@vuepress/plugin-umami-analytics 2.0.0-rc.122 → 2.0.0-rc.124

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.
@@ -1,5 +1,7 @@
1
- import * as vuepress_client from 'vuepress/client';
2
-
3
- declare const _default: vuepress_client.ClientConfig;
1
+ import * as vuepress_client0 from "vuepress/client";
4
2
 
3
+ //#region src/client/config.d.ts
4
+ declare const _default: vuepress_client0.ClientConfig;
5
+ //#endregion
5
6
  export { _default as default };
7
+ //# sourceMappingURL=config.d.ts.map
@@ -1,2 +1,2 @@
1
- import{defineClientConfig as _}from"vuepress/client";import{useUmamiAnalytics as i}from"./index.js";var e=_({setup(){__VUEPRESS_SSR__||i(__UMM_OPTIONS__)}});export{e as default};
2
- //# sourceMappingURL=config.js.map
1
+ import{t as e}from"../useUmamiAnalytics-DJNf4qED.js";import{defineClientConfig as t}from"vuepress/client";var n=t({setup(){__VUEPRESS_SSR__||e(__UMM_OPTIONS__)}});export{n as default};
2
+ //# sourceMappingURL=config.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sources":["../../src/client/config.ts"],"sourcesContent":["import { defineClientConfig } from 'vuepress/client'\nimport type { UmamiOptions } from '../shared/index.js'\nimport { useUmamiAnalytics } from './composables/index.js'\n\ndeclare const __UMM_OPTIONS__: UmamiOptions\n\nexport default defineClientConfig({\n setup() {\n if (__VUEPRESS_SSR__) return\n useUmamiAnalytics(__UMM_OPTIONS__)\n },\n})\n"],"names":["config","defineClientConfig","useUmamiAnalytics"],"mappings":"oGAMA,IAAAA,EAAeC,EAAmB,CAChC,OAAQ,CACF,kBACJC,EAAkB,eAAe,CACnC,CACF,CAAC"}
1
+ {"version":3,"file":"config.js","names":[],"sources":["../../src/client/config.ts"],"sourcesContent":["import { defineClientConfig } from 'vuepress/client'\nimport type { UmamiOptions } from '../shared/index.js'\nimport { useUmamiAnalytics } from './composables/index.js'\n\ndeclare const __UMM_OPTIONS__: UmamiOptions\n\nexport default defineClientConfig({\n setup() {\n if (__VUEPRESS_SSR__) return\n useUmamiAnalytics(__UMM_OPTIONS__)\n },\n})\n"],"mappings":"0GAMA,IAAA,EAAe,EAAmB,CAChC,OAAQ,CACF,kBACJ,EAAkB,gBAAgB,EAErC,CAAC"}
@@ -1,94 +1,6 @@
1
- /**
2
- * Options for @vuepress/plugin-umami-analytics
3
- *
4
- * @vuepress/plugin-umami-analytics 插件选项
5
- */
6
- interface UmamiOptions {
7
- /**
8
- * Umami Analytics website ID
9
- *
10
- * Umami Analytics 网站 ID
11
- *
12
- * @description The website ID from your Umami Analytics dashboard
13
- *
14
- * 从 Umami Analytics 仪表板获取的网站 ID
15
- */
16
- id: string;
17
- /**
18
- * Umami Analytics script URL
19
- *
20
- * Umami Analytics 脚本链接
21
- *
22
- * @description URL to the Umami tracking script
23
- *
24
- * Umami 追踪脚本的 URL
25
- *
26
- * @default 'https://us.umami.is/script.js'
27
- */
28
- link?: string;
29
- /**
30
- * Enable automatic tracking
31
- *
32
- * 启用自动追踪
33
- *
34
- * @description When enabled, Umami automatically tracks pageviews and events.
35
- * Set to `false` to use manual tracking with tracker functions.
36
- *
37
- * 启用时,Umami 会自动追踪页面浏览和事件。
38
- * 设为 `false` 可使用手动追踪功能。
39
- *
40
- * @default true
41
- */
42
- autoTrack?: boolean;
43
- /**
44
- * Enable data caching
45
- *
46
- * 启用数据缓存
47
- *
48
- * @description Cache data to improve tracking script performance.
49
- * Uses session storage and may require user notification.
50
- *
51
- * 缓存数据以提高追踪脚本性能。
52
- * 使用会话存储,可能需要通知用户。
53
- *
54
- * @default false
55
- */
56
- cache?: boolean;
57
- /**
58
- * Restrict tracking to specific domains
59
- *
60
- * 限制追踪到特定域名
61
- *
62
- * @description Array of domains where tracking should be active
63
- *
64
- * 限制追踪活跃的域名数组
65
- */
66
- domains?: string[];
67
- /**
68
- * Data collection endpoint
69
- *
70
- * 数据收集端点
71
- *
72
- * @description Custom URL for sending tracking data
73
- *
74
- * 发送追踪数据的自定义 URL
75
- *
76
- * @default link
77
- */
78
- hostUrl?: string;
79
- }
80
-
81
- declare global {
82
- interface Window {
83
- umami: {
84
- track: {
85
- (payload?: Record<string, unknown>): void;
86
- (name: string, data?: Record<string, unknown>): void;
87
- };
88
- };
89
- }
90
- }
1
+ import { t as UmamiOptions } from "../options-zTn9E-2W.js";
91
2
 
3
+ //#region src/client/composables/useUmamiAnalytics.d.ts
92
4
  /**
93
5
  * Initialize Umami Analytics tracking
94
6
  *
@@ -105,6 +17,14 @@ declare global {
105
17
  * @see https://umami.is/docs/tracker-functions
106
18
  * @see https://umami.is/docs/tracker-configuration
107
19
  */
108
- declare const useUmamiAnalytics: ({ link, id, domains, autoTrack, cache, hostUrl, }: UmamiOptions) => void;
109
-
20
+ declare const useUmamiAnalytics: ({
21
+ link,
22
+ id,
23
+ domains,
24
+ autoTrack,
25
+ cache,
26
+ hostUrl
27
+ }: UmamiOptions) => void;
28
+ //#endregion
110
29
  export { useUmamiAnalytics };
30
+ //# sourceMappingURL=index.d.ts.map
@@ -1,2 +1 @@
1
- const u=({link:s="https://us.umami.is/script.js",id:i,domains:a,autoTrack:r,cache:c,hostUrl:e})=>{if("umami"in window)return;const t=document.createElement("script");t.src=s,t.async=!0,t.setAttribute("data-website-id",i),r===!1&&t.setAttribute("data-auto-track","false"),c&&t.setAttribute("data-cache","true"),a&&t.setAttribute("data-domains",a.join(",")),e&&t.setAttribute("data-hostUrl",e),document.head.appendChild(t)};export{u as useUmamiAnalytics};
2
- //# sourceMappingURL=index.js.map
1
+ import{t as e}from"../useUmamiAnalytics-DJNf4qED.js";export{e as useUmamiAnalytics};
@@ -1,93 +1,12 @@
1
- import { Plugin } from 'vuepress/core';
2
-
3
- /**
4
- * Options for @vuepress/plugin-umami-analytics
5
- *
6
- * @vuepress/plugin-umami-analytics 插件选项
7
- */
8
- interface UmamiOptions {
9
- /**
10
- * Umami Analytics website ID
11
- *
12
- * Umami Analytics 网站 ID
13
- *
14
- * @description The website ID from your Umami Analytics dashboard
15
- *
16
- * 从 Umami Analytics 仪表板获取的网站 ID
17
- */
18
- id: string;
19
- /**
20
- * Umami Analytics script URL
21
- *
22
- * Umami Analytics 脚本链接
23
- *
24
- * @description URL to the Umami tracking script
25
- *
26
- * Umami 追踪脚本的 URL
27
- *
28
- * @default 'https://us.umami.is/script.js'
29
- */
30
- link?: string;
31
- /**
32
- * Enable automatic tracking
33
- *
34
- * 启用自动追踪
35
- *
36
- * @description When enabled, Umami automatically tracks pageviews and events.
37
- * Set to `false` to use manual tracking with tracker functions.
38
- *
39
- * 启用时,Umami 会自动追踪页面浏览和事件。
40
- * 设为 `false` 可使用手动追踪功能。
41
- *
42
- * @default true
43
- */
44
- autoTrack?: boolean;
45
- /**
46
- * Enable data caching
47
- *
48
- * 启用数据缓存
49
- *
50
- * @description Cache data to improve tracking script performance.
51
- * Uses session storage and may require user notification.
52
- *
53
- * 缓存数据以提高追踪脚本性能。
54
- * 使用会话存储,可能需要通知用户。
55
- *
56
- * @default false
57
- */
58
- cache?: boolean;
59
- /**
60
- * Restrict tracking to specific domains
61
- *
62
- * 限制追踪到特定域名
63
- *
64
- * @description Array of domains where tracking should be active
65
- *
66
- * 限制追踪活跃的域名数组
67
- */
68
- domains?: string[];
69
- /**
70
- * Data collection endpoint
71
- *
72
- * 数据收集端点
73
- *
74
- * @description Custom URL for sending tracking data
75
- *
76
- * 发送追踪数据的自定义 URL
77
- *
78
- * @default link
79
- */
80
- hostUrl?: string;
81
- }
1
+ import { t as UmamiOptions } from "../options-zTn9E-2W.js";
2
+ import { Plugin } from "vuepress/core";
82
3
 
4
+ //#region src/node/umamiAnalyticsPlugin.d.ts
83
5
  /**
84
6
  * Umami Analytics plugin for VuePress
85
7
  *
86
8
  * VuePress 的 Umami Analytics 插件
87
9
  *
88
- * @param options - Plugin options
89
- * @returns VuePress plugin
90
- *
91
10
  * @description Integrates Umami Analytics tracking into VuePress applications.
92
11
  * Only active in production builds when a valid website ID is provided.
93
12
  *
@@ -108,7 +27,10 @@ interface UmamiOptions {
108
27
  * }
109
28
  * ```
110
29
  */
111
- declare const umamiAnalyticsPlugin: ({ id, ...options }: UmamiOptions) => Plugin;
112
-
113
- export { umamiAnalyticsPlugin };
114
- export type { UmamiOptions as UmamiPluginOptions };
30
+ declare const umamiAnalyticsPlugin: ({
31
+ id,
32
+ ...options
33
+ }: UmamiOptions) => Plugin;
34
+ //#endregion
35
+ export { type UmamiOptions as UmamiPluginOptions, umamiAnalyticsPlugin };
36
+ //# sourceMappingURL=index.d.ts.map
package/lib/node/index.js CHANGED
@@ -1,2 +1,2 @@
1
- import{Logger as o}from"@vuepress/helper";import{getDirname as m,path as a,colors as s}from"vuepress/utils";const l=import.meta.dirname||m(import.meta.url),n="@vuepress/plugin-umami-analytics",c=new o(n),p=({id:i,...r})=>t=>{const e={name:n};return i?t.env.isDev?e:{...e,define:{__UMM_OPTIONS__:{id:i,...r}},clientConfigFile:a.resolve(l,"../client/config.js")}:(c.warn(`${s.cyan("id")} is required!`),e)};export{p as umamiAnalyticsPlugin};
2
- //# sourceMappingURL=index.js.map
1
+ import{Logger as e}from"@vuepress/helper";import{colors as t,getDirname as n,path as r}from"vuepress/utils";const i=import.meta.dirname||n(import.meta.url),a=`@vuepress/plugin-umami-analytics`,o=new e(a),s=({id:e,...n})=>s=>{let c={name:a};return e?s.env.isDev?c:{...c,define:{__UMM_OPTIONS__:{id:e,...n}},clientConfigFile:r.resolve(i,`../client/config.js`)}:(o.warn(`${t.cyan(`id`)} is required!`),c)};export{s as umamiAnalyticsPlugin};
2
+ //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../src/node/umamiAnalyticsPlugin.ts"],"sourcesContent":["import { Logger } from '@vuepress/helper'\nimport type { Plugin, PluginObject } from 'vuepress/core'\nimport { colors, getDirname, path } from 'vuepress/utils'\nimport type { UmamiOptions } from '../shared/index.js'\n\nconst __dirname = import.meta.dirname || getDirname(import.meta.url)\n\nconst PLUGIN_NAME = '@vuepress/plugin-umami-analytics'\n\nconst logger = new Logger(PLUGIN_NAME)\n\n/**\n * Umami Analytics plugin for VuePress\n *\n * VuePress 的 Umami Analytics 插件\n *\n * @param options - Plugin options\n * @returns VuePress plugin\n *\n * @description Integrates Umami Analytics tracking into VuePress applications.\n * Only active in production builds when a valid website ID is provided.\n *\n * 集成 Umami Analytics 追踪到 VuePress 应用中。\n * 仅在生产构建且提供有效网站 ID 时启用。\n *\n * @example\n * ```ts\n * import { umamiAnalyticsPlugin } from '@vuepress/plugin-umami-analytics'\n *\n * export default {\n * plugins: [\n * umamiAnalyticsPlugin({\n * id: 'your-website-id',\n * link: 'https://your-umami-instance.com/script.js'\n * })\n * ]\n * }\n * ```\n */\nexport const umamiAnalyticsPlugin =\n ({ id, ...options }: UmamiOptions): Plugin =>\n (app) => {\n const plugin: PluginObject = {\n name: PLUGIN_NAME,\n }\n\n if (!id) {\n logger.warn(`${colors.cyan('id')} is required!`)\n\n return plugin\n }\n\n // returns an empty plugin in dev mode when debug mode is not enabled\n if (app.env.isDev) {\n return plugin\n }\n\n return {\n ...plugin,\n\n define: {\n __UMM_OPTIONS__: { id, ...options },\n },\n\n clientConfigFile: path.resolve(__dirname, '../client/config.js'),\n }\n }\n"],"names":["__dirname","getDirname","PLUGIN_NAME","logger","Logger","umamiAnalyticsPlugin","id","options","app","plugin","path","colors"],"mappings":"4GAKA,MAAMA,EAAY,YAAY,SAAWC,EAAW,YAAY,GAAG,EAE7DC,EAAc,mCAEdC,EAAS,IAAIC,EAAOF,CAAW,EA8BxBG,EACX,CAAC,CAAE,GAAAC,EAAI,GAAGC,CAAQ,IACjBC,GAAQ,CACP,MAAMC,EAAuB,CAC3B,KAAMP,CACR,EAEA,OAAKI,EAODE,EAAI,IAAI,MACHC,EAGF,CACL,GAAGA,EAEH,OAAQ,CACN,gBAAiB,CAAE,GAAAH,EAAI,GAAGC,CAAQ,CACpC,EAEA,iBAAkBG,EAAK,QAAQV,EAAW,qBAAqB,CACjE,GAlBEG,EAAO,KAAK,GAAGQ,EAAO,KAAK,IAAI,CAAC,eAAe,EAExCF,EAiBX"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/node/umamiAnalyticsPlugin.ts"],"sourcesContent":["import { Logger } from '@vuepress/helper'\nimport type { Plugin, PluginObject } from 'vuepress/core'\nimport { colors, getDirname, path } from 'vuepress/utils'\nimport type { UmamiOptions } from '../shared/index.js'\n\nconst __dirname = import.meta.dirname || getDirname(import.meta.url)\n\nconst PLUGIN_NAME = '@vuepress/plugin-umami-analytics'\n\nconst logger = new Logger(PLUGIN_NAME)\n\n/**\n * Umami Analytics plugin for VuePress\n *\n * VuePress 的 Umami Analytics 插件\n *\n * @description Integrates Umami Analytics tracking into VuePress applications.\n * Only active in production builds when a valid website ID is provided.\n *\n * 集成 Umami Analytics 追踪到 VuePress 应用中。\n * 仅在生产构建且提供有效网站 ID 时启用。\n *\n * @example\n * ```ts\n * import { umamiAnalyticsPlugin } from '@vuepress/plugin-umami-analytics'\n *\n * export default {\n * plugins: [\n * umamiAnalyticsPlugin({\n * id: 'your-website-id',\n * link: 'https://your-umami-instance.com/script.js'\n * })\n * ]\n * }\n * ```\n */\nexport const umamiAnalyticsPlugin =\n ({ id, ...options }: UmamiOptions): Plugin =>\n (app) => {\n const plugin: PluginObject = {\n name: PLUGIN_NAME,\n }\n\n if (!id) {\n logger.warn(`${colors.cyan('id')} is required!`)\n\n return plugin\n }\n\n // returns an empty plugin in dev mode when debug mode is not enabled\n if (app.env.isDev) return plugin\n\n return {\n ...plugin,\n\n define: {\n __UMM_OPTIONS__: { id, ...options },\n },\n\n clientConfigFile: path.resolve(__dirname, '../client/config.js'),\n }\n }\n"],"mappings":"4GAKA,MAAM,EAAY,OAAO,KAAK,SAAW,EAAW,OAAO,KAAK,IAAI,CAE9D,EAAc,mCAEd,EAAS,IAAI,EAAO,EAAY,CA2BzB,GACV,CAAE,KAAI,GAAG,KACT,GAAQ,CACP,IAAM,EAAuB,CAC3B,KAAM,EACP,CAWD,OATK,EAOD,EAAI,IAAI,MAAc,EAEnB,CACL,GAAG,EAEH,OAAQ,CACN,gBAAiB,CAAE,KAAI,GAAG,EAAS,CACpC,CAED,iBAAkB,EAAK,QAAQ,EAAW,sBAAsB,CACjE,EAhBC,EAAO,KAAK,GAAG,EAAO,KAAK,KAAK,CAAC,eAAe,CAEzC"}
@@ -0,0 +1,83 @@
1
+ //#region src/shared/options.d.ts
2
+ /**
3
+ * Options for `@vuepress/plugin-umami-analytics`
4
+ *
5
+ * `@vuepress/plugin-umami-analytics` 插件选项
6
+ */
7
+ interface UmamiOptions {
8
+ /**
9
+ * Umami Analytics website ID
10
+ *
11
+ * Umami Analytics 网站 ID
12
+ *
13
+ * @description The website ID from your Umami Analytics dashboard
14
+ *
15
+ * 从 Umami Analytics 仪表板获取的网站 ID
16
+ */
17
+ id: string;
18
+ /**
19
+ * Umami Analytics script URL
20
+ *
21
+ * Umami Analytics 脚本链接
22
+ *
23
+ * @description URL to the Umami tracking script
24
+ *
25
+ * Umami 追踪脚本的 URL
26
+ *
27
+ * @default 'https://us.umami.is/script.js'
28
+ */
29
+ link?: string;
30
+ /**
31
+ * Enable automatic tracking
32
+ *
33
+ * 启用自动追踪
34
+ *
35
+ * @description When enabled, Umami automatically tracks pageviews and events.
36
+ * Set to `false` to use manual tracking with tracker functions.
37
+ *
38
+ * 启用时,Umami 会自动追踪页面浏览和事件。
39
+ * 设为 `false` 可使用手动追踪功能。
40
+ *
41
+ * @default true
42
+ */
43
+ autoTrack?: boolean;
44
+ /**
45
+ * Enable data caching
46
+ *
47
+ * 启用数据缓存
48
+ *
49
+ * @description Cache data to improve tracking script performance.
50
+ * Uses session storage and may require user notification.
51
+ *
52
+ * 缓存数据以提高追踪脚本性能。
53
+ * 使用会话存储,可能需要通知用户。
54
+ *
55
+ * @default false
56
+ */
57
+ cache?: boolean;
58
+ /**
59
+ * Restrict tracking to specific domains
60
+ *
61
+ * 限制追踪到特定域名
62
+ *
63
+ * @description Array of domains where tracking should be active
64
+ *
65
+ * 限制追踪活跃的域名数组
66
+ */
67
+ domains?: string[];
68
+ /**
69
+ * Data collection endpoint
70
+ *
71
+ * 数据收集端点
72
+ *
73
+ * @description Custom URL for sending tracking data
74
+ *
75
+ * 发送追踪数据的自定义 URL
76
+ *
77
+ * @default link
78
+ */
79
+ hostUrl?: string;
80
+ }
81
+ //#endregion
82
+ export { UmamiOptions as t };
83
+ //# sourceMappingURL=options-zTn9E-2W.d.ts.map
@@ -0,0 +1,2 @@
1
+ const e=({link:e=`https://us.umami.is/script.js`,id:t,domains:n,autoTrack:r,cache:i,hostUrl:a})=>{if(`umami`in window)return;let o=document.createElement(`script`);o.src=e,o.async=!0,o.dataset.websiteId=t,r===!1&&(o.dataset.autoTrack=`false`),i&&(o.dataset.cache=`true`),n&&(o.dataset.domains=n.join(`,`)),a&&(o.dataset.hostUrl=a),document.head.append(o)};export{e as t};
2
+ //# sourceMappingURL=useUmamiAnalytics-DJNf4qED.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useUmamiAnalytics-DJNf4qED.js","names":[],"sources":["../src/client/composables/useUmamiAnalytics.ts"],"sourcesContent":["import type { UmamiOptions } from '../../shared/index.js'\n// oxlint-disable-next-line import/no-unassigned-import\nimport './declare.js'\n\n/**\n * Initialize Umami Analytics tracking\n *\n * 初始化 Umami Analytics 追踪\n *\n * @param options - Umami Analytics options\n *\n * @description Injects Umami tracking script and configures tracking behavior.\n * The global `umami.track()` function will be available for custom event tracking.\n *\n * 注入 Umami 追踪脚本并配置追踪行为。\n * 全局 `umami.track()` 函数可用于自定义事件追踪。\n *\n * @see https://umami.is/docs/tracker-functions\n * @see https://umami.is/docs/tracker-configuration\n */\nexport const useUmamiAnalytics = ({\n link = 'https://us.umami.is/script.js',\n id,\n domains,\n autoTrack,\n cache,\n hostUrl,\n}: UmamiOptions): void => {\n // avoid duplicated import\n if ('umami' in window) return\n\n const script = document.createElement('script')\n script.src = link!\n script.async = true\n script.dataset.websiteId = id\n\n if (autoTrack === false) script.dataset.autoTrack = 'false'\n if (cache) script.dataset.cache = 'true'\n if (domains) script.dataset.domains = domains.join(',')\n if (hostUrl) script.dataset.hostUrl = hostUrl\n\n document.head.append(script)\n}\n"],"mappings":"AAoBA,MAAa,GAAqB,CAChC,OAAO,gCACP,KACA,UACA,YACA,QACA,aACwB,CAExB,GAAI,UAAW,OAAQ,OAEvB,IAAM,EAAS,SAAS,cAAc,SAAS,CAC/C,EAAO,IAAM,EACb,EAAO,MAAQ,GACf,EAAO,QAAQ,UAAY,EAEvB,IAAc,KAAO,EAAO,QAAQ,UAAY,SAChD,IAAO,EAAO,QAAQ,MAAQ,QAC9B,IAAS,EAAO,QAAQ,QAAU,EAAQ,KAAK,IAAI,EACnD,IAAS,EAAO,QAAQ,QAAU,GAEtC,SAAS,KAAK,OAAO,EAAO"}
package/package.json CHANGED
@@ -1,49 +1,54 @@
1
1
  {
2
2
  "name": "@vuepress/plugin-umami-analytics",
3
- "version": "2.0.0-rc.122",
3
+ "version": "2.0.0-rc.124",
4
4
  "description": "VuePress plugin - umami-analytics",
5
5
  "keywords": [
6
- "vuepress-plugin",
7
- "vuepress",
6
+ "analytics",
8
7
  "plugin",
9
8
  "umami",
10
- "analytics"
9
+ "vuepress",
10
+ "vuepress-plugin"
11
11
  ],
12
12
  "homepage": "https://ecosystem.vuejs.press/plugins/analytics/umami-analytics.html",
13
13
  "bugs": {
14
14
  "url": "https://github.com/vuepress/ecosystem/issues"
15
15
  },
16
- "repository": {
17
- "type": "git",
18
- "url": "git+https://github.com/vuepress/ecosystem.git",
19
- "directory": "plugins/analytics/plugin-umami-analytics"
20
- },
21
16
  "license": "MIT",
22
17
  "author": {
23
18
  "name": "Mr.Hope",
24
19
  "email": "mister-hope@outlook.com",
25
20
  "url": "https://mister-hope.com"
26
21
  },
27
- "type": "module",
28
- "exports": {
29
- ".": "./lib/node/index.js",
30
- "./client": "./lib/client/index.js",
31
- "./package.json": "./package.json"
22
+ "repository": {
23
+ "type": "git",
24
+ "url": "git+https://github.com/vuepress/ecosystem.git",
25
+ "directory": "plugins/analytics/plugin-umami-analytics"
32
26
  },
33
- "main": "./lib/node/index.js",
34
- "types": "./lib/node/index.d.ts",
35
27
  "files": [
36
28
  "lib"
37
29
  ],
30
+ "type": "module",
31
+ "sideEffects": false,
32
+ "exports": {
33
+ ".": {
34
+ "types": "./lib/node/index.d.ts",
35
+ "default": "./lib/node/index.js"
36
+ },
37
+ "./client": {
38
+ "types": "./lib/client/index.d.ts",
39
+ "default": "./lib/client/index.js"
40
+ },
41
+ "./package.json": "./package.json"
42
+ },
43
+ "publishConfig": {
44
+ "access": "public"
45
+ },
38
46
  "dependencies": {
39
- "@vuepress/helper": "2.0.0-rc.122",
40
- "vue": "^3.5.27"
47
+ "@vuepress/helper": "2.0.0-rc.124",
48
+ "vue": "^3.5.29"
41
49
  },
42
50
  "peerDependencies": {
43
51
  "vuepress": "2.0.0-rc.26"
44
52
  },
45
- "publishConfig": {
46
- "access": "public"
47
- },
48
- "gitHead": "5dfd2d24f8335f718182701995420907b0a00905"
53
+ "gitHead": "f17e7479b1ef3c06814b6107df9188ba351702da"
49
54
  }
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sources":["../../src/client/composables/useUmamiAnalytics.ts"],"sourcesContent":["import type { UmamiOptions } from '../../shared/index.js'\nimport './declare.js'\n\n/**\n * Initialize Umami Analytics tracking\n *\n * 初始化 Umami Analytics 追踪\n *\n * @param options - Umami Analytics options\n *\n * @description Injects Umami tracking script and configures tracking behavior.\n * The global `umami.track()` function will be available for custom event tracking.\n *\n * 注入 Umami 追踪脚本并配置追踪行为。\n * 全局 `umami.track()` 函数可用于自定义事件追踪。\n *\n * @see https://umami.is/docs/tracker-functions\n * @see https://umami.is/docs/tracker-configuration\n */\nexport const useUmamiAnalytics = ({\n link = 'https://us.umami.is/script.js',\n id,\n domains,\n autoTrack,\n cache,\n hostUrl,\n}: UmamiOptions): void => {\n // avoid duplicated import\n if ('umami' in window) return\n\n const script = document.createElement('script')\n script.src = link!\n script.async = true\n script.setAttribute('data-website-id', id)\n\n if (autoTrack === false) script.setAttribute('data-auto-track', 'false')\n if (cache) script.setAttribute('data-cache', 'true')\n if (domains) script.setAttribute('data-domains', domains.join(','))\n if (hostUrl) script.setAttribute('data-hostUrl', hostUrl)\n\n document.head.appendChild(script)\n}\n"],"names":["useUmamiAnalytics","link","id","domains","autoTrack","cache","hostUrl","script"],"mappings":"AAmBO,MAAMA,EAAoB,CAAC,CAChC,KAAAC,EAAO,gCACP,GAAAC,EACA,QAAAC,EACA,UAAAC,EACA,MAAAC,EACA,QAAAC,CACF,IAA0B,CAExB,GAAI,UAAW,OAAQ,OAEvB,MAAMC,EAAS,SAAS,cAAc,QAAQ,EAC9CA,EAAO,IAAMN,EACbM,EAAO,MAAQ,GACfA,EAAO,aAAa,kBAAmBL,CAAE,EAErCE,IAAc,IAAOG,EAAO,aAAa,kBAAmB,OAAO,EACnEF,GAAOE,EAAO,aAAa,aAAc,MAAM,EAC/CJ,GAASI,EAAO,aAAa,eAAgBJ,EAAQ,KAAK,GAAG,CAAC,EAC9DG,GAASC,EAAO,aAAa,eAAgBD,CAAO,EAExD,SAAS,KAAK,YAAYC,CAAM,CAClC"}