@nocobase/flow-engine 2.0.0-alpha.7 → 2.0.0-alpha.71
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/lib/BlockScopedFlowEngine.d.ts +23 -0
- package/lib/BlockScopedFlowEngine.js +91 -0
- package/lib/FlowContextProvider.d.ts +2 -2
- package/lib/FlowContextProvider.js +3 -3
- package/lib/FlowDefinition.d.ts +6 -4
- package/lib/JSRunner.d.ts +6 -0
- package/lib/JSRunner.js +27 -1
- package/lib/ViewScopedFlowEngine.d.ts +1 -1
- package/lib/ViewScopedFlowEngine.js +18 -1
- package/lib/acl/Acl.d.ts +12 -12
- package/lib/acl/Acl.js +88 -30
- package/lib/components/DynamicFlowsEditor.js +2 -4
- package/lib/components/FieldModelRenderer.js +17 -9
- package/lib/components/FieldSkeleton.d.ts +10 -0
- package/lib/components/FieldSkeleton.js +64 -0
- package/lib/components/FlowContextSelector.js +19 -3
- package/lib/components/FlowModelRenderer.d.ts +4 -6
- package/lib/components/FlowModelRenderer.js +35 -53
- package/lib/components/FormItem.js +5 -1
- package/lib/components/MobilePopup.d.ts +20 -0
- package/lib/components/MobilePopup.js +102 -0
- package/lib/components/MobilePopup.style.d.ts +17 -0
- package/lib/components/MobilePopup.style.js +186 -0
- package/lib/components/common/withFlowDesignMode.d.ts +1 -1
- package/lib/components/common/withFlowDesignMode.js +5 -5
- package/lib/components/dnd/gridDragPlanner.d.ts +1 -0
- package/lib/components/dnd/gridDragPlanner.js +53 -1
- package/lib/components/index.d.ts +1 -0
- package/lib/components/index.js +3 -1
- package/lib/components/settings/independents/dropdown/FlowsDropdownButton.js +71 -53
- package/lib/components/settings/wrappers/component/SelectWithTitle.d.ts +19 -0
- package/lib/components/settings/wrappers/component/SelectWithTitle.js +136 -0
- package/lib/components/settings/wrappers/component/SwitchWithTitle.d.ts +10 -0
- package/lib/components/settings/wrappers/component/SwitchWithTitle.js +111 -0
- package/lib/components/settings/wrappers/contextual/DefaultSettingsIcon.js +233 -97
- package/lib/components/settings/wrappers/contextual/FlowsContextMenu.js +71 -54
- package/lib/components/settings/wrappers/contextual/FlowsFloatContextMenu.d.ts +2 -2
- package/lib/components/settings/wrappers/contextual/FlowsFloatContextMenu.js +63 -23
- package/lib/components/settings/wrappers/contextual/StepSettingsDialog.js +13 -2
- package/lib/components/settings/wrappers/embedded/FlowSettings.js +42 -28
- package/lib/components/settings/wrappers/embedded/FlowsSettings.js +3 -3
- package/lib/components/settings/wrappers/embedded/FlowsSettingsContent.js +52 -32
- package/lib/components/subModel/AddSubModelButton.d.ts +7 -0
- package/lib/components/subModel/AddSubModelButton.js +78 -8
- package/lib/components/subModel/LazyDropdown.js +14 -15
- package/lib/components/subModel/utils.d.ts +1 -1
- package/lib/components/subModel/utils.js +21 -11
- package/lib/components/variables/VariableInput.js +26 -6
- package/lib/components/variables/VariableTag.js +43 -2
- package/lib/components/variables/types.d.ts +2 -0
- package/lib/components/variables/utils.js +4 -2
- package/lib/data-source/index.d.ts +23 -4
- package/lib/data-source/index.js +135 -14
- package/lib/data-source/jioToJoiSchema.js +1 -0
- package/lib/emitter.d.ts +6 -0
- package/lib/emitter.js +12 -0
- package/lib/executor/FlowExecutor.d.ts +6 -6
- package/lib/executor/FlowExecutor.js +302 -99
- package/lib/flow-registry/GlobalFlowRegistry.d.ts +1 -0
- package/lib/flow-registry/GlobalFlowRegistry.js +3 -0
- package/lib/flow-registry/InstanceFlowRegistry.d.ts +1 -0
- package/lib/flow-registry/InstanceFlowRegistry.js +3 -0
- package/lib/flowContext.d.ts +105 -6
- package/lib/flowContext.js +447 -139
- package/lib/flowEngine.d.ts +71 -1
- package/lib/flowEngine.js +319 -16
- package/lib/flowSettings.d.ts +4 -3
- package/lib/flowSettings.js +45 -21
- package/lib/hooks/useApplyAutoFlows.d.ts +1 -0
- package/lib/hooks/useApplyAutoFlows.js +3 -2
- package/lib/index.d.ts +14 -3
- package/lib/index.js +54 -7
- package/lib/locale/de-DE.json +62 -0
- package/lib/locale/en-US.json +57 -45
- package/lib/locale/es-ES.json +62 -0
- package/lib/locale/fr-FR.json +62 -0
- package/lib/locale/hu-HU.json +62 -0
- package/lib/locale/id-ID.json +62 -0
- package/lib/locale/index.d.ts +114 -90
- package/lib/locale/it-IT.json +62 -0
- package/lib/locale/ja-JP.json +62 -0
- package/lib/locale/ko-KR.json +62 -0
- package/lib/locale/nl-NL.json +62 -0
- package/lib/locale/pt-BR.json +62 -0
- package/lib/locale/ru-RU.json +62 -0
- package/lib/locale/tr-TR.json +62 -0
- package/lib/locale/uk-UA.json +62 -0
- package/lib/locale/vi-VN.json +62 -0
- package/lib/locale/zh-CN.json +58 -46
- package/lib/locale/zh-TW.json +62 -0
- package/lib/models/CollectionFieldModel.d.ts +7 -2
- package/lib/models/CollectionFieldModel.js +63 -16
- package/lib/models/flowModel.d.ts +76 -32
- package/lib/models/flowModel.js +300 -112
- package/lib/models/forkFlowModel.d.ts +8 -4
- package/lib/models/forkFlowModel.js +38 -8
- package/lib/provider.d.ts +3 -1
- package/lib/provider.js +14 -11
- package/lib/reactive/index.d.ts +10 -0
- package/lib/{runjs-context/snippets/global/api-request-post.snippet.js → reactive/index.js} +14 -15
- package/lib/reactive/observer.d.ts +19 -0
- package/lib/reactive/observer.js +109 -0
- package/lib/resources/baseRecordResource.d.ts +6 -0
- package/lib/resources/baseRecordResource.js +38 -3
- package/lib/resources/multiRecordResource.d.ts +5 -2
- package/lib/resources/multiRecordResource.js +26 -10
- package/lib/resources/singleRecordResource.js +8 -3
- package/lib/resources/sqlResource.d.ts +5 -3
- package/lib/resources/sqlResource.js +30 -28
- package/lib/runjs-context/contexts/FormJSFieldItemRunJSContext.d.ts +1 -6
- package/lib/runjs-context/contexts/FormJSFieldItemRunJSContext.js +37 -20
- package/lib/runjs-context/contexts/JSBlockRunJSContext.d.ts +1 -6
- package/lib/runjs-context/contexts/JSBlockRunJSContext.js +46 -33
- package/lib/runjs-context/contexts/JSCollectionActionRunJSContext.d.ts +1 -2
- package/lib/runjs-context/contexts/JSCollectionActionRunJSContext.js +14 -15
- package/lib/runjs-context/contexts/{LinkageRunJSContext.d.ts → JSColumnRunJSContext.d.ts} +6 -3
- package/lib/runjs-context/contexts/JSColumnRunJSContext.js +78 -0
- package/lib/runjs-context/contexts/JSEditableFieldRunJSContext.d.ts +16 -0
- package/lib/runjs-context/contexts/JSEditableFieldRunJSContext.js +125 -0
- package/lib/runjs-context/contexts/JSFieldRunJSContext.d.ts +1 -6
- package/lib/runjs-context/contexts/JSFieldRunJSContext.js +28 -24
- package/lib/runjs-context/contexts/JSItemRunJSContext.d.ts +1 -6
- package/lib/runjs-context/contexts/JSItemRunJSContext.js +34 -20
- package/lib/runjs-context/contexts/JSRecordActionRunJSContext.d.ts +1 -2
- package/lib/runjs-context/contexts/JSRecordActionRunJSContext.js +16 -17
- package/lib/runjs-context/contexts/base.d.ts +9 -0
- package/lib/runjs-context/contexts/base.js +879 -0
- package/lib/runjs-context/contributions.d.ts +33 -0
- package/lib/runjs-context/contributions.js +88 -0
- package/lib/runjs-context/helpers.d.ts +5 -2
- package/lib/runjs-context/helpers.js +36 -27
- package/lib/runjs-context/registry.d.ts +7 -4
- package/lib/runjs-context/registry.js +10 -42
- package/lib/runjs-context/setup.d.ts +9 -0
- package/lib/runjs-context/setup.js +88 -0
- package/lib/runjs-context/snippets/global/{copy-record-json.snippet.js → api-request.snippet.js} +25 -10
- package/lib/runjs-context/snippets/global/clipboard-copy-text.snippet.js +61 -0
- package/lib/runjs-context/snippets/global/{view-navigation-push.snippet.js → import-esm.snippet.js} +26 -12
- package/lib/runjs-context/snippets/global/message-error.snippet.js +6 -0
- package/lib/runjs-context/snippets/global/message-success.snippet.js +6 -0
- package/lib/runjs-context/snippets/global/notification-open.snippet.d.ts +3 -8
- package/lib/runjs-context/snippets/global/notification-open.snippet.js +8 -1
- package/lib/runjs-context/snippets/global/open-view-dialog.snippet.js +10 -3
- package/lib/runjs-context/snippets/global/open-view-drawer.snippet.js +10 -3
- package/lib/runjs-context/snippets/global/query-selector.snippet.js +53 -0
- package/lib/runjs-context/snippets/global/require-amd.snippet.d.ts +11 -0
- package/lib/runjs-context/snippets/global/{requireAsync.snippet.js → require-amd.snippet.js} +16 -13
- package/lib/runjs-context/snippets/global/window-open.snippet.d.ts +3 -8
- package/lib/runjs-context/snippets/global/window-open.snippet.js +8 -1
- package/lib/runjs-context/snippets/index.d.ts +24 -3
- package/lib/runjs-context/snippets/index.js +183 -40
- package/lib/runjs-context/snippets/scene/block/add-event-listener.snippet.d.ts +11 -0
- package/lib/runjs-context/snippets/scene/{jsblock → block}/add-event-listener.snippet.js +11 -2
- package/lib/runjs-context/snippets/scene/block/api-fetch-render-list.snippet.d.ts +11 -0
- package/lib/runjs-context/snippets/scene/block/api-fetch-render-list.snippet.js +64 -0
- package/lib/runjs-context/snippets/scene/block/chartjs-bar.snippet.d.ts +11 -0
- package/lib/runjs-context/snippets/scene/block/chartjs-bar.snippet.js +99 -0
- package/lib/runjs-context/snippets/{libs → scene/block}/echarts-init.snippet.js +24 -7
- package/lib/runjs-context/snippets/scene/block/render-antd-icons.snippet.d.ts +11 -0
- package/lib/runjs-context/snippets/scene/block/render-antd-icons.snippet.js +65 -0
- package/lib/runjs-context/snippets/scene/block/render-button-handler.snippet.d.ts +11 -0
- package/lib/runjs-context/snippets/scene/{jsblock → block}/render-button-handler.snippet.js +17 -9
- package/lib/runjs-context/snippets/scene/block/render-iframe.snippet.d.ts +11 -0
- package/lib/runjs-context/snippets/scene/block/render-iframe.snippet.js +57 -0
- package/lib/runjs-context/snippets/scene/block/render-info-card.snippet.d.ts +11 -0
- package/lib/runjs-context/snippets/scene/block/render-info-card.snippet.js +71 -0
- package/lib/runjs-context/snippets/scene/block/render-react-jsx.snippet.d.ts +11 -0
- package/lib/runjs-context/snippets/scene/{jsblock/render-card.snippet.js → block/render-react-jsx.snippet.js} +26 -13
- package/lib/runjs-context/snippets/scene/block/render-react.snippet.d.ts +11 -0
- package/lib/runjs-context/snippets/scene/{jsblock → block}/render-react.snippet.js +18 -17
- package/lib/runjs-context/snippets/scene/block/render-statistics.snippet.d.ts +11 -0
- package/lib/runjs-context/snippets/scene/block/render-statistics.snippet.js +95 -0
- package/lib/runjs-context/snippets/scene/block/render-timeline.snippet.d.ts +11 -0
- package/lib/runjs-context/snippets/scene/block/render-timeline.snippet.js +84 -0
- package/lib/runjs-context/snippets/scene/block/resource-example.snippet.d.ts +11 -0
- package/lib/runjs-context/snippets/scene/block/resource-example.snippet.js +60 -0
- package/lib/runjs-context/snippets/scene/block/three-users-orbit.snippet.d.ts +11 -0
- package/lib/runjs-context/snippets/scene/block/three-users-orbit.snippet.js +283 -0
- package/lib/runjs-context/snippets/scene/block/vue-component.snippet.d.ts +11 -0
- package/lib/runjs-context/snippets/scene/block/vue-component.snippet.js +124 -0
- package/lib/runjs-context/snippets/scene/detail/color-by-value.snippet.d.ts +11 -0
- package/lib/runjs-context/snippets/scene/{jsfield → detail}/color-by-value.snippet.js +13 -3
- package/lib/runjs-context/snippets/scene/detail/copy-to-clipboard.snippet.d.ts +11 -0
- package/lib/runjs-context/snippets/{global → scene/detail}/copy-to-clipboard.snippet.js +28 -6
- package/lib/runjs-context/snippets/scene/detail/format-number.snippet.d.ts +11 -0
- package/lib/runjs-context/snippets/scene/{jsfield → detail}/format-number.snippet.js +13 -3
- package/lib/runjs-context/snippets/scene/detail/innerHTML-value.snippet.d.ts +11 -0
- package/lib/runjs-context/snippets/scene/{jsfield → detail}/innerHTML-value.snippet.js +13 -3
- package/lib/runjs-context/snippets/scene/detail/percentage-bar.snippet.d.ts +11 -0
- package/lib/runjs-context/snippets/scene/detail/percentage-bar.snippet.js +82 -0
- package/lib/runjs-context/snippets/scene/detail/relative-time.snippet.d.ts +11 -0
- package/lib/runjs-context/snippets/scene/detail/relative-time.snippet.js +80 -0
- package/lib/runjs-context/snippets/scene/detail/status-tag.snippet.d.ts +11 -0
- package/lib/runjs-context/snippets/scene/detail/status-tag.snippet.js +74 -0
- package/lib/runjs-context/snippets/scene/form/calculate-total.snippet.d.ts +11 -0
- package/lib/runjs-context/snippets/scene/form/calculate-total.snippet.js +63 -0
- package/lib/runjs-context/snippets/scene/form/cascade-select.snippet.d.ts +11 -0
- package/lib/runjs-context/snippets/scene/form/cascade-select.snippet.js +81 -0
- package/lib/runjs-context/snippets/scene/form/conditional-required.snippet.d.ts +11 -0
- package/lib/runjs-context/snippets/scene/form/conditional-required.snippet.js +64 -0
- package/lib/runjs-context/snippets/scene/form/copy-field-values.snippet.d.ts +11 -0
- package/lib/runjs-context/snippets/scene/form/copy-field-values.snippet.js +74 -0
- package/lib/runjs-context/snippets/scene/form/render-basic.snippet.d.ts +11 -0
- package/lib/runjs-context/snippets/scene/{jsitem → form}/render-basic.snippet.js +11 -2
- package/lib/runjs-context/snippets/scene/form/set-disabled.snippet.d.ts +11 -0
- package/lib/runjs-context/snippets/scene/{linkage → form}/set-disabled.snippet.js +12 -3
- package/lib/runjs-context/snippets/scene/form/set-field-value.snippet.d.ts +11 -0
- package/lib/runjs-context/snippets/scene/{linkage → form}/set-field-value.snippet.js +12 -3
- package/lib/runjs-context/snippets/scene/form/set-required.snippet.d.ts +11 -0
- package/lib/runjs-context/snippets/scene/{linkage → form}/set-required.snippet.js +12 -3
- package/lib/runjs-context/snippets/scene/form/toggle-multiple-fields.snippet.d.ts +11 -0
- package/lib/runjs-context/snippets/scene/form/toggle-multiple-fields.snippet.js +67 -0
- package/lib/runjs-context/snippets/scene/form/toggle-visible.snippet.d.ts +11 -0
- package/lib/runjs-context/snippets/scene/{linkage → form}/toggle-visible.snippet.js +12 -3
- package/lib/runjs-context/snippets/scene/table/cell-open-dialog.snippet.d.ts +11 -0
- package/lib/runjs-context/snippets/scene/table/cell-open-dialog.snippet.js +64 -0
- package/lib/runjs-context/snippets/scene/table/collection-selected-count.snippet.d.ts +11 -0
- package/lib/runjs-context/snippets/scene/{actions → table}/collection-selected-count.snippet.js +11 -2
- package/lib/runjs-context/snippets/scene/table/concat-fields.snippet.d.ts +11 -0
- package/lib/runjs-context/snippets/scene/table/concat-fields.snippet.js +79 -0
- package/lib/runjs-context/snippets/scene/table/destroy-selected.snippet.d.ts +11 -0
- package/lib/runjs-context/snippets/{global/log-json-record.snippet.js → scene/table/destroy-selected.snippet.js} +24 -11
- package/lib/runjs-context/snippets/scene/table/export-selected-json.snippet.d.ts +11 -0
- package/lib/runjs-context/snippets/scene/table/export-selected-json.snippet.js +64 -0
- package/lib/runjs-context/snippets/scene/table/iterate-selected-rows.snippet.d.ts +11 -0
- package/lib/runjs-context/snippets/scene/{actions → table}/iterate-selected-rows.snippet.js +11 -2
- package/lib/runjs-context/snippets/types.d.ts +9 -1
- package/lib/runjsLibs.d.ts +28 -0
- package/lib/runjsLibs.js +532 -0
- package/lib/scheduler/ModelOperationScheduler.d.ts +53 -0
- package/lib/scheduler/ModelOperationScheduler.js +262 -0
- package/lib/types.d.ts +66 -7
- package/lib/types.js +4 -3
- package/lib/utils/associationObjectVariable.d.ts +32 -0
- package/lib/utils/associationObjectVariable.js +157 -0
- package/lib/utils/createCollectionContextMeta.d.ts +1 -1
- package/lib/utils/createCollectionContextMeta.js +9 -4
- package/lib/utils/createEphemeralContext.d.ts +13 -0
- package/lib/utils/createEphemeralContext.js +140 -0
- package/lib/utils/flows.d.ts +10 -0
- package/lib/{runjs-context/snippets/global/console-log-ctx.snippet.js → utils/flows.js} +21 -14
- package/lib/utils/index.d.ts +9 -3
- package/lib/utils/index.js +30 -2
- package/lib/utils/jsxTransform.d.ts +15 -0
- package/lib/utils/jsxTransform.js +68 -0
- package/lib/utils/params-resolvers.js +19 -12
- package/lib/utils/parsePathnameToViewParams.d.ts +1 -1
- package/lib/utils/parsePathnameToViewParams.js +41 -5
- package/lib/utils/pruneFilter.d.ts +21 -0
- package/lib/{runjs-context/snippets/global/try-catch-async.snippet.js → utils/pruneFilter.js} +24 -16
- package/lib/utils/resolveModuleUrl.d.ts +58 -0
- package/lib/utils/resolveModuleUrl.js +65 -0
- package/lib/utils/runjsModuleLoader.d.ts +58 -0
- package/lib/utils/runjsModuleLoader.js +422 -0
- package/lib/utils/runjsTemplateCompat.d.ts +35 -0
- package/lib/utils/runjsTemplateCompat.js +743 -0
- package/lib/utils/safeGlobals.d.ts +6 -8
- package/lib/utils/safeGlobals.js +169 -14
- package/lib/utils/schema-utils.d.ts +6 -0
- package/lib/utils/schema-utils.js +71 -6
- package/lib/utils/serverContextParams.d.ts +4 -0
- package/lib/utils/serverContextParams.js +2 -0
- package/lib/utils/translation.d.ts +4 -1
- package/lib/utils/translation.js +6 -2
- package/lib/utils/variablesParams.d.ts +22 -5
- package/lib/utils/variablesParams.js +141 -61
- package/lib/views/DialogComponent.js +1 -5
- package/lib/views/DrawerComponent.js +18 -9
- package/lib/views/PageComponent.js +5 -5
- package/lib/views/ViewNavigation.d.ts +11 -15
- package/lib/views/ViewNavigation.js +37 -19
- package/lib/views/createViewMeta.d.ts +27 -5
- package/lib/views/createViewMeta.js +338 -72
- package/lib/views/index.d.ts +1 -1
- package/lib/views/index.js +4 -0
- package/lib/views/useDialog.d.ts +10 -9
- package/lib/views/useDialog.js +46 -34
- package/lib/views/useDrawer.d.ts +10 -9
- package/lib/views/useDrawer.js +74 -48
- package/lib/views/usePage.d.ts +14 -9
- package/lib/views/usePage.js +82 -33
- package/lib/views/usePopover.js +4 -1
- package/lib/views/viewEvents.d.ts +17 -0
- package/lib/views/viewEvents.js +90 -0
- package/package.json +6 -3
- package/src/BlockScopedFlowEngine.ts +85 -0
- package/src/FlowContextProvider.tsx +4 -2
- package/src/JSRunner.ts +39 -1
- package/src/ViewScopedFlowEngine.ts +21 -1
- package/src/__tests__/JSRunner.test.ts +125 -52
- package/src/__tests__/blockScopedFlowEngine.test.ts +154 -0
- package/src/__tests__/createViewMeta.popup.test.ts +203 -0
- package/src/__tests__/flow-engine.test.ts +3 -0
- package/src/__tests__/flowContext.test.ts +160 -0
- package/src/__tests__/flowContextCreateJSRunner.test.ts +163 -0
- package/src/__tests__/flowEngine.dataSourceDirty.test.ts +63 -0
- package/src/__tests__/flowEngine.destroyModel.test.ts +74 -0
- package/src/__tests__/flowEngine.moveModel.test.ts +43 -0
- package/src/__tests__/flowEngine.removeModel.test.ts +72 -0
- package/src/__tests__/flowEngine.saveModel.test.ts +4 -0
- package/src/__tests__/flowModel.openView.navigation.test.ts +31 -2
- package/src/__tests__/flowRunJSContextDefine.test.ts +508 -0
- package/src/__tests__/flowSettings.open.test.tsx +71 -15
- package/src/__tests__/flowSettings.test.ts +2 -0
- package/src/__tests__/globalFlowRegistry.test.ts +1 -1
- package/src/__tests__/modelOperationScheduler.test.ts +346 -0
- package/src/__tests__/objectVariable.test.ts +464 -0
- package/src/__tests__/provider.test.tsx +0 -5
- package/src/__tests__/runjsContext.test.ts +219 -35
- package/src/__tests__/runjsContextImplementations.test.ts +217 -0
- package/src/__tests__/runjsContextRuntime.test.ts +269 -0
- package/src/__tests__/runjsEdgeCases.test.ts +281 -0
- package/src/__tests__/runjsExternalLibs.test.ts +242 -0
- package/src/__tests__/runjsLibsLazyLoading.test.ts +44 -0
- package/src/__tests__/runjsLocales.test.ts +39 -0
- package/src/__tests__/runjsPreprocessDefault.test.ts +49 -0
- package/src/__tests__/runjsRuntimeFeatures.test.ts +461 -0
- package/src/__tests__/runjsSnippets.test.ts +140 -0
- package/src/__tests__/viewScopedFlowEngine.test.ts +101 -3
- package/src/acl/Acl.tsx +85 -31
- package/src/acl/__tests__/Acl.test.tsx +43 -1
- package/src/components/DynamicFlowsEditor.tsx +0 -10
- package/src/components/FieldModelRenderer.tsx +22 -9
- package/src/components/FieldSkeleton.tsx +27 -0
- package/src/components/FlowContextSelector.tsx +20 -2
- package/src/components/FlowModelRenderer.tsx +52 -84
- package/src/components/FormItem.tsx +8 -1
- package/src/components/MobilePopup.style.ts +220 -0
- package/src/components/MobilePopup.tsx +86 -0
- package/src/components/__tests__/FlowModelRenderer.test.tsx +89 -0
- package/src/components/__tests__/flow-model-render-error-fallback.test.tsx +6 -6
- package/src/components/__tests__/gridDragPlanner.test.ts +141 -1
- package/src/components/common/withFlowDesignMode.tsx +5 -5
- package/src/components/dnd/gridDragPlanner.ts +60 -0
- package/src/components/index.ts +1 -0
- package/src/components/settings/independents/dropdown/FlowsDropdownButton.tsx +34 -17
- package/src/components/settings/wrappers/component/SelectWithTitle.tsx +110 -0
- package/src/components/settings/wrappers/component/SwitchWithTitle.tsx +83 -0
- package/src/components/settings/wrappers/component/__tests__/InlineControls.test.tsx +74 -0
- package/src/components/settings/wrappers/contextual/DefaultSettingsIcon.tsx +272 -125
- package/src/components/settings/wrappers/contextual/FlowsContextMenu.tsx +34 -18
- package/src/components/settings/wrappers/contextual/FlowsFloatContextMenu.tsx +56 -18
- package/src/components/settings/wrappers/contextual/StepSettings.tsx +1 -2
- package/src/components/settings/wrappers/contextual/StepSettingsDialog.tsx +13 -1
- package/src/components/settings/wrappers/contextual/__tests__/DefaultSettingsIcon.test.tsx +624 -0
- package/src/components/settings/wrappers/embedded/FlowSettings.tsx +47 -35
- package/src/components/settings/wrappers/embedded/FlowsSettings.tsx +1 -1
- package/src/components/settings/wrappers/embedded/FlowsSettingsContent.tsx +64 -42
- package/src/components/subModel/AddSubModelButton.tsx +104 -9
- package/src/components/subModel/LazyDropdown.tsx +14 -14
- package/src/components/subModel/__tests__/AddSubModelButton.test.tsx +168 -7
- package/src/components/subModel/__tests__/utils.test.ts +12 -12
- package/src/components/subModel/utils.ts +25 -6
- package/src/components/variables/VariableInput.tsx +32 -6
- package/src/components/variables/VariableTag.tsx +54 -2
- package/src/components/variables/types.ts +2 -0
- package/src/components/variables/utils.ts +7 -3
- package/src/data-source/index.ts +143 -12
- package/src/data-source/jioToJoiSchema.ts +1 -0
- package/src/emitter.ts +14 -0
- package/src/executor/FlowExecutor.ts +383 -119
- package/src/executor/__tests__/ctx-defs-injection.test.ts +197 -0
- package/src/executor/__tests__/flowExecutor.test.ts +217 -5
- package/src/flow-registry/GlobalFlowRegistry.ts +1 -0
- package/src/flow-registry/InstanceFlowRegistry.ts +1 -0
- package/src/flow-registry/__tests__/globalFlowRegistry.test.ts +54 -0
- package/src/flowContext.ts +646 -158
- package/src/flowEngine.ts +385 -14
- package/src/flowSettings.ts +59 -30
- package/src/hooks/useApplyAutoFlows.ts +5 -3
- package/src/index.ts +26 -3
- package/src/locale/de-DE.json +62 -0
- package/src/locale/en-US.json +57 -45
- package/src/locale/es-ES.json +62 -0
- package/src/locale/fr-FR.json +62 -0
- package/src/locale/hu-HU.json +62 -0
- package/src/locale/id-ID.json +62 -0
- package/src/locale/it-IT.json +62 -0
- package/src/locale/ja-JP.json +62 -0
- package/src/locale/ko-KR.json +62 -0
- package/src/locale/nl-NL.json +62 -0
- package/src/locale/pt-BR.json +62 -0
- package/src/locale/ru-RU.json +62 -0
- package/src/locale/tr-TR.json +62 -0
- package/src/locale/uk-UA.json +62 -0
- package/src/locale/vi-VN.json +62 -0
- package/src/locale/zh-CN.json +58 -46
- package/src/locale/zh-TW.json +62 -0
- package/src/models/CollectionFieldModel.tsx +82 -18
- package/src/models/__tests__/dispatchEvent.behavior.test.ts +169 -0
- package/src/models/__tests__/dispatchEvent.when.test.ts +356 -0
- package/src/models/__tests__/flowEngine.resolveUse.test.ts +170 -0
- package/src/models/__tests__/flowModel.clone.test.ts +416 -0
- package/src/models/__tests__/flowModel.getFlows.sort.test.ts +33 -9
- package/src/models/__tests__/flowModel.scheduleModelOperation.test.tsx +129 -0
- package/src/models/__tests__/flowModel.test.ts +296 -119
- package/src/models/__tests__/forkFlowModel.test.ts +40 -7
- package/src/models/flowModel.tsx +426 -148
- package/src/models/forkFlowModel.ts +48 -8
- package/src/provider.tsx +18 -14
- package/src/reactive/__tests__/observer.test.tsx +211 -0
- package/src/reactive/index.ts +11 -0
- package/src/reactive/observer.tsx +101 -0
- package/src/resources/__tests__/multiRecordResource.test.ts +44 -0
- package/src/resources/__tests__/sqlResource.test.ts +60 -0
- package/src/resources/baseRecordResource.ts +46 -3
- package/src/resources/multiRecordResource.ts +28 -12
- package/src/resources/singleRecordResource.ts +9 -3
- package/src/resources/sqlResource.ts +33 -32
- package/src/runjs-context/contexts/FormJSFieldItemRunJSContext.ts +38 -21
- package/src/runjs-context/contexts/JSBlockRunJSContext.ts +50 -34
- package/src/runjs-context/contexts/JSCollectionActionRunJSContext.ts +15 -16
- package/src/runjs-context/contexts/JSColumnRunJSContext.ts +58 -0
- package/src/runjs-context/contexts/JSEditableFieldRunJSContext.ts +106 -0
- package/src/runjs-context/contexts/JSFieldRunJSContext.ts +30 -25
- package/src/runjs-context/contexts/JSItemRunJSContext.ts +35 -21
- package/src/runjs-context/contexts/JSRecordActionRunJSContext.ts +17 -18
- package/src/runjs-context/contexts/base.ts +871 -0
- package/src/runjs-context/contributions.ts +88 -0
- package/src/runjs-context/helpers.ts +32 -30
- package/src/runjs-context/registry.ts +16 -47
- package/src/runjs-context/setup.ts +57 -0
- package/src/runjs-context/snippets/global/api-request.snippet.ts +38 -0
- package/src/runjs-context/snippets/global/clipboard-copy-text.snippet.ts +42 -0
- package/src/runjs-context/snippets/global/import-esm.snippet.ts +39 -0
- package/src/runjs-context/snippets/global/message-error.snippet.ts +6 -0
- package/src/runjs-context/snippets/global/message-success.snippet.ts +6 -0
- package/src/runjs-context/snippets/global/notification-open.snippet.ts +11 -1
- package/src/runjs-context/snippets/global/open-view-dialog.snippet.ts +10 -3
- package/src/runjs-context/snippets/global/open-view-drawer.snippet.ts +10 -3
- package/src/runjs-context/snippets/global/query-selector.snippet.ts +34 -0
- package/src/runjs-context/snippets/global/require-amd.snippet.ts +30 -0
- package/src/runjs-context/snippets/global/window-open.snippet.ts +11 -1
- package/src/runjs-context/snippets/index.ts +212 -39
- package/src/runjs-context/snippets/scene/{jsblock → block}/add-event-listener.snippet.ts +14 -2
- package/src/runjs-context/snippets/scene/block/api-fetch-render-list.snippet.ts +45 -0
- package/src/runjs-context/snippets/scene/block/chartjs-bar.snippet.ts +80 -0
- package/src/runjs-context/snippets/scene/block/echarts-init.snippet.ts +44 -0
- package/src/runjs-context/snippets/scene/block/render-antd-icons.snippet.ts +46 -0
- package/src/runjs-context/snippets/scene/block/render-button-handler.snippet.ts +35 -0
- package/src/runjs-context/snippets/scene/block/render-iframe.snippet.ts +38 -0
- package/src/runjs-context/snippets/scene/block/render-info-card.snippet.ts +52 -0
- package/src/runjs-context/snippets/scene/block/render-react-jsx.snippet.ts +39 -0
- package/src/runjs-context/snippets/scene/block/render-react.snippet.ts +38 -0
- package/src/runjs-context/snippets/scene/block/render-statistics.snippet.ts +76 -0
- package/src/runjs-context/snippets/scene/block/render-timeline.snippet.ts +65 -0
- package/src/runjs-context/snippets/scene/block/resource-example.snippet.ts +46 -0
- package/src/runjs-context/snippets/scene/block/three-users-orbit.snippet.ts +264 -0
- package/src/runjs-context/snippets/scene/block/vue-component.snippet.ts +105 -0
- package/src/runjs-context/snippets/scene/detail/color-by-value.snippet.ts +33 -0
- package/src/runjs-context/snippets/scene/detail/copy-to-clipboard.snippet.ts +45 -0
- package/src/runjs-context/snippets/scene/detail/format-number.snippet.ts +32 -0
- package/src/runjs-context/snippets/scene/detail/innerHTML-value.snippet.ts +31 -0
- package/src/runjs-context/snippets/scene/detail/percentage-bar.snippet.ts +63 -0
- package/src/runjs-context/snippets/scene/detail/relative-time.snippet.ts +61 -0
- package/src/runjs-context/snippets/scene/detail/status-tag.snippet.ts +55 -0
- package/src/runjs-context/snippets/scene/form/calculate-total.snippet.ts +44 -0
- package/src/runjs-context/snippets/scene/form/cascade-select.snippet.ts +62 -0
- package/src/runjs-context/snippets/scene/form/conditional-required.snippet.ts +45 -0
- package/src/runjs-context/snippets/scene/form/copy-field-values.snippet.ts +55 -0
- package/src/runjs-context/snippets/scene/{jsitem → form}/render-basic.snippet.ts +14 -2
- package/src/runjs-context/snippets/scene/{linkage → form}/set-disabled.snippet.ts +15 -3
- package/src/runjs-context/snippets/scene/{linkage → form}/set-field-value.snippet.ts +15 -3
- package/src/runjs-context/snippets/scene/{linkage → form}/set-required.snippet.ts +15 -3
- package/src/runjs-context/snippets/scene/form/toggle-multiple-fields.snippet.ts +48 -0
- package/src/runjs-context/snippets/scene/{linkage → form}/toggle-visible.snippet.ts +15 -3
- package/src/runjs-context/snippets/scene/table/cell-open-dialog.snippet.ts +45 -0
- package/src/runjs-context/snippets/scene/{actions → table}/collection-selected-count.snippet.ts +14 -2
- package/src/runjs-context/snippets/scene/table/concat-fields.snippet.ts +60 -0
- package/src/runjs-context/snippets/scene/table/destroy-selected.snippet.ts +36 -0
- package/src/runjs-context/snippets/scene/table/export-selected-json.snippet.ts +45 -0
- package/src/runjs-context/snippets/scene/{actions → table}/iterate-selected-rows.snippet.ts +14 -2
- package/src/runjs-context/snippets/types.ts +5 -1
- package/src/runjsLibs.ts +622 -0
- package/src/scheduler/ModelOperationScheduler.ts +306 -0
- package/src/types.ts +86 -5
- package/src/utils/__tests__/createCollectionContextMeta.test.ts +51 -0
- package/src/utils/__tests__/flows.test.ts +65 -0
- package/src/utils/__tests__/jsxTransform.test.ts +38 -0
- package/src/utils/__tests__/params-resolvers.test.ts +40 -0
- package/src/utils/__tests__/parsePathnameToViewParams.test.ts +25 -0
- package/src/utils/__tests__/pruneFilter.test.ts +38 -0
- package/src/utils/__tests__/runjsRequireAsyncAutoWhitelist.test.ts +38 -0
- package/src/utils/__tests__/runjsTemplateCompat.test.ts +159 -0
- package/src/utils/__tests__/safeGlobals.test.ts +79 -2
- package/src/utils/__tests__/utils.test.ts +114 -15
- package/src/utils/__tests__/variablesParams.test.ts +120 -0
- package/src/utils/associationObjectVariable.ts +180 -0
- package/src/utils/createCollectionContextMeta.ts +9 -3
- package/src/utils/createEphemeralContext.ts +142 -0
- package/src/utils/flows.ts +23 -0
- package/src/utils/index.ts +17 -3
- package/src/utils/jsxTransform.ts +39 -0
- package/src/utils/params-resolvers.ts +25 -11
- package/src/utils/parsePathnameToViewParams.ts +50 -6
- package/src/utils/pruneFilter.ts +41 -0
- package/src/utils/resolveModuleUrl.ts +91 -0
- package/src/utils/runjsModuleLoader.ts +553 -0
- package/src/utils/runjsTemplateCompat.ts +828 -0
- package/src/utils/safeGlobals.ts +181 -15
- package/src/utils/schema-utils.ts +81 -3
- package/src/utils/serverContextParams.ts +6 -0
- package/src/utils/translation.ts +7 -2
- package/src/utils/variablesParams.ts +164 -72
- package/src/views/DialogComponent.tsx +1 -4
- package/src/views/DrawerComponent.tsx +19 -7
- package/src/views/PageComponent.tsx +3 -5
- package/src/views/ViewNavigation.ts +49 -43
- package/src/views/__tests__/FlowView.usePage.test.tsx +186 -0
- package/src/views/__tests__/ViewNavigation.test.ts +54 -34
- package/src/views/__tests__/useDialog.closeDestroy.test.tsx +159 -0
- package/src/views/__tests__/viewEvents.resolveOpenerEngine.test.ts +28 -0
- package/src/views/createViewMeta.ts +402 -73
- package/src/views/index.tsx +1 -1
- package/src/views/useDialog.tsx +52 -31
- package/src/views/useDrawer.tsx +99 -55
- package/src/views/usePage.tsx +101 -33
- package/src/views/usePopover.tsx +4 -1
- package/src/views/viewEvents.ts +55 -0
- package/lib/runjs-context/contexts/FlowRunJSContext.d.ts +0 -38
- package/lib/runjs-context/contexts/FlowRunJSContext.js +0 -217
- package/lib/runjs-context/contexts/LinkageRunJSContext.js +0 -62
- package/lib/runjs-context/index.d.ts +0 -19
- package/lib/runjs-context/index.js +0 -57
- package/lib/runjs-context/snippets/global/api-request-get.snippet.d.ts +0 -16
- package/lib/runjs-context/snippets/global/api-request-get.snippet.js +0 -42
- package/lib/runjs-context/snippets/global/api-request-post.snippet.d.ts +0 -16
- package/lib/runjs-context/snippets/global/console-log-ctx.snippet.d.ts +0 -16
- package/lib/runjs-context/snippets/global/requireAsync.snippet.d.ts +0 -16
- package/lib/runjs-context/snippets/global/sleep.snippet.d.ts +0 -16
- package/lib/runjs-context/snippets/global/sleep.snippet.js +0 -43
- package/lib/runjs-context/snippets/global/try-catch-async.snippet.d.ts +0 -16
- package/lib/runjs-context/snippets/libs/echarts-init.snippet.d.ts +0 -15
- package/lib/runjs-context/snippets/scene/actions/collection-selected-count.snippet.d.ts +0 -15
- package/lib/runjs-context/snippets/scene/actions/iterate-selected-rows.snippet.d.ts +0 -15
- package/lib/runjs-context/snippets/scene/actions/record-id-message.snippet.d.ts +0 -15
- package/lib/runjs-context/snippets/scene/actions/record-id-message.snippet.js +0 -43
- package/lib/runjs-context/snippets/scene/actions/run-action-basic.snippet.d.ts +0 -15
- package/lib/runjs-context/snippets/scene/actions/run-action-basic.snippet.js +0 -40
- package/lib/runjs-context/snippets/scene/jsblock/add-event-listener.snippet.d.ts +0 -15
- package/lib/runjs-context/snippets/scene/jsblock/append-style.snippet.d.ts +0 -15
- package/lib/runjs-context/snippets/scene/jsblock/append-style.snippet.js +0 -42
- package/lib/runjs-context/snippets/scene/jsblock/jsx-mount.snippet.d.ts +0 -15
- package/lib/runjs-context/snippets/scene/jsblock/jsx-mount.snippet.js +0 -46
- package/lib/runjs-context/snippets/scene/jsblock/jsx-unmount.snippet.d.ts +0 -15
- package/lib/runjs-context/snippets/scene/jsblock/jsx-unmount.snippet.js +0 -41
- package/lib/runjs-context/snippets/scene/jsblock/render-basic.snippet.d.ts +0 -15
- package/lib/runjs-context/snippets/scene/jsblock/render-basic.snippet.js +0 -41
- package/lib/runjs-context/snippets/scene/jsblock/render-button-handler.snippet.d.ts +0 -15
- package/lib/runjs-context/snippets/scene/jsblock/render-react.snippet.d.ts +0 -15
- package/lib/runjs-context/snippets/scene/jsfield/color-by-value.snippet.d.ts +0 -15
- package/lib/runjs-context/snippets/scene/jsfield/format-number.snippet.d.ts +0 -15
- package/lib/runjs-context/snippets/scene/jsfield/innerHTML-value.snippet.d.ts +0 -15
- package/lib/runjs-context/snippets/scene/jsitem/render-basic.snippet.d.ts +0 -15
- package/lib/runjs-context/snippets/scene/linkage/set-disabled.snippet.d.ts +0 -15
- package/lib/runjs-context/snippets/scene/linkage/set-field-value.snippet.d.ts +0 -15
- package/lib/runjs-context/snippets/scene/linkage/set-required.snippet.d.ts +0 -15
- package/lib/runjs-context/snippets/scene/linkage/toggle-visible.snippet.d.ts +0 -15
- package/src/runjs-context/contexts/FlowRunJSContext.ts +0 -190
- package/src/runjs-context/contexts/LinkageRunJSContext.ts +0 -35
- package/src/runjs-context/index.ts +0 -20
- package/src/runjs-context/snippets/global/api-request-get.snippet.ts +0 -20
- package/src/runjs-context/snippets/global/api-request-post.snippet.ts +0 -20
- package/src/runjs-context/snippets/global/console-log-ctx.snippet.ts +0 -19
- package/src/runjs-context/snippets/global/copy-record-json.snippet.ts +0 -21
- package/src/runjs-context/snippets/global/copy-to-clipboard.snippet.ts +0 -21
- package/src/runjs-context/snippets/global/log-json-record.snippet.ts +0 -21
- package/src/runjs-context/snippets/global/requireAsync.snippet.ts +0 -24
- package/src/runjs-context/snippets/global/sleep.snippet.ts +0 -21
- package/src/runjs-context/snippets/global/try-catch-async.snippet.ts +0 -22
- package/src/runjs-context/snippets/global/view-navigation-push.snippet.ts +0 -23
- package/src/runjs-context/snippets/libs/echarts-init.snippet.ts +0 -24
- package/src/runjs-context/snippets/scene/actions/record-id-message.snippet.ts +0 -21
- package/src/runjs-context/snippets/scene/actions/run-action-basic.snippet.ts +0 -18
- package/src/runjs-context/snippets/scene/jsblock/append-style.snippet.ts +0 -20
- package/src/runjs-context/snippets/scene/jsblock/jsx-mount.snippet.ts +0 -24
- package/src/runjs-context/snippets/scene/jsblock/jsx-unmount.snippet.ts +0 -19
- package/src/runjs-context/snippets/scene/jsblock/render-basic.snippet.ts +0 -24
- package/src/runjs-context/snippets/scene/jsblock/render-button-handler.snippet.ts +0 -24
- package/src/runjs-context/snippets/scene/jsblock/render-card.snippet.ts +0 -30
- package/src/runjs-context/snippets/scene/jsblock/render-react.snippet.ts +0 -34
- package/src/runjs-context/snippets/scene/jsfield/color-by-value.snippet.ts +0 -20
- package/src/runjs-context/snippets/scene/jsfield/format-number.snippet.ts +0 -19
- package/src/runjs-context/snippets/scene/jsfield/innerHTML-value.snippet.ts +0 -18
- /package/lib/runjs-context/snippets/global/{copy-record-json.snippet.d.ts → api-request.snippet.d.ts} +0 -0
- /package/lib/runjs-context/snippets/global/{copy-to-clipboard.snippet.d.ts → clipboard-copy-text.snippet.d.ts} +0 -0
- /package/lib/runjs-context/snippets/global/{log-json-record.snippet.d.ts → import-esm.snippet.d.ts} +0 -0
- /package/lib/runjs-context/snippets/global/{view-navigation-push.snippet.d.ts → query-selector.snippet.d.ts} +0 -0
- /package/lib/runjs-context/snippets/scene/{jsblock/render-card.snippet.d.ts → block/echarts-init.snippet.d.ts} +0 -0
package/lib/flowContext.js
CHANGED
|
@@ -51,7 +51,7 @@ __export(flowContext_exports, {
|
|
|
51
51
|
FlowEngineContext: () => FlowEngineContext,
|
|
52
52
|
FlowForkModelContext: () => FlowForkModelContext,
|
|
53
53
|
FlowModelContext: () => FlowModelContext,
|
|
54
|
-
|
|
54
|
+
FlowRunJSContext: () => FlowRunJSContext,
|
|
55
55
|
FlowRuntimeContext: () => FlowRuntimeContext
|
|
56
56
|
});
|
|
57
57
|
module.exports = __toCommonJS(flowContext_exports);
|
|
@@ -60,18 +60,25 @@ var antd = __toESM(require("antd"));
|
|
|
60
60
|
var import_lodash = __toESM(require("lodash"));
|
|
61
61
|
var import_qs = __toESM(require("qs"));
|
|
62
62
|
var import_react = __toESM(require("react"));
|
|
63
|
+
var ReactDOMClient = __toESM(require("react-dom/client"));
|
|
64
|
+
var import_ElementProxy = require("./ElementProxy");
|
|
63
65
|
var import_Acl = require("./acl/Acl");
|
|
64
66
|
var import_ContextPathProxy = require("./ContextPathProxy");
|
|
65
67
|
var import_data_source = require("./data-source");
|
|
66
68
|
var import_flowEngine = require("./flowEngine");
|
|
67
69
|
var import_flowI18n = require("./flowI18n");
|
|
68
70
|
var import_JSRunner = require("./JSRunner");
|
|
69
|
-
var import_models = require("./models");
|
|
70
71
|
var import_resources = require("./resources");
|
|
71
72
|
var import_utils = require("./utils");
|
|
72
73
|
var import_exceptions = require("./utils/exceptions");
|
|
73
74
|
var import_params_resolvers = require("./utils/params-resolvers");
|
|
74
75
|
var import_serverContextParams = require("./utils/serverContextParams");
|
|
76
|
+
var import_variablesParams = require("./utils/variablesParams");
|
|
77
|
+
var import_registry = require("./runjs-context/registry");
|
|
78
|
+
var import_createEphemeralContext = require("./utils/createEphemeralContext");
|
|
79
|
+
var import_dayjs = __toESM(require("dayjs"));
|
|
80
|
+
var import_runjsLibs = require("./runjsLibs");
|
|
81
|
+
var import_runjsModuleLoader = require("./utils/runjsModuleLoader");
|
|
75
82
|
var _proxy, _FlowContext_instances, createChildNodes_fn, findMetaByPath_fn, findMetaInDelegatesDeep_fn, findMetaInProperty_fn, resolvePathInMeta_fn, resolvePathInMetaAsync_fn, buildParentTitles_fn, toTreeNode_fn;
|
|
76
83
|
function isRecordRefLike(val) {
|
|
77
84
|
return !!(val && typeof val === "object" && "collection" in val && "filterByTk" in val);
|
|
@@ -91,6 +98,50 @@ function filterBuilderOutputByPaths(built, neededPaths) {
|
|
|
91
98
|
return void 0;
|
|
92
99
|
}
|
|
93
100
|
__name(filterBuilderOutputByPaths, "filterBuilderOutputByPaths");
|
|
101
|
+
function topLevelOf(subPath) {
|
|
102
|
+
if (!subPath) return void 0;
|
|
103
|
+
const m = String(subPath).match(/^([^.[]+)/);
|
|
104
|
+
return m == null ? void 0 : m[1];
|
|
105
|
+
}
|
|
106
|
+
__name(topLevelOf, "topLevelOf");
|
|
107
|
+
function inferSelectsFromUsage(paths = []) {
|
|
108
|
+
if (!Array.isArray(paths) || paths.length === 0) {
|
|
109
|
+
return { generatedAppends: void 0, generatedFields: void 0 };
|
|
110
|
+
}
|
|
111
|
+
const appendSet = /* @__PURE__ */ new Set();
|
|
112
|
+
const fieldSet = /* @__PURE__ */ new Set();
|
|
113
|
+
const normalizePath = /* @__PURE__ */ __name((raw) => {
|
|
114
|
+
if (!raw) return "";
|
|
115
|
+
let s = String(raw);
|
|
116
|
+
s = s.replace(/\[(?:\d+)\]/g, "");
|
|
117
|
+
s = s.replace(/\[(?:"((?:[^"\\]|\\.)*)"|'((?:[^'\\]|\\.)*)')\]/g, (_m, g1, g2) => `.${g1 || g2}`);
|
|
118
|
+
s = s.replace(/\.\.+/g, ".");
|
|
119
|
+
s = s.replace(/^\./, "").replace(/\.$/, "");
|
|
120
|
+
return s;
|
|
121
|
+
}, "normalizePath");
|
|
122
|
+
for (let path of paths) {
|
|
123
|
+
if (!path) continue;
|
|
124
|
+
while (/^\[(\d+)\](\.|$)/.test(path)) {
|
|
125
|
+
path = path.replace(/^\[(\d+)\]\.?/, "");
|
|
126
|
+
}
|
|
127
|
+
const norm = normalizePath(path);
|
|
128
|
+
if (!norm) continue;
|
|
129
|
+
const segments = norm.split(".").filter(Boolean);
|
|
130
|
+
if (segments.length === 0) continue;
|
|
131
|
+
if (segments.length === 1) {
|
|
132
|
+
fieldSet.add(segments[0]);
|
|
133
|
+
continue;
|
|
134
|
+
}
|
|
135
|
+
for (let i = 0; i < segments.length - 1; i++) {
|
|
136
|
+
appendSet.add(segments.slice(0, i + 1).join("."));
|
|
137
|
+
}
|
|
138
|
+
fieldSet.add(segments.join("."));
|
|
139
|
+
}
|
|
140
|
+
const generatedAppends = appendSet.size ? Array.from(appendSet) : void 0;
|
|
141
|
+
const generatedFields = fieldSet.size ? Array.from(fieldSet) : void 0;
|
|
142
|
+
return { generatedAppends, generatedFields };
|
|
143
|
+
}
|
|
144
|
+
__name(inferSelectsFromUsage, "inferSelectsFromUsage");
|
|
94
145
|
const _FlowContext = class _FlowContext {
|
|
95
146
|
constructor() {
|
|
96
147
|
__privateAdd(this, _FlowContext_instances);
|
|
@@ -418,6 +469,73 @@ const _FlowContext = class _FlowContext {
|
|
|
418
469
|
}
|
|
419
470
|
return this._findPropertyInDelegates(this._delegates, key);
|
|
420
471
|
}
|
|
472
|
+
/**
|
|
473
|
+
* 获取当前上下文可用的顶层 API 信息(主要用于编辑器补全/工具)。
|
|
474
|
+
*
|
|
475
|
+
* 注意:
|
|
476
|
+
* - 目前返回值以“尽量可用”为目标,允许不完整。
|
|
477
|
+
* - 该方法不会展开变量 meta(变量结构应由 `getPropertyMetaTree()`/VariableInput 等机制负责)。
|
|
478
|
+
*/
|
|
479
|
+
async getApiInfos(options = {}) {
|
|
480
|
+
var _a, _b, _c, _d, _e;
|
|
481
|
+
const version = (options == null ? void 0 : options.version) || "v1";
|
|
482
|
+
const modelClass = (0, import_registry.getModelClassName)(this);
|
|
483
|
+
const Ctor = import_registry.RunJSContextRegistry.resolve(version, modelClass) || import_registry.RunJSContextRegistry.resolve(version, "*");
|
|
484
|
+
const locale = ((_b = (_a = this == null ? void 0 : this.api) == null ? void 0 : _a.auth) == null ? void 0 : _b.locale) || ((_c = this == null ? void 0 : this.i18n) == null ? void 0 : _c.language) || (this == null ? void 0 : this.locale);
|
|
485
|
+
let doc = {};
|
|
486
|
+
try {
|
|
487
|
+
if ((_d = Ctor == null ? void 0 : Ctor.getDoc) == null ? void 0 : _d.length) doc = Ctor.getDoc(locale) || {};
|
|
488
|
+
else doc = ((_e = Ctor == null ? void 0 : Ctor.getDoc) == null ? void 0 : _e.call(Ctor)) || {};
|
|
489
|
+
} catch (_2) {
|
|
490
|
+
doc = {};
|
|
491
|
+
}
|
|
492
|
+
const isPrivateKey = /* @__PURE__ */ __name((key) => typeof key === "string" && key.startsWith("_"), "isPrivateKey");
|
|
493
|
+
const out = {};
|
|
494
|
+
const visited = /* @__PURE__ */ new WeakSet();
|
|
495
|
+
const walk = /* @__PURE__ */ __name((ctx) => {
|
|
496
|
+
if (!ctx || visited.has(ctx)) return;
|
|
497
|
+
visited.add(ctx);
|
|
498
|
+
try {
|
|
499
|
+
for (const key of Object.keys(ctx._props || {})) {
|
|
500
|
+
if (isPrivateKey(key)) continue;
|
|
501
|
+
if (typeof out[key] === "undefined") out[key] = { type: "property" };
|
|
502
|
+
}
|
|
503
|
+
} catch (_2) {
|
|
504
|
+
}
|
|
505
|
+
try {
|
|
506
|
+
for (const key of Object.keys(ctx._methods || {})) {
|
|
507
|
+
if (isPrivateKey(key)) continue;
|
|
508
|
+
if (typeof out[key] === "undefined") out[key] = { type: "function" };
|
|
509
|
+
}
|
|
510
|
+
} catch (_2) {
|
|
511
|
+
}
|
|
512
|
+
try {
|
|
513
|
+
const delegates = Array.isArray(ctx._delegates) ? ctx._delegates : [];
|
|
514
|
+
for (const d of delegates) walk(d);
|
|
515
|
+
} catch (_2) {
|
|
516
|
+
}
|
|
517
|
+
}, "walk");
|
|
518
|
+
walk(this);
|
|
519
|
+
return {
|
|
520
|
+
...out,
|
|
521
|
+
...(doc == null ? void 0 : doc.properties) || {},
|
|
522
|
+
...(doc == null ? void 0 : doc.methods) || {}
|
|
523
|
+
};
|
|
524
|
+
}
|
|
525
|
+
/**
|
|
526
|
+
* 变量结构信息(保留给编辑器/工具使用)。
|
|
527
|
+
* 当前实现为保底空对象,避免 RunJS doc 中补全到该方法时调用报错。
|
|
528
|
+
*/
|
|
529
|
+
async getVarInfos(_options = {}) {
|
|
530
|
+
return {};
|
|
531
|
+
}
|
|
532
|
+
/**
|
|
533
|
+
* 运行时环境信息(保留给编辑器/工具使用)。
|
|
534
|
+
* 当前实现为保底空对象,避免 RunJS doc 中补全到该方法时调用报错。
|
|
535
|
+
*/
|
|
536
|
+
async getEnvInfos() {
|
|
537
|
+
return {};
|
|
538
|
+
}
|
|
421
539
|
};
|
|
422
540
|
_proxy = new WeakMap();
|
|
423
541
|
_FlowContext_instances = new WeakSet();
|
|
@@ -585,12 +703,13 @@ toTreeNode_fn = /* @__PURE__ */ __name(function(name, metaOrFactory, paths = [na
|
|
|
585
703
|
return cached;
|
|
586
704
|
}
|
|
587
705
|
let node;
|
|
588
|
-
const
|
|
589
|
-
if (!m) return { disabled: false };
|
|
706
|
+
const computeStateFromMeta = /* @__PURE__ */ __name((m) => {
|
|
707
|
+
if (!m) return { disabled: false, hidden: false };
|
|
590
708
|
const disabledVal = typeof m.disabled === "function" ? m.disabled() : m.disabled;
|
|
591
709
|
const reason = typeof m.disabledReason === "function" ? m.disabledReason() : m.disabledReason;
|
|
592
|
-
|
|
593
|
-
|
|
710
|
+
const hiddenVal = typeof m.hidden === "function" ? m.hidden() : m.hidden;
|
|
711
|
+
return { disabled: !!disabledVal, reason, hidden: !!hiddenVal };
|
|
712
|
+
}, "computeStateFromMeta");
|
|
594
713
|
if (typeof metaOrFactory === "function") {
|
|
595
714
|
const initialTitle = name;
|
|
596
715
|
const hasChildrenHint = metaOrFactory.hasChildren;
|
|
@@ -601,19 +720,25 @@ toTreeNode_fn = /* @__PURE__ */ __name(function(name, metaOrFactory, paths = [na
|
|
|
601
720
|
type: "object",
|
|
602
721
|
// 初始类型
|
|
603
722
|
interface: void 0,
|
|
723
|
+
options: void 0,
|
|
604
724
|
uiSchema: void 0,
|
|
605
725
|
paths,
|
|
606
726
|
parentTitles: parentTitles.length > 0 ? parentTitles : void 0,
|
|
607
727
|
disabled: /* @__PURE__ */ __name(() => {
|
|
608
728
|
const maybe = metaOrFactory();
|
|
609
729
|
if (maybe && typeof maybe["then"] === "function") return false;
|
|
610
|
-
return
|
|
730
|
+
return computeStateFromMeta(maybe).disabled;
|
|
611
731
|
}, "disabled"),
|
|
612
732
|
disabledReason: /* @__PURE__ */ __name(() => {
|
|
613
733
|
const maybe = metaOrFactory();
|
|
614
734
|
if (maybe && typeof maybe["then"] === "function") return void 0;
|
|
615
|
-
return
|
|
735
|
+
return computeStateFromMeta(maybe).reason;
|
|
616
736
|
}, "disabledReason"),
|
|
737
|
+
hidden: /* @__PURE__ */ __name(() => {
|
|
738
|
+
const maybe = metaOrFactory();
|
|
739
|
+
if (maybe && typeof maybe["then"] === "function") return false;
|
|
740
|
+
return computeStateFromMeta(maybe).hidden;
|
|
741
|
+
}, "hidden"),
|
|
617
742
|
// 注意:即便 hasChildren === false,也只是“没有子节点”的 UI 提示;
|
|
618
743
|
// 节点自身依然通过 meta 工厂保持惰性特性(需要时可解析出 title/type 等)。
|
|
619
744
|
// 这里仅在 hasChildren !== false 时,提供子节点的懒加载逻辑。
|
|
@@ -624,6 +749,7 @@ toTreeNode_fn = /* @__PURE__ */ __name(function(name, metaOrFactory, paths = [na
|
|
|
624
749
|
node.title = finalTitle;
|
|
625
750
|
node.type = meta == null ? void 0 : meta.type;
|
|
626
751
|
node.interface = meta == null ? void 0 : meta.interface;
|
|
752
|
+
node.options = meta == null ? void 0 : meta.options;
|
|
627
753
|
node.uiSchema = meta == null ? void 0 : meta.uiSchema;
|
|
628
754
|
if (!(meta == null ? void 0 : meta.properties)) return [];
|
|
629
755
|
const childNodes = __privateMethod(this, _FlowContext_instances, createChildNodes_fn).call(this, meta.properties, paths, [...parentTitles, finalTitle], meta);
|
|
@@ -638,17 +764,19 @@ toTreeNode_fn = /* @__PURE__ */ __name(function(name, metaOrFactory, paths = [na
|
|
|
638
764
|
};
|
|
639
765
|
} else {
|
|
640
766
|
const nodeTitle = metaOrFactory.title;
|
|
641
|
-
const { disabled, reason } =
|
|
767
|
+
const { disabled, reason, hidden } = computeStateFromMeta(metaOrFactory);
|
|
642
768
|
node = {
|
|
643
769
|
name,
|
|
644
770
|
title: nodeTitle,
|
|
645
771
|
type: metaOrFactory.type,
|
|
646
772
|
interface: metaOrFactory.interface,
|
|
773
|
+
options: metaOrFactory.options,
|
|
647
774
|
uiSchema: metaOrFactory.uiSchema,
|
|
648
775
|
paths,
|
|
649
776
|
parentTitles: parentTitles.length > 0 ? parentTitles : void 0,
|
|
650
777
|
disabled,
|
|
651
778
|
disabledReason: reason,
|
|
779
|
+
hidden,
|
|
652
780
|
children: metaOrFactory.properties ? __privateMethod(this, _FlowContext_instances, createChildNodes_fn).call(this, metaOrFactory.properties, paths, [...parentTitles, nodeTitle], metaOrFactory) : void 0
|
|
653
781
|
};
|
|
654
782
|
}
|
|
@@ -657,36 +785,25 @@ toTreeNode_fn = /* @__PURE__ */ __name(function(name, metaOrFactory, paths = [na
|
|
|
657
785
|
}, "#toTreeNode");
|
|
658
786
|
__name(_FlowContext, "FlowContext");
|
|
659
787
|
let FlowContext = _FlowContext;
|
|
660
|
-
const
|
|
661
|
-
constructor(
|
|
788
|
+
const _BaseFlowEngineContext = class _BaseFlowEngineContext extends FlowContext {
|
|
789
|
+
constructor() {
|
|
662
790
|
super();
|
|
663
|
-
this.addDelegate(delegate);
|
|
664
|
-
this.defineProperty("React", { value: import_react.default });
|
|
665
|
-
this.defineProperty("antd", { value: antd });
|
|
666
791
|
this.defineMethod(
|
|
667
|
-
"
|
|
668
|
-
async (
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
model.dispatchEvent(eventName, { navigation: false, ...(_b = (_a = this.model) == null ? void 0 : _a["getInputArgs"]) == null ? void 0 : _b.call(_a), ...inputArgs });
|
|
679
|
-
} else {
|
|
680
|
-
this.message.error(this.t("Model with ID {{uid}} not found", { uid: modelOrUid }));
|
|
681
|
-
}
|
|
792
|
+
"runjs",
|
|
793
|
+
async function(code, variables, options) {
|
|
794
|
+
const { preprocessTemplates, ...runnerOptions } = options || {};
|
|
795
|
+
const mergedGlobals = { ...(runnerOptions == null ? void 0 : runnerOptions.globals) || {}, ...variables || {} };
|
|
796
|
+
const runner = await this.createJSRunner({
|
|
797
|
+
...runnerOptions || {},
|
|
798
|
+
globals: mergedGlobals
|
|
799
|
+
});
|
|
800
|
+
const shouldPreprocessTemplates = preprocessTemplates !== false;
|
|
801
|
+
const jsCode = await (0, import_utils.prepareRunJsCode)(String(code ?? ""), { preprocessTemplates: shouldPreprocessTemplates });
|
|
802
|
+
return runner.run(jsCode);
|
|
682
803
|
}
|
|
683
804
|
);
|
|
684
805
|
}
|
|
685
806
|
};
|
|
686
|
-
__name(_FlowRunjsContext, "FlowRunjsContext");
|
|
687
|
-
let FlowRunjsContext = _FlowRunjsContext;
|
|
688
|
-
const _BaseFlowEngineContext = class _BaseFlowEngineContext extends FlowContext {
|
|
689
|
-
};
|
|
690
807
|
__name(_BaseFlowEngineContext, "BaseFlowEngineContext");
|
|
691
808
|
let BaseFlowEngineContext = _BaseFlowEngineContext;
|
|
692
809
|
const _BaseFlowModelContext = class _BaseFlowModelContext extends BaseFlowEngineContext {
|
|
@@ -713,7 +830,8 @@ const _FlowEngineContext = class _FlowEngineContext extends BaseFlowEngineContex
|
|
|
713
830
|
value: this.engine
|
|
714
831
|
});
|
|
715
832
|
this.defineProperty("sql", {
|
|
716
|
-
get: /* @__PURE__ */ __name(() => new import_resources.FlowSQLRepository(
|
|
833
|
+
get: /* @__PURE__ */ __name((ctx) => new import_resources.FlowSQLRepository(ctx), "get"),
|
|
834
|
+
cache: false
|
|
717
835
|
});
|
|
718
836
|
this.defineProperty("dataSourceManager", {
|
|
719
837
|
value: dataSourceManager
|
|
@@ -722,14 +840,6 @@ const _FlowEngineContext = class _FlowEngineContext extends BaseFlowEngineContex
|
|
|
722
840
|
this.defineMethod("t", (keyOrTemplate, options) => {
|
|
723
841
|
return i18n.translate(keyOrTemplate, options);
|
|
724
842
|
});
|
|
725
|
-
this.defineMethod("runjs", async (code, variables, options) => {
|
|
726
|
-
const mergedGlobals = { ...(options == null ? void 0 : options.globals) || {}, ...variables || {} };
|
|
727
|
-
const runner = this.createJSRunner({
|
|
728
|
-
...options || {},
|
|
729
|
-
globals: mergedGlobals
|
|
730
|
-
});
|
|
731
|
-
return runner.run(code);
|
|
732
|
-
});
|
|
733
843
|
this.defineMethod("renderJson", function(template) {
|
|
734
844
|
return this.resolveJsonTemplate(template);
|
|
735
845
|
});
|
|
@@ -761,6 +871,21 @@ const _FlowEngineContext = class _FlowEngineContext extends BaseFlowEngineContex
|
|
|
761
871
|
const needServer = Object.keys(serverVarPaths).length > 0;
|
|
762
872
|
let serverResolved = template;
|
|
763
873
|
if (needServer) {
|
|
874
|
+
const inferRecordRefWithMeta = /* @__PURE__ */ __name((ctx) => {
|
|
875
|
+
var _a2, _b2, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
|
|
876
|
+
const ref = (0, import_variablesParams.inferRecordRef)(ctx);
|
|
877
|
+
if (ref) return ref;
|
|
878
|
+
try {
|
|
879
|
+
const tk = (_b2 = (_a2 = ctx == null ? void 0 : ctx.resource) == null ? void 0 : _a2.getMeta) == null ? void 0 : _b2.call(_a2, "currentFilterByTk");
|
|
880
|
+
if (typeof tk === "undefined" || tk === null) return void 0;
|
|
881
|
+
const collection = ((_c = ctx == null ? void 0 : ctx.collection) == null ? void 0 : _c.name) || ((_j = (_i = (_h = (_g = (_f = (_e = (_d = ctx == null ? void 0 : ctx.resource) == null ? void 0 : _d.getResourceName) == null ? void 0 : _e.call(_d)) == null ? void 0 : _f.split) == null ? void 0 : _g.call(_f, ".")) == null ? void 0 : _h.slice) == null ? void 0 : _i.call(_h, -1)) == null ? void 0 : _j[0]);
|
|
882
|
+
if (!collection) return void 0;
|
|
883
|
+
const dataSourceKey = ((_k = ctx == null ? void 0 : ctx.collection) == null ? void 0 : _k.dataSourceKey) || ((_m = (_l = ctx == null ? void 0 : ctx.resource) == null ? void 0 : _l.getDataSourceKey) == null ? void 0 : _m.call(_l));
|
|
884
|
+
return { collection, dataSourceKey, filterByTk: tk };
|
|
885
|
+
} catch (_2) {
|
|
886
|
+
return void 0;
|
|
887
|
+
}
|
|
888
|
+
}, "inferRecordRefWithMeta");
|
|
764
889
|
const collectFromMeta = /* @__PURE__ */ __name(async () => {
|
|
765
890
|
var _a2;
|
|
766
891
|
const out = {};
|
|
@@ -796,7 +921,54 @@ const _FlowEngineContext = class _FlowEngineContext extends BaseFlowEngineContex
|
|
|
796
921
|
}, "collectFromMeta");
|
|
797
922
|
const inputFromMeta = await collectFromMeta();
|
|
798
923
|
const autoInput = { ...inputFromMeta };
|
|
924
|
+
try {
|
|
925
|
+
const varName = "formValues";
|
|
926
|
+
const neededPaths = serverVarPaths[varName] || [];
|
|
927
|
+
if (neededPaths.length) {
|
|
928
|
+
const requiredTop = /* @__PURE__ */ new Set();
|
|
929
|
+
for (const p of neededPaths) {
|
|
930
|
+
const top = topLevelOf(p);
|
|
931
|
+
if (top) requiredTop.add(top);
|
|
932
|
+
}
|
|
933
|
+
const metaOut = inputFromMeta == null ? void 0 : inputFromMeta[varName];
|
|
934
|
+
const builtTop = /* @__PURE__ */ new Set();
|
|
935
|
+
if (metaOut && typeof metaOut === "object" && !Array.isArray(metaOut) && !isRecordRefLike(metaOut)) {
|
|
936
|
+
Object.keys(metaOut).forEach((k) => builtTop.add(k));
|
|
937
|
+
}
|
|
938
|
+
const missing = [...requiredTop].filter((k) => !builtTop.has(k));
|
|
939
|
+
if (missing.length) {
|
|
940
|
+
const ref = inferRecordRefWithMeta(this);
|
|
941
|
+
if (ref) {
|
|
942
|
+
const { generatedFields, generatedAppends } = inferSelectsFromUsage(neededPaths);
|
|
943
|
+
const recordRef = {
|
|
944
|
+
...ref,
|
|
945
|
+
fields: generatedFields,
|
|
946
|
+
appends: generatedAppends
|
|
947
|
+
};
|
|
948
|
+
const existing = autoInput[varName];
|
|
949
|
+
if (existing && typeof existing === "object" && !Array.isArray(existing) && !isRecordRefLike(existing)) {
|
|
950
|
+
for (const [k, v] of Object.entries(existing)) {
|
|
951
|
+
autoInput[`${varName}.${k}`] = v;
|
|
952
|
+
}
|
|
953
|
+
delete autoInput[varName];
|
|
954
|
+
}
|
|
955
|
+
autoInput[varName] = recordRef;
|
|
956
|
+
}
|
|
957
|
+
}
|
|
958
|
+
}
|
|
959
|
+
} catch (_2) {
|
|
960
|
+
}
|
|
799
961
|
const autoContextParams = Object.keys(autoInput).length ? (0, import_serverContextParams.buildServerContextParams)(this, autoInput) : void 0;
|
|
962
|
+
if (!autoContextParams) {
|
|
963
|
+
const keys = Object.keys(serverVarPaths);
|
|
964
|
+
const allOptional = keys.length > 0 && keys.every((k) => {
|
|
965
|
+
var _a2;
|
|
966
|
+
return (_a2 = this.getPropertyOptions(k)) == null ? void 0 : _a2.serverOnlyWhenContextParams;
|
|
967
|
+
});
|
|
968
|
+
if (allOptional) {
|
|
969
|
+
return (0, import_utils.resolveExpressions)(template, this);
|
|
970
|
+
}
|
|
971
|
+
}
|
|
800
972
|
if (this.api) {
|
|
801
973
|
try {
|
|
802
974
|
serverResolved = await (0, import_params_resolvers.enqueueVariablesResolve)(this, {
|
|
@@ -811,6 +983,19 @@ const _FlowEngineContext = class _FlowEngineContext extends BaseFlowEngineContex
|
|
|
811
983
|
}
|
|
812
984
|
return (0, import_utils.resolveExpressions)(serverResolved, this);
|
|
813
985
|
});
|
|
986
|
+
this.defineMethod(
|
|
987
|
+
"getVar",
|
|
988
|
+
async function(varPath) {
|
|
989
|
+
const raw = typeof varPath === "string" ? varPath : String(varPath ?? "");
|
|
990
|
+
const s = raw.trim();
|
|
991
|
+
if (!s) return void 0;
|
|
992
|
+
if (s !== "ctx" && !s.startsWith("ctx.")) {
|
|
993
|
+
throw new Error(`ctx.getVar(path) expects an expression starting with "ctx.", got: "${s}"`);
|
|
994
|
+
}
|
|
995
|
+
return this.resolveJsonTemplate(`{{ ${s} }}`);
|
|
996
|
+
},
|
|
997
|
+
'Resolve a ctx expression value by path (expression starts with "ctx.").'
|
|
998
|
+
);
|
|
814
999
|
this.defineProperty("requirejs", {
|
|
815
1000
|
get: /* @__PURE__ */ __name(() => {
|
|
816
1001
|
var _a, _b;
|
|
@@ -900,7 +1085,8 @@ const _FlowEngineContext = class _FlowEngineContext extends BaseFlowEngineContex
|
|
|
900
1085
|
user: this.user
|
|
901
1086
|
}), "get")
|
|
902
1087
|
});
|
|
903
|
-
this.defineMethod("loadCSS", async (
|
|
1088
|
+
this.defineMethod("loadCSS", async (href) => {
|
|
1089
|
+
const url = (0, import_utils.resolveModuleUrl)(href);
|
|
904
1090
|
return new Promise((resolve, reject) => {
|
|
905
1091
|
const existingLink = document.querySelector(`link[href="${url}"]`);
|
|
906
1092
|
if (existingLink) {
|
|
@@ -916,59 +1102,28 @@ const _FlowEngineContext = class _FlowEngineContext extends BaseFlowEngineContex
|
|
|
916
1102
|
});
|
|
917
1103
|
});
|
|
918
1104
|
this.defineMethod("requireAsync", async (url) => {
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
reject(new Error("requirejs is not available"));
|
|
922
|
-
return;
|
|
923
|
-
}
|
|
924
|
-
this.requirejs(
|
|
925
|
-
[url],
|
|
926
|
-
(...args) => {
|
|
927
|
-
resolve(args[0]);
|
|
928
|
-
},
|
|
929
|
-
reject
|
|
930
|
-
);
|
|
931
|
-
});
|
|
1105
|
+
const u = (0, import_utils.resolveModuleUrl)(url, { raw: true });
|
|
1106
|
+
return await (0, import_runjsModuleLoader.runjsRequireAsync)(this.requirejs, u);
|
|
932
1107
|
});
|
|
933
|
-
this.defineMethod("
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
ctx: runCtx,
|
|
939
|
-
window: (0, import_utils.createSafeWindow)(),
|
|
940
|
-
document: (0, import_utils.createSafeDocument)(),
|
|
941
|
-
...options == null ? void 0 : options.globals
|
|
942
|
-
}
|
|
943
|
-
});
|
|
1108
|
+
this.defineMethod("importAsync", async function(url) {
|
|
1109
|
+
if ((0, import_utils.isCssFile)(url)) {
|
|
1110
|
+
return this.loadCSS(url);
|
|
1111
|
+
}
|
|
1112
|
+
return await (0, import_runjsModuleLoader.runjsImportModule)(this, url, { importer: import_runjsModuleLoader.runjsImportAsync });
|
|
944
1113
|
});
|
|
945
|
-
this.defineMethod("
|
|
946
|
-
const content = String(text ?? "");
|
|
1114
|
+
this.defineMethod("createJSRunner", async function(options) {
|
|
947
1115
|
try {
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
}
|
|
952
|
-
} catch (e) {
|
|
1116
|
+
const mod = await import("./runjs-context/setup");
|
|
1117
|
+
if (typeof (mod == null ? void 0 : mod.setupRunJSContexts) === "function") await mod.setupRunJSContexts();
|
|
1118
|
+
} catch (_2) {
|
|
953
1119
|
}
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
document.body.appendChild(ta);
|
|
962
|
-
ta.focus();
|
|
963
|
-
ta.select();
|
|
964
|
-
const ok = document.execCommand("copy");
|
|
965
|
-
document.body.removeChild(ta);
|
|
966
|
-
if (ok) resolve();
|
|
967
|
-
else reject(new Error("execCommand copy failed"));
|
|
968
|
-
} catch (err) {
|
|
969
|
-
reject(err);
|
|
970
|
-
}
|
|
971
|
-
});
|
|
1120
|
+
const version = (options == null ? void 0 : options.version) || "v1";
|
|
1121
|
+
const modelClass = (0, import_registry.getModelClassName)(this);
|
|
1122
|
+
const Ctor = import_registry.RunJSContextRegistry.resolve(version, modelClass) || FlowRunJSContext;
|
|
1123
|
+
const runCtx = new Ctor(this);
|
|
1124
|
+
const globals = { ctx: runCtx, ...(options == null ? void 0 : options.globals) || {} };
|
|
1125
|
+
const { timeoutMs } = options || {};
|
|
1126
|
+
return new import_JSRunner.JSRunner({ globals, timeoutMs });
|
|
972
1127
|
});
|
|
973
1128
|
this.defineMethod("buildServerContextParams", function(input) {
|
|
974
1129
|
return (0, import_serverContextParams.buildServerContextParams)(this, input);
|
|
@@ -986,7 +1141,7 @@ const _FlowEngineContext = class _FlowEngineContext extends BaseFlowEngineContex
|
|
|
986
1141
|
"runAction",
|
|
987
1142
|
async function(actionName, params) {
|
|
988
1143
|
const def = this.engine.getAction(actionName);
|
|
989
|
-
const ctx =
|
|
1144
|
+
const ctx = await (0, import_createEphemeralContext.createEphemeralContext)(this, def);
|
|
990
1145
|
if (!def) {
|
|
991
1146
|
throw new Error(`Action '${actionName}' not found.`);
|
|
992
1147
|
}
|
|
@@ -1019,13 +1174,22 @@ const _FlowEngineContext = class _FlowEngineContext extends BaseFlowEngineContex
|
|
|
1019
1174
|
context: this.createProxy()
|
|
1020
1175
|
});
|
|
1021
1176
|
});
|
|
1177
|
+
this.defineMethod(
|
|
1178
|
+
"useResource",
|
|
1179
|
+
function(className) {
|
|
1180
|
+
if (this.has("resource")) return;
|
|
1181
|
+
this.defineProperty("resource", {
|
|
1182
|
+
get: /* @__PURE__ */ __name(() => this.createResource(className), "get")
|
|
1183
|
+
});
|
|
1184
|
+
}
|
|
1185
|
+
);
|
|
1022
1186
|
}
|
|
1023
1187
|
};
|
|
1024
1188
|
__name(_FlowEngineContext, "FlowEngineContext");
|
|
1025
1189
|
let FlowEngineContext = _FlowEngineContext;
|
|
1026
1190
|
const _FlowModelContext = class _FlowModelContext extends BaseFlowModelContext {
|
|
1027
1191
|
constructor(model) {
|
|
1028
|
-
if (!
|
|
1192
|
+
if (!model || typeof model !== "object") {
|
|
1029
1193
|
throw new Error("Invalid FlowModel instance");
|
|
1030
1194
|
}
|
|
1031
1195
|
super();
|
|
@@ -1033,13 +1197,6 @@ const _FlowModelContext = class _FlowModelContext extends BaseFlowModelContext {
|
|
|
1033
1197
|
this.defineMethod("onRefReady", (ref, cb, timeout) => {
|
|
1034
1198
|
this.engine.reactView.onRefReady(ref, cb, timeout);
|
|
1035
1199
|
});
|
|
1036
|
-
this.defineMethod("runjs", async (code, variables, options) => {
|
|
1037
|
-
const runner = this.createJSRunner({
|
|
1038
|
-
globals: variables,
|
|
1039
|
-
version: options == null ? void 0 : options.version
|
|
1040
|
-
});
|
|
1041
|
-
return runner.run(code);
|
|
1042
|
-
});
|
|
1043
1200
|
this.defineProperty("model", {
|
|
1044
1201
|
value: model
|
|
1045
1202
|
});
|
|
@@ -1051,14 +1208,23 @@ const _FlowModelContext = class _FlowModelContext extends BaseFlowModelContext {
|
|
|
1051
1208
|
}, "get")
|
|
1052
1209
|
});
|
|
1053
1210
|
this.defineMethod("openView", async function(uid, options) {
|
|
1054
|
-
var _a, _b, _c, _d, _e
|
|
1211
|
+
var _a, _b, _c, _d, _e;
|
|
1055
1212
|
const opts = { ...options };
|
|
1056
|
-
if (opts.defineProperties || opts.
|
|
1213
|
+
if (opts.defineProperties || opts.defineMethods) {
|
|
1057
1214
|
opts.navigation = false;
|
|
1058
1215
|
}
|
|
1059
1216
|
let model2 = null;
|
|
1060
1217
|
model2 = await this.engine.loadModel({ uid });
|
|
1061
1218
|
if (!model2) {
|
|
1219
|
+
const pickDefined = /* @__PURE__ */ __name((src, keys) => {
|
|
1220
|
+
const res = {};
|
|
1221
|
+
for (const k of keys) {
|
|
1222
|
+
if (typeof (src == null ? void 0 : src[k]) !== "undefined") {
|
|
1223
|
+
res[k] = src[k];
|
|
1224
|
+
}
|
|
1225
|
+
}
|
|
1226
|
+
return res;
|
|
1227
|
+
}, "pickDefined");
|
|
1062
1228
|
model2 = this.engine.createModel({
|
|
1063
1229
|
uid,
|
|
1064
1230
|
// 注意: 新建的 model 应该使用 ${parentModel.uid}-xxx 形式的 uid
|
|
@@ -1069,28 +1235,21 @@ const _FlowModelContext = class _FlowModelContext extends BaseFlowModelContext {
|
|
|
1069
1235
|
stepParams: {
|
|
1070
1236
|
popupSettings: {
|
|
1071
1237
|
openView: {
|
|
1072
|
-
|
|
1238
|
+
// 仅在创建时持久化一份默认配置;运行时以本次 opts 为准,避免多个 opener 互相覆盖。
|
|
1239
|
+
...pickDefined(opts, ["dataSourceKey", "collectionName", "associationName", "mode", "size"])
|
|
1073
1240
|
}
|
|
1074
1241
|
}
|
|
1075
1242
|
}
|
|
1076
1243
|
});
|
|
1077
1244
|
await model2.save();
|
|
1078
1245
|
}
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
openView: {
|
|
1082
|
-
...(_c = model2.getStepParams("popupSettings")) == null ? void 0 : _c.openView,
|
|
1083
|
-
...import_lodash.default.pick(opts, ["dataSourceKey", "collectionName", "associationName"])
|
|
1084
|
-
}
|
|
1085
|
-
});
|
|
1086
|
-
await model2.save();
|
|
1087
|
-
}
|
|
1088
|
-
const viewUid = (opts == null ? void 0 : opts.routeViewUid) ?? (opts == null ? void 0 : opts.viewUid) ?? (((_e = (_d = model2.stepParams) == null ? void 0 : _d.popupSettings) == null ? void 0 : _e.openView) ? model2.uid : this.model.uid);
|
|
1246
|
+
model2.setParent(this.model);
|
|
1247
|
+
const viewUid = (opts == null ? void 0 : opts.routeViewUid) ?? (opts == null ? void 0 : opts.viewUid) ?? (((_b = (_a = model2.stepParams) == null ? void 0 : _a.popupSettings) == null ? void 0 : _b.openView) ? model2.uid : this.model.uid);
|
|
1089
1248
|
const parentView = this.view;
|
|
1090
1249
|
const pendingType = (opts == null ? void 0 : opts.isMobileLayout) ? "embed" : (opts == null ? void 0 : opts.mode) || "drawer";
|
|
1091
1250
|
const pendingInputArgs = { ...opts, viewUid, navigation: opts.navigation };
|
|
1092
|
-
pendingInputArgs.filterByTk = pendingInputArgs.filterByTk || ((
|
|
1093
|
-
pendingInputArgs.sourceId = pendingInputArgs.sourceId || ((
|
|
1251
|
+
pendingInputArgs.filterByTk = pendingInputArgs.filterByTk || ((_c = this.inputArgs) == null ? void 0 : _c.filterByTk);
|
|
1252
|
+
pendingInputArgs.sourceId = pendingInputArgs.sourceId || ((_d = this.inputArgs) == null ? void 0 : _d.sourceId);
|
|
1094
1253
|
const pendingView = {
|
|
1095
1254
|
type: pendingType,
|
|
1096
1255
|
inputArgs: pendingInputArgs,
|
|
@@ -1099,12 +1258,25 @@ const _FlowModelContext = class _FlowModelContext extends BaseFlowModelContext {
|
|
|
1099
1258
|
engineCtx: this.engine.context
|
|
1100
1259
|
};
|
|
1101
1260
|
model2.context.defineProperty("view", { value: pendingView });
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1261
|
+
const popupFlow = (_e = model2.getFlow) == null ? void 0 : _e.call(model2, "popupSettings");
|
|
1262
|
+
const on = popupFlow == null ? void 0 : popupFlow.on;
|
|
1263
|
+
let openEventName = "click";
|
|
1264
|
+
if (typeof on === "string" && on) {
|
|
1265
|
+
openEventName = on;
|
|
1266
|
+
} else if (on && typeof on === "object" && typeof on.eventName === "string" && on.eventName) {
|
|
1267
|
+
openEventName = on.eventName;
|
|
1268
|
+
}
|
|
1269
|
+
await model2.dispatchEvent(
|
|
1270
|
+
openEventName,
|
|
1271
|
+
{
|
|
1272
|
+
// navigation: false, // TODO: 路由模式有bug,不支持多层同样viewId的弹窗,因此这里默认先用false
|
|
1273
|
+
// ...this.model?.['getInputArgs']?.(), // 避免部分关系字段信息丢失, 仿照 ClickableCollectionField 做法
|
|
1274
|
+
...opts
|
|
1275
|
+
},
|
|
1276
|
+
{
|
|
1277
|
+
debounce: true
|
|
1278
|
+
}
|
|
1279
|
+
);
|
|
1108
1280
|
});
|
|
1109
1281
|
this.defineMethod("getEvents", function() {
|
|
1110
1282
|
return this.model.getEvents();
|
|
@@ -1119,7 +1291,7 @@ const _FlowModelContext = class _FlowModelContext extends BaseFlowModelContext {
|
|
|
1119
1291
|
"runAction",
|
|
1120
1292
|
async function(actionName, params) {
|
|
1121
1293
|
const def = this.model.getAction(actionName);
|
|
1122
|
-
const ctx =
|
|
1294
|
+
const ctx = await (0, import_createEphemeralContext.createEphemeralContext)(this, def);
|
|
1123
1295
|
if (!def) {
|
|
1124
1296
|
throw new Error(`Action '${actionName}' not found.`);
|
|
1125
1297
|
}
|
|
@@ -1144,7 +1316,7 @@ __name(_FlowModelContext, "FlowModelContext");
|
|
|
1144
1316
|
let FlowModelContext = _FlowModelContext;
|
|
1145
1317
|
const _FlowForkModelContext = class _FlowForkModelContext extends BaseFlowModelContext {
|
|
1146
1318
|
constructor(master, fork) {
|
|
1147
|
-
if (!
|
|
1319
|
+
if (!master || typeof master !== "object") {
|
|
1148
1320
|
throw new Error("Invalid FlowModel instance");
|
|
1149
1321
|
}
|
|
1150
1322
|
super();
|
|
@@ -1164,13 +1336,6 @@ const _FlowForkModelContext = class _FlowForkModelContext extends BaseFlowModelC
|
|
|
1164
1336
|
return stableRef;
|
|
1165
1337
|
}, "get")
|
|
1166
1338
|
});
|
|
1167
|
-
this.defineMethod("runjs", async (code, variables, options) => {
|
|
1168
|
-
const runner = this.createJSRunner({
|
|
1169
|
-
globals: variables,
|
|
1170
|
-
version: options == null ? void 0 : options.version
|
|
1171
|
-
});
|
|
1172
|
-
return runner.run(code);
|
|
1173
|
-
});
|
|
1174
1339
|
}
|
|
1175
1340
|
};
|
|
1176
1341
|
__name(_FlowForkModelContext, "FlowForkModelContext");
|
|
@@ -1215,13 +1380,6 @@ const _FlowRuntimeContext = class _FlowRuntimeContext extends BaseFlowModelConte
|
|
|
1215
1380
|
this.defineMethod("onRefReady", (ref, cb, timeout) => {
|
|
1216
1381
|
this.engine.reactView.onRefReady(ref, cb, timeout);
|
|
1217
1382
|
});
|
|
1218
|
-
this.defineMethod("runjs", async (code, variables, options) => {
|
|
1219
|
-
const runner = this.createJSRunner({
|
|
1220
|
-
globals: variables,
|
|
1221
|
-
version: options == null ? void 0 : options.version
|
|
1222
|
-
});
|
|
1223
|
-
return runner.run(code);
|
|
1224
|
-
});
|
|
1225
1383
|
}
|
|
1226
1384
|
stepResults = {};
|
|
1227
1385
|
_getOwnProperty(key) {
|
|
@@ -1257,12 +1415,162 @@ const _FlowRuntimeContext = class _FlowRuntimeContext extends BaseFlowModelConte
|
|
|
1257
1415
|
};
|
|
1258
1416
|
__name(_FlowRuntimeContext, "FlowRuntimeContext");
|
|
1259
1417
|
let FlowRuntimeContext = _FlowRuntimeContext;
|
|
1418
|
+
const __runjsClassDefaultMeta = /* @__PURE__ */ new WeakMap();
|
|
1419
|
+
const __runjsClassLocaleMeta = /* @__PURE__ */ new WeakMap();
|
|
1420
|
+
const __runjsDocCache = /* @__PURE__ */ new WeakMap();
|
|
1421
|
+
function __runjsDeepMerge(base, patch) {
|
|
1422
|
+
if (patch === null) return void 0;
|
|
1423
|
+
if (Array.isArray(base) || Array.isArray(patch) || typeof base !== "object" || typeof patch !== "object") {
|
|
1424
|
+
return patch ?? base;
|
|
1425
|
+
}
|
|
1426
|
+
const out = { ...base };
|
|
1427
|
+
for (const k of Object.keys(patch)) {
|
|
1428
|
+
const v = __runjsDeepMerge(base == null ? void 0 : base[k], patch[k]);
|
|
1429
|
+
if (typeof v === "undefined") delete out[k];
|
|
1430
|
+
else out[k] = v;
|
|
1431
|
+
}
|
|
1432
|
+
return out;
|
|
1433
|
+
}
|
|
1434
|
+
__name(__runjsDeepMerge, "__runjsDeepMerge");
|
|
1435
|
+
const _FlowRunJSContext = class _FlowRunJSContext extends FlowContext {
|
|
1436
|
+
constructor(delegate) {
|
|
1437
|
+
super();
|
|
1438
|
+
this.addDelegate(delegate);
|
|
1439
|
+
this.defineProperty("React", { value: import_react.default });
|
|
1440
|
+
this.defineProperty("antd", { value: antd });
|
|
1441
|
+
this.defineProperty("dayjs", { value: import_dayjs.default });
|
|
1442
|
+
const ReactDOMShim = {
|
|
1443
|
+
...ReactDOMClient,
|
|
1444
|
+
createRoot: /* @__PURE__ */ __name((container, options) => {
|
|
1445
|
+
const realContainer = (container == null ? void 0 : container.__el) || container;
|
|
1446
|
+
return this.engine.reactView.createRoot(realContainer, options);
|
|
1447
|
+
}, "createRoot")
|
|
1448
|
+
};
|
|
1449
|
+
ReactDOMShim.__nbRunjsInternalShim = true;
|
|
1450
|
+
this.defineProperty("ReactDOM", { value: ReactDOMShim });
|
|
1451
|
+
(0, import_runjsLibs.setupRunJSLibs)(this);
|
|
1452
|
+
this.defineMethod(
|
|
1453
|
+
"render",
|
|
1454
|
+
function(vnode, container) {
|
|
1455
|
+
const el = container || this.element;
|
|
1456
|
+
if (!el) throw new Error("ctx.render: container not provided and ctx.element is not available");
|
|
1457
|
+
const containerEl = (el == null ? void 0 : el.__el) || el;
|
|
1458
|
+
const globalRef = globalThis;
|
|
1459
|
+
globalRef.__nbRunjsRoots = globalRef.__nbRunjsRoots || /* @__PURE__ */ new WeakMap();
|
|
1460
|
+
const rootMap = globalRef.__nbRunjsRoots;
|
|
1461
|
+
const disposeEntry = /* @__PURE__ */ __name((entry2) => {
|
|
1462
|
+
if (!entry2) return;
|
|
1463
|
+
if (entry2.disposeTheme && typeof entry2.disposeTheme === "function") {
|
|
1464
|
+
try {
|
|
1465
|
+
entry2.disposeTheme();
|
|
1466
|
+
} catch (_2) {
|
|
1467
|
+
}
|
|
1468
|
+
entry2.disposeTheme = void 0;
|
|
1469
|
+
}
|
|
1470
|
+
const root = entry2.root || entry2;
|
|
1471
|
+
if (root && typeof root.unmount === "function") {
|
|
1472
|
+
try {
|
|
1473
|
+
root.unmount();
|
|
1474
|
+
} catch (_2) {
|
|
1475
|
+
}
|
|
1476
|
+
}
|
|
1477
|
+
}, "disposeEntry");
|
|
1478
|
+
const unmountContainerRoot = /* @__PURE__ */ __name(() => {
|
|
1479
|
+
const existing = rootMap.get(containerEl);
|
|
1480
|
+
if (existing) {
|
|
1481
|
+
disposeEntry(existing);
|
|
1482
|
+
rootMap.delete(containerEl);
|
|
1483
|
+
}
|
|
1484
|
+
}, "unmountContainerRoot");
|
|
1485
|
+
if (typeof vnode === "string") {
|
|
1486
|
+
unmountContainerRoot();
|
|
1487
|
+
const proxy = new import_ElementProxy.ElementProxy(containerEl);
|
|
1488
|
+
proxy.innerHTML = String(vnode ?? "");
|
|
1489
|
+
return null;
|
|
1490
|
+
}
|
|
1491
|
+
if (vnode && vnode.nodeType && (vnode.nodeType === 1 || vnode.nodeType === 3 || vnode.nodeType === 11)) {
|
|
1492
|
+
unmountContainerRoot();
|
|
1493
|
+
while (containerEl.firstChild) containerEl.removeChild(containerEl.firstChild);
|
|
1494
|
+
containerEl.appendChild(vnode);
|
|
1495
|
+
return null;
|
|
1496
|
+
}
|
|
1497
|
+
const rendererKey = this.ReactDOM;
|
|
1498
|
+
const ownerKey = this;
|
|
1499
|
+
let entry = rootMap.get(containerEl);
|
|
1500
|
+
if (!entry || entry.rendererKey !== rendererKey || entry.ownerKey !== ownerKey) {
|
|
1501
|
+
if (entry) {
|
|
1502
|
+
disposeEntry(entry);
|
|
1503
|
+
rootMap.delete(containerEl);
|
|
1504
|
+
}
|
|
1505
|
+
const root = this.ReactDOM.createRoot(containerEl);
|
|
1506
|
+
entry = { rendererKey, ownerKey, root, disposeTheme: void 0, lastVnode: void 0 };
|
|
1507
|
+
rootMap.set(containerEl, entry);
|
|
1508
|
+
}
|
|
1509
|
+
return (0, import_runjsLibs.externalReactRender)({
|
|
1510
|
+
ctx: this,
|
|
1511
|
+
entry,
|
|
1512
|
+
vnode,
|
|
1513
|
+
containerEl,
|
|
1514
|
+
rootMap,
|
|
1515
|
+
unmountContainerRoot,
|
|
1516
|
+
internalReact: import_react.default,
|
|
1517
|
+
internalAntd: antd
|
|
1518
|
+
});
|
|
1519
|
+
}
|
|
1520
|
+
);
|
|
1521
|
+
}
|
|
1522
|
+
static define(meta, options) {
|
|
1523
|
+
const locale = options == null ? void 0 : options.locale;
|
|
1524
|
+
if (locale) {
|
|
1525
|
+
const map = __runjsClassLocaleMeta.get(this) || /* @__PURE__ */ new Map();
|
|
1526
|
+
const prev = map.get(locale) || {};
|
|
1527
|
+
map.set(locale, __runjsDeepMerge(prev, meta));
|
|
1528
|
+
__runjsClassLocaleMeta.set(this, map);
|
|
1529
|
+
} else {
|
|
1530
|
+
const prev = __runjsClassDefaultMeta.get(this) || {};
|
|
1531
|
+
__runjsClassDefaultMeta.set(this, __runjsDeepMerge(prev, meta));
|
|
1532
|
+
}
|
|
1533
|
+
__runjsDocCache.delete(this);
|
|
1534
|
+
}
|
|
1535
|
+
static getDoc(locale) {
|
|
1536
|
+
const self = this;
|
|
1537
|
+
let cacheForClass = __runjsDocCache.get(self);
|
|
1538
|
+
const cacheKey = String(locale || "default");
|
|
1539
|
+
if (cacheForClass && cacheForClass.has(cacheKey)) return cacheForClass.get(cacheKey);
|
|
1540
|
+
const chain = [];
|
|
1541
|
+
let cur = self;
|
|
1542
|
+
while (cur && cur.prototype) {
|
|
1543
|
+
chain.unshift(cur);
|
|
1544
|
+
cur = Object.getPrototypeOf(cur);
|
|
1545
|
+
}
|
|
1546
|
+
let merged = {};
|
|
1547
|
+
for (const cls of chain) {
|
|
1548
|
+
merged = __runjsDeepMerge(merged, __runjsClassDefaultMeta.get(cls) || {});
|
|
1549
|
+
}
|
|
1550
|
+
if (locale) {
|
|
1551
|
+
for (const cls of chain) {
|
|
1552
|
+
const lmap = __runjsClassLocaleMeta.get(cls);
|
|
1553
|
+
if (lmap && lmap.has(locale)) {
|
|
1554
|
+
merged = __runjsDeepMerge(merged, lmap.get(locale));
|
|
1555
|
+
}
|
|
1556
|
+
}
|
|
1557
|
+
}
|
|
1558
|
+
if (!cacheForClass) {
|
|
1559
|
+
cacheForClass = /* @__PURE__ */ new Map();
|
|
1560
|
+
__runjsDocCache.set(self, cacheForClass);
|
|
1561
|
+
}
|
|
1562
|
+
cacheForClass.set(cacheKey, merged);
|
|
1563
|
+
return merged;
|
|
1564
|
+
}
|
|
1565
|
+
};
|
|
1566
|
+
__name(_FlowRunJSContext, "FlowRunJSContext");
|
|
1567
|
+
let FlowRunJSContext = _FlowRunJSContext;
|
|
1260
1568
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1261
1569
|
0 && (module.exports = {
|
|
1262
1570
|
FlowContext,
|
|
1263
1571
|
FlowEngineContext,
|
|
1264
1572
|
FlowForkModelContext,
|
|
1265
1573
|
FlowModelContext,
|
|
1266
|
-
|
|
1574
|
+
FlowRunJSContext,
|
|
1267
1575
|
FlowRuntimeContext
|
|
1268
1576
|
});
|