Переглянути джерело

chore: update `@pureadmin/theme` latest

xiaoxian521 2 роки тому
батько
коміт
66fdfebb5e
5 змінених файлів з 31 додано та 43 видалено
  1. 1 8
      build/plugins.ts
  2. 1 1
      package.json
  3. 25 25
      pnpm-lock.yaml
  4. 4 7
      src/layout/theme/index.ts
  5. 0 2
      types/shims-vue.d.ts

+ 1 - 8
build/plugins.ts

@@ -40,14 +40,7 @@ export function getPluginsList(
     themePreprocessorPlugin({
       scss: {
         multipleScopeVars: genScssMultipleScopeVars(),
-        // 在生产模式是否抽取独立的主题css文件,extract为true以下属性有效
-        extract: true,
-        // 会选取defaultScopeName对应的主题css文件在html添加link
-        themeLinkTagId: "head",
-        // "head"||"head-prepend" || "body" ||"body-prepend"
-        themeLinkTagInjectTo: "head",
-        // 是否对抽取的css文件内对应scopeName的权重类名移除
-        removeCssScopeName: false
+        extract: true
       }
     }),
     // svg组件化支持

+ 1 - 1
package.json

@@ -85,7 +85,7 @@
     "@iconify-icons/ri": "^1.2.3",
     "@iconify/vue": "^4.0.0",
     "@intlify/vite-plugin-vue-i18n": "^6.0.3",
-    "@pureadmin/theme": "^2.4.0",
+    "@pureadmin/theme": "^3.0.0",
     "@types/element-resize-detector": "1.1.3",
     "@types/intro.js": "^5.1.0",
     "@types/js-cookie": "^3.0.1",

+ 25 - 25
pnpm-lock.yaml

@@ -14,7 +14,7 @@ specifiers:
   "@logicflow/extension": ^1.1.30
   "@pureadmin/descriptions": ^1.1.0
   "@pureadmin/table": ^1.9.0
-  "@pureadmin/theme": ^2.4.0
+  "@pureadmin/theme": ^3.0.0
   "@pureadmin/utils": ^1.8.5
   "@types/element-resize-detector": 1.1.3
   "@types/intro.js": ^5.1.0
@@ -153,7 +153,7 @@ dependencies:
   vue-pdf-embed: 1.1.5_vue@3.2.45
   vue-router: 4.1.6_vue@3.2.45
   vue-types: 4.2.1_vue@3.2.45
-  vue-virtual-scroller: 2.0.0-beta.5_vue@3.2.45
+  vue-virtual-scroller: 2.0.0-beta.7_vue@3.2.45
   vue3-danmaku: 1.2.0_vue@3.2.45
   vuedraggable: 4.1.0_vue@3.2.45
   xgplayer: 2.32.2
@@ -163,16 +163,16 @@ devDependencies:
   "@commitlint/cli": 13.1.0
   "@commitlint/config-conventional": 13.1.0
   "@iconify-icons/ep": 1.2.10
-  "@iconify-icons/mdi": 1.2.34
+  "@iconify-icons/mdi": 1.2.35
   "@iconify-icons/ri": 1.2.4
   "@iconify/vue": 4.0.2_vue@3.2.45
   "@intlify/vite-plugin-vue-i18n": 6.0.3_vite@3.1.8+vue-i18n@9.2.2
-  "@pureadmin/theme": 2.4.0
+  "@pureadmin/theme": 3.0.0
   "@types/element-resize-detector": 1.1.3
   "@types/intro.js": 5.1.0
   "@types/js-cookie": 3.0.2
   "@types/mockjs": 1.0.7
-  "@types/node": 18.11.13
+  "@types/node": 18.11.15
   "@types/nprogress": 0.2.0
   "@types/qrcode": 1.5.0
   "@types/qs": 6.9.7
@@ -933,10 +933,10 @@ packages:
       vue: 3.2.45
     dev: false
 
-  /@humanwhocodes/config-array/0.11.7:
+  /@humanwhocodes/config-array/0.11.8:
     resolution:
       {
-        integrity: sha512-kBbPWzN8oVMLb0hOUYXhmxggL/1cJE6ydvjDIGi9EnAGUyA7cLVKQg+d/Dsm+KZwx2czGHrCmMVLiyg8s5JPKw==
+        integrity: sha512-UybHIJzJnR5Qc/MsD9Kr+RpO2h+/P1GhOwdiLPXK5TWk5sgTdu88bTD9UP+CKbPPh5Rni1u0GjAdYQLemG8g+g==
       }
     engines: { node: ">=10.10.0" }
     dependencies:
@@ -971,10 +971,10 @@ packages:
       "@iconify/types": 2.0.0
     dev: true
 
-  /@iconify-icons/mdi/1.2.34:
+  /@iconify-icons/mdi/1.2.35:
     resolution:
       {
-        integrity: sha512-3A7ezd/9mQKM9KEqR8QIfJaBWJ/HfZ3u45oy5/yU6FlTQrfRx+f+e0hD0nwAkbOptZmz2sFsGIfwBdX4Kl+JIw==
+        integrity: sha512-cOxQdQqMcV/CA3d2CkTFVRyvYRDE5SpX0Wekjl5lbEQ5IkAPy0hJrOebSH1Jo+IB8Nm3DbAT7xkj3TjgJ7VmEA==
       }
     dependencies:
       "@iconify/types": 2.0.0
@@ -1271,10 +1271,10 @@ packages:
       vue: 3.2.45
     dev: false
 
-  /@pureadmin/theme/2.4.0:
+  /@pureadmin/theme/3.0.0:
     resolution:
       {
-        integrity: sha512-aqX2O5WpqOCUiy6jhle92Pj7gDqF1/cHPWD+fWcDmmgmV7l7zqEDMWmZI1Iueg55fGxR39D400LaD2VrE8ihGA==
+        integrity: sha512-1qs0fve9DY4XgI5xafTd9qRPuWSo2QGON7avBqKSSSjXpCbo2BOccsH6qh5N2BxVBVZQJBYZoMq3bAUdK2Q0Jw==
       }
     dependencies:
       "@zougt/some-loader-utils": 1.4.3
@@ -1463,10 +1463,10 @@ packages:
       }
     dev: false
 
-  /@types/node/18.11.13:
+  /@types/node/18.11.15:
     resolution:
       {
-        integrity: sha512-IASpMGVcWpUsx5xBOrxMj7Bl8lqfuTY7FKAnPmu5cHkfQVWF8GulWS1jbRqA934qZL35xh5xN/+Xe/i26Bod4w==
+        integrity: sha512-VkhBbVo2+2oozlkdHXLrb3zjsRkpdnaU2bXmX8Wgle3PUi569eLRaHGlgETQHR7lLL1w7GiG3h9SnePhxNDecw==
       }
     dev: true
 
@@ -1497,7 +1497,7 @@ packages:
         integrity: sha512-x5ilHXRxUPIMfjtM+1vf/GPTRWZ81nqscursm5gMznJeK9M0YnZ1c3bEvRLQ0zSSgedLx1J6MGL231ObQGGhaA==
       }
     dependencies:
-      "@types/node": 18.11.13
+      "@types/node": 18.11.15
     dev: true
 
   /@types/qs/6.9.7:
@@ -1513,7 +1513,7 @@ packages:
         integrity: sha512-yy7HuzQhj0dhGpD8RLXSZWEkLsV9ibvxvi6EiJ3bkqLAO1RGo0WbkWQiwpRlSFymTJRz0d3k5LM3kkx8ArDbLw==
       }
     dependencies:
-      "@types/node": 18.11.13
+      "@types/node": 18.11.15
     dev: true
 
   /@types/semver/7.3.13:
@@ -2742,7 +2742,7 @@ packages:
     dependencies:
       caniuse-lite: 1.0.30001439
       electron-to-chromium: 1.4.284
-      node-releases: 2.0.6
+      node-releases: 2.0.7
       update-browserslist-db: 1.0.10_browserslist@4.21.4
     dev: true
 
@@ -3283,12 +3283,12 @@ packages:
       source-map-js: 1.0.2
     dev: true
 
-  /css-tree/2.3.0:
+  /css-tree/2.3.1:
     resolution:
       {
-        integrity: sha512-1rg0LiK2MFi4R3/lVvnRokEWTZb30ljSAe5x+0HHkZ+OqZaAeiP8g8Eh91VmkyCtQn9vMgQRiaTDYgLBt+2Qyw==
+        integrity: sha512-6Fv1DV/TYw//QF5IzQdqsNDjx/wc8TrMBZsqjL9eW01tWb7R7k/mq+/VXfJCl7SoD5emsJop9cOByJZfs8hYIw==
       }
-    engines: { node: ^10 || ^12.20.0 || ^14.13.0 || >=15.0.0, npm: ">=7.0.0" }
+    engines: { node: ^10 || ^12.20.0 || ^14.13.0 || >=15.0.0 }
     dependencies:
       mdn-data: 2.0.30
       source-map-js: 1.0.2
@@ -4358,7 +4358,7 @@ packages:
     hasBin: true
     dependencies:
       "@eslint/eslintrc": 1.3.3
-      "@humanwhocodes/config-array": 0.11.7
+      "@humanwhocodes/config-array": 0.11.8
       "@humanwhocodes/module-importer": 1.0.1
       "@nodelib/fs.walk": 1.2.8
       ajv: 6.12.6
@@ -6178,10 +6178,10 @@ packages:
       }
     dev: false
 
-  /node-releases/2.0.6:
+  /node-releases/2.0.7:
     resolution:
       {
-        integrity: sha512-PiVXnNuFm5+iYkLBNeq5211hvO38y63T0i2KKh2KnUs3RpzJ+JtODFjkD8yjLwnDkTYF1eKXheUwdssR+NRZdg==
+        integrity: sha512-EJ3rzxL9pTWPjk5arA0s0dgXpnyiAbJDE6wHT62g7VsgrgQgmmZ+Ru++M1BFofncWja+Pnn3rEr3fieRySAdKQ==
       }
     dev: true
 
@@ -8142,7 +8142,7 @@ packages:
       "@trysound/sax": 0.2.0
       commander: 7.2.0
       css-select: 5.1.0
-      css-tree: 2.3.0
+      css-tree: 2.3.1
       csso: 5.0.5
       picocolors: 1.0.0
     dev: true
@@ -8827,10 +8827,10 @@ packages:
       vue: 3.2.45
     dev: false
 
-  /vue-virtual-scroller/2.0.0-beta.5_vue@3.2.45:
+  /vue-virtual-scroller/2.0.0-beta.7_vue@3.2.45:
     resolution:
       {
-        integrity: sha512-P7m/8D/7bzu45gWqCflQxyZomWL4cy75AZXz73Ri43VYRiSx1hW8QNIGr6PoAR1kZAcEqHZwYlvM76gUDA3wdA==
+        integrity: sha512-OrouVj1i2939jaLjVfu8f5fsDlbzhAb4bOsYZYrAkpcVLylAmMoGtIL7eT3hJrdTiaKbwQpRdnv7DKf9Fn+tHg==
       }
     peerDependencies:
       vue: ^3.2.0

+ 4 - 7
src/layout/theme/index.ts

@@ -2,10 +2,7 @@
  * @description ⚠️:此文件仅供主题插件使用,请不要在此文件中导出别的工具函数(仅在页面加载前运行)
  */
 
-type MultipleScopeVarsItem = {
-  scopeName: string;
-  varsContent: string;
-};
+import { type multipleScopeVarsOptions } from "@pureadmin/theme";
 
 /** 预设主题色 */
 const themeColors = {
@@ -113,8 +110,8 @@ const themeColors = {
 /**
  * @description 将预设主题色处理成主题插件所需格式
  */
-export const genScssMultipleScopeVars = (): MultipleScopeVarsItem[] => {
-  const result = [] as MultipleScopeVarsItem[];
+export const genScssMultipleScopeVars = (): multipleScopeVarsOptions[] => {
+  const result = [] as multipleScopeVarsOptions[];
   Object.keys(themeColors).forEach(key => {
     result.push({
       scopeName: `layout-theme-${key}`,
@@ -129,7 +126,7 @@ export const genScssMultipleScopeVars = (): MultipleScopeVarsItem[] => {
         $menuTitleHover: ${themeColors[key].menuTitleHover} !default;
         $menuActiveBefore: ${themeColors[key].menuActiveBefore} !default;
       `
-    } as MultipleScopeVarsItem);
+    } as multipleScopeVarsOptions);
   });
   return result;
 };

+ 0 - 2
types/shims-vue.d.ts

@@ -9,7 +9,5 @@ declare module "*.scss" {
   export default scss;
 }
 
-declare module "@pureadmin/theme";
 declare module "vue-virtual-scroller";
 declare module "vuedraggable/src/vuedraggable";
-declare module "@pureadmin/theme/dist/browser-utils";