@dxos/plugin-space 0.10.0 → 0.11.0
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 +8 -8
- 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 +1 -0
- 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
|
@@ -1,1332 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
getSpaceDisplayName,
|
|
3
|
-
makeCreateObjectEntryForDatabaseType
|
|
4
|
-
} from "./chunk-52ASDNRA.mjs";
|
|
5
|
-
import {
|
|
6
|
-
SHARED
|
|
7
|
-
} from "./chunk-F5KLUP2P.mjs";
|
|
8
|
-
import "./chunk-J5LGTIGS.mjs";
|
|
9
|
-
|
|
10
|
-
// src/capabilities/app-graph-builder/app-graph-builder.ts
|
|
11
|
-
import * as Effect6 from "effect/Effect";
|
|
12
|
-
import { Capability as Capability4 } from "@dxos/app-framework";
|
|
13
|
-
import { AppCapabilities as AppCapabilities4 } from "@dxos/app-toolkit";
|
|
14
|
-
|
|
15
|
-
// src/capabilities/app-graph-builder/extensions/spaces.ts
|
|
16
|
-
import * as Effect from "effect/Effect";
|
|
17
|
-
import { Capability } from "@dxos/app-framework";
|
|
18
|
-
import { AppCapabilities, AppNode, AppNodeMatcher, AppSpace, Paths } from "@dxos/app-toolkit";
|
|
19
|
-
import { SpaceState as SpaceState2 } from "@dxos/client/echo";
|
|
20
|
-
import { Operation } from "@dxos/compute";
|
|
21
|
-
import { Filter as Filter2, Obj as Obj2 } from "@dxos/echo";
|
|
22
|
-
import { Migrations as Migrations2 } from "@dxos/migrations";
|
|
23
|
-
import { ClientCapabilities } from "@dxos/plugin-client";
|
|
24
|
-
import { CreateAtom, Graph, GraphBuilder, Node, NodeMatcher } from "@dxos/plugin-graph";
|
|
25
|
-
import { SpaceArchive } from "@dxos/protocols/proto/dxos/client/services";
|
|
26
|
-
import { Expando } from "@dxos/schema";
|
|
27
|
-
import { Position } from "@dxos/util";
|
|
28
|
-
import { meta as meta2 } from "#meta";
|
|
29
|
-
import { SpaceOperation } from "#operations";
|
|
30
|
-
import { SPACE_HOME_NODE_TYPE, SPACE_TYPE, SpaceCapabilities } from "#types";
|
|
31
|
-
|
|
32
|
-
// src/capabilities/app-graph-builder/extensions/shared.ts
|
|
33
|
-
import * as Option from "effect/Option";
|
|
34
|
-
import { SpaceState, isSpace } from "@dxos/client/echo";
|
|
35
|
-
import { Annotation, Filter, Obj, Type } from "@dxos/echo";
|
|
36
|
-
import { Migrations, MigrationVersionAnnotation } from "@dxos/migrations";
|
|
37
|
-
import { ViewAnnotation, getTypeURIFromQuery } from "@dxos/schema";
|
|
38
|
-
import { meta } from "#meta";
|
|
39
|
-
var DATABASE_SECTION_TYPE = `${meta.profile.key}.database`;
|
|
40
|
-
var COLLECTIONS_SECTION_TYPE = `${meta.profile.key}.collections`;
|
|
41
|
-
var STATIC_SCHEMA_TYPE = `${meta.profile.key}.static-schema`;
|
|
42
|
-
var META_NS = {
|
|
43
|
-
ns: meta.profile.key
|
|
44
|
-
};
|
|
45
|
-
var CAN_DROP_SPACE = (source) => Obj.isObject(source.item.data) || isSpace(source.item.data);
|
|
46
|
-
var spaceActionsCache = /* @__PURE__ */ new Map();
|
|
47
|
-
var spaceRearrangeCache = /* @__PURE__ */ new Map();
|
|
48
|
-
var ADD_VIEW_TO_SCHEMA_LABEL = [
|
|
49
|
-
"add-view-to-schema.label",
|
|
50
|
-
META_NS
|
|
51
|
-
];
|
|
52
|
-
var COPY_LINK_LABEL = [
|
|
53
|
-
"copy-link.label",
|
|
54
|
-
META_NS
|
|
55
|
-
];
|
|
56
|
-
var CREATE_OBJECT_IN_COLLECTION_LABEL = [
|
|
57
|
-
"create-object-in-collection.label",
|
|
58
|
-
META_NS
|
|
59
|
-
];
|
|
60
|
-
var CREATE_OBJECT_IN_SPACE_LABEL = [
|
|
61
|
-
"create-object-in-space.label",
|
|
62
|
-
META_NS
|
|
63
|
-
];
|
|
64
|
-
var EXPOSE_OBJECT_LABEL = [
|
|
65
|
-
"expose-object.label",
|
|
66
|
-
META_NS
|
|
67
|
-
];
|
|
68
|
-
var MIGRATE_SPACE_LABEL = [
|
|
69
|
-
"migrate-space.label",
|
|
70
|
-
META_NS
|
|
71
|
-
];
|
|
72
|
-
var RENAME_SPACE_LABEL = [
|
|
73
|
-
"rename-space.label",
|
|
74
|
-
META_NS
|
|
75
|
-
];
|
|
76
|
-
var SNAPSHOT_BY_SCHEMA_LABEL = [
|
|
77
|
-
"snapshot-by-schema.label",
|
|
78
|
-
META_NS
|
|
79
|
-
];
|
|
80
|
-
var checkPendingMigration = (space) => {
|
|
81
|
-
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;
|
|
82
|
-
};
|
|
83
|
-
var downloadBlob = async (blob, filename) => {
|
|
84
|
-
const url = URL.createObjectURL(blob);
|
|
85
|
-
const anchor = document.createElement("a");
|
|
86
|
-
anchor.href = url;
|
|
87
|
-
anchor.download = filename;
|
|
88
|
-
document.body.appendChild(anchor);
|
|
89
|
-
anchor.click();
|
|
90
|
-
document.body.removeChild(anchor);
|
|
91
|
-
URL.revokeObjectURL(url);
|
|
92
|
-
};
|
|
93
|
-
var buildViewIndex = (get, space, schemas) => {
|
|
94
|
-
const viewSchemas = schemas.filter((schema) => ViewAnnotation.has(schema));
|
|
95
|
-
const viewsByTypeUri = /* @__PURE__ */ new Map();
|
|
96
|
-
const viewObjectIds = /* @__PURE__ */ new Set();
|
|
97
|
-
if (viewSchemas.length > 0) {
|
|
98
|
-
const filter = Filter.or(...viewSchemas.map((schema) => Filter.type(schema)));
|
|
99
|
-
const viewObjects = get(space.db.query(filter).atom);
|
|
100
|
-
for (const viewObject of viewObjects) {
|
|
101
|
-
if (!Obj.isObject(viewObject)) {
|
|
102
|
-
continue;
|
|
103
|
-
}
|
|
104
|
-
const holderType = Obj.getType(viewObject);
|
|
105
|
-
const path = holderType ? ViewAnnotation.get(Type.getSchema(holderType)).pipe(Option.getOrElse(() => [])) : [];
|
|
106
|
-
if (path.length === 0) {
|
|
107
|
-
continue;
|
|
108
|
-
}
|
|
109
|
-
const viewSnapshot = get(Obj.atom(viewObject));
|
|
110
|
-
let holder = viewSnapshot;
|
|
111
|
-
for (const segment of path) {
|
|
112
|
-
holder = holder == null || typeof holder !== "object" ? void 0 : holder[segment];
|
|
113
|
-
}
|
|
114
|
-
if (holder != null) {
|
|
115
|
-
viewObjectIds.add(viewObject.id);
|
|
116
|
-
}
|
|
117
|
-
const viewTarget = holder != null ? get(Obj.atom(holder)) : void 0;
|
|
118
|
-
const typeUri = getTypeURIFromQuery(viewTarget?.query?.ast);
|
|
119
|
-
if (typeUri) {
|
|
120
|
-
const existing = viewsByTypeUri.get(typeUri) ?? [];
|
|
121
|
-
existing.push(viewObject);
|
|
122
|
-
viewsByTypeUri.set(typeUri, existing);
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
return {
|
|
127
|
-
typeUrisWithViews: new Set(viewsByTypeUri.keys()),
|
|
128
|
-
getViewsForTypeUri: (typeUri) => viewsByTypeUri.get(typeUri) ?? [],
|
|
129
|
-
isView: (object) => viewObjectIds.has(object.id)
|
|
130
|
-
};
|
|
131
|
-
};
|
|
132
|
-
|
|
133
|
-
// src/capabilities/app-graph-builder/extensions/spaces.ts
|
|
134
|
-
var SPACE_HOME_NODE_LABEL = [
|
|
135
|
-
"space-home-node.label",
|
|
136
|
-
{
|
|
137
|
-
ns: meta2.profile.key
|
|
138
|
-
}
|
|
139
|
-
];
|
|
140
|
-
var createSpaceExtensions = Effect.fnUntraced(function* () {
|
|
141
|
-
const capabilities = yield* Capability.Service;
|
|
142
|
-
return yield* Effect.all([
|
|
143
|
-
GraphBuilder.createExtension({
|
|
144
|
-
id: "spaceHome",
|
|
145
|
-
position: Position.first,
|
|
146
|
-
match: AppNodeMatcher.whenSpace,
|
|
147
|
-
connector: (space) => Effect.succeed([
|
|
148
|
-
{
|
|
149
|
-
id: Paths.SPACE_HOME_SEGMENT,
|
|
150
|
-
type: SPACE_HOME_NODE_TYPE,
|
|
151
|
-
data: SPACE_HOME_NODE_TYPE,
|
|
152
|
-
properties: {
|
|
153
|
-
label: SPACE_HOME_NODE_LABEL,
|
|
154
|
-
icon: "ph--house--regular",
|
|
155
|
-
iconHue: "emerald",
|
|
156
|
-
position: Position.first,
|
|
157
|
-
draggable: false,
|
|
158
|
-
droppable: false,
|
|
159
|
-
space
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
])
|
|
163
|
-
}),
|
|
164
|
-
GraphBuilder.createExtension({
|
|
165
|
-
id: "primaryActions",
|
|
166
|
-
position: Position.first,
|
|
167
|
-
match: NodeMatcher.whenRoot,
|
|
168
|
-
actions: () => Effect.succeed([
|
|
169
|
-
Node.makeAction({
|
|
170
|
-
id: SpaceOperation.OpenCreateSpace.meta.key,
|
|
171
|
-
data: () => Operation.invoke(SpaceOperation.OpenCreateSpace),
|
|
172
|
-
properties: {
|
|
173
|
-
label: [
|
|
174
|
-
"create-space.label",
|
|
175
|
-
{
|
|
176
|
-
ns: meta2.profile.key
|
|
177
|
-
}
|
|
178
|
-
],
|
|
179
|
-
icon: "ph--plus--regular",
|
|
180
|
-
testId: "spacePlugin.createSpace",
|
|
181
|
-
disposition: "menu"
|
|
182
|
-
}
|
|
183
|
-
}),
|
|
184
|
-
Node.makeAction({
|
|
185
|
-
id: SpaceOperation.Join.meta.key,
|
|
186
|
-
data: () => Operation.invoke(SpaceOperation.Join, {}),
|
|
187
|
-
properties: {
|
|
188
|
-
label: [
|
|
189
|
-
"join-space.label",
|
|
190
|
-
{
|
|
191
|
-
ns: meta2.profile.key
|
|
192
|
-
}
|
|
193
|
-
],
|
|
194
|
-
icon: "ph--sign-in--regular",
|
|
195
|
-
testId: "spacePlugin.joinSpace",
|
|
196
|
-
disposition: "menu"
|
|
197
|
-
}
|
|
198
|
-
}),
|
|
199
|
-
Node.makeAction({
|
|
200
|
-
id: SpaceOperation.OpenImportSpace.meta.key,
|
|
201
|
-
data: () => Operation.invoke(SpaceOperation.OpenImportSpace),
|
|
202
|
-
properties: {
|
|
203
|
-
label: [
|
|
204
|
-
"import-space.label",
|
|
205
|
-
{
|
|
206
|
-
ns: meta2.profile.key
|
|
207
|
-
}
|
|
208
|
-
],
|
|
209
|
-
icon: "ph--upload--regular",
|
|
210
|
-
testId: "spacePlugin.importSpace"
|
|
211
|
-
}
|
|
212
|
-
}),
|
|
213
|
-
Node.makeAction({
|
|
214
|
-
id: `${SpaceOperation.ExportSpace.meta.key}.binary`,
|
|
215
|
-
data: Effect.fnUntraced(function* () {
|
|
216
|
-
const client = yield* Capability.get(ClientCapabilities.Client);
|
|
217
|
-
const space = AppSpace.getActiveSpace(client, capabilities) ?? AppSpace.getPersonalSpace(client);
|
|
218
|
-
if (space) {
|
|
219
|
-
yield* Operation.invoke(SpaceOperation.ExportSpace, {
|
|
220
|
-
space,
|
|
221
|
-
format: SpaceArchive.Format.BINARY
|
|
222
|
-
});
|
|
223
|
-
}
|
|
224
|
-
}),
|
|
225
|
-
properties: {
|
|
226
|
-
label: [
|
|
227
|
-
"export-space-binary.label",
|
|
228
|
-
{
|
|
229
|
-
ns: meta2.profile.key
|
|
230
|
-
}
|
|
231
|
-
],
|
|
232
|
-
icon: "ph--download--regular",
|
|
233
|
-
testId: "spacePlugin.exportSpaceBinary"
|
|
234
|
-
}
|
|
235
|
-
}),
|
|
236
|
-
Node.makeAction({
|
|
237
|
-
id: `${SpaceOperation.ExportSpace.meta.key}.json`,
|
|
238
|
-
data: Effect.fnUntraced(function* () {
|
|
239
|
-
const client = yield* Capability.get(ClientCapabilities.Client);
|
|
240
|
-
const space = AppSpace.getActiveSpace(client, capabilities) ?? AppSpace.getPersonalSpace(client);
|
|
241
|
-
if (space) {
|
|
242
|
-
yield* Operation.invoke(SpaceOperation.ExportSpace, {
|
|
243
|
-
space,
|
|
244
|
-
format: SpaceArchive.Format.JSON
|
|
245
|
-
});
|
|
246
|
-
}
|
|
247
|
-
}),
|
|
248
|
-
properties: {
|
|
249
|
-
label: [
|
|
250
|
-
"export-space-json.label",
|
|
251
|
-
{
|
|
252
|
-
ns: meta2.profile.key
|
|
253
|
-
}
|
|
254
|
-
],
|
|
255
|
-
icon: "ph--download--regular",
|
|
256
|
-
testId: "spacePlugin.exportSpaceJson"
|
|
257
|
-
}
|
|
258
|
-
}),
|
|
259
|
-
Node.makeAction({
|
|
260
|
-
id: SpaceOperation.OpenMembers.meta.key,
|
|
261
|
-
data: Effect.fnUntraced(function* () {
|
|
262
|
-
const client = yield* Capability.get(ClientCapabilities.Client);
|
|
263
|
-
const space = AppSpace.getActiveSpace(client, capabilities) ?? AppSpace.getPersonalSpace(client);
|
|
264
|
-
if (space) {
|
|
265
|
-
yield* Operation.invoke(SpaceOperation.OpenMembers, {
|
|
266
|
-
space
|
|
267
|
-
});
|
|
268
|
-
}
|
|
269
|
-
}),
|
|
270
|
-
properties: {
|
|
271
|
-
label: [
|
|
272
|
-
"share-space.label",
|
|
273
|
-
{
|
|
274
|
-
ns: meta2.profile.key
|
|
275
|
-
}
|
|
276
|
-
],
|
|
277
|
-
icon: "ph--users--regular",
|
|
278
|
-
testId: "spacePlugin.shareSpace",
|
|
279
|
-
keyBinding: {
|
|
280
|
-
macos: "meta+.",
|
|
281
|
-
windows: "alt+."
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
}),
|
|
285
|
-
Node.makeAction({
|
|
286
|
-
id: SpaceOperation.OpenSettings.meta.key,
|
|
287
|
-
data: Effect.fnUntraced(function* () {
|
|
288
|
-
const client = yield* Capability.get(ClientCapabilities.Client);
|
|
289
|
-
const space = AppSpace.getActiveSpace(client, capabilities) ?? AppSpace.getPersonalSpace(client);
|
|
290
|
-
if (space) {
|
|
291
|
-
yield* Operation.invoke(SpaceOperation.OpenSettings, {
|
|
292
|
-
space
|
|
293
|
-
});
|
|
294
|
-
}
|
|
295
|
-
}),
|
|
296
|
-
properties: {
|
|
297
|
-
label: [
|
|
298
|
-
"open-current-space-settings.label",
|
|
299
|
-
{
|
|
300
|
-
ns: meta2.profile.key
|
|
301
|
-
}
|
|
302
|
-
],
|
|
303
|
-
icon: "ph--faders--regular",
|
|
304
|
-
keyBinding: {
|
|
305
|
-
macos: "meta+shift+,",
|
|
306
|
-
windows: "ctrl+shift+,"
|
|
307
|
-
}
|
|
308
|
-
}
|
|
309
|
-
})
|
|
310
|
-
])
|
|
311
|
-
}),
|
|
312
|
-
GraphBuilder.createExtension({
|
|
313
|
-
id: "spaces",
|
|
314
|
-
match: NodeMatcher.whenRoot,
|
|
315
|
-
connector: (_node, get) => {
|
|
316
|
-
const [client] = capabilities.getAll(ClientCapabilities.Client);
|
|
317
|
-
if (!client) {
|
|
318
|
-
return Effect.succeed([]);
|
|
319
|
-
}
|
|
320
|
-
const stateAtom = capabilities.get(SpaceCapabilities.State);
|
|
321
|
-
const ephemeralAtom = capabilities.get(SpaceCapabilities.EphemeralState);
|
|
322
|
-
const spacesAtom = CreateAtom.fromObservable(client.spaces);
|
|
323
|
-
const spaces = get(spacesAtom);
|
|
324
|
-
const personalSpace = AppSpace.getPersonalSpace(client);
|
|
325
|
-
if (!spaces || !personalSpace) {
|
|
326
|
-
return Effect.succeed([]);
|
|
327
|
-
}
|
|
328
|
-
const settingsAtom = capabilities.get(SpaceCapabilities.Settings);
|
|
329
|
-
const settings = get(settingsAtom);
|
|
330
|
-
const state = get(stateAtom);
|
|
331
|
-
const ephemeralState = get(ephemeralAtom);
|
|
332
|
-
try {
|
|
333
|
-
const [spacesOrder] = get(personalSpace.db.query(Filter2.type(Expando.Expando, {
|
|
334
|
-
key: SHARED
|
|
335
|
-
})).atom);
|
|
336
|
-
const { graph } = capabilities.get(AppCapabilities.AppGraph);
|
|
337
|
-
const spacesOrderSnapshot = spacesOrder ? get(Obj2.atom(spacesOrder)) : void 0;
|
|
338
|
-
const order = spacesOrderSnapshot?.order ?? [];
|
|
339
|
-
const orderMap = new Map(order.map((id, index) => [
|
|
340
|
-
id,
|
|
341
|
-
index
|
|
342
|
-
]));
|
|
343
|
-
const spaceStates = spaces.map((space) => get(CreateAtom.fromObservable(space.state)));
|
|
344
|
-
spaces.forEach((space) => {
|
|
345
|
-
if (space.state.get() === SpaceState2.SPACE_READY) {
|
|
346
|
-
get(Obj2.atom(space.properties));
|
|
347
|
-
}
|
|
348
|
-
});
|
|
349
|
-
return Effect.succeed([
|
|
350
|
-
...spaces.filter((space) => orderMap.has(space.id)).sort((sortA, sortB) => orderMap.get(sortA.id) - orderMap.get(sortB.id)),
|
|
351
|
-
...spaces.filter((space) => !orderMap.has(space.id))
|
|
352
|
-
].filter((space, idx) => spaceStates[idx] === SpaceState2.SPACE_READY).filter((space) => space.tags.length === 0 || AppSpace.isPersonalSpace(space) || AppSpace.isExemplarSpace(space)).map((space) => constructSpaceNode({
|
|
353
|
-
space,
|
|
354
|
-
navigable: ephemeralState.navigableCollections,
|
|
355
|
-
personal: AppSpace.isPersonalSpace(space),
|
|
356
|
-
namesCache: state.spaceNames,
|
|
357
|
-
graph,
|
|
358
|
-
spacesOrder
|
|
359
|
-
})));
|
|
360
|
-
} catch {
|
|
361
|
-
return Effect.succeed([]);
|
|
362
|
-
}
|
|
363
|
-
}
|
|
364
|
-
}),
|
|
365
|
-
// Communications section group — no single plugin owns this category; it lives here so the
|
|
366
|
-
// group is always present when the space plugin is active. A more specific plugin (e.g. a
|
|
367
|
-
// future plugin-communications) should own this once one exists.
|
|
368
|
-
// TODO(wittjosiah): Move to a dedicated communications plugin when one exists.
|
|
369
|
-
GraphBuilder.createExtension({
|
|
370
|
-
id: Paths.GroupSegments.communications,
|
|
371
|
-
match: AppNodeMatcher.whenSpace,
|
|
372
|
-
connector: (space) => Effect.succeed([
|
|
373
|
-
AppNode.makeGroup({
|
|
374
|
-
id: Paths.GroupSegments.communications,
|
|
375
|
-
type: Paths.GroupTypes.communications,
|
|
376
|
-
label: [
|
|
377
|
-
"nav-tree-group-comm.label",
|
|
378
|
-
{
|
|
379
|
-
ns: meta2.profile.key
|
|
380
|
-
}
|
|
381
|
-
],
|
|
382
|
-
space,
|
|
383
|
-
position: 100
|
|
384
|
-
})
|
|
385
|
-
])
|
|
386
|
-
}),
|
|
387
|
-
GraphBuilder.createExtension({
|
|
388
|
-
id: "actions",
|
|
389
|
-
match: AppNodeMatcher.whenSpace,
|
|
390
|
-
actions: (space, get) => {
|
|
391
|
-
const [client] = get(capabilities.atom(ClientCapabilities.Client));
|
|
392
|
-
const ephemeralAtom = capabilities.get(SpaceCapabilities.EphemeralState);
|
|
393
|
-
const ephemeralState = get(ephemeralAtom);
|
|
394
|
-
if (!client) {
|
|
395
|
-
return Effect.succeed([]);
|
|
396
|
-
}
|
|
397
|
-
get(CreateAtom.fromObservable(space.state));
|
|
398
|
-
if (space.state.get() === SpaceState2.SPACE_READY) {
|
|
399
|
-
get(Obj2.atom(space.properties));
|
|
400
|
-
}
|
|
401
|
-
return Effect.succeed(constructSpaceActions({
|
|
402
|
-
space,
|
|
403
|
-
migrating: ephemeralState.sdkMigrationRunning[space.id]
|
|
404
|
-
}));
|
|
405
|
-
}
|
|
406
|
-
})
|
|
407
|
-
]);
|
|
408
|
-
});
|
|
409
|
-
var constructSpaceNode = ({ space, navigable = false, personal, namesCache, graph, spacesOrder }) => {
|
|
410
|
-
const hasPendingMigration = checkPendingMigration(space);
|
|
411
|
-
let onRearrange;
|
|
412
|
-
if (graph && spacesOrder) {
|
|
413
|
-
onRearrange = spaceRearrangeCache.get(space.id);
|
|
414
|
-
if (!onRearrange) {
|
|
415
|
-
onRearrange = (nextOrder) => {
|
|
416
|
-
Graph.sortEdges(graph, Node.RootId, "outbound", nextOrder.map(({ id }) => id));
|
|
417
|
-
Obj2.update(spacesOrder, (spacesOrder2) => {
|
|
418
|
-
spacesOrder2.order = nextOrder.map(({ id }) => id);
|
|
419
|
-
});
|
|
420
|
-
};
|
|
421
|
-
spaceRearrangeCache.set(space.id, onRearrange);
|
|
422
|
-
}
|
|
423
|
-
}
|
|
424
|
-
return Node.make({
|
|
425
|
-
id: space.id,
|
|
426
|
-
type: SPACE_TYPE,
|
|
427
|
-
cacheable: AppNode.CACHEABLE_PROPS,
|
|
428
|
-
data: space,
|
|
429
|
-
properties: {
|
|
430
|
-
label: getSpaceDisplayName(space, {
|
|
431
|
-
personal,
|
|
432
|
-
namesCache
|
|
433
|
-
}),
|
|
434
|
-
description: space.state.get() === SpaceState2.SPACE_READY && space.properties.description,
|
|
435
|
-
hue: space.state.get() === SpaceState2.SPACE_READY && space.properties.hue,
|
|
436
|
-
icon: space.state.get() === SpaceState2.SPACE_READY && space.properties.icon ? `ph--${space.properties.icon}--regular` : void 0,
|
|
437
|
-
iconHue: space.state.get() === SpaceState2.SPACE_READY && space.properties.iconHue,
|
|
438
|
-
disabled: !navigable || space.state.get() !== SpaceState2.SPACE_READY || hasPendingMigration,
|
|
439
|
-
disposition: "workspace",
|
|
440
|
-
testId: "spacePlugin.space",
|
|
441
|
-
onRearrange,
|
|
442
|
-
canDrop: CAN_DROP_SPACE
|
|
443
|
-
}
|
|
444
|
-
});
|
|
445
|
-
};
|
|
446
|
-
var constructSpaceActions = ({ space, migrating }) => {
|
|
447
|
-
const state = space.state.get();
|
|
448
|
-
const hasPendingMigration = checkPendingMigration(space);
|
|
449
|
-
const isMigrating = migrating || Migrations2.running(space);
|
|
450
|
-
const cached = spaceActionsCache.get(space.id);
|
|
451
|
-
if (cached && cached.state === state && cached.hasPendingMigration === hasPendingMigration && cached.migrating === isMigrating) {
|
|
452
|
-
return cached.actions;
|
|
453
|
-
}
|
|
454
|
-
const actions = [];
|
|
455
|
-
if (hasPendingMigration) {
|
|
456
|
-
actions.push(Node.make({
|
|
457
|
-
id: SpaceOperation.Migrate.meta.key,
|
|
458
|
-
type: Node.ActionGroupType,
|
|
459
|
-
data: () => Operation.invoke(SpaceOperation.Migrate, {
|
|
460
|
-
space
|
|
461
|
-
}),
|
|
462
|
-
properties: {
|
|
463
|
-
label: MIGRATE_SPACE_LABEL,
|
|
464
|
-
icon: "ph--database--regular",
|
|
465
|
-
disposition: "list-item-primary",
|
|
466
|
-
disabled: isMigrating
|
|
467
|
-
}
|
|
468
|
-
}));
|
|
469
|
-
}
|
|
470
|
-
if (state === SpaceState2.SPACE_READY && !hasPendingMigration) {
|
|
471
|
-
actions.push(Node.makeAction({
|
|
472
|
-
id: SpaceOperation.OpenCreateObject.meta.key,
|
|
473
|
-
data: () => Operation.invoke(SpaceOperation.OpenCreateObject, {
|
|
474
|
-
target: space.db
|
|
475
|
-
}),
|
|
476
|
-
properties: {
|
|
477
|
-
label: CREATE_OBJECT_IN_SPACE_LABEL,
|
|
478
|
-
icon: "ph--plus--regular",
|
|
479
|
-
disposition: "list-item-primary",
|
|
480
|
-
testId: "spacePlugin.createObject"
|
|
481
|
-
}
|
|
482
|
-
}), Node.makeAction({
|
|
483
|
-
id: SpaceOperation.Rename.meta.key,
|
|
484
|
-
data: (params) => Operation.invoke(SpaceOperation.Rename, {
|
|
485
|
-
space,
|
|
486
|
-
caller: `${params?.caller}:${params?.parent?.id}`
|
|
487
|
-
}),
|
|
488
|
-
properties: {
|
|
489
|
-
label: RENAME_SPACE_LABEL,
|
|
490
|
-
icon: "ph--pencil-simple-line--regular",
|
|
491
|
-
keyBinding: {
|
|
492
|
-
macos: "shift+F6",
|
|
493
|
-
windows: "shift+F6"
|
|
494
|
-
}
|
|
495
|
-
}
|
|
496
|
-
}));
|
|
497
|
-
}
|
|
498
|
-
spaceActionsCache.set(space.id, {
|
|
499
|
-
state,
|
|
500
|
-
hasPendingMigration,
|
|
501
|
-
migrating: isMigrating,
|
|
502
|
-
actions
|
|
503
|
-
});
|
|
504
|
-
return actions;
|
|
505
|
-
};
|
|
506
|
-
|
|
507
|
-
// src/capabilities/app-graph-builder/extensions/database.ts
|
|
508
|
-
import * as Effect2 from "effect/Effect";
|
|
509
|
-
import * as Match from "effect/Match";
|
|
510
|
-
import * as Option2 from "effect/Option";
|
|
511
|
-
import { Capability as Capability2 } from "@dxos/app-framework";
|
|
512
|
-
import { AppCapabilities as AppCapabilities2, AppNode as AppNode2, AppNodeMatcher as AppNodeMatcher2, LayoutOperation, Paths as Paths2 } from "@dxos/app-toolkit";
|
|
513
|
-
import { isSpace as isSpace2 } from "@dxos/client/echo";
|
|
514
|
-
import { Operation as Operation2 } from "@dxos/compute";
|
|
515
|
-
import { Annotation as Annotation2, Collection, Entity, Filter as Filter3, Key, Obj as Obj3, Query, Scope, Type as Type2 } from "@dxos/echo";
|
|
516
|
-
import { HiddenAnnotation } from "@dxos/echo/Annotation";
|
|
517
|
-
import { ClientCapabilities as ClientCapabilities2 } from "@dxos/plugin-client";
|
|
518
|
-
import { GraphBuilder as GraphBuilder2, Node as Node2 } from "@dxos/plugin-graph";
|
|
519
|
-
import { ViewAnnotation as ViewAnnotation2 } from "@dxos/schema";
|
|
520
|
-
import { isLabel, toLocalizedString } from "@dxos/ui-types/translations";
|
|
521
|
-
import { createFilename, isNonNullable } from "@dxos/util";
|
|
522
|
-
import { meta as meta3 } from "#meta";
|
|
523
|
-
import { SpaceOperation as SpaceOperation2 } from "#operations";
|
|
524
|
-
import { SpaceCapabilities as SpaceCapabilities2 } from "#types";
|
|
525
|
-
var createDatabaseExtensions = Effect2.fnUntraced(function* () {
|
|
526
|
-
const capabilities = yield* Capability2.Service;
|
|
527
|
-
return yield* Effect2.all([
|
|
528
|
-
// System section group — created alongside database/settings so the group always
|
|
529
|
-
// appears when the space plugin is active and hides when there are no children.
|
|
530
|
-
GraphBuilder2.createExtension({
|
|
531
|
-
id: Paths2.GroupSegments.system,
|
|
532
|
-
match: AppNodeMatcher2.whenSpace,
|
|
533
|
-
connector: (space) => Effect2.succeed([
|
|
534
|
-
AppNode2.makeGroup({
|
|
535
|
-
id: Paths2.GroupSegments.system,
|
|
536
|
-
type: Paths2.GroupTypes.system,
|
|
537
|
-
label: [
|
|
538
|
-
"nav-tree-group-system.label",
|
|
539
|
-
{
|
|
540
|
-
ns: meta3.profile.key
|
|
541
|
-
}
|
|
542
|
-
],
|
|
543
|
-
space,
|
|
544
|
-
position: 900
|
|
545
|
-
})
|
|
546
|
-
])
|
|
547
|
-
}),
|
|
548
|
-
// Types section virtual node under the system group.
|
|
549
|
-
GraphBuilder2.createExtension({
|
|
550
|
-
id: "databaseSection",
|
|
551
|
-
match: AppNodeMatcher2.whenNavTreeGroup(Paths2.GroupTypes.system),
|
|
552
|
-
connector: (space) => {
|
|
553
|
-
return Effect2.succeed([
|
|
554
|
-
AppNode2.makeSection({
|
|
555
|
-
id: Paths2.Segments.database,
|
|
556
|
-
type: DATABASE_SECTION_TYPE,
|
|
557
|
-
label: [
|
|
558
|
-
"database-section.label",
|
|
559
|
-
{
|
|
560
|
-
ns: meta3.profile.key
|
|
561
|
-
}
|
|
562
|
-
],
|
|
563
|
-
icon: "ph--database--regular",
|
|
564
|
-
space,
|
|
565
|
-
testId: "spacePlugin.databaseSection"
|
|
566
|
-
})
|
|
567
|
-
]);
|
|
568
|
-
}
|
|
569
|
-
}),
|
|
570
|
-
// Schema nodes under the Types virtual node.
|
|
571
|
-
GraphBuilder2.createExtension({
|
|
572
|
-
id: "database",
|
|
573
|
-
match: (node) => {
|
|
574
|
-
const space = isSpace2(node.properties.space) ? node.properties.space : void 0;
|
|
575
|
-
return node.type === DATABASE_SECTION_TYPE && space ? Option2.some(space) : Option2.none();
|
|
576
|
-
},
|
|
577
|
-
connector: (space, get) => {
|
|
578
|
-
const settingsAtom = get(capabilities.atom(SpaceCapabilities2.Settings)).at(0);
|
|
579
|
-
const showHidden = settingsAtom ? get(settingsAtom).showHidden : false;
|
|
580
|
-
const allSchemas = get(space.db.query(Query.select(Filter3.type(Type2.Type)).from(Scope.space(), Scope.registry())).atom);
|
|
581
|
-
const userSchemas = allSchemas.filter((type) => {
|
|
582
|
-
if (Type2.isRelation(type)) {
|
|
583
|
-
return false;
|
|
584
|
-
}
|
|
585
|
-
if (Type2.isTypeKind(type)) {
|
|
586
|
-
return false;
|
|
587
|
-
}
|
|
588
|
-
const schema = Type2.getSchema(type);
|
|
589
|
-
if (!showHidden && HiddenAnnotation.get(schema).pipe(Option2.getOrElse(() => false))) {
|
|
590
|
-
return false;
|
|
591
|
-
}
|
|
592
|
-
if (Type2.getTypename(type) === Type2.getTypename(Collection.Collection)) {
|
|
593
|
-
return false;
|
|
594
|
-
}
|
|
595
|
-
return true;
|
|
596
|
-
});
|
|
597
|
-
const viewIndex = buildViewIndex(get, space, allSchemas);
|
|
598
|
-
const visibleSchemas = userSchemas.filter((schema) => {
|
|
599
|
-
if (Type2.getDatabase(schema) != null) {
|
|
600
|
-
return true;
|
|
601
|
-
}
|
|
602
|
-
const typeUri = Type2.getURI(schema);
|
|
603
|
-
const objects = get(space.db.query(Filter3.type(typeUri)).atom);
|
|
604
|
-
if (ViewAnnotation2.has(schema)) {
|
|
605
|
-
return objects.some((obj) => !viewIndex.isView(obj));
|
|
606
|
-
}
|
|
607
|
-
return objects.length > 0 || viewIndex.typeUrisWithViews.has(typeUri);
|
|
608
|
-
});
|
|
609
|
-
const translator = get(capabilities.atom(AppCapabilities2.Translator)).at(0);
|
|
610
|
-
const labelOf = (node) => {
|
|
611
|
-
const label = node.properties?.label;
|
|
612
|
-
if (translator && isLabel(label)) {
|
|
613
|
-
return toLocalizedString(label, translator.t);
|
|
614
|
-
}
|
|
615
|
-
return node.data ? Type2.getTypename(node.data) : "";
|
|
616
|
-
};
|
|
617
|
-
return Effect2.succeed(visibleSchemas.map((schema) => createSchemaNode({
|
|
618
|
-
schema,
|
|
619
|
-
space,
|
|
620
|
-
get
|
|
621
|
-
})).toSorted((nodeA, nodeB) => labelOf(nodeA).localeCompare(labelOf(nodeB))));
|
|
622
|
-
}
|
|
623
|
-
}),
|
|
624
|
-
// {All} virtual node + view objects under each schema node.
|
|
625
|
-
GraphBuilder2.createExtension({
|
|
626
|
-
id: "schemaChildren",
|
|
627
|
-
match: (node) => {
|
|
628
|
-
const space = isSpace2(node.properties.space) ? node.properties.space : void 0;
|
|
629
|
-
return space && Type2.isType(node.data) ? Option2.some({
|
|
630
|
-
space,
|
|
631
|
-
schema: node.data
|
|
632
|
-
}) : Option2.none();
|
|
633
|
-
},
|
|
634
|
-
connector: ({ space, schema }, get) => {
|
|
635
|
-
const client = get(capabilities.atom(ClientCapabilities2.Client)).at(0);
|
|
636
|
-
const schemas = client ? get(client.graph.registry.query(Filter3.type(Type2.Type)).atom) : [];
|
|
637
|
-
const typeUri = Type2.getURI(schema);
|
|
638
|
-
const viewIndex = buildViewIndex(get, space, schemas);
|
|
639
|
-
const viewNodes = viewIndex.getViewsForTypeUri(typeUri).map((object) => AppNode2.makeObject({
|
|
640
|
-
get,
|
|
641
|
-
db: space.db,
|
|
642
|
-
object,
|
|
643
|
-
draggable: false,
|
|
644
|
-
droppable: false
|
|
645
|
-
})).filter(isNonNullable);
|
|
646
|
-
return Effect2.succeed(viewNodes);
|
|
647
|
-
}
|
|
648
|
-
}),
|
|
649
|
-
// Objects of a type are not enumerated in the nav tree; navigating directly to the canonical
|
|
650
|
-
// object path resolves the object on demand as a hidden child of its type node. Mirrors the
|
|
651
|
-
// inbox feed-object resolver: a resolver keyed on path shape, not a connector.
|
|
652
|
-
GraphBuilder2.createExtension({
|
|
653
|
-
id: "typeCollectionObject",
|
|
654
|
-
match: () => Option2.none(),
|
|
655
|
-
resolver: (qualifiedId, get) => Effect2.gen(function* () {
|
|
656
|
-
const segments = qualifiedId.split("/");
|
|
657
|
-
if (segments.at(-3) !== Paths2.Segments.database) {
|
|
658
|
-
return null;
|
|
659
|
-
}
|
|
660
|
-
const spaceId = Paths2.getSpaceIdFromPath(qualifiedId);
|
|
661
|
-
const objectId = segments.at(-1);
|
|
662
|
-
if (!spaceId || !objectId || !Key.EntityId.isValid(objectId)) {
|
|
663
|
-
return null;
|
|
664
|
-
}
|
|
665
|
-
const client = get(capabilities.atom(ClientCapabilities2.Client)).at(0);
|
|
666
|
-
const space = client?.spaces.get(spaceId);
|
|
667
|
-
if (!space) {
|
|
668
|
-
return null;
|
|
669
|
-
}
|
|
670
|
-
const object = get(space.db.query(Filter3.id(objectId)).atom).at(0);
|
|
671
|
-
if (!object) {
|
|
672
|
-
return null;
|
|
673
|
-
}
|
|
674
|
-
get(Obj3.atom(object));
|
|
675
|
-
const node = AppNode2.makeObject({
|
|
676
|
-
get,
|
|
677
|
-
db: space.db,
|
|
678
|
-
object,
|
|
679
|
-
disposition: "hidden",
|
|
680
|
-
draggable: false,
|
|
681
|
-
droppable: false
|
|
682
|
-
});
|
|
683
|
-
return node && {
|
|
684
|
-
...node,
|
|
685
|
-
id: qualifiedId
|
|
686
|
-
};
|
|
687
|
-
})
|
|
688
|
-
}),
|
|
689
|
-
// Actions for schema nodes.
|
|
690
|
-
GraphBuilder2.createExtension({
|
|
691
|
-
id: "schemaActions",
|
|
692
|
-
match: (node) => {
|
|
693
|
-
const space = isSpace2(node.properties.space) ? node.properties.space : void 0;
|
|
694
|
-
return space && Type2.isType(node.data) ? Option2.some({
|
|
695
|
-
space,
|
|
696
|
-
schema: node.data
|
|
697
|
-
}) : Option2.none();
|
|
698
|
-
},
|
|
699
|
-
actions: ({ space, schema }, get) => {
|
|
700
|
-
const client = get(capabilities.atom(ClientCapabilities2.Client)).at(0);
|
|
701
|
-
const schemas = client ? get(client.graph.registry.query(Filter3.type(Type2.Type)).atom) : [];
|
|
702
|
-
const targetUri = Type2.getURI(schema);
|
|
703
|
-
const viewIndex = buildViewIndex(get, space, schemas);
|
|
704
|
-
const deletable = Type2.getDatabase(schema) != null && viewIndex.getViewsForTypeUri(targetUri).length === 0;
|
|
705
|
-
return Effect2.succeed(createSchemaActions({
|
|
706
|
-
type: schema,
|
|
707
|
-
space,
|
|
708
|
-
deletable,
|
|
709
|
-
capabilities
|
|
710
|
-
}));
|
|
711
|
-
}
|
|
712
|
-
})
|
|
713
|
-
]);
|
|
714
|
-
});
|
|
715
|
-
var createSchemaNode = ({ schema, space, get }) => {
|
|
716
|
-
const typename = Type2.getTypename(schema);
|
|
717
|
-
const slug = Paths2.getTypeSlug(schema);
|
|
718
|
-
const iconAnnotation = Type2.getDatabase(schema) == null ? Option2.getOrUndefined(Annotation2.IconAnnotation.get(Type2.getSchema(schema))) : void 0;
|
|
719
|
-
const { label, nodeId } = Match.value(schema).pipe(Match.when((value2) => Type2.getDatabase(value2) != null, (mutableSchema) => {
|
|
720
|
-
const snapshot = get(Entity.atom(mutableSchema));
|
|
721
|
-
return {
|
|
722
|
-
label: snapshot.name || [
|
|
723
|
-
"object-name.placeholder",
|
|
724
|
-
{
|
|
725
|
-
ns: Type2.getTypename(Type2.Type)
|
|
726
|
-
}
|
|
727
|
-
],
|
|
728
|
-
nodeId: slug
|
|
729
|
-
};
|
|
730
|
-
}), Match.orElse(() => ({
|
|
731
|
-
label: AppNode2.getDynamicLabel("typename.label", typename, {
|
|
732
|
-
count: 2,
|
|
733
|
-
defaultValue: typename
|
|
734
|
-
}),
|
|
735
|
-
nodeId: slug
|
|
736
|
-
})));
|
|
737
|
-
const icon = Type2.getDatabase(schema) != null ? "ph--cube--regular" : iconAnnotation?.icon ?? "ph--circle-dashed--regular";
|
|
738
|
-
const iconHue = Type2.getDatabase(schema) != null ? "neutral" : iconAnnotation?.hue;
|
|
739
|
-
return Node2.make({
|
|
740
|
-
id: nodeId,
|
|
741
|
-
type: STATIC_SCHEMA_TYPE,
|
|
742
|
-
data: schema,
|
|
743
|
-
properties: {
|
|
744
|
-
label,
|
|
745
|
-
icon,
|
|
746
|
-
iconHue,
|
|
747
|
-
// Selecting the type node opens a list of every object of this type (see TypeCollectionArticle);
|
|
748
|
-
// objects resolve on demand as hidden children. View objects are its only visible children, so
|
|
749
|
-
// without a view the node is a leaf (no `role: 'branch'`).
|
|
750
|
-
testId: `spacePlugin.schemaNode.${typename}`,
|
|
751
|
-
selectable: true,
|
|
752
|
-
draggable: false,
|
|
753
|
-
droppable: false,
|
|
754
|
-
childrenDroppable: false,
|
|
755
|
-
space
|
|
756
|
-
}
|
|
757
|
-
});
|
|
758
|
-
};
|
|
759
|
-
var createSchemaActions = ({ type, space, deletable, capabilities }) => {
|
|
760
|
-
const typename = Type2.getTypename(type);
|
|
761
|
-
const createEntry = capabilities.getAll(SpaceCapabilities2.CreateObjectEntry).find((entry) => entry.id === typename);
|
|
762
|
-
const resolvedEntry = createEntry ?? (Type2.getDatabase(type) != null && Type2.isObject(type) ? makeCreateObjectEntryForDatabaseType(type) : void 0);
|
|
763
|
-
const createObjectFn = resolvedEntry?.createObject;
|
|
764
|
-
const inputSchema = resolvedEntry?.inputSchema;
|
|
765
|
-
const actions = [
|
|
766
|
-
...createObjectFn ? [
|
|
767
|
-
Node2.makeAction({
|
|
768
|
-
id: SpaceOperation2.OpenCreateObject.meta.key,
|
|
769
|
-
data: Effect2.fnUntraced(function* () {
|
|
770
|
-
if (inputSchema) {
|
|
771
|
-
yield* Operation2.invoke(SpaceOperation2.OpenCreateObject, {
|
|
772
|
-
target: space.db,
|
|
773
|
-
typename
|
|
774
|
-
});
|
|
775
|
-
} else {
|
|
776
|
-
const result = yield* createObjectFn({}, {
|
|
777
|
-
db: space.db,
|
|
778
|
-
target: space.db
|
|
779
|
-
}).pipe(Effect2.provideService(Capability2.Service, capabilities));
|
|
780
|
-
if (result.subject.length > 0) {
|
|
781
|
-
yield* Operation2.invoke(LayoutOperation.Open, {
|
|
782
|
-
subject: [
|
|
783
|
-
...result.subject
|
|
784
|
-
],
|
|
785
|
-
navigation: "immediate"
|
|
786
|
-
});
|
|
787
|
-
}
|
|
788
|
-
}
|
|
789
|
-
}),
|
|
790
|
-
properties: {
|
|
791
|
-
// Static plugin types carry a per-typename `add-object.label` (e.g. "Add event");
|
|
792
|
-
// database types have no such namespace, so fall back to the plugin's generic label.
|
|
793
|
-
label: AppNode2.getDynamicLabel("add-object.label", Type2.getDatabase(type) != null ? meta3.profile.key : typename),
|
|
794
|
-
icon: "ph--plus--regular",
|
|
795
|
-
disposition: "list-item-primary",
|
|
796
|
-
testId: "spacePlugin.createObject"
|
|
797
|
-
}
|
|
798
|
-
})
|
|
799
|
-
] : [],
|
|
800
|
-
Node2.makeAction({
|
|
801
|
-
id: `${SpaceOperation2.AddObject.meta.key}-view`,
|
|
802
|
-
data: () => Operation2.invoke(SpaceOperation2.OpenCreateObject, {
|
|
803
|
-
target: space.db,
|
|
804
|
-
views: true,
|
|
805
|
-
// The type-picker field value is the type URI (see TypeOptions), so seed the default with
|
|
806
|
-
// the URI — not the bare typename — for the option to be pre-selected.
|
|
807
|
-
initialFormValues: {
|
|
808
|
-
typename: Type2.getURI(type)
|
|
809
|
-
}
|
|
810
|
-
}),
|
|
811
|
-
properties: {
|
|
812
|
-
label: ADD_VIEW_TO_SCHEMA_LABEL,
|
|
813
|
-
icon: "ph--circles-three-plus--regular",
|
|
814
|
-
disposition: "list-item",
|
|
815
|
-
testId: "spacePlugin.addViewToSchema"
|
|
816
|
-
}
|
|
817
|
-
}),
|
|
818
|
-
Node2.makeAction({
|
|
819
|
-
id: SpaceOperation2.RenameObject.meta.key,
|
|
820
|
-
data: (params) => Type2.getDatabase(type) != null ? Operation2.invoke(SpaceOperation2.RenameObject, {
|
|
821
|
-
object: type,
|
|
822
|
-
caller: `${params?.caller}:${params?.parent?.id}`
|
|
823
|
-
}) : Effect2.fail(new Error("Cannot rename immutable schema")),
|
|
824
|
-
properties: {
|
|
825
|
-
label: AppNode2.getDynamicLabel("rename-object.label", Type2.getTypename(Type2.Type)),
|
|
826
|
-
icon: "ph--pencil-simple-line--regular",
|
|
827
|
-
disabled: Type2.getDatabase(type) == null,
|
|
828
|
-
disposition: "list-item",
|
|
829
|
-
testId: "spacePlugin.renameObject"
|
|
830
|
-
}
|
|
831
|
-
}),
|
|
832
|
-
Node2.makeAction({
|
|
833
|
-
id: SpaceOperation2.RemoveObjects.meta.key,
|
|
834
|
-
data: () => Type2.getDatabase(type) != null ? Operation2.invoke(SpaceOperation2.RemoveObjects, {
|
|
835
|
-
objects: [
|
|
836
|
-
type
|
|
837
|
-
]
|
|
838
|
-
}) : Effect2.succeed(void 0),
|
|
839
|
-
properties: {
|
|
840
|
-
label: AppNode2.getDynamicLabel("delete-object.label", Type2.getTypename(Type2.Type)),
|
|
841
|
-
icon: "ph--trash--regular",
|
|
842
|
-
disposition: "list-item",
|
|
843
|
-
disabled: !deletable,
|
|
844
|
-
testId: "spacePlugin.deleteObject"
|
|
845
|
-
}
|
|
846
|
-
}),
|
|
847
|
-
Node2.makeAction({
|
|
848
|
-
id: SpaceOperation2.Snapshot.meta.key,
|
|
849
|
-
data: Effect2.fnUntraced(function* () {
|
|
850
|
-
const result = yield* Operation2.invoke(SpaceOperation2.Snapshot, {
|
|
851
|
-
db: space.db,
|
|
852
|
-
query: Query.select(Filter3.type(type)).ast
|
|
853
|
-
});
|
|
854
|
-
if (result.snapshot) {
|
|
855
|
-
yield* Effect2.tryPromise(() => downloadBlob(result.snapshot, createFilename({
|
|
856
|
-
parts: [
|
|
857
|
-
space.id,
|
|
858
|
-
Type2.getTypename(type)
|
|
859
|
-
],
|
|
860
|
-
ext: "json"
|
|
861
|
-
})));
|
|
862
|
-
}
|
|
863
|
-
}),
|
|
864
|
-
properties: {
|
|
865
|
-
label: SNAPSHOT_BY_SCHEMA_LABEL,
|
|
866
|
-
icon: "ph--camera--regular",
|
|
867
|
-
disposition: "list-item"
|
|
868
|
-
}
|
|
869
|
-
})
|
|
870
|
-
];
|
|
871
|
-
return actions;
|
|
872
|
-
};
|
|
873
|
-
|
|
874
|
-
// src/capabilities/app-graph-builder/extensions/collections.ts
|
|
875
|
-
import * as Effect3 from "effect/Effect";
|
|
876
|
-
import * as Option3 from "effect/Option";
|
|
877
|
-
import { Capability as Capability3 } from "@dxos/app-framework";
|
|
878
|
-
import { AppAnnotation, AppCapabilities as AppCapabilities3, AppNode as AppNode3, AppNodeMatcher as AppNodeMatcher3, LayoutOperation as LayoutOperation2, Paths as Paths3 } from "@dxos/app-toolkit";
|
|
879
|
-
import { isSpace as isSpace3 } from "@dxos/client/echo";
|
|
880
|
-
import { Operation as Operation3 } from "@dxos/compute";
|
|
881
|
-
import { Annotation as Annotation3, Collection as Collection2, Obj as Obj4, Type as Type3 } from "@dxos/echo";
|
|
882
|
-
import { invariant } from "@dxos/invariant";
|
|
883
|
-
import { Graph as Graph2, GraphBuilder as GraphBuilder3, Node as Node3 } from "@dxos/plugin-graph";
|
|
884
|
-
import { isNonNullable as isNonNullable2 } from "@dxos/util";
|
|
885
|
-
import { meta as meta4 } from "#meta";
|
|
886
|
-
import { SpaceOperation as SpaceOperation3 } from "#operations";
|
|
887
|
-
import { SpaceCapabilities as SpaceCapabilities3 } from "#types";
|
|
888
|
-
var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-space/src/capabilities/app-graph-builder/extensions/collections.ts";
|
|
889
|
-
var createCollectionExtensions = Effect3.fnUntraced(function* ({ shareableLinkOrigin }) {
|
|
890
|
-
const capabilities = yield* Capability3.Service;
|
|
891
|
-
return yield* Effect3.all([
|
|
892
|
-
// Content section group — created alongside collections so the group always
|
|
893
|
-
// appears when the space plugin is active and hides when there are no children.
|
|
894
|
-
GraphBuilder3.createExtension({
|
|
895
|
-
id: Paths3.GroupSegments.content,
|
|
896
|
-
match: AppNodeMatcher3.whenSpace,
|
|
897
|
-
connector: (space) => Effect3.succeed([
|
|
898
|
-
AppNode3.makeGroup({
|
|
899
|
-
id: Paths3.GroupSegments.content,
|
|
900
|
-
type: Paths3.GroupTypes.content,
|
|
901
|
-
label: [
|
|
902
|
-
"nav-tree-group-content.label",
|
|
903
|
-
{
|
|
904
|
-
ns: meta4.profile.key
|
|
905
|
-
}
|
|
906
|
-
],
|
|
907
|
-
space,
|
|
908
|
-
position: 200
|
|
909
|
-
})
|
|
910
|
-
])
|
|
911
|
-
}),
|
|
912
|
-
// Collections section virtual node under the content group.
|
|
913
|
-
GraphBuilder3.createExtension({
|
|
914
|
-
id: "collectionsSection",
|
|
915
|
-
match: AppNodeMatcher3.whenNavTreeGroup(Paths3.GroupTypes.content),
|
|
916
|
-
connector: (space, get) => {
|
|
917
|
-
get(Obj4.atom(space.properties));
|
|
918
|
-
const collectionRef = Annotation3.get(space.properties, AppAnnotation.RootCollectionAnnotation).pipe(Option3.getOrUndefined);
|
|
919
|
-
if (collectionRef) {
|
|
920
|
-
get(Obj4.atom(collectionRef));
|
|
921
|
-
}
|
|
922
|
-
const rootCollection = collectionRef?.target;
|
|
923
|
-
const collectionPartials = rootCollection ? AppNode3.getCollectionGraphNodePartials({
|
|
924
|
-
db: space.db,
|
|
925
|
-
collection: rootCollection
|
|
926
|
-
}) : void 0;
|
|
927
|
-
return Effect3.succeed([
|
|
928
|
-
Node3.make({
|
|
929
|
-
id: Paths3.Segments.collections,
|
|
930
|
-
type: COLLECTIONS_SECTION_TYPE,
|
|
931
|
-
data: null,
|
|
932
|
-
properties: {
|
|
933
|
-
label: [
|
|
934
|
-
"collections-section.label",
|
|
935
|
-
{
|
|
936
|
-
ns: meta4.profile.key
|
|
937
|
-
}
|
|
938
|
-
],
|
|
939
|
-
icon: "ph--folder--regular",
|
|
940
|
-
iconHue: "indigo",
|
|
941
|
-
role: "branch",
|
|
942
|
-
testId: "spacePlugin.collectionsSection",
|
|
943
|
-
draggable: false,
|
|
944
|
-
droppable: false,
|
|
945
|
-
space,
|
|
946
|
-
...collectionPartials
|
|
947
|
-
}
|
|
948
|
-
})
|
|
949
|
-
]);
|
|
950
|
-
}
|
|
951
|
-
}),
|
|
952
|
-
// Root collection objects under the Collections virtual node.
|
|
953
|
-
GraphBuilder3.createExtension({
|
|
954
|
-
id: "collections",
|
|
955
|
-
match: (node) => {
|
|
956
|
-
const space = isSpace3(node.properties.space) ? node.properties.space : void 0;
|
|
957
|
-
return node.type === COLLECTIONS_SECTION_TYPE && space ? Option3.some(space) : Option3.none();
|
|
958
|
-
},
|
|
959
|
-
connector: (space, get) => {
|
|
960
|
-
const ephemeralAtom = capabilities.get(SpaceCapabilities3.EphemeralState);
|
|
961
|
-
const ephemeralState = get(ephemeralAtom);
|
|
962
|
-
get(Obj4.atom(space.properties));
|
|
963
|
-
const collectionRef = Annotation3.get(space.properties, AppAnnotation.RootCollectionAnnotation).pipe(Option3.getOrUndefined);
|
|
964
|
-
const collection = collectionRef ? get(Obj4.atom(collectionRef)) : void 0;
|
|
965
|
-
if (!collection) {
|
|
966
|
-
return Effect3.succeed([]);
|
|
967
|
-
}
|
|
968
|
-
const rawRefs = collection.objects ?? [];
|
|
969
|
-
const objects = rawRefs.map((ref) => {
|
|
970
|
-
get(Obj4.atom(ref));
|
|
971
|
-
return ref.target;
|
|
972
|
-
}).filter(isNonNullable2);
|
|
973
|
-
return Effect3.succeed(objects.map((object) => AppNode3.makeObject({
|
|
974
|
-
get,
|
|
975
|
-
db: space.db,
|
|
976
|
-
object,
|
|
977
|
-
navigable: ephemeralState.navigableCollections,
|
|
978
|
-
canDrop: AppNode3.CAN_DROP_COLLECTION_ITEM,
|
|
979
|
-
onRearrange: collectionRef?.target ? AppNode3.makeCollectionRearrangeCallback(collectionRef.target) : void 0
|
|
980
|
-
})).filter(isNonNullable2));
|
|
981
|
-
}
|
|
982
|
-
}),
|
|
983
|
-
// Children of Collection.Collection nodes.
|
|
984
|
-
GraphBuilder3.createExtension({
|
|
985
|
-
id: "objects",
|
|
986
|
-
match: (node) => Obj4.instanceOf(Collection2.Collection, node.data) ? Option3.some(node.data) : Option3.none(),
|
|
987
|
-
connector: (collection, get) => {
|
|
988
|
-
const ephemeralAtom = capabilities.get(SpaceCapabilities3.EphemeralState);
|
|
989
|
-
const ephemeralState = get(ephemeralAtom);
|
|
990
|
-
const db = Obj4.getDatabase(collection);
|
|
991
|
-
const collectionSnapshot = get(Obj4.atom(collection));
|
|
992
|
-
const refs = collectionSnapshot.objects ?? [];
|
|
993
|
-
const objects = refs.map((ref) => {
|
|
994
|
-
get(Obj4.atom(ref));
|
|
995
|
-
return ref.target;
|
|
996
|
-
}).filter(isNonNullable2);
|
|
997
|
-
return Effect3.succeed(objects.map((object) => db && AppNode3.makeObject({
|
|
998
|
-
get,
|
|
999
|
-
object,
|
|
1000
|
-
db,
|
|
1001
|
-
navigable: ephemeralState.navigableCollections,
|
|
1002
|
-
canDrop: AppNode3.CAN_DROP_COLLECTION_ITEM,
|
|
1003
|
-
onRearrange: AppNode3.makeCollectionRearrangeCallback(collection)
|
|
1004
|
-
})).filter(isNonNullable2));
|
|
1005
|
-
}
|
|
1006
|
-
}),
|
|
1007
|
-
// Object actions.
|
|
1008
|
-
GraphBuilder3.createExtension({
|
|
1009
|
-
id: "objectActions",
|
|
1010
|
-
match: (node) => {
|
|
1011
|
-
return node.data != null && Obj4.getDatabase(node.data) && Obj4.isObject(node.data) && Obj4.getTypename(node.data) === node.type ? Option3.some({
|
|
1012
|
-
object: node.data,
|
|
1013
|
-
nodeId: node.id
|
|
1014
|
-
}) : Option3.none();
|
|
1015
|
-
},
|
|
1016
|
-
actions: ({ object, nodeId }, get) => {
|
|
1017
|
-
const deletable = !Type3.isType(object);
|
|
1018
|
-
const [appGraph] = get(capabilities.atom(AppCapabilities3.AppGraph));
|
|
1019
|
-
const ephemeralAtom = capabilities.get(SpaceCapabilities3.EphemeralState);
|
|
1020
|
-
const ephemeralState = get(ephemeralAtom);
|
|
1021
|
-
if (!appGraph) {
|
|
1022
|
-
return Effect3.succeed([]);
|
|
1023
|
-
}
|
|
1024
|
-
const parentId = nodeId.substring(0, nodeId.lastIndexOf("/"));
|
|
1025
|
-
const parentNode = Option3.getOrUndefined(Graph2.getNode(appGraph.graph, parentId));
|
|
1026
|
-
const parentCollection = parentNode && Obj4.instanceOf(Collection2.Collection, parentNode.data) ? parentNode.data : void 0;
|
|
1027
|
-
return Effect3.succeed(constructObjectActions({
|
|
1028
|
-
object,
|
|
1029
|
-
nodeId,
|
|
1030
|
-
deletable,
|
|
1031
|
-
navigable: ephemeralState.navigableCollections,
|
|
1032
|
-
shareableLinkOrigin,
|
|
1033
|
-
parentCollection
|
|
1034
|
-
}));
|
|
1035
|
-
}
|
|
1036
|
-
}),
|
|
1037
|
-
// Action on the collections section header to add an object to the space's root collection.
|
|
1038
|
-
GraphBuilder3.createExtension({
|
|
1039
|
-
id: "collectionsSectionActions",
|
|
1040
|
-
match: (node) => {
|
|
1041
|
-
const space = isSpace3(node.properties.space) ? node.properties.space : void 0;
|
|
1042
|
-
return node.type === COLLECTIONS_SECTION_TYPE && space ? Option3.some(space) : Option3.none();
|
|
1043
|
-
},
|
|
1044
|
-
actions: (space) => Effect3.succeed([
|
|
1045
|
-
Node3.makeAction({
|
|
1046
|
-
id: SpaceOperation3.OpenCreateObject.meta.key,
|
|
1047
|
-
data: () => Effect3.gen(function* () {
|
|
1048
|
-
const rootCollection = Annotation3.get(space.properties, AppAnnotation.RootCollectionAnnotation).pipe(Option3.getOrUndefined)?.target;
|
|
1049
|
-
yield* Operation3.invoke(SpaceOperation3.OpenCreateObject, {
|
|
1050
|
-
// Qualified id of the collections section node (root/<spaceId>/collections), so the new
|
|
1051
|
-
// object's navigation path resolves under the section — the bare segment would not.
|
|
1052
|
-
target: rootCollection ?? space.db,
|
|
1053
|
-
targetNodeId: Paths3.getCollectionsPath(space.id)
|
|
1054
|
-
});
|
|
1055
|
-
}),
|
|
1056
|
-
properties: {
|
|
1057
|
-
label: CREATE_OBJECT_IN_COLLECTION_LABEL,
|
|
1058
|
-
icon: "ph--plus--regular",
|
|
1059
|
-
disposition: "list-item-primary",
|
|
1060
|
-
testId: "spacePlugin.createObject"
|
|
1061
|
-
}
|
|
1062
|
-
})
|
|
1063
|
-
])
|
|
1064
|
-
})
|
|
1065
|
-
]);
|
|
1066
|
-
});
|
|
1067
|
-
var constructObjectActions = ({ object, nodeId, deletable = true, navigable = false, shareableLinkOrigin, parentCollection }) => {
|
|
1068
|
-
const db = Obj4.getDatabase(object);
|
|
1069
|
-
invariant(db, "Database not found", { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 206, S: void 0, A: ["db", "'Database not found'"] });
|
|
1070
|
-
const typename = Obj4.getTypename(object);
|
|
1071
|
-
invariant(typename, "Object has no typename", { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 208, S: void 0, A: ["typename", "'Object has no typename'"] });
|
|
1072
|
-
const actions = [
|
|
1073
|
-
...Obj4.instanceOf(Collection2.Collection, object) ? [
|
|
1074
|
-
Node3.makeAction({
|
|
1075
|
-
id: SpaceOperation3.OpenCreateObject.meta.key,
|
|
1076
|
-
data: () => Operation3.invoke(SpaceOperation3.OpenCreateObject, {
|
|
1077
|
-
target: object,
|
|
1078
|
-
targetNodeId: nodeId
|
|
1079
|
-
}),
|
|
1080
|
-
properties: {
|
|
1081
|
-
label: CREATE_OBJECT_IN_COLLECTION_LABEL,
|
|
1082
|
-
icon: "ph--plus--regular",
|
|
1083
|
-
disposition: "list-item-primary",
|
|
1084
|
-
testId: "spacePlugin.createObject"
|
|
1085
|
-
}
|
|
1086
|
-
})
|
|
1087
|
-
] : [],
|
|
1088
|
-
Node3.makeAction({
|
|
1089
|
-
id: SpaceOperation3.RenameObject.meta.key,
|
|
1090
|
-
data: (params) => Operation3.invoke(SpaceOperation3.RenameObject, {
|
|
1091
|
-
object,
|
|
1092
|
-
caller: `${params?.caller}:${params?.parent?.id}`
|
|
1093
|
-
}),
|
|
1094
|
-
properties: {
|
|
1095
|
-
label: AppNode3.getDynamicLabel("rename-object.label", typename, {
|
|
1096
|
-
defaultValue: "Rename"
|
|
1097
|
-
}),
|
|
1098
|
-
icon: "ph--pencil-simple-line--regular",
|
|
1099
|
-
disposition: "list-item",
|
|
1100
|
-
testId: "spacePlugin.renameObject"
|
|
1101
|
-
}
|
|
1102
|
-
}),
|
|
1103
|
-
Node3.makeAction({
|
|
1104
|
-
id: SpaceOperation3.RemoveObjects.meta.key,
|
|
1105
|
-
data: () => Operation3.invoke(SpaceOperation3.RemoveObjects, {
|
|
1106
|
-
objects: [
|
|
1107
|
-
object
|
|
1108
|
-
],
|
|
1109
|
-
target: parentCollection
|
|
1110
|
-
}),
|
|
1111
|
-
properties: {
|
|
1112
|
-
label: AppNode3.getDynamicLabel("delete-object.label", typename, {
|
|
1113
|
-
defaultValue: "Delete"
|
|
1114
|
-
}),
|
|
1115
|
-
icon: "ph--trash--regular",
|
|
1116
|
-
disposition: "list-item",
|
|
1117
|
-
disabled: !deletable,
|
|
1118
|
-
testId: "spacePlugin.deleteObject"
|
|
1119
|
-
}
|
|
1120
|
-
}),
|
|
1121
|
-
...navigable || !Obj4.instanceOf(Collection2.Collection, object) ? [
|
|
1122
|
-
Node3.makeAction({
|
|
1123
|
-
id: "copyLink",
|
|
1124
|
-
data: () => Effect3.promise(async () => {
|
|
1125
|
-
const url = new URL(Paths3.toUrlPath(nodeId), shareableLinkOrigin);
|
|
1126
|
-
await navigator.clipboard.writeText(url.toString());
|
|
1127
|
-
}),
|
|
1128
|
-
properties: {
|
|
1129
|
-
label: COPY_LINK_LABEL,
|
|
1130
|
-
icon: "ph--link--regular",
|
|
1131
|
-
disposition: "list-item",
|
|
1132
|
-
testId: "spacePlugin.copyLink"
|
|
1133
|
-
}
|
|
1134
|
-
})
|
|
1135
|
-
] : [],
|
|
1136
|
-
Node3.makeAction({
|
|
1137
|
-
id: LayoutOperation2.Expose.meta.key,
|
|
1138
|
-
data: () => Operation3.invoke(LayoutOperation2.Expose, {
|
|
1139
|
-
subject: Paths3.getObjectPathFromObject(object)
|
|
1140
|
-
}),
|
|
1141
|
-
properties: {
|
|
1142
|
-
label: EXPOSE_OBJECT_LABEL,
|
|
1143
|
-
icon: "ph--eye--regular",
|
|
1144
|
-
disposition: "heading-list-item",
|
|
1145
|
-
testId: "spacePlugin.exposeObject"
|
|
1146
|
-
}
|
|
1147
|
-
})
|
|
1148
|
-
];
|
|
1149
|
-
return actions;
|
|
1150
|
-
};
|
|
1151
|
-
|
|
1152
|
-
// src/capabilities/app-graph-builder/extensions/companions.ts
|
|
1153
|
-
import * as Effect4 from "effect/Effect";
|
|
1154
|
-
import * as Option4 from "effect/Option";
|
|
1155
|
-
import { AppNode as AppNode4 } from "@dxos/app-toolkit";
|
|
1156
|
-
import { Obj as Obj5, Type as Type4 } from "@dxos/echo";
|
|
1157
|
-
import { GraphBuilder as GraphBuilder4, NodeMatcher as NodeMatcher2 } from "@dxos/plugin-graph";
|
|
1158
|
-
import { linkedSegment } from "@dxos/react-ui-attention";
|
|
1159
|
-
import { ViewAnnotation as ViewAnnotation3 } from "@dxos/schema";
|
|
1160
|
-
import { Position as Position2 } from "@dxos/util";
|
|
1161
|
-
import { meta as meta5 } from "#meta";
|
|
1162
|
-
var createCompanionExtensions = Effect4.fnUntraced(function* () {
|
|
1163
|
-
return yield* Effect4.all([
|
|
1164
|
-
// Object settings plank companion.
|
|
1165
|
-
GraphBuilder4.createExtension({
|
|
1166
|
-
id: "settings",
|
|
1167
|
-
match: NodeMatcher2.whenEchoObjectMatches,
|
|
1168
|
-
connector: (node) => Effect4.succeed([
|
|
1169
|
-
AppNode4.makeCompanion({
|
|
1170
|
-
id: linkedSegment("settings"),
|
|
1171
|
-
label: [
|
|
1172
|
-
"object-properties.label",
|
|
1173
|
-
{
|
|
1174
|
-
ns: meta5.profile.key
|
|
1175
|
-
}
|
|
1176
|
-
],
|
|
1177
|
-
icon: "ph--sliders--regular",
|
|
1178
|
-
data: "settings",
|
|
1179
|
-
position: Position2.last
|
|
1180
|
-
})
|
|
1181
|
-
])
|
|
1182
|
-
}),
|
|
1183
|
-
// Related objects plank companion.
|
|
1184
|
-
GraphBuilder4.createExtension({
|
|
1185
|
-
id: "related",
|
|
1186
|
-
match: NodeMatcher2.whenEchoObjectMatches,
|
|
1187
|
-
connector: (node) => Effect4.succeed([
|
|
1188
|
-
AppNode4.makeCompanion({
|
|
1189
|
-
id: linkedSegment("related"),
|
|
1190
|
-
label: [
|
|
1191
|
-
"companion-related.label",
|
|
1192
|
-
{
|
|
1193
|
-
ns: meta5.profile.key
|
|
1194
|
-
}
|
|
1195
|
-
],
|
|
1196
|
-
icon: "ph--graph--regular",
|
|
1197
|
-
data: "related",
|
|
1198
|
-
position: Position2.last
|
|
1199
|
-
})
|
|
1200
|
-
])
|
|
1201
|
-
}),
|
|
1202
|
-
// View selected objects companion.
|
|
1203
|
-
GraphBuilder4.createExtension({
|
|
1204
|
-
id: "selectedObjects",
|
|
1205
|
-
match: (node) => {
|
|
1206
|
-
if (!Obj5.isObject(node.data)) {
|
|
1207
|
-
return Option4.none();
|
|
1208
|
-
}
|
|
1209
|
-
const type = Obj5.getType(node.data);
|
|
1210
|
-
const path = type ? ViewAnnotation3.get(Type4.getSchema(type)).pipe(Option4.getOrElse(() => [])) : [];
|
|
1211
|
-
const isEchoViewBacked = type && path.length > 0 ? ViewAnnotation3.hasRefAlongPath(node.data, path) : false;
|
|
1212
|
-
if (!isEchoViewBacked) {
|
|
1213
|
-
return Option4.none();
|
|
1214
|
-
}
|
|
1215
|
-
return Option4.some(node);
|
|
1216
|
-
},
|
|
1217
|
-
connector: (node) => Effect4.succeed([
|
|
1218
|
-
AppNode4.makeCompanion({
|
|
1219
|
-
id: linkedSegment("selected-objects"),
|
|
1220
|
-
label: [
|
|
1221
|
-
"companion-selected-objects.label",
|
|
1222
|
-
{
|
|
1223
|
-
ns: meta5.profile.key
|
|
1224
|
-
}
|
|
1225
|
-
],
|
|
1226
|
-
icon: "ph--tree-view--regular",
|
|
1227
|
-
data: "selected-objects"
|
|
1228
|
-
})
|
|
1229
|
-
])
|
|
1230
|
-
})
|
|
1231
|
-
]);
|
|
1232
|
-
});
|
|
1233
|
-
|
|
1234
|
-
// src/capabilities/app-graph-builder/extensions/settings.ts
|
|
1235
|
-
import * as Effect5 from "effect/Effect";
|
|
1236
|
-
import { AppNode as AppNode5, AppNodeMatcher as AppNodeMatcher4, AppSpace as AppSpace2 } from "@dxos/app-toolkit";
|
|
1237
|
-
import { GraphBuilder as GraphBuilder5, Node as Node4 } from "@dxos/plugin-graph";
|
|
1238
|
-
import { Position as Position3 } from "@dxos/util";
|
|
1239
|
-
import { meta as meta6 } from "#meta";
|
|
1240
|
-
import { SETTINGS_SECTION_ID, SETTINGS_SECTION_TYPE } from "#types";
|
|
1241
|
-
var createSettingsExtensions = Effect5.fnUntraced(function* () {
|
|
1242
|
-
const sectionExtension = yield* GraphBuilder5.createExtension({
|
|
1243
|
-
id: "settingsSection",
|
|
1244
|
-
match: AppNodeMatcher4.whenSpace,
|
|
1245
|
-
connector: (space) => Effect5.succeed([
|
|
1246
|
-
AppNode5.makeSection({
|
|
1247
|
-
id: SETTINGS_SECTION_ID,
|
|
1248
|
-
type: SETTINGS_SECTION_TYPE,
|
|
1249
|
-
label: [
|
|
1250
|
-
"settings-section.label",
|
|
1251
|
-
{
|
|
1252
|
-
ns: meta6.profile.key
|
|
1253
|
-
}
|
|
1254
|
-
],
|
|
1255
|
-
icon: "ph--sliders--regular",
|
|
1256
|
-
iconHue: "emerald",
|
|
1257
|
-
space,
|
|
1258
|
-
position: Position3.first,
|
|
1259
|
-
testId: "spacePlugin.settings"
|
|
1260
|
-
})
|
|
1261
|
-
])
|
|
1262
|
-
});
|
|
1263
|
-
const childrenExtension = yield* GraphBuilder5.createExtension({
|
|
1264
|
-
id: "settingsSections",
|
|
1265
|
-
match: AppNodeMatcher4.whenSpaceSettings,
|
|
1266
|
-
connector: (space) => {
|
|
1267
|
-
const personal = AppSpace2.isPersonalSpace(space);
|
|
1268
|
-
return Effect5.succeed([
|
|
1269
|
-
Node4.make({
|
|
1270
|
-
id: "general",
|
|
1271
|
-
type: `${meta6.profile.key}.general`,
|
|
1272
|
-
data: `${meta6.profile.key}.general`,
|
|
1273
|
-
properties: {
|
|
1274
|
-
label: [
|
|
1275
|
-
"space-settings-properties.label",
|
|
1276
|
-
{
|
|
1277
|
-
ns: meta6.profile.key
|
|
1278
|
-
}
|
|
1279
|
-
],
|
|
1280
|
-
icon: "ph--brackets-curly--regular",
|
|
1281
|
-
iconHue: "emerald",
|
|
1282
|
-
space,
|
|
1283
|
-
position: Position3.first,
|
|
1284
|
-
testId: "spacePlugin.general"
|
|
1285
|
-
}
|
|
1286
|
-
}),
|
|
1287
|
-
...!personal ? [
|
|
1288
|
-
Node4.make({
|
|
1289
|
-
id: "members",
|
|
1290
|
-
type: `${meta6.profile.key}.members`,
|
|
1291
|
-
data: `${meta6.profile.key}.members`,
|
|
1292
|
-
properties: {
|
|
1293
|
-
label: [
|
|
1294
|
-
"members-panel.label",
|
|
1295
|
-
{
|
|
1296
|
-
ns: meta6.profile.key
|
|
1297
|
-
}
|
|
1298
|
-
],
|
|
1299
|
-
icon: "ph--users--regular",
|
|
1300
|
-
iconHue: "emerald",
|
|
1301
|
-
space,
|
|
1302
|
-
position: Position3.first,
|
|
1303
|
-
testId: "spacePlugin.members"
|
|
1304
|
-
}
|
|
1305
|
-
})
|
|
1306
|
-
] : []
|
|
1307
|
-
]);
|
|
1308
|
-
}
|
|
1309
|
-
});
|
|
1310
|
-
return [
|
|
1311
|
-
sectionExtension,
|
|
1312
|
-
childrenExtension
|
|
1313
|
-
];
|
|
1314
|
-
});
|
|
1315
|
-
|
|
1316
|
-
// src/capabilities/app-graph-builder/app-graph-builder.ts
|
|
1317
|
-
var app_graph_builder_default = Capability4.makeModule(Effect6.fnUntraced(function* ({ shareableLinkOrigin = window.location.origin } = {}) {
|
|
1318
|
-
const extensions = yield* Effect6.all([
|
|
1319
|
-
createSpaceExtensions(),
|
|
1320
|
-
createSettingsExtensions(),
|
|
1321
|
-
createDatabaseExtensions(),
|
|
1322
|
-
createCollectionExtensions({
|
|
1323
|
-
shareableLinkOrigin
|
|
1324
|
-
}),
|
|
1325
|
-
createCompanionExtensions()
|
|
1326
|
-
]);
|
|
1327
|
-
return Capability4.contributes(AppCapabilities4.AppGraphBuilder, extensions.flat());
|
|
1328
|
-
}));
|
|
1329
|
-
export {
|
|
1330
|
-
app_graph_builder_default as default
|
|
1331
|
-
};
|
|
1332
|
-
//# sourceMappingURL=app-graph-builder-7H2KOD4B.mjs.map
|