dsh-plugin-core-demo 0.42.1 → 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 +29 -19
  2. package/package.json +1 -1
package/dist/client.js CHANGED
@@ -6571,10 +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
- const lockExceptions = opts.lockExceptions;
6576
6585
  if (opts.skin === "host") {
6577
- if (hostHandlers !== null && (lockExceptions === void 0 || lockExceptions.length === 0)) {
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) {
6578
6592
  return hostHandlers.confirm({
6579
6593
  title: opts.title == null ? void 0 : String(opts.title),
6580
6594
  description: opts.message == null ? void 0 : String(opts.message),
@@ -6582,9 +6596,6 @@ function confirmModal(opts) {
6582
6596
  cancelText: opts.cancelText,
6583
6597
  danger: opts.tone === "danger"
6584
6598
  });
6585
- }
6586
- if (lockExceptions !== void 0 && lockExceptions.length > 0) {
6587
- console.warn('[dsh-plugin-core] confirmModal skin:"host" \u4E0D\u652F\u6301 lockExceptions\uFF0C\u5DF2\u56DE\u843D\u5230 core \u76AE\u80A4');
6588
6599
  } else {
6589
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');
6590
6601
  }
@@ -6632,17 +6643,16 @@ function confirmModal(opts) {
6632
6643
  });
6633
6644
  }
6634
6645
  function alertModal(opts) {
6635
- const wantsExceptions = opts.lockExceptions === true;
6636
6646
  if (opts.skin === "host") {
6637
- if (hostHandlers !== null && !wantsExceptions) {
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) {
6638
6651
  return hostHandlers.alert({
6639
6652
  title: opts.title == null ? void 0 : String(opts.title),
6640
6653
  description: opts.message == null ? void 0 : String(opts.message),
6641
6654
  confirmText: opts.confirmText
6642
6655
  });
6643
- }
6644
- if (wantsExceptions) {
6645
- console.warn('[dsh-plugin-core] alertModal skin:"host" \u4E0D\u652F\u6301 lockExceptions\uFF0C\u5DF2\u56DE\u843D\u5230 core \u76AE\u80A4');
6646
6656
  } else {
6647
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');
6648
6658
  }
@@ -68343,7 +68353,7 @@ var docData = {
68343
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)."
68344
68354
  },
68345
68355
  {
68346
- "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\u3002",
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",
68347
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."
68348
68358
  },
68349
68359
  {
@@ -68981,8 +68991,8 @@ var docData = {
68981
68991
  "type": "'core' | 'host'",
68982
68992
  "def": "'core'",
68983
68993
  "desc": {
68984
- "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\uFF1B**host \u4E0D\u652F\u6301 `lockExceptions`**\uFF0C\u4F20\u4E86\u4F1A\u544A\u8B66\u5E76\u56DE\u843D core",
68985
- "en": "host uses the host\u2019s native Modal (requires the `official.js` adapter; falls back to core with a warning when unregistered); **host does not support `lockExceptions`** \u2014 passing it warns and falls back to core"
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"
68986
68996
  }
68987
68997
  },
68988
68998
  {
@@ -77246,9 +77256,9 @@ function ReferencePage() {
77246
77256
  "tbody",
77247
77257
  null,
77248
77258
  [
77249
- [t3("buildCore"), `v${"0.42.1"}`],
77250
- [t3("buildDemo"), `v${"0.42.1"}`],
77251
- [t3("buildStamp"), "261117-064545-153"]
77259
+ [t3("buildCore"), `v${"0.42.2"}`],
77260
+ [t3("buildDemo"), `v${"0.42.2"}`],
77261
+ [t3("buildStamp"), "261117-071856-088"]
77252
77262
  ].map(
77253
77263
  ([label, value]) => (0, import_react110.createElement)(
77254
77264
  "tr",
@@ -77567,9 +77577,9 @@ function DemoPage() {
77567
77577
  lineHeight: "14px"
77568
77578
  }
77569
77579
  },
77570
- (0, import_react112.createElement)("span", null, `core v${"0.42.1"}`),
77571
- (0, import_react112.createElement)("span", null, `demo v${"0.42.1"}`),
77572
- (0, import_react112.createElement)("span", { style: { marginTop: "4px", fontSize: "9px" } }, "261117-064545-153")
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")
77573
77583
  )
77574
77584
  )
77575
77585
  ),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-plugin-core-demo",
3
- "version": "0.42.1",
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": [