@dxos/plugin-space 0.7.5-main.9d2a38b → 0.7.5-main.b19bfc8
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-F6XSETHX.mjs → app-graph-builder-MGK5HWPZ.mjs} +26 -103
- package/dist/lib/browser/app-graph-builder-MGK5HWPZ.mjs.map +7 -0
- package/dist/lib/browser/{app-graph-serializer-FYJE23GN.mjs → app-graph-serializer-FOWFLYGU.mjs} +5 -5
- package/dist/lib/browser/{chunk-IZ7QKQ2E.mjs → chunk-23RVI5FZ.mjs} +27 -11
- package/dist/lib/browser/chunk-23RVI5FZ.mjs.map +7 -0
- package/dist/lib/browser/{chunk-UH5P4UL3.mjs → chunk-NU7WDVGN.mjs} +4 -2
- package/dist/lib/browser/chunk-NU7WDVGN.mjs.map +7 -0
- package/dist/lib/browser/{chunk-SOXNANA6.mjs → chunk-PQXZCNAU.mjs} +3 -2
- package/dist/lib/browser/{chunk-SOXNANA6.mjs.map → chunk-PQXZCNAU.mjs.map} +3 -3
- package/dist/lib/browser/{chunk-XXD33C4E.mjs → chunk-S6B7627U.mjs} +486 -349
- package/dist/lib/browser/chunk-S6B7627U.mjs.map +7 -0
- package/dist/lib/browser/{chunk-T36CIHPG.mjs → chunk-UDWHTKB5.mjs} +7 -4
- package/dist/lib/browser/chunk-UDWHTKB5.mjs.map +7 -0
- package/dist/lib/browser/{chunk-SSJ772GK.mjs → chunk-ULA2UQJ4.mjs} +18 -5
- package/dist/lib/browser/chunk-ULA2UQJ4.mjs.map +7 -0
- package/dist/lib/browser/{identity-created-4Q4PFIC5.mjs → identity-created-FYGS6TBH.mjs} +3 -3
- package/dist/lib/browser/index.mjs +58 -24
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/intent-resolver-QVR4MSJV.mjs +555 -0
- package/dist/lib/browser/intent-resolver-QVR4MSJV.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-root-BDOPFJGJ.mjs → react-root-IP2ZB245.mjs} +6 -6
- package/dist/lib/browser/{react-surface-EGOL2JBL.mjs → react-surface-BT3EHB6V.mjs} +36 -49
- package/dist/lib/browser/react-surface-BT3EHB6V.mjs.map +7 -0
- package/dist/lib/browser/schema-5W3DSY2E.mjs +24 -0
- package/dist/lib/browser/schema-5W3DSY2E.mjs.map +7 -0
- package/dist/lib/browser/{settings-WF67QZSD.mjs → settings-PHPCXX33.mjs} +3 -3
- package/dist/lib/browser/{spaces-ready-WVU7US3C.mjs → spaces-ready-K47RR7N2.mjs} +31 -32
- package/dist/lib/browser/spaces-ready-K47RR7N2.mjs.map +7 -0
- package/dist/lib/browser/{state-MS4KYJWI.mjs → state-INJ63O57.mjs} +3 -3
- package/dist/lib/browser/types/index.mjs +6 -4
- package/dist/lib/node/{app-graph-builder-GKLVZ4PM.cjs → app-graph-builder-ZIUBXRPA.cjs} +59 -136
- package/dist/lib/node/app-graph-builder-ZIUBXRPA.cjs.map +7 -0
- package/dist/lib/node/{app-graph-serializer-RMTU5YSC.cjs → app-graph-serializer-VQOGHKXL.cjs} +21 -21
- package/dist/lib/node/{chunk-AJRP7AD6.cjs → chunk-N2FS7PRA.cjs} +552 -414
- package/dist/lib/node/chunk-N2FS7PRA.cjs.map +7 -0
- package/dist/lib/node/{chunk-5D4RWKTV.cjs → chunk-OVGKWJOC.cjs} +78 -62
- package/dist/lib/node/chunk-OVGKWJOC.cjs.map +7 -0
- package/dist/lib/node/{chunk-UENH2YBM.cjs → chunk-U6DYXAR3.cjs} +12 -9
- package/dist/lib/node/chunk-U6DYXAR3.cjs.map +7 -0
- package/dist/lib/node/{chunk-YCBBGTFD.cjs → chunk-WAJKBO3J.cjs} +25 -11
- package/dist/lib/node/chunk-WAJKBO3J.cjs.map +7 -0
- package/dist/lib/node/{chunk-AO4EW2RX.cjs → chunk-WZR6OAN3.cjs} +6 -5
- package/dist/lib/node/{chunk-AO4EW2RX.cjs.map → chunk-WZR6OAN3.cjs.map} +3 -3
- package/dist/lib/node/{chunk-56NGXG2A.cjs → chunk-YZKNRFHU.cjs} +10 -8
- package/dist/lib/node/chunk-YZKNRFHU.cjs.map +7 -0
- package/dist/lib/node/{identity-created-QQWX7WX3.cjs → identity-created-AXI64BLE.cjs} +7 -7
- package/dist/lib/node/index.cjs +131 -98
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/intent-resolver-MLENGECT.cjs +553 -0
- package/dist/lib/node/intent-resolver-MLENGECT.cjs.map +7 -0
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/{react-root-ZTR2J2I3.cjs → react-root-3OX5Z5CX.cjs} +12 -12
- package/dist/lib/node/{react-surface-75KRPQYT.cjs → react-surface-5NYCMXSM.cjs} +77 -89
- package/dist/lib/node/react-surface-5NYCMXSM.cjs.map +7 -0
- package/dist/lib/node/schema-YN7WVFRX.cjs +40 -0
- package/dist/lib/node/schema-YN7WVFRX.cjs.map +7 -0
- package/dist/lib/node/{settings-KOVSPA3S.cjs → settings-5QYFWNH7.cjs} +8 -8
- package/dist/lib/node/{spaces-ready-ILVGUHJH.cjs → spaces-ready-FQNAKR7G.cjs} +39 -40
- package/dist/lib/node/spaces-ready-FQNAKR7G.cjs.map +7 -0
- package/dist/lib/node/{state-4UIOUKLJ.cjs → state-57UE3DYE.cjs} +8 -8
- package/dist/lib/node/types/index.cjs +19 -17
- package/dist/lib/node/types/index.cjs.map +2 -2
- package/dist/lib/node-esm/{app-graph-builder-NEHQ5Z63.mjs → app-graph-builder-TERVM2SL.mjs} +26 -103
- package/dist/lib/node-esm/app-graph-builder-TERVM2SL.mjs.map +7 -0
- package/dist/lib/node-esm/{app-graph-serializer-UWWS5OVC.mjs → app-graph-serializer-GZRSWHEN.mjs} +5 -5
- package/dist/lib/node-esm/{chunk-E5DWIQ3N.mjs → chunk-2TQ2AJEZ.mjs} +7 -4
- package/dist/lib/node-esm/chunk-2TQ2AJEZ.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-375RB3CZ.mjs → chunk-6RSVVEPS.mjs} +4 -2
- package/dist/lib/node-esm/chunk-6RSVVEPS.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-GVOPDPS2.mjs → chunk-DIKRH2IK.mjs} +486 -349
- package/dist/lib/node-esm/chunk-DIKRH2IK.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-7FUVU45N.mjs → chunk-ICCM4YRJ.mjs} +3 -2
- package/dist/lib/node-esm/{chunk-7FUVU45N.mjs.map → chunk-ICCM4YRJ.mjs.map} +3 -3
- package/dist/lib/node-esm/{chunk-5QMAPAZD.mjs → chunk-PGH5L7MV.mjs} +27 -11
- package/dist/lib/node-esm/chunk-PGH5L7MV.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-HTBGWQEU.mjs → chunk-TRNZQEEN.mjs} +18 -5
- package/dist/lib/node-esm/chunk-TRNZQEEN.mjs.map +7 -0
- package/dist/lib/node-esm/{identity-created-HMNY2MPB.mjs → identity-created-3CGEXNPO.mjs} +3 -3
- package/dist/lib/node-esm/index.mjs +58 -24
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/intent-resolver-BLW4RM6X.mjs +556 -0
- package/dist/lib/node-esm/intent-resolver-BLW4RM6X.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-root-OUPJA4RY.mjs → react-root-7XXGP56B.mjs} +6 -6
- package/dist/lib/node-esm/{react-surface-7EVWCKIP.mjs → react-surface-R2ECJSFB.mjs} +36 -49
- package/dist/lib/node-esm/react-surface-R2ECJSFB.mjs.map +7 -0
- package/dist/lib/node-esm/schema-LOR2EVGY.mjs +25 -0
- package/dist/lib/node-esm/schema-LOR2EVGY.mjs.map +7 -0
- package/dist/lib/node-esm/{settings-EDK6WI3V.mjs → settings-H6MXTEQM.mjs} +3 -3
- package/dist/lib/node-esm/{spaces-ready-CH3W7OGN.mjs → spaces-ready-HKAQG5SA.mjs} +31 -32
- package/dist/lib/node-esm/spaces-ready-HKAQG5SA.mjs.map +7 -0
- package/dist/lib/node-esm/{state-BMISGQ2O.mjs → state-VYA6OFHD.mjs} +3 -3
- package/dist/lib/node-esm/types/index.mjs +6 -4
- package/dist/types/src/SpacePlugin.d.ts +5 -1
- package/dist/types/src/SpacePlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts +110 -110
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/capabilities.d.ts +8 -1
- package/dist/types/src/capabilities/capabilities.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +123 -121
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +2 -1
- 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.d.ts +4 -0
- package/dist/types/src/capabilities/schema.d.ts.map +1 -0
- package/dist/types/src/capabilities/spaces-ready.d.ts.map +1 -1
- package/dist/types/src/components/AdvancedObjectSettings/AdvancedObjectSettings.d.ts +1 -2
- package/dist/types/src/components/AdvancedObjectSettings/AdvancedObjectSettings.d.ts.map +1 -1
- package/dist/types/src/components/AdvancedObjectSettings/ForeignKeys.d.ts +1 -2
- package/dist/types/src/components/AdvancedObjectSettings/ForeignKeys.d.ts.map +1 -1
- package/dist/types/src/components/AwaitingObject.d.ts +1 -2
- package/dist/types/src/components/AwaitingObject.d.ts.map +1 -1
- package/dist/types/src/components/BaseObjectSettings.d.ts +1 -2
- package/dist/types/src/components/BaseObjectSettings.d.ts.map +1 -1
- package/dist/types/src/components/CollectionMain.d.ts +1 -2
- package/dist/types/src/components/CollectionMain.d.ts.map +1 -1
- package/dist/types/src/components/CollectionSection.d.ts +1 -2
- package/dist/types/src/components/CollectionSection.d.ts.map +1 -1
- package/dist/types/src/components/CreateDialog/CreateObjectDialog.d.ts +2 -4
- package/dist/types/src/components/CreateDialog/CreateObjectDialog.d.ts.map +1 -1
- package/dist/types/src/components/CreateDialog/CreateObjectDialog.stories.d.ts.map +1 -1
- package/dist/types/src/components/CreateDialog/CreateObjectPanel.d.ts +8 -9
- package/dist/types/src/components/CreateDialog/CreateObjectPanel.d.ts.map +1 -1
- package/dist/types/src/components/CreateDialog/CreateSpaceDialog.d.ts +1 -2
- package/dist/types/src/components/CreateDialog/CreateSpaceDialog.d.ts.map +1 -1
- package/dist/types/src/components/JoinDialog.d.ts +1 -2
- package/dist/types/src/components/JoinDialog.d.ts.map +1 -1
- package/dist/types/src/components/MenuFooter.d.ts +1 -2
- package/dist/types/src/components/MenuFooter.d.ts.map +1 -1
- package/dist/types/src/components/PersistenceStatus.d.ts +1 -2
- package/dist/types/src/components/PersistenceStatus.d.ts.map +1 -1
- package/dist/types/src/components/PopoverAddSpace.d.ts +3 -0
- package/dist/types/src/components/PopoverAddSpace.d.ts.map +1 -0
- package/dist/types/src/components/PopoverRenameObject.d.ts +1 -2
- package/dist/types/src/components/PopoverRenameObject.d.ts.map +1 -1
- package/dist/types/src/components/PopoverRenameSpace.d.ts +1 -2
- package/dist/types/src/components/PopoverRenameSpace.d.ts.map +1 -1
- package/dist/types/src/components/ShareSpaceButton.d.ts +2 -3
- package/dist/types/src/components/ShareSpaceButton.d.ts.map +1 -1
- package/dist/types/src/components/SpacePluginSettings.d.ts +1 -2
- package/dist/types/src/components/SpacePluginSettings.d.ts.map +1 -1
- package/dist/types/src/components/SpacePresence.d.ts +4 -5
- package/dist/types/src/components/SpacePresence.d.ts.map +1 -1
- package/dist/types/src/components/SpacePresence.stories.d.ts +2 -3
- package/dist/types/src/components/SpacePresence.stories.d.ts.map +1 -1
- package/dist/types/src/components/SpaceSettings/SpaceSettingsDialog.d.ts +1 -2
- package/dist/types/src/components/SpaceSettings/SpaceSettingsDialog.d.ts.map +1 -1
- package/dist/types/src/components/SpaceSettings/SpaceSettingsPanel.d.ts +3 -5
- package/dist/types/src/components/SpaceSettings/SpaceSettingsPanel.d.ts.map +1 -1
- package/dist/types/src/components/SpaceSettings/SpaceSettingsPanel.stories.d.ts.map +1 -1
- package/dist/types/src/components/SyncStatus/InlineSyncStatus.d.ts +1 -2
- package/dist/types/src/components/SyncStatus/InlineSyncStatus.d.ts.map +1 -1
- package/dist/types/src/components/SyncStatus/Space.d.ts +2 -3
- package/dist/types/src/components/SyncStatus/Space.d.ts.map +1 -1
- package/dist/types/src/components/SyncStatus/SyncStatus.d.ts +3 -4
- package/dist/types/src/components/SyncStatus/SyncStatus.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +1 -0
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/events.d.ts +4 -0
- package/dist/types/src/events.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +1 -0
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +9 -0
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/collection.d.ts +2 -2
- package/dist/types/src/types/thread.d.ts +34 -34
- package/dist/types/src/types/types.d.ts +37 -12
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/src/util.d.ts +3 -2
- package/dist/types/src/util.d.ts.map +1 -1
- package/package.json +41 -38
- package/src/SpacePlugin.tsx +43 -15
- package/src/capabilities/app-graph-builder.ts +19 -92
- package/src/capabilities/capabilities.ts +7 -2
- package/src/capabilities/index.ts +1 -0
- package/src/capabilities/intent-resolver.ts +428 -312
- package/src/capabilities/react-surface.tsx +32 -56
- package/src/capabilities/schema.ts +27 -0
- package/src/capabilities/spaces-ready.ts +20 -21
- package/src/components/AwaitingObject.tsx +5 -5
- package/src/components/BaseObjectSettings.tsx +7 -0
- package/src/components/CreateDialog/CreateObjectDialog.stories.tsx +1 -3
- package/src/components/CreateDialog/CreateObjectDialog.tsx +42 -34
- package/src/components/CreateDialog/CreateObjectPanel.tsx +126 -129
- package/src/components/CreateDialog/CreateSpaceDialog.tsx +18 -9
- package/src/components/JoinDialog.tsx +27 -19
- package/src/components/PopoverAddSpace.tsx +46 -0
- package/src/components/SpacePluginSettings.tsx +3 -3
- package/src/components/SpacePresence.stories.tsx +2 -2
- package/src/components/SpacePresence.tsx +2 -3
- package/src/components/SpaceSettings/SpaceSettingsDialog.tsx +16 -1
- package/src/components/SpaceSettings/SpaceSettingsPanel.stories.tsx +5 -1
- package/src/components/SpaceSettings/SpaceSettingsPanel.tsx +30 -8
- package/src/components/SyncStatus/InlineSyncStatus.tsx +2 -2
- package/src/components/SyncStatus/SyncStatus.tsx +2 -1
- package/src/components/index.ts +1 -0
- package/src/events.ts +6 -0
- package/src/index.ts +1 -1
- package/src/meta.ts +1 -0
- package/src/translations.ts +3 -0
- package/src/types/types.ts +23 -4
- package/src/util.tsx +16 -6
- package/dist/lib/browser/app-graph-builder-F6XSETHX.mjs.map +0 -7
- package/dist/lib/browser/chunk-IZ7QKQ2E.mjs.map +0 -7
- package/dist/lib/browser/chunk-SSJ772GK.mjs.map +0 -7
- package/dist/lib/browser/chunk-T36CIHPG.mjs.map +0 -7
- package/dist/lib/browser/chunk-UH5P4UL3.mjs.map +0 -7
- package/dist/lib/browser/chunk-XXD33C4E.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-XRZYCXXX.mjs +0 -459
- package/dist/lib/browser/intent-resolver-XRZYCXXX.mjs.map +0 -7
- package/dist/lib/browser/react-surface-EGOL2JBL.mjs.map +0 -7
- package/dist/lib/browser/spaces-ready-WVU7US3C.mjs.map +0 -7
- package/dist/lib/node/app-graph-builder-GKLVZ4PM.cjs.map +0 -7
- package/dist/lib/node/chunk-56NGXG2A.cjs.map +0 -7
- package/dist/lib/node/chunk-5D4RWKTV.cjs.map +0 -7
- package/dist/lib/node/chunk-AJRP7AD6.cjs.map +0 -7
- package/dist/lib/node/chunk-UENH2YBM.cjs.map +0 -7
- package/dist/lib/node/chunk-YCBBGTFD.cjs.map +0 -7
- package/dist/lib/node/intent-resolver-3NI6AUAI.cjs +0 -458
- package/dist/lib/node/intent-resolver-3NI6AUAI.cjs.map +0 -7
- package/dist/lib/node/react-surface-75KRPQYT.cjs.map +0 -7
- package/dist/lib/node/spaces-ready-ILVGUHJH.cjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-NEHQ5Z63.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-375RB3CZ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-5QMAPAZD.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-E5DWIQ3N.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-GVOPDPS2.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HTBGWQEU.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-P5EVBOGP.mjs +0 -460
- package/dist/lib/node-esm/intent-resolver-P5EVBOGP.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-7EVWCKIP.mjs.map +0 -7
- package/dist/lib/node-esm/spaces-ready-CH3W7OGN.mjs.map +0 -7
- /package/dist/lib/browser/{app-graph-serializer-FYJE23GN.mjs.map → app-graph-serializer-FOWFLYGU.mjs.map} +0 -0
- /package/dist/lib/browser/{identity-created-4Q4PFIC5.mjs.map → identity-created-FYGS6TBH.mjs.map} +0 -0
- /package/dist/lib/browser/{react-root-BDOPFJGJ.mjs.map → react-root-IP2ZB245.mjs.map} +0 -0
- /package/dist/lib/browser/{settings-WF67QZSD.mjs.map → settings-PHPCXX33.mjs.map} +0 -0
- /package/dist/lib/browser/{state-MS4KYJWI.mjs.map → state-INJ63O57.mjs.map} +0 -0
- /package/dist/lib/node/{app-graph-serializer-RMTU5YSC.cjs.map → app-graph-serializer-VQOGHKXL.cjs.map} +0 -0
- /package/dist/lib/node/{identity-created-QQWX7WX3.cjs.map → identity-created-AXI64BLE.cjs.map} +0 -0
- /package/dist/lib/node/{react-root-ZTR2J2I3.cjs.map → react-root-3OX5Z5CX.cjs.map} +0 -0
- /package/dist/lib/node/{settings-KOVSPA3S.cjs.map → settings-5QYFWNH7.cjs.map} +0 -0
- /package/dist/lib/node/{state-4UIOUKLJ.cjs.map → state-57UE3DYE.cjs.map} +0 -0
- /package/dist/lib/node-esm/{app-graph-serializer-UWWS5OVC.mjs.map → app-graph-serializer-GZRSWHEN.mjs.map} +0 -0
- /package/dist/lib/node-esm/{identity-created-HMNY2MPB.mjs.map → identity-created-3CGEXNPO.mjs.map} +0 -0
- /package/dist/lib/node-esm/{react-root-OUPJA4RY.mjs.map → react-root-7XXGP56B.mjs.map} +0 -0
- /package/dist/lib/node-esm/{settings-EDK6WI3V.mjs.map → settings-H6MXTEQM.mjs.map} +0 -0
- /package/dist/lib/node-esm/{state-BMISGQ2O.mjs.map → state-VYA6OFHD.mjs.map} +0 -0
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SpaceCapabilities
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-NU7WDVGN.mjs";
|
|
4
4
|
import {
|
|
5
5
|
COMPOSER_SPACE_LOCK,
|
|
6
6
|
getSpaceDisplayName
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-23RVI5FZ.mjs";
|
|
8
8
|
import {
|
|
9
9
|
CollectionType,
|
|
10
10
|
SpaceAction,
|
|
11
11
|
SpaceForm
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-ULA2UQJ4.mjs";
|
|
13
13
|
import {
|
|
14
14
|
SPACE_PLUGIN
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-PQXZCNAU.mjs";
|
|
16
16
|
|
|
17
17
|
// packages/plugins/plugin-space/src/components/AdvancedObjectSettings/AdvancedObjectSettings.tsx
|
|
18
18
|
import React2, { useCallback as useCallback2, useState } from "react";
|
|
@@ -111,7 +111,7 @@ var AdvancedObjectSettings = ({ object }) => {
|
|
|
111
111
|
// packages/plugins/plugin-space/src/components/AwaitingObject.tsx
|
|
112
112
|
import { CheckCircle, CircleDashed, CircleNotch } from "@phosphor-icons/react";
|
|
113
113
|
import React3, { useCallback as useCallback3, useEffect, useState as useState2 } from "react";
|
|
114
|
-
import {
|
|
114
|
+
import { createIntent, LayoutAction, useIntentDispatcher, useLayout } from "@dxos/app-framework";
|
|
115
115
|
import { useClient } from "@dxos/react-client";
|
|
116
116
|
import { Filter, fullyQualifiedId, useQuery } from "@dxos/react-client/echo";
|
|
117
117
|
import { Button, Toast, useTranslation as useTranslation3 } from "@dxos/react-ui";
|
|
@@ -124,7 +124,7 @@ var AwaitingObject = ({ id }) => {
|
|
|
124
124
|
const [found, setFound] = useState2(false);
|
|
125
125
|
const { t } = useTranslation3(SPACE_PLUGIN);
|
|
126
126
|
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
127
|
-
const
|
|
127
|
+
const layout = useLayout();
|
|
128
128
|
const client = useClient();
|
|
129
129
|
const objects = useQuery(client.spaces, Filter.all());
|
|
130
130
|
useEffect(() => {
|
|
@@ -141,14 +141,14 @@ var AwaitingObject = ({ id }) => {
|
|
|
141
141
|
useEffect(() => {
|
|
142
142
|
if (objects.findIndex((object) => fullyQualifiedId(object) === id) > -1) {
|
|
143
143
|
setFound(true);
|
|
144
|
-
if (
|
|
144
|
+
if (layout.active.includes(id)) {
|
|
145
145
|
setOpen(false);
|
|
146
146
|
}
|
|
147
147
|
}
|
|
148
148
|
}, [
|
|
149
149
|
id,
|
|
150
150
|
objects,
|
|
151
|
-
|
|
151
|
+
layout
|
|
152
152
|
]);
|
|
153
153
|
const handleClose = useCallback3(async () => dispatch(createIntent(SpaceAction.WaitForObject, {
|
|
154
154
|
id: void 0
|
|
@@ -156,12 +156,11 @@ var AwaitingObject = ({ id }) => {
|
|
|
156
156
|
dispatch
|
|
157
157
|
]);
|
|
158
158
|
const handleNavigate = useCallback3(() => {
|
|
159
|
-
void dispatch(createIntent(
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
}
|
|
159
|
+
void dispatch(createIntent(LayoutAction.Open, {
|
|
160
|
+
part: "main",
|
|
161
|
+
subject: [
|
|
162
|
+
id
|
|
163
|
+
]
|
|
165
164
|
}));
|
|
166
165
|
void handleClose();
|
|
167
166
|
}, [
|
|
@@ -207,14 +206,21 @@ import React4 from "react";
|
|
|
207
206
|
import { Input, useTranslation as useTranslation4 } from "@dxos/react-ui";
|
|
208
207
|
var BaseObjectSettings = ({ object }) => {
|
|
209
208
|
const { t } = useTranslation4(SPACE_PLUGIN);
|
|
209
|
+
const inputRef = React4.useRef(null);
|
|
210
210
|
return /* @__PURE__ */ React4.createElement("div", {
|
|
211
211
|
role: "form",
|
|
212
212
|
className: "flex flex-col w-full p-2 gap-1"
|
|
213
213
|
}, /* @__PURE__ */ React4.createElement(Input.Root, null, /* @__PURE__ */ React4.createElement(Input.Label, null, t("name label")), /* @__PURE__ */ React4.createElement(Input.TextInput, {
|
|
214
|
+
ref: inputRef,
|
|
214
215
|
placeholder: t("name placeholder"),
|
|
215
216
|
value: object.name ?? "",
|
|
216
217
|
onChange: (event) => {
|
|
217
218
|
object.name = event.target.value;
|
|
219
|
+
},
|
|
220
|
+
onKeyDown: (event) => {
|
|
221
|
+
if (event.key === "Enter") {
|
|
222
|
+
inputRef.current?.blur();
|
|
223
|
+
}
|
|
218
224
|
}
|
|
219
225
|
})));
|
|
220
226
|
};
|
|
@@ -222,20 +228,23 @@ var BaseObjectSettings = ({ object }) => {
|
|
|
222
228
|
// packages/plugins/plugin-space/src/components/CreateDialog/CreateObjectDialog.tsx
|
|
223
229
|
import { pipe } from "effect";
|
|
224
230
|
import React6, { useCallback as useCallback5, useRef } from "react";
|
|
225
|
-
import { chain, createIntent as createIntent2,
|
|
231
|
+
import { Capabilities, chain, createIntent as createIntent2, LayoutAction as LayoutAction2, useCapabilities, useIntentDispatcher as useIntentDispatcher2, usePluginManager as usePluginManager2 } from "@dxos/app-framework";
|
|
232
|
+
import { invariant as invariant2 } from "@dxos/invariant";
|
|
226
233
|
import { useClient as useClient2 } from "@dxos/react-client";
|
|
227
|
-
import { getSpace, isReactiveObject, isSpace
|
|
234
|
+
import { getSpace, isReactiveObject, isSpace, useSpaces } from "@dxos/react-client/echo";
|
|
228
235
|
import { Button as Button2, Dialog, Icon as Icon2, useTranslation as useTranslation6 } from "@dxos/react-ui";
|
|
229
236
|
|
|
230
237
|
// packages/plugins/plugin-space/src/components/CreateDialog/CreateObjectPanel.tsx
|
|
231
|
-
import React5, { useCallback as useCallback4,
|
|
238
|
+
import React5, { useCallback as useCallback4, useState as useState3 } from "react";
|
|
232
239
|
import { Surface, isSurfaceAvailable, usePluginManager } from "@dxos/app-framework";
|
|
233
|
-
import { getObjectAnnotation
|
|
234
|
-
import {
|
|
235
|
-
import { Icon,
|
|
236
|
-
import { Form as Form2
|
|
240
|
+
import { getObjectAnnotation } from "@dxos/echo-schema";
|
|
241
|
+
import { invariant } from "@dxos/invariant";
|
|
242
|
+
import { Icon, toLocalizedString, useTranslation as useTranslation5 } from "@dxos/react-ui";
|
|
243
|
+
import { Form as Form2 } from "@dxos/react-ui-form";
|
|
237
244
|
import { SearchList } from "@dxos/react-ui-searchlist";
|
|
238
|
-
import {
|
|
245
|
+
import { mx as mx2 } from "@dxos/react-ui-theme";
|
|
246
|
+
import { isNonNullable } from "@dxos/util";
|
|
247
|
+
var __dxlog_file = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/CreateDialog/CreateObjectPanel.tsx";
|
|
239
248
|
var useInputSurfaceLookup = (baseData) => {
|
|
240
249
|
const pluginManager = usePluginManager();
|
|
241
250
|
return useCallback4(({ prop, schema, inputProps }) => {
|
|
@@ -260,38 +269,122 @@ var useInputSurfaceLookup = (baseData) => {
|
|
|
260
269
|
baseData
|
|
261
270
|
]);
|
|
262
271
|
};
|
|
263
|
-
var CreateObjectPanel = ({
|
|
272
|
+
var CreateObjectPanel = ({ classNames, forms, spaces, typename: initialTypename, target: initialTarget, name: initialName, defaultSpaceId, resolve, onCreateObject }) => {
|
|
264
273
|
const { t } = useTranslation5(SPACE_PLUGIN);
|
|
265
274
|
const [typename, setTypename] = useState3(initialTypename);
|
|
266
275
|
const [target, setTarget] = useState3(initialTarget);
|
|
267
|
-
const
|
|
268
|
-
const options =
|
|
269
|
-
|
|
270
|
-
|
|
276
|
+
const form = forms.find((form2) => getObjectAnnotation(form2.objectSchema)?.typename === typename);
|
|
277
|
+
const options = forms.map((form2) => getObjectAnnotation(form2.objectSchema)).filter(isNonNullable).sort((a, b) => {
|
|
278
|
+
const nameA = t("typename label", {
|
|
279
|
+
ns: a.typename,
|
|
280
|
+
defaultValue: a.typename
|
|
281
|
+
});
|
|
282
|
+
const nameB = t("typename label", {
|
|
283
|
+
ns: b.typename,
|
|
284
|
+
defaultValue: b.typename
|
|
285
|
+
});
|
|
286
|
+
return nameA.localeCompare(nameB);
|
|
287
|
+
});
|
|
271
288
|
const handleCreateObject = useCallback4(async (props) => {
|
|
272
|
-
if (!
|
|
289
|
+
if (!form || !target) {
|
|
273
290
|
return;
|
|
274
291
|
}
|
|
275
292
|
await onCreateObject?.({
|
|
276
|
-
|
|
293
|
+
form,
|
|
277
294
|
target,
|
|
278
295
|
data: props
|
|
279
296
|
});
|
|
280
297
|
}, [
|
|
281
298
|
onCreateObject,
|
|
282
|
-
|
|
299
|
+
form,
|
|
283
300
|
target
|
|
284
301
|
]);
|
|
285
|
-
const
|
|
286
|
-
|
|
287
|
-
|
|
302
|
+
const handleSetTypename = useCallback4(async (typename2) => {
|
|
303
|
+
invariant(target, "target is required", {
|
|
304
|
+
F: __dxlog_file,
|
|
305
|
+
L: 94,
|
|
306
|
+
S: void 0,
|
|
307
|
+
A: [
|
|
308
|
+
"target",
|
|
309
|
+
"'target is required'"
|
|
310
|
+
]
|
|
311
|
+
});
|
|
312
|
+
const form2 = forms.find((form3) => getObjectAnnotation(form3.objectSchema)?.typename === typename2);
|
|
313
|
+
if (form2 && !form2.formSchema) {
|
|
314
|
+
await onCreateObject?.({
|
|
315
|
+
form: form2,
|
|
316
|
+
target
|
|
317
|
+
});
|
|
318
|
+
} else {
|
|
319
|
+
setTypename(typename2);
|
|
288
320
|
}
|
|
289
|
-
return resolve?.(typename);
|
|
290
321
|
}, [
|
|
291
|
-
|
|
292
|
-
|
|
322
|
+
forms,
|
|
323
|
+
onCreateObject,
|
|
324
|
+
target
|
|
293
325
|
]);
|
|
294
|
-
const
|
|
326
|
+
const inputSurfaceLookup = useInputSurfaceLookup({
|
|
327
|
+
target
|
|
328
|
+
});
|
|
329
|
+
return /* @__PURE__ */ React5.createElement("div", {
|
|
330
|
+
role: "form",
|
|
331
|
+
className: mx2("flex flex-col gap-2", classNames)
|
|
332
|
+
}, !form ? /* @__PURE__ */ React5.createElement(SelectSchema, {
|
|
333
|
+
options,
|
|
334
|
+
resolve,
|
|
335
|
+
onChange: handleSetTypename
|
|
336
|
+
}) : !target ? /* @__PURE__ */ React5.createElement(SelectSpace, {
|
|
337
|
+
spaces,
|
|
338
|
+
defaultSpaceId,
|
|
339
|
+
onChange: setTarget
|
|
340
|
+
}) : form.formSchema ? /* @__PURE__ */ React5.createElement(Form2, {
|
|
341
|
+
classNames: "!p-0",
|
|
342
|
+
autoFocus: true,
|
|
343
|
+
values: {
|
|
344
|
+
name: initialName
|
|
345
|
+
},
|
|
346
|
+
schema: form.formSchema,
|
|
347
|
+
testId: "create-object-form",
|
|
348
|
+
onSave: handleCreateObject,
|
|
349
|
+
lookupComponent: inputSurfaceLookup
|
|
350
|
+
}) : void 0);
|
|
351
|
+
};
|
|
352
|
+
var SelectSpace = ({ spaces, defaultSpaceId, onChange }) => {
|
|
353
|
+
const { t } = useTranslation5(SPACE_PLUGIN);
|
|
354
|
+
return /* @__PURE__ */ React5.createElement(SearchList.Root, {
|
|
355
|
+
label: t("space input label"),
|
|
356
|
+
classNames: "flex flex-col grow overflow-hidden"
|
|
357
|
+
}, /* @__PURE__ */ React5.createElement(SearchList.Input, {
|
|
358
|
+
autoFocus: true,
|
|
359
|
+
"data-testid": "create-object-form.space-input",
|
|
360
|
+
placeholder: t("space input placeholder"),
|
|
361
|
+
classNames: "px-1 my-2"
|
|
362
|
+
}), /* @__PURE__ */ React5.createElement(SearchList.Content, {
|
|
363
|
+
classNames: "max-bs-[24rem] overflow-auto"
|
|
364
|
+
}, spaces.sort((a, b) => {
|
|
365
|
+
const aName = toLocalizedString(getSpaceDisplayName(a, {
|
|
366
|
+
personal: a.id === defaultSpaceId
|
|
367
|
+
}), t);
|
|
368
|
+
const bName = toLocalizedString(getSpaceDisplayName(b, {
|
|
369
|
+
personal: b.id === defaultSpaceId
|
|
370
|
+
}), t);
|
|
371
|
+
return aName.localeCompare(bName);
|
|
372
|
+
}).map((space) => /* @__PURE__ */ React5.createElement(SearchList.Item, {
|
|
373
|
+
key: space.id,
|
|
374
|
+
value: toLocalizedString(getSpaceDisplayName(space, {
|
|
375
|
+
personal: space.id === defaultSpaceId
|
|
376
|
+
}), t),
|
|
377
|
+
onSelect: () => onChange(space),
|
|
378
|
+
classNames: "flex items-center gap-2"
|
|
379
|
+
}, /* @__PURE__ */ React5.createElement("span", {
|
|
380
|
+
className: "grow truncate"
|
|
381
|
+
}, toLocalizedString(getSpaceDisplayName(space, {
|
|
382
|
+
personal: space.id === defaultSpaceId
|
|
383
|
+
}), t))))));
|
|
384
|
+
};
|
|
385
|
+
var SelectSchema = ({ options, resolve, onChange }) => {
|
|
386
|
+
const { t } = useTranslation5(SPACE_PLUGIN);
|
|
387
|
+
return /* @__PURE__ */ React5.createElement(SearchList.Root, {
|
|
295
388
|
label: t("schema input label"),
|
|
296
389
|
classNames: "flex flex-col grow overflow-hidden"
|
|
297
390
|
}, /* @__PURE__ */ React5.createElement(SearchList.Input, {
|
|
@@ -307,7 +400,7 @@ var CreateObjectPanel = ({ schemas, spaces, typename: initialTypename, target: i
|
|
|
307
400
|
ns: option.typename,
|
|
308
401
|
defaultValue: option.typename
|
|
309
402
|
}),
|
|
310
|
-
onSelect: () =>
|
|
403
|
+
onSelect: () => onChange(option.typename),
|
|
311
404
|
classNames: "flex items-center gap-2"
|
|
312
405
|
}, /* @__PURE__ */ React5.createElement("span", {
|
|
313
406
|
className: "flex gap-2 items-center grow truncate"
|
|
@@ -318,104 +411,52 @@ var CreateObjectPanel = ({ schemas, spaces, typename: initialTypename, target: i
|
|
|
318
411
|
ns: option.typename,
|
|
319
412
|
defaultValue: option.typename
|
|
320
413
|
}))))));
|
|
321
|
-
const spaceInput = /* @__PURE__ */ React5.createElement(SearchList.Root, {
|
|
322
|
-
label: t("space input label"),
|
|
323
|
-
classNames: "flex flex-col grow overflow-hidden"
|
|
324
|
-
}, /* @__PURE__ */ React5.createElement(SearchList.Input, {
|
|
325
|
-
autoFocus: true,
|
|
326
|
-
"data-testid": "create-object-form.space-input",
|
|
327
|
-
placeholder: t("space input placeholder"),
|
|
328
|
-
classNames: "px-1 my-2"
|
|
329
|
-
}), /* @__PURE__ */ React5.createElement(SearchList.Content, {
|
|
330
|
-
classNames: "max-bs-[24rem] overflow-auto"
|
|
331
|
-
}, spaces.map((space) => /* @__PURE__ */ React5.createElement(SearchList.Item, {
|
|
332
|
-
key: space.id,
|
|
333
|
-
value: toLocalizedString(getSpaceDisplayName(space, {
|
|
334
|
-
personal: space.id === defaultSpaceId
|
|
335
|
-
}), t),
|
|
336
|
-
onSelect: () => setTarget(space),
|
|
337
|
-
classNames: "flex items-center gap-2"
|
|
338
|
-
}, /* @__PURE__ */ React5.createElement("span", {
|
|
339
|
-
className: "grow truncate"
|
|
340
|
-
}, toLocalizedString(getSpaceDisplayName(space, {
|
|
341
|
-
personal: space.id === defaultSpaceId
|
|
342
|
-
}), t))))));
|
|
343
|
-
const inputSurfaceLookup = useInputSurfaceLookup({
|
|
344
|
-
target
|
|
345
|
-
});
|
|
346
|
-
const form = useMemo(() => {
|
|
347
|
-
const schema2 = metadata?.creationSchema ?? S.Struct({
|
|
348
|
-
name: S.optional(S.String)
|
|
349
|
-
});
|
|
350
|
-
return /* @__PURE__ */ React5.createElement(Form2, {
|
|
351
|
-
autoFocus: true,
|
|
352
|
-
values: {
|
|
353
|
-
name: initialName
|
|
354
|
-
},
|
|
355
|
-
schema: schema2,
|
|
356
|
-
testId: "create-object-form",
|
|
357
|
-
onSave: handleCreateObject,
|
|
358
|
-
lookupComponent: inputSurfaceLookup
|
|
359
|
-
});
|
|
360
|
-
}, [
|
|
361
|
-
initialName,
|
|
362
|
-
handleCreateObject,
|
|
363
|
-
metadata
|
|
364
|
-
]);
|
|
365
|
-
return /* @__PURE__ */ React5.createElement("div", {
|
|
366
|
-
role: "form",
|
|
367
|
-
className: "flex flex-col gap-2"
|
|
368
|
-
}, target && /* @__PURE__ */ React5.createElement("div", {
|
|
369
|
-
role: "none"
|
|
370
|
-
}, /* @__PURE__ */ React5.createElement(Input2.Root, null, /* @__PURE__ */ React5.createElement(InputHeader, null, /* @__PURE__ */ React5.createElement(Input2.Label, null, t(isSpace(target) ? "creating in space label" : "creating in collection label"))), /* @__PURE__ */ React5.createElement("div", {
|
|
371
|
-
role: "none",
|
|
372
|
-
className: "flex gap-2"
|
|
373
|
-
}, /* @__PURE__ */ React5.createElement(Input2.TextInput, {
|
|
374
|
-
disabled: true,
|
|
375
|
-
value: isSpace(target) ? toLocalizedString(getSpaceDisplayName(target, {
|
|
376
|
-
personal: target.id === defaultSpaceId
|
|
377
|
-
}), t) : target.name || t("unnamed collection label")
|
|
378
|
-
}), /* @__PURE__ */ React5.createElement(IconButton3, {
|
|
379
|
-
iconOnly: true,
|
|
380
|
-
icon: "ph--x--regular",
|
|
381
|
-
label: t("clear input label"),
|
|
382
|
-
onClick: handleClearTarget
|
|
383
|
-
})))), schema && /* @__PURE__ */ React5.createElement("div", {
|
|
384
|
-
role: "none"
|
|
385
|
-
}, /* @__PURE__ */ React5.createElement(Input2.Root, null, /* @__PURE__ */ React5.createElement(InputHeader, null, /* @__PURE__ */ React5.createElement(Input2.Label, null, t("creating object type label"))), /* @__PURE__ */ React5.createElement("div", {
|
|
386
|
-
role: "none",
|
|
387
|
-
className: "flex gap-2"
|
|
388
|
-
}, /* @__PURE__ */ React5.createElement(Input2.TextInput, {
|
|
389
|
-
disabled: true,
|
|
390
|
-
value: t("typename label", {
|
|
391
|
-
ns: schema.typename,
|
|
392
|
-
defaultValue: schema.typename
|
|
393
|
-
})
|
|
394
|
-
}), /* @__PURE__ */ React5.createElement(IconButton3, {
|
|
395
|
-
iconOnly: true,
|
|
396
|
-
icon: "ph--x--regular",
|
|
397
|
-
label: t("clear input label"),
|
|
398
|
-
onClick: handleClearSchema
|
|
399
|
-
})))), !schema ? schemaInput : !target ? spaceInput : form);
|
|
400
414
|
};
|
|
401
415
|
|
|
416
|
+
// packages/plugins/plugin-space/src/capabilities/index.ts
|
|
417
|
+
import { lazy } from "@dxos/app-framework";
|
|
418
|
+
var AppGraphBuilder = lazy(() => import("./app-graph-builder-MGK5HWPZ.mjs"));
|
|
419
|
+
var AppGraphSerializer = lazy(() => import("./app-graph-serializer-FOWFLYGU.mjs"));
|
|
420
|
+
var IdentityCreated = lazy(() => import("./identity-created-FYGS6TBH.mjs"));
|
|
421
|
+
var IntentResolver = lazy(() => import("./intent-resolver-QVR4MSJV.mjs"));
|
|
422
|
+
var ReactRoot = lazy(() => import("./react-root-IP2ZB245.mjs"));
|
|
423
|
+
var ReactSurface = lazy(() => import("./react-surface-BT3EHB6V.mjs"));
|
|
424
|
+
var Schema = lazy(() => import("./schema-5W3DSY2E.mjs"));
|
|
425
|
+
var SpaceSettings = lazy(() => import("./settings-PHPCXX33.mjs"));
|
|
426
|
+
var SpaceState = lazy(() => import("./state-INJ63O57.mjs"));
|
|
427
|
+
var SpacesReady = lazy(() => import("./spaces-ready-K47RR7N2.mjs"));
|
|
428
|
+
|
|
402
429
|
// packages/plugins/plugin-space/src/components/CreateDialog/CreateObjectDialog.tsx
|
|
430
|
+
var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/CreateDialog/CreateObjectDialog.tsx";
|
|
403
431
|
var CREATE_OBJECT_DIALOG = `${SPACE_PLUGIN}/CreateObjectDialog`;
|
|
404
|
-
var CreateObjectDialog = ({
|
|
432
|
+
var CreateObjectDialog = ({ target, typename, name, shouldNavigate: _shouldNavigate }) => {
|
|
405
433
|
const closeRef = useRef(null);
|
|
434
|
+
const manager = usePluginManager2();
|
|
406
435
|
const { t } = useTranslation6(SPACE_PLUGIN);
|
|
407
436
|
const client = useClient2();
|
|
408
437
|
const spaces = useSpaces();
|
|
409
438
|
const { dispatchPromise: dispatch } = useIntentDispatcher2();
|
|
410
|
-
const
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
439
|
+
const forms = useCapabilities(SpaceCapabilities.ObjectForm);
|
|
440
|
+
const resolve = useCallback5((typename2) => manager.context.requestCapabilities(Capabilities.Metadata).find(({ id }) => id === typename2)?.metadata ?? {}, [
|
|
441
|
+
manager
|
|
442
|
+
]);
|
|
443
|
+
const handleCreateObject = useCallback5(async ({ form, target: _target, data = {} }) => {
|
|
444
|
+
const target2 = isSpace(_target) ? _target.properties[CollectionType.typename]?.target : _target;
|
|
445
|
+
if (!target2) {
|
|
414
446
|
return;
|
|
415
447
|
}
|
|
416
448
|
closeRef.current?.click();
|
|
417
|
-
const space =
|
|
418
|
-
|
|
449
|
+
const space = isSpace(target2) ? target2 : getSpace(target2);
|
|
450
|
+
invariant2(space, "Missing space", {
|
|
451
|
+
F: __dxlog_file2,
|
|
452
|
+
L: 75,
|
|
453
|
+
S: void 0,
|
|
454
|
+
A: [
|
|
455
|
+
"space",
|
|
456
|
+
"'Missing space'"
|
|
457
|
+
]
|
|
458
|
+
});
|
|
459
|
+
const result = await dispatch(form.getIntent(data, {
|
|
419
460
|
space
|
|
420
461
|
}));
|
|
421
462
|
const object = result.data?.object;
|
|
@@ -426,7 +467,9 @@ var CreateObjectDialog = ({ schemas, target, typename, name, shouldNavigate: _sh
|
|
|
426
467
|
});
|
|
427
468
|
const shouldNavigate = _shouldNavigate ?? (() => true);
|
|
428
469
|
if (shouldNavigate(object)) {
|
|
429
|
-
await dispatch(pipe(addObjectIntent, chain(
|
|
470
|
+
await dispatch(pipe(addObjectIntent, chain(LayoutAction2.Open, {
|
|
471
|
+
part: "main"
|
|
472
|
+
})));
|
|
430
473
|
} else {
|
|
431
474
|
await dispatch(addObjectIntent);
|
|
432
475
|
}
|
|
@@ -439,7 +482,7 @@ var CreateObjectDialog = ({ schemas, target, typename, name, shouldNavigate: _sh
|
|
|
439
482
|
// TODO(wittjosiah): The tablist dialog pattern is copied from @dxos/plugin-manager.
|
|
440
483
|
// Consider factoring it out to the tabs package.
|
|
441
484
|
/* @__PURE__ */ React6.createElement(Dialog.Content, {
|
|
442
|
-
classNames: "p-0 bs-content
|
|
485
|
+
classNames: "p-0 bs-content max-bs-full md:max-is-[40rem] overflow-hidden"
|
|
443
486
|
}, /* @__PURE__ */ React6.createElement("div", {
|
|
444
487
|
role: "none",
|
|
445
488
|
className: "flex justify-between pbs-2 pis-2 pie-2 @md:pbs-4 @md:pis-4 @md:pie-4"
|
|
@@ -453,10 +496,9 @@ var CreateObjectDialog = ({ schemas, target, typename, name, shouldNavigate: _sh
|
|
|
453
496
|
}, /* @__PURE__ */ React6.createElement(Icon2, {
|
|
454
497
|
icon: "ph--x--regular",
|
|
455
498
|
size: 4
|
|
456
|
-
})))), /* @__PURE__ */ React6.createElement(
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
schemas,
|
|
499
|
+
})))), /* @__PURE__ */ React6.createElement(CreateObjectPanel, {
|
|
500
|
+
classNames: "p-4",
|
|
501
|
+
forms,
|
|
460
502
|
spaces,
|
|
461
503
|
target,
|
|
462
504
|
typename,
|
|
@@ -464,13 +506,14 @@ var CreateObjectDialog = ({ schemas, target, typename, name, shouldNavigate: _sh
|
|
|
464
506
|
defaultSpaceId: client.spaces.default.id,
|
|
465
507
|
resolve,
|
|
466
508
|
onCreateObject: handleCreateObject
|
|
467
|
-
}))
|
|
509
|
+
}))
|
|
468
510
|
);
|
|
469
511
|
};
|
|
470
512
|
|
|
471
513
|
// packages/plugins/plugin-space/src/components/CreateDialog/CreateSpaceDialog.tsx
|
|
514
|
+
import { Effect } from "effect";
|
|
472
515
|
import React7, { useCallback as useCallback6, useRef as useRef2 } from "react";
|
|
473
|
-
import { createIntent as createIntent3, useIntentDispatcher as useIntentDispatcher3 } from "@dxos/app-framework";
|
|
516
|
+
import { createIntent as createIntent3, LayoutAction as LayoutAction3, useIntentDispatcher as useIntentDispatcher3 } from "@dxos/app-framework";
|
|
474
517
|
import { Button as Button3, Dialog as Dialog2, Icon as Icon3, useTranslation as useTranslation7 } from "@dxos/react-ui";
|
|
475
518
|
import { Form as Form3 } from "@dxos/react-ui-form";
|
|
476
519
|
var CREATE_SPACE_DIALOG = `${SPACE_PLUGIN}/CreateSpaceDialog`;
|
|
@@ -480,15 +523,19 @@ var initialValues2 = {
|
|
|
480
523
|
var CreateSpaceDialog = () => {
|
|
481
524
|
const closeRef = useRef2(null);
|
|
482
525
|
const { t } = useTranslation7(SPACE_PLUGIN);
|
|
483
|
-
const {
|
|
526
|
+
const { dispatch } = useIntentDispatcher3();
|
|
484
527
|
const handleCreateSpace = useCallback6(async (data) => {
|
|
485
|
-
const
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
528
|
+
const program = Effect.gen(function* () {
|
|
529
|
+
const { space } = yield* dispatch(createIntent3(SpaceAction.Create, data));
|
|
530
|
+
yield* dispatch(createIntent3(LayoutAction3.SwitchWorkspace, {
|
|
531
|
+
part: "workspace",
|
|
532
|
+
subject: space.id
|
|
490
533
|
}));
|
|
491
|
-
|
|
534
|
+
yield* dispatch(createIntent3(SpaceAction.OpenCreateObject, {
|
|
535
|
+
target: space
|
|
536
|
+
}));
|
|
537
|
+
});
|
|
538
|
+
await Effect.runPromise(program);
|
|
492
539
|
}, [
|
|
493
540
|
dispatch
|
|
494
541
|
]);
|
|
@@ -496,7 +543,7 @@ var CreateSpaceDialog = () => {
|
|
|
496
543
|
// TODO(wittjosiah): The tablist dialog pattern is copied from @dxos/plugin-manager.
|
|
497
544
|
// Consider factoring it out to the tabs package.
|
|
498
545
|
/* @__PURE__ */ React7.createElement(Dialog2.Content, {
|
|
499
|
-
classNames: "p-0 bs-content min-bs-[
|
|
546
|
+
classNames: "p-0 bs-content min-bs-[16rem] max-bs-full md:max-is-[32rem] overflow-hidden"
|
|
500
547
|
}, /* @__PURE__ */ React7.createElement("div", {
|
|
501
548
|
role: "none",
|
|
502
549
|
className: "flex justify-between pbs-2 pis-2 pie-2 @md:pbs-4 @md:pis-4 @md:pie-4"
|
|
@@ -514,6 +561,8 @@ var CreateSpaceDialog = () => {
|
|
|
514
561
|
className: "p-4"
|
|
515
562
|
}, /* @__PURE__ */ React7.createElement(Form3, {
|
|
516
563
|
testId: "create-space-form",
|
|
564
|
+
classNames: "!p-0",
|
|
565
|
+
autoFocus: true,
|
|
517
566
|
values: initialValues2,
|
|
518
567
|
schema: SpaceForm,
|
|
519
568
|
onSave: handleCreateSpace
|
|
@@ -524,16 +573,16 @@ var CreateSpaceDialog = () => {
|
|
|
524
573
|
// packages/plugins/plugin-space/src/components/CollectionMain.tsx
|
|
525
574
|
import React8 from "react";
|
|
526
575
|
import { useTranslation as useTranslation8 } from "@dxos/react-ui";
|
|
527
|
-
import { baseSurface, descriptionText, mx as
|
|
576
|
+
import { baseSurface, descriptionText, mx as mx3 } from "@dxos/react-ui-theme";
|
|
528
577
|
var CollectionMain = ({ collection }) => {
|
|
529
578
|
const { t } = useTranslation8(SPACE_PLUGIN);
|
|
530
579
|
return /* @__PURE__ */ React8.createElement("div", {
|
|
531
580
|
role: "none",
|
|
532
|
-
className:
|
|
581
|
+
className: mx3(baseSurface, "min-bs-screen is-full flex items-center justify-center p-8"),
|
|
533
582
|
"data-testid": "composer.firstRunMessage"
|
|
534
583
|
}, /* @__PURE__ */ React8.createElement("p", {
|
|
535
584
|
role: "alert",
|
|
536
|
-
className:
|
|
585
|
+
className: mx3(descriptionText, "border border-dashed border-neutral-400/50 rounded-lg p-8 font-normal text-lg max-is-[24rem] break-words")
|
|
537
586
|
}, collection.name ?? t("unnamed collection label")));
|
|
538
587
|
};
|
|
539
588
|
|
|
@@ -551,37 +600,62 @@ var CollectionSection = ({ collection }) => {
|
|
|
551
600
|
|
|
552
601
|
// packages/plugins/plugin-space/src/components/JoinDialog.tsx
|
|
553
602
|
import React10, { useCallback as useCallback7 } from "react";
|
|
554
|
-
import { createIntent as createIntent4, LayoutAction
|
|
555
|
-
import {
|
|
603
|
+
import { createIntent as createIntent4, LayoutAction as LayoutAction4, useAppGraph, useIntentDispatcher as useIntentDispatcher4 } from "@dxos/app-framework";
|
|
604
|
+
import { log } from "@dxos/log";
|
|
556
605
|
import { ObservabilityAction } from "@dxos/plugin-observability/types";
|
|
557
|
-
import {
|
|
558
|
-
import { Dialog as Dialog3
|
|
606
|
+
import { useClient as useClient3 } from "@dxos/react-client";
|
|
607
|
+
import { Dialog as Dialog3 } from "@dxos/react-ui";
|
|
559
608
|
import { JoinPanel } from "@dxos/shell/react";
|
|
609
|
+
var __dxlog_file3 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/JoinDialog.tsx";
|
|
560
610
|
var JOIN_DIALOG = `${SPACE_PLUGIN}/JoinDialog`;
|
|
561
611
|
var JoinDialog = ({ navigableCollections, onDone, ...props }) => {
|
|
562
|
-
const { t } = useTranslation10(SPACE_PLUGIN);
|
|
563
612
|
const { dispatchPromise: dispatch } = useIntentDispatcher4();
|
|
564
|
-
const
|
|
565
|
-
const { graph } =
|
|
613
|
+
const client = useClient3();
|
|
614
|
+
const { graph } = useAppGraph();
|
|
566
615
|
const handleDone = useCallback7(async (result) => {
|
|
567
616
|
if (result?.spaceKey) {
|
|
568
617
|
await Promise.all([
|
|
569
|
-
dispatch(createIntent4(
|
|
570
|
-
|
|
618
|
+
dispatch(createIntent4(LayoutAction4.AddToast, {
|
|
619
|
+
part: "toast",
|
|
571
620
|
subject: {
|
|
572
621
|
id: `${SPACE_PLUGIN}/join-success`,
|
|
573
622
|
duration: 5e3,
|
|
574
|
-
title:
|
|
575
|
-
|
|
623
|
+
title: [
|
|
624
|
+
"join success label",
|
|
625
|
+
{
|
|
626
|
+
ns: SPACE_PLUGIN
|
|
627
|
+
}
|
|
628
|
+
],
|
|
629
|
+
closeLabel: [
|
|
630
|
+
"dismiss label",
|
|
631
|
+
{
|
|
632
|
+
ns: SPACE_PLUGIN
|
|
633
|
+
}
|
|
634
|
+
]
|
|
576
635
|
}
|
|
577
636
|
})),
|
|
578
|
-
dispatch(createIntent4(
|
|
579
|
-
|
|
580
|
-
|
|
637
|
+
dispatch(createIntent4(LayoutAction4.UpdateDialog, {
|
|
638
|
+
part: "dialog",
|
|
639
|
+
options: {
|
|
640
|
+
state: false
|
|
641
|
+
}
|
|
581
642
|
}))
|
|
582
643
|
]);
|
|
583
644
|
}
|
|
584
|
-
const space = spaces.
|
|
645
|
+
const space = result?.spaceKey ? client.spaces.get(result.spaceKey) : void 0;
|
|
646
|
+
if (!space) {
|
|
647
|
+
log.warn("Space not found", result?.spaceKey, {
|
|
648
|
+
F: __dxlog_file3,
|
|
649
|
+
L: 56,
|
|
650
|
+
S: void 0,
|
|
651
|
+
C: (f, a) => f(...a)
|
|
652
|
+
});
|
|
653
|
+
return;
|
|
654
|
+
}
|
|
655
|
+
await dispatch(createIntent4(LayoutAction4.SwitchWorkspace, {
|
|
656
|
+
part: "workspace",
|
|
657
|
+
subject: space.id
|
|
658
|
+
}));
|
|
585
659
|
const target = result?.target || (navigableCollections ? space?.id : void 0);
|
|
586
660
|
if (target) {
|
|
587
661
|
await graph.waitForPath({
|
|
@@ -589,15 +663,15 @@ var JoinDialog = ({ navigableCollections, onDone, ...props }) => {
|
|
|
589
663
|
}).catch(() => {
|
|
590
664
|
});
|
|
591
665
|
await Promise.all([
|
|
592
|
-
dispatch(createIntent4(
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
}
|
|
666
|
+
dispatch(createIntent4(LayoutAction4.Open, {
|
|
667
|
+
part: "main",
|
|
668
|
+
subject: [
|
|
669
|
+
target
|
|
670
|
+
]
|
|
598
671
|
})),
|
|
599
|
-
dispatch(createIntent4(
|
|
600
|
-
|
|
672
|
+
dispatch(createIntent4(LayoutAction4.Expose, {
|
|
673
|
+
part: "navigation",
|
|
674
|
+
subject: target
|
|
601
675
|
}))
|
|
602
676
|
]);
|
|
603
677
|
}
|
|
@@ -612,7 +686,8 @@ var JoinDialog = ({ navigableCollections, onDone, ...props }) => {
|
|
|
612
686
|
}
|
|
613
687
|
}, [
|
|
614
688
|
dispatch,
|
|
615
|
-
|
|
689
|
+
client,
|
|
690
|
+
graph
|
|
616
691
|
]);
|
|
617
692
|
return /* @__PURE__ */ React10.createElement(Dialog3.Content, null, /* @__PURE__ */ React10.createElement(JoinPanel, {
|
|
618
693
|
...props,
|
|
@@ -630,11 +705,11 @@ var JoinDialog = ({ navigableCollections, onDone, ...props }) => {
|
|
|
630
705
|
import { Planet } from "@phosphor-icons/react";
|
|
631
706
|
import React11 from "react";
|
|
632
707
|
import { getSpace as getSpace2 } from "@dxos/client/echo";
|
|
633
|
-
import { useClient as
|
|
634
|
-
import { DropdownMenu, toLocalizedString as toLocalizedString2, useTranslation as
|
|
708
|
+
import { useClient as useClient4 } from "@dxos/react-client";
|
|
709
|
+
import { DropdownMenu, toLocalizedString as toLocalizedString2, useTranslation as useTranslation10 } from "@dxos/react-ui";
|
|
635
710
|
var MenuFooter = ({ object }) => {
|
|
636
|
-
const { t } =
|
|
637
|
-
const client =
|
|
711
|
+
const { t } = useTranslation10(SPACE_PLUGIN);
|
|
712
|
+
const client = useClient4();
|
|
638
713
|
const space = getSpace2(object);
|
|
639
714
|
const spaceName = space ? getSpaceDisplayName(space, {
|
|
640
715
|
personal: client.spaces.default === space
|
|
@@ -654,8 +729,8 @@ var MenuFooter = ({ object }) => {
|
|
|
654
729
|
import { ArrowsCounterClockwise, CheckCircle as CheckCircle2, Warning } from "@phosphor-icons/react";
|
|
655
730
|
import React12, { useEffect as useEffect2, useState as useState4 } from "react";
|
|
656
731
|
import { debounce } from "@dxos/async";
|
|
657
|
-
import { Tooltip, useTranslation as
|
|
658
|
-
import { getSize as getSize2, mx as
|
|
732
|
+
import { Tooltip, useTranslation as useTranslation11 } from "@dxos/react-ui";
|
|
733
|
+
import { getSize as getSize2, mx as mx4, staticPlaceholderText, warningText } from "@dxos/react-ui-theme";
|
|
659
734
|
var Status;
|
|
660
735
|
(function(Status2) {
|
|
661
736
|
Status2[Status2["PERSISTED_LOCALLY"] = 0] = "PERSISTED_LOCALLY";
|
|
@@ -663,7 +738,7 @@ var Status;
|
|
|
663
738
|
Status2[Status2["ERROR"] = 2] = "ERROR";
|
|
664
739
|
})(Status || (Status = {}));
|
|
665
740
|
var PersistenceStatus = ({ db }) => {
|
|
666
|
-
const { t } =
|
|
741
|
+
const { t } = useTranslation11(SPACE_PLUGIN);
|
|
667
742
|
const [displayMessage, setDisplayMessage] = useState4(false);
|
|
668
743
|
const [status, naturalSetStatus] = useState4(0);
|
|
669
744
|
const [prevStatus, setPrevStatus] = useState4(0);
|
|
@@ -683,17 +758,17 @@ var PersistenceStatus = ({ db }) => {
|
|
|
683
758
|
return /* @__PURE__ */ React12.createElement("div", {
|
|
684
759
|
className: "flex items-center"
|
|
685
760
|
}, /* @__PURE__ */ React12.createElement(Warning, {
|
|
686
|
-
className:
|
|
761
|
+
className: mx4(getSize2(4), "me-1")
|
|
687
762
|
}), /* @__PURE__ */ React12.createElement("span", {
|
|
688
|
-
className:
|
|
763
|
+
className: mx4("text-sm", warningText)
|
|
689
764
|
}, t("persistence error label")));
|
|
690
765
|
case 1:
|
|
691
766
|
return /* @__PURE__ */ React12.createElement("div", {
|
|
692
767
|
className: "flex items-center"
|
|
693
768
|
}, /* @__PURE__ */ React12.createElement(ArrowsCounterClockwise, {
|
|
694
|
-
className:
|
|
769
|
+
className: mx4(getSize2(4), "me-1")
|
|
695
770
|
}), /* @__PURE__ */ React12.createElement("span", {
|
|
696
|
-
className:
|
|
771
|
+
className: mx4("text-sm", staticPlaceholderText)
|
|
697
772
|
}, t("persistence pending label")));
|
|
698
773
|
case 0:
|
|
699
774
|
default:
|
|
@@ -703,18 +778,62 @@ var PersistenceStatus = ({ db }) => {
|
|
|
703
778
|
role: "status",
|
|
704
779
|
className: "flex items-center"
|
|
705
780
|
}, /* @__PURE__ */ React12.createElement(CheckCircle2, {
|
|
706
|
-
className:
|
|
781
|
+
className: mx4(getSize2(4), "me-1")
|
|
707
782
|
}), displayMessage && /* @__PURE__ */ React12.createElement("span", {
|
|
708
|
-
className:
|
|
783
|
+
className: mx4("text-sm", staticPlaceholderText)
|
|
709
784
|
}, t("persisted locally label"))), /* @__PURE__ */ React12.createElement(Tooltip.Portal, null, /* @__PURE__ */ React12.createElement(Tooltip.Content, null, t("persisted locally message"), /* @__PURE__ */ React12.createElement(Tooltip.Arrow, null))));
|
|
710
785
|
}
|
|
711
786
|
};
|
|
712
787
|
|
|
788
|
+
// packages/plugins/plugin-space/src/components/PopoverAddSpace.tsx
|
|
789
|
+
import React13 from "react";
|
|
790
|
+
import { createIntent as createIntent5, LayoutAction as LayoutAction5, useIntentDispatcher as useIntentDispatcher5 } from "@dxos/app-framework";
|
|
791
|
+
import { IconButton as IconButton3, useTranslation as useTranslation12 } from "@dxos/react-ui";
|
|
792
|
+
var POPOVER_ADD_SPACE = `${SPACE_PLUGIN}/PopoverRenameSpace`;
|
|
793
|
+
var PopoverAddSpace = () => {
|
|
794
|
+
const { t } = useTranslation12(SPACE_PLUGIN);
|
|
795
|
+
const { dispatchPromise: dispatch } = useIntentDispatcher5();
|
|
796
|
+
return /* @__PURE__ */ React13.createElement("div", {
|
|
797
|
+
role: "none",
|
|
798
|
+
className: "grid grid-cols-1 gap-1 [&>button]:justify-start"
|
|
799
|
+
}, /* @__PURE__ */ React13.createElement(IconButton3, {
|
|
800
|
+
variant: "ghost",
|
|
801
|
+
label: t("create space label"),
|
|
802
|
+
icon: "ph--plus--regular",
|
|
803
|
+
onClick: () => {
|
|
804
|
+
void dispatch(createIntent5(SpaceAction.OpenCreateSpace));
|
|
805
|
+
void dispatch(createIntent5(LayoutAction5.UpdatePopover, {
|
|
806
|
+
part: "popover",
|
|
807
|
+
options: {
|
|
808
|
+
anchorId: "",
|
|
809
|
+
state: false
|
|
810
|
+
}
|
|
811
|
+
}));
|
|
812
|
+
},
|
|
813
|
+
"data-testid": "spacePlugin.createSpace"
|
|
814
|
+
}), /* @__PURE__ */ React13.createElement(IconButton3, {
|
|
815
|
+
variant: "ghost",
|
|
816
|
+
label: t("join space label"),
|
|
817
|
+
icon: "ph--sign-in--regular",
|
|
818
|
+
onClick: () => {
|
|
819
|
+
void dispatch(createIntent5(SpaceAction.Join));
|
|
820
|
+
void dispatch(createIntent5(LayoutAction5.UpdatePopover, {
|
|
821
|
+
part: "popover",
|
|
822
|
+
options: {
|
|
823
|
+
anchorId: "",
|
|
824
|
+
state: false
|
|
825
|
+
}
|
|
826
|
+
}));
|
|
827
|
+
},
|
|
828
|
+
"data-testid": "spacePlugin.joinSpace"
|
|
829
|
+
}));
|
|
830
|
+
};
|
|
831
|
+
|
|
713
832
|
// packages/plugins/plugin-space/src/components/PopoverRenameObject.tsx
|
|
714
|
-
import
|
|
715
|
-
import { log } from "@dxos/log";
|
|
716
|
-
import { Button as Button4, Input as
|
|
717
|
-
var
|
|
833
|
+
import React14, { useCallback as useCallback8, useRef as useRef3, useState as useState5 } from "react";
|
|
834
|
+
import { log as log2 } from "@dxos/log";
|
|
835
|
+
import { Button as Button4, Input as Input2, Popover, useTranslation as useTranslation13 } from "@dxos/react-ui";
|
|
836
|
+
var __dxlog_file4 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/PopoverRenameObject.tsx";
|
|
718
837
|
var POPOVER_RENAME_OBJECT = `${SPACE_PLUGIN}/PopoverRenameObject`;
|
|
719
838
|
var PopoverRenameObject = ({ object: obj }) => {
|
|
720
839
|
const { t } = useTranslation13(SPACE_PLUGIN);
|
|
@@ -728,10 +847,10 @@ var PopoverRenameObject = ({ object: obj }) => {
|
|
|
728
847
|
try {
|
|
729
848
|
object.title = name;
|
|
730
849
|
} catch (err) {
|
|
731
|
-
|
|
850
|
+
log2.error("Failed to rename object", {
|
|
732
851
|
err
|
|
733
852
|
}, {
|
|
734
|
-
F:
|
|
853
|
+
F: __dxlog_file4,
|
|
735
854
|
L: 30,
|
|
736
855
|
S: void 0,
|
|
737
856
|
C: (f, a) => f(...a)
|
|
@@ -742,23 +861,23 @@ var PopoverRenameObject = ({ object: obj }) => {
|
|
|
742
861
|
object,
|
|
743
862
|
name
|
|
744
863
|
]);
|
|
745
|
-
return /* @__PURE__ */
|
|
864
|
+
return /* @__PURE__ */ React14.createElement("div", {
|
|
746
865
|
role: "none",
|
|
747
866
|
className: "p-1 flex gap-2"
|
|
748
|
-
}, /* @__PURE__ */
|
|
867
|
+
}, /* @__PURE__ */ React14.createElement("div", {
|
|
749
868
|
role: "none",
|
|
750
869
|
className: "flex-1"
|
|
751
|
-
}, /* @__PURE__ */
|
|
870
|
+
}, /* @__PURE__ */ React14.createElement(Input2.Root, null, /* @__PURE__ */ React14.createElement(Input2.Label, {
|
|
752
871
|
srOnly: true
|
|
753
|
-
}, t("object name label")), /* @__PURE__ */
|
|
872
|
+
}, t("object name label")), /* @__PURE__ */ React14.createElement(Input2.TextInput, {
|
|
754
873
|
placeholder: t("object title placeholder"),
|
|
755
874
|
value: name,
|
|
756
875
|
"data-testid": "spacePlugin.renameObject.input",
|
|
757
876
|
onChange: ({ target: { value } }) => setName(value),
|
|
758
877
|
onKeyDown: ({ key }) => key === "Enter" && doneButton.current?.click()
|
|
759
|
-
}))), /* @__PURE__ */
|
|
878
|
+
}))), /* @__PURE__ */ React14.createElement(Popover.Close, {
|
|
760
879
|
asChild: true
|
|
761
|
-
}, /* @__PURE__ */
|
|
880
|
+
}, /* @__PURE__ */ React14.createElement(Button4, {
|
|
762
881
|
ref: doneButton,
|
|
763
882
|
classNames: "self-stretch",
|
|
764
883
|
onClick: handleDone
|
|
@@ -768,8 +887,8 @@ var PopoverRenameObject = ({ object: obj }) => {
|
|
|
768
887
|
};
|
|
769
888
|
|
|
770
889
|
// packages/plugins/plugin-space/src/components/PopoverRenameSpace.tsx
|
|
771
|
-
import
|
|
772
|
-
import { Button as Button5, Input as
|
|
890
|
+
import React15, { useCallback as useCallback9, useRef as useRef4, useState as useState6 } from "react";
|
|
891
|
+
import { Button as Button5, Input as Input3, Popover as Popover2, useTranslation as useTranslation14 } from "@dxos/react-ui";
|
|
773
892
|
var POPOVER_RENAME_SPACE = `${SPACE_PLUGIN}/PopoverRenameSpace`;
|
|
774
893
|
var PopoverRenameSpace = ({ space }) => {
|
|
775
894
|
const { t } = useTranslation14(SPACE_PLUGIN);
|
|
@@ -781,24 +900,24 @@ var PopoverRenameSpace = ({ space }) => {
|
|
|
781
900
|
space,
|
|
782
901
|
name
|
|
783
902
|
]);
|
|
784
|
-
return /* @__PURE__ */
|
|
903
|
+
return /* @__PURE__ */ React15.createElement("div", {
|
|
785
904
|
role: "none",
|
|
786
905
|
className: "p-1 flex gap-2"
|
|
787
|
-
}, /* @__PURE__ */
|
|
906
|
+
}, /* @__PURE__ */ React15.createElement("div", {
|
|
788
907
|
role: "none",
|
|
789
908
|
className: "flex-1"
|
|
790
|
-
}, /* @__PURE__ */
|
|
909
|
+
}, /* @__PURE__ */ React15.createElement(Input3.Root, null, /* @__PURE__ */ React15.createElement(Input3.Label, {
|
|
791
910
|
srOnly: true
|
|
792
|
-
}, t("space name label")), /* @__PURE__ */
|
|
911
|
+
}, t("space name label")), /* @__PURE__ */ React15.createElement(Input3.TextInput, {
|
|
793
912
|
defaultValue: space.properties.name ?? "",
|
|
794
913
|
placeholder: t("unnamed space label"),
|
|
795
914
|
onChange: ({ target: { value } }) => setName(value),
|
|
796
915
|
// TODO(wittjosiah): Ideally this should access the popover context to close the popover.
|
|
797
916
|
// Currently this is not possible because Radix does not expose the popover context.
|
|
798
917
|
onKeyDown: ({ key }) => key === "Enter" && doneButton.current?.click()
|
|
799
|
-
}))), /* @__PURE__ */
|
|
918
|
+
}))), /* @__PURE__ */ React15.createElement(Popover2.Close, {
|
|
800
919
|
asChild: true
|
|
801
|
-
}, /* @__PURE__ */
|
|
920
|
+
}, /* @__PURE__ */ React15.createElement(Button5, {
|
|
802
921
|
ref: doneButton,
|
|
803
922
|
classNames: "self-stretch",
|
|
804
923
|
onClick: handleDone
|
|
@@ -808,20 +927,20 @@ var PopoverRenameSpace = ({ space }) => {
|
|
|
808
927
|
};
|
|
809
928
|
|
|
810
929
|
// packages/plugins/plugin-space/src/components/ShareSpaceButton.tsx
|
|
811
|
-
import
|
|
812
|
-
import { createIntent as
|
|
930
|
+
import React16 from "react";
|
|
931
|
+
import { createIntent as createIntent6, useIntentDispatcher as useIntentDispatcher6 } from "@dxos/app-framework";
|
|
813
932
|
import { IconButton as IconButton4, useTranslation as useTranslation15 } from "@dxos/react-ui";
|
|
814
933
|
var ShareSpaceButton = ({ space }) => {
|
|
815
|
-
const { dispatchPromise: dispatch } =
|
|
816
|
-
return /* @__PURE__ */
|
|
817
|
-
onClick: () => dispatch(
|
|
934
|
+
const { dispatchPromise: dispatch } = useIntentDispatcher6();
|
|
935
|
+
return /* @__PURE__ */ React16.createElement(ShareSpaceButtonImpl, {
|
|
936
|
+
onClick: () => dispatch(createIntent6(SpaceAction.Share, {
|
|
818
937
|
space
|
|
819
938
|
}))
|
|
820
939
|
});
|
|
821
940
|
};
|
|
822
941
|
var ShareSpaceButtonImpl = ({ onClick }) => {
|
|
823
942
|
const { t } = useTranslation15(SPACE_PLUGIN);
|
|
824
|
-
return /* @__PURE__ */
|
|
943
|
+
return /* @__PURE__ */ React16.createElement(IconButton4, {
|
|
825
944
|
"data-testid": "spacePlugin.shareSpaceButton",
|
|
826
945
|
icon: "ph--users--regular",
|
|
827
946
|
label: t("share space label"),
|
|
@@ -830,29 +949,16 @@ var ShareSpaceButtonImpl = ({ onClick }) => {
|
|
|
830
949
|
};
|
|
831
950
|
|
|
832
951
|
// packages/plugins/plugin-space/src/components/SpacePresence.tsx
|
|
833
|
-
import
|
|
834
|
-
import {
|
|
952
|
+
import React17, { useCallback as useCallback10, useEffect as useEffect4, useState as useState8 } from "react";
|
|
953
|
+
import { useAppGraph as useAppGraph2, useCapability } from "@dxos/app-framework";
|
|
835
954
|
import { generateName } from "@dxos/display-name";
|
|
836
|
-
import {
|
|
837
|
-
import { PublicKey, useClient as useClient4 } from "@dxos/react-client";
|
|
955
|
+
import { PublicKey, useClient as useClient5 } from "@dxos/react-client";
|
|
838
956
|
import { getSpace as getSpace3, useMembers, fullyQualifiedId as fullyQualifiedId2 } from "@dxos/react-client/echo";
|
|
839
957
|
import { useIdentity } from "@dxos/react-client/halo";
|
|
840
958
|
import { Avatar, AvatarGroup, AvatarGroupItem, Tooltip as Tooltip2, useTranslation as useTranslation16, List as List2, ListItem as ListItem2, useDefaultValue } from "@dxos/react-ui";
|
|
841
959
|
import { AttentionGlyph, useAttended, useAttention } from "@dxos/react-ui-attention";
|
|
842
960
|
import { ComplexMap, keyToFallback } from "@dxos/util";
|
|
843
961
|
|
|
844
|
-
// packages/plugins/plugin-space/src/capabilities/index.ts
|
|
845
|
-
import { lazy } from "@dxos/app-framework";
|
|
846
|
-
var AppGraphBuilder = lazy(() => import("./app-graph-builder-F6XSETHX.mjs"));
|
|
847
|
-
var AppGraphSerializer = lazy(() => import("./app-graph-serializer-FYJE23GN.mjs"));
|
|
848
|
-
var IdentityCreated = lazy(() => import("./identity-created-4Q4PFIC5.mjs"));
|
|
849
|
-
var IntentResolver = lazy(() => import("./intent-resolver-XRZYCXXX.mjs"));
|
|
850
|
-
var ReactRoot = lazy(() => import("./react-root-BDOPFJGJ.mjs"));
|
|
851
|
-
var ReactSurface = lazy(() => import("./react-surface-EGOL2JBL.mjs"));
|
|
852
|
-
var SpaceSettings = lazy(() => import("./settings-WF67QZSD.mjs"));
|
|
853
|
-
var SpaceState = lazy(() => import("./state-MS4KYJWI.mjs"));
|
|
854
|
-
var SpacesReady = lazy(() => import("./spaces-ready-WVU7US3C.mjs"));
|
|
855
|
-
|
|
856
962
|
// packages/plugins/plugin-space/src/hooks/usePath.ts
|
|
857
963
|
import { useEffect as useEffect3, useState as useState7 } from "react";
|
|
858
964
|
var usePath = (graph, id, timeout) => {
|
|
@@ -895,8 +1001,8 @@ var ACTIVITY_DURATION = 3e4;
|
|
|
895
1001
|
var noViewers = new ComplexMap(PublicKey.hash);
|
|
896
1002
|
var getName = (identity) => identity.profile?.displayName ?? generateName(identity.identityKey.toHex());
|
|
897
1003
|
var SpacePresence = ({ object, spaceKey }) => {
|
|
898
|
-
const spaceState =
|
|
899
|
-
const client =
|
|
1004
|
+
const spaceState = useCapability(SpaceCapabilities.MutableState);
|
|
1005
|
+
const client = useClient5();
|
|
900
1006
|
const identity = useIdentity();
|
|
901
1007
|
const space = spaceKey ? client.spaces.get(spaceKey) : getSpace3(object);
|
|
902
1008
|
const spaceMembers = useMembers(space?.key);
|
|
@@ -923,7 +1029,7 @@ var SpacePresence = ({ object, spaceKey }) => {
|
|
|
923
1029
|
lastSeen
|
|
924
1030
|
};
|
|
925
1031
|
}).toSorted((a, b) => a.lastSeen - b.lastSeen);
|
|
926
|
-
return /* @__PURE__ */
|
|
1032
|
+
return /* @__PURE__ */ React17.createElement(FullPresence, {
|
|
927
1033
|
members: membersForObject
|
|
928
1034
|
});
|
|
929
1035
|
};
|
|
@@ -933,38 +1039,38 @@ var FullPresence = (props) => {
|
|
|
933
1039
|
if (members.length === 0) {
|
|
934
1040
|
return null;
|
|
935
1041
|
}
|
|
936
|
-
return /* @__PURE__ */
|
|
1042
|
+
return /* @__PURE__ */ React17.createElement(AvatarGroup.Root, {
|
|
937
1043
|
size,
|
|
938
1044
|
classNames: "mbs-2 mie-4",
|
|
939
1045
|
"data-testid": "spacePlugin.presence"
|
|
940
|
-
}, members.slice(0, 3).map((member, i) => /* @__PURE__ */
|
|
1046
|
+
}, members.slice(0, 3).map((member, i) => /* @__PURE__ */ React17.createElement(Tooltip2.Root, {
|
|
941
1047
|
key: member.identity.identityKey.toHex()
|
|
942
|
-
}, /* @__PURE__ */
|
|
1048
|
+
}, /* @__PURE__ */ React17.createElement(Tooltip2.Trigger, null, /* @__PURE__ */ React17.createElement(PrensenceAvatar, {
|
|
943
1049
|
identity: member.identity,
|
|
944
1050
|
group: true,
|
|
945
1051
|
match: member.currentlyAttended,
|
|
946
1052
|
index: members.length - i,
|
|
947
1053
|
onClick: () => onMemberClick?.(member)
|
|
948
|
-
})), /* @__PURE__ */
|
|
1054
|
+
})), /* @__PURE__ */ React17.createElement(Tooltip2.Portal, null, /* @__PURE__ */ React17.createElement(Tooltip2.Content, {
|
|
949
1055
|
side: "bottom"
|
|
950
|
-
}, /* @__PURE__ */
|
|
1056
|
+
}, /* @__PURE__ */ React17.createElement("span", null, getName(member.identity)), /* @__PURE__ */ React17.createElement(Tooltip2.Arrow, null))))), members.length > 3 && /* @__PURE__ */ React17.createElement(Tooltip2.Root, null, /* @__PURE__ */ React17.createElement(Tooltip2.Trigger, null, /* @__PURE__ */ React17.createElement(AvatarGroupItem.Root, {
|
|
951
1057
|
status: "inactive"
|
|
952
|
-
}, /* @__PURE__ */
|
|
1058
|
+
}, /* @__PURE__ */ React17.createElement(Avatar.Frame, {
|
|
953
1059
|
style: {
|
|
954
1060
|
zIndex: members.length - 4
|
|
955
1061
|
}
|
|
956
|
-
}, /* @__PURE__ */
|
|
1062
|
+
}, /* @__PURE__ */ React17.createElement(Avatar.Fallback, {
|
|
957
1063
|
text: `+${members.length - 3}`
|
|
958
|
-
})))), /* @__PURE__ */
|
|
1064
|
+
})))), /* @__PURE__ */ React17.createElement(Tooltip2.Portal, null, /* @__PURE__ */ React17.createElement(Tooltip2.Content, {
|
|
959
1065
|
side: "bottom"
|
|
960
|
-
}, /* @__PURE__ */
|
|
1066
|
+
}, /* @__PURE__ */ React17.createElement(Tooltip2.Arrow, null), /* @__PURE__ */ React17.createElement(List2, {
|
|
961
1067
|
classNames: "max-h-56 overflow-y-auto"
|
|
962
|
-
}, members.map((member) => /* @__PURE__ */
|
|
1068
|
+
}, members.map((member) => /* @__PURE__ */ React17.createElement(ListItem2.Root, {
|
|
963
1069
|
key: member.identity.identityKey.toHex(),
|
|
964
1070
|
classNames: "flex gap-2 items-center cursor-pointer mbe-2",
|
|
965
1071
|
onClick: () => onMemberClick?.(member),
|
|
966
1072
|
"data-testid": "identity-list-item"
|
|
967
|
-
}, /* @__PURE__ */
|
|
1073
|
+
}, /* @__PURE__ */ React17.createElement(PrensenceAvatar, {
|
|
968
1074
|
identity: member.identity,
|
|
969
1075
|
showName: true,
|
|
970
1076
|
match: member.currentlyAttended
|
|
@@ -974,10 +1080,10 @@ var PrensenceAvatar = ({ identity, showName, match, group, index, onClick }) =>
|
|
|
974
1080
|
const Root = group ? AvatarGroupItem.Root : Avatar.Root;
|
|
975
1081
|
const status = match ? "current" : "active";
|
|
976
1082
|
const fallbackValue = keyToFallback(identity.identityKey);
|
|
977
|
-
return /* @__PURE__ */
|
|
1083
|
+
return /* @__PURE__ */ React17.createElement(Root, {
|
|
978
1084
|
status,
|
|
979
1085
|
hue: identity.profile?.data?.hue || fallbackValue.hue
|
|
980
|
-
}, /* @__PURE__ */
|
|
1086
|
+
}, /* @__PURE__ */ React17.createElement(Avatar.Frame, {
|
|
981
1087
|
"data-testid": "spacePlugin.presence.member",
|
|
982
1088
|
"data-status": status,
|
|
983
1089
|
...index ? {
|
|
@@ -986,16 +1092,16 @@ var PrensenceAvatar = ({ identity, showName, match, group, index, onClick }) =>
|
|
|
986
1092
|
}
|
|
987
1093
|
} : {},
|
|
988
1094
|
onClick: () => onClick?.()
|
|
989
|
-
}, /* @__PURE__ */
|
|
1095
|
+
}, /* @__PURE__ */ React17.createElement(Avatar.Fallback, {
|
|
990
1096
|
text: identity.profile?.data?.emoji || fallbackValue.emoji
|
|
991
|
-
})), showName && /* @__PURE__ */
|
|
1097
|
+
})), showName && /* @__PURE__ */ React17.createElement(Avatar.Label, {
|
|
992
1098
|
classNames: "text-sm truncate pli-2"
|
|
993
1099
|
}, getName(identity)));
|
|
994
1100
|
};
|
|
995
1101
|
var SmallPresenceLive = ({ id, open, viewers }) => {
|
|
996
1102
|
const { hasAttention, isAncestor, isRelated } = useAttention(id);
|
|
997
1103
|
const isAttended = hasAttention || isAncestor || isRelated;
|
|
998
|
-
const { graph } =
|
|
1104
|
+
const { graph } = useAppGraph2();
|
|
999
1105
|
const attended = useAttended();
|
|
1000
1106
|
const startOfAttention = attended.at(-1);
|
|
1001
1107
|
const path = usePath(graph, startOfAttention);
|
|
@@ -1016,7 +1122,7 @@ var SmallPresenceLive = ({ id, open, viewers }) => {
|
|
|
1016
1122
|
}, [
|
|
1017
1123
|
viewers
|
|
1018
1124
|
]);
|
|
1019
|
-
return /* @__PURE__ */
|
|
1125
|
+
return /* @__PURE__ */ React17.createElement(SmallPresence, {
|
|
1020
1126
|
count: activeViewers.length,
|
|
1021
1127
|
attended: isAttended,
|
|
1022
1128
|
containsAttended
|
|
@@ -1024,53 +1130,53 @@ var SmallPresenceLive = ({ id, open, viewers }) => {
|
|
|
1024
1130
|
};
|
|
1025
1131
|
var SmallPresence = ({ count = 0, attended, containsAttended }) => {
|
|
1026
1132
|
const { t } = useTranslation16(SPACE_PLUGIN);
|
|
1027
|
-
return /* @__PURE__ */
|
|
1133
|
+
return /* @__PURE__ */ React17.createElement(Tooltip2.Root, null, /* @__PURE__ */ React17.createElement(Tooltip2.Trigger, {
|
|
1028
1134
|
asChild: true
|
|
1029
|
-
}, /* @__PURE__ */
|
|
1135
|
+
}, /* @__PURE__ */ React17.createElement(AttentionGlyph, {
|
|
1030
1136
|
attended,
|
|
1031
1137
|
containsAttended,
|
|
1032
1138
|
presence: count > 1 ? "many" : count === 1 ? "one" : "none",
|
|
1033
1139
|
classNames: "self-center mie-1"
|
|
1034
|
-
})), /* @__PURE__ */
|
|
1140
|
+
})), /* @__PURE__ */ React17.createElement(Tooltip2.Portal, null, /* @__PURE__ */ React17.createElement(Tooltip2.Content, {
|
|
1035
1141
|
side: "bottom"
|
|
1036
|
-
}, /* @__PURE__ */
|
|
1142
|
+
}, /* @__PURE__ */ React17.createElement("span", null, t("presence label", {
|
|
1037
1143
|
count
|
|
1038
|
-
})), /* @__PURE__ */
|
|
1144
|
+
})), /* @__PURE__ */ React17.createElement(Tooltip2.Arrow, null))));
|
|
1039
1145
|
};
|
|
1040
1146
|
|
|
1041
1147
|
// packages/plugins/plugin-space/src/components/SpacePluginSettings.tsx
|
|
1042
|
-
import
|
|
1043
|
-
import { Input as
|
|
1044
|
-
import { DeprecatedFormInput } from "@dxos/react-ui-form";
|
|
1148
|
+
import React18 from "react";
|
|
1149
|
+
import { Input as Input4, useTranslation as useTranslation17 } from "@dxos/react-ui";
|
|
1150
|
+
import { DeprecatedFormContainer, DeprecatedFormInput } from "@dxos/react-ui-form";
|
|
1045
1151
|
var SpacePluginSettings = ({ settings }) => {
|
|
1046
1152
|
const { t } = useTranslation17(SPACE_PLUGIN);
|
|
1047
|
-
return /* @__PURE__ */
|
|
1153
|
+
return /* @__PURE__ */ React18.createElement(DeprecatedFormContainer, null, /* @__PURE__ */ React18.createElement(DeprecatedFormInput, {
|
|
1048
1154
|
label: t("show hidden spaces label")
|
|
1049
|
-
}, /* @__PURE__ */
|
|
1155
|
+
}, /* @__PURE__ */ React18.createElement(Input4.Switch, {
|
|
1050
1156
|
checked: settings.showHidden,
|
|
1051
1157
|
onCheckedChange: (checked) => settings.showHidden = !!checked
|
|
1052
1158
|
})));
|
|
1053
1159
|
};
|
|
1054
1160
|
|
|
1055
1161
|
// packages/plugins/plugin-space/src/components/SpaceSettings/SpaceSettingsPanel.tsx
|
|
1056
|
-
import
|
|
1057
|
-
import { log as
|
|
1162
|
+
import React19, { useCallback as useCallback11, useState as useState9 } from "react";
|
|
1163
|
+
import { log as log3 } from "@dxos/log";
|
|
1058
1164
|
import { EdgeReplicationSetting } from "@dxos/protocols/proto/dxos/echo/metadata";
|
|
1059
|
-
import { useClient as
|
|
1060
|
-
import { Input as
|
|
1061
|
-
import { DeprecatedFormInput as DeprecatedFormInput2 } from "@dxos/react-ui-form";
|
|
1062
|
-
import {
|
|
1063
|
-
var
|
|
1064
|
-
var SpaceSettingsPanel = ({
|
|
1165
|
+
import { useClient as useClient6 } from "@dxos/react-client";
|
|
1166
|
+
import { Input as Input5, Toolbar, useTranslation as useTranslation18 } from "@dxos/react-ui";
|
|
1167
|
+
import { DeprecatedFormContainer as DeprecatedFormContainer2, DeprecatedFormInput as DeprecatedFormInput2 } from "@dxos/react-ui-form";
|
|
1168
|
+
import { HuePicker, IconPicker } from "@dxos/react-ui-pickers";
|
|
1169
|
+
var __dxlog_file5 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/SpaceSettings/SpaceSettingsPanel.tsx";
|
|
1170
|
+
var SpaceSettingsPanel = ({ space }) => {
|
|
1065
1171
|
const { t } = useTranslation18(SPACE_PLUGIN);
|
|
1066
|
-
const client =
|
|
1172
|
+
const client = useClient6();
|
|
1067
1173
|
const edgeEnabled = Boolean(client.config.values.runtime?.client?.edgeFeatures?.echoReplicator);
|
|
1068
1174
|
const [edgeReplication, setEdgeReplication] = useState9(space.internal.data.edgeReplication === EdgeReplicationSetting.ENABLED);
|
|
1069
1175
|
const toggleEdgeReplication = useCallback11(async (next) => {
|
|
1070
1176
|
setEdgeReplication(next);
|
|
1071
1177
|
await space?.internal.setEdgeReplicationPreference(next ? EdgeReplicationSetting.ENABLED : EdgeReplicationSetting.DISABLED).catch((err) => {
|
|
1072
|
-
|
|
1073
|
-
F:
|
|
1178
|
+
log3.catch(err, void 0, {
|
|
1179
|
+
F: __dxlog_file5,
|
|
1074
1180
|
L: 36,
|
|
1075
1181
|
S: void 0,
|
|
1076
1182
|
C: (f, a) => f(...a)
|
|
@@ -1080,35 +1186,49 @@ var SpaceSettingsPanel = ({ classNames, space }) => {
|
|
|
1080
1186
|
}, [
|
|
1081
1187
|
space
|
|
1082
1188
|
]);
|
|
1083
|
-
return /* @__PURE__ */
|
|
1084
|
-
role: "form",
|
|
1085
|
-
className: mx4("flex flex-col", classNames)
|
|
1086
|
-
}, /* @__PURE__ */ React18.createElement(DeprecatedFormInput2, {
|
|
1189
|
+
return /* @__PURE__ */ React19.createElement(DeprecatedFormContainer2, null, /* @__PURE__ */ React19.createElement(DeprecatedFormInput2, {
|
|
1087
1190
|
label: t("name label")
|
|
1088
|
-
}, /* @__PURE__ */
|
|
1191
|
+
}, /* @__PURE__ */ React19.createElement(Input5.TextInput, {
|
|
1089
1192
|
placeholder: t("unnamed space label"),
|
|
1090
1193
|
value: space.properties.name ?? "",
|
|
1091
1194
|
onChange: (event) => {
|
|
1092
1195
|
space.properties.name = event.target.value;
|
|
1093
1196
|
}
|
|
1094
|
-
})),
|
|
1197
|
+
})), /* @__PURE__ */ React19.createElement(DeprecatedFormInput2, {
|
|
1198
|
+
label: t("icon label")
|
|
1199
|
+
}, /* @__PURE__ */ React19.createElement(Toolbar.Root, null, /* @__PURE__ */ React19.createElement(IconPicker, {
|
|
1200
|
+
value: space.properties.icon,
|
|
1201
|
+
onChange: (nextIcon) => space.properties.icon = nextIcon,
|
|
1202
|
+
onReset: () => {
|
|
1203
|
+
space.properties.icon = void 0;
|
|
1204
|
+
}
|
|
1205
|
+
}))), /* @__PURE__ */ React19.createElement(DeprecatedFormInput2, {
|
|
1206
|
+
label: t("hue label")
|
|
1207
|
+
}, /* @__PURE__ */ React19.createElement(Toolbar.Root, null, /* @__PURE__ */ React19.createElement(HuePicker, {
|
|
1208
|
+
value: space.properties.hue,
|
|
1209
|
+
onChange: (nextHue) => space.properties.hue = nextHue,
|
|
1210
|
+
onReset: () => {
|
|
1211
|
+
space.properties.hue = void 0;
|
|
1212
|
+
}
|
|
1213
|
+
}))), edgeEnabled && /* @__PURE__ */ React19.createElement(DeprecatedFormInput2, {
|
|
1095
1214
|
label: t("edge replication label")
|
|
1096
|
-
}, /* @__PURE__ */
|
|
1215
|
+
}, /* @__PURE__ */ React19.createElement(Input5.Switch, {
|
|
1097
1216
|
checked: edgeReplication,
|
|
1098
1217
|
onCheckedChange: toggleEdgeReplication
|
|
1099
1218
|
})));
|
|
1100
1219
|
};
|
|
1101
1220
|
|
|
1102
1221
|
// packages/plugins/plugin-space/src/components/SpaceSettings/SpaceSettingsDialog.tsx
|
|
1103
|
-
import
|
|
1104
|
-
import {
|
|
1222
|
+
import React20, { useMemo, useState as useState10 } from "react";
|
|
1223
|
+
import { Surface as Surface2, useCapabilities as useCapabilities2 } from "@dxos/app-framework";
|
|
1224
|
+
import { useClient as useClient7 } from "@dxos/react-client";
|
|
1105
1225
|
import { Button as Button6, Clipboard, Dialog as Dialog4, Icon as Icon4, toLocalizedString as toLocalizedString3, useTranslation as useTranslation19 } from "@dxos/react-ui";
|
|
1106
1226
|
import { Tabs } from "@dxos/react-ui-tabs";
|
|
1107
1227
|
import { SpacePanel } from "@dxos/shell/react";
|
|
1108
1228
|
var SPACE_SETTINGS_DIALOG = `${SPACE_PLUGIN}/SpaceSettingsDialog`;
|
|
1109
1229
|
var SpaceSettingsDialog = ({ space, target, createInvitationUrl, initialTab = "members", namesCache }) => {
|
|
1110
1230
|
const { t } = useTranslation19(SPACE_PLUGIN);
|
|
1111
|
-
const client =
|
|
1231
|
+
const client = useClient7();
|
|
1112
1232
|
const [tabsActivePart, setTabsActivePart] = useState10("list");
|
|
1113
1233
|
const [selected, setSelected] = useState10(initialTab);
|
|
1114
1234
|
const locked = space.properties[COMPOSER_SPACE_LOCK];
|
|
@@ -1116,81 +1236,97 @@ var SpaceSettingsDialog = ({ space, target, createInvitationUrl, initialTab = "m
|
|
|
1116
1236
|
personal: client.spaces.default === space,
|
|
1117
1237
|
namesCache
|
|
1118
1238
|
});
|
|
1239
|
+
const panels = useCapabilities2(SpaceCapabilities.SettingsPanel);
|
|
1240
|
+
const data = useMemo(() => ({
|
|
1241
|
+
subject: space
|
|
1242
|
+
}), [
|
|
1243
|
+
space
|
|
1244
|
+
]);
|
|
1119
1245
|
return (
|
|
1120
1246
|
// TODO(wittjosiah): The tablist dialog pattern is copied from @dxos/plugin-manager.
|
|
1121
1247
|
// Consider factoring it out to the tabs package.
|
|
1122
|
-
/* @__PURE__ */
|
|
1248
|
+
/* @__PURE__ */ React20.createElement(Dialog4.Content, {
|
|
1123
1249
|
classNames: "p-0 bs-content min-bs-[15rem] max-bs-full md:max-is-[40rem] overflow-hidden"
|
|
1124
|
-
}, /* @__PURE__ */
|
|
1250
|
+
}, /* @__PURE__ */ React20.createElement("div", {
|
|
1125
1251
|
role: "none",
|
|
1126
1252
|
className: "flex justify-between pbs-2 pis-2 pie-2 @md:pbs-4 @md:pis-4 @md:pie-4"
|
|
1127
|
-
}, /* @__PURE__ */
|
|
1253
|
+
}, /* @__PURE__ */ React20.createElement(Dialog4.Title, {
|
|
1128
1254
|
onClick: () => setTabsActivePart("list"),
|
|
1129
1255
|
"aria-description": t("click to return to tablist description"),
|
|
1130
1256
|
classNames: "flex cursor-pointer items-center group/title"
|
|
1131
|
-
}, /* @__PURE__ */
|
|
1257
|
+
}, /* @__PURE__ */ React20.createElement(Icon4, {
|
|
1132
1258
|
icon: "ph--caret-left--regular",
|
|
1133
1259
|
size: 4,
|
|
1134
1260
|
classNames: [
|
|
1135
1261
|
"@md:hidden",
|
|
1136
1262
|
tabsActivePart === "list" && "invisible"
|
|
1137
1263
|
]
|
|
1138
|
-
}), /* @__PURE__ */
|
|
1264
|
+
}), /* @__PURE__ */ React20.createElement("span", {
|
|
1139
1265
|
className: tabsActivePart !== "list" ? "group-hover/title:underline @md:group-hover/title:no-underline underline-offset-4 decoration-1" : ""
|
|
1140
|
-
}, toLocalizedString3(name, t))), /* @__PURE__ */
|
|
1266
|
+
}, toLocalizedString3(name, t))), /* @__PURE__ */ React20.createElement(Dialog4.Close, {
|
|
1141
1267
|
asChild: true
|
|
1142
|
-
}, /* @__PURE__ */
|
|
1268
|
+
}, /* @__PURE__ */ React20.createElement(Button6, {
|
|
1143
1269
|
density: "fine",
|
|
1144
1270
|
variant: "ghost",
|
|
1145
1271
|
autoFocus: true
|
|
1146
|
-
}, /* @__PURE__ */
|
|
1272
|
+
}, /* @__PURE__ */ React20.createElement(Icon4, {
|
|
1147
1273
|
icon: "ph--x--regular",
|
|
1148
1274
|
size: 4
|
|
1149
|
-
})))), /* @__PURE__ */
|
|
1275
|
+
})))), /* @__PURE__ */ React20.createElement(Tabs.Root, {
|
|
1150
1276
|
orientation: "vertical",
|
|
1151
1277
|
value: selected,
|
|
1152
1278
|
onValueChange: setSelected,
|
|
1153
1279
|
activePart: tabsActivePart,
|
|
1154
1280
|
onActivePartChange: setTabsActivePart,
|
|
1155
1281
|
classNames: "flex flex-col flex-1 mbs-2"
|
|
1156
|
-
}, /* @__PURE__ */
|
|
1282
|
+
}, /* @__PURE__ */ React20.createElement(Tabs.Viewport, {
|
|
1157
1283
|
classNames: "flex-1 min-bs-0"
|
|
1158
|
-
}, /* @__PURE__ */
|
|
1284
|
+
}, /* @__PURE__ */ React20.createElement("div", {
|
|
1159
1285
|
role: "none",
|
|
1160
1286
|
className: "overflow-y-auto pli-3 @md:pis-2 @md:pie-0 mbe-4 border-r border-separator"
|
|
1161
|
-
}, /* @__PURE__ */
|
|
1287
|
+
}, /* @__PURE__ */ React20.createElement(Tabs.Tablist, {
|
|
1162
1288
|
classNames: "flex flex-col max-bs-none min-is-[200px] gap-4 overflow-y-auto"
|
|
1163
|
-
}, /* @__PURE__ */
|
|
1289
|
+
}, /* @__PURE__ */ React20.createElement("div", {
|
|
1164
1290
|
role: "none",
|
|
1165
1291
|
className: "flex flex-col ml-1"
|
|
1166
|
-
}, /* @__PURE__ */
|
|
1292
|
+
}, /* @__PURE__ */ React20.createElement(Tabs.Tab, {
|
|
1167
1293
|
value: "settings"
|
|
1168
|
-
}, t("settings tab label")), /* @__PURE__ */
|
|
1294
|
+
}, t("settings tab label")), /* @__PURE__ */ React20.createElement(Tabs.Tab, {
|
|
1169
1295
|
value: "members",
|
|
1170
1296
|
disabled: locked
|
|
1171
|
-
}, t("members tab label"))
|
|
1297
|
+
}, t("members tab label")), panels.map((panel) => /* @__PURE__ */ React20.createElement(Tabs.Tab, {
|
|
1298
|
+
key: panel.id,
|
|
1299
|
+
value: panel.id
|
|
1300
|
+
}, toLocalizedString3(panel.label, t)))))), /* @__PURE__ */ React20.createElement(Tabs.Tabpanel, {
|
|
1172
1301
|
value: "settings",
|
|
1173
1302
|
classNames: "pli-3 @md:pli-5 max-bs-dvh overflow-y-auto"
|
|
1174
|
-
}, /* @__PURE__ */
|
|
1303
|
+
}, /* @__PURE__ */ React20.createElement(SpaceSettingsPanel, {
|
|
1175
1304
|
space
|
|
1176
|
-
})), /* @__PURE__ */
|
|
1305
|
+
})), /* @__PURE__ */ React20.createElement(Tabs.Tabpanel, {
|
|
1177
1306
|
value: "members",
|
|
1178
1307
|
classNames: "pli-3 @md:pli-5 max-bs-dvh overflow-y-auto"
|
|
1179
|
-
}, /* @__PURE__ */
|
|
1308
|
+
}, /* @__PURE__ */ React20.createElement(Clipboard.Provider, null, /* @__PURE__ */ React20.createElement(SpacePanel, {
|
|
1180
1309
|
space,
|
|
1181
1310
|
hideHeading: true,
|
|
1182
1311
|
target,
|
|
1183
1312
|
createInvitationUrl
|
|
1313
|
+
}))), panels.map((panel) => /* @__PURE__ */ React20.createElement(Tabs.Tabpanel, {
|
|
1314
|
+
key: panel.id,
|
|
1315
|
+
value: panel.id,
|
|
1316
|
+
classNames: "pli-3 @md:pli-5 max-bs-dvh overflow-y-auto"
|
|
1317
|
+
}, /* @__PURE__ */ React20.createElement(Surface2, {
|
|
1318
|
+
role: `space-settings--${panel.id}`,
|
|
1319
|
+
data
|
|
1184
1320
|
}))))))
|
|
1185
1321
|
);
|
|
1186
1322
|
};
|
|
1187
1323
|
|
|
1188
1324
|
// packages/plugins/plugin-space/src/components/SyncStatus/InlineSyncStatus.tsx
|
|
1189
|
-
import
|
|
1190
|
-
import {
|
|
1325
|
+
import React21, { useEffect as useEffect6, useState as useState12 } from "react";
|
|
1326
|
+
import { useAppGraph as useAppGraph3 } from "@dxos/app-framework";
|
|
1191
1327
|
import { QueryEdgeStatusResponse } from "@dxos/protocols/proto/dxos/client/services";
|
|
1192
1328
|
import { EdgeReplicationSetting as EdgeReplicationSetting2 } from "@dxos/protocols/proto/dxos/echo/metadata";
|
|
1193
|
-
import { useClient as
|
|
1329
|
+
import { useClient as useClient9 } from "@dxos/react-client";
|
|
1194
1330
|
import { Tooltip as Tooltip3, useTranslation as useTranslation20 } from "@dxos/react-ui";
|
|
1195
1331
|
import { AttentionGlyph as AttentionGlyph2, useAttended as useAttended2, useAttention as useAttention2 } from "@dxos/react-ui-attention";
|
|
1196
1332
|
|
|
@@ -1198,8 +1334,8 @@ import { AttentionGlyph as AttentionGlyph2, useAttended as useAttended2, useAtte
|
|
|
1198
1334
|
import { useEffect as useEffect5, useState as useState11 } from "react";
|
|
1199
1335
|
import { Context } from "@dxos/context";
|
|
1200
1336
|
import { EdgeService } from "@dxos/protocols";
|
|
1201
|
-
import { useClient as
|
|
1202
|
-
var
|
|
1337
|
+
import { useClient as useClient8 } from "@dxos/react-client";
|
|
1338
|
+
var __dxlog_file6 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/SyncStatus/sync-state.ts";
|
|
1203
1339
|
var createEmptyEdgeSyncState = () => ({
|
|
1204
1340
|
missingOnLocal: 0,
|
|
1205
1341
|
missingOnRemote: 0,
|
|
@@ -1219,11 +1355,11 @@ var getSyncSummary = (syncMap) => {
|
|
|
1219
1355
|
};
|
|
1220
1356
|
var isEdgePeerId = (peerId, spaceId) => peerId.startsWith(`${EdgeService.AUTOMERGE_REPLICATOR}:${spaceId}`);
|
|
1221
1357
|
var useSyncState = () => {
|
|
1222
|
-
const client =
|
|
1358
|
+
const client = useClient8();
|
|
1223
1359
|
const [spaceState, setSpaceState] = useState11({});
|
|
1224
1360
|
useEffect5(() => {
|
|
1225
1361
|
const ctx = new Context(void 0, {
|
|
1226
|
-
F:
|
|
1362
|
+
F: __dxlog_file6,
|
|
1227
1363
|
L: 48
|
|
1228
1364
|
});
|
|
1229
1365
|
const createSubscriptions = (spaces) => {
|
|
@@ -1258,7 +1394,7 @@ var useSpaceSyncState = (space) => {
|
|
|
1258
1394
|
const [spaceState, setSpaceState] = useState11();
|
|
1259
1395
|
useEffect5(() => {
|
|
1260
1396
|
const ctx = new Context(void 0, {
|
|
1261
|
-
F:
|
|
1397
|
+
F: __dxlog_file6,
|
|
1262
1398
|
L: 87
|
|
1263
1399
|
});
|
|
1264
1400
|
space.crud.subscribeToSyncState(ctx, ({ peers = [] }) => {
|
|
@@ -1279,7 +1415,7 @@ var useSpaceSyncState = (space) => {
|
|
|
1279
1415
|
// packages/plugins/plugin-space/src/components/SyncStatus/InlineSyncStatus.tsx
|
|
1280
1416
|
var useEdgeStatus = () => {
|
|
1281
1417
|
const [status, setStatus] = useState12(QueryEdgeStatusResponse.EdgeStatus.NOT_CONNECTED);
|
|
1282
|
-
const client =
|
|
1418
|
+
const client = useClient9();
|
|
1283
1419
|
useEffect6(() => {
|
|
1284
1420
|
client.services.services.EdgeAgentService?.queryEdgeStatus().subscribe(({ status: status2 }) => {
|
|
1285
1421
|
setStatus(status2);
|
|
@@ -1294,7 +1430,7 @@ var InlineSyncStatus = ({ space, open }) => {
|
|
|
1294
1430
|
const id = space.id;
|
|
1295
1431
|
const { hasAttention, isAncestor, isRelated } = useAttention2(id);
|
|
1296
1432
|
const isAttended = hasAttention || isAncestor || isRelated;
|
|
1297
|
-
const { graph } =
|
|
1433
|
+
const { graph } = useAppGraph3();
|
|
1298
1434
|
const attended = useAttended2();
|
|
1299
1435
|
const startOfAttention = attended.at(-1);
|
|
1300
1436
|
const path = usePath(graph, startOfAttention);
|
|
@@ -1303,30 +1439,30 @@ var InlineSyncStatus = ({ space, open }) => {
|
|
|
1303
1439
|
const edgeSyncEnabled = space.internal.data.edgeReplication === EdgeReplicationSetting2.ENABLED;
|
|
1304
1440
|
const syncState = useSpaceSyncState(space);
|
|
1305
1441
|
const syncing = connectedToEdge && edgeSyncEnabled && syncState && syncState.missingOnLocal > 0;
|
|
1306
|
-
return /* @__PURE__ */
|
|
1442
|
+
return /* @__PURE__ */ React21.createElement(Tooltip3.Root, null, /* @__PURE__ */ React21.createElement(Tooltip3.Trigger, {
|
|
1307
1443
|
asChild: true
|
|
1308
|
-
}, /* @__PURE__ */
|
|
1444
|
+
}, /* @__PURE__ */ React21.createElement(AttentionGlyph2, {
|
|
1309
1445
|
syncing,
|
|
1310
1446
|
attended: isAttended,
|
|
1311
1447
|
containsAttended,
|
|
1312
1448
|
classNames: "self-center mie-1"
|
|
1313
|
-
})), /* @__PURE__ */
|
|
1449
|
+
})), /* @__PURE__ */ React21.createElement(Tooltip3.Portal, null, /* @__PURE__ */ React21.createElement(Tooltip3.Content, {
|
|
1314
1450
|
side: "bottom",
|
|
1315
1451
|
classNames: "z-[70]"
|
|
1316
|
-
}, /* @__PURE__ */
|
|
1452
|
+
}, /* @__PURE__ */ React21.createElement("span", null, t("syncing label")), /* @__PURE__ */ React21.createElement(Tooltip3.Arrow, null))));
|
|
1317
1453
|
};
|
|
1318
1454
|
|
|
1319
1455
|
// packages/plugins/plugin-space/src/components/SyncStatus/SyncStatus.tsx
|
|
1320
|
-
import
|
|
1456
|
+
import React23, { useCallback as useCallback12, useEffect as useEffect8, useState as useState14 } from "react";
|
|
1321
1457
|
import { StatusBar } from "@dxos/plugin-status-bar";
|
|
1322
|
-
import { useClient as
|
|
1323
|
-
import { Icon as Icon6, Input as
|
|
1458
|
+
import { useClient as useClient11 } from "@dxos/react-client";
|
|
1459
|
+
import { Icon as Icon6, Input as Input6, Popover as Popover3, useTranslation as useTranslation22 } from "@dxos/react-ui";
|
|
1324
1460
|
import { SyntaxHighlighter } from "@dxos/react-ui-syntax-highlighter";
|
|
1325
1461
|
import { mx as mx6 } from "@dxos/react-ui-theme";
|
|
1326
1462
|
|
|
1327
1463
|
// packages/plugins/plugin-space/src/components/SyncStatus/Space.tsx
|
|
1328
|
-
import
|
|
1329
|
-
import { useClient as
|
|
1464
|
+
import React22, { useEffect as useEffect7, useState as useState13 } from "react";
|
|
1465
|
+
import { useClient as useClient10 } from "@dxos/react-client";
|
|
1330
1466
|
import { useSpace } from "@dxos/react-client/echo";
|
|
1331
1467
|
import { Icon as Icon5, toLocalizedString as toLocalizedString4, useTranslation as useTranslation21 } from "@dxos/react-ui";
|
|
1332
1468
|
import { mx as mx5 } from "@dxos/react-ui-theme";
|
|
@@ -1361,7 +1497,7 @@ var useActive = (count) => {
|
|
|
1361
1497
|
};
|
|
1362
1498
|
var SpaceRowContainer = ({ spaceId, state }) => {
|
|
1363
1499
|
const { t } = useTranslation21(SPACE_PLUGIN);
|
|
1364
|
-
const client =
|
|
1500
|
+
const client = useClient10();
|
|
1365
1501
|
const space = useSpace(spaceId);
|
|
1366
1502
|
if (!space) {
|
|
1367
1503
|
return null;
|
|
@@ -1369,7 +1505,7 @@ var SpaceRowContainer = ({ spaceId, state }) => {
|
|
|
1369
1505
|
const spaceName = toLocalizedString4(getSpaceDisplayName(space, {
|
|
1370
1506
|
personal: space === client.spaces.default
|
|
1371
1507
|
}), t);
|
|
1372
|
-
return /* @__PURE__ */
|
|
1508
|
+
return /* @__PURE__ */ React22.createElement(SpaceRow, {
|
|
1373
1509
|
spaceId,
|
|
1374
1510
|
spaceName,
|
|
1375
1511
|
state
|
|
@@ -1378,19 +1514,19 @@ var SpaceRowContainer = ({ spaceId, state }) => {
|
|
|
1378
1514
|
var SpaceRow = ({ spaceId, spaceName, state: { localDocumentCount, remoteDocumentCount, missingOnLocal, missingOnRemote } }) => {
|
|
1379
1515
|
const downActive = useActive(localDocumentCount);
|
|
1380
1516
|
const upActive = useActive(remoteDocumentCount);
|
|
1381
|
-
return /* @__PURE__ */
|
|
1517
|
+
return /* @__PURE__ */ React22.createElement("div", {
|
|
1382
1518
|
className: "flex items-center mx-0.5 gap-0.5 cursor-pointer",
|
|
1383
1519
|
title: spaceId,
|
|
1384
1520
|
onClick: () => {
|
|
1385
1521
|
void navigator.clipboard.writeText(spaceId);
|
|
1386
1522
|
}
|
|
1387
|
-
}, /* @__PURE__ */
|
|
1523
|
+
}, /* @__PURE__ */ React22.createElement("span", {
|
|
1388
1524
|
className: "is-1/2 truncate"
|
|
1389
|
-
}, spaceName), /* @__PURE__ */
|
|
1525
|
+
}, spaceName), /* @__PURE__ */ React22.createElement(Icon5, {
|
|
1390
1526
|
icon: "ph--arrow-fat-line-left--regular",
|
|
1391
1527
|
size: 3,
|
|
1392
1528
|
classNames: mx5(downActive && "animate-[pulse_1s_infinite]")
|
|
1393
|
-
}), /* @__PURE__ */
|
|
1529
|
+
}), /* @__PURE__ */ React22.createElement(Candle, {
|
|
1394
1530
|
up: {
|
|
1395
1531
|
count: remoteDocumentCount,
|
|
1396
1532
|
total: remoteDocumentCount + missingOnRemote
|
|
@@ -1400,44 +1536,44 @@ var SpaceRow = ({ spaceId, spaceName, state: { localDocumentCount, remoteDocumen
|
|
|
1400
1536
|
total: localDocumentCount + missingOnLocal
|
|
1401
1537
|
},
|
|
1402
1538
|
title: spaceId
|
|
1403
|
-
}), /* @__PURE__ */
|
|
1539
|
+
}), /* @__PURE__ */ React22.createElement(Icon5, {
|
|
1404
1540
|
icon: "ph--arrow-fat-line-right--regular",
|
|
1405
1541
|
size: 3,
|
|
1406
1542
|
classNames: mx5(upActive && "animate-[pulse_1s_step-start_infinite]")
|
|
1407
1543
|
}));
|
|
1408
1544
|
};
|
|
1409
1545
|
var Candle = ({ classNames, up, down }) => {
|
|
1410
|
-
return /* @__PURE__ */
|
|
1546
|
+
return /* @__PURE__ */ React22.createElement("div", {
|
|
1411
1547
|
className: mx5("grid grid-cols-[1fr_2rem_1fr] w-full h-3", classNames)
|
|
1412
|
-
}, /* @__PURE__ */
|
|
1548
|
+
}, /* @__PURE__ */ React22.createElement(Bar, {
|
|
1413
1549
|
classNames: "justify-end",
|
|
1414
1550
|
...up
|
|
1415
|
-
}), /* @__PURE__ */
|
|
1551
|
+
}), /* @__PURE__ */ React22.createElement("div", {
|
|
1416
1552
|
className: "relative"
|
|
1417
|
-
}, /* @__PURE__ */
|
|
1553
|
+
}, /* @__PURE__ */ React22.createElement("div", {
|
|
1418
1554
|
className: mx5("absolute inset-0 flex items-center justify-center text-xs", styles.barBg)
|
|
1419
|
-
}, up.total)), /* @__PURE__ */
|
|
1555
|
+
}, up.total)), /* @__PURE__ */ React22.createElement(Bar, down));
|
|
1420
1556
|
};
|
|
1421
1557
|
var Bar = ({ classNames, count, total }) => {
|
|
1422
1558
|
let p = count / total * 100;
|
|
1423
1559
|
if (count < total) {
|
|
1424
1560
|
p = Math.min(p, 95);
|
|
1425
1561
|
}
|
|
1426
|
-
return /* @__PURE__ */
|
|
1562
|
+
return /* @__PURE__ */ React22.createElement("div", {
|
|
1427
1563
|
className: mx5("relative flex w-full", styles.barBg, classNames)
|
|
1428
|
-
}, /* @__PURE__ */
|
|
1564
|
+
}, /* @__PURE__ */ React22.createElement("div", {
|
|
1429
1565
|
className: mx5("shrink-0", styles.barFg),
|
|
1430
1566
|
style: {
|
|
1431
1567
|
width: `${p}%`
|
|
1432
1568
|
}
|
|
1433
|
-
}), count !== total && /* @__PURE__ */
|
|
1569
|
+
}), count !== total && /* @__PURE__ */ React22.createElement("div", {
|
|
1434
1570
|
className: "absolute top-0 bottom-0 flex items-center mx-0.5 text-black text-xs"
|
|
1435
1571
|
}, count));
|
|
1436
1572
|
};
|
|
1437
1573
|
|
|
1438
1574
|
// packages/plugins/plugin-space/src/components/SyncStatus/save-tracker.ts
|
|
1439
1575
|
import { Context as Context2 } from "@dxos/context";
|
|
1440
|
-
var
|
|
1576
|
+
var __dxlog_file7 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/SyncStatus/save-tracker.ts";
|
|
1441
1577
|
var createClientSaveTracker = (client, cb) => {
|
|
1442
1578
|
const unsubscribeCallbacks = {};
|
|
1443
1579
|
const state = {};
|
|
@@ -1465,7 +1601,7 @@ var createClientSaveTracker = (client, cb) => {
|
|
|
1465
1601
|
};
|
|
1466
1602
|
var createSpaceSaveTracker = (space, cb) => {
|
|
1467
1603
|
const ctx = new Context2(void 0, {
|
|
1468
|
-
F:
|
|
1604
|
+
F: __dxlog_file7,
|
|
1469
1605
|
L: 40
|
|
1470
1606
|
});
|
|
1471
1607
|
void space.waitUntilReady().then(() => {
|
|
@@ -1528,7 +1664,7 @@ var getIcon = (status) => {
|
|
|
1528
1664
|
|
|
1529
1665
|
// packages/plugins/plugin-space/src/components/SyncStatus/SyncStatus.tsx
|
|
1530
1666
|
var SyncStatus = () => {
|
|
1531
|
-
const client =
|
|
1667
|
+
const client = useClient11();
|
|
1532
1668
|
const state = useSyncState();
|
|
1533
1669
|
const [saved, setSaved] = useState14(true);
|
|
1534
1670
|
useEffect8(() => {
|
|
@@ -1536,7 +1672,7 @@ var SyncStatus = () => {
|
|
|
1536
1672
|
setSaved(state2 === "saved");
|
|
1537
1673
|
});
|
|
1538
1674
|
}, []);
|
|
1539
|
-
return /* @__PURE__ */
|
|
1675
|
+
return /* @__PURE__ */ React23.createElement(SyncStatusIndicator, {
|
|
1540
1676
|
state,
|
|
1541
1677
|
saved
|
|
1542
1678
|
});
|
|
@@ -1569,27 +1705,25 @@ var SyncStatusIndicator = ({ state, saved }) => {
|
|
|
1569
1705
|
needsToDownload
|
|
1570
1706
|
]);
|
|
1571
1707
|
const title = t(`${status} label`);
|
|
1572
|
-
const icon = /* @__PURE__ */
|
|
1708
|
+
const icon = /* @__PURE__ */ React23.createElement(Icon6, {
|
|
1573
1709
|
icon: getIcon(status),
|
|
1574
1710
|
size: 4,
|
|
1575
1711
|
classNames
|
|
1576
1712
|
});
|
|
1577
1713
|
if (offline) {
|
|
1578
|
-
return /* @__PURE__ */
|
|
1714
|
+
return /* @__PURE__ */ React23.createElement(StatusBar.Item, {
|
|
1579
1715
|
title
|
|
1580
1716
|
}, icon);
|
|
1581
1717
|
} else {
|
|
1582
|
-
return /* @__PURE__ */
|
|
1718
|
+
return /* @__PURE__ */ React23.createElement(Popover3.Root, null, /* @__PURE__ */ React23.createElement(Popover3.Trigger, {
|
|
1583
1719
|
asChild: true
|
|
1584
|
-
}, /* @__PURE__ */
|
|
1720
|
+
}, /* @__PURE__ */ React23.createElement(StatusBar.Button, {
|
|
1585
1721
|
title
|
|
1586
|
-
}, icon)), /* @__PURE__ */
|
|
1587
|
-
sideOffset: 16
|
|
1588
|
-
}, /* @__PURE__ */ React22.createElement(SyncStatusDetail, {
|
|
1722
|
+
}, icon)), /* @__PURE__ */ React23.createElement(Popover3.Portal, null, /* @__PURE__ */ React23.createElement(Popover3.Content, null, /* @__PURE__ */ React23.createElement(SyncStatusDetail, {
|
|
1589
1723
|
state,
|
|
1590
1724
|
summary,
|
|
1591
1725
|
debug: false
|
|
1592
|
-
}))));
|
|
1726
|
+
}), /* @__PURE__ */ React23.createElement(Popover3.Arrow, null))));
|
|
1593
1727
|
}
|
|
1594
1728
|
};
|
|
1595
1729
|
var SyncStatusDetail = ({ classNames, state, summary, debug }) => {
|
|
@@ -1599,30 +1733,30 @@ var SyncStatusDetail = ({ classNames, state, summary, debug }) => {
|
|
|
1599
1733
|
const handleCheckedChange = useCallback12((state2) => setShowAll(state2), [
|
|
1600
1734
|
setShowAll
|
|
1601
1735
|
]);
|
|
1602
|
-
return /* @__PURE__ */
|
|
1736
|
+
return /* @__PURE__ */ React23.createElement("div", {
|
|
1603
1737
|
className: mx6("flex flex-col gap-3 p-2 text-xs min-w-96", classNames)
|
|
1604
|
-
}, /* @__PURE__ */
|
|
1738
|
+
}, /* @__PURE__ */ React23.createElement("div", {
|
|
1605
1739
|
role: "none",
|
|
1606
1740
|
className: "flex items-center"
|
|
1607
|
-
}, /* @__PURE__ */
|
|
1741
|
+
}, /* @__PURE__ */ React23.createElement("h1", {
|
|
1608
1742
|
className: "flex-1"
|
|
1609
|
-
}, t("sync status title")), /* @__PURE__ */
|
|
1743
|
+
}, t("sync status title")), /* @__PURE__ */ React23.createElement("div", {
|
|
1610
1744
|
className: "flex items-center gap-2"
|
|
1611
|
-
}, /* @__PURE__ */
|
|
1745
|
+
}, /* @__PURE__ */ React23.createElement(Input6.Root, null, /* @__PURE__ */ React23.createElement(Input6.Label, {
|
|
1612
1746
|
classNames: "text-xs"
|
|
1613
|
-
}, t("show all label")), /* @__PURE__ */
|
|
1747
|
+
}, t("show all label")), /* @__PURE__ */ React23.createElement(Input6.Checkbox, {
|
|
1614
1748
|
checked: showAll,
|
|
1615
1749
|
onCheckedChange: handleCheckedChange
|
|
1616
|
-
})))), /* @__PURE__ */
|
|
1750
|
+
})))), /* @__PURE__ */ React23.createElement("div", {
|
|
1617
1751
|
className: "flex flex-col gap-2"
|
|
1618
|
-
}, entries.length === 0 && /* @__PURE__ */
|
|
1752
|
+
}, entries.length === 0 && /* @__PURE__ */ React23.createElement("div", {
|
|
1619
1753
|
role: "none",
|
|
1620
1754
|
className: "flex justify-center"
|
|
1621
|
-
}, t("no sync status label")), entries.map(([spaceId, state2]) => /* @__PURE__ */
|
|
1755
|
+
}, t("no sync status label")), entries.map(([spaceId, state2]) => /* @__PURE__ */ React23.createElement(SpaceRowContainer, {
|
|
1622
1756
|
key: spaceId,
|
|
1623
1757
|
spaceId,
|
|
1624
1758
|
state: state2
|
|
1625
|
-
}))), debug && /* @__PURE__ */
|
|
1759
|
+
}))), debug && /* @__PURE__ */ React23.createElement(SyntaxHighlighter, {
|
|
1626
1760
|
language: "json"
|
|
1627
1761
|
}, JSON.stringify(summary, null, 2)));
|
|
1628
1762
|
};
|
|
@@ -1641,6 +1775,8 @@ export {
|
|
|
1641
1775
|
JoinDialog,
|
|
1642
1776
|
MenuFooter,
|
|
1643
1777
|
PersistenceStatus,
|
|
1778
|
+
POPOVER_ADD_SPACE,
|
|
1779
|
+
PopoverAddSpace,
|
|
1644
1780
|
POPOVER_RENAME_OBJECT,
|
|
1645
1781
|
PopoverRenameObject,
|
|
1646
1782
|
POPOVER_RENAME_SPACE,
|
|
@@ -1665,8 +1801,9 @@ export {
|
|
|
1665
1801
|
IntentResolver,
|
|
1666
1802
|
ReactRoot,
|
|
1667
1803
|
ReactSurface,
|
|
1804
|
+
Schema,
|
|
1668
1805
|
SpaceSettings,
|
|
1669
1806
|
SpaceState,
|
|
1670
1807
|
SpacesReady
|
|
1671
1808
|
};
|
|
1672
|
-
//# sourceMappingURL=chunk-
|
|
1809
|
+
//# sourceMappingURL=chunk-S6B7627U.mjs.map
|