@dxos/plugin-space 0.8.2-main.fbd8ed0 → 0.8.2-staging.7ac8446
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/browser/app-graph-builder-GMFCSOLG.mjs +315 -0
- package/dist/lib/browser/app-graph-builder-GMFCSOLG.mjs.map +7 -0
- package/dist/lib/browser/{app-graph-serializer-VRU57AEZ.mjs → app-graph-serializer-DSF2U3A5.mjs} +10 -10
- package/dist/lib/browser/app-graph-serializer-DSF2U3A5.mjs.map +7 -0
- package/dist/lib/browser/{chunk-UBSVH2NQ.mjs → chunk-5BDV575R.mjs} +10 -21
- package/dist/lib/browser/chunk-5BDV575R.mjs.map +7 -0
- package/dist/lib/browser/chunk-AYW4IDRT.mjs +275 -0
- package/dist/lib/browser/chunk-AYW4IDRT.mjs.map +7 -0
- package/dist/lib/browser/{chunk-43UQWMD3.mjs → chunk-JZXWPMLA.mjs} +740 -390
- package/dist/lib/browser/chunk-JZXWPMLA.mjs.map +7 -0
- package/dist/lib/browser/{chunk-IQFFOAWD.mjs → chunk-LO5UL6RU.mjs} +173 -78
- package/dist/lib/browser/chunk-LO5UL6RU.mjs.map +7 -0
- package/dist/lib/browser/{identity-created-ANRJHNMQ.mjs → identity-created-JR7BNXFH.mjs} +5 -5
- package/dist/lib/browser/identity-created-JR7BNXFH.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +47 -30
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-resolver-KRINV5QI.mjs → intent-resolver-RKYILWWQ.mjs} +106 -98
- package/dist/lib/browser/intent-resolver-RKYILWWQ.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-root-J3SP2HVW.mjs → react-root-6H7NX2M2.mjs} +4 -5
- package/dist/lib/{node-esm/react-root-S2LW4FS7.mjs.map → browser/react-root-6H7NX2M2.mjs.map} +1 -1
- package/dist/lib/browser/{react-surface-J7T2IMH4.mjs → react-surface-7AGLOVMK.mjs} +53 -120
- package/dist/lib/browser/react-surface-7AGLOVMK.mjs.map +7 -0
- package/dist/lib/browser/schema-FHTA26SW.mjs +24 -0
- package/dist/lib/browser/schema-FHTA26SW.mjs.map +7 -0
- package/dist/lib/browser/{schema-tools-MYC4LTQD.mjs → schema-tools-YAXPRIXP.mjs} +22 -22
- package/dist/lib/browser/schema-tools-YAXPRIXP.mjs.map +7 -0
- package/dist/lib/browser/{settings-G24447B7.mjs → settings-PJPTJUPE.mjs} +4 -4
- package/dist/lib/browser/settings-PJPTJUPE.mjs.map +7 -0
- package/dist/lib/browser/{spaces-ready-5I3RKYTT.mjs → spaces-ready-BSSP7HHG.mjs} +17 -18
- package/dist/lib/browser/spaces-ready-BSSP7HHG.mjs.map +7 -0
- package/dist/lib/browser/{state-SI4B5GHC.mjs → state-X7VLCC6E.mjs} +4 -2
- package/dist/lib/browser/state-X7VLCC6E.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +1 -7
- package/dist/lib/node/app-graph-builder-DPY7AUZE.cjs +318 -0
- package/dist/lib/node/app-graph-builder-DPY7AUZE.cjs.map +7 -0
- package/dist/lib/node/{app-graph-serializer-VLBCR3IX.cjs → app-graph-serializer-JELGJUAY.cjs} +22 -22
- package/dist/lib/node/app-graph-serializer-JELGJUAY.cjs.map +7 -0
- package/dist/lib/node/{chunk-MXBE2VET.cjs → chunk-3GKCNADA.cjs} +751 -412
- package/dist/lib/node/chunk-3GKCNADA.cjs.map +7 -0
- package/dist/lib/node/{chunk-5YHUQJVB.cjs → chunk-PU2EYH4E.cjs} +14 -25
- package/dist/lib/node/chunk-PU2EYH4E.cjs.map +7 -0
- package/dist/lib/node/{chunk-SCATWJKX.cjs → chunk-TUZWEPGX.cjs} +198 -100
- package/dist/lib/node/chunk-TUZWEPGX.cjs.map +7 -0
- package/dist/lib/node/chunk-WDEIFDTX.cjs +300 -0
- package/dist/lib/node/chunk-WDEIFDTX.cjs.map +7 -0
- package/dist/lib/node/{identity-created-NIPYGVG3.cjs → identity-created-XU4HFV2T.cjs} +7 -7
- package/dist/lib/node/identity-created-XU4HFV2T.cjs.map +7 -0
- package/dist/lib/node/index.cjs +97 -79
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/{intent-resolver-MJVRY6YE.cjs → intent-resolver-VJ7YV74L.cjs} +151 -144
- package/dist/lib/node/intent-resolver-VJ7YV74L.cjs.map +7 -0
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/{react-root-M4BZ6VXB.cjs → react-root-TEL5RW3N.cjs} +8 -9
- package/dist/lib/node/{react-root-M4BZ6VXB.cjs.map → react-root-TEL5RW3N.cjs.map} +1 -1
- package/dist/lib/node/{react-surface-RYKSYYKM.cjs → react-surface-2H3S5TY5.cjs} +75 -142
- package/dist/lib/node/react-surface-2H3S5TY5.cjs.map +7 -0
- package/dist/lib/node/{schema-defs-2HJLXSNK.cjs → schema-PPJ5BZ3A.cjs} +11 -13
- package/dist/lib/node/schema-PPJ5BZ3A.cjs.map +7 -0
- package/dist/lib/node/{schema-tools-OE3MFYYH.cjs → schema-tools-BLIMOZYY.cjs} +24 -24
- package/dist/lib/node/schema-tools-BLIMOZYY.cjs.map +7 -0
- package/dist/lib/node/{settings-AFWO4AWK.cjs → settings-WVFP2UEP.cjs} +7 -7
- package/dist/lib/node/settings-WVFP2UEP.cjs.map +7 -0
- package/dist/lib/node/{spaces-ready-BMPXSFHF.cjs → spaces-ready-7DNZSUOG.cjs} +24 -25
- package/dist/lib/node/spaces-ready-7DNZSUOG.cjs.map +7 -0
- package/dist/lib/node/{state-L2ZSDKLS.cjs → state-5KX6WBJH.cjs} +7 -5
- package/dist/lib/node/state-5KX6WBJH.cjs.map +7 -0
- package/dist/lib/node/types/index.cjs +12 -18
- package/dist/lib/node/types/index.cjs.map +2 -2
- package/dist/lib/node-esm/app-graph-builder-42IGWRPL.mjs +316 -0
- package/dist/lib/node-esm/app-graph-builder-42IGWRPL.mjs.map +7 -0
- package/dist/lib/node-esm/{app-graph-serializer-GEUYYXKD.mjs → app-graph-serializer-FXONFKOE.mjs} +10 -10
- package/dist/lib/node-esm/app-graph-serializer-FXONFKOE.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-5NIBYPVF.mjs → chunk-3ZOUV4DF.mjs} +10 -21
- package/dist/lib/node-esm/chunk-3ZOUV4DF.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-FI3WV22Y.mjs → chunk-BEWBZ4Q4.mjs} +740 -390
- package/dist/lib/node-esm/chunk-BEWBZ4Q4.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-FC4UHDPL.mjs +276 -0
- package/dist/lib/node-esm/chunk-FC4UHDPL.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-S2W6HS4A.mjs → chunk-ZGLK25WQ.mjs} +173 -78
- package/dist/lib/node-esm/chunk-ZGLK25WQ.mjs.map +7 -0
- package/dist/lib/node-esm/{identity-created-O5X2FFWU.mjs → identity-created-WJKAS2PV.mjs} +5 -5
- package/dist/lib/node-esm/identity-created-WJKAS2PV.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +47 -30
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/{intent-resolver-JT6EB47M.mjs → intent-resolver-ZFNSA4CM.mjs} +106 -98
- package/dist/lib/node-esm/intent-resolver-ZFNSA4CM.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-root-S2LW4FS7.mjs → react-root-PRBJMWLQ.mjs} +4 -5
- package/dist/lib/node-esm/{react-surface-ZNNMO7QQ.mjs → react-surface-RCZG2PNF.mjs} +53 -120
- package/dist/lib/node-esm/react-surface-RCZG2PNF.mjs.map +7 -0
- package/dist/lib/node-esm/schema-OUZKVYM5.mjs +25 -0
- package/dist/lib/node-esm/schema-OUZKVYM5.mjs.map +7 -0
- package/dist/lib/node-esm/{schema-tools-YTJLA3NQ.mjs → schema-tools-IU7EX5A5.mjs} +22 -22
- package/dist/lib/node-esm/schema-tools-IU7EX5A5.mjs.map +7 -0
- package/dist/lib/node-esm/{settings-MJVSCOI4.mjs → settings-FJZPC2TV.mjs} +4 -4
- package/dist/lib/node-esm/settings-FJZPC2TV.mjs.map +7 -0
- package/dist/lib/node-esm/{spaces-ready-XKG57SL5.mjs → spaces-ready-7X5PGB2V.mjs} +17 -18
- package/dist/lib/node-esm/spaces-ready-7X5PGB2V.mjs.map +7 -0
- package/dist/lib/node-esm/{state-QUDYGEU6.mjs → state-Z6E2YTNC.mjs} +4 -2
- package/dist/lib/node-esm/state-Z6E2YTNC.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +1 -7
- package/dist/types/src/SpacePlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts +179 -2
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-serializer.d.ts +2 -2
- package/dist/types/src/capabilities/app-graph-serializer.d.ts.map +1 -1
- package/dist/types/src/capabilities/identity-created.d.ts +2 -2
- package/dist/types/src/capabilities/identity-created.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +184 -9
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +3 -4
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/schema-tools.d.ts +2 -2
- package/dist/types/src/capabilities/schema-tools.d.ts.map +1 -1
- package/dist/types/src/capabilities/schema.d.ts +4 -0
- package/dist/types/src/capabilities/schema.d.ts.map +1 -0
- package/dist/types/src/capabilities/spaces-ready.d.ts +2 -2
- package/dist/types/src/capabilities/spaces-ready.d.ts.map +1 -1
- package/dist/types/src/capabilities/state.d.ts +2 -2
- package/dist/types/src/capabilities/state.d.ts.map +1 -1
- package/dist/types/src/components/AwaitingObject.d.ts.map +1 -1
- package/dist/types/src/components/CollectionMain.d.ts.map +1 -1
- package/dist/types/src/components/CollectionSection.d.ts.map +1 -1
- package/dist/types/src/components/CreateDialog/CreateObjectDialog.d.ts +2 -2
- package/dist/types/src/components/CreateDialog/CreateObjectDialog.d.ts.map +1 -1
- package/dist/types/src/components/CreateDialog/CreateObjectPanel.d.ts.map +1 -1
- package/dist/types/src/components/CreateDialog/CreateSpaceDialog.d.ts.map +1 -1
- package/dist/types/src/components/JoinDialog.d.ts.map +1 -1
- package/dist/types/src/components/MembersContainer.d.ts.map +1 -1
- package/dist/types/src/components/MembersContainer.stories.d.ts.map +1 -1
- package/dist/types/src/components/MenuFooter.d.ts +2 -2
- package/dist/types/src/components/MenuFooter.d.ts.map +1 -1
- package/dist/types/src/components/{ObjectSettings → ObjectSettingsContainer}/AdvancedObjectSettings.d.ts +2 -2
- package/dist/types/src/components/ObjectSettingsContainer/AdvancedObjectSettings.d.ts.map +1 -0
- package/dist/types/src/components/{ObjectSettings → ObjectSettingsContainer}/BaseObjectSettings.d.ts +2 -2
- package/dist/types/src/components/ObjectSettingsContainer/BaseObjectSettings.d.ts.map +1 -0
- package/dist/types/src/components/ObjectSettingsContainer/ForeignKeys.d.ts.map +1 -0
- package/dist/types/src/components/{ObjectSettings → ObjectSettingsContainer}/ObjectSettingsContainer.d.ts +2 -2
- package/dist/types/src/components/ObjectSettingsContainer/ObjectSettingsContainer.d.ts.map +1 -0
- package/dist/types/src/components/ObjectSettingsContainer/index.d.ts.map +1 -0
- package/dist/types/src/components/PersistenceStatus.d.ts.map +1 -1
- package/dist/types/src/components/PopoverAddSpace.d.ts +4 -0
- package/dist/types/src/components/PopoverAddSpace.d.ts.map +1 -0
- package/dist/types/src/components/PopoverRenameObject.d.ts +2 -2
- package/dist/types/src/components/PopoverRenameObject.d.ts.map +1 -1
- package/dist/types/src/components/PopoverRenameSpace.d.ts.map +1 -1
- package/dist/types/src/components/ShareSpaceButton.d.ts +9 -0
- package/dist/types/src/components/ShareSpaceButton.d.ts.map +1 -0
- package/dist/types/src/components/ShareSpaceButton.stories.d.ts +10 -0
- package/dist/types/src/components/ShareSpaceButton.stories.d.ts.map +1 -0
- package/dist/types/src/components/SpacePluginSettings.d.ts.map +1 -1
- package/dist/types/src/components/SpacePresence.d.ts.map +1 -1
- package/dist/types/src/components/SpacePresence.stories.d.ts.map +1 -1
- package/dist/types/src/components/SpaceSettings/SpacePropertiesForm.d.ts +7 -0
- package/dist/types/src/components/SpaceSettings/SpacePropertiesForm.d.ts.map +1 -0
- package/dist/types/src/components/SpaceSettings/SpacePropertiesForm.stories.d.ts +7 -0
- package/dist/types/src/components/SpaceSettings/SpacePropertiesForm.stories.d.ts.map +1 -0
- package/dist/types/src/components/SpaceSettings/SpaceSettingsContainer.d.ts +2 -0
- package/dist/types/src/components/SpaceSettings/SpaceSettingsContainer.d.ts.map +1 -1
- package/dist/types/src/components/SpaceSettings/index.d.ts +1 -0
- package/dist/types/src/components/SpaceSettings/index.d.ts.map +1 -1
- package/dist/types/src/components/SyncStatus/InlineSyncStatus.d.ts.map +1 -1
- package/dist/types/src/components/SyncStatus/Space.d.ts +13 -0
- package/dist/types/src/components/SyncStatus/Space.d.ts.map +1 -0
- package/dist/types/src/components/SyncStatus/SyncStatus.d.ts +8 -1
- package/dist/types/src/components/SyncStatus/SyncStatus.d.ts.map +1 -1
- package/dist/types/src/components/SyncStatus/SyncStatusDetail.stories.d.ts +9 -0
- package/dist/types/src/components/SyncStatus/SyncStatusDetail.stories.d.ts.map +1 -0
- package/dist/types/src/components/SyncStatus/save-tracker.d.ts.map +1 -1
- package/dist/types/src/components/SyncStatus/status.d.ts.map +1 -1
- package/dist/types/src/components/SyncStatus/sync-state.d.ts +18 -0
- package/dist/types/src/components/SyncStatus/sync-state.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +3 -2
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/hooks/index.d.ts +0 -2
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/usePath.d.ts +2 -3
- package/dist/types/src/hooks/usePath.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +0 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +242 -17
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/collection.d.ts +8 -9
- package/dist/types/src/types/collection.d.ts.map +1 -1
- package/dist/types/src/types/thread.d.ts +110 -205
- package/dist/types/src/types/thread.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +146 -157
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/src/util.d.ts +20 -36
- package/dist/types/src/util.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +44 -51
- package/src/SpacePlugin.tsx +20 -11
- package/src/capabilities/app-graph-builder.ts +230 -377
- package/src/capabilities/app-graph-serializer.ts +8 -8
- package/src/capabilities/identity-created.ts +5 -5
- package/src/capabilities/index.ts +2 -2
- package/src/capabilities/intent-resolver.ts +110 -94
- package/src/capabilities/react-surface.tsx +50 -111
- package/src/capabilities/schema-tool.test.ts +3 -2
- package/src/capabilities/schema-tools.ts +25 -25
- package/src/capabilities/schema.ts +27 -0
- package/src/capabilities/settings.ts +2 -2
- package/src/capabilities/spaces-ready.ts +14 -16
- package/src/capabilities/state.ts +5 -3
- package/src/components/AwaitingObject.tsx +1 -1
- package/src/components/CollectionMain.tsx +5 -2
- package/src/components/CreateDialog/CreateObjectDialog.stories.tsx +4 -4
- package/src/components/CreateDialog/CreateObjectDialog.tsx +4 -4
- package/src/components/CreateDialog/CreateObjectPanel.tsx +25 -3
- package/src/components/CreateDialog/CreateSpaceDialog.tsx +3 -6
- package/src/components/MembersContainer.stories.tsx +5 -1
- package/src/components/MembersContainer.tsx +54 -80
- package/src/components/MenuFooter.tsx +2 -2
- package/src/components/{ObjectSettings → ObjectSettingsContainer}/AdvancedObjectSettings.tsx +2 -2
- package/src/components/{ObjectSettings → ObjectSettingsContainer}/BaseObjectSettings.tsx +2 -2
- package/src/components/{ObjectSettings → ObjectSettingsContainer}/ObjectSettingsContainer.tsx +4 -4
- package/src/components/PersistenceStatus.tsx +14 -11
- package/src/components/PopoverAddSpace.tsx +46 -0
- package/src/components/PopoverRenameObject.tsx +8 -14
- package/src/components/PopoverRenameSpace.tsx +0 -8
- package/src/components/ShareSpaceButton.stories.tsx +27 -0
- package/src/components/ShareSpaceButton.tsx +32 -0
- package/src/components/SpacePluginSettings.tsx +2 -27
- package/src/components/SpacePresence.stories.tsx +1 -1
- package/src/components/SpacePresence.tsx +65 -60
- package/src/components/SpaceSettings/{SpaceSettingsContainer.stories.tsx → SpacePropertiesForm.stories.tsx} +6 -6
- package/src/components/SpaceSettings/SpacePropertiesForm.tsx +136 -0
- package/src/components/SpaceSettings/SpaceSettingsContainer.tsx +39 -159
- package/src/components/SpaceSettings/index.ts +1 -0
- package/src/components/SyncStatus/InlineSyncStatus.tsx +24 -15
- package/src/components/SyncStatus/Space.tsx +133 -0
- package/src/components/SyncStatus/SyncStatus.tsx +69 -6
- package/src/components/SyncStatus/SyncStatusDetail.stories.tsx +89 -0
- package/src/components/SyncStatus/sync-state.ts +101 -0
- package/src/components/index.ts +3 -2
- package/src/hooks/index.ts +0 -2
- package/src/hooks/usePath.ts +6 -9
- package/src/index.ts +0 -1
- package/src/translations.ts +7 -19
- package/src/types/collection.ts +4 -6
- package/src/types/thread.ts +8 -14
- package/src/types/types.ts +101 -115
- package/src/util.tsx +172 -75
- package/dist/lib/browser/app-graph-builder-7X3SIPCD.mjs +0 -328
- package/dist/lib/browser/app-graph-builder-7X3SIPCD.mjs.map +0 -7
- package/dist/lib/browser/app-graph-serializer-VRU57AEZ.mjs.map +0 -7
- package/dist/lib/browser/chunk-43UQWMD3.mjs.map +0 -7
- package/dist/lib/browser/chunk-AR5R2F6B.mjs +0 -88
- package/dist/lib/browser/chunk-AR5R2F6B.mjs.map +0 -7
- package/dist/lib/browser/chunk-CY35NLWL.mjs +0 -296
- package/dist/lib/browser/chunk-CY35NLWL.mjs.map +0 -7
- package/dist/lib/browser/chunk-IQFFOAWD.mjs.map +0 -7
- package/dist/lib/browser/chunk-UBSVH2NQ.mjs.map +0 -7
- package/dist/lib/browser/identity-created-ANRJHNMQ.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-KRINV5QI.mjs.map +0 -7
- package/dist/lib/browser/react-surface-J7T2IMH4.mjs.map +0 -7
- package/dist/lib/browser/schema-defs-OCBY7APN.mjs +0 -26
- package/dist/lib/browser/schema-defs-OCBY7APN.mjs.map +0 -7
- package/dist/lib/browser/schema-tools-MYC4LTQD.mjs.map +0 -7
- package/dist/lib/browser/settings-G24447B7.mjs.map +0 -7
- package/dist/lib/browser/spaces-ready-5I3RKYTT.mjs.map +0 -7
- package/dist/lib/browser/state-SI4B5GHC.mjs.map +0 -7
- package/dist/lib/node/app-graph-builder-C2ISDMSL.cjs +0 -328
- package/dist/lib/node/app-graph-builder-C2ISDMSL.cjs.map +0 -7
- package/dist/lib/node/app-graph-serializer-VLBCR3IX.cjs.map +0 -7
- package/dist/lib/node/chunk-5YHUQJVB.cjs.map +0 -7
- package/dist/lib/node/chunk-DQN4ZQDW.cjs +0 -119
- package/dist/lib/node/chunk-DQN4ZQDW.cjs.map +0 -7
- package/dist/lib/node/chunk-K6ZO4WDJ.cjs +0 -324
- package/dist/lib/node/chunk-K6ZO4WDJ.cjs.map +0 -7
- package/dist/lib/node/chunk-MXBE2VET.cjs.map +0 -7
- package/dist/lib/node/chunk-SCATWJKX.cjs.map +0 -7
- package/dist/lib/node/identity-created-NIPYGVG3.cjs.map +0 -7
- package/dist/lib/node/intent-resolver-MJVRY6YE.cjs.map +0 -7
- package/dist/lib/node/react-surface-RYKSYYKM.cjs.map +0 -7
- package/dist/lib/node/schema-defs-2HJLXSNK.cjs.map +0 -7
- package/dist/lib/node/schema-tools-OE3MFYYH.cjs.map +0 -7
- package/dist/lib/node/settings-AFWO4AWK.cjs.map +0 -7
- package/dist/lib/node/spaces-ready-BMPXSFHF.cjs.map +0 -7
- package/dist/lib/node/state-L2ZSDKLS.cjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-WVCQZ324.mjs +0 -329
- package/dist/lib/node-esm/app-graph-builder-WVCQZ324.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-serializer-GEUYYXKD.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-5NIBYPVF.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-CLRCW6PU.mjs +0 -297
- package/dist/lib/node-esm/chunk-CLRCW6PU.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-FI3WV22Y.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HNKAG5CX.mjs +0 -90
- package/dist/lib/node-esm/chunk-HNKAG5CX.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-S2W6HS4A.mjs.map +0 -7
- package/dist/lib/node-esm/identity-created-O5X2FFWU.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-JT6EB47M.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-ZNNMO7QQ.mjs.map +0 -7
- package/dist/lib/node-esm/schema-defs-B74N3GQ5.mjs +0 -27
- package/dist/lib/node-esm/schema-defs-B74N3GQ5.mjs.map +0 -7
- package/dist/lib/node-esm/schema-tools-YTJLA3NQ.mjs.map +0 -7
- package/dist/lib/node-esm/settings-MJVSCOI4.mjs.map +0 -7
- package/dist/lib/node-esm/spaces-ready-XKG57SL5.mjs.map +0 -7
- package/dist/lib/node-esm/state-QUDYGEU6.mjs.map +0 -7
- package/dist/types/src/capabilities/schema-defs.d.ts +0 -4
- package/dist/types/src/capabilities/schema-defs.d.ts.map +0 -1
- package/dist/types/src/components/ObjectSettings/AdvancedObjectSettings.d.ts.map +0 -1
- package/dist/types/src/components/ObjectSettings/BaseObjectSettings.d.ts.map +0 -1
- package/dist/types/src/components/ObjectSettings/ForeignKeys.d.ts.map +0 -1
- package/dist/types/src/components/ObjectSettings/ObjectSettingsContainer.d.ts.map +0 -1
- package/dist/types/src/components/ObjectSettings/index.d.ts.map +0 -1
- package/dist/types/src/components/SchemaContainer.d.ts +0 -13
- package/dist/types/src/components/SchemaContainer.d.ts.map +0 -1
- package/dist/types/src/components/SpaceSettings/SpaceSettingsContainer.stories.d.ts +0 -7
- package/dist/types/src/components/SpaceSettings/SpaceSettingsContainer.stories.d.ts.map +0 -1
- package/dist/types/src/hooks/useActiveSpace.d.ts +0 -4
- package/dist/types/src/hooks/useActiveSpace.d.ts.map +0 -1
- package/dist/types/src/hooks/useInputSurfaceLookup.d.ts +0 -14
- package/dist/types/src/hooks/useInputSurfaceLookup.d.ts.map +0 -1
- package/src/capabilities/schema-defs.ts +0 -30
- package/src/components/SchemaContainer.tsx +0 -59
- package/src/hooks/useActiveSpace.ts +0 -20
- package/src/hooks/useInputSurfaceLookup.tsx +0 -31
- /package/dist/lib/{browser/react-root-J3SP2HVW.mjs.map → node-esm/react-root-PRBJMWLQ.mjs.map} +0 -0
- /package/dist/types/src/components/{ObjectSettings → ObjectSettingsContainer}/ForeignKeys.d.ts +0 -0
- /package/dist/types/src/components/{ObjectSettings → ObjectSettingsContainer}/index.d.ts +0 -0
- /package/src/components/{ObjectSettings → ObjectSettingsContainer}/ForeignKeys.tsx +0 -0
- /package/src/components/{ObjectSettings → ObjectSettingsContainer}/index.ts +0 -0
|
@@ -1,20 +1,15 @@
|
|
|
1
1
|
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
useInputSurfaceLookup,
|
|
4
|
-
usePath
|
|
5
|
-
} from "./chunk-HNKAG5CX.mjs";
|
|
6
2
|
import {
|
|
7
3
|
SpaceCapabilities
|
|
8
4
|
} from "./chunk-PIYAWT5N.mjs";
|
|
9
5
|
import {
|
|
10
|
-
COMPOSER_SPACE_LOCK,
|
|
11
6
|
getSpaceDisplayName
|
|
12
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-ZGLK25WQ.mjs";
|
|
13
8
|
import {
|
|
14
9
|
CollectionType,
|
|
15
10
|
SpaceAction,
|
|
16
11
|
SpaceForm
|
|
17
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-FC4UHDPL.mjs";
|
|
18
13
|
import {
|
|
19
14
|
SPACE_PLUGIN,
|
|
20
15
|
meta
|
|
@@ -38,7 +33,7 @@ var AwaitingObject = ({ id }) => {
|
|
|
38
33
|
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
39
34
|
const layout = useLayout();
|
|
40
35
|
const client = useClient();
|
|
41
|
-
const objects = useQuery(client.spaces, Filter.
|
|
36
|
+
const objects = useQuery(client.spaces, Filter.all());
|
|
42
37
|
useEffect(() => {
|
|
43
38
|
if (!id) {
|
|
44
39
|
return;
|
|
@@ -116,14 +111,15 @@ var AwaitingObject = ({ id }) => {
|
|
|
116
111
|
// packages/plugins/plugin-space/src/components/CreateDialog/CreateObjectDialog.tsx
|
|
117
112
|
import { pipe } from "effect";
|
|
118
113
|
import React3, { useCallback as useCallback3, useRef } from "react";
|
|
119
|
-
import { Capabilities, chain, createIntent as createIntent2, LayoutAction as LayoutAction2, useCapabilities, useIntentDispatcher as useIntentDispatcher2, usePluginManager } from "@dxos/app-framework";
|
|
114
|
+
import { Capabilities, chain, createIntent as createIntent2, LayoutAction as LayoutAction2, useCapabilities, useIntentDispatcher as useIntentDispatcher2, usePluginManager as usePluginManager2 } from "@dxos/app-framework";
|
|
120
115
|
import { invariant as invariant2 } from "@dxos/invariant";
|
|
121
116
|
import { useClient as useClient2 } from "@dxos/react-client";
|
|
122
|
-
import { getSpace,
|
|
117
|
+
import { getSpace, isReactiveObject, isSpace, useSpaces } from "@dxos/react-client/echo";
|
|
123
118
|
import { Button as Button2, Dialog, Icon as Icon2, useTranslation as useTranslation3 } from "@dxos/react-ui";
|
|
124
119
|
|
|
125
120
|
// packages/plugins/plugin-space/src/components/CreateDialog/CreateObjectPanel.tsx
|
|
126
121
|
import React2, { useCallback as useCallback2, useState as useState2 } from "react";
|
|
122
|
+
import { Surface, isSurfaceAvailable, usePluginManager } from "@dxos/app-framework";
|
|
127
123
|
import { getTypeAnnotation } from "@dxos/echo-schema";
|
|
128
124
|
import { invariant } from "@dxos/invariant";
|
|
129
125
|
import { Icon, toLocalizedString, useTranslation as useTranslation2 } from "@dxos/react-ui";
|
|
@@ -132,6 +128,30 @@ import { SearchList } from "@dxos/react-ui-searchlist";
|
|
|
132
128
|
import { mx as mx2 } from "@dxos/react-ui-theme";
|
|
133
129
|
import { isNonNullable } from "@dxos/util";
|
|
134
130
|
var __dxlog_file = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/CreateDialog/CreateObjectPanel.tsx";
|
|
131
|
+
var useInputSurfaceLookup = (baseData) => {
|
|
132
|
+
const pluginManager = usePluginManager();
|
|
133
|
+
return useCallback2(({ prop, schema, inputProps }) => {
|
|
134
|
+
const composedData = {
|
|
135
|
+
prop,
|
|
136
|
+
schema,
|
|
137
|
+
...baseData
|
|
138
|
+
};
|
|
139
|
+
if (!isSurfaceAvailable(pluginManager.context, {
|
|
140
|
+
role: "form-input",
|
|
141
|
+
data: composedData
|
|
142
|
+
})) {
|
|
143
|
+
return void 0;
|
|
144
|
+
}
|
|
145
|
+
return /* @__PURE__ */ React2.createElement(Surface, {
|
|
146
|
+
role: "form-input",
|
|
147
|
+
data: composedData,
|
|
148
|
+
...inputProps
|
|
149
|
+
});
|
|
150
|
+
}, [
|
|
151
|
+
pluginManager,
|
|
152
|
+
baseData
|
|
153
|
+
]);
|
|
154
|
+
};
|
|
135
155
|
var CreateObjectPanel = ({ classNames, forms, spaces, typename: initialTypename, target: initialTarget, name: initialName, defaultSpaceId, resolve, onCreateObject }) => {
|
|
136
156
|
const { t } = useTranslation2(SPACE_PLUGIN);
|
|
137
157
|
const [typename, setTypename] = useState2(initialTypename);
|
|
@@ -165,7 +185,7 @@ var CreateObjectPanel = ({ classNames, forms, spaces, typename: initialTypename,
|
|
|
165
185
|
const handleSetTypename = useCallback2(async (typename2) => {
|
|
166
186
|
invariant(target, "target is required", {
|
|
167
187
|
F: __dxlog_file,
|
|
168
|
-
L:
|
|
188
|
+
L: 94,
|
|
169
189
|
S: void 0,
|
|
170
190
|
A: [
|
|
171
191
|
"target",
|
|
@@ -278,30 +298,30 @@ var SelectSchema = ({ options, resolve, onChange }) => {
|
|
|
278
298
|
|
|
279
299
|
// packages/plugins/plugin-space/src/capabilities/index.ts
|
|
280
300
|
import { lazy } from "@dxos/app-framework";
|
|
281
|
-
var AppGraphBuilder = lazy(() => import("./app-graph-builder-
|
|
282
|
-
var AppGraphSerializer = lazy(() => import("./app-graph-serializer-
|
|
283
|
-
var IdentityCreated = lazy(() => import("./identity-created-
|
|
284
|
-
var IntentResolver = lazy(() => import("./intent-resolver-
|
|
285
|
-
var ReactRoot = lazy(() => import("./react-root-
|
|
286
|
-
var ReactSurface = lazy(() => import("./react-surface-
|
|
287
|
-
var
|
|
288
|
-
var
|
|
289
|
-
var SpaceSettings = lazy(() => import("./settings-
|
|
290
|
-
var SpaceState = lazy(() => import("./state-
|
|
291
|
-
var SpacesReady = lazy(() => import("./spaces-ready-
|
|
301
|
+
var AppGraphBuilder = lazy(() => import("./app-graph-builder-42IGWRPL.mjs"));
|
|
302
|
+
var AppGraphSerializer = lazy(() => import("./app-graph-serializer-FXONFKOE.mjs"));
|
|
303
|
+
var IdentityCreated = lazy(() => import("./identity-created-WJKAS2PV.mjs"));
|
|
304
|
+
var IntentResolver = lazy(() => import("./intent-resolver-ZFNSA4CM.mjs"));
|
|
305
|
+
var ReactRoot = lazy(() => import("./react-root-PRBJMWLQ.mjs"));
|
|
306
|
+
var ReactSurface = lazy(() => import("./react-surface-RCZG2PNF.mjs"));
|
|
307
|
+
var Schema = lazy(() => import("./schema-OUZKVYM5.mjs"));
|
|
308
|
+
var Tools = lazy(() => import("./schema-tools-IU7EX5A5.mjs"));
|
|
309
|
+
var SpaceSettings = lazy(() => import("./settings-FJZPC2TV.mjs"));
|
|
310
|
+
var SpaceState = lazy(() => import("./state-Z6E2YTNC.mjs"));
|
|
311
|
+
var SpacesReady = lazy(() => import("./spaces-ready-7X5PGB2V.mjs"));
|
|
292
312
|
|
|
293
313
|
// packages/plugins/plugin-space/src/components/CreateDialog/CreateObjectDialog.tsx
|
|
294
314
|
var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/CreateDialog/CreateObjectDialog.tsx";
|
|
295
315
|
var CREATE_OBJECT_DIALOG = `${SPACE_PLUGIN}/CreateObjectDialog`;
|
|
296
316
|
var CreateObjectDialog = ({ target, typename, name, shouldNavigate: _shouldNavigate }) => {
|
|
297
317
|
const closeRef = useRef(null);
|
|
298
|
-
const manager =
|
|
318
|
+
const manager = usePluginManager2();
|
|
299
319
|
const { t } = useTranslation3(SPACE_PLUGIN);
|
|
300
320
|
const client = useClient2();
|
|
301
321
|
const spaces = useSpaces();
|
|
302
322
|
const { dispatchPromise: dispatch } = useIntentDispatcher2();
|
|
303
323
|
const forms = useCapabilities(SpaceCapabilities.ObjectForm);
|
|
304
|
-
const resolve = useCallback3((typename2) => manager.context.
|
|
324
|
+
const resolve = useCallback3((typename2) => manager.context.requestCapabilities(Capabilities.Metadata).find(({ id }) => id === typename2)?.metadata ?? {}, [
|
|
305
325
|
manager
|
|
306
326
|
]);
|
|
307
327
|
const handleCreateObject = useCallback3(async ({ form, target: target2, data = {} }) => {
|
|
@@ -323,7 +343,7 @@ var CreateObjectDialog = ({ target, typename, name, shouldNavigate: _shouldNavig
|
|
|
323
343
|
space
|
|
324
344
|
}));
|
|
325
345
|
const object = result.data?.object;
|
|
326
|
-
if (
|
|
346
|
+
if (isReactiveObject(object)) {
|
|
327
347
|
const addObjectIntent = createIntent2(SpaceAction.AddObject, {
|
|
328
348
|
target: target2,
|
|
329
349
|
object,
|
|
@@ -388,7 +408,6 @@ var CreateSpaceDialog = () => {
|
|
|
388
408
|
const closeRef = useRef2(null);
|
|
389
409
|
const { t } = useTranslation4(SPACE_PLUGIN);
|
|
390
410
|
const { dispatch } = useIntentDispatcher3();
|
|
391
|
-
const inputSurfaceLookup = useInputSurfaceLookup();
|
|
392
411
|
const handleCreateSpace = useCallback4(async (data) => {
|
|
393
412
|
const program = Effect.gen(function* () {
|
|
394
413
|
const { space } = yield* dispatch(createIntent3(SpaceAction.Create, data));
|
|
@@ -430,7 +449,6 @@ var CreateSpaceDialog = () => {
|
|
|
430
449
|
autoFocus: true,
|
|
431
450
|
values: initialValues,
|
|
432
451
|
schema: SpaceForm,
|
|
433
|
-
lookupComponent: inputSurfaceLookup,
|
|
434
452
|
onSave: handleCreateSpace
|
|
435
453
|
})))
|
|
436
454
|
);
|
|
@@ -439,7 +457,7 @@ var CreateSpaceDialog = () => {
|
|
|
439
457
|
// packages/plugins/plugin-space/src/components/CollectionMain.tsx
|
|
440
458
|
import React5 from "react";
|
|
441
459
|
import { useTranslation as useTranslation5 } from "@dxos/react-ui";
|
|
442
|
-
import { baseSurface,
|
|
460
|
+
import { baseSurface, descriptionText, mx as mx3 } from "@dxos/react-ui-theme";
|
|
443
461
|
var CollectionMain = ({ collection }) => {
|
|
444
462
|
const { t } = useTranslation5(SPACE_PLUGIN);
|
|
445
463
|
return /* @__PURE__ */ React5.createElement("div", {
|
|
@@ -448,7 +466,7 @@ var CollectionMain = ({ collection }) => {
|
|
|
448
466
|
"data-testid": "composer.firstRunMessage"
|
|
449
467
|
}, /* @__PURE__ */ React5.createElement("p", {
|
|
450
468
|
role: "alert",
|
|
451
|
-
className: mx3(
|
|
469
|
+
className: mx3(descriptionText, "border border-dashed border-neutral-400/50 rounded-lg p-8 font-normal text-lg max-is-[24rem] break-words")
|
|
452
470
|
}, collection.name ?? t("unnamed collection label")));
|
|
453
471
|
};
|
|
454
472
|
|
|
@@ -576,15 +594,14 @@ var JoinDialog = ({ navigableCollections, onDone, ...props }) => {
|
|
|
576
594
|
|
|
577
595
|
// packages/plugins/plugin-space/src/components/MembersContainer.tsx
|
|
578
596
|
import { Check, X } from "@phosphor-icons/react";
|
|
579
|
-
import React8, {
|
|
597
|
+
import React8, { useMemo, useState as useState3 } from "react";
|
|
580
598
|
import { QR } from "react-qr-rounded";
|
|
581
|
-
import { createIntent as createIntent5, useIntentDispatcher as useIntentDispatcher5 } from "@dxos/app-framework";
|
|
582
599
|
import { log } from "@dxos/log";
|
|
583
600
|
import { useConfig } from "@dxos/react-client";
|
|
584
601
|
import { fullyQualifiedId as fullyQualifiedId2, useSpaceInvitations } from "@dxos/react-client/echo";
|
|
585
602
|
import { Invitation, InvitationEncoder } from "@dxos/react-client/invitations";
|
|
586
|
-
import { Button as Button4, Clipboard, Icon as Icon4,
|
|
587
|
-
import {
|
|
603
|
+
import { Button as Button4, Clipboard, Icon as Icon4, useId, useTranslation as useTranslation8 } from "@dxos/react-ui";
|
|
604
|
+
import { ControlSection, ControlFrame, ControlFrameItem } from "@dxos/react-ui-form";
|
|
588
605
|
import { StackItem } from "@dxos/react-ui-stack";
|
|
589
606
|
import { getSize as getSize2, mx as mx4 } from "@dxos/react-ui-theme";
|
|
590
607
|
import { AuthCode, BifurcatedAction, Centered, Emoji, InvitationList, SpaceMemberList, Viewport } from "@dxos/shell/react";
|
|
@@ -599,7 +616,7 @@ var handleInvitationEvent = (invitation, subscription) => {
|
|
|
599
616
|
authCode: invitation.authCode
|
|
600
617
|
}), void 0, {
|
|
601
618
|
F: __dxlog_file3,
|
|
602
|
-
L:
|
|
619
|
+
L: 38,
|
|
603
620
|
S: void 0,
|
|
604
621
|
C: (f, a) => f(...a)
|
|
605
622
|
});
|
|
@@ -607,9 +624,8 @@ var handleInvitationEvent = (invitation, subscription) => {
|
|
|
607
624
|
}
|
|
608
625
|
};
|
|
609
626
|
var MembersContainer = ({ space, createInvitationUrl }) => {
|
|
610
|
-
const { t } = useTranslation8(
|
|
627
|
+
const { t } = useTranslation8("os");
|
|
611
628
|
const config = useConfig();
|
|
612
|
-
const { dispatchPromise: dispatch } = useIntentDispatcher5();
|
|
613
629
|
const invitations = useSpaceInvitations(space.key);
|
|
614
630
|
const visibleInvitations = invitations?.filter((invitation) => ![
|
|
615
631
|
Invitation.State.CANCELLED
|
|
@@ -620,59 +636,42 @@ var MembersContainer = ({ space, createInvitationUrl }) => {
|
|
|
620
636
|
localStorage.setItem(activeActionKey, nextAction);
|
|
621
637
|
};
|
|
622
638
|
const target = space.properties[CollectionType.typename]?.target?.objects[0]?.target;
|
|
623
|
-
const locked = space.properties[COMPOSER_SPACE_LOCK];
|
|
624
|
-
const handleChangeLocked = useCallback6(() => {
|
|
625
|
-
space.properties[COMPOSER_SPACE_LOCK] = !locked;
|
|
626
|
-
}, [
|
|
627
|
-
locked,
|
|
628
|
-
space
|
|
629
|
-
]);
|
|
630
639
|
const inviteActions = useMemo(() => ({
|
|
631
640
|
inviteOne: {
|
|
632
|
-
label: t("invite one label",
|
|
633
|
-
|
|
634
|
-
}),
|
|
635
|
-
description: t("invite one description", {
|
|
636
|
-
ns: "os"
|
|
637
|
-
}),
|
|
641
|
+
label: t("invite one label"),
|
|
642
|
+
description: t("invite one description"),
|
|
638
643
|
icon: () => /* @__PURE__ */ React8.createElement(Icon4, {
|
|
639
644
|
icon: "ph--user-plus--regular",
|
|
640
645
|
size: 5
|
|
641
646
|
}),
|
|
642
647
|
testId: "membersContainer.inviteOne",
|
|
643
|
-
onClick:
|
|
644
|
-
const
|
|
645
|
-
space,
|
|
648
|
+
onClick: () => {
|
|
649
|
+
const invitation = space.share?.({
|
|
646
650
|
type: Invitation.Type.INTERACTIVE,
|
|
647
651
|
authMethod: Invitation.AuthMethod.SHARED_SECRET,
|
|
648
652
|
multiUse: false,
|
|
649
653
|
target: target && fullyQualifiedId2(target)
|
|
650
|
-
})
|
|
654
|
+
});
|
|
651
655
|
if (invitation && config.values.runtime?.app?.env?.DX_ENVIRONMENT !== "production") {
|
|
652
656
|
const subscription = invitation.subscribe((invitation2) => handleInvitationEvent(invitation2, subscription));
|
|
653
657
|
}
|
|
654
658
|
}
|
|
655
659
|
},
|
|
656
660
|
inviteMany: {
|
|
657
|
-
label: t("invite many label",
|
|
658
|
-
|
|
659
|
-
}),
|
|
660
|
-
description: t("invite many description", {
|
|
661
|
-
ns: "os"
|
|
662
|
-
}),
|
|
661
|
+
label: t("invite many label"),
|
|
662
|
+
description: t("invite many description"),
|
|
663
663
|
icon: () => /* @__PURE__ */ React8.createElement(Icon4, {
|
|
664
664
|
icon: "ph--users-three--regular",
|
|
665
665
|
size: 5
|
|
666
666
|
}),
|
|
667
667
|
testId: "membersContainer.inviteMany",
|
|
668
|
-
onClick:
|
|
669
|
-
const
|
|
670
|
-
space,
|
|
668
|
+
onClick: () => {
|
|
669
|
+
const invitation = space.share?.({
|
|
671
670
|
type: Invitation.Type.DELEGATED,
|
|
672
671
|
authMethod: Invitation.AuthMethod.KNOWN_PUBLIC_KEY,
|
|
673
672
|
multiUse: true,
|
|
674
673
|
target: target && fullyQualifiedId2(target)
|
|
675
|
-
})
|
|
674
|
+
});
|
|
676
675
|
if (invitation && config.values.runtime?.app?.env?.DX_ENVIRONMENT !== "production") {
|
|
677
676
|
const subscription = invitation.subscribe((invitation2) => handleInvitationEvent(invitation2, subscription));
|
|
678
677
|
}
|
|
@@ -691,27 +690,33 @@ var MembersContainer = ({ space, createInvitationUrl }) => {
|
|
|
691
690
|
setSelectedInvitation(null);
|
|
692
691
|
};
|
|
693
692
|
return /* @__PURE__ */ React8.createElement(Clipboard.Provider, null, /* @__PURE__ */ React8.createElement(StackItem.Content, {
|
|
694
|
-
classNames: "block overflow-y-auto"
|
|
695
|
-
}, /* @__PURE__ */ React8.createElement(
|
|
696
|
-
title: t("members verbose label"
|
|
697
|
-
|
|
693
|
+
classNames: "p-2 block overflow-y-auto"
|
|
694
|
+
}, /* @__PURE__ */ React8.createElement(ControlSection, {
|
|
695
|
+
title: t("members verbose label", {
|
|
696
|
+
ns: SPACE_PLUGIN
|
|
697
|
+
}),
|
|
698
|
+
description: t("members description", {
|
|
699
|
+
ns: SPACE_PLUGIN
|
|
700
|
+
})
|
|
698
701
|
}, /* @__PURE__ */ React8.createElement(ControlFrame, null, /* @__PURE__ */ React8.createElement(ControlFrameItem, {
|
|
699
|
-
title: t("members label"
|
|
702
|
+
title: t("members label", {
|
|
703
|
+
ns: SPACE_PLUGIN
|
|
704
|
+
})
|
|
700
705
|
}, /* @__PURE__ */ React8.createElement(SpaceMemberList, {
|
|
701
706
|
spaceKey: space.key,
|
|
702
707
|
includeSelf: true
|
|
703
|
-
})),
|
|
704
|
-
title: t("invitations label"
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
}, t("locked space description"))), !locked && /* @__PURE__ */ React8.createElement(ControlFrameItem, {
|
|
708
|
-
title: t("invitations label")
|
|
708
|
+
})), /* @__PURE__ */ React8.createElement(ControlFrameItem, {
|
|
709
|
+
title: t("invitations label", {
|
|
710
|
+
ns: SPACE_PLUGIN
|
|
711
|
+
})
|
|
709
712
|
}, selectedInvitation && /* @__PURE__ */ React8.createElement(InvitationSection, {
|
|
710
713
|
...selectedInvitation,
|
|
711
714
|
onBack: handleBack
|
|
712
715
|
}), !selectedInvitation && /* @__PURE__ */ React8.createElement(React8.Fragment, null, /* @__PURE__ */ React8.createElement("p", {
|
|
713
716
|
className: "text-description mbe-2"
|
|
714
|
-
}, t("space invitation description"
|
|
717
|
+
}, t("space invitation description", {
|
|
718
|
+
ns: SPACE_PLUGIN
|
|
719
|
+
})), /* @__PURE__ */ React8.createElement(InvitationList, {
|
|
715
720
|
className: "mb-2",
|
|
716
721
|
send: handleSend,
|
|
717
722
|
invitations: visibleInvitations ?? [],
|
|
@@ -722,15 +727,6 @@ var MembersContainer = ({ space, createInvitationUrl }) => {
|
|
|
722
727
|
activeAction,
|
|
723
728
|
onChangeActiveAction: setActiveAction,
|
|
724
729
|
"data-testid": "membersContainer.createInvitation"
|
|
725
|
-
})))), /* @__PURE__ */ React8.createElement("div", {
|
|
726
|
-
className: "justify-center gap-4 p-0 mbs-4 container-max-width grid grid-cols-1 md:grid-cols-[1fr_min-content]"
|
|
727
|
-
}, /* @__PURE__ */ React8.createElement(ControlItemInput, {
|
|
728
|
-
title: t("space locked label"),
|
|
729
|
-
description: t("space locked description")
|
|
730
|
-
}, /* @__PURE__ */ React8.createElement(Input.Switch, {
|
|
731
|
-
checked: locked,
|
|
732
|
-
onCheckedChange: handleChangeLocked,
|
|
733
|
-
classNames: "justify-self-end"
|
|
734
730
|
})))))));
|
|
735
731
|
};
|
|
736
732
|
var InvitationSection = ({ state = Invitation.State.INIT, authCode, invitationId = "never", url = "never", onBack }) => {
|
|
@@ -841,22 +837,116 @@ var MenuFooter = ({ object }) => {
|
|
|
841
837
|
}), toLocalizedString2(spaceName, t)))) : null;
|
|
842
838
|
};
|
|
843
839
|
|
|
844
|
-
// packages/plugins/plugin-space/src/components/
|
|
845
|
-
import
|
|
846
|
-
import { Surface } from "@dxos/app-framework";
|
|
840
|
+
// packages/plugins/plugin-space/src/components/ObjectSettingsContainer/ObjectSettingsContainer.tsx
|
|
841
|
+
import React13, { useMemo as useMemo2 } from "react";
|
|
842
|
+
import { Surface as Surface2 } from "@dxos/app-framework";
|
|
847
843
|
import { Clipboard as Clipboard2 } from "@dxos/react-ui";
|
|
848
844
|
import { StackItem as StackItem2 } from "@dxos/react-ui-stack";
|
|
849
845
|
|
|
850
|
-
// packages/plugins/plugin-space/src/components/
|
|
851
|
-
import
|
|
852
|
-
import {
|
|
846
|
+
// packages/plugins/plugin-space/src/components/ObjectSettingsContainer/AdvancedObjectSettings.tsx
|
|
847
|
+
import React11, { useCallback as useCallback7, useState as useState4 } from "react";
|
|
848
|
+
import { ForeignKeySchema } from "@dxos/echo-schema";
|
|
849
|
+
import { getMeta } from "@dxos/react-client/echo";
|
|
850
|
+
import { IconButton as IconButton2, useTranslation as useTranslation11 } from "@dxos/react-ui";
|
|
851
|
+
import { Form as Form3 } from "@dxos/react-ui-form";
|
|
852
|
+
|
|
853
|
+
// packages/plugins/plugin-space/src/components/ObjectSettingsContainer/ForeignKeys.tsx
|
|
854
|
+
import React10, { useCallback as useCallback6 } from "react";
|
|
855
|
+
import { IconButton, List, ListItem, useTranslation as useTranslation10 } from "@dxos/react-ui";
|
|
856
|
+
var ForeignKeys = ({ keys, onDelete }) => {
|
|
857
|
+
return /* @__PURE__ */ React10.createElement(List, {
|
|
858
|
+
classNames: "flex flex-col gap-2"
|
|
859
|
+
}, keys.map((key) => /* @__PURE__ */ React10.createElement(KeyItem, {
|
|
860
|
+
key: key.id,
|
|
861
|
+
forignKey: key,
|
|
862
|
+
onDelete
|
|
863
|
+
})));
|
|
864
|
+
};
|
|
865
|
+
var KeyItem = ({ forignKey, onDelete }) => {
|
|
866
|
+
const { t } = useTranslation10(SPACE_PLUGIN);
|
|
867
|
+
const handleDelete = useCallback6(() => {
|
|
868
|
+
onDelete?.(forignKey);
|
|
869
|
+
}, [
|
|
870
|
+
forignKey,
|
|
871
|
+
onDelete
|
|
872
|
+
]);
|
|
873
|
+
return /* @__PURE__ */ React10.createElement(ListItem.Root, {
|
|
874
|
+
classNames: "px-2"
|
|
875
|
+
}, /* @__PURE__ */ React10.createElement(ListItem.Heading, {
|
|
876
|
+
classNames: "flex flex-col grow truncate"
|
|
877
|
+
}, /* @__PURE__ */ React10.createElement("div", null, forignKey.source), /* @__PURE__ */ React10.createElement("div", {
|
|
878
|
+
className: "text-description text-sm truncate"
|
|
879
|
+
}, forignKey.id)), /* @__PURE__ */ React10.createElement(ListItem.Endcap, null, /* @__PURE__ */ React10.createElement(IconButton, {
|
|
880
|
+
iconOnly: true,
|
|
881
|
+
icon: "ph--x--regular",
|
|
882
|
+
variant: "ghost",
|
|
883
|
+
label: t("delete key"),
|
|
884
|
+
onClick: handleDelete
|
|
885
|
+
})));
|
|
886
|
+
};
|
|
887
|
+
|
|
888
|
+
// packages/plugins/plugin-space/src/components/ObjectSettingsContainer/AdvancedObjectSettings.tsx
|
|
889
|
+
var initialValues2 = {
|
|
890
|
+
source: "",
|
|
891
|
+
id: ""
|
|
892
|
+
};
|
|
893
|
+
var AdvancedObjectSettings = ({ object }) => {
|
|
894
|
+
const { t } = useTranslation11(SPACE_PLUGIN);
|
|
895
|
+
const [adding, setAdding] = useState4(false);
|
|
896
|
+
const keys = getMeta(object).keys;
|
|
897
|
+
const handleNew = useCallback7(() => setAdding(true), []);
|
|
898
|
+
const handleCancel = useCallback7(() => setAdding(false), []);
|
|
899
|
+
const handleSave = useCallback7((key) => {
|
|
900
|
+
const index = keys.findIndex(({ source, id }) => source === key.source && id === key.id);
|
|
901
|
+
if (index === -1) {
|
|
902
|
+
keys.push(key);
|
|
903
|
+
}
|
|
904
|
+
setAdding(false);
|
|
905
|
+
}, [
|
|
906
|
+
keys
|
|
907
|
+
]);
|
|
908
|
+
const handleDelete = useCallback7((key) => {
|
|
909
|
+
const index = keys.findIndex(({ source, id }) => source === key.source && id === key.id);
|
|
910
|
+
if (index !== -1) {
|
|
911
|
+
keys.splice(index, 1);
|
|
912
|
+
}
|
|
913
|
+
}, [
|
|
914
|
+
keys
|
|
915
|
+
]);
|
|
916
|
+
return /* @__PURE__ */ React11.createElement(React11.Fragment, null, /* @__PURE__ */ React11.createElement("div", {
|
|
917
|
+
className: "p-2 flex flex-col gap-4"
|
|
918
|
+
}, /* @__PURE__ */ React11.createElement("h2", null, t("advanced settings label")), /* @__PURE__ */ React11.createElement("div", {
|
|
919
|
+
className: "flex items-center"
|
|
920
|
+
}, /* @__PURE__ */ React11.createElement("h3", {
|
|
921
|
+
className: "text-sm font-semibold"
|
|
922
|
+
}, t("foreign keys")), /* @__PURE__ */ React11.createElement("div", {
|
|
923
|
+
className: "grow"
|
|
924
|
+
}), /* @__PURE__ */ React11.createElement(IconButton2, {
|
|
925
|
+
classNames: adding && "invisible",
|
|
926
|
+
icon: "ph--plus--regular",
|
|
927
|
+
label: t("add key"),
|
|
928
|
+
onClick: handleNew
|
|
929
|
+
})), !adding && /* @__PURE__ */ React11.createElement(ForeignKeys, {
|
|
930
|
+
keys,
|
|
931
|
+
onDelete: handleDelete
|
|
932
|
+
})), adding && /* @__PURE__ */ React11.createElement(Form3, {
|
|
933
|
+
schema: ForeignKeySchema,
|
|
934
|
+
values: initialValues2,
|
|
935
|
+
onSave: handleSave,
|
|
936
|
+
onCancel: handleCancel
|
|
937
|
+
}));
|
|
938
|
+
};
|
|
939
|
+
|
|
940
|
+
// packages/plugins/plugin-space/src/components/ObjectSettingsContainer/BaseObjectSettings.tsx
|
|
941
|
+
import React12, { useRef as useRef3 } from "react";
|
|
942
|
+
import { Input, useTranslation as useTranslation12 } from "@dxos/react-ui";
|
|
853
943
|
import { mx as mx5 } from "@dxos/react-ui-theme";
|
|
854
944
|
var BaseObjectSettings = ({ classNames, children, object }) => {
|
|
855
|
-
const { t } =
|
|
945
|
+
const { t } = useTranslation12(meta.id);
|
|
856
946
|
const inputRef = useRef3(null);
|
|
857
|
-
return /* @__PURE__ */
|
|
947
|
+
return /* @__PURE__ */ React12.createElement("form", {
|
|
858
948
|
className: mx5("flex flex-col p-2 gap-2", classNames)
|
|
859
|
-
}, /* @__PURE__ */
|
|
949
|
+
}, /* @__PURE__ */ React12.createElement(Input.Root, null, /* @__PURE__ */ React12.createElement(Input.Label, null, t("name label")), /* @__PURE__ */ React12.createElement(Input.TextInput, {
|
|
860
950
|
ref: inputRef,
|
|
861
951
|
placeholder: t("name placeholder"),
|
|
862
952
|
value: object.name ?? "",
|
|
@@ -871,34 +961,36 @@ var BaseObjectSettings = ({ classNames, children, object }) => {
|
|
|
871
961
|
})), children);
|
|
872
962
|
};
|
|
873
963
|
|
|
874
|
-
// packages/plugins/plugin-space/src/components/
|
|
964
|
+
// packages/plugins/plugin-space/src/components/ObjectSettingsContainer/ObjectSettingsContainer.tsx
|
|
875
965
|
var ObjectSettingsContainer = ({ object, role }) => {
|
|
876
966
|
const data = useMemo2(() => ({
|
|
877
967
|
subject: object
|
|
878
968
|
}), [
|
|
879
969
|
object
|
|
880
970
|
]);
|
|
881
|
-
return /* @__PURE__ */
|
|
971
|
+
return /* @__PURE__ */ React13.createElement(Clipboard2.Provider, null, /* @__PURE__ */ React13.createElement(StackItem2.Content, {
|
|
882
972
|
toolbar: false,
|
|
883
973
|
role
|
|
884
|
-
}, /* @__PURE__ */
|
|
974
|
+
}, /* @__PURE__ */ React13.createElement("div", {
|
|
885
975
|
className: "flex flex-col overflow-y-auto divide-y divide-separator"
|
|
886
|
-
}, /* @__PURE__ */
|
|
976
|
+
}, /* @__PURE__ */ React13.createElement(BaseObjectSettings, {
|
|
887
977
|
object
|
|
888
|
-
}, /* @__PURE__ */
|
|
978
|
+
}, /* @__PURE__ */ React13.createElement(Surface2, {
|
|
889
979
|
role: "base-object-settings",
|
|
890
980
|
data
|
|
891
|
-
})), /* @__PURE__ */
|
|
981
|
+
})), /* @__PURE__ */ React13.createElement(Surface2, {
|
|
892
982
|
role: "object-settings",
|
|
893
983
|
data
|
|
984
|
+
}), /* @__PURE__ */ React13.createElement(AdvancedObjectSettings, {
|
|
985
|
+
object
|
|
894
986
|
}))));
|
|
895
987
|
};
|
|
896
988
|
|
|
897
989
|
// packages/plugins/plugin-space/src/components/PersistenceStatus.tsx
|
|
898
990
|
import { ArrowsCounterClockwise, CheckCircle as CheckCircle2, Warning } from "@phosphor-icons/react";
|
|
899
|
-
import
|
|
991
|
+
import React14, { useEffect as useEffect2, useState as useState5 } from "react";
|
|
900
992
|
import { debounce } from "@dxos/async";
|
|
901
|
-
import { Tooltip, useTranslation as
|
|
993
|
+
import { Tooltip, useTranslation as useTranslation13 } from "@dxos/react-ui";
|
|
902
994
|
import { getSize as getSize3, mx as mx6, staticPlaceholderText, warningText } from "@dxos/react-ui-theme";
|
|
903
995
|
var Status;
|
|
904
996
|
(function(Status2) {
|
|
@@ -907,10 +999,10 @@ var Status;
|
|
|
907
999
|
Status2[Status2["ERROR"] = 2] = "ERROR";
|
|
908
1000
|
})(Status || (Status = {}));
|
|
909
1001
|
var PersistenceStatus = ({ db }) => {
|
|
910
|
-
const { t } =
|
|
911
|
-
const [displayMessage, setDisplayMessage] =
|
|
912
|
-
const [status, naturalSetStatus] =
|
|
913
|
-
const [prevStatus, setPrevStatus] =
|
|
1002
|
+
const { t } = useTranslation13(SPACE_PLUGIN);
|
|
1003
|
+
const [displayMessage, setDisplayMessage] = useState5(false);
|
|
1004
|
+
const [status, naturalSetStatus] = useState5(0);
|
|
1005
|
+
const [prevStatus, setPrevStatus] = useState5(0);
|
|
914
1006
|
const _setStatus = debounce(naturalSetStatus, 500);
|
|
915
1007
|
useEffect2(() => {
|
|
916
1008
|
setPrevStatus(status);
|
|
@@ -924,50 +1016,92 @@ var PersistenceStatus = ({ db }) => {
|
|
|
924
1016
|
]);
|
|
925
1017
|
switch (status) {
|
|
926
1018
|
case 2:
|
|
927
|
-
return /* @__PURE__ */
|
|
1019
|
+
return /* @__PURE__ */ React14.createElement("div", {
|
|
928
1020
|
className: "flex items-center"
|
|
929
|
-
}, /* @__PURE__ */
|
|
1021
|
+
}, /* @__PURE__ */ React14.createElement(Warning, {
|
|
930
1022
|
className: mx6(getSize3(4), "me-1")
|
|
931
|
-
}), /* @__PURE__ */
|
|
1023
|
+
}), /* @__PURE__ */ React14.createElement("span", {
|
|
932
1024
|
className: mx6("text-sm", warningText)
|
|
933
1025
|
}, t("persistence error label")));
|
|
934
1026
|
case 1:
|
|
935
|
-
return /* @__PURE__ */
|
|
1027
|
+
return /* @__PURE__ */ React14.createElement("div", {
|
|
936
1028
|
className: "flex items-center"
|
|
937
|
-
}, /* @__PURE__ */
|
|
1029
|
+
}, /* @__PURE__ */ React14.createElement(ArrowsCounterClockwise, {
|
|
938
1030
|
className: mx6(getSize3(4), "me-1")
|
|
939
|
-
}), /* @__PURE__ */
|
|
1031
|
+
}), /* @__PURE__ */ React14.createElement("span", {
|
|
940
1032
|
className: mx6("text-sm", staticPlaceholderText)
|
|
941
1033
|
}, t("persistence pending label")));
|
|
942
1034
|
case 0:
|
|
943
1035
|
default:
|
|
944
|
-
return /* @__PURE__ */
|
|
945
|
-
delayDuration: 400
|
|
1036
|
+
return /* @__PURE__ */ React14.createElement(Tooltip.Root, {
|
|
1037
|
+
delayDuration: 400
|
|
1038
|
+
}, /* @__PURE__ */ React14.createElement(Tooltip.Trigger, {
|
|
946
1039
|
role: "status",
|
|
947
|
-
content: t("persisted locally message"),
|
|
948
1040
|
className: "flex items-center"
|
|
949
|
-
}, /* @__PURE__ */
|
|
1041
|
+
}, /* @__PURE__ */ React14.createElement(CheckCircle2, {
|
|
950
1042
|
className: mx6(getSize3(4), "me-1")
|
|
951
|
-
}), displayMessage && /* @__PURE__ */
|
|
1043
|
+
}), displayMessage && /* @__PURE__ */ React14.createElement("span", {
|
|
952
1044
|
className: mx6("text-sm", staticPlaceholderText)
|
|
953
|
-
}, t("persisted locally label")));
|
|
1045
|
+
}, 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))));
|
|
954
1046
|
}
|
|
955
1047
|
};
|
|
956
1048
|
|
|
1049
|
+
// packages/plugins/plugin-space/src/components/PopoverAddSpace.tsx
|
|
1050
|
+
import React15 from "react";
|
|
1051
|
+
import { createIntent as createIntent5, LayoutAction as LayoutAction5, useIntentDispatcher as useIntentDispatcher5 } from "@dxos/app-framework";
|
|
1052
|
+
import { IconButton as IconButton3, useTranslation as useTranslation14 } from "@dxos/react-ui";
|
|
1053
|
+
var POPOVER_ADD_SPACE = `${SPACE_PLUGIN}/PopoverRenameSpace`;
|
|
1054
|
+
var PopoverAddSpace = () => {
|
|
1055
|
+
const { t } = useTranslation14(SPACE_PLUGIN);
|
|
1056
|
+
const { dispatchPromise: dispatch } = useIntentDispatcher5();
|
|
1057
|
+
return /* @__PURE__ */ React15.createElement("div", {
|
|
1058
|
+
role: "none",
|
|
1059
|
+
className: "grid grid-cols-1 gap-1 [&>button]:justify-start"
|
|
1060
|
+
}, /* @__PURE__ */ React15.createElement(IconButton3, {
|
|
1061
|
+
variant: "ghost",
|
|
1062
|
+
label: t("create space label"),
|
|
1063
|
+
icon: "ph--plus--regular",
|
|
1064
|
+
onClick: () => {
|
|
1065
|
+
void dispatch(createIntent5(SpaceAction.OpenCreateSpace));
|
|
1066
|
+
void dispatch(createIntent5(LayoutAction5.UpdatePopover, {
|
|
1067
|
+
part: "popover",
|
|
1068
|
+
options: {
|
|
1069
|
+
anchorId: "",
|
|
1070
|
+
state: false
|
|
1071
|
+
}
|
|
1072
|
+
}));
|
|
1073
|
+
},
|
|
1074
|
+
"data-testid": "spacePlugin.createSpace"
|
|
1075
|
+
}), /* @__PURE__ */ React15.createElement(IconButton3, {
|
|
1076
|
+
variant: "ghost",
|
|
1077
|
+
label: t("join space label"),
|
|
1078
|
+
icon: "ph--sign-in--regular",
|
|
1079
|
+
onClick: () => {
|
|
1080
|
+
void dispatch(createIntent5(SpaceAction.Join));
|
|
1081
|
+
void dispatch(createIntent5(LayoutAction5.UpdatePopover, {
|
|
1082
|
+
part: "popover",
|
|
1083
|
+
options: {
|
|
1084
|
+
anchorId: "",
|
|
1085
|
+
state: false
|
|
1086
|
+
}
|
|
1087
|
+
}));
|
|
1088
|
+
},
|
|
1089
|
+
"data-testid": "spacePlugin.joinSpace"
|
|
1090
|
+
}));
|
|
1091
|
+
};
|
|
1092
|
+
|
|
957
1093
|
// packages/plugins/plugin-space/src/components/PopoverRenameObject.tsx
|
|
958
|
-
import
|
|
959
|
-
import { createIntent as createIntent6, LayoutAction as LayoutAction5, useIntentDispatcher as useIntentDispatcher6 } from "@dxos/app-framework";
|
|
1094
|
+
import React16, { useCallback as useCallback8, useRef as useRef4, useState as useState6 } from "react";
|
|
960
1095
|
import { log as log2 } from "@dxos/log";
|
|
961
|
-
import { Button as Button5, Input as
|
|
1096
|
+
import { Button as Button5, Input as Input2, Popover, useTranslation as useTranslation15 } from "@dxos/react-ui";
|
|
962
1097
|
var __dxlog_file4 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/PopoverRenameObject.tsx";
|
|
963
1098
|
var POPOVER_RENAME_OBJECT = `${SPACE_PLUGIN}/PopoverRenameObject`;
|
|
964
1099
|
var PopoverRenameObject = ({ object: obj }) => {
|
|
965
|
-
const { t } =
|
|
1100
|
+
const { t } = useTranslation15(SPACE_PLUGIN);
|
|
966
1101
|
const doneButton = useRef4(null);
|
|
967
1102
|
const object = obj;
|
|
968
|
-
const [name, setName] =
|
|
969
|
-
const
|
|
970
|
-
const handleDone = useCallback7(() => {
|
|
1103
|
+
const [name, setName] = useState6(object.name || object.title || "");
|
|
1104
|
+
const handleDone = useCallback8(() => {
|
|
971
1105
|
try {
|
|
972
1106
|
object.name = name;
|
|
973
1107
|
} catch {
|
|
@@ -978,89 +1112,73 @@ var PopoverRenameObject = ({ object: obj }) => {
|
|
|
978
1112
|
err
|
|
979
1113
|
}, {
|
|
980
1114
|
F: __dxlog_file4,
|
|
981
|
-
L:
|
|
1115
|
+
L: 30,
|
|
982
1116
|
S: void 0,
|
|
983
1117
|
C: (f, a) => f(...a)
|
|
984
1118
|
});
|
|
985
1119
|
}
|
|
986
1120
|
}
|
|
987
|
-
void dispatch(createIntent6(LayoutAction5.UpdatePopover, {
|
|
988
|
-
part: "popover",
|
|
989
|
-
options: {
|
|
990
|
-
variant: "react",
|
|
991
|
-
anchorId: "",
|
|
992
|
-
state: false
|
|
993
|
-
}
|
|
994
|
-
}));
|
|
995
1121
|
}, [
|
|
996
1122
|
object,
|
|
997
1123
|
name
|
|
998
1124
|
]);
|
|
999
|
-
return /* @__PURE__ */
|
|
1125
|
+
return /* @__PURE__ */ React16.createElement("div", {
|
|
1000
1126
|
role: "none",
|
|
1001
1127
|
className: "p-1 flex gap-2"
|
|
1002
|
-
}, /* @__PURE__ */
|
|
1128
|
+
}, /* @__PURE__ */ React16.createElement("div", {
|
|
1003
1129
|
role: "none",
|
|
1004
1130
|
className: "flex-1"
|
|
1005
|
-
}, /* @__PURE__ */
|
|
1131
|
+
}, /* @__PURE__ */ React16.createElement(Input2.Root, null, /* @__PURE__ */ React16.createElement(Input2.Label, {
|
|
1006
1132
|
srOnly: true
|
|
1007
|
-
}, t("object name label")), /* @__PURE__ */
|
|
1133
|
+
}, t("object name label")), /* @__PURE__ */ React16.createElement(Input2.TextInput, {
|
|
1008
1134
|
placeholder: t("object placeholder"),
|
|
1009
1135
|
value: name,
|
|
1010
1136
|
"data-testid": "spacePlugin.renameObject.input",
|
|
1011
1137
|
onChange: ({ target: { value } }) => setName(value),
|
|
1012
1138
|
onKeyDown: ({ key }) => key === "Enter" && doneButton.current?.click()
|
|
1013
|
-
}))), /* @__PURE__ */
|
|
1139
|
+
}))), /* @__PURE__ */ React16.createElement(Popover.Close, {
|
|
1140
|
+
asChild: true
|
|
1141
|
+
}, /* @__PURE__ */ React16.createElement(Button5, {
|
|
1014
1142
|
ref: doneButton,
|
|
1015
1143
|
classNames: "self-stretch",
|
|
1016
1144
|
onClick: handleDone
|
|
1017
1145
|
}, t("done label", {
|
|
1018
1146
|
ns: "os"
|
|
1019
|
-
})));
|
|
1147
|
+
}))));
|
|
1020
1148
|
};
|
|
1021
1149
|
|
|
1022
1150
|
// packages/plugins/plugin-space/src/components/PopoverRenameSpace.tsx
|
|
1023
|
-
import
|
|
1024
|
-
import {
|
|
1025
|
-
import { Button as Button6, Input as Input4, Popover, useTranslation as useTranslation13 } from "@dxos/react-ui";
|
|
1151
|
+
import React17, { useCallback as useCallback9, useRef as useRef5, useState as useState7 } from "react";
|
|
1152
|
+
import { Button as Button6, Input as Input3, Popover as Popover2, useTranslation as useTranslation16 } from "@dxos/react-ui";
|
|
1026
1153
|
var POPOVER_RENAME_SPACE = `${SPACE_PLUGIN}/PopoverRenameSpace`;
|
|
1027
1154
|
var PopoverRenameSpace = ({ space }) => {
|
|
1028
|
-
const { t } =
|
|
1155
|
+
const { t } = useTranslation16(SPACE_PLUGIN);
|
|
1029
1156
|
const doneButton = useRef5(null);
|
|
1030
|
-
const [name, setName] =
|
|
1031
|
-
const
|
|
1032
|
-
const handleDone = useCallback8(() => {
|
|
1157
|
+
const [name, setName] = useState7(space.properties.name ?? "");
|
|
1158
|
+
const handleDone = useCallback9(() => {
|
|
1033
1159
|
space.properties.name = name;
|
|
1034
|
-
void dispatch(createIntent7(LayoutAction6.UpdatePopover, {
|
|
1035
|
-
part: "popover",
|
|
1036
|
-
options: {
|
|
1037
|
-
variant: "react",
|
|
1038
|
-
anchorId: "",
|
|
1039
|
-
state: false
|
|
1040
|
-
}
|
|
1041
|
-
}));
|
|
1042
1160
|
}, [
|
|
1043
1161
|
space,
|
|
1044
1162
|
name
|
|
1045
1163
|
]);
|
|
1046
|
-
return /* @__PURE__ */
|
|
1164
|
+
return /* @__PURE__ */ React17.createElement("div", {
|
|
1047
1165
|
role: "none",
|
|
1048
1166
|
className: "p-1 flex gap-2"
|
|
1049
|
-
}, /* @__PURE__ */
|
|
1167
|
+
}, /* @__PURE__ */ React17.createElement("div", {
|
|
1050
1168
|
role: "none",
|
|
1051
1169
|
className: "flex-1"
|
|
1052
|
-
}, /* @__PURE__ */
|
|
1170
|
+
}, /* @__PURE__ */ React17.createElement(Input3.Root, null, /* @__PURE__ */ React17.createElement(Input3.Label, {
|
|
1053
1171
|
srOnly: true
|
|
1054
|
-
}, t("space name label")), /* @__PURE__ */
|
|
1172
|
+
}, t("space name label")), /* @__PURE__ */ React17.createElement(Input3.TextInput, {
|
|
1055
1173
|
defaultValue: space.properties.name ?? "",
|
|
1056
1174
|
placeholder: t("unnamed space label"),
|
|
1057
1175
|
onChange: ({ target: { value } }) => setName(value),
|
|
1058
1176
|
// TODO(wittjosiah): Ideally this should access the popover context to close the popover.
|
|
1059
1177
|
// Currently this is not possible because Radix does not expose the popover context.
|
|
1060
1178
|
onKeyDown: ({ key }) => key === "Enter" && doneButton.current?.click()
|
|
1061
|
-
}))), /* @__PURE__ */
|
|
1179
|
+
}))), /* @__PURE__ */ React17.createElement(Popover2.Close, {
|
|
1062
1180
|
asChild: true
|
|
1063
|
-
}, /* @__PURE__ */
|
|
1181
|
+
}, /* @__PURE__ */ React17.createElement(Button6, {
|
|
1064
1182
|
ref: doneButton,
|
|
1065
1183
|
classNames: "self-stretch",
|
|
1066
1184
|
onClick: handleDone
|
|
@@ -1069,53 +1187,76 @@ var PopoverRenameSpace = ({ space }) => {
|
|
|
1069
1187
|
}))));
|
|
1070
1188
|
};
|
|
1071
1189
|
|
|
1072
|
-
// packages/plugins/plugin-space/src/components/
|
|
1073
|
-
import
|
|
1074
|
-
import {
|
|
1075
|
-
import {
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
const unsubscribe = query.subscribe(() => setSchemas(query.results));
|
|
1084
|
-
return () => unsubscribe();
|
|
1085
|
-
}, [
|
|
1086
|
-
space
|
|
1087
|
-
]);
|
|
1088
|
-
return schemas;
|
|
1190
|
+
// packages/plugins/plugin-space/src/components/ShareSpaceButton.tsx
|
|
1191
|
+
import React18 from "react";
|
|
1192
|
+
import { createIntent as createIntent6, useIntentDispatcher as useIntentDispatcher6 } from "@dxos/app-framework";
|
|
1193
|
+
import { IconButton as IconButton4, useTranslation as useTranslation17 } from "@dxos/react-ui";
|
|
1194
|
+
var ShareSpaceButton = ({ space }) => {
|
|
1195
|
+
const { dispatchPromise: dispatch } = useIntentDispatcher6();
|
|
1196
|
+
return /* @__PURE__ */ React18.createElement(ShareSpaceButtonImpl, {
|
|
1197
|
+
onClick: () => dispatch(createIntent6(SpaceAction.Share, {
|
|
1198
|
+
space
|
|
1199
|
+
}))
|
|
1200
|
+
});
|
|
1089
1201
|
};
|
|
1090
|
-
var
|
|
1091
|
-
const { t } =
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
}, /* @__PURE__ */ React15.createElement("div", {
|
|
1099
|
-
role: "none",
|
|
1100
|
-
className: controlItemClasses
|
|
1101
|
-
}, schemas.length === 0 && /* @__PURE__ */ React15.createElement("div", {
|
|
1102
|
-
className: "text-center plb-4"
|
|
1103
|
-
}, t("no schemas found message")), schemas.map((schema) => /* @__PURE__ */ React15.createElement("div", {
|
|
1104
|
-
key: schema.id
|
|
1105
|
-
}, /* @__PURE__ */ React15.createElement("div", null, schema.typename)))))));
|
|
1202
|
+
var ShareSpaceButtonImpl = ({ onClick }) => {
|
|
1203
|
+
const { t } = useTranslation17(SPACE_PLUGIN);
|
|
1204
|
+
return /* @__PURE__ */ React18.createElement(IconButton4, {
|
|
1205
|
+
"data-testid": "spacePlugin.shareSpaceButton",
|
|
1206
|
+
icon: "ph--users--regular",
|
|
1207
|
+
label: t("share space label"),
|
|
1208
|
+
onClick
|
|
1209
|
+
});
|
|
1106
1210
|
};
|
|
1107
1211
|
|
|
1108
1212
|
// packages/plugins/plugin-space/src/components/SpacePresence.tsx
|
|
1109
|
-
import {
|
|
1110
|
-
import React16, { forwardRef, useCallback as useCallback9, useEffect as useEffect4, useState as useState8 } from "react";
|
|
1213
|
+
import React19, { useCallback as useCallback10, useEffect as useEffect4, useState as useState9 } from "react";
|
|
1111
1214
|
import { useAppGraph as useAppGraph2, useCapability } from "@dxos/app-framework";
|
|
1112
1215
|
import { generateName } from "@dxos/display-name";
|
|
1113
1216
|
import { PublicKey, useClient as useClient5 } from "@dxos/react-client";
|
|
1114
1217
|
import { getSpace as getSpace3, useMembers, fullyQualifiedId as fullyQualifiedId3 } from "@dxos/react-client/echo";
|
|
1115
1218
|
import { useIdentity } from "@dxos/react-client/halo";
|
|
1116
|
-
import { Avatar, Tooltip as Tooltip2,
|
|
1219
|
+
import { Avatar, Tooltip as Tooltip2, useTranslation as useTranslation18, List as List2, ListItem as ListItem2, useDefaultValue } from "@dxos/react-ui";
|
|
1117
1220
|
import { AttentionGlyph, useAttended, useAttention } from "@dxos/react-ui-attention";
|
|
1118
1221
|
import { ComplexMap, keyToFallback } from "@dxos/util";
|
|
1222
|
+
|
|
1223
|
+
// packages/plugins/plugin-space/src/hooks/usePath.ts
|
|
1224
|
+
import { useEffect as useEffect3, useState as useState8 } from "react";
|
|
1225
|
+
var usePath = (graph, id, timeout) => {
|
|
1226
|
+
const [pathState, setPathState] = useState8(id ? graph.getPath({
|
|
1227
|
+
target: id
|
|
1228
|
+
}) : void 0);
|
|
1229
|
+
useEffect3(() => {
|
|
1230
|
+
if (!id && pathState) {
|
|
1231
|
+
setPathState(void 0);
|
|
1232
|
+
}
|
|
1233
|
+
if (pathState?.at(-1) === id || !id) {
|
|
1234
|
+
return;
|
|
1235
|
+
}
|
|
1236
|
+
const frame = requestAnimationFrame(async () => {
|
|
1237
|
+
try {
|
|
1238
|
+
const path = await graph.waitForPath({
|
|
1239
|
+
target: id
|
|
1240
|
+
}, {
|
|
1241
|
+
timeout
|
|
1242
|
+
});
|
|
1243
|
+
if (path) {
|
|
1244
|
+
setPathState(path);
|
|
1245
|
+
}
|
|
1246
|
+
} catch {
|
|
1247
|
+
}
|
|
1248
|
+
});
|
|
1249
|
+
return () => cancelAnimationFrame(frame);
|
|
1250
|
+
}, [
|
|
1251
|
+
graph,
|
|
1252
|
+
id,
|
|
1253
|
+
timeout,
|
|
1254
|
+
pathState
|
|
1255
|
+
]);
|
|
1256
|
+
return pathState;
|
|
1257
|
+
};
|
|
1258
|
+
|
|
1259
|
+
// packages/plugins/plugin-space/src/components/SpacePresence.tsx
|
|
1119
1260
|
var REFRESH_INTERVAL = 5e3;
|
|
1120
1261
|
var ACTIVITY_DURATION = 3e4;
|
|
1121
1262
|
var noViewers = new ComplexMap(PublicKey.hash);
|
|
@@ -1126,13 +1267,13 @@ var SpacePresence = ({ object, spaceKey }) => {
|
|
|
1126
1267
|
const identity = useIdentity();
|
|
1127
1268
|
const space = spaceKey ? client.spaces.get(spaceKey) : getSpace3(object);
|
|
1128
1269
|
const spaceMembers = useMembers(space?.key);
|
|
1129
|
-
const [_moment, setMoment] =
|
|
1270
|
+
const [_moment, setMoment] = useState9(Date.now());
|
|
1130
1271
|
useEffect4(() => {
|
|
1131
1272
|
const interval = setInterval(() => setMoment(Date.now()), REFRESH_INTERVAL);
|
|
1132
1273
|
return () => clearInterval(interval);
|
|
1133
1274
|
}, []);
|
|
1134
|
-
const memberOnline =
|
|
1135
|
-
const memberIsNotSelf =
|
|
1275
|
+
const memberOnline = useCallback10((member) => member.presence === 1, []);
|
|
1276
|
+
const memberIsNotSelf = useCallback10((member) => !identity?.identityKey.equals(member.identity.identityKey), [
|
|
1136
1277
|
identity?.identityKey
|
|
1137
1278
|
]);
|
|
1138
1279
|
if (!identity || !spaceState || !space) {
|
|
@@ -1149,7 +1290,7 @@ var SpacePresence = ({ object, spaceKey }) => {
|
|
|
1149
1290
|
lastSeen
|
|
1150
1291
|
};
|
|
1151
1292
|
}).toSorted((a, b) => a.lastSeen - b.lastSeen);
|
|
1152
|
-
return /* @__PURE__ */
|
|
1293
|
+
return /* @__PURE__ */ React19.createElement(FullPresence, {
|
|
1153
1294
|
members: membersForObject
|
|
1154
1295
|
});
|
|
1155
1296
|
};
|
|
@@ -1159,66 +1300,62 @@ var FullPresence = (props) => {
|
|
|
1159
1300
|
if (members.length === 0) {
|
|
1160
1301
|
return null;
|
|
1161
1302
|
}
|
|
1162
|
-
return /* @__PURE__ */
|
|
1303
|
+
return /* @__PURE__ */ React19.createElement("div", {
|
|
1163
1304
|
className: "dx-avatar-group",
|
|
1164
1305
|
"data-testid": "spacePlugin.presence"
|
|
1165
|
-
}, members.slice(0, 3).map((member, i) => /* @__PURE__ */
|
|
1166
|
-
key: member.identity.identityKey.toHex()
|
|
1167
|
-
|
|
1168
|
-
content: getName(member.identity),
|
|
1169
|
-
className: "grid focus:outline-none"
|
|
1170
|
-
}, /* @__PURE__ */ React16.createElement(PresenceAvatar, {
|
|
1306
|
+
}, members.slice(0, 3).map((member, i) => /* @__PURE__ */ React19.createElement(Tooltip2.Root, {
|
|
1307
|
+
key: member.identity.identityKey.toHex()
|
|
1308
|
+
}, /* @__PURE__ */ React19.createElement(Tooltip2.Trigger, null, /* @__PURE__ */ React19.createElement(PrensenceAvatar, {
|
|
1171
1309
|
identity: member.identity,
|
|
1172
1310
|
match: member.currentlyAttended,
|
|
1173
1311
|
index: members.length - i,
|
|
1174
1312
|
onClick: () => onMemberClick?.(member),
|
|
1175
1313
|
size
|
|
1176
|
-
}))
|
|
1177
|
-
|
|
1178
|
-
}, /* @__PURE__ */
|
|
1314
|
+
})), /* @__PURE__ */ React19.createElement(Tooltip2.Portal, null, /* @__PURE__ */ React19.createElement(Tooltip2.Content, {
|
|
1315
|
+
side: "bottom"
|
|
1316
|
+
}, /* @__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, {
|
|
1179
1317
|
status: "inactive",
|
|
1180
1318
|
style: {
|
|
1181
1319
|
zIndex: members.length - 4
|
|
1182
1320
|
},
|
|
1183
|
-
fallback: `+${members.length - 3}
|
|
1184
|
-
|
|
1185
|
-
}))), /* @__PURE__ */ React16.createElement(Popover2.Portal, null, /* @__PURE__ */ React16.createElement(Popover2.Content, {
|
|
1321
|
+
fallback: `+${members.length - 3}`
|
|
1322
|
+
}))), /* @__PURE__ */ React19.createElement(Tooltip2.Portal, null, /* @__PURE__ */ React19.createElement(Tooltip2.Content, {
|
|
1186
1323
|
side: "bottom"
|
|
1187
|
-
}, /* @__PURE__ */
|
|
1324
|
+
}, /* @__PURE__ */ React19.createElement(Tooltip2.Arrow, null), /* @__PURE__ */ React19.createElement(List2, {
|
|
1188
1325
|
classNames: "max-h-56 overflow-y-auto"
|
|
1189
|
-
}, members.map((member) => /* @__PURE__ */
|
|
1326
|
+
}, members.map((member) => /* @__PURE__ */ React19.createElement(ListItem2.Root, {
|
|
1190
1327
|
key: member.identity.identityKey.toHex(),
|
|
1191
1328
|
classNames: "flex gap-2 items-center cursor-pointer mbe-2",
|
|
1192
1329
|
onClick: () => onMemberClick?.(member),
|
|
1193
1330
|
"data-testid": "identity-list-item"
|
|
1194
|
-
}, /* @__PURE__ */
|
|
1331
|
+
}, /* @__PURE__ */ React19.createElement(PrensenceAvatar, {
|
|
1195
1332
|
identity: member.identity,
|
|
1196
1333
|
size,
|
|
1197
1334
|
showName: true,
|
|
1198
1335
|
match: member.currentlyAttended
|
|
1199
1336
|
}))))))));
|
|
1200
1337
|
};
|
|
1201
|
-
var
|
|
1338
|
+
var PrensenceAvatar = ({ identity, showName, match, index, onClick, size }) => {
|
|
1202
1339
|
const status = match ? "current" : "active";
|
|
1203
1340
|
const fallbackValue = keyToFallback(identity.identityKey);
|
|
1204
|
-
return /* @__PURE__ */
|
|
1341
|
+
return /* @__PURE__ */ React19.createElement(Avatar.Root, null, /* @__PURE__ */ React19.createElement(Avatar.Content, {
|
|
1205
1342
|
status,
|
|
1206
1343
|
hue: identity.profile?.data?.hue || fallbackValue.hue,
|
|
1207
1344
|
"data-testid": "spacePlugin.presence.member",
|
|
1208
1345
|
"data-status": status,
|
|
1209
1346
|
size,
|
|
1347
|
+
classNames: "mbs-2 mie-4",
|
|
1210
1348
|
...index ? {
|
|
1211
1349
|
style: {
|
|
1212
1350
|
zIndex: index
|
|
1213
1351
|
}
|
|
1214
1352
|
} : {},
|
|
1215
|
-
onClick,
|
|
1216
|
-
fallback: identity.profile?.data?.emoji || fallbackValue.emoji
|
|
1217
|
-
|
|
1218
|
-
}), /* @__PURE__ */ React16.createElement(Avatar.Label, {
|
|
1353
|
+
onClick: () => onClick?.(),
|
|
1354
|
+
fallback: identity.profile?.data?.emoji || fallbackValue.emoji
|
|
1355
|
+
}), /* @__PURE__ */ React19.createElement(Avatar.Label, {
|
|
1219
1356
|
classNames: showName ? "text-sm truncate pli-2" : "sr-only"
|
|
1220
1357
|
}, getName(identity)));
|
|
1221
|
-
}
|
|
1358
|
+
};
|
|
1222
1359
|
var SmallPresenceLive = ({ id, open, viewers }) => {
|
|
1223
1360
|
const { hasAttention, isAncestor, isRelated } = useAttention(id);
|
|
1224
1361
|
const isAttended = hasAttention || isAncestor || isRelated;
|
|
@@ -1226,12 +1363,12 @@ var SmallPresenceLive = ({ id, open, viewers }) => {
|
|
|
1226
1363
|
const attended = useAttended();
|
|
1227
1364
|
const startOfAttention = attended.at(-1);
|
|
1228
1365
|
const path = usePath(graph, startOfAttention);
|
|
1229
|
-
const containsAttended = !open && !isAttended && id &&
|
|
1366
|
+
const containsAttended = !open && !isAttended && id && path ? path.includes(id) : false;
|
|
1230
1367
|
const getActiveViewers = (viewers2) => {
|
|
1231
1368
|
const moment = Date.now();
|
|
1232
1369
|
return Array.from(viewers2.values()).filter((viewer) => moment - viewer.lastSeen < ACTIVITY_DURATION);
|
|
1233
1370
|
};
|
|
1234
|
-
const [activeViewers, setActiveViewers] =
|
|
1371
|
+
const [activeViewers, setActiveViewers] = useState9(viewers ? getActiveViewers(viewers) : []);
|
|
1235
1372
|
useEffect4(() => {
|
|
1236
1373
|
if (viewers) {
|
|
1237
1374
|
setActiveViewers(getActiveViewers(viewers));
|
|
@@ -1243,96 +1380,59 @@ var SmallPresenceLive = ({ id, open, viewers }) => {
|
|
|
1243
1380
|
}, [
|
|
1244
1381
|
viewers
|
|
1245
1382
|
]);
|
|
1246
|
-
return /* @__PURE__ */
|
|
1383
|
+
return /* @__PURE__ */ React19.createElement(SmallPresence, {
|
|
1247
1384
|
count: activeViewers.length,
|
|
1248
1385
|
attended: isAttended,
|
|
1249
1386
|
containsAttended
|
|
1250
1387
|
});
|
|
1251
1388
|
};
|
|
1252
1389
|
var SmallPresence = ({ count = 0, attended, containsAttended }) => {
|
|
1253
|
-
const { t } =
|
|
1254
|
-
return /* @__PURE__ */
|
|
1255
|
-
asChild: true
|
|
1256
|
-
|
|
1257
|
-
count
|
|
1258
|
-
}),
|
|
1259
|
-
side: "bottom"
|
|
1260
|
-
}, /* @__PURE__ */ React16.createElement(AttentionGlyph, {
|
|
1390
|
+
const { t } = useTranslation18(SPACE_PLUGIN);
|
|
1391
|
+
return /* @__PURE__ */ React19.createElement(Tooltip2.Root, null, /* @__PURE__ */ React19.createElement(Tooltip2.Trigger, {
|
|
1392
|
+
asChild: true
|
|
1393
|
+
}, /* @__PURE__ */ React19.createElement(AttentionGlyph, {
|
|
1261
1394
|
attended,
|
|
1262
1395
|
containsAttended,
|
|
1263
1396
|
presence: count > 1 ? "many" : count === 1 ? "one" : "none",
|
|
1264
1397
|
classNames: "self-center mie-1"
|
|
1265
|
-
}))
|
|
1398
|
+
})), /* @__PURE__ */ React19.createElement(Tooltip2.Portal, null, /* @__PURE__ */ React19.createElement(Tooltip2.Content, {
|
|
1399
|
+
side: "bottom"
|
|
1400
|
+
}, /* @__PURE__ */ React19.createElement("span", null, t("presence label", {
|
|
1401
|
+
count
|
|
1402
|
+
})), /* @__PURE__ */ React19.createElement(Tooltip2.Arrow, null))));
|
|
1266
1403
|
};
|
|
1267
1404
|
|
|
1268
1405
|
// packages/plugins/plugin-space/src/components/SpacePluginSettings.tsx
|
|
1269
|
-
import
|
|
1270
|
-
import {
|
|
1271
|
-
import { useClient as useClient6 } from "@dxos/react-client";
|
|
1272
|
-
import { useSpaces as useSpaces2 } from "@dxos/react-client/echo";
|
|
1273
|
-
import { Input as Input5, toLocalizedString as toLocalizedString3, useTranslation as useTranslation16, List as List2, ListItem as ListItem2, Button as Button7 } from "@dxos/react-ui";
|
|
1406
|
+
import React20 from "react";
|
|
1407
|
+
import { Input as Input4, useTranslation as useTranslation19 } from "@dxos/react-ui";
|
|
1274
1408
|
import { DeprecatedFormContainer, DeprecatedFormInput } from "@dxos/react-ui-form";
|
|
1275
1409
|
var SpacePluginSettings = ({ settings }) => {
|
|
1276
|
-
const { t } =
|
|
1277
|
-
|
|
1278
|
-
const client = useClient6();
|
|
1279
|
-
const spaces = useSpaces2({
|
|
1280
|
-
all: settings.showHidden
|
|
1281
|
-
});
|
|
1282
|
-
return /* @__PURE__ */ React17.createElement(DeprecatedFormContainer, null, /* @__PURE__ */ React17.createElement(DeprecatedFormInput, {
|
|
1410
|
+
const { t } = useTranslation19(SPACE_PLUGIN);
|
|
1411
|
+
return /* @__PURE__ */ React20.createElement(DeprecatedFormContainer, null, /* @__PURE__ */ React20.createElement(DeprecatedFormInput, {
|
|
1283
1412
|
label: t("show hidden spaces label")
|
|
1284
|
-
}, /* @__PURE__ */
|
|
1413
|
+
}, /* @__PURE__ */ React20.createElement(Input4.Switch, {
|
|
1285
1414
|
checked: settings.showHidden,
|
|
1286
1415
|
onCheckedChange: (checked) => settings.showHidden = !!checked
|
|
1287
|
-
}))
|
|
1288
|
-
role: "none"
|
|
1289
|
-
}, /* @__PURE__ */ React17.createElement("h2", {
|
|
1290
|
-
className: "text-xl my-4"
|
|
1291
|
-
}, "Space Settings"), /* @__PURE__ */ React17.createElement(List2, {
|
|
1292
|
-
classNames: "max-w-md mx-auto"
|
|
1293
|
-
}, spaces.map((space) => /* @__PURE__ */ React17.createElement(ListItem2.Root, {
|
|
1294
|
-
key: space.id
|
|
1295
|
-
}, /* @__PURE__ */ React17.createElement(ListItem2.Heading, {
|
|
1296
|
-
classNames: "flex flex-col grow truncate mbe-2"
|
|
1297
|
-
}, toLocalizedString3(getSpaceDisplayName(space, {
|
|
1298
|
-
personal: space === client.spaces.default
|
|
1299
|
-
}), t)), /* @__PURE__ */ React17.createElement(ListItem2.Endcap, null, /* @__PURE__ */ React17.createElement(Button7, {
|
|
1300
|
-
onClick: () => dispatch(createIntent8(SpaceAction.OpenSettings, {
|
|
1301
|
-
space
|
|
1302
|
-
}))
|
|
1303
|
-
}, t("open space settings label"))))))));
|
|
1416
|
+
})));
|
|
1304
1417
|
};
|
|
1305
1418
|
|
|
1306
|
-
// packages/plugins/plugin-space/src/components/SpaceSettings/
|
|
1307
|
-
import {
|
|
1308
|
-
import React18, { useCallback as useCallback10, useMemo as useMemo3, useState as useState9 } from "react";
|
|
1309
|
-
import { chain as chain2, createIntent as createIntent9, LayoutAction as LayoutAction7, useIntentDispatcher as useIntentDispatcher9 } from "@dxos/app-framework";
|
|
1419
|
+
// packages/plugins/plugin-space/src/components/SpaceSettings/SpacePropertiesForm.tsx
|
|
1420
|
+
import React21, { useCallback as useCallback11, useMemo as useMemo3, useState as useState10 } from "react";
|
|
1310
1421
|
import { log as log3 } from "@dxos/log";
|
|
1311
1422
|
import { EdgeReplicationSetting } from "@dxos/protocols/proto/dxos/echo/metadata";
|
|
1312
|
-
import {
|
|
1313
|
-
import {
|
|
1314
|
-
import { Button as Button8, Input as Input6, useMulticastObservable, useTranslation as useTranslation17 } from "@dxos/react-ui";
|
|
1315
|
-
import { Form as Form3, ControlItem, ControlItemInput as ControlItemInput2, ControlSection as ControlSection3, ControlPage as ControlPage3 } from "@dxos/react-ui-form";
|
|
1423
|
+
import { Input as Input5, useTranslation as useTranslation20 } from "@dxos/react-ui";
|
|
1424
|
+
import { Form as Form4, ControlItem, ControlItemInput } from "@dxos/react-ui-form";
|
|
1316
1425
|
import { HuePicker, IconPicker } from "@dxos/react-ui-pickers";
|
|
1317
|
-
|
|
1318
|
-
var
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
})
|
|
1323
|
-
})));
|
|
1324
|
-
var SpaceSettingsContainer = ({ space }) => {
|
|
1325
|
-
const { t } = useTranslation17(SPACE_PLUGIN);
|
|
1326
|
-
const { dispatchPromise: dispatch } = useIntentDispatcher9();
|
|
1327
|
-
const client = useClient7();
|
|
1328
|
-
const archived = useMulticastObservable(space.state) === SpaceState2.SPACE_INACTIVE;
|
|
1329
|
-
const [edgeReplication, setEdgeReplication] = useState9(space.internal.data.edgeReplication === EdgeReplicationSetting.ENABLED);
|
|
1330
|
-
const toggleEdgeReplication = useCallback10(async (next) => {
|
|
1426
|
+
var __dxlog_file5 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/SpaceSettings/SpacePropertiesForm.tsx";
|
|
1427
|
+
var SpacePropertiesForm = ({ space }) => {
|
|
1428
|
+
const { t } = useTranslation20(SPACE_PLUGIN);
|
|
1429
|
+
const [edgeReplication, setEdgeReplication] = useState10(space.internal.data.edgeReplication === EdgeReplicationSetting.ENABLED);
|
|
1430
|
+
const toggleEdgeReplication = useCallback11(async (next) => {
|
|
1331
1431
|
setEdgeReplication(next);
|
|
1332
1432
|
await space?.internal.setEdgeReplicationPreference(next ? EdgeReplicationSetting.ENABLED : EdgeReplicationSetting.DISABLED).catch((err) => {
|
|
1333
1433
|
log3.catch(err, void 0, {
|
|
1334
1434
|
F: __dxlog_file5,
|
|
1335
|
-
L:
|
|
1435
|
+
L: 34,
|
|
1336
1436
|
S: void 0,
|
|
1337
1437
|
C: (f, a) => f(...a)
|
|
1338
1438
|
});
|
|
@@ -1341,7 +1441,7 @@ var SpaceSettingsContainer = ({ space }) => {
|
|
|
1341
1441
|
}, [
|
|
1342
1442
|
space
|
|
1343
1443
|
]);
|
|
1344
|
-
const handleSave =
|
|
1444
|
+
const handleSave = useCallback11((properties) => {
|
|
1345
1445
|
void toggleEdgeReplication(properties.edgeReplication);
|
|
1346
1446
|
if (properties.name !== space.properties.name) {
|
|
1347
1447
|
space.properties.name = properties.name;
|
|
@@ -1352,46 +1452,31 @@ var SpaceSettingsContainer = ({ space }) => {
|
|
|
1352
1452
|
if (properties.hue !== space.properties.hue) {
|
|
1353
1453
|
space.properties.hue = properties.hue;
|
|
1354
1454
|
}
|
|
1355
|
-
if (properties.archived && !archived) {
|
|
1356
|
-
void dispatch(pipe2(createIntent9(SpaceAction.Close, {
|
|
1357
|
-
space
|
|
1358
|
-
}), chain2(LayoutAction7.SwitchWorkspace, {
|
|
1359
|
-
part: "workspace",
|
|
1360
|
-
subject: client.spaces.default.id
|
|
1361
|
-
})));
|
|
1362
|
-
} else if (!properties.archived && archived) {
|
|
1363
|
-
void dispatch(createIntent9(SpaceAction.Open, {
|
|
1364
|
-
space
|
|
1365
|
-
}));
|
|
1366
|
-
}
|
|
1367
1455
|
}, [
|
|
1368
1456
|
space,
|
|
1369
|
-
toggleEdgeReplication
|
|
1370
|
-
archived
|
|
1457
|
+
toggleEdgeReplication
|
|
1371
1458
|
]);
|
|
1372
1459
|
const values = useMemo3(() => ({
|
|
1373
1460
|
name: space.properties.name,
|
|
1374
1461
|
icon: space.properties.icon,
|
|
1375
1462
|
hue: space.properties.hue,
|
|
1376
|
-
edgeReplication
|
|
1377
|
-
archived
|
|
1463
|
+
edgeReplication
|
|
1378
1464
|
}), [
|
|
1379
1465
|
space.properties.name,
|
|
1380
1466
|
space.properties.icon,
|
|
1381
1467
|
space.properties.hue,
|
|
1382
|
-
edgeReplication
|
|
1383
|
-
archived
|
|
1468
|
+
edgeReplication
|
|
1384
1469
|
]);
|
|
1385
1470
|
const customElements = useMemo3(() => ({
|
|
1386
1471
|
name: ({ type, label, getValue, onValueChange }) => {
|
|
1387
|
-
const handleChange =
|
|
1472
|
+
const handleChange = useCallback11(({ target: { value } }) => onValueChange(type, value), [
|
|
1388
1473
|
onValueChange,
|
|
1389
1474
|
type
|
|
1390
1475
|
]);
|
|
1391
|
-
return /* @__PURE__ */
|
|
1476
|
+
return /* @__PURE__ */ React21.createElement(ControlItemInput, {
|
|
1392
1477
|
title: label,
|
|
1393
1478
|
description: t("display name description")
|
|
1394
|
-
}, /* @__PURE__ */
|
|
1479
|
+
}, /* @__PURE__ */ React21.createElement(Input5.TextInput, {
|
|
1395
1480
|
value: getValue(),
|
|
1396
1481
|
onChange: handleChange,
|
|
1397
1482
|
placeholder: t("display name input placeholder"),
|
|
@@ -1399,18 +1484,18 @@ var SpaceSettingsContainer = ({ space }) => {
|
|
|
1399
1484
|
}));
|
|
1400
1485
|
},
|
|
1401
1486
|
icon: ({ type, label, getValue, onValueChange }) => {
|
|
1402
|
-
const handleChange =
|
|
1487
|
+
const handleChange = useCallback11((nextEmoji) => onValueChange(type, nextEmoji), [
|
|
1403
1488
|
onValueChange,
|
|
1404
1489
|
type
|
|
1405
1490
|
]);
|
|
1406
|
-
const handleEmojiReset =
|
|
1491
|
+
const handleEmojiReset = useCallback11(() => onValueChange(type, void 0), [
|
|
1407
1492
|
onValueChange,
|
|
1408
1493
|
type
|
|
1409
1494
|
]);
|
|
1410
|
-
return /* @__PURE__ */
|
|
1495
|
+
return /* @__PURE__ */ React21.createElement(ControlItem, {
|
|
1411
1496
|
title: label,
|
|
1412
1497
|
description: t("icon description")
|
|
1413
|
-
}, /* @__PURE__ */
|
|
1498
|
+
}, /* @__PURE__ */ React21.createElement(IconPicker, {
|
|
1414
1499
|
value: getValue(),
|
|
1415
1500
|
onChange: handleChange,
|
|
1416
1501
|
onReset: handleEmojiReset,
|
|
@@ -1419,18 +1504,18 @@ var SpaceSettingsContainer = ({ space }) => {
|
|
|
1419
1504
|
}));
|
|
1420
1505
|
},
|
|
1421
1506
|
hue: ({ type, label, getValue, onValueChange }) => {
|
|
1422
|
-
const handleChange =
|
|
1507
|
+
const handleChange = useCallback11((nextHue) => onValueChange(type, nextHue), [
|
|
1423
1508
|
onValueChange,
|
|
1424
1509
|
type
|
|
1425
1510
|
]);
|
|
1426
|
-
const handleHueReset =
|
|
1511
|
+
const handleHueReset = useCallback11(() => onValueChange(type, void 0), [
|
|
1427
1512
|
onValueChange,
|
|
1428
1513
|
type
|
|
1429
1514
|
]);
|
|
1430
|
-
return /* @__PURE__ */
|
|
1515
|
+
return /* @__PURE__ */ React21.createElement(ControlItem, {
|
|
1431
1516
|
title: label,
|
|
1432
1517
|
description: t("hue description")
|
|
1433
|
-
}, /* @__PURE__ */
|
|
1518
|
+
}, /* @__PURE__ */ React21.createElement(HuePicker, {
|
|
1434
1519
|
value: getValue(),
|
|
1435
1520
|
onChange: handleChange,
|
|
1436
1521
|
onReset: handleHueReset,
|
|
@@ -1438,70 +1523,172 @@ var SpaceSettingsContainer = ({ space }) => {
|
|
|
1438
1523
|
}));
|
|
1439
1524
|
},
|
|
1440
1525
|
edgeReplication: ({ type, label, getValue, onValueChange }) => {
|
|
1441
|
-
const handleChange =
|
|
1526
|
+
const handleChange = useCallback11((checked) => onValueChange(type, checked), [
|
|
1442
1527
|
onValueChange,
|
|
1443
1528
|
type
|
|
1444
1529
|
]);
|
|
1445
|
-
return /* @__PURE__ */
|
|
1530
|
+
return /* @__PURE__ */ React21.createElement(ControlItemInput, {
|
|
1446
1531
|
title: label,
|
|
1447
1532
|
description: t("edge replication description")
|
|
1448
|
-
}, /* @__PURE__ */
|
|
1533
|
+
}, /* @__PURE__ */ React21.createElement(Input5.Switch, {
|
|
1449
1534
|
checked: getValue(),
|
|
1450
1535
|
onCheckedChange: handleChange,
|
|
1451
1536
|
classNames: "justify-self-end"
|
|
1452
1537
|
}));
|
|
1453
|
-
},
|
|
1454
|
-
archived: ({ type, label, getValue, onValueChange }) => {
|
|
1455
|
-
const handleChange = useCallback10(() => onValueChange(type, !getValue()), [
|
|
1456
|
-
onValueChange,
|
|
1457
|
-
type,
|
|
1458
|
-
getValue
|
|
1459
|
-
]);
|
|
1460
|
-
return /* @__PURE__ */ React18.createElement(ControlItemInput2, {
|
|
1461
|
-
title: label,
|
|
1462
|
-
description: t("archive space description")
|
|
1463
|
-
}, /* @__PURE__ */ React18.createElement(Button8, {
|
|
1464
|
-
disabled: space === client.spaces.default,
|
|
1465
|
-
onClick: handleChange
|
|
1466
|
-
}, getValue() ? t("unarchive space label") : t("archive space label")));
|
|
1467
1538
|
}
|
|
1468
1539
|
}), [
|
|
1469
|
-
t
|
|
1470
|
-
space
|
|
1540
|
+
t
|
|
1471
1541
|
]);
|
|
1472
|
-
return /* @__PURE__ */
|
|
1473
|
-
|
|
1474
|
-
}, /* @__PURE__ */ React18.createElement(ControlPage3, null, /* @__PURE__ */ React18.createElement(ControlSection3, {
|
|
1475
|
-
title: t("space properties settings verbose label", {
|
|
1476
|
-
ns: SPACE_PLUGIN
|
|
1477
|
-
}),
|
|
1478
|
-
description: t("space properties settings description", {
|
|
1479
|
-
ns: SPACE_PLUGIN
|
|
1480
|
-
})
|
|
1481
|
-
}, /* @__PURE__ */ React18.createElement(Form3, {
|
|
1482
|
-
schema: FormSchema,
|
|
1542
|
+
return /* @__PURE__ */ React21.createElement(Form4, {
|
|
1543
|
+
schema: SpaceForm,
|
|
1483
1544
|
values,
|
|
1484
1545
|
autoSave: true,
|
|
1485
1546
|
onSave: handleSave,
|
|
1486
1547
|
Custom: customElements,
|
|
1487
1548
|
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'
|
|
1488
|
-
})
|
|
1549
|
+
});
|
|
1550
|
+
};
|
|
1551
|
+
|
|
1552
|
+
// packages/plugins/plugin-space/src/components/SpaceSettings/SpaceSettingsContainer.tsx
|
|
1553
|
+
import React22, { useCallback as useCallback12, useMemo as useMemo4 } from "react";
|
|
1554
|
+
import { Surface as Surface3, useCapabilities as useCapabilities2, useCapability as useCapability2 } from "@dxos/app-framework";
|
|
1555
|
+
import { toLocalizedString as toLocalizedString3, useTranslation as useTranslation21 } from "@dxos/react-ui";
|
|
1556
|
+
import { ControlSectionHeading } from "@dxos/react-ui-form";
|
|
1557
|
+
import { Accordion } from "@dxos/react-ui-list";
|
|
1558
|
+
import { StackItem as StackItem3 } from "@dxos/react-ui-stack";
|
|
1559
|
+
import { byPosition } from "@dxos/util";
|
|
1560
|
+
var SPACE_SETTINGS_DIALOG = `${SPACE_PLUGIN}/SpaceSettingsDialog`;
|
|
1561
|
+
var SpaceSettingsContainer = ({ space }) => {
|
|
1562
|
+
const { t } = useTranslation21(SPACE_PLUGIN);
|
|
1563
|
+
const state = useCapability2(SpaceCapabilities.MutableState);
|
|
1564
|
+
const items = useCapabilities2(SpaceCapabilities.SettingsSection).toSorted(byPosition);
|
|
1565
|
+
const data = useMemo4(() => ({
|
|
1566
|
+
subject: space
|
|
1567
|
+
}), [
|
|
1568
|
+
space
|
|
1569
|
+
]);
|
|
1570
|
+
const handleOpenSectionChange = useCallback12((sections) => {
|
|
1571
|
+
state.spaceSettingsOpenSections.splice(0, state.spaceSettingsOpenSections.length, ...sections);
|
|
1572
|
+
}, [
|
|
1573
|
+
state
|
|
1574
|
+
]);
|
|
1575
|
+
return /* @__PURE__ */ React22.createElement(StackItem3.Content, {
|
|
1576
|
+
classNames: "p-2 block overflow-y-auto"
|
|
1577
|
+
}, /* @__PURE__ */ React22.createElement(Accordion.Root, {
|
|
1578
|
+
items,
|
|
1579
|
+
value: state.spaceSettingsOpenSections,
|
|
1580
|
+
onValueChange: handleOpenSectionChange
|
|
1581
|
+
}, ({ items: items2 }) => /* @__PURE__ */ React22.createElement(React22.Fragment, null, items2.map((item) => /* @__PURE__ */ React22.createElement(Accordion.Item, {
|
|
1582
|
+
key: item.id,
|
|
1583
|
+
item,
|
|
1584
|
+
classNames: "container-max-width"
|
|
1585
|
+
}, /* @__PURE__ */ React22.createElement(Accordion.ItemHeader, {
|
|
1586
|
+
classNames: "pie-6",
|
|
1587
|
+
asChild: true
|
|
1588
|
+
}, /* @__PURE__ */ React22.createElement(ControlSectionHeading, {
|
|
1589
|
+
title: toLocalizedString3(item.label, t)
|
|
1590
|
+
})), /* @__PURE__ */ React22.createElement(Accordion.ItemBody, null, /* @__PURE__ */ React22.createElement(Surface3, {
|
|
1591
|
+
role: `space-settings--${item.id}`,
|
|
1592
|
+
data
|
|
1593
|
+
})))))));
|
|
1489
1594
|
};
|
|
1490
1595
|
|
|
1491
1596
|
// packages/plugins/plugin-space/src/components/SyncStatus/InlineSyncStatus.tsx
|
|
1492
|
-
import {
|
|
1493
|
-
import React19, { useEffect as useEffect5, useState as useState10 } from "react";
|
|
1597
|
+
import React23, { useEffect as useEffect6, useState as useState12 } from "react";
|
|
1494
1598
|
import { useAppGraph as useAppGraph3 } from "@dxos/app-framework";
|
|
1495
|
-
import {
|
|
1599
|
+
import { QueryEdgeStatusResponse } from "@dxos/protocols/proto/dxos/client/services";
|
|
1496
1600
|
import { EdgeReplicationSetting as EdgeReplicationSetting2 } from "@dxos/protocols/proto/dxos/echo/metadata";
|
|
1497
|
-
import { useClient as
|
|
1498
|
-
import {
|
|
1499
|
-
import { Tooltip as Tooltip3, useTranslation as useTranslation18 } from "@dxos/react-ui";
|
|
1601
|
+
import { useClient as useClient7 } from "@dxos/react-client";
|
|
1602
|
+
import { Tooltip as Tooltip3, useTranslation as useTranslation22 } from "@dxos/react-ui";
|
|
1500
1603
|
import { AttentionGlyph as AttentionGlyph2, useAttended as useAttended2, useAttention as useAttention2 } from "@dxos/react-ui-attention";
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1604
|
+
|
|
1605
|
+
// packages/plugins/plugin-space/src/components/SyncStatus/sync-state.ts
|
|
1606
|
+
import { useEffect as useEffect5, useState as useState11 } from "react";
|
|
1607
|
+
import { Context } from "@dxos/context";
|
|
1608
|
+
import { EdgeService } from "@dxos/protocols";
|
|
1609
|
+
import { useClient as useClient6 } from "@dxos/react-client";
|
|
1610
|
+
var __dxlog_file6 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/SyncStatus/sync-state.ts";
|
|
1611
|
+
var createEmptyEdgeSyncState = () => ({
|
|
1612
|
+
missingOnLocal: 0,
|
|
1613
|
+
missingOnRemote: 0,
|
|
1614
|
+
localDocumentCount: 0,
|
|
1615
|
+
remoteDocumentCount: 0,
|
|
1616
|
+
differentDocuments: 0
|
|
1617
|
+
});
|
|
1618
|
+
var getSyncSummary = (syncMap) => {
|
|
1619
|
+
return Object.entries(syncMap).reduce((summary, [_spaceId, peerState]) => {
|
|
1620
|
+
summary.missingOnLocal += peerState.missingOnLocal;
|
|
1621
|
+
summary.missingOnRemote += peerState.missingOnRemote;
|
|
1622
|
+
summary.localDocumentCount += peerState.localDocumentCount;
|
|
1623
|
+
summary.remoteDocumentCount += peerState.remoteDocumentCount;
|
|
1624
|
+
summary.differentDocuments += peerState.differentDocuments;
|
|
1625
|
+
return summary;
|
|
1626
|
+
}, createEmptyEdgeSyncState());
|
|
1627
|
+
};
|
|
1628
|
+
var isEdgePeerId = (peerId, spaceId) => peerId.startsWith(`${EdgeService.AUTOMERGE_REPLICATOR}:${spaceId}`);
|
|
1629
|
+
var useSyncState = () => {
|
|
1630
|
+
const client = useClient6();
|
|
1631
|
+
const [spaceState, setSpaceState] = useState11({});
|
|
1504
1632
|
useEffect5(() => {
|
|
1633
|
+
const ctx = new Context(void 0, {
|
|
1634
|
+
F: __dxlog_file6,
|
|
1635
|
+
L: 48
|
|
1636
|
+
});
|
|
1637
|
+
const createSubscriptions = (spaces) => {
|
|
1638
|
+
for (const space of spaces) {
|
|
1639
|
+
if (spaceState[space.id]) {
|
|
1640
|
+
continue;
|
|
1641
|
+
}
|
|
1642
|
+
ctx.onDispose(space.crud.subscribeToSyncState(ctx, ({ peers = [] }) => {
|
|
1643
|
+
const syncState = peers.find((state) => isEdgePeerId(state.peerId, space.id));
|
|
1644
|
+
if (syncState) {
|
|
1645
|
+
setSpaceState((spaceState2) => ({
|
|
1646
|
+
...spaceState2,
|
|
1647
|
+
[space.id]: syncState
|
|
1648
|
+
}));
|
|
1649
|
+
}
|
|
1650
|
+
}));
|
|
1651
|
+
}
|
|
1652
|
+
};
|
|
1653
|
+
createSubscriptions(client.spaces.get());
|
|
1654
|
+
client.spaces.subscribe((spaces) => {
|
|
1655
|
+
createSubscriptions(spaces);
|
|
1656
|
+
});
|
|
1657
|
+
return () => {
|
|
1658
|
+
void ctx.dispose();
|
|
1659
|
+
};
|
|
1660
|
+
}, [
|
|
1661
|
+
client
|
|
1662
|
+
]);
|
|
1663
|
+
return spaceState;
|
|
1664
|
+
};
|
|
1665
|
+
var useSpaceSyncState = (space) => {
|
|
1666
|
+
const [spaceState, setSpaceState] = useState11();
|
|
1667
|
+
useEffect5(() => {
|
|
1668
|
+
const ctx = new Context(void 0, {
|
|
1669
|
+
F: __dxlog_file6,
|
|
1670
|
+
L: 87
|
|
1671
|
+
});
|
|
1672
|
+
space.crud.subscribeToSyncState(ctx, ({ peers = [] }) => {
|
|
1673
|
+
const syncState = peers.find((state) => isEdgePeerId(state.peerId, space.id));
|
|
1674
|
+
if (syncState) {
|
|
1675
|
+
setSpaceState(syncState);
|
|
1676
|
+
}
|
|
1677
|
+
});
|
|
1678
|
+
return () => {
|
|
1679
|
+
void ctx.dispose();
|
|
1680
|
+
};
|
|
1681
|
+
}, [
|
|
1682
|
+
space
|
|
1683
|
+
]);
|
|
1684
|
+
return spaceState;
|
|
1685
|
+
};
|
|
1686
|
+
|
|
1687
|
+
// packages/plugins/plugin-space/src/components/SyncStatus/InlineSyncStatus.tsx
|
|
1688
|
+
var useEdgeStatus = () => {
|
|
1689
|
+
const [status, setStatus] = useState12(QueryEdgeStatusResponse.EdgeStatus.NOT_CONNECTED);
|
|
1690
|
+
const client = useClient7();
|
|
1691
|
+
useEffect6(() => {
|
|
1505
1692
|
client.services.services.EdgeAgentService?.queryEdgeStatus().subscribe(({ status: status2 }) => {
|
|
1506
1693
|
setStatus(status2);
|
|
1507
1694
|
});
|
|
@@ -1511,7 +1698,7 @@ var useEdgeStatus = () => {
|
|
|
1511
1698
|
return status;
|
|
1512
1699
|
};
|
|
1513
1700
|
var InlineSyncStatus = ({ space, open }) => {
|
|
1514
|
-
const { t } =
|
|
1701
|
+
const { t } = useTranslation22(SPACE_PLUGIN);
|
|
1515
1702
|
const id = space.id;
|
|
1516
1703
|
const { hasAttention, isAncestor, isRelated } = useAttention2(id);
|
|
1517
1704
|
const isAttended = hasAttention || isAncestor || isRelated;
|
|
@@ -1519,33 +1706,146 @@ var InlineSyncStatus = ({ space, open }) => {
|
|
|
1519
1706
|
const attended = useAttended2();
|
|
1520
1707
|
const startOfAttention = attended.at(-1);
|
|
1521
1708
|
const path = usePath(graph, startOfAttention);
|
|
1522
|
-
const containsAttended = !open && !isAttended && id &&
|
|
1523
|
-
const connectedToEdge = useEdgeStatus() === EdgeStatus.CONNECTED;
|
|
1709
|
+
const containsAttended = !open && !isAttended && id && path ? path.includes(id) : false;
|
|
1710
|
+
const connectedToEdge = useEdgeStatus() === QueryEdgeStatusResponse.EdgeStatus.CONNECTED;
|
|
1524
1711
|
const edgeSyncEnabled = space.internal.data.edgeReplication === EdgeReplicationSetting2.ENABLED;
|
|
1525
1712
|
const syncState = useSpaceSyncState(space);
|
|
1526
1713
|
const syncing = connectedToEdge && edgeSyncEnabled && syncState && syncState.missingOnLocal > 0;
|
|
1527
|
-
return /* @__PURE__ */
|
|
1528
|
-
asChild: true
|
|
1529
|
-
|
|
1530
|
-
side: "bottom"
|
|
1531
|
-
}, /* @__PURE__ */ React19.createElement(AttentionGlyph2, {
|
|
1714
|
+
return /* @__PURE__ */ React23.createElement(Tooltip3.Root, null, /* @__PURE__ */ React23.createElement(Tooltip3.Trigger, {
|
|
1715
|
+
asChild: true
|
|
1716
|
+
}, /* @__PURE__ */ React23.createElement(AttentionGlyph2, {
|
|
1532
1717
|
syncing,
|
|
1533
1718
|
attended: isAttended,
|
|
1534
1719
|
containsAttended,
|
|
1535
1720
|
classNames: "self-center mie-1"
|
|
1536
|
-
}))
|
|
1721
|
+
})), /* @__PURE__ */ React23.createElement(Tooltip3.Portal, null, /* @__PURE__ */ React23.createElement(Tooltip3.Content, {
|
|
1722
|
+
side: "bottom",
|
|
1723
|
+
classNames: "z-[70]"
|
|
1724
|
+
}, /* @__PURE__ */ React23.createElement("span", null, t("syncing label")), /* @__PURE__ */ React23.createElement(Tooltip3.Arrow, null))));
|
|
1537
1725
|
};
|
|
1538
1726
|
|
|
1539
1727
|
// packages/plugins/plugin-space/src/components/SyncStatus/SyncStatus.tsx
|
|
1540
|
-
import
|
|
1728
|
+
import React25, { useCallback as useCallback13, useEffect as useEffect8, useState as useState14 } from "react";
|
|
1541
1729
|
import { StatusBar } from "@dxos/plugin-status-bar";
|
|
1542
1730
|
import { useClient as useClient9 } from "@dxos/react-client";
|
|
1543
|
-
import {
|
|
1544
|
-
import {
|
|
1731
|
+
import { Icon as Icon6, Input as Input6, Popover as Popover3, useTranslation as useTranslation24 } from "@dxos/react-ui";
|
|
1732
|
+
import { SyntaxHighlighter } from "@dxos/react-ui-syntax-highlighter";
|
|
1733
|
+
import { mx as mx8 } from "@dxos/react-ui-theme";
|
|
1734
|
+
|
|
1735
|
+
// packages/plugins/plugin-space/src/components/SyncStatus/Space.tsx
|
|
1736
|
+
import React24, { useEffect as useEffect7, useState as useState13 } from "react";
|
|
1737
|
+
import { useClient as useClient8 } from "@dxos/react-client";
|
|
1738
|
+
import { useSpace } from "@dxos/react-client/echo";
|
|
1739
|
+
import { Icon as Icon5, toLocalizedString as toLocalizedString4, useTranslation as useTranslation23 } from "@dxos/react-ui";
|
|
1740
|
+
import { mx as mx7 } from "@dxos/react-ui-theme";
|
|
1741
|
+
var SYNC_STALLED_TIMEOUT = 5e3;
|
|
1742
|
+
var styles = {
|
|
1743
|
+
barBg: "bg-neutral-50 dark:bg-green-900 text-black",
|
|
1744
|
+
barFg: "bg-neutral-100 bg-green-500",
|
|
1745
|
+
barHover: "dark:hover:bg-green-500"
|
|
1746
|
+
};
|
|
1747
|
+
var useActive = (count) => {
|
|
1748
|
+
const [current, setCurrent] = useState13(count);
|
|
1749
|
+
const [active, setActive] = useState13(false);
|
|
1750
|
+
useEffect7(() => {
|
|
1751
|
+
let t;
|
|
1752
|
+
if (count !== current) {
|
|
1753
|
+
setActive(true);
|
|
1754
|
+
setCurrent(count);
|
|
1755
|
+
t && clearTimeout(t);
|
|
1756
|
+
t = setTimeout(() => {
|
|
1757
|
+
setActive(false);
|
|
1758
|
+
}, SYNC_STALLED_TIMEOUT);
|
|
1759
|
+
}
|
|
1760
|
+
return () => {
|
|
1761
|
+
setActive(false);
|
|
1762
|
+
clearTimeout(t);
|
|
1763
|
+
};
|
|
1764
|
+
}, [
|
|
1765
|
+
count,
|
|
1766
|
+
current
|
|
1767
|
+
]);
|
|
1768
|
+
return active;
|
|
1769
|
+
};
|
|
1770
|
+
var SpaceRowContainer = ({ spaceId, state }) => {
|
|
1771
|
+
const { t } = useTranslation23(SPACE_PLUGIN);
|
|
1772
|
+
const client = useClient8();
|
|
1773
|
+
const space = useSpace(spaceId);
|
|
1774
|
+
if (!space) {
|
|
1775
|
+
return null;
|
|
1776
|
+
}
|
|
1777
|
+
const spaceName = toLocalizedString4(getSpaceDisplayName(space, {
|
|
1778
|
+
personal: space === client.spaces.default
|
|
1779
|
+
}), t);
|
|
1780
|
+
return /* @__PURE__ */ React24.createElement(SpaceRow, {
|
|
1781
|
+
spaceId,
|
|
1782
|
+
spaceName,
|
|
1783
|
+
state
|
|
1784
|
+
});
|
|
1785
|
+
};
|
|
1786
|
+
var SpaceRow = ({ spaceId, spaceName, state: { localDocumentCount, remoteDocumentCount, missingOnLocal, missingOnRemote } }) => {
|
|
1787
|
+
const downActive = useActive(localDocumentCount);
|
|
1788
|
+
const upActive = useActive(remoteDocumentCount);
|
|
1789
|
+
return /* @__PURE__ */ React24.createElement("div", {
|
|
1790
|
+
className: "flex items-center mx-0.5 gap-0.5 cursor-pointer",
|
|
1791
|
+
title: spaceId,
|
|
1792
|
+
onClick: () => {
|
|
1793
|
+
void navigator.clipboard.writeText(spaceId);
|
|
1794
|
+
}
|
|
1795
|
+
}, /* @__PURE__ */ React24.createElement("span", {
|
|
1796
|
+
className: "is-1/2 truncate"
|
|
1797
|
+
}, spaceName), /* @__PURE__ */ React24.createElement(Icon5, {
|
|
1798
|
+
icon: "ph--arrow-fat-line-left--regular",
|
|
1799
|
+
size: 3,
|
|
1800
|
+
classNames: mx7(downActive && "animate-[pulse_1s_infinite]")
|
|
1801
|
+
}), /* @__PURE__ */ React24.createElement(Candle, {
|
|
1802
|
+
up: {
|
|
1803
|
+
count: remoteDocumentCount,
|
|
1804
|
+
total: remoteDocumentCount + missingOnRemote
|
|
1805
|
+
},
|
|
1806
|
+
down: {
|
|
1807
|
+
count: localDocumentCount,
|
|
1808
|
+
total: localDocumentCount + missingOnLocal
|
|
1809
|
+
},
|
|
1810
|
+
title: spaceId
|
|
1811
|
+
}), /* @__PURE__ */ React24.createElement(Icon5, {
|
|
1812
|
+
icon: "ph--arrow-fat-line-right--regular",
|
|
1813
|
+
size: 3,
|
|
1814
|
+
classNames: mx7(upActive && "animate-[pulse_1s_step-start_infinite]")
|
|
1815
|
+
}));
|
|
1816
|
+
};
|
|
1817
|
+
var Candle = ({ classNames, up, down }) => {
|
|
1818
|
+
return /* @__PURE__ */ React24.createElement("div", {
|
|
1819
|
+
className: mx7("grid grid-cols-[1fr_2rem_1fr] w-full h-3", classNames)
|
|
1820
|
+
}, /* @__PURE__ */ React24.createElement(Bar, {
|
|
1821
|
+
classNames: "justify-end",
|
|
1822
|
+
...up
|
|
1823
|
+
}), /* @__PURE__ */ React24.createElement("div", {
|
|
1824
|
+
className: "relative"
|
|
1825
|
+
}, /* @__PURE__ */ React24.createElement("div", {
|
|
1826
|
+
className: mx7("absolute inset-0 flex items-center justify-center text-xs", styles.barBg)
|
|
1827
|
+
}, up.total)), /* @__PURE__ */ React24.createElement(Bar, down));
|
|
1828
|
+
};
|
|
1829
|
+
var Bar = ({ classNames, count, total }) => {
|
|
1830
|
+
let p = count / total * 100;
|
|
1831
|
+
if (count < total) {
|
|
1832
|
+
p = Math.min(p, 95);
|
|
1833
|
+
}
|
|
1834
|
+
return /* @__PURE__ */ React24.createElement("div", {
|
|
1835
|
+
className: mx7("relative flex w-full", styles.barBg, classNames)
|
|
1836
|
+
}, /* @__PURE__ */ React24.createElement("div", {
|
|
1837
|
+
className: mx7("shrink-0", styles.barFg),
|
|
1838
|
+
style: {
|
|
1839
|
+
width: `${p}%`
|
|
1840
|
+
}
|
|
1841
|
+
}), count !== total && /* @__PURE__ */ React24.createElement("div", {
|
|
1842
|
+
className: "absolute top-0 bottom-0 flex items-center mx-0.5 text-black text-xs"
|
|
1843
|
+
}, count));
|
|
1844
|
+
};
|
|
1545
1845
|
|
|
1546
1846
|
// packages/plugins/plugin-space/src/components/SyncStatus/save-tracker.ts
|
|
1547
|
-
import { Context } from "@dxos/context";
|
|
1548
|
-
var
|
|
1847
|
+
import { Context as Context2 } from "@dxos/context";
|
|
1848
|
+
var __dxlog_file7 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/SyncStatus/save-tracker.ts";
|
|
1549
1849
|
var createClientSaveTracker = (client, cb) => {
|
|
1550
1850
|
const CleanupFns = {};
|
|
1551
1851
|
const state = {};
|
|
@@ -1572,8 +1872,8 @@ var createClientSaveTracker = (client, cb) => {
|
|
|
1572
1872
|
};
|
|
1573
1873
|
};
|
|
1574
1874
|
var createSpaceSaveTracker = (space, cb) => {
|
|
1575
|
-
const ctx = new
|
|
1576
|
-
F:
|
|
1875
|
+
const ctx = new Context2(void 0, {
|
|
1876
|
+
F: __dxlog_file7,
|
|
1577
1877
|
L: 40
|
|
1578
1878
|
});
|
|
1579
1879
|
void space.waitUntilReady().then(() => {
|
|
@@ -1635,23 +1935,22 @@ var getIcon = (status) => {
|
|
|
1635
1935
|
};
|
|
1636
1936
|
|
|
1637
1937
|
// packages/plugins/plugin-space/src/components/SyncStatus/SyncStatus.tsx
|
|
1638
|
-
var SYNC_STALLED_TIMEOUT = 5e3;
|
|
1639
1938
|
var SyncStatus = () => {
|
|
1640
1939
|
const client = useClient9();
|
|
1641
1940
|
const state = useSyncState();
|
|
1642
|
-
const [saved, setSaved] =
|
|
1643
|
-
|
|
1941
|
+
const [saved, setSaved] = useState14(true);
|
|
1942
|
+
useEffect8(() => {
|
|
1644
1943
|
return createClientSaveTracker(client, (state2) => {
|
|
1645
1944
|
setSaved(state2 === "saved");
|
|
1646
1945
|
});
|
|
1647
1946
|
}, []);
|
|
1648
|
-
return /* @__PURE__ */
|
|
1947
|
+
return /* @__PURE__ */ React25.createElement(SyncStatusIndicator, {
|
|
1649
1948
|
state,
|
|
1650
1949
|
saved
|
|
1651
1950
|
});
|
|
1652
1951
|
};
|
|
1653
1952
|
var SyncStatusIndicator = ({ state, saved }) => {
|
|
1654
|
-
const { t } =
|
|
1953
|
+
const { t } = useTranslation24(SPACE_PLUGIN);
|
|
1655
1954
|
const summary = getSyncSummary(state);
|
|
1656
1955
|
const offline = Object.values(state).length === 0;
|
|
1657
1956
|
const needsToUpload = summary.differentDocuments > 0 || summary.missingOnRemote > 0;
|
|
@@ -1662,8 +1961,8 @@ var SyncStatusIndicator = ({ state, saved }) => {
|
|
|
1662
1961
|
needsToUpload,
|
|
1663
1962
|
needsToDownload
|
|
1664
1963
|
});
|
|
1665
|
-
const [classNames, setClassNames] =
|
|
1666
|
-
|
|
1964
|
+
const [classNames, setClassNames] = useState14();
|
|
1965
|
+
useEffect8(() => {
|
|
1667
1966
|
setClassNames(void 0);
|
|
1668
1967
|
if (offline || !needsToUpload && !needsToDownload) {
|
|
1669
1968
|
return;
|
|
@@ -1678,14 +1977,60 @@ var SyncStatusIndicator = ({ state, saved }) => {
|
|
|
1678
1977
|
needsToDownload
|
|
1679
1978
|
]);
|
|
1680
1979
|
const title = t(`${status} label`);
|
|
1681
|
-
const icon = /* @__PURE__ */
|
|
1980
|
+
const icon = /* @__PURE__ */ React25.createElement(Icon6, {
|
|
1682
1981
|
icon: getIcon(status),
|
|
1683
1982
|
size: 4,
|
|
1684
1983
|
classNames
|
|
1685
1984
|
});
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1985
|
+
if (offline) {
|
|
1986
|
+
return /* @__PURE__ */ React25.createElement(StatusBar.Item, {
|
|
1987
|
+
title
|
|
1988
|
+
}, icon);
|
|
1989
|
+
} else {
|
|
1990
|
+
return /* @__PURE__ */ React25.createElement(Popover3.Root, null, /* @__PURE__ */ React25.createElement(Popover3.Trigger, {
|
|
1991
|
+
asChild: true
|
|
1992
|
+
}, /* @__PURE__ */ React25.createElement(StatusBar.Button, {
|
|
1993
|
+
title
|
|
1994
|
+
}, icon)), /* @__PURE__ */ React25.createElement(Popover3.Portal, null, /* @__PURE__ */ React25.createElement(Popover3.Content, null, /* @__PURE__ */ React25.createElement(SyncStatusDetail, {
|
|
1995
|
+
state,
|
|
1996
|
+
summary,
|
|
1997
|
+
debug: false
|
|
1998
|
+
}), /* @__PURE__ */ React25.createElement(Popover3.Arrow, null))));
|
|
1999
|
+
}
|
|
2000
|
+
};
|
|
2001
|
+
var SyncStatusDetail = ({ classNames, state, summary, debug }) => {
|
|
2002
|
+
const [showAll, setShowAll] = useState14(false);
|
|
2003
|
+
const { t } = useTranslation24(SPACE_PLUGIN);
|
|
2004
|
+
const entries = Object.entries(state).filter(([_, value]) => showAll || value.missingOnLocal + value.missingOnRemote > 0).toSorted(([a], [b]) => a < b ? -1 : a > b ? 1 : 0);
|
|
2005
|
+
const handleCheckedChange = useCallback13((state2) => setShowAll(state2), [
|
|
2006
|
+
setShowAll
|
|
2007
|
+
]);
|
|
2008
|
+
return /* @__PURE__ */ React25.createElement("div", {
|
|
2009
|
+
className: mx8("flex flex-col gap-3 p-2 text-xs min-w-[400px]", classNames)
|
|
2010
|
+
}, /* @__PURE__ */ React25.createElement("div", {
|
|
2011
|
+
role: "none",
|
|
2012
|
+
className: "flex items-center"
|
|
2013
|
+
}, /* @__PURE__ */ React25.createElement("h1", {
|
|
2014
|
+
className: "flex-1"
|
|
2015
|
+
}, t("sync status title")), /* @__PURE__ */ React25.createElement("div", {
|
|
2016
|
+
className: "flex items-center gap-2"
|
|
2017
|
+
}, /* @__PURE__ */ React25.createElement(Input6.Root, null, /* @__PURE__ */ React25.createElement(Input6.Label, {
|
|
2018
|
+
classNames: "text-xs"
|
|
2019
|
+
}, t("show all label")), /* @__PURE__ */ React25.createElement(Input6.Checkbox, {
|
|
2020
|
+
checked: showAll,
|
|
2021
|
+
onCheckedChange: handleCheckedChange
|
|
2022
|
+
})))), /* @__PURE__ */ React25.createElement("div", {
|
|
2023
|
+
className: "flex flex-col gap-2"
|
|
2024
|
+
}, entries.length === 0 && /* @__PURE__ */ React25.createElement("div", {
|
|
2025
|
+
role: "none",
|
|
2026
|
+
className: "flex justify-center"
|
|
2027
|
+
}, t("no sync status label")), entries.map(([spaceId, state2]) => /* @__PURE__ */ React25.createElement(SpaceRowContainer, {
|
|
2028
|
+
key: spaceId,
|
|
2029
|
+
spaceId,
|
|
2030
|
+
state: state2
|
|
2031
|
+
}))), debug && /* @__PURE__ */ React25.createElement(SyntaxHighlighter, {
|
|
2032
|
+
language: "json"
|
|
2033
|
+
}, JSON.stringify(summary, null, 2)));
|
|
1689
2034
|
};
|
|
1690
2035
|
|
|
1691
2036
|
export {
|
|
@@ -1702,31 +2047,36 @@ export {
|
|
|
1702
2047
|
MenuFooter,
|
|
1703
2048
|
ObjectSettingsContainer,
|
|
1704
2049
|
PersistenceStatus,
|
|
2050
|
+
POPOVER_ADD_SPACE,
|
|
2051
|
+
PopoverAddSpace,
|
|
1705
2052
|
POPOVER_RENAME_OBJECT,
|
|
1706
2053
|
PopoverRenameObject,
|
|
1707
2054
|
POPOVER_RENAME_SPACE,
|
|
1708
2055
|
PopoverRenameSpace,
|
|
1709
|
-
|
|
1710
|
-
|
|
2056
|
+
ShareSpaceButton,
|
|
2057
|
+
ShareSpaceButtonImpl,
|
|
1711
2058
|
SpacePresence,
|
|
1712
2059
|
FullPresence,
|
|
1713
2060
|
SmallPresenceLive,
|
|
1714
2061
|
SmallPresence,
|
|
1715
2062
|
SpacePluginSettings,
|
|
2063
|
+
SpacePropertiesForm,
|
|
2064
|
+
SPACE_SETTINGS_DIALOG,
|
|
1716
2065
|
SpaceSettingsContainer,
|
|
1717
2066
|
InlineSyncStatus,
|
|
1718
2067
|
SyncStatus,
|
|
1719
2068
|
SyncStatusIndicator,
|
|
2069
|
+
SyncStatusDetail,
|
|
1720
2070
|
AppGraphBuilder,
|
|
1721
2071
|
AppGraphSerializer,
|
|
1722
2072
|
IdentityCreated,
|
|
1723
2073
|
IntentResolver,
|
|
1724
2074
|
ReactRoot,
|
|
1725
2075
|
ReactSurface,
|
|
1726
|
-
|
|
1727
|
-
|
|
2076
|
+
Schema,
|
|
2077
|
+
Tools,
|
|
1728
2078
|
SpaceSettings,
|
|
1729
2079
|
SpaceState,
|
|
1730
2080
|
SpacesReady
|
|
1731
2081
|
};
|
|
1732
|
-
//# sourceMappingURL=chunk-
|
|
2082
|
+
//# sourceMappingURL=chunk-BEWBZ4Q4.mjs.map
|