Update after directives move to components change

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

View File

@ -117,7 +117,7 @@ export default {
return colorScheme;
},
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.';
if (this.path.startsWith(colorSchemePrefix)) {

View File

@ -1,5 +1,5 @@
<template>
<section v-if="isComponentRoute">
<section>
<div class="text-lg font-semibold capitalize mb-2">{{ componentKey }}</div>
<Fieldset legend="Common" :toggleable="true" class="mb-3">
<div class="flex flex-col gap-3">
@ -38,14 +38,8 @@ export default {
componentKey() {
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() {
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() {
return this.tokens.colorScheme?.light;

View File

@ -66,7 +66,7 @@ export default {
.join(' ');
},
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);
},