@dxos/plugin-space 0.8.1-main.ba2dec9 → 0.8.1-staging.31c3ee1
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-MGK5HWPZ.mjs → app-graph-builder-GMFCSOLG.mjs} +33 -6
- package/dist/lib/browser/app-graph-builder-GMFCSOLG.mjs.map +7 -0
- package/dist/lib/browser/{app-graph-serializer-FOWFLYGU.mjs → app-graph-serializer-DSF2U3A5.mjs} +7 -7
- package/dist/lib/browser/{app-graph-serializer-FOWFLYGU.mjs.map → app-graph-serializer-DSF2U3A5.mjs.map} +2 -2
- package/dist/lib/browser/{chunk-UDWHTKB5.mjs → chunk-5BDV575R.mjs} +22 -16
- package/dist/lib/browser/chunk-5BDV575R.mjs.map +7 -0
- package/dist/lib/browser/{chunk-ULA2UQJ4.mjs → chunk-AYW4IDRT.mjs} +15 -65
- package/dist/lib/browser/chunk-AYW4IDRT.mjs.map +7 -0
- package/dist/lib/browser/{chunk-PCEP3KQY.mjs → chunk-DVZEJGCK.mjs} +854 -587
- package/dist/lib/browser/chunk-DVZEJGCK.mjs.map +7 -0
- package/dist/lib/browser/{chunk-NU7WDVGN.mjs → chunk-KVRYWFZU.mjs} +3 -3
- package/dist/lib/browser/chunk-KVRYWFZU.mjs.map +7 -0
- package/dist/lib/browser/{chunk-23RVI5FZ.mjs → chunk-LO5UL6RU.mjs} +49 -16
- package/dist/lib/browser/chunk-LO5UL6RU.mjs.map +7 -0
- package/dist/lib/browser/{chunk-PQXZCNAU.mjs → chunk-PTKYMZWO.mjs} +1 -1
- package/dist/lib/browser/chunk-PTKYMZWO.mjs.map +7 -0
- package/dist/lib/browser/{identity-created-FYGS6TBH.mjs → identity-created-JR7BNXFH.mjs} +3 -3
- package/dist/lib/browser/index.mjs +40 -45
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-resolver-GPNAQ2SG.mjs → intent-resolver-OG62I5IL.mjs} +69 -44
- package/dist/lib/browser/intent-resolver-OG62I5IL.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-root-4CCSD7TZ.mjs → react-root-VPSIJ6EU.mjs} +6 -6
- package/dist/lib/browser/{react-surface-FKMRI3WV.mjs → react-surface-KOSYP574.mjs} +39 -38
- package/dist/lib/browser/react-surface-KOSYP574.mjs.map +7 -0
- package/dist/lib/browser/{schema-5W3DSY2E.mjs → schema-FHTA26SW.mjs} +3 -3
- package/dist/lib/browser/schema-tools-YAXPRIXP.mjs +123 -0
- package/dist/lib/browser/schema-tools-YAXPRIXP.mjs.map +7 -0
- package/dist/lib/browser/{settings-PHPCXX33.mjs → settings-PJPTJUPE.mjs} +3 -3
- package/dist/lib/browser/{spaces-ready-K47RR7N2.mjs → spaces-ready-BSSP7HHG.mjs} +8 -8
- package/dist/lib/browser/spaces-ready-BSSP7HHG.mjs.map +7 -0
- package/dist/lib/browser/{state-INJ63O57.mjs → state-X7VLCC6E.mjs} +5 -3
- package/dist/lib/browser/state-X7VLCC6E.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +2 -10
- package/dist/lib/node/{app-graph-builder-ZIUBXRPA.cjs → app-graph-builder-DPY7AUZE.cjs} +73 -46
- package/dist/lib/node/app-graph-builder-DPY7AUZE.cjs.map +7 -0
- package/dist/lib/node/{app-graph-serializer-VQOGHKXL.cjs → app-graph-serializer-JELGJUAY.cjs} +21 -21
- package/dist/lib/node/{app-graph-serializer-VQOGHKXL.cjs.map → app-graph-serializer-JELGJUAY.cjs.map} +2 -2
- package/dist/lib/node/{chunk-WZR6OAN3.cjs → chunk-6P2DB4QQ.cjs} +4 -4
- package/dist/lib/node/{chunk-WZR6OAN3.cjs.map → chunk-6P2DB4QQ.cjs.map} +2 -2
- package/dist/lib/node/{chunk-QE4GVR6C.cjs → chunk-APYLLIMY.cjs} +919 -657
- package/dist/lib/node/chunk-APYLLIMY.cjs.map +7 -0
- package/dist/lib/node/{chunk-YZKNRFHU.cjs → chunk-IKIDS6XF.cjs} +10 -10
- package/dist/lib/node/chunk-IKIDS6XF.cjs.map +7 -0
- package/dist/lib/node/{chunk-U6DYXAR3.cjs → chunk-PU2EYH4E.cjs} +27 -21
- package/dist/lib/node/chunk-PU2EYH4E.cjs.map +7 -0
- package/dist/lib/node/{chunk-OVGKWJOC.cjs → chunk-TUZWEPGX.cjs} +99 -66
- package/dist/lib/node/chunk-TUZWEPGX.cjs.map +7 -0
- package/dist/lib/node/{chunk-WAJKBO3J.cjs → chunk-WDEIFDTX.cjs} +19 -73
- package/dist/lib/node/chunk-WDEIFDTX.cjs.map +7 -0
- package/dist/lib/node/{identity-created-AXI64BLE.cjs → identity-created-XU4HFV2T.cjs} +7 -7
- package/dist/lib/node/index.cjs +105 -111
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/{intent-resolver-ICHHI6I6.cjs → intent-resolver-UMF6MLOH.cjs} +133 -107
- package/dist/lib/node/intent-resolver-UMF6MLOH.cjs.map +7 -0
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/{react-root-TCBTUOOJ.cjs → react-root-ZRFHMM7R.cjs} +12 -12
- package/dist/lib/node/{react-surface-JSCCIZS5.cjs → react-surface-72U57CIU.cjs} +78 -76
- package/dist/lib/node/react-surface-72U57CIU.cjs.map +7 -0
- package/dist/lib/node/{schema-YN7WVFRX.cjs → schema-PPJ5BZ3A.cjs} +7 -7
- package/dist/lib/node/schema-tools-BLIMOZYY.cjs +146 -0
- package/dist/lib/node/schema-tools-BLIMOZYY.cjs.map +7 -0
- package/dist/lib/node/{settings-5QYFWNH7.cjs → settings-WVFP2UEP.cjs} +8 -8
- package/dist/lib/node/{spaces-ready-FQNAKR7G.cjs → spaces-ready-7DNZSUOG.cjs} +16 -16
- package/dist/lib/node/spaces-ready-7DNZSUOG.cjs.map +7 -0
- package/dist/lib/node/{state-57UE3DYE.cjs → state-5KX6WBJH.cjs} +10 -8
- package/dist/lib/node/state-5KX6WBJH.cjs.map +7 -0
- package/dist/lib/node/types/index.cjs +13 -21
- package/dist/lib/node/types/index.cjs.map +2 -2
- package/dist/lib/node-esm/{app-graph-builder-TERVM2SL.mjs → app-graph-builder-42IGWRPL.mjs} +33 -6
- package/dist/lib/node-esm/app-graph-builder-42IGWRPL.mjs.map +7 -0
- package/dist/lib/node-esm/{app-graph-serializer-GZRSWHEN.mjs → app-graph-serializer-FXONFKOE.mjs} +7 -7
- package/dist/lib/node-esm/{app-graph-serializer-GZRSWHEN.mjs.map → app-graph-serializer-FXONFKOE.mjs.map} +2 -2
- package/dist/lib/node-esm/{chunk-2TQ2AJEZ.mjs → chunk-3ZOUV4DF.mjs} +22 -16
- package/dist/lib/node-esm/chunk-3ZOUV4DF.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-TRNZQEEN.mjs → chunk-FC4UHDPL.mjs} +15 -65
- package/dist/lib/node-esm/chunk-FC4UHDPL.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-HJCEJNW3.mjs → chunk-HMCIZ7G7.mjs} +854 -587
- package/dist/lib/node-esm/chunk-HMCIZ7G7.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-ICCM4YRJ.mjs → chunk-MSWEFAPD.mjs} +1 -1
- package/dist/lib/node-esm/chunk-MSWEFAPD.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-6RSVVEPS.mjs → chunk-PIYAWT5N.mjs} +3 -3
- package/dist/lib/node-esm/chunk-PIYAWT5N.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-PGH5L7MV.mjs → chunk-ZGLK25WQ.mjs} +49 -16
- package/dist/lib/node-esm/chunk-ZGLK25WQ.mjs.map +7 -0
- package/dist/lib/node-esm/{identity-created-3CGEXNPO.mjs → identity-created-WJKAS2PV.mjs} +3 -3
- package/dist/lib/node-esm/index.mjs +40 -45
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/{intent-resolver-VR42K5GE.mjs → intent-resolver-67C5MOIE.mjs} +69 -44
- package/dist/lib/node-esm/intent-resolver-67C5MOIE.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-root-THJBSTQS.mjs → react-root-XPRWMZGT.mjs} +6 -6
- package/dist/lib/node-esm/{react-surface-Z3BBQ5HX.mjs → react-surface-MUE6M34Y.mjs} +39 -38
- package/dist/lib/node-esm/react-surface-MUE6M34Y.mjs.map +7 -0
- package/dist/lib/node-esm/{schema-LOR2EVGY.mjs → schema-OUZKVYM5.mjs} +3 -3
- package/dist/lib/node-esm/schema-tools-IU7EX5A5.mjs +125 -0
- package/dist/lib/node-esm/schema-tools-IU7EX5A5.mjs.map +7 -0
- package/dist/lib/node-esm/{settings-H6MXTEQM.mjs → settings-FJZPC2TV.mjs} +3 -3
- package/dist/lib/node-esm/{spaces-ready-HKAQG5SA.mjs → spaces-ready-7X5PGB2V.mjs} +8 -8
- package/dist/lib/node-esm/spaces-ready-7X5PGB2V.mjs.map +7 -0
- package/dist/lib/node-esm/{state-VYA6OFHD.mjs → state-Z6E2YTNC.mjs} +5 -3
- package/dist/lib/node-esm/state-Z6E2YTNC.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +2 -10
- 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/capabilities.d.ts +4 -3
- package/dist/types/src/capabilities/capabilities.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +1 -1
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +1 -2
- 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-tool.test.d.ts +2 -0
- package/dist/types/src/capabilities/schema-tool.test.d.ts.map +1 -0
- package/dist/types/src/capabilities/schema-tools.d.ts +13 -0
- package/dist/types/src/capabilities/schema-tools.d.ts.map +1 -0
- package/dist/types/src/capabilities/state.d.ts.map +1 -1
- package/dist/types/src/components/CreateDialog/CreateObjectDialog.d.ts.map +1 -1
- package/dist/types/src/components/JoinDialog.d.ts.map +1 -1
- package/dist/types/src/components/MembersContainer.d.ts +7 -0
- package/dist/types/src/components/MembersContainer.d.ts.map +1 -0
- package/dist/types/src/components/MembersContainer.stories.d.ts +8 -0
- package/dist/types/src/components/MembersContainer.stories.d.ts.map +1 -0
- package/dist/types/src/components/ObjectSettingsContainer/AdvancedObjectSettings.d.ts.map +1 -0
- package/dist/types/src/components/ObjectSettingsContainer/BaseObjectSettings.d.ts +8 -0
- 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/ObjectSettingsContainer/ObjectSettingsContainer.d.ts +8 -0
- package/dist/types/src/components/ObjectSettingsContainer/ObjectSettingsContainer.d.ts.map +1 -0
- package/dist/types/src/components/ObjectSettingsContainer/index.d.ts +2 -0
- package/dist/types/src/components/ObjectSettingsContainer/index.d.ts.map +1 -0
- package/dist/types/src/components/SpacePresence.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 +9 -0
- package/dist/types/src/components/SpaceSettings/SpaceSettingsContainer.d.ts.map +1 -0
- package/dist/types/src/components/SpaceSettings/index.d.ts +2 -2
- package/dist/types/src/components/SpaceSettings/index.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/events.d.ts +1 -1
- package/dist/types/src/events.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +2 -5
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +53 -36
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/thread.d.ts +92 -197
- package/dist/types/src/types/thread.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +10 -0
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/src/util.d.ts +12 -0
- package/dist/types/src/util.d.ts.map +1 -1
- package/package.json +44 -39
- package/src/SpacePlugin.tsx +12 -11
- package/src/capabilities/app-graph-builder.ts +20 -0
- package/src/capabilities/app-graph-serializer.ts +2 -2
- package/src/capabilities/capabilities.ts +3 -3
- package/src/capabilities/index.ts +1 -0
- package/src/capabilities/intent-resolver.ts +66 -38
- package/src/capabilities/react-surface.tsx +30 -28
- package/src/capabilities/schema-tool.test.ts +45 -0
- package/src/capabilities/schema-tools.ts +124 -0
- package/src/capabilities/spaces-ready.ts +3 -3
- package/src/capabilities/state.ts +2 -0
- package/src/components/CreateDialog/CreateObjectDialog.tsx +3 -6
- package/src/components/CreateDialog/CreateObjectPanel.tsx +6 -6
- package/src/components/JoinDialog.tsx +43 -27
- package/src/components/MembersContainer.stories.tsx +34 -0
- package/src/components/MembersContainer.tsx +255 -0
- package/src/components/{AdvancedObjectSettings → ObjectSettingsContainer}/AdvancedObjectSettings.tsx +2 -2
- package/src/components/ObjectSettingsContainer/BaseObjectSettings.tsx +47 -0
- package/src/components/ObjectSettingsContainer/ObjectSettingsContainer.tsx +36 -0
- package/src/components/ObjectSettingsContainer/index.ts +5 -0
- package/src/components/PopoverRenameObject.tsx +1 -1
- package/src/components/SpacePresence.tsx +25 -23
- package/src/components/SpaceSettings/{SpaceSettingsPanel.stories.tsx → SpacePropertiesForm.stories.tsx} +6 -6
- package/src/components/SpaceSettings/SpacePropertiesForm.tsx +136 -0
- package/src/components/SpaceSettings/SpaceSettingsContainer.tsx +63 -0
- package/src/components/SpaceSettings/index.ts +2 -2
- package/src/components/SyncStatus/SyncStatus.tsx +1 -1
- package/src/components/SyncStatus/save-tracker.ts +5 -5
- package/src/components/index.ts +2 -2
- package/src/events.ts +2 -2
- package/src/meta.ts +2 -2
- package/src/translations.ts +21 -12
- package/src/types/thread.ts +2 -56
- package/src/types/types.ts +15 -6
- package/src/util.tsx +30 -9
- package/dist/lib/browser/app-graph-builder-MGK5HWPZ.mjs.map +0 -7
- package/dist/lib/browser/chunk-23RVI5FZ.mjs.map +0 -7
- package/dist/lib/browser/chunk-NU7WDVGN.mjs.map +0 -7
- package/dist/lib/browser/chunk-PCEP3KQY.mjs.map +0 -7
- package/dist/lib/browser/chunk-PQXZCNAU.mjs.map +0 -7
- package/dist/lib/browser/chunk-UDWHTKB5.mjs.map +0 -7
- package/dist/lib/browser/chunk-ULA2UQJ4.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-GPNAQ2SG.mjs.map +0 -7
- package/dist/lib/browser/react-surface-FKMRI3WV.mjs.map +0 -7
- package/dist/lib/browser/spaces-ready-K47RR7N2.mjs.map +0 -7
- package/dist/lib/browser/state-INJ63O57.mjs.map +0 -7
- package/dist/lib/node/app-graph-builder-ZIUBXRPA.cjs.map +0 -7
- package/dist/lib/node/chunk-OVGKWJOC.cjs.map +0 -7
- package/dist/lib/node/chunk-QE4GVR6C.cjs.map +0 -7
- package/dist/lib/node/chunk-U6DYXAR3.cjs.map +0 -7
- package/dist/lib/node/chunk-WAJKBO3J.cjs.map +0 -7
- package/dist/lib/node/chunk-YZKNRFHU.cjs.map +0 -7
- package/dist/lib/node/intent-resolver-ICHHI6I6.cjs.map +0 -7
- package/dist/lib/node/react-surface-JSCCIZS5.cjs.map +0 -7
- package/dist/lib/node/spaces-ready-FQNAKR7G.cjs.map +0 -7
- package/dist/lib/node/state-57UE3DYE.cjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-TERVM2SL.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-2TQ2AJEZ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-6RSVVEPS.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HJCEJNW3.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-ICCM4YRJ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-PGH5L7MV.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-TRNZQEEN.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-VR42K5GE.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-Z3BBQ5HX.mjs.map +0 -7
- package/dist/lib/node-esm/spaces-ready-HKAQG5SA.mjs.map +0 -7
- package/dist/lib/node-esm/state-VYA6OFHD.mjs.map +0 -7
- package/dist/types/src/components/AdvancedObjectSettings/AdvancedObjectSettings.d.ts.map +0 -1
- package/dist/types/src/components/AdvancedObjectSettings/ForeignKeys.d.ts.map +0 -1
- package/dist/types/src/components/AdvancedObjectSettings/index.d.ts +0 -2
- package/dist/types/src/components/AdvancedObjectSettings/index.d.ts.map +0 -1
- package/dist/types/src/components/BaseObjectSettings.d.ts +0 -7
- package/dist/types/src/components/BaseObjectSettings.d.ts.map +0 -1
- package/dist/types/src/components/SpaceSettings/SpaceSettingsDialog.d.ts +0 -11
- package/dist/types/src/components/SpaceSettings/SpaceSettingsDialog.d.ts.map +0 -1
- package/dist/types/src/components/SpaceSettings/SpaceSettingsDialog.stories.d.ts +0 -7
- package/dist/types/src/components/SpaceSettings/SpaceSettingsDialog.stories.d.ts.map +0 -1
- package/dist/types/src/components/SpaceSettings/SpaceSettingsPanel.d.ts +0 -7
- package/dist/types/src/components/SpaceSettings/SpaceSettingsPanel.d.ts.map +0 -1
- package/dist/types/src/components/SpaceSettings/SpaceSettingsPanel.stories.d.ts +0 -7
- package/dist/types/src/components/SpaceSettings/SpaceSettingsPanel.stories.d.ts.map +0 -1
- package/src/components/AdvancedObjectSettings/index.ts +0 -5
- package/src/components/BaseObjectSettings.tsx +0 -40
- package/src/components/SpaceSettings/SpaceSettingsDialog.stories.tsx +0 -43
- package/src/components/SpaceSettings/SpaceSettingsDialog.tsx +0 -120
- package/src/components/SpaceSettings/SpaceSettingsPanel.tsx +0 -83
- /package/dist/lib/browser/{identity-created-FYGS6TBH.mjs.map → identity-created-JR7BNXFH.mjs.map} +0 -0
- /package/dist/lib/browser/{react-root-4CCSD7TZ.mjs.map → react-root-VPSIJ6EU.mjs.map} +0 -0
- /package/dist/lib/browser/{schema-5W3DSY2E.mjs.map → schema-FHTA26SW.mjs.map} +0 -0
- /package/dist/lib/browser/{settings-PHPCXX33.mjs.map → settings-PJPTJUPE.mjs.map} +0 -0
- /package/dist/lib/node/{identity-created-AXI64BLE.cjs.map → identity-created-XU4HFV2T.cjs.map} +0 -0
- /package/dist/lib/node/{react-root-TCBTUOOJ.cjs.map → react-root-ZRFHMM7R.cjs.map} +0 -0
- /package/dist/lib/node/{schema-YN7WVFRX.cjs.map → schema-PPJ5BZ3A.cjs.map} +0 -0
- /package/dist/lib/node/{settings-5QYFWNH7.cjs.map → settings-WVFP2UEP.cjs.map} +0 -0
- /package/dist/lib/node-esm/{identity-created-3CGEXNPO.mjs.map → identity-created-WJKAS2PV.mjs.map} +0 -0
- /package/dist/lib/node-esm/{react-root-THJBSTQS.mjs.map → react-root-XPRWMZGT.mjs.map} +0 -0
- /package/dist/lib/node-esm/{schema-LOR2EVGY.mjs.map → schema-OUZKVYM5.mjs.map} +0 -0
- /package/dist/lib/node-esm/{settings-H6MXTEQM.mjs.map → settings-FJZPC2TV.mjs.map} +0 -0
- /package/dist/types/src/components/{AdvancedObjectSettings → ObjectSettingsContainer}/AdvancedObjectSettings.d.ts +0 -0
- /package/dist/types/src/components/{AdvancedObjectSettings → ObjectSettingsContainer}/ForeignKeys.d.ts +0 -0
- /package/src/components/{AdvancedObjectSettings → ObjectSettingsContainer}/ForeignKeys.tsx +0 -0
|
@@ -19,6 +19,7 @@ import {
|
|
|
19
19
|
import { isDeleted } from '@dxos/live-object';
|
|
20
20
|
import { log } from '@dxos/log';
|
|
21
21
|
import { ClientCapabilities } from '@dxos/plugin-client';
|
|
22
|
+
import { PLANK_COMPANION_TYPE, ATTENDABLE_PATH_SEPARATOR } from '@dxos/plugin-deck/types';
|
|
22
23
|
import { createExtension, toSignal, type Node, type InvokeParams } from '@dxos/plugin-graph';
|
|
23
24
|
import { isNonNullable } from '@dxos/util';
|
|
24
25
|
|
|
@@ -315,5 +316,24 @@ export default (context: PluginsContext) => {
|
|
|
315
316
|
return constructObjectActions({ node, dispatch, navigable: state.navigableCollections });
|
|
316
317
|
},
|
|
317
318
|
}),
|
|
319
|
+
|
|
320
|
+
// Object settings plank companion.
|
|
321
|
+
createExtension({
|
|
322
|
+
id: `${SPACE_PLUGIN}/settings`,
|
|
323
|
+
filter: (node): node is Node<ReactiveEchoObject<any>> => isEchoObject(node.data),
|
|
324
|
+
connector: ({ node }) => [
|
|
325
|
+
{
|
|
326
|
+
id: [node.id, 'settings'].join(ATTENDABLE_PATH_SEPARATOR),
|
|
327
|
+
type: PLANK_COMPANION_TYPE,
|
|
328
|
+
data: 'settings',
|
|
329
|
+
properties: {
|
|
330
|
+
label: ['object settings label', { ns: SPACE_PLUGIN }],
|
|
331
|
+
icon: 'ph--sliders--regular',
|
|
332
|
+
disposition: 'hidden',
|
|
333
|
+
position: 'hoist',
|
|
334
|
+
},
|
|
335
|
+
},
|
|
336
|
+
],
|
|
337
|
+
}),
|
|
318
338
|
]);
|
|
319
339
|
};
|
|
@@ -46,8 +46,8 @@ export default (context: PluginsContext) =>
|
|
|
46
46
|
inputType: CollectionType.typename,
|
|
47
47
|
outputType: DIRECTORY_TYPE,
|
|
48
48
|
serialize: (node) => ({
|
|
49
|
-
name: node.data.name ?? translations[0]['en-US'][
|
|
50
|
-
data: node.data.name ?? translations[0]['en-US'][
|
|
49
|
+
name: node.data.name ?? translations[0]['en-US'][CollectionType.typename]['object name placeholder'],
|
|
50
|
+
data: node.data.name ?? translations[0]['en-US'][CollectionType.typename]['object name placeholder'],
|
|
51
51
|
type: DIRECTORY_TYPE,
|
|
52
52
|
}),
|
|
53
53
|
deserialize: async (data, ancestors) => {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { defineCapability, type Label } from '@dxos/app-framework';
|
|
6
|
-
import { type DeepReadonly } from '@dxos/util';
|
|
6
|
+
import { type Position, type DeepReadonly } from '@dxos/util';
|
|
7
7
|
|
|
8
8
|
import { SPACE_PLUGIN } from '../meta';
|
|
9
9
|
import { type ObjectForm, type PluginState } from '../types';
|
|
@@ -12,8 +12,8 @@ export namespace SpaceCapabilities {
|
|
|
12
12
|
export const State = defineCapability<DeepReadonly<PluginState>>(`${SPACE_PLUGIN}/capability/state`);
|
|
13
13
|
export const MutableState = defineCapability<PluginState>(`${SPACE_PLUGIN}/capability/state`);
|
|
14
14
|
|
|
15
|
-
export type
|
|
16
|
-
export const
|
|
15
|
+
export type SettingsSection = { id: string; label: Label; position?: Position };
|
|
16
|
+
export const SettingsSection = defineCapability<SettingsSection>(`${SPACE_PLUGIN}/capability/settings-section`);
|
|
17
17
|
|
|
18
18
|
export const ObjectForm = defineCapability<ObjectForm<any>>(`${SPACE_PLUGIN}/capability/object-form`);
|
|
19
19
|
}
|
|
@@ -11,6 +11,7 @@ export const IntentResolver = lazy(() => import('./intent-resolver'));
|
|
|
11
11
|
export const ReactRoot = lazy(() => import('./react-root'));
|
|
12
12
|
export const ReactSurface = lazy(() => import('./react-surface'));
|
|
13
13
|
export const Schema = lazy(() => import('./schema'));
|
|
14
|
+
export const Tools = lazy(() => import('./schema-tools'));
|
|
14
15
|
export const SpaceSettings = lazy(() => import('./settings'));
|
|
15
16
|
export const SpaceState = lazy(() => import('./state'));
|
|
16
17
|
export const SpacesReady = lazy(() => import('./spaces-ready'));
|
|
@@ -2,8 +2,11 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
import { pipe } from 'effect';
|
|
6
|
+
|
|
5
7
|
import {
|
|
6
8
|
Capabilities,
|
|
9
|
+
chain,
|
|
7
10
|
contributes,
|
|
8
11
|
createIntent,
|
|
9
12
|
createResolver,
|
|
@@ -14,8 +17,8 @@ import { type Expando, getTypename, type HasId } from '@dxos/echo-schema';
|
|
|
14
17
|
import { invariant } from '@dxos/invariant';
|
|
15
18
|
import { create, makeRef, type ReactiveObject } from '@dxos/live-object';
|
|
16
19
|
import { Migrations } from '@dxos/migrations';
|
|
17
|
-
import { AttentionCapabilities } from '@dxos/plugin-attention';
|
|
18
20
|
import { ClientCapabilities } from '@dxos/plugin-client';
|
|
21
|
+
import { ATTENDABLE_PATH_SEPARATOR } from '@dxos/plugin-deck/types';
|
|
19
22
|
import { ObservabilityAction } from '@dxos/plugin-observability/types';
|
|
20
23
|
import { EdgeReplicationSetting } from '@dxos/protocols/proto/dxos/echo/metadata';
|
|
21
24
|
import { isSpace, getSpace, SpaceState, type Space, fullyQualifiedId, isEchoObject } from '@dxos/react-client/echo';
|
|
@@ -24,8 +27,6 @@ import { SpaceCapabilities } from './capabilities';
|
|
|
24
27
|
import {
|
|
25
28
|
CREATE_SPACE_DIALOG,
|
|
26
29
|
JOIN_DIALOG,
|
|
27
|
-
SPACE_SETTINGS_DIALOG,
|
|
28
|
-
type SpaceSettingsDialogProps,
|
|
29
30
|
type JoinDialogProps,
|
|
30
31
|
POPOVER_RENAME_SPACE,
|
|
31
32
|
CREATE_OBJECT_DIALOG,
|
|
@@ -41,12 +42,11 @@ import { cloneObject, COMPOSER_SPACE_LOCK, getNestedObjects } from '../util';
|
|
|
41
42
|
const SPACE_MAX_OBJECTS = 500;
|
|
42
43
|
|
|
43
44
|
type IntentResolverOptions = {
|
|
44
|
-
createInvitationUrl: (invitationCode: string) => string;
|
|
45
45
|
context: PluginsContext;
|
|
46
46
|
observability?: boolean;
|
|
47
47
|
};
|
|
48
48
|
|
|
49
|
-
export default ({
|
|
49
|
+
export default ({ context, observability }: IntentResolverOptions) => {
|
|
50
50
|
const resolve = (typename: string) =>
|
|
51
51
|
context.requestCapabilities(Capabilities.Metadata).find(({ id }) => id === typename)?.metadata ?? {};
|
|
52
52
|
|
|
@@ -104,7 +104,7 @@ export default ({ createInvitationUrl, context, observability }: IntentResolverO
|
|
|
104
104
|
}),
|
|
105
105
|
createResolver({
|
|
106
106
|
intent: SpaceAction.Join,
|
|
107
|
-
resolve: ({ invitationCode }) => ({
|
|
107
|
+
resolve: ({ invitationCode, onDone }) => ({
|
|
108
108
|
intents: [
|
|
109
109
|
createIntent(LayoutAction.UpdateDialog, {
|
|
110
110
|
part: 'dialog',
|
|
@@ -113,6 +113,7 @@ export default ({ createInvitationUrl, context, observability }: IntentResolverO
|
|
|
113
113
|
blockAlign: 'start',
|
|
114
114
|
props: {
|
|
115
115
|
initialInvitationCode: invitationCode,
|
|
116
|
+
onDone,
|
|
116
117
|
} satisfies Partial<JoinDialogProps>,
|
|
117
118
|
},
|
|
118
119
|
}),
|
|
@@ -123,31 +124,40 @@ export default ({ createInvitationUrl, context, observability }: IntentResolverO
|
|
|
123
124
|
intent: SpaceAction.Share,
|
|
124
125
|
filter: (data): data is { space: Space } => !data.space.properties[COMPOSER_SPACE_LOCK],
|
|
125
126
|
resolve: ({ space }) => {
|
|
126
|
-
const
|
|
127
|
-
const
|
|
128
|
-
|
|
127
|
+
const layout = context.requestCapability(Capabilities.Layout);
|
|
128
|
+
const id = `${space.id}${ATTENDABLE_PATH_SEPARATOR}members`;
|
|
129
|
+
if (layout.active.includes(id)) {
|
|
130
|
+
return {
|
|
131
|
+
intents: [
|
|
132
|
+
createIntent(LayoutAction.ScrollIntoView, {
|
|
133
|
+
part: 'current',
|
|
134
|
+
subject: id,
|
|
135
|
+
}),
|
|
136
|
+
],
|
|
137
|
+
};
|
|
138
|
+
}
|
|
129
139
|
|
|
130
140
|
return {
|
|
131
141
|
intents: [
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
}
|
|
143
|
-
},
|
|
144
|
-
|
|
142
|
+
pipe(
|
|
143
|
+
createIntent(LayoutAction.SwitchWorkspace, {
|
|
144
|
+
part: 'workspace',
|
|
145
|
+
subject: space.id,
|
|
146
|
+
}),
|
|
147
|
+
chain(LayoutAction.Open, {
|
|
148
|
+
part: 'main',
|
|
149
|
+
subject: [space.id],
|
|
150
|
+
options: {
|
|
151
|
+
variant: 'members',
|
|
152
|
+
},
|
|
153
|
+
}),
|
|
154
|
+
),
|
|
145
155
|
...(observability
|
|
146
156
|
? [
|
|
147
157
|
createIntent(ObservabilityAction.SendEvent, {
|
|
148
158
|
name: 'space.share',
|
|
149
159
|
properties: {
|
|
150
|
-
|
|
160
|
+
spaceId: space.id,
|
|
151
161
|
},
|
|
152
162
|
}),
|
|
153
163
|
]
|
|
@@ -233,20 +243,34 @@ export default ({ createInvitationUrl, context, observability }: IntentResolverO
|
|
|
233
243
|
createResolver({
|
|
234
244
|
intent: SpaceAction.OpenSettings,
|
|
235
245
|
resolve: ({ space }) => {
|
|
246
|
+
const layout = context.requestCapability(Capabilities.Layout);
|
|
247
|
+
const id = `${space.id}${ATTENDABLE_PATH_SEPARATOR}settings`;
|
|
248
|
+
if (layout.active.includes(id)) {
|
|
249
|
+
return {
|
|
250
|
+
intents: [
|
|
251
|
+
createIntent(LayoutAction.ScrollIntoView, {
|
|
252
|
+
part: 'current',
|
|
253
|
+
subject: id,
|
|
254
|
+
}),
|
|
255
|
+
],
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
|
|
236
259
|
return {
|
|
237
260
|
intents: [
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
261
|
+
pipe(
|
|
262
|
+
createIntent(LayoutAction.SwitchWorkspace, {
|
|
263
|
+
part: 'workspace',
|
|
264
|
+
subject: space.id,
|
|
265
|
+
}),
|
|
266
|
+
chain(LayoutAction.Open, {
|
|
267
|
+
part: 'main',
|
|
268
|
+
subject: [space.id],
|
|
269
|
+
options: {
|
|
270
|
+
variant: 'settings',
|
|
271
|
+
},
|
|
272
|
+
}),
|
|
273
|
+
),
|
|
250
274
|
],
|
|
251
275
|
};
|
|
252
276
|
},
|
|
@@ -265,7 +289,7 @@ export default ({ createInvitationUrl, context, observability }: IntentResolverO
|
|
|
265
289
|
}),
|
|
266
290
|
createResolver({
|
|
267
291
|
intent: SpaceAction.Migrate,
|
|
268
|
-
resolve: async ({ space, version }) => {
|
|
292
|
+
resolve: async ({ space, version: targetVersion }) => {
|
|
269
293
|
const state = context.requestCapability(SpaceCapabilities.MutableState);
|
|
270
294
|
|
|
271
295
|
if (space.state.get() === SpaceState.SPACE_REQUIRES_MIGRATION) {
|
|
@@ -273,7 +297,8 @@ export default ({ createInvitationUrl, context, observability }: IntentResolverO
|
|
|
273
297
|
await space.internal.migrate();
|
|
274
298
|
state.sdkMigrationRunning[space.id] = false;
|
|
275
299
|
}
|
|
276
|
-
const result = await Migrations.migrate(space,
|
|
300
|
+
const result = await Migrations.migrate(space, targetVersion);
|
|
301
|
+
const version = Migrations.versionProperty ? space.properties[Migrations.versionProperty] : undefined;
|
|
277
302
|
return {
|
|
278
303
|
data: result,
|
|
279
304
|
intents: [
|
|
@@ -283,6 +308,7 @@ export default ({ createInvitationUrl, context, observability }: IntentResolverO
|
|
|
283
308
|
name: 'space.migrate',
|
|
284
309
|
properties: {
|
|
285
310
|
spaceId: space.id,
|
|
311
|
+
targetVersion,
|
|
286
312
|
version,
|
|
287
313
|
},
|
|
288
314
|
}),
|
|
@@ -318,7 +344,7 @@ export default ({ createInvitationUrl, context, observability }: IntentResolverO
|
|
|
318
344
|
}),
|
|
319
345
|
createResolver({
|
|
320
346
|
intent: SpaceAction.AddObject,
|
|
321
|
-
resolve: async ({ target, object }) => {
|
|
347
|
+
resolve: async ({ target, object, hidden }) => {
|
|
322
348
|
const space = isSpace(target) ? target : getSpace(target);
|
|
323
349
|
invariant(space, 'Space not found.');
|
|
324
350
|
|
|
@@ -356,6 +382,8 @@ export default ({ createInvitationUrl, context, observability }: IntentResolverO
|
|
|
356
382
|
|
|
357
383
|
if (target instanceof CollectionType) {
|
|
358
384
|
target.objects.push(makeRef(object as HasId));
|
|
385
|
+
} else if (isSpace(target) && hidden) {
|
|
386
|
+
space.db.add(object);
|
|
359
387
|
} else if (isSpace(target)) {
|
|
360
388
|
const collection = space.properties[CollectionType.typename]?.target;
|
|
361
389
|
if (collection instanceof CollectionType) {
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
7
|
import { Capabilities, contributes, createSurface, Surface, useCapability } from '@dxos/app-framework';
|
|
8
|
+
import { isInstanceOf } from '@dxos/echo-schema';
|
|
8
9
|
import { SettingsStore } from '@dxos/local-storage';
|
|
9
10
|
import {
|
|
10
11
|
getSpace,
|
|
@@ -19,8 +20,6 @@ import { type JoinPanelProps } from '@dxos/shell/react';
|
|
|
19
20
|
|
|
20
21
|
import { SpaceCapabilities } from './capabilities';
|
|
21
22
|
import {
|
|
22
|
-
AdvancedObjectSettings,
|
|
23
|
-
BaseObjectSettings,
|
|
24
23
|
CollectionMain,
|
|
25
24
|
CollectionSection,
|
|
26
25
|
CREATE_OBJECT_DIALOG,
|
|
@@ -36,16 +35,16 @@ import {
|
|
|
36
35
|
PopoverRenameObject,
|
|
37
36
|
PopoverRenameSpace,
|
|
38
37
|
SmallPresenceLive,
|
|
39
|
-
SPACE_SETTINGS_DIALOG,
|
|
40
38
|
SpacePluginSettings,
|
|
41
39
|
SpacePresence,
|
|
42
|
-
SpaceSettingsDialog,
|
|
43
|
-
SpaceSettingsPanel,
|
|
44
40
|
SyncStatus,
|
|
45
41
|
type CreateObjectDialogProps,
|
|
46
|
-
type SpaceSettingsDialogProps,
|
|
47
42
|
POPOVER_ADD_SPACE,
|
|
48
43
|
PopoverAddSpace,
|
|
44
|
+
SpaceSettingsContainer,
|
|
45
|
+
SpacePropertiesForm,
|
|
46
|
+
MembersContainer,
|
|
47
|
+
ObjectSettingsContainer,
|
|
49
48
|
} from '../components';
|
|
50
49
|
import { SPACE_PLUGIN } from '../meta';
|
|
51
50
|
import { CollectionType, type SpaceSettingsProps } from '../types';
|
|
@@ -74,35 +73,37 @@ export default ({ createInvitationUrl }: ReactSurfaceOptions) =>
|
|
|
74
73
|
id: `${SPACE_PLUGIN}/collection-fallback`,
|
|
75
74
|
role: 'article',
|
|
76
75
|
position: 'fallback',
|
|
77
|
-
filter: (data): data is { subject: CollectionType } => data.subject
|
|
76
|
+
filter: (data): data is { subject: CollectionType } => isInstanceOf(CollectionType, data.subject),
|
|
78
77
|
component: ({ data }) => <CollectionMain collection={data.subject} />,
|
|
79
78
|
}),
|
|
80
79
|
createSurface({
|
|
81
|
-
id: `${SPACE_PLUGIN}/
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
filter: (data): data is { subject: Space } =>
|
|
85
|
-
|
|
80
|
+
id: `${SPACE_PLUGIN}/members`,
|
|
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
86
|
}),
|
|
87
87
|
createSurface({
|
|
88
|
-
id: `${SPACE_PLUGIN}/
|
|
89
|
-
role: '
|
|
88
|
+
id: `${SPACE_PLUGIN}/settings`,
|
|
89
|
+
role: 'article',
|
|
90
90
|
position: 'hoist',
|
|
91
|
-
filter: (data): data is { subject:
|
|
92
|
-
|
|
91
|
+
filter: (data): data is { subject: Space; variant: 'settings' } =>
|
|
92
|
+
isSpace(data.subject) && data.variant === 'settings',
|
|
93
|
+
component: ({ data }) => <SpaceSettingsContainer space={data.subject} />,
|
|
93
94
|
}),
|
|
94
95
|
createSurface({
|
|
95
|
-
id: `${SPACE_PLUGIN}/object-settings
|
|
96
|
-
role: '
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
component: ({ data }) => <
|
|
96
|
+
id: `${SPACE_PLUGIN}/companion/object-settings`,
|
|
97
|
+
role: 'article',
|
|
98
|
+
filter: (data): data is { companionTo: ReactiveEchoObject<any> } =>
|
|
99
|
+
isEchoObject(data.companionTo) && data.subject === 'settings',
|
|
100
|
+
component: ({ data, role }) => <ObjectSettingsContainer object={data.companionTo} role={role} />,
|
|
100
101
|
}),
|
|
101
102
|
createSurface({
|
|
102
|
-
id:
|
|
103
|
-
role: '
|
|
104
|
-
filter: (data): data is {
|
|
105
|
-
component: ({ data }) => <
|
|
103
|
+
id: `${SPACE_PLUGIN}/space-settings--properties`,
|
|
104
|
+
role: 'space-settings--properties',
|
|
105
|
+
filter: (data): data is { subject: Space } => isSpace(data.subject),
|
|
106
|
+
component: ({ data }) => <SpacePropertiesForm space={data.subject} />,
|
|
106
107
|
}),
|
|
107
108
|
createSurface({
|
|
108
109
|
id: JOIN_DIALOG,
|
|
@@ -152,14 +153,15 @@ export default ({ createInvitationUrl }: ReactSurfaceOptions) =>
|
|
|
152
153
|
return <SmallPresenceLive id={data.id} open={data.open} viewers={state.viewersByObject[data.id]} />;
|
|
153
154
|
},
|
|
154
155
|
}),
|
|
156
|
+
// TODO(wittjosiah): Attention glyph for non-echo items should be handled elsewhere.
|
|
155
157
|
createSurface({
|
|
156
|
-
// TODO(wittjosiah): Attention glyph for non-echo items should be handled elsewhere.
|
|
157
158
|
id: `${SPACE_PLUGIN}/navtree-presence-fallback`,
|
|
158
159
|
role: 'navtree-item-end',
|
|
159
160
|
position: 'fallback',
|
|
160
161
|
filter: (data): data is { id: string; open?: boolean } => typeof data.id === 'string',
|
|
161
162
|
component: ({ data }) => <SmallPresenceLive id={data.id} open={data.open} />,
|
|
162
163
|
}),
|
|
164
|
+
// TODO(wittjosiah): Broken?
|
|
163
165
|
createSurface({
|
|
164
166
|
id: `${SPACE_PLUGIN}/navtree-sync-status`,
|
|
165
167
|
role: 'navtree-item-end',
|
|
@@ -186,11 +188,11 @@ export default ({ createInvitationUrl }: ReactSurfaceOptions) =>
|
|
|
186
188
|
createSurface({
|
|
187
189
|
id: `${SPACE_PLUGIN}/collection-section`,
|
|
188
190
|
role: 'section',
|
|
189
|
-
filter: (data): data is { subject: CollectionType } => data.subject
|
|
191
|
+
filter: (data): data is { subject: CollectionType } => isInstanceOf(CollectionType, data.subject),
|
|
190
192
|
component: ({ data }) => <CollectionSection collection={data.subject} />,
|
|
191
193
|
}),
|
|
192
194
|
createSurface({
|
|
193
|
-
id: `${SPACE_PLUGIN}/settings`,
|
|
195
|
+
id: `${SPACE_PLUGIN}/plugin-settings`,
|
|
194
196
|
role: 'article',
|
|
195
197
|
filter: (data): data is { subject: SettingsStore<SpaceSettingsProps> } =>
|
|
196
198
|
data.subject instanceof SettingsStore && data.subject.prefix === SPACE_PLUGIN,
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { describe, it, expect } from 'vitest';
|
|
6
|
+
|
|
7
|
+
import { S } from '@dxos/echo-schema';
|
|
8
|
+
|
|
9
|
+
import { TypeNameSchema } from './schema-tools';
|
|
10
|
+
|
|
11
|
+
describe('TypeNameSchema format', () => {
|
|
12
|
+
const valid = [
|
|
13
|
+
'example.com/usCities',
|
|
14
|
+
'dxos.org/Contact',
|
|
15
|
+
'dxos.org/Table',
|
|
16
|
+
'dxos.org/Table/Contact',
|
|
17
|
+
'dxos.org/PluginName/TypeName',
|
|
18
|
+
// Case variations
|
|
19
|
+
'DXOS.org/Table',
|
|
20
|
+
'dxos.ORG/table',
|
|
21
|
+
];
|
|
22
|
+
|
|
23
|
+
const invalid = [
|
|
24
|
+
'http://dxos.org/Table', // No protocol allowed
|
|
25
|
+
'dxos.org/', // Must have type path
|
|
26
|
+
// TODO(dmaretskyi): Decide if we want to ban numbers.
|
|
27
|
+
// 'dxos.org/1Type', // Path segments must start with letter
|
|
28
|
+
'dxos.org/Type!', // Invalid character
|
|
29
|
+
'.org/Type', // Must have domain
|
|
30
|
+
];
|
|
31
|
+
|
|
32
|
+
const validate = S.validateSync(TypeNameSchema);
|
|
33
|
+
|
|
34
|
+
valid.forEach((typename) => {
|
|
35
|
+
it(`should accept valid typename: ${typename}`, () => {
|
|
36
|
+
expect(() => validate(typename)).not.toThrow();
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
invalid.forEach((typename) => {
|
|
41
|
+
it(`should reject invalid typename: ${typename}`, () => {
|
|
42
|
+
expect(() => validate(typename)).toThrow();
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
});
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { DescriptionAnnotationId, ExamplesAnnotationId, TitleAnnotationId } from 'effect/SchemaAST';
|
|
6
|
+
|
|
7
|
+
import { Capabilities, contributes, type PromiseIntentDispatcher } from '@dxos/app-framework';
|
|
8
|
+
import { defineTool, ToolResult } from '@dxos/artifact';
|
|
9
|
+
import { type Space } from '@dxos/client/echo';
|
|
10
|
+
import { FormatEnum, FormatEnums, S, SelectOptionSchema, GeoPoint, toJsonSchema } from '@dxos/echo-schema';
|
|
11
|
+
import { invariant } from '@dxos/invariant';
|
|
12
|
+
import { hues } from '@dxos/react-ui-theme';
|
|
13
|
+
import { getSchemaFromPropertyDefinitions } from '@dxos/schema';
|
|
14
|
+
|
|
15
|
+
// TODO(burdon): Factor out.
|
|
16
|
+
declare global {
|
|
17
|
+
interface ToolContextExtensions {
|
|
18
|
+
space?: Space;
|
|
19
|
+
dispatch?: PromiseIntentDispatcher;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// TODO(ZaymonFC): Move this somewhere common.
|
|
24
|
+
export const TypeNameSchema = S.String.pipe(
|
|
25
|
+
S.pattern(/^\w+\.\w{2,}\/[\w/]+$/i),
|
|
26
|
+
S.annotations({
|
|
27
|
+
[TitleAnnotationId]: 'TypeName',
|
|
28
|
+
[DescriptionAnnotationId]:
|
|
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'],
|
|
31
|
+
}),
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
const formatDescription = `The format of the property. Additional information:
|
|
35
|
+
${FormatEnum.GeoPoint}: ${JSON.stringify(toJsonSchema(GeoPoint))}
|
|
36
|
+
This tuple is GeoJSON. You must specify \`${FormatEnum.GeoPoint}\` as [Longitude, Latitude]`;
|
|
37
|
+
|
|
38
|
+
// TODO(ZaymonFC): All properties are default optional, but maybe we should allow for required properties.
|
|
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
|
+
}),
|
|
44
|
+
config: S.optional(
|
|
45
|
+
S.Struct({
|
|
46
|
+
options: S.optional(
|
|
47
|
+
S.Array(SelectOptionSchema)
|
|
48
|
+
.annotations({
|
|
49
|
+
description: `Options for SingleSelect/MultiSelect formats. Available colors: ${hues.join(', ')}`,
|
|
50
|
+
})
|
|
51
|
+
.pipe(S.mutable),
|
|
52
|
+
),
|
|
53
|
+
}),
|
|
54
|
+
),
|
|
55
|
+
}).pipe(S.mutable);
|
|
56
|
+
|
|
57
|
+
const SYSTEM_NAMESPACE = 'dxos.org/echo/schema';
|
|
58
|
+
|
|
59
|
+
export default () =>
|
|
60
|
+
contributes(Capabilities.Tools, [
|
|
61
|
+
defineTool(SYSTEM_NAMESPACE, {
|
|
62
|
+
name: 'list',
|
|
63
|
+
description: 'List registered schemas in the space.',
|
|
64
|
+
caption: 'Listing registered schemas...',
|
|
65
|
+
schema: S.Struct({}),
|
|
66
|
+
execute: async (_input, { extensions }) => {
|
|
67
|
+
invariant(extensions?.space, 'No space.');
|
|
68
|
+
const space = extensions.space;
|
|
69
|
+
|
|
70
|
+
const schemas = await space.db.schemaRegistry.query({}).run();
|
|
71
|
+
return ToolResult.Success(
|
|
72
|
+
schemas.map((schema) => ({
|
|
73
|
+
typename: schema.typename,
|
|
74
|
+
version: schema.version,
|
|
75
|
+
})),
|
|
76
|
+
);
|
|
77
|
+
},
|
|
78
|
+
}),
|
|
79
|
+
defineTool(SYSTEM_NAMESPACE, {
|
|
80
|
+
name: 'get',
|
|
81
|
+
description: 'Get a specific schema by its typename.',
|
|
82
|
+
caption: 'Getting schema...',
|
|
83
|
+
schema: S.Struct({
|
|
84
|
+
typename: S.String.annotations({
|
|
85
|
+
description: 'The fully qualified typename of the schema.',
|
|
86
|
+
}),
|
|
87
|
+
}),
|
|
88
|
+
execute: async ({ typename }, { extensions }) => {
|
|
89
|
+
invariant(extensions?.space, 'No space.');
|
|
90
|
+
const space = extensions.space;
|
|
91
|
+
|
|
92
|
+
const schema = await space.db.schemaRegistry.query({ typename }).firstOrUndefined();
|
|
93
|
+
if (!schema) {
|
|
94
|
+
return ToolResult.Error(`Schema not found: ${typename}`);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
return ToolResult.Success(schema);
|
|
98
|
+
},
|
|
99
|
+
}),
|
|
100
|
+
defineTool(SYSTEM_NAMESPACE, {
|
|
101
|
+
name: 'create',
|
|
102
|
+
description: 'Create a new schema with the provided definition.',
|
|
103
|
+
caption: 'Creating schema...',
|
|
104
|
+
schema: S.Struct({
|
|
105
|
+
typename: TypeNameSchema.annotations({
|
|
106
|
+
description:
|
|
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
|
+
}),
|
|
109
|
+
properties: S.Array(PropertyDefinitionSchema).pipe(
|
|
110
|
+
S.annotations({ description: 'Array of property definitions for the schema.' }),
|
|
111
|
+
S.mutable,
|
|
112
|
+
),
|
|
113
|
+
}),
|
|
114
|
+
execute: async ({ typename, properties }, { extensions }) => {
|
|
115
|
+
invariant(extensions?.space, 'No space.');
|
|
116
|
+
const space = extensions.space;
|
|
117
|
+
|
|
118
|
+
const schema = getSchemaFromPropertyDefinitions(typename, properties);
|
|
119
|
+
const [registeredSchema] = await space.db.schemaRegistry.register([schema]);
|
|
120
|
+
|
|
121
|
+
return ToolResult.Success(registeredSchema);
|
|
122
|
+
},
|
|
123
|
+
}),
|
|
124
|
+
]);
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { contributes, createIntent, type PluginsContext, Capabilities, LayoutAction } from '@dxos/app-framework';
|
|
6
|
-
import {
|
|
6
|
+
import { SubscriptionList } from '@dxos/async';
|
|
7
7
|
import { Expando } from '@dxos/echo-schema';
|
|
8
8
|
import { scheduledEffect } from '@dxos/echo-signals/core';
|
|
9
9
|
import { create } from '@dxos/live-object';
|
|
@@ -24,8 +24,8 @@ const ACTIVE_NODE_BROADCAST_INTERVAL = 30_000;
|
|
|
24
24
|
const WAIT_FOR_OBJECT_TIMEOUT = 1000;
|
|
25
25
|
|
|
26
26
|
export default async (context: PluginsContext) => {
|
|
27
|
-
const subscriptions = new
|
|
28
|
-
const spaceSubscriptions = new
|
|
27
|
+
const subscriptions = new SubscriptionList();
|
|
28
|
+
const spaceSubscriptions = new SubscriptionList();
|
|
29
29
|
|
|
30
30
|
const { dispatchPromise: dispatch } = context.requestCapability(Capabilities.IntentDispatcher);
|
|
31
31
|
const { graph } = context.requestCapability(Capabilities.AppGraph);
|
|
@@ -14,9 +14,11 @@ 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);
|
|
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),
|
|
@@ -22,7 +22,7 @@ import { Button, Dialog, Icon, useTranslation } from '@dxos/react-ui';
|
|
|
22
22
|
import { CreateObjectPanel, type CreateObjectPanelProps } from './CreateObjectPanel';
|
|
23
23
|
import { SpaceCapabilities } from '../../capabilities';
|
|
24
24
|
import { SPACE_PLUGIN } from '../../meta';
|
|
25
|
-
import {
|
|
25
|
+
import { type ObjectForm, SpaceAction } from '../../types';
|
|
26
26
|
|
|
27
27
|
export const CREATE_OBJECT_DIALOG = `${SPACE_PLUGIN}/CreateObjectDialog`;
|
|
28
28
|
|
|
@@ -53,16 +53,13 @@ export const CreateObjectDialog = ({
|
|
|
53
53
|
const handleCreateObject = useCallback(
|
|
54
54
|
async ({
|
|
55
55
|
form,
|
|
56
|
-
target
|
|
56
|
+
target,
|
|
57
57
|
data = {},
|
|
58
58
|
}: {
|
|
59
59
|
form: ObjectForm;
|
|
60
60
|
target: CreateObjectPanelProps['target'];
|
|
61
61
|
data?: Record<string, any>;
|
|
62
62
|
}) => {
|
|
63
|
-
const target = isSpace(_target)
|
|
64
|
-
? (_target.properties[CollectionType.typename]?.target as CollectionType | undefined)
|
|
65
|
-
: _target;
|
|
66
63
|
if (!target) {
|
|
67
64
|
// TODO(wittjosiah): UI feedback.
|
|
68
65
|
return;
|
|
@@ -76,7 +73,7 @@ export const CreateObjectDialog = ({
|
|
|
76
73
|
const result = await dispatch(form.getIntent(data, { space }));
|
|
77
74
|
const object = result.data?.object;
|
|
78
75
|
if (isReactiveObject(object)) {
|
|
79
|
-
const addObjectIntent = createIntent(SpaceAction.AddObject, { target, object });
|
|
76
|
+
const addObjectIntent = createIntent(SpaceAction.AddObject, { target, object, hidden: form.hidden });
|
|
80
77
|
const shouldNavigate = _shouldNavigate ?? (() => true);
|
|
81
78
|
if (shouldNavigate(object)) {
|
|
82
79
|
await dispatch(pipe(addObjectIntent, chain(LayoutAction.Open, { part: 'main' })));
|