@24city/web-console 0.3.0 → 0.3.2
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 +16 -1
- package/GUIDELINES.md +3 -1
- package/README.md +20 -3
- package/dist/account/account-menu.d.ts +1 -1
- package/dist/account/allowance-meter.d.ts +21 -0
- package/dist/account/customization.d.ts +9 -0
- package/dist/account/index.d.ts +1 -0
- package/dist/account/index.js +64 -63
- package/dist/chunks/{console-layout-D58Ux9DC.js → console-layout-Os4sQzMP.js} +1 -1
- package/dist/chunks/upgrade-modal-BWnNve0z.js +696 -0
- package/dist/chunks/wallet-badge-Dt8fv-Du.js +575 -0
- package/dist/index.js +197 -196
- package/dist/layout/index.js +1 -1
- package/dist/styles.css +134 -55
- package/dist/testing/guard.js +54 -48
- package/package.json +1 -1
- package/dist/chunks/upgrade-modal-DIINHIt0.js +0 -667
- package/dist/chunks/wallet-badge-n1ASGYJY.js +0 -573
package/dist/styles.css
CHANGED
|
@@ -180,10 +180,11 @@
|
|
|
180
180
|
}
|
|
181
181
|
/*
|
|
182
182
|
* 右上角账号入口,参照蝉镜:顶栏只放 34px 头像(昵称首字的主色渐变圆,会员加金边和小皇冠),
|
|
183
|
-
* 展开 344px 白色卡片:12px 圆角、柔和投影,身份行 → 套餐区(plan-panel.module.css)→
|
|
183
|
+
* 展开 344px 白色卡片:12px 圆角、柔和投影,身份行 → 套餐区(plan-panel.module.css)→ 产品额度(可选,allowance-meter.module.css)
|
|
184
|
+
* → 个人中心 → 退出登录。
|
|
184
185
|
*/
|
|
185
186
|
|
|
186
|
-
.
|
|
187
|
+
._trigger_w6k09_7.semi-button {
|
|
187
188
|
display: inline-flex;
|
|
188
189
|
width: 40px;
|
|
189
190
|
height: 40px;
|
|
@@ -196,48 +197,48 @@
|
|
|
196
197
|
}
|
|
197
198
|
|
|
198
199
|
/* 文字按钮的悬停、按下和展开态:比 Semi 的悬停规则多一个类。 */
|
|
199
|
-
.
|
|
200
|
-
.
|
|
201
|
-
.
|
|
200
|
+
._trigger_w6k09_7.semi-button.semi-button-borderless:not(.semi-button-disabled):hover,
|
|
201
|
+
._trigger_w6k09_7.semi-button.semi-button-borderless:not(.semi-button-disabled):active,
|
|
202
|
+
._trigger_w6k09_7.semi-button[aria-expanded='true'] {
|
|
202
203
|
background: rgba(var(--app-brand-6), 0.08);
|
|
203
204
|
}
|
|
204
205
|
|
|
205
206
|
/* ---------- 头像 ---------- */
|
|
206
207
|
|
|
207
|
-
.
|
|
208
|
+
._avatarWrap_w6k09_28 {
|
|
208
209
|
position: relative;
|
|
209
210
|
display: inline-flex;
|
|
210
211
|
flex: none;
|
|
211
212
|
border-radius: 50%;
|
|
212
213
|
}
|
|
213
214
|
|
|
214
|
-
.
|
|
215
|
+
._avatar_w6k09_28.semi-avatar {
|
|
215
216
|
background: linear-gradient(135deg, rgb(var(--app-brand-4)) 0%, rgb(var(--app-brand-6)) 100%);
|
|
216
217
|
color: var(--semi-color-white);
|
|
217
218
|
font-weight: 600;
|
|
218
219
|
}
|
|
219
220
|
|
|
220
221
|
/* Semi 在头像里的文字上写死了字号(small 是 12px),字号由头像本身决定。 */
|
|
221
|
-
.
|
|
222
|
+
._avatar_w6k09_28 .semi-avatar-label {
|
|
222
223
|
font-size: inherit;
|
|
223
224
|
line-height: 1;
|
|
224
225
|
}
|
|
225
226
|
|
|
226
|
-
.
|
|
227
|
+
._avatarWrap_w6k09_28[data-size='large'] ._avatar_w6k09_28.semi-avatar {
|
|
227
228
|
box-shadow: 0 0 0 2px var(--semi-color-bg-1), 0 0 0 3px rgb(var(--semi-grey-2));
|
|
228
229
|
font-size: 20px;
|
|
229
230
|
}
|
|
230
231
|
|
|
231
|
-
.
|
|
232
|
+
._avatarWrap_w6k09_28[data-size='small'] ._avatar_w6k09_28.semi-avatar {
|
|
232
233
|
font-size: 15px;
|
|
233
234
|
}
|
|
234
235
|
|
|
235
236
|
/* 会员:金色描边 + 右下角小皇冠。 */
|
|
236
|
-
.
|
|
237
|
+
._avatarWrap_w6k09_28[data-member='true'] ._avatar_w6k09_28.semi-avatar {
|
|
237
238
|
box-shadow: 0 0 0 2px var(--semi-color-bg-1), 0 0 0 3.5px rgb(var(--semi-amber-4));
|
|
238
239
|
}
|
|
239
240
|
|
|
240
|
-
.
|
|
241
|
+
._avatarWrap_w6k09_28[data-member='true']::after {
|
|
241
242
|
position: absolute;
|
|
242
243
|
right: -3px;
|
|
243
244
|
bottom: -2px;
|
|
@@ -249,7 +250,7 @@
|
|
|
249
250
|
content: '';
|
|
250
251
|
}
|
|
251
252
|
|
|
252
|
-
.
|
|
253
|
+
._avatarWrap_w6k09_28[data-size='large'][data-member='true']::after {
|
|
253
254
|
width: 20px;
|
|
254
255
|
height: 20px;
|
|
255
256
|
background-size: 14px;
|
|
@@ -257,7 +258,7 @@
|
|
|
257
258
|
|
|
258
259
|
/* ---------- 卡片 ---------- */
|
|
259
260
|
|
|
260
|
-
.
|
|
261
|
+
._card_w6k09_81 {
|
|
261
262
|
width: 344px;
|
|
262
263
|
max-height: calc(100dvh - 76px);
|
|
263
264
|
overflow-y: auto;
|
|
@@ -267,7 +268,7 @@
|
|
|
267
268
|
box-shadow: 0 0 1px rgba(var(--app-shadow-color), 0.2), 0 12px 32px rgba(var(--app-shadow-color), 0.12);
|
|
268
269
|
}
|
|
269
270
|
|
|
270
|
-
.
|
|
271
|
+
._identity_w6k09_91 {
|
|
271
272
|
display: flex;
|
|
272
273
|
min-width: 0;
|
|
273
274
|
align-items: center;
|
|
@@ -275,7 +276,7 @@
|
|
|
275
276
|
padding: 0 4px;
|
|
276
277
|
}
|
|
277
278
|
|
|
278
|
-
.
|
|
279
|
+
._who_w6k09_99 {
|
|
279
280
|
display: flex;
|
|
280
281
|
min-width: 0;
|
|
281
282
|
flex: 1;
|
|
@@ -284,14 +285,14 @@
|
|
|
284
285
|
gap: 4px;
|
|
285
286
|
}
|
|
286
287
|
|
|
287
|
-
.
|
|
288
|
+
._nameRow_w6k09_108 {
|
|
288
289
|
display: flex;
|
|
289
290
|
max-width: 100%;
|
|
290
291
|
align-items: center;
|
|
291
292
|
gap: 6px;
|
|
292
293
|
}
|
|
293
294
|
|
|
294
|
-
.
|
|
295
|
+
._name_w6k09_108 {
|
|
295
296
|
overflow: hidden;
|
|
296
297
|
color: var(--semi-color-text-0);
|
|
297
298
|
font-size: var(--app-font-size-h6);
|
|
@@ -301,7 +302,7 @@
|
|
|
301
302
|
white-space: nowrap;
|
|
302
303
|
}
|
|
303
304
|
|
|
304
|
-
.
|
|
305
|
+
._planChip_w6k09_125 {
|
|
305
306
|
display: inline-flex;
|
|
306
307
|
height: 20px;
|
|
307
308
|
flex: none;
|
|
@@ -315,23 +316,23 @@
|
|
|
315
316
|
white-space: nowrap;
|
|
316
317
|
}
|
|
317
318
|
|
|
318
|
-
.
|
|
319
|
+
._planChip_w6k09_125[data-tone='free'] {
|
|
319
320
|
background: var(--semi-color-fill-1);
|
|
320
321
|
color: var(--semi-color-text-2);
|
|
321
322
|
}
|
|
322
323
|
|
|
323
|
-
.
|
|
324
|
+
._planChip_w6k09_125[data-tone='member'] {
|
|
324
325
|
padding-left: 4px;
|
|
325
326
|
background: linear-gradient(90deg, rgb(var(--semi-amber-1)), rgb(var(--semi-amber-3)));
|
|
326
327
|
color: rgb(var(--semi-amber-9));
|
|
327
328
|
}
|
|
328
329
|
|
|
329
|
-
.
|
|
330
|
+
._planChip_w6k09_125[data-tone='warning'] {
|
|
330
331
|
background: rgb(var(--semi-orange-0));
|
|
331
332
|
color: rgb(var(--semi-orange-6));
|
|
332
333
|
}
|
|
333
334
|
|
|
334
|
-
.
|
|
335
|
+
._diamond_w6k09_155 {
|
|
335
336
|
width: 14px;
|
|
336
337
|
height: 14px;
|
|
337
338
|
background: url('./assets/diamond-BuDSsnw-.webp') center / contain no-repeat;
|
|
@@ -339,8 +340,8 @@
|
|
|
339
340
|
|
|
340
341
|
/* 当前空间:一行小字,多个空间时整行是按钮,点开在下面列出空间。
|
|
341
342
|
卡片里的文字按钮都写成“.card .x:global(.semi-button.semi-button-borderless)”,悬停时比 Semi 文字按钮的悬停规则多一个类。 */
|
|
342
|
-
.
|
|
343
|
-
.
|
|
343
|
+
._card_w6k09_81 ._spaceToggle_w6k09_163.semi-button.semi-button-borderless,
|
|
344
|
+
._spaceStatic_w6k09_164 {
|
|
344
345
|
display: inline-flex;
|
|
345
346
|
max-width: 100%;
|
|
346
347
|
height: 22px;
|
|
@@ -354,26 +355,26 @@
|
|
|
354
355
|
font-weight: 400;
|
|
355
356
|
}
|
|
356
357
|
|
|
357
|
-
.
|
|
358
|
-
.
|
|
359
|
-
.
|
|
358
|
+
._card_w6k09_81 ._spaceToggle_w6k09_163.semi-button.semi-button-borderless:hover,
|
|
359
|
+
._card_w6k09_81 ._spaceToggle_w6k09_163.semi-button.semi-button-borderless:active,
|
|
360
|
+
._card_w6k09_81 ._spaceToggle_w6k09_163.semi-button.semi-button-borderless[aria-expanded='true'] {
|
|
360
361
|
background: var(--semi-color-fill-1);
|
|
361
362
|
color: var(--semi-color-text-1);
|
|
362
363
|
}
|
|
363
364
|
|
|
364
|
-
.
|
|
365
|
+
._spaceSwitchText_w6k09_185 {
|
|
365
366
|
flex: none;
|
|
366
367
|
margin-left: 2px;
|
|
367
368
|
color: rgb(var(--app-brand-6));
|
|
368
369
|
}
|
|
369
370
|
|
|
370
|
-
.
|
|
371
|
+
._spaceName_w6k09_191 {
|
|
371
372
|
overflow: hidden;
|
|
372
373
|
text-overflow: ellipsis;
|
|
373
374
|
white-space: nowrap;
|
|
374
375
|
}
|
|
375
376
|
|
|
376
|
-
.
|
|
377
|
+
._spaceType_w6k09_197 {
|
|
377
378
|
flex: none;
|
|
378
379
|
padding: 0 5px;
|
|
379
380
|
border-radius: 4px;
|
|
@@ -383,7 +384,7 @@
|
|
|
383
384
|
line-height: 16px;
|
|
384
385
|
}
|
|
385
386
|
|
|
386
|
-
.
|
|
387
|
+
._spaceList_w6k09_207 {
|
|
387
388
|
display: flex;
|
|
388
389
|
flex-direction: column;
|
|
389
390
|
margin-top: 12px;
|
|
@@ -392,7 +393,7 @@
|
|
|
392
393
|
border-radius: 10px;
|
|
393
394
|
}
|
|
394
395
|
|
|
395
|
-
.
|
|
396
|
+
._card_w6k09_81 ._spaceOption_w6k09_216.semi-button.semi-button-borderless {
|
|
396
397
|
display: flex;
|
|
397
398
|
height: 36px;
|
|
398
399
|
align-items: center;
|
|
@@ -404,35 +405,44 @@
|
|
|
404
405
|
font-weight: 400;
|
|
405
406
|
}
|
|
406
407
|
|
|
407
|
-
.
|
|
408
|
-
.
|
|
408
|
+
._card_w6k09_81 ._spaceOption_w6k09_216.semi-button.semi-button-borderless:hover,
|
|
409
|
+
._card_w6k09_81 ._spaceOption_w6k09_216.semi-button.semi-button-borderless:active {
|
|
409
410
|
background: var(--semi-color-fill-1);
|
|
410
411
|
color: var(--semi-color-text-0);
|
|
411
412
|
}
|
|
412
413
|
|
|
413
|
-
.
|
|
414
|
+
._card_w6k09_81 ._spaceOption_w6k09_216.semi-button.semi-button-borderless[aria-current='true'] {
|
|
414
415
|
color: rgb(var(--app-brand-6));
|
|
415
416
|
}
|
|
416
417
|
|
|
417
|
-
.
|
|
418
|
+
._spaceCheck_w6k09_238 {
|
|
418
419
|
display: inline-flex;
|
|
419
420
|
width: 20px;
|
|
420
421
|
flex: none;
|
|
421
422
|
}
|
|
422
423
|
|
|
423
|
-
.
|
|
424
|
+
._plan_w6k09_125 {
|
|
424
425
|
margin-top: 16px;
|
|
425
426
|
}
|
|
426
427
|
|
|
428
|
+
/* 产品额度:产品组件返回 null 时这一格是空的,不留间距。 */
|
|
429
|
+
._allowance_w6k09_249 {
|
|
430
|
+
margin-top: 8px;
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
._allowance_w6k09_249:empty {
|
|
434
|
+
display: none;
|
|
435
|
+
}
|
|
436
|
+
|
|
427
437
|
/* ---------- 个人中心与退出 ---------- */
|
|
428
438
|
|
|
429
|
-
.
|
|
439
|
+
._links_w6k09_259 {
|
|
430
440
|
display: flex;
|
|
431
441
|
flex-direction: column;
|
|
432
442
|
margin-top: 8px;
|
|
433
443
|
}
|
|
434
444
|
|
|
435
|
-
.
|
|
445
|
+
._card_w6k09_81 ._link_w6k09_259.semi-button.semi-button-borderless {
|
|
436
446
|
display: flex;
|
|
437
447
|
height: 44px;
|
|
438
448
|
align-items: center;
|
|
@@ -445,49 +455,49 @@
|
|
|
445
455
|
font-weight: 400;
|
|
446
456
|
}
|
|
447
457
|
|
|
448
|
-
.
|
|
458
|
+
._card_w6k09_81 ._link_w6k09_259 .semi-button-content {
|
|
449
459
|
display: flex;
|
|
450
460
|
width: 100%;
|
|
451
461
|
align-items: center;
|
|
452
462
|
gap: 10px;
|
|
453
463
|
}
|
|
454
464
|
|
|
455
|
-
.
|
|
456
|
-
.
|
|
465
|
+
._card_w6k09_81 ._link_w6k09_259.semi-button.semi-button-borderless:hover,
|
|
466
|
+
._card_w6k09_81 ._link_w6k09_259.semi-button.semi-button-borderless:active {
|
|
457
467
|
background: var(--semi-color-fill-1);
|
|
458
468
|
color: var(--semi-color-text-0);
|
|
459
469
|
}
|
|
460
470
|
|
|
461
|
-
.
|
|
462
|
-
.
|
|
471
|
+
._card_w6k09_81 ._link_w6k09_259.semi-button.semi-button-borderless[aria-current='page'],
|
|
472
|
+
._card_w6k09_81 ._link_w6k09_259.semi-button.semi-button-borderless[aria-current='page']:hover {
|
|
463
473
|
background: rgb(var(--app-brand-1));
|
|
464
474
|
color: rgb(var(--app-brand-6));
|
|
465
475
|
}
|
|
466
476
|
|
|
467
|
-
.
|
|
477
|
+
._linkIcon_w6k09_297 {
|
|
468
478
|
display: inline-flex;
|
|
469
479
|
flex: none;
|
|
470
480
|
color: var(--semi-color-text-2);
|
|
471
481
|
font-size: 16px;
|
|
472
482
|
}
|
|
473
483
|
|
|
474
|
-
.
|
|
484
|
+
._card_w6k09_81 ._link_w6k09_259.semi-button.semi-button-borderless[aria-current='page'] ._linkIcon_w6k09_297 {
|
|
475
485
|
color: rgb(var(--app-brand-6));
|
|
476
486
|
}
|
|
477
487
|
|
|
478
|
-
.
|
|
488
|
+
._linkLabel_w6k09_308 {
|
|
479
489
|
flex: 1;
|
|
480
490
|
text-align: left;
|
|
481
491
|
}
|
|
482
492
|
|
|
483
|
-
.
|
|
493
|
+
._linkArrow_w6k09_313 {
|
|
484
494
|
flex: none;
|
|
485
495
|
color: var(--semi-color-text-3);
|
|
486
496
|
font-size: 12px;
|
|
487
497
|
}
|
|
488
498
|
|
|
489
499
|
/* 外观(颜色模式)一行:与上面的菜单项同高同边距,右侧是分段选择;产品没开放暗色时不出现。 */
|
|
490
|
-
.
|
|
500
|
+
._appearance_w6k09_320 {
|
|
491
501
|
display: flex;
|
|
492
502
|
height: 44px;
|
|
493
503
|
align-items: center;
|
|
@@ -497,13 +507,13 @@
|
|
|
497
507
|
font-size: var(--app-font-size-body);
|
|
498
508
|
}
|
|
499
509
|
|
|
500
|
-
.
|
|
510
|
+
._divider_w6k09_330 {
|
|
501
511
|
height: 1px;
|
|
502
512
|
margin: 4px 0;
|
|
503
513
|
background: var(--semi-color-fill-1);
|
|
504
514
|
}
|
|
505
515
|
|
|
506
|
-
.
|
|
516
|
+
._card_w6k09_81 ._logout_w6k09_336.semi-button.semi-button-borderless {
|
|
507
517
|
height: 44px;
|
|
508
518
|
border-radius: 8px;
|
|
509
519
|
color: rgb(var(--semi-red-5));
|
|
@@ -511,14 +521,14 @@
|
|
|
511
521
|
font-weight: 400;
|
|
512
522
|
}
|
|
513
523
|
|
|
514
|
-
.
|
|
515
|
-
.
|
|
524
|
+
._card_w6k09_81 ._logout_w6k09_336.semi-button.semi-button-borderless:hover,
|
|
525
|
+
._card_w6k09_81 ._logout_w6k09_336.semi-button.semi-button-borderless:active {
|
|
516
526
|
background: rgb(var(--semi-red-0));
|
|
517
527
|
color: rgb(var(--semi-red-5));
|
|
518
528
|
}
|
|
519
529
|
|
|
520
530
|
@media (max-width: 576px) {
|
|
521
|
-
.
|
|
531
|
+
._card_w6k09_81 {
|
|
522
532
|
width: calc(100vw - 24px);
|
|
523
533
|
}
|
|
524
534
|
}
|
|
@@ -2173,6 +2183,67 @@
|
|
|
2173
2183
|
justify-content: space-between;
|
|
2174
2184
|
}
|
|
2175
2185
|
}
|
|
2186
|
+
/*
|
|
2187
|
+
* 账号卡片里的一条额度(AllowanceMeter):浅灰圆角块,名称与“已用 80/120 秒”一行,下面是 6px 进度条和一句说明。
|
|
2188
|
+
* 进度条平时用强调色(--app-strong-bg,与卡片里的黑色主按钮同一套),用满或先用不了时进度条和数字变橙色;不用品牌主色,
|
|
2189
|
+
* 否则橙色系品牌(如 AdFlow)的“还有”和“用完”分不出来。读不到时数字变灰。两种颜色模式下都成立。
|
|
2190
|
+
*/
|
|
2191
|
+
|
|
2192
|
+
._meter_o7x3q_7 {
|
|
2193
|
+
display: flex;
|
|
2194
|
+
flex-direction: column;
|
|
2195
|
+
gap: 8px;
|
|
2196
|
+
padding: 12px 16px;
|
|
2197
|
+
border-radius: 12px;
|
|
2198
|
+
background: var(--semi-color-fill-0);
|
|
2199
|
+
}
|
|
2200
|
+
|
|
2201
|
+
._head_o7x3q_16 {
|
|
2202
|
+
display: flex;
|
|
2203
|
+
min-width: 0;
|
|
2204
|
+
align-items: baseline;
|
|
2205
|
+
justify-content: space-between;
|
|
2206
|
+
gap: 12px;
|
|
2207
|
+
}
|
|
2208
|
+
|
|
2209
|
+
._label_o7x3q_24 {
|
|
2210
|
+
overflow: hidden;
|
|
2211
|
+
color: var(--semi-color-text-1);
|
|
2212
|
+
font-size: var(--app-font-size-compact);
|
|
2213
|
+
line-height: 20px;
|
|
2214
|
+
text-overflow: ellipsis;
|
|
2215
|
+
white-space: nowrap;
|
|
2216
|
+
}
|
|
2217
|
+
|
|
2218
|
+
._value_o7x3q_33 {
|
|
2219
|
+
flex: none;
|
|
2220
|
+
color: var(--semi-color-text-0);
|
|
2221
|
+
font-size: var(--app-font-size-compact);
|
|
2222
|
+
font-variant-numeric: tabular-nums;
|
|
2223
|
+
font-weight: 500;
|
|
2224
|
+
line-height: 20px;
|
|
2225
|
+
white-space: nowrap;
|
|
2226
|
+
}
|
|
2227
|
+
|
|
2228
|
+
._value_o7x3q_33[data-tone='warning'] {
|
|
2229
|
+
color: var(--semi-color-warning);
|
|
2230
|
+
}
|
|
2231
|
+
|
|
2232
|
+
._value_o7x3q_33[data-tone='muted'] {
|
|
2233
|
+
color: var(--semi-color-text-2);
|
|
2234
|
+
font-weight: 400;
|
|
2235
|
+
}
|
|
2236
|
+
|
|
2237
|
+
/* Semi 的横向进度条自带上下 4px 外边距,间距由 .meter 的 gap 统一给。 */
|
|
2238
|
+
._meter_o7x3q_7 ._bar_o7x3q_53.semi-progress-horizontal {
|
|
2239
|
+
margin: 0;
|
|
2240
|
+
}
|
|
2241
|
+
|
|
2242
|
+
._note_o7x3q_57 {
|
|
2243
|
+
color: var(--semi-color-text-2);
|
|
2244
|
+
font-size: var(--app-font-size-caption);
|
|
2245
|
+
line-height: 18px;
|
|
2246
|
+
}
|
|
2176
2247
|
/* 套餐数量胶囊:白底细边,满了换成暖金底并带“升级”文字按钮。 */
|
|
2177
2248
|
._pill_1hckq_2 {
|
|
2178
2249
|
display: inline-flex;
|
|
@@ -4880,6 +4951,14 @@ body .semi-sidesheet-header {
|
|
|
4880
4951
|
border-bottom-color: var(--app-border-1);
|
|
4881
4952
|
}
|
|
4882
4953
|
|
|
4954
|
+
/*
|
|
4955
|
+
* 没有标题也没有关闭按钮时,Semi 仍然渲染一个空头部(上下内边距 24px + 20px),抽屉顶上平白空出 44px;
|
|
4956
|
+
* 内层透明、自己画面板的抽屉(如 AdFlow 的素材详情)会在这里露出遮罩。空的就不显示。
|
|
4957
|
+
*/
|
|
4958
|
+
body .semi-sidesheet-header:empty {
|
|
4959
|
+
display: none;
|
|
4960
|
+
}
|
|
4961
|
+
|
|
4883
4962
|
body .semi-sidesheet-title {
|
|
4884
4963
|
color: var(--semi-color-text-0);
|
|
4885
4964
|
font-size: var(--app-font-size-h6);
|
package/dist/testing/guard.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { readFileSync as
|
|
2
|
-
import { relative as
|
|
3
|
-
import { D as
|
|
4
|
-
const
|
|
5
|
-
peerDependencies:
|
|
6
|
-
},
|
|
1
|
+
import { readFileSync as f, readdirSync as L, statSync as _ } from "node:fs";
|
|
2
|
+
import { relative as y, join as v } from "node:path";
|
|
3
|
+
import { D as x, F as N, B as O } from "../chunks/scale-smFifpMm.js";
|
|
4
|
+
const C = { "@douyinfe/semi-ui": "2.104.0" }, D = {
|
|
5
|
+
peerDependencies: C
|
|
6
|
+
}, R = /<(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|>|\/)/, T = [
|
|
7
7
|
"lucide-react",
|
|
8
8
|
"@nuwa/customer-ui",
|
|
9
9
|
"@nuwa/customer-shell",
|
|
@@ -15,43 +15,49 @@ const O = { "@douyinfe/semi-ui": "2.104.0" }, C = {
|
|
|
15
15
|
".arco-",
|
|
16
16
|
"@douyinfe/semi-ui/dist/css",
|
|
17
17
|
"theme-mode"
|
|
18
|
-
],
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
], w = ["--semi-", "--app-"], F = /#(?:[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{;'"])(${w.map((s) => s.replace(/-/g, "\\-")).join("|")})[a-z0-9_-]*\\s*['"]?\\s*:`, "m"), W = /<IconSpin\b([^>]*)>/g, j = (s) => {
|
|
19
|
+
for (const i of s.matchAll(W))
|
|
20
|
+
if (!/(?:^|\s)spin(?=[\s=/]|$)/.test(i[1])) return i[0];
|
|
21
|
+
return null;
|
|
22
|
+
}, h = (s) => L(s).flatMap((i) => {
|
|
23
|
+
const e = v(s, i);
|
|
24
|
+
return _(e).isDirectory() ? h(e) : [e];
|
|
25
|
+
}), S = (s) => /\.test\.(ts|tsx)$/.test(s) || s.startsWith("test/") || s.endsWith(".d.ts"), X = ({ sourceRoot: s, exclude: i = S }) => {
|
|
26
|
+
const e = [], r = h(s).map((o) => ({ path: o, file: y(s, o) })).filter(({ file: o }) => !i(o));
|
|
23
27
|
for (const { path: o, file: t } of r) {
|
|
24
28
|
const n = t.endsWith(".tsx");
|
|
25
29
|
if (!/\.(tsx?|css)$/.test(t)) continue;
|
|
26
|
-
const c =
|
|
30
|
+
const c = f(o, "utf8");
|
|
27
31
|
if (n) {
|
|
28
|
-
const m = c.match(
|
|
32
|
+
const m = c.match(R);
|
|
29
33
|
m && e.push({ file: t, rule: "raw-element", detail: `应改用 Semi 组件,而不是 ${m[0].trim()}` }), /className="/.test(c) && e.push({ file: t, rule: "class-string", detail: "className 应引用 CSS Module,不写工具类字符串" });
|
|
34
|
+
const g = j(c);
|
|
35
|
+
g && e.push({ file: t, rule: "static-spinner", detail: `${g} 不会转:Semi 的 IconSpin 要加 spin` });
|
|
30
36
|
}
|
|
31
|
-
for (const m of
|
|
37
|
+
for (const m of T)
|
|
32
38
|
c.includes(m) && e.push({ file: t, rule: "forbidden-import", detail: `不应引用 ${m}` });
|
|
33
|
-
const a = c.match(
|
|
39
|
+
const a = c.match(F);
|
|
34
40
|
a && e.push({ file: t, rule: "color-literal", detail: `含有写死的色值 ${a[0]}` });
|
|
35
|
-
const u = c.match(
|
|
41
|
+
const u = c.match(P);
|
|
36
42
|
u && e.push({ file: t, rule: "color-literal", detail: `含有写死的色值 ${u[0]}` });
|
|
37
|
-
const E = c.match(
|
|
43
|
+
const E = c.match(k);
|
|
38
44
|
E && e.push({ file: t, rule: "reserved-variable", detail: `不得声明主题变量 ${E[1]}…,品牌主色只能通过 runtime-config 的 brand.primaryColor 设置` });
|
|
39
45
|
}
|
|
40
46
|
return e;
|
|
41
|
-
},
|
|
47
|
+
}, M = ["@douyinfe/semi-ui", "@douyinfe/semi-icons", "@douyinfe/semi-illustrations"], z = D.peerDependencies, d = z["@douyinfe/semi-ui"], q = (s) => {
|
|
42
48
|
var r, o;
|
|
43
|
-
const i = JSON.parse(
|
|
44
|
-
for (const t of
|
|
49
|
+
const i = JSON.parse(f(s, "utf8")), e = [];
|
|
50
|
+
for (const t of M) {
|
|
45
51
|
const n = ((r = i.dependencies) == null ? void 0 : r[t]) ?? ((o = i.devDependencies) == null ? void 0 : o[t]);
|
|
46
|
-
!(t === "@douyinfe/semi-ui" || n !== void 0) || n ===
|
|
52
|
+
!(t === "@douyinfe/semi-ui" || n !== void 0) || n === d || e.push({
|
|
47
53
|
file: "package.json",
|
|
48
54
|
rule: "semi-version",
|
|
49
|
-
detail: n ? `${t} 必须精确声明为 ${
|
|
55
|
+
detail: n ? `${t} 必须精确声明为 ${d},现在是 ${n}` : `必须声明 ${t} ${d}`
|
|
50
56
|
});
|
|
51
57
|
}
|
|
52
58
|
return e;
|
|
53
|
-
},
|
|
54
|
-
const i =
|
|
59
|
+
}, G = (s) => {
|
|
60
|
+
const i = f(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);
|
|
55
61
|
return e && r ? [] : [
|
|
56
62
|
{
|
|
57
63
|
file: "vite.config.ts",
|
|
@@ -59,38 +65,38 @@ const O = { "@douyinfe/semi-ui": "2.104.0" }, C = {
|
|
|
59
65
|
detail: "plugins 里要加 semiCssLayer()(import { semiCssLayer } from '@24city/web-console/vite'),把 Semi 的样式放进 semi 层"
|
|
60
66
|
}
|
|
61
67
|
];
|
|
62
|
-
},
|
|
63
|
-
`).length,
|
|
68
|
+
}, A = [...Object.values(N), ...x], b = Object.values(O), $ = (s) => s.replace(/\/\*[\s\S]*?\*\//g, (i) => i.replace(/[^\n]/g, " ")), p = (s, i) => s.slice(0, i).split(`
|
|
69
|
+
`).length, I = (s, i) => h(s).map((e) => ({ path: e, file: y(s, e) })).filter(({ file: e }) => e.endsWith(".css") && !i(e)), H = ({ sourceRoot: s, exclude: i = S }) => {
|
|
64
70
|
const e = [];
|
|
65
|
-
for (const { path: r, file: o } of
|
|
66
|
-
const t =
|
|
71
|
+
for (const { path: r, file: o } of I(s, i)) {
|
|
72
|
+
const t = $(f(r, "utf8"));
|
|
67
73
|
for (const n of t.matchAll(/font-size\s*:\s*(\d+(?:\.\d+)?)px/g))
|
|
68
|
-
|
|
74
|
+
A.includes(Number(n[1])) || e.push({
|
|
69
75
|
file: o,
|
|
70
76
|
line: p(t, n.index),
|
|
71
77
|
rule: "font-size-scale",
|
|
72
|
-
detail: `font-size: ${n[1]}px 不在字号阶梯上(${[...
|
|
78
|
+
detail: `font-size: ${n[1]}px 不在字号阶梯上(${[...A].sort((l, c) => l - c).join("、")})`
|
|
73
79
|
});
|
|
74
80
|
for (const n of t.matchAll(/@media[^{]*/g))
|
|
75
81
|
for (const l of n[0].matchAll(/(min|max)-width\s*:\s*(\d+(?:\.\d+)?)px/g))
|
|
76
|
-
|
|
82
|
+
b.includes(Number(l[2])) || e.push({
|
|
77
83
|
file: o,
|
|
78
84
|
line: p(t, n.index),
|
|
79
85
|
rule: "breakpoint",
|
|
80
|
-
detail: `@media 的 ${l[1]}-width: ${l[2]}px 不是规定的断点(${
|
|
86
|
+
detail: `@media 的 ${l[1]}-width: ${l[2]}px 不是规定的断点(${b.join("、")})`
|
|
81
87
|
});
|
|
82
88
|
}
|
|
83
89
|
return e;
|
|
84
|
-
},
|
|
90
|
+
}, B = /(?:^|[\s>+~])(?::global\(\s*)?\.(semi-[A-Za-z0-9-]+)/, V = /:not\((?:[^()]|\([^()]*\))*\)/g, J = ({ sourceRoot: s, exclude: i = S }) => {
|
|
85
91
|
const e = [];
|
|
86
|
-
for (const { path: r, file: o } of
|
|
87
|
-
const t =
|
|
92
|
+
for (const { path: r, file: o } of I(s, i)) {
|
|
93
|
+
const t = $(f(r, "utf8"));
|
|
88
94
|
for (const n of t.matchAll(/([^{}]+)\{/g)) {
|
|
89
95
|
const l = n[1];
|
|
90
96
|
if (l.trimStart().startsWith("@")) continue;
|
|
91
97
|
let c = 0;
|
|
92
98
|
for (const a of l.split(",")) {
|
|
93
|
-
const u = a.replace(
|
|
99
|
+
const u = a.replace(V, "").trim().match(B);
|
|
94
100
|
u && e.push({
|
|
95
101
|
file: o,
|
|
96
102
|
line: p(t, n.index + c + (a.length - a.trimStart().length)),
|
|
@@ -103,16 +109,16 @@ const O = { "@douyinfe/semi-ui": "2.104.0" }, C = {
|
|
|
103
109
|
return e;
|
|
104
110
|
};
|
|
105
111
|
export {
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
112
|
+
b as ALLOWED_BREAKPOINTS,
|
|
113
|
+
A as ALLOWED_FONT_SIZES,
|
|
114
|
+
d as EXPECTED_SEMI_VERSION,
|
|
115
|
+
T as FORBIDDEN_SNIPPETS,
|
|
116
|
+
R as RAW_ELEMENT_PATTERN,
|
|
117
|
+
w as RESERVED_VARIABLE_PREFIXES,
|
|
118
|
+
M as SEMI_PACKAGES,
|
|
119
|
+
H as checkDesignScale,
|
|
120
|
+
G as checkSemiCssLayer,
|
|
121
|
+
J as checkSemiInternals,
|
|
122
|
+
q as checkSemiVersion,
|
|
123
|
+
X as checkUiLibraryUsage
|
|
118
124
|
};
|