dsh-sidebar-fold 0.1.17 → 0.1.19-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.19-rc.1 (2026-11-27)
4
+
5
+ **候选版:设置面板失活三版本(0.1.16–0.1.18)的根因修复 + 设置卡片页底排序。**
6
+
7
+ - 根因:`settings-card.ts` 用 `./star-row-copy.ts` 的符号,但拼接式 bundle 的 `MODULES` 清单漏了该副本;`stripRelativeImports` 删掉 import 后 bundle 照样能 parse、单测全绿,浏览器半体却在运行时抛 `ReferenceError`,宿主把崩掉的 slot 塞进 `data-slot-error` —— 页面只表现为「设置卡片整段不出现」。已把 `star-row-copy.ts` 补进 `MODULES`(leaf-first),插件详情页设置卡片恢复渲染。
8
+ - 防复发:build 期新增「相对 import ⊆ MODULES」闸,凡被 `./x.ts` 引用却未拼接的模块直接 build 失败;已做破坏自证(移除该模块 → exit 1 并点名 `star-row-copy.ts`,还原 → exit 0,产物 `lib/client.js` 7 modules / 130749 chars)。
9
+ - 设置卡片位置:宿主把详情页 section 写死为 `README → config → components → version → source`,卡片夹在 README 与组件列表之间;容器 `detailSections` 是 flex column,纯 CSS `order:99`(`section[data-plugin-config]`,避开行详情页的 div 容器)把配置卡片压到页底,不碰宿主 DOM。
10
+ - 门禁:lint / typecheck / 58 tests / build / verify / surface-classes 全绿。
11
+
12
+ ## 0.1.18 (2026-11-27)
13
+
14
+ **修复:0.1.17 真机回归——「更多」飘到列首、拖动方向反 / 拖不动。**
15
+
16
+ - 缺陷 1(更多飘顶):「更多」按钮的父节点是 `span.moreAnchor`,不是 `div._panelEntry`,`foldTarget()` 原样返回 button;rank 写在 button 上无效,而真正的 flex item(span)留在 `order:0`,比其它行的 `1..N` 都小 → 顶到列首。改法:新增 `flexItemOf()` 从 `foldTarget` 结果向上走到 `.panelList` 的直接子节点,rank 落在真 flex item;并把列内非本行的 chrome(moreAnchor 等)补 `rank = 行数 + 1`,不再留默认 `order:0`。
17
+ - 缺陷 2/3(方向反 / 拖不动):`drop` 用 `rowsOf(nav)` 的 DOM 序算新序,但用户按视觉序(`style.order`)拖;两序相反时移动量互相抵消。改法:`drop` 改从 `orderedRows(all, config.orderLabels)`(当前屏幕所见)算 `reorderLabels`。
18
+ - 回归测试:`tests/order-apply.test.ts` 新增 `nested()` 桩(DOM 序与视觉序互逆 + header 在 span 里)与 3 条断言(moreAnchor 拿最大 rank 且 button 不写、互逆序下拖动能换序、清空时含 chrome 全部撤 rank)。共 58/58 通过。
19
+ - 真机复验(farm 0.2.2-rc.3 / 3121):moreAnchor `order=3`、`top=184`(列内最大,稳在列尾);拖「插件→自动化任务」视觉序 `[自动化任务,插件]→[插件,自动化任务]`,拖回可还原;F5 刷新后顺序保持;控制台 0 错误。
20
+
3
21
  ## 0.1.17 (2026-11-27)
4
22
 
5
23
  **修复:拖动排序只有反馈、顺序不变。**
package/dsh.plugin.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "id": "dsh-external/dsh-sidebar-fold",
3
- "version": "0.1.17",
3
+ "version": "0.1.19-rc.1",
4
4
  "main": "./src/index.js",
5
5
  "description": "折叠左侧栏加项入口:在宿主「更多」行挂一个 28×28 方形箭头按钮,把自动化任务、agent 团队、插件市场、上下文页等加项面板行收纳成一行;设置卡每行三档:显示(一直显示)/ 折叠(允许折叠)/ 隐藏到更多(移进宿主「更多」菜单,宿主 0.2.2 起)。还可调默认态与行内文字图标对齐(左/居中/右)。",
6
6
  "engines": {
package/lib/client.js CHANGED
@@ -321,6 +321,13 @@ window.__ModuleLoader__.load({
321
321
  rule(`.${CLS.rowHandle}`, ['cursor:grab', '-webkit-user-select:none', 'user-select:none']),
322
322
  rule(`.${CLS.rowHandle}:active`, ['cursor:grabbing']),
323
323
  rule(`.${CLS.menuIcon}`, ['flex:none', 'display:block']),
324
+ // Configuration card last on the detail page. The host hard-codes
325
+ // README -> config -> components -> version -> source, which buries the card
326
+ // between the README and the component list; the sections container is
327
+ // display:flex; flex-direction:column (rc.5 PluginManagerPage.module.css),
328
+ // so `order` re-sorts it without touching a host node. The `section` prefix
329
+ // keeps the row-detail container (a div[data-plugin-config]) out of scope.
330
+ rule(`section[data-plugin-config]`, ['order:99']),
324
331
  ].join('');
325
332
  /**
326
333
  * Runtime dictionaries for the browser half (10 languages, zh key set is the
@@ -1340,7 +1347,13 @@ window.__ModuleLoader__.load({
1340
1347
  // Order the reorderable rows only: the "More" header is not a rank, it is
1341
1348
  // pinned last by orderedRows, and persisting its label would just be noise.
1342
1349
  const header = all.find((row) => row.getAttribute('aria-haspopup') === 'menu') ?? all[all.length - 1];
1343
- const next = reorderLabels(all.filter((row) => row !== header).map(labelOf), source, label);
1350
+ // The list the user is dragging in is the one they can SEE, and since 0.1.17
1351
+ // that order lives in `style.order`, not in the DOM. Computing the move from
1352
+ // DOM order made a downward drag a no-op once any rank existed (DOM order and
1353
+ // visual order differ), which read as "the drag does nothing" or "it goes the
1354
+ // wrong way". Always start from the order currently on screen.
1355
+ const visible = orderedRows(all, config.orderLabels);
1356
+ const next = reorderLabels(visible.filter((row) => row !== header).map(labelOf), source, label);
1344
1357
  applyOrder(all, next);
1345
1358
  notifyOrderChange(next);
1346
1359
  });
@@ -1383,6 +1396,40 @@ window.__ModuleLoader__.load({
1383
1396
  * @param rows - the nav's panel rows, in document order.
1384
1397
  * @param orderLabels - persisted label order; an empty list clears every rank.
1385
1398
  */
1399
+ /** The parent whose flex children the ranks reorder, or null for a detached stub. */
1400
+ function childContainer(node) {
1401
+ return (node.parentElement ?? null);
1402
+ }
1403
+ /** The flex children of a container (empty for a stub that has none). */
1404
+ function childrenOf(container) {
1405
+ const kids = container.children;
1406
+ return kids === undefined ? [] : Array.from(kids);
1407
+ }
1408
+ /**
1409
+ * The flex item a rank must be written on.
1410
+ *
1411
+ * `foldTarget` answers "which node does the host treat as the row", and on the
1412
+ * 0.2.2 line that is the `div._panelEntry` — a flex child of `.panelList`. The
1413
+ * "More" row is the exception: its button sits directly inside a
1414
+ * `span.moreAnchor`, so the closest entry above it is none and the button is
1415
+ * returned. A rank written there is inert (the button is not a flex item) while
1416
+ * the anchor keeps `order: 0` and floats to the top. Walk up to the child of the
1417
+ * container so every rank lands on something the column actually lays out.
1418
+ * @param target - the node {@link foldTarget} returned.
1419
+ * @param container - the flex container the ranks apply to, or null.
1420
+ * @returns the direct child of `container` that owns `target`, else `target`.
1421
+ */
1422
+ function flexItemOf(target, container) {
1423
+ if (container === null)
1424
+ return target;
1425
+ let node = target;
1426
+ let guard = 0;
1427
+ while (node.parentElement != null && node.parentElement !== container && guard < 8) {
1428
+ node = node.parentElement;
1429
+ guard += 1;
1430
+ }
1431
+ return node.parentElement === container ? node : target;
1432
+ }
1386
1433
  function applyOrder(rows, orderLabels) {
1387
1434
  if (rows.length < 2)
1388
1435
  return;
@@ -1392,13 +1439,39 @@ window.__ModuleLoader__.load({
1392
1439
  if (!entries.includes(entry))
1393
1440
  entries.push(entry);
1394
1441
  }
1442
+ if (entries.length === 0)
1443
+ return;
1444
+ const container = childContainer(entries[0]);
1395
1445
  const wanted = new Map();
1396
1446
  if (orderLabels.length > 0) {
1397
- orderedRows(rows, orderLabels).forEach((row, index) => {
1398
- wanted.set(foldTarget(row), index + 1);
1447
+ const ordered = orderedRows(rows, orderLabels);
1448
+ ordered.forEach((row, index) => {
1449
+ const entry = flexItemOf(foldTarget(row), container);
1450
+ if (!wanted.has(entry))
1451
+ wanted.set(entry, index + 1);
1399
1452
  });
1453
+ // Host chrome that is not one of our rows — above all the "More" anchor, a
1454
+ // `span.moreAnchor` that wraps the header button instead of being a
1455
+ // `div._panelEntry` — must not be left at the flex default `order: 0`, or it
1456
+ // jumps above every ranked row (measured: "More" flew to the top of the
1457
+ // column). Rank it past the last row so it stays where the host put it.
1458
+ if (container !== null) {
1459
+ const tail = ordered.length + 1;
1460
+ for (const child of childrenOf(container)) {
1461
+ if (!wanted.has(child))
1462
+ wanted.set(child, tail);
1463
+ }
1464
+ }
1400
1465
  }
1401
- for (const entry of entries) {
1466
+ const touched = [...entries];
1467
+ if (container !== null)
1468
+ for (const child of childrenOf(container))
1469
+ touched.push(child);
1470
+ const seen = new Set();
1471
+ for (const entry of touched) {
1472
+ if (seen.has(entry))
1473
+ continue;
1474
+ seen.add(entry);
1402
1475
  const value = wanted.get(entry);
1403
1476
  if (value === undefined) {
1404
1477
  if (entry.getAttribute(ATTR.order) === null)
@@ -1783,6 +1856,109 @@ window.__ModuleLoader__.load({
1783
1856
  align: 'start',
1784
1857
  orderLabels: [],
1785
1858
  };
1859
+ /**
1860
+ * star-row 真源(面板 star 快车道行,v1)——纯 DOM 实现,零依赖。
1861
+ *
1862
+ * 副本约束:生成文件名 star-row-copy.ts,头部须保留 /** 块注释,单行 ≤140
1863
+ * 字宽(sidebar-fold 仓 lint 门禁:max-line + file-header)。
1864
+ *
1865
+ * 契约(对齐 panel-star-row spec):
1866
+ * - 渲染一行 <a>:GitHub 单色 SVG + `owner/name`;variant A 追加一句工程话术;
1867
+ * - 整行即链接(A/L 档),新标签页打开;不做弹窗、不做按钮交互;
1868
+ * - 文案内嵌 10 语,按 `document.documentElement.lang` 前缀自选
1869
+ * (同 sidebar-fold `pickDictionary` 口径),不依赖宿主 locale 服务,
1870
+ * 避免逐仓动字典文件;
1871
+ * - 样式一次性注入 <style data-dsh-star-row>,色随 currentColor,深浅主题自适应;
1872
+ * - 副本由 _tools/star-row/sync.mjs 生成到各仓 `src/client/star-row-copy.ts`
1873
+ * (文件名含 copy,locale 守卫豁免规则命中),改副本无效,改真源后重跑 sync。
1874
+ *
1875
+ * 每仓生成时在文件头部烘焙 REPO_URL / STAR_NS / STAR_VARIANT 三个常量。
1876
+ */
1877
+ /** 生成段:REPO_URL / STAR_NS / STAR_VARIANT 由 sync 注入。 */
1878
+ // STAR-CONSTS:BEGIN — generated by _tools/star-row/sync.mjs; edit the real source instead
1879
+ const REPO_URL = "https://github.com/drscrewdriver/dsh-sidebar-fold";
1880
+ const STAR_NS = "sidebar-fold";
1881
+ const STAR_VARIANT = "A";
1882
+ // STAR-CONSTS:END
1883
+ /** zh 为键集真理源;10 语与 sidebar-fold/manage-session 同集合。 */
1884
+ const STAR_COPY = {
1885
+ zh: { ask: "觉得省事了?一颗 Star 让工具被更多人看见" },
1886
+ en: { ask: "Finding it handy? A star helps more people discover this tool" },
1887
+ ja: { ask: "便利でしたら⭐で、このツールがもっと届きます" },
1888
+ ko: { ask: "유용했다면 ⭐ 하나로 더 많은 사용자에게 닿습니다" },
1889
+ fr: { ask: "Utile ? Une étoile aide cet outil à être découvert" },
1890
+ de: { ask: "Nützlich? Ein Stern hilft dem Tool, gesehen zu werden" },
1891
+ it: { ask: "Ti è utile? Una stella aiuta questo tool a farsi scoprire" },
1892
+ ru: { ask: "Пригодилось? Звезда поможет большему числу людей узнать о tool" },
1893
+ es: { ask: "¿Te resulta útil? Una estrella ayuda a que más gente lo descubra" },
1894
+ pt: { ask: "Achou útil? Uma estrela ajuda mais pessoas a descobrir a ferramenta" },
1895
+ };
1896
+ const STAR_LANGS = ["zh", "en", "ja", "ko", "fr", "de", "it", "ru", "es", "pt"];
1897
+ /** GitHub mark(Simple Icons / octicon 轮廓,24 视口),fill 随 currentColor。 */
1898
+ const GITHUB_MARK_PATH = "M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577" +
1899
+ " 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7" +
1900
+ " 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07" +
1901
+ " 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332" +
1902
+ " -5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0" +
1903
+ " 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552" +
1904
+ " 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0" +
1905
+ " 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015" +
1906
+ " 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12";
1907
+ const STYLE_ID = "dsh-star-row-style";
1908
+ const STYLE_CSS = [
1909
+ ".dsh-star-row{display:flex;align-items:center;gap:7px;font-size:12px;",
1910
+ "line-height:1.5;color:inherit;text-decoration:none;opacity:.72;padding:3px 0;",
1911
+ "margin-top:6px;min-width:0;flex-wrap:wrap}",
1912
+ ".dsh-star-row:hover{opacity:1;text-decoration:underline}",
1913
+ ".dsh-star-row svg{width:14px;height:14px;flex:none;display:block}",
1914
+ ".dsh-star-row .dsh-star-ask{opacity:.85;font-weight:400}",
1915
+ ].join("");
1916
+ function pickLang() {
1917
+ const tag = (typeof document !== "undefined" && document.documentElement.lang) || "";
1918
+ const low = tag.toLowerCase();
1919
+ for (const cand of STAR_LANGS) {
1920
+ if (low.startsWith(cand))
1921
+ return STAR_COPY[cand];
1922
+ }
1923
+ return STAR_COPY.en;
1924
+ }
1925
+ /** 在目标文档上建出快车道行(一次性注入样式)。纯 DOM,React 仓经 ref 回调挂载。 */
1926
+ function mountStarRow(doc) {
1927
+ const d = doc ?? document;
1928
+ if (!d.getElementById(STYLE_ID)) {
1929
+ const tag = d.createElement("style");
1930
+ tag.id = STYLE_ID;
1931
+ tag.textContent = STYLE_CSS;
1932
+ d.head.appendChild(tag);
1933
+ }
1934
+ const match = REPO_URL.match(/github\.com\/([^/]+\/[^/#?]+)/);
1935
+ const repo = match ? match[1] : "drscrewdriver";
1936
+ const a = d.createElement("a");
1937
+ a.className = "dsh-star-row";
1938
+ a.href = REPO_URL;
1939
+ a.target = "_blank";
1940
+ a.rel = "noreferrer";
1941
+ a.dataset.starNs = STAR_NS;
1942
+ const svg = d.createElementNS("http://www.w3.org/2000/svg", "svg");
1943
+ svg.setAttribute("viewBox", "0 0 24 24");
1944
+ svg.setAttribute("aria-hidden", "true");
1945
+ const path = d.createElementNS("http://www.w3.org/2000/svg", "path");
1946
+ path.setAttribute("fill", "currentColor");
1947
+ path.setAttribute("d", GITHUB_MARK_PATH);
1948
+ svg.appendChild(path);
1949
+ a.appendChild(svg);
1950
+ const label = d.createElement("span");
1951
+ label.textContent = repo;
1952
+ a.appendChild(label);
1953
+ if (STAR_VARIANT === "A") {
1954
+ const ask = d.createElement("span");
1955
+ ask.className = "dsh-star-ask";
1956
+ ask.textContent = pickLang().ask;
1957
+ a.appendChild(ask);
1958
+ }
1959
+ // L 档:仅中性仓库链接,无话术。S 档细条在后续批次扩展。
1960
+ return a;
1961
+ }
1786
1962
  /**
1787
1963
  * The configuration card on this bundle's Plugin-Manager page.
1788
1964
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-sidebar-fold",
3
- "version": "0.1.17",
3
+ "version": "0.1.19-rc.1",
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",
@@ -332,4 +332,11 @@ export const SHEET = [
332
332
  rule(`.${CLS.rowHandle}`, ['cursor:grab', '-webkit-user-select:none', 'user-select:none']),
333
333
  rule(`.${CLS.rowHandle}:active`, ['cursor:grabbing']),
334
334
  rule(`.${CLS.menuIcon}`, ['flex:none', 'display:block']),
335
+ // Configuration card last on the detail page. The host hard-codes
336
+ // README -> config -> components -> version -> source, which buries the card
337
+ // between the README and the component list; the sections container is
338
+ // display:flex; flex-direction:column (rc.5 PluginManagerPage.module.css),
339
+ // so `order` re-sorts it without touching a host node. The `section` prefix
340
+ // keeps the row-detail container (a div[data-plugin-config]) out of scope.
341
+ rule(`section[data-plugin-config]`, ['order:99']),
335
342
  ].join('')
@@ -802,7 +802,13 @@ function bindRowDrag(row: ElementLike, isHeader: boolean): void {
802
802
  // Order the reorderable rows only: the "More" header is not a rank, it is
803
803
  // pinned last by orderedRows, and persisting its label would just be noise.
804
804
  const header = all.find((row) => row.getAttribute('aria-haspopup') === 'menu') ?? all[all.length - 1]
805
- const next = reorderLabels(all.filter((row) => row !== header).map(labelOf), source, label)
805
+ // The list the user is dragging in is the one they can SEE, and since 0.1.17
806
+ // that order lives in `style.order`, not in the DOM. Computing the move from
807
+ // DOM order made a downward drag a no-op once any rank existed (DOM order and
808
+ // visual order differ), which read as "the drag does nothing" or "it goes the
809
+ // wrong way". Always start from the order currently on screen.
810
+ const visible = orderedRows(all, config.orderLabels)
811
+ const next = reorderLabels(visible.filter((row) => row !== header).map(labelOf), source, label)
806
812
  applyOrder(all, next)
807
813
  notifyOrderChange(next)
808
814
  })
@@ -845,6 +851,42 @@ function bindRowDrags(rows: readonly ElementLike[]): void {
845
851
  * @param rows - the nav's panel rows, in document order.
846
852
  * @param orderLabels - persisted label order; an empty list clears every rank.
847
853
  */
854
+ /** The parent whose flex children the ranks reorder, or null for a detached stub. */
855
+ function childContainer(node: ElementLike): ElementLike | null {
856
+ return ((node as { parentElement?: ElementLike | null }).parentElement ?? null) as ElementLike | null
857
+ }
858
+
859
+ /** The flex children of a container (empty for a stub that has none). */
860
+ function childrenOf(container: ElementLike): ElementLike[] {
861
+ const kids = (container as { children?: ArrayLike<ElementLike> }).children
862
+ return kids === undefined ? [] : (Array.from(kids) as ElementLike[])
863
+ }
864
+
865
+ /**
866
+ * The flex item a rank must be written on.
867
+ *
868
+ * `foldTarget` answers "which node does the host treat as the row", and on the
869
+ * 0.2.2 line that is the `div._panelEntry` — a flex child of `.panelList`. The
870
+ * "More" row is the exception: its button sits directly inside a
871
+ * `span.moreAnchor`, so the closest entry above it is none and the button is
872
+ * returned. A rank written there is inert (the button is not a flex item) while
873
+ * the anchor keeps `order: 0` and floats to the top. Walk up to the child of the
874
+ * container so every rank lands on something the column actually lays out.
875
+ * @param target - the node {@link foldTarget} returned.
876
+ * @param container - the flex container the ranks apply to, or null.
877
+ * @returns the direct child of `container` that owns `target`, else `target`.
878
+ */
879
+ function flexItemOf(target: ElementLike, container: ElementLike | null): ElementLike {
880
+ if (container === null) return target
881
+ let node = target as unknown as { parentElement?: ElementLike | null }
882
+ let guard = 0
883
+ while (node.parentElement != null && node.parentElement !== container && guard < 8) {
884
+ node = node.parentElement
885
+ guard += 1
886
+ }
887
+ return node.parentElement === container ? (node as unknown as ElementLike) : target
888
+ }
889
+
848
890
  export function applyOrder(rows: readonly ElementLike[], orderLabels: readonly string[]): void {
849
891
  if (rows.length < 2) return
850
892
  const entries: ElementLike[] = []
@@ -852,13 +894,33 @@ export function applyOrder(rows: readonly ElementLike[], orderLabels: readonly s
852
894
  const entry = foldTarget(row)
853
895
  if (!entries.includes(entry)) entries.push(entry)
854
896
  }
897
+ if (entries.length === 0) return
898
+ const container = childContainer(entries[0])
855
899
  const wanted = new Map<ElementLike, number>()
856
900
  if (orderLabels.length > 0) {
857
- orderedRows(rows, orderLabels).forEach((row, index) => {
858
- wanted.set(foldTarget(row), index + 1)
901
+ const ordered = orderedRows(rows, orderLabels)
902
+ ordered.forEach((row, index) => {
903
+ const entry = flexItemOf(foldTarget(row), container)
904
+ if (!wanted.has(entry)) wanted.set(entry, index + 1)
859
905
  })
906
+ // Host chrome that is not one of our rows — above all the "More" anchor, a
907
+ // `span.moreAnchor` that wraps the header button instead of being a
908
+ // `div._panelEntry` — must not be left at the flex default `order: 0`, or it
909
+ // jumps above every ranked row (measured: "More" flew to the top of the
910
+ // column). Rank it past the last row so it stays where the host put it.
911
+ if (container !== null) {
912
+ const tail = ordered.length + 1
913
+ for (const child of childrenOf(container)) {
914
+ if (!wanted.has(child)) wanted.set(child, tail)
915
+ }
916
+ }
860
917
  }
861
- for (const entry of entries) {
918
+ const touched: ElementLike[] = [...entries]
919
+ if (container !== null) for (const child of childrenOf(container)) touched.push(child)
920
+ const seen = new Set<ElementLike>()
921
+ for (const entry of touched) {
922
+ if (seen.has(entry)) continue
923
+ seen.add(entry)
862
924
  const value = wanted.get(entry)
863
925
  if (value === undefined) {
864
926
  if (entry.getAttribute(ATTR.order) === null) continue