@opentiny/vue-docs 3.20.2 → 3.20.4

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/index.html CHANGED
@@ -21,24 +21,13 @@
21
21
  window.DEPLOY_URL = ''
22
22
  window.process = { env: {} }
23
23
  </script>
24
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@docsearch/css@3"/>
25
24
  </head>
26
25
 
27
26
  <body class="of-hidden">
28
27
  <div id="header"></div>
29
28
  <app-root></app-root>
30
29
  <div id="app" class="wp100 hp100 pt60 of-hidden"></div>
31
- <div class="search-box" style="display: none;"></div>
32
- <script src="https://cdn.jsdelivr.net/npm/@docsearch/js@3"></script>
33
- <script type="text/javascript">
34
- docsearch({
35
- appId: "AGPA5UXHMH",
36
- apiKey: "5fa09fc20270efa61d68e2c2eb0f56df",
37
- indexName: "opentiny",
38
- container: ".search-box",
39
- debug: false
40
- });
41
- </script>
30
+ <div class="search-box"></div>
42
31
  <!-- prettier-ignore -->
43
32
  <script id="tinyui-design-common" src="/static/js/design-common.js"></script>
44
33
  <script type="module" src="./src/main.js"></script>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opentiny/vue-docs",
3
- "version": "3.20.2",
3
+ "version": "3.20.4",
4
4
  "license": "MIT",
5
5
  "dependencies": {
6
6
  "@opentiny/vue-repl": "^1.1.2",
@@ -16,20 +16,23 @@
16
16
  "vue": "^3.4.31",
17
17
  "vue-i18n": "^9.1.10",
18
18
  "vue-router": "4.1.5",
19
- "@opentiny/vue": "~3.20.0",
19
+ "@docsearch/js": "^3.8.0",
20
+ "@docsearch/css": "^3.8.0",
21
+ "@docsearch/react": "npm:@docsearch/css",
20
22
  "@opentiny/vue-design-saas": "~3.20.0",
21
- "@opentiny/vue-design-aurora": "~3.20.0",
22
23
  "@opentiny/vue-common": "~3.20.1",
23
- "@opentiny/vue-design-smb": "~3.20.0",
24
- "@opentiny/vue-hooks": "~3.20.0",
24
+ "@opentiny/vue": "~3.20.0",
25
25
  "@opentiny/vue-directive": "~3.20.0",
26
+ "@opentiny/vue-design-aurora": "~3.20.0",
26
27
  "@opentiny/vue-icon": "~3.20.0",
27
- "@opentiny/vue-icon-multicolor": "~3.20.0",
28
+ "@opentiny/vue-design-smb": "~3.20.0",
29
+ "@opentiny/vue-hooks": "~3.20.0",
28
30
  "@opentiny/vue-icon-saas": "~3.20.0",
29
31
  "@opentiny/vue-theme": "~3.20.0",
32
+ "@opentiny/vue-icon-multicolor": "~3.20.0",
30
33
  "@opentiny/vue-theme-mobile": "~3.20.0",
31
- "@opentiny/vue-theme-saas": "~3.20.0",
32
- "@opentiny/vue-vite-import": "~1.2.0"
34
+ "@opentiny/vue-vite-import": "~1.2.0",
35
+ "@opentiny/vue-theme-saas": "~3.20.0"
33
36
  },
34
37
  "devDependencies": {
35
38
  "@playwright/test": "~1.42.0",
package/src/App.vue CHANGED
@@ -17,8 +17,6 @@ import { iconClose } from '@opentiny/vue-icon'
17
17
  import { appData } from './tools'
18
18
  import useTheme from './tools/useTheme'
19
19
 
20
- const envTarget = import.meta.env.VITE_BUILD_TARGET || 'open'
21
-
22
20
  export default defineComponent({
23
21
  name: 'AppVue',
24
22
  props: [],
@@ -42,11 +40,6 @@ export default defineComponent({
42
40
  }
43
41
  })
44
42
  common.renderHeader()
45
-
46
- const searchBox = document.querySelector('.search-box')
47
- if (searchBox && envTarget === 'open') {
48
- searchBox.style.display = 'block'
49
- }
50
43
  })
51
44
  const { designConfig, currentThemeKey } = useTheme()
52
45
 
package/src/main.js CHANGED
@@ -31,11 +31,25 @@ import hljs from 'highlight.js/lib/core'
31
31
  import javascript from 'highlight.js/lib/languages/javascript'
32
32
  import css from 'highlight.js/lib/languages/css'
33
33
  import html from 'highlight.js/lib/languages/xml'
34
+ import docsearch from '@docsearch/js'
35
+ import '@docsearch/css'
36
+
37
+ const envTarget = import.meta.env.VITE_BUILD_TARGET || 'open'
34
38
 
35
39
  hljs.registerLanguage('javascript', javascript)
36
40
  hljs.registerLanguage('css', css)
37
41
  hljs.registerLanguage('html', html)
38
42
 
43
+ if (envTarget === 'open') {
44
+ docsearch({
45
+ appId: 'AGPA5UXHMH',
46
+ apiKey: '5fa09fc20270efa61d68e2c2eb0f56df',
47
+ indexName: 'opentiny',
48
+ container: '.search-box',
49
+ debug: false
50
+ })
51
+ }
52
+
39
53
  // 实验后发现,先调用一次预热一下,后续再调用会有速度的提示,因此在main中预热一下。
40
54
  setTimeout(() => {
41
55
  hljs.highlightAuto(`<template>
package/src/style.css CHANGED
@@ -4,7 +4,8 @@ html {
4
4
  }
5
5
 
6
6
  /* reset.css 引入后造成site官网中 b 和 strong 标签没有粗体,此处还原粗体 */
7
- b, strong {
7
+ b,
8
+ strong {
8
9
  font-weight: 700;
9
10
  }
10
11
 
@@ -22,7 +23,8 @@ b, strong {
22
23
  z-index: 1000 !important;
23
24
  }
24
25
 
25
- .tiny-grid td,.tiny-grid th {
26
+ .tiny-grid td,
27
+ .tiny-grid th {
26
28
  vertical-align: middle;
27
29
  }
28
30
 
@@ -42,7 +44,7 @@ b, strong {
42
44
 
43
45
  .DocSearch-Button {
44
46
  border-radius: 6px;
45
- transition: 0.4s
47
+ transition: 0.4s;
46
48
  }
47
49
 
48
50
  .DocSearch-Button:hover {
@@ -310,10 +310,18 @@ export default defineComponent({
310
310
  }
311
311
  }
312
312
 
313
+ @media screen and (max-width: 640px) {
314
+ .pc-demo-container {
315
+ overflow: auto;
316
+ }
317
+ }
318
+
313
319
  .pc-demo-container {
314
320
  display: flex;
315
321
  flex-direction: column;
316
- background: #fafafa;
322
+ background: #fff;
323
+ border-radius: 6px;
324
+ border: 1px solid #dcdfe6;
317
325
  padding: 26px 18px 42px;
318
326
 
319
327
  .pc-demo {