@octaviaflow/core 3.0.18-beta.0 → 3.0.18-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-2NGC7AI3.js +2637 -0
- package/dist/chunk-2NGC7AI3.js.map +1 -0
- package/dist/chunk-2O6K5PLY.js +2637 -0
- package/dist/chunk-2O6K5PLY.js.map +1 -0
- package/dist/chunk-4ZALUTZS.js +2936 -0
- package/dist/chunk-4ZALUTZS.js.map +1 -0
- package/dist/chunk-C3UD2AZ5.js +2637 -0
- package/dist/chunk-C3UD2AZ5.js.map +1 -0
- package/dist/chunk-CEUP4NK2.js +2850 -0
- package/dist/chunk-CEUP4NK2.js.map +1 -0
- package/dist/chunk-EERNYLFL.js +2860 -0
- package/dist/chunk-EERNYLFL.js.map +1 -0
- package/dist/chunk-EKFDJX4G.js +2872 -0
- package/dist/chunk-EKFDJX4G.js.map +1 -0
- package/dist/chunk-GJA3GJUZ.js +2844 -0
- package/dist/chunk-GJA3GJUZ.js.map +1 -0
- package/dist/chunk-IOKUV7FD.js +2658 -0
- package/dist/chunk-IOKUV7FD.js.map +1 -0
- package/dist/chunk-J7YASALS.js +2859 -0
- package/dist/chunk-J7YASALS.js.map +1 -0
- package/dist/chunk-JIEUYBQT.js +2658 -0
- package/dist/chunk-JIEUYBQT.js.map +1 -0
- package/dist/chunk-KYMYNYFV.js +2656 -0
- package/dist/chunk-KYMYNYFV.js.map +1 -0
- package/dist/chunk-PVJXX6GP.js +2640 -0
- package/dist/chunk-PVJXX6GP.js.map +1 -0
- package/dist/chunk-S2SSBMWJ.js +2658 -0
- package/dist/chunk-S2SSBMWJ.js.map +1 -0
- package/dist/chunk-WEPTBLWX.js +2847 -0
- package/dist/chunk-WEPTBLWX.js.map +1 -0
- package/dist/chunk-WG4ZQMPS.js +2844 -0
- package/dist/chunk-WG4ZQMPS.js.map +1 -0
- package/dist/chunk-XEPEBHAW.js +2808 -0
- package/dist/chunk-XEPEBHAW.js.map +1 -0
- package/dist/chunk-XG2OYFX6.js +2925 -0
- package/dist/chunk-XG2OYFX6.js.map +1 -0
- package/dist/components/Accordion/Accordion.d.ts +45 -0
- package/dist/components/Accordion/Accordion.d.ts.map +1 -0
- package/dist/components/Accordion/index.d.ts +2 -0
- package/dist/components/Accordion/index.d.ts.map +1 -0
- package/dist/components/AgentCard/AgentCard.d.ts +53 -7
- package/dist/components/AgentCard/AgentCard.d.ts.map +1 -1
- package/dist/components/AlertCard/AlertCard.d.ts +76 -0
- package/dist/components/AlertCard/AlertCard.d.ts.map +1 -0
- package/dist/components/AlertCard/index.d.ts +2 -0
- package/dist/components/AlertCard/index.d.ts.map +1 -0
- package/dist/components/AuthCard/AuthCard.d.ts +29 -42
- package/dist/components/AuthCard/AuthCard.d.ts.map +1 -1
- package/dist/components/Avatar/Avatar.d.ts +48 -11
- package/dist/components/Avatar/Avatar.d.ts.map +1 -1
- package/dist/components/Avatar/index.d.ts +1 -1
- package/dist/components/Avatar/index.d.ts.map +1 -1
- package/dist/components/Badge/Badge.d.ts +46 -8
- package/dist/components/Badge/Badge.d.ts.map +1 -1
- package/dist/components/Badge/index.d.ts +1 -1
- package/dist/components/Badge/index.d.ts.map +1 -1
- package/dist/components/Banner/Banner.d.ts +53 -6
- package/dist/components/Banner/Banner.d.ts.map +1 -1
- package/dist/components/Banner/index.d.ts +1 -1
- package/dist/components/Banner/index.d.ts.map +1 -1
- package/dist/components/BarChart/BarChart.d.ts +62 -5
- package/dist/components/BarChart/BarChart.d.ts.map +1 -1
- package/dist/components/BarChart/index.d.ts +1 -1
- package/dist/components/BarChart/index.d.ts.map +1 -1
- package/dist/components/BlogCard/BlogCard.d.ts +39 -4
- package/dist/components/BlogCard/BlogCard.d.ts.map +1 -1
- package/dist/components/Button/Button.d.ts +23 -5
- package/dist/components/Button/Button.d.ts.map +1 -1
- package/dist/components/Calendar/Calendar.d.ts +53 -4
- package/dist/components/Calendar/Calendar.d.ts.map +1 -1
- package/dist/components/CalendarHeatmap/CalendarHeatmap.d.ts +47 -0
- package/dist/components/CalendarHeatmap/CalendarHeatmap.d.ts.map +1 -0
- package/dist/components/CalendarHeatmap/index.d.ts +2 -0
- package/dist/components/CalendarHeatmap/index.d.ts.map +1 -0
- package/dist/components/Callout/Callout.d.ts +33 -7
- package/dist/components/Callout/Callout.d.ts.map +1 -1
- package/dist/components/Callout/index.d.ts +1 -1
- package/dist/components/Callout/index.d.ts.map +1 -1
- package/dist/components/Card/Card.d.ts +49 -8
- package/dist/components/Card/Card.d.ts.map +1 -1
- package/dist/components/Card/index.d.ts +1 -1
- package/dist/components/Card/index.d.ts.map +1 -1
- package/dist/components/ChatBubble/ChatBubble.d.ts +32 -7
- package/dist/components/ChatBubble/ChatBubble.d.ts.map +1 -1
- package/dist/components/ChatBubble/index.d.ts +1 -1
- package/dist/components/ChatBubble/index.d.ts.map +1 -1
- package/dist/components/Checkbox/Checkbox.d.ts +16 -3
- package/dist/components/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/components/Checkbox/index.d.ts +1 -1
- package/dist/components/Checkbox/index.d.ts.map +1 -1
- package/dist/components/Chip/Chip.d.ts +28 -9
- package/dist/components/Chip/Chip.d.ts.map +1 -1
- package/dist/components/Chip/index.d.ts +1 -1
- package/dist/components/Chip/index.d.ts.map +1 -1
- package/dist/components/ChoiceCard/ChoiceCard.d.ts +44 -6
- package/dist/components/ChoiceCard/ChoiceCard.d.ts.map +1 -1
- package/dist/components/ChoiceCard/index.d.ts +1 -1
- package/dist/components/ChoiceCard/index.d.ts.map +1 -1
- package/dist/components/Coachmark/Coachmark.d.ts +52 -0
- package/dist/components/Coachmark/Coachmark.d.ts.map +1 -0
- package/dist/components/Coachmark/index.d.ts +2 -0
- package/dist/components/Coachmark/index.d.ts.map +1 -0
- package/dist/components/CodeEditor/CodeEditor.d.ts +10 -1
- package/dist/components/CodeEditor/CodeEditor.d.ts.map +1 -1
- package/dist/components/ColorPicker/ColorPicker.d.ts +25 -6
- package/dist/components/ColorPicker/ColorPicker.d.ts.map +1 -1
- package/dist/components/ColorPicker/index.d.ts +1 -1
- package/dist/components/ColorPicker/index.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPalette.d.ts +64 -0
- package/dist/components/CommandPalette/CommandPalette.d.ts.map +1 -0
- package/dist/components/CommandPalette/index.d.ts +2 -0
- package/dist/components/CommandPalette/index.d.ts.map +1 -0
- package/dist/components/ConditionBuilder/ConditionBuilder.d.ts +24 -4
- package/dist/components/ConditionBuilder/ConditionBuilder.d.ts.map +1 -1
- package/dist/components/ConfigPanel/ConfigPanel.d.ts +18 -12
- package/dist/components/ConfigPanel/ConfigPanel.d.ts.map +1 -1
- package/dist/components/ConfigPanel/index.d.ts +1 -1
- package/dist/components/ConfigPanel/index.d.ts.map +1 -1
- package/dist/components/ConfirmDialog/ConfirmDialog.d.ts +47 -0
- package/dist/components/ConfirmDialog/ConfirmDialog.d.ts.map +1 -0
- package/dist/components/ConfirmDialog/index.d.ts +2 -0
- package/dist/components/ConfirmDialog/index.d.ts.map +1 -0
- package/dist/components/ConnectorCard/ConnectorCard.d.ts +49 -0
- package/dist/components/ConnectorCard/ConnectorCard.d.ts.map +1 -0
- package/dist/components/ConnectorCard/index.d.ts +2 -0
- package/dist/components/ConnectorCard/index.d.ts.map +1 -0
- package/dist/components/ContextMenu/ContextMenu.d.ts +46 -0
- package/dist/components/ContextMenu/ContextMenu.d.ts.map +1 -0
- package/dist/components/ContextMenu/index.d.ts +2 -0
- package/dist/components/ContextMenu/index.d.ts.map +1 -0
- package/dist/components/CountUp/CountUp.d.ts +35 -0
- package/dist/components/CountUp/CountUp.d.ts.map +1 -0
- package/dist/components/CountUp/index.d.ts +2 -0
- package/dist/components/CountUp/index.d.ts.map +1 -0
- package/dist/components/CsvViewer/CsvViewer.d.ts +51 -0
- package/dist/components/CsvViewer/CsvViewer.d.ts.map +1 -0
- package/dist/components/CsvViewer/index.d.ts +2 -0
- package/dist/components/CsvViewer/index.d.ts.map +1 -0
- package/dist/components/DataMapper/DataMapper.d.ts +3 -3
- package/dist/components/DataMapper/DataMapper.d.ts.map +1 -1
- package/dist/components/DataTable/DataTable.d.ts +54 -4
- package/dist/components/DataTable/DataTable.d.ts.map +1 -1
- package/dist/components/DatasetCard/DatasetCard.d.ts +55 -0
- package/dist/components/DatasetCard/DatasetCard.d.ts.map +1 -0
- package/dist/components/DatasetCard/index.d.ts +2 -0
- package/dist/components/DatasetCard/index.d.ts.map +1 -0
- package/dist/components/DatePicker/DatePicker.d.ts +18 -5
- package/dist/components/DatePicker/DatePicker.d.ts.map +1 -1
- package/dist/components/DatePicker/index.d.ts +1 -1
- package/dist/components/DatePicker/index.d.ts.map +1 -1
- package/dist/components/DescriptionList/DescriptionList.d.ts +10 -6
- package/dist/components/DescriptionList/DescriptionList.d.ts.map +1 -1
- package/dist/components/DescriptionList/index.d.ts +1 -1
- package/dist/components/DescriptionList/index.d.ts.map +1 -1
- package/dist/components/Dialog/Dialog.d.ts +13 -5
- package/dist/components/Dialog/Dialog.d.ts.map +1 -1
- package/dist/components/Dialog/index.d.ts +1 -1
- package/dist/components/Dialog/index.d.ts.map +1 -1
- package/dist/components/Divider/Divider.d.ts +24 -0
- package/dist/components/Divider/Divider.d.ts.map +1 -0
- package/dist/components/Divider/index.d.ts +2 -0
- package/dist/components/Divider/index.d.ts.map +1 -0
- package/dist/components/DonutChart/DonutChart.d.ts +32 -4
- package/dist/components/DonutChart/DonutChart.d.ts.map +1 -1
- package/dist/components/Drawer/Drawer.d.ts +12 -5
- package/dist/components/Drawer/Drawer.d.ts.map +1 -1
- package/dist/components/Drawer/index.d.ts +1 -1
- package/dist/components/Drawer/index.d.ts.map +1 -1
- package/dist/components/DropdownMenu/DropdownMenu.d.ts +12 -2
- package/dist/components/DropdownMenu/DropdownMenu.d.ts.map +1 -1
- package/dist/components/EmptyState/EmptyState.d.ts +16 -6
- package/dist/components/EmptyState/EmptyState.d.ts.map +1 -1
- package/dist/components/EmptyState/index.d.ts +1 -1
- package/dist/components/EmptyState/index.d.ts.map +1 -1
- package/dist/components/ExecutionConsole/ExecutionConsole.d.ts +8 -2
- package/dist/components/ExecutionConsole/ExecutionConsole.d.ts.map +1 -1
- package/dist/components/FeatureCard/FeatureCard.d.ts +29 -10
- package/dist/components/FeatureCard/FeatureCard.d.ts.map +1 -1
- package/dist/components/FileDropzone/FileDropzone.d.ts +3 -3
- package/dist/components/FileDropzone/FileDropzone.d.ts.map +1 -1
- package/dist/components/FlowMinimap/FlowMinimap.d.ts +17 -1
- package/dist/components/FlowMinimap/FlowMinimap.d.ts.map +1 -1
- package/dist/components/FlowToolbar/FlowToolbar.d.ts +16 -10
- package/dist/components/FlowToolbar/FlowToolbar.d.ts.map +1 -1
- package/dist/components/Gauge/Gauge.d.ts +46 -0
- package/dist/components/Gauge/Gauge.d.ts.map +1 -0
- package/dist/components/Gauge/index.d.ts +2 -0
- package/dist/components/Gauge/index.d.ts.map +1 -0
- package/dist/components/Grid/Grid.d.ts +46 -0
- package/dist/components/Grid/Grid.d.ts.map +1 -0
- package/dist/components/Grid/index.d.ts +2 -0
- package/dist/components/Grid/index.d.ts.map +1 -0
- package/dist/components/Heatmap/Heatmap.d.ts +54 -0
- package/dist/components/Heatmap/Heatmap.d.ts.map +1 -0
- package/dist/components/Heatmap/index.d.ts +2 -0
- package/dist/components/Heatmap/index.d.ts.map +1 -0
- package/dist/components/IconCard/IconCard.d.ts +24 -6
- package/dist/components/IconCard/IconCard.d.ts.map +1 -1
- package/dist/components/IconCard/index.d.ts +1 -1
- package/dist/components/IconCard/index.d.ts.map +1 -1
- package/dist/components/InlineMessage/InlineMessage.d.ts +24 -0
- package/dist/components/InlineMessage/InlineMessage.d.ts.map +1 -0
- package/dist/components/InlineMessage/index.d.ts +2 -0
- package/dist/components/InlineMessage/index.d.ts.map +1 -0
- package/dist/components/Input/Input.d.ts.map +1 -1
- package/dist/components/IntegrationCard/IntegrationCard.d.ts +69 -0
- package/dist/components/IntegrationCard/IntegrationCard.d.ts.map +1 -0
- package/dist/components/IntegrationCard/index.d.ts +2 -0
- package/dist/components/IntegrationCard/index.d.ts.map +1 -0
- package/dist/components/JsonViewer/JsonViewer.d.ts +51 -10
- package/dist/components/JsonViewer/JsonViewer.d.ts.map +1 -1
- package/dist/components/JsonViewer/index.d.ts +1 -1
- package/dist/components/JsonViewer/index.d.ts.map +1 -1
- package/dist/components/KanbanCard/KanbanCard.d.ts +40 -7
- package/dist/components/KanbanCard/KanbanCard.d.ts.map +1 -1
- package/dist/components/Kbd/Kbd.d.ts +8 -9
- package/dist/components/Kbd/Kbd.d.ts.map +1 -1
- package/dist/components/Kbd/index.d.ts +1 -1
- package/dist/components/Kbd/index.d.ts.map +1 -1
- package/dist/components/LineChart/LineChart.d.ts +42 -4
- package/dist/components/LineChart/LineChart.d.ts.map +1 -1
- package/dist/components/LineChart/index.d.ts +1 -1
- package/dist/components/LineChart/index.d.ts.map +1 -1
- package/dist/components/LinkButton/LinkButton.d.ts +16 -4
- package/dist/components/LinkButton/LinkButton.d.ts.map +1 -1
- package/dist/components/LinkButton/index.d.ts +1 -1
- package/dist/components/LinkButton/index.d.ts.map +1 -1
- package/dist/components/MetricCard/MetricCard.d.ts +71 -0
- package/dist/components/MetricCard/MetricCard.d.ts.map +1 -0
- package/dist/components/MetricCard/index.d.ts +2 -0
- package/dist/components/MetricCard/index.d.ts.map +1 -0
- package/dist/components/MonacoEditor/MonacoDiffEditor.d.ts +22 -5
- package/dist/components/MonacoEditor/MonacoDiffEditor.d.ts.map +1 -1
- package/dist/components/MonacoEditor/MonacoEditor.d.ts +28 -7
- package/dist/components/MonacoEditor/MonacoEditor.d.ts.map +1 -1
- package/dist/components/MonacoEditor/index.d.ts +2 -2
- package/dist/components/MonacoEditor/index.d.ts.map +1 -1
- package/dist/components/MultiSelect/MultiSelect.d.ts +23 -7
- package/dist/components/MultiSelect/MultiSelect.d.ts.map +1 -1
- package/dist/components/MultiSelect/index.d.ts +1 -1
- package/dist/components/MultiSelect/index.d.ts.map +1 -1
- package/dist/components/NumberInput/NumberInput.d.ts +13 -7
- package/dist/components/NumberInput/NumberInput.d.ts.map +1 -1
- package/dist/components/NumberInput/index.d.ts +1 -1
- package/dist/components/NumberInput/index.d.ts.map +1 -1
- package/dist/components/OTPInput/OTPInput.d.ts +27 -4
- package/dist/components/OTPInput/OTPInput.d.ts.map +1 -1
- package/dist/components/OTPInput/index.d.ts +1 -1
- package/dist/components/OTPInput/index.d.ts.map +1 -1
- package/dist/components/Pagination/Pagination.d.ts +50 -0
- package/dist/components/Pagination/Pagination.d.ts.map +1 -0
- package/dist/components/Pagination/index.d.ts +2 -0
- package/dist/components/Pagination/index.d.ts.map +1 -0
- package/dist/components/PasswordInput/PasswordInput.d.ts +22 -7
- package/dist/components/PasswordInput/PasswordInput.d.ts.map +1 -1
- package/dist/components/PasswordInput/index.d.ts +1 -1
- package/dist/components/PasswordInput/index.d.ts.map +1 -1
- package/dist/components/PhoneInput/PhoneInput.d.ts +19 -6
- package/dist/components/PhoneInput/PhoneInput.d.ts.map +1 -1
- package/dist/components/PhoneInput/countries.d.ts +15 -0
- package/dist/components/PhoneInput/countries.d.ts.map +1 -0
- package/dist/components/PhoneInput/index.d.ts +2 -1
- package/dist/components/PhoneInput/index.d.ts.map +1 -1
- package/dist/components/PipelineCard/PipelineCard.d.ts +100 -0
- package/dist/components/PipelineCard/PipelineCard.d.ts.map +1 -0
- package/dist/components/PipelineCard/index.d.ts +2 -0
- package/dist/components/PipelineCard/index.d.ts.map +1 -0
- package/dist/components/Popover/Popover.d.ts +5 -1
- package/dist/components/Popover/Popover.d.ts.map +1 -1
- package/dist/components/PricingCard/PricingCard.d.ts +28 -5
- package/dist/components/PricingCard/PricingCard.d.ts.map +1 -1
- package/dist/components/ProductCard/ProductCard.d.ts +35 -4
- package/dist/components/ProductCard/ProductCard.d.ts.map +1 -1
- package/dist/components/ProgressBar/ProgressBar.d.ts +28 -0
- package/dist/components/ProgressBar/ProgressBar.d.ts.map +1 -0
- package/dist/components/ProgressBar/index.d.ts +2 -0
- package/dist/components/ProgressBar/index.d.ts.map +1 -0
- package/dist/components/ProgressRing/ProgressRing.d.ts +22 -5
- package/dist/components/ProgressRing/ProgressRing.d.ts.map +1 -1
- package/dist/components/ProgressRing/index.d.ts +1 -1
- package/dist/components/ProgressRing/index.d.ts.map +1 -1
- package/dist/components/PromptInput/PromptInput.d.ts +59 -16
- package/dist/components/PromptInput/PromptInput.d.ts.map +1 -1
- package/dist/components/PromptInput/index.d.ts +1 -1
- package/dist/components/PromptInput/index.d.ts.map +1 -1
- package/dist/components/Quote/Quote.d.ts +20 -6
- package/dist/components/Quote/Quote.d.ts.map +1 -1
- package/dist/components/Quote/index.d.ts +1 -1
- package/dist/components/Quote/index.d.ts.map +1 -1
- package/dist/components/Radio/Radio.d.ts +12 -5
- package/dist/components/Radio/Radio.d.ts.map +1 -1
- package/dist/components/Radio/RadioGroup.d.ts +16 -15
- package/dist/components/Radio/RadioGroup.d.ts.map +1 -1
- package/dist/components/Radio/index.d.ts +2 -2
- package/dist/components/Radio/index.d.ts.map +1 -1
- package/dist/components/RangeSlider/RangeSlider.d.ts +18 -5
- package/dist/components/RangeSlider/RangeSlider.d.ts.map +1 -1
- package/dist/components/RangeSlider/index.d.ts +1 -1
- package/dist/components/RangeSlider/index.d.ts.map +1 -1
- package/dist/components/Rating/BinaryRating.d.ts +40 -0
- package/dist/components/Rating/BinaryRating.d.ts.map +1 -0
- package/dist/components/Rating/Rating.d.ts +21 -6
- package/dist/components/Rating/Rating.d.ts.map +1 -1
- package/dist/components/Rating/index.d.ts +2 -1
- package/dist/components/Rating/index.d.ts.map +1 -1
- package/dist/components/Resizable/Resizable.d.ts +32 -36
- package/dist/components/Resizable/Resizable.d.ts.map +1 -1
- package/dist/components/Resizable/index.d.ts +1 -1
- package/dist/components/Resizable/index.d.ts.map +1 -1
- package/dist/components/Ribbon/Ribbon.d.ts +12 -6
- package/dist/components/Ribbon/Ribbon.d.ts.map +1 -1
- package/dist/components/Ribbon/index.d.ts +1 -1
- package/dist/components/Ribbon/index.d.ts.map +1 -1
- package/dist/components/Sankey/Sankey.d.ts +53 -0
- package/dist/components/Sankey/Sankey.d.ts.map +1 -0
- package/dist/components/Sankey/index.d.ts +2 -0
- package/dist/components/Sankey/index.d.ts.map +1 -0
- package/dist/components/ScrollArea/ScrollArea.d.ts +33 -0
- package/dist/components/ScrollArea/ScrollArea.d.ts.map +1 -0
- package/dist/components/ScrollArea/index.d.ts +2 -0
- package/dist/components/ScrollArea/index.d.ts.map +1 -0
- package/dist/components/SegmentedControl/SegmentedControl.d.ts +38 -0
- package/dist/components/SegmentedControl/SegmentedControl.d.ts.map +1 -0
- package/dist/components/SegmentedControl/index.d.ts +2 -0
- package/dist/components/SegmentedControl/index.d.ts.map +1 -0
- package/dist/components/Select/Select.d.ts +19 -1
- package/dist/components/Select/Select.d.ts.map +1 -1
- package/dist/components/Sheet/Sheet.d.ts.map +1 -1
- package/dist/components/Show/Show.d.ts +35 -0
- package/dist/components/Show/Show.d.ts.map +1 -0
- package/dist/components/Show/index.d.ts +2 -0
- package/dist/components/Show/index.d.ts.map +1 -0
- package/dist/components/Sidebar/Sidebar.d.ts +7 -8
- package/dist/components/Sidebar/Sidebar.d.ts.map +1 -1
- package/dist/components/Skeleton/Skeleton.d.ts +43 -5
- package/dist/components/Skeleton/Skeleton.d.ts.map +1 -1
- package/dist/components/Skeleton/index.d.ts +1 -1
- package/dist/components/Skeleton/index.d.ts.map +1 -1
- package/dist/components/Slider/Slider.d.ts +26 -7
- package/dist/components/Slider/Slider.d.ts.map +1 -1
- package/dist/components/Slider/index.d.ts +1 -1
- package/dist/components/Slider/index.d.ts.map +1 -1
- package/dist/components/SocialButton/SocialButton.d.ts +23 -5
- package/dist/components/SocialButton/SocialButton.d.ts.map +1 -1
- package/dist/components/SocialButton/index.d.ts +1 -1
- package/dist/components/SocialButton/index.d.ts.map +1 -1
- package/dist/components/Sortable/Sortable.d.ts +14 -6
- package/dist/components/Sortable/Sortable.d.ts.map +1 -1
- package/dist/components/Sparkline/Sparkline.d.ts +38 -3
- package/dist/components/Sparkline/Sparkline.d.ts.map +1 -1
- package/dist/components/Sparkline/index.d.ts +1 -1
- package/dist/components/Sparkline/index.d.ts.map +1 -1
- package/dist/components/Spinner/Spinner.d.ts +14 -5
- package/dist/components/Spinner/Spinner.d.ts.map +1 -1
- package/dist/components/Spinner/index.d.ts +1 -1
- package/dist/components/Spinner/index.d.ts.map +1 -1
- package/dist/components/Spotlight/Spotlight.d.ts +37 -0
- package/dist/components/Spotlight/Spotlight.d.ts.map +1 -0
- package/dist/components/Spotlight/index.d.ts +2 -0
- package/dist/components/Spotlight/index.d.ts.map +1 -0
- package/dist/components/Stack/Stack.d.ts +41 -0
- package/dist/components/Stack/Stack.d.ts.map +1 -0
- package/dist/components/Stack/index.d.ts +2 -0
- package/dist/components/Stack/index.d.ts.map +1 -0
- package/dist/components/Stat/Stat.d.ts +15 -6
- package/dist/components/Stat/Stat.d.ts.map +1 -1
- package/dist/components/Stat/index.d.ts +1 -1
- package/dist/components/Stat/index.d.ts.map +1 -1
- package/dist/components/StatusTiles/StatusTiles.d.ts +39 -0
- package/dist/components/StatusTiles/StatusTiles.d.ts.map +1 -0
- package/dist/components/StatusTiles/index.d.ts +2 -0
- package/dist/components/StatusTiles/index.d.ts.map +1 -0
- package/dist/components/Stepper/Stepper.d.ts +53 -0
- package/dist/components/Stepper/Stepper.d.ts.map +1 -0
- package/dist/components/Stepper/index.d.ts +2 -0
- package/dist/components/Stepper/index.d.ts.map +1 -0
- package/dist/components/Switch/Switch.d.ts +11 -6
- package/dist/components/Switch/Switch.d.ts.map +1 -1
- package/dist/components/Switch/index.d.ts +1 -1
- package/dist/components/Switch/index.d.ts.map +1 -1
- package/dist/components/Table/Table.d.ts +11 -5
- package/dist/components/Table/Table.d.ts.map +1 -1
- package/dist/components/TagsInput/TagsInput.d.ts +10 -5
- package/dist/components/TagsInput/TagsInput.d.ts.map +1 -1
- package/dist/components/TagsInput/index.d.ts +1 -1
- package/dist/components/TagsInput/index.d.ts.map +1 -1
- package/dist/components/TemplateCard/TemplateCard.d.ts +120 -0
- package/dist/components/TemplateCard/TemplateCard.d.ts.map +1 -0
- package/dist/components/TemplateCard/index.d.ts +2 -0
- package/dist/components/TemplateCard/index.d.ts.map +1 -0
- package/dist/components/TestimonialCard/TestimonialCard.d.ts +30 -5
- package/dist/components/TestimonialCard/TestimonialCard.d.ts.map +1 -1
- package/dist/components/Textarea/Textarea.d.ts +81 -7
- package/dist/components/Textarea/Textarea.d.ts.map +1 -1
- package/dist/components/Textarea/index.d.ts +1 -1
- package/dist/components/Textarea/index.d.ts.map +1 -1
- package/dist/components/TimePicker/TimePicker.d.ts +7 -5
- package/dist/components/TimePicker/TimePicker.d.ts.map +1 -1
- package/dist/components/TimePicker/index.d.ts +1 -1
- package/dist/components/TimePicker/index.d.ts.map +1 -1
- package/dist/components/Timeline/Timeline.d.ts +14 -5
- package/dist/components/Timeline/Timeline.d.ts.map +1 -1
- package/dist/components/Timeline/index.d.ts +1 -1
- package/dist/components/Timeline/index.d.ts.map +1 -1
- package/dist/components/TimezonePicker/TimezonePicker.d.ts +8 -5
- package/dist/components/TimezonePicker/TimezonePicker.d.ts.map +1 -1
- package/dist/components/TimezonePicker/index.d.ts +1 -1
- package/dist/components/TimezonePicker/index.d.ts.map +1 -1
- package/dist/components/Toast/Toast.d.ts +15 -0
- package/dist/components/Toast/Toast.d.ts.map +1 -1
- package/dist/components/Toggle/Toggle.d.ts +16 -6
- package/dist/components/Toggle/Toggle.d.ts.map +1 -1
- package/dist/components/Toggle/index.d.ts +1 -1
- package/dist/components/Toggle/index.d.ts.map +1 -1
- package/dist/components/ToolCard/ToolCard.d.ts +12 -10
- package/dist/components/ToolCard/ToolCard.d.ts.map +1 -1
- package/dist/components/Tooltip/Tooltip.d.ts +13 -2
- package/dist/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/components/Tooltip/index.d.ts +1 -1
- package/dist/components/Tooltip/index.d.ts.map +1 -1
- package/dist/components/TraceStep/TraceStep.d.ts +37 -8
- package/dist/components/TraceStep/TraceStep.d.ts.map +1 -1
- package/dist/components/TreeView/TreeView.d.ts +54 -0
- package/dist/components/TreeView/TreeView.d.ts.map +1 -0
- package/dist/components/TreeView/index.d.ts +2 -0
- package/dist/components/TreeView/index.d.ts.map +1 -0
- package/dist/components/UserCard/UserCard.d.ts +38 -5
- package/dist/components/UserCard/UserCard.d.ts.map +1 -1
- package/dist/components/WorkflowHeader/WorkflowHeader.d.ts +130 -0
- package/dist/components/WorkflowHeader/WorkflowHeader.d.ts.map +1 -0
- package/dist/components/WorkflowHeader/WorkflowHeaderExpanded.d.ts +69 -0
- package/dist/components/WorkflowHeader/WorkflowHeaderExpanded.d.ts.map +1 -0
- package/dist/components/WorkflowHeader/index.d.ts +3 -0
- package/dist/components/WorkflowHeader/index.d.ts.map +1 -0
- package/dist/components/WorkflowHeader/misc/WorkflowHeaderCentered.d.ts +40 -0
- package/dist/components/WorkflowHeader/misc/WorkflowHeaderCentered.d.ts.map +1 -0
- package/dist/components/WorkflowHeader/misc/WorkflowHeaderCommand.d.ts +39 -0
- package/dist/components/WorkflowHeader/misc/WorkflowHeaderCommand.d.ts.map +1 -0
- package/dist/components/WorkflowHeader/misc/WorkflowHeaderMinimal.d.ts +44 -0
- package/dist/components/WorkflowHeader/misc/WorkflowHeaderMinimal.d.ts.map +1 -0
- package/dist/components/WorkflowHeader/misc/WorkflowHeaderRail.d.ts +45 -0
- package/dist/components/WorkflowHeader/misc/WorkflowHeaderRail.d.ts.map +1 -0
- package/dist/components/WorkflowHeader/misc/WorkflowHeaderStudio.d.ts +48 -0
- package/dist/components/WorkflowHeader/misc/WorkflowHeaderStudio.d.ts.map +1 -0
- package/dist/components/WorkflowHeader/misc/WorkflowHeaderTiered.d.ts +52 -0
- package/dist/components/WorkflowHeader/misc/WorkflowHeaderTiered.d.ts.map +1 -0
- package/dist/components/XmlViewer/XmlViewer.d.ts +36 -6
- package/dist/components/XmlViewer/XmlViewer.d.ts.map +1 -1
- package/dist/components/XmlViewer/index.d.ts +1 -1
- package/dist/components/XmlViewer/index.d.ts.map +1 -1
- package/dist/components/YamlViewer/YamlViewer.d.ts +38 -6
- package/dist/components/YamlViewer/YamlViewer.d.ts.map +1 -1
- package/dist/components/YamlViewer/index.d.ts +1 -1
- package/dist/components/YamlViewer/index.d.ts.map +1 -1
- package/dist/hooks/useBanner.d.ts +27 -0
- package/dist/hooks/useBanner.d.ts.map +1 -0
- package/dist/hooks/useBreakpoint.d.ts +29 -0
- package/dist/hooks/useBreakpoint.d.ts.map +1 -0
- package/dist/hooks/useCallout.d.ts +32 -0
- package/dist/hooks/useCallout.d.ts.map +1 -0
- package/dist/hooks/useMediaQuery.d.ts +15 -0
- package/dist/hooks/useMediaQuery.d.ts.map +1 -0
- package/dist/hooks/usePasswordStrength.d.ts +37 -0
- package/dist/hooks/usePasswordStrength.d.ts.map +1 -0
- package/dist/hooks/useRating.d.ts +51 -0
- package/dist/hooks/useRating.d.ts.map +1 -0
- package/dist/hooks/useRelativeTime.d.ts +28 -0
- package/dist/hooks/useRelativeTime.d.ts.map +1 -0
- package/dist/hooks/useTextareaCommands.d.ts +55 -0
- package/dist/hooks/useTextareaCommands.d.ts.map +1 -0
- package/dist/hooks/useTextareaSelection.d.ts +34 -0
- package/dist/hooks/useTextareaSelection.d.ts.map +1 -0
- package/dist/hooks/useTextareaTools.d.ts +88 -0
- package/dist/hooks/useTextareaTools.d.ts.map +1 -0
- package/dist/hooks/useTimeline.d.ts +31 -0
- package/dist/hooks/useTimeline.d.ts.map +1 -0
- package/dist/hooks/useTraceTimeline.d.ts +54 -0
- package/dist/hooks/useTraceTimeline.d.ts.map +1 -0
- package/dist/hooks/useWorkflowRuntime.d.ts +20 -0
- package/dist/hooks/useWorkflowRuntime.d.ts.map +1 -0
- package/dist/index.cjs +26892 -12774
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +97 -50
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +26322 -12033
- package/dist/index.js.map +1 -1
- package/dist/monaco.cjs +359 -488
- package/dist/monaco.cjs.map +1 -1
- package/dist/monaco.d.ts +1 -1
- package/dist/monaco.d.ts.map +1 -1
- package/dist/monaco.js +381 -489
- package/dist/monaco.js.map +1 -1
- package/dist/stories/_shared/TestPage.d.ts +12 -0
- package/dist/stories/_shared/TestPage.d.ts.map +1 -0
- package/dist/styles.css +1 -1
- package/dist/utils/Slot.d.ts +7 -0
- package/dist/utils/Slot.d.ts.map +1 -0
- package/dist/utils/composeRefs.d.ts +7 -0
- package/dist/utils/composeRefs.d.ts.map +1 -0
- package/dist/utils/gradients.d.ts +77 -0
- package/dist/utils/gradients.d.ts.map +1 -0
- package/dist/utils/zIndex.d.ts +53 -0
- package/dist/utils/zIndex.d.ts.map +1 -0
- package/dist/workflow/components/FlowCanvas/FlowCanvas.d.ts +41 -1
- package/dist/workflow/components/FlowCanvas/FlowCanvas.d.ts.map +1 -1
- package/dist/workflow/components/kinds/index.d.ts +4 -0
- package/dist/workflow/components/kinds/index.d.ts.map +1 -1
- package/dist/workflow/index.d.ts +1 -1
- package/dist/workflow/index.d.ts.map +1 -1
- package/dist/workflow/store/selectors.d.ts +12 -0
- package/dist/workflow/store/selectors.d.ts.map +1 -1
- package/dist/workflow.cjs +528 -358
- package/dist/workflow.cjs.map +1 -1
- package/dist/workflow.js +19 -205
- package/dist/workflow.js.map +1 -1
- package/package.json +10 -6
package/dist/workflow.cjs
CHANGED
|
@@ -77,7 +77,8 @@ __export(workflow_exports, {
|
|
|
77
77
|
useNodeData: () => useNodeData,
|
|
78
78
|
useNodes: () => useNodes,
|
|
79
79
|
useSelection: () => useSelection,
|
|
80
|
-
useViewport: () => useViewport
|
|
80
|
+
useViewport: () => useViewport,
|
|
81
|
+
useViewportOrNull: () => useViewportOrNull
|
|
81
82
|
});
|
|
82
83
|
module.exports = __toCommonJS(workflow_exports);
|
|
83
84
|
|
|
@@ -646,6 +647,23 @@ function useEdges() {
|
|
|
646
647
|
function useViewport() {
|
|
647
648
|
return useFlowSelector((s) => s.viewport);
|
|
648
649
|
}
|
|
650
|
+
var VIEWPORT_OR_NULL_NO_STORE_SUBSCRIBE = (_cb) => () => {
|
|
651
|
+
};
|
|
652
|
+
var VIEWPORT_OR_NULL_NO_STORE_SNAPSHOT = () => null;
|
|
653
|
+
function useViewportOrNull() {
|
|
654
|
+
const store = (0, import_react5.useContext)(FlowStoreContext);
|
|
655
|
+
const { sub, snap } = (0, import_react5.useMemo)(
|
|
656
|
+
() => store ? {
|
|
657
|
+
sub: store.subscribe,
|
|
658
|
+
snap: () => store.getSnapshot().viewport
|
|
659
|
+
} : {
|
|
660
|
+
sub: VIEWPORT_OR_NULL_NO_STORE_SUBSCRIBE,
|
|
661
|
+
snap: VIEWPORT_OR_NULL_NO_STORE_SNAPSHOT
|
|
662
|
+
},
|
|
663
|
+
[store]
|
|
664
|
+
);
|
|
665
|
+
return (0, import_react5.useSyncExternalStore)(sub, snap, snap);
|
|
666
|
+
}
|
|
649
667
|
function useNodeById(id) {
|
|
650
668
|
return useFlowSelector((s) => s.nodes.find((n) => n.id === id));
|
|
651
669
|
}
|
|
@@ -943,7 +961,7 @@ function ConfigPanel({
|
|
|
943
961
|
}
|
|
944
962
|
|
|
945
963
|
// src/workflow/components/FlowCanvas/FlowCanvas.tsx
|
|
946
|
-
var
|
|
964
|
+
var import_react15 = require("react");
|
|
947
965
|
|
|
948
966
|
// src/workflow/store/createFlowStore.ts
|
|
949
967
|
var DEFAULT_VIEWPORT = { x: 0, y: 0, zoom: 1 };
|
|
@@ -1791,10 +1809,155 @@ function handleSideStyle(side, index, total) {
|
|
|
1791
1809
|
}
|
|
1792
1810
|
}
|
|
1793
1811
|
|
|
1794
|
-
// src/workflow/components/
|
|
1795
|
-
var import_icons = require("@octaviaflow/icons");
|
|
1812
|
+
// src/workflow/components/NodeResizer/NodeResizer.tsx
|
|
1796
1813
|
var import_react13 = require("react");
|
|
1797
1814
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
1815
|
+
function NodeResizer({
|
|
1816
|
+
isVisible,
|
|
1817
|
+
minWidth = 80,
|
|
1818
|
+
minHeight = 60,
|
|
1819
|
+
maxWidth,
|
|
1820
|
+
maxHeight,
|
|
1821
|
+
keepAspectRatio = false,
|
|
1822
|
+
onResize,
|
|
1823
|
+
onResizeEnd,
|
|
1824
|
+
color
|
|
1825
|
+
}) {
|
|
1826
|
+
const { node, selected } = useFlowNodeContext();
|
|
1827
|
+
const viewport = useViewport();
|
|
1828
|
+
const flow = useFlow();
|
|
1829
|
+
const dragRef = (0, import_react13.useRef)(null);
|
|
1830
|
+
const show = isVisible ?? selected;
|
|
1831
|
+
if (!show) return null;
|
|
1832
|
+
const beginResize = (e, corner) => {
|
|
1833
|
+
e.preventDefault();
|
|
1834
|
+
e.stopPropagation();
|
|
1835
|
+
e.target.setPointerCapture(e.pointerId);
|
|
1836
|
+
const w = node.width ?? DEFAULT_NODE_WIDTH;
|
|
1837
|
+
const h = node.height ?? DEFAULT_NODE_HEIGHT;
|
|
1838
|
+
dragRef.current = {
|
|
1839
|
+
pointerId: e.pointerId,
|
|
1840
|
+
corner,
|
|
1841
|
+
startClientX: e.clientX,
|
|
1842
|
+
startClientY: e.clientY,
|
|
1843
|
+
startWidth: w,
|
|
1844
|
+
startHeight: h,
|
|
1845
|
+
startX: node.position.x,
|
|
1846
|
+
startY: node.position.y,
|
|
1847
|
+
aspect: w / Math.max(1, h)
|
|
1848
|
+
};
|
|
1849
|
+
};
|
|
1850
|
+
const onMove = (e) => {
|
|
1851
|
+
const drag = dragRef.current;
|
|
1852
|
+
if (!drag || drag.pointerId !== e.pointerId) return;
|
|
1853
|
+
const dx = (e.clientX - drag.startClientX) / viewport.zoom;
|
|
1854
|
+
const dy = (e.clientY - drag.startClientY) / viewport.zoom;
|
|
1855
|
+
let nextW = drag.startWidth;
|
|
1856
|
+
let nextH = drag.startHeight;
|
|
1857
|
+
let nextX = drag.startX;
|
|
1858
|
+
let nextY = drag.startY;
|
|
1859
|
+
switch (drag.corner) {
|
|
1860
|
+
case "se":
|
|
1861
|
+
nextW = drag.startWidth + dx;
|
|
1862
|
+
nextH = drag.startHeight + dy;
|
|
1863
|
+
break;
|
|
1864
|
+
case "sw":
|
|
1865
|
+
nextW = drag.startWidth - dx;
|
|
1866
|
+
nextH = drag.startHeight + dy;
|
|
1867
|
+
nextX = drag.startX + dx;
|
|
1868
|
+
break;
|
|
1869
|
+
case "ne":
|
|
1870
|
+
nextW = drag.startWidth + dx;
|
|
1871
|
+
nextH = drag.startHeight - dy;
|
|
1872
|
+
nextY = drag.startY + dy;
|
|
1873
|
+
break;
|
|
1874
|
+
case "nw":
|
|
1875
|
+
nextW = drag.startWidth - dx;
|
|
1876
|
+
nextH = drag.startHeight - dy;
|
|
1877
|
+
nextX = drag.startX + dx;
|
|
1878
|
+
nextY = drag.startY + dy;
|
|
1879
|
+
break;
|
|
1880
|
+
}
|
|
1881
|
+
if (keepAspectRatio) {
|
|
1882
|
+
nextH = nextW / drag.aspect;
|
|
1883
|
+
if (drag.corner === "nw" || drag.corner === "ne") {
|
|
1884
|
+
nextY = drag.startY + (drag.startHeight - nextH);
|
|
1885
|
+
}
|
|
1886
|
+
}
|
|
1887
|
+
nextW = Math.max(minWidth, maxWidth ? Math.min(maxWidth, nextW) : nextW);
|
|
1888
|
+
nextH = Math.max(minHeight, maxHeight ? Math.min(maxHeight, nextH) : nextH);
|
|
1889
|
+
flow.updateNode(node.id, {
|
|
1890
|
+
width: nextW,
|
|
1891
|
+
height: nextH,
|
|
1892
|
+
position: { x: nextX, y: nextY }
|
|
1893
|
+
});
|
|
1894
|
+
onResize?.({ width: nextW, height: nextH });
|
|
1895
|
+
};
|
|
1896
|
+
const onUp = (e) => {
|
|
1897
|
+
if (dragRef.current?.pointerId === e.pointerId) {
|
|
1898
|
+
const cur = flow.getNode(node.id);
|
|
1899
|
+
if (cur) {
|
|
1900
|
+
onResizeEnd?.({
|
|
1901
|
+
width: cur.width ?? DEFAULT_NODE_WIDTH,
|
|
1902
|
+
height: cur.height ?? DEFAULT_NODE_HEIGHT
|
|
1903
|
+
});
|
|
1904
|
+
}
|
|
1905
|
+
dragRef.current = null;
|
|
1906
|
+
}
|
|
1907
|
+
};
|
|
1908
|
+
const handleColor = color ?? "var(--ods-accent)";
|
|
1909
|
+
const handleStyle = (corner) => {
|
|
1910
|
+
const base = {
|
|
1911
|
+
position: "absolute",
|
|
1912
|
+
width: 12,
|
|
1913
|
+
height: 12,
|
|
1914
|
+
background: "var(--ods-surface-canvas)",
|
|
1915
|
+
border: `2px solid ${handleColor}`,
|
|
1916
|
+
borderRadius: 2,
|
|
1917
|
+
cursor: cursorFor(corner),
|
|
1918
|
+
touchAction: "none",
|
|
1919
|
+
// Place each handle so its CENTRE sits on the corresponding corner.
|
|
1920
|
+
transform: "translate(-50%, -50%)"
|
|
1921
|
+
};
|
|
1922
|
+
switch (corner) {
|
|
1923
|
+
case "nw":
|
|
1924
|
+
return { ...base, top: 0, left: 0 };
|
|
1925
|
+
case "ne":
|
|
1926
|
+
return { ...base, top: 0, left: "100%" };
|
|
1927
|
+
case "sw":
|
|
1928
|
+
return { ...base, top: "100%", left: 0 };
|
|
1929
|
+
case "se":
|
|
1930
|
+
return { ...base, top: "100%", left: "100%" };
|
|
1931
|
+
}
|
|
1932
|
+
};
|
|
1933
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: cn("ods-node-resizer"), "data-flow-no-drag": "true", children: ["nw", "ne", "sw", "se"].map((corner) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1934
|
+
"div",
|
|
1935
|
+
{
|
|
1936
|
+
style: handleStyle(corner),
|
|
1937
|
+
onPointerDown: (e) => beginResize(e, corner),
|
|
1938
|
+
onPointerMove: onMove,
|
|
1939
|
+
onPointerUp: onUp,
|
|
1940
|
+
onPointerCancel: onUp,
|
|
1941
|
+
"aria-label": `Resize ${corner}`
|
|
1942
|
+
},
|
|
1943
|
+
corner
|
|
1944
|
+
)) });
|
|
1945
|
+
}
|
|
1946
|
+
function cursorFor(corner) {
|
|
1947
|
+
switch (corner) {
|
|
1948
|
+
case "nw":
|
|
1949
|
+
case "se":
|
|
1950
|
+
return "nwse-resize";
|
|
1951
|
+
case "ne":
|
|
1952
|
+
case "sw":
|
|
1953
|
+
return "nesw-resize";
|
|
1954
|
+
}
|
|
1955
|
+
}
|
|
1956
|
+
|
|
1957
|
+
// src/workflow/components/kinds/BaseNode.tsx
|
|
1958
|
+
var import_icons = require("@octaviaflow/icons");
|
|
1959
|
+
var import_react14 = require("react");
|
|
1960
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
1798
1961
|
function BaseNode({
|
|
1799
1962
|
kind,
|
|
1800
1963
|
kindIcon,
|
|
@@ -1810,10 +1973,10 @@ function BaseNode({
|
|
|
1810
1973
|
className,
|
|
1811
1974
|
children
|
|
1812
1975
|
}) {
|
|
1813
|
-
const ctx = (0,
|
|
1814
|
-
const bridge = (0,
|
|
1976
|
+
const ctx = (0, import_react14.useContext)(FlowNodeContext);
|
|
1977
|
+
const bridge = (0, import_react14.useContext)(FlowNodeBridgeContext);
|
|
1815
1978
|
const deleteHandler = onDelete === false ? void 0 : onDelete ?? (ctx && bridge ? () => bridge.deleteNode(ctx.id) : void 0);
|
|
1816
|
-
return /* @__PURE__ */ (0,
|
|
1979
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
1817
1980
|
"div",
|
|
1818
1981
|
{
|
|
1819
1982
|
className: cn(
|
|
@@ -1823,31 +1986,31 @@ function BaseNode({
|
|
|
1823
1986
|
className
|
|
1824
1987
|
),
|
|
1825
1988
|
children: [
|
|
1826
|
-
/* @__PURE__ */ (0,
|
|
1827
|
-
kindIcon && /* @__PURE__ */ (0,
|
|
1828
|
-
/* @__PURE__ */ (0,
|
|
1989
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "ods-flow-base-node__pill", children: [
|
|
1990
|
+
kindIcon && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "ods-flow-base-node__pill-icon", "aria-hidden": "true", children: kindIcon }),
|
|
1991
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "ods-flow-base-node__pill-label", children: kind })
|
|
1829
1992
|
] }),
|
|
1830
|
-
status && status !== "idle" && /* @__PURE__ */ (0,
|
|
1993
|
+
status && status !== "idle" && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1831
1994
|
"span",
|
|
1832
1995
|
{
|
|
1833
1996
|
className: cn("ods-flow-base-node__status", `ods-flow-base-node__status--${status}`),
|
|
1834
1997
|
"aria-hidden": "true"
|
|
1835
1998
|
}
|
|
1836
1999
|
),
|
|
1837
|
-
/* @__PURE__ */ (0,
|
|
1838
|
-
/* @__PURE__ */ (0,
|
|
1839
|
-
/* @__PURE__ */ (0,
|
|
1840
|
-
/* @__PURE__ */ (0,
|
|
1841
|
-
/* @__PURE__ */ (0,
|
|
1842
|
-
(chip !== void 0 || description !== void 0 || valueChip !== void 0) && /* @__PURE__ */ (0,
|
|
1843
|
-
chip !== void 0 && /* @__PURE__ */ (0,
|
|
1844
|
-
description !== void 0 && /* @__PURE__ */ (0,
|
|
1845
|
-
valueChip !== void 0 && /* @__PURE__ */ (0,
|
|
2000
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "ods-flow-base-node__body", children: [
|
|
2001
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "ods-flow-base-node__content", children: [
|
|
2002
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "ods-flow-base-node__bubble", "aria-hidden": "true", children: icon }),
|
|
2003
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "ods-flow-base-node__content-text", children: [
|
|
2004
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "ods-flow-base-node__content-title", children: title }),
|
|
2005
|
+
(chip !== void 0 || description !== void 0 || valueChip !== void 0) && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "ods-flow-base-node__content-info", children: [
|
|
2006
|
+
chip !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "ods-flow-base-node__chip", children: chip }),
|
|
2007
|
+
description !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "ods-flow-base-node__description", children: description }),
|
|
2008
|
+
valueChip !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "ods-flow-base-node__value-chip", children: valueChip })
|
|
1846
2009
|
] })
|
|
1847
2010
|
] })
|
|
1848
2011
|
] }),
|
|
1849
|
-
footer && /* @__PURE__ */ (0,
|
|
1850
|
-
deleteHandler && /* @__PURE__ */ (0,
|
|
2012
|
+
footer && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "ods-flow-base-node__footer", children: footer }),
|
|
2013
|
+
deleteHandler && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1851
2014
|
"button",
|
|
1852
2015
|
{
|
|
1853
2016
|
type: "button",
|
|
@@ -1859,7 +2022,7 @@ function BaseNode({
|
|
|
1859
2022
|
"aria-label": "Delete node",
|
|
1860
2023
|
"data-flow-no-drag": "true",
|
|
1861
2024
|
title: "Delete node",
|
|
1862
|
-
children: /* @__PURE__ */ (0,
|
|
2025
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_icons.TrashCanIcon, { size: 16, "aria-hidden": true })
|
|
1863
2026
|
}
|
|
1864
2027
|
)
|
|
1865
2028
|
] }),
|
|
@@ -1870,12 +2033,12 @@ function BaseNode({
|
|
|
1870
2033
|
}
|
|
1871
2034
|
|
|
1872
2035
|
// src/workflow/components/kinds/index.tsx
|
|
1873
|
-
var
|
|
2036
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
1874
2037
|
var ActionNode = ({
|
|
1875
2038
|
node
|
|
1876
2039
|
}) => {
|
|
1877
2040
|
const d = node.data ?? {};
|
|
1878
|
-
return /* @__PURE__ */ (0,
|
|
2041
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
1879
2042
|
BaseNode,
|
|
1880
2043
|
{
|
|
1881
2044
|
kind: d.kind ?? "ACTION",
|
|
@@ -1887,8 +2050,8 @@ var ActionNode = ({
|
|
|
1887
2050
|
status: d.status,
|
|
1888
2051
|
accent: "green",
|
|
1889
2052
|
children: [
|
|
1890
|
-
/* @__PURE__ */ (0,
|
|
1891
|
-
/* @__PURE__ */ (0,
|
|
2053
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Handle, { type: "target", position: "top" }),
|
|
2054
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Handle, { type: "source", position: "bottom" })
|
|
1892
2055
|
]
|
|
1893
2056
|
}
|
|
1894
2057
|
);
|
|
@@ -1897,7 +2060,7 @@ var TriggerNode = ({
|
|
|
1897
2060
|
node
|
|
1898
2061
|
}) => {
|
|
1899
2062
|
const d = node.data ?? {};
|
|
1900
|
-
return /* @__PURE__ */ (0,
|
|
2063
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1901
2064
|
BaseNode,
|
|
1902
2065
|
{
|
|
1903
2066
|
kind: d.kind ?? "TRIGGER",
|
|
@@ -1908,7 +2071,7 @@ var TriggerNode = ({
|
|
|
1908
2071
|
valueChip: d.valueChip,
|
|
1909
2072
|
status: d.status,
|
|
1910
2073
|
accent: "green",
|
|
1911
|
-
children: /* @__PURE__ */ (0,
|
|
2074
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Handle, { type: "source", position: "bottom" })
|
|
1912
2075
|
}
|
|
1913
2076
|
);
|
|
1914
2077
|
};
|
|
@@ -1920,7 +2083,7 @@ var ConditionNode = ({
|
|
|
1920
2083
|
{ id: "true", label: "true" },
|
|
1921
2084
|
{ id: "false", label: "false" }
|
|
1922
2085
|
];
|
|
1923
|
-
return /* @__PURE__ */ (0,
|
|
2086
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
1924
2087
|
BaseNode,
|
|
1925
2088
|
{
|
|
1926
2089
|
kind: d.kind ?? "CONDITION",
|
|
@@ -1932,8 +2095,8 @@ var ConditionNode = ({
|
|
|
1932
2095
|
status: d.status,
|
|
1933
2096
|
accent: "amber",
|
|
1934
2097
|
children: [
|
|
1935
|
-
/* @__PURE__ */ (0,
|
|
1936
|
-
branches.map((b, i) => /* @__PURE__ */ (0,
|
|
2098
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Handle, { type: "target", position: "top" }),
|
|
2099
|
+
branches.map((b, i) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1937
2100
|
Handle,
|
|
1938
2101
|
{
|
|
1939
2102
|
type: "source",
|
|
@@ -1954,24 +2117,27 @@ var GroupNode = ({
|
|
|
1954
2117
|
}) => {
|
|
1955
2118
|
const d = node.data ?? {};
|
|
1956
2119
|
const collapsed = !!d.collapsed;
|
|
2120
|
+
const disabled = !!d.disabled;
|
|
1957
2121
|
const hiddenCount = d.hiddenCount;
|
|
1958
2122
|
const bridge = useFlowNodeBridge();
|
|
1959
2123
|
const onChevronClick = (e) => {
|
|
1960
2124
|
e.stopPropagation();
|
|
1961
2125
|
bridge.toggleNodeCollapse(node.id);
|
|
1962
2126
|
};
|
|
1963
|
-
return /* @__PURE__ */ (0,
|
|
2127
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
1964
2128
|
"div",
|
|
1965
2129
|
{
|
|
1966
2130
|
className: "ods-flow-group",
|
|
1967
2131
|
"data-collapsed": collapsed ? "true" : "false",
|
|
2132
|
+
"data-disabled": disabled ? "true" : void 0,
|
|
1968
2133
|
style: {
|
|
1969
2134
|
width: node.width ?? 360,
|
|
1970
2135
|
height: collapsed ? 36 : node.height ?? 200
|
|
1971
2136
|
},
|
|
1972
2137
|
children: [
|
|
1973
|
-
/* @__PURE__ */ (0,
|
|
1974
|
-
|
|
2138
|
+
!collapsed && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(NodeResizer, { minWidth: 240, minHeight: 120 }),
|
|
2139
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "ods-flow-group__header", "data-flow-no-drag": "false", children: [
|
|
2140
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1975
2141
|
"button",
|
|
1976
2142
|
{
|
|
1977
2143
|
type: "button",
|
|
@@ -1984,15 +2150,16 @@ var GroupNode = ({
|
|
|
1984
2150
|
children: collapsed ? "\u25B8" : "\u25BE"
|
|
1985
2151
|
}
|
|
1986
2152
|
),
|
|
1987
|
-
/* @__PURE__ */ (0,
|
|
1988
|
-
d.subtitle && /* @__PURE__ */ (0,
|
|
1989
|
-
|
|
2153
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "ods-flow-group__title", children: d.title ?? "Group" }),
|
|
2154
|
+
d.subtitle && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "ods-flow-group__subtitle", children: d.subtitle }),
|
|
2155
|
+
disabled && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "ods-flow-group__disabled-badge", "aria-label": "Disabled subflow", children: "Disabled" }),
|
|
2156
|
+
collapsed && hiddenCount !== void 0 && hiddenCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { className: "ods-flow-group__count", "aria-label": `${hiddenCount} hidden steps`, children: [
|
|
1990
2157
|
hiddenCount,
|
|
1991
2158
|
" steps"
|
|
1992
2159
|
] })
|
|
1993
2160
|
] }),
|
|
1994
|
-
/* @__PURE__ */ (0,
|
|
1995
|
-
/* @__PURE__ */ (0,
|
|
2161
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Handle, { type: "target", position: "top", id: "__group_in" }),
|
|
2162
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Handle, { type: "source", position: "bottom", id: "__group_out" })
|
|
1996
2163
|
]
|
|
1997
2164
|
}
|
|
1998
2165
|
);
|
|
@@ -2003,24 +2170,27 @@ var ForEachNode = ({
|
|
|
2003
2170
|
const d = node.data ?? {};
|
|
2004
2171
|
const iteratorExpr = d.iterator ?? d.description ?? "items[]";
|
|
2005
2172
|
const collapsed = !!d.collapsed;
|
|
2173
|
+
const disabled = !!d.disabled;
|
|
2006
2174
|
const hiddenCount = d.hiddenCount;
|
|
2007
2175
|
const bridge = useFlowNodeBridge();
|
|
2008
2176
|
const onChevronClick = (e) => {
|
|
2009
2177
|
e.stopPropagation();
|
|
2010
2178
|
bridge.toggleNodeCollapse(node.id);
|
|
2011
2179
|
};
|
|
2012
|
-
return /* @__PURE__ */ (0,
|
|
2180
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
2013
2181
|
"div",
|
|
2014
2182
|
{
|
|
2015
2183
|
className: "ods-flow-foreach",
|
|
2016
2184
|
"data-collapsed": collapsed ? "true" : "false",
|
|
2185
|
+
"data-disabled": disabled ? "true" : void 0,
|
|
2017
2186
|
style: {
|
|
2018
2187
|
width: node.width ?? 420,
|
|
2019
2188
|
height: collapsed ? 40 : node.height ?? 260
|
|
2020
2189
|
},
|
|
2021
2190
|
children: [
|
|
2022
|
-
/* @__PURE__ */ (0,
|
|
2023
|
-
|
|
2191
|
+
!collapsed && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(NodeResizer, { minWidth: 240, minHeight: 120 }),
|
|
2192
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "ods-flow-foreach__header", children: [
|
|
2193
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
2024
2194
|
"button",
|
|
2025
2195
|
{
|
|
2026
2196
|
type: "button",
|
|
@@ -2033,24 +2203,57 @@ var ForEachNode = ({
|
|
|
2033
2203
|
children: collapsed ? "\u25B8" : "\u25BE"
|
|
2034
2204
|
}
|
|
2035
2205
|
),
|
|
2036
|
-
/* @__PURE__ */ (0,
|
|
2037
|
-
/* @__PURE__ */ (0,
|
|
2038
|
-
/* @__PURE__ */ (0,
|
|
2039
|
-
|
|
2206
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "ods-flow-foreach__icon", "aria-hidden": "true", children: "\u21BB" }),
|
|
2207
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "ods-flow-foreach__title", children: d.title ?? "For each" }),
|
|
2208
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("code", { className: "ods-flow-foreach__iterator", children: iteratorExpr }),
|
|
2209
|
+
disabled && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
2210
|
+
"span",
|
|
2211
|
+
{
|
|
2212
|
+
className: "ods-flow-foreach__disabled-badge",
|
|
2213
|
+
"aria-label": "Disabled subflow",
|
|
2214
|
+
children: "Disabled"
|
|
2215
|
+
}
|
|
2216
|
+
),
|
|
2217
|
+
collapsed && hiddenCount !== void 0 && hiddenCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { className: "ods-flow-foreach__count", "aria-label": `${hiddenCount} hidden steps`, children: [
|
|
2040
2218
|
hiddenCount,
|
|
2041
2219
|
" steps"
|
|
2042
2220
|
] })
|
|
2043
2221
|
] }),
|
|
2044
|
-
/* @__PURE__ */ (0,
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2222
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Handle, { type: "target", position: "top", id: "__group_in", label: !collapsed ? "in" : void 0 }),
|
|
2223
|
+
collapsed ? (
|
|
2224
|
+
// Collapsed: single bottom exit so the container behaves like a
|
|
2225
|
+
// regular action in the chain.
|
|
2226
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Handle, { type: "source", position: "bottom", id: "__group_out" })
|
|
2227
|
+
) : (
|
|
2228
|
+
// Expanded: two bottom outputs spread across the bottom edge.
|
|
2229
|
+
// Index/total tell the Handle to position them at 33% and 66%
|
|
2230
|
+
// along the edge (per `handleSideStyle`). `each` is left of
|
|
2231
|
+
// centre, `__group_out` (labelled "done") is right of centre.
|
|
2232
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
|
|
2233
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
2234
|
+
Handle,
|
|
2235
|
+
{
|
|
2236
|
+
type: "source",
|
|
2237
|
+
position: "bottom",
|
|
2238
|
+
id: "each",
|
|
2239
|
+
label: "each",
|
|
2240
|
+
index: 0,
|
|
2241
|
+
total: 2
|
|
2242
|
+
}
|
|
2243
|
+
),
|
|
2244
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
2245
|
+
Handle,
|
|
2246
|
+
{
|
|
2247
|
+
type: "source",
|
|
2248
|
+
position: "bottom",
|
|
2249
|
+
id: "__group_out",
|
|
2250
|
+
label: "done",
|
|
2251
|
+
index: 1,
|
|
2252
|
+
total: 2
|
|
2253
|
+
}
|
|
2254
|
+
)
|
|
2255
|
+
] })
|
|
2256
|
+
)
|
|
2054
2257
|
]
|
|
2055
2258
|
}
|
|
2056
2259
|
);
|
|
@@ -2059,7 +2262,7 @@ var OutputNode = ({
|
|
|
2059
2262
|
node
|
|
2060
2263
|
}) => {
|
|
2061
2264
|
const d = node.data ?? {};
|
|
2062
|
-
return /* @__PURE__ */ (0,
|
|
2265
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
2063
2266
|
BaseNode,
|
|
2064
2267
|
{
|
|
2065
2268
|
kind: d.kind ?? "OUTPUT",
|
|
@@ -2069,7 +2272,7 @@ var OutputNode = ({
|
|
|
2069
2272
|
description: d.description ?? d.subtitle,
|
|
2070
2273
|
status: d.status,
|
|
2071
2274
|
accent: "green",
|
|
2072
|
-
children: /* @__PURE__ */ (0,
|
|
2275
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Handle, { type: "target", position: "top" })
|
|
2073
2276
|
}
|
|
2074
2277
|
);
|
|
2075
2278
|
};
|
|
@@ -2077,7 +2280,7 @@ var ErrorNode = ({
|
|
|
2077
2280
|
node
|
|
2078
2281
|
}) => {
|
|
2079
2282
|
const d = node.data ?? {};
|
|
2080
|
-
return /* @__PURE__ */ (0,
|
|
2283
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
2081
2284
|
BaseNode,
|
|
2082
2285
|
{
|
|
2083
2286
|
kind: d.kind ?? "ERROR",
|
|
@@ -2088,8 +2291,8 @@ var ErrorNode = ({
|
|
|
2088
2291
|
status: d.status ?? "error",
|
|
2089
2292
|
accent: "red",
|
|
2090
2293
|
children: [
|
|
2091
|
-
/* @__PURE__ */ (0,
|
|
2092
|
-
/* @__PURE__ */ (0,
|
|
2294
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Handle, { type: "target", position: "top" }),
|
|
2295
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Handle, { type: "source", position: "bottom" })
|
|
2093
2296
|
]
|
|
2094
2297
|
}
|
|
2095
2298
|
);
|
|
@@ -2100,7 +2303,7 @@ var WaitNode = ({
|
|
|
2100
2303
|
const d = node.data ?? {};
|
|
2101
2304
|
const waitMs = d.waitMs;
|
|
2102
2305
|
const durationChip = waitMs ? `${Math.round(waitMs / 100) / 10}s` : void 0;
|
|
2103
|
-
return /* @__PURE__ */ (0,
|
|
2306
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
2104
2307
|
BaseNode,
|
|
2105
2308
|
{
|
|
2106
2309
|
kind: d.kind ?? "WAIT",
|
|
@@ -2111,8 +2314,8 @@ var WaitNode = ({
|
|
|
2111
2314
|
status: d.status,
|
|
2112
2315
|
accent: "violet",
|
|
2113
2316
|
children: [
|
|
2114
|
-
/* @__PURE__ */ (0,
|
|
2115
|
-
/* @__PURE__ */ (0,
|
|
2317
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Handle, { type: "target", position: "top" }),
|
|
2318
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Handle, { type: "source", position: "bottom" })
|
|
2116
2319
|
]
|
|
2117
2320
|
}
|
|
2118
2321
|
);
|
|
@@ -2125,7 +2328,7 @@ var ParallelNode = ({
|
|
|
2125
2328
|
{ id: "a", label: "a" },
|
|
2126
2329
|
{ id: "b", label: "b" }
|
|
2127
2330
|
];
|
|
2128
|
-
return /* @__PURE__ */ (0,
|
|
2331
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
2129
2332
|
BaseNode,
|
|
2130
2333
|
{
|
|
2131
2334
|
kind: d.kind ?? "PARALLEL",
|
|
@@ -2136,8 +2339,8 @@ var ParallelNode = ({
|
|
|
2136
2339
|
status: d.status,
|
|
2137
2340
|
accent: "blue",
|
|
2138
2341
|
children: [
|
|
2139
|
-
/* @__PURE__ */ (0,
|
|
2140
|
-
branches.map((b, i) => /* @__PURE__ */ (0,
|
|
2342
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Handle, { type: "target", position: "top" }),
|
|
2343
|
+
branches.map((b, i) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
2141
2344
|
Handle,
|
|
2142
2345
|
{
|
|
2143
2346
|
type: "source",
|
|
@@ -2157,7 +2360,7 @@ var StickyNode = ({
|
|
|
2157
2360
|
node
|
|
2158
2361
|
}) => {
|
|
2159
2362
|
const d = node.data ?? {};
|
|
2160
|
-
return /* @__PURE__ */ (0,
|
|
2363
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
2161
2364
|
"div",
|
|
2162
2365
|
{
|
|
2163
2366
|
className: "ods-flow-sticky",
|
|
@@ -2166,8 +2369,8 @@ var StickyNode = ({
|
|
|
2166
2369
|
minHeight: node.height ?? 120
|
|
2167
2370
|
},
|
|
2168
2371
|
children: [
|
|
2169
|
-
d.title && /* @__PURE__ */ (0,
|
|
2170
|
-
d.description && /* @__PURE__ */ (0,
|
|
2372
|
+
d.title && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "ods-flow-sticky__title", children: d.title }),
|
|
2373
|
+
d.description && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "ods-flow-sticky__body", children: d.description })
|
|
2171
2374
|
]
|
|
2172
2375
|
}
|
|
2173
2376
|
);
|
|
@@ -2176,7 +2379,7 @@ var WebhookNode = ({
|
|
|
2176
2379
|
node
|
|
2177
2380
|
}) => {
|
|
2178
2381
|
const d = node.data ?? {};
|
|
2179
|
-
return /* @__PURE__ */ (0,
|
|
2382
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
2180
2383
|
BaseNode,
|
|
2181
2384
|
{
|
|
2182
2385
|
kind: d.kind ?? "WEBHOOK",
|
|
@@ -2187,7 +2390,7 @@ var WebhookNode = ({
|
|
|
2187
2390
|
valueChip: d.valueChip,
|
|
2188
2391
|
status: d.status,
|
|
2189
2392
|
accent: "blue",
|
|
2190
|
-
children: /* @__PURE__ */ (0,
|
|
2393
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Handle, { type: "source", position: "bottom" })
|
|
2191
2394
|
}
|
|
2192
2395
|
);
|
|
2193
2396
|
};
|
|
@@ -2195,7 +2398,7 @@ var HttpRequestNode = ({
|
|
|
2195
2398
|
node
|
|
2196
2399
|
}) => {
|
|
2197
2400
|
const d = node.data ?? {};
|
|
2198
|
-
return /* @__PURE__ */ (0,
|
|
2401
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
2199
2402
|
BaseNode,
|
|
2200
2403
|
{
|
|
2201
2404
|
kind: d.kind ?? "HTTP",
|
|
@@ -2207,8 +2410,8 @@ var HttpRequestNode = ({
|
|
|
2207
2410
|
status: d.status,
|
|
2208
2411
|
accent: "blue",
|
|
2209
2412
|
children: [
|
|
2210
|
-
/* @__PURE__ */ (0,
|
|
2211
|
-
/* @__PURE__ */ (0,
|
|
2413
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Handle, { type: "target", position: "top" }),
|
|
2414
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Handle, { type: "source", position: "bottom" })
|
|
2212
2415
|
]
|
|
2213
2416
|
}
|
|
2214
2417
|
);
|
|
@@ -2229,52 +2432,58 @@ var DEFAULT_NODE_KINDS = {
|
|
|
2229
2432
|
};
|
|
2230
2433
|
|
|
2231
2434
|
// src/workflow/components/FlowCanvas/FlowCanvas.tsx
|
|
2232
|
-
var
|
|
2435
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
2233
2436
|
var DEFAULT_VIEWPORT2 = { x: 0, y: 0, zoom: 1 };
|
|
2234
|
-
function FlowCanvas({
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2437
|
+
function FlowCanvas(props) {
|
|
2438
|
+
const viewportPropProvided = props.viewport !== void 0 || props.defaultViewport !== void 0;
|
|
2439
|
+
const {
|
|
2440
|
+
nodes,
|
|
2441
|
+
edges,
|
|
2442
|
+
onNodesChange,
|
|
2443
|
+
onEdgesChange,
|
|
2444
|
+
viewport: controlledViewport,
|
|
2445
|
+
defaultViewport = DEFAULT_VIEWPORT2,
|
|
2446
|
+
onViewportChange,
|
|
2447
|
+
minZoom = 0.25,
|
|
2448
|
+
maxZoom = 2,
|
|
2449
|
+
fitViewOnInit,
|
|
2450
|
+
nodeKinds,
|
|
2451
|
+
onConnect,
|
|
2452
|
+
onConnectStart,
|
|
2453
|
+
onConnectEnd,
|
|
2454
|
+
isValidConnection,
|
|
2455
|
+
onSelectionChange,
|
|
2456
|
+
onPaneClick,
|
|
2457
|
+
onNodeClick,
|
|
2458
|
+
onEdgeClick,
|
|
2459
|
+
onEdgeLabelChange,
|
|
2460
|
+
onInit,
|
|
2461
|
+
onBeforeDelete,
|
|
2462
|
+
onNodeContextMenu,
|
|
2463
|
+
onEdgeContextMenu,
|
|
2464
|
+
onPaneContextMenu,
|
|
2465
|
+
nodesDraggable = true,
|
|
2466
|
+
nodesConnectable = true,
|
|
2467
|
+
panOnDrag: panOnDragProp,
|
|
2468
|
+
zoomOnScroll: zoomOnScrollProp,
|
|
2469
|
+
preset = "mouse",
|
|
2470
|
+
paneClickDistance = 4,
|
|
2471
|
+
paneClickClearsSelection = true,
|
|
2472
|
+
background = "dots",
|
|
2473
|
+
gridSize = 20,
|
|
2474
|
+
snapToGrid = false,
|
|
2475
|
+
nodeCollisionGap = -1,
|
|
2476
|
+
subflowCollisionGap,
|
|
2477
|
+
reparentOnDrag = false,
|
|
2478
|
+
autoResizeContainers = false,
|
|
2479
|
+
containerAutoResizePadding = 32,
|
|
2480
|
+
height = "100%",
|
|
2481
|
+
width = "100%",
|
|
2482
|
+
className,
|
|
2483
|
+
style,
|
|
2484
|
+
children,
|
|
2485
|
+
emptyState
|
|
2486
|
+
} = props;
|
|
2278
2487
|
const presetDefaults = {
|
|
2279
2488
|
mouse: { panOnDrag: true, zoomOnScroll: true },
|
|
2280
2489
|
trackpad: { panOnDrag: true, zoomOnScroll: true },
|
|
@@ -2282,46 +2491,46 @@ function FlowCanvas({
|
|
|
2282
2491
|
};
|
|
2283
2492
|
const panOnDrag = panOnDragProp ?? presetDefaults[preset].panOnDrag;
|
|
2284
2493
|
const zoomOnScroll = zoomOnScrollProp ?? presetDefaults[preset].zoomOnScroll;
|
|
2285
|
-
const store = (0,
|
|
2494
|
+
const store = (0, import_react15.useState)(
|
|
2286
2495
|
() => createFlowStore({
|
|
2287
2496
|
initialNodes: nodes,
|
|
2288
2497
|
initialEdges: edges,
|
|
2289
2498
|
initialViewport: controlledViewport ?? defaultViewport
|
|
2290
2499
|
})
|
|
2291
2500
|
)[0];
|
|
2292
|
-
const handleRegistry = (0,
|
|
2293
|
-
const [handleVersion, setHandleVersion] = (0,
|
|
2294
|
-
(0,
|
|
2501
|
+
const handleRegistry = (0, import_react15.useState)(() => createHandleRegistry())[0];
|
|
2502
|
+
const [handleVersion, setHandleVersion] = (0, import_react15.useState)(0);
|
|
2503
|
+
(0, import_react15.useEffect)(() => {
|
|
2295
2504
|
const unsub = handleRegistry.subscribe(() => {
|
|
2296
2505
|
setHandleVersion((v) => v + 1);
|
|
2297
2506
|
});
|
|
2298
2507
|
return unsub;
|
|
2299
2508
|
}, [handleRegistry]);
|
|
2300
|
-
const kinds = (0,
|
|
2301
|
-
const containerRef = (0,
|
|
2302
|
-
(0,
|
|
2303
|
-
(0,
|
|
2304
|
-
const [uncontrolledVp, setUncontrolledVp] = (0,
|
|
2509
|
+
const kinds = (0, import_react15.useMemo)(() => buildNodeKindRegistry(DEFAULT_NODE_KINDS, nodeKinds), [nodeKinds]);
|
|
2510
|
+
const containerRef = (0, import_react15.useRef)(null);
|
|
2511
|
+
(0, import_react15.useEffect)(() => store.setNodes(nodes), [store, nodes]);
|
|
2512
|
+
(0, import_react15.useEffect)(() => store.setEdges(edges), [store, edges]);
|
|
2513
|
+
const [uncontrolledVp, setUncontrolledVp] = (0, import_react15.useState)(controlledViewport ?? defaultViewport);
|
|
2305
2514
|
const viewport = controlledViewport ?? uncontrolledVp;
|
|
2306
|
-
(0,
|
|
2307
|
-
const setViewport = (0,
|
|
2515
|
+
(0, import_react15.useEffect)(() => store.setViewport(viewport), [store, viewport]);
|
|
2516
|
+
const setViewport = (0, import_react15.useCallback)(
|
|
2308
2517
|
(next) => {
|
|
2309
2518
|
if (controlledViewport === void 0) setUncontrolledVp(next);
|
|
2310
2519
|
onViewportChange?.(next);
|
|
2311
2520
|
},
|
|
2312
2521
|
[controlledViewport, onViewportChange]
|
|
2313
2522
|
);
|
|
2314
|
-
const selectedNodeIds = (0,
|
|
2523
|
+
const selectedNodeIds = (0, import_react15.useMemo)(() => {
|
|
2315
2524
|
const s = /* @__PURE__ */ new Set();
|
|
2316
2525
|
for (const n of nodes) if (n.selected) s.add(n.id);
|
|
2317
2526
|
return s;
|
|
2318
2527
|
}, [nodes]);
|
|
2319
|
-
const selectedEdgeIds = (0,
|
|
2528
|
+
const selectedEdgeIds = (0, import_react15.useMemo)(() => {
|
|
2320
2529
|
const s = /* @__PURE__ */ new Set();
|
|
2321
2530
|
for (const e of edges) if (e.selected) s.add(e.id);
|
|
2322
2531
|
return s;
|
|
2323
2532
|
}, [edges]);
|
|
2324
|
-
(0,
|
|
2533
|
+
(0, import_react15.useEffect)(() => {
|
|
2325
2534
|
store.setSelection(selectedNodeIds, selectedEdgeIds);
|
|
2326
2535
|
if (onSelectionChange) {
|
|
2327
2536
|
onSelectionChange({
|
|
@@ -2330,7 +2539,7 @@ function FlowCanvas({
|
|
|
2330
2539
|
});
|
|
2331
2540
|
}
|
|
2332
2541
|
}, [store, selectedNodeIds, selectedEdgeIds, nodes, edges, onSelectionChange]);
|
|
2333
|
-
const selectNode = (0,
|
|
2542
|
+
const selectNode = (0, import_react15.useCallback)(
|
|
2334
2543
|
(id, additive) => {
|
|
2335
2544
|
const next = [];
|
|
2336
2545
|
const nextEdges = [];
|
|
@@ -2353,14 +2562,14 @@ function FlowCanvas({
|
|
|
2353
2562
|
},
|
|
2354
2563
|
[nodes, edges, selectedNodeIds, onNodesChange, onEdgesChange]
|
|
2355
2564
|
);
|
|
2356
|
-
const notifyNodeClick = (0,
|
|
2565
|
+
const notifyNodeClick = (0, import_react15.useCallback)(
|
|
2357
2566
|
(id) => {
|
|
2358
2567
|
const node = nodes.find((n) => n.id === id);
|
|
2359
2568
|
if (node) onNodeClick?.(node);
|
|
2360
2569
|
},
|
|
2361
2570
|
[nodes, onNodeClick]
|
|
2362
2571
|
);
|
|
2363
|
-
const selectEdge = (0,
|
|
2572
|
+
const selectEdge = (0, import_react15.useCallback)(
|
|
2364
2573
|
(id, additive) => {
|
|
2365
2574
|
const next = [];
|
|
2366
2575
|
const nextNodes = [];
|
|
@@ -2385,7 +2594,7 @@ function FlowCanvas({
|
|
|
2385
2594
|
},
|
|
2386
2595
|
[nodes, edges, selectedEdgeIds, onEdgesChange, onNodesChange, onEdgeClick]
|
|
2387
2596
|
);
|
|
2388
|
-
const clearSelection = (0,
|
|
2597
|
+
const clearSelection = (0, import_react15.useCallback)(() => {
|
|
2389
2598
|
const ns = [];
|
|
2390
2599
|
const es = [];
|
|
2391
2600
|
for (const n of nodes) if (n.selected) ns.push(change.node.select(n.id, false));
|
|
@@ -2393,9 +2602,9 @@ function FlowCanvas({
|
|
|
2393
2602
|
if (ns.length) onNodesChange?.(ns);
|
|
2394
2603
|
if (es.length) onEdgesChange?.(es);
|
|
2395
2604
|
}, [nodes, edges, onNodesChange, onEdgesChange]);
|
|
2396
|
-
const dragRef = (0,
|
|
2397
|
-
const [draggingId, setDraggingId] = (0,
|
|
2398
|
-
const beginNodeDrag = (0,
|
|
2605
|
+
const dragRef = (0, import_react15.useRef)(null);
|
|
2606
|
+
const [draggingId, setDraggingId] = (0, import_react15.useState)(null);
|
|
2607
|
+
const beginNodeDrag = (0, import_react15.useCallback)(
|
|
2399
2608
|
(nodeId, pointerId, clientX, clientY, altKey = false) => {
|
|
2400
2609
|
if (!nodesDraggable) return;
|
|
2401
2610
|
const node = nodes.find((n) => n.id === nodeId);
|
|
@@ -2404,6 +2613,7 @@ function FlowCanvas({
|
|
|
2404
2613
|
id: d.id,
|
|
2405
2614
|
startPosition: d.position
|
|
2406
2615
|
}));
|
|
2616
|
+
const wantsReparent = altKey || reparentOnDragRef.current;
|
|
2407
2617
|
dragRef.current = {
|
|
2408
2618
|
pointerId,
|
|
2409
2619
|
nodeId,
|
|
@@ -2411,7 +2621,7 @@ function FlowCanvas({
|
|
|
2411
2621
|
startClientY: clientY,
|
|
2412
2622
|
startPosition: node.position,
|
|
2413
2623
|
descendants: kids,
|
|
2414
|
-
altDetach:
|
|
2624
|
+
altDetach: wantsReparent,
|
|
2415
2625
|
rafScheduled: false,
|
|
2416
2626
|
nextDelta: null
|
|
2417
2627
|
};
|
|
@@ -2420,12 +2630,12 @@ function FlowCanvas({
|
|
|
2420
2630
|
},
|
|
2421
2631
|
[nodes, nodesDraggable, selectNode]
|
|
2422
2632
|
);
|
|
2423
|
-
const [conn, setConn] = (0,
|
|
2424
|
-
const connRef = (0,
|
|
2425
|
-
(0,
|
|
2633
|
+
const [conn, setConn] = (0, import_react15.useState)(null);
|
|
2634
|
+
const connRef = (0, import_react15.useRef)(null);
|
|
2635
|
+
(0, import_react15.useEffect)(() => {
|
|
2426
2636
|
connRef.current = conn;
|
|
2427
2637
|
}, [conn]);
|
|
2428
|
-
const beginConnection = (0,
|
|
2638
|
+
const beginConnection = (0, import_react15.useCallback)(
|
|
2429
2639
|
(nodeId, handleId, handleType, pointerId, clientX, clientY) => {
|
|
2430
2640
|
if (!nodesConnectable) return;
|
|
2431
2641
|
const node = nodes.find((n) => n.id === nodeId);
|
|
@@ -2458,63 +2668,75 @@ function FlowCanvas({
|
|
|
2458
2668
|
},
|
|
2459
2669
|
[nodes, nodesConnectable, handleRegistry, viewport, store, onConnectStart]
|
|
2460
2670
|
);
|
|
2461
|
-
const viewportRef = (0,
|
|
2462
|
-
const nodesRef = (0,
|
|
2463
|
-
const edgesRef = (0,
|
|
2464
|
-
const onNodesChangeRefForInstance = (0,
|
|
2465
|
-
const onEdgesChangeRefForInstance = (0,
|
|
2466
|
-
const onBeforeDeleteRef = (0,
|
|
2467
|
-
const snapToGridRef = (0,
|
|
2468
|
-
const gridSizeRef = (0,
|
|
2469
|
-
const nodeCollisionGapRef = (0,
|
|
2470
|
-
const subflowCollisionGapRef = (0,
|
|
2471
|
-
(0,
|
|
2671
|
+
const viewportRef = (0, import_react15.useRef)(viewport);
|
|
2672
|
+
const nodesRef = (0, import_react15.useRef)(nodes);
|
|
2673
|
+
const edgesRef = (0, import_react15.useRef)(edges);
|
|
2674
|
+
const onNodesChangeRefForInstance = (0, import_react15.useRef)(onNodesChange);
|
|
2675
|
+
const onEdgesChangeRefForInstance = (0, import_react15.useRef)(onEdgesChange);
|
|
2676
|
+
const onBeforeDeleteRef = (0, import_react15.useRef)(onBeforeDelete);
|
|
2677
|
+
const snapToGridRef = (0, import_react15.useRef)(snapToGrid);
|
|
2678
|
+
const gridSizeRef = (0, import_react15.useRef)(gridSize);
|
|
2679
|
+
const nodeCollisionGapRef = (0, import_react15.useRef)(nodeCollisionGap);
|
|
2680
|
+
const subflowCollisionGapRef = (0, import_react15.useRef)(subflowCollisionGap ?? nodeCollisionGap);
|
|
2681
|
+
const reparentOnDragRef = (0, import_react15.useRef)(reparentOnDrag);
|
|
2682
|
+
const autoResizeContainersRef = (0, import_react15.useRef)(autoResizeContainers);
|
|
2683
|
+
const containerAutoResizePaddingRef = (0, import_react15.useRef)(containerAutoResizePadding);
|
|
2684
|
+
(0, import_react15.useEffect)(() => {
|
|
2472
2685
|
edgesRef.current = edges;
|
|
2473
2686
|
}, [edges]);
|
|
2474
|
-
(0,
|
|
2687
|
+
(0, import_react15.useEffect)(() => {
|
|
2475
2688
|
onNodesChangeRefForInstance.current = onNodesChange;
|
|
2476
2689
|
}, [onNodesChange]);
|
|
2477
|
-
(0,
|
|
2690
|
+
(0, import_react15.useEffect)(() => {
|
|
2478
2691
|
onEdgesChangeRefForInstance.current = onEdgesChange;
|
|
2479
2692
|
}, [onEdgesChange]);
|
|
2480
|
-
(0,
|
|
2693
|
+
(0, import_react15.useEffect)(() => {
|
|
2481
2694
|
onBeforeDeleteRef.current = onBeforeDelete;
|
|
2482
2695
|
}, [onBeforeDelete]);
|
|
2483
|
-
(0,
|
|
2696
|
+
(0, import_react15.useEffect)(() => {
|
|
2484
2697
|
snapToGridRef.current = snapToGrid;
|
|
2485
2698
|
}, [snapToGrid]);
|
|
2486
|
-
(0,
|
|
2699
|
+
(0, import_react15.useEffect)(() => {
|
|
2487
2700
|
gridSizeRef.current = gridSize;
|
|
2488
2701
|
}, [gridSize]);
|
|
2489
|
-
(0,
|
|
2702
|
+
(0, import_react15.useEffect)(() => {
|
|
2490
2703
|
nodeCollisionGapRef.current = nodeCollisionGap;
|
|
2491
2704
|
}, [nodeCollisionGap]);
|
|
2492
|
-
(0,
|
|
2705
|
+
(0, import_react15.useEffect)(() => {
|
|
2493
2706
|
subflowCollisionGapRef.current = subflowCollisionGap ?? nodeCollisionGap;
|
|
2494
2707
|
}, [subflowCollisionGap, nodeCollisionGap]);
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
2708
|
+
(0, import_react15.useEffect)(() => {
|
|
2709
|
+
reparentOnDragRef.current = reparentOnDrag;
|
|
2710
|
+
}, [reparentOnDrag]);
|
|
2711
|
+
(0, import_react15.useEffect)(() => {
|
|
2712
|
+
autoResizeContainersRef.current = autoResizeContainers;
|
|
2713
|
+
}, [autoResizeContainers]);
|
|
2714
|
+
(0, import_react15.useEffect)(() => {
|
|
2715
|
+
containerAutoResizePaddingRef.current = containerAutoResizePadding;
|
|
2716
|
+
}, [containerAutoResizePadding]);
|
|
2717
|
+
const onNodesChangeRef = (0, import_react15.useRef)(onNodesChange);
|
|
2718
|
+
const onConnectRef = (0, import_react15.useRef)(onConnect);
|
|
2719
|
+
const onConnectEndRef = (0, import_react15.useRef)(onConnectEnd);
|
|
2720
|
+
const isValidConnectionRef = (0, import_react15.useRef)(isValidConnection);
|
|
2721
|
+
(0, import_react15.useEffect)(() => {
|
|
2500
2722
|
viewportRef.current = viewport;
|
|
2501
2723
|
}, [viewport]);
|
|
2502
|
-
(0,
|
|
2724
|
+
(0, import_react15.useEffect)(() => {
|
|
2503
2725
|
nodesRef.current = nodes;
|
|
2504
2726
|
}, [nodes]);
|
|
2505
|
-
(0,
|
|
2727
|
+
(0, import_react15.useEffect)(() => {
|
|
2506
2728
|
onNodesChangeRef.current = onNodesChange;
|
|
2507
2729
|
}, [onNodesChange]);
|
|
2508
|
-
(0,
|
|
2730
|
+
(0, import_react15.useEffect)(() => {
|
|
2509
2731
|
onConnectRef.current = onConnect;
|
|
2510
2732
|
}, [onConnect]);
|
|
2511
|
-
(0,
|
|
2733
|
+
(0, import_react15.useEffect)(() => {
|
|
2512
2734
|
onConnectEndRef.current = onConnectEnd;
|
|
2513
2735
|
}, [onConnectEnd]);
|
|
2514
|
-
(0,
|
|
2736
|
+
(0, import_react15.useEffect)(() => {
|
|
2515
2737
|
isValidConnectionRef.current = isValidConnection;
|
|
2516
2738
|
}, [isValidConnection]);
|
|
2517
|
-
(0,
|
|
2739
|
+
(0, import_react15.useEffect)(() => {
|
|
2518
2740
|
const onPointerMove = (e) => {
|
|
2519
2741
|
const vp = viewportRef.current;
|
|
2520
2742
|
const drag = dragRef.current;
|
|
@@ -2611,7 +2833,7 @@ function FlowCanvas({
|
|
|
2611
2833
|
)
|
|
2612
2834
|
);
|
|
2613
2835
|
}
|
|
2614
|
-
if (drag.altDetach
|
|
2836
|
+
if (drag.altDetach) {
|
|
2615
2837
|
const targetGroup = findContainingGroup(
|
|
2616
2838
|
{
|
|
2617
2839
|
x: finalPos.x + (dragNode.width ?? 0) / 2,
|
|
@@ -2621,14 +2843,26 @@ function FlowCanvas({
|
|
|
2621
2843
|
[drag.nodeId, ...drag.descendants.map((d) => d.id)]
|
|
2622
2844
|
);
|
|
2623
2845
|
const nextParentId = targetGroup?.id;
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
|
|
2846
|
+
if (nextParentId !== dragNode.parentId) {
|
|
2847
|
+
const updated = {
|
|
2848
|
+
...dragNode,
|
|
2849
|
+
position: finalPos,
|
|
2850
|
+
parentId: nextParentId,
|
|
2851
|
+
// Preserve extent only when staying in a group.
|
|
2852
|
+
extent: nextParentId ? dragNode.extent : void 0
|
|
2853
|
+
};
|
|
2854
|
+
changes.push(change.node.replace(drag.nodeId, updated));
|
|
2855
|
+
}
|
|
2856
|
+
}
|
|
2857
|
+
if (autoResizeContainersRef.current) {
|
|
2858
|
+
const containerChanges = computeContainerAutoResize(
|
|
2859
|
+
nodesRef.current,
|
|
2860
|
+
// Projected children: apply the position + reparent
|
|
2861
|
+
// changes we just built before measuring bboxes.
|
|
2862
|
+
changes,
|
|
2863
|
+
containerAutoResizePaddingRef.current
|
|
2864
|
+
);
|
|
2865
|
+
for (const c2 of containerChanges) changes.push(c2);
|
|
2632
2866
|
}
|
|
2633
2867
|
onNodesChangeRef.current?.(changes);
|
|
2634
2868
|
}
|
|
@@ -2637,8 +2871,19 @@ function FlowCanvas({
|
|
|
2637
2871
|
}
|
|
2638
2872
|
const c = connRef.current;
|
|
2639
2873
|
if (c && c.pointerId === e.pointerId) {
|
|
2640
|
-
|
|
2641
|
-
|
|
2874
|
+
let handleEl = null;
|
|
2875
|
+
if (typeof document !== "undefined") {
|
|
2876
|
+
const stack = document.elementsFromPoint(e.clientX, e.clientY);
|
|
2877
|
+
for (const el of stack) {
|
|
2878
|
+
const candidate = el.closest(
|
|
2879
|
+
"[data-handle-id]"
|
|
2880
|
+
);
|
|
2881
|
+
if (!candidate) continue;
|
|
2882
|
+
if (candidate.dataset.handleNodeId === c.from.nodeId) continue;
|
|
2883
|
+
handleEl = candidate;
|
|
2884
|
+
break;
|
|
2885
|
+
}
|
|
2886
|
+
}
|
|
2642
2887
|
let connection = null;
|
|
2643
2888
|
let connectedTo;
|
|
2644
2889
|
if (handleEl) {
|
|
@@ -2701,7 +2946,7 @@ function FlowCanvas({
|
|
|
2701
2946
|
window.removeEventListener("pointercancel", onPointerCancel);
|
|
2702
2947
|
};
|
|
2703
2948
|
}, [store]);
|
|
2704
|
-
const panRef = (0,
|
|
2949
|
+
const panRef = (0, import_react15.useRef)(null);
|
|
2705
2950
|
const onCanvasPointerDown = (e) => {
|
|
2706
2951
|
if (e.button !== 0) return;
|
|
2707
2952
|
const t = e.target;
|
|
@@ -2726,7 +2971,7 @@ function FlowCanvas({
|
|
|
2726
2971
|
moved: false
|
|
2727
2972
|
};
|
|
2728
2973
|
};
|
|
2729
|
-
(0,
|
|
2974
|
+
(0, import_react15.useEffect)(() => {
|
|
2730
2975
|
const onMove = (e) => {
|
|
2731
2976
|
const pan = panRef.current;
|
|
2732
2977
|
if (!pan || pan.pointerId !== e.pointerId) return;
|
|
@@ -2782,7 +3027,7 @@ function FlowCanvas({
|
|
|
2782
3027
|
y: py - (py - viewport.y) * k
|
|
2783
3028
|
});
|
|
2784
3029
|
};
|
|
2785
|
-
const dispatch = (0,
|
|
3030
|
+
const dispatch = (0, import_react15.useCallback)(
|
|
2786
3031
|
(a) => {
|
|
2787
3032
|
if (a.type === "connection/start") {
|
|
2788
3033
|
beginConnection(a.nodeId, a.handleId, a.handleType, a.pointerId, a.clientX, a.clientY);
|
|
@@ -2790,7 +3035,7 @@ function FlowCanvas({
|
|
|
2790
3035
|
},
|
|
2791
3036
|
[beginConnection]
|
|
2792
3037
|
);
|
|
2793
|
-
const reportDimensions = (0,
|
|
3038
|
+
const reportDimensions = (0, import_react15.useCallback)(
|
|
2794
3039
|
(nodeId, width2, height2) => {
|
|
2795
3040
|
const node = nodes.find((n) => n.id === nodeId);
|
|
2796
3041
|
if (!node) return;
|
|
@@ -2799,7 +3044,7 @@ function FlowCanvas({
|
|
|
2799
3044
|
},
|
|
2800
3045
|
[nodes, onNodesChange]
|
|
2801
3046
|
);
|
|
2802
|
-
const toggleNodeCollapseImpl = (0,
|
|
3047
|
+
const toggleNodeCollapseImpl = (0, import_react15.useCallback)(
|
|
2803
3048
|
(nodeId) => {
|
|
2804
3049
|
const node = nodes.find((n) => n.id === nodeId);
|
|
2805
3050
|
if (!node) return;
|
|
@@ -2812,7 +3057,7 @@ function FlowCanvas({
|
|
|
2812
3057
|
},
|
|
2813
3058
|
[nodes, onNodesChange]
|
|
2814
3059
|
);
|
|
2815
|
-
const deleteNodeImpl = (0,
|
|
3060
|
+
const deleteNodeImpl = (0, import_react15.useCallback)(
|
|
2816
3061
|
(nodeId) => {
|
|
2817
3062
|
const incidentEdgeIds = edgesRef.current.filter((e) => e.source === nodeId || e.target === nodeId).map((e) => e.id);
|
|
2818
3063
|
if (incidentEdgeIds.length > 0) {
|
|
@@ -2822,7 +3067,7 @@ function FlowCanvas({
|
|
|
2822
3067
|
},
|
|
2823
3068
|
[onNodesChange, onEdgesChange]
|
|
2824
3069
|
);
|
|
2825
|
-
const instance = (0,
|
|
3070
|
+
const instance = (0, import_react15.useMemo)(
|
|
2826
3071
|
() => ({
|
|
2827
3072
|
// viewport
|
|
2828
3073
|
getViewport: () => viewportRef.current,
|
|
@@ -2963,13 +3208,29 @@ function FlowCanvas({
|
|
|
2963
3208
|
}),
|
|
2964
3209
|
[setViewport, minZoom, maxZoom]
|
|
2965
3210
|
);
|
|
2966
|
-
const initFiredRef = (0,
|
|
2967
|
-
(0,
|
|
3211
|
+
const initFiredRef = (0, import_react15.useRef)(false);
|
|
3212
|
+
(0, import_react15.useEffect)(() => {
|
|
2968
3213
|
if (initFiredRef.current) return;
|
|
2969
3214
|
initFiredRef.current = true;
|
|
2970
3215
|
onInit?.(instance);
|
|
2971
3216
|
}, [instance, onInit]);
|
|
2972
|
-
(0,
|
|
3217
|
+
const fitOnInitFiredRef = (0, import_react15.useRef)(false);
|
|
3218
|
+
(0, import_react15.useEffect)(() => {
|
|
3219
|
+
if (fitOnInitFiredRef.current) return;
|
|
3220
|
+
const opt = fitViewOnInit;
|
|
3221
|
+
const shouldFit = opt === false ? false : opt !== void 0 ? true : !viewportPropProvided;
|
|
3222
|
+
if (!shouldFit) return;
|
|
3223
|
+
if (nodes.length === 0) return;
|
|
3224
|
+
const rect = containerRef.current?.getBoundingClientRect();
|
|
3225
|
+
if (!rect || rect.width === 0 || rect.height === 0) return;
|
|
3226
|
+
fitOnInitFiredRef.current = true;
|
|
3227
|
+
const fitOpts = typeof opt === "object" && opt !== null ? opt : void 0;
|
|
3228
|
+
const raf = requestAnimationFrame(() => {
|
|
3229
|
+
void instance.fitView(fitOpts);
|
|
3230
|
+
});
|
|
3231
|
+
return () => cancelAnimationFrame(raf);
|
|
3232
|
+
}, [fitViewOnInit, viewportPropProvided, nodes.length, instance]);
|
|
3233
|
+
(0, import_react15.useEffect)(() => {
|
|
2973
3234
|
const onKey = (e) => {
|
|
2974
3235
|
if (e.key !== "Backspace" && e.key !== "Delete") return;
|
|
2975
3236
|
const target = e.target;
|
|
@@ -2990,7 +3251,7 @@ function FlowCanvas({
|
|
|
2990
3251
|
window.addEventListener("keydown", onKey);
|
|
2991
3252
|
return () => window.removeEventListener("keydown", onKey);
|
|
2992
3253
|
}, [instance, store]);
|
|
2993
|
-
const bridge = (0,
|
|
3254
|
+
const bridge = (0, import_react15.useMemo)(
|
|
2994
3255
|
() => ({
|
|
2995
3256
|
beginNodeDrag,
|
|
2996
3257
|
selectNode,
|
|
@@ -3010,16 +3271,16 @@ function FlowCanvas({
|
|
|
3010
3271
|
toggleNodeCollapseImpl
|
|
3011
3272
|
]
|
|
3012
3273
|
);
|
|
3013
|
-
const [panGesture, setPanGesture] = (0,
|
|
3274
|
+
const [panGesture, setPanGesture] = (0, import_react15.useState)(false);
|
|
3014
3275
|
const isEmpty = nodes.length === 0 && edges.length === 0;
|
|
3015
3276
|
const isConnecting = conn !== null;
|
|
3016
|
-
const visibleNodes = (0,
|
|
3017
|
-
const visibleEdges = (0,
|
|
3277
|
+
const visibleNodes = (0, import_react15.useMemo)(() => nodes.filter((n) => !n.hidden), [nodes]);
|
|
3278
|
+
const visibleEdges = (0, import_react15.useMemo)(() => {
|
|
3018
3279
|
if (visibleNodes.length === nodes.length) return edges;
|
|
3019
3280
|
const visibleIds = new Set(visibleNodes.map((n) => n.id));
|
|
3020
3281
|
return edges.filter((e) => visibleIds.has(e.source) && visibleIds.has(e.target));
|
|
3021
3282
|
}, [edges, nodes, visibleNodes]);
|
|
3022
|
-
const orderedNodes = (0,
|
|
3283
|
+
const orderedNodes = (0, import_react15.useMemo)(() => {
|
|
3023
3284
|
const isContainer = (n) => n.type === "group" || n.type === "forEach";
|
|
3024
3285
|
const depth = (n) => {
|
|
3025
3286
|
let d = 0;
|
|
@@ -3038,7 +3299,7 @@ function FlowCanvas({
|
|
|
3038
3299
|
containers.sort((a, b) => depth(a) - depth(b));
|
|
3039
3300
|
return [...containers, ...others];
|
|
3040
3301
|
}, [visibleNodes]);
|
|
3041
|
-
return /* @__PURE__ */ (0,
|
|
3302
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(FlowStoreContext.Provider, { value: store, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(FlowInstanceContext.Provider, { value: instance, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(HandleRegistryContext.Provider, { value: handleRegistry, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(FlowDispatchContext.Provider, { value: dispatch, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(FlowNodeBridgeContext.Provider, { value: bridge, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
3042
3303
|
"div",
|
|
3043
3304
|
{
|
|
3044
3305
|
ref: containerRef,
|
|
@@ -3083,7 +3344,7 @@ function FlowCanvas({
|
|
|
3083
3344
|
},
|
|
3084
3345
|
"data-empty": isEmpty ? "true" : void 0,
|
|
3085
3346
|
children: [
|
|
3086
|
-
background !== "none" && /* @__PURE__ */ (0,
|
|
3347
|
+
background !== "none" && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
3087
3348
|
"div",
|
|
3088
3349
|
{
|
|
3089
3350
|
className: cn(
|
|
@@ -3097,7 +3358,7 @@ function FlowCanvas({
|
|
|
3097
3358
|
}
|
|
3098
3359
|
}
|
|
3099
3360
|
),
|
|
3100
|
-
/* @__PURE__ */ (0,
|
|
3361
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
3101
3362
|
"div",
|
|
3102
3363
|
{
|
|
3103
3364
|
className: "ods-flow-canvas-v2__viewport",
|
|
@@ -3108,7 +3369,7 @@ function FlowCanvas({
|
|
|
3108
3369
|
transformOrigin: "0 0"
|
|
3109
3370
|
},
|
|
3110
3371
|
children: [
|
|
3111
|
-
/* @__PURE__ */ (0,
|
|
3372
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
3112
3373
|
EdgesLayer,
|
|
3113
3374
|
{
|
|
3114
3375
|
edges: visibleEdges,
|
|
@@ -3123,7 +3384,7 @@ function FlowCanvas({
|
|
|
3123
3384
|
orderedNodes.map((node) => {
|
|
3124
3385
|
const Kind = kinds[node.type] ?? kinds.action;
|
|
3125
3386
|
if (!Kind) return null;
|
|
3126
|
-
return /* @__PURE__ */ (0,
|
|
3387
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
3127
3388
|
FlowNode,
|
|
3128
3389
|
{
|
|
3129
3390
|
node,
|
|
@@ -3138,7 +3399,7 @@ function FlowCanvas({
|
|
|
3138
3399
|
]
|
|
3139
3400
|
}
|
|
3140
3401
|
),
|
|
3141
|
-
isEmpty && emptyState && /* @__PURE__ */ (0,
|
|
3402
|
+
isEmpty && emptyState && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "ods-flow-canvas-v2__empty", children: emptyState }),
|
|
3142
3403
|
children
|
|
3143
3404
|
]
|
|
3144
3405
|
}
|
|
@@ -3147,7 +3408,60 @@ function FlowCanvas({
|
|
|
3147
3408
|
function onEdgesChangeRef(id, cb) {
|
|
3148
3409
|
cb?.([change.edge.remove(id)]);
|
|
3149
3410
|
}
|
|
3150
|
-
|
|
3411
|
+
function computeContainerAutoResize(nodes, pending, padding) {
|
|
3412
|
+
const projected = /* @__PURE__ */ new Map();
|
|
3413
|
+
for (const n of nodes) projected.set(n.id, n);
|
|
3414
|
+
for (const c of pending) {
|
|
3415
|
+
if (c.type === "position" && c.position) {
|
|
3416
|
+
const cur = projected.get(c.id);
|
|
3417
|
+
if (cur) projected.set(c.id, { ...cur, position: c.position });
|
|
3418
|
+
} else if (c.type === "replace" && c.item) {
|
|
3419
|
+
projected.set(c.id, { ...projected.get(c.id), ...c.item });
|
|
3420
|
+
} else if (c.type === "add" && c.item) {
|
|
3421
|
+
projected.set(c.item.id, c.item);
|
|
3422
|
+
}
|
|
3423
|
+
}
|
|
3424
|
+
const HEADER = 56;
|
|
3425
|
+
const out = [];
|
|
3426
|
+
for (const parent of projected.values()) {
|
|
3427
|
+
if (parent.type !== "group" && parent.type !== "forEach") continue;
|
|
3428
|
+
const children = [];
|
|
3429
|
+
for (const n of projected.values()) {
|
|
3430
|
+
if (n.parentId === parent.id) children.push(n);
|
|
3431
|
+
}
|
|
3432
|
+
if (children.length === 0) continue;
|
|
3433
|
+
let minX = Number.POSITIVE_INFINITY;
|
|
3434
|
+
let minY = Number.POSITIVE_INFINITY;
|
|
3435
|
+
let maxX = Number.NEGATIVE_INFINITY;
|
|
3436
|
+
let maxY = Number.NEGATIVE_INFINITY;
|
|
3437
|
+
for (const c of children) {
|
|
3438
|
+
const cw = c.width ?? 240;
|
|
3439
|
+
const ch = c.height ?? 96;
|
|
3440
|
+
if (c.position.x < minX) minX = c.position.x;
|
|
3441
|
+
if (c.position.y < minY) minY = c.position.y;
|
|
3442
|
+
if (c.position.x + cw > maxX) maxX = c.position.x + cw;
|
|
3443
|
+
if (c.position.y + ch > maxY) maxY = c.position.y + ch;
|
|
3444
|
+
}
|
|
3445
|
+
const targetX = minX - padding;
|
|
3446
|
+
const targetY = minY - padding - HEADER;
|
|
3447
|
+
const targetW = maxX - minX + padding * 2;
|
|
3448
|
+
const targetH = maxY - minY + padding * 2 + HEADER;
|
|
3449
|
+
const curW = parent.width ?? 480;
|
|
3450
|
+
const curH = parent.height ?? 240;
|
|
3451
|
+
const nextW = Math.max(curW, targetW);
|
|
3452
|
+
const nextH = Math.max(curH, targetH);
|
|
3453
|
+
const positionDirty = parent.position.x !== targetX || parent.position.y !== targetY;
|
|
3454
|
+
const sizeDirty = curW !== nextW || curH !== nextH;
|
|
3455
|
+
if (positionDirty) {
|
|
3456
|
+
out.push(change.node.position(parent.id, { x: targetX, y: targetY }, false));
|
|
3457
|
+
}
|
|
3458
|
+
if (sizeDirty) {
|
|
3459
|
+
out.push(change.node.dimensions(parent.id, { width: nextW, height: nextH }));
|
|
3460
|
+
}
|
|
3461
|
+
}
|
|
3462
|
+
return out;
|
|
3463
|
+
}
|
|
3464
|
+
var EdgesLayer = (0, import_react15.memo)(function EdgesLayer2({
|
|
3151
3465
|
edges,
|
|
3152
3466
|
nodes,
|
|
3153
3467
|
onSelect,
|
|
@@ -3156,7 +3470,7 @@ var EdgesLayer = (0, import_react14.memo)(function EdgesLayer2({
|
|
|
3156
3470
|
ghost,
|
|
3157
3471
|
handleVersion: _handleVersion
|
|
3158
3472
|
}) {
|
|
3159
|
-
return /* @__PURE__ */ (0,
|
|
3473
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
3160
3474
|
"svg",
|
|
3161
3475
|
{
|
|
3162
3476
|
className: "ods-flow-canvas-v2__edges",
|
|
@@ -3164,7 +3478,7 @@ var EdgesLayer = (0, import_react14.memo)(function EdgesLayer2({
|
|
|
3164
3478
|
width: "100%",
|
|
3165
3479
|
height: "100%",
|
|
3166
3480
|
children: [
|
|
3167
|
-
/* @__PURE__ */ (0,
|
|
3481
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("g", { style: { pointerEvents: "auto" }, children: edges.map((edge) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
3168
3482
|
FlowEdge,
|
|
3169
3483
|
{
|
|
3170
3484
|
edge,
|
|
@@ -3176,7 +3490,7 @@ var EdgesLayer = (0, import_react14.memo)(function EdgesLayer2({
|
|
|
3176
3490
|
},
|
|
3177
3491
|
edge.id
|
|
3178
3492
|
)) }),
|
|
3179
|
-
ghost && /* @__PURE__ */ (0,
|
|
3493
|
+
ghost && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
3180
3494
|
"path",
|
|
3181
3495
|
{
|
|
3182
3496
|
d: `M ${ghost.start.x} ${ghost.start.y} L ${ghost.end.x} ${ghost.end.y}`,
|
|
@@ -3191,151 +3505,6 @@ var EdgesLayer = (0, import_react14.memo)(function EdgesLayer2({
|
|
|
3191
3505
|
);
|
|
3192
3506
|
});
|
|
3193
3507
|
|
|
3194
|
-
// src/workflow/components/NodeResizer/NodeResizer.tsx
|
|
3195
|
-
var import_react15 = require("react");
|
|
3196
|
-
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
3197
|
-
function NodeResizer({
|
|
3198
|
-
isVisible,
|
|
3199
|
-
minWidth = 80,
|
|
3200
|
-
minHeight = 60,
|
|
3201
|
-
maxWidth,
|
|
3202
|
-
maxHeight,
|
|
3203
|
-
keepAspectRatio = false,
|
|
3204
|
-
onResize,
|
|
3205
|
-
onResizeEnd,
|
|
3206
|
-
color
|
|
3207
|
-
}) {
|
|
3208
|
-
const { node, selected } = useFlowNodeContext();
|
|
3209
|
-
const viewport = useViewport();
|
|
3210
|
-
const flow = useFlow();
|
|
3211
|
-
const dragRef = (0, import_react15.useRef)(null);
|
|
3212
|
-
const show = isVisible ?? selected;
|
|
3213
|
-
if (!show) return null;
|
|
3214
|
-
const beginResize = (e, corner) => {
|
|
3215
|
-
e.preventDefault();
|
|
3216
|
-
e.stopPropagation();
|
|
3217
|
-
e.target.setPointerCapture(e.pointerId);
|
|
3218
|
-
const w = node.width ?? DEFAULT_NODE_WIDTH;
|
|
3219
|
-
const h = node.height ?? DEFAULT_NODE_HEIGHT;
|
|
3220
|
-
dragRef.current = {
|
|
3221
|
-
pointerId: e.pointerId,
|
|
3222
|
-
corner,
|
|
3223
|
-
startClientX: e.clientX,
|
|
3224
|
-
startClientY: e.clientY,
|
|
3225
|
-
startWidth: w,
|
|
3226
|
-
startHeight: h,
|
|
3227
|
-
startX: node.position.x,
|
|
3228
|
-
startY: node.position.y,
|
|
3229
|
-
aspect: w / Math.max(1, h)
|
|
3230
|
-
};
|
|
3231
|
-
};
|
|
3232
|
-
const onMove = (e) => {
|
|
3233
|
-
const drag = dragRef.current;
|
|
3234
|
-
if (!drag || drag.pointerId !== e.pointerId) return;
|
|
3235
|
-
const dx = (e.clientX - drag.startClientX) / viewport.zoom;
|
|
3236
|
-
const dy = (e.clientY - drag.startClientY) / viewport.zoom;
|
|
3237
|
-
let nextW = drag.startWidth;
|
|
3238
|
-
let nextH = drag.startHeight;
|
|
3239
|
-
let nextX = drag.startX;
|
|
3240
|
-
let nextY = drag.startY;
|
|
3241
|
-
switch (drag.corner) {
|
|
3242
|
-
case "se":
|
|
3243
|
-
nextW = drag.startWidth + dx;
|
|
3244
|
-
nextH = drag.startHeight + dy;
|
|
3245
|
-
break;
|
|
3246
|
-
case "sw":
|
|
3247
|
-
nextW = drag.startWidth - dx;
|
|
3248
|
-
nextH = drag.startHeight + dy;
|
|
3249
|
-
nextX = drag.startX + dx;
|
|
3250
|
-
break;
|
|
3251
|
-
case "ne":
|
|
3252
|
-
nextW = drag.startWidth + dx;
|
|
3253
|
-
nextH = drag.startHeight - dy;
|
|
3254
|
-
nextY = drag.startY + dy;
|
|
3255
|
-
break;
|
|
3256
|
-
case "nw":
|
|
3257
|
-
nextW = drag.startWidth - dx;
|
|
3258
|
-
nextH = drag.startHeight - dy;
|
|
3259
|
-
nextX = drag.startX + dx;
|
|
3260
|
-
nextY = drag.startY + dy;
|
|
3261
|
-
break;
|
|
3262
|
-
}
|
|
3263
|
-
if (keepAspectRatio) {
|
|
3264
|
-
nextH = nextW / drag.aspect;
|
|
3265
|
-
if (drag.corner === "nw" || drag.corner === "ne") {
|
|
3266
|
-
nextY = drag.startY + (drag.startHeight - nextH);
|
|
3267
|
-
}
|
|
3268
|
-
}
|
|
3269
|
-
nextW = Math.max(minWidth, maxWidth ? Math.min(maxWidth, nextW) : nextW);
|
|
3270
|
-
nextH = Math.max(minHeight, maxHeight ? Math.min(maxHeight, nextH) : nextH);
|
|
3271
|
-
flow.updateNode(node.id, {
|
|
3272
|
-
width: nextW,
|
|
3273
|
-
height: nextH,
|
|
3274
|
-
position: { x: nextX, y: nextY }
|
|
3275
|
-
});
|
|
3276
|
-
onResize?.({ width: nextW, height: nextH });
|
|
3277
|
-
};
|
|
3278
|
-
const onUp = (e) => {
|
|
3279
|
-
if (dragRef.current?.pointerId === e.pointerId) {
|
|
3280
|
-
const cur = flow.getNode(node.id);
|
|
3281
|
-
if (cur) {
|
|
3282
|
-
onResizeEnd?.({
|
|
3283
|
-
width: cur.width ?? DEFAULT_NODE_WIDTH,
|
|
3284
|
-
height: cur.height ?? DEFAULT_NODE_HEIGHT
|
|
3285
|
-
});
|
|
3286
|
-
}
|
|
3287
|
-
dragRef.current = null;
|
|
3288
|
-
}
|
|
3289
|
-
};
|
|
3290
|
-
const handleColor = color ?? "var(--ods-accent)";
|
|
3291
|
-
const handleStyle = (corner) => {
|
|
3292
|
-
const base = {
|
|
3293
|
-
position: "absolute",
|
|
3294
|
-
width: 12,
|
|
3295
|
-
height: 12,
|
|
3296
|
-
background: "var(--ods-surface-canvas)",
|
|
3297
|
-
border: `2px solid ${handleColor}`,
|
|
3298
|
-
borderRadius: 2,
|
|
3299
|
-
cursor: cursorFor(corner),
|
|
3300
|
-
touchAction: "none",
|
|
3301
|
-
// Place each handle so its CENTRE sits on the corresponding corner.
|
|
3302
|
-
transform: "translate(-50%, -50%)"
|
|
3303
|
-
};
|
|
3304
|
-
switch (corner) {
|
|
3305
|
-
case "nw":
|
|
3306
|
-
return { ...base, top: 0, left: 0 };
|
|
3307
|
-
case "ne":
|
|
3308
|
-
return { ...base, top: 0, left: "100%" };
|
|
3309
|
-
case "sw":
|
|
3310
|
-
return { ...base, top: "100%", left: 0 };
|
|
3311
|
-
case "se":
|
|
3312
|
-
return { ...base, top: "100%", left: "100%" };
|
|
3313
|
-
}
|
|
3314
|
-
};
|
|
3315
|
-
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: cn("ods-node-resizer"), "data-flow-no-drag": "true", children: ["nw", "ne", "sw", "se"].map((corner) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
3316
|
-
"div",
|
|
3317
|
-
{
|
|
3318
|
-
style: handleStyle(corner),
|
|
3319
|
-
onPointerDown: (e) => beginResize(e, corner),
|
|
3320
|
-
onPointerMove: onMove,
|
|
3321
|
-
onPointerUp: onUp,
|
|
3322
|
-
onPointerCancel: onUp,
|
|
3323
|
-
"aria-label": `Resize ${corner}`
|
|
3324
|
-
},
|
|
3325
|
-
corner
|
|
3326
|
-
)) });
|
|
3327
|
-
}
|
|
3328
|
-
function cursorFor(corner) {
|
|
3329
|
-
switch (corner) {
|
|
3330
|
-
case "nw":
|
|
3331
|
-
case "se":
|
|
3332
|
-
return "nwse-resize";
|
|
3333
|
-
case "ne":
|
|
3334
|
-
case "sw":
|
|
3335
|
-
return "nesw-resize";
|
|
3336
|
-
}
|
|
3337
|
-
}
|
|
3338
|
-
|
|
3339
3508
|
// src/workflow/components/NodeToolbar/NodeToolbar.tsx
|
|
3340
3509
|
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
3341
3510
|
function NodeToolbar({
|
|
@@ -3564,6 +3733,7 @@ function toggleGroupCollapse(groupId, nodes) {
|
|
|
3564
3733
|
useNodeData,
|
|
3565
3734
|
useNodes,
|
|
3566
3735
|
useSelection,
|
|
3567
|
-
useViewport
|
|
3736
|
+
useViewport,
|
|
3737
|
+
useViewportOrNull
|
|
3568
3738
|
});
|
|
3569
3739
|
//# sourceMappingURL=workflow.cjs.map
|