@dxos/plugin-space 0.10.0 → 0.11.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/PLUGIN.mdl +11 -0
- package/dist/lib/SpacePlugin.mjs +2 -0
- package/dist/lib/SpacePlugin.node.mjs +628 -0
- package/dist/lib/SpacePlugin.node.mjs.map +1 -0
- package/dist/lib/SpacePlugin.workerd.mjs +26 -0
- package/dist/lib/SpacePlugin.workerd.mjs.map +1 -0
- package/dist/lib/capabilities/node.mjs +10 -0
- package/dist/lib/capabilities/node.mjs.map +1 -0
- package/dist/lib/capabilities.mjs +24 -0
- package/dist/lib/capabilities.mjs.map +1 -0
- package/dist/lib/chunk-CollectionArticle.mjs +90 -0
- package/dist/lib/chunk-CollectionArticle.mjs.map +1 -0
- package/dist/lib/chunk-CollectionSection.mjs +21 -0
- package/dist/lib/chunk-CollectionSection.mjs.map +1 -0
- package/dist/lib/chunk-CreateObjectDialog.mjs +178 -0
- package/dist/lib/chunk-CreateObjectDialog.mjs.map +1 -0
- package/dist/lib/chunk-CreateSpaceDialog.mjs +68 -0
- package/dist/lib/chunk-CreateSpaceDialog.mjs.map +1 -0
- package/dist/lib/chunk-DefaultProperties.mjs +59 -0
- package/dist/lib/chunk-DefaultProperties.mjs.map +1 -0
- package/dist/lib/chunk-ImportSpaceDialog.mjs +58 -0
- package/dist/lib/chunk-ImportSpaceDialog.mjs.map +1 -0
- package/dist/lib/chunk-InlineSyncStatus.mjs +37 -0
- package/dist/lib/chunk-InlineSyncStatus.mjs.map +1 -0
- package/dist/lib/chunk-JoinDialog.mjs +65 -0
- package/dist/lib/chunk-JoinDialog.mjs.map +1 -0
- package/dist/lib/chunk-MembersContainer.mjs +263 -0
- package/dist/lib/chunk-MembersContainer.mjs.map +1 -0
- package/dist/lib/chunk-MergePreview.mjs +91 -0
- package/dist/lib/chunk-MergePreview.mjs.map +1 -0
- package/dist/lib/chunk-ObjectCardStack.mjs +68 -0
- package/dist/lib/chunk-ObjectCardStack.mjs.map +1 -0
- package/dist/lib/chunk-RecordArticle.mjs +106 -0
- package/dist/lib/chunk-RecordArticle.mjs.map +1 -0
- package/dist/lib/chunk-RelatedArticle.mjs +71 -0
- package/dist/lib/chunk-RelatedArticle.mjs.map +1 -0
- package/dist/lib/chunk-RenamePopover.mjs +94 -0
- package/dist/lib/chunk-RenamePopover.mjs.map +1 -0
- package/dist/lib/chunk-SchemaContainer.mjs +53 -0
- package/dist/lib/chunk-SchemaContainer.mjs.map +1 -0
- package/dist/lib/chunk-SmallPresenceLive.mjs +2 -0
- package/dist/lib/chunk-SpaceHomeArticle.mjs +82 -0
- package/dist/lib/chunk-SpaceHomeArticle.mjs.map +1 -0
- package/dist/lib/chunk-SpaceHomeDashboard.mjs +96 -0
- package/dist/lib/chunk-SpaceHomeDashboard.mjs.map +1 -0
- package/dist/lib/chunk-SpaceHomeRecent.mjs +79 -0
- package/dist/lib/chunk-SpaceHomeRecent.mjs.map +1 -0
- package/dist/lib/chunk-SpacePlugin.mjs +97 -0
- package/dist/lib/chunk-SpacePlugin.mjs.map +1 -0
- package/dist/lib/chunk-SpacePresence.mjs +155 -0
- package/dist/lib/chunk-SpacePresence.mjs.map +1 -0
- package/dist/lib/chunk-SpaceSettings.mjs +63 -0
- package/dist/lib/chunk-SpaceSettings.mjs.map +1 -0
- package/dist/lib/chunk-SpaceSettingsContainer.mjs +278 -0
- package/dist/lib/chunk-SpaceSettingsContainer.mjs.map +1 -0
- package/dist/lib/chunk-SyncStatus.mjs +166 -0
- package/dist/lib/chunk-SyncStatus.mjs.map +1 -0
- package/dist/lib/chunk-TypeArticle.mjs +469 -0
- package/dist/lib/chunk-TypeArticle.mjs.map +1 -0
- package/dist/lib/chunk-ViewEditor.mjs +78 -0
- package/dist/lib/chunk-ViewEditor.mjs.map +1 -0
- package/dist/lib/chunk-add-object.mjs +74 -0
- package/dist/lib/chunk-add-object.mjs.map +1 -0
- package/dist/lib/chunk-add-relation.mjs +16 -0
- package/dist/lib/chunk-add-relation.mjs.map +1 -0
- package/dist/lib/chunk-add-type.mjs +41 -0
- package/dist/lib/chunk-add-type.mjs.map +1 -0
- package/dist/lib/chunk-app-graph-builder.mjs +1056 -0
- package/dist/lib/chunk-app-graph-builder.mjs.map +1 -0
- package/dist/lib/chunk-close.mjs +11 -0
- package/dist/lib/chunk-close.mjs.map +1 -0
- package/dist/lib/chunk-collection-path.mjs +65 -0
- package/dist/lib/chunk-collection-path.mjs.map +1 -0
- package/dist/lib/chunk-create-object.mjs +80 -0
- package/dist/lib/chunk-create-object.mjs.map +1 -0
- package/dist/lib/chunk-create.mjs +62 -0
- package/dist/lib/chunk-create.mjs.map +1 -0
- package/dist/lib/chunk-definitions.mjs +466 -0
- package/dist/lib/chunk-definitions.mjs.map +1 -0
- package/dist/lib/chunk-delete-field.mjs +52 -0
- package/dist/lib/chunk-delete-field.mjs.map +1 -0
- package/dist/lib/chunk-delete.mjs +11 -0
- package/dist/lib/chunk-delete.mjs.map +1 -0
- package/dist/lib/chunk-duplicate-object.mjs +11 -0
- package/dist/lib/chunk-duplicate-object.mjs.map +1 -0
- package/dist/lib/chunk-errors.mjs +10 -0
- package/dist/lib/chunk-errors.mjs.map +1 -0
- package/dist/lib/chunk-export-space.mjs +24 -0
- package/dist/lib/chunk-export-space.mjs.map +1 -0
- package/dist/lib/chunk-find-duplicates.mjs +19 -0
- package/dist/lib/chunk-find-duplicates.mjs.map +1 -0
- package/dist/lib/chunk-get-share-link.mjs +29 -0
- package/dist/lib/chunk-get-share-link.mjs.map +1 -0
- package/dist/lib/chunk-helpers.mjs +14 -0
- package/dist/lib/chunk-helpers.mjs.map +1 -0
- package/dist/lib/chunk-identity-created.mjs +26 -0
- package/dist/lib/chunk-identity-created.mjs.map +1 -0
- package/dist/lib/chunk-import-space.mjs +16 -0
- package/dist/lib/chunk-import-space.mjs.map +1 -0
- package/dist/lib/chunk-join.mjs +35 -0
- package/dist/lib/chunk-join.mjs.map +1 -0
- package/dist/lib/chunk-merge-duplicates.mjs +62 -0
- package/dist/lib/chunk-merge-duplicates.mjs.map +1 -0
- package/dist/lib/{neutral/chunk-5ZZS3KMK.mjs → chunk-meta.mjs} +15 -24
- package/dist/lib/chunk-meta.mjs.map +1 -0
- package/dist/lib/chunk-migrate.mjs +45 -0
- package/dist/lib/chunk-migrate.mjs.map +1 -0
- package/dist/lib/chunk-navigation-handler.mjs +63 -0
- package/dist/lib/chunk-navigation-handler.mjs.map +1 -0
- package/dist/lib/chunk-navigation-target-resolver.mjs +79 -0
- package/dist/lib/chunk-navigation-target-resolver.mjs.map +1 -0
- package/dist/lib/chunk-open-create-object.mjs +32 -0
- package/dist/lib/chunk-open-create-object.mjs.map +1 -0
- package/dist/lib/chunk-open-create-space.mjs +16 -0
- package/dist/lib/chunk-open-create-space.mjs.map +1 -0
- package/dist/lib/chunk-open-import-space.mjs +16 -0
- package/dist/lib/chunk-open-import-space.mjs.map +1 -0
- package/dist/lib/chunk-open-members.mjs +15 -0
- package/dist/lib/chunk-open-members.mjs.map +1 -0
- package/dist/lib/chunk-open-settings.mjs +15 -0
- package/dist/lib/chunk-open-settings.mjs.map +1 -0
- package/dist/lib/chunk-open.mjs +11 -0
- package/dist/lib/chunk-open.mjs.map +1 -0
- package/dist/lib/chunk-operation-handler.mjs +13 -0
- package/dist/lib/chunk-operation-handler.mjs.map +1 -0
- package/dist/lib/chunk-react-root.mjs +20 -0
- package/dist/lib/chunk-react-root.mjs.map +1 -0
- package/dist/lib/chunk-react-surface.mjs +384 -0
- package/dist/lib/chunk-react-surface.mjs.map +1 -0
- package/dist/lib/chunk-remove-objects.mjs +83 -0
- package/dist/lib/chunk-remove-objects.mjs.map +1 -0
- package/dist/lib/chunk-rename-object.mjs +18 -0
- package/dist/lib/chunk-rename-object.mjs.map +1 -0
- package/dist/lib/chunk-rename.mjs +18 -0
- package/dist/lib/chunk-rename.mjs.map +1 -0
- package/dist/lib/chunk-repair.mjs +28 -0
- package/dist/lib/chunk-repair.mjs.map +1 -0
- package/dist/lib/chunk-restore-field.mjs +50 -0
- package/dist/lib/chunk-restore-field.mjs.map +1 -0
- package/dist/lib/chunk-restore-objects.mjs +33 -0
- package/dist/lib/chunk-restore-objects.mjs.map +1 -0
- package/dist/lib/chunk-settings.mjs +23 -0
- package/dist/lib/chunk-settings.mjs.map +1 -0
- package/dist/lib/chunk-share.mjs +23 -0
- package/dist/lib/chunk-share.mjs.map +1 -0
- package/dist/lib/chunk-snapshot.mjs +24 -0
- package/dist/lib/chunk-snapshot.mjs.map +1 -0
- package/dist/lib/chunk-spaces-ready.mjs +242 -0
- package/dist/lib/chunk-spaces-ready.mjs.map +1 -0
- package/dist/lib/chunk-state.mjs +48 -0
- package/dist/lib/chunk-state.mjs.map +1 -0
- package/dist/lib/chunk-types.mjs +56 -0
- package/dist/lib/chunk-types.mjs.map +1 -0
- package/dist/lib/chunk-undo-mappings.mjs +40 -0
- package/dist/lib/chunk-undo-mappings.mjs.map +1 -0
- package/dist/lib/chunk-util.mjs +34 -0
- package/dist/lib/chunk-util.mjs.map +1 -0
- package/dist/lib/chunk-wait-for-object.mjs +16 -0
- package/dist/lib/chunk-wait-for-object.mjs.map +1 -0
- package/dist/lib/components.mjs +329 -0
- package/dist/lib/components.mjs.map +1 -0
- package/dist/lib/{neutral/chunk-C2ULK22J.mjs → constants.mjs} +5 -10
- package/dist/lib/constants.mjs.map +1 -0
- package/dist/lib/containers.mjs +31 -0
- package/dist/lib/containers.mjs.map +1 -0
- package/dist/lib/hooks.mjs +185 -0
- package/dist/lib/hooks.mjs.map +1 -0
- package/dist/lib/index.mjs +7 -0
- package/dist/lib/meta.mjs +2 -0
- package/dist/lib/operations.mjs +8 -0
- package/dist/lib/operations.mjs.map +1 -0
- package/dist/lib/plugin.mjs +9 -0
- package/dist/lib/plugin.mjs.map +1 -0
- package/dist/lib/testing.mjs +2 -0
- package/dist/lib/translations.mjs +350 -0
- package/dist/lib/translations.mjs.map +1 -0
- package/dist/lib/types.mjs +60 -0
- package/dist/lib/types.mjs.map +1 -0
- package/dist/types/src/SpacePlugin.workerd.d.ts.map +1 -1
- package/dist/types/src/capabilities/SpaceFormFields.d.ts +10 -0
- package/dist/types/src/capabilities/SpaceFormFields.d.ts.map +1 -0
- package/dist/types/src/capabilities/SpaceSurfaces.d.ts +50 -0
- package/dist/types/src/capabilities/SpaceSurfaces.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +1 -1
- package/dist/types/src/capabilities/app-graph-builder/extensions/collections.d.ts +6 -1
- package/dist/types/src/capabilities/app-graph-builder/extensions/collections.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder/extensions/companions.d.ts +1 -1
- package/dist/types/src/capabilities/app-graph-builder/extensions/companions.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder/extensions/database.d.ts +7 -1
- package/dist/types/src/capabilities/app-graph-builder/extensions/database.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder/extensions/settings.d.ts +2 -7
- package/dist/types/src/capabilities/app-graph-builder/extensions/settings.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder/extensions/shared.d.ts +3 -2
- package/dist/types/src/capabilities/app-graph-builder/extensions/shared.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder/extensions/spaces.d.ts +5 -0
- package/dist/types/src/capabilities/app-graph-builder/extensions/spaces.d.ts.map +1 -1
- package/dist/types/src/capabilities/create-object.d.ts +1 -1
- package/dist/types/src/capabilities/identity-created.d.ts +1 -1
- package/dist/types/src/capabilities/index.d.ts +1 -1
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/navigation-handler/navigation-handler.d.ts +3 -1
- package/dist/types/src/capabilities/navigation-handler/navigation-handler.d.ts.map +1 -1
- package/dist/types/src/capabilities/navigation-target-resolver.d.ts +5 -0
- package/dist/types/src/capabilities/navigation-target-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/operation-handler.d.ts +1 -1
- package/dist/types/src/capabilities/react-root.d.ts +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/repair.d.ts +1 -1
- package/dist/types/src/capabilities/settings.d.ts +1 -1
- package/dist/types/src/capabilities/spaces-ready.d.ts +1 -1
- package/dist/types/src/capabilities/state.d.ts +1 -1
- package/dist/types/src/capabilities/try-get-view.d.ts +7 -0
- package/dist/types/src/capabilities/try-get-view.d.ts.map +1 -0
- package/dist/types/src/capabilities/undo-mappings.d.ts +1 -1
- package/dist/types/src/collection-path.d.ts +28 -0
- package/dist/types/src/collection-path.d.ts.map +1 -0
- package/dist/types/src/collection-path.test.d.ts +2 -0
- package/dist/types/src/collection-path.test.d.ts.map +1 -0
- package/dist/types/src/commands/space/export/export.d.ts +23 -0
- package/dist/types/src/commands/space/export/export.d.ts.map +1 -0
- package/dist/types/src/commands/space/export/export.test.d.ts +2 -0
- package/dist/types/src/commands/space/export/export.test.d.ts.map +1 -0
- package/dist/types/src/commands/space/export/index.d.ts +2 -0
- package/dist/types/src/commands/space/export/index.d.ts.map +1 -0
- package/dist/types/src/commands/space/import/import.d.ts +17 -0
- package/dist/types/src/commands/space/import/import.d.ts.map +1 -0
- package/dist/types/src/commands/space/import/import.test.d.ts +2 -0
- package/dist/types/src/commands/space/import/import.test.d.ts.map +1 -0
- package/dist/types/src/commands/space/import/index.d.ts +2 -0
- package/dist/types/src/commands/space/import/index.d.ts.map +1 -0
- package/dist/types/src/commands/space/index.d.ts +8 -1
- package/dist/types/src/commands/space/index.d.ts.map +1 -1
- package/dist/types/src/components/AwaitingObject/AwaitingObject.d.ts.map +1 -1
- package/dist/types/src/components/SyncStatus/status.d.ts +7 -4
- package/dist/types/src/components/SyncStatus/status.d.ts.map +1 -1
- package/dist/types/src/components/SyncStatus/status.test.d.ts +2 -0
- package/dist/types/src/components/SyncStatus/status.test.d.ts.map +1 -0
- package/dist/types/src/containers/CollectionArticle/CollectionArticle.d.ts +4 -4
- package/dist/types/src/containers/CollectionArticle/CollectionArticle.d.ts.map +1 -1
- package/dist/types/src/containers/CollectionSection/CollectionSection.d.ts +4 -1
- package/dist/types/src/containers/CollectionSection/CollectionSection.d.ts.map +1 -1
- package/dist/types/src/containers/CreateObjectDialog/CreateObjectDialog.d.ts +4 -1
- package/dist/types/src/containers/CreateObjectDialog/CreateObjectDialog.d.ts.map +1 -1
- package/dist/types/src/containers/CreateObjectDialog/CreateObjectDialog.stories.d.ts +420 -9
- package/dist/types/src/containers/CreateObjectDialog/CreateObjectDialog.stories.d.ts.map +1 -1
- package/dist/types/src/containers/CreateSpaceDialog/CreateSpaceDialog.d.ts +4 -1
- package/dist/types/src/containers/CreateSpaceDialog/CreateSpaceDialog.d.ts.map +1 -1
- package/dist/types/src/containers/CreateSpaceDialog/CreateSpaceDialog.stories.d.ts +423 -10
- package/dist/types/src/containers/CreateSpaceDialog/CreateSpaceDialog.stories.d.ts.map +1 -1
- package/dist/types/src/containers/ImportSpaceDialog/ImportSpaceDialog.d.ts +4 -1
- package/dist/types/src/containers/ImportSpaceDialog/ImportSpaceDialog.d.ts.map +1 -1
- package/dist/types/src/containers/InlineSyncStatus/InlineSyncStatus.d.ts +5 -2
- package/dist/types/src/containers/InlineSyncStatus/InlineSyncStatus.d.ts.map +1 -1
- package/dist/types/src/containers/JoinDialog/JoinDialog.d.ts +4 -1
- package/dist/types/src/containers/JoinDialog/JoinDialog.d.ts.map +1 -1
- package/dist/types/src/containers/JoinDialog/JoinDialog.stories.d.ts +423 -10
- package/dist/types/src/containers/JoinDialog/JoinDialog.stories.d.ts.map +1 -1
- package/dist/types/src/containers/MembersContainer/MembersContainer.d.ts +4 -1
- package/dist/types/src/containers/MembersContainer/MembersContainer.d.ts.map +1 -1
- package/dist/types/src/containers/MergePreview/MergePreview.d.ts +16 -0
- package/dist/types/src/containers/MergePreview/MergePreview.d.ts.map +1 -0
- package/dist/types/src/containers/MergePreview/index.d.ts +2 -0
- package/dist/types/src/containers/MergePreview/index.d.ts.map +1 -0
- package/dist/types/src/containers/ObjectCardStack/ObjectCardStack.d.ts +3 -2
- package/dist/types/src/containers/ObjectCardStack/ObjectCardStack.d.ts.map +1 -1
- package/dist/types/src/containers/RecordArticle/RecordArticle.d.ts +4 -1
- package/dist/types/src/containers/RecordArticle/RecordArticle.d.ts.map +1 -1
- package/dist/types/src/containers/RecordArticle/RecordArticle.stories.d.ts.map +1 -1
- package/dist/types/src/containers/RelatedArticle/RelatedArticle.d.ts +4 -1
- package/dist/types/src/containers/RelatedArticle/RelatedArticle.d.ts.map +1 -1
- package/dist/types/src/containers/RenamePopover/RenamePopover.d.ts +4 -4
- package/dist/types/src/containers/RenamePopover/RenamePopover.d.ts.map +1 -1
- package/dist/types/src/containers/SchemaContainer/SchemaContainer.d.ts +4 -7
- package/dist/types/src/containers/SchemaContainer/SchemaContainer.d.ts.map +1 -1
- package/dist/types/src/containers/SchemaContainer/use-query-space-types.d.ts +7 -0
- package/dist/types/src/containers/SchemaContainer/use-query-space-types.d.ts.map +1 -0
- package/dist/types/src/containers/SpaceHomeArticle/SpaceHomeArticle.d.ts +4 -11
- package/dist/types/src/containers/SpaceHomeArticle/SpaceHomeArticle.d.ts.map +1 -1
- package/dist/types/src/containers/SpaceHomeArticle/SpaceHomeArticle.stories.d.ts +14 -0
- package/dist/types/src/containers/SpaceHomeArticle/SpaceHomeArticle.stories.d.ts.map +1 -0
- package/dist/types/src/containers/SpaceHomeDashboard/SpaceHomeDashboard.d.ts +15 -0
- package/dist/types/src/containers/SpaceHomeDashboard/SpaceHomeDashboard.d.ts.map +1 -0
- package/dist/types/src/containers/SpaceHomeDashboard/SpaceHomeDashboard.stories.d.ts +20 -0
- package/dist/types/src/containers/SpaceHomeDashboard/SpaceHomeDashboard.stories.d.ts.map +1 -0
- package/dist/types/src/containers/SpaceHomeDashboard/index.d.ts +2 -0
- package/dist/types/src/containers/SpaceHomeDashboard/index.d.ts.map +1 -0
- package/dist/types/src/containers/SpaceHomeRecent/SpaceHomeRecent.d.ts +5 -8
- package/dist/types/src/containers/SpaceHomeRecent/SpaceHomeRecent.d.ts.map +1 -1
- package/dist/types/src/containers/SpacePresence/SpacePresence.d.ts +7 -4
- package/dist/types/src/containers/SpacePresence/SpacePresence.d.ts.map +1 -1
- package/dist/types/src/containers/SpacePresence/SpacePresence.stories.d.ts +419 -9
- package/dist/types/src/containers/SpacePresence/SpacePresence.stories.d.ts.map +1 -1
- package/dist/types/src/containers/SpaceSettings/SpaceSettings.d.ts +4 -1
- package/dist/types/src/containers/SpaceSettings/SpaceSettings.d.ts.map +1 -1
- package/dist/types/src/containers/SpaceSettings/SpaceSettings.stories.d.ts +423 -10
- package/dist/types/src/containers/SpaceSettings/SpaceSettings.stories.d.ts.map +1 -1
- package/dist/types/src/containers/SpaceSettingsContainer/SpaceSettingsContainer.stories.d.ts +419 -9
- package/dist/types/src/containers/SpaceSettingsContainer/SpaceSettingsContainer.stories.d.ts.map +1 -1
- package/dist/types/src/containers/SyncStatus/SyncStatus.d.ts +7 -2
- package/dist/types/src/containers/SyncStatus/SyncStatus.d.ts.map +1 -1
- package/dist/types/src/containers/SyncStatus/SyncStatus.stories.d.ts +434 -11
- package/dist/types/src/containers/SyncStatus/SyncStatus.stories.d.ts.map +1 -1
- package/dist/types/src/containers/TypeArticle/TypeArticle.d.ts +14 -0
- package/dist/types/src/containers/TypeArticle/TypeArticle.d.ts.map +1 -0
- package/dist/types/src/containers/TypeArticle/TypeArticle.stories.d.ts +45 -0
- package/dist/types/src/containers/TypeArticle/TypeArticle.stories.d.ts.map +1 -0
- package/dist/types/src/containers/TypeArticle/duplicatesGroup.d.ts +19 -0
- package/dist/types/src/containers/TypeArticle/duplicatesGroup.d.ts.map +1 -0
- package/dist/types/src/containers/TypeArticle/index.d.ts +2 -0
- package/dist/types/src/containers/TypeArticle/index.d.ts.map +1 -0
- package/dist/types/src/containers/TypeArticle/useDuplicates.d.ts +34 -0
- package/dist/types/src/containers/TypeArticle/useDuplicates.d.ts.map +1 -0
- package/dist/types/src/containers/ViewEditor/ViewEditor.d.ts +4 -1
- package/dist/types/src/containers/ViewEditor/ViewEditor.d.ts.map +1 -1
- package/dist/types/src/containers/index.d.ts +3 -2
- package/dist/types/src/containers/index.d.ts.map +1 -1
- package/dist/types/src/errors.d.ts +30 -0
- package/dist/types/src/errors.d.ts.map +1 -1
- package/dist/types/src/hooks/index.d.ts +2 -0
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useEdgeStatus.d.ts +6 -0
- package/dist/types/src/hooks/useEdgeStatus.d.ts.map +1 -0
- package/dist/types/src/hooks/useInputSurfaceLookup.d.ts.map +1 -1
- package/dist/types/src/hooks/useStalled.d.ts +13 -0
- package/dist/types/src/hooks/useStalled.d.ts.map +1 -0
- package/dist/types/src/operations/create.d.ts.map +1 -1
- package/dist/types/src/operations/definitions.d.ts +29 -1
- package/dist/types/src/operations/definitions.d.ts.map +1 -1
- package/dist/types/src/operations/find-duplicates.d.ts +5 -0
- package/dist/types/src/operations/find-duplicates.d.ts.map +1 -0
- package/dist/types/src/operations/helpers.d.ts +3 -0
- package/dist/types/src/operations/helpers.d.ts.map +1 -1
- package/dist/types/src/operations/index.d.ts.map +1 -1
- package/dist/types/src/operations/join.d.ts.map +1 -1
- package/dist/types/src/operations/merge-duplicates.d.ts +5 -0
- package/dist/types/src/operations/merge-duplicates.d.ts.map +1 -0
- package/dist/types/src/operations/open-settings.d.ts.map +1 -1
- package/dist/types/src/operations/remove-objects.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +419 -9
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/type-section-path.d.ts +22 -0
- package/dist/types/src/type-section-path.d.ts.map +1 -0
- package/dist/types/src/type-section-path.test.d.ts +2 -0
- package/dist/types/src/type-section-path.test.d.ts.map +1 -0
- package/dist/types/src/types/capabilities.d.ts +22 -2
- package/dist/types/src/types/capabilities.d.ts.map +1 -1
- package/dist/types/src/types/surface.d.ts +4 -4
- package/dist/types/src/types/surface.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +6 -0
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +87 -72
- package/src/SpacePlugin.ts +6 -6
- package/src/SpacePlugin.workerd.ts +3 -1
- package/src/capabilities/SpaceFormFields.tsx +72 -0
- package/src/capabilities/SpaceSurfaces.tsx +219 -0
- package/src/capabilities/app-graph-builder/extensions/collections.ts +74 -21
- package/src/capabilities/app-graph-builder/extensions/companions.ts +10 -5
- package/src/capabilities/app-graph-builder/extensions/database.ts +64 -57
- package/src/capabilities/app-graph-builder/extensions/settings.ts +23 -13
- package/src/capabilities/app-graph-builder/extensions/shared.ts +3 -2
- package/src/capabilities/app-graph-builder/extensions/spaces.ts +6 -7
- package/src/capabilities/create-object.ts +1 -14
- package/src/capabilities/index.ts +4 -1
- package/src/capabilities/navigation-handler/navigation-handler.ts +27 -7
- package/src/capabilities/navigation-target-resolver.ts +77 -0
- package/src/capabilities/react-surface.ts +274 -0
- package/src/capabilities/spaces-ready.ts +31 -18
- package/src/capabilities/state.ts +3 -1
- package/src/capabilities/try-get-view.ts +24 -0
- package/src/collection-path.test.ts +161 -0
- package/src/collection-path.ts +97 -0
- package/src/commands/space/export/export.test.ts +68 -0
- package/src/commands/space/export/export.ts +118 -0
- package/src/commands/space/export/index.ts +5 -0
- package/src/commands/space/import/import.test.ts +80 -0
- package/src/commands/space/import/import.ts +65 -0
- package/src/commands/space/import/index.ts +5 -0
- package/src/commands/space/index.ts +16 -1
- package/src/components/AwaitingObject/AwaitingObject.tsx +10 -4
- package/src/components/CreateObjectPanel/CreateObjectPanel.tsx +16 -18
- package/src/components/SyncStatus/status.test.ts +49 -0
- package/src/components/SyncStatus/status.ts +25 -12
- package/src/containers/CollectionArticle/CollectionArticle.tsx +5 -3
- package/src/containers/CollectionSection/CollectionSection.tsx +2 -0
- package/src/containers/CreateObjectDialog/CreateObjectDialog.stories.tsx +18 -4
- package/src/containers/CreateObjectDialog/CreateObjectDialog.tsx +13 -17
- package/src/containers/CreateSpaceDialog/CreateSpaceDialog.tsx +28 -19
- package/src/containers/DefaultProperties/DefaultProperties.tsx +4 -2
- package/src/containers/ImportSpaceDialog/ImportSpaceDialog.tsx +4 -2
- package/src/containers/InlineSyncStatus/InlineSyncStatus.tsx +7 -17
- package/src/containers/JoinDialog/JoinDialog.tsx +5 -3
- package/src/containers/MembersContainer/MembersContainer.tsx +2 -0
- package/src/containers/MergePreview/MergePreview.tsx +90 -0
- package/src/containers/MergePreview/index.ts +5 -0
- package/src/containers/ObjectCardStack/ObjectCardStack.tsx +46 -43
- package/src/containers/RecordArticle/RecordArticle.stories.tsx +2 -1
- package/src/containers/RecordArticle/RecordArticle.tsx +8 -4
- package/src/containers/RelatedArticle/RelatedArticle.tsx +7 -3
- package/src/containers/RenamePopover/RenamePopover.tsx +2 -0
- package/src/containers/SchemaContainer/SchemaContainer.tsx +4 -17
- package/src/containers/SchemaContainer/use-query-space-types.ts +28 -0
- package/src/containers/SpaceHomeArticle/SpaceHomeArticle.stories.tsx +116 -0
- package/src/containers/SpaceHomeArticle/SpaceHomeArticle.tsx +6 -5
- package/src/containers/SpaceHomeDashboard/SpaceHomeDashboard.stories.tsx +99 -0
- package/src/containers/SpaceHomeDashboard/SpaceHomeDashboard.tsx +109 -0
- package/src/containers/SpaceHomeDashboard/index.ts +5 -0
- package/src/containers/SpaceHomeRecent/SpaceHomeRecent.tsx +17 -15
- package/src/containers/SpacePresence/SpacePresence.stories.tsx +4 -4
- package/src/containers/SpacePresence/SpacePresence.tsx +37 -36
- package/src/containers/SpaceSettings/SpaceSettings.tsx +3 -1
- package/src/containers/SpaceSettingsContainer/SpaceSettingsContainer.tsx +7 -2
- package/src/containers/SyncStatus/SyncStatus.stories.tsx +80 -1
- package/src/containers/SyncStatus/SyncStatus.tsx +36 -46
- package/src/containers/TypeArticle/TypeArticle.stories.tsx +249 -0
- package/src/containers/TypeArticle/TypeArticle.tsx +362 -0
- package/src/containers/TypeArticle/duplicatesGroup.tsx +150 -0
- package/src/containers/TypeArticle/index.ts +5 -0
- package/src/containers/TypeArticle/useDuplicates.ts +119 -0
- package/src/containers/ViewEditor/ViewEditor.tsx +3 -1
- package/src/containers/index.ts +3 -2
- package/src/errors.ts +6 -0
- package/src/hooks/index.ts +2 -0
- package/src/hooks/useEdgeStatus.ts +40 -0
- package/src/hooks/useInputSurfaceLookup.tsx +5 -4
- package/src/hooks/useRelatedObjects.ts +1 -1
- package/src/hooks/useStalled.ts +39 -0
- package/src/operations/add-object.ts +7 -7
- package/src/operations/create.ts +11 -3
- package/src/operations/definitions.ts +54 -1
- package/src/operations/find-duplicates.ts +33 -0
- package/src/operations/get-share-link.ts +1 -1
- package/src/operations/helpers.ts +11 -0
- package/src/operations/index.ts +2 -0
- package/src/operations/join.ts +6 -5
- package/src/operations/merge-duplicates.ts +51 -0
- package/src/operations/open-members.ts +3 -3
- package/src/operations/open-settings.ts +5 -3
- package/src/operations/remove-objects.ts +42 -3
- package/src/translations.ts +52 -11
- package/src/type-section-path.test.ts +48 -0
- package/src/type-section-path.ts +39 -0
- package/src/types/capabilities.ts +26 -2
- package/src/types/surface.ts +4 -8
- package/src/types/types.ts +7 -0
- package/dist/lib/neutral/CollectionArticle-BMH7SZ7Q.mjs +0 -93
- package/dist/lib/neutral/CollectionArticle-BMH7SZ7Q.mjs.map +0 -7
- package/dist/lib/neutral/CollectionSection-BLYTGOKH.mjs +0 -19
- package/dist/lib/neutral/CollectionSection-BLYTGOKH.mjs.map +0 -7
- package/dist/lib/neutral/CreateObjectDialog-5454N3FJ.mjs +0 -221
- package/dist/lib/neutral/CreateObjectDialog-5454N3FJ.mjs.map +0 -7
- package/dist/lib/neutral/CreateSpaceDialog-WWNUTLVK.mjs +0 -61
- package/dist/lib/neutral/CreateSpaceDialog-WWNUTLVK.mjs.map +0 -7
- package/dist/lib/neutral/DefaultProperties-5SAWQC6I.mjs +0 -58
- package/dist/lib/neutral/DefaultProperties-5SAWQC6I.mjs.map +0 -7
- package/dist/lib/neutral/ImportSpaceDialog-CSSRTFAO.mjs +0 -64
- package/dist/lib/neutral/ImportSpaceDialog-CSSRTFAO.mjs.map +0 -7
- package/dist/lib/neutral/InlineSyncStatus-UOUTAPCU.mjs +0 -49
- package/dist/lib/neutral/InlineSyncStatus-UOUTAPCU.mjs.map +0 -7
- package/dist/lib/neutral/JoinDialog-ATNUCNL2.mjs +0 -97
- package/dist/lib/neutral/JoinDialog-ATNUCNL2.mjs.map +0 -7
- package/dist/lib/neutral/MembersContainer-C4ZTP6ZW.mjs +0 -231
- package/dist/lib/neutral/MembersContainer-C4ZTP6ZW.mjs.map +0 -7
- package/dist/lib/neutral/MenuFooter-FWE5LFM4.mjs +0 -33
- package/dist/lib/neutral/MenuFooter-FWE5LFM4.mjs.map +0 -7
- package/dist/lib/neutral/ObjectCardStack-DHVDRNRK.mjs +0 -55
- package/dist/lib/neutral/ObjectCardStack-DHVDRNRK.mjs.map +0 -7
- package/dist/lib/neutral/RecordArticle-JSORXRAA.mjs +0 -102
- package/dist/lib/neutral/RecordArticle-JSORXRAA.mjs.map +0 -7
- package/dist/lib/neutral/RelatedArticle-Z777WVDW.mjs +0 -69
- package/dist/lib/neutral/RelatedArticle-Z777WVDW.mjs.map +0 -7
- package/dist/lib/neutral/RenamePopover-AZT2KPOF.mjs +0 -104
- package/dist/lib/neutral/RenamePopover-AZT2KPOF.mjs.map +0 -7
- package/dist/lib/neutral/SchemaContainer-4GJKQBXM.mjs +0 -53
- package/dist/lib/neutral/SchemaContainer-4GJKQBXM.mjs.map +0 -7
- package/dist/lib/neutral/SmallPresenceLive-FW3AMEY5.mjs +0 -8
- package/dist/lib/neutral/SmallPresenceLive-FW3AMEY5.mjs.map +0 -7
- package/dist/lib/neutral/SpaceHomeArticle-Y47TLZ72.mjs +0 -78
- package/dist/lib/neutral/SpaceHomeArticle-Y47TLZ72.mjs.map +0 -7
- package/dist/lib/neutral/SpaceHomeRecent-S57AO3EV.mjs +0 -89
- package/dist/lib/neutral/SpaceHomeRecent-S57AO3EV.mjs.map +0 -7
- package/dist/lib/neutral/SpacePlugin.mjs +0 -10
- package/dist/lib/neutral/SpacePlugin.mjs.map +0 -7
- package/dist/lib/neutral/SpacePlugin.node.mjs +0 -838
- package/dist/lib/neutral/SpacePlugin.node.mjs.map +0 -7
- package/dist/lib/neutral/SpacePlugin.workerd.mjs +0 -34
- package/dist/lib/neutral/SpacePlugin.workerd.mjs.map +0 -7
- package/dist/lib/neutral/SpacePresence-T37WH43Y.mjs +0 -11
- package/dist/lib/neutral/SpacePresence-T37WH43Y.mjs.map +0 -7
- package/dist/lib/neutral/SpaceSettings-6CZF7GEO.mjs +0 -60
- package/dist/lib/neutral/SpaceSettings-6CZF7GEO.mjs.map +0 -7
- package/dist/lib/neutral/SpaceSettingsContainer-72CJWELM.mjs +0 -279
- package/dist/lib/neutral/SpaceSettingsContainer-72CJWELM.mjs.map +0 -7
- package/dist/lib/neutral/SyncStatus-J7CHLO5O.mjs +0 -147
- package/dist/lib/neutral/SyncStatus-J7CHLO5O.mjs.map +0 -7
- package/dist/lib/neutral/TypeCollectionArticle-W76ADS2G.mjs +0 -143
- package/dist/lib/neutral/TypeCollectionArticle-W76ADS2G.mjs.map +0 -7
- package/dist/lib/neutral/ViewEditor-QXRUOKXR.mjs +0 -101
- package/dist/lib/neutral/ViewEditor-QXRUOKXR.mjs.map +0 -7
- package/dist/lib/neutral/add-object-H2N4AOQJ.mjs +0 -77
- package/dist/lib/neutral/add-object-H2N4AOQJ.mjs.map +0 -7
- package/dist/lib/neutral/add-relation-BGTLART5.mjs +0 -26
- package/dist/lib/neutral/add-relation-BGTLART5.mjs.map +0 -7
- package/dist/lib/neutral/add-type-JIDLRANR.mjs +0 -57
- package/dist/lib/neutral/add-type-JIDLRANR.mjs.map +0 -7
- package/dist/lib/neutral/app-graph-builder-7H2KOD4B.mjs +0 -1332
- package/dist/lib/neutral/app-graph-builder-7H2KOD4B.mjs.map +0 -7
- package/dist/lib/neutral/capabilities/index.mjs +0 -46
- package/dist/lib/neutral/capabilities/index.mjs.map +0 -7
- package/dist/lib/neutral/capabilities/node.mjs +0 -15
- package/dist/lib/neutral/capabilities/node.mjs.map +0 -7
- package/dist/lib/neutral/chunk-52ASDNRA.mjs +0 -41
- package/dist/lib/neutral/chunk-52ASDNRA.mjs.map +0 -7
- package/dist/lib/neutral/chunk-5ZZS3KMK.mjs.map +0 -7
- package/dist/lib/neutral/chunk-C2ULK22J.mjs.map +0 -7
- package/dist/lib/neutral/chunk-F5KLUP2P.mjs +0 -115
- package/dist/lib/neutral/chunk-F5KLUP2P.mjs.map +0 -7
- package/dist/lib/neutral/chunk-G2KHP7FX.mjs +0 -8
- package/dist/lib/neutral/chunk-G2KHP7FX.mjs.map +0 -7
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs +0 -10
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs.map +0 -7
- package/dist/lib/neutral/chunk-LMUG6PEJ.mjs +0 -572
- package/dist/lib/neutral/chunk-LMUG6PEJ.mjs.map +0 -7
- package/dist/lib/neutral/chunk-RAAHDTVF.mjs +0 -167
- package/dist/lib/neutral/chunk-RAAHDTVF.mjs.map +0 -7
- package/dist/lib/neutral/chunk-SPWAMXNR.mjs +0 -131
- package/dist/lib/neutral/chunk-SPWAMXNR.mjs.map +0 -7
- package/dist/lib/neutral/chunk-U5WTDOMV.mjs +0 -8
- package/dist/lib/neutral/chunk-U5WTDOMV.mjs.map +0 -7
- package/dist/lib/neutral/chunk-V7JALUM3.mjs +0 -9
- package/dist/lib/neutral/chunk-V7JALUM3.mjs.map +0 -7
- package/dist/lib/neutral/close-5WEQZRNK.mjs +0 -17
- package/dist/lib/neutral/close-5WEQZRNK.mjs.map +0 -7
- package/dist/lib/neutral/components/index.mjs +0 -401
- package/dist/lib/neutral/components/index.mjs.map +0 -7
- package/dist/lib/neutral/constants.mjs +0 -16
- package/dist/lib/neutral/constants.mjs.map +0 -7
- package/dist/lib/neutral/containers/index.mjs +0 -55
- package/dist/lib/neutral/containers/index.mjs.map +0 -7
- package/dist/lib/neutral/create-QZ47FHQU.mjs +0 -75
- package/dist/lib/neutral/create-QZ47FHQU.mjs.map +0 -7
- package/dist/lib/neutral/create-object-ZU6FZW5X.mjs +0 -96
- package/dist/lib/neutral/create-object-ZU6FZW5X.mjs.map +0 -7
- package/dist/lib/neutral/delete-SPCU2VFM.mjs +0 -17
- package/dist/lib/neutral/delete-SPCU2VFM.mjs.map +0 -7
- package/dist/lib/neutral/delete-field-TAKJVEAD.mjs +0 -42
- package/dist/lib/neutral/delete-field-TAKJVEAD.mjs.map +0 -7
- package/dist/lib/neutral/duplicate-object-BUPZOO6S.mjs +0 -17
- package/dist/lib/neutral/duplicate-object-BUPZOO6S.mjs.map +0 -7
- package/dist/lib/neutral/export-space-S5SCAL4M.mjs +0 -34
- package/dist/lib/neutral/export-space-S5SCAL4M.mjs.map +0 -7
- package/dist/lib/neutral/get-share-link-CLM5IQRL.mjs +0 -41
- package/dist/lib/neutral/get-share-link-CLM5IQRL.mjs.map +0 -7
- package/dist/lib/neutral/hooks/index.mjs +0 -133
- package/dist/lib/neutral/hooks/index.mjs.map +0 -7
- package/dist/lib/neutral/identity-created-BEYMLBK4.mjs +0 -32
- package/dist/lib/neutral/identity-created-BEYMLBK4.mjs.map +0 -7
- package/dist/lib/neutral/import-space-LJQK3KT7.mjs +0 -28
- package/dist/lib/neutral/import-space-LJQK3KT7.mjs.map +0 -7
- package/dist/lib/neutral/index.mjs +0 -62
- package/dist/lib/neutral/index.mjs.map +0 -7
- package/dist/lib/neutral/join-FSODYIOC.mjs +0 -54
- package/dist/lib/neutral/join-FSODYIOC.mjs.map +0 -7
- package/dist/lib/neutral/meta.json +0 -1
- package/dist/lib/neutral/meta.mjs +0 -8
- package/dist/lib/neutral/meta.mjs.map +0 -7
- package/dist/lib/neutral/migrate-WHM6LU7L.mjs +0 -52
- package/dist/lib/neutral/migrate-WHM6LU7L.mjs.map +0 -7
- package/dist/lib/neutral/navigation-handler-ZF7MV2HL.mjs +0 -44
- package/dist/lib/neutral/navigation-handler-ZF7MV2HL.mjs.map +0 -7
- package/dist/lib/neutral/navigation-resolver-KBESOSWU.mjs +0 -82
- package/dist/lib/neutral/navigation-resolver-KBESOSWU.mjs.map +0 -7
- package/dist/lib/neutral/open-JCXTL3SK.mjs +0 -17
- package/dist/lib/neutral/open-JCXTL3SK.mjs.map +0 -7
- package/dist/lib/neutral/open-create-object-WAIAU7TA.mjs +0 -42
- package/dist/lib/neutral/open-create-object-WAIAU7TA.mjs.map +0 -7
- package/dist/lib/neutral/open-create-space-VU47FWPZ.mjs +0 -24
- package/dist/lib/neutral/open-create-space-VU47FWPZ.mjs.map +0 -7
- package/dist/lib/neutral/open-import-space-GUHIEWYB.mjs +0 -24
- package/dist/lib/neutral/open-import-space-GUHIEWYB.mjs.map +0 -7
- package/dist/lib/neutral/open-members-MLLBHKUU.mjs +0 -23
- package/dist/lib/neutral/open-members-MLLBHKUU.mjs.map +0 -7
- package/dist/lib/neutral/open-settings-DTPZF4U4.mjs +0 -23
- package/dist/lib/neutral/open-settings-DTPZF4U4.mjs.map +0 -7
- package/dist/lib/neutral/operation-handler-YPIRQOH2.mjs +0 -13
- package/dist/lib/neutral/operation-handler-YPIRQOH2.mjs.map +0 -7
- package/dist/lib/neutral/operations/index.mjs +0 -13
- package/dist/lib/neutral/operations/index.mjs.map +0 -7
- package/dist/lib/neutral/plugin.mjs +0 -18
- package/dist/lib/neutral/plugin.mjs.map +0 -7
- package/dist/lib/neutral/react-root-YLYRCSAZ.mjs +0 -23
- package/dist/lib/neutral/react-root-YLYRCSAZ.mjs.map +0 -7
- package/dist/lib/neutral/react-surface-LRA7GIFN.mjs +0 -367
- package/dist/lib/neutral/react-surface-LRA7GIFN.mjs.map +0 -7
- package/dist/lib/neutral/remove-objects-WEO66EDS.mjs +0 -55
- package/dist/lib/neutral/remove-objects-WEO66EDS.mjs.map +0 -7
- package/dist/lib/neutral/rename-Q6UNCBIM.mjs +0 -26
- package/dist/lib/neutral/rename-Q6UNCBIM.mjs.map +0 -7
- package/dist/lib/neutral/rename-object-2UCEGU7U.mjs +0 -26
- package/dist/lib/neutral/rename-object-2UCEGU7U.mjs.map +0 -7
- package/dist/lib/neutral/repair-HMH476U3.mjs +0 -32
- package/dist/lib/neutral/repair-HMH476U3.mjs.map +0 -7
- package/dist/lib/neutral/restore-field-6CQAFOXY.mjs +0 -40
- package/dist/lib/neutral/restore-field-6CQAFOXY.mjs.map +0 -7
- package/dist/lib/neutral/restore-objects-3VINLP7C.mjs +0 -39
- package/dist/lib/neutral/restore-objects-3VINLP7C.mjs.map +0 -7
- package/dist/lib/neutral/settings-5IBSYBVU.mjs +0 -28
- package/dist/lib/neutral/settings-5IBSYBVU.mjs.map +0 -7
- package/dist/lib/neutral/share-A4WPILNF.mjs +0 -31
- package/dist/lib/neutral/share-A4WPILNF.mjs.map +0 -7
- package/dist/lib/neutral/snapshot-HBYMAPA7.mjs +0 -30
- package/dist/lib/neutral/snapshot-HBYMAPA7.mjs.map +0 -7
- package/dist/lib/neutral/spaces-ready-GWMSU72V.mjs +0 -281
- package/dist/lib/neutral/spaces-ready-GWMSU72V.mjs.map +0 -7
- package/dist/lib/neutral/state-KMH2NUAL.mjs +0 -55
- package/dist/lib/neutral/state-KMH2NUAL.mjs.map +0 -7
- package/dist/lib/neutral/testing.mjs +0 -8
- package/dist/lib/neutral/testing.mjs.map +0 -7
- package/dist/lib/neutral/translations.mjs +0 -315
- package/dist/lib/neutral/translations.mjs.map +0 -7
- package/dist/lib/neutral/types/index.mjs +0 -40
- package/dist/lib/neutral/types/index.mjs.map +0 -7
- package/dist/lib/neutral/undo-mappings-P43EAUGI.mjs +0 -68
- package/dist/lib/neutral/undo-mappings-P43EAUGI.mjs.map +0 -7
- package/dist/lib/neutral/wait-for-object-U6P2NNWY.mjs +0 -23
- package/dist/lib/neutral/wait-for-object-U6P2NNWY.mjs.map +0 -7
- package/dist/types/src/capabilities/navigation-resolver.d.ts +0 -5
- package/dist/types/src/capabilities/navigation-resolver.d.ts.map +0 -1
- package/dist/types/src/containers/MenuFooter/MenuFooter.d.ts +0 -6
- package/dist/types/src/containers/MenuFooter/MenuFooter.d.ts.map +0 -1
- package/dist/types/src/containers/MenuFooter/index.d.ts +0 -2
- package/dist/types/src/containers/MenuFooter/index.d.ts.map +0 -1
- package/dist/types/src/containers/TypeCollectionArticle/TypeCollectionArticle.d.ts +0 -16
- package/dist/types/src/containers/TypeCollectionArticle/TypeCollectionArticle.d.ts.map +0 -1
- package/dist/types/src/containers/TypeCollectionArticle/TypeCollectionArticle.stories.d.ts +0 -21
- package/dist/types/src/containers/TypeCollectionArticle/TypeCollectionArticle.stories.d.ts.map +0 -1
- package/dist/types/src/containers/TypeCollectionArticle/index.d.ts +0 -2
- package/dist/types/src/containers/TypeCollectionArticle/index.d.ts.map +0 -1
- package/src/capabilities/navigation-resolver.ts +0 -94
- package/src/capabilities/react-surface.tsx +0 -395
- package/src/containers/MenuFooter/MenuFooter.tsx +0 -33
- package/src/containers/MenuFooter/index.ts +0 -5
- package/src/containers/TypeCollectionArticle/TypeCollectionArticle.stories.tsx +0 -116
- package/src/containers/TypeCollectionArticle/TypeCollectionArticle.tsx +0 -162
- package/src/containers/TypeCollectionArticle/index.ts +0 -5
|
@@ -0,0 +1,1056 @@
|
|
|
1
|
+
import { a as SHARED } from "./chunk-types.mjs";
|
|
2
|
+
import { n as getSpaceDisplayName, r as makeCreateObjectEntryForDatabaseType } from "./chunk-util.mjs";
|
|
3
|
+
import { t as resolveCollectionObjectPath } from "./chunk-collection-path.mjs";
|
|
4
|
+
import { Capability } from "@dxos/app-framework";
|
|
5
|
+
import { Position, createFilename, isNonNullable } from "@dxos/util";
|
|
6
|
+
import { meta } from "#meta";
|
|
7
|
+
import { AppAnnotation, AppCapabilities, AppNode, AppNodeMatcher, AppSpace, GraphPath, LayoutOperation, UrlResolution } from "@dxos/app-toolkit";
|
|
8
|
+
import * as Effect from "effect/Effect";
|
|
9
|
+
import { SpaceState, isSpace } from "@dxos/client/echo";
|
|
10
|
+
import { Operation } from "@dxos/compute";
|
|
11
|
+
import { Annotation, Collection, Database, Entity, Filter, Obj, Query, Scope, Type } from "@dxos/echo";
|
|
12
|
+
import { SpaceOperation } from "#operations";
|
|
13
|
+
import { SpaceArchive } from "@dxos/protocols/proto/dxos/client/services";
|
|
14
|
+
import { ClientCapabilities } from "@dxos/plugin-client";
|
|
15
|
+
import { Expando, ViewAnnotation, getTypeURIFromQuery } from "@dxos/schema";
|
|
16
|
+
import { SETTINGS_SECTION_ID, SETTINGS_SECTION_TYPE, SPACE_HOME_NODE_TYPE, SPACE_TYPE, SpaceCapabilities } from "#types";
|
|
17
|
+
import * as Option from "effect/Option";
|
|
18
|
+
import { HiddenAnnotation } from "@dxos/echo/Annotation";
|
|
19
|
+
import { SpaceId } from "@dxos/keys";
|
|
20
|
+
import * as Match from "effect/Match";
|
|
21
|
+
import { invariant } from "@dxos/invariant";
|
|
22
|
+
import { log } from "@dxos/log";
|
|
23
|
+
import { CreateAtom, Graph, GraphBuilder, Node, NodeMatcher } from "@dxos/plugin-graph";
|
|
24
|
+
import { MigrationVersionAnnotation, Migrations } from "@dxos/migrations";
|
|
25
|
+
import { isLabel, toLocalizedString } from "@dxos/ui-types/translations";
|
|
26
|
+
//#region src/capabilities/app-graph-builder/extensions/shared.ts
|
|
27
|
+
var DATABASE_SECTION_TYPE = `${meta.profile.key}.database`;
|
|
28
|
+
var COLLECTIONS_SECTION_TYPE = `${meta.profile.key}.collections`;
|
|
29
|
+
/** Tags every type node under the Database section — both static (compile-time) and database (dynamic) schemas. */
|
|
30
|
+
var SCHEMA_NODE_TYPE = `${meta.profile.key}.static-schema`;
|
|
31
|
+
/** Shared translation namespace descriptor. */
|
|
32
|
+
var META_NS = { ns: meta.profile.key };
|
|
33
|
+
var CAN_DROP_SPACE = (source) => Obj.isObject(source.item.data) || isSpace(source.item.data);
|
|
34
|
+
var spaceActionsCache = /* @__PURE__ */ new Map();
|
|
35
|
+
var spaceRearrangeCache = /* @__PURE__ */ new Map();
|
|
36
|
+
var ADD_VIEW_TO_SCHEMA_LABEL = ["add-view-to-schema.label", META_NS];
|
|
37
|
+
var COPY_LINK_LABEL = ["copy-link.label", META_NS];
|
|
38
|
+
var CREATE_OBJECT_IN_COLLECTION_LABEL = ["create-object-in-collection.label", META_NS];
|
|
39
|
+
var CREATE_OBJECT_IN_SPACE_LABEL = ["create-object-in-space.label", META_NS];
|
|
40
|
+
var EXPOSE_OBJECT_LABEL = ["expose-object.label", META_NS];
|
|
41
|
+
var MIGRATE_SPACE_LABEL = ["migrate-space.label", META_NS];
|
|
42
|
+
var RENAME_SPACE_LABEL = ["rename-space.label", META_NS];
|
|
43
|
+
var SNAPSHOT_BY_SCHEMA_LABEL = ["snapshot-by-schema.label", META_NS];
|
|
44
|
+
var checkPendingMigration = (space) => {
|
|
45
|
+
return space.state.get() === SpaceState.SPACE_REQUIRES_MIGRATION || space.state.get() === SpaceState.SPACE_READY && !!Migrations.targetVersion && Annotation.get(space.properties, MigrationVersionAnnotation).pipe(Option.getOrUndefined) !== Migrations.targetVersion;
|
|
46
|
+
};
|
|
47
|
+
var downloadBlob = async (blob, filename) => {
|
|
48
|
+
const url = URL.createObjectURL(blob);
|
|
49
|
+
const anchor = document.createElement("a");
|
|
50
|
+
anchor.href = url;
|
|
51
|
+
anchor.download = filename;
|
|
52
|
+
document.body.appendChild(anchor);
|
|
53
|
+
anchor.click();
|
|
54
|
+
document.body.removeChild(anchor);
|
|
55
|
+
URL.revokeObjectURL(url);
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* Builds an index of view objects by scanning view-annotated schemas and resolving the target
|
|
59
|
+
* type URI from each view's query AST. Only straightforward views whose query resolves to a
|
|
60
|
+
* type URI via getTypeURIFromQuery are included.
|
|
61
|
+
*/
|
|
62
|
+
var buildViewIndex = (get, space, schemas) => {
|
|
63
|
+
const viewSchemas = schemas.filter((schema) => ViewAnnotation.has(schema));
|
|
64
|
+
const viewsByTypeUri = /* @__PURE__ */ new Map();
|
|
65
|
+
const viewObjectIds = /* @__PURE__ */ new Set();
|
|
66
|
+
if (viewSchemas.length > 0) {
|
|
67
|
+
const filter = Filter.or(...viewSchemas.map((schema) => Filter.type(schema)));
|
|
68
|
+
const viewObjects = get(space.db.query(filter).atom);
|
|
69
|
+
for (const viewObject of viewObjects) {
|
|
70
|
+
if (!Obj.isObject(viewObject)) continue;
|
|
71
|
+
const holderType = Obj.getType(viewObject);
|
|
72
|
+
const path = holderType ? ViewAnnotation.get(Type.getSchema(holderType)).pipe(Option.getOrElse(() => [])) : [];
|
|
73
|
+
if (path.length === 0) continue;
|
|
74
|
+
let holder = get(Obj.atom(viewObject));
|
|
75
|
+
for (const segment of path) holder = holder == null || typeof holder !== "object" ? void 0 : holder[segment];
|
|
76
|
+
if (holder != null) viewObjectIds.add(viewObject.id);
|
|
77
|
+
const typeUri = getTypeURIFromQuery((holder != null ? get(Obj.atom(holder)) : void 0)?.query?.ast);
|
|
78
|
+
if (typeUri) {
|
|
79
|
+
const existing = viewsByTypeUri.get(typeUri) ?? [];
|
|
80
|
+
existing.push(viewObject);
|
|
81
|
+
viewsByTypeUri.set(typeUri, existing);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return {
|
|
86
|
+
typeUrisWithViews: new Set(viewsByTypeUri.keys()),
|
|
87
|
+
getViewsForTypeUri: (typeUri) => viewsByTypeUri.get(typeUri) ?? [],
|
|
88
|
+
isView: (object) => viewObjectIds.has(object.id)
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
//#endregion
|
|
92
|
+
//#region src/capabilities/app-graph-builder/extensions/spaces.ts
|
|
93
|
+
var SPACE_HOME_NODE_LABEL = ["space-home-node.label", { ns: meta.profile.key }];
|
|
94
|
+
/** Creates space-related extensions: primary actions, space nodes, space actions, and the Home node. */
|
|
95
|
+
var createSpaceExtensions = Effect.fnUntraced(function* () {
|
|
96
|
+
const capabilities = yield* Capability.Service;
|
|
97
|
+
return yield* Effect.all([
|
|
98
|
+
GraphBuilder.createExtension({
|
|
99
|
+
id: "spaceHome",
|
|
100
|
+
position: Position.first,
|
|
101
|
+
url: {
|
|
102
|
+
key: "home",
|
|
103
|
+
kind: "singleton",
|
|
104
|
+
path: []
|
|
105
|
+
},
|
|
106
|
+
match: AppNodeMatcher.whenSpace,
|
|
107
|
+
connector: (space) => Effect.succeed([{
|
|
108
|
+
id: GraphPath.SPACE_HOME_SEGMENT,
|
|
109
|
+
type: SPACE_HOME_NODE_TYPE,
|
|
110
|
+
data: SPACE_HOME_NODE_TYPE,
|
|
111
|
+
properties: {
|
|
112
|
+
label: SPACE_HOME_NODE_LABEL,
|
|
113
|
+
icon: "ph--house--regular",
|
|
114
|
+
iconHue: "emerald",
|
|
115
|
+
position: Position.first,
|
|
116
|
+
draggable: false,
|
|
117
|
+
droppable: false,
|
|
118
|
+
space
|
|
119
|
+
}
|
|
120
|
+
}])
|
|
121
|
+
}),
|
|
122
|
+
GraphBuilder.createExtension({
|
|
123
|
+
id: "primaryActions",
|
|
124
|
+
position: Position.first,
|
|
125
|
+
match: NodeMatcher.whenRoot,
|
|
126
|
+
actions: () => Effect.succeed([
|
|
127
|
+
Node.makeAction({
|
|
128
|
+
id: SpaceOperation.OpenCreateSpace.meta.key,
|
|
129
|
+
data: () => Operation.invoke(SpaceOperation.OpenCreateSpace),
|
|
130
|
+
properties: {
|
|
131
|
+
label: ["create-space.label", { ns: meta.profile.key }],
|
|
132
|
+
icon: "ph--plus--regular",
|
|
133
|
+
testId: "spacePlugin.createSpace",
|
|
134
|
+
disposition: "menu"
|
|
135
|
+
}
|
|
136
|
+
}),
|
|
137
|
+
Node.makeAction({
|
|
138
|
+
id: SpaceOperation.Join.meta.key,
|
|
139
|
+
data: () => Operation.invoke(SpaceOperation.Join, {}),
|
|
140
|
+
properties: {
|
|
141
|
+
label: ["join-space.label", { ns: meta.profile.key }],
|
|
142
|
+
icon: "ph--sign-in--regular",
|
|
143
|
+
testId: "spacePlugin.joinSpace",
|
|
144
|
+
disposition: "menu"
|
|
145
|
+
}
|
|
146
|
+
}),
|
|
147
|
+
Node.makeAction({
|
|
148
|
+
id: SpaceOperation.OpenImportSpace.meta.key,
|
|
149
|
+
data: () => Operation.invoke(SpaceOperation.OpenImportSpace),
|
|
150
|
+
properties: {
|
|
151
|
+
label: ["import-space.label", { ns: meta.profile.key }],
|
|
152
|
+
icon: "ph--upload--regular",
|
|
153
|
+
testId: "spacePlugin.importSpace"
|
|
154
|
+
}
|
|
155
|
+
}),
|
|
156
|
+
Node.makeAction({
|
|
157
|
+
id: `${SpaceOperation.ExportSpace.meta.key}.binary`,
|
|
158
|
+
data: Effect.fnUntraced(function* () {
|
|
159
|
+
const client = yield* Capability.get(ClientCapabilities.Client);
|
|
160
|
+
const space = AppSpace.getActiveSpace(client, capabilities) ?? AppSpace.getPersonalSpace(client);
|
|
161
|
+
if (space) yield* Operation.invoke(SpaceOperation.ExportSpace, {
|
|
162
|
+
space,
|
|
163
|
+
format: SpaceArchive.Format.BINARY
|
|
164
|
+
});
|
|
165
|
+
}),
|
|
166
|
+
properties: {
|
|
167
|
+
label: ["export-space-binary.label", { ns: meta.profile.key }],
|
|
168
|
+
icon: "ph--download--regular",
|
|
169
|
+
testId: "spacePlugin.exportSpaceBinary"
|
|
170
|
+
}
|
|
171
|
+
}),
|
|
172
|
+
Node.makeAction({
|
|
173
|
+
id: `${SpaceOperation.ExportSpace.meta.key}.json`,
|
|
174
|
+
data: Effect.fnUntraced(function* () {
|
|
175
|
+
const client = yield* Capability.get(ClientCapabilities.Client);
|
|
176
|
+
const space = AppSpace.getActiveSpace(client, capabilities) ?? AppSpace.getPersonalSpace(client);
|
|
177
|
+
if (space) yield* Operation.invoke(SpaceOperation.ExportSpace, {
|
|
178
|
+
space,
|
|
179
|
+
format: SpaceArchive.Format.JSON
|
|
180
|
+
});
|
|
181
|
+
}),
|
|
182
|
+
properties: {
|
|
183
|
+
label: ["export-space-json.label", { ns: meta.profile.key }],
|
|
184
|
+
icon: "ph--download--regular",
|
|
185
|
+
testId: "spacePlugin.exportSpaceJson"
|
|
186
|
+
}
|
|
187
|
+
}),
|
|
188
|
+
Node.makeAction({
|
|
189
|
+
id: SpaceOperation.OpenMembers.meta.key,
|
|
190
|
+
data: Effect.fnUntraced(function* () {
|
|
191
|
+
const client = yield* Capability.get(ClientCapabilities.Client);
|
|
192
|
+
const space = AppSpace.getActiveSpace(client, capabilities) ?? AppSpace.getPersonalSpace(client);
|
|
193
|
+
if (space) yield* Operation.invoke(SpaceOperation.OpenMembers, { space });
|
|
194
|
+
}),
|
|
195
|
+
properties: {
|
|
196
|
+
label: ["share-space.label", { ns: meta.profile.key }],
|
|
197
|
+
icon: "ph--users--regular",
|
|
198
|
+
testId: "spacePlugin.shareSpace",
|
|
199
|
+
keyBinding: {
|
|
200
|
+
macos: "meta+.",
|
|
201
|
+
windows: "alt+."
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}),
|
|
205
|
+
Node.makeAction({
|
|
206
|
+
id: SpaceOperation.OpenSettings.meta.key,
|
|
207
|
+
data: Effect.fnUntraced(function* () {
|
|
208
|
+
const client = yield* Capability.get(ClientCapabilities.Client);
|
|
209
|
+
const space = AppSpace.getActiveSpace(client, capabilities) ?? AppSpace.getPersonalSpace(client);
|
|
210
|
+
if (space) yield* Operation.invoke(SpaceOperation.OpenSettings, { space });
|
|
211
|
+
}),
|
|
212
|
+
properties: {
|
|
213
|
+
label: ["open-current-space-settings.label", { ns: meta.profile.key }],
|
|
214
|
+
icon: "ph--faders--regular",
|
|
215
|
+
keyBinding: {
|
|
216
|
+
macos: "meta+shift+,",
|
|
217
|
+
windows: "ctrl+shift+,"
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
})
|
|
221
|
+
])
|
|
222
|
+
}),
|
|
223
|
+
GraphBuilder.createExtension({
|
|
224
|
+
id: "spaces",
|
|
225
|
+
match: NodeMatcher.whenRoot,
|
|
226
|
+
connector: (_node, get) => {
|
|
227
|
+
const [client] = capabilities.getAll(ClientCapabilities.Client);
|
|
228
|
+
if (!client) return Effect.succeed([]);
|
|
229
|
+
const stateAtom = capabilities.get(SpaceCapabilities.State);
|
|
230
|
+
const ephemeralAtom = capabilities.get(SpaceCapabilities.EphemeralState);
|
|
231
|
+
const spaces = get(CreateAtom.fromObservable(client.spaces));
|
|
232
|
+
const personalSpace = AppSpace.getPersonalSpace(client);
|
|
233
|
+
if (!spaces || !personalSpace) return Effect.succeed([]);
|
|
234
|
+
get(capabilities.get(SpaceCapabilities.Settings));
|
|
235
|
+
const state = get(stateAtom);
|
|
236
|
+
const ephemeralState = get(ephemeralAtom);
|
|
237
|
+
try {
|
|
238
|
+
const [spacesOrder] = get(personalSpace.db.query(Filter.type(Expando.Expando, { key: SHARED })).atom);
|
|
239
|
+
const { graph } = capabilities.get(AppCapabilities.AppGraph);
|
|
240
|
+
const order = (spacesOrder ? get(Obj.atom(spacesOrder)) : void 0)?.order ?? [];
|
|
241
|
+
const orderMap = new Map(order.map((id, index) => [id, index]));
|
|
242
|
+
const spaceStates = spaces.map((space) => get(CreateAtom.fromObservable(space.state)));
|
|
243
|
+
spaces.forEach((space) => {
|
|
244
|
+
if (space.state.get() === SpaceState.SPACE_READY) get(Obj.atom(space.properties));
|
|
245
|
+
});
|
|
246
|
+
return Effect.succeed([...spaces.filter((space) => orderMap.has(space.id)).sort((sortA, sortB) => orderMap.get(sortA.id) - orderMap.get(sortB.id)), ...spaces.filter((space) => !orderMap.has(space.id))].filter((space, idx) => spaceStates[idx] === SpaceState.SPACE_READY).filter((space) => space.tags.length === 0 || AppSpace.isPersonalSpace(space) || AppSpace.isExemplarSpace(space)).map((space) => constructSpaceNode({
|
|
247
|
+
space,
|
|
248
|
+
navigable: ephemeralState.navigableCollections,
|
|
249
|
+
personal: AppSpace.isPersonalSpace(space),
|
|
250
|
+
namesCache: state.spaceNames,
|
|
251
|
+
graph,
|
|
252
|
+
spacesOrder
|
|
253
|
+
})));
|
|
254
|
+
} catch {
|
|
255
|
+
return Effect.succeed([]);
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
}),
|
|
259
|
+
GraphBuilder.createExtension({
|
|
260
|
+
id: GraphPath.GroupSegments.communications,
|
|
261
|
+
match: AppNodeMatcher.whenSpace,
|
|
262
|
+
connector: (space) => Effect.succeed([AppNode.makeGroup({
|
|
263
|
+
id: GraphPath.GroupSegments.communications,
|
|
264
|
+
type: GraphPath.GroupTypes.communications,
|
|
265
|
+
label: ["nav-tree-group-comm.label", { ns: meta.profile.key }],
|
|
266
|
+
space,
|
|
267
|
+
position: 100
|
|
268
|
+
})])
|
|
269
|
+
}),
|
|
270
|
+
GraphBuilder.createExtension({
|
|
271
|
+
id: "actions",
|
|
272
|
+
match: AppNodeMatcher.whenSpace,
|
|
273
|
+
actions: (space, get) => {
|
|
274
|
+
const [client] = get(capabilities.atom(ClientCapabilities.Client));
|
|
275
|
+
const ephemeralState = get(capabilities.get(SpaceCapabilities.EphemeralState));
|
|
276
|
+
if (!client) return Effect.succeed([]);
|
|
277
|
+
get(CreateAtom.fromObservable(space.state));
|
|
278
|
+
if (space.state.get() === SpaceState.SPACE_READY) get(Obj.atom(space.properties));
|
|
279
|
+
return Effect.succeed(constructSpaceActions({
|
|
280
|
+
space,
|
|
281
|
+
migrating: ephemeralState.sdkMigrationRunning[space.id]
|
|
282
|
+
}));
|
|
283
|
+
}
|
|
284
|
+
})
|
|
285
|
+
]);
|
|
286
|
+
});
|
|
287
|
+
/** Builds an app-graph node for a space, including settings children and optional rearrange handler. */
|
|
288
|
+
var constructSpaceNode = ({ space, navigable = false, personal, namesCache, graph, spacesOrder }) => {
|
|
289
|
+
const hasPendingMigration = checkPendingMigration(space);
|
|
290
|
+
let onRearrange;
|
|
291
|
+
if (graph && spacesOrder) {
|
|
292
|
+
onRearrange = spaceRearrangeCache.get(space.id);
|
|
293
|
+
if (!onRearrange) {
|
|
294
|
+
onRearrange = (nextOrder) => {
|
|
295
|
+
Graph.sortEdges(graph, Node.RootId, "outbound", nextOrder.map(({ id }) => id));
|
|
296
|
+
Obj.update(spacesOrder, (spacesOrder) => {
|
|
297
|
+
spacesOrder.order = nextOrder.map(({ id }) => id);
|
|
298
|
+
});
|
|
299
|
+
};
|
|
300
|
+
spaceRearrangeCache.set(space.id, onRearrange);
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
return Node.make({
|
|
304
|
+
id: space.id,
|
|
305
|
+
type: SPACE_TYPE,
|
|
306
|
+
cacheable: AppNode.CACHEABLE_PROPS,
|
|
307
|
+
data: space,
|
|
308
|
+
properties: {
|
|
309
|
+
label: getSpaceDisplayName(space, {
|
|
310
|
+
personal,
|
|
311
|
+
namesCache
|
|
312
|
+
}),
|
|
313
|
+
description: space.state.get() === SpaceState.SPACE_READY && space.properties.description,
|
|
314
|
+
hue: space.state.get() === SpaceState.SPACE_READY && space.properties.hue,
|
|
315
|
+
icon: space.state.get() === SpaceState.SPACE_READY && space.properties.icon ? `ph--${space.properties.icon}--regular` : void 0,
|
|
316
|
+
iconHue: space.state.get() === SpaceState.SPACE_READY && space.properties.iconHue,
|
|
317
|
+
disabled: !navigable || space.state.get() !== SpaceState.SPACE_READY || hasPendingMigration,
|
|
318
|
+
disposition: "workspace",
|
|
319
|
+
testId: "spacePlugin.space",
|
|
320
|
+
onRearrange,
|
|
321
|
+
canDrop: CAN_DROP_SPACE
|
|
322
|
+
}
|
|
323
|
+
});
|
|
324
|
+
};
|
|
325
|
+
/** Builds the action list for a space node (migrate, create object, rename). */
|
|
326
|
+
var constructSpaceActions = ({ space, migrating }) => {
|
|
327
|
+
const state = space.state.get();
|
|
328
|
+
const hasPendingMigration = checkPendingMigration(space);
|
|
329
|
+
const isMigrating = migrating || Migrations.running(space);
|
|
330
|
+
const cached = spaceActionsCache.get(space.id);
|
|
331
|
+
if (cached && cached.state === state && cached.hasPendingMigration === hasPendingMigration && cached.migrating === isMigrating) return cached.actions;
|
|
332
|
+
const actions = [];
|
|
333
|
+
if (hasPendingMigration) actions.push(Node.make({
|
|
334
|
+
id: SpaceOperation.Migrate.meta.key,
|
|
335
|
+
type: Node.ActionGroupType,
|
|
336
|
+
data: () => Operation.invoke(SpaceOperation.Migrate, { space }),
|
|
337
|
+
properties: {
|
|
338
|
+
label: MIGRATE_SPACE_LABEL,
|
|
339
|
+
icon: "ph--database--regular",
|
|
340
|
+
disposition: "list-item-primary",
|
|
341
|
+
disabled: isMigrating
|
|
342
|
+
}
|
|
343
|
+
}));
|
|
344
|
+
if (state === SpaceState.SPACE_READY && !hasPendingMigration) actions.push(Node.makeAction({
|
|
345
|
+
id: SpaceOperation.OpenCreateObject.meta.key,
|
|
346
|
+
data: () => Operation.invoke(SpaceOperation.OpenCreateObject, { target: space.db }),
|
|
347
|
+
properties: {
|
|
348
|
+
label: CREATE_OBJECT_IN_SPACE_LABEL,
|
|
349
|
+
icon: "ph--plus--regular",
|
|
350
|
+
disposition: "list-item-primary",
|
|
351
|
+
testId: "spacePlugin.createObject"
|
|
352
|
+
}
|
|
353
|
+
}), Node.makeAction({
|
|
354
|
+
id: SpaceOperation.Rename.meta.key,
|
|
355
|
+
data: (params) => Operation.invoke(SpaceOperation.Rename, {
|
|
356
|
+
space,
|
|
357
|
+
caller: `${params?.caller}:${params?.parent?.id}`
|
|
358
|
+
}),
|
|
359
|
+
properties: {
|
|
360
|
+
label: RENAME_SPACE_LABEL,
|
|
361
|
+
icon: "ph--pencil-simple-line--regular",
|
|
362
|
+
keyBinding: {
|
|
363
|
+
macos: "shift+F6",
|
|
364
|
+
windows: "shift+F6"
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
}));
|
|
368
|
+
spaceActionsCache.set(space.id, {
|
|
369
|
+
state,
|
|
370
|
+
hasPendingMigration,
|
|
371
|
+
migrating: isMigrating,
|
|
372
|
+
actions
|
|
373
|
+
});
|
|
374
|
+
return actions;
|
|
375
|
+
};
|
|
376
|
+
//#endregion
|
|
377
|
+
//#region src/capabilities/app-graph-builder/extensions/database.ts
|
|
378
|
+
/** Creates database extensions: types section, schema nodes, schema children, and schema actions. */
|
|
379
|
+
var createDatabaseExtensions = Effect.fnUntraced(function* () {
|
|
380
|
+
const capabilities = yield* Capability.Service;
|
|
381
|
+
return yield* Effect.all([
|
|
382
|
+
GraphBuilder.createExtension({
|
|
383
|
+
id: GraphPath.GroupSegments.system,
|
|
384
|
+
match: AppNodeMatcher.whenSpace,
|
|
385
|
+
connector: (space) => Effect.succeed([AppNode.makeGroup({
|
|
386
|
+
id: GraphPath.GroupSegments.system,
|
|
387
|
+
type: GraphPath.GroupTypes.system,
|
|
388
|
+
label: ["nav-tree-group-system.label", { ns: meta.profile.key }],
|
|
389
|
+
space,
|
|
390
|
+
position: 900
|
|
391
|
+
})])
|
|
392
|
+
}),
|
|
393
|
+
GraphBuilder.createExtension({
|
|
394
|
+
id: "databaseSection",
|
|
395
|
+
match: AppNodeMatcher.whenNavTreeGroup(GraphPath.GroupTypes.system),
|
|
396
|
+
connector: (space) => {
|
|
397
|
+
return Effect.succeed([AppNode.makeSection({
|
|
398
|
+
id: GraphPath.Segments.database,
|
|
399
|
+
type: DATABASE_SECTION_TYPE,
|
|
400
|
+
label: ["database-section.label", { ns: meta.profile.key }],
|
|
401
|
+
icon: "ph--database--regular",
|
|
402
|
+
space,
|
|
403
|
+
testId: "spacePlugin.databaseSection"
|
|
404
|
+
})]);
|
|
405
|
+
}
|
|
406
|
+
}),
|
|
407
|
+
GraphBuilder.createExtension({
|
|
408
|
+
id: "database",
|
|
409
|
+
url: {
|
|
410
|
+
key: "type",
|
|
411
|
+
kind: "item",
|
|
412
|
+
path: [GraphPath.GroupSegments.system, GraphPath.Segments.database]
|
|
413
|
+
},
|
|
414
|
+
match: (node) => {
|
|
415
|
+
const space = isSpace(node.properties.space) ? node.properties.space : void 0;
|
|
416
|
+
return node.type === DATABASE_SECTION_TYPE && space ? Option.some(space) : Option.none();
|
|
417
|
+
},
|
|
418
|
+
connector: (space, get) => {
|
|
419
|
+
const settingsAtom = get(capabilities.atom(SpaceCapabilities.Settings)).at(0);
|
|
420
|
+
const showHidden = settingsAtom ? get(settingsAtom).showHidden : false;
|
|
421
|
+
const allSchemas = get(space.db.query(Query.select(Filter.type(Type.Type)).from(Scope.space(), Scope.registry())).atom);
|
|
422
|
+
const userSchemas = allSchemas.filter((type) => {
|
|
423
|
+
if (Type.isRelation(type)) return false;
|
|
424
|
+
if (Type.isTypeKind(type)) return false;
|
|
425
|
+
const schema = Type.getSchema(type);
|
|
426
|
+
if (!showHidden && HiddenAnnotation.get(schema).pipe(Option.getOrElse(() => false))) return false;
|
|
427
|
+
if (Type.getTypename(type) === Type.getTypename(Collection.Collection)) return false;
|
|
428
|
+
return true;
|
|
429
|
+
});
|
|
430
|
+
const viewIndex = buildViewIndex(get, space, allSchemas);
|
|
431
|
+
const visibleSchemas = userSchemas.filter((schema) => {
|
|
432
|
+
if (Type.getDatabase(schema) != null) return true;
|
|
433
|
+
const typeUri = Type.getURI(schema);
|
|
434
|
+
const objects = get(space.db.query(Filter.type(typeUri)).atom);
|
|
435
|
+
if (ViewAnnotation.has(schema)) return objects.some((obj) => !viewIndex.isView(obj));
|
|
436
|
+
return objects.length > 0 || viewIndex.typeUrisWithViews.has(typeUri);
|
|
437
|
+
});
|
|
438
|
+
const translator = get(capabilities.atom(AppCapabilities.Translator)).at(0);
|
|
439
|
+
const labelOf = (node) => {
|
|
440
|
+
const label = node.properties?.label;
|
|
441
|
+
if (translator && isLabel(label)) return toLocalizedString(label, translator.t);
|
|
442
|
+
return node.data ? Type.getTypename(node.data) : "";
|
|
443
|
+
};
|
|
444
|
+
return Effect.succeed(visibleSchemas.map((schema) => createSchemaNode({
|
|
445
|
+
schema,
|
|
446
|
+
space,
|
|
447
|
+
get
|
|
448
|
+
})).toSorted((nodeA, nodeB) => labelOf(nodeA).localeCompare(labelOf(nodeB))));
|
|
449
|
+
}
|
|
450
|
+
}),
|
|
451
|
+
GraphBuilder.createExtension({
|
|
452
|
+
id: "schemaChildren",
|
|
453
|
+
url: {
|
|
454
|
+
key: "view",
|
|
455
|
+
kind: "item",
|
|
456
|
+
path: [GraphPath.GroupSegments.system, GraphPath.Segments.database]
|
|
457
|
+
},
|
|
458
|
+
match: (node) => {
|
|
459
|
+
const space = isSpace(node.properties.space) ? node.properties.space : void 0;
|
|
460
|
+
return node.type === SCHEMA_NODE_TYPE && space && Type.isType(node.data) ? Option.some({
|
|
461
|
+
space,
|
|
462
|
+
schema: node.data
|
|
463
|
+
}) : Option.none();
|
|
464
|
+
},
|
|
465
|
+
connector: ({ space, schema }, get) => {
|
|
466
|
+
const client = get(capabilities.atom(ClientCapabilities.Client)).at(0);
|
|
467
|
+
const schemas = client ? get(client.graph.registry.query(Filter.type(Type.Type)).atom) : [];
|
|
468
|
+
const typeUri = Type.getURI(schema);
|
|
469
|
+
const viewNodes = buildViewIndex(get, space, schemas).getViewsForTypeUri(typeUri).map((object) => AppNode.makeObject({
|
|
470
|
+
get,
|
|
471
|
+
db: space.db,
|
|
472
|
+
object,
|
|
473
|
+
draggable: false,
|
|
474
|
+
droppable: false
|
|
475
|
+
})).filter(isNonNullable);
|
|
476
|
+
return Effect.succeed(viewNodes);
|
|
477
|
+
}
|
|
478
|
+
}),
|
|
479
|
+
GraphBuilder.createExtension({
|
|
480
|
+
id: "databaseObjects",
|
|
481
|
+
url: {
|
|
482
|
+
key: "db",
|
|
483
|
+
kind: "item",
|
|
484
|
+
path: [GraphPath.GroupSegments.system, GraphPath.Segments.database]
|
|
485
|
+
},
|
|
486
|
+
match: (node) => {
|
|
487
|
+
const space = isSpace(node.properties.space) ? node.properties.space : void 0;
|
|
488
|
+
return node.type === SCHEMA_NODE_TYPE && space && Type.isType(node.data) ? Option.some({
|
|
489
|
+
space,
|
|
490
|
+
schema: node.data
|
|
491
|
+
}) : Option.none();
|
|
492
|
+
},
|
|
493
|
+
connector: ({ space, schema }, get) => {
|
|
494
|
+
const client = get(capabilities.atom(ClientCapabilities.Client)).at(0);
|
|
495
|
+
const schemas = client ? get(client.graph.registry.query(Filter.type(Type.Type)).atom) : [];
|
|
496
|
+
const typeUri = Type.getURI(schema);
|
|
497
|
+
const viewIndex = buildViewIndex(get, space, schemas);
|
|
498
|
+
const objects = get(space.db.query(Query.select(Filter.type(typeUri)).from(space.db, { includeFeeds: true })).atom);
|
|
499
|
+
return Effect.succeed(objects.filter((object) => !viewIndex.isView(object)).map((object) => AppNode.makeObject({
|
|
500
|
+
get,
|
|
501
|
+
db: space.db,
|
|
502
|
+
object,
|
|
503
|
+
disposition: "hidden",
|
|
504
|
+
draggable: false,
|
|
505
|
+
droppable: false
|
|
506
|
+
})).filter(isNonNullable));
|
|
507
|
+
}
|
|
508
|
+
}),
|
|
509
|
+
GraphBuilder.createExtension({
|
|
510
|
+
id: "schemaActions",
|
|
511
|
+
match: (node) => {
|
|
512
|
+
const space = isSpace(node.properties.space) ? node.properties.space : void 0;
|
|
513
|
+
return space && Type.isType(node.data) ? Option.some({
|
|
514
|
+
space,
|
|
515
|
+
schema: node.data
|
|
516
|
+
}) : Option.none();
|
|
517
|
+
},
|
|
518
|
+
actions: ({ space, schema }, get) => {
|
|
519
|
+
const client = get(capabilities.atom(ClientCapabilities.Client)).at(0);
|
|
520
|
+
const schemas = client ? get(client.graph.registry.query(Filter.type(Type.Type)).atom) : [];
|
|
521
|
+
const targetUri = Type.getURI(schema);
|
|
522
|
+
const viewIndex = buildViewIndex(get, space, schemas);
|
|
523
|
+
const deletable = Type.getDatabase(schema) != null && viewIndex.getViewsForTypeUri(targetUri).length === 0;
|
|
524
|
+
return Effect.succeed(createSchemaActions({
|
|
525
|
+
type: schema,
|
|
526
|
+
space,
|
|
527
|
+
deletable,
|
|
528
|
+
capabilities
|
|
529
|
+
}));
|
|
530
|
+
}
|
|
531
|
+
})
|
|
532
|
+
]);
|
|
533
|
+
});
|
|
534
|
+
/** Builds a graph node for a schema in the Types subtree. */
|
|
535
|
+
var createSchemaNode = ({ schema, space, get }) => {
|
|
536
|
+
const typename = Type.getTypename(schema);
|
|
537
|
+
const slug = GraphPath.getTypeSlug(schema);
|
|
538
|
+
const iconAnnotation = Type.getDatabase(schema) == null ? Option.getOrUndefined(Annotation.IconAnnotation.get(Type.getSchema(schema))) : void 0;
|
|
539
|
+
const { label, nodeId } = Match.value(schema).pipe(Match.when((value) => Type.getDatabase(value) != null, (mutableSchema) => {
|
|
540
|
+
return {
|
|
541
|
+
label: get(Entity.atom(mutableSchema)).name || ["object-name.placeholder", { ns: Type.getTypename(Type.Type) }],
|
|
542
|
+
nodeId: slug
|
|
543
|
+
};
|
|
544
|
+
}), Match.orElse(() => ({
|
|
545
|
+
label: AppNode.getDynamicLabel("typename.label", typename, {
|
|
546
|
+
count: 2,
|
|
547
|
+
defaultValue: typename
|
|
548
|
+
}),
|
|
549
|
+
nodeId: slug
|
|
550
|
+
})));
|
|
551
|
+
const icon = Type.getDatabase(schema) != null ? "ph--cube--regular" : iconAnnotation?.icon ?? "ph--circle-dashed--regular";
|
|
552
|
+
const iconHue = Type.getDatabase(schema) != null ? "neutral" : iconAnnotation?.hue;
|
|
553
|
+
return Node.make({
|
|
554
|
+
id: nodeId,
|
|
555
|
+
type: SCHEMA_NODE_TYPE,
|
|
556
|
+
data: schema,
|
|
557
|
+
properties: {
|
|
558
|
+
label,
|
|
559
|
+
icon,
|
|
560
|
+
iconHue,
|
|
561
|
+
testId: `spacePlugin.schemaNode.${typename}`,
|
|
562
|
+
selectable: true,
|
|
563
|
+
draggable: false,
|
|
564
|
+
droppable: false,
|
|
565
|
+
childrenDroppable: false,
|
|
566
|
+
space
|
|
567
|
+
}
|
|
568
|
+
});
|
|
569
|
+
};
|
|
570
|
+
/** Builds schema actions (add view, rename, delete, snapshot). */
|
|
571
|
+
var createSchemaActions = ({ type, space, deletable, capabilities }) => {
|
|
572
|
+
const typename = Type.getTypename(type);
|
|
573
|
+
const resolvedEntry = capabilities.getAll(SpaceCapabilities.CreateObjectEntry).find((entry) => entry.id === typename) ?? (Type.getDatabase(type) != null && Type.isObject(type) ? makeCreateObjectEntryForDatabaseType(type) : void 0);
|
|
574
|
+
const createObjectFn = resolvedEntry?.createObject;
|
|
575
|
+
const inputSchema = resolvedEntry?.inputSchema;
|
|
576
|
+
return [
|
|
577
|
+
...createObjectFn ? [Node.makeAction({
|
|
578
|
+
id: SpaceOperation.OpenCreateObject.meta.key,
|
|
579
|
+
data: Effect.fnUntraced(function* () {
|
|
580
|
+
if (inputSchema) yield* Operation.invoke(SpaceOperation.OpenCreateObject, {
|
|
581
|
+
target: space.db,
|
|
582
|
+
typename
|
|
583
|
+
});
|
|
584
|
+
else {
|
|
585
|
+
const result = yield* createObjectFn({}, {
|
|
586
|
+
db: space.db,
|
|
587
|
+
target: space.db
|
|
588
|
+
}).pipe(Effect.provideService(Capability.Service, capabilities));
|
|
589
|
+
if (result.subject.length > 0) yield* Operation.invoke(LayoutOperation.Open, {
|
|
590
|
+
subject: [...result.subject],
|
|
591
|
+
navigation: "immediate"
|
|
592
|
+
});
|
|
593
|
+
}
|
|
594
|
+
}),
|
|
595
|
+
properties: {
|
|
596
|
+
label: AppNode.getDynamicLabel("add-object.label", Type.getDatabase(type) != null ? meta.profile.key : typename),
|
|
597
|
+
icon: "ph--plus--regular",
|
|
598
|
+
disposition: "list-item-primary",
|
|
599
|
+
testId: "spacePlugin.createObject"
|
|
600
|
+
}
|
|
601
|
+
})] : [],
|
|
602
|
+
Node.makeAction({
|
|
603
|
+
id: `${SpaceOperation.AddObject.meta.key}-view`,
|
|
604
|
+
data: () => Operation.invoke(SpaceOperation.OpenCreateObject, {
|
|
605
|
+
target: space.db,
|
|
606
|
+
views: true,
|
|
607
|
+
initialFormValues: { typename: Type.getURI(type) }
|
|
608
|
+
}),
|
|
609
|
+
properties: {
|
|
610
|
+
label: ADD_VIEW_TO_SCHEMA_LABEL,
|
|
611
|
+
icon: "ph--circles-three-plus--regular",
|
|
612
|
+
disposition: "list-item",
|
|
613
|
+
testId: "spacePlugin.addViewToSchema"
|
|
614
|
+
}
|
|
615
|
+
}),
|
|
616
|
+
Node.makeAction({
|
|
617
|
+
id: SpaceOperation.RenameObject.meta.key,
|
|
618
|
+
data: (params) => Type.getDatabase(type) != null ? Operation.invoke(SpaceOperation.RenameObject, {
|
|
619
|
+
object: type,
|
|
620
|
+
caller: `${params?.caller}:${params?.parent?.id}`
|
|
621
|
+
}) : Effect.fail(/* @__PURE__ */ new Error("Cannot rename immutable schema")),
|
|
622
|
+
properties: {
|
|
623
|
+
label: AppNode.getDynamicLabel("rename-object.label", Type.getTypename(Type.Type)),
|
|
624
|
+
icon: "ph--pencil-simple-line--regular",
|
|
625
|
+
disabled: Type.getDatabase(type) == null,
|
|
626
|
+
disposition: "list-item",
|
|
627
|
+
testId: "spacePlugin.renameObject"
|
|
628
|
+
}
|
|
629
|
+
}),
|
|
630
|
+
Node.makeAction({
|
|
631
|
+
id: SpaceOperation.RemoveObjects.meta.key,
|
|
632
|
+
data: () => Type.getDatabase(type) != null ? Operation.invoke(SpaceOperation.RemoveObjects, { objects: [type] }) : Effect.succeed(void 0),
|
|
633
|
+
properties: {
|
|
634
|
+
label: AppNode.getDynamicLabel("delete-object.label", Type.getTypename(Type.Type)),
|
|
635
|
+
icon: "ph--trash--regular",
|
|
636
|
+
disposition: "list-item",
|
|
637
|
+
disabled: !deletable,
|
|
638
|
+
testId: "spacePlugin.deleteObject"
|
|
639
|
+
}
|
|
640
|
+
}),
|
|
641
|
+
Node.makeAction({
|
|
642
|
+
id: SpaceOperation.Snapshot.meta.key,
|
|
643
|
+
data: Effect.fnUntraced(function* () {
|
|
644
|
+
const result = yield* Operation.invoke(SpaceOperation.Snapshot, {
|
|
645
|
+
db: space.db,
|
|
646
|
+
query: Query.select(Filter.type(type)).ast
|
|
647
|
+
});
|
|
648
|
+
if (result.snapshot) yield* Effect.tryPromise(() => downloadBlob(result.snapshot, createFilename({
|
|
649
|
+
parts: [space.id, Type.getTypename(type)],
|
|
650
|
+
ext: "json"
|
|
651
|
+
})));
|
|
652
|
+
}),
|
|
653
|
+
properties: {
|
|
654
|
+
label: SNAPSHOT_BY_SCHEMA_LABEL,
|
|
655
|
+
icon: "ph--camera--regular",
|
|
656
|
+
disposition: "list-item"
|
|
657
|
+
}
|
|
658
|
+
})
|
|
659
|
+
];
|
|
660
|
+
};
|
|
661
|
+
//#endregion
|
|
662
|
+
//#region src/capabilities/app-graph-builder/extensions/collections.ts
|
|
663
|
+
var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-space/src/capabilities/app-graph-builder/extensions/collections.ts";
|
|
664
|
+
/** Creates collection-related extensions: collections section, collections, objects, and object actions. */
|
|
665
|
+
/**
|
|
666
|
+
* A collection is always a navigation target; what differs is what navigating to it shows. When a
|
|
667
|
+
* plugin renders collections as their own article (stack, simple-layout) that article wins, otherwise
|
|
668
|
+
* the deck opens the collection's contents. Returning `undefined` leaves the ordinary open in place.
|
|
669
|
+
*/
|
|
670
|
+
var collectionDeck = (object, hasCollectionArticle) => !hasCollectionArticle && Obj.instanceOf(Collection.Collection, object) ? { initial: "children" } : void 0;
|
|
671
|
+
var createCollectionExtensions = Effect.fnUntraced(function* ({ shareableLinkOrigin }) {
|
|
672
|
+
const capabilities = yield* Capability.Service;
|
|
673
|
+
return yield* Effect.all([
|
|
674
|
+
GraphBuilder.createExtension({
|
|
675
|
+
id: GraphPath.GroupSegments.content,
|
|
676
|
+
match: AppNodeMatcher.whenSpace,
|
|
677
|
+
connector: (space) => Effect.succeed([AppNode.makeGroup({
|
|
678
|
+
id: GraphPath.GroupSegments.content,
|
|
679
|
+
type: GraphPath.GroupTypes.content,
|
|
680
|
+
label: ["nav-tree-group-content.label", { ns: meta.profile.key }],
|
|
681
|
+
space,
|
|
682
|
+
position: 200
|
|
683
|
+
})])
|
|
684
|
+
}),
|
|
685
|
+
GraphBuilder.createExtension({
|
|
686
|
+
id: "collectionsSection",
|
|
687
|
+
match: AppNodeMatcher.whenNavTreeGroup(GraphPath.GroupTypes.content),
|
|
688
|
+
connector: (space, get) => {
|
|
689
|
+
get(Obj.atom(space.properties));
|
|
690
|
+
const collectionRef = Annotation.get(space.properties, AppAnnotation.RootCollectionAnnotation).pipe(Option.getOrUndefined);
|
|
691
|
+
if (collectionRef) get(Obj.atom(collectionRef));
|
|
692
|
+
const rootCollection = collectionRef?.target;
|
|
693
|
+
const collectionPartials = rootCollection ? AppNode.getCollectionGraphNodePartials({
|
|
694
|
+
db: space.db,
|
|
695
|
+
collection: rootCollection
|
|
696
|
+
}) : void 0;
|
|
697
|
+
return Effect.succeed([Node.make({
|
|
698
|
+
id: GraphPath.Segments.collections,
|
|
699
|
+
type: COLLECTIONS_SECTION_TYPE,
|
|
700
|
+
data: null,
|
|
701
|
+
properties: {
|
|
702
|
+
label: ["collections-section.label", { ns: meta.profile.key }],
|
|
703
|
+
icon: "ph--folder--regular",
|
|
704
|
+
iconHue: "indigo",
|
|
705
|
+
role: "branch",
|
|
706
|
+
testId: "spacePlugin.collectionsSection",
|
|
707
|
+
draggable: false,
|
|
708
|
+
droppable: false,
|
|
709
|
+
space,
|
|
710
|
+
...collectionPartials
|
|
711
|
+
}
|
|
712
|
+
})]);
|
|
713
|
+
}
|
|
714
|
+
}),
|
|
715
|
+
GraphBuilder.createExtension({
|
|
716
|
+
id: "collections",
|
|
717
|
+
url: {
|
|
718
|
+
key: "object",
|
|
719
|
+
kind: "item",
|
|
720
|
+
path: [GraphPath.GroupSegments.content, GraphPath.Segments.collections]
|
|
721
|
+
},
|
|
722
|
+
match: (node) => {
|
|
723
|
+
const space = isSpace(node.properties.space) ? node.properties.space : void 0;
|
|
724
|
+
return node.type === COLLECTIONS_SECTION_TYPE && space ? Option.some(space) : Option.none();
|
|
725
|
+
},
|
|
726
|
+
connector: (space, get) => {
|
|
727
|
+
const ephemeralState = get(capabilities.get(SpaceCapabilities.EphemeralState));
|
|
728
|
+
get(Obj.atom(space.properties));
|
|
729
|
+
const collectionRef = Annotation.get(space.properties, AppAnnotation.RootCollectionAnnotation).pipe(Option.getOrUndefined);
|
|
730
|
+
const collection = collectionRef ? get(Obj.atom(collectionRef)) : void 0;
|
|
731
|
+
if (!collection) return Effect.succeed([]);
|
|
732
|
+
const objects = (collection.objects ?? []).map((ref) => {
|
|
733
|
+
get(Obj.atom(ref));
|
|
734
|
+
return ref.target;
|
|
735
|
+
}).filter(isNonNullable);
|
|
736
|
+
return Effect.succeed(objects.map((object) => AppNode.makeObject({
|
|
737
|
+
get,
|
|
738
|
+
db: space.db,
|
|
739
|
+
object,
|
|
740
|
+
navigable: true,
|
|
741
|
+
deck: collectionDeck(object, ephemeralState.navigableCollections),
|
|
742
|
+
canDrop: AppNode.CAN_DROP_COLLECTION_ITEM,
|
|
743
|
+
onRearrange: collectionRef?.target ? AppNode.makeCollectionRearrangeCallback(collectionRef.target) : void 0
|
|
744
|
+
})).filter(isNonNullable));
|
|
745
|
+
}
|
|
746
|
+
}),
|
|
747
|
+
GraphBuilder.createExtension({
|
|
748
|
+
id: "objects",
|
|
749
|
+
url: {
|
|
750
|
+
key: "object",
|
|
751
|
+
kind: "item",
|
|
752
|
+
path: ({ id, workspace }) => Effect.gen(function* () {
|
|
753
|
+
if (!SpaceId.isValid(workspace)) return null;
|
|
754
|
+
const space = capabilities.get(ClientCapabilities.Client).spaces.get(workspace);
|
|
755
|
+
if (!space) return null;
|
|
756
|
+
return (yield* resolveCollectionObjectPath({ objectId: id }).pipe(Effect.provide(Database.layer(space.db)))) ?? null;
|
|
757
|
+
})
|
|
758
|
+
},
|
|
759
|
+
match: (node) => Obj.instanceOf(Collection.Collection, node.data) ? Option.some(node.data) : Option.none(),
|
|
760
|
+
connector: (collection, get) => {
|
|
761
|
+
const ephemeralState = get(capabilities.get(SpaceCapabilities.EphemeralState));
|
|
762
|
+
const db = Obj.getDatabase(collection);
|
|
763
|
+
const objects = (get(Obj.atom(collection)).objects ?? []).map((ref) => {
|
|
764
|
+
get(Obj.atom(ref));
|
|
765
|
+
return ref.target;
|
|
766
|
+
}).filter(isNonNullable);
|
|
767
|
+
return Effect.succeed(objects.map((object) => db && AppNode.makeObject({
|
|
768
|
+
get,
|
|
769
|
+
object,
|
|
770
|
+
db,
|
|
771
|
+
navigable: true,
|
|
772
|
+
deck: collectionDeck(object, ephemeralState.navigableCollections),
|
|
773
|
+
canDrop: AppNode.CAN_DROP_COLLECTION_ITEM,
|
|
774
|
+
onRearrange: AppNode.makeCollectionRearrangeCallback(collection)
|
|
775
|
+
})).filter(isNonNullable));
|
|
776
|
+
}
|
|
777
|
+
}),
|
|
778
|
+
GraphBuilder.createExtension({
|
|
779
|
+
id: "objectActions",
|
|
780
|
+
match: (node) => {
|
|
781
|
+
return node.data != null && Obj.getDatabase(node.data) && Obj.isObject(node.data) && Obj.getTypename(node.data) === node.type ? Option.some({
|
|
782
|
+
object: node.data,
|
|
783
|
+
nodeId: node.id
|
|
784
|
+
}) : Option.none();
|
|
785
|
+
},
|
|
786
|
+
actions: ({ object, nodeId }, get) => {
|
|
787
|
+
const deletable = !Type.isType(object);
|
|
788
|
+
const [appGraph] = get(capabilities.atom(AppCapabilities.AppGraph));
|
|
789
|
+
const ephemeralState = get(capabilities.get(SpaceCapabilities.EphemeralState));
|
|
790
|
+
if (!appGraph) return Effect.succeed([]);
|
|
791
|
+
const parentId = nodeId.substring(0, nodeId.lastIndexOf("/"));
|
|
792
|
+
const parentNode = Option.getOrUndefined(Graph.getNode(appGraph.graph, parentId));
|
|
793
|
+
const parentCollection = parentNode && Obj.instanceOf(Collection.Collection, parentNode.data) ? parentNode.data : void 0;
|
|
794
|
+
return Effect.succeed(constructObjectActions({
|
|
795
|
+
object,
|
|
796
|
+
nodeId,
|
|
797
|
+
deletable,
|
|
798
|
+
navigable: ephemeralState.navigableCollections,
|
|
799
|
+
shareableLinkOrigin,
|
|
800
|
+
parentCollection
|
|
801
|
+
}));
|
|
802
|
+
}
|
|
803
|
+
}),
|
|
804
|
+
GraphBuilder.createExtension({
|
|
805
|
+
id: "collectionsSectionActions",
|
|
806
|
+
match: (node) => {
|
|
807
|
+
const space = isSpace(node.properties.space) ? node.properties.space : void 0;
|
|
808
|
+
return node.type === COLLECTIONS_SECTION_TYPE && space ? Option.some(space) : Option.none();
|
|
809
|
+
},
|
|
810
|
+
actions: (space) => Effect.succeed([Node.makeAction({
|
|
811
|
+
id: SpaceOperation.OpenCreateObject.meta.key,
|
|
812
|
+
data: () => Effect.gen(function* () {
|
|
813
|
+
const rootCollection = Annotation.get(space.properties, AppAnnotation.RootCollectionAnnotation).pipe(Option.getOrUndefined)?.target;
|
|
814
|
+
yield* Operation.invoke(SpaceOperation.OpenCreateObject, {
|
|
815
|
+
target: rootCollection ?? space.db,
|
|
816
|
+
targetNodeId: GraphPath.getCollectionsPath(space.id)
|
|
817
|
+
});
|
|
818
|
+
}),
|
|
819
|
+
properties: {
|
|
820
|
+
label: CREATE_OBJECT_IN_COLLECTION_LABEL,
|
|
821
|
+
icon: "ph--plus--regular",
|
|
822
|
+
disposition: "list-item-primary",
|
|
823
|
+
testId: "spacePlugin.createObject"
|
|
824
|
+
}
|
|
825
|
+
})])
|
|
826
|
+
})
|
|
827
|
+
]);
|
|
828
|
+
});
|
|
829
|
+
/** Builds the action list for an ECHO object node. */
|
|
830
|
+
var constructObjectActions = ({ object, nodeId, deletable = true, navigable = false, shareableLinkOrigin, parentCollection }) => {
|
|
831
|
+
invariant(Obj.getDatabase(object), "Database not found", {
|
|
832
|
+
"~LogMeta": "~LogMeta",
|
|
833
|
+
F: __dxlog_file,
|
|
834
|
+
L: 329,
|
|
835
|
+
S: void 0,
|
|
836
|
+
A: ["db", "'Database not found'"]
|
|
837
|
+
});
|
|
838
|
+
const typename = Obj.getTypename(object);
|
|
839
|
+
invariant(typename, "Object has no typename", {
|
|
840
|
+
"~LogMeta": "~LogMeta",
|
|
841
|
+
F: __dxlog_file,
|
|
842
|
+
L: 331,
|
|
843
|
+
S: void 0,
|
|
844
|
+
A: ["typename", "'Object has no typename'"]
|
|
845
|
+
});
|
|
846
|
+
return [
|
|
847
|
+
...Obj.instanceOf(Collection.Collection, object) ? [Node.makeAction({
|
|
848
|
+
id: SpaceOperation.OpenCreateObject.meta.key,
|
|
849
|
+
data: () => Operation.invoke(SpaceOperation.OpenCreateObject, {
|
|
850
|
+
target: object,
|
|
851
|
+
targetNodeId: nodeId
|
|
852
|
+
}),
|
|
853
|
+
properties: {
|
|
854
|
+
label: CREATE_OBJECT_IN_COLLECTION_LABEL,
|
|
855
|
+
icon: "ph--plus--regular",
|
|
856
|
+
disposition: "list-item-primary",
|
|
857
|
+
testId: "spacePlugin.createObject"
|
|
858
|
+
}
|
|
859
|
+
})] : [],
|
|
860
|
+
Node.makeAction({
|
|
861
|
+
id: SpaceOperation.RenameObject.meta.key,
|
|
862
|
+
data: (params) => Operation.invoke(SpaceOperation.RenameObject, {
|
|
863
|
+
object,
|
|
864
|
+
caller: `${params?.caller}:${params?.parent?.id}`
|
|
865
|
+
}),
|
|
866
|
+
properties: {
|
|
867
|
+
label: AppNode.getDynamicLabel("rename-object.label", typename, { defaultValue: "Rename" }),
|
|
868
|
+
icon: "ph--pencil-simple-line--regular",
|
|
869
|
+
disposition: "list-item",
|
|
870
|
+
testId: "spacePlugin.renameObject"
|
|
871
|
+
}
|
|
872
|
+
}),
|
|
873
|
+
Node.makeAction({
|
|
874
|
+
id: SpaceOperation.RemoveObjects.meta.key,
|
|
875
|
+
data: () => Operation.invoke(SpaceOperation.RemoveObjects, {
|
|
876
|
+
objects: [object],
|
|
877
|
+
target: parentCollection
|
|
878
|
+
}),
|
|
879
|
+
properties: {
|
|
880
|
+
label: AppNode.getDynamicLabel("delete-object.label", typename, { defaultValue: "Delete" }),
|
|
881
|
+
icon: "ph--trash--regular",
|
|
882
|
+
disposition: "list-item",
|
|
883
|
+
disabled: !deletable,
|
|
884
|
+
testId: "spacePlugin.deleteObject"
|
|
885
|
+
}
|
|
886
|
+
}),
|
|
887
|
+
...navigable || !Obj.instanceOf(Collection.Collection, object) ? [Node.makeAction({
|
|
888
|
+
id: "copyLink",
|
|
889
|
+
data: () => Effect.gen(function* () {
|
|
890
|
+
const builder = yield* Capability.get(AppCapabilities.AppGraph);
|
|
891
|
+
const path = UrlResolution.getShareableLinkPath(builder, nodeId);
|
|
892
|
+
if (Option.isNone(path)) {
|
|
893
|
+
log.warn("object has no URL representation; cannot copy link", { nodeId }, {
|
|
894
|
+
"~LogMeta": "~LogMeta",
|
|
895
|
+
F: __dxlog_file,
|
|
896
|
+
L: 383,
|
|
897
|
+
S: this
|
|
898
|
+
});
|
|
899
|
+
return;
|
|
900
|
+
}
|
|
901
|
+
const url = new URL(path.value, shareableLinkOrigin);
|
|
902
|
+
yield* Effect.promise(() => navigator.clipboard.writeText(url.toString()));
|
|
903
|
+
}),
|
|
904
|
+
properties: {
|
|
905
|
+
label: COPY_LINK_LABEL,
|
|
906
|
+
icon: "ph--link--regular",
|
|
907
|
+
disposition: "list-item",
|
|
908
|
+
testId: "spacePlugin.copyLink"
|
|
909
|
+
}
|
|
910
|
+
})] : [],
|
|
911
|
+
Node.makeAction({
|
|
912
|
+
id: LayoutOperation.Expose.meta.key,
|
|
913
|
+
data: () => Operation.invoke(LayoutOperation.Expose, { subject: GraphPath.getObjectPathFromObject(object) }),
|
|
914
|
+
properties: {
|
|
915
|
+
label: EXPOSE_OBJECT_LABEL,
|
|
916
|
+
icon: "ph--eye--regular",
|
|
917
|
+
disposition: "heading-list-item",
|
|
918
|
+
testId: "spacePlugin.exposeObject"
|
|
919
|
+
}
|
|
920
|
+
})
|
|
921
|
+
];
|
|
922
|
+
};
|
|
923
|
+
//#endregion
|
|
924
|
+
//#region src/capabilities/app-graph-builder/extensions/companions.ts
|
|
925
|
+
/** Creates companion panel extensions: object settings, related, and selected-objects. */
|
|
926
|
+
var createCompanionExtensions = Effect.fnUntraced(function* () {
|
|
927
|
+
return yield* Effect.all([
|
|
928
|
+
GraphBuilder.createExtension({
|
|
929
|
+
id: "settings",
|
|
930
|
+
match: NodeMatcher.whenEchoObjectMatches,
|
|
931
|
+
connector: (node) => Effect.succeed([AppNode.makeCompanion({
|
|
932
|
+
variant: "settings",
|
|
933
|
+
label: ["object-properties.label", { ns: meta.profile.key }],
|
|
934
|
+
icon: "ph--sliders--regular",
|
|
935
|
+
data: "settings",
|
|
936
|
+
position: Position.last
|
|
937
|
+
})])
|
|
938
|
+
}),
|
|
939
|
+
GraphBuilder.createExtension({
|
|
940
|
+
id: "related",
|
|
941
|
+
match: NodeMatcher.whenEchoObjectMatches,
|
|
942
|
+
connector: (node) => Effect.succeed([AppNode.makeCompanion({
|
|
943
|
+
variant: "related",
|
|
944
|
+
label: ["companion-related.label", { ns: meta.profile.key }],
|
|
945
|
+
icon: "ph--graph--regular",
|
|
946
|
+
data: "related",
|
|
947
|
+
position: Position.last
|
|
948
|
+
})])
|
|
949
|
+
}),
|
|
950
|
+
GraphBuilder.createExtension({
|
|
951
|
+
id: "selectedObjects",
|
|
952
|
+
match: (node) => {
|
|
953
|
+
if (Type.isType(node.data)) return Option.some(node);
|
|
954
|
+
if (!Obj.isObject(node.data)) return Option.none();
|
|
955
|
+
const type = Obj.getType(node.data);
|
|
956
|
+
const path = type ? ViewAnnotation.get(Type.getSchema(type)).pipe(Option.getOrElse(() => [])) : [];
|
|
957
|
+
if (!(type && path.length > 0 ? ViewAnnotation.hasRefAlongPath(node.data, path) : false)) return Option.none();
|
|
958
|
+
return Option.some(node);
|
|
959
|
+
},
|
|
960
|
+
connector: (node) => Effect.succeed([AppNode.makeCompanion({
|
|
961
|
+
variant: "selected-objects",
|
|
962
|
+
label: ["companion-selected-objects.label", { ns: meta.profile.key }],
|
|
963
|
+
icon: "ph--tree-view--regular",
|
|
964
|
+
data: "selected-objects"
|
|
965
|
+
})])
|
|
966
|
+
})
|
|
967
|
+
]);
|
|
968
|
+
});
|
|
969
|
+
//#endregion
|
|
970
|
+
//#region src/capabilities/app-graph-builder/extensions/settings.ts
|
|
971
|
+
/**
|
|
972
|
+
* Settings section attached directly under each Space node, plus its children.
|
|
973
|
+
*
|
|
974
|
+
* The virtual `settings` section is pinned to the top via `position: Position.first`
|
|
975
|
+
* so it sits above the un-positioned middle band (collections, mailboxes,
|
|
976
|
+
* automations, integrations, etc.). It groups the panels contributed by this
|
|
977
|
+
* plugin (general, members) and by other plugins (automation, functions).
|
|
978
|
+
*/
|
|
979
|
+
var createSettingsExtensions = Effect.fnUntraced(function* () {
|
|
980
|
+
return [
|
|
981
|
+
yield* GraphBuilder.createExtension({
|
|
982
|
+
id: "settingsSection",
|
|
983
|
+
match: AppNodeMatcher.whenSpace,
|
|
984
|
+
connector: (space) => Effect.succeed([AppNode.makeSection({
|
|
985
|
+
id: SETTINGS_SECTION_ID,
|
|
986
|
+
type: SETTINGS_SECTION_TYPE,
|
|
987
|
+
label: ["settings-section.label", { ns: meta.profile.key }],
|
|
988
|
+
icon: "ph--sliders--regular",
|
|
989
|
+
iconHue: "emerald",
|
|
990
|
+
space,
|
|
991
|
+
position: Position.first,
|
|
992
|
+
testId: "spacePlugin.settings"
|
|
993
|
+
})])
|
|
994
|
+
}),
|
|
995
|
+
yield* GraphBuilder.createExtension({
|
|
996
|
+
id: "settingsGeneral",
|
|
997
|
+
url: {
|
|
998
|
+
key: "settings",
|
|
999
|
+
kind: "singleton",
|
|
1000
|
+
path: [SETTINGS_SECTION_ID]
|
|
1001
|
+
},
|
|
1002
|
+
match: AppNodeMatcher.whenSpaceSettings,
|
|
1003
|
+
connector: (space) => Effect.succeed([Node.make({
|
|
1004
|
+
id: "settings",
|
|
1005
|
+
type: `${meta.profile.key}.general`,
|
|
1006
|
+
data: `${meta.profile.key}.general`,
|
|
1007
|
+
properties: {
|
|
1008
|
+
label: ["space-settings-properties.label", { ns: meta.profile.key }],
|
|
1009
|
+
icon: "ph--brackets-curly--regular",
|
|
1010
|
+
iconHue: "emerald",
|
|
1011
|
+
space,
|
|
1012
|
+
position: Position.first,
|
|
1013
|
+
testId: "spacePlugin.general"
|
|
1014
|
+
}
|
|
1015
|
+
})])
|
|
1016
|
+
}),
|
|
1017
|
+
yield* GraphBuilder.createExtension({
|
|
1018
|
+
id: "settingsMembers",
|
|
1019
|
+
url: {
|
|
1020
|
+
key: "members",
|
|
1021
|
+
kind: "singleton",
|
|
1022
|
+
path: [SETTINGS_SECTION_ID]
|
|
1023
|
+
},
|
|
1024
|
+
match: AppNodeMatcher.whenSpaceSettings,
|
|
1025
|
+
connector: (space) => Effect.succeed(AppSpace.isPersonalSpace(space) ? [] : [Node.make({
|
|
1026
|
+
id: "members",
|
|
1027
|
+
type: `${meta.profile.key}.members`,
|
|
1028
|
+
data: `${meta.profile.key}.members`,
|
|
1029
|
+
properties: {
|
|
1030
|
+
label: ["members-panel.label", { ns: meta.profile.key }],
|
|
1031
|
+
icon: "ph--users--regular",
|
|
1032
|
+
iconHue: "emerald",
|
|
1033
|
+
space,
|
|
1034
|
+
position: Position.first,
|
|
1035
|
+
testId: "spacePlugin.members"
|
|
1036
|
+
}
|
|
1037
|
+
})])
|
|
1038
|
+
})
|
|
1039
|
+
];
|
|
1040
|
+
});
|
|
1041
|
+
//#endregion
|
|
1042
|
+
//#region src/capabilities/app-graph-builder/app-graph-builder.ts
|
|
1043
|
+
var app_graph_builder_default = Capability.makeModule(Effect.fnUntraced(function* ({ shareableLinkOrigin = window.location.origin } = {}) {
|
|
1044
|
+
const extensions = yield* Effect.all([
|
|
1045
|
+
createSpaceExtensions(),
|
|
1046
|
+
createSettingsExtensions(),
|
|
1047
|
+
createDatabaseExtensions(),
|
|
1048
|
+
createCollectionExtensions({ shareableLinkOrigin }),
|
|
1049
|
+
createCompanionExtensions()
|
|
1050
|
+
]);
|
|
1051
|
+
return Capability.contributes(AppCapabilities.AppGraphBuilder, extensions.flat());
|
|
1052
|
+
}));
|
|
1053
|
+
//#endregion
|
|
1054
|
+
export { app_graph_builder_default as default };
|
|
1055
|
+
|
|
1056
|
+
//# sourceMappingURL=chunk-app-graph-builder.mjs.map
|