logo

pleroma-fe

My custom branche(s) on git.pleroma.social/pleroma/pleroma-fe git clone https://anongit.hacktivis.me/git/pleroma-fe.git/
commit: 0afe69ce28d48c201f21932d11fb763da5e7ec56
parent 202d77e0ccc1e14a68ba9f90a0ec17080dfad0dd
Author: Henry Jameson <me@hjkos.com>
Date:   Thu, 10 Oct 2024 00:54:53 +0300

palette importer/exporter

Diffstat:

Msrc/components/palette_editor/palette_editor.vue20++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)

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