From 1c7e4f9bafae15a14dc844b5f35f17b8f7b74d4f Mon Sep 17 00:00:00 2001 From: Cagatay Civici Date: Fri, 27 Dec 2024 23:17:25 +0300 Subject: [PATCH] Adjustments to API updates --- .../components/layout/AppDesigner.vue | 36 ++------- .../designer/create/DesignCreateTheme.vue | 73 ++++++++++--------- .../designer/dashboard/DesignDashboard.vue | 26 ++++--- .../designer/editor/DesignEditorFooter.vue | 61 ++++++++++++++++ .../editor/custom/DesignCustomTokens.vue | 6 +- apps/showcase/plugins/app-state.js | 4 +- 6 files changed, 129 insertions(+), 77 deletions(-) create mode 100644 apps/showcase/components/layout/designer/editor/DesignEditorFooter.vue diff --git a/apps/showcase/components/layout/AppDesigner.vue b/apps/showcase/components/layout/AppDesigner.vue index bc9760df0..703a9186f 100644 --- a/apps/showcase/components/layout/AppDesigner.vue +++ b/apps/showcase/components/layout/AppDesigner.vue @@ -25,24 +25,7 @@ @@ -53,9 +36,10 @@ import { $dt } from '@primevue/themes'; export default { provide() { return { - designerUtils: { + designerService: { refreshACTokens: this.refreshACTokens, - saveTheme: this.saveTheme + saveTheme: this.saveTheme, + downloadTheme: this.downloadTheme } }; }, @@ -71,18 +55,9 @@ export default { onHide() { this.deferredTabs = true; }, - download() { + downloadTheme(theme) { // TODO: Fetch from endpoint }, - apply() { - saveTheme(); - updatePreset(this.$appState.designer.theme.preset); - EventBus.emit('theme-palette-change'); - }, - saveTheme() { - // TODO: Save to DB or Local Storage - console.log('theme saved'); - }, camelCaseToDotCase(name) { return name.replace(/([a-z])([A-Z])/g, '$1.$2').toLowerCase(); }, @@ -111,7 +86,6 @@ export default { refreshACTokens() { this.$appState.designer.theme.acTokens = []; this.generateACTokens(null, this.$appState.designer.theme.preset); - console.log('refresh tokens'); }, openDashboard() { this.$appState.designer.activeView = 'dashboard'; diff --git a/apps/showcase/components/layout/designer/create/DesignCreateTheme.vue b/apps/showcase/components/layout/designer/create/DesignCreateTheme.vue index 4bda91626..9b8c1d699 100644 --- a/apps/showcase/components/layout/designer/create/DesignCreateTheme.vue +++ b/apps/showcase/components/layout/designer/create/DesignCreateTheme.vue @@ -1,7 +1,7 @@