@xrxs-ai/dsh-xrxs-plugins-store 0.2.6 → 0.2.7

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.
Files changed (2) hide show
  1. package/lib/client.js +139 -79
  2. package/package.json +1 -1
package/lib/client.js CHANGED
@@ -30,10 +30,10 @@ __export(index_exports, {
30
30
  inject: () => inject
31
31
  });
32
32
  module.exports = __toCommonJS(index_exports);
33
- var import_react12 = require("react");
33
+ var import_react13 = require("react");
34
34
 
35
35
  // src/client/MarketplaceApp.tsx
36
- var import_react9 = require("react");
36
+ var import_react10 = require("react");
37
37
 
38
38
  // src/client/pages/DeveloperPage.tsx
39
39
  var import_react4 = require("react");
@@ -933,14 +933,27 @@ var MARKET_CSS = `
933
933
  font-size: 13px; line-height: 18px; color: var(--dsw-alias-label-tertiary, #8f959e);
934
934
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
935
935
  }
936
+ /* \u884C\u5C3E\u5143\u4FE1\u606F\u6309\u56FA\u5B9A\u56DB\u5217\u6392(\u7248\u672C / \u4E0B\u8F7D\u91CF / \u517C\u5BB9\u6027 / \u64CD\u4F5C),\u9010\u5217\u4E0E\u4E0A\u4E0B\u884C\u5BF9\u9F50:
937
+ \u82E5\u7528\u53F3\u5BF9\u9F50 flex,\u672B\u5217(\u6309\u94AE\u6216\u300C\u5DF2\u5B89\u88C5\u300D\u5FBD\u6807)\u5BBD\u5EA6\u4E0D\u540C\u4F1A\u628A\u5DE6\u8FB9\u6240\u6709\u5217\u4E00\u8D77\u63A8\u7740\u5DE6\u53F3\u6D6E\u52A8 */
936
938
  .xps-mk-row-meta {
937
- flex: none; display: flex; align-items: center; gap: 10px;
939
+ flex: none;
940
+ display: grid;
941
+ grid-template-columns: 140px 56px 124px 74px;
942
+ align-items: center;
943
+ justify-items: end;
944
+ column-gap: 8px;
938
945
  font-size: 12px; line-height: 18px; color: var(--dsw-alias-label-tertiary, #8f959e);
939
946
  }
947
+ .xps-mk-row-meta > * { min-width: 0; }
940
948
  .xps-mk-row-version {
941
949
  font-variant-numeric: tabular-nums;
942
950
  font-family: var(--dsw-font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
951
+ white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
943
952
  }
953
+ .xps-mk-row-downloads { font-variant-numeric: tabular-nums; white-space: nowrap; }
954
+ /* \u517C\u5BB9\u6027\u5FBD\u6807\u5217\u5BBD\u56FA\u5B9A:\u8D85\u957F compatRange \u7684\u4E0D\u6362\u884C\u5FBD\u6807\u5217\u5185\u53F3\u5BF9\u9F50,\u6EA2\u51FA\u65F6\u5411\u5DE6\u8BA9\u4F4D(\u4E0D\u628A\u5217\u6491\u5BBD) */
955
+ .xps-mk-row-compat { display: inline-flex; justify-content: flex-end; }
956
+ .xps-mk-row-action { display: inline-flex; justify-content: flex-end; }
944
957
  /* \u56FE\u6807:r11;\u5F69\u8272\u6E10\u53D8\u7531 PluginIcon \u5185\u8054 gradient,\u65E0 hairline */
945
958
  /* \u56FE\u6807:r10(\u4E0E\u5DF2\u88C5\u9875 .xps-row-icon \u7684 40px \u5706\u89D2\u4E00\u81F4) */
946
959
  .xps-mk-icon {
@@ -1079,6 +1092,17 @@ var MARKET_CSS = `
1079
1092
  cursor: pointer; text-decoration: none;
1080
1093
  }
1081
1094
  .xps-md-link:hover { text-decoration: underline; }
1095
+ /* README \u56FE\u7247:\u4E0D\u8D85\u51FA\u6B63\u6587\u5BBD(\u5FBD\u6807\u7C7B\u5C0F\u56FE\u4FDD\u6301\u539F\u59CB\u5C3A\u5BF8);\u52A0\u8F7D\u5931\u8D25\u964D\u7EA7\u4E3A\u7070\u8272\u6587\u672C */
1096
+ .xps-md-img {
1097
+ max-width: 100%; height: auto;
1098
+ border-radius: 6px; vertical-align: middle;
1099
+ }
1100
+ .xps-md-img-fallback {
1101
+ display: inline-block; padding: 0 4px;
1102
+ font-size: 12px; color: var(--dsw-alias-label-tertiary, #8f959e);
1103
+ background: var(--dsw-alias-bg-layer-2, #f5f6f7);
1104
+ border-radius: 4px;
1105
+ }
1082
1106
  .xps-md-table-wrap { margin: 8px 0; overflow-x: auto; }
1083
1107
  .xps-md-table {
1084
1108
  border-collapse: collapse; width: 100%; font-size: 12px; line-height: 1.6;
@@ -1791,7 +1815,7 @@ function UploadForm(props) {
1791
1815
  ] }),
1792
1816
  /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("li", { children: [
1793
1817
  /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("b", { children: "README \u8BF7\u5C3D\u91CF\u5199\u6E05\u695A:" }),
1794
- "README \u662F\u5E02\u573A\u8BE6\u60C5\u9875\u7684\u5168\u90E8\u5C55\u793A\u5185\u5BB9,\u652F\u6301\u6807\u51C6 markdown(\u6807\u9898\u3001\u5217\u8868\u3001\u8868\u683C\u3001\u4EE3\u7801\u5757\u3001\u94FE\u63A5)\u3002\u5EFA\u8BAE\u5305\u542B:\u63D2\u4EF6\u89E3\u51B3\u4EC0\u4E48\u95EE\u9898\u3001\u5982\u4F55\u5B89\u88C5\u542F\u7528\u3001\u5404\u529F\u80FD\u600E\u4E48\u7528\u3001\u6709\u54EA\u4E9B\u914D\u7F6E\u9879\u4E0E\u6CE8\u610F\u4E8B\u9879 \u2014\u2014 \u8BF4\u660E\u8D8A\u5B8C\u6574,\u8D8A\u5BB9\u6613\u901A\u8FC7\u5BA1\u6838,\u4E5F\u8D8A\u5BB9\u6613\u88AB\u4F7F\u7528\u3002"
1818
+ "README \u662F\u5E02\u573A\u8BE6\u60C5\u9875\u7684\u5168\u90E8\u5C55\u793A\u5185\u5BB9,\u652F\u6301\u6807\u51C6 markdown(\u6807\u9898\u3001\u5217\u8868\u3001\u8868\u683C\u3001\u4EE3\u7801\u5757\u3001\u94FE\u63A5\u3001\u56FE\u7247 \u2014\u2014 \u56FE\u7247\u4EC5\u652F\u6301 http/https \u5916\u94FE,\u4E0D\u652F\u6301\u76F8\u5BF9\u8DEF\u5F84)\u3002\u5EFA\u8BAE\u5305\u542B:\u63D2\u4EF6\u89E3\u51B3\u4EC0\u4E48\u95EE\u9898\u3001\u5982\u4F55\u5B89\u88C5\u542F\u7528\u3001\u5404\u529F\u80FD\u600E\u4E48\u7528\u3001\u6709\u54EA\u4E9B\u914D\u7F6E\u9879\u4E0E\u6CE8\u610F\u4E8B\u9879 \u2014\u2014 \u8BF4\u660E\u8D8A\u5B8C\u6574,\u8D8A\u5BB9\u6613\u901A\u8FC7\u5BA1\u6838,\u4E5F\u8D8A\u5BB9\u6613\u88AB\u4F7F\u7528\u3002"
1795
1819
  ] }),
1796
1820
  /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("li", { children: [
1797
1821
  /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("b", { children: "\u4EA7\u7269\u5305(*.tgz):" }),
@@ -2701,6 +2725,8 @@ function PluginRow(props) {
2701
2725
  const compat = checkCompat(p.compatRange, props.dshVersion);
2702
2726
  const installed = props.installed;
2703
2727
  const upToDate = installed !== void 0 && !installed.updateAvailable;
2728
+ const versionLabel = installed !== void 0 && installed.updateAvailable ? `v${installed.version} \u2192 v${p.version}` : `v${p.version}`;
2729
+ const versionTitle = installed !== void 0 && installed.updateAvailable ? `\u672C\u673A\u5DF2\u5B89\u88C5 v${installed.version},\u53EF\u66F4\u65B0\u5230\u5E02\u573A\u6700\u65B0 v${p.version}` : `\u5E02\u573A\u6700\u65B0\u7248\u672C v${p.version}`;
2704
2730
  const open = () => props.onOpen?.(p.id);
2705
2731
  return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
2706
2732
  "div",
@@ -2724,23 +2750,16 @@ function PluginRow(props) {
2724
2750
  /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "xps-mk-row-summary", children: p.summary })
2725
2751
  ] }),
2726
2752
  /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "xps-mk-row-meta", children: [
2727
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("span", { className: "xps-mk-row-version", children: [
2728
- "v",
2729
- p.version
2730
- ] }),
2731
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("span", { title: `\u4E0B\u8F7D\u91CF ${p.downloads}`, children: [
2753
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "xps-mk-row-version", title: versionTitle, children: versionLabel }),
2754
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("span", { className: "xps-mk-row-downloads", title: `\u4E0B\u8F7D\u91CF ${p.downloads}`, children: [
2732
2755
  "\u2B07 ",
2733
2756
  formatDownloads(p.downloads)
2734
2757
  ] }),
2735
- compat.ok === null ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Badge, { children: "? \u517C\u5BB9\u6027\u672A\u77E5" }) : compat.ok ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Badge, { tone: "success", children: "\u2714 \u517C\u5BB9\u672C\u673A" }) : /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(Badge, { tone: "warning", children: [
2758
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "xps-mk-row-compat", children: compat.ok === null ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Badge, { children: "? \u517C\u5BB9\u6027\u672A\u77E5" }) : compat.ok ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Badge, { tone: "success", children: "\u2714 \u517C\u5BB9\u672C\u673A" }) : /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(Badge, { tone: "warning", children: [
2736
2759
  "\u26A0 \u9700 dsh ",
2737
2760
  p.compatRange
2738
- ] }),
2739
- installed !== void 0 && (installed.updateAvailable ? /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(Badge, { tone: "warning", children: [
2740
- "\u2191 \u53EF\u66F4\u65B0 v",
2741
- installed.version
2742
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Badge, { tone: "success", children: "\u2713 \u5DF2\u5B89\u88C5" })),
2743
- !upToDate && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
2761
+ ] }) }),
2762
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "xps-mk-row-action", children: upToDate ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Badge, { tone: "success", children: "\u2713 \u5DF2\u5B89\u88C5" }) : /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
2744
2763
  InstallButton,
2745
2764
  {
2746
2765
  pluginName: p.name,
@@ -2753,7 +2772,7 @@ function PluginRow(props) {
2753
2772
  size: "small",
2754
2773
  onToast: props.onToast
2755
2774
  }
2756
- )
2775
+ ) })
2757
2776
  ] })
2758
2777
  ]
2759
2778
  }
@@ -3011,9 +3030,10 @@ function MarketPage(props) {
3011
3030
  }
3012
3031
 
3013
3032
  // src/client/pages/PluginDetailPage.tsx
3014
- var import_react8 = require("react");
3033
+ var import_react9 = require("react");
3015
3034
 
3016
3035
  // src/client/pages/market/Markdown.tsx
3036
+ var import_react8 = require("react");
3017
3037
  var import_jsx_runtime18 = require("react/jsx-runtime");
3018
3038
  function Markdown(props) {
3019
3039
  return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "xps-md", children: renderBlocks(props.text) });
@@ -3151,16 +3171,80 @@ function renderBlocks(text, depth = 0) {
3151
3171
  }
3152
3172
  return blocks;
3153
3173
  }
3174
+ function MarkdownImage(props) {
3175
+ const [failed, setFailed] = (0, import_react8.useState)(false);
3176
+ (0, import_react8.useEffect)(() => setFailed(false), [props.src]);
3177
+ if (failed) {
3178
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "xps-md-img-fallback", title: props.alt, children: props.alt === "" ? "[\u56FE\u7247\u52A0\u8F7D\u5931\u8D25]" : `[\u56FE\u7247\u52A0\u8F7D\u5931\u8D25:${props.alt}]` });
3179
+ }
3180
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
3181
+ "img",
3182
+ {
3183
+ className: "xps-md-img",
3184
+ src: props.src,
3185
+ alt: props.alt,
3186
+ loading: "lazy",
3187
+ referrerPolicy: "no-referrer",
3188
+ onError: () => setFailed(true)
3189
+ }
3190
+ );
3191
+ }
3192
+ function renderLink(url, content, key) {
3193
+ if (!/^https?:\/\//.test(url)) return null;
3194
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
3195
+ "span",
3196
+ {
3197
+ className: "xps-md-link",
3198
+ role: "link",
3199
+ tabIndex: 0,
3200
+ onClick: () => void window.open(url, "_blank", "noopener,noreferrer"),
3201
+ onKeyDown: (event) => {
3202
+ if (event.key === "Enter" || event.key === " ") {
3203
+ event.preventDefault();
3204
+ void window.open(url, "_blank", "noopener,noreferrer");
3205
+ }
3206
+ },
3207
+ children: content
3208
+ },
3209
+ key
3210
+ );
3211
+ }
3154
3212
  function renderInline(text, keyPrefix) {
3155
3213
  const nodes = [];
3156
- const pattern = /(\*\*[^*]+\*\*|~~[^~]+~~|`[^`]+`|\[[^\]]*\]\([^)\s]*(?:\([^)\s]*\)[^)\s]*)?\))/g;
3214
+ const pattern = /(\[!\[[^\]]*\]\(\s*[^()\s]*(?:\([^()\s]*\)[^()\s]*)?\s*\)\]\(\s*[^()\s]*(?:\([^()\s]*\)[^()\s]*)?\s*\)|!\[[^\]]*\]\(\s*[^()\s]*(?:\([^()\s]*\)[^()\s]*)?\s*\)|\*\*[^*]+\*\*|~~[^~]+~~|`[^`]+`|\[[^\]]*\]\(\s*[^()\s]*(?:\([^()\s]*\)[^()\s]*)?\s*\))/g;
3157
3215
  let last = 0;
3158
3216
  let seq = 0;
3159
3217
  let m;
3160
3218
  while ((m = pattern.exec(text)) !== null) {
3161
3219
  if (m.index > last) nodes.push(text.slice(last, m.index));
3162
3220
  const token = m[0];
3163
- if (token.startsWith("**")) {
3221
+ if (token.startsWith("[![")) {
3222
+ const split = token.lastIndexOf("](");
3223
+ const inner = token.slice(1, split);
3224
+ const href = token.slice(split + 2, -1).trim();
3225
+ const image = /^!\[([^\]]*)\]\(([\s\S]*)\)$/.exec(inner);
3226
+ if (image === null) {
3227
+ nodes.push(token);
3228
+ } else {
3229
+ const [, alt = "", rawSrc = ""] = image;
3230
+ const src = rawSrc.trim();
3231
+ const picture = /^https?:\/\//.test(src) ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(MarkdownImage, { src, alt }, `${keyPrefix}-nimg${seq}`) : alt === "" ? token : alt;
3232
+ nodes.push(renderLink(href, picture, `${keyPrefix}-na${seq}`) ?? picture);
3233
+ }
3234
+ } else if (token.startsWith("![")) {
3235
+ const image = /^!\[([^\]]*)\]\((.+)\)$/.exec(token);
3236
+ if (image === null) {
3237
+ nodes.push(token);
3238
+ } else {
3239
+ const [, alt = "", rawSrc = ""] = image;
3240
+ const src = rawSrc.trim();
3241
+ if (/^https?:\/\//.test(src)) {
3242
+ nodes.push(/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(MarkdownImage, { src, alt }, `${keyPrefix}-img${seq}`));
3243
+ } else {
3244
+ nodes.push(token);
3245
+ }
3246
+ }
3247
+ } else if (token.startsWith("**")) {
3164
3248
  nodes.push(
3165
3249
  /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("strong", { children: renderInline(token.slice(2, -2), `${keyPrefix}-b${seq}`) }, `${keyPrefix}-b${seq}`)
3166
3250
  );
@@ -3178,32 +3262,8 @@ function renderInline(text, keyPrefix) {
3178
3262
  nodes.push(token);
3179
3263
  } else {
3180
3264
  const [, label = "", rawUrl = ""] = link;
3181
- const isImage = label.startsWith("!");
3182
- const text2 = isImage ? label.slice(1) : label;
3183
3265
  const url = rawUrl.trim();
3184
- if (/^https?:\/\//.test(url)) {
3185
- nodes.push(
3186
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
3187
- "span",
3188
- {
3189
- className: "xps-md-link",
3190
- role: "link",
3191
- tabIndex: 0,
3192
- onClick: () => void window.open(url, "_blank", "noopener,noreferrer"),
3193
- onKeyDown: (event) => {
3194
- if (event.key === "Enter" || event.key === " ") {
3195
- event.preventDefault();
3196
- void window.open(url, "_blank", "noopener,noreferrer");
3197
- }
3198
- },
3199
- children: text2 === "" ? url : text2
3200
- },
3201
- `${keyPrefix}-a${seq}`
3202
- )
3203
- );
3204
- } else {
3205
- nodes.push(isImage ? label : token);
3206
- }
3266
+ nodes.push(renderLink(url, label === "" ? url : label, `${keyPrefix}-a${seq}`) ?? token);
3207
3267
  }
3208
3268
  }
3209
3269
  last = m.index + token.length;
@@ -3235,15 +3295,15 @@ var import_jsx_runtime19 = require("react/jsx-runtime");
3235
3295
  function PluginDetailPage(props) {
3236
3296
  ensureMarketStyles();
3237
3297
  const pluginId = props.pluginId ?? "";
3238
- const [detail, setDetail] = (0, import_react8.useState)(null);
3239
- const [status, setStatus] = (0, import_react8.useState)("loading");
3240
- const [selectedVersion, setSelectedVersion] = (0, import_react8.useState)(null);
3241
- const [reloadFlag, setReloadFlag] = (0, import_react8.useState)(0);
3242
- const [dshVersion, setDshVersion] = (0, import_react8.useState)(null);
3243
- const [installed, setInstalled] = (0, import_react8.useState)(null);
3298
+ const [detail, setDetail] = (0, import_react9.useState)(null);
3299
+ const [status, setStatus] = (0, import_react9.useState)("loading");
3300
+ const [selectedVersion, setSelectedVersion] = (0, import_react9.useState)(null);
3301
+ const [reloadFlag, setReloadFlag] = (0, import_react9.useState)(0);
3302
+ const [dshVersion, setDshVersion] = (0, import_react9.useState)(null);
3303
+ const [installed, setInstalled] = (0, import_react9.useState)(null);
3244
3304
  const toasts = useToasts();
3245
- const installedSeq = (0, import_react8.useRef)(0);
3246
- const loadInstalled = (0, import_react8.useCallback)(
3305
+ const installedSeq = (0, import_react9.useRef)(0);
3306
+ const loadInstalled = (0, import_react9.useCallback)(
3247
3307
  (...names) => {
3248
3308
  const seq = ++installedSeq.current;
3249
3309
  getInstalled().then((list) => {
@@ -3260,7 +3320,7 @@ function PluginDetailPage(props) {
3260
3320
  setSelectedVersion(version);
3261
3321
  if (detail !== null) loadInstalled(pluginId, detail.name);
3262
3322
  };
3263
- (0, import_react8.useEffect)(() => {
3323
+ (0, import_react9.useEffect)(() => {
3264
3324
  if (detail === null) return;
3265
3325
  const onVisible = () => {
3266
3326
  if (document.visibilityState === "visible") loadInstalled(pluginId, detail.name);
@@ -3268,7 +3328,7 @@ function PluginDetailPage(props) {
3268
3328
  document.addEventListener("visibilitychange", onVisible);
3269
3329
  return () => document.removeEventListener("visibilitychange", onVisible);
3270
3330
  }, [detail, pluginId, loadInstalled]);
3271
- (0, import_react8.useEffect)(() => {
3331
+ (0, import_react9.useEffect)(() => {
3272
3332
  let alive = true;
3273
3333
  getHostInfo().then((info) => {
3274
3334
  if (alive) setDshVersion(info.dshVersion);
@@ -3278,7 +3338,7 @@ function PluginDetailPage(props) {
3278
3338
  alive = false;
3279
3339
  };
3280
3340
  }, []);
3281
- (0, import_react8.useEffect)(() => {
3341
+ (0, import_react9.useEffect)(() => {
3282
3342
  let alive = true;
3283
3343
  setStatus("loading");
3284
3344
  setDetail(null);
@@ -3416,7 +3476,7 @@ function PluginDetailPage(props) {
3416
3476
  value: displayVersion,
3417
3477
  title: "\u5207\u6362\u7248\u672C",
3418
3478
  onChange: (e) => selectVersion(e.target.value),
3419
- children: detail.versions.map((v) => /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("option", { value: v.version, children: [
3479
+ children: [...detail.versions].sort((a, b) => compareVersions(b.version, a.version)).map((v) => /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("option", { value: v.version, children: [
3420
3480
  "v",
3421
3481
  v.version,
3422
3482
  " \xB7 ",
@@ -3470,8 +3530,8 @@ var NAV_ITEMS = [
3470
3530
  { key: "developer", label: "\u6211\u7684" }
3471
3531
  ];
3472
3532
  function MarketplaceApp() {
3473
- const [nav, setNav] = (0, import_react9.useState)("market");
3474
- const [detailId, setDetailId] = (0, import_react9.useState)(null);
3533
+ const [nav, setNav] = (0, import_react10.useState)("market");
3534
+ const [detailId, setDetailId] = (0, import_react10.useState)(null);
3475
3535
  ensureThemeStyles();
3476
3536
  return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "xps-app", children: [
3477
3537
  /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("nav", { className: "xps-nav", children: NAV_ITEMS.map((item) => /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
@@ -3499,7 +3559,7 @@ function MarketplaceApp() {
3499
3559
  }
3500
3560
 
3501
3561
  // src/client/settings/GeneralTokenRow.tsx
3502
- var import_react10 = require("react");
3562
+ var import_react11 = require("react");
3503
3563
  var import_jsx_runtime21 = require("react/jsx-runtime");
3504
3564
  var rowStyle = {
3505
3565
  display: "flex",
@@ -3556,12 +3616,12 @@ function messageOf2(error, fallback) {
3556
3616
  return error instanceof Error && error.message !== "" ? error.message : fallback;
3557
3617
  }
3558
3618
  function GeneralTokenRow() {
3559
- const [loading, setLoading] = (0, import_react10.useState)(true);
3560
- const [auth, setAuth] = (0, import_react10.useState)(null);
3561
- const [token, setToken] = (0, import_react10.useState)("");
3562
- const [pending, setPending] = (0, import_react10.useState)(false);
3563
- const [error, setError] = (0, import_react10.useState)("");
3564
- (0, import_react10.useEffect)(() => {
3619
+ const [loading, setLoading] = (0, import_react11.useState)(true);
3620
+ const [auth, setAuth] = (0, import_react11.useState)(null);
3621
+ const [token, setToken] = (0, import_react11.useState)("");
3622
+ const [pending, setPending] = (0, import_react11.useState)(false);
3623
+ const [error, setError] = (0, import_react11.useState)("");
3624
+ (0, import_react11.useEffect)(() => {
3565
3625
  let alive = true;
3566
3626
  void getAuthState().then((state) => {
3567
3627
  if (alive) setAuth(state);
@@ -3635,7 +3695,7 @@ function GeneralTokenRow() {
3635
3695
  }
3636
3696
 
3637
3697
  // src/client/settings/GeneralUpdateRow.tsx
3638
- var import_react11 = require("react");
3698
+ var import_react12 = require("react");
3639
3699
  var import_jsx_runtime22 = require("react/jsx-runtime");
3640
3700
  var rowStyle2 = {
3641
3701
  display: "flex",
@@ -3720,11 +3780,11 @@ function versionAtLeast(current, target) {
3720
3780
  return true;
3721
3781
  }
3722
3782
  function GeneralUpdateRow() {
3723
- const [phase, setPhase] = (0, import_react11.useState)(() => {
3783
+ const [phase, setPhase] = (0, import_react12.useState)(() => {
3724
3784
  const pending = readPendingUpdate();
3725
3785
  return pending !== null ? { kind: "updated", version: pending } : { kind: "checking" };
3726
3786
  });
3727
- const [error, setError] = (0, import_react11.useState)("");
3787
+ const [error, setError] = (0, import_react12.useState)("");
3728
3788
  const check = () => {
3729
3789
  setPhase({ kind: "checking" });
3730
3790
  setError("");
@@ -3741,7 +3801,7 @@ function GeneralUpdateRow() {
3741
3801
  setError(messageOf3(err, "\u68C0\u67E5\u66F4\u65B0\u5931\u8D25"));
3742
3802
  });
3743
3803
  };
3744
- (0, import_react11.useEffect)(() => {
3804
+ (0, import_react12.useEffect)(() => {
3745
3805
  if (readPendingUpdate() !== null) {
3746
3806
  void checkSelfUpdate().then((result) => {
3747
3807
  const pending = readPendingUpdate();
@@ -3828,7 +3888,7 @@ function injectTheme() {
3828
3888
  function StoreIcon(props) {
3829
3889
  const active = props.active === true;
3830
3890
  const size = typeof props.size === "number" ? props.size : 20;
3831
- return (0, import_react12.createElement)(
3891
+ return (0, import_react13.createElement)(
3832
3892
  "svg",
3833
3893
  {
3834
3894
  width: size,
@@ -3839,13 +3899,13 @@ function StoreIcon(props) {
3839
3899
  color: active ? "var(--dsw-alias-brand-primary, #3861fb)" : "var(--dsw-alias-label-secondary, #646a73)"
3840
3900
  }
3841
3901
  },
3842
- (0, import_react12.createElement)("path", {
3902
+ (0, import_react13.createElement)("path", {
3843
3903
  d: "M4 7h16l-1.2-3.2A1 1 0 0 0 17.85 3H6.15a1 1 0 0 0-.95.8L4 7Zm0 0v12a1 1 0 0 0 1 1h14a1 1 0 0 0 1-1V7",
3844
3904
  stroke: "currentColor",
3845
3905
  strokeWidth: 1.6,
3846
3906
  strokeLinejoin: "round"
3847
3907
  }),
3848
- (0, import_react12.createElement)("path", {
3908
+ (0, import_react13.createElement)("path", {
3849
3909
  d: "M9 11a3 3 0 0 0 6 0",
3850
3910
  stroke: "currentColor",
3851
3911
  strokeWidth: 1.6,
@@ -3855,13 +3915,13 @@ function StoreIcon(props) {
3855
3915
  }
3856
3916
  function BundleConfigSeat(props) {
3857
3917
  if (props.view === "page") {
3858
- return (0, import_react12.createElement)(
3918
+ return (0, import_react13.createElement)(
3859
3919
  "div",
3860
3920
  { className: "xps-page-placeholder" },
3861
3921
  "\u85AA\u4EBA\u85AA\u4E8B\u5E02\u573A\u914D\u7F6E(\u5360\u4F4D):serviceBaseUrl / cacheDir / requestTimeout / cachePolicy"
3862
3922
  );
3863
3923
  }
3864
- return (0, import_react12.createElement)("div", null, "\u85AA\u4EBA\u85AA\u4E8B\u5E02\u573A:\u79C1\u6709\u63D2\u4EF6\u6D4F\u89C8\u3001\u5B89\u88C5\u4E0E\u5F00\u53D1\u8005\u4E0A\u4F20");
3924
+ return (0, import_react13.createElement)("div", null, "\u85AA\u4EBA\u85AA\u4E8B\u5E02\u573A:\u79C1\u6709\u63D2\u4EF6\u6D4F\u89C8\u3001\u5B89\u88C5\u4E0E\u5F00\u53D1\u8005\u4E0A\u4F20");
3865
3925
  }
3866
3926
  function apply(ctx) {
3867
3927
  const slots = ctx.get("slots");
@@ -3894,7 +3954,7 @@ function apply(ctx) {
3894
3954
  "main",
3895
3955
  () => safe(
3896
3956
  "main",
3897
- () => slots.register({ name: "main", key: "xrxs-plugins-store" }, () => (0, import_react12.createElement)(MarketplaceApp))
3957
+ () => slots.register({ name: "main", key: "xrxs-plugins-store" }, () => (0, import_react13.createElement)(MarketplaceApp))
3898
3958
  )
3899
3959
  ),
3900
3960
  "xrxs-plugins-store.main"
@@ -3906,7 +3966,7 @@ function apply(ctx) {
3906
3966
  "settings.general.item",
3907
3967
  () => slots.register(
3908
3968
  { name: "settings.general.item", id: "xrxs-plugins-store-token", order: 50 },
3909
- () => (0, import_react12.createElement)(GeneralTokenRow)
3969
+ () => (0, import_react13.createElement)(GeneralTokenRow)
3910
3970
  )
3911
3971
  )
3912
3972
  ),
@@ -3919,7 +3979,7 @@ function apply(ctx) {
3919
3979
  "settings.general.item",
3920
3980
  () => slots.register(
3921
3981
  { name: "settings.general.item", id: "xrxs-plugins-store-update", order: 51 },
3922
- () => (0, import_react12.createElement)(GeneralUpdateRow)
3982
+ () => (0, import_react13.createElement)(GeneralUpdateRow)
3923
3983
  )
3924
3984
  )
3925
3985
  ),
@@ -3932,7 +3992,7 @@ function apply(ctx) {
3932
3992
  "plugins.bundle.config",
3933
3993
  () => slots.register(
3934
3994
  { name: "plugins.bundle.config", key: "@xrxs-ai/dsh-xrxs-plugins-store" },
3935
- (props) => (0, import_react12.createElement)(BundleConfigSeat, props)
3995
+ (props) => (0, import_react13.createElement)(BundleConfigSeat, props)
3936
3996
  )
3937
3997
  )
3938
3998
  ),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xrxs-ai/dsh-xrxs-plugins-store",
3
- "version": "0.2.6",
3
+ "version": "0.2.7",
4
4
  "description": "DSH 私有插件市场插件(静态持久 bundle,双 face)",
5
5
  "type": "module",
6
6
  "license": "MIT",