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