@24city/web-console 0.1.3 → 0.2.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.
- package/CHANGELOG.md +58 -0
- package/GUIDELINES.md +223 -0
- package/README.md +42 -10
- package/dist/account/index.js +2 -2
- package/dist/chunks/console-layout-BWz1qRog.js +210 -0
- package/dist/chunks/page-YBG0dEN1.js +111 -0
- package/dist/chunks/scale-smFifpMm.js +26 -0
- package/dist/chunks/{stale-build-DUKkQHuu.js → stale-build-DG-Tb2RA.js} +24 -20
- package/dist/chunks/status-tag-BrLUhH6Z.js +87 -0
- package/dist/chunks/text-link-BAKoHe5o.js +64 -0
- package/dist/chunks/unsupported-browser-Dwq1mNRy.js +48 -0
- package/dist/chunks/upgrade-modal-DgChxbLm.js +667 -0
- package/dist/chunks/{wallet-badge-BXu-WxJa.js → wallet-badge-dVrO6py9.js} +136 -136
- package/dist/chunks/waterfall-CQG8aVdx.js +613 -0
- package/dist/data/index.d.ts +2 -0
- package/dist/data/index.js +6 -0
- package/dist/data/metric-card.d.ts +41 -0
- package/dist/data/status-tag.d.ts +18 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +160 -120
- package/dist/layout/index.js +1 -1
- package/dist/list/choice-cards.d.ts +29 -0
- package/dist/list/content-square.d.ts +50 -0
- package/dist/list/filter-dropdown.d.ts +43 -0
- package/dist/list/filter-panel.d.ts +94 -0
- package/dist/list/index.d.ts +7 -0
- package/dist/list/index.js +27 -0
- package/dist/list/list-toolbar.d.ts +56 -0
- package/dist/list/waterfall-layout.d.ts +11 -0
- package/dist/list/waterfall.d.ts +13 -0
- package/dist/page/index.d.ts +2 -0
- package/dist/page/index.js +19 -15
- package/dist/page/page.d.ts +21 -2
- package/dist/page/select-label.d.ts +11 -0
- package/dist/page/unsupported-browser.d.ts +2 -0
- package/dist/runtime/browser-support.d.ts +6 -0
- package/dist/runtime/index.d.ts +1 -0
- package/dist/runtime/index.js +38 -37
- package/dist/runtime/providers.d.ts +1 -1
- package/dist/styles.css +1973 -575
- package/dist/testing/guard.d.ts +20 -0
- package/dist/testing/guard.js +83 -36
- package/dist/theme/index.d.ts +1 -0
- package/dist/theme/index.js +29 -25
- package/dist/theme/scale.d.ts +34 -0
- package/package.json +13 -2
- package/dist/chunks/console-layout-D5YgsZYN.js +0 -208
- package/dist/chunks/error-boundary-D3qiD7ov.js +0 -35
- package/dist/chunks/page-BaitnD--.js +0 -89
- package/dist/chunks/text-link-FTsBp_QU.js +0 -54
- package/dist/chunks/upgrade-modal-J0X79nT2.js +0 -667
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** 每一项放进当前最矮的一列;高度相同时放左边,保证从左到右、从上到下的阅读顺序。 */
|
|
2
|
+
export declare const distributeToColumns: (heights: readonly number[], columns: number) => number[][];
|
|
3
|
+
export interface WaterfallLayout {
|
|
4
|
+
columns: number;
|
|
5
|
+
columnWidth: number;
|
|
6
|
+
gap: number;
|
|
7
|
+
}
|
|
8
|
+
/** 最多 5 列:再多卡片就太小,宽屏时加宽卡片而不是加列。 */
|
|
9
|
+
export declare const MAX_WATERFALL_COLUMNS = 5;
|
|
10
|
+
/** 列数随容器宽度变化:列宽不小于 minColumnWidth,两到五列;容器不超过手机断点时间距收到 10px。 */
|
|
11
|
+
export declare const waterfallLayout: (width: number, minColumnWidth: number) => WaterfallLayout;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
interface WaterfallProps<T> {
|
|
3
|
+
items: readonly T[];
|
|
4
|
+
getKey: (item: T) => string;
|
|
5
|
+
/** 按列宽估算每项高度,用来决定放进哪一列;不必精确。 */
|
|
6
|
+
estimateHeight: (item: T, columnWidth: number) => number;
|
|
7
|
+
renderItem: (item: T) => ReactNode;
|
|
8
|
+
minColumnWidth?: number;
|
|
9
|
+
ariaLabel?: string;
|
|
10
|
+
}
|
|
11
|
+
/** 瀑布流:按估算高度把卡片分到各列,列内纵向排列,卡片高度可以各不相同。 */
|
|
12
|
+
export declare const Waterfall: <T>({ items, getKey, estimateHeight, renderItem, minColumnWidth, ariaLabel, }: WaterfallProps<T>) => import("react").JSX.Element;
|
|
13
|
+
export {};
|
package/dist/page/index.d.ts
CHANGED
|
@@ -2,6 +2,8 @@ export * from './error-boundary';
|
|
|
2
2
|
export * from './link-button';
|
|
3
3
|
export * from './not-found-page';
|
|
4
4
|
export * from './page';
|
|
5
|
+
export * from './select-label';
|
|
5
6
|
export * from './startup-error';
|
|
6
7
|
export * from './status-result';
|
|
7
8
|
export * from './text-link';
|
|
9
|
+
export * from './unsupported-browser';
|
package/dist/page/index.js
CHANGED
|
@@ -1,21 +1,25 @@
|
|
|
1
|
-
import { E as o, R as s } from "../chunks/
|
|
2
|
-
import { L as
|
|
3
|
-
import { N as n, S as
|
|
4
|
-
import { E, a as P, F as
|
|
1
|
+
import { E as o, R as s, U as e } from "../chunks/unsupported-browser-Dwq1mNRy.js";
|
|
2
|
+
import { L as l } from "../chunks/link-button-giJEcTmG.js";
|
|
3
|
+
import { N as n, S as u, a as p, T as g } from "../chunks/text-link-BAKoHe5o.js";
|
|
4
|
+
import { E as L, a as i, b as P, F as m, c as S, L as c, d as x, P as B, S as b, e as f, T as k } from "../chunks/page-YBG0dEN1.js";
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
L as EmptyBlock,
|
|
7
|
+
i as EmptyCard,
|
|
7
8
|
o as ErrorBoundary,
|
|
8
9
|
P as ErrorCard,
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
m as FullPage,
|
|
11
|
+
S as FullPageLoading,
|
|
12
|
+
l as LinkButton,
|
|
13
|
+
c as LoadingBlock,
|
|
14
|
+
x as LoadingCard,
|
|
13
15
|
n as NotFoundPage,
|
|
14
|
-
|
|
16
|
+
B as ProductPage,
|
|
15
17
|
s as RouteErrorPage,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
u as SelectLabel,
|
|
19
|
+
b as SessionUnavailable,
|
|
20
|
+
p as StartupError,
|
|
21
|
+
f as StatusResult,
|
|
22
|
+
g as TextLink,
|
|
23
|
+
k as Toolbar,
|
|
24
|
+
e as UnsupportedBrowser
|
|
21
25
|
};
|
package/dist/page/page.d.ts
CHANGED
|
@@ -1,12 +1,22 @@
|
|
|
1
1
|
import type { PropsWithChildren, ReactNode } from 'react';
|
|
2
|
+
/** 页面内容的宽度档位:full 占满内容区(列表、看板),medium 1152px(详情),narrow 768px(表单、设置)。 */
|
|
3
|
+
export type ProductPageWidth = 'full' | 'medium' | 'narrow';
|
|
2
4
|
interface ProductPageProps {
|
|
3
5
|
title: ReactNode;
|
|
4
6
|
description?: ReactNode;
|
|
5
7
|
extra?: ReactNode;
|
|
8
|
+
/** 标题上方的返回入口,用于从列表进来的详情页,通常是一个 TextLink(“返回任务列表”);一级页面不放 */
|
|
9
|
+
back?: ReactNode;
|
|
10
|
+
/** 紧跟在标题后面的内容,通常是一个状态标签 */
|
|
11
|
+
titleAfter?: ReactNode;
|
|
12
|
+
width?: ProductPageWidth;
|
|
6
13
|
testId?: string;
|
|
7
14
|
}
|
|
8
|
-
/**
|
|
9
|
-
|
|
15
|
+
/**
|
|
16
|
+
* 登录后页面的统一骨架:页头(标题、说明、操作)直接落在灰底上,下面纵向排列内容卡片。多个操作按钮由调用方用 Space 包起来。
|
|
17
|
+
* 页面只有一块主内容时放一张卡片,有几块并列内容时放几张卡片;卡片里不再套卡片。
|
|
18
|
+
*/
|
|
19
|
+
export declare const ProductPage: ({ title, description, extra, back, titleAfter, width, testId, children }: PropsWithChildren<ProductPageProps>) => import("react").JSX.Element;
|
|
10
20
|
/** 公开页、登录与异常页使用的整屏居中容器。 */
|
|
11
21
|
export declare const FullPage: ({ children }: PropsWithChildren) => import("react").JSX.Element;
|
|
12
22
|
export declare const FullPageLoading: () => import("react").JSX.Element;
|
|
@@ -27,6 +37,15 @@ interface ErrorCardProps {
|
|
|
27
37
|
onRetry?: () => void;
|
|
28
38
|
}
|
|
29
39
|
export declare const ErrorCard: ({ title, message, retryLabel, retrying, onRetry }: ErrorCardProps) => import("react").JSX.Element;
|
|
40
|
+
/** 卡片、表格、面板里面的空状态:不带卡片外框,插画比 EmptyCard 小一号。整页或整张卡片为空时用 EmptyCard。 */
|
|
41
|
+
export declare const EmptyBlock: ({ description, action }: {
|
|
42
|
+
description?: ReactNode;
|
|
43
|
+
action?: ReactNode;
|
|
44
|
+
}) => import("react").JSX.Element;
|
|
45
|
+
/** 卡片、表格、面板里面的加载状态:转圈加一句话。首屏内容的占位用 LoadingCard(骨架)。 */
|
|
46
|
+
export declare const LoadingBlock: ({ text }: {
|
|
47
|
+
text?: ReactNode;
|
|
48
|
+
}) => import("react").JSX.Element;
|
|
30
49
|
export declare const EmptyCard: ({ description, action }: {
|
|
31
50
|
description: ReactNode;
|
|
32
51
|
action?: ReactNode;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type ReactElement } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* 给 Semi 的 Select 一个读屏名称:Semi 的 Select 不接受 aria-label(自己写死成 "selected"),只认 aria-labelledby。
|
|
4
|
+
* 这里放一个视觉上隐藏的标签并把 id 接给 Select。
|
|
5
|
+
*/
|
|
6
|
+
export declare const SelectLabel: ({ label, children }: {
|
|
7
|
+
label: string;
|
|
8
|
+
children: ReactElement<{
|
|
9
|
+
"aria-labelledby"?: string;
|
|
10
|
+
}>;
|
|
11
|
+
}) => import("react").JSX.Element;
|
package/dist/runtime/index.d.ts
CHANGED
package/dist/runtime/index.js
CHANGED
|
@@ -1,41 +1,42 @@
|
|
|
1
|
-
import { C as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { C as s, R as r, c as o, e as t, k as i, l as n, p as u, a as m, r as p, s as C } from "../chunks/stale-build-DG-Tb2RA.js";
|
|
2
|
+
import { C as l, u as R, a as d, b as c } from "../chunks/context-CaVim6ZO.js";
|
|
3
|
+
import { h, j as x, k as y, m as P, o as z, p as N, q as S, s as k, t as q, v as B, x as D, y as E, z as I, B as v, C as L, D as O, E as Q } from "../chunks/logout-signal-CiD_zY5M.js";
|
|
4
|
+
import { c as A } from "../chunks/http-B3mTs9KZ.js";
|
|
5
5
|
import { u as H } from "../chunks/use-media-query-DvyinWNg.js";
|
|
6
|
-
import { summarizeCustomerError as
|
|
6
|
+
import { summarizeCustomerError as T } from "@24city/web-runtime/error-summary";
|
|
7
7
|
export {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
8
|
+
s as ConsoleApp,
|
|
9
|
+
l as ConsoleRuntimeProvider,
|
|
10
|
+
r as RUNTIME_CONFIG_URL,
|
|
11
|
+
o as createConsoleQueryClient,
|
|
12
|
+
A as createHttpRuntime,
|
|
13
|
+
t as earlyRuntimeConfigFetcher,
|
|
14
|
+
h as formatChargePoints,
|
|
15
|
+
x as formatClock,
|
|
16
|
+
y as formatDate,
|
|
17
|
+
P as formatDateTime,
|
|
18
|
+
z as formatDuration,
|
|
19
|
+
N as formatNumber,
|
|
20
|
+
S as formatPoints,
|
|
21
|
+
k as formatPrice,
|
|
22
|
+
q as hasHttpStatus,
|
|
23
|
+
B as isPathWithin,
|
|
24
|
+
D as isSafeInternalPath,
|
|
25
|
+
i as keepLoadingOnStaleBuild,
|
|
26
|
+
n as loadRuntimeConfig,
|
|
27
|
+
u as parseRuntimeConfig,
|
|
28
|
+
m as productQueryKeys,
|
|
29
|
+
p as reloadOnStaleBuild,
|
|
30
|
+
E as requireNonNegativeInteger,
|
|
31
|
+
I as requireRecord,
|
|
32
|
+
v as requireString,
|
|
33
|
+
L as sanitizeReturnPath,
|
|
34
|
+
T as summarizeCustomerError,
|
|
35
|
+
O as summarizeError,
|
|
36
|
+
C as supportsCascadeLayers,
|
|
37
|
+
Q as unwrapApiResponse,
|
|
38
|
+
R as useConsoleBrand,
|
|
39
|
+
d as useConsoleCustomization,
|
|
40
|
+
c as useConsoleRuntime,
|
|
40
41
|
H as useMediaQuery
|
|
41
42
|
};
|
|
@@ -11,6 +11,6 @@ export interface ConsoleAppProps {
|
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
13
13
|
* 产品用户 Web 的 Provider 组装:错误边界、TanStack Query、运行时配置、控制台运行时、身份状态与会话恢复。
|
|
14
|
-
* children 通常是 `<RouterProvider router={…}
|
|
14
|
+
* children 通常是 `<RouterProvider router={…} />`。浏览器过旧(不支持 CSS 级联层)时只显示升级提示。
|
|
15
15
|
*/
|
|
16
16
|
export declare const ConsoleApp: ({ runtime, queryClient, authStore, children }: PropsWithChildren<ConsoleAppProps>) => import("react").JSX.Element;
|