Support for directives
parent
b9b026df1a
commit
121b8fcb24
|
@ -82,6 +82,15 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
inject: ['designerService'],
|
inject: ['designerService'],
|
||||||
|
watch: {
|
||||||
|
$route: {
|
||||||
|
handler() {
|
||||||
|
if (!this.isComponentRoute && this.$appState.designer.activeTab === '2') {
|
||||||
|
this.$appState.designer.activeTab = '0';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
onKeyDown(event) {
|
onKeyDown(event) {
|
||||||
if (event.code === 'Enter' || event.code === 'NumpadEnter') {
|
if (event.code === 'Enter' || event.code === 'NumpadEnter') {
|
||||||
|
@ -92,9 +101,10 @@ export default {
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
isComponentRoute() {
|
isComponentRoute() {
|
||||||
const components = this.$appState.designer.theme?.preset?.components;
|
const components = this.$appState.designer.theme.preset.components;
|
||||||
|
const directives = this.$appState.designer.theme.preset.directives;
|
||||||
|
|
||||||
return components ? components[this.$route.name] != null : false;
|
return components[this.$route.name] != null || directives[this.$route.name];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -32,18 +32,19 @@ export default {
|
||||||
return this.$route.name;
|
return this.$route.name;
|
||||||
},
|
},
|
||||||
isComponentRoute() {
|
isComponentRoute() {
|
||||||
const components = this.$appState.designer.theme?.preset?.components;
|
const components = this.$appState.designer.theme.preset.components;
|
||||||
|
const directives = this.$appState.designer.theme.preset.directives;
|
||||||
|
|
||||||
return components ? components[this.componentKey] != null : false;
|
return components[this.componentKey] != null || directives[this.componentKey] != null;
|
||||||
},
|
},
|
||||||
tokens() {
|
tokens() {
|
||||||
return this.$appState.designer.theme?.preset?.components[this.componentKey];
|
return this.$appState.designer.theme.preset.components[this.componentKey] || this.$appState.designer.theme.preset.directives[this.componentKey];
|
||||||
},
|
},
|
||||||
lightTokens() {
|
lightTokens() {
|
||||||
return this.$appState.designer.theme?.preset?.components[this.componentKey].colorScheme.light;
|
return this.tokens.colorScheme?.light;
|
||||||
},
|
},
|
||||||
darkTokens() {
|
darkTokens() {
|
||||||
return this.$appState.designer.theme?.preset?.components[this.componentKey].colorScheme.dark;
|
return this.tokens.colorScheme?.dark;
|
||||||
},
|
},
|
||||||
hasColorScheme() {
|
hasColorScheme() {
|
||||||
return this.tokens.colorScheme != undefined;
|
return this.tokens.colorScheme != undefined;
|
||||||
|
|
|
@ -66,7 +66,9 @@ export default {
|
||||||
.join(' ');
|
.join(' ');
|
||||||
},
|
},
|
||||||
tokens() {
|
tokens() {
|
||||||
return this.getObjectProperty(this.$appState.designer.theme.preset.components[this.componentKey], this.path);
|
const source = this.$appState.designer.theme.preset.components[this.componentKey] || this.$appState.designer.theme.preset.directives[this.componentKey];
|
||||||
|
|
||||||
|
return this.getObjectProperty(source, this.path);
|
||||||
},
|
},
|
||||||
nestedTokens() {
|
nestedTokens() {
|
||||||
const groups = {};
|
const groups = {};
|
||||||
|
|
|
@ -38,7 +38,7 @@ export default {
|
||||||
inject: ['designerService'],
|
inject: ['designerService'],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
fontSizes: ['12px', '13px', '14px', '15px', '16px', '17px', '18px'],
|
fontSizes: ['12px', '13px', '14px', '15px', '16px'],
|
||||||
fonts: ['DM Sans', 'Inter var', 'Figtree', 'Lato', 'Lexend', 'Poppins', 'Public Sans', 'Raleway', 'Roboto', 'Open Sans', 'Quicksand']
|
fonts: ['DM Sans', 'Inter var', 'Figtree', 'Lato', 'Lexend', 'Poppins', 'Public Sans', 'Raleway', 'Roboto', 'Open Sans', 'Quicksand']
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue