@dxos/plugin-space 0.8.1-main.ae460ac → 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/AwaitingObject.d.ts +2 -1
- package/dist/types/src/components/AwaitingObject.d.ts.map +1 -1
- package/dist/types/src/components/CollectionMain.d.ts +2 -1
- package/dist/types/src/components/CollectionMain.d.ts.map +1 -1
- package/dist/types/src/components/CollectionSection.d.ts +2 -1
- package/dist/types/src/components/CollectionSection.d.ts.map +1 -1
- package/dist/types/src/components/CreateDialog/CreateObjectDialog.d.ts +2 -1
- package/dist/types/src/components/CreateDialog/CreateObjectDialog.d.ts.map +1 -1
- package/dist/types/src/components/CreateDialog/CreateObjectPanel.d.ts +2 -1
- package/dist/types/src/components/CreateDialog/CreateObjectPanel.d.ts.map +1 -1
- package/dist/types/src/components/CreateDialog/CreateSpaceDialog.d.ts +2 -1
- package/dist/types/src/components/CreateDialog/CreateSpaceDialog.d.ts.map +1 -1
- package/dist/types/src/components/JoinDialog.d.ts +2 -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/MenuFooter.d.ts +2 -1
- package/dist/types/src/components/MenuFooter.d.ts.map +1 -1
- package/dist/types/src/components/{AdvancedObjectSettings → ObjectSettingsContainer}/AdvancedObjectSettings.d.ts +2 -1
- 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/{AdvancedObjectSettings → ObjectSettingsContainer}/ForeignKeys.d.ts +2 -1
- 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/PersistenceStatus.d.ts +2 -1
- package/dist/types/src/components/PersistenceStatus.d.ts.map +1 -1
- package/dist/types/src/components/PopoverAddSpace.d.ts +2 -1
- package/dist/types/src/components/PopoverAddSpace.d.ts.map +1 -1
- package/dist/types/src/components/PopoverRenameObject.d.ts +2 -1
- package/dist/types/src/components/PopoverRenameObject.d.ts.map +1 -1
- package/dist/types/src/components/PopoverRenameSpace.d.ts +2 -1
- package/dist/types/src/components/PopoverRenameSpace.d.ts.map +1 -1
- package/dist/types/src/components/ShareSpaceButton.d.ts +3 -2
- package/dist/types/src/components/ShareSpaceButton.d.ts.map +1 -1
- package/dist/types/src/components/SpacePluginSettings.d.ts +2 -1
- package/dist/types/src/components/SpacePluginSettings.d.ts.map +1 -1
- package/dist/types/src/components/SpacePresence.d.ts +5 -4
- package/dist/types/src/components/SpacePresence.d.ts.map +1 -1
- package/dist/types/src/components/SpacePresence.stories.d.ts +3 -2
- package/dist/types/src/components/SpacePresence.stories.d.ts.map +1 -1
- package/dist/types/src/components/SpaceSettings/SpacePropertiesForm.d.ts +7 -0
- package/dist/types/src/components/SpaceSettings/SpacePropertiesForm.d.ts.map +1 -0
- package/dist/types/src/components/SpaceSettings/SpacePropertiesForm.stories.d.ts +7 -0
- package/dist/types/src/components/SpaceSettings/SpacePropertiesForm.stories.d.ts.map +1 -0
- package/dist/types/src/components/SpaceSettings/SpaceSettingsContainer.d.ts +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/SyncStatus/InlineSyncStatus.d.ts +2 -1
- package/dist/types/src/components/SyncStatus/InlineSyncStatus.d.ts.map +1 -1
- package/dist/types/src/components/SyncStatus/Space.d.ts +3 -2
- package/dist/types/src/components/SyncStatus/Space.d.ts.map +1 -1
- package/dist/types/src/components/SyncStatus/SyncStatus.d.ts +4 -3
- package/dist/types/src/components/SyncStatus/SyncStatus.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +2 -2
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/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 +45 -40
- 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 -6
- package/dist/types/src/components/BaseObjectSettings.d.ts.map +0 -1
- package/dist/types/src/components/SpaceSettings/SpaceSettingsDialog.d.ts +0 -10
- 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 -6
- 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/src/components/{AdvancedObjectSettings → ObjectSettingsContainer}/ForeignKeys.tsx +0 -0
|
@@ -1,128 +1,34 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SpaceCapabilities
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-KVRYWFZU.mjs";
|
|
4
4
|
import {
|
|
5
|
-
COMPOSER_SPACE_LOCK,
|
|
6
5
|
getSpaceDisplayName
|
|
7
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-LO5UL6RU.mjs";
|
|
8
7
|
import {
|
|
9
8
|
CollectionType,
|
|
10
9
|
SpaceAction,
|
|
11
10
|
SpaceForm
|
|
12
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-AYW4IDRT.mjs";
|
|
13
12
|
import {
|
|
14
|
-
SPACE_PLUGIN
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
// packages/plugins/plugin-space/src/components/AdvancedObjectSettings/AdvancedObjectSettings.tsx
|
|
18
|
-
import React2, { useCallback as useCallback2, useState } from "react";
|
|
19
|
-
import { ForeignKeySchema } from "@dxos/echo-schema";
|
|
20
|
-
import { getMeta } from "@dxos/react-client/echo";
|
|
21
|
-
import { IconButton as IconButton2, useTranslation as useTranslation2, Separator } from "@dxos/react-ui";
|
|
22
|
-
import { Form } from "@dxos/react-ui-form";
|
|
23
|
-
|
|
24
|
-
// packages/plugins/plugin-space/src/components/AdvancedObjectSettings/ForeignKeys.tsx
|
|
25
|
-
import React, { useCallback } from "react";
|
|
26
|
-
import { IconButton, List, ListItem, useTranslation } from "@dxos/react-ui";
|
|
27
|
-
var ForeignKeys = ({ keys, onDelete }) => {
|
|
28
|
-
return /* @__PURE__ */ React.createElement(List, {
|
|
29
|
-
classNames: "flex flex-col gap-2"
|
|
30
|
-
}, keys.map((key) => /* @__PURE__ */ React.createElement(KeyItem, {
|
|
31
|
-
key: key.id,
|
|
32
|
-
forignKey: key,
|
|
33
|
-
onDelete
|
|
34
|
-
})));
|
|
35
|
-
};
|
|
36
|
-
var KeyItem = ({ forignKey, onDelete }) => {
|
|
37
|
-
const { t } = useTranslation(SPACE_PLUGIN);
|
|
38
|
-
const handleDelete = useCallback(() => {
|
|
39
|
-
onDelete?.(forignKey);
|
|
40
|
-
}, [
|
|
41
|
-
forignKey,
|
|
42
|
-
onDelete
|
|
43
|
-
]);
|
|
44
|
-
return /* @__PURE__ */ React.createElement(ListItem.Root, {
|
|
45
|
-
classNames: "px-2"
|
|
46
|
-
}, /* @__PURE__ */ React.createElement(ListItem.Heading, {
|
|
47
|
-
classNames: "flex flex-col grow truncate"
|
|
48
|
-
}, /* @__PURE__ */ React.createElement("div", null, forignKey.source), /* @__PURE__ */ React.createElement("div", {
|
|
49
|
-
className: "text-description text-sm truncate"
|
|
50
|
-
}, forignKey.id)), /* @__PURE__ */ React.createElement(ListItem.Endcap, null, /* @__PURE__ */ React.createElement(IconButton, {
|
|
51
|
-
iconOnly: true,
|
|
52
|
-
icon: "ph--x--regular",
|
|
53
|
-
variant: "ghost",
|
|
54
|
-
label: t("delete key"),
|
|
55
|
-
onClick: handleDelete
|
|
56
|
-
})));
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
// packages/plugins/plugin-space/src/components/AdvancedObjectSettings/AdvancedObjectSettings.tsx
|
|
60
|
-
var initialValues = {
|
|
61
|
-
source: "",
|
|
62
|
-
id: ""
|
|
63
|
-
};
|
|
64
|
-
var AdvancedObjectSettings = ({ object }) => {
|
|
65
|
-
const { t } = useTranslation2(SPACE_PLUGIN);
|
|
66
|
-
const [adding, setAdding] = useState(false);
|
|
67
|
-
const keys = getMeta(object).keys;
|
|
68
|
-
const handleNew = useCallback2(() => setAdding(true), []);
|
|
69
|
-
const handleCancel = useCallback2(() => setAdding(false), []);
|
|
70
|
-
const handleSave = useCallback2((key) => {
|
|
71
|
-
const index = keys.findIndex(({ source, id }) => source === key.source && id === key.id);
|
|
72
|
-
if (index === -1) {
|
|
73
|
-
keys.push(key);
|
|
74
|
-
}
|
|
75
|
-
setAdding(false);
|
|
76
|
-
}, [
|
|
77
|
-
keys
|
|
78
|
-
]);
|
|
79
|
-
const handleDelete = useCallback2((key) => {
|
|
80
|
-
const index = keys.findIndex(({ source, id }) => source === key.source && id === key.id);
|
|
81
|
-
if (index !== -1) {
|
|
82
|
-
keys.splice(index, 1);
|
|
83
|
-
}
|
|
84
|
-
}, [
|
|
85
|
-
keys
|
|
86
|
-
]);
|
|
87
|
-
return /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement(Separator, null), /* @__PURE__ */ React2.createElement("div", {
|
|
88
|
-
className: "p-2 flex flex-col gap-4"
|
|
89
|
-
}, /* @__PURE__ */ React2.createElement("h2", null, t("advanced settings label")), /* @__PURE__ */ React2.createElement("div", {
|
|
90
|
-
className: "flex items-center"
|
|
91
|
-
}, /* @__PURE__ */ React2.createElement("h3", {
|
|
92
|
-
className: "text-sm font-semibold"
|
|
93
|
-
}, t("foreign keys")), /* @__PURE__ */ React2.createElement("div", {
|
|
94
|
-
className: "grow"
|
|
95
|
-
}), /* @__PURE__ */ React2.createElement(IconButton2, {
|
|
96
|
-
classNames: adding && "invisible",
|
|
97
|
-
icon: "ph--plus--regular",
|
|
98
|
-
label: t("add key"),
|
|
99
|
-
onClick: handleNew
|
|
100
|
-
})), !adding && /* @__PURE__ */ React2.createElement(ForeignKeys, {
|
|
101
|
-
keys,
|
|
102
|
-
onDelete: handleDelete
|
|
103
|
-
})), adding && /* @__PURE__ */ React2.createElement(Form, {
|
|
104
|
-
schema: ForeignKeySchema,
|
|
105
|
-
values: initialValues,
|
|
106
|
-
onSave: handleSave,
|
|
107
|
-
onCancel: handleCancel
|
|
108
|
-
}));
|
|
109
|
-
};
|
|
13
|
+
SPACE_PLUGIN,
|
|
14
|
+
meta
|
|
15
|
+
} from "./chunk-PTKYMZWO.mjs";
|
|
110
16
|
|
|
111
17
|
// packages/plugins/plugin-space/src/components/AwaitingObject.tsx
|
|
112
18
|
import { CheckCircle, CircleDashed, CircleNotch } from "@phosphor-icons/react";
|
|
113
|
-
import
|
|
19
|
+
import React, { useCallback, useEffect, useState } from "react";
|
|
114
20
|
import { createIntent, LayoutAction, useIntentDispatcher, useLayout } from "@dxos/app-framework";
|
|
115
21
|
import { useClient } from "@dxos/react-client";
|
|
116
22
|
import { Filter, fullyQualifiedId, useQuery } from "@dxos/react-client/echo";
|
|
117
|
-
import { Button, Toast, useTranslation
|
|
23
|
+
import { Button, Toast, useTranslation } from "@dxos/react-ui";
|
|
118
24
|
import { getSize, mx } from "@dxos/react-ui-theme";
|
|
119
25
|
var WAIT_FOR_OBJECT_TIMEOUT = 18e4;
|
|
120
26
|
var TOAST_TIMEOUT = 24e4;
|
|
121
27
|
var AwaitingObject = ({ id }) => {
|
|
122
|
-
const [open, setOpen] =
|
|
123
|
-
const [waiting, setWaiting] =
|
|
124
|
-
const [found, setFound] =
|
|
125
|
-
const { t } =
|
|
28
|
+
const [open, setOpen] = useState(true);
|
|
29
|
+
const [waiting, setWaiting] = useState(true);
|
|
30
|
+
const [found, setFound] = useState(false);
|
|
31
|
+
const { t } = useTranslation(SPACE_PLUGIN);
|
|
126
32
|
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
127
33
|
const layout = useLayout();
|
|
128
34
|
const client = useClient();
|
|
@@ -150,12 +56,12 @@ var AwaitingObject = ({ id }) => {
|
|
|
150
56
|
objects,
|
|
151
57
|
layout
|
|
152
58
|
]);
|
|
153
|
-
const handleClose =
|
|
59
|
+
const handleClose = useCallback(async () => dispatch(createIntent(SpaceAction.WaitForObject, {
|
|
154
60
|
id: void 0
|
|
155
61
|
})), [
|
|
156
62
|
dispatch
|
|
157
63
|
]);
|
|
158
|
-
const handleNavigate =
|
|
64
|
+
const handleNavigate = useCallback(() => {
|
|
159
65
|
void dispatch(createIntent(LayoutAction.Open, {
|
|
160
66
|
part: "main",
|
|
161
67
|
subject: [
|
|
@@ -168,86 +74,62 @@ var AwaitingObject = ({ id }) => {
|
|
|
168
74
|
handleClose,
|
|
169
75
|
dispatch
|
|
170
76
|
]);
|
|
171
|
-
return /* @__PURE__ */
|
|
77
|
+
return /* @__PURE__ */ React.createElement(Toast.Root, {
|
|
172
78
|
open,
|
|
173
79
|
duration: TOAST_TIMEOUT,
|
|
174
80
|
onOpenChange: setOpen
|
|
175
|
-
}, /* @__PURE__ */
|
|
81
|
+
}, /* @__PURE__ */ React.createElement(Toast.Body, null, /* @__PURE__ */ React.createElement(Toast.Title, {
|
|
176
82
|
classNames: "flex items-center gap-2"
|
|
177
|
-
}, found ? /* @__PURE__ */
|
|
83
|
+
}, found ? /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(CheckCircle, {
|
|
178
84
|
className: getSize(5)
|
|
179
|
-
}), /* @__PURE__ */
|
|
85
|
+
}), /* @__PURE__ */ React.createElement("span", null, t("found object label"))) : waiting ? /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(CircleNotch, {
|
|
180
86
|
className: mx(getSize(5), "animate-spin")
|
|
181
|
-
}), /* @__PURE__ */
|
|
87
|
+
}), /* @__PURE__ */ React.createElement("span", null, t("waiting for object label"))) : /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(CircleDashed, {
|
|
182
88
|
className: getSize(5)
|
|
183
|
-
}), /* @__PURE__ */
|
|
89
|
+
}), /* @__PURE__ */ React.createElement("span", null, t("object not found label")))), /* @__PURE__ */ React.createElement(Toast.Description, null, t(found ? "found object description" : waiting ? "waiting for object description" : "object not found description"))), /* @__PURE__ */ React.createElement(Toast.Actions, null, found ? /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Toast.Action, {
|
|
184
90
|
altText: t("go to object alt"),
|
|
185
91
|
asChild: true
|
|
186
|
-
}, /* @__PURE__ */
|
|
92
|
+
}, /* @__PURE__ */ React.createElement(Button, {
|
|
187
93
|
variant: "primary",
|
|
188
94
|
onClick: handleNavigate
|
|
189
|
-
}, t("go to object label"))), /* @__PURE__ */
|
|
95
|
+
}, t("go to object label"))), /* @__PURE__ */ React.createElement(Toast.Close, {
|
|
190
96
|
asChild: true
|
|
191
|
-
}, /* @__PURE__ */
|
|
97
|
+
}, /* @__PURE__ */ React.createElement(Button, {
|
|
192
98
|
onClick: handleClose
|
|
193
99
|
}, t("close label", {
|
|
194
100
|
ns: "appkit"
|
|
195
|
-
})))) : /* @__PURE__ */
|
|
101
|
+
})))) : /* @__PURE__ */ React.createElement(Toast.Close, {
|
|
196
102
|
asChild: true
|
|
197
|
-
}, /* @__PURE__ */
|
|
103
|
+
}, /* @__PURE__ */ React.createElement(Button, {
|
|
198
104
|
onClick: handleClose
|
|
199
105
|
}, t(waiting ? "close label" : "confirm label", {
|
|
200
106
|
ns: "appkit"
|
|
201
107
|
})))));
|
|
202
108
|
};
|
|
203
109
|
|
|
204
|
-
// packages/plugins/plugin-space/src/components/BaseObjectSettings.tsx
|
|
205
|
-
import React4 from "react";
|
|
206
|
-
import { Input, useTranslation as useTranslation4 } from "@dxos/react-ui";
|
|
207
|
-
var BaseObjectSettings = ({ object }) => {
|
|
208
|
-
const { t } = useTranslation4(SPACE_PLUGIN);
|
|
209
|
-
const inputRef = React4.useRef(null);
|
|
210
|
-
return /* @__PURE__ */ React4.createElement("div", {
|
|
211
|
-
role: "form",
|
|
212
|
-
className: "flex flex-col w-full p-2 gap-1"
|
|
213
|
-
}, /* @__PURE__ */ React4.createElement(Input.Root, null, /* @__PURE__ */ React4.createElement(Input.Label, null, t("name label")), /* @__PURE__ */ React4.createElement(Input.TextInput, {
|
|
214
|
-
ref: inputRef,
|
|
215
|
-
placeholder: t("name placeholder"),
|
|
216
|
-
value: object.name ?? "",
|
|
217
|
-
onChange: (event) => {
|
|
218
|
-
object.name = event.target.value;
|
|
219
|
-
},
|
|
220
|
-
onKeyDown: (event) => {
|
|
221
|
-
if (event.key === "Enter") {
|
|
222
|
-
inputRef.current?.blur();
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
})));
|
|
226
|
-
};
|
|
227
|
-
|
|
228
110
|
// packages/plugins/plugin-space/src/components/CreateDialog/CreateObjectDialog.tsx
|
|
229
111
|
import { pipe } from "effect";
|
|
230
|
-
import
|
|
112
|
+
import React3, { useCallback as useCallback3, useRef } from "react";
|
|
231
113
|
import { Capabilities, chain, createIntent as createIntent2, LayoutAction as LayoutAction2, useCapabilities, useIntentDispatcher as useIntentDispatcher2, usePluginManager as usePluginManager2 } from "@dxos/app-framework";
|
|
232
114
|
import { invariant as invariant2 } from "@dxos/invariant";
|
|
233
115
|
import { useClient as useClient2 } from "@dxos/react-client";
|
|
234
116
|
import { getSpace, isReactiveObject, isSpace, useSpaces } from "@dxos/react-client/echo";
|
|
235
|
-
import { Button as Button2, Dialog, Icon as Icon2, useTranslation as
|
|
117
|
+
import { Button as Button2, Dialog, Icon as Icon2, useTranslation as useTranslation3 } from "@dxos/react-ui";
|
|
236
118
|
|
|
237
119
|
// packages/plugins/plugin-space/src/components/CreateDialog/CreateObjectPanel.tsx
|
|
238
|
-
import
|
|
120
|
+
import React2, { useCallback as useCallback2, useState as useState2 } from "react";
|
|
239
121
|
import { Surface, isSurfaceAvailable, usePluginManager } from "@dxos/app-framework";
|
|
240
|
-
import {
|
|
122
|
+
import { getTypeAnnotation } from "@dxos/echo-schema";
|
|
241
123
|
import { invariant } from "@dxos/invariant";
|
|
242
|
-
import { Icon, toLocalizedString, useTranslation as
|
|
243
|
-
import { Form
|
|
124
|
+
import { Icon, toLocalizedString, useTranslation as useTranslation2 } from "@dxos/react-ui";
|
|
125
|
+
import { Form } from "@dxos/react-ui-form";
|
|
244
126
|
import { SearchList } from "@dxos/react-ui-searchlist";
|
|
245
127
|
import { mx as mx2 } from "@dxos/react-ui-theme";
|
|
246
128
|
import { isNonNullable } from "@dxos/util";
|
|
247
129
|
var __dxlog_file = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/CreateDialog/CreateObjectPanel.tsx";
|
|
248
130
|
var useInputSurfaceLookup = (baseData) => {
|
|
249
131
|
const pluginManager = usePluginManager();
|
|
250
|
-
return
|
|
132
|
+
return useCallback2(({ prop, schema, inputProps }) => {
|
|
251
133
|
const composedData = {
|
|
252
134
|
prop,
|
|
253
135
|
schema,
|
|
@@ -259,7 +141,7 @@ var useInputSurfaceLookup = (baseData) => {
|
|
|
259
141
|
})) {
|
|
260
142
|
return void 0;
|
|
261
143
|
}
|
|
262
|
-
return /* @__PURE__ */
|
|
144
|
+
return /* @__PURE__ */ React2.createElement(Surface, {
|
|
263
145
|
role: "form-input",
|
|
264
146
|
data: composedData,
|
|
265
147
|
...inputProps
|
|
@@ -270,11 +152,11 @@ var useInputSurfaceLookup = (baseData) => {
|
|
|
270
152
|
]);
|
|
271
153
|
};
|
|
272
154
|
var CreateObjectPanel = ({ classNames, forms, spaces, typename: initialTypename, target: initialTarget, name: initialName, defaultSpaceId, resolve, onCreateObject }) => {
|
|
273
|
-
const { t } =
|
|
274
|
-
const [typename, setTypename] =
|
|
275
|
-
const [target, setTarget] =
|
|
276
|
-
const form = forms.find((form2) =>
|
|
277
|
-
const options = forms.map((form2) =>
|
|
155
|
+
const { t } = useTranslation2(SPACE_PLUGIN);
|
|
156
|
+
const [typename, setTypename] = useState2(initialTypename);
|
|
157
|
+
const [target, setTarget] = useState2(initialTarget);
|
|
158
|
+
const form = forms.find((form2) => getTypeAnnotation(form2.objectSchema)?.typename === typename);
|
|
159
|
+
const options = forms.map((form2) => getTypeAnnotation(form2.objectSchema)).filter(isNonNullable).sort((a, b) => {
|
|
278
160
|
const nameA = t("typename label", {
|
|
279
161
|
ns: a.typename,
|
|
280
162
|
defaultValue: a.typename
|
|
@@ -285,7 +167,7 @@ var CreateObjectPanel = ({ classNames, forms, spaces, typename: initialTypename,
|
|
|
285
167
|
});
|
|
286
168
|
return nameA.localeCompare(nameB);
|
|
287
169
|
});
|
|
288
|
-
const handleCreateObject =
|
|
170
|
+
const handleCreateObject = useCallback2(async (props) => {
|
|
289
171
|
if (!form || !target) {
|
|
290
172
|
return;
|
|
291
173
|
}
|
|
@@ -299,7 +181,7 @@ var CreateObjectPanel = ({ classNames, forms, spaces, typename: initialTypename,
|
|
|
299
181
|
form,
|
|
300
182
|
target
|
|
301
183
|
]);
|
|
302
|
-
const handleSetTypename =
|
|
184
|
+
const handleSetTypename = useCallback2(async (typename2) => {
|
|
303
185
|
invariant(target, "target is required", {
|
|
304
186
|
F: __dxlog_file,
|
|
305
187
|
L: 94,
|
|
@@ -309,7 +191,7 @@ var CreateObjectPanel = ({ classNames, forms, spaces, typename: initialTypename,
|
|
|
309
191
|
"'target is required'"
|
|
310
192
|
]
|
|
311
193
|
});
|
|
312
|
-
const form2 = forms.find((form3) =>
|
|
194
|
+
const form2 = forms.find((form3) => getTypeAnnotation(form3.objectSchema)?.typename === typename2);
|
|
313
195
|
if (form2 && !form2.formSchema) {
|
|
314
196
|
await onCreateObject?.({
|
|
315
197
|
form: form2,
|
|
@@ -326,18 +208,18 @@ var CreateObjectPanel = ({ classNames, forms, spaces, typename: initialTypename,
|
|
|
326
208
|
const inputSurfaceLookup = useInputSurfaceLookup({
|
|
327
209
|
target
|
|
328
210
|
});
|
|
329
|
-
return /* @__PURE__ */
|
|
211
|
+
return /* @__PURE__ */ React2.createElement("div", {
|
|
330
212
|
role: "form",
|
|
331
213
|
className: mx2("flex flex-col gap-2", classNames)
|
|
332
|
-
}, !form ? /* @__PURE__ */
|
|
214
|
+
}, !form ? /* @__PURE__ */ React2.createElement(SelectSchema, {
|
|
333
215
|
options,
|
|
334
216
|
resolve,
|
|
335
217
|
onChange: handleSetTypename
|
|
336
|
-
}) : !target ? /* @__PURE__ */
|
|
218
|
+
}) : !target ? /* @__PURE__ */ React2.createElement(SelectSpace, {
|
|
337
219
|
spaces,
|
|
338
220
|
defaultSpaceId,
|
|
339
221
|
onChange: setTarget
|
|
340
|
-
}) : form.formSchema ? /* @__PURE__ */
|
|
222
|
+
}) : form.formSchema ? /* @__PURE__ */ React2.createElement(Form, {
|
|
341
223
|
classNames: "!p-0",
|
|
342
224
|
autoFocus: true,
|
|
343
225
|
values: {
|
|
@@ -350,16 +232,16 @@ var CreateObjectPanel = ({ classNames, forms, spaces, typename: initialTypename,
|
|
|
350
232
|
}) : void 0);
|
|
351
233
|
};
|
|
352
234
|
var SelectSpace = ({ spaces, defaultSpaceId, onChange }) => {
|
|
353
|
-
const { t } =
|
|
354
|
-
return /* @__PURE__ */
|
|
235
|
+
const { t } = useTranslation2(SPACE_PLUGIN);
|
|
236
|
+
return /* @__PURE__ */ React2.createElement(SearchList.Root, {
|
|
355
237
|
label: t("space input label"),
|
|
356
238
|
classNames: "flex flex-col grow overflow-hidden"
|
|
357
|
-
}, /* @__PURE__ */
|
|
239
|
+
}, /* @__PURE__ */ React2.createElement(SearchList.Input, {
|
|
358
240
|
autoFocus: true,
|
|
359
241
|
"data-testid": "create-object-form.space-input",
|
|
360
242
|
placeholder: t("space input placeholder"),
|
|
361
243
|
classNames: "px-1 my-2"
|
|
362
|
-
}), /* @__PURE__ */
|
|
244
|
+
}), /* @__PURE__ */ React2.createElement(SearchList.Content, {
|
|
363
245
|
classNames: "max-bs-[24rem] overflow-auto"
|
|
364
246
|
}, spaces.sort((a, b) => {
|
|
365
247
|
const aName = toLocalizedString(getSpaceDisplayName(a, {
|
|
@@ -369,32 +251,32 @@ var SelectSpace = ({ spaces, defaultSpaceId, onChange }) => {
|
|
|
369
251
|
personal: b.id === defaultSpaceId
|
|
370
252
|
}), t);
|
|
371
253
|
return aName.localeCompare(bName);
|
|
372
|
-
}).map((space) => /* @__PURE__ */
|
|
254
|
+
}).map((space) => /* @__PURE__ */ React2.createElement(SearchList.Item, {
|
|
373
255
|
key: space.id,
|
|
374
256
|
value: toLocalizedString(getSpaceDisplayName(space, {
|
|
375
257
|
personal: space.id === defaultSpaceId
|
|
376
258
|
}), t),
|
|
377
259
|
onSelect: () => onChange(space),
|
|
378
260
|
classNames: "flex items-center gap-2"
|
|
379
|
-
}, /* @__PURE__ */
|
|
261
|
+
}, /* @__PURE__ */ React2.createElement("span", {
|
|
380
262
|
className: "grow truncate"
|
|
381
263
|
}, toLocalizedString(getSpaceDisplayName(space, {
|
|
382
264
|
personal: space.id === defaultSpaceId
|
|
383
265
|
}), t))))));
|
|
384
266
|
};
|
|
385
267
|
var SelectSchema = ({ options, resolve, onChange }) => {
|
|
386
|
-
const { t } =
|
|
387
|
-
return /* @__PURE__ */
|
|
268
|
+
const { t } = useTranslation2(SPACE_PLUGIN);
|
|
269
|
+
return /* @__PURE__ */ React2.createElement(SearchList.Root, {
|
|
388
270
|
label: t("schema input label"),
|
|
389
271
|
classNames: "flex flex-col grow overflow-hidden"
|
|
390
|
-
}, /* @__PURE__ */
|
|
272
|
+
}, /* @__PURE__ */ React2.createElement(SearchList.Input, {
|
|
391
273
|
autoFocus: true,
|
|
392
274
|
"data-testid": "create-object-form.schema-input",
|
|
393
275
|
placeholder: t("schema input placeholder"),
|
|
394
276
|
classNames: "px-1 my-2"
|
|
395
|
-
}), /* @__PURE__ */
|
|
277
|
+
}), /* @__PURE__ */ React2.createElement(SearchList.Content, {
|
|
396
278
|
classNames: "max-bs-[24rem] overflow-auto"
|
|
397
|
-
}, options.map((option) => /* @__PURE__ */
|
|
279
|
+
}, options.map((option) => /* @__PURE__ */ React2.createElement(SearchList.Item, {
|
|
398
280
|
key: option.typename,
|
|
399
281
|
value: t("typename label", {
|
|
400
282
|
ns: option.typename,
|
|
@@ -402,9 +284,9 @@ var SelectSchema = ({ options, resolve, onChange }) => {
|
|
|
402
284
|
}),
|
|
403
285
|
onSelect: () => onChange(option.typename),
|
|
404
286
|
classNames: "flex items-center gap-2"
|
|
405
|
-
}, /* @__PURE__ */
|
|
287
|
+
}, /* @__PURE__ */ React2.createElement("span", {
|
|
406
288
|
className: "flex gap-2 items-center grow truncate"
|
|
407
|
-
}, /* @__PURE__ */
|
|
289
|
+
}, /* @__PURE__ */ React2.createElement(Icon, {
|
|
408
290
|
icon: resolve?.(option.typename).icon ?? "ph--placeholder--regular",
|
|
409
291
|
size: 5
|
|
410
292
|
}), t("typename label", {
|
|
@@ -415,16 +297,17 @@ var SelectSchema = ({ options, resolve, onChange }) => {
|
|
|
415
297
|
|
|
416
298
|
// packages/plugins/plugin-space/src/capabilities/index.ts
|
|
417
299
|
import { lazy } from "@dxos/app-framework";
|
|
418
|
-
var AppGraphBuilder = lazy(() => import("./app-graph-builder-
|
|
419
|
-
var AppGraphSerializer = lazy(() => import("./app-graph-serializer-
|
|
420
|
-
var IdentityCreated = lazy(() => import("./identity-created-
|
|
421
|
-
var IntentResolver = lazy(() => import("./intent-resolver-
|
|
422
|
-
var ReactRoot = lazy(() => import("./react-root-
|
|
423
|
-
var ReactSurface = lazy(() => import("./react-surface-
|
|
424
|
-
var Schema = lazy(() => import("./schema-
|
|
425
|
-
var
|
|
426
|
-
var
|
|
427
|
-
var
|
|
300
|
+
var AppGraphBuilder = lazy(() => import("./app-graph-builder-GMFCSOLG.mjs"));
|
|
301
|
+
var AppGraphSerializer = lazy(() => import("./app-graph-serializer-DSF2U3A5.mjs"));
|
|
302
|
+
var IdentityCreated = lazy(() => import("./identity-created-JR7BNXFH.mjs"));
|
|
303
|
+
var IntentResolver = lazy(() => import("./intent-resolver-OG62I5IL.mjs"));
|
|
304
|
+
var ReactRoot = lazy(() => import("./react-root-VPSIJ6EU.mjs"));
|
|
305
|
+
var ReactSurface = lazy(() => import("./react-surface-KOSYP574.mjs"));
|
|
306
|
+
var Schema = lazy(() => import("./schema-FHTA26SW.mjs"));
|
|
307
|
+
var Tools = lazy(() => import("./schema-tools-YAXPRIXP.mjs"));
|
|
308
|
+
var SpaceSettings = lazy(() => import("./settings-PJPTJUPE.mjs"));
|
|
309
|
+
var SpaceState = lazy(() => import("./state-X7VLCC6E.mjs"));
|
|
310
|
+
var SpacesReady = lazy(() => import("./spaces-ready-BSSP7HHG.mjs"));
|
|
428
311
|
|
|
429
312
|
// packages/plugins/plugin-space/src/components/CreateDialog/CreateObjectDialog.tsx
|
|
430
313
|
var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/CreateDialog/CreateObjectDialog.tsx";
|
|
@@ -432,16 +315,15 @@ var CREATE_OBJECT_DIALOG = `${SPACE_PLUGIN}/CreateObjectDialog`;
|
|
|
432
315
|
var CreateObjectDialog = ({ target, typename, name, shouldNavigate: _shouldNavigate }) => {
|
|
433
316
|
const closeRef = useRef(null);
|
|
434
317
|
const manager = usePluginManager2();
|
|
435
|
-
const { t } =
|
|
318
|
+
const { t } = useTranslation3(SPACE_PLUGIN);
|
|
436
319
|
const client = useClient2();
|
|
437
320
|
const spaces = useSpaces();
|
|
438
321
|
const { dispatchPromise: dispatch } = useIntentDispatcher2();
|
|
439
322
|
const forms = useCapabilities(SpaceCapabilities.ObjectForm);
|
|
440
|
-
const resolve =
|
|
323
|
+
const resolve = useCallback3((typename2) => manager.context.requestCapabilities(Capabilities.Metadata).find(({ id }) => id === typename2)?.metadata ?? {}, [
|
|
441
324
|
manager
|
|
442
325
|
]);
|
|
443
|
-
const handleCreateObject =
|
|
444
|
-
const target2 = isSpace(_target) ? _target.properties[CollectionType.typename]?.target : _target;
|
|
326
|
+
const handleCreateObject = useCallback3(async ({ form, target: target2, data = {} }) => {
|
|
445
327
|
if (!target2) {
|
|
446
328
|
return;
|
|
447
329
|
}
|
|
@@ -449,7 +331,7 @@ var CreateObjectDialog = ({ target, typename, name, shouldNavigate: _shouldNavig
|
|
|
449
331
|
const space = isSpace(target2) ? target2 : getSpace(target2);
|
|
450
332
|
invariant2(space, "Missing space", {
|
|
451
333
|
F: __dxlog_file2,
|
|
452
|
-
L:
|
|
334
|
+
L: 72,
|
|
453
335
|
S: void 0,
|
|
454
336
|
A: [
|
|
455
337
|
"space",
|
|
@@ -463,7 +345,8 @@ var CreateObjectDialog = ({ target, typename, name, shouldNavigate: _shouldNavig
|
|
|
463
345
|
if (isReactiveObject(object)) {
|
|
464
346
|
const addObjectIntent = createIntent2(SpaceAction.AddObject, {
|
|
465
347
|
target: target2,
|
|
466
|
-
object
|
|
348
|
+
object,
|
|
349
|
+
hidden: form.hidden
|
|
467
350
|
});
|
|
468
351
|
const shouldNavigate = _shouldNavigate ?? (() => true);
|
|
469
352
|
if (shouldNavigate(object)) {
|
|
@@ -481,22 +364,22 @@ var CreateObjectDialog = ({ target, typename, name, shouldNavigate: _shouldNavig
|
|
|
481
364
|
return (
|
|
482
365
|
// TODO(wittjosiah): The tablist dialog pattern is copied from @dxos/plugin-manager.
|
|
483
366
|
// Consider factoring it out to the tabs package.
|
|
484
|
-
/* @__PURE__ */
|
|
367
|
+
/* @__PURE__ */ React3.createElement(Dialog.Content, {
|
|
485
368
|
classNames: "p-0 bs-content max-bs-full md:max-is-[40rem] overflow-hidden"
|
|
486
|
-
}, /* @__PURE__ */
|
|
369
|
+
}, /* @__PURE__ */ React3.createElement("div", {
|
|
487
370
|
role: "none",
|
|
488
371
|
className: "flex justify-between pbs-2 pis-2 pie-2 @md:pbs-4 @md:pis-4 @md:pie-4"
|
|
489
|
-
}, /* @__PURE__ */
|
|
372
|
+
}, /* @__PURE__ */ React3.createElement(Dialog.Title, null, t("create object dialog title")), /* @__PURE__ */ React3.createElement(Dialog.Close, {
|
|
490
373
|
asChild: true
|
|
491
|
-
}, /* @__PURE__ */
|
|
374
|
+
}, /* @__PURE__ */ React3.createElement(Button2, {
|
|
492
375
|
ref: closeRef,
|
|
493
376
|
density: "fine",
|
|
494
377
|
variant: "ghost",
|
|
495
378
|
autoFocus: true
|
|
496
|
-
}, /* @__PURE__ */
|
|
379
|
+
}, /* @__PURE__ */ React3.createElement(Icon2, {
|
|
497
380
|
icon: "ph--x--regular",
|
|
498
381
|
size: 4
|
|
499
|
-
})))), /* @__PURE__ */
|
|
382
|
+
})))), /* @__PURE__ */ React3.createElement(CreateObjectPanel, {
|
|
500
383
|
classNames: "p-4",
|
|
501
384
|
forms,
|
|
502
385
|
spaces,
|
|
@@ -512,19 +395,19 @@ var CreateObjectDialog = ({ target, typename, name, shouldNavigate: _shouldNavig
|
|
|
512
395
|
|
|
513
396
|
// packages/plugins/plugin-space/src/components/CreateDialog/CreateSpaceDialog.tsx
|
|
514
397
|
import { Effect } from "effect";
|
|
515
|
-
import
|
|
398
|
+
import React4, { useCallback as useCallback4, useRef as useRef2 } from "react";
|
|
516
399
|
import { createIntent as createIntent3, LayoutAction as LayoutAction3, useIntentDispatcher as useIntentDispatcher3 } from "@dxos/app-framework";
|
|
517
|
-
import { Button as Button3, Dialog as Dialog2, Icon as Icon3, useTranslation as
|
|
518
|
-
import { Form as
|
|
400
|
+
import { Button as Button3, Dialog as Dialog2, Icon as Icon3, useTranslation as useTranslation4 } from "@dxos/react-ui";
|
|
401
|
+
import { Form as Form2 } from "@dxos/react-ui-form";
|
|
519
402
|
var CREATE_SPACE_DIALOG = `${SPACE_PLUGIN}/CreateSpaceDialog`;
|
|
520
|
-
var
|
|
403
|
+
var initialValues = {
|
|
521
404
|
edgeReplication: true
|
|
522
405
|
};
|
|
523
406
|
var CreateSpaceDialog = () => {
|
|
524
407
|
const closeRef = useRef2(null);
|
|
525
|
-
const { t } =
|
|
408
|
+
const { t } = useTranslation4(SPACE_PLUGIN);
|
|
526
409
|
const { dispatch } = useIntentDispatcher3();
|
|
527
|
-
const handleCreateSpace =
|
|
410
|
+
const handleCreateSpace = useCallback4(async (data) => {
|
|
528
411
|
const program = Effect.gen(function* () {
|
|
529
412
|
const { space } = yield* dispatch(createIntent3(SpaceAction.Create, data));
|
|
530
413
|
yield* dispatch(createIntent3(LayoutAction3.SwitchWorkspace, {
|
|
@@ -542,28 +425,28 @@ var CreateSpaceDialog = () => {
|
|
|
542
425
|
return (
|
|
543
426
|
// TODO(wittjosiah): The tablist dialog pattern is copied from @dxos/plugin-manager.
|
|
544
427
|
// Consider factoring it out to the tabs package.
|
|
545
|
-
/* @__PURE__ */
|
|
428
|
+
/* @__PURE__ */ React4.createElement(Dialog2.Content, {
|
|
546
429
|
classNames: "p-0 bs-content min-bs-[16rem] max-bs-full md:max-is-[32rem] overflow-hidden"
|
|
547
|
-
}, /* @__PURE__ */
|
|
430
|
+
}, /* @__PURE__ */ React4.createElement("div", {
|
|
548
431
|
role: "none",
|
|
549
432
|
className: "flex justify-between pbs-2 pis-2 pie-2 @md:pbs-4 @md:pis-4 @md:pie-4"
|
|
550
|
-
}, /* @__PURE__ */
|
|
433
|
+
}, /* @__PURE__ */ React4.createElement(Dialog2.Title, null, t("create space dialog title")), /* @__PURE__ */ React4.createElement(Dialog2.Close, {
|
|
551
434
|
asChild: true
|
|
552
|
-
}, /* @__PURE__ */
|
|
435
|
+
}, /* @__PURE__ */ React4.createElement(Button3, {
|
|
553
436
|
ref: closeRef,
|
|
554
437
|
density: "fine",
|
|
555
438
|
variant: "ghost",
|
|
556
439
|
autoFocus: true
|
|
557
|
-
}, /* @__PURE__ */
|
|
440
|
+
}, /* @__PURE__ */ React4.createElement(Icon3, {
|
|
558
441
|
icon: "ph--x--regular",
|
|
559
442
|
size: 4
|
|
560
|
-
})))), /* @__PURE__ */
|
|
443
|
+
})))), /* @__PURE__ */ React4.createElement("div", {
|
|
561
444
|
className: "p-4"
|
|
562
|
-
}, /* @__PURE__ */
|
|
445
|
+
}, /* @__PURE__ */ React4.createElement(Form2, {
|
|
563
446
|
testId: "create-space-form",
|
|
564
447
|
classNames: "!p-0",
|
|
565
448
|
autoFocus: true,
|
|
566
|
-
values:
|
|
449
|
+
values: initialValues,
|
|
567
450
|
schema: SpaceForm,
|
|
568
451
|
onSave: handleCreateSpace
|
|
569
452
|
})))
|
|
@@ -571,87 +454,89 @@ var CreateSpaceDialog = () => {
|
|
|
571
454
|
};
|
|
572
455
|
|
|
573
456
|
// packages/plugins/plugin-space/src/components/CollectionMain.tsx
|
|
574
|
-
import
|
|
575
|
-
import { useTranslation as
|
|
457
|
+
import React5 from "react";
|
|
458
|
+
import { useTranslation as useTranslation5 } from "@dxos/react-ui";
|
|
576
459
|
import { baseSurface, descriptionText, mx as mx3 } from "@dxos/react-ui-theme";
|
|
577
460
|
var CollectionMain = ({ collection }) => {
|
|
578
|
-
const { t } =
|
|
579
|
-
return /* @__PURE__ */
|
|
461
|
+
const { t } = useTranslation5(SPACE_PLUGIN);
|
|
462
|
+
return /* @__PURE__ */ React5.createElement("div", {
|
|
580
463
|
role: "none",
|
|
581
464
|
className: mx3(baseSurface, "min-bs-screen is-full flex items-center justify-center p-8"),
|
|
582
465
|
"data-testid": "composer.firstRunMessage"
|
|
583
|
-
}, /* @__PURE__ */
|
|
466
|
+
}, /* @__PURE__ */ React5.createElement("p", {
|
|
584
467
|
role: "alert",
|
|
585
468
|
className: mx3(descriptionText, "border border-dashed border-neutral-400/50 rounded-lg p-8 font-normal text-lg max-is-[24rem] break-words")
|
|
586
469
|
}, collection.name ?? t("unnamed collection label")));
|
|
587
470
|
};
|
|
588
471
|
|
|
589
472
|
// packages/plugins/plugin-space/src/components/CollectionSection.tsx
|
|
590
|
-
import
|
|
591
|
-
import { useTranslation as
|
|
473
|
+
import React6 from "react";
|
|
474
|
+
import { useTranslation as useTranslation6 } from "@dxos/react-ui";
|
|
592
475
|
var CollectionSection = ({ collection }) => {
|
|
593
|
-
const { t } =
|
|
594
|
-
return /* @__PURE__ */
|
|
476
|
+
const { t } = useTranslation6(SPACE_PLUGIN);
|
|
477
|
+
return /* @__PURE__ */ React6.createElement("div", {
|
|
595
478
|
className: "min-bs-[3.5rem] grid grid-rows-subgrid grid-cols-subgrid items-center"
|
|
596
|
-
}, /* @__PURE__ */
|
|
479
|
+
}, /* @__PURE__ */ React6.createElement("span", {
|
|
597
480
|
className: "truncate"
|
|
598
481
|
}, collection.name ?? t("unnamed collection label")));
|
|
599
482
|
};
|
|
600
483
|
|
|
601
484
|
// packages/plugins/plugin-space/src/components/JoinDialog.tsx
|
|
602
|
-
import
|
|
485
|
+
import React7, { useCallback as useCallback5 } from "react";
|
|
603
486
|
import { createIntent as createIntent4, LayoutAction as LayoutAction4, useAppGraph, useIntentDispatcher as useIntentDispatcher4 } from "@dxos/app-framework";
|
|
604
|
-
import {
|
|
487
|
+
import { Trigger } from "@dxos/async";
|
|
605
488
|
import { ObservabilityAction } from "@dxos/plugin-observability/types";
|
|
606
489
|
import { useClient as useClient3 } from "@dxos/react-client";
|
|
607
|
-
import { Dialog as Dialog3, useTranslation as
|
|
490
|
+
import { Dialog as Dialog3, useTranslation as useTranslation7 } from "@dxos/react-ui";
|
|
608
491
|
import { JoinPanel } from "@dxos/shell/react";
|
|
609
|
-
var __dxlog_file3 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/JoinDialog.tsx";
|
|
610
492
|
var JOIN_DIALOG = `${SPACE_PLUGIN}/JoinDialog`;
|
|
611
493
|
var JoinDialog = ({ navigableCollections, onDone, ...props }) => {
|
|
612
494
|
const { dispatchPromise: dispatch } = useIntentDispatcher4();
|
|
613
495
|
const client = useClient3();
|
|
614
496
|
const { graph } = useAppGraph();
|
|
615
|
-
const { t } =
|
|
616
|
-
const handleDone =
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
part: "toast",
|
|
621
|
-
subject: {
|
|
622
|
-
id: `${SPACE_PLUGIN}/join-success`,
|
|
623
|
-
duration: 5e3,
|
|
624
|
-
title: [
|
|
625
|
-
"join success label",
|
|
626
|
-
{
|
|
627
|
-
ns: SPACE_PLUGIN
|
|
628
|
-
}
|
|
629
|
-
],
|
|
630
|
-
closeLabel: [
|
|
631
|
-
"dismiss label",
|
|
632
|
-
{
|
|
633
|
-
ns: SPACE_PLUGIN
|
|
634
|
-
}
|
|
635
|
-
]
|
|
636
|
-
}
|
|
637
|
-
})),
|
|
638
|
-
dispatch(createIntent4(LayoutAction4.UpdateDialog, {
|
|
639
|
-
part: "dialog",
|
|
640
|
-
options: {
|
|
641
|
-
state: false
|
|
642
|
-
}
|
|
643
|
-
}))
|
|
644
|
-
]);
|
|
497
|
+
const { t } = useTranslation7(SPACE_PLUGIN);
|
|
498
|
+
const handleDone = useCallback5(async (result) => {
|
|
499
|
+
const spaceKey = result?.spaceKey;
|
|
500
|
+
if (!spaceKey) {
|
|
501
|
+
return;
|
|
645
502
|
}
|
|
646
|
-
|
|
503
|
+
await Promise.all([
|
|
504
|
+
dispatch(createIntent4(LayoutAction4.AddToast, {
|
|
505
|
+
part: "toast",
|
|
506
|
+
subject: {
|
|
507
|
+
id: `${SPACE_PLUGIN}/join-success`,
|
|
508
|
+
duration: 5e3,
|
|
509
|
+
title: [
|
|
510
|
+
"join success label",
|
|
511
|
+
{
|
|
512
|
+
ns: SPACE_PLUGIN
|
|
513
|
+
}
|
|
514
|
+
],
|
|
515
|
+
closeLabel: [
|
|
516
|
+
"dismiss label",
|
|
517
|
+
{
|
|
518
|
+
ns: SPACE_PLUGIN
|
|
519
|
+
}
|
|
520
|
+
]
|
|
521
|
+
}
|
|
522
|
+
})),
|
|
523
|
+
dispatch(createIntent4(LayoutAction4.UpdateDialog, {
|
|
524
|
+
part: "dialog",
|
|
525
|
+
options: {
|
|
526
|
+
state: false
|
|
527
|
+
}
|
|
528
|
+
}))
|
|
529
|
+
]);
|
|
530
|
+
let space = client.spaces.get(spaceKey);
|
|
647
531
|
if (!space) {
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
532
|
+
const trigger = new Trigger();
|
|
533
|
+
client.spaces.subscribe(() => {
|
|
534
|
+
const space2 = client.spaces.get(spaceKey);
|
|
535
|
+
if (space2) {
|
|
536
|
+
trigger.wake(space2);
|
|
537
|
+
}
|
|
653
538
|
});
|
|
654
|
-
|
|
539
|
+
space = await trigger.wait();
|
|
655
540
|
}
|
|
656
541
|
await dispatch(createIntent4(LayoutAction4.SwitchWorkspace, {
|
|
657
542
|
part: "workspace",
|
|
@@ -690,52 +575,422 @@ var JoinDialog = ({ navigableCollections, onDone, ...props }) => {
|
|
|
690
575
|
client,
|
|
691
576
|
graph
|
|
692
577
|
]);
|
|
693
|
-
return /* @__PURE__ */
|
|
578
|
+
return /* @__PURE__ */ React7.createElement(Dialog3.Content, null, /* @__PURE__ */ React7.createElement(Dialog3.Title, {
|
|
694
579
|
classNames: "sr-only"
|
|
695
580
|
}, t("join space label", {
|
|
696
581
|
ns: "os"
|
|
697
|
-
})), /* @__PURE__ */
|
|
582
|
+
})), /* @__PURE__ */ React7.createElement(JoinPanel, {
|
|
698
583
|
...props,
|
|
699
|
-
exitActionParent: /* @__PURE__ */
|
|
584
|
+
exitActionParent: /* @__PURE__ */ React7.createElement(Dialog3.Close, {
|
|
700
585
|
asChild: true
|
|
701
586
|
}),
|
|
702
|
-
doneActionParent: /* @__PURE__ */
|
|
587
|
+
doneActionParent: /* @__PURE__ */ React7.createElement(Dialog3.Close, {
|
|
703
588
|
asChild: true
|
|
704
589
|
}),
|
|
705
590
|
onDone: handleDone
|
|
706
591
|
}));
|
|
707
592
|
};
|
|
708
593
|
|
|
594
|
+
// packages/plugins/plugin-space/src/components/MembersContainer.tsx
|
|
595
|
+
import { Check, X } from "@phosphor-icons/react";
|
|
596
|
+
import React8, { useMemo, useState as useState3 } from "react";
|
|
597
|
+
import { QR } from "react-qr-rounded";
|
|
598
|
+
import { log } from "@dxos/log";
|
|
599
|
+
import { useConfig } from "@dxos/react-client";
|
|
600
|
+
import { fullyQualifiedId as fullyQualifiedId2, useSpaceInvitations } from "@dxos/react-client/echo";
|
|
601
|
+
import { Invitation, InvitationEncoder } from "@dxos/react-client/invitations";
|
|
602
|
+
import { Button as Button4, Clipboard, Icon as Icon4, useId, useTranslation as useTranslation8 } from "@dxos/react-ui";
|
|
603
|
+
import { ControlSection, ControlFrame, ControlFrameItem } from "@dxos/react-ui-form";
|
|
604
|
+
import { StackItem } from "@dxos/react-ui-stack";
|
|
605
|
+
import { getSize as getSize2, mx as mx4 } from "@dxos/react-ui-theme";
|
|
606
|
+
import { AuthCode, BifurcatedAction, Centered, Emoji, InvitationList, SpaceMemberList, Viewport } from "@dxos/shell/react";
|
|
607
|
+
import { hexToEmoji } from "@dxos/util";
|
|
608
|
+
var __dxlog_file3 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/MembersContainer.tsx";
|
|
609
|
+
var activeActionKey = "dxos:react-shell/space-manager/active-action";
|
|
610
|
+
var handleInvitationEvent = (invitation, subscription) => {
|
|
611
|
+
const invitationCode = InvitationEncoder.encode(invitation);
|
|
612
|
+
if (invitation.state === Invitation.State.CONNECTING) {
|
|
613
|
+
log.info(JSON.stringify({
|
|
614
|
+
invitationCode,
|
|
615
|
+
authCode: invitation.authCode
|
|
616
|
+
}), void 0, {
|
|
617
|
+
F: __dxlog_file3,
|
|
618
|
+
L: 38,
|
|
619
|
+
S: void 0,
|
|
620
|
+
C: (f, a) => f(...a)
|
|
621
|
+
});
|
|
622
|
+
subscription.unsubscribe();
|
|
623
|
+
}
|
|
624
|
+
};
|
|
625
|
+
var MembersContainer = ({ space, createInvitationUrl }) => {
|
|
626
|
+
const { t } = useTranslation8("os");
|
|
627
|
+
const config = useConfig();
|
|
628
|
+
const invitations = useSpaceInvitations(space.key);
|
|
629
|
+
const visibleInvitations = invitations?.filter((invitation) => ![
|
|
630
|
+
Invitation.State.CANCELLED
|
|
631
|
+
].includes(invitation.get().state));
|
|
632
|
+
const [activeAction, setInternalActiveAction] = useState3(localStorage.getItem(activeActionKey) ?? "inviteMany");
|
|
633
|
+
const setActiveAction = (nextAction) => {
|
|
634
|
+
setInternalActiveAction(nextAction);
|
|
635
|
+
localStorage.setItem(activeActionKey, nextAction);
|
|
636
|
+
};
|
|
637
|
+
const target = space.properties[CollectionType.typename]?.target?.objects[0]?.target;
|
|
638
|
+
const inviteActions = useMemo(() => ({
|
|
639
|
+
inviteOne: {
|
|
640
|
+
label: t("invite one label"),
|
|
641
|
+
description: t("invite one description"),
|
|
642
|
+
icon: () => /* @__PURE__ */ React8.createElement(Icon4, {
|
|
643
|
+
icon: "ph--user-plus--regular",
|
|
644
|
+
size: 5
|
|
645
|
+
}),
|
|
646
|
+
testId: "membersContainer.inviteOne",
|
|
647
|
+
onClick: () => {
|
|
648
|
+
const invitation = space.share?.({
|
|
649
|
+
type: Invitation.Type.INTERACTIVE,
|
|
650
|
+
authMethod: Invitation.AuthMethod.SHARED_SECRET,
|
|
651
|
+
multiUse: false,
|
|
652
|
+
target: target && fullyQualifiedId2(target)
|
|
653
|
+
});
|
|
654
|
+
if (invitation && config.values.runtime?.app?.env?.DX_ENVIRONMENT !== "production") {
|
|
655
|
+
const subscription = invitation.subscribe((invitation2) => handleInvitationEvent(invitation2, subscription));
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
},
|
|
659
|
+
inviteMany: {
|
|
660
|
+
label: t("invite many label"),
|
|
661
|
+
description: t("invite many description"),
|
|
662
|
+
icon: () => /* @__PURE__ */ React8.createElement(Icon4, {
|
|
663
|
+
icon: "ph--users-three--regular",
|
|
664
|
+
size: 5
|
|
665
|
+
}),
|
|
666
|
+
testId: "membersContainer.inviteMany",
|
|
667
|
+
onClick: () => {
|
|
668
|
+
const invitation = space.share?.({
|
|
669
|
+
type: Invitation.Type.DELEGATED,
|
|
670
|
+
authMethod: Invitation.AuthMethod.KNOWN_PUBLIC_KEY,
|
|
671
|
+
multiUse: true,
|
|
672
|
+
target: target && fullyQualifiedId2(target)
|
|
673
|
+
});
|
|
674
|
+
if (invitation && config.values.runtime?.app?.env?.DX_ENVIRONMENT !== "production") {
|
|
675
|
+
const subscription = invitation.subscribe((invitation2) => handleInvitationEvent(invitation2, subscription));
|
|
676
|
+
}
|
|
677
|
+
}
|
|
678
|
+
}
|
|
679
|
+
}), [
|
|
680
|
+
t,
|
|
681
|
+
space,
|
|
682
|
+
target
|
|
683
|
+
]);
|
|
684
|
+
const [selectedInvitation, setSelectedInvitation] = useState3(null);
|
|
685
|
+
const handleSend = (event) => {
|
|
686
|
+
setSelectedInvitation(event.invitation);
|
|
687
|
+
};
|
|
688
|
+
const handleBack = () => {
|
|
689
|
+
setSelectedInvitation(null);
|
|
690
|
+
};
|
|
691
|
+
return /* @__PURE__ */ React8.createElement(StackItem.Content, {
|
|
692
|
+
classNames: "p-2 block overflow-y-auto"
|
|
693
|
+
}, /* @__PURE__ */ React8.createElement(ControlSection, {
|
|
694
|
+
title: t("members verbose label", {
|
|
695
|
+
ns: SPACE_PLUGIN
|
|
696
|
+
}),
|
|
697
|
+
description: t("members description", {
|
|
698
|
+
ns: SPACE_PLUGIN
|
|
699
|
+
})
|
|
700
|
+
}, /* @__PURE__ */ React8.createElement(ControlFrame, null, /* @__PURE__ */ React8.createElement(ControlFrameItem, {
|
|
701
|
+
title: t("members label", {
|
|
702
|
+
ns: SPACE_PLUGIN
|
|
703
|
+
})
|
|
704
|
+
}, /* @__PURE__ */ React8.createElement(SpaceMemberList, {
|
|
705
|
+
spaceKey: space.key,
|
|
706
|
+
includeSelf: true
|
|
707
|
+
})), /* @__PURE__ */ React8.createElement(ControlFrameItem, {
|
|
708
|
+
title: t("invitations label", {
|
|
709
|
+
ns: SPACE_PLUGIN
|
|
710
|
+
})
|
|
711
|
+
}, selectedInvitation && /* @__PURE__ */ React8.createElement(InvitationSection, {
|
|
712
|
+
...selectedInvitation,
|
|
713
|
+
onBack: handleBack
|
|
714
|
+
}), !selectedInvitation && /* @__PURE__ */ React8.createElement(React8.Fragment, null, /* @__PURE__ */ React8.createElement("p", {
|
|
715
|
+
className: "text-description mbe-2"
|
|
716
|
+
}, t("space invitation description", {
|
|
717
|
+
ns: SPACE_PLUGIN
|
|
718
|
+
})), /* @__PURE__ */ React8.createElement(InvitationList, {
|
|
719
|
+
className: "mb-2",
|
|
720
|
+
send: handleSend,
|
|
721
|
+
invitations: visibleInvitations ?? [],
|
|
722
|
+
onClickRemove: (invitation) => invitation.cancel(),
|
|
723
|
+
createInvitationUrl
|
|
724
|
+
}), /* @__PURE__ */ React8.createElement(BifurcatedAction, {
|
|
725
|
+
actions: inviteActions,
|
|
726
|
+
activeAction,
|
|
727
|
+
onChangeActiveAction: setActiveAction,
|
|
728
|
+
"data-testid": "membersContainer.createInvitation"
|
|
729
|
+
}))))));
|
|
730
|
+
};
|
|
731
|
+
var InvitationSection = ({ state = Invitation.State.INIT, authCode, invitationId = "never", url = "never", onBack }) => {
|
|
732
|
+
const activeView = state < 0 ? "init" : state >= Invitation.State.CANCELLED ? "complete" : state >= Invitation.State.READY_FOR_AUTHENTICATION && authCode ? "auth-code" : "qr-code";
|
|
733
|
+
return /* @__PURE__ */ React8.createElement(Viewport.Root, {
|
|
734
|
+
activeView
|
|
735
|
+
}, /* @__PURE__ */ React8.createElement(Viewport.Views, null, /* @__PURE__ */ React8.createElement(Viewport.View, {
|
|
736
|
+
id: "init"
|
|
737
|
+
}), /* @__PURE__ */ React8.createElement(Viewport.View, {
|
|
738
|
+
id: "complete"
|
|
739
|
+
}, /* @__PURE__ */ React8.createElement(InvitationComplete, {
|
|
740
|
+
statusValue: state
|
|
741
|
+
})), /* @__PURE__ */ React8.createElement(Viewport.View, {
|
|
742
|
+
id: "auth-code"
|
|
743
|
+
}, /* @__PURE__ */ React8.createElement(InvitationAuthCode, {
|
|
744
|
+
id: invitationId,
|
|
745
|
+
code: authCode ?? "never",
|
|
746
|
+
onCancel: onBack
|
|
747
|
+
})), /* @__PURE__ */ React8.createElement(Viewport.View, {
|
|
748
|
+
id: "qr-code"
|
|
749
|
+
}, /* @__PURE__ */ React8.createElement(InvitationQR, {
|
|
750
|
+
id: invitationId,
|
|
751
|
+
url,
|
|
752
|
+
onCancel: onBack
|
|
753
|
+
}))));
|
|
754
|
+
};
|
|
755
|
+
var InvitationQR = ({ id, url, onCancel }) => {
|
|
756
|
+
const { t } = useTranslation8("os");
|
|
757
|
+
const qrLabel = useId("members-container__qr-code");
|
|
758
|
+
const emoji = hexToEmoji(id);
|
|
759
|
+
return /* @__PURE__ */ React8.createElement(Clipboard.Provider, null, /* @__PURE__ */ React8.createElement("p", {
|
|
760
|
+
className: "text-description"
|
|
761
|
+
}, t("qr code description", {
|
|
762
|
+
ns: SPACE_PLUGIN
|
|
763
|
+
})), /* @__PURE__ */ React8.createElement("div", {
|
|
764
|
+
role: "group",
|
|
765
|
+
className: "grid grid-cols-[1fr_min-content] mlb-2 gap-2"
|
|
766
|
+
}, /* @__PURE__ */ React8.createElement("div", {
|
|
767
|
+
role: "none",
|
|
768
|
+
className: "is-full aspect-square relative text-description"
|
|
769
|
+
}, /* @__PURE__ */ React8.createElement(QR, {
|
|
770
|
+
rounding: 100,
|
|
771
|
+
backgroundColor: "transparent",
|
|
772
|
+
color: "currentColor",
|
|
773
|
+
"aria-labelledby": qrLabel,
|
|
774
|
+
errorCorrectionLevel: "Q",
|
|
775
|
+
cutout: true
|
|
776
|
+
}, url ?? "never"), /* @__PURE__ */ React8.createElement(Centered, null, /* @__PURE__ */ React8.createElement(Emoji, {
|
|
777
|
+
text: emoji
|
|
778
|
+
}))), /* @__PURE__ */ React8.createElement("span", {
|
|
779
|
+
id: qrLabel,
|
|
780
|
+
className: "sr-only"
|
|
781
|
+
}, t("qr label")), /* @__PURE__ */ React8.createElement(Clipboard.Button, {
|
|
782
|
+
value: url ?? "never"
|
|
783
|
+
})), /* @__PURE__ */ React8.createElement(Button4, {
|
|
784
|
+
variant: "ghost",
|
|
785
|
+
onClick: onCancel
|
|
786
|
+
}, t("cancel label")));
|
|
787
|
+
};
|
|
788
|
+
var InvitationAuthCode = ({ id, code, onCancel }) => {
|
|
789
|
+
const { t } = useTranslation8("os");
|
|
790
|
+
const emoji = hexToEmoji(id);
|
|
791
|
+
return /* @__PURE__ */ React8.createElement(React8.Fragment, null, /* @__PURE__ */ React8.createElement("p", {
|
|
792
|
+
className: "text-description"
|
|
793
|
+
}, t("auth other device emoji message")), emoji && /* @__PURE__ */ React8.createElement(Emoji, {
|
|
794
|
+
text: emoji,
|
|
795
|
+
className: "mli-auto mlb-2 text-center"
|
|
796
|
+
}), /* @__PURE__ */ React8.createElement("p", {
|
|
797
|
+
className: "text-description"
|
|
798
|
+
}, t("auth code message")), /* @__PURE__ */ React8.createElement(AuthCode, {
|
|
799
|
+
code,
|
|
800
|
+
large: true,
|
|
801
|
+
classNames: "mli-auto mlb-2 text-center grow"
|
|
802
|
+
}), /* @__PURE__ */ React8.createElement(Button4, {
|
|
803
|
+
variant: "ghost",
|
|
804
|
+
onClick: onCancel
|
|
805
|
+
}, t("cancel label")));
|
|
806
|
+
};
|
|
807
|
+
var InvitationComplete = ({ statusValue }) => {
|
|
808
|
+
return statusValue > 0 ? /* @__PURE__ */ React8.createElement(Check, {
|
|
809
|
+
className: mx4("m-1.5", getSize2(6))
|
|
810
|
+
}) : /* @__PURE__ */ React8.createElement(X, {
|
|
811
|
+
className: mx4("m-1.5", getSize2(6))
|
|
812
|
+
});
|
|
813
|
+
};
|
|
814
|
+
|
|
709
815
|
// packages/plugins/plugin-space/src/components/MenuFooter.tsx
|
|
710
816
|
import { Planet } from "@phosphor-icons/react";
|
|
711
|
-
import
|
|
817
|
+
import React9 from "react";
|
|
712
818
|
import { getSpace as getSpace2 } from "@dxos/client/echo";
|
|
713
819
|
import { useClient as useClient4 } from "@dxos/react-client";
|
|
714
|
-
import { DropdownMenu, toLocalizedString as toLocalizedString2, useTranslation as
|
|
820
|
+
import { DropdownMenu, toLocalizedString as toLocalizedString2, useTranslation as useTranslation9 } from "@dxos/react-ui";
|
|
715
821
|
var MenuFooter = ({ object }) => {
|
|
716
|
-
const { t } =
|
|
822
|
+
const { t } = useTranslation9(SPACE_PLUGIN);
|
|
717
823
|
const client = useClient4();
|
|
718
824
|
const space = getSpace2(object);
|
|
719
825
|
const spaceName = space ? getSpaceDisplayName(space, {
|
|
720
826
|
personal: client.spaces.default === space
|
|
721
827
|
}) : "";
|
|
722
|
-
return space ? /* @__PURE__ */
|
|
828
|
+
return space ? /* @__PURE__ */ React9.createElement(React9.Fragment, null, /* @__PURE__ */ React9.createElement(DropdownMenu.Separator, null), /* @__PURE__ */ React9.createElement(DropdownMenu.GroupLabel, null, t("menu footer label")), /* @__PURE__ */ React9.createElement("dl", {
|
|
723
829
|
className: "pis-2 mbe-2 text-xs grid grid-cols-[max-content_1fr] gap-2"
|
|
724
|
-
}, /* @__PURE__ */
|
|
830
|
+
}, /* @__PURE__ */ React9.createElement("dt", {
|
|
725
831
|
className: "uppercase text-[.75em] tracking-wide font-medium mbs-px self-start"
|
|
726
|
-
}, t("location label")), /* @__PURE__ */
|
|
832
|
+
}, t("location label")), /* @__PURE__ */ React9.createElement("dd", {
|
|
727
833
|
className: "line-clamp-3"
|
|
728
|
-
}, /* @__PURE__ */
|
|
834
|
+
}, /* @__PURE__ */ React9.createElement(Planet, {
|
|
729
835
|
className: "inline-block mie-1"
|
|
730
836
|
}), toLocalizedString2(spaceName, t)))) : null;
|
|
731
837
|
};
|
|
732
838
|
|
|
839
|
+
// packages/plugins/plugin-space/src/components/ObjectSettingsContainer/ObjectSettingsContainer.tsx
|
|
840
|
+
import React13, { useMemo as useMemo2 } from "react";
|
|
841
|
+
import { Surface as Surface2 } from "@dxos/app-framework";
|
|
842
|
+
import { Clipboard as Clipboard2 } from "@dxos/react-ui";
|
|
843
|
+
import { StackItem as StackItem2 } from "@dxos/react-ui-stack";
|
|
844
|
+
|
|
845
|
+
// packages/plugins/plugin-space/src/components/ObjectSettingsContainer/AdvancedObjectSettings.tsx
|
|
846
|
+
import React11, { useCallback as useCallback7, useState as useState4 } from "react";
|
|
847
|
+
import { ForeignKeySchema } from "@dxos/echo-schema";
|
|
848
|
+
import { getMeta } from "@dxos/react-client/echo";
|
|
849
|
+
import { IconButton as IconButton2, useTranslation as useTranslation11 } from "@dxos/react-ui";
|
|
850
|
+
import { Form as Form3 } from "@dxos/react-ui-form";
|
|
851
|
+
|
|
852
|
+
// packages/plugins/plugin-space/src/components/ObjectSettingsContainer/ForeignKeys.tsx
|
|
853
|
+
import React10, { useCallback as useCallback6 } from "react";
|
|
854
|
+
import { IconButton, List, ListItem, useTranslation as useTranslation10 } from "@dxos/react-ui";
|
|
855
|
+
var ForeignKeys = ({ keys, onDelete }) => {
|
|
856
|
+
return /* @__PURE__ */ React10.createElement(List, {
|
|
857
|
+
classNames: "flex flex-col gap-2"
|
|
858
|
+
}, keys.map((key) => /* @__PURE__ */ React10.createElement(KeyItem, {
|
|
859
|
+
key: key.id,
|
|
860
|
+
forignKey: key,
|
|
861
|
+
onDelete
|
|
862
|
+
})));
|
|
863
|
+
};
|
|
864
|
+
var KeyItem = ({ forignKey, onDelete }) => {
|
|
865
|
+
const { t } = useTranslation10(SPACE_PLUGIN);
|
|
866
|
+
const handleDelete = useCallback6(() => {
|
|
867
|
+
onDelete?.(forignKey);
|
|
868
|
+
}, [
|
|
869
|
+
forignKey,
|
|
870
|
+
onDelete
|
|
871
|
+
]);
|
|
872
|
+
return /* @__PURE__ */ React10.createElement(ListItem.Root, {
|
|
873
|
+
classNames: "px-2"
|
|
874
|
+
}, /* @__PURE__ */ React10.createElement(ListItem.Heading, {
|
|
875
|
+
classNames: "flex flex-col grow truncate"
|
|
876
|
+
}, /* @__PURE__ */ React10.createElement("div", null, forignKey.source), /* @__PURE__ */ React10.createElement("div", {
|
|
877
|
+
className: "text-description text-sm truncate"
|
|
878
|
+
}, forignKey.id)), /* @__PURE__ */ React10.createElement(ListItem.Endcap, null, /* @__PURE__ */ React10.createElement(IconButton, {
|
|
879
|
+
iconOnly: true,
|
|
880
|
+
icon: "ph--x--regular",
|
|
881
|
+
variant: "ghost",
|
|
882
|
+
label: t("delete key"),
|
|
883
|
+
onClick: handleDelete
|
|
884
|
+
})));
|
|
885
|
+
};
|
|
886
|
+
|
|
887
|
+
// packages/plugins/plugin-space/src/components/ObjectSettingsContainer/AdvancedObjectSettings.tsx
|
|
888
|
+
var initialValues2 = {
|
|
889
|
+
source: "",
|
|
890
|
+
id: ""
|
|
891
|
+
};
|
|
892
|
+
var AdvancedObjectSettings = ({ object }) => {
|
|
893
|
+
const { t } = useTranslation11(SPACE_PLUGIN);
|
|
894
|
+
const [adding, setAdding] = useState4(false);
|
|
895
|
+
const keys = getMeta(object).keys;
|
|
896
|
+
const handleNew = useCallback7(() => setAdding(true), []);
|
|
897
|
+
const handleCancel = useCallback7(() => setAdding(false), []);
|
|
898
|
+
const handleSave = useCallback7((key) => {
|
|
899
|
+
const index = keys.findIndex(({ source, id }) => source === key.source && id === key.id);
|
|
900
|
+
if (index === -1) {
|
|
901
|
+
keys.push(key);
|
|
902
|
+
}
|
|
903
|
+
setAdding(false);
|
|
904
|
+
}, [
|
|
905
|
+
keys
|
|
906
|
+
]);
|
|
907
|
+
const handleDelete = useCallback7((key) => {
|
|
908
|
+
const index = keys.findIndex(({ source, id }) => source === key.source && id === key.id);
|
|
909
|
+
if (index !== -1) {
|
|
910
|
+
keys.splice(index, 1);
|
|
911
|
+
}
|
|
912
|
+
}, [
|
|
913
|
+
keys
|
|
914
|
+
]);
|
|
915
|
+
return /* @__PURE__ */ React11.createElement(React11.Fragment, null, /* @__PURE__ */ React11.createElement("div", {
|
|
916
|
+
className: "p-2 flex flex-col gap-4"
|
|
917
|
+
}, /* @__PURE__ */ React11.createElement("h2", null, t("advanced settings label")), /* @__PURE__ */ React11.createElement("div", {
|
|
918
|
+
className: "flex items-center"
|
|
919
|
+
}, /* @__PURE__ */ React11.createElement("h3", {
|
|
920
|
+
className: "text-sm font-semibold"
|
|
921
|
+
}, t("foreign keys")), /* @__PURE__ */ React11.createElement("div", {
|
|
922
|
+
className: "grow"
|
|
923
|
+
}), /* @__PURE__ */ React11.createElement(IconButton2, {
|
|
924
|
+
classNames: adding && "invisible",
|
|
925
|
+
icon: "ph--plus--regular",
|
|
926
|
+
label: t("add key"),
|
|
927
|
+
onClick: handleNew
|
|
928
|
+
})), !adding && /* @__PURE__ */ React11.createElement(ForeignKeys, {
|
|
929
|
+
keys,
|
|
930
|
+
onDelete: handleDelete
|
|
931
|
+
})), adding && /* @__PURE__ */ React11.createElement(Form3, {
|
|
932
|
+
schema: ForeignKeySchema,
|
|
933
|
+
values: initialValues2,
|
|
934
|
+
onSave: handleSave,
|
|
935
|
+
onCancel: handleCancel
|
|
936
|
+
}));
|
|
937
|
+
};
|
|
938
|
+
|
|
939
|
+
// packages/plugins/plugin-space/src/components/ObjectSettingsContainer/BaseObjectSettings.tsx
|
|
940
|
+
import React12, { useRef as useRef3 } from "react";
|
|
941
|
+
import { Input, useTranslation as useTranslation12 } from "@dxos/react-ui";
|
|
942
|
+
import { mx as mx5 } from "@dxos/react-ui-theme";
|
|
943
|
+
var BaseObjectSettings = ({ classNames, children, object }) => {
|
|
944
|
+
const { t } = useTranslation12(meta.id);
|
|
945
|
+
const inputRef = useRef3(null);
|
|
946
|
+
return /* @__PURE__ */ React12.createElement("form", {
|
|
947
|
+
className: mx5("flex flex-col p-2 gap-2", classNames)
|
|
948
|
+
}, /* @__PURE__ */ React12.createElement(Input.Root, null, /* @__PURE__ */ React12.createElement(Input.Label, null, t("name label")), /* @__PURE__ */ React12.createElement(Input.TextInput, {
|
|
949
|
+
ref: inputRef,
|
|
950
|
+
placeholder: t("name placeholder"),
|
|
951
|
+
value: object.name ?? "",
|
|
952
|
+
onChange: (event) => {
|
|
953
|
+
object.name = event.target.value;
|
|
954
|
+
},
|
|
955
|
+
onKeyDown: (event) => {
|
|
956
|
+
if (event.key === "Enter") {
|
|
957
|
+
inputRef.current?.blur();
|
|
958
|
+
}
|
|
959
|
+
}
|
|
960
|
+
})), children);
|
|
961
|
+
};
|
|
962
|
+
|
|
963
|
+
// packages/plugins/plugin-space/src/components/ObjectSettingsContainer/ObjectSettingsContainer.tsx
|
|
964
|
+
var ObjectSettingsContainer = ({ object, role }) => {
|
|
965
|
+
const data = useMemo2(() => ({
|
|
966
|
+
subject: object
|
|
967
|
+
}), [
|
|
968
|
+
object
|
|
969
|
+
]);
|
|
970
|
+
return /* @__PURE__ */ React13.createElement(Clipboard2.Provider, null, /* @__PURE__ */ React13.createElement(StackItem2.Content, {
|
|
971
|
+
toolbar: false,
|
|
972
|
+
role
|
|
973
|
+
}, /* @__PURE__ */ React13.createElement("div", {
|
|
974
|
+
className: "flex flex-col overflow-y-auto divide-y divide-separator"
|
|
975
|
+
}, /* @__PURE__ */ React13.createElement(BaseObjectSettings, {
|
|
976
|
+
object
|
|
977
|
+
}, /* @__PURE__ */ React13.createElement(Surface2, {
|
|
978
|
+
role: "base-object-settings",
|
|
979
|
+
data
|
|
980
|
+
})), /* @__PURE__ */ React13.createElement(Surface2, {
|
|
981
|
+
role: "object-settings",
|
|
982
|
+
data
|
|
983
|
+
}), /* @__PURE__ */ React13.createElement(AdvancedObjectSettings, {
|
|
984
|
+
object
|
|
985
|
+
}))));
|
|
986
|
+
};
|
|
987
|
+
|
|
733
988
|
// packages/plugins/plugin-space/src/components/PersistenceStatus.tsx
|
|
734
989
|
import { ArrowsCounterClockwise, CheckCircle as CheckCircle2, Warning } from "@phosphor-icons/react";
|
|
735
|
-
import
|
|
990
|
+
import React14, { useEffect as useEffect2, useState as useState5 } from "react";
|
|
736
991
|
import { debounce } from "@dxos/async";
|
|
737
|
-
import { Tooltip, useTranslation as
|
|
738
|
-
import { getSize as
|
|
992
|
+
import { Tooltip, useTranslation as useTranslation13 } from "@dxos/react-ui";
|
|
993
|
+
import { getSize as getSize3, mx as mx6, staticPlaceholderText, warningText } from "@dxos/react-ui-theme";
|
|
739
994
|
var Status;
|
|
740
995
|
(function(Status2) {
|
|
741
996
|
Status2[Status2["PERSISTED_LOCALLY"] = 0] = "PERSISTED_LOCALLY";
|
|
@@ -743,10 +998,10 @@ var Status;
|
|
|
743
998
|
Status2[Status2["ERROR"] = 2] = "ERROR";
|
|
744
999
|
})(Status || (Status = {}));
|
|
745
1000
|
var PersistenceStatus = ({ db }) => {
|
|
746
|
-
const { t } =
|
|
747
|
-
const [displayMessage, setDisplayMessage] =
|
|
748
|
-
const [status, naturalSetStatus] =
|
|
749
|
-
const [prevStatus, setPrevStatus] =
|
|
1001
|
+
const { t } = useTranslation13(SPACE_PLUGIN);
|
|
1002
|
+
const [displayMessage, setDisplayMessage] = useState5(false);
|
|
1003
|
+
const [status, naturalSetStatus] = useState5(0);
|
|
1004
|
+
const [prevStatus, setPrevStatus] = useState5(0);
|
|
750
1005
|
const _setStatus = debounce(naturalSetStatus, 500);
|
|
751
1006
|
useEffect2(() => {
|
|
752
1007
|
setPrevStatus(status);
|
|
@@ -760,48 +1015,48 @@ var PersistenceStatus = ({ db }) => {
|
|
|
760
1015
|
]);
|
|
761
1016
|
switch (status) {
|
|
762
1017
|
case 2:
|
|
763
|
-
return /* @__PURE__ */
|
|
1018
|
+
return /* @__PURE__ */ React14.createElement("div", {
|
|
764
1019
|
className: "flex items-center"
|
|
765
|
-
}, /* @__PURE__ */
|
|
766
|
-
className:
|
|
767
|
-
}), /* @__PURE__ */
|
|
768
|
-
className:
|
|
1020
|
+
}, /* @__PURE__ */ React14.createElement(Warning, {
|
|
1021
|
+
className: mx6(getSize3(4), "me-1")
|
|
1022
|
+
}), /* @__PURE__ */ React14.createElement("span", {
|
|
1023
|
+
className: mx6("text-sm", warningText)
|
|
769
1024
|
}, t("persistence error label")));
|
|
770
1025
|
case 1:
|
|
771
|
-
return /* @__PURE__ */
|
|
1026
|
+
return /* @__PURE__ */ React14.createElement("div", {
|
|
772
1027
|
className: "flex items-center"
|
|
773
|
-
}, /* @__PURE__ */
|
|
774
|
-
className:
|
|
775
|
-
}), /* @__PURE__ */
|
|
776
|
-
className:
|
|
1028
|
+
}, /* @__PURE__ */ React14.createElement(ArrowsCounterClockwise, {
|
|
1029
|
+
className: mx6(getSize3(4), "me-1")
|
|
1030
|
+
}), /* @__PURE__ */ React14.createElement("span", {
|
|
1031
|
+
className: mx6("text-sm", staticPlaceholderText)
|
|
777
1032
|
}, t("persistence pending label")));
|
|
778
1033
|
case 0:
|
|
779
1034
|
default:
|
|
780
|
-
return /* @__PURE__ */
|
|
1035
|
+
return /* @__PURE__ */ React14.createElement(Tooltip.Root, {
|
|
781
1036
|
delayDuration: 400
|
|
782
|
-
}, /* @__PURE__ */
|
|
1037
|
+
}, /* @__PURE__ */ React14.createElement(Tooltip.Trigger, {
|
|
783
1038
|
role: "status",
|
|
784
1039
|
className: "flex items-center"
|
|
785
|
-
}, /* @__PURE__ */
|
|
786
|
-
className:
|
|
787
|
-
}), displayMessage && /* @__PURE__ */
|
|
788
|
-
className:
|
|
789
|
-
}, t("persisted locally label"))), /* @__PURE__ */
|
|
1040
|
+
}, /* @__PURE__ */ React14.createElement(CheckCircle2, {
|
|
1041
|
+
className: mx6(getSize3(4), "me-1")
|
|
1042
|
+
}), displayMessage && /* @__PURE__ */ React14.createElement("span", {
|
|
1043
|
+
className: mx6("text-sm", staticPlaceholderText)
|
|
1044
|
+
}, t("persisted locally label"))), /* @__PURE__ */ React14.createElement(Tooltip.Portal, null, /* @__PURE__ */ React14.createElement(Tooltip.Content, null, t("persisted locally message"), /* @__PURE__ */ React14.createElement(Tooltip.Arrow, null))));
|
|
790
1045
|
}
|
|
791
1046
|
};
|
|
792
1047
|
|
|
793
1048
|
// packages/plugins/plugin-space/src/components/PopoverAddSpace.tsx
|
|
794
|
-
import
|
|
1049
|
+
import React15 from "react";
|
|
795
1050
|
import { createIntent as createIntent5, LayoutAction as LayoutAction5, useIntentDispatcher as useIntentDispatcher5 } from "@dxos/app-framework";
|
|
796
|
-
import { IconButton as IconButton3, useTranslation as
|
|
1051
|
+
import { IconButton as IconButton3, useTranslation as useTranslation14 } from "@dxos/react-ui";
|
|
797
1052
|
var POPOVER_ADD_SPACE = `${SPACE_PLUGIN}/PopoverRenameSpace`;
|
|
798
1053
|
var PopoverAddSpace = () => {
|
|
799
|
-
const { t } =
|
|
1054
|
+
const { t } = useTranslation14(SPACE_PLUGIN);
|
|
800
1055
|
const { dispatchPromise: dispatch } = useIntentDispatcher5();
|
|
801
|
-
return /* @__PURE__ */
|
|
1056
|
+
return /* @__PURE__ */ React15.createElement("div", {
|
|
802
1057
|
role: "none",
|
|
803
1058
|
className: "grid grid-cols-1 gap-1 [&>button]:justify-start"
|
|
804
|
-
}, /* @__PURE__ */
|
|
1059
|
+
}, /* @__PURE__ */ React15.createElement(IconButton3, {
|
|
805
1060
|
variant: "ghost",
|
|
806
1061
|
label: t("create space label"),
|
|
807
1062
|
icon: "ph--plus--regular",
|
|
@@ -816,7 +1071,7 @@ var PopoverAddSpace = () => {
|
|
|
816
1071
|
}));
|
|
817
1072
|
},
|
|
818
1073
|
"data-testid": "spacePlugin.createSpace"
|
|
819
|
-
}), /* @__PURE__ */
|
|
1074
|
+
}), /* @__PURE__ */ React15.createElement(IconButton3, {
|
|
820
1075
|
variant: "ghost",
|
|
821
1076
|
label: t("join space label"),
|
|
822
1077
|
icon: "ph--sign-in--regular",
|
|
@@ -835,16 +1090,16 @@ var PopoverAddSpace = () => {
|
|
|
835
1090
|
};
|
|
836
1091
|
|
|
837
1092
|
// packages/plugins/plugin-space/src/components/PopoverRenameObject.tsx
|
|
838
|
-
import
|
|
1093
|
+
import React16, { useCallback as useCallback8, useRef as useRef4, useState as useState6 } from "react";
|
|
839
1094
|
import { log as log2 } from "@dxos/log";
|
|
840
|
-
import { Button as
|
|
1095
|
+
import { Button as Button5, Input as Input2, Popover, useTranslation as useTranslation15 } from "@dxos/react-ui";
|
|
841
1096
|
var __dxlog_file4 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/PopoverRenameObject.tsx";
|
|
842
1097
|
var POPOVER_RENAME_OBJECT = `${SPACE_PLUGIN}/PopoverRenameObject`;
|
|
843
1098
|
var PopoverRenameObject = ({ object: obj }) => {
|
|
844
|
-
const { t } =
|
|
845
|
-
const doneButton =
|
|
1099
|
+
const { t } = useTranslation15(SPACE_PLUGIN);
|
|
1100
|
+
const doneButton = useRef4(null);
|
|
846
1101
|
const object = obj;
|
|
847
|
-
const [name, setName] =
|
|
1102
|
+
const [name, setName] = useState6(object.name || object.title || "");
|
|
848
1103
|
const handleDone = useCallback8(() => {
|
|
849
1104
|
try {
|
|
850
1105
|
object.name = name;
|
|
@@ -866,23 +1121,23 @@ var PopoverRenameObject = ({ object: obj }) => {
|
|
|
866
1121
|
object,
|
|
867
1122
|
name
|
|
868
1123
|
]);
|
|
869
|
-
return /* @__PURE__ */
|
|
1124
|
+
return /* @__PURE__ */ React16.createElement("div", {
|
|
870
1125
|
role: "none",
|
|
871
1126
|
className: "p-1 flex gap-2"
|
|
872
|
-
}, /* @__PURE__ */
|
|
1127
|
+
}, /* @__PURE__ */ React16.createElement("div", {
|
|
873
1128
|
role: "none",
|
|
874
1129
|
className: "flex-1"
|
|
875
|
-
}, /* @__PURE__ */
|
|
1130
|
+
}, /* @__PURE__ */ React16.createElement(Input2.Root, null, /* @__PURE__ */ React16.createElement(Input2.Label, {
|
|
876
1131
|
srOnly: true
|
|
877
|
-
}, t("object name label")), /* @__PURE__ */
|
|
878
|
-
placeholder: t("object
|
|
1132
|
+
}, t("object name label")), /* @__PURE__ */ React16.createElement(Input2.TextInput, {
|
|
1133
|
+
placeholder: t("object placeholder"),
|
|
879
1134
|
value: name,
|
|
880
1135
|
"data-testid": "spacePlugin.renameObject.input",
|
|
881
1136
|
onChange: ({ target: { value } }) => setName(value),
|
|
882
1137
|
onKeyDown: ({ key }) => key === "Enter" && doneButton.current?.click()
|
|
883
|
-
}))), /* @__PURE__ */
|
|
1138
|
+
}))), /* @__PURE__ */ React16.createElement(Popover.Close, {
|
|
884
1139
|
asChild: true
|
|
885
|
-
}, /* @__PURE__ */
|
|
1140
|
+
}, /* @__PURE__ */ React16.createElement(Button5, {
|
|
886
1141
|
ref: doneButton,
|
|
887
1142
|
classNames: "self-stretch",
|
|
888
1143
|
onClick: handleDone
|
|
@@ -892,37 +1147,37 @@ var PopoverRenameObject = ({ object: obj }) => {
|
|
|
892
1147
|
};
|
|
893
1148
|
|
|
894
1149
|
// packages/plugins/plugin-space/src/components/PopoverRenameSpace.tsx
|
|
895
|
-
import
|
|
896
|
-
import { Button as
|
|
1150
|
+
import React17, { useCallback as useCallback9, useRef as useRef5, useState as useState7 } from "react";
|
|
1151
|
+
import { Button as Button6, Input as Input3, Popover as Popover2, useTranslation as useTranslation16 } from "@dxos/react-ui";
|
|
897
1152
|
var POPOVER_RENAME_SPACE = `${SPACE_PLUGIN}/PopoverRenameSpace`;
|
|
898
1153
|
var PopoverRenameSpace = ({ space }) => {
|
|
899
|
-
const { t } =
|
|
900
|
-
const doneButton =
|
|
901
|
-
const [name, setName] =
|
|
1154
|
+
const { t } = useTranslation16(SPACE_PLUGIN);
|
|
1155
|
+
const doneButton = useRef5(null);
|
|
1156
|
+
const [name, setName] = useState7(space.properties.name ?? "");
|
|
902
1157
|
const handleDone = useCallback9(() => {
|
|
903
1158
|
space.properties.name = name;
|
|
904
1159
|
}, [
|
|
905
1160
|
space,
|
|
906
1161
|
name
|
|
907
1162
|
]);
|
|
908
|
-
return /* @__PURE__ */
|
|
1163
|
+
return /* @__PURE__ */ React17.createElement("div", {
|
|
909
1164
|
role: "none",
|
|
910
1165
|
className: "p-1 flex gap-2"
|
|
911
|
-
}, /* @__PURE__ */
|
|
1166
|
+
}, /* @__PURE__ */ React17.createElement("div", {
|
|
912
1167
|
role: "none",
|
|
913
1168
|
className: "flex-1"
|
|
914
|
-
}, /* @__PURE__ */
|
|
1169
|
+
}, /* @__PURE__ */ React17.createElement(Input3.Root, null, /* @__PURE__ */ React17.createElement(Input3.Label, {
|
|
915
1170
|
srOnly: true
|
|
916
|
-
}, t("space name label")), /* @__PURE__ */
|
|
1171
|
+
}, t("space name label")), /* @__PURE__ */ React17.createElement(Input3.TextInput, {
|
|
917
1172
|
defaultValue: space.properties.name ?? "",
|
|
918
1173
|
placeholder: t("unnamed space label"),
|
|
919
1174
|
onChange: ({ target: { value } }) => setName(value),
|
|
920
1175
|
// TODO(wittjosiah): Ideally this should access the popover context to close the popover.
|
|
921
1176
|
// Currently this is not possible because Radix does not expose the popover context.
|
|
922
1177
|
onKeyDown: ({ key }) => key === "Enter" && doneButton.current?.click()
|
|
923
|
-
}))), /* @__PURE__ */
|
|
1178
|
+
}))), /* @__PURE__ */ React17.createElement(Popover2.Close, {
|
|
924
1179
|
asChild: true
|
|
925
|
-
}, /* @__PURE__ */
|
|
1180
|
+
}, /* @__PURE__ */ React17.createElement(Button6, {
|
|
926
1181
|
ref: doneButton,
|
|
927
1182
|
classNames: "self-stretch",
|
|
928
1183
|
onClick: handleDone
|
|
@@ -932,20 +1187,20 @@ var PopoverRenameSpace = ({ space }) => {
|
|
|
932
1187
|
};
|
|
933
1188
|
|
|
934
1189
|
// packages/plugins/plugin-space/src/components/ShareSpaceButton.tsx
|
|
935
|
-
import
|
|
1190
|
+
import React18 from "react";
|
|
936
1191
|
import { createIntent as createIntent6, useIntentDispatcher as useIntentDispatcher6 } from "@dxos/app-framework";
|
|
937
|
-
import { IconButton as IconButton4, useTranslation as
|
|
1192
|
+
import { IconButton as IconButton4, useTranslation as useTranslation17 } from "@dxos/react-ui";
|
|
938
1193
|
var ShareSpaceButton = ({ space }) => {
|
|
939
1194
|
const { dispatchPromise: dispatch } = useIntentDispatcher6();
|
|
940
|
-
return /* @__PURE__ */
|
|
1195
|
+
return /* @__PURE__ */ React18.createElement(ShareSpaceButtonImpl, {
|
|
941
1196
|
onClick: () => dispatch(createIntent6(SpaceAction.Share, {
|
|
942
1197
|
space
|
|
943
1198
|
}))
|
|
944
1199
|
});
|
|
945
1200
|
};
|
|
946
1201
|
var ShareSpaceButtonImpl = ({ onClick }) => {
|
|
947
|
-
const { t } =
|
|
948
|
-
return /* @__PURE__ */
|
|
1202
|
+
const { t } = useTranslation17(SPACE_PLUGIN);
|
|
1203
|
+
return /* @__PURE__ */ React18.createElement(IconButton4, {
|
|
949
1204
|
"data-testid": "spacePlugin.shareSpaceButton",
|
|
950
1205
|
icon: "ph--users--regular",
|
|
951
1206
|
label: t("share space label"),
|
|
@@ -954,20 +1209,20 @@ var ShareSpaceButtonImpl = ({ onClick }) => {
|
|
|
954
1209
|
};
|
|
955
1210
|
|
|
956
1211
|
// packages/plugins/plugin-space/src/components/SpacePresence.tsx
|
|
957
|
-
import
|
|
1212
|
+
import React19, { useCallback as useCallback10, useEffect as useEffect4, useState as useState9 } from "react";
|
|
958
1213
|
import { useAppGraph as useAppGraph2, useCapability } from "@dxos/app-framework";
|
|
959
1214
|
import { generateName } from "@dxos/display-name";
|
|
960
1215
|
import { PublicKey, useClient as useClient5 } from "@dxos/react-client";
|
|
961
|
-
import { getSpace as getSpace3, useMembers, fullyQualifiedId as
|
|
1216
|
+
import { getSpace as getSpace3, useMembers, fullyQualifiedId as fullyQualifiedId3 } from "@dxos/react-client/echo";
|
|
962
1217
|
import { useIdentity } from "@dxos/react-client/halo";
|
|
963
|
-
import { Avatar,
|
|
1218
|
+
import { Avatar, Tooltip as Tooltip2, useTranslation as useTranslation18, List as List2, ListItem as ListItem2, useDefaultValue } from "@dxos/react-ui";
|
|
964
1219
|
import { AttentionGlyph, useAttended, useAttention } from "@dxos/react-ui-attention";
|
|
965
1220
|
import { ComplexMap, keyToFallback } from "@dxos/util";
|
|
966
1221
|
|
|
967
1222
|
// packages/plugins/plugin-space/src/hooks/usePath.ts
|
|
968
|
-
import { useEffect as useEffect3, useState as
|
|
1223
|
+
import { useEffect as useEffect3, useState as useState8 } from "react";
|
|
969
1224
|
var usePath = (graph, id, timeout) => {
|
|
970
|
-
const [pathState, setPathState] =
|
|
1225
|
+
const [pathState, setPathState] = useState8(id ? graph.getPath({
|
|
971
1226
|
target: id
|
|
972
1227
|
}) : void 0);
|
|
973
1228
|
useEffect3(() => {
|
|
@@ -1011,7 +1266,7 @@ var SpacePresence = ({ object, spaceKey }) => {
|
|
|
1011
1266
|
const identity = useIdentity();
|
|
1012
1267
|
const space = spaceKey ? client.spaces.get(spaceKey) : getSpace3(object);
|
|
1013
1268
|
const spaceMembers = useMembers(space?.key);
|
|
1014
|
-
const [_moment, setMoment] =
|
|
1269
|
+
const [_moment, setMoment] = useState9(Date.now());
|
|
1015
1270
|
useEffect4(() => {
|
|
1016
1271
|
const interval = setInterval(() => setMoment(Date.now()), REFRESH_INTERVAL);
|
|
1017
1272
|
return () => clearInterval(interval);
|
|
@@ -1023,7 +1278,7 @@ var SpacePresence = ({ object, spaceKey }) => {
|
|
|
1023
1278
|
if (!identity || !spaceState || !space) {
|
|
1024
1279
|
return null;
|
|
1025
1280
|
}
|
|
1026
|
-
const currentObjectViewers = spaceState.viewersByObject[
|
|
1281
|
+
const currentObjectViewers = spaceState.viewersByObject[fullyQualifiedId3(object)] ?? noViewers;
|
|
1027
1282
|
const membersForObject = spaceMembers.filter((member) => memberOnline(member) && memberIsNotSelf(member)).filter((member) => currentObjectViewers.has(member.identity.identityKey)).map((member) => {
|
|
1028
1283
|
const objectView = currentObjectViewers.get(member.identity.identityKey);
|
|
1029
1284
|
const lastSeen = objectView?.lastSeen ?? -Infinity;
|
|
@@ -1034,7 +1289,7 @@ var SpacePresence = ({ object, spaceKey }) => {
|
|
|
1034
1289
|
lastSeen
|
|
1035
1290
|
};
|
|
1036
1291
|
}).toSorted((a, b) => a.lastSeen - b.lastSeen);
|
|
1037
|
-
return /* @__PURE__ */
|
|
1292
|
+
return /* @__PURE__ */ React19.createElement(FullPresence, {
|
|
1038
1293
|
members: membersForObject
|
|
1039
1294
|
});
|
|
1040
1295
|
};
|
|
@@ -1044,63 +1299,60 @@ var FullPresence = (props) => {
|
|
|
1044
1299
|
if (members.length === 0) {
|
|
1045
1300
|
return null;
|
|
1046
1301
|
}
|
|
1047
|
-
return /* @__PURE__ */
|
|
1048
|
-
|
|
1049
|
-
classNames: "mbs-2 mie-4",
|
|
1302
|
+
return /* @__PURE__ */ React19.createElement("div", {
|
|
1303
|
+
className: "dx-avatar-group",
|
|
1050
1304
|
"data-testid": "spacePlugin.presence"
|
|
1051
|
-
}, members.slice(0, 3).map((member, i) => /* @__PURE__ */
|
|
1305
|
+
}, members.slice(0, 3).map((member, i) => /* @__PURE__ */ React19.createElement(Tooltip2.Root, {
|
|
1052
1306
|
key: member.identity.identityKey.toHex()
|
|
1053
|
-
}, /* @__PURE__ */
|
|
1307
|
+
}, /* @__PURE__ */ React19.createElement(Tooltip2.Trigger, null, /* @__PURE__ */ React19.createElement(PrensenceAvatar, {
|
|
1054
1308
|
identity: member.identity,
|
|
1055
|
-
group: true,
|
|
1056
1309
|
match: member.currentlyAttended,
|
|
1057
1310
|
index: members.length - i,
|
|
1058
|
-
onClick: () => onMemberClick?.(member)
|
|
1059
|
-
|
|
1311
|
+
onClick: () => onMemberClick?.(member),
|
|
1312
|
+
size
|
|
1313
|
+
})), /* @__PURE__ */ React19.createElement(Tooltip2.Portal, null, /* @__PURE__ */ React19.createElement(Tooltip2.Content, {
|
|
1060
1314
|
side: "bottom"
|
|
1061
|
-
}, /* @__PURE__ */
|
|
1062
|
-
status: "inactive"
|
|
1063
|
-
}, /* @__PURE__ */ React17.createElement(Avatar.Frame, {
|
|
1315
|
+
}, /* @__PURE__ */ React19.createElement("span", null, getName(member.identity)), /* @__PURE__ */ React19.createElement(Tooltip2.Arrow, null))))), members.length > 3 && /* @__PURE__ */ React19.createElement(Tooltip2.Root, null, /* @__PURE__ */ React19.createElement(Tooltip2.Trigger, null, /* @__PURE__ */ React19.createElement(Avatar.Root, null, /* @__PURE__ */ React19.createElement(Avatar.Content, {
|
|
1316
|
+
status: "inactive",
|
|
1064
1317
|
style: {
|
|
1065
1318
|
zIndex: members.length - 4
|
|
1066
|
-
}
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
})))), /* @__PURE__ */ React17.createElement(Tooltip2.Portal, null, /* @__PURE__ */ React17.createElement(Tooltip2.Content, {
|
|
1319
|
+
},
|
|
1320
|
+
fallback: `+${members.length - 3}`
|
|
1321
|
+
}))), /* @__PURE__ */ React19.createElement(Tooltip2.Portal, null, /* @__PURE__ */ React19.createElement(Tooltip2.Content, {
|
|
1070
1322
|
side: "bottom"
|
|
1071
|
-
}, /* @__PURE__ */
|
|
1323
|
+
}, /* @__PURE__ */ React19.createElement(Tooltip2.Arrow, null), /* @__PURE__ */ React19.createElement(List2, {
|
|
1072
1324
|
classNames: "max-h-56 overflow-y-auto"
|
|
1073
|
-
}, members.map((member) => /* @__PURE__ */
|
|
1325
|
+
}, members.map((member) => /* @__PURE__ */ React19.createElement(ListItem2.Root, {
|
|
1074
1326
|
key: member.identity.identityKey.toHex(),
|
|
1075
1327
|
classNames: "flex gap-2 items-center cursor-pointer mbe-2",
|
|
1076
1328
|
onClick: () => onMemberClick?.(member),
|
|
1077
1329
|
"data-testid": "identity-list-item"
|
|
1078
|
-
}, /* @__PURE__ */
|
|
1330
|
+
}, /* @__PURE__ */ React19.createElement(PrensenceAvatar, {
|
|
1079
1331
|
identity: member.identity,
|
|
1332
|
+
size,
|
|
1080
1333
|
showName: true,
|
|
1081
1334
|
match: member.currentlyAttended
|
|
1082
1335
|
}))))))));
|
|
1083
1336
|
};
|
|
1084
|
-
var PrensenceAvatar = ({ identity, showName, match,
|
|
1085
|
-
const Root = group ? AvatarGroupItem.Root : Avatar.Root;
|
|
1337
|
+
var PrensenceAvatar = ({ identity, showName, match, index, onClick, size }) => {
|
|
1086
1338
|
const status = match ? "current" : "active";
|
|
1087
1339
|
const fallbackValue = keyToFallback(identity.identityKey);
|
|
1088
|
-
return /* @__PURE__ */
|
|
1340
|
+
return /* @__PURE__ */ React19.createElement(Avatar.Root, null, /* @__PURE__ */ React19.createElement(Avatar.Content, {
|
|
1089
1341
|
status,
|
|
1090
|
-
hue: identity.profile?.data?.hue || fallbackValue.hue
|
|
1091
|
-
}, /* @__PURE__ */ React17.createElement(Avatar.Frame, {
|
|
1342
|
+
hue: identity.profile?.data?.hue || fallbackValue.hue,
|
|
1092
1343
|
"data-testid": "spacePlugin.presence.member",
|
|
1093
1344
|
"data-status": status,
|
|
1345
|
+
size,
|
|
1346
|
+
classNames: "mbs-2 mie-4",
|
|
1094
1347
|
...index ? {
|
|
1095
1348
|
style: {
|
|
1096
1349
|
zIndex: index
|
|
1097
1350
|
}
|
|
1098
1351
|
} : {},
|
|
1099
|
-
onClick: () => onClick?.()
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
classNames: "text-sm truncate pli-2"
|
|
1352
|
+
onClick: () => onClick?.(),
|
|
1353
|
+
fallback: identity.profile?.data?.emoji || fallbackValue.emoji
|
|
1354
|
+
}), /* @__PURE__ */ React19.createElement(Avatar.Label, {
|
|
1355
|
+
classNames: showName ? "text-sm truncate pli-2" : "sr-only"
|
|
1104
1356
|
}, getName(identity)));
|
|
1105
1357
|
};
|
|
1106
1358
|
var SmallPresenceLive = ({ id, open, viewers }) => {
|
|
@@ -1115,7 +1367,7 @@ var SmallPresenceLive = ({ id, open, viewers }) => {
|
|
|
1115
1367
|
const moment = Date.now();
|
|
1116
1368
|
return Array.from(viewers2.values()).filter((viewer) => moment - viewer.lastSeen < ACTIVITY_DURATION);
|
|
1117
1369
|
};
|
|
1118
|
-
const [activeViewers, setActiveViewers] =
|
|
1370
|
+
const [activeViewers, setActiveViewers] = useState9(viewers ? getActiveViewers(viewers) : []);
|
|
1119
1371
|
useEffect4(() => {
|
|
1120
1372
|
if (viewers) {
|
|
1121
1373
|
setActiveViewers(getActiveViewers(viewers));
|
|
@@ -1127,62 +1379,59 @@ var SmallPresenceLive = ({ id, open, viewers }) => {
|
|
|
1127
1379
|
}, [
|
|
1128
1380
|
viewers
|
|
1129
1381
|
]);
|
|
1130
|
-
return /* @__PURE__ */
|
|
1382
|
+
return /* @__PURE__ */ React19.createElement(SmallPresence, {
|
|
1131
1383
|
count: activeViewers.length,
|
|
1132
1384
|
attended: isAttended,
|
|
1133
1385
|
containsAttended
|
|
1134
1386
|
});
|
|
1135
1387
|
};
|
|
1136
1388
|
var SmallPresence = ({ count = 0, attended, containsAttended }) => {
|
|
1137
|
-
const { t } =
|
|
1138
|
-
return /* @__PURE__ */
|
|
1389
|
+
const { t } = useTranslation18(SPACE_PLUGIN);
|
|
1390
|
+
return /* @__PURE__ */ React19.createElement(Tooltip2.Root, null, /* @__PURE__ */ React19.createElement(Tooltip2.Trigger, {
|
|
1139
1391
|
asChild: true
|
|
1140
|
-
}, /* @__PURE__ */
|
|
1392
|
+
}, /* @__PURE__ */ React19.createElement(AttentionGlyph, {
|
|
1141
1393
|
attended,
|
|
1142
1394
|
containsAttended,
|
|
1143
1395
|
presence: count > 1 ? "many" : count === 1 ? "one" : "none",
|
|
1144
1396
|
classNames: "self-center mie-1"
|
|
1145
|
-
})), /* @__PURE__ */
|
|
1397
|
+
})), /* @__PURE__ */ React19.createElement(Tooltip2.Portal, null, /* @__PURE__ */ React19.createElement(Tooltip2.Content, {
|
|
1146
1398
|
side: "bottom"
|
|
1147
|
-
}, /* @__PURE__ */
|
|
1399
|
+
}, /* @__PURE__ */ React19.createElement("span", null, t("presence label", {
|
|
1148
1400
|
count
|
|
1149
|
-
})), /* @__PURE__ */
|
|
1401
|
+
})), /* @__PURE__ */ React19.createElement(Tooltip2.Arrow, null))));
|
|
1150
1402
|
};
|
|
1151
1403
|
|
|
1152
1404
|
// packages/plugins/plugin-space/src/components/SpacePluginSettings.tsx
|
|
1153
|
-
import
|
|
1154
|
-
import { Input as Input4, useTranslation as
|
|
1405
|
+
import React20 from "react";
|
|
1406
|
+
import { Input as Input4, useTranslation as useTranslation19 } from "@dxos/react-ui";
|
|
1155
1407
|
import { DeprecatedFormContainer, DeprecatedFormInput } from "@dxos/react-ui-form";
|
|
1156
1408
|
var SpacePluginSettings = ({ settings }) => {
|
|
1157
|
-
const { t } =
|
|
1158
|
-
return /* @__PURE__ */
|
|
1409
|
+
const { t } = useTranslation19(SPACE_PLUGIN);
|
|
1410
|
+
return /* @__PURE__ */ React20.createElement(DeprecatedFormContainer, null, /* @__PURE__ */ React20.createElement(DeprecatedFormInput, {
|
|
1159
1411
|
label: t("show hidden spaces label")
|
|
1160
|
-
}, /* @__PURE__ */
|
|
1412
|
+
}, /* @__PURE__ */ React20.createElement(Input4.Switch, {
|
|
1161
1413
|
checked: settings.showHidden,
|
|
1162
1414
|
onCheckedChange: (checked) => settings.showHidden = !!checked
|
|
1163
1415
|
})));
|
|
1164
1416
|
};
|
|
1165
1417
|
|
|
1166
|
-
// packages/plugins/plugin-space/src/components/SpaceSettings/
|
|
1167
|
-
import
|
|
1418
|
+
// packages/plugins/plugin-space/src/components/SpaceSettings/SpacePropertiesForm.tsx
|
|
1419
|
+
import React21, { useCallback as useCallback11, useMemo as useMemo3, useState as useState10 } from "react";
|
|
1168
1420
|
import { log as log3 } from "@dxos/log";
|
|
1169
1421
|
import { EdgeReplicationSetting } from "@dxos/protocols/proto/dxos/echo/metadata";
|
|
1170
|
-
import {
|
|
1171
|
-
import {
|
|
1172
|
-
import { DeprecatedFormContainer as DeprecatedFormContainer2, DeprecatedFormInput as DeprecatedFormInput2 } from "@dxos/react-ui-form";
|
|
1422
|
+
import { Input as Input5, useTranslation as useTranslation20 } from "@dxos/react-ui";
|
|
1423
|
+
import { Form as Form4, ControlItem, ControlItemInput } from "@dxos/react-ui-form";
|
|
1173
1424
|
import { HuePicker, IconPicker } from "@dxos/react-ui-pickers";
|
|
1174
|
-
var __dxlog_file5 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/SpaceSettings/
|
|
1175
|
-
var
|
|
1176
|
-
const { t } =
|
|
1177
|
-
const
|
|
1178
|
-
const edgeEnabled = Boolean(client.config.values.runtime?.client?.edgeFeatures?.echoReplicator);
|
|
1179
|
-
const [edgeReplication, setEdgeReplication] = useState9(space.internal.data.edgeReplication === EdgeReplicationSetting.ENABLED);
|
|
1425
|
+
var __dxlog_file5 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/SpaceSettings/SpacePropertiesForm.tsx";
|
|
1426
|
+
var SpacePropertiesForm = ({ space }) => {
|
|
1427
|
+
const { t } = useTranslation20(SPACE_PLUGIN);
|
|
1428
|
+
const [edgeReplication, setEdgeReplication] = useState10(space.internal.data.edgeReplication === EdgeReplicationSetting.ENABLED);
|
|
1180
1429
|
const toggleEdgeReplication = useCallback11(async (next) => {
|
|
1181
1430
|
setEdgeReplication(next);
|
|
1182
1431
|
await space?.internal.setEdgeReplicationPreference(next ? EdgeReplicationSetting.ENABLED : EdgeReplicationSetting.DISABLED).catch((err) => {
|
|
1183
1432
|
log3.catch(err, void 0, {
|
|
1184
1433
|
F: __dxlog_file5,
|
|
1185
|
-
L:
|
|
1434
|
+
L: 34,
|
|
1186
1435
|
S: void 0,
|
|
1187
1436
|
C: (f, a) => f(...a)
|
|
1188
1437
|
});
|
|
@@ -1191,155 +1440,172 @@ var SpaceSettingsPanel = ({ space }) => {
|
|
|
1191
1440
|
}, [
|
|
1192
1441
|
space
|
|
1193
1442
|
]);
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
value: space.properties.name ?? "",
|
|
1199
|
-
onChange: (event) => {
|
|
1200
|
-
space.properties.name = event.target.value;
|
|
1443
|
+
const handleSave = useCallback11((properties) => {
|
|
1444
|
+
void toggleEdgeReplication(properties.edgeReplication);
|
|
1445
|
+
if (properties.name !== space.properties.name) {
|
|
1446
|
+
space.properties.name = properties.name;
|
|
1201
1447
|
}
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
}, /* @__PURE__ */ React19.createElement(Toolbar.Root, null, /* @__PURE__ */ React19.createElement(IconPicker, {
|
|
1205
|
-
value: space.properties.icon,
|
|
1206
|
-
onChange: (nextIcon) => space.properties.icon = nextIcon,
|
|
1207
|
-
onReset: () => {
|
|
1208
|
-
space.properties.icon = void 0;
|
|
1448
|
+
if (properties.icon !== space.properties.icon) {
|
|
1449
|
+
space.properties.icon = properties.icon;
|
|
1209
1450
|
}
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
}, /* @__PURE__ */ React19.createElement(Toolbar.Root, null, /* @__PURE__ */ React19.createElement(HuePicker, {
|
|
1213
|
-
value: space.properties.hue,
|
|
1214
|
-
onChange: (nextHue) => space.properties.hue = nextHue,
|
|
1215
|
-
onReset: () => {
|
|
1216
|
-
space.properties.hue = void 0;
|
|
1451
|
+
if (properties.hue !== space.properties.hue) {
|
|
1452
|
+
space.properties.hue = properties.hue;
|
|
1217
1453
|
}
|
|
1218
|
-
}
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1454
|
+
}, [
|
|
1455
|
+
space,
|
|
1456
|
+
toggleEdgeReplication
|
|
1457
|
+
]);
|
|
1458
|
+
const values = useMemo3(() => ({
|
|
1459
|
+
name: space.properties.name,
|
|
1460
|
+
icon: space.properties.icon,
|
|
1461
|
+
hue: space.properties.hue,
|
|
1462
|
+
edgeReplication
|
|
1463
|
+
}), [
|
|
1464
|
+
space.properties.name,
|
|
1465
|
+
space.properties.icon,
|
|
1466
|
+
space.properties.hue,
|
|
1467
|
+
edgeReplication
|
|
1468
|
+
]);
|
|
1469
|
+
const customElements = useMemo3(() => ({
|
|
1470
|
+
name: ({ type, label, getValue, onValueChange }) => {
|
|
1471
|
+
const handleChange = useCallback11(({ target: { value } }) => onValueChange(type, value), [
|
|
1472
|
+
onValueChange,
|
|
1473
|
+
type
|
|
1474
|
+
]);
|
|
1475
|
+
return /* @__PURE__ */ React21.createElement(ControlItemInput, {
|
|
1476
|
+
title: label,
|
|
1477
|
+
description: t("display name description")
|
|
1478
|
+
}, /* @__PURE__ */ React21.createElement(Input5.TextInput, {
|
|
1479
|
+
value: getValue(),
|
|
1480
|
+
onChange: handleChange,
|
|
1481
|
+
placeholder: t("display name input placeholder"),
|
|
1482
|
+
classNames: "min-is-64"
|
|
1483
|
+
}));
|
|
1484
|
+
},
|
|
1485
|
+
icon: ({ type, label, getValue, onValueChange }) => {
|
|
1486
|
+
const handleChange = useCallback11((nextEmoji) => onValueChange(type, nextEmoji), [
|
|
1487
|
+
onValueChange,
|
|
1488
|
+
type
|
|
1489
|
+
]);
|
|
1490
|
+
const handleEmojiReset = useCallback11(() => onValueChange(type, void 0), [
|
|
1491
|
+
onValueChange,
|
|
1492
|
+
type
|
|
1493
|
+
]);
|
|
1494
|
+
return /* @__PURE__ */ React21.createElement(ControlItem, {
|
|
1495
|
+
title: label,
|
|
1496
|
+
description: t("icon description")
|
|
1497
|
+
}, /* @__PURE__ */ React21.createElement(IconPicker, {
|
|
1498
|
+
value: getValue(),
|
|
1499
|
+
onChange: handleChange,
|
|
1500
|
+
onReset: handleEmojiReset,
|
|
1501
|
+
classNames: "justify-self-end",
|
|
1502
|
+
iconSize: 5
|
|
1503
|
+
}));
|
|
1504
|
+
},
|
|
1505
|
+
hue: ({ type, label, getValue, onValueChange }) => {
|
|
1506
|
+
const handleChange = useCallback11((nextHue) => onValueChange(type, nextHue), [
|
|
1507
|
+
onValueChange,
|
|
1508
|
+
type
|
|
1509
|
+
]);
|
|
1510
|
+
const handleHueReset = useCallback11(() => onValueChange(type, void 0), [
|
|
1511
|
+
onValueChange,
|
|
1512
|
+
type
|
|
1513
|
+
]);
|
|
1514
|
+
return /* @__PURE__ */ React21.createElement(ControlItem, {
|
|
1515
|
+
title: label,
|
|
1516
|
+
description: t("hue description")
|
|
1517
|
+
}, /* @__PURE__ */ React21.createElement(HuePicker, {
|
|
1518
|
+
value: getValue(),
|
|
1519
|
+
onChange: handleChange,
|
|
1520
|
+
onReset: handleHueReset,
|
|
1521
|
+
classNames: "[--hue-preview-size:1.25rem] justify-self-end"
|
|
1522
|
+
}));
|
|
1523
|
+
},
|
|
1524
|
+
edgeReplication: ({ type, label, getValue, onValueChange }) => {
|
|
1525
|
+
const handleChange = useCallback11((checked) => onValueChange(type, checked), [
|
|
1526
|
+
onValueChange,
|
|
1527
|
+
type
|
|
1528
|
+
]);
|
|
1529
|
+
return /* @__PURE__ */ React21.createElement(ControlItemInput, {
|
|
1530
|
+
title: label,
|
|
1531
|
+
description: t("edge replication description")
|
|
1532
|
+
}, /* @__PURE__ */ React21.createElement(Input5.Switch, {
|
|
1533
|
+
checked: getValue(),
|
|
1534
|
+
onCheckedChange: handleChange,
|
|
1535
|
+
classNames: "justify-self-end"
|
|
1536
|
+
}));
|
|
1537
|
+
}
|
|
1538
|
+
}), [
|
|
1539
|
+
t
|
|
1540
|
+
]);
|
|
1541
|
+
return /* @__PURE__ */ React21.createElement(Form4, {
|
|
1542
|
+
schema: SpaceForm,
|
|
1543
|
+
values,
|
|
1544
|
+
autoSave: true,
|
|
1545
|
+
onSave: handleSave,
|
|
1546
|
+
Custom: customElements,
|
|
1547
|
+
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'
|
|
1548
|
+
});
|
|
1224
1549
|
};
|
|
1225
1550
|
|
|
1226
|
-
// packages/plugins/plugin-space/src/components/SpaceSettings/
|
|
1227
|
-
import
|
|
1228
|
-
import { Surface as
|
|
1229
|
-
import {
|
|
1230
|
-
import {
|
|
1231
|
-
import {
|
|
1232
|
-
import {
|
|
1551
|
+
// packages/plugins/plugin-space/src/components/SpaceSettings/SpaceSettingsContainer.tsx
|
|
1552
|
+
import React22, { useCallback as useCallback12, useMemo as useMemo4 } from "react";
|
|
1553
|
+
import { Surface as Surface3, useCapabilities as useCapabilities2, useCapability as useCapability2 } from "@dxos/app-framework";
|
|
1554
|
+
import { toLocalizedString as toLocalizedString3, useTranslation as useTranslation21 } from "@dxos/react-ui";
|
|
1555
|
+
import { ControlSectionHeading } from "@dxos/react-ui-form";
|
|
1556
|
+
import { Accordion } from "@dxos/react-ui-list";
|
|
1557
|
+
import { StackItem as StackItem3 } from "@dxos/react-ui-stack";
|
|
1558
|
+
import { byPosition } from "@dxos/util";
|
|
1233
1559
|
var SPACE_SETTINGS_DIALOG = `${SPACE_PLUGIN}/SpaceSettingsDialog`;
|
|
1234
|
-
var
|
|
1235
|
-
const { t } =
|
|
1236
|
-
const
|
|
1237
|
-
const
|
|
1238
|
-
const
|
|
1239
|
-
const locked = space.properties[COMPOSER_SPACE_LOCK];
|
|
1240
|
-
const name = getSpaceDisplayName(space, {
|
|
1241
|
-
personal: client.spaces.default === space,
|
|
1242
|
-
namesCache
|
|
1243
|
-
});
|
|
1244
|
-
const panels = useCapabilities2(SpaceCapabilities.SettingsPanel);
|
|
1245
|
-
const data = useMemo(() => ({
|
|
1560
|
+
var SpaceSettingsContainer = ({ space }) => {
|
|
1561
|
+
const { t } = useTranslation21(SPACE_PLUGIN);
|
|
1562
|
+
const state = useCapability2(SpaceCapabilities.MutableState);
|
|
1563
|
+
const items = useCapabilities2(SpaceCapabilities.SettingsSection).toSorted(byPosition);
|
|
1564
|
+
const data = useMemo4(() => ({
|
|
1246
1565
|
subject: space
|
|
1247
1566
|
}), [
|
|
1248
1567
|
space
|
|
1249
1568
|
]);
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
density: "fine",
|
|
1275
|
-
variant: "ghost",
|
|
1276
|
-
autoFocus: true
|
|
1277
|
-
}, /* @__PURE__ */ React20.createElement(Icon4, {
|
|
1278
|
-
icon: "ph--x--regular",
|
|
1279
|
-
size: 4
|
|
1280
|
-
})))), /* @__PURE__ */ React20.createElement(Tabs.Root, {
|
|
1281
|
-
orientation: "vertical",
|
|
1282
|
-
value: selected,
|
|
1283
|
-
onValueChange: setSelected,
|
|
1284
|
-
activePart: tabsActivePart,
|
|
1285
|
-
onActivePartChange: setTabsActivePart,
|
|
1286
|
-
classNames: "flex flex-col flex-1 mbs-2"
|
|
1287
|
-
}, /* @__PURE__ */ React20.createElement(Tabs.Viewport, {
|
|
1288
|
-
classNames: "flex-1 min-bs-0"
|
|
1289
|
-
}, /* @__PURE__ */ React20.createElement("div", {
|
|
1290
|
-
role: "none",
|
|
1291
|
-
className: "overflow-y-auto pli-3 @md:pis-2 @md:pie-0 mbe-4 border-r border-separator"
|
|
1292
|
-
}, /* @__PURE__ */ React20.createElement(Tabs.Tablist, {
|
|
1293
|
-
classNames: "flex flex-col max-bs-none min-is-[200px] gap-4 overflow-y-auto"
|
|
1294
|
-
}, /* @__PURE__ */ React20.createElement("div", {
|
|
1295
|
-
role: "none",
|
|
1296
|
-
className: "flex flex-col ml-1"
|
|
1297
|
-
}, /* @__PURE__ */ React20.createElement(Tabs.Tab, {
|
|
1298
|
-
value: "settings"
|
|
1299
|
-
}, t("settings tab label")), /* @__PURE__ */ React20.createElement(Tabs.Tab, {
|
|
1300
|
-
value: "members",
|
|
1301
|
-
disabled: locked
|
|
1302
|
-
}, t("members tab label")), panels.map((panel) => /* @__PURE__ */ React20.createElement(Tabs.Tab, {
|
|
1303
|
-
key: panel.id,
|
|
1304
|
-
value: panel.id
|
|
1305
|
-
}, toLocalizedString3(panel.label, t)))))), /* @__PURE__ */ React20.createElement(Tabs.Tabpanel, {
|
|
1306
|
-
value: "settings",
|
|
1307
|
-
classNames: "pli-3 @md:pli-5 max-bs-dvh overflow-y-auto"
|
|
1308
|
-
}, /* @__PURE__ */ React20.createElement(SpaceSettingsPanel, {
|
|
1309
|
-
space
|
|
1310
|
-
})), /* @__PURE__ */ React20.createElement(Tabs.Tabpanel, {
|
|
1311
|
-
value: "members",
|
|
1312
|
-
classNames: "pli-3 @md:pli-5 max-bs-dvh overflow-y-auto"
|
|
1313
|
-
}, /* @__PURE__ */ React20.createElement(Clipboard.Provider, null, /* @__PURE__ */ React20.createElement(SpacePanel, {
|
|
1314
|
-
space,
|
|
1315
|
-
hideHeading: true,
|
|
1316
|
-
target,
|
|
1317
|
-
createInvitationUrl
|
|
1318
|
-
}))), panels.map((panel) => /* @__PURE__ */ React20.createElement(Tabs.Tabpanel, {
|
|
1319
|
-
key: panel.id,
|
|
1320
|
-
value: panel.id,
|
|
1321
|
-
classNames: "pli-3 @md:pli-5 max-bs-dvh overflow-y-auto"
|
|
1322
|
-
}, /* @__PURE__ */ React20.createElement(Surface2, {
|
|
1323
|
-
role: `space-settings--${panel.id}`,
|
|
1324
|
-
data
|
|
1325
|
-
}))))))
|
|
1326
|
-
);
|
|
1569
|
+
const handleOpenSectionChange = useCallback12((sections) => {
|
|
1570
|
+
state.spaceSettingsOpenSections.splice(0, state.spaceSettingsOpenSections.length, ...sections);
|
|
1571
|
+
}, [
|
|
1572
|
+
state
|
|
1573
|
+
]);
|
|
1574
|
+
return /* @__PURE__ */ React22.createElement(StackItem3.Content, {
|
|
1575
|
+
classNames: "p-2 block overflow-y-auto"
|
|
1576
|
+
}, /* @__PURE__ */ React22.createElement(Accordion.Root, {
|
|
1577
|
+
items,
|
|
1578
|
+
value: state.spaceSettingsOpenSections,
|
|
1579
|
+
onValueChange: handleOpenSectionChange
|
|
1580
|
+
}, ({ items: items2 }) => /* @__PURE__ */ React22.createElement(React22.Fragment, null, items2.map((item) => /* @__PURE__ */ React22.createElement(Accordion.Item, {
|
|
1581
|
+
key: item.id,
|
|
1582
|
+
item,
|
|
1583
|
+
classNames: "container-max-width"
|
|
1584
|
+
}, /* @__PURE__ */ React22.createElement(Accordion.ItemHeader, {
|
|
1585
|
+
classNames: "pie-6",
|
|
1586
|
+
asChild: true
|
|
1587
|
+
}, /* @__PURE__ */ React22.createElement(ControlSectionHeading, {
|
|
1588
|
+
title: toLocalizedString3(item.label, t)
|
|
1589
|
+
})), /* @__PURE__ */ React22.createElement(Accordion.ItemBody, null, /* @__PURE__ */ React22.createElement(Surface3, {
|
|
1590
|
+
role: `space-settings--${item.id}`,
|
|
1591
|
+
data
|
|
1592
|
+
})))))));
|
|
1327
1593
|
};
|
|
1328
1594
|
|
|
1329
1595
|
// packages/plugins/plugin-space/src/components/SyncStatus/InlineSyncStatus.tsx
|
|
1330
|
-
import
|
|
1596
|
+
import React23, { useEffect as useEffect6, useState as useState12 } from "react";
|
|
1331
1597
|
import { useAppGraph as useAppGraph3 } from "@dxos/app-framework";
|
|
1332
1598
|
import { QueryEdgeStatusResponse } from "@dxos/protocols/proto/dxos/client/services";
|
|
1333
1599
|
import { EdgeReplicationSetting as EdgeReplicationSetting2 } from "@dxos/protocols/proto/dxos/echo/metadata";
|
|
1334
|
-
import { useClient as
|
|
1335
|
-
import { Tooltip as Tooltip3, useTranslation as
|
|
1600
|
+
import { useClient as useClient7 } from "@dxos/react-client";
|
|
1601
|
+
import { Tooltip as Tooltip3, useTranslation as useTranslation22 } from "@dxos/react-ui";
|
|
1336
1602
|
import { AttentionGlyph as AttentionGlyph2, useAttended as useAttended2, useAttention as useAttention2 } from "@dxos/react-ui-attention";
|
|
1337
1603
|
|
|
1338
1604
|
// packages/plugins/plugin-space/src/components/SyncStatus/sync-state.ts
|
|
1339
1605
|
import { useEffect as useEffect5, useState as useState11 } from "react";
|
|
1340
1606
|
import { Context } from "@dxos/context";
|
|
1341
1607
|
import { EdgeService } from "@dxos/protocols";
|
|
1342
|
-
import { useClient as
|
|
1608
|
+
import { useClient as useClient6 } from "@dxos/react-client";
|
|
1343
1609
|
var __dxlog_file6 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/SyncStatus/sync-state.ts";
|
|
1344
1610
|
var createEmptyEdgeSyncState = () => ({
|
|
1345
1611
|
missingOnLocal: 0,
|
|
@@ -1360,7 +1626,7 @@ var getSyncSummary = (syncMap) => {
|
|
|
1360
1626
|
};
|
|
1361
1627
|
var isEdgePeerId = (peerId, spaceId) => peerId.startsWith(`${EdgeService.AUTOMERGE_REPLICATOR}:${spaceId}`);
|
|
1362
1628
|
var useSyncState = () => {
|
|
1363
|
-
const client =
|
|
1629
|
+
const client = useClient6();
|
|
1364
1630
|
const [spaceState, setSpaceState] = useState11({});
|
|
1365
1631
|
useEffect5(() => {
|
|
1366
1632
|
const ctx = new Context(void 0, {
|
|
@@ -1420,7 +1686,7 @@ var useSpaceSyncState = (space) => {
|
|
|
1420
1686
|
// packages/plugins/plugin-space/src/components/SyncStatus/InlineSyncStatus.tsx
|
|
1421
1687
|
var useEdgeStatus = () => {
|
|
1422
1688
|
const [status, setStatus] = useState12(QueryEdgeStatusResponse.EdgeStatus.NOT_CONNECTED);
|
|
1423
|
-
const client =
|
|
1689
|
+
const client = useClient7();
|
|
1424
1690
|
useEffect6(() => {
|
|
1425
1691
|
client.services.services.EdgeAgentService?.queryEdgeStatus().subscribe(({ status: status2 }) => {
|
|
1426
1692
|
setStatus(status2);
|
|
@@ -1431,7 +1697,7 @@ var useEdgeStatus = () => {
|
|
|
1431
1697
|
return status;
|
|
1432
1698
|
};
|
|
1433
1699
|
var InlineSyncStatus = ({ space, open }) => {
|
|
1434
|
-
const { t } =
|
|
1700
|
+
const { t } = useTranslation22(SPACE_PLUGIN);
|
|
1435
1701
|
const id = space.id;
|
|
1436
1702
|
const { hasAttention, isAncestor, isRelated } = useAttention2(id);
|
|
1437
1703
|
const isAttended = hasAttention || isAncestor || isRelated;
|
|
@@ -1444,33 +1710,33 @@ var InlineSyncStatus = ({ space, open }) => {
|
|
|
1444
1710
|
const edgeSyncEnabled = space.internal.data.edgeReplication === EdgeReplicationSetting2.ENABLED;
|
|
1445
1711
|
const syncState = useSpaceSyncState(space);
|
|
1446
1712
|
const syncing = connectedToEdge && edgeSyncEnabled && syncState && syncState.missingOnLocal > 0;
|
|
1447
|
-
return /* @__PURE__ */
|
|
1713
|
+
return /* @__PURE__ */ React23.createElement(Tooltip3.Root, null, /* @__PURE__ */ React23.createElement(Tooltip3.Trigger, {
|
|
1448
1714
|
asChild: true
|
|
1449
|
-
}, /* @__PURE__ */
|
|
1715
|
+
}, /* @__PURE__ */ React23.createElement(AttentionGlyph2, {
|
|
1450
1716
|
syncing,
|
|
1451
1717
|
attended: isAttended,
|
|
1452
1718
|
containsAttended,
|
|
1453
1719
|
classNames: "self-center mie-1"
|
|
1454
|
-
})), /* @__PURE__ */
|
|
1720
|
+
})), /* @__PURE__ */ React23.createElement(Tooltip3.Portal, null, /* @__PURE__ */ React23.createElement(Tooltip3.Content, {
|
|
1455
1721
|
side: "bottom",
|
|
1456
1722
|
classNames: "z-[70]"
|
|
1457
|
-
}, /* @__PURE__ */
|
|
1723
|
+
}, /* @__PURE__ */ React23.createElement("span", null, t("syncing label")), /* @__PURE__ */ React23.createElement(Tooltip3.Arrow, null))));
|
|
1458
1724
|
};
|
|
1459
1725
|
|
|
1460
1726
|
// packages/plugins/plugin-space/src/components/SyncStatus/SyncStatus.tsx
|
|
1461
|
-
import
|
|
1727
|
+
import React25, { useCallback as useCallback13, useEffect as useEffect8, useState as useState14 } from "react";
|
|
1462
1728
|
import { StatusBar } from "@dxos/plugin-status-bar";
|
|
1463
|
-
import { useClient as
|
|
1464
|
-
import { Icon as Icon6, Input as Input6, Popover as Popover3, useTranslation as
|
|
1729
|
+
import { useClient as useClient9 } from "@dxos/react-client";
|
|
1730
|
+
import { Icon as Icon6, Input as Input6, Popover as Popover3, useTranslation as useTranslation24 } from "@dxos/react-ui";
|
|
1465
1731
|
import { SyntaxHighlighter } from "@dxos/react-ui-syntax-highlighter";
|
|
1466
|
-
import { mx as
|
|
1732
|
+
import { mx as mx8 } from "@dxos/react-ui-theme";
|
|
1467
1733
|
|
|
1468
1734
|
// packages/plugins/plugin-space/src/components/SyncStatus/Space.tsx
|
|
1469
|
-
import
|
|
1470
|
-
import { useClient as
|
|
1735
|
+
import React24, { useEffect as useEffect7, useState as useState13 } from "react";
|
|
1736
|
+
import { useClient as useClient8 } from "@dxos/react-client";
|
|
1471
1737
|
import { useSpace } from "@dxos/react-client/echo";
|
|
1472
|
-
import { Icon as Icon5, toLocalizedString as toLocalizedString4, useTranslation as
|
|
1473
|
-
import { mx as
|
|
1738
|
+
import { Icon as Icon5, toLocalizedString as toLocalizedString4, useTranslation as useTranslation23 } from "@dxos/react-ui";
|
|
1739
|
+
import { mx as mx7 } from "@dxos/react-ui-theme";
|
|
1474
1740
|
var SYNC_STALLED_TIMEOUT = 5e3;
|
|
1475
1741
|
var styles = {
|
|
1476
1742
|
barBg: "bg-neutral-50 dark:bg-green-900 text-black",
|
|
@@ -1501,8 +1767,8 @@ var useActive = (count) => {
|
|
|
1501
1767
|
return active;
|
|
1502
1768
|
};
|
|
1503
1769
|
var SpaceRowContainer = ({ spaceId, state }) => {
|
|
1504
|
-
const { t } =
|
|
1505
|
-
const client =
|
|
1770
|
+
const { t } = useTranslation23(SPACE_PLUGIN);
|
|
1771
|
+
const client = useClient8();
|
|
1506
1772
|
const space = useSpace(spaceId);
|
|
1507
1773
|
if (!space) {
|
|
1508
1774
|
return null;
|
|
@@ -1510,7 +1776,7 @@ var SpaceRowContainer = ({ spaceId, state }) => {
|
|
|
1510
1776
|
const spaceName = toLocalizedString4(getSpaceDisplayName(space, {
|
|
1511
1777
|
personal: space === client.spaces.default
|
|
1512
1778
|
}), t);
|
|
1513
|
-
return /* @__PURE__ */
|
|
1779
|
+
return /* @__PURE__ */ React24.createElement(SpaceRow, {
|
|
1514
1780
|
spaceId,
|
|
1515
1781
|
spaceName,
|
|
1516
1782
|
state
|
|
@@ -1519,19 +1785,19 @@ var SpaceRowContainer = ({ spaceId, state }) => {
|
|
|
1519
1785
|
var SpaceRow = ({ spaceId, spaceName, state: { localDocumentCount, remoteDocumentCount, missingOnLocal, missingOnRemote } }) => {
|
|
1520
1786
|
const downActive = useActive(localDocumentCount);
|
|
1521
1787
|
const upActive = useActive(remoteDocumentCount);
|
|
1522
|
-
return /* @__PURE__ */
|
|
1788
|
+
return /* @__PURE__ */ React24.createElement("div", {
|
|
1523
1789
|
className: "flex items-center mx-0.5 gap-0.5 cursor-pointer",
|
|
1524
1790
|
title: spaceId,
|
|
1525
1791
|
onClick: () => {
|
|
1526
1792
|
void navigator.clipboard.writeText(spaceId);
|
|
1527
1793
|
}
|
|
1528
|
-
}, /* @__PURE__ */
|
|
1794
|
+
}, /* @__PURE__ */ React24.createElement("span", {
|
|
1529
1795
|
className: "is-1/2 truncate"
|
|
1530
|
-
}, spaceName), /* @__PURE__ */
|
|
1796
|
+
}, spaceName), /* @__PURE__ */ React24.createElement(Icon5, {
|
|
1531
1797
|
icon: "ph--arrow-fat-line-left--regular",
|
|
1532
1798
|
size: 3,
|
|
1533
|
-
classNames:
|
|
1534
|
-
}), /* @__PURE__ */
|
|
1799
|
+
classNames: mx7(downActive && "animate-[pulse_1s_infinite]")
|
|
1800
|
+
}), /* @__PURE__ */ React24.createElement(Candle, {
|
|
1535
1801
|
up: {
|
|
1536
1802
|
count: remoteDocumentCount,
|
|
1537
1803
|
total: remoteDocumentCount + missingOnRemote
|
|
@@ -1541,37 +1807,37 @@ var SpaceRow = ({ spaceId, spaceName, state: { localDocumentCount, remoteDocumen
|
|
|
1541
1807
|
total: localDocumentCount + missingOnLocal
|
|
1542
1808
|
},
|
|
1543
1809
|
title: spaceId
|
|
1544
|
-
}), /* @__PURE__ */
|
|
1810
|
+
}), /* @__PURE__ */ React24.createElement(Icon5, {
|
|
1545
1811
|
icon: "ph--arrow-fat-line-right--regular",
|
|
1546
1812
|
size: 3,
|
|
1547
|
-
classNames:
|
|
1813
|
+
classNames: mx7(upActive && "animate-[pulse_1s_step-start_infinite]")
|
|
1548
1814
|
}));
|
|
1549
1815
|
};
|
|
1550
1816
|
var Candle = ({ classNames, up, down }) => {
|
|
1551
|
-
return /* @__PURE__ */
|
|
1552
|
-
className:
|
|
1553
|
-
}, /* @__PURE__ */
|
|
1817
|
+
return /* @__PURE__ */ React24.createElement("div", {
|
|
1818
|
+
className: mx7("grid grid-cols-[1fr_2rem_1fr] w-full h-3", classNames)
|
|
1819
|
+
}, /* @__PURE__ */ React24.createElement(Bar, {
|
|
1554
1820
|
classNames: "justify-end",
|
|
1555
1821
|
...up
|
|
1556
|
-
}), /* @__PURE__ */
|
|
1822
|
+
}), /* @__PURE__ */ React24.createElement("div", {
|
|
1557
1823
|
className: "relative"
|
|
1558
|
-
}, /* @__PURE__ */
|
|
1559
|
-
className:
|
|
1560
|
-
}, up.total)), /* @__PURE__ */
|
|
1824
|
+
}, /* @__PURE__ */ React24.createElement("div", {
|
|
1825
|
+
className: mx7("absolute inset-0 flex items-center justify-center text-xs", styles.barBg)
|
|
1826
|
+
}, up.total)), /* @__PURE__ */ React24.createElement(Bar, down));
|
|
1561
1827
|
};
|
|
1562
1828
|
var Bar = ({ classNames, count, total }) => {
|
|
1563
1829
|
let p = count / total * 100;
|
|
1564
1830
|
if (count < total) {
|
|
1565
1831
|
p = Math.min(p, 95);
|
|
1566
1832
|
}
|
|
1567
|
-
return /* @__PURE__ */
|
|
1568
|
-
className:
|
|
1569
|
-
}, /* @__PURE__ */
|
|
1570
|
-
className:
|
|
1833
|
+
return /* @__PURE__ */ React24.createElement("div", {
|
|
1834
|
+
className: mx7("relative flex w-full", styles.barBg, classNames)
|
|
1835
|
+
}, /* @__PURE__ */ React24.createElement("div", {
|
|
1836
|
+
className: mx7("shrink-0", styles.barFg),
|
|
1571
1837
|
style: {
|
|
1572
1838
|
width: `${p}%`
|
|
1573
1839
|
}
|
|
1574
|
-
}), count !== total && /* @__PURE__ */
|
|
1840
|
+
}), count !== total && /* @__PURE__ */ React24.createElement("div", {
|
|
1575
1841
|
className: "absolute top-0 bottom-0 flex items-center mx-0.5 text-black text-xs"
|
|
1576
1842
|
}, count));
|
|
1577
1843
|
};
|
|
@@ -1580,7 +1846,7 @@ var Bar = ({ classNames, count, total }) => {
|
|
|
1580
1846
|
import { Context as Context2 } from "@dxos/context";
|
|
1581
1847
|
var __dxlog_file7 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/SyncStatus/save-tracker.ts";
|
|
1582
1848
|
var createClientSaveTracker = (client, cb) => {
|
|
1583
|
-
const
|
|
1849
|
+
const CleanupFns = {};
|
|
1584
1850
|
const state = {};
|
|
1585
1851
|
const install = (spaces) => {
|
|
1586
1852
|
for (const space of spaces) {
|
|
@@ -1588,7 +1854,7 @@ var createClientSaveTracker = (client, cb) => {
|
|
|
1588
1854
|
continue;
|
|
1589
1855
|
}
|
|
1590
1856
|
state[space.id] = "saved";
|
|
1591
|
-
|
|
1857
|
+
CleanupFns[space.id] = createSpaceSaveTracker(space, (s) => {
|
|
1592
1858
|
state[space.id] = s;
|
|
1593
1859
|
cb(Object.values(state).some((s2) => s2 === "saving") ? "saving" : "saved");
|
|
1594
1860
|
});
|
|
@@ -1599,7 +1865,7 @@ var createClientSaveTracker = (client, cb) => {
|
|
|
1599
1865
|
});
|
|
1600
1866
|
install(client.spaces.get());
|
|
1601
1867
|
return () => {
|
|
1602
|
-
for (const unsubscribe of Object.values(
|
|
1868
|
+
for (const unsubscribe of Object.values(CleanupFns)) {
|
|
1603
1869
|
unsubscribe();
|
|
1604
1870
|
}
|
|
1605
1871
|
};
|
|
@@ -1669,7 +1935,7 @@ var getIcon = (status) => {
|
|
|
1669
1935
|
|
|
1670
1936
|
// packages/plugins/plugin-space/src/components/SyncStatus/SyncStatus.tsx
|
|
1671
1937
|
var SyncStatus = () => {
|
|
1672
|
-
const client =
|
|
1938
|
+
const client = useClient9();
|
|
1673
1939
|
const state = useSyncState();
|
|
1674
1940
|
const [saved, setSaved] = useState14(true);
|
|
1675
1941
|
useEffect8(() => {
|
|
@@ -1677,13 +1943,13 @@ var SyncStatus = () => {
|
|
|
1677
1943
|
setSaved(state2 === "saved");
|
|
1678
1944
|
});
|
|
1679
1945
|
}, []);
|
|
1680
|
-
return /* @__PURE__ */
|
|
1946
|
+
return /* @__PURE__ */ React25.createElement(SyncStatusIndicator, {
|
|
1681
1947
|
state,
|
|
1682
1948
|
saved
|
|
1683
1949
|
});
|
|
1684
1950
|
};
|
|
1685
1951
|
var SyncStatusIndicator = ({ state, saved }) => {
|
|
1686
|
-
const { t } =
|
|
1952
|
+
const { t } = useTranslation24(SPACE_PLUGIN);
|
|
1687
1953
|
const summary = getSyncSummary(state);
|
|
1688
1954
|
const offline = Object.values(state).length === 0;
|
|
1689
1955
|
const needsToUpload = summary.differentDocuments > 0 || summary.missingOnRemote > 0;
|
|
@@ -1710,66 +1976,64 @@ var SyncStatusIndicator = ({ state, saved }) => {
|
|
|
1710
1976
|
needsToDownload
|
|
1711
1977
|
]);
|
|
1712
1978
|
const title = t(`${status} label`);
|
|
1713
|
-
const icon = /* @__PURE__ */
|
|
1979
|
+
const icon = /* @__PURE__ */ React25.createElement(Icon6, {
|
|
1714
1980
|
icon: getIcon(status),
|
|
1715
1981
|
size: 4,
|
|
1716
1982
|
classNames
|
|
1717
1983
|
});
|
|
1718
1984
|
if (offline) {
|
|
1719
|
-
return /* @__PURE__ */
|
|
1985
|
+
return /* @__PURE__ */ React25.createElement(StatusBar.Item, {
|
|
1720
1986
|
title
|
|
1721
1987
|
}, icon);
|
|
1722
1988
|
} else {
|
|
1723
|
-
return /* @__PURE__ */
|
|
1989
|
+
return /* @__PURE__ */ React25.createElement(Popover3.Root, null, /* @__PURE__ */ React25.createElement(Popover3.Trigger, {
|
|
1724
1990
|
asChild: true
|
|
1725
|
-
}, /* @__PURE__ */
|
|
1991
|
+
}, /* @__PURE__ */ React25.createElement(StatusBar.Button, {
|
|
1726
1992
|
title
|
|
1727
|
-
}, icon)), /* @__PURE__ */
|
|
1993
|
+
}, icon)), /* @__PURE__ */ React25.createElement(Popover3.Portal, null, /* @__PURE__ */ React25.createElement(Popover3.Content, null, /* @__PURE__ */ React25.createElement(SyncStatusDetail, {
|
|
1728
1994
|
state,
|
|
1729
1995
|
summary,
|
|
1730
1996
|
debug: false
|
|
1731
|
-
}), /* @__PURE__ */
|
|
1997
|
+
}), /* @__PURE__ */ React25.createElement(Popover3.Arrow, null))));
|
|
1732
1998
|
}
|
|
1733
1999
|
};
|
|
1734
2000
|
var SyncStatusDetail = ({ classNames, state, summary, debug }) => {
|
|
1735
2001
|
const [showAll, setShowAll] = useState14(false);
|
|
1736
|
-
const { t } =
|
|
2002
|
+
const { t } = useTranslation24(SPACE_PLUGIN);
|
|
1737
2003
|
const entries = Object.entries(state).filter(([_, value]) => showAll || value.missingOnLocal + value.missingOnRemote > 0).toSorted(([a], [b]) => a < b ? -1 : a > b ? 1 : 0);
|
|
1738
|
-
const handleCheckedChange =
|
|
2004
|
+
const handleCheckedChange = useCallback13((state2) => setShowAll(state2), [
|
|
1739
2005
|
setShowAll
|
|
1740
2006
|
]);
|
|
1741
|
-
return /* @__PURE__ */
|
|
1742
|
-
className:
|
|
1743
|
-
}, /* @__PURE__ */
|
|
2007
|
+
return /* @__PURE__ */ React25.createElement("div", {
|
|
2008
|
+
className: mx8("flex flex-col gap-3 p-2 text-xs min-w-[400px]", classNames)
|
|
2009
|
+
}, /* @__PURE__ */ React25.createElement("div", {
|
|
1744
2010
|
role: "none",
|
|
1745
2011
|
className: "flex items-center"
|
|
1746
|
-
}, /* @__PURE__ */
|
|
2012
|
+
}, /* @__PURE__ */ React25.createElement("h1", {
|
|
1747
2013
|
className: "flex-1"
|
|
1748
|
-
}, t("sync status title")), /* @__PURE__ */
|
|
2014
|
+
}, t("sync status title")), /* @__PURE__ */ React25.createElement("div", {
|
|
1749
2015
|
className: "flex items-center gap-2"
|
|
1750
|
-
}, /* @__PURE__ */
|
|
2016
|
+
}, /* @__PURE__ */ React25.createElement(Input6.Root, null, /* @__PURE__ */ React25.createElement(Input6.Label, {
|
|
1751
2017
|
classNames: "text-xs"
|
|
1752
|
-
}, t("show all label")), /* @__PURE__ */
|
|
2018
|
+
}, t("show all label")), /* @__PURE__ */ React25.createElement(Input6.Checkbox, {
|
|
1753
2019
|
checked: showAll,
|
|
1754
2020
|
onCheckedChange: handleCheckedChange
|
|
1755
|
-
})))), /* @__PURE__ */
|
|
2021
|
+
})))), /* @__PURE__ */ React25.createElement("div", {
|
|
1756
2022
|
className: "flex flex-col gap-2"
|
|
1757
|
-
}, entries.length === 0 && /* @__PURE__ */
|
|
2023
|
+
}, entries.length === 0 && /* @__PURE__ */ React25.createElement("div", {
|
|
1758
2024
|
role: "none",
|
|
1759
2025
|
className: "flex justify-center"
|
|
1760
|
-
}, t("no sync status label")), entries.map(([spaceId, state2]) => /* @__PURE__ */
|
|
2026
|
+
}, t("no sync status label")), entries.map(([spaceId, state2]) => /* @__PURE__ */ React25.createElement(SpaceRowContainer, {
|
|
1761
2027
|
key: spaceId,
|
|
1762
2028
|
spaceId,
|
|
1763
2029
|
state: state2
|
|
1764
|
-
}))), debug && /* @__PURE__ */
|
|
2030
|
+
}))), debug && /* @__PURE__ */ React25.createElement(SyntaxHighlighter, {
|
|
1765
2031
|
language: "json"
|
|
1766
2032
|
}, JSON.stringify(summary, null, 2)));
|
|
1767
2033
|
};
|
|
1768
2034
|
|
|
1769
2035
|
export {
|
|
1770
|
-
AdvancedObjectSettings,
|
|
1771
2036
|
AwaitingObject,
|
|
1772
|
-
BaseObjectSettings,
|
|
1773
2037
|
CREATE_OBJECT_DIALOG,
|
|
1774
2038
|
CreateObjectDialog,
|
|
1775
2039
|
CREATE_SPACE_DIALOG,
|
|
@@ -1778,7 +2042,9 @@ export {
|
|
|
1778
2042
|
CollectionSection,
|
|
1779
2043
|
JOIN_DIALOG,
|
|
1780
2044
|
JoinDialog,
|
|
2045
|
+
MembersContainer,
|
|
1781
2046
|
MenuFooter,
|
|
2047
|
+
ObjectSettingsContainer,
|
|
1782
2048
|
PersistenceStatus,
|
|
1783
2049
|
POPOVER_ADD_SPACE,
|
|
1784
2050
|
PopoverAddSpace,
|
|
@@ -1793,9 +2059,9 @@ export {
|
|
|
1793
2059
|
SmallPresenceLive,
|
|
1794
2060
|
SmallPresence,
|
|
1795
2061
|
SpacePluginSettings,
|
|
1796
|
-
|
|
2062
|
+
SpacePropertiesForm,
|
|
1797
2063
|
SPACE_SETTINGS_DIALOG,
|
|
1798
|
-
|
|
2064
|
+
SpaceSettingsContainer,
|
|
1799
2065
|
InlineSyncStatus,
|
|
1800
2066
|
SyncStatus,
|
|
1801
2067
|
SyncStatusIndicator,
|
|
@@ -1807,8 +2073,9 @@ export {
|
|
|
1807
2073
|
ReactRoot,
|
|
1808
2074
|
ReactSurface,
|
|
1809
2075
|
Schema,
|
|
2076
|
+
Tools,
|
|
1810
2077
|
SpaceSettings,
|
|
1811
2078
|
SpaceState,
|
|
1812
2079
|
SpacesReady
|
|
1813
2080
|
};
|
|
1814
|
-
//# sourceMappingURL=chunk-
|
|
2081
|
+
//# sourceMappingURL=chunk-DVZEJGCK.mjs.map
|