@dxos/plugin-space 0.8.1 → 0.8.2-main.2f9c567
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 → app-graph-builder-I2BU35J5.mjs} +61 -7
- package/dist/lib/browser/app-graph-builder-I2BU35J5.mjs.map +7 -0
- package/dist/lib/browser/{app-graph-serializer-DSF2U3A5.mjs → app-graph-serializer-HPYDOKA5.mjs} +8 -8
- package/dist/lib/browser/app-graph-serializer-HPYDOKA5.mjs.map +7 -0
- package/dist/lib/browser/{chunk-5BDV575R.mjs → chunk-OS5QKO4Z.mjs} +20 -8
- package/dist/lib/browser/chunk-OS5QKO4Z.mjs.map +7 -0
- package/dist/lib/browser/{chunk-LO5UL6RU.mjs → chunk-RERTVPBV.mjs} +60 -141
- package/dist/lib/browser/chunk-RERTVPBV.mjs.map +7 -0
- package/dist/lib/browser/{chunk-JZXWPMLA.mjs → chunk-TSX67XGX.mjs} +526 -670
- package/dist/lib/browser/chunk-TSX67XGX.mjs.map +7 -0
- package/dist/lib/browser/chunk-YQNBTJI4.mjs +308 -0
- package/dist/lib/browser/chunk-YQNBTJI4.mjs.map +7 -0
- package/dist/lib/browser/{identity-created-JR7BNXFH.mjs → identity-created-DWFKBGOA.mjs} +4 -4
- package/dist/lib/browser/identity-created-DWFKBGOA.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +19 -40
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-resolver-RKYILWWQ.mjs → intent-resolver-GKDCJ4H2.mjs} +92 -82
- package/dist/lib/browser/intent-resolver-GKDCJ4H2.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-root-6H7NX2M2.mjs → react-root-667IZ2Q4.mjs} +4 -4
- package/dist/lib/browser/{react-surface-7AGLOVMK.mjs → react-surface-I4RNTGGN.mjs} +121 -47
- package/dist/lib/browser/react-surface-I4RNTGGN.mjs.map +7 -0
- package/dist/lib/browser/{schema-FHTA26SW.mjs → schema-defs-FLFEUSLB.mjs} +4 -4
- package/dist/lib/browser/{schema-FHTA26SW.mjs.map → schema-defs-FLFEUSLB.mjs.map} +2 -2
- package/dist/lib/browser/{schema-tools-YAXPRIXP.mjs → schema-tools-MYC4LTQD.mjs} +22 -22
- package/dist/lib/browser/schema-tools-MYC4LTQD.mjs.map +7 -0
- package/dist/lib/browser/{settings-PJPTJUPE.mjs → settings-ILGGNYJ7.mjs} +4 -4
- package/dist/lib/browser/settings-ILGGNYJ7.mjs.map +7 -0
- package/dist/lib/browser/{spaces-ready-BSSP7HHG.mjs → spaces-ready-IXZF3RWW.mjs} +5 -5
- package/dist/lib/browser/spaces-ready-IXZF3RWW.mjs.map +7 -0
- package/dist/lib/browser/{state-X7VLCC6E.mjs → state-CYV6QCTN.mjs} +1 -3
- package/dist/lib/browser/state-CYV6QCTN.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +7 -1
- package/dist/lib/node/{app-graph-builder-DPY7AUZE.cjs → app-graph-builder-H7MDHM3X.cjs} +83 -30
- package/dist/lib/node/app-graph-builder-H7MDHM3X.cjs.map +7 -0
- package/dist/lib/node/{app-graph-serializer-JELGJUAY.cjs → app-graph-serializer-G7UYFWG6.cjs} +20 -20
- package/dist/lib/node/app-graph-serializer-G7UYFWG6.cjs.map +7 -0
- package/dist/lib/node/chunk-AR3JHVCY.cjs +336 -0
- package/dist/lib/node/chunk-AR3JHVCY.cjs.map +7 -0
- package/dist/lib/node/{chunk-TUZWEPGX.cjs → chunk-EG3WAZLA.cjs} +84 -167
- package/dist/lib/node/chunk-EG3WAZLA.cjs.map +7 -0
- package/dist/lib/node/{chunk-3GKCNADA.cjs → chunk-HD4C6KKO.cjs} +517 -659
- package/dist/lib/node/chunk-HD4C6KKO.cjs.map +7 -0
- package/dist/lib/node/{chunk-PU2EYH4E.cjs → chunk-NCSFM6RA.cjs} +24 -12
- package/dist/lib/node/chunk-NCSFM6RA.cjs.map +7 -0
- package/dist/lib/node/{identity-created-XU4HFV2T.cjs → identity-created-YLGVEWAJ.cjs} +6 -6
- package/dist/lib/node/identity-created-YLGVEWAJ.cjs.map +7 -0
- package/dist/lib/node/index.cjs +73 -94
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/{intent-resolver-VJ7YV74L.cjs → intent-resolver-V7UJKLE7.cjs} +141 -131
- package/dist/lib/node/intent-resolver-V7UJKLE7.cjs.map +7 -0
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/{react-root-TEL5RW3N.cjs → react-root-I3SSFA5O.cjs} +8 -8
- package/dist/lib/node/{react-surface-2H3S5TY5.cjs → react-surface-OLMQCCYD.cjs} +146 -74
- package/dist/lib/node/react-surface-OLMQCCYD.cjs.map +7 -0
- package/dist/lib/node/{schema-PPJ5BZ3A.cjs → schema-defs-PKZVL52M.cjs} +6 -6
- package/dist/lib/node/{schema-PPJ5BZ3A.cjs.map → schema-defs-PKZVL52M.cjs.map} +2 -2
- package/dist/lib/node/{schema-tools-BLIMOZYY.cjs → schema-tools-OE3MFYYH.cjs} +24 -24
- package/dist/lib/node/schema-tools-OE3MFYYH.cjs.map +7 -0
- package/dist/lib/node/{settings-WVFP2UEP.cjs → settings-7TC55JP4.cjs} +7 -7
- package/dist/lib/node/settings-7TC55JP4.cjs.map +7 -0
- package/dist/lib/node/{spaces-ready-7DNZSUOG.cjs → spaces-ready-4H3Q46GV.cjs} +12 -12
- package/dist/lib/node/spaces-ready-4H3Q46GV.cjs.map +7 -0
- package/dist/lib/node/{state-5KX6WBJH.cjs → state-JLN7TGRR.cjs} +4 -6
- package/dist/lib/node/state-JLN7TGRR.cjs.map +7 -0
- package/dist/lib/node/types/index.cjs +18 -12
- package/dist/lib/node/types/index.cjs.map +2 -2
- package/dist/lib/node-esm/{app-graph-builder-42IGWRPL.mjs → app-graph-builder-NI7X6W3Q.mjs} +61 -7
- package/dist/lib/node-esm/app-graph-builder-NI7X6W3Q.mjs.map +7 -0
- package/dist/lib/node-esm/{app-graph-serializer-FXONFKOE.mjs → app-graph-serializer-CVPYWWW3.mjs} +8 -8
- package/dist/lib/node-esm/app-graph-serializer-CVPYWWW3.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-ZGLK25WQ.mjs → chunk-B2P24Q5R.mjs} +60 -141
- package/dist/lib/node-esm/chunk-B2P24Q5R.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-BEWBZ4Q4.mjs → chunk-BU6F7ZU4.mjs} +526 -670
- package/dist/lib/node-esm/chunk-BU6F7ZU4.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-3ZOUV4DF.mjs → chunk-FUH5OODY.mjs} +20 -8
- package/dist/lib/node-esm/chunk-FUH5OODY.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-RUWTHAV7.mjs +309 -0
- package/dist/lib/node-esm/chunk-RUWTHAV7.mjs.map +7 -0
- package/dist/lib/node-esm/{identity-created-WJKAS2PV.mjs → identity-created-7NHGER3Q.mjs} +4 -4
- package/dist/lib/node-esm/identity-created-7NHGER3Q.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +19 -40
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/{intent-resolver-ZFNSA4CM.mjs → intent-resolver-IL63YTIT.mjs} +92 -82
- package/dist/lib/node-esm/intent-resolver-IL63YTIT.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-root-PRBJMWLQ.mjs → react-root-JEGVIVVK.mjs} +4 -4
- package/dist/lib/node-esm/{react-surface-RCZG2PNF.mjs → react-surface-DRRXIJBE.mjs} +121 -47
- package/dist/lib/node-esm/react-surface-DRRXIJBE.mjs.map +7 -0
- package/dist/lib/node-esm/{schema-OUZKVYM5.mjs → schema-defs-IIEQR7B3.mjs} +4 -4
- package/dist/lib/node-esm/{schema-OUZKVYM5.mjs.map → schema-defs-IIEQR7B3.mjs.map} +2 -2
- package/dist/lib/node-esm/{schema-tools-IU7EX5A5.mjs → schema-tools-YTJLA3NQ.mjs} +22 -22
- package/dist/lib/node-esm/schema-tools-YTJLA3NQ.mjs.map +7 -0
- package/dist/lib/node-esm/{settings-FJZPC2TV.mjs → settings-CXMV2AFR.mjs} +4 -4
- package/dist/lib/node-esm/settings-CXMV2AFR.mjs.map +7 -0
- package/dist/lib/node-esm/{spaces-ready-7X5PGB2V.mjs → spaces-ready-QMXLQ4QV.mjs} +5 -5
- package/dist/lib/node-esm/spaces-ready-QMXLQ4QV.mjs.map +7 -0
- package/dist/lib/node-esm/{state-Z6E2YTNC.mjs → state-YZPY5T5A.mjs} +1 -3
- package/dist/lib/node-esm/state-YZPY5T5A.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +7 -1
- package/dist/types/src/SpacePlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +3 -2
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +2 -1
- 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.d.ts → schema-defs.d.ts} +1 -1
- package/dist/types/src/capabilities/schema-defs.d.ts.map +1 -0
- 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/state.d.ts.map +1 -1
- package/dist/types/src/components/CollectionMain.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/MembersContainer.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/{ObjectSettingsContainer → ObjectSettings}/AdvancedObjectSettings.d.ts +2 -2
- package/dist/types/src/components/ObjectSettings/AdvancedObjectSettings.d.ts.map +1 -0
- package/dist/types/src/components/{ObjectSettingsContainer → ObjectSettings}/BaseObjectSettings.d.ts +2 -2
- package/dist/types/src/components/ObjectSettings/BaseObjectSettings.d.ts.map +1 -0
- package/dist/types/src/components/ObjectSettings/ForeignKeys.d.ts.map +1 -0
- package/dist/types/src/components/{ObjectSettingsContainer → ObjectSettings}/ObjectSettingsContainer.d.ts +2 -2
- package/dist/types/src/components/ObjectSettings/ObjectSettingsContainer.d.ts.map +1 -0
- package/dist/types/src/components/ObjectSettings/index.d.ts.map +1 -0
- package/dist/types/src/components/PopoverAddSpace.d.ts.map +1 -1
- 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/SchemaContainer.d.ts +13 -0
- package/dist/types/src/components/SchemaContainer.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/SpaceSettings/SpaceSettingsContainer.d.ts +0 -2
- package/dist/types/src/components/SpaceSettings/SpaceSettingsContainer.d.ts.map +1 -1
- package/dist/types/src/components/SpaceSettings/SpaceSettingsContainer.stories.d.ts +7 -0
- package/dist/types/src/components/SpaceSettings/SpaceSettingsContainer.stories.d.ts.map +1 -0
- package/dist/types/src/components/SpaceSettings/index.d.ts +0 -1
- 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/SyncStatus.d.ts +1 -8
- package/dist/types/src/components/SyncStatus/SyncStatus.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +2 -2
- package/dist/types/src/components/index.d.ts.map +1 -1
- 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/useInputSurfaceLookup.d.ts +14 -0
- package/dist/types/src/hooks/useInputSurfaceLookup.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +45 -9
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/collection.d.ts +9 -8
- package/dist/types/src/types/collection.d.ts.map +1 -1
- package/dist/types/src/types/thread.d.ts +329 -110
- package/dist/types/src/types/thread.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +167 -140
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/src/util.d.ts +31 -9
- package/dist/types/src/util.d.ts.map +1 -1
- package/package.json +46 -44
- package/src/SpacePlugin.tsx +11 -20
- package/src/capabilities/app-graph-builder.ts +47 -8
- package/src/capabilities/app-graph-serializer.ts +4 -4
- package/src/capabilities/identity-created.ts +2 -2
- package/src/capabilities/index.ts +2 -2
- package/src/capabilities/intent-resolver.ts +87 -84
- package/src/capabilities/react-surface.tsx +111 -42
- package/src/capabilities/schema-tool.test.ts +2 -3
- package/src/capabilities/schema-tools.ts +25 -25
- package/src/capabilities/settings.ts +2 -2
- package/src/capabilities/spaces-ready.ts +2 -2
- package/src/capabilities/state.ts +0 -2
- package/src/components/CollectionMain.tsx +2 -5
- package/src/components/CreateDialog/CreateObjectDialog.stories.tsx +2 -2
- package/src/components/CreateDialog/CreateObjectDialog.tsx +3 -3
- package/src/components/CreateDialog/CreateObjectPanel.tsx +3 -25
- package/src/components/CreateDialog/CreateSpaceDialog.tsx +6 -3
- package/src/components/MembersContainer.tsx +80 -54
- package/src/components/MenuFooter.tsx +2 -2
- package/src/components/{ObjectSettingsContainer → ObjectSettings}/AdvancedObjectSettings.tsx +2 -2
- package/src/components/{ObjectSettingsContainer → ObjectSettings}/BaseObjectSettings.tsx +2 -2
- package/src/components/{ObjectSettingsContainer → ObjectSettings}/ObjectSettingsContainer.tsx +2 -2
- package/src/components/PopoverAddSpace.tsx +9 -3
- package/src/components/PopoverRenameObject.tsx +14 -8
- package/src/components/PopoverRenameSpace.tsx +8 -0
- package/src/components/SchemaContainer.tsx +59 -0
- package/src/components/SpacePluginSettings.tsx +27 -2
- package/src/components/SpacePresence.tsx +29 -25
- package/src/components/SpaceSettings/{SpacePropertiesForm.stories.tsx → SpaceSettingsContainer.stories.tsx} +6 -6
- package/src/components/SpaceSettings/SpaceSettingsContainer.tsx +159 -39
- package/src/components/SpaceSettings/index.ts +0 -1
- package/src/components/SyncStatus/InlineSyncStatus.tsx +5 -7
- package/src/components/SyncStatus/SyncStatus.tsx +6 -69
- package/src/components/index.ts +2 -2
- package/src/hooks/index.ts +1 -0
- package/src/hooks/useInputSurfaceLookup.tsx +31 -0
- package/src/translations.ts +18 -5
- package/src/types/collection.ts +6 -4
- package/src/types/thread.ts +14 -8
- package/src/types/types.ts +128 -101
- package/src/util.tsx +52 -112
- package/dist/lib/browser/app-graph-builder-GMFCSOLG.mjs.map +0 -7
- package/dist/lib/browser/app-graph-serializer-DSF2U3A5.mjs.map +0 -7
- package/dist/lib/browser/chunk-5BDV575R.mjs.map +0 -7
- package/dist/lib/browser/chunk-AYW4IDRT.mjs +0 -275
- package/dist/lib/browser/chunk-AYW4IDRT.mjs.map +0 -7
- package/dist/lib/browser/chunk-JZXWPMLA.mjs.map +0 -7
- package/dist/lib/browser/chunk-LO5UL6RU.mjs.map +0 -7
- package/dist/lib/browser/identity-created-JR7BNXFH.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-RKYILWWQ.mjs.map +0 -7
- package/dist/lib/browser/react-surface-7AGLOVMK.mjs.map +0 -7
- package/dist/lib/browser/schema-tools-YAXPRIXP.mjs.map +0 -7
- package/dist/lib/browser/settings-PJPTJUPE.mjs.map +0 -7
- package/dist/lib/browser/spaces-ready-BSSP7HHG.mjs.map +0 -7
- package/dist/lib/browser/state-X7VLCC6E.mjs.map +0 -7
- package/dist/lib/node/app-graph-builder-DPY7AUZE.cjs.map +0 -7
- package/dist/lib/node/app-graph-serializer-JELGJUAY.cjs.map +0 -7
- package/dist/lib/node/chunk-3GKCNADA.cjs.map +0 -7
- package/dist/lib/node/chunk-PU2EYH4E.cjs.map +0 -7
- package/dist/lib/node/chunk-TUZWEPGX.cjs.map +0 -7
- package/dist/lib/node/chunk-WDEIFDTX.cjs +0 -300
- package/dist/lib/node/chunk-WDEIFDTX.cjs.map +0 -7
- package/dist/lib/node/identity-created-XU4HFV2T.cjs.map +0 -7
- package/dist/lib/node/intent-resolver-VJ7YV74L.cjs.map +0 -7
- package/dist/lib/node/react-surface-2H3S5TY5.cjs.map +0 -7
- package/dist/lib/node/schema-tools-BLIMOZYY.cjs.map +0 -7
- package/dist/lib/node/settings-WVFP2UEP.cjs.map +0 -7
- package/dist/lib/node/spaces-ready-7DNZSUOG.cjs.map +0 -7
- package/dist/lib/node/state-5KX6WBJH.cjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-42IGWRPL.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-serializer-FXONFKOE.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-3ZOUV4DF.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-BEWBZ4Q4.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-FC4UHDPL.mjs +0 -276
- package/dist/lib/node-esm/chunk-FC4UHDPL.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-ZGLK25WQ.mjs.map +0 -7
- package/dist/lib/node-esm/identity-created-WJKAS2PV.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-ZFNSA4CM.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-RCZG2PNF.mjs.map +0 -7
- package/dist/lib/node-esm/schema-tools-IU7EX5A5.mjs.map +0 -7
- package/dist/lib/node-esm/settings-FJZPC2TV.mjs.map +0 -7
- package/dist/lib/node-esm/spaces-ready-7X5PGB2V.mjs.map +0 -7
- package/dist/lib/node-esm/state-Z6E2YTNC.mjs.map +0 -7
- package/dist/types/src/capabilities/schema.d.ts.map +0 -1
- package/dist/types/src/components/ObjectSettingsContainer/AdvancedObjectSettings.d.ts.map +0 -1
- package/dist/types/src/components/ObjectSettingsContainer/BaseObjectSettings.d.ts.map +0 -1
- package/dist/types/src/components/ObjectSettingsContainer/ForeignKeys.d.ts.map +0 -1
- package/dist/types/src/components/ObjectSettingsContainer/ObjectSettingsContainer.d.ts.map +0 -1
- package/dist/types/src/components/ObjectSettingsContainer/index.d.ts.map +0 -1
- package/dist/types/src/components/ShareSpaceButton.d.ts +0 -9
- package/dist/types/src/components/ShareSpaceButton.d.ts.map +0 -1
- package/dist/types/src/components/ShareSpaceButton.stories.d.ts +0 -10
- package/dist/types/src/components/ShareSpaceButton.stories.d.ts.map +0 -1
- package/dist/types/src/components/SpaceSettings/SpacePropertiesForm.d.ts +0 -7
- package/dist/types/src/components/SpaceSettings/SpacePropertiesForm.d.ts.map +0 -1
- package/dist/types/src/components/SpaceSettings/SpacePropertiesForm.stories.d.ts +0 -7
- package/dist/types/src/components/SpaceSettings/SpacePropertiesForm.stories.d.ts.map +0 -1
- package/dist/types/src/components/SyncStatus/Space.d.ts +0 -13
- package/dist/types/src/components/SyncStatus/Space.d.ts.map +0 -1
- package/dist/types/src/components/SyncStatus/SyncStatusDetail.stories.d.ts +0 -9
- package/dist/types/src/components/SyncStatus/SyncStatusDetail.stories.d.ts.map +0 -1
- package/dist/types/src/components/SyncStatus/sync-state.d.ts +0 -18
- package/dist/types/src/components/SyncStatus/sync-state.d.ts.map +0 -1
- package/src/components/ShareSpaceButton.stories.tsx +0 -27
- package/src/components/ShareSpaceButton.tsx +0 -32
- package/src/components/SpaceSettings/SpacePropertiesForm.tsx +0 -136
- package/src/components/SyncStatus/Space.tsx +0 -133
- package/src/components/SyncStatus/SyncStatusDetail.stories.tsx +0 -89
- package/src/components/SyncStatus/sync-state.ts +0 -101
- /package/dist/lib/browser/{react-root-6H7NX2M2.mjs.map → react-root-667IZ2Q4.mjs.map} +0 -0
- /package/dist/lib/node/{react-root-TEL5RW3N.cjs.map → react-root-I3SSFA5O.cjs.map} +0 -0
- /package/dist/lib/node-esm/{react-root-PRBJMWLQ.mjs.map → react-root-JEGVIVVK.mjs.map} +0 -0
- /package/dist/types/src/components/{ObjectSettingsContainer → ObjectSettings}/ForeignKeys.d.ts +0 -0
- /package/dist/types/src/components/{ObjectSettingsContainer → ObjectSettings}/index.d.ts +0 -0
- /package/src/capabilities/{schema.ts → schema-defs.ts} +0 -0
- /package/src/components/{ObjectSettingsContainer → ObjectSettings}/ForeignKeys.tsx +0 -0
- /package/src/components/{ObjectSettingsContainer → ObjectSettings}/index.ts +0 -0
|
@@ -2,20 +2,27 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import { type Schema } from 'effect';
|
|
6
|
+
import React, { useCallback } from 'react';
|
|
6
7
|
|
|
7
|
-
import { Capabilities, contributes, createSurface, Surface, useCapability } from '@dxos/app-framework';
|
|
8
|
+
import { Capabilities, contributes, createSurface, Surface, useCapability, useLayout } from '@dxos/app-framework';
|
|
8
9
|
import { isInstanceOf } from '@dxos/echo-schema';
|
|
10
|
+
import { findAnnotation } from '@dxos/effect';
|
|
9
11
|
import { SettingsStore } from '@dxos/local-storage';
|
|
10
12
|
import {
|
|
11
13
|
getSpace,
|
|
12
14
|
isEchoObject,
|
|
13
|
-
|
|
15
|
+
isLiveObject,
|
|
14
16
|
isSpace,
|
|
17
|
+
parseId,
|
|
15
18
|
SpaceState,
|
|
16
|
-
|
|
19
|
+
useSpace,
|
|
20
|
+
type AnyLiveObject,
|
|
17
21
|
type Space,
|
|
18
22
|
} from '@dxos/react-client/echo';
|
|
23
|
+
import { Input } from '@dxos/react-ui';
|
|
24
|
+
import { type InputProps } from '@dxos/react-ui-form';
|
|
25
|
+
import { HuePicker, IconPicker } from '@dxos/react-ui-pickers';
|
|
19
26
|
import { type JoinPanelProps } from '@dxos/shell/react';
|
|
20
27
|
|
|
21
28
|
import { SpaceCapabilities } from './capabilities';
|
|
@@ -41,13 +48,13 @@ import {
|
|
|
41
48
|
type CreateObjectDialogProps,
|
|
42
49
|
POPOVER_ADD_SPACE,
|
|
43
50
|
PopoverAddSpace,
|
|
44
|
-
SpaceSettingsContainer,
|
|
45
|
-
SpacePropertiesForm,
|
|
46
51
|
MembersContainer,
|
|
47
52
|
ObjectSettingsContainer,
|
|
53
|
+
SpaceSettingsContainer,
|
|
54
|
+
SchemaContainer,
|
|
48
55
|
} from '../components';
|
|
49
56
|
import { SPACE_PLUGIN } from '../meta';
|
|
50
|
-
import { CollectionType, type SpaceSettingsProps } from '../types';
|
|
57
|
+
import { CollectionType, HueAnnotationId, IconAnnotationId, type SpaceSettingsProps } from '../types';
|
|
51
58
|
|
|
52
59
|
type ReactSurfaceOptions = {
|
|
53
60
|
createInvitationUrl: (invitationCode: string) => string;
|
|
@@ -77,33 +84,64 @@ export default ({ createInvitationUrl }: ReactSurfaceOptions) =>
|
|
|
77
84
|
component: ({ data }) => <CollectionMain collection={data.subject} />,
|
|
78
85
|
}),
|
|
79
86
|
createSurface({
|
|
80
|
-
id: `${SPACE_PLUGIN}/
|
|
81
|
-
role: 'article',
|
|
82
|
-
position: 'hoist',
|
|
83
|
-
filter: (data): data is { subject: Space; variant: 'members' } =>
|
|
84
|
-
isSpace(data.subject) && data.variant === 'members',
|
|
85
|
-
component: ({ data }) => <MembersContainer space={data.subject} createInvitationUrl={createInvitationUrl} />,
|
|
86
|
-
}),
|
|
87
|
-
createSurface({
|
|
88
|
-
id: `${SPACE_PLUGIN}/settings`,
|
|
87
|
+
id: `${SPACE_PLUGIN}/plugin-settings`,
|
|
89
88
|
role: 'article',
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
component: ({ data }) => <SpaceSettingsContainer space={data.subject} />,
|
|
89
|
+
filter: (data): data is { subject: SettingsStore<SpaceSettingsProps> } =>
|
|
90
|
+
data.subject instanceof SettingsStore && data.subject.prefix === SPACE_PLUGIN,
|
|
91
|
+
component: ({ data: { subject } }) => <SpacePluginSettings settings={subject.value} />,
|
|
94
92
|
}),
|
|
95
93
|
createSurface({
|
|
96
94
|
id: `${SPACE_PLUGIN}/companion/object-settings`,
|
|
97
95
|
role: 'article',
|
|
98
|
-
filter: (data): data is { companionTo:
|
|
96
|
+
filter: (data): data is { companionTo: AnyLiveObject<any> } =>
|
|
99
97
|
isEchoObject(data.companionTo) && data.subject === 'settings',
|
|
100
98
|
component: ({ data, role }) => <ObjectSettingsContainer object={data.companionTo} role={role} />,
|
|
101
99
|
}),
|
|
102
100
|
createSurface({
|
|
103
|
-
id: `${SPACE_PLUGIN}/space-settings
|
|
104
|
-
role: '
|
|
105
|
-
filter: (data): data is { subject:
|
|
106
|
-
component: (
|
|
101
|
+
id: `${SPACE_PLUGIN}/space-settings-properties`,
|
|
102
|
+
role: 'article',
|
|
103
|
+
filter: (data): data is { subject: string } => data.subject === `${SPACE_PLUGIN}/properties`,
|
|
104
|
+
component: () => {
|
|
105
|
+
const layout = useLayout();
|
|
106
|
+
const { spaceId } = parseId(layout.workspace);
|
|
107
|
+
const space = useSpace(spaceId);
|
|
108
|
+
if (!space || !spaceId) {
|
|
109
|
+
return null;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
return <SpaceSettingsContainer space={space} />;
|
|
113
|
+
},
|
|
114
|
+
}),
|
|
115
|
+
createSurface({
|
|
116
|
+
id: `${SPACE_PLUGIN}/space-settings-members`,
|
|
117
|
+
role: 'article',
|
|
118
|
+
position: 'hoist',
|
|
119
|
+
filter: (data): data is { subject: string } => data.subject === `${SPACE_PLUGIN}/members`,
|
|
120
|
+
component: () => {
|
|
121
|
+
const layout = useLayout();
|
|
122
|
+
const { spaceId } = parseId(layout.workspace);
|
|
123
|
+
const space = useSpace(spaceId);
|
|
124
|
+
if (!space || !spaceId) {
|
|
125
|
+
return null;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
return <MembersContainer space={space} createInvitationUrl={createInvitationUrl} />;
|
|
129
|
+
},
|
|
130
|
+
}),
|
|
131
|
+
createSurface({
|
|
132
|
+
id: `${SPACE_PLUGIN}/space-settings-schema`,
|
|
133
|
+
role: 'article',
|
|
134
|
+
filter: (data): data is { subject: string } => data.subject === `${SPACE_PLUGIN}/schema`,
|
|
135
|
+
component: () => {
|
|
136
|
+
const layout = useLayout();
|
|
137
|
+
const { spaceId } = parseId(layout.workspace);
|
|
138
|
+
const space = useSpace(spaceId);
|
|
139
|
+
if (!space || !spaceId) {
|
|
140
|
+
return null;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
return <SchemaContainer space={space} />;
|
|
144
|
+
},
|
|
107
145
|
}),
|
|
108
146
|
createSurface({
|
|
109
147
|
id: JOIN_DIALOG,
|
|
@@ -123,6 +161,44 @@ export default ({ createInvitationUrl }: ReactSurfaceOptions) =>
|
|
|
123
161
|
filter: (data): data is { props: CreateObjectDialogProps } => data.component === CREATE_OBJECT_DIALOG,
|
|
124
162
|
component: ({ data }) => <CreateObjectDialog {...data.props} />,
|
|
125
163
|
}),
|
|
164
|
+
createSurface({
|
|
165
|
+
id: `${SPACE_PLUGIN}/create-initial-space-form-[hue]`,
|
|
166
|
+
role: 'form-input',
|
|
167
|
+
filter: (data): data is { prop: string; schema: Schema.Schema<any> } => {
|
|
168
|
+
const annotation = findAnnotation<boolean>((data.schema as Schema.Schema.All).ast, HueAnnotationId);
|
|
169
|
+
return !!annotation;
|
|
170
|
+
},
|
|
171
|
+
component: ({ data: _, ...inputProps }) => {
|
|
172
|
+
const { label, disabled, type, getValue, onValueChange } = inputProps as any as InputProps;
|
|
173
|
+
const handleChange = useCallback((nextHue: string) => onValueChange(type, nextHue), [onValueChange]);
|
|
174
|
+
const handleReset = useCallback(() => onValueChange(type, undefined), [onValueChange]);
|
|
175
|
+
return (
|
|
176
|
+
<Input.Root>
|
|
177
|
+
<Input.Label>{label}</Input.Label>
|
|
178
|
+
<HuePicker disabled={disabled} value={getValue() ?? ''} onChange={handleChange} onReset={handleReset} />
|
|
179
|
+
</Input.Root>
|
|
180
|
+
);
|
|
181
|
+
},
|
|
182
|
+
}),
|
|
183
|
+
createSurface({
|
|
184
|
+
id: `${SPACE_PLUGIN}/create-initial-space-form-[icon]`,
|
|
185
|
+
role: 'form-input',
|
|
186
|
+
filter: (data): data is { prop: string; schema: Schema.Schema<any> } => {
|
|
187
|
+
const annotation = findAnnotation<boolean>((data.schema as Schema.Schema.All).ast, IconAnnotationId);
|
|
188
|
+
return !!annotation;
|
|
189
|
+
},
|
|
190
|
+
component: ({ data: _, ...inputProps }) => {
|
|
191
|
+
const { label, disabled, type, getValue, onValueChange } = inputProps as any as InputProps;
|
|
192
|
+
const handleChange = useCallback((nextIcon: string) => onValueChange(type, nextIcon), [onValueChange]);
|
|
193
|
+
const handleReset = useCallback(() => onValueChange(type, undefined), [onValueChange]);
|
|
194
|
+
return (
|
|
195
|
+
<Input.Root>
|
|
196
|
+
<Input.Label>{label}</Input.Label>
|
|
197
|
+
<IconPicker disabled={disabled} value={getValue() ?? ''} onChange={handleChange} onReset={handleReset} />
|
|
198
|
+
</Input.Root>
|
|
199
|
+
);
|
|
200
|
+
},
|
|
201
|
+
}),
|
|
126
202
|
createSurface({
|
|
127
203
|
id: POPOVER_RENAME_SPACE,
|
|
128
204
|
role: 'popover',
|
|
@@ -132,8 +208,8 @@ export default ({ createInvitationUrl }: ReactSurfaceOptions) =>
|
|
|
132
208
|
createSurface({
|
|
133
209
|
id: POPOVER_RENAME_OBJECT,
|
|
134
210
|
role: 'popover',
|
|
135
|
-
filter: (data): data is { props:
|
|
136
|
-
data.component === POPOVER_RENAME_OBJECT &&
|
|
211
|
+
filter: (data): data is { props: AnyLiveObject<any> } =>
|
|
212
|
+
data.component === POPOVER_RENAME_OBJECT && isLiveObject(data.props),
|
|
137
213
|
component: ({ data }) => <PopoverRenameObject object={data.props} />,
|
|
138
214
|
}),
|
|
139
215
|
createSurface({
|
|
@@ -142,10 +218,16 @@ export default ({ createInvitationUrl }: ReactSurfaceOptions) =>
|
|
|
142
218
|
filter: (data): data is any => data.component === POPOVER_ADD_SPACE,
|
|
143
219
|
component: () => <PopoverAddSpace />,
|
|
144
220
|
}),
|
|
221
|
+
createSurface({
|
|
222
|
+
id: `${SPACE_PLUGIN}/menu-footer`,
|
|
223
|
+
role: 'menu-footer',
|
|
224
|
+
filter: (data): data is { subject: AnyLiveObject<any> } => isEchoObject(data.subject),
|
|
225
|
+
component: ({ data }) => <MenuFooter object={data.subject} />,
|
|
226
|
+
}),
|
|
145
227
|
createSurface({
|
|
146
228
|
id: `${SPACE_PLUGIN}/navtree-presence`,
|
|
147
229
|
role: 'navtree-item-end',
|
|
148
|
-
filter: (data): data is { id: string; subject:
|
|
230
|
+
filter: (data): data is { id: string; subject: AnyLiveObject<any>; open?: boolean } =>
|
|
149
231
|
typeof data.id === 'string' && isEchoObject(data.subject),
|
|
150
232
|
component: ({ data }) => {
|
|
151
233
|
// TODO(wittjosiah): Doesn't need to be mutable but readonly type messes with ComplexMap.
|
|
@@ -172,7 +254,7 @@ export default ({ createInvitationUrl }: ReactSurfaceOptions) =>
|
|
|
172
254
|
id: `${SPACE_PLUGIN}/navbar-presence`,
|
|
173
255
|
role: 'navbar-end',
|
|
174
256
|
position: 'hoist',
|
|
175
|
-
filter: (data): data is { subject: Space |
|
|
257
|
+
filter: (data): data is { subject: Space | AnyLiveObject<any> } =>
|
|
176
258
|
isSpace(data.subject) || isEchoObject(data.subject),
|
|
177
259
|
component: ({ data }) => {
|
|
178
260
|
const space = isSpace(data.subject) ? data.subject : getSpace(data.subject);
|
|
@@ -191,19 +273,6 @@ export default ({ createInvitationUrl }: ReactSurfaceOptions) =>
|
|
|
191
273
|
filter: (data): data is { subject: CollectionType } => isInstanceOf(CollectionType, data.subject),
|
|
192
274
|
component: ({ data }) => <CollectionSection collection={data.subject} />,
|
|
193
275
|
}),
|
|
194
|
-
createSurface({
|
|
195
|
-
id: `${SPACE_PLUGIN}/plugin-settings`,
|
|
196
|
-
role: 'article',
|
|
197
|
-
filter: (data): data is { subject: SettingsStore<SpaceSettingsProps> } =>
|
|
198
|
-
data.subject instanceof SettingsStore && data.subject.prefix === SPACE_PLUGIN,
|
|
199
|
-
component: ({ data: { subject } }) => <SpacePluginSettings settings={subject.value} />,
|
|
200
|
-
}),
|
|
201
|
-
createSurface({
|
|
202
|
-
id: `${SPACE_PLUGIN}/menu-footer`,
|
|
203
|
-
role: 'menu-footer',
|
|
204
|
-
filter: (data): data is { subject: ReactiveEchoObject<any> } => isEchoObject(data.subject),
|
|
205
|
-
component: ({ data }) => <MenuFooter object={data.subject} />,
|
|
206
|
-
}),
|
|
207
276
|
createSurface({
|
|
208
277
|
id: `${SPACE_PLUGIN}/status`,
|
|
209
278
|
role: 'status',
|
|
@@ -2,10 +2,9 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
import { Schema } from 'effect';
|
|
5
6
|
import { describe, it, expect } from 'vitest';
|
|
6
7
|
|
|
7
|
-
import { S } from '@dxos/echo-schema';
|
|
8
|
-
|
|
9
8
|
import { TypeNameSchema } from './schema-tools';
|
|
10
9
|
|
|
11
10
|
describe('TypeNameSchema format', () => {
|
|
@@ -29,7 +28,7 @@ describe('TypeNameSchema format', () => {
|
|
|
29
28
|
'.org/Type', // Must have domain
|
|
30
29
|
];
|
|
31
30
|
|
|
32
|
-
const validate =
|
|
31
|
+
const validate = Schema.validateSync(TypeNameSchema);
|
|
33
32
|
|
|
34
33
|
valid.forEach((typename) => {
|
|
35
34
|
it(`should accept valid typename: ${typename}`, () => {
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { Schema, SchemaAST } from 'effect';
|
|
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,
|
|
10
|
+
import { FormatEnum, FormatEnums, 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
|
-
[TitleAnnotationId]: 'TypeName',
|
|
28
|
-
[DescriptionAnnotationId]:
|
|
24
|
+
export const TypeNameSchema = Schema.String.pipe(
|
|
25
|
+
Schema.pattern(/^\w+\.\w{2,}\/[\w/]+$/i),
|
|
26
|
+
Schema.annotations({
|
|
27
|
+
[SchemaAST.TitleAnnotationId]: 'TypeName',
|
|
28
|
+
[SchemaAST.DescriptionAnnotationId]:
|
|
29
29
|
'Domain-style type name path. Dashes are not allowed. Use camel case for the final component of the type name.',
|
|
30
|
-
[ExamplesAnnotationId]: ['example.com/type/Document', 'example.com/type/FlightList'],
|
|
30
|
+
[SchemaAST.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
|
-
[DescriptionAnnotationId]: formatDescription,
|
|
39
|
+
const PropertyDefinitionSchema = Schema.Struct({
|
|
40
|
+
name: Schema.String.annotations({ [SchemaAST.DescriptionAnnotationId]: 'The name of the property.' }),
|
|
41
|
+
format: Schema.Union(...FormatEnums.map((format) => Schema.Literal(format))).annotations({
|
|
42
|
+
[SchemaAST.DescriptionAnnotationId]: formatDescription,
|
|
43
43
|
}),
|
|
44
|
-
config:
|
|
45
|
-
|
|
46
|
-
options:
|
|
47
|
-
|
|
44
|
+
config: Schema.optional(
|
|
45
|
+
Schema.Struct({
|
|
46
|
+
options: Schema.optional(
|
|
47
|
+
Schema.Array(SelectOptionSchema)
|
|
48
48
|
.annotations({
|
|
49
49
|
description: `Options for SingleSelect/MultiSelect formats. Available colors: ${hues.join(', ')}`,
|
|
50
50
|
})
|
|
51
|
-
.pipe(
|
|
51
|
+
.pipe(Schema.mutable),
|
|
52
52
|
),
|
|
53
53
|
}),
|
|
54
54
|
),
|
|
55
|
-
}).pipe(
|
|
55
|
+
}).pipe(Schema.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: Schema.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: Schema.Struct({
|
|
84
|
+
typename: Schema.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: Schema.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: Schema.Array(PropertyDefinitionSchema).pipe(
|
|
110
|
+
Schema.annotations({ description: 'Array of property definitions for the schema.' }),
|
|
111
|
+
Schema.mutable,
|
|
112
112
|
),
|
|
113
113
|
}),
|
|
114
114
|
execute: async ({ typename, properties }, { extensions }) => {
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { Capabilities, contributes } from '@dxos/app-framework';
|
|
6
|
-
import {
|
|
6
|
+
import { live } 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 = live<SpaceSettingsProps>({
|
|
13
13
|
showHidden: false,
|
|
14
14
|
});
|
|
15
15
|
|
|
@@ -6,7 +6,7 @@ import { contributes, createIntent, type PluginsContext, Capabilities, LayoutAct
|
|
|
6
6
|
import { SubscriptionList } from '@dxos/async';
|
|
7
7
|
import { Expando } from '@dxos/echo-schema';
|
|
8
8
|
import { scheduledEffect } from '@dxos/echo-signals/core';
|
|
9
|
-
import {
|
|
9
|
+
import { live } from '@dxos/live-object';
|
|
10
10
|
import { log } from '@dxos/log';
|
|
11
11
|
import { AttentionCapabilities } from '@dxos/plugin-attention';
|
|
12
12
|
import { ClientCapabilities } from '@dxos/plugin-client';
|
|
@@ -53,7 +53,7 @@ export default async (context: PluginsContext) => {
|
|
|
53
53
|
if (!spacesOrder) {
|
|
54
54
|
// TODO(wittjosiah): Cannot be a Folder because Spaces are not TypedObjects so can't be saved in the database.
|
|
55
55
|
// Instead, we store order as an array of space ids.
|
|
56
|
-
defaultSpace.db.add(
|
|
56
|
+
defaultSpace.db.add(live({ key: SHARED, order: [] }));
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
// Await missing objects.
|
|
@@ -14,11 +14,9 @@ import { SPACE_PLUGIN } from '../meta';
|
|
|
14
14
|
import { type PluginState } from '../types';
|
|
15
15
|
|
|
16
16
|
export default (context: PluginsContext) => {
|
|
17
|
-
const sections = context.requestCapabilities(SpaceCapabilities.SettingsSection);
|
|
18
17
|
const state = new LocalStorageStore<PluginState>(SPACE_PLUGIN, {
|
|
19
18
|
awaiting: undefined,
|
|
20
19
|
spaceNames: {},
|
|
21
|
-
spaceSettingsOpenSections: sections.map((section) => section.id),
|
|
22
20
|
viewersByObject: {},
|
|
23
21
|
// TODO(wittjosiah): Stop using (Complex)Map inside reactive object.
|
|
24
22
|
viewersByIdentity: new ComplexMap(PublicKey.hash),
|
|
@@ -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, descriptionMessage, mx } from '@dxos/react-ui-theme';
|
|
9
9
|
|
|
10
10
|
import { SPACE_PLUGIN } from '../meta';
|
|
11
11
|
import type { CollectionType } from '../types';
|
|
@@ -21,10 +21,7 @@ export const CollectionMain = ({ collection }: { collection: CollectionType }) =
|
|
|
21
21
|
>
|
|
22
22
|
<p
|
|
23
23
|
role='alert'
|
|
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
|
-
)}
|
|
24
|
+
className={mx(descriptionMessage, 'rounded-lg p-8 font-normal text-lg max-is-[24rem] break-words')}
|
|
28
25
|
>
|
|
29
26
|
{collection.name ?? t('unnamed collection label')}
|
|
30
27
|
</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 { live, 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';
|
|
@@ -70,7 +70,7 @@ export const TargetCollection: StoryObj<typeof CreateObjectDialog> = {
|
|
|
70
70
|
|
|
71
71
|
useEffect(() => {
|
|
72
72
|
if (space) {
|
|
73
|
-
space.db.add(
|
|
73
|
+
space.db.add(live(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, isLiveObject, isSpace, type Live, 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: Live<any>) => boolean;
|
|
31
31
|
};
|
|
32
32
|
|
|
33
33
|
export const CreateObjectDialog = ({
|
|
@@ -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 (isLiveObject(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,42 +4,20 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { useCallback, useState } from 'react';
|
|
6
6
|
|
|
7
|
-
import {
|
|
8
|
-
import { getTypeAnnotation, type TypeAnnotation, type S } from '@dxos/echo-schema';
|
|
7
|
+
import { getTypeAnnotation, type TypeAnnotation } from '@dxos/echo-schema';
|
|
9
8
|
import { invariant } from '@dxos/invariant';
|
|
10
9
|
import { type SpaceId, type Space } from '@dxos/react-client/echo';
|
|
11
10
|
import { Icon, type ThemedClassName, toLocalizedString, useTranslation } from '@dxos/react-ui';
|
|
12
|
-
import { Form
|
|
11
|
+
import { Form } from '@dxos/react-ui-form';
|
|
13
12
|
import { SearchList } from '@dxos/react-ui-searchlist';
|
|
14
13
|
import { mx } from '@dxos/react-ui-theme';
|
|
15
14
|
import { isNonNullable, type MaybePromise } from '@dxos/util';
|
|
16
15
|
|
|
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
|
-
|
|
43
21
|
export type CreateObjectPanelProps = ThemedClassName<{
|
|
44
22
|
forms: ObjectForm[];
|
|
45
23
|
spaces: Space[];
|
|
@@ -2,20 +2,20 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { Effect } from 'effect';
|
|
5
|
+
import { Effect, type Schema } 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';
|
|
10
9
|
import { Button, Dialog, Icon, useTranslation } from '@dxos/react-ui';
|
|
11
10
|
import { Form } from '@dxos/react-ui-form';
|
|
12
11
|
|
|
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 = Schema.Schema.Type<typeof SpaceForm>;
|
|
19
19
|
const initialValues: FormValues = { edgeReplication: true };
|
|
20
20
|
|
|
21
21
|
export const CreateSpaceDialog = () => {
|
|
@@ -23,6 +23,8 @@ export const CreateSpaceDialog = () => {
|
|
|
23
23
|
const { t } = useTranslation(SPACE_PLUGIN);
|
|
24
24
|
const { dispatch } = useIntentDispatcher();
|
|
25
25
|
|
|
26
|
+
const inputSurfaceLookup = useInputSurfaceLookup();
|
|
27
|
+
|
|
26
28
|
const handleCreateSpace = useCallback(
|
|
27
29
|
async (data: FormValues) => {
|
|
28
30
|
const program = Effect.gen(function* () {
|
|
@@ -54,6 +56,7 @@ export const CreateSpaceDialog = () => {
|
|
|
54
56
|
autoFocus
|
|
55
57
|
values={initialValues}
|
|
56
58
|
schema={SpaceForm}
|
|
59
|
+
lookupComponent={inputSurfaceLookup}
|
|
57
60
|
onSave={handleCreateSpace}
|
|
58
61
|
/>
|
|
59
62
|
</div>
|