@fluidgrids/fe-sdk 0.0.0-stage → 2026.1203.7
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/README.md +564 -2
- package/dist/ActivityOptionsFields-C2u-hY2U.js +142 -0
- package/dist/AiStudioPage-B_hNTj-_.js +1137 -0
- package/dist/ApprovalInboxPage-ClITra3n.js +1312 -0
- package/dist/ChoiceSelect-LkK-uS9J.js +65 -0
- package/dist/ConfirmActionDialog-DHWTDRbp.js +31 -0
- package/dist/ConnectionFormDialog-C0kDgcrZ.js +153 -0
- package/dist/CreateFluidgridsTagDocument-Dtp9KPLJ.js +1055 -0
- package/dist/DataSinkDashboardPage-b4ezeqa6.js +278 -0
- package/dist/DataTablesPage-C1d9YGHz.js +5575 -0
- package/dist/DateTimeField-B1qR4ruo.js +51 -0
- package/dist/Disclosure-BNKij7-v.js +45 -0
- package/dist/ElementLibraryPage-8jNO6YmE.js +2256 -0
- package/dist/ElementLibrarySequenceDocument-B-W8SPzn.js +3979 -0
- package/dist/EnsureThemeProvider-BvlNjAd0.js +24 -0
- package/dist/EntityTagBadge-1OlP6p0c.js +25 -0
- package/dist/EntityTagPicker-BBrU5cE0.js +137 -0
- package/dist/ExecuteStepDocument-B4j1mdRT.js +189 -0
- package/dist/ExecutionDetailDocument-D6QuM-kp.js +875 -0
- package/dist/ExecutionDetailPage-D4CBtFdo.js +12217 -0
- package/dist/ExecutionDetailPage-DvQ667OE.d.ts +10 -0
- package/dist/ExecutionStatusBadge-BsDVor9t.js +221 -0
- package/dist/ExecutionsListDocument-Dan7ZiqB.js +459 -0
- package/dist/ExecutionsListPage-B3XT8ITL.js +4307 -0
- package/dist/FailureTriagePanel-DOJMaJ0n.js +1285 -0
- package/dist/FileDownloadUrlDocument-CVOYKcL5.js +92 -0
- package/dist/FluidGridsDocsLink-bX0Hnhxr.js +66 -0
- package/dist/FluidGridsMark-CE2blT7K.js +74 -0
- package/dist/HeldLoadRegion-BtTxbvOW.js +34 -0
- package/dist/HistoryPage-BLoRpJ1R.d.ts +6 -0
- package/dist/HistoryPage-BSBISXoj.js +2835 -0
- package/dist/Icon-BtQ0HXLh.js +160 -0
- package/dist/InsightsPage-D7ybj8N9.js +11245 -0
- package/dist/IsolationSetting-vy911E8b.js +1153 -0
- package/dist/LibraryParts-DOeNgR8A.js +413 -0
- package/dist/ManagedAiPolicyAuthority-BxwJ3ptd.js +40 -0
- package/dist/ManagedAiPolicyAuthority-DM3t3wNr.d.ts +18 -0
- package/dist/ManagedAiPolicyAuthorityContext-CNkxIOZ1.js +10 -0
- package/dist/McpTriggerServers-BCPCAOWB.js +459 -0
- package/dist/MissingNodesInstallModal-rO_SEDrC.js +224 -0
- package/dist/NavigationV2Provider-DCDt35eG.js +17 -0
- package/dist/NodeSchemaIntrospectionDocument-C1vAIcHd.js +95 -0
- package/dist/NodesPage-DEbnz9iU.d.ts +6 -0
- package/dist/NodesPage-O7KeeKtd.js +653 -0
- package/dist/OfflineIcon-TwMKYWjA.js +207 -0
- package/dist/OpenTemplateAsCodeButton-BhWJWIF3.js +94 -0
- package/dist/PaidTemplateConfirm-_G3ag6S4.js +28 -0
- package/dist/PublishCustomNodeAction-CIySbK4c.js +134 -0
- package/dist/RecordTaskDialog-BkpCDvhR.js +2078 -0
- package/dist/RunActionsMenu-DodOgIQm.js +59 -0
- package/dist/RunnerStatusPill-C1v967iq.js +24 -0
- package/dist/RunnersPage-dB0RSdY_.js +1929 -0
- package/dist/SandboxRuntimeExhaustedNotice-BFOIF93C.js +120 -0
- package/dist/SchedulesPage-DPWr1yvf.js +1607 -0
- package/dist/SearchBox-BGtYjvfs.js +49 -0
- package/dist/SequenceEditor-CFiHeHkR.js +497 -0
- package/dist/SettingsPage-0CQBNPZV.js +8695 -0
- package/dist/StewardPages-DAJhepen.js +47 -0
- package/dist/StewardRunImportPanel-Kva2DO0u.js +2844 -0
- package/dist/StoreTemplateCardCompact-CHn5kP7A.js +2166 -0
- package/dist/TagFilterSelect-CyA8QrS7.js +42 -0
- package/dist/TaskQueuesPage-DdnDCyat.js +3571 -0
- package/dist/TechnicalDetails-B0Oi4aZw.js +19 -0
- package/dist/TemplateConfigurationModal-CdvCYJLM.js +332 -0
- package/dist/TemplateDetailPanel-CbiKciuB.js +222 -0
- package/dist/TemplatePreview-cx7-NOeG.js +868 -0
- package/dist/TemplatesPage-BG3H-6v6.d.ts +10 -0
- package/dist/TemplatesPage-BVQpGYIV.js +3251 -0
- package/dist/TerminateExecutionDocument-B_HKNVrN.js +581 -0
- package/dist/TranslationBridge-Bd4aJKMs.d.ts +11 -0
- package/dist/TranslationBridge-Da-TPgQm.js +68 -0
- package/dist/TriggerWorkflowDocument-D9Km2Vv2.js +460 -0
- package/dist/UiSequencePickerSequenceDocument-BSYnSDV7.js +607 -0
- package/dist/UiStepScreenshot-Qh4QMyUp.js +146 -0
- package/dist/UsageTimeSeriesDocument-DcInx9-z.js +177 -0
- package/dist/VariablesPage-ChfGuW22.js +2243 -0
- package/dist/VersionDiffDialog-Bd2AeUwf.js +1702 -0
- package/dist/VersionLifecycleBar-BBeWVtz-.js +143 -0
- package/dist/WebhookDeliveriesPage-D66bua0j.js +1563 -0
- package/dist/WorkflowBuilder-B6wQD1TK.js +539 -0
- package/dist/WorkflowBuilder-DR4ku8Tr.js +1611 -0
- package/dist/WorkflowDefinitionDocument-DZLbTPUZ.js +321 -0
- package/dist/WorkflowEmbed-BXfFGy0i.js +708 -0
- package/dist/WorkflowEmbed-Cbqe1s1z.d.ts +6 -0
- package/dist/WorkflowPinnedDataDocument-BODT5omd.js +782 -0
- package/dist/WorkflowProposalCard-BruukdeF.js +96 -0
- package/dist/WorkflowProposalDocument-BdUbsrd0.js +620 -0
- package/dist/WorkflowSearchRedirect-C7zJ2MKH.js +40 -0
- package/dist/WorkflowSettingsDrawer-MVU1BKfY.d.ts +18 -0
- package/dist/WorkflowSettingsDrawer-gazs97WR.js +196 -0
- package/dist/WorkflowShareDialog-e8jJtLjU.js +469 -0
- package/dist/WorkflowVersionsDocument-DRVOp8Uj.js +3213 -0
- package/dist/WorkflowsList--hR2_8gf.js +4593 -0
- package/dist/WorkflowsList-CcNDQge5.d.ts +6 -0
- package/dist/WorkflowsListPageDocument-CnzcQm_o.js +934 -0
- package/dist/addonCatalog-CbZS4deh.js +58 -0
- package/dist/addonCatalog-sjlonAmR.d.ts +15 -0
- package/dist/addons.d.ts +3 -0
- package/dist/addons.js +4 -0
- package/dist/agent-form-Bfvm32j1.js +83 -0
- package/dist/agent-tools.d.ts +3 -0
- package/dist/agent-tools.js +5 -0
- package/dist/agentTools-CyL7DLOF.js +320 -0
- package/dist/ai-usage-BrxDgvdR.js +240 -0
- package/dist/aiCreditsBridge-BuE92tKo.js +49 -0
- package/dist/api-BKq-nIOZ.js +2286 -0
- package/dist/api-Ol7I8NxE.js +8289 -0
- package/dist/apollo-type-policies.d.ts +11 -0
- package/dist/apollo-type-policies.js +64 -0
- package/dist/askAboutBridge-ByYsQams.js +106 -0
- package/dist/askQuestions-Cmx7VnMm.js +742 -0
- package/dist/assert-rules-lfYEMc99.js +318 -0
- package/dist/assistant.d.ts +94 -0
- package/dist/assistant.js +99 -0
- package/dist/attach-node-helpers-HDKQOtrD.js +32 -0
- package/dist/badge-CXfPhoMH.js +26 -0
- package/dist/basil.generated-BK-EHbwN.js +10 -0
- package/dist/browser-steps-DMpS5TyB.js +533 -0
- package/dist/builderTimings-pvGnK1m-.js +510 -0
- package/dist/button-DG7y_FVJ.js +48 -0
- package/dist/canvasNoteTools-BxuP_AYO.js +137 -0
- package/dist/card-Bomy_1UG.js +44 -0
- package/dist/catalogGrid-BOrfMgi-.js +41 -0
- package/dist/channel-CPyQ1NR1.js +212 -0
- package/dist/chips-CvNrYJZa.js +27 -0
- package/dist/client-holder-C0M5Cfwl.js +68 -0
- package/dist/cn-QqidFIgr.js +10 -0
- package/dist/code-editor-diagnostics-Zr0cIcx1.js +46 -0
- package/dist/code-editor-field-x_JrY8KR.js +113 -0
- package/dist/codec-client-DPuD6mw7.js +515 -0
- package/dist/conditionBuilder-DwfEF0Q-.js +1144 -0
- package/dist/config-DO68jw5k.js +322 -0
- package/dist/constants-DgbVc24O.d.ts +296 -0
- package/dist/constants-DlRnHBfQ.js +217 -0
- package/dist/convert-browser-action-pfecelF7.js +347 -0
- package/dist/convert-dialog-B_o22NiJ.js +382 -0
- package/dist/create-workflow-first-Azg3JUdX.js +120 -0
- package/dist/definition-canvas-Bsda-rDT.js +31 -0
- package/dist/dialog-BVd152GS.js +94 -0
- package/dist/durable-nodes-BXyYCLxT.js +91 -0
- package/dist/duration-CDb7-mT_.js +33 -0
- package/dist/edge-mapper-wEAdGVU2.js +4477 -0
- package/dist/element-library-DkSlg_VE.js +727 -0
- package/dist/entities-I_0kio3q.js +38 -0
- package/dist/error-advice-QLr5NCm7.js +65 -0
- package/dist/errors-ClKb5sEt.js +188 -0
- package/dist/executions.d.ts +3 -0
- package/dist/executions.js +5 -0
- package/dist/feature-flags-B2qetXKd.js +385 -0
- package/dist/field-label-DPZRmE_B.js +153 -0
- package/dist/firstWorkflow-C_h0KMB2.js +133 -0
- package/dist/flags.d.ts +3 -0
- package/dist/flags.js +4 -0
- package/dist/flow-builder-DIvLOhz0.js +28038 -0
- package/dist/flow-store-holder-CUN7Terz.js +52 -0
- package/dist/fluent.generated-CA_e6-4l.js +14 -0
- package/dist/fluidgridsEvents-bbEQbwU6.js +175 -0
- package/dist/fluidgridsTheme-DUhvOgoy.js +297 -0
- package/dist/global-client-BQPuFrFa.js +433 -0
- package/dist/global-operations-BG6YgxrM.js +136 -0
- package/dist/graphql-types-UTYtujY9.js +21358 -0
- package/dist/history.d.ts +3 -0
- package/dist/history.js +4 -0
- package/dist/index-AoJAa5vU.d.ts +164958 -0
- package/dist/index-DEMT3iAM.d.ts +120 -0
- package/dist/index-ROZzNGyY.d.ts +76 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.js +8123 -0
- package/dist/ion.generated-mbajjcAg.js +10 -0
- package/dist/label-Lzb8ZXf_.js +29 -0
- package/dist/labels-rXd9gYQz.js +1236 -0
- package/dist/liveCanvas-D5ytXDp8.js +103 -0
- package/dist/logos.generated-X6_0kjVR.js +21 -0
- package/dist/logs-panel-Cw0DkG0l.js +468 -0
- package/dist/lucide.generated-B6NVd3GT.js +29 -0
- package/dist/marksStore-a9oIMMot.js +175 -0
- package/dist/mcp-trigger-D0nRdvq5.js +307 -0
- package/dist/mdi.generated-D1BV74d6.js +292 -0
- package/dist/menus-CU3hDGYl.js +160 -0
- package/dist/mynaui.generated-DMWr5cXz.js +66 -0
- package/dist/navigation-v2.d.ts +3 -0
- package/dist/navigation-v2.js +5 -0
- package/dist/node-detail-view-Cgm5H1P-.js +1372 -0
- package/dist/node-editor-tab-body-CZ0fVuVP.js +187 -0
- package/dist/node-operation-selection-CdV3KI_V.js +3534 -0
- package/dist/node-registry-refresh-s3okf83X.js +27 -0
- package/dist/node-role-TMbnkmeP.js +132 -0
- package/dist/node-type-icon-BZa8n4iG.js +33 -0
- package/dist/nodes.d.ts +3 -0
- package/dist/nodes.js +4 -0
- package/dist/notesKey-5EaREBGA.js +12 -0
- package/dist/observability.d.ts +3 -0
- package/dist/observability.js +5 -0
- package/dist/offset-pages-zghoClB3.js +55 -0
- package/dist/operations-BBmT9ToP.js +663 -0
- package/dist/operations-WxRJWeqO.js +3133 -0
- package/dist/output-files-Ba8bu5lv.js +196 -0
- package/dist/page-operation-DrWuhd6Y.js +129 -0
- package/dist/page-twins.d.ts +13 -0
- package/dist/page-twins.js +186 -0
- package/dist/pageControlSpecs-DZJ9K37m.js +134 -0
- package/dist/pageControlsBridge-0pX9s-3k.js +54 -0
- package/dist/pageControlsBridge-DAuT3w7L.d.ts +36 -0
- package/dist/panels-PfBBAToE.js +346 -0
- package/dist/parts-B7fBcw-B.js +346 -0
- package/dist/popover-Dms9Vz3j.js +3389 -0
- package/dist/preloadable-lazy-Pp47mqQ9.js +65 -0
- package/dist/proactive.d.ts +66 -0
- package/dist/proactive.js +237 -0
- package/dist/quick-config-panel-DFd77xho.js +451 -0
- package/dist/quota-DeA_CJ2e.js +175 -0
- package/dist/quota.d.ts +3 -0
- package/dist/quota.js +4 -0
- package/dist/read-only-context-Dt9N9SIG.js +18 -0
- package/dist/relative-time-Dxt8ZIIu.js +55 -0
- package/dist/results-CwK_yDxK.js +325 -0
- package/dist/rolldown-runtime-hDbaFkMy.js +18 -0
- package/dist/route-data.d.ts +12 -0
- package/dist/route-data.js +69 -0
- package/dist/route-match-C-0_EnAt.d.ts +5 -0
- package/dist/route-match-DMkUICYV.js +41 -0
- package/dist/route-preload-C4DlGoCd.js +120 -0
- package/dist/run-display-UjLAoYqQ.js +81 -0
- package/dist/run-history-arGiHzGU.js +285 -0
- package/dist/run-list-links-DJn4Mf1T.js +98 -0
- package/dist/run-mode-USmM0-Uo.js +82 -0
- package/dist/run-parity-CWXqEJqM.js +144 -0
- package/dist/runsQuota-B6SyTbne.js +100 -0
- package/dist/runsQuota-DsniKiSg.d.ts +20 -0
- package/dist/safe-expression-Cw7-SCsm.js +1251 -0
- package/dist/save-status-store-C7nEYpfb.js +631 -0
- package/dist/schedule-panel-B4GYXzXQ.js +13774 -0
- package/dist/schedule-rules-ggVKRkBH.js +358 -0
- package/dist/secrets-Re_wSiE3.js +153 -0
- package/dist/settings.d.ts +4 -0
- package/dist/settings.js +6 -0
- package/dist/shared-DAWGGMSM.js +177 -0
- package/dist/sidebar-node-editor-6eSSgCzc.js +178 -0
- package/dist/solar.generated-CGYuUQAC.js +10 -0
- package/dist/stableTabbedDialog-BBhrfXGe.js +20 -0
- package/dist/start-url-CT6Yz96K.js +24 -0
- package/dist/status-CessxGpm.js +55 -0
- package/dist/store-icon-OctYp5zP.js +155 -0
- package/dist/styles-WGmTnZ2n.js +26 -0
- package/dist/styles.css +139 -0
- package/dist/svg-spinners.generated-CIPT7IhM.js +10 -0
- package/dist/template-code-CzN6JWNV.js +191 -0
- package/dist/template-graph-DLF9dygU.js +20 -0
- package/dist/template-preview-DcIIKOOL.js +32 -0
- package/dist/template-price-CdUHZRMF.js +40 -0
- package/dist/templates.d.ts +3 -0
- package/dist/templates.js +5 -0
- package/dist/theme-provider-CntfC4_i.js +23 -0
- package/dist/transient-DgZfhDfN.js +57 -0
- package/dist/typed-calls-C5tO03wq.js +26 -0
- package/dist/ui-script-By74Guk3.js +1094 -0
- package/dist/ui-script-editor-CqPu2bCN.js +2447 -0
- package/dist/ui-step-fix-8uM2_Hft.js +67 -0
- package/dist/ui-step-fix-store-CcO1FdRx.js +19 -0
- package/dist/ui-step-run-context-o7bLE6KP.js +46 -0
- package/dist/ui-target-editor-D2JhB_lD.js +673 -0
- package/dist/uiMarkTools-CSznnO1i.js +1054 -0
- package/dist/upgradePrompt-BAFBKKW5.js +72 -0
- package/dist/use-bare-node-registry-O6mKJO_n.js +11498 -0
- package/dist/use-browser-available-hj8wc3Kb.js +241 -0
- package/dist/use-edge-mapper-schemas-Bonofxow.js +496 -0
- package/dist/use-extension-bridge-B9ZreOkQ.js +608 -0
- package/dist/use-mobile-BTqCUjzS.js +27 -0
- package/dist/use-sdk-query-C697xZVv.js +116 -0
- package/dist/use-workflow-code-editor-CFoRFrZ5.js +753 -0
- package/dist/useActionParam-B2tU2BlY.js +85 -0
- package/dist/useAgentTokenStream-Bko_J0d0.js +4217 -0
- package/dist/useBrowserClients-3v95-gSh.js +103 -0
- package/dist/useCodeWorkflowInsights-w0tz9Ap_.js +600 -0
- package/dist/useConnections-DsgEJs05.js +439 -0
- package/dist/useDebouncedValue-BFekcv6n.js +18 -0
- package/dist/useDurableParity-8fnMZmBc.js +1787 -0
- package/dist/useEntityTags-D0spL6Ut.js +460 -0
- package/dist/useExecutions-2u5nGJJk.js +681 -0
- package/dist/useFluidGridsAnalytics-VM8lAi2x.js +238 -0
- package/dist/useGlobalStoreClient-BTdhkA2I.js +24 -0
- package/dist/useHumanRequests-zlYDp3l1.js +221 -0
- package/dist/useNavigationV2-C2WeqN7d.js +29 -0
- package/dist/useNavigationV2-DANUmg12.d.ts +9 -0
- package/dist/useObservability-BRlQ0tOA.js +285 -0
- package/dist/useRequestedProposal-B7uPXfZB.js +51 -0
- package/dist/useRunHistory-CXCMUPyf.js +2759 -0
- package/dist/useRunLive-D0JvVZT2.js +1060 -0
- package/dist/useRunnerList-Dbi59i1K.js +446 -0
- package/dist/useRunners-URUc5quU.js +173 -0
- package/dist/useRunsPage-DG656UCK.js +2709 -0
- package/dist/useVariables-BIelxcWr.js +463 -0
- package/dist/useVersionHistoryData-CTjqVw7l.js +292 -0
- package/dist/useWorkflowCodeExport-pqxyLHD1.js +522 -0
- package/dist/useWorkflowListExport-hcZNvTaB.js +232 -0
- package/dist/useWorkflowOrganization-CpBbOrs7.js +1772 -0
- package/dist/useWorkflowProposal-BH0VdNMA.js +3280 -0
- package/dist/useWorkflows-Cvg-Z_IE.js +1606 -0
- package/dist/utils-fvBb5qOD.js +89 -0
- package/dist/webhook-deliveries-AvQujaZy.js +99 -0
- package/dist/workflow-builder-CJygVkVv.d.ts +2 -0
- package/dist/workflow-builder.d.ts +3 -0
- package/dist/workflow-builder.js +8 -0
- package/dist/workflow-code-transfer-Bsy0JKAZ.js +323 -0
- package/dist/workflow-embed.d.ts +3 -0
- package/dist/workflow-embed.js +4 -0
- package/dist/workflow-git-sync--K9ZsPDC.js +263 -0
- package/dist/workflow-host.d.ts +6 -0
- package/dist/workflow-host.js +11 -0
- package/dist/workflow-pages-D-7ByLTB.d.ts +68 -0
- package/dist/workflow-pages.d.ts +3 -0
- package/dist/workflow-pages.js +115 -0
- package/dist/workflow-preview-canvas-CO8yzdE3.js +848 -0
- package/dist/workflow-preview.d.ts +65 -0
- package/dist/workflow-preview.js +4 -0
- package/dist/workflow-route.d.ts +33 -0
- package/dist/workflow-route.js +4 -0
- package/dist/workflow-save-state-D0l-DkLf.js +767 -0
- package/dist/workflow-transfer-CQnQC-ke.js +104 -0
- package/dist/workflowRouteData-BkfVOc-O.js +169 -0
- package/dist/workflows-list.d.ts +10 -0
- package/dist/workflows-list.js +5 -0
- package/package.json +320 -4
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { t as cn } from "./cn-QqidFIgr.js";
|
|
3
|
+
import { r as useTr } from "./TranslationBridge-Da-TPgQm.js";
|
|
4
|
+
import { t as CONTROL_RING } from "./styles-WGmTnZ2n.js";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { Search, X } from "lucide-react";
|
|
7
|
+
import { Input } from "@burdenoff/fe-libs/ui";
|
|
8
|
+
|
|
9
|
+
// src/components/moreTools/SearchBox.tsx
|
|
10
|
+
/**
|
|
11
|
+
* The search box above a More tools list (BOFF-15502), as on the Templates
|
|
12
|
+
* page: a search icon, the field, and a Clear button once something is typed.
|
|
13
|
+
*/
|
|
14
|
+
function SearchBox({ value, onChange, placeholder, disabled, className, testId = "more-tools-search" }) {
|
|
15
|
+
const tr = useTr();
|
|
16
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
17
|
+
className: cn("relative min-w-0 flex-[1_1_16rem] sm:max-w-sm", className),
|
|
18
|
+
children: [
|
|
19
|
+
/* @__PURE__ */ jsx(Search, {
|
|
20
|
+
className: "pointer-events-none absolute start-3 top-1/2 size-4 -translate-y-1/2 text-text-muted",
|
|
21
|
+
"aria-hidden": "true"
|
|
22
|
+
}),
|
|
23
|
+
/* @__PURE__ */ jsx(Input, {
|
|
24
|
+
type: "search",
|
|
25
|
+
value,
|
|
26
|
+
onChange: (event) => onChange(event.target.value),
|
|
27
|
+
placeholder,
|
|
28
|
+
"aria-label": placeholder,
|
|
29
|
+
disabled,
|
|
30
|
+
autoComplete: "off",
|
|
31
|
+
className: "h-10 ps-9 pe-9 [&::-webkit-search-cancel-button]:hidden",
|
|
32
|
+
"data-testid": testId
|
|
33
|
+
}),
|
|
34
|
+
value && !disabled && /* @__PURE__ */ jsx("button", {
|
|
35
|
+
type: "button",
|
|
36
|
+
onClick: () => onChange(""),
|
|
37
|
+
"aria-label": tr("fluidgrids.moreTools.common.clearSearch", "Clear search"),
|
|
38
|
+
className: cn("absolute end-1.5 top-1/2 inline-flex size-7 -translate-y-1/2 items-center justify-center rounded-md text-text-muted hover:text-text-primary", "outline-none focus-visible:ring-2 focus-visible:ring-accent-glow"),
|
|
39
|
+
"data-testid": `${testId}-clear`,
|
|
40
|
+
children: /* @__PURE__ */ jsx(X, {
|
|
41
|
+
className: "size-4",
|
|
42
|
+
"aria-hidden": "true"
|
|
43
|
+
})
|
|
44
|
+
})
|
|
45
|
+
]
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export { SearchBox as t };
|
|
@@ -0,0 +1,497 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { r as useTr } from "./TranslationBridge-Da-TPgQm.js";
|
|
3
|
+
import { UiScriptEditorView } from "./ui-script-editor-CqPu2bCN.js";
|
|
4
|
+
import { C as saveUiSharedSequence, _ as fetchUiElements, a as usePagedLibraryList, b as replayUiScript, d as deleteUiSharedSequence, i as SectionTitle, n as LibraryError, o as useLibraryRead, t as Field, v as fetchUiSharedSequence } from "./LibraryParts-DOeNgR8A.js";
|
|
5
|
+
import { A as withPinNames, C as readSequenceDraft, D as sequenceVersionFields, E as sequenceDraft, a as draftPins, f as emptySequenceDraft, g as keyFromName, j as withoutPin, k as withPin, m as freePinKey, t as ELEMENT_KEY_PATTERN, w as replayScript } from "./element-library-DkSlg_VE.js";
|
|
6
|
+
import { useEffect, useMemo, useState } from "react";
|
|
7
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
import { ArrowLeft, Trash2, X } from "lucide-react";
|
|
9
|
+
import { toast } from "sonner";
|
|
10
|
+
import { Badge, Input, Skeleton, ThemedSelect } from "@burdenoff/fe-libs/ui";
|
|
11
|
+
import { Button as Button$1 } from "@burdenoff/fe-libs/button";
|
|
12
|
+
|
|
13
|
+
// src/modules/element-library/hooks/usePinChoices.ts
|
|
14
|
+
/**
|
|
15
|
+
* The elements the shared-sequence editor's pin picker offers: the
|
|
16
|
+
* application's elements, searchable and paged, so every element can be
|
|
17
|
+
* pinned and not only the page's first page. The search asks once typing
|
|
18
|
+
* pauses.
|
|
19
|
+
*/
|
|
20
|
+
/** How long the search waits after a keystroke before it asks. */
|
|
21
|
+
const SEARCH_DELAY_MS = 300;
|
|
22
|
+
function usePinChoices(applicationId) {
|
|
23
|
+
const [search, setSearch] = useState("");
|
|
24
|
+
const [query, setQuery] = useState("");
|
|
25
|
+
useEffect(() => {
|
|
26
|
+
const timer = setTimeout(() => setQuery(search.trim()), SEARCH_DELAY_MS);
|
|
27
|
+
return () => clearTimeout(timer);
|
|
28
|
+
}, [search]);
|
|
29
|
+
return {
|
|
30
|
+
search,
|
|
31
|
+
setSearch,
|
|
32
|
+
list: usePagedLibraryList(`${applicationId}\n${query}`, (_key, after) => fetchUiElements({
|
|
33
|
+
applicationId,
|
|
34
|
+
search: query || null
|
|
35
|
+
}, after))
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// src/modules/element-library/components/SequenceFields.tsx
|
|
40
|
+
/**
|
|
41
|
+
* A shared sequence's heading and its name, key and description. The key is
|
|
42
|
+
* fixed once the sequence exists.
|
|
43
|
+
*/
|
|
44
|
+
function SequenceFields({ sequence, applicationName, values, onName, onKey, onDescription, readOnly, onClose }) {
|
|
45
|
+
const tr = useTr();
|
|
46
|
+
const nextVersion = (sequence?.currentVersion ?? 0) + 1;
|
|
47
|
+
const { name, description } = values;
|
|
48
|
+
const effectiveKey = values.key;
|
|
49
|
+
const setName = onName;
|
|
50
|
+
const setDescription = onDescription;
|
|
51
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
52
|
+
/* @__PURE__ */ jsxs("div", {
|
|
53
|
+
className: "flex min-w-0 flex-col gap-1",
|
|
54
|
+
children: [
|
|
55
|
+
/* @__PURE__ */ jsxs("button", {
|
|
56
|
+
type: "button",
|
|
57
|
+
onClick: onClose,
|
|
58
|
+
className: "flex items-center gap-1 self-start text-xs text-primary hover:underline",
|
|
59
|
+
"data-testid": "element-library-sequence-back",
|
|
60
|
+
children: [/* @__PURE__ */ jsx(ArrowLeft, {
|
|
61
|
+
className: "size-3.5",
|
|
62
|
+
"aria-hidden": "true"
|
|
63
|
+
}), tr("fluidgrids.elementLibrary.sequence.breadcrumb", "{{application}} › Sequences", { application: applicationName })]
|
|
64
|
+
}),
|
|
65
|
+
/* @__PURE__ */ jsxs("div", {
|
|
66
|
+
className: "flex min-w-0 flex-wrap items-center gap-2",
|
|
67
|
+
children: [/* @__PURE__ */ jsx("h2", {
|
|
68
|
+
className: "truncate text-lg font-semibold text-text-primary",
|
|
69
|
+
children: sequence ? sequence.name : tr("fluidgrids.elementLibrary.sequence.new", "New sequence")
|
|
70
|
+
}), sequence && /* @__PURE__ */ jsx(Badge, {
|
|
71
|
+
variant: "secondary",
|
|
72
|
+
"data-testid": "element-library-sequence-version",
|
|
73
|
+
children: tr("fluidgrids.elementLibrary.element.latest", "v{{version}} (latest)", { version: sequence.currentVersion })
|
|
74
|
+
})]
|
|
75
|
+
}),
|
|
76
|
+
/* @__PURE__ */ jsx("p", {
|
|
77
|
+
className: "text-xs text-text-secondary",
|
|
78
|
+
children: tr("fluidgrids.elementLibrary.sequence.versionHint", "Saving creates v{{version}}; workflows keep the version they pin.", { version: nextVersion })
|
|
79
|
+
})
|
|
80
|
+
]
|
|
81
|
+
}),
|
|
82
|
+
/* @__PURE__ */ jsxs("div", {
|
|
83
|
+
className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
|
|
84
|
+
children: [/* @__PURE__ */ jsx(Field, {
|
|
85
|
+
id: "element-library-sequence-name",
|
|
86
|
+
label: tr("fluidgrids.elementLibrary.field.name", "Name"),
|
|
87
|
+
children: /* @__PURE__ */ jsx(Input, {
|
|
88
|
+
id: "element-library-sequence-name",
|
|
89
|
+
value: name,
|
|
90
|
+
readOnly,
|
|
91
|
+
maxLength: 200,
|
|
92
|
+
onChange: (event) => setName(event.target.value),
|
|
93
|
+
placeholder: tr("fluidgrids.elementLibrary.sequence.namePlaceholder", "Log in"),
|
|
94
|
+
"data-testid": "element-library-sequence-name"
|
|
95
|
+
})
|
|
96
|
+
}), /* @__PURE__ */ jsx(Field, {
|
|
97
|
+
id: "element-library-sequence-key",
|
|
98
|
+
label: tr("fluidgrids.elementLibrary.field.key", "Key"),
|
|
99
|
+
hint: tr("fluidgrids.elementLibrary.field.elementKeyHint", "Starts with a letter or _; unique in the application."),
|
|
100
|
+
children: /* @__PURE__ */ jsx(Input, {
|
|
101
|
+
id: "element-library-sequence-key",
|
|
102
|
+
value: effectiveKey,
|
|
103
|
+
readOnly: readOnly || sequence !== null,
|
|
104
|
+
maxLength: 64,
|
|
105
|
+
onChange: (event) => onKey(event.target.value),
|
|
106
|
+
className: "font-mono",
|
|
107
|
+
"data-testid": "element-library-sequence-key"
|
|
108
|
+
})
|
|
109
|
+
})]
|
|
110
|
+
}),
|
|
111
|
+
/* @__PURE__ */ jsx(Field, {
|
|
112
|
+
id: "element-library-sequence-description",
|
|
113
|
+
label: tr("fluidgrids.elementLibrary.field.description", "Description"),
|
|
114
|
+
hint: tr("fluidgrids.elementLibrary.field.optional", "Optional."),
|
|
115
|
+
children: /* @__PURE__ */ jsx(Input, {
|
|
116
|
+
id: "element-library-sequence-description",
|
|
117
|
+
value: description,
|
|
118
|
+
readOnly,
|
|
119
|
+
maxLength: 2e3,
|
|
120
|
+
onChange: (event) => setDescription(event.target.value),
|
|
121
|
+
"data-testid": "element-library-sequence-description"
|
|
122
|
+
})
|
|
123
|
+
})
|
|
124
|
+
] });
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
// src/modules/element-library/components/SequencePins.tsx
|
|
128
|
+
/**
|
|
129
|
+
* The library elements a shared sequence pins (spec 19 M5): each at its
|
|
130
|
+
* version, so the sequence always finds the same things. A pin a step still
|
|
131
|
+
* uses cannot be removed. The picker searches and pages the application's
|
|
132
|
+
* elements.
|
|
133
|
+
*/
|
|
134
|
+
/** The choice of the pin picker that adds nothing. */
|
|
135
|
+
const NO_ELEMENT = "";
|
|
136
|
+
function SequencePins({ draft, onDraft, choices, names, readOnly }) {
|
|
137
|
+
const tr = useTr();
|
|
138
|
+
const [pinChoice, setPinChoice] = useState(NO_ELEMENT);
|
|
139
|
+
const [pinError, setPinError] = useState(null);
|
|
140
|
+
const pins = draftPins(draft);
|
|
141
|
+
const pinned = new Set(pins.map((pin) => pin.elementId));
|
|
142
|
+
const unpinned = choices.list.items.filter((element) => !pinned.has(element.id));
|
|
143
|
+
const pinSearch = choices.search;
|
|
144
|
+
const setPinSearch = choices.setSearch;
|
|
145
|
+
const addPin = () => {
|
|
146
|
+
const element = choices.list.items.find((entry) => entry.id === pinChoice);
|
|
147
|
+
if (!element) return;
|
|
148
|
+
onDraft(withPin(draft, freePinKey(draft, element.key), {
|
|
149
|
+
elementId: element.id,
|
|
150
|
+
version: element.currentVersion,
|
|
151
|
+
name: element.name
|
|
152
|
+
}));
|
|
153
|
+
setPinChoice(NO_ELEMENT);
|
|
154
|
+
setPinError(null);
|
|
155
|
+
};
|
|
156
|
+
const removePin = (pinKey) => {
|
|
157
|
+
const next = withoutPin(draft, pinKey);
|
|
158
|
+
if (next === null) {
|
|
159
|
+
setPinError(tr("fluidgrids.elementLibrary.sequence.pinInUse", "A step still uses {{key}}. Change that step first.", { key: pinKey }));
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
setPinError(null);
|
|
163
|
+
onDraft(next);
|
|
164
|
+
};
|
|
165
|
+
return /* @__PURE__ */ jsxs("section", {
|
|
166
|
+
className: "flex flex-col gap-2",
|
|
167
|
+
"data-testid": "element-library-sequence-pins",
|
|
168
|
+
children: [
|
|
169
|
+
/* @__PURE__ */ jsx(SectionTitle, { children: tr("fluidgrids.elementLibrary.sequence.elements", "Elements it uses") }),
|
|
170
|
+
/* @__PURE__ */ jsx("p", {
|
|
171
|
+
className: "text-xs text-text-secondary",
|
|
172
|
+
children: tr("fluidgrids.elementLibrary.sequence.elementsHint", "Each element is pinned at its version, so the sequence always finds the same things. A step uses one by choosing it as its element.")
|
|
173
|
+
}),
|
|
174
|
+
/* @__PURE__ */ jsx("ul", {
|
|
175
|
+
className: "flex flex-col gap-1",
|
|
176
|
+
children: pins.map((pin) => /* @__PURE__ */ jsxs("li", {
|
|
177
|
+
className: "flex min-w-0 items-center justify-between gap-2 rounded-md border border-border-default px-2 py-1 text-sm",
|
|
178
|
+
"data-testid": `element-library-sequence-pinned-${pin.key}`,
|
|
179
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
180
|
+
className: "min-w-0 truncate text-text-primary",
|
|
181
|
+
children: tr("fluidgrids.elementLibrary.sequence.pin", "{{name}} v{{version}}", {
|
|
182
|
+
name: pin.name ?? names[pin.elementId] ?? pin.key,
|
|
183
|
+
version: pin.version
|
|
184
|
+
})
|
|
185
|
+
}), !readOnly && /* @__PURE__ */ jsx("button", {
|
|
186
|
+
type: "button",
|
|
187
|
+
onClick: () => removePin(pin.key),
|
|
188
|
+
"aria-label": tr("fluidgrids.elementLibrary.sequence.unpin", "Remove {{key}}", { key: pin.key }),
|
|
189
|
+
className: "shrink-0 rounded p-1 text-text-secondary hover:bg-muted",
|
|
190
|
+
"data-testid": `element-library-sequence-pinned-${pin.key}-remove`,
|
|
191
|
+
children: /* @__PURE__ */ jsx(X, {
|
|
192
|
+
className: "size-3.5",
|
|
193
|
+
"aria-hidden": "true"
|
|
194
|
+
})
|
|
195
|
+
})]
|
|
196
|
+
}, pin.key))
|
|
197
|
+
}),
|
|
198
|
+
pinError && /* @__PURE__ */ jsx("p", {
|
|
199
|
+
role: "alert",
|
|
200
|
+
className: "text-xs text-status-error-text",
|
|
201
|
+
children: pinError
|
|
202
|
+
}),
|
|
203
|
+
!readOnly && /* @__PURE__ */ jsxs("div", {
|
|
204
|
+
className: "flex min-w-0 flex-wrap items-center gap-2",
|
|
205
|
+
children: [
|
|
206
|
+
/* @__PURE__ */ jsx(Input, {
|
|
207
|
+
type: "search",
|
|
208
|
+
value: pinSearch,
|
|
209
|
+
onChange: (event) => setPinSearch(event.target.value),
|
|
210
|
+
placeholder: tr("fluidgrids.elementLibrary.sequence.searchElements", "Search elements"),
|
|
211
|
+
"aria-label": tr("fluidgrids.elementLibrary.sequence.searchElements", "Search elements"),
|
|
212
|
+
className: "min-w-0 flex-1",
|
|
213
|
+
"data-testid": "element-library-sequence-pin-filter"
|
|
214
|
+
}),
|
|
215
|
+
/* @__PURE__ */ jsxs(ThemedSelect, {
|
|
216
|
+
value: pinChoice,
|
|
217
|
+
onChange: (event) => setPinChoice(event.target.value),
|
|
218
|
+
"aria-label": tr("fluidgrids.elementLibrary.sequence.addElement", "Add an element"),
|
|
219
|
+
className: "min-w-0 flex-1",
|
|
220
|
+
"data-testid": "element-library-sequence-pin-choice",
|
|
221
|
+
children: [/* @__PURE__ */ jsx("option", {
|
|
222
|
+
value: NO_ELEMENT,
|
|
223
|
+
children: tr("fluidgrids.elementLibrary.sequence.chooseElement", "Choose an element")
|
|
224
|
+
}), unpinned.map((element) => /* @__PURE__ */ jsx("option", {
|
|
225
|
+
value: element.id,
|
|
226
|
+
children: element.name
|
|
227
|
+
}, element.id))]
|
|
228
|
+
}),
|
|
229
|
+
/* @__PURE__ */ jsx(Button$1, {
|
|
230
|
+
size: "sm",
|
|
231
|
+
variant: "outline",
|
|
232
|
+
disabled: pinChoice === NO_ELEMENT,
|
|
233
|
+
onClick: addPin,
|
|
234
|
+
"data-testid": "element-library-sequence-pin-add",
|
|
235
|
+
children: tr("fluidgrids.elementLibrary.sequence.addElement", "Add an element")
|
|
236
|
+
}),
|
|
237
|
+
choices.list.hasMore && /* @__PURE__ */ jsx(Button$1, {
|
|
238
|
+
size: "sm",
|
|
239
|
+
variant: "ghost",
|
|
240
|
+
disabled: choices.list.loadingMore,
|
|
241
|
+
onClick: () => void choices.list.loadMore(),
|
|
242
|
+
"data-testid": "element-library-sequence-pin-more",
|
|
243
|
+
children: tr("fluidgrids.elementLibrary.loadMore", "Show more")
|
|
244
|
+
})
|
|
245
|
+
]
|
|
246
|
+
})
|
|
247
|
+
]
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
// src/modules/element-library/components/SequenceTest.tsx
|
|
252
|
+
/**
|
|
253
|
+
* "Test without a browser" for a shared sequence (spec 19 M5 marker 3): the
|
|
254
|
+
* steps replayed on the page snapshots stored with each pinned element
|
|
255
|
+
* (`replayUiScriptOnSnapshots`, P1-05). It writes nothing.
|
|
256
|
+
*/
|
|
257
|
+
function ReplayResult({ result }) {
|
|
258
|
+
const tr = useTr();
|
|
259
|
+
const failed = result.snapshots.filter((snapshot) => !snapshot.passed);
|
|
260
|
+
const tone = result.untested ? "text-text-secondary" : result.passed ? "text-status-success-text" : "text-status-error-text";
|
|
261
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
262
|
+
role: "status",
|
|
263
|
+
className: `text-sm ${tone}`,
|
|
264
|
+
"data-testid": "element-library-sequence-replay-result",
|
|
265
|
+
children: [result.untested ? tr("fluidgrids.elementLibrary.sequence.replayUntested", "Untested: none of the pinned elements has a stored snapshot yet.") : result.passed ? tr("fluidgrids.elementLibrary.sequence.replayPassed", "Passed on {{count}} snapshots.", { count: result.snapshots.length }) : tr("fluidgrids.elementLibrary.sequence.replayFailed", "Failed on {{failed}} of {{count}} snapshots.", {
|
|
266
|
+
failed: failed.length,
|
|
267
|
+
count: result.snapshots.length
|
|
268
|
+
}), failed.length > 0 && /* @__PURE__ */ jsx("ul", {
|
|
269
|
+
className: "mt-1 list-disc pl-5 text-xs",
|
|
270
|
+
children: failed.map((snapshot) => /* @__PURE__ */ jsx("li", { children: tr("fluidgrids.elementLibrary.sequence.replayStep", "Step {{step}}: {{code}}", {
|
|
271
|
+
step: snapshot.failedStepPath ?? "–",
|
|
272
|
+
code: snapshot.errorCode ?? "–"
|
|
273
|
+
}) }, snapshot.snapshotId))
|
|
274
|
+
})]
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
function SequenceTest({ draft, canTest }) {
|
|
278
|
+
const tr = useTr();
|
|
279
|
+
const [replaying, setReplaying] = useState(false);
|
|
280
|
+
const [replay, setReplay] = useState(null);
|
|
281
|
+
const [replayError, setReplayError] = useState(null);
|
|
282
|
+
const test = async () => {
|
|
283
|
+
setReplaying(true);
|
|
284
|
+
setReplayError(null);
|
|
285
|
+
setReplay(null);
|
|
286
|
+
try {
|
|
287
|
+
setReplay(await replayUiScript(replayScript(draft)));
|
|
288
|
+
} catch (err) {
|
|
289
|
+
setReplayError(err);
|
|
290
|
+
} finally {
|
|
291
|
+
setReplaying(false);
|
|
292
|
+
}
|
|
293
|
+
};
|
|
294
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
295
|
+
className: "flex flex-col gap-2",
|
|
296
|
+
children: [
|
|
297
|
+
canTest && /* @__PURE__ */ jsxs("div", {
|
|
298
|
+
className: "flex flex-wrap items-center gap-2",
|
|
299
|
+
children: [/* @__PURE__ */ jsx(Button$1, {
|
|
300
|
+
variant: "outline",
|
|
301
|
+
size: "sm",
|
|
302
|
+
disabled: replaying || draft.steps.length === 0,
|
|
303
|
+
onClick: () => void test(),
|
|
304
|
+
"data-testid": "element-library-sequence-test",
|
|
305
|
+
children: tr("fluidgrids.elementLibrary.sequence.test", "Test without a browser")
|
|
306
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
307
|
+
className: "text-xs text-text-secondary",
|
|
308
|
+
children: tr("fluidgrids.elementLibrary.sequence.testHint", "Replays the steps against the page snapshots saved with each element.")
|
|
309
|
+
})]
|
|
310
|
+
}),
|
|
311
|
+
replay && /* @__PURE__ */ jsx(ReplayResult, { result: replay }),
|
|
312
|
+
/* @__PURE__ */ jsx(LibraryError, {
|
|
313
|
+
error: replayError,
|
|
314
|
+
testId: "element-library-sequence-replay-error"
|
|
315
|
+
})
|
|
316
|
+
]
|
|
317
|
+
});
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
// src/modules/element-library/components/SequenceEditor.tsx
|
|
321
|
+
/**
|
|
322
|
+
* The shared-sequence editor (spec 19 M5 markers 1 to 3): a sequence's name,
|
|
323
|
+
* key and description, the library elements it pins, its arguments and
|
|
324
|
+
* outputs, and its steps in the same editor as a Use Browser node (P1-11), so
|
|
325
|
+
* there is one way to edit steps. "Test without a browser" replays the steps
|
|
326
|
+
* on the tree snapshots stored with each pinned element (P1-05). Saving
|
|
327
|
+
* writes the next version; workflows keep the version their call blocks pin.
|
|
328
|
+
*
|
|
329
|
+
* This module brings the step editor and with it `@burdenoff/ui-engine`, so
|
|
330
|
+
* the page loads it only when a sequence opens (see `LazySequenceEditor`).
|
|
331
|
+
*/
|
|
332
|
+
/** The sequence's save and delete, with their refusal. */
|
|
333
|
+
function useSequenceWrites(sequence, onChanged) {
|
|
334
|
+
const tr = useTr();
|
|
335
|
+
const [saving, setSaving] = useState(false);
|
|
336
|
+
const [error, setError] = useState(null);
|
|
337
|
+
const run = async (write) => {
|
|
338
|
+
setSaving(true);
|
|
339
|
+
setError(null);
|
|
340
|
+
try {
|
|
341
|
+
onChanged(await write());
|
|
342
|
+
} catch (err) {
|
|
343
|
+
setError(err);
|
|
344
|
+
} finally {
|
|
345
|
+
setSaving(false);
|
|
346
|
+
}
|
|
347
|
+
};
|
|
348
|
+
const save = (fields) => run(async () => {
|
|
349
|
+
const saved = await saveUiSharedSequence(fields);
|
|
350
|
+
toast.success(tr("fluidgrids.elementLibrary.sequence.saved", "Saved as v{{version}}", { version: saved.currentVersion }));
|
|
351
|
+
return saved;
|
|
352
|
+
});
|
|
353
|
+
const remove = () => {
|
|
354
|
+
if (!sequence) return Promise.resolve();
|
|
355
|
+
if (!window.confirm(tr("fluidgrids.elementLibrary.sequence.deleteConfirm", "Delete {{name}}? This cannot be undone.", { name: sequence.name }))) return Promise.resolve();
|
|
356
|
+
return run(async () => {
|
|
357
|
+
await deleteUiSharedSequence(sequence.id);
|
|
358
|
+
return null;
|
|
359
|
+
});
|
|
360
|
+
};
|
|
361
|
+
return {
|
|
362
|
+
saving,
|
|
363
|
+
error,
|
|
364
|
+
save,
|
|
365
|
+
remove
|
|
366
|
+
};
|
|
367
|
+
}
|
|
368
|
+
function SequenceForm({ sequence, applicationId, applicationName, elements, access, onClose, onChanged }) {
|
|
369
|
+
const tr = useTr();
|
|
370
|
+
const choices = usePinChoices(applicationId);
|
|
371
|
+
const elementNames = useMemo(() => Object.fromEntries([...elements, ...choices.list.items].map((element) => [element.id, element.name])), [elements, choices.list.items]);
|
|
372
|
+
const [name, setName] = useState(sequence?.name ?? "");
|
|
373
|
+
const [key, setKey] = useState(sequence?.key ?? null);
|
|
374
|
+
const [description, setDescription] = useState(sequence?.description ?? "");
|
|
375
|
+
const [draft, setDraft] = useState(() => sequence ? sequenceDraft(sequence.current, elementNames) : emptySequenceDraft());
|
|
376
|
+
const writes = useSequenceWrites(sequence, onChanged);
|
|
377
|
+
const readOnly = !access.canUpdate;
|
|
378
|
+
const effectiveKey = key ?? keyFromName(name, true);
|
|
379
|
+
const valid = name.trim().length > 0 && ELEMENT_KEY_PATTERN.test(effectiveKey);
|
|
380
|
+
const nextVersion = (sequence?.currentVersion ?? 0) + 1;
|
|
381
|
+
const shownDraft = useMemo(() => withPinNames(draft, elementNames), [draft, elementNames]);
|
|
382
|
+
const save = () => {
|
|
383
|
+
if (!valid || writes.saving) return;
|
|
384
|
+
writes.save({
|
|
385
|
+
id: sequence?.id ?? null,
|
|
386
|
+
applicationId,
|
|
387
|
+
key: effectiveKey,
|
|
388
|
+
name: name.trim(),
|
|
389
|
+
description: description.trim() || null,
|
|
390
|
+
expectedVersion: sequence?.currentVersion ?? null,
|
|
391
|
+
...sequenceVersionFields(draft)
|
|
392
|
+
});
|
|
393
|
+
};
|
|
394
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
395
|
+
className: "flex min-w-0 flex-col gap-4",
|
|
396
|
+
"data-testid": "element-library-sequence",
|
|
397
|
+
children: [
|
|
398
|
+
/* @__PURE__ */ jsx(SequenceFields, {
|
|
399
|
+
sequence,
|
|
400
|
+
applicationName,
|
|
401
|
+
values: {
|
|
402
|
+
name,
|
|
403
|
+
key: effectiveKey,
|
|
404
|
+
description
|
|
405
|
+
},
|
|
406
|
+
onName: setName,
|
|
407
|
+
onKey: setKey,
|
|
408
|
+
onDescription: setDescription,
|
|
409
|
+
readOnly,
|
|
410
|
+
onClose
|
|
411
|
+
}),
|
|
412
|
+
/* @__PURE__ */ jsx(SequencePins, {
|
|
413
|
+
draft,
|
|
414
|
+
onDraft: setDraft,
|
|
415
|
+
choices,
|
|
416
|
+
names: elementNames,
|
|
417
|
+
readOnly
|
|
418
|
+
}),
|
|
419
|
+
/* @__PURE__ */ jsxs("section", {
|
|
420
|
+
className: "flex flex-col gap-2",
|
|
421
|
+
children: [/* @__PURE__ */ jsx(SectionTitle, { children: tr("fluidgrids.elementLibrary.sequence.steps", "Steps") }), /* @__PURE__ */ jsx(UiScriptEditorView, {
|
|
422
|
+
value: shownDraft,
|
|
423
|
+
onChange: (next) => {
|
|
424
|
+
const parsed = readSequenceDraft(next);
|
|
425
|
+
if (parsed) setDraft(parsed);
|
|
426
|
+
},
|
|
427
|
+
inputs: {},
|
|
428
|
+
onInputsChange: () => void 0,
|
|
429
|
+
inputsEditable: false,
|
|
430
|
+
asSequence: true,
|
|
431
|
+
readOnly,
|
|
432
|
+
testIdPrefix: "element-library-sequence"
|
|
433
|
+
})]
|
|
434
|
+
}),
|
|
435
|
+
/* @__PURE__ */ jsx(SequenceTest, {
|
|
436
|
+
draft,
|
|
437
|
+
canTest: access.canTest
|
|
438
|
+
}),
|
|
439
|
+
/* @__PURE__ */ jsx(LibraryError, {
|
|
440
|
+
error: writes.error,
|
|
441
|
+
testId: "element-library-sequence-error"
|
|
442
|
+
}),
|
|
443
|
+
/* @__PURE__ */ jsxs("div", {
|
|
444
|
+
className: "flex flex-wrap gap-2",
|
|
445
|
+
children: [
|
|
446
|
+
!readOnly && /* @__PURE__ */ jsx(Button$1, {
|
|
447
|
+
disabled: !valid || writes.saving,
|
|
448
|
+
onClick: save,
|
|
449
|
+
"data-testid": "element-library-sequence-save",
|
|
450
|
+
children: tr("fluidgrids.elementLibrary.sequence.save", "Save as v{{version}}", { version: nextVersion })
|
|
451
|
+
}),
|
|
452
|
+
/* @__PURE__ */ jsx(Button$1, {
|
|
453
|
+
variant: "outline",
|
|
454
|
+
onClick: onClose,
|
|
455
|
+
children: tr("fluidgrids.elementLibrary.close", "Close")
|
|
456
|
+
}),
|
|
457
|
+
sequence && access.canDelete && /* @__PURE__ */ jsxs(Button$1, {
|
|
458
|
+
variant: "outline",
|
|
459
|
+
disabled: writes.saving,
|
|
460
|
+
onClick: () => void writes.remove(),
|
|
461
|
+
"data-testid": "element-library-sequence-delete",
|
|
462
|
+
children: [/* @__PURE__ */ jsx(Trash2, {
|
|
463
|
+
className: "mr-1 size-4",
|
|
464
|
+
"aria-hidden": "true"
|
|
465
|
+
}), tr("fluidgrids.elementLibrary.sequence.delete", "Delete")]
|
|
466
|
+
})
|
|
467
|
+
]
|
|
468
|
+
})
|
|
469
|
+
]
|
|
470
|
+
});
|
|
471
|
+
}
|
|
472
|
+
function SequenceEditor(props) {
|
|
473
|
+
const sequence = useLibraryRead(props.sequenceId, fetchUiSharedSequence);
|
|
474
|
+
if (props.sequenceId !== null && sequence.loading && !sequence.data) return /* @__PURE__ */ jsxs("div", {
|
|
475
|
+
className: "flex flex-col gap-3",
|
|
476
|
+
"data-testid": "element-library-sequence-loading",
|
|
477
|
+
children: [/* @__PURE__ */ jsx(Skeleton, { className: "h-8 w-1/2" }), /* @__PURE__ */ jsx(Skeleton, { className: "h-48 w-full" })]
|
|
478
|
+
});
|
|
479
|
+
if (props.sequenceId !== null && !sequence.data) return /* @__PURE__ */ jsx(LibraryError, {
|
|
480
|
+
error: sequence.error ?? /* @__PURE__ */ new Error("Not found"),
|
|
481
|
+
testId: "element-library-sequence-load-error"
|
|
482
|
+
});
|
|
483
|
+
return /* @__PURE__ */ jsx(SequenceForm, {
|
|
484
|
+
sequence: sequence.data ?? null,
|
|
485
|
+
applicationId: props.applicationId,
|
|
486
|
+
applicationName: props.applicationName,
|
|
487
|
+
elements: props.elements,
|
|
488
|
+
access: props.access,
|
|
489
|
+
onClose: props.onClose,
|
|
490
|
+
onChanged: (saved) => {
|
|
491
|
+
if (saved) sequence.refetch();
|
|
492
|
+
props.onChanged(saved);
|
|
493
|
+
}
|
|
494
|
+
}, `${props.sequenceId ?? "new"}:${sequence.data?.currentVersion ?? 0}`);
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
export { SequenceEditor, SequenceEditor as default };
|