@24city/web-console 0.0.0-stage → 0.1.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.
- package/CHANGELOG.md +19 -0
- package/LICENSE +21 -0
- package/README.md +164 -2
- package/dist/account/account-api.d.ts +24 -0
- package/dist/account/account-center-links.d.ts +35 -0
- package/dist/account/account-center-page.d.ts +7 -0
- package/dist/account/account-center-ui.d.ts +19 -0
- package/dist/account/account-menu.d.ts +23 -0
- package/dist/account/auth-provider.d.ts +6 -0
- package/dist/account/auth-store.d.ts +25 -0
- package/dist/account/benefit-copy.d.ts +15 -0
- package/dist/account/customization.d.ts +62 -0
- package/dist/account/index.d.ts +34 -0
- package/dist/account/index.js +87 -0
- package/dist/account/login-page.d.ts +6 -0
- package/dist/account/logout-signal.d.ts +13 -0
- package/dist/account/personal-nav.d.ts +29 -0
- package/dist/account/plan-benefits.d.ts +16 -0
- package/dist/account/plan-cards.d.ts +10 -0
- package/dist/account/plan-display.d.ts +44 -0
- package/dist/account/plan-panel.d.ts +16 -0
- package/dist/account/points-section.d.ts +8 -0
- package/dist/account/profile-section.d.ts +9 -0
- package/dist/account/quota-pill.d.ts +10 -0
- package/dist/account/quota.d.ts +12 -0
- package/dist/account/route-guard.d.ts +5 -0
- package/dist/account/session-sync.d.ts +1 -0
- package/dist/account/space-label.d.ts +10 -0
- package/dist/account/subscription-section.d.ts +11 -0
- package/dist/account/team-promo.d.ts +9 -0
- package/dist/account/types.d.ts +120 -0
- package/dist/account/upgrade-entry.d.ts +6 -0
- package/dist/account/upgrade-modal.d.ts +14 -0
- package/dist/account/use-account-center.d.ts +27 -0
- package/dist/account/use-logout.d.ts +13 -0
- package/dist/account/use-membership.d.ts +48 -0
- package/dist/account/use-plan-catalog.d.ts +2 -0
- package/dist/account/use-space-switch.d.ts +8 -0
- package/dist/account/wallet-badge.d.ts +2 -0
- package/dist/assets/coin-BhUDKCPy.webp +0 -0
- package/dist/assets/crown-D5kKk5rW.webp +0 -0
- package/dist/assets/diamond-BuDSsnw-.webp +0 -0
- package/dist/assets/engine-hero-BaSSoV-3.webp +0 -0
- package/dist/assets/member-gem-DTY0gTzl.webp +0 -0
- package/dist/assets/team-BeZ_oZcL.webp +0 -0
- package/dist/assets/upgrade-crown-Ci1IFoXi.webp +0 -0
- package/dist/chunks/auth-provider-CqiyTeOt.js +62 -0
- package/dist/chunks/console-layout-CcUiJPf0.js +198 -0
- package/dist/chunks/context-CaVim6ZO.js +13 -0
- package/dist/chunks/error-boundary-BgTZsJA_.js +35 -0
- package/dist/chunks/http-B3mTs9KZ.js +8 -0
- package/dist/chunks/link-button-giJEcTmG.js +42 -0
- package/dist/chunks/logout-signal-CiD_zY5M.js +365 -0
- package/dist/chunks/page-BhfOrziX.js +89 -0
- package/dist/chunks/stale-build-D4N21gap.js +57 -0
- package/dist/chunks/text-link-7A--UEc3.js +54 -0
- package/dist/chunks/upgrade-modal-BbsM2VE2.js +667 -0
- package/dist/chunks/use-media-query-DvyinWNg.js +12 -0
- package/dist/chunks/wallet-badge-D7AFqTLx.js +565 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +159 -0
- package/dist/layout/console-layout.d.ts +35 -0
- package/dist/layout/console-nav.d.ts +30 -0
- package/dist/layout/index.d.ts +2 -0
- package/dist/layout/index.js +8 -0
- package/dist/page/error-boundary.d.ts +20 -0
- package/dist/page/index.d.ts +7 -0
- package/dist/page/index.js +21 -0
- package/dist/page/link-button.d.ts +29 -0
- package/dist/page/not-found-page.d.ts +1 -0
- package/dist/page/page.d.ts +34 -0
- package/dist/page/startup-error.d.ts +2 -0
- package/dist/page/status-result.d.ts +17 -0
- package/dist/page/text-link.d.ts +22 -0
- package/dist/runtime/context.d.ts +19 -0
- package/dist/runtime/error-summary.d.ts +5 -0
- package/dist/runtime/format.d.ts +10 -0
- package/dist/runtime/http.d.ts +11 -0
- package/dist/runtime/index.d.ts +11 -0
- package/dist/runtime/index.js +41 -0
- package/dist/runtime/internal-path.d.ts +4 -0
- package/dist/runtime/providers.d.ts +16 -0
- package/dist/runtime/query-keys.d.ts +6 -0
- package/dist/runtime/response.d.ts +6 -0
- package/dist/runtime/runtime-config.d.ts +19 -0
- package/dist/runtime/stale-build.d.ts +11 -0
- package/dist/runtime/use-media-query.d.ts +2 -0
- package/dist/semi.d.ts +10 -0
- package/dist/semi.js +12 -0
- package/dist/styles.css +3192 -0
- package/dist/testing/fixtures.d.ts +15 -0
- package/dist/testing/fixtures.js +142 -0
- package/dist/testing/guard.d.ts +32 -0
- package/dist/testing/guard.js +61 -0
- package/dist/testing/jsdom.d.ts +2 -0
- package/dist/testing/jsdom.js +116 -0
- package/dist/theme/index.d.ts +24 -0
- package/dist/theme/index.js +51 -0
- package/dist/theme/palette.d.ts +6 -0
- package/package.json +98 -3
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { jsx as e, jsxs as o } from "react/jsx-runtime";
|
|
2
|
+
import { Empty as k, Spin as y, Card as d, Button as f, Skeleton as n, Space as N, Typography as h } from "@douyinfe/semi-ui";
|
|
3
|
+
import { IllustrationSuccess as I, IllustrationSuccessDark as j, IllustrationIdle as b, IllustrationIdleDark as v, IllustrationNotFound as P, IllustrationNotFoundDark as x, IllustrationNoAccess as C, IllustrationNoAccessDark as E, IllustrationFailure as T, IllustrationFailureDark as D, IllustrationNoContentDark as H, IllustrationNoContent as S } from "@douyinfe/semi-illustrations";
|
|
4
|
+
const F = "_fullPage_ijyik_3", M = "_fullPageCard_ijyik_13", w = "_page_ijyik_18", L = "_pageHeader_ijyik_26", A = "_pageHeaderMain_ijyik_34", $ = "_pageTitle_ijyik_41", B = "_pageDescription_ijyik_49", R = "_pageExtra_ijyik_56", U = "_toolbar_ijyik_75", q = "_status_ijyik_84", z = "_statusExtra_ijyik_88", G = "_skeleton_ijyik_94", J = "_skeletonImage_ijyik_98", K = "_skeletonText_ijyik_103", O = "_loadingCard_ijyik_115", a = {
|
|
5
|
+
fullPage: F,
|
|
6
|
+
fullPageCard: M,
|
|
7
|
+
page: w,
|
|
8
|
+
pageHeader: L,
|
|
9
|
+
pageHeaderMain: A,
|
|
10
|
+
pageTitle: $,
|
|
11
|
+
pageDescription: B,
|
|
12
|
+
pageExtra: R,
|
|
13
|
+
toolbar: U,
|
|
14
|
+
status: q,
|
|
15
|
+
statusExtra: z,
|
|
16
|
+
skeleton: G,
|
|
17
|
+
skeletonImage: J,
|
|
18
|
+
skeletonText: K,
|
|
19
|
+
loadingCard: O
|
|
20
|
+
}, Q = {
|
|
21
|
+
error: [T, D],
|
|
22
|
+
forbidden: [C, E],
|
|
23
|
+
"not-found": [P, x],
|
|
24
|
+
info: [b, v],
|
|
25
|
+
success: [I, j]
|
|
26
|
+
}, m = ({ status: t, title: s, description: i, extra: r, size: l = 140, className: c, children: g }) => {
|
|
27
|
+
const [u, p] = t === "loading" ? [null, null] : Q[t], _ = { width: l, height: l };
|
|
28
|
+
return /* @__PURE__ */ e(
|
|
29
|
+
k,
|
|
30
|
+
{
|
|
31
|
+
className: c ? `${a.status} ${c}` : a.status,
|
|
32
|
+
image: u ? /* @__PURE__ */ e(u, { style: _ }) : /* @__PURE__ */ e(y, { size: "large" }),
|
|
33
|
+
darkModeImage: p ? /* @__PURE__ */ e(p, { style: _ }) : void 0,
|
|
34
|
+
title: s,
|
|
35
|
+
description: i,
|
|
36
|
+
children: r || g ? /* @__PURE__ */ o("div", { className: a.statusExtra, children: [
|
|
37
|
+
r,
|
|
38
|
+
g
|
|
39
|
+
] }) : null
|
|
40
|
+
}
|
|
41
|
+
);
|
|
42
|
+
}, Z = ({ title: t, description: s, extra: i, testId: r, children: l }) => /* @__PURE__ */ o("section", { className: a.page, "data-testid": r, children: [
|
|
43
|
+
/* @__PURE__ */ o("div", { className: a.pageHeader, children: [
|
|
44
|
+
/* @__PURE__ */ o("div", { className: a.pageHeaderMain, children: [
|
|
45
|
+
/* @__PURE__ */ e(h.Title, { heading: 1, className: a.pageTitle, children: t }),
|
|
46
|
+
s ? /* @__PURE__ */ e(h.Paragraph, { className: a.pageDescription, children: s }) : null
|
|
47
|
+
] }),
|
|
48
|
+
i ? /* @__PURE__ */ e("div", { className: a.pageExtra, children: i }) : null
|
|
49
|
+
] }),
|
|
50
|
+
l
|
|
51
|
+
] }), V = ({ children: t }) => /* @__PURE__ */ e("main", { className: a.fullPage, children: /* @__PURE__ */ e(d, { className: a.fullPageCard, bordered: !1, children: t }) }), ee = () => /* @__PURE__ */ e(V, { children: /* @__PURE__ */ e("div", { "aria-busy": "true", children: /* @__PURE__ */ e(n, { loading: !0, active: !0, placeholder: /* @__PURE__ */ e(n.Paragraph, { rows: 4 }) }) }) }), ae = ({ children: t }) => /* @__PURE__ */ e("div", { className: a.toolbar, children: t }), te = ({ message: t = "当前会话或空间不可用,请重新登录。" }) => /* @__PURE__ */ e(d, { bordered: !1, children: /* @__PURE__ */ e("div", { role: "alert", children: /* @__PURE__ */ e(m, { status: "forbidden", title: "当前会话或空间不可用", description: t }) }) }), se = ({ rows: t = 3, image: s = !1 }) => /* @__PURE__ */ e("div", { "aria-busy": "true", children: /* @__PURE__ */ e(d, { bordered: !1, className: a.loadingCard, children: /* @__PURE__ */ e(
|
|
52
|
+
n,
|
|
53
|
+
{
|
|
54
|
+
loading: !0,
|
|
55
|
+
active: !0,
|
|
56
|
+
placeholder: /* @__PURE__ */ o(N, { vertical: !0, align: "start", spacing: 12, className: a.skeleton, children: [
|
|
57
|
+
s ? /* @__PURE__ */ e(n.Image, { className: a.skeletonImage }) : null,
|
|
58
|
+
/* @__PURE__ */ e(n.Paragraph, { rows: t, className: a.skeletonText })
|
|
59
|
+
] })
|
|
60
|
+
}
|
|
61
|
+
) }) }), le = ({ title: t, message: s, retryLabel: i = "重新加载", retrying: r = !1, onRetry: l }) => /* @__PURE__ */ e(d, { bordered: !1, children: /* @__PURE__ */ e("div", { role: "alert", children: /* @__PURE__ */ e(
|
|
62
|
+
m,
|
|
63
|
+
{
|
|
64
|
+
status: "error",
|
|
65
|
+
title: t,
|
|
66
|
+
description: s,
|
|
67
|
+
extra: l ? /* @__PURE__ */ e(f, { theme: "solid", type: "primary", loading: r, onClick: l, children: i }) : void 0
|
|
68
|
+
}
|
|
69
|
+
) }) }), ie = ({ description: t, action: s }) => /* @__PURE__ */ e(d, { bordered: !1, children: /* @__PURE__ */ e(
|
|
70
|
+
k,
|
|
71
|
+
{
|
|
72
|
+
className: a.status,
|
|
73
|
+
image: /* @__PURE__ */ e(S, { style: { width: 120, height: 120 } }),
|
|
74
|
+
darkModeImage: /* @__PURE__ */ e(H, { style: { width: 120, height: 120 } }),
|
|
75
|
+
description: t,
|
|
76
|
+
children: s ? /* @__PURE__ */ e("div", { className: a.statusExtra, children: s }) : null
|
|
77
|
+
}
|
|
78
|
+
) });
|
|
79
|
+
export {
|
|
80
|
+
ie as E,
|
|
81
|
+
V as F,
|
|
82
|
+
se as L,
|
|
83
|
+
Z as P,
|
|
84
|
+
te as S,
|
|
85
|
+
ae as T,
|
|
86
|
+
le as a,
|
|
87
|
+
ee as b,
|
|
88
|
+
m as c
|
|
89
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { QueryClient as c, QueryClientProvider as l } from "@tanstack/react-query";
|
|
3
|
+
import { useMemo as i } from "react";
|
|
4
|
+
import { CustomerRuntimeConfigProvider as f } from "@24city/web-runtime/runtime-config-provider";
|
|
5
|
+
import { A as d } from "./auth-provider-CqiyTeOt.js";
|
|
6
|
+
import { b as m, A as p } from "./logout-signal-CiD_zY5M.js";
|
|
7
|
+
import { E as C } from "./error-boundary-BgTZsJA_.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({
|
|
11
|
+
defaultOptions: {
|
|
12
|
+
queries: { staleTime: 3e4, refetchOnWindowFocus: !1, retry: 1 },
|
|
13
|
+
mutations: { retry: !1 }
|
|
14
|
+
}
|
|
15
|
+
}), 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 r = e.trim();
|
|
20
|
+
if (!r) throw new Error("受空间影响的 Query Key 必须包含 activeSpaceId");
|
|
21
|
+
return r;
|
|
22
|
+
}, s = {
|
|
23
|
+
all: ["product-web"],
|
|
24
|
+
feature: (e, r) => [...s.all, g(e), r],
|
|
25
|
+
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) => {
|
|
27
|
+
const r = e.__24cityRuntimeConfig;
|
|
28
|
+
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()) {
|
|
31
|
+
e.addEventListener("vite:preloadError", (o) => {
|
|
32
|
+
E(e.performance) && (o.preventDefault(), r());
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
function j(e) {
|
|
36
|
+
return e.then((r) => r === void 0 ? new Promise(() => {
|
|
37
|
+
}) : r);
|
|
38
|
+
}
|
|
39
|
+
function E(e) {
|
|
40
|
+
try {
|
|
41
|
+
const [r] = (e == null ? void 0 : e.getEntriesByType("navigation")) ?? [];
|
|
42
|
+
return !r || !e ? !1 : r.type !== "reload" || e.now() >= A;
|
|
43
|
+
} catch {
|
|
44
|
+
return !1;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
export {
|
|
48
|
+
F as C,
|
|
49
|
+
w as R,
|
|
50
|
+
s as a,
|
|
51
|
+
R as c,
|
|
52
|
+
U as e,
|
|
53
|
+
j as k,
|
|
54
|
+
T as l,
|
|
55
|
+
M as p,
|
|
56
|
+
b as r
|
|
57
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { jsx as n, jsxs as w } from "react/jsx-runtime";
|
|
2
|
+
import { Button as m, Typography as x } from "@douyinfe/semi-ui";
|
|
3
|
+
import { useNavigate as h } from "react-router";
|
|
4
|
+
import { b as v } from "./context-CaVim6ZO.js";
|
|
5
|
+
import { F as d, c as u } from "./page-BhfOrziX.js";
|
|
6
|
+
const E = () => {
|
|
7
|
+
const { config: r } = v(), t = h();
|
|
8
|
+
return /* @__PURE__ */ n(d, { children: /* @__PURE__ */ n(
|
|
9
|
+
u,
|
|
10
|
+
{
|
|
11
|
+
status: "not-found",
|
|
12
|
+
title: "页面不存在",
|
|
13
|
+
description: "请检查地址,或返回产品首页继续。",
|
|
14
|
+
extra: /* @__PURE__ */ n(m, { theme: "solid", type: "primary", onClick: () => t(r.routes.publicHome), children: "返回首页" })
|
|
15
|
+
}
|
|
16
|
+
) });
|
|
17
|
+
}, K = () => /* @__PURE__ */ n(d, { children: /* @__PURE__ */ n("div", { role: "alert", children: /* @__PURE__ */ n(
|
|
18
|
+
u,
|
|
19
|
+
{
|
|
20
|
+
status: "error",
|
|
21
|
+
title: "应用配置暂时无法加载",
|
|
22
|
+
description: "启动检查未通过。请检查运行时配置和网络连接后重新加载。",
|
|
23
|
+
extra: /* @__PURE__ */ n(m, { theme: "solid", type: "primary", onClick: () => window.location.reload(), children: "重新加载" })
|
|
24
|
+
}
|
|
25
|
+
) }) }), N = "_link_1mzr6_2", b = "_danger_1mzr6_28", z = "_warning_1mzr6_33", T = "_icon_1mzr6_38", i = {
|
|
26
|
+
link: N,
|
|
27
|
+
danger: b,
|
|
28
|
+
warning: z,
|
|
29
|
+
icon: T
|
|
30
|
+
}, P = ({ href: r, target: t, rel: s, download: p, onClick: a, icon: l, status: c, disabled: o = !1, className: g, children: _, ...y }) => {
|
|
31
|
+
const f = [i.link, c === "danger" ? i.danger : c === "warning" ? i.warning : "", g ?? ""].filter(Boolean).join(" "), k = {
|
|
32
|
+
href: r,
|
|
33
|
+
target: t,
|
|
34
|
+
rel: t === "_blank" ? s ?? "noreferrer" : s,
|
|
35
|
+
download: p,
|
|
36
|
+
onClick: o ? void 0 : a,
|
|
37
|
+
onKeyDown: (e) => {
|
|
38
|
+
r || o || !a || (e.key === "Enter" || e.key === " ") && (e.preventDefault(), a(e));
|
|
39
|
+
},
|
|
40
|
+
role: r ? void 0 : "button",
|
|
41
|
+
tabIndex: r || o ? void 0 : 0,
|
|
42
|
+
"aria-disabled": o || void 0,
|
|
43
|
+
"aria-label": y["aria-label"]
|
|
44
|
+
};
|
|
45
|
+
return /* @__PURE__ */ w(x.Text, { link: k, disabled: o, className: f, children: [
|
|
46
|
+
l ? /* @__PURE__ */ n("span", { className: i.icon, children: l }) : null,
|
|
47
|
+
_
|
|
48
|
+
] });
|
|
49
|
+
};
|
|
50
|
+
export {
|
|
51
|
+
E as N,
|
|
52
|
+
K as S,
|
|
53
|
+
P as T
|
|
54
|
+
};
|