@dxos/plugin-space 0.8.4-main.3c1ae3b → 0.8.4-main.3eb6e50203
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/CollectionArticle-XXLUNK3F.mjs +127 -0
- package/dist/lib/browser/CollectionArticle-XXLUNK3F.mjs.map +7 -0
- package/dist/lib/browser/ObjectCardStack-CXNBCSMR.mjs +148 -0
- package/dist/lib/browser/ObjectCardStack-CXNBCSMR.mjs.map +7 -0
- package/dist/lib/browser/ObjectDetails-HXV4IQEM.mjs +143 -0
- package/dist/lib/browser/ObjectDetails-HXV4IQEM.mjs.map +7 -0
- package/dist/lib/browser/RecordArticle-36LDKFWF.mjs +108 -0
- package/dist/lib/browser/RecordArticle-36LDKFWF.mjs.map +7 -0
- package/dist/lib/browser/app-graph-builder-GLV46QSI.mjs +530 -0
- package/dist/lib/browser/app-graph-builder-GLV46QSI.mjs.map +7 -0
- package/dist/lib/browser/app-graph-serializer-VOLRDNVE.mjs +85 -0
- package/dist/lib/browser/app-graph-serializer-VOLRDNVE.mjs.map +7 -0
- package/dist/lib/browser/{chunk-POFUXISV.mjs → chunk-7D63MVRS.mjs} +6 -5
- package/dist/lib/browser/chunk-7D63MVRS.mjs.map +7 -0
- package/dist/lib/browser/{chunk-5CSSKOWR.mjs → chunk-A7ZCVQGZ.mjs} +43 -45
- package/dist/lib/browser/chunk-A7ZCVQGZ.mjs.map +7 -0
- package/dist/lib/browser/chunk-ASV6DYFH.mjs +19 -0
- package/dist/lib/browser/chunk-ASV6DYFH.mjs.map +7 -0
- package/dist/lib/browser/chunk-CMLRMQNM.mjs +1889 -0
- package/dist/lib/browser/chunk-CMLRMQNM.mjs.map +7 -0
- package/dist/lib/browser/{chunk-VZBIIYFM.mjs → chunk-HSMQFM57.mjs} +1 -1
- package/dist/lib/browser/chunk-HSMQFM57.mjs.map +7 -0
- package/dist/lib/browser/chunk-KGLWYGIF.mjs +715 -0
- package/dist/lib/browser/chunk-KGLWYGIF.mjs.map +7 -0
- package/dist/lib/browser/chunk-NF3ZFAB4.mjs +13 -0
- package/dist/lib/browser/chunk-NF3ZFAB4.mjs.map +7 -0
- package/dist/lib/browser/{chunk-IJCMB5B5.mjs → chunk-WAOJLA2S.mjs} +195 -196
- package/dist/lib/browser/chunk-WAOJLA2S.mjs.map +7 -0
- package/dist/lib/browser/cli/index.mjs +851 -0
- package/dist/lib/browser/cli/index.mjs.map +7 -0
- package/dist/lib/browser/identity-created-VCFYLSBB.mjs +23 -0
- package/dist/lib/browser/identity-created-VCFYLSBB.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +215 -189
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/operation-resolver-PJJ3PCM7.mjs +830 -0
- package/dist/lib/browser/operation-resolver-PJJ3PCM7.mjs.map +7 -0
- package/dist/lib/browser/react-root-ITWAPZIY.mjs +30 -0
- package/dist/lib/browser/react-root-ITWAPZIY.mjs.map +7 -0
- package/dist/lib/browser/react-surface-6GD6K4I4.mjs +383 -0
- package/dist/lib/browser/react-surface-6GD6K4I4.mjs.map +7 -0
- package/dist/lib/browser/{repair-CNLE35NF.mjs → repair-DKU4TUD2.mjs} +16 -10
- package/dist/lib/browser/repair-DKU4TUD2.mjs.map +7 -0
- package/dist/lib/browser/settings-M2DMD2ZA.mjs +34 -0
- package/dist/lib/browser/settings-M2DMD2ZA.mjs.map +7 -0
- package/dist/lib/browser/spaces-ready-XWJUJ43N.mjs +243 -0
- package/dist/lib/browser/spaces-ready-XWJUJ43N.mjs.map +7 -0
- package/dist/lib/browser/state-V637BLIM.mjs +58 -0
- package/dist/lib/browser/state-V637BLIM.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +10 -8
- package/dist/lib/node-esm/CollectionArticle-KFFKKP37.mjs +128 -0
- package/dist/lib/node-esm/CollectionArticle-KFFKKP37.mjs.map +7 -0
- package/dist/lib/node-esm/ObjectCardStack-EHXPNRQW.mjs +149 -0
- package/dist/lib/node-esm/ObjectCardStack-EHXPNRQW.mjs.map +7 -0
- package/dist/lib/node-esm/ObjectDetails-N73UI4ZL.mjs +144 -0
- package/dist/lib/node-esm/ObjectDetails-N73UI4ZL.mjs.map +7 -0
- package/dist/lib/node-esm/RecordArticle-CMEXNNOZ.mjs +109 -0
- package/dist/lib/node-esm/RecordArticle-CMEXNNOZ.mjs.map +7 -0
- package/dist/lib/node-esm/app-graph-builder-KCEHEKVS.mjs +531 -0
- package/dist/lib/node-esm/app-graph-builder-KCEHEKVS.mjs.map +7 -0
- package/dist/lib/node-esm/app-graph-serializer-7C4MV5NB.mjs +86 -0
- package/dist/lib/node-esm/app-graph-serializer-7C4MV5NB.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-2NM62ORP.mjs +1890 -0
- package/dist/lib/node-esm/chunk-2NM62ORP.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-AX3UGL5D.mjs → chunk-5N3YIAXD.mjs} +6 -5
- package/dist/lib/node-esm/chunk-5N3YIAXD.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-UMZ7G6G4.mjs → chunk-A5A7M37T.mjs} +43 -45
- package/dist/lib/node-esm/chunk-A5A7M37T.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-CVXULIYC.mjs +20 -0
- package/dist/lib/node-esm/chunk-CVXULIYC.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-3D4NGZPW.mjs → chunk-FB5YNROS.mjs} +195 -196
- package/dist/lib/node-esm/chunk-FB5YNROS.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-NYSDQPNM.mjs +716 -0
- package/dist/lib/node-esm/chunk-NYSDQPNM.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-PG7DNOEX.mjs +15 -0
- package/dist/lib/node-esm/chunk-PG7DNOEX.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-BDEFTL6K.mjs → chunk-SL4BJSUG.mjs} +1 -1
- package/dist/lib/node-esm/chunk-SL4BJSUG.mjs.map +7 -0
- package/dist/lib/node-esm/cli/index.mjs +852 -0
- package/dist/lib/node-esm/cli/index.mjs.map +7 -0
- package/dist/lib/node-esm/identity-created-2SJABVJD.mjs +25 -0
- package/dist/lib/node-esm/identity-created-2SJABVJD.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +215 -189
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/operation-resolver-2K7N4KYC.mjs +831 -0
- package/dist/lib/node-esm/operation-resolver-2K7N4KYC.mjs.map +7 -0
- package/dist/lib/node-esm/react-root-GIQAKDQ2.mjs +31 -0
- package/dist/lib/node-esm/react-root-GIQAKDQ2.mjs.map +7 -0
- package/dist/lib/node-esm/react-surface-KWP2DNFG.mjs +384 -0
- package/dist/lib/node-esm/react-surface-KWP2DNFG.mjs.map +7 -0
- package/dist/lib/node-esm/{repair-EHZS6MFY.mjs → repair-C2H6JQCL.mjs} +16 -10
- package/dist/lib/node-esm/repair-C2H6JQCL.mjs.map +7 -0
- package/dist/lib/node-esm/settings-VCPCNBOY.mjs +35 -0
- package/dist/lib/node-esm/settings-VCPCNBOY.mjs.map +7 -0
- package/dist/lib/node-esm/spaces-ready-5JOGEWON.mjs +244 -0
- package/dist/lib/node-esm/spaces-ready-5JOGEWON.mjs.map +7 -0
- package/dist/lib/node-esm/state-5MCEPWN3.mjs +59 -0
- package/dist/lib/node-esm/state-5MCEPWN3.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +10 -8
- package/dist/types/src/SpacePlugin.d.ts +3 -15
- package/dist/types/src/SpacePlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +7 -0
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts +3 -0
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-serializer/app-graph-serializer.d.ts +5 -0
- package/dist/types/src/capabilities/app-graph-serializer/app-graph-serializer.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-serializer/index.d.ts +3 -0
- package/dist/types/src/capabilities/app-graph-serializer/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/identity-created/identity-created.d.ts +5 -0
- package/dist/types/src/capabilities/identity-created/identity-created.d.ts.map +1 -0
- package/dist/types/src/capabilities/identity-created/index.d.ts +3 -0
- package/dist/types/src/capabilities/identity-created/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +10 -20
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/operation-resolver/index.d.ts +6 -0
- package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +9 -0
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-root/index.d.ts +6 -0
- package/dist/types/src/capabilities/react-root/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-root/react-root.d.ts +9 -0
- package/dist/types/src/capabilities/react-root/react-root.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface/index.d.ts +5 -0
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts +8 -0
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -0
- package/dist/types/src/capabilities/repair/index.d.ts +3 -0
- package/dist/types/src/capabilities/repair/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/repair/repair.d.ts +6 -0
- package/dist/types/src/capabilities/repair/repair.d.ts.map +1 -0
- package/dist/types/src/capabilities/settings/index.d.ts +7 -0
- package/dist/types/src/capabilities/settings/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/settings/settings.d.ts +10 -0
- package/dist/types/src/capabilities/settings/settings.d.ts.map +1 -0
- package/dist/types/src/capabilities/spaces-ready/index.d.ts +3 -0
- package/dist/types/src/capabilities/spaces-ready/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/spaces-ready/spaces-ready.d.ts +5 -0
- package/dist/types/src/capabilities/spaces-ready/spaces-ready.d.ts.map +1 -0
- package/dist/types/src/capabilities/state/index.d.ts +13 -0
- package/dist/types/src/capabilities/state/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/state/state.d.ts +17 -0
- package/dist/types/src/capabilities/state/state.d.ts.map +1 -0
- package/dist/types/src/cli/commands/database/add.d.ts +17 -0
- package/dist/types/src/cli/commands/database/add.d.ts.map +1 -0
- package/dist/types/src/cli/commands/database/index.d.ts +3 -0
- package/dist/types/src/cli/commands/database/index.d.ts.map +1 -0
- package/dist/types/src/cli/commands/database/query/index.d.ts +2 -0
- package/dist/types/src/cli/commands/database/query/index.d.ts.map +1 -0
- package/dist/types/src/cli/commands/database/query/query.d.ts +13 -0
- package/dist/types/src/cli/commands/database/query/query.d.ts.map +1 -0
- package/dist/types/src/cli/commands/database/query/query.test.d.ts +2 -0
- package/dist/types/src/cli/commands/database/query/query.test.d.ts.map +1 -0
- package/dist/types/src/cli/commands/database/remove.d.ts +9 -0
- package/dist/types/src/cli/commands/database/remove.d.ts.map +1 -0
- package/dist/types/src/cli/commands/database/stats.d.ts +6 -0
- package/dist/types/src/cli/commands/database/stats.d.ts.map +1 -0
- package/dist/types/src/cli/commands/database/util.d.ts +14 -0
- package/dist/types/src/cli/commands/database/util.d.ts.map +1 -0
- package/dist/types/src/cli/commands/index.d.ts +4 -0
- package/dist/types/src/cli/commands/index.d.ts.map +1 -0
- package/dist/types/src/cli/commands/queue/index.d.ts +7 -0
- package/dist/types/src/cli/commands/queue/index.d.ts.map +1 -0
- package/dist/types/src/cli/commands/queue/query.d.ts +8 -0
- package/dist/types/src/cli/commands/queue/query.d.ts.map +1 -0
- package/dist/types/src/cli/commands/queue/util.d.ts +6 -0
- package/dist/types/src/cli/commands/queue/util.d.ts.map +1 -0
- package/dist/types/src/cli/commands/space/close/close.d.ts +12 -0
- package/dist/types/src/cli/commands/space/close/close.d.ts.map +1 -0
- package/dist/types/src/cli/commands/space/close/index.d.ts +2 -0
- package/dist/types/src/cli/commands/space/close/index.d.ts.map +1 -0
- package/dist/types/src/cli/commands/space/create/create.d.ts +12 -0
- package/dist/types/src/cli/commands/space/create/create.d.ts.map +1 -0
- package/dist/types/src/cli/commands/space/create/create.test.d.ts +2 -0
- package/dist/types/src/cli/commands/space/create/create.test.d.ts.map +1 -0
- package/dist/types/src/cli/commands/space/create/index.d.ts +2 -0
- package/dist/types/src/cli/commands/space/create/index.d.ts.map +1 -0
- package/dist/types/src/cli/commands/space/index.d.ts +31 -0
- package/dist/types/src/cli/commands/space/index.d.ts.map +1 -0
- package/dist/types/src/cli/commands/space/info/index.d.ts +2 -0
- package/dist/types/src/cli/commands/space/info/index.d.ts.map +1 -0
- package/dist/types/src/cli/commands/space/info/info.d.ts +13 -0
- package/dist/types/src/cli/commands/space/info/info.d.ts.map +1 -0
- package/dist/types/src/cli/commands/space/info/info.test.d.ts +2 -0
- package/dist/types/src/cli/commands/space/info/info.test.d.ts.map +1 -0
- package/dist/types/src/cli/commands/space/join/index.d.ts +2 -0
- package/dist/types/src/cli/commands/space/join/index.d.ts.map +1 -0
- package/dist/types/src/cli/commands/space/join/join.d.ts +14 -0
- package/dist/types/src/cli/commands/space/join/join.d.ts.map +1 -0
- package/dist/types/src/cli/commands/space/join/util.d.ts +17 -0
- package/dist/types/src/cli/commands/space/join/util.d.ts.map +1 -0
- package/dist/types/src/cli/commands/space/list/index.d.ts +2 -0
- package/dist/types/src/cli/commands/space/list/index.d.ts.map +1 -0
- package/dist/types/src/cli/commands/space/list/list.d.ts +7 -0
- package/dist/types/src/cli/commands/space/list/list.d.ts.map +1 -0
- package/dist/types/src/cli/commands/space/list/list.test.d.ts +2 -0
- package/dist/types/src/cli/commands/space/list/list.test.d.ts.map +1 -0
- package/dist/types/src/cli/commands/space/members/index.d.ts +2 -0
- package/dist/types/src/cli/commands/space/members/index.d.ts.map +1 -0
- package/dist/types/src/cli/commands/space/members/members.d.ts +13 -0
- package/dist/types/src/cli/commands/space/members/members.d.ts.map +1 -0
- package/dist/types/src/cli/commands/space/members/members.test.d.ts +2 -0
- package/dist/types/src/cli/commands/space/members/members.test.d.ts.map +1 -0
- package/dist/types/src/cli/commands/space/members/util.d.ts +9 -0
- package/dist/types/src/cli/commands/space/members/util.d.ts.map +1 -0
- package/dist/types/src/cli/commands/space/open/index.d.ts +2 -0
- package/dist/types/src/cli/commands/space/open/index.d.ts.map +1 -0
- package/dist/types/src/cli/commands/space/open/open.d.ts +12 -0
- package/dist/types/src/cli/commands/space/open/open.d.ts.map +1 -0
- package/dist/types/src/cli/commands/space/schema/index.d.ts +8 -0
- package/dist/types/src/cli/commands/space/schema/index.d.ts.map +1 -0
- package/dist/types/src/cli/commands/space/schema/list/index.d.ts +2 -0
- package/dist/types/src/cli/commands/space/schema/list/index.d.ts.map +1 -0
- package/dist/types/src/cli/commands/space/schema/list/list.d.ts +15 -0
- package/dist/types/src/cli/commands/space/schema/list/list.d.ts.map +1 -0
- package/dist/types/src/cli/commands/space/schema/list/list.test.d.ts +2 -0
- package/dist/types/src/cli/commands/space/schema/list/list.test.d.ts.map +1 -0
- package/dist/types/src/cli/commands/space/schema/list/util.d.ts +15 -0
- package/dist/types/src/cli/commands/space/schema/list/util.d.ts.map +1 -0
- package/dist/types/src/cli/commands/space/share/index.d.ts +2 -0
- package/dist/types/src/cli/commands/space/share/index.d.ts.map +1 -0
- package/dist/types/src/cli/commands/space/share/share.d.ts +19 -0
- package/dist/types/src/cli/commands/space/share/share.d.ts.map +1 -0
- package/dist/types/src/cli/commands/space/sync/index.d.ts +2 -0
- package/dist/types/src/cli/commands/space/sync/index.d.ts.map +1 -0
- package/dist/types/src/cli/commands/space/sync/sync.d.ts +6 -0
- package/dist/types/src/cli/commands/space/sync/sync.d.ts.map +1 -0
- package/dist/types/src/cli/commands/space/sync/sync.test.d.ts +2 -0
- package/dist/types/src/cli/commands/space/sync/sync.test.d.ts.map +1 -0
- package/dist/types/src/cli/index.d.ts +2 -0
- package/dist/types/src/cli/index.d.ts.map +1 -0
- package/dist/types/src/cli/plugin.d.ts +4 -0
- package/dist/types/src/cli/plugin.d.ts.map +1 -0
- package/dist/types/src/components/AwaitingObject.d.ts.map +1 -1
- package/dist/types/src/components/CollectionArticle.d.ts +6 -3
- package/dist/types/src/components/CollectionArticle.d.ts.map +1 -1
- package/dist/types/src/components/CollectionSection.d.ts +1 -1
- package/dist/types/src/components/CollectionSection.d.ts.map +1 -1
- package/dist/types/src/components/CreateDialog/CreateObjectDialog.d.ts +2 -2
- package/dist/types/src/components/CreateDialog/CreateObjectDialog.d.ts.map +1 -1
- package/dist/types/src/components/CreateDialog/CreateObjectDialog.stories.d.ts +17 -7
- package/dist/types/src/components/CreateDialog/CreateObjectDialog.stories.d.ts.map +1 -1
- package/dist/types/src/components/CreateDialog/CreateObjectPanel.d.ts +9 -5
- package/dist/types/src/components/CreateDialog/CreateObjectPanel.d.ts.map +1 -1
- package/dist/types/src/components/CreateDialog/CreateSpaceDialog.d.ts.map +1 -1
- package/dist/types/src/components/JoinDialog/JoinDialog.d.ts.map +1 -1
- package/dist/types/src/components/MembersContainer/MembersContainer.d.ts.map +1 -1
- package/dist/types/src/components/MembersContainer/MembersContainer.stories.d.ts +11 -2
- package/dist/types/src/components/MembersContainer/MembersContainer.stories.d.ts.map +1 -1
- package/dist/types/src/components/MenuFooter.d.ts +1 -1
- package/dist/types/src/components/MenuFooter.d.ts.map +1 -1
- package/dist/types/src/components/ObjectCardStack/ObjectCardStack.d.ts +1 -1
- package/dist/types/src/components/ObjectCardStack/ObjectCardStack.d.ts.map +1 -1
- package/dist/types/src/components/ObjectCardStack/ObjectForm.d.ts +1 -1
- package/dist/types/src/components/ObjectCardStack/ObjectForm.d.ts.map +1 -1
- package/dist/types/src/components/ObjectDetails/BaseObjectSettings.d.ts +1 -1
- package/dist/types/src/components/ObjectDetails/BaseObjectSettings.d.ts.map +1 -1
- package/dist/types/src/components/ObjectDetails/BaseObjectSettings.stories.d.ts +9 -0
- package/dist/types/src/components/ObjectDetails/BaseObjectSettings.stories.d.ts.map +1 -1
- package/dist/types/src/components/ObjectDetails/ObjectDetails.d.ts +6 -5
- package/dist/types/src/components/ObjectDetails/ObjectDetails.d.ts.map +1 -1
- package/dist/types/src/components/ObjectRenamePopover/ObjectRenamePopover.d.ts +1 -1
- package/dist/types/src/components/ObjectRenamePopover/ObjectRenamePopover.d.ts.map +1 -1
- package/dist/types/src/components/RecordArticle.d.ts +2 -2
- package/dist/types/src/components/RecordArticle.d.ts.map +1 -1
- package/dist/types/src/components/RecordArticle.stories.d.ts +11 -2
- package/dist/types/src/components/RecordArticle.stories.d.ts.map +1 -1
- package/dist/types/src/components/SchemaContainer.d.ts.map +1 -1
- package/dist/types/src/components/SpacePluginSettings.d.ts +4 -2
- package/dist/types/src/components/SpacePluginSettings.d.ts.map +1 -1
- package/dist/types/src/components/SpacePresence/SpacePresence.d.ts +4 -4
- package/dist/types/src/components/SpacePresence/SpacePresence.d.ts.map +1 -1
- package/dist/types/src/components/SpacePresence/SpacePresence.stories.d.ts +9 -0
- package/dist/types/src/components/SpacePresence/SpacePresence.stories.d.ts.map +1 -1
- package/dist/types/src/components/SpaceRenamePopover/SpaceRenamePopover.d.ts.map +1 -1
- package/dist/types/src/components/SpaceSettings/SpaceSettingsContainer.d.ts +4 -1
- package/dist/types/src/components/SpaceSettings/SpaceSettingsContainer.d.ts.map +1 -1
- package/dist/types/src/components/SpaceSettings/SpaceSettingsContainer.stories.d.ts +13 -1
- package/dist/types/src/components/SpaceSettings/SpaceSettingsContainer.stories.d.ts.map +1 -1
- package/dist/types/src/components/SyncStatus/SyncStatus.stories.d.ts +9 -0
- package/dist/types/src/components/SyncStatus/SyncStatus.stories.d.ts.map +1 -1
- package/dist/types/src/components/ViewEditor.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +11 -6
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/constants.d.ts +6 -0
- package/dist/types/src/constants.d.ts.map +1 -0
- package/dist/types/src/helpers/query.d.ts +3 -3
- package/dist/types/src/helpers/query.d.ts.map +1 -1
- package/dist/types/src/hooks/useActiveSpace.d.ts +2 -2
- package/dist/types/src/hooks/useActiveSpace.d.ts.map +1 -1
- package/dist/types/src/hooks/usePath.d.ts +2 -2
- package/dist/types/src/hooks/usePath.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +2 -2
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +9 -0
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/capabilities.d.ts +71 -0
- package/dist/types/src/types/capabilities.d.ts.map +1 -0
- package/dist/types/src/types/events.d.ts +9 -0
- package/dist/types/src/types/events.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +2 -0
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +643 -354
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/src/util.d.ts +36 -31
- package/dist/types/src/util.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +83 -69
- package/src/SpacePlugin.ts +174 -194
- package/src/capabilities/app-graph-builder/app-graph-builder.ts +621 -0
- package/src/capabilities/app-graph-builder/index.ts +7 -0
- package/src/capabilities/app-graph-serializer/app-graph-serializer.ts +83 -0
- package/src/capabilities/app-graph-serializer/index.ts +7 -0
- package/src/capabilities/identity-created/identity-created.ts +29 -0
- package/src/capabilities/identity-created/index.ts +7 -0
- package/src/capabilities/index.ts +10 -14
- package/src/capabilities/operation-resolver/index.ts +7 -0
- package/src/capabilities/operation-resolver/operation-resolver.ts +762 -0
- package/src/capabilities/react-root/index.ts +7 -0
- package/src/capabilities/react-root/react-root.tsx +25 -0
- package/src/capabilities/react-surface/index.ts +7 -0
- package/src/capabilities/react-surface/react-surface.tsx +377 -0
- package/src/capabilities/repair/index.ts +7 -0
- package/src/capabilities/{repair.ts → repair/repair.ts} +21 -11
- package/src/capabilities/settings/index.ts +7 -0
- package/src/capabilities/settings/settings.ts +33 -0
- package/src/capabilities/spaces-ready/index.ts +7 -0
- package/src/capabilities/spaces-ready/spaces-ready.ts +290 -0
- package/src/capabilities/state/index.ts +7 -0
- package/src/capabilities/state/state.ts +64 -0
- package/src/cli/commands/database/add.ts +115 -0
- package/src/cli/commands/database/index.ts +16 -0
- package/src/cli/commands/database/query/index.ts +5 -0
- package/src/cli/commands/database/query/query.test.ts +55 -0
- package/src/cli/commands/database/query/query.ts +44 -0
- package/src/cli/commands/database/remove.ts +51 -0
- package/src/cli/commands/database/stats.ts +44 -0
- package/src/cli/commands/database/util.ts +32 -0
- package/src/cli/commands/index.ts +7 -0
- package/src/cli/commands/queue/index.ts +12 -0
- package/src/cli/commands/queue/query.ts +45 -0
- package/src/cli/commands/queue/util.ts +19 -0
- package/src/cli/commands/space/close/close.ts +40 -0
- package/src/cli/commands/space/close/index.ts +5 -0
- package/src/cli/commands/space/create/create.test.ts +67 -0
- package/src/cli/commands/space/create/create.ts +61 -0
- package/src/cli/commands/space/create/index.ts +5 -0
- package/src/cli/commands/space/index.ts +21 -0
- package/src/cli/commands/space/info/index.ts +5 -0
- package/src/cli/commands/space/info/info.test.ts +47 -0
- package/src/cli/commands/space/info/info.ts +37 -0
- package/src/cli/commands/space/join/index.ts +5 -0
- package/src/cli/commands/space/join/join.ts +122 -0
- package/src/cli/commands/space/join/util.ts +82 -0
- package/src/cli/commands/space/list/index.ts +5 -0
- package/src/cli/commands/space/list/list.test.ts +36 -0
- package/src/cli/commands/space/list/list.ts +30 -0
- package/src/cli/commands/space/members/index.ts +5 -0
- package/src/cli/commands/space/members/members.test.ts +46 -0
- package/src/cli/commands/space/members/members.ts +40 -0
- package/src/cli/commands/space/members/util.ts +29 -0
- package/src/cli/commands/space/open/index.ts +5 -0
- package/src/cli/commands/space/open/open.ts +39 -0
- package/src/cli/commands/space/schema/index.ts +12 -0
- package/src/cli/commands/space/schema/list/index.ts +5 -0
- package/src/cli/commands/space/schema/list/list.test.ts +42 -0
- package/src/cli/commands/space/schema/list/list.ts +64 -0
- package/src/cli/commands/space/schema/list/util.ts +39 -0
- package/src/cli/commands/space/share/index.ts +5 -0
- package/src/cli/commands/space/share/share.ts +112 -0
- package/src/cli/commands/space/sync/index.ts +5 -0
- package/src/cli/commands/space/sync/sync.test.ts +12 -0
- package/src/cli/commands/space/sync/sync.ts +33 -0
- package/src/cli/index.ts +5 -0
- package/src/cli/plugin.ts +88 -0
- package/src/components/AwaitingObject.tsx +14 -10
- package/src/components/CollectionArticle.tsx +142 -19
- package/src/components/CollectionSection.tsx +1 -1
- package/src/components/CreateDialog/CreateObjectDialog.stories.tsx +28 -22
- package/src/components/CreateDialog/CreateObjectDialog.tsx +55 -60
- package/src/components/CreateDialog/CreateObjectPanel.tsx +102 -52
- package/src/components/CreateDialog/CreateSpaceDialog.tsx +34 -51
- package/src/components/JoinDialog/JoinDialog.tsx +26 -52
- package/src/components/MembersContainer/MembersContainer.stories.tsx +3 -3
- package/src/components/MembersContainer/MembersContainer.tsx +76 -81
- package/src/components/MenuFooter.tsx +1 -1
- package/src/components/ObjectCardStack/ObjectCardStack.tsx +13 -10
- package/src/components/ObjectCardStack/ObjectForm.tsx +34 -27
- package/src/components/ObjectDetails/BaseObjectSettings.stories.tsx +8 -8
- package/src/components/ObjectDetails/BaseObjectSettings.tsx +35 -31
- package/src/components/ObjectDetails/ObjectDetails.tsx +9 -11
- package/src/components/ObjectRenamePopover/ObjectRenamePopover.tsx +9 -13
- package/src/components/RecordArticle.stories.tsx +14 -13
- package/src/components/RecordArticle.tsx +47 -37
- package/src/components/SchemaContainer.tsx +20 -17
- package/src/components/SpacePluginSettings.tsx +42 -35
- package/src/components/SpacePresence/SpacePresence.stories.tsx +1 -1
- package/src/components/SpacePresence/SpacePresence.tsx +15 -16
- package/src/components/SpaceRenamePopover/SpaceRenamePopover.tsx +11 -12
- package/src/components/SpaceSettings/SpaceSettingsContainer.stories.tsx +5 -5
- package/src/components/SpaceSettings/SpaceSettingsContainer.tsx +165 -182
- package/src/components/SyncStatus/InlineSyncStatus.tsx +1 -1
- package/src/components/SyncStatus/SyncStatus.stories.tsx +1 -1
- package/src/components/SyncStatus/SyncStatus.tsx +1 -1
- package/src/components/SyncStatus/save-tracker.ts +2 -2
- package/src/components/ViewEditor.tsx +16 -12
- package/src/constants.ts +11 -0
- package/src/helpers/query.ts +7 -6
- package/src/hooks/useActiveSpace.ts +8 -5
- package/src/hooks/useInputSurfaceLookup.tsx +3 -3
- package/src/hooks/usePath.ts +4 -4
- package/src/index.ts +1 -2
- package/src/meta.ts +2 -2
- package/src/translations.ts +4 -2
- package/src/types/capabilities.ts +73 -0
- package/src/types/events.ts +16 -0
- package/src/types/index.ts +2 -0
- package/src/types/types.ts +533 -245
- package/src/util.tsx +222 -230
- package/dist/lib/browser/CollectionArticle-WTHWY4YS.mjs +0 -31
- package/dist/lib/browser/CollectionArticle-WTHWY4YS.mjs.map +0 -7
- package/dist/lib/browser/ObjectCardStack-TE7AWPMH.mjs +0 -144
- package/dist/lib/browser/ObjectCardStack-TE7AWPMH.mjs.map +0 -7
- package/dist/lib/browser/ObjectDetails-666IBRHE.mjs +0 -144
- package/dist/lib/browser/ObjectDetails-666IBRHE.mjs.map +0 -7
- package/dist/lib/browser/RecordArticle-2PFEBPXY.mjs +0 -116
- package/dist/lib/browser/RecordArticle-2PFEBPXY.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-USKWFIDK.mjs +0 -551
- package/dist/lib/browser/app-graph-builder-USKWFIDK.mjs.map +0 -7
- package/dist/lib/browser/app-graph-serializer-SXIQ425K.mjs +0 -80
- package/dist/lib/browser/app-graph-serializer-SXIQ425K.mjs.map +0 -7
- package/dist/lib/browser/chunk-5CSSKOWR.mjs.map +0 -7
- package/dist/lib/browser/chunk-C6DAPIFF.mjs +0 -20
- package/dist/lib/browser/chunk-C6DAPIFF.mjs.map +0 -7
- package/dist/lib/browser/chunk-E4BEMEZ3.mjs +0 -399
- package/dist/lib/browser/chunk-E4BEMEZ3.mjs.map +0 -7
- package/dist/lib/browser/chunk-IJCMB5B5.mjs.map +0 -7
- package/dist/lib/browser/chunk-POFUXISV.mjs.map +0 -7
- package/dist/lib/browser/chunk-VZBIIYFM.mjs.map +0 -7
- package/dist/lib/browser/chunk-WJXU4GKV.mjs +0 -19
- package/dist/lib/browser/chunk-WJXU4GKV.mjs.map +0 -7
- package/dist/lib/browser/chunk-XKQCDLXX.mjs +0 -2103
- package/dist/lib/browser/chunk-XKQCDLXX.mjs.map +0 -7
- package/dist/lib/browser/identity-created-NAXTPQXE.mjs +0 -23
- package/dist/lib/browser/identity-created-NAXTPQXE.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-QEIM7NQT.mjs +0 -769
- package/dist/lib/browser/intent-resolver-QEIM7NQT.mjs.map +0 -7
- package/dist/lib/browser/react-root-T6ZETLD2.mjs +0 -30
- package/dist/lib/browser/react-root-T6ZETLD2.mjs.map +0 -7
- package/dist/lib/browser/react-surface-MLN5BZ2G.mjs +0 -374
- package/dist/lib/browser/react-surface-MLN5BZ2G.mjs.map +0 -7
- package/dist/lib/browser/repair-CNLE35NF.mjs.map +0 -7
- package/dist/lib/browser/settings-EGTCHS7U.mjs +0 -24
- package/dist/lib/browser/settings-EGTCHS7U.mjs.map +0 -7
- package/dist/lib/browser/spaces-ready-YS4BBZXW.mjs +0 -208
- package/dist/lib/browser/spaces-ready-YS4BBZXW.mjs.map +0 -7
- package/dist/lib/browser/state-C7N6EDDZ.mjs +0 -47
- package/dist/lib/browser/state-C7N6EDDZ.mjs.map +0 -7
- package/dist/lib/node-esm/CollectionArticle-KHXYT3SH.mjs +0 -32
- package/dist/lib/node-esm/CollectionArticle-KHXYT3SH.mjs.map +0 -7
- package/dist/lib/node-esm/ObjectCardStack-AAKMAQ6T.mjs +0 -145
- package/dist/lib/node-esm/ObjectCardStack-AAKMAQ6T.mjs.map +0 -7
- package/dist/lib/node-esm/ObjectDetails-TZ5YKXGN.mjs +0 -145
- package/dist/lib/node-esm/ObjectDetails-TZ5YKXGN.mjs.map +0 -7
- package/dist/lib/node-esm/RecordArticle-SSJ7PULS.mjs +0 -117
- package/dist/lib/node-esm/RecordArticle-SSJ7PULS.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-QRQ5EQLB.mjs +0 -552
- package/dist/lib/node-esm/app-graph-builder-QRQ5EQLB.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-serializer-P2X4W7LI.mjs +0 -81
- package/dist/lib/node-esm/app-graph-serializer-P2X4W7LI.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-3D4NGZPW.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-AX3UGL5D.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-BDEFTL6K.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-H4JILUJK.mjs +0 -20
- package/dist/lib/node-esm/chunk-H4JILUJK.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-QQQE2ZCX.mjs +0 -400
- package/dist/lib/node-esm/chunk-QQQE2ZCX.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-UMZ7G6G4.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-WWGV5FJM.mjs +0 -21
- package/dist/lib/node-esm/chunk-WWGV5FJM.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-XD532BVR.mjs +0 -2104
- package/dist/lib/node-esm/chunk-XD532BVR.mjs.map +0 -7
- package/dist/lib/node-esm/identity-created-OXLKCJE3.mjs +0 -25
- package/dist/lib/node-esm/identity-created-OXLKCJE3.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-ZWCBVABN.mjs +0 -770
- package/dist/lib/node-esm/intent-resolver-ZWCBVABN.mjs.map +0 -7
- package/dist/lib/node-esm/react-root-SKB4UJ4K.mjs +0 -31
- package/dist/lib/node-esm/react-root-SKB4UJ4K.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-BVZGNSBB.mjs +0 -375
- package/dist/lib/node-esm/react-surface-BVZGNSBB.mjs.map +0 -7
- package/dist/lib/node-esm/repair-EHZS6MFY.mjs.map +0 -7
- package/dist/lib/node-esm/settings-N3F6JCIR.mjs +0 -25
- package/dist/lib/node-esm/settings-N3F6JCIR.mjs.map +0 -7
- package/dist/lib/node-esm/spaces-ready-U2K5P4LB.mjs +0 -209
- package/dist/lib/node-esm/spaces-ready-U2K5P4LB.mjs.map +0 -7
- package/dist/lib/node-esm/state-45TXZQJ6.mjs +0 -48
- package/dist/lib/node-esm/state-45TXZQJ6.mjs.map +0 -7
- package/dist/types/src/capabilities/app-graph-builder.d.ts +0 -4
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +0 -1
- package/dist/types/src/capabilities/app-graph-serializer.d.ts +0 -4
- package/dist/types/src/capabilities/app-graph-serializer.d.ts.map +0 -1
- package/dist/types/src/capabilities/capabilities.d.ts +0 -34
- package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
- package/dist/types/src/capabilities/identity-created.d.ts +0 -4
- package/dist/types/src/capabilities/identity-created.d.ts.map +0 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +0 -9
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-root.d.ts +0 -7
- package/dist/types/src/capabilities/react-root.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface.d.ts +0 -7
- package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
- package/dist/types/src/capabilities/repair.d.ts +0 -4
- package/dist/types/src/capabilities/repair.d.ts.map +0 -1
- package/dist/types/src/capabilities/settings.d.ts +0 -4
- package/dist/types/src/capabilities/settings.d.ts.map +0 -1
- package/dist/types/src/capabilities/spaces-ready.d.ts +0 -4
- package/dist/types/src/capabilities/spaces-ready.d.ts.map +0 -1
- package/dist/types/src/capabilities/state.d.ts +0 -5
- package/dist/types/src/capabilities/state.d.ts.map +0 -1
- package/dist/types/src/events.d.ts +0 -8
- package/dist/types/src/events.d.ts.map +0 -1
- package/src/capabilities/app-graph-builder.ts +0 -724
- package/src/capabilities/app-graph-serializer.ts +0 -76
- package/src/capabilities/capabilities.ts +0 -40
- package/src/capabilities/identity-created.ts +0 -25
- package/src/capabilities/intent-resolver.ts +0 -705
- package/src/capabilities/react-root.tsx +0 -22
- package/src/capabilities/react-surface.tsx +0 -358
- package/src/capabilities/settings.ts +0 -21
- package/src/capabilities/spaces-ready.ts +0 -252
- package/src/capabilities/state.ts +0 -46
- package/src/events.ts +0 -15
package/src/util.tsx
CHANGED
|
@@ -3,53 +3,29 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { type Instruction } from '@atlaskit/pragmatic-drag-and-drop-hitbox/tree-item';
|
|
6
|
-
import
|
|
7
|
-
import * as Function from 'effect/Function';
|
|
8
|
-
import type * as Schema from 'effect/Schema';
|
|
6
|
+
import * as Effect from 'effect/Effect';
|
|
9
7
|
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
8
|
+
import { type CapabilityManager } from '@dxos/app-framework';
|
|
9
|
+
import { LayoutOperation } from '@dxos/app-toolkit';
|
|
10
|
+
import { type Space, SpaceState, isSpace } from '@dxos/client/echo';
|
|
11
|
+
import { type Database, Filter, Obj, Query, Ref, Type } from '@dxos/echo';
|
|
13
12
|
import { invariant } from '@dxos/invariant';
|
|
14
13
|
import { Migrations } from '@dxos/migrations';
|
|
15
|
-
import {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
type ActionData,
|
|
19
|
-
type InvokeParams,
|
|
20
|
-
type Node,
|
|
21
|
-
type NodeArg,
|
|
22
|
-
type ReadableGraph,
|
|
23
|
-
isGraphNode,
|
|
24
|
-
} from '@dxos/plugin-graph';
|
|
25
|
-
import { type Space, SpaceState, getSpace, isSpace } from '@dxos/react-client/echo';
|
|
26
|
-
import { ATTENDABLE_PATH_SEPARATOR } from '@dxos/react-ui-attention';
|
|
14
|
+
import { Operation } from '@dxos/operation';
|
|
15
|
+
import { Graph, Node } from '@dxos/plugin-graph';
|
|
16
|
+
import { ATTENDABLE_PATH_SEPARATOR } from '@dxos/react-ui-attention/types';
|
|
27
17
|
import { type TreeData } from '@dxos/react-ui-list';
|
|
28
|
-
import { Collection } from '@dxos/schema';
|
|
18
|
+
import { Collection, Expando } from '@dxos/schema';
|
|
29
19
|
import { createFilename } from '@dxos/util';
|
|
30
20
|
|
|
31
21
|
import { meta } from './meta';
|
|
32
|
-
import { SPACE_TYPE,
|
|
22
|
+
import { SPACE_TYPE, SpaceOperation } from './types';
|
|
33
23
|
|
|
34
24
|
export const SPACES = `${meta.id}-spaces`;
|
|
35
25
|
export const COMPOSER_SPACE_LOCK = `${meta.id}/lock`;
|
|
36
26
|
// TODO(wittjosiah): Remove.
|
|
37
27
|
export const SHARED = 'shared-spaces';
|
|
38
28
|
|
|
39
|
-
/**
|
|
40
|
-
* Convert a query result to an Atom value of the objects.
|
|
41
|
-
*/
|
|
42
|
-
export const atomFromQuery = <T extends Entity.Unknown>(query: QueryResult.QueryResult<T>): Atom.Atom<T[]> => {
|
|
43
|
-
return Atom.make((get) => {
|
|
44
|
-
const unsubscribe = query.subscribe((result) => {
|
|
45
|
-
get.setSelf(result.results);
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
get.addFinalizer(() => unsubscribe());
|
|
49
|
-
return query.results;
|
|
50
|
-
});
|
|
51
|
-
};
|
|
52
|
-
|
|
53
29
|
// TODO(wittjosiah): Factor out? Expose via capability?
|
|
54
30
|
export const getSpaceDisplayName = (
|
|
55
31
|
space: Space,
|
|
@@ -66,22 +42,18 @@ export const getSpaceDisplayName = (
|
|
|
66
42
|
|
|
67
43
|
const getCollectionGraphNodePartials = ({
|
|
68
44
|
collection,
|
|
69
|
-
|
|
45
|
+
db,
|
|
70
46
|
resolve,
|
|
71
47
|
}: {
|
|
72
48
|
collection: Collection.Collection;
|
|
73
|
-
|
|
49
|
+
db: Database.Database;
|
|
74
50
|
resolve: (typename: string) => Record<string, any>;
|
|
75
51
|
}) => {
|
|
76
52
|
return {
|
|
77
53
|
acceptPersistenceClass: new Set(['echo']),
|
|
78
|
-
acceptPersistenceKey: new Set([
|
|
54
|
+
acceptPersistenceKey: new Set([db.spaceId]),
|
|
79
55
|
role: 'branch',
|
|
80
|
-
|
|
81
|
-
// Change on disk.
|
|
82
|
-
collection.objects = nextOrder.filter(Obj.isObject).map(Ref.make);
|
|
83
|
-
},
|
|
84
|
-
onTransferStart: (child: Node<Obj.Any>, index?: number) => {
|
|
56
|
+
onTransferStart: (child: Node.Node<Obj.Unknown>, index?: number) => {
|
|
85
57
|
// TODO(wittjosiah): Support transfer between spaces.
|
|
86
58
|
// const childSpace = getSpace(child.data);
|
|
87
59
|
// if (space && childSpace && !childSpace.key.equals(space.key)) {
|
|
@@ -100,22 +72,26 @@ const getCollectionGraphNodePartials = ({
|
|
|
100
72
|
|
|
101
73
|
// Add child to destination collection.
|
|
102
74
|
// TODO(dmaretskyi): Compare by id.
|
|
103
|
-
|
|
104
|
-
if (
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
75
|
+
Obj.change(collection, (c) => {
|
|
76
|
+
if (!c.objects.find((object) => object.target === child.data)) {
|
|
77
|
+
if (typeof index !== 'undefined') {
|
|
78
|
+
c.objects.splice(index, 0, Ref.make(child.data));
|
|
79
|
+
} else {
|
|
80
|
+
c.objects.push(Ref.make(child.data));
|
|
81
|
+
}
|
|
108
82
|
}
|
|
109
|
-
}
|
|
83
|
+
});
|
|
110
84
|
|
|
111
85
|
// }
|
|
112
86
|
},
|
|
113
|
-
onTransferEnd: (child: Node<Obj.
|
|
87
|
+
onTransferEnd: (child: Node.Node<Obj.Unknown>, destination: Node.Node) => {
|
|
114
88
|
// Remove child from origin collection.
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
89
|
+
Obj.change(collection, (c) => {
|
|
90
|
+
const index = c.objects.findIndex((object) => object.target === child.data);
|
|
91
|
+
if (index > -1) {
|
|
92
|
+
c.objects.splice(index, 1);
|
|
93
|
+
}
|
|
94
|
+
});
|
|
119
95
|
|
|
120
96
|
// TODO(wittjosiah): Support transfer between spaces.
|
|
121
97
|
// const childSpace = getSpace(child.data);
|
|
@@ -126,26 +102,28 @@ const getCollectionGraphNodePartials = ({
|
|
|
126
102
|
// childSpace.db.remove(child.data);
|
|
127
103
|
// }
|
|
128
104
|
},
|
|
129
|
-
onCopy: async (child: Node<Obj.
|
|
105
|
+
onCopy: async (child: Node.Node<Obj.Unknown>, index?: number) => {
|
|
130
106
|
// Create clone of child and add to destination space.
|
|
131
|
-
const newObject = await cloneObject(child.data, resolve,
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
107
|
+
const newObject = await cloneObject(child.data, resolve, db);
|
|
108
|
+
db.add(newObject);
|
|
109
|
+
Obj.change(collection, (c) => {
|
|
110
|
+
if (typeof index !== 'undefined') {
|
|
111
|
+
c.objects.splice(index, 0, Ref.make(newObject));
|
|
112
|
+
} else {
|
|
113
|
+
c.objects.push(Ref.make(newObject));
|
|
114
|
+
}
|
|
115
|
+
});
|
|
138
116
|
},
|
|
139
117
|
};
|
|
140
118
|
};
|
|
141
119
|
|
|
142
120
|
const getSystemCollectionNodePartials = ({
|
|
143
121
|
collection,
|
|
144
|
-
|
|
122
|
+
db,
|
|
145
123
|
resolve,
|
|
146
124
|
}: {
|
|
147
125
|
collection: Collection.Managed;
|
|
148
|
-
|
|
126
|
+
db: Database.Database;
|
|
149
127
|
resolve: (typename: string) => Record<string, any>;
|
|
150
128
|
}) => {
|
|
151
129
|
const metadata = resolve(collection.key);
|
|
@@ -154,7 +132,7 @@ const getSystemCollectionNodePartials = ({
|
|
|
154
132
|
icon: metadata.icon,
|
|
155
133
|
iconHue: metadata.iconHue,
|
|
156
134
|
acceptPersistenceClass: new Set(['echo']),
|
|
157
|
-
acceptPersistenceKey: new Set([
|
|
135
|
+
acceptPersistenceKey: new Set([db.spaceId]),
|
|
158
136
|
role: 'branch',
|
|
159
137
|
};
|
|
160
138
|
};
|
|
@@ -181,21 +159,46 @@ export const constructSpaceNode = ({
|
|
|
181
159
|
personal,
|
|
182
160
|
namesCache,
|
|
183
161
|
resolve,
|
|
162
|
+
graph,
|
|
163
|
+
spacesOrder,
|
|
184
164
|
}: {
|
|
185
165
|
space: Space;
|
|
186
166
|
navigable?: boolean;
|
|
187
167
|
personal?: boolean;
|
|
188
168
|
namesCache?: Record<string, string>;
|
|
189
169
|
resolve: (typename: string) => Record<string, any>;
|
|
170
|
+
/** Graph for sorting edges on rearrange. */
|
|
171
|
+
graph?: Graph.ExpandableGraph;
|
|
172
|
+
// TODO(wittjosiah): Should be Type.Expando but it doesn't work with the AtomQuery result type.
|
|
173
|
+
/** Spaces order object for persisting workspace order. */
|
|
174
|
+
spacesOrder?: Obj.Any;
|
|
190
175
|
}) => {
|
|
191
176
|
const hasPendingMigration = checkPendingMigration(space);
|
|
192
177
|
const collection =
|
|
193
178
|
space.state.get() === SpaceState.SPACE_READY && space.properties[Collection.Collection.typename]?.target;
|
|
194
179
|
const partials =
|
|
195
180
|
space.state.get() === SpaceState.SPACE_READY && Obj.instanceOf(Collection.Collection, collection)
|
|
196
|
-
? getCollectionGraphNodePartials({ collection, space, resolve })
|
|
181
|
+
? getCollectionGraphNodePartials({ collection, db: space.db, resolve })
|
|
197
182
|
: {};
|
|
198
183
|
|
|
184
|
+
const onRearrange =
|
|
185
|
+
graph && spacesOrder
|
|
186
|
+
? (nextOrder: Space[]) => {
|
|
187
|
+
// NOTE: This is needed to ensure order is updated by next animation frame.
|
|
188
|
+
Graph.sortEdges(
|
|
189
|
+
graph,
|
|
190
|
+
Node.RootId,
|
|
191
|
+
'outbound',
|
|
192
|
+
nextOrder.map(({ id }) => id),
|
|
193
|
+
);
|
|
194
|
+
|
|
195
|
+
// Persist order to database.
|
|
196
|
+
Obj.change(spacesOrder, (mutableOrder: any) => {
|
|
197
|
+
mutableOrder.order = nextOrder.map(({ id }) => id);
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
: undefined;
|
|
201
|
+
|
|
199
202
|
return {
|
|
200
203
|
id: space.id,
|
|
201
204
|
type: SPACE_TYPE,
|
|
@@ -212,7 +215,9 @@ export const constructSpaceNode = ({
|
|
|
212
215
|
: undefined,
|
|
213
216
|
iconHue: space.state.get() === SpaceState.SPACE_READY && space.properties.iconHue,
|
|
214
217
|
disabled: !navigable || space.state.get() !== SpaceState.SPACE_READY || hasPendingMigration,
|
|
218
|
+
disposition: 'workspace',
|
|
215
219
|
testId: 'spacePlugin.space',
|
|
220
|
+
onRearrange,
|
|
216
221
|
canDrop: (source: TreeData) => {
|
|
217
222
|
// TODO(wittjosiah): Find a way to only allow space as source for rearranging.
|
|
218
223
|
return Obj.isObject(source.item.data) || isSpace(source.item.data);
|
|
@@ -237,6 +242,7 @@ export const constructSpaceNode = ({
|
|
|
237
242
|
label: ['space settings properties label', { ns: meta.id }],
|
|
238
243
|
icon: 'ph--sliders--regular',
|
|
239
244
|
position: 'hoist',
|
|
245
|
+
testId: 'spacePlugin.general',
|
|
240
246
|
},
|
|
241
247
|
},
|
|
242
248
|
{
|
|
@@ -247,6 +253,7 @@ export const constructSpaceNode = ({
|
|
|
247
253
|
label: ['members panel label', { ns: meta.id }],
|
|
248
254
|
icon: 'ph--users--regular',
|
|
249
255
|
position: 'hoist',
|
|
256
|
+
testId: 'spacePlugin.members',
|
|
250
257
|
},
|
|
251
258
|
},
|
|
252
259
|
{
|
|
@@ -256,6 +263,7 @@ export const constructSpaceNode = ({
|
|
|
256
263
|
properties: {
|
|
257
264
|
label: ['space settings schema label', { ns: meta.id }],
|
|
258
265
|
icon: 'ph--shapes--regular',
|
|
266
|
+
testId: 'spacePlugin.schema',
|
|
259
267
|
},
|
|
260
268
|
},
|
|
261
269
|
],
|
|
@@ -266,27 +274,23 @@ export const constructSpaceNode = ({
|
|
|
266
274
|
|
|
267
275
|
export const constructSpaceActions = ({
|
|
268
276
|
space,
|
|
269
|
-
dispatch,
|
|
270
277
|
personal,
|
|
271
278
|
migrating,
|
|
272
279
|
}: {
|
|
273
280
|
space: Space;
|
|
274
|
-
dispatch: PromiseIntentDispatcher;
|
|
275
281
|
personal?: boolean;
|
|
276
282
|
migrating?: boolean;
|
|
277
283
|
}) => {
|
|
278
284
|
const state = space.state.get();
|
|
279
285
|
const hasPendingMigration = checkPendingMigration(space);
|
|
280
286
|
const getId = (id: string) => `${id}/${space.id}`;
|
|
281
|
-
const actions: NodeArg<ActionData
|
|
287
|
+
const actions: Node.NodeArg<Node.ActionData<Operation.Service>>[] = [];
|
|
282
288
|
|
|
283
289
|
if (hasPendingMigration) {
|
|
284
290
|
actions.push({
|
|
285
|
-
id: getId(
|
|
286
|
-
type:
|
|
287
|
-
data:
|
|
288
|
-
await dispatch(createIntent(SpaceAction.Migrate, { space }));
|
|
289
|
-
},
|
|
291
|
+
id: getId(SpaceOperation.Migrate.meta.key),
|
|
292
|
+
type: Node.ActionGroupType,
|
|
293
|
+
data: () => Operation.invoke(SpaceOperation.Migrate, { space }),
|
|
290
294
|
properties: {
|
|
291
295
|
label: ['migrate space label', { ns: meta.id }],
|
|
292
296
|
icon: 'ph--database--regular',
|
|
@@ -299,24 +303,20 @@ export const constructSpaceActions = ({
|
|
|
299
303
|
if (state === SpaceState.SPACE_READY && !hasPendingMigration) {
|
|
300
304
|
actions.push(
|
|
301
305
|
{
|
|
302
|
-
id: getId(
|
|
303
|
-
type:
|
|
304
|
-
data:
|
|
305
|
-
await dispatch(createIntent(SpaceAction.OpenCreateObject, { target: space }));
|
|
306
|
-
},
|
|
306
|
+
id: getId(SpaceOperation.OpenCreateObject.meta.key),
|
|
307
|
+
type: Node.ActionType,
|
|
308
|
+
data: () => Operation.invoke(SpaceOperation.OpenCreateObject, { target: space.db }),
|
|
307
309
|
properties: {
|
|
308
310
|
label: ['create object in space label', { ns: meta.id }],
|
|
309
311
|
icon: 'ph--plus--regular',
|
|
310
|
-
disposition: 'item',
|
|
312
|
+
disposition: 'list-item-primary',
|
|
311
313
|
testId: 'spacePlugin.createObject',
|
|
312
314
|
},
|
|
313
315
|
},
|
|
314
316
|
{
|
|
315
|
-
id: getId(
|
|
316
|
-
type:
|
|
317
|
-
data:
|
|
318
|
-
await dispatch(createIntent(SpaceAction.Rename, { space, caller: params?.caller }));
|
|
319
|
-
},
|
|
317
|
+
id: getId(SpaceOperation.Rename.meta.key),
|
|
318
|
+
type: Node.ActionType,
|
|
319
|
+
data: (params?: Node.InvokeProps) => Operation.invoke(SpaceOperation.Rename, { space, caller: params?.caller }),
|
|
320
320
|
properties: {
|
|
321
321
|
label: ['rename space label', { ns: meta.id }],
|
|
322
322
|
icon: 'ph--pencil-simple-line--regular',
|
|
@@ -332,13 +332,7 @@ export const constructSpaceActions = ({
|
|
|
332
332
|
return actions;
|
|
333
333
|
};
|
|
334
334
|
|
|
335
|
-
export const createStaticSchemaNode = ({
|
|
336
|
-
schema,
|
|
337
|
-
space,
|
|
338
|
-
}: {
|
|
339
|
-
schema: Schema.Schema.AnyNoContext;
|
|
340
|
-
space: Space;
|
|
341
|
-
}): Node => {
|
|
335
|
+
export const createStaticSchemaNode = ({ schema, space }: { schema: Type.Entity.Any; space: Space }): Node.Node => {
|
|
342
336
|
return {
|
|
343
337
|
id: `${space.id}/${Type.getTypename(schema)}`,
|
|
344
338
|
type: `${meta.id}/static-schema`,
|
|
@@ -358,29 +352,24 @@ export const createStaticSchemaNode = ({
|
|
|
358
352
|
export const createStaticSchemaActions = ({
|
|
359
353
|
schema,
|
|
360
354
|
space,
|
|
361
|
-
dispatch,
|
|
362
355
|
deletable,
|
|
363
356
|
}: {
|
|
364
357
|
schema: Type.Obj.Any;
|
|
365
358
|
space: Space;
|
|
366
|
-
dispatch: PromiseIntentDispatcher;
|
|
367
359
|
deletable: boolean;
|
|
368
360
|
}) => {
|
|
369
361
|
const getId = (id: string) => `${space.id}/${Type.getTypename(schema)}/${id}`;
|
|
370
362
|
|
|
371
|
-
const actions: NodeArg<ActionData
|
|
363
|
+
const actions: Node.NodeArg<Node.ActionData<Operation.Service>>[] = [
|
|
372
364
|
{
|
|
373
|
-
id: getId(
|
|
374
|
-
type:
|
|
375
|
-
data:
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
}),
|
|
382
|
-
);
|
|
383
|
-
},
|
|
365
|
+
id: getId(SpaceOperation.AddObject.meta.key),
|
|
366
|
+
type: Node.ActionType,
|
|
367
|
+
data: () =>
|
|
368
|
+
Operation.invoke(SpaceOperation.OpenCreateObject, {
|
|
369
|
+
target: space.db,
|
|
370
|
+
views: true,
|
|
371
|
+
initialFormValues: { typename: Type.getTypename(schema) },
|
|
372
|
+
}),
|
|
384
373
|
properties: {
|
|
385
374
|
label: ['add view to schema label', { ns: meta.id }],
|
|
386
375
|
icon: 'ph--plus--regular',
|
|
@@ -389,11 +378,9 @@ export const createStaticSchemaActions = ({
|
|
|
389
378
|
},
|
|
390
379
|
},
|
|
391
380
|
{
|
|
392
|
-
id: getId(
|
|
393
|
-
type:
|
|
394
|
-
data:
|
|
395
|
-
throw new Error('Not implemented');
|
|
396
|
-
},
|
|
381
|
+
id: getId(SpaceOperation.RenameObject.meta.key),
|
|
382
|
+
type: Node.ActionType,
|
|
383
|
+
data: () => Effect.fail(new Error('Not implemented')),
|
|
397
384
|
properties: {
|
|
398
385
|
label: ['rename object label', { ns: Type.getTypename(Type.PersistentType) }],
|
|
399
386
|
icon: 'ph--pencil-simple-line--regular',
|
|
@@ -403,16 +390,19 @@ export const createStaticSchemaActions = ({
|
|
|
403
390
|
},
|
|
404
391
|
},
|
|
405
392
|
{
|
|
406
|
-
id: getId(
|
|
407
|
-
type:
|
|
408
|
-
data:
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
393
|
+
id: getId(SpaceOperation.RemoveObjects.meta.key),
|
|
394
|
+
type: Node.ActionType,
|
|
395
|
+
data: () =>
|
|
396
|
+
Effect.sync(() => {
|
|
397
|
+
const index = space.properties.staticRecords.findIndex(
|
|
398
|
+
(typename: string) => typename === Type.getTypename(schema),
|
|
399
|
+
);
|
|
400
|
+
if (index > -1) {
|
|
401
|
+
Obj.change(space.properties, (p) => {
|
|
402
|
+
p.staticRecords.splice(index, 1);
|
|
403
|
+
});
|
|
404
|
+
}
|
|
405
|
+
}),
|
|
416
406
|
properties: {
|
|
417
407
|
label: ['delete object label', { ns: Type.getTypename(Type.PersistentType) }],
|
|
418
408
|
icon: 'ph--trash--regular',
|
|
@@ -422,22 +412,19 @@ export const createStaticSchemaActions = ({
|
|
|
422
412
|
},
|
|
423
413
|
},
|
|
424
414
|
{
|
|
425
|
-
id: getId(
|
|
426
|
-
type:
|
|
427
|
-
data:
|
|
428
|
-
const result =
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
await downloadBlob(
|
|
436
|
-
result.data.snapshot,
|
|
437
|
-
createFilename({ parts: [space.id, Type.getTypename(schema)], ext: 'json' }),
|
|
415
|
+
id: getId(SpaceOperation.Snapshot.meta.key),
|
|
416
|
+
type: Node.ActionType,
|
|
417
|
+
data: Effect.fnUntraced(function* () {
|
|
418
|
+
const result = yield* Operation.invoke(SpaceOperation.Snapshot, {
|
|
419
|
+
db: space.db,
|
|
420
|
+
query: Query.select(Filter.type(schema)).ast,
|
|
421
|
+
});
|
|
422
|
+
if (result.snapshot) {
|
|
423
|
+
yield* Effect.tryPromise(() =>
|
|
424
|
+
downloadBlob(result.snapshot, createFilename({ parts: [space.id, Type.getTypename(schema)], ext: 'json' })),
|
|
438
425
|
);
|
|
439
426
|
}
|
|
440
|
-
},
|
|
427
|
+
}),
|
|
441
428
|
properties: {
|
|
442
429
|
label: ['snapshot by schema label', { ns: meta.id }],
|
|
443
430
|
icon: 'ph--camera--regular',
|
|
@@ -450,21 +437,24 @@ export const createStaticSchemaActions = ({
|
|
|
450
437
|
};
|
|
451
438
|
|
|
452
439
|
export const createObjectNode = ({
|
|
453
|
-
|
|
440
|
+
db,
|
|
454
441
|
object,
|
|
455
442
|
disposition,
|
|
456
443
|
droppable = true,
|
|
457
444
|
navigable = false,
|
|
458
445
|
managedCollectionChild = false,
|
|
459
446
|
resolve,
|
|
447
|
+
parentCollection,
|
|
460
448
|
}: {
|
|
461
|
-
|
|
462
|
-
object: Obj.
|
|
449
|
+
db: Database.Database;
|
|
450
|
+
object: Obj.Unknown;
|
|
463
451
|
disposition?: string;
|
|
464
452
|
droppable?: boolean;
|
|
465
453
|
navigable?: boolean;
|
|
466
454
|
managedCollectionChild?: boolean;
|
|
467
455
|
resolve: (typename: string) => Record<string, any>;
|
|
456
|
+
/** Parent collection for rearranging objects. */
|
|
457
|
+
parentCollection?: Collection.Collection;
|
|
468
458
|
}) => {
|
|
469
459
|
const type = Obj.getTypename(object);
|
|
470
460
|
if (!type) {
|
|
@@ -473,9 +463,9 @@ export const createObjectNode = ({
|
|
|
473
463
|
|
|
474
464
|
const metadata = resolve(type);
|
|
475
465
|
const partials = Obj.instanceOf(Collection.Collection, object)
|
|
476
|
-
? getCollectionGraphNodePartials({ collection: object,
|
|
466
|
+
? getCollectionGraphNodePartials({ collection: object, db, resolve })
|
|
477
467
|
: Obj.instanceOf(Collection.Managed, object)
|
|
478
|
-
? getSystemCollectionNodePartials({ collection: object,
|
|
468
|
+
? getSystemCollectionNodePartials({ collection: object, db, resolve })
|
|
479
469
|
: Obj.instanceOf(Type.PersistentType, object)
|
|
480
470
|
? getSchemaGraphNodePartials()
|
|
481
471
|
: metadata.graphProps;
|
|
@@ -505,9 +495,16 @@ export const createObjectNode = ({
|
|
|
505
495
|
disposition,
|
|
506
496
|
testId: 'spacePlugin.object',
|
|
507
497
|
persistenceClass: 'echo',
|
|
508
|
-
persistenceKey:
|
|
498
|
+
persistenceKey: db.spaceId,
|
|
509
499
|
selectable,
|
|
510
500
|
managedCollectionChild,
|
|
501
|
+
onRearrange: parentCollection
|
|
502
|
+
? (nextOrder: unknown[]) => {
|
|
503
|
+
Obj.change(parentCollection, (c) => {
|
|
504
|
+
c.objects = nextOrder.filter(Obj.isObject).map(Ref.make);
|
|
505
|
+
});
|
|
506
|
+
}
|
|
507
|
+
: undefined,
|
|
511
508
|
blockInstruction: (source: TreeData, instruction: Instruction) => {
|
|
512
509
|
if (source.item.properties.managedCollectionChild) {
|
|
513
510
|
// TODO(wittjosiah): Support reordering system collections.
|
|
@@ -522,7 +519,7 @@ export const createObjectNode = ({
|
|
|
522
519
|
return managedCollectionChild;
|
|
523
520
|
},
|
|
524
521
|
canDrop: (source: TreeData) => {
|
|
525
|
-
return droppable && isGraphNode(source.item) && Obj.isObject(source.item.data);
|
|
522
|
+
return droppable && Node.isGraphNode(source.item) && Obj.isObject(source.item.data);
|
|
526
523
|
},
|
|
527
524
|
...partials,
|
|
528
525
|
},
|
|
@@ -532,20 +529,22 @@ export const createObjectNode = ({
|
|
|
532
529
|
export const constructObjectActions = ({
|
|
533
530
|
object,
|
|
534
531
|
graph,
|
|
535
|
-
dispatch,
|
|
536
532
|
resolve,
|
|
533
|
+
capabilities,
|
|
537
534
|
deletable = true,
|
|
538
535
|
navigable = false,
|
|
536
|
+
shareableLinkOrigin,
|
|
539
537
|
}: {
|
|
540
|
-
object: Obj.
|
|
541
|
-
graph: ReadableGraph;
|
|
542
|
-
dispatch: PromiseIntentDispatcher;
|
|
538
|
+
object: Obj.Unknown;
|
|
539
|
+
graph: Graph.ReadableGraph;
|
|
543
540
|
resolve: (typename: string) => Record<string, any>;
|
|
541
|
+
capabilities: CapabilityManager.CapabilityManager;
|
|
542
|
+
shareableLinkOrigin: string;
|
|
544
543
|
deletable?: boolean;
|
|
545
544
|
navigable?: boolean;
|
|
546
545
|
}) => {
|
|
547
|
-
const
|
|
548
|
-
invariant(
|
|
546
|
+
const db = Obj.getDatabase(object);
|
|
547
|
+
invariant(db, 'Database not found');
|
|
549
548
|
const typename = Obj.getTypename(object);
|
|
550
549
|
invariant(typename, 'Object has no typename');
|
|
551
550
|
|
|
@@ -553,18 +552,16 @@ export const constructObjectActions = ({
|
|
|
553
552
|
|
|
554
553
|
const managedCollection = Obj.instanceOf(Collection.Managed, object) ? object : undefined;
|
|
555
554
|
const metadata = managedCollection ? resolve(managedCollection.key) : {};
|
|
556
|
-
const
|
|
555
|
+
const createObject = metadata.createObject;
|
|
557
556
|
const inputSchema = metadata.inputSchema;
|
|
558
557
|
|
|
559
|
-
const actions: NodeArg<ActionData
|
|
558
|
+
const actions: Node.NodeArg<Node.ActionData<Operation.Service>>[] = [
|
|
560
559
|
...(Obj.instanceOf(Collection.Collection, object)
|
|
561
560
|
? [
|
|
562
561
|
{
|
|
563
|
-
id: getId(
|
|
564
|
-
type:
|
|
565
|
-
data:
|
|
566
|
-
await dispatch(createIntent(SpaceAction.OpenCreateObject, { target: object }));
|
|
567
|
-
},
|
|
562
|
+
id: getId(SpaceOperation.OpenCreateObject.meta.key),
|
|
563
|
+
type: Node.ActionType,
|
|
564
|
+
data: () => Operation.invoke(SpaceOperation.OpenCreateObject, { target: object }),
|
|
568
565
|
properties: {
|
|
569
566
|
label: ['create object in collection label', { ns: meta.id }],
|
|
570
567
|
icon: 'ph--plus--regular',
|
|
@@ -577,17 +574,14 @@ export const constructObjectActions = ({
|
|
|
577
574
|
...(Obj.instanceOf(Type.PersistentType, object)
|
|
578
575
|
? [
|
|
579
576
|
{
|
|
580
|
-
id: getId(
|
|
581
|
-
type:
|
|
582
|
-
data:
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
}),
|
|
589
|
-
);
|
|
590
|
-
},
|
|
577
|
+
id: getId(SpaceOperation.AddObject.meta.key),
|
|
578
|
+
type: Node.ActionType,
|
|
579
|
+
data: () =>
|
|
580
|
+
Operation.invoke(SpaceOperation.OpenCreateObject, {
|
|
581
|
+
target: db,
|
|
582
|
+
views: true,
|
|
583
|
+
initialFormValues: { typename: object.typename },
|
|
584
|
+
}),
|
|
591
585
|
properties: {
|
|
592
586
|
label: ['add view to schema label', { ns: meta.id }],
|
|
593
587
|
icon: 'ph--plus--regular',
|
|
@@ -596,22 +590,19 @@ export const constructObjectActions = ({
|
|
|
596
590
|
},
|
|
597
591
|
},
|
|
598
592
|
{
|
|
599
|
-
id: getId(
|
|
600
|
-
type:
|
|
601
|
-
data:
|
|
602
|
-
const result =
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
await downloadBlob(
|
|
610
|
-
result.data.snapshot,
|
|
611
|
-
createFilename({ parts: [space.id, object.typename], ext: 'json' }),
|
|
593
|
+
id: getId(SpaceOperation.Snapshot.meta.key),
|
|
594
|
+
type: Node.ActionType,
|
|
595
|
+
data: Effect.fnUntraced(function* () {
|
|
596
|
+
const result = yield* Operation.invoke(SpaceOperation.Snapshot, {
|
|
597
|
+
db,
|
|
598
|
+
query: Query.select(Filter.type(Type.toEffectSchema(object.jsonSchema))).ast,
|
|
599
|
+
});
|
|
600
|
+
if (result.snapshot) {
|
|
601
|
+
yield* Effect.promise(() =>
|
|
602
|
+
downloadBlob(result.snapshot, createFilename({ parts: [db.spaceId, object.typename], ext: 'json' })),
|
|
612
603
|
);
|
|
613
604
|
}
|
|
614
|
-
},
|
|
605
|
+
}),
|
|
615
606
|
properties: {
|
|
616
607
|
label: ['snapshot by schema label', { ns: meta.id }],
|
|
617
608
|
icon: 'ph--camera--regular',
|
|
@@ -620,29 +611,33 @@ export const constructObjectActions = ({
|
|
|
620
611
|
},
|
|
621
612
|
]
|
|
622
613
|
: []),
|
|
623
|
-
...(
|
|
614
|
+
...(createObject
|
|
624
615
|
? [
|
|
625
616
|
{
|
|
626
|
-
id: getId(
|
|
627
|
-
type:
|
|
628
|
-
data:
|
|
617
|
+
id: getId(SpaceOperation.OpenCreateObject.meta.key),
|
|
618
|
+
type: Node.ActionType,
|
|
619
|
+
data: Effect.fnUntraced(function* () {
|
|
629
620
|
if (inputSchema) {
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
}),
|
|
635
|
-
);
|
|
621
|
+
yield* Operation.invoke(SpaceOperation.OpenCreateObject, {
|
|
622
|
+
target: db,
|
|
623
|
+
typename: managedCollection ? managedCollection.key : undefined,
|
|
624
|
+
});
|
|
636
625
|
} else {
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
626
|
+
const createdObject = yield* createObject({}, { db, capabilities }) as Effect.Effect<
|
|
627
|
+
Obj.Unknown,
|
|
628
|
+
Error,
|
|
629
|
+
never
|
|
630
|
+
>;
|
|
631
|
+
const addResult = yield* Operation.invoke(SpaceOperation.AddObject, {
|
|
632
|
+
target: db,
|
|
633
|
+
hidden: true,
|
|
634
|
+
object: createdObject,
|
|
635
|
+
});
|
|
636
|
+
if (addResult.id) {
|
|
637
|
+
yield* Operation.invoke(LayoutOperation.Open, { subject: [addResult.id] });
|
|
638
|
+
}
|
|
644
639
|
}
|
|
645
|
-
},
|
|
640
|
+
}),
|
|
646
641
|
properties: {
|
|
647
642
|
label: ['create object in system collection label', { ns: meta.id }],
|
|
648
643
|
icon: 'ph--plus--regular',
|
|
@@ -656,11 +651,10 @@ export const constructObjectActions = ({
|
|
|
656
651
|
? []
|
|
657
652
|
: [
|
|
658
653
|
{
|
|
659
|
-
id: getId(
|
|
660
|
-
type:
|
|
661
|
-
data:
|
|
662
|
-
|
|
663
|
-
},
|
|
654
|
+
id: getId(SpaceOperation.RenameObject.meta.key),
|
|
655
|
+
type: Node.ActionType,
|
|
656
|
+
data: (params?: Node.InvokeProps) =>
|
|
657
|
+
Operation.invoke(SpaceOperation.RenameObject, { object, caller: params?.caller }),
|
|
664
658
|
properties: {
|
|
665
659
|
label: ['rename object label', { ns: typename }],
|
|
666
660
|
icon: 'ph--pencil-simple-line--regular',
|
|
@@ -673,14 +667,15 @@ export const constructObjectActions = ({
|
|
|
673
667
|
},
|
|
674
668
|
},
|
|
675
669
|
{
|
|
676
|
-
id: getId(
|
|
677
|
-
type:
|
|
678
|
-
data:
|
|
679
|
-
const collection = graph
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
670
|
+
id: getId(SpaceOperation.RemoveObjects.meta.key),
|
|
671
|
+
type: Node.ActionType,
|
|
672
|
+
data: Effect.fnUntraced(function* () {
|
|
673
|
+
const collection = Graph.getConnections(graph, Obj.getDXN(object).toString(), 'inbound').find(
|
|
674
|
+
(node: Node.Node): node is Node.Node<Collection.Collection> =>
|
|
675
|
+
Obj.instanceOf(Collection.Collection, node.data),
|
|
676
|
+
)?.data;
|
|
677
|
+
yield* Operation.invoke(SpaceOperation.RemoveObjects, { objects: [object], target: collection });
|
|
678
|
+
}),
|
|
684
679
|
properties: {
|
|
685
680
|
label: ['delete object label', { ns: typename }],
|
|
686
681
|
icon: 'ph--trash--regular',
|
|
@@ -699,11 +694,12 @@ export const constructObjectActions = ({
|
|
|
699
694
|
? [
|
|
700
695
|
{
|
|
701
696
|
id: getId('copy-link'),
|
|
702
|
-
type:
|
|
703
|
-
data:
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
697
|
+
type: Node.ActionType,
|
|
698
|
+
data: () =>
|
|
699
|
+
Effect.promise(async () => {
|
|
700
|
+
const url = `${shareableLinkOrigin}/${db.spaceId}/${Obj.getDXN(object).toString()}`;
|
|
701
|
+
await navigator.clipboard.writeText(url);
|
|
702
|
+
}),
|
|
707
703
|
properties: {
|
|
708
704
|
label: ['copy link label', { ns: meta.id }],
|
|
709
705
|
icon: 'ph--link--regular',
|
|
@@ -715,13 +711,9 @@ export const constructObjectActions = ({
|
|
|
715
711
|
: []),
|
|
716
712
|
// TODO(wittjosiah): Factor out and apply to all nodes.
|
|
717
713
|
{
|
|
718
|
-
id: getId(
|
|
719
|
-
type:
|
|
720
|
-
data:
|
|
721
|
-
await dispatch(
|
|
722
|
-
createIntent(LayoutAction.Expose, { part: 'navigation', subject: Obj.getDXN(object).toString() }),
|
|
723
|
-
);
|
|
724
|
-
},
|
|
714
|
+
id: getId(LayoutOperation.Expose.meta.key),
|
|
715
|
+
type: Node.ActionType,
|
|
716
|
+
data: () => Operation.invoke(LayoutOperation.Expose, { subject: Obj.getDXN(object).toString() }),
|
|
725
717
|
properties: {
|
|
726
718
|
label: ['expose object label', { ns: meta.id }],
|
|
727
719
|
icon: 'ph--eye--regular',
|
|
@@ -752,9 +744,9 @@ const downloadBlob = async (blob: Blob, filename: string) => {
|
|
|
752
744
|
* @deprecated This is a temporary solution.
|
|
753
745
|
*/
|
|
754
746
|
export const getNestedObjects = async (
|
|
755
|
-
object: Obj.
|
|
747
|
+
object: Obj.Unknown,
|
|
756
748
|
resolve: (typename: string) => Record<string, any>,
|
|
757
|
-
): Promise<Obj.
|
|
749
|
+
): Promise<Obj.Unknown[]> => {
|
|
758
750
|
const type = Obj.getTypename(object);
|
|
759
751
|
if (!type) {
|
|
760
752
|
return [];
|
|
@@ -766,7 +758,7 @@ export const getNestedObjects = async (
|
|
|
766
758
|
return [];
|
|
767
759
|
}
|
|
768
760
|
|
|
769
|
-
const objects: Obj.
|
|
761
|
+
const objects: Obj.Unknown[] = await loadReferences(object);
|
|
770
762
|
const nested = await Promise.all(objects.map((object) => getNestedObjects(object, resolve)));
|
|
771
763
|
return [...objects, ...nested.flat()];
|
|
772
764
|
};
|
|
@@ -776,15 +768,15 @@ export const getNestedObjects = async (
|
|
|
776
768
|
*/
|
|
777
769
|
// TODO(burdon): Remove.
|
|
778
770
|
export const cloneObject = async (
|
|
779
|
-
object: Obj.
|
|
771
|
+
object: Obj.Unknown,
|
|
780
772
|
resolve: (typename: string) => Record<string, any>,
|
|
781
|
-
|
|
782
|
-
): Promise<Obj.
|
|
773
|
+
newDb: Database.Database,
|
|
774
|
+
): Promise<Obj.Unknown> => {
|
|
783
775
|
const schema = Obj.getSchema(object);
|
|
784
|
-
const typename = schema ? (Type.getTypename(schema) ??
|
|
776
|
+
const typename = schema ? (Type.getTypename(schema) ?? Expando.Expando.typename) : Expando.Expando.typename;
|
|
785
777
|
const metadata = resolve(typename);
|
|
786
778
|
const serializer = metadata.serializer;
|
|
787
779
|
invariant(serializer, `No serializer for type: ${typename}`);
|
|
788
780
|
const content = await serializer.serialize({ object });
|
|
789
|
-
return serializer.deserialize({ content,
|
|
781
|
+
return serializer.deserialize({ content, db: newDb, newId: true });
|
|
790
782
|
};
|