udp-react-enterprise-component-library 27.0.0-next.12 → 27.0.0-next.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.tsbuildinfo +1 -1
- package/dist/UI/fluent-web-components/UdpIconPicker.d.ts +4 -1
- package/dist/UI/fluent-web-components/UdpIconPicker.d.ts.map +1 -1
- package/dist/UI/fluent-web-components/UdpIconPicker.js +2 -2
- package/dist/UI/fluent-web-components/UdpIconPicker.js.map +1 -1
- package/dist/UI/fluent-web-components/UdpIconPicker.mjs +32 -28
- package/dist/UI/fluent-web-components/UdpIconPicker.mjs.map +1 -1
- package/dist/UI/fluent-web-components/UdpLink.d.ts +6 -0
- package/dist/UI/fluent-web-components/UdpLink.d.ts.map +1 -1
- package/dist/UI/fluent-web-components/UdpLink.js.map +1 -1
- package/dist/UI/fluent-web-components/UdpLink.mjs.map +1 -1
- package/dist/UI/fluent-web-components/types.d.ts +2 -0
- package/dist/UI/fluent-web-components/types.d.ts.map +1 -1
- package/dist/UI/widgets/library/InquiryFindRecordsWidget/InquiryFindRecordsWidget.d.ts +16 -3
- package/dist/UI/widgets/library/InquiryFindRecordsWidget/InquiryFindRecordsWidget.d.ts.map +1 -1
- package/dist/UI/widgets/library/InquiryFindRecordsWidget/InquiryFindRecordsWidget.js +36 -13
- package/dist/UI/widgets/library/InquiryFindRecordsWidget/InquiryFindRecordsWidget.js.map +1 -1
- package/dist/UI/widgets/library/InquiryFindRecordsWidget/InquiryFindRecordsWidget.mjs +119 -62
- package/dist/UI/widgets/library/InquiryFindRecordsWidget/InquiryFindRecordsWidget.mjs.map +1 -1
- package/dist/UI/widgets/library/InquiryFindRecordsWidget/index.mjs +3 -2
- package/dist/UI/widgets/library/InquiryRecentRecordsWidget/InquiryRecentRecordsWidget.d.ts +9 -2
- package/dist/UI/widgets/library/InquiryRecentRecordsWidget/InquiryRecentRecordsWidget.d.ts.map +1 -1
- package/dist/UI/widgets/library/InquiryRecentRecordsWidget/InquiryRecentRecordsWidget.js +18 -18
- package/dist/UI/widgets/library/InquiryRecentRecordsWidget/InquiryRecentRecordsWidget.js.map +1 -1
- package/dist/UI/widgets/library/InquiryRecentRecordsWidget/InquiryRecentRecordsWidget.mjs +79 -67
- package/dist/UI/widgets/library/InquiryRecentRecordsWidget/InquiryRecentRecordsWidget.mjs.map +1 -1
- package/dist/UI/widgets/library/InquiryRemindersWidget/InquiryRemindersWidget.d.ts +8 -2
- package/dist/UI/widgets/library/InquiryRemindersWidget/InquiryRemindersWidget.d.ts.map +1 -1
- package/dist/UI/widgets/library/InquiryRemindersWidget/InquiryRemindersWidget.js +32 -16
- package/dist/UI/widgets/library/InquiryRemindersWidget/InquiryRemindersWidget.js.map +1 -1
- package/dist/UI/widgets/library/InquiryRemindersWidget/InquiryRemindersWidget.mjs +129 -102
- package/dist/UI/widgets/library/InquiryRemindersWidget/InquiryRemindersWidget.mjs.map +1 -1
- package/dist/UI/widgets/library/InquiryRemindersWidget/reminderRowModel.d.ts +3 -2
- package/dist/UI/widgets/library/InquiryRemindersWidget/reminderRowModel.d.ts.map +1 -1
- package/dist/UI/widgets/library/InquiryRemindersWidget/reminderRowModel.js +11 -12
- package/dist/UI/widgets/library/InquiryRemindersWidget/reminderRowModel.js.map +1 -1
- package/dist/UI/widgets/library/InquiryRemindersWidget/reminderRowModel.mjs +6 -4
- package/dist/UI/widgets/library/InquiryRemindersWidget/reminderRowModel.mjs.map +1 -1
- package/dist/UI/widgets/library/InquiryRemindersWidget/useInquiryReminders.d.ts +2 -19
- package/dist/UI/widgets/library/InquiryRemindersWidget/useInquiryReminders.d.ts.map +1 -1
- package/dist/UI/widgets/library/InquiryRemindersWidget/useInquiryReminders.js +4 -5
- package/dist/UI/widgets/library/InquiryRemindersWidget/useInquiryReminders.js.map +1 -1
- package/dist/UI/widgets/library/InquiryRemindersWidget/useInquiryReminders.mjs +5 -4
- package/dist/UI/widgets/library/InquiryRemindersWidget/useInquiryReminders.mjs.map +1 -1
- package/dist/actionPanels/index.d.ts +0 -2
- package/dist/actionPanels/index.d.ts.map +1 -1
- package/dist/actionPanels/index.js +0 -2
- package/dist/actionPanels/index.js.map +1 -1
- package/dist/actionPanels/panelActionFields.d.ts +9 -26
- package/dist/actionPanels/panelActionFields.d.ts.map +1 -1
- package/dist/actionPanels/panelActionFields.js +32 -55
- package/dist/actionPanels/panelActionFields.js.map +1 -1
- package/dist/actionPanels/panelActionFields.mjs +159 -375
- package/dist/actionPanels/panelActionFields.mjs.map +1 -1
- package/dist/actionPanels/panelOperations.d.ts +15 -41
- package/dist/actionPanels/panelOperations.d.ts.map +1 -1
- package/dist/actionPanels/panelOperations.js +51 -89
- package/dist/actionPanels/panelOperations.js.map +1 -1
- package/dist/actionPanels/panelOperations.mjs +37 -92
- package/dist/actionPanels/panelOperations.mjs.map +1 -1
- package/dist/domain/actionPanel/actionTypeMeta.d.ts +15 -2
- package/dist/domain/actionPanel/actionTypeMeta.d.ts.map +1 -1
- package/dist/domain/actionPanel/actionTypeMeta.js +21 -2
- package/dist/domain/actionPanel/actionTypeMeta.js.map +1 -1
- package/dist/domain/actionPanel/actionTypeMeta.mjs +18 -3
- package/dist/domain/actionPanel/actionTypeMeta.mjs.map +1 -1
- package/dist/domain/actionPanel/buttonOrder.d.ts +67 -0
- package/dist/domain/actionPanel/buttonOrder.d.ts.map +1 -0
- package/dist/domain/actionPanel/buttonOrder.js +105 -0
- package/dist/domain/actionPanel/buttonOrder.js.map +1 -0
- package/dist/domain/actionPanel/buttonOrder.mjs +90 -0
- package/dist/domain/actionPanel/buttonOrder.mjs.map +1 -0
- package/dist/domain/actionPanel/index.d.ts +1 -0
- package/dist/domain/actionPanel/index.d.ts.map +1 -1
- package/dist/domain/actionPanel/index.js +1 -0
- package/dist/domain/actionPanel/index.js.map +1 -1
- package/dist/domain/actionPanel/index.mjs +4 -3
- package/dist/domain/actionPanel/serialize.d.ts +6 -2
- package/dist/domain/actionPanel/serialize.d.ts.map +1 -1
- package/dist/domain/actionPanel/serialize.js +10 -3
- package/dist/domain/actionPanel/serialize.js.map +1 -1
- package/dist/domain/actionPanel/serialize.mjs +7 -3
- package/dist/domain/actionPanel/serialize.mjs.map +1 -1
- package/dist/domain/actionPanel/types.d.ts +24 -8
- package/dist/domain/actionPanel/types.d.ts.map +1 -1
- package/dist/domain/actionPanel/types.js.map +1 -1
- package/dist/domain/actionPanel/types.mjs.map +1 -1
- package/dist/domain/inquiryTree/describe.d.ts +15 -3
- package/dist/domain/inquiryTree/describe.d.ts.map +1 -1
- package/dist/domain/inquiryTree/describe.js +32 -28
- package/dist/domain/inquiryTree/describe.js.map +1 -1
- package/dist/domain/inquiryTree/describe.mjs +34 -16
- package/dist/domain/inquiryTree/describe.mjs.map +1 -1
- package/dist/domain/inquiryTree/displayTree.d.ts +75 -97
- package/dist/domain/inquiryTree/displayTree.d.ts.map +1 -1
- package/dist/domain/inquiryTree/displayTree.js +418 -551
- package/dist/domain/inquiryTree/displayTree.js.map +1 -1
- package/dist/domain/inquiryTree/displayTree.mjs +345 -414
- package/dist/domain/inquiryTree/displayTree.mjs.map +1 -1
- package/dist/domain/inquiryTree/groups.d.ts +2 -0
- package/dist/domain/inquiryTree/groups.d.ts.map +1 -1
- package/dist/domain/inquiryTree/groups.js.map +1 -1
- package/dist/domain/inquiryTree/groups.mjs.map +1 -1
- package/dist/domain/inquiryTree/index.d.ts +1 -1
- package/dist/domain/inquiryTree/index.d.ts.map +1 -1
- package/dist/domain/inquiryTree/index.js +1 -1
- package/dist/domain/inquiryTree/index.js.map +1 -1
- package/dist/domain/inquiryTree/index.mjs +12 -12
- package/dist/domain/inquiryTree/lazyLoad.d.ts +20 -129
- package/dist/domain/inquiryTree/lazyLoad.d.ts.map +1 -1
- package/dist/domain/inquiryTree/lazyLoad.js +48 -233
- package/dist/domain/inquiryTree/lazyLoad.js.map +1 -1
- package/dist/domain/inquiryTree/lazyLoad.mjs +32 -187
- package/dist/domain/inquiryTree/lazyLoad.mjs.map +1 -1
- package/dist/domain/inquiryTree/legalChildren.d.ts +13 -14
- package/dist/domain/inquiryTree/legalChildren.d.ts.map +1 -1
- package/dist/domain/inquiryTree/legalChildren.js +21 -42
- package/dist/domain/inquiryTree/legalChildren.js.map +1 -1
- package/dist/domain/inquiryTree/legalChildren.mjs +19 -37
- package/dist/domain/inquiryTree/legalChildren.mjs.map +1 -1
- package/dist/domain/inquiryTree/names.d.ts +38 -0
- package/dist/domain/inquiryTree/names.d.ts.map +1 -0
- package/dist/domain/inquiryTree/names.js +64 -0
- package/dist/domain/inquiryTree/names.js.map +1 -0
- package/dist/domain/inquiryTree/names.mjs +56 -0
- package/dist/domain/inquiryTree/names.mjs.map +1 -0
- package/dist/domain/inquiryTree/operations.d.ts +6 -2
- package/dist/domain/inquiryTree/operations.d.ts.map +1 -1
- package/dist/domain/inquiryTree/operations.js +17 -16
- package/dist/domain/inquiryTree/operations.js.map +1 -1
- package/dist/domain/inquiryTree/operations.mjs +14 -11
- package/dist/domain/inquiryTree/operations.mjs.map +1 -1
- package/dist/domain/inquiryTree/rules.d.ts +3 -4
- package/dist/domain/inquiryTree/rules.d.ts.map +1 -1
- package/dist/domain/inquiryTree/rules.js +3 -13
- package/dist/domain/inquiryTree/rules.js.map +1 -1
- package/dist/domain/inquiryTree/rules.mjs +3 -9
- package/dist/domain/inquiryTree/rules.mjs.map +1 -1
- package/dist/domain/inquiryTree/runtime.d.ts +23 -16
- package/dist/domain/inquiryTree/runtime.d.ts.map +1 -1
- package/dist/domain/inquiryTree/runtime.js +46 -54
- package/dist/domain/inquiryTree/runtime.js.map +1 -1
- package/dist/domain/inquiryTree/runtime.mjs +31 -26
- package/dist/domain/inquiryTree/runtime.mjs.map +1 -1
- package/dist/domain/inquiryTree/serialize.d.ts +20 -29
- package/dist/domain/inquiryTree/serialize.d.ts.map +1 -1
- package/dist/domain/inquiryTree/serialize.js +93 -205
- package/dist/domain/inquiryTree/serialize.js.map +1 -1
- package/dist/domain/inquiryTree/serialize.mjs +89 -180
- package/dist/domain/inquiryTree/serialize.mjs.map +1 -1
- package/dist/domain/inquiryTree/types.d.ts +146 -65
- package/dist/domain/inquiryTree/types.d.ts.map +1 -1
- package/dist/domain/inquiryTree/types.js +5 -0
- package/dist/domain/inquiryTree/types.js.map +1 -1
- package/dist/domain/inquiryTree/types.mjs +3 -1
- package/dist/domain/inquiryTree/types.mjs.map +1 -1
- package/dist/domain/inquiryTree/validate.d.ts +9 -2
- package/dist/domain/inquiryTree/validate.d.ts.map +1 -1
- package/dist/domain/inquiryTree/validate.js +30 -58
- package/dist/domain/inquiryTree/validate.js.map +1 -1
- package/dist/domain/inquiryTree/validate.mjs +29 -44
- package/dist/domain/inquiryTree/validate.mjs.map +1 -1
- package/dist/domain/inquiryTree/view.d.ts +8 -12
- package/dist/domain/inquiryTree/view.d.ts.map +1 -1
- package/dist/domain/inquiryTree/view.js +40 -66
- package/dist/domain/inquiryTree/view.js.map +1 -1
- package/dist/domain/inquiryTree/view.mjs +30 -60
- package/dist/domain/inquiryTree/view.mjs.map +1 -1
- package/dist/domain/inquiryTree/waveLoad.d.ts +32 -48
- package/dist/domain/inquiryTree/waveLoad.d.ts.map +1 -1
- package/dist/domain/inquiryTree/waveLoad.js +75 -90
- package/dist/domain/inquiryTree/waveLoad.js.map +1 -1
- package/dist/domain/inquiryTree/waveLoad.mjs +54 -60
- package/dist/domain/inquiryTree/waveLoad.mjs.map +1 -1
- package/dist/domain/inquiryTree/wireString.d.ts +5 -0
- package/dist/domain/inquiryTree/wireString.d.ts.map +1 -1
- package/dist/domain/inquiryTree/wireString.js +11 -0
- package/dist/domain/inquiryTree/wireString.js.map +1 -1
- package/dist/domain/inquiryTree/wireString.mjs +10 -1
- package/dist/domain/inquiryTree/wireString.mjs.map +1 -1
- package/dist/domain/nodeView/index.mjs +2 -2
- package/dist/domain/nodeView/model.d.ts +35 -30
- package/dist/domain/nodeView/model.d.ts.map +1 -1
- package/dist/domain/nodeView/model.js +108 -69
- package/dist/domain/nodeView/model.js.map +1 -1
- package/dist/domain/nodeView/model.mjs +86 -36
- package/dist/domain/nodeView/model.mjs.map +1 -1
- package/dist/icons/legacyIconNames.d.ts.map +1 -1
- package/dist/icons/legacyIconNames.js +46 -1
- package/dist/icons/legacyIconNames.js.map +1 -1
- package/dist/icons/legacyIconNames.mjs +46 -1
- package/dist/icons/legacyIconNames.mjs.map +1 -1
- package/dist/index.mjs +10 -12
- package/dist/inquiry/Inquiry.d.ts +3 -0
- package/dist/inquiry/Inquiry.d.ts.map +1 -1
- package/dist/inquiry/Inquiry.js +3 -0
- package/dist/inquiry/Inquiry.js.map +1 -1
- package/dist/inquiry/Inquiry.mjs +3 -0
- package/dist/inquiry/Inquiry.mjs.map +1 -1
- package/dist/inquiry/v2/InquiryV2.d.ts +8 -6
- package/dist/inquiry/v2/InquiryV2.d.ts.map +1 -1
- package/dist/inquiry/v2/InquiryV2.js +45 -24
- package/dist/inquiry/v2/InquiryV2.js.map +1 -1
- package/dist/inquiry/v2/InquiryV2.mjs +108 -61
- package/dist/inquiry/v2/InquiryV2.mjs.map +1 -1
- package/dist/inquiry/v2/InquiryV2.module.css +60 -15
- package/dist/inquiry/v2/InquiryWorkspace.d.ts +9 -9
- package/dist/inquiry/v2/InquiryWorkspace.d.ts.map +1 -1
- package/dist/inquiry/v2/InquiryWorkspace.js +531 -408
- package/dist/inquiry/v2/InquiryWorkspace.js.map +1 -1
- package/dist/inquiry/v2/InquiryWorkspace.mjs +524 -408
- package/dist/inquiry/v2/InquiryWorkspace.mjs.map +1 -1
- package/dist/inquiry/v2/ai/InquiryV2Copilot.d.ts +3 -2
- package/dist/inquiry/v2/ai/InquiryV2Copilot.d.ts.map +1 -1
- package/dist/inquiry/v2/ai/InquiryV2Copilot.js +20 -37
- package/dist/inquiry/v2/ai/InquiryV2Copilot.js.map +1 -1
- package/dist/inquiry/v2/ai/InquiryV2Copilot.mjs +19 -31
- package/dist/inquiry/v2/ai/InquiryV2Copilot.mjs.map +1 -1
- package/dist/inquiry/v2/ai/copilotModel.d.ts +6 -14
- package/dist/inquiry/v2/ai/copilotModel.d.ts.map +1 -1
- package/dist/inquiry/v2/ai/copilotModel.js +35 -87
- package/dist/inquiry/v2/ai/copilotModel.js.map +1 -1
- package/dist/inquiry/v2/ai/copilotModel.mjs +23 -47
- package/dist/inquiry/v2/ai/copilotModel.mjs.map +1 -1
- package/dist/inquiry/v2/api/queries.d.ts +46 -73
- package/dist/inquiry/v2/api/queries.d.ts.map +1 -1
- package/dist/inquiry/v2/api/queries.js +151 -210
- package/dist/inquiry/v2/api/queries.js.map +1 -1
- package/dist/inquiry/v2/api/queries.mjs +227 -183
- package/dist/inquiry/v2/api/queries.mjs.map +1 -1
- package/dist/inquiry/v2/capabilities/actions/ActionsCapability.d.ts.map +1 -1
- package/dist/inquiry/v2/capabilities/actions/ActionsCapability.js +103 -32
- package/dist/inquiry/v2/capabilities/actions/ActionsCapability.js.map +1 -1
- package/dist/inquiry/v2/capabilities/actions/ActionsCapability.mjs +92 -32
- package/dist/inquiry/v2/capabilities/actions/ActionsCapability.mjs.map +1 -1
- package/dist/inquiry/v2/capabilities/actions/ActionsCapability.module.css +8 -1
- package/dist/inquiry/v2/capabilities/actions/EntityFormSurface.d.ts +20 -16
- package/dist/inquiry/v2/capabilities/actions/EntityFormSurface.d.ts.map +1 -1
- package/dist/inquiry/v2/capabilities/actions/EntityFormSurface.js +111 -68
- package/dist/inquiry/v2/capabilities/actions/EntityFormSurface.js.map +1 -1
- package/dist/inquiry/v2/capabilities/actions/EntityFormSurface.mjs +108 -142
- package/dist/inquiry/v2/capabilities/actions/EntityFormSurface.mjs.map +1 -1
- package/dist/inquiry/v2/capabilities/actions/RetrieveSurface.mjs +1 -1
- package/dist/inquiry/v2/capabilities/actions/actionModel.d.ts +66 -50
- package/dist/inquiry/v2/capabilities/actions/actionModel.d.ts.map +1 -1
- package/dist/inquiry/v2/capabilities/actions/actionModel.js +141 -66
- package/dist/inquiry/v2/capabilities/actions/actionModel.js.map +1 -1
- package/dist/inquiry/v2/capabilities/actions/actionModel.mjs +115 -53
- package/dist/inquiry/v2/capabilities/actions/actionModel.mjs.map +1 -1
- package/dist/inquiry/v2/capabilities/actions/parentKeyDefaults.d.ts +26 -0
- package/dist/inquiry/v2/capabilities/actions/parentKeyDefaults.d.ts.map +1 -0
- package/dist/inquiry/v2/capabilities/actions/parentKeyDefaults.js +36 -0
- package/dist/inquiry/v2/capabilities/actions/parentKeyDefaults.js.map +1 -0
- package/dist/inquiry/v2/capabilities/actions/parentKeyDefaults.mjs +41 -0
- package/dist/inquiry/v2/capabilities/actions/parentKeyDefaults.mjs.map +1 -0
- package/dist/inquiry/v2/capabilities/actions/runAction.d.ts +3 -2
- package/dist/inquiry/v2/capabilities/actions/runAction.d.ts.map +1 -1
- package/dist/inquiry/v2/capabilities/actions/runAction.js +27 -23
- package/dist/inquiry/v2/capabilities/actions/runAction.js.map +1 -1
- package/dist/inquiry/v2/capabilities/actions/runAction.mjs +26 -20
- package/dist/inquiry/v2/capabilities/actions/runAction.mjs.map +1 -1
- package/dist/inquiry/v2/capabilities/actions/useHeaderFold.d.ts +20 -0
- package/dist/inquiry/v2/capabilities/actions/useHeaderFold.d.ts.map +1 -0
- package/dist/inquiry/v2/capabilities/actions/useHeaderFold.js +112 -0
- package/dist/inquiry/v2/capabilities/actions/useHeaderFold.js.map +1 -0
- package/dist/inquiry/v2/capabilities/actions/useHeaderFold.mjs +118 -0
- package/dist/inquiry/v2/capabilities/actions/useHeaderFold.mjs.map +1 -0
- package/dist/inquiry/v2/capabilities/actions/useSheetPanel.d.ts +25 -1
- package/dist/inquiry/v2/capabilities/actions/useSheetPanel.d.ts.map +1 -1
- package/dist/inquiry/v2/capabilities/actions/useSheetPanel.js +7 -4
- package/dist/inquiry/v2/capabilities/actions/useSheetPanel.js.map +1 -1
- package/dist/inquiry/v2/capabilities/actions/useSheetPanel.mjs +9 -4
- package/dist/inquiry/v2/capabilities/actions/useSheetPanel.mjs.map +1 -1
- package/dist/inquiry/v2/capabilities/alerts/AlertsCapability.d.ts +5 -3
- package/dist/inquiry/v2/capabilities/alerts/AlertsCapability.d.ts.map +1 -1
- package/dist/inquiry/v2/capabilities/alerts/AlertsCapability.js +11 -8
- package/dist/inquiry/v2/capabilities/alerts/AlertsCapability.js.map +1 -1
- package/dist/inquiry/v2/capabilities/alerts/AlertsCapability.mjs +13 -7
- package/dist/inquiry/v2/capabilities/alerts/AlertsCapability.mjs.map +1 -1
- package/dist/inquiry/v2/capabilities/alerts/AlertsCapability.module.css +4 -4
- package/dist/inquiry/v2/capabilities/header/HeaderCapability.d.ts +1 -1
- package/dist/inquiry/v2/capabilities/header/HeaderCapability.d.ts.map +1 -1
- package/dist/inquiry/v2/capabilities/header/HeaderCapability.js +20 -17
- package/dist/inquiry/v2/capabilities/header/HeaderCapability.js.map +1 -1
- package/dist/inquiry/v2/capabilities/header/HeaderCapability.mjs +101 -111
- package/dist/inquiry/v2/capabilities/header/HeaderCapability.mjs.map +1 -1
- package/dist/inquiry/v2/capabilities/header/HeaderCapability.module.css +9 -6
- package/dist/inquiry/v2/capabilities/tabs/TabsCapability.d.ts +2 -1
- package/dist/inquiry/v2/capabilities/tabs/TabsCapability.d.ts.map +1 -1
- package/dist/inquiry/v2/capabilities/tabs/TabsCapability.js +9 -2
- package/dist/inquiry/v2/capabilities/tabs/TabsCapability.js.map +1 -1
- package/dist/inquiry/v2/capabilities/tabs/TabsCapability.mjs +18 -15
- package/dist/inquiry/v2/capabilities/tabs/TabsCapability.mjs.map +1 -1
- package/dist/inquiry/v2/index.d.ts +0 -1
- package/dist/inquiry/v2/index.d.ts.map +1 -1
- package/dist/inquiry/v2/index.js.map +1 -1
- package/dist/inquiry/v2/kernel/ActionRunnerContext.d.ts +3 -3
- package/dist/inquiry/v2/kernel/ActionRunnerContext.d.ts.map +1 -1
- package/dist/inquiry/v2/kernel/ActionRunnerContext.js +11 -5
- package/dist/inquiry/v2/kernel/ActionRunnerContext.js.map +1 -1
- package/dist/inquiry/v2/kernel/ActionRunnerContext.mjs +15 -12
- package/dist/inquiry/v2/kernel/ActionRunnerContext.mjs.map +1 -1
- package/dist/inquiry/v2/kernel/ReadOnlyContext.d.ts +3 -0
- package/dist/inquiry/v2/kernel/ReadOnlyContext.d.ts.map +1 -0
- package/dist/inquiry/v2/kernel/ReadOnlyContext.js +14 -0
- package/dist/inquiry/v2/kernel/ReadOnlyContext.js.map +1 -0
- package/dist/inquiry/v2/kernel/ReadOnlyContext.mjs +20 -0
- package/dist/inquiry/v2/kernel/ReadOnlyContext.mjs.map +1 -0
- package/dist/inquiry/v2/kernel/RecordContext.d.ts +2 -0
- package/dist/inquiry/v2/kernel/RecordContext.d.ts.map +1 -1
- package/dist/inquiry/v2/kernel/RecordContext.js.map +1 -1
- package/dist/inquiry/v2/kernel/RecordContext.mjs.map +1 -1
- package/dist/inquiry/v2/kernel/UdpNodeView.d.ts.map +1 -1
- package/dist/inquiry/v2/kernel/UdpNodeView.js +18 -13
- package/dist/inquiry/v2/kernel/UdpNodeView.js.map +1 -1
- package/dist/inquiry/v2/kernel/UdpNodeView.mjs +177 -140
- package/dist/inquiry/v2/kernel/UdpNodeView.mjs.map +1 -1
- package/dist/inquiry/v2/kernel/UdpNodeView.module.css +56 -5
- package/dist/inquiry/v2/kernel/capabilities.d.ts +0 -2
- package/dist/inquiry/v2/kernel/capabilities.d.ts.map +1 -1
- package/dist/inquiry/v2/kernel/capabilities.js.map +1 -1
- package/dist/inquiry/v2/kernel/capabilities.mjs.map +1 -1
- package/dist/inquiry/v2/landing/InquiryExplorePage.d.ts +26 -37
- package/dist/inquiry/v2/landing/InquiryExplorePage.d.ts.map +1 -1
- package/dist/inquiry/v2/landing/InquiryExplorePage.js +48 -57
- package/dist/inquiry/v2/landing/InquiryExplorePage.js.map +1 -1
- package/dist/inquiry/v2/landing/InquiryExplorePage.mjs +102 -106
- package/dist/inquiry/v2/landing/InquiryExplorePage.mjs.map +1 -1
- package/dist/inquiry/v2/landing/InquiryExplorePage.module.css +58 -6
- package/dist/inquiry/v2/landing/InquiryLanding.d.ts +3 -3
- package/dist/inquiry/v2/landing/InquiryLanding.d.ts.map +1 -1
- package/dist/inquiry/v2/landing/InquiryLanding.js +8 -3
- package/dist/inquiry/v2/landing/InquiryLanding.js.map +1 -1
- package/dist/inquiry/v2/landing/InquiryLanding.mjs +51 -35
- package/dist/inquiry/v2/landing/InquiryLanding.mjs.map +1 -1
- package/dist/inquiry/v2/landing/InquiryLanding.module.css +8 -0
- package/dist/inquiry/v2/page/UdpPageRenderer.d.ts +5 -1
- package/dist/inquiry/v2/page/UdpPageRenderer.d.ts.map +1 -1
- package/dist/inquiry/v2/page/UdpPageRenderer.js +13 -1
- package/dist/inquiry/v2/page/UdpPageRenderer.js.map +1 -1
- package/dist/inquiry/v2/page/UdpPageRenderer.mjs +36 -7
- package/dist/inquiry/v2/page/UdpPageRenderer.mjs.map +1 -1
- package/dist/inquiry/v2/search/InquirySearchPanel.d.ts +1 -7
- package/dist/inquiry/v2/search/InquirySearchPanel.d.ts.map +1 -1
- package/dist/inquiry/v2/search/InquirySearchPanel.js +6 -13
- package/dist/inquiry/v2/search/InquirySearchPanel.js.map +1 -1
- package/dist/inquiry/v2/search/InquirySearchPanel.mjs +4 -8
- package/dist/inquiry/v2/search/InquirySearchPanel.mjs.map +1 -1
- package/dist/inquiry/v2/search/RecordFinder.d.ts +30 -1
- package/dist/inquiry/v2/search/RecordFinder.d.ts.map +1 -1
- package/dist/inquiry/v2/search/RecordFinder.js +43 -20
- package/dist/inquiry/v2/search/RecordFinder.js.map +1 -1
- package/dist/inquiry/v2/search/RecordFinder.mjs +68 -42
- package/dist/inquiry/v2/search/RecordFinder.mjs.map +1 -1
- package/dist/inquiry/v2/search/index.d.ts +3 -3
- package/dist/inquiry/v2/search/index.d.ts.map +1 -1
- package/dist/inquiry/v2/search/index.js +1 -1
- package/dist/inquiry/v2/search/index.js.map +1 -1
- package/dist/inquiry/v2/search/searchModel.d.ts +130 -23
- package/dist/inquiry/v2/search/searchModel.d.ts.map +1 -1
- package/dist/inquiry/v2/search/searchModel.js +237 -36
- package/dist/inquiry/v2/search/searchModel.js.map +1 -1
- package/dist/inquiry/v2/search/searchModel.mjs +207 -34
- package/dist/inquiry/v2/search/searchModel.mjs.map +1 -1
- package/dist/inquiry/v2/search/useInquirySearch.d.ts.map +1 -1
- package/dist/inquiry/v2/search/useInquirySearch.js +46 -19
- package/dist/inquiry/v2/search/useInquirySearch.js.map +1 -1
- package/dist/inquiry/v2/search/useInquirySearch.mjs +83 -84
- package/dist/inquiry/v2/search/useInquirySearch.mjs.map +1 -1
- package/dist/inquiry/v2/tree/InquiryFluentTreeMenu.d.ts +4 -1
- package/dist/inquiry/v2/tree/InquiryFluentTreeMenu.d.ts.map +1 -1
- package/dist/inquiry/v2/tree/InquiryFluentTreeMenu.js +174 -166
- package/dist/inquiry/v2/tree/InquiryFluentTreeMenu.js.map +1 -1
- package/dist/inquiry/v2/tree/InquiryFluentTreeMenu.mjs +343 -325
- package/dist/inquiry/v2/tree/InquiryFluentTreeMenu.mjs.map +1 -1
- package/dist/inquiry/v2/tree/InquiryMenuToolbar.d.ts +3 -1
- package/dist/inquiry/v2/tree/InquiryMenuToolbar.d.ts.map +1 -1
- package/dist/inquiry/v2/tree/InquiryMenuToolbar.js +8 -7
- package/dist/inquiry/v2/tree/InquiryMenuToolbar.js.map +1 -1
- package/dist/inquiry/v2/tree/InquiryMenuToolbar.mjs +68 -72
- package/dist/inquiry/v2/tree/InquiryMenuToolbar.mjs.map +1 -1
- package/dist/inquiry/v2/tree/LoadRecordDialog.d.ts +3 -3
- package/dist/inquiry/v2/tree/LoadRecordDialog.d.ts.map +1 -1
- package/dist/inquiry/v2/tree/LoadRecordDialog.js +12 -7
- package/dist/inquiry/v2/tree/LoadRecordDialog.js.map +1 -1
- package/dist/inquiry/v2/tree/LoadRecordDialog.mjs +48 -33
- package/dist/inquiry/v2/tree/LoadRecordDialog.mjs.map +1 -1
- package/dist/inquiry/v2/tree/NodeList.d.ts.map +1 -1
- package/dist/inquiry/v2/tree/NodeList.js +17 -6
- package/dist/inquiry/v2/tree/NodeList.js.map +1 -1
- package/dist/inquiry/v2/tree/NodeList.mjs +49 -36
- package/dist/inquiry/v2/tree/NodeList.mjs.map +1 -1
- package/dist/inquiry/v2/tree/arrivalModel.d.ts +15 -0
- package/dist/inquiry/v2/tree/arrivalModel.d.ts.map +1 -1
- package/dist/inquiry/v2/tree/arrivalModel.js +14 -1
- package/dist/inquiry/v2/tree/arrivalModel.js.map +1 -1
- package/dist/inquiry/v2/tree/arrivalModel.mjs +12 -1
- package/dist/inquiry/v2/tree/arrivalModel.mjs.map +1 -1
- package/dist/inquiry/v2/tree/branchRefreshModel.d.ts +32 -0
- package/dist/inquiry/v2/tree/branchRefreshModel.d.ts.map +1 -0
- package/dist/inquiry/v2/tree/branchRefreshModel.js +62 -0
- package/dist/inquiry/v2/tree/branchRefreshModel.js.map +1 -0
- package/dist/inquiry/v2/tree/branchRefreshModel.mjs +60 -0
- package/dist/inquiry/v2/tree/branchRefreshModel.mjs.map +1 -0
- package/dist/inquiry/v2/tree/droppedPageModel.d.ts +23 -1
- package/dist/inquiry/v2/tree/droppedPageModel.d.ts.map +1 -1
- package/dist/inquiry/v2/tree/droppedPageModel.js +53 -26
- package/dist/inquiry/v2/tree/droppedPageModel.js.map +1 -1
- package/dist/inquiry/v2/tree/droppedPageModel.mjs +48 -20
- package/dist/inquiry/v2/tree/droppedPageModel.mjs.map +1 -1
- package/dist/inquiry/v2/tree/fluentTreeMenu/treeMenuVisuals.d.ts +7 -12
- package/dist/inquiry/v2/tree/fluentTreeMenu/treeMenuVisuals.d.ts.map +1 -1
- package/dist/inquiry/v2/tree/fluentTreeMenu/treeMenuVisuals.js +44 -15
- package/dist/inquiry/v2/tree/fluentTreeMenu/treeMenuVisuals.js.map +1 -1
- package/dist/inquiry/v2/tree/fluentTreeMenu/treeMenuVisuals.mjs +34 -15
- package/dist/inquiry/v2/tree/fluentTreeMenu/treeMenuVisuals.mjs.map +1 -1
- package/dist/inquiry/v2/tree/fluentTreeMenu/useAggregateBadges.d.ts.map +1 -1
- package/dist/inquiry/v2/tree/fluentTreeMenu/useAggregateBadges.js +7 -18
- package/dist/inquiry/v2/tree/fluentTreeMenu/useAggregateBadges.js.map +1 -1
- package/dist/inquiry/v2/tree/fluentTreeMenu/useAggregateBadges.mjs +6 -14
- package/dist/inquiry/v2/tree/fluentTreeMenu/useAggregateBadges.mjs.map +1 -1
- package/dist/inquiry/v2/tree/fluentTreeMenu/useChildCountBadges.d.ts +20 -16
- package/dist/inquiry/v2/tree/fluentTreeMenu/useChildCountBadges.d.ts.map +1 -1
- package/dist/inquiry/v2/tree/fluentTreeMenu/useChildCountBadges.js +77 -55
- package/dist/inquiry/v2/tree/fluentTreeMenu/useChildCountBadges.js.map +1 -1
- package/dist/inquiry/v2/tree/fluentTreeMenu/useChildCountBadges.mjs +85 -106
- package/dist/inquiry/v2/tree/fluentTreeMenu/useChildCountBadges.mjs.map +1 -1
- package/dist/inquiry/v2/tree/lineageModel.d.ts +18 -1
- package/dist/inquiry/v2/tree/lineageModel.d.ts.map +1 -1
- package/dist/inquiry/v2/tree/lineageModel.js +71 -2
- package/dist/inquiry/v2/tree/lineageModel.js.map +1 -1
- package/dist/inquiry/v2/tree/lineageModel.mjs +53 -3
- package/dist/inquiry/v2/tree/lineageModel.mjs.map +1 -1
- package/dist/inquiry/v2/tree/menuRebuildModel.d.ts +10 -27
- package/dist/inquiry/v2/tree/menuRebuildModel.d.ts.map +1 -1
- package/dist/inquiry/v2/tree/menuRebuildModel.js +8 -58
- package/dist/inquiry/v2/tree/menuRebuildModel.js.map +1 -1
- package/dist/inquiry/v2/tree/menuRebuildModel.mjs +8 -51
- package/dist/inquiry/v2/tree/menuRebuildModel.mjs.map +1 -1
- package/dist/inquiry/v2/tree/pagedChildrenModel.d.ts +26 -0
- package/dist/inquiry/v2/tree/pagedChildrenModel.d.ts.map +1 -0
- package/dist/inquiry/v2/tree/pagedChildrenModel.js +56 -0
- package/dist/inquiry/v2/tree/pagedChildrenModel.js.map +1 -0
- package/dist/inquiry/v2/tree/pagedChildrenModel.mjs +43 -0
- package/dist/inquiry/v2/tree/pagedChildrenModel.mjs.map +1 -0
- package/dist/inquiry/v2/tree/rootRemovalModel.d.ts +7 -0
- package/dist/inquiry/v2/tree/rootRemovalModel.d.ts.map +1 -1
- package/dist/inquiry/v2/tree/rootRemovalModel.js +31 -5
- package/dist/inquiry/v2/tree/rootRemovalModel.js.map +1 -1
- package/dist/inquiry/v2/tree/rootRemovalModel.mjs +21 -4
- package/dist/inquiry/v2/tree/rootRemovalModel.mjs.map +1 -1
- package/dist/inquiry/v2/tree/treeFilterModel.d.ts +0 -2
- package/dist/inquiry/v2/tree/treeFilterModel.d.ts.map +1 -1
- package/dist/inquiry/v2/tree/treeFilterModel.js +0 -7
- package/dist/inquiry/v2/tree/treeFilterModel.js.map +1 -1
- package/dist/inquiry/v2/tree/treeFilterModel.mjs.map +1 -1
- package/dist/inquiry/v2/tree/useInquiryMenu.d.ts +16 -7
- package/dist/inquiry/v2/tree/useInquiryMenu.d.ts.map +1 -1
- package/dist/inquiry/v2/tree/useInquiryMenu.js +401 -163
- package/dist/inquiry/v2/tree/useInquiryMenu.js.map +1 -1
- package/dist/inquiry/v2/tree/useInquiryMenu.mjs +511 -310
- package/dist/inquiry/v2/tree/useInquiryMenu.mjs.map +1 -1
- package/dist/inquiry/v2/tree/waveLoader.d.ts +10 -11
- package/dist/inquiry/v2/tree/waveLoader.d.ts.map +1 -1
- package/dist/inquiry/v2/tree/waveLoader.js +78 -72
- package/dist/inquiry/v2/tree/waveLoader.js.map +1 -1
- package/dist/inquiry/v2/tree/waveLoader.mjs +79 -68
- package/dist/inquiry/v2/tree/waveLoader.mjs.map +1 -1
- package/dist/inquiry/v2/widgets/listRow.module.css +27 -0
- package/dist/inquiry/v2/widgets/widgetRowModel.d.ts +6 -2
- package/dist/inquiry/v2/widgets/widgetRowModel.d.ts.map +1 -1
- package/dist/inquiry/v2/widgets/widgetRowModel.js +49 -14
- package/dist/inquiry/v2/widgets/widgetRowModel.js.map +1 -1
- package/dist/inquiry/v2/widgets/widgetRowModel.mjs +36 -12
- package/dist/inquiry/v2/widgets/widgetRowModel.mjs.map +1 -1
- package/dist/maintenance/UdpTaggedRecordsPage.mjs +1 -1
- package/dist/maintenance/api/lookupApi.mjs +1 -1
- package/dist/maintenance/api/tagsApi.mjs +1 -1
- package/dist/maintenance/config/nodeDefaults.d.ts.map +1 -1
- package/dist/maintenance/config/nodeDefaults.js +16 -5
- package/dist/maintenance/config/nodeDefaults.js.map +1 -1
- package/dist/maintenance/config/nodeDefaults.mjs +14 -5
- package/dist/maintenance/config/nodeDefaults.mjs.map +1 -1
- package/dist/maintenance/config/useEntityConfig.mjs +1 -1
- package/dist/maintenance/config/useLinkedLabels.mjs +1 -1
- package/dist/maintenance/grid/MaintenanceGrid.mjs +1 -1
- package/dist/maintenance/metadata/useEntityMetadata.mjs +1 -1
- package/dist/maintenance/record/ChildTab.mjs +1 -1
- package/dist/maintenance/record/DeleteRecordDialog.mjs +1 -1
- package/dist/maintenance/record/LinkRecordsSheet.mjs +1 -1
- package/dist/maintenance/record/RecordFacts.mjs +1 -1
- package/dist/maintenance/record/RecordSheet.mjs +2 -2
- package/dist/maintenance/record/displayValue.mjs +1 -1
- package/dist/maintenance/record/stampDisplayText.mjs +1 -1
- package/dist/maintenance/settings/useEntityCatalog.mjs +1 -1
- package/dist/maintenanceEngine/tableBrowser/TableColumnDefs.d.ts +4 -5
- package/dist/maintenanceEngine/tableBrowser/TableColumnDefs.d.ts.map +1 -1
- package/dist/stores/inquiryStore.d.ts +2 -1
- package/dist/stores/inquiryStore.d.ts.map +1 -1
- package/dist/stores/inquiryStore.js +4 -3
- package/dist/stores/inquiryStore.js.map +1 -1
- package/dist/stores/inquiryStore.mjs +18 -11
- package/dist/stores/inquiryStore.mjs.map +1 -1
- package/dist/udp/pages/UdpMaintenanceEnginePage/UdpMaintenanceEnginePage.d.ts.map +1 -1
- package/dist/udp/pages/UdpMaintenanceEnginePage/UdpMaintenanceEnginePage.js +1 -1
- package/dist/udp/pages/UdpMaintenanceEnginePage/UdpMaintenanceEnginePage.js.map +1 -1
- package/dist/udp/pages/UdpMaintenanceEnginePage/UdpMaintenanceEnginePage.mjs +2 -1
- package/dist/udp/pages/UdpMaintenanceEnginePage/UdpMaintenanceEnginePage.mjs.map +1 -1
- package/dist/udp/pages/UdpMaintenanceEnginePage/components/EntitiyTimeLine.mjs +1 -1
- package/dist/udp/utilities/useDateStringColumnDef.d.ts +1 -1
- package/dist/utilities/i18n/locales/es-US.json +23 -5
- package/dist/utilities/i18n/locales/es-US.mjs +24 -4
- package/dist/utilities/i18n/locales/fr-CA.json +23 -5
- package/dist/utilities/i18n/locales/fr-CA.mjs +24 -4
- package/package.json +30 -18
- package/dist/actionPanels/PanelActionForm.d.ts +0 -56
- package/dist/actionPanels/PanelActionForm.d.ts.map +0 -1
- package/dist/actionPanels/PanelActionForm.js +0 -30
- package/dist/actionPanels/PanelActionForm.js.map +0 -1
- package/dist/actionPanels/PanelActionForm.mjs +0 -168
- package/dist/actionPanels/PanelActionForm.mjs.map +0 -1
- package/dist/actionPanels/PanelEditor.d.ts +0 -44
- package/dist/actionPanels/PanelEditor.d.ts.map +0 -1
- package/dist/actionPanels/PanelEditor.js +0 -78
- package/dist/actionPanels/PanelEditor.js.map +0 -1
- package/dist/actionPanels/PanelEditor.mjs +0 -345
- package/dist/actionPanels/PanelEditor.mjs.map +0 -1
- package/dist/actionPanels/panelActionFields.module.css +0 -18
- package/dist/domain/inquiryTree/ruleBindings.d.ts +0 -10
- package/dist/domain/inquiryTree/ruleBindings.d.ts.map +0 -1
- package/dist/domain/inquiryTree/ruleBindings.js +0 -20
- package/dist/domain/inquiryTree/ruleBindings.js.map +0 -1
- package/dist/domain/inquiryTree/ruleBindings.mjs +0 -21
- package/dist/domain/inquiryTree/ruleBindings.mjs.map +0 -1
- package/dist/inquiry/v2/kernel/readOnlyModel.d.ts +0 -17
- package/dist/inquiry/v2/kernel/readOnlyModel.d.ts.map +0 -1
- package/dist/inquiry/v2/kernel/readOnlyModel.js +0 -19
- package/dist/inquiry/v2/kernel/readOnlyModel.js.map +0 -1
- package/dist/inquiry/v2/kernel/readOnlyModel.mjs +0 -21
- package/dist/inquiry/v2/kernel/readOnlyModel.mjs.map +0 -1
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/** The position of a button the tree read's copy does not hold. */
|
|
2
|
+
const NOT_IN_READ = Number.MAX_SAFE_INTEGER;
|
|
3
|
+
/** The panel IS the tree read's copy: position = array index. */
|
|
4
|
+
const arrayPosition = (_button, index) => index;
|
|
5
|
+
/** The row-level action id the runtime keys on, else the action's own. */
|
|
6
|
+
const rowActionId = (button) => {
|
|
7
|
+
var _a;
|
|
8
|
+
var _b;
|
|
9
|
+
const rowId = (_a = button.unknownKeys) === null || _a === void 0 ? void 0 : _a.actionId;
|
|
10
|
+
return typeof rowId === 'string' && rowId
|
|
11
|
+
? rowId
|
|
12
|
+
: (_b = button.action.actionId) !== null && _b !== void 0 ? _b : '';
|
|
13
|
+
};
|
|
14
|
+
/** A button's menu group: its trimmed, lower-cased name; '' when ungrouped. */
|
|
15
|
+
export const buttonGroupKey = (button) => {
|
|
16
|
+
var _a;
|
|
17
|
+
var _b;
|
|
18
|
+
return (_b = (_a = button.groupName) === null || _a === void 0 ? void 0 : _a.trim().toLowerCase()) !== null && _b !== void 0 ? _b : '';
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Positions from the tree read's copy of a panel, matching a button by its
|
|
22
|
+
* association id, else its action id.
|
|
23
|
+
*/
|
|
24
|
+
export const treeReadPositions = (read) => {
|
|
25
|
+
var _a;
|
|
26
|
+
const readButtons = (_a = read === null || read === void 0 ? void 0 : read.buttons) !== null && _a !== void 0 ? _a : [];
|
|
27
|
+
return (button) => {
|
|
28
|
+
const actionId = rowActionId(button);
|
|
29
|
+
const at = readButtons.findIndex((candidate) => (!!button.panelActionId &&
|
|
30
|
+
candidate.panelActionId === button.panelActionId) ||
|
|
31
|
+
(!!actionId && rowActionId(candidate) === actionId));
|
|
32
|
+
return at < 0 ? NOT_IN_READ : at;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
/** Array.sort comparator over ButtonOrderKey — a total order. */
|
|
36
|
+
export const compareButtonOrder = (a, b) => a.panelIndex - b.panelIndex ||
|
|
37
|
+
a.groupSequence - b.groupSequence ||
|
|
38
|
+
a.groupRank - b.groupRank ||
|
|
39
|
+
a.group.localeCompare(b.group) ||
|
|
40
|
+
a.sequence - b.sequence ||
|
|
41
|
+
a.position - b.position ||
|
|
42
|
+
a.name.localeCompare(b.name) ||
|
|
43
|
+
a.actionId.localeCompare(b.actionId);
|
|
44
|
+
/** Every button's key, by index into `panel.buttons`. */
|
|
45
|
+
export const panelOrderKeys = (panel, panelIndex = 0, positionOf = arrayPosition) => {
|
|
46
|
+
const positions = panel.buttons.map(positionOf);
|
|
47
|
+
const groupRank = new Map();
|
|
48
|
+
const groupSequence = new Map();
|
|
49
|
+
panel.buttons.forEach((button, index) => {
|
|
50
|
+
var _a, _b;
|
|
51
|
+
const group = buttonGroupKey(button);
|
|
52
|
+
groupRank.set(group, Math.min((_a = groupRank.get(group)) !== null && _a !== void 0 ? _a : NOT_IN_READ, positions[index]));
|
|
53
|
+
groupSequence.set(group, Math.min((_b = groupSequence.get(group)) !== null && _b !== void 0 ? _b : Infinity, button.sequence));
|
|
54
|
+
});
|
|
55
|
+
return panel.buttons.map((button, index) => {
|
|
56
|
+
var _a, _b;
|
|
57
|
+
const group = buttonGroupKey(button);
|
|
58
|
+
return {
|
|
59
|
+
panelIndex,
|
|
60
|
+
groupSequence: (_a = groupSequence.get(group)) !== null && _a !== void 0 ? _a : Infinity,
|
|
61
|
+
groupRank: (_b = groupRank.get(group)) !== null && _b !== void 0 ? _b : NOT_IN_READ,
|
|
62
|
+
group,
|
|
63
|
+
sequence: button.sequence,
|
|
64
|
+
position: positions[index],
|
|
65
|
+
name: button.action.name.trim(),
|
|
66
|
+
actionId: rowActionId(button)
|
|
67
|
+
};
|
|
68
|
+
});
|
|
69
|
+
};
|
|
70
|
+
/** Indexes into `panel.buttons`, in the canonical order. */
|
|
71
|
+
export const panelButtonOrder = (panel, positionOf) => {
|
|
72
|
+
const keys = panelOrderKeys(panel, 0, positionOf);
|
|
73
|
+
return keys
|
|
74
|
+
.map((_key, index) => index)
|
|
75
|
+
.sort((a, b) => compareButtonOrder(keys[a], keys[b]));
|
|
76
|
+
};
|
|
77
|
+
/**
|
|
78
|
+
* Move the button at `index` one slot within its menu group, then number the
|
|
79
|
+
* whole panel 1..n in the new display order — so `sequence` alone says the
|
|
80
|
+
* order (group ranks included) whatever row order the database returns. A
|
|
81
|
+
* move never leaves its group. Array order is kept (callers address buttons
|
|
82
|
+
* by index). Returns the same panel when the move is not possible.
|
|
83
|
+
*/
|
|
84
|
+
export const moveButtonInOrder = (panel, index, direction, positionOf) => {
|
|
85
|
+
const button = panel.buttons[index];
|
|
86
|
+
if (!button)
|
|
87
|
+
return panel;
|
|
88
|
+
const group = buttonGroupKey(button);
|
|
89
|
+
const order = panelButtonOrder(panel, positionOf);
|
|
90
|
+
const inGroup = order.filter((at) => buttonGroupKey(panel.buttons[at]) === group);
|
|
91
|
+
const from = inGroup.indexOf(index);
|
|
92
|
+
const to = direction === 'up' ? from - 1 : from + 1;
|
|
93
|
+
if (to < 0 || to >= inGroup.length)
|
|
94
|
+
return panel;
|
|
95
|
+
const a = order.indexOf(inGroup[from]);
|
|
96
|
+
const b = order.indexOf(inGroup[to]);
|
|
97
|
+
[order[a], order[b]] = [order[b], order[a]];
|
|
98
|
+
const buttons = panel.buttons.slice();
|
|
99
|
+
order.forEach((at, rank) => {
|
|
100
|
+
if (buttons[at].sequence !== rank + 1)
|
|
101
|
+
buttons[at] = Object.assign(Object.assign({}, buttons[at]), { sequence: rank + 1 });
|
|
102
|
+
});
|
|
103
|
+
return Object.assign(Object.assign({}, panel), { buttons });
|
|
104
|
+
};
|
|
105
|
+
//# sourceMappingURL=buttonOrder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buttonOrder.js","sourceRoot":"","sources":["../../../src/domain/actionPanel/buttonOrder.ts"],"names":[],"mappings":"AAgDA,mEAAmE;AACnE,MAAM,WAAW,GAAG,MAAM,CAAC,gBAAgB,CAAC;AAE5C,iEAAiE;AACjE,MAAM,aAAa,GAAmB,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC;AAEhE,0EAA0E;AAC1E,MAAM,WAAW,GAAG,CAAC,MAAmB,EAAU,EAAE,CAAC;;;IACnD,MAAM,KAAK,GAAG,MAAA,MAAM,CAAC,WAAW,0CAAE,QAAQ,CAAC;IAC3C,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK;QACvC,CAAC,CAAC,KAAK;QACP,CAAC,OAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,mCAAI,EAAE,CAAC;AAAA,CAClC,CAAC;AAEF,+EAA+E;AAC/E,MAAM,CAAC,MAAM,cAAc,GAAG,CAC5B,MAAsC,EAC9B,EAAE;;;iBAAC,MAAA,MAAM,CAAC,SAAS,0CAAE,IAAI,GAAG,WAAW,EAAE,mCAAI,EAAE;CAAA,CAAC;AAE1D;;;GAGG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,IAAuB,EAAkB,EAAE,CAAC;;IAC5E,MAAM,WAAW,SAAG,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,OAAO,mCAAI,EAAE,CAAC;IACxC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC;QACjB,MAAM,QAAQ,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC;QACrC,MAAM,EAAE,GAAG,WAAW,CAAC,SAAS,CAC9B,CAAC,SAAS,EAAE,EAAE,CACZ,CAAC,CAAC,CAAC,MAAM,CAAC,aAAa;YACrB,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AC;IAC5C,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;IACtC,KAAK,CAAC,OAAO,CAAC,CAAC,EAAE,EAAE,IAAI,EAAE,EAAE,CAAC;QAC1B,IAAI,OAAO,CAAC,EAAE,CAAC,CAAC,QAAQ,KAAK,IAAI,GAAG,CAAC;YACnC,OAAO,CAAC,EAAE,CAAC,mCAAQ,OAAO,CAAC,EAAE,CAAC,KAAE,QAAQ,EAAE,IAAI,GAAG,CAAC,GAAE,CAAC;IAAA,CACxD,CAAC,CAAC;IACH,uCAAY,KAAK,KAAE,OAAO,IAAG;AAAA,CAC9B,CAAC"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
//#region src/domain/actionPanel/buttonOrder.ts
|
|
2
|
+
/** The position of a button the tree read's copy does not hold. */
|
|
3
|
+
const NOT_IN_READ = Number.MAX_SAFE_INTEGER;
|
|
4
|
+
/** The panel IS the tree read's copy: position = array index. */
|
|
5
|
+
const arrayPosition = (_button, index) => index;
|
|
6
|
+
/** The row-level action id the runtime keys on, else the action's own. */
|
|
7
|
+
const rowActionId = (button) => {
|
|
8
|
+
const rowId = button.unknownKeys?.actionId;
|
|
9
|
+
return typeof rowId === "string" && rowId ? rowId : button.action.actionId ?? "";
|
|
10
|
+
};
|
|
11
|
+
/** A button's menu group: its trimmed, lower-cased name; '' when ungrouped. */
|
|
12
|
+
const buttonGroupKey = (button) => button.groupName?.trim().toLowerCase() ?? "";
|
|
13
|
+
/**
|
|
14
|
+
* Positions from the tree read's copy of a panel, matching a button by its
|
|
15
|
+
* association id, else its action id.
|
|
16
|
+
*/
|
|
17
|
+
const treeReadPositions = (read) => {
|
|
18
|
+
const readButtons = read?.buttons ?? [];
|
|
19
|
+
return (button) => {
|
|
20
|
+
const actionId = rowActionId(button);
|
|
21
|
+
const at = readButtons.findIndex((candidate) => !!button.panelActionId && candidate.panelActionId === button.panelActionId || !!actionId && rowActionId(candidate) === actionId);
|
|
22
|
+
return at < 0 ? NOT_IN_READ : at;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
/** Array.sort comparator over ButtonOrderKey — a total order. */
|
|
26
|
+
const compareButtonOrder = (a, b) => a.panelIndex - b.panelIndex || a.groupSequence - b.groupSequence || a.groupRank - b.groupRank || a.group.localeCompare(b.group) || a.sequence - b.sequence || a.position - b.position || a.name.localeCompare(b.name) || a.actionId.localeCompare(b.actionId);
|
|
27
|
+
/** Every button's key, by index into `panel.buttons`. */
|
|
28
|
+
const panelOrderKeys = (panel, panelIndex = 0, positionOf = arrayPosition) => {
|
|
29
|
+
const positions = panel.buttons.map(positionOf);
|
|
30
|
+
const groupRank = /* @__PURE__ */ new Map();
|
|
31
|
+
const groupSequence = /* @__PURE__ */ new Map();
|
|
32
|
+
panel.buttons.forEach((button, index) => {
|
|
33
|
+
const group = buttonGroupKey(button);
|
|
34
|
+
groupRank.set(group, Math.min(groupRank.get(group) ?? NOT_IN_READ, positions[index]));
|
|
35
|
+
groupSequence.set(group, Math.min(groupSequence.get(group) ?? Infinity, button.sequence));
|
|
36
|
+
});
|
|
37
|
+
return panel.buttons.map((button, index) => {
|
|
38
|
+
const group = buttonGroupKey(button);
|
|
39
|
+
return {
|
|
40
|
+
panelIndex,
|
|
41
|
+
groupSequence: groupSequence.get(group) ?? Infinity,
|
|
42
|
+
groupRank: groupRank.get(group) ?? NOT_IN_READ,
|
|
43
|
+
group,
|
|
44
|
+
sequence: button.sequence,
|
|
45
|
+
position: positions[index],
|
|
46
|
+
name: button.action.name.trim(),
|
|
47
|
+
actionId: rowActionId(button)
|
|
48
|
+
};
|
|
49
|
+
});
|
|
50
|
+
};
|
|
51
|
+
/** Indexes into `panel.buttons`, in the canonical order. */
|
|
52
|
+
const panelButtonOrder = (panel, positionOf) => {
|
|
53
|
+
const keys = panelOrderKeys(panel, 0, positionOf);
|
|
54
|
+
return keys.map((_key, index) => index).sort((a, b) => compareButtonOrder(keys[a], keys[b]));
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* Move the button at `index` one slot within its menu group, then number the
|
|
58
|
+
* whole panel 1..n in the new display order — so `sequence` alone says the
|
|
59
|
+
* order (group ranks included) whatever row order the database returns. A
|
|
60
|
+
* move never leaves its group. Array order is kept (callers address buttons
|
|
61
|
+
* by index). Returns the same panel when the move is not possible.
|
|
62
|
+
*/
|
|
63
|
+
const moveButtonInOrder = (panel, index, direction, positionOf) => {
|
|
64
|
+
const button = panel.buttons[index];
|
|
65
|
+
if (!button) return panel;
|
|
66
|
+
const group = buttonGroupKey(button);
|
|
67
|
+
const order = panelButtonOrder(panel, positionOf);
|
|
68
|
+
const inGroup = order.filter((at) => buttonGroupKey(panel.buttons[at]) === group);
|
|
69
|
+
const from = inGroup.indexOf(index);
|
|
70
|
+
const to = direction === "up" ? from - 1 : from + 1;
|
|
71
|
+
if (to < 0 || to >= inGroup.length) return panel;
|
|
72
|
+
const a = order.indexOf(inGroup[from]);
|
|
73
|
+
const b = order.indexOf(inGroup[to]);
|
|
74
|
+
[order[a], order[b]] = [order[b], order[a]];
|
|
75
|
+
const buttons = panel.buttons.slice();
|
|
76
|
+
order.forEach((at, rank) => {
|
|
77
|
+
if (buttons[at].sequence !== rank + 1) buttons[at] = {
|
|
78
|
+
...buttons[at],
|
|
79
|
+
sequence: rank + 1
|
|
80
|
+
};
|
|
81
|
+
});
|
|
82
|
+
return {
|
|
83
|
+
...panel,
|
|
84
|
+
buttons
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
//#endregion
|
|
88
|
+
export { buttonGroupKey, compareButtonOrder, moveButtonInOrder, panelButtonOrder, panelOrderKeys, treeReadPositions };
|
|
89
|
+
|
|
90
|
+
//# sourceMappingURL=buttonOrder.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buttonOrder.mjs","names":["Panel","PanelButton","ButtonOrderKey","panelIndex","groupSequence","groupRank","group","sequence","position","name","actionId","ButtonPosition","button","index","NOT_IN_READ","Number","MAX_SAFE_INTEGER","arrayPosition","_button","rowActionId","rowId","unknownKeys","action","buttonGroupKey","Pick","groupName","trim","toLowerCase","treeReadPositions","read","readButtons","buttons","at","findIndex","candidate","panelActionId","compareButtonOrder","a","b","localeCompare","panelOrderKeys","panel","positionOf","positions","map","Map","forEach","set","Math","min","get","Infinity","panelButtonOrder","keys","_key","sort","moveButtonInOrder","direction","order","inGroup","filter","from","indexOf","to","length","slice","rank"],"sources":["../../../src/domain/actionPanel/buttonOrder.ts"],"sourcesContent":["/**\n * THE order of a level's header buttons. Inquiry v2's header\n * (resolveHeaderActions) and the Tree Builder's button list both sort by it, so\n * the builder lists exactly what the runtime renders; the header's overflow\n * menu then sections this order by `groupName` (assignMenuSections).\n *\n * The key, most significant first:\n * 1. The panel's index among the level's attachments — v1 rendered each\n * panel's buttons together (ActionPanelPlacement.jsx).\n * 2. The button's menu group (case-insensitive; ungrouped is a group of its\n * own), ranked by its lowest `sequence`, then by its first appearance in\n * the tree read — the read's array order is the database's row order, not\n * an authored one, so it only breaks a tie. Legacy panels restart\n * `sequence` per group (Account 1..14, then Workflow 1..6): every group\n * ties at 1 and they keep v1's stored-array order. A panel the builder\n * writes numbers its buttons 1..n in display order (moveButtonInOrder), so\n * its groups rank as shown. Groups never interleave.\n * 3. `sequence` within the group.\n * 4. The button's position in the TREE READ's copy of its panel: v1 rendered\n * `panelActions` in that array order, and the product's panels store many\n * buttons at one sequence. The panel library lists the same panel's buttons\n * in another order, so an editor holding the library copy takes positions\n * from the tree read's (`treeReadPositions`). A button that copy does not\n * hold yet (a new one) sorts after those it does.\n * 5. Name, then action id — a total order.\n */\nimport { Panel, PanelButton } from './types';\n\nexport interface ButtonOrderKey {\n /** The panel's index among the level's panel attachments. */\n panelIndex: number;\n /** The lowest `sequence` in the button's group in its panel. */\n groupSequence: number;\n /** First tree-read position of the button's group in its panel. */\n groupRank: number;\n /** The button's group (buttonGroupKey). */\n group: string;\n sequence: number;\n /** Index in the tree read's copy of the panel; NOT_IN_READ when absent. */\n position: number;\n /** The action's name, trimmed. */\n name: string;\n actionId: string;\n}\n\n/** Where a button sits in the tree read's copy of its panel. */\nexport type ButtonPosition = (button: PanelButton, index: number) => number;\n\n/** The position of a button the tree read's copy does not hold. */\nconst NOT_IN_READ = Number.MAX_SAFE_INTEGER;\n\n/** The panel IS the tree read's copy: position = array index. */\nconst arrayPosition: ButtonPosition = (_button, index) => index;\n\n/** The row-level action id the runtime keys on, else the action's own. */\nconst rowActionId = (button: PanelButton): string => {\n const rowId = button.unknownKeys?.actionId;\n return typeof rowId === 'string' && rowId\n ? rowId\n : button.action.actionId ?? '';\n};\n\n/** A button's menu group: its trimmed, lower-cased name; '' when ungrouped. */\nexport const buttonGroupKey = (\n button: Pick<PanelButton, 'groupName'>\n): string => button.groupName?.trim().toLowerCase() ?? '';\n\n/**\n * Positions from the tree read's copy of a panel, matching a button by its\n * association id, else its action id.\n */\nexport const treeReadPositions = (read: Panel | undefined): ButtonPosition => {\n const readButtons = read?.buttons ?? [];\n return (button) => {\n const actionId = rowActionId(button);\n const at = readButtons.findIndex(\n (candidate) =>\n (!!button.panelActionId &&\n candidate.panelActionId === button.panelActionId) ||\n (!!actionId && rowActionId(candidate) === actionId)\n );\n return at < 0 ? NOT_IN_READ : at;\n };\n};\n\n/** Array.sort comparator over ButtonOrderKey — a total order. */\nexport const compareButtonOrder = (\n a: ButtonOrderKey,\n b: ButtonOrderKey\n): number =>\n a.panelIndex - b.panelIndex ||\n a.groupSequence - b.groupSequence ||\n a.groupRank - b.groupRank ||\n a.group.localeCompare(b.group) ||\n a.sequence - b.sequence ||\n a.position - b.position ||\n a.name.localeCompare(b.name) ||\n a.actionId.localeCompare(b.actionId);\n\n/** Every button's key, by index into `panel.buttons`. */\nexport const panelOrderKeys = (\n panel: Panel,\n panelIndex = 0,\n positionOf: ButtonPosition = arrayPosition\n): ButtonOrderKey[] => {\n const positions = panel.buttons.map(positionOf);\n const groupRank = new Map<string, number>();\n const groupSequence = new Map<string, number>();\n panel.buttons.forEach((button, index) => {\n const group = buttonGroupKey(button);\n groupRank.set(\n group,\n Math.min(groupRank.get(group) ?? NOT_IN_READ, positions[index])\n );\n groupSequence.set(\n group,\n Math.min(groupSequence.get(group) ?? Infinity, button.sequence)\n );\n });\n return panel.buttons.map((button, index) => {\n const group = buttonGroupKey(button);\n return {\n panelIndex,\n groupSequence: groupSequence.get(group) ?? Infinity,\n groupRank: groupRank.get(group) ?? NOT_IN_READ,\n group,\n sequence: button.sequence,\n position: positions[index],\n name: button.action.name.trim(),\n actionId: rowActionId(button)\n };\n });\n};\n\n/** Indexes into `panel.buttons`, in the canonical order. */\nexport const panelButtonOrder = (\n panel: Panel,\n positionOf?: ButtonPosition\n): number[] => {\n const keys = panelOrderKeys(panel, 0, positionOf);\n return keys\n .map((_key, index) => index)\n .sort((a, b) => compareButtonOrder(keys[a], keys[b]));\n};\n\n/**\n * Move the button at `index` one slot within its menu group, then number the\n * whole panel 1..n in the new display order — so `sequence` alone says the\n * order (group ranks included) whatever row order the database returns. A\n * move never leaves its group. Array order is kept (callers address buttons\n * by index). Returns the same panel when the move is not possible.\n */\nexport const moveButtonInOrder = (\n panel: Panel,\n index: number,\n direction: 'up' | 'down',\n positionOf?: ButtonPosition\n): Panel => {\n const button = panel.buttons[index];\n if (!button) return panel;\n const group = buttonGroupKey(button);\n const order = panelButtonOrder(panel, positionOf);\n const inGroup = order.filter(\n (at) => buttonGroupKey(panel.buttons[at]) === group\n );\n const from = inGroup.indexOf(index);\n const to = direction === 'up' ? from - 1 : from + 1;\n if (to < 0 || to >= inGroup.length) return panel;\n const a = order.indexOf(inGroup[from]);\n const b = order.indexOf(inGroup[to]);\n [order[a], order[b]] = [order[b], order[a]];\n const buttons = panel.buttons.slice();\n order.forEach((at, rank) => {\n if (buttons[at].sequence !== rank + 1)\n buttons[at] = { ...buttons[at], sequence: rank + 1 };\n });\n return { ...panel, buttons };\n};\n"],"mappings":";;AAiDA,MAAMc,cAAcC,OAAOC;;AAG3B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AAI;AACpC,EAACL,MAAMrB,IAAIqB,MAAMpB,MAAM,CAACoB,MAAMpB,IAAIoB,MAAMrB,GAAG;CAC3C,MAAMN,UAAUU,MAAMV,QAAQkC,OAAO;AACrCP,OAAMZ,SAASd,IAAIkC,SAAS;AAC1B,MAAInC,QAAQC,IAAIzB,aAAa2D,OAAO,EAClCnC,SAAQC,MAAM;GAAE,GAAGD,QAAQC;GAAKzB,UAAU2D,OAAO;GAAG;GACtD;AACF,QAAO;EAAE,GAAGzB;EAAOV;EAAS"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/domain/actionPanel/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/domain/actionPanel/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/domain/actionPanel/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/domain/actionPanel/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { LEGACY_ICON_MAP, isRegistryIconName } from "../../icons/legacyIconNames.mjs";
|
|
2
2
|
import { ACTION_TYPES, ActionType, isActionType } from "./types.mjs";
|
|
3
|
-
import { ACTION_TYPE_META, GENERIC_ACTION_ICON, actionTypeLabel, actionTypeOptions, resolvePanelButtonIcon } from "./actionTypeMeta.mjs";
|
|
4
|
-
import {
|
|
5
|
-
|
|
3
|
+
import { ACTION_TYPE_META, GENERIC_ACTION_ICON, actionButtonLabel, actionTypeLabel, actionTypeOptions, resolvePanelButtonIcon } from "./actionTypeMeta.mjs";
|
|
4
|
+
import { buttonGroupKey, compareButtonOrder, moveButtonInOrder, panelButtonOrder, panelOrderKeys, treeReadPositions } from "./buttonOrder.mjs";
|
|
5
|
+
import { actionFromWire, panelButtonFromWire, panelButtonToWire, panelFromWire, panelToWire } from "./serialize.mjs";
|
|
6
|
+
export { ACTION_TYPES, ACTION_TYPE_META, ActionType, GENERIC_ACTION_ICON, LEGACY_ICON_MAP, actionButtonLabel, actionFromWire, actionTypeLabel, actionTypeOptions, buttonGroupKey, compareButtonOrder, isActionType, isRegistryIconName, moveButtonInOrder, panelButtonFromWire, panelButtonOrder, panelButtonToWire, panelFromWire, panelOrderKeys, panelToWire, resolvePanelButtonIcon, treeReadPositions };
|
|
@@ -16,7 +16,8 @@
|
|
|
16
16
|
* - nullish `icon` ⇒ `{ name: '', type: null }`
|
|
17
17
|
* - `panelRules` keeps its null (opaque passthrough, no live example)
|
|
18
18
|
*/
|
|
19
|
-
import { Panel, PanelButton } from './types';
|
|
19
|
+
import { ActionConfig, Panel, PanelButton } from './types';
|
|
20
|
+
import type { JsonLogic, StagedRule } from '../inquiryTree/types';
|
|
20
21
|
/* -------------------------------------------------------------------------- */
|
|
21
22
|
/* Wire shapes */
|
|
22
23
|
/* -------------------------------------------------------------------------- */
|
|
@@ -26,9 +27,10 @@ type WireExtras = Record<string, unknown>;
|
|
|
26
27
|
export interface ActionRuleWire extends WireExtras {
|
|
27
28
|
actionRuleId?: string;
|
|
28
29
|
ruleId?: string;
|
|
29
|
-
jsonLogic?:
|
|
30
|
+
jsonLogic?: JsonLogic | null;
|
|
30
31
|
mapping?: Record<string, string> | null;
|
|
31
32
|
propertyIsCustomMapping?: Record<string, boolean> | null;
|
|
33
|
+
stagedRule?: StagedRule;
|
|
32
34
|
}
|
|
33
35
|
/** Nested `action` object on a panel-action row. */
|
|
34
36
|
export interface ActionWire extends WireExtras {
|
|
@@ -75,6 +77,8 @@ export interface PanelWire extends WireExtras {
|
|
|
75
77
|
parentPanelId?: string | null;
|
|
76
78
|
isProductPanel?: boolean;
|
|
77
79
|
}
|
|
80
|
+
/** Tolerant reader: one `action` row (nested, or from `action/{id}`). */
|
|
81
|
+
export declare const actionFromWire: (wire: ActionWire) => ActionConfig;
|
|
78
82
|
/** Tolerant reader: one `PanelAction` row → PanelButton. */
|
|
79
83
|
export declare const panelButtonFromWire: (wire: PanelActionWire) => PanelButton;
|
|
80
84
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serialize.d.ts","sourceRoot":"","sources":["../../../src/domain/actionPanel/serialize.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,
|
|
1
|
+
{"version":3,"file":"serialize.d.ts","sourceRoot":"","sources":["../../../src/domain/actionPanel/serialize.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EACL,YAAY,EAGZ,KAAK,EACL,WAAW,EAEZ,MAAM,SAAS,CAAC;AAEjB,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAElE,gFAAgF;AAChF,gFAAgF;AAChF,gFAAgF;AAEhF,wDAAwD;AACxD,KAAK,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAE1C,uCAAuC;AACvC,MAAM,WAAW,cAAe,SAAQ,UAAU;IAChD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC,MAA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AAO,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IACzB,SAAS,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IAC3B,UAAU,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;CAC7B;AAED,yCAAyC;AACzC,MAAM,WAAW,SAAU,SAAQ,UAAU;IAC3C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IAC9B,YAAY,CAAC,EAAE,eAAe,EAAE,GAAG,IAAI,CAAC;IACxC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AA0GD,yEAAyE;AACzE,eAAO,MAAM,cAAc,oCAgC1B,CAAC;AAkBF,8DAA4D;AAC5D,eAAO,MAAM,mBAAmB,wCAgB/B,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,aAAa,4BAwBzB,CAAC;AA8CF;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,0CAc7B,CAAC;AAEF,wEAAsE;AACtE,eAAO,MAAM,WAAW,6BAcvB,CAAC"}
|
|
@@ -41,7 +41,8 @@ const ACTION_RULE_KEYS = new Set([
|
|
|
41
41
|
'ruleId',
|
|
42
42
|
'jsonLogic',
|
|
43
43
|
'mapping',
|
|
44
|
-
'propertyIsCustomMapping'
|
|
44
|
+
'propertyIsCustomMapping',
|
|
45
|
+
'stagedRule'
|
|
45
46
|
]);
|
|
46
47
|
const ICON_KEYS = new Set(['name', 'type', 'fluentName']);
|
|
47
48
|
/** Collect the keys we do not model, deep-cloned. */
|
|
@@ -81,12 +82,15 @@ const actionRuleFromWire = (wire) => {
|
|
|
81
82
|
rule.actionRuleId = readString(wire.actionRuleId);
|
|
82
83
|
if (wire.ruleId !== undefined)
|
|
83
84
|
rule.ruleId = readString(wire.ruleId);
|
|
85
|
+
if (wire.stagedRule)
|
|
86
|
+
rule.stagedRule = deepClone(wire.stagedRule);
|
|
84
87
|
const unknownKeys = readUnknownKeys(wire, ACTION_RULE_KEYS);
|
|
85
88
|
if (unknownKeys)
|
|
86
89
|
rule.unknownKeys = unknownKeys;
|
|
87
90
|
return rule;
|
|
88
91
|
};
|
|
89
|
-
|
|
92
|
+
/** Tolerant reader: one `action` row (nested, or from `action/{id}`). */
|
|
93
|
+
export const actionFromWire = (wire) => {
|
|
90
94
|
const source = (wire !== null && wire !== void 0 ? wire : {});
|
|
91
95
|
const action = {
|
|
92
96
|
actionId: readNullableString(source.actionId),
|
|
@@ -187,7 +191,10 @@ const actionRuleToWire = (rule) => {
|
|
|
187
191
|
const out = Object.assign(Object.assign({}, deepClone((_a = rule.unknownKeys) !== null && _a !== void 0 ? _a : {})), { jsonLogic: deepClone(rule.jsonLogic), mapping: deepClone(rule.mapping), propertyIsCustomMapping: deepClone(rule.propertyIsCustomMapping) });
|
|
188
192
|
if (rule.actionRuleId !== undefined)
|
|
189
193
|
out.actionRuleId = rule.actionRuleId;
|
|
190
|
-
|
|
194
|
+
// A staged condition names its rule in stagedRule alone.
|
|
195
|
+
if (rule.stagedRule)
|
|
196
|
+
out.stagedRule = deepClone(rule.stagedRule);
|
|
197
|
+
else if (rule.ruleId !== undefined)
|
|
191
198
|
out.ruleId = rule.ruleId;
|
|
192
199
|
return out;
|
|
193
200
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serialize.js","sourceRoot":"","sources":["../../../src/domain/actionPanel/serialize.ts"],"names":[],"mappings":"AA0BA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"serialize.js","sourceRoot":"","sources":["../../../src/domain/actionPanel/serialize.ts"],"names":[],"mappings":"AA0BA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;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AAG,MAAM,CAAC,aAAa,CAAC;IAC3C,OAAO,GAAG,CAAC;AAAA,CACZ,CAAC;AAEF,wEAAsE;AACtE,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,KAAY,EAAa,EAAE,CAAC;;IACtD,MAAM,EAAE,QAAQ,EAAE,gBAAgB,EAAE,aAAa,EAAE,GAAG,KAAK,CAAC,UAAU,CAAC;IACvE,MAAM,GAAG,mCACJ,SAAS,OAAC,KAAK,CAAC,WAAW,mCAAI,EAAE,CAAC,KACrC,OAAO,EAAE,KAAK,CAAC,OAAO,EACtB,IAAI,EAAE,KAAK,CAAC,IAAI,EAChB,UAAU,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,UAAU,CAAC,EAC1E,YAAY,EAAE,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,EAClD,cAAc,EAAE,KAAK,CAAC,UAAU,CAAC,cAAc,GAChD,CAAC;IACF,IAAI,QAAQ,KAAK,SAAS;QAAE,GAAG,CAAC,QAAQ,GAAG,QAAQ,CAAC;IACpD,IAAI,gBAAgB,KAAK,SAAS;QAAE,GAAG,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;IAC5E,IAAI,aAAa,KAAK,SAAS;QAAE,GAAG,CAAC,aAAa,GAAG,aAAa,CAAC;IACnE,OAAO,GAAG,CAAC;AAAA,CACZ,CAAC"}
|
|
@@ -39,7 +39,8 @@ const ACTION_RULE_KEYS = new Set([
|
|
|
39
39
|
"ruleId",
|
|
40
40
|
"jsonLogic",
|
|
41
41
|
"mapping",
|
|
42
|
-
"propertyIsCustomMapping"
|
|
42
|
+
"propertyIsCustomMapping",
|
|
43
|
+
"stagedRule"
|
|
43
44
|
]);
|
|
44
45
|
const ICON_KEYS = new Set([
|
|
45
46
|
"name",
|
|
@@ -72,10 +73,12 @@ const actionRuleFromWire = (wire) => {
|
|
|
72
73
|
};
|
|
73
74
|
if (wire.actionRuleId !== void 0) rule.actionRuleId = readString(wire.actionRuleId);
|
|
74
75
|
if (wire.ruleId !== void 0) rule.ruleId = readString(wire.ruleId);
|
|
76
|
+
if (wire.stagedRule) rule.stagedRule = deepClone(wire.stagedRule);
|
|
75
77
|
const unknownKeys = readUnknownKeys(wire, ACTION_RULE_KEYS);
|
|
76
78
|
if (unknownKeys) rule.unknownKeys = unknownKeys;
|
|
77
79
|
return rule;
|
|
78
80
|
};
|
|
81
|
+
/** Tolerant reader: one `action` row (nested, or from `action/{id}`). */
|
|
79
82
|
const actionFromWire = (wire) => {
|
|
80
83
|
const source = wire ?? {};
|
|
81
84
|
const action = {
|
|
@@ -154,7 +157,8 @@ const actionRuleToWire = (rule) => {
|
|
|
154
157
|
propertyIsCustomMapping: deepClone(rule.propertyIsCustomMapping)
|
|
155
158
|
};
|
|
156
159
|
if (rule.actionRuleId !== void 0) out.actionRuleId = rule.actionRuleId;
|
|
157
|
-
if (rule.
|
|
160
|
+
if (rule.stagedRule) out.stagedRule = deepClone(rule.stagedRule);
|
|
161
|
+
else if (rule.ruleId !== void 0) out.ruleId = rule.ruleId;
|
|
158
162
|
return out;
|
|
159
163
|
};
|
|
160
164
|
const actionToWire = (action) => {
|
|
@@ -217,6 +221,6 @@ const panelToWire = (panel) => {
|
|
|
217
221
|
return out;
|
|
218
222
|
};
|
|
219
223
|
//#endregion
|
|
220
|
-
export { panelButtonFromWire, panelButtonToWire, panelFromWire, panelToWire };
|
|
224
|
+
export { actionFromWire, panelButtonFromWire, panelButtonToWire, panelFromWire, panelToWire };
|
|
221
225
|
|
|
222
226
|
//# sourceMappingURL=serialize.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serialize.mjs","names":["ActionConfig","ActionRule","ActionType","Panel","PanelButton","PanelButtonIcon","deepClone","WireExtras","Record","ActionRuleWire","actionRuleId","ruleId","jsonLogic","mapping","propertyIsCustomMapping","ActionWire","actionId","name","actionTypeId","value","parameters","actionRules","tenantId","productVersionId","parentActionId","isProductAction","isGlobalAction","PanelButtonIconWire","type","fluentName","PanelActionWire","panelActionId","action","icon","groupName","sequence","enabled","isPrimary","hideAction","PanelWire","panelId","panelRules","panelActions","parentPanelId","isProductPanel","PANEL_KEYS","Set","PANEL_ACTION_KEYS","ACTION_KEYS","ACTION_RULE_KEYS","ICON_KEYS","readUnknownKeys","source","typedKeys","unknown","key","Object","entries","has","keys","length","undefined","readString","fallback","readNullableString","readBoolean","Boolean","readNumber","Number","isFinite","trim","parsed","actionRuleFromWire","wire","rule","unknownKeys","actionFromWire","rules","Array","isArray","map","provenance","iconFromWire","panelButtonFromWire","button","panelFromWire","panel","buttons","actionRuleToWire","out","actionToWire","iconToWire","panelButtonToWire","panelToWire"],"sources":["../../../src/domain/actionPanel/serialize.ts"],"sourcesContent":["/**\n * Tolerant reader (wire → typed) and strict writer (typed → wire) for action\n * panels. The ONLY place in the codebase that reshapes panel/action data.\n *\n * Reader guarantees: no data loss. Every key we do not model rides through\n * `unknownKeys` on the owning object and is re-emitted on write, so a\n * read→write with no edits reproduces the wire object modulo these documented\n * normalizations:\n * - `sequence` may arrive as a legacy string ⇒ always a number in domain and\n * on write\n * - `actionTypeId` may arrive as a string ⇒ always a number (unparseable /\n * missing reads as 0, which `isActionType` rejects)\n * - nullish `enabled` / `isPrimary` / `hideAction` ⇒ true / false / false\n * - nullish `groupName` / `value` ⇒ null\n * - nullish `actionRules` ⇒ `[]` (and written as `[]`)\n * - nullish `icon` ⇒ `{ name: '', type: null }`\n * - `panelRules` keeps its null (opaque passthrough, no live example)\n */\nimport {\n ActionConfig,\n ActionRule,\n ActionType,\n Panel,\n PanelButton,\n PanelButtonIcon\n} from './types';\nimport { deepClone } from '../jsonClone';\n\n/* -------------------------------------------------------------------------- */\n/* Wire shapes */\n/* -------------------------------------------------------------------------- */\n\n/** Anything the server may add that we do not model. */\ntype WireExtras = Record<string, unknown>;\n\n/** `actionRules[]` row on the wire. */\nexport interface ActionRuleWire extends WireExtras {\n actionRuleId?: string;\n ruleId?: string;\n jsonLogic?: unknown;\n mapping?: Record<string, string> | null;\n propertyIsCustomMapping?: Record<string, boolean> | null;\n}\n\n/** Nested `action` object on a panel-action row. */\nexport interface ActionWire extends WireExtras {\n actionId?: string | null;\n name?: string;\n actionTypeId?: number | string;\n value?: string | null;\n parameters?: Record<string, unknown> | null;\n actionRules?: ActionRuleWire[] | null;\n tenantId?: string;\n productVersionId?: string;\n parentActionId?: string | null;\n isProductAction?: boolean;\n isGlobalAction?: boolean;\n}\n\n/** `icon` object on a panel-action row. */\nexport interface PanelButtonIconWire extends WireExtras {\n name?: string;\n type?: string | null;\n fluentName?: string | null;\n}\n\n/**\n * A panel↔action association row — the element type of both\n * `panel/detailed`'s nested `panelActions` and `action/panel/{panelId}`.\n */\nexport interface PanelActionWire extends WireExtras {\n panelActionId?: string;\n action?: ActionWire | null;\n icon?: PanelButtonIconWire | null;\n groupName?: string | null;\n sequence?: number | string | null;\n enabled?: boolean | null;\n isPrimary?: boolean | null;\n hideAction?: boolean | null;\n}\n\n/** A panel row from `panel/detailed`. */\nexport interface PanelWire extends WireExtras {\n panelId?: string;\n name?: string;\n panelRules?: unknown[] | null;\n panelActions?: PanelActionWire[] | null;\n tenantId?: string;\n productVersionId?: string;\n parentPanelId?: string | null;\n isProductPanel?: boolean;\n}\n\n/* -------------------------------------------------------------------------- */\n/* Primitives */\n/* -------------------------------------------------------------------------- */\n\n/** Keys read into typed fields; everything else → the object's unknownKeys. */\nconst PANEL_KEYS = new Set([\n 'panelId',\n 'name',\n 'panelRules',\n 'panelActions',\n 'tenantId',\n 'productVersionId',\n 'parentPanelId',\n 'isProductPanel'\n]);\n\nconst PANEL_ACTION_KEYS = new Set([\n 'panelActionId',\n 'action',\n 'icon',\n 'groupName',\n 'sequence',\n 'enabled',\n 'isPrimary',\n 'hideAction'\n]);\n\nconst ACTION_KEYS = new Set([\n 'actionId',\n 'name',\n 'actionTypeId',\n 'value',\n 'parameters',\n 'actionRules',\n 'tenantId',\n 'productVersionId',\n 'parentActionId',\n 'isProductAction',\n 'isGlobalAction'\n]);\n\nconst ACTION_RULE_KEYS = new Set([\n 'actionRuleId',\n 'ruleId',\n 'jsonLogic',\n 'mapping',\n 'propertyIsCustomMapping'\n]);\n\nconst ICON_KEYS = new Set(['name', 'type', 'fluentName']);\n\n/** Collect the keys we do not model, deep-cloned. */\nconst readUnknownKeys = (\n source: Record<string, unknown>,\n typedKeys: Set<string>\n): Record<string, unknown> | undefined => {\n const unknown: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(source)) {\n if (!typedKeys.has(key)) unknown[key] = deepClone(value);\n }\n return Object.keys(unknown).length ? unknown : undefined;\n};\n\nconst readString = (value: unknown, fallback = ''): string =>\n typeof value === 'string' ? value : fallback;\n\nconst readNullableString = (value: unknown): string | null =>\n typeof value === 'string' ? value : null;\n\nconst readBoolean = (value: unknown, fallback: boolean): boolean =>\n value === null || value === undefined ? fallback : Boolean(value);\n\n/** Legacy wires send numbers as strings; domain numbers are always numbers. */\nconst readNumber = (value: unknown, fallback = 0): number => {\n if (typeof value === 'number' && Number.isFinite(value)) return value;\n if (typeof value === 'string' && value.trim() !== '') {\n const parsed = Number(value);\n if (Number.isFinite(parsed)) return parsed;\n }\n return fallback;\n};\n\n/* -------------------------------------------------------------------------- */\n/* Reader */\n/* -------------------------------------------------------------------------- */\n\nconst actionRuleFromWire = (wire: ActionRuleWire): ActionRule => {\n const rule: ActionRule = {\n jsonLogic: deepClone(wire.jsonLogic ?? null),\n mapping: deepClone(wire.mapping ?? {}),\n propertyIsCustomMapping: deepClone(\n wire.propertyIsCustomMapping ?? {}\n )\n };\n if (wire.actionRuleId !== undefined)\n rule.actionRuleId = readString(wire.actionRuleId);\n if (wire.ruleId !== undefined) rule.ruleId = readString(wire.ruleId);\n const unknownKeys = readUnknownKeys(wire, ACTION_RULE_KEYS);\n if (unknownKeys) rule.unknownKeys = unknownKeys;\n return rule;\n};\n\nconst actionFromWire = (wire: ActionWire | null | undefined): ActionConfig => {\n const source = (wire ?? {});\n const action: ActionConfig = {\n actionId: readNullableString(source.actionId),\n name: readString(source.name),\n actionTypeId: readNumber(source.actionTypeId) as ActionType,\n value: readNullableString(source.value),\n parameters:\n source.parameters === null || source.parameters === undefined\n ? null\n : (deepClone(source.parameters) as ActionConfig['parameters']),\n rules: Array.isArray(source.actionRules)\n ? source.actionRules.map(actionRuleFromWire)\n : [],\n provenance: {\n isProductAction: readBoolean(source.isProductAction, false),\n isGlobalAction: readBoolean(source.isGlobalAction, false)\n }\n };\n if (source.tenantId !== undefined)\n action.provenance.tenantId = readString(source.tenantId);\n if (source.productVersionId !== undefined)\n action.provenance.productVersionId = readString(source.productVersionId);\n if (source.parentActionId !== undefined)\n action.provenance.parentActionId = readNullableString(\n source.parentActionId\n );\n const unknownKeys = readUnknownKeys(source, ACTION_KEYS);\n if (unknownKeys) action.unknownKeys = unknownKeys;\n return action;\n};\n\nconst iconFromWire = (\n wire: PanelButtonIconWire | null | undefined\n): PanelButtonIcon => {\n const source = (wire ?? {});\n const icon: PanelButtonIcon = {\n name: readString(source.name),\n type: readNullableString(source.type)\n };\n if (source.fluentName !== undefined) {\n icon.fluentName = readNullableString(source.fluentName);\n }\n const unknownKeys = readUnknownKeys(source, ICON_KEYS);\n if (unknownKeys) icon.unknownKeys = unknownKeys;\n return icon;\n};\n\n/** Tolerant reader: one `PanelAction` row → PanelButton. */\nexport const panelButtonFromWire = (wire: PanelActionWire): PanelButton => {\n const source = (wire ?? {});\n const button: PanelButton = {\n action: actionFromWire(source.action),\n icon: iconFromWire(source.icon),\n groupName: readNullableString(source.groupName),\n sequence: readNumber(source.sequence),\n enabled: readBoolean(source.enabled, true),\n isPrimary: readBoolean(source.isPrimary, false),\n hideAction: readBoolean(source.hideAction, false)\n };\n if (source.panelActionId !== undefined)\n button.panelActionId = readString(source.panelActionId);\n const unknownKeys = readUnknownKeys(source, PANEL_ACTION_KEYS);\n if (unknownKeys) button.unknownKeys = unknownKeys;\n return button;\n};\n\n/**\n * Tolerant reader: one `panel/detailed` row → Panel.\n * Buttons come from the nested `panelActions`; pass rows fetched separately\n * from `action/panel/{panelId}` through `panelButtonFromWire` instead.\n */\nexport const panelFromWire = (wire: PanelWire): Panel => {\n const source = (wire ?? {});\n const panel: Panel = {\n panelId: readString(source.panelId),\n name: readString(source.name),\n buttons: Array.isArray(source.panelActions)\n ? source.panelActions.map(panelButtonFromWire)\n : [],\n panelRules: Array.isArray(source.panelRules)\n ? deepClone(source.panelRules)\n : null,\n provenance: {\n isProductPanel: readBoolean(source.isProductPanel, false)\n }\n };\n if (source.tenantId !== undefined)\n panel.provenance.tenantId = readString(source.tenantId);\n if (source.productVersionId !== undefined)\n panel.provenance.productVersionId = readString(source.productVersionId);\n if (source.parentPanelId !== undefined)\n panel.provenance.parentPanelId = readNullableString(source.parentPanelId);\n const unknownKeys = readUnknownKeys(source, PANEL_KEYS);\n if (unknownKeys) panel.unknownKeys = unknownKeys;\n return panel;\n};\n\n/* -------------------------------------------------------------------------- */\n/* Writer */\n/* -------------------------------------------------------------------------- */\n\nconst actionRuleToWire = (rule: ActionRule): ActionRuleWire => {\n const out: ActionRuleWire = {\n ...deepClone(rule.unknownKeys ?? {}),\n jsonLogic: deepClone(rule.jsonLogic),\n mapping: deepClone(rule.mapping),\n propertyIsCustomMapping: deepClone(rule.propertyIsCustomMapping)\n };\n if (rule.actionRuleId !== undefined) out.actionRuleId = rule.actionRuleId;\n if (rule.ruleId !== undefined) out.ruleId = rule.ruleId;\n return out;\n};\n\nconst actionToWire = (action: ActionConfig): ActionWire => {\n const { tenantId, productVersionId, parentActionId } = action.provenance;\n const out: ActionWire = {\n ...deepClone(action.unknownKeys ?? {}),\n actionId: action.actionId,\n name: action.name,\n actionTypeId: action.actionTypeId,\n value: action.value,\n parameters: action.parameters === null ? null : deepClone(action.parameters),\n actionRules: action.rules.map(actionRuleToWire),\n isProductAction: action.provenance.isProductAction,\n isGlobalAction: action.provenance.isGlobalAction\n };\n if (tenantId !== undefined) out.tenantId = tenantId;\n if (productVersionId !== undefined) out.productVersionId = productVersionId;\n if (parentActionId !== undefined) out.parentActionId = parentActionId;\n return out;\n};\n\nconst iconToWire = (icon: PanelButtonIcon): PanelButtonIconWire => ({\n ...deepClone(icon.unknownKeys ?? {}),\n name: icon.name,\n type: icon.type,\n ...(icon.fluentName !== undefined && { fluentName: icon.fluentName })\n});\n\n/**\n * Strict writer: PanelButton → one `PanelAction` wire row.\n * `panelActionId` is emitted only when the button is persisted, which is what\n * the PUT contract buckets on (add-and-associate vs update).\n */\nexport const panelButtonToWire = (button: PanelButton): PanelActionWire => {\n const out: PanelActionWire = {\n ...deepClone(button.unknownKeys ?? {}),\n action: actionToWire(button.action),\n icon: iconToWire(button.icon),\n groupName: button.groupName,\n sequence: button.sequence,\n enabled: button.enabled,\n isPrimary: button.isPrimary,\n hideAction: button.hideAction\n };\n if (button.panelActionId !== undefined)\n out.panelActionId = button.panelActionId;\n return out;\n};\n\n/** Strict writer: Panel → the `panel/detailed`-shaped wire object. */\nexport const panelToWire = (panel: Panel): PanelWire => {\n const { tenantId, productVersionId, parentPanelId } = panel.provenance;\n const out: PanelWire = {\n ...deepClone(panel.unknownKeys ?? {}),\n panelId: panel.panelId,\n name: panel.name,\n panelRules: panel.panelRules === null ? null : deepClone(panel.panelRules),\n panelActions: panel.buttons.map(panelButtonToWire),\n isProductPanel: panel.provenance.isProductPanel\n };\n if (tenantId !== undefined) out.tenantId = tenantId;\n if (productVersionId !== undefined) out.productVersionId = productVersionId;\n if (parentPanelId !== undefined) out.parentPanelId = parentPanelId;\n return out;\n};\n"],"mappings":";;;AAkGA,MAAM6C,aAAa,IAAIC,IAAI;CACzB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD,CAAC;AAEF,MAAMC,oBAAoB,IAAID,IAAI;CAChC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD,CAAC;AAEF,MAAME,cAAc,IAAIF,IAAI;CAC1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KAAInE,WAAWA;AAC3C,KAAIC,qBAAqBsC,KAAAA,EAAW4B,KAAIlE,mBAAmBA;AAC3D,KAAIoB,kBAAkBkB,KAAAA,EAAW4B,KAAI9C,gBAAgBA;AACrD,QAAO8C"}
|
|
1
|
+
{"version":3,"file":"serialize.mjs","names":["ActionConfig","ActionRule","ActionType","Panel","PanelButton","PanelButtonIcon","deepClone","JsonLogic","StagedRule","WireExtras","Record","ActionRuleWire","actionRuleId","ruleId","jsonLogic","mapping","propertyIsCustomMapping","stagedRule","ActionWire","actionId","name","actionTypeId","value","parameters","actionRules","tenantId","productVersionId","parentActionId","isProductAction","isGlobalAction","PanelButtonIconWire","type","fluentName","PanelActionWire","panelActionId","action","icon","groupName","sequence","enabled","isPrimary","hideAction","PanelWire","panelId","panelRules","panelActions","parentPanelId","isProductPanel","PANEL_KEYS","Set","PANEL_ACTION_KEYS","ACTION_KEYS","ACTION_RULE_KEYS","ICON_KEYS","readUnknownKeys","source","typedKeys","unknown","key","Object","entries","has","keys","length","undefined","readString","fallback","readNullableString","readBoolean","Boolean","readNumber","Number","isFinite","trim","parsed","actionRuleFromWire","wire","rule","unknownKeys","actionFromWire","rules","Array","isArray","map","provenance","iconFromWire","panelButtonFromWire","button","panelFromWire","panel","buttons","actionRuleToWire","out","actionToWire","iconToWire","panelButtonToWire","panelToWire"],"sources":["../../../src/domain/actionPanel/serialize.ts"],"sourcesContent":["/**\n * Tolerant reader (wire → typed) and strict writer (typed → wire) for action\n * panels. The ONLY place in the codebase that reshapes panel/action data.\n *\n * Reader guarantees: no data loss. Every key we do not model rides through\n * `unknownKeys` on the owning object and is re-emitted on write, so a\n * read→write with no edits reproduces the wire object modulo these documented\n * normalizations:\n * - `sequence` may arrive as a legacy string ⇒ always a number in domain and\n * on write\n * - `actionTypeId` may arrive as a string ⇒ always a number (unparseable /\n * missing reads as 0, which `isActionType` rejects)\n * - nullish `enabled` / `isPrimary` / `hideAction` ⇒ true / false / false\n * - nullish `groupName` / `value` ⇒ null\n * - nullish `actionRules` ⇒ `[]` (and written as `[]`)\n * - nullish `icon` ⇒ `{ name: '', type: null }`\n * - `panelRules` keeps its null (opaque passthrough, no live example)\n */\nimport {\n ActionConfig,\n ActionRule,\n ActionType,\n Panel,\n PanelButton,\n PanelButtonIcon\n} from './types';\nimport { deepClone } from '../jsonClone';\nimport type { JsonLogic, StagedRule } from '../inquiryTree/types';\n\n/* -------------------------------------------------------------------------- */\n/* Wire shapes */\n/* -------------------------------------------------------------------------- */\n\n/** Anything the server may add that we do not model. */\ntype WireExtras = Record<string, unknown>;\n\n/** `actionRules[]` row on the wire. */\nexport interface ActionRuleWire extends WireExtras {\n actionRuleId?: string;\n ruleId?: string;\n jsonLogic?: JsonLogic | null;\n mapping?: Record<string, string> | null;\n propertyIsCustomMapping?: Record<string, boolean> | null;\n stagedRule?: StagedRule;\n}\n\n/** Nested `action` object on a panel-action row. */\nexport interface ActionWire extends WireExtras {\n actionId?: string | null;\n name?: string;\n actionTypeId?: number | string;\n value?: string | null;\n parameters?: Record<string, unknown> | null;\n actionRules?: ActionRuleWire[] | null;\n tenantId?: string;\n productVersionId?: string;\n parentActionId?: string | null;\n isProductAction?: boolean;\n isGlobalAction?: boolean;\n}\n\n/** `icon` object on a panel-action row. */\nexport interface PanelButtonIconWire extends WireExtras {\n name?: string;\n type?: string | null;\n fluentName?: string | null;\n}\n\n/**\n * A panel↔action association row — the element type of both\n * `panel/detailed`'s nested `panelActions` and `action/panel/{panelId}`.\n */\nexport interface PanelActionWire extends WireExtras {\n panelActionId?: string;\n action?: ActionWire | null;\n icon?: PanelButtonIconWire | null;\n groupName?: string | null;\n sequence?: number | string | null;\n enabled?: boolean | null;\n isPrimary?: boolean | null;\n hideAction?: boolean | null;\n}\n\n/** A panel row from `panel/detailed`. */\nexport interface PanelWire extends WireExtras {\n panelId?: string;\n name?: string;\n panelRules?: unknown[] | null;\n panelActions?: PanelActionWire[] | null;\n tenantId?: string;\n productVersionId?: string;\n parentPanelId?: string | null;\n isProductPanel?: boolean;\n}\n\n/* -------------------------------------------------------------------------- */\n/* Primitives */\n/* -------------------------------------------------------------------------- */\n\n/** Keys read into typed fields; everything else → the object's unknownKeys. */\nconst PANEL_KEYS = new Set([\n 'panelId',\n 'name',\n 'panelRules',\n 'panelActions',\n 'tenantId',\n 'productVersionId',\n 'parentPanelId',\n 'isProductPanel'\n]);\n\nconst PANEL_ACTION_KEYS = new Set([\n 'panelActionId',\n 'action',\n 'icon',\n 'groupName',\n 'sequence',\n 'enabled',\n 'isPrimary',\n 'hideAction'\n]);\n\nconst ACTION_KEYS = new Set([\n 'actionId',\n 'name',\n 'actionTypeId',\n 'value',\n 'parameters',\n 'actionRules',\n 'tenantId',\n 'productVersionId',\n 'parentActionId',\n 'isProductAction',\n 'isGlobalAction'\n]);\n\nconst ACTION_RULE_KEYS = new Set([\n 'actionRuleId',\n 'ruleId',\n 'jsonLogic',\n 'mapping',\n 'propertyIsCustomMapping',\n 'stagedRule'\n]);\n\nconst ICON_KEYS = new Set(['name', 'type', 'fluentName']);\n\n/** Collect the keys we do not model, deep-cloned. */\nconst readUnknownKeys = (\n source: Record<string, unknown>,\n typedKeys: Set<string>\n): Record<string, unknown> | undefined => {\n const unknown: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(source)) {\n if (!typedKeys.has(key)) unknown[key] = deepClone(value);\n }\n return Object.keys(unknown).length ? unknown : undefined;\n};\n\nconst readString = (value: unknown, fallback = ''): string =>\n typeof value === 'string' ? value : fallback;\n\nconst readNullableString = (value: unknown): string | null =>\n typeof value === 'string' ? value : null;\n\nconst readBoolean = (value: unknown, fallback: boolean): boolean =>\n value === null || value === undefined ? fallback : Boolean(value);\n\n/** Legacy wires send numbers as strings; domain numbers are always numbers. */\nconst readNumber = (value: unknown, fallback = 0): number => {\n if (typeof value === 'number' && Number.isFinite(value)) return value;\n if (typeof value === 'string' && value.trim() !== '') {\n const parsed = Number(value);\n if (Number.isFinite(parsed)) return parsed;\n }\n return fallback;\n};\n\n/* -------------------------------------------------------------------------- */\n/* Reader */\n/* -------------------------------------------------------------------------- */\n\nconst actionRuleFromWire = (wire: ActionRuleWire): ActionRule => {\n const rule: ActionRule = {\n jsonLogic: deepClone(wire.jsonLogic ?? null),\n mapping: deepClone(wire.mapping ?? {}),\n propertyIsCustomMapping: deepClone(\n wire.propertyIsCustomMapping ?? {}\n )\n };\n if (wire.actionRuleId !== undefined)\n rule.actionRuleId = readString(wire.actionRuleId);\n if (wire.ruleId !== undefined) rule.ruleId = readString(wire.ruleId);\n if (wire.stagedRule) rule.stagedRule = deepClone(wire.stagedRule);\n const unknownKeys = readUnknownKeys(wire, ACTION_RULE_KEYS);\n if (unknownKeys) rule.unknownKeys = unknownKeys;\n return rule;\n};\n\n/** Tolerant reader: one `action` row (nested, or from `action/{id}`). */\nexport const actionFromWire = (\n wire: ActionWire | null | undefined\n): ActionConfig => {\n const source = (wire ?? {});\n const action: ActionConfig = {\n actionId: readNullableString(source.actionId),\n name: readString(source.name),\n actionTypeId: readNumber(source.actionTypeId) as ActionType,\n value: readNullableString(source.value),\n parameters:\n source.parameters === null || source.parameters === undefined\n ? null\n : (deepClone(source.parameters) as ActionConfig['parameters']),\n rules: Array.isArray(source.actionRules)\n ? source.actionRules.map(actionRuleFromWire)\n : [],\n provenance: {\n isProductAction: readBoolean(source.isProductAction, false),\n isGlobalAction: readBoolean(source.isGlobalAction, false)\n }\n };\n if (source.tenantId !== undefined)\n action.provenance.tenantId = readString(source.tenantId);\n if (source.productVersionId !== undefined)\n action.provenance.productVersionId = readString(source.productVersionId);\n if (source.parentActionId !== undefined)\n action.provenance.parentActionId = readNullableString(\n source.parentActionId\n );\n const unknownKeys = readUnknownKeys(source, ACTION_KEYS);\n if (unknownKeys) action.unknownKeys = unknownKeys;\n return action;\n};\n\nconst iconFromWire = (\n wire: PanelButtonIconWire | null | undefined\n): PanelButtonIcon => {\n const source = (wire ?? {});\n const icon: PanelButtonIcon = {\n name: readString(source.name),\n type: readNullableString(source.type)\n };\n if (source.fluentName !== undefined) {\n icon.fluentName = readNullableString(source.fluentName);\n }\n const unknownKeys = readUnknownKeys(source, ICON_KEYS);\n if (unknownKeys) icon.unknownKeys = unknownKeys;\n return icon;\n};\n\n/** Tolerant reader: one `PanelAction` row → PanelButton. */\nexport const panelButtonFromWire = (wire: PanelActionWire): PanelButton => {\n const source = (wire ?? {});\n const button: PanelButton = {\n action: actionFromWire(source.action),\n icon: iconFromWire(source.icon),\n groupName: readNullableString(source.groupName),\n sequence: readNumber(source.sequence),\n enabled: readBoolean(source.enabled, true),\n isPrimary: readBoolean(source.isPrimary, false),\n hideAction: readBoolean(source.hideAction, false)\n };\n if (source.panelActionId !== undefined)\n button.panelActionId = readString(source.panelActionId);\n const unknownKeys = readUnknownKeys(source, PANEL_ACTION_KEYS);\n if (unknownKeys) button.unknownKeys = unknownKeys;\n return button;\n};\n\n/**\n * Tolerant reader: one `panel/detailed` row → Panel.\n * Buttons come from the nested `panelActions`; pass rows fetched separately\n * from `action/panel/{panelId}` through `panelButtonFromWire` instead.\n */\nexport const panelFromWire = (wire: PanelWire): Panel => {\n const source = (wire ?? {});\n const panel: Panel = {\n panelId: readString(source.panelId),\n name: readString(source.name),\n buttons: Array.isArray(source.panelActions)\n ? source.panelActions.map(panelButtonFromWire)\n : [],\n panelRules: Array.isArray(source.panelRules)\n ? deepClone(source.panelRules)\n : null,\n provenance: {\n isProductPanel: readBoolean(source.isProductPanel, false)\n }\n };\n if (source.tenantId !== undefined)\n panel.provenance.tenantId = readString(source.tenantId);\n if (source.productVersionId !== undefined)\n panel.provenance.productVersionId = readString(source.productVersionId);\n if (source.parentPanelId !== undefined)\n panel.provenance.parentPanelId = readNullableString(source.parentPanelId);\n const unknownKeys = readUnknownKeys(source, PANEL_KEYS);\n if (unknownKeys) panel.unknownKeys = unknownKeys;\n return panel;\n};\n\n/* -------------------------------------------------------------------------- */\n/* Writer */\n/* -------------------------------------------------------------------------- */\n\nconst actionRuleToWire = (rule: ActionRule): ActionRuleWire => {\n const out: ActionRuleWire = {\n ...deepClone(rule.unknownKeys ?? {}),\n jsonLogic: deepClone(rule.jsonLogic),\n mapping: deepClone(rule.mapping),\n propertyIsCustomMapping: deepClone(rule.propertyIsCustomMapping)\n };\n if (rule.actionRuleId !== undefined) out.actionRuleId = rule.actionRuleId;\n // A staged condition names its rule in stagedRule alone.\n if (rule.stagedRule) out.stagedRule = deepClone(rule.stagedRule);\n else if (rule.ruleId !== undefined) out.ruleId = rule.ruleId;\n return out;\n};\n\nconst actionToWire = (action: ActionConfig): ActionWire => {\n const { tenantId, productVersionId, parentActionId } = action.provenance;\n const out: ActionWire = {\n ...deepClone(action.unknownKeys ?? {}),\n actionId: action.actionId,\n name: action.name,\n actionTypeId: action.actionTypeId,\n value: action.value,\n parameters: action.parameters === null ? null : deepClone(action.parameters),\n actionRules: action.rules.map(actionRuleToWire),\n isProductAction: action.provenance.isProductAction,\n isGlobalAction: action.provenance.isGlobalAction\n };\n if (tenantId !== undefined) out.tenantId = tenantId;\n if (productVersionId !== undefined) out.productVersionId = productVersionId;\n if (parentActionId !== undefined) out.parentActionId = parentActionId;\n return out;\n};\n\nconst iconToWire = (icon: PanelButtonIcon): PanelButtonIconWire => ({\n ...deepClone(icon.unknownKeys ?? {}),\n name: icon.name,\n type: icon.type,\n ...(icon.fluentName !== undefined && { fluentName: icon.fluentName })\n});\n\n/**\n * Strict writer: PanelButton → one `PanelAction` wire row.\n * `panelActionId` is emitted only when the button is persisted, which is what\n * the PUT contract buckets on (add-and-associate vs update).\n */\nexport const panelButtonToWire = (button: PanelButton): PanelActionWire => {\n const out: PanelActionWire = {\n ...deepClone(button.unknownKeys ?? {}),\n action: actionToWire(button.action),\n icon: iconToWire(button.icon),\n groupName: button.groupName,\n sequence: button.sequence,\n enabled: button.enabled,\n isPrimary: button.isPrimary,\n hideAction: button.hideAction\n };\n if (button.panelActionId !== undefined)\n out.panelActionId = button.panelActionId;\n return out;\n};\n\n/** Strict writer: Panel → the `panel/detailed`-shaped wire object. */\nexport const panelToWire = (panel: Panel): PanelWire => {\n const { tenantId, productVersionId, parentPanelId } = panel.provenance;\n const out: PanelWire = {\n ...deepClone(panel.unknownKeys ?? {}),\n panelId: panel.panelId,\n name: panel.name,\n panelRules: panel.panelRules === null ? null : deepClone(panel.panelRules),\n panelActions: panel.buttons.map(panelButtonToWire),\n isProductPanel: panel.provenance.isProductPanel\n };\n if (tenantId !== undefined) out.tenantId = tenantId;\n if (productVersionId !== undefined) out.productVersionId = productVersionId;\n if (parentPanelId !== undefined) out.parentPanelId = parentPanelId;\n return out;\n};\n"],"mappings":";;;AAoGA,MAAMgD,aAAa,IAAIC,IAAI;CACzB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD,CAAC;AAEF,MAAMC,oBAAoB,IAAID,IAAI;CAChC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD,CAAC;AAEF,MAAME,cAAc,IAAIF,IAAI;CAC1B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD,CAAC;AAEF,MAAMG,mBAAmB,IAAIH,IAAI;CAC/B;CACA;CACA;CACA;CACA;CACA;CACD,CAAC;AAEF,MAAMI,YAAY,IAAIJ,IAAI;CAAC;CAAQ;CAAQ;CAAa,CAAC;;AAGzD,MAAMK,mBACJC,QACAC,cACwC;CACxC,MAAMC,UAAmC,EAAE;AAC3C,MAAK,MAAM,CAACC,KAAKpC,UAAUqC,OAAOC,QAAQL,OAAO,CAC/C,KAAI,CAACC,UAAUK,IAAIH,IAAI,CAAED,SAAQC,OAAOpD,UAAUgB,MAAM;AAE1D,QAAOqC,OAAOG,KAAKL,QAAQ,CAACM,SAASN,UAAUO,KAAAA;;AAGjD,MAAMC,cAAc3C,OAAgB4C,WAAW,OAC7C,OAAO5C,UAAU,WAAWA,QAAQ4C;AAEtC,MAAMC,sBAAsB7C,UAC1B,OAAOA,UAAU,WAAWA,QAAQ;AAEtC,MAAM8C,eAAe9C,OAAgB4C,aACnC5C,UAAU,Q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AOT,eAAe,EAAE,CAAC;EACtC3C,QAAQ0D,aAAaN,OAAOpD,OAAO;EACnCC,MAAM0D,WAAWP,OAAOnD,KAAK;EAC7BC,WAAWkD,OAAOlD;EAClBC,UAAUiD,OAAOjD;EACjBC,SAASgD,OAAOhD;EAChBC,WAAW+C,OAAO/C;EAClBC,YAAY8C,OAAO9C;EACpB;AACD,KAAI8C,OAAOrD,kBAAkB8B,KAAAA,EAC3B4B,KAAI1D,gBAAgBqD,OAAOrD;AAC7B,QAAO0D;;;AAIT,MAAaI,eAAeP,UAA4B;CACtD,MAAM,EAAEhE,UAAUC,kBAAkBoB,kBAAkB2C,MAAML;CAC5D,MAAMQ,MAAiB;EACrB,GAAGtF,UAAUmF,MAAMX,eAAe,EAAE,CAAC;EACrCnC,SAAS8C,MAAM9C;EACfvB,MAAMqE,MAAMrE;EACZwB,YAAY6C,MAAM7C,eAAe,OAAO,OAAOtC,UAAUmF,MAAM7C,WAAW;EAC1EC,cAAc4C,MAAMC,QAAQP,IAAIY,kBAAkB;EAClDhD,gBAAgB0C,MAAML,WAAWrC;EAClC;AACD,KAAItB,aAAauC,KAAAA,EAAW4B,KAAInE,WAAWA;AAC3C,KAAIC,qBAAqBsC,KAAAA,EAAW4B,KAAIlE,mBAAmBA;AAC3D,KAAIoB,kBAAkBkB,KAAAA,EAAW4B,KAAI9C,gBAAgBA;AACrD,QAAO8C"}
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
* not model (clusterId, redundant parent ids, future additions) survive a
|
|
19
19
|
* read→edit→write round trip untouched.
|
|
20
20
|
*/
|
|
21
|
-
|
|
22
|
-
export type JsonLogic
|
|
21
|
+
import type { JsonLogic, StagedRule } from '../inquiryTree/types';
|
|
22
|
+
export type { JsonLogic };
|
|
23
23
|
/**
|
|
24
24
|
* Action behaviour discriminator (legacy `NodeActionEnums`, offered subset).
|
|
25
25
|
* The numbers are persisted values — never renumber.
|
|
@@ -65,14 +65,22 @@ export declare const isActionType: (value: unknown) => value is ActionType;
|
|
|
65
65
|
export interface ActionRule {
|
|
66
66
|
/** Association id — absent on a rule that has never been persisted. */
|
|
67
67
|
actionRuleId?: string;
|
|
68
|
-
/**
|
|
68
|
+
/**
|
|
69
|
+
* Tenant `Rule` entity this row links to. Absent while `stagedRule` names
|
|
70
|
+
* the rule Save binds — a condition names its rule in one place.
|
|
71
|
+
*/
|
|
69
72
|
ruleId?: string;
|
|
70
73
|
/** JsonLogic expression evaluated against the mapped variables. */
|
|
71
|
-
jsonLogic:
|
|
74
|
+
jsonLogic: JsonLogic | null;
|
|
72
75
|
/** JsonLogic var name → record field name. */
|
|
73
76
|
mapping: Record<string, string>;
|
|
74
77
|
/** JsonLogic var name → "value is custom, not a record field". */
|
|
75
78
|
propertyIsCustomMapping: Record<string, boolean>;
|
|
79
|
+
/**
|
|
80
|
+
* The rule the tree's Save writes and binds for this condition — the same
|
|
81
|
+
* `StagedRule` a tree condition carries. Never on a tree the server read.
|
|
82
|
+
*/
|
|
83
|
+
stagedRule?: StagedRule;
|
|
76
84
|
/** Unrecognized wire keys preserved verbatim for write-back. */
|
|
77
85
|
unknownKeys?: Record<string, unknown>;
|
|
78
86
|
}
|
|
@@ -87,6 +95,13 @@ export interface ActionProvenance {
|
|
|
87
95
|
/** Available to every tree/node rather than a specific panel. */
|
|
88
96
|
isGlobalAction: boolean;
|
|
89
97
|
}
|
|
98
|
+
/** An action's parameter bag; keys beyond these ride through untouched. */
|
|
99
|
+
export interface ActionParameters extends Record<string, unknown> {
|
|
100
|
+
pageId?: string;
|
|
101
|
+
pageDisplayName?: string;
|
|
102
|
+
entityName?: string;
|
|
103
|
+
requiredFieldMapping?: Record<string, unknown>;
|
|
104
|
+
}
|
|
90
105
|
/**
|
|
91
106
|
* The action itself — what a button does when pressed. Shared across panels:
|
|
92
107
|
* two panels can reference one `actionId`.
|
|
@@ -102,10 +117,11 @@ export interface ActionConfig {
|
|
|
102
117
|
* types, path/url/function-name for text types. `''` when not applicable.
|
|
103
118
|
*/
|
|
104
119
|
value: string | null;
|
|
105
|
-
/**
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
120
|
+
/**
|
|
121
|
+
* Typed parameter bag: `pageId` for the page types, `entityName` for the
|
|
122
|
+
* entity an action targets or a link carries.
|
|
123
|
+
*/
|
|
124
|
+
parameters: ActionParameters | null;
|
|
109
125
|
/** Visibility/enablement rules; empty array = always shown. */
|
|
110
126
|
rules: ActionRule[];
|
|
111
127
|
provenance: ActionProvenance;
|