@dxos/plugin-space 0.8.4-main.b97322e → 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-HSMQFM57.mjs +16 -0
- package/dist/lib/browser/chunk-HSMQFM57.mjs.map +7 -0
- package/dist/lib/browser/chunk-SUI34XSA.mjs +772 -0
- 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-QACNNDOT.mjs → chunk-ZT2VPYRM.mjs} +70 -62
- 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 +236 -262
- 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-P442DOQ3.mjs → chunk-2SW6S2BB.mjs} +70 -62
- package/dist/lib/node-esm/chunk-2SW6S2BB.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-7KMYUWSR.mjs +773 -0
- 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-SL4BJSUG.mjs +18 -0
- 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 +236 -262
- 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 -21
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/operation-resolver/index.d.ts +6 -0
- package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +9 -0
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-root/index.d.ts +6 -0
- package/dist/types/src/capabilities/react-root/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-root/react-root.d.ts +9 -0
- package/dist/types/src/capabilities/react-root/react-root.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface/index.d.ts +5 -0
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts +8 -0
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -0
- package/dist/types/src/capabilities/repair/index.d.ts +3 -0
- package/dist/types/src/capabilities/repair/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/repair/repair.d.ts +6 -0
- package/dist/types/src/capabilities/repair/repair.d.ts.map +1 -0
- package/dist/types/src/capabilities/settings/index.d.ts +7 -0
- package/dist/types/src/capabilities/settings/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/settings/settings.d.ts +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 +5 -5
- package/dist/types/src/components/CreateDialog/CreateObjectDialog.d.ts.map +1 -1
- package/dist/types/src/components/CreateDialog/CreateObjectDialog.stories.d.ts +1602 -8
- package/dist/types/src/components/CreateDialog/CreateObjectDialog.stories.d.ts.map +1 -1
- package/dist/types/src/components/CreateDialog/CreateObjectPanel.d.ts +20 -10
- package/dist/types/src/components/CreateDialog/CreateObjectPanel.d.ts.map +1 -1
- package/dist/types/src/components/CreateDialog/CreateSpaceDialog.d.ts +1 -1
- package/dist/types/src/components/CreateDialog/CreateSpaceDialog.d.ts.map +1 -1
- package/dist/types/src/components/{JoinDialog.d.ts → JoinDialog/JoinDialog.d.ts} +1 -1
- package/dist/types/src/components/JoinDialog/JoinDialog.d.ts.map +1 -0
- package/dist/types/src/components/JoinDialog/index.d.ts +2 -0
- package/dist/types/src/components/JoinDialog/index.d.ts.map +1 -0
- package/dist/types/src/components/{MembersContainer.d.ts → MembersContainer/MembersContainer.d.ts} +3 -2
- package/dist/types/src/components/MembersContainer/MembersContainer.d.ts.map +1 -0
- package/dist/types/src/components/MembersContainer/MembersContainer.stories.d.ts +1600 -0
- package/dist/types/src/components/MembersContainer/MembersContainer.stories.d.ts.map +1 -0
- package/dist/types/src/components/MembersContainer/index.d.ts +2 -0
- package/dist/types/src/components/MembersContainer/index.d.ts.map +1 -0
- package/dist/types/src/components/MenuFooter.d.ts +1 -1
- package/dist/types/src/components/MenuFooter.d.ts.map +1 -1
- package/dist/types/src/components/ObjectCardStack/ObjectCardStack.d.ts +8 -0
- package/dist/types/src/components/ObjectCardStack/ObjectCardStack.d.ts.map +1 -0
- package/dist/types/src/components/ObjectCardStack/ObjectForm.d.ts +9 -0
- package/dist/types/src/components/ObjectCardStack/ObjectForm.d.ts.map +1 -0
- package/dist/types/src/components/ObjectCardStack/index.d.ts +3 -0
- package/dist/types/src/components/ObjectCardStack/index.d.ts.map +1 -0
- package/dist/types/src/components/{ObjectSettings → ObjectDetails}/BaseObjectSettings.d.ts +3 -3
- package/dist/types/src/components/ObjectDetails/BaseObjectSettings.d.ts.map +1 -0
- package/dist/types/src/components/ObjectDetails/BaseObjectSettings.stories.d.ts +1433 -0
- package/dist/types/src/components/ObjectDetails/BaseObjectSettings.stories.d.ts.map +1 -0
- package/dist/types/src/components/ObjectDetails/ForeignKeys.d.ts +8 -0
- package/dist/types/src/components/ObjectDetails/ForeignKeys.d.ts.map +1 -0
- package/dist/types/src/components/ObjectDetails/ObjectDetails.d.ts +9 -0
- package/dist/types/src/components/ObjectDetails/ObjectDetails.d.ts.map +1 -0
- package/dist/types/src/components/ObjectDetails/index.d.ts +3 -0
- package/dist/types/src/components/ObjectDetails/index.d.ts.map +1 -0
- package/dist/types/src/components/ObjectRenamePopover/ObjectRenamePopover.d.ts +7 -0
- package/dist/types/src/components/ObjectRenamePopover/ObjectRenamePopover.d.ts.map +1 -0
- package/dist/types/src/components/ObjectRenamePopover/index.d.ts +2 -0
- package/dist/types/src/components/ObjectRenamePopover/index.d.ts.map +1 -0
- package/dist/types/src/components/RecordArticle.d.ts +5 -0
- package/dist/types/src/components/RecordArticle.d.ts.map +1 -0
- package/dist/types/src/components/RecordArticle.stories.d.ts +1600 -0
- package/dist/types/src/components/RecordArticle.stories.d.ts.map +1 -0
- package/dist/types/src/components/SchemaContainer.d.ts +2 -2
- package/dist/types/src/components/SchemaContainer.d.ts.map +1 -1
- package/dist/types/src/components/SpacePluginSettings.d.ts +4 -2
- package/dist/types/src/components/SpacePluginSettings.d.ts.map +1 -1
- package/dist/types/src/components/{SpacePresence.d.ts → SpacePresence/SpacePresence.d.ts} +7 -6
- package/dist/types/src/components/SpacePresence/SpacePresence.d.ts.map +1 -0
- package/dist/types/src/components/SpacePresence/SpacePresence.stories.d.ts +1430 -0
- package/dist/types/src/components/SpacePresence/SpacePresence.stories.d.ts.map +1 -0
- package/dist/types/src/components/SpacePresence/index.d.ts +2 -0
- package/dist/types/src/components/SpacePresence/index.d.ts.map +1 -0
- package/dist/types/src/components/SpaceRenamePopover/SpaceRenamePopover.d.ts +7 -0
- package/dist/types/src/components/SpaceRenamePopover/SpaceRenamePopover.d.ts.map +1 -0
- package/dist/types/src/components/SpaceRenamePopover/index.d.ts +2 -0
- package/dist/types/src/components/SpaceRenamePopover/index.d.ts.map +1 -0
- package/dist/types/src/components/SpaceSettings/SpaceSettingsContainer.d.ts +1 -1
- package/dist/types/src/components/SpaceSettings/SpaceSettingsContainer.d.ts.map +1 -1
- package/dist/types/src/components/SpaceSettings/SpaceSettingsContainer.stories.d.ts +1430 -4
- 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 +1431 -5
- 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 -12
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/constants.d.ts +6 -0
- package/dist/types/src/constants.d.ts.map +1 -0
- package/dist/types/src/helpers/index.d.ts +2 -0
- package/dist/types/src/helpers/index.d.ts.map +1 -0
- package/dist/types/src/helpers/query.d.ts +7 -0
- package/dist/types/src/helpers/query.d.ts.map +1 -0
- package/dist/types/src/helpers/query.test.d.ts +2 -0
- package/dist/types/src/helpers/query.test.d.ts.map +1 -0
- package/dist/types/src/hooks/index.d.ts +1 -0
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useActiveSpace.d.ts +2 -2
- package/dist/types/src/hooks/useActiveSpace.d.ts.map +1 -1
- package/dist/types/src/hooks/useInputSurfaceLookup.d.ts +2 -8
- package/dist/types/src/hooks/useInputSurfaceLookup.d.ts.map +1 -1
- package/dist/types/src/hooks/usePath.d.ts +3 -3
- package/dist/types/src/hooks/usePath.d.ts.map +1 -1
- package/dist/types/src/hooks/useTypeOptions.d.ts +10 -0
- package/dist/types/src/hooks/useTypeOptions.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +2 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +2 -3
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +1270 -67
- 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 +639 -417
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/src/util.d.ts +43 -50
- package/dist/types/src/util.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +86 -62
- package/src/SpacePlugin.ts +174 -253
- 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 -15
- 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 +22 -21
- package/src/components/CollectionArticle.tsx +153 -0
- package/src/components/CollectionSection.tsx +8 -6
- package/src/components/CreateDialog/CreateObjectDialog.stories.tsx +37 -30
- package/src/components/CreateDialog/CreateObjectDialog.tsx +81 -61
- package/src/components/CreateDialog/CreateObjectPanel.tsx +170 -97
- package/src/components/CreateDialog/CreateSpaceDialog.tsx +39 -33
- package/src/components/{JoinDialog.tsx → JoinDialog/JoinDialog.tsx} +28 -39
- package/src/components/JoinDialog/index.ts +5 -0
- package/src/components/MembersContainer/MembersContainer.stories.tsx +56 -0
- package/src/components/{MembersContainer.tsx → MembersContainer/MembersContainer.tsx} +51 -52
- package/src/components/MembersContainer/index.ts +5 -0
- package/src/components/MenuFooter.tsx +3 -3
- package/src/components/ObjectCardStack/ObjectCardStack.tsx +67 -0
- package/src/components/ObjectCardStack/ObjectForm.tsx +97 -0
- package/src/components/ObjectCardStack/index.ts +7 -0
- package/src/components/ObjectDetails/BaseObjectSettings.stories.tsx +63 -0
- package/src/components/ObjectDetails/BaseObjectSettings.tsx +122 -0
- package/src/components/{ObjectSettings → ObjectDetails}/ForeignKeys.tsx +8 -8
- package/src/components/ObjectDetails/ObjectDetails.tsx +32 -0
- package/src/components/ObjectDetails/index.ts +7 -0
- package/src/components/ObjectRenamePopover/ObjectRenamePopover.tsx +52 -0
- package/src/components/ObjectRenamePopover/index.ts +5 -0
- package/src/components/RecordArticle.stories.tsx +115 -0
- package/src/components/RecordArticle.tsx +122 -0
- package/src/components/SchemaContainer.tsx +28 -31
- package/src/components/SpacePluginSettings.tsx +25 -16
- package/src/components/{SpacePresence.stories.tsx → SpacePresence/SpacePresence.stories.tsx} +24 -23
- package/src/components/{SpacePresence.tsx → SpacePresence/SpacePresence.tsx} +27 -24
- package/src/components/SpacePresence/index.ts +5 -0
- package/src/components/{PopoverRenameSpace.tsx → SpaceRenamePopover/SpaceRenamePopover.tsx} +16 -16
- package/src/components/SpaceRenamePopover/index.ts +5 -0
- package/src/components/SpaceSettings/SpaceSettingsContainer.stories.tsx +19 -11
- package/src/components/SpaceSettings/SpaceSettingsContainer.tsx +193 -157
- package/src/components/SyncStatus/InlineSyncStatus.tsx +8 -8
- package/src/components/SyncStatus/SyncStatus.stories.tsx +9 -9
- package/src/components/SyncStatus/SyncStatus.tsx +109 -12
- package/src/components/SyncStatus/save-tracker.ts +2 -2
- package/src/components/ViewEditor.tsx +64 -27
- package/src/components/index.ts +7 -7
- package/src/constants.ts +11 -0
- package/src/helpers/index.ts +5 -0
- package/src/helpers/query.test.ts +24 -0
- package/src/helpers/query.ts +153 -0
- package/src/hooks/index.ts +1 -0
- package/src/hooks/useActiveSpace.ts +7 -4
- package/src/hooks/useInputSurfaceLookup.tsx +9 -13
- package/src/hooks/usePath.ts +5 -5
- package/src/hooks/useTypeOptions.ts +25 -0
- package/src/index.ts +2 -2
- package/src/meta.ts +8 -5
- package/src/translations.ts +70 -58
- 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 +534 -254
- package/src/util.tsx +385 -274
- package/dist/lib/browser/CollectionMain-D2B75XBS.mjs +0 -31
- package/dist/lib/browser/CollectionMain-D2B75XBS.mjs.map +0 -7
- package/dist/lib/browser/ObjectDetailsPanel-YPTDQKMG.mjs +0 -88
- package/dist/lib/browser/ObjectDetailsPanel-YPTDQKMG.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-7CZZJS3S.mjs +0 -479
- package/dist/lib/browser/app-graph-builder-7CZZJS3S.mjs.map +0 -7
- package/dist/lib/browser/app-graph-serializer-H6AW7KGS.mjs +0 -80
- package/dist/lib/browser/app-graph-serializer-H6AW7KGS.mjs.map +0 -7
- package/dist/lib/browser/chunk-CEFHNVU7.mjs +0 -20
- package/dist/lib/browser/chunk-CEFHNVU7.mjs.map +0 -7
- package/dist/lib/browser/chunk-FBCGT5YY.mjs +0 -13
- package/dist/lib/browser/chunk-FBCGT5YY.mjs.map +0 -7
- package/dist/lib/browser/chunk-JS3MMC42.mjs +0 -19
- package/dist/lib/browser/chunk-JS3MMC42.mjs.map +0 -7
- package/dist/lib/browser/chunk-QACNNDOT.mjs.map +0 -7
- package/dist/lib/browser/chunk-SGTQ52SU.mjs +0 -338
- package/dist/lib/browser/chunk-SGTQ52SU.mjs.map +0 -7
- package/dist/lib/browser/chunk-V7MJSSBQ.mjs +0 -1984
- package/dist/lib/browser/chunk-V7MJSSBQ.mjs.map +0 -7
- package/dist/lib/browser/chunk-VLBRSGJ2.mjs +0 -94
- package/dist/lib/browser/chunk-VLBRSGJ2.mjs.map +0 -7
- package/dist/lib/browser/chunk-XUYKJUU7.mjs +0 -649
- package/dist/lib/browser/chunk-XUYKJUU7.mjs.map +0 -7
- package/dist/lib/browser/identity-created-23XJJV2N.mjs +0 -23
- package/dist/lib/browser/identity-created-23XJJV2N.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-TIXVDYN7.mjs +0 -760
- package/dist/lib/browser/intent-resolver-TIXVDYN7.mjs.map +0 -7
- package/dist/lib/browser/react-root-N2J7TDRX.mjs +0 -29
- package/dist/lib/browser/react-root-N2J7TDRX.mjs.map +0 -7
- package/dist/lib/browser/react-surface-TPNLWJJH.mjs +0 -374
- package/dist/lib/browser/react-surface-TPNLWJJH.mjs.map +0 -7
- package/dist/lib/browser/schema-defs-Z6FC4AHC.mjs +0 -26
- package/dist/lib/browser/schema-defs-Z6FC4AHC.mjs.map +0 -7
- package/dist/lib/browser/schema-tools-BNP4JTD7.mjs +0 -124
- package/dist/lib/browser/schema-tools-BNP4JTD7.mjs.map +0 -7
- package/dist/lib/browser/settings-4IMP5RYT.mjs +0 -24
- package/dist/lib/browser/settings-4IMP5RYT.mjs.map +0 -7
- package/dist/lib/browser/spaces-ready-TOPG6IV4.mjs +0 -199
- package/dist/lib/browser/spaces-ready-TOPG6IV4.mjs.map +0 -7
- package/dist/lib/browser/state-QYZAB45H.mjs +0 -47
- package/dist/lib/browser/state-QYZAB45H.mjs.map +0 -7
- package/dist/lib/node-esm/CollectionMain-ZJIFCWKZ.mjs +0 -32
- package/dist/lib/node-esm/CollectionMain-ZJIFCWKZ.mjs.map +0 -7
- package/dist/lib/node-esm/ObjectDetailsPanel-QKZEDSZK.mjs +0 -89
- package/dist/lib/node-esm/ObjectDetailsPanel-QKZEDSZK.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-KGIGWC72.mjs +0 -480
- package/dist/lib/node-esm/app-graph-builder-KGIGWC72.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-serializer-2ICUGQQT.mjs +0 -81
- package/dist/lib/node-esm/app-graph-serializer-2ICUGQQT.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-4AOMYKDE.mjs +0 -650
- package/dist/lib/node-esm/chunk-4AOMYKDE.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-5HHYE264.mjs +0 -20
- package/dist/lib/node-esm/chunk-5HHYE264.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-5T3ZH23B.mjs +0 -21
- package/dist/lib/node-esm/chunk-5T3ZH23B.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-6X5DLJM5.mjs +0 -1985
- package/dist/lib/node-esm/chunk-6X5DLJM5.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HWNG4MEU.mjs +0 -15
- package/dist/lib/node-esm/chunk-HWNG4MEU.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-JH6F4C3I.mjs +0 -339
- package/dist/lib/node-esm/chunk-JH6F4C3I.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-P442DOQ3.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-SSLBYZEY.mjs +0 -96
- package/dist/lib/node-esm/chunk-SSLBYZEY.mjs.map +0 -7
- package/dist/lib/node-esm/identity-created-IJQO6GCR.mjs +0 -25
- package/dist/lib/node-esm/identity-created-IJQO6GCR.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-MHGHRGDT.mjs +0 -761
- package/dist/lib/node-esm/intent-resolver-MHGHRGDT.mjs.map +0 -7
- package/dist/lib/node-esm/react-root-KW3TGJGY.mjs +0 -30
- package/dist/lib/node-esm/react-root-KW3TGJGY.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-UUIUUD6P.mjs +0 -375
- package/dist/lib/node-esm/react-surface-UUIUUD6P.mjs.map +0 -7
- package/dist/lib/node-esm/schema-defs-WHJM7UZE.mjs +0 -27
- package/dist/lib/node-esm/schema-defs-WHJM7UZE.mjs.map +0 -7
- package/dist/lib/node-esm/schema-tools-KWW5PTML.mjs +0 -126
- package/dist/lib/node-esm/schema-tools-KWW5PTML.mjs.map +0 -7
- package/dist/lib/node-esm/settings-SAOBPND3.mjs +0 -25
- package/dist/lib/node-esm/settings-SAOBPND3.mjs.map +0 -7
- package/dist/lib/node-esm/spaces-ready-HIUKNDZK.mjs +0 -200
- package/dist/lib/node-esm/spaces-ready-HIUKNDZK.mjs.map +0 -7
- package/dist/lib/node-esm/state-ZVEHQ4BJ.mjs +0 -48
- package/dist/lib/node-esm/state-ZVEHQ4BJ.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 -28
- package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
- package/dist/types/src/capabilities/identity-created.d.ts +0 -4
- package/dist/types/src/capabilities/identity-created.d.ts.map +0 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +0 -9
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-root.d.ts +0 -7
- package/dist/types/src/capabilities/react-root.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface.d.ts +0 -7
- package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
- package/dist/types/src/capabilities/schema-defs.d.ts +0 -4
- package/dist/types/src/capabilities/schema-defs.d.ts.map +0 -1
- package/dist/types/src/capabilities/schema-tool.test.d.ts +0 -2
- package/dist/types/src/capabilities/schema-tool.test.d.ts.map +0 -1
- package/dist/types/src/capabilities/schema-tools.d.ts +0 -13
- package/dist/types/src/capabilities/schema-tools.d.ts.map +0 -1
- package/dist/types/src/capabilities/settings.d.ts +0 -4
- package/dist/types/src/capabilities/settings.d.ts.map +0 -1
- package/dist/types/src/capabilities/spaces-ready.d.ts +0 -4
- package/dist/types/src/capabilities/spaces-ready.d.ts.map +0 -1
- package/dist/types/src/capabilities/state.d.ts +0 -5
- package/dist/types/src/capabilities/state.d.ts.map +0 -1
- package/dist/types/src/components/CollectionMain.d.ts +0 -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/MembersContainer.stories.d.ts +0 -8
- package/dist/types/src/components/MembersContainer.stories.d.ts.map +0 -1
- package/dist/types/src/components/ObjectDetailsPanel.d.ts +0 -9
- package/dist/types/src/components/ObjectDetailsPanel.d.ts.map +0 -1
- package/dist/types/src/components/ObjectSettings/AdvancedObjectSettings.d.ts +0 -7
- package/dist/types/src/components/ObjectSettings/AdvancedObjectSettings.d.ts.map +0 -1
- package/dist/types/src/components/ObjectSettings/BaseObjectSettings.d.ts.map +0 -1
- package/dist/types/src/components/ObjectSettings/ForeignKeys.d.ts +0 -8
- package/dist/types/src/components/ObjectSettings/ForeignKeys.d.ts.map +0 -1
- package/dist/types/src/components/ObjectSettings/ObjectSettingsContainer.d.ts +0 -8
- package/dist/types/src/components/ObjectSettings/ObjectSettingsContainer.d.ts.map +0 -1
- package/dist/types/src/components/ObjectSettings/index.d.ts +0 -2
- package/dist/types/src/components/ObjectSettings/index.d.ts.map +0 -1
- package/dist/types/src/components/PersistenceStatus.d.ts +0 -6
- package/dist/types/src/components/PersistenceStatus.d.ts.map +0 -1
- package/dist/types/src/components/PopoverRenameObject.d.ts +0 -7
- package/dist/types/src/components/PopoverRenameObject.d.ts.map +0 -1
- package/dist/types/src/components/PopoverRenameSpace.d.ts +0 -7
- package/dist/types/src/components/PopoverRenameSpace.d.ts.map +0 -1
- package/dist/types/src/components/SpacePresence.d.ts.map +0 -1
- package/dist/types/src/components/SpacePresence.stories.d.ts +0 -9
- package/dist/types/src/components/SpacePresence.stories.d.ts.map +0 -1
- package/dist/types/src/events.d.ts +0 -8
- package/dist/types/src/events.d.ts.map +0 -1
- package/src/capabilities/app-graph-builder.ts +0 -699
- package/src/capabilities/app-graph-serializer.ts +0 -76
- package/src/capabilities/capabilities.ts +0 -29
- package/src/capabilities/identity-created.ts +0 -25
- package/src/capabilities/intent-resolver.ts +0 -694
- package/src/capabilities/react-root.tsx +0 -20
- package/src/capabilities/react-surface.tsx +0 -386
- package/src/capabilities/schema-defs.ts +0 -30
- package/src/capabilities/schema-tool.test.ts +0 -44
- package/src/capabilities/schema-tools.ts +0 -125
- package/src/capabilities/settings.ts +0 -21
- package/src/capabilities/spaces-ready.ts +0 -231
- package/src/capabilities/state.ts +0 -45
- package/src/components/CollectionMain.tsx +0 -32
- package/src/components/MembersContainer.stories.tsx +0 -30
- package/src/components/ObjectDetailsPanel.tsx +0 -77
- package/src/components/ObjectSettings/AdvancedObjectSettings.tsx +0 -80
- package/src/components/ObjectSettings/BaseObjectSettings.tsx +0 -47
- package/src/components/ObjectSettings/ObjectSettingsContainer.tsx +0 -36
- package/src/components/ObjectSettings/index.ts +0 -5
- package/src/components/PersistenceStatus.tsx +0 -83
- package/src/components/PopoverRenameObject.tsx +0 -62
- package/src/events.ts +0 -15
package/src/util.tsx
CHANGED
|
@@ -2,83 +2,57 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
5
|
+
import { type Instruction } from '@atlaskit/pragmatic-drag-and-drop-hitbox/tree-item';
|
|
6
|
+
import * as Effect from 'effect/Effect';
|
|
7
7
|
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { 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 ReadableGraph,
|
|
17
|
-
type ActionData,
|
|
18
|
-
type InvokeParams,
|
|
19
|
-
type Node,
|
|
20
|
-
type NodeArg,
|
|
21
|
-
isGraphNode,
|
|
22
|
-
} from '@dxos/plugin-graph';
|
|
23
|
-
import { fullyQualifiedId, getSpace, type QueryResult, SpaceState, type Space, isSpace } from '@dxos/react-client/echo';
|
|
24
|
-
import { ATTENDABLE_PATH_SEPARATOR } from '@dxos/react-ui-attention';
|
|
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
|
-
import {
|
|
29
|
-
import {
|
|
20
|
+
import { meta } from './meta';
|
|
21
|
+
import { SPACE_TYPE, SpaceOperation } from './types';
|
|
30
22
|
|
|
31
|
-
export const SPACES = `${
|
|
32
|
-
export const COMPOSER_SPACE_LOCK =
|
|
23
|
+
export const SPACES = `${meta.id}-spaces`;
|
|
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
|
|
60
|
-
? ['personal space label', { ns:
|
|
61
|
-
: ['unnamed space label', { ns:
|
|
38
|
+
? ['personal space label', { ns: meta.id }]
|
|
39
|
+
: ['unnamed space label', { ns: meta.id }];
|
|
62
40
|
};
|
|
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,46 +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
|
}) => {
|
|
128
|
+
const metadata = resolve(collection.key);
|
|
148
129
|
return {
|
|
149
|
-
|
|
130
|
+
label: ['typename label', { ns: collection.key, count: 2 }],
|
|
131
|
+
icon: metadata.icon,
|
|
132
|
+
iconHue: metadata.iconHue,
|
|
150
133
|
acceptPersistenceClass: new Set(['echo']),
|
|
151
|
-
acceptPersistenceKey: new Set([
|
|
134
|
+
acceptPersistenceKey: new Set([db.spaceId]),
|
|
152
135
|
role: 'branch',
|
|
153
|
-
canDrop: (source: TreeData) => {
|
|
154
|
-
return (
|
|
155
|
-
isGraphNode(source.item) &&
|
|
156
|
-
Obj.isObject(source.item.data) &&
|
|
157
|
-
Obj.getTypename(source.item.data) === collection.query.typename
|
|
158
|
-
);
|
|
159
|
-
},
|
|
160
|
-
onTransferStart: (child: Node<Obj.Any>, index?: number) => {
|
|
161
|
-
// No-op. Objects are moved into query collections by being removed from their original collection.
|
|
162
|
-
},
|
|
163
|
-
onTransferEnd: (child: Node<Obj.Any>, destination: Node) => {
|
|
164
|
-
// No-op. Objects are moved out of query collections by being added to another collection.
|
|
165
|
-
},
|
|
166
136
|
};
|
|
167
137
|
};
|
|
168
138
|
|
|
@@ -173,24 +143,6 @@ const getSchemaGraphNodePartials = () => {
|
|
|
173
143
|
};
|
|
174
144
|
};
|
|
175
145
|
|
|
176
|
-
const getViewGraphNodePartials = ({
|
|
177
|
-
view,
|
|
178
|
-
resolve,
|
|
179
|
-
}: {
|
|
180
|
-
view: DataType.View;
|
|
181
|
-
resolve: (typename: string) => Record<string, any>;
|
|
182
|
-
}) => {
|
|
183
|
-
const presentation = view.presentation.target;
|
|
184
|
-
const typename = presentation ? Obj.getTypename(presentation) : undefined;
|
|
185
|
-
const metadata = typename ? resolve(typename) : {};
|
|
186
|
-
|
|
187
|
-
return {
|
|
188
|
-
label: view.name || ['object name placeholder', { ns: typename, default: 'New view' }],
|
|
189
|
-
icon: metadata.icon,
|
|
190
|
-
canDrop: () => false,
|
|
191
|
-
};
|
|
192
|
-
};
|
|
193
|
-
|
|
194
146
|
const checkPendingMigration = (space: Space) => {
|
|
195
147
|
return (
|
|
196
148
|
space.state.get() === SpaceState.SPACE_REQUIRES_MIGRATION ||
|
|
@@ -206,21 +158,46 @@ export const constructSpaceNode = ({
|
|
|
206
158
|
personal,
|
|
207
159
|
namesCache,
|
|
208
160
|
resolve,
|
|
161
|
+
graph,
|
|
162
|
+
spacesOrder,
|
|
209
163
|
}: {
|
|
210
164
|
space: Space;
|
|
211
165
|
navigable?: boolean;
|
|
212
166
|
personal?: boolean;
|
|
213
167
|
namesCache?: Record<string, string>;
|
|
214
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;
|
|
215
174
|
}) => {
|
|
216
175
|
const hasPendingMigration = checkPendingMigration(space);
|
|
217
176
|
const collection =
|
|
218
|
-
space.state.get() === SpaceState.SPACE_READY && space.properties[
|
|
177
|
+
space.state.get() === SpaceState.SPACE_READY && space.properties[Collection.Collection.typename]?.target;
|
|
219
178
|
const partials =
|
|
220
|
-
space.state.get() === SpaceState.SPACE_READY && Obj.instanceOf(
|
|
221
|
-
? getCollectionGraphNodePartials({ collection, space, resolve })
|
|
179
|
+
space.state.get() === SpaceState.SPACE_READY && Obj.instanceOf(Collection.Collection, collection)
|
|
180
|
+
? getCollectionGraphNodePartials({ collection, db: space.db, resolve })
|
|
222
181
|
: {};
|
|
223
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
|
+
|
|
224
201
|
return {
|
|
225
202
|
id: space.id,
|
|
226
203
|
type: SPACE_TYPE,
|
|
@@ -235,8 +212,11 @@ export const constructSpaceNode = ({
|
|
|
235
212
|
space.state.get() === SpaceState.SPACE_READY && space.properties.icon
|
|
236
213
|
? `ph--${space.properties.icon}--regular`
|
|
237
214
|
: undefined,
|
|
215
|
+
iconHue: space.state.get() === SpaceState.SPACE_READY && space.properties.iconHue,
|
|
238
216
|
disabled: !navigable || space.state.get() !== SpaceState.SPACE_READY || hasPendingMigration,
|
|
217
|
+
disposition: 'workspace',
|
|
239
218
|
testId: 'spacePlugin.space',
|
|
219
|
+
onRearrange,
|
|
240
220
|
canDrop: (source: TreeData) => {
|
|
241
221
|
// TODO(wittjosiah): Find a way to only allow space as source for rearranging.
|
|
242
222
|
return Obj.isObject(source.item.data) || isSpace(source.item.data);
|
|
@@ -245,41 +225,44 @@ export const constructSpaceNode = ({
|
|
|
245
225
|
nodes: [
|
|
246
226
|
{
|
|
247
227
|
id: `settings${ATTENDABLE_PATH_SEPARATOR}${space.id}`,
|
|
248
|
-
type: `${
|
|
228
|
+
type: `${meta.id}/settings`,
|
|
249
229
|
data: null,
|
|
250
230
|
properties: {
|
|
251
|
-
label: ['settings panel label', { ns:
|
|
231
|
+
label: ['settings panel label', { ns: meta.id }],
|
|
252
232
|
icon: 'ph--faders--regular',
|
|
253
233
|
disposition: 'alternate-tree',
|
|
254
234
|
},
|
|
255
235
|
nodes: [
|
|
256
236
|
{
|
|
257
237
|
id: `properties-settings${ATTENDABLE_PATH_SEPARATOR}${space.id}`,
|
|
258
|
-
type: `${
|
|
259
|
-
data: `${
|
|
238
|
+
type: `${meta.id}/properties`,
|
|
239
|
+
data: `${meta.id}/properties`,
|
|
260
240
|
properties: {
|
|
261
|
-
label: ['space settings properties label', { ns:
|
|
241
|
+
label: ['space settings properties label', { ns: meta.id }],
|
|
262
242
|
icon: 'ph--sliders--regular',
|
|
263
243
|
position: 'hoist',
|
|
244
|
+
testId: 'spacePlugin.general',
|
|
264
245
|
},
|
|
265
246
|
},
|
|
266
247
|
{
|
|
267
248
|
id: `members-settings${ATTENDABLE_PATH_SEPARATOR}${space.id}`,
|
|
268
|
-
type: `${
|
|
269
|
-
data: `${
|
|
249
|
+
type: `${meta.id}/members`,
|
|
250
|
+
data: `${meta.id}/members`,
|
|
270
251
|
properties: {
|
|
271
|
-
label: ['members panel label', { ns:
|
|
252
|
+
label: ['members panel label', { ns: meta.id }],
|
|
272
253
|
icon: 'ph--users--regular',
|
|
273
254
|
position: 'hoist',
|
|
255
|
+
testId: 'spacePlugin.members',
|
|
274
256
|
},
|
|
275
257
|
},
|
|
276
258
|
{
|
|
277
259
|
id: `schema-settings${ATTENDABLE_PATH_SEPARATOR}${space.id}`,
|
|
278
|
-
type: `${
|
|
279
|
-
data: `${
|
|
260
|
+
type: `${meta.id}/schema`,
|
|
261
|
+
data: `${meta.id}/schema`,
|
|
280
262
|
properties: {
|
|
281
|
-
label: ['space settings schema label', { ns:
|
|
263
|
+
label: ['space settings schema label', { ns: meta.id }],
|
|
282
264
|
icon: 'ph--shapes--regular',
|
|
265
|
+
testId: 'spacePlugin.schema',
|
|
283
266
|
},
|
|
284
267
|
},
|
|
285
268
|
],
|
|
@@ -290,29 +273,25 @@ export const constructSpaceNode = ({
|
|
|
290
273
|
|
|
291
274
|
export const constructSpaceActions = ({
|
|
292
275
|
space,
|
|
293
|
-
dispatch,
|
|
294
276
|
personal,
|
|
295
277
|
migrating,
|
|
296
278
|
}: {
|
|
297
279
|
space: Space;
|
|
298
|
-
dispatch: PromiseIntentDispatcher;
|
|
299
280
|
personal?: boolean;
|
|
300
281
|
migrating?: boolean;
|
|
301
282
|
}) => {
|
|
302
283
|
const state = space.state.get();
|
|
303
284
|
const hasPendingMigration = checkPendingMigration(space);
|
|
304
285
|
const getId = (id: string) => `${id}/${space.id}`;
|
|
305
|
-
const actions: NodeArg<ActionData
|
|
286
|
+
const actions: Node.NodeArg<Node.ActionData<Operation.Service>>[] = [];
|
|
306
287
|
|
|
307
288
|
if (hasPendingMigration) {
|
|
308
289
|
actions.push({
|
|
309
|
-
id: getId(
|
|
310
|
-
type:
|
|
311
|
-
data:
|
|
312
|
-
await dispatch(createIntent(SpaceAction.Migrate, { space }));
|
|
313
|
-
},
|
|
290
|
+
id: getId(SpaceOperation.Migrate.meta.key),
|
|
291
|
+
type: Node.ActionGroupType,
|
|
292
|
+
data: () => Operation.invoke(SpaceOperation.Migrate, { space }),
|
|
314
293
|
properties: {
|
|
315
|
-
label: ['migrate space label', { ns:
|
|
294
|
+
label: ['migrate space label', { ns: meta.id }],
|
|
316
295
|
icon: 'ph--database--regular',
|
|
317
296
|
disposition: 'list-item-primary',
|
|
318
297
|
disabled: migrating || Migrations.running(space),
|
|
@@ -323,26 +302,22 @@ export const constructSpaceActions = ({
|
|
|
323
302
|
if (state === SpaceState.SPACE_READY && !hasPendingMigration) {
|
|
324
303
|
actions.push(
|
|
325
304
|
{
|
|
326
|
-
id: getId(
|
|
327
|
-
type:
|
|
328
|
-
data:
|
|
329
|
-
await dispatch(createIntent(SpaceAction.OpenCreateObject, { target: space }));
|
|
330
|
-
},
|
|
305
|
+
id: getId(SpaceOperation.OpenCreateObject.meta.key),
|
|
306
|
+
type: Node.ActionType,
|
|
307
|
+
data: () => Operation.invoke(SpaceOperation.OpenCreateObject, { target: space.db }),
|
|
331
308
|
properties: {
|
|
332
|
-
label: ['create object in space label', { ns:
|
|
309
|
+
label: ['create object in space label', { ns: meta.id }],
|
|
333
310
|
icon: 'ph--plus--regular',
|
|
334
311
|
disposition: 'item',
|
|
335
312
|
testId: 'spacePlugin.createObject',
|
|
336
313
|
},
|
|
337
314
|
},
|
|
338
315
|
{
|
|
339
|
-
id: getId(
|
|
340
|
-
type:
|
|
341
|
-
data:
|
|
342
|
-
await dispatch(createIntent(SpaceAction.Rename, { space, caller: params?.caller }));
|
|
343
|
-
},
|
|
316
|
+
id: getId(SpaceOperation.Rename.meta.key),
|
|
317
|
+
type: Node.ActionType,
|
|
318
|
+
data: (params?: Node.InvokeProps) => Operation.invoke(SpaceOperation.Rename, { space, caller: params?.caller }),
|
|
344
319
|
properties: {
|
|
345
|
-
label: ['rename space label', { ns:
|
|
320
|
+
label: ['rename space label', { ns: meta.id }],
|
|
346
321
|
icon: 'ph--pencil-simple-line--regular',
|
|
347
322
|
keyBinding: {
|
|
348
323
|
macos: 'shift+F6',
|
|
@@ -356,15 +331,17 @@ export const constructSpaceActions = ({
|
|
|
356
331
|
return actions;
|
|
357
332
|
};
|
|
358
333
|
|
|
359
|
-
export const createStaticSchemaNode = ({ schema, space }: { schema: Type.
|
|
334
|
+
export const createStaticSchemaNode = ({ schema, space }: { schema: Type.Entity.Any; space: Space }): Node.Node => {
|
|
360
335
|
return {
|
|
361
336
|
id: `${space.id}/${Type.getTypename(schema)}`,
|
|
362
|
-
type: `${
|
|
337
|
+
type: `${meta.id}/static-schema`,
|
|
363
338
|
data: schema,
|
|
364
339
|
properties: {
|
|
365
|
-
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) }],
|
|
366
341
|
icon: 'ph--database--regular',
|
|
342
|
+
iconHue: 'green',
|
|
367
343
|
role: 'branch',
|
|
344
|
+
selectable: false,
|
|
368
345
|
canDrop: () => false,
|
|
369
346
|
space,
|
|
370
347
|
},
|
|
@@ -382,15 +359,29 @@ export const createStaticSchemaActions = ({
|
|
|
382
359
|
}) => {
|
|
383
360
|
const getId = (id: string) => `${space.id}/${Type.getTypename(schema)}/${id}`;
|
|
384
361
|
|
|
385
|
-
const actions: NodeArg<ActionData
|
|
362
|
+
const actions: Node.NodeArg<Node.ActionData<Operation.Service>>[] = [
|
|
386
363
|
{
|
|
387
|
-
id: getId(
|
|
388
|
-
type:
|
|
389
|
-
data:
|
|
390
|
-
|
|
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
|
+
}),
|
|
372
|
+
properties: {
|
|
373
|
+
label: ['add view to schema label', { ns: meta.id }],
|
|
374
|
+
icon: 'ph--plus--regular',
|
|
375
|
+
disposition: 'list-item-primary',
|
|
376
|
+
testId: 'spacePlugin.addViewToSchema',
|
|
391
377
|
},
|
|
378
|
+
},
|
|
379
|
+
{
|
|
380
|
+
id: getId(SpaceOperation.RenameObject.meta.key),
|
|
381
|
+
type: Node.ActionType,
|
|
382
|
+
data: () => Effect.fail(new Error('Not implemented')),
|
|
392
383
|
properties: {
|
|
393
|
-
label: ['rename object label', { ns: Type.getTypename(
|
|
384
|
+
label: ['rename object label', { ns: Type.getTypename(Type.PersistentType) }],
|
|
394
385
|
icon: 'ph--pencil-simple-line--regular',
|
|
395
386
|
disabled: true,
|
|
396
387
|
disposition: 'list-item',
|
|
@@ -398,75 +389,136 @@ export const createStaticSchemaActions = ({
|
|
|
398
389
|
},
|
|
399
390
|
},
|
|
400
391
|
{
|
|
401
|
-
id: getId(
|
|
402
|
-
type:
|
|
403
|
-
data:
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
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
|
+
}),
|
|
411
405
|
properties: {
|
|
412
|
-
label: ['delete object label', { ns: Type.getTypename(
|
|
406
|
+
label: ['delete object label', { ns: Type.getTypename(Type.PersistentType) }],
|
|
413
407
|
icon: 'ph--trash--regular',
|
|
414
408
|
disposition: 'list-item',
|
|
415
409
|
disabled: !deletable,
|
|
416
410
|
testId: 'spacePlugin.deleteObject',
|
|
417
411
|
},
|
|
418
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
|
+
},
|
|
419
433
|
];
|
|
420
434
|
|
|
421
435
|
return actions;
|
|
422
436
|
};
|
|
423
437
|
|
|
424
438
|
export const createObjectNode = ({
|
|
425
|
-
|
|
439
|
+
db,
|
|
426
440
|
object,
|
|
441
|
+
disposition,
|
|
427
442
|
droppable = true,
|
|
428
443
|
navigable = false,
|
|
444
|
+
managedCollectionChild = false,
|
|
429
445
|
resolve,
|
|
446
|
+
parentCollection,
|
|
430
447
|
}: {
|
|
431
|
-
|
|
432
|
-
object: Obj.
|
|
448
|
+
db: Database.Database;
|
|
449
|
+
object: Obj.Unknown;
|
|
450
|
+
disposition?: string;
|
|
433
451
|
droppable?: boolean;
|
|
434
452
|
navigable?: boolean;
|
|
453
|
+
managedCollectionChild?: boolean;
|
|
435
454
|
resolve: (typename: string) => Record<string, any>;
|
|
455
|
+
/** Parent collection for rearranging objects. */
|
|
456
|
+
parentCollection?: Collection.Collection;
|
|
436
457
|
}) => {
|
|
437
458
|
const type = Obj.getTypename(object);
|
|
438
459
|
if (!type) {
|
|
439
|
-
return
|
|
460
|
+
return null;
|
|
440
461
|
}
|
|
441
462
|
|
|
442
463
|
const metadata = resolve(type);
|
|
443
|
-
const partials = Obj.instanceOf(
|
|
444
|
-
? getCollectionGraphNodePartials({ collection: object,
|
|
445
|
-
: Obj.instanceOf(
|
|
446
|
-
?
|
|
447
|
-
: 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)
|
|
448
469
|
? getSchemaGraphNodePartials()
|
|
449
|
-
:
|
|
450
|
-
? getViewGraphNodePartials({ view: object, resolve })
|
|
451
|
-
: metadata.graphProps;
|
|
470
|
+
: metadata.graphProps;
|
|
452
471
|
|
|
453
|
-
|
|
472
|
+
// TODO(wittjosiah): Obj.getLabel isn't triggering reactivity in some cases.
|
|
473
|
+
// e.g., create new collection with no name and rename it.
|
|
474
|
+
const label = (object as any).name ||
|
|
475
|
+
Obj.getLabel(object) ||
|
|
454
476
|
// TODO(wittjosiah): Remove metadata labels.
|
|
455
477
|
metadata.label?.(object) || ['object name placeholder', { ns: type, default: 'New item' }];
|
|
456
478
|
|
|
479
|
+
const selectable =
|
|
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));
|
|
484
|
+
|
|
457
485
|
return {
|
|
458
|
-
id:
|
|
486
|
+
id: Obj.getDXN(object).toString(),
|
|
459
487
|
type,
|
|
460
488
|
cacheable: ['label', 'icon', 'role'],
|
|
461
489
|
data: object,
|
|
462
490
|
properties: {
|
|
463
491
|
label,
|
|
464
492
|
icon: metadata.icon ?? 'ph--placeholder--regular',
|
|
493
|
+
iconHue: metadata.iconHue,
|
|
494
|
+
disposition,
|
|
465
495
|
testId: 'spacePlugin.object',
|
|
466
496
|
persistenceClass: 'echo',
|
|
467
|
-
persistenceKey:
|
|
497
|
+
persistenceKey: db.spaceId,
|
|
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
|
+
},
|
|
468
520
|
canDrop: (source: TreeData) => {
|
|
469
|
-
return droppable && isGraphNode(source.item) && Obj.isObject(source.item.data);
|
|
521
|
+
return droppable && Node.isGraphNode(source.item) && Obj.isObject(source.item.data);
|
|
470
522
|
},
|
|
471
523
|
...partials,
|
|
472
524
|
},
|
|
@@ -476,41 +528,39 @@ export const createObjectNode = ({
|
|
|
476
528
|
export const constructObjectActions = ({
|
|
477
529
|
object,
|
|
478
530
|
graph,
|
|
479
|
-
|
|
480
|
-
|
|
531
|
+
resolve,
|
|
532
|
+
capabilities,
|
|
481
533
|
deletable = true,
|
|
482
534
|
navigable = false,
|
|
483
535
|
}: {
|
|
484
|
-
object: Obj.
|
|
485
|
-
graph: ReadableGraph;
|
|
486
|
-
|
|
487
|
-
|
|
536
|
+
object: Obj.Unknown;
|
|
537
|
+
graph: Graph.ReadableGraph;
|
|
538
|
+
resolve: (typename: string) => Record<string, any>;
|
|
539
|
+
capabilities: CapabilityManager.CapabilityManager;
|
|
488
540
|
deletable?: boolean;
|
|
489
541
|
navigable?: boolean;
|
|
490
542
|
}) => {
|
|
491
|
-
const
|
|
492
|
-
invariant(
|
|
543
|
+
const db = Obj.getDatabase(object);
|
|
544
|
+
invariant(db, 'Database not found');
|
|
493
545
|
const typename = Obj.getTypename(object);
|
|
494
546
|
invariant(typename, 'Object has no typename');
|
|
495
547
|
|
|
496
|
-
const getId = (id: string) => `${id}/${
|
|
548
|
+
const getId = (id: string) => `${id}/${Obj.getDXN(object).toString()}`;
|
|
497
549
|
|
|
498
|
-
const
|
|
499
|
-
const
|
|
500
|
-
|
|
501
|
-
|
|
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;
|
|
502
554
|
|
|
503
|
-
const actions: NodeArg<ActionData
|
|
504
|
-
...(Obj.instanceOf(
|
|
555
|
+
const actions: Node.NodeArg<Node.ActionData<Operation.Service>>[] = [
|
|
556
|
+
...(Obj.instanceOf(Collection.Collection, object)
|
|
505
557
|
? [
|
|
506
558
|
{
|
|
507
|
-
id: getId(
|
|
508
|
-
type:
|
|
509
|
-
data:
|
|
510
|
-
await dispatch(createIntent(SpaceAction.OpenCreateObject, { target: object }));
|
|
511
|
-
},
|
|
559
|
+
id: getId(SpaceOperation.OpenCreateObject.meta.key),
|
|
560
|
+
type: Node.ActionType,
|
|
561
|
+
data: () => Operation.invoke(SpaceOperation.OpenCreateObject, { target: object }),
|
|
512
562
|
properties: {
|
|
513
|
-
label: ['create object in collection label', { ns:
|
|
563
|
+
label: ['create object in collection label', { ns: meta.id }],
|
|
514
564
|
icon: 'ph--plus--regular',
|
|
515
565
|
disposition: 'list-item-primary',
|
|
516
566
|
testId: 'spacePlugin.createObject',
|
|
@@ -518,31 +568,75 @@ export const constructObjectActions = ({
|
|
|
518
568
|
},
|
|
519
569
|
]
|
|
520
570
|
: []),
|
|
521
|
-
...(
|
|
571
|
+
...(Obj.instanceOf(Type.PersistentType, object)
|
|
522
572
|
? [
|
|
523
573
|
{
|
|
524
|
-
id: getId(
|
|
525
|
-
type:
|
|
526
|
-
data:
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
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
|
+
}),
|
|
582
|
+
properties: {
|
|
583
|
+
label: ['add view to schema label', { ns: meta.id }],
|
|
584
|
+
icon: 'ph--plus--regular',
|
|
585
|
+
disposition: 'list-item-primary',
|
|
586
|
+
testId: 'spacePlugin.addViewToSchema',
|
|
587
|
+
},
|
|
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' })),
|
|
541
600
|
);
|
|
542
601
|
}
|
|
602
|
+
}),
|
|
603
|
+
properties: {
|
|
604
|
+
label: ['snapshot by schema label', { ns: meta.id }],
|
|
605
|
+
icon: 'ph--camera--regular',
|
|
606
|
+
disposition: 'list-item',
|
|
543
607
|
},
|
|
608
|
+
},
|
|
609
|
+
]
|
|
610
|
+
: []),
|
|
611
|
+
...(createObject
|
|
612
|
+
? [
|
|
613
|
+
{
|
|
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
|
+
});
|
|
622
|
+
} else {
|
|
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
|
+
}
|
|
636
|
+
}
|
|
637
|
+
}),
|
|
544
638
|
properties: {
|
|
545
|
-
label: ['create object in
|
|
639
|
+
label: ['create object in system collection label', { ns: meta.id }],
|
|
546
640
|
icon: 'ph--plus--regular',
|
|
547
641
|
disposition: 'list-item-primary',
|
|
548
642
|
testId: 'spacePlugin.createObject',
|
|
@@ -550,56 +644,61 @@ export const constructObjectActions = ({
|
|
|
550
644
|
},
|
|
551
645
|
]
|
|
552
646
|
: []),
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
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
|
+
]),
|
|
589
687
|
...(navigable ||
|
|
590
|
-
(!Obj.instanceOf(
|
|
591
|
-
!Obj.instanceOf(
|
|
592
|
-
!Obj.instanceOf(
|
|
688
|
+
(!Obj.instanceOf(Collection.Collection, object) &&
|
|
689
|
+
!Obj.instanceOf(Collection.Managed, object) &&
|
|
690
|
+
!Obj.instanceOf(Type.PersistentType, object))
|
|
593
691
|
? [
|
|
594
692
|
{
|
|
595
693
|
id: getId('copy-link'),
|
|
596
|
-
type:
|
|
597
|
-
data:
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
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
|
+
}),
|
|
601
700
|
properties: {
|
|
602
|
-
label: ['copy link label', { ns:
|
|
701
|
+
label: ['copy link label', { ns: meta.id }],
|
|
603
702
|
icon: 'ph--link--regular',
|
|
604
703
|
disposition: 'list-item',
|
|
605
704
|
testId: 'spacePlugin.copyLink',
|
|
@@ -609,13 +708,11 @@ export const constructObjectActions = ({
|
|
|
609
708
|
: []),
|
|
610
709
|
// TODO(wittjosiah): Factor out and apply to all nodes.
|
|
611
710
|
{
|
|
612
|
-
id: getId(
|
|
613
|
-
type:
|
|
614
|
-
data:
|
|
615
|
-
await dispatch(createIntent(LayoutAction.Expose, { part: 'navigation', subject: fullyQualifiedId(object) }));
|
|
616
|
-
},
|
|
711
|
+
id: getId(Common.LayoutOperation.Expose.meta.key),
|
|
712
|
+
type: Node.ActionType,
|
|
713
|
+
data: () => Operation.invoke(Common.LayoutOperation.Expose, { subject: Obj.getDXN(object).toString() }),
|
|
617
714
|
properties: {
|
|
618
|
-
label: ['expose object label', { ns:
|
|
715
|
+
label: ['expose object label', { ns: meta.id }],
|
|
619
716
|
icon: 'ph--eye--regular',
|
|
620
717
|
disposition: 'heading-list-item',
|
|
621
718
|
testId: 'spacePlugin.exposeObject',
|
|
@@ -626,13 +723,27 @@ export const constructObjectActions = ({
|
|
|
626
723
|
return actions;
|
|
627
724
|
};
|
|
628
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
|
+
|
|
629
740
|
/**
|
|
630
741
|
* @deprecated This is a temporary solution.
|
|
631
742
|
*/
|
|
632
743
|
export const getNestedObjects = async (
|
|
633
|
-
object: Obj.
|
|
744
|
+
object: Obj.Unknown,
|
|
634
745
|
resolve: (typename: string) => Record<string, any>,
|
|
635
|
-
): Promise<Obj.
|
|
746
|
+
): Promise<Obj.Unknown[]> => {
|
|
636
747
|
const type = Obj.getTypename(object);
|
|
637
748
|
if (!type) {
|
|
638
749
|
return [];
|
|
@@ -644,7 +755,7 @@ export const getNestedObjects = async (
|
|
|
644
755
|
return [];
|
|
645
756
|
}
|
|
646
757
|
|
|
647
|
-
const objects: Obj.
|
|
758
|
+
const objects: Obj.Unknown[] = await loadReferences(object);
|
|
648
759
|
const nested = await Promise.all(objects.map((object) => getNestedObjects(object, resolve)));
|
|
649
760
|
return [...objects, ...nested.flat()];
|
|
650
761
|
};
|
|
@@ -654,15 +765,15 @@ export const getNestedObjects = async (
|
|
|
654
765
|
*/
|
|
655
766
|
// TODO(burdon): Remove.
|
|
656
767
|
export const cloneObject = async (
|
|
657
|
-
object:
|
|
768
|
+
object: Obj.Unknown,
|
|
658
769
|
resolve: (typename: string) => Record<string, any>,
|
|
659
|
-
|
|
660
|
-
): Promise<
|
|
770
|
+
newDb: Database.Database,
|
|
771
|
+
): Promise<Obj.Unknown> => {
|
|
661
772
|
const schema = Obj.getSchema(object);
|
|
662
|
-
const typename = schema ? (Type.getTypename(schema) ??
|
|
773
|
+
const typename = schema ? (Type.getTypename(schema) ?? Expando.Expando.typename) : Expando.Expando.typename;
|
|
663
774
|
const metadata = resolve(typename);
|
|
664
775
|
const serializer = metadata.serializer;
|
|
665
776
|
invariant(serializer, `No serializer for type: ${typename}`);
|
|
666
777
|
const content = await serializer.serialize({ object });
|
|
667
|
-
return serializer.deserialize({ content,
|
|
778
|
+
return serializer.deserialize({ content, db: newDb, newId: true });
|
|
668
779
|
};
|