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