@oomol-lab/open-flow 0.1.0-beta.10 → 0.1.0-beta.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.
Files changed (65) hide show
  1. package/dist/browser/DesignerIcon-ckcKnxxJ.js +2267 -0
  2. package/dist/browser/createResourceDialog-2pESP2wA.js +111 -0
  3. package/dist/browser/{dist-meg_oHVR.js → dist-BZ5PTFAs.js} +335 -335
  4. package/dist/browser/dist-Bmb2mZvW.js +795 -0
  5. package/dist/browser/{dist-Cc0y2Pli.js → dist-Ce71Szg7.js} +622 -622
  6. package/dist/browser/dist-DSe6KRsr.js +1224 -0
  7. package/dist/browser/{dist-Dg_VXC8f.js → dist-DY4qlXTK.js} +134 -134
  8. package/dist/browser/{esm-yhVU_KbQ.js → esm-BPZ0P6x4.js} +59 -59
  9. package/dist/browser/flow-authoring-node.d.ts +11 -4
  10. package/dist/browser/flow-authoring.d.ts +1 -1
  11. package/dist/browser/flow-authoring.js +5032 -275
  12. package/dist/browser/flow-change-schema.d.ts +6 -0
  13. package/dist/browser/flow-change.d.ts +21 -8
  14. package/dist/browser/flow-change.js +5048 -155
  15. package/dist/browser/{flowChanges-B2ttnaj9.js → flowChanges-CHPdBmZb.js} +4433 -3786
  16. package/dist/browser/{flowRunInputEditorStore-DDidwd8h.js → flowRunInputEditorStore-NPGePkvP.js} +679 -689
  17. package/dist/browser/flowWorkspace-BLGcgnHj.js +158418 -0
  18. package/dist/browser/{getPseudoElementBounds-5LArT6Xc.js → getPseudoElementBounds-Dfqo78k7.js} +691 -687
  19. package/dist/browser/host-conformance.d.ts +7 -0
  20. package/dist/browser/host-conformance.js +33 -0
  21. package/dist/browser/{languages-DgJehE1g.js → languages-i3Xmpt6S.js} +6 -15
  22. package/dist/browser/licenses.md +82 -0
  23. package/dist/browser/{markdownContent-DUfLdnUt.js → markdownContent-BawLYUjh.js} +23 -23
  24. package/dist/browser/select-Dn3vpjGC.js +6872 -0
  25. package/dist/browser/theme.css +34 -34
  26. package/dist/browser/{typeScriptSession-_TgJ_7Oq.js → typeScriptSession-BoV-FDl3.js} +257 -257
  27. package/dist/browser/waitNotificationInputs-BFbQUOyp.js +29 -0
  28. package/dist/browser/workbench-contract.d.ts +8 -2
  29. package/dist/browser/workbench.css +1 -1
  30. package/dist/browser/workbench.js +1277 -1021
  31. package/dist/browser/workbenchSelect-DzF8oik9.js +435 -0
  32. package/dist/common/control-api-conformance.d.ts +6 -0
  33. package/dist/common/control-api-conformance.js +300 -85
  34. package/dist/common/control-api.d.ts +37 -10
  35. package/dist/common/control-api.js +5199 -437
  36. package/dist/common/control-requests.d.ts +68 -0
  37. package/dist/common/control-requests.js +4913 -0
  38. package/dist/common/engine-contract.d.ts +1 -1
  39. package/dist/common/flow-encoding.d.ts +3 -1
  40. package/dist/common/flow-encoding.js +4761 -63
  41. package/dist/common/flow-graph.d.ts +6 -0
  42. package/dist/common/flow-json.d.ts +2 -0
  43. package/dist/common/flow-modules.d.ts +20 -0
  44. package/dist/common/flow-schema.d.ts +8 -0
  45. package/dist/common/flow-semantics.d.ts +6 -5
  46. package/dist/common/flow-semantics.js +14641 -9800
  47. package/dist/common/integration-trigger.d.ts +1 -0
  48. package/dist/common/mcp-conformance.d.ts +2 -0
  49. package/dist/common/mcp.d.ts +545 -0
  50. package/dist/common/mcp.js +4964 -0
  51. package/dist/common/run-events.d.ts +2 -2
  52. package/dist/common/run-events.js +8 -15
  53. package/dist/common/runtime-contract.d.ts +9 -1
  54. package/dist/common/runtime-contract.js +137 -27
  55. package/dist/common/scheduler.d.ts +11 -33
  56. package/dist/common/scheduler.js +7241 -428
  57. package/dist/index.d.ts +5 -5
  58. package/package.json +13 -1
  59. package/dist/browser/DesignerIcon-DjgOMYI5.js +0 -2065
  60. package/dist/browser/createResourceDialog-DNBueSYZ.js +0 -505
  61. package/dist/browser/dist-BMRLCebL.js +0 -1893
  62. package/dist/browser/flowWorkspace-Dr8-Hut9.js +0 -45541
  63. package/dist/browser/icons-KIOgjHpD.js +0 -730
  64. package/dist/browser/waitNotificationInputs-BPulOxYt.js +0 -26
  65. package/dist/browser/workbenchSelect-CbXrdwxW.js +0 -1375
@@ -1,505 +0,0 @@
1
- import { a as e } from "./main-DmjVyuWr.js";
2
- import { At as t, B as n, Ct as r, F as i, In as a, Kn as o, L as s, M as c, Mt as l, On as u, P as d, Pt as f, Qn as p, R as m, Rt as h, Tt as g, Un as _, V as v, Vn as y, W as b, Z as x, Zt as S, c as C, en as w, et as T, i as E, jt as D, kn as ee, lt as O, n as te, nt as k, o as ne, p as A, sr as j, tr as M, x as N, z as P } from "./getPseudoElementBounds-5LArT6Xc.js";
3
- import { c as F, d as re, f as I, l as L, o as ie, t as ae, u as oe } from "./icons-KIOgjHpD.js";
4
- import { t as se } from "./workbenchSelect-CbXrdwxW.js";
5
- import * as R from "react";
6
- import { useEffect as ce, useRef as z, useState as le } from "react";
7
- import { Fragment as ue, jsx as B, jsxs as V } from "react/jsx-runtime";
8
- //#region ../../node_modules/.bun/lucide-react@0.468.0+f4eacebf2041cd4f/node_modules/lucide-react/dist/esm/icons/x.js
9
- var H = t("X", [["path", {
10
- d: "M18 6 6 18",
11
- key: "1bl5f8"
12
- }], ["path", {
13
- d: "m6 6 12 12",
14
- key: "d8bk6v"
15
- }]]), U = /*#__PURE__*/ R.createContext(void 0);
16
- process.env.NODE_ENV !== "production" && (U.displayName = "DialogRootContext");
17
- function W(e) {
18
- let t = R.useContext(U);
19
- if (e === !1 && t === void 0) throw Error(process.env.NODE_ENV === "production" ? M(27) : "Base UI: DialogRootContext is missing. Dialog parts must be placed within <Dialog.Root>.");
20
- return t;
21
- }
22
- //#endregion
23
- //#region ../../node_modules/.bun/@base-ui+react@1.4.1+b87d06724be9db7a/node_modules/@base-ui/react/esm/dialog/backdrop/DialogBackdrop.js
24
- var de = {
25
- ...g,
26
- ...w
27
- }, G = /*#__PURE__*/ R.forwardRef(function(e, t) {
28
- let { render: n, className: r, style: i, forceRender: a = !1, ...s } = e, { store: c } = W(), l = c.useState("open"), u = c.useState("nested"), d = c.useState("mounted"), f = {
29
- open: l,
30
- transitionStatus: c.useState("transitionStatus")
31
- };
32
- return o("div", e, {
33
- state: f,
34
- ref: [c.context.backdropRef, t],
35
- stateAttributesMapping: de,
36
- props: [{
37
- role: "presentation",
38
- hidden: !d,
39
- style: {
40
- userSelect: "none",
41
- WebkitUserSelect: "none"
42
- }
43
- }, s],
44
- enabled: a || !u
45
- });
46
- });
47
- process.env.NODE_ENV !== "production" && (G.displayName = "DialogBackdrop");
48
- //#endregion
49
- //#region ../../node_modules/.bun/@base-ui+react@1.4.1+b87d06724be9db7a/node_modules/@base-ui/react/esm/dialog/close/DialogClose.js
50
- var K = /*#__PURE__*/ R.forwardRef(function(e, t) {
51
- let { render: n, className: r, disabled: i = !1, nativeButton: a = !0, style: s, ...c } = e, { store: u } = W(), d = u.useState("open");
52
- function m(e) {
53
- d && u.setOpen(!1, l(f, e.nativeEvent));
54
- }
55
- let { getButtonProps: h, buttonRef: g } = p({
56
- disabled: i,
57
- native: a
58
- });
59
- return o("button", e, {
60
- state: { disabled: i },
61
- ref: [t, g],
62
- props: [
63
- { onClick: m },
64
- c,
65
- h
66
- ]
67
- });
68
- });
69
- process.env.NODE_ENV !== "production" && (K.displayName = "DialogClose");
70
- //#endregion
71
- //#region ../../node_modules/.bun/@base-ui+react@1.4.1+b87d06724be9db7a/node_modules/@base-ui/react/esm/dialog/popup/DialogPopupCssVars.js
72
- var fe = /*#__PURE__*/ function(e) {
73
- return e.nestedDialogs = "--nested-dialogs", e;
74
- }({}), pe = function(e) {
75
- return e[e.open = r.open] = "open", e[e.closed = r.closed] = "closed", e[e.startingStyle = r.startingStyle] = "startingStyle", e[e.endingStyle = r.endingStyle] = "endingStyle", e.nested = "data-nested", e.nestedDialogOpen = "data-nested-dialog-open", e;
76
- }({}), q = /*#__PURE__*/ R.createContext(void 0);
77
- process.env.NODE_ENV !== "production" && (q.displayName = "DialogPortalContext");
78
- function me() {
79
- let e = R.useContext(q);
80
- if (e === void 0) throw Error(process.env.NODE_ENV === "production" ? M(26) : "Base UI: <Dialog.Portal> is missing.");
81
- return e;
82
- }
83
- //#endregion
84
- //#region ../../node_modules/.bun/@base-ui+react@1.4.1+b87d06724be9db7a/node_modules/@base-ui/react/esm/dialog/popup/DialogPopup.js
85
- var he = {
86
- ...g,
87
- ...w,
88
- nestedDialogOpen(e) {
89
- return e ? { [pe.nestedDialogOpen]: "" } : null;
90
- }
91
- }, J = /*#__PURE__*/ R.forwardRef(function(e, t) {
92
- let { className: n, finalFocus: r, initialFocus: i, render: a, style: s, ...c } = e, { store: l } = W(), u = l.useState("descriptionElementId"), d = l.useState("disablePointerDismissal"), f = l.useState("floatingRootContext"), p = l.useState("popupProps"), m = l.useState("modal"), h = l.useState("mounted"), g = l.useState("nested"), _ = l.useState("nestedOpenDialogCount"), v = l.useState("open"), y = l.useState("openMethod"), b = l.useState("titleElementId"), x = l.useState("transitionStatus"), C = l.useState("role");
93
- me(), S({
94
- open: v,
95
- ref: l.context.popupRef,
96
- onComplete() {
97
- v && l.context.onOpenChangeComplete?.(!0);
98
- }
99
- });
100
- function w(e) {
101
- return e !== "touch" || l.context.popupRef.current;
102
- }
103
- let T = i === void 0 ? w : i, E = o("div", e, {
104
- state: {
105
- open: v,
106
- nested: g,
107
- transitionStatus: x,
108
- nestedDialogOpen: _ > 0
109
- },
110
- props: [
111
- p,
112
- {
113
- "aria-labelledby": b ?? void 0,
114
- "aria-describedby": u ?? void 0,
115
- role: C,
116
- tabIndex: -1,
117
- hidden: !h,
118
- onKeyDown(e) {
119
- N.has(e.key) && e.stopPropagation();
120
- },
121
- style: { [fe.nestedDialogs]: _ }
122
- },
123
- c
124
- ],
125
- ref: [
126
- t,
127
- l.context.popupRef,
128
- l.useStateSetter("popupElement")
129
- ],
130
- stateAttributesMapping: he
131
- });
132
- return /*#__PURE__*/ B(k, {
133
- context: f,
134
- openInteractionType: y,
135
- disabled: !h,
136
- closeOnFocusOut: !d,
137
- initialFocus: T,
138
- returnFocus: r,
139
- modal: m !== !1,
140
- restoreFocus: "popup",
141
- children: E
142
- });
143
- });
144
- process.env.NODE_ENV !== "production" && (J.displayName = "DialogPopup");
145
- //#endregion
146
- //#region ../../node_modules/.bun/@base-ui+react@1.4.1+b87d06724be9db7a/node_modules/@base-ui/react/esm/dialog/portal/DialogPortal.js
147
- var Y = /*#__PURE__*/ R.forwardRef(function(e, t) {
148
- let { keepMounted: n = !1, ...r } = e, { store: i } = W(), a = i.useState("mounted"), o = i.useState("modal"), s = i.useState("open");
149
- return a || n ? /*#__PURE__*/ B(q.Provider, {
150
- value: n,
151
- children: /*#__PURE__*/ V(O, {
152
- ref: t,
153
- ...r,
154
- children: [a && o === !0 && /*#__PURE__*/ B(C, {
155
- ref: i.context.internalBackdropRef,
156
- inert: A(!s)
157
- }), e.children]
158
- })
159
- }) : null;
160
- });
161
- process.env.NODE_ENV !== "production" && (Y.displayName = "DialogPortal");
162
- //#endregion
163
- //#region ../../node_modules/.bun/@base-ui+react@1.4.1+b87d06724be9db7a/node_modules/@base-ui/react/esm/dialog/root/useDialogRoot.js
164
- function ge(e) {
165
- let { store: t, parentContext: r, actionsRef: a, isDrawer: o } = e, s = t.useState("open"), f = t.useState("disablePointerDismissal"), p = t.useState("modal"), m = t.useState("popupElement"), { openMethod: g, triggerProps: _ } = te(s);
166
- n(t);
167
- let { forceUnmount: y } = v(s, t), b = R.useCallback(() => {
168
- t.setOpen(!1, l(h));
169
- }, [t]);
170
- R.useImperativeHandle(a, () => ({
171
- unmount: y,
172
- close: b
173
- }), [y, b]);
174
- let x = i({
175
- popupStore: t,
176
- onOpenChange: t.setOpen,
177
- treatPopupAsFloatingElement: !0
178
- }), [S, C] = R.useState(0), [w, E] = R.useState(0), D = S === 0, O = c(x), k = T(x, {
179
- outsidePressEvent() {
180
- return t.context.internalBackdropRef.current || t.context.backdropRef.current ? "intentional" : {
181
- mouse: p === "trap-focus" ? "sloppy" : "intentional",
182
- touch: "sloppy"
183
- };
184
- },
185
- outsidePress(e) {
186
- if (!t.context.outsidePressEnabledRef.current || "button" in e && e.button !== 0 || "touches" in e && e.touches.length !== 1) return !1;
187
- let n = ee(e);
188
- if (D && !f) {
189
- let e = n;
190
- return p && (t.context.internalBackdropRef.current || t.context.backdropRef.current) ? t.context.internalBackdropRef.current === e || t.context.backdropRef.current === e || u(e, m) && !e?.hasAttribute("data-base-ui-portal") : !0;
191
- }
192
- return !1;
193
- },
194
- escapeKey: D
195
- });
196
- ne(s && p === !0, m);
197
- let { getReferenceProps: A, getFloatingProps: j, getTriggerProps: M } = d([O, k]);
198
- t.useContextCallback("onNestedDialogOpen", (e, t) => {
199
- C(e), E(t);
200
- }), t.useContextCallback("onNestedDialogClose", () => {
201
- C(0), E(0);
202
- }), R.useEffect(() => (r?.onNestedDialogOpen && s && r.onNestedDialogOpen(S + 1, w + +!!o), r?.onNestedDialogClose && !s && r.onNestedDialogClose(), () => {
203
- r?.onNestedDialogClose && s && r.onNestedDialogClose();
204
- }), [
205
- o,
206
- s,
207
- S,
208
- w,
209
- r
210
- ]);
211
- let N = R.useMemo(() => A(_), [A, _]), P = R.useMemo(() => M(_), [M, _]), F = R.useMemo(() => j(), [j]);
212
- t.useSyncedValues({
213
- openMethod: g,
214
- activeTriggerProps: N,
215
- inactiveTriggerProps: P,
216
- popupProps: F,
217
- floatingRootContext: x,
218
- nestedOpenDialogCount: S,
219
- nestedOpenDrawerCount: w
220
- });
221
- }
222
- //#endregion
223
- //#region ../../node_modules/.bun/@base-ui+react@1.4.1+b87d06724be9db7a/node_modules/@base-ui/react/esm/dialog/store/DialogStore.js
224
- var _e = {
225
- ...m,
226
- modal: x((e) => e.modal),
227
- nested: x((e) => e.nested),
228
- nestedOpenDialogCount: x((e) => e.nestedOpenDialogCount),
229
- nestedOpenDrawerCount: x((e) => e.nestedOpenDrawerCount),
230
- disablePointerDismissal: x((e) => e.disablePointerDismissal),
231
- openMethod: x((e) => e.openMethod),
232
- descriptionElementId: x((e) => e.descriptionElementId),
233
- titleElementId: x((e) => e.titleElementId),
234
- viewportElement: x((e) => e.viewportElement),
235
- role: x((e) => e.role)
236
- }, ve = class e extends b {
237
- constructor(e) {
238
- super(ye(e), {
239
- popupRef: /*#__PURE__*/ R.createRef(),
240
- backdropRef: /*#__PURE__*/ R.createRef(),
241
- internalBackdropRef: /*#__PURE__*/ R.createRef(),
242
- outsidePressEnabledRef: { current: !0 },
243
- triggerElements: new P(),
244
- onOpenChange: void 0,
245
- onOpenChangeComplete: void 0
246
- }, _e);
247
- }
248
- setOpen = (e, t) => {
249
- if (t.preventUnmountOnClose = () => {
250
- this.set("preventUnmountingOnClose", !0);
251
- }, !e && t.trigger == null && this.state.activeTriggerId != null && (t.trigger = this.state.activeTriggerElement ?? void 0), this.context.onOpenChange?.(e, t), t.isCanceled) return;
252
- this.state.floatingRootContext.dispatchOpenChange(e, t);
253
- let n = { open: e }, r = t.trigger?.id ?? null;
254
- (r || e) && (n.activeTriggerId = r, n.activeTriggerElement = t.trigger ?? null), this.update(n);
255
- };
256
- static useStore(t, n) {
257
- let r = j(() => new e(n)).current;
258
- return t ?? r;
259
- }
260
- };
261
- function ye(e = {}) {
262
- return {
263
- ...s(),
264
- modal: !0,
265
- disablePointerDismissal: !1,
266
- popupElement: null,
267
- viewportElement: null,
268
- descriptionElementId: void 0,
269
- titleElementId: void 0,
270
- openMethod: null,
271
- nested: !1,
272
- nestedOpenDialogCount: 0,
273
- nestedOpenDrawerCount: 0,
274
- role: "dialog",
275
- ...e
276
- };
277
- }
278
- //#endregion
279
- //#region ../../node_modules/.bun/@base-ui+react@1.4.1+b87d06724be9db7a/node_modules/@base-ui/react/esm/dialog/root/DialogRoot.js
280
- var X = /*#__PURE__*/ R.createContext(!1);
281
- process.env.NODE_ENV !== "production" && (X.displayName = "IsDrawerContext");
282
- function be(e) {
283
- 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 = R.useContext(X), m = !!f, h = ve.useStore(l?.store, {
284
- open: r,
285
- openProp: n,
286
- activeTriggerId: d,
287
- triggerIdProp: u,
288
- modal: s,
289
- disablePointerDismissal: o,
290
- nested: m
291
- });
292
- E(() => {
293
- n === void 0 && h.state.open === !1 && r === !0 && h.update({
294
- open: !0,
295
- activeTriggerId: d
296
- });
297
- }), h.useControlledProp("openProp", n), h.useControlledProp("triggerIdProp", u), h.useSyncedValues({
298
- disablePointerDismissal: o,
299
- nested: m,
300
- modal: s
301
- }), h.useContextCallback("onOpenChange", i), h.useContextCallback("onOpenChangeComplete", a);
302
- let g = h.useState("payload");
303
- ge({
304
- store: h,
305
- actionsRef: c,
306
- parentContext: f?.store.context,
307
- isDrawer: p,
308
- onOpenChange: i,
309
- triggerIdProp: u
310
- });
311
- let _ = R.useMemo(() => ({ store: h }), [h]);
312
- return /*#__PURE__*/ B(X.Provider, {
313
- value: !1,
314
- children: /*#__PURE__*/ B(U.Provider, {
315
- value: _,
316
- children: typeof t == "function" ? t({ payload: g }) : t
317
- })
318
- });
319
- }
320
- //#endregion
321
- //#region ../../node_modules/.bun/@base-ui+react@1.4.1+b87d06724be9db7a/node_modules/@base-ui/react/esm/dialog/title/DialogTitle.js
322
- var Z = /*#__PURE__*/ R.forwardRef(function(e, t) {
323
- let { render: n, className: r, style: i, id: s, ...c } = e, { store: l } = W(), u = a(s);
324
- return l.useSyncedValueWithCleanup("titleElementId", u), o("h2", e, {
325
- ref: t,
326
- props: [{ id: u }, c]
327
- });
328
- });
329
- process.env.NODE_ENV !== "production" && (Z.displayName = "DialogTitle");
330
- //#endregion
331
- //#region src/ui/browser/dialog.tsx
332
- function xe(e) {
333
- return /* @__PURE__ */ B(be, {
334
- "data-slot": "dialog",
335
- ...e
336
- });
337
- }
338
- function Se(e) {
339
- return /* @__PURE__ */ B(Y, {
340
- "data-slot": "dialog-portal",
341
- ...e
342
- });
343
- }
344
- function Q(e) {
345
- return /* @__PURE__ */ B(K, {
346
- "data-slot": "dialog-close",
347
- ...e
348
- });
349
- }
350
- function Ce({ className: e, ...t }) {
351
- return /* @__PURE__ */ B(G, {
352
- "data-slot": "dialog-overlay",
353
- className: _("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),
354
- ...t
355
- });
356
- }
357
- function $({ children: e, className: t, closeLabel: n = "Close", container: r, showCloseButton: i = !0, ...a }) {
358
- return /* @__PURE__ */ V(Se, {
359
- container: r,
360
- children: [/* @__PURE__ */ B(Ce, {}), /* @__PURE__ */ V(J, {
361
- "data-slot": "dialog-content",
362
- className: _("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),
363
- ...a,
364
- children: [e, i && /* @__PURE__ */ V(K, {
365
- "data-slot": "dialog-close",
366
- render: /* @__PURE__ */ B(y, {
367
- className: "absolute top-2 right-2",
368
- size: "icon-sm",
369
- variant: "ghost"
370
- }),
371
- children: [/* @__PURE__ */ B(H, {}), /* @__PURE__ */ B("span", {
372
- className: "sr-only",
373
- children: n
374
- })]
375
- })]
376
- })]
377
- });
378
- }
379
- function we({ className: e, ...t }) {
380
- return /* @__PURE__ */ B("div", {
381
- "data-slot": "dialog-header",
382
- className: _("flex flex-col gap-2", e),
383
- ...t
384
- });
385
- }
386
- function Te({ className: e, ...t }) {
387
- return /* @__PURE__ */ B("div", {
388
- "data-slot": "dialog-footer",
389
- className: _("-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t border-border bg-muted/50 p-4 sm:flex-row sm:justify-end", e),
390
- ...t
391
- });
392
- }
393
- function Ee({ className: e, ...t }) {
394
- return /* @__PURE__ */ B(Z, {
395
- "data-slot": "dialog-title",
396
- className: _("text-base leading-none font-medium", e),
397
- ...t
398
- });
399
- }
400
- //#endregion
401
- //#region src/workbench/browser/runtime/shell/createResourceDialog.tsx
402
- function De({ disabled: t, field: n, id: r, issue: i, label: a, name: o, onNameChange: s, onOpenChange: c, onSubmit: l, pending: u, title: d }) {
403
- let f = e(), p = z(null), m = z(null), [h, g] = le(!1), _ = o.length > 0 && i != null, v = f(_ ? `resource.nameIssue.${i}` : "resource.nameHint", { max: 80 }), b = `${r}-message`, x = `${r}-option`;
404
- return ce(() => g(!0), []), /* @__PURE__ */ V(ue, { children: [/* @__PURE__ */ B("div", { ref: m }), /* @__PURE__ */ B(xe, {
405
- onOpenChange: g,
406
- onOpenChangeComplete: (e) => {
407
- e || c(!1);
408
- },
409
- open: h,
410
- children: /* @__PURE__ */ B($, {
411
- container: m.current,
412
- initialFocus: () => p.current,
413
- showCloseButton: !1,
414
- children: /* @__PURE__ */ V("form", {
415
- className: "flex flex-col gap-4",
416
- onSubmit: l,
417
- children: [
418
- /* @__PURE__ */ V(we, {
419
- className: "flex-row items-center justify-between",
420
- children: [/* @__PURE__ */ B(Ee, { children: d }), /* @__PURE__ */ B(Q, {
421
- "aria-label": f("common.cancel"),
422
- render: /* @__PURE__ */ B(y, {
423
- size: "icon-sm",
424
- variant: "ghost"
425
- }),
426
- type: "button",
427
- children: /* @__PURE__ */ B(ae, { name: "close" })
428
- })]
429
- }),
430
- /* @__PURE__ */ V(re, {
431
- className: "gap-4",
432
- children: [/* @__PURE__ */ V(F, {
433
- "data-invalid": _,
434
- children: [
435
- /* @__PURE__ */ B(I, {
436
- htmlFor: r,
437
- children: a
438
- }),
439
- /* @__PURE__ */ B(D, {
440
- autoComplete: "off",
441
- "aria-describedby": b,
442
- "aria-invalid": _,
443
- id: r,
444
- name: "resource-name",
445
- onChange: (e) => s(e.target.value),
446
- ref: p,
447
- required: !0,
448
- value: o
449
- }),
450
- B(_ ? oe : L, {
451
- id: b,
452
- children: v
453
- })
454
- ]
455
- }), n != null && /* @__PURE__ */ V(F, { children: [
456
- /* @__PURE__ */ B(I, {
457
- htmlFor: n.state == "ready" ? x : void 0,
458
- children: n.label
459
- }),
460
- n.state == "ready" ? /* @__PURE__ */ B(se, {
461
- ariaLabel: n.ariaLabel,
462
- className: "w-full",
463
- id: x,
464
- onValueChange: n.onValueChange,
465
- options: n.options,
466
- portalRoot: m.current,
467
- value: n.value
468
- }) : /* @__PURE__ */ V("div", {
469
- className: "flex min-h-9 items-center gap-2 rounded-lg border bg-muted/30 px-3 py-2 text-sm text-muted-foreground",
470
- role: n.state == "error" ? "alert" : "status",
471
- children: [
472
- n.state == "loading" && /* @__PURE__ */ B(ie, { "aria-hidden": "true" }),
473
- /* @__PURE__ */ B("span", { children: n.status }),
474
- n.state == "error" && /* @__PURE__ */ B(y, {
475
- className: "ml-auto bg-background",
476
- onClick: n.onRetry,
477
- size: "sm",
478
- type: "button",
479
- variant: "outline",
480
- children: n.retry
481
- })
482
- ]
483
- }),
484
- /* @__PURE__ */ B(L, { children: n.description })
485
- ] })]
486
- }),
487
- /* @__PURE__ */ V(Te, {
488
- className: "mx-0 mb-0 border-0 bg-transparent p-0 pt-1",
489
- children: [/* @__PURE__ */ B(Q, {
490
- render: /* @__PURE__ */ B(y, { variant: "outline" }),
491
- type: "button",
492
- children: f("common.cancel")
493
- }), /* @__PURE__ */ B(y, {
494
- disabled: t || u || i != null,
495
- type: "submit",
496
- children: f(u ? "common.creating" : "common.create")
497
- })]
498
- })
499
- ]
500
- })
501
- })
502
- })] });
503
- }
504
- //#endregion
505
- export { De as default };