@24city/web-console 0.0.0-stage → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/LICENSE +21 -0
  3. package/README.md +168 -2
  4. package/dist/account/account-api.d.ts +24 -0
  5. package/dist/account/account-center-links.d.ts +35 -0
  6. package/dist/account/account-center-page.d.ts +7 -0
  7. package/dist/account/account-center-ui.d.ts +19 -0
  8. package/dist/account/account-menu.d.ts +23 -0
  9. package/dist/account/auth-provider.d.ts +6 -0
  10. package/dist/account/auth-store.d.ts +25 -0
  11. package/dist/account/benefit-copy.d.ts +15 -0
  12. package/dist/account/customization.d.ts +62 -0
  13. package/dist/account/index.d.ts +34 -0
  14. package/dist/account/index.js +87 -0
  15. package/dist/account/login-page.d.ts +6 -0
  16. package/dist/account/logout-signal.d.ts +13 -0
  17. package/dist/account/personal-nav.d.ts +29 -0
  18. package/dist/account/plan-benefits.d.ts +16 -0
  19. package/dist/account/plan-cards.d.ts +10 -0
  20. package/dist/account/plan-display.d.ts +44 -0
  21. package/dist/account/plan-panel.d.ts +16 -0
  22. package/dist/account/points-section.d.ts +8 -0
  23. package/dist/account/profile-section.d.ts +9 -0
  24. package/dist/account/quota-pill.d.ts +10 -0
  25. package/dist/account/quota.d.ts +12 -0
  26. package/dist/account/route-guard.d.ts +5 -0
  27. package/dist/account/session-sync.d.ts +1 -0
  28. package/dist/account/space-label.d.ts +10 -0
  29. package/dist/account/subscription-section.d.ts +11 -0
  30. package/dist/account/team-promo.d.ts +9 -0
  31. package/dist/account/types.d.ts +120 -0
  32. package/dist/account/upgrade-entry.d.ts +6 -0
  33. package/dist/account/upgrade-modal.d.ts +14 -0
  34. package/dist/account/use-account-center.d.ts +27 -0
  35. package/dist/account/use-logout.d.ts +13 -0
  36. package/dist/account/use-membership.d.ts +48 -0
  37. package/dist/account/use-plan-catalog.d.ts +2 -0
  38. package/dist/account/use-space-switch.d.ts +8 -0
  39. package/dist/account/wallet-badge.d.ts +2 -0
  40. package/dist/assets/coin-BhUDKCPy.webp +0 -0
  41. package/dist/assets/crown-D5kKk5rW.webp +0 -0
  42. package/dist/assets/diamond-BuDSsnw-.webp +0 -0
  43. package/dist/assets/engine-hero-BaSSoV-3.webp +0 -0
  44. package/dist/assets/member-gem-DTY0gTzl.webp +0 -0
  45. package/dist/assets/team-BeZ_oZcL.webp +0 -0
  46. package/dist/assets/upgrade-crown-Ci1IFoXi.webp +0 -0
  47. package/dist/chunks/auth-provider-CqiyTeOt.js +62 -0
  48. package/dist/chunks/console-layout-BibioK5M.js +198 -0
  49. package/dist/chunks/context-CaVim6ZO.js +13 -0
  50. package/dist/chunks/error-boundary-D3qiD7ov.js +35 -0
  51. package/dist/chunks/http-B3mTs9KZ.js +8 -0
  52. package/dist/chunks/link-button-giJEcTmG.js +42 -0
  53. package/dist/chunks/logout-signal-CiD_zY5M.js +365 -0
  54. package/dist/chunks/page-BaitnD--.js +89 -0
  55. package/dist/chunks/stale-build-DUKkQHuu.js +57 -0
  56. package/dist/chunks/text-link-FTsBp_QU.js +54 -0
  57. package/dist/chunks/upgrade-modal-DzdKuEkJ.js +667 -0
  58. package/dist/chunks/use-media-query-DvyinWNg.js +12 -0
  59. package/dist/chunks/wallet-badge-CnyMLpUO.js +565 -0
  60. package/dist/index.d.ts +6 -0
  61. package/dist/index.js +159 -0
  62. package/dist/layout/console-layout.d.ts +35 -0
  63. package/dist/layout/console-nav.d.ts +30 -0
  64. package/dist/layout/index.d.ts +2 -0
  65. package/dist/layout/index.js +8 -0
  66. package/dist/page/error-boundary.d.ts +20 -0
  67. package/dist/page/index.d.ts +7 -0
  68. package/dist/page/index.js +21 -0
  69. package/dist/page/link-button.d.ts +29 -0
  70. package/dist/page/not-found-page.d.ts +1 -0
  71. package/dist/page/page.d.ts +34 -0
  72. package/dist/page/startup-error.d.ts +2 -0
  73. package/dist/page/status-result.d.ts +17 -0
  74. package/dist/page/text-link.d.ts +22 -0
  75. package/dist/runtime/context.d.ts +19 -0
  76. package/dist/runtime/error-summary.d.ts +5 -0
  77. package/dist/runtime/format.d.ts +10 -0
  78. package/dist/runtime/http.d.ts +11 -0
  79. package/dist/runtime/index.d.ts +11 -0
  80. package/dist/runtime/index.js +41 -0
  81. package/dist/runtime/internal-path.d.ts +4 -0
  82. package/dist/runtime/providers.d.ts +16 -0
  83. package/dist/runtime/query-keys.d.ts +6 -0
  84. package/dist/runtime/response.d.ts +6 -0
  85. package/dist/runtime/runtime-config.d.ts +19 -0
  86. package/dist/runtime/stale-build.d.ts +11 -0
  87. package/dist/runtime/use-media-query.d.ts +2 -0
  88. package/dist/semi.d.ts +10 -0
  89. package/dist/semi.js +12 -0
  90. package/dist/styles.css +3224 -0
  91. package/dist/testing/fixtures.d.ts +15 -0
  92. package/dist/testing/fixtures.js +142 -0
  93. package/dist/testing/guard.d.ts +32 -0
  94. package/dist/testing/guard.js +61 -0
  95. package/dist/testing/jsdom.d.ts +2 -0
  96. package/dist/testing/jsdom.js +116 -0
  97. package/dist/theme/index.d.ts +24 -0
  98. package/dist/theme/index.js +51 -0
  99. package/dist/theme/palette.d.ts +6 -0
  100. package/package.json +98 -3
@@ -0,0 +1,89 @@
1
+ import { jsx as e, jsxs as n } from "react/jsx-runtime";
2
+ import { Empty as m, Spin as f, Card as d, Button as N, Skeleton as i, Space as I, Typography as h } from "@douyinfe/semi-ui";
3
+ import { IllustrationSuccess as b, IllustrationSuccessDark as v, IllustrationIdle as P, IllustrationIdleDark as x, IllustrationNotFound as C, IllustrationNotFoundDark as E, IllustrationNoAccess as T, IllustrationNoAccessDark as y, IllustrationFailure as D, IllustrationFailureDark as H, IllustrationNoContentDark as S, IllustrationNoContent as F } from "@douyinfe/semi-illustrations";
4
+ const M = "_fullPage_8980g_3", w = "_fullPageCard_8980g_13", L = "_page_8980g_18", A = "_pageHeader_8980g_26", j = "_pageHeaderMain_8980g_34", $ = "_pageTitle_8980g_42", B = "_pageDescription_8980g_51", R = "_pageExtra_8980g_58", U = "_toolbar_8980g_77", q = "_status_8980g_86", z = "_statusExtra_8980g_90", G = "_skeleton_8980g_96", J = "_skeletonImage_8980g_100", K = "_skeletonText_8980g_105", O = "_loadingCard_8980g_117", a = {
5
+ fullPage: M,
6
+ fullPageCard: w,
7
+ page: L,
8
+ pageHeader: A,
9
+ pageHeaderMain: j,
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: [D, H],
22
+ forbidden: [T, y],
23
+ "not-found": [C, E],
24
+ info: [P, x],
25
+ success: [b, v]
26
+ }, k = ({ status: t, title: s, description: r, extra: o, 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
+ m,
30
+ {
31
+ className: c ? `${a.status} ${c}` : a.status,
32
+ image: u ? /* @__PURE__ */ e(u, { style: _ }) : /* @__PURE__ */ e(f, { size: "large" }),
33
+ darkModeImage: p ? /* @__PURE__ */ e(p, { style: _ }) : void 0,
34
+ title: s,
35
+ description: r,
36
+ children: o || g ? /* @__PURE__ */ n("div", { className: a.statusExtra, children: [
37
+ o,
38
+ g
39
+ ] }) : null
40
+ }
41
+ );
42
+ }, Z = ({ title: t, description: s, extra: r, testId: o, children: l }) => /* @__PURE__ */ n("section", { className: a.page, "data-testid": o, children: [
43
+ /* @__PURE__ */ n("div", { className: a.pageHeader, children: [
44
+ /* @__PURE__ */ n("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
+ r ? /* @__PURE__ */ e("div", { className: a.pageExtra, children: r }) : 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(i, { loading: !0, active: !0, placeholder: /* @__PURE__ */ e(i.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(k, { 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
+ i,
53
+ {
54
+ loading: !0,
55
+ active: !0,
56
+ placeholder: /* @__PURE__ */ n(I, { vertical: !0, align: "start", spacing: 12, className: a.skeleton, children: [
57
+ s ? /* @__PURE__ */ e(i.Image, { className: a.skeletonImage }) : null,
58
+ /* @__PURE__ */ e(i.Paragraph, { rows: t, className: a.skeletonText })
59
+ ] })
60
+ }
61
+ ) }) }), le = ({ title: t, message: s, retryLabel: r = "重新加载", retrying: o = !1, onRetry: l }) => /* @__PURE__ */ e(d, { bordered: !1, children: /* @__PURE__ */ e("div", { role: "alert", children: /* @__PURE__ */ e(
62
+ k,
63
+ {
64
+ status: "error",
65
+ title: t,
66
+ description: s,
67
+ extra: l ? /* @__PURE__ */ e(N, { theme: "solid", type: "primary", loading: o, onClick: l, children: r }) : void 0
68
+ }
69
+ ) }) }), re = ({ description: t, action: s }) => /* @__PURE__ */ e(d, { bordered: !1, children: /* @__PURE__ */ e(
70
+ m,
71
+ {
72
+ className: a.status,
73
+ image: /* @__PURE__ */ e(F, { style: { width: 120, height: 120 } }),
74
+ darkModeImage: /* @__PURE__ */ e(S, { 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
+ re 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
+ k 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-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({
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-BaitnD--.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
+ };