@opentiny/vue-docs 3.18.1 → 3.18.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opentiny/vue-docs",
3
- "version": "3.18.1",
3
+ "version": "3.18.3",
4
4
  "license": "MIT",
5
5
  "dependencies": {
6
6
  "@opentiny/vue-repl": "^1.1.2",
@@ -17,17 +17,17 @@
17
17
  "vue-i18n": "^9.1.10",
18
18
  "vue-router": "4.1.5",
19
19
  "@opentiny/vue": "~3.18.0",
20
+ "@opentiny/vue-directive": "~3.18.0",
20
21
  "@opentiny/vue-design-smb": "~3.18.0",
21
- "@opentiny/vue-icon-saas": "~3.18.0",
22
- "@opentiny/vue-common": "~3.18.0",
23
22
  "@opentiny/vue-design-aurora": "~3.18.0",
23
+ "@opentiny/vue-common": "~3.18.0",
24
24
  "@opentiny/vue-design-saas": "~3.18.0",
25
- "@opentiny/vue-directive": "~3.18.0",
26
- "@opentiny/vue-theme": "~3.18.0",
27
- "@opentiny/vue-vite-import": "~1.2.0",
28
- "@opentiny/vue-theme-mobile": "~3.18.0",
29
25
  "@opentiny/vue-icon": "~3.18.0",
30
- "@opentiny/vue-theme-saas": "~3.18.0"
26
+ "@opentiny/vue-icon-saas": "~3.18.0",
27
+ "@opentiny/vue-theme": "~3.18.1",
28
+ "@opentiny/vue-theme-saas": "~3.18.0",
29
+ "@opentiny/vue-vite-import": "~1.2.0",
30
+ "@opentiny/vue-theme-mobile": "~3.18.0"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@playwright/test": "~1.42.0",
@@ -39,6 +39,7 @@
39
39
  "@vue/compiler-sfc": "^3.2.37",
40
40
  "chalk": "4.1.2",
41
41
  "cross-spawn": "^7.0.3",
42
+ "fast-glob": "^3.2.12",
42
43
  "fs-extra": "^10.1.0",
43
44
  "less": "^4.1.3",
44
45
  "markdown-it": "^13.0.1",
@@ -88,7 +88,7 @@
88
88
 
89
89
  <script>
90
90
  import { defineComponent, reactive, toRefs, onMounted, onUnmounted, watch, nextTick, ref } from 'vue'
91
- import { Tooltip, Radio, RadioGroup, Popover } from '@opentiny/vue'
91
+ import { Tooltip, Radio, RadioGroup, Popover, Notify } from '@opentiny/vue'
92
92
  import { iconUpWard } from '@opentiny/vue-icon'
93
93
  import debounce from '@opentiny/vue-renderless/common/deps/debounce'
94
94
  import { i18nByKey, useApiMode, useTemplateMode } from '@/tools'
@@ -129,6 +129,17 @@ export default defineComponent({
129
129
  initBottomVal: null, // 初始底部偏移
130
130
  isSettingsAside: false // 是否贴边
131
131
  })
132
+ let isShowTip = false
133
+ const showTip = () => {
134
+ Notify({
135
+ type: 'info',
136
+ title: '请注意',
137
+ message: '主题切换成功,如有部分主题样式不生效,请尝试手动刷新页面即可',
138
+ position: 'top-right',
139
+ duration: 3000
140
+ })
141
+ isShowTip = true
142
+ }
132
143
 
133
144
  if (isPlus) {
134
145
  state.styleSettings = state.styleSettings.filter((item) => item.name !== 'apiMode')
@@ -164,6 +175,10 @@ export default defineComponent({
164
175
  themeItemClick(node) {
165
176
  const val = node?.value || 'tiny-smb-theme'
166
177
  changeTheme(val)
178
+
179
+ if (!isShowTip) {
180
+ showTip()
181
+ }
167
182
  }
168
183
  }
169
184
 
package/vite.config.ts CHANGED
@@ -13,6 +13,30 @@ import vue3SvgPlugin from 'vite-svg-loader'
13
13
  import { getAlias, pathFromWorkspaceRoot, getOptimizeDeps } from '../../internals/cli/src/config/vite'
14
14
  import virtualTemplatePlugin from '@opentiny-internal/unplugin-virtual-template/vite'
15
15
  import tailwindCss from 'tailwindcss'
16
+ import fg from 'fast-glob'
17
+ import fs from 'fs-extra'
18
+
19
+ const delStatic = () => {
20
+ let config
21
+ return {
22
+ name: 'inline-plugin-del-static',
23
+ apply: 'build',
24
+ configResolved(_config) {
25
+ config = _config
26
+ },
27
+ async closeBundle() {
28
+ const targetPath = path.join(config.build.outDir, '@demos')
29
+ const files = await fg(['**/*.spec.js', '**/*.spec.ts'], {
30
+ dot: true,
31
+ cwd: targetPath
32
+ })
33
+ files.forEach((filename) => {
34
+ const filePath = path.join(targetPath, filename)
35
+ fs.unlink(filePath)
36
+ })
37
+ }
38
+ }
39
+ }
16
40
 
17
41
  export default defineConfig((config) => {
18
42
  const env = loadEnv(config.mode, process.cwd() + '/env', '')
@@ -23,17 +47,17 @@ export default defineConfig((config) => {
23
47
  const menuPath = isSaas ? path.resolve('./demos/saas') : path.resolve(demosPath)
24
48
  const copyTarget = [
25
49
  {
26
- src: `${demosPath}/**`,
50
+ src: `${demosPath}/*`,
27
51
  dest: '@demos'
28
52
  },
29
53
  {
30
- src: `${apisPath}/**`,
54
+ src: `${apisPath}/*`,
31
55
  dest: '@demos/apis'
32
56
  }
33
57
  ]
34
58
  if (isSaas) {
35
59
  copyTarget.push({
36
- src: `./demos/mobile-first/**`,
60
+ src: `./demos/mobile-first/*`,
37
61
  dest: '@demos/mobile-first'
38
62
  })
39
63
  }
@@ -75,7 +99,8 @@ export default defineConfig((config) => {
75
99
  Unocss(UnoCssConfig),
76
100
  viteStaticCopy({
77
101
  targets: copyTarget
78
- })
102
+ }),
103
+ delStatic()
79
104
  ],
80
105
  optimizeDeps: getOptimizeDeps(3),
81
106
  build: {