@oomol-lab/open-flow 0.1.0-beta.81 → 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.
Files changed (52) hide show
  1. package/README.md +35 -0
  2. package/dist/browser/{FlowCanvas-CrsiDHK8.js → FlowCanvas-ChbukrDh.js} +879 -535
  3. package/dist/browser/{createResourceDialog-CS3u9ga9.js → createResourceDialog-Bi4fUnbD.js} +5 -4
  4. package/dist/browser/{dialog-CFlvkliO.js → dialog-BzoSxhXQ.js} +1 -1
  5. package/dist/browser/{exportPng-BOPfjeEi.js → exportPng-CrAFfOaD.js} +187 -70
  6. package/dist/browser/{flowChanges-CFj5pL4Y.js → flowChanges-C567g-Pc.js} +2675 -93
  7. package/dist/browser/{flowWorkspace-BeQaeJ3e.js → flowWorkspace-rvcneG4q.js} +980 -2621
  8. package/dist/browser/licenses.md +2 -2
  9. package/dist/browser/{markdownContent-frwDfQQU.js → markdownContent-B-GLj5DU.js} +18 -40
  10. package/dist/browser/{markdownContent-CAG_CQfH.js → markdownContent-D8G_oNOe.js} +18 -41
  11. package/dist/browser/preview.css +125 -80
  12. package/dist/browser/preview.js +1093 -379
  13. package/dist/browser/{tooltip-BDcVTNpu.js → tooltip-DGj5pudg.js} +1 -1
  14. package/dist/browser/ui.css +45 -0
  15. package/dist/browser/{dist-CHwj9BhV.js → videoLink-NAWDmBtf.js} +35 -1
  16. package/dist/browser/workbench-contract.d.ts +6 -0
  17. package/dist/browser/workbench.css +296 -251
  18. package/dist/browser/workbench.d.ts +2 -0
  19. package/dist/browser/workbench.js +294 -141
  20. package/dist/browser/{workbenchSelect-Ci0KCYv9.js → workbenchSelect-BIaEVTx6.js} +2 -2
  21. package/dist/browser/{ContentIcon-CMn0c-kl.js → wrapLayout-C4moMKgb.js} +4400 -4148
  22. package/dist/command/index.js +43 -41
  23. package/dist/common/authoring.d.ts +1 -1
  24. package/dist/common/control-api-conformance.js +306 -2
  25. package/dist/common/control-api.d.ts +20 -0
  26. package/dist/common/control-api.js +306 -4
  27. package/dist/common/control-requests.d.ts +3 -5
  28. package/dist/common/control-requests.js +5 -7
  29. package/dist/common/flow-encoding.d.ts +1 -0
  30. package/dist/common/flow-encoding.js +167 -1
  31. package/dist/common/flow-semantics.js +20 -0
  32. package/dist/common/flow-workflowBundle.d.ts +27 -0
  33. package/dist/common/flow-workflowFile.d.ts +2 -0
  34. package/dist/common/flow-workflowReferences.d.ts +4 -0
  35. package/dist/common/mcp.d.ts +2 -0
  36. package/dist/common/mcp.js +312 -4
  37. package/dist/render/browser/licenses.md +4047 -0
  38. package/dist/render/browser/runtime.css +14914 -0
  39. package/dist/render/browser/runtime.js +267526 -0
  40. package/dist/render/common/png.d.ts +32 -0
  41. package/dist/render/node/index.d.ts +11 -0
  42. package/dist/render/node/index.js +9508 -0
  43. package/dist/render/node/licenses.md +75 -0
  44. package/package.json +12 -2
  45. package/src/control/common/api.ts +50 -0
  46. package/src/control/common/flowDecoders.ts +2 -0
  47. package/src/control/common/mcp.ts +4 -4
  48. package/src/control/common/requests.ts +12 -1
  49. package/src/flow/common/encoding.ts +1 -0
  50. package/src/flow/common/workflowBundle.ts +117 -0
  51. package/src/flow/common/workflowFile.ts +4 -0
  52. package/src/flow/common/workflowReferences.ts +20 -0
@@ -1,15 +1,14 @@
1
- import { i as __require, o as __toESM, r as __exportAll, t as __commonJSMin } from "./rolldown-runtime-CEgmsyvS.js";
2
- import { A as DropdownMenuSeparator, C as DropdownMenuCheckboxItem, D as DropdownMenuLabel, E as DropdownMenuItem, M as DropdownMenuSubContent, N as DropdownMenuSubTrigger, O as DropdownMenuRadioGroup, P as DropdownMenuTrigger, R as useCompositeItem, S as DropdownMenu, T as DropdownMenuGroup, X as waitBranchDescription, _ as PopoverTrigger, b as VirtualScrollArea, c as useIconifyData, ct as useAriaLabelledBy, d as Popover, f as PopoverContent, g as PopoverTitle, h as PopoverPanelContent, j as DropdownMenuSub, k as DropdownMenuRadioItem, m as PopoverHeader, o as IconifyProvider, p as PopoverDescription, s as useIconifyCollectionLoader, st as Checkbox, t as ContentIcon, v as NativeScrollArea, w as DropdownMenuContent, x as Z$1, y as ScrollArea } from "./ContentIcon-CMn0c-kl.js";
1
+ import { o as __toESM, r as __exportAll, t as __commonJSMin } from "./rolldown-runtime-CEgmsyvS.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, Dr as EMPTY_ARRAY, En as contains, Er as useRenderElement, Fr as formatErrorMessage, I as useCompositeListItem, In as useTransitionStatus, Ir as mergeProps, Ln as useOpenChangeComplete, Lr as useIsoLayoutEffect, Mn as ownerDocument, Mr as useButton, Nn as useLabelableId, Or as EMPTY_OBJECT, Qt as useStore, Sr as buttonVariants, Tn as activeElement, Tr as clsx, Un as useValueChanged, Wn as createChangeEventDetails, _r as fieldValidityMapping, a as createTooltipHandle, br as useControlled, c as TooltipPositioner, ct as CompositeList, d as TooltipRoot, dr as useFormContext, fr as useRegisterFieldControl, i as TooltipTrigger, jr as useMergedRefs, l as TooltipPortal, lt as inertValue, 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, zn as TransitionStatusDataAttributes, 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 toManifestHandleName, E as isSameViewport, S as toViewEdge, T as isMac, _ as timeZoneOffset, a as NodeHistoryContext, b as CanvasTooltip, c as defaultTriggerIcon, d as formatDuration, f as useDebouncedValue, g as timeZoneLongLabel, h as timeZoneLabel, i as setAddItemId, l as JSONViewer, m as selectableTimeZones, n as CompositeRoot, o as Textarea, p as IconStack, r as ACTIVE_COMPOSITE_ITEM, s as CanvasNodeIcon, t as FlowCanvas, u as collapseAllNested, v as cronDescription, w as toManifestNodeId, x as CanvasStore, y as E$1 } from "./FlowCanvas-CrsiDHK8.js";
8
- import { $ as resourceValue, $n as sourcePort, $t as IdTooltip, A as schemaForEditor, An as EmptyDescription, Ar as controlErrorCode, B as datePickerValue, Bn as EventSourceSetup, D as defaultValueEditorSchema, Dn as InputGroupInput, Dt as diagnosticMessage, E as supportsFeishuChatFilter, En as InputGroupAddon, Er as workflowSelectionTask, F as calendarChange, G as indexAddNodeOptions, H as isDateFormat, I as calendarDate, In as SourceForm, Jn as executionReachableNodes, Kn as decodeResultList, L as dateFromTimeZone, Ln as SourceSelect, M as getDefaultValue, Mn as EmptyMedia, N as isUnconstrainedSchema, Nn as EmptyTitle, O as editorComponent, On as Empty, Ot as diagnosticNodeId, P as typeOfSchema, Pn as Badge, Q as resourceData, Qn as sourceOutputLabel, Qt as WorkflowExportMenuItem, R as dateInTimeZone, Rn as createI18n, Sn as useComboboxRootContext, Sr as workflowAgentTool, St as revisionView, T as feishuResourceKind, Tn as InputGroup, Tr as workflowCapability, V as dateTimeWall, Vn as errorNotice, Xn as resolutionOutputPorts, Y as connectorActionPresentation, Yn as inputSourceCandidates, Z as observeResource, Zn as webhookResponseDiagnostics, Zt as dequal$1, _n as ComboboxInputGroup, _r as securityOptions, _t as actionSummary, an as selectionMenuItemClass, bn as selectors, br as servers, bt as canCancelRun, cn as valueEditor_module_default, dn as ComboboxPopup, dr as triggerConfigValues, dt as loadJson, en as FlowSettingsButton, fn as ComboboxPositioner, fr as inputValue, ft as designerGraph, gn as ComboboxTrigger, gr as openApiTask, gt as triggerNodeIcon, hn as GroupCollectionProvider, hr as openApiFieldIssues, ht as semanticNodeIcon, in as selectionMenuContentClass, it as decodeAppCatalogResponse, j as valueForEditor, jn as EmptyHeader, jr as eventSourceKind, jt as connectionCatalog, k as editorGroups, kn as EmptyContent, kr as ApiError, kt as schemaMismatchMessage, ln as ComboboxItemIndicator, mn as ComboboxList, mr as object$1, mt as nodeTitle, n as agentTool, nr as triggerOutputDefinitions, on as ValueControl, ot as getAppCatalogCache, pn as ComboboxPortal, pr as listOperations, pt as nodeIcon, q as mapSource, rr as isJsonObject, sn as ValueEditorFeedback, tt as provider, un as ComboboxItem, ur as triggerConfigValue, vn as ComboboxInput, vr as selectOperation, vt as providerIcon, wn as followWorkbenchLink, wr as workflowCandidateGroup, xn as useComboboxInputValueContext, xr as sameWorkflowInterface, xt as hasRunFilter, yn as ComboboxRoot, yr as serverAddress, z as datePickerChange, zn as FeishuEventPicker } from "./flowChanges-CFj5pL4Y.js";
9
- import { r as resolveUiLanguage } from "./languages-gYzoQqCi.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";
10
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";
11
10
  import { n as compile, r as validate } from "./flowRunInputEditorStore-ys1-w9GW.js";
12
- import { t as WorkbenchSelect } from "./workbenchSelect-Ci0KCYv9.js";
11
+ import { t as WorkbenchSelect } from "./workbenchSelect-BIaEVTx6.js";
13
12
  import * as React from "react";
14
13
  import reactExports, { Children, Fragment, Suspense, createContext, forwardRef, isValidElement, lazy, memo, useCallback, useContext, useEffect, useId, useImperativeHandle, useLayoutEffect, useMemo, useRef, useState } from "react";
15
14
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
@@ -142,326 +141,6 @@ var ComboboxClear = /*#__PURE__*/ React.forwardRef(function ComboboxClear(compon
142
141
  });
143
142
  if (process.env.NODE_ENV !== "production") ComboboxClear.displayName = "ComboboxClear";
144
143
  //#endregion
145
- //#region ../../node_modules/.bun/@iconify+utils@3.1.4/node_modules/@iconify/utils/lib/icon/defaults.js
146
- /** Default values for dimensions */
147
- var defaultIconDimensions = Object.freeze({
148
- left: 0,
149
- top: 0,
150
- width: 16,
151
- height: 16
152
- });
153
- /** Default values for transformations */
154
- var defaultIconTransformations = Object.freeze({
155
- rotate: 0,
156
- vFlip: false,
157
- hFlip: false
158
- });
159
- /** Default values for all optional IconifyIcon properties */
160
- var defaultIconProps = Object.freeze({
161
- ...defaultIconDimensions,
162
- ...defaultIconTransformations
163
- });
164
- /** Default values for all properties used in ExtendedIconifyIcon */
165
- var defaultExtendedIconProps = Object.freeze({
166
- ...defaultIconProps,
167
- body: "",
168
- hidden: false
169
- });
170
- //#endregion
171
- //#region ../../node_modules/.bun/@iconify+utils@3.1.4/node_modules/@iconify/utils/lib/customisations/defaults.js
172
- /**
173
- * Default icon customisations values
174
- */
175
- var defaultIconSizeCustomisations = Object.freeze({
176
- width: null,
177
- height: null
178
- });
179
- var defaultIconCustomisations = Object.freeze({
180
- ...defaultIconSizeCustomisations,
181
- ...defaultIconTransformations
182
- });
183
- //#endregion
184
- //#region ../../node_modules/.bun/@iconify+utils@3.1.4/node_modules/@iconify/utils/lib/icon/transformations.js
185
- /**
186
- * Merge transformations
187
- */
188
- function mergeIconTransformations(obj1, obj2) {
189
- const result = {};
190
- if (!obj1.hFlip !== !obj2.hFlip) result.hFlip = true;
191
- if (!obj1.vFlip !== !obj2.vFlip) result.vFlip = true;
192
- const rotate = ((obj1.rotate || 0) + (obj2.rotate || 0)) % 4;
193
- if (rotate) result.rotate = rotate;
194
- return result;
195
- }
196
- //#endregion
197
- //#region ../../node_modules/.bun/@iconify+utils@3.1.4/node_modules/@iconify/utils/lib/icon/merge.js
198
- /**
199
- * Merge icon and alias
200
- *
201
- * Can also be used to merge default values and icon
202
- */
203
- function mergeIconData(parent, child) {
204
- const result = mergeIconTransformations(parent, child);
205
- for (const key in defaultExtendedIconProps) if (key in defaultIconTransformations) {
206
- if (key in parent && !(key in result)) result[key] = defaultIconTransformations[key];
207
- } else if (key in child) result[key] = child[key];
208
- else if (key in parent) result[key] = parent[key];
209
- return result;
210
- }
211
- //#endregion
212
- //#region ../../node_modules/.bun/@iconify+utils@3.1.4/node_modules/@iconify/utils/lib/icon-set/tree.js
213
- /**
214
- * Resolve icon set icons
215
- *
216
- * Returns parent icon for each icon
217
- */
218
- function getIconsTree(data, names) {
219
- const icons = data.icons;
220
- const aliases = data.aliases || Object.create(null);
221
- const resolved = Object.create(null);
222
- function resolve(name) {
223
- if (icons[name]) return resolved[name] = [];
224
- if (!(name in resolved)) {
225
- resolved[name] = null;
226
- const parent = aliases[name] && aliases[name].parent;
227
- const value = parent && resolve(parent);
228
- if (value) resolved[name] = [parent].concat(value);
229
- }
230
- return resolved[name];
231
- }
232
- (names || Object.keys(icons).concat(Object.keys(aliases))).forEach(resolve);
233
- return resolved;
234
- }
235
- //#endregion
236
- //#region ../../node_modules/.bun/@iconify+utils@3.1.4/node_modules/@iconify/utils/lib/icon-set/get-icon.js
237
- /**
238
- * Get icon data, using prepared aliases tree
239
- */
240
- function internalGetIconData(data, name, tree) {
241
- const icons = data.icons;
242
- const aliases = data.aliases || Object.create(null);
243
- let currentProps = {};
244
- function parse(name) {
245
- currentProps = mergeIconData(icons[name] || aliases[name], currentProps);
246
- }
247
- parse(name);
248
- tree.forEach(parse);
249
- return mergeIconData(data, currentProps);
250
- }
251
- /**
252
- * Get data for icon
253
- */
254
- function getIconData(data, name) {
255
- if (data.icons[name]) return internalGetIconData(data, name, []);
256
- const tree = getIconsTree(data, [name])[name];
257
- return tree ? internalGetIconData(data, name, tree) : null;
258
- }
259
- //#endregion
260
- //#region ../../node_modules/.bun/@iconify+utils@3.1.4/node_modules/@iconify/utils/lib/svg/size.js
261
- /**
262
- * Regular expressions for calculating dimensions
263
- */
264
- var unitsSplit = /(-?[0-9.]*[0-9]+[0-9.]*)/g;
265
- var unitsTest = /^-?[0-9.]*[0-9]+[0-9.]*$/g;
266
- function calculateSize(size, ratio, precision) {
267
- if (ratio === 1) return size;
268
- precision = precision || 100;
269
- if (typeof size === "number") return Math.ceil(size * ratio * precision) / precision;
270
- if (typeof size !== "string") return size;
271
- const oldParts = size.split(unitsSplit);
272
- if (oldParts === null || !oldParts.length) return size;
273
- const newParts = [];
274
- let code = oldParts.shift();
275
- let isNumber = unitsTest.test(code);
276
- while (true) {
277
- if (isNumber) {
278
- const num = parseFloat(code);
279
- if (isNaN(num)) newParts.push(code);
280
- else newParts.push(Math.ceil(num * ratio * precision) / precision);
281
- } else newParts.push(code);
282
- code = oldParts.shift();
283
- if (code === void 0) return newParts.join("");
284
- isNumber = !isNumber;
285
- }
286
- }
287
- //#endregion
288
- //#region ../../node_modules/.bun/@iconify+utils@3.1.4/node_modules/@iconify/utils/lib/svg/defs.js
289
- function splitSVGDefs(content, tag = "defs") {
290
- let defs = "";
291
- const index = content.indexOf("<" + tag);
292
- while (index >= 0) {
293
- const start = content.indexOf(">", index);
294
- const end = content.indexOf("</" + tag);
295
- if (start === -1 || end === -1) break;
296
- const endEnd = content.indexOf(">", end);
297
- if (endEnd === -1) break;
298
- defs += content.slice(start + 1, end).trim();
299
- content = content.slice(0, index).trim() + content.slice(endEnd + 1);
300
- }
301
- return {
302
- defs,
303
- content
304
- };
305
- }
306
- /**
307
- * Merge defs and content
308
- */
309
- function mergeDefsAndContent(defs, content) {
310
- return defs ? "<defs>" + defs + "</defs>" + content : content;
311
- }
312
- /**
313
- * Wrap SVG content, without wrapping definitions
314
- */
315
- function wrapSVGContent(body, start, end) {
316
- const split = splitSVGDefs(body);
317
- return mergeDefsAndContent(split.defs, start + split.content + end);
318
- }
319
- //#endregion
320
- //#region ../../node_modules/.bun/@iconify+utils@3.1.4/node_modules/@iconify/utils/lib/svg/build.js
321
- /**
322
- * Check if value should be unset. Allows multiple keywords
323
- */
324
- var isUnsetKeyword = (value) => value === "unset" || value === "undefined" || value === "none";
325
- /**
326
- * Get SVG attributes and content from icon + customisations
327
- *
328
- * Does not generate style to make it compatible with frameworks that use objects for style, such as React.
329
- * Instead, it generates 'inline' value. If true, rendering engine should add verticalAlign: -0.125em to icon.
330
- *
331
- * Customisations should be normalised by platform specific parser.
332
- * Result should be converted to <svg> by platform specific parser.
333
- * Use replaceIDs to generate unique IDs for body.
334
- */
335
- function iconToSVG(icon, customisations) {
336
- const fullIcon = {
337
- ...defaultIconProps,
338
- ...icon
339
- };
340
- const fullCustomisations = {
341
- ...defaultIconCustomisations,
342
- ...customisations
343
- };
344
- const box = {
345
- left: fullIcon.left,
346
- top: fullIcon.top,
347
- width: fullIcon.width,
348
- height: fullIcon.height
349
- };
350
- let body = fullIcon.body;
351
- [fullIcon, fullCustomisations].forEach((props) => {
352
- const transformations = [];
353
- const hFlip = props.hFlip;
354
- const vFlip = props.vFlip;
355
- let rotation = props.rotate;
356
- if (hFlip) if (vFlip) rotation += 2;
357
- else {
358
- transformations.push("translate(" + (box.width + box.left).toString() + " " + (0 - box.top).toString() + ")");
359
- transformations.push("scale(-1 1)");
360
- box.top = box.left = 0;
361
- }
362
- else if (vFlip) {
363
- transformations.push("translate(" + (0 - box.left).toString() + " " + (box.height + box.top).toString() + ")");
364
- transformations.push("scale(1 -1)");
365
- box.top = box.left = 0;
366
- }
367
- let tempValue;
368
- if (rotation < 0) rotation -= Math.floor(rotation / 4) * 4;
369
- rotation = rotation % 4;
370
- switch (rotation) {
371
- case 1:
372
- tempValue = box.height / 2 + box.top;
373
- transformations.unshift("rotate(90 " + tempValue.toString() + " " + tempValue.toString() + ")");
374
- break;
375
- case 2:
376
- transformations.unshift("rotate(180 " + (box.width / 2 + box.left).toString() + " " + (box.height / 2 + box.top).toString() + ")");
377
- break;
378
- case 3:
379
- tempValue = box.width / 2 + box.left;
380
- transformations.unshift("rotate(-90 " + tempValue.toString() + " " + tempValue.toString() + ")");
381
- }
382
- if (rotation % 2 === 1) {
383
- if (box.left !== box.top) {
384
- tempValue = box.left;
385
- box.left = box.top;
386
- box.top = tempValue;
387
- }
388
- if (box.width !== box.height) {
389
- tempValue = box.width;
390
- box.width = box.height;
391
- box.height = tempValue;
392
- }
393
- }
394
- if (transformations.length) body = wrapSVGContent(body, "<g transform=\"" + transformations.join(" ") + "\">", "</g>");
395
- });
396
- const customisationsWidth = fullCustomisations.width;
397
- const customisationsHeight = fullCustomisations.height;
398
- const boxWidth = box.width;
399
- const boxHeight = box.height;
400
- let width;
401
- let height;
402
- if (customisationsWidth === null) {
403
- height = customisationsHeight === null ? "1em" : customisationsHeight === "auto" ? boxHeight : customisationsHeight;
404
- width = calculateSize(height, boxWidth / boxHeight);
405
- } else {
406
- width = customisationsWidth === "auto" ? boxWidth : customisationsWidth;
407
- height = customisationsHeight === null ? calculateSize(width, boxHeight / boxWidth) : customisationsHeight === "auto" ? boxHeight : customisationsHeight;
408
- }
409
- const attributes = {};
410
- const setAttr = (prop, value) => {
411
- if (!isUnsetKeyword(value)) attributes[prop] = value.toString();
412
- };
413
- setAttr("width", width);
414
- setAttr("height", height);
415
- const viewBox = [
416
- box.left,
417
- box.top,
418
- boxWidth,
419
- boxHeight
420
- ];
421
- attributes.viewBox = viewBox.join(" ");
422
- return {
423
- attributes,
424
- viewBox,
425
- body
426
- };
427
- }
428
- //#endregion
429
- //#region ../../node_modules/.bun/@iconify+utils@3.1.4/node_modules/@iconify/utils/lib/svg/id.js
430
- /**
431
- * Regular expression for finding ids
432
- */
433
- var regex = /\sid="(\S+)"/g;
434
- /**
435
- * Counters
436
- */
437
- var counters = /* @__PURE__ */ new Map();
438
- /**
439
- * Get unique new ID
440
- */
441
- function nextID(id) {
442
- id = id.replace(/[0-9]+$/, "") || "a";
443
- const count = counters.get(id) || 0;
444
- counters.set(id, count + 1);
445
- return count ? `${id}${count}` : id;
446
- }
447
- /**
448
- * Replace IDs in SVG output with unique IDs
449
- */
450
- function replaceIDs(body) {
451
- const ids = [];
452
- let match;
453
- while (match = regex.exec(body)) ids.push(match[1]);
454
- if (!ids.length) return body;
455
- const suffix = "suffix" + (Math.random() * 16777216 | Date.now()).toString(16);
456
- ids.forEach((id) => {
457
- const newID = nextID(id);
458
- const escapedID = id.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
459
- body = body.replace(new RegExp("([#;\"])(" + escapedID + ")([\")]|\\.[a-z])", "g"), "$1" + newID + suffix + "$3");
460
- });
461
- body = body.replace(new RegExp(suffix, "g"), "");
462
- return body;
463
- }
464
- //#endregion
465
144
  //#region src/canvas/browser/useIgnoredNodes.ts
466
145
  /** Temporary display state. It does not change the saved graph or execution. */
467
146
  function useIgnoredNodes(identity) {
@@ -551,603 +230,8 @@ function CanvasHistoryScope({ history, disabled, ...props }) {
551
230
  });
552
231
  }
553
232
  //#endregion
554
- //#region ../../node_modules/.bun/@base-ui+react@1.4.1+fa6c2f29eeb10566/node_modules/@base-ui/react/esm/tabs/root/TabsRootContext.js
555
- /**
556
- * @internal
557
- */
558
- var TabsRootContext = /*#__PURE__*/ React.createContext(void 0);
559
- if (process.env.NODE_ENV !== "production") TabsRootContext.displayName = "TabsRootContext";
560
- function useTabsRootContext() {
561
- const context = React.useContext(TabsRootContext);
562
- if (context === void 0) throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: TabsRootContext is missing. Tabs parts must be placed within <Tabs.Root>." : formatErrorMessage(64));
563
- return context;
564
- }
565
- //#endregion
566
- //#region ../../node_modules/.bun/@base-ui+react@1.4.1+fa6c2f29eeb10566/node_modules/@base-ui/react/esm/tabs/root/TabsRootDataAttributes.js
567
- var TabsRootDataAttributes = /*#__PURE__*/ function(TabsRootDataAttributes) {
568
- /**
569
- * Indicates the direction of the activation (based on the previous active tab).
570
- * @type {'left' | 'right' | 'up' | 'down' | 'none'}
571
- */
572
- TabsRootDataAttributes["activationDirection"] = "data-activation-direction";
573
- /**
574
- * Indicates the orientation of the tabs.
575
- * @type {'horizontal' | 'vertical'}
576
- */
577
- TabsRootDataAttributes["orientation"] = "data-orientation";
578
- return TabsRootDataAttributes;
579
- }({});
580
- //#endregion
581
- //#region ../../node_modules/.bun/@base-ui+react@1.4.1+fa6c2f29eeb10566/node_modules/@base-ui/react/esm/tabs/root/stateAttributesMapping.js
582
- var tabsStateAttributesMapping = { tabActivationDirection: (dir) => ({ [TabsRootDataAttributes.activationDirection]: dir }) };
583
- //#endregion
584
- //#region ../../node_modules/.bun/@base-ui+react@1.4.1+fa6c2f29eeb10566/node_modules/@base-ui/react/esm/tabs/root/TabsRoot.js
585
- /**
586
- * Groups the tabs and the corresponding panels.
587
- * Renders a `<div>` element.
588
- *
589
- * Documentation: [Base UI Tabs](https://base-ui.com/react/components/tabs)
590
- */
591
- var TabsRoot = /*#__PURE__*/ React.forwardRef(function TabsRoot(componentProps, forwardedRef) {
592
- const { className, defaultValue: defaultValueProp = 0, onValueChange: onValueChangeProp, orientation = "horizontal", render, value: valueProp, style, ...elementProps } = componentProps;
593
- const hasExplicitDefaultValueProp = Object.hasOwn(componentProps, "defaultValue");
594
- const tabPanelRefs = React.useRef([]);
595
- const [mountedTabPanels, setMountedTabPanels] = React.useState(() => /* @__PURE__ */ new Map());
596
- const [value, setValue] = useControlled({
597
- controlled: valueProp,
598
- default: defaultValueProp,
599
- name: "Tabs",
600
- state: "value"
601
- });
602
- const isControlled = valueProp !== void 0;
603
- const [tabMap, setTabMap] = React.useState(() => /* @__PURE__ */ new Map());
604
- const getTabElementBySelectedValue = React.useCallback((selectedValue) => {
605
- if (selectedValue === void 0) return null;
606
- for (const [tabElement, tabMetadata] of tabMap.entries()) if (tabMetadata != null && selectedValue === (tabMetadata.value ?? tabMetadata.index)) return tabElement;
607
- return null;
608
- }, [tabMap]);
609
- const [activationDirectionState, setActivationDirectionState] = React.useState(() => ({
610
- previousValue: value,
611
- tabActivationDirection: "none"
612
- }));
613
- const { previousValue, tabActivationDirection: committedTabActivationDirection } = activationDirectionState;
614
- let tabActivationDirection = committedTabActivationDirection;
615
- let directionComputationIncomplete = false;
616
- if (previousValue !== value) {
617
- tabActivationDirection = computeActivationDirection(previousValue, value, orientation, tabMap);
618
- directionComputationIncomplete = previousValue != null && value != null && getTabElementBySelectedValue(value) == null;
619
- }
620
- const nextPreviousValue = directionComputationIncomplete ? previousValue : value;
621
- const shouldSyncActivationDirectionState = previousValue !== nextPreviousValue || committedTabActivationDirection !== tabActivationDirection;
622
- useIsoLayoutEffect(() => {
623
- if (!shouldSyncActivationDirectionState) return;
624
- setActivationDirectionState({
625
- previousValue: nextPreviousValue,
626
- tabActivationDirection
627
- });
628
- }, [
629
- nextPreviousValue,
630
- shouldSyncActivationDirectionState,
631
- tabActivationDirection
632
- ]);
633
- const onValueChange = useStableCallback((newValue, eventDetails) => {
634
- eventDetails.activationDirection = computeActivationDirection(value, newValue, orientation, tabMap);
635
- onValueChangeProp?.(newValue, eventDetails);
636
- if (eventDetails.isCanceled) return;
637
- setValue(newValue);
638
- });
639
- const registerMountedTabPanel = useStableCallback((panelValue, panelId) => {
640
- setMountedTabPanels((prev) => {
641
- if (prev.get(panelValue) === panelId) return prev;
642
- const next = new Map(prev);
643
- next.set(panelValue, panelId);
644
- return next;
645
- });
646
- });
647
- const unregisterMountedTabPanel = useStableCallback((panelValue, panelId) => {
648
- setMountedTabPanels((prev) => {
649
- if (!prev.has(panelValue) || prev.get(panelValue) !== panelId) return prev;
650
- const next = new Map(prev);
651
- next.delete(panelValue);
652
- return next;
653
- });
654
- });
655
- const getTabPanelIdByValue = React.useCallback((tabValue) => {
656
- return mountedTabPanels.get(tabValue);
657
- }, [mountedTabPanels]);
658
- const getTabIdByPanelValue = React.useCallback((tabPanelValue) => {
659
- for (const tabMetadata of tabMap.values()) if (tabPanelValue === tabMetadata?.value) return tabMetadata?.id;
660
- }, [tabMap]);
661
- const tabsContextValue = React.useMemo(() => ({
662
- getTabElementBySelectedValue,
663
- getTabIdByPanelValue,
664
- getTabPanelIdByValue,
665
- onValueChange,
666
- orientation,
667
- registerMountedTabPanel,
668
- setTabMap,
669
- unregisterMountedTabPanel,
670
- tabActivationDirection,
671
- value
672
- }), [
673
- getTabElementBySelectedValue,
674
- getTabIdByPanelValue,
675
- getTabPanelIdByValue,
676
- onValueChange,
677
- orientation,
678
- registerMountedTabPanel,
679
- setTabMap,
680
- unregisterMountedTabPanel,
681
- tabActivationDirection,
682
- value
683
- ]);
684
- const selectedTabMetadata = React.useMemo(() => {
685
- for (const tabMetadata of tabMap.values()) if (tabMetadata != null && tabMetadata.value === value) return tabMetadata;
686
- }, [tabMap, value]);
687
- const firstEnabledTabValue = React.useMemo(() => {
688
- for (const tabMetadata of tabMap.values()) if (tabMetadata != null && !tabMetadata.disabled) return tabMetadata.value;
689
- }, [tabMap]);
690
- useIsoLayoutEffect(() => {
691
- if (isControlled || tabMap.size === 0) return;
692
- const selectionIsDisabled = selectedTabMetadata?.disabled;
693
- const selectionIsMissing = selectedTabMetadata == null && value !== null;
694
- if (hasExplicitDefaultValueProp && selectionIsDisabled && value === defaultValueProp) return;
695
- if (!selectionIsDisabled && !selectionIsMissing) return;
696
- const fallbackValue = firstEnabledTabValue ?? null;
697
- if (value === fallbackValue) return;
698
- setValue(fallbackValue);
699
- setActivationDirectionState((prev) => {
700
- if (prev.tabActivationDirection === "none") return prev;
701
- return {
702
- ...prev,
703
- tabActivationDirection: "none"
704
- };
705
- });
706
- }, [
707
- defaultValueProp,
708
- firstEnabledTabValue,
709
- hasExplicitDefaultValueProp,
710
- isControlled,
711
- selectedTabMetadata,
712
- setValue,
713
- tabMap,
714
- value
715
- ]);
716
- const element = useRenderElement("div", componentProps, {
717
- state: {
718
- orientation,
719
- tabActivationDirection
720
- },
721
- ref: forwardedRef,
722
- props: elementProps,
723
- stateAttributesMapping: tabsStateAttributesMapping
724
- });
725
- return /*#__PURE__*/ jsx(TabsRootContext.Provider, {
726
- value: tabsContextValue,
727
- children: /*#__PURE__*/ jsx(CompositeList, {
728
- elementsRef: tabPanelRefs,
729
- children: element
730
- })
731
- });
732
- });
733
- if (process.env.NODE_ENV !== "production") TabsRoot.displayName = "TabsRoot";
734
- function computeActivationDirection(oldValue, newValue, orientation, tabMap) {
735
- if (oldValue == null || newValue == null) return "none";
736
- let oldTab = null;
737
- let newTab = null;
738
- for (const [tabElement, tabMetadata] of tabMap.entries()) {
739
- if (tabMetadata == null) continue;
740
- const tabValue = tabMetadata.value ?? tabMetadata.index;
741
- if (oldValue === tabValue) oldTab = tabElement;
742
- if (newValue === tabValue) newTab = tabElement;
743
- if (oldTab != null && newTab != null) break;
744
- }
745
- if (oldTab == null || newTab == null) {
746
- if (oldTab !== newTab && (typeof oldValue === "number" || typeof oldValue === "string") && typeof oldValue === typeof newValue) {
747
- if (orientation === "horizontal") return newValue > oldValue ? "right" : "left";
748
- return newValue > oldValue ? "down" : "up";
749
- }
750
- return "none";
751
- }
752
- const oldRect = oldTab.getBoundingClientRect();
753
- const newRect = newTab.getBoundingClientRect();
754
- if (orientation === "horizontal") {
755
- if (newRect.left < oldRect.left) return "left";
756
- if (newRect.left > oldRect.left) return "right";
757
- } else {
758
- if (newRect.top < oldRect.top) return "up";
759
- if (newRect.top > oldRect.top) return "down";
760
- }
761
- return "none";
762
- }
763
- //#endregion
764
- //#region ../../node_modules/.bun/@base-ui+react@1.4.1+fa6c2f29eeb10566/node_modules/@base-ui/react/esm/tabs/list/TabsListContext.js
765
- var TabsListContext = /*#__PURE__*/ React.createContext(void 0);
766
- if (process.env.NODE_ENV !== "production") TabsListContext.displayName = "TabsListContext";
767
- function useTabsListContext() {
768
- const context = React.useContext(TabsListContext);
769
- if (context === void 0) throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: TabsListContext is missing. TabsList parts must be placed within <Tabs.List>." : formatErrorMessage(65));
770
- return context;
771
- }
772
- //#endregion
773
- //#region ../../node_modules/.bun/@base-ui+react@1.4.1+fa6c2f29eeb10566/node_modules/@base-ui/react/esm/tabs/tab/TabsTab.js
774
- /**
775
- * An individual interactive tab button that toggles the corresponding panel.
776
- * Renders a `<button>` element.
777
- *
778
- * Documentation: [Base UI Tabs](https://base-ui.com/react/components/tabs)
779
- */
780
- var TabsTab = /*#__PURE__*/ React.forwardRef(function TabsTab(componentProps, forwardedRef) {
781
- const { className, disabled = false, render, value, id: idProp, nativeButton = true, style, ...elementProps } = componentProps;
782
- const { value: activeTabValue, getTabPanelIdByValue, orientation } = useTabsRootContext();
783
- const { activateOnFocus, highlightedTabIndex, onTabActivation, registerTabResizeObserverElement, setHighlightedTabIndex, tabsListElement } = useTabsListContext();
784
- const id = useBaseUiId(idProp);
785
- const tabMetadata = React.useMemo(() => ({
786
- disabled,
787
- id,
788
- value
789
- }), [
790
- disabled,
791
- id,
792
- value
793
- ]);
794
- const { compositeProps, compositeRef, index } = useCompositeItem({ metadata: tabMetadata });
795
- const active = value === activeTabValue;
796
- const isNavigatingRef = React.useRef(false);
797
- const tabElementRef = React.useRef(null);
798
- React.useEffect(() => {
799
- const tabElement = tabElementRef.current;
800
- if (!tabElement) return;
801
- return registerTabResizeObserverElement(tabElement);
802
- }, [registerTabResizeObserverElement]);
803
- useIsoLayoutEffect(() => {
804
- if (isNavigatingRef.current) {
805
- isNavigatingRef.current = false;
806
- return;
807
- }
808
- if (!(active && index > -1 && highlightedTabIndex !== index)) return;
809
- const listElement = tabsListElement;
810
- if (listElement != null) {
811
- const activeEl = activeElement(ownerDocument(listElement));
812
- if (activeEl && contains(listElement, activeEl)) return;
813
- }
814
- if (!disabled) setHighlightedTabIndex(index);
815
- }, [
816
- active,
817
- index,
818
- highlightedTabIndex,
819
- setHighlightedTabIndex,
820
- disabled,
821
- tabsListElement
822
- ]);
823
- const { getButtonProps, buttonRef } = useButton({
824
- disabled,
825
- native: nativeButton,
826
- focusableWhenDisabled: true
827
- });
828
- const tabPanelId = getTabPanelIdByValue(value);
829
- const isPressingRef = React.useRef(false);
830
- const isMainButtonRef = React.useRef(false);
831
- function onClick(event) {
832
- if (active || disabled) return;
833
- onTabActivation(value, createChangeEventDetails(none, event.nativeEvent, void 0, { activationDirection: "none" }));
834
- }
835
- function onFocus(event) {
836
- if (active) return;
837
- if (index > -1 && !disabled) setHighlightedTabIndex(index);
838
- if (disabled) return;
839
- if (activateOnFocus && (!isPressingRef.current || isPressingRef.current && isMainButtonRef.current)) onTabActivation(value, createChangeEventDetails(none, event.nativeEvent, void 0, { activationDirection: "none" }));
840
- }
841
- function onPointerDown(event) {
842
- if (active || disabled) return;
843
- isPressingRef.current = true;
844
- function handlePointerUp() {
845
- isPressingRef.current = false;
846
- isMainButtonRef.current = false;
847
- }
848
- if (!event.button || event.button === 0) {
849
- isMainButtonRef.current = true;
850
- ownerDocument(event.currentTarget).addEventListener("pointerup", handlePointerUp, { once: true });
851
- }
852
- }
853
- return useRenderElement("button", componentProps, {
854
- state: {
855
- disabled,
856
- active,
857
- orientation
858
- },
859
- ref: [
860
- forwardedRef,
861
- buttonRef,
862
- compositeRef,
863
- tabElementRef
864
- ],
865
- props: [
866
- compositeProps,
867
- {
868
- role: "tab",
869
- "aria-controls": tabPanelId,
870
- "aria-selected": active,
871
- id,
872
- onClick,
873
- onFocus,
874
- onPointerDown,
875
- [ACTIVE_COMPOSITE_ITEM]: active ? "" : void 0,
876
- onKeyDownCapture() {
877
- isNavigatingRef.current = true;
878
- }
879
- },
880
- elementProps,
881
- getButtonProps
882
- ]
883
- });
884
- });
885
- if (process.env.NODE_ENV !== "production") TabsTab.displayName = "TabsTab";
886
- //#endregion
887
- //#region ../../node_modules/.bun/@base-ui+react@1.4.1+fa6c2f29eeb10566/node_modules/@base-ui/react/esm/tabs/panel/TabsPanelDataAttributes.js
888
- var TabsPanelDataAttributes = function(TabsPanelDataAttributes) {
889
- /**
890
- * Indicates the index of the tab panel.
891
- */
892
- TabsPanelDataAttributes["index"] = "data-index";
893
- /**
894
- * Indicates the direction of the activation (based on the previous active tab).
895
- * @type {'left' | 'right' | 'up' | 'down' | 'none'}
896
- */
897
- TabsPanelDataAttributes["activationDirection"] = "data-activation-direction";
898
- /**
899
- * Indicates the orientation of the tabs.
900
- * @type {'horizontal' | 'vertical'}
901
- */
902
- TabsPanelDataAttributes["orientation"] = "data-orientation";
903
- /**
904
- * Present when the panel is hidden.
905
- */
906
- TabsPanelDataAttributes["hidden"] = "data-hidden";
907
- /**
908
- * Present when the panel is animating in.
909
- */
910
- TabsPanelDataAttributes[TabsPanelDataAttributes["startingStyle"] = TransitionStatusDataAttributes.startingStyle] = "startingStyle";
911
- /**
912
- * Present when the panel is animating out.
913
- */
914
- TabsPanelDataAttributes[TabsPanelDataAttributes["endingStyle"] = TransitionStatusDataAttributes.endingStyle] = "endingStyle";
915
- return TabsPanelDataAttributes;
916
- }({});
917
- //#endregion
918
- //#region ../../node_modules/.bun/@base-ui+react@1.4.1+fa6c2f29eeb10566/node_modules/@base-ui/react/esm/tabs/panel/TabsPanel.js
919
- var stateAttributesMapping$1 = {
920
- ...tabsStateAttributesMapping,
921
- ...transitionStatusMapping
922
- };
923
- /**
924
- * A panel displayed when the corresponding tab is active.
925
- * Renders a `<div>` element.
926
- *
927
- * Documentation: [Base UI Tabs](https://base-ui.com/react/components/tabs)
928
- */
929
- var TabsPanel = /*#__PURE__*/ React.forwardRef(function TabPanel(componentProps, forwardedRef) {
930
- const { className, value, render, keepMounted = false, style, ...elementProps } = componentProps;
931
- const { value: selectedValue, getTabIdByPanelValue, orientation, tabActivationDirection, registerMountedTabPanel, unregisterMountedTabPanel } = useTabsRootContext();
932
- const id = useBaseUiId();
933
- const metadata = React.useMemo(() => ({
934
- id,
935
- value
936
- }), [id, value]);
937
- const { ref: listItemRef, index } = useCompositeListItem({ metadata });
938
- const open = value === selectedValue;
939
- const { mounted, transitionStatus, setMounted } = useTransitionStatus(open);
940
- const hidden = !mounted;
941
- const correspondingTabId = getTabIdByPanelValue(value);
942
- const state = {
943
- hidden,
944
- orientation,
945
- tabActivationDirection,
946
- transitionStatus
947
- };
948
- const panelRef = React.useRef(null);
949
- const element = useRenderElement("div", componentProps, {
950
- state,
951
- ref: [
952
- forwardedRef,
953
- listItemRef,
954
- panelRef
955
- ],
956
- props: [{
957
- "aria-labelledby": correspondingTabId,
958
- hidden,
959
- id,
960
- role: "tabpanel",
961
- tabIndex: open ? 0 : -1,
962
- inert: inertValue(!open),
963
- [TabsPanelDataAttributes.index]: index
964
- }, elementProps],
965
- stateAttributesMapping: stateAttributesMapping$1
966
- });
967
- useOpenChangeComplete({
968
- open,
969
- ref: panelRef,
970
- onComplete() {
971
- if (!open) setMounted(false);
972
- }
973
- });
974
- useIsoLayoutEffect(() => {
975
- if (hidden && !keepMounted) return;
976
- if (id == null) return;
977
- registerMountedTabPanel(value, id);
978
- return () => {
979
- unregisterMountedTabPanel(value, id);
980
- };
981
- }, [
982
- hidden,
983
- keepMounted,
984
- value,
985
- id,
986
- registerMountedTabPanel,
987
- unregisterMountedTabPanel
988
- ]);
989
- if (!(keepMounted || mounted)) return null;
990
- return element;
991
- });
992
- if (process.env.NODE_ENV !== "production") TabsPanel.displayName = "TabsPanel";
993
- //#endregion
994
- //#region ../../node_modules/.bun/@base-ui+react@1.4.1+fa6c2f29eeb10566/node_modules/@base-ui/react/esm/tabs/list/TabsList.js
995
- /**
996
- * Groups the individual tab buttons.
997
- * Renders a `<div>` element.
998
- *
999
- * Documentation: [Base UI Tabs](https://base-ui.com/react/components/tabs)
1000
- */
1001
- var TabsList$1 = /*#__PURE__*/ React.forwardRef(function TabsList(componentProps, forwardedRef) {
1002
- const { activateOnFocus = false, className, loopFocus = true, render, style, ...elementProps } = componentProps;
1003
- const { onValueChange, orientation, value, setTabMap, tabActivationDirection } = useTabsRootContext();
1004
- const [highlightedTabIndex, setHighlightedTabIndex] = React.useState(0);
1005
- const [tabsListElement, setTabsListElement] = React.useState(null);
1006
- const indicatorUpdateListenersRef = React.useRef(/* @__PURE__ */ new Set());
1007
- const tabResizeObserverElementsRef = React.useRef(/* @__PURE__ */ new Set());
1008
- const resizeObserverRef = React.useRef(null);
1009
- const notifyIndicatorUpdateListeners = useStableCallback(() => {
1010
- indicatorUpdateListenersRef.current.forEach((listener) => {
1011
- listener();
1012
- });
1013
- });
1014
- React.useEffect(() => {
1015
- if (typeof ResizeObserver === "undefined") return;
1016
- const resizeObserver = new ResizeObserver(() => {
1017
- if (!indicatorUpdateListenersRef.current.size) return;
1018
- notifyIndicatorUpdateListeners();
1019
- });
1020
- resizeObserverRef.current = resizeObserver;
1021
- if (tabsListElement) resizeObserver.observe(tabsListElement);
1022
- tabResizeObserverElementsRef.current.forEach((element) => {
1023
- resizeObserver.observe(element);
1024
- });
1025
- return () => {
1026
- resizeObserver.disconnect();
1027
- resizeObserverRef.current = null;
1028
- };
1029
- }, [tabsListElement, notifyIndicatorUpdateListeners]);
1030
- const registerIndicatorUpdateListener = useStableCallback((listener) => {
1031
- indicatorUpdateListenersRef.current.add(listener);
1032
- return () => {
1033
- indicatorUpdateListenersRef.current.delete(listener);
1034
- };
1035
- });
1036
- const registerTabResizeObserverElement = useStableCallback((element) => {
1037
- tabResizeObserverElementsRef.current.add(element);
1038
- resizeObserverRef.current?.observe(element);
1039
- return () => {
1040
- tabResizeObserverElementsRef.current.delete(element);
1041
- resizeObserverRef.current?.unobserve(element);
1042
- };
1043
- });
1044
- const onTabActivation = useStableCallback((newValue, eventDetails) => {
1045
- if (newValue !== value) onValueChange(newValue, eventDetails);
1046
- });
1047
- const state = {
1048
- orientation,
1049
- tabActivationDirection
1050
- };
1051
- const defaultProps = {
1052
- "aria-orientation": orientation === "vertical" ? "vertical" : void 0,
1053
- role: "tablist"
1054
- };
1055
- const tabsListContextValue = React.useMemo(() => ({
1056
- activateOnFocus,
1057
- highlightedTabIndex,
1058
- registerIndicatorUpdateListener,
1059
- registerTabResizeObserverElement,
1060
- onTabActivation,
1061
- setHighlightedTabIndex,
1062
- tabsListElement
1063
- }), [
1064
- activateOnFocus,
1065
- highlightedTabIndex,
1066
- registerIndicatorUpdateListener,
1067
- registerTabResizeObserverElement,
1068
- onTabActivation,
1069
- setHighlightedTabIndex,
1070
- tabsListElement
1071
- ]);
1072
- return /*#__PURE__*/ jsx(TabsListContext.Provider, {
1073
- value: tabsListContextValue,
1074
- children: /*#__PURE__*/ jsx(CompositeRoot, {
1075
- render,
1076
- className,
1077
- style,
1078
- state,
1079
- refs: [forwardedRef, setTabsListElement],
1080
- props: [defaultProps, elementProps],
1081
- stateAttributesMapping: tabsStateAttributesMapping,
1082
- highlightedIndex: highlightedTabIndex,
1083
- enableHomeAndEndKeys: true,
1084
- loopFocus,
1085
- orientation,
1086
- onHighlightedIndexChange: setHighlightedTabIndex,
1087
- onMapChange: setTabMap,
1088
- disabledIndices: EMPTY_ARRAY
1089
- })
1090
- });
1091
- });
1092
- if (process.env.NODE_ENV !== "production") TabsList$1.displayName = "TabsList";
1093
- //#endregion
1094
- //#region src/ui/browser/tabs.tsx
1095
- function Tabs({ className, orientation = "horizontal", ...props }) {
1096
- return /* @__PURE__ */ jsx(TabsRoot, {
1097
- "data-slot": "tabs",
1098
- "data-orientation": orientation,
1099
- className: cn("group/tabs flex gap-2 data-[orientation=horizontal]:flex-col", className),
1100
- orientation,
1101
- ...props
1102
- });
1103
- }
1104
- var tabsListVariants = cva("group/tabs-list inline-flex w-fit items-center justify-center rounded-lg text-muted-foreground group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col data-[variant=line]:rounded-none", {
1105
- variants: {
1106
- size: {
1107
- default: "p-[3px] group-data-[orientation=horizontal]/tabs:h-8",
1108
- sm: "rounded-[6px] p-0.5 group-data-[orientation=horizontal]/tabs:h-6"
1109
- },
1110
- variant: {
1111
- default: "bg-muted",
1112
- line: "gap-1 bg-transparent",
1113
- navigation: "gap-1 bg-transparent data-[variant=navigation]:p-0 group-data-[orientation=horizontal]/tabs:data-[variant=navigation]:h-auto",
1114
- flat: "gap-1 bg-[color-mix(in_srgb,var(--ui-foreground)_8%,var(--ui-popover))] dark:bg-[color-mix(in_srgb,black_16%,var(--ui-popover))]"
1115
- }
1116
- },
1117
- defaultVariants: {
1118
- size: "default",
1119
- variant: "default"
1120
- }
1121
- });
1122
- function TabsList({ className, variant = "default", size = "default", ...props }) {
1123
- return /* @__PURE__ */ jsx(TabsList$1, {
1124
- "data-slot": "tabs-list",
1125
- "data-variant": variant,
1126
- "data-size": size,
1127
- className: cn(tabsListVariants({
1128
- variant,
1129
- size
1130
- }), className),
1131
- ...props
1132
- });
1133
- }
1134
- function TabsTrigger({ className, ...props }) {
1135
- return /* @__PURE__ */ jsx(TabsTab, {
1136
- "data-slot": "tabs-trigger",
1137
- className: cn("relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium whitespace-nowrap text-foreground/60 transition-[color,background-color,border-color,box-shadow,opacity] group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start hover:text-foreground focus-visible:border-border 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 has-data-[icon=inline-end]:pr-1 has-data-[icon=inline-start]:pl-1 aria-disabled:pointer-events-none aria-disabled:opacity-50 motion-reduce:transition-none dark:text-muted-foreground dark:hover:text-foreground group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", "group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent", "group-data-[variant=navigation]/tabs-list:h-auto group-data-[variant=navigation]/tabs-list:flex-none group-data-[variant=navigation]/tabs-list:rounded-[6px] group-data-[variant=navigation]/tabs-list:border-0 group-data-[variant=navigation]/tabs-list:px-3 group-data-[variant=navigation]/tabs-list:py-2 group-data-[variant=navigation]/tabs-list:text-[13px] group-data-[variant=navigation]/tabs-list:font-normal group-data-[variant=navigation]/tabs-list:text-muted-foreground group-data-[variant=navigation]/tabs-list:hover:bg-muted group-data-[variant=navigation]/tabs-list:hover:text-foreground group-data-[variant=navigation]/tabs-list:data-active:bg-muted group-data-[variant=navigation]/tabs-list:data-active:font-semibold group-data-[variant=navigation]/tabs-list:data-active:text-foreground dark:group-data-[variant=navigation]/tabs-list:data-active:bg-muted dark:group-data-[variant=navigation]/tabs-list:data-active:text-foreground", "group-data-[variant=flat]/tabs-list:h-full group-data-[variant=flat]/tabs-list:border-0 group-data-[variant=flat]/tabs-list:data-active:bg-popover group-data-[variant=flat]/tabs-list:data-active:shadow-[0_1px_2px_rgb(0_0_0/0.08)] dark:group-data-[variant=flat]/tabs-list:data-active:bg-[color-mix(in_srgb,var(--ui-foreground)_8%,var(--ui-popover))]", "data-active:bg-background data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground", "after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100 motion-reduce:after:transition-none", "group-data-[size=sm]/tabs-list:rounded-[4px] group-data-[size=sm]/tabs-list:gap-1 group-data-[size=sm]/tabs-list:py-0 group-data-[size=sm]/tabs-list:text-[11px] group-data-[size=sm]/tabs-list:leading-4 group-data-[orientation=horizontal]/tabs:group-data-[size=sm]/tabs-list:after:bottom-[-4px]", "group-data-[variant=navigation]/tabs-list:group-data-[size=sm]/tabs-list:rounded-[4px] group-data-[variant=navigation]/tabs-list:group-data-[size=sm]/tabs-list:px-2 group-data-[variant=navigation]/tabs-list:group-data-[size=sm]/tabs-list:py-1 group-data-[variant=navigation]/tabs-list:group-data-[size=sm]/tabs-list:text-[12px]", className),
1138
- ...props
1139
- });
1140
- }
1141
- function TabsContent({ className, ...props }) {
1142
- return /* @__PURE__ */ jsx(TabsPanel, {
1143
- "data-slot": "tabs-content",
1144
- className: cn("flex-1 text-sm outline-none", className),
1145
- ...props
1146
- });
1147
- }
1148
- //#endregion
1149
233
  //#region src/workbench/browser/runtime/editor/commentInspector.tsx
1150
- var MarkdownContent = lazy(() => import("./markdownContent-frwDfQQU.js"));
234
+ var MarkdownContent = lazy(() => import("./markdownContent-B-GLj5DU.js"));
1151
235
  /** A comment is presentation data; editing it does not require the canvas store. */
1152
236
  function CommentInspector({ title, content, disabled = false, readOnly, dark, onSave }) {
1153
237
  const t = useTranslate();
@@ -1189,14 +273,16 @@ function CommentInspector({ title, content, disabled = false, readOnly, dark, on
1189
273
  readOnly,
1190
274
  value: draftContent,
1191
275
  onChange: (event) => setDraftContent(event.target.value),
276
+ onPaste: (event) => pasteVideoLink(event, t),
1192
277
  onBlur: save
1193
278
  })
1194
279
  }),
1195
280
  /* @__PURE__ */ jsx(TabsContent, {
1196
281
  value: "preview",
1197
282
  className: "flex min-h-0 flex-1 flex-col rounded-[var(--ui-control-radius,calc(var(--ui-radius)_+_2px))] border border-[var(--_open-flow-comment-border)] bg-[var(--_open-flow-comment-surface)] p-2",
1198
- children: /* @__PURE__ */ jsx("div", {
1199
- className: "min-h-0 flex-1 overflow-auto rounded-[var(--ui-control-radius,calc(var(--ui-radius)_+_2px))] border border-[color-mix(in_srgb,var(--_open-flow-comment-border)_45%,transparent)] bg-[var(--_open-flow-comment-content)] p-3",
283
+ children: /* @__PURE__ */ jsx(ScrollArea, {
284
+ autoHide: "leave",
285
+ className: "min-h-0 flex-1 rounded-[var(--ui-control-radius,calc(var(--ui-radius)_+_2px))] border border-[color-mix(in_srgb,var(--_open-flow-comment-border)_45%,transparent)] bg-[var(--_open-flow-comment-content)] p-3",
1200
286
  children: /* @__PURE__ */ jsx("div", {
1201
287
  className: "markdown-body min-w-0",
1202
288
  onDoubleClick: () => setSource(true),
@@ -4041,1249 +3127,6 @@ function ContextPanel({ className, layoutRoot, children, focusOnOpen, actions, h
4041
3127
  ]
4042
3128
  })] });
4043
3129
  }
4044
- var IconPicker_module_default = {
4045
- container: "IconPicker_container_1b462",
4046
- filter: "IconPicker_filter_1b462",
4047
- tabs: "IconPicker_tabs_1b462",
4048
- colors: "IconPicker_colors_1b462",
4049
- color: "IconPicker_color_1b462",
4050
- panel: "IconPicker_panel_1b462",
4051
- row: "IconPicker_row_1b462",
4052
- icon: "IconPicker_icon_1b462",
4053
- subtitle: "IconPicker_subtitle_1b462",
4054
- loading: "IconPicker_loading_1b462",
4055
- spin: "IconPicker_spin_1b462"
4056
- };
4057
- //#endregion
4058
- //#region ../../node_modules/.bun/fzf@0.5.2/node_modules/fzf/dist/fzf.es.js
4059
- /** @license
4060
- * fzf v0.5.2
4061
- * Copyright (c) 2021 Ajit
4062
- * Licensed under BSD 3-Clause
4063
- */
4064
- var normalized = {
4065
- 216: "O",
4066
- 223: "s",
4067
- 248: "o",
4068
- 273: "d",
4069
- 295: "h",
4070
- 305: "i",
4071
- 320: "l",
4072
- 322: "l",
4073
- 359: "t",
4074
- 383: "s",
4075
- 384: "b",
4076
- 385: "B",
4077
- 387: "b",
4078
- 390: "O",
4079
- 392: "c",
4080
- 393: "D",
4081
- 394: "D",
4082
- 396: "d",
4083
- 398: "E",
4084
- 400: "E",
4085
- 402: "f",
4086
- 403: "G",
4087
- 407: "I",
4088
- 409: "k",
4089
- 410: "l",
4090
- 412: "M",
4091
- 413: "N",
4092
- 414: "n",
4093
- 415: "O",
4094
- 421: "p",
4095
- 427: "t",
4096
- 429: "t",
4097
- 430: "T",
4098
- 434: "V",
4099
- 436: "y",
4100
- 438: "z",
4101
- 477: "e",
4102
- 485: "g",
4103
- 544: "N",
4104
- 545: "d",
4105
- 549: "z",
4106
- 564: "l",
4107
- 565: "n",
4108
- 566: "t",
4109
- 567: "j",
4110
- 570: "A",
4111
- 571: "C",
4112
- 572: "c",
4113
- 573: "L",
4114
- 574: "T",
4115
- 575: "s",
4116
- 576: "z",
4117
- 579: "B",
4118
- 580: "U",
4119
- 581: "V",
4120
- 582: "E",
4121
- 583: "e",
4122
- 584: "J",
4123
- 585: "j",
4124
- 586: "Q",
4125
- 587: "q",
4126
- 588: "R",
4127
- 589: "r",
4128
- 590: "Y",
4129
- 591: "y",
4130
- 592: "a",
4131
- 593: "a",
4132
- 595: "b",
4133
- 596: "o",
4134
- 597: "c",
4135
- 598: "d",
4136
- 599: "d",
4137
- 600: "e",
4138
- 603: "e",
4139
- 604: "e",
4140
- 605: "e",
4141
- 606: "e",
4142
- 607: "j",
4143
- 608: "g",
4144
- 609: "g",
4145
- 610: "G",
4146
- 613: "h",
4147
- 614: "h",
4148
- 616: "i",
4149
- 618: "I",
4150
- 619: "l",
4151
- 620: "l",
4152
- 621: "l",
4153
- 623: "m",
4154
- 624: "m",
4155
- 625: "m",
4156
- 626: "n",
4157
- 627: "n",
4158
- 628: "N",
4159
- 629: "o",
4160
- 633: "r",
4161
- 634: "r",
4162
- 635: "r",
4163
- 636: "r",
4164
- 637: "r",
4165
- 638: "r",
4166
- 639: "r",
4167
- 640: "R",
4168
- 641: "R",
4169
- 642: "s",
4170
- 647: "t",
4171
- 648: "t",
4172
- 649: "u",
4173
- 651: "v",
4174
- 652: "v",
4175
- 653: "w",
4176
- 654: "y",
4177
- 655: "Y",
4178
- 656: "z",
4179
- 657: "z",
4180
- 663: "c",
4181
- 665: "B",
4182
- 666: "e",
4183
- 667: "G",
4184
- 668: "H",
4185
- 669: "j",
4186
- 670: "k",
4187
- 671: "L",
4188
- 672: "q",
4189
- 686: "h",
4190
- 867: "a",
4191
- 868: "e",
4192
- 869: "i",
4193
- 870: "o",
4194
- 871: "u",
4195
- 872: "c",
4196
- 873: "d",
4197
- 874: "h",
4198
- 875: "m",
4199
- 876: "r",
4200
- 877: "t",
4201
- 878: "v",
4202
- 879: "x",
4203
- 7424: "A",
4204
- 7427: "B",
4205
- 7428: "C",
4206
- 7429: "D",
4207
- 7431: "E",
4208
- 7432: "e",
4209
- 7433: "i",
4210
- 7434: "J",
4211
- 7435: "K",
4212
- 7436: "L",
4213
- 7437: "M",
4214
- 7438: "N",
4215
- 7439: "O",
4216
- 7440: "O",
4217
- 7441: "o",
4218
- 7442: "o",
4219
- 7443: "o",
4220
- 7446: "o",
4221
- 7447: "o",
4222
- 7448: "P",
4223
- 7449: "R",
4224
- 7450: "R",
4225
- 7451: "T",
4226
- 7452: "U",
4227
- 7453: "u",
4228
- 7454: "u",
4229
- 7455: "m",
4230
- 7456: "V",
4231
- 7457: "W",
4232
- 7458: "Z",
4233
- 7522: "i",
4234
- 7523: "r",
4235
- 7524: "u",
4236
- 7525: "v",
4237
- 7834: "a",
4238
- 7835: "s",
4239
- 8305: "i",
4240
- 8341: "h",
4241
- 8342: "k",
4242
- 8343: "l",
4243
- 8344: "m",
4244
- 8345: "n",
4245
- 8346: "p",
4246
- 8347: "s",
4247
- 8348: "t",
4248
- 8580: "c"
4249
- };
4250
- for (let i = "̀".codePointAt(0); i <= "ͯ".codePointAt(0); ++i) {
4251
- const diacritic = String.fromCodePoint(i);
4252
- for (const asciiChar of "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz") {
4253
- const withDiacriticCodePoint = (asciiChar + diacritic).normalize().codePointAt(0);
4254
- if (withDiacriticCodePoint > 126) normalized[withDiacriticCodePoint] = asciiChar;
4255
- }
4256
- }
4257
- var ranges = {
4258
- a: [7844, 7863],
4259
- e: [7870, 7879],
4260
- o: [7888, 7907],
4261
- u: [7912, 7921]
4262
- };
4263
- for (const lowerChar of Object.keys(ranges)) {
4264
- const upperChar = lowerChar.toUpperCase();
4265
- for (let i = ranges[lowerChar][0]; i <= ranges[lowerChar][1]; ++i) normalized[i] = i % 2 === 0 ? upperChar : lowerChar;
4266
- }
4267
- function normalizeRune(rune) {
4268
- if (rune < 192 || rune > 8580) return rune;
4269
- const normalizedChar = normalized[rune];
4270
- if (normalizedChar !== void 0) return normalizedChar.codePointAt(0);
4271
- return rune;
4272
- }
4273
- function toShort(number) {
4274
- return number;
4275
- }
4276
- function toInt(number) {
4277
- return number;
4278
- }
4279
- function maxInt16(num1, num2) {
4280
- return num1 > num2 ? num1 : num2;
4281
- }
4282
- var strToRunes = (str) => str.split("").map((s) => s.codePointAt(0));
4283
- var whitespaceRunes = new Set(" \f\n\r \v\xA0 \u2028\u2029   ".split("").map((v) => v.codePointAt(0)));
4284
- for (let codePoint = " ".codePointAt(0); codePoint <= " ".codePointAt(0); codePoint++) whitespaceRunes.add(codePoint);
4285
- var MAX_ASCII = "".codePointAt(0);
4286
- var CAPITAL_A_RUNE = "A".codePointAt(0);
4287
- var CAPITAL_Z_RUNE = "Z".codePointAt(0);
4288
- var SMALL_A_RUNE = "a".codePointAt(0);
4289
- var SMALL_Z_RUNE = "z".codePointAt(0);
4290
- var NUMERAL_ZERO_RUNE = "0".codePointAt(0);
4291
- var NUMERAL_NINE_RUNE = "9".codePointAt(0);
4292
- function indexAt(index, max, forward) {
4293
- if (forward) return index;
4294
- return max - index - 1;
4295
- }
4296
- var SCORE_MATCH = 16;
4297
- var SCORE_GAP_START = -3;
4298
- var SCORE_GAP_EXTENTION = -1;
4299
- var BONUS_BOUNDARY = SCORE_MATCH / 2;
4300
- var BONUS_NON_WORD = SCORE_MATCH / 2;
4301
- var BONUS_CAMEL_123 = 7;
4302
- var BONUS_CONSECUTIVE = 4;
4303
- var BONUS_FIRST_CHAR_MULTIPLIER = 2;
4304
- function createPosSet(withPos) {
4305
- if (withPos) return /* @__PURE__ */ new Set();
4306
- return null;
4307
- }
4308
- function alloc16(offset, slab2, size) {
4309
- if (slab2 !== null && slab2.i16.length > offset + size) {
4310
- const subarray = slab2.i16.subarray(offset, offset + size);
4311
- return [offset + size, subarray];
4312
- }
4313
- return [offset, new Int16Array(size)];
4314
- }
4315
- function alloc32(offset, slab2, size) {
4316
- if (slab2 !== null && slab2.i32.length > offset + size) {
4317
- const subarray = slab2.i32.subarray(offset, offset + size);
4318
- return [offset + size, subarray];
4319
- }
4320
- return [offset, new Int32Array(size)];
4321
- }
4322
- function charClassOfAscii(rune) {
4323
- if (rune >= SMALL_A_RUNE && rune <= SMALL_Z_RUNE) return 1;
4324
- else if (rune >= CAPITAL_A_RUNE && rune <= CAPITAL_Z_RUNE) return 2;
4325
- else if (rune >= NUMERAL_ZERO_RUNE && rune <= NUMERAL_NINE_RUNE) return 4;
4326
- else return 0;
4327
- }
4328
- function charClassOfNonAscii(rune) {
4329
- const char = String.fromCodePoint(rune);
4330
- if (char !== char.toUpperCase()) return 1;
4331
- else if (char !== char.toLowerCase()) return 2;
4332
- else if (char.match(/\p{Number}/gu) !== null) return 4;
4333
- else if (char.match(/\p{Letter}/gu) !== null) return 3;
4334
- return 0;
4335
- }
4336
- function charClassOf(rune) {
4337
- if (rune <= MAX_ASCII) return charClassOfAscii(rune);
4338
- return charClassOfNonAscii(rune);
4339
- }
4340
- function bonusFor(prevClass, currClass) {
4341
- if (prevClass === 0 && currClass !== 0) return BONUS_BOUNDARY;
4342
- else if (prevClass === 1 && currClass === 2 || prevClass !== 4 && currClass === 4) return BONUS_CAMEL_123;
4343
- else if (currClass === 0) return BONUS_NON_WORD;
4344
- return 0;
4345
- }
4346
- function bonusAt(input, idx) {
4347
- if (idx === 0) return BONUS_BOUNDARY;
4348
- return bonusFor(charClassOf(input[idx - 1]), charClassOf(input[idx]));
4349
- }
4350
- function trySkip(input, caseSensitive, char, from) {
4351
- let rest = input.slice(from);
4352
- let idx = rest.indexOf(char);
4353
- if (idx === 0) return from;
4354
- if (!caseSensitive && char >= SMALL_A_RUNE && char <= SMALL_Z_RUNE) {
4355
- if (idx > 0) rest = rest.slice(0, idx);
4356
- const uidx = rest.indexOf(char - 32);
4357
- if (uidx >= 0) idx = uidx;
4358
- }
4359
- if (idx < 0) return -1;
4360
- return from + idx;
4361
- }
4362
- function isAscii(runes) {
4363
- for (const rune of runes) if (rune >= 128) return false;
4364
- return true;
4365
- }
4366
- function asciiFuzzyIndex(input, pattern, caseSensitive) {
4367
- if (!isAscii(input)) return 0;
4368
- if (!isAscii(pattern)) return -1;
4369
- let firstIdx = 0, idx = 0;
4370
- for (let pidx = 0; pidx < pattern.length; pidx++) {
4371
- idx = trySkip(input, caseSensitive, pattern[pidx], idx);
4372
- if (idx < 0) return -1;
4373
- if (pidx === 0 && idx > 0) firstIdx = idx - 1;
4374
- idx++;
4375
- }
4376
- return firstIdx;
4377
- }
4378
- var fuzzyMatchV2 = (caseSensitive, normalize, forward, input, pattern, withPos, slab2) => {
4379
- const M = pattern.length;
4380
- if (M === 0) return [{
4381
- start: 0,
4382
- end: 0,
4383
- score: 0
4384
- }, createPosSet(withPos)];
4385
- const N = input.length;
4386
- if (slab2 !== null && N * M > slab2.i16.length) return fuzzyMatchV1(caseSensitive, normalize, forward, input, pattern, withPos);
4387
- const idx = asciiFuzzyIndex(input, pattern, caseSensitive);
4388
- if (idx < 0) return [{
4389
- start: -1,
4390
- end: -1,
4391
- score: 0
4392
- }, null];
4393
- let offset16 = 0, offset32 = 0, H0 = null, C0 = null, B = null, F = null;
4394
- [offset16, H0] = alloc16(offset16, slab2, N);
4395
- [offset16, C0] = alloc16(offset16, slab2, N);
4396
- [offset16, B] = alloc16(offset16, slab2, N);
4397
- [offset32, F] = alloc32(offset32, slab2, M);
4398
- const [, T] = alloc32(offset32, slab2, N);
4399
- for (let i = 0; i < T.length; i++) T[i] = input[i];
4400
- let maxScore = toShort(0), maxScorePos = 0;
4401
- let pidx = 0, lastIdx = 0;
4402
- const pchar0 = pattern[0];
4403
- let pchar = pattern[0], prevH0 = toShort(0), prevCharClass = 0, inGap = false;
4404
- let Tsub = T.subarray(idx);
4405
- let H0sub = H0.subarray(idx).subarray(0, Tsub.length), C0sub = C0.subarray(idx).subarray(0, Tsub.length), Bsub = B.subarray(idx).subarray(0, Tsub.length);
4406
- for (let [off, char] of Tsub.entries()) {
4407
- let charClass = null;
4408
- if (char <= MAX_ASCII) {
4409
- charClass = charClassOfAscii(char);
4410
- if (!caseSensitive && charClass === 2) char += 32;
4411
- } else {
4412
- charClass = charClassOfNonAscii(char);
4413
- if (!caseSensitive && charClass === 2) char = String.fromCodePoint(char).toLowerCase().codePointAt(0);
4414
- if (normalize) char = normalizeRune(char);
4415
- }
4416
- Tsub[off] = char;
4417
- const bonus = bonusFor(prevCharClass, charClass);
4418
- Bsub[off] = bonus;
4419
- prevCharClass = charClass;
4420
- if (char === pchar) {
4421
- if (pidx < M) {
4422
- F[pidx] = toInt(idx + off);
4423
- pidx++;
4424
- pchar = pattern[Math.min(pidx, M - 1)];
4425
- }
4426
- lastIdx = idx + off;
4427
- }
4428
- if (char === pchar0) {
4429
- const score = SCORE_MATCH + bonus * BONUS_FIRST_CHAR_MULTIPLIER;
4430
- H0sub[off] = score;
4431
- C0sub[off] = 1;
4432
- if (M === 1 && (forward && score > maxScore || !forward && score >= maxScore)) {
4433
- maxScore = score;
4434
- maxScorePos = idx + off;
4435
- if (forward && bonus === BONUS_BOUNDARY) break;
4436
- }
4437
- inGap = false;
4438
- } else {
4439
- if (inGap) H0sub[off] = maxInt16(prevH0 + SCORE_GAP_EXTENTION, 0);
4440
- else H0sub[off] = maxInt16(prevH0 + SCORE_GAP_START, 0);
4441
- C0sub[off] = 0;
4442
- inGap = true;
4443
- }
4444
- prevH0 = H0sub[off];
4445
- }
4446
- if (pidx !== M) return [{
4447
- start: -1,
4448
- end: -1,
4449
- score: 0
4450
- }, null];
4451
- if (M === 1) {
4452
- const result = {
4453
- start: maxScorePos,
4454
- end: maxScorePos + 1,
4455
- score: maxScore
4456
- };
4457
- if (!withPos) return [result, null];
4458
- const pos2 = /* @__PURE__ */ new Set();
4459
- pos2.add(maxScorePos);
4460
- return [result, pos2];
4461
- }
4462
- const f0 = F[0];
4463
- const width = lastIdx - f0 + 1;
4464
- let H = null;
4465
- [offset16, H] = alloc16(offset16, slab2, width * M);
4466
- {
4467
- const toCopy = H0.subarray(f0, lastIdx + 1);
4468
- for (const [i, v] of toCopy.entries()) H[i] = v;
4469
- }
4470
- let [, C] = alloc16(offset16, slab2, width * M);
4471
- {
4472
- const toCopy = C0.subarray(f0, lastIdx + 1);
4473
- for (const [i, v] of toCopy.entries()) C[i] = v;
4474
- }
4475
- const Fsub = F.subarray(1);
4476
- const Psub = pattern.slice(1).slice(0, Fsub.length);
4477
- for (const [off, f] of Fsub.entries()) {
4478
- let inGap2 = false;
4479
- const pchar2 = Psub[off], pidx2 = off + 1, row = pidx2 * width, Tsub2 = T.subarray(f, lastIdx + 1), Bsub2 = B.subarray(f).subarray(0, Tsub2.length), Csub = C.subarray(row + f - f0).subarray(0, Tsub2.length), Cdiag = C.subarray(row + f - f0 - 1 - width).subarray(0, Tsub2.length), Hsub = H.subarray(row + f - f0).subarray(0, Tsub2.length), Hdiag = H.subarray(row + f - f0 - 1 - width).subarray(0, Tsub2.length), Hleft = H.subarray(row + f - f0 - 1).subarray(0, Tsub2.length);
4480
- Hleft[0] = 0;
4481
- for (const [off2, char] of Tsub2.entries()) {
4482
- const col = off2 + f;
4483
- let s1 = 0, s2 = 0, consecutive = 0;
4484
- if (inGap2) s2 = Hleft[off2] + SCORE_GAP_EXTENTION;
4485
- else s2 = Hleft[off2] + SCORE_GAP_START;
4486
- if (pchar2 === char) {
4487
- s1 = Hdiag[off2] + SCORE_MATCH;
4488
- let b = Bsub2[off2];
4489
- consecutive = Cdiag[off2] + 1;
4490
- if (b === BONUS_BOUNDARY) consecutive = 1;
4491
- else if (consecutive > 1) b = maxInt16(b, maxInt16(BONUS_CONSECUTIVE, B[col - consecutive + 1]));
4492
- if (s1 + b < s2) {
4493
- s1 += Bsub2[off2];
4494
- consecutive = 0;
4495
- } else s1 += b;
4496
- }
4497
- Csub[off2] = consecutive;
4498
- inGap2 = s1 < s2;
4499
- const score = maxInt16(maxInt16(s1, s2), 0);
4500
- if (pidx2 === M - 1 && (forward && score > maxScore || !forward && score >= maxScore)) {
4501
- maxScore = score;
4502
- maxScorePos = col;
4503
- }
4504
- Hsub[off2] = score;
4505
- }
4506
- }
4507
- const pos = createPosSet(withPos);
4508
- let j = f0;
4509
- if (withPos && pos !== null) {
4510
- let i = M - 1;
4511
- j = maxScorePos;
4512
- let preferMatch = true;
4513
- while (true) {
4514
- const I = i * width, j0 = j - f0, s = H[I + j0];
4515
- let s1 = 0, s2 = 0;
4516
- if (i > 0 && j >= F[i]) s1 = H[I - width + j0 - 1];
4517
- if (j > F[i]) s2 = H[I + j0 - 1];
4518
- if (s > s1 && (s > s2 || s === s2 && preferMatch)) {
4519
- pos.add(j);
4520
- if (i === 0) break;
4521
- i--;
4522
- }
4523
- preferMatch = C[I + j0] > 1 || I + width + j0 + 1 < C.length && C[I + width + j0 + 1] > 0;
4524
- j--;
4525
- }
4526
- }
4527
- return [{
4528
- start: j,
4529
- end: maxScorePos + 1,
4530
- score: maxScore
4531
- }, pos];
4532
- };
4533
- function calculateScore(caseSensitive, normalize, text, pattern, sidx, eidx, withPos) {
4534
- let pidx = 0, score = 0, inGap = false, consecutive = 0, firstBonus = toShort(0);
4535
- const pos = createPosSet(withPos);
4536
- let prevCharClass = 0;
4537
- if (sidx > 0) prevCharClass = charClassOf(text[sidx - 1]);
4538
- for (let idx = sidx; idx < eidx; idx++) {
4539
- let rune = text[idx];
4540
- const charClass = charClassOf(rune);
4541
- if (!caseSensitive) {
4542
- if (rune >= CAPITAL_A_RUNE && rune <= CAPITAL_Z_RUNE) rune += 32;
4543
- else if (rune > MAX_ASCII) rune = String.fromCodePoint(rune).toLowerCase().codePointAt(0);
4544
- }
4545
- if (normalize) rune = normalizeRune(rune);
4546
- if (rune === pattern[pidx]) {
4547
- if (withPos && pos !== null) pos.add(idx);
4548
- score += SCORE_MATCH;
4549
- let bonus = bonusFor(prevCharClass, charClass);
4550
- if (consecutive === 0) firstBonus = bonus;
4551
- else {
4552
- if (bonus === BONUS_BOUNDARY) firstBonus = bonus;
4553
- bonus = maxInt16(maxInt16(bonus, firstBonus), BONUS_CONSECUTIVE);
4554
- }
4555
- if (pidx === 0) score += bonus * BONUS_FIRST_CHAR_MULTIPLIER;
4556
- else score += bonus;
4557
- inGap = false;
4558
- consecutive++;
4559
- pidx++;
4560
- } else {
4561
- if (inGap) score += SCORE_GAP_EXTENTION;
4562
- else score += SCORE_GAP_START;
4563
- inGap = true;
4564
- consecutive = 0;
4565
- firstBonus = 0;
4566
- }
4567
- prevCharClass = charClass;
4568
- }
4569
- return [score, pos];
4570
- }
4571
- var fuzzyMatchV1 = (caseSensitive, normalize, forward, text, pattern, withPos, slab2) => {
4572
- if (pattern.length === 0) return [{
4573
- start: 0,
4574
- end: 0,
4575
- score: 0
4576
- }, null];
4577
- if (asciiFuzzyIndex(text, pattern, caseSensitive) < 0) return [{
4578
- start: -1,
4579
- end: -1,
4580
- score: 0
4581
- }, null];
4582
- let pidx = 0, sidx = -1, eidx = -1;
4583
- const lenRunes = text.length;
4584
- const lenPattern = pattern.length;
4585
- for (let index = 0; index < lenRunes; index++) {
4586
- let rune = text[indexAt(index, lenRunes, forward)];
4587
- if (!caseSensitive) {
4588
- if (rune >= CAPITAL_A_RUNE && rune <= CAPITAL_Z_RUNE) rune += 32;
4589
- else if (rune > MAX_ASCII) rune = String.fromCodePoint(rune).toLowerCase().codePointAt(0);
4590
- }
4591
- if (normalize) rune = normalizeRune(rune);
4592
- const pchar = pattern[indexAt(pidx, lenPattern, forward)];
4593
- if (rune === pchar) {
4594
- if (sidx < 0) sidx = index;
4595
- pidx++;
4596
- if (pidx === lenPattern) {
4597
- eidx = index + 1;
4598
- break;
4599
- }
4600
- }
4601
- }
4602
- if (sidx >= 0 && eidx >= 0) {
4603
- pidx--;
4604
- for (let index = eidx - 1; index >= sidx; index--) {
4605
- let rune = text[indexAt(index, lenRunes, forward)];
4606
- if (!caseSensitive) {
4607
- if (rune >= CAPITAL_A_RUNE && rune <= CAPITAL_Z_RUNE) rune += 32;
4608
- else if (rune > MAX_ASCII) rune = String.fromCodePoint(rune).toLowerCase().codePointAt(0);
4609
- }
4610
- const pchar = pattern[indexAt(pidx, lenPattern, forward)];
4611
- if (rune === pchar) {
4612
- pidx--;
4613
- if (pidx < 0) {
4614
- sidx = index;
4615
- break;
4616
- }
4617
- }
4618
- }
4619
- if (!forward) {
4620
- const sidxTemp = sidx;
4621
- sidx = lenRunes - eidx;
4622
- eidx = lenRunes - sidxTemp;
4623
- }
4624
- const [score, pos] = calculateScore(caseSensitive, normalize, text, pattern, sidx, eidx, withPos);
4625
- return [{
4626
- start: sidx,
4627
- end: eidx,
4628
- score
4629
- }, pos];
4630
- }
4631
- return [{
4632
- start: -1,
4633
- end: -1,
4634
- score: 0
4635
- }, null];
4636
- };
4637
- var exactMatchNaive = (caseSensitive, normalize, forward, text, pattern, withPos, slab2) => {
4638
- if (pattern.length === 0) return [{
4639
- start: 0,
4640
- end: 0,
4641
- score: 0
4642
- }, null];
4643
- const lenRunes = text.length;
4644
- const lenPattern = pattern.length;
4645
- if (lenRunes < lenPattern) return [{
4646
- start: -1,
4647
- end: -1,
4648
- score: 0
4649
- }, null];
4650
- if (asciiFuzzyIndex(text, pattern, caseSensitive) < 0) return [{
4651
- start: -1,
4652
- end: -1,
4653
- score: 0
4654
- }, null];
4655
- let pidx = 0;
4656
- let bestPos = -1, bonus = toShort(0), bestBonus = toShort(-1);
4657
- for (let index = 0; index < lenRunes; index++) {
4658
- const index_ = indexAt(index, lenRunes, forward);
4659
- let rune = text[index_];
4660
- if (!caseSensitive) {
4661
- if (rune >= CAPITAL_A_RUNE && rune <= CAPITAL_Z_RUNE) rune += 32;
4662
- else if (rune > MAX_ASCII) rune = String.fromCodePoint(rune).toLowerCase().codePointAt(0);
4663
- }
4664
- if (normalize) rune = normalizeRune(rune);
4665
- const pidx_ = indexAt(pidx, lenPattern, forward);
4666
- if (pattern[pidx_] === rune) {
4667
- if (pidx_ === 0) bonus = bonusAt(text, index_);
4668
- pidx++;
4669
- if (pidx === lenPattern) {
4670
- if (bonus > bestBonus) {
4671
- bestPos = index;
4672
- bestBonus = bonus;
4673
- }
4674
- if (bonus === BONUS_BOUNDARY) break;
4675
- index -= pidx - 1;
4676
- pidx = 0;
4677
- bonus = 0;
4678
- }
4679
- } else {
4680
- index -= pidx;
4681
- pidx = 0;
4682
- bonus = 0;
4683
- }
4684
- }
4685
- if (bestPos >= 0) {
4686
- let sidx = 0, eidx = 0;
4687
- if (forward) {
4688
- sidx = bestPos - lenPattern + 1;
4689
- eidx = bestPos + 1;
4690
- } else {
4691
- sidx = lenRunes - (bestPos + 1);
4692
- eidx = lenRunes - (bestPos - lenPattern + 1);
4693
- }
4694
- const [score] = calculateScore(caseSensitive, normalize, text, pattern, sidx, eidx, false);
4695
- return [{
4696
- start: sidx,
4697
- end: eidx,
4698
- score
4699
- }, null];
4700
- }
4701
- return [{
4702
- start: -1,
4703
- end: -1,
4704
- score: 0
4705
- }, null];
4706
- };
4707
- var SLAB_16_SIZE = 102400;
4708
- var SLAB_32_SIZE = 2048;
4709
- function makeSlab(size16, size32) {
4710
- return {
4711
- i16: new Int16Array(size16),
4712
- i32: new Int32Array(size32)
4713
- };
4714
- }
4715
- var slab = makeSlab(SLAB_16_SIZE, SLAB_32_SIZE);
4716
- var buildPatternForBasicMatch = (query, casing, normalize) => {
4717
- let caseSensitive = false;
4718
- switch (casing) {
4719
- case "smart-case":
4720
- if (query.toLowerCase() !== query) caseSensitive = true;
4721
- break;
4722
- case "case-sensitive":
4723
- caseSensitive = true;
4724
- break;
4725
- case "case-insensitive":
4726
- query = query.toLowerCase();
4727
- caseSensitive = false;
4728
- }
4729
- let queryRunes = strToRunes(query);
4730
- if (normalize) queryRunes = queryRunes.map(normalizeRune);
4731
- return {
4732
- queryRunes,
4733
- caseSensitive
4734
- };
4735
- };
4736
- function getResultFromScoreMap(scoreMap, limit) {
4737
- const scoresInDesc = Object.keys(scoreMap).map((v) => parseInt(v, 10)).sort((a, b) => b - a);
4738
- let result = [];
4739
- for (const score of scoresInDesc) {
4740
- result = result.concat(scoreMap[score]);
4741
- if (result.length >= limit) break;
4742
- }
4743
- return result;
4744
- }
4745
- function getBasicMatchIter(scoreMap, queryRunes, caseSensitive) {
4746
- return (idx) => {
4747
- const itemRunes = this.runesList[idx];
4748
- if (queryRunes.length > itemRunes.length) return;
4749
- let [match, positions] = this.algoFn(caseSensitive, this.opts.normalize, this.opts.forward, itemRunes, queryRunes, true, slab);
4750
- if (match.start === -1) return;
4751
- if (this.opts.fuzzy === false) {
4752
- positions = /* @__PURE__ */ new Set();
4753
- for (let position = match.start; position < match.end; ++position) positions.add(position);
4754
- }
4755
- const scoreKey = this.opts.sort ? match.score : 0;
4756
- if (scoreMap[scoreKey] === void 0) scoreMap[scoreKey] = [];
4757
- scoreMap[scoreKey].push({
4758
- item: this.items[idx],
4759
- ...match,
4760
- positions: positions != null ? positions : /* @__PURE__ */ new Set()
4761
- });
4762
- };
4763
- }
4764
- var isNode = typeof __require !== "undefined" && typeof window === "undefined";
4765
- function asyncMatcher(token, len, iter2, onFinish) {
4766
- return new Promise((resolve, reject) => {
4767
- const INCREMENT = 1e3;
4768
- let i = 0, end = Math.min(INCREMENT, len);
4769
- const step = () => {
4770
- if (token.cancelled) return reject("search cancelled");
4771
- for (; i < end; ++i) iter2(i);
4772
- if (end < len) {
4773
- end = Math.min(end + INCREMENT, len);
4774
- isNode ? setImmediate(step) : setTimeout(step);
4775
- } else resolve(onFinish());
4776
- };
4777
- step();
4778
- });
4779
- }
4780
- function asyncBasicMatch(query, token) {
4781
- const { queryRunes, caseSensitive } = buildPatternForBasicMatch(query, this.opts.casing, this.opts.normalize);
4782
- const scoreMap = {};
4783
- return asyncMatcher(token, this.runesList.length, getBasicMatchIter.bind(this)(scoreMap, queryRunes, caseSensitive), () => getResultFromScoreMap(scoreMap, this.opts.limit));
4784
- }
4785
- var defaultOpts = {
4786
- limit: Infinity,
4787
- selector: (v) => v,
4788
- casing: "smart-case",
4789
- normalize: true,
4790
- fuzzy: "v2",
4791
- tiebreakers: [],
4792
- sort: true,
4793
- forward: true
4794
- };
4795
- var BaseFinder = class {
4796
- constructor(list, ...optionsTuple) {
4797
- this.opts = {
4798
- ...defaultOpts,
4799
- ...optionsTuple[0]
4800
- };
4801
- this.items = list;
4802
- this.runesList = list.map((item) => strToRunes(this.opts.selector(item).normalize()));
4803
- this.algoFn = exactMatchNaive;
4804
- switch (this.opts.fuzzy) {
4805
- case "v2":
4806
- this.algoFn = fuzzyMatchV2;
4807
- break;
4808
- case "v1": this.algoFn = fuzzyMatchV1;
4809
- }
4810
- }
4811
- };
4812
- ({ ...defaultOpts });
4813
- var asyncDefaultOpts = {
4814
- ...defaultOpts,
4815
- match: asyncBasicMatch
4816
- };
4817
- var AsyncFinder = class extends BaseFinder {
4818
- constructor(list, ...optionsTuple) {
4819
- super(list, ...optionsTuple);
4820
- this.opts = {
4821
- ...asyncDefaultOpts,
4822
- ...optionsTuple[0]
4823
- };
4824
- this.token = { cancelled: false };
4825
- }
4826
- async find(query) {
4827
- this.token.cancelled = true;
4828
- this.token = { cancelled: false };
4829
- if (query.length === 0 || this.items.length === 0) return this.items.slice(0, this.opts.limit).map(createResultItemWithEmptyPos);
4830
- query = query.normalize();
4831
- return postProcessResultItems(await this.opts.match.bind(this)(query, this.token), this.opts);
4832
- }
4833
- };
4834
- var createResultItemWithEmptyPos = (item) => ({
4835
- item,
4836
- start: -1,
4837
- end: -1,
4838
- score: 0,
4839
- positions: /* @__PURE__ */ new Set()
4840
- });
4841
- function postProcessResultItems(result, opts) {
4842
- if (opts.sort) {
4843
- const { selector } = opts;
4844
- result.sort((a, b) => {
4845
- if (a.score === b.score) for (const tiebreaker of opts.tiebreakers) {
4846
- const diff = tiebreaker(a, b, selector);
4847
- if (diff !== 0) return diff;
4848
- }
4849
- return 0;
4850
- });
4851
- }
4852
- if (Number.isFinite(opts.limit)) result.splice(opts.limit);
4853
- return result;
4854
- }
4855
- var AsyncFzf = class {
4856
- constructor(list, ...optionsTuple) {
4857
- this.finder = new AsyncFinder(list, ...optionsTuple);
4858
- this.find = this.finder.find.bind(this.finder);
4859
- }
4860
- };
4861
- //#endregion
4862
- //#region src/ui/browser/icons/picker/IconPicker.tsx
4863
- var translations = {
4864
- "en": {
4865
- emoji: "Emoji",
4866
- icon: "Icon",
4867
- random: "Random",
4868
- filter: "Filter...",
4869
- more: "More...",
4870
- loading: "Loading...",
4871
- carbon: "Carbon",
4872
- close: "Close",
4873
- color: "Color"
4874
- },
4875
- "zh-CN": {
4876
- emoji: "Emoji",
4877
- icon: "图标",
4878
- random: "随机",
4879
- filter: "搜索...",
4880
- more: "更多...",
4881
- loading: "加载中...",
4882
- carbon: "Carbon",
4883
- close: "关闭",
4884
- color: "颜色"
4885
- },
4886
- "zh-TW": {
4887
- emoji: "Emoji",
4888
- icon: "圖示",
4889
- random: "隨機",
4890
- filter: "搜尋...",
4891
- more: "更多...",
4892
- loading: "載入中...",
4893
- carbon: "Carbon",
4894
- close: "關閉",
4895
- color: "顏色"
4896
- },
4897
- "ja": {
4898
- emoji: "絵文字",
4899
- icon: "アイコン",
4900
- random: "ランダム",
4901
- filter: "検索…",
4902
- more: "もっと見る…",
4903
- loading: "読み込み中…",
4904
- carbon: "Carbon",
4905
- close: "閉じる",
4906
- color: "色"
4907
- },
4908
- "ko": {
4909
- emoji: "이모지",
4910
- icon: "아이콘",
4911
- random: "무작위",
4912
- filter: "필터...",
4913
- more: "더 보기...",
4914
- loading: "불러오는 중...",
4915
- carbon: "Carbon",
4916
- close: "닫기",
4917
- color: "색상"
4918
- },
4919
- "ru": {
4920
- emoji: "Эмодзи",
4921
- icon: "Значок",
4922
- random: "Случайно",
4923
- filter: "Фильтр…",
4924
- more: "Ещё…",
4925
- loading: "Загрузка…",
4926
- carbon: "Carbon",
4927
- close: "Закрыть",
4928
- color: "Цвет"
4929
- },
4930
- "fr": {
4931
- emoji: "Emoji",
4932
- icon: "Icône",
4933
- random: "Aléatoire",
4934
- filter: "Filtrer...",
4935
- more: "Plus...",
4936
- loading: "Chargement...",
4937
- carbon: "Carbon",
4938
- close: "Fermer",
4939
- color: "Couleur"
4940
- }
4941
- };
4942
- var rememberLastTab;
4943
- var rememberLastColor;
4944
- function getTranslate(lang) {
4945
- const data = translations[resolveUiLanguage([lang])];
4946
- return (key) => data[key] || translations.en[key] || key;
4947
- }
4948
- var COLUMNS = 9;
4949
- var CONTAINER_STYLE = {
4950
- width: 308,
4951
- height: 360
4952
- };
4953
- var MAX_ITEMS_INIT = 180;
4954
- var MAX_ITEMS_STEP = 90;
4955
- var COLORS = [
4956
- "currentColor",
4957
- "#CC3E44",
4958
- "#E37933",
4959
- "#CBCB41",
4960
- "#8DC149",
4961
- "#7494A3",
4962
- "#519ABA",
4963
- "#A074C4",
4964
- "#F55385",
4965
- "#6D8086"
4966
- ];
4967
- function computeRows(iconifyData, filteredIcons, categories, collection) {
4968
- const rows = [];
4969
- if (!iconifyData) return rows;
4970
- if (filteredIcons) for (let i = 0; i < filteredIcons.length; i += COLUMNS) rows.push(filteredIcons.slice(i, i + COLUMNS));
4971
- else if (categories) for (const category in categories) {
4972
- rows.push(category);
4973
- const icons = categories[category];
4974
- for (let i = 0; i < icons.length; i += COLUMNS) rows.push(icons.slice(i, i + COLUMNS));
4975
- }
4976
- else if (collection) {
4977
- const icons = iconifyData[collection]?.icons.icons;
4978
- if (icons) {
4979
- filteredIcons = Object.keys(icons);
4980
- for (let i = 0; i < filteredIcons.length; i += COLUMNS) rows.push(filteredIcons.slice(i, i + COLUMNS));
4981
- }
4982
- }
4983
- return rows;
4984
- }
4985
- var ICON_SIZE = 32;
4986
- var BUFFER_SIZE = 320;
4987
- var ROW_STYLE = { height: ICON_SIZE };
4988
- var PickerIcon = ({ iconSet, name, color }) => {
4989
- const svg = useMemo(() => {
4990
- const icon = getIconData(iconSet, name);
4991
- if (!icon) return null;
4992
- const result = iconToSVG(icon, {
4993
- width: "1em",
4994
- height: "1em"
4995
- });
4996
- return {
4997
- body: replaceIDs(result.body),
4998
- viewBox: result.attributes.viewBox
4999
- };
5000
- }, [iconSet, name]);
5001
- if (!svg) return null;
5002
- return /* @__PURE__ */ jsx("svg", {
5003
- "aria-hidden": "true",
5004
- className: clsx(IconPicker_module_default.icon, "text-lg"),
5005
- focusable: "false",
5006
- style: { color },
5007
- viewBox: svg.viewBox,
5008
- dangerouslySetInnerHTML: { __html: svg.body }
5009
- });
5010
- };
5011
- function renderRow(index, row, iconSet, color) {
5012
- return /* @__PURE__ */ jsx("div", {
5013
- className: IconPicker_module_default.row,
5014
- style: ROW_STYLE,
5015
- children: Array.isArray(row) ? row.map((icon) => /* @__PURE__ */ jsx(Button$1, {
5016
- variant: "ghost",
5017
- size: "icon-sm",
5018
- "aria-label": icon,
5019
- "data-icon": icon,
5020
- title: icon,
5021
- type: "button",
5022
- children: /* @__PURE__ */ jsx(PickerIcon, {
5023
- iconSet,
5024
- name: icon,
5025
- color
5026
- })
5027
- }, icon)) : /* @__PURE__ */ jsx("div", {
5028
- className: IconPicker_module_default.subtitle,
5029
- children: row
5030
- })
5031
- }, index);
5032
- }
5033
- var IconPickerIconsPanel = ({ filteredIcons, collection, color, categories, onClick }) => {
5034
- const iconifyData = useIconifyData(true);
5035
- const iconSet = iconifyData?.[collection]?.icons;
5036
- const [viewport, setViewport] = useState(null);
5037
- const rows = useMemo(() => computeRows(iconifyData, filteredIcons, categories, collection), [
5038
- iconifyData,
5039
- filteredIcons,
5040
- categories,
5041
- collection
5042
- ]);
5043
- return /* @__PURE__ */ jsx(ScrollArea, {
5044
- className: IconPicker_module_default.panel,
5045
- defer: false,
5046
- events: { initialized: (instance) => setViewport(instance.elements().viewport) },
5047
- onClick,
5048
- children: viewport && iconSet && /* @__PURE__ */ jsx(Z$1, {
5049
- data: rows,
5050
- itemSize: ICON_SIZE,
5051
- bufferSize: BUFFER_SIZE,
5052
- scrollRef: { current: viewport },
5053
- children: (row, index) => renderRow(index, row, iconSet, color)
5054
- })
5055
- });
5056
- };
5057
- var IconPicker = ({ className, emoji, carbon = true, defaultTab = rememberLastTab || (emoji ? "twemoji" : "carbon"), defaultColor = rememberLastColor || COLORS[0], locale, onChange, onCancel }) => {
5058
- if (!emoji && !carbon) carbon = true;
5059
- const i18n = useI18n(true);
5060
- const language$ = locale || i18n?.lang$ || "en";
5061
- const t = getTranslate(useVal(language$));
5062
- const root = useRef(null);
5063
- const [tab, setTab] = useState(defaultTab);
5064
- const [searchText, setSearchText] = useState("");
5065
- const [maxItems, setMaxItems] = useState(MAX_ITEMS_INIT);
5066
- const [filteredIcons, setIcons] = useState(null);
5067
- const [selectedColor, setColor] = useState(defaultColor);
5068
- const [colorsPanel, setColorsPanel] = useState(false);
5069
- const hasColors = tab === "carbon";
5070
- const iconifyData = useIconifyData(true);
5071
- const loadCollection = useIconifyCollectionLoader();
5072
- useEffect(() => {
5073
- loadCollection?.(tab).catch((error) => console.error(`Failed to load the ${tab} icon collection.`, error));
5074
- }, [loadCollection, tab]);
5075
- const fzf = useMemo(() => {
5076
- const collection = iconifyData?.[tab];
5077
- if (collection) return new AsyncFzf(Object.keys(collection.icons.icons), {
5078
- casing: "case-insensitive",
5079
- fuzzy: "v1"
5080
- });
5081
- return null;
5082
- }, [iconifyData, tab]);
5083
- const loadMore = useCallback(() => {
5084
- setMaxItems((currentMaxItems) => currentMaxItems + MAX_ITEMS_STEP);
5085
- }, []);
5086
- const searchTimeout = useRef(0);
5087
- useEffect(() => {
5088
- clearTimeout(searchTimeout.current);
5089
- if (searchText) {
5090
- setIcons([]);
5091
- if (!fzf || !searchText) return;
5092
- let isMounted = true;
5093
- searchTimeout.current = window.setTimeout(async () => {
5094
- const result = await fzf.find(searchText);
5095
- if (isMounted) {
5096
- setMaxItems(MAX_ITEMS_INIT);
5097
- setIcons(result.map((i) => i.item));
5098
- }
5099
- }, 200);
5100
- return () => {
5101
- isMounted = false;
5102
- };
5103
- } else setIcons(null);
5104
- }, [fzf, searchText]);
5105
- const onClickShuffle = useCallback(() => {
5106
- const collection = iconifyData?.[tab];
5107
- if (onChange && collection) {
5108
- const keys = Object.keys(collection.icons.icons);
5109
- const icon = keys[Math.floor(Math.random() * keys.length)];
5110
- const color = COLORS[Math.floor(Math.random() * COLORS.length)];
5111
- onChange(tab, icon, color, true);
5112
- }
5113
- }, [tab, onChange]);
5114
- const toggleColorsPanel = useCallback(() => {
5115
- setColorsPanel((e) => !e);
5116
- }, []);
5117
- const onClickColors = useCallback((event) => {
5118
- const color = event.target.dataset.color;
5119
- if (color) setColor(rememberLastColor = color);
5120
- }, []);
5121
- const onClickIcon = useCallback((event) => {
5122
- const icon = event.target.dataset.icon;
5123
- if (icon && onChange) onChange(tab, icon, selectedColor, false);
5124
- }, [
5125
- tab,
5126
- selectedColor,
5127
- onChange
5128
- ]);
5129
- const onKeyDown = useCallback((event) => {
5130
- if (event.key === "Escape" && onCancel) {
5131
- event.stopPropagation();
5132
- onCancel();
5133
- }
5134
- }, [onCancel]);
5135
- useEffect(() => {
5136
- root.current?.focus();
5137
- }, []);
5138
- return /* @__PURE__ */ jsxs("div", {
5139
- className: clsx(IconPicker_module_default.container, className),
5140
- style: CONTAINER_STYLE,
5141
- tabIndex: -1,
5142
- onKeyDown,
5143
- children: [
5144
- /* @__PURE__ */ jsxs("div", {
5145
- className: IconPicker_module_default.filter,
5146
- children: [/* @__PURE__ */ jsxs(InputGroup, {
5147
- className: "h-6",
5148
- children: [/* @__PURE__ */ jsx(InputGroupAddon, { children: /* @__PURE__ */ jsx("i", {
5149
- "aria-hidden": "true",
5150
- className: "i-lucide-light:search text-sm"
5151
- }) }), /* @__PURE__ */ jsx(InputGroupInput, {
5152
- className: "h-full py-0 text-[11px] md:text-[11px]",
5153
- "aria-label": t("filter"),
5154
- autoComplete: "off",
5155
- type: "search",
5156
- placeholder: t("filter"),
5157
- value: searchText,
5158
- onChange: (e) => setSearchText(e.target.value),
5159
- autoFocus: true
5160
- })]
5161
- }), /* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, {
5162
- render: /* @__PURE__ */ jsx(Button$1, {
5163
- variant: "ghost",
5164
- size: "icon-xs",
5165
- "aria-label": t("random"),
5166
- onClick: onClickShuffle,
5167
- type: "button"
5168
- }),
5169
- children: /* @__PURE__ */ jsx("i", {
5170
- "aria-hidden": "true",
5171
- className: "i-lucide-light:shuffle text-sm"
5172
- })
5173
- }), /* @__PURE__ */ jsx(TooltipContent, { children: t("random") })] })]
5174
- }),
5175
- /* @__PURE__ */ jsxs("div", {
5176
- className: IconPicker_module_default.tabs,
5177
- children: [
5178
- /* @__PURE__ */ jsx(Tabs, {
5179
- value: tab,
5180
- onValueChange: (value) => {
5181
- setTab(rememberLastTab = value);
5182
- setColorsPanel(false);
5183
- },
5184
- className: "min-w-0 flex-1",
5185
- children: /* @__PURE__ */ jsxs(TabsList, {
5186
- variant: "flat",
5187
- className: "w-full rounded-[6px] p-0.5 group-data-[orientation=horizontal]/tabs:h-6",
5188
- children: [emoji && /* @__PURE__ */ jsx(TabsTrigger, {
5189
- className: "text-[11px] group-data-[variant=flat]/tabs-list:rounded-[4px]",
5190
- value: "twemoji",
5191
- children: t("emoji")
5192
- }), carbon && /* @__PURE__ */ jsx(TabsTrigger, {
5193
- className: "text-[11px] group-data-[variant=flat]/tabs-list:rounded-[4px]",
5194
- value: "carbon",
5195
- children: t("carbon")
5196
- })]
5197
- })
5198
- }),
5199
- hasColors && /* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, {
5200
- render: /* @__PURE__ */ jsx(Button$1, {
5201
- variant: "ghost",
5202
- size: "icon-xs",
5203
- "aria-expanded": colorsPanel,
5204
- "aria-label": t("color"),
5205
- onClick: toggleColorsPanel,
5206
- type: "button"
5207
- }),
5208
- children: /* @__PURE__ */ jsx("i", {
5209
- "aria-hidden": "true",
5210
- className: "i-lucide-light:palette text-sm",
5211
- style: { color: selectedColor }
5212
- })
5213
- }), /* @__PURE__ */ jsx(TooltipContent, { children: t("color") })] }),
5214
- /* @__PURE__ */ jsx("div", {
5215
- onClick: onClickColors,
5216
- className: IconPicker_module_default.colors,
5217
- style: hasColors && colorsPanel ? {} : { display: "none" },
5218
- children: COLORS.map((color) => /* @__PURE__ */ jsx("button", {
5219
- "aria-label": `${t("color")}: ${color}`,
5220
- "aria-pressed": selectedColor === color,
5221
- className: IconPicker_module_default.color,
5222
- "data-color": color,
5223
- style: { backgroundColor: color },
5224
- type: "button"
5225
- }, color))
5226
- })
5227
- ]
5228
- }),
5229
- iconifyData?.[tab] ? /* @__PURE__ */ jsx(IconPickerIconsPanel, {
5230
- filteredIcons: filteredIcons?.slice(0, maxItems),
5231
- collection: tab,
5232
- categories: iconifyData?.[tab]?.metadata?.categories,
5233
- color: selectedColor,
5234
- onClick: onClickIcon
5235
- }, tab) : /* @__PURE__ */ jsxs("div", {
5236
- className: IconPicker_module_default.loading,
5237
- children: [/* @__PURE__ */ jsx("i", { className: "i-codicon:loading" }), /* @__PURE__ */ jsx("span", { children: t("loading") })]
5238
- }),
5239
- filteredIcons && filteredIcons.length > maxItems && /* @__PURE__ */ jsx(Button$1, {
5240
- variant: "ghost",
5241
- size: "xs",
5242
- className: "mx-3 mb-2 shrink-0 text-[11px]",
5243
- onClick: loadMore,
5244
- type: "button",
5245
- children: t("more")
5246
- })
5247
- ]
5248
- });
5249
- };
5250
- //#endregion
5251
- //#region src/ui/browser/icons/icon-picker-button.tsx
5252
- function IconPickerButton({ children, className, disabled, label, onChange, side = "bottom", size = "icon-xs", variant = "ghost" }) {
5253
- const [open, setOpen] = useState(false);
5254
- const [container, setContainer] = useState(null);
5255
- return /* @__PURE__ */ jsx("div", {
5256
- className: "inline-flex",
5257
- ref: setContainer,
5258
- children: /* @__PURE__ */ jsxs(Popover, {
5259
- open: open && !disabled,
5260
- onOpenChange: setOpen,
5261
- children: [/* @__PURE__ */ jsx(PopoverTrigger, {
5262
- render: /* @__PURE__ */ jsx(Button$1, {
5263
- "aria-label": label,
5264
- className,
5265
- disabled,
5266
- size,
5267
- variant
5268
- }),
5269
- children
5270
- }), /* @__PURE__ */ jsx(PopoverContent, {
5271
- "aria-label": label,
5272
- container,
5273
- side,
5274
- className: "w-auto overflow-hidden border border-foreground/10 p-0 ring-0",
5275
- children: /* @__PURE__ */ jsx(IconPicker, {
5276
- emoji: true,
5277
- onCancel: () => setOpen(false),
5278
- onChange: (collection, icon, color) => {
5279
- onChange(color.toLowerCase() === "currentcolor" ? `:${collection}:${icon}:` : `:${collection}:${icon}:${color}:`);
5280
- setOpen(false);
5281
- }
5282
- })
5283
- })]
5284
- })
5285
- });
5286
- }
5287
3130
  //#endregion
5288
3131
  //#region src/workbench/browser/runtime/editor/nodeHeading.tsx
5289
3132
  function NodeHeading({ title, icon, fallback, disabled, titleReadOnly = false, validate, onRename, onIconChange }) {
@@ -5919,7 +3762,7 @@ function FlowStateButton({ client, flowId, nodes, history, notify, onClose }) {
5919
3762
  children: [/* @__PURE__ */ jsx("i", {
5920
3763
  "aria-hidden": "true",
5921
3764
  className: "i-lucide-light:database"
5922
- }), t(space == null ? "flowState.title" : "flowState.history")]
3765
+ }), t(space == null ? "flowState.title" : "flowState.usage")]
5923
3766
  }), /* @__PURE__ */ jsxs(DialogContent, {
5924
3767
  ref: dialogRoot,
5925
3768
  container,
@@ -5928,7 +3771,7 @@ function FlowStateButton({ client, flowId, nodes, history, notify, onClose }) {
5928
3771
  children: [
5929
3772
  /* @__PURE__ */ jsx(DialogTitle, {
5930
3773
  className: "break-words pr-8",
5931
- children: space == null ? t("flowState.title") : t("flowState.sourceHistory", { name: sourceName(space, nodes, t) })
3774
+ children: space == null ? t("flowState.title") : t("flowState.sourceUsage", { name: sourceName(space, nodes, t) })
5932
3775
  }),
5933
3776
  /* @__PURE__ */ jsxs(Tabs, {
5934
3777
  value: scope,
@@ -6130,7 +3973,7 @@ var SwitchRootDataAttributes = /*#__PURE__*/ function(SwitchRootDataAttributes)
6130
3973
  }({});
6131
3974
  //#endregion
6132
3975
  //#region ../../node_modules/.bun/@base-ui+react@1.4.1+fa6c2f29eeb10566/node_modules/@base-ui/react/esm/switch/stateAttributesMapping.js
6133
- var stateAttributesMapping = {
3976
+ var stateAttributesMapping$1 = {
6134
3977
  ...fieldValidityMapping,
6135
3978
  checked(value) {
6136
3979
  if (value) return { [SwitchRootDataAttributes.checked]: "" };
@@ -6284,7 +4127,7 @@ var SwitchRoot = /*#__PURE__*/ React.forwardRef(function SwitchRoot(componentPro
6284
4127
  elementProps,
6285
4128
  getButtonProps
6286
4129
  ],
6287
- stateAttributesMapping
4130
+ stateAttributesMapping: stateAttributesMapping$1
6288
4131
  });
6289
4132
  return /*#__PURE__*/ jsxs(SwitchRootContext.Provider, {
6290
4133
  value: state,
@@ -6323,7 +4166,7 @@ var SwitchThumb = /*#__PURE__*/ React.forwardRef(function SwitchThumb(componentP
6323
4166
  return useRenderElement("span", componentProps, {
6324
4167
  state: extendedState,
6325
4168
  ref: forwardedRef,
6326
- stateAttributesMapping,
4169
+ stateAttributesMapping: stateAttributesMapping$1,
6327
4170
  props: elementProps
6328
4171
  });
6329
4172
  });
@@ -35952,6 +33795,543 @@ function RunsView({ flowName, onClose, onConfigureConnector, onLocateEvent, onLo
35952
33795
  });
35953
33796
  }
35954
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
35955
34335
  //#region src/workbench/browser/runtime/shell/diagnosticsPanel.tsx
35956
34336
  function DiagnosticsPanel({ checking, items, nodes, onClose, onRefresh, onSelect, onSelectNode }) {
35957
34337
  const t = useTranslate();
@@ -36127,7 +34507,7 @@ function WorkspaceDiagnosticsIsland({ checking, items, nodes, onOpenChange, onRe
36127
34507
  }
36128
34508
  //#endregion
36129
34509
  //#region src/workbench/browser/runtime/shell/workspaceNavigationIsland.tsx
36130
- function WorkspaceNavigationIsland({ flowName, settings, flowsHref, ghost = false, onOpenFlows, saveStatus }) {
34510
+ function WorkspaceNavigationIsland({ flowName, flowIcon, flowDescription, settings, flowsHref, ghost = false, onOpenFlows, saveStatus }) {
36131
34511
  const t = useTranslate();
36132
34512
  const [tooltipContainer, setTooltipContainer] = useState(null);
36133
34513
  const draftStatus = saveStatus == "saved" || saveStatus == "saving" || saveStatus == "failed" ? saveStatus : void 0;
@@ -36156,10 +34536,25 @@ function WorkspaceNavigationIsland({ flowName, settings, flowsHref, ghost = fals
36156
34536
  children: /* @__PURE__ */ jsx(Icon, { name: "chevron-left" })
36157
34537
  })
36158
34538
  }),
34539
+ flowIcon && /* @__PURE__ */ jsx(ContentIcon, {
34540
+ src: flowIcon,
34541
+ className: "size-4 shrink-0",
34542
+ fallback: /* @__PURE__ */ jsx("i", {
34543
+ "aria-hidden": "true",
34544
+ className: "i-lucide-light:workflow size-4 shrink-0"
34545
+ })
34546
+ }),
36159
34547
  /* @__PURE__ */ jsx(CanvasTooltip, {
36160
34548
  getPopupContainer: () => tooltipContainer ?? document.body,
36161
34549
  placement: "bottom",
36162
- title: flowName,
34550
+ title: flowDescription ? /* @__PURE__ */ jsxs("span", {
34551
+ className: "whitespace-pre-wrap",
34552
+ children: [
34553
+ flowName,
34554
+ "\n",
34555
+ flowDescription
34556
+ ]
34557
+ }) : flowName,
36163
34558
  children: /* @__PURE__ */ jsx("span", {
36164
34559
  className: "workspace-flow-name",
36165
34560
  tabIndex: 0,
@@ -36186,33 +34581,18 @@ function WorkspaceNavigationIsland({ flowName, settings, flowsHref, ghost = fals
36186
34581
  });
36187
34582
  }
36188
34583
  //#endregion
36189
- //#region src/workbench/browser/runtime/shell/pngExportPreference.ts
36190
- var pngExportFramePreferenceKey = "open-flow:png-export-frame";
36191
- function readPngExportFrame(preferences) {
36192
- try {
36193
- return preferences?.getItem(pngExportFramePreferenceKey) !== "false";
36194
- } catch {
36195
- return true;
36196
- }
36197
- }
36198
- function writePngExportFrame(preferences, enabled) {
36199
- try {
36200
- preferences?.setItem(pngExportFramePreferenceKey, String(enabled));
36201
- } catch {}
36202
- }
36203
- //#endregion
36204
34584
  //#region src/workbench/browser/runtime/shell/workspacePublishIsland.tsx
36205
34585
  var blockedReasonKey = {
36206
34586
  issues: "workspace.publishIssuesReason",
36207
34587
  busy: "workspace.publishActionInProgress",
36208
34588
  publishing: "workspace.publishInProgress"
36209
34589
  };
36210
- function WorkspacePublishIsland({ hasPublications, onOpenPublications, onExport, onExportPng, onOpenRuns, onOpenState, onPublish, preferences, state }) {
34590
+ function WorkspacePublishIsland({ hasPublications, onOpenPublications, onExport, onOpenPngExport, onOpenRuns, onOpenState, onPublish, state }) {
36211
34591
  const t = useTranslate();
34592
+ const exportAction = useWorkflowExportAction(onExport);
34593
+ const pngAction = useWorkflowExportAction(onOpenPngExport);
36212
34594
  const [popupContainer, setPopupContainer] = useState(null);
36213
34595
  const [confirming, setConfirming] = useState(false);
36214
- const [exporting, setExporting] = useState(false);
36215
- const [showFrame, setShowFrame] = useState(() => readPngExportFrame(preferences));
36216
34596
  const cancelButton = useRef(null);
36217
34597
  const publishLabel = t(state == "publishing" ? "workspace.publishing" : "publication.publishDraft");
36218
34598
  const historyLabel = t(hasPublications === true ? "workspace.publications" : hasPublications === false ? "publication.historyEmpty" : "publication.loading");
@@ -36228,69 +34608,72 @@ function WorkspacePublishIsland({ hasPublications, onOpenPublications, onExport,
36228
34608
  onPointerDown: (event) => event.stopPropagation(),
36229
34609
  ref: setPopupContainer,
36230
34610
  role: "group",
36231
- children: [
36232
- /* @__PURE__ */ jsxs(Popover, {
36233
- open: confirming,
36234
- onOpenChange: (open) => setConfirming(open && state == "ready"),
36235
- children: [/* @__PURE__ */ jsx(CanvasTooltip, {
36236
- getPopupContainer: () => popupContainer ?? document.body,
36237
- placement: "bottom",
36238
- title: statusTooltip,
36239
- children: /* @__PURE__ */ jsxs(PopoverTrigger, {
36240
- render: /* @__PURE__ */ jsx(Button$1, {
36241
- "aria-description": statusTooltip,
36242
- "aria-disabled": status != "ready" || void 0,
36243
- className: "workspace-publish-button",
36244
- "data-publish-status": status,
36245
- size: "default",
36246
- type: "button",
36247
- variant: "ghost"
36248
- }),
36249
- children: [/* @__PURE__ */ jsx("span", {
36250
- "aria-hidden": "true",
36251
- className: `status-dot ${status == "current" ? "success" : status == "ready" ? "warning" : "neutral"}`
36252
- }), /* @__PURE__ */ jsx("span", { children: publishLabel })]
36253
- })
36254
- }), /* @__PURE__ */ jsxs(PopoverContent, {
36255
- align: "end",
36256
- className: "gap-4 p-0",
36257
- container: popupContainer,
36258
- initialFocus: cancelButton,
36259
- side: "bottom",
36260
- sideOffset: 8,
36261
- children: [/* @__PURE__ */ jsxs(PopoverHeader, {
36262
- className: "gap-2 px-4 pt-4",
36263
- children: [/* @__PURE__ */ jsx(PopoverTitle, {
36264
- className: "m-0 text-sm",
36265
- children: t("publication.publishConfirm")
36266
- }), /* @__PURE__ */ jsx(PopoverDescription, {
36267
- className: "m-0",
36268
- children: t("publication.publishConfirmDescription")
36269
- })]
36270
- }), /* @__PURE__ */ jsxs("div", {
36271
- className: "flex justify-end gap-2 px-3 pb-3",
36272
- children: [/* @__PURE__ */ jsx(Button$1, {
36273
- ref: cancelButton,
36274
- onClick: () => setConfirming(false),
36275
- size: "sm",
36276
- type: "button",
36277
- variant: "outline",
36278
- children: t("common.cancel")
36279
- }), /* @__PURE__ */ jsx(Button$1, {
36280
- disabled: state != "ready",
36281
- onClick: () => {
36282
- if (state != "ready") return;
36283
- setConfirming(false);
36284
- onPublish();
36285
- },
36286
- size: "sm",
36287
- type: "button",
36288
- children: t("publication.confirmPublish")
36289
- })]
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")
34648
+ })]
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",
34655
+ type: "button",
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")
36290
34668
  })]
36291
34669
  })]
36292
- }),
36293
- /* @__PURE__ */ jsxs(DropdownMenu, { children: [/* @__PURE__ */ jsx(CanvasTooltip, {
34670
+ })]
34671
+ }), /* @__PURE__ */ jsxs(DropdownMenu, {
34672
+ onOpenChangeComplete: (open) => {
34673
+ exportAction.onOpenChangeComplete(open);
34674
+ pngAction.onOpenChangeComplete(open);
34675
+ },
34676
+ children: [/* @__PURE__ */ jsx(CanvasTooltip, {
36294
34677
  getPopupContainer: () => popupContainer ?? document.body,
36295
34678
  placement: "bottom",
36296
34679
  title: menuLabel,
@@ -36314,47 +34697,16 @@ function WorkspacePublishIsland({ hasPublications, onOpenPublications, onExport,
36314
34697
  onExport != null && /* @__PURE__ */ jsx(WorkflowExportMenuItem, {
36315
34698
  className: "gap-2 px-2 py-[5px]",
36316
34699
  disabled: state == "busy" || state == "publishing",
36317
- onClick: onExport
34700
+ onClick: exportAction.onClick
36318
34701
  }),
36319
- onExportPng != null && /* @__PURE__ */ jsxs(DropdownMenuSub, { children: [/* @__PURE__ */ jsxs(DropdownMenuSubTrigger, {
34702
+ onOpenPngExport != null && /* @__PURE__ */ jsxs(DropdownMenuItem, {
36320
34703
  className: "gap-2 px-2 py-[5px]",
36321
- disabled: exporting,
34704
+ onClick: pngAction.onClick,
36322
34705
  children: [/* @__PURE__ */ jsx("i", {
36323
34706
  "aria-hidden": "true",
36324
34707
  className: "i-lucide-light:download size-4 shrink-0"
36325
34708
  }), t("resource.exportPng")]
36326
- }), /* @__PURE__ */ jsxs(DropdownMenuSubContent, {
36327
- className: "min-w-32",
36328
- container: popupContainer,
36329
- children: [
36330
- /* @__PURE__ */ jsx(DropdownMenuCheckboxItem, {
36331
- checked: showFrame,
36332
- className: "py-[5px] pl-2",
36333
- closeOnClick: false,
36334
- onCheckedChange: (checked) => {
36335
- setShowFrame(checked);
36336
- writePngExportFrame(preferences, checked);
36337
- },
36338
- children: t("resource.exportPngFrame")
36339
- }),
36340
- /* @__PURE__ */ jsx(DropdownMenuSeparator, { className: "mx-2 bg-border/50" }),
36341
- [false, true].map((dark) => /* @__PURE__ */ jsx(DropdownMenuItem, {
36342
- className: "px-2 py-[5px]",
36343
- onClick: async () => {
36344
- setExporting(true);
36345
- try {
36346
- await onExportPng({
36347
- dark,
36348
- frame: showFrame
36349
- });
36350
- } finally {
36351
- setExporting(false);
36352
- }
36353
- },
36354
- children: t(dark ? "resource.exportPngDark" : "resource.exportPngLight")
36355
- }, String(dark)))
36356
- ]
36357
- })] }),
34709
+ }),
36358
34710
  /* @__PURE__ */ jsxs(DropdownMenuItem, {
36359
34711
  className: "gap-2 px-2 py-[5px]",
36360
34712
  disabled: hasPublications !== true,
@@ -36384,24 +34736,8 @@ function WorkspacePublishIsland({ hasPublications, onOpenPublications, onExport,
36384
34736
  }), runsLabel]
36385
34737
  })
36386
34738
  ]
36387
- })] }),
36388
- /* @__PURE__ */ jsx(Dialog, {
36389
- open: exporting,
36390
- onOpenChange: (_open, details) => details.cancel(),
36391
- children: /* @__PURE__ */ jsxs(DialogContent, {
36392
- container: popupContainer?.closest(".open-flow-workbench") ?? popupContainer,
36393
- showCloseButton: false,
36394
- "aria-busy": "true",
36395
- children: [/* @__PURE__ */ jsxs("div", {
36396
- className: "flex items-center gap-3",
36397
- children: [/* @__PURE__ */ jsx(Spinner, {
36398
- "aria-hidden": "true",
36399
- className: "shrink-0"
36400
- }), /* @__PURE__ */ jsx(DialogTitle, { children: t("resource.exportPngPending") })]
36401
- }), /* @__PURE__ */ jsx(DialogDescription, { children: t("resource.exportPngPendingDescription") })]
36402
- })
36403
- })
36404
- ]
34739
+ })]
34740
+ })]
36405
34741
  });
36406
34742
  }
36407
34743
  //#endregion
@@ -36607,14 +34943,16 @@ var NodeInspectorContainer = memo(function NodeInspectorContainer({ onAddWorkflo
36607
34943
  triggers: store.triggers
36608
34944
  });
36609
34945
  });
36610
- 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 }) {
36611
34947
  const t = useTranslate();
36612
34948
  const addNodeOptions = useVal(store.workspace.$.addNodeOptions);
36613
34949
  const language = useLang();
36614
34950
  const connections = useVal(store.connectors.$.pickerConnections);
36615
34951
  const triggerCatalogState = useVal(store.triggers.catalog.state);
36616
34952
  const [startId, setStartId] = useState();
36617
- const [stateTarget, setStateTarget] = useState();
34953
+ const [stateOpen, setStateOpen] = useState(false);
34954
+ const [pngExportOpen, setPngExportOpen] = useState(false);
34955
+ const currentFlow = useVal(store.workspace.$.flow);
36618
34956
  const runInputRequest = useVal(store.runRequests.$.inputRequest);
36619
34957
  useVal(store.runRequests.$.inputsLoaded);
36620
34958
  const busy = useVal(store.$.busy);
@@ -36639,6 +34977,18 @@ function FlowEditor({ navigationIsland, onRun, onRunStarted, onCloseRuns, onConf
36639
34977
  const moduleEditor = useVal(store.workspace.$.moduleEditor);
36640
34978
  const initialAddNodeTab = triggers.length == 0 ? "triggers" : "nodes";
36641
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
+ ]);
36642
34992
  const panel = useInspectorPanel({
36643
34993
  identity: flowId ?? "",
36644
34994
  preferences: store.preferences,
@@ -36697,6 +35047,7 @@ function FlowEditor({ navigationIsland, onRun, onRunStarted, onCloseRuns, onConf
36697
35047
  const opener = useRef();
36698
35048
  useEffect(() => {
36699
35049
  setStartId(void 0);
35050
+ setPngExportOpen(false);
36700
35051
  focusInspectorOnOpen.current = false;
36701
35052
  opener.current = void 0;
36702
35053
  }, [flowId]);
@@ -36757,269 +35108,266 @@ function FlowEditor({ navigationIsland, onRun, onRunStarted, onCloseRuns, onConf
36757
35108
  onRedo: () => void store.workspace.redo(),
36758
35109
  onRetry: () => void store.workspace.retryHistorySync()
36759
35110
  };
36760
- return /* @__PURE__ */ jsx(NodeHistoryContext.Provider, {
36761
- value: (nodeId) => {
36762
- const node = revision?.graph().nodes[nodeId];
36763
- if (flowId == null || node?.kind !== "task" || !("executor" in node.task) || node.task.executor.kind !== "skip-duplicates") return void 0;
36764
- return {
36765
- label: t("flowState.history"),
36766
- onClick: () => setStateTarget({ history: { nodeId } })
36767
- };
36768
- },
36769
- children: /* @__PURE__ */ jsxs(CanvasHistoryScope, {
36770
- history: historyControls,
36771
- disabled: authoringDisabled,
36772
- "aria-label": t("workspace.design"),
36773
- className: `editor-grid ${contextPanelVisible ? "" : "context-panel-closed"}`,
36774
- id: "workspace-panel-design",
36775
- role: "region",
36776
- tabIndex: 0,
36777
- children: [
36778
- flowId != null && stateTarget != null && /* @__PURE__ */ jsx(FlowStateButton, {
36779
- client: store.state,
36780
- flowId,
36781
- nodes: designer.nodes,
36782
- notify: store.workspace.notify,
36783
- history: stateTarget.history,
36784
- onClose: () => setStateTarget(void 0)
36785
- }, `${flowId}:${stateTarget.history?.nodeId ?? "all"}`),
36786
- /* @__PURE__ */ jsx(WorkbenchCanvas, {
36787
- interactiveMode$: store.interactiveMode$,
36788
- connectionControl: /* @__PURE__ */ jsx(ConnectionUsageButton, {
36789
- connectionHref,
36790
- onManage: onManageConnectorAccess,
36791
- onSelectReference: setAccountReference,
36792
- store
36793
- }, flowId),
36794
- topLeftTools: navigationIsland,
36795
- bottomRightTools: /* @__PURE__ */ jsx(RunStatusIslandContainer, {
36796
- onToggle: onToggleRuns,
36797
- open: runDrawerOpen,
36798
- panelId: RUN_LOG_PANEL_ID,
36799
- store
36800
- }),
36801
- cornerLeading: /* @__PURE__ */ jsxs("div", {
36802
- className: "workspace-corner-leading",
36803
- children: [diagnostics?.valid == false && diagnosticItems.length > 0 && /* @__PURE__ */ jsx(WorkspaceDiagnosticsIsland, {
36804
- checking: checkLoading,
36805
- items: diagnosticItems,
36806
- nodes: designerNodes,
36807
- onOpenChange: (open) => {
36808
- if (open) store.runRequests.dismissInputs();
36809
- setDiagnosticsOpen(open);
36810
- },
36811
- onRefresh: () => void store.workspace.check(),
36812
- onSelect: (item) => {
36813
- if (store.workspace.locateDiagnostic(item)) setDiagnosticsOpen(false);
36814
- },
36815
- onSelectNode: (nodeId) => {
36816
- if (store.workspace.locateNode(nodeId)) {
36817
- openInspector();
36818
- setDiagnosticsOpen(false);
36819
- }
36820
- },
36821
- open: diagnosticsOpen
36822
- }), /* @__PURE__ */ jsx(WorkspacePublishIsland, {
36823
- onExportPng: connectorAccess.access?.mode != "selectable" || designer.nodes.length == 0 ? void 0 : (options) => store.exportPng(language, {
36824
- ...options,
36825
- ignoredNodeIds
36826
- }),
36827
- preferences: store.preferences,
36828
- onExport: () => {
36829
- const id = store.workspace.$.flowId.value;
36830
- if (id != null) store.workspace.exportFlow(id);
36831
- },
36832
- hasPublications: live == null ? void 0 : live.publication != null,
36833
- onOpenPublications,
36834
- onOpenRuns,
36835
- onOpenState: flowId == null ? void 0 : () => setStateTarget({}),
36836
- onPublish: () => void store.publications.publish(),
36837
- state: publishState
36838
- })]
36839
- }),
36840
- history: historyControls,
36841
- ignoredNodeIds,
36842
- onIgnoreNodes,
36843
- runControl: draft != null && selectedTrigger != null ? /* @__PURE__ */ jsx(RunControl, {
36844
- disabled: busy != null && busy != "run" && busy != "designer",
36845
- inputContent: /* @__PURE__ */ jsx(RunInputPanel, {
36846
- onStarted: onRunStarted,
36847
- store: store.runRequests,
36848
- theme
36849
- }),
36850
- inputOpen: runInputRequest?.triggerId == selectedTrigger.id,
36851
- inputStatus: store.runRequests.inputStatus(draft.flowId, draft, selectedTrigger.id),
36852
- onInputOpenChange: (open) => {
36853
- if (open) store.editDraftRunInputs(selectedTrigger.id);
36854
- else store.runRequests.dismissInputs();
36855
- },
36856
- onRun: () => onRun(selectedTrigger.id),
36857
- onSelectTrigger: (triggerId) => {
36858
- store.runRequests.dismissInputs();
36859
- setStartId(triggerId);
36860
- },
36861
- selectedTriggerId: selectedTrigger.id,
36862
- starting: busy == "run",
36863
- triggers
36864
- }) : void 0,
36865
- addNodeControl: /* @__PURE__ */ jsx(NodePickerPopover, {
36866
- options: addNodeOptions,
36867
- connections,
36868
- loadConnections: store.connectors.loadConnections,
36869
- browseOptions: store.browseAddNodeOptions,
36870
- searchOptions: store.provideAddNodeOptions,
36871
- provideChoices: store.provideAddNodeOptionChoices,
36872
- catalogFailed: triggerCatalogState.error != null,
36873
- refreshCatalog: store.retryCatalog,
36874
- initialTab: initialAddNodeTab,
36875
- disabled: authoringDisabled,
36876
- focusRequest: 0,
36877
- onAdd: addFromPicker,
36878
- onRegisterDragOption: (option) => designerRef.current?.registerDraggedNode(option),
36879
- onDragEnd: () => designerRef.current?.clearDraggedNode()
36880
- }, flowId ?? ""),
36881
- nodePicker: {
36882
- connections,
36883
- loadConnections: store.connectors.loadConnections,
36884
- browseOptions: store.browseAddNodeOptions,
36885
- provideChoices: store.provideAddNodeOptionChoices,
36886
- catalogFailed: triggerCatalogState.error != null,
36887
- refreshCatalog: store.retryCatalog,
36888
- initialTab: initialAddNodeTab
36889
- },
36890
- addNodeOptions,
36891
- disabled: authoringDisabled,
36892
- subscribeCanvasCommands: store.workspace.subscribeCanvasCommands,
36893
- focusNodeRequest: diagnosticFocus ?? nodeFocus,
36894
- inspectorOpen: contextPanelVisible,
36895
- model: designer,
36896
- annotationContext: canvasAnnotations(flowId, draft, workspaceStatus, moduleEditor?.status, history.failed),
36897
- onAddNode: async (option, position, connection) => {
36898
- const nodeId = await store.addNode(option, position, connection);
36899
- if (nodeId != null && flowId != null && store.workspace.$.flowId.value == flowId) {
36900
- setAddedNode({
36901
- flowId,
36902
- nodeId
36903
- });
36904
- if (panel.open) panel.activate([nodeId]);
36905
- }
36906
- return nodeId;
36907
- },
36908
- onConnect: (edge) => void store.workspace.connect(edge),
36909
- onChangeNodeContentHidden: (nodeId, hidden) => void store.workspace.saveNodeContentHidden(nodeId, hidden),
36910
- onChangeNodeWidth: (nodeId, width, position) => store.workspace.saveNodeWidth(nodeId, width, position),
36911
- onChangeComment: (nodeId, value) => void store.workspace.saveComment(nodeId, value),
36912
- onCopy: () => store.workspace.copySelectedNodes(),
36913
- onDeleteEdge: (edge) => void store.workspace.disconnect(edge),
36914
- onDeleteNodes: () => void store.workspace.deleteSelectedNodes(),
36915
- onDuplicate: (positions, offset) => void store.workspace.duplicateSelectedNodes(positions, offset),
36916
- onMoveNodes: (positions) => void store.workspace.moveNodes(positions),
36917
- onChangeDirection: (direction, positions) => store.changeDirection(direction, positions),
36918
- onMoveViewport: (viewport) => void store.workspace.moveViewport(viewport),
36919
- onPaste: () => void store.workspace.pasteNodes(),
36920
- provideAddNodeOptions: store.provideAddNodeOptions,
36921
- onSelectNodes: panel.select,
36922
- onActivateSelection: panel.activate,
36923
- onSelectionStart: panel.startSelection,
36924
- onSelectionEnd: panel.endSelection,
36925
- onToggleInspector: toggleInspector,
36926
- ref: designerRef,
36927
- selectedNodeIds: panel.canvasSelection,
36928
- theme
35111
+ return /* @__PURE__ */ jsxs(CanvasHistoryScope, {
35112
+ history: historyControls,
35113
+ disabled: authoringDisabled,
35114
+ "aria-label": t("workspace.design"),
35115
+ className: `editor-grid ${contextPanelVisible ? "" : "context-panel-closed"}`,
35116
+ id: "workspace-panel-design",
35117
+ role: "region",
35118
+ tabIndex: 0,
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
+ }),
35131
+ flowId != null && stateOpen && /* @__PURE__ */ jsx(FlowStateButton, {
35132
+ client: store.state,
35133
+ flowId,
35134
+ nodes: designer.nodes,
35135
+ notify: store.workspace.notify,
35136
+ onClose: () => setStateOpen(false)
35137
+ }, flowId),
35138
+ /* @__PURE__ */ jsx(WorkbenchCanvas, {
35139
+ interactiveMode$: store.interactiveMode$,
35140
+ connectionControl: /* @__PURE__ */ jsx(ConnectionUsageButton, {
35141
+ connectionHref,
35142
+ onManage: onManageConnectorAccess,
35143
+ onSelectReference: setAccountReference,
35144
+ store
35145
+ }, flowId),
35146
+ topLeftTools: navigationIsland,
35147
+ bottomRightTools: /* @__PURE__ */ jsx(RunStatusIslandContainer, {
35148
+ onToggle: onToggleRuns,
35149
+ open: runDrawerOpen,
35150
+ panelId: RUN_LOG_PANEL_ID,
35151
+ store
36929
35152
  }),
36930
- contextPanelVisible && /* @__PURE__ */ jsxs(EditorContextPanel, {
36931
- resizable: true,
36932
- onBack: !flowSelected ? () => {
36933
- panel.back();
36934
- designerRef.current?.focusCanvas();
36935
- } : void 0,
36936
- nodeId: singleSelected ? selectedDesignerNode?.id : void 0,
36937
- nodeHeading: singleSelected && selection != null ? {
36938
- titleReadOnly: selection.kind === "trigger" && (selection.trigger.kind === "manual" || selection.trigger.kind === "start"),
36939
- title: selection.node.name ?? selectedDesignerNode?.title ?? "",
36940
- icon: selectedDesignerNode != null && "icon" in selectedDesignerNode ? selectedDesignerNode.icon : void 0,
36941
- disabled: authoringDisabled,
36942
- fallback: /* @__PURE__ */ jsx(Icon, { name: inspectorIcon(selection) }),
36943
- onRename: (name) => {
36944
- store.workspace.nodes.saveNodeTitle(selection.id, name);
35153
+ cornerLeading: /* @__PURE__ */ jsxs("div", {
35154
+ className: "workspace-corner-leading",
35155
+ children: [diagnostics?.valid == false && diagnosticItems.length > 0 && /* @__PURE__ */ jsx(WorkspaceDiagnosticsIsland, {
35156
+ checking: checkLoading,
35157
+ items: diagnosticItems,
35158
+ nodes: designerNodes,
35159
+ onOpenChange: (open) => {
35160
+ if (open) store.runRequests.dismissInputs();
35161
+ setDiagnosticsOpen(open);
36945
35162
  },
36946
- onIconChange: (icon) => {
36947
- store.workspace.nodes.saveNodeIcon(selection.id, icon);
35163
+ onRefresh: () => void store.workspace.check(),
35164
+ onSelect: (item) => {
35165
+ if (store.workspace.locateDiagnostic(item)) setDiagnosticsOpen(false);
36948
35166
  },
36949
- validate: (name) => {
36950
- if (revision == null) return;
36951
- const graph = revision.graph();
36952
- if (graph == null) return;
36953
- const issue = nodeNameIssue(graph, selection.id, name);
36954
- return issue == null ? void 0 : t(`inspector.node.${issue === "empty" ? "nameEmpty" : "nameDuplicate"}`);
36955
- }
36956
- } : singleSelected && selectedDesignerNode?.kind === "comment" ? {
36957
- title: selectedDesignerNode.title,
36958
- disabled: authoringDisabled,
36959
- fallback: /* @__PURE__ */ jsx("i", {
36960
- "aria-hidden": "true",
36961
- className: "i-codicon:note"
36962
- }),
36963
- validate: () => void 0,
36964
- onRename: (title) => {
36965
- store.workspace.saveComment(selectedDesignerNode.id, {
36966
- title,
36967
- content: selectedDesignerNode.content ?? ""
36968
- });
36969
- }
36970
- } : void 0,
36971
- focusOnOpen: focusInspectorOnOpen.current,
36972
- icon: contextPanelIcon,
36973
- onClose: () => closeContextPanel(opener.current),
36974
- theme,
36975
- title: contextPanelTitle,
36976
- children: [/* @__PURE__ */ jsx("div", {
36977
- hidden: !flowSelected,
36978
- className: flowSelected ? "flex h-full min-h-0 flex-col" : "hidden",
36979
- children: /* @__PURE__ */ jsx("div", {
36980
- className: "min-h-0 flex-1",
36981
- children: /* @__PURE__ */ jsx(FlowNodeList, {
36982
- groupTriggers: true,
36983
- nodes: designer.nodes,
36984
- onFocusNode: focusNode,
36985
- onSelect: selectOutlineNode
36986
- }, flowId ?? "")
36987
- })
36988
- }), multipleSelected ? /* @__PURE__ */ jsx(FlowNodeList, {
36989
- nodes: designer.nodes.filter((node) => selectedNodeIds.includes(node.id)),
36990
- onSelect: selectOutlineNode,
36991
- onFocusNode: focusNode
36992
- }) : flowSelected ? null : selectedDesignerNode?.kind == "comment" ? /* @__PURE__ */ jsx(CommentInspector, {
36993
- title: selectedDesignerNode.title,
36994
- content: selectedDesignerNode.content ?? "",
36995
- disabled: authoringDisabled,
36996
- dark: theme == "dark",
36997
- onSave: (comment) => void store.workspace.saveComment(selectedDesignerNode.id, comment)
36998
- }, selectedDesignerNode.id) : revision != null && /* @__PURE__ */ jsx(NodeInspectorContainer, {
36999
- onAddWorkflowOutputs: () => {
37000
- const option = store.workspace.$.addNodeOptions.value.find((item) => item.kind === "outputs");
37001
- if (option != null) addFromPicker(option);
35167
+ onSelectNode: (nodeId) => {
35168
+ if (store.workspace.locateNode(nodeId)) {
35169
+ openInspector();
35170
+ setDiagnosticsOpen(false);
35171
+ }
37002
35172
  },
37003
- store,
37004
- focus: diagnosticFocus,
37005
- disabled: authoringDisabled,
37006
- revision,
37007
- selection,
37008
- theme
35173
+ open: diagnosticsOpen
35174
+ }), /* @__PURE__ */ jsx(WorkspacePublishIsland, {
35175
+ onOpenPngExport: connectorAccess.access?.mode != "selectable" || designer.nodes.length == 0 ? void 0 : () => setPngExportOpen(true),
35176
+ onExport: () => {
35177
+ const id = store.workspace.$.flowId.value;
35178
+ if (id != null) store.workspace.exportFlow(id);
35179
+ },
35180
+ hasPublications: live == null ? void 0 : live.publication != null,
35181
+ onOpenPublications,
35182
+ onOpenRuns,
35183
+ onOpenState: flowId == null ? void 0 : () => setStateOpen(true),
35184
+ onPublish: () => void store.publications.publish(),
35185
+ state: publishState
37009
35186
  })]
37010
35187
  }),
37011
- /* @__PURE__ */ jsx(RunDrawerContainer, {
37012
- onOpenRuns,
37013
- onClose: onCloseRuns,
37014
- onConfigureConnector,
37015
- open: runDrawerOpen,
37016
- store
37017
- })
37018
- ]
37019
- })
35188
+ history: historyControls,
35189
+ ignoredNodeIds,
35190
+ onIgnoreNodes,
35191
+ runControl: draft != null && selectedTrigger != null ? /* @__PURE__ */ jsx(RunControl, {
35192
+ disabled: busy != null && busy != "run" && busy != "designer",
35193
+ inputContent: /* @__PURE__ */ jsx(RunInputPanel, {
35194
+ onStarted: onRunStarted,
35195
+ store: store.runRequests,
35196
+ theme
35197
+ }),
35198
+ inputOpen: runInputRequest?.triggerId == selectedTrigger.id,
35199
+ inputStatus: store.runRequests.inputStatus(draft.flowId, draft, selectedTrigger.id),
35200
+ onInputOpenChange: (open) => {
35201
+ if (open) store.editDraftRunInputs(selectedTrigger.id);
35202
+ else store.runRequests.dismissInputs();
35203
+ },
35204
+ onRun: () => onRun(selectedTrigger.id),
35205
+ onSelectTrigger: (triggerId) => {
35206
+ store.runRequests.dismissInputs();
35207
+ setStartId(triggerId);
35208
+ },
35209
+ selectedTriggerId: selectedTrigger.id,
35210
+ starting: busy == "run",
35211
+ triggers
35212
+ }) : void 0,
35213
+ addNodeControl: /* @__PURE__ */ jsx(NodePickerPopover, {
35214
+ options: addNodeOptions,
35215
+ connections,
35216
+ loadConnections: store.connectors.loadConnections,
35217
+ browseOptions: store.browseAddNodeOptions,
35218
+ searchOptions: store.provideAddNodeOptions,
35219
+ provideChoices: store.provideAddNodeOptionChoices,
35220
+ catalogFailed: triggerCatalogState.error != null,
35221
+ refreshCatalog: store.retryCatalog,
35222
+ initialTab: initialAddNodeTab,
35223
+ disabled: authoringDisabled,
35224
+ focusRequest: 0,
35225
+ onAdd: addFromPicker,
35226
+ onRegisterDragOption: (option) => designerRef.current?.registerDraggedNode(option),
35227
+ onDragEnd: () => designerRef.current?.clearDraggedNode()
35228
+ }, flowId ?? ""),
35229
+ nodePicker: {
35230
+ connections,
35231
+ loadConnections: store.connectors.loadConnections,
35232
+ browseOptions: store.browseAddNodeOptions,
35233
+ provideChoices: store.provideAddNodeOptionChoices,
35234
+ catalogFailed: triggerCatalogState.error != null,
35235
+ refreshCatalog: store.retryCatalog,
35236
+ initialTab: initialAddNodeTab
35237
+ },
35238
+ addNodeOptions,
35239
+ disabled: authoringDisabled,
35240
+ subscribeCanvasCommands: store.workspace.subscribeCanvasCommands,
35241
+ focusNodeRequest: diagnosticFocus ?? nodeFocus,
35242
+ inspectorOpen: contextPanelVisible,
35243
+ model: designer,
35244
+ annotationContext: canvasAnnotations(flowId, draft, workspaceStatus, moduleEditor?.status, history.failed),
35245
+ onAddNode: async (option, position, connection) => {
35246
+ const nodeId = await store.addNode(option, position, connection);
35247
+ if (nodeId != null && flowId != null && store.workspace.$.flowId.value == flowId) {
35248
+ setAddedNode({
35249
+ flowId,
35250
+ nodeId
35251
+ });
35252
+ if (panel.open) panel.activate([nodeId]);
35253
+ }
35254
+ return nodeId;
35255
+ },
35256
+ onConnect: (edge) => void store.workspace.connect(edge),
35257
+ onChangeNodeContentHidden: (nodeId, hidden) => void store.workspace.saveNodeContentHidden(nodeId, hidden),
35258
+ onChangeNodeWidth: (nodeId, width, position) => store.workspace.saveNodeWidth(nodeId, width, position),
35259
+ onChangeComment: (nodeId, value) => void store.workspace.saveComment(nodeId, value),
35260
+ onCopy: () => store.workspace.copySelectedNodes(),
35261
+ onDeleteEdge: (edge) => void store.workspace.disconnect(edge),
35262
+ onDeleteNodes: () => void store.workspace.deleteSelectedNodes(),
35263
+ onDuplicate: (positions, offset) => void store.workspace.duplicateSelectedNodes(positions, offset),
35264
+ onMoveNodes: (positions) => void store.workspace.moveNodes(positions),
35265
+ onChangeDirection: (direction, positions) => store.changeDirection(direction, positions),
35266
+ onMoveViewport: (viewport) => void store.workspace.moveViewport(viewport),
35267
+ onPaste: () => void store.workspace.pasteNodes(),
35268
+ provideAddNodeOptions: store.provideAddNodeOptions,
35269
+ onSelectNodes: panel.select,
35270
+ onActivateSelection: panel.activate,
35271
+ onSelectionStart: panel.startSelection,
35272
+ onSelectionEnd: panel.endSelection,
35273
+ onToggleInspector: toggleInspector,
35274
+ ref: designerRef,
35275
+ selectedNodeIds: panel.canvasSelection,
35276
+ theme
35277
+ }),
35278
+ contextPanelVisible && /* @__PURE__ */ jsxs(EditorContextPanel, {
35279
+ resizable: true,
35280
+ onBack: !flowSelected ? () => {
35281
+ panel.back();
35282
+ designerRef.current?.focusCanvas();
35283
+ } : void 0,
35284
+ nodeId: singleSelected ? selectedDesignerNode?.id : void 0,
35285
+ nodeHeading: singleSelected && selection != null ? {
35286
+ titleReadOnly: selection.kind === "trigger" && (selection.trigger.kind === "manual" || selection.trigger.kind === "start"),
35287
+ title: selection.node.name ?? selectedDesignerNode?.title ?? "",
35288
+ icon: selectedDesignerNode != null && "icon" in selectedDesignerNode ? selectedDesignerNode.icon : void 0,
35289
+ disabled: authoringDisabled,
35290
+ fallback: /* @__PURE__ */ jsx(Icon, { name: inspectorIcon(selection) }),
35291
+ onRename: (name) => {
35292
+ store.workspace.nodes.saveNodeTitle(selection.id, name);
35293
+ },
35294
+ onIconChange: (icon) => {
35295
+ store.workspace.nodes.saveNodeIcon(selection.id, icon);
35296
+ },
35297
+ validate: (name) => {
35298
+ if (revision == null) return;
35299
+ const graph = revision.graph();
35300
+ if (graph == null) return;
35301
+ const issue = nodeNameIssue(graph, selection.id, name);
35302
+ return issue == null ? void 0 : t(`inspector.node.${issue === "empty" ? "nameEmpty" : "nameDuplicate"}`);
35303
+ }
35304
+ } : singleSelected && selectedDesignerNode?.kind === "comment" ? {
35305
+ title: selectedDesignerNode.title,
35306
+ disabled: authoringDisabled,
35307
+ fallback: /* @__PURE__ */ jsx("i", {
35308
+ "aria-hidden": "true",
35309
+ className: "i-codicon:note"
35310
+ }),
35311
+ validate: () => void 0,
35312
+ onRename: (title) => {
35313
+ store.workspace.saveComment(selectedDesignerNode.id, {
35314
+ title,
35315
+ content: selectedDesignerNode.content ?? ""
35316
+ });
35317
+ }
35318
+ } : void 0,
35319
+ focusOnOpen: focusInspectorOnOpen.current,
35320
+ icon: contextPanelIcon,
35321
+ onClose: () => closeContextPanel(opener.current),
35322
+ theme,
35323
+ title: contextPanelTitle,
35324
+ children: [/* @__PURE__ */ jsx("div", {
35325
+ hidden: !flowSelected,
35326
+ className: flowSelected ? "flex h-full min-h-0 flex-col" : "hidden",
35327
+ children: /* @__PURE__ */ jsx("div", {
35328
+ className: "min-h-0 flex-1",
35329
+ children: /* @__PURE__ */ jsx(FlowNodeList, {
35330
+ groupTriggers: true,
35331
+ nodes: designer.nodes,
35332
+ onFocusNode: focusNode,
35333
+ onSelect: selectOutlineNode
35334
+ }, flowId ?? "")
35335
+ })
35336
+ }), multipleSelected ? /* @__PURE__ */ jsx(FlowNodeList, {
35337
+ nodes: designer.nodes.filter((node) => selectedNodeIds.includes(node.id)),
35338
+ onSelect: selectOutlineNode,
35339
+ onFocusNode: focusNode
35340
+ }) : flowSelected ? null : selectedDesignerNode?.kind == "comment" ? /* @__PURE__ */ jsx(CommentInspector, {
35341
+ title: selectedDesignerNode.title,
35342
+ content: selectedDesignerNode.content ?? "",
35343
+ disabled: authoringDisabled,
35344
+ dark: theme == "dark",
35345
+ onSave: (comment) => void store.workspace.saveComment(selectedDesignerNode.id, comment)
35346
+ }, selectedDesignerNode.id) : revision != null && /* @__PURE__ */ jsx(NodeInspectorContainer, {
35347
+ onAddWorkflowOutputs: () => {
35348
+ const option = store.workspace.$.addNodeOptions.value.find((item) => item.kind === "outputs");
35349
+ if (option != null) addFromPicker(option);
35350
+ },
35351
+ store,
35352
+ focus: diagnosticFocus,
35353
+ disabled: authoringDisabled,
35354
+ revision,
35355
+ selection,
35356
+ theme
35357
+ })]
35358
+ }),
35359
+ /* @__PURE__ */ jsx(RunDrawerContainer, {
35360
+ onOpenRuns,
35361
+ onClose: onCloseRuns,
35362
+ onConfigureConnector,
35363
+ open: runDrawerOpen,
35364
+ store
35365
+ })
35366
+ ]
37020
35367
  });
37021
35368
  }
37022
35369
  function FlowWorkspace({ hrefFor, navigation, onConfigureConnector, onManageConnectorAccess, connectionHref, store, theme }) {
35370
+ const [transferContainer, setTransferContainer] = useState(null);
37023
35371
  const t = useTranslate();
37024
35372
  const [runDrawerOpen, setRunDrawerOpen] = useState(() => readRunDrawerOpen(store.preferences) ?? false);
37025
35373
  const runDrawerPreference = useRef(readRunDrawerOpen(store.preferences));
@@ -37102,6 +35450,8 @@ function FlowWorkspace({ hrefFor, navigation, onConfigureConnector, onManageConn
37102
35450
  onSelectFlow: (target) => void navigation.selectFlow(target)
37103
35451
  }, flow.flowId),
37104
35452
  flowName: flow?.name ?? flow?.flowId ?? "",
35453
+ flowIcon: flow?.icon,
35454
+ flowDescription: flow?.description,
37105
35455
  flowsHref: hrefFor({ view: "design" }),
37106
35456
  onOpenFlows: () => void navigation.openFlows()
37107
35457
  });
@@ -37109,64 +35459,73 @@ function FlowWorkspace({ hrefFor, navigation, onConfigureConnector, onManageConn
37109
35459
  value: hrefFor,
37110
35460
  children: /* @__PURE__ */ jsxs("main", {
37111
35461
  className: "workspace",
37112
- children: [view == "design" && !canvasReady && /* @__PURE__ */ jsx("div", {
37113
- className: "workspace-navigation-placement",
37114
- children: navigationIsland
37115
- }), view == "design" && !canvasReady ? /* @__PURE__ */ jsx("div", {
37116
- "aria-label": t("workspace.design"),
37117
- className: "editor-grid context-panel-closed",
37118
- id: "workspace-panel-design",
37119
- role: "region",
37120
- tabIndex: 0,
37121
- children: /* @__PURE__ */ jsx("section", {
37122
- "aria-busy": !workspaceLoadFailed,
37123
- className: "canvas-panel workbench-canvas",
37124
- children: workspaceLoadFailed ? /* @__PURE__ */ jsx(WorkspaceRecovery, {
37125
- kind: workspaceLoadProblem?.kind ?? "failed",
37126
- message: workspaceLoadProblem?.message,
37127
- repairing: workspaceRepairing,
37128
- onRepair: () => void store.workspace.repairWorkspace(),
37129
- onRetry: () => flowId != null && void store.selectFlow(flowId)
37130
- }) : /* @__PURE__ */ jsx(Empty, {
37131
- className: "h-full",
37132
- children: /* @__PURE__ */ jsx(EmptyHeader, { children: /* @__PURE__ */ jsx(EmptyTitle, { children: t("workspace.status.loading") }) })
35462
+ ref: setTransferContainer,
35463
+ children: [
35464
+ /* @__PURE__ */ jsx(WorkflowExportDialog, {
35465
+ workspace: store.workspace,
35466
+ container: transferContainer
35467
+ }),
35468
+ view == "design" && !canvasReady && /* @__PURE__ */ jsx("div", {
35469
+ className: "workspace-navigation-placement",
35470
+ children: navigationIsland
35471
+ }),
35472
+ view == "design" && !canvasReady ? /* @__PURE__ */ jsx("div", {
35473
+ "aria-label": t("workspace.design"),
35474
+ className: "editor-grid context-panel-closed",
35475
+ id: "workspace-panel-design",
35476
+ role: "region",
35477
+ tabIndex: 0,
35478
+ children: /* @__PURE__ */ jsx("section", {
35479
+ "aria-busy": !workspaceLoadFailed,
35480
+ className: "canvas-panel workbench-canvas",
35481
+ children: workspaceLoadFailed ? /* @__PURE__ */ jsx(WorkspaceRecovery, {
35482
+ kind: workspaceLoadProblem?.kind ?? "failed",
35483
+ message: workspaceLoadProblem?.message,
35484
+ repairing: workspaceRepairing,
35485
+ onRepair: () => void store.workspace.repairWorkspace(),
35486
+ onRetry: () => flowId != null && void store.selectFlow(flowId)
35487
+ }) : /* @__PURE__ */ jsx(Empty, {
35488
+ className: "h-full",
35489
+ children: /* @__PURE__ */ jsx(EmptyHeader, { children: /* @__PURE__ */ jsx(EmptyTitle, { children: t("workspace.status.loading") }) })
35490
+ })
37133
35491
  })
37134
- })
37135
- }) : view == "design" ? /* @__PURE__ */ jsx(FlowEditor, {
37136
- navigationIsland,
37137
- onRun: (triggerId) => void run(triggerId),
37138
- onRunStarted: revealRun,
37139
- onCloseRuns: () => changeRunDrawerOpen(false),
37140
- onConfigureConnector,
37141
- onOpenPublications: () => {
37142
- store.runRequests.dismissInputs();
37143
- navigation.open("publications");
37144
- },
37145
- onOpenRuns: () => {
37146
- store.runRequests.dismissInputs();
37147
- navigation.open("runs");
37148
- },
37149
- onManageConnectorAccess,
37150
- connectionHref,
37151
- onToggleRuns: () => changeRunDrawerOpen(!runDrawerOpen),
37152
- runDrawerOpen,
37153
- store,
37154
- theme
37155
- }) : view == "runs" ? /* @__PURE__ */ jsx(RunsView, {
37156
- onSourceChange: (source) => navigation.open("runs", source),
37157
- flowName: flow?.name ?? flow?.flowId ?? "",
37158
- onClose: () => navigation.open("design"),
37159
- onConfigureConnector,
37160
- onLocateEvent: locateRunEvent,
37161
- onLocateWait: (nodeId) => {
37162
- if (store.locateRunWait(nodeId)) navigation.open("design");
37163
- },
37164
- store
37165
- }) : /* @__PURE__ */ jsx(PublicationsView, {
37166
- theme,
37167
- onClose: () => navigation.open("design"),
37168
- store
37169
- }, flowId)]
35492
+ }) : view == "design" ? /* @__PURE__ */ jsx(FlowEditor, {
35493
+ portalRoot: transferContainer,
35494
+ navigationIsland,
35495
+ onRun: (triggerId) => void run(triggerId),
35496
+ onRunStarted: revealRun,
35497
+ onCloseRuns: () => changeRunDrawerOpen(false),
35498
+ onConfigureConnector,
35499
+ onOpenPublications: () => {
35500
+ store.runRequests.dismissInputs();
35501
+ navigation.open("publications");
35502
+ },
35503
+ onOpenRuns: () => {
35504
+ store.runRequests.dismissInputs();
35505
+ navigation.open("runs");
35506
+ },
35507
+ onManageConnectorAccess,
35508
+ connectionHref,
35509
+ onToggleRuns: () => changeRunDrawerOpen(!runDrawerOpen),
35510
+ runDrawerOpen,
35511
+ store,
35512
+ theme
35513
+ }) : view == "runs" ? /* @__PURE__ */ jsx(RunsView, {
35514
+ onSourceChange: (source) => navigation.open("runs", source),
35515
+ flowName: flow?.name ?? flow?.flowId ?? "",
35516
+ onClose: () => navigation.open("design"),
35517
+ onConfigureConnector,
35518
+ onLocateEvent: locateRunEvent,
35519
+ onLocateWait: (nodeId) => {
35520
+ if (store.locateRunWait(nodeId)) navigation.open("design");
35521
+ },
35522
+ store
35523
+ }) : /* @__PURE__ */ jsx(PublicationsView, {
35524
+ theme,
35525
+ onClose: () => navigation.open("design"),
35526
+ store
35527
+ }, flowId)
35528
+ ]
37170
35529
  })
37171
35530
  }) });
37172
35531
  }