dsh-sidebar-fold 0.1.14 → 0.1.16
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 +15 -1
- package/LICENSE +21 -21
- package/cordis.patch.yml +17 -17
- package/dsh.plugin.json +2 -2
- package/lib/client.js +282 -14
- package/package.json +4 -4
- package/screenshots.json +6 -6
- package/src/client/constants.ts +9 -1
- package/src/client/fold.ts +158 -3
- package/src/client/index.ts +10 -2
- package/src/client/locales.ts +21 -1
- package/src/client/settings-card.ts +95 -27
- package/src/client/star-row-copy.ts +112 -0
- package/src/index.js +13 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.16 (2026-11-27)
|
|
4
|
+
|
|
5
|
+
**侧边栏入口行排序:除「更多」外全部可拖,顺序持久化到 Config。**
|
|
6
|
+
|
|
7
|
+
- `orderLabels`(volatile Config 字段,缺省 `[]` = 宿主 DOM 原序):侧边栏行内 DnD 与设置卡片 DnD 两面共享同一来源与写路径。
|
|
8
|
+
- 新增纯函数 `reorderLabels` / `orderedRows`;`applyFold` 用幂等 `insertBefore` 重排,抗 MutationObserver 自激;「更多」header 恒固定末尾,折叠开关不变。
|
|
9
|
+
- 设置卡入口行加拖柄,drop 后 `commit({orderLabels})`;`index.ts` 把侧栏拖动经 `subscribeOrder` 桥接回同一 scope 落盘。
|
|
10
|
+
- 10 语字典 + locale 元数据同步新增 `settings.rowDrag` / `rowDragHint`;新增 `scripts/check-surface-classes.mjs` 并接进 prepack。
|
|
11
|
+
|
|
12
|
+
## 0.1.15
|
|
13
|
+
|
|
14
|
+
- 设置面新增 star 快车道行(单源 _tools/star-row 生成,10 语;GitHub 单色图标 + 仓库直达链接 + 一句工程话术,整行可点,无弹窗无打断)。
|
|
15
|
+
- 附带 CI 修复:本包无线标签时直接收工,不再空等读侧滞后。
|
|
16
|
+
|
|
3
17
|
## 0.1.14
|
|
4
18
|
|
|
5
19
|
- **CI 发版通道**:新增 `.github/workflows/release.yml`,打 tag 后由 GitHub Actions 依次完成
|
|
@@ -16,4 +30,4 @@
|
|
|
16
30
|
|
|
17
31
|
- 折叠标记落在 panelEntry 包装层,避免与宿主行级 class 冲突(issue #2)。
|
|
18
32
|
- 新增第 10 种 runtime 字典 `pt`(巴西葡萄牙语),locale 文件与门禁同步到 10 种。
|
|
19
|
-
- README.pt.md 镜像翻译,`files[]` 收录。
|
|
33
|
+
- README.pt.md 镜像翻译,`files[]` 收录。
|
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 drscrewdriver
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 drscrewdriver
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/cordis.patch.yml
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
# dsh-sidebar-fold bundle patch
|
|
2
|
-
#
|
|
3
|
-
# Assembly layer for the DSH profiles whose bundle list includes this package.
|
|
4
|
-
# A pure ADDITION: one insert row carrying an id no shipped entry uses. No
|
|
5
|
-
# shipped row is disabled, renamed, or reconfigured here, so the patch stays
|
|
6
|
-
# safe to compose with any other plugin's patch.
|
|
7
|
-
#
|
|
8
|
-
# The row exists so the loader has a host-side entry point (src/index.js, which
|
|
9
|
-
# installs nothing) and so the bundle's settings namespace is served under this
|
|
10
|
-
# package's name; every behaviour lives in the browser half (lib/client.js).
|
|
11
|
-
#
|
|
12
|
-
# Install (recommended, official CLI):
|
|
13
|
-
# dsh plugin --profile <profile> add dsh-sidebar-fold
|
|
14
|
-
|
|
15
|
-
- insert:
|
|
16
|
-
- id: dsh-sidebar-fold
|
|
17
|
-
name: dsh-sidebar-fold
|
|
1
|
+
# dsh-sidebar-fold bundle patch
|
|
2
|
+
#
|
|
3
|
+
# Assembly layer for the DSH profiles whose bundle list includes this package.
|
|
4
|
+
# A pure ADDITION: one insert row carrying an id no shipped entry uses. No
|
|
5
|
+
# shipped row is disabled, renamed, or reconfigured here, so the patch stays
|
|
6
|
+
# safe to compose with any other plugin's patch.
|
|
7
|
+
#
|
|
8
|
+
# The row exists so the loader has a host-side entry point (src/index.js, which
|
|
9
|
+
# installs nothing) and so the bundle's settings namespace is served under this
|
|
10
|
+
# package's name; every behaviour lives in the browser half (lib/client.js).
|
|
11
|
+
#
|
|
12
|
+
# Install (recommended, official CLI):
|
|
13
|
+
# dsh plugin --profile <profile> add dsh-sidebar-fold
|
|
14
|
+
|
|
15
|
+
- insert:
|
|
16
|
+
- id: dsh-sidebar-fold
|
|
17
|
+
name: dsh-sidebar-fold
|
package/dsh.plugin.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "dsh-external/dsh-sidebar-fold",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.16",
|
|
4
4
|
"main": "./src/index.js",
|
|
5
5
|
"description": "折叠左侧栏加项入口:在宿主「更多」行挂一个 28×28 方形箭头按钮,把自动化任务、agent 团队、插件市场、上下文页等加项面板行收纳成一行;设置卡每行三档:显示(一直显示)/ 折叠(允许折叠)/ 隐藏到更多(移进宿主「更多」菜单,宿主 0.2.2 起)。还可调默认态与行内文字图标对齐(左/居中/右)。",
|
|
6
6
|
"engines": {
|
|
@@ -13,4 +13,4 @@
|
|
|
13
13
|
"client": {
|
|
14
14
|
"main": "./lib/client.js"
|
|
15
15
|
}
|
|
16
|
-
}
|
|
16
|
+
}
|
package/lib/client.js
CHANGED
|
@@ -39,6 +39,9 @@ window.__ModuleLoader__.load({
|
|
|
39
39
|
menuRow: 'dshsf-menu-row',
|
|
40
40
|
menuText: 'dshsf-menu-text',
|
|
41
41
|
menuIcon: 'dshsf-menu-icon',
|
|
42
|
+
/** Transient highlight on the row being dragged / targeted. */
|
|
43
|
+
rowDrag: 'dshsf-row-drag',
|
|
44
|
+
rowDragOver: 'dshsf-row-drag-over',
|
|
42
45
|
});
|
|
43
46
|
/**
|
|
44
47
|
* Alignment of a panel row's content (icon + label) inside the row.
|
|
@@ -64,6 +67,8 @@ window.__ModuleLoader__.load({
|
|
|
64
67
|
align: 'data-dshsf-align',
|
|
65
68
|
/** On the toggle: the folded group holds the panel the user is looking at. */
|
|
66
69
|
activeInside: 'data-dshsf-active-inside',
|
|
70
|
+
/** On a panel row we have wired for HTML5 drag-and-drop reordering. */
|
|
71
|
+
dnd: 'data-dshsf-dnd',
|
|
67
72
|
});
|
|
68
73
|
/** Selector fragments (hash-tolerant). */
|
|
69
74
|
const SEL = Object.freeze({
|
|
@@ -304,6 +309,9 @@ window.__ModuleLoader__.load({
|
|
|
304
309
|
'outline-offset:-2px',
|
|
305
310
|
]),
|
|
306
311
|
rule(`.${CLS.menuText}`, ['overflow:hidden', 'text-overflow:ellipsis', 'white-space:nowrap']),
|
|
312
|
+
// Row drag feedback — opacity on the source, a token-tinted outline on the target.
|
|
313
|
+
rule(`.${CLS.rowDrag}`, ['opacity:.45']),
|
|
314
|
+
rule(`.${CLS.rowDragOver}`, ['outline:2px solid var(--dsw-alias-state-business-primary,#4d6bfe)', 'outline-offset:-2px']),
|
|
307
315
|
rule(`.${CLS.menuIcon}`, ['flex:none', 'display:block']),
|
|
308
316
|
].join('');
|
|
309
317
|
/**
|
|
@@ -324,6 +332,8 @@ window.__ModuleLoader__.load({
|
|
|
324
332
|
'settings.defaultFoldedHint': '新窗口在没有本地记录时采用的初始状态',
|
|
325
333
|
'settings.rows': '入口行',
|
|
326
334
|
'settings.rowsHint': '每行三档:显示=一直显示;折叠=允许折叠;隐藏到更多=移进「更多」菜单。',
|
|
335
|
+
'settings.rowDrag': '拖动入口行可排序(「更多」固定末尾)',
|
|
336
|
+
'settings.rowDragHint': '按住入口行拖到目标位置,顺序会保存到设置。',
|
|
327
337
|
'settings.rowAlways': '显示',
|
|
328
338
|
'settings.rowFold': '折叠',
|
|
329
339
|
'settings.rowMore': '隐藏到更多',
|
|
@@ -351,6 +361,8 @@ window.__ModuleLoader__.load({
|
|
|
351
361
|
'settings.defaultFoldedHint': 'Initial state for a window with no local record yet',
|
|
352
362
|
'settings.rows': 'Entries',
|
|
353
363
|
'settings.rowsHint': 'Three states per row: Show keeps it visible, Fold lets the fold hide it, Hide in More moves it into the “More” menu.',
|
|
364
|
+
'settings.rowDrag': 'Drag entry rows to reorder (“More” stays last)',
|
|
365
|
+
'settings.rowDragHint': 'Drag a row onto another to reorder; the order is saved to settings.',
|
|
354
366
|
'settings.rowAlways': 'Show',
|
|
355
367
|
'settings.rowFold': 'Fold',
|
|
356
368
|
'settings.rowMore': 'Hide in More',
|
|
@@ -378,6 +390,8 @@ window.__ModuleLoader__.load({
|
|
|
378
390
|
'settings.defaultFoldedHint': 'ローカル記録がないウィンドウの初期状態',
|
|
379
391
|
'settings.rows': '項目',
|
|
380
392
|
'settings.rowsHint': '行ごとに3段階:表示=常に表示、折りたたみ=折りたたみ可、「その他」へ隠す=「その他」メニューへ移動。',
|
|
393
|
+
'settings.rowDrag': '項目行をドラッグして並べ替え(「その他」は末尾固定)',
|
|
394
|
+
'settings.rowDragHint': '行を別の行へドラッグすると並びが変わり、設定に保存されます。',
|
|
381
395
|
'settings.rowAlways': '表示',
|
|
382
396
|
'settings.rowFold': '折りたたみ',
|
|
383
397
|
'settings.rowMore': '「その他」へ隠す',
|
|
@@ -405,6 +419,8 @@ window.__ModuleLoader__.load({
|
|
|
405
419
|
'settings.defaultFoldedHint': '로컬 기록이 없는 창의 초기 상태',
|
|
406
420
|
'settings.rows': '항목',
|
|
407
421
|
'settings.rowsHint': '행마다 3단계: 표시=항상 표시, 접기=접기 허용, 더 보기에 숨기기=“더 보기” 메뉴로 이동.',
|
|
422
|
+
'settings.rowDrag': '항목 행을 끌어 순서 변경 (“더 보기”는 항상 마지막)',
|
|
423
|
+
'settings.rowDragHint': '행을 다른 행으로 끌어 순서를 바꾸면 설정에 저장됩니다.',
|
|
408
424
|
'settings.rowAlways': '표시',
|
|
409
425
|
'settings.rowFold': '접기',
|
|
410
426
|
'settings.rowMore': '더 보기에 숨기기',
|
|
@@ -432,6 +448,8 @@ window.__ModuleLoader__.load({
|
|
|
432
448
|
'settings.defaultFoldedHint': 'État initial d’une fenêtre sans enregistrement local',
|
|
433
449
|
'settings.rows': 'Entrées',
|
|
434
450
|
'settings.rowsHint': 'Trois états par ligne : Afficher la garde visible, Replier laisse le repli la masquer, Masquer dans « Plus » la déplace dans le menu « Plus ».',
|
|
451
|
+
'settings.rowDrag': 'Faites glisser les lignes pour réordonner (« Plus » reste en fin)',
|
|
452
|
+
'settings.rowDragHint': 'Glissez une ligne sur une autre pour changer l’ordre ; il est enregistré dans les réglages.',
|
|
435
453
|
'settings.rowAlways': 'Afficher',
|
|
436
454
|
'settings.rowFold': 'Replier',
|
|
437
455
|
'settings.rowMore': 'Masquer dans « Plus »',
|
|
@@ -459,6 +477,8 @@ window.__ModuleLoader__.load({
|
|
|
459
477
|
'settings.defaultFoldedHint': 'Anfangszustand eines Fensters ohne lokalen Eintrag',
|
|
460
478
|
'settings.rows': 'Einträge',
|
|
461
479
|
'settings.rowsHint': 'Drei Zustände pro Zeile: Anzeigen bleibt sichtbar, Einklappen lässt die Zeile verschwinden, In „Mehr“ ausblenden verschiebt sie in das Menü „Mehr“.',
|
|
480
|
+
'settings.rowDrag': 'Zeilen zum Neuanordnen ziehen („Mehr“ bleibt am Ende)',
|
|
481
|
+
'settings.rowDragHint': 'Ziehen Sie eine Zeile auf eine andere; die Reihenfolge wird in den Einstellungen gespeichert.',
|
|
462
482
|
'settings.rowAlways': 'Anzeigen',
|
|
463
483
|
'settings.rowFold': 'Einklappen',
|
|
464
484
|
'settings.rowMore': 'In „Mehr“ ausblenden',
|
|
@@ -486,6 +506,8 @@ window.__ModuleLoader__.load({
|
|
|
486
506
|
'settings.defaultFoldedHint': 'Stato iniziale di una finestra senza record locale',
|
|
487
507
|
'settings.rows': 'Voci',
|
|
488
508
|
'settings.rowsHint': 'Tre stati per riga: Mostra resta visibile, Comprimi lascia che la compressione la nasconda, Nascondi in «Altro» la sposta nel menu «Altro».',
|
|
509
|
+
'settings.rowDrag': 'Trascina le righe per riordinarle («Altro» resta in fondo)',
|
|
510
|
+
'settings.rowDragHint': 'Trascina una riga su un’altra per cambiare l’ordine, salvato nelle impostazioni.',
|
|
489
511
|
'settings.rowAlways': 'Mostra',
|
|
490
512
|
'settings.rowFold': 'Comprimi',
|
|
491
513
|
'settings.rowMore': 'Nascondi in «Altro»',
|
|
@@ -513,6 +535,8 @@ window.__ModuleLoader__.load({
|
|
|
513
535
|
'settings.defaultFoldedHint': 'Начальное состояние окна без локальной записи',
|
|
514
536
|
'settings.rows': 'Пункты',
|
|
515
537
|
'settings.rowsHint': 'Три состояния на строку: Показывать оставляет её видимой, Сворачивать позволяет её скрыть, Скрыть в «Ещё» переносит её в меню «Ещё».',
|
|
538
|
+
'settings.rowDrag': 'Перетаскивайте строки для изменения порядка («Ещё» всегда последняя)',
|
|
539
|
+
'settings.rowDragHint': 'Перетащите строку на другую — порядок сохранится в настройках.',
|
|
516
540
|
'settings.rowAlways': 'Показывать',
|
|
517
541
|
'settings.rowFold': 'Сворачивать',
|
|
518
542
|
'settings.rowMore': 'Скрыть в «Ещё»',
|
|
@@ -540,6 +564,8 @@ window.__ModuleLoader__.load({
|
|
|
540
564
|
'settings.defaultFoldedHint': 'Estado inicial de una ventana sin registro local',
|
|
541
565
|
'settings.rows': 'Entradas',
|
|
542
566
|
'settings.rowsHint': 'Tres estados por fila: Mostrar la mantiene visible, Plegar deja que el pliegue la oculte, Ocultar en «Más» la mueve al menú «Más».',
|
|
567
|
+
'settings.rowDrag': 'Arrastre las filas para reordenar («Más» siempre al final)',
|
|
568
|
+
'settings.rowDragHint': 'Arrastre una fila sobre otra para cambiar el orden; se guarda en los ajustes.',
|
|
543
569
|
'settings.rowAlways': 'Mostrar',
|
|
544
570
|
'settings.rowFold': 'Plegar',
|
|
545
571
|
'settings.rowMore': 'Ocultar en «Más»',
|
|
@@ -568,6 +594,8 @@ window.__ModuleLoader__.load({
|
|
|
568
594
|
'settings.defaultFoldedHint': 'Estado inicial de uma janela sem registro local',
|
|
569
595
|
'settings.rows': 'Entradas',
|
|
570
596
|
'settings.rowsHint': 'Três estados por linha: Mostrar mantém a linha sempre visível; Recolher permite o recolhimento; Ocultar em «Mais» move a linha para o menu «Mais».',
|
|
597
|
+
'settings.rowDrag': 'Arraste as linhas para reordenar («Mais» fica no fim)',
|
|
598
|
+
'settings.rowDragHint': 'Arraste uma linha para outra para mudar a ordem; ela é salva nas configurações.',
|
|
571
599
|
'settings.rowAlways': 'Mostrar',
|
|
572
600
|
'settings.rowFold': 'Recolher',
|
|
573
601
|
'settings.rowMore': 'Ocultar em «Mais»',
|
|
@@ -653,7 +681,7 @@ window.__ModuleLoader__.load({
|
|
|
653
681
|
/** Whether the group is folded; `null` = never decided in this window yet. */
|
|
654
682
|
let folded = null;
|
|
655
683
|
/** Last config the fold was applied with (also read by the settings card). */
|
|
656
|
-
let config = { defaultFolded: false, keepLabels: [], hideLabels: [], align: 'start' };
|
|
684
|
+
let config = { defaultFolded: false, keepLabels: [], hideLabels: [], align: 'start', orderLabels: [] };
|
|
657
685
|
/** Registered so `index.ts` can notify the fold after a settings write. */
|
|
658
686
|
const configListeners = new Set();
|
|
659
687
|
/**
|
|
@@ -786,6 +814,48 @@ window.__ModuleLoader__.load({
|
|
|
786
814
|
* `_panelRow` button. Returns `null` when nothing matches — the caller then
|
|
787
815
|
* leaves the sidebar exactly as shipped.
|
|
788
816
|
*/
|
|
817
|
+
/**
|
|
818
|
+
* Move one label to another label's position in an ordered label list.
|
|
819
|
+
*
|
|
820
|
+
* Pure and case-sensitive by label identity: unknown labels leave the list
|
|
821
|
+
* untouched. Used both by the sidebar DnD and by the settings card so both
|
|
822
|
+
* surfaces compute the next order through one function.
|
|
823
|
+
*/
|
|
824
|
+
function reorderLabels(labels, fromLabel, toLabel) {
|
|
825
|
+
const from = labels.indexOf(fromLabel);
|
|
826
|
+
const to = labels.indexOf(toLabel);
|
|
827
|
+
if (from < 0 || to < 0 || from === to)
|
|
828
|
+
return [...labels];
|
|
829
|
+
const next = [...labels];
|
|
830
|
+
const [moved] = next.splice(from, 1);
|
|
831
|
+
next.splice(to, 0, moved);
|
|
832
|
+
return next;
|
|
833
|
+
}
|
|
834
|
+
/**
|
|
835
|
+
* Arrange live panel rows into the persisted label order.
|
|
836
|
+
*
|
|
837
|
+
* Rows whose label is absent from `orderLabels` are appended in their current
|
|
838
|
+
* DOM order, so a config written before a row existed never loses that row.
|
|
839
|
+
* The "More" header (aria-haspopup="menu", or the last row as fallback) is
|
|
840
|
+
* always forced to the end — it is the fold toggle and must stay put.
|
|
841
|
+
*/
|
|
842
|
+
function orderedRows(rows, orderLabels) {
|
|
843
|
+
if (rows.length < 2)
|
|
844
|
+
return [...rows];
|
|
845
|
+
const header = rows.find((row) => row.getAttribute('aria-haspopup') === 'menu') ?? rows[rows.length - 1];
|
|
846
|
+
const body = rows.filter((row) => row !== header);
|
|
847
|
+
const rank = (row) => {
|
|
848
|
+
const label = labelOf(row);
|
|
849
|
+
const idx = orderLabels.indexOf(label);
|
|
850
|
+
return idx < 0 ? Number.MAX_SAFE_INTEGER : idx;
|
|
851
|
+
};
|
|
852
|
+
// Stable sort: unknown labels keep their relative DOM order.
|
|
853
|
+
const sorted = body
|
|
854
|
+
.map((row, index) => ({ row, index, r: rank(row) }))
|
|
855
|
+
.sort((a, b) => (a.r - b.r) || (a.index - b.index))
|
|
856
|
+
.map((entry) => entry.row);
|
|
857
|
+
return [...sorted, header];
|
|
858
|
+
}
|
|
789
859
|
function findPanelNav(root) {
|
|
790
860
|
for (const label of PANELS_LABELS) {
|
|
791
861
|
const byLabel = root.querySelector(`nav[aria-label="${label}"]`);
|
|
@@ -1195,6 +1265,112 @@ window.__ModuleLoader__.load({
|
|
|
1195
1265
|
return;
|
|
1196
1266
|
anchor.click();
|
|
1197
1267
|
}
|
|
1268
|
+
// --- Row reorder (HTML5 DnD on the live sidebar rows) -----------------------
|
|
1269
|
+
/** Registered by index.ts / the settings card to learn when a sidebar drag commits a new order. */
|
|
1270
|
+
const orderListeners = new Set();
|
|
1271
|
+
let dragSourceLabel = null;
|
|
1272
|
+
/** Subscribe to order changes originating from the sidebar DOM. */
|
|
1273
|
+
function subscribeOrder(listener) {
|
|
1274
|
+
orderListeners.add(listener);
|
|
1275
|
+
return () => { orderListeners.delete(listener); };
|
|
1276
|
+
}
|
|
1277
|
+
/** Publish a new order from a sidebar drag and persist it in our config. */
|
|
1278
|
+
function notifyOrderChange(order) {
|
|
1279
|
+
config = { ...config, orderLabels: [...order] };
|
|
1280
|
+
for (const listener of Array.from(orderListeners))
|
|
1281
|
+
listener([...order]);
|
|
1282
|
+
}
|
|
1283
|
+
/**
|
|
1284
|
+
* Wire one panel row for HTML5 drag-and-drop. Idempotent: an `ATTR.dnd` mark
|
|
1285
|
+
* prevents duplicate listeners across the many rescan passes. The "More" header
|
|
1286
|
+
* is never wired (it stays the fold toggle). Drop commits the reordered label
|
|
1287
|
+
* list; the settings card and index.ts both observe it via subscribeOrder.
|
|
1288
|
+
*/
|
|
1289
|
+
function bindRowDrag(row, isHeader) {
|
|
1290
|
+
if (isHeader || row.getAttribute(ATTR.dnd) !== null)
|
|
1291
|
+
return;
|
|
1292
|
+
const el = row;
|
|
1293
|
+
el.setAttribute(ATTR.dnd, '');
|
|
1294
|
+
el.setAttribute('draggable', 'true');
|
|
1295
|
+
const label = labelOf(row);
|
|
1296
|
+
if (label === '')
|
|
1297
|
+
return;
|
|
1298
|
+
el.addEventListener('dragstart', (e) => {
|
|
1299
|
+
dragSourceLabel = label;
|
|
1300
|
+
el.classList?.add(CLS.rowDrag);
|
|
1301
|
+
if (e?.dataTransfer)
|
|
1302
|
+
e.dataTransfer.effectAllowed = 'move';
|
|
1303
|
+
});
|
|
1304
|
+
el.addEventListener('dragover', (e) => {
|
|
1305
|
+
if (dragSourceLabel === null || dragSourceLabel === label)
|
|
1306
|
+
return;
|
|
1307
|
+
e?.preventDefault?.();
|
|
1308
|
+
if (e?.dataTransfer)
|
|
1309
|
+
e.dataTransfer.dropEffect = 'move';
|
|
1310
|
+
el.classList?.add(CLS.rowDragOver);
|
|
1311
|
+
});
|
|
1312
|
+
el.addEventListener('dragleave', () => {
|
|
1313
|
+
el.classList?.remove(CLS.rowDragOver);
|
|
1314
|
+
});
|
|
1315
|
+
el.addEventListener('drop', (e) => {
|
|
1316
|
+
e?.preventDefault?.();
|
|
1317
|
+
el.classList?.remove(CLS.rowDragOver);
|
|
1318
|
+
if (dragSourceLabel === null || dragSourceLabel === label)
|
|
1319
|
+
return;
|
|
1320
|
+
const all = rowsOf(mount?.nav ?? el.closest?.(SEL.panelList));
|
|
1321
|
+
if (all.length === 0)
|
|
1322
|
+
return;
|
|
1323
|
+
const labels = all.map(labelOf);
|
|
1324
|
+
const next = reorderLabels(labels, dragSourceLabel, label);
|
|
1325
|
+
dragSourceLabel = null;
|
|
1326
|
+
if (next.some((value) => value === ''))
|
|
1327
|
+
return;
|
|
1328
|
+
applyOrder(all, next);
|
|
1329
|
+
notifyOrderChange(next);
|
|
1330
|
+
});
|
|
1331
|
+
el.addEventListener('dragend', () => {
|
|
1332
|
+
dragSourceLabel = null;
|
|
1333
|
+
el.classList?.remove(CLS.rowDrag);
|
|
1334
|
+
el.classList?.remove(CLS.rowDragOver);
|
|
1335
|
+
});
|
|
1336
|
+
}
|
|
1337
|
+
/** Wire every live row for reordering (called on each apply pass, idempotent). */
|
|
1338
|
+
function bindRowDrags(rows) {
|
|
1339
|
+
if (rows.length < 2)
|
|
1340
|
+
return;
|
|
1341
|
+
const header = rows.find((row) => row.getAttribute('aria-haspopup') === 'menu') ?? rows[rows.length - 1];
|
|
1342
|
+
for (const row of rows)
|
|
1343
|
+
bindRowDrag(row, row === header);
|
|
1344
|
+
}
|
|
1345
|
+
/**
|
|
1346
|
+
* Reorder the nav's rows in place to match the persisted label order.
|
|
1347
|
+
*
|
|
1348
|
+
* Mutation-safe: a row is moved only when its position actually differs from
|
|
1349
|
+
* the target. The host owns these nodes (React), so we only re-parent them —
|
|
1350
|
+
* never clone, never replace — and the "More" header stays at the end.
|
|
1351
|
+
*/
|
|
1352
|
+
function applyOrder(rows, orderLabels) {
|
|
1353
|
+
if (orderLabels.length === 0)
|
|
1354
|
+
return;
|
|
1355
|
+
const target = orderedRows(rows, orderLabels);
|
|
1356
|
+
if (target.length !== rows.length)
|
|
1357
|
+
return;
|
|
1358
|
+
const parent = rows[0]?.parentElement;
|
|
1359
|
+
if (parent == null)
|
|
1360
|
+
return;
|
|
1361
|
+
// Walk the target order and insert each row before its successor; insertBefore
|
|
1362
|
+
// of a node already in place is a no-op in the DOM, so no mutation is emitted.
|
|
1363
|
+
for (let i = target.length - 2; i >= 0; i--) {
|
|
1364
|
+
const row = target[i];
|
|
1365
|
+
const next = target[i + 1];
|
|
1366
|
+
if (row.nextElementSibling !== next) {
|
|
1367
|
+
try {
|
|
1368
|
+
parent.insertBefore(row, next);
|
|
1369
|
+
}
|
|
1370
|
+
catch { /* host may re-render */ }
|
|
1371
|
+
}
|
|
1372
|
+
}
|
|
1373
|
+
}
|
|
1198
1374
|
/**
|
|
1199
1375
|
* Write the fold marks. Only attributes we own are touched: no host class,
|
|
1200
1376
|
* no host attribute, and never the anchor's `aria-expanded` (that one is the
|
|
@@ -1208,6 +1384,11 @@ window.__ModuleLoader__.load({
|
|
|
1208
1384
|
if (plan === null)
|
|
1209
1385
|
return;
|
|
1210
1386
|
const { header } = plan;
|
|
1387
|
+
// Reorder the live rows to the persisted order before any fold marks are
|
|
1388
|
+
// written. insertBefore is idempotent (only moves when the order differs) so
|
|
1389
|
+
// the MutationObserver cannot self-trigger an endless rescan loop.
|
|
1390
|
+
applyOrder(rows, config.orderLabels);
|
|
1391
|
+
bindRowDrags(rows);
|
|
1211
1392
|
if (header.getAttribute(ATTR.header) === null)
|
|
1212
1393
|
header.setAttribute(ATTR.header, '');
|
|
1213
1394
|
// Alignment is one nav-level mark with three rule sets behind it. Written on
|
|
@@ -1331,6 +1512,11 @@ window.__ModuleLoader__.load({
|
|
|
1331
1512
|
for (const row of Array.from(nav.querySelectorAll?.(`[${ATTR.folded}]`) ?? [])) {
|
|
1332
1513
|
row.removeAttribute(ATTR.folded);
|
|
1333
1514
|
}
|
|
1515
|
+
for (const row of Array.from(nav.querySelectorAll?.(`[${ATTR.dnd}]`) ?? [])) {
|
|
1516
|
+
row.removeAttribute(ATTR.dnd);
|
|
1517
|
+
row.removeAttribute('draggable');
|
|
1518
|
+
row.classList?.remove(CLS.rowDrag, CLS.rowDragOver);
|
|
1519
|
+
}
|
|
1334
1520
|
mount = null;
|
|
1335
1521
|
}
|
|
1336
1522
|
/**
|
|
@@ -1390,6 +1576,11 @@ window.__ModuleLoader__.load({
|
|
|
1390
1576
|
for (const row of Array.from(document.querySelectorAll(`[${ATTR.folded}]`))) {
|
|
1391
1577
|
row.removeAttribute(ATTR.folded);
|
|
1392
1578
|
}
|
|
1579
|
+
for (const row of Array.from(document.querySelectorAll(`[${ATTR.dnd}]`))) {
|
|
1580
|
+
row.removeAttribute(ATTR.dnd);
|
|
1581
|
+
row.removeAttribute('draggable');
|
|
1582
|
+
row.classList?.remove(CLS.rowDrag, CLS.rowDragOver);
|
|
1583
|
+
}
|
|
1393
1584
|
mount = null;
|
|
1394
1585
|
// The pin bookkeeping belongs to one window's DOM; a remount starts from what
|
|
1395
1586
|
// the host shows now, never from a count that may no longer refer to it.
|
|
@@ -1517,6 +1708,7 @@ window.__ModuleLoader__.load({
|
|
|
1517
1708
|
// dropped on the way in instead of being retried on every scan.
|
|
1518
1709
|
hideLabels: pruneHidden(cfg.hideLabels),
|
|
1519
1710
|
align: normalizeAlign(cfg.align),
|
|
1711
|
+
orderLabels: [...(cfg.orderLabels ?? [])],
|
|
1520
1712
|
};
|
|
1521
1713
|
}
|
|
1522
1714
|
/** The configuration the fold is currently running with (settings card reads it). */
|
|
@@ -1529,6 +1721,7 @@ window.__ModuleLoader__.load({
|
|
|
1529
1721
|
keepLabels: ['插件', 'Plugins'],
|
|
1530
1722
|
hideLabels: [],
|
|
1531
1723
|
align: 'start',
|
|
1724
|
+
orderLabels: [],
|
|
1532
1725
|
};
|
|
1533
1726
|
/**
|
|
1534
1727
|
* The configuration card on this bundle's Plugin-Manager page.
|
|
@@ -1559,6 +1752,7 @@ window.__ModuleLoader__.load({
|
|
|
1559
1752
|
keepLabels: ['插件', 'Plugins'],
|
|
1560
1753
|
hideLabels: [],
|
|
1561
1754
|
align: 'start',
|
|
1755
|
+
orderLabels: [],
|
|
1562
1756
|
};
|
|
1563
1757
|
/** The card body node, created once and re-used by every mount. */
|
|
1564
1758
|
let cardRoot = null;
|
|
@@ -1581,6 +1775,7 @@ window.__ModuleLoader__.load({
|
|
|
1581
1775
|
keepLabels: snap.value?.keepLabels ?? fallback.keepLabels,
|
|
1582
1776
|
hideLabels: snap.value?.hideLabels ?? fallback.hideLabels,
|
|
1583
1777
|
align: normalizeAlign(snap.value?.align ?? fallback.align),
|
|
1778
|
+
orderLabels: Array.isArray(snap.value?.orderLabels) ? snap.value.orderLabels : fallback.orderLabels,
|
|
1584
1779
|
writable: snap.writable && snap.status === 'ready',
|
|
1585
1780
|
status: snap.status,
|
|
1586
1781
|
};
|
|
@@ -1590,6 +1785,7 @@ window.__ModuleLoader__.load({
|
|
|
1590
1785
|
keepLabels: fallback.keepLabels,
|
|
1591
1786
|
hideLabels: fallback.hideLabels,
|
|
1592
1787
|
align: normalizeAlign(fallback.align),
|
|
1788
|
+
orderLabels: fallback.orderLabels,
|
|
1593
1789
|
writable: false,
|
|
1594
1790
|
status: 'unavailable',
|
|
1595
1791
|
};
|
|
@@ -1741,6 +1937,71 @@ window.__ModuleLoader__.load({
|
|
|
1741
1937
|
paint();
|
|
1742
1938
|
commit({ keepLabels: lists.keepLabels, hideLabels: lists.hideLabels });
|
|
1743
1939
|
}
|
|
1940
|
+
/**
|
|
1941
|
+
* Attach a drag handle to a settings row so the visible list can be reordered.
|
|
1942
|
+
*
|
|
1943
|
+
* The row itself is the drag source and drop target; both surfaces (sidebar and
|
|
1944
|
+
* card) compute the next order via reorderLabels and commit through write().
|
|
1945
|
+
*/
|
|
1946
|
+
function makeDraggableRow(row, label, rows) {
|
|
1947
|
+
row.setAttribute('draggable', 'true');
|
|
1948
|
+
row.classList.add(CLS.rowDrag);
|
|
1949
|
+
let source = '';
|
|
1950
|
+
row.addEventListener('dragstart', (e) => {
|
|
1951
|
+
source = label;
|
|
1952
|
+
if (e?.dataTransfer)
|
|
1953
|
+
e.dataTransfer.effectAllowed = 'move';
|
|
1954
|
+
});
|
|
1955
|
+
row.addEventListener('dragover', (e) => {
|
|
1956
|
+
if (source === '' || source === label)
|
|
1957
|
+
return;
|
|
1958
|
+
e?.preventDefault?.();
|
|
1959
|
+
if (e?.dataTransfer)
|
|
1960
|
+
e.dataTransfer.dropEffect = 'move';
|
|
1961
|
+
row.classList.add(CLS.rowDragOver);
|
|
1962
|
+
});
|
|
1963
|
+
row.addEventListener('dragleave', () => row.classList.remove(CLS.rowDragOver));
|
|
1964
|
+
row.addEventListener('drop', (e) => {
|
|
1965
|
+
e?.preventDefault?.();
|
|
1966
|
+
row.classList.remove(CLS.rowDragOver);
|
|
1967
|
+
if (source === '' || source === label)
|
|
1968
|
+
return;
|
|
1969
|
+
const labels = rows.map((entry) => entry.label);
|
|
1970
|
+
const next = reorderLabels(labels, source, label);
|
|
1971
|
+
source = '';
|
|
1972
|
+
// Local optimistic reorder: repaint the roster in the new order first, then
|
|
1973
|
+
// persist it through the same commit() path as the three-state writes.
|
|
1974
|
+
const rank = new Map(next.map((value, index) => [value, index]));
|
|
1975
|
+
const reordered = [...rows].sort((a, b) => (rank.get(a.label) ?? 0) - (rank.get(b.label) ?? 0));
|
|
1976
|
+
for (const entry of reordered) {
|
|
1977
|
+
// Build a fresh row for each entry in the new order.
|
|
1978
|
+
cardRoot?.appendChild(buildEntry(entry, reordered));
|
|
1979
|
+
}
|
|
1980
|
+
commit({ orderLabels: next });
|
|
1981
|
+
});
|
|
1982
|
+
row.addEventListener('dragend', () => {
|
|
1983
|
+
source = '';
|
|
1984
|
+
row.classList.remove(CLS.rowDragOver);
|
|
1985
|
+
});
|
|
1986
|
+
return row;
|
|
1987
|
+
}
|
|
1988
|
+
/** Build one three-state entry row (shared by paint and the DnD repaint). */
|
|
1989
|
+
function buildEntry(entry, rows) {
|
|
1990
|
+
const canHide = hostHasPin();
|
|
1991
|
+
const movable = canMoveToMore(entry.label, canHide);
|
|
1992
|
+
const hintText = movable
|
|
1993
|
+
? pickDictionary(document.documentElement.lang ?? '')['settings.rowHint']
|
|
1994
|
+
: isFixedLabel(entry.label)
|
|
1995
|
+
? pickDictionary(document.documentElement.lang ?? '')['settings.moreFixed']
|
|
1996
|
+
: pickDictionary(document.documentElement.lang ?? '')['settings.moreUnavailable'];
|
|
1997
|
+
const dict = pickDictionary(document.documentElement.lang ?? '');
|
|
1998
|
+
const built = buildRow(entry.label, hintText, segmentedControl(`row:${entry.label}`, entry.state, [
|
|
1999
|
+
{ value: 'always', label: dict['settings.rowAlways'] },
|
|
2000
|
+
{ value: 'foldable', label: dict['settings.rowFold'] },
|
|
2001
|
+
{ value: 'more', label: dict['settings.rowMore'], unavailable: !movable },
|
|
2002
|
+
], !currentValues().writable, (next) => writeRowState(rows, entry.label, next)));
|
|
2003
|
+
return makeDraggableRow(built, entry.label, rows);
|
|
2004
|
+
}
|
|
1744
2005
|
/** Paint (or repaint) the card body from the current values and the live roster. */
|
|
1745
2006
|
function paint() {
|
|
1746
2007
|
if (cardRoot === null)
|
|
@@ -1767,6 +2028,11 @@ window.__ModuleLoader__.load({
|
|
|
1767
2028
|
scopeTitle.setAttribute(ATTR.own, '');
|
|
1768
2029
|
scopeTitle.textContent = dict['settings.rows'];
|
|
1769
2030
|
cardRoot.appendChild(scopeTitle);
|
|
2031
|
+
const dragHint = document.createElement('span');
|
|
2032
|
+
dragHint.className = CLS.hint;
|
|
2033
|
+
dragHint.setAttribute(ATTR.own, '');
|
|
2034
|
+
dragHint.textContent = dict['settings.rowDrag'] + ' — ' + dict['settings.rowDragHint'];
|
|
2035
|
+
cardRoot.appendChild(dragHint);
|
|
1770
2036
|
const hint = document.createElement('span');
|
|
1771
2037
|
hint.className = CLS.hint;
|
|
1772
2038
|
hint.setAttribute(ATTR.own, '');
|
|
@@ -1782,19 +2048,8 @@ window.__ModuleLoader__.load({
|
|
|
1782
2048
|
// Two gates on the third state, per row: this host must ship the pin mechanism
|
|
1783
2049
|
// at all (0.2.2 on), and the row must not be the host's fixed panel — the host
|
|
1784
2050
|
// never unpins that one, so offering it would be a promise it silently refuses.
|
|
1785
|
-
const canHide = hostHasPin();
|
|
1786
2051
|
for (const entry of rows) {
|
|
1787
|
-
|
|
1788
|
-
const hintText = movable
|
|
1789
|
-
? dict['settings.rowHint']
|
|
1790
|
-
: isFixedLabel(entry.label) ? dict['settings.moreFixed'] : dict['settings.moreUnavailable'];
|
|
1791
|
-
cardRoot.appendChild(buildRow(entry.label, hintText, segmentedControl(`row:${entry.label}`, entry.state, [
|
|
1792
|
-
{ value: 'always', label: dict['settings.rowAlways'] },
|
|
1793
|
-
{ value: 'foldable', label: dict['settings.rowFold'] },
|
|
1794
|
-
{ value: 'more', label: dict['settings.rowMore'], unavailable: !movable },
|
|
1795
|
-
], !values.writable, (next) => {
|
|
1796
|
-
writeRowState(rows, entry.label, next);
|
|
1797
|
-
})));
|
|
2052
|
+
cardRoot.appendChild(buildEntry(entry, rows));
|
|
1798
2053
|
}
|
|
1799
2054
|
// ④ write outcome. The host owns persistence; a refused write leaves the card
|
|
1800
2055
|
// and the sidebar agreeing with each other and disagreeing with the store, so
|
|
@@ -1828,6 +2083,10 @@ window.__ModuleLoader__.load({
|
|
|
1828
2083
|
note.textContent = dict['settings.readonly'];
|
|
1829
2084
|
cardRoot.appendChild(note);
|
|
1830
2085
|
}
|
|
2086
|
+
// star 快车道行(单源 _tools/star-row,改副本无效;重渲染随 cardRoot 一起重建)
|
|
2087
|
+
const starRow = mountStarRow();
|
|
2088
|
+
starRow.setAttribute(ATTR.own, '');
|
|
2089
|
+
cardRoot.appendChild(starRow);
|
|
1831
2090
|
}
|
|
1832
2091
|
/**
|
|
1833
2092
|
* Point the card at a settings scope (called by `index.ts` when a waist resolves).
|
|
@@ -1847,6 +2106,7 @@ window.__ModuleLoader__.load({
|
|
|
1847
2106
|
keepLabels: [...next.keepLabels],
|
|
1848
2107
|
hideLabels: [...next.hideLabels],
|
|
1849
2108
|
align: normalizeAlign(next.align),
|
|
2109
|
+
orderLabels: [...(next.orderLabels ?? [])],
|
|
1850
2110
|
};
|
|
1851
2111
|
paint();
|
|
1852
2112
|
}
|
|
@@ -1879,7 +2139,7 @@ window.__ModuleLoader__.load({
|
|
|
1879
2139
|
};
|
|
1880
2140
|
}
|
|
1881
2141
|
/** Exported for the guard test: the card writes no free-text label list. */
|
|
1882
|
-
const CARD_WRITES = ['defaultFolded', 'align', 'keepLabels', 'hideLabels'];
|
|
2142
|
+
const CARD_WRITES = ['defaultFolded', 'align', 'keepLabels', 'hideLabels', 'orderLabels'];
|
|
1883
2143
|
/**
|
|
1884
2144
|
* The "More" menu's shortcut row into this plugin's own settings.
|
|
1885
2145
|
*
|
|
@@ -2037,6 +2297,12 @@ window.__ModuleLoader__.load({
|
|
|
2037
2297
|
/** Adopt a served snapshot, falling back to the built-ins when it says nothing. */
|
|
2038
2298
|
function adopt(scope) {
|
|
2039
2299
|
onScope(scope);
|
|
2300
|
+
// A sidebar drag publishes the new order here; commit it through the same
|
|
2301
|
+
// scoped form so the card and the sidebar share one persisted source.
|
|
2302
|
+
subscribeOrder((order) => {
|
|
2303
|
+
applyConfig({ ...effectiveConfig(), orderLabels: order });
|
|
2304
|
+
void scope.set('orderLabels', order);
|
|
2305
|
+
});
|
|
2040
2306
|
const push = () => {
|
|
2041
2307
|
const snap = scope.getSnapshot();
|
|
2042
2308
|
const value = snap.value;
|
|
@@ -2049,6 +2315,8 @@ window.__ModuleLoader__.load({
|
|
|
2049
2315
|
// Alignment is validated by `normalizeAlign` here so everything downstream
|
|
2050
2316
|
// (fold marks, card radios) only ever sees one of the three known modes.
|
|
2051
2317
|
align: normalizeAlign(typeof value?.align === 'string' ? value.align : BUILTIN_CONFIG.align),
|
|
2318
|
+
// Row order: absent on older hosts means keep the shipped DOM order.
|
|
2319
|
+
orderLabels: Array.isArray(value?.orderLabels) ? value.orderLabels : BUILTIN_CONFIG.orderLabels,
|
|
2052
2320
|
};
|
|
2053
2321
|
onFallback(next);
|
|
2054
2322
|
applyConfig(next);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-sidebar-fold",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.16",
|
|
4
4
|
"description": "Folds the sidebar's add-on panel rows under the shipped \"More\" row, and from host 0.2.2 on gives every row three states — show, fold, or hide in the host's own \"More\" list. The fold state persists per window, rows are read from the live sidebar, and the managed rows' icon + label can be aligned left, centre or right.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -37,13 +37,13 @@
|
|
|
37
37
|
"scripts": {
|
|
38
38
|
"lint": "node scripts/lint.mjs",
|
|
39
39
|
"typecheck": "tsc -p tsconfig.json",
|
|
40
|
-
"test": "node --experimental-strip-types --no-warnings --test tests/fold.test.ts tests/fold-plan.test.ts",
|
|
40
|
+
"test": "node --experimental-strip-types --no-warnings --test tests/fold.test.ts tests/fold-plan.test.ts tests/order.test.ts",
|
|
41
41
|
"test:coverage": "node --experimental-strip-types --no-warnings --experimental-test-coverage --test tests/fold.test.ts tests/fold-plan.test.ts",
|
|
42
42
|
"build": "node scripts/build-client.mjs",
|
|
43
43
|
"verify": "node scripts/verify.mjs",
|
|
44
44
|
"gen:locale": "node scripts/gen-locale-meta.mjs",
|
|
45
45
|
"ci": "npm run lint && npm run typecheck && npm test && npm run build && npm run verify",
|
|
46
|
-
"prepack": "npm run lint && npm run build && npm run verify",
|
|
46
|
+
"prepack": "npm run lint && npm run build && node scripts/check-surface-classes.mjs --prefix dshsf && npm run verify",
|
|
47
47
|
"prepublishOnly": "npm run lint && npm run build && npm run verify",
|
|
48
48
|
"hosts:check": "node scripts/sync-hosts.mjs",
|
|
49
49
|
"hosts:write": "node scripts/sync-hosts.mjs --write"
|
|
@@ -81,4 +81,4 @@
|
|
|
81
81
|
"@types/node": "^22.20.5",
|
|
82
82
|
"typescript": "^5.6.0"
|
|
83
83
|
}
|
|
84
|
-
}
|
|
84
|
+
}
|