@dxos/plugin-space 0.8.2-main.f081794 → 0.8.2-main.fbd8ed0
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-7X3SIPCD.mjs +328 -0
- package/dist/lib/browser/app-graph-builder-7X3SIPCD.mjs.map +7 -0
- package/dist/lib/browser/{app-graph-serializer-6WIAFHYK.mjs → app-graph-serializer-VRU57AEZ.mjs} +6 -6
- package/dist/lib/browser/app-graph-serializer-VRU57AEZ.mjs.map +7 -0
- package/dist/lib/browser/{chunk-MHTZAZT2.mjs → chunk-43UQWMD3.mjs} +327 -535
- package/dist/lib/browser/chunk-43UQWMD3.mjs.map +7 -0
- package/dist/lib/browser/chunk-AR5R2F6B.mjs +88 -0
- package/dist/lib/browser/chunk-AR5R2F6B.mjs.map +7 -0
- package/dist/lib/browser/chunk-CY35NLWL.mjs +296 -0
- package/dist/lib/browser/chunk-CY35NLWL.mjs.map +7 -0
- package/dist/lib/browser/{chunk-FSHDAPFY.mjs → chunk-IQFFOAWD.mjs} +24 -38
- package/dist/lib/browser/chunk-IQFFOAWD.mjs.map +7 -0
- package/dist/lib/browser/{chunk-MIJHUABE.mjs → chunk-UBSVH2NQ.mjs} +3 -4
- package/dist/lib/browser/chunk-UBSVH2NQ.mjs.map +7 -0
- package/dist/lib/browser/{identity-created-DVHNLGYU.mjs → identity-created-ANRJHNMQ.mjs} +3 -3
- package/dist/lib/browser/identity-created-ANRJHNMQ.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +24 -23
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-resolver-72IWBVYE.mjs → intent-resolver-KRINV5QI.mjs} +90 -94
- package/dist/lib/browser/intent-resolver-KRINV5QI.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-root-DRVM5ACV.mjs → react-root-J3SP2HVW.mjs} +5 -4
- package/dist/lib/browser/{react-surface-KODNQYDN.mjs → react-surface-J7T2IMH4.mjs} +6 -30
- package/dist/lib/browser/react-surface-J7T2IMH4.mjs.map +7 -0
- package/dist/lib/browser/schema-defs-OCBY7APN.mjs +26 -0
- package/dist/lib/browser/schema-defs-OCBY7APN.mjs.map +7 -0
- package/dist/lib/browser/{schema-tools-YAXPRIXP.mjs → schema-tools-MYC4LTQD.mjs} +22 -22
- package/dist/lib/browser/schema-tools-MYC4LTQD.mjs.map +7 -0
- package/dist/lib/browser/{settings-2UIV5WX5.mjs → settings-G24447B7.mjs} +2 -2
- package/dist/lib/browser/{spaces-ready-3URIMLCR.mjs → spaces-ready-5I3RKYTT.mjs} +16 -15
- package/dist/lib/browser/spaces-ready-5I3RKYTT.mjs.map +7 -0
- package/dist/lib/browser/{state-CYV6QCTN.mjs → state-SI4B5GHC.mjs} +2 -2
- package/dist/lib/browser/state-SI4B5GHC.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +1 -1
- package/dist/lib/node/app-graph-builder-C2ISDMSL.cjs +328 -0
- package/dist/lib/node/app-graph-builder-C2ISDMSL.cjs.map +7 -0
- package/dist/lib/node/{app-graph-serializer-GOLCQHFQ.cjs → app-graph-serializer-VLBCR3IX.cjs} +22 -22
- package/dist/lib/node/app-graph-serializer-VLBCR3IX.cjs.map +7 -0
- package/dist/lib/node/{chunk-EI3ZPOLJ.cjs → chunk-5YHUQJVB.cjs} +7 -8
- package/dist/lib/node/chunk-5YHUQJVB.cjs.map +7 -0
- package/dist/lib/node/chunk-DQN4ZQDW.cjs +119 -0
- package/dist/lib/node/chunk-DQN4ZQDW.cjs.map +7 -0
- package/dist/lib/node/chunk-K6ZO4WDJ.cjs +324 -0
- package/dist/lib/node/chunk-K6ZO4WDJ.cjs.map +7 -0
- package/dist/lib/node/{chunk-GPZPEQXP.cjs → chunk-MXBE2VET.cjs} +351 -550
- package/dist/lib/node/chunk-MXBE2VET.cjs.map +7 -0
- package/dist/lib/node/{chunk-U63V2254.cjs → chunk-SCATWJKX.cjs} +46 -61
- package/dist/lib/node/chunk-SCATWJKX.cjs.map +7 -0
- package/dist/lib/node/{identity-created-YYTW4K3Z.cjs → identity-created-NIPYGVG3.cjs} +7 -7
- package/dist/lib/node/identity-created-NIPYGVG3.cjs.map +7 -0
- package/dist/lib/node/index.cjs +74 -74
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/{intent-resolver-KA56XGUX.cjs → intent-resolver-MJVRY6YE.cjs} +133 -136
- package/dist/lib/node/intent-resolver-MJVRY6YE.cjs.map +7 -0
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/{react-root-6WGN5WRQ.cjs → react-root-M4BZ6VXB.cjs} +9 -8
- package/dist/lib/node/{react-root-6WGN5WRQ.cjs.map → react-root-M4BZ6VXB.cjs.map} +1 -1
- package/dist/lib/node/{react-surface-37AVZFPL.cjs → react-surface-RYKSYYKM.cjs} +42 -64
- package/dist/lib/node/react-surface-RYKSYYKM.cjs.map +7 -0
- package/dist/lib/node/{schema-PPJ5BZ3A.cjs → schema-defs-2HJLXSNK.cjs} +13 -11
- package/dist/lib/node/schema-defs-2HJLXSNK.cjs.map +7 -0
- package/dist/lib/node/{schema-tools-BLIMOZYY.cjs → schema-tools-OE3MFYYH.cjs} +24 -24
- package/dist/lib/node/schema-tools-OE3MFYYH.cjs.map +7 -0
- package/dist/lib/node/{settings-HJROTHC4.cjs → settings-AFWO4AWK.cjs} +6 -6
- package/dist/lib/node/{spaces-ready-IWDDIAAD.cjs → spaces-ready-BMPXSFHF.cjs} +24 -23
- package/dist/lib/node/spaces-ready-BMPXSFHF.cjs.map +7 -0
- package/dist/lib/node/{state-JLN7TGRR.cjs → state-L2ZSDKLS.cjs} +5 -5
- package/dist/lib/node/state-L2ZSDKLS.cjs.map +7 -0
- package/dist/lib/node/types/index.cjs +15 -15
- package/dist/lib/node/types/index.cjs.map +1 -1
- package/dist/lib/node-esm/app-graph-builder-WVCQZ324.mjs +329 -0
- package/dist/lib/node-esm/app-graph-builder-WVCQZ324.mjs.map +7 -0
- package/dist/lib/node-esm/{app-graph-serializer-AZXSO7HK.mjs → app-graph-serializer-GEUYYXKD.mjs} +6 -6
- package/dist/lib/node-esm/app-graph-serializer-GEUYYXKD.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-DUA32XUX.mjs → chunk-5NIBYPVF.mjs} +3 -4
- package/dist/lib/node-esm/chunk-5NIBYPVF.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-CLRCW6PU.mjs +297 -0
- package/dist/lib/node-esm/chunk-CLRCW6PU.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-ABKX22IP.mjs → chunk-FI3WV22Y.mjs} +327 -535
- package/dist/lib/node-esm/chunk-FI3WV22Y.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-HNKAG5CX.mjs +90 -0
- package/dist/lib/node-esm/chunk-HNKAG5CX.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-TVN6VHTT.mjs → chunk-S2W6HS4A.mjs} +24 -38
- package/dist/lib/node-esm/chunk-S2W6HS4A.mjs.map +7 -0
- package/dist/lib/node-esm/{identity-created-MP4GLXHO.mjs → identity-created-O5X2FFWU.mjs} +3 -3
- package/dist/lib/node-esm/identity-created-O5X2FFWU.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +24 -23
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/{intent-resolver-SG2ECM5R.mjs → intent-resolver-JT6EB47M.mjs} +90 -94
- package/dist/lib/node-esm/intent-resolver-JT6EB47M.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-root-MSUT6S2S.mjs → react-root-S2LW4FS7.mjs} +5 -4
- package/dist/lib/{browser/react-root-DRVM5ACV.mjs.map → node-esm/react-root-S2LW4FS7.mjs.map} +1 -1
- package/dist/lib/node-esm/{react-surface-G73SO23W.mjs → react-surface-ZNNMO7QQ.mjs} +6 -30
- package/dist/lib/node-esm/react-surface-ZNNMO7QQ.mjs.map +7 -0
- package/dist/lib/node-esm/schema-defs-B74N3GQ5.mjs +27 -0
- package/dist/lib/node-esm/schema-defs-B74N3GQ5.mjs.map +7 -0
- package/dist/lib/node-esm/{schema-tools-IU7EX5A5.mjs → schema-tools-YTJLA3NQ.mjs} +22 -22
- package/dist/lib/node-esm/schema-tools-YTJLA3NQ.mjs.map +7 -0
- package/dist/lib/node-esm/{settings-KCLKPJVY.mjs → settings-MJVSCOI4.mjs} +2 -2
- package/dist/lib/node-esm/{spaces-ready-Z3SXKWX2.mjs → spaces-ready-XKG57SL5.mjs} +16 -15
- package/dist/lib/node-esm/spaces-ready-XKG57SL5.mjs.map +7 -0
- package/dist/lib/node-esm/{state-YZPY5T5A.mjs → state-QUDYGEU6.mjs} +2 -2
- package/dist/lib/node-esm/state-QUDYGEU6.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +1 -1
- package/dist/types/src/SpacePlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts +2 -179
- 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 +9 -184
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +4 -3
- 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-defs.d.ts +4 -0
- package/dist/types/src/capabilities/schema-defs.d.ts.map +1 -0
- 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/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.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/AdvancedObjectSettings.d.ts +2 -2
- package/dist/types/src/components/ObjectSettings/AdvancedObjectSettings.d.ts.map +1 -1
- package/dist/types/src/components/ObjectSettings/BaseObjectSettings.d.ts +2 -2
- package/dist/types/src/components/ObjectSettings/BaseObjectSettings.d.ts.map +1 -1
- package/dist/types/src/components/ObjectSettings/ForeignKeys.d.ts.map +1 -1
- package/dist/types/src/components/ObjectSettings/ObjectSettingsContainer.d.ts +2 -2
- package/dist/types/src/components/ObjectSettings/ObjectSettingsContainer.d.ts.map +1 -1
- package/dist/types/src/components/PersistenceStatus.d.ts.map +1 -1
- 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/SchemaContainer.d.ts.map +1 -1
- 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/SpaceSettingsContainer.d.ts.map +1 -1
- package/dist/types/src/components/SyncStatus/InlineSyncStatus.d.ts.map +1 -1
- package/dist/types/src/components/SyncStatus/SyncStatus.d.ts.map +1 -1
- 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/index.d.ts +0 -2
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/hooks/index.d.ts +1 -0
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useActiveSpace.d.ts +4 -0
- package/dist/types/src/hooks/useActiveSpace.d.ts.map +1 -0
- package/dist/types/src/hooks/useInputSurfaceLookup.d.ts +2 -2
- package/dist/types/src/hooks/useInputSurfaceLookup.d.ts.map +1 -1
- package/dist/types/src/hooks/usePath.d.ts +3 -2
- package/dist/types/src/hooks/usePath.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -0
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +2 -263
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/collection.d.ts +9 -8
- package/dist/types/src/types/collection.d.ts.map +1 -1
- package/dist/types/src/types/thread.d.ts +205 -110
- package/dist/types/src/types/thread.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +154 -142
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/src/util.d.ts +10 -16
- package/dist/types/src/util.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +51 -45
- package/src/SpacePlugin.tsx +9 -8
- package/src/capabilities/app-graph-builder.ts +376 -268
- package/src/capabilities/app-graph-serializer.ts +4 -4
- package/src/capabilities/identity-created.ts +3 -3
- package/src/capabilities/index.ts +2 -2
- package/src/capabilities/intent-resolver.ts +85 -95
- package/src/capabilities/react-surface.tsx +17 -38
- package/src/capabilities/schema-defs.ts +30 -0
- package/src/capabilities/schema-tool.test.ts +2 -3
- package/src/capabilities/schema-tools.ts +25 -25
- package/src/capabilities/spaces-ready.ts +14 -12
- package/src/capabilities/state.ts +3 -3
- package/src/components/AwaitingObject.tsx +1 -1
- package/src/components/CollectionMain.tsx +2 -5
- package/src/components/CreateDialog/CreateObjectDialog.stories.tsx +2 -2
- package/src/components/CreateDialog/CreateObjectDialog.tsx +1 -1
- package/src/components/CreateDialog/CreateSpaceDialog.tsx +2 -3
- package/src/components/MembersContainer.stories.tsx +1 -5
- package/src/components/MembersContainer.tsx +23 -15
- package/src/components/MenuFooter.tsx +2 -2
- package/src/components/ObjectSettings/AdvancedObjectSettings.tsx +2 -2
- package/src/components/ObjectSettings/BaseObjectSettings.tsx +2 -2
- package/src/components/ObjectSettings/ObjectSettingsContainer.tsx +4 -4
- package/src/components/PersistenceStatus.tsx +11 -14
- package/src/components/PopoverRenameObject.tsx +12 -6
- package/src/components/PopoverRenameSpace.tsx +8 -0
- package/src/components/SpacePresence.stories.tsx +1 -1
- package/src/components/SpacePresence.tsx +34 -43
- package/src/components/SpaceSettings/SpaceSettingsContainer.tsx +5 -3
- package/src/components/SyncStatus/InlineSyncStatus.tsx +10 -17
- package/src/components/index.ts +0 -2
- package/src/hooks/index.ts +1 -0
- package/src/hooks/useActiveSpace.ts +20 -0
- package/src/hooks/useInputSurfaceLookup.tsx +2 -2
- package/src/hooks/usePath.ts +9 -6
- package/src/index.ts +1 -0
- package/src/translations.ts +1 -2
- package/src/types/collection.ts +6 -4
- package/src/types/thread.ts +14 -8
- package/src/types/types.ts +109 -96
- package/src/util.tsx +36 -73
- package/dist/lib/browser/app-graph-builder-J4PN5HOM.mjs +0 -369
- package/dist/lib/browser/app-graph-builder-J4PN5HOM.mjs.map +0 -7
- package/dist/lib/browser/app-graph-serializer-6WIAFHYK.mjs.map +0 -7
- package/dist/lib/browser/chunk-FSHDAPFY.mjs.map +0 -7
- package/dist/lib/browser/chunk-KDNV4YRD.mjs +0 -283
- package/dist/lib/browser/chunk-KDNV4YRD.mjs.map +0 -7
- package/dist/lib/browser/chunk-MHTZAZT2.mjs.map +0 -7
- package/dist/lib/browser/chunk-MIJHUABE.mjs.map +0 -7
- package/dist/lib/browser/identity-created-DVHNLGYU.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-72IWBVYE.mjs.map +0 -7
- package/dist/lib/browser/react-surface-KODNQYDN.mjs.map +0 -7
- package/dist/lib/browser/schema-FHTA26SW.mjs +0 -24
- package/dist/lib/browser/schema-FHTA26SW.mjs.map +0 -7
- package/dist/lib/browser/schema-tools-YAXPRIXP.mjs.map +0 -7
- package/dist/lib/browser/spaces-ready-3URIMLCR.mjs.map +0 -7
- package/dist/lib/browser/state-CYV6QCTN.mjs.map +0 -7
- package/dist/lib/node/app-graph-builder-3BNPC5GB.cjs +0 -371
- package/dist/lib/node/app-graph-builder-3BNPC5GB.cjs.map +0 -7
- package/dist/lib/node/app-graph-serializer-GOLCQHFQ.cjs.map +0 -7
- package/dist/lib/node/chunk-3UKLWXNJ.cjs +0 -311
- package/dist/lib/node/chunk-3UKLWXNJ.cjs.map +0 -7
- package/dist/lib/node/chunk-EI3ZPOLJ.cjs.map +0 -7
- package/dist/lib/node/chunk-GPZPEQXP.cjs.map +0 -7
- package/dist/lib/node/chunk-U63V2254.cjs.map +0 -7
- package/dist/lib/node/identity-created-YYTW4K3Z.cjs.map +0 -7
- package/dist/lib/node/intent-resolver-KA56XGUX.cjs.map +0 -7
- package/dist/lib/node/react-surface-37AVZFPL.cjs.map +0 -7
- package/dist/lib/node/schema-PPJ5BZ3A.cjs.map +0 -7
- package/dist/lib/node/schema-tools-BLIMOZYY.cjs.map +0 -7
- package/dist/lib/node/spaces-ready-IWDDIAAD.cjs.map +0 -7
- package/dist/lib/node/state-JLN7TGRR.cjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-OVMSUAX3.mjs +0 -370
- package/dist/lib/node-esm/app-graph-builder-OVMSUAX3.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-serializer-AZXSO7HK.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-35OHQARN.mjs +0 -284
- package/dist/lib/node-esm/chunk-35OHQARN.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-ABKX22IP.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-DUA32XUX.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-TVN6VHTT.mjs.map +0 -7
- package/dist/lib/node-esm/identity-created-MP4GLXHO.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-SG2ECM5R.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-G73SO23W.mjs.map +0 -7
- package/dist/lib/node-esm/schema-OUZKVYM5.mjs +0 -25
- package/dist/lib/node-esm/schema-OUZKVYM5.mjs.map +0 -7
- package/dist/lib/node-esm/schema-tools-IU7EX5A5.mjs.map +0 -7
- package/dist/lib/node-esm/spaces-ready-Z3SXKWX2.mjs.map +0 -7
- package/dist/lib/node-esm/state-YZPY5T5A.mjs.map +0 -7
- package/dist/types/src/capabilities/schema.d.ts +0 -4
- package/dist/types/src/capabilities/schema.d.ts.map +0 -1
- package/dist/types/src/components/PopoverAddSpace.d.ts +0 -4
- package/dist/types/src/components/PopoverAddSpace.d.ts.map +0 -1
- package/dist/types/src/components/ShareSpaceButton.d.ts +0 -9
- package/dist/types/src/components/ShareSpaceButton.d.ts.map +0 -1
- package/dist/types/src/components/ShareSpaceButton.stories.d.ts +0 -10
- package/dist/types/src/components/ShareSpaceButton.stories.d.ts.map +0 -1
- package/src/capabilities/schema.ts +0 -27
- package/src/components/PopoverAddSpace.tsx +0 -52
- package/src/components/ShareSpaceButton.stories.tsx +0 -27
- package/src/components/ShareSpaceButton.tsx +0 -32
- /package/dist/lib/{node-esm/react-root-MSUT6S2S.mjs.map → browser/react-root-J3SP2HVW.mjs.map} +0 -0
- /package/dist/lib/browser/{settings-2UIV5WX5.mjs.map → settings-G24447B7.mjs.map} +0 -0
- /package/dist/lib/node/{settings-HJROTHC4.cjs.map → settings-AFWO4AWK.cjs.map} +0 -0
- /package/dist/lib/node-esm/{settings-KCLKPJVY.mjs.map → settings-MJVSCOI4.mjs.map} +0 -0
|
@@ -1,15 +1,19 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useInputSurfaceLookup,
|
|
3
|
+
usePath
|
|
4
|
+
} from "./chunk-AR5R2F6B.mjs";
|
|
1
5
|
import {
|
|
2
6
|
SpaceCapabilities
|
|
3
7
|
} from "./chunk-KVRYWFZU.mjs";
|
|
4
8
|
import {
|
|
5
9
|
COMPOSER_SPACE_LOCK,
|
|
6
10
|
getSpaceDisplayName
|
|
7
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-IQFFOAWD.mjs";
|
|
8
12
|
import {
|
|
9
13
|
CollectionType,
|
|
10
14
|
SpaceAction,
|
|
11
15
|
SpaceForm
|
|
12
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-CY35NLWL.mjs";
|
|
13
17
|
import {
|
|
14
18
|
SPACE_PLUGIN,
|
|
15
19
|
meta
|
|
@@ -33,7 +37,7 @@ var AwaitingObject = ({ id }) => {
|
|
|
33
37
|
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
34
38
|
const layout = useLayout();
|
|
35
39
|
const client = useClient();
|
|
36
|
-
const objects = useQuery(client.spaces, Filter.
|
|
40
|
+
const objects = useQuery(client.spaces, Filter.everything());
|
|
37
41
|
useEffect(() => {
|
|
38
42
|
if (!id) {
|
|
39
43
|
return;
|
|
@@ -110,15 +114,15 @@ var AwaitingObject = ({ id }) => {
|
|
|
110
114
|
|
|
111
115
|
// packages/plugins/plugin-space/src/components/CreateDialog/CreateObjectDialog.tsx
|
|
112
116
|
import { pipe } from "effect";
|
|
113
|
-
import
|
|
114
|
-
import { Capabilities, chain, createIntent as createIntent2, LayoutAction as LayoutAction2, useCapabilities, useIntentDispatcher as useIntentDispatcher2, usePluginManager
|
|
117
|
+
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";
|
|
115
119
|
import { invariant as invariant2 } from "@dxos/invariant";
|
|
116
120
|
import { useClient as useClient2 } from "@dxos/react-client";
|
|
117
121
|
import { getSpace, isLiveObject, isSpace, useSpaces } from "@dxos/react-client/echo";
|
|
118
122
|
import { Button as Button2, Dialog, Icon as Icon2, useTranslation as useTranslation3 } from "@dxos/react-ui";
|
|
119
123
|
|
|
120
124
|
// packages/plugins/plugin-space/src/components/CreateDialog/CreateObjectPanel.tsx
|
|
121
|
-
import
|
|
125
|
+
import React2, { useCallback as useCallback2, useState as useState2 } from "react";
|
|
122
126
|
import { getTypeAnnotation } from "@dxos/echo-schema";
|
|
123
127
|
import { invariant } from "@dxos/invariant";
|
|
124
128
|
import { Icon, toLocalizedString, useTranslation as useTranslation2 } from "@dxos/react-ui";
|
|
@@ -126,77 +130,11 @@ import { Form } from "@dxos/react-ui-form";
|
|
|
126
130
|
import { SearchList } from "@dxos/react-ui-searchlist";
|
|
127
131
|
import { mx as mx2 } from "@dxos/react-ui-theme";
|
|
128
132
|
import { isNonNullable } from "@dxos/util";
|
|
129
|
-
|
|
130
|
-
// packages/plugins/plugin-space/src/hooks/useInputSurfaceLookup.tsx
|
|
131
|
-
import React2, { useCallback as useCallback2 } from "react";
|
|
132
|
-
import { usePluginManager, isSurfaceAvailable, Surface } from "@dxos/app-framework";
|
|
133
|
-
var useInputSurfaceLookup = (baseData) => {
|
|
134
|
-
const pluginManager = usePluginManager();
|
|
135
|
-
return useCallback2(({ prop, schema, inputProps }) => {
|
|
136
|
-
const composedData = {
|
|
137
|
-
prop,
|
|
138
|
-
schema,
|
|
139
|
-
...baseData
|
|
140
|
-
};
|
|
141
|
-
if (!isSurfaceAvailable(pluginManager.context, {
|
|
142
|
-
role: "form-input",
|
|
143
|
-
data: composedData
|
|
144
|
-
})) {
|
|
145
|
-
return void 0;
|
|
146
|
-
}
|
|
147
|
-
return /* @__PURE__ */ React2.createElement(Surface, {
|
|
148
|
-
role: "form-input",
|
|
149
|
-
data: composedData,
|
|
150
|
-
...inputProps
|
|
151
|
-
});
|
|
152
|
-
}, [
|
|
153
|
-
pluginManager,
|
|
154
|
-
baseData
|
|
155
|
-
]);
|
|
156
|
-
};
|
|
157
|
-
|
|
158
|
-
// packages/plugins/plugin-space/src/hooks/usePath.ts
|
|
159
|
-
import { useEffect as useEffect2, useState as useState2 } from "react";
|
|
160
|
-
var usePath = (graph, id, timeout) => {
|
|
161
|
-
const [pathState, setPathState] = useState2(id ? graph.getPath({
|
|
162
|
-
target: id
|
|
163
|
-
}) : void 0);
|
|
164
|
-
useEffect2(() => {
|
|
165
|
-
if (!id && pathState) {
|
|
166
|
-
setPathState(void 0);
|
|
167
|
-
}
|
|
168
|
-
if (pathState?.at(-1) === id || !id) {
|
|
169
|
-
return;
|
|
170
|
-
}
|
|
171
|
-
const frame = requestAnimationFrame(async () => {
|
|
172
|
-
try {
|
|
173
|
-
const path = await graph.waitForPath({
|
|
174
|
-
target: id
|
|
175
|
-
}, {
|
|
176
|
-
timeout
|
|
177
|
-
});
|
|
178
|
-
if (path) {
|
|
179
|
-
setPathState(path);
|
|
180
|
-
}
|
|
181
|
-
} catch {
|
|
182
|
-
}
|
|
183
|
-
});
|
|
184
|
-
return () => cancelAnimationFrame(frame);
|
|
185
|
-
}, [
|
|
186
|
-
graph,
|
|
187
|
-
id,
|
|
188
|
-
timeout,
|
|
189
|
-
pathState
|
|
190
|
-
]);
|
|
191
|
-
return pathState;
|
|
192
|
-
};
|
|
193
|
-
|
|
194
|
-
// packages/plugins/plugin-space/src/components/CreateDialog/CreateObjectPanel.tsx
|
|
195
133
|
var __dxlog_file = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/CreateDialog/CreateObjectPanel.tsx";
|
|
196
134
|
var CreateObjectPanel = ({ classNames, forms, spaces, typename: initialTypename, target: initialTarget, name: initialName, defaultSpaceId, resolve, onCreateObject }) => {
|
|
197
135
|
const { t } = useTranslation2(SPACE_PLUGIN);
|
|
198
|
-
const [typename, setTypename] =
|
|
199
|
-
const [target, setTarget] =
|
|
136
|
+
const [typename, setTypename] = useState2(initialTypename);
|
|
137
|
+
const [target, setTarget] = useState2(initialTarget);
|
|
200
138
|
const form = forms.find((form2) => getTypeAnnotation(form2.objectSchema)?.typename === typename);
|
|
201
139
|
const options = forms.map((form2) => getTypeAnnotation(form2.objectSchema)).filter(isNonNullable).sort((a, b) => {
|
|
202
140
|
const nameA = t("typename label", {
|
|
@@ -209,7 +147,7 @@ var CreateObjectPanel = ({ classNames, forms, spaces, typename: initialTypename,
|
|
|
209
147
|
});
|
|
210
148
|
return nameA.localeCompare(nameB);
|
|
211
149
|
});
|
|
212
|
-
const handleCreateObject =
|
|
150
|
+
const handleCreateObject = useCallback2(async (props) => {
|
|
213
151
|
if (!form || !target) {
|
|
214
152
|
return;
|
|
215
153
|
}
|
|
@@ -223,7 +161,7 @@ var CreateObjectPanel = ({ classNames, forms, spaces, typename: initialTypename,
|
|
|
223
161
|
form,
|
|
224
162
|
target
|
|
225
163
|
]);
|
|
226
|
-
const handleSetTypename =
|
|
164
|
+
const handleSetTypename = useCallback2(async (typename2) => {
|
|
227
165
|
invariant(target, "target is required", {
|
|
228
166
|
F: __dxlog_file,
|
|
229
167
|
L: 72,
|
|
@@ -250,18 +188,18 @@ var CreateObjectPanel = ({ classNames, forms, spaces, typename: initialTypename,
|
|
|
250
188
|
const inputSurfaceLookup = useInputSurfaceLookup({
|
|
251
189
|
target
|
|
252
190
|
});
|
|
253
|
-
return /* @__PURE__ */
|
|
191
|
+
return /* @__PURE__ */ React2.createElement("div", {
|
|
254
192
|
role: "form",
|
|
255
193
|
className: mx2("flex flex-col gap-2", classNames)
|
|
256
|
-
}, !form ? /* @__PURE__ */
|
|
194
|
+
}, !form ? /* @__PURE__ */ React2.createElement(SelectSchema, {
|
|
257
195
|
options,
|
|
258
196
|
resolve,
|
|
259
197
|
onChange: handleSetTypename
|
|
260
|
-
}) : !target ? /* @__PURE__ */
|
|
198
|
+
}) : !target ? /* @__PURE__ */ React2.createElement(SelectSpace, {
|
|
261
199
|
spaces,
|
|
262
200
|
defaultSpaceId,
|
|
263
201
|
onChange: setTarget
|
|
264
|
-
}) : form.formSchema ? /* @__PURE__ */
|
|
202
|
+
}) : form.formSchema ? /* @__PURE__ */ React2.createElement(Form, {
|
|
265
203
|
classNames: "!p-0",
|
|
266
204
|
autoFocus: true,
|
|
267
205
|
values: {
|
|
@@ -275,15 +213,15 @@ var CreateObjectPanel = ({ classNames, forms, spaces, typename: initialTypename,
|
|
|
275
213
|
};
|
|
276
214
|
var SelectSpace = ({ spaces, defaultSpaceId, onChange }) => {
|
|
277
215
|
const { t } = useTranslation2(SPACE_PLUGIN);
|
|
278
|
-
return /* @__PURE__ */
|
|
216
|
+
return /* @__PURE__ */ React2.createElement(SearchList.Root, {
|
|
279
217
|
label: t("space input label"),
|
|
280
218
|
classNames: "flex flex-col grow overflow-hidden"
|
|
281
|
-
}, /* @__PURE__ */
|
|
219
|
+
}, /* @__PURE__ */ React2.createElement(SearchList.Input, {
|
|
282
220
|
autoFocus: true,
|
|
283
221
|
"data-testid": "create-object-form.space-input",
|
|
284
222
|
placeholder: t("space input placeholder"),
|
|
285
223
|
classNames: "px-1 my-2"
|
|
286
|
-
}), /* @__PURE__ */
|
|
224
|
+
}), /* @__PURE__ */ React2.createElement(SearchList.Content, {
|
|
287
225
|
classNames: "max-bs-[24rem] overflow-auto"
|
|
288
226
|
}, spaces.sort((a, b) => {
|
|
289
227
|
const aName = toLocalizedString(getSpaceDisplayName(a, {
|
|
@@ -293,14 +231,14 @@ var SelectSpace = ({ spaces, defaultSpaceId, onChange }) => {
|
|
|
293
231
|
personal: b.id === defaultSpaceId
|
|
294
232
|
}), t);
|
|
295
233
|
return aName.localeCompare(bName);
|
|
296
|
-
}).map((space) => /* @__PURE__ */
|
|
234
|
+
}).map((space) => /* @__PURE__ */ React2.createElement(SearchList.Item, {
|
|
297
235
|
key: space.id,
|
|
298
236
|
value: toLocalizedString(getSpaceDisplayName(space, {
|
|
299
237
|
personal: space.id === defaultSpaceId
|
|
300
238
|
}), t),
|
|
301
239
|
onSelect: () => onChange(space),
|
|
302
240
|
classNames: "flex items-center gap-2"
|
|
303
|
-
}, /* @__PURE__ */
|
|
241
|
+
}, /* @__PURE__ */ React2.createElement("span", {
|
|
304
242
|
className: "grow truncate"
|
|
305
243
|
}, toLocalizedString(getSpaceDisplayName(space, {
|
|
306
244
|
personal: space.id === defaultSpaceId
|
|
@@ -308,17 +246,17 @@ var SelectSpace = ({ spaces, defaultSpaceId, onChange }) => {
|
|
|
308
246
|
};
|
|
309
247
|
var SelectSchema = ({ options, resolve, onChange }) => {
|
|
310
248
|
const { t } = useTranslation2(SPACE_PLUGIN);
|
|
311
|
-
return /* @__PURE__ */
|
|
249
|
+
return /* @__PURE__ */ React2.createElement(SearchList.Root, {
|
|
312
250
|
label: t("schema input label"),
|
|
313
251
|
classNames: "flex flex-col grow overflow-hidden"
|
|
314
|
-
}, /* @__PURE__ */
|
|
252
|
+
}, /* @__PURE__ */ React2.createElement(SearchList.Input, {
|
|
315
253
|
autoFocus: true,
|
|
316
254
|
"data-testid": "create-object-form.schema-input",
|
|
317
255
|
placeholder: t("schema input placeholder"),
|
|
318
256
|
classNames: "px-1 my-2"
|
|
319
|
-
}), /* @__PURE__ */
|
|
257
|
+
}), /* @__PURE__ */ React2.createElement(SearchList.Content, {
|
|
320
258
|
classNames: "max-bs-[24rem] overflow-auto"
|
|
321
|
-
}, options.map((option) => /* @__PURE__ */
|
|
259
|
+
}, options.map((option) => /* @__PURE__ */ React2.createElement(SearchList.Item, {
|
|
322
260
|
key: option.typename,
|
|
323
261
|
value: t("typename label", {
|
|
324
262
|
ns: option.typename,
|
|
@@ -326,9 +264,9 @@ var SelectSchema = ({ options, resolve, onChange }) => {
|
|
|
326
264
|
}),
|
|
327
265
|
onSelect: () => onChange(option.typename),
|
|
328
266
|
classNames: "flex items-center gap-2"
|
|
329
|
-
}, /* @__PURE__ */
|
|
267
|
+
}, /* @__PURE__ */ React2.createElement("span", {
|
|
330
268
|
className: "flex gap-2 items-center grow truncate"
|
|
331
|
-
}, /* @__PURE__ */
|
|
269
|
+
}, /* @__PURE__ */ React2.createElement(Icon, {
|
|
332
270
|
icon: resolve?.(option.typename).icon ?? "ph--placeholder--regular",
|
|
333
271
|
size: 5
|
|
334
272
|
}), t("typename label", {
|
|
@@ -339,33 +277,33 @@ var SelectSchema = ({ options, resolve, onChange }) => {
|
|
|
339
277
|
|
|
340
278
|
// packages/plugins/plugin-space/src/capabilities/index.ts
|
|
341
279
|
import { lazy } from "@dxos/app-framework";
|
|
342
|
-
var AppGraphBuilder = lazy(() => import("./app-graph-builder-
|
|
343
|
-
var AppGraphSerializer = lazy(() => import("./app-graph-serializer-
|
|
344
|
-
var IdentityCreated = lazy(() => import("./identity-created-
|
|
345
|
-
var IntentResolver = lazy(() => import("./intent-resolver-
|
|
346
|
-
var ReactRoot = lazy(() => import("./react-root-
|
|
347
|
-
var ReactSurface = lazy(() => import("./react-surface-
|
|
348
|
-
var
|
|
349
|
-
var
|
|
350
|
-
var SpaceSettings = lazy(() => import("./settings-
|
|
351
|
-
var SpaceState = lazy(() => import("./state-
|
|
352
|
-
var SpacesReady = lazy(() => import("./spaces-ready-
|
|
280
|
+
var AppGraphBuilder = lazy(() => import("./app-graph-builder-7X3SIPCD.mjs"));
|
|
281
|
+
var AppGraphSerializer = lazy(() => import("./app-graph-serializer-VRU57AEZ.mjs"));
|
|
282
|
+
var IdentityCreated = lazy(() => import("./identity-created-ANRJHNMQ.mjs"));
|
|
283
|
+
var IntentResolver = lazy(() => import("./intent-resolver-KRINV5QI.mjs"));
|
|
284
|
+
var ReactRoot = lazy(() => import("./react-root-J3SP2HVW.mjs"));
|
|
285
|
+
var ReactSurface = lazy(() => import("./react-surface-J7T2IMH4.mjs"));
|
|
286
|
+
var SchemaDefs = lazy(() => import("./schema-defs-OCBY7APN.mjs"));
|
|
287
|
+
var SchemaTools = lazy(() => import("./schema-tools-MYC4LTQD.mjs"));
|
|
288
|
+
var SpaceSettings = lazy(() => import("./settings-G24447B7.mjs"));
|
|
289
|
+
var SpaceState = lazy(() => import("./state-SI4B5GHC.mjs"));
|
|
290
|
+
var SpacesReady = lazy(() => import("./spaces-ready-5I3RKYTT.mjs"));
|
|
353
291
|
|
|
354
292
|
// packages/plugins/plugin-space/src/components/CreateDialog/CreateObjectDialog.tsx
|
|
355
293
|
var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/CreateDialog/CreateObjectDialog.tsx";
|
|
356
294
|
var CREATE_OBJECT_DIALOG = `${SPACE_PLUGIN}/CreateObjectDialog`;
|
|
357
295
|
var CreateObjectDialog = ({ target, typename, name, shouldNavigate: _shouldNavigate }) => {
|
|
358
296
|
const closeRef = useRef(null);
|
|
359
|
-
const manager =
|
|
297
|
+
const manager = usePluginManager();
|
|
360
298
|
const { t } = useTranslation3(SPACE_PLUGIN);
|
|
361
299
|
const client = useClient2();
|
|
362
300
|
const spaces = useSpaces();
|
|
363
301
|
const { dispatchPromise: dispatch } = useIntentDispatcher2();
|
|
364
302
|
const forms = useCapabilities(SpaceCapabilities.ObjectForm);
|
|
365
|
-
const resolve =
|
|
303
|
+
const resolve = useCallback3((typename2) => manager.context.getCapabilities(Capabilities.Metadata).find(({ id }) => id === typename2)?.metadata ?? {}, [
|
|
366
304
|
manager
|
|
367
305
|
]);
|
|
368
|
-
const handleCreateObject =
|
|
306
|
+
const handleCreateObject = useCallback3(async ({ form, target: target2, data = {} }) => {
|
|
369
307
|
if (!target2) {
|
|
370
308
|
return;
|
|
371
309
|
}
|
|
@@ -406,22 +344,22 @@ var CreateObjectDialog = ({ target, typename, name, shouldNavigate: _shouldNavig
|
|
|
406
344
|
return (
|
|
407
345
|
// TODO(wittjosiah): The tablist dialog pattern is copied from @dxos/plugin-manager.
|
|
408
346
|
// Consider factoring it out to the tabs package.
|
|
409
|
-
/* @__PURE__ */
|
|
347
|
+
/* @__PURE__ */ React3.createElement(Dialog.Content, {
|
|
410
348
|
classNames: "p-0 bs-content max-bs-full md:max-is-[40rem] overflow-hidden"
|
|
411
|
-
}, /* @__PURE__ */
|
|
349
|
+
}, /* @__PURE__ */ React3.createElement("div", {
|
|
412
350
|
role: "none",
|
|
413
351
|
className: "flex justify-between pbs-2 pis-2 pie-2 @md:pbs-4 @md:pis-4 @md:pie-4"
|
|
414
|
-
}, /* @__PURE__ */
|
|
352
|
+
}, /* @__PURE__ */ React3.createElement(Dialog.Title, null, t("create object dialog title")), /* @__PURE__ */ React3.createElement(Dialog.Close, {
|
|
415
353
|
asChild: true
|
|
416
|
-
}, /* @__PURE__ */
|
|
354
|
+
}, /* @__PURE__ */ React3.createElement(Button2, {
|
|
417
355
|
ref: closeRef,
|
|
418
356
|
density: "fine",
|
|
419
357
|
variant: "ghost",
|
|
420
358
|
autoFocus: true
|
|
421
|
-
}, /* @__PURE__ */
|
|
359
|
+
}, /* @__PURE__ */ React3.createElement(Icon2, {
|
|
422
360
|
icon: "ph--x--regular",
|
|
423
361
|
size: 4
|
|
424
|
-
})))), /* @__PURE__ */
|
|
362
|
+
})))), /* @__PURE__ */ React3.createElement(CreateObjectPanel, {
|
|
425
363
|
classNames: "p-4",
|
|
426
364
|
forms,
|
|
427
365
|
spaces,
|
|
@@ -437,7 +375,7 @@ var CreateObjectDialog = ({ target, typename, name, shouldNavigate: _shouldNavig
|
|
|
437
375
|
|
|
438
376
|
// packages/plugins/plugin-space/src/components/CreateDialog/CreateSpaceDialog.tsx
|
|
439
377
|
import { Effect } from "effect";
|
|
440
|
-
import
|
|
378
|
+
import React4, { useCallback as useCallback4, useRef as useRef2 } from "react";
|
|
441
379
|
import { createIntent as createIntent3, LayoutAction as LayoutAction3, useIntentDispatcher as useIntentDispatcher3 } from "@dxos/app-framework";
|
|
442
380
|
import { Button as Button3, Dialog as Dialog2, Icon as Icon3, useTranslation as useTranslation4 } from "@dxos/react-ui";
|
|
443
381
|
import { Form as Form2 } from "@dxos/react-ui-form";
|
|
@@ -450,7 +388,7 @@ var CreateSpaceDialog = () => {
|
|
|
450
388
|
const { t } = useTranslation4(SPACE_PLUGIN);
|
|
451
389
|
const { dispatch } = useIntentDispatcher3();
|
|
452
390
|
const inputSurfaceLookup = useInputSurfaceLookup();
|
|
453
|
-
const handleCreateSpace =
|
|
391
|
+
const handleCreateSpace = useCallback4(async (data) => {
|
|
454
392
|
const program = Effect.gen(function* () {
|
|
455
393
|
const { space } = yield* dispatch(createIntent3(SpaceAction.Create, data));
|
|
456
394
|
yield* dispatch(createIntent3(LayoutAction3.SwitchWorkspace, {
|
|
@@ -468,24 +406,24 @@ var CreateSpaceDialog = () => {
|
|
|
468
406
|
return (
|
|
469
407
|
// TODO(wittjosiah): The tablist dialog pattern is copied from @dxos/plugin-manager.
|
|
470
408
|
// Consider factoring it out to the tabs package.
|
|
471
|
-
/* @__PURE__ */
|
|
409
|
+
/* @__PURE__ */ React4.createElement(Dialog2.Content, {
|
|
472
410
|
classNames: "p-0 bs-content min-bs-[16rem] max-bs-full md:max-is-[32rem] overflow-hidden"
|
|
473
|
-
}, /* @__PURE__ */
|
|
411
|
+
}, /* @__PURE__ */ React4.createElement("div", {
|
|
474
412
|
role: "none",
|
|
475
413
|
className: "flex justify-between pbs-2 pis-2 pie-2 @md:pbs-4 @md:pis-4 @md:pie-4"
|
|
476
|
-
}, /* @__PURE__ */
|
|
414
|
+
}, /* @__PURE__ */ React4.createElement(Dialog2.Title, null, t("create space dialog title")), /* @__PURE__ */ React4.createElement(Dialog2.Close, {
|
|
477
415
|
asChild: true
|
|
478
|
-
}, /* @__PURE__ */
|
|
416
|
+
}, /* @__PURE__ */ React4.createElement(Button3, {
|
|
479
417
|
ref: closeRef,
|
|
480
418
|
density: "fine",
|
|
481
419
|
variant: "ghost",
|
|
482
420
|
autoFocus: true
|
|
483
|
-
}, /* @__PURE__ */
|
|
421
|
+
}, /* @__PURE__ */ React4.createElement(Icon3, {
|
|
484
422
|
icon: "ph--x--regular",
|
|
485
423
|
size: 4
|
|
486
|
-
})))), /* @__PURE__ */
|
|
424
|
+
})))), /* @__PURE__ */ React4.createElement("div", {
|
|
487
425
|
className: "p-4"
|
|
488
|
-
}, /* @__PURE__ */
|
|
426
|
+
}, /* @__PURE__ */ React4.createElement(Form2, {
|
|
489
427
|
testId: "create-space-form",
|
|
490
428
|
classNames: "!p-0",
|
|
491
429
|
autoFocus: true,
|
|
@@ -498,35 +436,35 @@ var CreateSpaceDialog = () => {
|
|
|
498
436
|
};
|
|
499
437
|
|
|
500
438
|
// packages/plugins/plugin-space/src/components/CollectionMain.tsx
|
|
501
|
-
import
|
|
439
|
+
import React5 from "react";
|
|
502
440
|
import { useTranslation as useTranslation5 } from "@dxos/react-ui";
|
|
503
|
-
import { baseSurface,
|
|
441
|
+
import { baseSurface, descriptionMessage, mx as mx3 } from "@dxos/react-ui-theme";
|
|
504
442
|
var CollectionMain = ({ collection }) => {
|
|
505
443
|
const { t } = useTranslation5(SPACE_PLUGIN);
|
|
506
|
-
return /* @__PURE__ */
|
|
444
|
+
return /* @__PURE__ */ React5.createElement("div", {
|
|
507
445
|
role: "none",
|
|
508
446
|
className: mx3(baseSurface, "min-bs-screen is-full flex items-center justify-center p-8"),
|
|
509
447
|
"data-testid": "composer.firstRunMessage"
|
|
510
|
-
}, /* @__PURE__ */
|
|
448
|
+
}, /* @__PURE__ */ React5.createElement("p", {
|
|
511
449
|
role: "alert",
|
|
512
|
-
className: mx3(
|
|
450
|
+
className: mx3(descriptionMessage, "rounded-lg p-8 font-normal text-lg max-is-[24rem] break-words")
|
|
513
451
|
}, collection.name ?? t("unnamed collection label")));
|
|
514
452
|
};
|
|
515
453
|
|
|
516
454
|
// packages/plugins/plugin-space/src/components/CollectionSection.tsx
|
|
517
|
-
import
|
|
455
|
+
import React6 from "react";
|
|
518
456
|
import { useTranslation as useTranslation6 } from "@dxos/react-ui";
|
|
519
457
|
var CollectionSection = ({ collection }) => {
|
|
520
458
|
const { t } = useTranslation6(SPACE_PLUGIN);
|
|
521
|
-
return /* @__PURE__ */
|
|
459
|
+
return /* @__PURE__ */ React6.createElement("div", {
|
|
522
460
|
className: "min-bs-[3.5rem] grid grid-rows-subgrid grid-cols-subgrid items-center"
|
|
523
|
-
}, /* @__PURE__ */
|
|
461
|
+
}, /* @__PURE__ */ React6.createElement("span", {
|
|
524
462
|
className: "truncate"
|
|
525
463
|
}, collection.name ?? t("unnamed collection label")));
|
|
526
464
|
};
|
|
527
465
|
|
|
528
466
|
// packages/plugins/plugin-space/src/components/JoinDialog.tsx
|
|
529
|
-
import
|
|
467
|
+
import React7, { useCallback as useCallback5 } from "react";
|
|
530
468
|
import { createIntent as createIntent4, LayoutAction as LayoutAction4, useAppGraph, useIntentDispatcher as useIntentDispatcher4 } from "@dxos/app-framework";
|
|
531
469
|
import { Trigger } from "@dxos/async";
|
|
532
470
|
import { ObservabilityAction } from "@dxos/plugin-observability/types";
|
|
@@ -539,7 +477,7 @@ var JoinDialog = ({ navigableCollections, onDone, ...props }) => {
|
|
|
539
477
|
const client = useClient3();
|
|
540
478
|
const { graph } = useAppGraph();
|
|
541
479
|
const { t } = useTranslation7(SPACE_PLUGIN);
|
|
542
|
-
const handleDone =
|
|
480
|
+
const handleDone = useCallback5(async (result) => {
|
|
543
481
|
const spaceKey = result?.spaceKey;
|
|
544
482
|
if (!spaceKey) {
|
|
545
483
|
return;
|
|
@@ -619,16 +557,16 @@ var JoinDialog = ({ navigableCollections, onDone, ...props }) => {
|
|
|
619
557
|
client,
|
|
620
558
|
graph
|
|
621
559
|
]);
|
|
622
|
-
return /* @__PURE__ */
|
|
560
|
+
return /* @__PURE__ */ React7.createElement(Dialog3.Content, null, /* @__PURE__ */ React7.createElement(Dialog3.Title, {
|
|
623
561
|
classNames: "sr-only"
|
|
624
562
|
}, t("join space label", {
|
|
625
563
|
ns: "os"
|
|
626
|
-
})), /* @__PURE__ */
|
|
564
|
+
})), /* @__PURE__ */ React7.createElement(JoinPanel, {
|
|
627
565
|
...props,
|
|
628
|
-
exitActionParent: /* @__PURE__ */
|
|
566
|
+
exitActionParent: /* @__PURE__ */ React7.createElement(Dialog3.Close, {
|
|
629
567
|
asChild: true
|
|
630
568
|
}),
|
|
631
|
-
doneActionParent: /* @__PURE__ */
|
|
569
|
+
doneActionParent: /* @__PURE__ */ React7.createElement(Dialog3.Close, {
|
|
632
570
|
asChild: true
|
|
633
571
|
}),
|
|
634
572
|
onDone: handleDone
|
|
@@ -637,8 +575,9 @@ var JoinDialog = ({ navigableCollections, onDone, ...props }) => {
|
|
|
637
575
|
|
|
638
576
|
// packages/plugins/plugin-space/src/components/MembersContainer.tsx
|
|
639
577
|
import { Check, X } from "@phosphor-icons/react";
|
|
640
|
-
import
|
|
578
|
+
import React8, { useCallback as useCallback6, useMemo, useState as useState3 } from "react";
|
|
641
579
|
import { QR } from "react-qr-rounded";
|
|
580
|
+
import { createIntent as createIntent5, useIntentDispatcher as useIntentDispatcher5 } from "@dxos/app-framework";
|
|
642
581
|
import { log } from "@dxos/log";
|
|
643
582
|
import { useConfig } from "@dxos/react-client";
|
|
644
583
|
import { fullyQualifiedId as fullyQualifiedId2, useSpaceInvitations } from "@dxos/react-client/echo";
|
|
@@ -659,7 +598,7 @@ var handleInvitationEvent = (invitation, subscription) => {
|
|
|
659
598
|
authCode: invitation.authCode
|
|
660
599
|
}), void 0, {
|
|
661
600
|
F: __dxlog_file3,
|
|
662
|
-
L:
|
|
601
|
+
L: 40,
|
|
663
602
|
S: void 0,
|
|
664
603
|
C: (f, a) => f(...a)
|
|
665
604
|
});
|
|
@@ -669,18 +608,19 @@ var handleInvitationEvent = (invitation, subscription) => {
|
|
|
669
608
|
var MembersContainer = ({ space, createInvitationUrl }) => {
|
|
670
609
|
const { t } = useTranslation8(SPACE_PLUGIN);
|
|
671
610
|
const config = useConfig();
|
|
611
|
+
const { dispatchPromise: dispatch } = useIntentDispatcher5();
|
|
672
612
|
const invitations = useSpaceInvitations(space.key);
|
|
673
613
|
const visibleInvitations = invitations?.filter((invitation) => ![
|
|
674
614
|
Invitation.State.CANCELLED
|
|
675
615
|
].includes(invitation.get().state));
|
|
676
|
-
const [activeAction, setInternalActiveAction] =
|
|
616
|
+
const [activeAction, setInternalActiveAction] = useState3(localStorage.getItem(activeActionKey) ?? "inviteMany");
|
|
677
617
|
const setActiveAction = (nextAction) => {
|
|
678
618
|
setInternalActiveAction(nextAction);
|
|
679
619
|
localStorage.setItem(activeActionKey, nextAction);
|
|
680
620
|
};
|
|
681
621
|
const target = space.properties[CollectionType.typename]?.target?.objects[0]?.target;
|
|
682
622
|
const locked = space.properties[COMPOSER_SPACE_LOCK];
|
|
683
|
-
const handleChangeLocked =
|
|
623
|
+
const handleChangeLocked = useCallback6(() => {
|
|
684
624
|
space.properties[COMPOSER_SPACE_LOCK] = !locked;
|
|
685
625
|
}, [
|
|
686
626
|
locked,
|
|
@@ -694,18 +634,19 @@ var MembersContainer = ({ space, createInvitationUrl }) => {
|
|
|
694
634
|
description: t("invite one description", {
|
|
695
635
|
ns: "os"
|
|
696
636
|
}),
|
|
697
|
-
icon: () => /* @__PURE__ */
|
|
637
|
+
icon: () => /* @__PURE__ */ React8.createElement(Icon4, {
|
|
698
638
|
icon: "ph--user-plus--regular",
|
|
699
639
|
size: 5
|
|
700
640
|
}),
|
|
701
641
|
testId: "membersContainer.inviteOne",
|
|
702
|
-
onClick: () => {
|
|
703
|
-
const invitation =
|
|
642
|
+
onClick: async () => {
|
|
643
|
+
const { data: invitation } = await dispatch(createIntent5(SpaceAction.Share, {
|
|
644
|
+
space,
|
|
704
645
|
type: Invitation.Type.INTERACTIVE,
|
|
705
646
|
authMethod: Invitation.AuthMethod.SHARED_SECRET,
|
|
706
647
|
multiUse: false,
|
|
707
648
|
target: target && fullyQualifiedId2(target)
|
|
708
|
-
});
|
|
649
|
+
}));
|
|
709
650
|
if (invitation && config.values.runtime?.app?.env?.DX_ENVIRONMENT !== "production") {
|
|
710
651
|
const subscription = invitation.subscribe((invitation2) => handleInvitationEvent(invitation2, subscription));
|
|
711
652
|
}
|
|
@@ -718,18 +659,19 @@ var MembersContainer = ({ space, createInvitationUrl }) => {
|
|
|
718
659
|
description: t("invite many description", {
|
|
719
660
|
ns: "os"
|
|
720
661
|
}),
|
|
721
|
-
icon: () => /* @__PURE__ */
|
|
662
|
+
icon: () => /* @__PURE__ */ React8.createElement(Icon4, {
|
|
722
663
|
icon: "ph--users-three--regular",
|
|
723
664
|
size: 5
|
|
724
665
|
}),
|
|
725
666
|
testId: "membersContainer.inviteMany",
|
|
726
|
-
onClick: () => {
|
|
727
|
-
const invitation =
|
|
667
|
+
onClick: async () => {
|
|
668
|
+
const { data: invitation } = await dispatch(createIntent5(SpaceAction.Share, {
|
|
669
|
+
space,
|
|
728
670
|
type: Invitation.Type.DELEGATED,
|
|
729
671
|
authMethod: Invitation.AuthMethod.KNOWN_PUBLIC_KEY,
|
|
730
672
|
multiUse: true,
|
|
731
673
|
target: target && fullyQualifiedId2(target)
|
|
732
|
-
});
|
|
674
|
+
}));
|
|
733
675
|
if (invitation && config.values.runtime?.app?.env?.DX_ENVIRONMENT !== "production") {
|
|
734
676
|
const subscription = invitation.subscribe((invitation2) => handleInvitationEvent(invitation2, subscription));
|
|
735
677
|
}
|
|
@@ -740,51 +682,51 @@ var MembersContainer = ({ space, createInvitationUrl }) => {
|
|
|
740
682
|
space,
|
|
741
683
|
target
|
|
742
684
|
]);
|
|
743
|
-
const [selectedInvitation, setSelectedInvitation] =
|
|
685
|
+
const [selectedInvitation, setSelectedInvitation] = useState3(null);
|
|
744
686
|
const handleSend = (event) => {
|
|
745
687
|
setSelectedInvitation(event.invitation);
|
|
746
688
|
};
|
|
747
689
|
const handleBack = () => {
|
|
748
690
|
setSelectedInvitation(null);
|
|
749
691
|
};
|
|
750
|
-
return /* @__PURE__ */
|
|
692
|
+
return /* @__PURE__ */ React8.createElement(Clipboard.Provider, null, /* @__PURE__ */ React8.createElement(StackItem.Content, {
|
|
751
693
|
classNames: "block overflow-y-auto"
|
|
752
|
-
}, /* @__PURE__ */
|
|
694
|
+
}, /* @__PURE__ */ React8.createElement(ControlPage, null, /* @__PURE__ */ React8.createElement(ControlSection, {
|
|
753
695
|
title: t("members verbose label"),
|
|
754
696
|
description: t("members description")
|
|
755
|
-
}, /* @__PURE__ */
|
|
697
|
+
}, /* @__PURE__ */ React8.createElement(ControlFrame, null, /* @__PURE__ */ React8.createElement(ControlFrameItem, {
|
|
756
698
|
title: t("members label")
|
|
757
|
-
}, /* @__PURE__ */
|
|
699
|
+
}, /* @__PURE__ */ React8.createElement(SpaceMemberList, {
|
|
758
700
|
spaceKey: space.key,
|
|
759
701
|
includeSelf: true
|
|
760
|
-
})), locked && /* @__PURE__ */
|
|
702
|
+
})), locked && /* @__PURE__ */ React8.createElement(ControlFrameItem, {
|
|
761
703
|
title: t("invitations label")
|
|
762
|
-
}, /* @__PURE__ */
|
|
704
|
+
}, /* @__PURE__ */ React8.createElement("p", {
|
|
763
705
|
className: "text-description mbe-2"
|
|
764
|
-
}, t("locked space description"))), !locked && /* @__PURE__ */
|
|
706
|
+
}, t("locked space description"))), !locked && /* @__PURE__ */ React8.createElement(ControlFrameItem, {
|
|
765
707
|
title: t("invitations label")
|
|
766
|
-
}, selectedInvitation && /* @__PURE__ */
|
|
708
|
+
}, selectedInvitation && /* @__PURE__ */ React8.createElement(InvitationSection, {
|
|
767
709
|
...selectedInvitation,
|
|
768
710
|
onBack: handleBack
|
|
769
|
-
}), !selectedInvitation && /* @__PURE__ */
|
|
711
|
+
}), !selectedInvitation && /* @__PURE__ */ React8.createElement(React8.Fragment, null, /* @__PURE__ */ React8.createElement("p", {
|
|
770
712
|
className: "text-description mbe-2"
|
|
771
|
-
}, t("space invitation description")), /* @__PURE__ */
|
|
713
|
+
}, t("space invitation description")), /* @__PURE__ */ React8.createElement(InvitationList, {
|
|
772
714
|
className: "mb-2",
|
|
773
715
|
send: handleSend,
|
|
774
716
|
invitations: visibleInvitations ?? [],
|
|
775
717
|
onClickRemove: (invitation) => invitation.cancel(),
|
|
776
718
|
createInvitationUrl
|
|
777
|
-
}), /* @__PURE__ */
|
|
719
|
+
}), /* @__PURE__ */ React8.createElement(BifurcatedAction, {
|
|
778
720
|
actions: inviteActions,
|
|
779
721
|
activeAction,
|
|
780
722
|
onChangeActiveAction: setActiveAction,
|
|
781
723
|
"data-testid": "membersContainer.createInvitation"
|
|
782
|
-
})))), /* @__PURE__ */
|
|
724
|
+
})))), /* @__PURE__ */ React8.createElement("div", {
|
|
783
725
|
className: "justify-center gap-4 p-0 mbs-4 container-max-width grid grid-cols-1 md:grid-cols-[1fr_min-content]"
|
|
784
|
-
}, /* @__PURE__ */
|
|
726
|
+
}, /* @__PURE__ */ React8.createElement(ControlItemInput, {
|
|
785
727
|
title: t("space locked label"),
|
|
786
728
|
description: t("space locked description")
|
|
787
|
-
}, /* @__PURE__ */
|
|
729
|
+
}, /* @__PURE__ */ React8.createElement(Input.Switch, {
|
|
788
730
|
checked: locked,
|
|
789
731
|
onCheckedChange: handleChangeLocked,
|
|
790
732
|
classNames: "justify-self-end"
|
|
@@ -792,23 +734,23 @@ var MembersContainer = ({ space, createInvitationUrl }) => {
|
|
|
792
734
|
};
|
|
793
735
|
var InvitationSection = ({ state = Invitation.State.INIT, authCode, invitationId = "never", url = "never", onBack }) => {
|
|
794
736
|
const activeView = state < 0 ? "init" : state >= Invitation.State.CANCELLED ? "complete" : state >= Invitation.State.READY_FOR_AUTHENTICATION && authCode ? "auth-code" : "qr-code";
|
|
795
|
-
return /* @__PURE__ */
|
|
737
|
+
return /* @__PURE__ */ React8.createElement(Viewport.Root, {
|
|
796
738
|
activeView
|
|
797
|
-
}, /* @__PURE__ */
|
|
739
|
+
}, /* @__PURE__ */ React8.createElement(Viewport.Views, null, /* @__PURE__ */ React8.createElement(Viewport.View, {
|
|
798
740
|
id: "init"
|
|
799
|
-
}), /* @__PURE__ */
|
|
741
|
+
}), /* @__PURE__ */ React8.createElement(Viewport.View, {
|
|
800
742
|
id: "complete"
|
|
801
|
-
}, /* @__PURE__ */
|
|
743
|
+
}, /* @__PURE__ */ React8.createElement(InvitationComplete, {
|
|
802
744
|
statusValue: state
|
|
803
|
-
})), /* @__PURE__ */
|
|
745
|
+
})), /* @__PURE__ */ React8.createElement(Viewport.View, {
|
|
804
746
|
id: "auth-code"
|
|
805
|
-
}, /* @__PURE__ */
|
|
747
|
+
}, /* @__PURE__ */ React8.createElement(InvitationAuthCode, {
|
|
806
748
|
id: invitationId,
|
|
807
749
|
code: authCode ?? "never",
|
|
808
750
|
onCancel: onBack
|
|
809
|
-
})), /* @__PURE__ */
|
|
751
|
+
})), /* @__PURE__ */ React8.createElement(Viewport.View, {
|
|
810
752
|
id: "qr-code"
|
|
811
|
-
}, /* @__PURE__ */
|
|
753
|
+
}, /* @__PURE__ */ React8.createElement(InvitationQR, {
|
|
812
754
|
id: invitationId,
|
|
813
755
|
url,
|
|
814
756
|
onCancel: onBack
|
|
@@ -818,31 +760,31 @@ var InvitationQR = ({ id, url, onCancel }) => {
|
|
|
818
760
|
const { t } = useTranslation8("os");
|
|
819
761
|
const qrLabel = useId("members-container__qr-code");
|
|
820
762
|
const emoji = hexToEmoji(id);
|
|
821
|
-
return /* @__PURE__ */
|
|
763
|
+
return /* @__PURE__ */ React8.createElement(React8.Fragment, null, /* @__PURE__ */ React8.createElement("p", {
|
|
822
764
|
className: "text-description"
|
|
823
765
|
}, t("qr code description", {
|
|
824
766
|
ns: SPACE_PLUGIN
|
|
825
|
-
})), /* @__PURE__ */
|
|
767
|
+
})), /* @__PURE__ */ React8.createElement("div", {
|
|
826
768
|
role: "group",
|
|
827
769
|
className: "grid grid-cols-[1fr_min-content] mlb-2 gap-2"
|
|
828
|
-
}, /* @__PURE__ */
|
|
770
|
+
}, /* @__PURE__ */ React8.createElement("div", {
|
|
829
771
|
role: "none",
|
|
830
772
|
className: "is-full aspect-square relative text-description"
|
|
831
|
-
}, /* @__PURE__ */
|
|
773
|
+
}, /* @__PURE__ */ React8.createElement(QR, {
|
|
832
774
|
rounding: 100,
|
|
833
775
|
backgroundColor: "transparent",
|
|
834
776
|
color: "currentColor",
|
|
835
777
|
"aria-labelledby": qrLabel,
|
|
836
778
|
errorCorrectionLevel: "Q",
|
|
837
779
|
cutout: true
|
|
838
|
-
}, url ?? "never"), /* @__PURE__ */
|
|
780
|
+
}, url ?? "never"), /* @__PURE__ */ React8.createElement(Centered, null, /* @__PURE__ */ React8.createElement(Emoji, {
|
|
839
781
|
text: emoji
|
|
840
|
-
}))), /* @__PURE__ */
|
|
782
|
+
}))), /* @__PURE__ */ React8.createElement("span", {
|
|
841
783
|
id: qrLabel,
|
|
842
784
|
className: "sr-only"
|
|
843
|
-
}, t("qr label")), /* @__PURE__ */
|
|
785
|
+
}, t("qr label")), /* @__PURE__ */ React8.createElement(Clipboard.Button, {
|
|
844
786
|
value: url ?? "never"
|
|
845
|
-
})), /* @__PURE__ */
|
|
787
|
+
})), /* @__PURE__ */ React8.createElement(Button4, {
|
|
846
788
|
variant: "ghost",
|
|
847
789
|
onClick: onCancel
|
|
848
790
|
}, t("cancel label")));
|
|
@@ -850,33 +792,33 @@ var InvitationQR = ({ id, url, onCancel }) => {
|
|
|
850
792
|
var InvitationAuthCode = ({ id, code, onCancel }) => {
|
|
851
793
|
const { t } = useTranslation8("os");
|
|
852
794
|
const emoji = hexToEmoji(id);
|
|
853
|
-
return /* @__PURE__ */
|
|
795
|
+
return /* @__PURE__ */ React8.createElement(React8.Fragment, null, /* @__PURE__ */ React8.createElement("p", {
|
|
854
796
|
className: "text-description"
|
|
855
|
-
}, t("auth other device emoji message")), emoji && /* @__PURE__ */
|
|
797
|
+
}, t("auth other device emoji message")), emoji && /* @__PURE__ */ React8.createElement(Emoji, {
|
|
856
798
|
text: emoji,
|
|
857
799
|
className: "mli-auto mlb-2 text-center"
|
|
858
|
-
}), /* @__PURE__ */
|
|
800
|
+
}), /* @__PURE__ */ React8.createElement("p", {
|
|
859
801
|
className: "text-description"
|
|
860
|
-
}, t("auth code message")), /* @__PURE__ */
|
|
802
|
+
}, t("auth code message")), /* @__PURE__ */ React8.createElement(AuthCode, {
|
|
861
803
|
code,
|
|
862
804
|
large: true,
|
|
863
805
|
classNames: "mli-auto mlb-2 text-center grow"
|
|
864
|
-
}), /* @__PURE__ */
|
|
806
|
+
}), /* @__PURE__ */ React8.createElement(Button4, {
|
|
865
807
|
variant: "ghost",
|
|
866
808
|
onClick: onCancel
|
|
867
809
|
}, t("cancel label")));
|
|
868
810
|
};
|
|
869
811
|
var InvitationComplete = ({ statusValue }) => {
|
|
870
|
-
return statusValue > 0 ? /* @__PURE__ */
|
|
812
|
+
return statusValue > 0 ? /* @__PURE__ */ React8.createElement(Check, {
|
|
871
813
|
className: mx4("m-1.5", getSize2(6))
|
|
872
|
-
}) : /* @__PURE__ */
|
|
814
|
+
}) : /* @__PURE__ */ React8.createElement(X, {
|
|
873
815
|
className: mx4("m-1.5", getSize2(6))
|
|
874
816
|
});
|
|
875
817
|
};
|
|
876
818
|
|
|
877
819
|
// packages/plugins/plugin-space/src/components/MenuFooter.tsx
|
|
878
820
|
import { Planet } from "@phosphor-icons/react";
|
|
879
|
-
import
|
|
821
|
+
import React9 from "react";
|
|
880
822
|
import { getSpace as getSpace2 } from "@dxos/client/echo";
|
|
881
823
|
import { useClient as useClient4 } from "@dxos/react-client";
|
|
882
824
|
import { DropdownMenu, toLocalizedString as toLocalizedString2, useTranslation as useTranslation9 } from "@dxos/react-ui";
|
|
@@ -887,127 +829,33 @@ var MenuFooter = ({ object }) => {
|
|
|
887
829
|
const spaceName = space ? getSpaceDisplayName(space, {
|
|
888
830
|
personal: client.spaces.default === space
|
|
889
831
|
}) : "";
|
|
890
|
-
return space ? /* @__PURE__ */
|
|
832
|
+
return space ? /* @__PURE__ */ React9.createElement(React9.Fragment, null, /* @__PURE__ */ React9.createElement(DropdownMenu.Separator, null), /* @__PURE__ */ React9.createElement(DropdownMenu.GroupLabel, null, t("menu footer label")), /* @__PURE__ */ React9.createElement("dl", {
|
|
891
833
|
className: "pis-2 mbe-2 text-xs grid grid-cols-[max-content_1fr] gap-2"
|
|
892
|
-
}, /* @__PURE__ */
|
|
834
|
+
}, /* @__PURE__ */ React9.createElement("dt", {
|
|
893
835
|
className: "uppercase text-[.75em] tracking-wide font-medium mbs-px self-start"
|
|
894
|
-
}, t("location label")), /* @__PURE__ */
|
|
836
|
+
}, t("location label")), /* @__PURE__ */ React9.createElement("dd", {
|
|
895
837
|
className: "line-clamp-3"
|
|
896
|
-
}, /* @__PURE__ */
|
|
838
|
+
}, /* @__PURE__ */ React9.createElement(Planet, {
|
|
897
839
|
className: "inline-block mie-1"
|
|
898
840
|
}), toLocalizedString2(spaceName, t)))) : null;
|
|
899
841
|
};
|
|
900
842
|
|
|
901
843
|
// packages/plugins/plugin-space/src/components/ObjectSettings/ObjectSettingsContainer.tsx
|
|
902
|
-
import
|
|
903
|
-
import { Surface
|
|
844
|
+
import React11, { useMemo as useMemo2 } from "react";
|
|
845
|
+
import { Surface } from "@dxos/app-framework";
|
|
904
846
|
import { Clipboard as Clipboard2 } from "@dxos/react-ui";
|
|
905
847
|
import { StackItem as StackItem2 } from "@dxos/react-ui-stack";
|
|
906
848
|
|
|
907
|
-
// packages/plugins/plugin-space/src/components/ObjectSettings/AdvancedObjectSettings.tsx
|
|
908
|
-
import React12, { useCallback as useCallback9, useState as useState5 } from "react";
|
|
909
|
-
import { ForeignKeySchema } from "@dxos/echo-schema";
|
|
910
|
-
import { getMeta } from "@dxos/react-client/echo";
|
|
911
|
-
import { IconButton as IconButton2, useTranslation as useTranslation11 } from "@dxos/react-ui";
|
|
912
|
-
import { Form as Form3 } from "@dxos/react-ui-form";
|
|
913
|
-
|
|
914
|
-
// packages/plugins/plugin-space/src/components/ObjectSettings/ForeignKeys.tsx
|
|
915
|
-
import React11, { useCallback as useCallback8 } from "react";
|
|
916
|
-
import { IconButton, List, ListItem, useTranslation as useTranslation10 } from "@dxos/react-ui";
|
|
917
|
-
var ForeignKeys = ({ keys, onDelete }) => {
|
|
918
|
-
return /* @__PURE__ */ React11.createElement(List, {
|
|
919
|
-
classNames: "flex flex-col gap-2"
|
|
920
|
-
}, keys.map((key) => /* @__PURE__ */ React11.createElement(KeyItem, {
|
|
921
|
-
key: key.id,
|
|
922
|
-
forignKey: key,
|
|
923
|
-
onDelete
|
|
924
|
-
})));
|
|
925
|
-
};
|
|
926
|
-
var KeyItem = ({ forignKey, onDelete }) => {
|
|
927
|
-
const { t } = useTranslation10(SPACE_PLUGIN);
|
|
928
|
-
const handleDelete = useCallback8(() => {
|
|
929
|
-
onDelete?.(forignKey);
|
|
930
|
-
}, [
|
|
931
|
-
forignKey,
|
|
932
|
-
onDelete
|
|
933
|
-
]);
|
|
934
|
-
return /* @__PURE__ */ React11.createElement(ListItem.Root, {
|
|
935
|
-
classNames: "px-2"
|
|
936
|
-
}, /* @__PURE__ */ React11.createElement(ListItem.Heading, {
|
|
937
|
-
classNames: "flex flex-col grow truncate"
|
|
938
|
-
}, /* @__PURE__ */ React11.createElement("div", null, forignKey.source), /* @__PURE__ */ React11.createElement("div", {
|
|
939
|
-
className: "text-description text-sm truncate"
|
|
940
|
-
}, forignKey.id)), /* @__PURE__ */ React11.createElement(ListItem.Endcap, null, /* @__PURE__ */ React11.createElement(IconButton, {
|
|
941
|
-
iconOnly: true,
|
|
942
|
-
icon: "ph--x--regular",
|
|
943
|
-
variant: "ghost",
|
|
944
|
-
label: t("delete key"),
|
|
945
|
-
onClick: handleDelete
|
|
946
|
-
})));
|
|
947
|
-
};
|
|
948
|
-
|
|
949
|
-
// packages/plugins/plugin-space/src/components/ObjectSettings/AdvancedObjectSettings.tsx
|
|
950
|
-
var initialValues2 = {
|
|
951
|
-
source: "",
|
|
952
|
-
id: ""
|
|
953
|
-
};
|
|
954
|
-
var AdvancedObjectSettings = ({ object }) => {
|
|
955
|
-
const { t } = useTranslation11(SPACE_PLUGIN);
|
|
956
|
-
const [adding, setAdding] = useState5(false);
|
|
957
|
-
const keys = getMeta(object).keys;
|
|
958
|
-
const handleNew = useCallback9(() => setAdding(true), []);
|
|
959
|
-
const handleCancel = useCallback9(() => setAdding(false), []);
|
|
960
|
-
const handleSave = useCallback9((key) => {
|
|
961
|
-
const index = keys.findIndex(({ source, id }) => source === key.source && id === key.id);
|
|
962
|
-
if (index === -1) {
|
|
963
|
-
keys.push(key);
|
|
964
|
-
}
|
|
965
|
-
setAdding(false);
|
|
966
|
-
}, [
|
|
967
|
-
keys
|
|
968
|
-
]);
|
|
969
|
-
const handleDelete = useCallback9((key) => {
|
|
970
|
-
const index = keys.findIndex(({ source, id }) => source === key.source && id === key.id);
|
|
971
|
-
if (index !== -1) {
|
|
972
|
-
keys.splice(index, 1);
|
|
973
|
-
}
|
|
974
|
-
}, [
|
|
975
|
-
keys
|
|
976
|
-
]);
|
|
977
|
-
return /* @__PURE__ */ React12.createElement(React12.Fragment, null, /* @__PURE__ */ React12.createElement("div", {
|
|
978
|
-
className: "p-2 flex flex-col gap-4"
|
|
979
|
-
}, /* @__PURE__ */ React12.createElement("h2", null, t("advanced settings label")), /* @__PURE__ */ React12.createElement("div", {
|
|
980
|
-
className: "flex items-center"
|
|
981
|
-
}, /* @__PURE__ */ React12.createElement("h3", {
|
|
982
|
-
className: "text-sm font-semibold"
|
|
983
|
-
}, t("foreign keys")), /* @__PURE__ */ React12.createElement("div", {
|
|
984
|
-
className: "grow"
|
|
985
|
-
}), /* @__PURE__ */ React12.createElement(IconButton2, {
|
|
986
|
-
classNames: adding && "invisible",
|
|
987
|
-
icon: "ph--plus--regular",
|
|
988
|
-
label: t("add key"),
|
|
989
|
-
onClick: handleNew
|
|
990
|
-
})), !adding && /* @__PURE__ */ React12.createElement(ForeignKeys, {
|
|
991
|
-
keys,
|
|
992
|
-
onDelete: handleDelete
|
|
993
|
-
})), adding && /* @__PURE__ */ React12.createElement(Form3, {
|
|
994
|
-
schema: ForeignKeySchema,
|
|
995
|
-
values: initialValues2,
|
|
996
|
-
onSave: handleSave,
|
|
997
|
-
onCancel: handleCancel
|
|
998
|
-
}));
|
|
999
|
-
};
|
|
1000
|
-
|
|
1001
849
|
// packages/plugins/plugin-space/src/components/ObjectSettings/BaseObjectSettings.tsx
|
|
1002
|
-
import
|
|
1003
|
-
import { Input as Input2, useTranslation as
|
|
850
|
+
import React10, { useRef as useRef3 } from "react";
|
|
851
|
+
import { Input as Input2, useTranslation as useTranslation10 } from "@dxos/react-ui";
|
|
1004
852
|
import { mx as mx5 } from "@dxos/react-ui-theme";
|
|
1005
853
|
var BaseObjectSettings = ({ classNames, children, object }) => {
|
|
1006
|
-
const { t } =
|
|
854
|
+
const { t } = useTranslation10(meta.id);
|
|
1007
855
|
const inputRef = useRef3(null);
|
|
1008
|
-
return /* @__PURE__ */
|
|
856
|
+
return /* @__PURE__ */ React10.createElement("form", {
|
|
1009
857
|
className: mx5("flex flex-col p-2 gap-2", classNames)
|
|
1010
|
-
}, /* @__PURE__ */
|
|
858
|
+
}, /* @__PURE__ */ React10.createElement(Input2.Root, null, /* @__PURE__ */ React10.createElement(Input2.Label, null, t("name label")), /* @__PURE__ */ React10.createElement(Input2.TextInput, {
|
|
1011
859
|
ref: inputRef,
|
|
1012
860
|
placeholder: t("name placeholder"),
|
|
1013
861
|
value: object.name ?? "",
|
|
@@ -1029,29 +877,27 @@ var ObjectSettingsContainer = ({ object, role }) => {
|
|
|
1029
877
|
}), [
|
|
1030
878
|
object
|
|
1031
879
|
]);
|
|
1032
|
-
return /* @__PURE__ */
|
|
880
|
+
return /* @__PURE__ */ React11.createElement(Clipboard2.Provider, null, /* @__PURE__ */ React11.createElement(StackItem2.Content, {
|
|
1033
881
|
toolbar: false,
|
|
1034
882
|
role
|
|
1035
|
-
}, /* @__PURE__ */
|
|
883
|
+
}, /* @__PURE__ */ React11.createElement("div", {
|
|
1036
884
|
className: "flex flex-col overflow-y-auto divide-y divide-separator"
|
|
1037
|
-
}, /* @__PURE__ */
|
|
885
|
+
}, /* @__PURE__ */ React11.createElement(BaseObjectSettings, {
|
|
1038
886
|
object
|
|
1039
|
-
}, /* @__PURE__ */
|
|
887
|
+
}, /* @__PURE__ */ React11.createElement(Surface, {
|
|
1040
888
|
role: "base-object-settings",
|
|
1041
889
|
data
|
|
1042
|
-
})), /* @__PURE__ */
|
|
890
|
+
})), /* @__PURE__ */ React11.createElement(Surface, {
|
|
1043
891
|
role: "object-settings",
|
|
1044
892
|
data
|
|
1045
|
-
}), /* @__PURE__ */ React14.createElement(AdvancedObjectSettings, {
|
|
1046
|
-
object
|
|
1047
893
|
}))));
|
|
1048
894
|
};
|
|
1049
895
|
|
|
1050
896
|
// packages/plugins/plugin-space/src/components/PersistenceStatus.tsx
|
|
1051
897
|
import { ArrowsCounterClockwise, CheckCircle as CheckCircle2, Warning } from "@phosphor-icons/react";
|
|
1052
|
-
import
|
|
898
|
+
import React12, { useEffect as useEffect2, useState as useState4 } from "react";
|
|
1053
899
|
import { debounce } from "@dxos/async";
|
|
1054
|
-
import { Tooltip, useTranslation as
|
|
900
|
+
import { Tooltip, useTranslation as useTranslation11 } from "@dxos/react-ui";
|
|
1055
901
|
import { getSize as getSize3, mx as mx6, staticPlaceholderText, warningText } from "@dxos/react-ui-theme";
|
|
1056
902
|
var Status;
|
|
1057
903
|
(function(Status2) {
|
|
@@ -1060,12 +906,12 @@ var Status;
|
|
|
1060
906
|
Status2[Status2["ERROR"] = 2] = "ERROR";
|
|
1061
907
|
})(Status || (Status = {}));
|
|
1062
908
|
var PersistenceStatus = ({ db }) => {
|
|
1063
|
-
const { t } =
|
|
1064
|
-
const [displayMessage, setDisplayMessage] =
|
|
1065
|
-
const [status, naturalSetStatus] =
|
|
1066
|
-
const [prevStatus, setPrevStatus] =
|
|
909
|
+
const { t } = useTranslation11(SPACE_PLUGIN);
|
|
910
|
+
const [displayMessage, setDisplayMessage] = useState4(false);
|
|
911
|
+
const [status, naturalSetStatus] = useState4(0);
|
|
912
|
+
const [prevStatus, setPrevStatus] = useState4(0);
|
|
1067
913
|
const _setStatus = debounce(naturalSetStatus, 500);
|
|
1068
|
-
|
|
914
|
+
useEffect2(() => {
|
|
1069
915
|
setPrevStatus(status);
|
|
1070
916
|
if (prevStatus !== status && status === 0) {
|
|
1071
917
|
setDisplayMessage(true);
|
|
@@ -1077,94 +923,50 @@ var PersistenceStatus = ({ db }) => {
|
|
|
1077
923
|
]);
|
|
1078
924
|
switch (status) {
|
|
1079
925
|
case 2:
|
|
1080
|
-
return /* @__PURE__ */
|
|
926
|
+
return /* @__PURE__ */ React12.createElement("div", {
|
|
1081
927
|
className: "flex items-center"
|
|
1082
|
-
}, /* @__PURE__ */
|
|
928
|
+
}, /* @__PURE__ */ React12.createElement(Warning, {
|
|
1083
929
|
className: mx6(getSize3(4), "me-1")
|
|
1084
|
-
}), /* @__PURE__ */
|
|
930
|
+
}), /* @__PURE__ */ React12.createElement("span", {
|
|
1085
931
|
className: mx6("text-sm", warningText)
|
|
1086
932
|
}, t("persistence error label")));
|
|
1087
933
|
case 1:
|
|
1088
|
-
return /* @__PURE__ */
|
|
934
|
+
return /* @__PURE__ */ React12.createElement("div", {
|
|
1089
935
|
className: "flex items-center"
|
|
1090
|
-
}, /* @__PURE__ */
|
|
936
|
+
}, /* @__PURE__ */ React12.createElement(ArrowsCounterClockwise, {
|
|
1091
937
|
className: mx6(getSize3(4), "me-1")
|
|
1092
|
-
}), /* @__PURE__ */
|
|
938
|
+
}), /* @__PURE__ */ React12.createElement("span", {
|
|
1093
939
|
className: mx6("text-sm", staticPlaceholderText)
|
|
1094
940
|
}, t("persistence pending label")));
|
|
1095
941
|
case 0:
|
|
1096
942
|
default:
|
|
1097
|
-
return /* @__PURE__ */
|
|
1098
|
-
delayDuration: 400
|
|
1099
|
-
}, /* @__PURE__ */ React15.createElement(Tooltip.Trigger, {
|
|
943
|
+
return /* @__PURE__ */ React12.createElement(Tooltip.Trigger, {
|
|
944
|
+
delayDuration: 400,
|
|
1100
945
|
role: "status",
|
|
946
|
+
content: t("persisted locally message"),
|
|
1101
947
|
className: "flex items-center"
|
|
1102
|
-
}, /* @__PURE__ */
|
|
948
|
+
}, /* @__PURE__ */ React12.createElement(CheckCircle2, {
|
|
1103
949
|
className: mx6(getSize3(4), "me-1")
|
|
1104
|
-
}), displayMessage && /* @__PURE__ */
|
|
950
|
+
}), displayMessage && /* @__PURE__ */ React12.createElement("span", {
|
|
1105
951
|
className: mx6("text-sm", staticPlaceholderText)
|
|
1106
|
-
}, t("persisted locally label")))
|
|
952
|
+
}, t("persisted locally label")));
|
|
1107
953
|
}
|
|
1108
954
|
};
|
|
1109
955
|
|
|
1110
|
-
// packages/plugins/plugin-space/src/components/PopoverAddSpace.tsx
|
|
1111
|
-
import React16 from "react";
|
|
1112
|
-
import { createIntent as createIntent5, LayoutAction as LayoutAction5, useIntentDispatcher as useIntentDispatcher5 } from "@dxos/app-framework";
|
|
1113
|
-
import { IconButton as IconButton3, useTranslation as useTranslation14 } from "@dxos/react-ui";
|
|
1114
|
-
var POPOVER_ADD_SPACE = `${SPACE_PLUGIN}/PopoverRenameSpace`;
|
|
1115
|
-
var PopoverAddSpace = () => {
|
|
1116
|
-
const { t } = useTranslation14(SPACE_PLUGIN);
|
|
1117
|
-
const { dispatchPromise: dispatch } = useIntentDispatcher5();
|
|
1118
|
-
return /* @__PURE__ */ React16.createElement("div", {
|
|
1119
|
-
role: "none",
|
|
1120
|
-
className: "grid grid-cols-1 gap-1 [&>button]:justify-start"
|
|
1121
|
-
}, /* @__PURE__ */ React16.createElement(IconButton3, {
|
|
1122
|
-
variant: "ghost",
|
|
1123
|
-
label: t("create space label"),
|
|
1124
|
-
icon: "ph--plus--regular",
|
|
1125
|
-
onClick: () => {
|
|
1126
|
-
void dispatch(createIntent5(SpaceAction.OpenCreateSpace));
|
|
1127
|
-
void dispatch(createIntent5(LayoutAction5.UpdatePopover, {
|
|
1128
|
-
part: "popover",
|
|
1129
|
-
options: {
|
|
1130
|
-
variant: "react",
|
|
1131
|
-
anchorId: "",
|
|
1132
|
-
state: false
|
|
1133
|
-
}
|
|
1134
|
-
}));
|
|
1135
|
-
},
|
|
1136
|
-
"data-testid": "spacePlugin.createSpace"
|
|
1137
|
-
}), /* @__PURE__ */ React16.createElement(IconButton3, {
|
|
1138
|
-
variant: "ghost",
|
|
1139
|
-
label: t("join space label"),
|
|
1140
|
-
icon: "ph--sign-in--regular",
|
|
1141
|
-
onClick: () => {
|
|
1142
|
-
void dispatch(createIntent5(SpaceAction.Join));
|
|
1143
|
-
void dispatch(createIntent5(LayoutAction5.UpdatePopover, {
|
|
1144
|
-
part: "popover",
|
|
1145
|
-
options: {
|
|
1146
|
-
variant: "react",
|
|
1147
|
-
anchorId: "",
|
|
1148
|
-
state: false
|
|
1149
|
-
}
|
|
1150
|
-
}));
|
|
1151
|
-
},
|
|
1152
|
-
"data-testid": "spacePlugin.joinSpace"
|
|
1153
|
-
}));
|
|
1154
|
-
};
|
|
1155
|
-
|
|
1156
956
|
// packages/plugins/plugin-space/src/components/PopoverRenameObject.tsx
|
|
1157
|
-
import
|
|
957
|
+
import React13, { useCallback as useCallback7, useRef as useRef4, useState as useState5 } from "react";
|
|
958
|
+
import { createIntent as createIntent6, LayoutAction as LayoutAction5, useIntentDispatcher as useIntentDispatcher6 } from "@dxos/app-framework";
|
|
1158
959
|
import { log as log2 } from "@dxos/log";
|
|
1159
|
-
import { Button as Button5, Input as Input3,
|
|
960
|
+
import { Button as Button5, Input as Input3, useTranslation as useTranslation12 } from "@dxos/react-ui";
|
|
1160
961
|
var __dxlog_file4 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/PopoverRenameObject.tsx";
|
|
1161
962
|
var POPOVER_RENAME_OBJECT = `${SPACE_PLUGIN}/PopoverRenameObject`;
|
|
1162
963
|
var PopoverRenameObject = ({ object: obj }) => {
|
|
1163
|
-
const { t } =
|
|
964
|
+
const { t } = useTranslation12(SPACE_PLUGIN);
|
|
1164
965
|
const doneButton = useRef4(null);
|
|
1165
966
|
const object = obj;
|
|
1166
|
-
const [name, setName] =
|
|
1167
|
-
const
|
|
967
|
+
const [name, setName] = useState5(object.name || object.title || "");
|
|
968
|
+
const { dispatchPromise: dispatch } = useIntentDispatcher6();
|
|
969
|
+
const handleDone = useCallback7(() => {
|
|
1168
970
|
try {
|
|
1169
971
|
object.name = name;
|
|
1170
972
|
} catch {
|
|
@@ -1175,73 +977,89 @@ var PopoverRenameObject = ({ object: obj }) => {
|
|
|
1175
977
|
err
|
|
1176
978
|
}, {
|
|
1177
979
|
F: __dxlog_file4,
|
|
1178
|
-
L:
|
|
980
|
+
L: 32,
|
|
1179
981
|
S: void 0,
|
|
1180
982
|
C: (f, a) => f(...a)
|
|
1181
983
|
});
|
|
1182
984
|
}
|
|
1183
985
|
}
|
|
986
|
+
void dispatch(createIntent6(LayoutAction5.UpdatePopover, {
|
|
987
|
+
part: "popover",
|
|
988
|
+
options: {
|
|
989
|
+
variant: "react",
|
|
990
|
+
anchorId: "",
|
|
991
|
+
state: false
|
|
992
|
+
}
|
|
993
|
+
}));
|
|
1184
994
|
}, [
|
|
1185
995
|
object,
|
|
1186
996
|
name
|
|
1187
997
|
]);
|
|
1188
|
-
return /* @__PURE__ */
|
|
998
|
+
return /* @__PURE__ */ React13.createElement("div", {
|
|
1189
999
|
role: "none",
|
|
1190
1000
|
className: "p-1 flex gap-2"
|
|
1191
|
-
}, /* @__PURE__ */
|
|
1001
|
+
}, /* @__PURE__ */ React13.createElement("div", {
|
|
1192
1002
|
role: "none",
|
|
1193
1003
|
className: "flex-1"
|
|
1194
|
-
}, /* @__PURE__ */
|
|
1004
|
+
}, /* @__PURE__ */ React13.createElement(Input3.Root, null, /* @__PURE__ */ React13.createElement(Input3.Label, {
|
|
1195
1005
|
srOnly: true
|
|
1196
|
-
}, t("object name label")), /* @__PURE__ */
|
|
1006
|
+
}, t("object name label")), /* @__PURE__ */ React13.createElement(Input3.TextInput, {
|
|
1197
1007
|
placeholder: t("object placeholder"),
|
|
1198
1008
|
value: name,
|
|
1199
1009
|
"data-testid": "spacePlugin.renameObject.input",
|
|
1200
1010
|
onChange: ({ target: { value } }) => setName(value),
|
|
1201
1011
|
onKeyDown: ({ key }) => key === "Enter" && doneButton.current?.click()
|
|
1202
|
-
}))), /* @__PURE__ */
|
|
1203
|
-
asChild: true
|
|
1204
|
-
}, /* @__PURE__ */ React17.createElement(Button5, {
|
|
1012
|
+
}))), /* @__PURE__ */ React13.createElement(Button5, {
|
|
1205
1013
|
ref: doneButton,
|
|
1206
1014
|
classNames: "self-stretch",
|
|
1207
1015
|
onClick: handleDone
|
|
1208
1016
|
}, t("done label", {
|
|
1209
1017
|
ns: "os"
|
|
1210
|
-
})))
|
|
1018
|
+
})));
|
|
1211
1019
|
};
|
|
1212
1020
|
|
|
1213
1021
|
// packages/plugins/plugin-space/src/components/PopoverRenameSpace.tsx
|
|
1214
|
-
import
|
|
1215
|
-
import {
|
|
1022
|
+
import React14, { useCallback as useCallback8, useRef as useRef5, useState as useState6 } from "react";
|
|
1023
|
+
import { createIntent as createIntent7, LayoutAction as LayoutAction6, useIntentDispatcher as useIntentDispatcher7 } from "@dxos/app-framework";
|
|
1024
|
+
import { Button as Button6, Input as Input4, Popover, useTranslation as useTranslation13 } from "@dxos/react-ui";
|
|
1216
1025
|
var POPOVER_RENAME_SPACE = `${SPACE_PLUGIN}/PopoverRenameSpace`;
|
|
1217
1026
|
var PopoverRenameSpace = ({ space }) => {
|
|
1218
|
-
const { t } =
|
|
1027
|
+
const { t } = useTranslation13(SPACE_PLUGIN);
|
|
1219
1028
|
const doneButton = useRef5(null);
|
|
1220
|
-
const [name, setName] =
|
|
1221
|
-
const
|
|
1029
|
+
const [name, setName] = useState6(space.properties.name ?? "");
|
|
1030
|
+
const { dispatchPromise: dispatch } = useIntentDispatcher7();
|
|
1031
|
+
const handleDone = useCallback8(() => {
|
|
1222
1032
|
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
|
+
}));
|
|
1223
1041
|
}, [
|
|
1224
1042
|
space,
|
|
1225
1043
|
name
|
|
1226
1044
|
]);
|
|
1227
|
-
return /* @__PURE__ */
|
|
1045
|
+
return /* @__PURE__ */ React14.createElement("div", {
|
|
1228
1046
|
role: "none",
|
|
1229
1047
|
className: "p-1 flex gap-2"
|
|
1230
|
-
}, /* @__PURE__ */
|
|
1048
|
+
}, /* @__PURE__ */ React14.createElement("div", {
|
|
1231
1049
|
role: "none",
|
|
1232
1050
|
className: "flex-1"
|
|
1233
|
-
}, /* @__PURE__ */
|
|
1051
|
+
}, /* @__PURE__ */ React14.createElement(Input4.Root, null, /* @__PURE__ */ React14.createElement(Input4.Label, {
|
|
1234
1052
|
srOnly: true
|
|
1235
|
-
}, t("space name label")), /* @__PURE__ */
|
|
1053
|
+
}, t("space name label")), /* @__PURE__ */ React14.createElement(Input4.TextInput, {
|
|
1236
1054
|
defaultValue: space.properties.name ?? "",
|
|
1237
1055
|
placeholder: t("unnamed space label"),
|
|
1238
1056
|
onChange: ({ target: { value } }) => setName(value),
|
|
1239
1057
|
// TODO(wittjosiah): Ideally this should access the popover context to close the popover.
|
|
1240
1058
|
// Currently this is not possible because Radix does not expose the popover context.
|
|
1241
1059
|
onKeyDown: ({ key }) => key === "Enter" && doneButton.current?.click()
|
|
1242
|
-
}))), /* @__PURE__ */
|
|
1060
|
+
}))), /* @__PURE__ */ React14.createElement(Popover.Close, {
|
|
1243
1061
|
asChild: true
|
|
1244
|
-
}, /* @__PURE__ */
|
|
1062
|
+
}, /* @__PURE__ */ React14.createElement(Button6, {
|
|
1245
1063
|
ref: doneButton,
|
|
1246
1064
|
classNames: "self-stretch",
|
|
1247
1065
|
onClick: handleDone
|
|
@@ -1251,13 +1069,13 @@ var PopoverRenameSpace = ({ space }) => {
|
|
|
1251
1069
|
};
|
|
1252
1070
|
|
|
1253
1071
|
// packages/plugins/plugin-space/src/components/SchemaContainer.tsx
|
|
1254
|
-
import
|
|
1255
|
-
import { useTranslation as
|
|
1072
|
+
import React15, { useState as useState7, useEffect as useEffect3 } from "react";
|
|
1073
|
+
import { useTranslation as useTranslation14 } from "@dxos/react-ui";
|
|
1256
1074
|
import { controlItemClasses, ControlPage as ControlPage2, ControlSection as ControlSection2 } from "@dxos/react-ui-form";
|
|
1257
1075
|
import { StackItem as StackItem3 } from "@dxos/react-ui-stack";
|
|
1258
1076
|
var useQuerySpaceSchemas = (space) => {
|
|
1259
|
-
const [schemas, setSchemas] =
|
|
1260
|
-
|
|
1077
|
+
const [schemas, setSchemas] = useState7([]);
|
|
1078
|
+
useEffect3(() => {
|
|
1261
1079
|
const query = space.db.schemaRegistry.query();
|
|
1262
1080
|
const initialResults = query.runSync();
|
|
1263
1081
|
setSchemas(initialResults);
|
|
@@ -1269,53 +1087,32 @@ var useQuerySpaceSchemas = (space) => {
|
|
|
1269
1087
|
return schemas;
|
|
1270
1088
|
};
|
|
1271
1089
|
var SchemaContainer = ({ space }) => {
|
|
1272
|
-
const { t } =
|
|
1090
|
+
const { t } = useTranslation14(SPACE_PLUGIN);
|
|
1273
1091
|
const schemas = useQuerySpaceSchemas(space);
|
|
1274
|
-
return /* @__PURE__ */
|
|
1092
|
+
return /* @__PURE__ */ React15.createElement(StackItem3.Content, {
|
|
1275
1093
|
classNames: "block overflow-y-auto"
|
|
1276
|
-
}, /* @__PURE__ */
|
|
1094
|
+
}, /* @__PURE__ */ React15.createElement(ControlPage2, null, /* @__PURE__ */ React15.createElement(ControlSection2, {
|
|
1277
1095
|
title: t("schema verbose label"),
|
|
1278
1096
|
description: t("schema description")
|
|
1279
|
-
}, /* @__PURE__ */
|
|
1097
|
+
}, /* @__PURE__ */ React15.createElement("div", {
|
|
1280
1098
|
role: "none",
|
|
1281
1099
|
className: controlItemClasses
|
|
1282
|
-
}, schemas.length === 0 && /* @__PURE__ */
|
|
1100
|
+
}, schemas.length === 0 && /* @__PURE__ */ React15.createElement("div", {
|
|
1283
1101
|
className: "text-center plb-4"
|
|
1284
|
-
}, t("no schemas found message")), schemas.map((schema) => /* @__PURE__ */
|
|
1102
|
+
}, t("no schemas found message")), schemas.map((schema) => /* @__PURE__ */ React15.createElement("div", {
|
|
1285
1103
|
key: schema.id
|
|
1286
|
-
}, /* @__PURE__ */
|
|
1287
|
-
};
|
|
1288
|
-
|
|
1289
|
-
// packages/plugins/plugin-space/src/components/ShareSpaceButton.tsx
|
|
1290
|
-
import React20 from "react";
|
|
1291
|
-
import { createIntent as createIntent6, useIntentDispatcher as useIntentDispatcher6 } from "@dxos/app-framework";
|
|
1292
|
-
import { IconButton as IconButton4, useTranslation as useTranslation18 } from "@dxos/react-ui";
|
|
1293
|
-
var ShareSpaceButton = ({ space }) => {
|
|
1294
|
-
const { dispatchPromise: dispatch } = useIntentDispatcher6();
|
|
1295
|
-
return /* @__PURE__ */ React20.createElement(ShareSpaceButtonImpl, {
|
|
1296
|
-
onClick: () => dispatch(createIntent6(SpaceAction.Share, {
|
|
1297
|
-
space
|
|
1298
|
-
}))
|
|
1299
|
-
});
|
|
1300
|
-
};
|
|
1301
|
-
var ShareSpaceButtonImpl = ({ onClick }) => {
|
|
1302
|
-
const { t } = useTranslation18(SPACE_PLUGIN);
|
|
1303
|
-
return /* @__PURE__ */ React20.createElement(IconButton4, {
|
|
1304
|
-
"data-testid": "spacePlugin.shareSpaceButton",
|
|
1305
|
-
icon: "ph--users--regular",
|
|
1306
|
-
label: t("share space label"),
|
|
1307
|
-
onClick
|
|
1308
|
-
});
|
|
1104
|
+
}, /* @__PURE__ */ React15.createElement("div", null, schema.typename)))))));
|
|
1309
1105
|
};
|
|
1310
1106
|
|
|
1311
1107
|
// packages/plugins/plugin-space/src/components/SpacePresence.tsx
|
|
1312
|
-
import
|
|
1108
|
+
import { Option } from "effect";
|
|
1109
|
+
import React16, { forwardRef, useCallback as useCallback9, useEffect as useEffect4, useState as useState8 } from "react";
|
|
1313
1110
|
import { useAppGraph as useAppGraph2, useCapability } from "@dxos/app-framework";
|
|
1314
1111
|
import { generateName } from "@dxos/display-name";
|
|
1315
1112
|
import { PublicKey, useClient as useClient5 } from "@dxos/react-client";
|
|
1316
1113
|
import { getSpace as getSpace3, useMembers, fullyQualifiedId as fullyQualifiedId3 } from "@dxos/react-client/echo";
|
|
1317
1114
|
import { useIdentity } from "@dxos/react-client/halo";
|
|
1318
|
-
import { Avatar, Tooltip as Tooltip2,
|
|
1115
|
+
import { Avatar, Tooltip as Tooltip2, Popover as Popover2, useTranslation as useTranslation15, List, ListItem, useDefaultValue } from "@dxos/react-ui";
|
|
1319
1116
|
import { AttentionGlyph, useAttended, useAttention } from "@dxos/react-ui-attention";
|
|
1320
1117
|
import { ComplexMap, keyToFallback } from "@dxos/util";
|
|
1321
1118
|
var REFRESH_INTERVAL = 5e3;
|
|
@@ -1328,13 +1125,13 @@ var SpacePresence = ({ object, spaceKey }) => {
|
|
|
1328
1125
|
const identity = useIdentity();
|
|
1329
1126
|
const space = spaceKey ? client.spaces.get(spaceKey) : getSpace3(object);
|
|
1330
1127
|
const spaceMembers = useMembers(space?.key);
|
|
1331
|
-
const [_moment, setMoment] =
|
|
1332
|
-
|
|
1128
|
+
const [_moment, setMoment] = useState8(Date.now());
|
|
1129
|
+
useEffect4(() => {
|
|
1333
1130
|
const interval = setInterval(() => setMoment(Date.now()), REFRESH_INTERVAL);
|
|
1334
1131
|
return () => clearInterval(interval);
|
|
1335
1132
|
}, []);
|
|
1336
|
-
const memberOnline =
|
|
1337
|
-
const memberIsNotSelf =
|
|
1133
|
+
const memberOnline = useCallback9((member) => member.presence === 1, []);
|
|
1134
|
+
const memberIsNotSelf = useCallback9((member) => !identity?.identityKey.equals(member.identity.identityKey), [
|
|
1338
1135
|
identity?.identityKey
|
|
1339
1136
|
]);
|
|
1340
1137
|
if (!identity || !spaceState || !space) {
|
|
@@ -1351,7 +1148,7 @@ var SpacePresence = ({ object, spaceKey }) => {
|
|
|
1351
1148
|
lastSeen
|
|
1352
1149
|
};
|
|
1353
1150
|
}).toSorted((a, b) => a.lastSeen - b.lastSeen);
|
|
1354
|
-
return /* @__PURE__ */
|
|
1151
|
+
return /* @__PURE__ */ React16.createElement(FullPresence, {
|
|
1355
1152
|
members: membersForObject
|
|
1356
1153
|
});
|
|
1357
1154
|
};
|
|
@@ -1361,40 +1158,39 @@ var FullPresence = (props) => {
|
|
|
1361
1158
|
if (members.length === 0) {
|
|
1362
1159
|
return null;
|
|
1363
1160
|
}
|
|
1364
|
-
return /* @__PURE__ */
|
|
1161
|
+
return /* @__PURE__ */ React16.createElement("div", {
|
|
1365
1162
|
className: "dx-avatar-group",
|
|
1366
1163
|
"data-testid": "spacePlugin.presence"
|
|
1367
|
-
}, members.slice(0, 3).map((member, i) => /* @__PURE__ */
|
|
1368
|
-
key: member.identity.identityKey.toHex()
|
|
1369
|
-
|
|
1164
|
+
}, members.slice(0, 3).map((member, i) => /* @__PURE__ */ React16.createElement(Tooltip2.Trigger, {
|
|
1165
|
+
key: member.identity.identityKey.toHex(),
|
|
1166
|
+
side: "bottom",
|
|
1167
|
+
content: getName(member.identity),
|
|
1370
1168
|
className: "grid focus:outline-none"
|
|
1371
|
-
}, /* @__PURE__ */
|
|
1169
|
+
}, /* @__PURE__ */ React16.createElement(PresenceAvatar, {
|
|
1372
1170
|
identity: member.identity,
|
|
1373
1171
|
match: member.currentlyAttended,
|
|
1374
1172
|
index: members.length - i,
|
|
1375
1173
|
onClick: () => onMemberClick?.(member),
|
|
1376
1174
|
size
|
|
1377
|
-
})), /* @__PURE__ */
|
|
1378
|
-
side: "bottom"
|
|
1379
|
-
}, /* @__PURE__ */ React21.createElement("span", null, getName(member.identity)), /* @__PURE__ */ React21.createElement(Tooltip2.Arrow, null))))), members.length > 3 && /* @__PURE__ */ React21.createElement(Tooltip2.Root, null, /* @__PURE__ */ React21.createElement(Tooltip2.Trigger, {
|
|
1175
|
+
}))), members.length > 3 && /* @__PURE__ */ React16.createElement(Popover2.Root, null, /* @__PURE__ */ React16.createElement(Popover2.Trigger, {
|
|
1380
1176
|
className: "grid focus:outline-none"
|
|
1381
|
-
}, /* @__PURE__ */
|
|
1177
|
+
}, /* @__PURE__ */ React16.createElement(Avatar.Root, null, /* @__PURE__ */ React16.createElement(Avatar.Content, {
|
|
1382
1178
|
status: "inactive",
|
|
1383
1179
|
style: {
|
|
1384
1180
|
zIndex: members.length - 4
|
|
1385
1181
|
},
|
|
1386
1182
|
fallback: `+${members.length - 3}`,
|
|
1387
1183
|
size
|
|
1388
|
-
}))), /* @__PURE__ */
|
|
1184
|
+
}))), /* @__PURE__ */ React16.createElement(Popover2.Portal, null, /* @__PURE__ */ React16.createElement(Popover2.Content, {
|
|
1389
1185
|
side: "bottom"
|
|
1390
|
-
}, /* @__PURE__ */
|
|
1186
|
+
}, /* @__PURE__ */ React16.createElement(Popover2.Arrow, null), /* @__PURE__ */ React16.createElement(List, {
|
|
1391
1187
|
classNames: "max-h-56 overflow-y-auto"
|
|
1392
|
-
}, members.map((member) => /* @__PURE__ */
|
|
1188
|
+
}, members.map((member) => /* @__PURE__ */ React16.createElement(ListItem.Root, {
|
|
1393
1189
|
key: member.identity.identityKey.toHex(),
|
|
1394
1190
|
classNames: "flex gap-2 items-center cursor-pointer mbe-2",
|
|
1395
1191
|
onClick: () => onMemberClick?.(member),
|
|
1396
1192
|
"data-testid": "identity-list-item"
|
|
1397
|
-
}, /* @__PURE__ */
|
|
1193
|
+
}, /* @__PURE__ */ React16.createElement(PresenceAvatar, {
|
|
1398
1194
|
identity: member.identity,
|
|
1399
1195
|
size,
|
|
1400
1196
|
showName: true,
|
|
@@ -1404,7 +1200,7 @@ var FullPresence = (props) => {
|
|
|
1404
1200
|
var PresenceAvatar = /* @__PURE__ */ forwardRef(({ identity, showName, match, index, onClick, size }, forwardedRef) => {
|
|
1405
1201
|
const status = match ? "current" : "active";
|
|
1406
1202
|
const fallbackValue = keyToFallback(identity.identityKey);
|
|
1407
|
-
return /* @__PURE__ */
|
|
1203
|
+
return /* @__PURE__ */ React16.createElement(Avatar.Root, null, /* @__PURE__ */ React16.createElement(Avatar.Content, {
|
|
1408
1204
|
status,
|
|
1409
1205
|
hue: identity.profile?.data?.hue || fallbackValue.hue,
|
|
1410
1206
|
"data-testid": "spacePlugin.presence.member",
|
|
@@ -1418,7 +1214,7 @@ var PresenceAvatar = /* @__PURE__ */ forwardRef(({ identity, showName, match, in
|
|
|
1418
1214
|
onClick,
|
|
1419
1215
|
fallback: identity.profile?.data?.emoji || fallbackValue.emoji,
|
|
1420
1216
|
ref: forwardedRef
|
|
1421
|
-
}), /* @__PURE__ */
|
|
1217
|
+
}), /* @__PURE__ */ React16.createElement(Avatar.Label, {
|
|
1422
1218
|
classNames: showName ? "text-sm truncate pli-2" : "sr-only"
|
|
1423
1219
|
}, getName(identity)));
|
|
1424
1220
|
});
|
|
@@ -1429,13 +1225,13 @@ var SmallPresenceLive = ({ id, open, viewers }) => {
|
|
|
1429
1225
|
const attended = useAttended();
|
|
1430
1226
|
const startOfAttention = attended.at(-1);
|
|
1431
1227
|
const path = usePath(graph, startOfAttention);
|
|
1432
|
-
const containsAttended = !open && !isAttended && id && path ? path.includes(id) : false;
|
|
1228
|
+
const containsAttended = !open && !isAttended && id && Option.isSome(path) ? path.value.includes(id) : false;
|
|
1433
1229
|
const getActiveViewers = (viewers2) => {
|
|
1434
1230
|
const moment = Date.now();
|
|
1435
1231
|
return Array.from(viewers2.values()).filter((viewer) => moment - viewer.lastSeen < ACTIVITY_DURATION);
|
|
1436
1232
|
};
|
|
1437
|
-
const [activeViewers, setActiveViewers] =
|
|
1438
|
-
|
|
1233
|
+
const [activeViewers, setActiveViewers] = useState8(viewers ? getActiveViewers(viewers) : []);
|
|
1234
|
+
useEffect4(() => {
|
|
1439
1235
|
if (viewers) {
|
|
1440
1236
|
setActiveViewers(getActiveViewers(viewers));
|
|
1441
1237
|
const interval = setInterval(() => {
|
|
@@ -1446,96 +1242,96 @@ var SmallPresenceLive = ({ id, open, viewers }) => {
|
|
|
1446
1242
|
}, [
|
|
1447
1243
|
viewers
|
|
1448
1244
|
]);
|
|
1449
|
-
return /* @__PURE__ */
|
|
1245
|
+
return /* @__PURE__ */ React16.createElement(SmallPresence, {
|
|
1450
1246
|
count: activeViewers.length,
|
|
1451
1247
|
attended: isAttended,
|
|
1452
1248
|
containsAttended
|
|
1453
1249
|
});
|
|
1454
1250
|
};
|
|
1455
1251
|
var SmallPresence = ({ count = 0, attended, containsAttended }) => {
|
|
1456
|
-
const { t } =
|
|
1457
|
-
return /* @__PURE__ */
|
|
1458
|
-
asChild: true
|
|
1459
|
-
|
|
1252
|
+
const { t } = useTranslation15(SPACE_PLUGIN);
|
|
1253
|
+
return /* @__PURE__ */ React16.createElement(Tooltip2.Trigger, {
|
|
1254
|
+
asChild: true,
|
|
1255
|
+
content: t("presence label", {
|
|
1256
|
+
count
|
|
1257
|
+
}),
|
|
1258
|
+
side: "bottom"
|
|
1259
|
+
}, /* @__PURE__ */ React16.createElement(AttentionGlyph, {
|
|
1460
1260
|
attended,
|
|
1461
1261
|
containsAttended,
|
|
1462
1262
|
presence: count > 1 ? "many" : count === 1 ? "one" : "none",
|
|
1463
1263
|
classNames: "self-center mie-1"
|
|
1464
|
-
}))
|
|
1465
|
-
side: "bottom"
|
|
1466
|
-
}, /* @__PURE__ */ React21.createElement("span", null, t("presence label", {
|
|
1467
|
-
count
|
|
1468
|
-
})), /* @__PURE__ */ React21.createElement(Tooltip2.Arrow, null))));
|
|
1264
|
+
}));
|
|
1469
1265
|
};
|
|
1470
1266
|
|
|
1471
1267
|
// packages/plugins/plugin-space/src/components/SpacePluginSettings.tsx
|
|
1472
|
-
import
|
|
1473
|
-
import { createIntent as
|
|
1268
|
+
import React17 from "react";
|
|
1269
|
+
import { createIntent as createIntent8, useIntentDispatcher as useIntentDispatcher8 } from "@dxos/app-framework";
|
|
1474
1270
|
import { useClient as useClient6 } from "@dxos/react-client";
|
|
1475
1271
|
import { useSpaces as useSpaces2 } from "@dxos/react-client/echo";
|
|
1476
|
-
import { Input as Input5, toLocalizedString as toLocalizedString3, useTranslation as
|
|
1272
|
+
import { Input as Input5, toLocalizedString as toLocalizedString3, useTranslation as useTranslation16, List as List2, ListItem as ListItem2, Button as Button7 } from "@dxos/react-ui";
|
|
1477
1273
|
import { DeprecatedFormContainer, DeprecatedFormInput } from "@dxos/react-ui-form";
|
|
1478
1274
|
var SpacePluginSettings = ({ settings }) => {
|
|
1479
|
-
const { t } =
|
|
1480
|
-
const { dispatchPromise: dispatch } =
|
|
1275
|
+
const { t } = useTranslation16(SPACE_PLUGIN);
|
|
1276
|
+
const { dispatchPromise: dispatch } = useIntentDispatcher8();
|
|
1481
1277
|
const client = useClient6();
|
|
1482
1278
|
const spaces = useSpaces2({
|
|
1483
1279
|
all: settings.showHidden
|
|
1484
1280
|
});
|
|
1485
|
-
return /* @__PURE__ */
|
|
1281
|
+
return /* @__PURE__ */ React17.createElement(DeprecatedFormContainer, null, /* @__PURE__ */ React17.createElement(DeprecatedFormInput, {
|
|
1486
1282
|
label: t("show hidden spaces label")
|
|
1487
|
-
}, /* @__PURE__ */
|
|
1283
|
+
}, /* @__PURE__ */ React17.createElement(Input5.Switch, {
|
|
1488
1284
|
checked: settings.showHidden,
|
|
1489
1285
|
onCheckedChange: (checked) => settings.showHidden = !!checked
|
|
1490
|
-
})), /* @__PURE__ */
|
|
1286
|
+
})), /* @__PURE__ */ React17.createElement("div", {
|
|
1491
1287
|
role: "none"
|
|
1492
|
-
}, /* @__PURE__ */
|
|
1288
|
+
}, /* @__PURE__ */ React17.createElement("h2", {
|
|
1493
1289
|
className: "text-xl my-4"
|
|
1494
|
-
}, "Space Settings"), /* @__PURE__ */
|
|
1290
|
+
}, "Space Settings"), /* @__PURE__ */ React17.createElement(List2, {
|
|
1495
1291
|
classNames: "max-w-md mx-auto"
|
|
1496
|
-
}, spaces.map((space) => /* @__PURE__ */
|
|
1292
|
+
}, spaces.map((space) => /* @__PURE__ */ React17.createElement(ListItem2.Root, {
|
|
1497
1293
|
key: space.id
|
|
1498
|
-
}, /* @__PURE__ */
|
|
1294
|
+
}, /* @__PURE__ */ React17.createElement(ListItem2.Heading, {
|
|
1499
1295
|
classNames: "flex flex-col grow truncate mbe-2"
|
|
1500
1296
|
}, toLocalizedString3(getSpaceDisplayName(space, {
|
|
1501
1297
|
personal: space === client.spaces.default
|
|
1502
|
-
}), t)), /* @__PURE__ */
|
|
1503
|
-
onClick: () => dispatch(
|
|
1298
|
+
}), t)), /* @__PURE__ */ React17.createElement(ListItem2.Endcap, null, /* @__PURE__ */ React17.createElement(Button7, {
|
|
1299
|
+
onClick: () => dispatch(createIntent8(SpaceAction.OpenSettings, {
|
|
1504
1300
|
space
|
|
1505
1301
|
}))
|
|
1506
1302
|
}, t("open space settings label"))))))));
|
|
1507
1303
|
};
|
|
1508
1304
|
|
|
1509
1305
|
// packages/plugins/plugin-space/src/components/SpaceSettings/SpaceSettingsContainer.tsx
|
|
1510
|
-
import { pipe as pipe2, Schema
|
|
1511
|
-
import
|
|
1512
|
-
import { chain as chain2, createIntent as
|
|
1306
|
+
import { pipe as pipe2, Schema } from "effect";
|
|
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";
|
|
1513
1309
|
import { log as log3 } from "@dxos/log";
|
|
1514
1310
|
import { EdgeReplicationSetting } from "@dxos/protocols/proto/dxos/echo/metadata";
|
|
1515
1311
|
import { useClient as useClient7 } from "@dxos/react-client";
|
|
1516
1312
|
import { SpaceState as SpaceState2 } from "@dxos/react-client/echo";
|
|
1517
|
-
import { Button as Button8, Input as Input6, useMulticastObservable, useTranslation as
|
|
1518
|
-
import { Form as
|
|
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";
|
|
1519
1315
|
import { HuePicker, IconPicker } from "@dxos/react-ui-pickers";
|
|
1520
1316
|
import { StackItem as StackItem4 } from "@dxos/react-ui-stack";
|
|
1521
1317
|
var __dxlog_file5 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/SpaceSettings/SpaceSettingsContainer.tsx";
|
|
1522
|
-
var FormSchema = SpaceForm.pipe(
|
|
1523
|
-
archived:
|
|
1318
|
+
var FormSchema = SpaceForm.pipe(Schema.extend(Schema.Struct({
|
|
1319
|
+
archived: Schema.Boolean.annotations({
|
|
1524
1320
|
title: "Archive space"
|
|
1525
1321
|
})
|
|
1526
1322
|
})));
|
|
1527
1323
|
var SpaceSettingsContainer = ({ space }) => {
|
|
1528
|
-
const { t } =
|
|
1529
|
-
const { dispatchPromise: dispatch } =
|
|
1324
|
+
const { t } = useTranslation17(SPACE_PLUGIN);
|
|
1325
|
+
const { dispatchPromise: dispatch } = useIntentDispatcher9();
|
|
1530
1326
|
const client = useClient7();
|
|
1531
1327
|
const archived = useMulticastObservable(space.state) === SpaceState2.SPACE_INACTIVE;
|
|
1532
|
-
const [edgeReplication, setEdgeReplication] =
|
|
1533
|
-
const toggleEdgeReplication =
|
|
1328
|
+
const [edgeReplication, setEdgeReplication] = useState9(space.internal.data.edgeReplication === EdgeReplicationSetting.ENABLED);
|
|
1329
|
+
const toggleEdgeReplication = useCallback10(async (next) => {
|
|
1534
1330
|
setEdgeReplication(next);
|
|
1535
1331
|
await space?.internal.setEdgeReplicationPreference(next ? EdgeReplicationSetting.ENABLED : EdgeReplicationSetting.DISABLED).catch((err) => {
|
|
1536
1332
|
log3.catch(err, void 0, {
|
|
1537
1333
|
F: __dxlog_file5,
|
|
1538
|
-
L:
|
|
1334
|
+
L: 51,
|
|
1539
1335
|
S: void 0,
|
|
1540
1336
|
C: (f, a) => f(...a)
|
|
1541
1337
|
});
|
|
@@ -1544,7 +1340,7 @@ var SpaceSettingsContainer = ({ space }) => {
|
|
|
1544
1340
|
}, [
|
|
1545
1341
|
space
|
|
1546
1342
|
]);
|
|
1547
|
-
const handleSave =
|
|
1343
|
+
const handleSave = useCallback10((properties) => {
|
|
1548
1344
|
void toggleEdgeReplication(properties.edgeReplication);
|
|
1549
1345
|
if (properties.name !== space.properties.name) {
|
|
1550
1346
|
space.properties.name = properties.name;
|
|
@@ -1556,14 +1352,14 @@ var SpaceSettingsContainer = ({ space }) => {
|
|
|
1556
1352
|
space.properties.hue = properties.hue;
|
|
1557
1353
|
}
|
|
1558
1354
|
if (properties.archived && !archived) {
|
|
1559
|
-
void dispatch(pipe2(
|
|
1355
|
+
void dispatch(pipe2(createIntent9(SpaceAction.Close, {
|
|
1560
1356
|
space
|
|
1561
|
-
}), chain2(
|
|
1357
|
+
}), chain2(LayoutAction7.SwitchWorkspace, {
|
|
1562
1358
|
part: "workspace",
|
|
1563
1359
|
subject: client.spaces.default.id
|
|
1564
1360
|
})));
|
|
1565
1361
|
} else if (!properties.archived && archived) {
|
|
1566
|
-
void dispatch(
|
|
1362
|
+
void dispatch(createIntent9(SpaceAction.Open, {
|
|
1567
1363
|
space
|
|
1568
1364
|
}));
|
|
1569
1365
|
}
|
|
@@ -1587,14 +1383,14 @@ var SpaceSettingsContainer = ({ space }) => {
|
|
|
1587
1383
|
]);
|
|
1588
1384
|
const customElements = useMemo3(() => ({
|
|
1589
1385
|
name: ({ type, label, getValue, onValueChange }) => {
|
|
1590
|
-
const handleChange =
|
|
1386
|
+
const handleChange = useCallback10(({ target: { value } }) => onValueChange(type, value), [
|
|
1591
1387
|
onValueChange,
|
|
1592
1388
|
type
|
|
1593
1389
|
]);
|
|
1594
|
-
return /* @__PURE__ */
|
|
1390
|
+
return /* @__PURE__ */ React18.createElement(ControlItemInput2, {
|
|
1595
1391
|
title: label,
|
|
1596
1392
|
description: t("display name description")
|
|
1597
|
-
}, /* @__PURE__ */
|
|
1393
|
+
}, /* @__PURE__ */ React18.createElement(Input6.TextInput, {
|
|
1598
1394
|
value: getValue(),
|
|
1599
1395
|
onChange: handleChange,
|
|
1600
1396
|
placeholder: t("display name input placeholder"),
|
|
@@ -1602,18 +1398,18 @@ var SpaceSettingsContainer = ({ space }) => {
|
|
|
1602
1398
|
}));
|
|
1603
1399
|
},
|
|
1604
1400
|
icon: ({ type, label, getValue, onValueChange }) => {
|
|
1605
|
-
const handleChange =
|
|
1401
|
+
const handleChange = useCallback10((nextEmoji) => onValueChange(type, nextEmoji), [
|
|
1606
1402
|
onValueChange,
|
|
1607
1403
|
type
|
|
1608
1404
|
]);
|
|
1609
|
-
const handleEmojiReset =
|
|
1405
|
+
const handleEmojiReset = useCallback10(() => onValueChange(type, void 0), [
|
|
1610
1406
|
onValueChange,
|
|
1611
1407
|
type
|
|
1612
1408
|
]);
|
|
1613
|
-
return /* @__PURE__ */
|
|
1409
|
+
return /* @__PURE__ */ React18.createElement(ControlItem, {
|
|
1614
1410
|
title: label,
|
|
1615
1411
|
description: t("icon description")
|
|
1616
|
-
}, /* @__PURE__ */
|
|
1412
|
+
}, /* @__PURE__ */ React18.createElement(IconPicker, {
|
|
1617
1413
|
value: getValue(),
|
|
1618
1414
|
onChange: handleChange,
|
|
1619
1415
|
onReset: handleEmojiReset,
|
|
@@ -1622,18 +1418,18 @@ var SpaceSettingsContainer = ({ space }) => {
|
|
|
1622
1418
|
}));
|
|
1623
1419
|
},
|
|
1624
1420
|
hue: ({ type, label, getValue, onValueChange }) => {
|
|
1625
|
-
const handleChange =
|
|
1421
|
+
const handleChange = useCallback10((nextHue) => onValueChange(type, nextHue), [
|
|
1626
1422
|
onValueChange,
|
|
1627
1423
|
type
|
|
1628
1424
|
]);
|
|
1629
|
-
const handleHueReset =
|
|
1425
|
+
const handleHueReset = useCallback10(() => onValueChange(type, void 0), [
|
|
1630
1426
|
onValueChange,
|
|
1631
1427
|
type
|
|
1632
1428
|
]);
|
|
1633
|
-
return /* @__PURE__ */
|
|
1429
|
+
return /* @__PURE__ */ React18.createElement(ControlItem, {
|
|
1634
1430
|
title: label,
|
|
1635
1431
|
description: t("hue description")
|
|
1636
|
-
}, /* @__PURE__ */
|
|
1432
|
+
}, /* @__PURE__ */ React18.createElement(HuePicker, {
|
|
1637
1433
|
value: getValue(),
|
|
1638
1434
|
onChange: handleChange,
|
|
1639
1435
|
onReset: handleHueReset,
|
|
@@ -1641,29 +1437,29 @@ var SpaceSettingsContainer = ({ space }) => {
|
|
|
1641
1437
|
}));
|
|
1642
1438
|
},
|
|
1643
1439
|
edgeReplication: ({ type, label, getValue, onValueChange }) => {
|
|
1644
|
-
const handleChange =
|
|
1440
|
+
const handleChange = useCallback10((checked) => onValueChange(type, checked), [
|
|
1645
1441
|
onValueChange,
|
|
1646
1442
|
type
|
|
1647
1443
|
]);
|
|
1648
|
-
return /* @__PURE__ */
|
|
1444
|
+
return /* @__PURE__ */ React18.createElement(ControlItemInput2, {
|
|
1649
1445
|
title: label,
|
|
1650
1446
|
description: t("edge replication description")
|
|
1651
|
-
}, /* @__PURE__ */
|
|
1447
|
+
}, /* @__PURE__ */ React18.createElement(Input6.Switch, {
|
|
1652
1448
|
checked: getValue(),
|
|
1653
1449
|
onCheckedChange: handleChange,
|
|
1654
1450
|
classNames: "justify-self-end"
|
|
1655
1451
|
}));
|
|
1656
1452
|
},
|
|
1657
1453
|
archived: ({ type, label, getValue, onValueChange }) => {
|
|
1658
|
-
const handleChange =
|
|
1454
|
+
const handleChange = useCallback10(() => onValueChange(type, !getValue()), [
|
|
1659
1455
|
onValueChange,
|
|
1660
1456
|
type,
|
|
1661
1457
|
getValue
|
|
1662
1458
|
]);
|
|
1663
|
-
return /* @__PURE__ */
|
|
1459
|
+
return /* @__PURE__ */ React18.createElement(ControlItemInput2, {
|
|
1664
1460
|
title: label,
|
|
1665
1461
|
description: t("archive space description")
|
|
1666
|
-
}, /* @__PURE__ */
|
|
1462
|
+
}, /* @__PURE__ */ React18.createElement(Button8, {
|
|
1667
1463
|
disabled: space === client.spaces.default,
|
|
1668
1464
|
onClick: handleChange
|
|
1669
1465
|
}, getValue() ? t("unarchive space label") : t("archive space label")));
|
|
@@ -1672,16 +1468,16 @@ var SpaceSettingsContainer = ({ space }) => {
|
|
|
1672
1468
|
t,
|
|
1673
1469
|
space
|
|
1674
1470
|
]);
|
|
1675
|
-
return /* @__PURE__ */
|
|
1471
|
+
return /* @__PURE__ */ React18.createElement(StackItem4.Content, {
|
|
1676
1472
|
classNames: "block overflow-y-auto pli-2"
|
|
1677
|
-
}, /* @__PURE__ */
|
|
1473
|
+
}, /* @__PURE__ */ React18.createElement(ControlPage3, null, /* @__PURE__ */ React18.createElement(ControlSection3, {
|
|
1678
1474
|
title: t("space properties settings verbose label", {
|
|
1679
1475
|
ns: SPACE_PLUGIN
|
|
1680
1476
|
}),
|
|
1681
1477
|
description: t("space properties settings description", {
|
|
1682
1478
|
ns: SPACE_PLUGIN
|
|
1683
1479
|
})
|
|
1684
|
-
}, /* @__PURE__ */
|
|
1480
|
+
}, /* @__PURE__ */ React18.createElement(Form3, {
|
|
1685
1481
|
schema: FormSchema,
|
|
1686
1482
|
values,
|
|
1687
1483
|
autoSave: true,
|
|
@@ -1692,18 +1488,19 @@ var SpaceSettingsContainer = ({ space }) => {
|
|
|
1692
1488
|
};
|
|
1693
1489
|
|
|
1694
1490
|
// packages/plugins/plugin-space/src/components/SyncStatus/InlineSyncStatus.tsx
|
|
1695
|
-
import
|
|
1491
|
+
import { Option as Option2 } from "effect";
|
|
1492
|
+
import React19, { useEffect as useEffect5, useState as useState10 } from "react";
|
|
1696
1493
|
import { useAppGraph as useAppGraph3 } from "@dxos/app-framework";
|
|
1697
1494
|
import { EdgeStatus } from "@dxos/protocols/proto/dxos/client/services";
|
|
1698
1495
|
import { EdgeReplicationSetting as EdgeReplicationSetting2 } from "@dxos/protocols/proto/dxos/echo/metadata";
|
|
1699
1496
|
import { useClient as useClient8 } from "@dxos/react-client";
|
|
1700
1497
|
import { useSpaceSyncState } from "@dxos/react-client/echo";
|
|
1701
|
-
import { Tooltip as Tooltip3, useTranslation as
|
|
1498
|
+
import { Tooltip as Tooltip3, useTranslation as useTranslation18 } from "@dxos/react-ui";
|
|
1702
1499
|
import { AttentionGlyph as AttentionGlyph2, useAttended as useAttended2, useAttention as useAttention2 } from "@dxos/react-ui-attention";
|
|
1703
1500
|
var useEdgeStatus = () => {
|
|
1704
|
-
const [status, setStatus] =
|
|
1501
|
+
const [status, setStatus] = useState10(EdgeStatus.NOT_CONNECTED);
|
|
1705
1502
|
const client = useClient8();
|
|
1706
|
-
|
|
1503
|
+
useEffect5(() => {
|
|
1707
1504
|
client.services.services.EdgeAgentService?.queryEdgeStatus().subscribe(({ status: status2 }) => {
|
|
1708
1505
|
setStatus(status2);
|
|
1709
1506
|
});
|
|
@@ -1713,7 +1510,7 @@ var useEdgeStatus = () => {
|
|
|
1713
1510
|
return status;
|
|
1714
1511
|
};
|
|
1715
1512
|
var InlineSyncStatus = ({ space, open }) => {
|
|
1716
|
-
const { t } =
|
|
1513
|
+
const { t } = useTranslation18(SPACE_PLUGIN);
|
|
1717
1514
|
const id = space.id;
|
|
1718
1515
|
const { hasAttention, isAncestor, isRelated } = useAttention2(id);
|
|
1719
1516
|
const isAttended = hasAttention || isAncestor || isRelated;
|
|
@@ -1721,30 +1518,29 @@ var InlineSyncStatus = ({ space, open }) => {
|
|
|
1721
1518
|
const attended = useAttended2();
|
|
1722
1519
|
const startOfAttention = attended.at(-1);
|
|
1723
1520
|
const path = usePath(graph, startOfAttention);
|
|
1724
|
-
const containsAttended = !open && !isAttended && id && path ? path.includes(id) : false;
|
|
1521
|
+
const containsAttended = !open && !isAttended && id && Option2.isSome(path) ? path.value.includes(id) : false;
|
|
1725
1522
|
const connectedToEdge = useEdgeStatus() === EdgeStatus.CONNECTED;
|
|
1726
1523
|
const edgeSyncEnabled = space.internal.data.edgeReplication === EdgeReplicationSetting2.ENABLED;
|
|
1727
1524
|
const syncState = useSpaceSyncState(space);
|
|
1728
1525
|
const syncing = connectedToEdge && edgeSyncEnabled && syncState && syncState.missingOnLocal > 0;
|
|
1729
|
-
return /* @__PURE__ */
|
|
1730
|
-
asChild: true
|
|
1731
|
-
|
|
1526
|
+
return /* @__PURE__ */ React19.createElement(Tooltip3.Trigger, {
|
|
1527
|
+
asChild: true,
|
|
1528
|
+
content: t("syncing label"),
|
|
1529
|
+
side: "bottom"
|
|
1530
|
+
}, /* @__PURE__ */ React19.createElement(AttentionGlyph2, {
|
|
1732
1531
|
syncing,
|
|
1733
1532
|
attended: isAttended,
|
|
1734
1533
|
containsAttended,
|
|
1735
1534
|
classNames: "self-center mie-1"
|
|
1736
|
-
}))
|
|
1737
|
-
side: "bottom",
|
|
1738
|
-
classNames: "z-[70]"
|
|
1739
|
-
}, /* @__PURE__ */ React24.createElement("span", null, t("syncing label")), /* @__PURE__ */ React24.createElement(Tooltip3.Arrow, null))));
|
|
1535
|
+
}));
|
|
1740
1536
|
};
|
|
1741
1537
|
|
|
1742
1538
|
// packages/plugins/plugin-space/src/components/SyncStatus/SyncStatus.tsx
|
|
1743
|
-
import
|
|
1539
|
+
import React20, { useEffect as useEffect6, useState as useState11 } from "react";
|
|
1744
1540
|
import { StatusBar } from "@dxos/plugin-status-bar";
|
|
1745
1541
|
import { useClient as useClient9 } from "@dxos/react-client";
|
|
1746
1542
|
import { getSyncSummary, useSyncState } from "@dxos/react-client/echo";
|
|
1747
|
-
import { Icon as Icon5, useTranslation as
|
|
1543
|
+
import { Icon as Icon5, useTranslation as useTranslation19 } from "@dxos/react-ui";
|
|
1748
1544
|
|
|
1749
1545
|
// packages/plugins/plugin-space/src/components/SyncStatus/save-tracker.ts
|
|
1750
1546
|
import { Context } from "@dxos/context";
|
|
@@ -1842,19 +1638,19 @@ var SYNC_STALLED_TIMEOUT = 5e3;
|
|
|
1842
1638
|
var SyncStatus = () => {
|
|
1843
1639
|
const client = useClient9();
|
|
1844
1640
|
const state = useSyncState();
|
|
1845
|
-
const [saved, setSaved] =
|
|
1846
|
-
|
|
1641
|
+
const [saved, setSaved] = useState11(true);
|
|
1642
|
+
useEffect6(() => {
|
|
1847
1643
|
return createClientSaveTracker(client, (state2) => {
|
|
1848
1644
|
setSaved(state2 === "saved");
|
|
1849
1645
|
});
|
|
1850
1646
|
}, []);
|
|
1851
|
-
return /* @__PURE__ */
|
|
1647
|
+
return /* @__PURE__ */ React20.createElement(SyncStatusIndicator, {
|
|
1852
1648
|
state,
|
|
1853
1649
|
saved
|
|
1854
1650
|
});
|
|
1855
1651
|
};
|
|
1856
1652
|
var SyncStatusIndicator = ({ state, saved }) => {
|
|
1857
|
-
const { t } =
|
|
1653
|
+
const { t } = useTranslation19(SPACE_PLUGIN);
|
|
1858
1654
|
const summary = getSyncSummary(state);
|
|
1859
1655
|
const offline = Object.values(state).length === 0;
|
|
1860
1656
|
const needsToUpload = summary.differentDocuments > 0 || summary.missingOnRemote > 0;
|
|
@@ -1865,8 +1661,8 @@ var SyncStatusIndicator = ({ state, saved }) => {
|
|
|
1865
1661
|
needsToUpload,
|
|
1866
1662
|
needsToDownload
|
|
1867
1663
|
});
|
|
1868
|
-
const [classNames, setClassNames] =
|
|
1869
|
-
|
|
1664
|
+
const [classNames, setClassNames] = useState11();
|
|
1665
|
+
useEffect6(() => {
|
|
1870
1666
|
setClassNames(void 0);
|
|
1871
1667
|
if (offline || !needsToUpload && !needsToDownload) {
|
|
1872
1668
|
return;
|
|
@@ -1881,12 +1677,12 @@ var SyncStatusIndicator = ({ state, saved }) => {
|
|
|
1881
1677
|
needsToDownload
|
|
1882
1678
|
]);
|
|
1883
1679
|
const title = t(`${status} label`);
|
|
1884
|
-
const icon = /* @__PURE__ */
|
|
1680
|
+
const icon = /* @__PURE__ */ React20.createElement(Icon5, {
|
|
1885
1681
|
icon: getIcon(status),
|
|
1886
1682
|
size: 4,
|
|
1887
1683
|
classNames
|
|
1888
1684
|
});
|
|
1889
|
-
return /* @__PURE__ */
|
|
1685
|
+
return /* @__PURE__ */ React20.createElement(StatusBar.Item, {
|
|
1890
1686
|
title
|
|
1891
1687
|
}, icon);
|
|
1892
1688
|
};
|
|
@@ -1905,16 +1701,12 @@ export {
|
|
|
1905
1701
|
MenuFooter,
|
|
1906
1702
|
ObjectSettingsContainer,
|
|
1907
1703
|
PersistenceStatus,
|
|
1908
|
-
POPOVER_ADD_SPACE,
|
|
1909
|
-
PopoverAddSpace,
|
|
1910
1704
|
POPOVER_RENAME_OBJECT,
|
|
1911
1705
|
PopoverRenameObject,
|
|
1912
1706
|
POPOVER_RENAME_SPACE,
|
|
1913
1707
|
PopoverRenameSpace,
|
|
1914
1708
|
useQuerySpaceSchemas,
|
|
1915
1709
|
SchemaContainer,
|
|
1916
|
-
ShareSpaceButton,
|
|
1917
|
-
ShareSpaceButtonImpl,
|
|
1918
1710
|
SpacePresence,
|
|
1919
1711
|
FullPresence,
|
|
1920
1712
|
SmallPresenceLive,
|
|
@@ -1930,10 +1722,10 @@ export {
|
|
|
1930
1722
|
IntentResolver,
|
|
1931
1723
|
ReactRoot,
|
|
1932
1724
|
ReactSurface,
|
|
1933
|
-
|
|
1934
|
-
|
|
1725
|
+
SchemaDefs,
|
|
1726
|
+
SchemaTools,
|
|
1935
1727
|
SpaceSettings,
|
|
1936
1728
|
SpaceState,
|
|
1937
1729
|
SpacesReady
|
|
1938
1730
|
};
|
|
1939
|
-
//# sourceMappingURL=chunk-
|
|
1731
|
+
//# sourceMappingURL=chunk-43UQWMD3.mjs.map
|