@dxos/plugin-space 0.8.2-main.fbd8ed0 → 0.8.2-staging.7ac8446
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/app-graph-builder-GMFCSOLG.mjs +315 -0
- package/dist/lib/browser/app-graph-builder-GMFCSOLG.mjs.map +7 -0
- package/dist/lib/browser/{app-graph-serializer-VRU57AEZ.mjs → app-graph-serializer-DSF2U3A5.mjs} +10 -10
- package/dist/lib/browser/app-graph-serializer-DSF2U3A5.mjs.map +7 -0
- package/dist/lib/browser/{chunk-UBSVH2NQ.mjs → chunk-5BDV575R.mjs} +10 -21
- package/dist/lib/browser/chunk-5BDV575R.mjs.map +7 -0
- package/dist/lib/browser/chunk-AYW4IDRT.mjs +275 -0
- package/dist/lib/browser/chunk-AYW4IDRT.mjs.map +7 -0
- package/dist/lib/browser/{chunk-43UQWMD3.mjs → chunk-JZXWPMLA.mjs} +740 -390
- package/dist/lib/browser/chunk-JZXWPMLA.mjs.map +7 -0
- package/dist/lib/browser/{chunk-IQFFOAWD.mjs → chunk-LO5UL6RU.mjs} +173 -78
- package/dist/lib/browser/chunk-LO5UL6RU.mjs.map +7 -0
- package/dist/lib/browser/{identity-created-ANRJHNMQ.mjs → identity-created-JR7BNXFH.mjs} +5 -5
- package/dist/lib/browser/identity-created-JR7BNXFH.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +47 -30
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-resolver-KRINV5QI.mjs → intent-resolver-RKYILWWQ.mjs} +106 -98
- package/dist/lib/browser/intent-resolver-RKYILWWQ.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-root-J3SP2HVW.mjs → react-root-6H7NX2M2.mjs} +4 -5
- package/dist/lib/{node-esm/react-root-S2LW4FS7.mjs.map → browser/react-root-6H7NX2M2.mjs.map} +1 -1
- package/dist/lib/browser/{react-surface-J7T2IMH4.mjs → react-surface-7AGLOVMK.mjs} +53 -120
- package/dist/lib/browser/react-surface-7AGLOVMK.mjs.map +7 -0
- package/dist/lib/browser/schema-FHTA26SW.mjs +24 -0
- package/dist/lib/browser/schema-FHTA26SW.mjs.map +7 -0
- package/dist/lib/browser/{schema-tools-MYC4LTQD.mjs → schema-tools-YAXPRIXP.mjs} +22 -22
- package/dist/lib/browser/schema-tools-YAXPRIXP.mjs.map +7 -0
- package/dist/lib/browser/{settings-G24447B7.mjs → settings-PJPTJUPE.mjs} +4 -4
- package/dist/lib/browser/settings-PJPTJUPE.mjs.map +7 -0
- package/dist/lib/browser/{spaces-ready-5I3RKYTT.mjs → spaces-ready-BSSP7HHG.mjs} +17 -18
- package/dist/lib/browser/spaces-ready-BSSP7HHG.mjs.map +7 -0
- package/dist/lib/browser/{state-SI4B5GHC.mjs → state-X7VLCC6E.mjs} +4 -2
- package/dist/lib/browser/state-X7VLCC6E.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +1 -7
- package/dist/lib/node/app-graph-builder-DPY7AUZE.cjs +318 -0
- package/dist/lib/node/app-graph-builder-DPY7AUZE.cjs.map +7 -0
- package/dist/lib/node/{app-graph-serializer-VLBCR3IX.cjs → app-graph-serializer-JELGJUAY.cjs} +22 -22
- package/dist/lib/node/app-graph-serializer-JELGJUAY.cjs.map +7 -0
- package/dist/lib/node/{chunk-MXBE2VET.cjs → chunk-3GKCNADA.cjs} +751 -412
- package/dist/lib/node/chunk-3GKCNADA.cjs.map +7 -0
- package/dist/lib/node/{chunk-5YHUQJVB.cjs → chunk-PU2EYH4E.cjs} +14 -25
- package/dist/lib/node/chunk-PU2EYH4E.cjs.map +7 -0
- package/dist/lib/node/{chunk-SCATWJKX.cjs → chunk-TUZWEPGX.cjs} +198 -100
- package/dist/lib/node/chunk-TUZWEPGX.cjs.map +7 -0
- package/dist/lib/node/chunk-WDEIFDTX.cjs +300 -0
- package/dist/lib/node/chunk-WDEIFDTX.cjs.map +7 -0
- package/dist/lib/node/{identity-created-NIPYGVG3.cjs → identity-created-XU4HFV2T.cjs} +7 -7
- package/dist/lib/node/identity-created-XU4HFV2T.cjs.map +7 -0
- package/dist/lib/node/index.cjs +97 -79
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/{intent-resolver-MJVRY6YE.cjs → intent-resolver-VJ7YV74L.cjs} +151 -144
- package/dist/lib/node/intent-resolver-VJ7YV74L.cjs.map +7 -0
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/{react-root-M4BZ6VXB.cjs → react-root-TEL5RW3N.cjs} +8 -9
- package/dist/lib/node/{react-root-M4BZ6VXB.cjs.map → react-root-TEL5RW3N.cjs.map} +1 -1
- package/dist/lib/node/{react-surface-RYKSYYKM.cjs → react-surface-2H3S5TY5.cjs} +75 -142
- package/dist/lib/node/react-surface-2H3S5TY5.cjs.map +7 -0
- package/dist/lib/node/{schema-defs-2HJLXSNK.cjs → schema-PPJ5BZ3A.cjs} +11 -13
- package/dist/lib/node/schema-PPJ5BZ3A.cjs.map +7 -0
- package/dist/lib/node/{schema-tools-OE3MFYYH.cjs → schema-tools-BLIMOZYY.cjs} +24 -24
- package/dist/lib/node/schema-tools-BLIMOZYY.cjs.map +7 -0
- package/dist/lib/node/{settings-AFWO4AWK.cjs → settings-WVFP2UEP.cjs} +7 -7
- package/dist/lib/node/settings-WVFP2UEP.cjs.map +7 -0
- package/dist/lib/node/{spaces-ready-BMPXSFHF.cjs → spaces-ready-7DNZSUOG.cjs} +24 -25
- package/dist/lib/node/spaces-ready-7DNZSUOG.cjs.map +7 -0
- package/dist/lib/node/{state-L2ZSDKLS.cjs → state-5KX6WBJH.cjs} +7 -5
- package/dist/lib/node/state-5KX6WBJH.cjs.map +7 -0
- package/dist/lib/node/types/index.cjs +12 -18
- package/dist/lib/node/types/index.cjs.map +2 -2
- package/dist/lib/node-esm/app-graph-builder-42IGWRPL.mjs +316 -0
- package/dist/lib/node-esm/app-graph-builder-42IGWRPL.mjs.map +7 -0
- package/dist/lib/node-esm/{app-graph-serializer-GEUYYXKD.mjs → app-graph-serializer-FXONFKOE.mjs} +10 -10
- package/dist/lib/node-esm/app-graph-serializer-FXONFKOE.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-5NIBYPVF.mjs → chunk-3ZOUV4DF.mjs} +10 -21
- package/dist/lib/node-esm/chunk-3ZOUV4DF.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-FI3WV22Y.mjs → chunk-BEWBZ4Q4.mjs} +740 -390
- package/dist/lib/node-esm/chunk-BEWBZ4Q4.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-FC4UHDPL.mjs +276 -0
- package/dist/lib/node-esm/chunk-FC4UHDPL.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-S2W6HS4A.mjs → chunk-ZGLK25WQ.mjs} +173 -78
- package/dist/lib/node-esm/chunk-ZGLK25WQ.mjs.map +7 -0
- package/dist/lib/node-esm/{identity-created-O5X2FFWU.mjs → identity-created-WJKAS2PV.mjs} +5 -5
- package/dist/lib/node-esm/identity-created-WJKAS2PV.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +47 -30
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/{intent-resolver-JT6EB47M.mjs → intent-resolver-ZFNSA4CM.mjs} +106 -98
- package/dist/lib/node-esm/intent-resolver-ZFNSA4CM.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-root-S2LW4FS7.mjs → react-root-PRBJMWLQ.mjs} +4 -5
- package/dist/lib/node-esm/{react-surface-ZNNMO7QQ.mjs → react-surface-RCZG2PNF.mjs} +53 -120
- package/dist/lib/node-esm/react-surface-RCZG2PNF.mjs.map +7 -0
- package/dist/lib/node-esm/schema-OUZKVYM5.mjs +25 -0
- package/dist/lib/node-esm/schema-OUZKVYM5.mjs.map +7 -0
- package/dist/lib/node-esm/{schema-tools-YTJLA3NQ.mjs → schema-tools-IU7EX5A5.mjs} +22 -22
- package/dist/lib/node-esm/schema-tools-IU7EX5A5.mjs.map +7 -0
- package/dist/lib/node-esm/{settings-MJVSCOI4.mjs → settings-FJZPC2TV.mjs} +4 -4
- package/dist/lib/node-esm/settings-FJZPC2TV.mjs.map +7 -0
- package/dist/lib/node-esm/{spaces-ready-XKG57SL5.mjs → spaces-ready-7X5PGB2V.mjs} +17 -18
- package/dist/lib/node-esm/spaces-ready-7X5PGB2V.mjs.map +7 -0
- package/dist/lib/node-esm/{state-QUDYGEU6.mjs → state-Z6E2YTNC.mjs} +4 -2
- package/dist/lib/node-esm/state-Z6E2YTNC.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +1 -7
- package/dist/types/src/SpacePlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts +179 -2
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-serializer.d.ts +2 -2
- package/dist/types/src/capabilities/app-graph-serializer.d.ts.map +1 -1
- package/dist/types/src/capabilities/identity-created.d.ts +2 -2
- package/dist/types/src/capabilities/identity-created.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +184 -9
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +3 -4
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/schema-tools.d.ts +2 -2
- package/dist/types/src/capabilities/schema-tools.d.ts.map +1 -1
- package/dist/types/src/capabilities/schema.d.ts +4 -0
- package/dist/types/src/capabilities/schema.d.ts.map +1 -0
- package/dist/types/src/capabilities/spaces-ready.d.ts +2 -2
- package/dist/types/src/capabilities/spaces-ready.d.ts.map +1 -1
- package/dist/types/src/capabilities/state.d.ts +2 -2
- package/dist/types/src/capabilities/state.d.ts.map +1 -1
- package/dist/types/src/components/AwaitingObject.d.ts.map +1 -1
- package/dist/types/src/components/CollectionMain.d.ts.map +1 -1
- package/dist/types/src/components/CollectionSection.d.ts.map +1 -1
- package/dist/types/src/components/CreateDialog/CreateObjectDialog.d.ts +2 -2
- package/dist/types/src/components/CreateDialog/CreateObjectDialog.d.ts.map +1 -1
- package/dist/types/src/components/CreateDialog/CreateObjectPanel.d.ts.map +1 -1
- package/dist/types/src/components/CreateDialog/CreateSpaceDialog.d.ts.map +1 -1
- package/dist/types/src/components/JoinDialog.d.ts.map +1 -1
- package/dist/types/src/components/MembersContainer.d.ts.map +1 -1
- package/dist/types/src/components/MembersContainer.stories.d.ts.map +1 -1
- package/dist/types/src/components/MenuFooter.d.ts +2 -2
- package/dist/types/src/components/MenuFooter.d.ts.map +1 -1
- package/dist/types/src/components/{ObjectSettings → ObjectSettingsContainer}/AdvancedObjectSettings.d.ts +2 -2
- package/dist/types/src/components/ObjectSettingsContainer/AdvancedObjectSettings.d.ts.map +1 -0
- package/dist/types/src/components/{ObjectSettings → ObjectSettingsContainer}/BaseObjectSettings.d.ts +2 -2
- package/dist/types/src/components/ObjectSettingsContainer/BaseObjectSettings.d.ts.map +1 -0
- package/dist/types/src/components/ObjectSettingsContainer/ForeignKeys.d.ts.map +1 -0
- package/dist/types/src/components/{ObjectSettings → ObjectSettingsContainer}/ObjectSettingsContainer.d.ts +2 -2
- package/dist/types/src/components/ObjectSettingsContainer/ObjectSettingsContainer.d.ts.map +1 -0
- package/dist/types/src/components/ObjectSettingsContainer/index.d.ts.map +1 -0
- package/dist/types/src/components/PersistenceStatus.d.ts.map +1 -1
- package/dist/types/src/components/PopoverAddSpace.d.ts +4 -0
- package/dist/types/src/components/PopoverAddSpace.d.ts.map +1 -0
- package/dist/types/src/components/PopoverRenameObject.d.ts +2 -2
- package/dist/types/src/components/PopoverRenameObject.d.ts.map +1 -1
- package/dist/types/src/components/PopoverRenameSpace.d.ts.map +1 -1
- package/dist/types/src/components/ShareSpaceButton.d.ts +9 -0
- package/dist/types/src/components/ShareSpaceButton.d.ts.map +1 -0
- package/dist/types/src/components/ShareSpaceButton.stories.d.ts +10 -0
- package/dist/types/src/components/ShareSpaceButton.stories.d.ts.map +1 -0
- package/dist/types/src/components/SpacePluginSettings.d.ts.map +1 -1
- package/dist/types/src/components/SpacePresence.d.ts.map +1 -1
- package/dist/types/src/components/SpacePresence.stories.d.ts.map +1 -1
- package/dist/types/src/components/SpaceSettings/SpacePropertiesForm.d.ts +7 -0
- package/dist/types/src/components/SpaceSettings/SpacePropertiesForm.d.ts.map +1 -0
- package/dist/types/src/components/SpaceSettings/SpacePropertiesForm.stories.d.ts +7 -0
- package/dist/types/src/components/SpaceSettings/SpacePropertiesForm.stories.d.ts.map +1 -0
- package/dist/types/src/components/SpaceSettings/SpaceSettingsContainer.d.ts +2 -0
- package/dist/types/src/components/SpaceSettings/SpaceSettingsContainer.d.ts.map +1 -1
- package/dist/types/src/components/SpaceSettings/index.d.ts +1 -0
- package/dist/types/src/components/SpaceSettings/index.d.ts.map +1 -1
- package/dist/types/src/components/SyncStatus/InlineSyncStatus.d.ts.map +1 -1
- package/dist/types/src/components/SyncStatus/Space.d.ts +13 -0
- package/dist/types/src/components/SyncStatus/Space.d.ts.map +1 -0
- package/dist/types/src/components/SyncStatus/SyncStatus.d.ts +8 -1
- package/dist/types/src/components/SyncStatus/SyncStatus.d.ts.map +1 -1
- package/dist/types/src/components/SyncStatus/SyncStatusDetail.stories.d.ts +9 -0
- package/dist/types/src/components/SyncStatus/SyncStatusDetail.stories.d.ts.map +1 -0
- package/dist/types/src/components/SyncStatus/save-tracker.d.ts.map +1 -1
- package/dist/types/src/components/SyncStatus/status.d.ts.map +1 -1
- package/dist/types/src/components/SyncStatus/sync-state.d.ts +18 -0
- package/dist/types/src/components/SyncStatus/sync-state.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +3 -2
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/hooks/index.d.ts +0 -2
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/usePath.d.ts +2 -3
- package/dist/types/src/hooks/usePath.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +0 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +242 -17
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/collection.d.ts +8 -9
- package/dist/types/src/types/collection.d.ts.map +1 -1
- package/dist/types/src/types/thread.d.ts +110 -205
- package/dist/types/src/types/thread.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +146 -157
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/src/util.d.ts +20 -36
- package/dist/types/src/util.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +44 -51
- package/src/SpacePlugin.tsx +20 -11
- package/src/capabilities/app-graph-builder.ts +230 -377
- package/src/capabilities/app-graph-serializer.ts +8 -8
- package/src/capabilities/identity-created.ts +5 -5
- package/src/capabilities/index.ts +2 -2
- package/src/capabilities/intent-resolver.ts +110 -94
- package/src/capabilities/react-surface.tsx +50 -111
- package/src/capabilities/schema-tool.test.ts +3 -2
- package/src/capabilities/schema-tools.ts +25 -25
- package/src/capabilities/schema.ts +27 -0
- package/src/capabilities/settings.ts +2 -2
- package/src/capabilities/spaces-ready.ts +14 -16
- package/src/capabilities/state.ts +5 -3
- package/src/components/AwaitingObject.tsx +1 -1
- package/src/components/CollectionMain.tsx +5 -2
- package/src/components/CreateDialog/CreateObjectDialog.stories.tsx +4 -4
- package/src/components/CreateDialog/CreateObjectDialog.tsx +4 -4
- package/src/components/CreateDialog/CreateObjectPanel.tsx +25 -3
- package/src/components/CreateDialog/CreateSpaceDialog.tsx +3 -6
- package/src/components/MembersContainer.stories.tsx +5 -1
- package/src/components/MembersContainer.tsx +54 -80
- package/src/components/MenuFooter.tsx +2 -2
- package/src/components/{ObjectSettings → ObjectSettingsContainer}/AdvancedObjectSettings.tsx +2 -2
- package/src/components/{ObjectSettings → ObjectSettingsContainer}/BaseObjectSettings.tsx +2 -2
- package/src/components/{ObjectSettings → ObjectSettingsContainer}/ObjectSettingsContainer.tsx +4 -4
- package/src/components/PersistenceStatus.tsx +14 -11
- package/src/components/PopoverAddSpace.tsx +46 -0
- package/src/components/PopoverRenameObject.tsx +8 -14
- package/src/components/PopoverRenameSpace.tsx +0 -8
- package/src/components/ShareSpaceButton.stories.tsx +27 -0
- package/src/components/ShareSpaceButton.tsx +32 -0
- package/src/components/SpacePluginSettings.tsx +2 -27
- package/src/components/SpacePresence.stories.tsx +1 -1
- package/src/components/SpacePresence.tsx +65 -60
- package/src/components/SpaceSettings/{SpaceSettingsContainer.stories.tsx → SpacePropertiesForm.stories.tsx} +6 -6
- package/src/components/SpaceSettings/SpacePropertiesForm.tsx +136 -0
- package/src/components/SpaceSettings/SpaceSettingsContainer.tsx +39 -159
- package/src/components/SpaceSettings/index.ts +1 -0
- package/src/components/SyncStatus/InlineSyncStatus.tsx +24 -15
- package/src/components/SyncStatus/Space.tsx +133 -0
- package/src/components/SyncStatus/SyncStatus.tsx +69 -6
- package/src/components/SyncStatus/SyncStatusDetail.stories.tsx +89 -0
- package/src/components/SyncStatus/sync-state.ts +101 -0
- package/src/components/index.ts +3 -2
- package/src/hooks/index.ts +0 -2
- package/src/hooks/usePath.ts +6 -9
- package/src/index.ts +0 -1
- package/src/translations.ts +7 -19
- package/src/types/collection.ts +4 -6
- package/src/types/thread.ts +8 -14
- package/src/types/types.ts +101 -115
- package/src/util.tsx +172 -75
- package/dist/lib/browser/app-graph-builder-7X3SIPCD.mjs +0 -328
- package/dist/lib/browser/app-graph-builder-7X3SIPCD.mjs.map +0 -7
- package/dist/lib/browser/app-graph-serializer-VRU57AEZ.mjs.map +0 -7
- package/dist/lib/browser/chunk-43UQWMD3.mjs.map +0 -7
- package/dist/lib/browser/chunk-AR5R2F6B.mjs +0 -88
- package/dist/lib/browser/chunk-AR5R2F6B.mjs.map +0 -7
- package/dist/lib/browser/chunk-CY35NLWL.mjs +0 -296
- package/dist/lib/browser/chunk-CY35NLWL.mjs.map +0 -7
- package/dist/lib/browser/chunk-IQFFOAWD.mjs.map +0 -7
- package/dist/lib/browser/chunk-UBSVH2NQ.mjs.map +0 -7
- package/dist/lib/browser/identity-created-ANRJHNMQ.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-KRINV5QI.mjs.map +0 -7
- package/dist/lib/browser/react-surface-J7T2IMH4.mjs.map +0 -7
- package/dist/lib/browser/schema-defs-OCBY7APN.mjs +0 -26
- package/dist/lib/browser/schema-defs-OCBY7APN.mjs.map +0 -7
- package/dist/lib/browser/schema-tools-MYC4LTQD.mjs.map +0 -7
- package/dist/lib/browser/settings-G24447B7.mjs.map +0 -7
- package/dist/lib/browser/spaces-ready-5I3RKYTT.mjs.map +0 -7
- package/dist/lib/browser/state-SI4B5GHC.mjs.map +0 -7
- package/dist/lib/node/app-graph-builder-C2ISDMSL.cjs +0 -328
- package/dist/lib/node/app-graph-builder-C2ISDMSL.cjs.map +0 -7
- package/dist/lib/node/app-graph-serializer-VLBCR3IX.cjs.map +0 -7
- package/dist/lib/node/chunk-5YHUQJVB.cjs.map +0 -7
- package/dist/lib/node/chunk-DQN4ZQDW.cjs +0 -119
- package/dist/lib/node/chunk-DQN4ZQDW.cjs.map +0 -7
- package/dist/lib/node/chunk-K6ZO4WDJ.cjs +0 -324
- package/dist/lib/node/chunk-K6ZO4WDJ.cjs.map +0 -7
- package/dist/lib/node/chunk-MXBE2VET.cjs.map +0 -7
- package/dist/lib/node/chunk-SCATWJKX.cjs.map +0 -7
- package/dist/lib/node/identity-created-NIPYGVG3.cjs.map +0 -7
- package/dist/lib/node/intent-resolver-MJVRY6YE.cjs.map +0 -7
- package/dist/lib/node/react-surface-RYKSYYKM.cjs.map +0 -7
- package/dist/lib/node/schema-defs-2HJLXSNK.cjs.map +0 -7
- package/dist/lib/node/schema-tools-OE3MFYYH.cjs.map +0 -7
- package/dist/lib/node/settings-AFWO4AWK.cjs.map +0 -7
- package/dist/lib/node/spaces-ready-BMPXSFHF.cjs.map +0 -7
- package/dist/lib/node/state-L2ZSDKLS.cjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-WVCQZ324.mjs +0 -329
- package/dist/lib/node-esm/app-graph-builder-WVCQZ324.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-serializer-GEUYYXKD.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-5NIBYPVF.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-CLRCW6PU.mjs +0 -297
- package/dist/lib/node-esm/chunk-CLRCW6PU.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-FI3WV22Y.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HNKAG5CX.mjs +0 -90
- package/dist/lib/node-esm/chunk-HNKAG5CX.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-S2W6HS4A.mjs.map +0 -7
- package/dist/lib/node-esm/identity-created-O5X2FFWU.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-JT6EB47M.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-ZNNMO7QQ.mjs.map +0 -7
- package/dist/lib/node-esm/schema-defs-B74N3GQ5.mjs +0 -27
- package/dist/lib/node-esm/schema-defs-B74N3GQ5.mjs.map +0 -7
- package/dist/lib/node-esm/schema-tools-YTJLA3NQ.mjs.map +0 -7
- package/dist/lib/node-esm/settings-MJVSCOI4.mjs.map +0 -7
- package/dist/lib/node-esm/spaces-ready-XKG57SL5.mjs.map +0 -7
- package/dist/lib/node-esm/state-QUDYGEU6.mjs.map +0 -7
- 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/components/ObjectSettings/AdvancedObjectSettings.d.ts.map +0 -1
- package/dist/types/src/components/ObjectSettings/BaseObjectSettings.d.ts.map +0 -1
- package/dist/types/src/components/ObjectSettings/ForeignKeys.d.ts.map +0 -1
- package/dist/types/src/components/ObjectSettings/ObjectSettingsContainer.d.ts.map +0 -1
- package/dist/types/src/components/ObjectSettings/index.d.ts.map +0 -1
- package/dist/types/src/components/SchemaContainer.d.ts +0 -13
- package/dist/types/src/components/SchemaContainer.d.ts.map +0 -1
- package/dist/types/src/components/SpaceSettings/SpaceSettingsContainer.stories.d.ts +0 -7
- package/dist/types/src/components/SpaceSettings/SpaceSettingsContainer.stories.d.ts.map +0 -1
- package/dist/types/src/hooks/useActiveSpace.d.ts +0 -4
- package/dist/types/src/hooks/useActiveSpace.d.ts.map +0 -1
- package/dist/types/src/hooks/useInputSurfaceLookup.d.ts +0 -14
- package/dist/types/src/hooks/useInputSurfaceLookup.d.ts.map +0 -1
- package/src/capabilities/schema-defs.ts +0 -30
- package/src/components/SchemaContainer.tsx +0 -59
- package/src/hooks/useActiveSpace.ts +0 -20
- package/src/hooks/useInputSurfaceLookup.tsx +0 -31
- /package/dist/lib/{browser/react-root-J3SP2HVW.mjs.map → node-esm/react-root-PRBJMWLQ.mjs.map} +0 -0
- /package/dist/types/src/components/{ObjectSettings → ObjectSettingsContainer}/ForeignKeys.d.ts +0 -0
- /package/dist/types/src/components/{ObjectSettings → ObjectSettingsContainer}/index.d.ts +0 -0
- /package/src/components/{ObjectSettings → ObjectSettingsContainer}/ForeignKeys.tsx +0 -0
- /package/src/components/{ObjectSettings → ObjectSettingsContainer}/index.ts +0 -0
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { Schema } from 'effect';
|
|
6
5
|
import { describe, it, expect } from 'vitest';
|
|
7
6
|
|
|
7
|
+
import { S } from '@dxos/echo-schema';
|
|
8
|
+
|
|
8
9
|
import { TypeNameSchema } from './schema-tools';
|
|
9
10
|
|
|
10
11
|
describe('TypeNameSchema format', () => {
|
|
@@ -28,7 +29,7 @@ describe('TypeNameSchema format', () => {
|
|
|
28
29
|
'.org/Type', // Must have domain
|
|
29
30
|
];
|
|
30
31
|
|
|
31
|
-
const validate =
|
|
32
|
+
const validate = S.validateSync(TypeNameSchema);
|
|
32
33
|
|
|
33
34
|
valid.forEach((typename) => {
|
|
34
35
|
it(`should accept valid typename: ${typename}`, () => {
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { DescriptionAnnotationId, ExamplesAnnotationId, TitleAnnotationId } from 'effect/SchemaAST';
|
|
6
6
|
|
|
7
7
|
import { Capabilities, contributes, type PromiseIntentDispatcher } from '@dxos/app-framework';
|
|
8
8
|
import { defineTool, ToolResult } from '@dxos/artifact';
|
|
9
9
|
import { type Space } from '@dxos/client/echo';
|
|
10
|
-
import { FormatEnum, FormatEnums, SelectOptionSchema, GeoPoint, toJsonSchema } from '@dxos/echo-schema';
|
|
10
|
+
import { FormatEnum, FormatEnums, S, SelectOptionSchema, GeoPoint, toJsonSchema } from '@dxos/echo-schema';
|
|
11
11
|
import { invariant } from '@dxos/invariant';
|
|
12
12
|
import { hues } from '@dxos/react-ui-theme';
|
|
13
13
|
import { getSchemaFromPropertyDefinitions } from '@dxos/schema';
|
|
@@ -21,13 +21,13 @@ declare global {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
// TODO(ZaymonFC): Move this somewhere common.
|
|
24
|
-
export const TypeNameSchema =
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
[
|
|
28
|
-
[
|
|
24
|
+
export const TypeNameSchema = S.String.pipe(
|
|
25
|
+
S.pattern(/^\w+\.\w{2,}\/[\w/]+$/i),
|
|
26
|
+
S.annotations({
|
|
27
|
+
[TitleAnnotationId]: 'TypeName',
|
|
28
|
+
[DescriptionAnnotationId]:
|
|
29
29
|
'Domain-style type name path. Dashes are not allowed. Use camel case for the final component of the type name.',
|
|
30
|
-
[
|
|
30
|
+
[ExamplesAnnotationId]: ['example.com/type/Document', 'example.com/type/FlightList'],
|
|
31
31
|
}),
|
|
32
32
|
);
|
|
33
33
|
|
|
@@ -36,23 +36,23 @@ const formatDescription = `The format of the property. Additional information:
|
|
|
36
36
|
This tuple is GeoJSON. You must specify \`${FormatEnum.GeoPoint}\` as [Longitude, Latitude]`;
|
|
37
37
|
|
|
38
38
|
// TODO(ZaymonFC): All properties are default optional, but maybe we should allow for required properties.
|
|
39
|
-
const PropertyDefinitionSchema =
|
|
40
|
-
name:
|
|
41
|
-
format:
|
|
42
|
-
[
|
|
39
|
+
const PropertyDefinitionSchema = S.Struct({
|
|
40
|
+
name: S.String.annotations({ [DescriptionAnnotationId]: 'The name of the property.' }),
|
|
41
|
+
format: S.Union(...FormatEnums.map((format) => S.Literal(format))).annotations({
|
|
42
|
+
[DescriptionAnnotationId]: formatDescription,
|
|
43
43
|
}),
|
|
44
|
-
config:
|
|
45
|
-
|
|
46
|
-
options:
|
|
47
|
-
|
|
44
|
+
config: S.optional(
|
|
45
|
+
S.Struct({
|
|
46
|
+
options: S.optional(
|
|
47
|
+
S.Array(SelectOptionSchema)
|
|
48
48
|
.annotations({
|
|
49
49
|
description: `Options for SingleSelect/MultiSelect formats. Available colors: ${hues.join(', ')}`,
|
|
50
50
|
})
|
|
51
|
-
.pipe(
|
|
51
|
+
.pipe(S.mutable),
|
|
52
52
|
),
|
|
53
53
|
}),
|
|
54
54
|
),
|
|
55
|
-
}).pipe(
|
|
55
|
+
}).pipe(S.mutable);
|
|
56
56
|
|
|
57
57
|
const SYSTEM_NAMESPACE = 'dxos.org/echo/schema';
|
|
58
58
|
|
|
@@ -62,7 +62,7 @@ export default () =>
|
|
|
62
62
|
name: 'list',
|
|
63
63
|
description: 'List registered schemas in the space.',
|
|
64
64
|
caption: 'Listing registered schemas...',
|
|
65
|
-
schema:
|
|
65
|
+
schema: S.Struct({}),
|
|
66
66
|
execute: async (_input, { extensions }) => {
|
|
67
67
|
invariant(extensions?.space, 'No space.');
|
|
68
68
|
const space = extensions.space;
|
|
@@ -80,8 +80,8 @@ export default () =>
|
|
|
80
80
|
name: 'get',
|
|
81
81
|
description: 'Get a specific schema by its typename.',
|
|
82
82
|
caption: 'Getting schema...',
|
|
83
|
-
schema:
|
|
84
|
-
typename:
|
|
83
|
+
schema: S.Struct({
|
|
84
|
+
typename: S.String.annotations({
|
|
85
85
|
description: 'The fully qualified typename of the schema.',
|
|
86
86
|
}),
|
|
87
87
|
}),
|
|
@@ -101,14 +101,14 @@ export default () =>
|
|
|
101
101
|
name: 'create',
|
|
102
102
|
description: 'Create a new schema with the provided definition.',
|
|
103
103
|
caption: 'Creating schema...',
|
|
104
|
-
schema:
|
|
104
|
+
schema: S.Struct({
|
|
105
105
|
typename: TypeNameSchema.annotations({
|
|
106
106
|
description:
|
|
107
107
|
'The fully qualified schema typename. Must start with a domain, and then one or more path components (e.g., "example.com/type/TypeName").',
|
|
108
108
|
}),
|
|
109
|
-
properties:
|
|
110
|
-
|
|
111
|
-
|
|
109
|
+
properties: S.Array(PropertyDefinitionSchema).pipe(
|
|
110
|
+
S.annotations({ description: 'Array of property definitions for the schema.' }),
|
|
111
|
+
S.mutable,
|
|
112
112
|
),
|
|
113
113
|
}),
|
|
114
114
|
execute: async ({ typename, properties }, { extensions }) => {
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { effect } from '@preact/signals-core';
|
|
6
|
+
|
|
7
|
+
import { Capabilities, contributes, type PluginsContext } from '@dxos/app-framework';
|
|
8
|
+
import { ClientCapabilities } from '@dxos/plugin-client';
|
|
9
|
+
|
|
10
|
+
import { SpaceCapabilities } from './capabilities';
|
|
11
|
+
import { type ObjectForm } from '../types';
|
|
12
|
+
|
|
13
|
+
export default (context: PluginsContext) => {
|
|
14
|
+
const client = context.requestCapability(ClientCapabilities.Client);
|
|
15
|
+
|
|
16
|
+
// TODO(wittjosiah): Unregister schemas when they are disabled.
|
|
17
|
+
let previous: ObjectForm[] = [];
|
|
18
|
+
const unsubscribe = effect(() => {
|
|
19
|
+
const forms = Array.from(new Set(context.requestCapabilities(SpaceCapabilities.ObjectForm)));
|
|
20
|
+
// TODO(wittjosiah): Filter out schemas which the client has already registered.
|
|
21
|
+
const newSchemas = forms.filter((form) => !previous.includes(form)).map((form) => form.objectSchema);
|
|
22
|
+
previous = forms;
|
|
23
|
+
client.addTypes(newSchemas);
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
return contributes(Capabilities.Null, null, () => unsubscribe());
|
|
27
|
+
};
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { Capabilities, contributes } from '@dxos/app-framework';
|
|
6
|
-
import {
|
|
6
|
+
import { create } from '@dxos/live-object';
|
|
7
7
|
|
|
8
8
|
import { SPACE_PLUGIN } from '../meta';
|
|
9
9
|
import { type SpaceSettingsProps, SpaceSettingsSchema } from '../types';
|
|
10
10
|
|
|
11
11
|
export default () => {
|
|
12
|
-
const settings =
|
|
12
|
+
const settings = create<SpaceSettingsProps>({
|
|
13
13
|
showHidden: false,
|
|
14
14
|
});
|
|
15
15
|
|
|
@@ -2,13 +2,11 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
import { contributes, createIntent, type PluginContext, Capabilities, LayoutAction } from '@dxos/app-framework';
|
|
5
|
+
import { contributes, createIntent, type PluginsContext, Capabilities, LayoutAction } from '@dxos/app-framework';
|
|
8
6
|
import { SubscriptionList } from '@dxos/async';
|
|
9
7
|
import { Expando } from '@dxos/echo-schema';
|
|
10
8
|
import { scheduledEffect } from '@dxos/echo-signals/core';
|
|
11
|
-
import {
|
|
9
|
+
import { create } from '@dxos/live-object';
|
|
12
10
|
import { log } from '@dxos/log';
|
|
13
11
|
import { AttentionCapabilities } from '@dxos/plugin-attention';
|
|
14
12
|
import { ClientCapabilities } from '@dxos/plugin-client';
|
|
@@ -25,17 +23,17 @@ import { COMPOSER_SPACE_LOCK, SHARED } from '../util';
|
|
|
25
23
|
const ACTIVE_NODE_BROADCAST_INTERVAL = 30_000;
|
|
26
24
|
const WAIT_FOR_OBJECT_TIMEOUT = 1000;
|
|
27
25
|
|
|
28
|
-
export default async (context:
|
|
26
|
+
export default async (context: PluginsContext) => {
|
|
29
27
|
const subscriptions = new SubscriptionList();
|
|
30
28
|
const spaceSubscriptions = new SubscriptionList();
|
|
31
29
|
|
|
32
|
-
const { dispatchPromise: dispatch } = context.
|
|
33
|
-
const { graph } = context.
|
|
34
|
-
const layout = context.
|
|
35
|
-
const deck = context.
|
|
36
|
-
const attention = context.
|
|
37
|
-
const state = context.
|
|
38
|
-
const client = context.
|
|
30
|
+
const { dispatchPromise: dispatch } = context.requestCapability(Capabilities.IntentDispatcher);
|
|
31
|
+
const { graph } = context.requestCapability(Capabilities.AppGraph);
|
|
32
|
+
const layout = context.requestCapability(Capabilities.Layout);
|
|
33
|
+
const deck = context.requestCapability(DeckCapabilities.DeckState);
|
|
34
|
+
const attention = context.requestCapability(AttentionCapabilities.Attention);
|
|
35
|
+
const state = context.requestCapability(SpaceCapabilities.MutableState);
|
|
36
|
+
const client = context.requestCapability(ClientCapabilities.Client);
|
|
39
37
|
|
|
40
38
|
const defaultSpace = client.spaces.default;
|
|
41
39
|
await defaultSpace.waitUntilReady();
|
|
@@ -51,11 +49,11 @@ export default async (context: PluginContext) => {
|
|
|
51
49
|
|
|
52
50
|
const {
|
|
53
51
|
objects: [spacesOrder],
|
|
54
|
-
} = await defaultSpace.db.query(Filter.
|
|
52
|
+
} = await defaultSpace.db.query(Filter.schema(Expando, { key: SHARED })).run();
|
|
55
53
|
if (!spacesOrder) {
|
|
56
54
|
// TODO(wittjosiah): Cannot be a Folder because Spaces are not TypedObjects so can't be saved in the database.
|
|
57
55
|
// Instead, we store order as an array of space ids.
|
|
58
|
-
defaultSpace.db.add(
|
|
56
|
+
defaultSpace.db.add(create({ key: SHARED, order: [] }));
|
|
59
57
|
}
|
|
60
58
|
|
|
61
59
|
// Await missing objects.
|
|
@@ -67,10 +65,10 @@ export default async (context: PluginContext) => {
|
|
|
67
65
|
return;
|
|
68
66
|
}
|
|
69
67
|
|
|
70
|
-
const node = graph.
|
|
68
|
+
const node = graph.findNode(active[0]);
|
|
71
69
|
if (!node && active[0].length === FQ_ID_LENGTH) {
|
|
72
70
|
const timeout = setTimeout(async () => {
|
|
73
|
-
const node = graph.
|
|
71
|
+
const node = graph.findNode(active[0]);
|
|
74
72
|
if (!node) {
|
|
75
73
|
await dispatch(createIntent(SpaceAction.WaitForObject, { id: active[0] }));
|
|
76
74
|
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { effect } from '@preact/signals-core';
|
|
6
6
|
|
|
7
|
-
import { Capabilities, contributes, type
|
|
7
|
+
import { Capabilities, contributes, type PluginsContext } from '@dxos/app-framework';
|
|
8
8
|
import { PublicKey } from '@dxos/keys';
|
|
9
9
|
import { LocalStorageStore } from '@dxos/local-storage';
|
|
10
10
|
import { ComplexMap } from '@dxos/util';
|
|
@@ -13,10 +13,12 @@ import { SpaceCapabilities } from './capabilities';
|
|
|
13
13
|
import { SPACE_PLUGIN } from '../meta';
|
|
14
14
|
import { type PluginState } from '../types';
|
|
15
15
|
|
|
16
|
-
export default (context:
|
|
16
|
+
export default (context: PluginsContext) => {
|
|
17
|
+
const sections = context.requestCapabilities(SpaceCapabilities.SettingsSection);
|
|
17
18
|
const state = new LocalStorageStore<PluginState>(SPACE_PLUGIN, {
|
|
18
19
|
awaiting: undefined,
|
|
19
20
|
spaceNames: {},
|
|
21
|
+
spaceSettingsOpenSections: sections.map((section) => section.id),
|
|
20
22
|
viewersByObject: {},
|
|
21
23
|
// TODO(wittjosiah): Stop using (Complex)Map inside reactive object.
|
|
22
24
|
viewersByIdentity: new ComplexMap(PublicKey.hash),
|
|
@@ -29,7 +31,7 @@ export default (context: PluginContext) => {
|
|
|
29
31
|
.prop({ key: 'spaceNames', type: LocalStorageStore.json<Record<string, string>>() })
|
|
30
32
|
.prop({ key: 'enabledEdgeReplication', type: LocalStorageStore.bool() });
|
|
31
33
|
|
|
32
|
-
const manager = context.
|
|
34
|
+
const manager = context.requestCapability(Capabilities.PluginManager);
|
|
33
35
|
const unsubscribe = effect(() => {
|
|
34
36
|
// TODO(wittjosiah): Find a way to make this capability-based.
|
|
35
37
|
const enabled = manager.enabled.includes('dxos.org/plugin/stack');
|
|
@@ -26,7 +26,7 @@ export const AwaitingObject = ({ id }: { id: string }) => {
|
|
|
26
26
|
const layout = useLayout();
|
|
27
27
|
|
|
28
28
|
const client = useClient();
|
|
29
|
-
const objects = useQuery(client.spaces, Filter.
|
|
29
|
+
const objects = useQuery(client.spaces, Filter.all());
|
|
30
30
|
|
|
31
31
|
useEffect(() => {
|
|
32
32
|
if (!id) {
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
7
|
import { useTranslation } from '@dxos/react-ui';
|
|
8
|
-
import { baseSurface,
|
|
8
|
+
import { baseSurface, descriptionText, mx } from '@dxos/react-ui-theme';
|
|
9
9
|
|
|
10
10
|
import { SPACE_PLUGIN } from '../meta';
|
|
11
11
|
import type { CollectionType } from '../types';
|
|
@@ -21,7 +21,10 @@ export const CollectionMain = ({ collection }: { collection: CollectionType }) =
|
|
|
21
21
|
>
|
|
22
22
|
<p
|
|
23
23
|
role='alert'
|
|
24
|
-
className={mx(
|
|
24
|
+
className={mx(
|
|
25
|
+
descriptionText,
|
|
26
|
+
'border border-dashed border-neutral-400/50 rounded-lg p-8 font-normal text-lg max-is-[24rem] break-words',
|
|
27
|
+
)}
|
|
25
28
|
>
|
|
26
29
|
{collection.name ?? t('unnamed collection label')}
|
|
27
30
|
</p>
|
|
@@ -7,7 +7,7 @@ import '@dxos-theme';
|
|
|
7
7
|
import { type Meta, type StoryObj } from '@storybook/react';
|
|
8
8
|
import React, { useEffect } from 'react';
|
|
9
9
|
|
|
10
|
-
import {
|
|
10
|
+
import { create, Filter, useQuery, useSpace } from '@dxos/react-client/echo';
|
|
11
11
|
import { withClientProvider } from '@dxos/react-client/testing';
|
|
12
12
|
import { Dialog } from '@dxos/react-ui';
|
|
13
13
|
import { osTranslations } from '@dxos/shell/react';
|
|
@@ -35,7 +35,7 @@ const meta: Meta<typeof CreateObjectDialog> = {
|
|
|
35
35
|
decorators: [
|
|
36
36
|
withClientProvider({ createIdentity: true, createSpace: true, types: [CollectionType] }),
|
|
37
37
|
withTheme,
|
|
38
|
-
withLayout(),
|
|
38
|
+
withLayout({ tooltips: true }),
|
|
39
39
|
],
|
|
40
40
|
parameters: {
|
|
41
41
|
translations: [...translations, osTranslations],
|
|
@@ -66,11 +66,11 @@ export const TargetSpace: StoryObj<typeof CreateObjectDialog> = {
|
|
|
66
66
|
export const TargetCollection: StoryObj<typeof CreateObjectDialog> = {
|
|
67
67
|
render: (args) => {
|
|
68
68
|
const space = useSpace();
|
|
69
|
-
const [collection] = useQuery(space, Filter.
|
|
69
|
+
const [collection] = useQuery(space, Filter.schema(CollectionType));
|
|
70
70
|
|
|
71
71
|
useEffect(() => {
|
|
72
72
|
if (space) {
|
|
73
|
-
space.db.add(
|
|
73
|
+
space.db.add(create(CollectionType, { name: 'My Collection', objects: [], views: {} }));
|
|
74
74
|
}
|
|
75
75
|
}, [space]);
|
|
76
76
|
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
} from '@dxos/app-framework';
|
|
17
17
|
import { invariant } from '@dxos/invariant';
|
|
18
18
|
import { useClient } from '@dxos/react-client';
|
|
19
|
-
import { getSpace,
|
|
19
|
+
import { getSpace, isReactiveObject, isSpace, type ReactiveObject, useSpaces } from '@dxos/react-client/echo';
|
|
20
20
|
import { Button, Dialog, Icon, useTranslation } from '@dxos/react-ui';
|
|
21
21
|
|
|
22
22
|
import { CreateObjectPanel, type CreateObjectPanelProps } from './CreateObjectPanel';
|
|
@@ -27,7 +27,7 @@ import { type ObjectForm, SpaceAction } from '../../types';
|
|
|
27
27
|
export const CREATE_OBJECT_DIALOG = `${SPACE_PLUGIN}/CreateObjectDialog`;
|
|
28
28
|
|
|
29
29
|
export type CreateObjectDialogProps = Pick<CreateObjectPanelProps, 'target' | 'typename' | 'name'> & {
|
|
30
|
-
shouldNavigate?: (object:
|
|
30
|
+
shouldNavigate?: (object: ReactiveObject<any>) => boolean;
|
|
31
31
|
};
|
|
32
32
|
|
|
33
33
|
export const CreateObjectDialog = ({
|
|
@@ -46,7 +46,7 @@ export const CreateObjectDialog = ({
|
|
|
46
46
|
|
|
47
47
|
const resolve = useCallback(
|
|
48
48
|
(typename: string) =>
|
|
49
|
-
manager.context.
|
|
49
|
+
manager.context.requestCapabilities(Capabilities.Metadata).find(({ id }) => id === typename)?.metadata ?? {},
|
|
50
50
|
[manager],
|
|
51
51
|
);
|
|
52
52
|
|
|
@@ -72,7 +72,7 @@ export const CreateObjectDialog = ({
|
|
|
72
72
|
invariant(space, 'Missing space');
|
|
73
73
|
const result = await dispatch(form.getIntent(data, { space }));
|
|
74
74
|
const object = result.data?.object;
|
|
75
|
-
if (
|
|
75
|
+
if (isReactiveObject(object)) {
|
|
76
76
|
const addObjectIntent = createIntent(SpaceAction.AddObject, { target, object, hidden: form.hidden });
|
|
77
77
|
const shouldNavigate = _shouldNavigate ?? (() => true);
|
|
78
78
|
if (shouldNavigate(object)) {
|
|
@@ -4,20 +4,42 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { useCallback, useState } from 'react';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { Surface, isSurfaceAvailable, usePluginManager } from '@dxos/app-framework';
|
|
8
|
+
import { getTypeAnnotation, type TypeAnnotation, type S } from '@dxos/echo-schema';
|
|
8
9
|
import { invariant } from '@dxos/invariant';
|
|
9
10
|
import { type SpaceId, type Space } from '@dxos/react-client/echo';
|
|
10
11
|
import { Icon, type ThemedClassName, toLocalizedString, useTranslation } from '@dxos/react-ui';
|
|
11
|
-
import { Form } from '@dxos/react-ui-form';
|
|
12
|
+
import { Form, type InputProps } from '@dxos/react-ui-form';
|
|
12
13
|
import { SearchList } from '@dxos/react-ui-searchlist';
|
|
13
14
|
import { mx } from '@dxos/react-ui-theme';
|
|
14
15
|
import { isNonNullable, type MaybePromise } from '@dxos/util';
|
|
15
16
|
|
|
16
|
-
import { useInputSurfaceLookup } from '../../hooks';
|
|
17
17
|
import { SPACE_PLUGIN } from '../../meta';
|
|
18
18
|
import { type ObjectForm, type CollectionType } from '../../types';
|
|
19
19
|
import { getSpaceDisplayName } from '../../util';
|
|
20
20
|
|
|
21
|
+
// TODO(ZaymonFC): Move this if you find yourself needing it elsewhere.
|
|
22
|
+
/**
|
|
23
|
+
* Creates a surface input component based on plugin context.
|
|
24
|
+
* @param baseData Additional data that will be merged with form data and passed to the surface.
|
|
25
|
+
* This allows providing more context to the surface than what's available from the form itself.
|
|
26
|
+
*/
|
|
27
|
+
const useInputSurfaceLookup = (baseData?: Record<string, any>) => {
|
|
28
|
+
const pluginManager = usePluginManager();
|
|
29
|
+
|
|
30
|
+
return useCallback(
|
|
31
|
+
({ prop, schema, inputProps }: { prop: string; schema: S.Schema<any>; inputProps: InputProps }) => {
|
|
32
|
+
const composedData = { prop, schema, ...baseData };
|
|
33
|
+
if (!isSurfaceAvailable(pluginManager.context, { role: 'form-input', data: composedData })) {
|
|
34
|
+
return undefined;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return <Surface role='form-input' data={composedData} {...inputProps} />;
|
|
38
|
+
},
|
|
39
|
+
[pluginManager, baseData],
|
|
40
|
+
);
|
|
41
|
+
};
|
|
42
|
+
|
|
21
43
|
export type CreateObjectPanelProps = ThemedClassName<{
|
|
22
44
|
forms: ObjectForm[];
|
|
23
45
|
spaces: Space[];
|
|
@@ -2,20 +2,20 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { Effect
|
|
5
|
+
import { Effect } from 'effect';
|
|
6
6
|
import React, { useCallback, useRef } from 'react';
|
|
7
7
|
|
|
8
8
|
import { createIntent, LayoutAction, useIntentDispatcher } from '@dxos/app-framework';
|
|
9
|
+
import { type S } from '@dxos/echo-schema';
|
|
9
10
|
import { Button, Dialog, Icon, useTranslation } from '@dxos/react-ui';
|
|
10
11
|
import { Form } from '@dxos/react-ui-form';
|
|
11
12
|
|
|
12
|
-
import { useInputSurfaceLookup } from '../../hooks';
|
|
13
13
|
import { SPACE_PLUGIN } from '../../meta';
|
|
14
14
|
import { SpaceAction, SpaceForm } from '../../types';
|
|
15
15
|
|
|
16
16
|
export const CREATE_SPACE_DIALOG = `${SPACE_PLUGIN}/CreateSpaceDialog`;
|
|
17
17
|
|
|
18
|
-
type FormValues =
|
|
18
|
+
type FormValues = S.Schema.Type<typeof SpaceForm>;
|
|
19
19
|
const initialValues: FormValues = { edgeReplication: true };
|
|
20
20
|
|
|
21
21
|
export const CreateSpaceDialog = () => {
|
|
@@ -23,8 +23,6 @@ export const CreateSpaceDialog = () => {
|
|
|
23
23
|
const { t } = useTranslation(SPACE_PLUGIN);
|
|
24
24
|
const { dispatch } = useIntentDispatcher();
|
|
25
25
|
|
|
26
|
-
const inputSurfaceLookup = useInputSurfaceLookup();
|
|
27
|
-
|
|
28
26
|
const handleCreateSpace = useCallback(
|
|
29
27
|
async (data: FormValues) => {
|
|
30
28
|
const program = Effect.gen(function* () {
|
|
@@ -56,7 +54,6 @@ export const CreateSpaceDialog = () => {
|
|
|
56
54
|
autoFocus
|
|
57
55
|
values={initialValues}
|
|
58
56
|
schema={SpaceForm}
|
|
59
|
-
lookupComponent={inputSurfaceLookup}
|
|
60
57
|
onSave={handleCreateSpace}
|
|
61
58
|
/>
|
|
62
59
|
</div>
|
|
@@ -16,7 +16,11 @@ import translations from '../translations';
|
|
|
16
16
|
const meta: Meta = {
|
|
17
17
|
title: 'plugins/plugin-space/MembersContainer',
|
|
18
18
|
component: MembersContainer,
|
|
19
|
-
decorators: [
|
|
19
|
+
decorators: [
|
|
20
|
+
withClientProvider({ createIdentity: true, createSpace: true }),
|
|
21
|
+
withTheme,
|
|
22
|
+
withLayout({ tooltips: true }),
|
|
23
|
+
],
|
|
20
24
|
parameters: {
|
|
21
25
|
layout: 'fullscreen',
|
|
22
26
|
translations: [...translations, osTranslations],
|