giime 0.9.5-beta.1 → 0.9.6-beta.1
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/es/giime/index.mjs +1 -0
- package/es/giime/index.mjs.map +1 -1
- package/es/giime/version.d.ts +1 -1
- package/es/giime/version.mjs +1 -1
- package/es/giime/version.mjs.map +1 -1
- package/es/hooks/__tests__/base/usePasteFile.test.d.ts +1 -0
- package/es/hooks/base/index.d.ts +1 -0
- package/es/hooks/base/index.mjs +1 -0
- package/es/hooks/base/index.mjs.map +1 -1
- package/es/hooks/index.mjs +1 -0
- package/es/hooks/index.mjs.map +1 -1
- package/es/utils/src/clarity/index.mjs +31 -7
- package/es/utils/src/clarity/index.mjs.map +1 -1
- package/lib/giime/index.js +42 -40
- package/lib/giime/index.js.map +1 -1
- package/lib/giime/version.d.ts +1 -1
- package/lib/giime/version.js +1 -1
- package/lib/giime/version.js.map +1 -1
- package/lib/hooks/__tests__/base/usePasteFile.test.d.ts +1 -0
- package/lib/hooks/base/index.d.ts +1 -0
- package/lib/hooks/base/index.js +2 -0
- package/lib/hooks/base/index.js.map +1 -1
- package/lib/hooks/index.js +42 -40
- package/lib/hooks/index.js.map +1 -1
- package/lib/utils/src/clarity/index.js +31 -7
- package/lib/utils/src/clarity/index.js.map +1 -1
- package/package.json +1 -1
package/es/giime/index.mjs
CHANGED
|
@@ -345,6 +345,7 @@ export { useAxios } from '../hooks/base/useAxios/index.mjs';
|
|
|
345
345
|
export { useElementRemainingHeight } from '../hooks/base/useElementRemainingHeight/index.mjs';
|
|
346
346
|
export { useUploadFile } from '../hooks/base/useUploadFile/index.mjs';
|
|
347
347
|
export { useDictionary } from '../hooks/base/useDictionary/index.mjs';
|
|
348
|
+
export { usePasteFile } from '../hooks/base/usePasteFile/index.mjs';
|
|
348
349
|
export { useLoginStore } from '../hooks/store/useLogin/index.mjs';
|
|
349
350
|
export { useCustomSettingsStore } from '../hooks/store/useCustomSettings/index.mjs';
|
|
350
351
|
export { useLineListStore } from '../hooks/store/useLineList/index.mjs';
|
package/es/giime/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../../packages/giime/index.ts"],"sourcesContent":["import installer from './defaults';\nimport './tailwind.css';\nexport * from '@giime/utils';\nexport * from '@giime/components';\nexport * from '@giime/hooks';\n// export * from '@giime/api'; // 用户通过giime/es/api 导入类型\nexport const install = installer.install;\nexport const version = installer.version;\nexport default installer;\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../../packages/giime/index.ts"],"sourcesContent":["import installer from './defaults';\nimport './tailwind.css';\nexport * from '@giime/utils';\nexport * from '@giime/components';\nexport * from '@giime/hooks';\n// export * from '@giime/api'; // 用户通过giime/es/api 导入类型\nexport const install = installer.install;\nexport const version = installer.version;\nexport default installer;\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMO,MAAM,UAAU,SAAA,CAAU;AAC1B,MAAM,UAAU,SAAA,CAAU;;;;"}
|
package/es/giime/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "0.9.
|
|
1
|
+
export declare const version = "0.9.6-beta.1";
|
package/es/giime/version.mjs
CHANGED
package/es/giime/version.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.mjs","sources":["../../../../packages/giime/version.ts"],"sourcesContent":["export const version = '0.9.
|
|
1
|
+
{"version":3,"file":"version.mjs","sources":["../../../../packages/giime/version.ts"],"sourcesContent":["export const version = '0.9.6-beta.1';\n"],"names":[],"mappings":"AAAO,MAAM,OAAA,GAAU;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/es/hooks/base/index.d.ts
CHANGED
package/es/hooks/base/index.mjs
CHANGED
|
@@ -10,4 +10,5 @@ export { useAxios } from './useAxios/index.mjs';
|
|
|
10
10
|
export { useElementRemainingHeight } from './useElementRemainingHeight/index.mjs';
|
|
11
11
|
export { useUploadFile } from './useUploadFile/index.mjs';
|
|
12
12
|
export { useDictionary } from './useDictionary/index.mjs';
|
|
13
|
+
export { usePasteFile } from './usePasteFile/index.mjs';
|
|
13
14
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;"}
|
package/es/hooks/index.mjs
CHANGED
|
@@ -12,6 +12,7 @@ export { useAxios } from './base/useAxios/index.mjs';
|
|
|
12
12
|
export { useElementRemainingHeight } from './base/useElementRemainingHeight/index.mjs';
|
|
13
13
|
export { useUploadFile } from './base/useUploadFile/index.mjs';
|
|
14
14
|
export { useDictionary } from './base/useDictionary/index.mjs';
|
|
15
|
+
export { usePasteFile } from './base/usePasteFile/index.mjs';
|
|
15
16
|
export { useLoginStore } from './store/useLogin/index.mjs';
|
|
16
17
|
export { useCustomSettingsStore } from './store/useCustomSettings/index.mjs';
|
|
17
18
|
export { useLineListStore } from './store/useLineList/index.mjs';
|
package/es/hooks/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -54,38 +54,62 @@ const Clarity = {
|
|
|
54
54
|
* 设置标签
|
|
55
55
|
*/
|
|
56
56
|
setTag(key, value) {
|
|
57
|
-
window.clarity
|
|
57
|
+
if (typeof window.clarity === "function") {
|
|
58
|
+
window.clarity("set", key, value);
|
|
59
|
+
} else {
|
|
60
|
+
console.warn("[Clarity] window.clarity \u4E0D\u53EF\u7528");
|
|
61
|
+
}
|
|
58
62
|
},
|
|
59
63
|
/**
|
|
60
64
|
* 识别用户
|
|
61
65
|
*/
|
|
62
66
|
identify(options) {
|
|
63
|
-
|
|
64
|
-
|
|
67
|
+
if (typeof window.clarity === "function") {
|
|
68
|
+
const { customId, customSessionId, customPageId, friendlyName } = options;
|
|
69
|
+
window.clarity("identify", customId, customSessionId, customPageId, friendlyName);
|
|
70
|
+
} else {
|
|
71
|
+
console.warn("[Clarity] window.clarity \u4E0D\u53EF\u7528");
|
|
72
|
+
}
|
|
65
73
|
},
|
|
66
74
|
/**
|
|
67
75
|
* 同意追踪
|
|
68
76
|
*/
|
|
69
77
|
consent(consent = true) {
|
|
70
|
-
window.clarity
|
|
78
|
+
if (typeof window.clarity === "function") {
|
|
79
|
+
window.clarity("consent", consent);
|
|
80
|
+
} else {
|
|
81
|
+
console.warn("[Clarity] window.clarity \u4E0D\u53EF\u7528");
|
|
82
|
+
}
|
|
71
83
|
},
|
|
72
84
|
/**
|
|
73
85
|
* 同意追踪 V2
|
|
74
86
|
*/
|
|
75
87
|
consentV2(options = { ad_Storage: "granted", analytics_Storage: "granted" }) {
|
|
76
|
-
window.clarity
|
|
88
|
+
if (typeof window.clarity === "function") {
|
|
89
|
+
window.clarity("consentv2", options);
|
|
90
|
+
} else {
|
|
91
|
+
console.warn("[Clarity] window.clarity \u4E0D\u53EF\u7528");
|
|
92
|
+
}
|
|
77
93
|
},
|
|
78
94
|
/**
|
|
79
95
|
* 升级会话
|
|
80
96
|
*/
|
|
81
97
|
upgrade(reason) {
|
|
82
|
-
window.clarity
|
|
98
|
+
if (typeof window.clarity === "function") {
|
|
99
|
+
window.clarity("upgrade", reason);
|
|
100
|
+
} else {
|
|
101
|
+
console.warn("[Clarity] window.clarity \u4E0D\u53EF\u7528");
|
|
102
|
+
}
|
|
83
103
|
},
|
|
84
104
|
/**
|
|
85
105
|
* 发送自定义事件
|
|
86
106
|
*/
|
|
87
107
|
event(eventName) {
|
|
88
|
-
window.clarity
|
|
108
|
+
if (typeof window.clarity === "function") {
|
|
109
|
+
window.clarity("event", eventName);
|
|
110
|
+
} else {
|
|
111
|
+
console.warn("[Clarity] window.clarity \u4E0D\u53EF\u7528");
|
|
112
|
+
}
|
|
89
113
|
}
|
|
90
114
|
};
|
|
91
115
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../../../../packages/utils/src/clarity/index.ts"],"sourcesContent":["import { until } from '@vueuse/core';\nimport { useCurrentUserStore } from '@giime/hooks/store/userCenter/useCurrentUser';\n\nexport interface ClarityInitOptions {\n /**\n * 是否自动识别用户信息\n * @default true\n */\n autoIdentify?: boolean;\n}\n\nexport interface ClarityIdentifyOptions {\n customId: string;\n customSessionId?: string;\n customPageId?: string;\n friendlyName?: string;\n}\n\nexport interface ClarityConsentV2Options {\n ad_Storage: 'granted' | 'denied';\n analytics_Storage: 'granted' | 'denied';\n}\n\ndeclare global {\n interface Window {\n clarity: (...args: any[]) => void;\n }\n}\n\n/**\n * 注入 Clarity 脚本\n */\nconst injectScript = (projectId: string) => {\n try {\n (function (c: any, l: Document, a: string, r: string, i: string, t?: any, y?: any) {\n if (l.getElementById('clarity-script')) {\n return;\n }\n c[a] =\n c[a] ||\n function () {\n // eslint-disable-next-line prefer-rest-params\n (c[a].q = c[a].q || []).push(arguments);\n };\n t = l.createElement(r);\n t.async = 1;\n t.src = 'https://www.clarity.ms/tag/' + i + '?ref=npm';\n t.id = 'clarity-script';\n y = l.getElementsByTagName(r)[0];\n y.parentNode.insertBefore(t, y);\n })(window, document, 'clarity', 'script', projectId);\n } catch {\n // ignore\n }\n};\n\n/**\n * 自动识别用户信息\n */\nconst autoIdentifyUser = async () => {\n const currentUserStore = useCurrentUserStore();\n\n // 等待 userInfo 变为有效值\n await until(() => currentUserStore.userInfo?.id).toBeTruthy();\n\n const userInfo = {\n id: currentUserStore.userInfo?.id?.toString() || '',\n name: currentUserStore.userInfo?.name?.toString() || '',\n };\n\n Clarity.identify({\n customId: userInfo.id,\n customSessionId: userInfo.id,\n customPageId: '',\n friendlyName: `${userInfo.name} - ${userInfo.id}`,\n });\n};\n\n/**\n * Microsoft Clarity 封装\n *\n * @example\n * ```ts\n * // 自动识别用户信息\n * Clarity.init('your-project-id');\n *\n * // 手动设置用户信息\n * Clarity.init('your-project-id', { autoIdentify: false });\n * Clarity.identify({ customId: 'user-id', friendlyName: 'User Name' });\n * ```\n */\nexport const Clarity = {\n /**\n * 初始化 Clarity\n * @param projectId 项目 ID\n * @param options 配置选项\n */\n init(projectId: string, options: ClarityInitOptions = {}) {\n const { autoIdentify = true } = options;\n\n if (!projectId) {\n return;\n }\n\n injectScript(projectId);\n\n if (autoIdentify) {\n autoIdentifyUser();\n }\n },\n\n /**\n * 设置标签\n */\n setTag(key: string, value: string | string[]) {\n window.clarity('set', key, value);\n },\n\n /**\n * 识别用户\n */\n identify(options: ClarityIdentifyOptions) {\n const { customId, customSessionId, customPageId, friendlyName } = options;\n
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../../../../packages/utils/src/clarity/index.ts"],"sourcesContent":["import { until } from '@vueuse/core';\nimport { useCurrentUserStore } from '@giime/hooks/store/userCenter/useCurrentUser';\n\nexport interface ClarityInitOptions {\n /**\n * 是否自动识别用户信息\n * @default true\n */\n autoIdentify?: boolean;\n}\n\nexport interface ClarityIdentifyOptions {\n customId: string;\n customSessionId?: string;\n customPageId?: string;\n friendlyName?: string;\n}\n\nexport interface ClarityConsentV2Options {\n ad_Storage: 'granted' | 'denied';\n analytics_Storage: 'granted' | 'denied';\n}\n\ndeclare global {\n interface Window {\n clarity: (...args: any[]) => void;\n }\n}\n\n/**\n * 注入 Clarity 脚本\n */\nconst injectScript = (projectId: string) => {\n try {\n (function (c: any, l: Document, a: string, r: string, i: string, t?: any, y?: any) {\n if (l.getElementById('clarity-script')) {\n return;\n }\n c[a] =\n c[a] ||\n function () {\n // eslint-disable-next-line prefer-rest-params\n (c[a].q = c[a].q || []).push(arguments);\n };\n t = l.createElement(r);\n t.async = 1;\n t.src = 'https://www.clarity.ms/tag/' + i + '?ref=npm';\n t.id = 'clarity-script';\n y = l.getElementsByTagName(r)[0];\n y.parentNode.insertBefore(t, y);\n })(window, document, 'clarity', 'script', projectId);\n } catch {\n // ignore\n }\n};\n\n/**\n * 自动识别用户信息\n */\nconst autoIdentifyUser = async () => {\n const currentUserStore = useCurrentUserStore();\n\n // 等待 userInfo 变为有效值\n await until(() => currentUserStore.userInfo?.id).toBeTruthy();\n\n const userInfo = {\n id: currentUserStore.userInfo?.id?.toString() || '',\n name: currentUserStore.userInfo?.name?.toString() || '',\n };\n\n Clarity.identify({\n customId: userInfo.id,\n customSessionId: userInfo.id,\n customPageId: '',\n friendlyName: `${userInfo.name} - ${userInfo.id}`,\n });\n};\n\n/**\n * Microsoft Clarity 封装\n *\n * @example\n * ```ts\n * // 自动识别用户信息\n * Clarity.init('your-project-id');\n *\n * // 手动设置用户信息\n * Clarity.init('your-project-id', { autoIdentify: false });\n * Clarity.identify({ customId: 'user-id', friendlyName: 'User Name' });\n * ```\n */\nexport const Clarity = {\n /**\n * 初始化 Clarity\n * @param projectId 项目 ID\n * @param options 配置选项\n */\n init(projectId: string, options: ClarityInitOptions = {}) {\n const { autoIdentify = true } = options;\n\n if (!projectId) {\n return;\n }\n\n injectScript(projectId);\n\n if (autoIdentify) {\n autoIdentifyUser();\n }\n },\n\n /**\n * 设置标签\n */\n setTag(key: string, value: string | string[]) {\n if (typeof window.clarity === 'function') {\n window.clarity('set', key, value);\n } else {\n console.warn('[Clarity] window.clarity 不可用');\n }\n },\n\n /**\n * 识别用户\n */\n identify(options: ClarityIdentifyOptions) {\n if (typeof window.clarity === 'function') {\n const { customId, customSessionId, customPageId, friendlyName } = options;\n window.clarity('identify', customId, customSessionId, customPageId, friendlyName);\n } else {\n console.warn('[Clarity] window.clarity 不可用');\n }\n },\n\n /**\n * 同意追踪\n */\n consent(consent = true) {\n if (typeof window.clarity === 'function') {\n window.clarity('consent', consent);\n } else {\n console.warn('[Clarity] window.clarity 不可用');\n }\n },\n\n /**\n * 同意追踪 V2\n */\n consentV2(options: ClarityConsentV2Options = { ad_Storage: 'granted', analytics_Storage: 'granted' }) {\n if (typeof window.clarity === 'function') {\n window.clarity('consentv2', options);\n } else {\n console.warn('[Clarity] window.clarity 不可用');\n }\n },\n\n /**\n * 升级会话\n */\n upgrade(reason: string) {\n if (typeof window.clarity === 'function') {\n window.clarity('upgrade', reason);\n } else {\n console.warn('[Clarity] window.clarity 不可用');\n }\n },\n\n /**\n * 发送自定义事件\n */\n event(eventName: string) {\n if (typeof window.clarity === 'function') {\n window.clarity('event', eventName);\n } else {\n console.warn('[Clarity] window.clarity 不可用');\n }\n },\n};\n"],"names":[],"mappings":";;;AAgCA,MAAM,YAAA,GAAe,CAAC,SAAA,KAAsB;AAC1C,EAAA,IAAI;AACF,IAAA,CAAC,SAAU,CAAA,EAAQ,CAAA,EAAa,GAAW,CAAA,EAAW,CAAA,EAAW,GAAS,CAAA,EAAS;AACjF,MAAA,IAAI,CAAA,CAAE,cAAA,CAAe,gBAAgB,CAAA,EAAG;AACtC,QAAA;AAAA,MACF;AACA,MAAA,CAAA,CAAE,CAAC,CAAA,GACD,CAAA,CAAE,CAAC,KACH,WAAY;AAEV,QAAA,CAAC,CAAA,CAAE,CAAC,CAAA,CAAE,CAAA,GA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AA;AAAA,IAC7C;AAAA,EACF,CAAA;AAAA;AAAA;AAAA;AAAA,EAKA,UAAU,OAAA,GAAmC,EAAE,YAAY,SAAA,EAAW,iBAAA,EAAmB,WAAU,EAAG;AACpG,IAAA,IAAI,OAAO,MAAA,CAAO,OAAA,KAAY,UAAA,EAAY;AACxC,MAAA,MAAA,CAAO,OAAA,CAAQ,aAAa,OAAO,CAAA;AAAA,IACrC,CAAA,MAAO;AACL,MAAA,OAAA,CAAQ,KAAK,6CAA8B,CAAA;AAAA,IAC7C;AAAA,EACF,CAAA;AAAA;AAAA;AAAA;AAAA,EAKA,QAAQ,MAAA,EAAgB;AACtB,IAAA,IAAI,OAAO,MAAA,CAAO,OAAA,KAAY,UAAA,EAAY;AACxC,MAAA,MAAA,CAAO,OAAA,CAAQ,WAAW,MAAM,CAAA;AAAA,IAClC,CAAA,MAAO;AACL,MAAA,OAAA,CAAQ,KAAK,6CAA8B,CAAA;AAAA,IAC7C;AAAA,EACF,CAAA;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM,SAAA,EAAmB;AACvB,IAAA,IAAI,OAAO,MAAA,CAAO,OAAA,KAAY,UAAA,EAAY;AACxC,MAAA,MAAA,CAAO,OAAA,CAAQ,SAAS,SAAS,CAAA;AAAA,IACnC,CAAA,MAAO;AACL,MAAA,OAAA,CAAQ,KAAK,6CAA8B,CAAA;AAAA,IAC7C;AAAA,EACF;AACF;;;;"}
|
package/lib/giime/index.js
CHANGED
|
@@ -349,26 +349,27 @@ var index$2z = require('../hooks/base/useAxios/index.js');
|
|
|
349
349
|
var index$2A = require('../hooks/base/useElementRemainingHeight/index.js');
|
|
350
350
|
var index$2B = require('../hooks/base/useUploadFile/index.js');
|
|
351
351
|
var index$2C = require('../hooks/base/useDictionary/index.js');
|
|
352
|
-
var index$2D = require('../hooks/
|
|
353
|
-
var index$2E = require('../hooks/store/
|
|
354
|
-
var index$2F = require('../hooks/store/
|
|
355
|
-
var index$2G = require('../hooks/store/
|
|
356
|
-
var index$2H = require('../hooks/store/
|
|
357
|
-
var index$2I = require('../hooks/store/
|
|
358
|
-
var index$2J = require('../hooks/store/
|
|
359
|
-
var index$2K = require('../hooks/store/
|
|
360
|
-
var index$2L = require('../hooks/store/
|
|
361
|
-
var index$2M = require('../hooks/store/common/
|
|
362
|
-
var index$2N = require('../hooks/store/common/
|
|
363
|
-
var index$2O = require('../hooks/store/common/
|
|
364
|
-
var index$2P = require('../hooks/store/
|
|
365
|
-
var index$2Q = require('../hooks/store/userCenter/
|
|
366
|
-
var index$2R = require('../hooks/store/userCenter/
|
|
367
|
-
var index$2S = require('../hooks/store/userCenter/
|
|
368
|
-
var index$2T = require('../hooks/store/userCenter/
|
|
369
|
-
var index$2U = require('../hooks/store/
|
|
370
|
-
var index$2V = require('../hooks/store/
|
|
371
|
-
var index$2W = require('../hooks/store/
|
|
352
|
+
var index$2D = require('../hooks/base/usePasteFile/index.js');
|
|
353
|
+
var index$2E = require('../hooks/store/useLogin/index.js');
|
|
354
|
+
var index$2F = require('../hooks/store/useCustomSettings/index.js');
|
|
355
|
+
var index$2G = require('../hooks/store/useLineList/index.js');
|
|
356
|
+
var index$2H = require('../hooks/store/usePlatformLineList/index.js');
|
|
357
|
+
var index$2I = require('../hooks/store/useOrgUserList/index.js');
|
|
358
|
+
var index$2J = require('../hooks/store/useAliCategoryList/index.js');
|
|
359
|
+
var index$2K = require('../hooks/store/useCompanyCategoryList/index.js');
|
|
360
|
+
var index$2L = require('../hooks/store/useRepiteFilter/index.js');
|
|
361
|
+
var index$2M = require('../hooks/store/common/useCurrencyList/index.js');
|
|
362
|
+
var index$2N = require('../hooks/store/common/useCountryList/index.js');
|
|
363
|
+
var index$2O = require('../hooks/store/common/useSystemList/index.js');
|
|
364
|
+
var index$2P = require('../hooks/store/common/useLangList/index.js');
|
|
365
|
+
var index$2Q = require('../hooks/store/userCenter/useOrgList/index.js');
|
|
366
|
+
var index$2R = require('../hooks/store/userCenter/useAreaList/index.js');
|
|
367
|
+
var index$2S = require('../hooks/store/userCenter/useRoleList/index.js');
|
|
368
|
+
var index$2T = require('../hooks/store/userCenter/useOrgTreeList/index.js');
|
|
369
|
+
var index$2U = require('../hooks/store/userCenter/useCurrentUser/index.js');
|
|
370
|
+
var index$2V = require('../hooks/store/usePlatformList/index.js');
|
|
371
|
+
var index$2W = require('../hooks/store/useAliOssConfigs/index.js');
|
|
372
|
+
var index$2X = require('../hooks/store/useUploadTask/index.js');
|
|
372
373
|
|
|
373
374
|
const install = defaults.default.install;
|
|
374
375
|
const version = defaults.default.version;
|
|
@@ -935,26 +936,27 @@ exports.useAxios = index$2z.useAxios;
|
|
|
935
936
|
exports.useElementRemainingHeight = index$2A.useElementRemainingHeight;
|
|
936
937
|
exports.useUploadFile = index$2B.useUploadFile;
|
|
937
938
|
exports.useDictionary = index$2C.useDictionary;
|
|
938
|
-
exports.
|
|
939
|
-
exports.
|
|
940
|
-
exports.
|
|
941
|
-
exports.
|
|
942
|
-
exports.
|
|
943
|
-
exports.
|
|
944
|
-
exports.
|
|
945
|
-
exports.
|
|
946
|
-
exports.
|
|
947
|
-
exports.
|
|
948
|
-
exports.
|
|
949
|
-
exports.
|
|
950
|
-
exports.
|
|
951
|
-
exports.
|
|
952
|
-
exports.
|
|
953
|
-
exports.
|
|
954
|
-
exports.
|
|
955
|
-
exports.
|
|
956
|
-
exports.
|
|
957
|
-
exports.
|
|
939
|
+
exports.usePasteFile = index$2D.usePasteFile;
|
|
940
|
+
exports.useLoginStore = index$2E.useLoginStore;
|
|
941
|
+
exports.useCustomSettingsStore = index$2F.useCustomSettingsStore;
|
|
942
|
+
exports.useLineListStore = index$2G.useLineListStore;
|
|
943
|
+
exports.usePlatformLineListStore = index$2H.usePlatformLineListStore;
|
|
944
|
+
exports.useOrgUserListStore = index$2I.useOrgUserListStore;
|
|
945
|
+
exports.useAliCategoryListStore = index$2J.useAliCategoryListStore;
|
|
946
|
+
exports.useCompanyCategoryListStore = index$2K.useCompanyCategoryListStore;
|
|
947
|
+
exports.useRepiteFilterStore = index$2L.useRepiteFilterStore;
|
|
948
|
+
exports.useCurrencyListStore = index$2M.useCurrencyListStore;
|
|
949
|
+
exports.useCountryListStore = index$2N.useCountryListStore;
|
|
950
|
+
exports.useSystemListStore = index$2O.useSystemListStore;
|
|
951
|
+
exports.useLangListStore = index$2P.useLangListStore;
|
|
952
|
+
exports.useOrgListStore = index$2Q.useOrgListStore;
|
|
953
|
+
exports.useAreaListStore = index$2R.useAreaListStore;
|
|
954
|
+
exports.useRoleListStore = index$2S.useRoleListStore;
|
|
955
|
+
exports.useOrgTreeListStore = index$2T.useOrgTreeListStore;
|
|
956
|
+
exports.useCurrentUserStore = index$2U.useCurrentUserStore;
|
|
957
|
+
exports.usePlatformListStore = index$2V.usePlatformListStore;
|
|
958
|
+
exports.useAliOssConfigsStore = index$2W.useAliOssConfigsStore;
|
|
959
|
+
exports.useUploadTaskStore = index$2X.useUploadTaskStore;
|
|
958
960
|
exports.install = install;
|
|
959
961
|
exports.version = version;
|
|
960
962
|
//# sourceMappingURL=index.js.map
|
package/lib/giime/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../packages/giime/index.ts"],"sourcesContent":["import installer from './defaults';\nimport './tailwind.css';\nexport * from '@giime/utils';\nexport * from '@giime/components';\nexport * from '@giime/hooks';\n// export * from '@giime/api'; // 用户通过giime/es/api 导入类型\nexport const install = installer.install;\nexport const version = installer.version;\nexport default installer;\n"],"names":["installer"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../packages/giime/index.ts"],"sourcesContent":["import installer from './defaults';\nimport './tailwind.css';\nexport * from '@giime/utils';\nexport * from '@giime/components';\nexport * from '@giime/hooks';\n// export * from '@giime/api'; // 用户通过giime/es/api 导入类型\nexport const install = installer.install;\nexport const version = installer.version;\nexport default installer;\n"],"names":["installer"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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.9.
|
|
1
|
+
export declare const version = "0.9.6-beta.1";
|
package/lib/giime/version.js
CHANGED
package/lib/giime/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sources":["../../../../packages/giime/version.ts"],"sourcesContent":["export const version = '0.9.
|
|
1
|
+
{"version":3,"file":"version.js","sources":["../../../../packages/giime/version.ts"],"sourcesContent":["export const version = '0.9.6-beta.1';\n"],"names":[],"mappings":";;AAAO,MAAM,OAAA,GAAU;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/lib/hooks/base/index.js
CHANGED
|
@@ -12,6 +12,7 @@ var index$8 = require('./useAxios/index.js');
|
|
|
12
12
|
var index$9 = require('./useElementRemainingHeight/index.js');
|
|
13
13
|
var index$a = require('./useUploadFile/index.js');
|
|
14
14
|
var index$b = require('./useDictionary/index.js');
|
|
15
|
+
var index$c = require('./usePasteFile/index.js');
|
|
15
16
|
|
|
16
17
|
|
|
17
18
|
|
|
@@ -31,4 +32,5 @@ exports.useAxios = index$8.useAxios;
|
|
|
31
32
|
exports.useElementRemainingHeight = index$9.useElementRemainingHeight;
|
|
32
33
|
exports.useUploadFile = index$a.useUploadFile;
|
|
33
34
|
exports.useDictionary = index$b.useDictionary;
|
|
35
|
+
exports.usePasteFile = index$c.usePasteFile;
|
|
34
36
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/lib/hooks/index.js
CHANGED
|
@@ -14,26 +14,27 @@ var index$8 = require('./base/useAxios/index.js');
|
|
|
14
14
|
var index$9 = require('./base/useElementRemainingHeight/index.js');
|
|
15
15
|
var index$a = require('./base/useUploadFile/index.js');
|
|
16
16
|
var index$b = require('./base/useDictionary/index.js');
|
|
17
|
-
var index$c = require('./
|
|
18
|
-
var index$d = require('./store/
|
|
19
|
-
var index$e = require('./store/
|
|
20
|
-
var index$f = require('./store/
|
|
21
|
-
var index$g = require('./store/
|
|
22
|
-
var index$h = require('./store/
|
|
23
|
-
var index$i = require('./store/
|
|
24
|
-
var index$j = require('./store/
|
|
25
|
-
var index$k = require('./store/
|
|
26
|
-
var index$l = require('./store/common/
|
|
27
|
-
var index$m = require('./store/common/
|
|
28
|
-
var index$n = require('./store/common/
|
|
29
|
-
var index$o = require('./store/
|
|
30
|
-
var index$p = require('./store/userCenter/
|
|
31
|
-
var index$q = require('./store/userCenter/
|
|
32
|
-
var index$r = require('./store/userCenter/
|
|
33
|
-
var index$s = require('./store/userCenter/
|
|
34
|
-
var index$t = require('./store/
|
|
35
|
-
var index$u = require('./store/
|
|
36
|
-
var index$v = require('./store/
|
|
17
|
+
var index$c = require('./base/usePasteFile/index.js');
|
|
18
|
+
var index$d = require('./store/useLogin/index.js');
|
|
19
|
+
var index$e = require('./store/useCustomSettings/index.js');
|
|
20
|
+
var index$f = require('./store/useLineList/index.js');
|
|
21
|
+
var index$g = require('./store/usePlatformLineList/index.js');
|
|
22
|
+
var index$h = require('./store/useOrgUserList/index.js');
|
|
23
|
+
var index$i = require('./store/useAliCategoryList/index.js');
|
|
24
|
+
var index$j = require('./store/useCompanyCategoryList/index.js');
|
|
25
|
+
var index$k = require('./store/useRepiteFilter/index.js');
|
|
26
|
+
var index$l = require('./store/common/useCurrencyList/index.js');
|
|
27
|
+
var index$m = require('./store/common/useCountryList/index.js');
|
|
28
|
+
var index$n = require('./store/common/useSystemList/index.js');
|
|
29
|
+
var index$o = require('./store/common/useLangList/index.js');
|
|
30
|
+
var index$p = require('./store/userCenter/useOrgList/index.js');
|
|
31
|
+
var index$q = require('./store/userCenter/useAreaList/index.js');
|
|
32
|
+
var index$r = require('./store/userCenter/useRoleList/index.js');
|
|
33
|
+
var index$s = require('./store/userCenter/useOrgTreeList/index.js');
|
|
34
|
+
var index$t = require('./store/userCenter/useCurrentUser/index.js');
|
|
35
|
+
var index$u = require('./store/usePlatformList/index.js');
|
|
36
|
+
var index$v = require('./store/useAliOssConfigs/index.js');
|
|
37
|
+
var index$w = require('./store/useUploadTask/index.js');
|
|
37
38
|
|
|
38
39
|
|
|
39
40
|
|
|
@@ -53,24 +54,25 @@ exports.useAxios = index$8.useAxios;
|
|
|
53
54
|
exports.useElementRemainingHeight = index$9.useElementRemainingHeight;
|
|
54
55
|
exports.useUploadFile = index$a.useUploadFile;
|
|
55
56
|
exports.useDictionary = index$b.useDictionary;
|
|
56
|
-
exports.
|
|
57
|
-
exports.
|
|
58
|
-
exports.
|
|
59
|
-
exports.
|
|
60
|
-
exports.
|
|
61
|
-
exports.
|
|
62
|
-
exports.
|
|
63
|
-
exports.
|
|
64
|
-
exports.
|
|
65
|
-
exports.
|
|
66
|
-
exports.
|
|
67
|
-
exports.
|
|
68
|
-
exports.
|
|
69
|
-
exports.
|
|
70
|
-
exports.
|
|
71
|
-
exports.
|
|
72
|
-
exports.
|
|
73
|
-
exports.
|
|
74
|
-
exports.
|
|
75
|
-
exports.
|
|
57
|
+
exports.usePasteFile = index$c.usePasteFile;
|
|
58
|
+
exports.useLoginStore = index$d.useLoginStore;
|
|
59
|
+
exports.useCustomSettingsStore = index$e.useCustomSettingsStore;
|
|
60
|
+
exports.useLineListStore = index$f.useLineListStore;
|
|
61
|
+
exports.usePlatformLineListStore = index$g.usePlatformLineListStore;
|
|
62
|
+
exports.useOrgUserListStore = index$h.useOrgUserListStore;
|
|
63
|
+
exports.useAliCategoryListStore = index$i.useAliCategoryListStore;
|
|
64
|
+
exports.useCompanyCategoryListStore = index$j.useCompanyCategoryListStore;
|
|
65
|
+
exports.useRepiteFilterStore = index$k.useRepiteFilterStore;
|
|
66
|
+
exports.useCurrencyListStore = index$l.useCurrencyListStore;
|
|
67
|
+
exports.useCountryListStore = index$m.useCountryListStore;
|
|
68
|
+
exports.useSystemListStore = index$n.useSystemListStore;
|
|
69
|
+
exports.useLangListStore = index$o.useLangListStore;
|
|
70
|
+
exports.useOrgListStore = index$p.useOrgListStore;
|
|
71
|
+
exports.useAreaListStore = index$q.useAreaListStore;
|
|
72
|
+
exports.useRoleListStore = index$r.useRoleListStore;
|
|
73
|
+
exports.useOrgTreeListStore = index$s.useOrgTreeListStore;
|
|
74
|
+
exports.useCurrentUserStore = index$t.useCurrentUserStore;
|
|
75
|
+
exports.usePlatformListStore = index$u.usePlatformListStore;
|
|
76
|
+
exports.useAliOssConfigsStore = index$v.useAliOssConfigsStore;
|
|
77
|
+
exports.useUploadTaskStore = index$w.useUploadTaskStore;
|
|
76
78
|
//# sourceMappingURL=index.js.map
|
package/lib/hooks/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -56,38 +56,62 @@ const Clarity = {
|
|
|
56
56
|
* 设置标签
|
|
57
57
|
*/
|
|
58
58
|
setTag(key, value) {
|
|
59
|
-
window.clarity
|
|
59
|
+
if (typeof window.clarity === "function") {
|
|
60
|
+
window.clarity("set", key, value);
|
|
61
|
+
} else {
|
|
62
|
+
console.warn("[Clarity] window.clarity \u4E0D\u53EF\u7528");
|
|
63
|
+
}
|
|
60
64
|
},
|
|
61
65
|
/**
|
|
62
66
|
* 识别用户
|
|
63
67
|
*/
|
|
64
68
|
identify(options) {
|
|
65
|
-
|
|
66
|
-
|
|
69
|
+
if (typeof window.clarity === "function") {
|
|
70
|
+
const { customId, customSessionId, customPageId, friendlyName } = options;
|
|
71
|
+
window.clarity("identify", customId, customSessionId, customPageId, friendlyName);
|
|
72
|
+
} else {
|
|
73
|
+
console.warn("[Clarity] window.clarity \u4E0D\u53EF\u7528");
|
|
74
|
+
}
|
|
67
75
|
},
|
|
68
76
|
/**
|
|
69
77
|
* 同意追踪
|
|
70
78
|
*/
|
|
71
79
|
consent(consent = true) {
|
|
72
|
-
window.clarity
|
|
80
|
+
if (typeof window.clarity === "function") {
|
|
81
|
+
window.clarity("consent", consent);
|
|
82
|
+
} else {
|
|
83
|
+
console.warn("[Clarity] window.clarity \u4E0D\u53EF\u7528");
|
|
84
|
+
}
|
|
73
85
|
},
|
|
74
86
|
/**
|
|
75
87
|
* 同意追踪 V2
|
|
76
88
|
*/
|
|
77
89
|
consentV2(options = { ad_Storage: "granted", analytics_Storage: "granted" }) {
|
|
78
|
-
window.clarity
|
|
90
|
+
if (typeof window.clarity === "function") {
|
|
91
|
+
window.clarity("consentv2", options);
|
|
92
|
+
} else {
|
|
93
|
+
console.warn("[Clarity] window.clarity \u4E0D\u53EF\u7528");
|
|
94
|
+
}
|
|
79
95
|
},
|
|
80
96
|
/**
|
|
81
97
|
* 升级会话
|
|
82
98
|
*/
|
|
83
99
|
upgrade(reason) {
|
|
84
|
-
window.clarity
|
|
100
|
+
if (typeof window.clarity === "function") {
|
|
101
|
+
window.clarity("upgrade", reason);
|
|
102
|
+
} else {
|
|
103
|
+
console.warn("[Clarity] window.clarity \u4E0D\u53EF\u7528");
|
|
104
|
+
}
|
|
85
105
|
},
|
|
86
106
|
/**
|
|
87
107
|
* 发送自定义事件
|
|
88
108
|
*/
|
|
89
109
|
event(eventName) {
|
|
90
|
-
window.clarity
|
|
110
|
+
if (typeof window.clarity === "function") {
|
|
111
|
+
window.clarity("event", eventName);
|
|
112
|
+
} else {
|
|
113
|
+
console.warn("[Clarity] window.clarity \u4E0D\u53EF\u7528");
|
|
114
|
+
}
|
|
91
115
|
}
|
|
92
116
|
};
|
|
93
117
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../../packages/utils/src/clarity/index.ts"],"sourcesContent":["import { until } from '@vueuse/core';\nimport { useCurrentUserStore } from '@giime/hooks/store/userCenter/useCurrentUser';\n\nexport interface ClarityInitOptions {\n /**\n * 是否自动识别用户信息\n * @default true\n */\n autoIdentify?: boolean;\n}\n\nexport interface ClarityIdentifyOptions {\n customId: string;\n customSessionId?: string;\n customPageId?: string;\n friendlyName?: string;\n}\n\nexport interface ClarityConsentV2Options {\n ad_Storage: 'granted' | 'denied';\n analytics_Storage: 'granted' | 'denied';\n}\n\ndeclare global {\n interface Window {\n clarity: (...args: any[]) => void;\n }\n}\n\n/**\n * 注入 Clarity 脚本\n */\nconst injectScript = (projectId: string) => {\n try {\n (function (c: any, l: Document, a: string, r: string, i: string, t?: any, y?: any) {\n if (l.getElementById('clarity-script')) {\n return;\n }\n c[a] =\n c[a] ||\n function () {\n // eslint-disable-next-line prefer-rest-params\n (c[a].q = c[a].q || []).push(arguments);\n };\n t = l.createElement(r);\n t.async = 1;\n t.src = 'https://www.clarity.ms/tag/' + i + '?ref=npm';\n t.id = 'clarity-script';\n y = l.getElementsByTagName(r)[0];\n y.parentNode.insertBefore(t, y);\n })(window, document, 'clarity', 'script', projectId);\n } catch {\n // ignore\n }\n};\n\n/**\n * 自动识别用户信息\n */\nconst autoIdentifyUser = async () => {\n const currentUserStore = useCurrentUserStore();\n\n // 等待 userInfo 变为有效值\n await until(() => currentUserStore.userInfo?.id).toBeTruthy();\n\n const userInfo = {\n id: currentUserStore.userInfo?.id?.toString() || '',\n name: currentUserStore.userInfo?.name?.toString() || '',\n };\n\n Clarity.identify({\n customId: userInfo.id,\n customSessionId: userInfo.id,\n customPageId: '',\n friendlyName: `${userInfo.name} - ${userInfo.id}`,\n });\n};\n\n/**\n * Microsoft Clarity 封装\n *\n * @example\n * ```ts\n * // 自动识别用户信息\n * Clarity.init('your-project-id');\n *\n * // 手动设置用户信息\n * Clarity.init('your-project-id', { autoIdentify: false });\n * Clarity.identify({ customId: 'user-id', friendlyName: 'User Name' });\n * ```\n */\nexport const Clarity = {\n /**\n * 初始化 Clarity\n * @param projectId 项目 ID\n * @param options 配置选项\n */\n init(projectId: string, options: ClarityInitOptions = {}) {\n const { autoIdentify = true } = options;\n\n if (!projectId) {\n return;\n }\n\n injectScript(projectId);\n\n if (autoIdentify) {\n autoIdentifyUser();\n }\n },\n\n /**\n * 设置标签\n */\n setTag(key: string, value: string | string[]) {\n window.clarity('set', key, value);\n },\n\n /**\n * 识别用户\n */\n identify(options: ClarityIdentifyOptions) {\n const { customId, customSessionId, customPageId, friendlyName } = options;\n
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../../packages/utils/src/clarity/index.ts"],"sourcesContent":["import { until } from '@vueuse/core';\nimport { useCurrentUserStore } from '@giime/hooks/store/userCenter/useCurrentUser';\n\nexport interface ClarityInitOptions {\n /**\n * 是否自动识别用户信息\n * @default true\n */\n autoIdentify?: boolean;\n}\n\nexport interface ClarityIdentifyOptions {\n customId: string;\n customSessionId?: string;\n customPageId?: string;\n friendlyName?: string;\n}\n\nexport interface ClarityConsentV2Options {\n ad_Storage: 'granted' | 'denied';\n analytics_Storage: 'granted' | 'denied';\n}\n\ndeclare global {\n interface Window {\n clarity: (...args: any[]) => void;\n }\n}\n\n/**\n * 注入 Clarity 脚本\n */\nconst injectScript = (projectId: string) => {\n try {\n (function (c: any, l: Document, a: string, r: string, i: string, t?: any, y?: any) {\n if (l.getElementById('clarity-script')) {\n return;\n }\n c[a] =\n c[a] ||\n function () {\n // eslint-disable-next-line prefer-rest-params\n (c[a].q = c[a].q || []).push(arguments);\n };\n t = l.createElement(r);\n t.async = 1;\n t.src = 'https://www.clarity.ms/tag/' + i + '?ref=npm';\n t.id = 'clarity-script';\n y = l.getElementsByTagName(r)[0];\n y.parentNode.insertBefore(t, y);\n })(window, document, 'clarity', 'script', projectId);\n } catch {\n // ignore\n }\n};\n\n/**\n * 自动识别用户信息\n */\nconst autoIdentifyUser = async () => {\n const currentUserStore = useCurrentUserStore();\n\n // 等待 userInfo 变为有效值\n await until(() => currentUserStore.userInfo?.id).toBeTruthy();\n\n const userInfo = {\n id: currentUserStore.userInfo?.id?.toString() || '',\n name: currentUserStore.userInfo?.name?.toString() || '',\n };\n\n Clarity.identify({\n customId: userInfo.id,\n customSessionId: userInfo.id,\n customPageId: '',\n friendlyName: `${userInfo.name} - ${userInfo.id}`,\n });\n};\n\n/**\n * Microsoft Clarity 封装\n *\n * @example\n * ```ts\n * // 自动识别用户信息\n * Clarity.init('your-project-id');\n *\n * // 手动设置用户信息\n * Clarity.init('your-project-id', { autoIdentify: false });\n * Clarity.identify({ customId: 'user-id', friendlyName: 'User Name' });\n * ```\n */\nexport const Clarity = {\n /**\n * 初始化 Clarity\n * @param projectId 项目 ID\n * @param options 配置选项\n */\n init(projectId: string, options: ClarityInitOptions = {}) {\n const { autoIdentify = true } = options;\n\n if (!projectId) {\n return;\n }\n\n injectScript(projectId);\n\n if (autoIdentify) {\n autoIdentifyUser();\n }\n },\n\n /**\n * 设置标签\n */\n setTag(key: string, value: string | string[]) {\n if (typeof window.clarity === 'function') {\n window.clarity('set', key, value);\n } else {\n console.warn('[Clarity] window.clarity 不可用');\n }\n },\n\n /**\n * 识别用户\n */\n identify(options: ClarityIdentifyOptions) {\n if (typeof window.clarity === 'function') {\n const { customId, customSessionId, customPageId, friendlyName } = options;\n window.clarity('identify', customId, customSessionId, customPageId, friendlyName);\n } else {\n console.warn('[Clarity] window.clarity 不可用');\n }\n },\n\n /**\n * 同意追踪\n */\n consent(consent = true) {\n if (typeof window.clarity === 'function') {\n window.clarity('consent', consent);\n } else {\n console.warn('[Clarity] window.clarity 不可用');\n }\n },\n\n /**\n * 同意追踪 V2\n */\n consentV2(options: ClarityConsentV2Options = { ad_Storage: 'granted', analytics_Storage: 'granted' }) {\n if (typeof window.clarity === 'function') {\n window.clarity('consentv2', options);\n } else {\n console.warn('[Clarity] window.clarity 不可用');\n }\n },\n\n /**\n * 升级会话\n */\n upgrade(reason: string) {\n if (typeof window.clarity === 'function') {\n window.clarity('upgrade', reason);\n } else {\n console.warn('[Clarity] window.clarity 不可用');\n }\n },\n\n /**\n * 发送自定义事件\n */\n event(eventName: string) {\n if (typeof window.clarity === 'function') {\n window.clarity('event', eventName);\n } else {\n console.warn('[Clarity] window.clarity 不可用');\n }\n },\n};\n"],"names":["useCurrentUserStore","until"],"mappings":";;;;;AAgCA,MAAM,YAAA,GAAe,CAAC,SAAA,KAAsB;AAC1C,EAAA,IAAI;AACF,IAAA,CAAC,SAAU,CAAA,EAAQ,CAAA,EAAa,GAAW,CAAA,EAAW,CAAA,EAAW,GAAS,CAAA,EAAS;AACjF,MAAA,IAAI,CAAA,CAAE,cAAA,CAAe,gBAAgB,CAAA,EAAG;AACtC,QAAA;AAAA,MACF;AACA,MAAA,CAAA,CAAE,CAAC,CAAA,GACD,CAAA,CAAE,CAAC,KACH,WAAY;AAEV,QAAA,CAAC,CAAA,CAAE,CAAC,CAAA,CAAE,CAAA,GAAI,CAAA,CAAE,CAAC,CAAA,CAAE,CAAA,IAAK,EAAC,EAAG,IAAA,CAAK,SAAS,CAAA;AAAA,MACxC,CAAA;AACF,MAAA,CAAA,GAAI,CAAA,CAAE,cAAc,CAAC,CAAA;AACrB,MAAA,CAAA,CAAE,KAAA,GAAQ,CAAA;AACV,MAAA,CAAA,CAAE,GAAA,GAAM,gCAAgC,CAAA,GAAI,UAAA;AAC5C,MAAA,CAAA,CAAE,EAAA,GAAK,gBAAA;AACP,MAAA,CAAA,GAAI,CAAA,CAAE,oBAAA,CAAqB,CAAC,CAAA,CAAE,CAAC,CAAA;AAC/B,MAAA,CAAA,CAAE,UAAA,CAAW,YAAA,CAAa,CAAA,EAAG,CAAC,CAAA;AAAA,IAChC,CAAA,EAAG,MAAA,EAAQ,QAAA,EAAU,SAAA,EAAW,UAAU,SAAS,CAAA;AAAA,EACrD,CAAA,CAAA,MAAQ;AAAA,EAER;AACF,CAAA;AAKA,MAAM,mBAAmB,YAAY;AACnC,EAAA,MAAM,mBAAmBA,yBAAA,EAAoB;AAG7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