@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
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React from 'react';
|
|
6
|
-
|
|
7
|
-
import { Capabilities, contributes } from '@dxos/app-framework';
|
|
8
|
-
import { useCapability } from '@dxos/app-framework/react';
|
|
9
|
-
|
|
10
|
-
import { AwaitingObject } from '../components';
|
|
11
|
-
import { meta } from '../meta';
|
|
12
|
-
|
|
13
|
-
import { SpaceCapabilities } from './capabilities';
|
|
14
|
-
|
|
15
|
-
export default () =>
|
|
16
|
-
contributes(Capabilities.ReactRoot, {
|
|
17
|
-
id: meta.id,
|
|
18
|
-
root: () => {
|
|
19
|
-
const state = useCapability(SpaceCapabilities.State);
|
|
20
|
-
return state.awaiting ? <AwaitingObject id={state.awaiting} /> : null;
|
|
21
|
-
},
|
|
22
|
-
});
|
|
@@ -1,358 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import * as Option from 'effect/Option';
|
|
6
|
-
import type * as Schema from 'effect/Schema';
|
|
7
|
-
import React, { useCallback } from 'react';
|
|
8
|
-
|
|
9
|
-
import { Capabilities, contributes, createSurface } from '@dxos/app-framework';
|
|
10
|
-
import { Surface, useCapability, useLayout } from '@dxos/app-framework/react';
|
|
11
|
-
import { Obj, type Ref } from '@dxos/echo';
|
|
12
|
-
import { findAnnotation } from '@dxos/effect';
|
|
13
|
-
import { SettingsStore } from '@dxos/local-storage';
|
|
14
|
-
import { type Space, SpaceState, getSpace, isLiveObject, isSpace, parseId, useSpace } from '@dxos/react-client/echo';
|
|
15
|
-
import { Input } from '@dxos/react-ui';
|
|
16
|
-
import { type FormFieldComponentProps, SelectField } from '@dxos/react-ui-form';
|
|
17
|
-
import { HuePicker, IconPicker } from '@dxos/react-ui-pickers';
|
|
18
|
-
import { Collection, type View, ViewAnnotation } from '@dxos/schema';
|
|
19
|
-
import { type JoinPanelProps } from '@dxos/shell/react';
|
|
20
|
-
|
|
21
|
-
import {
|
|
22
|
-
CREATE_OBJECT_DIALOG,
|
|
23
|
-
CREATE_SPACE_DIALOG,
|
|
24
|
-
CollectionArticle,
|
|
25
|
-
CollectionSection,
|
|
26
|
-
CreateObjectDialog,
|
|
27
|
-
type CreateObjectDialogProps,
|
|
28
|
-
CreateSpaceDialog,
|
|
29
|
-
InlineSyncStatus,
|
|
30
|
-
JOIN_DIALOG,
|
|
31
|
-
JoinDialog,
|
|
32
|
-
MembersContainer,
|
|
33
|
-
MenuFooter,
|
|
34
|
-
OBJECT_RENAME_POPOVER,
|
|
35
|
-
ObjectCardStack,
|
|
36
|
-
ObjectDetails,
|
|
37
|
-
ObjectRenamePopover,
|
|
38
|
-
RecordArticle,
|
|
39
|
-
SPACE_RENAME_POPOVER,
|
|
40
|
-
SchemaContainer,
|
|
41
|
-
SmallPresenceLive,
|
|
42
|
-
SpacePluginSettings,
|
|
43
|
-
SpacePresence,
|
|
44
|
-
SpaceRenamePopover,
|
|
45
|
-
SpaceSettingsContainer,
|
|
46
|
-
SyncStatus,
|
|
47
|
-
ViewEditor,
|
|
48
|
-
} from '../components';
|
|
49
|
-
import { useTypeOptions } from '../hooks';
|
|
50
|
-
import { meta } from '../meta';
|
|
51
|
-
import {
|
|
52
|
-
HueAnnotationId,
|
|
53
|
-
IconAnnotationId,
|
|
54
|
-
type SpaceSettingsProps,
|
|
55
|
-
type TypeInputOptions,
|
|
56
|
-
TypeInputOptionsAnnotationId,
|
|
57
|
-
} from '../types';
|
|
58
|
-
|
|
59
|
-
import { SpaceCapabilities } from './capabilities';
|
|
60
|
-
|
|
61
|
-
type ReactSurfaceOptions = {
|
|
62
|
-
createInvitationUrl: (invitationCode: string) => string;
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
export default ({ createInvitationUrl }: ReactSurfaceOptions) =>
|
|
66
|
-
contributes(Capabilities.ReactSurface, [
|
|
67
|
-
createSurface({
|
|
68
|
-
id: `${meta.id}/article`,
|
|
69
|
-
role: 'article',
|
|
70
|
-
filter: (data): data is { subject: Space } =>
|
|
71
|
-
// TODO(wittjosiah): Need to avoid shotgun parsing space state everywhere.
|
|
72
|
-
isSpace(data.subject) && data.subject.state.get() === SpaceState.SPACE_READY,
|
|
73
|
-
component: ({ data, role, ...rest }) => (
|
|
74
|
-
<Surface
|
|
75
|
-
data={{
|
|
76
|
-
id: data.subject.id,
|
|
77
|
-
subject: data.subject.properties[Collection.Collection.typename]?.target,
|
|
78
|
-
}}
|
|
79
|
-
role={role}
|
|
80
|
-
{...rest}
|
|
81
|
-
/>
|
|
82
|
-
),
|
|
83
|
-
}),
|
|
84
|
-
createSurface({
|
|
85
|
-
id: `${meta.id}/record-article`,
|
|
86
|
-
role: 'article',
|
|
87
|
-
position: 'fallback',
|
|
88
|
-
filter: (data): data is { subject: Obj.Any } => Obj.isObject(data.subject),
|
|
89
|
-
component: ({ data }) => <RecordArticle subject={data.subject} />,
|
|
90
|
-
}),
|
|
91
|
-
createSurface({
|
|
92
|
-
id: `${meta.id}/collection-fallback`,
|
|
93
|
-
role: 'article',
|
|
94
|
-
position: 'fallback',
|
|
95
|
-
filter: (data): data is { subject: Collection.Collection } => Obj.instanceOf(Collection.Collection, data.subject),
|
|
96
|
-
component: ({ data }) => <CollectionArticle subject={data.subject} />,
|
|
97
|
-
}),
|
|
98
|
-
createSurface({
|
|
99
|
-
id: `${meta.id}/plugin-settings`,
|
|
100
|
-
role: 'article',
|
|
101
|
-
filter: (data): data is { subject: SettingsStore<SpaceSettingsProps> } =>
|
|
102
|
-
data.subject instanceof SettingsStore && data.subject.prefix === meta.id,
|
|
103
|
-
component: ({ data: { subject } }) => <SpacePluginSettings settings={subject.value} />,
|
|
104
|
-
}),
|
|
105
|
-
createSurface({
|
|
106
|
-
id: `${meta.id}/companion/object-settings`,
|
|
107
|
-
role: 'article',
|
|
108
|
-
filter: (data): data is { companionTo: Obj.Any } => Obj.isObject(data.companionTo) && data.subject === 'settings',
|
|
109
|
-
component: ({ ref, data, role }) => <ObjectDetails object={data.companionTo} role={role} ref={ref} />,
|
|
110
|
-
}),
|
|
111
|
-
createSurface({
|
|
112
|
-
id: `${meta.id}/space-settings-properties`,
|
|
113
|
-
role: 'article',
|
|
114
|
-
filter: (data): data is { subject: string } => data.subject === `${meta.id}/properties`,
|
|
115
|
-
component: ({ ref }) => {
|
|
116
|
-
const layout = useLayout();
|
|
117
|
-
const { spaceId } = parseId(layout.workspace);
|
|
118
|
-
const space = useSpace(spaceId);
|
|
119
|
-
if (!space || !spaceId) {
|
|
120
|
-
return null;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
return <SpaceSettingsContainer space={space} ref={ref} />;
|
|
124
|
-
},
|
|
125
|
-
}),
|
|
126
|
-
createSurface({
|
|
127
|
-
id: `${meta.id}/space-settings-members`,
|
|
128
|
-
role: 'article',
|
|
129
|
-
position: 'hoist',
|
|
130
|
-
filter: (data): data is { subject: string } => data.subject === `${meta.id}/members`,
|
|
131
|
-
component: () => {
|
|
132
|
-
const layout = useLayout();
|
|
133
|
-
const { spaceId } = parseId(layout.workspace);
|
|
134
|
-
const space = useSpace(spaceId);
|
|
135
|
-
if (!space || !spaceId) {
|
|
136
|
-
return null;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
return <MembersContainer space={space} createInvitationUrl={createInvitationUrl} />;
|
|
140
|
-
},
|
|
141
|
-
}),
|
|
142
|
-
createSurface({
|
|
143
|
-
id: `${meta.id}/space-settings-schema`,
|
|
144
|
-
role: 'article',
|
|
145
|
-
filter: (data): data is { subject: string } => data.subject === `${meta.id}/schema`,
|
|
146
|
-
component: () => {
|
|
147
|
-
const layout = useLayout();
|
|
148
|
-
const { spaceId } = parseId(layout.workspace);
|
|
149
|
-
const space = useSpace(spaceId);
|
|
150
|
-
if (!space || !spaceId) {
|
|
151
|
-
return null;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
return <SchemaContainer space={space} />;
|
|
155
|
-
},
|
|
156
|
-
}),
|
|
157
|
-
createSurface({
|
|
158
|
-
id: `${meta.id}/selected-objects`,
|
|
159
|
-
role: 'article',
|
|
160
|
-
filter: (data): data is { companionTo: Obj.Obj<{ view: Ref.Ref<View.View> }>; subject: 'selected-objects' } => {
|
|
161
|
-
if (data.subject !== 'selected-objects' || !Obj.isObject(data.companionTo)) {
|
|
162
|
-
return false;
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
// TODO(burdon): Check companionTo.view.target is valid.
|
|
166
|
-
const schema = Obj.getSchema(data.companionTo);
|
|
167
|
-
return Option.fromNullable(schema).pipe(
|
|
168
|
-
Option.flatMap((schema) => ViewAnnotation.get(schema)),
|
|
169
|
-
Option.getOrElse(() => false),
|
|
170
|
-
);
|
|
171
|
-
},
|
|
172
|
-
component: ({ data, ref }) => (
|
|
173
|
-
<ObjectCardStack
|
|
174
|
-
key={Obj.getDXN(data.companionTo).toString()}
|
|
175
|
-
objectId={Obj.getDXN(data.companionTo).toString()}
|
|
176
|
-
view={data.companionTo.view.target!}
|
|
177
|
-
ref={ref}
|
|
178
|
-
/>
|
|
179
|
-
),
|
|
180
|
-
}),
|
|
181
|
-
createSurface({
|
|
182
|
-
id: JOIN_DIALOG,
|
|
183
|
-
role: 'dialog',
|
|
184
|
-
filter: (data): data is { props: JoinPanelProps } => data.component === JOIN_DIALOG,
|
|
185
|
-
component: ({ data }) => <JoinDialog {...data.props} />,
|
|
186
|
-
}),
|
|
187
|
-
createSurface({
|
|
188
|
-
id: CREATE_SPACE_DIALOG,
|
|
189
|
-
role: 'dialog',
|
|
190
|
-
filter: (data): data is any => data.component === CREATE_SPACE_DIALOG,
|
|
191
|
-
component: () => <CreateSpaceDialog />,
|
|
192
|
-
}),
|
|
193
|
-
createSurface({
|
|
194
|
-
id: CREATE_OBJECT_DIALOG,
|
|
195
|
-
role: 'dialog',
|
|
196
|
-
filter: (data): data is { props: CreateObjectDialogProps } => data.component === CREATE_OBJECT_DIALOG,
|
|
197
|
-
component: ({ data }) => <CreateObjectDialog {...data.props} />,
|
|
198
|
-
}),
|
|
199
|
-
createSurface({
|
|
200
|
-
id: `${meta.id}/create-initial-space-form-[hue]`,
|
|
201
|
-
role: 'form-input',
|
|
202
|
-
filter: (data): data is { prop: string; schema: Schema.Schema<any> } => {
|
|
203
|
-
const annotation = findAnnotation<boolean>((data.schema as Schema.Schema.All).ast, HueAnnotationId);
|
|
204
|
-
return !!annotation;
|
|
205
|
-
},
|
|
206
|
-
component: ({ data: _, ...inputProps }) => {
|
|
207
|
-
const { label, readonly, type, getValue, onValueChange } = inputProps as any as FormFieldComponentProps;
|
|
208
|
-
const handleChange = useCallback((nextHue: string) => onValueChange(type, nextHue), [onValueChange]);
|
|
209
|
-
const handleReset = useCallback(() => onValueChange(type, undefined), [onValueChange]);
|
|
210
|
-
return (
|
|
211
|
-
<Input.Root>
|
|
212
|
-
<Input.Label>{label}</Input.Label>
|
|
213
|
-
<HuePicker disabled={!!readonly} value={getValue() ?? ''} onChange={handleChange} onReset={handleReset} />
|
|
214
|
-
</Input.Root>
|
|
215
|
-
);
|
|
216
|
-
},
|
|
217
|
-
}),
|
|
218
|
-
createSurface({
|
|
219
|
-
id: `${meta.id}/create-initial-space-form-[icon]`,
|
|
220
|
-
role: 'form-input',
|
|
221
|
-
filter: (data): data is { prop: string; schema: Schema.Schema<any> } => {
|
|
222
|
-
const annotation = findAnnotation<boolean>((data.schema as Schema.Schema.All).ast, IconAnnotationId);
|
|
223
|
-
return !!annotation;
|
|
224
|
-
},
|
|
225
|
-
component: ({ data: _, ...inputProps }) => {
|
|
226
|
-
const { label, readonly, type, getValue, onValueChange } = inputProps as any as FormFieldComponentProps;
|
|
227
|
-
const handleChange = useCallback((nextIcon: string) => onValueChange(type, nextIcon), [onValueChange]);
|
|
228
|
-
const handleReset = useCallback(() => onValueChange(type, undefined), [onValueChange]);
|
|
229
|
-
return (
|
|
230
|
-
<Input.Root>
|
|
231
|
-
<Input.Label>{label}</Input.Label>
|
|
232
|
-
<IconPicker disabled={!!readonly} value={getValue() ?? ''} onChange={handleChange} onReset={handleReset} />
|
|
233
|
-
</Input.Root>
|
|
234
|
-
);
|
|
235
|
-
},
|
|
236
|
-
}),
|
|
237
|
-
createSurface({
|
|
238
|
-
id: `${meta.id}/typename-form-input`,
|
|
239
|
-
role: 'form-input',
|
|
240
|
-
filter: (
|
|
241
|
-
data,
|
|
242
|
-
): data is {
|
|
243
|
-
prop: string;
|
|
244
|
-
schema: Schema.Schema.Any;
|
|
245
|
-
target: Space | Collection.Collection | undefined;
|
|
246
|
-
} => {
|
|
247
|
-
if (data.prop !== 'typename') {
|
|
248
|
-
return false;
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
const annotation = findAnnotation((data.schema as Schema.Schema.All).ast, TypeInputOptionsAnnotationId);
|
|
252
|
-
return !!annotation;
|
|
253
|
-
},
|
|
254
|
-
component: ({ data: { schema, target }, ...inputProps }) => {
|
|
255
|
-
const props = inputProps as any as FormFieldComponentProps;
|
|
256
|
-
const space = isSpace(target) ? target : getSpace(target);
|
|
257
|
-
const annotation = findAnnotation<TypeInputOptions>(schema.ast, TypeInputOptionsAnnotationId)!;
|
|
258
|
-
const options = useTypeOptions({ space, annotation });
|
|
259
|
-
|
|
260
|
-
return <SelectField {...props} options={options} />;
|
|
261
|
-
},
|
|
262
|
-
}),
|
|
263
|
-
createSurface({
|
|
264
|
-
id: `${meta.id}/object-settings`,
|
|
265
|
-
role: 'object-settings',
|
|
266
|
-
filter: (data): data is { subject: { view: Ref.Ref<View.View> } } => {
|
|
267
|
-
if (!Obj.isObject(data.subject)) {
|
|
268
|
-
return false;
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
const schema = Obj.getSchema(data.subject);
|
|
272
|
-
return Option.fromNullable(schema).pipe(
|
|
273
|
-
Option.flatMap((schema) => ViewAnnotation.get(schema)),
|
|
274
|
-
Option.getOrElse(() => false),
|
|
275
|
-
);
|
|
276
|
-
},
|
|
277
|
-
component: ({ data }) => {
|
|
278
|
-
const view = data.subject.view.target;
|
|
279
|
-
if (!view) {
|
|
280
|
-
return null;
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
return <ViewEditor view={view} />;
|
|
284
|
-
},
|
|
285
|
-
}),
|
|
286
|
-
createSurface({
|
|
287
|
-
id: SPACE_RENAME_POPOVER,
|
|
288
|
-
role: 'card--popover',
|
|
289
|
-
filter: (data): data is { props: Space } => data.component === SPACE_RENAME_POPOVER && isSpace(data.props),
|
|
290
|
-
component: ({ data }) => <SpaceRenamePopover space={data.props} />,
|
|
291
|
-
}),
|
|
292
|
-
createSurface({
|
|
293
|
-
id: OBJECT_RENAME_POPOVER,
|
|
294
|
-
role: 'card--popover',
|
|
295
|
-
filter: (data): data is { props: Obj.Any } =>
|
|
296
|
-
data.component === OBJECT_RENAME_POPOVER && isLiveObject(data.props),
|
|
297
|
-
component: ({ data }) => <ObjectRenamePopover object={data.props} />,
|
|
298
|
-
}),
|
|
299
|
-
createSurface({
|
|
300
|
-
id: `${meta.id}/menu-footer`,
|
|
301
|
-
role: 'menu-footer',
|
|
302
|
-
filter: (data): data is { subject: Obj.Any } => Obj.isObject(data.subject),
|
|
303
|
-
component: ({ data }) => <MenuFooter object={data.subject} />,
|
|
304
|
-
}),
|
|
305
|
-
createSurface({
|
|
306
|
-
id: `${meta.id}/navtree-presence`,
|
|
307
|
-
role: 'navtree-item-end',
|
|
308
|
-
filter: (data): data is { id: string; subject: Obj.Any; open?: boolean } =>
|
|
309
|
-
typeof data.id === 'string' && Obj.isObject(data.subject),
|
|
310
|
-
component: ({ data }) => {
|
|
311
|
-
// TODO(wittjosiah): Doesn't need to be mutable but readonly type messes with ComplexMap.
|
|
312
|
-
const state = useCapability(SpaceCapabilities.MutableState);
|
|
313
|
-
return <SmallPresenceLive id={data.id} open={data.open} viewers={state.viewersByObject[data.id]} />;
|
|
314
|
-
},
|
|
315
|
-
}),
|
|
316
|
-
// TODO(wittjosiah): Attention glyph for non-echo items should be handled elsewhere.
|
|
317
|
-
createSurface({
|
|
318
|
-
id: `${meta.id}/navtree-presence-fallback`,
|
|
319
|
-
role: 'navtree-item-end',
|
|
320
|
-
position: 'fallback',
|
|
321
|
-
filter: (data): data is { id: string; open?: boolean } => typeof data.id === 'string',
|
|
322
|
-
component: ({ data }) => <SmallPresenceLive id={data.id} open={data.open} />,
|
|
323
|
-
}),
|
|
324
|
-
// TODO(wittjosiah): Broken?
|
|
325
|
-
createSurface({
|
|
326
|
-
id: `${meta.id}/navtree-sync-status`,
|
|
327
|
-
role: 'navtree-item-end',
|
|
328
|
-
filter: (data): data is { subject: Space; open?: boolean } => isSpace(data.subject),
|
|
329
|
-
component: ({ data }) => <InlineSyncStatus space={data.subject} open={data.open} />,
|
|
330
|
-
}),
|
|
331
|
-
createSurface({
|
|
332
|
-
id: `${meta.id}/navbar-presence`,
|
|
333
|
-
role: 'navbar-end',
|
|
334
|
-
position: 'hoist',
|
|
335
|
-
filter: (data): data is { subject: Space | Obj.Any } => isSpace(data.subject) || Obj.isObject(data.subject),
|
|
336
|
-
component: ({ data }) => {
|
|
337
|
-
const space = isSpace(data.subject) ? data.subject : getSpace(data.subject);
|
|
338
|
-
const object = isSpace(data.subject)
|
|
339
|
-
? data.subject.state.get() === SpaceState.SPACE_READY
|
|
340
|
-
? (space?.properties[Collection.Collection.typename]?.target as Collection.Collection)
|
|
341
|
-
: undefined
|
|
342
|
-
: data.subject;
|
|
343
|
-
|
|
344
|
-
return object ? <SpacePresence object={object} /> : null;
|
|
345
|
-
},
|
|
346
|
-
}),
|
|
347
|
-
createSurface({
|
|
348
|
-
id: `${meta.id}/collection-section`,
|
|
349
|
-
role: 'section',
|
|
350
|
-
filter: (data): data is { subject: Collection.Collection } => Obj.instanceOf(Collection.Collection, data.subject),
|
|
351
|
-
component: ({ data }) => <CollectionSection subject={data.subject} />,
|
|
352
|
-
}),
|
|
353
|
-
createSurface({
|
|
354
|
-
id: `${meta.id}/status`,
|
|
355
|
-
role: 'status',
|
|
356
|
-
component: () => <SyncStatus />,
|
|
357
|
-
}),
|
|
358
|
-
]);
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { Capabilities, contributes } from '@dxos/app-framework';
|
|
6
|
-
import { live } from '@dxos/live-object';
|
|
7
|
-
|
|
8
|
-
import { meta } from '../meta';
|
|
9
|
-
import { type SpaceSettingsProps, SpaceSettingsSchema } from '../types';
|
|
10
|
-
|
|
11
|
-
export default () => {
|
|
12
|
-
const settings = live<SpaceSettingsProps>({
|
|
13
|
-
showHidden: false,
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
return contributes(Capabilities.Settings, {
|
|
17
|
-
prefix: meta.id,
|
|
18
|
-
schema: SpaceSettingsSchema,
|
|
19
|
-
value: settings,
|
|
20
|
-
});
|
|
21
|
-
};
|
|
@@ -1,252 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import * as Option from 'effect/Option';
|
|
6
|
-
|
|
7
|
-
import { Capabilities, LayoutAction, type PluginContext, contributes, createIntent } from '@dxos/app-framework';
|
|
8
|
-
import { SubscriptionList } from '@dxos/async';
|
|
9
|
-
import { Filter, Obj, Type } from '@dxos/echo';
|
|
10
|
-
import { scheduledEffect } from '@dxos/echo-signals/core';
|
|
11
|
-
import { log } from '@dxos/log';
|
|
12
|
-
import { AttentionCapabilities } from '@dxos/plugin-attention';
|
|
13
|
-
import { ClientCapabilities } from '@dxos/plugin-client';
|
|
14
|
-
import { DeckCapabilities } from '@dxos/plugin-deck';
|
|
15
|
-
import { EdgeReplicationSetting } from '@dxos/protocols/proto/dxos/echo/metadata';
|
|
16
|
-
import { PublicKey } from '@dxos/react-client';
|
|
17
|
-
import { SpaceState, parseId } from '@dxos/react-client/echo';
|
|
18
|
-
import { ComplexMap, reduceGroupBy } from '@dxos/util';
|
|
19
|
-
|
|
20
|
-
import { SpaceAction } from '../types';
|
|
21
|
-
import { COMPOSER_SPACE_LOCK, SHARED } from '../util';
|
|
22
|
-
|
|
23
|
-
import { SpaceCapabilities } from './capabilities';
|
|
24
|
-
|
|
25
|
-
const ACTIVE_NODE_BROADCAST_INTERVAL = 30_000;
|
|
26
|
-
const WAIT_FOR_OBJECT_TIMEOUT = 5_000;
|
|
27
|
-
|
|
28
|
-
// E.g., dxn:echo:BA25QRC2FEWCSAMRP4RZL65LWJ7352CKE:01J00J9B45YHYSGZQTQMSKMGJ6
|
|
29
|
-
const ECHO_DXN_LENGTH = 3 + 1 + 4 + 1 + 33 + 1 + 26;
|
|
30
|
-
|
|
31
|
-
export default async (context: PluginContext) => {
|
|
32
|
-
const subscriptions = new SubscriptionList();
|
|
33
|
-
const spaceSubscriptions = new SubscriptionList();
|
|
34
|
-
|
|
35
|
-
const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);
|
|
36
|
-
const { graph } = context.getCapability(Capabilities.AppGraph);
|
|
37
|
-
const layout = context.getCapability(Capabilities.Layout);
|
|
38
|
-
const deck = context.getCapabilities(DeckCapabilities.DeckState)[0];
|
|
39
|
-
const attention = context.getCapability(AttentionCapabilities.Attention);
|
|
40
|
-
const state = context.getCapability(SpaceCapabilities.MutableState);
|
|
41
|
-
const client = context.getCapability(ClientCapabilities.Client);
|
|
42
|
-
|
|
43
|
-
const defaultSpace = client.spaces.default;
|
|
44
|
-
await defaultSpace.waitUntilReady();
|
|
45
|
-
|
|
46
|
-
if (deck?.activeDeck === 'default') {
|
|
47
|
-
await dispatch(
|
|
48
|
-
createIntent(LayoutAction.SwitchWorkspace, {
|
|
49
|
-
part: 'workspace',
|
|
50
|
-
subject: defaultSpace.id,
|
|
51
|
-
}),
|
|
52
|
-
);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
// Initialize space sharing lock in default space.
|
|
56
|
-
if (typeof defaultSpace.properties[COMPOSER_SPACE_LOCK] !== 'boolean') {
|
|
57
|
-
defaultSpace.properties[COMPOSER_SPACE_LOCK] = true;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
const [spacesOrder] = await defaultSpace.db.query(Filter.type(Type.Expando, { key: SHARED })).run();
|
|
61
|
-
if (!spacesOrder) {
|
|
62
|
-
// TODO(wittjosiah): Cannot be a Folder because Spaces are not TypedObjects so can't be saved in the database.
|
|
63
|
-
// Instead, we store order as an array of space ids.
|
|
64
|
-
defaultSpace.db.add(Obj.make(Type.Expando, { key: SHARED, order: [] }));
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
// Await missing objects.
|
|
68
|
-
subscriptions.add(
|
|
69
|
-
scheduledEffect(
|
|
70
|
-
() => ({ active: layout.active }),
|
|
71
|
-
({ active }) => {
|
|
72
|
-
if (active.length !== 1) {
|
|
73
|
-
return;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
const id = active[0];
|
|
77
|
-
const node = graph.getNode(id).pipe(Option.getOrNull);
|
|
78
|
-
if (!node && id.length === ECHO_DXN_LENGTH) {
|
|
79
|
-
void graph.initialize(id);
|
|
80
|
-
const timeout = setTimeout(async () => {
|
|
81
|
-
const node = graph.getNode(id).pipe(Option.getOrNull);
|
|
82
|
-
if (!node) {
|
|
83
|
-
await dispatch(createIntent(SpaceAction.WaitForObject, { id }));
|
|
84
|
-
}
|
|
85
|
-
}, WAIT_FOR_OBJECT_TIMEOUT);
|
|
86
|
-
|
|
87
|
-
return () => clearTimeout(timeout);
|
|
88
|
-
}
|
|
89
|
-
},
|
|
90
|
-
),
|
|
91
|
-
);
|
|
92
|
-
|
|
93
|
-
// Cache space names.
|
|
94
|
-
subscriptions.add(
|
|
95
|
-
client.spaces.subscribe(async (spaces) => {
|
|
96
|
-
// TODO(wittjosiah): Remove. This is a hack to be able to migrate the default space properties.
|
|
97
|
-
if (defaultSpace.state.get() === SpaceState.SPACE_REQUIRES_MIGRATION) {
|
|
98
|
-
await defaultSpace.internal.migrate();
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
spaces
|
|
102
|
-
.filter((space) => space.state.get() === SpaceState.SPACE_READY)
|
|
103
|
-
.forEach((space) => {
|
|
104
|
-
subscriptions.add(
|
|
105
|
-
scheduledEffect(
|
|
106
|
-
() => ({ name: space.properties.name }),
|
|
107
|
-
({ name }) => {
|
|
108
|
-
if (!name) {
|
|
109
|
-
delete state.spaceNames[space.id];
|
|
110
|
-
} else {
|
|
111
|
-
state.spaceNames[space.id] = name;
|
|
112
|
-
}
|
|
113
|
-
},
|
|
114
|
-
),
|
|
115
|
-
);
|
|
116
|
-
});
|
|
117
|
-
}).unsubscribe,
|
|
118
|
-
);
|
|
119
|
-
|
|
120
|
-
// Broadcast active node to other peers in the space.
|
|
121
|
-
subscriptions.add(
|
|
122
|
-
scheduledEffect(
|
|
123
|
-
() => ({
|
|
124
|
-
current: attention.current,
|
|
125
|
-
active: layout.active,
|
|
126
|
-
inactive: layout.inactive,
|
|
127
|
-
}),
|
|
128
|
-
({ current, active, inactive }) => {
|
|
129
|
-
const send = () => {
|
|
130
|
-
const spaces = client.spaces.get();
|
|
131
|
-
const identity = client.halo.identity.get();
|
|
132
|
-
if (identity) {
|
|
133
|
-
// Group parts by space for efficient messaging.
|
|
134
|
-
const idsBySpace = reduceGroupBy(active, (id) => {
|
|
135
|
-
try {
|
|
136
|
-
const { spaceId } = parseId(id);
|
|
137
|
-
return spaceId;
|
|
138
|
-
} catch {
|
|
139
|
-
return null;
|
|
140
|
-
}
|
|
141
|
-
});
|
|
142
|
-
|
|
143
|
-
const removedBySpace = reduceGroupBy(inactive, (id) => {
|
|
144
|
-
try {
|
|
145
|
-
const { spaceId } = parseId(id);
|
|
146
|
-
return spaceId;
|
|
147
|
-
} catch {
|
|
148
|
-
return null;
|
|
149
|
-
}
|
|
150
|
-
});
|
|
151
|
-
|
|
152
|
-
// NOTE: Ensure all spaces are included so that we send the correct `removed` object arrays.
|
|
153
|
-
for (const space of spaces) {
|
|
154
|
-
if (!idsBySpace.has(space.id)) {
|
|
155
|
-
idsBySpace.set(space.id, []);
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
for (const [spaceId, added] of idsBySpace) {
|
|
160
|
-
const removed = removedBySpace.get(spaceId) ?? [];
|
|
161
|
-
const space = spaces.find((space) => space.id === spaceId);
|
|
162
|
-
if (!space) {
|
|
163
|
-
continue;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
void space
|
|
167
|
-
.postMessage('viewing', {
|
|
168
|
-
identityKey: identity.identityKey.toHex(),
|
|
169
|
-
attended: current,
|
|
170
|
-
added,
|
|
171
|
-
removed,
|
|
172
|
-
})
|
|
173
|
-
// TODO(burdon): This seems defensive; why would this fail? Backoff interval.
|
|
174
|
-
.catch((err) => {
|
|
175
|
-
log.warn('Failed to broadcast active node for presence.', {
|
|
176
|
-
err: err.message,
|
|
177
|
-
});
|
|
178
|
-
});
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
};
|
|
182
|
-
|
|
183
|
-
send();
|
|
184
|
-
// Send at interval to allow peers to expire entries if they become disconnected.
|
|
185
|
-
const interval = setInterval(() => send(), ACTIVE_NODE_BROADCAST_INTERVAL);
|
|
186
|
-
return () => clearInterval(interval);
|
|
187
|
-
},
|
|
188
|
-
),
|
|
189
|
-
);
|
|
190
|
-
|
|
191
|
-
// Listen for active nodes from other peers in the space.
|
|
192
|
-
subscriptions.add(
|
|
193
|
-
client.spaces.subscribe((spaces) => {
|
|
194
|
-
spaceSubscriptions.clear();
|
|
195
|
-
spaces.forEach((space) => {
|
|
196
|
-
spaceSubscriptions.add(
|
|
197
|
-
space.listen('viewing', (message) => {
|
|
198
|
-
const { added, removed, attended } = message.payload;
|
|
199
|
-
|
|
200
|
-
const identityKey = PublicKey.safeFrom(message.payload.identityKey);
|
|
201
|
-
const currentIdentity = client.halo.identity.get();
|
|
202
|
-
if (
|
|
203
|
-
identityKey &&
|
|
204
|
-
!currentIdentity?.identityKey.equals(identityKey) &&
|
|
205
|
-
Array.isArray(added) &&
|
|
206
|
-
Array.isArray(removed)
|
|
207
|
-
) {
|
|
208
|
-
added.forEach((id) => {
|
|
209
|
-
if (typeof id === 'string') {
|
|
210
|
-
if (!(id in state.viewersByObject)) {
|
|
211
|
-
state.viewersByObject[id] = new ComplexMap(PublicKey.hash);
|
|
212
|
-
}
|
|
213
|
-
state.viewersByObject[id]!.set(identityKey, {
|
|
214
|
-
lastSeen: Date.now(),
|
|
215
|
-
currentlyAttended: new Set(attended).has(id),
|
|
216
|
-
});
|
|
217
|
-
if (!state.viewersByIdentity.has(identityKey)) {
|
|
218
|
-
state.viewersByIdentity.set(identityKey, new Set());
|
|
219
|
-
}
|
|
220
|
-
state.viewersByIdentity.get(identityKey)!.add(id);
|
|
221
|
-
}
|
|
222
|
-
});
|
|
223
|
-
|
|
224
|
-
removed.forEach((id) => {
|
|
225
|
-
if (typeof id === 'string') {
|
|
226
|
-
state.viewersByObject[id]?.delete(identityKey);
|
|
227
|
-
state.viewersByIdentity.get(identityKey)?.delete(id);
|
|
228
|
-
// It’s okay for these to be empty sets/maps, reduces churn.
|
|
229
|
-
}
|
|
230
|
-
});
|
|
231
|
-
}
|
|
232
|
-
}),
|
|
233
|
-
);
|
|
234
|
-
});
|
|
235
|
-
}).unsubscribe,
|
|
236
|
-
);
|
|
237
|
-
|
|
238
|
-
// Enable edge replication for all spaces.
|
|
239
|
-
try {
|
|
240
|
-
await Promise.all(
|
|
241
|
-
client.spaces.get().map((space) => space.internal.setEdgeReplicationPreference(EdgeReplicationSetting.ENABLED)),
|
|
242
|
-
);
|
|
243
|
-
state.enabledEdgeReplication = true;
|
|
244
|
-
} catch (err) {
|
|
245
|
-
log.catch(err);
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
return contributes(Capabilities.Null, null, () => {
|
|
249
|
-
spaceSubscriptions.clear();
|
|
250
|
-
subscriptions.clear();
|
|
251
|
-
});
|
|
252
|
-
};
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { effect } from '@preact/signals-core';
|
|
6
|
-
|
|
7
|
-
import { Capabilities, type PluginContext, contributes } from '@dxos/app-framework';
|
|
8
|
-
import { PublicKey } from '@dxos/keys';
|
|
9
|
-
import { LocalStorageStore } from '@dxos/local-storage';
|
|
10
|
-
import { ComplexMap } from '@dxos/util';
|
|
11
|
-
|
|
12
|
-
import { meta } from '../meta';
|
|
13
|
-
import { type PluginState } from '../types';
|
|
14
|
-
|
|
15
|
-
import { SpaceCapabilities } from './capabilities';
|
|
16
|
-
|
|
17
|
-
export default (context: PluginContext) => {
|
|
18
|
-
const state = new LocalStorageStore<PluginState>(meta.id, {
|
|
19
|
-
awaiting: undefined,
|
|
20
|
-
spaceNames: {},
|
|
21
|
-
viewersByObject: {},
|
|
22
|
-
// TODO(wittjosiah): Stop using (Complex)Map inside reactive object.
|
|
23
|
-
viewersByIdentity: new ComplexMap(PublicKey.hash),
|
|
24
|
-
sdkMigrationRunning: {},
|
|
25
|
-
navigableCollections: false,
|
|
26
|
-
enabledEdgeReplication: false,
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
state
|
|
30
|
-
.prop({ key: 'spaceNames', type: LocalStorageStore.json<Record<string, string>>() })
|
|
31
|
-
.prop({ key: 'enabledEdgeReplication', type: LocalStorageStore.bool() });
|
|
32
|
-
|
|
33
|
-
const manager = context.getCapability(Capabilities.PluginManager);
|
|
34
|
-
const unsubscribe = effect(() => {
|
|
35
|
-
// TODO(wittjosiah): Find a way to make this capability-based.
|
|
36
|
-
const enabled = manager.enabled.includes('dxos.org/plugin/stack');
|
|
37
|
-
if (enabled !== state.values.navigableCollections) {
|
|
38
|
-
state.values.navigableCollections = enabled;
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
return contributes(SpaceCapabilities.State, state.values, () => {
|
|
43
|
-
unsubscribe();
|
|
44
|
-
state.close();
|
|
45
|
-
});
|
|
46
|
-
};
|