@marimo-team/islands 0.26.1-dev105 → 0.26.1-dev112
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/{ConnectedDataExplorerComponent-C6dY5fiI.js → ConnectedDataExplorerComponent-DQaiOY7w.js} +15 -15
- package/dist/{ErrorBoundary-Bn664FZa.js → ErrorBoundary-pNKOBKXw.js} +19 -19
- package/dist/{abnfDiagram-VCTEODGH-Ba0MYVW8.js → abnfDiagram-VCTEODGH-Df80tEYq.js} +2 -2
- package/dist/{any-language-editor-BNe8do3C.js → any-language-editor-BW-gNmbk.js} +2 -2
- package/dist/{architectureDiagram-5GKGNRK7-7MqAehef.js → architectureDiagram-5GKGNRK7-DNNMvKkY.js} +1 -1
- package/dist/{assertNever-5vhHGKOK.js → assertNever-B9_7z-dW.js} +13 -13
- package/dist/{chat-ui-zGgiq5zN.js → chat-ui-C9NZA-bk.js} +49 -49
- package/dist/{check-DUIc04aK.js → check-BqF09bSG.js} +1 -1
- package/dist/{chunk-IMKFNOWR-CAWA0HGB.js → chunk-IMKFNOWR-pXqnQ_fj.js} +1 -1
- package/dist/{chunk-SHT3W25Y-BIwVQjG5.js → chunk-SHT3W25Y-BWrxB3I2.js} +1 -1
- package/dist/{chunk-SVP7TREG-Cux251TB.js → chunk-SVP7TREG-CPdQP8_U.js} +1 -1
- package/dist/{chunk-TICWLB2K-DJVQ6khO.js → chunk-TICWLB2K-C5MYCwBz.js} +1 -1
- package/dist/{circle-question-mark-evCnVIut.js → circle-question-mark-YmLYXyvS.js} +1 -1
- package/dist/{classDiagram-ZZMXUADV-Cwve77ev.js → classDiagram-ZZMXUADV-Ba0SRm01.js} +2 -2
- package/dist/{classDiagram-v2-VYDZK3BY-BAeHKXmD.js → classDiagram-v2-VYDZK3BY-DSSzL_Dk.js} +2 -2
- package/dist/{code-visibility-CMgSFUs7.js → code-visibility-B9s3Hl8z.js} +18 -18
- package/dist/{common-DWnR77Qk.js → common-Bn3jx0X6.js} +170 -168
- package/dist/{copy-icon-CmNLxT5_.js → copy-icon-zP4__HPI.js} +2 -2
- package/dist/{createReducer-m7yAXmDu.js → createReducer-CArOwUaJ.js} +1 -1
- package/dist/{cynefinDiagram-5FMLGOSQ-t4eEkPJh.js → cynefinDiagram-5FMLGOSQ-BOtNvA04.js} +1 -1
- package/dist/{dagre-GXQ25YYZ-IuZuI28B.js → dagre-GXQ25YYZ-FpCEOTxX.js} +1 -1
- package/dist/{data-grid-overlay-editor-zS1h3iMI.js → data-grid-overlay-editor-mxwwRaQy.js} +1 -1
- package/dist/{diagram-S7CK7UJ4-D8R5Q_ok.js → diagram-S7CK7UJ4-Cm1HaBuu.js} +1 -1
- package/dist/{diagram-UQ7AKVKN-BGuMPsr-.js → diagram-UQ7AKVKN-D1lA7Ggu.js} +1 -1
- package/dist/{diagram-VX7I27RA-BkTtpO8P.js → diagram-VX7I27RA-BX3e-Rue.js} +1 -1
- package/dist/{diagram-Z3DM3KII-C0__Mxfm.js → diagram-Z3DM3KII-Dgoj7bPf.js} +1 -1
- package/dist/{dialog-BvjfalZ9.js → dialog-DfKgafXJ.js} +30 -30
- package/dist/{dropdown-menu-D0DeN-aL.js → dropdown-menu-Dge_SmqE.js} +168 -168
- package/dist/{ebnfDiagram-PWID7BFC-CSESPZoz.js → ebnfDiagram-PWID7BFC-B0xWiXrz.js} +2 -2
- package/dist/{erDiagram-RLTQ6QDP-DsDTtabH.js → erDiagram-RLTQ6QDP-Cm-GO31-.js} +1 -1
- package/dist/{error-banner-CXLjTW24.js → error-banner-CfYrJaIb.js} +91 -91
- package/dist/{error-entries-DVclFjaE.js → error-entries-1DC4BiYB.js} +661 -656
- package/dist/{export-context-CkgZeARR.js → export-context-B1jdxzHF.js} +21 -21
- package/dist/{feedback-button-BMGqp8Ff.js → feedback-button-BrzbnRTT.js} +72 -72
- package/dist/{flowDiagram-HODETNUW-qxDPYbfV.js → flowDiagram-HODETNUW-CH6xMlW_.js} +2 -2
- package/dist/{formats-CcQrzFo8.js → formats-Y52bg800.js} +1 -1
- package/dist/{glide-data-editor-Bra6h4KB.js → glide-data-editor-Cnsv3NcI.js} +11 -11
- package/dist/{glide-utils-CD8BaFTm.js → glide-utils-BRcuSTCx.js} +2 -2
- package/dist/{globals-_bXqC0R8.js → globals-BGqfFPx8.js} +3 -3
- package/dist/{html-to-image-Cst4BlIm.js → html-to-image-CsvAOgd3.js} +5073 -5076
- package/dist/{infoDiagram-27XIBGKW-B5hq8RM_.js → infoDiagram-27XIBGKW-DbUO63CX.js} +1 -1
- package/dist/{ishikawaDiagram-5VMMS53U-DkHc_9ET.js → ishikawaDiagram-5VMMS53U-CfQrrELH.js} +1 -1
- package/dist/{kanban-definition-UXKFOSKX-CqkTFXmU.js → kanban-definition-UXKFOSKX-C5SJcu1W.js} +1 -1
- package/dist/{loader-CGrYn73j.js → loader-C9-qRO3m.js} +2 -2
- package/dist/main.js +6696 -6602
- package/dist/{mermaid-pmVHDUQA.js → mermaid-C2alqcd8.js} +34 -34
- package/dist/{mindmap-definition-YA3MSWOX-D6cNa__z.js → mindmap-definition-YA3MSWOX-ByVHE0Ax.js} +1 -1
- package/dist/{number-overlay-editor-XLUhOVa7.js → number-overlay-editor-DuSCOMTK.js} +1 -1
- package/dist/{pegDiagram-XKGWAZYB-CmWJX_s1.js → pegDiagram-XKGWAZYB-DF5FBKZi.js} +2 -2
- package/dist/{pencil-CxMgOe04.js → pencil-D7jyZPnP.js} +1 -1
- package/dist/{pieDiagram-E7YTZNPT-CAQAxHah.js → pieDiagram-E7YTZNPT-B5n9nBQN.js} +1 -1
- package/dist/{process-output-DizFa5IE.js → process-output-CtfJ_Gbp.js} +4 -4
- package/dist/{railroadDiagram-O6MQD6OU-jlSsiQg3.js → railroadDiagram-O6MQD6OU-r5t7OYNE.js} +2 -2
- package/dist/{requirementDiagram-BXWQKSXE-DkDjfPhn.js → requirementDiagram-BXWQKSXE-D4QtEyZQ.js} +1 -1
- package/dist/{reveal-component-llpC324_.js → reveal-component-DzmiQyN9.js} +1008 -1008
- package/dist/{select-CEnB18uc.js → select-Buk3aXi1.js} +341 -341
- package/dist/{sequenceDiagram-WJ2MYXX4-DLywsGCW.js → sequenceDiagram-WJ2MYXX4-CK3Atn-z.js} +1 -1
- package/dist/{spec-Dz-Avv1m.js → spec-BEp9O9dy.js} +4 -4
- package/dist/{stateDiagram-D77RDMKH-DUmlKwYU.js → stateDiagram-D77RDMKH-C1SxRI8V.js} +2 -2
- package/dist/{stateDiagram-v2-MP3YSRHH-D646KiXs.js → stateDiagram-v2-MP3YSRHH-DK5X6bsr.js} +2 -2
- package/dist/{static-state-iw0PrHK4.js → static-state-D-aT9dOr.js} +9 -9
- package/dist/style.css +1 -1
- package/dist/{swimlanes-42K2YHIH-L7B1GphF.js → swimlanes-42K2YHIH-DdH5TZdu.js} +1 -1
- package/dist/{swimlanesDiagram-VR7AAH4N-DEu2wxtC.js → swimlanesDiagram-VR7AAH4N-CWBIvzgR.js} +2 -2
- package/dist/{timeline-definition-24CTP7MA-DDPyx1yG.js → timeline-definition-24CTP7MA-DE7-o2zU.js} +1 -1
- package/dist/{toast-BTjH6fIf.js → toast-b3k4YxaT.js} +54 -54
- package/dist/{tooltip-DyLdBIM4.js → tooltip-D-9pDheN.js} +62 -62
- package/dist/{use-restore-focus-DJ_-uSn_.js → use-restore-focus-CCfk-ey2.js} +1 -1
- package/dist/{useDateFormatter-HpKD0jEC.js → useDateFormatter-DH0uFwfL.js} +2 -2
- package/dist/{useDeepCompareMemoize-CHx-NxMl.js → useDeepCompareMemoize-Dn-ZJVTd.js} +1 -1
- package/dist/{useLifecycle-tPpAt-OE.js → useLifecycle-yjK7JsRL.js} +1 -1
- package/dist/{vega-component-BzNDFvQf.js → vega-component-BIq0qzhQ.js} +8 -8
- package/dist/{vennDiagram-4TSXK5OY-CRwWeb7g.js → vennDiagram-4TSXK5OY-D7yfNz0d.js} +1 -1
- package/dist/{wardleyDiagram-VM6X3IG4-DVlG9eoq.js → wardleyDiagram-VM6X3IG4-m5Jcz26Z.js} +1 -1
- package/dist/{xychartDiagram-S5SC5T6Z-CM32AISp.js → xychartDiagram-S5SC5T6Z-CA3zV3RW.js} +1 -1
- package/package.json +1 -1
- package/src/__mocks__/intersection-observer.ts +13 -12
- package/src/components/editor/Output.tsx +1 -1
- package/src/components/editor/__tests__/cell-renders.test.tsx +344 -2
- package/src/components/editor/ai/__tests__/completion-utils.test.ts +12 -20
- package/src/components/editor/ai/ai-completion-editor.tsx +391 -289
- package/src/components/editor/ai/completion-utils.ts +9 -7
- package/src/components/editor/cell/CellDeleteShoulder.tsx +82 -0
- package/src/components/editor/cell/DeleteButton.tsx +11 -2
- package/src/components/editor/cell/__tests__/CellDeleteShoulder.test.tsx +181 -0
- package/src/components/editor/cell/code/cell-editor.tsx +15 -25
- package/src/components/editor/chrome/panels/__tests__/logs-panel.test.tsx +26 -2
- package/src/components/editor/chrome/panels/logs-panel.tsx +27 -11
- package/src/components/editor/chrome/panels/outline/__tests__/outline-keyboard.test.tsx +517 -68
- package/src/components/editor/chrome/panels/outline/__tests__/useActiveOutline.test.ts +17 -5
- package/src/components/editor/chrome/panels/outline/floating-outline.tsx +29 -59
- package/src/components/editor/chrome/panels/outline/useActiveOutline.tsx +333 -133
- package/src/components/editor/chrome/panels/outline-panel.tsx +5 -19
- package/src/components/editor/notebook-cell.tsx +250 -274
- package/src/core/ai/state.ts +6 -0
- package/src/core/cells/__tests__/cells.test.ts +34 -20
- package/src/core/cells/__tests__/layout.test.ts +1 -1
- package/src/core/cells/__tests__/notebook-outline.test.ts +31 -3
- package/src/core/cells/cell-log-chunks.ts +31 -0
- package/src/core/cells/cells.ts +31 -20
- package/src/core/cells/outline.ts +8 -8
- package/src/core/codemirror/language/extension.ts +6 -3
- package/src/core/codemirror/language/panel/panel.test.tsx +144 -0
- package/src/core/codemirror/language/panel/panel.tsx +9 -6
- package/src/core/codemirror/lsp/__tests__/log-messages.test.ts +1 -1
- package/src/core/codemirror/lsp/__tests__/transports.test.ts +1 -1
- package/src/core/codemirror/react-dom/createPanel.tsx +15 -15
- package/src/core/dom/__tests__/outline.test.ts +29 -170
- package/src/core/dom/outline.ts +21 -61
- package/src/core/executions/atoms.ts +12 -4
- package/src/core/islands/__tests__/bridge.test.ts +2 -5
- package/src/core/islands/components/output-wrapper.tsx +7 -2
- package/src/core/session/__tests__/useNotebookSession.hook.test.tsx +10 -1
- package/src/css/common.css +11 -0
- package/src/hooks/useFinePointer.ts +30 -0
- package/src/plugins/layout/OutlinePlugin.tsx +5 -17
- package/src/stories/log-viewer.stories.tsx +48 -44
|
@@ -9,7 +9,7 @@ import "./chunk-4HAMMTFA-qKgadZwy.js";
|
|
|
9
9
|
import "./chunk-GVQU2GXP-BkolpSXU.js";
|
|
10
10
|
import "./chunk-L3NEJ4N5-B-BFQp9t.js";
|
|
11
11
|
import { o as n } from "./chunk-OSK3NFVY-BzfZ4VBG.js";
|
|
12
|
-
import { c as r } from "./mermaid-
|
|
12
|
+
import { c as r } from "./mermaid-C2alqcd8.js";
|
|
13
13
|
//#region ../node_modules/.pnpm/mermaid@11.17.2/node_modules/mermaid/dist/chunks/mermaid.core/swimlanes-42K2YHIH.mjs
|
|
14
14
|
var i = 5, a = 1e-5, o = 1e-6;
|
|
15
15
|
function s(e) {
|
package/dist/{swimlanesDiagram-VR7AAH4N-DEu2wxtC.js → swimlanesDiagram-VR7AAH4N-CWBIvzgR.js}
RENAMED
|
@@ -9,11 +9,11 @@ import "./chunk-4HAMMTFA-qKgadZwy.js";
|
|
|
9
9
|
import "./chunk-GVQU2GXP-BkolpSXU.js";
|
|
10
10
|
import "./chunk-L3NEJ4N5-B-BFQp9t.js";
|
|
11
11
|
import "./chunk-OSK3NFVY-BzfZ4VBG.js";
|
|
12
|
-
import "./mermaid-
|
|
12
|
+
import "./mermaid-C2alqcd8.js";
|
|
13
13
|
import "./chunk-F27PBJKO-COH2t-FO.js";
|
|
14
14
|
import "./chunk-XXDRQBXY-BM-YIt-_.js";
|
|
15
15
|
import "./chunk-POPQ4Y6H-BFSZel4w.js";
|
|
16
|
-
import { r as t, t as n } from "./chunk-SHT3W25Y-
|
|
16
|
+
import { r as t, t as n } from "./chunk-SHT3W25Y-BWrxB3I2.js";
|
|
17
17
|
//#region ../node_modules/.pnpm/mermaid@11.17.2/node_modules/mermaid/dist/chunks/mermaid.core/swimlanesDiagram-VR7AAH4N.mjs
|
|
18
18
|
var r = n({
|
|
19
19
|
defaultLayout: "swimlane",
|
package/dist/{timeline-definition-24CTP7MA-DDPyx1yG.js → timeline-definition-24CTP7MA-DE7-o2zU.js}
RENAMED
|
@@ -3,7 +3,7 @@ import { p as t } from "./chunk-75Z2AOVW-76L6My3P.js";
|
|
|
3
3
|
import { n, t as r } from "./src-D5uZaZib.js";
|
|
4
4
|
import { n as i, t as a } from "./chunk-Y2CYZVJY-DKKS1VyV.js";
|
|
5
5
|
import { $ as o, J as s, a as c, b as l, et as u, nt as d, o as f, x as p } from "./chunk-DU6HZSFF-4SDIhUTY.js";
|
|
6
|
-
import { p as m } from "./mermaid-
|
|
6
|
+
import { p as m } from "./mermaid-C2alqcd8.js";
|
|
7
7
|
//#region ../node_modules/.pnpm/mermaid@11.17.2/node_modules/mermaid/dist/chunks/mermaid.core/timeline-definition-24CTP7MA.mjs
|
|
8
8
|
var h = (function() {
|
|
9
9
|
var e = /* @__PURE__ */ i(function(e, t, n, r) {
|
|
@@ -2,11 +2,11 @@ import { a as e } from "./rolldown-runtime-BPCzCO3I.js";
|
|
|
2
2
|
import { h as t, i as n, p as r } from "./button-Z2R2272J.js";
|
|
3
3
|
import { t as i } from "./react-Bgs_wQh3.js";
|
|
4
4
|
import { t as a } from "./compiler-runtime-C5KHtL5D.js";
|
|
5
|
-
import { m as o } from "./tooltip-
|
|
6
|
-
import { a as s, s as c } from "./assertNever-
|
|
5
|
+
import { m as o } from "./tooltip-D-9pDheN.js";
|
|
6
|
+
import { a as s, s as c } from "./assertNever-B9_7z-dW.js";
|
|
7
7
|
import { t as l } from "./react-dom-DdqGVp5N.js";
|
|
8
8
|
import { t as u } from "./jsx-runtime-D8btoEHk.js";
|
|
9
|
-
import { Cn as d, Sn as f,
|
|
9
|
+
import { Cn as d, Sn as f, bn as p, gn as m, hn as h, ln as g, mn as _, vn as v, wn as ee, xn as y, yn as te } from "./use-restore-focus-CCfk-ey2.js";
|
|
10
10
|
//#region ../node_modules/.pnpm/@radix-ui+react-toast@1.3.1_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@1_72d2e12f1af98becc17c9660ff8081b2/node_modules/@radix-ui/react-toast/dist/index.mjs
|
|
11
11
|
var b = /* @__PURE__ */ e(i(), 1), ne = /* @__PURE__ */ e(l(), 1), x = u(), S = Object.defineProperty, C = (e, t) => S(e, "name", {
|
|
12
12
|
value: t,
|
|
@@ -19,7 +19,7 @@ var b = /* @__PURE__ */ e(i(), 1), ne = /* @__PURE__ */ e(l(), 1), x = u(), S =
|
|
|
19
19
|
}, k = {
|
|
20
20
|
Foreground: "foreground",
|
|
21
21
|
Background: "background"
|
|
22
|
-
}, [A, ie] =
|
|
22
|
+
}, [A, ie] = f("Toast", [D]), [j, M] = A(T);
|
|
23
23
|
function N(e) {
|
|
24
24
|
typeof w == "function" ? w(e) : e();
|
|
25
25
|
}
|
|
@@ -51,7 +51,7 @@ var P = /* @__PURE__ */ C((e) => {
|
|
|
51
51
|
})
|
|
52
52
|
});
|
|
53
53
|
}, "ToastProvider"), F = "ToastViewport", I = ["F8"], L = "toast.viewportPause", R = "toast.viewportResume", z = /* @__PURE__ */ b.forwardRef(/* @__PURE__ */ C(function(e, t) {
|
|
54
|
-
let { __scopeToast: n, hotkey: i = I, label: a = "Notifications ({hotkey})", ...o } = e, s = M(F, n), c = re(n), l = b.useRef(null), u = b.useRef(null),
|
|
54
|
+
let { __scopeToast: n, hotkey: i = I, label: a = "Notifications ({hotkey})", ...o } = e, s = M(F, n), c = re(n), l = b.useRef(null), u = b.useRef(null), f = b.useRef(null), p = b.useRef(null), m = r(t, p, s.onViewportChange), g = i.join("+").replace(/Key/g, "").replace(/Digit/g, ""), _ = s.toastCount > 0;
|
|
55
55
|
b.useEffect(() => {
|
|
56
56
|
let e = /* @__PURE__ */ C((e) => {
|
|
57
57
|
i.length !== 0 && i.every((t) => e[t] || e.code === t) && p.current?.focus();
|
|
@@ -59,7 +59,7 @@ var P = /* @__PURE__ */ C((e) => {
|
|
|
59
59
|
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
60
60
|
}, [i]), b.useEffect(() => {
|
|
61
61
|
let e = l.current, t = p.current;
|
|
62
|
-
if (
|
|
62
|
+
if (_ && e && t) {
|
|
63
63
|
let n = /* @__PURE__ */ C(() => {
|
|
64
64
|
if (!s.isClosePausedRef.current) {
|
|
65
65
|
let e = new CustomEvent(L);
|
|
@@ -79,8 +79,8 @@ var P = /* @__PURE__ */ C((e) => {
|
|
|
79
79
|
e.removeEventListener("focusin", n), e.removeEventListener("focusout", i), e.removeEventListener("pointermove", n), e.removeEventListener("pointerleave", a), window.removeEventListener("blur", n), window.removeEventListener("focus", r);
|
|
80
80
|
};
|
|
81
81
|
}
|
|
82
|
-
}, [
|
|
83
|
-
let
|
|
82
|
+
}, [_, s.isClosePausedRef]);
|
|
83
|
+
let v = b.useCallback(({ tabbingDirection: e }) => {
|
|
84
84
|
let t = c().map((t) => {
|
|
85
85
|
let n = t.ref.current, r = [n, ...ye(n)];
|
|
86
86
|
return e === "forwards" ? r : r.reverse();
|
|
@@ -98,37 +98,37 @@ var P = /* @__PURE__ */ C((e) => {
|
|
|
98
98
|
u.current?.focus();
|
|
99
99
|
return;
|
|
100
100
|
}
|
|
101
|
-
let i =
|
|
102
|
-
X(i.slice(a + 1)) ? t.preventDefault() : r ? u.current?.focus() :
|
|
101
|
+
let i = v({ tabbingDirection: r ? "backwards" : "forwards" }), a = i.findIndex((e) => e === n);
|
|
102
|
+
X(i.slice(a + 1)) ? t.preventDefault() : r ? u.current?.focus() : f.current?.focus();
|
|
103
103
|
}
|
|
104
104
|
}, "handleKeyDown");
|
|
105
105
|
return e.addEventListener("keydown", t), () => e.removeEventListener("keydown", t);
|
|
106
106
|
}
|
|
107
|
-
}, [c,
|
|
107
|
+
}, [c, v]), /* @__PURE__ */ (0, x.jsxs)(h, {
|
|
108
108
|
ref: l,
|
|
109
109
|
role: "region",
|
|
110
|
-
"aria-label": a.replace("{hotkey}",
|
|
110
|
+
"aria-label": a.replace("{hotkey}", g),
|
|
111
111
|
tabIndex: -1,
|
|
112
|
-
style: { pointerEvents:
|
|
112
|
+
style: { pointerEvents: _ ? void 0 : "none" },
|
|
113
113
|
children: [
|
|
114
|
-
|
|
114
|
+
_ && /* @__PURE__ */ (0, x.jsx)(ae, {
|
|
115
115
|
ref: u,
|
|
116
116
|
onFocusFromOutsideViewport: () => {
|
|
117
|
-
X(
|
|
117
|
+
X(v({ tabbingDirection: "forwards" }));
|
|
118
118
|
}
|
|
119
119
|
}),
|
|
120
120
|
/* @__PURE__ */ (0, x.jsx)(E.Slot, {
|
|
121
121
|
scope: n,
|
|
122
|
-
children: /* @__PURE__ */ (0, x.jsx)(
|
|
122
|
+
children: /* @__PURE__ */ (0, x.jsx)(d.ol, {
|
|
123
123
|
tabIndex: -1,
|
|
124
124
|
...o,
|
|
125
125
|
ref: m
|
|
126
126
|
})
|
|
127
127
|
}),
|
|
128
|
-
|
|
129
|
-
ref:
|
|
128
|
+
_ && /* @__PURE__ */ (0, x.jsx)(ae, {
|
|
129
|
+
ref: f,
|
|
130
130
|
onFocusFromOutsideViewport: () => {
|
|
131
|
-
X(
|
|
131
|
+
X(v({ tabbingDirection: "backwards" }));
|
|
132
132
|
}
|
|
133
133
|
})
|
|
134
134
|
]
|
|
@@ -146,45 +146,45 @@ var P = /* @__PURE__ */ C((e) => {
|
|
|
146
146
|
}
|
|
147
147
|
});
|
|
148
148
|
}, "ToastFocusProxy")), V = "Toast", oe = "toast.swipeStart", se = "toast.swipeMove", ce = "toast.swipeCancel", le = "toast.swipeEnd", H = /* @__PURE__ */ b.forwardRef(/* @__PURE__ */ C(function(e, t) {
|
|
149
|
-
let { forceMount: n, open: r, defaultOpen: i, onOpenChange: a, ...o } = e, [s, c] =
|
|
149
|
+
let { forceMount: n, open: r, defaultOpen: i, onOpenChange: a, ...o } = e, [s, c] = te({
|
|
150
150
|
prop: r,
|
|
151
151
|
defaultProp: i ?? !0,
|
|
152
152
|
onChange: a,
|
|
153
153
|
caller: V
|
|
154
154
|
});
|
|
155
|
-
return /* @__PURE__ */ (0, x.jsx)(
|
|
155
|
+
return /* @__PURE__ */ (0, x.jsx)(v, {
|
|
156
156
|
present: n || s,
|
|
157
157
|
children: /* @__PURE__ */ (0, x.jsx)(fe, {
|
|
158
158
|
open: s,
|
|
159
159
|
...o,
|
|
160
160
|
ref: t,
|
|
161
161
|
onClose: () => c(!1),
|
|
162
|
-
onPause:
|
|
163
|
-
onResume:
|
|
164
|
-
onSwipeStart:
|
|
162
|
+
onPause: m(e.onPause),
|
|
163
|
+
onResume: m(e.onResume),
|
|
164
|
+
onSwipeStart: p(e.onSwipeStart, (e) => {
|
|
165
165
|
e.currentTarget.setAttribute("data-swipe", "start");
|
|
166
166
|
}),
|
|
167
|
-
onSwipeMove:
|
|
167
|
+
onSwipeMove: p(e.onSwipeMove, (e) => {
|
|
168
168
|
let { x: t, y: n } = e.detail.delta;
|
|
169
169
|
e.currentTarget.setAttribute("data-swipe", "move"), e.currentTarget.style.setProperty("--radix-toast-swipe-move-x", `${t}px`), e.currentTarget.style.setProperty("--radix-toast-swipe-move-y", `${n}px`);
|
|
170
170
|
}),
|
|
171
|
-
onSwipeCancel:
|
|
171
|
+
onSwipeCancel: p(e.onSwipeCancel, (e) => {
|
|
172
172
|
e.currentTarget.setAttribute("data-swipe", "cancel"), e.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"), e.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"), e.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"), e.currentTarget.style.removeProperty("--radix-toast-swipe-end-y");
|
|
173
173
|
}),
|
|
174
|
-
onSwipeEnd:
|
|
174
|
+
onSwipeEnd: p(e.onSwipeEnd, (e) => {
|
|
175
175
|
let { x: t, y: n } = e.detail.delta;
|
|
176
176
|
e.currentTarget.setAttribute("data-swipe", "end"), e.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"), e.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"), e.currentTarget.style.setProperty("--radix-toast-swipe-end-x", `${t}px`), e.currentTarget.style.setProperty("--radix-toast-swipe-end-y", `${n}px`), c(!1);
|
|
177
177
|
})
|
|
178
178
|
})
|
|
179
179
|
});
|
|
180
180
|
}, "Toast")), [ue, de] = A(V, { onClose() {} }), fe = /* @__PURE__ */ b.forwardRef(/* @__PURE__ */ C(function(e, t) {
|
|
181
|
-
let { __scopeToast: n, type: i = k.Foreground, duration: a, open: o, onClose: s, onEscapeKeyDown: c, onPause: l, onResume: u, onSwipeStart:
|
|
182
|
-
S?.contains(document.activeElement) &&
|
|
181
|
+
let { __scopeToast: n, type: i = k.Foreground, duration: a, open: o, onClose: s, onEscapeKeyDown: c, onPause: l, onResume: u, onSwipeStart: f, onSwipeMove: h, onSwipeCancel: g, onSwipeEnd: v, ...ee } = e, y = M(V, n), te = re(n), [S, w] = b.useState(null), T = r(t, w), D = b.useRef(null), O = b.useRef(null), A = a || y.duration, ie = b.useRef(0), j = b.useRef(A), N = b.useRef(0), { onToastAdd: P, onToastRemove: F } = y, I = m(() => {
|
|
182
|
+
S?.contains(document.activeElement) && y.viewport?.focus(), s();
|
|
183
183
|
}), z = b.useCallback((e) => {
|
|
184
184
|
e && e !== Infinity && (window.clearTimeout(N.current), ie.current = (/* @__PURE__ */ new Date()).getTime(), N.current = window.setTimeout(I, e));
|
|
185
185
|
}, [I]);
|
|
186
186
|
b.useEffect(() => {
|
|
187
|
-
let e =
|
|
187
|
+
let e = y.viewport;
|
|
188
188
|
if (e) {
|
|
189
189
|
let t = /* @__PURE__ */ C(() => {
|
|
190
190
|
z(j.current), u?.();
|
|
@@ -197,23 +197,23 @@ var P = /* @__PURE__ */ C((e) => {
|
|
|
197
197
|
};
|
|
198
198
|
}
|
|
199
199
|
}, [
|
|
200
|
-
|
|
200
|
+
y.viewport,
|
|
201
201
|
A,
|
|
202
202
|
l,
|
|
203
203
|
u,
|
|
204
204
|
z
|
|
205
205
|
]), b.useEffect(() => {
|
|
206
|
-
j.current = A, o && !
|
|
206
|
+
j.current = A, o && !y.isClosePausedRef.current && z(A);
|
|
207
207
|
}, [
|
|
208
208
|
o,
|
|
209
209
|
A,
|
|
210
|
-
|
|
210
|
+
y.isClosePausedRef,
|
|
211
211
|
z
|
|
212
212
|
]), b.useEffect(() => () => {
|
|
213
213
|
window.clearTimeout(N.current);
|
|
214
214
|
}, []), b.useEffect(() => (P(), () => F()), [P, F]);
|
|
215
215
|
let B = b.useMemo(() => S ? J(S) : null, [S]);
|
|
216
|
-
return
|
|
216
|
+
return y.viewport ? /* @__PURE__ */ (0, x.jsxs)(x.Fragment, { children: [B && /* @__PURE__ */ (0, x.jsx)(pe, {
|
|
217
217
|
__scopeToast: n,
|
|
218
218
|
role: "status",
|
|
219
219
|
"aria-live": i === k.Foreground ? "assertive" : "polite",
|
|
@@ -225,13 +225,13 @@ var P = /* @__PURE__ */ C((e) => {
|
|
|
225
225
|
scope: n,
|
|
226
226
|
children: /* @__PURE__ */ (0, x.jsx)(_, {
|
|
227
227
|
asChild: !0,
|
|
228
|
-
onEscapeKeyDown:
|
|
228
|
+
onEscapeKeyDown: p(c, (e) => {
|
|
229
229
|
te().some((t) => t.ref.current?.contains(e.target)) || I();
|
|
230
230
|
}),
|
|
231
|
-
children: /* @__PURE__ */ (0, x.jsx)(
|
|
231
|
+
children: /* @__PURE__ */ (0, x.jsx)(d.li, {
|
|
232
232
|
tabIndex: 0,
|
|
233
233
|
"data-state": o ? "open" : "closed",
|
|
234
|
-
"data-swipe-direction":
|
|
234
|
+
"data-swipe-direction": y.swipeDirection,
|
|
235
235
|
...ee,
|
|
236
236
|
ref: T,
|
|
237
237
|
style: {
|
|
@@ -239,46 +239,46 @@ var P = /* @__PURE__ */ C((e) => {
|
|
|
239
239
|
touchAction: "none",
|
|
240
240
|
...e.style
|
|
241
241
|
},
|
|
242
|
-
onKeyDown:
|
|
242
|
+
onKeyDown: p(e.onKeyDown, (e) => {
|
|
243
243
|
e.key === "Escape" && (c?.(e.nativeEvent), e.nativeEvent.defaultPrevented || I());
|
|
244
244
|
}),
|
|
245
|
-
onPointerDown:
|
|
245
|
+
onPointerDown: p(e.onPointerDown, (e) => {
|
|
246
246
|
e.button === 0 && (D.current = {
|
|
247
247
|
x: e.clientX,
|
|
248
248
|
y: e.clientY
|
|
249
249
|
});
|
|
250
250
|
}),
|
|
251
|
-
onPointerMove:
|
|
251
|
+
onPointerMove: p(e.onPointerMove, (e) => {
|
|
252
252
|
if (!D.current) return;
|
|
253
|
-
let t = e.clientX - D.current.x, n = e.clientY - D.current.y, r = !!O.current, i = ["left", "right"].includes(
|
|
253
|
+
let t = e.clientX - D.current.x, n = e.clientY - D.current.y, r = !!O.current, i = ["left", "right"].includes(y.swipeDirection), a = ["left", "up"].includes(y.swipeDirection) ? Math.min : Math.max, o = i ? a(0, t) : 0, s = i ? 0 : a(0, n), c = e.pointerType === "touch" ? 10 : 2, l = {
|
|
254
254
|
x: o,
|
|
255
255
|
y: s
|
|
256
256
|
}, u = {
|
|
257
257
|
originalEvent: e,
|
|
258
258
|
delta: l
|
|
259
259
|
};
|
|
260
|
-
r ? (O.current = l, Y(se,
|
|
260
|
+
r ? (O.current = l, Y(se, h, u, { discrete: !1 })) : ge(l, y.swipeDirection, c) ? (O.current = l, Y(oe, f, u, { discrete: !1 }), e.target.setPointerCapture(e.pointerId)) : (Math.abs(t) > c || Math.abs(n) > c) && (D.current = null);
|
|
261
261
|
}),
|
|
262
|
-
onPointerUp:
|
|
262
|
+
onPointerUp: p(e.onPointerUp, (e) => {
|
|
263
263
|
let t = O.current, n = e.target;
|
|
264
264
|
if (n.hasPointerCapture(e.pointerId) && n.releasePointerCapture(e.pointerId), O.current = null, D.current = null, t) {
|
|
265
265
|
let n = e.currentTarget, r = {
|
|
266
266
|
originalEvent: e,
|
|
267
267
|
delta: t
|
|
268
268
|
};
|
|
269
|
-
ge(t,
|
|
269
|
+
ge(t, y.swipeDirection, y.swipeThreshold) ? Y(le, v, r, { discrete: !0 }) : Y(ce, g, r, { discrete: !0 }), n.addEventListener("click", (e) => e.preventDefault(), { once: !0 });
|
|
270
270
|
}
|
|
271
271
|
})
|
|
272
272
|
})
|
|
273
273
|
})
|
|
274
|
-
}),
|
|
274
|
+
}), y.viewport)
|
|
275
275
|
})] }) : null;
|
|
276
276
|
}, "ToastImpl")), pe = /* @__PURE__ */ C((e) => {
|
|
277
277
|
let { __scopeToast: t, children: n, ...r } = e, i = M(V, t), [a, s] = b.useState(!1), [c, l] = b.useState(!1);
|
|
278
278
|
return _e(() => s(!0)), b.useEffect(() => {
|
|
279
279
|
let e = window.setTimeout(() => l(!0), 1e3);
|
|
280
280
|
return () => window.clearTimeout(e);
|
|
281
|
-
}, []), c ? null : /* @__PURE__ */ (0, x.jsx)(
|
|
281
|
+
}, []), c ? null : /* @__PURE__ */ (0, x.jsx)(g, {
|
|
282
282
|
asChild: !0,
|
|
283
283
|
container: i.announcerContainer || void 0,
|
|
284
284
|
children: /* @__PURE__ */ (0, x.jsx)(o, {
|
|
@@ -292,13 +292,13 @@ var P = /* @__PURE__ */ C((e) => {
|
|
|
292
292
|
});
|
|
293
293
|
}, "ToastAnnounce"), U = /* @__PURE__ */ b.forwardRef(/* @__PURE__ */ C(function(e, t) {
|
|
294
294
|
let { __scopeToast: n, ...r } = e;
|
|
295
|
-
return /* @__PURE__ */ (0, x.jsx)(
|
|
295
|
+
return /* @__PURE__ */ (0, x.jsx)(d.div, {
|
|
296
296
|
...r,
|
|
297
297
|
ref: t
|
|
298
298
|
});
|
|
299
299
|
}, "ToastTitle")), W = /* @__PURE__ */ b.forwardRef(/* @__PURE__ */ C(function(e, t) {
|
|
300
300
|
let { __scopeToast: n, ...r } = e;
|
|
301
|
-
return /* @__PURE__ */ (0, x.jsx)(
|
|
301
|
+
return /* @__PURE__ */ (0, x.jsx)(d.div, {
|
|
302
302
|
...r,
|
|
303
303
|
ref: t
|
|
304
304
|
});
|
|
@@ -316,16 +316,16 @@ var P = /* @__PURE__ */ C((e) => {
|
|
|
316
316
|
let { __scopeToast: n, ...r } = e, i = de(he, n);
|
|
317
317
|
return /* @__PURE__ */ (0, x.jsx)(q, {
|
|
318
318
|
asChild: !0,
|
|
319
|
-
children: /* @__PURE__ */ (0, x.jsx)(
|
|
319
|
+
children: /* @__PURE__ */ (0, x.jsx)(d.button, {
|
|
320
320
|
type: "button",
|
|
321
321
|
...r,
|
|
322
322
|
ref: t,
|
|
323
|
-
onClick:
|
|
323
|
+
onClick: p(e.onClick, i.onClose)
|
|
324
324
|
})
|
|
325
325
|
});
|
|
326
326
|
}, "ToastClose")), q = /* @__PURE__ */ b.forwardRef(/* @__PURE__ */ C(function(e, t) {
|
|
327
327
|
let { __scopeToast: n, altText: r, ...i } = e;
|
|
328
|
-
return /* @__PURE__ */ (0, x.jsx)(
|
|
328
|
+
return /* @__PURE__ */ (0, x.jsx)(d.div, {
|
|
329
329
|
"data-radix-toast-announce-exclude": "",
|
|
330
330
|
"data-radix-toast-announce-alt": r || void 0,
|
|
331
331
|
...i,
|
|
@@ -353,7 +353,7 @@ function Y(e, t, n, { discrete: r }) {
|
|
|
353
353
|
cancelable: !0,
|
|
354
354
|
detail: n
|
|
355
355
|
});
|
|
356
|
-
t && i.addEventListener(e, t, { once: !0 }), r ?
|
|
356
|
+
t && i.addEventListener(e, t, { once: !0 }), r ? ee(i, a) : i.dispatchEvent(a);
|
|
357
357
|
}
|
|
358
358
|
C(Y, "handleAndDispatchCustomEvent");
|
|
359
359
|
var ge = /* @__PURE__ */ C((e, t, n = 0) => {
|
|
@@ -361,8 +361,8 @@ var ge = /* @__PURE__ */ C((e, t, n = 0) => {
|
|
|
361
361
|
return t === O.Left || t === O.Right ? a && r > n : !a && i > n;
|
|
362
362
|
}, "isDeltaInDirection");
|
|
363
363
|
function _e(e = () => {}) {
|
|
364
|
-
let t =
|
|
365
|
-
|
|
364
|
+
let t = m(e);
|
|
365
|
+
y(() => {
|
|
366
366
|
let e = 0, n = 0;
|
|
367
367
|
return e = window.requestAnimationFrame(() => n = window.requestAnimationFrame(t)), () => {
|
|
368
368
|
window.cancelAnimationFrame(e), window.cancelAnimationFrame(n);
|