proper exporter

This commit is contained in:
Henry Jameson 2024-10-06 03:32:08 +03:00
parent 0f2bd39db8
commit 7e684ea3ff

View file

@ -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 { init } from 'src/services/theme_data/theme_data_3.service.js'
import { getCssRules } from 'src/services/theme_data/css_utils.js' import { getCssRules } from 'src/services/theme_data/css_utils.js'
import { serialize } from 'src/services/theme_data/iss_serializer.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 { import {
// rgb2hex, // rgb2hex,
hex2rgb, hex2rgb,
getContrastRatio getContrastRatio
} from 'src/services/color_convert/color_convert.js' } 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 { library } from '@fortawesome/fontawesome-svg-core'
import { faFloppyDisk, faFolderOpen, faFile } from '@fortawesome/free-solid-svg-icons' import { faFloppyDisk, faFolderOpen, faFile } from '@fortawesome/free-solid-svg-icons'
@ -492,18 +496,19 @@ export default {
isShadowTabOpen.value = tab === 'shadow' isShadowTabOpen.value = tab === 'shadow'
} }
const exportStyle = () => { const styleExporter = newExporter({
console.log('ORIG', toValue(editorFriendlyToOriginal.value)) filename: 'pleroma.palette.json',
console.log('SERI', serialize(editorFriendlyToOriginal.value)) getExportedObject: () => exportStyleData
})
const result = [ const exportStyleData = computed(() => {
return [
metaOut.value, metaOut.value,
palettesOut.value, palettesOut.value,
serialize(editorFriendlyToOriginal.value) serialize(editorFriendlyToOriginal.value)
].join('\n\n') ].join('\n\n')
})
console.log('RESULT', result) const exportStyle = () => {
console.log('DESERI', deserialize(result)) styleExporter.exportData()
} }
return { return {