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