@24city/web-console 0.1.2 → 0.2.0

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.
Files changed (53) hide show
  1. package/CHANGELOG.md +66 -0
  2. package/GUIDELINES.md +223 -0
  3. package/README.md +70 -11
  4. package/dist/account/index.js +2 -2
  5. package/dist/chunks/console-layout-DH-aROYp.js +209 -0
  6. package/dist/chunks/page-YBG0dEN1.js +111 -0
  7. package/dist/chunks/scale-smFifpMm.js +26 -0
  8. package/dist/chunks/{stale-build-DUKkQHuu.js → stale-build-DG-Tb2RA.js} +24 -20
  9. package/dist/chunks/status-tag-BrLUhH6Z.js +87 -0
  10. package/dist/chunks/text-link-BAKoHe5o.js +64 -0
  11. package/dist/chunks/unsupported-browser-Dwq1mNRy.js +48 -0
  12. package/dist/chunks/upgrade-modal-DgChxbLm.js +667 -0
  13. package/dist/chunks/{wallet-badge-CnyMLpUO.js → wallet-badge-dVrO6py9.js} +118 -118
  14. package/dist/chunks/waterfall-CQG8aVdx.js +613 -0
  15. package/dist/data/index.d.ts +2 -0
  16. package/dist/data/index.js +6 -0
  17. package/dist/data/metric-card.d.ts +41 -0
  18. package/dist/data/status-tag.d.ts +18 -0
  19. package/dist/index.d.ts +2 -0
  20. package/dist/index.js +160 -120
  21. package/dist/layout/index.js +1 -1
  22. package/dist/list/choice-cards.d.ts +29 -0
  23. package/dist/list/content-square.d.ts +50 -0
  24. package/dist/list/filter-dropdown.d.ts +43 -0
  25. package/dist/list/filter-panel.d.ts +94 -0
  26. package/dist/list/index.d.ts +7 -0
  27. package/dist/list/index.js +27 -0
  28. package/dist/list/list-toolbar.d.ts +56 -0
  29. package/dist/list/waterfall-layout.d.ts +11 -0
  30. package/dist/list/waterfall.d.ts +13 -0
  31. package/dist/page/index.d.ts +2 -0
  32. package/dist/page/index.js +19 -15
  33. package/dist/page/page.d.ts +21 -2
  34. package/dist/page/select-label.d.ts +11 -0
  35. package/dist/page/unsupported-browser.d.ts +2 -0
  36. package/dist/runtime/browser-support.d.ts +6 -0
  37. package/dist/runtime/index.d.ts +1 -0
  38. package/dist/runtime/index.js +38 -37
  39. package/dist/runtime/providers.d.ts +1 -1
  40. package/dist/styles.css +1993 -576
  41. package/dist/testing/guard.d.ts +25 -0
  42. package/dist/testing/guard.js +95 -38
  43. package/dist/theme/index.d.ts +1 -0
  44. package/dist/theme/index.js +29 -25
  45. package/dist/theme/scale.d.ts +34 -0
  46. package/dist/vite.d.ts +24 -0
  47. package/dist/vite.js +24 -0
  48. package/package.json +18 -2
  49. package/dist/chunks/console-layout-BibioK5M.js +0 -198
  50. package/dist/chunks/error-boundary-D3qiD7ov.js +0 -35
  51. package/dist/chunks/page-BaitnD--.js +0 -89
  52. package/dist/chunks/text-link-FTsBp_QU.js +0 -54
  53. package/dist/chunks/upgrade-modal-_psMAWRK.js +0 -667
@@ -0,0 +1,209 @@
1
+ import { jsx as a, jsxs as c, Fragment as O } from "react/jsx-runtime";
2
+ import { useState as v, useEffect as P } from "react";
3
+ import { Layout as f, Button as y, Typography as F, Space as Q, Nav as T } from "@douyinfe/semi-ui";
4
+ import { IconSidebar as $ } from "@douyinfe/semi-icons";
5
+ import { useLocation as Y, useNavigate as q, Outlet as D } from "react-router";
6
+ import { h as J, B as V, o as X, e as Z, W as z, b as ee } from "./wallet-badge-dVrO6py9.js";
7
+ import { u as S, b as ae, a as ne } from "./context-CaVim6ZO.js";
8
+ import { u as te } from "./use-media-query-DvyinWNg.js";
9
+ import { a as se } from "./scale-smFifpMm.js";
10
+ const oe = "_layout_1sj6a_6", le = "_header_1sj6a_13", re = "_headerLeft_1sj6a_34", ce = "_logo_1sj6a_42", ie = "_logoMark_1sj6a_57", de = "_logoText_1sj6a_64", ue = "_modules_1sj6a_73", me = "_module_1sj6a_73", pe = "_moduleText_1sj6a_110", _e = "_moduleIcon_1sj6a_130", he = "_moduleInk_1sj6a_134", fe = "_headerRight_1sj6a_154", ye = "_body_1sj6a_163", ke = "_sider_1sj6a_169", ge = "_siderInner_1sj6a_183", je = "_panel_1sj6a_190", Ne = "_expandButton_1sj6a_227", ve = "_menu_1sj6a_243", be = "_menuGroup_1sj6a_254", Ie = "_menuGroupPlain_1sj6a_263", xe = "_menuGroupTitle_1sj6a_268", Ce = "_menuList_1sj6a_279", Me = "_collapseButton_1sj6a_402", Be = "_mask_1sj6a_423", Le = "_content_1sj6a_432", we = "_contentCentered_1sj6a_438", Ge = "_contentInner_1sj6a_450", Te = "_letterMark_1sj6a_503", e = {
11
+ layout: oe,
12
+ header: le,
13
+ headerLeft: re,
14
+ logo: ce,
15
+ logoMark: ie,
16
+ logoText: de,
17
+ modules: ue,
18
+ module: me,
19
+ moduleText: pe,
20
+ moduleIcon: _e,
21
+ moduleInk: he,
22
+ headerRight: fe,
23
+ body: ye,
24
+ sider: ke,
25
+ siderInner: ge,
26
+ panel: je,
27
+ expandButton: Ne,
28
+ menu: ve,
29
+ menuGroup: be,
30
+ menuGroupPlain: Ie,
31
+ menuGroupTitle: xe,
32
+ menuList: Ce,
33
+ collapseButton: Me,
34
+ mask: Be,
35
+ content: Le,
36
+ contentCentered: we,
37
+ contentInner: Ge,
38
+ letterMark: Te
39
+ }, $e = (t, l) => t === l || t.startsWith(`${l}/`), Pe = (t, l) => t.flatMap((s) => s.items).find((s) => new URL(s.to, "http://console.local").pathname === l), Se = (t, l) => {
40
+ var s;
41
+ return (s = [...t].map((r) => ({ module: r, path: new URL(r.to, "http://console.local").pathname })).filter(({ path: r }) => $e(l, r)).sort((r, u) => u.path.length - r.path.length)[0]) == null ? void 0 : s.module;
42
+ }, Re = () => {
43
+ const [t, l] = v(!1);
44
+ return P(() => {
45
+ const s = () => l(window.scrollY > 0);
46
+ return s(), window.addEventListener("scroll", s, { passive: !0 }), () => window.removeEventListener("scroll", s);
47
+ }, []), t;
48
+ }, Ue = ({ size: t = 30, className: l }) => {
49
+ const s = S(), r = (u) => l ? `${u} ${l}` : u;
50
+ return s.markUrl ? /* @__PURE__ */ a(
51
+ "span",
52
+ {
53
+ className: r(e.logoMark),
54
+ style: { width: t, height: t, backgroundImage: `url("${s.markUrl}")` },
55
+ "aria-hidden": "true"
56
+ }
57
+ ) : /* @__PURE__ */ a("span", { className: r(e.letterMark), style: { width: t, height: t }, "aria-hidden": "true", children: Array.from(s.mark).slice(0, 2).join("") });
58
+ }, qe = ({
59
+ modules: t = [],
60
+ activeModuleKey: l,
61
+ moduleTarget: s,
62
+ sidebar: r = [],
63
+ selectedKey: u,
64
+ renderItemLabel: b,
65
+ headerRight: R,
66
+ menuLabel: U = "工作台菜单",
67
+ children: A,
68
+ extra: E
69
+ }) => {
70
+ var G;
71
+ const { config: I } = ae(), x = S(), k = Y(), g = q(), C = I.routes.app, _ = J(C, V(ne())), M = X(C, k.pathname), h = M ? [] : r ?? [], B = h.length > 0, K = l ?? ((G = Se(t, k.pathname)) == null ? void 0 : G.key), m = Pe([...h, _], k.pathname), L = u ?? (m == null ? void 0 : m.key), i = te(se("desktop")), W = Re(), [p, j] = v(!i), [N, d] = v(!1), H = new Map([...h, _].flatMap((n) => n.items.map((o) => [o.key, o])));
72
+ P(() => {
73
+ j(!i), d(!1);
74
+ }, [i]);
75
+ const w = (n) => {
76
+ const o = H.get(n);
77
+ o && g(o.to), d(!1);
78
+ };
79
+ return /* @__PURE__ */ c(f, { className: e.layout, children: [
80
+ /* @__PURE__ */ c(f.Header, { className: e.header, "data-scrolled": W ? "true" : "false", children: [
81
+ /* @__PURE__ */ c("div", { className: e.headerLeft, children: [
82
+ /* @__PURE__ */ c(
83
+ y,
84
+ {
85
+ theme: "borderless",
86
+ type: "tertiary",
87
+ className: e.logo,
88
+ "aria-label": `${x.shortName} 首页`,
89
+ onClick: () => g(I.routes.publicHome),
90
+ children: [
91
+ /* @__PURE__ */ a(Ue, {}),
92
+ /* @__PURE__ */ a(F.Text, { className: e.logoText, children: x.shortName })
93
+ ]
94
+ }
95
+ ),
96
+ t.length ? /* @__PURE__ */ a("div", { className: e.modules, role: "navigation", "aria-label": "产品模块", children: t.map((n) => /* @__PURE__ */ c(
97
+ y,
98
+ {
99
+ theme: "borderless",
100
+ type: "tertiary",
101
+ className: e.module,
102
+ "aria-current": K === n.key ? "page" : void 0,
103
+ onClick: () => g(s ? s(n) : n.to),
104
+ children: [
105
+ /* @__PURE__ */ c("span", { className: e.moduleText, children: [
106
+ n.icon ? /* @__PURE__ */ a("span", { className: e.moduleIcon, children: /* @__PURE__ */ a(n.icon, {}) }) : null,
107
+ n.label
108
+ ] }),
109
+ /* @__PURE__ */ a("span", { className: e.moduleInk, "aria-hidden": "true" })
110
+ ]
111
+ },
112
+ n.key
113
+ )) }) : null
114
+ ] }),
115
+ /* @__PURE__ */ a(Q, { spacing: 10, className: e.headerRight, children: R ?? /* @__PURE__ */ c(O, { children: [
116
+ /* @__PURE__ */ a(Z, {}),
117
+ /* @__PURE__ */ a(z, {}),
118
+ /* @__PURE__ */ a(ee, { personal: _, selectedKey: m && _.items.includes(m) ? m.key : void 0, onOpen: w })
119
+ ] }) })
120
+ ] }),
121
+ /* @__PURE__ */ c(f, { className: e.body, children: [
122
+ B ? /* @__PURE__ */ a("aside", { className: e.sider, "data-collapsed": p ? "true" : "false", children: /* @__PURE__ */ c(
123
+ "div",
124
+ {
125
+ className: e.siderInner,
126
+ "data-collapsed": p ? "true" : "false",
127
+ "data-peek": N ? "true" : "false",
128
+ onMouseEnter: () => {
129
+ p && i && d(!0);
130
+ },
131
+ onMouseLeave: () => {
132
+ i && d(!1);
133
+ },
134
+ children: [
135
+ p ? /* @__PURE__ */ a(
136
+ y,
137
+ {
138
+ theme: "light",
139
+ type: "tertiary",
140
+ className: e.expandButton,
141
+ icon: /* @__PURE__ */ a($, { "aria-hidden": "true" }),
142
+ "aria-label": "展开侧边栏",
143
+ "aria-expanded": N,
144
+ onClick: () => {
145
+ i ? (j(!1), d(!1)) : d((n) => !n);
146
+ }
147
+ }
148
+ ) : null,
149
+ /* @__PURE__ */ c("div", { className: e.panel, children: [
150
+ /* @__PURE__ */ a("nav", { className: e.menu, "aria-label": U, children: h.map((n) => /* @__PURE__ */ c(
151
+ "div",
152
+ {
153
+ className: n.label ? e.menuGroup : `${e.menuGroup} ${e.menuGroupPlain}`,
154
+ role: "group",
155
+ "aria-label": n.label || void 0,
156
+ children: [
157
+ n.label ? /* @__PURE__ */ a("div", { className: e.menuGroupTitle, children: n.label }) : null,
158
+ /* @__PURE__ */ a(
159
+ T,
160
+ {
161
+ mode: "vertical",
162
+ className: e.menuList,
163
+ selectedKeys: L ? [L] : [],
164
+ onSelect: ({ itemKey: o }) => w(String(o)),
165
+ children: n.items.map((o) => /* @__PURE__ */ a(
166
+ T.Item,
167
+ {
168
+ itemKey: o.key,
169
+ icon: o.icon ? /* @__PURE__ */ a(o.icon, {}) : void 0,
170
+ text: b ? b(o) : o.label
171
+ },
172
+ o.key
173
+ ))
174
+ }
175
+ )
176
+ ]
177
+ },
178
+ n.key
179
+ )) }),
180
+ i ? /* @__PURE__ */ a(
181
+ y,
182
+ {
183
+ theme: "borderless",
184
+ type: "tertiary",
185
+ className: e.collapseButton,
186
+ icon: /* @__PURE__ */ a($, { "aria-hidden": "true" }),
187
+ onClick: () => {
188
+ j((n) => !n), d(!1);
189
+ },
190
+ children: p ? "固定侧边栏" : "收起侧边栏"
191
+ }
192
+ ) : null
193
+ ] })
194
+ ]
195
+ }
196
+ ) }) : null,
197
+ N && !i && B ? /* @__PURE__ */ a("div", { className: e.mask, "aria-hidden": "true", onClick: () => d(!1) }) : null,
198
+ /* @__PURE__ */ a(f.Content, { className: M ? `${e.content} ${e.contentCentered}` : e.content, children: /* @__PURE__ */ a("div", { className: e.contentInner, children: A ?? /* @__PURE__ */ a(D, {}) }) })
199
+ ] }),
200
+ E
201
+ ] });
202
+ };
203
+ export {
204
+ Ue as B,
205
+ qe as C,
206
+ Pe as a,
207
+ Se as f,
208
+ $e as i
209
+ };
@@ -0,0 +1,111 @@
1
+ import { jsx as a, jsxs as o } from "react/jsx-runtime";
2
+ import { Empty as p, Spin as m, Card as c, Button as f, Skeleton as i, Space as I, Typography as h } from "@douyinfe/semi-ui";
3
+ import { IllustrationSuccess as T, IllustrationSuccessDark as v, IllustrationIdle as y, IllustrationIdleDark as P, IllustrationNotFound as C, IllustrationNotFoundDark as E, IllustrationNoAccess as w, IllustrationNoAccessDark as D, IllustrationFailure as H, IllustrationFailureDark as S, IllustrationNoContentDark as b, IllustrationNoContent as k } from "@douyinfe/semi-illustrations";
4
+ const B = "_fullPage_17xbx_3", F = "_fullPageCard_17xbx_13", M = "_page_17xbx_18", L = "_pageHeader_17xbx_26", R = "_pageHeaderMain_17xbx_34", A = "_pageBack_17xbx_51", j = "_pageTitleRow_17xbx_70", $ = "_pageTitle_17xbx_70", U = "_pageDescription_17xbx_88", q = "_pageExtra_17xbx_95", z = "_toolbar_17xbx_114", G = "_block_17xbx_123", J = "_blockText_17xbx_141", K = "_status_17xbx_147", O = "_statusExtra_17xbx_151", Q = "_skeleton_17xbx_157", V = "_skeletonImage_17xbx_161", W = "_skeletonText_17xbx_166", X = "_loadingCard_17xbx_178", e = {
5
+ fullPage: B,
6
+ fullPageCard: F,
7
+ page: M,
8
+ pageHeader: L,
9
+ pageHeaderMain: R,
10
+ pageBack: A,
11
+ pageTitleRow: j,
12
+ pageTitle: $,
13
+ pageDescription: U,
14
+ pageExtra: q,
15
+ toolbar: z,
16
+ block: G,
17
+ blockText: J,
18
+ status: K,
19
+ statusExtra: O,
20
+ skeleton: Q,
21
+ skeletonImage: V,
22
+ skeletonText: W,
23
+ loadingCard: X
24
+ }, Y = {
25
+ error: [H, S],
26
+ forbidden: [w, D],
27
+ "not-found": [C, E],
28
+ info: [y, P],
29
+ success: [T, v]
30
+ }, N = ({ status: l, title: t, description: n, extra: s, size: r = 140, className: d, children: g }) => {
31
+ const [u, x] = l === "loading" ? [null, null] : Y[l], _ = { width: r, height: r };
32
+ return /* @__PURE__ */ a(
33
+ p,
34
+ {
35
+ className: d ? `${e.status} ${d}` : e.status,
36
+ image: u ? /* @__PURE__ */ a(u, { style: _ }) : /* @__PURE__ */ a(m, { size: "large" }),
37
+ darkModeImage: x ? /* @__PURE__ */ a(x, { style: _ }) : void 0,
38
+ title: t,
39
+ description: n,
40
+ children: s || g ? /* @__PURE__ */ o("div", { className: e.statusExtra, children: [
41
+ s,
42
+ g
43
+ ] }) : null
44
+ }
45
+ );
46
+ }, ta = ({ title: l, description: t, extra: n, back: s, titleAfter: r, width: d = "full", testId: g, children: u }) => /* @__PURE__ */ o("section", { className: e.page, "data-width": d, "data-testid": g, children: [
47
+ /* @__PURE__ */ o("div", { className: e.pageHeader, children: [
48
+ /* @__PURE__ */ o("div", { className: e.pageHeaderMain, children: [
49
+ s ? /* @__PURE__ */ a("div", { className: e.pageBack, children: s }) : null,
50
+ /* @__PURE__ */ o("div", { className: e.pageTitleRow, children: [
51
+ /* @__PURE__ */ a(h.Title, { heading: 1, className: e.pageTitle, children: l }),
52
+ r
53
+ ] }),
54
+ t ? /* @__PURE__ */ a(h.Paragraph, { className: e.pageDescription, children: t }) : null
55
+ ] }),
56
+ n ? /* @__PURE__ */ a("div", { className: e.pageExtra, children: n }) : null
57
+ ] }),
58
+ u
59
+ ] }), Z = ({ children: l }) => /* @__PURE__ */ a("main", { className: e.fullPage, children: /* @__PURE__ */ a(c, { className: e.fullPageCard, bordered: !1, children: l }) }), sa = () => /* @__PURE__ */ a(Z, { children: /* @__PURE__ */ a("div", { "aria-busy": "true", children: /* @__PURE__ */ a(i, { loading: !0, active: !0, placeholder: /* @__PURE__ */ a(i.Paragraph, { rows: 4 }) }) }) }), ra = ({ children: l }) => /* @__PURE__ */ a("div", { className: e.toolbar, children: l }), oa = ({ message: l = "当前会话或空间不可用,请重新登录。" }) => /* @__PURE__ */ a(c, { bordered: !1, children: /* @__PURE__ */ a("div", { role: "alert", children: /* @__PURE__ */ a(N, { status: "forbidden", title: "当前会话或空间不可用", description: l }) }) }), na = ({ rows: l = 3, image: t = !1 }) => /* @__PURE__ */ a("div", { "aria-busy": "true", children: /* @__PURE__ */ a(c, { bordered: !1, className: e.loadingCard, children: /* @__PURE__ */ a(
60
+ i,
61
+ {
62
+ loading: !0,
63
+ active: !0,
64
+ placeholder: /* @__PURE__ */ o(I, { vertical: !0, align: "start", spacing: 12, className: e.skeleton, children: [
65
+ t ? /* @__PURE__ */ a(i.Image, { className: e.skeletonImage }) : null,
66
+ /* @__PURE__ */ a(i.Paragraph, { rows: l, className: e.skeletonText })
67
+ ] })
68
+ }
69
+ ) }) }), ia = ({ title: l, message: t, retryLabel: n = "重新加载", retrying: s = !1, onRetry: r }) => /* @__PURE__ */ a(c, { bordered: !1, children: /* @__PURE__ */ a("div", { role: "alert", children: /* @__PURE__ */ a(
70
+ N,
71
+ {
72
+ status: "error",
73
+ title: l,
74
+ description: t,
75
+ extra: r ? /* @__PURE__ */ a(f, { theme: "solid", type: "primary", loading: s, onClick: r, children: n }) : void 0
76
+ }
77
+ ) }) }), ca = ({ description: l = "暂无数据", action: t }) => /* @__PURE__ */ a(
78
+ p,
79
+ {
80
+ className: e.block,
81
+ image: /* @__PURE__ */ a(k, { style: { width: 80, height: 80 } }),
82
+ darkModeImage: /* @__PURE__ */ a(b, { style: { width: 80, height: 80 } }),
83
+ description: l,
84
+ children: t ? /* @__PURE__ */ a("div", { className: e.statusExtra, children: t }) : null
85
+ }
86
+ ), da = ({ text: l = "加载中…" }) => /* @__PURE__ */ o("div", { className: e.block, "data-loading": "true", role: "status", "aria-busy": "true", children: [
87
+ /* @__PURE__ */ a(m, {}),
88
+ l ? /* @__PURE__ */ a("span", { className: e.blockText, children: l }) : null
89
+ ] }), ga = ({ description: l, action: t }) => /* @__PURE__ */ a(c, { bordered: !1, children: /* @__PURE__ */ a(
90
+ p,
91
+ {
92
+ className: e.status,
93
+ image: /* @__PURE__ */ a(k, { style: { width: 120, height: 120 } }),
94
+ darkModeImage: /* @__PURE__ */ a(b, { style: { width: 120, height: 120 } }),
95
+ description: l,
96
+ children: t ? /* @__PURE__ */ a("div", { className: e.statusExtra, children: t }) : null
97
+ }
98
+ ) });
99
+ export {
100
+ ca as E,
101
+ Z as F,
102
+ da as L,
103
+ ta as P,
104
+ oa as S,
105
+ ra as T,
106
+ ga as a,
107
+ ia as b,
108
+ sa as c,
109
+ na as d,
110
+ N as e
111
+ };
@@ -0,0 +1,26 @@
1
+ const o = {
2
+ h1: 32,
3
+ h2: 28,
4
+ h3: 24,
5
+ h4: 20,
6
+ h5: 18,
7
+ h6: 16,
8
+ lead: 15,
9
+ body: 14,
10
+ compact: 13,
11
+ caption: 12,
12
+ badge: 11
13
+ }, n = [36, 40, 48, 56, 64], a = {
14
+ phone: 576,
15
+ tablet: 768,
16
+ desktop: 992,
17
+ wide: 1200,
18
+ xwide: 1440
19
+ }, s = (t) => `(min-width: ${a[t]}px)`, e = (t) => `(max-width: ${a[t]}px)`;
20
+ export {
21
+ a as B,
22
+ n as D,
23
+ o as F,
24
+ s as a,
25
+ e as b
26
+ };
@@ -4,54 +4,58 @@ import { useMemo as i } from "react";
4
4
  import { CustomerRuntimeConfigProvider as f } from "@24city/web-runtime/runtime-config-provider";
5
5
  import { A as d } from "./auth-provider-CqiyTeOt.js";
6
6
  import { b as m, A as p } from "./logout-signal-CiD_zY5M.js";
7
- import { E as C } from "./error-boundary-D3qiD7ov.js";
8
- import { C as y } from "./context-CaVim6ZO.js";
9
- import { parseCustomerRuntimeConfig as h, loadCustomerRuntimeConfig as v } from "@24city/web-runtime/core/runtime-config";
10
- const R = () => new c({
7
+ import { U as C, E as y } from "./unsupported-browser-Dwq1mNRy.js";
8
+ import { C as h } from "./context-CaVim6ZO.js";
9
+ import { parseCustomerRuntimeConfig as R, loadCustomerRuntimeConfig as v } from "@24city/web-runtime/core/runtime-config";
10
+ const w = (e = window) => {
11
+ const r = e;
12
+ return !r.CSS || typeof r.CSS.supports != "function" ? !0 : typeof r.CSSLayerBlockRule < "u";
13
+ }, g = () => new c({
11
14
  defaultOptions: {
12
15
  queries: { staleTime: 3e4, refetchOnWindowFocus: !1, retry: 1 },
13
16
  mutations: { retry: !1 }
14
17
  }
15
18
  }), F = ({ runtime: e, queryClient: r, authStore: o, children: n }) => {
16
- const a = i(() => r ?? R(), [r]), u = i(() => o ?? m(), [o]);
17
- return /* @__PURE__ */ t(C, { children: /* @__PURE__ */ t(l, { client: a, children: /* @__PURE__ */ t(f, { config: e.config, children: /* @__PURE__ */ t(y, { runtime: e, children: /* @__PURE__ */ t(p, { value: u, children: /* @__PURE__ */ t(d, { children: n }) }) }) }) }) });
18
- }, g = (e) => {
19
+ const u = i(() => r ?? g(), [r]), a = i(() => o ?? m(), [o]);
20
+ return w() ? /* @__PURE__ */ t(y, { children: /* @__PURE__ */ t(l, { client: u, children: /* @__PURE__ */ t(f, { config: e.config, children: /* @__PURE__ */ t(h, { runtime: e, children: /* @__PURE__ */ t(p, { value: a, children: /* @__PURE__ */ t(d, { children: n }) }) }) }) }) }) : /* @__PURE__ */ t(C, {});
21
+ }, S = (e) => {
19
22
  const r = e.trim();
20
23
  if (!r) throw new Error("受空间影响的 Query Key 必须包含 activeSpaceId");
21
24
  return r;
22
25
  }, s = {
23
26
  all: ["product-web"],
24
- feature: (e, r) => [...s.all, g(e), r],
27
+ feature: (e, r) => [...s.all, S(e), r],
25
28
  scope: (e, r, ...o) => [...s.feature(e, r), ...o]
26
- }, w = "/runtime-config.json", M = h, T = (e = fetch) => v({ fetcher: e, url: w }), U = (e = window) => {
29
+ }, A = "/runtime-config.json", M = R, T = (e = fetch) => v({ fetcher: e, url: A }), b = (e = window) => {
27
30
  const r = e.__24cityRuntimeConfig;
28
31
  return e.__24cityRuntimeConfig = void 0, r ? (o, n) => r.catch(() => fetch(o, n)) : fetch;
29
- }, A = 6e4;
30
- function b(e = window, r = () => e.location.reload()) {
32
+ }, E = 6e4;
33
+ function j(e = window, r = () => e.location.reload()) {
31
34
  e.addEventListener("vite:preloadError", (o) => {
32
- E(e.performance) && (o.preventDefault(), r());
35
+ _(e.performance) && (o.preventDefault(), r());
33
36
  });
34
37
  }
35
- function j(e) {
38
+ function x(e) {
36
39
  return e.then((r) => r === void 0 ? new Promise(() => {
37
40
  }) : r);
38
41
  }
39
- function E(e) {
42
+ function _(e) {
40
43
  try {
41
44
  const [r] = (e == null ? void 0 : e.getEntriesByType("navigation")) ?? [];
42
- return !r || !e ? !1 : r.type !== "reload" || e.now() >= A;
45
+ return !r || !e ? !1 : r.type !== "reload" || e.now() >= E;
43
46
  } catch {
44
47
  return !1;
45
48
  }
46
49
  }
47
50
  export {
48
51
  F as C,
49
- w as R,
52
+ A as R,
50
53
  s as a,
51
- R as c,
52
- U as e,
53
- j as k,
54
+ g as c,
55
+ b as e,
56
+ x as k,
54
57
  T as l,
55
58
  M as p,
56
- b as r
59
+ j as r,
60
+ w as s
57
61
  };
@@ -0,0 +1,87 @@
1
+ import { jsx as e, jsxs as c } from "react/jsx-runtime";
2
+ import { Card as m, Tooltip as f, Progress as u, Tag as p, Spin as b } from "@douyinfe/semi-ui";
3
+ import { IconHelpCircle as y, IconArrowUp as N, IconArrowDown as z } from "@douyinfe/semi-icons";
4
+ const q = "_card_zq4gf_6", w = "_body_zq4gf_16", $ = "_head_zq4gf_59", v = "_icon_zq4gf_69", x = "_label_zq4gf_75", O = "_tip_zq4gf_79", C = "_value_zq4gf_97", M = "_ringRow_zq4gf_113", I = "_footer_zq4gf_120", R = "_change_zq4gf_130", S = "_srOnly_zq4gf_147", k = "_grid_zq4gf_159", t = {
5
+ card: q,
6
+ body: w,
7
+ head: $,
8
+ icon: v,
9
+ label: x,
10
+ tip: O,
11
+ value: C,
12
+ ringRow: M,
13
+ footer: I,
14
+ change: R,
15
+ srOnly: S,
16
+ grid: k
17
+ }, T = (n) => {
18
+ if (typeof n != "string") return null;
19
+ const a = n.trim().match(/^(-?\d+(?:\.\d+)?)%$/);
20
+ if (!a) return null;
21
+ const r = Number.parseFloat(a[1]);
22
+ return Number.isFinite(r) ? Math.min(100, Math.max(0, r)) : null;
23
+ }, j = (n) => {
24
+ if (typeof n == "number") return String(Math.abs(n));
25
+ const a = n.trim();
26
+ return !a || a === "-" || a === "--" ? "-" : a.replace(/^[+-]/, "");
27
+ }, A = ({ comparison: n }) => {
28
+ const a = j(n.value), r = a === "-" ? "flat" : n.direction ?? "flat", s = r === "increase" ? "上升" : r === "decrease" ? "下降" : "";
29
+ return /* @__PURE__ */ c("div", { className: t.footer, children: [
30
+ /* @__PURE__ */ e("span", { children: n.label ?? "较上次" }),
31
+ /* @__PURE__ */ c("span", { className: t.change, "data-direction": r, children: [
32
+ s ? /* @__PURE__ */ e("span", { className: t.srOnly, children: s }) : null,
33
+ a,
34
+ r === "increase" ? /* @__PURE__ */ e(N, { "aria-hidden": "true" }) : null,
35
+ r === "decrease" ? /* @__PURE__ */ e(z, { "aria-hidden": "true" }) : null
36
+ ] })
37
+ ] });
38
+ }, W = ({ label: n, icon: a, value: r, tip: s, helper: i, comparison: o, tone: d = "brand", align: h = "center", className: _ }) => {
39
+ const g = T(r);
40
+ return /* @__PURE__ */ e(m, { bordered: !1, className: _ ? `${t.card} ${_}` : t.card, children: /* @__PURE__ */ c("div", { className: t.body, "data-tone": d, "data-align": h, children: [
41
+ /* @__PURE__ */ c("div", { className: t.head, children: [
42
+ a ? /* @__PURE__ */ e("span", { className: t.icon, "aria-hidden": "true", children: a }) : null,
43
+ /* @__PURE__ */ e("span", { className: t.label, children: n }),
44
+ s ? /* @__PURE__ */ e(f, { content: s, children: /* @__PURE__ */ e("span", { className: t.tip, tabIndex: 0, role: "img", "aria-label": `${n}说明:${s}`, children: /* @__PURE__ */ e(y, { "aria-hidden": "true" }) }) }) : null
45
+ ] }),
46
+ g === null ? /* @__PURE__ */ e("div", { className: t.value, children: r }) : /* @__PURE__ */ c("div", { className: t.ringRow, children: [
47
+ /* @__PURE__ */ e(
48
+ u,
49
+ {
50
+ type: "circle",
51
+ percent: g,
52
+ width: 56,
53
+ strokeWidth: 7,
54
+ showInfo: !1,
55
+ motion: !1,
56
+ stroke: "var(--metric-color)",
57
+ orbitStroke: "var(--metric-track)",
58
+ "aria-label": `${n} ${r}`
59
+ }
60
+ ),
61
+ /* @__PURE__ */ e("div", { className: t.value, "data-size": "ring", children: r })
62
+ ] }),
63
+ o ? /* @__PURE__ */ e(A, { comparison: o }) : i ? /* @__PURE__ */ e("div", { className: t.footer, children: i }) : null
64
+ ] }) });
65
+ }, E = ({ columns: n = 4, children: a, className: r }) => /* @__PURE__ */ e("div", { className: r ? `${t.grid} ${r}` : t.grid, style: { "--metric-columns": n }, children: a }), F = "_tag_brdn3_3", B = "_brand_brdn3_14", D = "_icon_brdn3_19", G = "_spin_brdn3_24", l = {
66
+ tag: F,
67
+ brand: B,
68
+ icon: D,
69
+ spin: G
70
+ }, H = {
71
+ success: "green",
72
+ warning: "orange",
73
+ danger: "red",
74
+ info: "blue",
75
+ neutral: "grey"
76
+ }, J = ({ tone: n = "neutral", loading: a = !1, icon: r, className: s, children: i }) => {
77
+ const o = [l.tag, n === "brand" ? l.brand : "", s ?? ""].filter(Boolean).join(" "), d = a ? /* @__PURE__ */ e(b, { size: "small", wrapperClassName: l.spin }) : r ? /* @__PURE__ */ e("span", { className: l.icon, "aria-hidden": "true", children: r }) : null;
78
+ return /* @__PURE__ */ c(p, { size: "large", type: "light", color: n === "brand" ? "grey" : H[n], className: o, children: [
79
+ d,
80
+ i
81
+ ] });
82
+ };
83
+ export {
84
+ W as M,
85
+ J as S,
86
+ E as a
87
+ };
@@ -0,0 +1,64 @@
1
+ import { jsx as n, jsxs as m, Fragment as w } from "react/jsx-runtime";
2
+ import { Button as d, Typography as x } from "@douyinfe/semi-ui";
3
+ import { useNavigate as b } from "react-router";
4
+ import { b as N } from "./context-CaVim6ZO.js";
5
+ import { F as u, e as p } from "./page-YBG0dEN1.js";
6
+ import { useId as v, cloneElement as z } from "react";
7
+ const R = () => {
8
+ const { config: r } = N(), o = b();
9
+ return /* @__PURE__ */ n(u, { children: /* @__PURE__ */ n(
10
+ p,
11
+ {
12
+ status: "not-found",
13
+ title: "页面不存在",
14
+ description: "请检查地址,或返回产品首页继续。",
15
+ extra: /* @__PURE__ */ n(d, { theme: "solid", type: "primary", onClick: () => o(r.routes.publicHome), children: "返回首页" })
16
+ }
17
+ ) });
18
+ }, F = "_srOnly_1mfs8_2", O = {
19
+ srOnly: F
20
+ }, H = ({ label: r, children: o }) => {
21
+ const e = v();
22
+ return /* @__PURE__ */ m(w, { children: [
23
+ /* @__PURE__ */ n("span", { id: e, className: O.srOnly, children: r }),
24
+ z(o, { "aria-labelledby": e })
25
+ ] });
26
+ }, $ = () => /* @__PURE__ */ n(u, { children: /* @__PURE__ */ n("div", { role: "alert", children: /* @__PURE__ */ n(
27
+ p,
28
+ {
29
+ status: "error",
30
+ title: "应用配置暂时无法加载",
31
+ description: "启动检查未通过。请检查运行时配置和网络连接后重新加载。",
32
+ extra: /* @__PURE__ */ n(d, { theme: "solid", type: "primary", onClick: () => window.location.reload(), children: "重新加载" })
33
+ }
34
+ ) }) }), S = "_link_1mzr6_2", T = "_danger_1mzr6_28", j = "_warning_1mzr6_33", D = "_icon_1mzr6_38", i = {
35
+ link: S,
36
+ danger: T,
37
+ warning: j,
38
+ icon: D
39
+ }, q = ({ href: r, target: o, rel: e, download: y, onClick: s, icon: l, status: c, disabled: t = !1, className: g, children: _, ...f }) => {
40
+ const k = [i.link, c === "danger" ? i.danger : c === "warning" ? i.warning : "", g ?? ""].filter(Boolean).join(" "), h = {
41
+ href: r,
42
+ target: o,
43
+ rel: o === "_blank" ? e ?? "noreferrer" : e,
44
+ download: y,
45
+ onClick: t ? void 0 : s,
46
+ onKeyDown: (a) => {
47
+ r || t || !s || (a.key === "Enter" || a.key === " ") && (a.preventDefault(), s(a));
48
+ },
49
+ role: r ? void 0 : "button",
50
+ tabIndex: r || t ? void 0 : 0,
51
+ "aria-disabled": t || void 0,
52
+ "aria-label": f["aria-label"]
53
+ };
54
+ return /* @__PURE__ */ m(x.Text, { link: h, disabled: t, className: k, children: [
55
+ l ? /* @__PURE__ */ n("span", { className: i.icon, children: l }) : null,
56
+ _
57
+ ] });
58
+ };
59
+ export {
60
+ R as N,
61
+ H as S,
62
+ q as T,
63
+ $ as a
64
+ };
@@ -0,0 +1,48 @@
1
+ var l = Object.defineProperty;
2
+ var d = (r, t, o) => t in r ? l(r, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : r[t] = o;
3
+ var a = (r, t, o) => d(r, typeof t != "symbol" ? t + "" : t, o);
4
+ import { jsx as e, jsxs as c } from "react/jsx-runtime";
5
+ import { Component as m } from "react";
6
+ import { Card as p, Button as f } from "@douyinfe/semi-ui";
7
+ import { F as n, e as h } from "./page-YBG0dEN1.js";
8
+ const i = () => /* @__PURE__ */ e("div", { role: "alert", children: /* @__PURE__ */ e(
9
+ h,
10
+ {
11
+ status: "error",
12
+ title: "页面暂时无法显示",
13
+ description: "本次页面加载没有完成。您可以重新加载;如问题持续,请联系管理员。",
14
+ extra: /* @__PURE__ */ e(f, { theme: "solid", type: "primary", onClick: () => window.location.reload(), children: "重新加载" })
15
+ }
16
+ ) }), C = ({ inLayout: r = !1 }) => r ? /* @__PURE__ */ e(p, { bordered: !1, children: /* @__PURE__ */ e(i, {}) }) : /* @__PURE__ */ e(n, { children: /* @__PURE__ */ e(i, {}) });
17
+ class E extends m {
18
+ constructor() {
19
+ super(...arguments);
20
+ a(this, "state", { failed: !1 });
21
+ }
22
+ static getDerivedStateFromError() {
23
+ return { failed: !0 };
24
+ }
25
+ componentDidCatch(o, s) {
26
+ console.error("产品用户 Web 渲染失败", o, s.componentStack);
27
+ }
28
+ render() {
29
+ return this.state.failed ? /* @__PURE__ */ e(n, { children: /* @__PURE__ */ e(i, {}) }) : this.props.children;
30
+ }
31
+ }
32
+ const g = {
33
+ maxWidth: 480,
34
+ margin: "15vh auto 0",
35
+ padding: 24,
36
+ color: "#262626",
37
+ fontFamily: "-apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif",
38
+ fontSize: 14,
39
+ lineHeight: 1.7
40
+ }, v = () => /* @__PURE__ */ c("div", { role: "alert", style: g, children: [
41
+ /* @__PURE__ */ e("h1", { style: { margin: "0 0 12px", fontSize: 20, fontWeight: 500 }, children: "当前浏览器版本过低" }),
42
+ /* @__PURE__ */ e("p", { style: { margin: 0 }, children: "页面无法正常显示。请把 Chrome、Edge、Safari 或 Firefox 升级到最新版后再打开;使用 360、QQ、搜狗等浏览器时,请升级到最新版并切换到极速模式。" })
43
+ ] });
44
+ export {
45
+ E,
46
+ C as R,
47
+ v as U
48
+ };