From 7e684ea3ff67803e4dd419f9db561fc52fd9893f Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Sun, 6 Oct 2024 03:32:08 +0300 Subject: [PATCH] proper exporter --- .../tabs/style_tab/style_tab.js | 23 +++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/src/components/settings_modal/tabs/style_tab/style_tab.js b/src/components/settings_modal/tabs/style_tab/style_tab.js index 9c51c8ea..2a29744d 100644 --- a/src/components/settings_modal/tabs/style_tab/style_tab.js +++ b/src/components/settings_modal/tabs/style_tab/style_tab.js @@ -17,12 +17,16 @@ import ContrastRatio from 'src/components/contrast_ratio/contrast_ratio.vue' import { init } from 'src/services/theme_data/theme_data_3.service.js' import { getCssRules } from 'src/services/theme_data/css_utils.js' import { serialize } from 'src/services/theme_data/iss_serializer.js' -import { deserialize } from 'src/services/theme_data/iss_deserializer.js' +// import { deserialize } from 'src/services/theme_data/iss_deserializer.js' import { // rgb2hex, hex2rgb, getContrastRatio } from 'src/services/color_convert/color_convert.js' +import { + // newImporter, + newExporter +} from 'src/services/export_import/export_import.js' import { library } from '@fortawesome/fontawesome-svg-core' import { faFloppyDisk, faFolderOpen, faFile } from '@fortawesome/free-solid-svg-icons' @@ -492,18 +496,19 @@ export default { isShadowTabOpen.value = tab === 'shadow' } - const exportStyle = () => { - console.log('ORIG', toValue(editorFriendlyToOriginal.value)) - console.log('SERI', serialize(editorFriendlyToOriginal.value)) - - const result = [ + const styleExporter = newExporter({ + filename: 'pleroma.palette.json', + getExportedObject: () => exportStyleData + }) + const exportStyleData = computed(() => { + return [ metaOut.value, palettesOut.value, serialize(editorFriendlyToOriginal.value) ].join('\n\n') - - console.log('RESULT', result) - console.log('DESERI', deserialize(result)) + }) + const exportStyle = () => { + styleExporter.exportData() } return {