@solidxai/core-ui 0.1.13 → 0.1.14-beta.1
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/components/common/SolidPopupContainer.d.ts.map +1 -1
- package/dist/components/common/SolidPopupContainer.js +68 -5
- package/dist/components/common/SolidPopupContainer.js.map +1 -1
- package/dist/components/common/SolidPopupContainer.tsx +50 -4
- package/dist/components/core/card/SolidCardView.d.ts.map +1 -1
- package/dist/components/core/card/SolidCardView.js +12 -5
- package/dist/components/core/card/SolidCardView.js.map +1 -1
- package/dist/components/core/card/SolidCardView.tsx +15 -21
- package/dist/components/core/card/SolidCardViewConfigure.d.ts.map +1 -1
- package/dist/components/core/card/SolidCardViewConfigure.js +1 -1
- package/dist/components/core/card/SolidCardViewConfigure.js.map +1 -1
- package/dist/components/core/card/SolidCardViewConfigure.tsx +3 -1
- package/dist/components/core/chatter/useChatterMentions.js +11 -12
- package/dist/components/core/chatter/useChatterMentions.js.map +1 -1
- package/dist/components/core/chatter/useChatterMentions.ts +6 -6
- package/dist/components/core/common/globalSearchPersistence.d.ts +0 -1
- package/dist/components/core/common/globalSearchPersistence.d.ts.map +1 -1
- package/dist/components/core/common/globalSearchPersistence.js +4 -6
- package/dist/components/core/common/globalSearchPersistence.js.map +1 -1
- package/dist/components/core/common/globalSearchPersistence.ts +4 -4
- package/dist/components/core/extension/solid-core/workflowDefinition/list/openWorkflowDefinitionEditorHeaderAction.d.ts +2 -0
- package/dist/components/core/extension/solid-core/workflowDefinition/list/openWorkflowDefinitionEditorHeaderAction.d.ts.map +1 -0
- package/dist/components/core/extension/solid-core/workflowDefinition/list/openWorkflowDefinitionEditorHeaderAction.js +4 -0
- package/dist/components/core/extension/solid-core/workflowDefinition/list/openWorkflowDefinitionEditorHeaderAction.js.map +1 -0
- package/dist/components/core/extension/solid-core/workflowDefinition/list/openWorkflowDefinitionEditorHeaderAction.ts +3 -0
- package/dist/components/core/extension/solid-core/workflowDefinition/list/openWorkflowDefinitionEditorRowAction.d.ts +8 -0
- package/dist/components/core/extension/solid-core/workflowDefinition/list/openWorkflowDefinitionEditorRowAction.d.ts.map +1 -0
- package/dist/components/core/extension/solid-core/workflowDefinition/list/openWorkflowDefinitionEditorRowAction.js +9 -0
- package/dist/components/core/extension/solid-core/workflowDefinition/list/openWorkflowDefinitionEditorRowAction.js.map +1 -0
- package/dist/components/core/extension/solid-core/workflowDefinition/list/openWorkflowDefinitionEditorRowAction.ts +17 -0
- package/dist/components/core/form/SolidFormActionHeader.d.ts +1 -1
- package/dist/components/core/form/SolidFormActionHeader.d.ts.map +1 -1
- package/dist/components/core/form/SolidFormActionHeader.js +20 -11
- package/dist/components/core/form/SolidFormActionHeader.js.map +1 -1
- package/dist/components/core/form/SolidFormActionHeader.tsx +90 -30
- package/dist/components/core/form/SolidFormView.d.ts +1 -0
- package/dist/components/core/form/SolidFormView.d.ts.map +1 -1
- package/dist/components/core/form/SolidFormView.js +75 -25
- package/dist/components/core/form/SolidFormView.js.map +1 -1
- package/dist/components/core/form/SolidFormView.tsx +78 -11
- package/dist/components/core/form/fields/relations/SolidRelationManyToManyField.d.ts +1 -0
- package/dist/components/core/form/fields/relations/SolidRelationManyToManyField.d.ts.map +1 -1
- package/dist/components/core/form/fields/relations/SolidRelationManyToManyField.js +13 -9
- package/dist/components/core/form/fields/relations/SolidRelationManyToManyField.js.map +1 -1
- package/dist/components/core/form/fields/relations/SolidRelationManyToManyField.tsx +17 -6
- package/dist/components/core/form/fields/relations/SolidRelationManyToOneField.d.ts +1 -0
- package/dist/components/core/form/fields/relations/SolidRelationManyToOneField.d.ts.map +1 -1
- package/dist/components/core/form/fields/relations/SolidRelationManyToOneField.js +1 -0
- package/dist/components/core/form/fields/relations/SolidRelationManyToOneField.js.map +1 -1
- package/dist/components/core/form/fields/relations/SolidRelationManyToOneField.tsx +2 -0
- package/dist/components/core/form/fields/relations/SolidRelationOneToManyField.d.ts +1 -0
- package/dist/components/core/form/fields/relations/SolidRelationOneToManyField.d.ts.map +1 -1
- package/dist/components/core/form/fields/relations/SolidRelationOneToManyField.js +13 -13
- package/dist/components/core/form/fields/relations/SolidRelationOneToManyField.js.map +1 -1
- package/dist/components/core/form/fields/relations/SolidRelationOneToManyField.tsx +16 -11
- package/dist/components/core/form/fields/relations/widgets/helpers/InlineRelationEntityDialog.d.ts.map +1 -1
- package/dist/components/core/form/fields/relations/widgets/helpers/InlineRelationEntityDialog.js +2 -1
- package/dist/components/core/form/fields/relations/widgets/helpers/InlineRelationEntityDialog.js.map +1 -1
- package/dist/components/core/form/fields/relations/widgets/helpers/InlineRelationEntityDialog.tsx +2 -1
- package/dist/components/core/kanban/SolidKanbanView.d.ts.map +1 -1
- package/dist/components/core/kanban/SolidKanbanView.js +13 -7
- package/dist/components/core/kanban/SolidKanbanView.js.map +1 -1
- package/dist/components/core/kanban/SolidKanbanView.tsx +16 -15
- package/dist/components/core/kanban/SolidKanbanViewConfigure.d.ts.map +1 -1
- package/dist/components/core/kanban/SolidKanbanViewConfigure.js +1 -1
- package/dist/components/core/kanban/SolidKanbanViewConfigure.js.map +1 -1
- package/dist/components/core/kanban/SolidKanbanViewConfigure.tsx +3 -1
- package/dist/components/core/list/SolidCustomListColumn.d.ts +8 -0
- package/dist/components/core/list/SolidCustomListColumn.d.ts.map +1 -0
- package/dist/components/core/list/SolidCustomListColumn.js +47 -0
- package/dist/components/core/list/SolidCustomListColumn.js.map +1 -0
- package/dist/components/core/list/SolidCustomListColumn.tsx +57 -0
- package/dist/components/core/list/SolidCustomListViewColumn.d.ts +2 -1
- package/dist/components/core/list/SolidCustomListViewColumn.d.ts.map +1 -1
- package/dist/components/core/list/SolidCustomListViewColumn.js +3 -2
- package/dist/components/core/list/SolidCustomListViewColumn.js.map +1 -1
- package/dist/components/core/list/SolidCustomListViewColumn.tsx +4 -1
- package/dist/components/core/list/SolidListView.d.ts.map +1 -1
- package/dist/components/core/list/SolidListView.js +85 -83
- package/dist/components/core/list/SolidListView.js.map +1 -1
- package/dist/components/core/list/SolidListView.tsx +33 -40
- package/dist/components/core/list/SolidListViewColumn.d.ts +3 -1
- package/dist/components/core/list/SolidListViewColumn.d.ts.map +1 -1
- package/dist/components/core/list/SolidListViewColumn.js +81 -42
- package/dist/components/core/list/SolidListViewColumn.js.map +1 -1
- package/dist/components/core/list/SolidListViewColumn.tsx +93 -44
- package/dist/components/core/list/SolidListViewConfigure.d.ts.map +1 -1
- package/dist/components/core/list/SolidListViewConfigure.js +2 -2
- package/dist/components/core/list/SolidListViewConfigure.js.map +1 -1
- package/dist/components/core/list/SolidListViewConfigure.tsx +4 -2
- package/dist/components/core/list/SolidTableRowCell.js +1 -1
- package/dist/components/core/list/SolidTableRowCell.js.map +1 -1
- package/dist/components/core/list/SolidTableRowCell.tsx +1 -1
- package/dist/components/core/list/columns/SolidDateColumn.d.ts +1 -1
- package/dist/components/core/list/columns/SolidDateColumn.d.ts.map +1 -1
- package/dist/components/core/list/columns/SolidDateColumn.js +4 -5
- package/dist/components/core/list/columns/SolidDateColumn.js.map +1 -1
- package/dist/components/core/list/columns/SolidDateColumn.tsx +6 -3
- package/dist/components/core/list/columns/SolidDatetimeColumn.js +3 -3
- package/dist/components/core/list/columns/SolidDatetimeColumn.js.map +1 -1
- package/dist/components/core/list/columns/SolidDatetimeColumn.tsx +1 -2
- package/dist/components/core/list/columns/SolidIntColumn.js +3 -3
- package/dist/components/core/list/columns/SolidIntColumn.js.map +1 -1
- package/dist/components/core/list/columns/SolidIntColumn.tsx +1 -1
- package/dist/components/core/list/columns/SolidShortTextColumn.js +5 -5
- package/dist/components/core/list/columns/SolidShortTextColumn.js.map +1 -1
- package/dist/components/core/list/columns/SolidShortTextColumn.tsx +2 -2
- package/dist/components/core/list/widgets/PillWidget.d.ts +3 -0
- package/dist/components/core/list/widgets/PillWidget.d.ts.map +1 -0
- package/dist/components/core/list/widgets/PillWidget.js +95 -0
- package/dist/components/core/list/widgets/PillWidget.js.map +1 -0
- package/dist/components/core/list/widgets/PillWidget.tsx +127 -0
- package/dist/components/core/tree/SolidTreeView.d.ts.map +1 -1
- package/dist/components/core/tree/SolidTreeView.js +60 -50
- package/dist/components/core/tree/SolidTreeView.js.map +1 -1
- package/dist/components/core/tree/SolidTreeView.tsx +19 -22
- package/dist/components/shad-cn-ui/SolidCodeEditor.d.ts +2 -1
- package/dist/components/shad-cn-ui/SolidCodeEditor.d.ts.map +1 -1
- package/dist/components/shad-cn-ui/SolidCodeEditor.js +2 -2
- package/dist/components/shad-cn-ui/SolidCodeEditor.js.map +1 -1
- package/dist/components/shad-cn-ui/SolidCodeEditor.tsx +3 -0
- package/dist/components/shad-cn-ui/SolidDialog.js +1 -1
- package/dist/components/shad-cn-ui/SolidDialog.js.map +1 -1
- package/dist/components/shad-cn-ui/SolidDialog.tsx +1 -1
- package/dist/components/shad-cn-ui/SolidDropdownMenu.d.ts +3 -1
- package/dist/components/shad-cn-ui/SolidDropdownMenu.d.ts.map +1 -1
- package/dist/components/shad-cn-ui/SolidDropdownMenu.js +3 -3
- package/dist/components/shad-cn-ui/SolidDropdownMenu.js.map +1 -1
- package/dist/components/shad-cn-ui/SolidDropdownMenu.tsx +12 -6
- package/dist/components/shad-cn-ui/SolidIcon.d.ts +2 -1
- package/dist/components/shad-cn-ui/SolidIcon.d.ts.map +1 -1
- package/dist/components/shad-cn-ui/SolidIcon.js +2 -1
- package/dist/components/shad-cn-ui/SolidIcon.js.map +1 -1
- package/dist/components/shad-cn-ui/SolidIcon.tsx +2 -0
- package/dist/components/workflow/WorkflowFlowCanvas.css +470 -0
- package/dist/components/workflow/WorkflowFlowCanvas.d.ts +42 -0
- package/dist/components/workflow/WorkflowFlowCanvas.d.ts.map +1 -0
- package/dist/components/workflow/WorkflowFlowCanvas.js +923 -0
- package/dist/components/workflow/WorkflowFlowCanvas.js.map +1 -0
- package/dist/components/workflow/WorkflowFlowCanvas.tsx +1640 -0
- package/dist/components/workflow/WorkflowNodeDocsPanel.css +247 -0
- package/dist/components/workflow/WorkflowNodeDocsPanel.d.ts +22 -0
- package/dist/components/workflow/WorkflowNodeDocsPanel.d.ts.map +1 -0
- package/dist/components/workflow/WorkflowNodeDocsPanel.js +97 -0
- package/dist/components/workflow/WorkflowNodeDocsPanel.js.map +1 -0
- package/dist/components/workflow/WorkflowNodeDocsPanel.tsx +363 -0
- package/dist/components/workflow/WorkflowNodeSchemaEditor.css +999 -0
- package/dist/components/workflow/WorkflowNodeSchemaEditor.d.ts +74 -0
- package/dist/components/workflow/WorkflowNodeSchemaEditor.d.ts.map +1 -0
- package/dist/components/workflow/WorkflowNodeSchemaEditor.js +1745 -0
- package/dist/components/workflow/WorkflowNodeSchemaEditor.js.map +1 -0
- package/dist/components/workflow/WorkflowNodeSchemaEditor.tsx +3363 -0
- package/dist/helpers/modulePackageResumeState.d.ts +6 -0
- package/dist/helpers/modulePackageResumeState.d.ts.map +1 -0
- package/dist/helpers/modulePackageResumeState.js +46 -0
- package/dist/helpers/modulePackageResumeState.js.map +1 -0
- package/dist/helpers/modulePackageResumeState.ts +57 -0
- package/dist/helpers/registry.d.ts.map +1 -1
- package/dist/helpers/registry.js +3 -0
- package/dist/helpers/registry.js.map +1 -1
- package/dist/helpers/registry.ts +4 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/dist/index.ts +38 -0
- package/dist/redux/api/solidChatterMessageApi.d.ts +2 -1
- package/dist/redux/api/solidChatterMessageApi.d.ts.map +1 -1
- package/dist/redux/api/solidChatterMessageApi.js +6 -1
- package/dist/redux/api/solidChatterMessageApi.js.map +1 -1
- package/dist/redux/api/solidChatterMessageApi.ts +6 -1
- package/dist/redux/api/workflowDefinitionEditorApi.d.ts +17 -0
- package/dist/redux/api/workflowDefinitionEditorApi.d.ts.map +1 -0
- package/dist/redux/api/workflowDefinitionEditorApi.js +38 -0
- package/dist/redux/api/workflowDefinitionEditorApi.js.map +1 -0
- package/dist/redux/api/workflowDefinitionEditorApi.ts +40 -0
- package/dist/redux/api/workflowNodeApi.d.ts +6 -0
- package/dist/redux/api/workflowNodeApi.d.ts.map +1 -0
- package/dist/redux/api/workflowNodeApi.js +14 -0
- package/dist/redux/api/workflowNodeApi.js.map +1 -0
- package/dist/redux/api/workflowNodeApi.ts +18 -0
- package/dist/redux/features/popupSlice.d.ts +17 -2
- package/dist/redux/features/popupSlice.d.ts.map +1 -1
- package/dist/redux/features/popupSlice.js.map +1 -1
- package/dist/redux/features/popupSlice.ts +19 -3
- package/dist/redux/store/defaultStoreConfig.d.ts +14 -0
- package/dist/redux/store/defaultStoreConfig.d.ts.map +1 -1
- package/dist/redux/store/defaultStoreConfig.js +4 -0
- package/dist/redux/store/defaultStoreConfig.js.map +1 -1
- package/dist/redux/store/defaultStoreConfig.ts +4 -0
- package/dist/redux/store/solidEntityApiPool.d.ts.map +1 -1
- package/dist/redux/store/solidEntityApiPool.js +1 -0
- package/dist/redux/store/solidEntityApiPool.js.map +1 -1
- package/dist/redux/store/solidEntityApiPool.ts +1 -0
- package/dist/resources/shadcn-base.css +70 -16
- package/dist/resources/solid-custom.css +13 -14
- package/dist/resources/solid-tailwind-generated.css +1 -1
- package/dist/routes/pages/admin/core/WorkflowDefinitionEditorPage.css +3194 -0
- package/dist/routes/pages/admin/core/WorkflowDefinitionEditorPage.d.ts +3 -0
- package/dist/routes/pages/admin/core/WorkflowDefinitionEditorPage.d.ts.map +1 -0
- package/dist/routes/pages/admin/core/WorkflowDefinitionEditorPage.js +3428 -0
- package/dist/routes/pages/admin/core/WorkflowDefinitionEditorPage.js.map +1 -0
- package/dist/routes/pages/admin/core/WorkflowDefinitionEditorPage.tsx +6322 -0
- package/dist/routes/pages/admin/core/WorkflowDefinitionListPage.css +217 -0
- package/dist/routes/pages/admin/core/WorkflowDefinitionListPage.d.ts +3 -0
- package/dist/routes/pages/admin/core/WorkflowDefinitionListPage.d.ts.map +1 -0
- package/dist/routes/pages/admin/core/WorkflowDefinitionListPage.js +268 -0
- package/dist/routes/pages/admin/core/WorkflowDefinitionListPage.js.map +1 -0
- package/dist/routes/pages/admin/core/WorkflowDefinitionListPage.tsx +510 -0
- package/dist/routes/pages/admin/core/WorkflowExecutionDetailPage.d.ts +3 -0
- package/dist/routes/pages/admin/core/WorkflowExecutionDetailPage.d.ts.map +1 -0
- package/dist/routes/pages/admin/core/WorkflowExecutionDetailPage.js +618 -0
- package/dist/routes/pages/admin/core/WorkflowExecutionDetailPage.js.map +1 -0
- package/dist/routes/pages/admin/core/WorkflowExecutionDetailPage.tsx +1322 -0
- package/dist/routes/solidRoutes.d.ts.map +1 -1
- package/dist/routes/solidRoutes.js +4 -0
- package/dist/routes/solidRoutes.js.map +1 -1
- package/dist/routes/solidRoutes.tsx +4 -0
- package/dist/types/extension-registry.d.ts +4 -0
- package/dist/types/extension-registry.d.ts.map +1 -1
- package/dist/types/extension-registry.js +5 -1
- package/dist/types/extension-registry.js.map +1 -1
- package/dist/types/extension-registry.ts +5 -1
- package/dist/types/solid-core.d.ts +32 -0
- package/dist/types/workflow-node.d.ts +143 -0
- package/dist/types/workflow-node.d.ts.map +1 -0
- package/dist/types/workflow-node.js +2 -0
- package/dist/types/workflow-node.js.map +1 -0
- package/dist/types/workflow-node.ts +180 -0
- package/package.json +3 -1
- package/dist/components/auth/SolidOTPVerify.d.ts +0 -3
- package/dist/components/auth/SolidOTPVerify.d.ts.map +0 -1
- package/dist/components/auth/SolidOTPVerify.js +0 -67
- package/dist/components/auth/SolidOTPVerify.js.map +0 -1
- package/dist/components/auth/SolidOTPVerify.tsx +0 -133
- package/dist/components/common/AuthBanner.d.ts +0 -3
- package/dist/components/common/AuthBanner.d.ts.map +0 -1
- package/dist/components/common/AuthBanner.js +0 -15
- package/dist/components/common/AuthBanner.js.map +0 -1
- package/dist/components/common/AuthBanner.tsx +0 -41
- package/dist/components/common/SingleSelectAutoCompleteField.d.ts +0 -2
- package/dist/components/common/SingleSelectAutoCompleteField.d.ts.map +0 -1
- package/dist/components/common/SingleSelectAutoCompleteField.js +0 -92
- package/dist/components/common/SingleSelectAutoCompleteField.js.map +0 -1
- package/dist/components/common/SingleSelectAutoCompleteField.tsx +0 -73
- package/dist/components/common/SolidExportStepper.d.ts +0 -12
- package/dist/components/common/SolidExportStepper.d.ts.map +0 -1
- package/dist/components/common/SolidExportStepper.js +0 -30
- package/dist/components/common/SolidExportStepper.js.map +0 -1
- package/dist/components/common/SolidExportStepper.tsx +0 -135
- package/dist/components/core/common/LoadDynamicJsxComponent.d.ts +0 -2
- package/dist/components/core/common/LoadDynamicJsxComponent.d.ts.map +0 -1
- package/dist/components/core/common/LoadDynamicJsxComponent.js +0 -50
- package/dist/components/core/common/LoadDynamicJsxComponent.js.map +0 -1
- package/dist/components/core/common/LoadDynamicJsxComponent.tsx +0 -70
- package/dist/components/core/common/SolidGenericImport/SolidImportWrapper.d.ts +0 -2
- package/dist/components/core/common/SolidGenericImport/SolidImportWrapper.d.ts.map +0 -1
- package/dist/components/core/common/SolidGenericImport/SolidImportWrapper.js +0 -16
- package/dist/components/core/common/SolidGenericImport/SolidImportWrapper.js.map +0 -1
- package/dist/components/core/common/SolidGenericImport/SolidImportWrapper.tsx +0 -29
- package/dist/components/core/dashboard/DashboardFilter.d.ts +0 -13
- package/dist/components/core/dashboard/DashboardFilter.d.ts.map +0 -1
- package/dist/components/core/dashboard/DashboardFilter.js +0 -299
- package/dist/components/core/dashboard/DashboardFilter.js.map +0 -1
- package/dist/components/core/dashboard/DashboardFilter.tsx +0 -348
- package/dist/components/core/dashboard/PrimeDataTableWrapper.d.ts +0 -3
- package/dist/components/core/dashboard/PrimeDataTableWrapper.d.ts.map +0 -1
- package/dist/components/core/dashboard/PrimeDataTableWrapper.js +0 -21
- package/dist/components/core/dashboard/PrimeDataTableWrapper.js.map +0 -1
- package/dist/components/core/dashboard/PrimeDataTableWrapper.tsx +0 -40
- package/dist/components/core/dashboard/SolidDashboard.d.ts +0 -28
- package/dist/components/core/dashboard/SolidDashboard.d.ts.map +0 -1
- package/dist/components/core/dashboard/SolidDashboard.js +0 -183
- package/dist/components/core/dashboard/SolidDashboard.js.map +0 -1
- package/dist/components/core/dashboard/SolidDashboard.module.css +0 -83
- package/dist/components/core/dashboard/SolidDashboard.tsx +0 -263
- package/dist/components/core/dashboard/SolidDashboardBody.d.ts +0 -24
- package/dist/components/core/dashboard/SolidDashboardBody.d.ts.map +0 -1
- package/dist/components/core/dashboard/SolidDashboardBody.js +0 -162
- package/dist/components/core/dashboard/SolidDashboardBody.js.map +0 -1
- package/dist/components/core/dashboard/SolidDashboardBody.tsx +0 -168
- package/dist/components/core/dashboard/SolidDashboardFilterRequired.d.ts +0 -2
- package/dist/components/core/dashboard/SolidDashboardFilterRequired.d.ts.map +0 -1
- package/dist/components/core/dashboard/SolidDashboardFilterRequired.js +0 -11
- package/dist/components/core/dashboard/SolidDashboardFilterRequired.js.map +0 -1
- package/dist/components/core/dashboard/SolidDashboardFilterRequired.tsx +0 -28
- package/dist/components/core/dashboard/SolidDashboardHeader.d.ts +0 -3
- package/dist/components/core/dashboard/SolidDashboardHeader.d.ts.map +0 -1
- package/dist/components/core/dashboard/SolidDashboardHeader.js +0 -6
- package/dist/components/core/dashboard/SolidDashboardHeader.js.map +0 -1
- package/dist/components/core/dashboard/SolidDashboardHeader.tsx +0 -10
- package/dist/components/core/dashboard/SolidDashboardLoading.d.ts +0 -2
- package/dist/components/core/dashboard/SolidDashboardLoading.d.ts.map +0 -1
- package/dist/components/core/dashboard/SolidDashboardLoading.js +0 -10
- package/dist/components/core/dashboard/SolidDashboardLoading.js.map +0 -1
- package/dist/components/core/dashboard/SolidDashboardLoading.tsx +0 -61
- package/dist/components/core/dashboard/SolidDashboardNotAvailable.d.ts +0 -3
- package/dist/components/core/dashboard/SolidDashboardNotAvailable.d.ts.map +0 -1
- package/dist/components/core/dashboard/SolidDashboardNotAvailable.js +0 -12
- package/dist/components/core/dashboard/SolidDashboardNotAvailable.js.map +0 -1
- package/dist/components/core/dashboard/SolidDashboardNotAvailable.tsx +0 -32
- package/dist/components/core/dashboard/SolidDashboardRenderError.d.ts +0 -2
- package/dist/components/core/dashboard/SolidDashboardRenderError.d.ts.map +0 -1
- package/dist/components/core/dashboard/SolidDashboardRenderError.js +0 -11
- package/dist/components/core/dashboard/SolidDashboardRenderError.js.map +0 -1
- package/dist/components/core/dashboard/SolidDashboardRenderError.tsx +0 -28
- package/dist/components/core/dashboard/SolidDashboardVariable.d.ts +0 -19
- package/dist/components/core/dashboard/SolidDashboardVariable.d.ts.map +0 -1
- package/dist/components/core/dashboard/SolidDashboardVariable.js +0 -171
- package/dist/components/core/dashboard/SolidDashboardVariable.js.map +0 -1
- package/dist/components/core/dashboard/SolidDashboardVariable.tsx +0 -259
- package/dist/components/core/dashboard/SolidQuestionRenderer.d.ts +0 -9
- package/dist/components/core/dashboard/SolidQuestionRenderer.d.ts.map +0 -1
- package/dist/components/core/dashboard/SolidQuestionRenderer.js +0 -42
- package/dist/components/core/dashboard/SolidQuestionRenderer.js.map +0 -1
- package/dist/components/core/dashboard/SolidQuestionRenderer.tsx +0 -99
- package/dist/components/core/dashboard/chart-renderers/ChartJsRenderer.d.ts +0 -9
- package/dist/components/core/dashboard/chart-renderers/ChartJsRenderer.d.ts.map +0 -1
- package/dist/components/core/dashboard/chart-renderers/ChartJsRenderer.js +0 -35
- package/dist/components/core/dashboard/chart-renderers/ChartJsRenderer.js.map +0 -1
- package/dist/components/core/dashboard/chart-renderers/ChartJsRenderer.tsx +0 -48
- package/dist/components/core/dashboard/chart-renderers/PrimeReactDatatableRenderer.d.ts +0 -7
- package/dist/components/core/dashboard/chart-renderers/PrimeReactDatatableRenderer.d.ts.map +0 -1
- package/dist/components/core/dashboard/chart-renderers/PrimeReactDatatableRenderer.js +0 -22
- package/dist/components/core/dashboard/chart-renderers/PrimeReactDatatableRenderer.js.map +0 -1
- package/dist/components/core/dashboard/chart-renderers/PrimeReactDatatableRenderer.tsx +0 -51
- package/dist/components/core/dashboard/chart-renderers/init-chartjs.d.ts +0 -2
- package/dist/components/core/dashboard/chart-renderers/init-chartjs.d.ts.map +0 -1
- package/dist/components/core/dashboard/chart-renderers/init-chartjs.js +0 -4
- package/dist/components/core/dashboard/chart-renderers/init-chartjs.js.map +0 -1
- package/dist/components/core/dashboard/chart-renderers/init-chartjs.ts +0 -25
- package/dist/components/core/dashboard/dashboard-utils.d.ts +0 -2
- package/dist/components/core/dashboard/dashboard-utils.d.ts.map +0 -1
- package/dist/components/core/dashboard/dashboard-utils.js +0 -38
- package/dist/components/core/dashboard/dashboard-utils.js.map +0 -1
- package/dist/components/core/dashboard/dashboard-utils.ts +0 -39
- package/dist/components/core/extension/solid-core/dashboard/dashboardFormViewChangeHandler.d.ts +0 -10
- package/dist/components/core/extension/solid-core/dashboard/dashboardFormViewChangeHandler.d.ts.map +0 -1
- package/dist/components/core/extension/solid-core/dashboard/dashboardFormViewChangeHandler.js +0 -16
- package/dist/components/core/extension/solid-core/dashboard/dashboardFormViewChangeHandler.js.map +0 -1
- package/dist/components/core/extension/solid-core/dashboard/dashboardFormViewChangeHandler.ts +0 -19
- package/dist/components/core/extension/solid-core/dashboard/dashboardQuestionFieldChangeHandler.d.ts +0 -8
- package/dist/components/core/extension/solid-core/dashboard/dashboardQuestionFieldChangeHandler.d.ts.map +0 -1
- package/dist/components/core/extension/solid-core/dashboard/dashboardQuestionFieldChangeHandler.js +0 -64
- package/dist/components/core/extension/solid-core/dashboard/dashboardQuestionFieldChangeHandler.js.map +0 -1
- package/dist/components/core/extension/solid-core/dashboard/dashboardQuestionFieldChangeHandler.ts +0 -30
- package/dist/components/core/extension/solid-core/dashboard/dashboardQuestionOnFormLoadHandler.d.ts +0 -8
- package/dist/components/core/extension/solid-core/dashboard/dashboardQuestionOnFormLoadHandler.d.ts.map +0 -1
- package/dist/components/core/extension/solid-core/dashboard/dashboardQuestionOnFormLoadHandler.js +0 -62
- package/dist/components/core/extension/solid-core/dashboard/dashboardQuestionOnFormLoadHandler.js.map +0 -1
- package/dist/components/core/extension/solid-core/dashboard/dashboardQuestionOnFormLoadHandler.ts +0 -29
- package/dist/components/core/extension/solid-core/dashboardQuestion/ChartFormPreviewWidget.d.ts +0 -4
- package/dist/components/core/extension/solid-core/dashboardQuestion/ChartFormPreviewWidget.d.ts.map +0 -1
- package/dist/components/core/extension/solid-core/dashboardQuestion/ChartFormPreviewWidget.js +0 -23
- package/dist/components/core/extension/solid-core/dashboardQuestion/ChartFormPreviewWidget.js.map +0 -1
- package/dist/components/core/extension/solid-core/dashboardQuestion/ChartFormPreviewWidget.tsx +0 -36
- package/dist/components/core/form/fields/widgets/SolidChatterMessageCoModelEntityIdFormViewWidget.d.ts +0 -3
- package/dist/components/core/form/fields/widgets/SolidChatterMessageCoModelEntityIdFormViewWidget.d.ts.map +0 -1
- package/dist/components/core/form/fields/widgets/SolidChatterMessageCoModelEntityIdFormViewWidget.js +0 -92
- package/dist/components/core/form/fields/widgets/SolidChatterMessageCoModelEntityIdFormViewWidget.js.map +0 -1
- package/dist/components/core/form/fields/widgets/SolidChatterMessageCoModelEntityIdFormViewWidget.tsx +0 -68
- package/dist/components/core/form/fields/widgets/SolidLovTypeChangeFormEditWidget.d.ts +0 -3
- package/dist/components/core/form/fields/widgets/SolidLovTypeChangeFormEditWidget.d.ts.map +0 -1
- package/dist/components/core/form/fields/widgets/SolidLovTypeChangeFormEditWidget.js +0 -111
- package/dist/components/core/form/fields/widgets/SolidLovTypeChangeFormEditWidget.js.map +0 -1
- package/dist/components/core/form/fields/widgets/SolidLovTypeChangeFormEditWidget.tsx +0 -122
- package/dist/components/core/kanban/SolidKanbanViewFields.d.ts +0 -12
- package/dist/components/core/kanban/SolidKanbanViewFields.d.ts.map +0 -1
- package/dist/components/core/kanban/SolidKanbanViewFields.js +0 -145
- package/dist/components/core/kanban/SolidKanbanViewFields.js.map +0 -1
- package/dist/components/core/kanban/SolidKanbanViewFields.tsx +0 -164
- package/dist/components/core/kanban/SolidManyToOneFilterElement.d.ts +0 -2
- package/dist/components/core/kanban/SolidManyToOneFilterElement.d.ts.map +0 -1
- package/dist/components/core/kanban/SolidManyToOneFilterElement.js +0 -87
- package/dist/components/core/kanban/SolidManyToOneFilterElement.js.map +0 -1
- package/dist/components/core/kanban/SolidManyToOneFilterElement.tsx +0 -59
- package/dist/components/core/kanban/SolidSelectionDynamicFilterElement.d.ts +0 -2
- package/dist/components/core/kanban/SolidSelectionDynamicFilterElement.d.ts.map +0 -1
- package/dist/components/core/kanban/SolidSelectionDynamicFilterElement.js +0 -73
- package/dist/components/core/kanban/SolidSelectionDynamicFilterElement.js.map +0 -1
- package/dist/components/core/kanban/SolidSelectionDynamicFilterElement.tsx +0 -50
- package/dist/components/core/kanban/SolidSelectionStaticFilterElement.d.ts +0 -2
- package/dist/components/core/kanban/SolidSelectionStaticFilterElement.d.ts.map +0 -1
- package/dist/components/core/kanban/SolidSelectionStaticFilterElement.js +0 -20
- package/dist/components/core/kanban/SolidSelectionStaticFilterElement.js.map +0 -1
- package/dist/components/core/kanban/SolidSelectionStaticFilterElement.tsx +0 -32
- package/dist/components/core/kanban/SolidVarInputsFilterElement.d.ts +0 -12
- package/dist/components/core/kanban/SolidVarInputsFilterElement.d.ts.map +0 -1
- package/dist/components/core/kanban/SolidVarInputsFilterElement.js +0 -81
- package/dist/components/core/kanban/SolidVarInputsFilterElement.js.map +0 -1
- package/dist/components/core/kanban/SolidVarInputsFilterElement.tsx +0 -184
- package/dist/components/core/kanban/kanban-fields/SolidBigintKanbanField.d.ts +0 -4
- package/dist/components/core/kanban/kanban-fields/SolidBigintKanbanField.d.ts.map +0 -1
- package/dist/components/core/kanban/kanban-fields/SolidBigintKanbanField.js +0 -7
- package/dist/components/core/kanban/kanban-fields/SolidBigintKanbanField.js.map +0 -1
- package/dist/components/core/kanban/kanban-fields/SolidBigintKanbanField.tsx +0 -9
- package/dist/components/core/kanban/kanban-fields/SolidBooleanKanbanField.d.ts +0 -4
- package/dist/components/core/kanban/kanban-fields/SolidBooleanKanbanField.d.ts.map +0 -1
- package/dist/components/core/kanban/kanban-fields/SolidBooleanKanbanField.js +0 -8
- package/dist/components/core/kanban/kanban-fields/SolidBooleanKanbanField.js.map +0 -1
- package/dist/components/core/kanban/kanban-fields/SolidBooleanKanbanField.tsx +0 -16
- package/dist/components/core/kanban/kanban-fields/SolidComputedKanbanField.d.ts +0 -4
- package/dist/components/core/kanban/kanban-fields/SolidComputedKanbanField.d.ts.map +0 -1
- package/dist/components/core/kanban/kanban-fields/SolidComputedKanbanField.js +0 -21
- package/dist/components/core/kanban/kanban-fields/SolidComputedKanbanField.js.map +0 -1
- package/dist/components/core/kanban/kanban-fields/SolidComputedKanbanField.tsx +0 -23
- package/dist/components/core/kanban/kanban-fields/SolidDateKanbanField.d.ts +0 -4
- package/dist/components/core/kanban/kanban-fields/SolidDateKanbanField.d.ts.map +0 -1
- package/dist/components/core/kanban/kanban-fields/SolidDateKanbanField.js +0 -8
- package/dist/components/core/kanban/kanban-fields/SolidDateKanbanField.js.map +0 -1
- package/dist/components/core/kanban/kanban-fields/SolidDateKanbanField.tsx +0 -14
- package/dist/components/core/kanban/kanban-fields/SolidDatetimeKanbanField.d.ts +0 -4
- package/dist/components/core/kanban/kanban-fields/SolidDatetimeKanbanField.d.ts.map +0 -1
- package/dist/components/core/kanban/kanban-fields/SolidDatetimeKanbanField.js +0 -8
- package/dist/components/core/kanban/kanban-fields/SolidDatetimeKanbanField.js.map +0 -1
- package/dist/components/core/kanban/kanban-fields/SolidDatetimeKanbanField.tsx +0 -13
- package/dist/components/core/kanban/kanban-fields/SolidDecimalKanbanField.d.ts +0 -4
- package/dist/components/core/kanban/kanban-fields/SolidDecimalKanbanField.d.ts.map +0 -1
- package/dist/components/core/kanban/kanban-fields/SolidDecimalKanbanField.js +0 -7
- package/dist/components/core/kanban/kanban-fields/SolidDecimalKanbanField.js.map +0 -1
- package/dist/components/core/kanban/kanban-fields/SolidDecimalKanbanField.tsx +0 -9
- package/dist/components/core/kanban/kanban-fields/SolidExternalIdKanbanField.d.ts +0 -4
- package/dist/components/core/kanban/kanban-fields/SolidExternalIdKanbanField.d.ts.map +0 -1
- package/dist/components/core/kanban/kanban-fields/SolidExternalIdKanbanField.js +0 -8
- package/dist/components/core/kanban/kanban-fields/SolidExternalIdKanbanField.js.map +0 -1
- package/dist/components/core/kanban/kanban-fields/SolidExternalIdKanbanField.tsx +0 -12
- package/dist/components/core/kanban/kanban-fields/SolidFloatKanbanField.d.ts +0 -4
- package/dist/components/core/kanban/kanban-fields/SolidFloatKanbanField.d.ts.map +0 -1
- package/dist/components/core/kanban/kanban-fields/SolidFloatKanbanField.js +0 -7
- package/dist/components/core/kanban/kanban-fields/SolidFloatKanbanField.js.map +0 -1
- package/dist/components/core/kanban/kanban-fields/SolidFloatKanbanField.tsx +0 -9
- package/dist/components/core/kanban/kanban-fields/SolidIdKanbanField.d.ts +0 -4
- package/dist/components/core/kanban/kanban-fields/SolidIdKanbanField.d.ts.map +0 -1
- package/dist/components/core/kanban/kanban-fields/SolidIdKanbanField.js +0 -8
- package/dist/components/core/kanban/kanban-fields/SolidIdKanbanField.js.map +0 -1
- package/dist/components/core/kanban/kanban-fields/SolidIdKanbanField.tsx +0 -14
- package/dist/components/core/kanban/kanban-fields/SolidIntKanbanField.d.ts +0 -4
- package/dist/components/core/kanban/kanban-fields/SolidIntKanbanField.d.ts.map +0 -1
- package/dist/components/core/kanban/kanban-fields/SolidIntKanbanField.js +0 -16
- package/dist/components/core/kanban/kanban-fields/SolidIntKanbanField.js.map +0 -1
- package/dist/components/core/kanban/kanban-fields/SolidIntKanbanField.tsx +0 -20
- package/dist/components/core/kanban/kanban-fields/SolidLongTextKanbanField.d.ts +0 -4
- package/dist/components/core/kanban/kanban-fields/SolidLongTextKanbanField.d.ts.map +0 -1
- package/dist/components/core/kanban/kanban-fields/SolidLongTextKanbanField.js +0 -7
- package/dist/components/core/kanban/kanban-fields/SolidLongTextKanbanField.js.map +0 -1
- package/dist/components/core/kanban/kanban-fields/SolidLongTextKanbanField.tsx +0 -9
- package/dist/components/core/kanban/kanban-fields/SolidMediaMultipleKanbanField.d.ts +0 -4
- package/dist/components/core/kanban/kanban-fields/SolidMediaMultipleKanbanField.d.ts.map +0 -1
- package/dist/components/core/kanban/kanban-fields/SolidMediaMultipleKanbanField.js +0 -56
- package/dist/components/core/kanban/kanban-fields/SolidMediaMultipleKanbanField.js.map +0 -1
- package/dist/components/core/kanban/kanban-fields/SolidMediaMultipleKanbanField.tsx +0 -140
- package/dist/components/core/kanban/kanban-fields/SolidMediaSingleKanbanField.d.ts +0 -4
- package/dist/components/core/kanban/kanban-fields/SolidMediaSingleKanbanField.d.ts.map +0 -1
- package/dist/components/core/kanban/kanban-fields/SolidMediaSingleKanbanField.js +0 -42
- package/dist/components/core/kanban/kanban-fields/SolidMediaSingleKanbanField.js.map +0 -1
- package/dist/components/core/kanban/kanban-fields/SolidMediaSingleKanbanField.tsx +0 -164
- package/dist/components/core/kanban/kanban-fields/SolidRelationKanbanField.d.ts +0 -4
- package/dist/components/core/kanban/kanban-fields/SolidRelationKanbanField.d.ts.map +0 -1
- package/dist/components/core/kanban/kanban-fields/SolidRelationKanbanField.js +0 -11
- package/dist/components/core/kanban/kanban-fields/SolidRelationKanbanField.js.map +0 -1
- package/dist/components/core/kanban/kanban-fields/SolidRelationKanbanField.tsx +0 -13
- package/dist/components/core/kanban/kanban-fields/SolidRichTextKanbanField.d.ts +0 -4
- package/dist/components/core/kanban/kanban-fields/SolidRichTextKanbanField.d.ts.map +0 -1
- package/dist/components/core/kanban/kanban-fields/SolidRichTextKanbanField.js +0 -7
- package/dist/components/core/kanban/kanban-fields/SolidRichTextKanbanField.js.map +0 -1
- package/dist/components/core/kanban/kanban-fields/SolidRichTextKanbanField.tsx +0 -9
- package/dist/components/core/kanban/kanban-fields/SolidSelectionDynamicKanbanField.d.ts +0 -4
- package/dist/components/core/kanban/kanban-fields/SolidSelectionDynamicKanbanField.d.ts.map +0 -1
- package/dist/components/core/kanban/kanban-fields/SolidSelectionDynamicKanbanField.js +0 -8
- package/dist/components/core/kanban/kanban-fields/SolidSelectionDynamicKanbanField.js.map +0 -1
- package/dist/components/core/kanban/kanban-fields/SolidSelectionDynamicKanbanField.tsx +0 -14
- package/dist/components/core/kanban/kanban-fields/SolidSelectionStaticKanbanField.d.ts +0 -4
- package/dist/components/core/kanban/kanban-fields/SolidSelectionStaticKanbanField.d.ts.map +0 -1
- package/dist/components/core/kanban/kanban-fields/SolidSelectionStaticKanbanField.js +0 -8
- package/dist/components/core/kanban/kanban-fields/SolidSelectionStaticKanbanField.js.map +0 -1
- package/dist/components/core/kanban/kanban-fields/SolidSelectionStaticKanbanField.tsx +0 -14
- package/dist/components/core/kanban/kanban-fields/SolidShortTextKanbanField.d.ts +0 -4
- package/dist/components/core/kanban/kanban-fields/SolidShortTextKanbanField.d.ts.map +0 -1
- package/dist/components/core/kanban/kanban-fields/SolidShortTextKanbanField.js +0 -37
- package/dist/components/core/kanban/kanban-fields/SolidShortTextKanbanField.js.map +0 -1
- package/dist/components/core/kanban/kanban-fields/SolidShortTextKanbanField.tsx +0 -121
- package/dist/components/core/kanban/kanban-fields/SolidTimeKanbanField.d.ts +0 -4
- package/dist/components/core/kanban/kanban-fields/SolidTimeKanbanField.d.ts.map +0 -1
- package/dist/components/core/kanban/kanban-fields/SolidTimeKanbanField.js +0 -8
- package/dist/components/core/kanban/kanban-fields/SolidTimeKanbanField.js.map +0 -1
- package/dist/components/core/kanban/kanban-fields/SolidTimeKanbanField.tsx +0 -12
- package/dist/components/core/kanban/kanban-fields/SolidUuidKanbanField.d.ts +0 -4
- package/dist/components/core/kanban/kanban-fields/SolidUuidKanbanField.d.ts.map +0 -1
- package/dist/components/core/kanban/kanban-fields/SolidUuidKanbanField.js +0 -8
- package/dist/components/core/kanban/kanban-fields/SolidUuidKanbanField.js.map +0 -1
- package/dist/components/core/kanban/kanban-fields/SolidUuidKanbanField.tsx +0 -13
- package/dist/components/core/kanban/kanban-fields/relations/SolidRelationManyToOneKanbanField.d.ts +0 -4
- package/dist/components/core/kanban/kanban-fields/relations/SolidRelationManyToOneKanbanField.d.ts.map +0 -1
- package/dist/components/core/kanban/kanban-fields/relations/SolidRelationManyToOneKanbanField.js +0 -7
- package/dist/components/core/kanban/kanban-fields/relations/SolidRelationManyToOneKanbanField.js.map +0 -1
- package/dist/components/core/kanban/kanban-fields/relations/SolidRelationManyToOneKanbanField.tsx +0 -16
- package/dist/components/core/list/SolidListViewRowButtonContextMenu.d.ts +0 -2
- package/dist/components/core/list/SolidListViewRowButtonContextMenu.d.ts.map +0 -1
- package/dist/components/core/list/SolidListViewRowButtonContextMenu.js +0 -39
- package/dist/components/core/list/SolidListViewRowButtonContextMenu.js.map +0 -1
- package/dist/components/core/list/SolidListViewRowButtonContextMenu.tsx +0 -40
- package/dist/components/core/list/SolidVarInputsFilterElement.d.ts +0 -12
- package/dist/components/core/list/SolidVarInputsFilterElement.d.ts.map +0 -1
- package/dist/components/core/list/SolidVarInputsFilterElement.js +0 -81
- package/dist/components/core/list/SolidVarInputsFilterElement.js.map +0 -1
- package/dist/components/core/list/SolidVarInputsFilterElement.tsx +0 -184
- package/dist/components/core/list/widgets/SolidChatterMessageCoModelEntityIdListViewWidget.d.ts +0 -3
- package/dist/components/core/list/widgets/SolidChatterMessageCoModelEntityIdListViewWidget.d.ts.map +0 -1
- package/dist/components/core/list/widgets/SolidChatterMessageCoModelEntityIdListViewWidget.js +0 -87
- package/dist/components/core/list/widgets/SolidChatterMessageCoModelEntityIdListViewWidget.js.map +0 -1
- package/dist/components/core/list/widgets/SolidChatterMessageCoModelEntityIdListViewWidget.tsx +0 -70
- package/dist/components/core/list/widgets/SolidMqMessageStageListViewWidget.d.ts +0 -3
- package/dist/components/core/list/widgets/SolidMqMessageStageListViewWidget.d.ts.map +0 -1
- package/dist/components/core/list/widgets/SolidMqMessageStageListViewWidget.js +0 -33
- package/dist/components/core/list/widgets/SolidMqMessageStageListViewWidget.js.map +0 -1
- package/dist/components/core/list/widgets/SolidMqMessageStageListViewWidget.tsx +0 -50
- package/dist/components/core/list/widgets/SolidSummarizeListHeaderActionMqMessages.d.ts +0 -3
- package/dist/components/core/list/widgets/SolidSummarizeListHeaderActionMqMessages.d.ts.map +0 -1
- package/dist/components/core/list/widgets/SolidSummarizeListHeaderActionMqMessages.js +0 -158
- package/dist/components/core/list/widgets/SolidSummarizeListHeaderActionMqMessages.js.map +0 -1
- package/dist/components/core/list/widgets/SolidSummarizeListHeaderActionMqMessages.tsx +0 -185
- package/dist/components/layout/DashboardHeader.d.ts +0 -3
- package/dist/components/layout/DashboardHeader.d.ts.map +0 -1
- package/dist/components/layout/DashboardHeader.js +0 -20
- package/dist/components/layout/DashboardHeader.js.map +0 -1
- package/dist/components/layout/DashboardHeader.tsx +0 -94
- package/dist/helpers/# no such endpoints exist, need to calle +0 -3
- package/dist/helpers/ToastContainer.d.ts +0 -4
- package/dist/helpers/ToastContainer.d.ts.map +0 -1
- package/dist/helpers/ToastContainer.js +0 -49
- package/dist/helpers/ToastContainer.js.map +0 -1
- package/dist/helpers/ToastContainer.tsx +0 -94
- package/dist/helpers/showToast.d.ts +0 -5
- package/dist/helpers/showToast.d.ts.map +0 -1
- package/dist/helpers/showToast.js +0 -17
- package/dist/helpers/showToast.js.map +0 -1
- package/dist/helpers/showToast.ts +0 -13
- package/dist/helpers/studioSandbox.d.ts +0 -31
- package/dist/helpers/studioSandbox.d.ts.map +0 -1
- package/dist/helpers/studioSandbox.js +0 -104
- package/dist/helpers/studioSandbox.js.map +0 -1
- package/dist/helpers/studioSandbox.ts +0 -117
- package/dist/nextAuth/authProviders.d.ts +0 -4
- package/dist/nextAuth/authProviders.d.ts.map +0 -1
- package/dist/nextAuth/authProviders.js +0 -198
- package/dist/nextAuth/authProviders.js.map +0 -1
- package/dist/nextAuth/authProviders.tsx +0 -232
- package/dist/nextAuth/handleLogout.d.ts +0 -2
- package/dist/nextAuth/handleLogout.d.ts.map +0 -1
- package/dist/nextAuth/handleLogout.js +0 -36
- package/dist/nextAuth/handleLogout.js.map +0 -1
- package/dist/nextAuth/handleLogout.tsx +0 -39
- package/dist/nextAuth/refreshAccessToken.d.ts +0 -2
- package/dist/nextAuth/refreshAccessToken.d.ts.map +0 -1
- package/dist/nextAuth/refreshAccessToken.js +0 -24
- package/dist/nextAuth/refreshAccessToken.js.map +0 -1
- package/dist/nextAuth/refreshAccessToken.tsx +0 -28
- package/dist/redux/api/dashboardApi.d.ts +0 -23
- package/dist/redux/api/dashboardApi.d.ts.map +0 -1
- package/dist/redux/api/dashboardApi.js +0 -35
- package/dist/redux/api/dashboardApi.js.map +0 -1
- package/dist/redux/api/dashboardApi.ts +0 -56
- package/dist/redux/api/dashboardLayoutApi.d.ts +0 -24
- package/dist/redux/api/dashboardLayoutApi.d.ts.map +0 -1
- package/dist/redux/api/dashboardLayoutApi.js +0 -34
- package/dist/redux/api/dashboardLayoutApi.js.map +0 -1
- package/dist/redux/api/dashboardLayoutApi.ts +0 -55
- package/dist/redux/api/dashboardQuestionApi.d.ts +0 -5
- package/dist/redux/api/dashboardQuestionApi.d.ts.map +0 -1
- package/dist/redux/api/dashboardQuestionApi.js +0 -18
- package/dist/redux/api/dashboardQuestionApi.js.map +0 -1
- package/dist/redux/api/dashboardQuestionApi.ts +0 -17
- package/dist/redux/features/settingsSlice.d.ts +0 -20
- package/dist/redux/features/settingsSlice.d.ts.map +0 -1
- package/dist/redux/features/settingsSlice.js +0 -39
- package/dist/redux/features/settingsSlice.js.map +0 -1
- package/dist/redux/features/settingsSlice.ts +0 -60
- package/dist/resources/images/Footerbg.png +0 -0
- package/dist/resources/images/LoginBanner.png +0 -0
- package/dist/resources/images/dashboard/Ellipse 1.svg +0 -10
- package/dist/resources/images/dashboard/Rectangle 17.svg +0 -10
- package/dist/resources/images/dashboard/Rectangle 25.svg +0 -11
- package/dist/resources/images/dashboard/image 5.svg +0 -9
- package/dist/resources/images/loginhero.png +0 -0
- package/dist/resources/images/logo.png +0 -0
- package/dist/resources/images/radix-logo-white.png +0 -0
- package/dist/resources/images/radix-logo.png +0 -0
- package/dist/resources/images/signupBanner.png +0 -0
|
@@ -0,0 +1,1745 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
13
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
14
|
+
if (ar || !(i in from)) {
|
|
15
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
16
|
+
ar[i] = from[i];
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
20
|
+
};
|
|
21
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
22
|
+
import React from "react";
|
|
23
|
+
import { createPortal } from "react-dom";
|
|
24
|
+
import YAML from "yaml";
|
|
25
|
+
import { ArrowLeft, CircleHelp, Filter, GitBranch, Plus, Search, Trash2, Workflow, X, Zap, } from "lucide-react";
|
|
26
|
+
import { getExtensionComponent } from "../../helpers/registry";
|
|
27
|
+
import { WorkflowNodeDocsPanel } from "./WorkflowNodeDocsPanel";
|
|
28
|
+
import { SolidButton, SolidCodeEditor, SolidDialog, SolidDialogBody, SolidDialogFooter, SolidInput, SolidNumberInput, SolidSelect, SolidSwitch, SolidTabGroup, SolidTag, SolidTextarea, SolidTooltip, SolidTooltipContent, SolidTooltipTrigger, SolidIcon, normalizeSolidIconName, } from "../shad-cn-ui";
|
|
29
|
+
import "./WorkflowNodeSchemaEditor.css";
|
|
30
|
+
var EMPTY_YAML_OBJECT = {};
|
|
31
|
+
var EMPTY_YAML_ARRAY = [];
|
|
32
|
+
function normalizeFieldValue(field, currentValue) {
|
|
33
|
+
if (currentValue !== undefined) {
|
|
34
|
+
return currentValue;
|
|
35
|
+
}
|
|
36
|
+
return field.defaultValue;
|
|
37
|
+
}
|
|
38
|
+
function stringifyYamlEditorValue(value, emptyValue) {
|
|
39
|
+
if (typeof value === "string") {
|
|
40
|
+
return value;
|
|
41
|
+
}
|
|
42
|
+
return YAML.stringify(value !== null && value !== void 0 ? value : emptyValue);
|
|
43
|
+
}
|
|
44
|
+
function stringifyJsonEditorValue(value, emptyValue) {
|
|
45
|
+
if (typeof value === "string") {
|
|
46
|
+
return value;
|
|
47
|
+
}
|
|
48
|
+
return JSON.stringify(value !== null && value !== void 0 ? value : emptyValue, null, 2);
|
|
49
|
+
}
|
|
50
|
+
function getYamlValueSignature(value) {
|
|
51
|
+
try {
|
|
52
|
+
return JSON.stringify(value);
|
|
53
|
+
}
|
|
54
|
+
catch (_a) {
|
|
55
|
+
return String(value);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
function getPathValue(value, pathOrKey) {
|
|
59
|
+
return pathOrKey
|
|
60
|
+
.split(".")
|
|
61
|
+
.reduce(function (current, part) { return current === null || current === void 0 ? void 0 : current[part]; }, value);
|
|
62
|
+
}
|
|
63
|
+
function setPathValue(value, pathOrKey, nextValue) {
|
|
64
|
+
var _a;
|
|
65
|
+
var parts = pathOrKey.split(".");
|
|
66
|
+
if (parts.length === 1) {
|
|
67
|
+
return __assign(__assign({}, value), (_a = {}, _a[pathOrKey] = nextValue, _a));
|
|
68
|
+
}
|
|
69
|
+
var nextRoot = __assign({}, value);
|
|
70
|
+
var cursor = nextRoot;
|
|
71
|
+
parts.forEach(function (part, index) {
|
|
72
|
+
if (index === parts.length - 1) {
|
|
73
|
+
cursor[part] = nextValue;
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
var existing = cursor[part];
|
|
77
|
+
cursor[part] =
|
|
78
|
+
existing && typeof existing === "object" && !Array.isArray(existing)
|
|
79
|
+
? __assign({}, existing) : {};
|
|
80
|
+
cursor = cursor[part];
|
|
81
|
+
});
|
|
82
|
+
return nextRoot;
|
|
83
|
+
}
|
|
84
|
+
function getSlotCount(node, slot) {
|
|
85
|
+
var _a;
|
|
86
|
+
if (slot.kind === "case-collection") {
|
|
87
|
+
return Object.keys((_a = node.cases) !== null && _a !== void 0 ? _a : {}).length;
|
|
88
|
+
}
|
|
89
|
+
var value = node[slot.key];
|
|
90
|
+
return Array.isArray(value) ? value.length : 0;
|
|
91
|
+
}
|
|
92
|
+
function hasRuntimeFields(nodeType) {
|
|
93
|
+
var authoring = nodeType.authoring;
|
|
94
|
+
return Boolean((authoring === null || authoring === void 0 ? void 0 : authoring.supportsDisableToggle) ||
|
|
95
|
+
(authoring === null || authoring === void 0 ? void 0 : authoring.supportsTimeoutMs) ||
|
|
96
|
+
(authoring === null || authoring === void 0 ? void 0 : authoring.supportsOnError) ||
|
|
97
|
+
(authoring === null || authoring === void 0 ? void 0 : authoring.supportsRetryPolicy));
|
|
98
|
+
}
|
|
99
|
+
function getNodeTypeIconName(nodeType) {
|
|
100
|
+
var _a, _b;
|
|
101
|
+
return (_b = (_a = nodeType.ui) === null || _a === void 0 ? void 0 : _a.icon) !== null && _b !== void 0 ? _b : nodeType.icon;
|
|
102
|
+
}
|
|
103
|
+
function WorkflowNodeTypeIcon(_a) {
|
|
104
|
+
var nodeType = _a.nodeType, _b = _a.size, size = _b === void 0 ? 18 : _b;
|
|
105
|
+
var iconName = getNodeTypeIconName(nodeType);
|
|
106
|
+
var normalizedIconName = normalizeSolidIconName(iconName);
|
|
107
|
+
if (normalizedIconName) {
|
|
108
|
+
return _jsx(SolidIcon, { name: normalizedIconName, size: size, "aria-hidden": true });
|
|
109
|
+
}
|
|
110
|
+
if (nodeType.kind === "control") {
|
|
111
|
+
return _jsx(GitBranch, { size: size, strokeWidth: 1.9 });
|
|
112
|
+
}
|
|
113
|
+
if (nodeType.kind === "subflow") {
|
|
114
|
+
return _jsx(Workflow, { size: size, strokeWidth: 1.9 });
|
|
115
|
+
}
|
|
116
|
+
return _jsx(Zap, { size: size, strokeWidth: 1.9 });
|
|
117
|
+
}
|
|
118
|
+
function getWorkflowNodeIconStyle(nodeType) {
|
|
119
|
+
var _a, _b, _c;
|
|
120
|
+
var backgroundColor = (_a = nodeType.ui) === null || _a === void 0 ? void 0 : _a.iconBackgroundColor;
|
|
121
|
+
var color = (_b = nodeType.ui) === null || _b === void 0 ? void 0 : _b.iconColor;
|
|
122
|
+
var borderColor = (_c = nodeType.ui) === null || _c === void 0 ? void 0 : _c.iconBorderColor;
|
|
123
|
+
if (!backgroundColor && !color && !borderColor) {
|
|
124
|
+
return undefined;
|
|
125
|
+
}
|
|
126
|
+
return __assign(__assign(__assign({}, (backgroundColor ? { backgroundColor: backgroundColor } : null)), (color ? { color: color } : null)), (borderColor ? { borderColor: borderColor } : null));
|
|
127
|
+
}
|
|
128
|
+
function normalizeGroupLabel(value, fallback) {
|
|
129
|
+
var trimmed = value === null || value === void 0 ? void 0 : value.trim();
|
|
130
|
+
return trimmed || fallback;
|
|
131
|
+
}
|
|
132
|
+
function getNodeTypeSearchText(nodeType) {
|
|
133
|
+
var _a, _b, _c;
|
|
134
|
+
return __spreadArray(__spreadArray([
|
|
135
|
+
nodeType.type,
|
|
136
|
+
nodeType.kind,
|
|
137
|
+
nodeType.label,
|
|
138
|
+
nodeType.description,
|
|
139
|
+
nodeType.category,
|
|
140
|
+
nodeType.subcategory
|
|
141
|
+
], ((_a = nodeType.tags) !== null && _a !== void 0 ? _a : []), true), ((_c = (_b = nodeType.authoring) === null || _b === void 0 ? void 0 : _b.searchableText) !== null && _c !== void 0 ? _c : []), true).filter(Boolean)
|
|
142
|
+
.join(" ")
|
|
143
|
+
.toLowerCase();
|
|
144
|
+
}
|
|
145
|
+
function createSelectOptions(values, allLabel) {
|
|
146
|
+
return __spreadArray([
|
|
147
|
+
{ label: allLabel, value: "" }
|
|
148
|
+
], values
|
|
149
|
+
.filter(Boolean)
|
|
150
|
+
.sort(function (a, b) { return a.localeCompare(b); })
|
|
151
|
+
.map(function (value) { return ({ label: value, value: value }); }), true);
|
|
152
|
+
}
|
|
153
|
+
function isConfigurationFieldVisible(field, draft) {
|
|
154
|
+
var _a, _b;
|
|
155
|
+
var visibleWhen = (_a = field.uiSchema) === null || _a === void 0 ? void 0 : _a.visibleWhen;
|
|
156
|
+
if (!visibleWhen) {
|
|
157
|
+
return true;
|
|
158
|
+
}
|
|
159
|
+
var dependencyPath = (_b = visibleWhen.path) !== null && _b !== void 0 ? _b : visibleWhen.field;
|
|
160
|
+
if (!dependencyPath) {
|
|
161
|
+
return true;
|
|
162
|
+
}
|
|
163
|
+
var dependencyValue = getPathValue(draft, dependencyPath);
|
|
164
|
+
if ("equals" in visibleWhen) {
|
|
165
|
+
return dependencyValue === visibleWhen.equals;
|
|
166
|
+
}
|
|
167
|
+
if ("notEquals" in visibleWhen) {
|
|
168
|
+
return dependencyValue !== visibleWhen.notEquals;
|
|
169
|
+
}
|
|
170
|
+
if (Array.isArray(visibleWhen.includes)) {
|
|
171
|
+
return visibleWhen.includes.includes(dependencyValue);
|
|
172
|
+
}
|
|
173
|
+
return true;
|
|
174
|
+
}
|
|
175
|
+
function getConfigurationFieldWidth(field) {
|
|
176
|
+
var _a, _b;
|
|
177
|
+
var width = (_b = (_a = field.uiSchema) === null || _a === void 0 ? void 0 : _a.layout) === null || _b === void 0 ? void 0 : _b.width;
|
|
178
|
+
return width === "full" || width === "field" ? width : "half";
|
|
179
|
+
}
|
|
180
|
+
function normalizeCssLength(value) {
|
|
181
|
+
if (typeof value === "number" && Number.isFinite(value)) {
|
|
182
|
+
return "".concat(value, "px");
|
|
183
|
+
}
|
|
184
|
+
if (typeof value === "string" && value.trim()) {
|
|
185
|
+
return value;
|
|
186
|
+
}
|
|
187
|
+
return undefined;
|
|
188
|
+
}
|
|
189
|
+
function getConfigurationFieldEditorHeight(field, fallback) {
|
|
190
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
191
|
+
if (fallback === void 0) { fallback = "220px"; }
|
|
192
|
+
return ((_j = (_f = (_c = normalizeCssLength((_b = (_a = field.uiSchema) === null || _a === void 0 ? void 0 : _a.editor) === null || _b === void 0 ? void 0 : _b.height)) !== null && _c !== void 0 ? _c : normalizeCssLength((_e = (_d = field.uiSchema) === null || _d === void 0 ? void 0 : _d.layout) === null || _e === void 0 ? void 0 : _e.height)) !== null && _f !== void 0 ? _f : normalizeCssLength((_h = (_g = field.uiSchema) === null || _g === void 0 ? void 0 : _g.layout) === null || _h === void 0 ? void 0 : _h.minHeight)) !== null && _j !== void 0 ? _j : fallback);
|
|
193
|
+
}
|
|
194
|
+
function getWorkflowNodeEditorDialogStyle(nodeType) {
|
|
195
|
+
var _a, _b;
|
|
196
|
+
var modalSize = (_b = (_a = nodeType.ui) === null || _a === void 0 ? void 0 : _a.modalSize) !== null && _b !== void 0 ? _b : "lg";
|
|
197
|
+
if (modalSize === "full") {
|
|
198
|
+
return {
|
|
199
|
+
width: "96vw",
|
|
200
|
+
maxWidth: "96vw",
|
|
201
|
+
height: "92vh",
|
|
202
|
+
maxHeight: "92vh",
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
if (modalSize === "xl") {
|
|
206
|
+
return {
|
|
207
|
+
width: "min(1240px, 94vw)",
|
|
208
|
+
maxWidth: "94vw",
|
|
209
|
+
height: "min(880px, 90vh)",
|
|
210
|
+
maxHeight: "90vh",
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
return {
|
|
214
|
+
width: "min(780px, 92vw)",
|
|
215
|
+
maxWidth: "92vw",
|
|
216
|
+
maxHeight: "90vh",
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
function getFieldHintItems(field) {
|
|
220
|
+
return [
|
|
221
|
+
field.valueType ? { key: "valueType", label: field.valueType } : null,
|
|
222
|
+
field.required ? { key: "required", label: "required", tone: "warn" } : null,
|
|
223
|
+
field.expressionAllowed ? { key: "expressions", label: "expressions" } : null,
|
|
224
|
+
field.secretAllowed ? { key: "secret", label: "secret", tone: "success" } : null,
|
|
225
|
+
].filter(Boolean);
|
|
226
|
+
}
|
|
227
|
+
function WorkflowFieldHelp(_a) {
|
|
228
|
+
var _b;
|
|
229
|
+
var field = _a.field;
|
|
230
|
+
var hintItems = getFieldHintItems(field);
|
|
231
|
+
if (!field.description && !hintItems.length) {
|
|
232
|
+
return null;
|
|
233
|
+
}
|
|
234
|
+
return (_jsxs(SolidTooltip, { delayDuration: 120, children: [_jsx(SolidTooltipTrigger, { asChild: true, children: _jsx("button", { type: "button", className: "workflow-node-editor-help-trigger", "aria-label": "".concat((_b = field.label) !== null && _b !== void 0 ? _b : field.key, " help"), children: _jsx(CircleHelp, { size: 13 }) }) }), _jsxs(SolidTooltipContent, { side: "top", align: "end", className: "workflow-node-editor-help-tooltip", children: [field.description ? (_jsxs("div", { className: "workflow-node-editor-help-section", children: [_jsx("div", { className: "workflow-node-editor-help-title", children: "Help" }), _jsx("div", { className: "workflow-node-editor-help-copy", children: field.description })] })) : null, hintItems.length ? (_jsxs("div", { className: "workflow-node-editor-help-section", children: [_jsx("div", { className: "workflow-node-editor-help-title", children: "Allowed" }), _jsx("div", { className: "workflow-node-editor-help-pills", children: hintItems.map(function (item) { return (_jsx(SolidTag, { tone: item.tone, children: item.label }, item.key)); }) })] })) : null] })] }));
|
|
235
|
+
}
|
|
236
|
+
function normalizeKeyValueRows(value) {
|
|
237
|
+
if (Array.isArray(value)) {
|
|
238
|
+
return value.map(function (item) {
|
|
239
|
+
var _a, _b, _c;
|
|
240
|
+
return ({
|
|
241
|
+
key: String((_b = (_a = item === null || item === void 0 ? void 0 : item.key) !== null && _a !== void 0 ? _a : item === null || item === void 0 ? void 0 : item.name) !== null && _b !== void 0 ? _b : ""),
|
|
242
|
+
value: (_c = item === null || item === void 0 ? void 0 : item.value) !== null && _c !== void 0 ? _c : "",
|
|
243
|
+
});
|
|
244
|
+
});
|
|
245
|
+
}
|
|
246
|
+
if (value && typeof value === "object") {
|
|
247
|
+
return Object.entries(value).map(function (_a) {
|
|
248
|
+
var key = _a[0], rowValue = _a[1];
|
|
249
|
+
return ({
|
|
250
|
+
key: key,
|
|
251
|
+
value: rowValue === undefined || rowValue === null
|
|
252
|
+
? ""
|
|
253
|
+
: typeof rowValue === "string"
|
|
254
|
+
? rowValue
|
|
255
|
+
: YAML.stringify(rowValue).trim(),
|
|
256
|
+
});
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
return [];
|
|
260
|
+
}
|
|
261
|
+
function rowsToKeyValueObject(rows) {
|
|
262
|
+
return rows.reduce(function (acc, row) {
|
|
263
|
+
var key = row.key.trim();
|
|
264
|
+
if (!key) {
|
|
265
|
+
return acc;
|
|
266
|
+
}
|
|
267
|
+
acc[key] = row.value;
|
|
268
|
+
return acc;
|
|
269
|
+
}, {});
|
|
270
|
+
}
|
|
271
|
+
function keyValueRowsSignature(rows) {
|
|
272
|
+
return JSON.stringify(rowsToKeyValueObject(rows));
|
|
273
|
+
}
|
|
274
|
+
function WorkflowKeyValueEditor(_a) {
|
|
275
|
+
var value = _a.value, readOnly = _a.readOnly, onChange = _a.onChange;
|
|
276
|
+
var normalizedRows = normalizeKeyValueRows(value);
|
|
277
|
+
var _b = React.useState(normalizedRows.length ? normalizedRows : [{ key: "", value: "" }]), rows = _b[0], setRows = _b[1];
|
|
278
|
+
var lastEmittedSignatureRef = React.useRef(keyValueRowsSignature(normalizedRows));
|
|
279
|
+
React.useEffect(function () {
|
|
280
|
+
var nextRows = normalizeKeyValueRows(value);
|
|
281
|
+
var nextSignature = keyValueRowsSignature(nextRows);
|
|
282
|
+
if (nextSignature === lastEmittedSignatureRef.current) {
|
|
283
|
+
return;
|
|
284
|
+
}
|
|
285
|
+
setRows(nextRows.length ? nextRows : [{ key: "", value: "" }]);
|
|
286
|
+
lastEmittedSignatureRef.current = nextSignature;
|
|
287
|
+
}, [value]);
|
|
288
|
+
var emitRows = function (nextRows) {
|
|
289
|
+
var nextValue = rowsToKeyValueObject(nextRows);
|
|
290
|
+
lastEmittedSignatureRef.current = JSON.stringify(nextValue);
|
|
291
|
+
onChange(nextValue);
|
|
292
|
+
};
|
|
293
|
+
var updateRow = function (index, patch) {
|
|
294
|
+
var nextRows = rows.map(function (row, rowIndex) {
|
|
295
|
+
return rowIndex === index ? __assign(__assign({}, row), patch) : row;
|
|
296
|
+
});
|
|
297
|
+
setRows(nextRows);
|
|
298
|
+
emitRows(nextRows);
|
|
299
|
+
};
|
|
300
|
+
var removeRow = function (index) {
|
|
301
|
+
var nextRows = rows.filter(function (_, rowIndex) { return rowIndex !== index; });
|
|
302
|
+
var displayRows = nextRows.length ? nextRows : [{ key: "", value: "" }];
|
|
303
|
+
setRows(displayRows);
|
|
304
|
+
emitRows(displayRows);
|
|
305
|
+
};
|
|
306
|
+
var addRow = function () {
|
|
307
|
+
setRows(__spreadArray(__spreadArray([], rows, true), [{ key: "", value: "" }], false));
|
|
308
|
+
};
|
|
309
|
+
return (_jsxs("div", { className: "workflow-node-key-value-editor", children: [_jsxs("div", { className: "workflow-node-key-value-header", children: [_jsx("span", { children: "Key" }), _jsx("span", { children: "Value" }), _jsx("span", {})] }), rows.map(function (row, index) {
|
|
310
|
+
var _a;
|
|
311
|
+
return (_jsxs("div", { className: "workflow-node-key-value-row", children: [_jsx(SolidInput, { value: row.key, disabled: readOnly, placeholder: "key", onChange: function (event) { return updateRow(index, { key: event.target.value }); } }), _jsx(SolidInput, { value: (_a = row.value) !== null && _a !== void 0 ? _a : "", disabled: readOnly, placeholder: "value", onChange: function (event) { return updateRow(index, { value: event.target.value }); } }), _jsx("button", { type: "button", className: "workflow-node-key-value-action", disabled: readOnly || rows.length === 1, "aria-label": "Remove row", onClick: function () { return removeRow(index); }, children: _jsx(Trash2, { size: 14 }) })] }, "".concat(row.key || "row", "-").concat(index)));
|
|
312
|
+
}), _jsxs("button", { type: "button", className: "workflow-node-key-value-add", disabled: readOnly, onClick: addRow, children: [_jsx(Plus, { size: 14 }), "Add row"] })] }));
|
|
313
|
+
}
|
|
314
|
+
function WorkflowYamlFieldEditor(_a) {
|
|
315
|
+
var value = _a.value, readOnly = _a.readOnly, onChange = _a.onChange, _b = _a.emptyValue, emptyValue = _b === void 0 ? {} : _b, _c = _a.format, format = _c === void 0 ? "yaml" : _c, _d = _a.height, height = _d === void 0 ? "220px" : _d, expressionSuggestions = _a.expressionSuggestions;
|
|
316
|
+
var stringifyValue = React.useCallback(function (nextValue, nextEmptyValue) {
|
|
317
|
+
return format === "json"
|
|
318
|
+
? stringifyJsonEditorValue(nextValue, nextEmptyValue)
|
|
319
|
+
: stringifyYamlEditorValue(nextValue, nextEmptyValue);
|
|
320
|
+
}, [format]);
|
|
321
|
+
var _e = React.useState(function () {
|
|
322
|
+
return stringifyValue(value, emptyValue);
|
|
323
|
+
}), textValue = _e[0], setTextValue = _e[1];
|
|
324
|
+
var _f = React.useState(null), parseError = _f[0], setParseError = _f[1];
|
|
325
|
+
var lastEmittedSignatureRef = React.useRef(getYamlValueSignature(value !== null && value !== void 0 ? value : emptyValue));
|
|
326
|
+
React.useEffect(function () {
|
|
327
|
+
var nextSignature = getYamlValueSignature(value !== null && value !== void 0 ? value : emptyValue);
|
|
328
|
+
if (nextSignature === lastEmittedSignatureRef.current) {
|
|
329
|
+
return;
|
|
330
|
+
}
|
|
331
|
+
setTextValue(stringifyValue(value, emptyValue));
|
|
332
|
+
setParseError(null);
|
|
333
|
+
lastEmittedSignatureRef.current = nextSignature;
|
|
334
|
+
}, [emptyValue, stringifyValue, value]);
|
|
335
|
+
var handleEditorChange = function (nextText) {
|
|
336
|
+
var _a;
|
|
337
|
+
var safeText = nextText !== null && nextText !== void 0 ? nextText : "";
|
|
338
|
+
setTextValue(safeText);
|
|
339
|
+
try {
|
|
340
|
+
var parsedValue = safeText.trim()
|
|
341
|
+
? format === "json"
|
|
342
|
+
? JSON.parse(safeText)
|
|
343
|
+
: YAML.parse(safeText)
|
|
344
|
+
: emptyValue;
|
|
345
|
+
setParseError(null);
|
|
346
|
+
lastEmittedSignatureRef.current = getYamlValueSignature(parsedValue);
|
|
347
|
+
onChange(parsedValue);
|
|
348
|
+
}
|
|
349
|
+
catch (error) {
|
|
350
|
+
setParseError((_a = error === null || error === void 0 ? void 0 : error.message) !== null && _a !== void 0 ? _a : "".concat(format.toUpperCase(), " is invalid."));
|
|
351
|
+
}
|
|
352
|
+
};
|
|
353
|
+
return (_jsxs("div", { className: "workflow-node-yaml-field-editor", children: [expressionSuggestions ? (_jsx(WorkflowExpressionCodeEditor, { language: format, height: height, fontSize: 12, readOnly: readOnly, value: textValue, suggestions: expressionSuggestions, onChange: handleEditorChange })) : (_jsx(SolidCodeEditor, { language: format, height: height, fontSize: 12, readOnly: readOnly, value: textValue, onChange: handleEditorChange })), parseError ? (_jsx("div", { className: "workflow-node-yaml-field-error", children: parseError })) : null] }));
|
|
354
|
+
}
|
|
355
|
+
function stringifyRecipientListValue(value) {
|
|
356
|
+
if (Array.isArray(value)) {
|
|
357
|
+
return value.join(", ");
|
|
358
|
+
}
|
|
359
|
+
if (value === undefined || value === null) {
|
|
360
|
+
return "";
|
|
361
|
+
}
|
|
362
|
+
return String(value);
|
|
363
|
+
}
|
|
364
|
+
function parseRecipientListValue(value) {
|
|
365
|
+
var trimmedValue = value.trim();
|
|
366
|
+
if (!trimmedValue) {
|
|
367
|
+
return [];
|
|
368
|
+
}
|
|
369
|
+
if (/^\{\{[\s\S]*\}\}$/.test(trimmedValue)) {
|
|
370
|
+
return trimmedValue;
|
|
371
|
+
}
|
|
372
|
+
var recipients = trimmedValue
|
|
373
|
+
.split(",")
|
|
374
|
+
.map(function (recipient) { return recipient.trim(); })
|
|
375
|
+
.filter(Boolean);
|
|
376
|
+
return recipients.length <= 1 ? trimmedValue : recipients;
|
|
377
|
+
}
|
|
378
|
+
function WorkflowRecipientListFieldEditor(_a) {
|
|
379
|
+
var value = _a.value, readOnly = _a.readOnly, placeholder = _a.placeholder, expressionSuggestions = _a.expressionSuggestions, onChange = _a.onChange;
|
|
380
|
+
var _b = React.useState(function () {
|
|
381
|
+
return stringifyRecipientListValue(value);
|
|
382
|
+
}), textValue = _b[0], setTextValue = _b[1];
|
|
383
|
+
var lastValueSignatureRef = React.useRef(getYamlValueSignature(value));
|
|
384
|
+
React.useEffect(function () {
|
|
385
|
+
var nextSignature = getYamlValueSignature(value);
|
|
386
|
+
if (nextSignature === lastValueSignatureRef.current) {
|
|
387
|
+
return;
|
|
388
|
+
}
|
|
389
|
+
setTextValue(stringifyRecipientListValue(value));
|
|
390
|
+
lastValueSignatureRef.current = nextSignature;
|
|
391
|
+
}, [value]);
|
|
392
|
+
var emitChange = function (nextValue) {
|
|
393
|
+
setTextValue(nextValue);
|
|
394
|
+
var parsedValue = parseRecipientListValue(nextValue);
|
|
395
|
+
lastValueSignatureRef.current = getYamlValueSignature(parsedValue);
|
|
396
|
+
onChange(parsedValue);
|
|
397
|
+
};
|
|
398
|
+
return (_jsx(WorkflowExpressionAutocompleteField, { value: textValue, readOnly: readOnly, placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : "{{ item.email }}", suggestions: expressionSuggestions, onChange: emitChange }));
|
|
399
|
+
}
|
|
400
|
+
function getExpressionSearchTerm(value, caretIndex) {
|
|
401
|
+
var prefix = value.slice(0, caretIndex);
|
|
402
|
+
var expressionStart = prefix.lastIndexOf("{{");
|
|
403
|
+
if (expressionStart >= 0 && prefix.lastIndexOf("}}") < expressionStart) {
|
|
404
|
+
return prefix.slice(expressionStart + 2).trim();
|
|
405
|
+
}
|
|
406
|
+
return "";
|
|
407
|
+
}
|
|
408
|
+
function getAutocompleteSession(value, caretIndex) {
|
|
409
|
+
var prefix = value.slice(0, caretIndex);
|
|
410
|
+
var expressionStart = prefix.lastIndexOf("{{");
|
|
411
|
+
if (expressionStart >= 0 && prefix.lastIndexOf("}}") < expressionStart) {
|
|
412
|
+
return {
|
|
413
|
+
mode: "expression",
|
|
414
|
+
queryStart: expressionStart + 2,
|
|
415
|
+
};
|
|
416
|
+
}
|
|
417
|
+
return {
|
|
418
|
+
mode: "insert",
|
|
419
|
+
queryStart: caretIndex,
|
|
420
|
+
};
|
|
421
|
+
}
|
|
422
|
+
function getAutocompleteSessionQuery(value, caretIndex, session) {
|
|
423
|
+
if (!session) {
|
|
424
|
+
return getExpressionSearchTerm(value, caretIndex);
|
|
425
|
+
}
|
|
426
|
+
if (session.queryStart > caretIndex) {
|
|
427
|
+
return "";
|
|
428
|
+
}
|
|
429
|
+
return value.slice(session.queryStart, caretIndex).trim();
|
|
430
|
+
}
|
|
431
|
+
function insertExpressionAtCaret(value, caretIndex, insertText, session) {
|
|
432
|
+
var prefix = value.slice(0, caretIndex);
|
|
433
|
+
var suffix = value.slice(caretIndex);
|
|
434
|
+
var expressionStart = prefix.lastIndexOf("{{");
|
|
435
|
+
var expressionEndInSuffix = suffix.indexOf("}}");
|
|
436
|
+
if (expressionStart >= 0 && prefix.lastIndexOf("}}") < expressionStart) {
|
|
437
|
+
var endIndex = expressionEndInSuffix >= 0
|
|
438
|
+
? caretIndex + expressionEndInSuffix + 2
|
|
439
|
+
: caretIndex;
|
|
440
|
+
return {
|
|
441
|
+
value: "".concat(value.slice(0, expressionStart)).concat(insertText).concat(value.slice(endIndex)),
|
|
442
|
+
caretIndex: expressionStart + insertText.length,
|
|
443
|
+
};
|
|
444
|
+
}
|
|
445
|
+
var replaceStart = (session === null || session === void 0 ? void 0 : session.mode) === "insert" && session.queryStart <= caretIndex
|
|
446
|
+
? session.queryStart
|
|
447
|
+
: caretIndex;
|
|
448
|
+
var spacerBefore = replaceStart > 0 && !/\s/.test(value.charAt(replaceStart - 1)) ? " " : "";
|
|
449
|
+
var spacerAfter = suffix && !/^\s/.test(suffix) ? " " : "";
|
|
450
|
+
var replacement = "".concat(spacerBefore).concat(insertText).concat(spacerAfter);
|
|
451
|
+
return {
|
|
452
|
+
value: "".concat(value.slice(0, replaceStart)).concat(replacement).concat(suffix),
|
|
453
|
+
caretIndex: replaceStart + spacerBefore.length + insertText.length,
|
|
454
|
+
};
|
|
455
|
+
}
|
|
456
|
+
function getWorkflowAutocompletePortalPosition(anchor) {
|
|
457
|
+
if (!anchor || typeof window === "undefined") {
|
|
458
|
+
return null;
|
|
459
|
+
}
|
|
460
|
+
var rect = anchor.getBoundingClientRect();
|
|
461
|
+
var viewportWidth = window.innerWidth;
|
|
462
|
+
var viewportHeight = window.innerHeight;
|
|
463
|
+
var gutter = 12;
|
|
464
|
+
var offset = 6;
|
|
465
|
+
var preferredWidth = Math.max(rect.width, 420);
|
|
466
|
+
var width = Math.min(preferredWidth, viewportWidth - gutter * 2);
|
|
467
|
+
var left = Math.min(Math.max(rect.left, gutter), Math.max(viewportWidth - width - gutter, gutter));
|
|
468
|
+
var spaceBelow = viewportHeight - rect.bottom - gutter;
|
|
469
|
+
var spaceAbove = rect.top - gutter;
|
|
470
|
+
var renderAbove = spaceBelow < 220 && spaceAbove > spaceBelow;
|
|
471
|
+
var availableHeight = Math.max(160, Math.min(320, renderAbove ? spaceAbove - offset : spaceBelow - offset));
|
|
472
|
+
return {
|
|
473
|
+
left: left,
|
|
474
|
+
top: renderAbove
|
|
475
|
+
? Math.max(gutter, rect.top - offset - availableHeight)
|
|
476
|
+
: Math.min(viewportHeight - gutter - availableHeight, rect.bottom + offset),
|
|
477
|
+
width: width,
|
|
478
|
+
maxHeight: availableHeight,
|
|
479
|
+
};
|
|
480
|
+
}
|
|
481
|
+
function getWorkflowCodeAutocompletePortalPosition(editor) {
|
|
482
|
+
var _a, _b, _c;
|
|
483
|
+
if (!editor || typeof window === "undefined") {
|
|
484
|
+
return null;
|
|
485
|
+
}
|
|
486
|
+
var domNode = (_a = editor.getDomNode) === null || _a === void 0 ? void 0 : _a.call(editor);
|
|
487
|
+
var position = (_b = editor.getPosition) === null || _b === void 0 ? void 0 : _b.call(editor);
|
|
488
|
+
var visiblePosition = position
|
|
489
|
+
? (_c = editor.getScrolledVisiblePosition) === null || _c === void 0 ? void 0 : _c.call(editor, position)
|
|
490
|
+
: null;
|
|
491
|
+
if (!domNode || !position || !visiblePosition) {
|
|
492
|
+
return getWorkflowAutocompletePortalPosition(domNode !== null && domNode !== void 0 ? domNode : null);
|
|
493
|
+
}
|
|
494
|
+
var rect = domNode.getBoundingClientRect();
|
|
495
|
+
var viewportWidth = window.innerWidth;
|
|
496
|
+
var viewportHeight = window.innerHeight;
|
|
497
|
+
var gutter = 12;
|
|
498
|
+
var offset = 6;
|
|
499
|
+
var preferredWidth = Math.max(Math.min(rect.width, 520), 420);
|
|
500
|
+
var width = Math.min(preferredWidth, viewportWidth - gutter * 2);
|
|
501
|
+
var caretLeft = rect.left + visiblePosition.left;
|
|
502
|
+
var caretBottom = rect.top + visiblePosition.top + visiblePosition.height;
|
|
503
|
+
var left = Math.min(Math.max(caretLeft, gutter), Math.max(viewportWidth - width - gutter, gutter));
|
|
504
|
+
var spaceBelow = viewportHeight - caretBottom - gutter;
|
|
505
|
+
var spaceAbove = rect.top + visiblePosition.top - gutter;
|
|
506
|
+
var renderAbove = spaceBelow < 220 && spaceAbove > spaceBelow;
|
|
507
|
+
var availableHeight = Math.max(160, Math.min(320, renderAbove ? spaceAbove - offset : spaceBelow - offset));
|
|
508
|
+
return {
|
|
509
|
+
left: left,
|
|
510
|
+
top: renderAbove
|
|
511
|
+
? Math.max(gutter, rect.top + visiblePosition.top - offset - availableHeight)
|
|
512
|
+
: Math.min(viewportHeight - gutter - availableHeight, caretBottom + offset),
|
|
513
|
+
width: width,
|
|
514
|
+
maxHeight: availableHeight,
|
|
515
|
+
};
|
|
516
|
+
}
|
|
517
|
+
function WorkflowExpressionCodeEditor(_a) {
|
|
518
|
+
var value = _a.value, readOnly = _a.readOnly, language = _a.language, height = _a.height, _b = _a.fontSize, fontSize = _b === void 0 ? 12 : _b, _c = _a.suggestions, suggestions = _c === void 0 ? [] : _c, onChange = _a.onChange;
|
|
519
|
+
var editorRef = React.useRef(null);
|
|
520
|
+
var disposablesRef = React.useRef([]);
|
|
521
|
+
var menuRef = React.useRef(null);
|
|
522
|
+
var scrollBodyRef = React.useRef(null);
|
|
523
|
+
var optionRefs = React.useRef([]);
|
|
524
|
+
var autocompleteSessionRef = React.useRef(null);
|
|
525
|
+
var isMenuInteractionRef = React.useRef(false);
|
|
526
|
+
var _d = React.useState(false), open = _d[0], setOpen = _d[1];
|
|
527
|
+
var _e = React.useState(""), query = _e[0], setQuery = _e[1];
|
|
528
|
+
var _f = React.useState(0), activeIndex = _f[0], setActiveIndex = _f[1];
|
|
529
|
+
var _g = React.useState(null), portalPosition = _g[0], setPortalPosition = _g[1];
|
|
530
|
+
var filteredSuggestions = React.useMemo(function () {
|
|
531
|
+
var normalizedQuery = query.trim().toLowerCase();
|
|
532
|
+
if (!normalizedQuery) {
|
|
533
|
+
return suggestions;
|
|
534
|
+
}
|
|
535
|
+
return suggestions.filter(function (suggestion) {
|
|
536
|
+
return [
|
|
537
|
+
suggestion.group,
|
|
538
|
+
suggestion.label,
|
|
539
|
+
suggestion.insertText,
|
|
540
|
+
suggestion.detail,
|
|
541
|
+
suggestion.description,
|
|
542
|
+
]
|
|
543
|
+
.filter(Boolean)
|
|
544
|
+
.some(function (entry) { return String(entry).toLowerCase().includes(normalizedQuery); });
|
|
545
|
+
});
|
|
546
|
+
}, [query, suggestions]);
|
|
547
|
+
var filteredSuggestionsRef = React.useRef(filteredSuggestions);
|
|
548
|
+
var activeIndexRef = React.useRef(activeIndex);
|
|
549
|
+
var openRef = React.useRef(open);
|
|
550
|
+
React.useEffect(function () {
|
|
551
|
+
filteredSuggestionsRef.current = filteredSuggestions;
|
|
552
|
+
}, [filteredSuggestions]);
|
|
553
|
+
React.useEffect(function () {
|
|
554
|
+
activeIndexRef.current = activeIndex;
|
|
555
|
+
}, [activeIndex]);
|
|
556
|
+
React.useEffect(function () {
|
|
557
|
+
openRef.current = open;
|
|
558
|
+
}, [open]);
|
|
559
|
+
React.useEffect(function () {
|
|
560
|
+
setActiveIndex(0);
|
|
561
|
+
}, [query]);
|
|
562
|
+
var getEditorState = React.useCallback(function () {
|
|
563
|
+
var _a, _b;
|
|
564
|
+
var editor = editorRef.current;
|
|
565
|
+
var model = (_a = editor === null || editor === void 0 ? void 0 : editor.getModel) === null || _a === void 0 ? void 0 : _a.call(editor);
|
|
566
|
+
var position = (_b = editor === null || editor === void 0 ? void 0 : editor.getPosition) === null || _b === void 0 ? void 0 : _b.call(editor);
|
|
567
|
+
if (!editor || !model || !position) {
|
|
568
|
+
return null;
|
|
569
|
+
}
|
|
570
|
+
return {
|
|
571
|
+
editor: editor,
|
|
572
|
+
model: model,
|
|
573
|
+
position: position,
|
|
574
|
+
value: model.getValue(),
|
|
575
|
+
caretIndex: model.getOffsetAt(position),
|
|
576
|
+
};
|
|
577
|
+
}, []);
|
|
578
|
+
var closePicker = React.useCallback(function () {
|
|
579
|
+
setOpen(false);
|
|
580
|
+
setQuery("");
|
|
581
|
+
setActiveIndex(0);
|
|
582
|
+
setPortalPosition(null);
|
|
583
|
+
autocompleteSessionRef.current = null;
|
|
584
|
+
isMenuInteractionRef.current = false;
|
|
585
|
+
}, []);
|
|
586
|
+
var updatePortalPosition = React.useCallback(function () {
|
|
587
|
+
setPortalPosition(getWorkflowCodeAutocompletePortalPosition(editorRef.current));
|
|
588
|
+
}, []);
|
|
589
|
+
var openPicker = React.useCallback(function () {
|
|
590
|
+
var editorState = getEditorState();
|
|
591
|
+
if (!editorState || readOnly) {
|
|
592
|
+
return;
|
|
593
|
+
}
|
|
594
|
+
var session = getAutocompleteSession(editorState.value, editorState.caretIndex);
|
|
595
|
+
autocompleteSessionRef.current = session;
|
|
596
|
+
setQuery(getAutocompleteSessionQuery(editorState.value, editorState.caretIndex, session));
|
|
597
|
+
setPortalPosition(getWorkflowCodeAutocompletePortalPosition(editorState.editor));
|
|
598
|
+
setOpen(true);
|
|
599
|
+
}, [getEditorState, readOnly]);
|
|
600
|
+
var scrollAutocompleteBy = React.useCallback(function (deltaY) {
|
|
601
|
+
var scrollBody = scrollBodyRef.current;
|
|
602
|
+
if (!scrollBody) {
|
|
603
|
+
return false;
|
|
604
|
+
}
|
|
605
|
+
var previousScrollTop = scrollBody.scrollTop;
|
|
606
|
+
scrollBody.scrollTop += deltaY;
|
|
607
|
+
return scrollBody.scrollTop !== previousScrollTop;
|
|
608
|
+
}, []);
|
|
609
|
+
var selectSuggestion = React.useCallback(function (suggestion) {
|
|
610
|
+
var editorState = getEditorState();
|
|
611
|
+
if (!editorState) {
|
|
612
|
+
return;
|
|
613
|
+
}
|
|
614
|
+
var next = insertExpressionAtCaret(editorState.value, editorState.caretIndex, suggestion.insertText, autocompleteSessionRef.current);
|
|
615
|
+
var range = editorState.model.getFullModelRange();
|
|
616
|
+
editorState.editor.executeEdits("workflow-expression-autocomplete", [
|
|
617
|
+
{
|
|
618
|
+
range: range,
|
|
619
|
+
text: next.value,
|
|
620
|
+
forceMoveMarkers: true,
|
|
621
|
+
},
|
|
622
|
+
]);
|
|
623
|
+
var nextPosition = editorState.model.getPositionAt(next.caretIndex);
|
|
624
|
+
editorState.editor.setPosition(nextPosition);
|
|
625
|
+
editorState.editor.focus();
|
|
626
|
+
onChange(next.value);
|
|
627
|
+
closePicker();
|
|
628
|
+
}, [closePicker, getEditorState, onChange]);
|
|
629
|
+
React.useLayoutEffect(function () {
|
|
630
|
+
if (!open) {
|
|
631
|
+
return;
|
|
632
|
+
}
|
|
633
|
+
var scrollBody = scrollBodyRef.current;
|
|
634
|
+
var option = optionRefs.current[activeIndex];
|
|
635
|
+
if (!scrollBody || !option) {
|
|
636
|
+
return;
|
|
637
|
+
}
|
|
638
|
+
var optionTop = option.offsetTop;
|
|
639
|
+
var optionBottom = optionTop + option.offsetHeight;
|
|
640
|
+
var visibleTop = scrollBody.scrollTop;
|
|
641
|
+
var visibleBottom = visibleTop + scrollBody.clientHeight;
|
|
642
|
+
if (optionTop < visibleTop) {
|
|
643
|
+
scrollBody.scrollTop = optionTop;
|
|
644
|
+
}
|
|
645
|
+
else if (optionBottom > visibleBottom) {
|
|
646
|
+
scrollBody.scrollTop = optionBottom - scrollBody.clientHeight;
|
|
647
|
+
}
|
|
648
|
+
}, [activeIndex, open]);
|
|
649
|
+
React.useLayoutEffect(function () {
|
|
650
|
+
if (!open) {
|
|
651
|
+
setPortalPosition(null);
|
|
652
|
+
return;
|
|
653
|
+
}
|
|
654
|
+
updatePortalPosition();
|
|
655
|
+
}, [filteredSuggestions.length, open, updatePortalPosition, value]);
|
|
656
|
+
React.useEffect(function () {
|
|
657
|
+
if (!open || typeof window === "undefined") {
|
|
658
|
+
return;
|
|
659
|
+
}
|
|
660
|
+
window.addEventListener("resize", updatePortalPosition);
|
|
661
|
+
window.addEventListener("scroll", updatePortalPosition, true);
|
|
662
|
+
return function () {
|
|
663
|
+
window.removeEventListener("resize", updatePortalPosition);
|
|
664
|
+
window.removeEventListener("scroll", updatePortalPosition, true);
|
|
665
|
+
};
|
|
666
|
+
}, [open, updatePortalPosition]);
|
|
667
|
+
React.useEffect(function () {
|
|
668
|
+
if (!open || typeof document === "undefined") {
|
|
669
|
+
return;
|
|
670
|
+
}
|
|
671
|
+
var handleNativeWheel = function (event) {
|
|
672
|
+
var menu = menuRef.current;
|
|
673
|
+
var scrollBody = scrollBodyRef.current;
|
|
674
|
+
if (!menu || !scrollBody) {
|
|
675
|
+
return;
|
|
676
|
+
}
|
|
677
|
+
var target = event.target;
|
|
678
|
+
var targetInsideMenu = target instanceof Node ? menu.contains(target) : false;
|
|
679
|
+
var rect = menu.getBoundingClientRect();
|
|
680
|
+
var pointerInsideMenu = event.clientX >= rect.left &&
|
|
681
|
+
event.clientX <= rect.right &&
|
|
682
|
+
event.clientY >= rect.top &&
|
|
683
|
+
event.clientY <= rect.bottom;
|
|
684
|
+
if (!targetInsideMenu && !pointerInsideMenu) {
|
|
685
|
+
return;
|
|
686
|
+
}
|
|
687
|
+
var normalizedDeltaY = event.deltaMode === WheelEvent.DOM_DELTA_LINE
|
|
688
|
+
? event.deltaY * 32
|
|
689
|
+
: event.deltaMode === WheelEvent.DOM_DELTA_PAGE
|
|
690
|
+
? event.deltaY * scrollBody.clientHeight
|
|
691
|
+
: event.deltaY || event.deltaX;
|
|
692
|
+
event.preventDefault();
|
|
693
|
+
event.stopPropagation();
|
|
694
|
+
event.stopImmediatePropagation();
|
|
695
|
+
scrollAutocompleteBy(normalizedDeltaY);
|
|
696
|
+
};
|
|
697
|
+
document.addEventListener("wheel", handleNativeWheel, {
|
|
698
|
+
capture: true,
|
|
699
|
+
passive: false,
|
|
700
|
+
});
|
|
701
|
+
return function () {
|
|
702
|
+
document.removeEventListener("wheel", handleNativeWheel, {
|
|
703
|
+
capture: true,
|
|
704
|
+
});
|
|
705
|
+
};
|
|
706
|
+
}, [open, scrollAutocompleteBy]);
|
|
707
|
+
React.useEffect(function () {
|
|
708
|
+
if (!open || typeof document === "undefined") {
|
|
709
|
+
return;
|
|
710
|
+
}
|
|
711
|
+
var getOptionIndexAtPoint = function (clientX, clientY) {
|
|
712
|
+
var menu = menuRef.current;
|
|
713
|
+
if (!menu) {
|
|
714
|
+
return -1;
|
|
715
|
+
}
|
|
716
|
+
var menuRect = menu.getBoundingClientRect();
|
|
717
|
+
var pointerInsideMenu = clientX >= menuRect.left &&
|
|
718
|
+
clientX <= menuRect.right &&
|
|
719
|
+
clientY >= menuRect.top &&
|
|
720
|
+
clientY <= menuRect.bottom;
|
|
721
|
+
if (!pointerInsideMenu) {
|
|
722
|
+
return -1;
|
|
723
|
+
}
|
|
724
|
+
return optionRefs.current.findIndex(function (option) {
|
|
725
|
+
if (!option) {
|
|
726
|
+
return false;
|
|
727
|
+
}
|
|
728
|
+
var rect = option.getBoundingClientRect();
|
|
729
|
+
return (clientX >= rect.left &&
|
|
730
|
+
clientX <= rect.right &&
|
|
731
|
+
clientY >= rect.top &&
|
|
732
|
+
clientY <= rect.bottom);
|
|
733
|
+
});
|
|
734
|
+
};
|
|
735
|
+
var handleNativePointerMove = function (event) {
|
|
736
|
+
var optionIndex = getOptionIndexAtPoint(event.clientX, event.clientY);
|
|
737
|
+
if (optionIndex >= 0) {
|
|
738
|
+
setActiveIndex(optionIndex);
|
|
739
|
+
}
|
|
740
|
+
};
|
|
741
|
+
var handleNativePointerDown = function (event) {
|
|
742
|
+
var optionIndex = getOptionIndexAtPoint(event.clientX, event.clientY);
|
|
743
|
+
var suggestion = filteredSuggestions[optionIndex];
|
|
744
|
+
if (!suggestion) {
|
|
745
|
+
return;
|
|
746
|
+
}
|
|
747
|
+
event.preventDefault();
|
|
748
|
+
event.stopPropagation();
|
|
749
|
+
event.stopImmediatePropagation();
|
|
750
|
+
isMenuInteractionRef.current = true;
|
|
751
|
+
setActiveIndex(optionIndex);
|
|
752
|
+
selectSuggestion(suggestion);
|
|
753
|
+
};
|
|
754
|
+
document.addEventListener("pointermove", handleNativePointerMove, {
|
|
755
|
+
capture: true,
|
|
756
|
+
});
|
|
757
|
+
document.addEventListener("pointerdown", handleNativePointerDown, {
|
|
758
|
+
capture: true,
|
|
759
|
+
});
|
|
760
|
+
return function () {
|
|
761
|
+
document.removeEventListener("pointermove", handleNativePointerMove, {
|
|
762
|
+
capture: true,
|
|
763
|
+
});
|
|
764
|
+
document.removeEventListener("pointerdown", handleNativePointerDown, {
|
|
765
|
+
capture: true,
|
|
766
|
+
});
|
|
767
|
+
};
|
|
768
|
+
}, [filteredSuggestions, open, selectSuggestion]);
|
|
769
|
+
React.useEffect(function () { return function () {
|
|
770
|
+
disposablesRef.current.forEach(function (disposable) { return disposable.dispose(); });
|
|
771
|
+
disposablesRef.current = [];
|
|
772
|
+
}; }, []);
|
|
773
|
+
var handleEditorMount = React.useCallback(function (editor) {
|
|
774
|
+
var _a;
|
|
775
|
+
disposablesRef.current.forEach(function (disposable) { return disposable.dispose(); });
|
|
776
|
+
disposablesRef.current = [];
|
|
777
|
+
editorRef.current = editor;
|
|
778
|
+
var consumeKeyboardEvent = function (browserEvent) {
|
|
779
|
+
var preventEditorHandling = function () {
|
|
780
|
+
browserEvent.preventDefault();
|
|
781
|
+
browserEvent.stopPropagation();
|
|
782
|
+
browserEvent.stopImmediatePropagation();
|
|
783
|
+
};
|
|
784
|
+
if (browserEvent.ctrlKey && browserEvent.code === "Space") {
|
|
785
|
+
preventEditorHandling();
|
|
786
|
+
openPicker();
|
|
787
|
+
return true;
|
|
788
|
+
}
|
|
789
|
+
if (!openRef.current) {
|
|
790
|
+
return false;
|
|
791
|
+
}
|
|
792
|
+
if (browserEvent.key === "Escape") {
|
|
793
|
+
preventEditorHandling();
|
|
794
|
+
closePicker();
|
|
795
|
+
return true;
|
|
796
|
+
}
|
|
797
|
+
if (browserEvent.key === "ArrowDown") {
|
|
798
|
+
preventEditorHandling();
|
|
799
|
+
setActiveIndex(function (current) {
|
|
800
|
+
return Math.min(current + 1, Math.max(filteredSuggestionsRef.current.length - 1, 0));
|
|
801
|
+
});
|
|
802
|
+
return true;
|
|
803
|
+
}
|
|
804
|
+
if (browserEvent.key === "ArrowUp") {
|
|
805
|
+
preventEditorHandling();
|
|
806
|
+
setActiveIndex(function (current) { return Math.max(current - 1, 0); });
|
|
807
|
+
return true;
|
|
808
|
+
}
|
|
809
|
+
if (browserEvent.key === "Enter") {
|
|
810
|
+
var suggestion = filteredSuggestionsRef.current[activeIndexRef.current];
|
|
811
|
+
if (suggestion) {
|
|
812
|
+
preventEditorHandling();
|
|
813
|
+
selectSuggestion(suggestion);
|
|
814
|
+
return true;
|
|
815
|
+
}
|
|
816
|
+
}
|
|
817
|
+
return false;
|
|
818
|
+
};
|
|
819
|
+
var domNode = (_a = editor.getDomNode) === null || _a === void 0 ? void 0 : _a.call(editor);
|
|
820
|
+
if (domNode) {
|
|
821
|
+
var handleNativeKeyDown_1 = function (event) {
|
|
822
|
+
consumeKeyboardEvent(event);
|
|
823
|
+
};
|
|
824
|
+
domNode.addEventListener("keydown", handleNativeKeyDown_1, {
|
|
825
|
+
capture: true,
|
|
826
|
+
});
|
|
827
|
+
disposablesRef.current.push({
|
|
828
|
+
dispose: function () {
|
|
829
|
+
domNode.removeEventListener("keydown", handleNativeKeyDown_1, {
|
|
830
|
+
capture: true,
|
|
831
|
+
});
|
|
832
|
+
},
|
|
833
|
+
});
|
|
834
|
+
}
|
|
835
|
+
disposablesRef.current.push(editor.onKeyDown(function (event) {
|
|
836
|
+
var browserEvent = event.browserEvent;
|
|
837
|
+
if (!browserEvent) {
|
|
838
|
+
return;
|
|
839
|
+
}
|
|
840
|
+
if (consumeKeyboardEvent(browserEvent)) {
|
|
841
|
+
event.preventDefault();
|
|
842
|
+
event.stopPropagation();
|
|
843
|
+
}
|
|
844
|
+
}));
|
|
845
|
+
disposablesRef.current.push(editor.onDidChangeModelContent(function () {
|
|
846
|
+
if (!openRef.current) {
|
|
847
|
+
return;
|
|
848
|
+
}
|
|
849
|
+
var editorState = getEditorState();
|
|
850
|
+
if (!editorState) {
|
|
851
|
+
return;
|
|
852
|
+
}
|
|
853
|
+
setQuery(getAutocompleteSessionQuery(editorState.value, editorState.caretIndex, autocompleteSessionRef.current));
|
|
854
|
+
updatePortalPosition();
|
|
855
|
+
}));
|
|
856
|
+
disposablesRef.current.push(editor.onDidBlurEditorWidget(function () {
|
|
857
|
+
window.setTimeout(function () {
|
|
858
|
+
if (!isMenuInteractionRef.current) {
|
|
859
|
+
closePicker();
|
|
860
|
+
}
|
|
861
|
+
}, 120);
|
|
862
|
+
}));
|
|
863
|
+
}, [
|
|
864
|
+
closePicker,
|
|
865
|
+
getEditorState,
|
|
866
|
+
openPicker,
|
|
867
|
+
selectSuggestion,
|
|
868
|
+
updatePortalPosition,
|
|
869
|
+
]);
|
|
870
|
+
var groupedSuggestions = filteredSuggestions.reduce(function (acc, suggestion) {
|
|
871
|
+
var _a;
|
|
872
|
+
acc[suggestion.group] = (_a = acc[suggestion.group]) !== null && _a !== void 0 ? _a : [];
|
|
873
|
+
acc[suggestion.group].push(suggestion);
|
|
874
|
+
return acc;
|
|
875
|
+
}, {});
|
|
876
|
+
var handleMenuWheel = function (event) {
|
|
877
|
+
event.preventDefault();
|
|
878
|
+
event.stopPropagation();
|
|
879
|
+
scrollAutocompleteBy(event.deltaY || event.deltaX);
|
|
880
|
+
};
|
|
881
|
+
var handleMenuPointerDown = function () {
|
|
882
|
+
isMenuInteractionRef.current = true;
|
|
883
|
+
window.setTimeout(function () {
|
|
884
|
+
var handlePointerUp = function () {
|
|
885
|
+
window.setTimeout(function () {
|
|
886
|
+
isMenuInteractionRef.current = false;
|
|
887
|
+
}, 0);
|
|
888
|
+
window.removeEventListener("pointerup", handlePointerUp);
|
|
889
|
+
};
|
|
890
|
+
window.addEventListener("pointerup", handlePointerUp);
|
|
891
|
+
}, 0);
|
|
892
|
+
};
|
|
893
|
+
var menu = open && portalPosition && typeof document !== "undefined" ? (_jsx("div", { ref: menuRef, className: "workflow-expression-autocomplete-menu", "data-solid-dialog-outside-safe": "true", style: {
|
|
894
|
+
left: portalPosition.left,
|
|
895
|
+
top: portalPosition.top,
|
|
896
|
+
width: portalPosition.width,
|
|
897
|
+
maxHeight: portalPosition.maxHeight,
|
|
898
|
+
}, onPointerDownCapture: handleMenuPointerDown, onWheelCapture: handleMenuWheel, children: _jsxs("div", { ref: scrollBodyRef, className: "workflow-expression-autocomplete-scroll-body", style: { maxHeight: Math.max(portalPosition.maxHeight - 16, 120) }, children: [_jsx("div", { className: "workflow-expression-autocomplete-help", children: "Start typing to choose from available variables, inputs, secrets, or outputs." }), filteredSuggestions.length ? (Object.entries(groupedSuggestions).map(function (_a) {
|
|
899
|
+
var group = _a[0], groupSuggestions = _a[1];
|
|
900
|
+
return (_jsxs("div", { className: "workflow-expression-autocomplete-group", children: [_jsx("div", { className: "workflow-expression-autocomplete-group-title", children: group }), groupSuggestions.map(function (suggestion) {
|
|
901
|
+
var absoluteIndex = filteredSuggestions.indexOf(suggestion);
|
|
902
|
+
var isActive = absoluteIndex === activeIndex;
|
|
903
|
+
return (_jsxs("button", { ref: function (element) {
|
|
904
|
+
optionRefs.current[absoluteIndex] = element;
|
|
905
|
+
}, type: "button", className: "workflow-expression-autocomplete-option ".concat(isActive ? "is-active" : ""), onPointerEnter: function () {
|
|
906
|
+
setActiveIndex(absoluteIndex);
|
|
907
|
+
}, onMouseEnter: function () {
|
|
908
|
+
setActiveIndex(absoluteIndex);
|
|
909
|
+
}, onPointerDown: function (event) {
|
|
910
|
+
event.preventDefault();
|
|
911
|
+
event.stopPropagation();
|
|
912
|
+
selectSuggestion(suggestion);
|
|
913
|
+
}, onClick: function (event) {
|
|
914
|
+
event.preventDefault();
|
|
915
|
+
event.stopPropagation();
|
|
916
|
+
selectSuggestion(suggestion);
|
|
917
|
+
}, children: [_jsxs("span", { className: "workflow-expression-autocomplete-option-main", children: [_jsx("span", { className: "workflow-expression-autocomplete-option-label", children: suggestion.label }), suggestion.detail ? (_jsx("span", { className: "workflow-expression-autocomplete-option-detail", children: suggestion.detail })) : null] }), suggestion.description ? (_jsx("span", { className: "workflow-expression-autocomplete-option-description", children: suggestion.description })) : null] }, "".concat(suggestion.group, "-").concat(suggestion.insertText)));
|
|
918
|
+
})] }, group));
|
|
919
|
+
})) : (_jsx("div", { className: "workflow-expression-autocomplete-empty", children: "No matching expression references." }))] }) })) : null;
|
|
920
|
+
return (_jsxs(_Fragment, { children: [_jsx(SolidCodeEditor, { language: language, height: height, fontSize: fontSize, readOnly: readOnly, value: value, onChange: onChange, onMount: handleEditorMount }), menu ? createPortal(menu, document.body) : null] }));
|
|
921
|
+
}
|
|
922
|
+
export function WorkflowExpressionAutocompleteField(_a) {
|
|
923
|
+
var value = _a.value, readOnly = _a.readOnly, multiline = _a.multiline, placeholder = _a.placeholder, _b = _a.suggestions, suggestions = _b === void 0 ? [] : _b, onChange = _a.onChange;
|
|
924
|
+
var inputRef = React.useRef(null);
|
|
925
|
+
var menuRef = React.useRef(null);
|
|
926
|
+
var scrollBodyRef = React.useRef(null);
|
|
927
|
+
var optionRefs = React.useRef([]);
|
|
928
|
+
var _c = React.useState(false), open = _c[0], setOpen = _c[1];
|
|
929
|
+
var _d = React.useState(""), query = _d[0], setQuery = _d[1];
|
|
930
|
+
var _e = React.useState(0), activeIndex = _e[0], setActiveIndex = _e[1];
|
|
931
|
+
var _f = React.useState(null), portalPosition = _f[0], setPortalPosition = _f[1];
|
|
932
|
+
var autocompleteSessionRef = React.useRef(null);
|
|
933
|
+
var isMenuInteractionRef = React.useRef(false);
|
|
934
|
+
var filteredSuggestions = React.useMemo(function () {
|
|
935
|
+
var normalizedQuery = query.trim().toLowerCase();
|
|
936
|
+
if (!normalizedQuery) {
|
|
937
|
+
return suggestions;
|
|
938
|
+
}
|
|
939
|
+
return suggestions.filter(function (suggestion) {
|
|
940
|
+
return [
|
|
941
|
+
suggestion.group,
|
|
942
|
+
suggestion.label,
|
|
943
|
+
suggestion.insertText,
|
|
944
|
+
suggestion.detail,
|
|
945
|
+
suggestion.description,
|
|
946
|
+
]
|
|
947
|
+
.filter(Boolean)
|
|
948
|
+
.some(function (entry) { return String(entry).toLowerCase().includes(normalizedQuery); });
|
|
949
|
+
});
|
|
950
|
+
}, [query, suggestions]);
|
|
951
|
+
React.useEffect(function () {
|
|
952
|
+
setActiveIndex(0);
|
|
953
|
+
}, [query]);
|
|
954
|
+
var scrollAutocompleteBy = React.useCallback(function (deltaY) {
|
|
955
|
+
var scrollBody = scrollBodyRef.current;
|
|
956
|
+
if (!scrollBody) {
|
|
957
|
+
return false;
|
|
958
|
+
}
|
|
959
|
+
var previousScrollTop = scrollBody.scrollTop;
|
|
960
|
+
scrollBody.scrollTop += deltaY;
|
|
961
|
+
return scrollBody.scrollTop !== previousScrollTop;
|
|
962
|
+
}, []);
|
|
963
|
+
React.useLayoutEffect(function () {
|
|
964
|
+
if (!open) {
|
|
965
|
+
return;
|
|
966
|
+
}
|
|
967
|
+
var scrollBody = scrollBodyRef.current;
|
|
968
|
+
var option = optionRefs.current[activeIndex];
|
|
969
|
+
if (!scrollBody || !option) {
|
|
970
|
+
return;
|
|
971
|
+
}
|
|
972
|
+
var optionTop = option.offsetTop;
|
|
973
|
+
var optionBottom = optionTop + option.offsetHeight;
|
|
974
|
+
var visibleTop = scrollBody.scrollTop;
|
|
975
|
+
var visibleBottom = visibleTop + scrollBody.clientHeight;
|
|
976
|
+
if (optionTop < visibleTop) {
|
|
977
|
+
scrollBody.scrollTop = optionTop;
|
|
978
|
+
}
|
|
979
|
+
else if (optionBottom > visibleBottom) {
|
|
980
|
+
scrollBody.scrollTop = optionBottom - scrollBody.clientHeight;
|
|
981
|
+
}
|
|
982
|
+
}, [activeIndex, open]);
|
|
983
|
+
var updatePortalPosition = React.useCallback(function () {
|
|
984
|
+
setPortalPosition(getWorkflowAutocompletePortalPosition(inputRef.current));
|
|
985
|
+
}, []);
|
|
986
|
+
React.useLayoutEffect(function () {
|
|
987
|
+
if (!open) {
|
|
988
|
+
setPortalPosition(null);
|
|
989
|
+
return;
|
|
990
|
+
}
|
|
991
|
+
updatePortalPosition();
|
|
992
|
+
}, [open, updatePortalPosition, value, filteredSuggestions.length]);
|
|
993
|
+
React.useEffect(function () {
|
|
994
|
+
if (!open || typeof window === "undefined") {
|
|
995
|
+
return;
|
|
996
|
+
}
|
|
997
|
+
window.addEventListener("resize", updatePortalPosition);
|
|
998
|
+
window.addEventListener("scroll", updatePortalPosition, true);
|
|
999
|
+
return function () {
|
|
1000
|
+
window.removeEventListener("resize", updatePortalPosition);
|
|
1001
|
+
window.removeEventListener("scroll", updatePortalPosition, true);
|
|
1002
|
+
};
|
|
1003
|
+
}, [open, updatePortalPosition]);
|
|
1004
|
+
React.useEffect(function () {
|
|
1005
|
+
if (!open || typeof document === "undefined") {
|
|
1006
|
+
return;
|
|
1007
|
+
}
|
|
1008
|
+
var handleNativeWheel = function (event) {
|
|
1009
|
+
var menu = menuRef.current;
|
|
1010
|
+
var scrollBody = scrollBodyRef.current;
|
|
1011
|
+
if (!menu || !scrollBody) {
|
|
1012
|
+
return;
|
|
1013
|
+
}
|
|
1014
|
+
var target = event.target;
|
|
1015
|
+
var targetInsideMenu = target instanceof Node ? menu.contains(target) : false;
|
|
1016
|
+
var rect = menu.getBoundingClientRect();
|
|
1017
|
+
var pointerInsideMenu = event.clientX >= rect.left &&
|
|
1018
|
+
event.clientX <= rect.right &&
|
|
1019
|
+
event.clientY >= rect.top &&
|
|
1020
|
+
event.clientY <= rect.bottom;
|
|
1021
|
+
if (!targetInsideMenu && !pointerInsideMenu) {
|
|
1022
|
+
return;
|
|
1023
|
+
}
|
|
1024
|
+
var normalizedDeltaY = event.deltaMode === WheelEvent.DOM_DELTA_LINE
|
|
1025
|
+
? event.deltaY * 32
|
|
1026
|
+
: event.deltaMode === WheelEvent.DOM_DELTA_PAGE
|
|
1027
|
+
? event.deltaY * scrollBody.clientHeight
|
|
1028
|
+
: event.deltaY || event.deltaX;
|
|
1029
|
+
event.preventDefault();
|
|
1030
|
+
event.stopPropagation();
|
|
1031
|
+
event.stopImmediatePropagation();
|
|
1032
|
+
scrollAutocompleteBy(normalizedDeltaY);
|
|
1033
|
+
};
|
|
1034
|
+
document.addEventListener("wheel", handleNativeWheel, {
|
|
1035
|
+
capture: true,
|
|
1036
|
+
passive: false,
|
|
1037
|
+
});
|
|
1038
|
+
return function () {
|
|
1039
|
+
document.removeEventListener("wheel", handleNativeWheel, {
|
|
1040
|
+
capture: true,
|
|
1041
|
+
});
|
|
1042
|
+
};
|
|
1043
|
+
}, [open, scrollAutocompleteBy]);
|
|
1044
|
+
var openPicker = function () {
|
|
1045
|
+
var _a;
|
|
1046
|
+
var input = inputRef.current;
|
|
1047
|
+
var caretIndex = (_a = input === null || input === void 0 ? void 0 : input.selectionStart) !== null && _a !== void 0 ? _a : value.length;
|
|
1048
|
+
var session = getAutocompleteSession(value, caretIndex);
|
|
1049
|
+
autocompleteSessionRef.current = session;
|
|
1050
|
+
setQuery(getAutocompleteSessionQuery(value, caretIndex, session));
|
|
1051
|
+
setPortalPosition(getWorkflowAutocompletePortalPosition(input));
|
|
1052
|
+
setOpen(true);
|
|
1053
|
+
};
|
|
1054
|
+
var closePicker = function () {
|
|
1055
|
+
setOpen(false);
|
|
1056
|
+
setQuery("");
|
|
1057
|
+
setActiveIndex(0);
|
|
1058
|
+
setPortalPosition(null);
|
|
1059
|
+
autocompleteSessionRef.current = null;
|
|
1060
|
+
isMenuInteractionRef.current = false;
|
|
1061
|
+
};
|
|
1062
|
+
var selectSuggestion = function (suggestion) {
|
|
1063
|
+
var _a;
|
|
1064
|
+
var input = inputRef.current;
|
|
1065
|
+
var caretIndex = (_a = input === null || input === void 0 ? void 0 : input.selectionStart) !== null && _a !== void 0 ? _a : value.length;
|
|
1066
|
+
var next = insertExpressionAtCaret(value, caretIndex, suggestion.insertText, autocompleteSessionRef.current);
|
|
1067
|
+
onChange(next.value);
|
|
1068
|
+
closePicker();
|
|
1069
|
+
window.requestAnimationFrame(function () {
|
|
1070
|
+
input === null || input === void 0 ? void 0 : input.focus();
|
|
1071
|
+
input === null || input === void 0 ? void 0 : input.setSelectionRange(next.caretIndex, next.caretIndex);
|
|
1072
|
+
});
|
|
1073
|
+
};
|
|
1074
|
+
React.useEffect(function () {
|
|
1075
|
+
if (!open || typeof document === "undefined") {
|
|
1076
|
+
return;
|
|
1077
|
+
}
|
|
1078
|
+
var getOptionIndexAtPoint = function (clientX, clientY) {
|
|
1079
|
+
var menu = menuRef.current;
|
|
1080
|
+
if (!menu) {
|
|
1081
|
+
return -1;
|
|
1082
|
+
}
|
|
1083
|
+
var menuRect = menu.getBoundingClientRect();
|
|
1084
|
+
var pointerInsideMenu = clientX >= menuRect.left &&
|
|
1085
|
+
clientX <= menuRect.right &&
|
|
1086
|
+
clientY >= menuRect.top &&
|
|
1087
|
+
clientY <= menuRect.bottom;
|
|
1088
|
+
if (!pointerInsideMenu) {
|
|
1089
|
+
return -1;
|
|
1090
|
+
}
|
|
1091
|
+
return optionRefs.current.findIndex(function (option) {
|
|
1092
|
+
if (!option) {
|
|
1093
|
+
return false;
|
|
1094
|
+
}
|
|
1095
|
+
var rect = option.getBoundingClientRect();
|
|
1096
|
+
return (clientX >= rect.left &&
|
|
1097
|
+
clientX <= rect.right &&
|
|
1098
|
+
clientY >= rect.top &&
|
|
1099
|
+
clientY <= rect.bottom);
|
|
1100
|
+
});
|
|
1101
|
+
};
|
|
1102
|
+
var handleNativePointerMove = function (event) {
|
|
1103
|
+
var optionIndex = getOptionIndexAtPoint(event.clientX, event.clientY);
|
|
1104
|
+
if (optionIndex >= 0) {
|
|
1105
|
+
setActiveIndex(optionIndex);
|
|
1106
|
+
}
|
|
1107
|
+
};
|
|
1108
|
+
var handleNativePointerDown = function (event) {
|
|
1109
|
+
var optionIndex = getOptionIndexAtPoint(event.clientX, event.clientY);
|
|
1110
|
+
var suggestion = filteredSuggestions[optionIndex];
|
|
1111
|
+
if (!suggestion) {
|
|
1112
|
+
return;
|
|
1113
|
+
}
|
|
1114
|
+
event.preventDefault();
|
|
1115
|
+
event.stopPropagation();
|
|
1116
|
+
event.stopImmediatePropagation();
|
|
1117
|
+
isMenuInteractionRef.current = true;
|
|
1118
|
+
setActiveIndex(optionIndex);
|
|
1119
|
+
selectSuggestion(suggestion);
|
|
1120
|
+
};
|
|
1121
|
+
document.addEventListener("pointermove", handleNativePointerMove, {
|
|
1122
|
+
capture: true,
|
|
1123
|
+
});
|
|
1124
|
+
document.addEventListener("pointerdown", handleNativePointerDown, {
|
|
1125
|
+
capture: true,
|
|
1126
|
+
});
|
|
1127
|
+
return function () {
|
|
1128
|
+
document.removeEventListener("pointermove", handleNativePointerMove, {
|
|
1129
|
+
capture: true,
|
|
1130
|
+
});
|
|
1131
|
+
document.removeEventListener("pointerdown", handleNativePointerDown, {
|
|
1132
|
+
capture: true,
|
|
1133
|
+
});
|
|
1134
|
+
};
|
|
1135
|
+
}, [filteredSuggestions, open]);
|
|
1136
|
+
var handleKeyDown = function (event) {
|
|
1137
|
+
if (event.ctrlKey && event.code === "Space") {
|
|
1138
|
+
event.preventDefault();
|
|
1139
|
+
if (!readOnly) {
|
|
1140
|
+
openPicker();
|
|
1141
|
+
}
|
|
1142
|
+
return;
|
|
1143
|
+
}
|
|
1144
|
+
if (!open) {
|
|
1145
|
+
return;
|
|
1146
|
+
}
|
|
1147
|
+
if (event.key === "Escape") {
|
|
1148
|
+
event.preventDefault();
|
|
1149
|
+
closePicker();
|
|
1150
|
+
return;
|
|
1151
|
+
}
|
|
1152
|
+
if (event.key === "ArrowDown") {
|
|
1153
|
+
event.preventDefault();
|
|
1154
|
+
setActiveIndex(function (current) {
|
|
1155
|
+
return Math.min(current + 1, Math.max(filteredSuggestions.length - 1, 0));
|
|
1156
|
+
});
|
|
1157
|
+
return;
|
|
1158
|
+
}
|
|
1159
|
+
if (event.key === "ArrowUp") {
|
|
1160
|
+
event.preventDefault();
|
|
1161
|
+
setActiveIndex(function (current) { return Math.max(current - 1, 0); });
|
|
1162
|
+
return;
|
|
1163
|
+
}
|
|
1164
|
+
if (event.key === "Enter" && filteredSuggestions[activeIndex]) {
|
|
1165
|
+
event.preventDefault();
|
|
1166
|
+
selectSuggestion(filteredSuggestions[activeIndex]);
|
|
1167
|
+
}
|
|
1168
|
+
};
|
|
1169
|
+
var handleChange = function (event) {
|
|
1170
|
+
var _a;
|
|
1171
|
+
var nextValue = event.target.value;
|
|
1172
|
+
onChange(nextValue);
|
|
1173
|
+
if (open) {
|
|
1174
|
+
setQuery(getAutocompleteSessionQuery(nextValue, (_a = event.target.selectionStart) !== null && _a !== void 0 ? _a : nextValue.length, autocompleteSessionRef.current));
|
|
1175
|
+
}
|
|
1176
|
+
};
|
|
1177
|
+
var groupedSuggestions = filteredSuggestions.reduce(function (acc, suggestion) {
|
|
1178
|
+
var _a;
|
|
1179
|
+
acc[suggestion.group] = (_a = acc[suggestion.group]) !== null && _a !== void 0 ? _a : [];
|
|
1180
|
+
acc[suggestion.group].push(suggestion);
|
|
1181
|
+
return acc;
|
|
1182
|
+
}, {});
|
|
1183
|
+
var inputProps = {
|
|
1184
|
+
ref: inputRef,
|
|
1185
|
+
value: value,
|
|
1186
|
+
disabled: readOnly,
|
|
1187
|
+
placeholder: placeholder,
|
|
1188
|
+
onChange: handleChange,
|
|
1189
|
+
onKeyDown: handleKeyDown,
|
|
1190
|
+
onBlur: function () {
|
|
1191
|
+
return window.setTimeout(function () {
|
|
1192
|
+
if (!isMenuInteractionRef.current) {
|
|
1193
|
+
closePicker();
|
|
1194
|
+
}
|
|
1195
|
+
}, 120);
|
|
1196
|
+
},
|
|
1197
|
+
};
|
|
1198
|
+
var handleMenuWheel = function (event) {
|
|
1199
|
+
event.preventDefault();
|
|
1200
|
+
event.stopPropagation();
|
|
1201
|
+
scrollAutocompleteBy(event.deltaY || event.deltaX);
|
|
1202
|
+
};
|
|
1203
|
+
var handleMenuPointerDown = function () {
|
|
1204
|
+
isMenuInteractionRef.current = true;
|
|
1205
|
+
window.setTimeout(function () {
|
|
1206
|
+
var handlePointerUp = function () {
|
|
1207
|
+
window.setTimeout(function () {
|
|
1208
|
+
isMenuInteractionRef.current = false;
|
|
1209
|
+
}, 0);
|
|
1210
|
+
window.removeEventListener("pointerup", handlePointerUp);
|
|
1211
|
+
};
|
|
1212
|
+
window.addEventListener("pointerup", handlePointerUp);
|
|
1213
|
+
}, 0);
|
|
1214
|
+
};
|
|
1215
|
+
var menu = open && portalPosition && typeof document !== "undefined" ? (_jsx("div", { ref: menuRef, className: "workflow-expression-autocomplete-menu", "data-solid-dialog-outside-safe": "true", style: {
|
|
1216
|
+
left: portalPosition.left,
|
|
1217
|
+
top: portalPosition.top,
|
|
1218
|
+
width: portalPosition.width,
|
|
1219
|
+
maxHeight: portalPosition.maxHeight,
|
|
1220
|
+
}, onPointerDownCapture: handleMenuPointerDown, onWheelCapture: handleMenuWheel, children: _jsxs("div", { ref: scrollBodyRef, className: "workflow-expression-autocomplete-scroll-body", style: { maxHeight: Math.max(portalPosition.maxHeight - 16, 120) }, children: [_jsx("div", { className: "workflow-expression-autocomplete-help", children: "Start typing to choose from available variables, inputs, secrets, or outputs." }), filteredSuggestions.length ? (Object.entries(groupedSuggestions).map(function (_a) {
|
|
1221
|
+
var group = _a[0], groupSuggestions = _a[1];
|
|
1222
|
+
return (_jsxs("div", { className: "workflow-expression-autocomplete-group", children: [_jsx("div", { className: "workflow-expression-autocomplete-group-title", children: group }), groupSuggestions.map(function (suggestion) {
|
|
1223
|
+
var absoluteIndex = filteredSuggestions.indexOf(suggestion);
|
|
1224
|
+
var isActive = absoluteIndex === activeIndex;
|
|
1225
|
+
return (_jsxs("button", { ref: function (element) {
|
|
1226
|
+
optionRefs.current[absoluteIndex] = element;
|
|
1227
|
+
}, type: "button", className: "workflow-expression-autocomplete-option ".concat(isActive ? "is-active" : ""), onPointerEnter: function () {
|
|
1228
|
+
setActiveIndex(absoluteIndex);
|
|
1229
|
+
}, onMouseEnter: function () {
|
|
1230
|
+
setActiveIndex(absoluteIndex);
|
|
1231
|
+
}, onPointerDown: function (event) {
|
|
1232
|
+
event.preventDefault();
|
|
1233
|
+
event.stopPropagation();
|
|
1234
|
+
selectSuggestion(suggestion);
|
|
1235
|
+
}, onClick: function (event) {
|
|
1236
|
+
event.preventDefault();
|
|
1237
|
+
event.stopPropagation();
|
|
1238
|
+
selectSuggestion(suggestion);
|
|
1239
|
+
}, children: [_jsxs("span", { className: "workflow-expression-autocomplete-option-main", children: [_jsx("span", { className: "workflow-expression-autocomplete-option-label", children: suggestion.label }), suggestion.detail ? (_jsx("span", { className: "workflow-expression-autocomplete-option-detail", children: suggestion.detail })) : null] }), suggestion.description ? (_jsx("span", { className: "workflow-expression-autocomplete-option-description", children: suggestion.description })) : null] }, "".concat(suggestion.group, "-").concat(suggestion.insertText)));
|
|
1240
|
+
})] }, group));
|
|
1241
|
+
})) : (_jsx("div", { className: "workflow-expression-autocomplete-empty", children: "No matching expression references." }))] }) })) : null;
|
|
1242
|
+
return (_jsxs("div", { className: "workflow-expression-autocomplete", children: [multiline ? (_jsx(SolidTextarea, __assign({}, inputProps))) : (_jsx(SolidInput, __assign({}, inputProps))), menu ? createPortal(menu, document.body) : null] }));
|
|
1243
|
+
}
|
|
1244
|
+
function WorkflowNodeFieldEditor(_a) {
|
|
1245
|
+
var _b, _c, _d, _e, _f, _g, _h, _j;
|
|
1246
|
+
var nodeType = _a.nodeType, field = _a.field, value = _a.value, expressionSuggestions = _a.expressionSuggestions, readOnly = _a.readOnly, onChange = _a.onChange;
|
|
1247
|
+
var extensionKey = (_b = field.extensionComponentKey) !== null && _b !== void 0 ? _b : (_d = (_c = nodeType.ui) === null || _c === void 0 ? void 0 : _c.fieldComponentKeys) === null || _d === void 0 ? void 0 : _d[field.key];
|
|
1248
|
+
var ExtensionComponent = extensionKey ? getExtensionComponent(extensionKey) : null;
|
|
1249
|
+
var normalizedValue = normalizeFieldValue(field, value);
|
|
1250
|
+
if (ExtensionComponent) {
|
|
1251
|
+
return (_jsx(ExtensionComponent, { nodeType: nodeType, field: field, value: normalizedValue, onChange: onChange, readOnly: readOnly }));
|
|
1252
|
+
}
|
|
1253
|
+
if ((_e = field.enumValues) === null || _e === void 0 ? void 0 : _e.length) {
|
|
1254
|
+
return (_jsx(SolidSelect, { value: normalizedValue, disabled: readOnly, options: field.enumValues.map(function (item) { return ({
|
|
1255
|
+
label: String(item),
|
|
1256
|
+
value: item,
|
|
1257
|
+
}); }), onChange: function (event) { return onChange(event.value); } }));
|
|
1258
|
+
}
|
|
1259
|
+
if (field.widgetHint === "key-value-editor") {
|
|
1260
|
+
return (_jsx(WorkflowKeyValueEditor, { value: normalizedValue, readOnly: readOnly, onChange: onChange }));
|
|
1261
|
+
}
|
|
1262
|
+
if (field.valueType === "boolean") {
|
|
1263
|
+
return (_jsx(SolidSwitch, { checked: !!normalizedValue, disabled: readOnly, onChange: function (checked) { return onChange(checked); } }));
|
|
1264
|
+
}
|
|
1265
|
+
if (field.valueType === "number" || field.valueType === "integer") {
|
|
1266
|
+
return (_jsx(SolidNumberInput, { value: normalizedValue, disabled: readOnly, onChange: function (event) { return onChange(event.value); } }));
|
|
1267
|
+
}
|
|
1268
|
+
if (field.widgetHint === "raw-editor") {
|
|
1269
|
+
var stringValue = typeof normalizedValue === "string"
|
|
1270
|
+
? normalizedValue
|
|
1271
|
+
: normalizedValue === undefined || normalizedValue === null
|
|
1272
|
+
? ""
|
|
1273
|
+
: JSON.stringify(normalizedValue, null, 2);
|
|
1274
|
+
var editorLanguage = (_h = (_g = (_f = field.uiSchema) === null || _f === void 0 ? void 0 : _f.editor) === null || _g === void 0 ? void 0 : _g.language) !== null && _h !== void 0 ? _h : "json";
|
|
1275
|
+
if (field.expressionAllowed) {
|
|
1276
|
+
return (_jsx(WorkflowExpressionCodeEditor, { language: editorLanguage, height: getConfigurationFieldEditorHeight(field), fontSize: 12, readOnly: readOnly, value: stringValue, suggestions: expressionSuggestions, onChange: function (next) { return onChange(next !== null && next !== void 0 ? next : ""); } }));
|
|
1277
|
+
}
|
|
1278
|
+
return (_jsx(SolidCodeEditor, { language: editorLanguage, height: getConfigurationFieldEditorHeight(field), fontSize: 12, readOnly: readOnly, value: stringValue, onChange: function (next) { return onChange(next !== null && next !== void 0 ? next : ""); } }));
|
|
1279
|
+
}
|
|
1280
|
+
if (field.widgetHint === "recipient-list") {
|
|
1281
|
+
return (_jsx(WorkflowRecipientListFieldEditor, { value: normalizedValue, readOnly: readOnly, placeholder: (_j = field.uiSchema) === null || _j === void 0 ? void 0 : _j.placeholder, expressionSuggestions: expressionSuggestions, onChange: onChange }));
|
|
1282
|
+
}
|
|
1283
|
+
if (field.valueType === "object" ||
|
|
1284
|
+
field.valueType === "array" ||
|
|
1285
|
+
field.valueType === "json" ||
|
|
1286
|
+
field.widgetHint === "json-editor" ||
|
|
1287
|
+
field.widgetHint === "yaml-editor") {
|
|
1288
|
+
return (_jsx(WorkflowYamlFieldEditor, { value: normalizedValue, readOnly: readOnly, onChange: onChange, emptyValue: field.valueType === "array" ? EMPTY_YAML_ARRAY : EMPTY_YAML_OBJECT, format: field.widgetHint === "yaml-editor" ? "yaml" : "json", height: getConfigurationFieldEditorHeight(field), expressionSuggestions: field.expressionAllowed ? expressionSuggestions : undefined }));
|
|
1289
|
+
}
|
|
1290
|
+
if (field.valueType === "any") {
|
|
1291
|
+
return (_jsx(WorkflowYamlFieldEditor, { value: normalizedValue, readOnly: readOnly, onChange: onChange, emptyValue: null, format: "yaml", height: getConfigurationFieldEditorHeight(field), expressionSuggestions: field.expressionAllowed ? expressionSuggestions : undefined }));
|
|
1292
|
+
}
|
|
1293
|
+
if (field.widgetHint === "textarea") {
|
|
1294
|
+
if (field.expressionAllowed) {
|
|
1295
|
+
return (_jsx(WorkflowExpressionAutocompleteField, { value: normalizedValue !== null && normalizedValue !== void 0 ? normalizedValue : "", readOnly: readOnly, multiline: true, suggestions: expressionSuggestions, onChange: onChange }));
|
|
1296
|
+
}
|
|
1297
|
+
return (_jsx(SolidTextarea, { value: normalizedValue !== null && normalizedValue !== void 0 ? normalizedValue : "", disabled: readOnly, onChange: function (event) { return onChange(event.target.value); } }));
|
|
1298
|
+
}
|
|
1299
|
+
if (field.expressionAllowed) {
|
|
1300
|
+
return (_jsx(WorkflowExpressionAutocompleteField, { value: normalizedValue !== null && normalizedValue !== void 0 ? normalizedValue : "", readOnly: readOnly, suggestions: expressionSuggestions, onChange: onChange }));
|
|
1301
|
+
}
|
|
1302
|
+
return (_jsx(SolidInput, { value: normalizedValue !== null && normalizedValue !== void 0 ? normalizedValue : "", disabled: readOnly, onChange: function (event) { return onChange(event.target.value); } }));
|
|
1303
|
+
}
|
|
1304
|
+
function orderGroupLabels(groupLabels, groupOrder) {
|
|
1305
|
+
return __spreadArray([], groupLabels, true).sort(function (left, right) {
|
|
1306
|
+
var leftIndex = groupOrder.indexOf(left);
|
|
1307
|
+
var rightIndex = groupOrder.indexOf(right);
|
|
1308
|
+
if (leftIndex >= 0 && rightIndex >= 0) {
|
|
1309
|
+
return leftIndex - rightIndex;
|
|
1310
|
+
}
|
|
1311
|
+
if (leftIndex >= 0) {
|
|
1312
|
+
return -1;
|
|
1313
|
+
}
|
|
1314
|
+
if (rightIndex >= 0) {
|
|
1315
|
+
return 1;
|
|
1316
|
+
}
|
|
1317
|
+
return left.localeCompare(right);
|
|
1318
|
+
});
|
|
1319
|
+
}
|
|
1320
|
+
function buildConfigurationSections(fields, groupOrder) {
|
|
1321
|
+
var groupedFields = fields.reduce(function (acc, field) {
|
|
1322
|
+
var _a, _b;
|
|
1323
|
+
var group = (_a = field.group) !== null && _a !== void 0 ? _a : "General";
|
|
1324
|
+
acc[group] = (_b = acc[group]) !== null && _b !== void 0 ? _b : [];
|
|
1325
|
+
acc[group].push(field);
|
|
1326
|
+
return acc;
|
|
1327
|
+
}, {});
|
|
1328
|
+
return orderGroupLabels(Object.keys(groupedFields), groupOrder).map(function (group) { return ({
|
|
1329
|
+
key: group,
|
|
1330
|
+
label: group,
|
|
1331
|
+
fields: groupedFields[group],
|
|
1332
|
+
}); });
|
|
1333
|
+
}
|
|
1334
|
+
function getFieldLayoutKeys(field) {
|
|
1335
|
+
return [field.key, field.path].filter(Boolean);
|
|
1336
|
+
}
|
|
1337
|
+
function buildConfigurationTabs(fields, groupOrder, layout) {
|
|
1338
|
+
if ((layout === null || layout === void 0 ? void 0 : layout.type) !== "tabs" || !Array.isArray(layout.tabs) || !layout.tabs.length) {
|
|
1339
|
+
return [];
|
|
1340
|
+
}
|
|
1341
|
+
var assignedFieldKeys = new Set();
|
|
1342
|
+
var tabs = layout.tabs
|
|
1343
|
+
.map(function (tab) {
|
|
1344
|
+
var _a, _b;
|
|
1345
|
+
var tabFieldKeys = new Set((_a = tab.fields) !== null && _a !== void 0 ? _a : []);
|
|
1346
|
+
var tabGroupLabels = new Set((_b = tab.groups) !== null && _b !== void 0 ? _b : []);
|
|
1347
|
+
var tabFields = fields.filter(function (field) {
|
|
1348
|
+
var _a;
|
|
1349
|
+
var isFieldMatch = getFieldLayoutKeys(field).some(function (key) { return tabFieldKeys.has(key); });
|
|
1350
|
+
var isGroupMatch = tabGroupLabels.has((_a = field.group) !== null && _a !== void 0 ? _a : "General");
|
|
1351
|
+
if (isFieldMatch || isGroupMatch) {
|
|
1352
|
+
getFieldLayoutKeys(field).forEach(function (key) { return assignedFieldKeys.add(key); });
|
|
1353
|
+
return true;
|
|
1354
|
+
}
|
|
1355
|
+
return false;
|
|
1356
|
+
});
|
|
1357
|
+
return {
|
|
1358
|
+
key: tab.key,
|
|
1359
|
+
label: tab.label,
|
|
1360
|
+
sections: buildConfigurationSections(tabFields, groupOrder),
|
|
1361
|
+
};
|
|
1362
|
+
})
|
|
1363
|
+
.filter(function (tab) { return tab.sections.some(function (section) { return section.fields.length; }); });
|
|
1364
|
+
var unassignedFields = fields.filter(function (field) { return !getFieldLayoutKeys(field).some(function (key) { return assignedFieldKeys.has(key); }); });
|
|
1365
|
+
if (unassignedFields.length) {
|
|
1366
|
+
tabs.push({
|
|
1367
|
+
key: "other",
|
|
1368
|
+
label: "Other",
|
|
1369
|
+
sections: buildConfigurationSections(unassignedFields, groupOrder),
|
|
1370
|
+
});
|
|
1371
|
+
}
|
|
1372
|
+
return tabs;
|
|
1373
|
+
}
|
|
1374
|
+
function WorkflowConfigurationSections(_a) {
|
|
1375
|
+
var sections = _a.sections, nodeType = _a.nodeType, draft = _a.draft, expressionSuggestions = _a.expressionSuggestions, readOnly = _a.readOnly, updateField = _a.updateField;
|
|
1376
|
+
return (_jsx(_Fragment, { children: sections.map(function (section) { return (_jsxs("section", { className: "workflow-node-editor-section", children: [sections.length > 1 || section.label !== "General" ? (_jsx("div", { className: "workflow-node-editor-section-heading", children: section.label })) : null, _jsx("div", { className: "workflow-node-editor-form-grid", children: section.fields.map(function (field) {
|
|
1377
|
+
var _a, _b;
|
|
1378
|
+
var fieldWidth = getConfigurationFieldWidth(field);
|
|
1379
|
+
return (_jsxs("div", { className: "workflow-node-editor-field workflow-node-editor-field--".concat(fieldWidth), children: [_jsx("div", { className: "workflow-node-editor-field-heading", children: _jsxs("div", { className: "workflow-node-editor-label-row", children: [_jsx("label", { className: "workflow-node-editor-label", children: (_a = field.label) !== null && _a !== void 0 ? _a : field.key }), _jsx(WorkflowFieldHelp, { field: field })] }) }), _jsx(WorkflowNodeFieldEditor, { nodeType: nodeType, field: field, value: getPathValue(draft, (_b = field.path) !== null && _b !== void 0 ? _b : field.key), expressionSuggestions: expressionSuggestions, readOnly: readOnly, onChange: function (nextValue) { return updateField(field, nextValue); } })] }, field.key));
|
|
1380
|
+
}) })] }, section.key)); }) }));
|
|
1381
|
+
}
|
|
1382
|
+
export function WorkflowNodeSchemaEditor(_a) {
|
|
1383
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
1384
|
+
var nodeType = _a.nodeType, value = _a.value, onChange = _a.onChange, onSubmit = _a.onSubmit, expressionSuggestions = _a.expressionSuggestions, readOnly = _a.readOnly, className = _a.className;
|
|
1385
|
+
var _o = React.useState((_c = value !== null && value !== void 0 ? value : (_b = nodeType.authoring) === null || _b === void 0 ? void 0 : _b.defaultConfiguration) !== null && _c !== void 0 ? _c : {}), draft = _o[0], setDraft = _o[1];
|
|
1386
|
+
var _p = React.useState(""), activeConfigurationTab = _p[0], setActiveConfigurationTab = _p[1];
|
|
1387
|
+
React.useEffect(function () {
|
|
1388
|
+
var _a, _b;
|
|
1389
|
+
setDraft((_b = value !== null && value !== void 0 ? value : (_a = nodeType.authoring) === null || _a === void 0 ? void 0 : _a.defaultConfiguration) !== null && _b !== void 0 ? _b : {});
|
|
1390
|
+
}, [nodeType, value]);
|
|
1391
|
+
var fields = (_e = (_d = nodeType.authoring) === null || _d === void 0 ? void 0 : _d.configurationFields) !== null && _e !== void 0 ? _e : [];
|
|
1392
|
+
var groupOrder = (_h = (_g = (_f = nodeType.ui) === null || _f === void 0 ? void 0 : _f.layoutHints) === null || _g === void 0 ? void 0 : _g.groupOrder) !== null && _h !== void 0 ? _h : [];
|
|
1393
|
+
var visibleFields = fields.filter(function (field) {
|
|
1394
|
+
return isConfigurationFieldVisible(field, draft);
|
|
1395
|
+
});
|
|
1396
|
+
var configurationSections = buildConfigurationSections(visibleFields, groupOrder);
|
|
1397
|
+
var configurationTabs = buildConfigurationTabs(visibleFields, groupOrder, (_j = nodeType.authoring) === null || _j === void 0 ? void 0 : _j.configurationLayout);
|
|
1398
|
+
var activeConfigurationTabValue = activeConfigurationTab || ((_k = configurationTabs[0]) === null || _k === void 0 ? void 0 : _k.key) || "";
|
|
1399
|
+
var updateField = function (field, nextValue) {
|
|
1400
|
+
var _a;
|
|
1401
|
+
var nextDraft = setPathValue(draft, (_a = field.path) !== null && _a !== void 0 ? _a : field.key, nextValue);
|
|
1402
|
+
setDraft(nextDraft);
|
|
1403
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(nextDraft);
|
|
1404
|
+
};
|
|
1405
|
+
React.useEffect(function () {
|
|
1406
|
+
if (configurationTabs.length &&
|
|
1407
|
+
!configurationTabs.some(function (tab) { return tab.key === activeConfigurationTab; })) {
|
|
1408
|
+
setActiveConfigurationTab(configurationTabs[0].key);
|
|
1409
|
+
}
|
|
1410
|
+
}, [activeConfigurationTab, configurationTabs]);
|
|
1411
|
+
if (!configurationSections.length) {
|
|
1412
|
+
return (_jsx("div", { className: "workflow-node-editor-empty ".concat(className !== null && className !== void 0 ? className : ""), children: "This node does not expose configuration fields yet." }));
|
|
1413
|
+
}
|
|
1414
|
+
return (_jsxs("div", { className: "workflow-node-editor-config ".concat(className !== null && className !== void 0 ? className : ""), children: [configurationTabs.length > 1 ? (_jsx(SolidTabGroup, { tabs: configurationTabs.map(function (tab) { return ({
|
|
1415
|
+
value: tab.key,
|
|
1416
|
+
label: tab.label,
|
|
1417
|
+
content: (_jsx(WorkflowConfigurationSections, { sections: tab.sections, nodeType: nodeType, draft: draft, expressionSuggestions: expressionSuggestions, readOnly: readOnly, updateField: updateField })),
|
|
1418
|
+
}); }), value: activeConfigurationTabValue, onValueChange: setActiveConfigurationTab, className: "workflow-node-editor-config-tabs", panelClassName: "workflow-node-editor-config-tab-panel" })) : (_jsx(WorkflowConfigurationSections, { sections: (_m = (_l = configurationTabs[0]) === null || _l === void 0 ? void 0 : _l.sections) !== null && _m !== void 0 ? _m : configurationSections, nodeType: nodeType, draft: draft, expressionSuggestions: expressionSuggestions, readOnly: readOnly, updateField: updateField })), !readOnly && onSubmit ? (_jsx("div", { className: "workflow-node-editor-inline-actions", children: _jsx(SolidButton, { onClick: function () { return onSubmit(draft); }, children: "Save" }) })) : null] }));
|
|
1419
|
+
}
|
|
1420
|
+
function WorkflowNodeTags(_a) {
|
|
1421
|
+
var _b;
|
|
1422
|
+
var nodeType = _a.nodeType;
|
|
1423
|
+
return (_jsxs("div", { className: "workflow-node-editor-tags", children: [_jsx(SolidTag, { children: nodeType.kind }), nodeType.category ? _jsx(SolidTag, { children: nodeType.category }) : null, ((_b = nodeType.ui) === null || _b === void 0 ? void 0 : _b.defaultEditorMode) ? _jsx(SolidTag, { children: nodeType.ui.defaultEditorMode }) : null] }));
|
|
1424
|
+
}
|
|
1425
|
+
function WorkflowNodeHeaderMeta(_a) {
|
|
1426
|
+
var nodeType = _a.nodeType;
|
|
1427
|
+
return (_jsxs("div", { className: "workflow-node-editor-dialog-meta", children: [_jsx("span", { className: "workflow-node-editor-dialog-icon", style: getWorkflowNodeIconStyle(nodeType), children: _jsx(WorkflowNodeTypeIcon, { nodeType: nodeType, size: 15 }) }), _jsx(SolidTag, { children: nodeType.kind }), _jsx(SolidTag, { children: nodeType.type }), nodeType.category ? _jsx(SolidTag, { children: nodeType.category }) : null, nodeType.subcategory ? _jsx(SolidTag, { children: nodeType.subcategory }) : null] }));
|
|
1428
|
+
}
|
|
1429
|
+
function WorkflowNodeCommonFields(_a) {
|
|
1430
|
+
var _b, _c, _d, _e;
|
|
1431
|
+
var nodeType = _a.nodeType, draft = _a.draft, readOnly = _a.readOnly, onChange = _a.onChange;
|
|
1432
|
+
var authoring = nodeType.authoring;
|
|
1433
|
+
var update = function (patch) {
|
|
1434
|
+
onChange(__assign(__assign({}, draft), patch));
|
|
1435
|
+
};
|
|
1436
|
+
return (_jsx("section", { className: "workflow-node-editor-section", children: _jsxs("div", { className: "workflow-node-editor-form-grid", children: [_jsxs("div", { className: "workflow-node-editor-field", children: [_jsx("label", { className: "workflow-node-editor-label", children: "Id" }), _jsx(SolidInput, { value: (_b = draft.id) !== null && _b !== void 0 ? _b : "", disabled: readOnly, onChange: function (event) { return update({ id: event.target.value }); } })] }), _jsxs("div", { className: "workflow-node-editor-field", children: [_jsx("label", { className: "workflow-node-editor-label", children: "Type" }), _jsx(SolidInput, { value: (_c = draft.type) !== null && _c !== void 0 ? _c : nodeType.type, disabled: true })] }), (authoring === null || authoring === void 0 ? void 0 : authoring.supportsName) !== false ? (_jsxs("div", { className: "workflow-node-editor-field", children: [_jsx("label", { className: "workflow-node-editor-label", children: "Name" }), _jsx(SolidInput, { value: (_d = draft.name) !== null && _d !== void 0 ? _d : "", disabled: readOnly, onChange: function (event) { return update({ name: event.target.value }); } })] })) : null, _jsxs("div", { className: "workflow-node-editor-field", children: [_jsx("label", { className: "workflow-node-editor-label", children: "Kind" }), _jsx(WorkflowNodeTags, { nodeType: nodeType })] }), (authoring === null || authoring === void 0 ? void 0 : authoring.supportsDescription) ? (_jsxs("div", { className: "workflow-node-editor-field workflow-node-editor-field--wide", children: [_jsx("label", { className: "workflow-node-editor-label", children: "Description" }), _jsx(SolidTextarea, { className: "workflow-node-editor-description-input", value: (_e = draft.description) !== null && _e !== void 0 ? _e : "", disabled: readOnly, onChange: function (event) { return update({ description: event.target.value }); } })] })) : null] }) }));
|
|
1437
|
+
}
|
|
1438
|
+
function WorkflowNodeRuntimeFields(_a) {
|
|
1439
|
+
var _b, _c, _d;
|
|
1440
|
+
var nodeType = _a.nodeType, draft = _a.draft, readOnly = _a.readOnly, onChange = _a.onChange;
|
|
1441
|
+
var authoring = nodeType.authoring;
|
|
1442
|
+
if (!hasRuntimeFields(nodeType)) {
|
|
1443
|
+
return null;
|
|
1444
|
+
}
|
|
1445
|
+
var update = function (patch) {
|
|
1446
|
+
onChange(__assign(__assign({}, draft), patch));
|
|
1447
|
+
};
|
|
1448
|
+
return (_jsxs("section", { className: "workflow-node-editor-section", children: [(authoring === null || authoring === void 0 ? void 0 : authoring.supportsDisableToggle) ? (_jsxs("div", { className: "workflow-node-editor-toggle-row", children: [_jsxs("div", { children: [_jsx("div", { className: "workflow-node-editor-toggle-title", children: "Disabled" }), _jsx("div", { className: "workflow-node-editor-description", children: "Skip this node during execution." })] }), _jsx(SolidSwitch, { checked: !!draft.disabled, disabled: readOnly, onChange: function (checked) { return update({ disabled: checked || undefined }); } })] })) : null, _jsxs("div", { className: "workflow-node-editor-form-grid", children: [(authoring === null || authoring === void 0 ? void 0 : authoring.supportsTimeoutMs) ? (_jsxs("div", { className: "workflow-node-editor-field", children: [_jsx("label", { className: "workflow-node-editor-label", children: "Timeout (ms)" }), _jsx(SolidNumberInput, { value: draft.timeoutMs, disabled: readOnly, onChange: function (event) { var _a; return update({ timeoutMs: (_a = event.value) !== null && _a !== void 0 ? _a : undefined }); } })] })) : null, (authoring === null || authoring === void 0 ? void 0 : authoring.supportsOnError) ? (_jsxs("div", { className: "workflow-node-editor-field", children: [_jsx("label", { className: "workflow-node-editor-label", children: "On error" }), _jsx(SolidSelect, { value: (_b = draft.onError) !== null && _b !== void 0 ? _b : "fail", disabled: readOnly, options: [
|
|
1449
|
+
{ label: "Fail workflow", value: "fail" },
|
|
1450
|
+
{ label: "Continue", value: "continue" },
|
|
1451
|
+
], onChange: function (event) { return update({ onError: event.value }); } })] })) : null, (authoring === null || authoring === void 0 ? void 0 : authoring.supportsRetryPolicy) ? (_jsxs(_Fragment, { children: [_jsxs("div", { className: "workflow-node-editor-field", children: [_jsx("label", { className: "workflow-node-editor-label", children: "Max retries" }), _jsx(SolidNumberInput, { value: (_c = draft.retryPolicy) === null || _c === void 0 ? void 0 : _c.maxRetries, disabled: readOnly, onChange: function (event) {
|
|
1452
|
+
var _a, _b;
|
|
1453
|
+
return update({
|
|
1454
|
+
retryPolicy: __assign(__assign({}, ((_a = draft.retryPolicy) !== null && _a !== void 0 ? _a : {})), { maxRetries: (_b = event.value) !== null && _b !== void 0 ? _b : undefined }),
|
|
1455
|
+
});
|
|
1456
|
+
} })] }), _jsxs("div", { className: "workflow-node-editor-field", children: [_jsx("label", { className: "workflow-node-editor-label", children: "Retry delay (ms)" }), _jsx(SolidNumberInput, { value: (_d = draft.retryPolicy) === null || _d === void 0 ? void 0 : _d.delayMs, disabled: readOnly, onChange: function (event) {
|
|
1457
|
+
var _a, _b;
|
|
1458
|
+
return update({
|
|
1459
|
+
retryPolicy: __assign(__assign({}, ((_a = draft.retryPolicy) !== null && _a !== void 0 ? _a : {})), { delayMs: (_b = event.value) !== null && _b !== void 0 ? _b : undefined }),
|
|
1460
|
+
});
|
|
1461
|
+
} })] })] })) : null] })] }));
|
|
1462
|
+
}
|
|
1463
|
+
function WorkflowNodeChildSlotsSummary(_a) {
|
|
1464
|
+
var _b, _c;
|
|
1465
|
+
var nodeType = _a.nodeType, draft = _a.draft;
|
|
1466
|
+
var childSlots = (_c = (_b = nodeType.authoring) === null || _b === void 0 ? void 0 : _b.childSlots) !== null && _c !== void 0 ? _c : [];
|
|
1467
|
+
if (!childSlots.length) {
|
|
1468
|
+
return null;
|
|
1469
|
+
}
|
|
1470
|
+
return (_jsxs("section", { className: "workflow-node-editor-section workflow-node-editor-topology-summary", children: [_jsxs("div", { className: "workflow-node-editor-topology-guide", children: [_jsx("div", { className: "workflow-node-editor-topology-guide-icon", children: _jsx(Workflow, { size: 18 }) }), _jsxs("div", { className: "workflow-node-editor-topology-guide-copy", children: [_jsx("div", { className: "workflow-node-editor-topology-guide-title", children: "Add child nodes on the topology canvas" }), _jsxs("div", { className: "workflow-node-editor-topology-guide-text", children: ["Close this dialog, then use the", " ", _jsxs("span", { className: "workflow-node-editor-canvas-plus", children: [_jsx(Plus, { size: 12 }), "insert points"] }), " ", "inside this control node's child lanes."] })] })] }), _jsxs("div", { className: "workflow-node-editor-topology-steps", "aria-label": "How to add child nodes", children: [_jsxs("div", { className: "workflow-node-editor-topology-step", children: [_jsx("span", { className: "workflow-node-editor-topology-step-number", children: "1" }), _jsx("span", { children: "Select the compound node on the canvas." })] }), _jsxs("div", { className: "workflow-node-editor-topology-step", children: [_jsx("span", { className: "workflow-node-editor-topology-step-number", children: "2" }), _jsx("span", { children: "Close this editor when the node settings look right." })] }), _jsxs("div", { className: "workflow-node-editor-topology-step", children: [_jsx("span", { className: "workflow-node-editor-topology-step-number", children: "3" }), _jsx("span", { children: "Use the lane insert points to add or reorder children." })] })] }), _jsx("div", { className: "workflow-node-editor-slot-list", children: childSlots.map(function (slot) {
|
|
1471
|
+
var _a, _b, _c;
|
|
1472
|
+
var count = getSlotCount(draft, slot);
|
|
1473
|
+
var slotKindLabel = slot.kind === "case-collection"
|
|
1474
|
+
? "Branch cases"
|
|
1475
|
+
: slot.layout === "parallel"
|
|
1476
|
+
? "Parallel lane"
|
|
1477
|
+
: "Sequential lane";
|
|
1478
|
+
var limitLabel = slot.maxItems
|
|
1479
|
+
? "Up to ".concat(slot.maxItems)
|
|
1480
|
+
: slot.minItems
|
|
1481
|
+
? "At least ".concat(slot.minItems)
|
|
1482
|
+
: undefined;
|
|
1483
|
+
return (_jsxs("div", { className: "workflow-node-editor-slot-card", children: [_jsxs("div", { className: "workflow-node-editor-slot-header", children: [_jsxs("div", { className: "workflow-node-editor-slot-main", children: [_jsx("span", { className: "workflow-node-editor-slot-icon", children: _jsx(GitBranch, { size: 15 }) }), _jsxs("div", { className: "workflow-node-editor-slot-copy", children: [_jsxs("div", { className: "workflow-node-editor-slot-title-row", children: [_jsx("div", { className: "workflow-node-editor-slot-title", children: (_a = slot.label) !== null && _a !== void 0 ? _a : slot.key }), _jsx(SolidTag, { children: slotKindLabel }), slot.required ? _jsx(SolidTag, { children: "Required" }) : null, limitLabel ? _jsx(SolidTag, { children: limitLabel }) : null] }), _jsx("div", { className: "workflow-node-editor-description", children: (_b = slot.description) !== null && _b !== void 0 ? _b : "Use the topology canvas to add, reorder, or remove child nodes." })] })] }), _jsxs("div", { className: "workflow-node-editor-slot-count", children: [_jsx("strong", { children: count }), _jsx("span", { children: count === 1 ? "child" : "children" })] })] }), _jsxs("div", { className: "workflow-node-editor-slot-canvas-hint", children: [_jsx(Plus, { size: 13 }), "Canvas insert points add nodes to this ", (_c = slot.label) !== null && _c !== void 0 ? _c : slot.key, " lane."] })] }, slot.key));
|
|
1484
|
+
}) })] }));
|
|
1485
|
+
}
|
|
1486
|
+
function WorkflowNodeFullEditor(_a) {
|
|
1487
|
+
var _b, _c, _d, _e, _f;
|
|
1488
|
+
var nodeType = _a.nodeType, value = _a.value, onChange = _a.onChange, expressionSuggestions = _a.expressionSuggestions, readOnly = _a.readOnly;
|
|
1489
|
+
var configuration = (_b = value.configuration) !== null && _b !== void 0 ? _b : {};
|
|
1490
|
+
var _g = React.useState("basic"), activeTab = _g[0], setActiveTab = _g[1];
|
|
1491
|
+
var hasConfiguration = Boolean((_d = (_c = nodeType.authoring) === null || _c === void 0 ? void 0 : _c.configurationFields) === null || _d === void 0 ? void 0 : _d.length);
|
|
1492
|
+
var childSlots = (_f = (_e = nodeType.authoring) === null || _e === void 0 ? void 0 : _e.childSlots) !== null && _f !== void 0 ? _f : [];
|
|
1493
|
+
var tabs = [
|
|
1494
|
+
{
|
|
1495
|
+
value: "basic",
|
|
1496
|
+
label: "Basic Info",
|
|
1497
|
+
content: (_jsx(WorkflowNodeCommonFields, { nodeType: nodeType, draft: value, readOnly: readOnly, onChange: onChange })),
|
|
1498
|
+
},
|
|
1499
|
+
hasConfiguration
|
|
1500
|
+
? {
|
|
1501
|
+
value: "configuration",
|
|
1502
|
+
label: "Configuration",
|
|
1503
|
+
content: (_jsx(WorkflowNodeSchemaEditor, { nodeType: nodeType, value: configuration, expressionSuggestions: expressionSuggestions, readOnly: readOnly, onChange: function (nextConfiguration) {
|
|
1504
|
+
return onChange(__assign(__assign({}, value), { configuration: nextConfiguration }));
|
|
1505
|
+
} })),
|
|
1506
|
+
}
|
|
1507
|
+
: null,
|
|
1508
|
+
hasRuntimeFields(nodeType)
|
|
1509
|
+
? {
|
|
1510
|
+
value: "runtime",
|
|
1511
|
+
label: "Runtime",
|
|
1512
|
+
content: (_jsx(WorkflowNodeRuntimeFields, { nodeType: nodeType, draft: value, readOnly: readOnly, onChange: onChange })),
|
|
1513
|
+
}
|
|
1514
|
+
: null,
|
|
1515
|
+
childSlots.length
|
|
1516
|
+
? {
|
|
1517
|
+
value: "topology",
|
|
1518
|
+
label: "Topology",
|
|
1519
|
+
content: _jsx(WorkflowNodeChildSlotsSummary, { nodeType: nodeType, draft: value }),
|
|
1520
|
+
}
|
|
1521
|
+
: null,
|
|
1522
|
+
{
|
|
1523
|
+
value: "docs",
|
|
1524
|
+
label: "Docs",
|
|
1525
|
+
content: (_jsx(WorkflowNodeDocsPanel, { nodeType: nodeType, className: "workflow-node-editor-docs-panel" })),
|
|
1526
|
+
},
|
|
1527
|
+
].filter(Boolean);
|
|
1528
|
+
React.useEffect(function () {
|
|
1529
|
+
var _a, _b;
|
|
1530
|
+
if (!tabs.some(function (tab) { return tab.value === activeTab; })) {
|
|
1531
|
+
setActiveTab((_b = (_a = tabs[0]) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : "basic");
|
|
1532
|
+
}
|
|
1533
|
+
}, [activeTab, tabs]);
|
|
1534
|
+
return (_jsx(SolidTabGroup, { tabs: tabs, value: activeTab, onValueChange: setActiveTab, className: "workflow-node-editor-tabs", panelClassName: "workflow-node-editor-tab-panel" }));
|
|
1535
|
+
}
|
|
1536
|
+
export function WorkflowNodeEditorDialog(_a) {
|
|
1537
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
1538
|
+
var open = _a.open, onOpenChange = _a.onOpenChange, title = _a.title, nodeType = _a.nodeType, value = _a.value, onChange = _a.onChange, onSubmit = _a.onSubmit, expressionSuggestions = _a.expressionSuggestions, readOnly = _a.readOnly, nodeValue = _a.nodeValue, onNodeChange = _a.onNodeChange, onNodeSubmit = _a.onNodeSubmit;
|
|
1539
|
+
var _m = React.useState((_d = (_b = value !== null && value !== void 0 ? value : nodeValue === null || nodeValue === void 0 ? void 0 : nodeValue.configuration) !== null && _b !== void 0 ? _b : (_c = nodeType.authoring) === null || _c === void 0 ? void 0 : _c.defaultConfiguration) !== null && _d !== void 0 ? _d : {}), draft = _m[0], setDraft = _m[1];
|
|
1540
|
+
var _o = React.useState(nodeValue !== null && nodeValue !== void 0 ? nodeValue : {
|
|
1541
|
+
id: "",
|
|
1542
|
+
type: nodeType.type,
|
|
1543
|
+
kind: nodeType.kind,
|
|
1544
|
+
configuration: (_f = value !== null && value !== void 0 ? value : (_e = nodeType.authoring) === null || _e === void 0 ? void 0 : _e.defaultConfiguration) !== null && _f !== void 0 ? _f : {},
|
|
1545
|
+
}), nodeDraft = _o[0], setNodeDraft = _o[1];
|
|
1546
|
+
React.useEffect(function () {
|
|
1547
|
+
var _a, _b, _c, _d, _e;
|
|
1548
|
+
setDraft((_c = (_a = value !== null && value !== void 0 ? value : nodeValue === null || nodeValue === void 0 ? void 0 : nodeValue.configuration) !== null && _a !== void 0 ? _a : (_b = nodeType.authoring) === null || _b === void 0 ? void 0 : _b.defaultConfiguration) !== null && _c !== void 0 ? _c : {});
|
|
1549
|
+
setNodeDraft(nodeValue !== null && nodeValue !== void 0 ? nodeValue : {
|
|
1550
|
+
id: "",
|
|
1551
|
+
type: nodeType.type,
|
|
1552
|
+
kind: nodeType.kind,
|
|
1553
|
+
configuration: (_e = value !== null && value !== void 0 ? value : (_d = nodeType.authoring) === null || _d === void 0 ? void 0 : _d.defaultConfiguration) !== null && _e !== void 0 ? _e : {},
|
|
1554
|
+
});
|
|
1555
|
+
}, [nodeType, nodeValue, value, open]);
|
|
1556
|
+
var editorComponentKey = (_g = nodeType.ui) === null || _g === void 0 ? void 0 : _g.editorComponentKey;
|
|
1557
|
+
var CustomEditor = editorComponentKey ? getExtensionComponent(editorComponentKey) : null;
|
|
1558
|
+
var useCustomEditor = !!CustomEditor && ((_h = nodeType.ui) === null || _h === void 0 ? void 0 : _h.defaultEditorMode) === "custom";
|
|
1559
|
+
var isFullNodeMode = !!nodeValue || !!onNodeSubmit || !!onNodeChange;
|
|
1560
|
+
var dialogTitle = (_j = title !== null && title !== void 0 ? title : nodeType.label) !== null && _j !== void 0 ? _j : nodeType.type;
|
|
1561
|
+
var dialogSubtitle = isFullNodeMode
|
|
1562
|
+
? "Review the node details and configuration for this workflow step."
|
|
1563
|
+
: "Review the configuration fields for this workflow node.";
|
|
1564
|
+
var handleNodeChange = function (nextValue) {
|
|
1565
|
+
var _a;
|
|
1566
|
+
setNodeDraft(nextValue);
|
|
1567
|
+
setDraft((_a = nextValue.configuration) !== null && _a !== void 0 ? _a : {});
|
|
1568
|
+
onNodeChange === null || onNodeChange === void 0 ? void 0 : onNodeChange(nextValue);
|
|
1569
|
+
};
|
|
1570
|
+
return (_jsxs(SolidDialog, { open: open, onOpenChange: onOpenChange, header: _jsxs("div", { className: "workflow-node-editor-dialog-heading", children: [_jsx("div", { className: "workflow-node-editor-dialog-title", children: dialogTitle }), _jsx("div", { className: "workflow-node-editor-dialog-subtitle", children: dialogSubtitle }), _jsx(WorkflowNodeHeaderMeta, { nodeType: nodeType })] }), className: "solid-workflow-node-editor-dialog solid-workflow-node-editor-dialog--".concat((_l = (_k = nodeType.ui) === null || _k === void 0 ? void 0 : _k.modalSize) !== null && _l !== void 0 ? _l : "lg"), style: getWorkflowNodeEditorDialogStyle(nodeType), children: [_jsx(SolidDialogBody, { className: "workflow-node-editor-dialog-body", children: useCustomEditor ? (_jsx(CustomEditor, { nodeType: nodeType, value: isFullNodeMode ? nodeDraft : draft, nodeValue: nodeDraft, configuration: draft, onChange: isFullNodeMode ? handleNodeChange : setDraft, readOnly: readOnly })) : isFullNodeMode ? (_jsx(WorkflowNodeFullEditor, { nodeType: nodeType, value: nodeDraft, onChange: handleNodeChange, expressionSuggestions: expressionSuggestions, readOnly: readOnly })) : (_jsx(WorkflowNodeSchemaEditor, { className: "workflow-node-editor-standalone-config", nodeType: nodeType, value: draft, expressionSuggestions: expressionSuggestions, onChange: function (nextValue) {
|
|
1571
|
+
setDraft(nextValue);
|
|
1572
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(nextValue);
|
|
1573
|
+
}, onSubmit: function (nextValue) {
|
|
1574
|
+
setDraft(nextValue);
|
|
1575
|
+
onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit(nextValue);
|
|
1576
|
+
}, readOnly: readOnly })) }), !readOnly && (onSubmit || onNodeSubmit) ? (_jsxs(SolidDialogFooter, { className: "workflow-node-editor-dialog-footer", children: [_jsx(SolidButton, { variant: "secondary", onClick: function () { return onOpenChange(false); }, children: "Cancel" }), _jsx(SolidButton, { onClick: function () {
|
|
1577
|
+
if (isFullNodeMode) {
|
|
1578
|
+
onNodeSubmit === null || onNodeSubmit === void 0 ? void 0 : onNodeSubmit(nodeDraft);
|
|
1579
|
+
}
|
|
1580
|
+
else {
|
|
1581
|
+
onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit(draft);
|
|
1582
|
+
}
|
|
1583
|
+
}, children: "Save" })] })) : null] }));
|
|
1584
|
+
}
|
|
1585
|
+
export function WorkflowAddNodeDialog(_a) {
|
|
1586
|
+
var _b, _c;
|
|
1587
|
+
var open = _a.open, nodeTypes = _a.nodeTypes, expressionSuggestions = _a.expressionSuggestions, onOpenChange = _a.onOpenChange, createNodeValue = _a.createNodeValue, onSubmit = _a.onSubmit;
|
|
1588
|
+
var _d = React.useState("select"), step = _d[0], setStep = _d[1];
|
|
1589
|
+
var _e = React.useState(""), query = _e[0], setQuery = _e[1];
|
|
1590
|
+
var _f = React.useState(""), categoryFilter = _f[0], setCategoryFilter = _f[1];
|
|
1591
|
+
var _g = React.useState(""), subcategoryFilter = _g[0], setSubcategoryFilter = _g[1];
|
|
1592
|
+
var _h = React.useState(""), kindFilter = _h[0], setKindFilter = _h[1];
|
|
1593
|
+
var _j = React.useState(false), filtersOpen = _j[0], setFiltersOpen = _j[1];
|
|
1594
|
+
var _k = React.useState(""), selectedType = _k[0], setSelectedType = _k[1];
|
|
1595
|
+
var _l = React.useState(null), nodeDraft = _l[0], setNodeDraft = _l[1];
|
|
1596
|
+
React.useEffect(function () {
|
|
1597
|
+
if (!open) {
|
|
1598
|
+
setStep("select");
|
|
1599
|
+
setQuery("");
|
|
1600
|
+
setCategoryFilter("");
|
|
1601
|
+
setSubcategoryFilter("");
|
|
1602
|
+
setKindFilter("");
|
|
1603
|
+
setFiltersOpen(false);
|
|
1604
|
+
setSelectedType("");
|
|
1605
|
+
setNodeDraft(null);
|
|
1606
|
+
}
|
|
1607
|
+
}, [open]);
|
|
1608
|
+
var selectedNodeType = React.useMemo(function () { return nodeTypes.find(function (nodeType) { return nodeType.type === selectedType; }); }, [nodeTypes, selectedType]);
|
|
1609
|
+
var categoryOptions = React.useMemo(function () {
|
|
1610
|
+
return createSelectOptions(Array.from(new Set(nodeTypes.map(function (nodeType) { var _a; return (_a = nodeType.category) !== null && _a !== void 0 ? _a : ""; }).filter(Boolean))), "All categories");
|
|
1611
|
+
}, [nodeTypes]);
|
|
1612
|
+
var subcategoryOptions = React.useMemo(function () {
|
|
1613
|
+
var source = categoryFilter
|
|
1614
|
+
? nodeTypes.filter(function (nodeType) { return nodeType.category === categoryFilter; })
|
|
1615
|
+
: nodeTypes;
|
|
1616
|
+
return createSelectOptions(Array.from(new Set(source.map(function (nodeType) { var _a; return (_a = nodeType.subcategory) !== null && _a !== void 0 ? _a : ""; }).filter(Boolean))), "All subcategories");
|
|
1617
|
+
}, [categoryFilter, nodeTypes]);
|
|
1618
|
+
var kindOptions = React.useMemo(function () {
|
|
1619
|
+
return createSelectOptions(Array.from(new Set(nodeTypes.map(function (nodeType) { return nodeType.kind; }).filter(Boolean))), "All kinds");
|
|
1620
|
+
}, [nodeTypes]);
|
|
1621
|
+
React.useEffect(function () {
|
|
1622
|
+
if (subcategoryFilter &&
|
|
1623
|
+
!subcategoryOptions.some(function (option) { return option.value === subcategoryFilter; })) {
|
|
1624
|
+
setSubcategoryFilter("");
|
|
1625
|
+
}
|
|
1626
|
+
}, [subcategoryFilter, subcategoryOptions]);
|
|
1627
|
+
var filteredNodeTypes = React.useMemo(function () {
|
|
1628
|
+
var normalizedQuery = query.trim().toLowerCase();
|
|
1629
|
+
return nodeTypes.filter(function (nodeType) {
|
|
1630
|
+
if (categoryFilter && nodeType.category !== categoryFilter) {
|
|
1631
|
+
return false;
|
|
1632
|
+
}
|
|
1633
|
+
if (subcategoryFilter && nodeType.subcategory !== subcategoryFilter) {
|
|
1634
|
+
return false;
|
|
1635
|
+
}
|
|
1636
|
+
if (kindFilter && nodeType.kind !== kindFilter) {
|
|
1637
|
+
return false;
|
|
1638
|
+
}
|
|
1639
|
+
if (!normalizedQuery) {
|
|
1640
|
+
return true;
|
|
1641
|
+
}
|
|
1642
|
+
return getNodeTypeSearchText(nodeType).includes(normalizedQuery);
|
|
1643
|
+
});
|
|
1644
|
+
}, [
|
|
1645
|
+
categoryFilter,
|
|
1646
|
+
kindFilter,
|
|
1647
|
+
nodeTypes,
|
|
1648
|
+
query,
|
|
1649
|
+
subcategoryFilter,
|
|
1650
|
+
]);
|
|
1651
|
+
var groupedNodeTypes = React.useMemo(function () {
|
|
1652
|
+
var grouped = new Map();
|
|
1653
|
+
filteredNodeTypes.forEach(function (nodeType) {
|
|
1654
|
+
var _a, _b;
|
|
1655
|
+
var category = normalizeGroupLabel(nodeType.category, "Uncategorized");
|
|
1656
|
+
var subcategory = normalizeGroupLabel(nodeType.subcategory, "General");
|
|
1657
|
+
var categoryGroup = (_a = grouped.get(category)) !== null && _a !== void 0 ? _a : new Map();
|
|
1658
|
+
var subcategoryGroup = (_b = categoryGroup.get(subcategory)) !== null && _b !== void 0 ? _b : [];
|
|
1659
|
+
subcategoryGroup.push(nodeType);
|
|
1660
|
+
categoryGroup.set(subcategory, subcategoryGroup);
|
|
1661
|
+
grouped.set(category, categoryGroup);
|
|
1662
|
+
});
|
|
1663
|
+
return Array.from(grouped.entries())
|
|
1664
|
+
.sort(function (_a, _b) {
|
|
1665
|
+
var left = _a[0];
|
|
1666
|
+
var right = _b[0];
|
|
1667
|
+
return left.localeCompare(right);
|
|
1668
|
+
})
|
|
1669
|
+
.map(function (_a) {
|
|
1670
|
+
var category = _a[0], subcategories = _a[1];
|
|
1671
|
+
return ({
|
|
1672
|
+
category: category,
|
|
1673
|
+
subcategories: Array.from(subcategories.entries())
|
|
1674
|
+
.sort(function (_a, _b) {
|
|
1675
|
+
var left = _a[0];
|
|
1676
|
+
var right = _b[0];
|
|
1677
|
+
return left.localeCompare(right);
|
|
1678
|
+
})
|
|
1679
|
+
.map(function (_a) {
|
|
1680
|
+
var subcategory = _a[0], nodes = _a[1];
|
|
1681
|
+
return ({
|
|
1682
|
+
subcategory: subcategory,
|
|
1683
|
+
nodes: nodes.sort(function (left, right) { var _a, _b; return ((_a = left.label) !== null && _a !== void 0 ? _a : left.type).localeCompare((_b = right.label) !== null && _b !== void 0 ? _b : right.type); }),
|
|
1684
|
+
});
|
|
1685
|
+
}),
|
|
1686
|
+
});
|
|
1687
|
+
});
|
|
1688
|
+
}, [filteredNodeTypes]);
|
|
1689
|
+
var goToConfigureStep = function (nodeType) {
|
|
1690
|
+
if (nodeType === void 0) { nodeType = selectedNodeType; }
|
|
1691
|
+
if (!nodeType) {
|
|
1692
|
+
return;
|
|
1693
|
+
}
|
|
1694
|
+
setSelectedType(nodeType.type);
|
|
1695
|
+
setNodeDraft(createNodeValue(nodeType));
|
|
1696
|
+
setStep("configure");
|
|
1697
|
+
};
|
|
1698
|
+
var handleSubmit = function () {
|
|
1699
|
+
if (!nodeDraft) {
|
|
1700
|
+
return;
|
|
1701
|
+
}
|
|
1702
|
+
onSubmit(nodeDraft);
|
|
1703
|
+
onOpenChange(false);
|
|
1704
|
+
};
|
|
1705
|
+
var header = (_jsxs("div", { className: "workflow-node-editor-dialog-heading", children: [_jsx("div", { className: "workflow-node-editor-dialog-title", children: step === "select" ? "Add Node" : "Configure ".concat((_c = (_b = selectedNodeType === null || selectedNodeType === void 0 ? void 0 : selectedNodeType.label) !== null && _b !== void 0 ? _b : selectedNodeType === null || selectedNodeType === void 0 ? void 0 : selectedNodeType.type) !== null && _c !== void 0 ? _c : "Node") }), _jsx("div", { className: "workflow-node-editor-dialog-subtitle", children: step === "select"
|
|
1706
|
+
? "Choose the workflow node type to insert at this point in the flow."
|
|
1707
|
+
: "Review the node details and configuration before adding it to the workflow." }), selectedNodeType ? _jsx(WorkflowNodeHeaderMeta, { nodeType: selectedNodeType }) : null] }));
|
|
1708
|
+
return (_jsxs(SolidDialog, { open: open, onOpenChange: onOpenChange, header: header, className: "solid-workflow-node-editor-dialog solid-workflow-add-node-dialog", style: { width: "min(1040px, 94vw)", maxWidth: "96vw" }, children: [_jsx(SolidDialogBody, { className: "workflow-node-editor-dialog-body workflow-add-node-dialog-body", children: step === "select" ? (_jsxs("div", { className: "workflow-add-node-picker", children: [_jsxs("div", { className: "workflow-add-node-search-row", children: [_jsxs("div", { className: "workflow-add-node-search", children: [_jsx(Search, { size: 15 }), _jsx(SolidInput, { value: query, onChange: function (event) { return setQuery(event.target.value); }, placeholder: "Search node types" }), _jsx("button", { type: "button", className: "workflow-add-node-search-action ".concat(filtersOpen ? "is-active" : ""), "aria-label": filtersOpen ? "Hide filters" : "Show filters", title: filtersOpen ? "Hide filters" : "Show filters", onClick: function () { return setFiltersOpen(function (current) { return !current; }); }, children: _jsx(Filter, { size: 14 }) }), _jsx("button", { type: "button", className: "workflow-add-node-search-action", "aria-label": "Clear search", title: "Clear search", disabled: !query, onClick: function () { return setQuery(""); }, children: _jsx(X, { size: 14 }) })] }), filtersOpen ? (_jsxs("div", { className: "workflow-add-node-filters", children: [_jsx(SolidSelect, { value: categoryFilter, options: categoryOptions, onChange: function (event) { var _a; return setCategoryFilter((_a = event.value) !== null && _a !== void 0 ? _a : ""); } }), _jsx(SolidSelect, { value: subcategoryFilter, options: subcategoryOptions, onChange: function (event) { var _a; return setSubcategoryFilter((_a = event.value) !== null && _a !== void 0 ? _a : ""); } }), _jsx(SolidSelect, { value: kindFilter, options: kindOptions, onChange: function (event) { var _a; return setKindFilter((_a = event.value) !== null && _a !== void 0 ? _a : ""); } })] })) : null] }), _jsx("div", { className: "workflow-add-node-results", children: groupedNodeTypes.length ? (groupedNodeTypes.map(function (categoryGroup) { return (_jsxs("section", { className: "workflow-add-node-category", children: [_jsx("div", { className: "workflow-add-node-category-title", children: categoryGroup.category }), _jsx("div", { className: "workflow-add-node-subcategory-list", children: categoryGroup.subcategories.map(function (subcategoryGroup) { return (_jsxs("div", { className: "workflow-add-node-subcategory", children: [_jsx("div", { className: "workflow-add-node-subcategory-title", children: subcategoryGroup.subcategory }), _jsx("div", { className: "workflow-add-node-grid", children: subcategoryGroup.nodes.map(function (nodeType) {
|
|
1709
|
+
var _a, _b;
|
|
1710
|
+
return (_jsxs("button", { type: "button", className: "workflow-add-node-card ".concat(selectedType === nodeType.type ? "is-active" : ""), onClick: function () { return goToConfigureStep(nodeType); }, children: [_jsx("span", { className: "workflow-add-node-card-icon workflow-add-node-card-icon--".concat(nodeType.kind), style: getWorkflowNodeIconStyle(nodeType), children: _jsx(WorkflowNodeTypeIcon, { nodeType: nodeType }) }), _jsxs("span", { className: "workflow-add-node-card-copy", children: [_jsx("span", { className: "workflow-add-node-card-title", children: (_a = nodeType.label) !== null && _a !== void 0 ? _a : nodeType.type }), _jsx("span", { className: "workflow-add-node-card-description", children: (_b = nodeType.description) !== null && _b !== void 0 ? _b : nodeType.type })] })] }, nodeType.type));
|
|
1711
|
+
}) })] }, "".concat(categoryGroup.category, "-").concat(subcategoryGroup.subcategory))); }) })] }, categoryGroup.category)); })) : (_jsx("div", { className: "workflow-node-editor-empty", children: "No node types match the current search and filters." })) })] })) : selectedNodeType && nodeDraft ? (_jsx(WorkflowNodeFullEditor, { nodeType: selectedNodeType, value: nodeDraft, onChange: setNodeDraft, expressionSuggestions: expressionSuggestions })) : null }), _jsx(SolidDialogFooter, { className: "workflow-node-editor-dialog-footer", children: step === "select" ? (_jsx(SolidButton, { variant: "secondary", onClick: function () { return onOpenChange(false); }, children: "Cancel" })) : (_jsxs(_Fragment, { children: [_jsx(SolidButton, { variant: "secondary", leftIcon: _jsx(ArrowLeft, { size: 14 }), onClick: function () { return setStep("select"); }, children: "Back" }), _jsx(SolidButton, { onClick: handleSubmit, children: "Add Node" })] })) })] }));
|
|
1712
|
+
}
|
|
1713
|
+
export function WorkflowNodePalette(_a) {
|
|
1714
|
+
var nodeTypes = _a.nodeTypes, value = _a.value, onSelect = _a.onSelect, className = _a.className;
|
|
1715
|
+
var _b = React.useState(""), query = _b[0], setQuery = _b[1];
|
|
1716
|
+
var filteredNodeTypes = nodeTypes.filter(function (nodeType) {
|
|
1717
|
+
var _a, _b, _c;
|
|
1718
|
+
var haystack = __spreadArray(__spreadArray([
|
|
1719
|
+
nodeType.type,
|
|
1720
|
+
nodeType.label,
|
|
1721
|
+
nodeType.description,
|
|
1722
|
+
nodeType.category,
|
|
1723
|
+
nodeType.subcategory
|
|
1724
|
+
], ((_a = nodeType.tags) !== null && _a !== void 0 ? _a : []), true), ((_c = (_b = nodeType.authoring) === null || _b === void 0 ? void 0 : _b.searchableText) !== null && _c !== void 0 ? _c : []), true).filter(Boolean)
|
|
1725
|
+
.join(" ")
|
|
1726
|
+
.toLowerCase();
|
|
1727
|
+
return haystack.includes(query.trim().toLowerCase());
|
|
1728
|
+
});
|
|
1729
|
+
return (_jsxs("div", { className: className, style: { display: "grid", gap: "1rem" }, children: [_jsx(SolidInput, { value: query, onChange: function (event) { return setQuery(event.target.value); }, placeholder: "Search node types" }), _jsx("div", { style: { display: "grid", gap: "0.75rem" }, children: filteredNodeTypes.map(function (nodeType) {
|
|
1730
|
+
var _a;
|
|
1731
|
+
return (_jsxs("button", { type: "button", onClick: function () { return onSelect === null || onSelect === void 0 ? void 0 : onSelect(nodeType); }, style: {
|
|
1732
|
+
textAlign: "left",
|
|
1733
|
+
border: value === nodeType.type
|
|
1734
|
+
? "1px solid var(--primary-color, #2563eb)"
|
|
1735
|
+
: "1px solid var(--surface-border, #e5e7eb)",
|
|
1736
|
+
borderRadius: "0.75rem",
|
|
1737
|
+
padding: "0.9rem 1rem",
|
|
1738
|
+
background: "var(--surface-card, #fff)",
|
|
1739
|
+
display: "grid",
|
|
1740
|
+
gap: "0.5rem",
|
|
1741
|
+
cursor: "pointer",
|
|
1742
|
+
}, children: [_jsxs("div", { style: { display: "flex", gap: "0.5rem", alignItems: "center", flexWrap: "wrap" }, children: [_jsx("strong", { children: (_a = nodeType.label) !== null && _a !== void 0 ? _a : nodeType.type }), nodeType.category ? _jsx(SolidTag, { children: nodeType.category }) : null, _jsx(SolidTag, { children: nodeType.kind })] }), nodeType.description ? (_jsx("div", { style: { opacity: 0.8 }, children: nodeType.description })) : null] }, nodeType.type));
|
|
1743
|
+
}) })] }));
|
|
1744
|
+
}
|
|
1745
|
+
//# sourceMappingURL=WorkflowNodeSchemaEditor.js.map
|