@dxos/plugin-space 0.8.2-main.f11618f → 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-UUJH7JRN.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-4226DMDP.mjs → chunk-43UQWMD3.mjs} +298 -504
- 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-JS6ZV4GV.mjs → chunk-IQFFOAWD.mjs} +24 -38
- package/dist/lib/browser/chunk-IQFFOAWD.mjs.map +7 -0
- package/dist/lib/browser/{chunk-DIJ7LMCS.mjs → chunk-UBSVH2NQ.mjs} +3 -4
- package/dist/lib/browser/chunk-UBSVH2NQ.mjs.map +7 -0
- package/dist/lib/browser/{identity-created-NRVE4XLL.mjs → identity-created-ANRJHNMQ.mjs} +3 -3
- package/dist/lib/browser/identity-created-ANRJHNMQ.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +23 -19
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-resolver-NP55M7C7.mjs → intent-resolver-KRINV5QI.mjs} +15 -33
- 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-XKAUZ3X2.mjs → react-root-J3SP2HVW.mjs} +5 -4
- package/dist/lib/browser/{react-surface-2DW2UDRX.mjs → react-surface-J7T2IMH4.mjs} +5 -12
- 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-MVT32NP6.mjs → settings-G24447B7.mjs} +2 -2
- package/dist/lib/browser/{spaces-ready-ERNSICUW.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-M6Z2OPA4.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-UOCR4G2D.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-ZMQO74LX.cjs → chunk-MXBE2VET.cjs} +338 -535
- package/dist/lib/node/chunk-MXBE2VET.cjs.map +7 -0
- package/dist/lib/node/{chunk-XADZLQAJ.cjs → chunk-SCATWJKX.cjs} +46 -61
- package/dist/lib/node/chunk-SCATWJKX.cjs.map +7 -0
- package/dist/lib/node/{identity-created-YDTRMOMX.cjs → identity-created-NIPYGVG3.cjs} +7 -7
- package/dist/lib/node/identity-created-NIPYGVG3.cjs.map +7 -0
- package/dist/lib/node/index.cjs +73 -70
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/{intent-resolver-3J52ARFL.cjs → intent-resolver-MJVRY6YE.cjs} +63 -80
- 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-XUE2J7HT.cjs → react-root-M4BZ6VXB.cjs} +9 -8
- package/dist/lib/node/{react-root-XUE2J7HT.cjs.map → react-root-M4BZ6VXB.cjs.map} +1 -1
- package/dist/lib/node/{react-surface-IWSTOZ2E.cjs → react-surface-RYKSYYKM.cjs} +42 -47
- 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-JLV7YT6Q.cjs → settings-AFWO4AWK.cjs} +6 -6
- package/dist/lib/node/{spaces-ready-6EBR4SM4.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-J3B4WSXU.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-OLISVDCF.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-PQI4D4SH.mjs → chunk-FI3WV22Y.mjs} +298 -504
- 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-ABTVMAG5.mjs → chunk-S2W6HS4A.mjs} +24 -38
- package/dist/lib/node-esm/chunk-S2W6HS4A.mjs.map +7 -0
- package/dist/lib/node-esm/{identity-created-EC6SVYB5.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 +23 -19
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/{intent-resolver-MXQIFIRC.mjs → intent-resolver-JT6EB47M.mjs} +15 -33
- 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-ZBCJCEFS.mjs → react-root-S2LW4FS7.mjs} +5 -4
- package/dist/lib/{browser/react-root-XKAUZ3X2.mjs.map → node-esm/react-root-S2LW4FS7.mjs.map} +1 -1
- package/dist/lib/node-esm/{react-surface-JCHDAPGM.mjs → react-surface-ZNNMO7QQ.mjs} +5 -12
- 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-AILIMHTE.mjs → settings-MJVSCOI4.mjs} +2 -2
- package/dist/lib/node-esm/{spaces-ready-5PXESKHX.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 +8 -184
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +2 -2
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/schema-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 -1
- 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 +113 -242
- package/dist/types/src/types/thread.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +145 -160
- 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 +8 -7
- 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 +9 -28
- package/src/capabilities/react-surface.tsx +15 -23
- 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/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/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/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 -1
- 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 +104 -112
- package/src/util.tsx +36 -73
- package/dist/lib/browser/app-graph-builder-ZWNOWRAX.mjs +0 -369
- package/dist/lib/browser/app-graph-builder-ZWNOWRAX.mjs.map +0 -7
- package/dist/lib/browser/app-graph-serializer-UUJH7JRN.mjs.map +0 -7
- package/dist/lib/browser/chunk-4226DMDP.mjs.map +0 -7
- package/dist/lib/browser/chunk-DIJ7LMCS.mjs.map +0 -7
- package/dist/lib/browser/chunk-JS6ZV4GV.mjs.map +0 -7
- package/dist/lib/browser/chunk-O7WGQVLQ.mjs +0 -306
- package/dist/lib/browser/chunk-O7WGQVLQ.mjs.map +0 -7
- package/dist/lib/browser/identity-created-NRVE4XLL.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-NP55M7C7.mjs.map +0 -7
- package/dist/lib/browser/react-surface-2DW2UDRX.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-ERNSICUW.mjs.map +0 -7
- package/dist/lib/browser/state-CYV6QCTN.mjs.map +0 -7
- package/dist/lib/node/app-graph-builder-LLIV422L.cjs +0 -371
- package/dist/lib/node/app-graph-builder-LLIV422L.cjs.map +0 -7
- package/dist/lib/node/app-graph-serializer-M6Z2OPA4.cjs.map +0 -7
- package/dist/lib/node/chunk-EQ5BPSQ7.cjs +0 -334
- package/dist/lib/node/chunk-EQ5BPSQ7.cjs.map +0 -7
- package/dist/lib/node/chunk-UOCR4G2D.cjs.map +0 -7
- package/dist/lib/node/chunk-XADZLQAJ.cjs.map +0 -7
- package/dist/lib/node/chunk-ZMQO74LX.cjs.map +0 -7
- package/dist/lib/node/identity-created-YDTRMOMX.cjs.map +0 -7
- package/dist/lib/node/intent-resolver-3J52ARFL.cjs.map +0 -7
- package/dist/lib/node/react-surface-IWSTOZ2E.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-6EBR4SM4.cjs.map +0 -7
- package/dist/lib/node/state-JLN7TGRR.cjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-HSGLCS76.mjs +0 -370
- package/dist/lib/node-esm/app-graph-builder-HSGLCS76.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-serializer-J3B4WSXU.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-ABTVMAG5.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-FJPCLEKN.mjs +0 -307
- package/dist/lib/node-esm/chunk-FJPCLEKN.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-OLISVDCF.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-PQI4D4SH.mjs.map +0 -7
- package/dist/lib/node-esm/identity-created-EC6SVYB5.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-MXQIFIRC.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-JCHDAPGM.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-5PXESKHX.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/src/capabilities/schema.ts +0 -27
- package/src/components/PopoverAddSpace.tsx +0 -52
- /package/dist/lib/{node-esm/react-root-ZBCJCEFS.mjs.map → browser/react-root-J3SP2HVW.mjs.map} +0 -0
- /package/dist/lib/browser/{settings-MVT32NP6.mjs.map → settings-G24447B7.mjs.map} +0 -0
- /package/dist/lib/node/{settings-JLV7YT6Q.cjs.map → settings-AFWO4AWK.cjs.map} +0 -0
- /package/dist/lib/node-esm/{settings-AILIMHTE.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
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
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,7 +575,7 @@ 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";
|
|
642
580
|
import { createIntent as createIntent5, useIntentDispatcher as useIntentDispatcher5 } from "@dxos/app-framework";
|
|
643
581
|
import { log } from "@dxos/log";
|
|
@@ -675,14 +613,14 @@ var MembersContainer = ({ space, createInvitationUrl }) => {
|
|
|
675
613
|
const visibleInvitations = invitations?.filter((invitation) => ![
|
|
676
614
|
Invitation.State.CANCELLED
|
|
677
615
|
].includes(invitation.get().state));
|
|
678
|
-
const [activeAction, setInternalActiveAction] =
|
|
616
|
+
const [activeAction, setInternalActiveAction] = useState3(localStorage.getItem(activeActionKey) ?? "inviteMany");
|
|
679
617
|
const setActiveAction = (nextAction) => {
|
|
680
618
|
setInternalActiveAction(nextAction);
|
|
681
619
|
localStorage.setItem(activeActionKey, nextAction);
|
|
682
620
|
};
|
|
683
621
|
const target = space.properties[CollectionType.typename]?.target?.objects[0]?.target;
|
|
684
622
|
const locked = space.properties[COMPOSER_SPACE_LOCK];
|
|
685
|
-
const handleChangeLocked =
|
|
623
|
+
const handleChangeLocked = useCallback6(() => {
|
|
686
624
|
space.properties[COMPOSER_SPACE_LOCK] = !locked;
|
|
687
625
|
}, [
|
|
688
626
|
locked,
|
|
@@ -696,7 +634,7 @@ var MembersContainer = ({ space, createInvitationUrl }) => {
|
|
|
696
634
|
description: t("invite one description", {
|
|
697
635
|
ns: "os"
|
|
698
636
|
}),
|
|
699
|
-
icon: () => /* @__PURE__ */
|
|
637
|
+
icon: () => /* @__PURE__ */ React8.createElement(Icon4, {
|
|
700
638
|
icon: "ph--user-plus--regular",
|
|
701
639
|
size: 5
|
|
702
640
|
}),
|
|
@@ -721,7 +659,7 @@ var MembersContainer = ({ space, createInvitationUrl }) => {
|
|
|
721
659
|
description: t("invite many description", {
|
|
722
660
|
ns: "os"
|
|
723
661
|
}),
|
|
724
|
-
icon: () => /* @__PURE__ */
|
|
662
|
+
icon: () => /* @__PURE__ */ React8.createElement(Icon4, {
|
|
725
663
|
icon: "ph--users-three--regular",
|
|
726
664
|
size: 5
|
|
727
665
|
}),
|
|
@@ -744,51 +682,51 @@ var MembersContainer = ({ space, createInvitationUrl }) => {
|
|
|
744
682
|
space,
|
|
745
683
|
target
|
|
746
684
|
]);
|
|
747
|
-
const [selectedInvitation, setSelectedInvitation] =
|
|
685
|
+
const [selectedInvitation, setSelectedInvitation] = useState3(null);
|
|
748
686
|
const handleSend = (event) => {
|
|
749
687
|
setSelectedInvitation(event.invitation);
|
|
750
688
|
};
|
|
751
689
|
const handleBack = () => {
|
|
752
690
|
setSelectedInvitation(null);
|
|
753
691
|
};
|
|
754
|
-
return /* @__PURE__ */
|
|
692
|
+
return /* @__PURE__ */ React8.createElement(Clipboard.Provider, null, /* @__PURE__ */ React8.createElement(StackItem.Content, {
|
|
755
693
|
classNames: "block overflow-y-auto"
|
|
756
|
-
}, /* @__PURE__ */
|
|
694
|
+
}, /* @__PURE__ */ React8.createElement(ControlPage, null, /* @__PURE__ */ React8.createElement(ControlSection, {
|
|
757
695
|
title: t("members verbose label"),
|
|
758
696
|
description: t("members description")
|
|
759
|
-
}, /* @__PURE__ */
|
|
697
|
+
}, /* @__PURE__ */ React8.createElement(ControlFrame, null, /* @__PURE__ */ React8.createElement(ControlFrameItem, {
|
|
760
698
|
title: t("members label")
|
|
761
|
-
}, /* @__PURE__ */
|
|
699
|
+
}, /* @__PURE__ */ React8.createElement(SpaceMemberList, {
|
|
762
700
|
spaceKey: space.key,
|
|
763
701
|
includeSelf: true
|
|
764
|
-
})), locked && /* @__PURE__ */
|
|
702
|
+
})), locked && /* @__PURE__ */ React8.createElement(ControlFrameItem, {
|
|
765
703
|
title: t("invitations label")
|
|
766
|
-
}, /* @__PURE__ */
|
|
704
|
+
}, /* @__PURE__ */ React8.createElement("p", {
|
|
767
705
|
className: "text-description mbe-2"
|
|
768
|
-
}, t("locked space description"))), !locked && /* @__PURE__ */
|
|
706
|
+
}, t("locked space description"))), !locked && /* @__PURE__ */ React8.createElement(ControlFrameItem, {
|
|
769
707
|
title: t("invitations label")
|
|
770
|
-
}, selectedInvitation && /* @__PURE__ */
|
|
708
|
+
}, selectedInvitation && /* @__PURE__ */ React8.createElement(InvitationSection, {
|
|
771
709
|
...selectedInvitation,
|
|
772
710
|
onBack: handleBack
|
|
773
|
-
}), !selectedInvitation && /* @__PURE__ */
|
|
711
|
+
}), !selectedInvitation && /* @__PURE__ */ React8.createElement(React8.Fragment, null, /* @__PURE__ */ React8.createElement("p", {
|
|
774
712
|
className: "text-description mbe-2"
|
|
775
|
-
}, t("space invitation description")), /* @__PURE__ */
|
|
713
|
+
}, t("space invitation description")), /* @__PURE__ */ React8.createElement(InvitationList, {
|
|
776
714
|
className: "mb-2",
|
|
777
715
|
send: handleSend,
|
|
778
716
|
invitations: visibleInvitations ?? [],
|
|
779
717
|
onClickRemove: (invitation) => invitation.cancel(),
|
|
780
718
|
createInvitationUrl
|
|
781
|
-
}), /* @__PURE__ */
|
|
719
|
+
}), /* @__PURE__ */ React8.createElement(BifurcatedAction, {
|
|
782
720
|
actions: inviteActions,
|
|
783
721
|
activeAction,
|
|
784
722
|
onChangeActiveAction: setActiveAction,
|
|
785
723
|
"data-testid": "membersContainer.createInvitation"
|
|
786
|
-
})))), /* @__PURE__ */
|
|
724
|
+
})))), /* @__PURE__ */ React8.createElement("div", {
|
|
787
725
|
className: "justify-center gap-4 p-0 mbs-4 container-max-width grid grid-cols-1 md:grid-cols-[1fr_min-content]"
|
|
788
|
-
}, /* @__PURE__ */
|
|
726
|
+
}, /* @__PURE__ */ React8.createElement(ControlItemInput, {
|
|
789
727
|
title: t("space locked label"),
|
|
790
728
|
description: t("space locked description")
|
|
791
|
-
}, /* @__PURE__ */
|
|
729
|
+
}, /* @__PURE__ */ React8.createElement(Input.Switch, {
|
|
792
730
|
checked: locked,
|
|
793
731
|
onCheckedChange: handleChangeLocked,
|
|
794
732
|
classNames: "justify-self-end"
|
|
@@ -796,23 +734,23 @@ var MembersContainer = ({ space, createInvitationUrl }) => {
|
|
|
796
734
|
};
|
|
797
735
|
var InvitationSection = ({ state = Invitation.State.INIT, authCode, invitationId = "never", url = "never", onBack }) => {
|
|
798
736
|
const activeView = state < 0 ? "init" : state >= Invitation.State.CANCELLED ? "complete" : state >= Invitation.State.READY_FOR_AUTHENTICATION && authCode ? "auth-code" : "qr-code";
|
|
799
|
-
return /* @__PURE__ */
|
|
737
|
+
return /* @__PURE__ */ React8.createElement(Viewport.Root, {
|
|
800
738
|
activeView
|
|
801
|
-
}, /* @__PURE__ */
|
|
739
|
+
}, /* @__PURE__ */ React8.createElement(Viewport.Views, null, /* @__PURE__ */ React8.createElement(Viewport.View, {
|
|
802
740
|
id: "init"
|
|
803
|
-
}), /* @__PURE__ */
|
|
741
|
+
}), /* @__PURE__ */ React8.createElement(Viewport.View, {
|
|
804
742
|
id: "complete"
|
|
805
|
-
}, /* @__PURE__ */
|
|
743
|
+
}, /* @__PURE__ */ React8.createElement(InvitationComplete, {
|
|
806
744
|
statusValue: state
|
|
807
|
-
})), /* @__PURE__ */
|
|
745
|
+
})), /* @__PURE__ */ React8.createElement(Viewport.View, {
|
|
808
746
|
id: "auth-code"
|
|
809
|
-
}, /* @__PURE__ */
|
|
747
|
+
}, /* @__PURE__ */ React8.createElement(InvitationAuthCode, {
|
|
810
748
|
id: invitationId,
|
|
811
749
|
code: authCode ?? "never",
|
|
812
750
|
onCancel: onBack
|
|
813
|
-
})), /* @__PURE__ */
|
|
751
|
+
})), /* @__PURE__ */ React8.createElement(Viewport.View, {
|
|
814
752
|
id: "qr-code"
|
|
815
|
-
}, /* @__PURE__ */
|
|
753
|
+
}, /* @__PURE__ */ React8.createElement(InvitationQR, {
|
|
816
754
|
id: invitationId,
|
|
817
755
|
url,
|
|
818
756
|
onCancel: onBack
|
|
@@ -822,31 +760,31 @@ var InvitationQR = ({ id, url, onCancel }) => {
|
|
|
822
760
|
const { t } = useTranslation8("os");
|
|
823
761
|
const qrLabel = useId("members-container__qr-code");
|
|
824
762
|
const emoji = hexToEmoji(id);
|
|
825
|
-
return /* @__PURE__ */
|
|
763
|
+
return /* @__PURE__ */ React8.createElement(React8.Fragment, null, /* @__PURE__ */ React8.createElement("p", {
|
|
826
764
|
className: "text-description"
|
|
827
765
|
}, t("qr code description", {
|
|
828
766
|
ns: SPACE_PLUGIN
|
|
829
|
-
})), /* @__PURE__ */
|
|
767
|
+
})), /* @__PURE__ */ React8.createElement("div", {
|
|
830
768
|
role: "group",
|
|
831
769
|
className: "grid grid-cols-[1fr_min-content] mlb-2 gap-2"
|
|
832
|
-
}, /* @__PURE__ */
|
|
770
|
+
}, /* @__PURE__ */ React8.createElement("div", {
|
|
833
771
|
role: "none",
|
|
834
772
|
className: "is-full aspect-square relative text-description"
|
|
835
|
-
}, /* @__PURE__ */
|
|
773
|
+
}, /* @__PURE__ */ React8.createElement(QR, {
|
|
836
774
|
rounding: 100,
|
|
837
775
|
backgroundColor: "transparent",
|
|
838
776
|
color: "currentColor",
|
|
839
777
|
"aria-labelledby": qrLabel,
|
|
840
778
|
errorCorrectionLevel: "Q",
|
|
841
779
|
cutout: true
|
|
842
|
-
}, url ?? "never"), /* @__PURE__ */
|
|
780
|
+
}, url ?? "never"), /* @__PURE__ */ React8.createElement(Centered, null, /* @__PURE__ */ React8.createElement(Emoji, {
|
|
843
781
|
text: emoji
|
|
844
|
-
}))), /* @__PURE__ */
|
|
782
|
+
}))), /* @__PURE__ */ React8.createElement("span", {
|
|
845
783
|
id: qrLabel,
|
|
846
784
|
className: "sr-only"
|
|
847
|
-
}, t("qr label")), /* @__PURE__ */
|
|
785
|
+
}, t("qr label")), /* @__PURE__ */ React8.createElement(Clipboard.Button, {
|
|
848
786
|
value: url ?? "never"
|
|
849
|
-
})), /* @__PURE__ */
|
|
787
|
+
})), /* @__PURE__ */ React8.createElement(Button4, {
|
|
850
788
|
variant: "ghost",
|
|
851
789
|
onClick: onCancel
|
|
852
790
|
}, t("cancel label")));
|
|
@@ -854,33 +792,33 @@ var InvitationQR = ({ id, url, onCancel }) => {
|
|
|
854
792
|
var InvitationAuthCode = ({ id, code, onCancel }) => {
|
|
855
793
|
const { t } = useTranslation8("os");
|
|
856
794
|
const emoji = hexToEmoji(id);
|
|
857
|
-
return /* @__PURE__ */
|
|
795
|
+
return /* @__PURE__ */ React8.createElement(React8.Fragment, null, /* @__PURE__ */ React8.createElement("p", {
|
|
858
796
|
className: "text-description"
|
|
859
|
-
}, t("auth other device emoji message")), emoji && /* @__PURE__ */
|
|
797
|
+
}, t("auth other device emoji message")), emoji && /* @__PURE__ */ React8.createElement(Emoji, {
|
|
860
798
|
text: emoji,
|
|
861
799
|
className: "mli-auto mlb-2 text-center"
|
|
862
|
-
}), /* @__PURE__ */
|
|
800
|
+
}), /* @__PURE__ */ React8.createElement("p", {
|
|
863
801
|
className: "text-description"
|
|
864
|
-
}, t("auth code message")), /* @__PURE__ */
|
|
802
|
+
}, t("auth code message")), /* @__PURE__ */ React8.createElement(AuthCode, {
|
|
865
803
|
code,
|
|
866
804
|
large: true,
|
|
867
805
|
classNames: "mli-auto mlb-2 text-center grow"
|
|
868
|
-
}), /* @__PURE__ */
|
|
806
|
+
}), /* @__PURE__ */ React8.createElement(Button4, {
|
|
869
807
|
variant: "ghost",
|
|
870
808
|
onClick: onCancel
|
|
871
809
|
}, t("cancel label")));
|
|
872
810
|
};
|
|
873
811
|
var InvitationComplete = ({ statusValue }) => {
|
|
874
|
-
return statusValue > 0 ? /* @__PURE__ */
|
|
812
|
+
return statusValue > 0 ? /* @__PURE__ */ React8.createElement(Check, {
|
|
875
813
|
className: mx4("m-1.5", getSize2(6))
|
|
876
|
-
}) : /* @__PURE__ */
|
|
814
|
+
}) : /* @__PURE__ */ React8.createElement(X, {
|
|
877
815
|
className: mx4("m-1.5", getSize2(6))
|
|
878
816
|
});
|
|
879
817
|
};
|
|
880
818
|
|
|
881
819
|
// packages/plugins/plugin-space/src/components/MenuFooter.tsx
|
|
882
820
|
import { Planet } from "@phosphor-icons/react";
|
|
883
|
-
import
|
|
821
|
+
import React9 from "react";
|
|
884
822
|
import { getSpace as getSpace2 } from "@dxos/client/echo";
|
|
885
823
|
import { useClient as useClient4 } from "@dxos/react-client";
|
|
886
824
|
import { DropdownMenu, toLocalizedString as toLocalizedString2, useTranslation as useTranslation9 } from "@dxos/react-ui";
|
|
@@ -891,127 +829,33 @@ var MenuFooter = ({ object }) => {
|
|
|
891
829
|
const spaceName = space ? getSpaceDisplayName(space, {
|
|
892
830
|
personal: client.spaces.default === space
|
|
893
831
|
}) : "";
|
|
894
|
-
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", {
|
|
895
833
|
className: "pis-2 mbe-2 text-xs grid grid-cols-[max-content_1fr] gap-2"
|
|
896
|
-
}, /* @__PURE__ */
|
|
834
|
+
}, /* @__PURE__ */ React9.createElement("dt", {
|
|
897
835
|
className: "uppercase text-[.75em] tracking-wide font-medium mbs-px self-start"
|
|
898
|
-
}, t("location label")), /* @__PURE__ */
|
|
836
|
+
}, t("location label")), /* @__PURE__ */ React9.createElement("dd", {
|
|
899
837
|
className: "line-clamp-3"
|
|
900
|
-
}, /* @__PURE__ */
|
|
838
|
+
}, /* @__PURE__ */ React9.createElement(Planet, {
|
|
901
839
|
className: "inline-block mie-1"
|
|
902
840
|
}), toLocalizedString2(spaceName, t)))) : null;
|
|
903
841
|
};
|
|
904
842
|
|
|
905
843
|
// packages/plugins/plugin-space/src/components/ObjectSettings/ObjectSettingsContainer.tsx
|
|
906
|
-
import
|
|
907
|
-
import { Surface
|
|
844
|
+
import React11, { useMemo as useMemo2 } from "react";
|
|
845
|
+
import { Surface } from "@dxos/app-framework";
|
|
908
846
|
import { Clipboard as Clipboard2 } from "@dxos/react-ui";
|
|
909
847
|
import { StackItem as StackItem2 } from "@dxos/react-ui-stack";
|
|
910
848
|
|
|
911
|
-
// packages/plugins/plugin-space/src/components/ObjectSettings/AdvancedObjectSettings.tsx
|
|
912
|
-
import React12, { useCallback as useCallback9, useState as useState5 } from "react";
|
|
913
|
-
import { ForeignKeySchema } from "@dxos/echo-schema";
|
|
914
|
-
import { getMeta } from "@dxos/react-client/echo";
|
|
915
|
-
import { IconButton as IconButton2, useTranslation as useTranslation11 } from "@dxos/react-ui";
|
|
916
|
-
import { Form as Form3 } from "@dxos/react-ui-form";
|
|
917
|
-
|
|
918
|
-
// packages/plugins/plugin-space/src/components/ObjectSettings/ForeignKeys.tsx
|
|
919
|
-
import React11, { useCallback as useCallback8 } from "react";
|
|
920
|
-
import { IconButton, List, ListItem, useTranslation as useTranslation10 } from "@dxos/react-ui";
|
|
921
|
-
var ForeignKeys = ({ keys, onDelete }) => {
|
|
922
|
-
return /* @__PURE__ */ React11.createElement(List, {
|
|
923
|
-
classNames: "flex flex-col gap-2"
|
|
924
|
-
}, keys.map((key) => /* @__PURE__ */ React11.createElement(KeyItem, {
|
|
925
|
-
key: key.id,
|
|
926
|
-
forignKey: key,
|
|
927
|
-
onDelete
|
|
928
|
-
})));
|
|
929
|
-
};
|
|
930
|
-
var KeyItem = ({ forignKey, onDelete }) => {
|
|
931
|
-
const { t } = useTranslation10(SPACE_PLUGIN);
|
|
932
|
-
const handleDelete = useCallback8(() => {
|
|
933
|
-
onDelete?.(forignKey);
|
|
934
|
-
}, [
|
|
935
|
-
forignKey,
|
|
936
|
-
onDelete
|
|
937
|
-
]);
|
|
938
|
-
return /* @__PURE__ */ React11.createElement(ListItem.Root, {
|
|
939
|
-
classNames: "px-2"
|
|
940
|
-
}, /* @__PURE__ */ React11.createElement(ListItem.Heading, {
|
|
941
|
-
classNames: "flex flex-col grow truncate"
|
|
942
|
-
}, /* @__PURE__ */ React11.createElement("div", null, forignKey.source), /* @__PURE__ */ React11.createElement("div", {
|
|
943
|
-
className: "text-description text-sm truncate"
|
|
944
|
-
}, forignKey.id)), /* @__PURE__ */ React11.createElement(ListItem.Endcap, null, /* @__PURE__ */ React11.createElement(IconButton, {
|
|
945
|
-
iconOnly: true,
|
|
946
|
-
icon: "ph--x--regular",
|
|
947
|
-
variant: "ghost",
|
|
948
|
-
label: t("delete key"),
|
|
949
|
-
onClick: handleDelete
|
|
950
|
-
})));
|
|
951
|
-
};
|
|
952
|
-
|
|
953
|
-
// packages/plugins/plugin-space/src/components/ObjectSettings/AdvancedObjectSettings.tsx
|
|
954
|
-
var initialValues2 = {
|
|
955
|
-
source: "",
|
|
956
|
-
id: ""
|
|
957
|
-
};
|
|
958
|
-
var AdvancedObjectSettings = ({ object }) => {
|
|
959
|
-
const { t } = useTranslation11(SPACE_PLUGIN);
|
|
960
|
-
const [adding, setAdding] = useState5(false);
|
|
961
|
-
const keys = getMeta(object).keys;
|
|
962
|
-
const handleNew = useCallback9(() => setAdding(true), []);
|
|
963
|
-
const handleCancel = useCallback9(() => setAdding(false), []);
|
|
964
|
-
const handleSave = useCallback9((key) => {
|
|
965
|
-
const index = keys.findIndex(({ source, id }) => source === key.source && id === key.id);
|
|
966
|
-
if (index === -1) {
|
|
967
|
-
keys.push(key);
|
|
968
|
-
}
|
|
969
|
-
setAdding(false);
|
|
970
|
-
}, [
|
|
971
|
-
keys
|
|
972
|
-
]);
|
|
973
|
-
const handleDelete = useCallback9((key) => {
|
|
974
|
-
const index = keys.findIndex(({ source, id }) => source === key.source && id === key.id);
|
|
975
|
-
if (index !== -1) {
|
|
976
|
-
keys.splice(index, 1);
|
|
977
|
-
}
|
|
978
|
-
}, [
|
|
979
|
-
keys
|
|
980
|
-
]);
|
|
981
|
-
return /* @__PURE__ */ React12.createElement(React12.Fragment, null, /* @__PURE__ */ React12.createElement("div", {
|
|
982
|
-
className: "p-2 flex flex-col gap-4"
|
|
983
|
-
}, /* @__PURE__ */ React12.createElement("h2", null, t("advanced settings label")), /* @__PURE__ */ React12.createElement("div", {
|
|
984
|
-
className: "flex items-center"
|
|
985
|
-
}, /* @__PURE__ */ React12.createElement("h3", {
|
|
986
|
-
className: "text-sm font-semibold"
|
|
987
|
-
}, t("foreign keys")), /* @__PURE__ */ React12.createElement("div", {
|
|
988
|
-
className: "grow"
|
|
989
|
-
}), /* @__PURE__ */ React12.createElement(IconButton2, {
|
|
990
|
-
classNames: adding && "invisible",
|
|
991
|
-
icon: "ph--plus--regular",
|
|
992
|
-
label: t("add key"),
|
|
993
|
-
onClick: handleNew
|
|
994
|
-
})), !adding && /* @__PURE__ */ React12.createElement(ForeignKeys, {
|
|
995
|
-
keys,
|
|
996
|
-
onDelete: handleDelete
|
|
997
|
-
})), adding && /* @__PURE__ */ React12.createElement(Form3, {
|
|
998
|
-
schema: ForeignKeySchema,
|
|
999
|
-
values: initialValues2,
|
|
1000
|
-
onSave: handleSave,
|
|
1001
|
-
onCancel: handleCancel
|
|
1002
|
-
}));
|
|
1003
|
-
};
|
|
1004
|
-
|
|
1005
849
|
// packages/plugins/plugin-space/src/components/ObjectSettings/BaseObjectSettings.tsx
|
|
1006
|
-
import
|
|
1007
|
-
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";
|
|
1008
852
|
import { mx as mx5 } from "@dxos/react-ui-theme";
|
|
1009
853
|
var BaseObjectSettings = ({ classNames, children, object }) => {
|
|
1010
|
-
const { t } =
|
|
854
|
+
const { t } = useTranslation10(meta.id);
|
|
1011
855
|
const inputRef = useRef3(null);
|
|
1012
|
-
return /* @__PURE__ */
|
|
856
|
+
return /* @__PURE__ */ React10.createElement("form", {
|
|
1013
857
|
className: mx5("flex flex-col p-2 gap-2", classNames)
|
|
1014
|
-
}, /* @__PURE__ */
|
|
858
|
+
}, /* @__PURE__ */ React10.createElement(Input2.Root, null, /* @__PURE__ */ React10.createElement(Input2.Label, null, t("name label")), /* @__PURE__ */ React10.createElement(Input2.TextInput, {
|
|
1015
859
|
ref: inputRef,
|
|
1016
860
|
placeholder: t("name placeholder"),
|
|
1017
861
|
value: object.name ?? "",
|
|
@@ -1033,29 +877,27 @@ var ObjectSettingsContainer = ({ object, role }) => {
|
|
|
1033
877
|
}), [
|
|
1034
878
|
object
|
|
1035
879
|
]);
|
|
1036
|
-
return /* @__PURE__ */
|
|
880
|
+
return /* @__PURE__ */ React11.createElement(Clipboard2.Provider, null, /* @__PURE__ */ React11.createElement(StackItem2.Content, {
|
|
1037
881
|
toolbar: false,
|
|
1038
882
|
role
|
|
1039
|
-
}, /* @__PURE__ */
|
|
883
|
+
}, /* @__PURE__ */ React11.createElement("div", {
|
|
1040
884
|
className: "flex flex-col overflow-y-auto divide-y divide-separator"
|
|
1041
|
-
}, /* @__PURE__ */
|
|
885
|
+
}, /* @__PURE__ */ React11.createElement(BaseObjectSettings, {
|
|
1042
886
|
object
|
|
1043
|
-
}, /* @__PURE__ */
|
|
887
|
+
}, /* @__PURE__ */ React11.createElement(Surface, {
|
|
1044
888
|
role: "base-object-settings",
|
|
1045
889
|
data
|
|
1046
|
-
})), /* @__PURE__ */
|
|
890
|
+
})), /* @__PURE__ */ React11.createElement(Surface, {
|
|
1047
891
|
role: "object-settings",
|
|
1048
892
|
data
|
|
1049
|
-
}), /* @__PURE__ */ React14.createElement(AdvancedObjectSettings, {
|
|
1050
|
-
object
|
|
1051
893
|
}))));
|
|
1052
894
|
};
|
|
1053
895
|
|
|
1054
896
|
// packages/plugins/plugin-space/src/components/PersistenceStatus.tsx
|
|
1055
897
|
import { ArrowsCounterClockwise, CheckCircle as CheckCircle2, Warning } from "@phosphor-icons/react";
|
|
1056
|
-
import
|
|
898
|
+
import React12, { useEffect as useEffect2, useState as useState4 } from "react";
|
|
1057
899
|
import { debounce } from "@dxos/async";
|
|
1058
|
-
import { Tooltip, useTranslation as
|
|
900
|
+
import { Tooltip, useTranslation as useTranslation11 } from "@dxos/react-ui";
|
|
1059
901
|
import { getSize as getSize3, mx as mx6, staticPlaceholderText, warningText } from "@dxos/react-ui-theme";
|
|
1060
902
|
var Status;
|
|
1061
903
|
(function(Status2) {
|
|
@@ -1064,12 +906,12 @@ var Status;
|
|
|
1064
906
|
Status2[Status2["ERROR"] = 2] = "ERROR";
|
|
1065
907
|
})(Status || (Status = {}));
|
|
1066
908
|
var PersistenceStatus = ({ db }) => {
|
|
1067
|
-
const { t } =
|
|
1068
|
-
const [displayMessage, setDisplayMessage] =
|
|
1069
|
-
const [status, naturalSetStatus] =
|
|
1070
|
-
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);
|
|
1071
913
|
const _setStatus = debounce(naturalSetStatus, 500);
|
|
1072
|
-
|
|
914
|
+
useEffect2(() => {
|
|
1073
915
|
setPrevStatus(status);
|
|
1074
916
|
if (prevStatus !== status && status === 0) {
|
|
1075
917
|
setDisplayMessage(true);
|
|
@@ -1081,96 +923,50 @@ var PersistenceStatus = ({ db }) => {
|
|
|
1081
923
|
]);
|
|
1082
924
|
switch (status) {
|
|
1083
925
|
case 2:
|
|
1084
|
-
return /* @__PURE__ */
|
|
926
|
+
return /* @__PURE__ */ React12.createElement("div", {
|
|
1085
927
|
className: "flex items-center"
|
|
1086
|
-
}, /* @__PURE__ */
|
|
928
|
+
}, /* @__PURE__ */ React12.createElement(Warning, {
|
|
1087
929
|
className: mx6(getSize3(4), "me-1")
|
|
1088
|
-
}), /* @__PURE__ */
|
|
930
|
+
}), /* @__PURE__ */ React12.createElement("span", {
|
|
1089
931
|
className: mx6("text-sm", warningText)
|
|
1090
932
|
}, t("persistence error label")));
|
|
1091
933
|
case 1:
|
|
1092
|
-
return /* @__PURE__ */
|
|
934
|
+
return /* @__PURE__ */ React12.createElement("div", {
|
|
1093
935
|
className: "flex items-center"
|
|
1094
|
-
}, /* @__PURE__ */
|
|
936
|
+
}, /* @__PURE__ */ React12.createElement(ArrowsCounterClockwise, {
|
|
1095
937
|
className: mx6(getSize3(4), "me-1")
|
|
1096
|
-
}), /* @__PURE__ */
|
|
938
|
+
}), /* @__PURE__ */ React12.createElement("span", {
|
|
1097
939
|
className: mx6("text-sm", staticPlaceholderText)
|
|
1098
940
|
}, t("persistence pending label")));
|
|
1099
941
|
case 0:
|
|
1100
942
|
default:
|
|
1101
|
-
return /* @__PURE__ */
|
|
1102
|
-
delayDuration: 400
|
|
1103
|
-
}, /* @__PURE__ */ React15.createElement(Tooltip.Trigger, {
|
|
943
|
+
return /* @__PURE__ */ React12.createElement(Tooltip.Trigger, {
|
|
944
|
+
delayDuration: 400,
|
|
1104
945
|
role: "status",
|
|
946
|
+
content: t("persisted locally message"),
|
|
1105
947
|
className: "flex items-center"
|
|
1106
|
-
}, /* @__PURE__ */
|
|
948
|
+
}, /* @__PURE__ */ React12.createElement(CheckCircle2, {
|
|
1107
949
|
className: mx6(getSize3(4), "me-1")
|
|
1108
|
-
}), displayMessage && /* @__PURE__ */
|
|
950
|
+
}), displayMessage && /* @__PURE__ */ React12.createElement("span", {
|
|
1109
951
|
className: mx6("text-sm", staticPlaceholderText)
|
|
1110
|
-
}, t("persisted locally label")))
|
|
952
|
+
}, t("persisted locally label")));
|
|
1111
953
|
}
|
|
1112
954
|
};
|
|
1113
955
|
|
|
1114
|
-
// packages/plugins/plugin-space/src/components/PopoverAddSpace.tsx
|
|
1115
|
-
import React16 from "react";
|
|
1116
|
-
import { createIntent as createIntent6, LayoutAction as LayoutAction5, useIntentDispatcher as useIntentDispatcher6 } from "@dxos/app-framework";
|
|
1117
|
-
import { IconButton as IconButton3, useTranslation as useTranslation14 } from "@dxos/react-ui";
|
|
1118
|
-
var POPOVER_ADD_SPACE = `${SPACE_PLUGIN}/PopoverRenameSpace`;
|
|
1119
|
-
var PopoverAddSpace = () => {
|
|
1120
|
-
const { t } = useTranslation14(SPACE_PLUGIN);
|
|
1121
|
-
const { dispatchPromise: dispatch } = useIntentDispatcher6();
|
|
1122
|
-
return /* @__PURE__ */ React16.createElement("div", {
|
|
1123
|
-
role: "none",
|
|
1124
|
-
className: "p-1 grid grid-cols-1 gap-1 [&>button]:justify-start"
|
|
1125
|
-
}, /* @__PURE__ */ React16.createElement(IconButton3, {
|
|
1126
|
-
variant: "ghost",
|
|
1127
|
-
label: t("create space label"),
|
|
1128
|
-
icon: "ph--plus--regular",
|
|
1129
|
-
onClick: () => {
|
|
1130
|
-
void dispatch(createIntent6(SpaceAction.OpenCreateSpace));
|
|
1131
|
-
void dispatch(createIntent6(LayoutAction5.UpdatePopover, {
|
|
1132
|
-
part: "popover",
|
|
1133
|
-
options: {
|
|
1134
|
-
variant: "react",
|
|
1135
|
-
anchorId: "",
|
|
1136
|
-
state: false
|
|
1137
|
-
}
|
|
1138
|
-
}));
|
|
1139
|
-
},
|
|
1140
|
-
"data-testid": "spacePlugin.createSpace"
|
|
1141
|
-
}), /* @__PURE__ */ React16.createElement(IconButton3, {
|
|
1142
|
-
variant: "ghost",
|
|
1143
|
-
label: t("join space label"),
|
|
1144
|
-
icon: "ph--sign-in--regular",
|
|
1145
|
-
onClick: () => {
|
|
1146
|
-
void dispatch(createIntent6(SpaceAction.Join));
|
|
1147
|
-
void dispatch(createIntent6(LayoutAction5.UpdatePopover, {
|
|
1148
|
-
part: "popover",
|
|
1149
|
-
options: {
|
|
1150
|
-
variant: "react",
|
|
1151
|
-
anchorId: "",
|
|
1152
|
-
state: false
|
|
1153
|
-
}
|
|
1154
|
-
}));
|
|
1155
|
-
},
|
|
1156
|
-
"data-testid": "spacePlugin.joinSpace"
|
|
1157
|
-
}));
|
|
1158
|
-
};
|
|
1159
|
-
|
|
1160
956
|
// packages/plugins/plugin-space/src/components/PopoverRenameObject.tsx
|
|
1161
|
-
import
|
|
1162
|
-
import { createIntent as
|
|
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";
|
|
1163
959
|
import { log as log2 } from "@dxos/log";
|
|
1164
|
-
import { Button as Button5, Input as Input3, useTranslation as
|
|
960
|
+
import { Button as Button5, Input as Input3, useTranslation as useTranslation12 } from "@dxos/react-ui";
|
|
1165
961
|
var __dxlog_file4 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/PopoverRenameObject.tsx";
|
|
1166
962
|
var POPOVER_RENAME_OBJECT = `${SPACE_PLUGIN}/PopoverRenameObject`;
|
|
1167
963
|
var PopoverRenameObject = ({ object: obj }) => {
|
|
1168
|
-
const { t } =
|
|
964
|
+
const { t } = useTranslation12(SPACE_PLUGIN);
|
|
1169
965
|
const doneButton = useRef4(null);
|
|
1170
966
|
const object = obj;
|
|
1171
|
-
const [name, setName] =
|
|
1172
|
-
const { dispatchPromise: dispatch } =
|
|
1173
|
-
const handleDone =
|
|
967
|
+
const [name, setName] = useState5(object.name || object.title || "");
|
|
968
|
+
const { dispatchPromise: dispatch } = useIntentDispatcher6();
|
|
969
|
+
const handleDone = useCallback7(() => {
|
|
1174
970
|
try {
|
|
1175
971
|
object.name = name;
|
|
1176
972
|
} catch {
|
|
@@ -1187,7 +983,7 @@ var PopoverRenameObject = ({ object: obj }) => {
|
|
|
1187
983
|
});
|
|
1188
984
|
}
|
|
1189
985
|
}
|
|
1190
|
-
void dispatch(
|
|
986
|
+
void dispatch(createIntent6(LayoutAction5.UpdatePopover, {
|
|
1191
987
|
part: "popover",
|
|
1192
988
|
options: {
|
|
1193
989
|
variant: "react",
|
|
@@ -1199,21 +995,21 @@ var PopoverRenameObject = ({ object: obj }) => {
|
|
|
1199
995
|
object,
|
|
1200
996
|
name
|
|
1201
997
|
]);
|
|
1202
|
-
return /* @__PURE__ */
|
|
998
|
+
return /* @__PURE__ */ React13.createElement("div", {
|
|
1203
999
|
role: "none",
|
|
1204
1000
|
className: "p-1 flex gap-2"
|
|
1205
|
-
}, /* @__PURE__ */
|
|
1001
|
+
}, /* @__PURE__ */ React13.createElement("div", {
|
|
1206
1002
|
role: "none",
|
|
1207
1003
|
className: "flex-1"
|
|
1208
|
-
}, /* @__PURE__ */
|
|
1004
|
+
}, /* @__PURE__ */ React13.createElement(Input3.Root, null, /* @__PURE__ */ React13.createElement(Input3.Label, {
|
|
1209
1005
|
srOnly: true
|
|
1210
|
-
}, t("object name label")), /* @__PURE__ */
|
|
1006
|
+
}, t("object name label")), /* @__PURE__ */ React13.createElement(Input3.TextInput, {
|
|
1211
1007
|
placeholder: t("object placeholder"),
|
|
1212
1008
|
value: name,
|
|
1213
1009
|
"data-testid": "spacePlugin.renameObject.input",
|
|
1214
1010
|
onChange: ({ target: { value } }) => setName(value),
|
|
1215
1011
|
onKeyDown: ({ key }) => key === "Enter" && doneButton.current?.click()
|
|
1216
|
-
}))), /* @__PURE__ */
|
|
1012
|
+
}))), /* @__PURE__ */ React13.createElement(Button5, {
|
|
1217
1013
|
ref: doneButton,
|
|
1218
1014
|
classNames: "self-stretch",
|
|
1219
1015
|
onClick: handleDone
|
|
@@ -1223,18 +1019,18 @@ var PopoverRenameObject = ({ object: obj }) => {
|
|
|
1223
1019
|
};
|
|
1224
1020
|
|
|
1225
1021
|
// packages/plugins/plugin-space/src/components/PopoverRenameSpace.tsx
|
|
1226
|
-
import
|
|
1227
|
-
import { createIntent as
|
|
1228
|
-
import { Button as Button6, Input as Input4, Popover, useTranslation as
|
|
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";
|
|
1229
1025
|
var POPOVER_RENAME_SPACE = `${SPACE_PLUGIN}/PopoverRenameSpace`;
|
|
1230
1026
|
var PopoverRenameSpace = ({ space }) => {
|
|
1231
|
-
const { t } =
|
|
1027
|
+
const { t } = useTranslation13(SPACE_PLUGIN);
|
|
1232
1028
|
const doneButton = useRef5(null);
|
|
1233
|
-
const [name, setName] =
|
|
1234
|
-
const { dispatchPromise: dispatch } =
|
|
1235
|
-
const handleDone =
|
|
1029
|
+
const [name, setName] = useState6(space.properties.name ?? "");
|
|
1030
|
+
const { dispatchPromise: dispatch } = useIntentDispatcher7();
|
|
1031
|
+
const handleDone = useCallback8(() => {
|
|
1236
1032
|
space.properties.name = name;
|
|
1237
|
-
void dispatch(
|
|
1033
|
+
void dispatch(createIntent7(LayoutAction6.UpdatePopover, {
|
|
1238
1034
|
part: "popover",
|
|
1239
1035
|
options: {
|
|
1240
1036
|
variant: "react",
|
|
@@ -1246,24 +1042,24 @@ var PopoverRenameSpace = ({ space }) => {
|
|
|
1246
1042
|
space,
|
|
1247
1043
|
name
|
|
1248
1044
|
]);
|
|
1249
|
-
return /* @__PURE__ */
|
|
1045
|
+
return /* @__PURE__ */ React14.createElement("div", {
|
|
1250
1046
|
role: "none",
|
|
1251
1047
|
className: "p-1 flex gap-2"
|
|
1252
|
-
}, /* @__PURE__ */
|
|
1048
|
+
}, /* @__PURE__ */ React14.createElement("div", {
|
|
1253
1049
|
role: "none",
|
|
1254
1050
|
className: "flex-1"
|
|
1255
|
-
}, /* @__PURE__ */
|
|
1051
|
+
}, /* @__PURE__ */ React14.createElement(Input4.Root, null, /* @__PURE__ */ React14.createElement(Input4.Label, {
|
|
1256
1052
|
srOnly: true
|
|
1257
|
-
}, t("space name label")), /* @__PURE__ */
|
|
1053
|
+
}, t("space name label")), /* @__PURE__ */ React14.createElement(Input4.TextInput, {
|
|
1258
1054
|
defaultValue: space.properties.name ?? "",
|
|
1259
1055
|
placeholder: t("unnamed space label"),
|
|
1260
1056
|
onChange: ({ target: { value } }) => setName(value),
|
|
1261
1057
|
// TODO(wittjosiah): Ideally this should access the popover context to close the popover.
|
|
1262
1058
|
// Currently this is not possible because Radix does not expose the popover context.
|
|
1263
1059
|
onKeyDown: ({ key }) => key === "Enter" && doneButton.current?.click()
|
|
1264
|
-
}))), /* @__PURE__ */
|
|
1060
|
+
}))), /* @__PURE__ */ React14.createElement(Popover.Close, {
|
|
1265
1061
|
asChild: true
|
|
1266
|
-
}, /* @__PURE__ */
|
|
1062
|
+
}, /* @__PURE__ */ React14.createElement(Button6, {
|
|
1267
1063
|
ref: doneButton,
|
|
1268
1064
|
classNames: "self-stretch",
|
|
1269
1065
|
onClick: handleDone
|
|
@@ -1273,13 +1069,13 @@ var PopoverRenameSpace = ({ space }) => {
|
|
|
1273
1069
|
};
|
|
1274
1070
|
|
|
1275
1071
|
// packages/plugins/plugin-space/src/components/SchemaContainer.tsx
|
|
1276
|
-
import
|
|
1277
|
-
import { useTranslation as
|
|
1072
|
+
import React15, { useState as useState7, useEffect as useEffect3 } from "react";
|
|
1073
|
+
import { useTranslation as useTranslation14 } from "@dxos/react-ui";
|
|
1278
1074
|
import { controlItemClasses, ControlPage as ControlPage2, ControlSection as ControlSection2 } from "@dxos/react-ui-form";
|
|
1279
1075
|
import { StackItem as StackItem3 } from "@dxos/react-ui-stack";
|
|
1280
1076
|
var useQuerySpaceSchemas = (space) => {
|
|
1281
|
-
const [schemas, setSchemas] =
|
|
1282
|
-
|
|
1077
|
+
const [schemas, setSchemas] = useState7([]);
|
|
1078
|
+
useEffect3(() => {
|
|
1283
1079
|
const query = space.db.schemaRegistry.query();
|
|
1284
1080
|
const initialResults = query.runSync();
|
|
1285
1081
|
setSchemas(initialResults);
|
|
@@ -1291,31 +1087,32 @@ var useQuerySpaceSchemas = (space) => {
|
|
|
1291
1087
|
return schemas;
|
|
1292
1088
|
};
|
|
1293
1089
|
var SchemaContainer = ({ space }) => {
|
|
1294
|
-
const { t } =
|
|
1090
|
+
const { t } = useTranslation14(SPACE_PLUGIN);
|
|
1295
1091
|
const schemas = useQuerySpaceSchemas(space);
|
|
1296
|
-
return /* @__PURE__ */
|
|
1092
|
+
return /* @__PURE__ */ React15.createElement(StackItem3.Content, {
|
|
1297
1093
|
classNames: "block overflow-y-auto"
|
|
1298
|
-
}, /* @__PURE__ */
|
|
1094
|
+
}, /* @__PURE__ */ React15.createElement(ControlPage2, null, /* @__PURE__ */ React15.createElement(ControlSection2, {
|
|
1299
1095
|
title: t("schema verbose label"),
|
|
1300
1096
|
description: t("schema description")
|
|
1301
|
-
}, /* @__PURE__ */
|
|
1097
|
+
}, /* @__PURE__ */ React15.createElement("div", {
|
|
1302
1098
|
role: "none",
|
|
1303
1099
|
className: controlItemClasses
|
|
1304
|
-
}, schemas.length === 0 && /* @__PURE__ */
|
|
1100
|
+
}, schemas.length === 0 && /* @__PURE__ */ React15.createElement("div", {
|
|
1305
1101
|
className: "text-center plb-4"
|
|
1306
|
-
}, t("no schemas found message")), schemas.map((schema) => /* @__PURE__ */
|
|
1102
|
+
}, t("no schemas found message")), schemas.map((schema) => /* @__PURE__ */ React15.createElement("div", {
|
|
1307
1103
|
key: schema.id
|
|
1308
|
-
}, /* @__PURE__ */
|
|
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__ */ React20.createElement("span", null, getName(member.identity)), /* @__PURE__ */ React20.createElement(Tooltip2.Arrow, null))))), members.length > 3 && /* @__PURE__ */ React20.createElement(Tooltip2.Root, null, /* @__PURE__ */ React20.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__ */ React20.createElement("span", null, t("presence label", {
|
|
1467
|
-
count
|
|
1468
|
-
})), /* @__PURE__ */ React20.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__ */ React23.createElement("span", null, t("syncing label")), /* @__PURE__ */ React23.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,8 +1701,6 @@ 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,
|
|
@@ -1928,10 +1722,10 @@ export {
|
|
|
1928
1722
|
IntentResolver,
|
|
1929
1723
|
ReactRoot,
|
|
1930
1724
|
ReactSurface,
|
|
1931
|
-
|
|
1932
|
-
|
|
1725
|
+
SchemaDefs,
|
|
1726
|
+
SchemaTools,
|
|
1933
1727
|
SpaceSettings,
|
|
1934
1728
|
SpaceState,
|
|
1935
1729
|
SpacesReady
|
|
1936
1730
|
};
|
|
1937
|
-
//# sourceMappingURL=chunk-
|
|
1731
|
+
//# sourceMappingURL=chunk-43UQWMD3.mjs.map
|