@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
|
@@ -2,31 +2,22 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import * as Function from 'effect/Function';
|
|
6
5
|
import * as Schema from 'effect/Schema';
|
|
7
|
-
import React, { type ChangeEvent,
|
|
6
|
+
import React, { type ChangeEvent, useCallback, useMemo, useState } from 'react';
|
|
8
7
|
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
8
|
+
import { useCapabilities, useOperationInvoker } from '@dxos/app-framework/ui';
|
|
9
|
+
import { LayoutOperation } from '@dxos/app-toolkit';
|
|
10
|
+
import { Obj } from '@dxos/echo';
|
|
11
11
|
import { log } from '@dxos/log';
|
|
12
12
|
import { EdgeReplicationSetting } from '@dxos/protocols/proto/dxos/echo/metadata';
|
|
13
13
|
import { useClient } from '@dxos/react-client';
|
|
14
14
|
import { type Space, SpaceState } from '@dxos/react-client/echo';
|
|
15
15
|
import { Button, Input, useFileDownload, useMulticastObservable, useTranslation } from '@dxos/react-ui';
|
|
16
|
-
import {
|
|
17
|
-
ControlItem,
|
|
18
|
-
ControlItemInput,
|
|
19
|
-
ControlPage,
|
|
20
|
-
ControlSection,
|
|
21
|
-
Form,
|
|
22
|
-
type FormFieldMap,
|
|
23
|
-
} from '@dxos/react-ui-form';
|
|
16
|
+
import { Form, type FormFieldMap, Settings } from '@dxos/react-ui-form';
|
|
24
17
|
import { HuePicker, IconPicker } from '@dxos/react-ui-pickers';
|
|
25
|
-
import { StackItem } from '@dxos/react-ui-stack';
|
|
26
18
|
|
|
27
|
-
import { SpaceCapabilities } from '../../capabilities';
|
|
28
19
|
import { meta } from '../../meta';
|
|
29
|
-
import {
|
|
20
|
+
import { SpaceCapabilities, SpaceForm, SpaceOperation } from '../../types';
|
|
30
21
|
|
|
31
22
|
const SpaceFormSchema = SpaceForm.pipe(
|
|
32
23
|
Schema.extend(
|
|
@@ -41,179 +32,171 @@ export type SpaceSettingsContainerProps = {
|
|
|
41
32
|
};
|
|
42
33
|
|
|
43
34
|
// TODO(wittjosiah): Handle space migrations here?
|
|
44
|
-
export const SpaceSettingsContainer =
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
.catch(
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
);
|
|
35
|
+
export const SpaceSettingsContainer = ({ space }: SpaceSettingsContainerProps) => {
|
|
36
|
+
const { t } = useTranslation(meta.id);
|
|
37
|
+
const { invokePromise } = useOperationInvoker();
|
|
38
|
+
const client = useClient();
|
|
39
|
+
const archived = useMulticastObservable(space.state) === SpaceState.SPACE_INACTIVE;
|
|
40
|
+
const [edgeReplication, setEdgeReplication] = useState(
|
|
41
|
+
space.internal.data.edgeReplication === EdgeReplicationSetting.ENABLED,
|
|
42
|
+
);
|
|
43
|
+
const toggleEdgeReplication = useCallback(
|
|
44
|
+
async (next: boolean) => {
|
|
45
|
+
setEdgeReplication(next);
|
|
46
|
+
await space?.internal
|
|
47
|
+
.setEdgeReplicationPreference(next ? EdgeReplicationSetting.ENABLED : EdgeReplicationSetting.DISABLED)
|
|
48
|
+
.catch((err: unknown) => {
|
|
49
|
+
log.catch(err);
|
|
50
|
+
setEdgeReplication(!next);
|
|
51
|
+
});
|
|
52
|
+
},
|
|
53
|
+
[space],
|
|
54
|
+
);
|
|
65
55
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
if (properties.icon !== space.properties.icon) {
|
|
73
|
-
space.properties.icon = properties.icon;
|
|
74
|
-
}
|
|
75
|
-
if (properties.hue !== space.properties.hue) {
|
|
76
|
-
space.properties.hue = properties.hue;
|
|
77
|
-
}
|
|
78
|
-
if (properties.archived && !archived) {
|
|
79
|
-
void dispatch(
|
|
80
|
-
Function.pipe(
|
|
81
|
-
createIntent(SpaceAction.Close, { space }),
|
|
82
|
-
chain(LayoutAction.SwitchWorkspace, {
|
|
83
|
-
part: 'workspace',
|
|
84
|
-
subject: client.spaces.default.id,
|
|
85
|
-
}),
|
|
86
|
-
),
|
|
87
|
-
);
|
|
88
|
-
} else if (!properties.archived && archived) {
|
|
89
|
-
void dispatch(createIntent(SpaceAction.Open, { space }));
|
|
90
|
-
}
|
|
91
|
-
},
|
|
92
|
-
[space, toggleEdgeReplication, archived],
|
|
93
|
-
);
|
|
56
|
+
const handleValuesChanged = useCallback(
|
|
57
|
+
(newValues: Partial<Schema.Schema.Type<typeof SpaceFormSchema>>, meta: { changed?: Record<string, boolean> }) => {
|
|
58
|
+
const changed = meta.changed ?? {};
|
|
59
|
+
if (changed['edgeReplication']) {
|
|
60
|
+
void toggleEdgeReplication(newValues.edgeReplication ?? false);
|
|
61
|
+
}
|
|
94
62
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
63
|
+
if (changed['name'] || changed['icon'] || changed['hue']) {
|
|
64
|
+
Obj.change(space.properties, (p) => {
|
|
65
|
+
if (changed['name'] && newValues.name !== undefined) {
|
|
66
|
+
p.name = newValues.name;
|
|
67
|
+
}
|
|
68
|
+
if (changed['icon']) {
|
|
69
|
+
p.icon = newValues.icon;
|
|
70
|
+
}
|
|
71
|
+
if (changed['hue']) {
|
|
72
|
+
p.hue = newValues.hue;
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
}
|
|
105
76
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
classNames='min-is-64'
|
|
120
|
-
/>
|
|
121
|
-
</ControlItemInput>
|
|
122
|
-
);
|
|
123
|
-
},
|
|
124
|
-
icon: ({ type, label, getValue, onValueChange }) => {
|
|
125
|
-
const handleChange = useCallback((icon: string) => onValueChange(type, icon), [onValueChange, type]);
|
|
126
|
-
const handleReset = useCallback(() => onValueChange(type, undefined), [onValueChange, type]);
|
|
127
|
-
return (
|
|
128
|
-
<ControlItem title={label} description={t('icon description')}>
|
|
129
|
-
<IconPicker
|
|
130
|
-
value={getValue()}
|
|
131
|
-
onChange={handleChange}
|
|
132
|
-
onReset={handleReset}
|
|
133
|
-
classNames='justify-self-end'
|
|
134
|
-
/>
|
|
135
|
-
</ControlItem>
|
|
136
|
-
);
|
|
137
|
-
},
|
|
138
|
-
hue: ({ type, label, getValue, onValueChange }) => {
|
|
139
|
-
const handleChange = useCallback((nextHue: string) => onValueChange(type, nextHue), [onValueChange, type]);
|
|
140
|
-
const handleReset = useCallback(() => onValueChange(type, undefined), [onValueChange, type]);
|
|
141
|
-
return (
|
|
142
|
-
<ControlItem title={label} description={t('hue description')}>
|
|
143
|
-
<HuePicker
|
|
144
|
-
value={getValue()}
|
|
145
|
-
onChange={handleChange}
|
|
146
|
-
onReset={handleReset}
|
|
147
|
-
classNames='justify-self-end'
|
|
148
|
-
/>
|
|
149
|
-
</ControlItem>
|
|
150
|
-
);
|
|
151
|
-
},
|
|
152
|
-
edgeReplication: ({ type, label, getValue, onValueChange }) => {
|
|
153
|
-
const handleChange = useCallback((checked: boolean) => onValueChange(type, checked), [onValueChange, type]);
|
|
154
|
-
return (
|
|
155
|
-
<ControlItemInput title={label} description={t('edge replication description')}>
|
|
156
|
-
<Input.Switch checked={getValue()} onCheckedChange={handleChange} classNames='justify-self-end' />
|
|
157
|
-
</ControlItemInput>
|
|
158
|
-
);
|
|
159
|
-
},
|
|
160
|
-
archived: ({ type, label, getValue, onValueChange }) => {
|
|
161
|
-
const handleChange = useCallback(() => onValueChange(type, !getValue()), [onValueChange, type, getValue]);
|
|
162
|
-
return (
|
|
163
|
-
<ControlItemInput title={label} description={t('archive space description')}>
|
|
164
|
-
<Button
|
|
165
|
-
disabled={space === client.spaces.default}
|
|
166
|
-
variant={getValue() ? 'default' : 'destructive'}
|
|
167
|
-
onClick={handleChange}
|
|
168
|
-
>
|
|
169
|
-
{getValue() ? t('unarchive space label') : t('archive space label')}
|
|
170
|
-
</Button>
|
|
171
|
-
</ControlItemInput>
|
|
172
|
-
);
|
|
173
|
-
},
|
|
174
|
-
}),
|
|
175
|
-
[t, space],
|
|
176
|
-
);
|
|
77
|
+
if (changed['archived']) {
|
|
78
|
+
if (newValues.archived && !archived) {
|
|
79
|
+
void invokePromise(SpaceOperation.Close, { space });
|
|
80
|
+
void invokePromise(LayoutOperation.SwitchWorkspace, {
|
|
81
|
+
subject: client.spaces.default.id,
|
|
82
|
+
});
|
|
83
|
+
} else if (!newValues.archived && archived) {
|
|
84
|
+
void invokePromise(SpaceOperation.Open, { space });
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
[space, client, archived, invokePromise, toggleEdgeReplication],
|
|
89
|
+
);
|
|
177
90
|
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
91
|
+
const values = useMemo(
|
|
92
|
+
() => ({
|
|
93
|
+
name: space.properties.name,
|
|
94
|
+
icon: space.properties.icon,
|
|
95
|
+
hue: space.properties.hue,
|
|
96
|
+
edgeReplication,
|
|
97
|
+
archived,
|
|
98
|
+
}),
|
|
99
|
+
[space.properties.name, space.properties.icon, space.properties.hue, edgeReplication, archived],
|
|
100
|
+
);
|
|
183
101
|
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
102
|
+
const fieldMap = useMemo<FormFieldMap>(
|
|
103
|
+
() => ({
|
|
104
|
+
name: ({ type, label, getValue, onValueChange }) => {
|
|
105
|
+
const handleChange = useCallback(
|
|
106
|
+
({ target: { value } }: ChangeEvent<HTMLInputElement>) => onValueChange(type, value),
|
|
107
|
+
[onValueChange, type],
|
|
108
|
+
);
|
|
109
|
+
return (
|
|
110
|
+
<Settings.ItemInput title={label} description={t('display name description')}>
|
|
111
|
+
<Input.TextInput
|
|
112
|
+
value={getValue()}
|
|
113
|
+
onChange={handleChange}
|
|
114
|
+
placeholder={t('display name input placeholder')}
|
|
115
|
+
classNames='min-is-64'
|
|
116
|
+
/>
|
|
117
|
+
</Settings.ItemInput>
|
|
118
|
+
);
|
|
119
|
+
},
|
|
120
|
+
icon: ({ type, label, getValue, onValueChange }) => {
|
|
121
|
+
const handleChange = useCallback((icon: string) => onValueChange(type, icon), [onValueChange, type]);
|
|
122
|
+
const handleReset = useCallback(() => onValueChange(type, undefined), [onValueChange, type]);
|
|
123
|
+
return (
|
|
124
|
+
<Settings.Item title={label} description={t('icon description')}>
|
|
125
|
+
<IconPicker
|
|
126
|
+
value={getValue()}
|
|
127
|
+
onChange={handleChange}
|
|
128
|
+
onReset={handleReset}
|
|
129
|
+
classNames='justify-self-end'
|
|
130
|
+
/>
|
|
131
|
+
</Settings.Item>
|
|
132
|
+
);
|
|
133
|
+
},
|
|
134
|
+
hue: ({ type, label, getValue, onValueChange }) => {
|
|
135
|
+
const handleChange = useCallback((nextHue: string) => onValueChange(type, nextHue), [onValueChange, type]);
|
|
136
|
+
const handleReset = useCallback(() => onValueChange(type, undefined), [onValueChange, type]);
|
|
137
|
+
return (
|
|
138
|
+
<Settings.Item title={label} description={t('hue description')}>
|
|
139
|
+
<HuePicker value={getValue()} onChange={handleChange} onReset={handleReset} classNames='justify-self-end' />
|
|
140
|
+
</Settings.Item>
|
|
141
|
+
);
|
|
142
|
+
},
|
|
143
|
+
edgeReplication: ({ type, label, getValue, onValueChange }) => {
|
|
144
|
+
const handleChange = useCallback((checked: boolean) => onValueChange(type, checked), [onValueChange, type]);
|
|
145
|
+
return (
|
|
146
|
+
<Settings.ItemInput title={label} description={t('edge replication description')}>
|
|
147
|
+
<Input.Switch checked={getValue()} onCheckedChange={handleChange} classNames='justify-self-end' />
|
|
148
|
+
</Settings.ItemInput>
|
|
149
|
+
);
|
|
150
|
+
},
|
|
151
|
+
archived: ({ type, label, getValue, onValueChange }) => {
|
|
152
|
+
const handleChange = useCallback(() => onValueChange(type, !getValue()), [onValueChange, type, getValue]);
|
|
153
|
+
return (
|
|
154
|
+
<Settings.ItemInput title={label} description={t('archive space description')}>
|
|
155
|
+
<Button
|
|
156
|
+
disabled={space === client.spaces.default}
|
|
157
|
+
variant={getValue() ? 'default' : 'destructive'}
|
|
158
|
+
onClick={handleChange}
|
|
159
|
+
>
|
|
160
|
+
{getValue() ? t('unarchive space label') : t('archive space label')}
|
|
161
|
+
</Button>
|
|
162
|
+
</Settings.ItemInput>
|
|
163
|
+
);
|
|
164
|
+
},
|
|
165
|
+
}),
|
|
166
|
+
[t, space, client],
|
|
167
|
+
);
|
|
188
168
|
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
description={t('space properties settings description', {
|
|
195
|
-
ns: meta.id,
|
|
196
|
-
})}
|
|
197
|
-
>
|
|
198
|
-
<Form.Root fieldMap={fieldMap} schema={SpaceFormSchema} values={values} autoSave onSave={handleSave}>
|
|
199
|
-
<Form.FieldSet />
|
|
200
|
-
</Form.Root>
|
|
201
|
-
</ControlSection>
|
|
169
|
+
const download = useFileDownload();
|
|
170
|
+
const handleBackup = useCallback(async () => {
|
|
171
|
+
const archive = await space.internal.export();
|
|
172
|
+
download(new Blob([archive.contents as Uint8Array<ArrayBuffer>]), archive.filename);
|
|
173
|
+
}, [space, download]);
|
|
202
174
|
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
175
|
+
const repairs = useCapabilities(SpaceCapabilities.Repair);
|
|
176
|
+
const handleRepair = useCallback(async () => {
|
|
177
|
+
await Promise.all(repairs.map((repair) => repair({ space, isDefault: client.spaces.default === space })));
|
|
178
|
+
}, [client, space, repairs]);
|
|
179
|
+
|
|
180
|
+
return (
|
|
181
|
+
<Settings.Root>
|
|
182
|
+
<Settings.Section
|
|
183
|
+
title={t('space properties settings verbose label')}
|
|
184
|
+
description={t('space properties settings description', { ns: meta.id })}
|
|
185
|
+
>
|
|
186
|
+
<Form.Root fieldMap={fieldMap} schema={SpaceFormSchema} values={values} onValuesChanged={handleValuesChanged}>
|
|
187
|
+
<Form.FieldSet classNames='space-y-trimMd' />
|
|
188
|
+
</Form.Root>
|
|
189
|
+
</Settings.Section>
|
|
190
|
+
<Settings.Section title={t('space controls title')} description={t('space controls description')}>
|
|
191
|
+
<Settings.ItemInput title={t('backup space title')} description={t('backup space description')}>
|
|
192
|
+
<Button onClick={handleBackup}>{t('download backup label')}</Button>
|
|
193
|
+
</Settings.ItemInput>
|
|
194
|
+
<Settings.ItemInput title={t('repair space title')} description={t('repair space description')}>
|
|
195
|
+
<Button onClick={handleRepair}>{t('repair space label')}</Button>
|
|
196
|
+
</Settings.ItemInput>
|
|
197
|
+
</Settings.Section>
|
|
198
|
+
</Settings.Root>
|
|
199
|
+
);
|
|
200
|
+
};
|
|
218
201
|
|
|
219
202
|
SpaceSettingsContainer.displayName = 'SpaceSettingsContainer';
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import * as Option from 'effect/Option';
|
|
6
6
|
import React, { useEffect, useState } from 'react';
|
|
7
7
|
|
|
8
|
-
import { useAppGraph } from '@dxos/app-
|
|
8
|
+
import { useAppGraph } from '@dxos/app-toolkit/ui';
|
|
9
9
|
import { EdgeStatus } from '@dxos/protocols/proto/dxos/client/services';
|
|
10
10
|
import { EdgeReplicationSetting } from '@dxos/protocols/proto/dxos/echo/metadata';
|
|
11
11
|
import { useClient } from '@dxos/react-client';
|
|
@@ -14,7 +14,7 @@ import { SyncStatusIndicator } from './SyncStatus';
|
|
|
14
14
|
const meta = {
|
|
15
15
|
title: 'plugins/plugin-space/SyncStatusIndicator',
|
|
16
16
|
component: SyncStatusIndicator,
|
|
17
|
-
decorators: [withTheme, withClientProvider({ createIdentity: true })],
|
|
17
|
+
decorators: [withTheme(), withClientProvider({ createIdentity: true })],
|
|
18
18
|
parameters: {
|
|
19
19
|
layout: 'centered',
|
|
20
20
|
translations,
|
|
@@ -11,7 +11,7 @@ import { useClient } from '@dxos/react-client';
|
|
|
11
11
|
import { useStream } from '@dxos/react-client/devtools';
|
|
12
12
|
import { type SpaceSyncStateMap, getSyncSummary, useSyncState } from '@dxos/react-client/echo';
|
|
13
13
|
import { Icon, Popover, useTranslation } from '@dxos/react-ui';
|
|
14
|
-
import { mx } from '@dxos/
|
|
14
|
+
import { mx } from '@dxos/ui-theme';
|
|
15
15
|
import { Unit, type UnitFormat } from '@dxos/util';
|
|
16
16
|
|
|
17
17
|
import { meta } from '../../meta';
|
|
@@ -46,10 +46,10 @@ const createSpaceSaveTracker = (space: Space, cb: (state: 'saved' | 'saving') =>
|
|
|
46
46
|
|
|
47
47
|
let hasUnsavedChanges = false;
|
|
48
48
|
let lastFlushPromise: Promise<void> | undefined;
|
|
49
|
-
space.db.saveStateChanged.on(ctx, ({ unsavedDocuments }) => {
|
|
49
|
+
space.internal.db.saveStateChanged.on(ctx, ({ unsavedDocuments }) => {
|
|
50
50
|
hasUnsavedChanges = unsavedDocuments.length > 0;
|
|
51
51
|
});
|
|
52
|
-
space.db.saveStateChanged.debounce(500).on(ctx, () => {
|
|
52
|
+
space.internal.db.saveStateChanged.debounce(500).on(ctx, () => {
|
|
53
53
|
if (hasUnsavedChanges) {
|
|
54
54
|
lastFlushPromise = undefined;
|
|
55
55
|
cb('saving');
|
|
@@ -5,27 +5,27 @@
|
|
|
5
5
|
import * as Schema from 'effect/Schema';
|
|
6
6
|
import React, { useCallback, useState } from 'react';
|
|
7
7
|
|
|
8
|
-
import {
|
|
9
|
-
import { useIntentDispatcher } from '@dxos/app-framework/react';
|
|
8
|
+
import { useOperationInvoker } from '@dxos/app-framework/ui';
|
|
10
9
|
import { DXN, Filter, Obj, Query, type QueryAST, Tag, Type } from '@dxos/echo';
|
|
10
|
+
import { type Mutable } from '@dxos/echo/internal';
|
|
11
11
|
import { useClient } from '@dxos/react-client';
|
|
12
12
|
import { getSpace, useQuery } from '@dxos/react-client/echo';
|
|
13
13
|
import { useAsyncEffect } from '@dxos/react-ui';
|
|
14
14
|
import { ViewEditor as NaturalViewEditor } from '@dxos/react-ui-form';
|
|
15
15
|
import { View } from '@dxos/schema';
|
|
16
16
|
|
|
17
|
-
import {
|
|
17
|
+
import { resolveSchemaWithRegistry } from '../helpers';
|
|
18
18
|
import { useTypeOptions } from '../hooks';
|
|
19
|
-
import {
|
|
19
|
+
import { SpaceOperation } from '../types';
|
|
20
20
|
|
|
21
21
|
export type ViewEditorProps = { view: View.View };
|
|
22
22
|
|
|
23
23
|
export const ViewEditor = ({ view }: ViewEditorProps) => {
|
|
24
|
-
const {
|
|
24
|
+
const { invokePromise } = useOperationInvoker();
|
|
25
25
|
const client = useClient();
|
|
26
26
|
const space = getSpace(view);
|
|
27
27
|
const [schema, setSchema] = useState<Schema.Schema.AnyNoContext>(() => Schema.Struct({}));
|
|
28
|
-
const tags = useQuery(space, Filter.type(Tag.Tag));
|
|
28
|
+
const tags = useQuery(space?.db, Filter.type(Tag.Tag));
|
|
29
29
|
const types = useTypeOptions({
|
|
30
30
|
space,
|
|
31
31
|
annotation: {
|
|
@@ -40,7 +40,7 @@ export const ViewEditor = ({ view }: ViewEditorProps) => {
|
|
|
40
40
|
return;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
const foundSchema = await
|
|
43
|
+
const foundSchema = await resolveSchemaWithRegistry(space.db.schemaRegistry, view.query.ast);
|
|
44
44
|
if (foundSchema && foundSchema !== schema) {
|
|
45
45
|
setSchema(() => foundSchema);
|
|
46
46
|
}
|
|
@@ -54,8 +54,10 @@ export const ViewEditor = ({ view }: ViewEditorProps) => {
|
|
|
54
54
|
|
|
55
55
|
const queue = target && DXN.tryParse(target) ? target : undefined;
|
|
56
56
|
const query = queue ? Query.fromAst(newQuery).options({ queues: [queue] }) : Query.fromAst(newQuery);
|
|
57
|
-
view
|
|
58
|
-
|
|
57
|
+
Obj.change(view, (v) => {
|
|
58
|
+
v.query.ast = query.ast as Mutable<typeof query.ast>;
|
|
59
|
+
});
|
|
60
|
+
const newSchema = await resolveSchemaWithRegistry(space.db.schemaRegistry, query.ast);
|
|
59
61
|
if (!newSchema) {
|
|
60
62
|
return;
|
|
61
63
|
}
|
|
@@ -64,7 +66,9 @@ export const ViewEditor = ({ view }: ViewEditorProps) => {
|
|
|
64
66
|
query,
|
|
65
67
|
jsonSchema: Type.toJsonSchema(newSchema),
|
|
66
68
|
});
|
|
67
|
-
|
|
69
|
+
Obj.change(view, (v) => {
|
|
70
|
+
v.projection = Obj.getSnapshot(newView).projection as Mutable<typeof v.projection>;
|
|
71
|
+
});
|
|
68
72
|
|
|
69
73
|
setSchema(() => newSchema);
|
|
70
74
|
},
|
|
@@ -73,9 +77,9 @@ export const ViewEditor = ({ view }: ViewEditorProps) => {
|
|
|
73
77
|
|
|
74
78
|
const handleDelete = useCallback(
|
|
75
79
|
(fieldId: string) => {
|
|
76
|
-
void
|
|
80
|
+
void invokePromise(SpaceOperation.DeleteField, { view, fieldId });
|
|
77
81
|
},
|
|
78
|
-
[
|
|
82
|
+
[invokePromise, view],
|
|
79
83
|
);
|
|
80
84
|
|
|
81
85
|
if (!space || !schema) {
|
package/src/constants.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { meta } from './meta';
|
|
6
|
+
|
|
7
|
+
export const CREATE_OBJECT_DIALOG = `${meta.id}/CreateObjectDialog`;
|
|
8
|
+
export const CREATE_SPACE_DIALOG = `${meta.id}/CreateSpaceDialog`;
|
|
9
|
+
export const JOIN_DIALOG = `${meta.id}/JoinDialog`;
|
|
10
|
+
export const OBJECT_RENAME_POPOVER = `${meta.id}/ObjectRenamePopover`;
|
|
11
|
+
export const SPACE_RENAME_POPOVER = `${meta.id}/SpaceRenamePopover`;
|
package/src/helpers/query.ts
CHANGED
|
@@ -10,13 +10,14 @@ import * as Option from 'effect/Option';
|
|
|
10
10
|
import type * as Schema from 'effect/Schema';
|
|
11
11
|
import * as SchemaAST from 'effect/SchemaAST';
|
|
12
12
|
|
|
13
|
-
import { DXN, Filter, Query, type QueryAST } from '@dxos/echo';
|
|
13
|
+
import { DXN, Filter, Query, type QueryAST, type SchemaRegistry } from '@dxos/echo';
|
|
14
14
|
import {
|
|
15
15
|
ReferenceAnnotationId,
|
|
16
16
|
type ReferenceAnnotationValue,
|
|
17
17
|
getTypeAnnotation,
|
|
18
18
|
unwrapOptional,
|
|
19
19
|
} from '@dxos/echo/internal';
|
|
20
|
+
import { runAndForwardErrors } from '@dxos/effect';
|
|
20
21
|
import { log } from '@dxos/log';
|
|
21
22
|
import { type Space } from '@dxos/react-client/echo';
|
|
22
23
|
import { Person } from '@dxos/types';
|
|
@@ -34,21 +35,21 @@ export const evalQuery = (queryString: string): Query.Any => {
|
|
|
34
35
|
}
|
|
35
36
|
};
|
|
36
37
|
|
|
37
|
-
export const
|
|
38
|
+
export const resolveSchemaWithRegistry = (registry: SchemaRegistry.SchemaRegistry, query: QueryAST.Query) => {
|
|
38
39
|
const resolve = Effect.fn(function* (dxn: string) {
|
|
39
40
|
const typename = DXN.parse(dxn).asTypeDXN()?.type;
|
|
40
41
|
if (!typename) {
|
|
41
42
|
return Option.none();
|
|
42
43
|
}
|
|
43
44
|
|
|
44
|
-
const query =
|
|
45
|
+
const query = registry.query({ typename, location: ['database', 'runtime'] });
|
|
45
46
|
const schemas = yield* Effect.promise(() => query.run());
|
|
46
47
|
return Array.head(schemas);
|
|
47
48
|
});
|
|
48
49
|
|
|
49
50
|
return resolveSchema(query, resolve).pipe(
|
|
50
51
|
Effect.map((schema) => Option.getOrUndefined(schema)),
|
|
51
|
-
|
|
52
|
+
runAndForwardErrors,
|
|
52
53
|
);
|
|
53
54
|
};
|
|
54
55
|
|
|
@@ -144,9 +145,9 @@ export const getQueryTarget = (query: QueryAST.Query, space?: Space) => {
|
|
|
144
145
|
Option.flatMap((queues) => Array.head(queues)),
|
|
145
146
|
Option.flatMap((queueDxn) => Option.fromNullable(DXN.tryParse(queueDxn))),
|
|
146
147
|
Option.flatMap((queueDxn) => Option.fromNullable(space?.queues.get(queueDxn))),
|
|
147
|
-
Option.getOrElse(() => space),
|
|
148
|
+
Option.getOrElse(() => space?.db),
|
|
148
149
|
);
|
|
149
150
|
}),
|
|
150
|
-
Match.orElse(() => space),
|
|
151
|
+
Match.orElse(() => space?.db),
|
|
151
152
|
);
|
|
152
153
|
};
|
|
@@ -2,14 +2,17 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { Capabilities, type
|
|
6
|
-
import {
|
|
5
|
+
import { Capabilities, type CapabilityManager } from '@dxos/app-framework';
|
|
6
|
+
import { AppCapabilities } from '@dxos/app-toolkit';
|
|
7
|
+
import { useLayout } from '@dxos/app-toolkit/ui';
|
|
7
8
|
import { ClientCapabilities } from '@dxos/plugin-client';
|
|
8
9
|
import { parseId, useSpace } from '@dxos/react-client/echo';
|
|
9
10
|
|
|
10
|
-
export const getActiveSpace = (
|
|
11
|
-
const client =
|
|
12
|
-
const
|
|
11
|
+
export const getActiveSpace = (capabilities: CapabilityManager.CapabilityManager) => {
|
|
12
|
+
const client = capabilities.get(ClientCapabilities.Client);
|
|
13
|
+
const registry = capabilities.get(Capabilities.AtomRegistry);
|
|
14
|
+
const layoutAtom = capabilities.get(AppCapabilities.Layout);
|
|
15
|
+
const layout = registry.get(layoutAtom);
|
|
13
16
|
const { spaceId } = parseId(layout.workspace);
|
|
14
17
|
return spaceId ? client.spaces.get(spaceId) : undefined;
|
|
15
18
|
};
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { useCallback } from 'react';
|
|
6
6
|
|
|
7
|
-
import { Surface,
|
|
7
|
+
import { Surface, usePluginManager } from '@dxos/app-framework/ui';
|
|
8
8
|
import { type FormFieldProvider } from '@dxos/react-ui-form';
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -18,8 +18,8 @@ export const useInputSurfaceLookup = (baseData?: Record<string, any>): FormField
|
|
|
18
18
|
return useCallback<FormFieldProvider>(
|
|
19
19
|
({ schema, prop, fieldProps }) => {
|
|
20
20
|
const data = { prop, schema, ...baseData };
|
|
21
|
-
if (
|
|
22
|
-
return <Surface role='form-input' data={data} {...fieldProps} />;
|
|
21
|
+
if (Surface.isAvailable(pluginManager.capabilities, { role: 'form-input', data })) {
|
|
22
|
+
return <Surface.Surface role='form-input' data={data} {...fieldProps} />;
|
|
23
23
|
}
|
|
24
24
|
},
|
|
25
25
|
[pluginManager, baseData],
|
package/src/hooks/usePath.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import * as Option from 'effect/Option';
|
|
6
6
|
import { useEffect, useState } from 'react';
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import { Graph } from '@dxos/plugin-graph';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* React hook to get a path from the graph.
|
|
@@ -16,9 +16,9 @@ import { type ReadableGraph } from '@dxos/plugin-graph';
|
|
|
16
16
|
* @returns Path if found, undefined otherwise.
|
|
17
17
|
*/
|
|
18
18
|
// TODO(wittjosiah): Factor out.
|
|
19
|
-
export const usePath = (graph: ReadableGraph, id?: string, timeout?: number): Option.Option<string[]> => {
|
|
19
|
+
export const usePath = (graph: Graph.ReadableGraph, id?: string, timeout?: number): Option.Option<string[]> => {
|
|
20
20
|
const [pathState, setPathState] = useState<Option.Option<string[]>>(
|
|
21
|
-
id ?
|
|
21
|
+
id ? Graph.getPath(graph, { target: id }) : Option.none(),
|
|
22
22
|
);
|
|
23
23
|
|
|
24
24
|
useEffect(() => {
|
|
@@ -33,7 +33,7 @@ export const usePath = (graph: ReadableGraph, id?: string, timeout?: number): Op
|
|
|
33
33
|
// Set timeout did not seem to effectively not block the UI thread.
|
|
34
34
|
const frame = requestAnimationFrame(async () => {
|
|
35
35
|
try {
|
|
36
|
-
const path = await
|
|
36
|
+
const path = await Graph.waitForPath(graph, { target: id }, { timeout });
|
|
37
37
|
if (path) {
|
|
38
38
|
setPathState(Option.some(path));
|
|
39
39
|
}
|
package/src/index.ts
CHANGED