@dxos/plugin-space 0.8.4-main.c1de068 → 0.8.4-main.c4373fc
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/browser/{CollectionMain-D2B75XBS.mjs → CollectionMain-AX7KKXWP.mjs} +4 -4
- package/dist/lib/browser/CollectionMain-AX7KKXWP.mjs.map +7 -0
- package/dist/lib/browser/{ObjectDetailsPanel-YPTDQKMG.mjs → ObjectDetailsPanel-SJ4XUXXX.mjs} +11 -9
- package/dist/lib/browser/ObjectDetailsPanel-SJ4XUXXX.mjs.map +7 -0
- package/dist/lib/browser/RecordMain-FHPCS6GM.mjs +68 -0
- package/dist/lib/browser/RecordMain-FHPCS6GM.mjs.map +7 -0
- package/dist/lib/browser/{app-graph-builder-7CZZJS3S.mjs → app-graph-builder-Y2LBZX2G.mjs} +102 -61
- package/dist/lib/browser/app-graph-builder-Y2LBZX2G.mjs.map +7 -0
- package/dist/lib/browser/{app-graph-serializer-H6AW7KGS.mjs → app-graph-serializer-425OVRTW.mjs} +14 -14
- package/dist/lib/browser/app-graph-serializer-425OVRTW.mjs.map +7 -0
- package/dist/lib/browser/{chunk-V7MJSSBQ.mjs → chunk-6KVKMOGQ.mjs} +148 -157
- package/dist/lib/browser/chunk-6KVKMOGQ.mjs.map +7 -0
- package/dist/lib/browser/{chunk-VLBRSGJ2.mjs → chunk-CVZAZRW4.mjs} +4 -4
- package/dist/lib/browser/chunk-CVZAZRW4.mjs.map +7 -0
- package/dist/lib/browser/chunk-EIXZABXD.mjs +19 -0
- package/dist/lib/browser/chunk-EIXZABXD.mjs.map +7 -0
- package/dist/lib/browser/chunk-IRKDREHY.mjs +11 -0
- package/dist/lib/browser/chunk-IRKDREHY.mjs.map +7 -0
- package/dist/lib/browser/{chunk-SGTQ52SU.mjs → chunk-OYHC63NL.mjs} +16 -10
- package/dist/lib/browser/chunk-OYHC63NL.mjs.map +7 -0
- package/dist/lib/browser/chunk-PUF3B7XO.mjs +20 -0
- package/dist/lib/browser/chunk-PUF3B7XO.mjs.map +7 -0
- package/dist/lib/browser/{chunk-XUYKJUU7.mjs → chunk-X6COEDOD.mjs} +99 -44
- package/dist/lib/browser/chunk-X6COEDOD.mjs.map +7 -0
- package/dist/lib/browser/{chunk-QACNNDOT.mjs → chunk-YZJWWMNB.mjs} +11 -10
- package/dist/lib/browser/chunk-YZJWWMNB.mjs.map +7 -0
- package/dist/lib/browser/{identity-created-23XJJV2N.mjs → identity-created-PW2BA46S.mjs} +4 -4
- package/dist/lib/browser/{identity-created-23XJJV2N.mjs.map → identity-created-PW2BA46S.mjs.map} +3 -3
- package/dist/lib/browser/index.mjs +20 -40
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-resolver-TIXVDYN7.mjs → intent-resolver-2TBYHOBA.mjs} +47 -42
- package/dist/lib/browser/intent-resolver-2TBYHOBA.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-root-N2J7TDRX.mjs → react-root-KMJXJ5VX.mjs} +11 -11
- package/dist/lib/browser/react-root-KMJXJ5VX.mjs.map +7 -0
- package/dist/lib/browser/{react-surface-TPNLWJJH.mjs → react-surface-YAJUAMER.mjs} +53 -42
- package/dist/lib/browser/react-surface-YAJUAMER.mjs.map +7 -0
- package/dist/lib/browser/{schema-defs-Z6FC4AHC.mjs → schema-defs-2OCPV7JF.mjs} +5 -5
- package/dist/lib/browser/schema-defs-2OCPV7JF.mjs.map +7 -0
- package/dist/lib/browser/{settings-4IMP5RYT.mjs → settings-UYYJ225A.mjs} +5 -5
- package/dist/lib/browser/{settings-4IMP5RYT.mjs.map → settings-UYYJ225A.mjs.map} +1 -1
- package/dist/lib/browser/{spaces-ready-TOPG6IV4.mjs → spaces-ready-YNZPWXA3.mjs} +18 -16
- package/dist/lib/browser/spaces-ready-YNZPWXA3.mjs.map +7 -0
- package/dist/lib/browser/{state-QYZAB45H.mjs → state-BPU73TYO.mjs} +7 -7
- package/dist/lib/browser/state-BPU73TYO.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +2 -2
- package/dist/lib/node-esm/{CollectionMain-ZJIFCWKZ.mjs → CollectionMain-EU57SRYK.mjs} +4 -4
- package/dist/lib/node-esm/CollectionMain-EU57SRYK.mjs.map +7 -0
- package/dist/lib/node-esm/{ObjectDetailsPanel-QKZEDSZK.mjs → ObjectDetailsPanel-P7D727OV.mjs} +11 -9
- package/dist/lib/node-esm/ObjectDetailsPanel-P7D727OV.mjs.map +7 -0
- package/dist/lib/node-esm/RecordMain-V73AEB6N.mjs +70 -0
- package/dist/lib/node-esm/RecordMain-V73AEB6N.mjs.map +7 -0
- package/dist/lib/node-esm/{app-graph-builder-KGIGWC72.mjs → app-graph-builder-DMNLDT7E.mjs} +102 -61
- package/dist/lib/node-esm/app-graph-builder-DMNLDT7E.mjs.map +7 -0
- package/dist/lib/node-esm/{app-graph-serializer-2ICUGQQT.mjs → app-graph-serializer-ZEDSY77N.mjs} +14 -14
- package/dist/lib/node-esm/app-graph-serializer-ZEDSY77N.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-36TAYXV7.mjs +21 -0
- package/dist/lib/node-esm/chunk-36TAYXV7.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-P442DOQ3.mjs → chunk-7UIEPBQJ.mjs} +11 -10
- package/dist/lib/node-esm/chunk-7UIEPBQJ.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-JH6F4C3I.mjs → chunk-ADEZJQE3.mjs} +16 -10
- package/dist/lib/node-esm/chunk-ADEZJQE3.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-SSLBYZEY.mjs → chunk-FLRC6XWU.mjs} +4 -4
- package/dist/lib/node-esm/chunk-FLRC6XWU.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-6X5DLJM5.mjs → chunk-L26ZIGHA.mjs} +148 -157
- package/dist/lib/node-esm/chunk-L26ZIGHA.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-HWNG4MEU.mjs → chunk-MWNATOXL.mjs} +2 -4
- package/dist/lib/node-esm/chunk-MWNATOXL.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-SVFKU7EW.mjs +20 -0
- package/dist/lib/node-esm/chunk-SVFKU7EW.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-4AOMYKDE.mjs → chunk-ZFCCFELA.mjs} +99 -44
- package/dist/lib/node-esm/chunk-ZFCCFELA.mjs.map +7 -0
- package/dist/lib/node-esm/{identity-created-IJQO6GCR.mjs → identity-created-MWTLGQRU.mjs} +4 -4
- package/dist/lib/node-esm/{identity-created-IJQO6GCR.mjs.map → identity-created-MWTLGQRU.mjs.map} +3 -3
- package/dist/lib/node-esm/index.mjs +20 -40
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/{intent-resolver-MHGHRGDT.mjs → intent-resolver-YOG27WOG.mjs} +47 -42
- package/dist/lib/node-esm/intent-resolver-YOG27WOG.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-root-KW3TGJGY.mjs → react-root-27QMJZD2.mjs} +11 -11
- package/dist/lib/node-esm/react-root-27QMJZD2.mjs.map +7 -0
- package/dist/lib/node-esm/{react-surface-UUIUUD6P.mjs → react-surface-RC73GAN5.mjs} +53 -42
- package/dist/lib/node-esm/react-surface-RC73GAN5.mjs.map +7 -0
- package/dist/lib/node-esm/{schema-defs-WHJM7UZE.mjs → schema-defs-X2Z7F2EV.mjs} +5 -5
- package/dist/lib/node-esm/schema-defs-X2Z7F2EV.mjs.map +7 -0
- package/dist/lib/node-esm/{settings-SAOBPND3.mjs → settings-Q736OQRP.mjs} +5 -5
- package/dist/lib/node-esm/{settings-SAOBPND3.mjs.map → settings-Q736OQRP.mjs.map} +1 -1
- package/dist/lib/node-esm/{spaces-ready-HIUKNDZK.mjs → spaces-ready-XZQD7Q65.mjs} +18 -16
- package/dist/lib/node-esm/spaces-ready-XZQD7Q65.mjs.map +7 -0
- package/dist/lib/node-esm/{state-ZVEHQ4BJ.mjs → state-BY75TM32.mjs} +7 -7
- package/dist/lib/node-esm/state-BY75TM32.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +2 -2
- package/dist/types/src/SpacePlugin.d.ts +1 -1
- package/dist/types/src/SpacePlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-serializer.d.ts +1 -1
- package/dist/types/src/capabilities/capabilities.d.ts +4 -4
- package/dist/types/src/capabilities/capabilities.d.ts.map +1 -1
- package/dist/types/src/capabilities/identity-created.d.ts +1 -1
- package/dist/types/src/capabilities/identity-created.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +11 -12
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-root.d.ts +2 -2
- package/dist/types/src/capabilities/react-root.d.ts.map +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/schema-defs.d.ts +1 -1
- package/dist/types/src/capabilities/schema-defs.d.ts.map +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/spaces-ready.d.ts.map +1 -1
- package/dist/types/src/capabilities/state.d.ts +1 -1
- package/dist/types/src/capabilities/state.d.ts.map +1 -1
- package/dist/types/src/components/CreateDialog/CreateObjectDialog.d.ts +3 -3
- package/dist/types/src/components/CreateDialog/CreateObjectDialog.d.ts.map +1 -1
- package/dist/types/src/components/CreateDialog/CreateObjectDialog.stories.d.ts +1584 -4
- package/dist/types/src/components/CreateDialog/CreateObjectDialog.stories.d.ts.map +1 -1
- package/dist/types/src/components/CreateDialog/CreateObjectPanel.d.ts +5 -3
- package/dist/types/src/components/CreateDialog/CreateObjectPanel.d.ts.map +1 -1
- package/dist/types/src/components/CreateDialog/CreateSpaceDialog.d.ts +1 -1
- package/dist/types/src/components/CreateDialog/CreateSpaceDialog.d.ts.map +1 -1
- package/dist/types/src/components/JoinDialog.d.ts +1 -1
- package/dist/types/src/components/JoinDialog.d.ts.map +1 -1
- package/dist/types/src/components/MembersContainer.d.ts +3 -2
- package/dist/types/src/components/MembersContainer.d.ts.map +1 -1
- package/dist/types/src/components/MembersContainer.stories.d.ts +1584 -5
- package/dist/types/src/components/MembersContainer.stories.d.ts.map +1 -1
- package/dist/types/src/components/ObjectDetailsPanel.d.ts.map +1 -1
- package/dist/types/src/components/ObjectSettings/AdvancedObjectSettings.d.ts.map +1 -1
- package/dist/types/src/components/ObjectSettings/ForeignKeys.d.ts +1 -1
- package/dist/types/src/components/ObjectSettings/ForeignKeys.d.ts.map +1 -1
- package/dist/types/src/components/ObjectSettings/ObjectSettingsContainer.d.ts.map +1 -1
- package/dist/types/src/components/PopoverRenameObject.d.ts +2 -2
- package/dist/types/src/components/PopoverRenameObject.d.ts.map +1 -1
- package/dist/types/src/components/PopoverRenameSpace.d.ts +1 -1
- package/dist/types/src/components/PopoverRenameSpace.d.ts.map +1 -1
- package/dist/types/src/components/RecordMain.d.ts +7 -0
- package/dist/types/src/components/RecordMain.d.ts.map +1 -0
- package/dist/types/src/components/SpacePluginSettings.d.ts.map +1 -1
- package/dist/types/src/components/SpacePresence.d.ts.map +1 -1
- package/dist/types/src/components/SpacePresence.stories.d.ts +1412 -4
- package/dist/types/src/components/SpacePresence.stories.d.ts.map +1 -1
- package/dist/types/src/components/SpaceSettings/SpaceSettingsContainer.d.ts.map +1 -1
- package/dist/types/src/components/SpaceSettings/SpaceSettingsContainer.stories.d.ts +1417 -4
- package/dist/types/src/components/SpaceSettings/SpaceSettingsContainer.stories.d.ts.map +1 -1
- package/dist/types/src/components/SyncStatus/SyncStatus.d.ts.map +1 -1
- package/dist/types/src/components/SyncStatus/SyncStatus.stories.d.ts +1418 -5
- package/dist/types/src/components/SyncStatus/SyncStatus.stories.d.ts.map +1 -1
- package/dist/types/src/components/ViewEditor.d.ts +1 -1
- package/dist/types/src/components/ViewEditor.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +8 -2
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/events.d.ts.map +1 -1
- package/dist/types/src/hooks/useActiveSpace.d.ts.map +1 -1
- package/dist/types/src/hooks/useInputSurfaceLookup.d.ts +1 -1
- package/dist/types/src/hooks/useInputSurfaceLookup.d.ts.map +1 -1
- package/dist/types/src/hooks/usePath.d.ts +1 -1
- package/dist/types/src/hooks/usePath.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +0 -1
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +1216 -26
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +76 -96
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/src/util.d.ts +10 -7
- package/dist/types/src/util.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +60 -58
- package/src/SpacePlugin.ts +204 -219
- package/src/capabilities/app-graph-builder.ts +127 -69
- package/src/capabilities/app-graph-serializer.ts +7 -7
- package/src/capabilities/capabilities.ts +12 -11
- package/src/capabilities/identity-created.ts +1 -1
- package/src/capabilities/index.ts +0 -1
- package/src/capabilities/intent-resolver.ts +37 -25
- package/src/capabilities/react-root.tsx +4 -3
- package/src/capabilities/react-surface.tsx +52 -38
- package/src/capabilities/schema-defs.ts +3 -2
- package/src/capabilities/spaces-ready.ts +11 -8
- package/src/capabilities/state.ts +5 -4
- package/src/components/AwaitingObject.tsx +3 -3
- package/src/components/CollectionMain.tsx +2 -2
- package/src/components/CollectionSection.tsx +2 -2
- package/src/components/CreateDialog/CreateObjectDialog.stories.tsx +11 -10
- package/src/components/CreateDialog/CreateObjectDialog.tsx +24 -13
- package/src/components/CreateDialog/CreateObjectPanel.tsx +22 -11
- package/src/components/CreateDialog/CreateSpaceDialog.tsx +6 -5
- package/src/components/JoinDialog.tsx +7 -7
- package/src/components/MembersContainer.stories.tsx +36 -10
- package/src/components/MembersContainer.tsx +13 -14
- package/src/components/MenuFooter.tsx +2 -2
- package/src/components/ObjectDetailsPanel.tsx +7 -5
- package/src/components/ObjectSettings/AdvancedObjectSettings.tsx +4 -3
- package/src/components/ObjectSettings/ForeignKeys.tsx +3 -3
- package/src/components/ObjectSettings/ObjectSettingsContainer.tsx +3 -2
- package/src/components/PersistenceStatus.tsx +2 -2
- package/src/components/PopoverRenameObject.tsx +9 -15
- package/src/components/PopoverRenameSpace.tsx +4 -4
- package/src/components/RecordMain.tsx +43 -0
- package/src/components/SchemaContainer.tsx +5 -5
- package/src/components/SpacePluginSettings.tsx +8 -9
- package/src/components/SpacePresence.stories.tsx +23 -22
- package/src/components/SpacePresence.tsx +10 -10
- package/src/components/SpaceSettings/SpaceSettingsContainer.stories.tsx +17 -9
- package/src/components/SpaceSettings/SpaceSettingsContainer.tsx +19 -18
- package/src/components/SyncStatus/InlineSyncStatus.tsx +3 -3
- package/src/components/SyncStatus/SyncStatus.stories.tsx +6 -7
- package/src/components/SyncStatus/SyncStatus.tsx +4 -3
- package/src/components/ViewEditor.tsx +13 -18
- package/src/components/index.ts +1 -0
- package/src/events.ts +7 -7
- package/src/hooks/useActiveSpace.ts +2 -2
- package/src/hooks/useInputSurfaceLookup.tsx +2 -2
- package/src/hooks/usePath.ts +1 -1
- package/src/meta.ts +1 -3
- package/src/translations.ts +9 -8
- package/src/types/types.ts +17 -13
- package/src/util.tsx +97 -40
- package/dist/lib/browser/CollectionMain-D2B75XBS.mjs.map +0 -7
- package/dist/lib/browser/ObjectDetailsPanel-YPTDQKMG.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-7CZZJS3S.mjs.map +0 -7
- package/dist/lib/browser/app-graph-serializer-H6AW7KGS.mjs.map +0 -7
- package/dist/lib/browser/chunk-CEFHNVU7.mjs +0 -20
- package/dist/lib/browser/chunk-CEFHNVU7.mjs.map +0 -7
- package/dist/lib/browser/chunk-FBCGT5YY.mjs +0 -13
- package/dist/lib/browser/chunk-FBCGT5YY.mjs.map +0 -7
- package/dist/lib/browser/chunk-JS3MMC42.mjs +0 -19
- package/dist/lib/browser/chunk-JS3MMC42.mjs.map +0 -7
- package/dist/lib/browser/chunk-QACNNDOT.mjs.map +0 -7
- package/dist/lib/browser/chunk-SGTQ52SU.mjs.map +0 -7
- package/dist/lib/browser/chunk-V7MJSSBQ.mjs.map +0 -7
- package/dist/lib/browser/chunk-VLBRSGJ2.mjs.map +0 -7
- package/dist/lib/browser/chunk-XUYKJUU7.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-TIXVDYN7.mjs.map +0 -7
- package/dist/lib/browser/react-root-N2J7TDRX.mjs.map +0 -7
- package/dist/lib/browser/react-surface-TPNLWJJH.mjs.map +0 -7
- package/dist/lib/browser/schema-defs-Z6FC4AHC.mjs.map +0 -7
- package/dist/lib/browser/schema-tools-BNP4JTD7.mjs +0 -124
- package/dist/lib/browser/schema-tools-BNP4JTD7.mjs.map +0 -7
- package/dist/lib/browser/spaces-ready-TOPG6IV4.mjs.map +0 -7
- package/dist/lib/browser/state-QYZAB45H.mjs.map +0 -7
- package/dist/lib/node-esm/CollectionMain-ZJIFCWKZ.mjs.map +0 -7
- package/dist/lib/node-esm/ObjectDetailsPanel-QKZEDSZK.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-KGIGWC72.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-serializer-2ICUGQQT.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-4AOMYKDE.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-5HHYE264.mjs +0 -20
- package/dist/lib/node-esm/chunk-5HHYE264.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-5T3ZH23B.mjs +0 -21
- package/dist/lib/node-esm/chunk-5T3ZH23B.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-6X5DLJM5.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HWNG4MEU.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-JH6F4C3I.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-P442DOQ3.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-SSLBYZEY.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-MHGHRGDT.mjs.map +0 -7
- package/dist/lib/node-esm/react-root-KW3TGJGY.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-UUIUUD6P.mjs.map +0 -7
- package/dist/lib/node-esm/schema-defs-WHJM7UZE.mjs.map +0 -7
- package/dist/lib/node-esm/schema-tools-KWW5PTML.mjs +0 -126
- package/dist/lib/node-esm/schema-tools-KWW5PTML.mjs.map +0 -7
- package/dist/lib/node-esm/spaces-ready-HIUKNDZK.mjs.map +0 -7
- package/dist/lib/node-esm/state-ZVEHQ4BJ.mjs.map +0 -7
- package/dist/types/src/capabilities/schema-tool.test.d.ts +0 -2
- package/dist/types/src/capabilities/schema-tool.test.d.ts.map +0 -1
- package/dist/types/src/capabilities/schema-tools.d.ts +0 -13
- package/dist/types/src/capabilities/schema-tools.d.ts.map +0 -1
- package/src/capabilities/schema-tool.test.ts +0 -44
- package/src/capabilities/schema-tools.ts +0 -125
|
@@ -3,23 +3,27 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { Rx } from '@effect-rx/rx-react';
|
|
6
|
-
import
|
|
6
|
+
import * as Array from 'effect/Array';
|
|
7
|
+
import * as Function from 'effect/Function';
|
|
8
|
+
import * as Option from 'effect/Option';
|
|
9
|
+
import * as Schema from 'effect/Schema';
|
|
7
10
|
|
|
8
|
-
import { Capabilities, contributes, createIntent
|
|
9
|
-
import {
|
|
11
|
+
import { Capabilities, type PluginContext, contributes, createIntent } from '@dxos/app-framework';
|
|
12
|
+
import { type QueryResult, type Space, SpaceState, getSpace, isSpace, parseId } from '@dxos/client/echo';
|
|
10
13
|
import { Filter, Obj, Query, Type } from '@dxos/echo';
|
|
11
14
|
import { log } from '@dxos/log';
|
|
12
15
|
import { ClientCapabilities } from '@dxos/plugin-client';
|
|
13
|
-
import {
|
|
14
|
-
import { createExtension, rxFromObservable,
|
|
15
|
-
import { DataType } from '@dxos/schema';
|
|
16
|
+
import { ATTENDABLE_PATH_SEPARATOR, PLANK_COMPANION_TYPE } from '@dxos/plugin-deck/types';
|
|
17
|
+
import { ROOT_ID, createExtension, rxFromObservable, rxFromSignal } from '@dxos/plugin-graph';
|
|
18
|
+
import { DataType, getTypenameFromQuery } from '@dxos/schema';
|
|
16
19
|
import { isNonNullable } from '@dxos/util';
|
|
17
20
|
|
|
18
|
-
import { SpaceCapabilities } from './capabilities';
|
|
19
21
|
import { getActiveSpace } from '../hooks';
|
|
20
|
-
import {
|
|
22
|
+
import { meta } from '../meta';
|
|
21
23
|
import { SPACE_TYPE, SpaceAction, type SpaceSettingsProps } from '../types';
|
|
22
24
|
import {
|
|
25
|
+
SHARED,
|
|
26
|
+
SPACES,
|
|
23
27
|
constructObjectActions,
|
|
24
28
|
constructSpaceActions,
|
|
25
29
|
constructSpaceNode,
|
|
@@ -27,10 +31,10 @@ import {
|
|
|
27
31
|
createStaticSchemaActions,
|
|
28
32
|
createStaticSchemaNode,
|
|
29
33
|
rxFromQuery,
|
|
30
|
-
SHARED,
|
|
31
|
-
SPACES,
|
|
32
34
|
} from '../util';
|
|
33
35
|
|
|
36
|
+
import { SpaceCapabilities } from './capabilities';
|
|
37
|
+
|
|
34
38
|
export default (context: PluginContext) => {
|
|
35
39
|
// TODO(wittjosiah): Make reactive.
|
|
36
40
|
const resolve = (typename: string) =>
|
|
@@ -41,7 +45,7 @@ export default (context: PluginContext) => {
|
|
|
41
45
|
type: SPACES,
|
|
42
46
|
cacheable: ['label', 'role'],
|
|
43
47
|
properties: {
|
|
44
|
-
label: ['spaces label', { ns:
|
|
48
|
+
label: ['spaces label', { ns: meta.id }],
|
|
45
49
|
icon: 'ph--planet--regular',
|
|
46
50
|
testId: 'spacePlugin.spaces',
|
|
47
51
|
role: 'branch',
|
|
@@ -76,11 +80,11 @@ export default (context: PluginContext) => {
|
|
|
76
80
|
return contributes(Capabilities.AppGraphBuilder, [
|
|
77
81
|
// Primary actions.
|
|
78
82
|
createExtension({
|
|
79
|
-
id: `${
|
|
83
|
+
id: `${meta.id}/primary-actions`,
|
|
80
84
|
position: 'hoist',
|
|
81
85
|
actions: (node) =>
|
|
82
86
|
Rx.make((get) =>
|
|
83
|
-
pipe(
|
|
87
|
+
Function.pipe(
|
|
84
88
|
get(node),
|
|
85
89
|
Option.flatMap((node) => (node.id === ROOT_ID ? Option.some(node) : Option.none())),
|
|
86
90
|
Option.map(() => [
|
|
@@ -91,7 +95,7 @@ export default (context: PluginContext) => {
|
|
|
91
95
|
await dispatch(createIntent(SpaceAction.OpenCreateSpace));
|
|
92
96
|
},
|
|
93
97
|
properties: {
|
|
94
|
-
label: ['create space label', { ns:
|
|
98
|
+
label: ['create space label', { ns: meta.id }],
|
|
95
99
|
icon: 'ph--plus--regular',
|
|
96
100
|
testId: 'spacePlugin.createSpace',
|
|
97
101
|
disposition: 'menu',
|
|
@@ -104,7 +108,7 @@ export default (context: PluginContext) => {
|
|
|
104
108
|
await dispatch(createIntent(SpaceAction.Join));
|
|
105
109
|
},
|
|
106
110
|
properties: {
|
|
107
|
-
label: ['join space label', { ns:
|
|
111
|
+
label: ['join space label', { ns: meta.id }],
|
|
108
112
|
icon: 'ph--sign-in--regular',
|
|
109
113
|
testId: 'spacePlugin.joinSpace',
|
|
110
114
|
disposition: 'menu',
|
|
@@ -119,7 +123,7 @@ export default (context: PluginContext) => {
|
|
|
119
123
|
await dispatch(createIntent(SpaceAction.OpenMembers, { space }));
|
|
120
124
|
},
|
|
121
125
|
properties: {
|
|
122
|
-
label: ['share space label', { ns:
|
|
126
|
+
label: ['share space label', { ns: meta.id }],
|
|
123
127
|
icon: 'ph--users--regular',
|
|
124
128
|
testId: 'spacePlugin.shareSpace',
|
|
125
129
|
keyBinding: {
|
|
@@ -137,7 +141,7 @@ export default (context: PluginContext) => {
|
|
|
137
141
|
await dispatch(createIntent(SpaceAction.OpenSettings, { space }));
|
|
138
142
|
},
|
|
139
143
|
properties: {
|
|
140
|
-
label: ['open current space settings label', { ns:
|
|
144
|
+
label: ['open current space settings label', { ns: meta.id }],
|
|
141
145
|
icon: 'ph--faders--regular',
|
|
142
146
|
keyBinding: {
|
|
143
147
|
macos: 'meta+shift+,',
|
|
@@ -153,11 +157,11 @@ export default (context: PluginContext) => {
|
|
|
153
157
|
|
|
154
158
|
// Create spaces group node.
|
|
155
159
|
createExtension({
|
|
156
|
-
id: `${
|
|
160
|
+
id: `${meta.id}/root`,
|
|
157
161
|
position: 'hoist',
|
|
158
162
|
connector: (node) =>
|
|
159
163
|
Rx.make((get) =>
|
|
160
|
-
pipe(
|
|
164
|
+
Function.pipe(
|
|
161
165
|
get(node),
|
|
162
166
|
Option.flatMap((node) => (node.id === ROOT_ID ? Option.some(node) : Option.none())),
|
|
163
167
|
Option.map(() => [spacesNode]),
|
|
@@ -173,7 +177,7 @@ export default (context: PluginContext) => {
|
|
|
173
177
|
connector: (node) => {
|
|
174
178
|
let query: QueryResult<Type.Expando> | undefined;
|
|
175
179
|
return Rx.make((get) =>
|
|
176
|
-
pipe(
|
|
180
|
+
Function.pipe(
|
|
177
181
|
get(node),
|
|
178
182
|
Option.flatMap((node) => (node.id === SPACES ? Option.some(node) : Option.none())),
|
|
179
183
|
Option.map(() => {
|
|
@@ -190,7 +194,7 @@ export default (context: PluginContext) => {
|
|
|
190
194
|
}
|
|
191
195
|
|
|
192
196
|
const settings = get(context.capabilities(Capabilities.SettingsStore))[0]?.getStore<SpaceSettingsProps>(
|
|
193
|
-
|
|
197
|
+
meta.id,
|
|
194
198
|
)?.value;
|
|
195
199
|
|
|
196
200
|
// TODO(wittjosiah): During client reset, accessing default space throws.
|
|
@@ -275,10 +279,10 @@ export default (context: PluginContext) => {
|
|
|
275
279
|
|
|
276
280
|
// Create space actions.
|
|
277
281
|
createExtension({
|
|
278
|
-
id: `${
|
|
282
|
+
id: `${meta.id}/actions`,
|
|
279
283
|
actions: (node) =>
|
|
280
284
|
Rx.make((get) =>
|
|
281
|
-
pipe(
|
|
285
|
+
Function.pipe(
|
|
282
286
|
get(node),
|
|
283
287
|
Option.flatMap((node) =>
|
|
284
288
|
node.type === SPACE_TYPE && isSpace(node.data) ? Option.some(node.data) : Option.none(),
|
|
@@ -307,10 +311,10 @@ export default (context: PluginContext) => {
|
|
|
307
311
|
|
|
308
312
|
// Create nodes for objects in the root collection of a space.
|
|
309
313
|
createExtension({
|
|
310
|
-
id: `${
|
|
314
|
+
id: `${meta.id}/root-collection`,
|
|
311
315
|
connector: (node) =>
|
|
312
316
|
Rx.make((get) =>
|
|
313
|
-
pipe(
|
|
317
|
+
Function.pipe(
|
|
314
318
|
get(node),
|
|
315
319
|
Option.flatMap((node) =>
|
|
316
320
|
node.type === SPACE_TYPE && isSpace(node.data) ? Option.some(node.data) : Option.none(),
|
|
@@ -333,7 +337,7 @@ export default (context: PluginContext) => {
|
|
|
333
337
|
|
|
334
338
|
return get(
|
|
335
339
|
rxFromSignal(() =>
|
|
336
|
-
pipe(
|
|
340
|
+
Function.pipe(
|
|
337
341
|
collection.objects,
|
|
338
342
|
Array.map((object) => object.target),
|
|
339
343
|
Array.filter(isNonNullable),
|
|
@@ -357,10 +361,10 @@ export default (context: PluginContext) => {
|
|
|
357
361
|
|
|
358
362
|
// Create nodes for objects in a collection or by its fully qualified id.
|
|
359
363
|
createExtension({
|
|
360
|
-
id: `${
|
|
364
|
+
id: `${meta.id}/objects`,
|
|
361
365
|
connector: (node) =>
|
|
362
366
|
Rx.make((get) =>
|
|
363
|
-
pipe(
|
|
367
|
+
Function.pipe(
|
|
364
368
|
get(node),
|
|
365
369
|
Option.flatMap((node) =>
|
|
366
370
|
Obj.instanceOf(DataType.Collection, node.data) ? Option.some(node.data) : Option.none(),
|
|
@@ -371,7 +375,7 @@ export default (context: PluginContext) => {
|
|
|
371
375
|
|
|
372
376
|
return get(
|
|
373
377
|
rxFromSignal(() =>
|
|
374
|
-
pipe(
|
|
378
|
+
Function.pipe(
|
|
375
379
|
collection.objects,
|
|
376
380
|
Array.map((object) => object.target),
|
|
377
381
|
Array.filter(isNonNullable),
|
|
@@ -428,20 +432,19 @@ export default (context: PluginContext) => {
|
|
|
428
432
|
|
|
429
433
|
// Create nodes for objects in a query collection.
|
|
430
434
|
createExtension({
|
|
431
|
-
id: `${
|
|
435
|
+
id: `${meta.id}/query-collection-objects`,
|
|
432
436
|
connector: (node) => {
|
|
433
437
|
let query: QueryResult<Type.Expando> | undefined;
|
|
434
438
|
return Rx.make((get) =>
|
|
435
|
-
pipe(
|
|
439
|
+
Function.pipe(
|
|
436
440
|
get(node),
|
|
437
441
|
Option.flatMap((node) =>
|
|
438
442
|
Obj.instanceOf(DataType.QueryCollection, node.data) ? Option.some(node.data) : Option.none(),
|
|
439
443
|
),
|
|
440
444
|
Option.flatMap((collection) => {
|
|
441
445
|
const space = getSpace(collection);
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
: Option.none();
|
|
446
|
+
const typename = getTypenameFromQuery(collection.query);
|
|
447
|
+
return typename && space ? Option.some({ typename, space }) : Option.none();
|
|
445
448
|
}),
|
|
446
449
|
Option.map(({ typename, space }) => {
|
|
447
450
|
const state = context.getCapability(SpaceCapabilities.State);
|
|
@@ -458,21 +461,25 @@ export default (context: PluginContext) => {
|
|
|
458
461
|
),
|
|
459
462
|
);
|
|
460
463
|
}
|
|
461
|
-
return
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
464
|
+
return (
|
|
465
|
+
get(rxFromQuery(query))
|
|
466
|
+
// TODO(wittjosiah): This should be the default sort order.
|
|
467
|
+
.toSorted((a, b) => a.id.localeCompare(b.id))
|
|
468
|
+
.map((object) =>
|
|
469
|
+
get(
|
|
470
|
+
rxFromSignal(() =>
|
|
471
|
+
createObjectNode({
|
|
472
|
+
object,
|
|
473
|
+
space,
|
|
474
|
+
resolve,
|
|
475
|
+
droppable: false, // Cannot rearrange query collections.
|
|
476
|
+
navigable: state.navigableCollections,
|
|
477
|
+
}),
|
|
478
|
+
),
|
|
472
479
|
),
|
|
473
|
-
)
|
|
474
|
-
|
|
475
|
-
|
|
480
|
+
)
|
|
481
|
+
.filter(isNonNullable)
|
|
482
|
+
);
|
|
476
483
|
}),
|
|
477
484
|
Option.getOrElse(() => []),
|
|
478
485
|
),
|
|
@@ -482,15 +489,15 @@ export default (context: PluginContext) => {
|
|
|
482
489
|
|
|
483
490
|
// Static schema records.
|
|
484
491
|
createExtension({
|
|
485
|
-
id: `${
|
|
492
|
+
id: `${meta.id}/static-schemas`,
|
|
486
493
|
connector: (node) => {
|
|
487
494
|
const client = context.getCapability(ClientCapabilities.Client);
|
|
488
495
|
return Rx.make((get) =>
|
|
489
|
-
pipe(
|
|
496
|
+
Function.pipe(
|
|
490
497
|
get(node),
|
|
491
498
|
Option.flatMap((node) =>
|
|
492
499
|
Obj.instanceOf(DataType.QueryCollection, node.data) &&
|
|
493
|
-
node.data.query
|
|
500
|
+
getTypenameFromQuery(node.data.query) === DataType.StoredSchema.typename
|
|
494
501
|
? Option.some(node.data)
|
|
495
502
|
: Option.none(),
|
|
496
503
|
),
|
|
@@ -514,11 +521,11 @@ export default (context: PluginContext) => {
|
|
|
514
521
|
|
|
515
522
|
// Create static schema actions.
|
|
516
523
|
createExtension({
|
|
517
|
-
id: `${
|
|
524
|
+
id: `${meta.id}/static-schema-actions`,
|
|
518
525
|
actions: (node) => {
|
|
519
526
|
let query: QueryResult<DataType.View> | undefined;
|
|
520
527
|
return Rx.make((get) =>
|
|
521
|
-
pipe(
|
|
528
|
+
Function.pipe(
|
|
522
529
|
get(node),
|
|
523
530
|
Option.flatMap((node) => {
|
|
524
531
|
const space = isSpace(node.properties.space) ? node.properties.space : undefined;
|
|
@@ -534,13 +541,25 @@ export default (context: PluginContext) => {
|
|
|
534
541
|
const filteredViews = get(
|
|
535
542
|
rxFromSignal(() =>
|
|
536
543
|
// TODO(wittjosiah): Remove cast.
|
|
537
|
-
views.filter(
|
|
544
|
+
views.filter(
|
|
545
|
+
(view) => getTypenameFromQuery(view.query.ast) === Type.getTypename(schema as Type.Obj.Any),
|
|
546
|
+
),
|
|
538
547
|
),
|
|
539
548
|
);
|
|
540
549
|
const deletable = filteredViews.length === 0;
|
|
541
550
|
|
|
551
|
+
const [dispatcher] = get(context.capabilities(Capabilities.IntentDispatcher));
|
|
552
|
+
if (!dispatcher) {
|
|
553
|
+
return [];
|
|
554
|
+
}
|
|
555
|
+
|
|
542
556
|
// TODO(wittjosiah): Remove cast.
|
|
543
|
-
return createStaticSchemaActions({
|
|
557
|
+
return createStaticSchemaActions({
|
|
558
|
+
schema: schema as Type.Obj.Any,
|
|
559
|
+
space,
|
|
560
|
+
dispatch: dispatcher.dispatchPromise,
|
|
561
|
+
deletable,
|
|
562
|
+
});
|
|
544
563
|
}),
|
|
545
564
|
Option.getOrElse(() => []),
|
|
546
565
|
),
|
|
@@ -550,11 +569,11 @@ export default (context: PluginContext) => {
|
|
|
550
569
|
|
|
551
570
|
// Create nodes for schema views.
|
|
552
571
|
createExtension({
|
|
553
|
-
id: `${
|
|
572
|
+
id: `${meta.id}/schema-views`,
|
|
554
573
|
connector: (node) => {
|
|
555
574
|
let query: QueryResult<DataType.View> | undefined;
|
|
556
575
|
return Rx.make((get) =>
|
|
557
|
-
pipe(
|
|
576
|
+
Function.pipe(
|
|
558
577
|
get(node),
|
|
559
578
|
Option.flatMap((node) => {
|
|
560
579
|
const space = getSpace(node.data) ?? (isSpace(node.properties.space) ? node.properties.space : undefined);
|
|
@@ -571,7 +590,7 @@ export default (context: PluginContext) => {
|
|
|
571
590
|
// TODO(wittjosiah): Remove cast.
|
|
572
591
|
const typename = Schema.isSchema(schema) ? Type.getTypename(schema as Type.Obj.Any) : schema.typename;
|
|
573
592
|
return get(rxFromQuery(query))
|
|
574
|
-
.filter((view) => view.query.
|
|
593
|
+
.filter((view) => getTypenameFromQuery(view.query.ast) === typename)
|
|
575
594
|
.map((view) =>
|
|
576
595
|
get(
|
|
577
596
|
rxFromSignal(() =>
|
|
@@ -592,17 +611,50 @@ export default (context: PluginContext) => {
|
|
|
592
611
|
},
|
|
593
612
|
}),
|
|
594
613
|
|
|
614
|
+
// Create record nodes.
|
|
615
|
+
createExtension({
|
|
616
|
+
id: `${meta.id}/records`,
|
|
617
|
+
resolver: (id) => {
|
|
618
|
+
let query: QueryResult<Type.Expando> | undefined;
|
|
619
|
+
return Rx.make((get) => {
|
|
620
|
+
const client = context.getCapability(ClientCapabilities.Client);
|
|
621
|
+
const { spaceId, objectId } = parseId(id);
|
|
622
|
+
if (!spaceId || !objectId) {
|
|
623
|
+
return null;
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
const space = client.spaces.get(spaceId);
|
|
627
|
+
if (!space) {
|
|
628
|
+
return null;
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
if (!query) {
|
|
632
|
+
query = space.db.query(Filter.ids(objectId));
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
const object = get(rxFromQuery(query)).at(0);
|
|
636
|
+
if (!object) {
|
|
637
|
+
return null;
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
return createObjectNode({ object, space, resolve, disposition: 'hidden' });
|
|
641
|
+
});
|
|
642
|
+
},
|
|
643
|
+
}),
|
|
644
|
+
|
|
595
645
|
// Create collection actions and action groups.
|
|
596
646
|
createExtension({
|
|
597
|
-
id: `${
|
|
647
|
+
id: `${meta.id}/object-actions`,
|
|
598
648
|
actions: (node) => {
|
|
599
649
|
let query: QueryResult<DataType.View> | undefined;
|
|
600
650
|
return Rx.make((get) =>
|
|
601
|
-
pipe(
|
|
651
|
+
Function.pipe(
|
|
602
652
|
get(node),
|
|
603
653
|
Option.flatMap((node) => {
|
|
604
654
|
const space = getSpace(node.data);
|
|
605
|
-
return space && Obj.isObject(node.data)
|
|
655
|
+
return space && Obj.isObject(node.data) && Obj.getTypename(node.data) === node.type
|
|
656
|
+
? Option.some({ space, object: node.data })
|
|
657
|
+
: Option.none();
|
|
606
658
|
}),
|
|
607
659
|
Option.flatMap(({ space, object }) => {
|
|
608
660
|
const isSchema = Obj.instanceOf(DataType.StoredSchema, object);
|
|
@@ -611,11 +663,17 @@ export default (context: PluginContext) => {
|
|
|
611
663
|
query = space.db.query(Filter.type(DataType.View));
|
|
612
664
|
}
|
|
613
665
|
|
|
614
|
-
let deletable =
|
|
666
|
+
let deletable =
|
|
667
|
+
!isSchema &&
|
|
668
|
+
// Don't allow the Records smart collection to be deleted.
|
|
669
|
+
!(
|
|
670
|
+
Obj.instanceOf(DataType.QueryCollection, object) &&
|
|
671
|
+
getTypenameFromQuery(object.query) === DataType.StoredSchema.typename
|
|
672
|
+
);
|
|
615
673
|
if (isSchema && query) {
|
|
616
674
|
const views = get(rxFromQuery(query));
|
|
617
675
|
const filteredViews = get(
|
|
618
|
-
rxFromSignal(() => views.filter((view) => view.query.
|
|
676
|
+
rxFromSignal(() => views.filter((view) => getTypenameFromQuery(view.query.ast) === object.typename)),
|
|
619
677
|
);
|
|
620
678
|
deletable = filteredViews.length === 0;
|
|
621
679
|
}
|
|
@@ -647,10 +705,10 @@ export default (context: PluginContext) => {
|
|
|
647
705
|
|
|
648
706
|
// View selected objects.
|
|
649
707
|
createExtension({
|
|
650
|
-
id: `${
|
|
708
|
+
id: `${meta.id}/selected-objects`,
|
|
651
709
|
connector: (node) =>
|
|
652
710
|
Rx.make((get) =>
|
|
653
|
-
pipe(
|
|
711
|
+
Function.pipe(
|
|
654
712
|
get(node),
|
|
655
713
|
Option.flatMap((node) => (Obj.instanceOf(DataType.View, node.data) ? Option.some(node) : Option.none())),
|
|
656
714
|
Option.map((node) => [
|
|
@@ -659,7 +717,7 @@ export default (context: PluginContext) => {
|
|
|
659
717
|
type: PLANK_COMPANION_TYPE,
|
|
660
718
|
data: 'selected-objects',
|
|
661
719
|
properties: {
|
|
662
|
-
label: ['companion selected objects label', { ns:
|
|
720
|
+
label: ['companion selected objects label', { ns: meta.id }],
|
|
663
721
|
icon: 'ph--tree-view--regular',
|
|
664
722
|
disposition: 'hidden',
|
|
665
723
|
},
|
|
@@ -672,10 +730,10 @@ export default (context: PluginContext) => {
|
|
|
672
730
|
|
|
673
731
|
// Object settings plank companion.
|
|
674
732
|
createExtension({
|
|
675
|
-
id: `${
|
|
733
|
+
id: `${meta.id}/settings`,
|
|
676
734
|
connector: (node) =>
|
|
677
735
|
Rx.make((get) =>
|
|
678
|
-
pipe(
|
|
736
|
+
Function.pipe(
|
|
679
737
|
get(node),
|
|
680
738
|
Option.flatMap((node) => (Obj.isObject(node.data) ? Option.some(node) : Option.none())),
|
|
681
739
|
Option.map((node) => [
|
|
@@ -684,7 +742,7 @@ export default (context: PluginContext) => {
|
|
|
684
742
|
type: PLANK_COMPANION_TYPE,
|
|
685
743
|
data: 'settings',
|
|
686
744
|
properties: {
|
|
687
|
-
label: ['object settings label', { ns:
|
|
745
|
+
label: ['object settings label', { ns: meta.id }],
|
|
688
746
|
icon: 'ph--sliders--regular',
|
|
689
747
|
disposition: 'hidden',
|
|
690
748
|
position: 'fallback',
|
|
@@ -7,7 +7,7 @@ import { isSpace } from '@dxos/client/echo';
|
|
|
7
7
|
import { Obj, Type } from '@dxos/echo';
|
|
8
8
|
import { DataType } from '@dxos/schema';
|
|
9
9
|
|
|
10
|
-
import {
|
|
10
|
+
import { meta } from '../meta';
|
|
11
11
|
import { translations } from '../translations';
|
|
12
12
|
import { SPACE_TYPE, SpaceAction } from '../types';
|
|
13
13
|
import { SPACES } from '../util';
|
|
@@ -23,8 +23,8 @@ export default (context: PluginContext) =>
|
|
|
23
23
|
inputType: SPACES,
|
|
24
24
|
outputType: DIRECTORY_TYPE,
|
|
25
25
|
serialize: (node) => ({
|
|
26
|
-
name: translations[0]['en-US'][
|
|
27
|
-
data: translations[0]['en-US'][
|
|
26
|
+
name: translations[0]['en-US'][meta.id]['spaces label'] ?? 'Spaces',
|
|
27
|
+
data: translations[0]['en-US'][meta.id]['spaces label'] ?? 'Spaces',
|
|
28
28
|
type: DIRECTORY_TYPE,
|
|
29
29
|
}),
|
|
30
30
|
deserialize: () => {
|
|
@@ -35,8 +35,8 @@ export default (context: PluginContext) =>
|
|
|
35
35
|
inputType: SPACE_TYPE,
|
|
36
36
|
outputType: DIRECTORY_TYPE,
|
|
37
37
|
serialize: (node) => ({
|
|
38
|
-
name: node.data.properties.name ?? translations[0]['en-US'][
|
|
39
|
-
data: node.data.properties.name ?? translations[0]['en-US'][
|
|
38
|
+
name: node.data.properties.name ?? translations[0]['en-US'][meta.id]['unnamed space label'],
|
|
39
|
+
data: node.data.properties.name ?? translations[0]['en-US'][meta.id]['unnamed space label'],
|
|
40
40
|
type: DIRECTORY_TYPE,
|
|
41
41
|
}),
|
|
42
42
|
deserialize: async (data) => {
|
|
@@ -49,8 +49,8 @@ export default (context: PluginContext) =>
|
|
|
49
49
|
inputType: COLLECTION_TYPE,
|
|
50
50
|
outputType: DIRECTORY_TYPE,
|
|
51
51
|
serialize: (node) => ({
|
|
52
|
-
name: node.data.name ?? translations[0]['en-US'][
|
|
53
|
-
data: node.data.name ?? translations[0]['en-US'][
|
|
52
|
+
name: node.data.name ?? translations[0]['en-US'][meta.id]['object name placeholder'],
|
|
53
|
+
data: node.data.name ?? translations[0]['en-US'][meta.id]['object name placeholder'],
|
|
54
54
|
type: DIRECTORY_TYPE,
|
|
55
55
|
}),
|
|
56
56
|
deserialize: async (data, ancestors) => {
|
|
@@ -2,28 +2,29 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import type * as Schema from 'effect/Schema';
|
|
6
6
|
|
|
7
|
-
import { type AnyIntentChain,
|
|
7
|
+
import { type AnyIntentChain, type Label, defineCapability } from '@dxos/app-framework';
|
|
8
8
|
import { type Space } from '@dxos/react-client/echo';
|
|
9
9
|
import { type DataType } from '@dxos/schema';
|
|
10
|
-
import { type
|
|
10
|
+
import { type DeepReadonly, type Position } from '@dxos/util';
|
|
11
11
|
|
|
12
|
-
import {
|
|
12
|
+
import { meta } from '../meta';
|
|
13
13
|
import { type ObjectForm, type PluginState } from '../types';
|
|
14
14
|
|
|
15
15
|
export namespace SpaceCapabilities {
|
|
16
|
-
export const State = defineCapability<DeepReadonly<PluginState>>(`${
|
|
17
|
-
export const MutableState = defineCapability<PluginState>(`${
|
|
16
|
+
export const State = defineCapability<DeepReadonly<PluginState>>(`${meta.id}/capability/state`);
|
|
17
|
+
export const MutableState = defineCapability<PluginState>(`${meta.id}/capability/state`);
|
|
18
18
|
|
|
19
19
|
export type SettingsSection = { id: string; label: Label; position?: Position };
|
|
20
|
-
export const SettingsSection = defineCapability<SettingsSection>(`${
|
|
20
|
+
export const SettingsSection = defineCapability<SettingsSection>(`${meta.id}/capability/settings-section`);
|
|
21
21
|
|
|
22
|
-
export type
|
|
23
|
-
export const
|
|
22
|
+
export type onCreateSpace = (params: { space: Space; rootCollection: DataType.Collection }) => AnyIntentChain;
|
|
23
|
+
export const onCreateSpace = defineCapability<onCreateSpace>(`${meta.id}/capability/on-space-created`);
|
|
24
24
|
|
|
25
25
|
export type OnSchemaAdded = (params: { space: Space; schema: Schema.Schema.AnyNoContext }) => AnyIntentChain;
|
|
26
|
-
export const OnSchemaAdded = defineCapability<OnSchemaAdded>(`${
|
|
26
|
+
export const OnSchemaAdded = defineCapability<OnSchemaAdded>(`${meta.id}/capability/on-schema-added`);
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
// TODO(burdon): Should this be view? Forms are UI concepts? (associated with a View/schema).
|
|
29
|
+
export const ObjectForm = defineCapability<ObjectForm<any>>(`${meta.id}/capability/object-form`);
|
|
29
30
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { Capabilities, type PluginContext, contributes } from '@dxos/app-framework';
|
|
6
6
|
import { Obj, Ref } from '@dxos/echo';
|
|
7
7
|
import { Migrations } from '@dxos/migrations';
|
|
8
8
|
import { ClientCapabilities } from '@dxos/plugin-client';
|
|
@@ -11,7 +11,6 @@ export const IntentResolver = lazy(() => import('./intent-resolver'));
|
|
|
11
11
|
export const ReactRoot = lazy(() => import('./react-root'));
|
|
12
12
|
export const ReactSurface = lazy(() => import('./react-surface'));
|
|
13
13
|
export const SchemaDefs = lazy(() => import('./schema-defs'));
|
|
14
|
-
export const SchemaTools = lazy(() => import('./schema-tools'));
|
|
15
14
|
export const SpaceSettings = lazy(() => import('./settings'));
|
|
16
15
|
export const SpaceState = lazy(() => import('./state'));
|
|
17
16
|
export const SpacesReady = lazy(() => import('./spaces-ready'));
|