dsh-plugin-core-demo 0.41.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 +113 -41
- package/package.json +1 -1
package/dist/client.js
CHANGED
|
@@ -6468,6 +6468,14 @@ function AlertModal(props) {
|
|
|
6468
6468
|
const severity = props.severity ?? "info";
|
|
6469
6469
|
const [running, setRunning] = (0, import_react24.useState)(false);
|
|
6470
6470
|
const busy = running || props.confirmLoading === true;
|
|
6471
|
+
const confirmButton = (0, import_react24.createElement)(Button, {
|
|
6472
|
+
variant: "primary",
|
|
6473
|
+
width: props.confirmWidth,
|
|
6474
|
+
loadingText: props.loadingText,
|
|
6475
|
+
loading: props.confirmLoading === true,
|
|
6476
|
+
onBusyChange: setRunning,
|
|
6477
|
+
onClick: () => props.onConfirm?.()
|
|
6478
|
+
}, props.confirmText ?? tt("dialogOk"));
|
|
6471
6479
|
return (0, import_react24.createElement)(Modal, {
|
|
6472
6480
|
icon: (0, import_react24.createElement)("span", { className: `dshpc-alert-sev dshpc-alert-sev--${severity}` }, (0, import_react24.createElement)(FontIcon, { name: SEVERITY_GLYPH[severity] })),
|
|
6473
6481
|
title: props.title,
|
|
@@ -6479,14 +6487,7 @@ function AlertModal(props) {
|
|
|
6479
6487
|
locked: props.locked,
|
|
6480
6488
|
onClose: props.onConfirm,
|
|
6481
6489
|
notice: props.notice,
|
|
6482
|
-
footer: (0, import_react24.createElement)(
|
|
6483
|
-
variant: "primary",
|
|
6484
|
-
width: props.confirmWidth,
|
|
6485
|
-
loadingText: props.loadingText,
|
|
6486
|
-
loading: props.confirmLoading === true,
|
|
6487
|
-
onBusyChange: setRunning,
|
|
6488
|
-
onClick: () => props.onConfirm?.()
|
|
6489
|
-
}, props.confirmText ?? tt("dialogOk"))
|
|
6490
|
+
footer: props.lockExceptions === true ? (0, import_react24.createElement)(OverlayLockExempt, null, confirmButton) : confirmButton
|
|
6490
6491
|
}, props.message ?? null);
|
|
6491
6492
|
}
|
|
6492
6493
|
|
|
@@ -6499,6 +6500,23 @@ function ConfirmModal(props) {
|
|
|
6499
6500
|
const [confirmBusy, setConfirmBusy] = (0, import_react25.useState)(false);
|
|
6500
6501
|
const [cancelBusy, setCancelBusy] = (0, import_react25.useState)(false);
|
|
6501
6502
|
const busy = confirmBusy || cancelBusy || props.confirmLoading === true || props.cancelLoading === true;
|
|
6503
|
+
const exempt = props.lockExceptions ?? [];
|
|
6504
|
+
const cancelButton = (0, import_react25.createElement)(Button, {
|
|
6505
|
+
variant: "outline",
|
|
6506
|
+
width: props.cancelWidth,
|
|
6507
|
+
loadingText: props.loadingText,
|
|
6508
|
+
loading: props.cancelLoading === true,
|
|
6509
|
+
onBusyChange: setCancelBusy,
|
|
6510
|
+
onClick: () => props.onCancel?.()
|
|
6511
|
+
}, props.cancelText ?? tt("cancel"));
|
|
6512
|
+
const confirmButton = (0, import_react25.createElement)(Button, {
|
|
6513
|
+
variant: confirmVariant,
|
|
6514
|
+
width: props.confirmWidth,
|
|
6515
|
+
loadingText: props.loadingText,
|
|
6516
|
+
loading: props.confirmLoading === true,
|
|
6517
|
+
onBusyChange: setConfirmBusy,
|
|
6518
|
+
onClick: () => props.onConfirm?.()
|
|
6519
|
+
}, props.confirmText ?? tt("confirm"));
|
|
6502
6520
|
return (0, import_react25.createElement)(Modal, {
|
|
6503
6521
|
title: props.title,
|
|
6504
6522
|
size: props.size ?? "sm",
|
|
@@ -6509,21 +6527,7 @@ function ConfirmModal(props) {
|
|
|
6509
6527
|
locked: props.locked,
|
|
6510
6528
|
onClose: props.onCancel,
|
|
6511
6529
|
notice: props.notice,
|
|
6512
|
-
footer: (0, import_react25.createElement)("div", { style: { display: "flex", gap: "8px", justifyContent: "flex-end" } }, (0, import_react25.createElement)(
|
|
6513
|
-
variant: "outline",
|
|
6514
|
-
width: props.cancelWidth,
|
|
6515
|
-
loadingText: props.loadingText,
|
|
6516
|
-
loading: props.cancelLoading === true,
|
|
6517
|
-
onBusyChange: setCancelBusy,
|
|
6518
|
-
onClick: () => props.onCancel?.()
|
|
6519
|
-
}, props.cancelText ?? tt("cancel")), (0, import_react25.createElement)(Button, {
|
|
6520
|
-
variant: confirmVariant,
|
|
6521
|
-
width: props.confirmWidth,
|
|
6522
|
-
loadingText: props.loadingText,
|
|
6523
|
-
loading: props.confirmLoading === true,
|
|
6524
|
-
onBusyChange: setConfirmBusy,
|
|
6525
|
-
onClick: () => props.onConfirm?.()
|
|
6526
|
-
}, props.confirmText ?? tt("confirm")))
|
|
6530
|
+
footer: (0, import_react25.createElement)("div", { style: { display: "flex", gap: "8px", justifyContent: "flex-end" } }, exempt.includes("cancel") ? (0, import_react25.createElement)(OverlayLockExempt, null, cancelButton) : cancelButton, exempt.includes("confirm") ? (0, import_react25.createElement)(OverlayLockExempt, null, confirmButton) : confirmButton)
|
|
6527
6531
|
}, props.message ?? null);
|
|
6528
6532
|
}
|
|
6529
6533
|
|
|
@@ -6568,8 +6572,9 @@ function registerHostDialog(handlers2) {
|
|
|
6568
6572
|
hostHandlers = handlers2;
|
|
6569
6573
|
}
|
|
6570
6574
|
function confirmModal(opts) {
|
|
6575
|
+
const lockExceptions = opts.lockExceptions;
|
|
6571
6576
|
if (opts.skin === "host") {
|
|
6572
|
-
if (hostHandlers !== null) {
|
|
6577
|
+
if (hostHandlers !== null && (lockExceptions === void 0 || lockExceptions.length === 0)) {
|
|
6573
6578
|
return hostHandlers.confirm({
|
|
6574
6579
|
title: opts.title == null ? void 0 : String(opts.title),
|
|
6575
6580
|
description: opts.message == null ? void 0 : String(opts.message),
|
|
@@ -6578,7 +6583,11 @@ function confirmModal(opts) {
|
|
|
6578
6583
|
danger: opts.tone === "danger"
|
|
6579
6584
|
});
|
|
6580
6585
|
}
|
|
6581
|
-
|
|
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
|
+
}
|
|
6582
6591
|
}
|
|
6583
6592
|
const { skin: _skin, onConfirm, onCancel, ...core } = opts;
|
|
6584
6593
|
void _skin;
|
|
@@ -6623,15 +6632,20 @@ function confirmModal(opts) {
|
|
|
6623
6632
|
});
|
|
6624
6633
|
}
|
|
6625
6634
|
function alertModal(opts) {
|
|
6635
|
+
const wantsExceptions = opts.lockExceptions === true;
|
|
6626
6636
|
if (opts.skin === "host") {
|
|
6627
|
-
if (hostHandlers !== null) {
|
|
6637
|
+
if (hostHandlers !== null && !wantsExceptions) {
|
|
6628
6638
|
return hostHandlers.alert({
|
|
6629
6639
|
title: opts.title == null ? void 0 : String(opts.title),
|
|
6630
6640
|
description: opts.message == null ? void 0 : String(opts.message),
|
|
6631
6641
|
confirmText: opts.confirmText
|
|
6632
6642
|
});
|
|
6633
6643
|
}
|
|
6634
|
-
|
|
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
|
+
}
|
|
6635
6649
|
}
|
|
6636
6650
|
const { skin: _skin, onConfirm, ...core } = opts;
|
|
6637
6651
|
void _skin;
|
|
@@ -68329,8 +68343,8 @@ var docData = {
|
|
|
68329
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)."
|
|
68330
68344
|
},
|
|
68331
68345
|
{
|
|
68332
|
-
"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",
|
|
68333
|
-
"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."
|
|
68334
68348
|
},
|
|
68335
68349
|
{
|
|
68336
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",
|
|
@@ -68341,12 +68355,16 @@ var docData = {
|
|
|
68341
68355
|
"en": '**When the whole dialog must be untouchable, pass `locked`** \u2014 do not fake it with button loading: loading only spins that one button, while `locked` covers the whole panel. **Each control renders its own disabled state** (Button / Input / Textarea / Checkbox / Segmented / Picker / date picker / pagination all dim themselves and are genuinely disabled, so Tab skips them), and the panel as a whole drops pointer hit-testing (`pointer-events:none`) so the mask catches the pointer \u2014 the mask is not a close path while locked, so clicking it neither closes nor falls through to the page; no dim veil (a veil reads as "the app broke"). Tab is swallowed and whatever was focused inside is blurred on lock. It **only ORs and never writes back** any `disabled`; controlled and stateless \u2014 omitted means unlocked. The imperative dialogs hand their callbacks a `ctl` (`{ setLocked(bool) }`); calling it after close is a no-op.'
|
|
68342
68356
|
},
|
|
68343
68357
|
{
|
|
68344
|
-
"zh": "**\u9501\u5B9A\u671F\u7559\u4E00\u4E2A\u4F8B\u5916\u63A7\u4EF6**\uFF08\u957F\u4EFB\u52A1\u63D0\u4EA4\u540E\u60F3\u5148\u6536\u8D77\u3001\u6D3B\u7EE7\u7EED\u8DD1\uFF09\uFF1A\u628A\u4EFB\u610F ReactNode\uFF08\u6309\u94AE / \u8F93\u5165\u6846 / \u81EA\u7ED8\u90FD\u884C\uFF0C1~N \u4E2A\uFF09\u653E\u8FDB `lockExceptions`\uFF0C\u53EA\u6709\u8FD9\u4E00\u5757\u4ECD\u53EF\u70B9\u3001\u53EF Tab\uFF0C\u6838\u5FC3\u63A7\u4EF6\u5728\u91CC\u9762\u4E5F\u4E0D\u81EA\u6211\u7981\u7528\uFF1B\u5176\u4F59\u6309\u94AE\u7167\u7070\u3001\u2715 / Esc / \u70B9\u906E\u7F69\u4E09\u6761\u5173\u95ED\u8DEF\u5F84\u4ECD\u5C01\u6B7B\u3002`useModalBackground()` \u5728\u4F8B\u5916\u5B50\u6811\u91CC\u62FF\u5230\u6536\u8D77\u51FA\u53E3 \u2014\u2014 \u4F60\u7684\u6536\u8D77\u94AE `onClick={useModalBackground()}` \u5373\u53EF\uFF1B\u6838\u5FC3\u53EA\u53D1\u8FD9\u4E2A\u4E8B\u4EF6\uFF0C**\u4E0D\u7ED3\u7B97\u3001\u4E0D\u9690\u85CF**\uFF1A\u4F60\u5728\u8FD9\u4E2A\u56DE\u8C03\u91CC\u767B\u8BB0\u540E\u53F0\u4EFB\u52A1\uFF08\u5982 `handle.background()`\uFF09\u5E76\u628A `backgrounded` \u7F6E true\u3002",
|
|
68345
|
-
"en": "**Keep one exception control interactive while locked** (collapse a long-running submit while the work continues): put any ReactNode (button / input / custom, 1~N) into `lockExceptions` \u2014 only that block stays clickable and Tab-reachable, and core controls inside do not self-disable; everything else stays dimmed and \u2715 / Esc / mask still cannot close. `useModalBackground()` yields the collapse outlet from inside the exception subtree \u2014 wire your collapse button as `onClick={useModalBackground()}`. The core only emits this event; it **neither settles nor hides**: in that callback you register the background job (e.g. `handle.background()`) and set `backgrounded` to true."
|
|
68358
|
+
"zh": "**\u9501\u5B9A\u671F\u7559\u4E00\u4E2A\u4F8B\u5916\u63A7\u4EF6**\uFF08\u957F\u4EFB\u52A1\u63D0\u4EA4\u540E\u60F3\u5148\u6536\u8D77\u3001\u6D3B\u7EE7\u7EED\u8DD1\uFF09\uFF1A\u628A\u4EFB\u610F ReactNode\uFF08\u6309\u94AE / \u8F93\u5165\u6846 / \u81EA\u7ED8\u90FD\u884C\uFF0C1~N \u4E2A\uFF09\u653E\u8FDB `lockExceptions`\uFF0C\u53EA\u6709\u8FD9\u4E00\u5757\u4ECD\u53EF\u70B9\u3001\u53EF Tab\uFF0C\u6838\u5FC3\u63A7\u4EF6\u5728\u91CC\u9762\u4E5F\u4E0D\u81EA\u6211\u7981\u7528\uFF1B\u5176\u4F59\u6309\u94AE\u7167\u7070\u3001\u2715 / Esc / \u70B9\u906E\u7F69\u4E09\u6761\u5173\u95ED\u8DEF\u5F84\u4ECD\u5C01\u6B7B\u3002**\u8BE5 prop \u56FA\u5B9A\u6E32\u67D3\u5728\u9762\u677F\u672B\u5C3E**\uFF08footer \u4E4B\u540E\uFF09\uFF1B\u8981\u653E\u5230\u5934\u90E8 / footer / \u6B63\u6587\u7B49\u5176\u4ED6\u4F4D\u7F6E\uFF0C\u7528\u540C\u5305\u5BFC\u51FA\u7684 `ModalLockExempt` \u5C31\u5730\u5305\u88F9\uFF1A`<ModalLockExempt><Button \u2026 /></ModalLockExempt>`\uFF0C\u540C\u4E00\u5957\u673A\u5236\u3002`useModalBackground()` \u5728\u4F8B\u5916\u5B50\u6811\u91CC\u62FF\u5230\u6536\u8D77\u51FA\u53E3 \u2014\u2014 \u4F60\u7684\u6536\u8D77\u94AE `onClick={useModalBackground()}` \u5373\u53EF\uFF1B\u6838\u5FC3\u53EA\u53D1\u8FD9\u4E2A\u4E8B\u4EF6\uFF0C**\u4E0D\u7ED3\u7B97\u3001\u4E0D\u9690\u85CF**\uFF1A\u4F60\u5728\u8FD9\u4E2A\u56DE\u8C03\u91CC\u767B\u8BB0\u540E\u53F0\u4EFB\u52A1\uFF08\u5982 `handle.background()`\uFF09\u5E76\u628A `backgrounded` \u7F6E true\u3002",
|
|
68359
|
+
"en": "**Keep one exception control interactive while locked** (collapse a long-running submit while the work continues): put any ReactNode (button / input / custom, 1~N) into `lockExceptions` \u2014 only that block stays clickable and Tab-reachable, and core controls inside do not self-disable; everything else stays dimmed and \u2715 / Esc / mask still cannot close. **This prop always renders at the end of the panel** (after the footer); to place it in the header / footer / body, wrap it in place with the exported `ModalLockExempt`: `<ModalLockExempt><Button \u2026 /></ModalLockExempt>` \u2014 same mechanism. `useModalBackground()` yields the collapse outlet from inside the exception subtree \u2014 wire your collapse button as `onClick={useModalBackground()}`. The core only emits this event; it **neither settles nor hides**: in that callback you register the background job (e.g. `handle.background()`) and set `backgrounded` to true."
|
|
68346
68360
|
},
|
|
68347
68361
|
{
|
|
68348
68362
|
"zh": "**\u6536\u8D77 / \u547C\u56DE**\u9760\u53D7\u63A7 `backgrounded`\uFF1Atrue \u65F6\u6574\u7A97\u7528 `visibility:hidden` \u9690\u85CF\uFF08**DOM \u4E0D\u5378\u8F7D**\uFF0C\u8F93\u5165\u5185\u5BB9 / \u8FDB\u5EA6 / \u6EDA\u52A8\u4F4D\u7F6E\u539F\u6837\u4FDD\u7559\uFF09\uFF0C\u540C\u65F6\u64A4\u6389 Tab / Esc \u76D1\u542C\uFF08\u770B\u4E0D\u89C1\u7684\u5F39\u7A97\u4E0D\u541E\u952E\u3001\u4E0D\u88AB Esc \u5173\u6389\uFF09\uFF1B\u4ECE\u540E\u53F0\u5217\u8868\u8FD8\u539F\u5C31\u662F\u628A `backgrounded` \u7F6E\u56DE false \u2014\u2014 \u540C\u4E00\u68F5\u6811\u539F\u4F4D\u56DE\u6765\uFF0C\u4E0D\u91CD\u753B\u3001\u4E0D\u91CD\u7F6E\u3002\u6838\u5FC3**\u4E0D\u78B0\u540E\u53F0\u6C60**\uFF1A\u767B\u8BB0 / \u8FD8\u539F / \u8DE8\u9875\u540C\u6B65\u90FD\u662F\u8C03\u7528\u65B9\u7528\u73B0\u6210\u7684 `task-notifications` \u4E8B\u4EF6\u63A5\uFF08\u6536\u8D77\u8D70 `backgrounded` \u4E8B\u4EF6\u3001\u547C\u56DE\u8D70 `restored` \u4E8B\u4EF6\uFF09\uFF0C`ui` \u4E0D\u4F9D\u8D56 `adv.*`\u3002\u5237\u65B0 / \u5207\u9875\u540E\u539F\u6811\u4E0D\u5728\u4E86\uFF0C\u5C31\u660E\u8BF4\u505A\u4E0D\u5230\uFF0C\u522B\u753B\u4E2A\u7A7A\u58F3\u5192\u5145\u8FD8\u539F\u3002",
|
|
68349
68363
|
"en": "**Collapse / restore** is the controlled `backgrounded` prop: true hides the whole window with `visibility:hidden` (**DOM stays mounted** \u2014 input, progress and scroll position are preserved) and detaches the Tab / Esc listeners (an invisible dialog neither swallows keys nor closes on Esc); restoring from a background list is just setting `backgrounded` back to false \u2014 the same tree returns in place, no repaint, no reset. The core **does not touch the task pool**: registration / restore / cross-page sync are wired by the caller through the existing `task-notifications` events (collapse via the `backgrounded` event, restore via `restored`), `ui` never imports `adv.*`. After a refresh / page change the original tree is gone \u2014 say so plainly instead of drawing an empty shell that pretends to restore."
|
|
68364
|
+
},
|
|
68365
|
+
{
|
|
68366
|
+
"zh": "**\u8FB9\u754C\uFF1A\u6709 `locked` \u4E0D\u7B49\u4E8E\u4E00\u5B9A\u80FD\u7559\u4F8B\u5916\u3002** \u4E0D\u4F20\u4F8B\u5916 = \u5168\u5C01\uFF0C\u8FD9\u662F\u8BBE\u8BA1\u3002\u4F8B\u5916\u53EA\u8C41\u514D\u300C\u53EF\u4EA4\u4E92\u300D\uFF0C**\u4E0D\u8C41\u514D\u4E09\u6761\u5173\u95ED\u8DEF\u5F84**\uFF08\u2715 / Esc / \u906E\u7F69\u4ECD\u5C01\u6B7B\uFF09\uFF0C\u4E5F\u4E0D\u66FF\u4F60\u7ED3\u7B97 Promise\u3002`ConfirmModal` / `AlertModal` \u662F\u6309\u94AE\u5C01\u95ED\u7684\u5C01\u88C5\uFF0C\u5B83\u4EEC\u7684 `lockExceptions` \u53EA\u63A5\u53D7**\u5185\u7F6E\u6309\u94AE\u540D**\uFF08`ConfirmModal` \u6536 `cancel` / `confirm`\uFF0C`AlertModal` \u6536\u5E03\u5C14\uFF09\uFF0C\u4E0D\u7167\u642C `Modal` \u7684\u4EFB\u610F ReactNode \u69FD\uFF1B\u5C06\u6765\u5F00\u653E\u81EA\u5B9A\u4E49\u6309\u94AE\u65F6\u518D\u7528 `ModalLockExempt`\u3002`skin:'host'` \u76AE\u80A4\u7531\u5BBF\u4E3B\u539F\u751F\u5F39\u7A97\u6E32\u67D3\uFF0C**\u4E0D\u652F\u6301\u4F8B\u5916**\uFF08\u4E5F\u62FF\u4E0D\u5230 `useModalBackground`\uFF09\uFF0C\u9700\u8981\u4F8B\u5916\u5C31\u7528 core \u76AE\u80A4\u3002",
|
|
68367
|
+
"en": "**Boundary: having `locked` does not mean an exception is always available.** Omitted exceptions = everything locked, by design. An exception only exempts *interaction* \u2014 it **never opens the three close paths** (\u2715 / Esc / mask stay blocked) and never settles a Promise for you. `ConfirmModal` / `AlertModal` are button-sealed wrappers: their `lockExceptions` accepts only **built-in button names** (`ConfirmModal` takes `cancel` / `confirm`, `AlertModal` takes a boolean) rather than `Modal`'s arbitrary ReactNode slot; when custom buttons are opened up later, use `ModalLockExempt`. The `skin:'host'` skin is rendered by the host native dialog and **does not support exceptions** (nor `useModalBackground`); use the core skin when you need them."
|
|
68350
68368
|
}
|
|
68351
68369
|
],
|
|
68352
68370
|
"api": [
|
|
@@ -68597,8 +68615,17 @@ var docData = {
|
|
|
68597
68615
|
"type": "ReactNode",
|
|
68598
68616
|
"def": "\u2014",
|
|
68599
68617
|
"desc": {
|
|
68600
|
-
"zh": "\u9501\u5B9A\u671F\u95F4\u7684\u4F8B\u5916\u63A7\u4EF6\uFF081~N \u4E2A\u4EFB\u610F\u8282\u70B9\uFF09\uFF1A\u53EA\u6709\u8FD9\u4E00\u5757\u4ECD\u53EF\u70B9\u3001\u53EF Tab\uFF0C\u6838\u5FC3\u63A7\u4EF6\u5728\u5176\u4E2D\u4E0D\u81EA\u6211\u7981\u7528\uFF1B\u5176\u4F59\u6309\u94AE\u7167\u7070\u3001\u4E09\u6761\u5173\u95ED\u8DEF\u5F84\u4ECD\u5C01\u6B7B\u3002\u4E0D\u4F20\u5219 locked \u4E00\u5200\u5207",
|
|
68601
|
-
"en": "Interactive exceptions while locked (1~N arbitrary nodes)
|
|
68618
|
+
"zh": "\u9501\u5B9A\u671F\u95F4\u7684\u4F8B\u5916\u63A7\u4EF6\uFF081~N \u4E2A\u4EFB\u610F\u8282\u70B9\uFF09\uFF0C**\u56FA\u5B9A\u6E32\u67D3\u5728\u9762\u677F\u672B\u5C3E**\uFF1A\u53EA\u6709\u8FD9\u4E00\u5757\u4ECD\u53EF\u70B9\u3001\u53EF Tab\uFF0C\u6838\u5FC3\u63A7\u4EF6\u5728\u5176\u4E2D\u4E0D\u81EA\u6211\u7981\u7528\uFF1B\u5176\u4F59\u6309\u94AE\u7167\u7070\u3001\u4E09\u6761\u5173\u95ED\u8DEF\u5F84\u4ECD\u5C01\u6B7B\u3002\u8981\u653E\u5176\u4ED6\u4F4D\u7F6E\u7528 `ModalLockExempt` \u5C31\u5730\u5305\u88F9\u3002\u4E0D\u4F20\u5219 locked \u4E00\u5200\u5207",
|
|
68619
|
+
"en": "Interactive exceptions while locked (1~N arbitrary nodes), **always rendered at the end of the panel**: only this block stays clickable / Tab-reachable and core controls inside do not self-disable; everything else stays dimmed, all three close paths still blocked. Wrap in place with `ModalLockExempt` to place it elsewhere. Omit for all-or-nothing locking"
|
|
68620
|
+
}
|
|
68621
|
+
},
|
|
68622
|
+
{
|
|
68623
|
+
"name": "ModalLockExempt",
|
|
68624
|
+
"type": "ReactNode",
|
|
68625
|
+
"def": "\u2014",
|
|
68626
|
+
"desc": {
|
|
68627
|
+
"zh": "\uFF08\u540C\u5305\u5BFC\u51FA\uFF09\u5728\u9762\u677F\u4EFB\u610F\u4F4D\u7F6E\u58F0\u660E\u4E00\u4E2A\u4F8B\u5916\u57DF\uFF1A`<ModalLockExempt><Button \u2026 /></ModalLockExempt>`\u3002\u4E0E `lockExceptions` \u540C\u4E00\u5957\u673A\u5236\uFF0C\u9002\u5408\u653E\u8FDB `headerActions` / `footer` / \u6B63\u6587\u3002\u53EA\u8C41\u514D\u4EA4\u4E92\uFF0C\u4E0D\u653E\u5F00\u4E09\u6761\u5173\u95ED\u8DEF\u5F84",
|
|
68628
|
+
"en": "(same package export) Declares an exemption region anywhere in the panel: `<ModalLockExempt><Button \u2026 /></ModalLockExempt>`. Same mechanism as `lockExceptions`; use it inside `headerActions` / `footer` / body. Only exempts interaction, never the three close paths"
|
|
68602
68629
|
}
|
|
68603
68630
|
},
|
|
68604
68631
|
{
|
|
@@ -68768,6 +68795,24 @@ var docData = {
|
|
|
68768
68795
|
"en": "Close on mask click (treated as cancel)"
|
|
68769
68796
|
}
|
|
68770
68797
|
},
|
|
68798
|
+
{
|
|
68799
|
+
"name": "locked",
|
|
68800
|
+
"type": "boolean",
|
|
68801
|
+
"def": "false",
|
|
68802
|
+
"desc": {
|
|
68803
|
+
"zh": "\u9501\u6B7B\u5168\u90E8\u4EA4\u4E92\uFF08\u542B\u4E49\u540C `Modal.locked`\uFF09\uFF1A\u6574\u6846\u70B9\u4E0D\u52A8\u3001Tab \u8FDB\u4E0D\u53BB\u3001\u4E09\u6761\u5173\u95ED\u8DEF\u5F84\u540C\u65F6\u5931\u6548\u3002\u4E0D\u4F20\u4F8B\u5916\u5219\u8FDE\u5185\u7F6E\u94AE\u4E00\u8D77\u5C01",
|
|
68804
|
+
"en": "Lock every interaction (same as `Modal.locked`): the whole dialog is unclickable, Tab cannot enter, all three close paths stop working. Without exceptions the built-in buttons are locked too"
|
|
68805
|
+
}
|
|
68806
|
+
},
|
|
68807
|
+
{
|
|
68808
|
+
"name": "lockExceptions",
|
|
68809
|
+
"type": "readonly ('cancel' | 'confirm')[]",
|
|
68810
|
+
"def": "\u2014",
|
|
68811
|
+
"desc": {
|
|
68812
|
+
"zh": "`locked` \u671F\u95F4\u4ECD\u53EF\u70B9\u7684**\u5185\u7F6E\u6309\u94AE**\uFF1A\u5178\u578B `[cancel]`\uFF08\u957F\u4EFB\u52A1\u91CC\u5141\u8BB8\u53D6\u6D88\uFF09\u3002\u53EA\u6536\u5185\u7F6E\u94AE\u540D\u3001\u4E0D\u900F\u4F20\u81EA\u5B9A\u4E49\u63A7\u4EF6\uFF1B\u4E0D\u4F20 = \u5168\u5C01\u3002\u53EA\u8C41\u514D\u4EA4\u4E92\uFF0C\u4E09\u6761\u5173\u95ED\u8DEF\u5F84\u4ECD\u5C01\u6B7B",
|
|
68813
|
+
"en": "Built-in buttons that stay clickable while `locked`: typically `[cancel]` (let the user cancel a long task). Only built-in button names, no custom controls; omitted = all locked. Only exempts interaction, never the three close paths"
|
|
68814
|
+
}
|
|
68815
|
+
},
|
|
68771
68816
|
{
|
|
68772
68817
|
"name": "size",
|
|
68773
68818
|
"type": "ModalSize",
|
|
@@ -68872,6 +68917,24 @@ var docData = {
|
|
|
68872
68917
|
"en": "Close on mask click"
|
|
68873
68918
|
}
|
|
68874
68919
|
},
|
|
68920
|
+
{
|
|
68921
|
+
"name": "locked",
|
|
68922
|
+
"type": "boolean",
|
|
68923
|
+
"def": "false",
|
|
68924
|
+
"desc": {
|
|
68925
|
+
"zh": "\u9501\u6B7B\u5168\u90E8\u4EA4\u4E92\uFF08\u542B\u4E49\u540C `Modal.locked`\uFF09\uFF1A\u6574\u6846\u70B9\u4E0D\u52A8\u3001Tab \u8FDB\u4E0D\u53BB\u3001\u4E09\u6761\u5173\u95ED\u8DEF\u5F84\u540C\u65F6\u5931\u6548\u3002\u4E0D\u4F20\u4F8B\u5916\u5219\u786E\u8BA4\u94AE\u4E5F\u5C01",
|
|
68926
|
+
"en": "Lock every interaction (same as `Modal.locked`): the whole dialog is unclickable, Tab cannot enter, all three close paths stop working. Without an exception the confirm button is locked too"
|
|
68927
|
+
}
|
|
68928
|
+
},
|
|
68929
|
+
{
|
|
68930
|
+
"name": "lockExceptions",
|
|
68931
|
+
"type": "boolean",
|
|
68932
|
+
"def": "false",
|
|
68933
|
+
"desc": {
|
|
68934
|
+
"zh": "`locked` \u671F\u95F4\u786E\u8BA4\u94AE\u662F\u5426\u4ECD\u53EF\u70B9\uFF08\u5355\u6309\u94AE\u5F39\u7A97\uFF09\u3002\u4E0D\u4F20 = \u5168\u5C01\uFF1B\u53EA\u8C41\u514D\u4EA4\u4E92\uFF0C\u4E09\u6761\u5173\u95ED\u8DEF\u5F84\u4ECD\u5C01\u6B7B",
|
|
68935
|
+
"en": "Whether the confirm button stays clickable while `locked` (single-button dialog). Omitted = all locked; only exempts interaction, never the three close paths"
|
|
68936
|
+
}
|
|
68937
|
+
},
|
|
68875
68938
|
{
|
|
68876
68939
|
"name": "size",
|
|
68877
68940
|
"type": "ModalSize",
|
|
@@ -68918,8 +68981,17 @@ var docData = {
|
|
|
68918
68981
|
"type": "'core' | 'host'",
|
|
68919
68982
|
"def": "'core'",
|
|
68920
68983
|
"desc": {
|
|
68921
|
-
"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",
|
|
68922
|
-
"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'
|
|
68923
68995
|
}
|
|
68924
68996
|
}
|
|
68925
68997
|
]
|
|
@@ -77174,9 +77246,9 @@ function ReferencePage() {
|
|
|
77174
77246
|
"tbody",
|
|
77175
77247
|
null,
|
|
77176
77248
|
[
|
|
77177
|
-
[t3("buildCore"), `v${"0.
|
|
77178
|
-
[t3("buildDemo"), `v${"0.
|
|
77179
|
-
[t3("buildStamp"), "261117-
|
|
77249
|
+
[t3("buildCore"), `v${"0.42.1"}`],
|
|
77250
|
+
[t3("buildDemo"), `v${"0.42.1"}`],
|
|
77251
|
+
[t3("buildStamp"), "261117-064545-153"]
|
|
77180
77252
|
].map(
|
|
77181
77253
|
([label, value]) => (0, import_react110.createElement)(
|
|
77182
77254
|
"tr",
|
|
@@ -77495,9 +77567,9 @@ function DemoPage() {
|
|
|
77495
77567
|
lineHeight: "14px"
|
|
77496
77568
|
}
|
|
77497
77569
|
},
|
|
77498
|
-
(0, import_react112.createElement)("span", null, `core v${"0.
|
|
77499
|
-
(0, import_react112.createElement)("span", null, `demo v${"0.
|
|
77500
|
-
(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")
|
|
77501
77573
|
)
|
|
77502
77574
|
)
|
|
77503
77575
|
),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-plugin-core-demo",
|
|
3
|
-
"version": "0.
|
|
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": [
|