@oomol-lab/open-flow 0.1.0-alpha.1 → 0.1.0-alpha.12
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/README.md +5 -1
- package/dist/browser/addNodeOptions-BYQXyUmQ.js +9571 -0
- package/dist/browser/carbon-DMCVsjHo.js +53 -0
- package/dist/browser/{project-change.js → change-7rp2OZLm.js} +16 -46
- package/dist/browser/createResourceDialog-CWD62rU0.js +467 -0
- package/dist/browser/{dist-o4dBuwiG.js → dist-3Mj8q8Pr.js} +28 -28
- package/dist/browser/{dist-CIq6ue3I.js → dist-BKuSVKCC.js} +1115 -1103
- package/dist/browser/{dist-DL0SDskM.js → dist-BMqL-qR5.js} +473 -906
- package/dist/browser/{dist-CLZJNoWB.js → dist-BN4ZCyOB.js} +10 -10
- package/dist/browser/{dist-zyY--HOV.js → dist-BpopSHwP.js} +3 -3
- package/dist/browser/dist-C46JByB-.js +252 -0
- package/dist/browser/{dist-BbyiRq3c.js → dist-CJpzJrLM.js} +294 -284
- package/dist/browser/{dist-Djd02JSy.js → dist-CPuF50D9.js} +198 -198
- package/dist/browser/{dist-CvcmLAMW.js → dist-CUSrALSX.js} +115 -115
- package/dist/browser/dist-CeSZ2xSM.js +444 -0
- package/dist/browser/{dist-7oZK9QXZ.js → dist-DMi8_lU3.js} +5 -5
- package/dist/browser/{dist-B9OV3YTx.js → dist-DUzA0Ukh.js} +22 -22
- package/dist/browser/{dist-aWSZx4q1.js → dist-DWADUsVB.js} +75 -75
- package/dist/browser/{dist-BLk5M0uK.js → dist-Mecbzdl2.js} +3 -3
- package/dist/browser/{esm-DXw7EADW.js → esm-DmVDlOEJ.js} +14 -24
- package/dist/browser/flow-authoring-edge.d.ts +3 -0
- package/dist/browser/flow-authoring-module.d.ts +4 -0
- package/dist/browser/flow-authoring-node.d.ts +86 -0
- package/dist/browser/flow-authoring.d.ts +4 -0
- package/dist/browser/flow-authoring.js +783 -0
- package/dist/browser/{project-change.d.ts → flow-change.d.ts} +29 -37
- package/dist/browser/flow-change.js +234 -0
- package/dist/browser/{project-notifications.d.ts → flow-notifications.d.ts} +6 -3
- package/dist/browser/flowRunInputEditorStore-BYxwvHZl.js +8952 -0
- package/dist/browser/flowWorkspace-Bwqmoq-c.js +47439 -0
- package/dist/browser/languages-DgJehE1g.js +62 -0
- package/dist/browser/lib-C5Ipyfps.js +7856 -0
- package/dist/browser/{lib-S4ccuMeT.js → lib-GrGxYjsJ.js} +3 -5
- package/dist/browser/licenses.md +620 -12
- package/dist/browser/main-DmjVyuWr.js +76 -0
- package/dist/browser/{markdownContent-ZZFfSRqO.js → markdownContent-0teWaxq8.js} +5188 -5144
- package/dist/browser/theme.css +63 -0
- package/dist/browser/theme.css.d.ts +1 -0
- package/dist/browser/typeScriptSession-D5neIpug.js +2560 -0
- package/dist/browser/{composite-7VwgfnXx.js → useOpenInteractionType-CRgOHg5M.js} +2209 -2750
- package/dist/browser/workbench-contract.d.ts +6 -6
- package/dist/browser/workbench.css +1 -1
- package/dist/browser/workbench.d.ts +18 -2
- package/dist/browser/workbench.js +4200 -2233
- package/dist/common/connector-action.d.ts +6 -0
- package/dist/common/connector-action.js +38 -30
- package/dist/common/control-api-conformance.js +262 -359
- package/dist/common/control-api-errors.d.ts +32 -24
- package/dist/common/control-api.d.ts +57 -73
- package/dist/common/control-api.js +199 -205
- package/dist/common/cron-trigger.d.ts +1 -1
- package/dist/common/cron-trigger.js +1 -1
- package/dist/common/flow-encoding.d.ts +11 -0
- package/dist/common/{project-encoding.js → flow-encoding.js} +14 -13
- package/dist/common/{project-notifications.d.ts → flow-notifications.d.ts} +6 -3
- package/dist/common/{project-semantics.d.ts → flow-semantics.d.ts} +11 -12
- package/dist/common/{project-semantics.js → flow-semantics.js} +959 -934
- package/dist/common/integration-trigger.d.ts +2 -1
- package/dist/common/integration-trigger.js +1 -1
- package/dist/common/licenses.md +1 -25
- package/dist/common/localization.d.ts +21 -0
- package/dist/common/localization.js +62 -0
- package/dist/common/poll-trigger.d.ts +1 -1
- package/dist/common/provider-triggers.js +1057 -948
- package/dist/common/run-lifecycle.js +1 -1
- package/dist/common/runtime-contract.d.ts +1 -1
- package/dist/common/runtime-contract.js +1 -1
- package/dist/common/scheduler.d.ts +8 -7
- package/dist/common/scheduler.js +251 -232
- package/dist/common/webhook-trigger.d.ts +1 -1
- package/dist/common/webhook-trigger.js +35 -1
- package/package.json +23 -10
- package/dist/browser/addNodeOptions-DqoIueCR.js +0 -33746
- package/dist/browser/carbon-nMY84Amv.js +0 -53
- package/dist/browser/createResourceDialog-ByuJWdSL.js +0 -439
- package/dist/browser/dist-n-z5HtaO.js +0 -4
- package/dist/browser/flowWorkspace-DwVMpcar.js +0 -22092
- package/dist/common/project-encoding.d.ts +0 -11
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
var e = 80;
|
|
3
|
-
function t(e) {
|
|
1
|
+
function e(e) {
|
|
4
2
|
let t = e.trim();
|
|
5
3
|
if (t.length == 0) return "empty";
|
|
6
4
|
if (t.length > 80) return "tooLong";
|
|
@@ -10,28 +8,23 @@ function t(e) {
|
|
|
10
8
|
}
|
|
11
9
|
if (!/^[\p{L}\p{N}](?:[\p{L}\p{N} _-]*[\p{L}\p{N}])?$/u.test(t)) return "specialCharacter";
|
|
12
10
|
}
|
|
11
|
+
function t(e) {
|
|
12
|
+
return Object.fromEntries(e.map((e) => [e.handle, e]));
|
|
13
|
+
}
|
|
13
14
|
var n = class extends Error {};
|
|
14
15
|
function r() {
|
|
15
16
|
throw new n();
|
|
16
17
|
}
|
|
17
18
|
function i(e, t) {
|
|
18
|
-
|
|
19
|
+
if (t.kind == "flow") return e.graph;
|
|
20
|
+
let n = e.subflows[t.id];
|
|
19
21
|
return n ?? r(), n.graph;
|
|
20
22
|
}
|
|
21
23
|
function a(e, t, n) {
|
|
22
|
-
if (t.kind == "flow") {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
flows: {
|
|
27
|
-
...e.flows,
|
|
28
|
-
[t.id]: {
|
|
29
|
-
...i,
|
|
30
|
-
graph: n
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
}
|
|
24
|
+
if (t.kind == "flow") return {
|
|
25
|
+
...e,
|
|
26
|
+
graph: n
|
|
27
|
+
};
|
|
35
28
|
let i = e.subflows[t.id];
|
|
36
29
|
return i ?? r(), {
|
|
37
30
|
...e,
|
|
@@ -81,29 +74,6 @@ function s(e, t) {
|
|
|
81
74
|
delete t[e.bindingId], n.bindings = t;
|
|
82
75
|
break;
|
|
83
76
|
}
|
|
84
|
-
case "flow.create":
|
|
85
|
-
n.flows[e.flowId] != null && r(), n.flows = {
|
|
86
|
-
...n.flows,
|
|
87
|
-
[e.flowId]: e.flow
|
|
88
|
-
};
|
|
89
|
-
break;
|
|
90
|
-
case "flow.delete": {
|
|
91
|
-
n.flows[e.flowId] ?? r();
|
|
92
|
-
let t = { ...n.flows };
|
|
93
|
-
delete t[e.flowId], n.flows = t;
|
|
94
|
-
break;
|
|
95
|
-
}
|
|
96
|
-
case "flow.rename": {
|
|
97
|
-
let t = n.flows[e.flowId];
|
|
98
|
-
t ?? r(), n.flows = {
|
|
99
|
-
...n.flows,
|
|
100
|
-
[e.flowId]: {
|
|
101
|
-
...t,
|
|
102
|
-
name: e.name
|
|
103
|
-
}
|
|
104
|
-
};
|
|
105
|
-
break;
|
|
106
|
-
}
|
|
107
77
|
case "graph.edge.connect": {
|
|
108
78
|
let t = i(n, e.target);
|
|
109
79
|
t.nodes[e.edge.source] ?? r();
|
|
@@ -113,7 +83,7 @@ function s(e, t) {
|
|
|
113
83
|
kind: "node",
|
|
114
84
|
nodeId: e.edge.source,
|
|
115
85
|
output: e.edge.sourceHandle
|
|
116
|
-
}, l = s?.kind == "sources" ? s.sources : [];
|
|
86
|
+
}, l = s?.kind == "sources" ? s.sources.filter((e) => e.kind != "binding" || n.bindings[e.bindingId]?.kind != "variable") : [];
|
|
117
87
|
l.some((e) => e.kind == "node" && e.nodeId == c.nodeId && e.output == c.output) && r();
|
|
118
88
|
let u = {
|
|
119
89
|
...o,
|
|
@@ -164,10 +134,10 @@ function s(e, t) {
|
|
|
164
134
|
t.nodes[e.nodeId] ?? r();
|
|
165
135
|
let s = /* @__PURE__ */ new Set([e.nodeId]), c = Object.fromEntries(Object.entries(t.nodes).flatMap(([e, t]) => s.has(e) ? [] : [[e, o(t, s)]]));
|
|
166
136
|
if (Object.assign(n, a(n, e.target, { nodes: c })), e.target.kind == "subflow") {
|
|
167
|
-
let t = n.subflows[e.target.id], r =
|
|
168
|
-
...
|
|
169
|
-
sources:
|
|
170
|
-
}
|
|
137
|
+
let t = n.subflows[e.target.id], r = t.outputs.map((e) => ({
|
|
138
|
+
...e,
|
|
139
|
+
sources: e.sources.filter((e) => e.kind != "node" || !s.has(e.nodeId))
|
|
140
|
+
}));
|
|
171
141
|
n.subflows = {
|
|
172
142
|
...n.subflows,
|
|
173
143
|
[e.target.id]: {
|
|
@@ -256,4 +226,4 @@ function s(e, t) {
|
|
|
256
226
|
};
|
|
257
227
|
}
|
|
258
228
|
//#endregion
|
|
259
|
-
export {
|
|
229
|
+
export { t as n, e as r, s as t };
|
|
@@ -0,0 +1,467 @@
|
|
|
1
|
+
import { a as e } from "./main-DmjVyuWr.js";
|
|
2
|
+
import { $n as t, B as n, C as r, Ct as i, D as a, E as o, H as s, In as c, It as l, Jn as u, Ln as d, N as f, O as p, Qn as m, Rt as h, S as g, T as _, V as v, Y as y, _t as b, a as x, dt as S, er as C, gt as w, hr as T, ht as E, i as ee, ir as D, k as te, lr as O, lt as k, mt as A, nr as j, o as M, or as N, p as P, r as F, t as I, tr as ne, vr as L, w as re, wr as ie, yt as R } from "./useOpenInteractionType-CRgOHg5M.js";
|
|
3
|
+
import * as z from "react";
|
|
4
|
+
import { useEffect as ae, useRef as B, useState as oe } from "react";
|
|
5
|
+
import { Fragment as se, jsx as V, jsxs as H } from "react/jsx-runtime";
|
|
6
|
+
//#region ../../node_modules/.bun/lucide-react@0.468.0+f4eacebf2041cd4f/node_modules/lucide-react/dist/esm/icons/x.js
|
|
7
|
+
var ce = E("X", [["path", {
|
|
8
|
+
d: "M18 6 6 18",
|
|
9
|
+
key: "1bl5f8"
|
|
10
|
+
}], ["path", {
|
|
11
|
+
d: "m6 6 12 12",
|
|
12
|
+
key: "d8bk6v"
|
|
13
|
+
}]]), U = /*#__PURE__*/ z.createContext(void 0);
|
|
14
|
+
process.env.NODE_ENV !== "production" && (U.displayName = "DialogRootContext");
|
|
15
|
+
function W(e) {
|
|
16
|
+
let t = z.useContext(U);
|
|
17
|
+
if (e === !1 && t === void 0) throw Error(process.env.NODE_ENV === "production" ? L(27) : "Base UI: DialogRootContext is missing. Dialog parts must be placed within <Dialog.Root>.");
|
|
18
|
+
return t;
|
|
19
|
+
}
|
|
20
|
+
//#endregion
|
|
21
|
+
//#region ../../node_modules/.bun/@base-ui+react@1.4.1+b87d06724be9db7a/node_modules/@base-ui/react/esm/dialog/backdrop/DialogBackdrop.js
|
|
22
|
+
var le = {
|
|
23
|
+
...S,
|
|
24
|
+
...h
|
|
25
|
+
}, G = /*#__PURE__*/ z.forwardRef(function(e, t) {
|
|
26
|
+
let { render: n, className: r, style: i, forceRender: a = !1, ...o } = e, { store: s } = W(), c = s.useState("open"), l = s.useState("nested"), u = s.useState("mounted"), d = {
|
|
27
|
+
open: c,
|
|
28
|
+
transitionStatus: s.useState("transitionStatus")
|
|
29
|
+
};
|
|
30
|
+
return O("div", e, {
|
|
31
|
+
state: d,
|
|
32
|
+
ref: [s.context.backdropRef, t],
|
|
33
|
+
stateAttributesMapping: le,
|
|
34
|
+
props: [{
|
|
35
|
+
role: "presentation",
|
|
36
|
+
hidden: !u,
|
|
37
|
+
style: {
|
|
38
|
+
userSelect: "none",
|
|
39
|
+
WebkitUserSelect: "none"
|
|
40
|
+
}
|
|
41
|
+
}, o],
|
|
42
|
+
enabled: a || !l
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
process.env.NODE_ENV !== "production" && (G.displayName = "DialogBackdrop");
|
|
46
|
+
//#endregion
|
|
47
|
+
//#region ../../node_modules/.bun/@base-ui+react@1.4.1+b87d06724be9db7a/node_modules/@base-ui/react/esm/dialog/close/DialogClose.js
|
|
48
|
+
var K = /*#__PURE__*/ z.forwardRef(function(e, t) {
|
|
49
|
+
let { render: n, className: r, disabled: i = !1, nativeButton: a = !0, style: o, ...s } = e, { store: c } = W(), l = c.useState("open");
|
|
50
|
+
function u(e) {
|
|
51
|
+
l && c.setOpen(!1, b(R, e.nativeEvent));
|
|
52
|
+
}
|
|
53
|
+
let { getButtonProps: d, buttonRef: f } = T({
|
|
54
|
+
disabled: i,
|
|
55
|
+
native: a
|
|
56
|
+
});
|
|
57
|
+
return O("button", e, {
|
|
58
|
+
state: { disabled: i },
|
|
59
|
+
ref: [t, f],
|
|
60
|
+
props: [
|
|
61
|
+
{ onClick: u },
|
|
62
|
+
s,
|
|
63
|
+
d
|
|
64
|
+
]
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
process.env.NODE_ENV !== "production" && (K.displayName = "DialogClose");
|
|
68
|
+
//#endregion
|
|
69
|
+
//#region ../../node_modules/.bun/@base-ui+react@1.4.1+b87d06724be9db7a/node_modules/@base-ui/react/esm/dialog/popup/DialogPopupCssVars.js
|
|
70
|
+
var ue = /*#__PURE__*/ function(e) {
|
|
71
|
+
return e.nestedDialogs = "--nested-dialogs", e;
|
|
72
|
+
}({}), q = function(e) {
|
|
73
|
+
return e[e.open = k.open] = "open", e[e.closed = k.closed] = "closed", e[e.startingStyle = k.startingStyle] = "startingStyle", e[e.endingStyle = k.endingStyle] = "endingStyle", e.nested = "data-nested", e.nestedDialogOpen = "data-nested-dialog-open", e;
|
|
74
|
+
}({}), J = /*#__PURE__*/ z.createContext(void 0);
|
|
75
|
+
process.env.NODE_ENV !== "production" && (J.displayName = "DialogPortalContext");
|
|
76
|
+
function de() {
|
|
77
|
+
let e = z.useContext(J);
|
|
78
|
+
if (e === void 0) throw Error(process.env.NODE_ENV === "production" ? L(26) : "Base UI: <Dialog.Portal> is missing.");
|
|
79
|
+
return e;
|
|
80
|
+
}
|
|
81
|
+
//#endregion
|
|
82
|
+
//#region ../../node_modules/.bun/@base-ui+react@1.4.1+b87d06724be9db7a/node_modules/@base-ui/react/esm/dialog/popup/DialogPopup.js
|
|
83
|
+
var fe = {
|
|
84
|
+
...S,
|
|
85
|
+
...h,
|
|
86
|
+
nestedDialogOpen(e) {
|
|
87
|
+
return e ? { [q.nestedDialogOpen]: "" } : null;
|
|
88
|
+
}
|
|
89
|
+
}, Y = /*#__PURE__*/ z.forwardRef(function(e, t) {
|
|
90
|
+
let { className: n, finalFocus: r, initialFocus: i, render: a, style: o, ...c } = e, { store: u } = W(), d = u.useState("descriptionElementId"), f = u.useState("disablePointerDismissal"), p = u.useState("floatingRootContext"), m = u.useState("popupProps"), h = u.useState("modal"), g = u.useState("mounted"), _ = u.useState("nested"), v = u.useState("nestedOpenDialogCount"), y = u.useState("open"), b = u.useState("openMethod"), x = u.useState("titleElementId"), S = u.useState("transitionStatus"), C = u.useState("role");
|
|
91
|
+
de(), l({
|
|
92
|
+
open: y,
|
|
93
|
+
ref: u.context.popupRef,
|
|
94
|
+
onComplete() {
|
|
95
|
+
y && u.context.onOpenChangeComplete?.(!0);
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
function w(e) {
|
|
99
|
+
return e !== "touch" || u.context.popupRef.current;
|
|
100
|
+
}
|
|
101
|
+
let T = i === void 0 ? w : i, E = O("div", e, {
|
|
102
|
+
state: {
|
|
103
|
+
open: y,
|
|
104
|
+
nested: _,
|
|
105
|
+
transitionStatus: S,
|
|
106
|
+
nestedDialogOpen: v > 0
|
|
107
|
+
},
|
|
108
|
+
props: [
|
|
109
|
+
m,
|
|
110
|
+
{
|
|
111
|
+
"aria-labelledby": x ?? void 0,
|
|
112
|
+
"aria-describedby": d ?? void 0,
|
|
113
|
+
role: C,
|
|
114
|
+
tabIndex: -1,
|
|
115
|
+
hidden: !g,
|
|
116
|
+
onKeyDown(e) {
|
|
117
|
+
P.has(e.key) && e.stopPropagation();
|
|
118
|
+
},
|
|
119
|
+
style: { [ue.nestedDialogs]: v }
|
|
120
|
+
},
|
|
121
|
+
c
|
|
122
|
+
],
|
|
123
|
+
ref: [
|
|
124
|
+
t,
|
|
125
|
+
u.context.popupRef,
|
|
126
|
+
u.useStateSetter("popupElement")
|
|
127
|
+
],
|
|
128
|
+
stateAttributesMapping: fe
|
|
129
|
+
});
|
|
130
|
+
return /*#__PURE__*/ V(s, {
|
|
131
|
+
context: p,
|
|
132
|
+
openInteractionType: b,
|
|
133
|
+
disabled: !g,
|
|
134
|
+
closeOnFocusOut: !f,
|
|
135
|
+
initialFocus: T,
|
|
136
|
+
returnFocus: r,
|
|
137
|
+
modal: h !== !1,
|
|
138
|
+
restoreFocus: "popup",
|
|
139
|
+
children: E
|
|
140
|
+
});
|
|
141
|
+
});
|
|
142
|
+
process.env.NODE_ENV !== "production" && (Y.displayName = "DialogPopup");
|
|
143
|
+
//#endregion
|
|
144
|
+
//#region ../../node_modules/.bun/@base-ui+react@1.4.1+b87d06724be9db7a/node_modules/@base-ui/react/esm/dialog/portal/DialogPortal.js
|
|
145
|
+
var X = /*#__PURE__*/ z.forwardRef(function(e, t) {
|
|
146
|
+
let { keepMounted: n = !1, ...r } = e, { store: i } = W(), a = i.useState("mounted"), o = i.useState("modal"), s = i.useState("open");
|
|
147
|
+
return a || n ? /*#__PURE__*/ V(J.Provider, {
|
|
148
|
+
value: n,
|
|
149
|
+
children: /*#__PURE__*/ H(y, {
|
|
150
|
+
ref: t,
|
|
151
|
+
...r,
|
|
152
|
+
children: [a && o === !0 && /*#__PURE__*/ V(x, {
|
|
153
|
+
ref: i.context.internalBackdropRef,
|
|
154
|
+
inert: M(!s)
|
|
155
|
+
}), e.children]
|
|
156
|
+
})
|
|
157
|
+
}) : null;
|
|
158
|
+
});
|
|
159
|
+
process.env.NODE_ENV !== "production" && (X.displayName = "DialogPortal");
|
|
160
|
+
//#endregion
|
|
161
|
+
//#region ../../node_modules/.bun/@base-ui+react@1.4.1+b87d06724be9db7a/node_modules/@base-ui/react/esm/dialog/root/useDialogRoot.js
|
|
162
|
+
function pe(e) {
|
|
163
|
+
let { store: t, parentContext: n, actionsRef: a, isDrawer: o } = e, s = t.useState("open"), l = t.useState("disablePointerDismissal"), u = t.useState("modal"), f = t.useState("popupElement"), { openMethod: m, triggerProps: h } = I(s);
|
|
164
|
+
p(t);
|
|
165
|
+
let { forceUnmount: _ } = te(s, t), y = z.useCallback(() => {
|
|
166
|
+
t.setOpen(!1, b(i));
|
|
167
|
+
}, [t]);
|
|
168
|
+
z.useImperativeHandle(a, () => ({
|
|
169
|
+
unmount: _,
|
|
170
|
+
close: y
|
|
171
|
+
}), [_, y]);
|
|
172
|
+
let x = re({
|
|
173
|
+
popupStore: t,
|
|
174
|
+
onOpenChange: t.setOpen,
|
|
175
|
+
treatPopupAsFloatingElement: !0
|
|
176
|
+
}), [S, C] = z.useState(0), [w, T] = z.useState(0), E = S === 0, D = g(x), O = v(x, {
|
|
177
|
+
outsidePressEvent() {
|
|
178
|
+
return t.context.internalBackdropRef.current || t.context.backdropRef.current ? "intentional" : {
|
|
179
|
+
mouse: u === "trap-focus" ? "sloppy" : "intentional",
|
|
180
|
+
touch: "sloppy"
|
|
181
|
+
};
|
|
182
|
+
},
|
|
183
|
+
outsidePress(e) {
|
|
184
|
+
if (!t.context.outsidePressEnabledRef.current || "button" in e && e.button !== 0 || "touches" in e && e.touches.length !== 1) return !1;
|
|
185
|
+
let n = d(e);
|
|
186
|
+
if (E && !l) {
|
|
187
|
+
let e = n;
|
|
188
|
+
return u && (t.context.internalBackdropRef.current || t.context.backdropRef.current) ? t.context.internalBackdropRef.current === e || t.context.backdropRef.current === e || c(e, f) && !e?.hasAttribute("data-base-ui-portal") : !0;
|
|
189
|
+
}
|
|
190
|
+
return !1;
|
|
191
|
+
},
|
|
192
|
+
escapeKey: E
|
|
193
|
+
});
|
|
194
|
+
ee(s && u === !0, f);
|
|
195
|
+
let { getReferenceProps: k, getFloatingProps: A, getTriggerProps: j } = r([D, O]);
|
|
196
|
+
t.useContextCallback("onNestedDialogOpen", (e, t) => {
|
|
197
|
+
C(e), T(t);
|
|
198
|
+
}), t.useContextCallback("onNestedDialogClose", () => {
|
|
199
|
+
C(0), T(0);
|
|
200
|
+
}), z.useEffect(() => (n?.onNestedDialogOpen && s && n.onNestedDialogOpen(S + 1, w + +!!o), n?.onNestedDialogClose && !s && n.onNestedDialogClose(), () => {
|
|
201
|
+
n?.onNestedDialogClose && s && n.onNestedDialogClose();
|
|
202
|
+
}), [
|
|
203
|
+
o,
|
|
204
|
+
s,
|
|
205
|
+
S,
|
|
206
|
+
w,
|
|
207
|
+
n
|
|
208
|
+
]);
|
|
209
|
+
let M = z.useMemo(() => k(h), [k, h]), N = z.useMemo(() => j(h), [j, h]), P = z.useMemo(() => A(), [A]);
|
|
210
|
+
t.useSyncedValues({
|
|
211
|
+
openMethod: m,
|
|
212
|
+
activeTriggerProps: M,
|
|
213
|
+
inactiveTriggerProps: N,
|
|
214
|
+
popupProps: P,
|
|
215
|
+
floatingRootContext: x,
|
|
216
|
+
nestedOpenDialogCount: S,
|
|
217
|
+
nestedOpenDrawerCount: w
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
//#endregion
|
|
221
|
+
//#region ../../node_modules/.bun/@base-ui+react@1.4.1+b87d06724be9db7a/node_modules/@base-ui/react/esm/dialog/store/DialogStore.js
|
|
222
|
+
var me = {
|
|
223
|
+
...o,
|
|
224
|
+
modal: n((e) => e.modal),
|
|
225
|
+
nested: n((e) => e.nested),
|
|
226
|
+
nestedOpenDialogCount: n((e) => e.nestedOpenDialogCount),
|
|
227
|
+
nestedOpenDrawerCount: n((e) => e.nestedOpenDrawerCount),
|
|
228
|
+
disablePointerDismissal: n((e) => e.disablePointerDismissal),
|
|
229
|
+
openMethod: n((e) => e.openMethod),
|
|
230
|
+
descriptionElementId: n((e) => e.descriptionElementId),
|
|
231
|
+
titleElementId: n((e) => e.titleElementId),
|
|
232
|
+
viewportElement: n((e) => e.viewportElement),
|
|
233
|
+
role: n((e) => e.role)
|
|
234
|
+
}, he = class e extends f {
|
|
235
|
+
constructor(e) {
|
|
236
|
+
super(ge(e), {
|
|
237
|
+
popupRef: /*#__PURE__*/ z.createRef(),
|
|
238
|
+
backdropRef: /*#__PURE__*/ z.createRef(),
|
|
239
|
+
internalBackdropRef: /*#__PURE__*/ z.createRef(),
|
|
240
|
+
outsidePressEnabledRef: { current: !0 },
|
|
241
|
+
triggerElements: new a(),
|
|
242
|
+
onOpenChange: void 0,
|
|
243
|
+
onOpenChangeComplete: void 0
|
|
244
|
+
}, me);
|
|
245
|
+
}
|
|
246
|
+
setOpen = (e, t) => {
|
|
247
|
+
if (t.preventUnmountOnClose = () => {
|
|
248
|
+
this.set("preventUnmountingOnClose", !0);
|
|
249
|
+
}, !e && t.trigger == null && this.state.activeTriggerId != null && (t.trigger = this.state.activeTriggerElement ?? void 0), this.context.onOpenChange?.(e, t), t.isCanceled) return;
|
|
250
|
+
this.state.floatingRootContext.dispatchOpenChange(e, t);
|
|
251
|
+
let n = { open: e }, r = t.trigger?.id ?? null;
|
|
252
|
+
(r || e) && (n.activeTriggerId = r, n.activeTriggerElement = t.trigger ?? null), this.update(n);
|
|
253
|
+
};
|
|
254
|
+
static useStore(t, n) {
|
|
255
|
+
let r = ie(() => new e(n)).current;
|
|
256
|
+
return t ?? r;
|
|
257
|
+
}
|
|
258
|
+
};
|
|
259
|
+
function ge(e = {}) {
|
|
260
|
+
return {
|
|
261
|
+
..._(),
|
|
262
|
+
modal: !0,
|
|
263
|
+
disablePointerDismissal: !1,
|
|
264
|
+
popupElement: null,
|
|
265
|
+
viewportElement: null,
|
|
266
|
+
descriptionElementId: void 0,
|
|
267
|
+
titleElementId: void 0,
|
|
268
|
+
openMethod: null,
|
|
269
|
+
nested: !1,
|
|
270
|
+
nestedOpenDialogCount: 0,
|
|
271
|
+
nestedOpenDrawerCount: 0,
|
|
272
|
+
role: "dialog",
|
|
273
|
+
...e
|
|
274
|
+
};
|
|
275
|
+
}
|
|
276
|
+
//#endregion
|
|
277
|
+
//#region ../../node_modules/.bun/@base-ui+react@1.4.1+b87d06724be9db7a/node_modules/@base-ui/react/esm/dialog/root/DialogRoot.js
|
|
278
|
+
var Z = /*#__PURE__*/ z.createContext(!1);
|
|
279
|
+
process.env.NODE_ENV !== "production" && (Z.displayName = "IsDrawerContext");
|
|
280
|
+
function _e(e) {
|
|
281
|
+
let { children: t, open: n, defaultOpen: r = !1, onOpenChange: i, onOpenChangeComplete: a, disablePointerDismissal: o = !1, modal: s = !0, actionsRef: c, handle: l, triggerId: u, defaultTriggerId: d = null } = e, f = W(!0), p = z.useContext(Z), m = !!f, h = he.useStore(l?.store, {
|
|
282
|
+
open: r,
|
|
283
|
+
openProp: n,
|
|
284
|
+
activeTriggerId: d,
|
|
285
|
+
triggerIdProp: u,
|
|
286
|
+
modal: s,
|
|
287
|
+
disablePointerDismissal: o,
|
|
288
|
+
nested: m
|
|
289
|
+
});
|
|
290
|
+
F(() => {
|
|
291
|
+
n === void 0 && h.state.open === !1 && r === !0 && h.update({
|
|
292
|
+
open: !0,
|
|
293
|
+
activeTriggerId: d
|
|
294
|
+
});
|
|
295
|
+
}), h.useControlledProp("openProp", n), h.useControlledProp("triggerIdProp", u), h.useSyncedValues({
|
|
296
|
+
disablePointerDismissal: o,
|
|
297
|
+
nested: m,
|
|
298
|
+
modal: s
|
|
299
|
+
}), h.useContextCallback("onOpenChange", i), h.useContextCallback("onOpenChangeComplete", a);
|
|
300
|
+
let g = h.useState("payload");
|
|
301
|
+
pe({
|
|
302
|
+
store: h,
|
|
303
|
+
actionsRef: c,
|
|
304
|
+
parentContext: f?.store.context,
|
|
305
|
+
isDrawer: p,
|
|
306
|
+
onOpenChange: i,
|
|
307
|
+
triggerIdProp: u
|
|
308
|
+
});
|
|
309
|
+
let _ = z.useMemo(() => ({ store: h }), [h]);
|
|
310
|
+
return /*#__PURE__*/ V(Z.Provider, {
|
|
311
|
+
value: !1,
|
|
312
|
+
children: /*#__PURE__*/ V(U.Provider, {
|
|
313
|
+
value: _,
|
|
314
|
+
children: typeof t == "function" ? t({ payload: g }) : t
|
|
315
|
+
})
|
|
316
|
+
});
|
|
317
|
+
}
|
|
318
|
+
//#endregion
|
|
319
|
+
//#region ../../node_modules/.bun/@base-ui+react@1.4.1+b87d06724be9db7a/node_modules/@base-ui/react/esm/dialog/title/DialogTitle.js
|
|
320
|
+
var Q = /*#__PURE__*/ z.forwardRef(function(e, t) {
|
|
321
|
+
let { render: n, className: r, style: i, id: a, ...o } = e, { store: s } = W(), c = u(a);
|
|
322
|
+
return s.useSyncedValueWithCleanup("titleElementId", c), O("h2", e, {
|
|
323
|
+
ref: t,
|
|
324
|
+
props: [{ id: c }, o]
|
|
325
|
+
});
|
|
326
|
+
});
|
|
327
|
+
process.env.NODE_ENV !== "production" && (Q.displayName = "DialogTitle");
|
|
328
|
+
//#endregion
|
|
329
|
+
//#region src/ui/browser/dialog.tsx
|
|
330
|
+
function ve(e) {
|
|
331
|
+
return /* @__PURE__ */ V(_e, {
|
|
332
|
+
"data-slot": "dialog",
|
|
333
|
+
...e
|
|
334
|
+
});
|
|
335
|
+
}
|
|
336
|
+
function ye(e) {
|
|
337
|
+
return /* @__PURE__ */ V(X, {
|
|
338
|
+
"data-slot": "dialog-portal",
|
|
339
|
+
...e
|
|
340
|
+
});
|
|
341
|
+
}
|
|
342
|
+
function $(e) {
|
|
343
|
+
return /* @__PURE__ */ V(K, {
|
|
344
|
+
"data-slot": "dialog-close",
|
|
345
|
+
...e
|
|
346
|
+
});
|
|
347
|
+
}
|
|
348
|
+
function be({ className: e, ...t }) {
|
|
349
|
+
return /* @__PURE__ */ V(G, {
|
|
350
|
+
"data-slot": "dialog-overlay",
|
|
351
|
+
className: N("fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0 motion-reduce:animate-none motion-reduce:transition-none", e),
|
|
352
|
+
...t
|
|
353
|
+
});
|
|
354
|
+
}
|
|
355
|
+
function xe({ children: e, className: t, closeLabel: n = "Close", container: r, showCloseButton: i = !0, ...a }) {
|
|
356
|
+
return /* @__PURE__ */ H(ye, {
|
|
357
|
+
container: r,
|
|
358
|
+
children: [/* @__PURE__ */ V(be, {}), /* @__PURE__ */ H(Y, {
|
|
359
|
+
"data-slot": "dialog-content",
|
|
360
|
+
className: N("fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-sm text-popover-foreground shadow-lg ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 motion-reduce:animate-none motion-reduce:transition-none", t),
|
|
361
|
+
...a,
|
|
362
|
+
children: [e, i && /* @__PURE__ */ H(K, {
|
|
363
|
+
"data-slot": "dialog-close",
|
|
364
|
+
render: /* @__PURE__ */ V(D, {
|
|
365
|
+
className: "absolute top-2 right-2",
|
|
366
|
+
size: "icon-sm",
|
|
367
|
+
variant: "ghost"
|
|
368
|
+
}),
|
|
369
|
+
children: [/* @__PURE__ */ V(ce, {}), /* @__PURE__ */ V("span", {
|
|
370
|
+
className: "sr-only",
|
|
371
|
+
children: n
|
|
372
|
+
})]
|
|
373
|
+
})]
|
|
374
|
+
})]
|
|
375
|
+
});
|
|
376
|
+
}
|
|
377
|
+
function Se({ className: e, ...t }) {
|
|
378
|
+
return /* @__PURE__ */ V("div", {
|
|
379
|
+
"data-slot": "dialog-header",
|
|
380
|
+
className: N("flex flex-col gap-2", e),
|
|
381
|
+
...t
|
|
382
|
+
});
|
|
383
|
+
}
|
|
384
|
+
function Ce({ className: e, ...t }) {
|
|
385
|
+
return /* @__PURE__ */ V("div", {
|
|
386
|
+
"data-slot": "dialog-footer",
|
|
387
|
+
className: N("-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 sm:flex-row sm:justify-end", e),
|
|
388
|
+
...t
|
|
389
|
+
});
|
|
390
|
+
}
|
|
391
|
+
function we({ className: e, ...t }) {
|
|
392
|
+
return /* @__PURE__ */ V(Q, {
|
|
393
|
+
"data-slot": "dialog-title",
|
|
394
|
+
className: N("text-base leading-none font-medium", e),
|
|
395
|
+
...t
|
|
396
|
+
});
|
|
397
|
+
}
|
|
398
|
+
//#endregion
|
|
399
|
+
//#region src/workbench/browser/runtime/shell/createResourceDialog.tsx
|
|
400
|
+
function Te({ id: n, issue: r, label: i, name: a, onNameChange: o, onOpenChange: s, onSubmit: c, pending: l, title: u }) {
|
|
401
|
+
let d = e(), f = B(null), p = B(null), [h, g] = oe(!1), _ = a.length > 0 && r != null, v = d(_ ? `resource.nameIssue.${r}` : "resource.nameHint", { max: 80 }), y = `${n}-message`;
|
|
402
|
+
return ae(() => g(!0), []), /* @__PURE__ */ H(se, { children: [/* @__PURE__ */ V("div", { ref: p }), /* @__PURE__ */ V(ve, {
|
|
403
|
+
onOpenChange: g,
|
|
404
|
+
onOpenChangeComplete: (e) => {
|
|
405
|
+
e || s(!1);
|
|
406
|
+
},
|
|
407
|
+
open: h,
|
|
408
|
+
children: /* @__PURE__ */ V(xe, {
|
|
409
|
+
container: p.current,
|
|
410
|
+
initialFocus: () => f.current,
|
|
411
|
+
showCloseButton: !1,
|
|
412
|
+
children: /* @__PURE__ */ H("form", {
|
|
413
|
+
className: "flex flex-col gap-4",
|
|
414
|
+
onSubmit: c,
|
|
415
|
+
children: [
|
|
416
|
+
/* @__PURE__ */ H(Se, {
|
|
417
|
+
className: "flex-row items-center justify-between",
|
|
418
|
+
children: [/* @__PURE__ */ V(we, { children: u }), /* @__PURE__ */ V($, {
|
|
419
|
+
"aria-label": d("common.cancel"),
|
|
420
|
+
render: /* @__PURE__ */ V(D, {
|
|
421
|
+
size: "icon-sm",
|
|
422
|
+
variant: "ghost"
|
|
423
|
+
}),
|
|
424
|
+
type: "button",
|
|
425
|
+
children: /* @__PURE__ */ V(A, { name: "close" })
|
|
426
|
+
})]
|
|
427
|
+
}),
|
|
428
|
+
/* @__PURE__ */ V(ne, { children: /* @__PURE__ */ H(m, {
|
|
429
|
+
"data-invalid": _,
|
|
430
|
+
children: [
|
|
431
|
+
/* @__PURE__ */ V(j, {
|
|
432
|
+
htmlFor: n,
|
|
433
|
+
children: i
|
|
434
|
+
}),
|
|
435
|
+
/* @__PURE__ */ V(w, {
|
|
436
|
+
autoComplete: "off",
|
|
437
|
+
"aria-describedby": y,
|
|
438
|
+
"aria-invalid": _,
|
|
439
|
+
id: n,
|
|
440
|
+
name: "resource-name",
|
|
441
|
+
onChange: (e) => o(e.target.value),
|
|
442
|
+
ref: f,
|
|
443
|
+
required: !0,
|
|
444
|
+
value: a
|
|
445
|
+
}),
|
|
446
|
+
V(_ ? C : t, {
|
|
447
|
+
id: y,
|
|
448
|
+
children: v
|
|
449
|
+
})
|
|
450
|
+
]
|
|
451
|
+
}) }),
|
|
452
|
+
/* @__PURE__ */ H(Ce, { children: [/* @__PURE__ */ V($, {
|
|
453
|
+
render: /* @__PURE__ */ V(D, { variant: "outline" }),
|
|
454
|
+
type: "button",
|
|
455
|
+
children: d("common.cancel")
|
|
456
|
+
}), /* @__PURE__ */ V(D, {
|
|
457
|
+
disabled: l || r != null,
|
|
458
|
+
type: "submit",
|
|
459
|
+
children: d(l ? "common.creating" : "common.create")
|
|
460
|
+
})] })
|
|
461
|
+
]
|
|
462
|
+
})
|
|
463
|
+
})
|
|
464
|
+
})] });
|
|
465
|
+
}
|
|
466
|
+
//#endregion
|
|
467
|
+
export { Te as default };
|