@marimo-team/islands 0.25.3-dev322 → 0.25.3-dev348
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-DkXBUBf3.js → ConnectedDataExplorerComponent-xliyyXNO.js} +16 -16
- package/dist/{ErrorBoundary-CYa6lyKz.js → ErrorBoundary-CIimOpqs.js} +7 -7
- package/dist/{abnfDiagram-VCTEODGH-BPS-pTU2.js → abnfDiagram-VCTEODGH-Dl9Nrtbf.js} +2 -2
- package/dist/{any-language-editor-DIS7IdV1.js → any-language-editor-CBHhdCC0.js} +2 -2
- package/dist/{architectureDiagram-5GKGNRK7-DB2MHOb7.js → architectureDiagram-5GKGNRK7-DTg032fQ.js} +1 -1
- package/dist/{assertNever-HbUt8DyH.js → assertNever-ie77PjMn.js} +13 -13
- package/dist/{chat-ui-85k50jaj.js → chat-ui-BV0qyfru.js} +51 -51
- package/dist/{check-CApDh1-n.js → check-DTIv5ZZ3.js} +1 -1
- package/dist/{chunk-IMKFNOWR-CjFCedjx.js → chunk-IMKFNOWR-CsFB-2LW.js} +1 -1
- package/dist/{chunk-SHT3W25Y-Dptltg0_.js → chunk-SHT3W25Y-ByuJHeBL.js} +1 -1
- package/dist/{chunk-SVP7TREG-2jBN760m.js → chunk-SVP7TREG-9oBZhbrr.js} +1 -1
- package/dist/{chunk-TICWLB2K-CS8BE-b9.js → chunk-TICWLB2K-Bx4m0cJ1.js} +1 -1
- package/dist/{classDiagram-ZZMXUADV-HtQWp-Cm.js → classDiagram-ZZMXUADV-Cms37-C9.js} +2 -2
- package/dist/{classDiagram-v2-VYDZK3BY-DA9LETN-.js → classDiagram-v2-VYDZK3BY-qAom4Bi7.js} +2 -2
- package/dist/{code-visibility-CGcIJMGj.js → code-visibility-_-8-dvb4.js} +20 -20
- package/dist/{common-B-Ng3J3K.js → common-CNXuhphD.js} +620 -620
- package/dist/{config-B171m9zn.js → config-CvBnR945.js} +3 -3
- package/dist/{copy-icon-k2_Fx5Qv.js → copy-icon-DmtNidSa.js} +2 -2
- package/dist/{createReducer-BPPI11pP.js → createReducer-BxBCTvKn.js} +5 -5
- package/dist/{cynefinDiagram-5FMLGOSQ-eyocrg_E.js → cynefinDiagram-5FMLGOSQ-BjJZwMEz.js} +1 -1
- package/dist/{dagre-GXQ25YYZ-Dtm96Nvx.js → dagre-GXQ25YYZ-Bohu7_09.js} +1 -1
- package/dist/{data-grid-overlay-editor-CUD6F0Vj.js → data-grid-overlay-editor--4Gk_rwA.js} +1 -1
- package/dist/{diagram-S7CK7UJ4-C09TrdNO.js → diagram-S7CK7UJ4-Chl0n835.js} +1 -1
- package/dist/{diagram-UQ7AKVKN-vHUsSML6.js → diagram-UQ7AKVKN-DHx8nzy7.js} +1 -1
- package/dist/{diagram-VX7I27RA-Ch4mRgz8.js → diagram-VX7I27RA-CKdpv1U4.js} +1 -1
- package/dist/{diagram-Z3DM3KII-DyFQNdAL.js → diagram-Z3DM3KII-sY-sI--2.js} +1 -1
- package/dist/{dialog-C2Muh059.js → dialog-Cqu5Hp5U.js} +21 -21
- package/dist/{dropdown-menu-BGbNnuFq.js → dropdown-menu-DXEYk99S.js} +707 -707
- package/dist/{ebnfDiagram-PWID7BFC-N3SvlrCs.js → ebnfDiagram-PWID7BFC-CD0P2xeH.js} +2 -2
- package/dist/{erDiagram-RLTQ6QDP-RR2q2xtd.js → erDiagram-RLTQ6QDP-BaKQuYxC.js} +1 -1
- package/dist/{error-banner-3_4Lc93Y.js → error-banner-DUB_qUeL.js} +58 -58
- package/dist/{error-entries-BhNAZWU1.js → error-entries-CTb_cxXY.js} +310 -310
- package/dist/{feedback-button-DK6zUzAk.js → feedback-button-BaA4r2dl.js} +7 -7
- package/dist/{flowDiagram-HODETNUW-nxd7WhlW.js → flowDiagram-HODETNUW-BcCpHh7-.js} +2 -2
- package/dist/{formats-aUcw6MrS.js → formats-hF6fETr6.js} +1 -1
- package/dist/{glide-data-editor-O-94UN5R.js → glide-data-editor-CRn3KXyR.js} +3129 -3119
- package/dist/{glide-utils-D4UP8TGv.js → glide-utils-Bnd_k48H.js} +2 -2
- package/dist/{globals-BVjYePCn.js → globals-_FmD97Ui.js} +3 -3
- package/dist/{html-to-image-DOOtP-4-.js → html-to-image-Bbl0PeC7.js} +478 -478
- package/dist/{infoDiagram-27XIBGKW-CUYXQKGf.js → infoDiagram-27XIBGKW-DWltseIa.js} +1 -1
- package/dist/{ishikawaDiagram-5VMMS53U-v6gsCrlK.js → ishikawaDiagram-5VMMS53U-DHgepBPo.js} +1 -1
- package/dist/{kanban-definition-UXKFOSKX-z236-0Ok.js → kanban-definition-UXKFOSKX-B2_BIjBq.js} +1 -1
- package/dist/main.js +6712 -6590
- package/dist/{mermaid-C7lQ_2LJ.js → mermaid--2K0cmt9.js} +34 -34
- package/dist/{mindmap-definition-YA3MSWOX--pZF7OCY.js → mindmap-definition-YA3MSWOX-DNebycIP.js} +1 -1
- package/dist/{number-overlay-editor-jkzzCN4e.js → number-overlay-editor-Bcg25qrp.js} +1 -1
- package/dist/{pegDiagram-XKGWAZYB-Bgw0Zz_6.js → pegDiagram-XKGWAZYB-CH4U3II-.js} +2 -2
- package/dist/{pencil-RXFY-Ek8.js → pencil-MMnw1YQh.js} +1 -1
- package/dist/{pieDiagram-E7YTZNPT-B27tDYvK.js → pieDiagram-E7YTZNPT-pfcrdUCa.js} +1 -1
- package/dist/{process-output-CiX_Dl4L.js → process-output-Dw_sI4Xp.js} +4 -4
- package/dist/{railroadDiagram-O6MQD6OU-CBjPhGpj.js → railroadDiagram-O6MQD6OU-BZKpAbNG.js} +2 -2
- package/dist/{requirementDiagram-BXWQKSXE-DDDrLEw9.js → requirementDiagram-BXWQKSXE-DnyfIHe3.js} +1 -1
- package/dist/{reveal-component-CvPmNI5C.js → reveal-component-BVC491am.js} +18 -18
- package/dist/{select-Cv6lR39D.js → select-suaAxFuo.js} +286 -286
- package/dist/{sequenceDiagram-WJ2MYXX4-DQPaMygQ.js → sequenceDiagram-WJ2MYXX4-BeYuWX7N.js} +1 -1
- package/dist/{spec-BoCLWa-M.js → spec-BQNx2-D7.js} +4 -4
- package/dist/{stateDiagram-D77RDMKH-BDoDVVnq.js → stateDiagram-D77RDMKH-B8FxwAM2.js} +2 -2
- package/dist/{stateDiagram-v2-MP3YSRHH-KNko46uJ.js → stateDiagram-v2-MP3YSRHH-CzWLBqm1.js} +2 -2
- package/dist/{static-state-DgdOadIH.js → static-state-Al_hmf1n.js} +6 -6
- package/dist/style.css +1 -1
- package/dist/{swimlanes-42K2YHIH-boFjOuiI.js → swimlanes-42K2YHIH-CzKmGMts.js} +1 -1
- package/dist/{swimlanesDiagram-VR7AAH4N-BC4FLNwY.js → swimlanesDiagram-VR7AAH4N-DnWIUN_9.js} +2 -2
- package/dist/{timeline-definition-24CTP7MA-CLVPYA-v.js → timeline-definition-24CTP7MA-Czf2QN2R.js} +1 -1
- package/dist/{toast-CUuX7uXg.js → toast-CsJa1nGj.js} +66 -66
- package/dist/{tooltip-DBv8QUvS.js → tooltip-BVbJPkcl.js} +49 -49
- package/dist/{use-restore-focus-BxJh5Zfa.js → use-restore-focus-tPmARo1Q.js} +1035 -1022
- package/dist/{useDateFormatter-2k4mHRBq.js → useDateFormatter-B4ygYuUU.js} +2 -2
- package/dist/{useDeepCompareMemoize-Cb2GRQIS.js → useDeepCompareMemoize-Bcu0DkCS.js} +1 -1
- package/dist/{useLifecycle-B2fV3c8N.js → useLifecycle-MTdtnR3-.js} +1 -1
- package/dist/{vega-component-do3stf0K.js → vega-component-BhBbP4S7.js} +6 -6
- package/dist/{vennDiagram-4TSXK5OY-BLq7sNjb.js → vennDiagram-4TSXK5OY-BrHqWB1U.js} +1 -1
- package/dist/{wardleyDiagram-VM6X3IG4-oyJEWWtb.js → wardleyDiagram-VM6X3IG4-Cms1K_3v.js} +1 -1
- package/dist/{xychartDiagram-S5SC5T6Z-DMjWgQPm.js → xychartDiagram-S5SC5T6Z-_kUiODzS.js} +1 -1
- package/package.json +1 -1
- package/src/__mocks__/requests.ts +0 -2
- package/src/components/chat/__tests__/notebook-context.test.ts +199 -0
- package/src/components/chat/chat-panel.tsx +33 -15
- package/src/components/chat/notebook-context.ts +80 -0
- package/src/components/editor/cell/StopButton.tsx +3 -3
- package/src/components/editor/cell/cell-context-menu.tsx +18 -2
- package/src/components/editor/cell/code/__tests__/language-toggle.test.tsx +38 -1
- package/src/components/editor/cell/code/cell-editor.tsx +2 -1
- package/src/components/editor/cell/code/language-toggle.tsx +6 -4
- package/src/components/editor/chrome/wrapper/__tests__/document-sync-status.test.tsx +9 -6
- package/src/components/slides/slide-cell-view.tsx +2 -1
- package/src/components/ui/__tests__/fullscreen.test.tsx +56 -1
- package/src/components/ui/fullscreen.tsx +18 -2
- package/src/components/ui/slider.tsx +6 -2
- package/src/core/codemirror/copilot/getCodes.ts +1 -1
- package/src/core/edit-app.tsx +5 -4
- package/src/core/executions/__tests__/input.test.ts +1 -1
- package/src/core/executions/__tests__/interrupt.test.ts +200 -0
- package/src/core/executions/__tests__/run.test.ts +3 -3
- package/src/core/executions/index.ts +1 -0
- package/src/core/executions/interrupt.ts +49 -0
- package/src/core/islands/bridge.ts +0 -2
- package/src/core/network/requests-network.ts +0 -15
- package/src/core/network/requests-static.ts +0 -2
- package/src/core/network/requests-toasting.tsx +0 -2
- package/src/core/network/types.ts +0 -3
- package/src/core/notebook/document/__tests__/model.test.ts +4 -4
- package/src/core/notebook/document/__tests__/test-host.test.ts +6 -6
- package/src/core/notebook/document/__tests__/test-host.ts +42 -46
- package/src/core/notebook/document/__tests__/test-notebook.ts +5 -4
- package/src/core/notebook/document/sync.ts +12 -5
- package/src/core/notebook/replica/__tests__/fixtures.ts +8 -0
- package/src/core/notebook/replica/backend.ts +1 -1
- package/src/core/saving/__tests__/document.test.tsx +1 -1
- package/src/core/transports/__tests__/static.test.ts +1 -1
- package/src/core/transports/__tests__/wasm.test.ts +1 -1
- package/src/core/transports/static.ts +8 -2
- package/src/core/transports/wasm.ts +2 -4
- package/src/core/wasm/__tests__/bridge.test.ts +170 -26
- package/src/core/wasm/bridge.ts +64 -19
- package/src/core/wasm/worker/types.ts +0 -1
- package/src/plugins/impl/DataEditorPlugin.tsx +32 -21
- package/src/plugins/impl/SliderPlugin.tsx +35 -3
- package/src/plugins/impl/__test__/slider-labels.test.tsx +30 -0
- package/src/plugins/impl/__tests__/DataEditorPlugin.test.ts +103 -12
- package/src/plugins/impl/__tests__/SliderPlugin.test.tsx +40 -0
- package/src/plugins/impl/data-editor/__tests__/glide-data-editor.test.tsx +159 -4
- package/src/plugins/impl/data-editor/glide-data-editor.tsx +30 -10
- package/src/plugins/impl/data-editor/glide-portal.tsx +5 -3
- package/src/plugins/layout/AccordionPlugin.tsx +2 -1
- package/src/plugins/layout/__tests__/AccordionPlugin.test.tsx +21 -0
|
@@ -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--2K0cmt9.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-BC4FLNwY.js → swimlanesDiagram-VR7AAH4N-DnWIUN_9.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--2K0cmt9.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-ByuJHeBL.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-CLVPYA-v.js → timeline-definition-24CTP7MA-Czf2QN2R.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--2K0cmt9.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, p as n, r } from "./button-qQhINE7z.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-BVbJPkcl.js";
|
|
6
|
+
import { a as s, s as c } from "./assertNever-ie77PjMn.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 {
|
|
9
|
+
import { _n as d, cn as f, dn as p, fn as m, gn as h, hn as g, ln as _, mn as v, nn as y, pn as b, sn as ee } from "./use-restore-focus-tPmARo1Q.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 x = /* @__PURE__ */ e(i(), 1), te = /* @__PURE__ */ e(l(), 1), S = u(), C = Object.defineProperty, w = (e, t) => C(e, "name", {
|
|
12
12
|
value: t,
|
|
@@ -16,10 +16,10 @@ var x = /* @__PURE__ */ e(i(), 1), te = /* @__PURE__ */ e(l(), 1), S = u(), C =
|
|
|
16
16
|
Down: "down",
|
|
17
17
|
Left: "left",
|
|
18
18
|
Right: "right"
|
|
19
|
-
},
|
|
19
|
+
}, re = {
|
|
20
20
|
Foreground: "foreground",
|
|
21
21
|
Background: "background"
|
|
22
|
-
}, [
|
|
22
|
+
}, [A, j] = g("Toast", [O]), [M, N] = A(E);
|
|
23
23
|
function P(e) {
|
|
24
24
|
typeof T == "function" ? T(e) : e();
|
|
25
25
|
}
|
|
@@ -51,15 +51,15 @@ var F = /* @__PURE__ */ w((e) => {
|
|
|
51
51
|
})
|
|
52
52
|
});
|
|
53
53
|
}, "ToastProvider"), I = "ToastViewport", L = ["F8"], R = "toast.viewportPause", z = "toast.viewportResume", B = /* @__PURE__ */ x.forwardRef(/* @__PURE__ */ w(function(e, t) {
|
|
54
|
-
let { __scopeToast: r, hotkey: i = L, label: a = "Notifications ({hotkey})", ...o } = e, s = N(I, r), c = ne(r), l = x.useRef(null), u = x.useRef(null), d = x.useRef(null),
|
|
54
|
+
let { __scopeToast: r, hotkey: i = L, label: a = "Notifications ({hotkey})", ...o } = e, s = N(I, r), c = ne(r), l = x.useRef(null), u = x.useRef(null), d = x.useRef(null), p = x.useRef(null), m = n(t, p, s.onViewportChange), g = i.join("+").replace(/Key/g, "").replace(/Digit/g, ""), _ = s.toastCount > 0;
|
|
55
55
|
x.useEffect(() => {
|
|
56
56
|
let e = /* @__PURE__ */ w((e) => {
|
|
57
|
-
i.length !== 0 && i.every((t) => e[t] || e.code === t) &&
|
|
57
|
+
i.length !== 0 && i.every((t) => e[t] || e.code === t) && p.current?.focus();
|
|
58
58
|
}, "handleKeyDown");
|
|
59
59
|
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
60
60
|
}, [i]), x.useEffect(() => {
|
|
61
|
-
let e = l.current, t =
|
|
62
|
-
if (
|
|
61
|
+
let e = l.current, t = p.current;
|
|
62
|
+
if (_ && e && t) {
|
|
63
63
|
let n = /* @__PURE__ */ w(() => {
|
|
64
64
|
if (!s.isClosePausedRef.current) {
|
|
65
65
|
let e = new CustomEvent(R);
|
|
@@ -79,8 +79,8 @@ var F = /* @__PURE__ */ w((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 = x.useCallback(({ tabbingDirection: e }) => {
|
|
84
84
|
let t = c().map((t) => {
|
|
85
85
|
let n = t.ref.current, r = [n, ..._e(n)];
|
|
86
86
|
return e === "forwards" ? r : r.reverse();
|
|
@@ -88,7 +88,7 @@ var F = /* @__PURE__ */ w((e) => {
|
|
|
88
88
|
return (e === "forwards" ? t.reverse() : t).flat();
|
|
89
89
|
}, [c]);
|
|
90
90
|
return x.useEffect(() => {
|
|
91
|
-
let e =
|
|
91
|
+
let e = p.current;
|
|
92
92
|
if (e) {
|
|
93
93
|
let t = /* @__PURE__ */ w((t) => {
|
|
94
94
|
let n = t.altKey || t.ctrlKey || t.metaKey;
|
|
@@ -98,37 +98,37 @@ var F = /* @__PURE__ */ w((e) => {
|
|
|
98
98
|
u.current?.focus();
|
|
99
99
|
return;
|
|
100
100
|
}
|
|
101
|
-
let i =
|
|
101
|
+
let i = v({ tabbingDirection: r ? "backwards" : "forwards" }), a = i.findIndex((e) => e === n);
|
|
102
102
|
Q(i.slice(a + 1)) ? t.preventDefault() : r ? u.current?.focus() : d.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, S.jsxs)(f, {
|
|
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, S.jsx)(H, {
|
|
115
115
|
ref: u,
|
|
116
116
|
onFocusFromOutsideViewport: () => {
|
|
117
|
-
Q(
|
|
117
|
+
Q(v({ tabbingDirection: "forwards" }));
|
|
118
118
|
}
|
|
119
119
|
}),
|
|
120
120
|
/* @__PURE__ */ (0, S.jsx)(D.Slot, {
|
|
121
121
|
scope: r,
|
|
122
|
-
children: /* @__PURE__ */ (0, S.jsx)(
|
|
122
|
+
children: /* @__PURE__ */ (0, S.jsx)(h.ol, {
|
|
123
123
|
tabIndex: -1,
|
|
124
124
|
...o,
|
|
125
|
-
ref:
|
|
125
|
+
ref: m
|
|
126
126
|
})
|
|
127
127
|
}),
|
|
128
|
-
|
|
128
|
+
_ && /* @__PURE__ */ (0, S.jsx)(H, {
|
|
129
129
|
ref: d,
|
|
130
130
|
onFocusFromOutsideViewport: () => {
|
|
131
|
-
Q(
|
|
131
|
+
Q(v({ tabbingDirection: "backwards" }));
|
|
132
132
|
}
|
|
133
133
|
})
|
|
134
134
|
]
|
|
@@ -146,50 +146,50 @@ var F = /* @__PURE__ */ w((e) => {
|
|
|
146
146
|
}
|
|
147
147
|
});
|
|
148
148
|
}, "ToastFocusProxy")), U = "Toast", ie = "toast.swipeStart", ae = "toast.swipeMove", oe = "toast.swipeCancel", se = "toast.swipeEnd", W = /* @__PURE__ */ x.forwardRef(/* @__PURE__ */ w(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] = m({
|
|
150
150
|
prop: r,
|
|
151
151
|
defaultProp: i ?? !0,
|
|
152
152
|
onChange: a,
|
|
153
153
|
caller: U
|
|
154
154
|
});
|
|
155
|
-
return /* @__PURE__ */ (0, S.jsx)(
|
|
155
|
+
return /* @__PURE__ */ (0, S.jsx)(p, {
|
|
156
156
|
present: n || s,
|
|
157
157
|
children: /* @__PURE__ */ (0, S.jsx)(ue, {
|
|
158
158
|
open: s,
|
|
159
159
|
...o,
|
|
160
160
|
ref: t,
|
|
161
161
|
onClose: () => c(!1),
|
|
162
|
-
onPause:
|
|
163
|
-
onResume:
|
|
164
|
-
onSwipeStart:
|
|
162
|
+
onPause: _(e.onPause),
|
|
163
|
+
onResume: _(e.onResume),
|
|
164
|
+
onSwipeStart: b(e.onSwipeStart, (e) => {
|
|
165
165
|
e.currentTarget.setAttribute("data-swipe", "start");
|
|
166
166
|
}),
|
|
167
|
-
onSwipeMove:
|
|
167
|
+
onSwipeMove: b(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: b(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: b(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
|
-
}, "Toast")), [ce, le] =
|
|
181
|
-
let { __scopeToast: r, type: i =
|
|
182
|
-
C?.contains(document.activeElement) &&
|
|
180
|
+
}, "Toast")), [ce, le] = A(U, { onClose() {} }), ue = /* @__PURE__ */ x.forwardRef(/* @__PURE__ */ w(function(e, t) {
|
|
181
|
+
let { __scopeToast: r, type: i = re.Foreground, duration: a, open: o, onClose: s, onEscapeKeyDown: c, onPause: l, onResume: u, onSwipeStart: d, onSwipeMove: f, onSwipeCancel: p, onSwipeEnd: m, ...g } = e, v = N(U, r), y = ne(r), [C, T] = x.useState(null), E = n(t, T), O = x.useRef(null), k = x.useRef(null), A = a || v.duration, j = x.useRef(0), M = x.useRef(A), P = x.useRef(0), { onToastAdd: F, onToastRemove: I } = v, L = _(() => {
|
|
182
|
+
C?.contains(document.activeElement) && v.viewport?.focus(), s();
|
|
183
183
|
}), B = x.useCallback((e) => {
|
|
184
|
-
e && e !== Infinity && (window.clearTimeout(P.current),
|
|
184
|
+
e && e !== Infinity && (window.clearTimeout(P.current), j.current = (/* @__PURE__ */ new Date()).getTime(), P.current = window.setTimeout(L, e));
|
|
185
185
|
}, [L]);
|
|
186
186
|
x.useEffect(() => {
|
|
187
|
-
let e =
|
|
187
|
+
let e = v.viewport;
|
|
188
188
|
if (e) {
|
|
189
189
|
let t = /* @__PURE__ */ w(() => {
|
|
190
190
|
B(M.current), u?.();
|
|
191
191
|
}, "handleResume"), n = /* @__PURE__ */ w(() => {
|
|
192
|
-
let e = (/* @__PURE__ */ new Date()).getTime() -
|
|
192
|
+
let e = (/* @__PURE__ */ new Date()).getTime() - j.current;
|
|
193
193
|
M.current -= e, window.clearTimeout(P.current), l?.();
|
|
194
194
|
}, "handlePause");
|
|
195
195
|
return e.addEventListener(R, n), e.addEventListener(z, t), () => {
|
|
@@ -197,88 +197,88 @@ var F = /* @__PURE__ */ w((e) => {
|
|
|
197
197
|
};
|
|
198
198
|
}
|
|
199
199
|
}, [
|
|
200
|
-
|
|
201
|
-
|
|
200
|
+
v.viewport,
|
|
201
|
+
A,
|
|
202
202
|
l,
|
|
203
203
|
u,
|
|
204
204
|
B
|
|
205
205
|
]), x.useEffect(() => {
|
|
206
|
-
M.current =
|
|
206
|
+
M.current = A, o && !v.isClosePausedRef.current && B(A);
|
|
207
207
|
}, [
|
|
208
208
|
o,
|
|
209
|
-
|
|
210
|
-
|
|
209
|
+
A,
|
|
210
|
+
v.isClosePausedRef,
|
|
211
211
|
B
|
|
212
212
|
]), x.useEffect(() => () => {
|
|
213
213
|
window.clearTimeout(P.current);
|
|
214
214
|
}, []), x.useEffect(() => (F(), () => I()), [F, I]);
|
|
215
215
|
let V = x.useMemo(() => C ? X(C) : null, [C]);
|
|
216
|
-
return
|
|
216
|
+
return v.viewport ? /* @__PURE__ */ (0, S.jsxs)(S.Fragment, { children: [V && /* @__PURE__ */ (0, S.jsx)(de, {
|
|
217
217
|
__scopeToast: r,
|
|
218
218
|
role: "status",
|
|
219
|
-
"aria-live": i ===
|
|
219
|
+
"aria-live": i === re.Foreground ? "assertive" : "polite",
|
|
220
220
|
children: V
|
|
221
221
|
}), /* @__PURE__ */ (0, S.jsx)(ce, {
|
|
222
222
|
scope: r,
|
|
223
223
|
onClose: L,
|
|
224
224
|
children: te.createPortal(/* @__PURE__ */ (0, S.jsx)(D.ItemSlot, {
|
|
225
225
|
scope: r,
|
|
226
|
-
children: /* @__PURE__ */ (0, S.jsx)(
|
|
226
|
+
children: /* @__PURE__ */ (0, S.jsx)(ee, {
|
|
227
227
|
asChild: !0,
|
|
228
|
-
onEscapeKeyDown:
|
|
229
|
-
|
|
228
|
+
onEscapeKeyDown: b(c, (e) => {
|
|
229
|
+
y().some((t) => t.ref.current?.contains(e.target)) || L();
|
|
230
230
|
}),
|
|
231
|
-
children: /* @__PURE__ */ (0, S.jsx)(
|
|
231
|
+
children: /* @__PURE__ */ (0, S.jsx)(h.li, {
|
|
232
232
|
tabIndex: 0,
|
|
233
233
|
"data-state": o ? "open" : "closed",
|
|
234
|
-
"data-swipe-direction":
|
|
235
|
-
...
|
|
234
|
+
"data-swipe-direction": v.swipeDirection,
|
|
235
|
+
...g,
|
|
236
236
|
ref: E,
|
|
237
237
|
style: {
|
|
238
238
|
userSelect: "none",
|
|
239
239
|
touchAction: "none",
|
|
240
240
|
...e.style
|
|
241
241
|
},
|
|
242
|
-
onKeyDown:
|
|
242
|
+
onKeyDown: b(e.onKeyDown, (e) => {
|
|
243
243
|
e.key === "Escape" && (c?.(e.nativeEvent), e.nativeEvent.defaultPrevented || L());
|
|
244
244
|
}),
|
|
245
|
-
onPointerDown:
|
|
245
|
+
onPointerDown: b(e.onPointerDown, (e) => {
|
|
246
246
|
e.button === 0 && (O.current = {
|
|
247
247
|
x: e.clientX,
|
|
248
248
|
y: e.clientY
|
|
249
249
|
});
|
|
250
250
|
}),
|
|
251
|
-
onPointerMove:
|
|
251
|
+
onPointerMove: b(e.onPointerMove, (e) => {
|
|
252
252
|
if (!O.current) return;
|
|
253
|
-
let t = e.clientX - O.current.x, n = e.clientY - O.current.y, r = !!k.current, i = ["left", "right"].includes(
|
|
253
|
+
let t = e.clientX - O.current.x, n = e.clientY - O.current.y, r = !!k.current, i = ["left", "right"].includes(v.swipeDirection), a = ["left", "up"].includes(v.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 ? (k.current = l, Z(ae,
|
|
260
|
+
r ? (k.current = l, Z(ae, f, u, { discrete: !1 })) : me(l, v.swipeDirection, c) ? (k.current = l, Z(ie, d, u, { discrete: !1 }), e.target.setPointerCapture(e.pointerId)) : (Math.abs(t) > c || Math.abs(n) > c) && (O.current = null);
|
|
261
261
|
}),
|
|
262
|
-
onPointerUp:
|
|
262
|
+
onPointerUp: b(e.onPointerUp, (e) => {
|
|
263
263
|
let t = k.current, n = e.target;
|
|
264
264
|
if (n.hasPointerCapture(e.pointerId) && n.releasePointerCapture(e.pointerId), k.current = null, O.current = null, t) {
|
|
265
265
|
let n = e.currentTarget, r = {
|
|
266
266
|
originalEvent: e,
|
|
267
267
|
delta: t
|
|
268
268
|
};
|
|
269
|
-
me(t,
|
|
269
|
+
me(t, v.swipeDirection, v.swipeThreshold) ? Z(se, m, r, { discrete: !0 }) : Z(oe, p, r, { discrete: !0 }), n.addEventListener("click", (e) => e.preventDefault(), { once: !0 });
|
|
270
270
|
}
|
|
271
271
|
})
|
|
272
272
|
})
|
|
273
273
|
})
|
|
274
|
-
}),
|
|
274
|
+
}), v.viewport)
|
|
275
275
|
})] }) : null;
|
|
276
276
|
}, "ToastImpl")), de = /* @__PURE__ */ w((e) => {
|
|
277
277
|
let { __scopeToast: t, children: n, ...r } = e, i = N(U, t), [a, s] = x.useState(!1), [c, l] = x.useState(!1);
|
|
278
278
|
return he(() => s(!0)), x.useEffect(() => {
|
|
279
279
|
let e = window.setTimeout(() => l(!0), 1e3);
|
|
280
280
|
return () => window.clearTimeout(e);
|
|
281
|
-
}, []), c ? null : /* @__PURE__ */ (0, S.jsx)(
|
|
281
|
+
}, []), c ? null : /* @__PURE__ */ (0, S.jsx)(y, {
|
|
282
282
|
asChild: !0,
|
|
283
283
|
container: i.announcerContainer || void 0,
|
|
284
284
|
children: /* @__PURE__ */ (0, S.jsx)(o, {
|
|
@@ -292,13 +292,13 @@ var F = /* @__PURE__ */ w((e) => {
|
|
|
292
292
|
});
|
|
293
293
|
}, "ToastAnnounce"), G = /* @__PURE__ */ x.forwardRef(/* @__PURE__ */ w(function(e, t) {
|
|
294
294
|
let { __scopeToast: n, ...r } = e;
|
|
295
|
-
return /* @__PURE__ */ (0, S.jsx)(
|
|
295
|
+
return /* @__PURE__ */ (0, S.jsx)(h.div, {
|
|
296
296
|
...r,
|
|
297
297
|
ref: t
|
|
298
298
|
});
|
|
299
299
|
}, "ToastTitle")), K = /* @__PURE__ */ x.forwardRef(/* @__PURE__ */ w(function(e, t) {
|
|
300
300
|
let { __scopeToast: n, ...r } = e;
|
|
301
|
-
return /* @__PURE__ */ (0, S.jsx)(
|
|
301
|
+
return /* @__PURE__ */ (0, S.jsx)(h.div, {
|
|
302
302
|
...r,
|
|
303
303
|
ref: t
|
|
304
304
|
});
|
|
@@ -316,16 +316,16 @@ var F = /* @__PURE__ */ w((e) => {
|
|
|
316
316
|
let { __scopeToast: n, ...r } = e, i = le(pe, n);
|
|
317
317
|
return /* @__PURE__ */ (0, S.jsx)(Y, {
|
|
318
318
|
asChild: !0,
|
|
319
|
-
children: /* @__PURE__ */ (0, S.jsx)(
|
|
319
|
+
children: /* @__PURE__ */ (0, S.jsx)(h.button, {
|
|
320
320
|
type: "button",
|
|
321
321
|
...r,
|
|
322
322
|
ref: t,
|
|
323
|
-
onClick:
|
|
323
|
+
onClick: b(e.onClick, i.onClose)
|
|
324
324
|
})
|
|
325
325
|
});
|
|
326
326
|
}, "ToastClose")), Y = /* @__PURE__ */ x.forwardRef(/* @__PURE__ */ w(function(e, t) {
|
|
327
327
|
let { __scopeToast: n, altText: r, ...i } = e;
|
|
328
|
-
return /* @__PURE__ */ (0, S.jsx)(
|
|
328
|
+
return /* @__PURE__ */ (0, S.jsx)(h.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 Z(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 ? d(i, a) : i.dispatchEvent(a);
|
|
357
357
|
}
|
|
358
358
|
w(Z, "handleAndDispatchCustomEvent");
|
|
359
359
|
var me = /* @__PURE__ */ w((e, t, n = 0) => {
|
|
@@ -361,8 +361,8 @@ var me = /* @__PURE__ */ w((e, t, n = 0) => {
|
|
|
361
361
|
return t === k.Left || t === k.Right ? a && r > n : !a && i > n;
|
|
362
362
|
}, "isDeltaInDirection");
|
|
363
363
|
function he(e = () => {}) {
|
|
364
|
-
let t =
|
|
365
|
-
|
|
364
|
+
let t = _(e);
|
|
365
|
+
v(() => {
|
|
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);
|