@medyll/idae-machine 0.129.0 → 0.136.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +462 -300
- package/cli.cjs +22 -0
- package/dist/__fixtures__/demoModel.d.ts +79 -0
- package/dist/__fixtures__/demoModel.js +146 -0
- package/dist/ai/frame/AiChatSession.svelte +152 -0
- package/dist/ai/frame/AiChatSession.svelte.d.ts +7 -0
- package/dist/ai/frame/index.d.ts +1 -0
- package/dist/ai/frame/index.js +2 -0
- package/dist/ai/index.d.ts +9 -0
- package/dist/ai/index.js +12 -0
- package/dist/ai/schema/ai-catalogs.d.ts +2 -0
- package/dist/ai/schema/ai-catalogs.js +86 -0
- package/dist/ai/schema/ai-chat-session.d.ts +2 -0
- package/dist/ai/schema/ai-chat-session.js +35 -0
- package/dist/ai/schema/ai-companion.d.ts +2 -0
- package/dist/ai/schema/ai-companion.js +25 -0
- package/dist/ai/schema/ai-message.d.ts +2 -0
- package/dist/ai/schema/ai-message.js +20 -0
- package/dist/ai/schema/ai-tool-call.d.ts +2 -0
- package/dist/ai/schema/ai-tool-call.js +18 -0
- package/dist/ai/schema/ai-user-prompt.d.ts +2 -0
- package/dist/ai/schema/ai-user-prompt.js +17 -0
- package/dist/ai/schema/tag.d.ts +2 -0
- package/dist/ai/schema/tag.js +14 -0
- package/dist/ai/streamIntoRecord.d.ts +31 -0
- package/dist/ai/streamIntoRecord.js +79 -0
- package/dist/config.d.ts +17 -0
- package/dist/config.js +19 -0
- package/dist/data-ui/controls/AlphabetFilter.svelte +114 -0
- package/dist/data-ui/controls/AlphabetFilter.svelte.d.ts +10 -0
- package/dist/data-ui/controls/ButtonAction.svelte +151 -0
- package/dist/data-ui/controls/ButtonAction.svelte.d.ts +18 -0
- package/dist/data-ui/controls/DataFind.svelte +174 -0
- package/dist/data-ui/controls/DataFind.svelte.d.ts +10 -0
- package/dist/data-ui/controls/DataGroup.svelte +150 -0
- package/dist/data-ui/controls/DataGroup.svelte.d.ts +7 -0
- package/dist/data-ui/controls/DataSort.svelte +78 -0
- package/dist/data-ui/controls/DataSort.svelte.d.ts +9 -0
- package/dist/data-ui/controls/DataToolbar.svelte +67 -0
- package/dist/data-ui/controls/DataToolbar.svelte.d.ts +11 -0
- package/dist/data-ui/controls/Find.svelte +38 -0
- package/dist/data-ui/controls/Find.svelte.d.ts +9 -0
- package/dist/data-ui/controls/FkFilter.svelte +94 -0
- package/dist/data-ui/controls/FkFilter.svelte.d.ts +11 -0
- package/dist/data-ui/controls/Group.svelte +36 -0
- package/dist/data-ui/controls/Group.svelte.d.ts +8 -0
- package/dist/data-ui/controls/ListMode.svelte +79 -0
- package/dist/data-ui/controls/ListMode.svelte.d.ts +10 -0
- package/dist/data-ui/controls/Sort.svelte +100 -0
- package/dist/data-ui/controls/Sort.svelte.d.ts +8 -0
- package/dist/data-ui/data/DataCount.svelte +67 -0
- package/dist/data-ui/data/DataCount.svelte.d.ts +36 -0
- package/dist/data-ui/data/DataFk.svelte +54 -0
- package/dist/data-ui/data/DataFk.svelte.d.ts +11 -0
- package/dist/data-ui/data/DataForm.svelte +191 -0
- package/dist/data-ui/data/DataForm.svelte.d.ts +15 -0
- package/dist/data-ui/data/DataList.svelte +645 -0
- package/dist/data-ui/data/DataList.svelte.d.ts +75 -0
- package/dist/data-ui/data/DataListFk.svelte +111 -0
- package/dist/data-ui/data/DataListFk.svelte.d.ts +13 -0
- package/dist/data-ui/data/DataListRfk.svelte +111 -0
- package/dist/data-ui/data/DataListRfk.svelte.d.ts +13 -0
- package/dist/data-ui/data/DataRecord.svelte +167 -0
- package/dist/data-ui/data/DataRecord.svelte.d.ts +22 -0
- package/dist/data-ui/data/DataRfk.svelte +73 -0
- package/dist/data-ui/data/DataRfk.svelte.d.ts +15 -0
- package/dist/data-ui/data/index.d.ts +7 -0
- package/dist/data-ui/data/index.js +8 -0
- package/dist/data-ui/field/DataField.svelte +343 -0
- package/dist/data-ui/field/DataField.svelte.d.ts +33 -0
- package/dist/data-ui/field/DataFieldEdit.svelte +103 -0
- package/dist/data-ui/field/DataFieldEdit.svelte.d.ts +14 -0
- package/dist/data-ui/field/index.d.ts +2 -0
- package/dist/data-ui/field/index.js +3 -0
- package/dist/data-ui/field/snippets/FieldAiPrompt.svelte +145 -0
- package/dist/data-ui/field/snippets/FieldAiPrompt.svelte.d.ts +14 -0
- package/dist/data-ui/field/snippets/FieldBoolean.svelte +43 -0
- package/dist/data-ui/field/snippets/FieldBoolean.svelte.d.ts +12 -0
- package/dist/data-ui/field/snippets/FieldColor.svelte +48 -0
- package/dist/data-ui/field/snippets/FieldColor.svelte.d.ts +10 -0
- package/dist/data-ui/field/snippets/FieldCurrency.svelte +105 -0
- package/dist/data-ui/field/snippets/FieldCurrency.svelte.d.ts +15 -0
- package/dist/data-ui/field/snippets/FieldEmail.svelte +77 -0
- package/dist/data-ui/field/snippets/FieldEmail.svelte.d.ts +14 -0
- package/dist/data-ui/field/snippets/FieldIcon.svelte +73 -0
- package/dist/data-ui/field/snippets/FieldIcon.svelte.d.ts +11 -0
- package/dist/data-ui/field/snippets/FieldSelect.svelte +71 -0
- package/dist/data-ui/field/snippets/FieldSelect.svelte.d.ts +15 -0
- package/dist/data-ui/field/snippets/FieldText.svelte +52 -0
- package/dist/data-ui/field/snippets/FieldText.svelte.d.ts +13 -0
- package/dist/data-ui/field/snippets/FieldTextarea.svelte +50 -0
- package/dist/data-ui/field/snippets/FieldTextarea.svelte.d.ts +13 -0
- package/dist/data-ui/field/snippets/index.d.ts +9 -0
- package/dist/data-ui/field/snippets/index.js +10 -0
- package/dist/data-ui/fragments/ContextMenu.svelte +109 -0
- package/dist/data-ui/fragments/ContextMenu.svelte.d.ts +4 -0
- package/dist/data-ui/fragments/ContextMenuContent.svelte +275 -0
- package/dist/data-ui/fragments/ContextMenuContent.svelte.d.ts +8 -0
- package/dist/data-ui/fragments/Frame.svelte +43 -0
- package/dist/data-ui/fragments/Frame.svelte.d.ts +10 -0
- package/dist/data-ui/fragments/InfoLine.svelte +123 -0
- package/dist/data-ui/fragments/InfoLine.svelte.d.ts +12 -0
- package/dist/data-ui/fragments/Selector.svelte +56 -0
- package/dist/data-ui/fragments/Selector.svelte.d.ts +10 -0
- package/dist/{fragments → data-ui/fragments}/Skeleton.svelte +3 -3
- package/dist/data-ui/fragments/Tile.svelte +126 -0
- package/dist/data-ui/fragments/Tile.svelte.d.ts +14 -0
- package/dist/data-ui/fragments/contextMenu.svelte.d.ts +22 -0
- package/dist/data-ui/fragments/contextMenu.svelte.js +31 -0
- package/dist/data-ui/fragments/dialog/Dialog.svelte +185 -0
- package/dist/data-ui/fragments/dialog/Dialog.svelte.d.ts +29 -0
- package/dist/data-ui/fragments/dialog/dialog.svelte.d.ts +27 -0
- package/dist/data-ui/fragments/dialog/dialog.svelte.js +41 -0
- package/dist/data-ui/fragments/index.d.ts +11 -0
- package/dist/data-ui/fragments/index.js +11 -0
- package/dist/data-ui/utils/__tests__/HostProbe.svelte +18 -0
- package/dist/data-ui/utils/__tests__/HostProbe.svelte.d.ts +8 -0
- package/dist/data-ui/utils/data-utils.d.ts +29 -0
- package/dist/data-ui/utils/data-utils.js +83 -0
- package/dist/data-ui/utils/dataRelationUtils.d.ts +37 -0
- package/dist/data-ui/utils/dataRelationUtils.js +125 -0
- package/dist/data-ui/utils/diagramUtils.d.ts +6 -0
- package/dist/data-ui/utils/diagramUtils.js +131 -0
- package/dist/data-ui/utils/draggable.d.ts +15 -0
- package/dist/data-ui/utils/draggable.js +61 -0
- package/dist/data-ui/utils/menuPrefs.d.ts +80 -0
- package/dist/data-ui/utils/menuPrefs.js +119 -0
- package/dist/data-ui/utils/useMachinePrefs.svelte.d.ts +38 -0
- package/dist/data-ui/utils/useMachinePrefs.svelte.js +117 -0
- package/dist/data-ui/utils/useMenuTree.svelte.d.ts +26 -0
- package/dist/data-ui/utils/useMenuTree.svelte.js +68 -0
- package/dist/data-ui/utils/useRecordData.svelte.d.ts +22 -0
- package/dist/data-ui/utils/useRecordData.svelte.js +50 -0
- package/dist/data-ui/utils/useViewFields.svelte.d.ts +22 -0
- package/dist/data-ui/utils/useViewFields.svelte.js +59 -0
- package/dist/demo/.gitkeep +0 -0
- package/dist/demo/demo-status.json +9 -0
- package/dist/idae/boot.d.ts +28 -0
- package/dist/idae/boot.js +43 -0
- package/dist/idae/bridge/register.d.ts +4 -0
- package/dist/idae/bridge/register.js +15 -0
- package/dist/idae/capabilities/Capabilities.d.ts +10 -0
- package/dist/idae/capabilities/Capabilities.js +34 -0
- package/dist/idae/codefield/CodeFieldConvention.d.ts +3 -0
- package/dist/idae/codefield/CodeFieldConvention.js +25 -0
- package/dist/idae/fieldcatalog/defaultFieldTypesDef.d.ts +2 -0
- package/dist/idae/fieldcatalog/defaultFieldTypesDef.js +104 -0
- package/dist/idae/frames/FrameCatalog.d.ts +31 -0
- package/dist/idae/frames/FrameCatalog.js +31 -0
- package/dist/idae/index.d.ts +14 -0
- package/dist/idae/index.js +13 -0
- package/dist/idae/menu/IdaeMenuManager.d.ts +79 -0
- package/dist/idae/menu/IdaeMenuManager.js +108 -0
- package/dist/idae/menu/IdaeMenuStore.d.ts +77 -0
- package/dist/idae/menu/IdaeMenuStore.js +68 -0
- package/dist/idae/menu/menuSnapshot.d.ts +30 -0
- package/dist/idae/menu/menuSnapshot.js +30 -0
- package/dist/idae/meta/MetaModelProvider.d.ts +11 -0
- package/dist/idae/meta/MetaModelProvider.js +43 -0
- package/dist/idae/relations/RelationPolicy.d.ts +19 -0
- package/dist/idae/relations/RelationPolicy.js +125 -0
- package/dist/idae/rights/RightsPolicy.d.ts +16 -0
- package/dist/idae/rights/RightsPolicy.js +80 -0
- package/dist/idae/userscope/UserScopePolicy.d.ts +9 -0
- package/dist/idae/userscope/UserScopePolicy.js +42 -0
- package/dist/idae/userscope/navTracking.d.ts +11 -0
- package/dist/idae/userscope/navTracking.js +15 -0
- package/dist/index.d.ts +68 -43
- package/dist/index.js +82 -44
- package/dist/main/__tests__/_relationTestUtils.d.ts +12 -0
- package/dist/main/__tests__/_relationTestUtils.js +53 -0
- package/dist/main/__tests__/helpers/mockCollection.d.ts +21 -0
- package/dist/main/__tests__/helpers/mockCollection.js +27 -0
- package/dist/main/api/types.d.ts +29 -0
- package/dist/main/ext/hooks.d.ts +32 -0
- package/dist/main/ext/hooks.js +31 -0
- package/dist/main/ext/interfaces.d.ts +69 -0
- package/dist/main/ext/interfaces.js +3 -0
- package/dist/main/ext/registry.d.ts +29 -0
- package/dist/main/ext/registry.js +30 -0
- package/dist/main/frame/MachineFrameManager.d.ts +187 -0
- package/dist/main/frame/MachineFrameManager.js +403 -0
- package/dist/main/frame/contextMenuSetup.d.ts +9 -0
- package/dist/main/frame/contextMenuSetup.js +42 -0
- package/dist/main/frame/frameUrl.d.ts +1 -0
- package/dist/main/frame/frameUrl.js +8 -0
- package/dist/main/frame/frameUtils.d.ts +16 -0
- package/dist/main/frame/frameUtils.js +26 -0
- package/dist/main/frame/linkParser.d.ts +9 -0
- package/dist/main/frame/linkParser.js +15 -0
- package/dist/main/index.d.ts +15 -0
- package/dist/main/index.js +19 -0
- package/dist/main/machine/MachineAction.d.ts +62 -0
- package/dist/main/machine/MachineAction.js +96 -0
- package/dist/main/machine/MachineError.d.ts +33 -0
- package/dist/main/machine/MachineError.js +49 -0
- package/dist/main/machine/MachineErrorValidation.d.ts +19 -0
- package/dist/main/machine/MachineErrorValidation.js +24 -0
- package/dist/main/machine/MachineFieldType.d.ts +140 -0
- package/dist/main/machine/MachineFieldType.js +341 -0
- package/dist/main/machine/MachineFkFold.d.ts +34 -0
- package/dist/main/machine/MachineFkFold.js +57 -0
- package/dist/main/machine/MachineRecordIdentity.d.ts +26 -0
- package/dist/main/machine/MachineRecordIdentity.js +44 -0
- package/dist/main/machine/MachineRights.d.ts +50 -0
- package/dist/main/machine/MachineRights.js +133 -0
- package/dist/main/machine/MachineRouter.d.ts +56 -0
- package/dist/main/machine/MachineRouter.js +250 -0
- package/dist/main/machine/MachineScheme.d.ts +54 -0
- package/dist/main/machine/MachineScheme.js +159 -0
- package/dist/main/machine/MachineSchemeField.js +67 -0
- package/dist/main/machine/MachineSchemeFieldForge.d.ts +84 -0
- package/dist/main/machine/MachineSchemeFieldForge.js +140 -0
- package/dist/main/machine/MachineSchemeFieldValues.d.ts +68 -0
- package/dist/main/machine/MachineSchemeFieldValues.js +97 -0
- package/dist/main/machine/MachineSchemeValidate.d.ts +107 -0
- package/dist/main/machine/MachineSchemeValidate.js +247 -0
- package/dist/main/machine/MachineSchemeValues.d.ts +120 -0
- package/dist/main/machine/MachineSchemeValues.js +306 -0
- package/dist/main/machine/SchemeFieldDefaultValues.d.ts +76 -0
- package/dist/main/machine/SchemeFieldDefaultValues.js +104 -0
- package/dist/main/machine/authState.svelte.d.ts +11 -0
- package/dist/main/machine/authState.svelte.js +17 -0
- package/dist/main/machine/fieldBuilder.d.ts +23 -0
- package/dist/main/machine/fieldBuilder.d.ts.map +1 -0
- package/dist/main/machine/fieldBuilder.js +10 -0
- package/dist/main/machine/fieldBuilder.js.map +1 -0
- package/dist/main/machine/machineLabel.d.ts +11 -0
- package/dist/main/machine/machineLabel.js +23 -0
- package/dist/main/machine/validateRules.d.ts +38 -0
- package/dist/main/machine/validateRules.js +109 -0
- package/dist/main/machine.d.ts +227 -61
- package/dist/main/machine.js +503 -86
- package/dist/main/machineDb.d.ts +25 -54
- package/dist/main/machineDb.js +40 -94
- package/dist/main/machineIdbAdapter.d.ts +83 -0
- package/dist/main/machineIdbAdapter.js +347 -0
- package/dist/main/machineModelBuilder.d.ts +31 -0
- package/dist/main/machineModelBuilder.js +58 -0
- package/dist/main/machineParserForge.d.ts +38 -0
- package/dist/main/machineParserForge.js +168 -0
- package/dist/main/machineSchemaCache.d.ts +8 -0
- package/dist/main/machineSchemaCache.js +58 -0
- package/dist/main/machineSchemaDoctor.d.ts +17 -0
- package/dist/main/machineSchemaDoctor.js +73 -0
- package/dist/main/machineSchemaLoader.d.ts +18 -0
- package/dist/main/machineSchemaLoader.js +43 -0
- package/dist/main/machineSeed.d.ts +21 -0
- package/dist/main/machineSeed.js +44 -0
- package/dist/main/router/componentRegistry.d.ts +35 -0
- package/dist/main/router/componentRegistry.js +35 -0
- package/dist/main/router/urlParser.d.ts +17 -0
- package/dist/main/router/urlParser.js +41 -0
- package/dist/main/warmupUtils.d.ts +40 -0
- package/dist/main/warmupUtils.js +73 -0
- package/dist/mcp/MachineMcpClient.d.ts +43 -0
- package/dist/mcp/MachineMcpClient.js +175 -0
- package/dist/shell/Frame.svelte +67 -0
- package/dist/shell/Frame.svelte.d.ts +11 -0
- package/dist/shell/auth/Login.svelte +244 -0
- package/dist/shell/auth/Login.svelte.d.ts +3 -0
- package/dist/shell/frame/dashboard/Dashboard.svelte +0 -0
- package/dist/shell/frame/dashboard/Dashboard.svelte.d.ts +26 -0
- package/dist/shell/frame/diagram/Diagram.svelte +244 -0
- package/dist/shell/frame/diagram/Diagram.svelte.d.ts +9 -0
- package/dist/shell/frame/explorer/Explorer.svelte +86 -0
- package/dist/shell/frame/explorer/Explorer.svelte.d.ts +29 -0
- package/dist/shell/frame/explorer/ExplorerContent.svelte +126 -0
- package/dist/shell/frame/explorer/ExplorerContent.svelte.d.ts +32 -0
- package/dist/shell/frame/index.d.ts +8 -0
- package/dist/shell/frame/index.js +9 -0
- package/dist/shell/frame/main-menu-content/MainMenuContent.svelte +100 -0
- package/dist/shell/frame/main-menu-content/MainMenuContent.svelte.d.ts +6 -0
- package/dist/shell/frame/planning/Planning.svelte +426 -0
- package/dist/shell/frame/planning/Planning.svelte.d.ts +12 -0
- package/dist/shell/frame/rbac/RbacMatrix.svelte +197 -0
- package/dist/shell/frame/rbac/RbacMatrix.svelte.d.ts +7 -0
- package/dist/shell/frame/space/Space.svelte +554 -0
- package/dist/shell/frame/space/Space.svelte.d.ts +8 -0
- package/dist/shell/frame/synthesis/Synthesis.svelte +383 -0
- package/dist/shell/frame/synthesis/Synthesis.svelte.d.ts +8 -0
- package/dist/shell/frame/today/Today.svelte +174 -0
- package/dist/shell/frame/today/Today.svelte.d.ts +3 -0
- package/dist/shell/layout/App.svelte +30 -0
- package/dist/shell/layout/App.svelte.d.ts +3 -0
- package/dist/shell/layout/Breadcrumb.svelte +67 -0
- package/dist/shell/layout/Breadcrumb.svelte.d.ts +12 -0
- package/dist/shell/layout/Columner.svelte +214 -0
- package/dist/shell/layout/Columner.svelte.d.ts +16 -0
- package/dist/shell/layout/DevResetPanel.svelte +194 -0
- package/dist/shell/layout/DevResetPanel.svelte.d.ts +7 -0
- package/dist/shell/layout/Fiche.svelte +111 -0
- package/dist/shell/layout/Fiche.svelte.d.ts +7 -0
- package/dist/shell/layout/FicheUpdate.svelte +53 -0
- package/dist/shell/layout/FicheUpdate.svelte.d.ts +7 -0
- package/dist/shell/layout/MainMenu.svelte +256 -0
- package/dist/shell/layout/MainMenu.svelte.d.ts +6 -0
- package/dist/shell/layout/MenuSettings.svelte +182 -0
- package/dist/shell/layout/MenuSettings.svelte.d.ts +6 -0
- package/dist/shell/layout/RecordTimeline.svelte +199 -0
- package/dist/shell/layout/RecordTimeline.svelte.d.ts +8 -0
- package/dist/shell/layout/RecordToolbar.svelte +39 -0
- package/dist/shell/layout/RecordToolbar.svelte.d.ts +7 -0
- package/dist/shell/layout/TaskBar.svelte +118 -0
- package/dist/shell/layout/TaskBar.svelte.d.ts +7 -0
- package/dist/shell/layout/TemplateShell.svelte +48 -0
- package/dist/shell/layout/TemplateShell.svelte.d.ts +15 -0
- package/dist/shell/layout/ThemeToggle.svelte +46 -0
- package/dist/shell/layout/ThemeToggle.svelte.d.ts +3 -0
- package/dist/shell/layout/index.d.ts +8 -0
- package/dist/shell/layout/index.js +9 -0
- package/dist/storage/ApiStorageAdapter.d.ts +41 -0
- package/dist/storage/ApiStorageAdapter.js +111 -0
- package/dist/storage/IdbStorageAdapter.d.ts +31 -0
- package/dist/storage/IdbStorageAdapter.js +72 -0
- package/dist/storage/MemoryStorageAdapter.d.ts +33 -0
- package/dist/storage/MemoryStorageAdapter.js +132 -0
- package/dist/storage/README.md +222 -0
- package/dist/storage/StorageAdapter.d.ts +75 -0
- package/dist/storage/StorageAdapter.js +7 -0
- package/dist/storage/demo/storage-demo.d.ts +22 -0
- package/dist/storage/demo/storage-demo.js +107 -0
- package/dist/storage/index.d.ts +9 -0
- package/dist/storage/index.js +9 -0
- package/dist/types/entity-types.d.ts +444 -0
- package/dist/types/entity-types.js +16 -0
- package/dist/types/index.d.ts +7 -0
- package/dist/types/index.js +6 -0
- package/dist/types/machine-model.d.ts +198 -0
- package/dist/types/machine-model.js +5 -0
- package/dist/types/qoolie-svelte.d.ts +11 -0
- package/dist/types/schema-utils.d.ts +32 -0
- package/dist/types/schema-utils.js +103 -0
- package/dist/utils/generateCode.d.ts +5 -0
- package/dist/utils/generateCode.js +9 -0
- package/dist/utils/logger.d.ts +10 -0
- package/dist/utils/logger.js +20 -0
- package/package.json +70 -31
- package/dist/db/CrudService.d.ts +0 -9
- package/dist/db/CrudService.js +0 -45
- package/dist/db/dbSchema.d.ts +0 -201
- package/dist/db/dbSchema.js +0 -205
- package/dist/db/fieldTypes.d.ts +0 -13
- package/dist/db/fieldTypes.js +0 -67
- package/dist/db/types.d.ts +0 -124
- package/dist/demo/form/CreateUpdate.svelte +0 -198
- package/dist/demo/form/CreateUpdate.svelte.d.ts +0 -29
- package/dist/demo/form/CrudZone.svelte +0 -22
- package/dist/demo/form/CrudZone.svelte.d.ts +0 -29
- package/dist/demo/form/DataProvider.svelte +0 -20
- package/dist/demo/form/DataProvider.svelte.d.ts +0 -9
- package/dist/demo/form/FieldInPlace.svelte +0 -49
- package/dist/demo/form/FieldInPlace.svelte.d.ts +0 -11
- package/dist/demo/form/FieldValue.svelte +0 -212
- package/dist/demo/form/FieldValue.svelte.d.ts +0 -35
- package/dist/demo/form/types.d.ts +0 -17
- package/dist/demo/form/types.js +0 -1
- package/dist/demo/testDbSchema.d.ts +0 -6
- package/dist/demo/testDbSchema.js +0 -58
- package/dist/demo/types.d.ts +0 -140
- package/dist/demo/types.js +0 -1
- package/dist/fragments/Confirm.svelte +0 -58
- package/dist/fragments/Confirm.svelte.d.ts +0 -11
- package/dist/fragments/Frame.svelte +0 -19
- package/dist/fragments/Frame.svelte.d.ts +0 -32
- package/dist/fragments/InfoLine.svelte +0 -21
- package/dist/fragments/InfoLine.svelte.d.ts +0 -35
- package/dist/fragments/List.svelte +0 -21
- package/dist/fragments/List.svelte.d.ts +0 -38
- package/dist/fragments/Selector.svelte +0 -26
- package/dist/fragments/Selector.svelte.d.ts +0 -38
- package/dist/main/machine/IDbCollection.d.ts +0 -69
- package/dist/main/machine/IDbCollection.js +0 -98
- package/dist/main/machine/IDbCollectionFieldForge.d.ts +0 -42
- package/dist/main/machine/IDbCollectionFieldForge.js +0 -74
- package/dist/main/machine/IDbCollectionFieldValues.d.ts +0 -46
- package/dist/main/machine/IDbCollectionFieldValues.js +0 -62
- package/dist/main/machine/IDbCollectionValues.d.ts +0 -78
- package/dist/main/machine/IDbCollectionValues.js +0 -203
- package/dist/main/machine/IDbError.d.ts +0 -6
- package/dist/main/machine/IDbError.js +0 -61
- package/dist/main/machine/IDbFormValidate.d.ts +0 -55
- package/dist/main/machine/IDbFormValidate.js +0 -183
- package/dist/main/machine/IDbValidationError.d.ts +0 -19
- package/dist/main/machine/IDbValidationError.js +0 -24
- package/dist/main/machine/types.d.ts +0 -1
- package/dist/main/machine/types.js +0 -1
- package/dist/main/machineForge.d.ts +0 -57
- package/dist/main/machineForge.js +0 -105
- package/dist/types/appschemeTypes.d.ts +0 -71
- package/dist/types/appschemeTypes.js +0 -83
- package/dist/ui/CollectionButton.svelte +0 -26
- package/dist/ui/CollectionButton.svelte.d.ts +0 -29
- package/dist/ui/CollectionFieldGuess.svelte +0 -29
- package/dist/ui/CollectionFieldGuess.svelte.d.ts +0 -11
- package/dist/ui/CollectionFks.svelte +0 -24
- package/dist/ui/CollectionFks.svelte.d.ts +0 -9
- package/dist/ui/CollectionList.svelte +0 -95
- package/dist/ui/CollectionList.svelte.d.ts +0 -37
- package/dist/ui/CollectionListMenu.svelte +0 -47
- package/dist/ui/CollectionListMenu.svelte.d.ts +0 -34
- package/dist/ui/CollectionReverseFks.svelte +0 -56
- package/dist/ui/CollectionReverseFks.svelte.d.ts +0 -18
- /package/dist/{fragments → data-ui/fragments}/Skeleton.svelte.d.ts +0 -0
- /package/dist/{db → main/api}/types.js +0 -0
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Test helpers for the appscheme-backed relation model (FKRELATIONS.md).
|
|
3
|
+
*
|
|
4
|
+
* Relations are read from the `appscheme[collection].fkRelations` record — never
|
|
5
|
+
* from the in-memory model. The relation accessor (`getCollectionRelations`)
|
|
6
|
+
* reads the GLOBAL `machine` singleton's appscheme qoolie collection, so tests
|
|
7
|
+
* must drive that same global instance (not a `new Machine()`), boot it with an
|
|
8
|
+
* `appscheme` collection, and seed one appscheme record per business collection.
|
|
9
|
+
* This mirrors what `publishModel` does server-side: move the authoring
|
|
10
|
+
* `fkRelations` declaration onto the appscheme record.
|
|
11
|
+
*/
|
|
12
|
+
import { IDBFactory } from 'fake-indexeddb';
|
|
13
|
+
import { machine } from '../machine.js';
|
|
14
|
+
let _dbCounter = 0;
|
|
15
|
+
/** Fresh IDB + unique db name so each boot of the shared global machine is isolated. */
|
|
16
|
+
export function resetIndexedDB() {
|
|
17
|
+
globalThis.indexedDB = new IDBFactory();
|
|
18
|
+
}
|
|
19
|
+
export function uniqueDbName(base) {
|
|
20
|
+
return `${base}-${++_dbCounter}`;
|
|
21
|
+
}
|
|
22
|
+
/** Inject an `appscheme` collection (base machine_app) so the relation accessor has a store. */
|
|
23
|
+
export function withAppscheme(model) {
|
|
24
|
+
return {
|
|
25
|
+
appscheme: {
|
|
26
|
+
keyPath: '++id',
|
|
27
|
+
base: 'machine_app',
|
|
28
|
+
model: {},
|
|
29
|
+
fields: {
|
|
30
|
+
id: { type: 'id', readonly: true },
|
|
31
|
+
code: { type: 'text', required: true },
|
|
32
|
+
},
|
|
33
|
+
fkRelations: {},
|
|
34
|
+
template: { presentation: 'code' },
|
|
35
|
+
},
|
|
36
|
+
...model,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Boot the global `machine` with `model` (+ an appscheme collection) and seed one
|
|
41
|
+
* appscheme record per collection carrying its authoring `fkRelations`. Returns the
|
|
42
|
+
* booted global machine. Reads of relations then resolve from the appscheme store.
|
|
43
|
+
*/
|
|
44
|
+
export async function bootWithRelations(dbName, model) {
|
|
45
|
+
resetIndexedDB();
|
|
46
|
+
machine.init({ dbName: uniqueDbName(dbName), version: 1, business: withAppscheme(model) });
|
|
47
|
+
await machine.boot();
|
|
48
|
+
for (const [code, def] of Object.entries(model)) {
|
|
49
|
+
const fkRelations = def.fkRelations ?? {};
|
|
50
|
+
await machine.collection('appscheme').create({ code, fkRelations });
|
|
51
|
+
}
|
|
52
|
+
return machine;
|
|
53
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared test helper — generic in-memory collection mock.
|
|
3
|
+
* Each test file can extend the base with collection-specific methods.
|
|
4
|
+
*/
|
|
5
|
+
export interface BaseMockCollection<T extends {
|
|
6
|
+
id: string;
|
|
7
|
+
}> {
|
|
8
|
+
docs: T[];
|
|
9
|
+
getAll: () => T[];
|
|
10
|
+
create: (doc: T) => Promise<T>;
|
|
11
|
+
update: (id: string, data: Partial<T>) => Promise<void>;
|
|
12
|
+
delete: (id: string) => Promise<void>;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Create a minimal in-memory mock of a QoolieCollection.
|
|
16
|
+
* Returns `{ docs, getAll, create, update, delete }`.
|
|
17
|
+
* Extend with collection-specific methods (e.g. `where`) as needed.
|
|
18
|
+
*/
|
|
19
|
+
export declare function createMockCollection<T extends {
|
|
20
|
+
id: string;
|
|
21
|
+
}>(): BaseMockCollection<T>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared test helper — generic in-memory collection mock.
|
|
3
|
+
* Each test file can extend the base with collection-specific methods.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Create a minimal in-memory mock of a QoolieCollection.
|
|
7
|
+
* Returns `{ docs, getAll, create, update, delete }`.
|
|
8
|
+
* Extend with collection-specific methods (e.g. `where`) as needed.
|
|
9
|
+
*/
|
|
10
|
+
export function createMockCollection() {
|
|
11
|
+
const docs = [];
|
|
12
|
+
return {
|
|
13
|
+
docs,
|
|
14
|
+
getAll: () => [...docs],
|
|
15
|
+
create: async (doc) => { docs.push(doc); return doc; },
|
|
16
|
+
update: async (id, data) => {
|
|
17
|
+
const i = docs.findIndex((d) => d.id === id);
|
|
18
|
+
if (i !== -1)
|
|
19
|
+
Object.assign(docs[i], data);
|
|
20
|
+
},
|
|
21
|
+
delete: async (id) => {
|
|
22
|
+
const i = docs.findIndex((d) => d.id === id);
|
|
23
|
+
if (i !== -1)
|
|
24
|
+
docs.splice(i, 1);
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export type { ViewFieldDef, ViewFields } from '../../types/machine-model.js';
|
|
2
|
+
import type { ViewFields } from '../../types/machine-model.js';
|
|
3
|
+
/**
|
|
4
|
+
* AppScheme type
|
|
5
|
+
*/
|
|
6
|
+
export interface AppScheme {
|
|
7
|
+
id: string;
|
|
8
|
+
code: string;
|
|
9
|
+
name: string;
|
|
10
|
+
_views?: ViewFields;
|
|
11
|
+
fields?: unknown[];
|
|
12
|
+
createdAt?: string;
|
|
13
|
+
updatedAt?: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Health response
|
|
17
|
+
*/
|
|
18
|
+
export interface HealthResponse {
|
|
19
|
+
status: string;
|
|
20
|
+
version: string;
|
|
21
|
+
timestamp: string;
|
|
22
|
+
environment: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Schemes list response
|
|
26
|
+
*/
|
|
27
|
+
export interface SchemesResponse {
|
|
28
|
+
schemes: AppScheme[];
|
|
29
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { FkRelations } from '../../types/index.js';
|
|
2
|
+
export interface RelationResolver {
|
|
3
|
+
getRelations(collection: string): FkRelations | undefined;
|
|
4
|
+
getAllCollections(): string[];
|
|
5
|
+
foldRelations?(collection: string, record: Record<string, unknown>): Promise<Record<string, unknown>>;
|
|
6
|
+
findRelationField?(collection: string, target: string): {
|
|
7
|
+
fieldName: string;
|
|
8
|
+
targetIndex: string;
|
|
9
|
+
} | null;
|
|
10
|
+
hasRelationValue?(collection: string, record: Record<string, unknown>, relationKey: string): boolean;
|
|
11
|
+
/** Resolve a FK presentation-path token (e.g. 'fks.firm.name') against a data record. */
|
|
12
|
+
resolvePresentationToken?(data: Record<string, unknown>, segments: string[]): unknown;
|
|
13
|
+
}
|
|
14
|
+
export interface MetaCollectionResolver {
|
|
15
|
+
isMetaCollection(name: string): boolean;
|
|
16
|
+
getSchemaCriticalCollections(bases?: string[]): string[];
|
|
17
|
+
}
|
|
18
|
+
export interface CodeFieldConvention {
|
|
19
|
+
readonly codeFieldName: string;
|
|
20
|
+
ensureCodeField(model: Record<string, unknown>): Record<string, unknown>;
|
|
21
|
+
}
|
|
22
|
+
export interface GrantDecoder {
|
|
23
|
+
decodeSchemeCode(grant: Record<string, unknown>): string | undefined;
|
|
24
|
+
}
|
|
25
|
+
export declare function registerRelationResolver(resolver: RelationResolver): void;
|
|
26
|
+
export declare function registerMetaCollectionResolver(resolver: MetaCollectionResolver): void;
|
|
27
|
+
export declare function registerCodeFieldConvention(convention: CodeFieldConvention): void;
|
|
28
|
+
export declare function registerGrantDecoder(decoder: GrantDecoder): void;
|
|
29
|
+
export declare function getRelationResolver(): RelationResolver | null;
|
|
30
|
+
export declare function getMetaCollectionResolver(): MetaCollectionResolver | null;
|
|
31
|
+
export declare function getCodeFieldConvention(): CodeFieldConvention | null;
|
|
32
|
+
export declare function getGrantDecoder(): GrantDecoder | null;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// ENGINE — no domain literals
|
|
2
|
+
// Domain bridge: abstract hooks that the domain layer implements and registers.
|
|
3
|
+
// Engine files call these hooks instead of containing domain-specific logic.
|
|
4
|
+
let relationResolver = null;
|
|
5
|
+
let metaCollectionResolver = null;
|
|
6
|
+
let codeFieldConvention = null;
|
|
7
|
+
let grantDecoder = null;
|
|
8
|
+
export function registerRelationResolver(resolver) {
|
|
9
|
+
relationResolver = resolver;
|
|
10
|
+
}
|
|
11
|
+
export function registerMetaCollectionResolver(resolver) {
|
|
12
|
+
metaCollectionResolver = resolver;
|
|
13
|
+
}
|
|
14
|
+
export function registerCodeFieldConvention(convention) {
|
|
15
|
+
codeFieldConvention = convention;
|
|
16
|
+
}
|
|
17
|
+
export function registerGrantDecoder(decoder) {
|
|
18
|
+
grantDecoder = decoder;
|
|
19
|
+
}
|
|
20
|
+
export function getRelationResolver() {
|
|
21
|
+
return relationResolver;
|
|
22
|
+
}
|
|
23
|
+
export function getMetaCollectionResolver() {
|
|
24
|
+
return metaCollectionResolver;
|
|
25
|
+
}
|
|
26
|
+
export function getCodeFieldConvention() {
|
|
27
|
+
return codeFieldConvention;
|
|
28
|
+
}
|
|
29
|
+
export function getGrantDecoder() {
|
|
30
|
+
return grantDecoder;
|
|
31
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { MachineFkDef, MachineCollectionModel } from '../../types/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* RelationPolicy — sorts ALL FK relation logic out of the engine
|
|
4
|
+
* Engine only knows abstract RelationDef + a field kind 'reference'.
|
|
5
|
+
* Words like 'fks', key 'code', format 'fks.{rel}_{id}' live ONLY in idae implementation.
|
|
6
|
+
*/
|
|
7
|
+
export interface RelationPolicy {
|
|
8
|
+
initialize(machine: any): void;
|
|
9
|
+
relations(collection: string): Record<string, RelationDef>;
|
|
10
|
+
reverseRelations(collection: string): Record<string, Record<string, RelationDef>>;
|
|
11
|
+
findRelationField(collection: string, target: string): {
|
|
12
|
+
fieldName: string;
|
|
13
|
+
targetIndex: string;
|
|
14
|
+
} | null;
|
|
15
|
+
hasRelationValue(collection: string, record: AnyDoc, relationKey: string): boolean;
|
|
16
|
+
foldRelations(collection: string, record: AnyDoc): AnyDoc | Promise<AnyDoc>;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* MetaModelProvider — appscheme = data, not in-memory model
|
|
20
|
+
*/
|
|
21
|
+
export interface MetaModelProvider {
|
|
22
|
+
collectionSchema(collection: string): CollectionSchema | undefined;
|
|
23
|
+
listCollections(): string[];
|
|
24
|
+
isMetaCollection(name: string): boolean;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* UserScopePolicy — generalizes MachineAction
|
|
28
|
+
*/
|
|
29
|
+
export interface UserScopePolicy {
|
|
30
|
+
currentUserId(): string | null;
|
|
31
|
+
scopedCollections(): string[];
|
|
32
|
+
naturalKey(collection: string): string[] | null;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* RightsPolicy — RBAC mechanism vs convention
|
|
36
|
+
*/
|
|
37
|
+
export interface RightsPolicy {
|
|
38
|
+
grantsFor(user: AppUser): NormalizedGrant[];
|
|
39
|
+
publicOps(collection: string): PermissionCode[];
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Capabilities — workflow semantics
|
|
43
|
+
*/
|
|
44
|
+
export interface Capabilities {
|
|
45
|
+
statusField(collection: string): string | null;
|
|
46
|
+
typeField(collection: string): string | null;
|
|
47
|
+
groupField(collection: string): string | null;
|
|
48
|
+
workflowOrder(collection: string): string[];
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* FrameCatalog — domain registry entries
|
|
52
|
+
*/
|
|
53
|
+
export interface FrameCatalog {
|
|
54
|
+
registerFrames(registry: Pick<ComponentRegistry, 'registerMany'>): void;
|
|
55
|
+
}
|
|
56
|
+
export type AnyDoc = Record<string, unknown>;
|
|
57
|
+
export type RelationDef = MachineFkDef;
|
|
58
|
+
export type CollectionSchema = MachineCollectionModel;
|
|
59
|
+
export type AppUser = import('../../types/entity-types.js').AppUser;
|
|
60
|
+
export type PermissionCode = import('../../types/entity-types.js').PermissionCode;
|
|
61
|
+
export type ComponentRegistry = import('../router/componentRegistry.js').ComponentRegistry;
|
|
62
|
+
export type { MachineFkDef, MachineCollectionModel } from '../../types/index.js';
|
|
63
|
+
export interface NormalizedGrant {
|
|
64
|
+
collection: string;
|
|
65
|
+
permissions: PermissionCode[];
|
|
66
|
+
userId?: string;
|
|
67
|
+
userType?: string;
|
|
68
|
+
userGroup?: string;
|
|
69
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { RelationPolicy, MetaModelProvider, UserScopePolicy, RightsPolicy, Capabilities, FrameCatalog } from './interfaces.js';
|
|
2
|
+
/**
|
|
3
|
+
* Policy registry type - mirrors the domain's PolicyRegistry
|
|
4
|
+
*/
|
|
5
|
+
export interface EnginePolicyRegistry {
|
|
6
|
+
relation?: RelationPolicy;
|
|
7
|
+
meta?: MetaModelProvider;
|
|
8
|
+
userScope?: UserScopePolicy;
|
|
9
|
+
rights?: RightsPolicy;
|
|
10
|
+
capabilities?: Capabilities;
|
|
11
|
+
frameCatalog?: FrameCatalog;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Inject domain policies into the engine registry
|
|
15
|
+
* Called by domain boot process
|
|
16
|
+
*/
|
|
17
|
+
export declare function injectPolicies(registry: EnginePolicyRegistry): void;
|
|
18
|
+
/**
|
|
19
|
+
* Get the current policy registry
|
|
20
|
+
*/
|
|
21
|
+
export declare function getPolicyRegistry(): EnginePolicyRegistry;
|
|
22
|
+
/**
|
|
23
|
+
* Get a specific policy implementation
|
|
24
|
+
*/
|
|
25
|
+
export declare function getPolicy<T extends keyof EnginePolicyRegistry>(policyName: T): EnginePolicyRegistry[T] | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* Check if a policy is available
|
|
28
|
+
*/
|
|
29
|
+
export declare function hasPolicy<T extends keyof EnginePolicyRegistry>(policyName: T): boolean;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// ENGINE — no domain literals
|
|
2
|
+
// Policy registry that will be injected with domain implementations
|
|
3
|
+
// Global registry that will be populated by domain boot
|
|
4
|
+
let policyRegistry = {};
|
|
5
|
+
/**
|
|
6
|
+
* Inject domain policies into the engine registry
|
|
7
|
+
* Called by domain boot process
|
|
8
|
+
*/
|
|
9
|
+
export function injectPolicies(registry) {
|
|
10
|
+
policyRegistry = registry;
|
|
11
|
+
console.log('Engine policies injected:', Object.keys(registry));
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Get the current policy registry
|
|
15
|
+
*/
|
|
16
|
+
export function getPolicyRegistry() {
|
|
17
|
+
return policyRegistry;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Get a specific policy implementation
|
|
21
|
+
*/
|
|
22
|
+
export function getPolicy(policyName) {
|
|
23
|
+
return policyRegistry[policyName];
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Check if a policy is available
|
|
27
|
+
*/
|
|
28
|
+
export function hasPolicy(policyName) {
|
|
29
|
+
return policyRegistry[policyName] !== undefined;
|
|
30
|
+
}
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import { type RegistryKey } from '../router/componentRegistry.js';
|
|
2
|
+
export interface FrameControls {
|
|
3
|
+
load: (modulePath: string, collection: string, collectionId?: string | number, vars?: Record<string, string>) => void;
|
|
4
|
+
show: () => void;
|
|
5
|
+
hide: () => void;
|
|
6
|
+
toggle: () => void;
|
|
7
|
+
close: () => void;
|
|
8
|
+
/** Bring the frame to front + focus it. Optional — only floating frames (dialogs) implement it. */
|
|
9
|
+
focus?: () => void;
|
|
10
|
+
/** Whether this frame appears as a window in the taskbar. Inner content zones (loadIn) set false. */
|
|
11
|
+
taskbar?: boolean;
|
|
12
|
+
/** Whether user-facing close controls are available. Defaults to true. */
|
|
13
|
+
closable?: boolean;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Mount engine shared by Frame.svelte and Dialog.svelte.
|
|
17
|
+
* Resolves a modulePath via componentRegistry and mounts it into the target element,
|
|
18
|
+
* guarding against out-of-order async resolution and unmounting the previous instance.
|
|
19
|
+
*/
|
|
20
|
+
export interface FrameHost {
|
|
21
|
+
load: (modulePath: string, collection: string, collectionId?: string | number, vars?: Record<string, string>) => void;
|
|
22
|
+
destroy: () => void;
|
|
23
|
+
}
|
|
24
|
+
/** Resolves a human label for (collection, id) — injected by machine. */
|
|
25
|
+
export type LabelResolver = (collection: string, collectionId?: string | number) => Promise<string | undefined>;
|
|
26
|
+
export interface FrameRegisterOptions {
|
|
27
|
+
replace?: boolean;
|
|
28
|
+
}
|
|
29
|
+
export interface FrameRouterOptions {
|
|
30
|
+
push: (url: string) => void;
|
|
31
|
+
openFrame: (event: NavigationEvent) => void;
|
|
32
|
+
openDialog: (event: DialogNavigationEvent) => void;
|
|
33
|
+
closeFrame: (frameId: string) => void;
|
|
34
|
+
}
|
|
35
|
+
export interface DialogNavigationEvent extends Omit<NavigationEvent, 'zone'> {
|
|
36
|
+
modal?: boolean;
|
|
37
|
+
closable?: boolean;
|
|
38
|
+
draggable?: boolean;
|
|
39
|
+
fullscreen?: boolean;
|
|
40
|
+
}
|
|
41
|
+
export interface LoadFrameOptions {
|
|
42
|
+
vars?: Record<string, string>;
|
|
43
|
+
zone?: string;
|
|
44
|
+
/** Show user-facing close controls. Defaults to true. */
|
|
45
|
+
closable?: boolean;
|
|
46
|
+
/** Add the navigation to the URL and browser history. Defaults to true. */
|
|
47
|
+
history?: boolean;
|
|
48
|
+
}
|
|
49
|
+
export interface LoadInOptions extends Omit<LoadFrameOptions, 'zone'> {
|
|
50
|
+
/** Explicit target zone. loadIn never supplies a default. */
|
|
51
|
+
zone: string;
|
|
52
|
+
}
|
|
53
|
+
export interface LoadDialogOptions {
|
|
54
|
+
vars?: Record<string, string>;
|
|
55
|
+
modal?: boolean;
|
|
56
|
+
/** Show user-facing close controls. Defaults to true. */
|
|
57
|
+
closable?: boolean;
|
|
58
|
+
/** Allow dragging by the dialog header. Defaults to true. */
|
|
59
|
+
draggable?: boolean;
|
|
60
|
+
/** Fill the viewport. Defaults to false. */
|
|
61
|
+
fullscreen?: boolean;
|
|
62
|
+
/** Add open/close states to browser history. Defaults to true. */
|
|
63
|
+
history?: boolean;
|
|
64
|
+
}
|
|
65
|
+
export interface CloseFrameOptions {
|
|
66
|
+
/** Notify the router of a user-driven close. Router reconciliation passes false. */
|
|
67
|
+
history?: boolean;
|
|
68
|
+
}
|
|
69
|
+
export interface NavigationEvent {
|
|
70
|
+
modulePath: string;
|
|
71
|
+
collection: string;
|
|
72
|
+
collectionId?: string | number;
|
|
73
|
+
vars?: Record<string, string>;
|
|
74
|
+
zone: string;
|
|
75
|
+
}
|
|
76
|
+
export declare class MachineFrameManager {
|
|
77
|
+
#private;
|
|
78
|
+
private registry;
|
|
79
|
+
/** Zones with a Frame mount in flight — closes the race where the same URL fires twice
|
|
80
|
+
* before the first Frame's $effect registers, causing a duplicate Frame mount. */
|
|
81
|
+
private mountingZones;
|
|
82
|
+
/** zone name → set of registered frameIds in that zone (for sibling hide/show). */
|
|
83
|
+
private zoneFrames;
|
|
84
|
+
private frameClosable;
|
|
85
|
+
private _router?;
|
|
86
|
+
private silentCloseFrames;
|
|
87
|
+
private _onNavigate?;
|
|
88
|
+
private _labelResolver?;
|
|
89
|
+
private _contextMenuMounted;
|
|
90
|
+
/** Injected by machine at init — enables URL-based navigation from framer. */
|
|
91
|
+
setRouter(options: FrameRouterOptions): void;
|
|
92
|
+
/** Injected by machine at init — fires after each loadFrame navigation. */
|
|
93
|
+
setNavigationHook(fn: (e: NavigationEvent) => void): void;
|
|
94
|
+
/** Injected by machine — resolves a record label (presentation) for dialog titles. */
|
|
95
|
+
setLabelResolver(fn: LabelResolver): void;
|
|
96
|
+
/** Resolve a human label for (collection, id). Falls back to undefined if no resolver set. */
|
|
97
|
+
resolveLabel(collection: string, collectionId?: string | number): Promise<string | undefined>;
|
|
98
|
+
/**
|
|
99
|
+
* Create a mount host bound to a target element (resolved lazily via getTarget).
|
|
100
|
+
* Shared engine for Frame.svelte and Dialog.svelte — see FrameHost.
|
|
101
|
+
*
|
|
102
|
+
* Toggle semantics (not swap): each distinct (modulePath, collection, collectionId, vars)
|
|
103
|
+
* mounts once into its own wrapper div and is kept alive. Re-loading the same content
|
|
104
|
+
* hides every sibling and shows the existing instance — no unmount, no re-render.
|
|
105
|
+
* Loading new content hides siblings and mounts the new instance. State is preserved
|
|
106
|
+
* across toggles. `destroy()` unmounts everything (frame teardown).
|
|
107
|
+
*
|
|
108
|
+
* `fill` (default true): the mounted content fills its zone via absolute
|
|
109
|
+
* inset:0 — correct for sized zones (main, panel). Set false for hosts whose
|
|
110
|
+
* own size is content-driven (floating dialog): content then sits in normal
|
|
111
|
+
* flow so the host can grow to fit it.
|
|
112
|
+
*/
|
|
113
|
+
createHost(getTarget: () => HTMLElement | undefined, opts?: {
|
|
114
|
+
fill?: boolean;
|
|
115
|
+
}): FrameHost;
|
|
116
|
+
/**
|
|
117
|
+
* Open the global context menu for (collection, collectionId) at the given page position.
|
|
118
|
+
* Mounts the singleton <ContextMenu> host into document.body on first use.
|
|
119
|
+
*/
|
|
120
|
+
openContextMenu(collection: string, collectionId: string | number, vars?: Record<string, string>, x?: number, y?: number): void;
|
|
121
|
+
/** Close the global context menu, if open. */
|
|
122
|
+
closeContextMenu(): void;
|
|
123
|
+
/**
|
|
124
|
+
* Frame navigation. By default it pushes a hash URL through the router;
|
|
125
|
+
* history:false mounts directly and leaves the URL untouched.
|
|
126
|
+
*/
|
|
127
|
+
loadFrame(pathKey: RegistryKey, collection: string, collectionId?: string | number, options?: LoadFrameOptions): void;
|
|
128
|
+
/**
|
|
129
|
+
* Navigation into an explicit zone. Unlike loadFrame, loadIn requires options.zone.
|
|
130
|
+
*/
|
|
131
|
+
loadIn(pathKey: RegistryKey, collection: string, options: LoadInOptions): void;
|
|
132
|
+
loadIn(pathKey: RegistryKey, collection: string, collectionId: string | number | undefined, options: LoadInOptions): void;
|
|
133
|
+
/**
|
|
134
|
+
* Open content in a dialog, routed by default and direct when history:false.
|
|
135
|
+
* frameId is content-keyed: reopening the same (modulePath, collection, id) focuses the
|
|
136
|
+
* existing dialog instead of duplicating; different content stacks new dialogs.
|
|
137
|
+
*/
|
|
138
|
+
loadInDialog(pathKey: RegistryKey, collection: string, collectionId?: string | number, options?: LoadDialogOptions): Promise<void>;
|
|
139
|
+
/**
|
|
140
|
+
* Register a frame's controls under a unique frameId.
|
|
141
|
+
* By default throws if the frameId is already registered.
|
|
142
|
+
* `replace` is intended for DOM/HMR-driven remounts where the frame id is stable
|
|
143
|
+
* but the mounted component instance has been recreated.
|
|
144
|
+
*
|
|
145
|
+
* Zone frames (format "modulePath:zone", not starting with "dialog:") are tracked
|
|
146
|
+
* per-zone so siblings can be hidden when a new frame activates.
|
|
147
|
+
*/
|
|
148
|
+
register(frameId: string, controls: FrameControls, options?: FrameRegisterOptions): void;
|
|
149
|
+
/**
|
|
150
|
+
* Unregister a frame by its frameId. No-op if not found.
|
|
151
|
+
*/
|
|
152
|
+
unregister(frameId: string): void;
|
|
153
|
+
/**
|
|
154
|
+
* For zone frames (format "modulePath:zone"): hide all sibling frames in the same
|
|
155
|
+
* zone and show the target frame. No-op for dialog frames.
|
|
156
|
+
*/
|
|
157
|
+
private activateZoneFrame;
|
|
158
|
+
/**
|
|
159
|
+
* Load content into a frame.
|
|
160
|
+
* - Frame known (in registry) → delegates to controls.load()
|
|
161
|
+
* - Frame unknown → looks for DOM zone [data-target-zone="${frameId}"]
|
|
162
|
+
* If zone found, caller should mount <Frame> there (auto-register happens on mount),
|
|
163
|
+
* then this method retries with the now-registered frame.
|
|
164
|
+
* If no zone found, throws.
|
|
165
|
+
*
|
|
166
|
+
* @param mountFn — optional callback to mount a <Frame> in the DOM zone.
|
|
167
|
+
* Signature: (frameId: string) => Promise<void>
|
|
168
|
+
*/
|
|
169
|
+
load(frameId: string, modulePath: string, collection: string, collectionId?: string | number, vars?: Record<string, string>, mountFn?: (frameId: string) => Promise<void>): Promise<void>;
|
|
170
|
+
/** Show a frame by calling controls.show(). Throws if not found. */
|
|
171
|
+
show(frameId: string): void;
|
|
172
|
+
/** Hide a frame by calling controls.hide(). Throws if not found. */
|
|
173
|
+
hide(frameId: string): void;
|
|
174
|
+
/** Toggle a frame visibility. Throws if not found. */
|
|
175
|
+
toggle(frameId: string): void;
|
|
176
|
+
/** Close a frame (unmount + unregister). Throws if not found. */
|
|
177
|
+
close(frameId: string, options?: CloseFrameOptions): void;
|
|
178
|
+
/** Read-only view of currently open frames. */
|
|
179
|
+
get openFrames(): ReadonlyMap<string, FrameControls>;
|
|
180
|
+
/** Check if a frame is registered. */
|
|
181
|
+
has(frameId: string): boolean;
|
|
182
|
+
/** Get controls for a frame (or undefined). */
|
|
183
|
+
getControls(frameId: string): FrameControls | undefined;
|
|
184
|
+
/** Clear all registered frames. */
|
|
185
|
+
clear(): void;
|
|
186
|
+
}
|
|
187
|
+
export declare const machineFrameManager: MachineFrameManager;
|