@weaveui/web 0.0.1 → 0.0.2
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/LICENSE +12 -12
- package/README.md +4 -6
- package/THIRD_PARTY_NOTICES +2 -2
- package/dist/apm-log.umd.cjs +1 -1
- package/dist/business/apm-log/types.d.ts +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.es.js +118 -118
- package/dist/index.umd.cjs +1 -1
- package/dist/monitor.es.js +14 -14
- package/dist/monitor.umd.cjs +1 -1
- package/dist/permission.umd.cjs +1 -1
- package/dist/upload-cos.umd.cjs +1 -1
- package/package.json +2 -2
package/LICENSE
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
|
|
1
|
+
WeaveUI Public Use License
|
|
2
2
|
|
|
3
3
|
Copyright (c) 2026 北京易油互联科技. All rights reserved.
|
|
4
4
|
|
|
5
5
|
1. Grant of License
|
|
6
6
|
|
|
7
|
-
Subject to the terms of this license, 北京易油互联科技 grants each recipient a non-exclusive, non-transferable, non-sublicensable, worldwide, royalty-free license to download, install, and use the unmodified
|
|
7
|
+
Subject to the terms of this license, 北京易油互联科技 grants each recipient a non-exclusive, non-transferable, non-sublicensable, worldwide, royalty-free license to download, install, and use the unmodified WeaveUI package as a dependency of the recipient's own applications, including commercial and internal applications.
|
|
8
8
|
|
|
9
|
-
The recipient may bundle, transpile, minify, and tree-shake unmodified package output solely as part of a normal application build and may deliver that application to its users. Those ordinary build steps do not constitute a modification or redistribution of
|
|
9
|
+
The recipient may bundle, transpile, minify, and tree-shake unmodified package output solely as part of a normal application build and may deliver that application to its users. Those ordinary build steps do not constitute a modification or redistribution of WeaveUI under this license.
|
|
10
10
|
|
|
11
11
|
2. Restrictions
|
|
12
12
|
|
|
13
13
|
Except for the limited rights expressly granted above, the recipient may not:
|
|
14
14
|
|
|
15
|
-
a. modify, adapt, translate, or create derivative works of
|
|
16
|
-
b. publish, distribute, mirror, sublicense, sell, rent, lease, transfer, or otherwise make
|
|
17
|
-
c. republish
|
|
18
|
-
d. remove or alter copyright, trademark, or license notices included with
|
|
19
|
-
e. represent a modified, extracted, or repackaged version of
|
|
15
|
+
a. modify, adapt, translate, or create derivative works of WeaveUI;
|
|
16
|
+
b. publish, distribute, mirror, sublicense, sell, rent, lease, transfer, or otherwise make WeaveUI available as a standalone package, component library, source archive, or asset collection;
|
|
17
|
+
c. republish WeaveUI, in whole or in part, to npm, another package registry, a code hosting service, or any other distribution channel;
|
|
18
|
+
d. remove or alter copyright, trademark, or license notices included with WeaveUI; or
|
|
19
|
+
e. represent a modified, extracted, or repackaged version of WeaveUI as an official WeaveUI release.
|
|
20
20
|
|
|
21
21
|
3. Ownership
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
WeaveUI and all intellectual property rights in it remain the exclusive property of 北京易油互联科技. This license grants no ownership interest and no rights other than those expressly stated above.
|
|
24
24
|
|
|
25
25
|
4. Trademarks
|
|
26
26
|
|
|
27
|
-
This license does not grant permission to use the
|
|
27
|
+
This license does not grant permission to use the WeaveUI name, the 北京易油互联科技 name, or any related trademark except as necessary to identify the unmodified package in accordance with this license.
|
|
28
28
|
|
|
29
29
|
5. Disclaimer and Limitation of Liability
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
WeaveUI is provided "AS IS", without warranties of any kind, whether express, implied, statutory, or otherwise. To the maximum extent permitted by applicable law, 北京易油互联科技 shall not be liable for any claim, damages, or other liability arising from or related to WeaveUI or its use.
|
|
32
32
|
|
|
33
33
|
6. Termination
|
|
34
34
|
|
|
35
|
-
The rights granted by this license terminate automatically if the recipient breaches any term of this license. Upon termination, the recipient must stop using
|
|
35
|
+
The rights granted by this license terminate automatically if the recipient breaches any term of this license. Upon termination, the recipient must stop using WeaveUI and remove it from its applications and distribution channels.
|
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Weave UI for web
|
|
2
2
|
|
|
3
3
|
`@weaveui/web` 是基于 Vue 3、Element Plus、Vite 的Web 端组件库。
|
|
4
4
|
|
|
@@ -60,21 +60,20 @@ web-ui/
|
|
|
60
60
|
npm install @weaveui/web element-plus
|
|
61
61
|
```
|
|
62
62
|
|
|
63
|
-
Element Custom UI 依赖 Vue 3 和 Element Plus,不支持 Vue 2 或 Element UI。
|
|
64
63
|
|
|
65
64
|
全局注册:
|
|
66
65
|
|
|
67
66
|
```ts
|
|
68
67
|
import { createApp } from 'vue'
|
|
69
68
|
import ElementPlus from 'element-plus'
|
|
70
|
-
import
|
|
69
|
+
import WebUI from '@weaveui/web'
|
|
71
70
|
import 'element-plus/dist/index.css'
|
|
72
71
|
import '@weaveui/web/style.css'
|
|
73
72
|
import App from './App.vue'
|
|
74
73
|
|
|
75
74
|
const app = createApp(App)
|
|
76
75
|
app.use(ElementPlus)
|
|
77
|
-
app.use(
|
|
76
|
+
app.use(WebUI)
|
|
78
77
|
app.mount('#app')
|
|
79
78
|
```
|
|
80
79
|
|
|
@@ -105,7 +104,7 @@ pnpm run pack:check
|
|
|
105
104
|
### 组件开发规则
|
|
106
105
|
|
|
107
106
|
- 新增通用组件放入 `src/components/组件名`,并通过 `src/index.ts` 暴露。
|
|
108
|
-
- 新增公司业务能力放入 `src/business/能力名`,默认不加入 `app.use(
|
|
107
|
+
- 新增公司业务能力放入 `src/business/能力名`,默认不加入 `app.use(WebUI)` 自动安装流程。
|
|
109
108
|
- 组件必须避免直接写死公司接口、登录态、生产域名、密钥或静态资源地址,需要通过 props、回调或配置传入。
|
|
110
109
|
- 组件或业务扩展需要完整项目验证时,同步更新 `examples` 中对应页面或配置。
|
|
111
110
|
- 发布前执行 `pnpm run typecheck:lib`、`pnpm run build:lib` 和 `pnpm run pack:check`。
|
|
@@ -116,4 +115,3 @@ pnpm run pack:check
|
|
|
116
115
|
|
|
117
116
|
- `package.json` 的 `version`、`exports`、`files` 和 peer 依赖范围已确认。
|
|
118
117
|
- `README.md` 和组件示例已同步更新。
|
|
119
|
-
|
package/THIRD_PARTY_NOTICES
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
WeaveUI Third-Party Notices
|
|
2
2
|
|
|
3
3
|
UploadCos declares `cos-js-sdk-v5` as an optional peer dependency. The COS SDK is
|
|
4
|
-
not bundled in
|
|
4
|
+
not bundled in WeaveUI; consumers who install it should review the license
|
|
5
5
|
included with that separately distributed package.
|
|
6
6
|
|
|
7
7
|
This package includes code from @element-plus/icons-vue.
|
package/dist/apm-log.umd.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(C,_){typeof exports=="object"&&typeof module<"u"?_(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],_):(C=typeof globalThis<"u"?globalThis:C||self,_(C.ElementCustomUIApmLog={}))})(this,function(C){"use strict";function _(){const t=globalThis.document;return typeof(t==null?void 0:t.addEventListener)=="function"?t:void 0}function ht(t){const e=globalThis.Element;return typeof e<"u"&&t instanceof e}function ot(t){const e=globalThis.MouseEvent;return typeof e<"u"&&t instanceof e}function it(t){return t.tagName.toLowerCase()}function Et(t,e){var u,s;if(typeof t=="string"){const g=t.trim();return g?{type:"click",properties:{action:g,element:it(e)}}:void 0}if(!t)return;const n=((u=t.type)==null?void 0:u.trim())||"click",c={element:it(e),...t.properties};return(s=t.label)!=null&&s.trim()&&(c.label=t.label.trim()),{type:n,properties:c,context:t.context?{...t.context}:void 0}}function at(t){const e=new WeakMap;return{mounted(n,c){const u={value:c.value,listener:s=>{if(!ot(s))return;const g=Et(u.value,n);g&&t.track(g)}};n.addEventListener("click",u.listener),e.set(n,u)},updated(n,c){const u=e.get(n);u&&(u.value=c.value)},unmounted(n){const c=e.get(n);c&&(n.removeEventListener("click",c.listener),e.delete(n))}}}const St=Symbol("EasyOilBehaviorLog"),bt=100,Dt=2,Ut=1e3,Pt="[data-behavior-log]",Nt="behavior-log";function q(t){return t?{...t}:{}}function kt(t){return t?{...t}:void 0}function wt(t,e){return!Number.isFinite(t)||!t||t<1?e:Math.floor(t)}function Tt(t,e){return!Number.isFinite(t)||t===void 0||t<0?e:Math.floor(t)}function Rt(t){var n;const e=(n=globalThis.crypto)==null?void 0:n.randomUUID;return typeof e=="function"?e.call(globalThis.crypto):`eol_${Date.now().toString(36)}_${t.toString(36)}_${Math.random().toString(36).slice(2,10)}`}function ct(t){if(t.fullPath)return t.fullPath;if(t.path)return t.path;if(t.name!==null&&t.name!==void 0)return String(t.name)}function At(t){var s;const e=(s=t.meta)==null?void 0:s.title,n=t.fullPath,c=n?n.split(/[?#]/,1)[0]:void 0,u=t.path||c;return{...u?{path:u}:{},...t.name!==null&&t.name!==void 0?{name:String(t.name)}:{},...typeof e=="string"&&e.trim()?{title:e.trim()}:{}}}function xt(t){const e=t.currentRoute;if(e)return"value"in e?e.value:e}function It(t,e){const n=ct(t),c=ct(e);return!!(n&&n===c)}function Ct(t){const e=wt(t.maxQueueSize,bt),n=Tt(t.maxRetries,Dt),c=t.dropStrategy??"oldest",u=[],s=new WeakSet;let g=0,l=!1,f=!1,d,b,w,D,x,T,F;function P(r,o){var a;try{(a=t.onError)==null||a.call(t,r,o)}catch{}}function R(r,o,a){var m;try{(m=t.onDrop)==null||m.call(t,r,{reason:o,error:a})}catch{}}function z(r){const o=u.indexOf(r);o>=0&&u.splice(o,1)}function N(){const r=u.findIndex(a=>a!==x);if(r<0)return;const[o]=u.splice(r,1);return o}function tt(r){if(u.length>=e){if(c==="newest")return R(r,"queue-full"),!1;const o=N();if(!o)return R(r,"queue-full"),!1;R(o.event,"queue-full")}return u.push({event:r,attempts:0}),!0}function et(r,o){try{const a=typeof t.retryDelay=="function"?t.retryDelay(r,o):t.retryDelay;if(typeof a=="number"&&Number.isFinite(a)&&a>=0)return a}catch(a){P(a,{stage:"transport",attempt:r})}return Ut}function nt(r,o){b||f||!l||(b=globalThis.setTimeout(()=>{b=void 0,y()},et(r,o)))}async function $(r){let o,a;if(t.getSessionId)try{o=await t.getSessionId()||void 0}catch(m){return{ok:!1,error:m,stage:"session-context"}}if(t.getUserContext)try{a=kt(await t.getUserContext())}catch(m){return{ok:!1,error:m,stage:"user-context"}}return{ok:!0,event:{...r,properties:q(r.properties),...r.context?{context:q(r.context)}:{},...o?{sessionId:o}:{},...a?{user:a}:{}}}}async function i(r){const o=await $(r.event);if(!o.ok)return o;if(f||!l)return{ok:!1,error:new Error("Behavior log was stopped before delivery."),stage:"transport"};try{return await t.transport(o.event),{ok:!0}}catch(a){return{ok:!1,error:a,stage:"transport"}}}async function p(){for(;l&&!f;){const r=u[0];if(!r)return;x=r;const o=await i(r);if(x===r&&(x=void 0),f||!l)return;if(o.ok){z(r);continue}if(u.includes(r)){if(r.attempts+=1,P(o.error,{stage:o.stage,event:r.event,attempt:r.attempts}),r.attempts>n){z(r),R(r.event,"transport-failed",o.error);continue}nt(r.attempts,o.error);return}}}function y(){if(f||!l)return Promise.resolve();if(d)return d;b&&(globalThis.clearTimeout(b),b=void 0);const r=p().catch(o=>{P(o,{stage:"transport"})}).finally(()=>{d===r&&(d=void 0,E())});return d=r,r}function E(){f||!l||!u.length||d||b||y()}function v(r,o){if(o.resolveRoute)try{const a=o.resolveRoute(r);if(a)return{...a}}catch(a){P(a,{stage:"router"})}return At(r)}function S(r,o,a){Q({type:"page_enter",properties:{page:v(r,a),...o?{from:v(o,a)}:{}}}),T=r,F=Date.now()}function U(r,o,a,m){if(a||f||!l)return;const h=T??o;h&&!m.includeSameRoute&&It(h,r)||(T&&F!==void 0&&Q({type:"page_leave",properties:{page:v(T,m),to:v(r,m),durationMs:Math.max(0,Date.now()-F)}}),S(r,h,m))}function rt(){const r=t.router,o=t.routeTracking;if(!r||o===!1)return;const a=o??{};try{const m=r.afterEach((h,I,j)=>{U(h,I,j,a)});if(typeof m=="function"&&(w=m),a.trackInitialRoute){const h=xt(r);h&&S(h,void 0,a)}}catch(m){P(m,{stage:"router"})}}function ee(r){var m,h;const o=((m=r.getAttribute("data-behavior-log"))==null?void 0:m.trim())||"click",a=(h=r.getAttribute("data-behavior-log-label"))==null?void 0:h.trim();return{type:"click",properties:{action:o,element:r.tagName.toLowerCase(),...a?{label:a}:{}}}}function ne(r,o){if(ht(r.target))return r.target.closest(o)??void 0}function re(){const r=t.clickTracking;if(!r)return;const o=r.root??_();if(!o)return;const a=r.selector??Pt,m=h=>{if(!(!ot(h)||f||!l))try{const I=ne(h,a);if(!I)return;const j=r.getPayload?r.getPayload(h,I):ee(I);j&&Q(j)}catch(I){P(I,{stage:"click-tracking"})}};try{o.addEventListener("click",m),D=()=>o.removeEventListener("click",m)}catch(h){P(h,{stage:"click-tracking"})}}function vt(){return f?!1:(l||(l=!0,rt(),re(),E()),!0)}function Q(r,o){if(!l||f)return;const a=typeof r=="string"?{type:r,properties:o}:r,m=a.type.trim();if(!m)return;g+=1;const h={id:Rt(g),type:m,timestamp:new Date().toISOString(),properties:q(a.properties),...a.context?{context:q(a.context)}:{}};if(tt(h))return E(),h}function oe(r){if(s.has(r))return;s.add(r),r.provide(St,K);const o=t.directiveName===void 0?Nt:t.directiveName;o&&r.directive(o,at(K)),vt()}function ie(){if(f)return;f=!0,l=!1,b&&(globalThis.clearTimeout(b),b=void 0);const r=w;w=void 0;const o=D;D=void 0;try{r==null||r()}catch(a){P(a,{stage:"router"})}try{o==null||o()}catch(a){P(a,{stage:"click-tracking"})}for(;u.length;){const a=u.shift();a&&R(a.event,"destroyed")}}const K={get isStarted(){return l},get isDestroyed(){return f},install:oe,start:vt,track:Q,flush:y,createClickDirective:()=>at(K),destroy:ie};return K}function O(t){if(t==null||t==="")return null;try{return String(t)}catch{return null}}function Lt(t,e){return typeof e=="string"?O(e):(e==null?void 0:e.buttonName)!==void 0?O(e.buttonName):O(t.innerText||t.textContent||void 0)}function Ft(t,e){return typeof t!="string"&&(t==null?void 0:t.pageName)!==void 0?O(t.pageName):e.pageName}function _t(t,e){const n=new WeakMap;return{mounted(c,u){const s={value:u.value,listener:()=>{try{const g=e();t.addTask("ClickButton",{fromUrl:null,fromPage:null,toUrl:null,toPage:null,pageName:Ft(s.value,g),buttonName:Lt(c,s.value),stopDuration:null,systemStopDuration:null})}catch{}}};c.addEventListener("click",s.listener),n.set(c,s)},updated(c,u){const s=n.get(c);s&&(s.value=u.value)},unmounted(c){const u=n.get(c);u&&(c.removeEventListener("click",u.listener),n.delete(c))}}}const ut="v1.0.0",H="6cff83cad70a55a7cfd197e1f29ff0d6",st="9e09e21609f011ce6eab6effd527bc63",Y="4bcbb789845ec91c1fb804235a797e0a";function M(){return typeof globalThis.window<"u"&&typeof globalThis.document<"u"}function lt(){return M()?globalThis.window:void 0}function ft(){const t=lt();if(t)try{return t.sessionStorage}catch{return}}function X(t){var e;try{return((e=ft())==null?void 0:e.getItem(t))||void 0}catch{return}}function B(t,e){var n;try{(n=ft())==null||n.setItem(t,e)}catch{}}function dt(t){const e=Number(X(t));return Number.isFinite(e)&&e>0?e:void 0}function Mt(){var e;const t=(e=globalThis.crypto)==null?void 0:e.randomUUID;return typeof t=="function"?t.call(globalThis.crypto):`eol_legacy_${Date.now().toString(36)}_${Math.random().toString(36).slice(2,12)}`}function J(){if(!M())return;const t=X(H);if(t)return t;const e=Mt();return B(H,e),e}function k(t){if(t==null)return"";try{return String(t)}catch{return""}}function L(t){if(t!==void 0)return t===null?null:k(t)}function A(t){return t&&k(t)||null}function gt(t){return typeof t!="string"?void 0:t.trim()||void 0}function mt(t){return typeof t=="number"&&Number.isFinite(t)&&t!==0?t:null}function Bt(t=new Date){const e=t.getFullYear(),n=t.getMonth()+1,c=String(t.getDate()).padStart(2,"0"),u=String(t.getHours()).padStart(2,"0"),s=String(t.getMinutes()).padStart(2,"0"),g=String(t.getSeconds()).padStart(2,"0");return`${e}-${n}-${c} ${u}:${s}:${g}`}function zt(){var e;const t={deviceSystem:"unknow",deviceModel:"web",deviceSystemVersion:"unknow",browser:"unknow"};if(!M())return t;try{const n=globalThis.navigator,c=n.userAgent||"",s=((e=n.userAgentData)==null?void 0:e.platform)||n.platform||"unknow",g=/Android|webOS|iPhone|iPod|BlackBerry/i.test(c)?"phone":"web";let l="unknow",f="unknow";if(c.includes("Chrome")){const d=c.match(/Chrome\/([\d.]+)/);l=(d==null?void 0:d[1])||"unknow",f=(d==null?void 0:d[0])||"Chrome"}else if(c.includes("Safari")){const d=c.match(/Version\/([\d.]+)/);l=(d==null?void 0:d[1])||"unknow",f="Safari"}else if(c.includes("Firefox")){const d=c.match(/Firefox\/([\d.]+)/);l=(d==null?void 0:d[1])||"unknow",f=(d==null?void 0:d[0])||"unknow"}return{deviceSystem:s,deviceModel:g,deviceSystemVersion:l,browser:f}}catch{return t}}function $t(t){const e=t.trim();if(e)return`${e.replace(/\/+$/,"")}/frontEndLog/add`}function qt(t){return{"Content-Type":"application/json",x_app_channel_id:k(t.appChannelId),x_data_channel_id:k(t.dataChannelId)}}function V(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function Ot(t,e){const n=t.action;if(!V(n))return{type:e,fromPage:null,pageName:null,buttonName:null,stopDuration:null};const c=gt(n.type)||e,u=L(n.fromUrl),s=L(n.toUrl),g=L(n.toPage),l=n.systemStopDuration,f={type:c,fromPage:A(n.fromPage),pageName:A(n.pageName),buttonName:A(n.buttonName),stopDuration:mt(n.stopDuration)};return u!==void 0&&(f.fromUrl=u),s!==void 0&&(f.toUrl=s),g!==void 0&&(f.toPage=g),(l===null||typeof l=="number"&&Number.isFinite(l))&&(f.systemStopDuration=l),f}function Yt(t){return{account:k(t==null?void 0:t.account),nickName:k(t==null?void 0:t.nickName)}}function Vt(t){if(t)try{Promise.resolve(t()).catch(()=>{})}catch{}}function Wt(t,e){if(t)try{Promise.resolve(t(e)).catch(()=>{})}catch{}}async function pt(t){if(!t)return"";try{return k(await t())}catch{return""}}async function Gt(t){const[e,n]=await Promise.all([pt(t.getAccountFn),pt(t.getNickNameFn)]);return{account:e,nickName:n}}function Qt(t,e){try{return typeof t=="string"?t===e:t instanceof RegExp?(t.lastIndex=0,t.test(e)):t(e)}catch{return!1}}function Kt(t,e){if(!t||t.mode!=="match"&&t.mode!=="ignore")return!1;const c=(Array.isArray(t.rules)?t.rules:[t.rules]).some(u=>Qt(u,e));return t.mode==="ignore"?c:!c}function W(t){return t&&(t.fullPath||t.path)||null}function jt(t){return(t==null?void 0:t.path)||W(t)}function Z(t){var n;if(!t)return null;const e=(n=t.meta)==null?void 0:n.title;return typeof e=="string"||typeof e=="number"?A(e):typeof t.name=="string"||typeof t.name=="number"||typeof t.name=="symbol"?k(t.name):null}function Ht(t){const e=t==null?void 0:t.currentRoute;if(e)return"value"in e?e.value:e}function G(t,e){return t===void 0?null:Math.max(0,e-t)}function Xt(t,e,n){const c=L(e.fromUrl),u=L(e.toUrl),s=L(e.toPage),g=A(e.pageName);g&&(n.currentPageName=g);const l={type:t,fromPage:A(e.fromPage),pageName:g||n.currentPageName||null,buttonName:A(e.buttonName),stopDuration:mt(e.stopDuration)};return c!==void 0&&(l.fromUrl=c),u!==void 0&&(l.toUrl=u),s!==void 0&&(l.toPage=s),e.systemStopDuration!==void 0&&(l.systemStopDuration=e.systemStopDuration),l}function Jt(t){const e=V(t)?t:{},n=typeof e.version=="string"&&e.version.trim()?e.version.trim():ut;return{envUrl:typeof e.envUrl=="string"?e.envUrl:"",...typeof e.appChannelId=="string"||typeof e.appChannelId=="number"||e.appChannelId===null?{appChannelId:e.appChannelId}:{},...typeof e.dataChannelId=="string"||typeof e.dataChannelId=="number"||e.dataChannelId===null?{dataChannelId:e.dataChannelId}:{},...V(e.router)?{router:e.router}:{},...typeof e.getAccountFn=="function"?{getAccountFn:e.getAccountFn}:{},...typeof e.getNickNameFn=="function"?{getNickNameFn:e.getNickNameFn}:{},...V(e.pageFilter)?{pageFilter:e.pageFilter}:{},...typeof e.success=="function"?{success:e.success}:{},...typeof e.failed=="function"?{failed:e.failed}:{},version:n}}function Zt(t){const e=Jt(t),n={currentRouteUrl:null,currentPageName:null,systemEnteredAt:void 0,pageEnteredAt:void 0},c=zt(),u=new WeakSet;let s=!1,g=!1,l,f=!1,d,b;const w=Ct({directiveName:!1,maxRetries:0,getSessionId:()=>J(),getUserContext:()=>Gt(e),transport:async i=>{if(!M())return;const p=$t(e.envUrl);if(!p)throw new Error("Legacy apm-log requires a non-empty envUrl.");if(typeof globalThis.fetch!="function")throw new Error("The browser Fetch API is unavailable.");const y=Ot(i.properties,i.type),E=Yt(i.user),v={sessionId:i.sessionId||J()||null,account:E.account,nickName:E.nickName,deviceInfo:{...c},action:y,version:e.version||ut,time:Bt()},S=await globalThis.fetch(p,{method:"POST",headers:qt(e),body:JSON.stringify(v)});if(!S.ok)throw new Error(`Legacy apm-log request failed with HTTP ${S.status}.`);Vt(e.success)},onDrop:(i,p)=>{p.reason==="transport-failed"&&Wt(e.failed,p.error)}});function D(i,p={}){if(s)return;const y=gt(i);if(!y)return;const E=k(p.toUrl),v=p.filter||e.pageFilter;if(Kt(v,E))return;const S=Xt(y,p,n);return w.track({type:y,properties:{action:S}})}function x(i,p){if(s)return;const y=Date.now(),E=W(p)||n.currentRouteUrl,v=Z(p)||n.currentPageName,S=W(i),U=Z(i),rt=!!X(H);J(),n.systemEnteredAt===void 0&&(n.systemEnteredAt=dt(st)||y),n.pageEnteredAt===void 0&&(n.pageEnteredAt=dt(Y)||y),rt?n.currentRouteUrl?(D("EnterPage",{fromUrl:E,fromPage:v,toUrl:S,toPage:U,pageName:U,stopDuration:null,systemStopDuration:null}),D("LeavePage",{fromUrl:E,fromPage:v,toUrl:S,toPage:U,pageName:U,stopDuration:G(n.pageEnteredAt,y),systemStopDuration:G(n.systemEnteredAt,y)}),n.pageEnteredAt=y,B(Y,String(y))):(D("EnterPage",{fromUrl:E,fromPage:v,toUrl:S,toPage:U,pageName:U,stopDuration:null,systemStopDuration:null}),n.pageEnteredAt=y,B(Y,String(y))):(n.systemEnteredAt=y,n.pageEnteredAt=y,B(st,String(y)),B(Y,String(y)),D("EnterSystem",{fromUrl:E,fromPage:null,toUrl:S,toPage:U,pageName:U,stopDuration:null,systemStopDuration:null}),D("EnterPage",{fromUrl:E,fromPage:v,toUrl:S,toPage:U,pageName:U,stopDuration:null,systemStopDuration:null})),n.currentRouteUrl=jt(i),n.currentPageName=U}function T(i){var E;if(!i||!M()||f)return;l=i;const p=(v,S)=>{try{x(v,S)}catch{}},y=(v,S,U)=>{if(!U)try{x(v,S)}catch{}};try{const v=i.beforeEach?i.beforeEach(p):(E=i.afterEach)==null?void 0:E.call(i,y);typeof v=="function"&&(d=v),f=!0}catch{l=void 0}}function F(){s||(D("LeavePage",{fromUrl:null,fromPage:n.currentRouteUrl,toUrl:null,toPage:null,pageName:null,buttonName:null,stopDuration:null,systemStopDuration:null}),D("LeaveSystem",{fromUrl:null,fromPage:n.currentRouteUrl,toUrl:null,toPage:null,pageName:null,buttonName:null,stopDuration:null,systemStopDuration:null}))}function P(){if(s)return;const i=Date.now();D("LeavePage",{fromUrl:n.currentRouteUrl,fromPage:n.currentPageName,toUrl:"",toPage:"",pageName:"",buttonName:null,stopDuration:G(n.pageEnteredAt,i),systemStopDuration:null}),D("LeaveSystem",{fromUrl:n.currentRouteUrl,fromPage:n.currentPageName,toUrl:"",toPage:"",pageName:"",buttonName:null,stopDuration:null,systemStopDuration:G(n.systemEnteredAt,i)})}function R(){const i=lt();if(!i||b)return;const p=()=>{try{P()}catch{}};try{i.addEventListener("beforeunload",p),b=()=>i.removeEventListener("beforeunload",p)}catch{}}function z(i,p){D("ClickButton",{fromUrl:null,fromPage:null,toUrl:null,toPage:null,pageName:i||n.currentPageName,buttonName:p,stopDuration:null,systemStopDuration:null})}const N={get isInitialized(){return g&&!s},init(i){return s||(T(i||l||e.router),R(),g=!0),N},initRouter(i){return s||(T(i||l||e.router),g=!0),N},initUniRouter(){return N},mountBtnFunction(){},mountExitSystemFunction(){},addListener(){return s||(R(),g=!0),N},addRouterListener(){return s||(T(l||e.router),g=!0),N}};function tt(){return _t($,()=>{const i=Ht(l||e.router);return{pageName:Z(i)||n.currentPageName,routeUrl:W(i)||n.currentRouteUrl}})}function et(i){if(!(s||u.has(i))){u.add(i);try{w.install(i)}catch{}try{i.directive("BtnLog",tt())}catch{}try{i.config.globalProperties.LogClass=$,i.config.globalProperties.MixinClass=N,i.config.globalProperties.$btnLog=z,i.config.globalProperties.$exitSystem=F}catch{}N.init(e.router)}}function nt(){if(s)return;s=!0;const i=d,p=b;d=void 0,b=void 0,f=!1,l=void 0;try{i==null||i()}catch{}try{p==null||p()}catch{}w.destroy()}const $={behaviorLog:w,mixinClass:N,options:e,get isDestroyed(){return s},install:et,addTask:D,btnLog:z,exitSystem:F,flush:()=>w.flush(),destroy:nt};return $}const yt=new WeakMap,te={install(t,e){if(yt.get(t))return;const c=Zt(e);yt.set(t,c),c.install(t)}};C.default=te,Object.defineProperties(C,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
1
|
+
(function(C,_){typeof exports=="object"&&typeof module<"u"?_(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],_):(C=typeof globalThis<"u"?globalThis:C||self,_(C.WeaveUIApmLog={}))})(this,function(C){"use strict";function _(){const t=globalThis.document;return typeof(t==null?void 0:t.addEventListener)=="function"?t:void 0}function ht(t){const e=globalThis.Element;return typeof e<"u"&&t instanceof e}function ot(t){const e=globalThis.MouseEvent;return typeof e<"u"&&t instanceof e}function it(t){return t.tagName.toLowerCase()}function Et(t,e){var u,s;if(typeof t=="string"){const g=t.trim();return g?{type:"click",properties:{action:g,element:it(e)}}:void 0}if(!t)return;const n=((u=t.type)==null?void 0:u.trim())||"click",c={element:it(e),...t.properties};return(s=t.label)!=null&&s.trim()&&(c.label=t.label.trim()),{type:n,properties:c,context:t.context?{...t.context}:void 0}}function at(t){const e=new WeakMap;return{mounted(n,c){const u={value:c.value,listener:s=>{if(!ot(s))return;const g=Et(u.value,n);g&&t.track(g)}};n.addEventListener("click",u.listener),e.set(n,u)},updated(n,c){const u=e.get(n);u&&(u.value=c.value)},unmounted(n){const c=e.get(n);c&&(n.removeEventListener("click",c.listener),e.delete(n))}}}const St=Symbol("EasyOilBehaviorLog"),bt=100,Dt=2,Ut=1e3,Pt="[data-behavior-log]",Nt="behavior-log";function q(t){return t?{...t}:{}}function kt(t){return t?{...t}:void 0}function wt(t,e){return!Number.isFinite(t)||!t||t<1?e:Math.floor(t)}function Tt(t,e){return!Number.isFinite(t)||t===void 0||t<0?e:Math.floor(t)}function Rt(t){var n;const e=(n=globalThis.crypto)==null?void 0:n.randomUUID;return typeof e=="function"?e.call(globalThis.crypto):`eol_${Date.now().toString(36)}_${t.toString(36)}_${Math.random().toString(36).slice(2,10)}`}function ct(t){if(t.fullPath)return t.fullPath;if(t.path)return t.path;if(t.name!==null&&t.name!==void 0)return String(t.name)}function At(t){var s;const e=(s=t.meta)==null?void 0:s.title,n=t.fullPath,c=n?n.split(/[?#]/,1)[0]:void 0,u=t.path||c;return{...u?{path:u}:{},...t.name!==null&&t.name!==void 0?{name:String(t.name)}:{},...typeof e=="string"&&e.trim()?{title:e.trim()}:{}}}function xt(t){const e=t.currentRoute;if(e)return"value"in e?e.value:e}function It(t,e){const n=ct(t),c=ct(e);return!!(n&&n===c)}function Ct(t){const e=wt(t.maxQueueSize,bt),n=Tt(t.maxRetries,Dt),c=t.dropStrategy??"oldest",u=[],s=new WeakSet;let g=0,l=!1,f=!1,d,b,w,D,x,T,F;function P(r,o){var a;try{(a=t.onError)==null||a.call(t,r,o)}catch{}}function R(r,o,a){var m;try{(m=t.onDrop)==null||m.call(t,r,{reason:o,error:a})}catch{}}function z(r){const o=u.indexOf(r);o>=0&&u.splice(o,1)}function N(){const r=u.findIndex(a=>a!==x);if(r<0)return;const[o]=u.splice(r,1);return o}function tt(r){if(u.length>=e){if(c==="newest")return R(r,"queue-full"),!1;const o=N();if(!o)return R(r,"queue-full"),!1;R(o.event,"queue-full")}return u.push({event:r,attempts:0}),!0}function et(r,o){try{const a=typeof t.retryDelay=="function"?t.retryDelay(r,o):t.retryDelay;if(typeof a=="number"&&Number.isFinite(a)&&a>=0)return a}catch(a){P(a,{stage:"transport",attempt:r})}return Ut}function nt(r,o){b||f||!l||(b=globalThis.setTimeout(()=>{b=void 0,y()},et(r,o)))}async function $(r){let o,a;if(t.getSessionId)try{o=await t.getSessionId()||void 0}catch(m){return{ok:!1,error:m,stage:"session-context"}}if(t.getUserContext)try{a=kt(await t.getUserContext())}catch(m){return{ok:!1,error:m,stage:"user-context"}}return{ok:!0,event:{...r,properties:q(r.properties),...r.context?{context:q(r.context)}:{},...o?{sessionId:o}:{},...a?{user:a}:{}}}}async function i(r){const o=await $(r.event);if(!o.ok)return o;if(f||!l)return{ok:!1,error:new Error("Behavior log was stopped before delivery."),stage:"transport"};try{return await t.transport(o.event),{ok:!0}}catch(a){return{ok:!1,error:a,stage:"transport"}}}async function p(){for(;l&&!f;){const r=u[0];if(!r)return;x=r;const o=await i(r);if(x===r&&(x=void 0),f||!l)return;if(o.ok){z(r);continue}if(u.includes(r)){if(r.attempts+=1,P(o.error,{stage:o.stage,event:r.event,attempt:r.attempts}),r.attempts>n){z(r),R(r.event,"transport-failed",o.error);continue}nt(r.attempts,o.error);return}}}function y(){if(f||!l)return Promise.resolve();if(d)return d;b&&(globalThis.clearTimeout(b),b=void 0);const r=p().catch(o=>{P(o,{stage:"transport"})}).finally(()=>{d===r&&(d=void 0,E())});return d=r,r}function E(){f||!l||!u.length||d||b||y()}function v(r,o){if(o.resolveRoute)try{const a=o.resolveRoute(r);if(a)return{...a}}catch(a){P(a,{stage:"router"})}return At(r)}function S(r,o,a){Q({type:"page_enter",properties:{page:v(r,a),...o?{from:v(o,a)}:{}}}),T=r,F=Date.now()}function U(r,o,a,m){if(a||f||!l)return;const h=T??o;h&&!m.includeSameRoute&&It(h,r)||(T&&F!==void 0&&Q({type:"page_leave",properties:{page:v(T,m),to:v(r,m),durationMs:Math.max(0,Date.now()-F)}}),S(r,h,m))}function rt(){const r=t.router,o=t.routeTracking;if(!r||o===!1)return;const a=o??{};try{const m=r.afterEach((h,I,j)=>{U(h,I,j,a)});if(typeof m=="function"&&(w=m),a.trackInitialRoute){const h=xt(r);h&&S(h,void 0,a)}}catch(m){P(m,{stage:"router"})}}function ee(r){var m,h;const o=((m=r.getAttribute("data-behavior-log"))==null?void 0:m.trim())||"click",a=(h=r.getAttribute("data-behavior-log-label"))==null?void 0:h.trim();return{type:"click",properties:{action:o,element:r.tagName.toLowerCase(),...a?{label:a}:{}}}}function ne(r,o){if(ht(r.target))return r.target.closest(o)??void 0}function re(){const r=t.clickTracking;if(!r)return;const o=r.root??_();if(!o)return;const a=r.selector??Pt,m=h=>{if(!(!ot(h)||f||!l))try{const I=ne(h,a);if(!I)return;const j=r.getPayload?r.getPayload(h,I):ee(I);j&&Q(j)}catch(I){P(I,{stage:"click-tracking"})}};try{o.addEventListener("click",m),D=()=>o.removeEventListener("click",m)}catch(h){P(h,{stage:"click-tracking"})}}function vt(){return f?!1:(l||(l=!0,rt(),re(),E()),!0)}function Q(r,o){if(!l||f)return;const a=typeof r=="string"?{type:r,properties:o}:r,m=a.type.trim();if(!m)return;g+=1;const h={id:Rt(g),type:m,timestamp:new Date().toISOString(),properties:q(a.properties),...a.context?{context:q(a.context)}:{}};if(tt(h))return E(),h}function oe(r){if(s.has(r))return;s.add(r),r.provide(St,K);const o=t.directiveName===void 0?Nt:t.directiveName;o&&r.directive(o,at(K)),vt()}function ie(){if(f)return;f=!0,l=!1,b&&(globalThis.clearTimeout(b),b=void 0);const r=w;w=void 0;const o=D;D=void 0;try{r==null||r()}catch(a){P(a,{stage:"router"})}try{o==null||o()}catch(a){P(a,{stage:"click-tracking"})}for(;u.length;){const a=u.shift();a&&R(a.event,"destroyed")}}const K={get isStarted(){return l},get isDestroyed(){return f},install:oe,start:vt,track:Q,flush:y,createClickDirective:()=>at(K),destroy:ie};return K}function O(t){if(t==null||t==="")return null;try{return String(t)}catch{return null}}function Lt(t,e){return typeof e=="string"?O(e):(e==null?void 0:e.buttonName)!==void 0?O(e.buttonName):O(t.innerText||t.textContent||void 0)}function Ft(t,e){return typeof t!="string"&&(t==null?void 0:t.pageName)!==void 0?O(t.pageName):e.pageName}function _t(t,e){const n=new WeakMap;return{mounted(c,u){const s={value:u.value,listener:()=>{try{const g=e();t.addTask("ClickButton",{fromUrl:null,fromPage:null,toUrl:null,toPage:null,pageName:Ft(s.value,g),buttonName:Lt(c,s.value),stopDuration:null,systemStopDuration:null})}catch{}}};c.addEventListener("click",s.listener),n.set(c,s)},updated(c,u){const s=n.get(c);s&&(s.value=u.value)},unmounted(c){const u=n.get(c);u&&(c.removeEventListener("click",u.listener),n.delete(c))}}}const ut="v1.0.0",H="6cff83cad70a55a7cfd197e1f29ff0d6",st="9e09e21609f011ce6eab6effd527bc63",Y="4bcbb789845ec91c1fb804235a797e0a";function M(){return typeof globalThis.window<"u"&&typeof globalThis.document<"u"}function lt(){return M()?globalThis.window:void 0}function ft(){const t=lt();if(t)try{return t.sessionStorage}catch{return}}function X(t){var e;try{return((e=ft())==null?void 0:e.getItem(t))||void 0}catch{return}}function B(t,e){var n;try{(n=ft())==null||n.setItem(t,e)}catch{}}function dt(t){const e=Number(X(t));return Number.isFinite(e)&&e>0?e:void 0}function Mt(){var e;const t=(e=globalThis.crypto)==null?void 0:e.randomUUID;return typeof t=="function"?t.call(globalThis.crypto):`eol_legacy_${Date.now().toString(36)}_${Math.random().toString(36).slice(2,12)}`}function J(){if(!M())return;const t=X(H);if(t)return t;const e=Mt();return B(H,e),e}function k(t){if(t==null)return"";try{return String(t)}catch{return""}}function L(t){if(t!==void 0)return t===null?null:k(t)}function A(t){return t&&k(t)||null}function gt(t){return typeof t!="string"?void 0:t.trim()||void 0}function mt(t){return typeof t=="number"&&Number.isFinite(t)&&t!==0?t:null}function Bt(t=new Date){const e=t.getFullYear(),n=t.getMonth()+1,c=String(t.getDate()).padStart(2,"0"),u=String(t.getHours()).padStart(2,"0"),s=String(t.getMinutes()).padStart(2,"0"),g=String(t.getSeconds()).padStart(2,"0");return`${e}-${n}-${c} ${u}:${s}:${g}`}function zt(){var e;const t={deviceSystem:"unknow",deviceModel:"web",deviceSystemVersion:"unknow",browser:"unknow"};if(!M())return t;try{const n=globalThis.navigator,c=n.userAgent||"",s=((e=n.userAgentData)==null?void 0:e.platform)||n.platform||"unknow",g=/Android|webOS|iPhone|iPod|BlackBerry/i.test(c)?"phone":"web";let l="unknow",f="unknow";if(c.includes("Chrome")){const d=c.match(/Chrome\/([\d.]+)/);l=(d==null?void 0:d[1])||"unknow",f=(d==null?void 0:d[0])||"Chrome"}else if(c.includes("Safari")){const d=c.match(/Version\/([\d.]+)/);l=(d==null?void 0:d[1])||"unknow",f="Safari"}else if(c.includes("Firefox")){const d=c.match(/Firefox\/([\d.]+)/);l=(d==null?void 0:d[1])||"unknow",f=(d==null?void 0:d[0])||"unknow"}return{deviceSystem:s,deviceModel:g,deviceSystemVersion:l,browser:f}}catch{return t}}function $t(t){const e=t.trim();if(e)return`${e.replace(/\/+$/,"")}/frontEndLog/add`}function qt(t){return{"Content-Type":"application/json",x_app_channel_id:k(t.appChannelId),x_data_channel_id:k(t.dataChannelId)}}function W(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function Ot(t,e){const n=t.action;if(!W(n))return{type:e,fromPage:null,pageName:null,buttonName:null,stopDuration:null};const c=gt(n.type)||e,u=L(n.fromUrl),s=L(n.toUrl),g=L(n.toPage),l=n.systemStopDuration,f={type:c,fromPage:A(n.fromPage),pageName:A(n.pageName),buttonName:A(n.buttonName),stopDuration:mt(n.stopDuration)};return u!==void 0&&(f.fromUrl=u),s!==void 0&&(f.toUrl=s),g!==void 0&&(f.toPage=g),(l===null||typeof l=="number"&&Number.isFinite(l))&&(f.systemStopDuration=l),f}function Yt(t){return{account:k(t==null?void 0:t.account),nickName:k(t==null?void 0:t.nickName)}}function Wt(t){if(t)try{Promise.resolve(t()).catch(()=>{})}catch{}}function Vt(t,e){if(t)try{Promise.resolve(t(e)).catch(()=>{})}catch{}}async function pt(t){if(!t)return"";try{return k(await t())}catch{return""}}async function Gt(t){const[e,n]=await Promise.all([pt(t.getAccountFn),pt(t.getNickNameFn)]);return{account:e,nickName:n}}function Qt(t,e){try{return typeof t=="string"?t===e:t instanceof RegExp?(t.lastIndex=0,t.test(e)):t(e)}catch{return!1}}function Kt(t,e){if(!t||t.mode!=="match"&&t.mode!=="ignore")return!1;const c=(Array.isArray(t.rules)?t.rules:[t.rules]).some(u=>Qt(u,e));return t.mode==="ignore"?c:!c}function V(t){return t&&(t.fullPath||t.path)||null}function jt(t){return(t==null?void 0:t.path)||V(t)}function Z(t){var n;if(!t)return null;const e=(n=t.meta)==null?void 0:n.title;return typeof e=="string"||typeof e=="number"?A(e):typeof t.name=="string"||typeof t.name=="number"||typeof t.name=="symbol"?k(t.name):null}function Ht(t){const e=t==null?void 0:t.currentRoute;if(e)return"value"in e?e.value:e}function G(t,e){return t===void 0?null:Math.max(0,e-t)}function Xt(t,e,n){const c=L(e.fromUrl),u=L(e.toUrl),s=L(e.toPage),g=A(e.pageName);g&&(n.currentPageName=g);const l={type:t,fromPage:A(e.fromPage),pageName:g||n.currentPageName||null,buttonName:A(e.buttonName),stopDuration:mt(e.stopDuration)};return c!==void 0&&(l.fromUrl=c),u!==void 0&&(l.toUrl=u),s!==void 0&&(l.toPage=s),e.systemStopDuration!==void 0&&(l.systemStopDuration=e.systemStopDuration),l}function Jt(t){const e=W(t)?t:{},n=typeof e.version=="string"&&e.version.trim()?e.version.trim():ut;return{envUrl:typeof e.envUrl=="string"?e.envUrl:"",...typeof e.appChannelId=="string"||typeof e.appChannelId=="number"||e.appChannelId===null?{appChannelId:e.appChannelId}:{},...typeof e.dataChannelId=="string"||typeof e.dataChannelId=="number"||e.dataChannelId===null?{dataChannelId:e.dataChannelId}:{},...W(e.router)?{router:e.router}:{},...typeof e.getAccountFn=="function"?{getAccountFn:e.getAccountFn}:{},...typeof e.getNickNameFn=="function"?{getNickNameFn:e.getNickNameFn}:{},...W(e.pageFilter)?{pageFilter:e.pageFilter}:{},...typeof e.success=="function"?{success:e.success}:{},...typeof e.failed=="function"?{failed:e.failed}:{},version:n}}function Zt(t){const e=Jt(t),n={currentRouteUrl:null,currentPageName:null,systemEnteredAt:void 0,pageEnteredAt:void 0},c=zt(),u=new WeakSet;let s=!1,g=!1,l,f=!1,d,b;const w=Ct({directiveName:!1,maxRetries:0,getSessionId:()=>J(),getUserContext:()=>Gt(e),transport:async i=>{if(!M())return;const p=$t(e.envUrl);if(!p)throw new Error("Legacy apm-log requires a non-empty envUrl.");if(typeof globalThis.fetch!="function")throw new Error("The browser Fetch API is unavailable.");const y=Ot(i.properties,i.type),E=Yt(i.user),v={sessionId:i.sessionId||J()||null,account:E.account,nickName:E.nickName,deviceInfo:{...c},action:y,version:e.version||ut,time:Bt()},S=await globalThis.fetch(p,{method:"POST",headers:qt(e),body:JSON.stringify(v)});if(!S.ok)throw new Error(`Legacy apm-log request failed with HTTP ${S.status}.`);Wt(e.success)},onDrop:(i,p)=>{p.reason==="transport-failed"&&Vt(e.failed,p.error)}});function D(i,p={}){if(s)return;const y=gt(i);if(!y)return;const E=k(p.toUrl),v=p.filter||e.pageFilter;if(Kt(v,E))return;const S=Xt(y,p,n);return w.track({type:y,properties:{action:S}})}function x(i,p){if(s)return;const y=Date.now(),E=V(p)||n.currentRouteUrl,v=Z(p)||n.currentPageName,S=V(i),U=Z(i),rt=!!X(H);J(),n.systemEnteredAt===void 0&&(n.systemEnteredAt=dt(st)||y),n.pageEnteredAt===void 0&&(n.pageEnteredAt=dt(Y)||y),rt?n.currentRouteUrl?(D("EnterPage",{fromUrl:E,fromPage:v,toUrl:S,toPage:U,pageName:U,stopDuration:null,systemStopDuration:null}),D("LeavePage",{fromUrl:E,fromPage:v,toUrl:S,toPage:U,pageName:U,stopDuration:G(n.pageEnteredAt,y),systemStopDuration:G(n.systemEnteredAt,y)}),n.pageEnteredAt=y,B(Y,String(y))):(D("EnterPage",{fromUrl:E,fromPage:v,toUrl:S,toPage:U,pageName:U,stopDuration:null,systemStopDuration:null}),n.pageEnteredAt=y,B(Y,String(y))):(n.systemEnteredAt=y,n.pageEnteredAt=y,B(st,String(y)),B(Y,String(y)),D("EnterSystem",{fromUrl:E,fromPage:null,toUrl:S,toPage:U,pageName:U,stopDuration:null,systemStopDuration:null}),D("EnterPage",{fromUrl:E,fromPage:v,toUrl:S,toPage:U,pageName:U,stopDuration:null,systemStopDuration:null})),n.currentRouteUrl=jt(i),n.currentPageName=U}function T(i){var E;if(!i||!M()||f)return;l=i;const p=(v,S)=>{try{x(v,S)}catch{}},y=(v,S,U)=>{if(!U)try{x(v,S)}catch{}};try{const v=i.beforeEach?i.beforeEach(p):(E=i.afterEach)==null?void 0:E.call(i,y);typeof v=="function"&&(d=v),f=!0}catch{l=void 0}}function F(){s||(D("LeavePage",{fromUrl:null,fromPage:n.currentRouteUrl,toUrl:null,toPage:null,pageName:null,buttonName:null,stopDuration:null,systemStopDuration:null}),D("LeaveSystem",{fromUrl:null,fromPage:n.currentRouteUrl,toUrl:null,toPage:null,pageName:null,buttonName:null,stopDuration:null,systemStopDuration:null}))}function P(){if(s)return;const i=Date.now();D("LeavePage",{fromUrl:n.currentRouteUrl,fromPage:n.currentPageName,toUrl:"",toPage:"",pageName:"",buttonName:null,stopDuration:G(n.pageEnteredAt,i),systemStopDuration:null}),D("LeaveSystem",{fromUrl:n.currentRouteUrl,fromPage:n.currentPageName,toUrl:"",toPage:"",pageName:"",buttonName:null,stopDuration:null,systemStopDuration:G(n.systemEnteredAt,i)})}function R(){const i=lt();if(!i||b)return;const p=()=>{try{P()}catch{}};try{i.addEventListener("beforeunload",p),b=()=>i.removeEventListener("beforeunload",p)}catch{}}function z(i,p){D("ClickButton",{fromUrl:null,fromPage:null,toUrl:null,toPage:null,pageName:i||n.currentPageName,buttonName:p,stopDuration:null,systemStopDuration:null})}const N={get isInitialized(){return g&&!s},init(i){return s||(T(i||l||e.router),R(),g=!0),N},initRouter(i){return s||(T(i||l||e.router),g=!0),N},initUniRouter(){return N},mountBtnFunction(){},mountExitSystemFunction(){},addListener(){return s||(R(),g=!0),N},addRouterListener(){return s||(T(l||e.router),g=!0),N}};function tt(){return _t($,()=>{const i=Ht(l||e.router);return{pageName:Z(i)||n.currentPageName,routeUrl:V(i)||n.currentRouteUrl}})}function et(i){if(!(s||u.has(i))){u.add(i);try{w.install(i)}catch{}try{i.directive("BtnLog",tt())}catch{}try{i.config.globalProperties.LogClass=$,i.config.globalProperties.MixinClass=N,i.config.globalProperties.$btnLog=z,i.config.globalProperties.$exitSystem=F}catch{}N.init(e.router)}}function nt(){if(s)return;s=!0;const i=d,p=b;d=void 0,b=void 0,f=!1,l=void 0;try{i==null||i()}catch{}try{p==null||p()}catch{}w.destroy()}const $={behaviorLog:w,mixinClass:N,options:e,get isDestroyed(){return s},install:et,addTask:D,btnLog:z,exitSystem:F,flush:()=>w.flush(),destroy:nt};return $}const yt=new WeakMap,te={install(t,e){if(yt.get(t))return;const c=Zt(e);yt.set(t,c),c.install(t)}};C.default=te,Object.defineProperties(C,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
@@ -119,7 +119,7 @@ export interface LegacyApmLogMixinClass {
|
|
|
119
119
|
}
|
|
120
120
|
/**
|
|
121
121
|
* An isolated legacy adapter instance. It is intentionally not installed by
|
|
122
|
-
* the
|
|
122
|
+
* the UI root plugin; callers opt in with `app.use(instance)`.
|
|
123
123
|
*/
|
|
124
124
|
export interface LegacyApmLog extends ObjectPlugin<[]> {
|
|
125
125
|
readonly behaviorLog: BehaviorLog;
|
package/dist/index.d.ts
CHANGED
|
@@ -1867,11 +1867,11 @@ export declare interface UploadRequestContext {
|
|
|
1867
1867
|
headers?: Record<string, string>;
|
|
1868
1868
|
}
|
|
1869
1869
|
|
|
1870
|
-
export declare const WEB_UI_BRAND_NAME = "
|
|
1870
|
+
export declare const WEB_UI_BRAND_NAME = "Weave UI";
|
|
1871
1871
|
|
|
1872
|
-
export declare const WEB_UI_PLUGIN_NAME = "
|
|
1872
|
+
export declare const WEB_UI_PLUGIN_NAME = "WeaveUI";
|
|
1873
1873
|
|
|
1874
|
-
export declare const WEB_UI_RUNTIME_ID = "
|
|
1874
|
+
export declare const WEB_UI_RUNTIME_ID = "weave-ui";
|
|
1875
1875
|
|
|
1876
1876
|
export declare const YyCheckbox: SFCWithInstall<DefineComponent< {
|
|
1877
1877
|
data?: CheckboxOption[];
|