@das-fed/upf-utils 6.4.0-dev.287 → 6.4.0-dev.289
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/api-services/es5.js +1672 -1660
- package/api-services/index.js +1362 -1344
- package/api-services/index.js.gz +0 -0
- package/api-services/modules/app-manage/es5.js +1110 -1122
- package/api-services/modules/app-manage/index.js +918 -936
- package/api-services/modules/app-manage/index.js.gz +0 -0
- package/api-services/modules/authentication/es5.js +1122 -1134
- package/api-services/modules/authentication/index.js +930 -948
- package/api-services/modules/authentication/index.js.gz +0 -0
- package/api-services/modules/bems/es5.js +1137 -1128
- package/api-services/modules/bems/index.js +950 -936
- package/api-services/modules/bems/index.js.gz +0 -0
- package/api-services/modules/contract/es5.js +1122 -1134
- package/api-services/modules/contract/index.js +930 -948
- package/api-services/modules/contract/index.js.gz +0 -0
- package/api-services/modules/duty-manage/es5.js +848 -850
- package/api-services/modules/duty-manage/index.js +666 -670
- package/api-services/modules/duty-manage/index.js.gz +0 -0
- package/api-services/modules/es5.js +1355 -1367
- package/api-services/modules/file/es5.js +1224 -1221
- package/api-services/modules/file/index.js +997 -993
- package/api-services/modules/file/index.js.gz +0 -0
- package/api-services/modules/gateway-edge/es5.js +1122 -1134
- package/api-services/modules/gateway-edge/index.js +930 -948
- package/api-services/modules/gateway-edge/index.js.gz +0 -0
- package/api-services/modules/index.js +1068 -1086
- package/api-services/modules/index.js.gz +0 -0
- package/api-services/modules/justauth/es5.js +873 -876
- package/api-services/modules/justauth/index.js +684 -688
- package/api-services/modules/justauth/index.js.gz +0 -0
- package/api-services/modules/knowledge/es5.js +1132 -1122
- package/api-services/modules/knowledge/index.js +944 -930
- package/api-services/modules/knowledge/index.js.gz +0 -0
- package/api-services/modules/link/es5.js +860 -857
- package/api-services/modules/link/index.js +674 -670
- package/api-services/modules/link/index.js.gz +0 -0
- package/api-services/modules/platformManage/es5.js +1238 -1226
- package/api-services/modules/platformManage/index.js +1032 -1014
- package/api-services/modules/platformManage/index.js.gz +0 -0
- package/api-services/modules/portal/es5.js +1124 -1133
- package/api-services/modules/portal/index.js +933 -947
- package/api-services/modules/portal/index.js.gz +0 -0
- package/api-services/modules/space-manage/es5.js +860 -857
- package/api-services/modules/space-manage/index.js +674 -670
- package/api-services/modules/space-manage/index.js.gz +0 -0
- package/api-services/modules/supplier/es5.js +1126 -1114
- package/api-services/modules/supplier/index.js +938 -920
- package/api-services/modules/supplier/index.js.gz +0 -0
- package/api-services/modules/systemConfiguration/es5.js +1122 -1134
- package/api-services/modules/systemConfiguration/index.js +930 -948
- package/api-services/modules/systemConfiguration/index.js.gz +0 -0
- package/api-services/src/create-service/es5.js +1132 -1120
- package/api-services/src/create-service/index.js +947 -929
- package/api-services/src/create-service/index.js.gz +0 -0
- package/common-info/getPermissionMethod/es5.js +1388 -1376
- package/common-info/getPermissionMethod/index.js +1155 -1137
- package/common-info/getPermissionMethod/index.js.gz +0 -0
- package/common-tools/timezone-format/es5.d.ts +1 -0
- package/common-tools/timezone-format/es5.js +159 -146
- package/common-tools/timezone-format/index.d.ts +1 -0
- package/common-tools/timezone-format/index.js +127 -111
- package/common-tools/timezone-format/index.js.gz +0 -0
- package/config/es5.js +12 -8
- package/config/index.js +7 -4
- package/create-api-service/es5.js +1133 -1121
- package/create-api-service/index.js +948 -930
- package/create-api-service/index.js.gz +0 -0
- package/esm-map.json +4 -1
- package/package.json +7 -7
- package/realtime-connection/es5.d.ts +70 -0
- package/realtime-connection/es5.js +340 -0
- package/realtime-connection/index.d.ts +70 -0
- package/realtime-connection/index.js +168 -0
- package/realtime-connection/index.js.gz +0 -0
- package/release-meta.json +4 -4
- package/theme/es5.js +41 -41
- package/theme/index.js +35 -35
- package/theme/index.js.gz +0 -0
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import { getConfig as c } from "@das-fed/upf-utils/config";
|
|
2
|
+
import { objectToUrlparams as h } from "@das-fed/upf-utils/common-tools";
|
|
3
|
+
const l = 3e3, u = 3e4, m = () => {
|
|
4
|
+
const i = c(), t = i.wsBaseURL || i.baseURL || location.origin;
|
|
5
|
+
return String(t || "").replace(/^https:/i, "wss:").replace(/^http:/i, "ws:").replace(/\/+$/, "");
|
|
6
|
+
}, d = (i) => /^wss?:\/\//i.test(i), f = (i) => /^https?:\/\//i.test(i), p = (i, t) => {
|
|
7
|
+
const e = String(i || "").trim(), s = d(e) ? e : f(e) ? e.replace(/^https:/i, "wss:").replace(/^http:/i, "ws:") : `${m()}${e.startsWith("/") ? e : `/${e}`}`, r = h(t);
|
|
8
|
+
return r ? `${s}${s.includes("?") ? "&" : "?"}${r}` : s;
|
|
9
|
+
}, T = (i, t) => t ? (Array.isArray(t) ? t : [t]).includes(String(i ?? "")) : !1, b = (i) => typeof i.data == "string" ? JSON.parse(i.data) : i.data;
|
|
10
|
+
class S {
|
|
11
|
+
constructor(t) {
|
|
12
|
+
this.ws = null, this.state = "idle", this.heartbeatTimer = null, this.heartbeatTimeoutTimer = null, this.reconnectTimer = null, this.reconnectAttempts = 0, this.manualClosed = !1, this.started = !1, this.lastHeartbeatAck = !0, this.options = t, this.handleOnline = this.handleOnline.bind(this), this.handleOffline = this.handleOffline.bind(this);
|
|
13
|
+
}
|
|
14
|
+
/** 获取当前连接状态,供业务显示或调试兜底使用。 */
|
|
15
|
+
getState() {
|
|
16
|
+
return this.state;
|
|
17
|
+
}
|
|
18
|
+
/** 建立连接;重复调用不会创建多个活动 WebSocket。 */
|
|
19
|
+
async connect() {
|
|
20
|
+
if (!(this.started && (this.state === "connecting" || this.state === "open" || this.state === "reconnecting"))) {
|
|
21
|
+
if (this.started = !0, this.manualClosed = !1, typeof WebSocket > "u") {
|
|
22
|
+
this.setState("unsupported");
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
typeof window < "u" && (window.addEventListener("online", this.handleOnline), window.addEventListener("offline", this.handleOffline)), await this.openSocket();
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
/** 仅在连接已打开时发送消息,失败时返回 false。 */
|
|
29
|
+
send(t) {
|
|
30
|
+
var e;
|
|
31
|
+
return ((e = this.ws) == null ? void 0 : e.readyState) !== WebSocket.OPEN ? !1 : (this.ws.send(t), !0);
|
|
32
|
+
}
|
|
33
|
+
/** 主动关闭连接,并清理心跳、重连和网络监听。 */
|
|
34
|
+
close() {
|
|
35
|
+
this.manualClosed = !0, this.started = !1, this.clearTimers(), this.removeNetworkListeners(), this.closeSocket(), this.setState("closed");
|
|
36
|
+
}
|
|
37
|
+
async openSocket() {
|
|
38
|
+
var s, r;
|
|
39
|
+
if (this.manualClosed) return;
|
|
40
|
+
this.clearReconnectTimer(), this.closeSocket(), this.setState(this.reconnectAttempts > 0 ? "reconnecting" : "connecting");
|
|
41
|
+
const t = { ...this.options.params || {} }, e = await this.resolveToken();
|
|
42
|
+
if (this.options.tokenProvider && !e) {
|
|
43
|
+
this.scheduleReconnect("waiting-token");
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
e && (t[this.options.tokenParamName || "access_token"] = e);
|
|
47
|
+
try {
|
|
48
|
+
const n = new WebSocket(p(this.options.url, t));
|
|
49
|
+
this.ws = n, n.onopen = (o) => this.handleOpen(o), n.onmessage = (o) => this.handleMessage(o), n.onclose = (o) => this.handleClose(o), n.onerror = (o) => this.handleError(o);
|
|
50
|
+
} catch (n) {
|
|
51
|
+
(r = (s = this.options).onInvalidMessage) == null || r.call(s, n, {}), this.scheduleReconnect();
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
async resolveToken() {
|
|
55
|
+
if (!this.options.tokenProvider) return "";
|
|
56
|
+
try {
|
|
57
|
+
return String(await this.options.tokenProvider() || "").trim();
|
|
58
|
+
} catch {
|
|
59
|
+
return "";
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
handleOpen(t) {
|
|
63
|
+
var e, s;
|
|
64
|
+
this.reconnectAttempts = 0, this.lastHeartbeatAck = !0, this.setState("open"), (s = (e = this.options).onOpen) == null || s.call(e, t), this.startHeartbeat();
|
|
65
|
+
}
|
|
66
|
+
handleMessage(t) {
|
|
67
|
+
var e, s, r, n, o;
|
|
68
|
+
if (T(t.data, (e = this.options.heartbeat) == null ? void 0 : e.response)) {
|
|
69
|
+
this.lastHeartbeatAck = !0, this.clearHeartbeatTimeoutTimer();
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
try {
|
|
73
|
+
const a = this.options.parser || b;
|
|
74
|
+
(r = (s = this.options).onMessage) == null || r.call(s, a(t), t);
|
|
75
|
+
} catch (a) {
|
|
76
|
+
(o = (n = this.options).onInvalidMessage) == null || o.call(n, a, t);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
handleClose(t) {
|
|
80
|
+
var e, s;
|
|
81
|
+
if (this.clearHeartbeatTimers(), (s = (e = this.options).onClose) == null || s.call(e, t), this.manualClosed) {
|
|
82
|
+
this.setState("closed");
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
this.scheduleReconnect();
|
|
86
|
+
}
|
|
87
|
+
handleError(t) {
|
|
88
|
+
var e, s;
|
|
89
|
+
(s = (e = this.options).onError) == null || s.call(e, t);
|
|
90
|
+
}
|
|
91
|
+
startHeartbeat() {
|
|
92
|
+
const t = this.options.heartbeat;
|
|
93
|
+
!(t != null && t.message) || !t.interval || (this.clearHeartbeatTimers(), this.heartbeatTimer = setInterval(() => {
|
|
94
|
+
if (!this.ws || this.ws.readyState !== WebSocket.OPEN) return;
|
|
95
|
+
if (t.timeout && !this.lastHeartbeatAck) {
|
|
96
|
+
this.closeSocket(), this.scheduleReconnect();
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
const e = typeof t.message == "function" ? t.message() : t.message;
|
|
100
|
+
this.lastHeartbeatAck = !1, this.send(e), t.timeout && (this.clearHeartbeatTimeoutTimer(), this.heartbeatTimeoutTimer = setTimeout(() => {
|
|
101
|
+
this.lastHeartbeatAck || this.manualClosed || (this.closeSocket(), this.scheduleReconnect());
|
|
102
|
+
}, t.timeout));
|
|
103
|
+
}, t.interval));
|
|
104
|
+
}
|
|
105
|
+
scheduleReconnect(t = "reconnecting") {
|
|
106
|
+
var n;
|
|
107
|
+
if (this.manualClosed || !((n = this.options.reconnect) != null && n.enabled)) {
|
|
108
|
+
this.setState("closed");
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
if (typeof navigator < "u" && navigator.onLine === !1) {
|
|
112
|
+
this.setState(t);
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
const { maxAttempts: e, jitter: s } = this.options.reconnect;
|
|
116
|
+
if (typeof e == "number" && e >= 0 && this.reconnectAttempts >= e) {
|
|
117
|
+
this.setState("closed");
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
this.reconnectAttempts += 1;
|
|
121
|
+
const r = this.getReconnectDelay();
|
|
122
|
+
this.setState(t), this.clearReconnectTimer(), this.reconnectTimer = setTimeout(() => {
|
|
123
|
+
if (s) {
|
|
124
|
+
setTimeout(() => this.openSocket(), Math.floor(Math.random() * 300));
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
this.openSocket();
|
|
128
|
+
}, r);
|
|
129
|
+
}
|
|
130
|
+
getReconnectDelay() {
|
|
131
|
+
const t = this.options.reconnect || { enabled: !1 }, e = t.delay || l, s = t.maxDelay || u;
|
|
132
|
+
return Math.min(e * Math.pow(2, Math.max(0, this.reconnectAttempts - 1)), s);
|
|
133
|
+
}
|
|
134
|
+
handleOnline() {
|
|
135
|
+
!this.started || this.manualClosed || this.state === "open" || this.state === "connecting" || this.openSocket();
|
|
136
|
+
}
|
|
137
|
+
handleOffline() {
|
|
138
|
+
this.manualClosed || (this.clearReconnectTimer(), this.closeSocket(), this.setState("reconnecting"));
|
|
139
|
+
}
|
|
140
|
+
setState(t) {
|
|
141
|
+
var e, s;
|
|
142
|
+
this.state !== t && (this.state = t, (s = (e = this.options).onStateChange) == null || s.call(e, t));
|
|
143
|
+
}
|
|
144
|
+
closeSocket() {
|
|
145
|
+
const t = this.ws;
|
|
146
|
+
t && (t.onopen = null, t.onmessage = null, t.onclose = null, t.onerror = null, (t.readyState === WebSocket.OPEN || t.readyState === WebSocket.CONNECTING) && t.close(), this.ws = null);
|
|
147
|
+
}
|
|
148
|
+
clearTimers() {
|
|
149
|
+
this.clearHeartbeatTimers(), this.clearReconnectTimer();
|
|
150
|
+
}
|
|
151
|
+
clearHeartbeatTimers() {
|
|
152
|
+
this.heartbeatTimer && clearInterval(this.heartbeatTimer), this.heartbeatTimer = null, this.clearHeartbeatTimeoutTimer();
|
|
153
|
+
}
|
|
154
|
+
clearHeartbeatTimeoutTimer() {
|
|
155
|
+
this.heartbeatTimeoutTimer && clearTimeout(this.heartbeatTimeoutTimer), this.heartbeatTimeoutTimer = null;
|
|
156
|
+
}
|
|
157
|
+
clearReconnectTimer() {
|
|
158
|
+
this.reconnectTimer && clearTimeout(this.reconnectTimer), this.reconnectTimer = null;
|
|
159
|
+
}
|
|
160
|
+
removeNetworkListeners() {
|
|
161
|
+
typeof window > "u" || (window.removeEventListener("online", this.handleOnline), window.removeEventListener("offline", this.handleOffline));
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
const g = (i) => new S(i);
|
|
165
|
+
export {
|
|
166
|
+
S as RealtimeSocketClient,
|
|
167
|
+
g as createRealtimeSocketClient
|
|
168
|
+
};
|
|
Binary file
|
package/release-meta.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"packageName": "@das-fed/upf-utils",
|
|
3
|
-
"releaseVersion": "6.4.0-dev.
|
|
3
|
+
"releaseVersion": "6.4.0-dev.289",
|
|
4
4
|
"distTag": "dev",
|
|
5
5
|
"releaseType": "publish",
|
|
6
|
-
"publishedAt": "2026-07-
|
|
6
|
+
"publishedAt": "2026-07-08T01:52:46.305Z",
|
|
7
7
|
"sourceBranch": "dev",
|
|
8
|
-
"sourceCommit": "
|
|
9
|
-
"gitTag": "upf-release/v6.4.0-dev.
|
|
8
|
+
"sourceCommit": "78a710c274cfb48feeff4e3e4b5c18d43396202b",
|
|
9
|
+
"gitTag": "upf-release/v6.4.0-dev.289",
|
|
10
10
|
"gitRemote": "origin",
|
|
11
11
|
"gitRemoteUrl": "http://gitlab.dasiot.cn/foundation/frontend/framework.git",
|
|
12
12
|
"releaseStatus": "success"
|
package/theme/es5.js
CHANGED
|
@@ -400,7 +400,7 @@ var m = "#ffffff",
|
|
|
400
400
|
"--upf-menu-hover-bg": "#f2f2f2",
|
|
401
401
|
"--upf-menu-active-bg": "#f2f6ff",
|
|
402
402
|
"--upf-menu-active-text": "#5582f3",
|
|
403
|
-
"--upf-menu-submenu-bg": "#
|
|
403
|
+
"--upf-menu-submenu-bg": "#FAFAFA",
|
|
404
404
|
"--upf-tab-hover-bg": "#f2f6ff",
|
|
405
405
|
"--upf-tab-active-text": "#5582f3",
|
|
406
406
|
"--upf-box-shadow": "0 2px 8px rgba(0, 0, 0, 0.08)",
|
|
@@ -421,12 +421,12 @@ var m = "#ffffff",
|
|
|
421
421
|
"--upf-nav-active-bg": "#5582f3",
|
|
422
422
|
"--upf-nav-active-text": "#ffffff",
|
|
423
423
|
"--upf-menu-bg": "#1f2346",
|
|
424
|
-
"--upf-menu-text": "
|
|
424
|
+
"--upf-menu-text": "rgba(255, 255, 255, 0.8)",
|
|
425
425
|
"--upf-menu-hover-bg": "#2d3158",
|
|
426
426
|
"--upf-menu-active-bg": "#2d3158",
|
|
427
427
|
"--upf-menu-active-text": "#ffffff",
|
|
428
428
|
"--upf-menu-submenu-bg": "#171b36",
|
|
429
|
-
"--upf-tab-hover-bg": "#
|
|
429
|
+
"--upf-tab-hover-bg": "#0d111b",
|
|
430
430
|
"--upf-tab-active-text": "#5582f3",
|
|
431
431
|
"--upf-box-shadow": "0 6px 18px rgba(15, 23, 42, 0.08)",
|
|
432
432
|
"--upf-box-shadow-elevated": "0 10px 28px rgba(35, 41, 75, 0.12)"
|
|
@@ -549,36 +549,36 @@ var m = "#ffffff",
|
|
|
549
549
|
basePresetName: "dkh",
|
|
550
550
|
variables: Ce
|
|
551
551
|
},
|
|
552
|
-
|
|
553
|
-
|
|
552
|
+
Fe = y.ssl,
|
|
553
|
+
we = {
|
|
554
554
|
name: "ssl",
|
|
555
555
|
displayName: "深邃蓝",
|
|
556
556
|
description: "深邃蓝壳层主题,内容区沿用浅底与高亮蓝交互色",
|
|
557
557
|
mode: "dark",
|
|
558
558
|
source: "preset",
|
|
559
559
|
basePresetName: "ssl",
|
|
560
|
-
variables:
|
|
560
|
+
variables: Fe
|
|
561
561
|
},
|
|
562
562
|
_e = ["default", "cjb", "ssl", "dkh"],
|
|
563
563
|
R = {
|
|
564
564
|
"default": Te,
|
|
565
565
|
cjb: xe,
|
|
566
|
-
ssl:
|
|
566
|
+
ssl: we,
|
|
567
567
|
dkh: Se
|
|
568
568
|
},
|
|
569
|
-
|
|
569
|
+
Ae = function Ae(e) {
|
|
570
570
|
return _objectSpread({}, e);
|
|
571
571
|
},
|
|
572
572
|
Z = function Z(e) {
|
|
573
573
|
return _objectSpread(_objectSpread({}, e), {}, {
|
|
574
|
-
variables:
|
|
574
|
+
variables: Ae(e.variables)
|
|
575
575
|
});
|
|
576
576
|
},
|
|
577
577
|
g = function g(e) {
|
|
578
578
|
var r = String(e || "").trim();
|
|
579
579
|
return R[r] ? Z(R[r]) : undefined;
|
|
580
580
|
},
|
|
581
|
-
|
|
581
|
+
Ne = function Ne() {
|
|
582
582
|
return _e.map(function (e) {
|
|
583
583
|
return Z(R[e]);
|
|
584
584
|
});
|
|
@@ -628,7 +628,7 @@ var m = "#ffffff",
|
|
|
628
628
|
Re = function Re(e) {
|
|
629
629
|
return Array.isArray(e) ? _toConsumableArray(e) : [e];
|
|
630
630
|
},
|
|
631
|
-
|
|
631
|
+
F = function F(e, r) {
|
|
632
632
|
var t = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
633
633
|
return r.reduce(function (o, u) {
|
|
634
634
|
var _u$value;
|
|
@@ -1615,19 +1615,19 @@ var m = "#ffffff",
|
|
|
1615
1615
|
}]),
|
|
1616
1616
|
Oe = function Oe(e) {
|
|
1617
1617
|
var r = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
1618
|
-
return
|
|
1618
|
+
return F(e, De, r);
|
|
1619
1619
|
},
|
|
1620
1620
|
Le = function Le(e) {
|
|
1621
1621
|
var r = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
1622
|
-
return
|
|
1622
|
+
return F(e, Me, r);
|
|
1623
1623
|
},
|
|
1624
1624
|
Ue = function Ue(e) {
|
|
1625
1625
|
var r = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
1626
|
-
return
|
|
1626
|
+
return F(e, Pe, r);
|
|
1627
1627
|
},
|
|
1628
1628
|
ze = function ze(e) {
|
|
1629
1629
|
var r = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
1630
|
-
return
|
|
1630
|
+
return F(e, Ie, r);
|
|
1631
1631
|
},
|
|
1632
1632
|
P = function P(e) {
|
|
1633
1633
|
var r = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
@@ -1664,13 +1664,13 @@ var m = "#ffffff",
|
|
|
1664
1664
|
return g(e);
|
|
1665
1665
|
},
|
|
1666
1666
|
Tr = function Tr() {
|
|
1667
|
-
return
|
|
1667
|
+
return Ne();
|
|
1668
1668
|
},
|
|
1669
|
-
|
|
1669
|
+
w = function w() {
|
|
1670
1670
|
return g("default");
|
|
1671
1671
|
},
|
|
1672
1672
|
Cr = function Cr() {
|
|
1673
|
-
return _objectSpread({},
|
|
1673
|
+
return _objectSpread({}, w().variables);
|
|
1674
1674
|
},
|
|
1675
1675
|
I = function I(e) {
|
|
1676
1676
|
return e || ((typeof document === "undefined" ? "undefined" : _typeof(document)) > "u" ? null : document.documentElement);
|
|
@@ -1720,7 +1720,7 @@ var m = "#ffffff",
|
|
|
1720
1720
|
We = function We() {
|
|
1721
1721
|
var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "default";
|
|
1722
1722
|
var r = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
1723
|
-
var t = g(e) ||
|
|
1723
|
+
var t = g(e) || w();
|
|
1724
1724
|
return O(P(t.variables, _objectSpread(_objectSpread({}, r), {}, {
|
|
1725
1725
|
themeName: r.themeName || t.name,
|
|
1726
1726
|
basePresetName: r.basePresetName || t.basePresetName
|
|
@@ -1748,7 +1748,7 @@ var m = "#ffffff",
|
|
|
1748
1748
|
L = function L(e) {
|
|
1749
1749
|
return Object.prototype.toString.call(e) === "[object Object]";
|
|
1750
1750
|
},
|
|
1751
|
-
|
|
1751
|
+
A = function A(e) {
|
|
1752
1752
|
return {
|
|
1753
1753
|
themeName: e.name,
|
|
1754
1754
|
basePresetName: e.basePresetName,
|
|
@@ -1756,7 +1756,7 @@ var m = "#ffffff",
|
|
|
1756
1756
|
};
|
|
1757
1757
|
},
|
|
1758
1758
|
x = function x() {
|
|
1759
|
-
return
|
|
1759
|
+
return A(w());
|
|
1760
1760
|
},
|
|
1761
1761
|
oe = function oe(e) {
|
|
1762
1762
|
if ((typeof window === "undefined" ? "undefined" : _typeof(window)) > "u") return null;
|
|
@@ -1783,7 +1783,7 @@ var m = "#ffffff",
|
|
|
1783
1783
|
var r = L(e.customTheme) ? e.customTheme : null;
|
|
1784
1784
|
if (!r) return null;
|
|
1785
1785
|
var t = String(r.basePresetName || e.remoteTheme || "").trim(),
|
|
1786
|
-
o = g(t) ||
|
|
1786
|
+
o = g(t) || w(),
|
|
1787
1787
|
u = qe(r.variables, o.variables);
|
|
1788
1788
|
return u ? {
|
|
1789
1789
|
themeName: "custom",
|
|
@@ -1807,7 +1807,7 @@ var m = "#ffffff",
|
|
|
1807
1807
|
continue;
|
|
1808
1808
|
}
|
|
1809
1809
|
var l = g(n);
|
|
1810
|
-
if (l) return
|
|
1810
|
+
if (l) return A(l);
|
|
1811
1811
|
}
|
|
1812
1812
|
return null;
|
|
1813
1813
|
},
|
|
@@ -1817,7 +1817,7 @@ var m = "#ffffff",
|
|
|
1817
1817
|
for (var _i2 = 0, _t = t; _i2 < _t.length; _i2++) {
|
|
1818
1818
|
var o = _t[_i2];
|
|
1819
1819
|
var u = g(String(o || "").trim());
|
|
1820
|
-
if (u) return
|
|
1820
|
+
if (u) return A(u);
|
|
1821
1821
|
}
|
|
1822
1822
|
return null;
|
|
1823
1823
|
},
|
|
@@ -1831,7 +1831,7 @@ var m = "#ffffff",
|
|
|
1831
1831
|
return (n ? ae(n) : null) || x();
|
|
1832
1832
|
}
|
|
1833
1833
|
var o = g(t);
|
|
1834
|
-
return o ?
|
|
1834
|
+
return o ? A(o) : x();
|
|
1835
1835
|
}
|
|
1836
1836
|
return Xe(e) || Je(r) || x();
|
|
1837
1837
|
},
|
|
@@ -1839,7 +1839,7 @@ var m = "#ffffff",
|
|
|
1839
1839
|
var t = _(e);
|
|
1840
1840
|
(r.parentNode !== t || t.firstChild !== r) && t.insertBefore(r, t.firstChild);
|
|
1841
1841
|
},
|
|
1842
|
-
|
|
1842
|
+
Fr = function Fr() {
|
|
1843
1843
|
var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
1844
1844
|
var p;
|
|
1845
1845
|
if ((typeof document === "undefined" ? "undefined" : _typeof(document)) > "u") return null;
|
|
@@ -1957,13 +1957,13 @@ var m = "#ffffff",
|
|
|
1957
1957
|
return null;
|
|
1958
1958
|
}
|
|
1959
1959
|
},
|
|
1960
|
-
|
|
1960
|
+
N = function N() {
|
|
1961
1961
|
var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
1962
1962
|
return (typeof window === "undefined" ? "undefined" : _typeof(window)) > "u" ? null : V(window, "current", e) || V(window.parent, "parent", e) || V(window.top, "top", e);
|
|
1963
1963
|
},
|
|
1964
1964
|
ne = function ne() {
|
|
1965
1965
|
var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
1966
|
-
var r =
|
|
1966
|
+
var r = N(e.debug),
|
|
1967
1967
|
t = r != null && r.getCurrentTheme ? r.getCurrentTheme() : null;
|
|
1968
1968
|
if (t) return t;
|
|
1969
1969
|
var o = ((typeof window === "undefined" ? "undefined" : _typeof(window)) < "u" ? window.__UPF_THEME_SNAPSHOT__ : null) || null;
|
|
@@ -1975,14 +1975,14 @@ var m = "#ffffff",
|
|
|
1975
1975
|
if (r) return E(r);
|
|
1976
1976
|
var t = ne(e);
|
|
1977
1977
|
if (t != null && t.variables) return E(t.variables);
|
|
1978
|
-
var o =
|
|
1978
|
+
var o = N(e.debug);
|
|
1979
1979
|
if (!o) return null;
|
|
1980
1980
|
var u = o.getVariables ? o.getVariables() : null;
|
|
1981
1981
|
return E(u);
|
|
1982
1982
|
},
|
|
1983
|
-
|
|
1983
|
+
wr = function wr(e) {
|
|
1984
1984
|
var r = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
1985
|
-
var t =
|
|
1985
|
+
var t = N(r);
|
|
1986
1986
|
return t != null && t.changeTheme ? (t.changeTheme(e), true) : false;
|
|
1987
1987
|
},
|
|
1988
1988
|
le = function le() {
|
|
@@ -2044,7 +2044,7 @@ var m = "#ffffff",
|
|
|
2044
2044
|
_e$debug = e.debug,
|
|
2045
2045
|
u = _e$debug === void 0 ? true : _e$debug,
|
|
2046
2046
|
n = _objectWithoutProperties(e, _excluded),
|
|
2047
|
-
l =
|
|
2047
|
+
l = N(u);
|
|
2048
2048
|
var i = false,
|
|
2049
2049
|
s = null,
|
|
2050
2050
|
c = null;
|
|
@@ -2066,7 +2066,7 @@ var m = "#ffffff",
|
|
|
2066
2066
|
i = true, s !== null && typeof cancelAnimationFrame == "function" && (cancelAnimationFrame(s), s = null), c !== null && (clearTimeout(c), c = null), k == null || k();
|
|
2067
2067
|
};
|
|
2068
2068
|
},
|
|
2069
|
-
|
|
2069
|
+
Ar = function Ar() {
|
|
2070
2070
|
var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
2071
2071
|
return mr(_objectSpread({
|
|
2072
2072
|
includeBridges: false,
|
|
@@ -2085,7 +2085,7 @@ var m = "#ffffff",
|
|
|
2085
2085
|
debug: false
|
|
2086
2086
|
})) == null ? undefined : n[o]) !== null && _ref75 !== void 0 ? _ref75 : "");
|
|
2087
2087
|
},
|
|
2088
|
-
|
|
2088
|
+
Nr = function Nr(e) {
|
|
2089
2089
|
return "var(".concat(String(e || "").trim(), ")");
|
|
2090
2090
|
},
|
|
2091
2091
|
kr = function kr(e, r) {
|
|
@@ -2111,15 +2111,15 @@ exports.applyThemeVariablesToDocument = nr;
|
|
|
2111
2111
|
exports.buildDefaultThemeCssText = Sr;
|
|
2112
2112
|
exports.buildPresetThemeCssText = We;
|
|
2113
2113
|
exports.buildRuntimeThemeVariables = P;
|
|
2114
|
-
exports.changeTheme =
|
|
2115
|
-
exports.ensureDefaultThemeStyle =
|
|
2114
|
+
exports.changeTheme = wr;
|
|
2115
|
+
exports.ensureDefaultThemeStyle = Fr;
|
|
2116
2116
|
exports.getAllPresetThemes = Tr;
|
|
2117
2117
|
exports.getCurrentTheme = ne;
|
|
2118
|
-
exports.getDefaultPresetTheme =
|
|
2118
|
+
exports.getDefaultPresetTheme = w;
|
|
2119
2119
|
exports.getDefaultThemeVariables = Cr;
|
|
2120
2120
|
exports.getHostThemeSnapshotFromWindowName = ar;
|
|
2121
2121
|
exports.getPresetTheme = Er;
|
|
2122
|
-
exports.getThemeAPI =
|
|
2122
|
+
exports.getThemeAPI = N;
|
|
2123
2123
|
exports.getThemeSourceVariableCategories = vr;
|
|
2124
2124
|
exports.getThemeSourceVariableHints = yr;
|
|
2125
2125
|
exports.getThemeSourceVariableLabels = hr;
|
|
@@ -2127,15 +2127,15 @@ exports.getThemeSourceVariableNames = br;
|
|
|
2127
2127
|
exports.getThemeSourceVariableRelations = xr;
|
|
2128
2128
|
exports.getThemeVariable = dr;
|
|
2129
2129
|
exports.getThemeVariables = lr;
|
|
2130
|
-
exports.getVar =
|
|
2130
|
+
exports.getVar = Nr;
|
|
2131
2131
|
exports.getVarValue = kr;
|
|
2132
|
-
exports.initHostThemeRootSync =
|
|
2132
|
+
exports.initHostThemeRootSync = Ar;
|
|
2133
2133
|
exports.initSubAppThemeSync = mr;
|
|
2134
2134
|
exports.mixHexColor = Q;
|
|
2135
2135
|
exports.normalizeHexColor = X;
|
|
2136
2136
|
exports.normalizeThemeSourceVariables = ye;
|
|
2137
2137
|
exports.resolvePrimaryBgColor = D;
|
|
2138
|
-
exports.resolveThemeBridgeVariables =
|
|
2138
|
+
exports.resolveThemeBridgeVariables = F;
|
|
2139
2139
|
exports.syncHostThemeRoot = _r;
|
|
2140
2140
|
exports.syncThemeFromHost = le;
|
|
2141
2141
|
exports.toDasUiColorOverrides = Ue;
|