@haklex/rich-editor-ui 0.22.1 → 0.24.0
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.
|
@@ -6,6 +6,8 @@ export interface DialogStackItemProps {
|
|
|
6
6
|
dismiss: () => void;
|
|
7
7
|
}>;
|
|
8
8
|
description?: ReactNode;
|
|
9
|
+
/** Fired once when the dialog transitions open -> closed (Esc, backdrop, or programmatic dismiss). */
|
|
10
|
+
onClose?: () => void;
|
|
9
11
|
portalClassName?: string;
|
|
10
12
|
sheet?: boolean | 'auto';
|
|
11
13
|
showCloseButton?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../src/components/dialog/store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE3C,MAAM,WAAW,oBAAoB;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,OAAO,EAAE,EAAE,CAAC;QAAE,OAAO,EAAE,MAAM,IAAI,CAAA;KAAE,CAAC,CAAC;IACrC,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IACzB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IACzB,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB;AAED,MAAM,WAAW,eAAgB,SAAQ,oBAAoB;IAC3D,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,OAAO,CAAC;CACf;AAUD,wBAAgB,SAAS,CAAC,EAAE,EAAE,MAAM,IAAI,cAKvC;AAED,wBAAgB,WAAW,IAAI,eAAe,EAAE,CAE/C;AAED,wBAAgB,aAAa,CAAC,KAAK,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GED
|
@@ -1427,11 +1427,14 @@ function removeDialog(id) {
|
|
|
1427
1427
|
emit();
|
|
1428
1428
|
}
|
|
1429
1429
|
function dismissDialog(id) {
|
|
1430
|
+
const target = stack.find((item) => item.id === id);
|
|
1431
|
+
if (!target || !target.open) return;
|
|
1430
1432
|
stack = stack.map((item) => item.id === id ? {
|
|
1431
1433
|
...item,
|
|
1432
1434
|
open: false
|
|
1433
1435
|
} : item);
|
|
1434
1436
|
emit();
|
|
1437
|
+
target.onClose?.();
|
|
1435
1438
|
}
|
|
1436
1439
|
function dismissTopDialog() {
|
|
1437
1440
|
for (let i = stack.length - 1; i >= 0; i--) if (stack[i].open) {
|
|
@@ -1440,11 +1443,13 @@ function dismissTopDialog() {
|
|
|
1440
1443
|
}
|
|
1441
1444
|
}
|
|
1442
1445
|
function dismissAllDialogs() {
|
|
1446
|
+
const closing = stack.filter((item) => item.open);
|
|
1443
1447
|
stack = stack.map((item) => ({
|
|
1444
1448
|
...item,
|
|
1445
1449
|
open: false
|
|
1446
1450
|
}));
|
|
1447
1451
|
emit();
|
|
1452
|
+
for (const item of closing) item.onClose?.();
|
|
1448
1453
|
}
|
|
1449
1454
|
//#endregion
|
|
1450
1455
|
//#region src/components/dialog/sheet.tsx
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@haklex/rich-editor-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.24.0",
|
|
4
4
|
"description": "UI components for haklex rich editor",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"dist"
|
|
22
22
|
],
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@haklex/rich-style-token": "0.
|
|
24
|
+
"@haklex/rich-style-token": "0.24.0"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@lexical/react": "^0.45.0",
|