@dxos/plugin-space 0.8.4-main.ae835ea → 0.8.4-main.bc674ce
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-OQMUVFVV.mjs +125 -0
- package/dist/lib/browser/CollectionArticle-OQMUVFVV.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-4WZUGLQQ.mjs +117 -0
- 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-OWNBEI5J.mjs → chunk-SUI34XSA.mjs} +318 -256
- package/dist/lib/browser/chunk-SUI34XSA.mjs.map +7 -0
- package/dist/lib/browser/chunk-TWUMNPG4.mjs +1898 -0
- package/dist/lib/browser/chunk-TWUMNPG4.mjs.map +7 -0
- package/dist/lib/browser/{chunk-4V4JNJ33.mjs → chunk-ZT2VPYRM.mjs} +62 -63
- package/dist/lib/browser/chunk-ZT2VPYRM.mjs.map +7 -0
- 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 +230 -236
- 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-3SPMM45V.mjs +30 -0
- package/dist/lib/browser/react-root-3SPMM45V.mjs.map +7 -0
- package/dist/lib/browser/react-surface-UUS7NDHS.mjs +382 -0
- package/dist/lib/browser/react-surface-UUS7NDHS.mjs.map +7 -0
- package/dist/lib/browser/repair-CJG26D52.mjs +50 -0
- 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 +18 -10
- package/dist/lib/node-esm/CollectionArticle-V5OOJVJJ.mjs +126 -0
- package/dist/lib/node-esm/CollectionArticle-V5OOJVJJ.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-G4PDWB7G.mjs → chunk-2SW6S2BB.mjs} +62 -63
- package/dist/lib/node-esm/chunk-2SW6S2BB.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-XEVIWD3O.mjs → chunk-7KMYUWSR.mjs} +318 -256
- 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-FYSBFBSD.mjs +1899 -0
- package/dist/lib/node-esm/chunk-FYSBFBSD.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-JOBIWCBC.mjs +118 -0
- 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 +230 -236
- 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-Y6JTGDTW.mjs +31 -0
- package/dist/lib/node-esm/react-root-Y6JTGDTW.mjs.map +7 -0
- package/dist/lib/node-esm/react-surface-SQ4SK3OK.mjs +383 -0
- package/dist/lib/node-esm/react-surface-SQ4SK3OK.mjs.map +7 -0
- package/dist/lib/node-esm/repair-G3ZW3VG3.mjs +51 -0
- 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 +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 +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 +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 +2 -2
- package/dist/types/src/components/CreateDialog/CreateObjectDialog.d.ts.map +1 -1
- package/dist/types/src/components/CreateDialog/CreateObjectDialog.stories.d.ts +163 -229
- package/dist/types/src/components/CreateDialog/CreateObjectDialog.stories.d.ts.map +1 -1
- package/dist/types/src/components/CreateDialog/CreateObjectPanel.d.ts +18 -10
- 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 -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/MembersContainer.d.ts.map +1 -0
- package/dist/types/src/components/{RecordMain.stories.d.ts → MembersContainer/MembersContainer.stories.d.ts} +158 -225
- package/dist/types/src/components/{MembersContainer.stories.d.ts.map → MembersContainer/MembersContainer.stories.d.ts.map} +1 -1
- 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/{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 +156 -223
- package/dist/types/src/components/{ObjectSettings → ObjectDetails}/BaseObjectSettings.stories.d.ts.map +1 -1
- 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/{MembersContainer.stories.d.ts → RecordArticle.stories.d.ts} +158 -225
- package/dist/types/src/components/{RecordMain.stories.d.ts.map → RecordArticle.stories.d.ts.map} +1 -1
- 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.stories.d.ts → SpacePresence/SpacePresence.stories.d.ts} +156 -223
- package/dist/types/src/components/{SpacePresence.stories.d.ts.map → SpacePresence/SpacePresence.stories.d.ts.map} +1 -1
- 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 +1 -1
- package/dist/types/src/components/SpaceSettings/SpaceSettingsContainer.d.ts.map +1 -1
- package/dist/types/src/components/SpaceSettings/SpaceSettingsContainer.stories.d.ts +157 -224
- package/dist/types/src/components/SpaceSettings/SpaceSettingsContainer.stories.d.ts.map +1 -1
- package/dist/types/src/components/SyncStatus/SyncStatus.d.ts.map +1 -1
- package/dist/types/src/components/SyncStatus/SyncStatus.stories.d.ts +156 -223
- package/dist/types/src/components/SyncStatus/SyncStatus.stories.d.ts.map +1 -1
- package/dist/types/src/components/ViewEditor.d.ts +3 -4
- package/dist/types/src/components/ViewEditor.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +15 -16
- 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/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 +2 -2
- package/dist/types/src/hooks/useTypeOptions.d.ts.map +1 -1
- 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 -2
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +156 -223
- 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 +637 -397
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/src/util.d.ts +39 -51
- package/dist/types/src/util.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +82 -63
- package/src/SpacePlugin.ts +169 -227
- 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/repair.ts +67 -0
- 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 +21 -20
- package/src/components/CollectionArticle.tsx +153 -0
- package/src/components/CollectionSection.tsx +6 -4
- package/src/components/CreateDialog/CreateObjectDialog.stories.tsx +30 -24
- package/src/components/CreateDialog/CreateObjectDialog.tsx +66 -57
- package/src/components/CreateDialog/CreateObjectPanel.tsx +153 -91
- package/src/components/CreateDialog/CreateSpaceDialog.tsx +34 -29
- package/src/components/{JoinDialog.tsx → JoinDialog/JoinDialog.tsx} +26 -37
- package/src/components/JoinDialog/index.ts +5 -0
- package/src/components/{MembersContainer.stories.tsx → MembersContainer/MembersContainer.stories.tsx} +3 -3
- package/src/components/{MembersContainer.tsx → MembersContainer/MembersContainer.tsx} +41 -41
- package/src/components/MembersContainer/index.ts +5 -0
- 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 +7 -7
- package/src/components/ObjectDetails/BaseObjectSettings.tsx +122 -0
- package/src/components/{ObjectSettings → ObjectDetails}/ForeignKeys.tsx +6 -6
- package/src/components/ObjectDetails/ObjectDetails.tsx +32 -0
- package/src/components/ObjectDetails/index.ts +7 -0
- package/src/components/{PopoverRenameObject.tsx → ObjectRenamePopover/ObjectRenamePopover.tsx} +11 -15
- package/src/components/ObjectRenamePopover/index.ts +5 -0
- package/src/components/{RecordMain.stories.tsx → RecordArticle.stories.tsx} +30 -31
- package/src/components/RecordArticle.tsx +122 -0
- package/src/components/SchemaContainer.tsx +24 -27
- package/src/components/SpacePluginSettings.tsx +17 -7
- package/src/components/{SpacePresence.stories.tsx → SpacePresence/SpacePresence.stories.tsx} +1 -1
- package/src/components/{SpacePresence.tsx → SpacePresence/SpacePresence.tsx} +19 -16
- package/src/components/SpacePresence/index.ts +5 -0
- package/src/components/{PopoverRenameSpace.tsx → SpaceRenamePopover/SpaceRenamePopover.tsx} +15 -15
- package/src/components/SpaceRenamePopover/index.ts +5 -0
- package/src/components/SpaceSettings/SpaceSettingsContainer.stories.tsx +4 -4
- package/src/components/SpaceSettings/SpaceSettingsContainer.tsx +188 -153
- package/src/components/SyncStatus/InlineSyncStatus.tsx +1 -1
- package/src/components/SyncStatus/SyncStatus.tsx +26 -20
- package/src/components/SyncStatus/save-tracker.ts +2 -2
- package/src/components/ViewEditor.tsx +64 -21
- package/src/components/index.ts +7 -8
- 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/useActiveSpace.ts +7 -4
- package/src/hooks/useInputSurfaceLookup.tsx +9 -13
- package/src/hooks/usePath.ts +4 -4
- package/src/hooks/useTypeOptions.ts +3 -37
- package/src/index.ts +2 -2
- package/src/meta.ts +2 -2
- package/src/translations.ts +61 -59
- package/src/types/capabilities.ts +73 -0
- package/src/types/events.ts +15 -0
- package/src/types/form.ts +69 -0
- package/src/types/index.ts +3 -0
- package/src/types/types.ts +532 -261
- package/src/util.tsx +330 -282
- package/dist/lib/browser/CollectionMain-HTKSZCRR.mjs +0 -31
- package/dist/lib/browser/CollectionMain-HTKSZCRR.mjs.map +0 -7
- package/dist/lib/browser/ObjectDetailsPanel-5B45G744.mjs +0 -145
- package/dist/lib/browser/ObjectDetailsPanel-5B45G744.mjs.map +0 -7
- package/dist/lib/browser/ObjectSettings-UFTKBP7B.mjs +0 -146
- package/dist/lib/browser/ObjectSettings-UFTKBP7B.mjs.map +0 -7
- package/dist/lib/browser/RecordMain-BCSXTSEB.mjs +0 -99
- package/dist/lib/browser/RecordMain-BCSXTSEB.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-QJFO4ANM.mjs +0 -520
- package/dist/lib/browser/app-graph-builder-QJFO4ANM.mjs.map +0 -7
- package/dist/lib/browser/app-graph-serializer-3R5NVV7U.mjs +0 -80
- package/dist/lib/browser/app-graph-serializer-3R5NVV7U.mjs.map +0 -7
- package/dist/lib/browser/chunk-2NS3VPSY.mjs +0 -20
- package/dist/lib/browser/chunk-2NS3VPSY.mjs.map +0 -7
- package/dist/lib/browser/chunk-4V4JNJ33.mjs.map +0 -7
- package/dist/lib/browser/chunk-ENBBJSNE.mjs +0 -1949
- package/dist/lib/browser/chunk-ENBBJSNE.mjs.map +0 -7
- package/dist/lib/browser/chunk-HS2VD6DN.mjs +0 -166
- package/dist/lib/browser/chunk-HS2VD6DN.mjs.map +0 -7
- package/dist/lib/browser/chunk-OWNBEI5J.mjs.map +0 -7
- package/dist/lib/browser/chunk-SLDQWMQ2.mjs +0 -349
- package/dist/lib/browser/chunk-SLDQWMQ2.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-PW2BA46S.mjs +0 -23
- package/dist/lib/browser/identity-created-PW2BA46S.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-MBVOLXFQ.mjs +0 -772
- package/dist/lib/browser/intent-resolver-MBVOLXFQ.mjs.map +0 -7
- package/dist/lib/browser/react-root-NKEKCEYM.mjs +0 -29
- package/dist/lib/browser/react-root-NKEKCEYM.mjs.map +0 -7
- package/dist/lib/browser/react-surface-PYSN2MBY.mjs +0 -354
- package/dist/lib/browser/react-surface-PYSN2MBY.mjs.map +0 -7
- package/dist/lib/browser/schema-defs-DWYK7TYW.mjs +0 -26
- package/dist/lib/browser/schema-defs-DWYK7TYW.mjs.map +0 -7
- package/dist/lib/browser/settings-ZUCC3ZLB.mjs +0 -24
- package/dist/lib/browser/settings-ZUCC3ZLB.mjs.map +0 -7
- package/dist/lib/browser/spaces-ready-HTWWJHLR.mjs +0 -201
- package/dist/lib/browser/spaces-ready-HTWWJHLR.mjs.map +0 -7
- package/dist/lib/browser/state-ISVAKMO7.mjs +0 -47
- package/dist/lib/browser/state-ISVAKMO7.mjs.map +0 -7
- package/dist/lib/node-esm/CollectionMain-OUHGG6OC.mjs +0 -32
- package/dist/lib/node-esm/CollectionMain-OUHGG6OC.mjs.map +0 -7
- package/dist/lib/node-esm/ObjectDetailsPanel-4SDHQVQU.mjs +0 -146
- package/dist/lib/node-esm/ObjectDetailsPanel-4SDHQVQU.mjs.map +0 -7
- package/dist/lib/node-esm/ObjectSettings-EU6F43RP.mjs +0 -147
- package/dist/lib/node-esm/ObjectSettings-EU6F43RP.mjs.map +0 -7
- package/dist/lib/node-esm/RecordMain-SD76DGOR.mjs +0 -100
- package/dist/lib/node-esm/RecordMain-SD76DGOR.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-B23W62HY.mjs +0 -521
- package/dist/lib/node-esm/app-graph-builder-B23W62HY.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-serializer-3Z3EXEEF.mjs +0 -81
- package/dist/lib/node-esm/app-graph-serializer-3Z3EXEEF.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-BDEFTL6K.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-G4PDWB7G.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-KKPCCA5O.mjs +0 -1950
- package/dist/lib/node-esm/chunk-KKPCCA5O.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-PM4ZIGKC.mjs +0 -167
- package/dist/lib/node-esm/chunk-PM4ZIGKC.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-XEVIWD3O.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-YFQXFQGT.mjs +0 -350
- package/dist/lib/node-esm/chunk-YFQXFQGT.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-ZLMFLI7G.mjs +0 -21
- package/dist/lib/node-esm/chunk-ZLMFLI7G.mjs.map +0 -7
- package/dist/lib/node-esm/identity-created-MWTLGQRU.mjs +0 -25
- package/dist/lib/node-esm/identity-created-MWTLGQRU.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-IWI47NTW.mjs +0 -773
- package/dist/lib/node-esm/intent-resolver-IWI47NTW.mjs.map +0 -7
- package/dist/lib/node-esm/react-root-LX7SIG6M.mjs +0 -30
- package/dist/lib/node-esm/react-root-LX7SIG6M.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-6SVGOZNJ.mjs +0 -355
- package/dist/lib/node-esm/react-surface-6SVGOZNJ.mjs.map +0 -7
- package/dist/lib/node-esm/schema-defs-EOG2UPJU.mjs +0 -27
- package/dist/lib/node-esm/schema-defs-EOG2UPJU.mjs.map +0 -7
- package/dist/lib/node-esm/settings-ZDJNLFGW.mjs +0 -25
- package/dist/lib/node-esm/settings-ZDJNLFGW.mjs.map +0 -7
- package/dist/lib/node-esm/spaces-ready-VUGYPF4L.mjs +0 -202
- package/dist/lib/node-esm/spaces-ready-VUGYPF4L.mjs.map +0 -7
- package/dist/lib/node-esm/state-QZ4Q6ZRL.mjs +0 -48
- package/dist/lib/node-esm/state-QZ4Q6ZRL.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 -29
- 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/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 -7
- 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/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 +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 -3
- 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/RecordMain.d.ts +0 -8
- package/dist/types/src/components/RecordMain.d.ts.map +0 -1
- package/dist/types/src/components/SpacePresence.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 -757
- package/src/capabilities/app-graph-serializer.ts +0 -76
- package/src/capabilities/capabilities.ts +0 -35
- package/src/capabilities/identity-created.ts +0 -25
- package/src/capabilities/intent-resolver.ts +0 -711
- package/src/capabilities/react-root.tsx +0 -21
- package/src/capabilities/react-surface.tsx +0 -329
- package/src/capabilities/schema-defs.ts +0 -31
- package/src/capabilities/settings.ts +0 -21
- package/src/capabilities/spaces-ready.ts +0 -234
- package/src/capabilities/state.ts +0 -46
- package/src/components/CollectionMain.tsx +0 -32
- package/src/components/ObjectDetailsPanel/ObjectDetailsPanel.tsx +0 -52
- package/src/components/ObjectDetailsPanel/ObjectForm.tsx +0 -75
- package/src/components/ObjectDetailsPanel/index.ts +0 -7
- package/src/components/ObjectSettings/AdvancedObjectSettings.tsx +0 -81
- package/src/components/ObjectSettings/BaseObjectSettings.tsx +0 -107
- package/src/components/ObjectSettings/ObjectSettingsContainer.tsx +0 -37
- package/src/components/ObjectSettings/index.ts +0 -7
- package/src/components/PersistenceStatus.tsx +0 -83
- package/src/components/RecordMain.tsx +0 -83
- package/src/events.ts +0 -15
- /package/dist/types/src/components/{JoinDialog.d.ts → JoinDialog/JoinDialog.d.ts} +0 -0
- /package/dist/types/src/components/{MembersContainer.d.ts → MembersContainer/MembersContainer.d.ts} +0 -0
package/src/util.tsx
CHANGED
|
@@ -2,58 +2,36 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
6
|
-
import * as
|
|
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 { type
|
|
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';
|
|
11
11
|
import { invariant } from '@dxos/invariant';
|
|
12
12
|
import { Migrations } from '@dxos/migrations';
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
type ActionData,
|
|
17
|
-
type InvokeParams,
|
|
18
|
-
type Node,
|
|
19
|
-
type NodeArg,
|
|
20
|
-
type ReadableGraph,
|
|
21
|
-
isGraphNode,
|
|
22
|
-
} from '@dxos/plugin-graph';
|
|
23
|
-
import { type QueryResult, type Space, SpaceState, fullyQualifiedId, getSpace, isSpace } from '@dxos/react-client/echo';
|
|
24
|
-
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';
|
|
25
16
|
import { type TreeData } from '@dxos/react-ui-list';
|
|
26
|
-
import {
|
|
17
|
+
import { Collection, Expando } from '@dxos/schema';
|
|
18
|
+
import { createFilename } from '@dxos/util';
|
|
27
19
|
|
|
28
20
|
import { meta } from './meta';
|
|
29
|
-
import {
|
|
21
|
+
import { SPACE_TYPE, SpaceOperation } from './types';
|
|
30
22
|
|
|
31
23
|
export const SPACES = `${meta.id}-spaces`;
|
|
32
24
|
export const COMPOSER_SPACE_LOCK = `${meta.id}/lock`;
|
|
33
25
|
// TODO(wittjosiah): Remove.
|
|
34
26
|
export const SHARED = 'shared-spaces';
|
|
35
27
|
|
|
36
|
-
/**
|
|
37
|
-
* Convert a query result to an Rx value of the objects.
|
|
38
|
-
*/
|
|
39
|
-
export const rxFromQuery = <T extends AnyEchoObject>(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
28
|
// TODO(wittjosiah): Factor out? Expose via capability?
|
|
51
29
|
export const getSpaceDisplayName = (
|
|
52
30
|
space: Space,
|
|
53
31
|
{ personal, namesCache = {} }: { personal?: boolean; namesCache?: Record<string, string> } = {},
|
|
54
32
|
): string | [string, { ns: string }] => {
|
|
55
33
|
return space.state.get() === SpaceState.SPACE_READY && (space.properties.name?.length ?? 0) > 0
|
|
56
|
-
? space.properties.name
|
|
34
|
+
? space.properties.name!
|
|
57
35
|
: namesCache[space.id]
|
|
58
36
|
? namesCache[space.id]
|
|
59
37
|
: personal
|
|
@@ -63,22 +41,18 @@ export const getSpaceDisplayName = (
|
|
|
63
41
|
|
|
64
42
|
const getCollectionGraphNodePartials = ({
|
|
65
43
|
collection,
|
|
66
|
-
|
|
44
|
+
db,
|
|
67
45
|
resolve,
|
|
68
46
|
}: {
|
|
69
|
-
collection:
|
|
70
|
-
|
|
47
|
+
collection: Collection.Collection;
|
|
48
|
+
db: Database.Database;
|
|
71
49
|
resolve: (typename: string) => Record<string, any>;
|
|
72
50
|
}) => {
|
|
73
51
|
return {
|
|
74
52
|
acceptPersistenceClass: new Set(['echo']),
|
|
75
|
-
acceptPersistenceKey: new Set([
|
|
53
|
+
acceptPersistenceKey: new Set([db.spaceId]),
|
|
76
54
|
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) => {
|
|
55
|
+
onTransferStart: (child: Node.Node<Obj.Unknown>, index?: number) => {
|
|
82
56
|
// TODO(wittjosiah): Support transfer between spaces.
|
|
83
57
|
// const childSpace = getSpace(child.data);
|
|
84
58
|
// if (space && childSpace && !childSpace.key.equals(space.key)) {
|
|
@@ -97,22 +71,26 @@ const getCollectionGraphNodePartials = ({
|
|
|
97
71
|
|
|
98
72
|
// Add child to destination collection.
|
|
99
73
|
// TODO(dmaretskyi): Compare by id.
|
|
100
|
-
|
|
101
|
-
if (
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
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
|
+
}
|
|
105
81
|
}
|
|
106
|
-
}
|
|
82
|
+
});
|
|
107
83
|
|
|
108
84
|
// }
|
|
109
85
|
},
|
|
110
|
-
onTransferEnd: (child: Node<Obj.
|
|
86
|
+
onTransferEnd: (child: Node.Node<Obj.Unknown>, destination: Node.Node) => {
|
|
111
87
|
// Remove child from origin collection.
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
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
|
+
});
|
|
116
94
|
|
|
117
95
|
// TODO(wittjosiah): Support transfer between spaces.
|
|
118
96
|
// const childSpace = getSpace(child.data);
|
|
@@ -123,47 +101,38 @@ const getCollectionGraphNodePartials = ({
|
|
|
123
101
|
// childSpace.db.remove(child.data);
|
|
124
102
|
// }
|
|
125
103
|
},
|
|
126
|
-
onCopy: async (child: Node<Obj.
|
|
104
|
+
onCopy: async (child: Node.Node<Obj.Unknown>, index?: number) => {
|
|
127
105
|
// Create clone of child and add to destination space.
|
|
128
|
-
const newObject = await cloneObject(child.data, resolve,
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
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
|
+
});
|
|
135
115
|
},
|
|
136
116
|
};
|
|
137
117
|
};
|
|
138
118
|
|
|
139
|
-
const
|
|
119
|
+
const getSystemCollectionNodePartials = ({
|
|
140
120
|
collection,
|
|
141
|
-
|
|
121
|
+
db,
|
|
142
122
|
resolve,
|
|
143
123
|
}: {
|
|
144
|
-
collection:
|
|
145
|
-
|
|
124
|
+
collection: Collection.Managed;
|
|
125
|
+
db: Database.Database;
|
|
146
126
|
resolve: (typename: string) => Record<string, any>;
|
|
147
127
|
}) => {
|
|
148
|
-
const
|
|
149
|
-
const metadata = typename ? resolve(typename) : {};
|
|
128
|
+
const metadata = resolve(collection.key);
|
|
150
129
|
return {
|
|
130
|
+
label: ['typename label', { ns: collection.key, count: 2 }],
|
|
151
131
|
icon: metadata.icon,
|
|
152
132
|
iconHue: metadata.iconHue,
|
|
153
133
|
acceptPersistenceClass: new Set(['echo']),
|
|
154
|
-
acceptPersistenceKey: new Set([
|
|
134
|
+
acceptPersistenceKey: new Set([db.spaceId]),
|
|
155
135
|
role: 'branch',
|
|
156
|
-
canDrop: (source: TreeData) => {
|
|
157
|
-
return (
|
|
158
|
-
isGraphNode(source.item) && Obj.isObject(source.item.data) && Obj.getTypename(source.item.data) === typename
|
|
159
|
-
);
|
|
160
|
-
},
|
|
161
|
-
onTransferStart: (child: Node<Obj.Any>, index?: number) => {
|
|
162
|
-
// No-op. Objects are moved into query collections by being removed from their original collection.
|
|
163
|
-
},
|
|
164
|
-
onTransferEnd: (child: Node<Obj.Any>, destination: Node) => {
|
|
165
|
-
// No-op. Objects are moved out of query collections by being added to another collection.
|
|
166
|
-
},
|
|
167
136
|
};
|
|
168
137
|
};
|
|
169
138
|
|
|
@@ -174,25 +143,6 @@ const getSchemaGraphNodePartials = () => {
|
|
|
174
143
|
};
|
|
175
144
|
};
|
|
176
145
|
|
|
177
|
-
const getViewGraphNodePartials = ({
|
|
178
|
-
view,
|
|
179
|
-
resolve,
|
|
180
|
-
}: {
|
|
181
|
-
view: DataType.View;
|
|
182
|
-
resolve: (typename: string) => Record<string, any>;
|
|
183
|
-
}) => {
|
|
184
|
-
const presentation = view.presentation.target;
|
|
185
|
-
const typename = presentation ? Obj.getTypename(presentation) : undefined;
|
|
186
|
-
const metadata = typename ? resolve(typename) : {};
|
|
187
|
-
|
|
188
|
-
return {
|
|
189
|
-
label: view.name || ['object name placeholder', { ns: typename, default: 'New view' }],
|
|
190
|
-
icon: metadata.icon,
|
|
191
|
-
iconHue: metadata.iconHue,
|
|
192
|
-
canDrop: () => false,
|
|
193
|
-
};
|
|
194
|
-
};
|
|
195
|
-
|
|
196
146
|
const checkPendingMigration = (space: Space) => {
|
|
197
147
|
return (
|
|
198
148
|
space.state.get() === SpaceState.SPACE_REQUIRES_MIGRATION ||
|
|
@@ -208,21 +158,46 @@ export const constructSpaceNode = ({
|
|
|
208
158
|
personal,
|
|
209
159
|
namesCache,
|
|
210
160
|
resolve,
|
|
161
|
+
graph,
|
|
162
|
+
spacesOrder,
|
|
211
163
|
}: {
|
|
212
164
|
space: Space;
|
|
213
165
|
navigable?: boolean;
|
|
214
166
|
personal?: boolean;
|
|
215
167
|
namesCache?: Record<string, string>;
|
|
216
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;
|
|
217
174
|
}) => {
|
|
218
175
|
const hasPendingMigration = checkPendingMigration(space);
|
|
219
176
|
const collection =
|
|
220
|
-
space.state.get() === SpaceState.SPACE_READY && space.properties[
|
|
177
|
+
space.state.get() === SpaceState.SPACE_READY && space.properties[Collection.Collection.typename]?.target;
|
|
221
178
|
const partials =
|
|
222
|
-
space.state.get() === SpaceState.SPACE_READY && Obj.instanceOf(
|
|
223
|
-
? getCollectionGraphNodePartials({ collection, space, resolve })
|
|
179
|
+
space.state.get() === SpaceState.SPACE_READY && Obj.instanceOf(Collection.Collection, collection)
|
|
180
|
+
? getCollectionGraphNodePartials({ collection, db: space.db, resolve })
|
|
224
181
|
: {};
|
|
225
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
|
+
|
|
226
201
|
return {
|
|
227
202
|
id: space.id,
|
|
228
203
|
type: SPACE_TYPE,
|
|
@@ -239,7 +214,9 @@ export const constructSpaceNode = ({
|
|
|
239
214
|
: undefined,
|
|
240
215
|
iconHue: space.state.get() === SpaceState.SPACE_READY && space.properties.iconHue,
|
|
241
216
|
disabled: !navigable || space.state.get() !== SpaceState.SPACE_READY || hasPendingMigration,
|
|
217
|
+
disposition: 'workspace',
|
|
242
218
|
testId: 'spacePlugin.space',
|
|
219
|
+
onRearrange,
|
|
243
220
|
canDrop: (source: TreeData) => {
|
|
244
221
|
// TODO(wittjosiah): Find a way to only allow space as source for rearranging.
|
|
245
222
|
return Obj.isObject(source.item.data) || isSpace(source.item.data);
|
|
@@ -264,6 +241,7 @@ export const constructSpaceNode = ({
|
|
|
264
241
|
label: ['space settings properties label', { ns: meta.id }],
|
|
265
242
|
icon: 'ph--sliders--regular',
|
|
266
243
|
position: 'hoist',
|
|
244
|
+
testId: 'spacePlugin.general',
|
|
267
245
|
},
|
|
268
246
|
},
|
|
269
247
|
{
|
|
@@ -274,6 +252,7 @@ export const constructSpaceNode = ({
|
|
|
274
252
|
label: ['members panel label', { ns: meta.id }],
|
|
275
253
|
icon: 'ph--users--regular',
|
|
276
254
|
position: 'hoist',
|
|
255
|
+
testId: 'spacePlugin.members',
|
|
277
256
|
},
|
|
278
257
|
},
|
|
279
258
|
{
|
|
@@ -283,6 +262,7 @@ export const constructSpaceNode = ({
|
|
|
283
262
|
properties: {
|
|
284
263
|
label: ['space settings schema label', { ns: meta.id }],
|
|
285
264
|
icon: 'ph--shapes--regular',
|
|
265
|
+
testId: 'spacePlugin.schema',
|
|
286
266
|
},
|
|
287
267
|
},
|
|
288
268
|
],
|
|
@@ -293,27 +273,23 @@ export const constructSpaceNode = ({
|
|
|
293
273
|
|
|
294
274
|
export const constructSpaceActions = ({
|
|
295
275
|
space,
|
|
296
|
-
dispatch,
|
|
297
276
|
personal,
|
|
298
277
|
migrating,
|
|
299
278
|
}: {
|
|
300
279
|
space: Space;
|
|
301
|
-
dispatch: PromiseIntentDispatcher;
|
|
302
280
|
personal?: boolean;
|
|
303
281
|
migrating?: boolean;
|
|
304
282
|
}) => {
|
|
305
283
|
const state = space.state.get();
|
|
306
284
|
const hasPendingMigration = checkPendingMigration(space);
|
|
307
285
|
const getId = (id: string) => `${id}/${space.id}`;
|
|
308
|
-
const actions: NodeArg<ActionData
|
|
286
|
+
const actions: Node.NodeArg<Node.ActionData<Operation.Service>>[] = [];
|
|
309
287
|
|
|
310
288
|
if (hasPendingMigration) {
|
|
311
289
|
actions.push({
|
|
312
|
-
id: getId(
|
|
313
|
-
type:
|
|
314
|
-
data:
|
|
315
|
-
await dispatch(createIntent(SpaceAction.Migrate, { space }));
|
|
316
|
-
},
|
|
290
|
+
id: getId(SpaceOperation.Migrate.meta.key),
|
|
291
|
+
type: Node.ActionGroupType,
|
|
292
|
+
data: () => Operation.invoke(SpaceOperation.Migrate, { space }),
|
|
317
293
|
properties: {
|
|
318
294
|
label: ['migrate space label', { ns: meta.id }],
|
|
319
295
|
icon: 'ph--database--regular',
|
|
@@ -326,11 +302,9 @@ export const constructSpaceActions = ({
|
|
|
326
302
|
if (state === SpaceState.SPACE_READY && !hasPendingMigration) {
|
|
327
303
|
actions.push(
|
|
328
304
|
{
|
|
329
|
-
id: getId(
|
|
330
|
-
type:
|
|
331
|
-
data:
|
|
332
|
-
await dispatch(createIntent(SpaceAction.OpenCreateObject, { target: space }));
|
|
333
|
-
},
|
|
305
|
+
id: getId(SpaceOperation.OpenCreateObject.meta.key),
|
|
306
|
+
type: Node.ActionType,
|
|
307
|
+
data: () => Operation.invoke(SpaceOperation.OpenCreateObject, { target: space.db }),
|
|
334
308
|
properties: {
|
|
335
309
|
label: ['create object in space label', { ns: meta.id }],
|
|
336
310
|
icon: 'ph--plus--regular',
|
|
@@ -339,11 +313,9 @@ export const constructSpaceActions = ({
|
|
|
339
313
|
},
|
|
340
314
|
},
|
|
341
315
|
{
|
|
342
|
-
id: getId(
|
|
343
|
-
type:
|
|
344
|
-
data:
|
|
345
|
-
await dispatch(createIntent(SpaceAction.Rename, { space, caller: params?.caller }));
|
|
346
|
-
},
|
|
316
|
+
id: getId(SpaceOperation.Rename.meta.key),
|
|
317
|
+
type: Node.ActionType,
|
|
318
|
+
data: (params?: Node.InvokeProps) => Operation.invoke(SpaceOperation.Rename, { space, caller: params?.caller }),
|
|
347
319
|
properties: {
|
|
348
320
|
label: ['rename space label', { ns: meta.id }],
|
|
349
321
|
icon: 'ph--pencil-simple-line--regular',
|
|
@@ -359,13 +331,13 @@ export const constructSpaceActions = ({
|
|
|
359
331
|
return actions;
|
|
360
332
|
};
|
|
361
333
|
|
|
362
|
-
export const createStaticSchemaNode = ({ schema, space }: { schema: Type.
|
|
334
|
+
export const createStaticSchemaNode = ({ schema, space }: { schema: Type.Entity.Any; space: Space }): Node.Node => {
|
|
363
335
|
return {
|
|
364
336
|
id: `${space.id}/${Type.getTypename(schema)}`,
|
|
365
337
|
type: `${meta.id}/static-schema`,
|
|
366
338
|
data: schema,
|
|
367
339
|
properties: {
|
|
368
|
-
label: ['typename label', { ns: Type.getTypename(schema), default: Type.getTypename(schema) }],
|
|
340
|
+
label: ['typename label', { ns: Type.getTypename(schema), count: 2, default: Type.getTypename(schema) }],
|
|
369
341
|
icon: 'ph--database--regular',
|
|
370
342
|
iconHue: 'green',
|
|
371
343
|
role: 'branch',
|
|
@@ -379,44 +351,37 @@ export const createStaticSchemaNode = ({ schema, space }: { schema: Type.Obj.Any
|
|
|
379
351
|
export const createStaticSchemaActions = ({
|
|
380
352
|
schema,
|
|
381
353
|
space,
|
|
382
|
-
dispatch,
|
|
383
354
|
deletable,
|
|
384
355
|
}: {
|
|
385
356
|
schema: Type.Obj.Any;
|
|
386
357
|
space: Space;
|
|
387
|
-
dispatch: PromiseIntentDispatcher;
|
|
388
358
|
deletable: boolean;
|
|
389
359
|
}) => {
|
|
390
360
|
const getId = (id: string) => `${space.id}/${Type.getTypename(schema)}/${id}`;
|
|
391
361
|
|
|
392
|
-
const actions: NodeArg<ActionData
|
|
362
|
+
const actions: Node.NodeArg<Node.ActionData<Operation.Service>>[] = [
|
|
393
363
|
{
|
|
394
|
-
id: getId(
|
|
395
|
-
type:
|
|
396
|
-
data:
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
}),
|
|
403
|
-
);
|
|
404
|
-
},
|
|
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
|
+
}),
|
|
405
372
|
properties: {
|
|
406
|
-
label: ['add view to schema label', { ns:
|
|
373
|
+
label: ['add view to schema label', { ns: meta.id }],
|
|
407
374
|
icon: 'ph--plus--regular',
|
|
408
375
|
disposition: 'list-item-primary',
|
|
409
376
|
testId: 'spacePlugin.addViewToSchema',
|
|
410
377
|
},
|
|
411
378
|
},
|
|
412
379
|
{
|
|
413
|
-
id: getId(
|
|
414
|
-
type:
|
|
415
|
-
data:
|
|
416
|
-
throw new Error('Not implemented');
|
|
417
|
-
},
|
|
380
|
+
id: getId(SpaceOperation.RenameObject.meta.key),
|
|
381
|
+
type: Node.ActionType,
|
|
382
|
+
data: () => Effect.fail(new Error('Not implemented')),
|
|
418
383
|
properties: {
|
|
419
|
-
label: ['rename object label', { ns: Type.getTypename(
|
|
384
|
+
label: ['rename object label', { ns: Type.getTypename(Type.PersistentType) }],
|
|
420
385
|
icon: 'ph--pencil-simple-line--regular',
|
|
421
386
|
disabled: true,
|
|
422
387
|
disposition: 'list-item',
|
|
@@ -424,43 +389,71 @@ export const createStaticSchemaActions = ({
|
|
|
424
389
|
},
|
|
425
390
|
},
|
|
426
391
|
{
|
|
427
|
-
id: getId(
|
|
428
|
-
type:
|
|
429
|
-
data:
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
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
|
+
}),
|
|
437
405
|
properties: {
|
|
438
|
-
label: ['delete object label', { ns: Type.getTypename(
|
|
406
|
+
label: ['delete object label', { ns: Type.getTypename(Type.PersistentType) }],
|
|
439
407
|
icon: 'ph--trash--regular',
|
|
440
408
|
disposition: 'list-item',
|
|
441
409
|
disabled: !deletable,
|
|
442
410
|
testId: 'spacePlugin.deleteObject',
|
|
443
411
|
},
|
|
444
412
|
},
|
|
413
|
+
{
|
|
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' })),
|
|
424
|
+
);
|
|
425
|
+
}
|
|
426
|
+
}),
|
|
427
|
+
properties: {
|
|
428
|
+
label: ['snapshot by schema label', { ns: meta.id }],
|
|
429
|
+
icon: 'ph--camera--regular',
|
|
430
|
+
disposition: 'list-item',
|
|
431
|
+
},
|
|
432
|
+
},
|
|
445
433
|
];
|
|
446
434
|
|
|
447
435
|
return actions;
|
|
448
436
|
};
|
|
449
437
|
|
|
450
438
|
export const createObjectNode = ({
|
|
451
|
-
|
|
439
|
+
db,
|
|
452
440
|
object,
|
|
453
441
|
disposition,
|
|
454
442
|
droppable = true,
|
|
455
443
|
navigable = false,
|
|
444
|
+
managedCollectionChild = false,
|
|
456
445
|
resolve,
|
|
446
|
+
parentCollection,
|
|
457
447
|
}: {
|
|
458
|
-
|
|
459
|
-
object: Obj.
|
|
448
|
+
db: Database.Database;
|
|
449
|
+
object: Obj.Unknown;
|
|
460
450
|
disposition?: string;
|
|
461
451
|
droppable?: boolean;
|
|
462
452
|
navigable?: boolean;
|
|
453
|
+
managedCollectionChild?: boolean;
|
|
463
454
|
resolve: (typename: string) => Record<string, any>;
|
|
455
|
+
/** Parent collection for rearranging objects. */
|
|
456
|
+
parentCollection?: Collection.Collection;
|
|
464
457
|
}) => {
|
|
465
458
|
const type = Obj.getTypename(object);
|
|
466
459
|
if (!type) {
|
|
@@ -468,15 +461,13 @@ export const createObjectNode = ({
|
|
|
468
461
|
}
|
|
469
462
|
|
|
470
463
|
const metadata = resolve(type);
|
|
471
|
-
const partials = Obj.instanceOf(
|
|
472
|
-
? getCollectionGraphNodePartials({ collection: object,
|
|
473
|
-
: Obj.instanceOf(
|
|
474
|
-
?
|
|
475
|
-
: Obj.instanceOf(
|
|
464
|
+
const partials = Obj.instanceOf(Collection.Collection, object)
|
|
465
|
+
? getCollectionGraphNodePartials({ collection: object, db, resolve })
|
|
466
|
+
: Obj.instanceOf(Collection.Managed, object)
|
|
467
|
+
? getSystemCollectionNodePartials({ collection: object, db, resolve })
|
|
468
|
+
: Obj.instanceOf(Type.PersistentType, object)
|
|
476
469
|
? getSchemaGraphNodePartials()
|
|
477
|
-
:
|
|
478
|
-
? getViewGraphNodePartials({ view: object, resolve })
|
|
479
|
-
: metadata.graphProps;
|
|
470
|
+
: metadata.graphProps;
|
|
480
471
|
|
|
481
472
|
// TODO(wittjosiah): Obj.getLabel isn't triggering reactivity in some cases.
|
|
482
473
|
// e.g., create new collection with no name and rename it.
|
|
@@ -486,13 +477,13 @@ export const createObjectNode = ({
|
|
|
486
477
|
metadata.label?.(object) || ['object name placeholder', { ns: type, default: 'New item' }];
|
|
487
478
|
|
|
488
479
|
const selectable =
|
|
489
|
-
(!Obj.instanceOf(
|
|
490
|
-
!Obj.instanceOf(
|
|
491
|
-
!Obj.instanceOf(
|
|
492
|
-
(navigable && Obj.instanceOf(
|
|
480
|
+
(!Obj.instanceOf(Type.PersistentType, object) &&
|
|
481
|
+
!Obj.instanceOf(Collection.Managed, object) &&
|
|
482
|
+
!Obj.instanceOf(Collection.Collection, object)) ||
|
|
483
|
+
(navigable && Obj.instanceOf(Collection.Collection, object));
|
|
493
484
|
|
|
494
485
|
return {
|
|
495
|
-
id:
|
|
486
|
+
id: Obj.getDXN(object).toString(),
|
|
496
487
|
type,
|
|
497
488
|
cacheable: ['label', 'icon', 'role'],
|
|
498
489
|
data: object,
|
|
@@ -503,10 +494,31 @@ export const createObjectNode = ({
|
|
|
503
494
|
disposition,
|
|
504
495
|
testId: 'spacePlugin.object',
|
|
505
496
|
persistenceClass: 'echo',
|
|
506
|
-
persistenceKey:
|
|
497
|
+
persistenceKey: db.spaceId,
|
|
507
498
|
selectable,
|
|
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,
|
|
507
|
+
blockInstruction: (source: TreeData, instruction: Instruction) => {
|
|
508
|
+
if (source.item.properties.managedCollectionChild) {
|
|
509
|
+
// TODO(wittjosiah): Support reordering system collections.
|
|
510
|
+
// return !(managedCollectionChild && source.item.type === type && instruction.type.startsWith('reorder'));
|
|
511
|
+
return true;
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
if (Obj.instanceOf(Collection.Managed, object)) {
|
|
515
|
+
return !instruction.type.startsWith('reorder');
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
return managedCollectionChild;
|
|
519
|
+
},
|
|
508
520
|
canDrop: (source: TreeData) => {
|
|
509
|
-
return droppable && isGraphNode(source.item) && Obj.isObject(source.item.data);
|
|
521
|
+
return droppable && Node.isGraphNode(source.item) && Obj.isObject(source.item.data);
|
|
510
522
|
},
|
|
511
523
|
...partials,
|
|
512
524
|
},
|
|
@@ -516,39 +528,37 @@ export const createObjectNode = ({
|
|
|
516
528
|
export const constructObjectActions = ({
|
|
517
529
|
object,
|
|
518
530
|
graph,
|
|
519
|
-
|
|
520
|
-
|
|
531
|
+
resolve,
|
|
532
|
+
capabilities,
|
|
521
533
|
deletable = true,
|
|
522
534
|
navigable = false,
|
|
523
535
|
}: {
|
|
524
|
-
object: Obj.
|
|
525
|
-
graph: ReadableGraph;
|
|
526
|
-
|
|
527
|
-
|
|
536
|
+
object: Obj.Unknown;
|
|
537
|
+
graph: Graph.ReadableGraph;
|
|
538
|
+
resolve: (typename: string) => Record<string, any>;
|
|
539
|
+
capabilities: CapabilityManager.CapabilityManager;
|
|
528
540
|
deletable?: boolean;
|
|
529
541
|
navigable?: boolean;
|
|
530
542
|
}) => {
|
|
531
|
-
const
|
|
532
|
-
invariant(
|
|
543
|
+
const db = Obj.getDatabase(object);
|
|
544
|
+
invariant(db, 'Database not found');
|
|
533
545
|
const typename = Obj.getTypename(object);
|
|
534
546
|
invariant(typename, 'Object has no typename');
|
|
535
547
|
|
|
536
|
-
const getId = (id: string) => `${id}/${
|
|
548
|
+
const getId = (id: string) => `${id}/${Obj.getDXN(object).toString()}`;
|
|
537
549
|
|
|
538
|
-
const
|
|
539
|
-
const
|
|
540
|
-
|
|
541
|
-
|
|
550
|
+
const managedCollection = Obj.instanceOf(Collection.Managed, object) ? object : undefined;
|
|
551
|
+
const metadata = managedCollection ? resolve(managedCollection.key) : {};
|
|
552
|
+
const createObject = metadata.createObject;
|
|
553
|
+
const inputSchema = metadata.inputSchema;
|
|
542
554
|
|
|
543
|
-
const actions: NodeArg<ActionData
|
|
544
|
-
...(Obj.instanceOf(
|
|
555
|
+
const actions: Node.NodeArg<Node.ActionData<Operation.Service>>[] = [
|
|
556
|
+
...(Obj.instanceOf(Collection.Collection, object)
|
|
545
557
|
? [
|
|
546
558
|
{
|
|
547
|
-
id: getId(
|
|
548
|
-
type:
|
|
549
|
-
data:
|
|
550
|
-
await dispatch(createIntent(SpaceAction.OpenCreateObject, { target: object }));
|
|
551
|
-
},
|
|
559
|
+
id: getId(SpaceOperation.OpenCreateObject.meta.key),
|
|
560
|
+
type: Node.ActionType,
|
|
561
|
+
data: () => Operation.invoke(SpaceOperation.OpenCreateObject, { target: object }),
|
|
552
562
|
properties: {
|
|
553
563
|
label: ['create object in collection label', { ns: meta.id }],
|
|
554
564
|
icon: 'ph--plus--regular',
|
|
@@ -558,54 +568,75 @@ export const constructObjectActions = ({
|
|
|
558
568
|
},
|
|
559
569
|
]
|
|
560
570
|
: []),
|
|
561
|
-
...(Obj.instanceOf(
|
|
571
|
+
...(Obj.instanceOf(Type.PersistentType, object)
|
|
562
572
|
? [
|
|
563
573
|
{
|
|
564
|
-
id: getId(
|
|
565
|
-
type:
|
|
566
|
-
data:
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
}),
|
|
573
|
-
);
|
|
574
|
-
},
|
|
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
|
+
}),
|
|
575
582
|
properties: {
|
|
576
|
-
label: ['add view to schema label', { ns:
|
|
583
|
+
label: ['add view to schema label', { ns: meta.id }],
|
|
577
584
|
icon: 'ph--plus--regular',
|
|
578
585
|
disposition: 'list-item-primary',
|
|
579
586
|
testId: 'spacePlugin.addViewToSchema',
|
|
580
587
|
},
|
|
581
588
|
},
|
|
589
|
+
{
|
|
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' })),
|
|
600
|
+
);
|
|
601
|
+
}
|
|
602
|
+
}),
|
|
603
|
+
properties: {
|
|
604
|
+
label: ['snapshot by schema label', { ns: meta.id }],
|
|
605
|
+
icon: 'ph--camera--regular',
|
|
606
|
+
disposition: 'list-item',
|
|
607
|
+
},
|
|
608
|
+
},
|
|
582
609
|
]
|
|
583
610
|
: []),
|
|
584
|
-
...(
|
|
611
|
+
...(createObject
|
|
585
612
|
? [
|
|
586
613
|
{
|
|
587
|
-
id: getId(
|
|
588
|
-
type:
|
|
589
|
-
data:
|
|
590
|
-
if (
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
}),
|
|
596
|
-
);
|
|
614
|
+
id: getId(SpaceOperation.OpenCreateObject.meta.key),
|
|
615
|
+
type: Node.ActionType,
|
|
616
|
+
data: Effect.fnUntraced(function* () {
|
|
617
|
+
if (inputSchema) {
|
|
618
|
+
yield* Operation.invoke(SpaceOperation.OpenCreateObject, {
|
|
619
|
+
target: db,
|
|
620
|
+
typename: managedCollection ? managedCollection.key : undefined,
|
|
621
|
+
});
|
|
597
622
|
} else {
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
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
|
+
}
|
|
605
636
|
}
|
|
606
|
-
},
|
|
637
|
+
}),
|
|
607
638
|
properties: {
|
|
608
|
-
label: ['create object in
|
|
639
|
+
label: ['create object in system collection label', { ns: meta.id }],
|
|
609
640
|
icon: 'ph--plus--regular',
|
|
610
641
|
disposition: 'list-item-primary',
|
|
611
642
|
testId: 'spacePlugin.createObject',
|
|
@@ -613,54 +644,59 @@ export const constructObjectActions = ({
|
|
|
613
644
|
},
|
|
614
645
|
]
|
|
615
646
|
: []),
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
647
|
+
...(managedCollection
|
|
648
|
+
? []
|
|
649
|
+
: [
|
|
650
|
+
{
|
|
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 }),
|
|
655
|
+
properties: {
|
|
656
|
+
label: ['rename object label', { ns: typename }],
|
|
657
|
+
icon: 'ph--pencil-simple-line--regular',
|
|
658
|
+
disposition: 'list-item',
|
|
659
|
+
// TODO(wittjosiah): Not working.
|
|
660
|
+
// keyBinding: {
|
|
661
|
+
// macos: 'shift+F6',
|
|
662
|
+
// },
|
|
663
|
+
testId: 'spacePlugin.renameObject',
|
|
664
|
+
},
|
|
665
|
+
},
|
|
666
|
+
{
|
|
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
|
+
}),
|
|
676
|
+
properties: {
|
|
677
|
+
label: ['delete object label', { ns: typename }],
|
|
678
|
+
icon: 'ph--trash--regular',
|
|
679
|
+
disposition: 'list-item',
|
|
680
|
+
disabled: !deletable,
|
|
681
|
+
// TODO(wittjosiah): This is a browser shortcut.
|
|
682
|
+
// keyBinding: object instanceof CollectionType ? undefined : 'shift+meta+Backspace',
|
|
683
|
+
testId: 'spacePlugin.deleteObject',
|
|
684
|
+
},
|
|
685
|
+
},
|
|
686
|
+
]),
|
|
652
687
|
...(navigable ||
|
|
653
|
-
(!Obj.instanceOf(
|
|
654
|
-
!Obj.instanceOf(
|
|
655
|
-
!Obj.instanceOf(
|
|
688
|
+
(!Obj.instanceOf(Collection.Collection, object) &&
|
|
689
|
+
!Obj.instanceOf(Collection.Managed, object) &&
|
|
690
|
+
!Obj.instanceOf(Type.PersistentType, object))
|
|
656
691
|
? [
|
|
657
692
|
{
|
|
658
693
|
id: getId('copy-link'),
|
|
659
|
-
type:
|
|
660
|
-
data:
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
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
|
+
}),
|
|
664
700
|
properties: {
|
|
665
701
|
label: ['copy link label', { ns: meta.id }],
|
|
666
702
|
icon: 'ph--link--regular',
|
|
@@ -672,11 +708,9 @@ export const constructObjectActions = ({
|
|
|
672
708
|
: []),
|
|
673
709
|
// TODO(wittjosiah): Factor out and apply to all nodes.
|
|
674
710
|
{
|
|
675
|
-
id: getId(
|
|
676
|
-
type:
|
|
677
|
-
data:
|
|
678
|
-
await dispatch(createIntent(LayoutAction.Expose, { part: 'navigation', subject: fullyQualifiedId(object) }));
|
|
679
|
-
},
|
|
711
|
+
id: getId(Common.LayoutOperation.Expose.meta.key),
|
|
712
|
+
type: Node.ActionType,
|
|
713
|
+
data: () => Operation.invoke(Common.LayoutOperation.Expose, { subject: Obj.getDXN(object).toString() }),
|
|
680
714
|
properties: {
|
|
681
715
|
label: ['expose object label', { ns: meta.id }],
|
|
682
716
|
icon: 'ph--eye--regular',
|
|
@@ -689,13 +723,27 @@ export const constructObjectActions = ({
|
|
|
689
723
|
return actions;
|
|
690
724
|
};
|
|
691
725
|
|
|
726
|
+
// TODO(wittjosiah): Factor out.
|
|
727
|
+
const downloadBlob = async (blob: Blob, filename: string) => {
|
|
728
|
+
const url = URL.createObjectURL(blob);
|
|
729
|
+
const a = document.createElement('a');
|
|
730
|
+
a.href = url;
|
|
731
|
+
a.download = filename;
|
|
732
|
+
|
|
733
|
+
document.body.appendChild(a);
|
|
734
|
+
a.click();
|
|
735
|
+
|
|
736
|
+
document.body.removeChild(a);
|
|
737
|
+
URL.revokeObjectURL(url);
|
|
738
|
+
};
|
|
739
|
+
|
|
692
740
|
/**
|
|
693
741
|
* @deprecated This is a temporary solution.
|
|
694
742
|
*/
|
|
695
743
|
export const getNestedObjects = async (
|
|
696
|
-
object: Obj.
|
|
744
|
+
object: Obj.Unknown,
|
|
697
745
|
resolve: (typename: string) => Record<string, any>,
|
|
698
|
-
): Promise<Obj.
|
|
746
|
+
): Promise<Obj.Unknown[]> => {
|
|
699
747
|
const type = Obj.getTypename(object);
|
|
700
748
|
if (!type) {
|
|
701
749
|
return [];
|
|
@@ -707,7 +755,7 @@ export const getNestedObjects = async (
|
|
|
707
755
|
return [];
|
|
708
756
|
}
|
|
709
757
|
|
|
710
|
-
const objects: Obj.
|
|
758
|
+
const objects: Obj.Unknown[] = await loadReferences(object);
|
|
711
759
|
const nested = await Promise.all(objects.map((object) => getNestedObjects(object, resolve)));
|
|
712
760
|
return [...objects, ...nested.flat()];
|
|
713
761
|
};
|
|
@@ -717,15 +765,15 @@ export const getNestedObjects = async (
|
|
|
717
765
|
*/
|
|
718
766
|
// TODO(burdon): Remove.
|
|
719
767
|
export const cloneObject = async (
|
|
720
|
-
object:
|
|
768
|
+
object: Obj.Unknown,
|
|
721
769
|
resolve: (typename: string) => Record<string, any>,
|
|
722
|
-
|
|
723
|
-
): Promise<
|
|
770
|
+
newDb: Database.Database,
|
|
771
|
+
): Promise<Obj.Unknown> => {
|
|
724
772
|
const schema = Obj.getSchema(object);
|
|
725
|
-
const typename = schema ? (Type.getTypename(schema) ??
|
|
773
|
+
const typename = schema ? (Type.getTypename(schema) ?? Expando.Expando.typename) : Expando.Expando.typename;
|
|
726
774
|
const metadata = resolve(typename);
|
|
727
775
|
const serializer = metadata.serializer;
|
|
728
776
|
invariant(serializer, `No serializer for type: ${typename}`);
|
|
729
777
|
const content = await serializer.serialize({ object });
|
|
730
|
-
return serializer.deserialize({ content,
|
|
778
|
+
return serializer.deserialize({ content, db: newDb, newId: true });
|
|
731
779
|
};
|