@medyll/idae-machine 0.135.2 → 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/LICENSE +21 -21
- package/README.md +555 -360
- 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/{form/FieldInPlace.svelte → data-ui/field/DataFieldEdit.svelte} +103 -98
- package/dist/{form/FieldInPlace.svelte.d.ts → data-ui/field/DataFieldEdit.svelte.d.ts} +5 -5
- 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 +21 -21
- 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 -35
- package/dist/index.js +82 -36
- 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.js +2 -2
- package/dist/main/machine/MachineFieldType.d.ts +25 -6
- package/dist/main/machine/MachineFieldType.js +118 -27
- 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 +40 -70
- package/dist/main/machine/MachineScheme.js +107 -94
- package/dist/main/machine/MachineSchemeField.js +32 -16
- package/dist/main/machine/MachineSchemeFieldForge.d.ts +11 -11
- package/dist/main/machine/MachineSchemeFieldForge.js +33 -21
- package/dist/main/machine/MachineSchemeFieldValues.d.ts +8 -9
- package/dist/main/machine/MachineSchemeFieldValues.js +12 -9
- package/dist/main/machine/MachineSchemeValidate.d.ts +69 -13
- package/dist/main/machine/MachineSchemeValidate.js +173 -46
- package/dist/main/machine/MachineSchemeValues.d.ts +32 -21
- package/dist/main/machine/MachineSchemeValues.js +132 -104
- package/dist/main/machine/SchemeFieldDefaultValues.d.ts +4 -2
- package/dist/main/machine/SchemeFieldDefaultValues.js +8 -2
- 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 +207 -68
- package/dist/main/machine.js +482 -96
- package/dist/main/machineDb.d.ts +21 -8
- package/dist/main/machineDb.js +33 -4
- 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 +9 -18
- package/dist/main/machineParserForge.js +92 -35
- 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 +59 -33
- package/cli.js +0 -46
- package/dist/db/CrudService.d.ts +0 -9
- package/dist/db/CrudService.js +0 -45
- package/dist/demo/dbSchema.d.ts +0 -446
- package/dist/demo/dbSchema.js +0 -449
- package/dist/demo/testScheme.d.ts +0 -56
- package/dist/demo/testScheme.js +0 -42
- package/dist/form/CreateUpdate.svelte +0 -219
- package/dist/form/CreateUpdate.svelte.d.ts +0 -27
- package/dist/form/DataProvider.svelte +0 -23
- package/dist/form/DataProvider.svelte.d.ts +0 -7
- package/dist/form/FieldValue.svelte +0 -148
- package/dist/form/FieldValue.svelte.d.ts +0 -34
- package/dist/form/types.d.ts +0 -17
- package/dist/fragments/Confirm.svelte +0 -73
- package/dist/fragments/Confirm.svelte.d.ts +0 -7
- 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/Selector.svelte +0 -26
- package/dist/fragments/Selector.svelte.d.ts +0 -38
- package/dist/main/machine/MachineSchemeField.d.ts +0 -19
- package/dist/types/appschemeTypes.d.ts +0 -71
- package/dist/types/appschemeTypes.js +0 -83
- package/dist/ui/CollectionButton.svelte +0 -29
- package/dist/ui/CollectionButton.svelte.d.ts +0 -29
- package/dist/ui/CollectionFks.svelte +0 -24
- package/dist/ui/CollectionFks.svelte.d.ts +0 -9
- package/dist/ui/CollectionList.svelte +0 -100
- package/dist/ui/CollectionList.svelte.d.ts +0 -36
- package/dist/ui/CollectionListFieldValues.svelte +0 -59
- package/dist/ui/CollectionListFieldValues.svelte.d.ts +0 -9
- package/dist/ui/CollectionListMenu.svelte +0 -39
- package/dist/ui/CollectionListMenu.svelte.d.ts +0 -34
- package/dist/ui/CollectionReverseFks.svelte +0 -37
- package/dist/ui/CollectionReverseFks.svelte.d.ts +0 -14
- /package/dist/{fragments → data-ui/fragments}/Skeleton.svelte.d.ts +0 -0
- /package/dist/{form → main/api}/types.js +0 -0
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
InfoLine.svelte
|
|
3
|
+
Label/value line, optional secondary hint and progress bar. Used inside Tile
|
|
4
|
+
panels (classification breakdown, period counters, FK card metadata).
|
|
5
|
+
|
|
6
|
+
A clickable line renders as a real <button>, a static one as <info-line-fragment>;
|
|
7
|
+
both carry .info-line-fragment so one rule styles the grid.
|
|
8
|
+
|
|
9
|
+
@prop {string} label
|
|
10
|
+
@prop {string|number} [value]
|
|
11
|
+
@prop {string} [hint] - secondary text, e.g. "3 sur 12"
|
|
12
|
+
@prop {number} [progress] - 0..1, renders a progress bar under the line
|
|
13
|
+
@prop {Snippet} [children] - custom value area, overrides `value`
|
|
14
|
+
@prop {() => void} [onclick]
|
|
15
|
+
-->
|
|
16
|
+
<script module lang="ts">
|
|
17
|
+
import type { Snippet } from 'svelte';
|
|
18
|
+
|
|
19
|
+
export interface InfoLineProps {
|
|
20
|
+
label: string;
|
|
21
|
+
value?: string | number;
|
|
22
|
+
hint?: string;
|
|
23
|
+
progress?: number;
|
|
24
|
+
children?: Snippet;
|
|
25
|
+
onclick?: () => void;
|
|
26
|
+
}
|
|
27
|
+
</script>
|
|
28
|
+
|
|
29
|
+
<script lang="ts">
|
|
30
|
+
let { label, value, hint, progress, children, onclick }: InfoLineProps = $props();
|
|
31
|
+
|
|
32
|
+
const clampedProgress = $derived(
|
|
33
|
+
progress == null ? undefined : Math.min(1, Math.max(0, progress))
|
|
34
|
+
);
|
|
35
|
+
</script>
|
|
36
|
+
|
|
37
|
+
{#snippet inner()}
|
|
38
|
+
<span class="info-line-label">{label}</span>
|
|
39
|
+
<span class="info-line-value">
|
|
40
|
+
{#if children}
|
|
41
|
+
{@render children()}
|
|
42
|
+
{:else}
|
|
43
|
+
{value ?? '—'}
|
|
44
|
+
{/if}
|
|
45
|
+
{#if hint}<span class="info-line-hint">{hint}</span>{/if}
|
|
46
|
+
</span>
|
|
47
|
+
{#if clampedProgress != null}
|
|
48
|
+
<span class="info-line-progress" style={`--progress: ${clampedProgress};`}>
|
|
49
|
+
<span class="info-line-progress-bar"></span>
|
|
50
|
+
</span>
|
|
51
|
+
{/if}
|
|
52
|
+
{/snippet}
|
|
53
|
+
|
|
54
|
+
{#if onclick}
|
|
55
|
+
<button type="button" class="info-line-fragment info-line-fragment--clickable" {onclick}>
|
|
56
|
+
{@render inner()}
|
|
57
|
+
</button>
|
|
58
|
+
{:else}
|
|
59
|
+
<info-line-fragment class="info-line-fragment">
|
|
60
|
+
{@render inner()}
|
|
61
|
+
</info-line-fragment>
|
|
62
|
+
{/if}
|
|
63
|
+
|
|
64
|
+
<style>
|
|
65
|
+
@layer components {
|
|
66
|
+
.info-line-fragment {
|
|
67
|
+
display: grid;
|
|
68
|
+
grid-template-columns: 1fr auto;
|
|
69
|
+
align-items: baseline;
|
|
70
|
+
gap: var(--gutter-xs) var(--gutter-sm);
|
|
71
|
+
padding: var(--pad-xs) 0;
|
|
72
|
+
color: var(--color-text);
|
|
73
|
+
font: inherit;
|
|
74
|
+
text-align: start;
|
|
75
|
+
}
|
|
76
|
+
/* Button normalisation only — grid/spacing come from .info-line-fragment above. */
|
|
77
|
+
.info-line-fragment--clickable {
|
|
78
|
+
appearance: none;
|
|
79
|
+
border: none;
|
|
80
|
+
background: transparent;
|
|
81
|
+
inline-size: 100%;
|
|
82
|
+
cursor: pointer;
|
|
83
|
+
}
|
|
84
|
+
.info-line-fragment--clickable:hover {
|
|
85
|
+
color: var(--color-primary);
|
|
86
|
+
}
|
|
87
|
+
.info-line-label {
|
|
88
|
+
text-transform: capitalize;
|
|
89
|
+
min-width: 0;
|
|
90
|
+
overflow: hidden;
|
|
91
|
+
text-overflow: ellipsis;
|
|
92
|
+
white-space: nowrap;
|
|
93
|
+
}
|
|
94
|
+
.info-line-value {
|
|
95
|
+
display: inline-flex;
|
|
96
|
+
align-items: baseline;
|
|
97
|
+
gap: var(--gutter-xs);
|
|
98
|
+
font-weight: var(--font-semibold);
|
|
99
|
+
white-space: nowrap;
|
|
100
|
+
}
|
|
101
|
+
.info-line-hint {
|
|
102
|
+
font-weight: var(--font-normal);
|
|
103
|
+
font-size: var(--text-xs);
|
|
104
|
+
color: var(--color-text-muted);
|
|
105
|
+
}
|
|
106
|
+
.info-line-progress {
|
|
107
|
+
grid-column: 1 / -1;
|
|
108
|
+
display: block;
|
|
109
|
+
inline-size: 100%;
|
|
110
|
+
block-size: calc(var(--gutter-xs) / 2);
|
|
111
|
+
background: var(--color-surface-sunken);
|
|
112
|
+
border-radius: var(--radius-full);
|
|
113
|
+
overflow: hidden;
|
|
114
|
+
}
|
|
115
|
+
.info-line-progress-bar {
|
|
116
|
+
display: block;
|
|
117
|
+
block-size: 100%;
|
|
118
|
+
inline-size: calc(var(--progress) * 100%);
|
|
119
|
+
background: var(--color-primary);
|
|
120
|
+
border-radius: var(--radius-full);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
</style>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
export interface InfoLineProps {
|
|
3
|
+
label: string;
|
|
4
|
+
value?: string | number;
|
|
5
|
+
hint?: string;
|
|
6
|
+
progress?: number;
|
|
7
|
+
children?: Snippet;
|
|
8
|
+
onclick?: () => void;
|
|
9
|
+
}
|
|
10
|
+
declare const InfoLine: import("svelte").Component<InfoLineProps, {}, "">;
|
|
11
|
+
type InfoLine = ReturnType<typeof InfoLine>;
|
|
12
|
+
export default InfoLine;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
Selector.svelte
|
|
3
|
+
Selection list that renders items via snippet prop
|
|
4
|
+
@role ui
|
|
5
|
+
@prop {unknown[]} [values] - Array of values to render
|
|
6
|
+
@prop {unknown} [value] - Current selected value
|
|
7
|
+
@prop {Snippet} item - Snippet for rendering an item (item, active)
|
|
8
|
+
@snippet selectorFallback - Fallback snippet when values empty
|
|
9
|
+
-->
|
|
10
|
+
<script module lang="ts">
|
|
11
|
+
import type { Snippet } from 'svelte';
|
|
12
|
+
|
|
13
|
+
export interface SelectorProps {
|
|
14
|
+
values?: unknown[];
|
|
15
|
+
value?: unknown;
|
|
16
|
+
item?: Snippet<[unknown, boolean]>;
|
|
17
|
+
selectorFallback?: Snippet;
|
|
18
|
+
}
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<script lang="ts">
|
|
22
|
+
let {
|
|
23
|
+
values = [],
|
|
24
|
+
value,
|
|
25
|
+
item,
|
|
26
|
+
selectorFallback
|
|
27
|
+
}: SelectorProps = $props();
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
{#each values as valueO ((valueO as Record<string, unknown>)?.id ?? valueO)}
|
|
31
|
+
<div class={' ' + (valueO == value ? 'active ' : 'inactive')}>
|
|
32
|
+
{@render item?.(valueO, valueO === value)}
|
|
33
|
+
</div>
|
|
34
|
+
{/each}
|
|
35
|
+
{#if !values.length}
|
|
36
|
+
{@render selectorFallback?.()}
|
|
37
|
+
{/if}
|
|
38
|
+
|
|
39
|
+
<style>
|
|
40
|
+
@layer components {
|
|
41
|
+
.active,
|
|
42
|
+
.inactive {
|
|
43
|
+
border: var(--border-width) solid transparent;
|
|
44
|
+
border-bottom-width: calc(var(--border-width) * 2);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.active {
|
|
48
|
+
border-color: var(--color-border-strong);
|
|
49
|
+
background: var(--color-surface-alt);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.inactive {
|
|
53
|
+
color: var(--color-text-muted);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
</style>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
export interface SelectorProps {
|
|
3
|
+
values?: unknown[];
|
|
4
|
+
value?: unknown;
|
|
5
|
+
item?: Snippet<[unknown, boolean]>;
|
|
6
|
+
selectorFallback?: Snippet;
|
|
7
|
+
}
|
|
8
|
+
declare const Selector: import("svelte").Component<SelectorProps, {}, "">;
|
|
9
|
+
type Selector = ReturnType<typeof Selector>;
|
|
10
|
+
export default Selector;
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import List from '
|
|
3
|
-
|
|
4
|
-
let className = '';
|
|
5
|
-
export { className as class };
|
|
6
|
-
|
|
7
|
-
function skeletonLine() {
|
|
8
|
-
return [...Array(Math.ceil(Math.random() * 5))]
|
|
9
|
-
.map(
|
|
10
|
-
() =>
|
|
11
|
-
'<div class="h-2 bg-gray-200 dark:bg-gray-600 rounded-md p-1 col-span-2 animate-pulse flex-auto" ></div>'
|
|
12
|
-
)
|
|
13
|
-
.join('');
|
|
14
|
-
}
|
|
15
|
-
</script>
|
|
16
|
-
|
|
17
|
-
<div class={className}>
|
|
18
|
-
<List class="flex flex-col gap-2" data={[...Array(4)]}>
|
|
19
|
-
<div class="flex gap-2">{@html skeletonLine()}</div>
|
|
20
|
-
</List>
|
|
21
|
-
</div>
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
// import List from '../../fragments/List.svelte';
|
|
3
|
+
|
|
4
|
+
let className = '';
|
|
5
|
+
export { className as class };
|
|
6
|
+
|
|
7
|
+
function skeletonLine() {
|
|
8
|
+
return [...Array(Math.ceil(Math.random() * 5))]
|
|
9
|
+
.map(
|
|
10
|
+
() =>
|
|
11
|
+
'<div class="h-2 bg-gray-200 dark:bg-gray-600 rounded-md p-1 col-span-2 animate-pulse flex-auto" ></div>'
|
|
12
|
+
)
|
|
13
|
+
.join('');
|
|
14
|
+
}
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<div class={className}>
|
|
18
|
+
<!-- <List class="flex flex-col gap-2" data={[...Array(4)]}>
|
|
19
|
+
<div class="flex gap-2">{@html skeletonLine()}</div>
|
|
20
|
+
</List> -->
|
|
21
|
+
</div>
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
Tile.svelte
|
|
3
|
+
Generic card/section shell — title + icon header, body, optional footer, optional
|
|
4
|
+
whole-tile click. Shared by Space (classification/FK/period panels) and Today
|
|
5
|
+
(quick-create/my-lists/echeancier sections).
|
|
6
|
+
|
|
7
|
+
A clickable tile renders as a real <button> (native semantics, no role/tabindex
|
|
8
|
+
patching); a static one renders as <tile-fragment>. Both carry the .tile-fragment
|
|
9
|
+
class so a single CSS rule styles them — the --clickable modifier only adds button
|
|
10
|
+
normalisation and hover.
|
|
11
|
+
|
|
12
|
+
@prop {string} [title]
|
|
13
|
+
@prop {string} [icon] - Iconify icon name; bare names are prefixed with "ph:"
|
|
14
|
+
@prop {string} [accentColor] - CSS color value applied as --tile-accent
|
|
15
|
+
@prop {Snippet} [header] - overrides the default title/icon line
|
|
16
|
+
@prop {Snippet} [footer]
|
|
17
|
+
@prop {Snippet} children
|
|
18
|
+
@prop {() => void} [onclick] - whole-tile click (renders as a button)
|
|
19
|
+
@prop {string} [class]
|
|
20
|
+
-->
|
|
21
|
+
<script module lang="ts">
|
|
22
|
+
import type { Snippet } from 'svelte';
|
|
23
|
+
|
|
24
|
+
export interface TileProps {
|
|
25
|
+
title?: string;
|
|
26
|
+
icon?: string;
|
|
27
|
+
accentColor?: string;
|
|
28
|
+
header?: Snippet;
|
|
29
|
+
footer?: Snippet;
|
|
30
|
+
children: Snippet;
|
|
31
|
+
onclick?: () => void;
|
|
32
|
+
class?: string;
|
|
33
|
+
}
|
|
34
|
+
</script>
|
|
35
|
+
|
|
36
|
+
<script lang="ts">
|
|
37
|
+
import Icon from '@iconify/svelte';
|
|
38
|
+
|
|
39
|
+
let { title, icon, accentColor, header, footer, children, onclick, class: className }: TileProps =
|
|
40
|
+
$props();
|
|
41
|
+
|
|
42
|
+
function normalizeIcon(value: string): string {
|
|
43
|
+
const trimmed = value.trim();
|
|
44
|
+
return trimmed.includes(':') ? trimmed : `ph:${trimmed}`;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const style = $derived(accentColor ? `--tile-accent: ${accentColor};` : undefined);
|
|
48
|
+
</script>
|
|
49
|
+
|
|
50
|
+
{#snippet inner()}
|
|
51
|
+
{#if header}
|
|
52
|
+
<tile-header>{@render header()}</tile-header>
|
|
53
|
+
{:else if title || icon}
|
|
54
|
+
<tile-header>
|
|
55
|
+
{#if icon}<span class="tile-icon"><Icon icon={normalizeIcon(icon)} /></span>{/if}
|
|
56
|
+
{#if title}<span class="tile-title">{title}</span>{/if}
|
|
57
|
+
</tile-header>
|
|
58
|
+
{/if}
|
|
59
|
+
<tile-body>
|
|
60
|
+
{@render children()}
|
|
61
|
+
</tile-body>
|
|
62
|
+
{#if footer}
|
|
63
|
+
<tile-footer>{@render footer()}</tile-footer>
|
|
64
|
+
{/if}
|
|
65
|
+
{/snippet}
|
|
66
|
+
|
|
67
|
+
{#if onclick}
|
|
68
|
+
<button type="button" class="tile-fragment tile-fragment--clickable {className ?? ''}" {style} {onclick}>
|
|
69
|
+
{@render inner()}
|
|
70
|
+
</button>
|
|
71
|
+
{:else}
|
|
72
|
+
<tile-fragment class="tile-fragment {className ?? ''}" {style}>
|
|
73
|
+
{@render inner()}
|
|
74
|
+
</tile-fragment>
|
|
75
|
+
{/if}
|
|
76
|
+
|
|
77
|
+
<style>
|
|
78
|
+
@layer components {
|
|
79
|
+
.tile-fragment {
|
|
80
|
+
display: flex;
|
|
81
|
+
flex-direction: column;
|
|
82
|
+
gap: var(--gutter-xs);
|
|
83
|
+
padding: var(--pad-sm);
|
|
84
|
+
border: var(--border-width) solid var(--color-border);
|
|
85
|
+
border-radius: var(--radius-xs);
|
|
86
|
+
background: var(--color-surface-alt);
|
|
87
|
+
border-inline-start: calc(var(--border-width) * 3) solid var(--tile-accent, transparent);
|
|
88
|
+
color: var(--color-text);
|
|
89
|
+
font: inherit;
|
|
90
|
+
text-align: start;
|
|
91
|
+
}
|
|
92
|
+
/* Button normalisation only — surfaces/borders come from .tile-fragment above. */
|
|
93
|
+
.tile-fragment--clickable {
|
|
94
|
+
appearance: none;
|
|
95
|
+
inline-size: 100%;
|
|
96
|
+
cursor: pointer;
|
|
97
|
+
}
|
|
98
|
+
.tile-fragment--clickable:hover {
|
|
99
|
+
background: var(--color-surface-hover);
|
|
100
|
+
}
|
|
101
|
+
tile-header {
|
|
102
|
+
display: flex;
|
|
103
|
+
align-items: center;
|
|
104
|
+
gap: var(--gutter-xs);
|
|
105
|
+
font-weight: var(--font-semibold);
|
|
106
|
+
}
|
|
107
|
+
.tile-icon :global(svg) {
|
|
108
|
+
font-size: var(--icon-size-sm);
|
|
109
|
+
}
|
|
110
|
+
.tile-title {
|
|
111
|
+
text-transform: capitalize;
|
|
112
|
+
}
|
|
113
|
+
tile-body {
|
|
114
|
+
display: flex;
|
|
115
|
+
flex-direction: column;
|
|
116
|
+
gap: var(--gutter-xs);
|
|
117
|
+
}
|
|
118
|
+
tile-footer {
|
|
119
|
+
display: flex;
|
|
120
|
+
align-items: center;
|
|
121
|
+
gap: var(--gutter-xs);
|
|
122
|
+
padding-top: var(--pad-xs);
|
|
123
|
+
border-top: var(--border-width) solid var(--color-border);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
</style>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
export interface TileProps {
|
|
3
|
+
title?: string;
|
|
4
|
+
icon?: string;
|
|
5
|
+
accentColor?: string;
|
|
6
|
+
header?: Snippet;
|
|
7
|
+
footer?: Snippet;
|
|
8
|
+
children: Snippet;
|
|
9
|
+
onclick?: () => void;
|
|
10
|
+
class?: string;
|
|
11
|
+
}
|
|
12
|
+
declare const Tile: import("svelte").Component<TileProps, {}, "">;
|
|
13
|
+
type Tile = ReturnType<typeof Tile>;
|
|
14
|
+
export default Tile;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reactive context-menu state. Svelte 5 runes module — consumers (ContextMenu.svelte)
|
|
3
|
+
* read `state` directly, no polling needed.
|
|
4
|
+
*/
|
|
5
|
+
export interface ContextMenuState {
|
|
6
|
+
isOpen: boolean;
|
|
7
|
+
position: {
|
|
8
|
+
x: number;
|
|
9
|
+
y: number;
|
|
10
|
+
};
|
|
11
|
+
collection: string;
|
|
12
|
+
collectionId: string | number;
|
|
13
|
+
vars: Record<string, string>;
|
|
14
|
+
}
|
|
15
|
+
/** Open the context menu at the specified position. */
|
|
16
|
+
export declare function openContextMenu(targetCollection: string, targetId: string | number, targetVars: Record<string, string> | undefined, positionX: number, positionY: number): void;
|
|
17
|
+
/** Close the context menu. */
|
|
18
|
+
export declare function closeContextMenu(): void;
|
|
19
|
+
/** Reactive context-menu state (same object every call — read its fields in a reactive scope). */
|
|
20
|
+
export declare function getContextMenuState(): ContextMenuState;
|
|
21
|
+
/** Reset the context menu state (used by tests). */
|
|
22
|
+
export declare function resetContextMenu(): void;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
const state = $state({
|
|
2
|
+
isOpen: false,
|
|
3
|
+
position: { x: 0, y: 0 },
|
|
4
|
+
collection: '',
|
|
5
|
+
collectionId: '',
|
|
6
|
+
vars: {}
|
|
7
|
+
});
|
|
8
|
+
/** Open the context menu at the specified position. */
|
|
9
|
+
export function openContextMenu(targetCollection, targetId, targetVars = {}, positionX, positionY) {
|
|
10
|
+
state.collection = targetCollection;
|
|
11
|
+
state.collectionId = targetId;
|
|
12
|
+
state.vars = targetVars;
|
|
13
|
+
state.position = { x: positionX, y: positionY };
|
|
14
|
+
state.isOpen = true;
|
|
15
|
+
}
|
|
16
|
+
/** Close the context menu. */
|
|
17
|
+
export function closeContextMenu() {
|
|
18
|
+
state.isOpen = false;
|
|
19
|
+
}
|
|
20
|
+
/** Reactive context-menu state (same object every call — read its fields in a reactive scope). */
|
|
21
|
+
export function getContextMenuState() {
|
|
22
|
+
return state;
|
|
23
|
+
}
|
|
24
|
+
/** Reset the context menu state (used by tests). */
|
|
25
|
+
export function resetContextMenu() {
|
|
26
|
+
state.isOpen = false;
|
|
27
|
+
state.position = { x: 0, y: 0 };
|
|
28
|
+
state.collection = '';
|
|
29
|
+
state.collectionId = '';
|
|
30
|
+
state.vars = {};
|
|
31
|
+
}
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
Dialog.svelte — floating/fullscreen frame with optional drag and modality (Svelte 5 runes).
|
|
3
|
+
A dialog IS a frame: it registers in machine.framer and mounts its content via the
|
|
4
|
+
shared host (componentRegistry). Rendered floating instead of filling a static zone.
|
|
5
|
+
When enabled, dragging uses the header bar. Stacking via css-base --z-modal.
|
|
6
|
+
-->
|
|
7
|
+
<script module lang="ts">
|
|
8
|
+
import type { Snippet } from 'svelte';
|
|
9
|
+
|
|
10
|
+
export interface DialogProps {
|
|
11
|
+
open?: boolean;
|
|
12
|
+
id: string;
|
|
13
|
+
modulePath?: string;
|
|
14
|
+
collection?: string;
|
|
15
|
+
collectionId?: string | number;
|
|
16
|
+
vars?: Record<string, string>;
|
|
17
|
+
iconClose?: string;
|
|
18
|
+
center?: boolean;
|
|
19
|
+
removeOnClose?: boolean;
|
|
20
|
+
/** Render a backdrop scrim behind the dialog (blocks interaction with the page). */
|
|
21
|
+
modal?: boolean;
|
|
22
|
+
/** Allow closing via the header button, Escape, or backdrop click. */
|
|
23
|
+
closable?: boolean;
|
|
24
|
+
/** Allow dragging by the header. Defaults to true. */
|
|
25
|
+
draggable?: boolean;
|
|
26
|
+
/** Fill the viewport. Defaults to false. */
|
|
27
|
+
fullscreen?: boolean;
|
|
28
|
+
onClose?: () => void;
|
|
29
|
+
header?: Snippet;
|
|
30
|
+
footer?: Snippet;
|
|
31
|
+
children?: Snippet;
|
|
32
|
+
}
|
|
33
|
+
</script>
|
|
34
|
+
|
|
35
|
+
<script lang="ts">
|
|
36
|
+
import Icon from '@iconify/svelte';
|
|
37
|
+
import { untrack } from 'svelte';
|
|
38
|
+
import { machine } from '../../../main/machine.js';
|
|
39
|
+
import type { FrameControls } from '../../../main/frame/MachineFrameManager.js';
|
|
40
|
+
import { draggable as draggableAction, centerInViewport } from '../../utils/draggable.js';
|
|
41
|
+
|
|
42
|
+
let {
|
|
43
|
+
open = $bindable(true),
|
|
44
|
+
id,
|
|
45
|
+
modulePath,
|
|
46
|
+
collection,
|
|
47
|
+
collectionId,
|
|
48
|
+
vars,
|
|
49
|
+
iconClose = 'mdi:close',
|
|
50
|
+
center = true,
|
|
51
|
+
removeOnClose = false,
|
|
52
|
+
modal = false,
|
|
53
|
+
closable = true,
|
|
54
|
+
draggable = true,
|
|
55
|
+
fullscreen = false,
|
|
56
|
+
onClose = () => {},
|
|
57
|
+
header,
|
|
58
|
+
footer,
|
|
59
|
+
children
|
|
60
|
+
}: DialogProps = $props();
|
|
61
|
+
|
|
62
|
+
let element = $state<HTMLDialogElement>();
|
|
63
|
+
let bodyEl = $state<HTMLDivElement>();
|
|
64
|
+
let visible = $state(true);
|
|
65
|
+
let title = $state('');
|
|
66
|
+
|
|
67
|
+
// Normal dialogs are content-driven; fullscreen dialogs provide a sized host.
|
|
68
|
+
const host = machine.framer.createHost(() => bodyEl, { fill: untrack(() => fullscreen) });
|
|
69
|
+
|
|
70
|
+
function setTitle(col?: string, colId?: string | number) {
|
|
71
|
+
if (!col) return;
|
|
72
|
+
machine.framer.resolveLabel(col, colId).then((label) => {
|
|
73
|
+
title = label ? `${col} — ${label}` : col;
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/** Raise above sibling dialogs: same --z-modal layer, DOM order decides paint order. */
|
|
78
|
+
function raise() {
|
|
79
|
+
const parent = element?.parentElement;
|
|
80
|
+
if (parent && element && parent.lastElementChild !== element) {
|
|
81
|
+
parent.appendChild(element);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function focusDialog() {
|
|
86
|
+
visible = true;
|
|
87
|
+
raise();
|
|
88
|
+
element?.focus();
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
const controls: FrameControls = {
|
|
92
|
+
load: (mp, col, colId, v) => {
|
|
93
|
+
host.load(mp, col, colId, v);
|
|
94
|
+
setTitle(col, colId);
|
|
95
|
+
},
|
|
96
|
+
show: () => { visible = true; },
|
|
97
|
+
hide: () => { visible = false; },
|
|
98
|
+
toggle: () => { visible = !visible; },
|
|
99
|
+
close: () => close(),
|
|
100
|
+
focus: () => focusDialog(),
|
|
101
|
+
closable: untrack(() => closable)
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
$effect(() => {
|
|
105
|
+
untrack(() => machine.framer.register(id, controls, { replace: true }));
|
|
106
|
+
if (modulePath && collection) {
|
|
107
|
+
host.load(modulePath, collection, collectionId, vars);
|
|
108
|
+
setTitle(collection, collectionId);
|
|
109
|
+
}
|
|
110
|
+
return () => {
|
|
111
|
+
untrack(() => machine.framer.unregister(id));
|
|
112
|
+
host.destroy();
|
|
113
|
+
};
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
$effect(() => {
|
|
117
|
+
if (element && open && center && !fullscreen) centerInViewport(element);
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
export function close() {
|
|
121
|
+
host.destroy();
|
|
122
|
+
untrack(() => machine.framer.unregister(id));
|
|
123
|
+
open = false;
|
|
124
|
+
onClose();
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
function onKeydown(e: KeyboardEvent) {
|
|
128
|
+
if (closable && e.key === 'Escape') close();
|
|
129
|
+
}
|
|
130
|
+
</script>
|
|
131
|
+
|
|
132
|
+
{#if open}
|
|
133
|
+
{#if modal && visible}
|
|
134
|
+
<!-- Scrim: blocks the page; click-to-close only when closable. -->
|
|
135
|
+
<div
|
|
136
|
+
class="idae-dialog__backdrop"
|
|
137
|
+
role="presentation"
|
|
138
|
+
onpointerdown={() => closable && close()}
|
|
139
|
+
></div>
|
|
140
|
+
{/if}
|
|
141
|
+
<dialog
|
|
142
|
+
bind:this={element}
|
|
143
|
+
open
|
|
144
|
+
class="idae-dialog"
|
|
145
|
+
class:idae-dialog--modal={modal}
|
|
146
|
+
class:idae-dialog--fullscreen={fullscreen}
|
|
147
|
+
tabindex="-1"
|
|
148
|
+
style:display={visible ? 'flex' : 'none'}
|
|
149
|
+
use:draggableAction={{ disabled: !draggable || fullscreen || modal }}
|
|
150
|
+
onpointerdown={raise}
|
|
151
|
+
onkeydown={onKeydown}
|
|
152
|
+
aria-label={title}
|
|
153
|
+
>
|
|
154
|
+
<header class="idae-dialog__bar" data-drag-handle>
|
|
155
|
+
{#if header}
|
|
156
|
+
{@render header()}
|
|
157
|
+
{:else}
|
|
158
|
+
<span class="idae-dialog__title">{title}</span>
|
|
159
|
+
{/if}
|
|
160
|
+
{#if closable}
|
|
161
|
+
<button
|
|
162
|
+
type="button"
|
|
163
|
+
class="btn-icon btn-sm idae-dialog__close"
|
|
164
|
+
aria-label="Close"
|
|
165
|
+
onclick={close}
|
|
166
|
+
>
|
|
167
|
+
<Icon icon={iconClose} />
|
|
168
|
+
</button>
|
|
169
|
+
{/if}
|
|
170
|
+
</header>
|
|
171
|
+
|
|
172
|
+
<div
|
|
173
|
+
class="idae-dialog__body"
|
|
174
|
+
class:idae-dialog__body--framed={!!modulePath}
|
|
175
|
+
bind:this={bodyEl}
|
|
176
|
+
>
|
|
177
|
+
{#if !modulePath && children}{@render children()}{/if}
|
|
178
|
+
</div>
|
|
179
|
+
|
|
180
|
+
{#if footer}
|
|
181
|
+
<footer class="idae-dialog__footer">{@render footer()}</footer>
|
|
182
|
+
{/if}
|
|
183
|
+
</dialog>
|
|
184
|
+
{/if}
|
|
185
|
+
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
export interface DialogProps {
|
|
3
|
+
open?: boolean;
|
|
4
|
+
id: string;
|
|
5
|
+
modulePath?: string;
|
|
6
|
+
collection?: string;
|
|
7
|
+
collectionId?: string | number;
|
|
8
|
+
vars?: Record<string, string>;
|
|
9
|
+
iconClose?: string;
|
|
10
|
+
center?: boolean;
|
|
11
|
+
removeOnClose?: boolean;
|
|
12
|
+
/** Render a backdrop scrim behind the dialog (blocks interaction with the page). */
|
|
13
|
+
modal?: boolean;
|
|
14
|
+
/** Allow closing via the header button, Escape, or backdrop click. */
|
|
15
|
+
closable?: boolean;
|
|
16
|
+
/** Allow dragging by the header. Defaults to true. */
|
|
17
|
+
draggable?: boolean;
|
|
18
|
+
/** Fill the viewport. Defaults to false. */
|
|
19
|
+
fullscreen?: boolean;
|
|
20
|
+
onClose?: () => void;
|
|
21
|
+
header?: Snippet;
|
|
22
|
+
footer?: Snippet;
|
|
23
|
+
children?: Snippet;
|
|
24
|
+
}
|
|
25
|
+
declare const Dialog: import("svelte").Component<DialogProps, {
|
|
26
|
+
close: () => void;
|
|
27
|
+
}, "open">;
|
|
28
|
+
type Dialog = ReturnType<typeof Dialog>;
|
|
29
|
+
export default Dialog;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export interface OpenDialogOptions {
|
|
2
|
+
/** Frame id — content-keyed by framer.loadInDialog. */
|
|
3
|
+
id: string;
|
|
4
|
+
iconClose?: string;
|
|
5
|
+
center?: boolean;
|
|
6
|
+
/** Render a backdrop scrim behind the dialog. */
|
|
7
|
+
modal?: boolean;
|
|
8
|
+
/** Allow closing via button / Escape / backdrop. Defaults to true. */
|
|
9
|
+
closable?: boolean;
|
|
10
|
+
/** Allow dragging by the header. Defaults to true. */
|
|
11
|
+
draggable?: boolean;
|
|
12
|
+
/** Fill the viewport. Defaults to false. */
|
|
13
|
+
fullscreen?: boolean;
|
|
14
|
+
/** Mount target. Defaults to document.body. */
|
|
15
|
+
target?: HTMLElement;
|
|
16
|
+
onClose?: () => void;
|
|
17
|
+
}
|
|
18
|
+
export interface DialogHandle {
|
|
19
|
+
close: () => void;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Mount a floating draggable Dialog frame on `target` (default body).
|
|
23
|
+
* Content is driven by framer: the Dialog auto-registers under `id`, then framer.load()
|
|
24
|
+
* calls controls.load() to mount the resolved component. Returns a handle with `.close()`.
|
|
25
|
+
* Prefer `machine.framer.loadInDialog(...)` over calling this directly.
|
|
26
|
+
*/
|
|
27
|
+
export declare function openDialog(options: OpenDialogOptions): DialogHandle;
|