@ruan-cat/vitepress-preset-config 0.13.4 → 0.15.0

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/dist/config.d.mts CHANGED
@@ -2,7 +2,7 @@ import * as vitepress_sidebar_types from 'vitepress-sidebar/types';
2
2
  import { UserConfig, DefaultTheme } from 'vitepress';
3
3
  export { defineConfig } from 'vitepress';
4
4
  import { generateSidebar } from 'vitepress-sidebar';
5
- export { addChangelog2doc } from '@ruan-cat/utils/node-esm';
5
+ export { addChangelog2doc, copyReadmeMd } from '@ruan-cat/utils/node-esm';
6
6
  export { withMermaid } from 'vitepress-plugin-mermaid';
7
7
  export { default as VitePluginVercel } from 'vite-plugin-vercel';
8
8
 
package/dist/config.mjs CHANGED
@@ -5,7 +5,7 @@ import { GitChangelog, GitChangelogMarkdownSection } from "@nolebase/vitepress-p
5
5
  import { vitepressDemoPlugin } from "vitepress-demo-plugin";
6
6
  import { merge, isUndefined, cloneDeep } from "lodash-es";
7
7
  import consola from "consola";
8
- import { addChangelog2doc, hasChangelogMd } from "@ruan-cat/utils/node-esm";
8
+ import { addChangelog2doc, hasChangelogMd, copyReadmeMd } from "@ruan-cat/utils/node-esm";
9
9
  import { transformerTwoslash } from "@shikijs/vitepress-twoslash";
10
10
  import llmstxt from "vitepress-plugin-llms";
11
11
  import { withMermaid } from "vitepress-plugin-mermaid";
@@ -84,6 +84,7 @@ var defaultUserConfig = {
84
84
  }),
85
85
  // @ts-ignore
86
86
  GitChangelogMarkdownSection(),
87
+ // @ts-ignore
87
88
  VitePluginVercel()
88
89
  ],
89
90
  optimizeDeps: {
@@ -143,6 +144,7 @@ function setUserConfig(config) {
143
144
  export {
144
145
  VitePluginVercel,
145
146
  addChangelog2doc,
147
+ copyReadmeMd,
146
148
  defineConfig,
147
149
  setGenerateSidebar,
148
150
  setUserConfig,
package/dist/theme.d.mts CHANGED
@@ -28,6 +28,7 @@ declare const defaultTheme: {
28
28
  */
29
29
  declare function defineRuancatPresetTheme(params?: DefineRuancatPresetThemeParams): {
30
30
  enhanceApp({ app, router, siteData }: EnhanceAppContext): void;
31
+ setup(): void;
31
32
  extends: {
32
33
  Layout: vue.DefineComponent;
33
34
  enhanceApp: (ctx: EnhanceAppContext) => void;
package/dist/theme.mjs CHANGED
@@ -15,6 +15,9 @@ import { NolebaseGitChangelogPlugin } from "@nolebase/vitepress-plugin-git-chang
15
15
  import "@nolebase/vitepress-plugin-git-changelog/client/style.css";
16
16
  import TwoslashFloatingVue from "@shikijs/vitepress-twoslash/client";
17
17
  import "@shikijs/vitepress-twoslash/style.css";
18
+ import "viewerjs/dist/viewer.min.css";
19
+ import imageViewer from "vitepress-plugin-image-viewer";
20
+ import { useRoute } from "vitepress";
18
21
  var defaultLayoutConfig = {
19
22
  // https://vitepress.dev/guide/extending-default-theme#layout-slots
20
23
  "doc-before": () => h(NolebaseBreadcrumbs),
@@ -54,6 +57,10 @@ function defineRuancatPresetTheme(params) {
54
57
  var _a;
55
58
  defaultTheme.enhanceApp({ app, router, siteData });
56
59
  (_a = params == null ? void 0 : params.enhanceAppCallBack) == null ? void 0 : _a.call(params, { app, router, siteData });
60
+ },
61
+ setup() {
62
+ const route = useRoute();
63
+ imageViewer(route);
57
64
  }
58
65
  };
59
66
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ruan-cat/vitepress-preset-config",
3
- "version": "0.13.4",
3
+ "version": "0.15.0",
4
4
  "description": "用于给大多数的vitepress项目提供一个预设的配置文件。",
5
5
  "homepage": "https://vitepress-preset.ruancat6312.top",
6
6
  "types": "./src/config.mts",
@@ -15,6 +15,7 @@
15
15
  "js-yaml": "^4.1.0",
16
16
  "lodash-es": "^4.17.21",
17
17
  "mermaid": "^11.6.0",
18
+ "viewerjs": "^1.11.7",
18
19
  "vite-plugin-vercel": "^9.0.7",
19
20
  "vitepress-demo-plugin": "^1.3.1",
20
21
  "vitepress-plugin-image-viewer": "^1.1.6",
@@ -22,7 +23,7 @@
22
23
  "vitepress-plugin-mermaid": "^2.0.17",
23
24
  "vitepress-sidebar": "^1.31.1",
24
25
  "vue": "^3.5.13",
25
- "@ruan-cat/utils": "^4.8.1"
26
+ "@ruan-cat/utils": "^4.9.0"
26
27
  },
27
28
  "devDependencies": {
28
29
  "@types/lodash-es": "^4.17.12",
package/src/config.mts CHANGED
@@ -9,8 +9,8 @@ import { vitepressDemoPlugin } from "vitepress-demo-plugin";
9
9
  import { merge, isUndefined, cloneDeep } from "lodash-es";
10
10
  import consola from "consola";
11
11
 
12
- import { addChangelog2doc, hasChangelogMd } from "@ruan-cat/utils/node-esm";
13
- export { addChangelog2doc };
12
+ import { addChangelog2doc, hasChangelogMd, copyReadmeMd } from "@ruan-cat/utils/node-esm";
13
+ export { addChangelog2doc, copyReadmeMd };
14
14
 
15
15
  import { transformerTwoslash } from "@shikijs/vitepress-twoslash";
16
16
 
@@ -140,6 +140,7 @@ const defaultUserConfig: UserConfig<DefaultTheme.Config> = {
140
140
  // @ts-ignore
141
141
  GitChangelogMarkdownSection(),
142
142
 
143
+ // @ts-ignore
143
144
  VitePluginVercel(),
144
145
  ],
145
146
 
package/src/theme.ts CHANGED
@@ -34,6 +34,10 @@ import "@nolebase/vitepress-plugin-git-changelog/client/style.css";
34
34
  import TwoslashFloatingVue from "@shikijs/vitepress-twoslash/client";
35
35
  import "@shikijs/vitepress-twoslash/style.css";
36
36
 
37
+ import "viewerjs/dist/viewer.min.css";
38
+ import imageViewer from "vitepress-plugin-image-viewer";
39
+ import { useRoute } from "vitepress";
40
+
37
41
  /**
38
42
  * 一个回调函数 用来暴露变量 实现注册
39
43
  */
@@ -112,5 +116,11 @@ export function defineRuancatPresetTheme(params?: DefineRuancatPresetThemeParams
112
116
  // 执行用户传入的回调函数
113
117
  params?.enhanceAppCallBack?.({ app, router, siteData });
114
118
  },
119
+ setup() {
120
+ // Get route
121
+ const route = useRoute();
122
+ // Using
123
+ imageViewer(route);
124
+ },
115
125
  } satisfies Theme;
116
126
  }