@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
|
@@ -10,21 +10,21 @@ import React from 'react';
|
|
|
10
10
|
import { useClientProvider, withClientProvider } from '@dxos/react-client/testing';
|
|
11
11
|
import { withTheme } from '@dxos/storybook-utils';
|
|
12
12
|
|
|
13
|
-
import {
|
|
13
|
+
import { SpacePropertiesForm, type SpacePropertiesFormProps } from './SpacePropertiesForm';
|
|
14
14
|
import translations from '../../translations';
|
|
15
15
|
|
|
16
|
-
const Story = (args: Partial<
|
|
16
|
+
const Story = (args: Partial<SpacePropertiesFormProps>) => {
|
|
17
17
|
const { space } = useClientProvider();
|
|
18
18
|
return (
|
|
19
19
|
<div role='none' className='p-2 border border-primary-500 rounded'>
|
|
20
|
-
<
|
|
20
|
+
<SpacePropertiesForm {...args} space={space!} />
|
|
21
21
|
</div>
|
|
22
22
|
);
|
|
23
23
|
};
|
|
24
24
|
|
|
25
25
|
const meta: Meta = {
|
|
26
|
-
title: 'plugins/plugin-space/
|
|
27
|
-
component:
|
|
26
|
+
title: 'plugins/plugin-space/SpacePropertiesForm',
|
|
27
|
+
component: SpacePropertiesForm,
|
|
28
28
|
render: Story,
|
|
29
29
|
decorators: [withClientProvider({ createIdentity: true, createSpace: true }), withTheme],
|
|
30
30
|
parameters: {
|
|
@@ -35,4 +35,4 @@ const meta: Meta = {
|
|
|
35
35
|
|
|
36
36
|
export default meta;
|
|
37
37
|
|
|
38
|
-
export const Default: StoryObj<typeof
|
|
38
|
+
export const Default: StoryObj<typeof SpacePropertiesForm> = {};
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2024 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type Schema as S } from 'effect';
|
|
6
|
+
import React, { type ChangeEvent, useCallback, useMemo, useState } from 'react';
|
|
7
|
+
|
|
8
|
+
import { log } from '@dxos/log';
|
|
9
|
+
import { EdgeReplicationSetting } from '@dxos/protocols/proto/dxos/echo/metadata';
|
|
10
|
+
import { type Space } from '@dxos/react-client/echo';
|
|
11
|
+
import { Input, useTranslation } from '@dxos/react-ui';
|
|
12
|
+
import { Form, type InputComponent, ControlItem, ControlItemInput } from '@dxos/react-ui-form';
|
|
13
|
+
import { HuePicker, IconPicker } from '@dxos/react-ui-pickers';
|
|
14
|
+
|
|
15
|
+
import { SPACE_PLUGIN } from '../../meta';
|
|
16
|
+
import { SpaceForm } from '../../types';
|
|
17
|
+
|
|
18
|
+
export type SpacePropertiesFormProps = {
|
|
19
|
+
space: Space;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export const SpacePropertiesForm = ({ space }: SpacePropertiesFormProps) => {
|
|
23
|
+
const { t } = useTranslation(SPACE_PLUGIN);
|
|
24
|
+
|
|
25
|
+
const [edgeReplication, setEdgeReplication] = useState(
|
|
26
|
+
space.internal.data.edgeReplication === EdgeReplicationSetting.ENABLED,
|
|
27
|
+
);
|
|
28
|
+
const toggleEdgeReplication = useCallback(
|
|
29
|
+
async (next: boolean) => {
|
|
30
|
+
setEdgeReplication(next);
|
|
31
|
+
await space?.internal
|
|
32
|
+
.setEdgeReplicationPreference(next ? EdgeReplicationSetting.ENABLED : EdgeReplicationSetting.DISABLED)
|
|
33
|
+
.catch((err: unknown) => {
|
|
34
|
+
log.catch(err);
|
|
35
|
+
setEdgeReplication(!next);
|
|
36
|
+
});
|
|
37
|
+
},
|
|
38
|
+
[space],
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
const handleSave = useCallback(
|
|
42
|
+
(properties: S.Schema.Type<typeof SpaceForm>) => {
|
|
43
|
+
void toggleEdgeReplication(properties.edgeReplication);
|
|
44
|
+
if (properties.name !== space.properties.name) {
|
|
45
|
+
space.properties.name = properties.name;
|
|
46
|
+
}
|
|
47
|
+
if (properties.icon !== space.properties.icon) {
|
|
48
|
+
space.properties.icon = properties.icon;
|
|
49
|
+
}
|
|
50
|
+
if (properties.hue !== space.properties.hue) {
|
|
51
|
+
space.properties.hue = properties.hue;
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
[space, toggleEdgeReplication],
|
|
55
|
+
);
|
|
56
|
+
|
|
57
|
+
const values = useMemo(
|
|
58
|
+
() => ({
|
|
59
|
+
name: space.properties.name,
|
|
60
|
+
icon: space.properties.icon,
|
|
61
|
+
hue: space.properties.hue,
|
|
62
|
+
edgeReplication,
|
|
63
|
+
}),
|
|
64
|
+
[space.properties.name, space.properties.icon, space.properties.hue, edgeReplication],
|
|
65
|
+
);
|
|
66
|
+
|
|
67
|
+
const customElements: Partial<Record<string, InputComponent>> = useMemo(
|
|
68
|
+
() => ({
|
|
69
|
+
name: ({ type, label, getValue, onValueChange }) => {
|
|
70
|
+
const handleChange = useCallback(
|
|
71
|
+
({ target: { value } }: ChangeEvent<HTMLInputElement>) => onValueChange(type, value),
|
|
72
|
+
[onValueChange, type],
|
|
73
|
+
);
|
|
74
|
+
return (
|
|
75
|
+
<ControlItemInput title={label} description={t('display name description')}>
|
|
76
|
+
<Input.TextInput
|
|
77
|
+
value={getValue()}
|
|
78
|
+
onChange={handleChange}
|
|
79
|
+
placeholder={t('display name input placeholder')}
|
|
80
|
+
classNames='min-is-64'
|
|
81
|
+
/>
|
|
82
|
+
</ControlItemInput>
|
|
83
|
+
);
|
|
84
|
+
},
|
|
85
|
+
icon: ({ type, label, getValue, onValueChange }) => {
|
|
86
|
+
const handleChange = useCallback((nextEmoji: string) => onValueChange(type, nextEmoji), [onValueChange, type]);
|
|
87
|
+
const handleEmojiReset = useCallback(() => onValueChange(type, undefined), [onValueChange, type]);
|
|
88
|
+
return (
|
|
89
|
+
<ControlItem title={label} description={t('icon description')}>
|
|
90
|
+
<IconPicker
|
|
91
|
+
value={getValue()}
|
|
92
|
+
onChange={handleChange}
|
|
93
|
+
onReset={handleEmojiReset}
|
|
94
|
+
classNames='justify-self-end'
|
|
95
|
+
iconSize={5}
|
|
96
|
+
/>
|
|
97
|
+
</ControlItem>
|
|
98
|
+
);
|
|
99
|
+
},
|
|
100
|
+
hue: ({ type, label, getValue, onValueChange }) => {
|
|
101
|
+
const handleChange = useCallback((nextHue: string) => onValueChange(type, nextHue), [onValueChange, type]);
|
|
102
|
+
const handleHueReset = useCallback(() => onValueChange(type, undefined), [onValueChange, type]);
|
|
103
|
+
return (
|
|
104
|
+
<ControlItem title={label} description={t('hue description')}>
|
|
105
|
+
<HuePicker
|
|
106
|
+
value={getValue()}
|
|
107
|
+
onChange={handleChange}
|
|
108
|
+
onReset={handleHueReset}
|
|
109
|
+
classNames='[--hue-preview-size:1.25rem] justify-self-end'
|
|
110
|
+
/>
|
|
111
|
+
</ControlItem>
|
|
112
|
+
);
|
|
113
|
+
},
|
|
114
|
+
edgeReplication: ({ type, label, getValue, onValueChange }) => {
|
|
115
|
+
const handleChange = useCallback((checked: boolean) => onValueChange(type, checked), [onValueChange, type]);
|
|
116
|
+
return (
|
|
117
|
+
<ControlItemInput title={label} description={t('edge replication description')}>
|
|
118
|
+
<Input.Switch checked={getValue()} onCheckedChange={handleChange} classNames='justify-self-end' />
|
|
119
|
+
</ControlItemInput>
|
|
120
|
+
);
|
|
121
|
+
},
|
|
122
|
+
}),
|
|
123
|
+
[t],
|
|
124
|
+
);
|
|
125
|
+
|
|
126
|
+
return (
|
|
127
|
+
<Form
|
|
128
|
+
schema={SpaceForm}
|
|
129
|
+
values={values}
|
|
130
|
+
autoSave
|
|
131
|
+
onSave={handleSave}
|
|
132
|
+
Custom={customElements}
|
|
133
|
+
classNames='p-0 container-max-width [&_[role="form"]]:grid [&_[role="form"]]:grid-cols-1 md:[&_[role="form"]]:grid-cols-[1fr_min-content] [&_[role="form"]]:gap-4'
|
|
134
|
+
/>
|
|
135
|
+
);
|
|
136
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2024 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React, { useCallback, useMemo } from 'react';
|
|
6
|
+
|
|
7
|
+
import { Surface, useCapabilities, useCapability } from '@dxos/app-framework';
|
|
8
|
+
import { type Space } from '@dxos/react-client/echo';
|
|
9
|
+
import { toLocalizedString, useTranslation } from '@dxos/react-ui';
|
|
10
|
+
import { ControlSectionHeading } from '@dxos/react-ui-form';
|
|
11
|
+
import { Accordion } from '@dxos/react-ui-list';
|
|
12
|
+
import { StackItem } from '@dxos/react-ui-stack';
|
|
13
|
+
import { byPosition } from '@dxos/util';
|
|
14
|
+
|
|
15
|
+
import { SpaceCapabilities } from '../../capabilities';
|
|
16
|
+
import { SPACE_PLUGIN } from '../../meta';
|
|
17
|
+
|
|
18
|
+
export const SPACE_SETTINGS_DIALOG = `${SPACE_PLUGIN}/SpaceSettingsDialog`;
|
|
19
|
+
|
|
20
|
+
export type SpaceSettingsTab = 'members' | 'settings';
|
|
21
|
+
|
|
22
|
+
export type SpaceSettingsContainerProps = {
|
|
23
|
+
space: Space;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export const SpaceSettingsContainer = ({ space }: SpaceSettingsContainerProps) => {
|
|
27
|
+
const { t } = useTranslation(SPACE_PLUGIN);
|
|
28
|
+
const state = useCapability(SpaceCapabilities.MutableState);
|
|
29
|
+
const items = useCapabilities(SpaceCapabilities.SettingsSection).toSorted(byPosition);
|
|
30
|
+
const data = useMemo(() => ({ subject: space }), [space]);
|
|
31
|
+
|
|
32
|
+
const handleOpenSectionChange = useCallback(
|
|
33
|
+
(sections: string[]) => {
|
|
34
|
+
state.spaceSettingsOpenSections.splice(0, state.spaceSettingsOpenSections.length, ...sections);
|
|
35
|
+
},
|
|
36
|
+
[state],
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
return (
|
|
40
|
+
<StackItem.Content classNames='p-2 block overflow-y-auto'>
|
|
41
|
+
<Accordion.Root<SpaceCapabilities.SettingsSection>
|
|
42
|
+
items={items}
|
|
43
|
+
value={state.spaceSettingsOpenSections}
|
|
44
|
+
onValueChange={handleOpenSectionChange}
|
|
45
|
+
>
|
|
46
|
+
{({ items }) => (
|
|
47
|
+
<>
|
|
48
|
+
{items.map((item) => (
|
|
49
|
+
<Accordion.Item key={item.id} item={item} classNames='container-max-width'>
|
|
50
|
+
<Accordion.ItemHeader classNames='pie-6' asChild>
|
|
51
|
+
<ControlSectionHeading title={toLocalizedString(item.label, t)} />
|
|
52
|
+
</Accordion.ItemHeader>
|
|
53
|
+
<Accordion.ItemBody>
|
|
54
|
+
<Surface role={`space-settings--${item.id}`} data={data} />
|
|
55
|
+
</Accordion.ItemBody>
|
|
56
|
+
</Accordion.Item>
|
|
57
|
+
))}
|
|
58
|
+
</>
|
|
59
|
+
)}
|
|
60
|
+
</Accordion.Root>
|
|
61
|
+
</StackItem.Content>
|
|
62
|
+
);
|
|
63
|
+
};
|
|
@@ -94,7 +94,7 @@ export const SyncStatusDetail = ({ classNames, state, summary, debug }: SyncStat
|
|
|
94
94
|
|
|
95
95
|
// TODO(burdon): Normalize to max document count?
|
|
96
96
|
return (
|
|
97
|
-
<div className={mx('flex flex-col gap-3 p-2 text-xs min-w-
|
|
97
|
+
<div className={mx('flex flex-col gap-3 p-2 text-xs min-w-[400px]', classNames)}>
|
|
98
98
|
<div role='none' className='flex items-center'>
|
|
99
99
|
<h1 className='flex-1'>{t('sync status title')}</h1>
|
|
100
100
|
<div className='flex items-center gap-2'>
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { type
|
|
5
|
+
import { type CleanupFn } from '@dxos/async';
|
|
6
6
|
import { type Client } from '@dxos/client';
|
|
7
7
|
import { type Space, type SpaceId } from '@dxos/client/echo';
|
|
8
8
|
import { Context } from '@dxos/context';
|
|
9
9
|
|
|
10
10
|
export const createClientSaveTracker = (client: Client, cb: (state: 'saved' | 'saving') => void) => {
|
|
11
|
-
const
|
|
11
|
+
const CleanupFns: Record<SpaceId, CleanupFn> = {};
|
|
12
12
|
const state: Record<SpaceId, 'saved' | 'saving'> = {};
|
|
13
13
|
|
|
14
14
|
const install = (spaces: Space[]) => {
|
|
@@ -18,7 +18,7 @@ export const createClientSaveTracker = (client: Client, cb: (state: 'saved' | 's
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
state[space.id] = 'saved';
|
|
21
|
-
|
|
21
|
+
CleanupFns[space.id] = createSpaceSaveTracker(space, (s) => {
|
|
22
22
|
state[space.id] = s;
|
|
23
23
|
cb(Object.values(state).some((s) => s === 'saving') ? 'saving' : 'saved');
|
|
24
24
|
});
|
|
@@ -30,13 +30,13 @@ export const createClientSaveTracker = (client: Client, cb: (state: 'saved' | 's
|
|
|
30
30
|
install(client.spaces.get());
|
|
31
31
|
|
|
32
32
|
return () => {
|
|
33
|
-
for (const unsubscribe of Object.values(
|
|
33
|
+
for (const unsubscribe of Object.values(CleanupFns)) {
|
|
34
34
|
unsubscribe();
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
37
|
};
|
|
38
38
|
|
|
39
|
-
const createSpaceSaveTracker = (space: Space, cb: (state: 'saved' | 'saving') => void):
|
|
39
|
+
const createSpaceSaveTracker = (space: Space, cb: (state: 'saved' | 'saving') => void): CleanupFn => {
|
|
40
40
|
const ctx = new Context();
|
|
41
41
|
|
|
42
42
|
void space.waitUntilReady().then(() => {
|
package/src/components/index.ts
CHANGED
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
export * from './AdvancedObjectSettings';
|
|
6
5
|
export * from './AwaitingObject';
|
|
7
|
-
export * from './BaseObjectSettings';
|
|
8
6
|
export * from './CreateDialog';
|
|
9
7
|
export * from './CollectionMain';
|
|
10
8
|
export * from './CollectionSection';
|
|
11
9
|
export * from './JoinDialog';
|
|
10
|
+
export * from './MembersContainer';
|
|
12
11
|
export * from './MenuFooter';
|
|
12
|
+
export * from './ObjectSettingsContainer';
|
|
13
13
|
export * from './PersistenceStatus';
|
|
14
14
|
export * from './PopoverAddSpace';
|
|
15
15
|
export * from './PopoverRenameObject';
|
package/src/events.ts
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { defineEvent } from '@dxos/app-framework';
|
|
5
|
+
import { defineEvent, Events } from '@dxos/app-framework';
|
|
6
6
|
|
|
7
7
|
import { SPACE_PLUGIN } from './meta';
|
|
8
8
|
|
|
9
9
|
export namespace SpaceEvents {
|
|
10
|
+
export const StateReady = Events.createStateEvent(`${SPACE_PLUGIN}/event/state-ready`);
|
|
10
11
|
export const SetupSettingsPanel = defineEvent(`${SPACE_PLUGIN}/event/setup-settings-panel`);
|
|
11
|
-
export const StateReady = defineEvent(`${SPACE_PLUGIN}/event/state-ready`);
|
|
12
12
|
export const DefaultSpaceReady = defineEvent(`${SPACE_PLUGIN}/event/default-space-ready`);
|
|
13
13
|
}
|
|
14
14
|
|
package/src/meta.ts
CHANGED
|
@@ -6,8 +6,8 @@ import { type PluginMeta } from '@dxos/app-framework';
|
|
|
6
6
|
|
|
7
7
|
export const SPACE_PLUGIN = 'dxos.org/plugin/space';
|
|
8
8
|
|
|
9
|
-
export const meta = {
|
|
9
|
+
export const meta: PluginMeta = {
|
|
10
10
|
id: SPACE_PLUGIN,
|
|
11
11
|
name: 'Spaces',
|
|
12
12
|
icon: 'ph--planet--regular',
|
|
13
|
-
}
|
|
13
|
+
};
|
package/src/translations.ts
CHANGED
|
@@ -10,6 +10,7 @@ export default [
|
|
|
10
10
|
'en-US': {
|
|
11
11
|
[CollectionType.typename]: {
|
|
12
12
|
'typename label': 'Collection',
|
|
13
|
+
'object name placeholder': 'New collection',
|
|
13
14
|
},
|
|
14
15
|
[SPACE_PLUGIN]: {
|
|
15
16
|
'plugin name': 'Spaces',
|
|
@@ -39,7 +40,7 @@ export default [
|
|
|
39
40
|
'confirm restore title': 'Overwrite files in this space?',
|
|
40
41
|
'confirm restore body': 'Restoring from a backup will overwrite the contents of any documents that match.',
|
|
41
42
|
'upload file message': 'Drag file here or click to browse',
|
|
42
|
-
'object
|
|
43
|
+
'object placeholder': 'Type a title here…',
|
|
43
44
|
'personal space label': 'Personal Space',
|
|
44
45
|
'spaces label': 'Spaces',
|
|
45
46
|
'show hidden spaces label': 'Show closed spaces',
|
|
@@ -64,9 +65,6 @@ export default [
|
|
|
64
65
|
'missing object message': 'Object not available.',
|
|
65
66
|
'missing object description':
|
|
66
67
|
'The requested object has not been found yet. Ensure there are enough peers online in the space with an updated copy.',
|
|
67
|
-
'create collection label': 'Create collection',
|
|
68
|
-
'unnamed object label': 'New object',
|
|
69
|
-
'unnamed collection label': 'New collection',
|
|
70
68
|
'create object in space label': 'Add to space',
|
|
71
69
|
'create object in collection label': 'Add to collection',
|
|
72
70
|
'share space label': 'Share',
|
|
@@ -98,18 +96,13 @@ export default [
|
|
|
98
96
|
'join success label': 'Successfully joined space',
|
|
99
97
|
'name label': 'Name',
|
|
100
98
|
'name placeholder': 'Name',
|
|
101
|
-
'
|
|
99
|
+
'object settings label': 'Settings',
|
|
102
100
|
'edge replication label': 'Enable EDGE Replication',
|
|
103
101
|
'saving locally label': 'Writing to disk',
|
|
104
102
|
'downloading label': 'Replicating from peers',
|
|
105
103
|
'uploading label': 'Replicating to peers',
|
|
106
104
|
'offline persisted label': 'Saved to disk (offline)',
|
|
107
105
|
'remote synced label': 'Synced with peers',
|
|
108
|
-
'open settings panel label': 'Show Settings',
|
|
109
|
-
'settings panel label': 'Settings',
|
|
110
|
-
'open space settings label': 'Space Settings',
|
|
111
|
-
'members tab label': 'Members',
|
|
112
|
-
'settings tab label': 'Settings',
|
|
113
106
|
'syncing label': 'Space syncing',
|
|
114
107
|
'show all label': 'Show all',
|
|
115
108
|
'no sync status label': 'No space with missing objects.',
|
|
@@ -125,8 +118,24 @@ export default [
|
|
|
125
118
|
'advanced settings label': 'Advanced',
|
|
126
119
|
'foreign keys': 'Foreign Keys',
|
|
127
120
|
'add key': 'Add Key',
|
|
128
|
-
|
|
129
|
-
'
|
|
121
|
+
|
|
122
|
+
'members panel label': 'Members',
|
|
123
|
+
'members verbose label': 'Manage space members',
|
|
124
|
+
'members description': 'You can view the current status of space members here as well as invite new members.',
|
|
125
|
+
'members label': 'Members',
|
|
126
|
+
'invitations label': 'Invitations',
|
|
127
|
+
'space invitation description': 'Manage invitations to the space.',
|
|
128
|
+
'qr code description': 'Share this QR code, or copy the URL and share it with the person you want to invite.',
|
|
129
|
+
|
|
130
|
+
'settings panel label': 'Space Settings',
|
|
131
|
+
'open space settings label': 'Space Settings',
|
|
132
|
+
'space settings properties label': 'General',
|
|
133
|
+
'display name input placeholder': 'Space name',
|
|
134
|
+
'display name description': 'Name of the space as it appears in the app.',
|
|
135
|
+
'icon description': 'Icon used to represent the space in the app.',
|
|
136
|
+
'hue description': 'Color used to represent the space in the app.',
|
|
137
|
+
'edge replication description':
|
|
138
|
+
"Only change this if you know what you're doing. Disabling this will prevent the space from replicating through Composer's EDGE services, and relies solely on peer-to-peer sync.",
|
|
130
139
|
},
|
|
131
140
|
},
|
|
132
141
|
},
|
package/src/types/thread.ts
CHANGED
|
@@ -3,65 +3,11 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { Expando, Ref, S, TypedObject } from '@dxos/echo-schema';
|
|
6
|
+
import { MessageType } from '@dxos/schema';
|
|
6
7
|
|
|
7
8
|
// TODO(wittjosiah): These types were placed here rather than in @dxos/plugin-thread
|
|
8
9
|
// in order to avoid a circular dependency between threads and other objects that use threads.
|
|
9
10
|
|
|
10
|
-
// TODO(wittjosiah): Factor out to halo?
|
|
11
|
-
export class ContactType extends TypedObject({ typename: 'dxos.org/type/Contact', version: '0.1.0' })({
|
|
12
|
-
name: S.optional(S.String),
|
|
13
|
-
identifiers: S.mutable(
|
|
14
|
-
S.Array(
|
|
15
|
-
S.Struct({
|
|
16
|
-
type: S.String,
|
|
17
|
-
value: S.String,
|
|
18
|
-
}),
|
|
19
|
-
),
|
|
20
|
-
),
|
|
21
|
-
}) {}
|
|
22
|
-
|
|
23
|
-
export const ActorSchema = S.mutable(
|
|
24
|
-
S.Struct({
|
|
25
|
-
contact: S.optional(Ref(ContactType)),
|
|
26
|
-
// TODO(wittjosiah): Should the below fields just be the contact schema?
|
|
27
|
-
// i.e. it should either be a reference to an existing contact or an inline contact schema.
|
|
28
|
-
identityKey: S.optional(S.String),
|
|
29
|
-
// TODO(burdon): Generalize to handle/identifier?
|
|
30
|
-
email: S.optional(S.String),
|
|
31
|
-
name: S.optional(S.String),
|
|
32
|
-
}),
|
|
33
|
-
);
|
|
34
|
-
|
|
35
|
-
export type ActorType = S.Schema.Type<typeof ActorSchema>;
|
|
36
|
-
|
|
37
|
-
export enum MessageState {
|
|
38
|
-
NONE = 0,
|
|
39
|
-
ARCHIVED = 1,
|
|
40
|
-
DELETED = 2,
|
|
41
|
-
SPAM = 3,
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export class MessageType extends TypedObject({ typename: 'dxos.org/type/Message', version: '0.1.0' })({
|
|
45
|
-
/** ISO date string when the message was sent. */
|
|
46
|
-
timestamp: S.String,
|
|
47
|
-
/** Message state. */
|
|
48
|
-
state: S.optional(S.Enums(MessageState)),
|
|
49
|
-
/** Identity of the message sender. */
|
|
50
|
-
sender: ActorSchema,
|
|
51
|
-
/** Text content of the message. */
|
|
52
|
-
text: S.String,
|
|
53
|
-
/** Non-text content sent with a message (e.g., files, polls, etc.) */
|
|
54
|
-
parts: S.optional(S.mutable(S.Array(Ref(Expando)))),
|
|
55
|
-
/** Custom properties for specific message types (e.g. email subject or cc fields). */
|
|
56
|
-
properties: S.optional(S.mutable(S.Record({ key: S.String, value: S.Any }))),
|
|
57
|
-
// TODO(wittjosiah): Add read status:
|
|
58
|
-
// - Read receipts need to be per space member.
|
|
59
|
-
// - Read receipts don't need to be added to schema until they being implemented.
|
|
60
|
-
/** Context of the application when message was created. */
|
|
61
|
-
// TODO(burdon): Evolve "attention object" to be current UX state? E.g., of Deck?
|
|
62
|
-
context: S.optional(Ref(Expando)),
|
|
63
|
-
}) {}
|
|
64
|
-
|
|
65
11
|
export const ThreadStatus = S.Union(S.Literal('staged'), S.Literal('active'), S.Literal('resolved'));
|
|
66
12
|
|
|
67
13
|
export class ThreadType extends TypedObject({ typename: 'dxos.org/type/Thread', version: '0.1.0' })({
|
|
@@ -74,5 +20,5 @@ export class ThreadType extends TypedObject({ typename: 'dxos.org/type/Thread',
|
|
|
74
20
|
|
|
75
21
|
export class ChannelType extends TypedObject({ typename: 'dxos.org/type/Channel', version: '0.1.0' })({
|
|
76
22
|
name: S.optional(S.String),
|
|
77
|
-
|
|
23
|
+
queue: Ref(Expando),
|
|
78
24
|
}) {}
|
package/src/types/types.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { type AnyIntentChain } from '@dxos/app-framework';
|
|
6
|
-
import {
|
|
6
|
+
import { S, type Expando, type BaseObject, type TypedObject } from '@dxos/echo-schema';
|
|
7
7
|
import { type PublicKey } from '@dxos/react-client';
|
|
8
8
|
// TODO(wittjosiah): This pulls in full client.
|
|
9
9
|
import { EchoObjectSchema, ReactiveObjectSchema, type Space, SpaceSchema } from '@dxos/react-client/echo';
|
|
@@ -42,6 +42,11 @@ export type PluginState = {
|
|
|
42
42
|
*/
|
|
43
43
|
spaceNames: Record<string, string>;
|
|
44
44
|
|
|
45
|
+
/**
|
|
46
|
+
* Which sections of the space settings are open.
|
|
47
|
+
*/
|
|
48
|
+
spaceSettingsOpenSections: string[];
|
|
49
|
+
|
|
45
50
|
/**
|
|
46
51
|
* Which spaces have an SDK migration running currently.
|
|
47
52
|
*/
|
|
@@ -88,14 +93,18 @@ export interface TypedObjectSerializer<T extends Expando = Expando> {
|
|
|
88
93
|
}
|
|
89
94
|
|
|
90
95
|
export const SpaceForm = S.Struct({
|
|
91
|
-
name: S.optional(S.String.annotations({
|
|
96
|
+
name: S.optional(S.String.annotations({ title: 'Name' })),
|
|
97
|
+
icon: S.optional(S.String.annotations({ title: 'Icon' })),
|
|
98
|
+
hue: S.optional(S.String.annotations({ title: 'Color' })),
|
|
92
99
|
// TODO(wittjosiah): Make optional with default value.
|
|
93
|
-
edgeReplication: S.Boolean.annotations({
|
|
100
|
+
edgeReplication: S.Boolean.annotations({ title: 'Enable EDGE Replication' }),
|
|
94
101
|
});
|
|
95
102
|
|
|
96
103
|
export type ObjectForm<T extends BaseObject = BaseObject> = {
|
|
104
|
+
// TODO(dmaretskyi): Change to S.Schema.AnyNoContext
|
|
97
105
|
objectSchema: TypedObject;
|
|
98
106
|
formSchema?: S.Schema<T, any>;
|
|
107
|
+
hidden?: boolean;
|
|
99
108
|
getIntent: (props: T, options: { space: Space }) => AnyIntentChain;
|
|
100
109
|
};
|
|
101
110
|
|
|
@@ -165,10 +174,9 @@ export namespace SpaceAction {
|
|
|
165
174
|
output: S.Void,
|
|
166
175
|
}) {}
|
|
167
176
|
|
|
177
|
+
// TODO(wittjosiah): Handle scrolling to section.
|
|
168
178
|
export class OpenSettings extends S.TaggedClass<OpenSettings>()(`${SPACE_ACTION}/open-settings`, {
|
|
169
|
-
input: S.Struct({
|
|
170
|
-
space: SpaceSchema,
|
|
171
|
-
}),
|
|
179
|
+
input: S.Struct({ space: SpaceSchema }),
|
|
172
180
|
output: S.Void,
|
|
173
181
|
}) {}
|
|
174
182
|
|
|
@@ -206,6 +214,7 @@ export namespace SpaceAction {
|
|
|
206
214
|
input: S.Struct({
|
|
207
215
|
object: ReactiveObjectSchema,
|
|
208
216
|
target: S.Union(SpaceSchema, CollectionType),
|
|
217
|
+
hidden: S.optional(S.Boolean),
|
|
209
218
|
}),
|
|
210
219
|
output: S.Struct({
|
|
211
220
|
id: S.String,
|
package/src/util.tsx
CHANGED
|
@@ -3,10 +3,11 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { createIntent, type PromiseIntentDispatcher, LayoutAction } from '@dxos/app-framework';
|
|
6
|
-
import { EXPANDO_TYPENAME,
|
|
6
|
+
import { EXPANDO_TYPENAME, getTypeAnnotation, getTypename, type Expando } from '@dxos/echo-schema';
|
|
7
7
|
import { invariant } from '@dxos/invariant';
|
|
8
8
|
import { getSchema, isReactiveObject, makeRef } from '@dxos/live-object';
|
|
9
9
|
import { Migrations } from '@dxos/migrations';
|
|
10
|
+
import { ATTENDABLE_PATH_SEPARATOR } from '@dxos/plugin-deck/types';
|
|
10
11
|
import {
|
|
11
12
|
ACTION_GROUP_TYPE,
|
|
12
13
|
ACTION_TYPE,
|
|
@@ -101,7 +102,6 @@ const getCollectionGraphNodePartials = ({
|
|
|
101
102
|
resolve: (typename: string) => Record<string, any>;
|
|
102
103
|
}) => {
|
|
103
104
|
return {
|
|
104
|
-
disabled: !navigable,
|
|
105
105
|
acceptPersistenceClass: new Set(['echo']),
|
|
106
106
|
acceptPersistenceKey: new Set([space.id]),
|
|
107
107
|
role: 'branch',
|
|
@@ -213,6 +213,28 @@ export const constructSpaceNode = ({
|
|
|
213
213
|
disabled: !navigable || space.state.get() !== SpaceState.SPACE_READY || hasPendingMigration,
|
|
214
214
|
testId: 'spacePlugin.space',
|
|
215
215
|
},
|
|
216
|
+
nodes: [
|
|
217
|
+
{
|
|
218
|
+
id: `${space.id}${ATTENDABLE_PATH_SEPARATOR}members`,
|
|
219
|
+
type: `${SPACE_PLUGIN}/members`,
|
|
220
|
+
data: space,
|
|
221
|
+
properties: {
|
|
222
|
+
label: ['members panel label', { ns: SPACE_PLUGIN }],
|
|
223
|
+
icon: 'ph--users--regular',
|
|
224
|
+
disposition: 'hidden',
|
|
225
|
+
},
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
id: `${space.id}${ATTENDABLE_PATH_SEPARATOR}settings`,
|
|
229
|
+
type: `${SPACE_PLUGIN}/settings`,
|
|
230
|
+
data: space,
|
|
231
|
+
properties: {
|
|
232
|
+
label: ['settings panel label', { ns: SPACE_PLUGIN }],
|
|
233
|
+
icon: 'ph--gear--regular',
|
|
234
|
+
disposition: 'hidden',
|
|
235
|
+
},
|
|
236
|
+
},
|
|
237
|
+
],
|
|
216
238
|
};
|
|
217
239
|
};
|
|
218
240
|
|
|
@@ -242,7 +264,7 @@ export const constructSpaceActions = ({
|
|
|
242
264
|
properties: {
|
|
243
265
|
label: ['migrate space label', { ns: SPACE_PLUGIN }],
|
|
244
266
|
icon: 'ph--database--regular',
|
|
245
|
-
disposition: '
|
|
267
|
+
disposition: 'list-item-primary',
|
|
246
268
|
disabled: migrating || Migrations.running(space),
|
|
247
269
|
},
|
|
248
270
|
});
|
|
@@ -277,7 +299,7 @@ export const constructSpaceActions = ({
|
|
|
277
299
|
label: ['share space label', { ns: SPACE_PLUGIN }],
|
|
278
300
|
icon: 'ph--users--regular',
|
|
279
301
|
disabled: locked,
|
|
280
|
-
disposition: '
|
|
302
|
+
disposition: 'list-item-primary',
|
|
281
303
|
iconOnly: false,
|
|
282
304
|
variant: 'default',
|
|
283
305
|
testId: 'spacePlugin.shareSpace',
|
|
@@ -357,7 +379,7 @@ export const constructSpaceActions = ({
|
|
|
357
379
|
properties: {
|
|
358
380
|
label: ['open space label', { ns: SPACE_PLUGIN }],
|
|
359
381
|
icon: 'ph--clock-counter-clockwise--regular',
|
|
360
|
-
disposition: '
|
|
382
|
+
disposition: 'list-item-primary',
|
|
361
383
|
},
|
|
362
384
|
});
|
|
363
385
|
}
|
|
@@ -399,8 +421,7 @@ export const createObjectNode = ({
|
|
|
399
421
|
properties: {
|
|
400
422
|
...partials,
|
|
401
423
|
label: metadata.label?.(object) ||
|
|
402
|
-
object.name ||
|
|
403
|
-
metadata.placeholder || ['unnamed object label', { ns: SPACE_PLUGIN }],
|
|
424
|
+
object.name || ['object name placeholder', { ns: type, default: 'New object' }],
|
|
404
425
|
icon: metadata.icon ?? 'ph--placeholder--regular',
|
|
405
426
|
testId: 'spacePlugin.object',
|
|
406
427
|
persistenceClass: 'echo',
|
|
@@ -434,7 +455,7 @@ export const constructObjectActions = ({
|
|
|
434
455
|
properties: {
|
|
435
456
|
label: ['create object in collection label', { ns: SPACE_PLUGIN }],
|
|
436
457
|
icon: 'ph--plus--regular',
|
|
437
|
-
disposition: '
|
|
458
|
+
disposition: 'list-item-primary',
|
|
438
459
|
testId: 'spacePlugin.createObject',
|
|
439
460
|
},
|
|
440
461
|
},
|
|
@@ -561,7 +582,7 @@ export const cloneObject = async (
|
|
|
561
582
|
newSpace: Space,
|
|
562
583
|
): Promise<Expando> => {
|
|
563
584
|
const schema = getSchema(object);
|
|
564
|
-
const typename = schema ?
|
|
585
|
+
const typename = schema ? getTypeAnnotation(schema)?.typename ?? EXPANDO_TYPENAME : EXPANDO_TYPENAME;
|
|
565
586
|
const metadata = resolve(typename);
|
|
566
587
|
const serializer = metadata.serializer;
|
|
567
588
|
invariant(serializer, `No serializer for type: ${typename}`);
|