@oomol-lab/open-flow 0.1.0-beta.82 → 0.1.0-beta.83

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.
@@ -1,14 +1,14 @@
1
1
  import { o as __toESM, r as __exportAll, t as __commonJSMin } from "./rolldown-runtime-CEgmsyvS.js";
2
- import { A as DropdownMenuLabel, D as DropdownMenuContent, E as DropdownMenuCheckboxItem, F as DropdownMenuSubContent, I as DropdownMenuSubTrigger, L as DropdownMenuTrigger, M as DropdownMenuRadioItem, N as DropdownMenuSeparator, O as DropdownMenuGroup, P as DropdownMenuSub, Q as waitBranchDescription, S as IconifyProvider, T as DropdownMenu, _ as ContentIcon, c as PopoverDescription, d as PopoverTitle, f as PopoverTrigger, g as Z$1, h as VirtualScrollArea, j as DropdownMenuRadioGroup, k as DropdownMenuItem, l as PopoverHeader, lt as Checkbox, m as ScrollArea, o as Popover, p as NativeScrollArea, r as Textarea, s as PopoverContent, u as PopoverPanelContent, ut as useAriaLabelledBy } from "./wrapLayout-DZvW9dBs.js";
2
+ import { $ as waitBranchDescription, A as DropdownMenuItem, B as CompositeItem, C as IconifyProvider, D as DropdownMenuCheckboxItem, E as DropdownMenu, F as DropdownMenuSub, I as DropdownMenuSubContent, L as DropdownMenuSubTrigger, M as DropdownMenuRadioGroup, N as DropdownMenuRadioItem, O as DropdownMenuContent, P as DropdownMenuSeparator, R as DropdownMenuTrigger, _ as Z$1, a as CompositeRoot, c as PopoverContent, d as PopoverPanelContent, dt as useAriaLabelledBy, f as PopoverTitle, g as VirtualScrollArea, h as ScrollArea, i as Textarea, j as DropdownMenuLabel, k as DropdownMenuGroup, l as PopoverDescription, m as NativeScrollArea, p as PopoverTrigger, s as Popover, u as PopoverHeader, ut as Checkbox, v as ContentIcon } from "./wrapLayout-C4moMKgb.js";
3
3
  import { i as compute, l as val } from "./dist-bO8nvHFH.js";
4
4
  import { c as useLang, l as useTranslate, o as I18nProvider, r as isPlainObject, s as useI18n, u as useVal } from "./dist-BFmpkX4P.js";
5
- import { A as string, Bn as transitionStatusMapping, Cr as cn, Er as useRenderElement, Fr as formatErrorMessage, In as useTransitionStatus, Ir as mergeProps, Ln as useOpenChangeComplete, Lr as useIsoLayoutEffect, Mr as useButton, Nn as useLabelableId, Or as EMPTY_OBJECT, Qt as useStore, Sr as buttonVariants, Un as useValueChanged, Wn as createChangeEventDetails, _r as fieldValidityMapping, a as createTooltipHandle, br as useControlled, c as TooltipPositioner, d as TooltipRoot, dr as useFormContext, fr as useRegisterFieldControl, i as TooltipTrigger, jr as useMergedRefs, l as TooltipPortal, mr as useBaseUiId, mt as triggerOpenStateMapping, n as TooltipContent, nn as require_builtin_esm_external_require_react, o as TooltipArrow, p as timeZoneOffsetMinutes, pr as useFieldRootContext, qn as clearPress, r as TooltipProvider, rr as none, s as TooltipPopup, t as Tooltip, u as TooltipTrigger$1, ur as useLabelableContext, vr as visuallyHidden, wr as cva, xr as Button$1, yr as visuallyHiddenInput, zr as useStableCallback } from "./tooltip-BDcVTNpu.js";
6
- import { $ as waitAutoContinueSchema, A as comparisonIssue, At as variableInputCompatible, Bt as SelectChevron, Ct as limitDecisionQuestions, D as nodeSystemOutputPorts, Dt as matchesSchema, E as nodeErrorSchema, F as operatorsForType, Gt as SelectTrigger, Ht as SelectGroup, It as skipDuplicatesConfigSchema, J as webhookResponseAllowsBody, K as webhookHeaderValuePort, Kt as SelectValue, L as unaryOperator, O as supportsNodeErrorHandling, Ot as portsAssignable, P as operandHandle, Q as workflowOutputsPort, R as valueType, Rt as dequal, St as defaultDecisionQuestion, T as workflowToolNameIssue, Tt as webhookSupportsBody, U as decodeRevisionContent, Ut as SelectItem, Vt as SelectContent, Wt as SelectSeparator, X as webhookResponseTimeout, Y as webhookResponseInputs, Z as webhookStatusCodePort, _t as isHttpHost, a as DialogFooter, an as ChevronDown, at as httpHeaderSchema, b as nodeNameIssue, bt as decisionQuestionIssues, c as DialogTrigger, d as Field, et as defaultNodeRetry, f as FieldDescription, h as FieldLabel, i as DialogDescription, in as Input, kt as schemaObject, l as Icon, lt as httpRequestIssues, m as FieldGroup, nt as retryConfigurationSchema, o as DialogHeader, ot as httpQuerySchema, p as FieldError, pt as httpHeaderNameIssue, q as webhookHeadersPort, r as DialogContent, rn as Label, rt as supportsNodeRetry, s as DialogTitle, t as Dialog, tt as nodeRetryLimits, u as Spinner, ut as httpRequestTask, vt as decisionLimits, wt as webhookMethods, xt as decisionTask, zt as Select$1 } from "./dialog-CFlvkliO.js";
7
- import { C as isMac, S as toManifestNodeId, _ as E$1, a as CanvasNodeIcon, b as toViewEdge, c as collapseAllNested, d as IconStack, f as selectableTimeZones, g as cronDescription, h as timeZoneOffset, i as pasteVideoLink, l as formatDuration, m as timeZoneLongLabel, n as setAddItemId, o as defaultTriggerIcon, p as timeZoneLabel, s as JSONViewer, t as FlowCanvas, u as useDebouncedValue, v as CanvasTooltip, w as isSameViewport, x as toManifestHandleName, y as CanvasStore } from "./FlowCanvas-Dew2fmoT.js";
8
- import { $ as resourceValue, $t as WorkflowExportDialog, A as schemaForEditor, An as TabsTrigger, Ar as serverAddress, B as datePickerValue, Bn as EmptyMedia, Br as ApiError, Cn as selectors, Cr as inputValue, D as defaultValueEditorSchema, Dn as Tabs, Dr as openApiTask, Dt as diagnosticMessage, E as supportsFeishuChatFilter, En as IconPickerButton, Er as openApiFieldIssues, F as calendarChange, Fn as InputGroupInput, Fr as workflowCandidateGroup, G as indexAddNodeOptions, Gn as SourceSelect, H as isDateFormat, Hn as Badge, Hr as eventSourceKind, I as calendarDate, In as Empty, Ir as workflowCapability, Jn as EventSourceSetup, Kn as createI18n, L as dateFromTimeZone, Ln as EmptyContent, Lr as workflowSelectionTask, M as getDefaultValue, Mn as followWorkbenchLink, Mr as sameWorkflowInterface, N as isUnconstrainedSchema, Nn as InputGroup, Nr as workflowAgentTool, O as editorComponent, On as TabsContent, Or as securityOptions, Ot as diagnosticNodeId, P as typeOfSchema, Pn as InputGroupAddon, Q as resourceData, R as dateInTimeZone, Rn as EmptyDescription, Sn as ComboboxRoot, Sr as triggerConfigValues, St as revisionView, T as feishuResourceKind, Tn as useComboboxRootContext, Tr as object$1, V as dateTimeWall, Vn as EmptyTitle, Vr as controlErrorCode, Wn as SourceForm, Y as connectorActionPresentation, Yn as errorNotice, Z as observeResource, Zt as dequal$1, _n as ComboboxList, _t as actionSummary, ar as webhookResponseDiagnostics, bn as ComboboxInputGroup, bt as canCancelRun, cn as selectionMenuItemClass, dn as valueEditor_module_default, dr as isJsonObject, dt as loadJson, en as WorkflowExportMenuItem, er as decodeResultList, fn as ComboboxItemIndicator, ft as designerGraph, gn as ComboboxPortal, gt as triggerNodeIcon, hn as ComboboxPositioner, ht as semanticNodeIcon, ir as resolutionOutputPorts, it as decodeAppCatalogResponse, j as valueForEditor, jr as servers, jt as connectionCatalog, k as editorGroups, kn as TabsList, kr as selectOperation, kt as schemaMismatchMessage, ln as ValueControl, mn as ComboboxPopup, mt as nodeTitle, n as agentTool, nn as IdTooltip, nr as executionReachableNodes, or as sourceOutputLabel, ot as getAppCatalogCache, pn as ComboboxItem, pt as nodeIcon, q as mapSource, qn as FeishuEventPicker, rn as FlowSettingsButton, rr as inputSourceCandidates, sn as selectionMenuContentClass, sr as sourcePort, tn as useWorkflowExportAction, tt as provider, un as ValueEditorFeedback, ur as triggerOutputDefinitions, vn as GroupCollectionProvider, vt as providerIcon, wn as useComboboxInputValueContext, wr as listOperations, xn as ComboboxInput, xr as triggerConfigValue, xt as hasRunFilter, yn as ComboboxTrigger, z as datePickerChange, zn as EmptyHeader } from "./flowChanges-URBEd4DI.js";
5
+ import { $ as useToolbarRootContext, A as string, Bn as transitionStatusMapping, Br as useStableCallback, Cr as cn, Er as useRenderElement, Fr as formatErrorMessage, In as useTransitionStatus, Ir as mergeProps, Ln as useOpenChangeComplete, Lr as useIsoLayoutEffect, Mr as useButton, Nn as useLabelableId, Or as EMPTY_OBJECT, Qt as useStore, Sr as buttonVariants, Un as useValueChanged, Wn as createChangeEventDetails, _r as fieldValidityMapping, a as createTooltipHandle, br as useControlled, c as TooltipPositioner, d as TooltipRoot, dr as useFormContext, fr as useRegisterFieldControl, i as TooltipTrigger, jr as useMergedRefs, l as TooltipPortal, mr as useBaseUiId, mt as triggerOpenStateMapping, n as TooltipContent, nn as require_builtin_esm_external_require_react, o as TooltipArrow, p as timeZoneOffsetMinutes, pr as useFieldRootContext, qn as clearPress, r as TooltipProvider, rr as none, s as TooltipPopup, t as Tooltip, u as TooltipTrigger$1, ur as useLabelableContext, vr as visuallyHidden, wr as cva, xr as Button$1, yr as visuallyHiddenInput, zr as error$1 } from "./tooltip-DGj5pudg.js";
6
+ import { $ as waitAutoContinueSchema, A as comparisonIssue, At as variableInputCompatible, Bt as SelectChevron, Ct as limitDecisionQuestions, D as nodeSystemOutputPorts, Dt as matchesSchema, E as nodeErrorSchema, F as operatorsForType, Gt as SelectTrigger, Ht as SelectGroup, It as skipDuplicatesConfigSchema, J as webhookResponseAllowsBody, K as webhookHeaderValuePort, Kt as SelectValue, L as unaryOperator, O as supportsNodeErrorHandling, Ot as portsAssignable, P as operandHandle, Q as workflowOutputsPort, R as valueType, Rt as dequal, St as defaultDecisionQuestion, T as workflowToolNameIssue, Tt as webhookSupportsBody, U as decodeRevisionContent, Ut as SelectItem, Vt as SelectContent, Wt as SelectSeparator, X as webhookResponseTimeout, Y as webhookResponseInputs, Z as webhookStatusCodePort, _t as isHttpHost, a as DialogFooter, an as ChevronDown, at as httpHeaderSchema, b as nodeNameIssue, bt as decisionQuestionIssues, c as DialogTrigger, d as Field, et as defaultNodeRetry, f as FieldDescription, h as FieldLabel, i as DialogDescription, in as Input, kt as schemaObject, l as Icon, lt as httpRequestIssues, m as FieldGroup, n as DialogClose, nt as retryConfigurationSchema, o as DialogHeader, ot as httpQuerySchema, p as FieldError, pt as httpHeaderNameIssue, q as webhookHeadersPort, r as DialogContent, rn as Label, rt as supportsNodeRetry, s as DialogTitle, t as Dialog, tt as nodeRetryLimits, u as Spinner, ut as httpRequestTask, vt as decisionLimits, wt as webhookMethods, xt as decisionTask, zt as Select$1 } from "./dialog-BzoSxhXQ.js";
7
+ import { C as isMac, S as toManifestNodeId, T as flowPngAspectRatios, _ as E$1, a as CanvasNodeIcon, b as toViewEdge, c as collapseAllNested, d as IconStack, f as selectableTimeZones, g as cronDescription, h as timeZoneOffset, i as pasteVideoLink, l as formatDuration, m as timeZoneLongLabel, n as setAddItemId, o as defaultTriggerIcon, p as timeZoneLabel, s as JSONViewer, t as FlowCanvas, u as useDebouncedValue, v as CanvasTooltip, w as isSameViewport, x as toManifestHandleName, y as CanvasStore } from "./FlowCanvas-ChbukrDh.js";
8
+ import { $ as resourceValue, $t as WorkflowExportDialog, A as schemaForEditor, An as TabsTrigger, Ar as serverAddress, B as datePickerValue, Bn as EmptyMedia, Br as ApiError, Cn as selectors, Cr as inputValue, D as defaultValueEditorSchema, Dn as Tabs, Dr as openApiTask, Dt as diagnosticMessage, E as supportsFeishuChatFilter, En as IconPickerButton, Er as openApiFieldIssues, F as calendarChange, Fn as InputGroupInput, Fr as workflowCandidateGroup, G as indexAddNodeOptions, Gn as SourceSelect, H as isDateFormat, Hn as Badge, Hr as eventSourceKind, I as calendarDate, In as Empty, Ir as workflowCapability, Jn as EventSourceSetup, Kn as createI18n, L as dateFromTimeZone, Ln as EmptyContent, Lr as workflowSelectionTask, M as getDefaultValue, Mn as followWorkbenchLink, Mr as sameWorkflowInterface, N as isUnconstrainedSchema, Nn as InputGroup, Nr as workflowAgentTool, O as editorComponent, On as TabsContent, Or as securityOptions, Ot as diagnosticNodeId, P as typeOfSchema, Pn as InputGroupAddon, Q as resourceData, R as dateInTimeZone, Rn as EmptyDescription, Sn as ComboboxRoot, Sr as triggerConfigValues, St as revisionView, T as feishuResourceKind, Tn as useComboboxRootContext, Tr as object$1, V as dateTimeWall, Vn as EmptyTitle, Vr as controlErrorCode, Wn as SourceForm, Y as connectorActionPresentation, Yn as errorNotice, Z as observeResource, Zt as dequal$1, _n as ComboboxList, _t as actionSummary, ar as webhookResponseDiagnostics, bn as ComboboxInputGroup, bt as canCancelRun, cn as selectionMenuItemClass, dn as valueEditor_module_default, dr as isJsonObject, dt as loadJson, en as WorkflowExportMenuItem, er as decodeResultList, fn as ComboboxItemIndicator, ft as designerGraph, gn as ComboboxPortal, gt as triggerNodeIcon, hn as ComboboxPositioner, ht as semanticNodeIcon, ir as resolutionOutputPorts, it as decodeAppCatalogResponse, j as valueForEditor, jr as servers, jt as connectionCatalog, k as editorGroups, kn as TabsList, kr as selectOperation, kt as schemaMismatchMessage, ln as ValueControl, mn as ComboboxPopup, mt as nodeTitle, n as agentTool, nn as IdTooltip, nr as executionReachableNodes, or as sourceOutputLabel, ot as getAppCatalogCache, pn as ComboboxItem, pt as nodeIcon, q as mapSource, qn as FeishuEventPicker, rn as FlowSettingsButton, rr as inputSourceCandidates, sn as selectionMenuContentClass, sr as sourcePort, tn as useWorkflowExportAction, tt as provider, un as ValueEditorFeedback, ur as triggerOutputDefinitions, vn as GroupCollectionProvider, vt as providerIcon, wn as useComboboxInputValueContext, wr as listOperations, xn as ComboboxInput, xr as triggerConfigValue, xt as hasRunFilter, yn as ComboboxTrigger, z as datePickerChange, zn as EmptyHeader } from "./flowChanges-C567g-Pc.js";
9
9
  import { a as renameObjectField, i as objectValue, n as isJsonValue, o as setObjectField, r as jsonDataTypes, s as valueType$1, t as initialValue } from "./value-BbFQZZ_V.js";
10
10
  import { n as compile, r as validate } from "./flowRunInputEditorStore-ys1-w9GW.js";
11
- import { t as WorkbenchSelect } from "./workbenchSelect-Ci0KCYv9.js";
11
+ import { t as WorkbenchSelect } from "./workbenchSelect-BIaEVTx6.js";
12
12
  import * as React from "react";
13
13
  import reactExports, { Children, Fragment, Suspense, createContext, forwardRef, isValidElement, lazy, memo, useCallback, useContext, useEffect, useId, useImperativeHandle, useLayoutEffect, useMemo, useRef, useState } from "react";
14
14
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
@@ -56,7 +56,7 @@ var ComboboxGroup = /*#__PURE__*/ React.forwardRef(function ComboboxGroup(compon
56
56
  if (process.env.NODE_ENV !== "production") ComboboxGroup.displayName = "ComboboxGroup";
57
57
  //#endregion
58
58
  //#region ../../node_modules/.bun/@base-ui+react@1.4.1+fa6c2f29eeb10566/node_modules/@base-ui/react/esm/combobox/clear/ComboboxClear.js
59
- var stateAttributesMapping$1 = {
59
+ var stateAttributesMapping$2 = {
60
60
  ...transitionStatusMapping,
61
61
  ...triggerOpenStateMapping
62
62
  };
@@ -134,7 +134,7 @@ var ComboboxClear = /*#__PURE__*/ React.forwardRef(function ComboboxClear(compon
134
134
  elementProps,
135
135
  getButtonProps
136
136
  ],
137
- stateAttributesMapping: stateAttributesMapping$1
137
+ stateAttributesMapping: stateAttributesMapping$2
138
138
  });
139
139
  if (!(keepMounted || mounted)) return null;
140
140
  return element;
@@ -231,7 +231,7 @@ function CanvasHistoryScope({ history, disabled, ...props }) {
231
231
  }
232
232
  //#endregion
233
233
  //#region src/workbench/browser/runtime/editor/commentInspector.tsx
234
- var MarkdownContent = lazy(() => import("./markdownContent-IS8xXDoc.js"));
234
+ var MarkdownContent = lazy(() => import("./markdownContent-B-GLj5DU.js"));
235
235
  /** A comment is presentation data; editing it does not require the canvas store. */
236
236
  function CommentInspector({ title, content, disabled = false, readOnly, dark, onSave }) {
237
237
  const t = useTranslate();
@@ -3973,7 +3973,7 @@ var SwitchRootDataAttributes = /*#__PURE__*/ function(SwitchRootDataAttributes)
3973
3973
  }({});
3974
3974
  //#endregion
3975
3975
  //#region ../../node_modules/.bun/@base-ui+react@1.4.1+fa6c2f29eeb10566/node_modules/@base-ui/react/esm/switch/stateAttributesMapping.js
3976
- var stateAttributesMapping = {
3976
+ var stateAttributesMapping$1 = {
3977
3977
  ...fieldValidityMapping,
3978
3978
  checked(value) {
3979
3979
  if (value) return { [SwitchRootDataAttributes.checked]: "" };
@@ -4127,7 +4127,7 @@ var SwitchRoot = /*#__PURE__*/ React.forwardRef(function SwitchRoot(componentPro
4127
4127
  elementProps,
4128
4128
  getButtonProps
4129
4129
  ],
4130
- stateAttributesMapping
4130
+ stateAttributesMapping: stateAttributesMapping$1
4131
4131
  });
4132
4132
  return /*#__PURE__*/ jsxs(SwitchRootContext.Provider, {
4133
4133
  value: state,
@@ -4166,7 +4166,7 @@ var SwitchThumb = /*#__PURE__*/ React.forwardRef(function SwitchThumb(componentP
4166
4166
  return useRenderElement("span", componentProps, {
4167
4167
  state: extendedState,
4168
4168
  ref: forwardedRef,
4169
- stateAttributesMapping,
4169
+ stateAttributesMapping: stateAttributesMapping$1,
4170
4170
  props: elementProps
4171
4171
  });
4172
4172
  });
@@ -33795,6 +33795,543 @@ function RunsView({ flowName, onClose, onConfigureConnector, onLocateEvent, onLo
33795
33795
  });
33796
33796
  }
33797
33797
  //#endregion
33798
+ //#region ../../node_modules/.bun/@base-ui+react@1.4.1+fa6c2f29eeb10566/node_modules/@base-ui/react/esm/toggle-group/ToggleGroupContext.js
33799
+ var ToggleGroupContext$1 = /*#__PURE__*/ React.createContext(void 0);
33800
+ if (process.env.NODE_ENV !== "production") ToggleGroupContext$1.displayName = "ToggleGroupContext";
33801
+ function useToggleGroupContext(optional = true) {
33802
+ const context = React.useContext(ToggleGroupContext$1);
33803
+ if (context === void 0 && !optional) throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: ToggleGroupContext is missing. ToggleGroup parts must be placed within <ToggleGroup>." : formatErrorMessage(7));
33804
+ return context;
33805
+ }
33806
+ //#endregion
33807
+ //#region ../../node_modules/.bun/@base-ui+react@1.4.1+fa6c2f29eeb10566/node_modules/@base-ui/react/esm/toggle/Toggle.js
33808
+ /**
33809
+ * A two-state button that can be on or off.
33810
+ * Renders a `<button>` element.
33811
+ *
33812
+ * Documentation: [Base UI Toggle](https://base-ui.com/react/components/toggle)
33813
+ */
33814
+ var Toggle = /*#__PURE__*/ React.forwardRef(function Toggle(componentProps, forwardedRef) {
33815
+ const { className, defaultPressed: defaultPressedProp = false, disabled: disabledProp = false, form, onPressedChange: onPressedChangeProp, pressed: pressedProp, render, type, value: valueProp, nativeButton = true, style, ...elementProps } = componentProps;
33816
+ const value = useBaseUiId(valueProp || void 0);
33817
+ const groupContext = useToggleGroupContext();
33818
+ const groupValue = groupContext?.value ?? [];
33819
+ const defaultPressed = groupContext ? void 0 : defaultPressedProp;
33820
+ const disabled = (disabledProp || groupContext?.disabled) ?? false;
33821
+ if (process.env.NODE_ENV !== "production") useIsoLayoutEffect(() => {
33822
+ if (groupContext && valueProp === void 0 && groupContext.isValueInitialized) error$1("A `<Toggle>` component rendered in a `<ToggleGroup>` has no explicit `value` prop.", "This will cause issues between the Toggle Group and Toggle values.", "Provide the `<Toggle>` with a `value` prop matching the `<ToggleGroup>` values prop type.");
33823
+ }, [
33824
+ groupContext,
33825
+ valueProp,
33826
+ groupContext?.isValueInitialized
33827
+ ]);
33828
+ const [pressed, setPressedState] = useControlled({
33829
+ controlled: groupContext ? value !== void 0 && groupValue.indexOf(value) > -1 : pressedProp,
33830
+ default: defaultPressed,
33831
+ name: "Toggle",
33832
+ state: "pressed"
33833
+ });
33834
+ const onPressedChange = useStableCallback((nextPressed, eventDetails) => {
33835
+ if (value) groupContext?.setGroupValue?.(value, nextPressed, eventDetails);
33836
+ onPressedChangeProp?.(nextPressed, eventDetails);
33837
+ });
33838
+ const { getButtonProps, buttonRef } = useButton({
33839
+ disabled,
33840
+ native: nativeButton
33841
+ });
33842
+ const state = {
33843
+ disabled,
33844
+ pressed
33845
+ };
33846
+ const refs = [buttonRef, forwardedRef];
33847
+ const props = [
33848
+ {
33849
+ "aria-pressed": pressed,
33850
+ onClick(event) {
33851
+ const nextPressed = !pressed;
33852
+ const details = createChangeEventDetails(none, event.nativeEvent);
33853
+ onPressedChange(nextPressed, details);
33854
+ if (details.isCanceled) return;
33855
+ setPressedState(nextPressed);
33856
+ }
33857
+ },
33858
+ elementProps,
33859
+ getButtonProps
33860
+ ];
33861
+ const element = useRenderElement("button", componentProps, {
33862
+ enabled: !groupContext,
33863
+ state,
33864
+ ref: refs,
33865
+ props
33866
+ });
33867
+ if (groupContext) return /*#__PURE__*/ jsx(CompositeItem, {
33868
+ tag: "button",
33869
+ render,
33870
+ className,
33871
+ style,
33872
+ state,
33873
+ refs,
33874
+ props
33875
+ });
33876
+ return element;
33877
+ });
33878
+ if (process.env.NODE_ENV !== "production") Toggle.displayName = "Toggle";
33879
+ //#endregion
33880
+ //#region ../../node_modules/.bun/@base-ui+react@1.4.1+fa6c2f29eeb10566/node_modules/@base-ui/react/esm/toggle-group/ToggleGroupDataAttributes.js
33881
+ var ToggleGroupDataAttributes = /*#__PURE__*/ function(ToggleGroupDataAttributes) {
33882
+ /**
33883
+ * Present when the toggle group is disabled.
33884
+ */
33885
+ ToggleGroupDataAttributes["disabled"] = "data-disabled";
33886
+ /**
33887
+ * Indicates the orientation of the toggle group.
33888
+ * @type {'horizontal' | 'vertical'}
33889
+ */
33890
+ ToggleGroupDataAttributes["orientation"] = "data-orientation";
33891
+ /**
33892
+ * Present when the toggle group allows multiple buttons to be in the pressed state at the same time.
33893
+ */
33894
+ ToggleGroupDataAttributes["multiple"] = "data-multiple";
33895
+ return ToggleGroupDataAttributes;
33896
+ }({});
33897
+ //#endregion
33898
+ //#region ../../node_modules/.bun/@base-ui+react@1.4.1+fa6c2f29eeb10566/node_modules/@base-ui/react/esm/toggle-group/ToggleGroup.js
33899
+ var stateAttributesMapping = { multiple(value) {
33900
+ if (value) return { [ToggleGroupDataAttributes.multiple]: "" };
33901
+ return null;
33902
+ } };
33903
+ /**
33904
+ * Provides a shared state to a series of toggle buttons.
33905
+ *
33906
+ * Documentation: [Base UI Toggle Group](https://base-ui.com/react/components/toggle-group)
33907
+ */
33908
+ var ToggleGroup$1 = /*#__PURE__*/ React.forwardRef(function ToggleGroup(componentProps, forwardedRef) {
33909
+ const { defaultValue: defaultValueProp, disabled: disabledProp = false, loopFocus = true, onValueChange, orientation = "horizontal", multiple = false, value: valueProp, className, render, style, ...elementProps } = componentProps;
33910
+ const toolbarContext = useToolbarRootContext(true);
33911
+ const defaultValue = React.useMemo(() => {
33912
+ if (valueProp === void 0) return defaultValueProp ?? [];
33913
+ }, [valueProp, defaultValueProp]);
33914
+ const isValueInitialized = React.useMemo(() => valueProp !== void 0 || defaultValueProp !== void 0, [valueProp, defaultValueProp]);
33915
+ const disabled = (toolbarContext?.disabled ?? false) || disabledProp;
33916
+ const [groupValue, setValueState] = useControlled({
33917
+ controlled: valueProp,
33918
+ default: defaultValue,
33919
+ name: "ToggleGroup",
33920
+ state: "value"
33921
+ });
33922
+ const setGroupValue = useStableCallback((newValue, nextPressed, eventDetails) => {
33923
+ let newGroupValue;
33924
+ if (multiple) {
33925
+ newGroupValue = groupValue.slice();
33926
+ if (nextPressed) newGroupValue.push(newValue);
33927
+ else newGroupValue.splice(groupValue.indexOf(newValue), 1);
33928
+ } else newGroupValue = nextPressed ? [newValue] : [];
33929
+ if (Array.isArray(newGroupValue)) {
33930
+ onValueChange?.(newGroupValue, eventDetails);
33931
+ if (eventDetails.isCanceled) return;
33932
+ setValueState(newGroupValue);
33933
+ }
33934
+ });
33935
+ const state = {
33936
+ disabled,
33937
+ multiple,
33938
+ orientation
33939
+ };
33940
+ const contextValue = React.useMemo(() => ({
33941
+ disabled,
33942
+ orientation,
33943
+ setGroupValue,
33944
+ value: groupValue,
33945
+ isValueInitialized
33946
+ }), [
33947
+ disabled,
33948
+ orientation,
33949
+ setGroupValue,
33950
+ groupValue,
33951
+ isValueInitialized
33952
+ ]);
33953
+ const defaultProps = { role: "group" };
33954
+ const element = useRenderElement("div", componentProps, {
33955
+ enabled: Boolean(toolbarContext),
33956
+ state,
33957
+ ref: forwardedRef,
33958
+ props: [defaultProps, elementProps],
33959
+ stateAttributesMapping
33960
+ });
33961
+ return /*#__PURE__*/ jsx(ToggleGroupContext$1.Provider, {
33962
+ value: contextValue,
33963
+ children: toolbarContext ? element : /*#__PURE__*/ jsx(CompositeRoot, {
33964
+ render,
33965
+ className,
33966
+ style,
33967
+ state,
33968
+ refs: [forwardedRef],
33969
+ props: [defaultProps, elementProps],
33970
+ stateAttributesMapping,
33971
+ loopFocus,
33972
+ enableHomeAndEndKeys: true,
33973
+ orientation
33974
+ })
33975
+ });
33976
+ });
33977
+ if (process.env.NODE_ENV !== "production") ToggleGroup$1.displayName = "ToggleGroup";
33978
+ //#endregion
33979
+ //#region src/ui/browser/toggle.tsx
33980
+ var toggleVariants = cva("group/toggle inline-flex items-center justify-center gap-1 rounded-lg text-sm font-medium whitespace-nowrap transition-[color,background-color,border-color,box-shadow,opacity,transform] outline-none hover:bg-muted hover:text-foreground focus-visible:outline-2 focus-visible:outline-solid focus-visible:ring-0 focus-visible:aria-invalid:ring-0 focus-visible:outline-offset-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-pressed:bg-accent aria-pressed:text-accent-foreground aria-pressed:hover:bg-accent aria-pressed:hover:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", {
33981
+ variants: {
33982
+ variant: {
33983
+ default: "bg-transparent",
33984
+ outline: "border border-input bg-transparent hover:bg-muted"
33985
+ },
33986
+ size: {
33987
+ default: "h-8 min-w-8 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
33988
+ sm: "h-7 min-w-7 rounded-md px-2.5 text-[0.8rem] has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",
33989
+ lg: "h-9 min-w-9 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2"
33990
+ }
33991
+ },
33992
+ defaultVariants: {
33993
+ variant: "default",
33994
+ size: "default"
33995
+ }
33996
+ });
33997
+ //#endregion
33998
+ //#region src/ui/browser/toggle-group.tsx
33999
+ var ToggleGroupContext = React.createContext({
34000
+ size: "default",
34001
+ variant: "default",
34002
+ spacing: 2,
34003
+ orientation: "horizontal"
34004
+ });
34005
+ function ToggleGroup({ className, variant, size, spacing = 2, orientation = "horizontal", children, ...props }) {
34006
+ return /* @__PURE__ */ jsx(ToggleGroup$1, {
34007
+ "data-slot": "toggle-group",
34008
+ "data-variant": variant,
34009
+ "data-size": size,
34010
+ "data-spacing": spacing,
34011
+ "data-orientation": orientation,
34012
+ style: { "--gap": `${spacing}px` },
34013
+ orientation,
34014
+ className: cn("group/toggle-group flex w-fit flex-row items-center gap-[var(--gap)] rounded-lg data-[size=sm]:rounded-md data-[variant=outline]:bg-background data-[orientation=vertical]:flex-col data-[orientation=vertical]:items-stretch", className),
34015
+ ...props,
34016
+ children: /* @__PURE__ */ jsx(ToggleGroupContext.Provider, {
34017
+ value: {
34018
+ variant,
34019
+ size,
34020
+ spacing,
34021
+ orientation
34022
+ },
34023
+ children
34024
+ })
34025
+ });
34026
+ }
34027
+ function ToggleGroupItem({ className, children, variant = "default", size = "default", ...props }) {
34028
+ const context = React.useContext(ToggleGroupContext);
34029
+ return /* @__PURE__ */ jsx(Toggle, {
34030
+ "data-slot": "toggle-group-item",
34031
+ "data-variant": context.variant || variant,
34032
+ "data-size": context.size || size,
34033
+ "data-spacing": context.spacing,
34034
+ className: cn("shrink-0 group-data-[spacing=0]/toggle-group:rounded-none group-data-[spacing=0]/toggle-group:px-2 focus:z-10 focus-visible:z-10 group-data-[spacing=0]/toggle-group:has-data-[icon=inline-end]:pr-1.5 group-data-[spacing=0]/toggle-group:has-data-[icon=inline-start]:pl-1.5 group-data-[orientation=horizontal]/toggle-group:data-[spacing=0]:first:rounded-l-lg group-data-[orientation=vertical]/toggle-group:data-[spacing=0]:first:rounded-t-lg group-data-[orientation=horizontal]/toggle-group:data-[spacing=0]:last:rounded-r-lg group-data-[orientation=vertical]/toggle-group:data-[spacing=0]:last:rounded-b-lg group-data-[orientation=horizontal]/toggle-group:data-[spacing=0]:data-[variant=outline]:border-l-0 group-data-[orientation=vertical]/toggle-group:data-[spacing=0]:data-[variant=outline]:border-t-0 group-data-[orientation=horizontal]/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-l group-data-[orientation=vertical]/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-t", toggleVariants({
34035
+ variant: context.variant || variant,
34036
+ size: context.size || size
34037
+ }), className),
34038
+ ...props,
34039
+ children
34040
+ });
34041
+ }
34042
+ //#endregion
34043
+ //#region src/workbench/browser/runtime/shell/pngExportPreference.ts
34044
+ var pngExportFramePreferenceKey = "open-flow:png-export-frame";
34045
+ function readPngExportFrame(preferences) {
34046
+ try {
34047
+ return preferences?.getItem(pngExportFramePreferenceKey) !== "false";
34048
+ } catch {
34049
+ return true;
34050
+ }
34051
+ }
34052
+ function writePngExportFrame(preferences, enabled) {
34053
+ try {
34054
+ preferences?.setItem(pngExportFramePreferenceKey, String(enabled));
34055
+ } catch {}
34056
+ }
34057
+ var pngExportLayoutPreferenceKey = "open-flow:png-export-layout";
34058
+ function readPngExportLayout(preferences) {
34059
+ try {
34060
+ return preferences?.getItem("open-flow:png-export-layout") === "compact" ? "compact" : "original";
34061
+ } catch {
34062
+ return "original";
34063
+ }
34064
+ }
34065
+ function writePngExportLayout(preferences, layout) {
34066
+ try {
34067
+ preferences?.setItem(pngExportLayoutPreferenceKey, layout);
34068
+ } catch {}
34069
+ }
34070
+ var pngExportAspectRatioPreferenceKey = "open-flow:png-export-aspect-ratio";
34071
+ var pngExportThemePreferenceKey = "open-flow:png-export-theme";
34072
+ function readPngExportAspectRatio(preferences) {
34073
+ try {
34074
+ const value = preferences?.getItem(pngExportAspectRatioPreferenceKey);
34075
+ return flowPngAspectRatios.find((ratio) => ratio === value) ?? "auto";
34076
+ } catch {
34077
+ return "auto";
34078
+ }
34079
+ }
34080
+ function writePngExportAspectRatio(preferences, value) {
34081
+ try {
34082
+ preferences?.setItem(pngExportAspectRatioPreferenceKey, value);
34083
+ } catch {}
34084
+ }
34085
+ function readPngExportDark(preferences, defaultDark) {
34086
+ try {
34087
+ const value = preferences?.getItem(pngExportThemePreferenceKey);
34088
+ return value === "dark" ? true : value === "light" ? false : defaultDark;
34089
+ } catch {
34090
+ return defaultDark;
34091
+ }
34092
+ }
34093
+ function writePngExportDark(preferences, dark) {
34094
+ try {
34095
+ preferences?.setItem(pngExportThemePreferenceKey, dark ? "dark" : "light");
34096
+ } catch {}
34097
+ }
34098
+ //#endregion
34099
+ //#region src/workbench/browser/runtime/shell/pngExportDialog.tsx
34100
+ function PngExportDialog({ container, defaultDark = false, direction, onDownload, onOpenChange, open, preferences, render, title }) {
34101
+ const t = useTranslate();
34102
+ const id = useId();
34103
+ const [aspectRatio, setAspectRatio] = useState(() => readPngExportAspectRatio(preferences));
34104
+ const [dark, setDark] = useState(() => readPngExportDark(preferences, defaultDark));
34105
+ const [frame, setFrame] = useState(() => readPngExportFrame(preferences));
34106
+ const [layout, setLayout] = useState(() => readPngExportLayout(preferences));
34107
+ const [attempt, setAttempt] = useState(0);
34108
+ const [preview, setPreview] = useState();
34109
+ const [failed, setFailed] = useState();
34110
+ const [downloading, setDownloading] = useState(false);
34111
+ const queue = useRef(Promise.resolve());
34112
+ const options = useMemo(() => ({
34113
+ aspectRatio,
34114
+ dark,
34115
+ frame,
34116
+ layout: direction === "vertical" ? layout : "original",
34117
+ title
34118
+ }), [
34119
+ aspectRatio,
34120
+ dark,
34121
+ frame,
34122
+ direction,
34123
+ layout,
34124
+ title
34125
+ ]);
34126
+ const request = useMemo(() => ({
34127
+ render,
34128
+ options,
34129
+ attempt,
34130
+ open
34131
+ }), [
34132
+ render,
34133
+ options,
34134
+ attempt,
34135
+ open
34136
+ ]);
34137
+ const ready = preview?.request === request;
34138
+ const error = failed === request;
34139
+ useEffect(() => {
34140
+ if (!open || ready) return;
34141
+ let active = true;
34142
+ setFailed(void 0);
34143
+ const timer = setTimeout(() => {
34144
+ queue.current = queue.current.then(async () => {
34145
+ if (!active) return;
34146
+ try {
34147
+ const result = await request.render(request.options);
34148
+ if (active) setPreview({
34149
+ request,
34150
+ result,
34151
+ url: URL.createObjectURL(result.blob)
34152
+ });
34153
+ } catch {
34154
+ if (active) setFailed(request);
34155
+ }
34156
+ });
34157
+ }, 200);
34158
+ return () => {
34159
+ active = false;
34160
+ clearTimeout(timer);
34161
+ };
34162
+ }, [
34163
+ open,
34164
+ request,
34165
+ ready
34166
+ ]);
34167
+ useEffect(() => () => {
34168
+ if (preview) URL.revokeObjectURL(preview.url);
34169
+ }, [preview]);
34170
+ return /* @__PURE__ */ jsx(Dialog, {
34171
+ open,
34172
+ onOpenChange,
34173
+ children: /* @__PURE__ */ jsxs(DialogContent, {
34174
+ container,
34175
+ closeLabel: t("common.close"),
34176
+ className: "max-h-[calc(100dvh-2rem)] grid-rows-[auto_minmax(0,1fr)_auto] sm:max-w-4xl",
34177
+ children: [
34178
+ /* @__PURE__ */ jsx(DialogHeader, { children: /* @__PURE__ */ jsx(DialogTitle, { children: t("resource.exportPng") }) }),
34179
+ /* @__PURE__ */ jsxs("div", {
34180
+ className: "grid min-h-0 gap-5 overflow-y-auto md:grid-cols-[minmax(0,1fr)_16rem]",
34181
+ children: [/* @__PURE__ */ jsxs("div", {
34182
+ "aria-label": t("resource.exportPngPreview"),
34183
+ "aria-busy": !ready && !error,
34184
+ className: "grid h-[min(56dvh,32rem)] min-h-52 min-w-0 grid-cols-[minmax(0,1fr)] grid-rows-[minmax(0,1fr)] place-items-center overflow-hidden rounded-lg border border-border p-2",
34185
+ style: {
34186
+ backgroundColor: "var(--ui-background)",
34187
+ backgroundImage: "conic-gradient(var(--ui-muted) 25%, transparent 0 50%, var(--ui-muted) 0 75%, transparent 0)",
34188
+ backgroundSize: "20px 20px"
34189
+ },
34190
+ role: "region",
34191
+ children: [
34192
+ preview && /* @__PURE__ */ jsx("img", {
34193
+ alt: title,
34194
+ className: `col-start-1 row-start-1 h-full max-h-full w-full min-h-0 min-w-0 object-contain ${ready ? "" : "opacity-30"}`,
34195
+ src: preview.url
34196
+ }),
34197
+ !ready && !error && /* @__PURE__ */ jsxs("div", {
34198
+ className: "col-start-1 row-start-1 flex items-center gap-2 text-sm text-muted-foreground",
34199
+ role: "status",
34200
+ children: [/* @__PURE__ */ jsx(Spinner, { "aria-hidden": "true" }), t("resource.exportPngPreviewPending")]
34201
+ }),
34202
+ error && /* @__PURE__ */ jsxs("div", {
34203
+ className: "col-start-1 row-start-1 flex flex-col items-center gap-3 text-center",
34204
+ children: [/* @__PURE__ */ jsx("p", {
34205
+ className: "m-0 text-sm text-muted-foreground",
34206
+ role: "alert",
34207
+ children: t("resource.exportPngPreviewFailed")
34208
+ }), /* @__PURE__ */ jsx(Button$1, {
34209
+ variant: "outline",
34210
+ onClick: () => setAttempt((value) => value + 1),
34211
+ children: t("resource.exportPngPreviewRetry")
34212
+ })]
34213
+ })
34214
+ ]
34215
+ }), /* @__PURE__ */ jsxs(FieldGroup, {
34216
+ className: "self-start",
34217
+ children: [
34218
+ /* @__PURE__ */ jsxs(Field, { children: [/* @__PURE__ */ jsx(FieldLabel, {
34219
+ id: `${id}-ratio`,
34220
+ children: t("resource.exportPngAspectRatio")
34221
+ }), /* @__PURE__ */ jsx(ToggleGroup, {
34222
+ "aria-labelledby": `${id}-ratio`,
34223
+ className: "grid w-full grid-cols-3",
34224
+ value: [aspectRatio],
34225
+ variant: "outline",
34226
+ onValueChange: (values) => {
34227
+ const value = values[0];
34228
+ if (!value) return;
34229
+ setAspectRatio(value);
34230
+ writePngExportAspectRatio(preferences, value);
34231
+ },
34232
+ children: flowPngAspectRatios.map((value) => /* @__PURE__ */ jsx(ToggleGroupItem, {
34233
+ value,
34234
+ children: value === "auto" ? t("resource.exportPngAuto") : value
34235
+ }, value))
34236
+ })] }),
34237
+ direction === "vertical" && /* @__PURE__ */ jsxs(Field, { children: [/* @__PURE__ */ jsx(FieldLabel, {
34238
+ id: `${id}-layout`,
34239
+ children: t("resource.exportPngLayout")
34240
+ }), /* @__PURE__ */ jsxs(ToggleGroup, {
34241
+ "aria-labelledby": `${id}-layout`,
34242
+ className: "grid w-full grid-cols-2",
34243
+ value: [layout],
34244
+ variant: "outline",
34245
+ onValueChange: (values) => {
34246
+ const value = values[0];
34247
+ if (!value) return;
34248
+ setLayout(value);
34249
+ writePngExportLayout(preferences, value);
34250
+ },
34251
+ children: [/* @__PURE__ */ jsx(ToggleGroupItem, {
34252
+ value: "original",
34253
+ children: t("resource.exportPngOriginal")
34254
+ }), /* @__PURE__ */ jsx(ToggleGroupItem, {
34255
+ value: "compact",
34256
+ children: t("resource.exportPngCompact")
34257
+ })]
34258
+ })] }),
34259
+ /* @__PURE__ */ jsxs(Field, { children: [/* @__PURE__ */ jsx(FieldLabel, {
34260
+ id: `${id}-theme`,
34261
+ children: t("resource.exportPngTheme")
34262
+ }), /* @__PURE__ */ jsxs(ToggleGroup, {
34263
+ "aria-labelledby": `${id}-theme`,
34264
+ className: "grid w-full grid-cols-2",
34265
+ value: [dark ? "dark" : "light"],
34266
+ variant: "outline",
34267
+ onValueChange: (values) => {
34268
+ if (!values[0]) return;
34269
+ const value = values[0] === "dark";
34270
+ setDark(value);
34271
+ writePngExportDark(preferences, value);
34272
+ },
34273
+ children: [/* @__PURE__ */ jsx(ToggleGroupItem, {
34274
+ value: "light",
34275
+ children: t("resource.exportPngLight")
34276
+ }), /* @__PURE__ */ jsx(ToggleGroupItem, {
34277
+ value: "dark",
34278
+ children: t("resource.exportPngDark")
34279
+ })]
34280
+ })] }),
34281
+ /* @__PURE__ */ jsxs(Field, {
34282
+ orientation: "horizontal",
34283
+ children: [/* @__PURE__ */ jsx(Checkbox, {
34284
+ id: `${id}-frame`,
34285
+ checked: frame,
34286
+ onCheckedChange: (value) => {
34287
+ setFrame(value);
34288
+ writePngExportFrame(preferences, value);
34289
+ }
34290
+ }), /* @__PURE__ */ jsx(FieldLabel, {
34291
+ htmlFor: `${id}-frame`,
34292
+ children: t("resource.exportPngFrame")
34293
+ })]
34294
+ }),
34295
+ ready && preview.result.hasImagePlaceholders && /* @__PURE__ */ jsx("p", {
34296
+ className: "m-0 text-xs text-muted-foreground",
34297
+ children: t("resource.exportPngPreviewPartial")
34298
+ })
34299
+ ]
34300
+ })]
34301
+ }),
34302
+ /* @__PURE__ */ jsxs(DialogFooter, {
34303
+ className: "items-center",
34304
+ children: [
34305
+ /* @__PURE__ */ jsx("output", {
34306
+ "aria-live": "polite",
34307
+ className: "mr-auto text-xs tabular-nums text-muted-foreground",
34308
+ children: ready && `${preview.result.width} × ${preview.result.height} px`
34309
+ }),
34310
+ /* @__PURE__ */ jsx(DialogClose, {
34311
+ render: /* @__PURE__ */ jsx(Button$1, { variant: "outline" }),
34312
+ children: t("common.close")
34313
+ }),
34314
+ /* @__PURE__ */ jsx(Button$1, {
34315
+ disabled: !ready || downloading,
34316
+ "aria-busy": downloading,
34317
+ onClick: async () => {
34318
+ if (!ready) return;
34319
+ setDownloading(true);
34320
+ try {
34321
+ if (await onDownload(preview.result)) onOpenChange(false);
34322
+ } finally {
34323
+ setDownloading(false);
34324
+ }
34325
+ },
34326
+ children: t("resource.exportPngDownload")
34327
+ })
34328
+ ]
34329
+ })
34330
+ ]
34331
+ })
34332
+ });
34333
+ }
34334
+ //#endregion
33798
34335
  //#region src/workbench/browser/runtime/shell/diagnosticsPanel.tsx
33799
34336
  function DiagnosticsPanel({ checking, items, nodes, onClose, onRefresh, onSelect, onSelectNode }) {
33800
34337
  const t = useTranslate();
@@ -34044,34 +34581,18 @@ function WorkspaceNavigationIsland({ flowName, flowIcon, flowDescription, settin
34044
34581
  });
34045
34582
  }
34046
34583
  //#endregion
34047
- //#region src/workbench/browser/runtime/shell/pngExportPreference.ts
34048
- var pngExportFramePreferenceKey = "open-flow:png-export-frame";
34049
- function readPngExportFrame(preferences) {
34050
- try {
34051
- return preferences?.getItem(pngExportFramePreferenceKey) !== "false";
34052
- } catch {
34053
- return true;
34054
- }
34055
- }
34056
- function writePngExportFrame(preferences, enabled) {
34057
- try {
34058
- preferences?.setItem(pngExportFramePreferenceKey, String(enabled));
34059
- } catch {}
34060
- }
34061
- //#endregion
34062
34584
  //#region src/workbench/browser/runtime/shell/workspacePublishIsland.tsx
34063
34585
  var blockedReasonKey = {
34064
34586
  issues: "workspace.publishIssuesReason",
34065
34587
  busy: "workspace.publishActionInProgress",
34066
34588
  publishing: "workspace.publishInProgress"
34067
34589
  };
34068
- function WorkspacePublishIsland({ hasPublications, onOpenPublications, onExport, onExportPng, onOpenRuns, onOpenState, onPublish, preferences, state }) {
34590
+ function WorkspacePublishIsland({ hasPublications, onOpenPublications, onExport, onOpenPngExport, onOpenRuns, onOpenState, onPublish, state }) {
34069
34591
  const t = useTranslate();
34070
34592
  const exportAction = useWorkflowExportAction(onExport);
34593
+ const pngAction = useWorkflowExportAction(onOpenPngExport);
34071
34594
  const [popupContainer, setPopupContainer] = useState(null);
34072
34595
  const [confirming, setConfirming] = useState(false);
34073
- const [exporting, setExporting] = useState(false);
34074
- const [showFrame, setShowFrame] = useState(() => readPngExportFrame(preferences));
34075
34596
  const cancelButton = useRef(null);
34076
34597
  const publishLabel = t(state == "publishing" ? "workspace.publishing" : "publication.publishDraft");
34077
34598
  const historyLabel = t(hasPublications === true ? "workspace.publications" : hasPublications === false ? "publication.historyEmpty" : "publication.loading");
@@ -34087,183 +34608,136 @@ function WorkspacePublishIsland({ hasPublications, onOpenPublications, onExport,
34087
34608
  onPointerDown: (event) => event.stopPropagation(),
34088
34609
  ref: setPopupContainer,
34089
34610
  role: "group",
34090
- children: [
34091
- /* @__PURE__ */ jsxs(Popover, {
34092
- open: confirming,
34093
- onOpenChange: (open) => setConfirming(open && state == "ready"),
34094
- children: [/* @__PURE__ */ jsx(CanvasTooltip, {
34095
- getPopupContainer: () => popupContainer ?? document.body,
34096
- placement: "bottom",
34097
- title: statusTooltip,
34098
- children: /* @__PURE__ */ jsxs(PopoverTrigger, {
34099
- render: /* @__PURE__ */ jsx(Button$1, {
34100
- "aria-description": statusTooltip,
34101
- "aria-disabled": status != "ready" || void 0,
34102
- className: "workspace-publish-button",
34103
- "data-publish-status": status,
34104
- size: "default",
34105
- type: "button",
34106
- variant: "ghost"
34107
- }),
34108
- children: [/* @__PURE__ */ jsx("span", {
34109
- "aria-hidden": "true",
34110
- className: `status-dot ${status == "current" ? "success" : status == "ready" ? "warning" : "neutral"}`
34111
- }), /* @__PURE__ */ jsx("span", { children: publishLabel })]
34112
- })
34113
- }), /* @__PURE__ */ jsxs(PopoverContent, {
34114
- align: "end",
34115
- className: "gap-4 p-0",
34116
- container: popupContainer,
34117
- initialFocus: cancelButton,
34118
- side: "bottom",
34119
- sideOffset: 8,
34120
- children: [/* @__PURE__ */ jsxs(PopoverHeader, {
34121
- className: "gap-2 px-4 pt-4",
34122
- children: [/* @__PURE__ */ jsx(PopoverTitle, {
34123
- className: "m-0 text-sm",
34124
- children: t("publication.publishConfirm")
34125
- }), /* @__PURE__ */ jsx(PopoverDescription, {
34126
- className: "m-0",
34127
- children: t("publication.publishConfirmDescription")
34128
- })]
34129
- }), /* @__PURE__ */ jsxs("div", {
34130
- className: "flex justify-end gap-2 px-3 pb-3",
34131
- children: [/* @__PURE__ */ jsx(Button$1, {
34132
- ref: cancelButton,
34133
- onClick: () => setConfirming(false),
34134
- size: "sm",
34135
- type: "button",
34136
- variant: "outline",
34137
- children: t("common.cancel")
34138
- }), /* @__PURE__ */ jsx(Button$1, {
34139
- disabled: state != "ready",
34140
- onClick: () => {
34141
- if (state != "ready") return;
34142
- setConfirming(false);
34143
- onPublish();
34144
- },
34145
- size: "sm",
34146
- type: "button",
34147
- children: t("publication.confirmPublish")
34148
- })]
34611
+ children: [/* @__PURE__ */ jsxs(Popover, {
34612
+ open: confirming,
34613
+ onOpenChange: (open) => setConfirming(open && state == "ready"),
34614
+ children: [/* @__PURE__ */ jsx(CanvasTooltip, {
34615
+ getPopupContainer: () => popupContainer ?? document.body,
34616
+ placement: "bottom",
34617
+ title: statusTooltip,
34618
+ children: /* @__PURE__ */ jsxs(PopoverTrigger, {
34619
+ render: /* @__PURE__ */ jsx(Button$1, {
34620
+ "aria-description": statusTooltip,
34621
+ "aria-disabled": status != "ready" || void 0,
34622
+ className: "workspace-publish-button",
34623
+ "data-publish-status": status,
34624
+ size: "default",
34625
+ type: "button",
34626
+ variant: "ghost"
34627
+ }),
34628
+ children: [/* @__PURE__ */ jsx("span", {
34629
+ "aria-hidden": "true",
34630
+ className: `status-dot ${status == "current" ? "success" : status == "ready" ? "warning" : "neutral"}`
34631
+ }), /* @__PURE__ */ jsx("span", { children: publishLabel })]
34632
+ })
34633
+ }), /* @__PURE__ */ jsxs(PopoverContent, {
34634
+ align: "end",
34635
+ className: "gap-4 p-0",
34636
+ container: popupContainer,
34637
+ initialFocus: cancelButton,
34638
+ side: "bottom",
34639
+ sideOffset: 8,
34640
+ children: [/* @__PURE__ */ jsxs(PopoverHeader, {
34641
+ className: "gap-2 px-4 pt-4",
34642
+ children: [/* @__PURE__ */ jsx(PopoverTitle, {
34643
+ className: "m-0 text-sm",
34644
+ children: t("publication.publishConfirm")
34645
+ }), /* @__PURE__ */ jsx(PopoverDescription, {
34646
+ className: "m-0",
34647
+ children: t("publication.publishConfirmDescription")
34149
34648
  })]
34150
- })]
34151
- }),
34152
- /* @__PURE__ */ jsxs(DropdownMenu, {
34153
- onOpenChangeComplete: exportAction.onOpenChangeComplete,
34154
- children: [/* @__PURE__ */ jsx(CanvasTooltip, {
34155
- getPopupContainer: () => popupContainer ?? document.body,
34156
- placement: "bottom",
34157
- title: menuLabel,
34158
- children: /* @__PURE__ */ jsx(DropdownMenuTrigger, { render: /* @__PURE__ */ jsx(Button$1, {
34159
- "aria-label": menuLabel,
34160
- size: "icon",
34649
+ }), /* @__PURE__ */ jsxs("div", {
34650
+ className: "flex justify-end gap-2 px-3 pb-3",
34651
+ children: [/* @__PURE__ */ jsx(Button$1, {
34652
+ ref: cancelButton,
34653
+ onClick: () => setConfirming(false),
34654
+ size: "sm",
34161
34655
  type: "button",
34162
- variant: "ghost",
34163
- children: /* @__PURE__ */ jsx("i", {
34164
- "aria-hidden": "true",
34165
- className: "i-lucide-light:chevron-down"
34166
- })
34167
- }) })
34168
- }), /* @__PURE__ */ jsxs(DropdownMenuContent, {
34169
- align: "end",
34170
- className: "w-max min-w-44 max-w-(--available-width)",
34171
- container: popupContainer,
34172
- side: "bottom",
34173
- sideOffset: 8,
34174
- children: [
34175
- onExport != null && /* @__PURE__ */ jsx(WorkflowExportMenuItem, {
34176
- className: "gap-2 px-2 py-[5px]",
34177
- disabled: state == "busy" || state == "publishing",
34178
- onClick: exportAction.onClick
34179
- }),
34180
- onExportPng != null && /* @__PURE__ */ jsxs(DropdownMenuSub, { children: [/* @__PURE__ */ jsxs(DropdownMenuSubTrigger, {
34181
- className: "gap-2 px-2 py-[5px]",
34182
- disabled: exporting,
34183
- children: [/* @__PURE__ */ jsx("i", {
34184
- "aria-hidden": "true",
34185
- className: "i-lucide-light:download size-4 shrink-0"
34186
- }), t("resource.exportPng")]
34187
- }), /* @__PURE__ */ jsxs(DropdownMenuSubContent, {
34188
- className: "min-w-32",
34189
- container: popupContainer,
34190
- children: [
34191
- /* @__PURE__ */ jsx(DropdownMenuCheckboxItem, {
34192
- checked: showFrame,
34193
- className: "py-[5px] pl-2",
34194
- closeOnClick: false,
34195
- onCheckedChange: (checked) => {
34196
- setShowFrame(checked);
34197
- writePngExportFrame(preferences, checked);
34198
- },
34199
- children: t("resource.exportPngFrame")
34200
- }),
34201
- /* @__PURE__ */ jsx(DropdownMenuSeparator, { className: "mx-2 bg-border/50" }),
34202
- [false, true].map((dark) => /* @__PURE__ */ jsx(DropdownMenuItem, {
34203
- className: "px-2 py-[5px]",
34204
- onClick: async () => {
34205
- setExporting(true);
34206
- try {
34207
- await onExportPng({
34208
- dark,
34209
- frame: showFrame
34210
- });
34211
- } finally {
34212
- setExporting(false);
34213
- }
34214
- },
34215
- children: t(dark ? "resource.exportPngDark" : "resource.exportPngLight")
34216
- }, String(dark)))
34217
- ]
34218
- })] }),
34219
- /* @__PURE__ */ jsxs(DropdownMenuItem, {
34220
- className: "gap-2 px-2 py-[5px]",
34221
- disabled: hasPublications !== true,
34222
- onClick: onOpenPublications,
34223
- children: [/* @__PURE__ */ jsx("i", {
34224
- "aria-hidden": "true",
34225
- className: "i-lucide-light:cloud-upload size-4 shrink-0 text-foreground/70"
34226
- }), /* @__PURE__ */ jsx("span", {
34227
- className: "whitespace-nowrap",
34228
- children: historyLabel
34229
- })]
34230
- }),
34231
- onOpenState != null && /* @__PURE__ */ jsxs(DropdownMenuItem, {
34232
- className: "gap-2 px-2 py-[5px]",
34233
- onClick: onOpenState,
34234
- children: [/* @__PURE__ */ jsx("i", {
34235
- "aria-hidden": "true",
34236
- className: "i-lucide-light:database size-4 shrink-0 text-foreground/70"
34237
- }), t("flowState.title")]
34238
- }),
34239
- /* @__PURE__ */ jsxs(DropdownMenuItem, {
34240
- className: "gap-2 px-2 py-[5px]",
34241
- onClick: onOpenRuns,
34242
- children: [/* @__PURE__ */ jsx("i", {
34243
- "aria-hidden": "true",
34244
- className: "i-lucide-light:history size-4 shrink-0 text-foreground/70"
34245
- }), runsLabel]
34246
- })
34247
- ]
34656
+ variant: "outline",
34657
+ children: t("common.cancel")
34658
+ }), /* @__PURE__ */ jsx(Button$1, {
34659
+ disabled: state != "ready",
34660
+ onClick: () => {
34661
+ if (state != "ready") return;
34662
+ setConfirming(false);
34663
+ onPublish();
34664
+ },
34665
+ size: "sm",
34666
+ type: "button",
34667
+ children: t("publication.confirmPublish")
34668
+ })]
34248
34669
  })]
34249
- }),
34250
- /* @__PURE__ */ jsx(Dialog, {
34251
- open: exporting,
34252
- onOpenChange: (_open, details) => details.cancel(),
34253
- children: /* @__PURE__ */ jsxs(DialogContent, {
34254
- container: popupContainer?.closest(".open-flow-workbench") ?? popupContainer,
34255
- showCloseButton: false,
34256
- "aria-busy": "true",
34257
- children: [/* @__PURE__ */ jsxs("div", {
34258
- className: "flex items-center gap-3",
34259
- children: [/* @__PURE__ */ jsx(Spinner, {
34670
+ })]
34671
+ }), /* @__PURE__ */ jsxs(DropdownMenu, {
34672
+ onOpenChangeComplete: (open) => {
34673
+ exportAction.onOpenChangeComplete(open);
34674
+ pngAction.onOpenChangeComplete(open);
34675
+ },
34676
+ children: [/* @__PURE__ */ jsx(CanvasTooltip, {
34677
+ getPopupContainer: () => popupContainer ?? document.body,
34678
+ placement: "bottom",
34679
+ title: menuLabel,
34680
+ children: /* @__PURE__ */ jsx(DropdownMenuTrigger, { render: /* @__PURE__ */ jsx(Button$1, {
34681
+ "aria-label": menuLabel,
34682
+ size: "icon",
34683
+ type: "button",
34684
+ variant: "ghost",
34685
+ children: /* @__PURE__ */ jsx("i", {
34686
+ "aria-hidden": "true",
34687
+ className: "i-lucide-light:chevron-down"
34688
+ })
34689
+ }) })
34690
+ }), /* @__PURE__ */ jsxs(DropdownMenuContent, {
34691
+ align: "end",
34692
+ className: "w-max min-w-44 max-w-(--available-width)",
34693
+ container: popupContainer,
34694
+ side: "bottom",
34695
+ sideOffset: 8,
34696
+ children: [
34697
+ onExport != null && /* @__PURE__ */ jsx(WorkflowExportMenuItem, {
34698
+ className: "gap-2 px-2 py-[5px]",
34699
+ disabled: state == "busy" || state == "publishing",
34700
+ onClick: exportAction.onClick
34701
+ }),
34702
+ onOpenPngExport != null && /* @__PURE__ */ jsxs(DropdownMenuItem, {
34703
+ className: "gap-2 px-2 py-[5px]",
34704
+ onClick: pngAction.onClick,
34705
+ children: [/* @__PURE__ */ jsx("i", {
34260
34706
  "aria-hidden": "true",
34261
- className: "shrink-0"
34262
- }), /* @__PURE__ */ jsx(DialogTitle, { children: t("resource.exportPngPending") })]
34263
- }), /* @__PURE__ */ jsx(DialogDescription, { children: t("resource.exportPngPendingDescription") })]
34264
- })
34265
- })
34266
- ]
34707
+ className: "i-lucide-light:download size-4 shrink-0"
34708
+ }), t("resource.exportPng")]
34709
+ }),
34710
+ /* @__PURE__ */ jsxs(DropdownMenuItem, {
34711
+ className: "gap-2 px-2 py-[5px]",
34712
+ disabled: hasPublications !== true,
34713
+ onClick: onOpenPublications,
34714
+ children: [/* @__PURE__ */ jsx("i", {
34715
+ "aria-hidden": "true",
34716
+ className: "i-lucide-light:cloud-upload size-4 shrink-0 text-foreground/70"
34717
+ }), /* @__PURE__ */ jsx("span", {
34718
+ className: "whitespace-nowrap",
34719
+ children: historyLabel
34720
+ })]
34721
+ }),
34722
+ onOpenState != null && /* @__PURE__ */ jsxs(DropdownMenuItem, {
34723
+ className: "gap-2 px-2 py-[5px]",
34724
+ onClick: onOpenState,
34725
+ children: [/* @__PURE__ */ jsx("i", {
34726
+ "aria-hidden": "true",
34727
+ className: "i-lucide-light:database size-4 shrink-0 text-foreground/70"
34728
+ }), t("flowState.title")]
34729
+ }),
34730
+ /* @__PURE__ */ jsxs(DropdownMenuItem, {
34731
+ className: "gap-2 px-2 py-[5px]",
34732
+ onClick: onOpenRuns,
34733
+ children: [/* @__PURE__ */ jsx("i", {
34734
+ "aria-hidden": "true",
34735
+ className: "i-lucide-light:history size-4 shrink-0 text-foreground/70"
34736
+ }), runsLabel]
34737
+ })
34738
+ ]
34739
+ })]
34740
+ })]
34267
34741
  });
34268
34742
  }
34269
34743
  //#endregion
@@ -34469,7 +34943,7 @@ var NodeInspectorContainer = memo(function NodeInspectorContainer({ onAddWorkflo
34469
34943
  triggers: store.triggers
34470
34944
  });
34471
34945
  });
34472
- function FlowEditor({ navigationIsland, onRun, onRunStarted, onCloseRuns, onConfigureConnector, onOpenPublications, onOpenRuns, onManageConnectorAccess, connectionHref, onToggleRuns, runDrawerOpen, store, theme }) {
34946
+ function FlowEditor({ portalRoot, navigationIsland, onRun, onRunStarted, onCloseRuns, onConfigureConnector, onOpenPublications, onOpenRuns, onManageConnectorAccess, connectionHref, onToggleRuns, runDrawerOpen, store, theme }) {
34473
34947
  const t = useTranslate();
34474
34948
  const addNodeOptions = useVal(store.workspace.$.addNodeOptions);
34475
34949
  const language = useLang();
@@ -34477,6 +34951,8 @@ function FlowEditor({ navigationIsland, onRun, onRunStarted, onCloseRuns, onConf
34477
34951
  const triggerCatalogState = useVal(store.triggers.catalog.state);
34478
34952
  const [startId, setStartId] = useState();
34479
34953
  const [stateOpen, setStateOpen] = useState(false);
34954
+ const [pngExportOpen, setPngExportOpen] = useState(false);
34955
+ const currentFlow = useVal(store.workspace.$.flow);
34480
34956
  const runInputRequest = useVal(store.runRequests.$.inputRequest);
34481
34957
  useVal(store.runRequests.$.inputsLoaded);
34482
34958
  const busy = useVal(store.$.busy);
@@ -34501,6 +34977,18 @@ function FlowEditor({ navigationIsland, onRun, onRunStarted, onCloseRuns, onConf
34501
34977
  const moduleEditor = useVal(store.workspace.$.moduleEditor);
34502
34978
  const initialAddNodeTab = triggers.length == 0 ? "triggers" : "nodes";
34503
34979
  const { ignoredNodeIds, onIgnoreNodes } = useIgnoredNodes(flowId ?? "");
34980
+ const renderPng = useCallback(async (options) => {
34981
+ const model = store.$.designer.value;
34982
+ const { flowToPng } = await import("./exportPng-CrAFfOaD.js");
34983
+ return flowToPng(model, language, {
34984
+ ...options,
34985
+ ignoredNodeIds
34986
+ });
34987
+ }, [
34988
+ store,
34989
+ language,
34990
+ ignoredNodeIds
34991
+ ]);
34504
34992
  const panel = useInspectorPanel({
34505
34993
  identity: flowId ?? "",
34506
34994
  preferences: store.preferences,
@@ -34559,6 +35047,7 @@ function FlowEditor({ navigationIsland, onRun, onRunStarted, onCloseRuns, onConf
34559
35047
  const opener = useRef();
34560
35048
  useEffect(() => {
34561
35049
  setStartId(void 0);
35050
+ setPngExportOpen(false);
34562
35051
  focusInspectorOnOpen.current = false;
34563
35052
  opener.current = void 0;
34564
35053
  }, [flowId]);
@@ -34628,6 +35117,17 @@ function FlowEditor({ navigationIsland, onRun, onRunStarted, onCloseRuns, onConf
34628
35117
  role: "region",
34629
35118
  tabIndex: 0,
34630
35119
  children: [
35120
+ /* @__PURE__ */ jsx(PngExportDialog, {
35121
+ container: portalRoot,
35122
+ defaultDark: theme === "dark",
35123
+ direction: designer.direction,
35124
+ onDownload: (result) => store.downloadPng(result),
35125
+ onOpenChange: setPngExportOpen,
35126
+ open: pngExportOpen,
35127
+ preferences: store.preferences,
35128
+ render: renderPng,
35129
+ title: currentFlow?.name ?? flowId ?? "Workflow"
35130
+ }),
34631
35131
  flowId != null && stateOpen && /* @__PURE__ */ jsx(FlowStateButton, {
34632
35132
  client: store.state,
34633
35133
  flowId,
@@ -34672,11 +35172,7 @@ function FlowEditor({ navigationIsland, onRun, onRunStarted, onCloseRuns, onConf
34672
35172
  },
34673
35173
  open: diagnosticsOpen
34674
35174
  }), /* @__PURE__ */ jsx(WorkspacePublishIsland, {
34675
- onExportPng: connectorAccess.access?.mode != "selectable" || designer.nodes.length == 0 ? void 0 : (options) => store.exportPng(language, {
34676
- ...options,
34677
- ignoredNodeIds
34678
- }),
34679
- preferences: store.preferences,
35175
+ onOpenPngExport: connectorAccess.access?.mode != "selectable" || designer.nodes.length == 0 ? void 0 : () => setPngExportOpen(true),
34680
35176
  onExport: () => {
34681
35177
  const id = store.workspace.$.flowId.value;
34682
35178
  if (id != null) store.workspace.exportFlow(id);
@@ -34994,6 +35490,7 @@ function FlowWorkspace({ hrefFor, navigation, onConfigureConnector, onManageConn
34994
35490
  })
34995
35491
  })
34996
35492
  }) : view == "design" ? /* @__PURE__ */ jsx(FlowEditor, {
35493
+ portalRoot: transferContainer,
34997
35494
  navigationIsland,
34998
35495
  onRun: (triggerId) => void run(triggerId),
34999
35496
  onRunStarted: revealRun,