@dxos/plugin-space 0.8.3 → 0.8.4-main.1068cf700f
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-4ZKSFDXM.mjs → chunk-7D63MVRS.mjs} +110 -41
- package/dist/lib/browser/chunk-7D63MVRS.mjs.map +7 -0
- package/dist/lib/browser/chunk-A7ZCVQGZ.mjs +118 -0
- 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-HSMQFM57.mjs +16 -0
- 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-WAOJLA2S.mjs +772 -0
- 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 +251 -183
- 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-DKU4TUD2.mjs +50 -0
- 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 +18 -10
- 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-JBQKU4K5.mjs → chunk-5N3YIAXD.mjs} +110 -41
- package/dist/lib/node-esm/chunk-5N3YIAXD.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-A5A7M37T.mjs +119 -0
- 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-FB5YNROS.mjs +773 -0
- 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-SL4BJSUG.mjs +18 -0
- 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 +251 -183
- 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-C2H6JQCL.mjs +51 -0
- 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 +18 -10
- 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 -21
- 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 +9 -0
- package/dist/types/src/components/CollectionArticle.d.ts.map +1 -0
- package/dist/types/src/components/CollectionSection.d.ts +3 -4
- package/dist/types/src/components/CollectionSection.d.ts.map +1 -1
- package/dist/types/src/components/CreateDialog/CreateObjectDialog.d.ts +6 -5
- package/dist/types/src/components/CreateDialog/CreateObjectDialog.d.ts.map +1 -1
- package/dist/types/src/components/CreateDialog/CreateObjectDialog.stories.d.ts +1602 -8
- package/dist/types/src/components/CreateDialog/CreateObjectDialog.stories.d.ts.map +1 -1
- package/dist/types/src/components/CreateDialog/CreateObjectPanel.d.ts +23 -10
- package/dist/types/src/components/CreateDialog/CreateObjectPanel.d.ts.map +1 -1
- package/dist/types/src/components/CreateDialog/CreateSpaceDialog.d.ts +1 -1
- package/dist/types/src/components/CreateDialog/CreateSpaceDialog.d.ts.map +1 -1
- package/dist/types/src/components/{JoinDialog.d.ts → JoinDialog/JoinDialog.d.ts} +1 -1
- package/dist/types/src/components/JoinDialog/JoinDialog.d.ts.map +1 -0
- package/dist/types/src/components/JoinDialog/index.d.ts +2 -0
- package/dist/types/src/components/JoinDialog/index.d.ts.map +1 -0
- package/dist/types/src/components/{MembersContainer.d.ts → MembersContainer/MembersContainer.d.ts} +3 -2
- package/dist/types/src/components/MembersContainer/MembersContainer.d.ts.map +1 -0
- package/dist/types/src/components/MembersContainer/MembersContainer.stories.d.ts +1600 -0
- package/dist/types/src/components/MembersContainer/MembersContainer.stories.d.ts.map +1 -0
- package/dist/types/src/components/MembersContainer/index.d.ts +2 -0
- package/dist/types/src/components/MembersContainer/index.d.ts.map +1 -0
- 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 +8 -0
- package/dist/types/src/components/ObjectCardStack/ObjectCardStack.d.ts.map +1 -0
- package/dist/types/src/components/ObjectCardStack/ObjectForm.d.ts +9 -0
- package/dist/types/src/components/ObjectCardStack/ObjectForm.d.ts.map +1 -0
- package/dist/types/src/components/ObjectCardStack/index.d.ts +3 -0
- package/dist/types/src/components/ObjectCardStack/index.d.ts.map +1 -0
- package/dist/types/src/components/{ObjectSettings → ObjectDetails}/BaseObjectSettings.d.ts +3 -3
- package/dist/types/src/components/ObjectDetails/BaseObjectSettings.d.ts.map +1 -0
- package/dist/types/src/components/ObjectDetails/BaseObjectSettings.stories.d.ts +1433 -0
- package/dist/types/src/components/ObjectDetails/BaseObjectSettings.stories.d.ts.map +1 -0
- package/dist/types/src/components/ObjectDetails/ForeignKeys.d.ts +8 -0
- package/dist/types/src/components/ObjectDetails/ForeignKeys.d.ts.map +1 -0
- package/dist/types/src/components/ObjectDetails/ObjectDetails.d.ts +9 -0
- package/dist/types/src/components/ObjectDetails/ObjectDetails.d.ts.map +1 -0
- package/dist/types/src/components/ObjectDetails/index.d.ts +3 -0
- package/dist/types/src/components/ObjectDetails/index.d.ts.map +1 -0
- package/dist/types/src/components/ObjectRenamePopover/ObjectRenamePopover.d.ts +7 -0
- package/dist/types/src/components/ObjectRenamePopover/ObjectRenamePopover.d.ts.map +1 -0
- package/dist/types/src/components/ObjectRenamePopover/index.d.ts +2 -0
- package/dist/types/src/components/ObjectRenamePopover/index.d.ts.map +1 -0
- package/dist/types/src/components/RecordArticle.d.ts +5 -0
- package/dist/types/src/components/RecordArticle.d.ts.map +1 -0
- package/dist/types/src/components/RecordArticle.stories.d.ts +1600 -0
- package/dist/types/src/components/RecordArticle.stories.d.ts.map +1 -0
- package/dist/types/src/components/SchemaContainer.d.ts +2 -2
- 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.d.ts → SpacePresence/SpacePresence.d.ts} +7 -6
- package/dist/types/src/components/SpacePresence/SpacePresence.d.ts.map +1 -0
- package/dist/types/src/components/SpacePresence/SpacePresence.stories.d.ts +1430 -0
- package/dist/types/src/components/SpacePresence/SpacePresence.stories.d.ts.map +1 -0
- package/dist/types/src/components/SpacePresence/index.d.ts +2 -0
- package/dist/types/src/components/SpacePresence/index.d.ts.map +1 -0
- package/dist/types/src/components/SpaceRenamePopover/SpaceRenamePopover.d.ts +7 -0
- package/dist/types/src/components/SpaceRenamePopover/SpaceRenamePopover.d.ts.map +1 -0
- package/dist/types/src/components/SpaceRenamePopover/index.d.ts +2 -0
- package/dist/types/src/components/SpaceRenamePopover/index.d.ts.map +1 -0
- 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 +1433 -4
- package/dist/types/src/components/SpaceSettings/SpaceSettingsContainer.stories.d.ts.map +1 -1
- package/dist/types/src/components/SyncStatus/SyncStatus.d.ts +1 -1
- package/dist/types/src/components/SyncStatus/SyncStatus.d.ts.map +1 -1
- package/dist/types/src/components/SyncStatus/SyncStatus.stories.d.ts +1431 -5
- package/dist/types/src/components/SyncStatus/SyncStatus.stories.d.ts.map +1 -1
- package/dist/types/src/components/SyncStatus/status.d.ts +5 -5
- package/dist/types/src/components/ViewEditor.d.ts +7 -0
- package/dist/types/src/components/ViewEditor.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +16 -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/index.d.ts +2 -0
- package/dist/types/src/helpers/index.d.ts.map +1 -0
- package/dist/types/src/helpers/query.d.ts +7 -0
- package/dist/types/src/helpers/query.d.ts.map +1 -0
- package/dist/types/src/helpers/query.test.d.ts +2 -0
- package/dist/types/src/helpers/query.test.d.ts.map +1 -0
- package/dist/types/src/hooks/index.d.ts +1 -0
- package/dist/types/src/hooks/index.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/useInputSurfaceLookup.d.ts +2 -8
- package/dist/types/src/hooks/useInputSurfaceLookup.d.ts.map +1 -1
- package/dist/types/src/hooks/usePath.d.ts +3 -3
- package/dist/types/src/hooks/usePath.d.ts.map +1 -1
- package/dist/types/src/hooks/useTypeOptions.d.ts +10 -0
- package/dist/types/src/hooks/useTypeOptions.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +2 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +2 -3
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +1415 -410
- 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/form.d.ts +22 -0
- package/dist/types/src/types/form.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +3 -0
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +646 -338
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/src/util.d.ts +50 -31
- package/dist/types/src/util.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +87 -64
- package/src/SpacePlugin.ts +197 -174
- 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 -15
- 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/repair.ts +67 -0
- 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 +27 -27
- package/src/components/CollectionArticle.tsx +156 -0
- package/src/components/CollectionSection.tsx +8 -6
- package/src/components/CreateDialog/CreateObjectDialog.stories.tsx +40 -33
- package/src/components/CreateDialog/CreateObjectDialog.tsx +108 -81
- package/src/components/CreateDialog/CreateObjectPanel.tsx +163 -91
- package/src/components/CreateDialog/CreateSpaceDialog.tsx +35 -29
- package/src/components/{JoinDialog.tsx → JoinDialog/JoinDialog.tsx} +29 -39
- package/src/components/JoinDialog/index.ts +5 -0
- package/src/components/MembersContainer/MembersContainer.stories.tsx +56 -0
- package/src/components/{MembersContainer.tsx → MembersContainer/MembersContainer.tsx} +95 -98
- package/src/components/MembersContainer/index.ts +5 -0
- package/src/components/MenuFooter.tsx +5 -6
- package/src/components/ObjectCardStack/ObjectCardStack.tsx +67 -0
- package/src/components/ObjectCardStack/ObjectForm.tsx +97 -0
- package/src/components/ObjectCardStack/index.ts +7 -0
- package/src/components/ObjectDetails/BaseObjectSettings.stories.tsx +63 -0
- package/src/components/ObjectDetails/BaseObjectSettings.tsx +122 -0
- package/src/components/{ObjectSettings → ObjectDetails}/ForeignKeys.tsx +8 -8
- package/src/components/ObjectDetails/ObjectDetails.tsx +33 -0
- package/src/components/ObjectDetails/index.ts +7 -0
- package/src/components/ObjectRenamePopover/ObjectRenamePopover.tsx +52 -0
- package/src/components/ObjectRenamePopover/index.ts +5 -0
- package/src/components/RecordArticle.stories.tsx +116 -0
- package/src/components/RecordArticle.tsx +124 -0
- package/src/components/SchemaContainer.tsx +31 -31
- package/src/components/SpacePluginSettings.tsx +45 -33
- package/src/components/{SpacePresence.stories.tsx → SpacePresence/SpacePresence.stories.tsx} +25 -24
- package/src/components/{SpacePresence.tsx → SpacePresence/SpacePresence.tsx} +28 -24
- package/src/components/SpacePresence/index.ts +5 -0
- package/src/components/{PopoverRenameSpace.tsx → SpaceRenamePopover/SpaceRenamePopover.tsx} +16 -16
- package/src/components/SpaceRenamePopover/index.ts +5 -0
- package/src/components/SpaceSettings/SpaceSettingsContainer.stories.tsx +20 -12
- package/src/components/SpaceSettings/SpaceSettingsContainer.tsx +99 -81
- package/src/components/SyncStatus/InlineSyncStatus.tsx +8 -8
- package/src/components/SyncStatus/SyncStatus.stories.tsx +12 -19
- package/src/components/SyncStatus/SyncStatus.tsx +110 -13
- package/src/components/SyncStatus/save-tracker.ts +3 -3
- package/src/components/SyncStatus/status.ts +4 -4
- package/src/components/ViewEditor.tsx +101 -0
- package/src/components/index.ts +11 -6
- package/src/constants.ts +11 -0
- package/src/helpers/index.ts +5 -0
- package/src/helpers/query.test.ts +24 -0
- package/src/helpers/query.ts +153 -0
- package/src/hooks/index.ts +1 -0
- package/src/hooks/useActiveSpace.ts +8 -4
- package/src/hooks/useInputSurfaceLookup.tsx +9 -13
- package/src/hooks/usePath.ts +5 -5
- package/src/hooks/useTypeOptions.ts +25 -0
- package/src/index.ts +2 -2
- package/src/meta.ts +8 -5
- package/src/translations.ts +112 -36
- package/src/types/capabilities.ts +73 -0
- package/src/types/events.ts +16 -0
- package/src/types/form.ts +69 -0
- package/src/types/index.ts +3 -0
- package/src/types/types.ts +546 -206
- package/src/util.tsx +451 -242
- package/dist/lib/browser/app-graph-builder-M2RH72VL.mjs +0 -363
- package/dist/lib/browser/app-graph-builder-M2RH72VL.mjs.map +0 -7
- package/dist/lib/browser/app-graph-serializer-F7ISRRBV.mjs +0 -80
- package/dist/lib/browser/app-graph-serializer-F7ISRRBV.mjs.map +0 -7
- package/dist/lib/browser/chunk-4ZKSFDXM.mjs.map +0 -7
- package/dist/lib/browser/chunk-7Y4M7GXO.mjs +0 -94
- package/dist/lib/browser/chunk-7Y4M7GXO.mjs.map +0 -7
- package/dist/lib/browser/chunk-BXNL6SDI.mjs +0 -19
- package/dist/lib/browser/chunk-BXNL6SDI.mjs.map +0 -7
- package/dist/lib/browser/chunk-NFUKCRGE.mjs +0 -1916
- package/dist/lib/browser/chunk-NFUKCRGE.mjs.map +0 -7
- package/dist/lib/browser/chunk-PTKYMZWO.mjs +0 -13
- package/dist/lib/browser/chunk-PTKYMZWO.mjs.map +0 -7
- package/dist/lib/browser/chunk-TW7O2EPP.mjs +0 -284
- package/dist/lib/browser/chunk-TW7O2EPP.mjs.map +0 -7
- package/dist/lib/browser/chunk-V24VASAJ.mjs +0 -546
- package/dist/lib/browser/chunk-V24VASAJ.mjs.map +0 -7
- package/dist/lib/browser/chunk-YMCZR6EZ.mjs +0 -18
- package/dist/lib/browser/chunk-YMCZR6EZ.mjs.map +0 -7
- package/dist/lib/browser/identity-created-PI7TKANR.mjs +0 -23
- package/dist/lib/browser/identity-created-PI7TKANR.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-RWU6ZE4H.mjs +0 -610
- package/dist/lib/browser/intent-resolver-RWU6ZE4H.mjs.map +0 -7
- package/dist/lib/browser/react-root-QIKHSNT2.mjs +0 -29
- package/dist/lib/browser/react-root-QIKHSNT2.mjs.map +0 -7
- package/dist/lib/browser/react-surface-W56UD53I.mjs +0 -353
- package/dist/lib/browser/react-surface-W56UD53I.mjs.map +0 -7
- package/dist/lib/browser/schema-defs-WREJNMIC.mjs +0 -26
- package/dist/lib/browser/schema-defs-WREJNMIC.mjs.map +0 -7
- package/dist/lib/browser/schema-tools-ILTVSSS3.mjs +0 -124
- package/dist/lib/browser/schema-tools-ILTVSSS3.mjs.map +0 -7
- package/dist/lib/browser/settings-K54STC5A.mjs +0 -24
- package/dist/lib/browser/settings-K54STC5A.mjs.map +0 -7
- package/dist/lib/browser/spaces-ready-3PDRDHPC.mjs +0 -199
- package/dist/lib/browser/spaces-ready-3PDRDHPC.mjs.map +0 -7
- package/dist/lib/browser/state-HRZ4VRXU.mjs +0 -47
- package/dist/lib/browser/state-HRZ4VRXU.mjs.map +0 -7
- package/dist/lib/node/app-graph-builder-6LK5HLLE.cjs +0 -364
- package/dist/lib/node/app-graph-builder-6LK5HLLE.cjs.map +0 -7
- package/dist/lib/node/app-graph-serializer-HKHBNHA3.cjs +0 -89
- package/dist/lib/node/app-graph-serializer-HKHBNHA3.cjs.map +0 -7
- package/dist/lib/node/chunk-3X4EA4XL.cjs +0 -37
- package/dist/lib/node/chunk-3X4EA4XL.cjs.map +0 -7
- package/dist/lib/node/chunk-5WLAXYE3.cjs +0 -125
- package/dist/lib/node/chunk-5WLAXYE3.cjs.map +0 -7
- package/dist/lib/node/chunk-6P2DB4QQ.cjs +0 -36
- package/dist/lib/node/chunk-6P2DB4QQ.cjs.map +0 -7
- package/dist/lib/node/chunk-DOC5XEZ4.cjs +0 -184
- package/dist/lib/node/chunk-DOC5XEZ4.cjs.map +0 -7
- package/dist/lib/node/chunk-NCHF433F.cjs +0 -1921
- package/dist/lib/node/chunk-NCHF433F.cjs.map +0 -7
- package/dist/lib/node/chunk-NL5Y4EDX.cjs +0 -38
- package/dist/lib/node/chunk-NL5Y4EDX.cjs.map +0 -7
- package/dist/lib/node/chunk-ULJZPATP.cjs +0 -312
- package/dist/lib/node/chunk-ULJZPATP.cjs.map +0 -7
- package/dist/lib/node/chunk-XHWVT7LW.cjs +0 -572
- package/dist/lib/node/chunk-XHWVT7LW.cjs.map +0 -7
- package/dist/lib/node/identity-created-FF4WZ2WY.cjs +0 -42
- package/dist/lib/node/identity-created-FF4WZ2WY.cjs.map +0 -7
- package/dist/lib/node/index.cjs +0 -278
- package/dist/lib/node/index.cjs.map +0 -7
- package/dist/lib/node/intent-resolver-AV4CMM3Z.cjs +0 -609
- package/dist/lib/node/intent-resolver-AV4CMM3Z.cjs.map +0 -7
- package/dist/lib/node/meta.json +0 -1
- package/dist/lib/node/react-root-RQUU3A45.cjs +0 -51
- package/dist/lib/node/react-root-RQUU3A45.cjs.map +0 -7
- package/dist/lib/node/react-surface-AZFJLE72.cjs +0 -351
- package/dist/lib/node/react-surface-AZFJLE72.cjs.map +0 -7
- package/dist/lib/node/schema-defs-OB2X2HBH.cjs +0 -42
- package/dist/lib/node/schema-defs-OB2X2HBH.cjs.map +0 -7
- package/dist/lib/node/schema-tools-IYREN4IH.cjs +0 -147
- package/dist/lib/node/schema-tools-IYREN4IH.cjs.map +0 -7
- package/dist/lib/node/settings-P2EQ7VKQ.cjs +0 -38
- package/dist/lib/node/settings-P2EQ7VKQ.cjs.map +0 -7
- package/dist/lib/node/spaces-ready-DXPOHYV7.cjs +0 -210
- package/dist/lib/node/spaces-ready-DXPOHYV7.cjs.map +0 -7
- package/dist/lib/node/state-M35DK75Z.cjs +0 -61
- package/dist/lib/node/state-M35DK75Z.cjs.map +0 -7
- package/dist/lib/node/types/index.cjs +0 -48
- package/dist/lib/node/types/index.cjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-BCHVZ4OM.mjs +0 -364
- package/dist/lib/node-esm/app-graph-builder-BCHVZ4OM.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-serializer-TXRGGNP2.mjs +0 -81
- package/dist/lib/node-esm/app-graph-serializer-TXRGGNP2.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-3CP67AYY.mjs +0 -19
- package/dist/lib/node-esm/chunk-3CP67AYY.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-BSLREHIX.mjs +0 -20
- package/dist/lib/node-esm/chunk-BSLREHIX.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-D4QMPPS7.mjs +0 -285
- package/dist/lib/node-esm/chunk-D4QMPPS7.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-GH2FGJXH.mjs +0 -96
- package/dist/lib/node-esm/chunk-GH2FGJXH.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HO7AIKQS.mjs +0 -547
- package/dist/lib/node-esm/chunk-HO7AIKQS.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-JBQKU4K5.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-LA6AVVH6.mjs +0 -1917
- package/dist/lib/node-esm/chunk-LA6AVVH6.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-MSWEFAPD.mjs +0 -15
- package/dist/lib/node-esm/chunk-MSWEFAPD.mjs.map +0 -7
- package/dist/lib/node-esm/identity-created-35CTAQWI.mjs +0 -25
- package/dist/lib/node-esm/identity-created-35CTAQWI.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-JO6L2VXC.mjs +0 -611
- package/dist/lib/node-esm/intent-resolver-JO6L2VXC.mjs.map +0 -7
- package/dist/lib/node-esm/react-root-YFGL3B4J.mjs +0 -30
- package/dist/lib/node-esm/react-root-YFGL3B4J.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-CVAPDLEZ.mjs +0 -354
- package/dist/lib/node-esm/react-surface-CVAPDLEZ.mjs.map +0 -7
- package/dist/lib/node-esm/schema-defs-4MEJETVX.mjs +0 -27
- package/dist/lib/node-esm/schema-defs-4MEJETVX.mjs.map +0 -7
- package/dist/lib/node-esm/schema-tools-SRLCRZ3B.mjs +0 -126
- package/dist/lib/node-esm/schema-tools-SRLCRZ3B.mjs.map +0 -7
- package/dist/lib/node-esm/settings-TD76LTQS.mjs +0 -25
- package/dist/lib/node-esm/settings-TD76LTQS.mjs.map +0 -7
- package/dist/lib/node-esm/spaces-ready-FJMGPAVV.mjs +0 -200
- package/dist/lib/node-esm/spaces-ready-FJMGPAVV.mjs.map +0 -7
- package/dist/lib/node-esm/state-XQNDCN37.mjs +0 -48
- package/dist/lib/node-esm/state-XQNDCN37.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 -22
- 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/schema-defs.d.ts +0 -4
- package/dist/types/src/capabilities/schema-defs.d.ts.map +0 -1
- package/dist/types/src/capabilities/schema-tool.test.d.ts +0 -2
- package/dist/types/src/capabilities/schema-tool.test.d.ts.map +0 -1
- package/dist/types/src/capabilities/schema-tools.d.ts +0 -13
- package/dist/types/src/capabilities/schema-tools.d.ts.map +0 -1
- package/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/components/CollectionMain.d.ts +0 -6
- package/dist/types/src/components/CollectionMain.d.ts.map +0 -1
- package/dist/types/src/components/JoinDialog.d.ts.map +0 -1
- package/dist/types/src/components/MembersContainer.d.ts.map +0 -1
- package/dist/types/src/components/MembersContainer.stories.d.ts +0 -8
- package/dist/types/src/components/MembersContainer.stories.d.ts.map +0 -1
- package/dist/types/src/components/ObjectSettings/AdvancedObjectSettings.d.ts +0 -7
- package/dist/types/src/components/ObjectSettings/AdvancedObjectSettings.d.ts.map +0 -1
- package/dist/types/src/components/ObjectSettings/BaseObjectSettings.d.ts.map +0 -1
- package/dist/types/src/components/ObjectSettings/ForeignKeys.d.ts +0 -8
- package/dist/types/src/components/ObjectSettings/ForeignKeys.d.ts.map +0 -1
- package/dist/types/src/components/ObjectSettings/ObjectSettingsContainer.d.ts +0 -8
- package/dist/types/src/components/ObjectSettings/ObjectSettingsContainer.d.ts.map +0 -1
- package/dist/types/src/components/ObjectSettings/index.d.ts +0 -2
- package/dist/types/src/components/ObjectSettings/index.d.ts.map +0 -1
- package/dist/types/src/components/PersistenceStatus.d.ts +0 -6
- package/dist/types/src/components/PersistenceStatus.d.ts.map +0 -1
- package/dist/types/src/components/PopoverRenameObject.d.ts +0 -7
- package/dist/types/src/components/PopoverRenameObject.d.ts.map +0 -1
- package/dist/types/src/components/PopoverRenameSpace.d.ts +0 -7
- package/dist/types/src/components/PopoverRenameSpace.d.ts.map +0 -1
- package/dist/types/src/components/SpacePresence.d.ts.map +0 -1
- package/dist/types/src/components/SpacePresence.stories.d.ts +0 -9
- package/dist/types/src/components/SpacePresence.stories.d.ts.map +0 -1
- package/dist/types/src/events.d.ts +0 -7
- package/dist/types/src/events.d.ts.map +0 -1
- package/src/capabilities/app-graph-builder.ts +0 -540
- package/src/capabilities/app-graph-serializer.ts +0 -76
- package/src/capabilities/capabilities.ts +0 -24
- package/src/capabilities/identity-created.ts +0 -27
- package/src/capabilities/intent-resolver.ts +0 -585
- package/src/capabilities/react-root.tsx +0 -20
- package/src/capabilities/react-surface.tsx +0 -349
- package/src/capabilities/schema-defs.ts +0 -30
- package/src/capabilities/schema-tool.test.ts +0 -44
- package/src/capabilities/schema-tools.ts +0 -125
- package/src/capabilities/settings.ts +0 -21
- package/src/capabilities/spaces-ready.ts +0 -231
- package/src/capabilities/state.ts +0 -45
- package/src/components/CollectionMain.tsx +0 -30
- package/src/components/MembersContainer.stories.tsx +0 -30
- package/src/components/ObjectSettings/AdvancedObjectSettings.tsx +0 -80
- package/src/components/ObjectSettings/BaseObjectSettings.tsx +0 -47
- package/src/components/ObjectSettings/ObjectSettingsContainer.tsx +0 -36
- package/src/components/ObjectSettings/index.ts +0 -5
- package/src/components/PersistenceStatus.tsx +0 -84
- package/src/components/PopoverRenameObject.tsx +0 -62
- package/src/events.ts +0 -14
package/src/util.tsx
CHANGED
|
@@ -2,83 +2,58 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
5
|
+
import { type Instruction } from '@atlaskit/pragmatic-drag-and-drop-hitbox/tree-item';
|
|
6
|
+
import * as Effect from 'effect/Effect';
|
|
7
7
|
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
8
|
+
import { type CapabilityManager } from '@dxos/app-framework';
|
|
9
|
+
import { LayoutOperation } from '@dxos/app-toolkit';
|
|
10
|
+
import { type Space, SpaceState, isSpace } from '@dxos/client/echo';
|
|
11
|
+
import { type Database, Filter, Obj, Query, Ref, Type } from '@dxos/echo';
|
|
11
12
|
import { invariant } from '@dxos/invariant';
|
|
12
13
|
import { Migrations } from '@dxos/migrations';
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
type ReadableGraph,
|
|
17
|
-
type ActionData,
|
|
18
|
-
type InvokeParams,
|
|
19
|
-
type Node,
|
|
20
|
-
type NodeArg,
|
|
21
|
-
isGraphNode,
|
|
22
|
-
} from '@dxos/plugin-graph';
|
|
23
|
-
import { fullyQualifiedId, getSpace, type QueryResult, SpaceState, type Space, isSpace } from '@dxos/react-client/echo';
|
|
24
|
-
import { ATTENDABLE_PATH_SEPARATOR } from '@dxos/react-ui-attention';
|
|
14
|
+
import { Operation } from '@dxos/operation';
|
|
15
|
+
import { Graph, Node } from '@dxos/plugin-graph';
|
|
16
|
+
import { ATTENDABLE_PATH_SEPARATOR } from '@dxos/react-ui-attention/types';
|
|
25
17
|
import { type TreeData } from '@dxos/react-ui-list';
|
|
26
|
-
import {
|
|
18
|
+
import { Collection, Expando } from '@dxos/schema';
|
|
19
|
+
import { createFilename } from '@dxos/util';
|
|
27
20
|
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
21
|
+
import { meta } from './meta';
|
|
22
|
+
import { SPACE_TYPE, SpaceOperation } from './types';
|
|
30
23
|
|
|
31
|
-
export const SPACES = `${
|
|
32
|
-
export const COMPOSER_SPACE_LOCK =
|
|
24
|
+
export const SPACES = `${meta.id}-spaces`;
|
|
25
|
+
export const COMPOSER_SPACE_LOCK = `${meta.id}/lock`;
|
|
33
26
|
// TODO(wittjosiah): Remove.
|
|
34
27
|
export const SHARED = 'shared-spaces';
|
|
35
28
|
|
|
36
|
-
/**
|
|
37
|
-
* Convert a query result to an Rx value of the objects.
|
|
38
|
-
*/
|
|
39
|
-
export const rxFromQuery = <T extends Obj.Any>(query: QueryResult<T>): Rx.Rx<T[]> => {
|
|
40
|
-
return Rx.make((get) => {
|
|
41
|
-
const unsubscribe = query.subscribe((result) => {
|
|
42
|
-
get.setSelf(result.objects);
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
get.addFinalizer(() => unsubscribe());
|
|
46
|
-
return query.objects;
|
|
47
|
-
});
|
|
48
|
-
};
|
|
49
|
-
|
|
50
29
|
// TODO(wittjosiah): Factor out? Expose via capability?
|
|
51
30
|
export const getSpaceDisplayName = (
|
|
52
31
|
space: Space,
|
|
53
32
|
{ personal, namesCache = {} }: { personal?: boolean; namesCache?: Record<string, string> } = {},
|
|
54
33
|
): string | [string, { ns: string }] => {
|
|
55
34
|
return space.state.get() === SpaceState.SPACE_READY && (space.properties.name?.length ?? 0) > 0
|
|
56
|
-
? space.properties.name
|
|
35
|
+
? space.properties.name!
|
|
57
36
|
: namesCache[space.id]
|
|
58
37
|
? namesCache[space.id]
|
|
59
38
|
: personal
|
|
60
|
-
? ['personal space label', { ns:
|
|
61
|
-
: ['unnamed space label', { ns:
|
|
39
|
+
? ['personal space label', { ns: meta.id }]
|
|
40
|
+
: ['unnamed space label', { ns: meta.id }];
|
|
62
41
|
};
|
|
63
42
|
|
|
64
43
|
const getCollectionGraphNodePartials = ({
|
|
65
44
|
collection,
|
|
66
|
-
|
|
45
|
+
db,
|
|
67
46
|
resolve,
|
|
68
47
|
}: {
|
|
69
|
-
collection:
|
|
70
|
-
|
|
48
|
+
collection: Collection.Collection;
|
|
49
|
+
db: Database.Database;
|
|
71
50
|
resolve: (typename: string) => Record<string, any>;
|
|
72
51
|
}) => {
|
|
73
52
|
return {
|
|
74
53
|
acceptPersistenceClass: new Set(['echo']),
|
|
75
|
-
acceptPersistenceKey: new Set([
|
|
54
|
+
acceptPersistenceKey: new Set([db.spaceId]),
|
|
76
55
|
role: 'branch',
|
|
77
|
-
|
|
78
|
-
// Change on disk.
|
|
79
|
-
collection.objects = nextOrder.filter(Obj.isObject).map(Ref.make);
|
|
80
|
-
},
|
|
81
|
-
onTransferStart: (child: Node<Obj.Any>, index?: number) => {
|
|
56
|
+
onTransferStart: (child: Node.Node<Obj.Unknown>, index?: number) => {
|
|
82
57
|
// TODO(wittjosiah): Support transfer between spaces.
|
|
83
58
|
// const childSpace = getSpace(child.data);
|
|
84
59
|
// if (space && childSpace && !childSpace.key.equals(space.key)) {
|
|
@@ -97,22 +72,26 @@ const getCollectionGraphNodePartials = ({
|
|
|
97
72
|
|
|
98
73
|
// Add child to destination collection.
|
|
99
74
|
// TODO(dmaretskyi): Compare by id.
|
|
100
|
-
|
|
101
|
-
if (
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
75
|
+
Obj.change(collection, (c) => {
|
|
76
|
+
if (!c.objects.find((object) => object.target === child.data)) {
|
|
77
|
+
if (typeof index !== 'undefined') {
|
|
78
|
+
c.objects.splice(index, 0, Ref.make(child.data));
|
|
79
|
+
} else {
|
|
80
|
+
c.objects.push(Ref.make(child.data));
|
|
81
|
+
}
|
|
105
82
|
}
|
|
106
|
-
}
|
|
83
|
+
});
|
|
107
84
|
|
|
108
85
|
// }
|
|
109
86
|
},
|
|
110
|
-
onTransferEnd: (child: Node<Obj.
|
|
87
|
+
onTransferEnd: (child: Node.Node<Obj.Unknown>, destination: Node.Node) => {
|
|
111
88
|
// Remove child from origin collection.
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
89
|
+
Obj.change(collection, (c) => {
|
|
90
|
+
const index = c.objects.findIndex((object) => object.target === child.data);
|
|
91
|
+
if (index > -1) {
|
|
92
|
+
c.objects.splice(index, 1);
|
|
93
|
+
}
|
|
94
|
+
});
|
|
116
95
|
|
|
117
96
|
// TODO(wittjosiah): Support transfer between spaces.
|
|
118
97
|
// const childSpace = getSpace(child.data);
|
|
@@ -123,46 +102,45 @@ const getCollectionGraphNodePartials = ({
|
|
|
123
102
|
// childSpace.db.remove(child.data);
|
|
124
103
|
// }
|
|
125
104
|
},
|
|
126
|
-
onCopy: async (child: Node<Obj.
|
|
105
|
+
onCopy: async (child: Node.Node<Obj.Unknown>, index?: number) => {
|
|
127
106
|
// Create clone of child and add to destination space.
|
|
128
|
-
const newObject = await cloneObject(child.data, resolve,
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
107
|
+
const newObject = await cloneObject(child.data, resolve, db);
|
|
108
|
+
db.add(newObject);
|
|
109
|
+
Obj.change(collection, (c) => {
|
|
110
|
+
if (typeof index !== 'undefined') {
|
|
111
|
+
c.objects.splice(index, 0, Ref.make(newObject));
|
|
112
|
+
} else {
|
|
113
|
+
c.objects.push(Ref.make(newObject));
|
|
114
|
+
}
|
|
115
|
+
});
|
|
135
116
|
},
|
|
136
117
|
};
|
|
137
118
|
};
|
|
138
119
|
|
|
139
|
-
const
|
|
120
|
+
const getSystemCollectionNodePartials = ({
|
|
140
121
|
collection,
|
|
141
|
-
|
|
122
|
+
db,
|
|
142
123
|
resolve,
|
|
143
124
|
}: {
|
|
144
|
-
collection:
|
|
145
|
-
|
|
125
|
+
collection: Collection.Managed;
|
|
126
|
+
db: Database.Database;
|
|
146
127
|
resolve: (typename: string) => Record<string, any>;
|
|
147
128
|
}) => {
|
|
129
|
+
const metadata = resolve(collection.key);
|
|
148
130
|
return {
|
|
149
|
-
|
|
131
|
+
label: ['typename label', { ns: collection.key, count: 2 }],
|
|
132
|
+
icon: metadata.icon,
|
|
133
|
+
iconHue: metadata.iconHue,
|
|
150
134
|
acceptPersistenceClass: new Set(['echo']),
|
|
151
|
-
acceptPersistenceKey: new Set([
|
|
135
|
+
acceptPersistenceKey: new Set([db.spaceId]),
|
|
152
136
|
role: 'branch',
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
onTransferStart: (child: Node<Obj.Any>, index?: number) => {
|
|
161
|
-
// No-op. Objects are moved into query collections by being removed from their original collection.
|
|
162
|
-
},
|
|
163
|
-
onTransferEnd: (child: Node<Obj.Any>, destination: Node) => {
|
|
164
|
-
// No-op. Objects are moved out of query collections by being added to another collection.
|
|
165
|
-
},
|
|
137
|
+
};
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
const getSchemaGraphNodePartials = () => {
|
|
141
|
+
return {
|
|
142
|
+
role: 'branch',
|
|
143
|
+
canDrop: () => false,
|
|
166
144
|
};
|
|
167
145
|
};
|
|
168
146
|
|
|
@@ -181,21 +159,46 @@ export const constructSpaceNode = ({
|
|
|
181
159
|
personal,
|
|
182
160
|
namesCache,
|
|
183
161
|
resolve,
|
|
162
|
+
graph,
|
|
163
|
+
spacesOrder,
|
|
184
164
|
}: {
|
|
185
165
|
space: Space;
|
|
186
166
|
navigable?: boolean;
|
|
187
167
|
personal?: boolean;
|
|
188
168
|
namesCache?: Record<string, string>;
|
|
189
169
|
resolve: (typename: string) => Record<string, any>;
|
|
170
|
+
/** Graph for sorting edges on rearrange. */
|
|
171
|
+
graph?: Graph.ExpandableGraph;
|
|
172
|
+
// TODO(wittjosiah): Should be Type.Expando but it doesn't work with the AtomQuery result type.
|
|
173
|
+
/** Spaces order object for persisting workspace order. */
|
|
174
|
+
spacesOrder?: Obj.Any;
|
|
190
175
|
}) => {
|
|
191
176
|
const hasPendingMigration = checkPendingMigration(space);
|
|
192
177
|
const collection =
|
|
193
|
-
space.state.get() === SpaceState.SPACE_READY && space.properties[
|
|
178
|
+
space.state.get() === SpaceState.SPACE_READY && space.properties[Collection.Collection.typename]?.target;
|
|
194
179
|
const partials =
|
|
195
|
-
space.state.get() === SpaceState.SPACE_READY && Obj.instanceOf(
|
|
196
|
-
? getCollectionGraphNodePartials({ collection, space, resolve })
|
|
180
|
+
space.state.get() === SpaceState.SPACE_READY && Obj.instanceOf(Collection.Collection, collection)
|
|
181
|
+
? getCollectionGraphNodePartials({ collection, db: space.db, resolve })
|
|
197
182
|
: {};
|
|
198
183
|
|
|
184
|
+
const onRearrange =
|
|
185
|
+
graph && spacesOrder
|
|
186
|
+
? (nextOrder: Space[]) => {
|
|
187
|
+
// NOTE: This is needed to ensure order is updated by next animation frame.
|
|
188
|
+
Graph.sortEdges(
|
|
189
|
+
graph,
|
|
190
|
+
Node.RootId,
|
|
191
|
+
'outbound',
|
|
192
|
+
nextOrder.map(({ id }) => id),
|
|
193
|
+
);
|
|
194
|
+
|
|
195
|
+
// Persist order to database.
|
|
196
|
+
Obj.change(spacesOrder, (mutableOrder: any) => {
|
|
197
|
+
mutableOrder.order = nextOrder.map(({ id }) => id);
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
: undefined;
|
|
201
|
+
|
|
199
202
|
return {
|
|
200
203
|
id: space.id,
|
|
201
204
|
type: SPACE_TYPE,
|
|
@@ -210,8 +213,11 @@ export const constructSpaceNode = ({
|
|
|
210
213
|
space.state.get() === SpaceState.SPACE_READY && space.properties.icon
|
|
211
214
|
? `ph--${space.properties.icon}--regular`
|
|
212
215
|
: undefined,
|
|
216
|
+
iconHue: space.state.get() === SpaceState.SPACE_READY && space.properties.iconHue,
|
|
213
217
|
disabled: !navigable || space.state.get() !== SpaceState.SPACE_READY || hasPendingMigration,
|
|
218
|
+
disposition: 'workspace',
|
|
214
219
|
testId: 'spacePlugin.space',
|
|
220
|
+
onRearrange,
|
|
215
221
|
canDrop: (source: TreeData) => {
|
|
216
222
|
// TODO(wittjosiah): Find a way to only allow space as source for rearranging.
|
|
217
223
|
return Obj.isObject(source.item.data) || isSpace(source.item.data);
|
|
@@ -220,41 +226,44 @@ export const constructSpaceNode = ({
|
|
|
220
226
|
nodes: [
|
|
221
227
|
{
|
|
222
228
|
id: `settings${ATTENDABLE_PATH_SEPARATOR}${space.id}`,
|
|
223
|
-
type: `${
|
|
229
|
+
type: `${meta.id}/settings`,
|
|
224
230
|
data: null,
|
|
225
231
|
properties: {
|
|
226
|
-
label: ['settings panel label', { ns:
|
|
232
|
+
label: ['settings panel label', { ns: meta.id }],
|
|
227
233
|
icon: 'ph--faders--regular',
|
|
228
234
|
disposition: 'alternate-tree',
|
|
229
235
|
},
|
|
230
236
|
nodes: [
|
|
231
237
|
{
|
|
232
238
|
id: `properties-settings${ATTENDABLE_PATH_SEPARATOR}${space.id}`,
|
|
233
|
-
type: `${
|
|
234
|
-
data: `${
|
|
239
|
+
type: `${meta.id}/properties`,
|
|
240
|
+
data: `${meta.id}/properties`,
|
|
235
241
|
properties: {
|
|
236
|
-
label: ['space settings properties label', { ns:
|
|
242
|
+
label: ['space settings properties label', { ns: meta.id }],
|
|
237
243
|
icon: 'ph--sliders--regular',
|
|
238
244
|
position: 'hoist',
|
|
245
|
+
testId: 'spacePlugin.general',
|
|
239
246
|
},
|
|
240
247
|
},
|
|
241
248
|
{
|
|
242
249
|
id: `members-settings${ATTENDABLE_PATH_SEPARATOR}${space.id}`,
|
|
243
|
-
type: `${
|
|
244
|
-
data: `${
|
|
250
|
+
type: `${meta.id}/members`,
|
|
251
|
+
data: `${meta.id}/members`,
|
|
245
252
|
properties: {
|
|
246
|
-
label: ['members panel label', { ns:
|
|
253
|
+
label: ['members panel label', { ns: meta.id }],
|
|
247
254
|
icon: 'ph--users--regular',
|
|
248
255
|
position: 'hoist',
|
|
256
|
+
testId: 'spacePlugin.members',
|
|
249
257
|
},
|
|
250
258
|
},
|
|
251
259
|
{
|
|
252
260
|
id: `schema-settings${ATTENDABLE_PATH_SEPARATOR}${space.id}`,
|
|
253
|
-
type: `${
|
|
254
|
-
data: `${
|
|
261
|
+
type: `${meta.id}/schema`,
|
|
262
|
+
data: `${meta.id}/schema`,
|
|
255
263
|
properties: {
|
|
256
|
-
label: ['space settings schema label', { ns:
|
|
264
|
+
label: ['space settings schema label', { ns: meta.id }],
|
|
257
265
|
icon: 'ph--shapes--regular',
|
|
266
|
+
testId: 'spacePlugin.schema',
|
|
258
267
|
},
|
|
259
268
|
},
|
|
260
269
|
],
|
|
@@ -265,29 +274,25 @@ export const constructSpaceNode = ({
|
|
|
265
274
|
|
|
266
275
|
export const constructSpaceActions = ({
|
|
267
276
|
space,
|
|
268
|
-
dispatch,
|
|
269
277
|
personal,
|
|
270
278
|
migrating,
|
|
271
279
|
}: {
|
|
272
280
|
space: Space;
|
|
273
|
-
dispatch: PromiseIntentDispatcher;
|
|
274
281
|
personal?: boolean;
|
|
275
282
|
migrating?: boolean;
|
|
276
283
|
}) => {
|
|
277
284
|
const state = space.state.get();
|
|
278
285
|
const hasPendingMigration = checkPendingMigration(space);
|
|
279
286
|
const getId = (id: string) => `${id}/${space.id}`;
|
|
280
|
-
const actions: NodeArg<ActionData
|
|
287
|
+
const actions: Node.NodeArg<Node.ActionData<Operation.Service>>[] = [];
|
|
281
288
|
|
|
282
289
|
if (hasPendingMigration) {
|
|
283
290
|
actions.push({
|
|
284
|
-
id: getId(
|
|
285
|
-
type:
|
|
286
|
-
data:
|
|
287
|
-
await dispatch(createIntent(SpaceAction.Migrate, { space }));
|
|
288
|
-
},
|
|
291
|
+
id: getId(SpaceOperation.Migrate.meta.key),
|
|
292
|
+
type: Node.ActionGroupType,
|
|
293
|
+
data: () => Operation.invoke(SpaceOperation.Migrate, { space }),
|
|
289
294
|
properties: {
|
|
290
|
-
label: ['migrate space label', { ns:
|
|
295
|
+
label: ['migrate space label', { ns: meta.id }],
|
|
291
296
|
icon: 'ph--database--regular',
|
|
292
297
|
disposition: 'list-item-primary',
|
|
293
298
|
disabled: migrating || Migrations.running(space),
|
|
@@ -298,26 +303,22 @@ export const constructSpaceActions = ({
|
|
|
298
303
|
if (state === SpaceState.SPACE_READY && !hasPendingMigration) {
|
|
299
304
|
actions.push(
|
|
300
305
|
{
|
|
301
|
-
id: getId(
|
|
302
|
-
type:
|
|
303
|
-
data:
|
|
304
|
-
await dispatch(createIntent(SpaceAction.OpenCreateObject, { target: space }));
|
|
305
|
-
},
|
|
306
|
+
id: getId(SpaceOperation.OpenCreateObject.meta.key),
|
|
307
|
+
type: Node.ActionType,
|
|
308
|
+
data: () => Operation.invoke(SpaceOperation.OpenCreateObject, { target: space.db }),
|
|
306
309
|
properties: {
|
|
307
|
-
label: ['create object in space label', { ns:
|
|
310
|
+
label: ['create object in space label', { ns: meta.id }],
|
|
308
311
|
icon: 'ph--plus--regular',
|
|
309
|
-
disposition: 'item',
|
|
312
|
+
disposition: 'list-item-primary',
|
|
310
313
|
testId: 'spacePlugin.createObject',
|
|
311
314
|
},
|
|
312
315
|
},
|
|
313
316
|
{
|
|
314
|
-
id: getId(
|
|
315
|
-
type:
|
|
316
|
-
data:
|
|
317
|
-
await dispatch(createIntent(SpaceAction.Rename, { space, caller: params?.caller }));
|
|
318
|
-
},
|
|
317
|
+
id: getId(SpaceOperation.Rename.meta.key),
|
|
318
|
+
type: Node.ActionType,
|
|
319
|
+
data: (params?: Node.InvokeProps) => Operation.invoke(SpaceOperation.Rename, { space, caller: params?.caller }),
|
|
319
320
|
properties: {
|
|
320
|
-
label: ['rename space label', { ns:
|
|
321
|
+
label: ['rename space label', { ns: meta.id }],
|
|
321
322
|
icon: 'ph--pencil-simple-line--regular',
|
|
322
323
|
keyBinding: {
|
|
323
324
|
macos: 'shift+F6',
|
|
@@ -331,50 +332,194 @@ export const constructSpaceActions = ({
|
|
|
331
332
|
return actions;
|
|
332
333
|
};
|
|
333
334
|
|
|
334
|
-
export const
|
|
335
|
+
export const createStaticSchemaNode = ({ schema, space }: { schema: Type.Entity.Any; space: Space }): Node.Node => {
|
|
336
|
+
return {
|
|
337
|
+
id: `${space.id}/${Type.getTypename(schema)}`,
|
|
338
|
+
type: `${meta.id}/static-schema`,
|
|
339
|
+
data: schema,
|
|
340
|
+
properties: {
|
|
341
|
+
label: ['typename label', { ns: Type.getTypename(schema), count: 2, default: Type.getTypename(schema) }],
|
|
342
|
+
icon: 'ph--database--regular',
|
|
343
|
+
iconHue: 'green',
|
|
344
|
+
role: 'branch',
|
|
345
|
+
selectable: false,
|
|
346
|
+
canDrop: () => false,
|
|
347
|
+
space,
|
|
348
|
+
},
|
|
349
|
+
};
|
|
350
|
+
};
|
|
351
|
+
|
|
352
|
+
export const createStaticSchemaActions = ({
|
|
353
|
+
schema,
|
|
335
354
|
space,
|
|
355
|
+
deletable,
|
|
356
|
+
}: {
|
|
357
|
+
schema: Type.Obj.Any;
|
|
358
|
+
space: Space;
|
|
359
|
+
deletable: boolean;
|
|
360
|
+
}) => {
|
|
361
|
+
const getId = (id: string) => `${space.id}/${Type.getTypename(schema)}/${id}`;
|
|
362
|
+
|
|
363
|
+
const actions: Node.NodeArg<Node.ActionData<Operation.Service>>[] = [
|
|
364
|
+
{
|
|
365
|
+
id: getId(SpaceOperation.AddObject.meta.key),
|
|
366
|
+
type: Node.ActionType,
|
|
367
|
+
data: () =>
|
|
368
|
+
Operation.invoke(SpaceOperation.OpenCreateObject, {
|
|
369
|
+
target: space.db,
|
|
370
|
+
views: true,
|
|
371
|
+
initialFormValues: { typename: Type.getTypename(schema) },
|
|
372
|
+
}),
|
|
373
|
+
properties: {
|
|
374
|
+
label: ['add view to schema label', { ns: meta.id }],
|
|
375
|
+
icon: 'ph--plus--regular',
|
|
376
|
+
disposition: 'list-item-primary',
|
|
377
|
+
testId: 'spacePlugin.addViewToSchema',
|
|
378
|
+
},
|
|
379
|
+
},
|
|
380
|
+
{
|
|
381
|
+
id: getId(SpaceOperation.RenameObject.meta.key),
|
|
382
|
+
type: Node.ActionType,
|
|
383
|
+
data: () => Effect.fail(new Error('Not implemented')),
|
|
384
|
+
properties: {
|
|
385
|
+
label: ['rename object label', { ns: Type.getTypename(Type.PersistentType) }],
|
|
386
|
+
icon: 'ph--pencil-simple-line--regular',
|
|
387
|
+
disabled: true,
|
|
388
|
+
disposition: 'list-item',
|
|
389
|
+
testId: 'spacePlugin.renameObject',
|
|
390
|
+
},
|
|
391
|
+
},
|
|
392
|
+
{
|
|
393
|
+
id: getId(SpaceOperation.RemoveObjects.meta.key),
|
|
394
|
+
type: Node.ActionType,
|
|
395
|
+
data: () =>
|
|
396
|
+
Effect.sync(() => {
|
|
397
|
+
const index = space.properties.staticRecords.findIndex(
|
|
398
|
+
(typename: string) => typename === Type.getTypename(schema),
|
|
399
|
+
);
|
|
400
|
+
if (index > -1) {
|
|
401
|
+
Obj.change(space.properties, (p) => {
|
|
402
|
+
p.staticRecords.splice(index, 1);
|
|
403
|
+
});
|
|
404
|
+
}
|
|
405
|
+
}),
|
|
406
|
+
properties: {
|
|
407
|
+
label: ['delete object label', { ns: Type.getTypename(Type.PersistentType) }],
|
|
408
|
+
icon: 'ph--trash--regular',
|
|
409
|
+
disposition: 'list-item',
|
|
410
|
+
disabled: !deletable,
|
|
411
|
+
testId: 'spacePlugin.deleteObject',
|
|
412
|
+
},
|
|
413
|
+
},
|
|
414
|
+
{
|
|
415
|
+
id: getId(SpaceOperation.Snapshot.meta.key),
|
|
416
|
+
type: Node.ActionType,
|
|
417
|
+
data: Effect.fnUntraced(function* () {
|
|
418
|
+
const result = yield* Operation.invoke(SpaceOperation.Snapshot, {
|
|
419
|
+
db: space.db,
|
|
420
|
+
query: Query.select(Filter.type(schema)).ast,
|
|
421
|
+
});
|
|
422
|
+
if (result.snapshot) {
|
|
423
|
+
yield* Effect.tryPromise(() =>
|
|
424
|
+
downloadBlob(result.snapshot, createFilename({ parts: [space.id, Type.getTypename(schema)], ext: 'json' })),
|
|
425
|
+
);
|
|
426
|
+
}
|
|
427
|
+
}),
|
|
428
|
+
properties: {
|
|
429
|
+
label: ['snapshot by schema label', { ns: meta.id }],
|
|
430
|
+
icon: 'ph--camera--regular',
|
|
431
|
+
disposition: 'list-item',
|
|
432
|
+
},
|
|
433
|
+
},
|
|
434
|
+
];
|
|
435
|
+
|
|
436
|
+
return actions;
|
|
437
|
+
};
|
|
438
|
+
|
|
439
|
+
export const createObjectNode = ({
|
|
440
|
+
db,
|
|
336
441
|
object,
|
|
442
|
+
disposition,
|
|
337
443
|
droppable = true,
|
|
338
444
|
navigable = false,
|
|
445
|
+
managedCollectionChild = false,
|
|
339
446
|
resolve,
|
|
447
|
+
parentCollection,
|
|
340
448
|
}: {
|
|
341
|
-
|
|
342
|
-
object: Obj.
|
|
449
|
+
db: Database.Database;
|
|
450
|
+
object: Obj.Unknown;
|
|
451
|
+
disposition?: string;
|
|
343
452
|
droppable?: boolean;
|
|
344
453
|
navigable?: boolean;
|
|
454
|
+
managedCollectionChild?: boolean;
|
|
345
455
|
resolve: (typename: string) => Record<string, any>;
|
|
456
|
+
/** Parent collection for rearranging objects. */
|
|
457
|
+
parentCollection?: Collection.Collection;
|
|
346
458
|
}) => {
|
|
347
459
|
const type = Obj.getTypename(object);
|
|
348
460
|
if (!type) {
|
|
349
|
-
return
|
|
461
|
+
return null;
|
|
350
462
|
}
|
|
351
463
|
|
|
352
464
|
const metadata = resolve(type);
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
465
|
+
const partials = Obj.instanceOf(Collection.Collection, object)
|
|
466
|
+
? getCollectionGraphNodePartials({ collection: object, db, resolve })
|
|
467
|
+
: Obj.instanceOf(Collection.Managed, object)
|
|
468
|
+
? getSystemCollectionNodePartials({ collection: object, db, resolve })
|
|
469
|
+
: Obj.instanceOf(Type.PersistentType, object)
|
|
470
|
+
? getSchemaGraphNodePartials()
|
|
471
|
+
: metadata.graphProps;
|
|
356
472
|
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
473
|
+
// TODO(wittjosiah): Obj.getLabel isn't triggering reactivity in some cases.
|
|
474
|
+
// e.g., create new collection with no name and rename it.
|
|
475
|
+
const label = (object as any).name ||
|
|
476
|
+
Obj.getLabel(object) ||
|
|
477
|
+
// TODO(wittjosiah): Remove metadata labels.
|
|
478
|
+
metadata.label?.(object) || ['object name placeholder', { ns: type, default: 'New item' }];
|
|
479
|
+
|
|
480
|
+
const selectable =
|
|
481
|
+
(!Obj.instanceOf(Type.PersistentType, object) &&
|
|
482
|
+
!Obj.instanceOf(Collection.Managed, object) &&
|
|
483
|
+
!Obj.instanceOf(Collection.Collection, object)) ||
|
|
484
|
+
(navigable && Obj.instanceOf(Collection.Collection, object));
|
|
362
485
|
|
|
363
486
|
return {
|
|
364
|
-
id:
|
|
487
|
+
id: Obj.getDXN(object).toString(),
|
|
365
488
|
type,
|
|
366
489
|
cacheable: ['label', 'icon', 'role'],
|
|
367
490
|
data: object,
|
|
368
491
|
properties: {
|
|
369
|
-
|
|
370
|
-
label: metadata.label?.(object) ||
|
|
371
|
-
(object as any).name || ['object name placeholder', { ns: type, default: 'New object' }],
|
|
492
|
+
label,
|
|
372
493
|
icon: metadata.icon ?? 'ph--placeholder--regular',
|
|
494
|
+
iconHue: metadata.iconHue,
|
|
495
|
+
disposition,
|
|
373
496
|
testId: 'spacePlugin.object',
|
|
374
497
|
persistenceClass: 'echo',
|
|
375
|
-
persistenceKey:
|
|
498
|
+
persistenceKey: db.spaceId,
|
|
499
|
+
selectable,
|
|
500
|
+
managedCollectionChild,
|
|
501
|
+
onRearrange: parentCollection
|
|
502
|
+
? (nextOrder: unknown[]) => {
|
|
503
|
+
Obj.change(parentCollection, (c) => {
|
|
504
|
+
c.objects = nextOrder.filter(Obj.isObject).map(Ref.make);
|
|
505
|
+
});
|
|
506
|
+
}
|
|
507
|
+
: undefined,
|
|
508
|
+
blockInstruction: (source: TreeData, instruction: Instruction) => {
|
|
509
|
+
if (source.item.properties.managedCollectionChild) {
|
|
510
|
+
// TODO(wittjosiah): Support reordering system collections.
|
|
511
|
+
// return !(managedCollectionChild && source.item.type === type && instruction.type.startsWith('reorder'));
|
|
512
|
+
return true;
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
if (Obj.instanceOf(Collection.Managed, object)) {
|
|
516
|
+
return !instruction.type.startsWith('reorder');
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
return managedCollectionChild;
|
|
520
|
+
},
|
|
376
521
|
canDrop: (source: TreeData) => {
|
|
377
|
-
return droppable && isGraphNode(source.item) && Obj.isObject(source.item.data);
|
|
522
|
+
return droppable && Node.isGraphNode(source.item) && Obj.isObject(source.item.data);
|
|
378
523
|
},
|
|
379
524
|
...partials,
|
|
380
525
|
},
|
|
@@ -384,36 +529,41 @@ export const createObjectNode = ({
|
|
|
384
529
|
export const constructObjectActions = ({
|
|
385
530
|
object,
|
|
386
531
|
graph,
|
|
387
|
-
|
|
388
|
-
|
|
532
|
+
resolve,
|
|
533
|
+
capabilities,
|
|
534
|
+
deletable = true,
|
|
389
535
|
navigable = false,
|
|
536
|
+
shareableLinkOrigin,
|
|
390
537
|
}: {
|
|
391
|
-
object: Obj.
|
|
392
|
-
graph: ReadableGraph;
|
|
393
|
-
|
|
394
|
-
|
|
538
|
+
object: Obj.Unknown;
|
|
539
|
+
graph: Graph.ReadableGraph;
|
|
540
|
+
resolve: (typename: string) => Record<string, any>;
|
|
541
|
+
capabilities: CapabilityManager.CapabilityManager;
|
|
542
|
+
shareableLinkOrigin: string;
|
|
543
|
+
deletable?: boolean;
|
|
395
544
|
navigable?: boolean;
|
|
396
545
|
}) => {
|
|
397
|
-
const
|
|
398
|
-
invariant(
|
|
399
|
-
const
|
|
546
|
+
const db = Obj.getDatabase(object);
|
|
547
|
+
invariant(db, 'Database not found');
|
|
548
|
+
const typename = Obj.getTypename(object);
|
|
549
|
+
invariant(typename, 'Object has no typename');
|
|
400
550
|
|
|
401
|
-
const
|
|
402
|
-
const matchingObjectForm = queryCollection
|
|
403
|
-
? objectForms.find((form) => Type.getTypename(form.objectSchema) === queryCollection.query.typename)
|
|
404
|
-
: undefined;
|
|
551
|
+
const getId = (id: string) => `${id}/${Obj.getDXN(object).toString()}`;
|
|
405
552
|
|
|
406
|
-
const
|
|
407
|
-
|
|
553
|
+
const managedCollection = Obj.instanceOf(Collection.Managed, object) ? object : undefined;
|
|
554
|
+
const metadata = managedCollection ? resolve(managedCollection.key) : {};
|
|
555
|
+
const createObject = metadata.createObject;
|
|
556
|
+
const inputSchema = metadata.inputSchema;
|
|
557
|
+
|
|
558
|
+
const actions: Node.NodeArg<Node.ActionData<Operation.Service>>[] = [
|
|
559
|
+
...(Obj.instanceOf(Collection.Collection, object)
|
|
408
560
|
? [
|
|
409
561
|
{
|
|
410
|
-
id: getId(
|
|
411
|
-
type:
|
|
412
|
-
data:
|
|
413
|
-
await dispatch(createIntent(SpaceAction.OpenCreateObject, { target: object }));
|
|
414
|
-
},
|
|
562
|
+
id: getId(SpaceOperation.OpenCreateObject.meta.key),
|
|
563
|
+
type: Node.ActionType,
|
|
564
|
+
data: () => Operation.invoke(SpaceOperation.OpenCreateObject, { target: object }),
|
|
415
565
|
properties: {
|
|
416
|
-
label: ['create object in collection label', { ns:
|
|
566
|
+
label: ['create object in collection label', { ns: meta.id }],
|
|
417
567
|
icon: 'ph--plus--regular',
|
|
418
568
|
disposition: 'list-item-primary',
|
|
419
569
|
testId: 'spacePlugin.createObject',
|
|
@@ -421,31 +571,75 @@ export const constructObjectActions = ({
|
|
|
421
571
|
},
|
|
422
572
|
]
|
|
423
573
|
: []),
|
|
424
|
-
...(
|
|
574
|
+
...(Obj.instanceOf(Type.PersistentType, object)
|
|
425
575
|
? [
|
|
426
576
|
{
|
|
427
|
-
id: getId(
|
|
428
|
-
type:
|
|
429
|
-
data:
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
577
|
+
id: getId(SpaceOperation.AddObject.meta.key),
|
|
578
|
+
type: Node.ActionType,
|
|
579
|
+
data: () =>
|
|
580
|
+
Operation.invoke(SpaceOperation.OpenCreateObject, {
|
|
581
|
+
target: db,
|
|
582
|
+
views: true,
|
|
583
|
+
initialFormValues: { typename: object.typename },
|
|
584
|
+
}),
|
|
585
|
+
properties: {
|
|
586
|
+
label: ['add view to schema label', { ns: meta.id }],
|
|
587
|
+
icon: 'ph--plus--regular',
|
|
588
|
+
disposition: 'list-item-primary',
|
|
589
|
+
testId: 'spacePlugin.addViewToSchema',
|
|
590
|
+
},
|
|
591
|
+
},
|
|
592
|
+
{
|
|
593
|
+
id: getId(SpaceOperation.Snapshot.meta.key),
|
|
594
|
+
type: Node.ActionType,
|
|
595
|
+
data: Effect.fnUntraced(function* () {
|
|
596
|
+
const result = yield* Operation.invoke(SpaceOperation.Snapshot, {
|
|
597
|
+
db,
|
|
598
|
+
query: Query.select(Filter.type(Type.toEffectSchema(object.jsonSchema))).ast,
|
|
599
|
+
});
|
|
600
|
+
if (result.snapshot) {
|
|
601
|
+
yield* Effect.promise(() =>
|
|
602
|
+
downloadBlob(result.snapshot, createFilename({ parts: [db.spaceId, object.typename], ext: 'json' })),
|
|
444
603
|
);
|
|
445
604
|
}
|
|
605
|
+
}),
|
|
606
|
+
properties: {
|
|
607
|
+
label: ['snapshot by schema label', { ns: meta.id }],
|
|
608
|
+
icon: 'ph--camera--regular',
|
|
609
|
+
disposition: 'list-item',
|
|
446
610
|
},
|
|
611
|
+
},
|
|
612
|
+
]
|
|
613
|
+
: []),
|
|
614
|
+
...(createObject
|
|
615
|
+
? [
|
|
616
|
+
{
|
|
617
|
+
id: getId(SpaceOperation.OpenCreateObject.meta.key),
|
|
618
|
+
type: Node.ActionType,
|
|
619
|
+
data: Effect.fnUntraced(function* () {
|
|
620
|
+
if (inputSchema) {
|
|
621
|
+
yield* Operation.invoke(SpaceOperation.OpenCreateObject, {
|
|
622
|
+
target: db,
|
|
623
|
+
typename: managedCollection ? managedCollection.key : undefined,
|
|
624
|
+
});
|
|
625
|
+
} else {
|
|
626
|
+
const createdObject = yield* createObject({}, { db, capabilities }) as Effect.Effect<
|
|
627
|
+
Obj.Unknown,
|
|
628
|
+
Error,
|
|
629
|
+
never
|
|
630
|
+
>;
|
|
631
|
+
const addResult = yield* Operation.invoke(SpaceOperation.AddObject, {
|
|
632
|
+
target: db,
|
|
633
|
+
hidden: true,
|
|
634
|
+
object: createdObject,
|
|
635
|
+
});
|
|
636
|
+
if (addResult.id) {
|
|
637
|
+
yield* Operation.invoke(LayoutOperation.Open, { subject: [addResult.id] });
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
}),
|
|
447
641
|
properties: {
|
|
448
|
-
label: ['create object in
|
|
642
|
+
label: ['create object in system collection label', { ns: meta.id }],
|
|
449
643
|
icon: 'ph--plus--regular',
|
|
450
644
|
disposition: 'list-item-primary',
|
|
451
645
|
testId: 'spacePlugin.createObject',
|
|
@@ -453,58 +647,61 @@ export const constructObjectActions = ({
|
|
|
453
647
|
},
|
|
454
648
|
]
|
|
455
649
|
: []),
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
650
|
+
...(managedCollection
|
|
651
|
+
? []
|
|
652
|
+
: [
|
|
653
|
+
{
|
|
654
|
+
id: getId(SpaceOperation.RenameObject.meta.key),
|
|
655
|
+
type: Node.ActionType,
|
|
656
|
+
data: (params?: Node.InvokeProps) =>
|
|
657
|
+
Operation.invoke(SpaceOperation.RenameObject, { object, caller: params?.caller }),
|
|
658
|
+
properties: {
|
|
659
|
+
label: ['rename object label', { ns: typename }],
|
|
660
|
+
icon: 'ph--pencil-simple-line--regular',
|
|
661
|
+
disposition: 'list-item',
|
|
662
|
+
// TODO(wittjosiah): Not working.
|
|
663
|
+
// keyBinding: {
|
|
664
|
+
// macos: 'shift+F6',
|
|
665
|
+
// },
|
|
666
|
+
testId: 'spacePlugin.renameObject',
|
|
667
|
+
},
|
|
668
|
+
},
|
|
669
|
+
{
|
|
670
|
+
id: getId(SpaceOperation.RemoveObjects.meta.key),
|
|
671
|
+
type: Node.ActionType,
|
|
672
|
+
data: Effect.fnUntraced(function* () {
|
|
673
|
+
const collection = Graph.getConnections(graph, Obj.getDXN(object).toString(), 'inbound').find(
|
|
674
|
+
(node: Node.Node): node is Node.Node<Collection.Collection> =>
|
|
675
|
+
Obj.instanceOf(Collection.Collection, node.data),
|
|
676
|
+
)?.data;
|
|
677
|
+
yield* Operation.invoke(SpaceOperation.RemoveObjects, { objects: [object], target: collection });
|
|
678
|
+
}),
|
|
679
|
+
properties: {
|
|
680
|
+
label: ['delete object label', { ns: typename }],
|
|
681
|
+
icon: 'ph--trash--regular',
|
|
682
|
+
disposition: 'list-item',
|
|
683
|
+
disabled: !deletable,
|
|
684
|
+
// TODO(wittjosiah): This is a browser shortcut.
|
|
685
|
+
// keyBinding: object instanceof CollectionType ? undefined : 'shift+meta+Backspace',
|
|
686
|
+
testId: 'spacePlugin.deleteObject',
|
|
687
|
+
},
|
|
688
|
+
},
|
|
689
|
+
]),
|
|
690
|
+
...(navigable ||
|
|
691
|
+
(!Obj.instanceOf(Collection.Collection, object) &&
|
|
692
|
+
!Obj.instanceOf(Collection.Managed, object) &&
|
|
693
|
+
!Obj.instanceOf(Type.PersistentType, object))
|
|
498
694
|
? [
|
|
499
695
|
{
|
|
500
696
|
id: getId('copy-link'),
|
|
501
|
-
type:
|
|
502
|
-
data:
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
697
|
+
type: Node.ActionType,
|
|
698
|
+
data: () =>
|
|
699
|
+
Effect.promise(async () => {
|
|
700
|
+
const url = `${shareableLinkOrigin}/${db.spaceId}/${Obj.getDXN(object).toString()}`;
|
|
701
|
+
await navigator.clipboard.writeText(url);
|
|
702
|
+
}),
|
|
506
703
|
properties: {
|
|
507
|
-
label: ['copy link label', { ns:
|
|
704
|
+
label: ['copy link label', { ns: meta.id }],
|
|
508
705
|
icon: 'ph--link--regular',
|
|
509
706
|
disposition: 'list-item',
|
|
510
707
|
testId: 'spacePlugin.copyLink',
|
|
@@ -514,13 +711,11 @@ export const constructObjectActions = ({
|
|
|
514
711
|
: []),
|
|
515
712
|
// TODO(wittjosiah): Factor out and apply to all nodes.
|
|
516
713
|
{
|
|
517
|
-
id: getId(
|
|
518
|
-
type:
|
|
519
|
-
data:
|
|
520
|
-
await dispatch(createIntent(LayoutAction.Expose, { part: 'navigation', subject: fullyQualifiedId(object) }));
|
|
521
|
-
},
|
|
714
|
+
id: getId(LayoutOperation.Expose.meta.key),
|
|
715
|
+
type: Node.ActionType,
|
|
716
|
+
data: () => Operation.invoke(LayoutOperation.Expose, { subject: Obj.getDXN(object).toString() }),
|
|
522
717
|
properties: {
|
|
523
|
-
label: ['expose object label', { ns:
|
|
718
|
+
label: ['expose object label', { ns: meta.id }],
|
|
524
719
|
icon: 'ph--eye--regular',
|
|
525
720
|
disposition: 'heading-list-item',
|
|
526
721
|
testId: 'spacePlugin.exposeObject',
|
|
@@ -531,13 +726,27 @@ export const constructObjectActions = ({
|
|
|
531
726
|
return actions;
|
|
532
727
|
};
|
|
533
728
|
|
|
729
|
+
// TODO(wittjosiah): Factor out.
|
|
730
|
+
const downloadBlob = async (blob: Blob, filename: string) => {
|
|
731
|
+
const url = URL.createObjectURL(blob);
|
|
732
|
+
const a = document.createElement('a');
|
|
733
|
+
a.href = url;
|
|
734
|
+
a.download = filename;
|
|
735
|
+
|
|
736
|
+
document.body.appendChild(a);
|
|
737
|
+
a.click();
|
|
738
|
+
|
|
739
|
+
document.body.removeChild(a);
|
|
740
|
+
URL.revokeObjectURL(url);
|
|
741
|
+
};
|
|
742
|
+
|
|
534
743
|
/**
|
|
535
744
|
* @deprecated This is a temporary solution.
|
|
536
745
|
*/
|
|
537
746
|
export const getNestedObjects = async (
|
|
538
|
-
object: Obj.
|
|
747
|
+
object: Obj.Unknown,
|
|
539
748
|
resolve: (typename: string) => Record<string, any>,
|
|
540
|
-
): Promise<Obj.
|
|
749
|
+
): Promise<Obj.Unknown[]> => {
|
|
541
750
|
const type = Obj.getTypename(object);
|
|
542
751
|
if (!type) {
|
|
543
752
|
return [];
|
|
@@ -549,7 +758,7 @@ export const getNestedObjects = async (
|
|
|
549
758
|
return [];
|
|
550
759
|
}
|
|
551
760
|
|
|
552
|
-
const objects: Obj.
|
|
761
|
+
const objects: Obj.Unknown[] = await loadReferences(object);
|
|
553
762
|
const nested = await Promise.all(objects.map((object) => getNestedObjects(object, resolve)));
|
|
554
763
|
return [...objects, ...nested.flat()];
|
|
555
764
|
};
|
|
@@ -559,15 +768,15 @@ export const getNestedObjects = async (
|
|
|
559
768
|
*/
|
|
560
769
|
// TODO(burdon): Remove.
|
|
561
770
|
export const cloneObject = async (
|
|
562
|
-
object:
|
|
771
|
+
object: Obj.Unknown,
|
|
563
772
|
resolve: (typename: string) => Record<string, any>,
|
|
564
|
-
|
|
565
|
-
): Promise<
|
|
773
|
+
newDb: Database.Database,
|
|
774
|
+
): Promise<Obj.Unknown> => {
|
|
566
775
|
const schema = Obj.getSchema(object);
|
|
567
|
-
const typename = schema ? Type.getTypename(schema) ??
|
|
776
|
+
const typename = schema ? (Type.getTypename(schema) ?? Expando.Expando.typename) : Expando.Expando.typename;
|
|
568
777
|
const metadata = resolve(typename);
|
|
569
778
|
const serializer = metadata.serializer;
|
|
570
779
|
invariant(serializer, `No serializer for type: ${typename}`);
|
|
571
780
|
const content = await serializer.serialize({ object });
|
|
572
|
-
return serializer.deserialize({ content,
|
|
781
|
+
return serializer.deserialize({ content, db: newDb, newId: true });
|
|
573
782
|
};
|