@opentiny/vue-docs 3.26.7 → 3.26.8

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,7 +1,7 @@
1
1
  {
2
2
  "name": "@opentiny/vue-docs",
3
3
  "type": "module",
4
- "version": "3.26.7",
4
+ "version": "3.26.8",
5
5
  "license": "MIT",
6
6
  "dependencies": {
7
7
  "@docsearch/css": "^3.8.0",
@@ -28,20 +28,20 @@
28
28
  "vue-router": "4.1.5",
29
29
  "zod": "^3.24.4",
30
30
  "@opentiny/utils": "~3.26.0",
31
- "@opentiny/vue": "~3.26.0",
32
31
  "@opentiny/vue-common": "~3.26.0",
32
+ "@opentiny/vue": "~3.26.0",
33
33
  "@opentiny/vue-design-aurora": "~3.26.0",
34
34
  "@opentiny/vue-design-saas": "~3.26.0",
35
35
  "@opentiny/vue-design-smb": "~3.26.0",
36
+ "@opentiny/vue-flowchart": "~3.26.0",
36
37
  "@opentiny/vue-directive": "~3.26.0",
37
38
  "@opentiny/vue-hooks": "~3.26.0",
38
- "@opentiny/vue-flowchart": "~3.26.0",
39
+ "@opentiny/vue-icon": "~3.26.0",
39
40
  "@opentiny/vue-huicharts": "~3.26.0",
40
41
  "@opentiny/vue-icon-multicolor": "~3.26.0",
41
- "@opentiny/vue-icon": "~3.26.0",
42
42
  "@opentiny/vue-locale": "~3.26.0",
43
- "@opentiny/vue-icon-saas": "~3.26.0",
44
43
  "@opentiny/vue-modal": "~3.26.0",
44
+ "@opentiny/vue-icon-saas": "~3.26.0",
45
45
  "@opentiny/vue-renderless": "~3.26.0",
46
46
  "@opentiny/vue-theme": "~3.26.0",
47
47
  "@opentiny/vue-theme-saas": "~3.26.2"
package/src/App.vue CHANGED
@@ -14,6 +14,7 @@
14
14
  import { onMounted, provide, ref } from 'vue'
15
15
  import { TinyConfigProvider, TinyModal } from '@opentiny/vue'
16
16
  import { iconClose } from '@opentiny/vue-icon'
17
+ import { isSaas } from './const'
17
18
 
18
19
  import useTheme from './tools/useTheme'
19
20
 
@@ -24,7 +25,7 @@ const tinyIconClose = iconClose()
24
25
  onMounted(() => {
25
26
  // 加载header
26
27
  const common = new window.TDCommon(['#header'], {
27
- allowDarkTheme: true,
28
+ allowDarkTheme: !isSaas,
28
29
  searchConfig: {
29
30
  show: true
30
31
  },
@@ -2,11 +2,11 @@
2
2
  <div v-if="links.length" class="cmp-page-anchor catalog">
3
3
  <tiny-anchor
4
4
  id="anchor"
5
- :tiny_mode="theme === 'saas' ? 'pc' : 'mobile-first'"
5
+ :tiny_mode="isSaas ? 'pc' : 'mobile-first'"
6
6
  :offset-top="56"
7
7
  :links="links"
8
8
  :is-affix="props.anchorAffix"
9
- :type="theme === 'saas' ? 'line' : 'dot'"
9
+ :type="isSaas ? 'line' : 'dot'"
10
10
  container-id="#doc-layout-scroller"
11
11
  @link-click="handleAnchorClick"
12
12
  >
@@ -17,13 +17,12 @@
17
17
  <script setup lang="ts">
18
18
  import { computed } from 'vue'
19
19
  import { TinyAnchor } from '@opentiny/vue'
20
+ import { isSaas } from '../const'
20
21
 
21
22
  const props = defineProps({ anchorAffix: {}, currentJson: {}, activeTab: {}, langKey: {}, apiTypes: {} })
22
23
 
23
24
  const emit = defineEmits(['link-click'])
24
25
 
25
- const theme = import.meta.env.VITE_TINY_THEME
26
-
27
26
  // 实例锚点
28
27
  const demoAnchorLinks = computed(() => {
29
28
  const links =
package/src/const.ts CHANGED
@@ -1,5 +1,7 @@
1
1
  import { tinyOldTheme, tinyAuroraTheme, tinyDarkTheme } from '@opentiny/vue-theme/theme-tool'
2
2
 
3
+ export const isSaas = import.meta.env.VITE_TINY_THEME === 'saas'
4
+
3
5
  // localStorage中保存语言的key
4
6
  export const LANG_KEY = '_lang'
5
7
  // localStorage中保存语言的value
package/src/main.js CHANGED
@@ -20,7 +20,7 @@ import { i18n } from './i18n/index'
20
20
  import { router } from './router'
21
21
  import App from './App.vue'
22
22
  import { appData } from './tools'
23
- import { ZH_CN_LANG, EN_US_LANG, LANG_PATH_MAP, ES_LA_LANG, PT_BR_LANG } from './const'
23
+ import { ZH_CN_LANG, EN_US_LANG, LANG_PATH_MAP, ES_LA_LANG, PT_BR_LANG, isSaas } from './const'
24
24
  import demoConfig from '@demos/config.js'
25
25
 
26
26
  import hljs from 'highlight.js/lib/core'
@@ -38,9 +38,6 @@ import { t } from '@opentiny/vue-locale'
38
38
  import { registerMcpConfig, customDesignConfig } from '@opentiny/vue-common'
39
39
  import { twMerge } from 'tailwind-merge'
40
40
 
41
- const envTarget = import.meta.env.VITE_BUILD_TARGET || 'open'
42
- const isSaas = import.meta.env.VITE_TINY_THEME === 'saas'
43
-
44
41
  // 适配层集成twMerge能力
45
42
  if (isSaas) {
46
43
  customDesignConfig.twMerge = twMerge
@@ -94,7 +91,7 @@ app.config.performance = true
94
91
  // 注入全局的saas主题变量
95
92
  app.config.globalProperties.tiny_theme = { value: import.meta.env.VITE_TINY_THEME }
96
93
 
97
- if (import.meta.env.VITE_TINY_THEME === 'saas') {
94
+ if (isSaas) {
98
95
  import('./tailwind.css')
99
96
  }
100
97
  // 注册TinyVue组件mcp配置
package/src/menus.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import { docMenus, cmpMenus } from '@menu/menus.js'
2
2
  import { appData, $split } from './tools'
3
+ import { isSaas } from './const'
3
4
 
4
5
  /**
5
6
  * 聚合doc / cmp 两个页面的所有菜单.
@@ -27,7 +28,7 @@ function genMenus() {
27
28
  ]
28
29
 
29
30
  // 使用指南只在DEV下生效
30
- const isShowDoc = import.meta.env.DEV || import.meta.env.VITE_TINY_THEME === 'saas'
31
+ const isShowDoc = import.meta.env.DEV || isSaas
31
32
  const docOptions = isShowDoc
32
33
  ? docMenus.map((menu) => ({
33
34
  ...menu,
@@ -1,5 +1,6 @@
1
+ import { isSaas } from '../const'
2
+
1
3
  const OPEN_TINY_URL = 'https://opentiny.design'
2
- const isSaas = import.meta.env.VITE_TINY_THEME === 'saas'
3
4
 
4
5
  export const doSearchEverySite = () => {
5
6
  window.handleGlobalSearchData = (resolve) => {
@@ -9,7 +10,7 @@ export const doSearchEverySite = () => {
9
10
  }
10
11
 
11
12
  if (isSaas) {
12
- data.content = data.content.replaceAll('/tiny-vue/', '/tiny-vue-saas/')
13
+ data.content = data.content.replace('/tiny-vue/', '/tiny-vue-saas/')
13
14
  }
14
15
 
15
16
  resolve(data)
@@ -3,11 +3,12 @@ import { router } from '@/router.js'
3
3
  import { getAllComponents } from '@/menus'
4
4
  import demoConfig from '@demos/config.js'
5
5
  import { staticDemoPath } from '../views/components-doc/cmp-config'
6
+ import { isSaas } from '../const'
6
7
 
7
8
  const allMenus = getAllComponents()
8
9
 
9
10
  const templateModeState = reactive({
10
- isSaas: import.meta.env.VITE_TINY_THEME === 'saas',
11
+ isSaas,
11
12
  modeList: [],
12
13
  mode: null
13
14
  })
@@ -4,7 +4,7 @@ import designSaasConfig from '@opentiny/vue-design-saas'
4
4
  import designSMBConfig from '@opentiny/vue-design-smb'
5
5
  import { router } from '@/router'
6
6
  import { appData } from './appData'
7
- import { CURRENT_THEME_KEY, DEFAULT_THEME, AURORA_THEME, OLD_THEME, themeToolValuesMap } from '../const'
7
+ import { CURRENT_THEME_KEY, DEFAULT_THEME, AURORA_THEME, OLD_THEME, themeToolValuesMap, isSaas } from '../const'
8
8
  import glaciers from '@/assets/images/glaciers.png'
9
9
  import glaciersIcon from '@/assets/images/glaciers-icon.png'
10
10
 
@@ -51,7 +51,7 @@ watch(
51
51
  )
52
52
 
53
53
  const designConfig = computed(() => {
54
- if (import.meta.env.VITE_TINY_THEME === 'saas') {
54
+ if (isSaas) {
55
55
  return designSaasConfig
56
56
  }
57
57
  if (router.currentRoute.value.params.theme === 'smb-theme') {
@@ -1,6 +1,7 @@
1
+ import { isSaas } from '../../const'
2
+
1
3
  // 批量导入vue组件示例文件, 进行vue组件示例的渲染
2
4
  const vueFiles = import.meta.glob(`@demos/app/**/*.vue`)
3
- const isSaas = import.meta.env.VITE_TINY_THEME === 'saas'
4
5
  const mobileFirstVueFiles = isSaas ? import.meta.glob(`../../../demos/mobile-first/app/**/*.vue`) : null
5
6
  // 所有demo组件实例
6
7
  const vueComponents = Object.create(null)