@24city/web-console 0.3.3 → 0.3.5
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 +29 -0
- package/GUIDELINES.md +18 -5
- package/dist/chunks/text-link-Bb5f1eLW.js +106 -0
- package/dist/index.js +119 -115
- package/dist/page/feature.d.ts +65 -0
- package/dist/page/index.d.ts +1 -0
- package/dist/page/index.js +25 -21
- package/dist/styles.css +195 -7
- package/dist/testing/guard.d.ts +4 -3
- package/dist/testing/guard.js +50 -43
- package/package.json +1 -1
- package/dist/chunks/text-link-Ch_4QIkx.js +0 -65
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,34 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.3.5
|
|
4
|
+
|
|
5
|
+
**新增:重点功能的一套视觉**(来自 AdFlow 的一键跟创弹框,`@24city/web-console/page`)
|
|
6
|
+
|
|
7
|
+
- `FeatureHero`:浅色多色渐变头部,依次是工具行(左侧 `toolbar`、右侧关闭按钮)、斜体标题、说明、`subject`(这次功能作用的对象);
|
|
8
|
+
`children` 是压在渐变上的白色内容区(顶部圆角,向上盖住渐变 32px)。
|
|
9
|
+
- `FeatureTitle`:斜体标题,600 字重、字距 1px;三档字号 large 24 / medium 20 / small 18,`level` 只管语义。
|
|
10
|
+
- `FeatureIndex`:分块标题前的斜体编号(01、02…),默认主色,读屏跳过。
|
|
11
|
+
- `featureModalProps`:展开给 Semi `Modal` 的外壳:去掉标题栏、脚部和关闭按钮,内容区不留内边距、圆角 18px,渐变铺满。
|
|
12
|
+
- 主题变量:`--app-font-family-display`(斜体标题的字体,目前等于正文字体,由浏览器斜切;以后换成真正的斜体标题字只改它)、
|
|
13
|
+
`--app-feature-gradient`(头部渐变:品牌色最浅一级 → 粉 → 靛)、`--app-feature-aside-gradient`(宽版左栏的竖向渐变,淡出到弹框底色)。
|
|
14
|
+
渐变从品牌色起,跟着产品主色变;AdFlow 的主色生成的第 1 级与它原来用的 Semi 橙色第 0 级几乎相同。
|
|
15
|
+
暗色模式下 Semi 色板的粉、靛、紫饱和度很高,渐变里这三色降到 35%,透出底下的弹框底色。
|
|
16
|
+
- 守卫:`checkDesignScale` 新增 `font-style` 规则,产品样式里的 `font-style: italic` / `oblique` 逐处报告(带行号)。
|
|
17
|
+
按 `rule` 分别断言的存量产品不受影响;断言整体为空的产品如果写了斜体会报出来,改用 `FeatureTitle` / `FeatureIndex`。
|
|
18
|
+
- 规范与总览页:`GUIDELINES.md` 第 1、4、8、9、14 节;总览页新增「重点功能弹框」展品和两条渐变变量。
|
|
19
|
+
|
|
20
|
+
**外观调整**
|
|
21
|
+
|
|
22
|
+
- 圆角更圆润:卡片、弹窗、表格容器 8 → 12px(`--app-radius-card`、`--semi-border-radius-large`),输入框、按钮、下拉项 6 → 8px
|
|
23
|
+
(`--semi-border-radius-small`),标签、小按钮 4 → 6px(`--app-radius-chip`)。
|
|
24
|
+
- 次要操作的图标淡一档:`light` / `borderless` 的 `tertiary` 按钮里的图标用 `--semi-color-text-2`,悬停、聚焦和选中
|
|
25
|
+
(`aria-current`、`aria-pressed`、`aria-selected`)时恢复按钮自己的颜色;主按钮、危险按钮、禁用按钮不变。输入框的前后缀图标也用 `--semi-color-text-2`。
|
|
26
|
+
|
|
27
|
+
## 0.3.4
|
|
28
|
+
|
|
29
|
+
- 提示条(`Toast`)外面不再多出一圈方框:主题的弹层投影原先加在外层 `.semi-toast` 上,那一层是透明的、四周还有间距,
|
|
30
|
+
投影在卡片外框出一块方形阴影;Semi 的卡片是里面的 `.semi-toast-content`,投影改加在它上面。通知(`Notification`)不变。
|
|
31
|
+
|
|
3
32
|
## 0.3.3
|
|
4
33
|
|
|
5
34
|
来自 AdFlow 的 Arco → Semi 迁移审计:下面这些要么是本包组件的缺陷,要么是 Semi 默认值与规范不一致、每个产品都会遇到的地方,统一在这里修。
|
package/GUIDELINES.md
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
## 1. 一段话说清风格
|
|
13
13
|
|
|
14
14
|
灰底白卡的现代 SaaS 工作台:页面底是很浅的中性灰,内容放在无边框、带一圈柔和投影的白色卡片里;一个品牌主色,只用在主按钮、
|
|
15
|
-
|
|
15
|
+
选中态和需要强调的数字上;状态用固定的绿、橙、红、蓝;圆角采用偏圆润的阶梯(卡片 12px、控件 8px、标签 6px);标题用 500 字重而不是粗黑体(只有重点功能弹框用斜体标题,见第 9 节);
|
|
16
16
|
动效只做反馈,不做表演。信息密度中等,结果优先,筛选和工具保持轻量。
|
|
17
17
|
|
|
18
18
|
给 AI 写页面时的提示词:
|
|
@@ -98,15 +98,17 @@
|
|
|
98
98
|
- 展示尺寸 36、40、48、56、64 只用于大数字和大图标,直接写数值。其他数值(17、22、30……)不要出现。
|
|
99
99
|
- 字重:正文 400;标题、选中项、强调数值 500;外壳导航的选中项和账号区的名称 600;价格和指标卡的大数字 700。
|
|
100
100
|
Semi 的 `Typography.Title`、`Text strong`、卡片与弹窗标题、分段选择的选中项已由主题统一成 500,链接是 400(靠颜色区分);
|
|
101
|
-
个别标题要更重时传 `weight`,不要在产品样式里把 Semi 的标题整体改回 600。
|
|
101
|
+
个别标题要更重时传 `weight`,不要在产品样式里把 Semi 的标题整体改回 600。重点功能的斜体标题(`FeatureTitle`)是 600。
|
|
102
102
|
- 数字:表格、指标、价格用等宽数字(`font-variant-numeric: tabular-nums`);指标卡和看板里的大数字用 `--app-font-family-number`。
|
|
103
|
+
- 斜体:只用于重点功能的标题和编号,由 `FeatureTitle`、`FeatureIndex` 提供,字体是 `--app-font-family-display`(目前就是正文字体,
|
|
104
|
+
中文字体没有斜体,浏览器斜切约 14° 显示;以后换成真正的斜体标题字只改这个变量)。产品样式里不写 `font-style: italic`,守卫会报。
|
|
103
105
|
- 一页里字号不超过四档;靠字号和颜色的层级区分主次,不靠加粗一切。
|
|
104
106
|
|
|
105
107
|
## 5. 间距、圆角、阴影、层级、动效
|
|
106
108
|
|
|
107
109
|
- **间距**按 4px 一格:4、8、12、16、20、24、32、40、48、56(`--app-space-1..14`,或直接写这些数值)。2px 只用于图标和文字之间的微调。
|
|
108
110
|
三个页面节奏变量所有页面相同:`--app-page-gutter` 24(内容区到视口边)、`--app-section-gap` 16(上下两块之间)、`--app-card-padding` 20(卡片内边距)。
|
|
109
|
-
- **圆角**:卡片、弹窗、表格容器
|
|
111
|
+
- **圆角**:卡片、弹窗、表格容器 12(`--app-radius-card`);输入框、按钮、下拉项 8;标签、小按钮 6(`--app-radius-chip`);
|
|
110
112
|
胶囊(999px)只用于头像、筛选胶囊和积分这类徽章。一张卡片里不混用三种以上圆角。
|
|
111
113
|
- **阴影**只有四种:`--app-shadow-card`(卡片)、`--app-shadow-card-hover`(可点的卡片悬停)、`--app-shadow-popup`(下拉、弹窗、气泡)、
|
|
112
114
|
`--app-shadow-raised`(灰底上的白色小控件)。不自己写 `box-shadow`,不用彩色阴影建立层级(主按钮自带的一点主色投影除外)。
|
|
@@ -153,6 +155,7 @@
|
|
|
153
155
|
| 详情与数据看板 | `ProductPage`(`back`、`titleAfter`)→ `MetricGrid` + `MetricCard` → 若干内容 `Card` |
|
|
154
156
|
| 多步骤工作台(制作流程) | `ProductPage`(`back`、`titleAfter`)→ `StepTabs`(步骤与每步状态)→ `SummaryBar`(这一步的总体进度与主操作)→ `WorkCanvas`(白底工作区:`toolbar` 放 `SubTabs` 和小号 `FilterCapsules`,`aside` 放参数,主区用 `WorkSection` 分节);旁边自成一体的内容用 `WorkPanel`,还没开始或没有结果用 `WorkPlaceholder` |
|
|
155
157
|
| 表单与设置 | `ProductPage width="narrow"` → 一张 `Card`:`FormSection`(按含义分节)→ `Field`(标签、说明、出错信息)→ `FormActions`(一个主按钮,靠左)。用 Semi `Form` 管状态时写 `labelPosition="top"`,外观相同 |
|
|
158
|
+
| 重点功能弹框 | Semi `Modal` 展开 `featureModalProps` → `FeatureHero`(渐变头部:`toolbar`、关闭、斜体标题、说明、`subject`;`children` 是压在渐变上的白色内容区)。左右两栏的宽版:左栏背景 `--app-feature-aside-gradient`,标题 `FeatureTitle size="medium"`,分块编号 `FeatureIndex`。用法见第 9 节「重点功能」 |
|
|
156
159
|
| 个人中心 | 用本包的 `AccountCenterPage`;产品只能追加分区(`customization.accountSections`) |
|
|
157
160
|
| 账号菜单里的产品额度 | `customization.AccountAllowance` 里放一个或几个 `AllowanceMeter`(每天的免费时长、每月的免费次数这类按周期发放的额度);数量上限(已有几个产品)仍用列表页的 `QuotaPill`,不放进账号菜单 |
|
|
158
161
|
| 结果与异常 | 整页用 `NotFoundPage`、`StartupError`、`RouteErrorPage`;页面内用 `ErrorCard`、`EmptyCard`、`SessionUnavailable` |
|
|
@@ -226,6 +229,15 @@ Semi 把 `className` 挂在哪个元素上因组件而异,写样式前先对
|
|
|
226
229
|
| `Input`、`TextArea` | 包装层(`.semi-input-wrapper`、`.semi-input-textarea-wrapper`) | 要作用到 `textarea` 本身用 `textareaStyle` |
|
|
227
230
|
| `Button`、`Card`、`Tabs`、`Upload`、`Image`、`Avatar`、`Empty` | 根元素自己 | 直接写在自己的类上 |
|
|
228
231
|
|
|
232
|
+
**重点功能**(`FeatureHero`、`FeatureTitle`、`FeatureIndex`、`featureModalProps`):产品里最想让用户用的一两个功能(一键跟创这类)
|
|
233
|
+
用更突出的弹框,其余弹框照常用 Semi `Modal` 自己的标题栏。重点要少才显得重,不要用在普通卡片、列表和表单页上。
|
|
234
|
+
|
|
235
|
+
- 弹框写法:`<Modal {...featureModalProps} visible width={600} onCancel={close}>`,里面放 `FeatureHero`,关闭按钮由它画在渐变里(`onClose`)。
|
|
236
|
+
- 头部是浅色多色渐变(`--app-feature-gradient`,从品牌色最浅一级起,跟着产品主色变),斜体标题 24px,下面一句说明;
|
|
237
|
+
这次功能作用的对象(来源素材这类)放 `subject`,仍在渐变里;主体内容是 `children`,在压上来的白色内容区里。
|
|
238
|
+
- 一个弹框或卡片只放一个斜体标题。卡片标题行里用 `size="small"`(18px),宽版弹框的左栏用 `size="medium"`(20px);
|
|
239
|
+
卡片要同一套底色时用 `--app-feature-gradient` 做背景。分块标题前的编号用 `FeatureIndex`,要渐变色时用 `className` 改颜色。
|
|
240
|
+
|
|
229
241
|
**表单**(`/form`):标签在上;整齐、直接、能快速扫完。
|
|
230
242
|
|
|
231
243
|
- 字段用 `Field` 包住控件(自己管状态的受控控件),或者用 Semi `Form` 的字段;两种写出来是同一个样子,不再手写“标签 + 控件”的布局。
|
|
@@ -254,7 +266,8 @@ Semi 把 `className` 挂在哪个元素上因组件而异,写样式前先对
|
|
|
254
266
|
## 10. 图标、图片与插画
|
|
255
267
|
|
|
256
268
|
- 图标只用 Semi 图标,默认实心风格;同一组入口不要实心和线性混用。图标跟随文字字号,单独定尺寸时取 12、14、16、18、20、24。
|
|
257
|
-
-
|
|
269
|
+
- 普通功能图标比邻近文字淡一档(通常用 `--semi-color-text-2`),辅助、元信息图标继续用 `--semi-color-text-2` 或 `--semi-color-text-3`;主按钮、状态和选中态图标继承控件自己的白色、状态色或品牌色。不要用透明度代替语义色。
|
|
270
|
+
- 状态图标用对应的状态色,功能图标使用对应的语义文字色,交互态再继承控件颜色,选中态转主色。
|
|
258
271
|
- 表示“处理中”的图标写 `<IconSpin spin />`:Semi 的图标默认不转(Arco 的 `IconLoading` 默认会转,迁移时容易漏),守卫会指出不带 `spin` 的写法。
|
|
259
272
|
- 空状态和结果页用 Semi 插画(`StatusResult` 已封装);产品自己的装饰插画保持同一套风格,只做装饰(`alt=""`、不接收指针)。
|
|
260
273
|
- 位图按最大显示尺寸的 2 倍导出再入库,不把生成的原图直接放进 `src/assets/`。产品图标用一张 SVG(`brand.markUrl`),favicon 用同一张。
|
|
@@ -282,7 +295,7 @@ Semi 把 `className` 挂在哪个元素上因组件而异,写样式前先对
|
|
|
282
295
|
## 14. 怎么检查
|
|
283
296
|
|
|
284
297
|
- **守卫测试**(`@24city/web-console/testing/guard`,每个产品一个测试文件):`checkUiLibraryUsage`(组件来源、色值、主题变量、不转的 `IconSpin`)、
|
|
285
|
-
`checkSemiVersion`、`checkSemiCssLayer`、`checkDesignScale
|
|
298
|
+
`checkSemiVersion`、`checkSemiCssLayer`、`checkDesignScale`(字号与断点在阶梯上,不写斜体)。存量页面先断言违规数量不超过现状,只减不增。
|
|
286
299
|
- **`checkSemiInternals`** 统计伸进 Semi 内部结构的选择器(`.mine :global(.semi-card-body)`):这类样式在 Semi 升级时会悄悄失效,
|
|
287
300
|
优先用组件属性(`bodyStyle`、`imgStyle`、`inputStyle`),多个产品都要的调整提给底座。产品断言数量只减不增。
|
|
288
301
|
- **看图**:改了页面,在 1440px 和 390px 两个宽度下各看一遍;开放了暗色的产品两种模式都看。改底座的主题或组件,用
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { jsxs as _, jsx as e, Fragment as j } from "react/jsx-runtime";
|
|
2
|
+
import { Button as b, Typography as p } from "@douyinfe/semi-ui";
|
|
3
|
+
import { IconClose as P } from "@douyinfe/semi-icons";
|
|
4
|
+
import { useNavigate as I } from "react-router";
|
|
5
|
+
import { b as O } from "./context-CaVim6ZO.js";
|
|
6
|
+
import { F as f, e as g } from "./page-YBG0dEN1.js";
|
|
7
|
+
import { useId as z, cloneElement as B, forwardRef as E } from "react";
|
|
8
|
+
const L = "_title_euw1b_10", R = "_medium_euw1b_21", H = "_small_euw1b_26", $ = "_index_euw1b_31", M = "_hero_euw1b_43", q = "_head_euw1b_49", A = "_withSheet_euw1b_60", D = "_bar_euw1b_64", G = "_toolbar_euw1b_75", J = "_close_euw1b_82", Q = "_heroTitle_euw1b_87", U = "_description_euw1b_96", V = "_subject_euw1b_103", W = "_sheet_euw1b_110", X = "_modalContent_euw1b_118", n = {
|
|
9
|
+
title: L,
|
|
10
|
+
medium: R,
|
|
11
|
+
small: H,
|
|
12
|
+
index: $,
|
|
13
|
+
hero: M,
|
|
14
|
+
head: q,
|
|
15
|
+
withSheet: A,
|
|
16
|
+
bar: D,
|
|
17
|
+
toolbar: G,
|
|
18
|
+
close: J,
|
|
19
|
+
heroTitle: Q,
|
|
20
|
+
description: U,
|
|
21
|
+
subject: V,
|
|
22
|
+
sheet: W,
|
|
23
|
+
modalContent: X
|
|
24
|
+
}, w = (...s) => s.filter(Boolean).join(" "), Y = ({ children: s, size: t = "large", level: o = 2, className: a }) => /* @__PURE__ */ e(p.Title, { heading: o, className: w(n.title, t === "large" ? void 0 : n[t], a), children: s }), ue = ({ value: s, className: t }) => /* @__PURE__ */ e("span", { className: w(n.index, t), "aria-hidden": "true", children: String(s).padStart(2, "0") }), me = ({ title: s, description: t, toolbar: o, onClose: a, closeLabel: h = "关闭", subject: i, level: d = 2, className: u, children: r }) => {
|
|
25
|
+
const l = r != null && r !== !1;
|
|
26
|
+
return /* @__PURE__ */ _("div", { className: w(n.hero, l ? n.withSheet : void 0, u), children: [
|
|
27
|
+
/* @__PURE__ */ _("div", { className: n.head, children: [
|
|
28
|
+
o || a ? /* @__PURE__ */ _("div", { className: n.bar, children: [
|
|
29
|
+
/* @__PURE__ */ e("div", { className: n.toolbar, children: o }),
|
|
30
|
+
a ? /* @__PURE__ */ e(b, { theme: "borderless", type: "tertiary", className: n.close, icon: /* @__PURE__ */ e(P, {}), "aria-label": h, onClick: a }) : null
|
|
31
|
+
] }) : null,
|
|
32
|
+
/* @__PURE__ */ e(Y, { level: d, className: n.heroTitle, children: s }),
|
|
33
|
+
t ? /* @__PURE__ */ e(p.Paragraph, { className: n.description, children: t }) : null,
|
|
34
|
+
i ? /* @__PURE__ */ e("div", { className: n.subject, children: i }) : null
|
|
35
|
+
] }),
|
|
36
|
+
l ? /* @__PURE__ */ e("div", { className: n.sheet, children: r }) : null
|
|
37
|
+
] });
|
|
38
|
+
}, he = {
|
|
39
|
+
header: null,
|
|
40
|
+
footer: null,
|
|
41
|
+
closable: !1,
|
|
42
|
+
bodyStyle: { padding: 0 },
|
|
43
|
+
modalContentClass: n.modalContent
|
|
44
|
+
}, be = () => {
|
|
45
|
+
const { config: s } = O(), t = I();
|
|
46
|
+
return /* @__PURE__ */ e(f, { children: /* @__PURE__ */ e(
|
|
47
|
+
g,
|
|
48
|
+
{
|
|
49
|
+
status: "not-found",
|
|
50
|
+
title: "页面不存在",
|
|
51
|
+
description: "请检查地址,或返回产品首页继续。",
|
|
52
|
+
extra: /* @__PURE__ */ e(b, { theme: "solid", type: "primary", onClick: () => t(s.routes.publicHome), children: "返回首页" })
|
|
53
|
+
}
|
|
54
|
+
) });
|
|
55
|
+
}, Z = "_srOnly_1mfs8_2", K = {
|
|
56
|
+
srOnly: Z
|
|
57
|
+
}, pe = ({ label: s, children: t }) => {
|
|
58
|
+
const o = z();
|
|
59
|
+
return /* @__PURE__ */ _(j, { children: [
|
|
60
|
+
/* @__PURE__ */ e("span", { id: o, className: K.srOnly, children: s }),
|
|
61
|
+
B(t, { "aria-labelledby": o })
|
|
62
|
+
] });
|
|
63
|
+
}, we = () => /* @__PURE__ */ e(f, { children: /* @__PURE__ */ e("div", { role: "alert", children: /* @__PURE__ */ e(
|
|
64
|
+
g,
|
|
65
|
+
{
|
|
66
|
+
status: "error",
|
|
67
|
+
title: "应用配置暂时无法加载",
|
|
68
|
+
description: "启动检查未通过。请检查运行时配置和网络连接后重新加载。",
|
|
69
|
+
extra: /* @__PURE__ */ e(b, { theme: "solid", type: "primary", onClick: () => window.location.reload(), children: "重新加载" })
|
|
70
|
+
}
|
|
71
|
+
) }) }), ee = "_link_1mzr6_2", te = "_danger_1mzr6_28", ne = "_warning_1mzr6_33", se = "_icon_1mzr6_38", m = {
|
|
72
|
+
link: ee,
|
|
73
|
+
danger: te,
|
|
74
|
+
warning: ne,
|
|
75
|
+
icon: se
|
|
76
|
+
}, fe = E(function({ href: t, target: o, rel: a, download: h, onClick: i, onKeyDown: d, icon: u, status: r, disabled: l = !1, className: y, style: N, role: x, tabIndex: v, children: k, ...S }, T) {
|
|
77
|
+
const C = [m.link, r === "danger" ? m.danger : r === "warning" ? m.warning : "", y ?? ""].filter(Boolean).join(" "), F = {
|
|
78
|
+
...S,
|
|
79
|
+
ref: T,
|
|
80
|
+
href: t,
|
|
81
|
+
target: o,
|
|
82
|
+
rel: o === "_blank" ? a ?? "noreferrer" : a,
|
|
83
|
+
download: h,
|
|
84
|
+
onClick: l ? void 0 : i,
|
|
85
|
+
onKeyDown: (c) => {
|
|
86
|
+
d == null || d(c), !(c.defaultPrevented || t || l || !i) && (c.key === "Enter" || c.key === " ") && (c.preventDefault(), i(c));
|
|
87
|
+
},
|
|
88
|
+
role: x ?? (t ? void 0 : "button"),
|
|
89
|
+
tabIndex: v ?? (t || l ? void 0 : 0),
|
|
90
|
+
"aria-disabled": l || void 0
|
|
91
|
+
};
|
|
92
|
+
return /* @__PURE__ */ _(p.Text, { link: F, disabled: l, className: C, style: N, children: [
|
|
93
|
+
u ? /* @__PURE__ */ e("span", { className: m.icon, children: u }) : null,
|
|
94
|
+
k
|
|
95
|
+
] });
|
|
96
|
+
});
|
|
97
|
+
export {
|
|
98
|
+
me as F,
|
|
99
|
+
be as N,
|
|
100
|
+
pe as S,
|
|
101
|
+
fe as T,
|
|
102
|
+
ue as a,
|
|
103
|
+
Y as b,
|
|
104
|
+
we as c,
|
|
105
|
+
he as f
|
|
106
|
+
};
|
package/dist/index.js
CHANGED
|
@@ -1,65 +1,68 @@
|
|
|
1
|
-
import { A as s, a as o, c as r, b as t, h as n, j as i, k as
|
|
2
|
-
import { A as
|
|
3
|
-
import { A as aa, a as ea, b as sa, E as oa, F as ra, P as ta, c as na, d as ia, U as
|
|
4
|
-
import { A as
|
|
1
|
+
import { A as s, a as o, c as r, b as t, h as n, j as i, k as u, m as l, o as c, p, q as S, s as d, t as m, i as C, d as f, v as P, x as g, l as A, n as L, r as F, y as E, z as T, B as R, e as h, f as x, C as B, D as b, E as y, u as N, g as O, w as M } from "./chunks/logout-signal-CiD_zY5M.js";
|
|
2
|
+
import { A as I, a as k, C as U, L as D, P as v, b as w, c as q, Q as W, R as K, S as Q, d as G, T as H, U as z, e as V, p as Y, f as j, g as X, h as Z, y as J } from "./chunks/upgrade-modal-DyPkV9OB.js";
|
|
3
|
+
import { A as aa, a as ea, b as sa, E as oa, F as ra, P as ta, c as na, d as ia, U as ua, e as la, W as ca, f as pa, g as Sa, h as da, i as ma, j as Ca, k as fa, l as Pa, m as ga, n as Aa, o as La, p as Fa, q as Ea, r as Ta, s as Ra, t as ha, u as xa, v as Ba, w as ba, x as ya, y as Na, z as Oa, B as Ma, C as _a, D as Ia, G as ka, H as Ua, I as Da, J as va, K as wa, L as qa, M as Wa, N as Ka, O as Qa, Q as Ga } from "./chunks/wallet-badge-Dt8fv-Du.js";
|
|
4
|
+
import { A as za } from "./chunks/auth-provider-CqiyTeOt.js";
|
|
5
5
|
import { M as Ya, a as ja, S as Xa } from "./chunks/status-tag-BrLUhH6Z.js";
|
|
6
6
|
import { S as Ja } from "./chunks/status-text-CKFIzlND.js";
|
|
7
7
|
import { F as ae, a as ee, b as se, c as oe, d as re } from "./chunks/form-layout-BDOTSKaB.js";
|
|
8
|
-
import { ConsoleSemiProvider as ne, MODAL_BUTTON_PROPS as ie, modalButtonProps as
|
|
8
|
+
import { ConsoleSemiProvider as ne, MODAL_BUTTON_PROPS as ie, modalButtonProps as ue } from "./semi.js";
|
|
9
9
|
import { B as ce, C as pe, f as Se, a as de, i as me } from "./chunks/console-layout-Os4sQzMP.js";
|
|
10
|
-
import { C as fe, a as Pe, b as ge, F as Ae, c as Le, d as
|
|
10
|
+
import { C as fe, a as Pe, b as ge, F as Ae, c as Le, d as Fe, e as Ee, f as Te, g as Re, h as he, i as xe, j as Be, k as be, L as ye, M as Ne, S as Oe, l as Me, m as _e, n as Ie, o as ke, T as Ue, W as De, p as ve, w as we } from "./chunks/waterfall-Cmz0ZULQ.js";
|
|
11
11
|
import { C as We } from "./chunks/color-mode-switch-BinpVuZ0.js";
|
|
12
|
-
import { E as Qe, R as Ge, U as
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import { E as
|
|
16
|
-
import { C as
|
|
17
|
-
import { C as
|
|
18
|
-
import { c as
|
|
19
|
-
import { u as
|
|
20
|
-
import { BRAND_SOURCE_VARIABLES as
|
|
21
|
-
import { I as
|
|
22
|
-
import { B as
|
|
23
|
-
import { C as
|
|
24
|
-
import { notifyCustomerSessionChanged as
|
|
25
|
-
import { summarizeCustomerError as
|
|
12
|
+
import { E as Qe, R as Ge, U as He } from "./chunks/unsupported-browser-Dwq1mNRy.js";
|
|
13
|
+
import { F as Ve, a as Ye, b as je, N as Xe, S as Ze, c as Je, T as $e, f as as } from "./chunks/text-link-Bb5f1eLW.js";
|
|
14
|
+
import { L as ss } from "./chunks/link-button-PqZcqU6s.js";
|
|
15
|
+
import { E as rs, a as ts, b as ns, F as is, c as us, L as ls, d as cs, P as ps, S as Ss, e as ds, T as ms } from "./chunks/page-YBG0dEN1.js";
|
|
16
|
+
import { C as fs, R as Ps, c as gs, e as As, k as Ls, l as Fs, p as Es, a as Ts, r as Rs, s as hs } from "./chunks/stale-build-DG-Tb2RA.js";
|
|
17
|
+
import { C as Bs, u as bs, a as ys, b as Ns } from "./chunks/context-CaVim6ZO.js";
|
|
18
|
+
import { c as Ms } from "./chunks/http-B3mTs9KZ.js";
|
|
19
|
+
import { u as Is } from "./chunks/use-media-query-DvyinWNg.js";
|
|
20
|
+
import { BRAND_SOURCE_VARIABLES as Us, BRAND_VARIABLES as Ds, SEMI_BRAND_VARIABLES as vs, applyBrand as ws, brandDarkPalette as qs, brandPalette as Ws } from "./theme/index.js";
|
|
21
|
+
import { I as Qs, K as Gs, M as Hs, P as zs, S as Vs, a as Ys, b as js, W as Xs, c as Zs, d as Js, e as $s, f as ao } from "./chunks/work-summary-DVmaOkCu.js";
|
|
22
|
+
import { B as so, D as oo, F as ro, b as to, a as no } from "./chunks/scale-smFifpMm.js";
|
|
23
|
+
import { C as uo, g as lo, i as co, s as po, u as So } from "./chunks/color-mode-DC4KIKya.js";
|
|
24
|
+
import { notifyCustomerSessionChanged as Co, subscribeCustomerSessionChanges as fo } from "@24city/web-runtime/session-sync";
|
|
25
|
+
import { summarizeCustomerError as go } from "@24city/web-runtime/error-summary";
|
|
26
26
|
export {
|
|
27
27
|
aa as ACCOUNT_SECTIONS,
|
|
28
28
|
ea as AccountAvatar,
|
|
29
|
-
|
|
29
|
+
I as AccountCenterPage,
|
|
30
30
|
sa as AccountMenu,
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
k as AllowanceMeter,
|
|
32
|
+
za as AuthProvider,
|
|
33
33
|
s as AuthStoreProvider,
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
Us as BRAND_SOURCE_VARIABLES,
|
|
35
|
+
Ds as BRAND_VARIABLES,
|
|
36
|
+
so as BREAKPOINTS,
|
|
37
37
|
ce as BrandMark,
|
|
38
|
-
|
|
38
|
+
uo as COLOR_MODE_STORAGE_KEY,
|
|
39
39
|
U as CenterLinkButton,
|
|
40
40
|
fe as ChoiceCards,
|
|
41
41
|
Pe as ChoiceCardsSkeleton,
|
|
42
42
|
We as ColorModeSwitch,
|
|
43
|
-
|
|
43
|
+
fs as ConsoleApp,
|
|
44
44
|
pe as ConsoleLayout,
|
|
45
|
-
|
|
45
|
+
Bs as ConsoleRuntimeProvider,
|
|
46
46
|
ne as ConsoleSemiProvider,
|
|
47
47
|
ge as ContentSquare,
|
|
48
|
-
|
|
48
|
+
oo as DISPLAY_SIZES,
|
|
49
49
|
oa as EXPIRING_SOON_DAYS,
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
rs as EmptyBlock,
|
|
51
|
+
ts as EmptyCard,
|
|
52
52
|
Qe as ErrorBoundary,
|
|
53
|
-
|
|
53
|
+
ns as ErrorCard,
|
|
54
54
|
ra as FALLBACK_ACCOUNT_LABEL,
|
|
55
|
-
|
|
55
|
+
ro as FONT_SIZE_SCALE,
|
|
56
|
+
Ve as FeatureHero,
|
|
57
|
+
Ye as FeatureIndex,
|
|
58
|
+
je as FeatureTitle,
|
|
56
59
|
ae as Field,
|
|
57
60
|
Ae as FilterCapsules,
|
|
58
61
|
Le as FilterDropdown,
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
62
|
+
Fe as FilterOptionButton,
|
|
63
|
+
Ee as FilterOptions,
|
|
64
|
+
Te as FilterPanel,
|
|
65
|
+
Re as FilterRangeText,
|
|
63
66
|
he as FilterRow,
|
|
64
67
|
xe as FilterSelectText,
|
|
65
68
|
Be as FilterSelected,
|
|
@@ -68,118 +71,119 @@ export {
|
|
|
68
71
|
se as FormGrid,
|
|
69
72
|
oe as FormSection,
|
|
70
73
|
re as FormStack,
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
74
|
+
is as FullPage,
|
|
75
|
+
us as FullPageLoading,
|
|
76
|
+
Qs as InlineStats,
|
|
77
|
+
Gs as KeyValueList,
|
|
78
|
+
ss as LinkButton,
|
|
76
79
|
ye as ListToolbar,
|
|
77
|
-
|
|
78
|
-
|
|
80
|
+
ls as LoadingBlock,
|
|
81
|
+
cs as LoadingCard,
|
|
79
82
|
D as LoginPage,
|
|
80
83
|
Ne as MAX_WATERFALL_COLUMNS,
|
|
81
84
|
ie as MODAL_BUTTON_PROPS,
|
|
82
|
-
|
|
85
|
+
Hs as MetaLine,
|
|
83
86
|
Ya as MetricCard,
|
|
84
87
|
ja as MetricGrid,
|
|
85
|
-
|
|
88
|
+
Xe as NotFoundPage,
|
|
86
89
|
ta as PERSONAL_NAV_KEYS,
|
|
87
90
|
na as PERSONAL_SPACE_LABEL,
|
|
88
|
-
|
|
91
|
+
zs as PanelHead,
|
|
89
92
|
v as PlanCards,
|
|
90
93
|
ia as PlanPanel,
|
|
91
94
|
w as PointsSection,
|
|
92
|
-
|
|
95
|
+
ps as ProductPage,
|
|
93
96
|
q as ProfileSection,
|
|
94
97
|
W as QuotaPill,
|
|
95
|
-
|
|
98
|
+
Ps as RUNTIME_CONFIG_URL,
|
|
96
99
|
Ge as RouteErrorPage,
|
|
97
100
|
K as RouteGuard,
|
|
98
|
-
|
|
99
|
-
|
|
101
|
+
vs as SEMI_BRAND_VARIABLES,
|
|
102
|
+
Ze as SelectLabel,
|
|
100
103
|
Oe as SelectionBar,
|
|
101
|
-
|
|
104
|
+
Ss as SessionUnavailable,
|
|
102
105
|
Q as SettingRow,
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
106
|
+
Me as SortBar,
|
|
107
|
+
_e as SquareAccent,
|
|
108
|
+
Ie as SquareFooter,
|
|
109
|
+
ke as SquareSearch,
|
|
110
|
+
Je as StartupError,
|
|
111
|
+
ds as StatusResult,
|
|
109
112
|
Xa as StatusTag,
|
|
110
113
|
Ja as StatusText,
|
|
111
|
-
|
|
112
|
-
|
|
114
|
+
Vs as StepTabs,
|
|
115
|
+
Ys as SubTabs,
|
|
113
116
|
G as SubscriptionSection,
|
|
114
|
-
|
|
117
|
+
js as SummaryBar,
|
|
115
118
|
Ue as TableScroll,
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
119
|
+
H as TeamPromo,
|
|
120
|
+
$e as TextLink,
|
|
121
|
+
ms as Toolbar,
|
|
122
|
+
ua as UNLIMITED_QUOTA,
|
|
123
|
+
He as UnsupportedBrowser,
|
|
124
|
+
la as UpgradeEntry,
|
|
125
|
+
z as UpgradeModal,
|
|
123
126
|
ca as WalletBadge,
|
|
124
127
|
De as Waterfall,
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
128
|
+
Xs as WorkArt,
|
|
129
|
+
Zs as WorkCanvas,
|
|
130
|
+
Js as WorkPanel,
|
|
131
|
+
$s as WorkPlaceholder,
|
|
132
|
+
ao as WorkSection,
|
|
130
133
|
V as accountCenterPageUrl,
|
|
131
134
|
pa as accountQueryKeys,
|
|
132
135
|
Sa as accountSectionPath,
|
|
133
136
|
o as announceLogout,
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
137
|
+
ws as applyBrand,
|
|
138
|
+
qs as brandDarkPalette,
|
|
139
|
+
Ws as brandPalette,
|
|
140
|
+
to as breakpointDown,
|
|
141
|
+
no as breakpointUp,
|
|
139
142
|
da as buildPersonalNavigation,
|
|
140
143
|
ma as canBuyForSpace,
|
|
141
144
|
Ca as catalogPlanOf,
|
|
142
145
|
r as createAccountApi,
|
|
143
146
|
t as createAuthStore,
|
|
144
|
-
|
|
145
|
-
|
|
147
|
+
gs as createConsoleQueryClient,
|
|
148
|
+
Ms as createHttpRuntime,
|
|
146
149
|
ve as distributeToColumns,
|
|
147
|
-
|
|
150
|
+
As as earlyRuntimeConfigFetcher,
|
|
148
151
|
fa as entryTeamPlan,
|
|
149
152
|
Pa as featureLines,
|
|
153
|
+
as as featureModalProps,
|
|
150
154
|
Se as findActiveModule,
|
|
151
155
|
de as findActiveNavItem,
|
|
152
156
|
n as formatChargePoints,
|
|
153
157
|
i as formatClock,
|
|
154
|
-
|
|
155
|
-
|
|
158
|
+
u as formatDate,
|
|
159
|
+
l as formatDateTime,
|
|
156
160
|
c as formatDuration,
|
|
157
161
|
p as formatNumber,
|
|
158
162
|
ga as formatPlanAmount,
|
|
159
163
|
Aa as formatPlanPrice,
|
|
160
164
|
S as formatPoints,
|
|
161
165
|
d as formatPrice,
|
|
162
|
-
|
|
166
|
+
lo as getColorMode,
|
|
163
167
|
m as hasHttpStatus,
|
|
164
|
-
|
|
168
|
+
co as initColorMode,
|
|
165
169
|
La as isAccountCenterPath,
|
|
166
|
-
|
|
170
|
+
Fa as isAccountSection,
|
|
167
171
|
C as isLeavingForLogout,
|
|
168
172
|
f as isLoggedOutElsewhere,
|
|
169
173
|
me as isPathUnder,
|
|
170
174
|
P as isPathWithin,
|
|
171
175
|
g as isSafeInternalPath,
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
+
Ea as isTeamSpace,
|
|
177
|
+
Ta as isTeamSubscriptionRequired,
|
|
178
|
+
Ra as isUnlimited,
|
|
179
|
+
Ls as keepLoadingOnStaleBuild,
|
|
176
180
|
A as leaveForLogout,
|
|
177
|
-
|
|
178
|
-
|
|
181
|
+
Fs as loadRuntimeConfig,
|
|
182
|
+
ue as modalButtonProps,
|
|
179
183
|
L as noteLogoutElsewhere,
|
|
180
|
-
|
|
184
|
+
Co as notifySessionChanged,
|
|
181
185
|
ha as offerHighlights,
|
|
182
|
-
|
|
186
|
+
Es as parseRuntimeConfig,
|
|
183
187
|
xa as personalNavKey,
|
|
184
188
|
Y as planBenefitLines,
|
|
185
189
|
j as planCopy,
|
|
@@ -190,42 +194,42 @@ export {
|
|
|
190
194
|
Oa as planTitle,
|
|
191
195
|
X as plansUrl,
|
|
192
196
|
Z as priceFor,
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
197
|
+
Ma as productAccountSections,
|
|
198
|
+
Ts as productQueryKeys,
|
|
199
|
+
_a as quotaCopy,
|
|
200
|
+
Ia as quotaFull,
|
|
201
|
+
ka as quotaText,
|
|
202
|
+
F as releaseLogoutHold,
|
|
203
|
+
Rs as reloadOnStaleBuild,
|
|
204
|
+
E as requireNonNegativeInteger,
|
|
205
|
+
T as requireRecord,
|
|
206
|
+
R as requireString,
|
|
203
207
|
h as resetLogoutSignalForTest,
|
|
204
208
|
x as restoreIdentityContext,
|
|
205
209
|
B as sanitizeReturnPath,
|
|
206
|
-
|
|
210
|
+
po as setColorModePreference,
|
|
207
211
|
Ua as spaceDisplayName,
|
|
208
212
|
Da as spaceRoleLabel,
|
|
209
213
|
va as startingPrice,
|
|
210
|
-
|
|
211
|
-
|
|
214
|
+
fo as subscribeSessionChanged,
|
|
215
|
+
go as summarizeCustomerError,
|
|
212
216
|
b as summarizeError,
|
|
213
|
-
|
|
217
|
+
hs as supportsCascadeLayers,
|
|
214
218
|
y as unwrapApiResponse,
|
|
215
219
|
wa as upgradeOffer,
|
|
216
220
|
qa as useAccountCenter,
|
|
217
221
|
N as useAuthState,
|
|
218
222
|
O as useAuthStore,
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
+
So as useColorMode,
|
|
224
|
+
bs as useConsoleBrand,
|
|
225
|
+
ys as useConsoleCustomization,
|
|
226
|
+
Ns as useConsoleRuntime,
|
|
223
227
|
Wa as useLogout,
|
|
224
|
-
|
|
228
|
+
Is as useMediaQuery,
|
|
225
229
|
Ka as useMembership,
|
|
226
230
|
Qa as usePlanCatalog,
|
|
227
231
|
Ga as useSpaceSwitch,
|
|
228
232
|
we as waterfallLayout,
|
|
229
|
-
|
|
233
|
+
M as withdrawLogout,
|
|
230
234
|
J as yearlyNote
|
|
231
235
|
};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
/** 标题层级(h1–h6),只影响语义,不影响字号。 */
|
|
3
|
+
export type FeatureHeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;
|
|
4
|
+
/** 斜体标题的三档字号:large 24px(弹框头部)、medium 20px(宽版弹框的左栏)、small 18px(卡片标题行)。 */
|
|
5
|
+
export type FeatureTitleSize = 'large' | 'medium' | 'small';
|
|
6
|
+
export interface FeatureTitleProps {
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
/** 默认 large */
|
|
9
|
+
size?: FeatureTitleSize;
|
|
10
|
+
/** 默认 2 */
|
|
11
|
+
level?: FeatureHeadingLevel;
|
|
12
|
+
className?: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* 重点功能的斜体标题:600 字重、字距 1px,字体取 `--app-font-family-display`。
|
|
16
|
+
* 中文字体没有斜体,浏览器把正文字体斜切约 14° 显示;一个弹框或卡片只放一个,不用于正文、按钮和表格里的数字。
|
|
17
|
+
*/
|
|
18
|
+
export declare const FeatureTitle: ({ children, size, level, className }: FeatureTitleProps) => import("react").JSX.Element;
|
|
19
|
+
export interface FeatureIndexProps {
|
|
20
|
+
/** 从 1 开始的序号,显示成两位(01、02…) */
|
|
21
|
+
value: number;
|
|
22
|
+
className?: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* 重点功能弹框里分块标题前的斜体编号(01、02…),默认主色;渐变色等由产品用 className 改颜色。
|
|
26
|
+
* 编号只是装饰,读屏跳过(分块的含义由紧跟的标题说明)。
|
|
27
|
+
*/
|
|
28
|
+
export declare const FeatureIndex: ({ value, className }: FeatureIndexProps) => import("react").JSX.Element;
|
|
29
|
+
export interface FeatureHeroProps {
|
|
30
|
+
/** 斜体标题(24px) */
|
|
31
|
+
title: ReactNode;
|
|
32
|
+
/** 标题下面的一句说明 */
|
|
33
|
+
description?: ReactNode;
|
|
34
|
+
/** 第一行左侧的控件,例如形式切换 */
|
|
35
|
+
toolbar?: ReactNode;
|
|
36
|
+
/** 传了才在右上角显示关闭按钮 */
|
|
37
|
+
onClose?: () => void;
|
|
38
|
+
/** 关闭按钮的读屏文字,默认「关闭」 */
|
|
39
|
+
closeLabel?: string;
|
|
40
|
+
/** 说明下面、仍在渐变里的内容:这次功能作用的对象,例如来源素材的卡片 */
|
|
41
|
+
subject?: ReactNode;
|
|
42
|
+
/** 标题层级,默认 2 */
|
|
43
|
+
level?: FeatureHeadingLevel;
|
|
44
|
+
className?: string;
|
|
45
|
+
/** 压在渐变上的白色内容区(顶部圆角,向上盖住渐变 32px);不传就只有渐变头部 */
|
|
46
|
+
children?: ReactNode;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* 重点功能弹框的头部:浅色多色渐变(`--app-feature-gradient`)里依次是工具行(左侧 `toolbar`、右侧关闭)、斜体标题、说明和 `subject`,
|
|
50
|
+
* `children` 是压在渐变上的白色内容区。放进 Semi Modal 时配合 `featureModalProps`,渐变铺满弹框。
|
|
51
|
+
*/
|
|
52
|
+
export declare const FeatureHero: ({ title, description, toolbar, onClose, closeLabel, subject, level, className, children }: FeatureHeroProps) => import("react").JSX.Element;
|
|
53
|
+
/** `featureModalProps` 的类型:Semi Modal 对应几个属性的子集。 */
|
|
54
|
+
export interface FeatureModalProps {
|
|
55
|
+
header: null;
|
|
56
|
+
footer: null;
|
|
57
|
+
closable: false;
|
|
58
|
+
bodyStyle: CSSProperties;
|
|
59
|
+
modalContentClass: string;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* 重点功能弹框的外壳,展开给 Semi Modal:`<Modal {...featureModalProps} visible width={600} onCancel={close}>`。
|
|
63
|
+
* 去掉 Semi 的标题栏、脚部和关闭按钮(关闭按钮由 FeatureHero 画在渐变里),内容区不留内边距、圆角 18px,渐变头部铺满。
|
|
64
|
+
*/
|
|
65
|
+
export declare const featureModalProps: FeatureModalProps;
|
package/dist/page/index.d.ts
CHANGED
package/dist/page/index.js
CHANGED
|
@@ -1,27 +1,31 @@
|
|
|
1
|
-
import { C as
|
|
2
|
-
import { E as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { E as m, a as
|
|
1
|
+
import { C as o } from "../chunks/color-mode-switch-BinpVuZ0.js";
|
|
2
|
+
import { E as s, R as t, U as l } from "../chunks/unsupported-browser-Dwq1mNRy.js";
|
|
3
|
+
import { F as d, a as n, b as p, N as i, S as g, c as E, T as F, f as L } from "../chunks/text-link-Bb5f1eLW.js";
|
|
4
|
+
import { L as c } from "../chunks/link-button-PqZcqU6s.js";
|
|
5
|
+
import { E as m, a as x, b as S, F as b, c as B, L as C, d as T, P as k, S as y, e as R, T as U } from "../chunks/page-YBG0dEN1.js";
|
|
6
6
|
export {
|
|
7
|
-
|
|
7
|
+
o as ColorModeSwitch,
|
|
8
8
|
m as EmptyBlock,
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
x as EmptyCard,
|
|
10
|
+
s as ErrorBoundary,
|
|
11
11
|
S as ErrorCard,
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
B as
|
|
17
|
-
|
|
18
|
-
C as
|
|
12
|
+
d as FeatureHero,
|
|
13
|
+
n as FeatureIndex,
|
|
14
|
+
p as FeatureTitle,
|
|
15
|
+
b as FullPage,
|
|
16
|
+
B as FullPageLoading,
|
|
17
|
+
c as LinkButton,
|
|
18
|
+
C as LoadingBlock,
|
|
19
|
+
T as LoadingCard,
|
|
20
|
+
i as NotFoundPage,
|
|
21
|
+
k as ProductPage,
|
|
19
22
|
t as RouteErrorPage,
|
|
20
23
|
g as SelectLabel,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
l as UnsupportedBrowser
|
|
24
|
+
y as SessionUnavailable,
|
|
25
|
+
E as StartupError,
|
|
26
|
+
R as StatusResult,
|
|
27
|
+
F as TextLink,
|
|
28
|
+
U as Toolbar,
|
|
29
|
+
l as UnsupportedBrowser,
|
|
30
|
+
L as featureModalProps
|
|
27
31
|
};
|
package/dist/styles.css
CHANGED
|
@@ -4377,6 +4377,146 @@
|
|
|
4377
4377
|
._item_3uefs_17 {
|
|
4378
4378
|
width: 100%;
|
|
4379
4379
|
}
|
|
4380
|
+
/*
|
|
4381
|
+
* 重点功能的一套视觉(来自 AdFlow 的一键跟创弹框):浅色多色渐变头部、斜体标题、压在渐变上的白色内容区、斜体编号。
|
|
4382
|
+
*
|
|
4383
|
+
* 斜体由浏览器把正文字体斜切出来(中文字体没有斜体)。字体取 --app-font-family-display,目前就是正文字体;
|
|
4384
|
+
* 以后换成真正的斜体标题字,只在本包登记一个 font-style: italic 的字体,这里不用改,也不会再叠一层斜切。
|
|
4385
|
+
* 字重 600:苹方最粗就是 600、微软雅黑的粗体只有 700 一档,写得再重中文也不会变;写 600 时标题里的英文和数字与中文一样粗。
|
|
4386
|
+
* 产品样式里不写 font-style: italic(守卫 checkDesignScale 会报),斜体只从这里来。
|
|
4387
|
+
*/
|
|
4388
|
+
|
|
4389
|
+
._title_euw1b_10 {
|
|
4390
|
+
margin: 0;
|
|
4391
|
+
color: var(--semi-color-text-0);
|
|
4392
|
+
font-family: var(--app-font-family-display);
|
|
4393
|
+
font-size: var(--app-font-size-h3);
|
|
4394
|
+
font-style: italic;
|
|
4395
|
+
font-weight: 600;
|
|
4396
|
+
letter-spacing: 1px;
|
|
4397
|
+
line-height: 32px;
|
|
4398
|
+
}
|
|
4399
|
+
|
|
4400
|
+
._medium_euw1b_21 {
|
|
4401
|
+
font-size: var(--app-font-size-h4);
|
|
4402
|
+
line-height: 28px;
|
|
4403
|
+
}
|
|
4404
|
+
|
|
4405
|
+
._small_euw1b_26 {
|
|
4406
|
+
font-size: var(--app-font-size-h5);
|
|
4407
|
+
line-height: 26px;
|
|
4408
|
+
}
|
|
4409
|
+
|
|
4410
|
+
._index_euw1b_31 {
|
|
4411
|
+
color: var(--semi-color-primary);
|
|
4412
|
+
font-family: var(--app-font-family-display);
|
|
4413
|
+
font-size: var(--app-font-size-h6);
|
|
4414
|
+
font-style: italic;
|
|
4415
|
+
font-variant-numeric: tabular-nums;
|
|
4416
|
+
font-weight: 600;
|
|
4417
|
+
line-height: 24px;
|
|
4418
|
+
}
|
|
4419
|
+
|
|
4420
|
+
/* ---------- 渐变头部 ---------- */
|
|
4421
|
+
|
|
4422
|
+
._hero_euw1b_43 {
|
|
4423
|
+
display: flex;
|
|
4424
|
+
min-width: 0;
|
|
4425
|
+
flex-direction: column;
|
|
4426
|
+
}
|
|
4427
|
+
|
|
4428
|
+
._head_euw1b_49 {
|
|
4429
|
+
display: flex;
|
|
4430
|
+
min-width: 0;
|
|
4431
|
+
flex-direction: column;
|
|
4432
|
+
align-items: center;
|
|
4433
|
+
padding: 16px 24px 24px;
|
|
4434
|
+
background: var(--app-feature-gradient);
|
|
4435
|
+
text-align: center;
|
|
4436
|
+
}
|
|
4437
|
+
|
|
4438
|
+
/* 下面接白色内容区时多留 32px,被内容区盖住。 */
|
|
4439
|
+
._withSheet_euw1b_60 ._head_euw1b_49 {
|
|
4440
|
+
padding-bottom: 52px;
|
|
4441
|
+
}
|
|
4442
|
+
|
|
4443
|
+
._bar_euw1b_64 {
|
|
4444
|
+
display: flex;
|
|
4445
|
+
min-height: 32px;
|
|
4446
|
+
align-self: stretch;
|
|
4447
|
+
align-items: center;
|
|
4448
|
+
justify-content: space-between;
|
|
4449
|
+
gap: 12px;
|
|
4450
|
+
margin-bottom: 4px;
|
|
4451
|
+
text-align: start;
|
|
4452
|
+
}
|
|
4453
|
+
|
|
4454
|
+
._toolbar_euw1b_75 {
|
|
4455
|
+
display: flex;
|
|
4456
|
+
min-width: 0;
|
|
4457
|
+
align-items: center;
|
|
4458
|
+
gap: 8px;
|
|
4459
|
+
}
|
|
4460
|
+
|
|
4461
|
+
._close_euw1b_82 {
|
|
4462
|
+
flex: none;
|
|
4463
|
+
margin-left: auto;
|
|
4464
|
+
}
|
|
4465
|
+
|
|
4466
|
+
._heroTitle_euw1b_87 {
|
|
4467
|
+
margin-top: 4px;
|
|
4468
|
+
}
|
|
4469
|
+
|
|
4470
|
+
/* 没有工具行时标题离顶边远一点。 */
|
|
4471
|
+
._head_euw1b_49 > ._heroTitle_euw1b_87:first-child {
|
|
4472
|
+
margin-top: 8px;
|
|
4473
|
+
}
|
|
4474
|
+
|
|
4475
|
+
._description_euw1b_96 {
|
|
4476
|
+
margin: 2px 0 0;
|
|
4477
|
+
color: var(--semi-color-text-1);
|
|
4478
|
+
font-size: var(--app-font-size-compact);
|
|
4479
|
+
line-height: 20px;
|
|
4480
|
+
}
|
|
4481
|
+
|
|
4482
|
+
._subject_euw1b_103 {
|
|
4483
|
+
min-width: 0;
|
|
4484
|
+
align-self: stretch;
|
|
4485
|
+
margin-top: 16px;
|
|
4486
|
+
text-align: start;
|
|
4487
|
+
}
|
|
4488
|
+
|
|
4489
|
+
._sheet_euw1b_110 {
|
|
4490
|
+
position: relative;
|
|
4491
|
+
margin-top: -32px;
|
|
4492
|
+
padding: 28px 40px 32px;
|
|
4493
|
+
border-radius: 20px 20px 0 0;
|
|
4494
|
+
background: var(--semi-color-bg-2);
|
|
4495
|
+
}
|
|
4496
|
+
|
|
4497
|
+
/* Semi Modal 的内容区(featureModalProps.modalContentClass):不留内边距、圆角加大,渐变头部铺满;
|
|
4498
|
+
* 钉在弹框右上角的按钮(宽版弹框的关闭钮)按它绝对定位。 */
|
|
4499
|
+
._modalContent_euw1b_118 {
|
|
4500
|
+
position: relative;
|
|
4501
|
+
overflow: hidden;
|
|
4502
|
+
padding: 0;
|
|
4503
|
+
border-radius: 18px;
|
|
4504
|
+
box-shadow: 0 24px 64px rgba(var(--app-shadow-color), 0.18);
|
|
4505
|
+
}
|
|
4506
|
+
|
|
4507
|
+
@media (max-width: 576px) {
|
|
4508
|
+
._head_euw1b_49 {
|
|
4509
|
+
padding: 12px 16px 20px;
|
|
4510
|
+
}
|
|
4511
|
+
|
|
4512
|
+
._withSheet_euw1b_60 ._head_euw1b_49 {
|
|
4513
|
+
padding-bottom: 48px;
|
|
4514
|
+
}
|
|
4515
|
+
|
|
4516
|
+
._sheet_euw1b_110 {
|
|
4517
|
+
padding: 24px 20px;
|
|
4518
|
+
}
|
|
4519
|
+
}
|
|
4380
4520
|
/* 只给读屏的文字:不占位、不可见。 */
|
|
4381
4521
|
._srOnly_1mfs8_2 {
|
|
4382
4522
|
position: absolute;
|
|
@@ -4517,6 +4657,9 @@ html body .semi-always-light {
|
|
|
4517
4657
|
--app-segment-track: rgb(var(--semi-grey-2));
|
|
4518
4658
|
/* 禁用的主色实心按钮上的字:浅色是白字压在浅主色上;暗色下底是深主色,白字会像没禁用,降到半透明。 */
|
|
4519
4659
|
--app-primary-disabled-text: rgb(255, 255, 255);
|
|
4660
|
+
/* 重点功能(FeatureHero 等)的浅色多色渐变:品牌色最浅一级 → 粉 → 靛;宽版弹框的左栏用竖向的那条,底部淡出到弹框底色。 */
|
|
4661
|
+
--app-feature-gradient: linear-gradient(135deg, rgb(var(--app-brand-1)) 0%, rgb(var(--semi-pink-0)) 48%, rgb(var(--semi-indigo-0)) 100%);
|
|
4662
|
+
--app-feature-aside-gradient: linear-gradient(180deg, rgb(var(--app-brand-1)) 0%, rgb(var(--semi-violet-0)) 46%, var(--semi-color-bg-2) 100%);
|
|
4520
4663
|
}
|
|
4521
4664
|
|
|
4522
4665
|
/* ---------- 暗色 ---------- */
|
|
@@ -4578,6 +4721,9 @@ html body .semi-always-dark {
|
|
|
4578
4721
|
--app-mask-bg: rgba(0, 0, 0, 0.5);
|
|
4579
4722
|
--app-segment-track: rgba(255, 255, 255, 0.1);
|
|
4580
4723
|
--app-primary-disabled-text: rgba(255, 255, 255, 0.45);
|
|
4724
|
+
/* Semi 暗色色板里粉、靛、紫的第 0 级饱和度很高,整块铺开像霓虹:降到 35% 透出底下的弹框底色。 */
|
|
4725
|
+
--app-feature-gradient: linear-gradient(135deg, rgb(var(--app-brand-1)) 0%, rgba(var(--semi-pink-0), 0.35) 48%, rgba(var(--semi-indigo-0), 0.35) 100%);
|
|
4726
|
+
--app-feature-aside-gradient: linear-gradient(180deg, rgb(var(--app-brand-1)) 0%, rgba(var(--semi-violet-0), 0.35) 46%, var(--semi-color-bg-2) 100%);
|
|
4581
4727
|
}
|
|
4582
4728
|
|
|
4583
4729
|
/* 暗色页面里的“保持浅色”区块:比上面的暗色规则多一个类,重新声明一遍浅色那组。 */
|
|
@@ -4622,6 +4768,8 @@ html body[theme-mode='dark'] .semi-always-light {
|
|
|
4622
4768
|
--app-mask-bg: rgba(38, 38, 38, 0.2);
|
|
4623
4769
|
--app-segment-track: rgb(var(--semi-grey-2));
|
|
4624
4770
|
--app-primary-disabled-text: rgb(255, 255, 255);
|
|
4771
|
+
--app-feature-gradient: linear-gradient(135deg, rgb(var(--app-brand-1)) 0%, rgb(var(--semi-pink-0)) 48%, rgb(var(--semi-indigo-0)) 100%);
|
|
4772
|
+
--app-feature-aside-gradient: linear-gradient(180deg, rgb(var(--app-brand-1)) 0%, rgb(var(--semi-violet-0)) 46%, var(--semi-color-bg-2) 100%);
|
|
4625
4773
|
/* 这类区块自己的文字颜色也回到浅色那组(Semi 的 .semi-always-light 已把它的语义色还原)。 */
|
|
4626
4774
|
color: var(--semi-color-text-0);
|
|
4627
4775
|
}
|
|
@@ -4651,11 +4799,11 @@ html body[theme-mode='dark'] .semi-always-light {
|
|
|
4651
4799
|
--semi-color-link-active: rgb(var(--app-brand-8));
|
|
4652
4800
|
--semi-color-link-visited: rgb(var(--app-brand-6));
|
|
4653
4801
|
|
|
4654
|
-
/* 圆角与曲线两种模式相同:控件
|
|
4655
|
-
--semi-border-radius-small:
|
|
4656
|
-
--semi-border-radius-large:
|
|
4657
|
-
--app-radius-card:
|
|
4658
|
-
--app-radius-chip:
|
|
4802
|
+
/* 圆角与曲线两种模式相同:控件 8px,卡片、弹窗与表格容器 12px,标签与小按钮 6px。 */
|
|
4803
|
+
--semi-border-radius-small: 8px;
|
|
4804
|
+
--semi-border-radius-large: 12px;
|
|
4805
|
+
--app-radius-card: 12px;
|
|
4806
|
+
--app-radius-chip: 6px;
|
|
4659
4807
|
--app-ease: cubic-bezier(0.2, 0, 0.38, 0.9);
|
|
4660
4808
|
}
|
|
4661
4809
|
|
|
@@ -4793,7 +4941,42 @@ body .semi-typography.semi-typography-link {
|
|
|
4793
4941
|
font-weight: 400;
|
|
4794
4942
|
}
|
|
4795
4943
|
|
|
4796
|
-
/* ----------
|
|
4944
|
+
/* ---------- 图标 ----------
|
|
4945
|
+
* Semi 图标只用 fill: currentColor,颜色由所在控件决定。普通次要操作的图标比按钮文字淡一档,
|
|
4946
|
+
* 让图标退到辅助层级;悬停、聚焦和选中时恢复按钮自己的颜色,保留品牌色或危险色反馈。
|
|
4947
|
+
* 主按钮和语义按钮不在这里覆盖,图标继续继承按钮的白色、主色或状态色。 */
|
|
4948
|
+
|
|
4949
|
+
body .semi-button-light.semi-button-tertiary:not(.semi-button-danger):not(.semi-button-disabled) .semi-icon,
|
|
4950
|
+
body .semi-button-borderless.semi-button-tertiary:not(.semi-button-danger):not(.semi-button-disabled) .semi-icon {
|
|
4951
|
+
color: var(--semi-color-text-2);
|
|
4952
|
+
}
|
|
4953
|
+
|
|
4954
|
+
body .semi-button-light.semi-button-tertiary:not(.semi-button-danger):not(.semi-button-disabled):hover .semi-icon,
|
|
4955
|
+
body .semi-button-light.semi-button-tertiary:not(.semi-button-danger):not(.semi-button-disabled):active .semi-icon,
|
|
4956
|
+
body .semi-button-light.semi-button-tertiary:not(.semi-button-danger):not(.semi-button-disabled):focus-visible .semi-icon,
|
|
4957
|
+
body .semi-button-borderless.semi-button-tertiary:not(.semi-button-danger):not(.semi-button-disabled):hover .semi-icon,
|
|
4958
|
+
body .semi-button-borderless.semi-button-tertiary:not(.semi-button-danger):not(.semi-button-disabled):active .semi-icon,
|
|
4959
|
+
body .semi-button-borderless.semi-button-tertiary:not(.semi-button-danger):not(.semi-button-disabled):focus-visible .semi-icon {
|
|
4960
|
+
color: inherit;
|
|
4961
|
+
}
|
|
4962
|
+
|
|
4963
|
+
body .semi-button-borderless.semi-button-tertiary:not(.semi-button-danger):not(.semi-button-disabled)[aria-current='page'] .semi-icon,
|
|
4964
|
+
body .semi-button-borderless.semi-button-tertiary:not(.semi-button-danger):not(.semi-button-disabled)[aria-pressed='true'] .semi-icon,
|
|
4965
|
+
body .semi-button-borderless.semi-button-tertiary:not(.semi-button-danger):not(.semi-button-disabled)[aria-selected='true'] .semi-icon,
|
|
4966
|
+
body .semi-button-light.semi-button-tertiary:not(.semi-button-danger):not(.semi-button-disabled)[aria-pressed='true'] .semi-icon,
|
|
4967
|
+
body .semi-button-light.semi-button-tertiary:not(.semi-button-danger):not(.semi-button-disabled)[aria-selected='true'] .semi-icon {
|
|
4968
|
+
color: inherit;
|
|
4969
|
+
}
|
|
4970
|
+
|
|
4971
|
+
/* 输入框里的搜索、前后缀图标是辅助提示,不与输入文字抢层级。 */
|
|
4972
|
+
body .semi-input-prefix-icon,
|
|
4973
|
+
body .semi-input-suffix-icon,
|
|
4974
|
+
body .semi-input-prepend-icon,
|
|
4975
|
+
body .semi-input-append-icon {
|
|
4976
|
+
color: var(--semi-color-text-2);
|
|
4977
|
+
}
|
|
4978
|
+
|
|
4979
|
+
/* Semi 默认固定 16px;让普通图标跟随所在文字字号,元信息行里的小图标才不会比字大。 */
|
|
4797
4980
|
|
|
4798
4981
|
body .semi-icon-default {
|
|
4799
4982
|
font-size: inherit;
|
|
@@ -5075,7 +5258,9 @@ body .semi-banner-in-container .semi-banner-close {
|
|
|
5075
5258
|
margin-left: 0;
|
|
5076
5259
|
}
|
|
5077
5260
|
|
|
5078
|
-
|
|
5261
|
+
/* 提示条的卡片是里面的 .semi-toast-content(Semi 的底色、圆角、投影都在它上面);外层 .semi-toast 是透明的、四周还留着间距,
|
|
5262
|
+
投影加在外层会在卡片外再框出一圈方块。通知的卡片就是 .semi-notification-notice 本身。 */
|
|
5263
|
+
body .semi-toast-content,
|
|
5079
5264
|
body .semi-notification-notice {
|
|
5080
5265
|
box-shadow: var(--app-shadow-popup);
|
|
5081
5266
|
}
|
|
@@ -5150,6 +5335,9 @@ body .semi-sidesheet-body {
|
|
|
5150
5335
|
'Inter', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Segoe UI', 'Helvetica Neue', Helvetica,
|
|
5151
5336
|
Arial, sans-serif;
|
|
5152
5337
|
--app-font-family-number: 'DIN Alternate', 'Bahnschrift', 'D-DIN', var(--app-font-family);
|
|
5338
|
+
/* 重点功能的斜体标题与编号(FeatureTitle、FeatureIndex)用的字体:目前就是正文字体,斜体由浏览器斜切。
|
|
5339
|
+
* 以后换成真正的斜体标题字,只改这里,并把那款字体按 font-style: italic 登记,组件不用改。 */
|
|
5340
|
+
--app-font-family-display: var(--app-font-family);
|
|
5153
5341
|
|
|
5154
5342
|
/* 字号阶梯。标题六级与 Semi 的 Typography.Title 相同(h1 32 … h6 16),正文 14、说明 12 也与 Semi 相同;
|
|
5155
5343
|
* 另有两档紧凑字号:13(表头、筛选项、次要说明)与 15(菜单项、列表项标题)。11 只用于角标里的短字。
|
package/dist/testing/guard.d.ts
CHANGED
|
@@ -42,10 +42,11 @@ export declare const ALLOWED_FONT_SIZES: readonly number[];
|
|
|
42
42
|
/** 允许出现在 @media 里的宽度(px)。 */
|
|
43
43
|
export declare const ALLOWED_BREAKPOINTS: readonly number[];
|
|
44
44
|
/**
|
|
45
|
-
*
|
|
45
|
+
* 检查样式里写死的字号和断点是否落在设计阶梯上,斜体是否只来自本包,逐处报告(带行号):
|
|
46
46
|
* - `font-size: Npx` 的 N 必须是字号阶梯或展示尺寸里的值(引用 `var(--app-font-size-*)`、`inherit`、`em` 等不受限);
|
|
47
|
-
* - `@media` 里 `min-width` / `max-width`
|
|
48
|
-
*
|
|
47
|
+
* - `@media` 里 `min-width` / `max-width` 的像素值必须是断点之一;
|
|
48
|
+
* - 不写 `font-style: italic` / `oblique`:重点功能的斜体标题用 `FeatureTitle`,编号用 `FeatureIndex`。
|
|
49
|
+
* 新产品 `expect(checkDesignScale({ sourceRoot })).toEqual([])`;存量产品可以按 `rule` 分别断言数量不超过现状,只减不增。
|
|
49
50
|
*/
|
|
50
51
|
export declare const checkDesignScale: ({ sourceRoot, exclude }: UiGuardOptions) => UiGuardViolation[];
|
|
51
52
|
/**
|
package/dist/testing/guard.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { readFileSync as
|
|
2
|
-
import { relative as
|
|
3
|
-
import { D as
|
|
4
|
-
const C = { "@douyinfe/semi-ui": "2.104.0" },
|
|
1
|
+
import { readFileSync as m, readdirSync as I, statSync as L } from "node:fs";
|
|
2
|
+
import { relative as A, join as _ } from "node:path";
|
|
3
|
+
import { D as v, F as N, B as O } from "../chunks/scale-smFifpMm.js";
|
|
4
|
+
const C = { "@douyinfe/semi-ui": "2.104.0" }, T = {
|
|
5
5
|
peerDependencies: C
|
|
6
|
-
},
|
|
6
|
+
}, D = /<(button|input|select|textarea|option|label|form|table|thead|tbody|tr|td|th|details|summary|dialog|img|a|ul|ol|li|dl|dt|dd|h[1-6]|p)(\s|>|\/)/, F = [
|
|
7
7
|
"lucide-react",
|
|
8
8
|
"@nuwa/customer-ui",
|
|
9
9
|
"@nuwa/customer-shell",
|
|
@@ -15,28 +15,28 @@ const C = { "@douyinfe/semi-ui": "2.104.0" }, D = {
|
|
|
15
15
|
".arco-",
|
|
16
16
|
"@douyinfe/semi-ui/dist/css",
|
|
17
17
|
"theme-mode"
|
|
18
|
-
],
|
|
18
|
+
], R = ["--semi-", "--app-"], w = /#(?:[0-9a-fA-F]{8}|[0-9a-fA-F]{6}|[0-9a-fA-F]{4}|[0-9a-fA-F]{3})\b/, P = /\b(?:rgba?|hsla?)\((?!\s*var\()/, k = new RegExp(`(?:^|[\\s{;'"])(${R.map((s) => s.replace(/-/g, "\\-")).join("|")})[a-z0-9_-]*\\s*['"]?\\s*:`, "m"), W = /<IconSpin\b([^>]*)>/g, j = (s) => {
|
|
19
19
|
for (const i of s.matchAll(W))
|
|
20
20
|
if (!/(?:^|\s)spin(?=[\s=/]|$)/.test(i[1])) return i[0];
|
|
21
21
|
return null;
|
|
22
|
-
}, h = (s) =>
|
|
23
|
-
const e =
|
|
24
|
-
return
|
|
25
|
-
}), S = (s) => /\.test\.(ts|tsx)$/.test(s) || s.startsWith("test/") || s.endsWith(".d.ts"),
|
|
26
|
-
const e = [], r = h(s).map((o) => ({ path: o, file:
|
|
22
|
+
}, h = (s) => I(s).flatMap((i) => {
|
|
23
|
+
const e = _(s, i);
|
|
24
|
+
return L(e).isDirectory() ? h(e) : [e];
|
|
25
|
+
}), S = (s) => /\.test\.(ts|tsx)$/.test(s) || s.startsWith("test/") || s.endsWith(".d.ts"), U = ({ sourceRoot: s, exclude: i = S }) => {
|
|
26
|
+
const e = [], r = h(s).map((o) => ({ path: o, file: A(s, o) })).filter(({ file: o }) => !i(o));
|
|
27
27
|
for (const { path: o, file: t } of r) {
|
|
28
28
|
const n = t.endsWith(".tsx");
|
|
29
29
|
if (!/\.(tsx?|css)$/.test(t)) continue;
|
|
30
|
-
const c =
|
|
30
|
+
const c = m(o, "utf8");
|
|
31
31
|
if (n) {
|
|
32
|
-
const
|
|
33
|
-
|
|
32
|
+
const f = c.match(D);
|
|
33
|
+
f && e.push({ file: t, rule: "raw-element", detail: `应改用 Semi 组件,而不是 ${f[0].trim()}` }), /className="/.test(c) && e.push({ file: t, rule: "class-string", detail: "className 应引用 CSS Module,不写工具类字符串" });
|
|
34
34
|
const g = j(c);
|
|
35
35
|
g && e.push({ file: t, rule: "static-spinner", detail: `${g} 不会转:Semi 的 IconSpin 要加 spin` });
|
|
36
36
|
}
|
|
37
|
-
for (const
|
|
38
|
-
c.includes(
|
|
39
|
-
const a = c.match(
|
|
37
|
+
for (const f of F)
|
|
38
|
+
c.includes(f) && e.push({ file: t, rule: "forbidden-import", detail: `不应引用 ${f}` });
|
|
39
|
+
const a = c.match(w);
|
|
40
40
|
a && e.push({ file: t, rule: "color-literal", detail: `含有写死的色值 ${a[0]}` });
|
|
41
41
|
const u = c.match(P);
|
|
42
42
|
u && e.push({ file: t, rule: "color-literal", detail: `含有写死的色值 ${u[0]}` });
|
|
@@ -44,20 +44,20 @@ const C = { "@douyinfe/semi-ui": "2.104.0" }, D = {
|
|
|
44
44
|
E && e.push({ file: t, rule: "reserved-variable", detail: `不得声明主题变量 ${E[1]}…,品牌主色只能通过 runtime-config 的 brand.primaryColor 设置` });
|
|
45
45
|
}
|
|
46
46
|
return e;
|
|
47
|
-
}, M = ["@douyinfe/semi-ui", "@douyinfe/semi-icons", "@douyinfe/semi-illustrations"], z =
|
|
47
|
+
}, M = ["@douyinfe/semi-ui", "@douyinfe/semi-icons", "@douyinfe/semi-illustrations"], z = T.peerDependencies, p = z["@douyinfe/semi-ui"], X = (s) => {
|
|
48
48
|
var r, o;
|
|
49
|
-
const i = JSON.parse(
|
|
49
|
+
const i = JSON.parse(m(s, "utf8")), e = [];
|
|
50
50
|
for (const t of M) {
|
|
51
51
|
const n = ((r = i.dependencies) == null ? void 0 : r[t]) ?? ((o = i.devDependencies) == null ? void 0 : o[t]);
|
|
52
|
-
!(t === "@douyinfe/semi-ui" || n !== void 0) || n ===
|
|
52
|
+
!(t === "@douyinfe/semi-ui" || n !== void 0) || n === p || e.push({
|
|
53
53
|
file: "package.json",
|
|
54
54
|
rule: "semi-version",
|
|
55
|
-
detail: n ? `${t} 必须精确声明为 ${
|
|
55
|
+
detail: n ? `${t} 必须精确声明为 ${p},现在是 ${n}` : `必须声明 ${t} ${p}`
|
|
56
56
|
});
|
|
57
57
|
}
|
|
58
58
|
return e;
|
|
59
59
|
}, G = (s) => {
|
|
60
|
-
const i =
|
|
60
|
+
const i = m(s, "utf8").replace(/\/\*[\s\S]*?\*\/|\/\/[^\n]*/g, ""), e = /import\s*\{[^}]*\bsemiCssLayer\b[^}]*\}\s*from\s*['"]@24city\/web-console\/vite['"]/.test(i), r = /\bsemiCssLayer\s*\(\s*\)/.test(i);
|
|
61
61
|
return e && r ? [] : [
|
|
62
62
|
{
|
|
63
63
|
file: "vite.config.ts",
|
|
@@ -65,32 +65,39 @@ const C = { "@douyinfe/semi-ui": "2.104.0" }, D = {
|
|
|
65
65
|
detail: "plugins 里要加 semiCssLayer()(import { semiCssLayer } from '@24city/web-console/vite'),把 Semi 的样式放进 semi 层"
|
|
66
66
|
}
|
|
67
67
|
];
|
|
68
|
-
},
|
|
69
|
-
`).length,
|
|
68
|
+
}, b = [...Object.values(N), ...v], y = Object.values(O), $ = (s) => s.replace(/\/\*[\s\S]*?\*\//g, (i) => i.replace(/[^\n]/g, " ")), d = (s, i) => s.slice(0, i).split(`
|
|
69
|
+
`).length, x = (s, i) => h(s).map((e) => ({ path: e, file: A(s, e) })).filter(({ file: e }) => e.endsWith(".css") && !i(e)), H = ({ sourceRoot: s, exclude: i = S }) => {
|
|
70
70
|
const e = [];
|
|
71
|
-
for (const { path: r, file: o } of
|
|
72
|
-
const t = $(
|
|
71
|
+
for (const { path: r, file: o } of x(s, i)) {
|
|
72
|
+
const t = $(m(r, "utf8"));
|
|
73
73
|
for (const n of t.matchAll(/font-size\s*:\s*(\d+(?:\.\d+)?)px/g))
|
|
74
|
-
|
|
74
|
+
b.includes(Number(n[1])) || e.push({
|
|
75
75
|
file: o,
|
|
76
|
-
line:
|
|
76
|
+
line: d(t, n.index),
|
|
77
77
|
rule: "font-size-scale",
|
|
78
|
-
detail: `font-size: ${n[1]}px 不在字号阶梯上(${[...
|
|
78
|
+
detail: `font-size: ${n[1]}px 不在字号阶梯上(${[...b].sort((l, c) => l - c).join("、")})`
|
|
79
79
|
});
|
|
80
80
|
for (const n of t.matchAll(/@media[^{]*/g))
|
|
81
81
|
for (const l of n[0].matchAll(/(min|max)-width\s*:\s*(\d+(?:\.\d+)?)px/g))
|
|
82
|
-
|
|
82
|
+
y.includes(Number(l[2])) || e.push({
|
|
83
83
|
file: o,
|
|
84
|
-
line:
|
|
84
|
+
line: d(t, n.index),
|
|
85
85
|
rule: "breakpoint",
|
|
86
|
-
detail: `@media 的 ${l[1]}-width: ${l[2]}px 不是规定的断点(${
|
|
86
|
+
detail: `@media 的 ${l[1]}-width: ${l[2]}px 不是规定的断点(${y.join("、")})`
|
|
87
87
|
});
|
|
88
|
+
for (const n of t.matchAll(/font-style\s*:\s*(italic|oblique)\b/g))
|
|
89
|
+
e.push({
|
|
90
|
+
file: o,
|
|
91
|
+
line: d(t, n.index),
|
|
92
|
+
rule: "font-style",
|
|
93
|
+
detail: `font-style: ${n[1]} 不写在产品样式里:重点功能的斜体标题用 FeatureTitle,编号用 FeatureIndex(@24city/web-console/page)`
|
|
94
|
+
});
|
|
88
95
|
}
|
|
89
96
|
return e;
|
|
90
97
|
}, B = /(?:^|[\s>+~])(?::global\(\s*)?\.(semi-[A-Za-z0-9-]+)/, V = /:not\((?:[^()]|\([^()]*\))*\)/g, J = ({ sourceRoot: s, exclude: i = S }) => {
|
|
91
98
|
const e = [];
|
|
92
|
-
for (const { path: r, file: o } of
|
|
93
|
-
const t = $(
|
|
99
|
+
for (const { path: r, file: o } of x(s, i)) {
|
|
100
|
+
const t = $(m(r, "utf8"));
|
|
94
101
|
for (const n of t.matchAll(/([^{}]+)\{/g)) {
|
|
95
102
|
const l = n[1];
|
|
96
103
|
if (l.trimStart().startsWith("@")) continue;
|
|
@@ -99,7 +106,7 @@ const C = { "@douyinfe/semi-ui": "2.104.0" }, D = {
|
|
|
99
106
|
const u = a.replace(V, "").trim().match(B);
|
|
100
107
|
u && e.push({
|
|
101
108
|
file: o,
|
|
102
|
-
line:
|
|
109
|
+
line: d(t, n.index + c + (a.length - a.trimStart().length)),
|
|
103
110
|
rule: "semi-internals",
|
|
104
111
|
detail: `选择器 ${a.trim()} 伸进了 Semi 组件内部(.${u[1]})`
|
|
105
112
|
}), c += a.length + 1;
|
|
@@ -109,16 +116,16 @@ const C = { "@douyinfe/semi-ui": "2.104.0" }, D = {
|
|
|
109
116
|
return e;
|
|
110
117
|
};
|
|
111
118
|
export {
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
119
|
+
y as ALLOWED_BREAKPOINTS,
|
|
120
|
+
b as ALLOWED_FONT_SIZES,
|
|
121
|
+
p as EXPECTED_SEMI_VERSION,
|
|
122
|
+
F as FORBIDDEN_SNIPPETS,
|
|
123
|
+
D as RAW_ELEMENT_PATTERN,
|
|
124
|
+
R as RESERVED_VARIABLE_PREFIXES,
|
|
118
125
|
M as SEMI_PACKAGES,
|
|
119
126
|
H as checkDesignScale,
|
|
120
127
|
G as checkSemiCssLayer,
|
|
121
128
|
J as checkSemiInternals,
|
|
122
|
-
|
|
123
|
-
|
|
129
|
+
X as checkSemiVersion,
|
|
130
|
+
U as checkUiLibraryUsage
|
|
124
131
|
};
|
package/package.json
CHANGED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { jsx as n, jsxs as u, Fragment as z } from "react/jsx-runtime";
|
|
2
|
-
import { Button as p, Typography as F } from "@douyinfe/semi-ui";
|
|
3
|
-
import { useNavigate as O } from "react-router";
|
|
4
|
-
import { b as S } from "./context-CaVim6ZO.js";
|
|
5
|
-
import { F as f, e as g } from "./page-YBG0dEN1.js";
|
|
6
|
-
import { useId as j, cloneElement as E, forwardRef as L } from "react";
|
|
7
|
-
const Q = () => {
|
|
8
|
-
const { config: i } = S(), r = O();
|
|
9
|
-
return /* @__PURE__ */ n(f, { children: /* @__PURE__ */ n(
|
|
10
|
-
g,
|
|
11
|
-
{
|
|
12
|
-
status: "not-found",
|
|
13
|
-
title: "页面不存在",
|
|
14
|
-
description: "请检查地址,或返回产品首页继续。",
|
|
15
|
-
extra: /* @__PURE__ */ n(p, { theme: "solid", type: "primary", onClick: () => r(i.routes.publicHome), children: "返回首页" })
|
|
16
|
-
}
|
|
17
|
-
) });
|
|
18
|
-
}, P = "_srOnly_1mfs8_2", R = {
|
|
19
|
-
srOnly: P
|
|
20
|
-
}, U = ({ label: i, children: r }) => {
|
|
21
|
-
const t = j();
|
|
22
|
-
return /* @__PURE__ */ u(z, { children: [
|
|
23
|
-
/* @__PURE__ */ n("span", { id: t, className: R.srOnly, children: i }),
|
|
24
|
-
E(r, { "aria-labelledby": t })
|
|
25
|
-
] });
|
|
26
|
-
}, V = () => /* @__PURE__ */ n(f, { children: /* @__PURE__ */ n("div", { role: "alert", children: /* @__PURE__ */ n(
|
|
27
|
-
g,
|
|
28
|
-
{
|
|
29
|
-
status: "error",
|
|
30
|
-
title: "应用配置暂时无法加载",
|
|
31
|
-
description: "启动检查未通过。请检查运行时配置和网络连接后重新加载。",
|
|
32
|
-
extra: /* @__PURE__ */ n(p, { theme: "solid", type: "primary", onClick: () => window.location.reload(), children: "重新加载" })
|
|
33
|
-
}
|
|
34
|
-
) }) }), B = "_link_1mzr6_2", C = "_danger_1mzr6_28", I = "_warning_1mzr6_33", H = "_icon_1mzr6_38", s = {
|
|
35
|
-
link: B,
|
|
36
|
-
danger: C,
|
|
37
|
-
warning: I,
|
|
38
|
-
icon: H
|
|
39
|
-
}, W = L(function({ href: r, target: t, rel: c, download: _, onClick: a, onKeyDown: l, icon: d, status: m, disabled: o = !1, className: y, style: h, role: k, tabIndex: x, children: w, ...N }, b) {
|
|
40
|
-
const T = [s.link, m === "danger" ? s.danger : m === "warning" ? s.warning : "", y ?? ""].filter(Boolean).join(" "), v = {
|
|
41
|
-
...N,
|
|
42
|
-
ref: b,
|
|
43
|
-
href: r,
|
|
44
|
-
target: t,
|
|
45
|
-
rel: t === "_blank" ? c ?? "noreferrer" : c,
|
|
46
|
-
download: _,
|
|
47
|
-
onClick: o ? void 0 : a,
|
|
48
|
-
onKeyDown: (e) => {
|
|
49
|
-
l == null || l(e), !(e.defaultPrevented || r || o || !a) && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), a(e));
|
|
50
|
-
},
|
|
51
|
-
role: k ?? (r ? void 0 : "button"),
|
|
52
|
-
tabIndex: x ?? (r || o ? void 0 : 0),
|
|
53
|
-
"aria-disabled": o || void 0
|
|
54
|
-
};
|
|
55
|
-
return /* @__PURE__ */ u(F.Text, { link: v, disabled: o, className: T, style: h, children: [
|
|
56
|
-
d ? /* @__PURE__ */ n("span", { className: s.icon, children: d }) : null,
|
|
57
|
-
w
|
|
58
|
-
] });
|
|
59
|
-
});
|
|
60
|
-
export {
|
|
61
|
-
Q as N,
|
|
62
|
-
U as S,
|
|
63
|
-
W as T,
|
|
64
|
-
V as a
|
|
65
|
-
};
|