Update after directives move to components change

pull/6454/merge
Cagatay Civici 2025-01-13 13:32:47 +03:00
parent 3e7739b1e7
commit a255bd1778
4 changed files with 6 additions and 15 deletions

View File

@ -59,7 +59,7 @@
</Accordion> </Accordion>
</TabPanel> </TabPanel>
<TabPanel value="2"> <TabPanel value="2">
<form @keydown="onKeyDown"> <form v-if="isComponentRoute" @keydown="onKeyDown">
<DesignComponent /> <DesignComponent />
</form> </form>
</TabPanel> </TabPanel>
@ -101,10 +101,7 @@ export default {
}, },
computed: { computed: {
isComponentRoute() { isComponentRoute() {
const components = this.$appState.designer.theme.preset.components; return this.$appState.designer.theme.preset?.components[this.$route.name] != null;
const directives = this.$appState.designer.theme.preset.directives;
return components[this.$route.name] != null || directives[this.$route.name];
} }
} }
}; };

View File

@ -117,7 +117,7 @@ export default {
return colorScheme; return colorScheme;
}, },
transfer(event) { transfer(event) {
let tokens = this.$appState.designer.theme.preset.components[this.componentKey] || this.$appState.designer.theme.preset.directives[this.componentKey]; let tokens = this.$appState.designer.theme.preset.components[this.componentKey];
const colorSchemePrefix = 'colorScheme.'; const colorSchemePrefix = 'colorScheme.';
if (this.path.startsWith(colorSchemePrefix)) { if (this.path.startsWith(colorSchemePrefix)) {

View File

@ -1,5 +1,5 @@
<template> <template>
<section v-if="isComponentRoute"> <section>
<div class="text-lg font-semibold capitalize mb-2">{{ componentKey }}</div> <div class="text-lg font-semibold capitalize mb-2">{{ componentKey }}</div>
<Fieldset legend="Common" :toggleable="true" class="mb-3"> <Fieldset legend="Common" :toggleable="true" class="mb-3">
<div class="flex flex-col gap-3"> <div class="flex flex-col gap-3">
@ -38,14 +38,8 @@ export default {
componentKey() { componentKey() {
return this.$route.name; return this.$route.name;
}, },
isComponentRoute() {
const components = this.$appState.designer.theme.preset.components;
const directives = this.$appState.designer.theme.preset.directives;
return components[this.componentKey] != null || directives[this.componentKey] != null;
},
tokens() { tokens() {
return this.$appState.designer.theme.preset.components[this.componentKey] || this.$appState.designer.theme.preset.directives[this.componentKey]; return this.$appState.designer.theme.preset.components[this.componentKey];
}, },
lightTokens() { lightTokens() {
return this.tokens.colorScheme?.light; return this.tokens.colorScheme?.light;

View File

@ -66,7 +66,7 @@ export default {
.join(' '); .join(' ');
}, },
tokens() { tokens() {
const source = this.$appState.designer.theme.preset.components[this.componentKey] || this.$appState.designer.theme.preset.directives[this.componentKey]; const source = this.$appState.designer.theme.preset.components[this.componentKey];
return this.getObjectProperty(source, this.path); return this.getObjectProperty(source, this.path);
}, },