@ruan-cat/vitepress-preset-config 0.13.3 → 0.14.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/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.3",
3
+ "version": "0.14.0",
4
4
  "description": "用于给大多数的vitepress项目提供一个预设的配置文件。",
5
5
  "homepage": "https://vitepress-preset.ruancat6312.top",
6
6
  "types": "./src/config.mts",
@@ -15,8 +15,10 @@
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",
21
+ "vitepress-plugin-image-viewer": "^1.1.6",
20
22
  "vitepress-plugin-llms": "^1.1.0",
21
23
  "vitepress-plugin-mermaid": "^2.0.17",
22
24
  "vitepress-sidebar": "^1.31.1",
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
  }