palette importer/exporter

This commit is contained in:
Henry Jameson 2024-10-10 00:54:53 +03:00
parent 202d77e0cc
commit 0afe69ce28

View file

@ -28,7 +28,7 @@
<script setup> <script setup>
import ColorInput from 'src/components/color_input/color_input.vue' import ColorInput from 'src/components/color_input/color_input.vue'
import { import {
// newImporter, newImporter,
newExporter newExporter
} from 'src/services/export_import/export_import.js' } from 'src/services/export_import/export_import.js'
@ -46,23 +46,23 @@ library.add(
const props = defineProps(['modelValue']) const props = defineProps(['modelValue'])
const emit = defineEmits(['update:modelValue']) const emit = defineEmits(['update:modelValue'])
const paletteExporter = newExporter({ const paletteExporter = newExporter({
filename: 'pleroma.palette.json', filename: 'pleroma',
extension: 'palette.json',
getExportedObject: () => props.modelValue getExportedObject: () => props.modelValue
}) })
/* const paletteImporter = newImporter({
const themeImporter = newImporter({ accept: '.palette.json',
validator: importValidator, onImport (parsed, filename) {
onImport, emit('update:modelValue', parsed)
onImportFailure, }
}) })
*/
const exportPalette = () => { const exportPalette = () => {
paletteExporter.exportData() paletteExporter.exportData()
} }
const importPalette = () => { const importPalette = () => {
// TODO paletteImporter.importData()
} }
const paletteKeys = [ const paletteKeys = [