@vuepress/plugin-umami-analytics 2.0.0-rc.122 → 2.0.0-rc.123
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/index.d.ts +2 -2
- package/lib/client/index.js +1 -1
- package/lib/client/index.js.map +1 -1
- package/lib/node/index.d.ts +2 -5
- package/lib/node/index.js.map +1 -1
- package/package.json +20 -20
package/lib/client/index.d.ts
CHANGED
package/lib/client/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const
|
|
1
|
+
const d=({link:e="https://us.umami.is/script.js",id:c,domains:a,autoTrack:i,cache:n,hostUrl:s})=>{if("umami"in window)return;const t=document.createElement("script");t.src=e,t.async=!0,t.dataset.websiteId=c,i===!1&&(t.dataset.autoTrack="false"),n&&(t.dataset.cache="true"),a&&(t.dataset.domains=a.join(",")),s&&(t.dataset.hostUrl=s),document.head.append(t)};export{d as useUmamiAnalytics};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/lib/client/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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.
|
|
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"}
|
package/lib/node/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Plugin } from 'vuepress/core';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* Options for
|
|
4
|
+
* Options for `@vuepress/plugin-umami-analytics`
|
|
5
5
|
*
|
|
6
|
-
*
|
|
6
|
+
* `@vuepress/plugin-umami-analytics` 插件选项
|
|
7
7
|
*/
|
|
8
8
|
interface UmamiOptions {
|
|
9
9
|
/**
|
|
@@ -85,9 +85,6 @@ interface UmamiOptions {
|
|
|
85
85
|
*
|
|
86
86
|
* VuePress 的 Umami Analytics 插件
|
|
87
87
|
*
|
|
88
|
-
* @param options - Plugin options
|
|
89
|
-
* @returns VuePress plugin
|
|
90
|
-
*
|
|
91
88
|
* @description Integrates Umami Analytics tracking into VuePress applications.
|
|
92
89
|
* Only active in production builds when a valid website ID is provided.
|
|
93
90
|
*
|
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 * @
|
|
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) {\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,EA2BxBG,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"}
|
package/package.json
CHANGED
|
@@ -1,49 +1,49 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vuepress/plugin-umami-analytics",
|
|
3
|
-
"version": "2.0.0-rc.
|
|
3
|
+
"version": "2.0.0-rc.123",
|
|
4
4
|
"description": "VuePress plugin - umami-analytics",
|
|
5
5
|
"keywords": [
|
|
6
|
-
"
|
|
7
|
-
"vuepress",
|
|
6
|
+
"analytics",
|
|
8
7
|
"plugin",
|
|
9
8
|
"umami",
|
|
10
|
-
"
|
|
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
|
},
|
|
22
|
+
"repository": {
|
|
23
|
+
"type": "git",
|
|
24
|
+
"url": "git+https://github.com/vuepress/ecosystem.git",
|
|
25
|
+
"directory": "plugins/analytics/plugin-umami-analytics"
|
|
26
|
+
},
|
|
27
|
+
"files": [
|
|
28
|
+
"lib"
|
|
29
|
+
],
|
|
27
30
|
"type": "module",
|
|
31
|
+
"main": "./lib/node/index.js",
|
|
32
|
+
"types": "./lib/node/index.d.ts",
|
|
28
33
|
"exports": {
|
|
29
34
|
".": "./lib/node/index.js",
|
|
30
35
|
"./client": "./lib/client/index.js",
|
|
31
36
|
"./package.json": "./package.json"
|
|
32
37
|
},
|
|
33
|
-
"
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
"lib"
|
|
37
|
-
],
|
|
38
|
+
"publishConfig": {
|
|
39
|
+
"access": "public"
|
|
40
|
+
},
|
|
38
41
|
"dependencies": {
|
|
39
|
-
"@vuepress/helper": "2.0.0-rc.
|
|
40
|
-
"vue": "^3.5.
|
|
42
|
+
"@vuepress/helper": "2.0.0-rc.123",
|
|
43
|
+
"vue": "^3.5.28"
|
|
41
44
|
},
|
|
42
45
|
"peerDependencies": {
|
|
43
46
|
"vuepress": "2.0.0-rc.26"
|
|
44
47
|
},
|
|
45
|
-
"
|
|
46
|
-
"access": "public"
|
|
47
|
-
},
|
|
48
|
-
"gitHead": "5dfd2d24f8335f718182701995420907b0a00905"
|
|
48
|
+
"gitHead": "4d944d5826c6ed0487caa973516f9db0194dc934"
|
|
49
49
|
}
|