dsh-sidebar-fold 0.1.18 → 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,14 @@
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
+
3
12
  ## 0.1.18 (2026-11-27)
4
13
 
5
14
  **修复:0.1.17 真机回归——「更多」飘到列首、拖动方向反 / 拖不动。**
package/dsh.plugin.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "id": "dsh-external/dsh-sidebar-fold",
3
- "version": "0.1.18",
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
@@ -1849,6 +1856,109 @@ window.__ModuleLoader__.load({
1849
1856
  align: 'start',
1850
1857
  orderLabels: [],
1851
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
+ }
1852
1962
  /**
1853
1963
  * The configuration card on this bundle's Plugin-Manager page.
1854
1964
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-sidebar-fold",
3
- "version": "0.1.18",
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('')