dsh-plugin-core-demo 0.42.0 → 0.42.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/dist/client.js +33 -14
- package/package.json +1 -1
package/dist/client.js
CHANGED
|
@@ -6572,8 +6572,9 @@ function registerHostDialog(handlers2) {
|
|
|
6572
6572
|
hostHandlers = handlers2;
|
|
6573
6573
|
}
|
|
6574
6574
|
function confirmModal(opts) {
|
|
6575
|
+
const lockExceptions = opts.lockExceptions;
|
|
6575
6576
|
if (opts.skin === "host") {
|
|
6576
|
-
if (hostHandlers !== null) {
|
|
6577
|
+
if (hostHandlers !== null && (lockExceptions === void 0 || lockExceptions.length === 0)) {
|
|
6577
6578
|
return hostHandlers.confirm({
|
|
6578
6579
|
title: opts.title == null ? void 0 : String(opts.title),
|
|
6579
6580
|
description: opts.message == null ? void 0 : String(opts.message),
|
|
@@ -6582,7 +6583,11 @@ function confirmModal(opts) {
|
|
|
6582
6583
|
danger: opts.tone === "danger"
|
|
6583
6584
|
});
|
|
6584
6585
|
}
|
|
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
|
+
} else {
|
|
6589
|
+
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
|
+
}
|
|
6586
6591
|
}
|
|
6587
6592
|
const { skin: _skin, onConfirm, onCancel, ...core } = opts;
|
|
6588
6593
|
void _skin;
|
|
@@ -6627,15 +6632,20 @@ function confirmModal(opts) {
|
|
|
6627
6632
|
});
|
|
6628
6633
|
}
|
|
6629
6634
|
function alertModal(opts) {
|
|
6635
|
+
const wantsExceptions = opts.lockExceptions === true;
|
|
6630
6636
|
if (opts.skin === "host") {
|
|
6631
|
-
if (hostHandlers !== null) {
|
|
6637
|
+
if (hostHandlers !== null && !wantsExceptions) {
|
|
6632
6638
|
return hostHandlers.alert({
|
|
6633
6639
|
title: opts.title == null ? void 0 : String(opts.title),
|
|
6634
6640
|
description: opts.message == null ? void 0 : String(opts.message),
|
|
6635
6641
|
confirmText: opts.confirmText
|
|
6636
6642
|
});
|
|
6637
6643
|
}
|
|
6638
|
-
|
|
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
|
+
} else {
|
|
6647
|
+
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
|
+
}
|
|
6639
6649
|
}
|
|
6640
6650
|
const { skin: _skin, onConfirm, ...core } = opts;
|
|
6641
6651
|
void _skin;
|
|
@@ -68333,8 +68343,8 @@ var docData = {
|
|
|
68333
68343
|
"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
68344
|
},
|
|
68335
68345
|
{
|
|
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."
|
|
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",
|
|
68347
|
+
"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
68348
|
},
|
|
68339
68349
|
{
|
|
68340
68350
|
"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 +68981,17 @@ var docData = {
|
|
|
68971
68981
|
"type": "'core' | 'host'",
|
|
68972
68982
|
"def": "'core'",
|
|
68973
68983
|
"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)"
|
|
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"
|
|
68986
|
+
}
|
|
68987
|
+
},
|
|
68988
|
+
{
|
|
68989
|
+
"name": "lockExceptions",
|
|
68990
|
+
"type": "readonly ('cancel' | 'confirm')[] | boolean",
|
|
68991
|
+
"def": "\u2014",
|
|
68992
|
+
"desc": {
|
|
68993
|
+
"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',
|
|
68994
|
+
"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
68995
|
}
|
|
68977
68996
|
}
|
|
68978
68997
|
]
|
|
@@ -77227,9 +77246,9 @@ function ReferencePage() {
|
|
|
77227
77246
|
"tbody",
|
|
77228
77247
|
null,
|
|
77229
77248
|
[
|
|
77230
|
-
[t3("buildCore"), `v${"0.42.
|
|
77231
|
-
[t3("buildDemo"), `v${"0.42.
|
|
77232
|
-
[t3("buildStamp"), "261117-
|
|
77249
|
+
[t3("buildCore"), `v${"0.42.1"}`],
|
|
77250
|
+
[t3("buildDemo"), `v${"0.42.1"}`],
|
|
77251
|
+
[t3("buildStamp"), "261117-064545-153"]
|
|
77233
77252
|
].map(
|
|
77234
77253
|
([label, value]) => (0, import_react110.createElement)(
|
|
77235
77254
|
"tr",
|
|
@@ -77548,9 +77567,9 @@ function DemoPage() {
|
|
|
77548
77567
|
lineHeight: "14px"
|
|
77549
77568
|
}
|
|
77550
77569
|
},
|
|
77551
|
-
(0, import_react112.createElement)("span", null, `core v${"0.42.
|
|
77552
|
-
(0, import_react112.createElement)("span", null, `demo v${"0.42.
|
|
77553
|
-
(0, import_react112.createElement)("span", { style: { marginTop: "4px", fontSize: "9px" } }, "261117-
|
|
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")
|
|
77554
77573
|
)
|
|
77555
77574
|
)
|
|
77556
77575
|
),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-plugin-core-demo",
|
|
3
|
-
"version": "0.42.
|
|
3
|
+
"version": "0.42.1",
|
|
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": [
|