From 2371c1c092b993004d12f7642ad5500fc234eee0 Mon Sep 17 00:00:00 2001 From: Nicolas Martinez <17040442+nicomt@users.noreply.github.com> Date: Thu, 6 Jun 2024 16:02:16 -0400 Subject: [PATCH 01/25] Filter environmet variables to prevent unintended leakage of environment variables. --- vite.config.mjs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/vite.config.mjs b/vite.config.mjs index f5cdf664..573cc8fa 100644 --- a/vite.config.mjs +++ b/vite.config.mjs @@ -5,8 +5,15 @@ import autoprefixer from 'autoprefixer' export default defineConfig(({ mode }) => { // Load .env - const env = loadEnv(mode, process.cwd(), '') - process.env = { ...process.env, ...env } + const viteEnv = loadEnv(mode, process.cwd(), '') + const env = {} + + // Filter env to variables starting with VITE_APP or VUE_APP + Object.keys({...process.env, ...viteEnv}).forEach(key => { + if (key.startsWith('VITE_APP') || key.startsWith('VUE_APP')) { + env[key] = viteEnv[key] + } + }) return { plugins: [vue()], @@ -53,7 +60,7 @@ export default defineConfig(({ mode }) => { }, define: { // vitejs does not support process.env so we have to redefine it - 'process.env': process.env, + 'process.env': env, }, } }) From 6b9c7c6ca8a88dda26469338988b217575c4fdcb Mon Sep 17 00:00:00 2001 From: Nicolas Martinez <17040442+nicomt@users.noreply.github.com> Date: Thu, 6 Jun 2024 16:12:25 -0400 Subject: [PATCH 02/25] Fix for loading data from both viteEnv and process.env --- vite.config.mjs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vite.config.mjs b/vite.config.mjs index 573cc8fa..81ec0d8e 100644 --- a/vite.config.mjs +++ b/vite.config.mjs @@ -9,9 +9,9 @@ export default defineConfig(({ mode }) => { const env = {} // Filter env to variables starting with VITE_APP or VUE_APP - Object.keys({...process.env, ...viteEnv}).forEach(key => { + Object.entries({...process.env, ...viteEnv}).forEach(([key, value]) => { if (key.startsWith('VITE_APP') || key.startsWith('VUE_APP')) { - env[key] = viteEnv[key] + env[key] = value } }) From 9bbf7509e15c02488232c3b268e0b08e0b9e740a Mon Sep 17 00:00:00 2001 From: mrholek Date: Fri, 7 Jun 2024 10:41:36 +0200 Subject: [PATCH 03/25] docs: update links to PRO versions --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 9a4e2123..f711b518 100644 --- a/README.md +++ b/README.md @@ -47,6 +47,7 @@ CoreUI is meant to be the UX game changer. Pure & transparent code is devoid of * 💪 [CoreUI PRO Angular Admin Template](https://coreui.io/product/angular-dashboard-template/) * 💪 [CoreUI PRO Bootstrap Admin Template](https://coreui.io/product/bootstrap-dashboard-template/) +* 💪 [CoreUI PRO Next.js Admin Template](https://coreui.io/product/next-js-dashboard-template/) * 💪 [CoreUI PRO React Admin Template](https://coreui.io/product/react-dashboard-template/) * 💪 [CoreUI PRO Vue Admin Template](https://coreui.io/product/vue-dashboard-template/) From dfa4381ce13433a7b48056ecfe7b204755665581 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Holeczek?= Date: Fri, 14 Jun 2024 13:10:02 +0200 Subject: [PATCH 04/25] Update vite.config.mjs --- vite.config.mjs | 34 +++++----------------------------- 1 file changed, 5 insertions(+), 29 deletions(-) diff --git a/vite.config.mjs b/vite.config.mjs index 81ec0d8e..7195c8b7 100644 --- a/vite.config.mjs +++ b/vite.config.mjs @@ -1,29 +1,18 @@ -import { defineConfig, loadEnv } from 'vite' +import { defineConfig } from 'vite' import vue from '@vitejs/plugin-vue' import path from 'node:path' import autoprefixer from 'autoprefixer' -export default defineConfig(({ mode }) => { - // Load .env - const viteEnv = loadEnv(mode, process.cwd(), '') - const env = {} - - // Filter env to variables starting with VITE_APP or VUE_APP - Object.entries({...process.env, ...viteEnv}).forEach(([key, value]) => { - if (key.startsWith('VITE_APP') || key.startsWith('VUE_APP')) { - env[key] = value - } - }) - +export default defineConfig(() => { return { plugins: [vue()], base: './', css: { postcss: { plugins: [ - autoprefixer({}) // add options if needed + autoprefixer({}), // add options if needed ], - } + }, }, resolve: { alias: [ @@ -41,16 +30,7 @@ export default defineConfig(({ mode }) => { replacement: path.resolve(__dirname, '/src'), }, ], - extensions: [ - '.mjs', - '.js', - '.ts', - '.jsx', - '.tsx', - '.json', - '.vue', - '.scss', - ], + extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json', '.vue', '.scss'], }, server: { port: 3000, @@ -58,9 +38,5 @@ export default defineConfig(({ mode }) => { // https://vitejs.dev/config/server-options.html }, }, - define: { - // vitejs does not support process.env so we have to redefine it - 'process.env': env, - }, } }) From 625122693588c564b734165381b758bfab1bc0d4 Mon Sep 17 00:00:00 2001 From: mrholek Date: Fri, 14 Jun 2024 13:17:48 +0200 Subject: [PATCH 05/25] chore: update dependencies and devDependencies MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @coreui/coreui ^5.0.0 → ^5.0.2 @coreui/vue ^5.0.0 → ^5.1.0 @vitejs/plugin-vue ^5.0.4 → ^5.0.5 chart.js ^4.4.2 → ^4.4.3 eslint-plugin-vue ^9.24.0 → ^9.26.0 sass ^1.72.0 → ^1.77.5 simplebar-vue ^2.3.3 → ^2.3.5 vite ^5.2.6 → ^5.3.1 vue ^3.4.21 → ^3.4.28 vue-router ^4.3.0 → ^4.3.3 --- package.json | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index 3b5b531a..cc0d6867 100644 --- a/package.json +++ b/package.json @@ -19,26 +19,26 @@ }, "dependencies": { "@coreui/chartjs": "^4.0.0", - "@coreui/coreui": "^5.0.0", + "@coreui/coreui": "^5.0.2", "@coreui/icons": "^3.0.1", "@coreui/icons-vue": "2.0.0", "@coreui/utils": "^2.0.2", - "@coreui/vue": "^5.0.0", + "@coreui/vue": "^5.1.0", "@coreui/vue-chartjs": "^3.0.0", "@popperjs/core": "^2.11.8", - "chart.js": "^4.4.2", + "chart.js": "^4.4.3", "pinia": "^2.1.7", - "simplebar-vue": "^2.3.3", - "vue": "^3.4.21", - "vue-router": "^4.3.0" + "simplebar-vue": "^2.3.5", + "vue": "^3.4.28", + "vue-router": "^4.3.3" }, "devDependencies": { - "@vitejs/plugin-vue": "^5.0.4", + "@vitejs/plugin-vue": "^5.0.5", "autoprefixer": "^10.4.19", "eslint": "^8.57.0", - "eslint-plugin-vue": "^9.24.0", + "eslint-plugin-vue": "^9.26.0", "postcss": "^8.4.38", - "sass": "^1.72.0", - "vite": "^5.2.6" + "sass": "^1.77.5", + "vite": "^5.3.1" } } From 85c9e1705626e79defb761f9560c8ae6d4bb9ad9 Mon Sep 17 00:00:00 2001 From: mrholek Date: Fri, 14 Jun 2024 13:18:42 +0200 Subject: [PATCH 06/25] fix: security problem with process.env --- src/router/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/router/index.js b/src/router/index.js index f70246f6..948de201 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -303,7 +303,7 @@ const routes = [ ] const router = createRouter({ - history: createWebHashHistory(process.env.BASE_URL), + history: createWebHashHistory(import.meta.env.BASE_URL), routes, scrollBehavior() { // always scroll to top From 953c231f28a1848ba192b87b5214bf8418e3dc16 Mon Sep 17 00:00:00 2001 From: mrholek Date: Fri, 14 Jun 2024 16:09:10 +0200 Subject: [PATCH 07/25] feat: add new tabs component --- src/_nav.js | 5 ++ src/router/index.js | 5 ++ src/views/base/Tabs.vue | 162 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 172 insertions(+) create mode 100644 src/views/base/Tabs.vue diff --git a/src/_nav.js b/src/_nav.js index 3433bdaf..4ac304af 100644 --- a/src/_nav.js +++ b/src/_nav.js @@ -100,6 +100,11 @@ export default [ name: 'Tables', to: '/base/tables', }, + { + component: 'CNavItem', + name: 'Tabs', + to: '/base/tabs', + }, { component: 'CNavItem', name: 'Tooltips', diff --git a/src/router/index.js b/src/router/index.js index 948de201..add55d6f 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -111,6 +111,11 @@ const routes = [ name: 'Tables', component: () => import('@/views/base/Tables.vue'), }, + { + path: '/base/tabs', + name: 'Tabs', + component: () => import('@/views/base/Tabs.vue'), + }, { path: '/base/tooltips', name: 'Tooltips', diff --git a/src/views/base/Tabs.vue b/src/views/base/Tabs.vue new file mode 100644 index 00000000..0460be0f --- /dev/null +++ b/src/views/base/Tabs.vue @@ -0,0 +1,162 @@ + From ee8cab33d9ce117d7289a9ec46eb77203bc203ac Mon Sep 17 00:00:00 2001 From: mrholek Date: Fri, 14 Jun 2024 16:15:41 +0200 Subject: [PATCH 08/25] release: v5.1.0 --- index.html | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index 1c4aae12..5cb553c6 100644 --- a/index.html +++ b/index.html @@ -1,7 +1,7 @@ From 10252d534a997a7298877c090484c5265046ff2e Mon Sep 17 00:00:00 2001 From: mrholek Date: Fri, 14 Feb 2025 13:03:09 +0100 Subject: [PATCH 22/25] chore: update dependencies and devDependencies MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @coreui/chartjs ^4.0.0 → ^4.1.0 @coreui/coreui ^5.2.0 → ^5.3.1 --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 47a20345..8344ee88 100644 --- a/package.json +++ b/package.json @@ -18,8 +18,8 @@ "preview": "vite preview" }, "dependencies": { - "@coreui/chartjs": "^4.0.0", - "@coreui/coreui": "^5.2.0", + "@coreui/chartjs": "^4.1.0", + "@coreui/coreui": "^5.3.1", "@coreui/icons": "^3.0.1", "@coreui/icons-vue": "2.2.0", "@coreui/utils": "^2.0.2", From ff804af0367aa655e43fe212188df67640b8beee Mon Sep 17 00:00:00 2001 From: mrholek Date: Fri, 14 Feb 2025 13:17:16 +0100 Subject: [PATCH 23/25] refactor: migrate to Sass modules and CSS logical properties and values --- src/App.vue | 4 +-- src/styles/_custom.scss | 1 - src/styles/_theme.scss | 64 --------------------------------- src/styles/_variables.scss | 5 --- src/styles/examples.scss | 21 +++++------ src/styles/style.scss | 74 ++++++++++++++++++++++++++++++++------ vite.config.mjs | 6 ---- 7 files changed, 73 insertions(+), 102 deletions(-) delete mode 100644 src/styles/_custom.scss delete mode 100644 src/styles/_theme.scss delete mode 100644 src/styles/_variables.scss diff --git a/src/App.vue b/src/App.vue index b06f287b..a095fda4 100644 --- a/src/App.vue +++ b/src/App.vue @@ -36,7 +36,7 @@ onBeforeMount(() => { diff --git a/src/styles/_custom.scss b/src/styles/_custom.scss deleted file mode 100644 index 15d367af..00000000 --- a/src/styles/_custom.scss +++ /dev/null @@ -1 +0,0 @@ -// Here you can add other styles diff --git a/src/styles/_theme.scss b/src/styles/_theme.scss deleted file mode 100644 index 49e1c79e..00000000 --- a/src/styles/_theme.scss +++ /dev/null @@ -1,64 +0,0 @@ -body { - background-color: var(--cui-tertiary-bg); -} - -.wrapper { - width: 100%; - @include ltr-rtl("padding-left", var(--cui-sidebar-occupy-start, 0)); - @include ltr-rtl("padding-right", var(--cui-sidebar-occupy-end, 0)); - will-change: auto; - @include transition(padding .15s); -} - -.header > .container-fluid, -.sidebar-header { - min-height: calc(4rem + 1px); // stylelint-disable-line function-disallowed-list -} - -.sidebar-brand-full { - margin-left: 3px; -} - -.sidebar-header { - .nav-underline-border { - --cui-nav-underline-border-link-padding-x: 1rem; - --cui-nav-underline-border-gap: 0; - } - - .nav-link { - display: flex; - align-items: center; - min-height: calc(4rem + 1px); // stylelint-disable-line function-disallowed-list - } -} - -.sidebar-toggler { - @include ltr-rtl("margin-left", auto); -} - -.sidebar-narrow, -.sidebar-narrow-unfoldable:not(:hover) { - .sidebar-toggler { - @include ltr-rtl("margin-right", auto); - } -} - -.header > .container-fluid + .container-fluid { - min-height: 3rem; -} - -.footer { - min-height: calc(3rem + 1px); // stylelint-disable-line function-disallowed-list -} - -@if $enable-dark-mode { - @include color-mode(dark) { - body { - background-color: var(--cui-dark-bg-subtle); - } - - .footer { - --cui-footer-bg: var(--cui-body-bg); - } - } -} diff --git a/src/styles/_variables.scss b/src/styles/_variables.scss deleted file mode 100644 index b0f8a52a..00000000 --- a/src/styles/_variables.scss +++ /dev/null @@ -1,5 +0,0 @@ -// Variable overrides -// -// If you want to customize your project please add your variables below. - -$enable-deprecation-messages: false !default; diff --git a/src/styles/examples.scss b/src/styles/examples.scss index 375fa9a5..7dfe7323 100644 --- a/src/styles/examples.scss +++ b/src/styles/examples.scss @@ -1,10 +1,7 @@ -/* stylelint-disable declaration-no-important, scss/selector-no-redundant-nesting-selector */ - -$enable-deprecation-messages: false !default; - -@import "@coreui/coreui/scss/functions"; -@import "@coreui/coreui/scss/variables"; -@import "@coreui/coreui/scss/mixins"; +/* stylelint-disable scss/selector-no-redundant-nesting-selector */ +@use "@coreui/coreui/scss/variables" as *; +@use "@coreui/coreui/scss/mixins/breakpoints" as *; +@use "@coreui/coreui/scss/mixins/color-mode" as *; .example { &:not(:first-child) { @@ -110,10 +107,8 @@ $enable-deprecation-messages: false !default; } } -@if $enable-dark-mode { - @include color-mode(dark) { - .example .tab-content { - background-color: var(--#{$prefix}secondary-bg) !important; - } +@include color-mode(dark) { + .example .tab-content { + background-color: var(--#{$prefix}secondary-bg) !important; } -} \ No newline at end of file +} diff --git a/src/styles/style.scss b/src/styles/style.scss index 4fbc8235..cf48cfdb 100644 --- a/src/styles/style.scss +++ b/src/styles/style.scss @@ -1,15 +1,67 @@ -// If you want to override variables do it here -@import "variables"; +@use "@coreui/coreui/scss/coreui" as * with ( + $enable-deprecation-messages: false +); +@use "@coreui/chartjs/scss/coreui-chartjs"; +@use "vendors/simplebar"; -// Import styles -@import "@coreui/coreui/scss/coreui"; -@import "@coreui/chartjs/scss/coreui-chartjs"; +body { + background-color: var(--cui-tertiary-bg); +} -// Vendors -@import "vendors/simplebar"; +.wrapper { + width: 100%; + padding-inline: var(--cui-sidebar-occupy-start, 0) var(--cui-sidebar-occupy-end, 0); + will-change: auto; + @include transition(padding .15s); +} -// Custom styles for this theme -@import "theme"; +.header > .container-fluid, +.sidebar-header { + min-height: calc(4rem + 1px); // stylelint-disable-line function-disallowed-list +} -// If you want to add custom CSS you can put it here -@import "custom"; +.sidebar-brand-full { + margin-left: 3px; +} + +.sidebar-header { + .nav-underline-border { + --cui-nav-underline-border-link-padding-x: 1rem; + --cui-nav-underline-border-gap: 0; + } + + .nav-link { + display: flex; + align-items: center; + min-height: calc(4rem + 1px); // stylelint-disable-line function-disallowed-list + } +} + +.sidebar-toggler { + margin-inline-start: auto; +} + +.sidebar-narrow, +.sidebar-narrow-unfoldable:not(:hover) { + .sidebar-toggler { + margin-inline-end: auto; + } +} + +.header > .container-fluid + .container-fluid { + min-height: 3rem; +} + +.footer { + min-height: calc(3rem + 1px); // stylelint-disable-line function-disallowed-list +} + +@include color-mode(dark) { + body { + background-color: var(--cui-dark-bg-subtle); + } + + .footer { + --cui-footer-bg: var(--cui-body-bg); + } +} diff --git a/vite.config.mjs b/vite.config.mjs index 6fc2bd88..7195c8b7 100644 --- a/vite.config.mjs +++ b/vite.config.mjs @@ -13,12 +13,6 @@ export default defineConfig(() => { autoprefixer({}), // add options if needed ], }, - preprocessorOptions: { - scss: { - quietDeps: true, - silenceDeprecations: ['import', 'legacy-js-api'], - }, - }, }, resolve: { alias: [ From 5f517fd123cb8f9c0bc560e13c8f06bea7d5dac4 Mon Sep 17 00:00:00 2001 From: mrholek Date: Fri, 14 Feb 2025 13:27:16 +0100 Subject: [PATCH 24/25] chore: clean-up --- src/styles/examples.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/styles/examples.scss b/src/styles/examples.scss index 7dfe7323..dbfe258f 100644 --- a/src/styles/examples.scss +++ b/src/styles/examples.scss @@ -109,6 +109,6 @@ @include color-mode(dark) { .example .tab-content { - background-color: var(--#{$prefix}secondary-bg) !important; + background-color: var(--#{$prefix}secondary-bg); } } From f4a09815b6e5082594472b74998cadfb9c852474 Mon Sep 17 00:00:00 2001 From: mrholek Date: Fri, 14 Feb 2025 13:56:35 +0100 Subject: [PATCH 25/25] release: v5.3.0 --- index.html | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index c3c244de..2d8d8ef1 100644 --- a/index.html +++ b/index.html @@ -1,7 +1,7 @@