@vuepress/plugin-umami-analytics 2.0.0-rc.123 → 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.
- package/lib/client/config.d.ts +5 -3
- package/lib/client/config.js +2 -2
- package/lib/client/config.js.map +1 -1
- package/lib/client/index.d.ts +12 -92
- package/lib/client/index.js +1 -2
- package/lib/node/index.d.ts +10 -85
- package/lib/node/index.js +2 -2
- package/lib/node/index.js.map +1 -1
- package/lib/options-zTn9E-2W.d.ts +83 -0
- package/lib/useUmamiAnalytics-DJNf4qED.js +2 -0
- package/lib/useUmamiAnalytics-DJNf4qED.js.map +1 -0
- package/package.json +13 -8
- package/lib/client/index.js.map +0 -1
package/lib/client/config.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import * as
|
|
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
|
package/lib/client/config.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
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
|
package/lib/client/config.js.map
CHANGED
|
@@ -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"],"
|
|
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"}
|
package/lib/client/index.d.ts
CHANGED
|
@@ -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: ({
|
|
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
|
package/lib/client/index.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
import{t as e}from"../useUmamiAnalytics-DJNf4qED.js";export{e as useUmamiAnalytics};
|
package/lib/node/index.d.ts
CHANGED
|
@@ -1,85 +1,7 @@
|
|
|
1
|
-
import {
|
|
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
|
*
|
|
@@ -105,7 +27,10 @@ interface UmamiOptions {
|
|
|
105
27
|
* }
|
|
106
28
|
* ```
|
|
107
29
|
*/
|
|
108
|
-
declare const umamiAnalyticsPlugin: ({
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
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
|
|
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
|
package/lib/node/index.js.map
CHANGED
|
@@ -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 * @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)
|
|
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,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vuepress/plugin-umami-analytics",
|
|
3
|
-
"version": "2.0.0-rc.
|
|
3
|
+
"version": "2.0.0-rc.124",
|
|
4
4
|
"description": "VuePress plugin - umami-analytics",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"analytics",
|
|
@@ -28,22 +28,27 @@
|
|
|
28
28
|
"lib"
|
|
29
29
|
],
|
|
30
30
|
"type": "module",
|
|
31
|
-
"
|
|
32
|
-
"types": "./lib/node/index.d.ts",
|
|
31
|
+
"sideEffects": false,
|
|
33
32
|
"exports": {
|
|
34
|
-
".":
|
|
35
|
-
|
|
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
|
+
},
|
|
36
41
|
"./package.json": "./package.json"
|
|
37
42
|
},
|
|
38
43
|
"publishConfig": {
|
|
39
44
|
"access": "public"
|
|
40
45
|
},
|
|
41
46
|
"dependencies": {
|
|
42
|
-
"@vuepress/helper": "2.0.0-rc.
|
|
43
|
-
"vue": "^3.5.
|
|
47
|
+
"@vuepress/helper": "2.0.0-rc.124",
|
|
48
|
+
"vue": "^3.5.29"
|
|
44
49
|
},
|
|
45
50
|
"peerDependencies": {
|
|
46
51
|
"vuepress": "2.0.0-rc.26"
|
|
47
52
|
},
|
|
48
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "f17e7479b1ef3c06814b6107df9188ba351702da"
|
|
49
54
|
}
|
package/lib/client/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","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"],"names":["useUmamiAnalytics","link","id","domains","autoTrack","cache","hostUrl","script"],"mappings":"AAoBO,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,QAAQ,UAAYL,EAEvBE,IAAc,KAAOG,EAAO,QAAQ,UAAY,SAChDF,IAAOE,EAAO,QAAQ,MAAQ,QAC9BJ,IAASI,EAAO,QAAQ,QAAUJ,EAAQ,KAAK,GAAG,GAClDG,IAASC,EAAO,QAAQ,QAAUD,GAEtC,SAAS,KAAK,OAAOC,CAAM,CAC7B"}
|