dsh-plugin-core-demo 0.42.0 → 0.42.2

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/dist/client.js +43 -14
  2. package/package.json +1 -1
package/dist/client.js CHANGED
@@ -6571,9 +6571,24 @@ var hostHandlers = null;
6571
6571
  function registerHostDialog(handlers2) {
6572
6572
  hostHandlers = handlers2;
6573
6573
  }
6574
+ var HOST_CONFIRM_FIELDS = ["title", "message", "confirmText", "cancelText", "tone", "skin"];
6575
+ var HOST_ALERT_FIELDS = ["title", "message", "confirmText", "skin"];
6576
+ function hostIgnoredFields(opts, allowed) {
6577
+ const ignored = [];
6578
+ for (const [key, value] of Object.entries(opts)) {
6579
+ if (value !== void 0 && !allowed.includes(key))
6580
+ ignored.push(key);
6581
+ }
6582
+ return ignored;
6583
+ }
6574
6584
  function confirmModal(opts) {
6575
6585
  if (opts.skin === "host") {
6576
- if (hostHandlers !== null) {
6586
+ const ignored = hostIgnoredFields(opts, HOST_CONFIRM_FIELDS);
6587
+ if (opts.tone !== void 0 && opts.tone !== "danger" && opts.tone !== "primary")
6588
+ ignored.push("tone");
6589
+ if (ignored.length > 0) {
6590
+ console.warn(`[dsh-plugin-core] confirmModal skin:"host" \u4E0D\u652F\u6301 ${ignored.join(" / ")}\uFF0C\u5DF2\u56DE\u843D\u5230 core \u76AE\u80A4\uFF1B\u8981\u4FDD\u4F4F host \u76AE\u80A4\u8BF7\u53BB\u6389\u8FD9\u4E9B\u5B57\u6BB5\uFF0C\u6216\u76F4\u63A5\u7701\u6389 skin:"host" \u7528 core`);
6591
+ } else if (hostHandlers !== null) {
6577
6592
  return hostHandlers.confirm({
6578
6593
  title: opts.title == null ? void 0 : String(opts.title),
6579
6594
  description: opts.message == null ? void 0 : String(opts.message),
@@ -6581,8 +6596,9 @@ function confirmModal(opts) {
6581
6596
  cancelText: opts.cancelText,
6582
6597
  danger: opts.tone === "danger"
6583
6598
  });
6599
+ } else {
6600
+ console.warn('[dsh-plugin-core] confirmModal skin:"host" \u9700\u5148\u5F15\u5165\u5B98\u65B9\u9002\u914D\u5C42 official.js\uFF0C\u5DF2\u56DE\u843D\u5230 core \u76AE\u80A4');
6584
6601
  }
6585
- console.warn('[dsh-plugin-core] confirmModal skin:"host" \u9700\u5148\u5F15\u5165\u5B98\u65B9\u9002\u914D\u5C42 official.js\uFF0C\u5DF2\u56DE\u843D\u5230 core \u76AE\u80A4');
6586
6602
  }
6587
6603
  const { skin: _skin, onConfirm, onCancel, ...core } = opts;
6588
6604
  void _skin;
@@ -6628,14 +6644,18 @@ function confirmModal(opts) {
6628
6644
  }
6629
6645
  function alertModal(opts) {
6630
6646
  if (opts.skin === "host") {
6631
- if (hostHandlers !== null) {
6647
+ const ignored = hostIgnoredFields(opts, HOST_ALERT_FIELDS);
6648
+ if (ignored.length > 0) {
6649
+ console.warn(`[dsh-plugin-core] alertModal skin:"host" \u4E0D\u652F\u6301 ${ignored.join(" / ")}\uFF0C\u5DF2\u56DE\u843D\u5230 core \u76AE\u80A4\uFF1B\u8981\u4FDD\u4F4F host \u76AE\u80A4\u8BF7\u53BB\u6389\u8FD9\u4E9B\u5B57\u6BB5\uFF0C\u6216\u76F4\u63A5\u7701\u6389 skin:"host" \u7528 core`);
6650
+ } else if (hostHandlers !== null) {
6632
6651
  return hostHandlers.alert({
6633
6652
  title: opts.title == null ? void 0 : String(opts.title),
6634
6653
  description: opts.message == null ? void 0 : String(opts.message),
6635
6654
  confirmText: opts.confirmText
6636
6655
  });
6656
+ } else {
6657
+ console.warn('[dsh-plugin-core] alertModal skin:"host" \u9700\u5148\u5F15\u5165\u5B98\u65B9\u9002\u914D\u5C42 official.js\uFF0C\u5DF2\u56DE\u843D\u5230 core \u76AE\u80A4');
6637
6658
  }
6638
- console.warn('[dsh-plugin-core] alertModal skin:"host" \u9700\u5148\u5F15\u5165\u5B98\u65B9\u9002\u914D\u5C42 official.js\uFF0C\u5DF2\u56DE\u843D\u5230 core \u76AE\u80A4');
6639
6659
  }
6640
6660
  const { skin: _skin, onConfirm, ...core } = opts;
6641
6661
  void _skin;
@@ -68333,8 +68353,8 @@ var docData = {
68333
68353
  "en": "The mask\u2019s right edge reads `--dshpc-page-inset-right` (summed across docks) and yields to the right column, centering the dialog in the **remaining** area. The dialog needs no mask props; never measure the column yourself (mounting is async, it always reads 0)."
68334
68354
  },
68335
68355
  {
68336
- "zh": "\u547D\u4EE4\u5F0F `confirmModal(opts)` / `alertModal(opts)` \u8FD4\u56DE Promise\uFF1A\u524D\u8005 resolve `true`\uFF08\u786E\u5B9A\uFF09\u6216 `false`\uFF08\u53D6\u6D88 / \u906E\u7F69 / Esc\uFF09\uFF0C\u540E\u8005\u5173\u95ED\u5373 resolve\u3002\u56DE\u8C03\u8FD4\u56DE Promise \u65F6\u5BF9\u5E94\u6309\u94AE\u81EA\u5DF1\u8F6C\u5708\u3001\u6574\u6846\u9501\u6B7B\uFF0Csettle \u540E\u624D\u5173\u3002",
68337
- "en": "The imperative `confirmModal(opts)` / `alertModal(opts)` return a Promise: the former resolves `true` (confirmed) or `false` (cancel / mask / Esc), the latter resolves on close. When a callback returns a Promise, its button spins and the dialog locks until it settles."
68356
+ "zh": "\u547D\u4EE4\u5F0F `confirmModal(opts)` / `alertModal(opts)` \u8FD4\u56DE Promise\uFF1A\u524D\u8005 resolve `true`\uFF08\u786E\u5B9A\uFF09\u6216 `false`\uFF08\u53D6\u6D88 / \u906E\u7F69 / Esc\uFF09\uFF0C\u540E\u8005\u5173\u95ED\u5373 resolve\u3002\u56DE\u8C03\u8FD4\u56DE Promise \u65F6\u5BF9\u5E94\u6309\u94AE\u81EA\u5DF1\u8F6C\u5708\u3001\u6574\u6846\u9501\u6B7B\uFF0Csettle \u540E\u624D\u5173\u3002\u8981\u300C\u9501\u5B9A\u671F\u95F4\u7559\u53D6\u6D88\u94AE\u300D\u4F20 `lockExceptions`\uFF08`confirmModal` \u6536 `['cancel']`\u3001`alertModal` \u6536 `true`\uFF09\uFF1B\u8BE5\u80FD\u529B\u53EA\u5728 core \u76AE\u80A4\u751F\u6548\uFF0C`skin:\"host\"` \u4F20\u4E86\u4F1A\u544A\u8B66\u5E76\u56DE\u843D core\uFF0C\u4E0D\u9759\u9ED8\u541E\u6389\u3002host \u76AE\u80A4\u672C\u8EAB\u53EA\u8F6C\u4EA4 `title` / `message` / `confirmText` / `cancelText` / `danger`\uFF0C\u5176\u4F59\u5B57\u6BB5\uFF08\u56DE\u8C03\u3001`notice`\u3001`size`\u3001\u5BBD\u5EA6\u3001`loadingText`\u3001`closeOnMask`\u3001`tone: warning` \u7B49\uFF09\u4F20\u4E86\u540C\u6837\u544A\u8B66\u5E76\u56DE\u843D core\u3002",
68357
+ "en": "The imperative `confirmModal(opts)` / `alertModal(opts)` return a Promise: the former resolves `true` (confirmed) or `false` (cancel / mask / Esc), the latter resolves on close. When a callback returns a Promise, its button spins and the dialog locks until it settles. To keep the cancel button clickable while locked, pass `lockExceptions` (`confirmModal` takes `['cancel']`, `alertModal` takes `true`); it only works on the core skin \u2014 `skin:\"host\"` warns and falls back to core instead of swallowing it silently."
68338
68358
  },
68339
68359
  {
68340
68360
  "zh": "\u56DE\u8C03\u7684\u8FD4\u56DE\u503C\u51B3\u5B9A\u5173\u4E0D\u5173\uFF1A**\u53EA\u6709 `false`**\uFF08\u540C\u6B65\u8FD4\u56DE\uFF0C\u6216 resolve \u6210 `false`\uFF09\u8868\u793A\u8FD9\u6B21\u6CA1\u6210 \u2014\u2014 \u6846\u7559\u7740\u8BA9\u4EBA\u91CD\u8BD5\uFF1B`true` / `undefined` / \u5176\u4ED6\u8FD4\u56DE\u503C\u7167\u5E38\u5173\uFF1Breject \u4E5F\u4E0D\u5173\uFF08\u9519\u8BEF\u6253\u5230\u63A7\u5236\u53F0\uFF09\u3002\u5931\u8D25\u63D0\u793A\u7531\u56DE\u8C03\u81EA\u5DF1\u51FA\uFF0C\u8C03\u7528\u70B9\u4E0D\u5FC5\u5305 `try/catch`\u3002",
@@ -68971,8 +68991,17 @@ var docData = {
68971
68991
  "type": "'core' | 'host'",
68972
68992
  "def": "'core'",
68973
68993
  "desc": {
68974
- "zh": "host \u8D70\u5BBF\u4E3B\u539F\u751F Modal\uFF08\u9700\u5148\u5F15\u5165\u9002\u914D\u5C42 `official.js`\uFF0C\u672A\u6CE8\u518C\u5219\u56DE\u843D core \u5E76\u544A\u8B66\uFF09",
68975
- "en": "host uses the host\u2019s native Modal (requires the `official.js` adapter; falls back to core with a warning when unregistered)"
68994
+ "zh": "host \u8D70\u5BBF\u4E3B\u539F\u751F Modal\uFF08\u9700\u5148\u5F15\u5165\u9002\u914D\u5C42 `official.js`\uFF0C\u672A\u6CE8\u518C\u5219\u56DE\u843D core \u5E76\u544A\u8B66\uFF09\u3002host \u53EA\u8BA4 `title` / `message` / `confirmText` / `cancelText` / `tone: danger`\uFF1B\u4F20\u4E86\u5176\u4ED6\u4EFB\u4F55\u5B57\u6BB5\uFF08`onConfirm` / `onCancel`\u3001`notice`\u3001`size`\u3001\u5BBD\u5EA6\u3001`loadingText`\u3001`closeOnMask`\u3001`tone: warning`\u3001`lockExceptions`\u2026\uFF09\u90FD\u4F1A**\u544A\u8B66\u5E76\u56DE\u843D core**\uFF0C\u4E0D\u4F1A\u9759\u9ED8\u964D\u7EA7",
68995
+ "en": "host uses the host\u2019s native Modal (requires the `official.js` adapter; falls back to core with a warning when unregistered). host accepts only `title` / `message` / `confirmText` / `cancelText` / `tone: danger`; passing anything else (`onConfirm` / `onCancel`, `notice`, `size`, widths, `loadingText`, `closeOnMask`, `tone: warning`, `lockExceptions`\u2026) **warns and falls back to core** instead of silently degrading"
68996
+ }
68997
+ },
68998
+ {
68999
+ "name": "lockExceptions",
69000
+ "type": "readonly ('cancel' | 'confirm')[] | boolean",
69001
+ "def": "\u2014",
69002
+ "desc": {
69003
+ "zh": '\u540C\u7EC4\u4EF6\u5F0F\uFF1A\u9501\u5B9A\u671F\u95F4\u4ECD\u53EF\u70B9\u7684\u5185\u7F6E\u94AE\uFF08`confirmModal` \u6536 `cancel` / `confirm` \u6570\u7EC4\uFF0C`alertModal` \u6536\u5E03\u5C14\uFF09\u3002\u53EA\u5728 core \u76AE\u80A4\u751F\u6548\uFF1B`skin:"host"` \u4F20\u4E86\u4F1A\u544A\u8B66\u5E76\u56DE\u843D core',
69004
+ "en": 'Same as the component form: built-in buttons that stay clickable while locked (`confirmModal` takes a `cancel` / `confirm` array, `alertModal` a boolean). Only effective on the core skin; `skin:"host"` warns and falls back to core when passed'
68976
69005
  }
68977
69006
  }
68978
69007
  ]
@@ -77227,9 +77256,9 @@ function ReferencePage() {
77227
77256
  "tbody",
77228
77257
  null,
77229
77258
  [
77230
- [t3("buildCore"), `v${"0.42.0"}`],
77231
- [t3("buildDemo"), `v${"0.42.0"}`],
77232
- [t3("buildStamp"), "261117-050941-188"]
77259
+ [t3("buildCore"), `v${"0.42.2"}`],
77260
+ [t3("buildDemo"), `v${"0.42.2"}`],
77261
+ [t3("buildStamp"), "261117-071856-088"]
77233
77262
  ].map(
77234
77263
  ([label, value]) => (0, import_react110.createElement)(
77235
77264
  "tr",
@@ -77548,9 +77577,9 @@ function DemoPage() {
77548
77577
  lineHeight: "14px"
77549
77578
  }
77550
77579
  },
77551
- (0, import_react112.createElement)("span", null, `core v${"0.42.0"}`),
77552
- (0, import_react112.createElement)("span", null, `demo v${"0.42.0"}`),
77553
- (0, import_react112.createElement)("span", { style: { marginTop: "4px", fontSize: "9px" } }, "261117-050941-188")
77580
+ (0, import_react112.createElement)("span", null, `core v${"0.42.2"}`),
77581
+ (0, import_react112.createElement)("span", null, `demo v${"0.42.2"}`),
77582
+ (0, import_react112.createElement)("span", { style: { marginTop: "4px", fontSize: "9px" } }, "261117-071856-088")
77554
77583
  )
77555
77584
  )
77556
77585
  ),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-plugin-core-demo",
3
- "version": "0.42.0",
3
+ "version": "0.42.2",
4
4
  "description": "The shared UI foundation for DSH plugins, with a live component preview: design tokens, common controls, workspace browsing and notifications maintained in one place — install it to preview every component in a real host.",
5
5
  "icon": "./assets/icon-components.svg",
6
6
  "keywords": [