dsh-bash-terminal-ts 0.9.2 → 0.9.3

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.9.3 (2026-11-26)
4
+
5
+ **设置卡底栏 Star 快车道:★ 直接打开仓库页(不再只静默收起),隐藏独立成 ×。**
6
+
7
+ - 新增 `src/client/star-row-copy.ts`(由 `_tools/star-row/sync.mjs` 从 kit 真源生成,禁手改):GitHub 图标 + owner/repo 链接 | 求星话术 | ★ CTA | × 隐藏。
8
+ - **修 S 档旧缺陷**:点 ★ 此前写成 `starDismiss()`,与「别打扰我」合流,仓库页一次都没打开过。现在 ★ 走锚点 click 打开 `REPO_URL`(不写 dismissed),× 才写 `dsh.star.<ns>.dismissed=1` 并收话术与两钮;链接段永留。
9
+ - 真源 `STAR:EXTENDED` 段单源维护,A/L 档副本由 sync 整段剥除,已发布 A/L 仓零 diff。
10
+ - 文案 10 语按 `documentElement.lang` 前缀自选;样式只走 `--dsw-alias-*` 令牌与 `currentColor`,零硬色。
11
+
3
12
  ## 0.9.1 (2026-11-19)
4
13
 
5
14
  - i18n: add Portuguese (pt-BR) locale — runtime dictionary, package metadata and README/CHANGELOG mirrors.
@@ -33,9 +33,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
33
33
  ));
34
34
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
35
35
 
36
- // node_modules/.pnpm/@xterm+addon-fit@0.10.0_@xterm+xterm@5.5.0/node_modules/@xterm/addon-fit/lib/addon-fit.js
36
+ // node_modules/@xterm/addon-fit/lib/addon-fit.js
37
37
  var require_addon_fit = __commonJS({
38
- "node_modules/.pnpm/@xterm+addon-fit@0.10.0_@xterm+xterm@5.5.0/node_modules/@xterm/addon-fit/lib/addon-fit.js"(exports, module2) {
38
+ "node_modules/@xterm/addon-fit/lib/addon-fit.js"(exports, module2) {
39
39
  !(function(e, t) {
40
40
  "object" == typeof exports && "object" == typeof module2 ? module2.exports = t() : "function" == typeof define && define.amd ? define([], t) : "object" == typeof exports ? exports.FitAddon = t() : e.FitAddon = t();
41
41
  })(self, (() => (() => {
@@ -69,9 +69,9 @@ var require_addon_fit = __commonJS({
69
69
  }
70
70
  });
71
71
 
72
- // node_modules/.pnpm/@xterm+xterm@5.5.0/node_modules/@xterm/xterm/lib/xterm.js
72
+ // node_modules/@xterm/xterm/lib/xterm.js
73
73
  var require_xterm = __commonJS({
74
- "node_modules/.pnpm/@xterm+xterm@5.5.0/node_modules/@xterm/xterm/lib/xterm.js"(exports, module2) {
74
+ "node_modules/@xterm/xterm/lib/xterm.js"(exports, module2) {
75
75
  !(function(e, t) {
76
76
  if ("object" == typeof exports && "object" == typeof module2) module2.exports = t();
77
77
  else if ("function" == typeof define && define.amd) define([], t);
@@ -7171,7 +7171,7 @@ var import_react2 = require("react");
7171
7171
  var import_addon_fit = __toESM(require_addon_fit(), 1);
7172
7172
  var import_xterm = __toESM(require_xterm(), 1);
7173
7173
 
7174
- // node_modules/.pnpm/@xterm+xterm@5.5.0/node_modules/@xterm/xterm/css/xterm.css
7174
+ // node_modules/@xterm/xterm/css/xterm.css
7175
7175
  var xterm_default = `/**
7176
7176
  * Copyright (c) 2014 The xterm.js authors. All rights reserved.
7177
7177
  * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
@@ -7737,6 +7737,194 @@ function MultiShellTerminal(props) {
7737
7737
  ] });
7738
7738
  }
7739
7739
 
7740
+ // src/webterminals/browser/star-row-copy.ts
7741
+ var REPO_URL = "https://github.com/drscrewdriver/dsh-bash-terminal-ts";
7742
+ var STAR_NS = "bash-terminal";
7743
+ var STAR_VARIANT = "S";
7744
+ var STAR_COPY = {
7745
+ zh: { ask: "\u89C9\u5F97\u7701\u4E8B\u4E86\uFF1F\u4E00\u9897 Star \u8BA9\u5DE5\u5177\u88AB\u66F4\u591A\u4EBA\u770B\u89C1" },
7746
+ en: { ask: "Finding it handy? A star helps more people discover this tool" },
7747
+ ja: { ask: "\u4FBF\u5229\u3067\u3057\u305F\u3089\u2B50\u3067\u3001\u3053\u306E\u30C4\u30FC\u30EB\u304C\u3082\u3063\u3068\u5C4A\u304D\u307E\u3059" },
7748
+ ko: { ask: "\uC720\uC6A9\uD588\uB2E4\uBA74 \u2B50 \uD558\uB098\uB85C \uB354 \uB9CE\uC740 \uC0AC\uC6A9\uC790\uC5D0\uAC8C \uB2FF\uC2B5\uB2C8\uB2E4" },
7749
+ fr: { ask: "Utile ? Une \xE9toile aide cet outil \xE0 \xEAtre d\xE9couvert" },
7750
+ de: { ask: "N\xFCtzlich? Ein Stern hilft dem Tool, gesehen zu werden" },
7751
+ it: { ask: "Ti \xE8 utile? Una stella aiuta questo tool a farsi scoprire" },
7752
+ ru: { ask: "\u041F\u0440\u0438\u0433\u043E\u0434\u0438\u043B\u043E\u0441\u044C? \u0417\u0432\u0435\u0437\u0434\u0430 \u043F\u043E\u043C\u043E\u0436\u0435\u0442 \u0431\u043E\u043B\u044C\u0448\u0435\u043C\u0443 \u0447\u0438\u0441\u043B\u0443 \u043B\u044E\u0434\u0435\u0439 \u0443\u0437\u043D\u0430\u0442\u044C \u043E tool" },
7753
+ es: { ask: "\xBFTe resulta \xFAtil? Una estrella ayuda a que m\xE1s gente lo descubra" },
7754
+ pt: { ask: "Achou \xFAtil? Uma estrela ajuda mais pessoas a descobrir a ferramenta" }
7755
+ };
7756
+ var STAR_LANGS = ["zh", "en", "ja", "ko", "fr", "de", "it", "ru", "es", "pt"];
7757
+ var 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 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 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332 -5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 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 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 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 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12";
7758
+ var STYLE_ID = "dsh-star-row-style";
7759
+ var STYLE_CSS = [
7760
+ ".dsh-star-row{display:flex;align-items:center;gap:7px;font-size:12px;",
7761
+ "line-height:1.5;color:inherit;text-decoration:none;opacity:.72;padding:3px 0;",
7762
+ "margin-top:6px;min-width:0;flex-wrap:wrap}",
7763
+ ".dsh-star-row:hover{opacity:1;text-decoration:underline}",
7764
+ ".dsh-star-row svg{width:14px;height:14px;flex:none;display:block}",
7765
+ ".dsh-star-row .dsh-star-ask{opacity:.85;font-weight:400}"
7766
+ ].join("");
7767
+ function pickLang() {
7768
+ const tag = typeof document !== "undefined" && document.documentElement.lang || "";
7769
+ const low = tag.toLowerCase();
7770
+ for (const cand of STAR_LANGS) {
7771
+ if (low.startsWith(cand)) return STAR_COPY[cand];
7772
+ }
7773
+ return STAR_COPY.en;
7774
+ }
7775
+ var STAR_CTA = {
7776
+ zh: "\u7559\u9897 Star",
7777
+ en: "Star",
7778
+ ja: "\u30B9\u30BF\u30FC",
7779
+ ko: "\uC2A4\uD0C0",
7780
+ fr: "Star",
7781
+ de: "Stern",
7782
+ it: "Stella",
7783
+ ru: "\u0417\u0432\u0435\u0437\u0434\u0430",
7784
+ es: "Estrella",
7785
+ pt: "Estrela"
7786
+ };
7787
+ var STAR_HIDE = {
7788
+ zh: "\u4E0D\u518D\u63D0\u793A",
7789
+ en: "Dismiss",
7790
+ ja: "\u4ECA\u5F8C\u8868\u793A\u3057\u306A\u3044",
7791
+ ko: "\uB2E4\uC2DC \uBCF4\uC9C0 \uC54A\uAE30",
7792
+ fr: "Masquer",
7793
+ de: "Ausblenden",
7794
+ it: "Nascondi",
7795
+ ru: "\u0421\u043A\u0440\u044B\u0442\u044C",
7796
+ es: "Ocultar",
7797
+ pt: "Ocultar"
7798
+ };
7799
+ var STAR_S_STYLE_ID = "dsh-star-row-s-style";
7800
+ var STAR_S_STYLE = [
7801
+ ".dsh-star-row-s{display:flex;align-items:center;gap:8px;flex-wrap:wrap;",
7802
+ "font-size:12px;line-height:1.5;color:inherit;opacity:.75;margin-top:10px;",
7803
+ "padding-top:8px;border-top:1px solid var(--dsw-alias-border-l2,currentColor)}",
7804
+ ".dsh-star-row-s:hover{opacity:1}",
7805
+ ".dsh-star-link{display:inline-flex;align-items:center;gap:6px;",
7806
+ "color:inherit;text-decoration:none}",
7807
+ ".dsh-star-link:hover{text-decoration:underline}",
7808
+ ".dsh-star-link svg{width:14px;height:14px;flex:none;display:block}",
7809
+ ".dsh-star-row-s .dsh-star-ask{opacity:.85;font-weight:400}",
7810
+ ".dsh-star-cta,.dsh-star-hide{font:inherit;font-size:11px;line-height:1;",
7811
+ "padding:4px 9px;border-radius:999px;border:1px solid currentColor;",
7812
+ "background:transparent;color:inherit;cursor:pointer;flex:none;opacity:.7}",
7813
+ ".dsh-star-hide{padding:4px 7px}",
7814
+ ".dsh-star-cta:hover,.dsh-star-hide:hover{opacity:1}"
7815
+ ].join("");
7816
+ function starLang() {
7817
+ const tag = typeof document !== "undefined" && document.documentElement.lang || "";
7818
+ const low = tag.toLowerCase();
7819
+ for (const cand of STAR_LANGS) if (low.startsWith(cand)) return cand;
7820
+ return "en";
7821
+ }
7822
+ function starDismissed() {
7823
+ try {
7824
+ return localStorage.getItem("dsh.star." + STAR_NS + ".dismissed") === "1";
7825
+ } catch {
7826
+ return false;
7827
+ }
7828
+ }
7829
+ function starDismiss() {
7830
+ try {
7831
+ localStorage.setItem("dsh.star." + STAR_NS + ".dismissed", "1");
7832
+ } catch {
7833
+ }
7834
+ }
7835
+ function injectStarSStyle(d) {
7836
+ if (d.getElementById(STAR_S_STYLE_ID)) return;
7837
+ const style = d.createElement("style");
7838
+ style.id = STAR_S_STYLE_ID;
7839
+ style.textContent = STAR_S_STYLE;
7840
+ d.head.appendChild(style);
7841
+ }
7842
+ function openRepo(d) {
7843
+ const a = d.createElement("a");
7844
+ a.href = REPO_URL;
7845
+ a.target = "_blank";
7846
+ a.rel = "noopener noreferrer";
7847
+ a.click();
7848
+ }
7849
+ function extendedStarRow(link, d) {
7850
+ if (STAR_VARIANT !== "S") return null;
7851
+ if (starDismissed()) return link;
7852
+ injectStarSStyle(d);
7853
+ link.className = "dsh-star-link";
7854
+ const lang = starLang();
7855
+ const row = d.createElement("div");
7856
+ row.className = "dsh-star-row-s";
7857
+ row.appendChild(link);
7858
+ const ask = d.createElement("span");
7859
+ ask.className = "dsh-star-ask";
7860
+ ask.textContent = STAR_COPY[lang].ask;
7861
+ row.appendChild(ask);
7862
+ const cta = d.createElement("button");
7863
+ cta.type = "button";
7864
+ cta.className = "dsh-star-cta";
7865
+ cta.textContent = "\u2605 " + STAR_CTA[lang];
7866
+ cta.addEventListener("click", (event) => {
7867
+ event.preventDefault();
7868
+ event.stopPropagation();
7869
+ openRepo(d);
7870
+ });
7871
+ row.appendChild(cta);
7872
+ const hide = d.createElement("button");
7873
+ hide.type = "button";
7874
+ hide.className = "dsh-star-hide";
7875
+ hide.textContent = "\xD7";
7876
+ hide.title = STAR_HIDE[lang];
7877
+ hide.setAttribute("aria-label", STAR_HIDE[lang]);
7878
+ hide.addEventListener("click", (event) => {
7879
+ event.preventDefault();
7880
+ event.stopPropagation();
7881
+ starDismiss();
7882
+ if (row.parentNode) {
7883
+ row.parentNode.replaceChild(link, row);
7884
+ link.className = "dsh-star-row";
7885
+ }
7886
+ });
7887
+ row.appendChild(hide);
7888
+ return row;
7889
+ }
7890
+ function mountStarRow(doc) {
7891
+ const d = doc ?? document;
7892
+ if (!d.getElementById(STYLE_ID)) {
7893
+ const tag = d.createElement("style");
7894
+ tag.id = STYLE_ID;
7895
+ tag.textContent = STYLE_CSS;
7896
+ d.head.appendChild(tag);
7897
+ }
7898
+ const match = REPO_URL.match(/github\.com\/([^/]+\/[^/#?]+)/);
7899
+ const repo = match ? match[1] : "drscrewdriver";
7900
+ const a = d.createElement("a");
7901
+ a.className = "dsh-star-row";
7902
+ a.href = REPO_URL;
7903
+ a.target = "_blank";
7904
+ a.rel = "noreferrer";
7905
+ a.dataset.starNs = STAR_NS;
7906
+ const svg = d.createElementNS("http://www.w3.org/2000/svg", "svg");
7907
+ svg.setAttribute("viewBox", "0 0 24 24");
7908
+ svg.setAttribute("aria-hidden", "true");
7909
+ const path = d.createElementNS("http://www.w3.org/2000/svg", "path");
7910
+ path.setAttribute("fill", "currentColor");
7911
+ path.setAttribute("d", GITHUB_MARK_PATH);
7912
+ svg.appendChild(path);
7913
+ a.appendChild(svg);
7914
+ const label = d.createElement("span");
7915
+ label.textContent = repo;
7916
+ a.appendChild(label);
7917
+ const row = extendedStarRow(a, d);
7918
+ if (row) return row;
7919
+ if (STAR_VARIANT === "A") {
7920
+ const ask = d.createElement("span");
7921
+ ask.className = "dsh-star-ask";
7922
+ ask.textContent = pickLang().ask;
7923
+ a.appendChild(ask);
7924
+ }
7925
+ return a;
7926
+ }
7927
+
7740
7928
  // src/client.tsx
7741
7929
  var import_jsx_runtime3 = require("react/jsx-runtime");
7742
7930
  var SETTINGS_NS = "settings.bash-terminal";
@@ -7990,7 +8178,10 @@ function ShellDockSection() {
7990
8178
  function SettingsBody() {
7991
8179
  return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
7992
8180
  /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ShellPreferenceRow, {}),
7993
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ShellDockSection, {})
8181
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ShellDockSection, {}),
8182
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { ref: (node) => {
8183
+ if (node && !node.firstChild) node.appendChild(mountStarRow());
8184
+ } })
7994
8185
  ] });
7995
8186
  }
7996
8187
  var hostSettingsSurface = "unknown";
package/dist/client.js CHANGED
@@ -38,9 +38,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
38
38
  ));
39
39
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
40
40
 
41
- // node_modules/.pnpm/@xterm+addon-fit@0.10.0_@xterm+xterm@5.5.0/node_modules/@xterm/addon-fit/lib/addon-fit.js
41
+ // node_modules/@xterm/addon-fit/lib/addon-fit.js
42
42
  var require_addon_fit = __commonJS({
43
- "node_modules/.pnpm/@xterm+addon-fit@0.10.0_@xterm+xterm@5.5.0/node_modules/@xterm/addon-fit/lib/addon-fit.js"(exports, module2) {
43
+ "node_modules/@xterm/addon-fit/lib/addon-fit.js"(exports, module2) {
44
44
  !(function(e, t) {
45
45
  "object" == typeof exports && "object" == typeof module2 ? module2.exports = t() : "function" == typeof define && define.amd ? define([], t) : "object" == typeof exports ? exports.FitAddon = t() : e.FitAddon = t();
46
46
  })(self, (() => (() => {
@@ -74,9 +74,9 @@ var require_addon_fit = __commonJS({
74
74
  }
75
75
  });
76
76
 
77
- // node_modules/.pnpm/@xterm+xterm@5.5.0/node_modules/@xterm/xterm/lib/xterm.js
77
+ // node_modules/@xterm/xterm/lib/xterm.js
78
78
  var require_xterm = __commonJS({
79
- "node_modules/.pnpm/@xterm+xterm@5.5.0/node_modules/@xterm/xterm/lib/xterm.js"(exports, module2) {
79
+ "node_modules/@xterm/xterm/lib/xterm.js"(exports, module2) {
80
80
  !(function(e, t) {
81
81
  if ("object" == typeof exports && "object" == typeof module2) module2.exports = t();
82
82
  else if ("function" == typeof define && define.amd) define([], t);
@@ -7176,7 +7176,7 @@ var import_react2 = require("react");
7176
7176
  var import_addon_fit = __toESM(require_addon_fit(), 1);
7177
7177
  var import_xterm = __toESM(require_xterm(), 1);
7178
7178
 
7179
- // node_modules/.pnpm/@xterm+xterm@5.5.0/node_modules/@xterm/xterm/css/xterm.css
7179
+ // node_modules/@xterm/xterm/css/xterm.css
7180
7180
  var xterm_default = `/**
7181
7181
  * Copyright (c) 2014 The xterm.js authors. All rights reserved.
7182
7182
  * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
@@ -7742,6 +7742,194 @@ function MultiShellTerminal(props) {
7742
7742
  ] });
7743
7743
  }
7744
7744
 
7745
+ // src/webterminals/browser/star-row-copy.ts
7746
+ var REPO_URL = "https://github.com/drscrewdriver/dsh-bash-terminal-ts";
7747
+ var STAR_NS = "bash-terminal";
7748
+ var STAR_VARIANT = "S";
7749
+ var STAR_COPY = {
7750
+ zh: { ask: "\u89C9\u5F97\u7701\u4E8B\u4E86\uFF1F\u4E00\u9897 Star \u8BA9\u5DE5\u5177\u88AB\u66F4\u591A\u4EBA\u770B\u89C1" },
7751
+ en: { ask: "Finding it handy? A star helps more people discover this tool" },
7752
+ ja: { ask: "\u4FBF\u5229\u3067\u3057\u305F\u3089\u2B50\u3067\u3001\u3053\u306E\u30C4\u30FC\u30EB\u304C\u3082\u3063\u3068\u5C4A\u304D\u307E\u3059" },
7753
+ ko: { ask: "\uC720\uC6A9\uD588\uB2E4\uBA74 \u2B50 \uD558\uB098\uB85C \uB354 \uB9CE\uC740 \uC0AC\uC6A9\uC790\uC5D0\uAC8C \uB2FF\uC2B5\uB2C8\uB2E4" },
7754
+ fr: { ask: "Utile ? Une \xE9toile aide cet outil \xE0 \xEAtre d\xE9couvert" },
7755
+ de: { ask: "N\xFCtzlich? Ein Stern hilft dem Tool, gesehen zu werden" },
7756
+ it: { ask: "Ti \xE8 utile? Una stella aiuta questo tool a farsi scoprire" },
7757
+ ru: { ask: "\u041F\u0440\u0438\u0433\u043E\u0434\u0438\u043B\u043E\u0441\u044C? \u0417\u0432\u0435\u0437\u0434\u0430 \u043F\u043E\u043C\u043E\u0436\u0435\u0442 \u0431\u043E\u043B\u044C\u0448\u0435\u043C\u0443 \u0447\u0438\u0441\u043B\u0443 \u043B\u044E\u0434\u0435\u0439 \u0443\u0437\u043D\u0430\u0442\u044C \u043E tool" },
7758
+ es: { ask: "\xBFTe resulta \xFAtil? Una estrella ayuda a que m\xE1s gente lo descubra" },
7759
+ pt: { ask: "Achou \xFAtil? Uma estrela ajuda mais pessoas a descobrir a ferramenta" }
7760
+ };
7761
+ var STAR_LANGS = ["zh", "en", "ja", "ko", "fr", "de", "it", "ru", "es", "pt"];
7762
+ var 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 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 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332 -5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 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 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 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 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12";
7763
+ var STYLE_ID = "dsh-star-row-style";
7764
+ var STYLE_CSS = [
7765
+ ".dsh-star-row{display:flex;align-items:center;gap:7px;font-size:12px;",
7766
+ "line-height:1.5;color:inherit;text-decoration:none;opacity:.72;padding:3px 0;",
7767
+ "margin-top:6px;min-width:0;flex-wrap:wrap}",
7768
+ ".dsh-star-row:hover{opacity:1;text-decoration:underline}",
7769
+ ".dsh-star-row svg{width:14px;height:14px;flex:none;display:block}",
7770
+ ".dsh-star-row .dsh-star-ask{opacity:.85;font-weight:400}"
7771
+ ].join("");
7772
+ function pickLang() {
7773
+ const tag = typeof document !== "undefined" && document.documentElement.lang || "";
7774
+ const low = tag.toLowerCase();
7775
+ for (const cand of STAR_LANGS) {
7776
+ if (low.startsWith(cand)) return STAR_COPY[cand];
7777
+ }
7778
+ return STAR_COPY.en;
7779
+ }
7780
+ var STAR_CTA = {
7781
+ zh: "\u7559\u9897 Star",
7782
+ en: "Star",
7783
+ ja: "\u30B9\u30BF\u30FC",
7784
+ ko: "\uC2A4\uD0C0",
7785
+ fr: "Star",
7786
+ de: "Stern",
7787
+ it: "Stella",
7788
+ ru: "\u0417\u0432\u0435\u0437\u0434\u0430",
7789
+ es: "Estrella",
7790
+ pt: "Estrela"
7791
+ };
7792
+ var STAR_HIDE = {
7793
+ zh: "\u4E0D\u518D\u63D0\u793A",
7794
+ en: "Dismiss",
7795
+ ja: "\u4ECA\u5F8C\u8868\u793A\u3057\u306A\u3044",
7796
+ ko: "\uB2E4\uC2DC \uBCF4\uC9C0 \uC54A\uAE30",
7797
+ fr: "Masquer",
7798
+ de: "Ausblenden",
7799
+ it: "Nascondi",
7800
+ ru: "\u0421\u043A\u0440\u044B\u0442\u044C",
7801
+ es: "Ocultar",
7802
+ pt: "Ocultar"
7803
+ };
7804
+ var STAR_S_STYLE_ID = "dsh-star-row-s-style";
7805
+ var STAR_S_STYLE = [
7806
+ ".dsh-star-row-s{display:flex;align-items:center;gap:8px;flex-wrap:wrap;",
7807
+ "font-size:12px;line-height:1.5;color:inherit;opacity:.75;margin-top:10px;",
7808
+ "padding-top:8px;border-top:1px solid var(--dsw-alias-border-l2,currentColor)}",
7809
+ ".dsh-star-row-s:hover{opacity:1}",
7810
+ ".dsh-star-link{display:inline-flex;align-items:center;gap:6px;",
7811
+ "color:inherit;text-decoration:none}",
7812
+ ".dsh-star-link:hover{text-decoration:underline}",
7813
+ ".dsh-star-link svg{width:14px;height:14px;flex:none;display:block}",
7814
+ ".dsh-star-row-s .dsh-star-ask{opacity:.85;font-weight:400}",
7815
+ ".dsh-star-cta,.dsh-star-hide{font:inherit;font-size:11px;line-height:1;",
7816
+ "padding:4px 9px;border-radius:999px;border:1px solid currentColor;",
7817
+ "background:transparent;color:inherit;cursor:pointer;flex:none;opacity:.7}",
7818
+ ".dsh-star-hide{padding:4px 7px}",
7819
+ ".dsh-star-cta:hover,.dsh-star-hide:hover{opacity:1}"
7820
+ ].join("");
7821
+ function starLang() {
7822
+ const tag = typeof document !== "undefined" && document.documentElement.lang || "";
7823
+ const low = tag.toLowerCase();
7824
+ for (const cand of STAR_LANGS) if (low.startsWith(cand)) return cand;
7825
+ return "en";
7826
+ }
7827
+ function starDismissed() {
7828
+ try {
7829
+ return localStorage.getItem("dsh.star." + STAR_NS + ".dismissed") === "1";
7830
+ } catch {
7831
+ return false;
7832
+ }
7833
+ }
7834
+ function starDismiss() {
7835
+ try {
7836
+ localStorage.setItem("dsh.star." + STAR_NS + ".dismissed", "1");
7837
+ } catch {
7838
+ }
7839
+ }
7840
+ function injectStarSStyle(d) {
7841
+ if (d.getElementById(STAR_S_STYLE_ID)) return;
7842
+ const style = d.createElement("style");
7843
+ style.id = STAR_S_STYLE_ID;
7844
+ style.textContent = STAR_S_STYLE;
7845
+ d.head.appendChild(style);
7846
+ }
7847
+ function openRepo(d) {
7848
+ const a = d.createElement("a");
7849
+ a.href = REPO_URL;
7850
+ a.target = "_blank";
7851
+ a.rel = "noopener noreferrer";
7852
+ a.click();
7853
+ }
7854
+ function extendedStarRow(link, d) {
7855
+ if (STAR_VARIANT !== "S") return null;
7856
+ if (starDismissed()) return link;
7857
+ injectStarSStyle(d);
7858
+ link.className = "dsh-star-link";
7859
+ const lang = starLang();
7860
+ const row = d.createElement("div");
7861
+ row.className = "dsh-star-row-s";
7862
+ row.appendChild(link);
7863
+ const ask = d.createElement("span");
7864
+ ask.className = "dsh-star-ask";
7865
+ ask.textContent = STAR_COPY[lang].ask;
7866
+ row.appendChild(ask);
7867
+ const cta = d.createElement("button");
7868
+ cta.type = "button";
7869
+ cta.className = "dsh-star-cta";
7870
+ cta.textContent = "\u2605 " + STAR_CTA[lang];
7871
+ cta.addEventListener("click", (event) => {
7872
+ event.preventDefault();
7873
+ event.stopPropagation();
7874
+ openRepo(d);
7875
+ });
7876
+ row.appendChild(cta);
7877
+ const hide = d.createElement("button");
7878
+ hide.type = "button";
7879
+ hide.className = "dsh-star-hide";
7880
+ hide.textContent = "\xD7";
7881
+ hide.title = STAR_HIDE[lang];
7882
+ hide.setAttribute("aria-label", STAR_HIDE[lang]);
7883
+ hide.addEventListener("click", (event) => {
7884
+ event.preventDefault();
7885
+ event.stopPropagation();
7886
+ starDismiss();
7887
+ if (row.parentNode) {
7888
+ row.parentNode.replaceChild(link, row);
7889
+ link.className = "dsh-star-row";
7890
+ }
7891
+ });
7892
+ row.appendChild(hide);
7893
+ return row;
7894
+ }
7895
+ function mountStarRow(doc) {
7896
+ const d = doc ?? document;
7897
+ if (!d.getElementById(STYLE_ID)) {
7898
+ const tag = d.createElement("style");
7899
+ tag.id = STYLE_ID;
7900
+ tag.textContent = STYLE_CSS;
7901
+ d.head.appendChild(tag);
7902
+ }
7903
+ const match = REPO_URL.match(/github\.com\/([^/]+\/[^/#?]+)/);
7904
+ const repo = match ? match[1] : "drscrewdriver";
7905
+ const a = d.createElement("a");
7906
+ a.className = "dsh-star-row";
7907
+ a.href = REPO_URL;
7908
+ a.target = "_blank";
7909
+ a.rel = "noreferrer";
7910
+ a.dataset.starNs = STAR_NS;
7911
+ const svg = d.createElementNS("http://www.w3.org/2000/svg", "svg");
7912
+ svg.setAttribute("viewBox", "0 0 24 24");
7913
+ svg.setAttribute("aria-hidden", "true");
7914
+ const path = d.createElementNS("http://www.w3.org/2000/svg", "path");
7915
+ path.setAttribute("fill", "currentColor");
7916
+ path.setAttribute("d", GITHUB_MARK_PATH);
7917
+ svg.appendChild(path);
7918
+ a.appendChild(svg);
7919
+ const label = d.createElement("span");
7920
+ label.textContent = repo;
7921
+ a.appendChild(label);
7922
+ const row = extendedStarRow(a, d);
7923
+ if (row) return row;
7924
+ if (STAR_VARIANT === "A") {
7925
+ const ask = d.createElement("span");
7926
+ ask.className = "dsh-star-ask";
7927
+ ask.textContent = pickLang().ask;
7928
+ a.appendChild(ask);
7929
+ }
7930
+ return a;
7931
+ }
7932
+
7745
7933
  // src/client.tsx
7746
7934
  var import_jsx_runtime3 = require("react/jsx-runtime");
7747
7935
  var SETTINGS_NS = "settings.bash-terminal";
@@ -7995,7 +8183,10 @@ function ShellDockSection() {
7995
8183
  function SettingsBody() {
7996
8184
  return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
7997
8185
  /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ShellPreferenceRow, {}),
7998
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ShellDockSection, {})
8186
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ShellDockSection, {}),
8187
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { ref: (node) => {
8188
+ if (node && !node.firstChild) node.appendChild(mountStarRow());
8189
+ } })
7999
8190
  ] });
8000
8191
  }
8001
8192
  var hostSettingsSurface = "unknown";
package/dsh.plugin.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "id": "dsh-bash-terminal-ts",
3
3
  "name": "dsh-bash-terminal-ts",
4
- "version": "0.9.2",
4
+ "version": "0.9.3",
5
5
  "description": {
6
6
  "en": "One shell tool that runs commands through PowerShell, Git Bash, MSYS2, WSL or Niubash on Windows, plus an embedded terminal for the bottom dock with per-shell activation switches and a default-shell fallback chain.",
7
7
  "zh": "一个 shell 工具,可在 Windows 上通过 PowerShell / Git Bash / MSYS2 / WSL / Niubash 执行命令;另提供底部工作台的内嵌终端,支持按 shell 激活开关与默认 shell 回落链。",