@dxos/plugin-space 0.7.5-main.9d26e3a → 0.7.5-main.b19bfc8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/browser/app-graph-builder-MGK5HWPZ.mjs +288 -0
- package/dist/lib/browser/app-graph-builder-MGK5HWPZ.mjs.map +7 -0
- package/dist/lib/browser/app-graph-serializer-FOWFLYGU.mjs +80 -0
- package/dist/lib/browser/app-graph-serializer-FOWFLYGU.mjs.map +7 -0
- package/dist/lib/browser/chunk-23RVI5FZ.mjs +539 -0
- package/dist/lib/browser/chunk-23RVI5FZ.mjs.map +7 -0
- package/dist/lib/browser/chunk-NU7WDVGN.mjs +23 -0
- package/dist/lib/browser/chunk-NU7WDVGN.mjs.map +7 -0
- package/dist/lib/browser/chunk-PQXZCNAU.mjs +13 -0
- package/dist/lib/browser/chunk-PQXZCNAU.mjs.map +7 -0
- package/dist/lib/browser/chunk-S6B7627U.mjs +1809 -0
- package/dist/lib/browser/chunk-S6B7627U.mjs.map +7 -0
- package/dist/lib/browser/chunk-UDWHTKB5.mjs +136 -0
- package/dist/lib/browser/chunk-UDWHTKB5.mjs.map +7 -0
- package/dist/lib/browser/{chunk-54VE4GTA.mjs → chunk-ULA2UQJ4.mjs} +25 -15
- package/dist/lib/browser/chunk-ULA2UQJ4.mjs.map +7 -0
- package/dist/lib/browser/identity-created-FYGS6TBH.mjs +28 -0
- package/dist/lib/browser/identity-created-FYGS6TBH.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +219 -3480
- package/dist/lib/browser/index.mjs.map +4 -4
- 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-IP2ZB245.mjs +28 -0
- package/dist/lib/browser/react-root-IP2ZB245.mjs.map +7 -0
- package/dist/lib/browser/react-surface-BT3EHB6V.mjs +225 -0
- 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-PHPCXX33.mjs +24 -0
- package/dist/lib/browser/settings-PHPCXX33.mjs.map +7 -0
- package/dist/lib/browser/spaces-ready-K47RR7N2.mjs +199 -0
- package/dist/lib/browser/spaces-ready-K47RR7N2.mjs.map +7 -0
- package/dist/lib/browser/state-INJ63O57.mjs +47 -0
- package/dist/lib/browser/state-INJ63O57.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +6 -4
- package/dist/lib/node/app-graph-builder-ZIUBXRPA.cjs +291 -0
- package/dist/lib/node/app-graph-builder-ZIUBXRPA.cjs.map +7 -0
- package/dist/lib/node/app-graph-serializer-VQOGHKXL.cjs +88 -0
- package/dist/lib/node/app-graph-serializer-VQOGHKXL.cjs.map +7 -0
- package/dist/lib/node/chunk-N2FS7PRA.cjs +1807 -0
- package/dist/lib/node/chunk-N2FS7PRA.cjs.map +7 -0
- package/dist/lib/node/chunk-OVGKWJOC.cjs +567 -0
- package/dist/lib/node/chunk-OVGKWJOC.cjs.map +7 -0
- package/dist/lib/node/chunk-U6DYXAR3.cjs +153 -0
- package/dist/lib/node/chunk-U6DYXAR3.cjs.map +7 -0
- package/dist/lib/node/{chunk-YF2AQ7KP.cjs → chunk-WAJKBO3J.cjs} +31 -20
- package/dist/lib/node/chunk-WAJKBO3J.cjs.map +7 -0
- package/dist/lib/node/{chunk-46S3JOES.cjs → chunk-WZR6OAN3.cjs} +9 -12
- package/dist/lib/node/chunk-WZR6OAN3.cjs.map +7 -0
- package/dist/lib/node/chunk-YZKNRFHU.cjs +43 -0
- package/dist/lib/node/chunk-YZKNRFHU.cjs.map +7 -0
- package/dist/lib/node/identity-created-AXI64BLE.cjs +44 -0
- package/dist/lib/node/identity-created-AXI64BLE.cjs.map +7 -0
- package/dist/lib/node/index.cjs +203 -3468
- package/dist/lib/node/index.cjs.map +4 -4
- 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-3OX5Z5CX.cjs +50 -0
- package/dist/lib/node/react-root-3OX5Z5CX.cjs.map +7 -0
- package/dist/lib/node/react-surface-5NYCMXSM.cjs +221 -0
- 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/{meta.cjs → settings-5QYFWNH7.cjs} +19 -13
- package/dist/lib/node/settings-5QYFWNH7.cjs.map +7 -0
- package/dist/lib/node/spaces-ready-FQNAKR7G.cjs +210 -0
- package/dist/lib/node/spaces-ready-FQNAKR7G.cjs.map +7 -0
- package/dist/lib/node/state-57UE3DYE.cjs +61 -0
- package/dist/lib/node/state-57UE3DYE.cjs.map +7 -0
- 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-TERVM2SL.mjs +289 -0
- package/dist/lib/node-esm/app-graph-builder-TERVM2SL.mjs.map +7 -0
- package/dist/lib/node-esm/app-graph-serializer-GZRSWHEN.mjs +81 -0
- package/dist/lib/node-esm/app-graph-serializer-GZRSWHEN.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-2TQ2AJEZ.mjs +137 -0
- package/dist/lib/node-esm/chunk-2TQ2AJEZ.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-6RSVVEPS.mjs +24 -0
- package/dist/lib/node-esm/chunk-6RSVVEPS.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-DIKRH2IK.mjs +1810 -0
- package/dist/lib/node-esm/chunk-DIKRH2IK.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-2MNFEB23.mjs → chunk-ICCM4YRJ.mjs} +5 -7
- package/dist/lib/node-esm/chunk-ICCM4YRJ.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-PGH5L7MV.mjs +540 -0
- package/dist/lib/node-esm/chunk-PGH5L7MV.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-CDZETPO7.mjs → chunk-TRNZQEEN.mjs} +25 -15
- package/dist/lib/node-esm/chunk-TRNZQEEN.mjs.map +7 -0
- package/dist/lib/node-esm/identity-created-3CGEXNPO.mjs +29 -0
- package/dist/lib/node-esm/identity-created-3CGEXNPO.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +219 -3480
- package/dist/lib/node-esm/index.mjs.map +4 -4
- 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-7XXGP56B.mjs +29 -0
- package/dist/lib/node-esm/react-root-7XXGP56B.mjs.map +7 -0
- package/dist/lib/node-esm/react-surface-R2ECJSFB.mjs +226 -0
- 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-H6MXTEQM.mjs +25 -0
- package/dist/lib/node-esm/settings-H6MXTEQM.mjs.map +7 -0
- package/dist/lib/node-esm/spaces-ready-HKAQG5SA.mjs +200 -0
- package/dist/lib/node-esm/spaces-ready-HKAQG5SA.mjs.map +7 -0
- package/dist/lib/node-esm/state-VYA6OFHD.mjs +48 -0
- package/dist/lib/node-esm/state-VYA6OFHD.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +6 -4
- package/dist/types/src/SpacePlugin.d.ts +3 -22
- package/dist/types/src/SpacePlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts +181 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-serializer.d.ts +4 -0
- package/dist/types/src/capabilities/app-graph-serializer.d.ts.map +1 -0
- package/dist/types/src/capabilities/capabilities.d.ts +22 -0
- package/dist/types/src/capabilities/capabilities.d.ts.map +1 -0
- package/dist/types/src/capabilities/identity-created.d.ts +4 -0
- package/dist/types/src/capabilities/identity-created.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +197 -0
- package/dist/types/src/capabilities/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/intent-resolver.d.ts +9 -0
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-root.d.ts +7 -0
- package/dist/types/src/capabilities/react-root.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface.d.ts +7 -0
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
- 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/settings.d.ts +4 -0
- package/dist/types/src/capabilities/settings.d.ts.map +1 -0
- package/dist/types/src/capabilities/spaces-ready.d.ts +4 -0
- package/dist/types/src/capabilities/spaces-ready.d.ts.map +1 -0
- package/dist/types/src/capabilities/state.d.ts +5 -0
- package/dist/types/src/capabilities/state.d.ts.map +1 -0
- package/dist/types/src/components/AdvancedObjectSettings/AdvancedObjectSettings.d.ts +6 -0
- package/dist/types/src/components/AdvancedObjectSettings/AdvancedObjectSettings.d.ts.map +1 -0
- package/dist/types/src/components/AdvancedObjectSettings/ForeignKeys.d.ts +7 -0
- package/dist/types/src/components/AdvancedObjectSettings/ForeignKeys.d.ts.map +1 -0
- package/dist/types/src/components/AdvancedObjectSettings/index.d.ts +2 -0
- package/dist/types/src/components/AdvancedObjectSettings/index.d.ts.map +1 -0
- 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 +6 -0
- package/dist/types/src/components/BaseObjectSettings.d.ts.map +1 -0
- 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 -5
- 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 +9 -11
- 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 +3 -1
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/events.d.ts +9 -0
- package/dist/types/src/events.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +3 -5
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +2 -4
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +21 -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 +41 -37
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/src/util.d.ts +10 -8
- package/dist/types/src/util.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +41 -47
- package/src/SpacePlugin.tsx +141 -1410
- package/src/capabilities/app-graph-builder.ts +319 -0
- package/src/capabilities/app-graph-serializer.ts +73 -0
- package/src/capabilities/capabilities.ts +28 -0
- package/src/capabilities/identity-created.ts +26 -0
- package/src/capabilities/index.ts +18 -0
- package/src/capabilities/intent-resolver.ts +536 -0
- package/src/capabilities/react-root.tsx +20 -0
- package/src/capabilities/react-surface.tsx +210 -0
- package/src/capabilities/schema.ts +27 -0
- package/src/capabilities/settings.ts +17 -0
- package/src/capabilities/spaces-ready.ts +230 -0
- package/src/capabilities/state.ts +45 -0
- package/src/components/AdvancedObjectSettings/AdvancedObjectSettings.tsx +72 -0
- package/src/components/AdvancedObjectSettings/ForeignKeys.tsx +51 -0
- package/src/components/AdvancedObjectSettings/index.ts +5 -0
- package/src/components/AwaitingObject.tsx +5 -11
- package/src/components/{DefaultObjectSettings.tsx → BaseObjectSettings.tsx} +9 -2
- package/src/components/CreateDialog/CreateObjectDialog.stories.tsx +1 -3
- package/src/components/CreateDialog/CreateObjectDialog.tsx +43 -35
- package/src/components/CreateDialog/CreateObjectPanel.tsx +139 -105
- 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 +5 -10
- package/src/components/SpacePresence.stories.tsx +2 -2
- package/src/components/SpacePresence.tsx +7 -7
- 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 +3 -1
- package/src/events.ts +18 -0
- package/src/index.ts +3 -7
- package/src/meta.ts +2 -3
- package/src/translations.ts +7 -0
- package/src/types/types.ts +32 -51
- package/src/util.tsx +45 -29
- package/dist/lib/browser/chunk-54VE4GTA.mjs.map +0 -7
- package/dist/lib/browser/chunk-73BCBSLP.mjs +0 -15
- package/dist/lib/browser/chunk-73BCBSLP.mjs.map +0 -7
- package/dist/lib/browser/meta.mjs +0 -11
- package/dist/lib/browser/meta.mjs.map +0 -7
- package/dist/lib/node/chunk-46S3JOES.cjs.map +0 -7
- package/dist/lib/node/chunk-YF2AQ7KP.cjs.map +0 -7
- package/dist/lib/node/meta.cjs.map +0 -7
- package/dist/lib/node-esm/chunk-2MNFEB23.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-CDZETPO7.mjs.map +0 -7
- package/dist/lib/node-esm/meta.mjs +0 -12
- package/dist/lib/node-esm/meta.mjs.map +0 -7
- package/dist/types/src/components/DefaultObjectSettings.d.ts +0 -7
- package/dist/types/src/components/DefaultObjectSettings.d.ts.map +0 -1
package/dist/lib/node/index.cjs
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
2
|
var __defProp = Object.defineProperty;
|
|
4
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
6
|
var __export = (target, all) => {
|
|
9
7
|
for (var name in all)
|
|
@@ -17,3522 +15,261 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
15
|
}
|
|
18
16
|
return to;
|
|
19
17
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
19
|
var node_exports = {};
|
|
30
20
|
__export(node_exports, {
|
|
31
|
-
|
|
32
|
-
AwaitingObject: () => AwaitingObject,
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
SPACE_TYPE: () => SPACE_TYPE,
|
|
65
|
-
ShareSpaceButton: () => ShareSpaceButton,
|
|
66
|
-
ShareSpaceButtonImpl: () => ShareSpaceButtonImpl,
|
|
67
|
-
SmallPresence: () => SmallPresence,
|
|
68
|
-
SmallPresenceLive: () => SmallPresenceLive,
|
|
69
|
-
SpaceAction: () => import_chunk_YF2AQ7KP.SpaceAction,
|
|
70
|
-
SpaceForm: () => import_chunk_YF2AQ7KP.SpaceForm,
|
|
21
|
+
AdvancedObjectSettings: () => import_chunk_N2FS7PRA.AdvancedObjectSettings,
|
|
22
|
+
AwaitingObject: () => import_chunk_N2FS7PRA.AwaitingObject,
|
|
23
|
+
BaseObjectSettings: () => import_chunk_N2FS7PRA.BaseObjectSettings,
|
|
24
|
+
COMPOSER_SPACE_LOCK: () => import_chunk_OVGKWJOC.COMPOSER_SPACE_LOCK,
|
|
25
|
+
CREATE_OBJECT_DIALOG: () => import_chunk_N2FS7PRA.CREATE_OBJECT_DIALOG,
|
|
26
|
+
CREATE_SPACE_DIALOG: () => import_chunk_N2FS7PRA.CREATE_SPACE_DIALOG,
|
|
27
|
+
CollectionMain: () => import_chunk_N2FS7PRA.CollectionMain,
|
|
28
|
+
CollectionSection: () => import_chunk_N2FS7PRA.CollectionSection,
|
|
29
|
+
CreateObjectDialog: () => import_chunk_N2FS7PRA.CreateObjectDialog,
|
|
30
|
+
CreateSpaceDialog: () => import_chunk_N2FS7PRA.CreateSpaceDialog,
|
|
31
|
+
FullPresence: () => import_chunk_N2FS7PRA.FullPresence,
|
|
32
|
+
InlineSyncStatus: () => import_chunk_N2FS7PRA.InlineSyncStatus,
|
|
33
|
+
JOIN_DIALOG: () => import_chunk_N2FS7PRA.JOIN_DIALOG,
|
|
34
|
+
JoinDialog: () => import_chunk_N2FS7PRA.JoinDialog,
|
|
35
|
+
MenuFooter: () => import_chunk_N2FS7PRA.MenuFooter,
|
|
36
|
+
POPOVER_ADD_SPACE: () => import_chunk_N2FS7PRA.POPOVER_ADD_SPACE,
|
|
37
|
+
POPOVER_RENAME_OBJECT: () => import_chunk_N2FS7PRA.POPOVER_RENAME_OBJECT,
|
|
38
|
+
POPOVER_RENAME_SPACE: () => import_chunk_N2FS7PRA.POPOVER_RENAME_SPACE,
|
|
39
|
+
PersistenceStatus: () => import_chunk_N2FS7PRA.PersistenceStatus,
|
|
40
|
+
PopoverAddSpace: () => import_chunk_N2FS7PRA.PopoverAddSpace,
|
|
41
|
+
PopoverRenameObject: () => import_chunk_N2FS7PRA.PopoverRenameObject,
|
|
42
|
+
PopoverRenameSpace: () => import_chunk_N2FS7PRA.PopoverRenameSpace,
|
|
43
|
+
SHARED: () => import_chunk_OVGKWJOC.SHARED,
|
|
44
|
+
SPACES: () => import_chunk_OVGKWJOC.SPACES,
|
|
45
|
+
SPACE_PLUGIN: () => import_chunk_WZR6OAN3.SPACE_PLUGIN,
|
|
46
|
+
SPACE_SETTINGS_DIALOG: () => import_chunk_N2FS7PRA.SPACE_SETTINGS_DIALOG,
|
|
47
|
+
SPACE_TYPE: () => import_chunk_OVGKWJOC.SPACE_TYPE,
|
|
48
|
+
ShareSpaceButton: () => import_chunk_N2FS7PRA.ShareSpaceButton,
|
|
49
|
+
ShareSpaceButtonImpl: () => import_chunk_N2FS7PRA.ShareSpaceButtonImpl,
|
|
50
|
+
SmallPresence: () => import_chunk_N2FS7PRA.SmallPresence,
|
|
51
|
+
SmallPresenceLive: () => import_chunk_N2FS7PRA.SmallPresenceLive,
|
|
52
|
+
SpaceCapabilities: () => import_chunk_YZKNRFHU.SpaceCapabilities,
|
|
53
|
+
SpaceEvents: () => SpaceEvents,
|
|
71
54
|
SpacePlugin: () => SpacePlugin,
|
|
72
|
-
SpacePluginSettings: () => SpacePluginSettings,
|
|
73
|
-
SpacePresence: () => SpacePresence,
|
|
74
|
-
SpaceSettingsDialog: () => SpaceSettingsDialog,
|
|
75
|
-
SpaceSettingsPanel: () => SpaceSettingsPanel,
|
|
76
|
-
SyncStatus: () => SyncStatus,
|
|
77
|
-
SyncStatusDetail: () => SyncStatusDetail,
|
|
78
|
-
SyncStatusIndicator: () => SyncStatusIndicator,
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
cloneObject: () => cloneObject,
|
|
82
|
-
constructObjectActions: () => constructObjectActions,
|
|
83
|
-
constructSpaceActions: () => constructSpaceActions,
|
|
84
|
-
constructSpaceNode: () => constructSpaceNode,
|
|
85
|
-
createObjectNode: () => createObjectNode,
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
parseSchemaPlugin: () => import_chunk_YF2AQ7KP.parseSchemaPlugin,
|
|
92
|
-
parseSpacePlugin: () => parseSpacePlugin,
|
|
93
|
-
translations: () => translations_default
|
|
55
|
+
SpacePluginSettings: () => import_chunk_N2FS7PRA.SpacePluginSettings,
|
|
56
|
+
SpacePresence: () => import_chunk_N2FS7PRA.SpacePresence,
|
|
57
|
+
SpaceSettingsDialog: () => import_chunk_N2FS7PRA.SpaceSettingsDialog,
|
|
58
|
+
SpaceSettingsPanel: () => import_chunk_N2FS7PRA.SpaceSettingsPanel,
|
|
59
|
+
SyncStatus: () => import_chunk_N2FS7PRA.SyncStatus,
|
|
60
|
+
SyncStatusDetail: () => import_chunk_N2FS7PRA.SyncStatusDetail,
|
|
61
|
+
SyncStatusIndicator: () => import_chunk_N2FS7PRA.SyncStatusIndicator,
|
|
62
|
+
ThreadCapabilities: () => import_chunk_YZKNRFHU.ThreadCapabilities,
|
|
63
|
+
ThreadEvents: () => ThreadEvents,
|
|
64
|
+
cloneObject: () => import_chunk_OVGKWJOC.cloneObject,
|
|
65
|
+
constructObjectActions: () => import_chunk_OVGKWJOC.constructObjectActions,
|
|
66
|
+
constructSpaceActions: () => import_chunk_OVGKWJOC.constructSpaceActions,
|
|
67
|
+
constructSpaceNode: () => import_chunk_OVGKWJOC.constructSpaceNode,
|
|
68
|
+
createObjectNode: () => import_chunk_OVGKWJOC.createObjectNode,
|
|
69
|
+
getActiveSpace: () => import_chunk_OVGKWJOC.getActiveSpace,
|
|
70
|
+
getNestedObjects: () => import_chunk_OVGKWJOC.getNestedObjects,
|
|
71
|
+
getSpaceDisplayName: () => import_chunk_OVGKWJOC.getSpaceDisplayName,
|
|
72
|
+
memoizeQuery: () => import_chunk_OVGKWJOC.memoizeQuery,
|
|
73
|
+
meta: () => import_chunk_WZR6OAN3.meta
|
|
94
74
|
});
|
|
95
75
|
module.exports = __toCommonJS(node_exports);
|
|
96
|
-
var
|
|
97
|
-
var
|
|
98
|
-
var
|
|
99
|
-
var
|
|
76
|
+
var import_chunk_U6DYXAR3 = require("./chunk-U6DYXAR3.cjs");
|
|
77
|
+
var import_chunk_N2FS7PRA = require("./chunk-N2FS7PRA.cjs");
|
|
78
|
+
var import_chunk_YZKNRFHU = require("./chunk-YZKNRFHU.cjs");
|
|
79
|
+
var import_chunk_OVGKWJOC = require("./chunk-OVGKWJOC.cjs");
|
|
80
|
+
var import_chunk_WAJKBO3J = require("./chunk-WAJKBO3J.cjs");
|
|
81
|
+
var import_chunk_WZR6OAN3 = require("./chunk-WZR6OAN3.cjs");
|
|
100
82
|
var import_app_framework = require("@dxos/app-framework");
|
|
101
|
-
var
|
|
102
|
-
var
|
|
103
|
-
var import_invariant = require("@dxos/invariant");
|
|
83
|
+
var import_app_framework2 = require("@dxos/app-framework");
|
|
84
|
+
var import_echo_schema = require("@dxos/echo-schema");
|
|
104
85
|
var import_live_object = require("@dxos/live-object");
|
|
105
|
-
var import_local_storage = require("@dxos/local-storage");
|
|
106
|
-
var import_log = require("@dxos/log");
|
|
107
|
-
var import_migrations = require("@dxos/migrations");
|
|
108
86
|
var import_plugin_attention = require("@dxos/plugin-attention");
|
|
109
|
-
var
|
|
110
|
-
var
|
|
111
|
-
var import_types2 = require("@dxos/plugin-observability/types");
|
|
112
|
-
var import_metadata = require("@dxos/protocols/proto/dxos/echo/metadata");
|
|
113
|
-
var import_react_client = require("@dxos/react-client");
|
|
87
|
+
var import_plugin_client = require("@dxos/plugin-client");
|
|
88
|
+
var import_plugin_deck = require("@dxos/plugin-deck");
|
|
114
89
|
var import_echo = require("@dxos/react-client/echo");
|
|
115
|
-
var
|
|
116
|
-
var
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
var
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
var
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
var import_echo_schema = require("@dxos/echo-schema");
|
|
132
|
-
var import_echo4 = require("@dxos/react-client/echo");
|
|
133
|
-
var import_react_ui3 = require("@dxos/react-ui");
|
|
134
|
-
var import_react_ui_form = require("@dxos/react-ui-form");
|
|
135
|
-
var import_react_ui_searchlist = require("@dxos/react-ui-searchlist");
|
|
136
|
-
var import_util2 = require("@dxos/util");
|
|
137
|
-
var import_app_framework4 = require("@dxos/app-framework");
|
|
138
|
-
var import_echo_schema2 = require("@dxos/echo-schema");
|
|
139
|
-
var import_invariant2 = require("@dxos/invariant");
|
|
140
|
-
var import_live_object2 = require("@dxos/live-object");
|
|
141
|
-
var import_migrations2 = require("@dxos/migrations");
|
|
142
|
-
var import_plugin_graph2 = require("@dxos/plugin-graph");
|
|
143
|
-
var import_echo5 = require("@dxos/react-client/echo");
|
|
144
|
-
var import_react7 = __toESM(require("react"));
|
|
145
|
-
var import_app_framework5 = require("@dxos/app-framework");
|
|
146
|
-
var import_react_ui4 = require("@dxos/react-ui");
|
|
147
|
-
var import_react_ui_form2 = require("@dxos/react-ui-form");
|
|
148
|
-
var import_react8 = __toESM(require("react"));
|
|
149
|
-
var import_react_ui5 = require("@dxos/react-ui");
|
|
150
|
-
var import_react_ui_theme2 = require("@dxos/react-ui-theme");
|
|
151
|
-
var import_react9 = __toESM(require("react"));
|
|
152
|
-
var import_react_ui6 = require("@dxos/react-ui");
|
|
153
|
-
var import_react10 = __toESM(require("react"));
|
|
154
|
-
var import_react_ui7 = require("@dxos/react-ui");
|
|
155
|
-
var import_react11 = __toESM(require("react"));
|
|
156
|
-
var import_app_framework6 = require("@dxos/app-framework");
|
|
157
|
-
var import_plugin_graph3 = require("@dxos/plugin-graph");
|
|
158
|
-
var import_types3 = require("@dxos/plugin-observability/types");
|
|
159
|
-
var import_echo6 = require("@dxos/react-client/echo");
|
|
160
|
-
var import_react_ui8 = require("@dxos/react-ui");
|
|
161
|
-
var import_react12 = require("@dxos/shell/react");
|
|
162
|
-
var import_react13 = require("@phosphor-icons/react");
|
|
163
|
-
var import_react14 = __toESM(require("react"));
|
|
164
|
-
var import_echo7 = require("@dxos/client/echo");
|
|
165
|
-
var import_react_client4 = require("@dxos/react-client");
|
|
166
|
-
var import_react_ui9 = require("@dxos/react-ui");
|
|
167
|
-
var import_react15 = require("@phosphor-icons/react");
|
|
168
|
-
var import_react16 = __toESM(require("react"));
|
|
169
|
-
var import_async2 = require("@dxos/async");
|
|
170
|
-
var import_react_ui10 = require("@dxos/react-ui");
|
|
171
|
-
var import_react_ui_theme3 = require("@dxos/react-ui-theme");
|
|
172
|
-
var import_react17 = __toESM(require("react"));
|
|
173
|
-
var import_log2 = require("@dxos/log");
|
|
174
|
-
var import_react_ui11 = require("@dxos/react-ui");
|
|
175
|
-
var import_react18 = __toESM(require("react"));
|
|
176
|
-
var import_react_ui12 = require("@dxos/react-ui");
|
|
177
|
-
var import_react19 = __toESM(require("react"));
|
|
178
|
-
var import_app_framework7 = require("@dxos/app-framework");
|
|
179
|
-
var import_react_ui13 = require("@dxos/react-ui");
|
|
180
|
-
var import_react20 = __toESM(require("react"));
|
|
181
|
-
var import_app_framework8 = require("@dxos/app-framework");
|
|
182
|
-
var import_display_name = require("@dxos/display-name");
|
|
183
|
-
var import_plugin_graph4 = require("@dxos/plugin-graph");
|
|
184
|
-
var import_react_client5 = require("@dxos/react-client");
|
|
185
|
-
var import_echo8 = require("@dxos/react-client/echo");
|
|
186
|
-
var import_halo = require("@dxos/react-client/halo");
|
|
187
|
-
var import_react_ui14 = require("@dxos/react-ui");
|
|
188
|
-
var import_react_ui_attention = require("@dxos/react-ui-attention");
|
|
189
|
-
var import_util3 = require("@dxos/util");
|
|
190
|
-
var import_react21 = require("react");
|
|
191
|
-
var import_react22 = __toESM(require("react"));
|
|
192
|
-
var import_app_framework9 = require("@dxos/app-framework");
|
|
193
|
-
var import_react_ui15 = require("@dxos/react-ui");
|
|
194
|
-
var import_react_ui_form3 = require("@dxos/react-ui-form");
|
|
195
|
-
var import_react23 = __toESM(require("react"));
|
|
196
|
-
var import_react_client6 = require("@dxos/react-client");
|
|
197
|
-
var import_react_ui16 = require("@dxos/react-ui");
|
|
198
|
-
var import_react_ui_tabs = require("@dxos/react-ui-tabs");
|
|
199
|
-
var import_react24 = require("@dxos/shell/react");
|
|
200
|
-
var import_react25 = __toESM(require("react"));
|
|
201
|
-
var import_log3 = require("@dxos/log");
|
|
202
|
-
var import_metadata2 = require("@dxos/protocols/proto/dxos/echo/metadata");
|
|
203
|
-
var import_react_client7 = require("@dxos/react-client");
|
|
204
|
-
var import_react_ui17 = require("@dxos/react-ui");
|
|
205
|
-
var import_react_ui_form4 = require("@dxos/react-ui-form");
|
|
206
|
-
var import_react_ui_theme4 = require("@dxos/react-ui-theme");
|
|
207
|
-
var import_react26 = __toESM(require("react"));
|
|
208
|
-
var import_plugin_graph5 = require("@dxos/plugin-graph");
|
|
209
|
-
var import_services = require("@dxos/protocols/proto/dxos/client/services");
|
|
210
|
-
var import_metadata3 = require("@dxos/protocols/proto/dxos/echo/metadata");
|
|
211
|
-
var import_react_client8 = require("@dxos/react-client");
|
|
212
|
-
var import_react_ui18 = require("@dxos/react-ui");
|
|
213
|
-
var import_react_ui_attention2 = require("@dxos/react-ui-attention");
|
|
214
|
-
var import_react27 = require("react");
|
|
215
|
-
var import_context = require("@dxos/context");
|
|
216
|
-
var import_protocols = require("@dxos/protocols");
|
|
217
|
-
var import_react_client9 = require("@dxos/react-client");
|
|
218
|
-
var import_react28 = __toESM(require("react"));
|
|
219
|
-
var import_plugin_status_bar = require("@dxos/plugin-status-bar");
|
|
220
|
-
var import_react_client10 = require("@dxos/react-client");
|
|
221
|
-
var import_react_ui19 = require("@dxos/react-ui");
|
|
222
|
-
var import_react_ui_syntax_highlighter = require("@dxos/react-ui-syntax-highlighter");
|
|
223
|
-
var import_react_ui_theme5 = require("@dxos/react-ui-theme");
|
|
224
|
-
var import_react29 = __toESM(require("react"));
|
|
225
|
-
var import_react_client11 = require("@dxos/react-client");
|
|
226
|
-
var import_echo9 = require("@dxos/react-client/echo");
|
|
227
|
-
var import_react_ui20 = require("@dxos/react-ui");
|
|
228
|
-
var import_react_ui_theme6 = require("@dxos/react-ui-theme");
|
|
229
|
-
var import_context2 = require("@dxos/context");
|
|
230
|
-
var WAIT_FOR_OBJECT_TIMEOUT = 18e4;
|
|
231
|
-
var TOAST_TIMEOUT = 24e4;
|
|
232
|
-
var AwaitingObject = ({ id }) => {
|
|
233
|
-
const [open, setOpen] = (0, import_react4.useState)(true);
|
|
234
|
-
const [waiting, setWaiting] = (0, import_react4.useState)(true);
|
|
235
|
-
const [found, setFound] = (0, import_react4.useState)(false);
|
|
236
|
-
const { t } = (0, import_react_ui.useTranslation)(import_chunk_46S3JOES.SPACE_PLUGIN);
|
|
237
|
-
const { dispatchPromise: dispatch } = (0, import_app_framework2.useIntentDispatcher)();
|
|
238
|
-
const navigationPlugin = (0, import_app_framework2.useResolvePlugin)(import_app_framework2.parseNavigationPlugin);
|
|
239
|
-
const client = (0, import_react_client2.useClient)();
|
|
240
|
-
const objects = (0, import_echo2.useQuery)(client.spaces, import_echo2.Filter.all());
|
|
241
|
-
(0, import_react4.useEffect)(() => {
|
|
242
|
-
if (!id) {
|
|
243
|
-
return;
|
|
244
|
-
}
|
|
245
|
-
const timeout = setTimeout(() => {
|
|
246
|
-
setWaiting(false);
|
|
247
|
-
}, WAIT_FOR_OBJECT_TIMEOUT);
|
|
248
|
-
() => clearTimeout(timeout);
|
|
249
|
-
}, [
|
|
250
|
-
id
|
|
251
|
-
]);
|
|
252
|
-
(0, import_react4.useEffect)(() => {
|
|
253
|
-
if (objects.findIndex((object) => (0, import_echo2.fullyQualifiedId)(object) === id) > -1) {
|
|
254
|
-
setFound(true);
|
|
255
|
-
if (navigationPlugin?.provides.location.active.solo?.[0].id === id) {
|
|
256
|
-
setOpen(false);
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
}, [
|
|
260
|
-
id,
|
|
261
|
-
objects,
|
|
262
|
-
navigationPlugin
|
|
263
|
-
]);
|
|
264
|
-
const handleClose = (0, import_react4.useCallback)(async () => dispatch((0, import_app_framework2.createIntent)(import_chunk_YF2AQ7KP.SpaceAction.WaitForObject, {
|
|
265
|
-
id: void 0
|
|
266
|
-
})), [
|
|
267
|
-
dispatch
|
|
268
|
-
]);
|
|
269
|
-
const handleNavigate = (0, import_react4.useCallback)(() => {
|
|
270
|
-
void dispatch((0, import_app_framework2.createIntent)(import_app_framework2.NavigationAction.Open, {
|
|
271
|
-
activeParts: {
|
|
272
|
-
main: [
|
|
273
|
-
id
|
|
274
|
-
]
|
|
275
|
-
}
|
|
276
|
-
}));
|
|
277
|
-
void handleClose();
|
|
278
|
-
}, [
|
|
279
|
-
id,
|
|
280
|
-
handleClose,
|
|
281
|
-
dispatch
|
|
282
|
-
]);
|
|
283
|
-
return /* @__PURE__ */ import_react4.default.createElement(import_react_ui.Toast.Root, {
|
|
284
|
-
open,
|
|
285
|
-
duration: TOAST_TIMEOUT,
|
|
286
|
-
onOpenChange: setOpen
|
|
287
|
-
}, /* @__PURE__ */ import_react4.default.createElement(import_react_ui.Toast.Body, null, /* @__PURE__ */ import_react4.default.createElement(import_react_ui.Toast.Title, {
|
|
288
|
-
classNames: "flex items-center gap-2"
|
|
289
|
-
}, found ? /* @__PURE__ */ import_react4.default.createElement(import_react4.default.Fragment, null, /* @__PURE__ */ import_react4.default.createElement(import_react3.CheckCircle, {
|
|
290
|
-
className: (0, import_react_ui_theme.getSize)(5)
|
|
291
|
-
}), /* @__PURE__ */ import_react4.default.createElement("span", null, t("found object label"))) : waiting ? /* @__PURE__ */ import_react4.default.createElement(import_react4.default.Fragment, null, /* @__PURE__ */ import_react4.default.createElement(import_react3.CircleNotch, {
|
|
292
|
-
className: (0, import_react_ui_theme.mx)((0, import_react_ui_theme.getSize)(5), "animate-spin")
|
|
293
|
-
}), /* @__PURE__ */ import_react4.default.createElement("span", null, t("waiting for object label"))) : /* @__PURE__ */ import_react4.default.createElement(import_react4.default.Fragment, null, /* @__PURE__ */ import_react4.default.createElement(import_react3.CircleDashed, {
|
|
294
|
-
className: (0, import_react_ui_theme.getSize)(5)
|
|
295
|
-
}), /* @__PURE__ */ import_react4.default.createElement("span", null, t("object not found label")))), /* @__PURE__ */ import_react4.default.createElement(import_react_ui.Toast.Description, null, t(found ? "found object description" : waiting ? "waiting for object description" : "object not found description"))), /* @__PURE__ */ import_react4.default.createElement(import_react_ui.Toast.Actions, null, found ? /* @__PURE__ */ import_react4.default.createElement(import_react4.default.Fragment, null, /* @__PURE__ */ import_react4.default.createElement(import_react_ui.Toast.Action, {
|
|
296
|
-
altText: t("go to object alt"),
|
|
297
|
-
asChild: true
|
|
298
|
-
}, /* @__PURE__ */ import_react4.default.createElement(import_react_ui.Button, {
|
|
299
|
-
variant: "primary",
|
|
300
|
-
onClick: handleNavigate
|
|
301
|
-
}, t("go to object label"))), /* @__PURE__ */ import_react4.default.createElement(import_react_ui.Toast.Close, {
|
|
302
|
-
asChild: true
|
|
303
|
-
}, /* @__PURE__ */ import_react4.default.createElement(import_react_ui.Button, {
|
|
304
|
-
onClick: handleClose
|
|
305
|
-
}, t("close label", {
|
|
306
|
-
ns: "appkit"
|
|
307
|
-
})))) : /* @__PURE__ */ import_react4.default.createElement(import_react_ui.Toast.Close, {
|
|
308
|
-
asChild: true
|
|
309
|
-
}, /* @__PURE__ */ import_react4.default.createElement(import_react_ui.Button, {
|
|
310
|
-
onClick: handleClose
|
|
311
|
-
}, t(waiting ? "close label" : "confirm label", {
|
|
312
|
-
ns: "appkit"
|
|
313
|
-
})))));
|
|
314
|
-
};
|
|
315
|
-
var __dxlog_file = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/util.tsx";
|
|
316
|
-
var SPACES = `${import_chunk_46S3JOES.SPACE_PLUGIN}-spaces`;
|
|
317
|
-
var SPACE_TYPE = "dxos.org/type/Space";
|
|
318
|
-
var COMPOSER_SPACE_LOCK = "dxos.org/plugin/space/lock";
|
|
319
|
-
var SHARED = "shared-spaces";
|
|
320
|
-
var EMPTY_ARRAY = [];
|
|
321
|
-
var memoizeQuery = (spaceOrEcho, filter, options) => {
|
|
322
|
-
const key = JSON.stringify({
|
|
323
|
-
space: (0, import_echo5.isSpace)(spaceOrEcho) ? spaceOrEcho.id : void 0,
|
|
324
|
-
filter: import_echo5.Filter.from(filter).toProto()
|
|
325
|
-
});
|
|
326
|
-
const query = (0, import_plugin_graph2.memoize)(() => (0, import_echo5.isSpace)(spaceOrEcho) ? spaceOrEcho.db.query(filter, options) : spaceOrEcho?.query(filter, options), key);
|
|
327
|
-
const unsubscribe = (0, import_plugin_graph2.memoize)(() => query?.subscribe(), key);
|
|
328
|
-
(0, import_plugin_graph2.cleanup)(() => unsubscribe?.());
|
|
329
|
-
return query?.objects ?? EMPTY_ARRAY;
|
|
330
|
-
};
|
|
331
|
-
var getSpaceDisplayName = (space, { personal, namesCache = {} } = {}) => {
|
|
332
|
-
return space.state.get() === import_echo5.SpaceState.SPACE_READY && (space.properties.name?.length ?? 0) > 0 ? space.properties.name : namesCache[space.id] ? namesCache[space.id] : personal ? [
|
|
333
|
-
"personal space label",
|
|
334
|
-
{
|
|
335
|
-
ns: import_chunk_46S3JOES.SPACE_PLUGIN
|
|
336
|
-
}
|
|
337
|
-
] : [
|
|
338
|
-
"unnamed space label",
|
|
339
|
-
{
|
|
340
|
-
ns: import_chunk_46S3JOES.SPACE_PLUGIN
|
|
341
|
-
}
|
|
342
|
-
];
|
|
343
|
-
};
|
|
344
|
-
var getCollectionGraphNodePartials = ({ navigable, collection, space, resolve }) => {
|
|
345
|
-
return {
|
|
346
|
-
disabled: !navigable,
|
|
347
|
-
acceptPersistenceClass: /* @__PURE__ */ new Set([
|
|
348
|
-
"echo"
|
|
349
|
-
]),
|
|
350
|
-
acceptPersistenceKey: /* @__PURE__ */ new Set([
|
|
351
|
-
space.id
|
|
352
|
-
]),
|
|
353
|
-
role: "branch",
|
|
354
|
-
onRearrangeChildren: (nextOrder) => {
|
|
355
|
-
collection.objects = nextOrder.filter(import_echo5.isEchoObject).map(import_live_object2.makeRef);
|
|
356
|
-
},
|
|
357
|
-
onTransferStart: (child, index) => {
|
|
358
|
-
if (!collection.objects.find((object) => object.target === child.data)) {
|
|
359
|
-
if (typeof index !== "undefined") {
|
|
360
|
-
collection.objects.splice(index, 0, (0, import_live_object2.makeRef)(child.data));
|
|
361
|
-
} else {
|
|
362
|
-
collection.objects.push((0, import_live_object2.makeRef)(child.data));
|
|
363
|
-
}
|
|
364
|
-
}
|
|
365
|
-
},
|
|
366
|
-
onTransferEnd: (child, destination) => {
|
|
367
|
-
const index = collection.objects.findIndex((object) => object.target === child.data);
|
|
368
|
-
if (index > -1) {
|
|
369
|
-
collection.objects.splice(index, 1);
|
|
370
|
-
}
|
|
371
|
-
},
|
|
372
|
-
onCopy: async (child, index) => {
|
|
373
|
-
const newObject = await cloneObject(child.data, resolve, space);
|
|
374
|
-
space.db.add(newObject);
|
|
375
|
-
if (typeof index !== "undefined") {
|
|
376
|
-
collection.objects.splice(index, 0, (0, import_live_object2.makeRef)(newObject));
|
|
377
|
-
} else {
|
|
378
|
-
collection.objects.push((0, import_live_object2.makeRef)(newObject));
|
|
379
|
-
}
|
|
380
|
-
}
|
|
381
|
-
};
|
|
382
|
-
};
|
|
383
|
-
var checkPendingMigration = (space) => {
|
|
384
|
-
return space.state.get() === import_echo5.SpaceState.SPACE_REQUIRES_MIGRATION || space.state.get() === import_echo5.SpaceState.SPACE_READY && !!import_migrations2.Migrations.versionProperty && space.properties[import_migrations2.Migrations.versionProperty] !== import_migrations2.Migrations.targetVersion;
|
|
385
|
-
};
|
|
386
|
-
var constructSpaceNode = ({ space, navigable = false, personal, namesCache, resolve }) => {
|
|
387
|
-
const hasPendingMigration = checkPendingMigration(space);
|
|
388
|
-
const collection = space.state.get() === import_echo5.SpaceState.SPACE_READY && space.properties[import_chunk_YF2AQ7KP.CollectionType.typename]?.target;
|
|
389
|
-
const partials = space.state.get() === import_echo5.SpaceState.SPACE_READY && collection instanceof import_chunk_YF2AQ7KP.CollectionType ? getCollectionGraphNodePartials({
|
|
390
|
-
collection,
|
|
391
|
-
space,
|
|
392
|
-
resolve,
|
|
393
|
-
navigable
|
|
394
|
-
}) : {};
|
|
395
|
-
return {
|
|
396
|
-
id: space.id,
|
|
397
|
-
type: SPACE_TYPE,
|
|
398
|
-
cacheable: [
|
|
399
|
-
"label",
|
|
400
|
-
"icon",
|
|
401
|
-
"role"
|
|
402
|
-
],
|
|
403
|
-
data: space,
|
|
404
|
-
properties: {
|
|
405
|
-
...partials,
|
|
406
|
-
label: getSpaceDisplayName(space, {
|
|
407
|
-
personal,
|
|
408
|
-
namesCache
|
|
409
|
-
}),
|
|
410
|
-
description: space.state.get() === import_echo5.SpaceState.SPACE_READY && space.properties.description,
|
|
411
|
-
icon: "ph--planet--regular",
|
|
412
|
-
disabled: !navigable || space.state.get() !== import_echo5.SpaceState.SPACE_READY || hasPendingMigration,
|
|
413
|
-
testId: "spacePlugin.space"
|
|
414
|
-
}
|
|
90
|
+
var import_react = require("@dxos/shell/react");
|
|
91
|
+
var SpaceEvents;
|
|
92
|
+
(function(SpaceEvents2) {
|
|
93
|
+
SpaceEvents2.SetupSettingsPanel = (0, import_app_framework.defineEvent)(`${import_chunk_WZR6OAN3.SPACE_PLUGIN}/event/setup-settings-panel`);
|
|
94
|
+
SpaceEvents2.StateReady = (0, import_app_framework.defineEvent)(`${import_chunk_WZR6OAN3.SPACE_PLUGIN}/event/state-ready`);
|
|
95
|
+
SpaceEvents2.DefaultSpaceReady = (0, import_app_framework.defineEvent)(`${import_chunk_WZR6OAN3.SPACE_PLUGIN}/event/default-space-ready`);
|
|
96
|
+
})(SpaceEvents || (SpaceEvents = {}));
|
|
97
|
+
var ThreadEvents;
|
|
98
|
+
(function(ThreadEvents2) {
|
|
99
|
+
ThreadEvents2.SetupThread = (0, import_app_framework.defineEvent)(`${import_chunk_WZR6OAN3.SPACE_PLUGIN}/event/setup-thread`);
|
|
100
|
+
})(ThreadEvents || (ThreadEvents = {}));
|
|
101
|
+
var SpacePlugin = ({ invitationUrl = window.location.origin, invitationParam = "spaceInvitationCode", observability = true } = {}) => {
|
|
102
|
+
const createInvitationUrl = (invitationCode) => {
|
|
103
|
+
const baseUrl = new URL(invitationUrl);
|
|
104
|
+
baseUrl.searchParams.set(invitationParam, invitationCode);
|
|
105
|
+
return baseUrl.toString();
|
|
415
106
|
};
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
type: import_plugin_graph2.ACTION_GROUP_TYPE,
|
|
426
|
-
data: async () => {
|
|
427
|
-
await dispatch((0, import_app_framework4.createIntent)(import_chunk_YF2AQ7KP.SpaceAction.Migrate, {
|
|
428
|
-
space
|
|
429
|
-
}));
|
|
430
|
-
},
|
|
431
|
-
properties: {
|
|
432
|
-
label: [
|
|
433
|
-
"migrate space label",
|
|
434
|
-
{
|
|
435
|
-
ns: import_chunk_46S3JOES.SPACE_PLUGIN
|
|
436
|
-
}
|
|
437
|
-
],
|
|
438
|
-
icon: "ph--database--regular",
|
|
439
|
-
disposition: "toolbar",
|
|
440
|
-
disabled: migrating || import_migrations2.Migrations.running(space)
|
|
441
|
-
}
|
|
442
|
-
});
|
|
443
|
-
}
|
|
444
|
-
if (state === import_echo5.SpaceState.SPACE_READY && !hasPendingMigration) {
|
|
445
|
-
const locked = space.properties[COMPOSER_SPACE_LOCK];
|
|
446
|
-
actions.push({
|
|
447
|
-
id: getId(import_chunk_YF2AQ7KP.SpaceAction.OpenCreateObject._tag),
|
|
448
|
-
type: import_plugin_graph2.ACTION_TYPE,
|
|
449
|
-
data: async () => {
|
|
450
|
-
await dispatch((0, import_app_framework4.createIntent)(import_chunk_YF2AQ7KP.SpaceAction.OpenCreateObject, {
|
|
451
|
-
target: space
|
|
452
|
-
}));
|
|
453
|
-
},
|
|
454
|
-
properties: {
|
|
455
|
-
label: [
|
|
456
|
-
"create object in space label",
|
|
457
|
-
{
|
|
458
|
-
ns: import_chunk_46S3JOES.SPACE_PLUGIN
|
|
459
|
-
}
|
|
460
|
-
],
|
|
461
|
-
icon: "ph--plus--regular",
|
|
462
|
-
disposition: "toolbar",
|
|
463
|
-
testId: "spacePlugin.createObject"
|
|
464
|
-
}
|
|
465
|
-
}, {
|
|
466
|
-
id: getId(import_chunk_YF2AQ7KP.SpaceAction.Share._tag),
|
|
467
|
-
type: import_plugin_graph2.ACTION_TYPE,
|
|
468
|
-
data: async () => {
|
|
469
|
-
if (locked) {
|
|
470
|
-
return;
|
|
471
|
-
}
|
|
472
|
-
await dispatch((0, import_app_framework4.createIntent)(import_chunk_YF2AQ7KP.SpaceAction.Share, {
|
|
473
|
-
space
|
|
474
|
-
}));
|
|
475
|
-
},
|
|
476
|
-
properties: {
|
|
477
|
-
label: [
|
|
478
|
-
"share space label",
|
|
479
|
-
{
|
|
480
|
-
ns: import_chunk_46S3JOES.SPACE_PLUGIN
|
|
481
|
-
}
|
|
482
|
-
],
|
|
483
|
-
icon: "ph--users--regular",
|
|
484
|
-
disabled: locked,
|
|
485
|
-
keyBinding: {
|
|
486
|
-
macos: "meta+.",
|
|
487
|
-
windows: "alt+."
|
|
488
|
-
}
|
|
489
|
-
}
|
|
490
|
-
}, {
|
|
491
|
-
id: locked ? getId(import_chunk_YF2AQ7KP.SpaceAction.Unlock._tag) : getId(import_chunk_YF2AQ7KP.SpaceAction.Lock._tag),
|
|
492
|
-
type: import_plugin_graph2.ACTION_TYPE,
|
|
493
|
-
data: async () => {
|
|
494
|
-
if (locked) {
|
|
495
|
-
await dispatch((0, import_app_framework4.createIntent)(import_chunk_YF2AQ7KP.SpaceAction.Unlock, {
|
|
496
|
-
space
|
|
497
|
-
}));
|
|
498
|
-
} else {
|
|
499
|
-
await dispatch((0, import_app_framework4.createIntent)(import_chunk_YF2AQ7KP.SpaceAction.Lock, {
|
|
500
|
-
space
|
|
501
|
-
}));
|
|
502
|
-
}
|
|
503
|
-
},
|
|
504
|
-
properties: {
|
|
505
|
-
label: [
|
|
506
|
-
locked ? "unlock space label" : "lock space label",
|
|
507
|
-
{
|
|
508
|
-
ns: import_chunk_46S3JOES.SPACE_PLUGIN
|
|
509
|
-
}
|
|
510
|
-
],
|
|
511
|
-
icon: locked ? "ph--lock-simple-open--regular" : "ph--lock-simple--regular"
|
|
512
|
-
}
|
|
513
|
-
}, {
|
|
514
|
-
id: getId(import_chunk_YF2AQ7KP.SpaceAction.Rename._tag),
|
|
515
|
-
type: import_plugin_graph2.ACTION_TYPE,
|
|
516
|
-
data: async (params) => {
|
|
517
|
-
await dispatch((0, import_app_framework4.createIntent)(import_chunk_YF2AQ7KP.SpaceAction.Rename, {
|
|
518
|
-
space,
|
|
519
|
-
caller: params.caller
|
|
520
|
-
}));
|
|
521
|
-
},
|
|
522
|
-
properties: {
|
|
523
|
-
label: [
|
|
524
|
-
"rename space label",
|
|
525
|
-
{
|
|
526
|
-
ns: import_chunk_46S3JOES.SPACE_PLUGIN
|
|
527
|
-
}
|
|
528
|
-
],
|
|
529
|
-
icon: "ph--pencil-simple-line--regular",
|
|
530
|
-
keyBinding: {
|
|
531
|
-
macos: "shift+F6",
|
|
532
|
-
windows: "shift+F6"
|
|
533
|
-
}
|
|
534
|
-
}
|
|
535
|
-
}, {
|
|
536
|
-
id: getId(import_chunk_YF2AQ7KP.SpaceAction.OpenSettings._tag),
|
|
537
|
-
type: import_plugin_graph2.ACTION_TYPE,
|
|
538
|
-
data: async () => {
|
|
539
|
-
await dispatch((0, import_app_framework4.createIntent)(import_chunk_YF2AQ7KP.SpaceAction.OpenSettings, {
|
|
540
|
-
space
|
|
541
|
-
}));
|
|
542
|
-
},
|
|
543
|
-
properties: {
|
|
544
|
-
label: [
|
|
545
|
-
"open space settings label",
|
|
546
|
-
{
|
|
547
|
-
ns: import_chunk_46S3JOES.SPACE_PLUGIN
|
|
548
|
-
}
|
|
549
|
-
],
|
|
550
|
-
icon: "ph--gear--regular"
|
|
551
|
-
}
|
|
552
|
-
});
|
|
553
|
-
}
|
|
554
|
-
if (state !== import_echo5.SpaceState.SPACE_INACTIVE && !hasPendingMigration) {
|
|
555
|
-
actions.push({
|
|
556
|
-
id: getId(import_chunk_YF2AQ7KP.SpaceAction.Close._tag),
|
|
557
|
-
type: import_plugin_graph2.ACTION_TYPE,
|
|
558
|
-
data: async () => {
|
|
559
|
-
await dispatch((0, import_app_framework4.createIntent)(import_chunk_YF2AQ7KP.SpaceAction.Close, {
|
|
560
|
-
space
|
|
561
|
-
}));
|
|
562
|
-
},
|
|
563
|
-
properties: {
|
|
564
|
-
label: [
|
|
565
|
-
"close space label",
|
|
566
|
-
{
|
|
567
|
-
ns: import_chunk_46S3JOES.SPACE_PLUGIN
|
|
568
|
-
}
|
|
569
|
-
],
|
|
570
|
-
icon: "ph--x--regular",
|
|
571
|
-
disabled: personal
|
|
572
|
-
}
|
|
573
|
-
});
|
|
574
|
-
}
|
|
575
|
-
if (state === import_echo5.SpaceState.SPACE_INACTIVE) {
|
|
576
|
-
actions.push({
|
|
577
|
-
id: getId(import_chunk_YF2AQ7KP.SpaceAction.Open._tag),
|
|
578
|
-
type: import_plugin_graph2.ACTION_TYPE,
|
|
579
|
-
data: async () => {
|
|
580
|
-
await dispatch((0, import_app_framework4.createIntent)(import_chunk_YF2AQ7KP.SpaceAction.Open, {
|
|
581
|
-
space
|
|
582
|
-
}));
|
|
583
|
-
},
|
|
584
|
-
properties: {
|
|
585
|
-
label: [
|
|
586
|
-
"open space label",
|
|
587
|
-
{
|
|
588
|
-
ns: import_chunk_46S3JOES.SPACE_PLUGIN
|
|
589
|
-
}
|
|
590
|
-
],
|
|
591
|
-
icon: "ph--clock-counter-clockwise--regular",
|
|
592
|
-
disposition: "toolbar"
|
|
593
|
-
}
|
|
594
|
-
});
|
|
595
|
-
}
|
|
596
|
-
return actions;
|
|
597
|
-
};
|
|
598
|
-
var createObjectNode = ({ object, space, navigable = false, resolve }) => {
|
|
599
|
-
const type = (0, import_echo_schema2.getTypename)(object);
|
|
600
|
-
if (!type) {
|
|
601
|
-
return void 0;
|
|
602
|
-
}
|
|
603
|
-
const metadata = resolve(type);
|
|
604
|
-
if (Object.keys(metadata).length === 0) {
|
|
605
|
-
return void 0;
|
|
606
|
-
}
|
|
607
|
-
const partials = object instanceof import_chunk_YF2AQ7KP.CollectionType ? getCollectionGraphNodePartials({
|
|
608
|
-
collection: object,
|
|
609
|
-
space,
|
|
610
|
-
resolve,
|
|
611
|
-
navigable
|
|
612
|
-
}) : metadata.graphProps;
|
|
613
|
-
return {
|
|
614
|
-
id: (0, import_echo5.fullyQualifiedId)(object),
|
|
615
|
-
type,
|
|
616
|
-
cacheable: [
|
|
617
|
-
"label",
|
|
618
|
-
"icon",
|
|
619
|
-
"role"
|
|
620
|
-
],
|
|
621
|
-
data: object,
|
|
622
|
-
properties: {
|
|
623
|
-
...partials,
|
|
624
|
-
label: metadata.label?.(object) || object.name || metadata.placeholder || [
|
|
625
|
-
"unnamed object label",
|
|
626
|
-
{
|
|
627
|
-
ns: import_chunk_46S3JOES.SPACE_PLUGIN
|
|
628
|
-
}
|
|
107
|
+
return (0, import_app_framework2.definePlugin)(import_chunk_WZR6OAN3.meta, [
|
|
108
|
+
(0, import_app_framework2.defineModule)({
|
|
109
|
+
id: `${import_chunk_WZR6OAN3.meta.id}/module/state`,
|
|
110
|
+
// TODO(wittjosiah): Does not integrate with settings store.
|
|
111
|
+
// Should this be a different event?
|
|
112
|
+
// Should settings store be renamed to be more generic?
|
|
113
|
+
activatesOn: (0, import_app_framework2.oneOf)(import_app_framework2.Events.SetupSettings, import_app_framework2.Events.SetupAppGraph),
|
|
114
|
+
activatesAfter: [
|
|
115
|
+
SpaceEvents.StateReady
|
|
629
116
|
],
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
}
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
"
|
|
117
|
+
activate: import_chunk_N2FS7PRA.SpaceState
|
|
118
|
+
}),
|
|
119
|
+
(0, import_app_framework2.defineModule)({
|
|
120
|
+
id: `${import_chunk_WZR6OAN3.meta.id}/module/settings`,
|
|
121
|
+
activatesOn: import_app_framework2.Events.SetupSettings,
|
|
122
|
+
activate: import_chunk_N2FS7PRA.SpaceSettings
|
|
123
|
+
}),
|
|
124
|
+
(0, import_app_framework2.defineModule)({
|
|
125
|
+
id: `${import_chunk_WZR6OAN3.meta.id}/module/translations`,
|
|
126
|
+
activatesOn: import_app_framework2.Events.SetupTranslations,
|
|
127
|
+
activate: () => (0, import_app_framework2.contributes)(import_app_framework2.Capabilities.Translations, [
|
|
128
|
+
...import_chunk_U6DYXAR3.translations_default,
|
|
129
|
+
import_react.osTranslations
|
|
130
|
+
])
|
|
131
|
+
}),
|
|
132
|
+
(0, import_app_framework2.defineModule)({
|
|
133
|
+
id: `${import_chunk_WZR6OAN3.meta.id}/module/metadata`,
|
|
134
|
+
activatesOn: import_app_framework2.Events.SetupMetadata,
|
|
135
|
+
activate: () => (0, import_app_framework2.contributes)(import_app_framework2.Capabilities.Metadata, {
|
|
136
|
+
id: import_chunk_WAJKBO3J.CollectionType.typename,
|
|
137
|
+
metadata: {
|
|
138
|
+
placeholder: [
|
|
139
|
+
"unnamed collection label",
|
|
653
140
|
{
|
|
654
|
-
ns:
|
|
141
|
+
ns: import_chunk_WZR6OAN3.SPACE_PLUGIN
|
|
655
142
|
}
|
|
656
143
|
],
|
|
657
|
-
icon: "ph--
|
|
658
|
-
|
|
659
|
-
|
|
144
|
+
icon: "ph--cards-three--regular",
|
|
145
|
+
// TODO(wittjosiah): Move out of metadata.
|
|
146
|
+
loadReferences: async (collection) => await import_live_object.RefArray.loadAll([
|
|
147
|
+
...collection.objects,
|
|
148
|
+
...Object.values(collection.views)
|
|
149
|
+
])
|
|
660
150
|
}
|
|
661
|
-
}
|
|
662
|
-
|
|
663
|
-
{
|
|
664
|
-
id:
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
})
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
icon: "ph--pencil-simple-line--regular",
|
|
680
|
-
// TODO(wittjosiah): Doesn't work.
|
|
681
|
-
// keyBinding: 'shift+F6',
|
|
682
|
-
testId: "spacePlugin.renameObject"
|
|
683
|
-
}
|
|
684
|
-
},
|
|
685
|
-
{
|
|
686
|
-
id: getId(import_chunk_YF2AQ7KP.SpaceAction.RemoveObjects._tag),
|
|
687
|
-
type: import_plugin_graph2.ACTION_TYPE,
|
|
688
|
-
data: async () => {
|
|
689
|
-
const graph = (0, import_plugin_graph2.getGraph)(node);
|
|
690
|
-
const collection = graph.nodes(node, {
|
|
691
|
-
relation: "inbound"
|
|
692
|
-
}).find(({ data }) => data instanceof import_chunk_YF2AQ7KP.CollectionType)?.data;
|
|
693
|
-
await dispatch((0, import_app_framework4.createIntent)(import_chunk_YF2AQ7KP.SpaceAction.RemoveObjects, {
|
|
694
|
-
objects: [
|
|
695
|
-
object
|
|
696
|
-
],
|
|
697
|
-
target: collection
|
|
698
|
-
}));
|
|
699
|
-
},
|
|
700
|
-
properties: {
|
|
701
|
-
label: [
|
|
702
|
-
object instanceof import_chunk_YF2AQ7KP.CollectionType ? "delete collection label" : "delete object label",
|
|
703
|
-
{
|
|
704
|
-
ns: import_chunk_46S3JOES.SPACE_PLUGIN
|
|
705
|
-
}
|
|
706
|
-
],
|
|
707
|
-
icon: "ph--trash--regular",
|
|
708
|
-
keyBinding: object instanceof import_chunk_YF2AQ7KP.CollectionType ? void 0 : "shift+meta+Backspace",
|
|
709
|
-
testId: "spacePlugin.deleteObject"
|
|
710
|
-
}
|
|
711
|
-
},
|
|
712
|
-
{
|
|
713
|
-
id: getId("copy-link"),
|
|
714
|
-
type: import_plugin_graph2.ACTION_TYPE,
|
|
715
|
-
data: async () => {
|
|
716
|
-
const url = `${window.location.origin}/${(0, import_echo5.fullyQualifiedId)(object)}`;
|
|
717
|
-
await navigator.clipboard.writeText(url);
|
|
718
|
-
},
|
|
719
|
-
properties: {
|
|
720
|
-
label: [
|
|
721
|
-
"copy link label",
|
|
722
|
-
{
|
|
723
|
-
ns: import_chunk_46S3JOES.SPACE_PLUGIN
|
|
724
|
-
}
|
|
725
|
-
],
|
|
726
|
-
icon: "ph--link--regular",
|
|
727
|
-
testId: "spacePlugin.copyLink"
|
|
728
|
-
}
|
|
729
|
-
},
|
|
730
|
-
// TODO(wittjosiah): Factor out and apply to all nodes.
|
|
731
|
-
{
|
|
732
|
-
id: import_app_framework4.NavigationAction.Expose._tag,
|
|
733
|
-
type: import_plugin_graph2.ACTION_TYPE,
|
|
734
|
-
data: async () => {
|
|
735
|
-
await dispatch((0, import_app_framework4.createIntent)(import_app_framework4.NavigationAction.Expose, {
|
|
736
|
-
id: (0, import_echo5.fullyQualifiedId)(object)
|
|
737
|
-
}));
|
|
738
|
-
},
|
|
739
|
-
properties: {
|
|
151
|
+
})
|
|
152
|
+
}),
|
|
153
|
+
(0, import_app_framework2.defineModule)({
|
|
154
|
+
id: `${import_chunk_WZR6OAN3.meta.id}/module/object-form`,
|
|
155
|
+
activatesOn: import_plugin_client.ClientEvents.SetupSchema,
|
|
156
|
+
activate: () => (0, import_app_framework2.contributes)(import_chunk_YZKNRFHU.SpaceCapabilities.ObjectForm, (0, import_chunk_WAJKBO3J.defineObjectForm)({
|
|
157
|
+
objectSchema: import_chunk_WAJKBO3J.CollectionType,
|
|
158
|
+
formSchema: import_echo_schema.S.Struct({
|
|
159
|
+
name: import_echo_schema.S.optional(import_echo_schema.S.String)
|
|
160
|
+
}),
|
|
161
|
+
getIntent: (props) => (0, import_app_framework2.createIntent)(import_chunk_WAJKBO3J.CollectionAction.Create, props)
|
|
162
|
+
}))
|
|
163
|
+
}),
|
|
164
|
+
(0, import_app_framework2.defineModule)({
|
|
165
|
+
id: `${import_chunk_WZR6OAN3.meta.id}/module/complementary-panel`,
|
|
166
|
+
activatesOn: import_plugin_deck.DeckEvents.SetupComplementaryPanels,
|
|
167
|
+
activate: () => (0, import_app_framework2.contributes)(import_plugin_deck.DeckCapabilities.ComplementaryPanel, {
|
|
168
|
+
id: "settings",
|
|
740
169
|
label: [
|
|
741
|
-
"
|
|
170
|
+
"settings panel label",
|
|
742
171
|
{
|
|
743
|
-
ns:
|
|
172
|
+
ns: import_chunk_WZR6OAN3.SPACE_PLUGIN
|
|
744
173
|
}
|
|
745
174
|
],
|
|
746
|
-
icon: "ph--
|
|
747
|
-
|
|
748
|
-
}
|
|
749
|
-
}
|
|
750
|
-
];
|
|
751
|
-
return actions;
|
|
752
|
-
};
|
|
753
|
-
var getActiveSpace = (graph, active) => {
|
|
754
|
-
if (!active) {
|
|
755
|
-
return;
|
|
756
|
-
}
|
|
757
|
-
const node = graph.findNode(active);
|
|
758
|
-
if (!node || !(0, import_live_object2.isReactiveObject)(node.data)) {
|
|
759
|
-
return;
|
|
760
|
-
}
|
|
761
|
-
return (0, import_echo5.getSpace)(node.data);
|
|
762
|
-
};
|
|
763
|
-
var getNestedObjects = async (object, resolve) => {
|
|
764
|
-
const type = (0, import_echo_schema2.getTypename)(object);
|
|
765
|
-
if (!type) {
|
|
766
|
-
return [];
|
|
767
|
-
}
|
|
768
|
-
const metadata = resolve(type);
|
|
769
|
-
const loadReferences = metadata.loadReferences;
|
|
770
|
-
if (typeof loadReferences !== "function") {
|
|
771
|
-
return [];
|
|
772
|
-
}
|
|
773
|
-
const objects = await loadReferences(object);
|
|
774
|
-
const nested = await Promise.all(objects.map((object2) => getNestedObjects(object2, resolve)));
|
|
775
|
-
return [
|
|
776
|
-
...objects,
|
|
777
|
-
...nested.flat()
|
|
778
|
-
];
|
|
779
|
-
};
|
|
780
|
-
var cloneObject = async (object, resolve, newSpace) => {
|
|
781
|
-
const schema = (0, import_live_object2.getSchema)(object);
|
|
782
|
-
const typename = schema ? (0, import_echo_schema2.getObjectAnnotation)(schema)?.typename ?? import_echo_schema2.EXPANDO_TYPENAME : import_echo_schema2.EXPANDO_TYPENAME;
|
|
783
|
-
const metadata = resolve(typename);
|
|
784
|
-
const serializer = metadata.serializer;
|
|
785
|
-
(0, import_invariant2.invariant)(serializer, `No serializer for type: ${typename}`, {
|
|
786
|
-
F: __dxlog_file,
|
|
787
|
-
L: 551,
|
|
788
|
-
S: void 0,
|
|
789
|
-
A: [
|
|
790
|
-
"serializer",
|
|
791
|
-
"`No serializer for type: ${typename}`"
|
|
792
|
-
]
|
|
793
|
-
});
|
|
794
|
-
const content = await serializer.serialize({
|
|
795
|
-
object
|
|
796
|
-
});
|
|
797
|
-
return serializer.deserialize({
|
|
798
|
-
content,
|
|
799
|
-
space: newSpace,
|
|
800
|
-
newId: true
|
|
801
|
-
});
|
|
802
|
-
};
|
|
803
|
-
var CreateObjectPanel = ({ schemas, spaces, typename: initialTypename, target: initialTarget, name: initialName, defaultSpaceId, resolve, onCreateObject }) => {
|
|
804
|
-
const { t } = (0, import_react_ui3.useTranslation)(import_chunk_46S3JOES.SPACE_PLUGIN);
|
|
805
|
-
const [typename, setTypename] = (0, import_react6.useState)(initialTypename);
|
|
806
|
-
const [target, setTarget] = (0, import_react6.useState)(initialTarget);
|
|
807
|
-
const schema = schemas.find((schema2) => (0, import_echo_schema.getObjectAnnotation)(schema2)?.typename === typename);
|
|
808
|
-
const options = schemas.map(import_echo_schema.getObjectAnnotation).filter(import_util2.nonNullable);
|
|
809
|
-
const handleClearSchema = (0, import_react6.useCallback)(() => setTypename(void 0), []);
|
|
810
|
-
const handleClearTarget = (0, import_react6.useCallback)(() => setTarget(void 0), []);
|
|
811
|
-
const handleCreateObject = (0, import_react6.useCallback)(async ({ name }) => {
|
|
812
|
-
if (!schema || !target) {
|
|
813
|
-
return;
|
|
814
|
-
}
|
|
815
|
-
await onCreateObject?.({
|
|
816
|
-
schema,
|
|
817
|
-
target,
|
|
818
|
-
name
|
|
819
|
-
});
|
|
820
|
-
}, [
|
|
821
|
-
onCreateObject,
|
|
822
|
-
schema,
|
|
823
|
-
target
|
|
824
|
-
]);
|
|
825
|
-
const schemaInput = /* @__PURE__ */ import_react6.default.createElement(import_react_ui_searchlist.SearchList.Root, {
|
|
826
|
-
label: t("schema input label"),
|
|
827
|
-
classNames: "flex flex-col grow overflow-hidden"
|
|
828
|
-
}, /* @__PURE__ */ import_react6.default.createElement(import_react_ui_searchlist.SearchList.Input, {
|
|
829
|
-
autoFocus: true,
|
|
830
|
-
"data-testid": "create-object-form.schema-input",
|
|
831
|
-
placeholder: t("schema input placeholder"),
|
|
832
|
-
classNames: "px-1 my-2"
|
|
833
|
-
}), /* @__PURE__ */ import_react6.default.createElement(import_react_ui_searchlist.SearchList.Content, {
|
|
834
|
-
classNames: "max-bs-[24rem] overflow-auto"
|
|
835
|
-
}, options.map((option) => /* @__PURE__ */ import_react6.default.createElement(import_react_ui_searchlist.SearchList.Item, {
|
|
836
|
-
key: option.typename,
|
|
837
|
-
value: t("typename label", {
|
|
838
|
-
ns: option.typename,
|
|
839
|
-
defaultValue: option.typename
|
|
175
|
+
icon: "ph--sliders--regular",
|
|
176
|
+
filter: (node) => (0, import_echo.isEchoObject)(node.data) && !!(0, import_echo.getSpace)(node.data)
|
|
177
|
+
})
|
|
840
178
|
}),
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
}), t("typename label", {
|
|
849
|
-
ns: option.typename,
|
|
850
|
-
defaultValue: option.typename
|
|
851
|
-
}))))));
|
|
852
|
-
const spaceInput = /* @__PURE__ */ import_react6.default.createElement(import_react_ui_searchlist.SearchList.Root, {
|
|
853
|
-
label: t("space input label"),
|
|
854
|
-
classNames: "flex flex-col grow overflow-hidden"
|
|
855
|
-
}, /* @__PURE__ */ import_react6.default.createElement(import_react_ui_searchlist.SearchList.Input, {
|
|
856
|
-
autoFocus: true,
|
|
857
|
-
"data-testid": "create-object-form.space-input",
|
|
858
|
-
placeholder: t("space input placeholder"),
|
|
859
|
-
classNames: "px-1 my-2"
|
|
860
|
-
}), /* @__PURE__ */ import_react6.default.createElement(import_react_ui_searchlist.SearchList.Content, {
|
|
861
|
-
classNames: "max-bs-[24rem] overflow-auto"
|
|
862
|
-
}, spaces.map((space) => /* @__PURE__ */ import_react6.default.createElement(import_react_ui_searchlist.SearchList.Item, {
|
|
863
|
-
key: space.id,
|
|
864
|
-
value: (0, import_react_ui3.toLocalizedString)(getSpaceDisplayName(space, {
|
|
865
|
-
personal: space.id === defaultSpaceId
|
|
866
|
-
}), t),
|
|
867
|
-
onSelect: () => setTarget(space),
|
|
868
|
-
classNames: "flex items-center gap-2"
|
|
869
|
-
}, /* @__PURE__ */ import_react6.default.createElement("span", {
|
|
870
|
-
className: "grow truncate"
|
|
871
|
-
}, (0, import_react_ui3.toLocalizedString)(getSpaceDisplayName(space, {
|
|
872
|
-
personal: space.id === defaultSpaceId
|
|
873
|
-
}), t))))));
|
|
874
|
-
const form = /* @__PURE__ */ import_react6.default.createElement(import_react_ui_form.Form, {
|
|
875
|
-
autoFocus: true,
|
|
876
|
-
values: {
|
|
877
|
-
name: initialName
|
|
878
|
-
},
|
|
879
|
-
schema: import_echo_schema.S.Struct({
|
|
880
|
-
name: import_echo_schema.S.optional(import_echo_schema.S.String)
|
|
179
|
+
(0, import_app_framework2.defineModule)({
|
|
180
|
+
id: `${import_chunk_WZR6OAN3.meta.id}/module/schema`,
|
|
181
|
+
activatesOn: import_plugin_client.ClientEvents.ClientReady,
|
|
182
|
+
activatesBefore: [
|
|
183
|
+
import_plugin_client.ClientEvents.SetupSchema
|
|
184
|
+
],
|
|
185
|
+
activate: import_chunk_N2FS7PRA.Schema
|
|
881
186
|
}),
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
role: "form",
|
|
887
|
-
className: "flex flex-col gap-2"
|
|
888
|
-
}, target && /* @__PURE__ */ import_react6.default.createElement("div", {
|
|
889
|
-
role: "none"
|
|
890
|
-
}, /* @__PURE__ */ import_react6.default.createElement(import_react_ui3.Input.Root, null, /* @__PURE__ */ import_react6.default.createElement(import_react_ui_form.InputHeader, null, /* @__PURE__ */ import_react6.default.createElement(import_react_ui3.Input.Label, null, t((0, import_echo4.isSpace)(target) ? "creating in space label" : "creating in collection label"))), /* @__PURE__ */ import_react6.default.createElement("div", {
|
|
891
|
-
role: "none",
|
|
892
|
-
className: "flex gap-2"
|
|
893
|
-
}, /* @__PURE__ */ import_react6.default.createElement(import_react_ui3.Input.TextInput, {
|
|
894
|
-
disabled: true,
|
|
895
|
-
value: (0, import_echo4.isSpace)(target) ? (0, import_react_ui3.toLocalizedString)(getSpaceDisplayName(target, {
|
|
896
|
-
personal: target.id === defaultSpaceId
|
|
897
|
-
}), t) : target.name || t("unnamed collection label")
|
|
898
|
-
}), /* @__PURE__ */ import_react6.default.createElement(import_react_ui3.IconButton, {
|
|
899
|
-
iconOnly: true,
|
|
900
|
-
icon: "ph--x--regular",
|
|
901
|
-
label: t("clear input label"),
|
|
902
|
-
onClick: handleClearTarget
|
|
903
|
-
})))), schema && /* @__PURE__ */ import_react6.default.createElement("div", {
|
|
904
|
-
role: "none"
|
|
905
|
-
}, /* @__PURE__ */ import_react6.default.createElement(import_react_ui3.Input.Root, null, /* @__PURE__ */ import_react6.default.createElement(import_react_ui_form.InputHeader, null, /* @__PURE__ */ import_react6.default.createElement(import_react_ui3.Input.Label, null, t("creating object type label"))), /* @__PURE__ */ import_react6.default.createElement("div", {
|
|
906
|
-
role: "none",
|
|
907
|
-
className: "flex gap-2"
|
|
908
|
-
}, /* @__PURE__ */ import_react6.default.createElement(import_react_ui3.Input.TextInput, {
|
|
909
|
-
disabled: true,
|
|
910
|
-
value: t("typename label", {
|
|
911
|
-
ns: schema.typename,
|
|
912
|
-
defaultValue: schema.typename
|
|
913
|
-
})
|
|
914
|
-
}), /* @__PURE__ */ import_react6.default.createElement(import_react_ui3.IconButton, {
|
|
915
|
-
iconOnly: true,
|
|
916
|
-
icon: "ph--x--regular",
|
|
917
|
-
label: t("clear input label"),
|
|
918
|
-
onClick: handleClearSchema
|
|
919
|
-
})))), !schema ? schemaInput : !target ? spaceInput : form);
|
|
920
|
-
};
|
|
921
|
-
var CREATE_OBJECT_DIALOG = `${import_chunk_46S3JOES.SPACE_PLUGIN}/CreateObjectDialog`;
|
|
922
|
-
var CreateObjectDialog = ({ schemas, target, typename, name, shouldNavigate: _shouldNavigate, resolve }) => {
|
|
923
|
-
const closeRef = (0, import_react5.useRef)(null);
|
|
924
|
-
const { t } = (0, import_react_ui2.useTranslation)(import_chunk_46S3JOES.SPACE_PLUGIN);
|
|
925
|
-
const client = (0, import_react_client3.useClient)();
|
|
926
|
-
const spaces = (0, import_echo3.useSpaces)();
|
|
927
|
-
const { dispatchPromise: dispatch } = (0, import_app_framework3.useIntentDispatcher)();
|
|
928
|
-
const handleCreateObject = (0, import_react5.useCallback)(async ({ schema, target: _target, name: name2 }) => {
|
|
929
|
-
const target2 = (0, import_echo3.isSpace)(_target) ? _target.properties[import_chunk_YF2AQ7KP.CollectionType.typename]?.target : _target;
|
|
930
|
-
const createObjectIntent = resolve?.(schema.typename)?.createObject;
|
|
931
|
-
if (!createObjectIntent || !target2) {
|
|
932
|
-
return;
|
|
933
|
-
}
|
|
934
|
-
closeRef.current?.click();
|
|
935
|
-
const space = (0, import_echo3.isSpace)(target2) ? target2 : (0, import_echo3.getSpace)(target2);
|
|
936
|
-
const result = await dispatch(createObjectIntent({
|
|
937
|
-
name: name2,
|
|
938
|
-
space
|
|
939
|
-
}));
|
|
940
|
-
const object = result.data?.object;
|
|
941
|
-
if ((0, import_echo3.isReactiveObject)(object)) {
|
|
942
|
-
const addObjectIntent = (0, import_app_framework3.createIntent)(import_chunk_YF2AQ7KP.SpaceAction.AddObject, {
|
|
943
|
-
target: target2,
|
|
944
|
-
object
|
|
945
|
-
});
|
|
946
|
-
const shouldNavigate = _shouldNavigate ?? (() => true);
|
|
947
|
-
if (shouldNavigate(object)) {
|
|
948
|
-
await dispatch((0, import_effect.pipe)(addObjectIntent, (0, import_app_framework3.chain)(import_app_framework3.NavigationAction.Open, {})));
|
|
949
|
-
} else {
|
|
950
|
-
await dispatch(addObjectIntent);
|
|
951
|
-
}
|
|
952
|
-
}
|
|
953
|
-
}, [
|
|
954
|
-
dispatch,
|
|
955
|
-
resolve
|
|
956
|
-
]);
|
|
957
|
-
return (
|
|
958
|
-
// TODO(wittjosiah): The tablist dialog pattern is copied from @dxos/plugin-manager.
|
|
959
|
-
// Consider factoring it out to the tabs package.
|
|
960
|
-
/* @__PURE__ */ import_react5.default.createElement(import_react_ui2.Dialog.Content, {
|
|
961
|
-
classNames: "p-0 bs-content min-bs-[15rem] max-bs-full md:max-is-[40rem] overflow-hidden"
|
|
962
|
-
}, /* @__PURE__ */ import_react5.default.createElement("div", {
|
|
963
|
-
role: "none",
|
|
964
|
-
className: "flex justify-between pbs-2 pis-2 pie-2 @md:pbs-4 @md:pis-4 @md:pie-4"
|
|
965
|
-
}, /* @__PURE__ */ import_react5.default.createElement(import_react_ui2.Dialog.Title, null, t("create object dialog title")), /* @__PURE__ */ import_react5.default.createElement(import_react_ui2.Dialog.Close, {
|
|
966
|
-
asChild: true
|
|
967
|
-
}, /* @__PURE__ */ import_react5.default.createElement(import_react_ui2.Button, {
|
|
968
|
-
ref: closeRef,
|
|
969
|
-
density: "fine",
|
|
970
|
-
variant: "ghost",
|
|
971
|
-
autoFocus: true
|
|
972
|
-
}, /* @__PURE__ */ import_react5.default.createElement(import_react_ui2.Icon, {
|
|
973
|
-
icon: "ph--x--regular",
|
|
974
|
-
size: 4
|
|
975
|
-
})))), /* @__PURE__ */ import_react5.default.createElement("div", {
|
|
976
|
-
className: "p-4"
|
|
977
|
-
}, /* @__PURE__ */ import_react5.default.createElement(CreateObjectPanel, {
|
|
978
|
-
schemas,
|
|
979
|
-
spaces,
|
|
980
|
-
target,
|
|
981
|
-
typename,
|
|
982
|
-
name,
|
|
983
|
-
defaultSpaceId: client.spaces.default.id,
|
|
984
|
-
resolve,
|
|
985
|
-
onCreateObject: handleCreateObject
|
|
986
|
-
})))
|
|
987
|
-
);
|
|
988
|
-
};
|
|
989
|
-
var CREATE_SPACE_DIALOG = `${import_chunk_46S3JOES.SPACE_PLUGIN}/CreateSpaceDialog`;
|
|
990
|
-
var initialValues = {
|
|
991
|
-
edgeReplication: true
|
|
992
|
-
};
|
|
993
|
-
var CreateSpaceDialog = () => {
|
|
994
|
-
const closeRef = (0, import_react7.useRef)(null);
|
|
995
|
-
const { t } = (0, import_react_ui4.useTranslation)(import_chunk_46S3JOES.SPACE_PLUGIN);
|
|
996
|
-
const { dispatchPromise: dispatch } = (0, import_app_framework5.useIntentDispatcher)();
|
|
997
|
-
const handleCreateSpace = (0, import_react7.useCallback)(async (data) => {
|
|
998
|
-
const result = await dispatch((0, import_app_framework5.createIntent)(import_chunk_YF2AQ7KP.SpaceAction.Create, data));
|
|
999
|
-
const target = result.data?.space;
|
|
1000
|
-
if (target) {
|
|
1001
|
-
await dispatch((0, import_app_framework5.createIntent)(import_chunk_YF2AQ7KP.SpaceAction.OpenCreateObject, {
|
|
1002
|
-
target
|
|
1003
|
-
}));
|
|
1004
|
-
}
|
|
1005
|
-
}, [
|
|
1006
|
-
dispatch
|
|
1007
|
-
]);
|
|
1008
|
-
return (
|
|
1009
|
-
// TODO(wittjosiah): The tablist dialog pattern is copied from @dxos/plugin-manager.
|
|
1010
|
-
// Consider factoring it out to the tabs package.
|
|
1011
|
-
/* @__PURE__ */ import_react7.default.createElement(import_react_ui4.Dialog.Content, {
|
|
1012
|
-
classNames: "p-0 bs-content min-bs-[15rem] max-bs-full md:max-is-[40rem] overflow-hidden"
|
|
1013
|
-
}, /* @__PURE__ */ import_react7.default.createElement("div", {
|
|
1014
|
-
role: "none",
|
|
1015
|
-
className: "flex justify-between pbs-2 pis-2 pie-2 @md:pbs-4 @md:pis-4 @md:pie-4"
|
|
1016
|
-
}, /* @__PURE__ */ import_react7.default.createElement(import_react_ui4.Dialog.Title, null, t("create space dialog title")), /* @__PURE__ */ import_react7.default.createElement(import_react_ui4.Dialog.Close, {
|
|
1017
|
-
asChild: true
|
|
1018
|
-
}, /* @__PURE__ */ import_react7.default.createElement(import_react_ui4.Button, {
|
|
1019
|
-
ref: closeRef,
|
|
1020
|
-
density: "fine",
|
|
1021
|
-
variant: "ghost",
|
|
1022
|
-
autoFocus: true
|
|
1023
|
-
}, /* @__PURE__ */ import_react7.default.createElement(import_react_ui4.Icon, {
|
|
1024
|
-
icon: "ph--x--regular",
|
|
1025
|
-
size: 4
|
|
1026
|
-
})))), /* @__PURE__ */ import_react7.default.createElement("div", {
|
|
1027
|
-
className: "p-4"
|
|
1028
|
-
}, /* @__PURE__ */ import_react7.default.createElement(import_react_ui_form2.Form, {
|
|
1029
|
-
testId: "create-space-form",
|
|
1030
|
-
values: initialValues,
|
|
1031
|
-
schema: import_chunk_YF2AQ7KP.SpaceForm,
|
|
1032
|
-
onSave: handleCreateSpace
|
|
1033
|
-
})))
|
|
1034
|
-
);
|
|
1035
|
-
};
|
|
1036
|
-
var CollectionMain = ({ collection }) => {
|
|
1037
|
-
const { t } = (0, import_react_ui5.useTranslation)(import_chunk_46S3JOES.SPACE_PLUGIN);
|
|
1038
|
-
return /* @__PURE__ */ import_react8.default.createElement("div", {
|
|
1039
|
-
role: "none",
|
|
1040
|
-
className: (0, import_react_ui_theme2.mx)(import_react_ui_theme2.baseSurface, "min-bs-screen is-full flex items-center justify-center p-8"),
|
|
1041
|
-
"data-testid": "composer.firstRunMessage"
|
|
1042
|
-
}, /* @__PURE__ */ import_react8.default.createElement("p", {
|
|
1043
|
-
role: "alert",
|
|
1044
|
-
className: (0, import_react_ui_theme2.mx)(import_react_ui_theme2.descriptionText, "border border-dashed border-neutral-400/50 rounded-lg p-8 font-normal text-lg max-is-[24rem] break-words")
|
|
1045
|
-
}, collection.name ?? t("unnamed collection label")));
|
|
1046
|
-
};
|
|
1047
|
-
var CollectionSection = ({ collection }) => {
|
|
1048
|
-
const { t } = (0, import_react_ui6.useTranslation)(import_chunk_46S3JOES.SPACE_PLUGIN);
|
|
1049
|
-
return /* @__PURE__ */ import_react9.default.createElement("div", {
|
|
1050
|
-
className: "min-bs-[3.5rem] grid grid-rows-subgrid grid-cols-subgrid items-center"
|
|
1051
|
-
}, /* @__PURE__ */ import_react9.default.createElement("span", {
|
|
1052
|
-
className: "truncate"
|
|
1053
|
-
}, collection.name ?? t("unnamed collection label")));
|
|
1054
|
-
};
|
|
1055
|
-
var DefaultObjectSettings = ({ object }) => {
|
|
1056
|
-
const { t } = (0, import_react_ui7.useTranslation)(import_chunk_46S3JOES.SPACE_PLUGIN);
|
|
1057
|
-
return /* @__PURE__ */ import_react10.default.createElement("div", {
|
|
1058
|
-
role: "form",
|
|
1059
|
-
className: "flex flex-col w-full p-2 gap-1"
|
|
1060
|
-
}, /* @__PURE__ */ import_react10.default.createElement(import_react_ui7.Input.Root, null, /* @__PURE__ */ import_react10.default.createElement(import_react_ui7.Input.Label, null, t("name label")), /* @__PURE__ */ import_react10.default.createElement(import_react_ui7.Input.TextInput, {
|
|
1061
|
-
placeholder: t("name placeholder"),
|
|
1062
|
-
value: object.name ?? "",
|
|
1063
|
-
onChange: (event) => {
|
|
1064
|
-
object.name = event.target.value;
|
|
1065
|
-
}
|
|
1066
|
-
})));
|
|
1067
|
-
};
|
|
1068
|
-
var JOIN_DIALOG = `${import_chunk_46S3JOES.SPACE_PLUGIN}/JoinDialog`;
|
|
1069
|
-
var JoinDialog = ({ navigableCollections, onDone, ...props }) => {
|
|
1070
|
-
const { t } = (0, import_react_ui8.useTranslation)(import_chunk_46S3JOES.SPACE_PLUGIN);
|
|
1071
|
-
const { dispatchPromise: dispatch } = (0, import_app_framework6.useIntentDispatcher)();
|
|
1072
|
-
const spaces = (0, import_echo6.useSpaces)();
|
|
1073
|
-
const { graph } = (0, import_plugin_graph3.useGraph)();
|
|
1074
|
-
const handleDone = (0, import_react11.useCallback)(async (result) => {
|
|
1075
|
-
if (result?.spaceKey) {
|
|
1076
|
-
await Promise.all([
|
|
1077
|
-
dispatch((0, import_app_framework6.createIntent)(import_app_framework6.LayoutAction.SetLayout, {
|
|
1078
|
-
element: "toast",
|
|
1079
|
-
subject: {
|
|
1080
|
-
id: `${import_chunk_46S3JOES.SPACE_PLUGIN}/join-success`,
|
|
1081
|
-
duration: 5e3,
|
|
1082
|
-
title: t("join success label"),
|
|
1083
|
-
closeLabel: t("dismiss label")
|
|
1084
|
-
}
|
|
1085
|
-
})),
|
|
1086
|
-
dispatch((0, import_app_framework6.createIntent)(import_app_framework6.LayoutAction.SetLayout, {
|
|
1087
|
-
element: "dialog",
|
|
1088
|
-
state: false
|
|
1089
|
-
}))
|
|
1090
|
-
]);
|
|
1091
|
-
}
|
|
1092
|
-
const space = spaces.find(({ key }) => result?.spaceKey?.equals(key));
|
|
1093
|
-
const target = result?.target || (navigableCollections ? space?.id : void 0);
|
|
1094
|
-
if (target) {
|
|
1095
|
-
await graph.waitForPath({
|
|
1096
|
-
target
|
|
1097
|
-
}).catch(() => {
|
|
1098
|
-
});
|
|
1099
|
-
await Promise.all([
|
|
1100
|
-
dispatch((0, import_app_framework6.createIntent)(import_app_framework6.NavigationAction.Open, {
|
|
1101
|
-
activeParts: {
|
|
1102
|
-
main: [
|
|
1103
|
-
target
|
|
1104
|
-
]
|
|
1105
|
-
}
|
|
1106
|
-
})),
|
|
1107
|
-
dispatch((0, import_app_framework6.createIntent)(import_app_framework6.NavigationAction.Expose, {
|
|
1108
|
-
id: target
|
|
1109
|
-
}))
|
|
1110
|
-
]);
|
|
1111
|
-
}
|
|
1112
|
-
await onDone?.(result);
|
|
1113
|
-
if (space) {
|
|
1114
|
-
await dispatch((0, import_app_framework6.createIntent)(import_types3.ObservabilityAction.SendEvent, {
|
|
1115
|
-
name: "space.join",
|
|
1116
|
-
properties: {
|
|
1117
|
-
spaceId: space.id
|
|
1118
|
-
}
|
|
1119
|
-
}));
|
|
1120
|
-
}
|
|
1121
|
-
}, [
|
|
1122
|
-
dispatch,
|
|
1123
|
-
spaces
|
|
1124
|
-
]);
|
|
1125
|
-
return /* @__PURE__ */ import_react11.default.createElement(import_react_ui8.Dialog.Content, null, /* @__PURE__ */ import_react11.default.createElement(import_react12.JoinPanel, {
|
|
1126
|
-
...props,
|
|
1127
|
-
exitActionParent: /* @__PURE__ */ import_react11.default.createElement(import_react_ui8.Dialog.Close, {
|
|
1128
|
-
asChild: true
|
|
187
|
+
(0, import_app_framework2.defineModule)({
|
|
188
|
+
id: `${import_chunk_WZR6OAN3.meta.id}/module/react-root`,
|
|
189
|
+
activatesOn: import_app_framework2.Events.Startup,
|
|
190
|
+
activate: import_chunk_N2FS7PRA.ReactRoot
|
|
1129
191
|
}),
|
|
1130
|
-
|
|
1131
|
-
|
|
192
|
+
(0, import_app_framework2.defineModule)({
|
|
193
|
+
id: `${import_chunk_WZR6OAN3.meta.id}/module/react-surface`,
|
|
194
|
+
activatesOn: import_app_framework2.Events.SetupReactSurface,
|
|
195
|
+
// TODO(wittjosiah): Should occur before the settings dialog is loaded when surfaces activation is more granular.
|
|
196
|
+
activatesBefore: [
|
|
197
|
+
SpaceEvents.SetupSettingsPanel
|
|
198
|
+
],
|
|
199
|
+
activate: () => (0, import_chunk_N2FS7PRA.ReactSurface)({
|
|
200
|
+
createInvitationUrl
|
|
201
|
+
})
|
|
1132
202
|
}),
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
}
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
})(Status || (Status = {}));
|
|
1159
|
-
var PersistenceStatus = ({ db }) => {
|
|
1160
|
-
const { t } = (0, import_react_ui10.useTranslation)(import_chunk_46S3JOES.SPACE_PLUGIN);
|
|
1161
|
-
const [displayMessage, setDisplayMessage] = (0, import_react16.useState)(false);
|
|
1162
|
-
const [status, naturalSetStatus] = (0, import_react16.useState)(0);
|
|
1163
|
-
const [prevStatus, setPrevStatus] = (0, import_react16.useState)(0);
|
|
1164
|
-
const _setStatus = (0, import_async2.debounce)(naturalSetStatus, 500);
|
|
1165
|
-
(0, import_react16.useEffect)(() => {
|
|
1166
|
-
setPrevStatus(status);
|
|
1167
|
-
if (prevStatus !== status && status === 0) {
|
|
1168
|
-
setDisplayMessage(true);
|
|
1169
|
-
const timeout = setTimeout(() => setDisplayMessage(false), 5e3);
|
|
1170
|
-
return () => clearTimeout(timeout);
|
|
1171
|
-
}
|
|
1172
|
-
}, [
|
|
1173
|
-
status
|
|
1174
|
-
]);
|
|
1175
|
-
switch (status) {
|
|
1176
|
-
case 2:
|
|
1177
|
-
return /* @__PURE__ */ import_react16.default.createElement("div", {
|
|
1178
|
-
className: "flex items-center"
|
|
1179
|
-
}, /* @__PURE__ */ import_react16.default.createElement(import_react15.Warning, {
|
|
1180
|
-
className: (0, import_react_ui_theme3.mx)((0, import_react_ui_theme3.getSize)(4), "me-1")
|
|
1181
|
-
}), /* @__PURE__ */ import_react16.default.createElement("span", {
|
|
1182
|
-
className: (0, import_react_ui_theme3.mx)("text-sm", import_react_ui_theme3.warningText)
|
|
1183
|
-
}, t("persistence error label")));
|
|
1184
|
-
case 1:
|
|
1185
|
-
return /* @__PURE__ */ import_react16.default.createElement("div", {
|
|
1186
|
-
className: "flex items-center"
|
|
1187
|
-
}, /* @__PURE__ */ import_react16.default.createElement(import_react15.ArrowsCounterClockwise, {
|
|
1188
|
-
className: (0, import_react_ui_theme3.mx)((0, import_react_ui_theme3.getSize)(4), "me-1")
|
|
1189
|
-
}), /* @__PURE__ */ import_react16.default.createElement("span", {
|
|
1190
|
-
className: (0, import_react_ui_theme3.mx)("text-sm", import_react_ui_theme3.staticPlaceholderText)
|
|
1191
|
-
}, t("persistence pending label")));
|
|
1192
|
-
case 0:
|
|
1193
|
-
default:
|
|
1194
|
-
return /* @__PURE__ */ import_react16.default.createElement(import_react_ui10.Tooltip.Root, {
|
|
1195
|
-
delayDuration: 400
|
|
1196
|
-
}, /* @__PURE__ */ import_react16.default.createElement(import_react_ui10.Tooltip.Trigger, {
|
|
1197
|
-
role: "status",
|
|
1198
|
-
className: "flex items-center"
|
|
1199
|
-
}, /* @__PURE__ */ import_react16.default.createElement(import_react15.CheckCircle, {
|
|
1200
|
-
className: (0, import_react_ui_theme3.mx)((0, import_react_ui_theme3.getSize)(4), "me-1")
|
|
1201
|
-
}), displayMessage && /* @__PURE__ */ import_react16.default.createElement("span", {
|
|
1202
|
-
className: (0, import_react_ui_theme3.mx)("text-sm", import_react_ui_theme3.staticPlaceholderText)
|
|
1203
|
-
}, t("persisted locally label"))), /* @__PURE__ */ import_react16.default.createElement(import_react_ui10.Tooltip.Portal, null, /* @__PURE__ */ import_react16.default.createElement(import_react_ui10.Tooltip.Content, null, t("persisted locally message"), /* @__PURE__ */ import_react16.default.createElement(import_react_ui10.Tooltip.Arrow, null))));
|
|
1204
|
-
}
|
|
1205
|
-
};
|
|
1206
|
-
var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/PopoverRenameObject.tsx";
|
|
1207
|
-
var POPOVER_RENAME_OBJECT = `${import_chunk_46S3JOES.SPACE_PLUGIN}/PopoverRenameObject`;
|
|
1208
|
-
var PopoverRenameObject = ({ object: obj }) => {
|
|
1209
|
-
const { t } = (0, import_react_ui11.useTranslation)(import_chunk_46S3JOES.SPACE_PLUGIN);
|
|
1210
|
-
const doneButton = (0, import_react17.useRef)(null);
|
|
1211
|
-
const object = obj;
|
|
1212
|
-
const [name, setName] = (0, import_react17.useState)(object.name || object.title || "");
|
|
1213
|
-
const handleDone = (0, import_react17.useCallback)(() => {
|
|
1214
|
-
try {
|
|
1215
|
-
object.name = name;
|
|
1216
|
-
} catch {
|
|
1217
|
-
try {
|
|
1218
|
-
object.title = name;
|
|
1219
|
-
} catch (err) {
|
|
1220
|
-
import_log2.log.error("Failed to rename object", {
|
|
1221
|
-
err
|
|
1222
|
-
}, {
|
|
1223
|
-
F: __dxlog_file2,
|
|
1224
|
-
L: 30,
|
|
1225
|
-
S: void 0,
|
|
1226
|
-
C: (f, a) => f(...a)
|
|
1227
|
-
});
|
|
1228
|
-
}
|
|
1229
|
-
}
|
|
1230
|
-
}, [
|
|
1231
|
-
object,
|
|
1232
|
-
name
|
|
1233
|
-
]);
|
|
1234
|
-
return /* @__PURE__ */ import_react17.default.createElement("div", {
|
|
1235
|
-
role: "none",
|
|
1236
|
-
className: "p-1 flex gap-2"
|
|
1237
|
-
}, /* @__PURE__ */ import_react17.default.createElement("div", {
|
|
1238
|
-
role: "none",
|
|
1239
|
-
className: "flex-1"
|
|
1240
|
-
}, /* @__PURE__ */ import_react17.default.createElement(import_react_ui11.Input.Root, null, /* @__PURE__ */ import_react17.default.createElement(import_react_ui11.Input.Label, {
|
|
1241
|
-
srOnly: true
|
|
1242
|
-
}, t("object name label")), /* @__PURE__ */ import_react17.default.createElement(import_react_ui11.Input.TextInput, {
|
|
1243
|
-
placeholder: t("object title placeholder"),
|
|
1244
|
-
value: name,
|
|
1245
|
-
"data-testid": "spacePlugin.renameObject.input",
|
|
1246
|
-
onChange: ({ target: { value } }) => setName(value),
|
|
1247
|
-
onKeyDown: ({ key }) => key === "Enter" && doneButton.current?.click()
|
|
1248
|
-
}))), /* @__PURE__ */ import_react17.default.createElement(import_react_ui11.Popover.Close, {
|
|
1249
|
-
asChild: true
|
|
1250
|
-
}, /* @__PURE__ */ import_react17.default.createElement(import_react_ui11.Button, {
|
|
1251
|
-
ref: doneButton,
|
|
1252
|
-
classNames: "self-stretch",
|
|
1253
|
-
onClick: handleDone
|
|
1254
|
-
}, t("done label", {
|
|
1255
|
-
ns: "os"
|
|
1256
|
-
}))));
|
|
1257
|
-
};
|
|
1258
|
-
var POPOVER_RENAME_SPACE = `${import_chunk_46S3JOES.SPACE_PLUGIN}/PopoverRenameSpace`;
|
|
1259
|
-
var PopoverRenameSpace = ({ space }) => {
|
|
1260
|
-
const { t } = (0, import_react_ui12.useTranslation)(import_chunk_46S3JOES.SPACE_PLUGIN);
|
|
1261
|
-
const doneButton = (0, import_react18.useRef)(null);
|
|
1262
|
-
const [name, setName] = (0, import_react18.useState)(space.properties.name ?? "");
|
|
1263
|
-
const handleDone = (0, import_react18.useCallback)(() => {
|
|
1264
|
-
space.properties.name = name;
|
|
1265
|
-
}, [
|
|
1266
|
-
space,
|
|
1267
|
-
name
|
|
1268
|
-
]);
|
|
1269
|
-
return /* @__PURE__ */ import_react18.default.createElement("div", {
|
|
1270
|
-
role: "none",
|
|
1271
|
-
className: "p-1 flex gap-2"
|
|
1272
|
-
}, /* @__PURE__ */ import_react18.default.createElement("div", {
|
|
1273
|
-
role: "none",
|
|
1274
|
-
className: "flex-1"
|
|
1275
|
-
}, /* @__PURE__ */ import_react18.default.createElement(import_react_ui12.Input.Root, null, /* @__PURE__ */ import_react18.default.createElement(import_react_ui12.Input.Label, {
|
|
1276
|
-
srOnly: true
|
|
1277
|
-
}, t("space name label")), /* @__PURE__ */ import_react18.default.createElement(import_react_ui12.Input.TextInput, {
|
|
1278
|
-
defaultValue: space.properties.name ?? "",
|
|
1279
|
-
placeholder: t("unnamed space label"),
|
|
1280
|
-
onChange: ({ target: { value } }) => setName(value),
|
|
1281
|
-
// TODO(wittjosiah): Ideally this should access the popover context to close the popover.
|
|
1282
|
-
// Currently this is not possible because Radix does not expose the popover context.
|
|
1283
|
-
onKeyDown: ({ key }) => key === "Enter" && doneButton.current?.click()
|
|
1284
|
-
}))), /* @__PURE__ */ import_react18.default.createElement(import_react_ui12.Popover.Close, {
|
|
1285
|
-
asChild: true
|
|
1286
|
-
}, /* @__PURE__ */ import_react18.default.createElement(import_react_ui12.Button, {
|
|
1287
|
-
ref: doneButton,
|
|
1288
|
-
classNames: "self-stretch",
|
|
1289
|
-
onClick: handleDone
|
|
1290
|
-
}, t("done label", {
|
|
1291
|
-
ns: "os"
|
|
1292
|
-
}))));
|
|
1293
|
-
};
|
|
1294
|
-
var ShareSpaceButton = ({ space }) => {
|
|
1295
|
-
const { dispatchPromise: dispatch } = (0, import_app_framework7.useIntentDispatcher)();
|
|
1296
|
-
return /* @__PURE__ */ import_react19.default.createElement(ShareSpaceButtonImpl, {
|
|
1297
|
-
onClick: () => dispatch((0, import_app_framework7.createIntent)(import_chunk_YF2AQ7KP.SpaceAction.Share, {
|
|
1298
|
-
space
|
|
1299
|
-
}))
|
|
1300
|
-
});
|
|
1301
|
-
};
|
|
1302
|
-
var ShareSpaceButtonImpl = ({ onClick }) => {
|
|
1303
|
-
const { t } = (0, import_react_ui13.useTranslation)(import_chunk_46S3JOES.SPACE_PLUGIN);
|
|
1304
|
-
return /* @__PURE__ */ import_react19.default.createElement(import_react_ui13.IconButton, {
|
|
1305
|
-
"data-testid": "spacePlugin.shareSpaceButton",
|
|
1306
|
-
icon: "ph--users--regular",
|
|
1307
|
-
label: t("share space label"),
|
|
1308
|
-
onClick
|
|
1309
|
-
});
|
|
1310
|
-
};
|
|
1311
|
-
var usePath = (graph, id, timeout) => {
|
|
1312
|
-
const [pathState, setPathState] = (0, import_react21.useState)(id ? graph.getPath({
|
|
1313
|
-
target: id
|
|
1314
|
-
}) : void 0);
|
|
1315
|
-
(0, import_react21.useEffect)(() => {
|
|
1316
|
-
if (!id && pathState) {
|
|
1317
|
-
setPathState(void 0);
|
|
1318
|
-
}
|
|
1319
|
-
if (pathState?.at(-1) === id || !id) {
|
|
1320
|
-
return;
|
|
1321
|
-
}
|
|
1322
|
-
const frame = requestAnimationFrame(async () => {
|
|
1323
|
-
try {
|
|
1324
|
-
const path = await graph.waitForPath({
|
|
1325
|
-
target: id
|
|
1326
|
-
}, {
|
|
1327
|
-
timeout
|
|
1328
|
-
});
|
|
1329
|
-
if (path) {
|
|
1330
|
-
setPathState(path);
|
|
1331
|
-
}
|
|
1332
|
-
} catch {
|
|
1333
|
-
}
|
|
1334
|
-
});
|
|
1335
|
-
return () => cancelAnimationFrame(frame);
|
|
1336
|
-
}, [
|
|
1337
|
-
graph,
|
|
1338
|
-
id,
|
|
1339
|
-
timeout,
|
|
1340
|
-
pathState
|
|
1341
|
-
]);
|
|
1342
|
-
return pathState;
|
|
1343
|
-
};
|
|
1344
|
-
var REFRESH_INTERVAL = 5e3;
|
|
1345
|
-
var ACTIVITY_DURATION = 3e4;
|
|
1346
|
-
var noViewers = new import_util3.ComplexMap(import_react_client5.PublicKey.hash);
|
|
1347
|
-
var getName = (identity) => identity.profile?.displayName ?? (0, import_display_name.generateName)(identity.identityKey.toHex());
|
|
1348
|
-
var SpacePresence = ({ object, spaceKey }) => {
|
|
1349
|
-
const spacePlugin = (0, import_app_framework8.usePlugin)(import_chunk_46S3JOES.SPACE_PLUGIN);
|
|
1350
|
-
const client = (0, import_react_client5.useClient)();
|
|
1351
|
-
const identity = (0, import_halo.useIdentity)();
|
|
1352
|
-
const space = spaceKey ? client.spaces.get(spaceKey) : (0, import_echo8.getSpace)(object);
|
|
1353
|
-
const spaceMembers = (0, import_echo8.useMembers)(space?.key);
|
|
1354
|
-
const [_moment, setMoment] = (0, import_react20.useState)(Date.now());
|
|
1355
|
-
(0, import_react20.useEffect)(() => {
|
|
1356
|
-
const interval = setInterval(() => setMoment(Date.now()), REFRESH_INTERVAL);
|
|
1357
|
-
return () => clearInterval(interval);
|
|
1358
|
-
}, []);
|
|
1359
|
-
const memberOnline = (0, import_react20.useCallback)((member) => member.presence === 1, []);
|
|
1360
|
-
const memberIsNotSelf = (0, import_react20.useCallback)((member) => !identity?.identityKey.equals(member.identity.identityKey), [
|
|
1361
|
-
identity?.identityKey
|
|
1362
|
-
]);
|
|
1363
|
-
if (!identity || !spacePlugin || !space) {
|
|
1364
|
-
return null;
|
|
1365
|
-
}
|
|
1366
|
-
const spaceState = spacePlugin.provides.space;
|
|
1367
|
-
const currentObjectViewers = spaceState.viewersByObject[(0, import_echo8.fullyQualifiedId)(object)] ?? noViewers;
|
|
1368
|
-
const membersForObject = spaceMembers.filter((member) => memberOnline(member) && memberIsNotSelf(member)).filter((member) => currentObjectViewers.has(member.identity.identityKey)).map((member) => {
|
|
1369
|
-
const objectView = currentObjectViewers.get(member.identity.identityKey);
|
|
1370
|
-
const lastSeen = objectView?.lastSeen ?? -Infinity;
|
|
1371
|
-
const currentlyAttended = objectView?.currentlyAttended ?? false;
|
|
1372
|
-
return {
|
|
1373
|
-
...member,
|
|
1374
|
-
currentlyAttended,
|
|
1375
|
-
lastSeen
|
|
1376
|
-
};
|
|
1377
|
-
}).toSorted((a, b) => a.lastSeen - b.lastSeen);
|
|
1378
|
-
return /* @__PURE__ */ import_react20.default.createElement(FullPresence, {
|
|
1379
|
-
members: membersForObject
|
|
1380
|
-
});
|
|
1381
|
-
};
|
|
1382
|
-
var FullPresence = (props) => {
|
|
1383
|
-
const { size = 9, onMemberClick } = props;
|
|
1384
|
-
const members = (0, import_react_ui14.useDefaultValue)(props.members, () => []);
|
|
1385
|
-
if (members.length === 0) {
|
|
1386
|
-
return null;
|
|
1387
|
-
}
|
|
1388
|
-
return /* @__PURE__ */ import_react20.default.createElement(import_react_ui14.AvatarGroup.Root, {
|
|
1389
|
-
size,
|
|
1390
|
-
classNames: "mbs-2 mie-4",
|
|
1391
|
-
"data-testid": "spacePlugin.presence"
|
|
1392
|
-
}, members.slice(0, 3).map((member, i) => /* @__PURE__ */ import_react20.default.createElement(import_react_ui14.Tooltip.Root, {
|
|
1393
|
-
key: member.identity.identityKey.toHex()
|
|
1394
|
-
}, /* @__PURE__ */ import_react20.default.createElement(import_react_ui14.Tooltip.Trigger, null, /* @__PURE__ */ import_react20.default.createElement(PrensenceAvatar, {
|
|
1395
|
-
identity: member.identity,
|
|
1396
|
-
group: true,
|
|
1397
|
-
match: member.currentlyAttended,
|
|
1398
|
-
index: members.length - i,
|
|
1399
|
-
onClick: () => onMemberClick?.(member)
|
|
1400
|
-
})), /* @__PURE__ */ import_react20.default.createElement(import_react_ui14.Tooltip.Portal, null, /* @__PURE__ */ import_react20.default.createElement(import_react_ui14.Tooltip.Content, {
|
|
1401
|
-
side: "bottom"
|
|
1402
|
-
}, /* @__PURE__ */ import_react20.default.createElement("span", null, getName(member.identity)), /* @__PURE__ */ import_react20.default.createElement(import_react_ui14.Tooltip.Arrow, null))))), members.length > 3 && /* @__PURE__ */ import_react20.default.createElement(import_react_ui14.Tooltip.Root, null, /* @__PURE__ */ import_react20.default.createElement(import_react_ui14.Tooltip.Trigger, null, /* @__PURE__ */ import_react20.default.createElement(import_react_ui14.AvatarGroupItem.Root, {
|
|
1403
|
-
status: "inactive"
|
|
1404
|
-
}, /* @__PURE__ */ import_react20.default.createElement(import_react_ui14.Avatar.Frame, {
|
|
1405
|
-
style: {
|
|
1406
|
-
zIndex: members.length - 4
|
|
1407
|
-
}
|
|
1408
|
-
}, /* @__PURE__ */ import_react20.default.createElement(import_react_ui14.Avatar.Fallback, {
|
|
1409
|
-
text: `+${members.length - 3}`
|
|
1410
|
-
})))), /* @__PURE__ */ import_react20.default.createElement(import_react_ui14.Tooltip.Portal, null, /* @__PURE__ */ import_react20.default.createElement(import_react_ui14.Tooltip.Content, {
|
|
1411
|
-
side: "bottom"
|
|
1412
|
-
}, /* @__PURE__ */ import_react20.default.createElement(import_react_ui14.Tooltip.Arrow, null), /* @__PURE__ */ import_react20.default.createElement(import_react_ui14.List, {
|
|
1413
|
-
classNames: "max-h-56 overflow-y-auto"
|
|
1414
|
-
}, members.map((member) => /* @__PURE__ */ import_react20.default.createElement(import_react_ui14.ListItem.Root, {
|
|
1415
|
-
key: member.identity.identityKey.toHex(),
|
|
1416
|
-
classNames: "flex gap-2 items-center cursor-pointer mbe-2",
|
|
1417
|
-
onClick: () => onMemberClick?.(member),
|
|
1418
|
-
"data-testid": "identity-list-item"
|
|
1419
|
-
}, /* @__PURE__ */ import_react20.default.createElement(PrensenceAvatar, {
|
|
1420
|
-
identity: member.identity,
|
|
1421
|
-
showName: true,
|
|
1422
|
-
match: member.currentlyAttended
|
|
1423
|
-
}))))))));
|
|
1424
|
-
};
|
|
1425
|
-
var PrensenceAvatar = ({ identity, showName, match, group, index, onClick }) => {
|
|
1426
|
-
const Root = group ? import_react_ui14.AvatarGroupItem.Root : import_react_ui14.Avatar.Root;
|
|
1427
|
-
const status = match ? "current" : "active";
|
|
1428
|
-
const fallbackValue = (0, import_util3.keyToFallback)(identity.identityKey);
|
|
1429
|
-
return /* @__PURE__ */ import_react20.default.createElement(Root, {
|
|
1430
|
-
status,
|
|
1431
|
-
hue: identity.profile?.data?.hue || fallbackValue.hue
|
|
1432
|
-
}, /* @__PURE__ */ import_react20.default.createElement(import_react_ui14.Avatar.Frame, {
|
|
1433
|
-
"data-testid": "spacePlugin.presence.member",
|
|
1434
|
-
"data-status": status,
|
|
1435
|
-
...index ? {
|
|
1436
|
-
style: {
|
|
1437
|
-
zIndex: index
|
|
1438
|
-
}
|
|
1439
|
-
} : {},
|
|
1440
|
-
onClick: () => onClick?.()
|
|
1441
|
-
}, /* @__PURE__ */ import_react20.default.createElement(import_react_ui14.Avatar.Fallback, {
|
|
1442
|
-
text: identity.profile?.data?.emoji || fallbackValue.emoji
|
|
1443
|
-
})), showName && /* @__PURE__ */ import_react20.default.createElement(import_react_ui14.Avatar.Label, {
|
|
1444
|
-
classNames: "text-sm truncate pli-2"
|
|
1445
|
-
}, getName(identity)));
|
|
1446
|
-
};
|
|
1447
|
-
var SmallPresenceLive = ({ id, open, viewers }) => {
|
|
1448
|
-
const { hasAttention, isAncestor, isRelated } = (0, import_react_ui_attention.useAttention)(id);
|
|
1449
|
-
const isAttended = hasAttention || isAncestor || isRelated;
|
|
1450
|
-
const { graph } = (0, import_plugin_graph4.useGraph)();
|
|
1451
|
-
const attended = (0, import_react_ui_attention.useAttended)();
|
|
1452
|
-
const startOfAttention = attended.at(-1);
|
|
1453
|
-
const path = usePath(graph, startOfAttention);
|
|
1454
|
-
const containsAttended = !open && !isAttended && id && path ? path.includes(id) : false;
|
|
1455
|
-
const getActiveViewers = (viewers2) => {
|
|
1456
|
-
const moment = Date.now();
|
|
1457
|
-
return Array.from(viewers2.values()).filter((viewer) => moment - viewer.lastSeen < ACTIVITY_DURATION);
|
|
1458
|
-
};
|
|
1459
|
-
const [activeViewers, setActiveViewers] = (0, import_react20.useState)(viewers ? getActiveViewers(viewers) : []);
|
|
1460
|
-
(0, import_react20.useEffect)(() => {
|
|
1461
|
-
if (viewers) {
|
|
1462
|
-
setActiveViewers(getActiveViewers(viewers));
|
|
1463
|
-
const interval = setInterval(() => {
|
|
1464
|
-
setActiveViewers(getActiveViewers(viewers));
|
|
1465
|
-
}, REFRESH_INTERVAL);
|
|
1466
|
-
return () => clearInterval(interval);
|
|
1467
|
-
}
|
|
1468
|
-
}, [
|
|
1469
|
-
viewers
|
|
1470
|
-
]);
|
|
1471
|
-
return /* @__PURE__ */ import_react20.default.createElement(SmallPresence, {
|
|
1472
|
-
count: activeViewers.length,
|
|
1473
|
-
attended: isAttended,
|
|
1474
|
-
containsAttended
|
|
1475
|
-
});
|
|
1476
|
-
};
|
|
1477
|
-
var SmallPresence = ({ count = 0, attended, containsAttended }) => {
|
|
1478
|
-
const { t } = (0, import_react_ui14.useTranslation)(import_chunk_46S3JOES.SPACE_PLUGIN);
|
|
1479
|
-
return /* @__PURE__ */ import_react20.default.createElement(import_react_ui14.Tooltip.Root, null, /* @__PURE__ */ import_react20.default.createElement(import_react_ui14.Tooltip.Trigger, {
|
|
1480
|
-
asChild: true
|
|
1481
|
-
}, /* @__PURE__ */ import_react20.default.createElement(import_react_ui_attention.AttentionGlyph, {
|
|
1482
|
-
attended,
|
|
1483
|
-
containsAttended,
|
|
1484
|
-
presence: count > 1 ? "many" : count === 1 ? "one" : "none",
|
|
1485
|
-
classNames: "self-center mie-1"
|
|
1486
|
-
})), /* @__PURE__ */ import_react20.default.createElement(import_react_ui14.Tooltip.Portal, null, /* @__PURE__ */ import_react20.default.createElement(import_react_ui14.Tooltip.Content, {
|
|
1487
|
-
side: "bottom"
|
|
1488
|
-
}, /* @__PURE__ */ import_react20.default.createElement("span", null, t("presence label", {
|
|
1489
|
-
count
|
|
1490
|
-
})), /* @__PURE__ */ import_react20.default.createElement(import_react_ui14.Tooltip.Arrow, null))));
|
|
1491
|
-
};
|
|
1492
|
-
var SpacePluginSettings = ({ settings }) => {
|
|
1493
|
-
const { t } = (0, import_react_ui15.useTranslation)(import_chunk_46S3JOES.SPACE_PLUGIN);
|
|
1494
|
-
const { dispatchPromise: dispatch } = (0, import_app_framework9.useIntentDispatcher)();
|
|
1495
|
-
return /* @__PURE__ */ import_react22.default.createElement(import_react22.default.Fragment, null, /* @__PURE__ */ import_react22.default.createElement(import_react_ui_form3.DeprecatedFormInput, {
|
|
1496
|
-
label: t("show hidden spaces label")
|
|
1497
|
-
}, /* @__PURE__ */ import_react22.default.createElement(import_react_ui15.Input.Switch, {
|
|
1498
|
-
checked: settings.showHidden,
|
|
1499
|
-
onCheckedChange: (checked) => dispatch((0, import_app_framework9.createIntent)(import_chunk_YF2AQ7KP.SpaceAction.ToggleHidden, {
|
|
1500
|
-
state: !!checked
|
|
1501
|
-
}))
|
|
1502
|
-
})));
|
|
1503
|
-
};
|
|
1504
|
-
var __dxlog_file3 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/SpaceSettings/SpaceSettingsPanel.tsx";
|
|
1505
|
-
var SpaceSettingsPanel = ({ classNames, space }) => {
|
|
1506
|
-
const { t } = (0, import_react_ui17.useTranslation)(import_chunk_46S3JOES.SPACE_PLUGIN);
|
|
1507
|
-
const client = (0, import_react_client7.useClient)();
|
|
1508
|
-
const edgeEnabled = Boolean(client.config.values.runtime?.client?.edgeFeatures?.echoReplicator);
|
|
1509
|
-
const [edgeReplication, setEdgeReplication] = (0, import_react25.useState)(space.internal.data.edgeReplication === import_metadata2.EdgeReplicationSetting.ENABLED);
|
|
1510
|
-
const toggleEdgeReplication = (0, import_react25.useCallback)(async (next) => {
|
|
1511
|
-
setEdgeReplication(next);
|
|
1512
|
-
await space?.internal.setEdgeReplicationPreference(next ? import_metadata2.EdgeReplicationSetting.ENABLED : import_metadata2.EdgeReplicationSetting.DISABLED).catch((err) => {
|
|
1513
|
-
import_log3.log.catch(err, void 0, {
|
|
1514
|
-
F: __dxlog_file3,
|
|
1515
|
-
L: 36,
|
|
1516
|
-
S: void 0,
|
|
1517
|
-
C: (f, a) => f(...a)
|
|
1518
|
-
});
|
|
1519
|
-
setEdgeReplication(!next);
|
|
1520
|
-
});
|
|
1521
|
-
}, [
|
|
1522
|
-
space
|
|
1523
|
-
]);
|
|
1524
|
-
return /* @__PURE__ */ import_react25.default.createElement("div", {
|
|
1525
|
-
role: "form",
|
|
1526
|
-
className: (0, import_react_ui_theme4.mx)("flex flex-col", classNames)
|
|
1527
|
-
}, /* @__PURE__ */ import_react25.default.createElement(import_react_ui_form4.DeprecatedFormInput, {
|
|
1528
|
-
label: t("name label")
|
|
1529
|
-
}, /* @__PURE__ */ import_react25.default.createElement(import_react_ui17.Input.TextInput, {
|
|
1530
|
-
placeholder: t("unnamed space label"),
|
|
1531
|
-
value: space.properties.name ?? "",
|
|
1532
|
-
onChange: (event) => {
|
|
1533
|
-
space.properties.name = event.target.value;
|
|
1534
|
-
}
|
|
1535
|
-
})), edgeEnabled && /* @__PURE__ */ import_react25.default.createElement(import_react_ui_form4.DeprecatedFormInput, {
|
|
1536
|
-
label: t("edge replication label")
|
|
1537
|
-
}, /* @__PURE__ */ import_react25.default.createElement(import_react_ui17.Input.Switch, {
|
|
1538
|
-
checked: edgeReplication,
|
|
1539
|
-
onCheckedChange: toggleEdgeReplication
|
|
1540
|
-
})));
|
|
1541
|
-
};
|
|
1542
|
-
var SPACE_SETTINGS_DIALOG = `${import_chunk_46S3JOES.SPACE_PLUGIN}/SpaceSettingsDialog`;
|
|
1543
|
-
var SpaceSettingsDialog = ({ space, target, createInvitationUrl, initialTab = "members", namesCache }) => {
|
|
1544
|
-
const { t } = (0, import_react_ui16.useTranslation)(import_chunk_46S3JOES.SPACE_PLUGIN);
|
|
1545
|
-
const client = (0, import_react_client6.useClient)();
|
|
1546
|
-
const [tabsActivePart, setTabsActivePart] = (0, import_react23.useState)("list");
|
|
1547
|
-
const [selected, setSelected] = (0, import_react23.useState)(initialTab);
|
|
1548
|
-
const locked = space.properties[COMPOSER_SPACE_LOCK];
|
|
1549
|
-
const name = getSpaceDisplayName(space, {
|
|
1550
|
-
personal: client.spaces.default === space,
|
|
1551
|
-
namesCache
|
|
1552
|
-
});
|
|
1553
|
-
return (
|
|
1554
|
-
// TODO(wittjosiah): The tablist dialog pattern is copied from @dxos/plugin-manager.
|
|
1555
|
-
// Consider factoring it out to the tabs package.
|
|
1556
|
-
/* @__PURE__ */ import_react23.default.createElement(import_react_ui16.Dialog.Content, {
|
|
1557
|
-
classNames: "p-0 bs-content min-bs-[15rem] max-bs-full md:max-is-[40rem] overflow-hidden"
|
|
1558
|
-
}, /* @__PURE__ */ import_react23.default.createElement("div", {
|
|
1559
|
-
role: "none",
|
|
1560
|
-
className: "flex justify-between pbs-2 pis-2 pie-2 @md:pbs-4 @md:pis-4 @md:pie-4"
|
|
1561
|
-
}, /* @__PURE__ */ import_react23.default.createElement(import_react_ui16.Dialog.Title, {
|
|
1562
|
-
onClick: () => setTabsActivePart("list"),
|
|
1563
|
-
"aria-description": t("click to return to tablist description"),
|
|
1564
|
-
classNames: "flex cursor-pointer items-center group/title"
|
|
1565
|
-
}, /* @__PURE__ */ import_react23.default.createElement(import_react_ui16.Icon, {
|
|
1566
|
-
icon: "ph--caret-left--regular",
|
|
1567
|
-
size: 4,
|
|
1568
|
-
classNames: [
|
|
1569
|
-
"@md:hidden",
|
|
1570
|
-
tabsActivePart === "list" && "invisible"
|
|
1571
|
-
]
|
|
1572
|
-
}), /* @__PURE__ */ import_react23.default.createElement("span", {
|
|
1573
|
-
className: tabsActivePart !== "list" ? "group-hover/title:underline @md:group-hover/title:no-underline underline-offset-4 decoration-1" : ""
|
|
1574
|
-
}, (0, import_react_ui16.toLocalizedString)(name, t))), /* @__PURE__ */ import_react23.default.createElement(import_react_ui16.Dialog.Close, {
|
|
1575
|
-
asChild: true
|
|
1576
|
-
}, /* @__PURE__ */ import_react23.default.createElement(import_react_ui16.Button, {
|
|
1577
|
-
density: "fine",
|
|
1578
|
-
variant: "ghost",
|
|
1579
|
-
autoFocus: true
|
|
1580
|
-
}, /* @__PURE__ */ import_react23.default.createElement(import_react_ui16.Icon, {
|
|
1581
|
-
icon: "ph--x--regular",
|
|
1582
|
-
size: 4
|
|
1583
|
-
})))), /* @__PURE__ */ import_react23.default.createElement(import_react_ui_tabs.Tabs.Root, {
|
|
1584
|
-
orientation: "vertical",
|
|
1585
|
-
value: selected,
|
|
1586
|
-
onValueChange: setSelected,
|
|
1587
|
-
activePart: tabsActivePart,
|
|
1588
|
-
onActivePartChange: setTabsActivePart,
|
|
1589
|
-
classNames: "flex flex-col flex-1 mbs-2"
|
|
1590
|
-
}, /* @__PURE__ */ import_react23.default.createElement(import_react_ui_tabs.Tabs.Viewport, {
|
|
1591
|
-
classNames: "flex-1 min-bs-0"
|
|
1592
|
-
}, /* @__PURE__ */ import_react23.default.createElement("div", {
|
|
1593
|
-
role: "none",
|
|
1594
|
-
className: "overflow-y-auto pli-3 @md:pis-2 @md:pie-0 mbe-4 border-r border-separator"
|
|
1595
|
-
}, /* @__PURE__ */ import_react23.default.createElement(import_react_ui_tabs.Tabs.Tablist, {
|
|
1596
|
-
classNames: "flex flex-col max-bs-none min-is-[200px] gap-4 overflow-y-auto"
|
|
1597
|
-
}, /* @__PURE__ */ import_react23.default.createElement("div", {
|
|
1598
|
-
role: "none",
|
|
1599
|
-
className: "flex flex-col ml-1"
|
|
1600
|
-
}, /* @__PURE__ */ import_react23.default.createElement(import_react_ui_tabs.Tabs.Tab, {
|
|
1601
|
-
value: "settings"
|
|
1602
|
-
}, t("settings tab label")), /* @__PURE__ */ import_react23.default.createElement(import_react_ui_tabs.Tabs.Tab, {
|
|
1603
|
-
value: "members",
|
|
1604
|
-
disabled: locked
|
|
1605
|
-
}, t("members tab label"))))), /* @__PURE__ */ import_react23.default.createElement(import_react_ui_tabs.Tabs.Tabpanel, {
|
|
1606
|
-
value: "settings",
|
|
1607
|
-
classNames: "pli-3 @md:pli-5 max-bs-dvh overflow-y-auto"
|
|
1608
|
-
}, /* @__PURE__ */ import_react23.default.createElement(SpaceSettingsPanel, {
|
|
1609
|
-
space
|
|
1610
|
-
})), /* @__PURE__ */ import_react23.default.createElement(import_react_ui_tabs.Tabs.Tabpanel, {
|
|
1611
|
-
value: "members",
|
|
1612
|
-
classNames: "pli-3 @md:pli-5 max-bs-dvh overflow-y-auto"
|
|
1613
|
-
}, /* @__PURE__ */ import_react23.default.createElement(import_react_ui16.Clipboard.Provider, null, /* @__PURE__ */ import_react23.default.createElement(import_react24.SpacePanel, {
|
|
1614
|
-
space,
|
|
1615
|
-
hideHeading: true,
|
|
1616
|
-
target,
|
|
1617
|
-
createInvitationUrl
|
|
1618
|
-
}))))))
|
|
1619
|
-
);
|
|
1620
|
-
};
|
|
1621
|
-
var __dxlog_file4 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/SyncStatus/sync-state.ts";
|
|
1622
|
-
var createEmptyEdgeSyncState = () => ({
|
|
1623
|
-
missingOnLocal: 0,
|
|
1624
|
-
missingOnRemote: 0,
|
|
1625
|
-
localDocumentCount: 0,
|
|
1626
|
-
remoteDocumentCount: 0,
|
|
1627
|
-
differentDocuments: 0
|
|
1628
|
-
});
|
|
1629
|
-
var getSyncSummary = (syncMap) => {
|
|
1630
|
-
return Object.entries(syncMap).reduce((summary, [_spaceId, peerState]) => {
|
|
1631
|
-
summary.missingOnLocal += peerState.missingOnLocal;
|
|
1632
|
-
summary.missingOnRemote += peerState.missingOnRemote;
|
|
1633
|
-
summary.localDocumentCount += peerState.localDocumentCount;
|
|
1634
|
-
summary.remoteDocumentCount += peerState.remoteDocumentCount;
|
|
1635
|
-
summary.differentDocuments += peerState.differentDocuments;
|
|
1636
|
-
return summary;
|
|
1637
|
-
}, createEmptyEdgeSyncState());
|
|
1638
|
-
};
|
|
1639
|
-
var isEdgePeerId = (peerId, spaceId) => peerId.startsWith(`${import_protocols.EdgeService.AUTOMERGE_REPLICATOR}:${spaceId}`);
|
|
1640
|
-
var useSyncState = () => {
|
|
1641
|
-
const client = (0, import_react_client9.useClient)();
|
|
1642
|
-
const [spaceState, setSpaceState] = (0, import_react27.useState)({});
|
|
1643
|
-
(0, import_react27.useEffect)(() => {
|
|
1644
|
-
const ctx = new import_context.Context(void 0, {
|
|
1645
|
-
F: __dxlog_file4,
|
|
1646
|
-
L: 48
|
|
1647
|
-
});
|
|
1648
|
-
const createSubscriptions = (spaces) => {
|
|
1649
|
-
for (const space of spaces) {
|
|
1650
|
-
if (spaceState[space.id]) {
|
|
1651
|
-
continue;
|
|
1652
|
-
}
|
|
1653
|
-
ctx.onDispose(space.crud.subscribeToSyncState(ctx, ({ peers = [] }) => {
|
|
1654
|
-
const syncState = peers.find((state) => isEdgePeerId(state.peerId, space.id));
|
|
1655
|
-
if (syncState) {
|
|
1656
|
-
setSpaceState((spaceState2) => ({
|
|
1657
|
-
...spaceState2,
|
|
1658
|
-
[space.id]: syncState
|
|
1659
|
-
}));
|
|
1660
|
-
}
|
|
1661
|
-
}));
|
|
1662
|
-
}
|
|
1663
|
-
};
|
|
1664
|
-
createSubscriptions(client.spaces.get());
|
|
1665
|
-
client.spaces.subscribe((spaces) => {
|
|
1666
|
-
createSubscriptions(spaces);
|
|
1667
|
-
});
|
|
1668
|
-
return () => {
|
|
1669
|
-
void ctx.dispose();
|
|
1670
|
-
};
|
|
1671
|
-
}, [
|
|
1672
|
-
client
|
|
1673
|
-
]);
|
|
1674
|
-
return spaceState;
|
|
1675
|
-
};
|
|
1676
|
-
var useSpaceSyncState = (space) => {
|
|
1677
|
-
const [spaceState, setSpaceState] = (0, import_react27.useState)();
|
|
1678
|
-
(0, import_react27.useEffect)(() => {
|
|
1679
|
-
const ctx = new import_context.Context(void 0, {
|
|
1680
|
-
F: __dxlog_file4,
|
|
1681
|
-
L: 87
|
|
1682
|
-
});
|
|
1683
|
-
space.crud.subscribeToSyncState(ctx, ({ peers = [] }) => {
|
|
1684
|
-
const syncState = peers.find((state) => isEdgePeerId(state.peerId, space.id));
|
|
1685
|
-
if (syncState) {
|
|
1686
|
-
setSpaceState(syncState);
|
|
1687
|
-
}
|
|
1688
|
-
});
|
|
1689
|
-
return () => {
|
|
1690
|
-
void ctx.dispose();
|
|
1691
|
-
};
|
|
1692
|
-
}, [
|
|
1693
|
-
space
|
|
1694
|
-
]);
|
|
1695
|
-
return spaceState;
|
|
1696
|
-
};
|
|
1697
|
-
var useEdgeStatus = () => {
|
|
1698
|
-
const [status, setStatus] = (0, import_react26.useState)(import_services.QueryEdgeStatusResponse.EdgeStatus.NOT_CONNECTED);
|
|
1699
|
-
const client = (0, import_react_client8.useClient)();
|
|
1700
|
-
(0, import_react26.useEffect)(() => {
|
|
1701
|
-
client.services.services.EdgeAgentService?.queryEdgeStatus().subscribe(({ status: status2 }) => {
|
|
1702
|
-
setStatus(status2);
|
|
1703
|
-
});
|
|
1704
|
-
}, [
|
|
1705
|
-
client
|
|
1706
|
-
]);
|
|
1707
|
-
return status;
|
|
1708
|
-
};
|
|
1709
|
-
var InlineSyncStatus = ({ space, open }) => {
|
|
1710
|
-
const { t } = (0, import_react_ui18.useTranslation)(import_chunk_46S3JOES.SPACE_PLUGIN);
|
|
1711
|
-
const id = space.id;
|
|
1712
|
-
const { hasAttention, isAncestor, isRelated } = (0, import_react_ui_attention2.useAttention)(id);
|
|
1713
|
-
const isAttended = hasAttention || isAncestor || isRelated;
|
|
1714
|
-
const { graph } = (0, import_plugin_graph5.useGraph)();
|
|
1715
|
-
const attended = (0, import_react_ui_attention2.useAttended)();
|
|
1716
|
-
const startOfAttention = attended.at(-1);
|
|
1717
|
-
const path = usePath(graph, startOfAttention);
|
|
1718
|
-
const containsAttended = !open && !isAttended && id && path ? path.includes(id) : false;
|
|
1719
|
-
const connectedToEdge = useEdgeStatus() === import_services.QueryEdgeStatusResponse.EdgeStatus.CONNECTED;
|
|
1720
|
-
const edgeSyncEnabled = space.internal.data.edgeReplication === import_metadata3.EdgeReplicationSetting.ENABLED;
|
|
1721
|
-
const syncState = useSpaceSyncState(space);
|
|
1722
|
-
const syncing = connectedToEdge && edgeSyncEnabled && syncState && syncState.missingOnLocal > 0;
|
|
1723
|
-
return /* @__PURE__ */ import_react26.default.createElement(import_react_ui18.Tooltip.Root, null, /* @__PURE__ */ import_react26.default.createElement(import_react_ui18.Tooltip.Trigger, {
|
|
1724
|
-
asChild: true
|
|
1725
|
-
}, /* @__PURE__ */ import_react26.default.createElement(import_react_ui_attention2.AttentionGlyph, {
|
|
1726
|
-
syncing,
|
|
1727
|
-
attended: isAttended,
|
|
1728
|
-
containsAttended,
|
|
1729
|
-
classNames: "self-center mie-1"
|
|
1730
|
-
})), /* @__PURE__ */ import_react26.default.createElement(import_react_ui18.Tooltip.Portal, null, /* @__PURE__ */ import_react26.default.createElement(import_react_ui18.Tooltip.Content, {
|
|
1731
|
-
side: "bottom",
|
|
1732
|
-
classNames: "z-[70]"
|
|
1733
|
-
}, /* @__PURE__ */ import_react26.default.createElement("span", null, t("syncing label")), /* @__PURE__ */ import_react26.default.createElement(import_react_ui18.Tooltip.Arrow, null))));
|
|
1734
|
-
};
|
|
1735
|
-
var SYNC_STALLED_TIMEOUT = 5e3;
|
|
1736
|
-
var styles = {
|
|
1737
|
-
barBg: "bg-neutral-50 dark:bg-green-900 text-black",
|
|
1738
|
-
barFg: "bg-neutral-100 bg-green-500",
|
|
1739
|
-
barHover: "dark:hover:bg-green-500"
|
|
1740
|
-
};
|
|
1741
|
-
var useActive = (count) => {
|
|
1742
|
-
const [current, setCurrent] = (0, import_react29.useState)(count);
|
|
1743
|
-
const [active, setActive] = (0, import_react29.useState)(false);
|
|
1744
|
-
(0, import_react29.useEffect)(() => {
|
|
1745
|
-
let t;
|
|
1746
|
-
if (count !== current) {
|
|
1747
|
-
setActive(true);
|
|
1748
|
-
setCurrent(count);
|
|
1749
|
-
t && clearTimeout(t);
|
|
1750
|
-
t = setTimeout(() => {
|
|
1751
|
-
setActive(false);
|
|
1752
|
-
}, SYNC_STALLED_TIMEOUT);
|
|
1753
|
-
}
|
|
1754
|
-
return () => {
|
|
1755
|
-
setActive(false);
|
|
1756
|
-
clearTimeout(t);
|
|
1757
|
-
};
|
|
1758
|
-
}, [
|
|
1759
|
-
count,
|
|
1760
|
-
current
|
|
1761
|
-
]);
|
|
1762
|
-
return active;
|
|
1763
|
-
};
|
|
1764
|
-
var SpaceRowContainer = ({ spaceId, state }) => {
|
|
1765
|
-
const { t } = (0, import_react_ui20.useTranslation)(import_chunk_46S3JOES.SPACE_PLUGIN);
|
|
1766
|
-
const client = (0, import_react_client11.useClient)();
|
|
1767
|
-
const space = (0, import_echo9.useSpace)(spaceId);
|
|
1768
|
-
if (!space) {
|
|
1769
|
-
return null;
|
|
1770
|
-
}
|
|
1771
|
-
const spaceName = (0, import_react_ui20.toLocalizedString)(getSpaceDisplayName(space, {
|
|
1772
|
-
personal: space === client.spaces.default
|
|
1773
|
-
}), t);
|
|
1774
|
-
return /* @__PURE__ */ import_react29.default.createElement(SpaceRow, {
|
|
1775
|
-
spaceId,
|
|
1776
|
-
spaceName,
|
|
1777
|
-
state
|
|
1778
|
-
});
|
|
1779
|
-
};
|
|
1780
|
-
var SpaceRow = ({ spaceId, spaceName, state: { localDocumentCount, remoteDocumentCount, missingOnLocal, missingOnRemote } }) => {
|
|
1781
|
-
const downActive = useActive(localDocumentCount);
|
|
1782
|
-
const upActive = useActive(remoteDocumentCount);
|
|
1783
|
-
return /* @__PURE__ */ import_react29.default.createElement("div", {
|
|
1784
|
-
className: "flex items-center mx-0.5 gap-0.5 cursor-pointer",
|
|
1785
|
-
title: spaceId,
|
|
1786
|
-
onClick: () => {
|
|
1787
|
-
void navigator.clipboard.writeText(spaceId);
|
|
1788
|
-
}
|
|
1789
|
-
}, /* @__PURE__ */ import_react29.default.createElement("span", {
|
|
1790
|
-
className: "is-1/2 truncate"
|
|
1791
|
-
}, spaceName), /* @__PURE__ */ import_react29.default.createElement(import_react_ui20.Icon, {
|
|
1792
|
-
icon: "ph--arrow-fat-line-left--regular",
|
|
1793
|
-
size: 3,
|
|
1794
|
-
classNames: (0, import_react_ui_theme6.mx)(downActive && "animate-[pulse_1s_infinite]")
|
|
1795
|
-
}), /* @__PURE__ */ import_react29.default.createElement(Candle, {
|
|
1796
|
-
up: {
|
|
1797
|
-
count: remoteDocumentCount,
|
|
1798
|
-
total: remoteDocumentCount + missingOnRemote
|
|
1799
|
-
},
|
|
1800
|
-
down: {
|
|
1801
|
-
count: localDocumentCount,
|
|
1802
|
-
total: localDocumentCount + missingOnLocal
|
|
1803
|
-
},
|
|
1804
|
-
title: spaceId
|
|
1805
|
-
}), /* @__PURE__ */ import_react29.default.createElement(import_react_ui20.Icon, {
|
|
1806
|
-
icon: "ph--arrow-fat-line-right--regular",
|
|
1807
|
-
size: 3,
|
|
1808
|
-
classNames: (0, import_react_ui_theme6.mx)(upActive && "animate-[pulse_1s_step-start_infinite]")
|
|
1809
|
-
}));
|
|
1810
|
-
};
|
|
1811
|
-
var Candle = ({ classNames, up, down }) => {
|
|
1812
|
-
return /* @__PURE__ */ import_react29.default.createElement("div", {
|
|
1813
|
-
className: (0, import_react_ui_theme6.mx)("grid grid-cols-[1fr_2rem_1fr] w-full h-3", classNames)
|
|
1814
|
-
}, /* @__PURE__ */ import_react29.default.createElement(Bar, {
|
|
1815
|
-
classNames: "justify-end",
|
|
1816
|
-
...up
|
|
1817
|
-
}), /* @__PURE__ */ import_react29.default.createElement("div", {
|
|
1818
|
-
className: "relative"
|
|
1819
|
-
}, /* @__PURE__ */ import_react29.default.createElement("div", {
|
|
1820
|
-
className: (0, import_react_ui_theme6.mx)("absolute inset-0 flex items-center justify-center text-xs", styles.barBg)
|
|
1821
|
-
}, up.total)), /* @__PURE__ */ import_react29.default.createElement(Bar, down));
|
|
1822
|
-
};
|
|
1823
|
-
var Bar = ({ classNames, count, total }) => {
|
|
1824
|
-
let p = count / total * 100;
|
|
1825
|
-
if (count < total) {
|
|
1826
|
-
p = Math.min(p, 95);
|
|
1827
|
-
}
|
|
1828
|
-
return /* @__PURE__ */ import_react29.default.createElement("div", {
|
|
1829
|
-
className: (0, import_react_ui_theme6.mx)("relative flex w-full", styles.barBg, classNames)
|
|
1830
|
-
}, /* @__PURE__ */ import_react29.default.createElement("div", {
|
|
1831
|
-
className: (0, import_react_ui_theme6.mx)("shrink-0", styles.barFg),
|
|
1832
|
-
style: {
|
|
1833
|
-
width: `${p}%`
|
|
1834
|
-
}
|
|
1835
|
-
}), count !== total && /* @__PURE__ */ import_react29.default.createElement("div", {
|
|
1836
|
-
className: "absolute top-0 bottom-0 flex items-center mx-0.5 text-black text-xs"
|
|
1837
|
-
}, count));
|
|
1838
|
-
};
|
|
1839
|
-
var __dxlog_file5 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/SyncStatus/save-tracker.ts";
|
|
1840
|
-
var createClientSaveTracker = (client, cb) => {
|
|
1841
|
-
const unsubscribeCallbacks = {};
|
|
1842
|
-
const state = {};
|
|
1843
|
-
const install = (spaces) => {
|
|
1844
|
-
for (const space of spaces) {
|
|
1845
|
-
if (state[space.id]) {
|
|
1846
|
-
continue;
|
|
1847
|
-
}
|
|
1848
|
-
state[space.id] = "saved";
|
|
1849
|
-
unsubscribeCallbacks[space.id] = createSpaceSaveTracker(space, (s) => {
|
|
1850
|
-
state[space.id] = s;
|
|
1851
|
-
cb(Object.values(state).some((s2) => s2 === "saving") ? "saving" : "saved");
|
|
1852
|
-
});
|
|
1853
|
-
}
|
|
1854
|
-
};
|
|
1855
|
-
client.spaces.subscribe((spaces) => {
|
|
1856
|
-
install(spaces);
|
|
1857
|
-
});
|
|
1858
|
-
install(client.spaces.get());
|
|
1859
|
-
return () => {
|
|
1860
|
-
for (const unsubscribe of Object.values(unsubscribeCallbacks)) {
|
|
1861
|
-
unsubscribe();
|
|
1862
|
-
}
|
|
1863
|
-
};
|
|
1864
|
-
};
|
|
1865
|
-
var createSpaceSaveTracker = (space, cb) => {
|
|
1866
|
-
const ctx = new import_context2.Context(void 0, {
|
|
1867
|
-
F: __dxlog_file5,
|
|
1868
|
-
L: 40
|
|
1869
|
-
});
|
|
1870
|
-
void space.waitUntilReady().then(() => {
|
|
1871
|
-
if (ctx.disposed) {
|
|
1872
|
-
return;
|
|
1873
|
-
}
|
|
1874
|
-
let hasUnsavedChanges = false;
|
|
1875
|
-
let lastFlushPromise;
|
|
1876
|
-
space.crud.saveStateChanged.on(ctx, ({ unsavedDocuments }) => {
|
|
1877
|
-
hasUnsavedChanges = unsavedDocuments.length > 0;
|
|
1878
|
-
});
|
|
1879
|
-
space.crud.saveStateChanged.debounce(500).on(ctx, () => {
|
|
1880
|
-
if (hasUnsavedChanges) {
|
|
1881
|
-
lastFlushPromise = void 0;
|
|
1882
|
-
cb("saving");
|
|
1883
|
-
} else {
|
|
1884
|
-
const flushPromise = space.crud.flush();
|
|
1885
|
-
lastFlushPromise = flushPromise;
|
|
1886
|
-
void flushPromise.then(() => {
|
|
1887
|
-
if (lastFlushPromise === flushPromise) {
|
|
1888
|
-
cb("saved");
|
|
1889
|
-
}
|
|
1890
|
-
});
|
|
1891
|
-
}
|
|
1892
|
-
});
|
|
1893
|
-
});
|
|
1894
|
-
return () => {
|
|
1895
|
-
void ctx.dispose();
|
|
1896
|
-
};
|
|
1897
|
-
};
|
|
1898
|
-
var getStatus = ({ offline, saved, needsToUpload, needsToDownload }) => {
|
|
1899
|
-
if (!saved) {
|
|
1900
|
-
return "saving locally";
|
|
1901
|
-
} else if (!offline && needsToDownload) {
|
|
1902
|
-
return "downloading";
|
|
1903
|
-
} else if (!offline && needsToUpload) {
|
|
1904
|
-
return "uploading";
|
|
1905
|
-
} else if (offline && !needsToUpload && !needsToDownload) {
|
|
1906
|
-
return "offline persisted";
|
|
1907
|
-
} else {
|
|
1908
|
-
return "remote synced";
|
|
1909
|
-
}
|
|
1910
|
-
};
|
|
1911
|
-
var getIcon = (status) => {
|
|
1912
|
-
switch (status) {
|
|
1913
|
-
case "saving locally":
|
|
1914
|
-
return "ph--download--regular";
|
|
1915
|
-
case "downloading":
|
|
1916
|
-
return "ph--cloud-arrow-down--regular";
|
|
1917
|
-
case "uploading":
|
|
1918
|
-
return "ph--cloud-arrow-up--regular";
|
|
1919
|
-
case "offline persisted":
|
|
1920
|
-
return "ph--check-circle--regular";
|
|
1921
|
-
case "remote synced":
|
|
1922
|
-
return "ph--cloud-check--regular";
|
|
1923
|
-
}
|
|
1924
|
-
};
|
|
1925
|
-
var SyncStatus = () => {
|
|
1926
|
-
const client = (0, import_react_client10.useClient)();
|
|
1927
|
-
const state = useSyncState();
|
|
1928
|
-
const [saved, setSaved] = (0, import_react28.useState)(true);
|
|
1929
|
-
(0, import_react28.useEffect)(() => {
|
|
1930
|
-
return createClientSaveTracker(client, (state2) => {
|
|
1931
|
-
setSaved(state2 === "saved");
|
|
1932
|
-
});
|
|
1933
|
-
}, []);
|
|
1934
|
-
return /* @__PURE__ */ import_react28.default.createElement(SyncStatusIndicator, {
|
|
1935
|
-
state,
|
|
1936
|
-
saved
|
|
1937
|
-
});
|
|
1938
|
-
};
|
|
1939
|
-
var SyncStatusIndicator = ({ state, saved }) => {
|
|
1940
|
-
const { t } = (0, import_react_ui19.useTranslation)(import_chunk_46S3JOES.SPACE_PLUGIN);
|
|
1941
|
-
const summary = getSyncSummary(state);
|
|
1942
|
-
const offline = Object.values(state).length === 0;
|
|
1943
|
-
const needsToUpload = summary.differentDocuments > 0 || summary.missingOnRemote > 0;
|
|
1944
|
-
const needsToDownload = summary.differentDocuments > 0 || summary.missingOnLocal > 0;
|
|
1945
|
-
const status = getStatus({
|
|
1946
|
-
offline,
|
|
1947
|
-
saved,
|
|
1948
|
-
needsToUpload,
|
|
1949
|
-
needsToDownload
|
|
1950
|
-
});
|
|
1951
|
-
const [classNames, setClassNames] = (0, import_react28.useState)();
|
|
1952
|
-
(0, import_react28.useEffect)(() => {
|
|
1953
|
-
setClassNames(void 0);
|
|
1954
|
-
if (offline || !needsToUpload && !needsToDownload) {
|
|
1955
|
-
return;
|
|
1956
|
-
}
|
|
1957
|
-
const t2 = setTimeout(() => {
|
|
1958
|
-
setClassNames("text-orange-500");
|
|
1959
|
-
}, SYNC_STALLED_TIMEOUT);
|
|
1960
|
-
return () => clearTimeout(t2);
|
|
1961
|
-
}, [
|
|
1962
|
-
offline,
|
|
1963
|
-
needsToUpload,
|
|
1964
|
-
needsToDownload
|
|
1965
|
-
]);
|
|
1966
|
-
const title = t(`${status} label`);
|
|
1967
|
-
const icon = /* @__PURE__ */ import_react28.default.createElement(import_react_ui19.Icon, {
|
|
1968
|
-
icon: getIcon(status),
|
|
1969
|
-
size: 4,
|
|
1970
|
-
classNames
|
|
1971
|
-
});
|
|
1972
|
-
if (offline) {
|
|
1973
|
-
return /* @__PURE__ */ import_react28.default.createElement(import_plugin_status_bar.StatusBar.Item, {
|
|
1974
|
-
title
|
|
1975
|
-
}, icon);
|
|
1976
|
-
} else {
|
|
1977
|
-
return /* @__PURE__ */ import_react28.default.createElement(import_react_ui19.Popover.Root, null, /* @__PURE__ */ import_react28.default.createElement(import_react_ui19.Popover.Trigger, {
|
|
1978
|
-
asChild: true
|
|
1979
|
-
}, /* @__PURE__ */ import_react28.default.createElement(import_plugin_status_bar.StatusBar.Button, {
|
|
1980
|
-
title
|
|
1981
|
-
}, icon)), /* @__PURE__ */ import_react28.default.createElement(import_react_ui19.Popover.Portal, null, /* @__PURE__ */ import_react28.default.createElement(import_react_ui19.Popover.Content, {
|
|
1982
|
-
sideOffset: 16
|
|
1983
|
-
}, /* @__PURE__ */ import_react28.default.createElement(SyncStatusDetail, {
|
|
1984
|
-
state,
|
|
1985
|
-
summary,
|
|
1986
|
-
debug: false
|
|
1987
|
-
}))));
|
|
1988
|
-
}
|
|
1989
|
-
};
|
|
1990
|
-
var SyncStatusDetail = ({ classNames, state, summary, debug }) => {
|
|
1991
|
-
const [showAll, setShowAll] = (0, import_react28.useState)(false);
|
|
1992
|
-
const { t } = (0, import_react_ui19.useTranslation)(import_chunk_46S3JOES.SPACE_PLUGIN);
|
|
1993
|
-
const entries = Object.entries(state).filter(([_, value]) => showAll || value.missingOnLocal + value.missingOnRemote > 0).toSorted(([a], [b]) => a < b ? -1 : a > b ? 1 : 0);
|
|
1994
|
-
const handleCheckedChange = (0, import_react28.useCallback)((state2) => setShowAll(state2), [
|
|
1995
|
-
setShowAll
|
|
1996
|
-
]);
|
|
1997
|
-
return /* @__PURE__ */ import_react28.default.createElement("div", {
|
|
1998
|
-
className: (0, import_react_ui_theme5.mx)("flex flex-col gap-3 p-2 text-xs min-w-96", classNames)
|
|
1999
|
-
}, /* @__PURE__ */ import_react28.default.createElement("div", {
|
|
2000
|
-
role: "none",
|
|
2001
|
-
className: "flex items-center"
|
|
2002
|
-
}, /* @__PURE__ */ import_react28.default.createElement("h1", {
|
|
2003
|
-
className: "flex-1"
|
|
2004
|
-
}, t("sync status title")), /* @__PURE__ */ import_react28.default.createElement("div", {
|
|
2005
|
-
className: "flex items-center gap-2"
|
|
2006
|
-
}, /* @__PURE__ */ import_react28.default.createElement(import_react_ui19.Input.Root, null, /* @__PURE__ */ import_react28.default.createElement(import_react_ui19.Input.Label, {
|
|
2007
|
-
classNames: "text-xs"
|
|
2008
|
-
}, t("show all label")), /* @__PURE__ */ import_react28.default.createElement(import_react_ui19.Input.Checkbox, {
|
|
2009
|
-
checked: showAll,
|
|
2010
|
-
onCheckedChange: handleCheckedChange
|
|
2011
|
-
})))), /* @__PURE__ */ import_react28.default.createElement("div", {
|
|
2012
|
-
className: "flex flex-col gap-2"
|
|
2013
|
-
}, entries.length === 0 && /* @__PURE__ */ import_react28.default.createElement("div", {
|
|
2014
|
-
role: "none",
|
|
2015
|
-
className: "flex justify-center"
|
|
2016
|
-
}, t("no sync status label")), entries.map(([spaceId, state2]) => /* @__PURE__ */ import_react28.default.createElement(SpaceRowContainer, {
|
|
2017
|
-
key: spaceId,
|
|
2018
|
-
spaceId,
|
|
2019
|
-
state: state2
|
|
2020
|
-
}))), debug && /* @__PURE__ */ import_react28.default.createElement(import_react_ui_syntax_highlighter.SyntaxHighlighter, {
|
|
2021
|
-
language: "json"
|
|
2022
|
-
}, JSON.stringify(summary, null, 2)));
|
|
2023
|
-
};
|
|
2024
|
-
var translations_default = [
|
|
2025
|
-
{
|
|
2026
|
-
"en-US": {
|
|
2027
|
-
[import_chunk_YF2AQ7KP.CollectionType.typename]: {
|
|
2028
|
-
"typename label": "Collection"
|
|
2029
|
-
},
|
|
2030
|
-
[import_chunk_46S3JOES.SPACE_PLUGIN]: {
|
|
2031
|
-
"plugin name": "Spaces",
|
|
2032
|
-
"first run message": "Nothing selected.",
|
|
2033
|
-
"create space label": "Create space",
|
|
2034
|
-
"join space label": "Join space",
|
|
2035
|
-
"empty space message": "No documents",
|
|
2036
|
-
"empty tree message": "No spaces",
|
|
2037
|
-
"unnamed space label": "New space",
|
|
2038
|
-
"closed space label": "Closed",
|
|
2039
|
-
"loading space label": "Loading space\u2026",
|
|
2040
|
-
"lock space label": "Lock space",
|
|
2041
|
-
"unlock space label": "Unlock space",
|
|
2042
|
-
"rename space label": "Rename space",
|
|
2043
|
-
"active space label": "Active space:",
|
|
2044
|
-
"space name label": "Space name",
|
|
2045
|
-
"object name label": "Object name",
|
|
2046
|
-
"close space label": "Close space",
|
|
2047
|
-
"open space label": "Open space",
|
|
2048
|
-
"export data label": "Export data",
|
|
2049
|
-
"import data label": "Import data",
|
|
2050
|
-
"migrate space label": "Migrate space",
|
|
2051
|
-
"share space": "Share space",
|
|
2052
|
-
"save space to disk label": "Save to disk",
|
|
2053
|
-
"load space from disk label": "Load from disk",
|
|
2054
|
-
"confirm restore title": "Overwrite files in this space?",
|
|
2055
|
-
"confirm restore body": "Restoring from a backup will overwrite the contents of any documents that match.",
|
|
2056
|
-
"upload file message": "Drag file here or click to browse",
|
|
2057
|
-
"object title placeholder": "Type a title here\u2026",
|
|
2058
|
-
"personal space label": "Personal Space",
|
|
2059
|
-
"spaces label": "Spaces",
|
|
2060
|
-
"show hidden spaces label": "Show closed spaces",
|
|
2061
|
-
"save files to directory label": "Save files to disk",
|
|
2062
|
-
"select path label": "Select path",
|
|
2063
|
-
"rename collection label": "Rename collection",
|
|
2064
|
-
"rename object label": "Rename item",
|
|
2065
|
-
"duplicate object label": "Duplicate item",
|
|
2066
|
-
"delete collection label": "Delete collection",
|
|
2067
|
-
"delete object label": "Delete item",
|
|
2068
|
-
"collection deleted label": "Collection deleted",
|
|
2069
|
-
"object deleted label": "Item deleted",
|
|
2070
|
-
"objects deleted label": "Items deleted",
|
|
2071
|
-
"go to object label": "Open item",
|
|
2072
|
-
"found object label": "Ready.",
|
|
2073
|
-
"found object description": "The requested object is now available.",
|
|
2074
|
-
"waiting for object label": "Loading\u2026",
|
|
2075
|
-
"waiting for object description": "The requested object is still being synchronized.",
|
|
2076
|
-
"object not found label": "Nothing found.",
|
|
2077
|
-
"object not found description": "The requested object has not been found yet. Ensure there are enough peers online in the space with an updated copy.",
|
|
2078
|
-
"missing object message": "Object not available.",
|
|
2079
|
-
"missing object description": "The requested object has not been found yet. Ensure there are enough peers online in the space with an updated copy.",
|
|
2080
|
-
"create collection label": "Create collection",
|
|
2081
|
-
"unnamed object label": "New object",
|
|
2082
|
-
"unnamed collection label": "New collection",
|
|
2083
|
-
"create object in space label": "Add to space",
|
|
2084
|
-
"create object in collection label": "Add to collection",
|
|
2085
|
-
"share space label": "Share",
|
|
2086
|
-
"space members label": "Space members",
|
|
2087
|
-
"active space members heading": "Online ({{count}})",
|
|
2088
|
-
"inactive space members heading": "Offline ({{count}})",
|
|
2089
|
-
"presence label_zero": "No other viewers",
|
|
2090
|
-
"presence label_one": "1 other viewer",
|
|
2091
|
-
"presence label_other": "{{count}} other viewers",
|
|
2092
|
-
"persisted locally label": "Changes saved locally.",
|
|
2093
|
-
"persisted locally message": "All changes have been saved to disk on this device.",
|
|
2094
|
-
"persistence pending label": "Saving\u2026",
|
|
2095
|
-
"persistence error label": "Error saving changes.",
|
|
2096
|
-
"more actions label": "More actions",
|
|
2097
|
-
"invitations heading": "Invitations",
|
|
2098
|
-
"keyshortcuts label": "Keyboard shortcuts",
|
|
2099
|
-
"menu footer label": "Details",
|
|
2100
|
-
"location label": "Located in",
|
|
2101
|
-
"space limit label": "Space Limit Reached",
|
|
2102
|
-
"space limit description": "This space has reached the maximum number of objects for the beta. This limit includes deleted objects currently, but those can be permanently removed with the cleanup action.",
|
|
2103
|
-
"space limit close label": "Close",
|
|
2104
|
-
"remove deleted objects label": "Cleanup",
|
|
2105
|
-
"remove deleted objects alt": "Permanently remove deleted objects to free up space.",
|
|
2106
|
-
"copy link label": "Copy link",
|
|
2107
|
-
"default on space create label": "On space create",
|
|
2108
|
-
"sync status title": "Sync status",
|
|
2109
|
-
"dismiss label": "Dismiss",
|
|
2110
|
-
"join success label": "Successfully joined space",
|
|
2111
|
-
"name label": "Name",
|
|
2112
|
-
"name placeholder": "Name",
|
|
2113
|
-
"unnamed object settings label": "Settings",
|
|
2114
|
-
"edge replication label": "Enable EDGE Replication",
|
|
2115
|
-
"saving locally label": "Writing to disk",
|
|
2116
|
-
"downloading label": "Replicating from peers",
|
|
2117
|
-
"uploading label": "Replicating to peers",
|
|
2118
|
-
"offline persisted label": "Saved to disk (offline)",
|
|
2119
|
-
"remote synced label": "Synced with peers",
|
|
2120
|
-
"open settings panel label": "Show Settings",
|
|
2121
|
-
"open space settings label": "Space Settings",
|
|
2122
|
-
"members tab label": "Members",
|
|
2123
|
-
"settings tab label": "Settings",
|
|
2124
|
-
"syncing label": "Space syncing",
|
|
2125
|
-
"show all label": "Show all",
|
|
2126
|
-
"no sync status label": "No space with missing objects.",
|
|
2127
|
-
"create space dialog title": "Create Space",
|
|
2128
|
-
"create object dialog title": "Create Object",
|
|
2129
|
-
"space input placeholder": "Select space",
|
|
2130
|
-
"schema input placeholder": "Select object type",
|
|
2131
|
-
"creating object type label": "Type",
|
|
2132
|
-
"creating in space label": "Location",
|
|
2133
|
-
"creating in collection label": "In Collection",
|
|
2134
|
-
"clear input label": "Clear",
|
|
2135
|
-
"expose object label": "Expose in navtree"
|
|
2136
|
-
}
|
|
2137
|
-
}
|
|
2138
|
-
}
|
|
2139
|
-
];
|
|
2140
|
-
var __dxlog_file6 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/SpacePlugin.tsx";
|
|
2141
|
-
var ACTIVE_NODE_BROADCAST_INTERVAL = 3e4;
|
|
2142
|
-
var WAIT_FOR_OBJECT_TIMEOUT2 = 1e3;
|
|
2143
|
-
var SPACE_MAX_OBJECTS = 500;
|
|
2144
|
-
var DIRECTORY_TYPE = "text/directory";
|
|
2145
|
-
var parseSpacePlugin = (plugin) => Array.isArray(plugin?.provides.space?.enabled) ? plugin : void 0;
|
|
2146
|
-
var SpacePlugin = ({ invitationUrl = window.location.origin, invitationParam = "spaceInvitationCode", firstRun, onFirstRun } = {}) => {
|
|
2147
|
-
const settings = new import_local_storage.LocalStorageStore(import_chunk_46S3JOES.SPACE_PLUGIN, {});
|
|
2148
|
-
const state = new import_local_storage.LocalStorageStore(import_chunk_46S3JOES.SPACE_PLUGIN, {
|
|
2149
|
-
awaiting: void 0,
|
|
2150
|
-
spaceNames: {},
|
|
2151
|
-
viewersByObject: {},
|
|
2152
|
-
// TODO(wittjosiah): Stop using (Complex)Map inside reactive object.
|
|
2153
|
-
viewersByIdentity: new import_util.ComplexMap(import_react_client.PublicKey.hash),
|
|
2154
|
-
sdkMigrationRunning: {},
|
|
2155
|
-
navigableCollections: false,
|
|
2156
|
-
enabledEdgeReplication: false
|
|
2157
|
-
});
|
|
2158
|
-
const subscriptions = new import_async.EventSubscriptions();
|
|
2159
|
-
const spaceSubscriptions = new import_async.EventSubscriptions();
|
|
2160
|
-
const graphSubscriptions = /* @__PURE__ */ new Map();
|
|
2161
|
-
const schemas = [];
|
|
2162
|
-
let clientPlugin;
|
|
2163
|
-
let graphPlugin;
|
|
2164
|
-
let intentPlugin;
|
|
2165
|
-
let layoutPlugin;
|
|
2166
|
-
let navigationPlugin;
|
|
2167
|
-
let attentionPlugin;
|
|
2168
|
-
const createSpaceInvitationUrl = (invitationCode) => {
|
|
2169
|
-
const baseUrl = new URL(invitationUrl);
|
|
2170
|
-
baseUrl.searchParams.set(invitationParam, invitationCode);
|
|
2171
|
-
return baseUrl.toString();
|
|
2172
|
-
};
|
|
2173
|
-
const onSpaceReady = async () => {
|
|
2174
|
-
if (!clientPlugin || !intentPlugin || !graphPlugin || !navigationPlugin || !layoutPlugin || !attentionPlugin) {
|
|
2175
|
-
return;
|
|
2176
|
-
}
|
|
2177
|
-
const client = clientPlugin.provides.client;
|
|
2178
|
-
const dispatch = intentPlugin.provides.intent.dispatch;
|
|
2179
|
-
const graph = graphPlugin.provides.graph;
|
|
2180
|
-
const location = navigationPlugin.provides.location;
|
|
2181
|
-
const layout = layoutPlugin.provides.layout;
|
|
2182
|
-
const attention = attentionPlugin.provides.attention;
|
|
2183
|
-
const defaultSpace = client.spaces.default;
|
|
2184
|
-
if (typeof defaultSpace.properties[COMPOSER_SPACE_LOCK] !== "boolean") {
|
|
2185
|
-
defaultSpace.properties[COMPOSER_SPACE_LOCK] = true;
|
|
2186
|
-
}
|
|
2187
|
-
const { objects: [spacesOrder] } = await defaultSpace.db.query(import_echo.Filter.schema(import_echo.Expando, {
|
|
2188
|
-
key: SHARED
|
|
2189
|
-
})).run();
|
|
2190
|
-
if (!spacesOrder) {
|
|
2191
|
-
defaultSpace.db.add((0, import_live_object.create)({
|
|
2192
|
-
key: SHARED,
|
|
2193
|
-
order: []
|
|
2194
|
-
}));
|
|
2195
|
-
}
|
|
2196
|
-
subscriptions.add((0, import_core.scheduledEffect)(() => ({
|
|
2197
|
-
layoutMode: layout.layoutMode,
|
|
2198
|
-
soloPart: location.active.solo?.[0]
|
|
2199
|
-
}), ({ layoutMode, soloPart }) => {
|
|
2200
|
-
if (layoutMode !== "solo" || !soloPart) {
|
|
2201
|
-
return;
|
|
2202
|
-
}
|
|
2203
|
-
const node = graph.findNode(soloPart.id);
|
|
2204
|
-
if (!node && soloPart.id.length === import_echo.FQ_ID_LENGTH) {
|
|
2205
|
-
const timeout = setTimeout(async () => {
|
|
2206
|
-
const node2 = graph.findNode(soloPart.id);
|
|
2207
|
-
if (!node2) {
|
|
2208
|
-
await dispatch((0, import_app_framework.createIntent)(import_chunk_YF2AQ7KP.SpaceAction.WaitForObject, {
|
|
2209
|
-
id: soloPart.id
|
|
2210
|
-
}));
|
|
2211
|
-
}
|
|
2212
|
-
}, WAIT_FOR_OBJECT_TIMEOUT2);
|
|
2213
|
-
return () => clearTimeout(timeout);
|
|
2214
|
-
}
|
|
2215
|
-
}));
|
|
2216
|
-
subscriptions.add(client.spaces.subscribe(async (spaces) => {
|
|
2217
|
-
if (defaultSpace.state.get() === import_echo.SpaceState.SPACE_REQUIRES_MIGRATION) {
|
|
2218
|
-
await defaultSpace.internal.migrate();
|
|
2219
|
-
}
|
|
2220
|
-
spaces.filter((space) => space.state.get() === import_echo.SpaceState.SPACE_READY).forEach((space) => {
|
|
2221
|
-
subscriptions.add((0, import_core.scheduledEffect)(() => ({
|
|
2222
|
-
name: space.properties.name
|
|
2223
|
-
}), ({ name }) => state.values.spaceNames[space.id] = name));
|
|
2224
|
-
});
|
|
2225
|
-
}).unsubscribe);
|
|
2226
|
-
subscriptions.add((0, import_core.scheduledEffect)(() => ({
|
|
2227
|
-
open: (0, import_app_framework.openIds)(location.active, layout.layoutMode === "solo" ? [
|
|
2228
|
-
"solo"
|
|
2229
|
-
] : [
|
|
2230
|
-
"main"
|
|
2231
|
-
]),
|
|
2232
|
-
closed: [
|
|
2233
|
-
...location.closed
|
|
2234
|
-
]
|
|
2235
|
-
}), ({ open, closed }) => {
|
|
2236
|
-
const send = () => {
|
|
2237
|
-
const spaces = client.spaces.get();
|
|
2238
|
-
const identity = client.halo.identity.get();
|
|
2239
|
-
if (identity && location.active) {
|
|
2240
|
-
const idsBySpace = (0, import_util.reduceGroupBy)(open, (id) => {
|
|
2241
|
-
try {
|
|
2242
|
-
const [spaceId] = (0, import_echo.parseFullyQualifiedId)(id);
|
|
2243
|
-
return spaceId;
|
|
2244
|
-
} catch {
|
|
2245
|
-
return null;
|
|
2246
|
-
}
|
|
2247
|
-
});
|
|
2248
|
-
const removedBySpace = (0, import_util.reduceGroupBy)(closed, (id) => {
|
|
2249
|
-
try {
|
|
2250
|
-
const [spaceId] = (0, import_echo.parseFullyQualifiedId)(id);
|
|
2251
|
-
return spaceId;
|
|
2252
|
-
} catch {
|
|
2253
|
-
return null;
|
|
2254
|
-
}
|
|
2255
|
-
});
|
|
2256
|
-
for (const space of spaces) {
|
|
2257
|
-
if (!idsBySpace.has(space.id)) {
|
|
2258
|
-
idsBySpace.set(space.id, []);
|
|
2259
|
-
}
|
|
2260
|
-
}
|
|
2261
|
-
for (const [spaceId, added] of idsBySpace) {
|
|
2262
|
-
const removed = removedBySpace.get(spaceId) ?? [];
|
|
2263
|
-
const space = spaces.find((space2) => space2.id === spaceId);
|
|
2264
|
-
if (!space) {
|
|
2265
|
-
continue;
|
|
2266
|
-
}
|
|
2267
|
-
void space.postMessage("viewing", {
|
|
2268
|
-
identityKey: identity.identityKey.toHex(),
|
|
2269
|
-
attended: attention.attended ? [
|
|
2270
|
-
...attention.attended
|
|
2271
|
-
] : [],
|
|
2272
|
-
added,
|
|
2273
|
-
removed
|
|
2274
|
-
}).catch((err) => {
|
|
2275
|
-
import_log.log.warn("Failed to broadcast active node for presence.", {
|
|
2276
|
-
err: err.message
|
|
2277
|
-
}, {
|
|
2278
|
-
F: __dxlog_file6,
|
|
2279
|
-
L: 324,
|
|
2280
|
-
S: void 0,
|
|
2281
|
-
C: (f, a) => f(...a)
|
|
2282
|
-
});
|
|
2283
|
-
});
|
|
2284
|
-
}
|
|
2285
|
-
}
|
|
2286
|
-
};
|
|
2287
|
-
send();
|
|
2288
|
-
const interval = setInterval(() => send(), ACTIVE_NODE_BROADCAST_INTERVAL);
|
|
2289
|
-
return () => clearInterval(interval);
|
|
2290
|
-
}));
|
|
2291
|
-
subscriptions.add(client.spaces.subscribe((spaces) => {
|
|
2292
|
-
spaceSubscriptions.clear();
|
|
2293
|
-
spaces.forEach((space) => {
|
|
2294
|
-
spaceSubscriptions.add(space.listen("viewing", (message) => {
|
|
2295
|
-
const { added, removed, attended } = message.payload;
|
|
2296
|
-
const identityKey = import_react_client.PublicKey.safeFrom(message.payload.identityKey);
|
|
2297
|
-
const currentIdentity = client.halo.identity.get();
|
|
2298
|
-
if (identityKey && !currentIdentity?.identityKey.equals(identityKey) && Array.isArray(added) && Array.isArray(removed)) {
|
|
2299
|
-
added.forEach((id) => {
|
|
2300
|
-
if (typeof id === "string") {
|
|
2301
|
-
if (!(id in state.values.viewersByObject)) {
|
|
2302
|
-
state.values.viewersByObject[id] = new import_util.ComplexMap(import_react_client.PublicKey.hash);
|
|
2303
|
-
}
|
|
2304
|
-
state.values.viewersByObject[id].set(identityKey, {
|
|
2305
|
-
lastSeen: Date.now(),
|
|
2306
|
-
currentlyAttended: new Set(attended).has(id)
|
|
2307
|
-
});
|
|
2308
|
-
if (!state.values.viewersByIdentity.has(identityKey)) {
|
|
2309
|
-
state.values.viewersByIdentity.set(identityKey, /* @__PURE__ */ new Set());
|
|
2310
|
-
}
|
|
2311
|
-
state.values.viewersByIdentity.get(identityKey).add(id);
|
|
2312
|
-
}
|
|
2313
|
-
});
|
|
2314
|
-
removed.forEach((id) => {
|
|
2315
|
-
if (typeof id === "string") {
|
|
2316
|
-
state.values.viewersByObject[id]?.delete(identityKey);
|
|
2317
|
-
state.values.viewersByIdentity.get(identityKey)?.delete(id);
|
|
2318
|
-
}
|
|
2319
|
-
});
|
|
2320
|
-
}
|
|
2321
|
-
}));
|
|
2322
|
-
});
|
|
2323
|
-
}).unsubscribe);
|
|
2324
|
-
};
|
|
2325
|
-
const setEdgeReplicationDefault = async (client) => {
|
|
2326
|
-
try {
|
|
2327
|
-
await Promise.all(client.spaces.get().map((space) => space.internal.setEdgeReplicationPreference(import_metadata.EdgeReplicationSetting.ENABLED)));
|
|
2328
|
-
state.values.enabledEdgeReplication = true;
|
|
2329
|
-
} catch (err) {
|
|
2330
|
-
import_log.log.catch(err, void 0, {
|
|
2331
|
-
F: __dxlog_file6,
|
|
2332
|
-
L: 393,
|
|
2333
|
-
S: void 0,
|
|
2334
|
-
C: (f, a) => f(...a)
|
|
2335
|
-
});
|
|
2336
|
-
}
|
|
2337
|
-
};
|
|
2338
|
-
return {
|
|
2339
|
-
meta: import_chunk_46S3JOES.meta_default,
|
|
2340
|
-
ready: async ({ plugins }) => {
|
|
2341
|
-
settings.prop({
|
|
2342
|
-
key: "showHidden",
|
|
2343
|
-
type: import_local_storage.LocalStorageStore.bool({
|
|
2344
|
-
allowUndefined: true
|
|
2345
|
-
})
|
|
2346
|
-
});
|
|
2347
|
-
state.prop({
|
|
2348
|
-
key: "spaceNames",
|
|
2349
|
-
type: import_local_storage.LocalStorageStore.json()
|
|
2350
|
-
}).prop({
|
|
2351
|
-
key: "enabledEdgeReplication",
|
|
2352
|
-
type: import_local_storage.LocalStorageStore.bool()
|
|
2353
|
-
});
|
|
2354
|
-
if ((0, import_app_framework.findPlugin)(plugins, "dxos.org/plugin/stack")) {
|
|
2355
|
-
state.values.navigableCollections = true;
|
|
2356
|
-
}
|
|
2357
|
-
graphPlugin = (0, import_app_framework.resolvePlugin)(plugins, import_app_framework.parseGraphPlugin);
|
|
2358
|
-
layoutPlugin = (0, import_app_framework.resolvePlugin)(plugins, import_app_framework.parseLayoutPlugin);
|
|
2359
|
-
navigationPlugin = (0, import_app_framework.resolvePlugin)(plugins, import_app_framework.parseNavigationPlugin);
|
|
2360
|
-
attentionPlugin = (0, import_app_framework.resolvePlugin)(plugins, import_plugin_attention.parseAttentionPlugin);
|
|
2361
|
-
clientPlugin = (0, import_app_framework.resolvePlugin)(plugins, import_types.parseClientPlugin);
|
|
2362
|
-
intentPlugin = (0, import_app_framework.resolvePlugin)(plugins, import_app_framework.parseIntentPlugin);
|
|
2363
|
-
if (!clientPlugin || !intentPlugin) {
|
|
2364
|
-
return;
|
|
2365
|
-
}
|
|
2366
|
-
const client = clientPlugin.provides.client;
|
|
2367
|
-
const dispatch = intentPlugin.provides.intent.dispatchPromise;
|
|
2368
|
-
schemas.push(...(0, import_app_framework.filterPlugins)(plugins, import_chunk_YF2AQ7KP.parseSchemaPlugin).map((plugin) => plugin.provides.echo.schema).filter(import_util.nonNullable).reduce((acc, schema) => {
|
|
2369
|
-
return [
|
|
2370
|
-
...acc,
|
|
2371
|
-
...schema
|
|
2372
|
-
];
|
|
2373
|
-
}));
|
|
2374
|
-
client.addTypes(schemas);
|
|
2375
|
-
(0, import_app_framework.filterPlugins)(plugins, import_chunk_YF2AQ7KP.parseSchemaPlugin).forEach((plugin) => {
|
|
2376
|
-
if (plugin.provides.echo.system) {
|
|
2377
|
-
client.addTypes(plugin.provides.echo.system);
|
|
2378
|
-
}
|
|
2379
|
-
});
|
|
2380
|
-
const handleFirstRun = async () => {
|
|
2381
|
-
const defaultSpace = client.spaces.default;
|
|
2382
|
-
defaultSpace.properties[import_chunk_YF2AQ7KP.CollectionType.typename] = (0, import_live_object.makeRef)((0, import_live_object.create)(import_chunk_YF2AQ7KP.CollectionType, {
|
|
2383
|
-
objects: [],
|
|
2384
|
-
views: {}
|
|
2385
|
-
}));
|
|
2386
|
-
if (import_migrations.Migrations.versionProperty) {
|
|
2387
|
-
defaultSpace.properties[import_migrations.Migrations.versionProperty] = import_migrations.Migrations.targetVersion;
|
|
2388
|
-
}
|
|
2389
|
-
await onFirstRun?.({
|
|
2390
|
-
client,
|
|
2391
|
-
dispatch
|
|
2392
|
-
});
|
|
2393
|
-
};
|
|
2394
|
-
subscriptions.add(client.spaces.isReady.subscribe(async (ready) => {
|
|
2395
|
-
if (ready) {
|
|
2396
|
-
await clientPlugin?.provides.client.spaces.default.waitUntilReady();
|
|
2397
|
-
if (firstRun) {
|
|
2398
|
-
void firstRun?.wait().then(handleFirstRun);
|
|
2399
|
-
} else {
|
|
2400
|
-
await handleFirstRun();
|
|
2401
|
-
}
|
|
2402
|
-
await onSpaceReady();
|
|
2403
|
-
await setEdgeReplicationDefault(client);
|
|
2404
|
-
}
|
|
2405
|
-
}).unsubscribe);
|
|
2406
|
-
},
|
|
2407
|
-
unload: async () => {
|
|
2408
|
-
settings.close();
|
|
2409
|
-
spaceSubscriptions.clear();
|
|
2410
|
-
subscriptions.clear();
|
|
2411
|
-
graphSubscriptions.forEach((cb) => cb());
|
|
2412
|
-
graphSubscriptions.clear();
|
|
2413
|
-
},
|
|
2414
|
-
provides: {
|
|
2415
|
-
space: state.values,
|
|
2416
|
-
settings: settings.values,
|
|
2417
|
-
translations: [
|
|
2418
|
-
...translations_default,
|
|
2419
|
-
import_react2.osTranslations
|
|
203
|
+
(0, import_app_framework2.defineModule)({
|
|
204
|
+
id: `${import_chunk_WZR6OAN3.meta.id}/module/intent-resolver`,
|
|
205
|
+
activatesOn: import_app_framework2.Events.SetupIntentResolver,
|
|
206
|
+
activate: (context) => (0, import_chunk_N2FS7PRA.IntentResolver)({
|
|
207
|
+
createInvitationUrl,
|
|
208
|
+
context,
|
|
209
|
+
observability
|
|
210
|
+
})
|
|
211
|
+
}),
|
|
212
|
+
(0, import_app_framework2.defineModule)({
|
|
213
|
+
id: `${import_chunk_WZR6OAN3.meta.id}/module/app-graph-builder`,
|
|
214
|
+
activatesOn: import_app_framework2.Events.SetupAppGraph,
|
|
215
|
+
activate: import_chunk_N2FS7PRA.AppGraphBuilder
|
|
216
|
+
}),
|
|
217
|
+
// TODO(wittjosiah): This could probably be deferred.
|
|
218
|
+
(0, import_app_framework2.defineModule)({
|
|
219
|
+
id: `${import_chunk_WZR6OAN3.meta.id}/module/app-graph-serializer`,
|
|
220
|
+
activatesOn: import_app_framework2.Events.AppGraphReady,
|
|
221
|
+
activate: import_chunk_N2FS7PRA.AppGraphSerializer
|
|
222
|
+
}),
|
|
223
|
+
(0, import_app_framework2.defineModule)({
|
|
224
|
+
id: `${import_chunk_WZR6OAN3.meta.id}/module/identity-created`,
|
|
225
|
+
activatesOn: import_plugin_client.ClientEvents.IdentityCreated,
|
|
226
|
+
activatesAfter: [
|
|
227
|
+
SpaceEvents.DefaultSpaceReady
|
|
2420
228
|
],
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
}
|
|
2430
|
-
],
|
|
2431
|
-
icon: "ph--gear--regular"
|
|
2432
|
-
}
|
|
2433
|
-
]
|
|
2434
|
-
},
|
|
2435
|
-
root: () => state.values.awaiting ? /* @__PURE__ */ import_react.default.createElement(AwaitingObject, {
|
|
2436
|
-
id: state.values.awaiting
|
|
2437
|
-
}) : null,
|
|
2438
|
-
metadata: {
|
|
2439
|
-
records: {
|
|
2440
|
-
[import_chunk_YF2AQ7KP.CollectionType.typename]: {
|
|
2441
|
-
createObject: (props) => (0, import_app_framework.createIntent)(import_chunk_YF2AQ7KP.CollectionAction.Create, props),
|
|
2442
|
-
placeholder: [
|
|
2443
|
-
"unnamed collection label",
|
|
2444
|
-
{
|
|
2445
|
-
ns: import_chunk_46S3JOES.SPACE_PLUGIN
|
|
2446
|
-
}
|
|
2447
|
-
],
|
|
2448
|
-
icon: "ph--cards-three--regular",
|
|
2449
|
-
// TODO(wittjosiah): Move out of metadata.
|
|
2450
|
-
loadReferences: async (collection) => await import_live_object.RefArray.loadAll([
|
|
2451
|
-
...collection.objects,
|
|
2452
|
-
...Object.values(collection.views)
|
|
2453
|
-
])
|
|
2454
|
-
}
|
|
2455
|
-
}
|
|
2456
|
-
},
|
|
2457
|
-
echo: {
|
|
2458
|
-
schema: [
|
|
2459
|
-
import_chunk_YF2AQ7KP.CollectionType
|
|
2460
|
-
]
|
|
2461
|
-
},
|
|
2462
|
-
surface: {
|
|
2463
|
-
definitions: ({ plugins }) => {
|
|
2464
|
-
const resolve = (0, import_app_framework.resolvePlugin)(plugins, import_app_framework.parseMetadataResolverPlugin)?.provides.metadata.resolver;
|
|
2465
|
-
const attention = (0, import_app_framework.resolvePlugin)(plugins, import_plugin_attention.parseAttentionPlugin)?.provides.attention;
|
|
2466
|
-
(0, import_invariant.invariant)(resolve, "Metadata plugin not found.", {
|
|
2467
|
-
F: __dxlog_file6,
|
|
2468
|
-
L: 503,
|
|
2469
|
-
S: void 0,
|
|
2470
|
-
A: [
|
|
2471
|
-
"resolve",
|
|
2472
|
-
"'Metadata plugin not found.'"
|
|
2473
|
-
]
|
|
2474
|
-
});
|
|
2475
|
-
(0, import_invariant.invariant)(attention, "Attention plugin not found.", {
|
|
2476
|
-
F: __dxlog_file6,
|
|
2477
|
-
L: 504,
|
|
2478
|
-
S: void 0,
|
|
2479
|
-
A: [
|
|
2480
|
-
"attention",
|
|
2481
|
-
"'Attention plugin not found.'"
|
|
2482
|
-
]
|
|
2483
|
-
});
|
|
2484
|
-
return [
|
|
2485
|
-
(0, import_app_framework.createSurface)({
|
|
2486
|
-
id: `${import_chunk_46S3JOES.SPACE_PLUGIN}/article`,
|
|
2487
|
-
role: "article",
|
|
2488
|
-
filter: (data) => (
|
|
2489
|
-
// TODO(wittjosiah): Need to avoid shotgun parsing space state everywhere.
|
|
2490
|
-
(0, import_echo.isSpace)(data.subject) && data.subject.state.get() === import_echo.SpaceState.SPACE_READY
|
|
2491
|
-
),
|
|
2492
|
-
component: ({ data, role, ...rest }) => /* @__PURE__ */ import_react.default.createElement(import_app_framework.Surface, {
|
|
2493
|
-
data: {
|
|
2494
|
-
id: data.subject.id,
|
|
2495
|
-
subject: data.subject.properties[import_chunk_YF2AQ7KP.CollectionType.typename]?.target
|
|
2496
|
-
},
|
|
2497
|
-
role,
|
|
2498
|
-
...rest
|
|
2499
|
-
})
|
|
2500
|
-
}),
|
|
2501
|
-
(0, import_app_framework.createSurface)({
|
|
2502
|
-
id: `${import_chunk_46S3JOES.SPACE_PLUGIN}/collection-fallback`,
|
|
2503
|
-
role: "article",
|
|
2504
|
-
disposition: "fallback",
|
|
2505
|
-
filter: (data) => data.subject instanceof import_chunk_YF2AQ7KP.CollectionType,
|
|
2506
|
-
component: ({ data }) => /* @__PURE__ */ import_react.default.createElement(CollectionMain, {
|
|
2507
|
-
collection: data.subject
|
|
2508
|
-
})
|
|
2509
|
-
}),
|
|
2510
|
-
(0, import_app_framework.createSurface)({
|
|
2511
|
-
id: `${import_chunk_46S3JOES.SPACE_PLUGIN}/settings-panel`,
|
|
2512
|
-
// TODO(burdon): Add role name syntax to minimal plugin docs.
|
|
2513
|
-
role: "complementary--settings",
|
|
2514
|
-
filter: (data) => (0, import_echo.isSpace)(data.subject),
|
|
2515
|
-
component: ({ data }) => /* @__PURE__ */ import_react.default.createElement(SpaceSettingsPanel, {
|
|
2516
|
-
space: data.subject
|
|
2517
|
-
})
|
|
2518
|
-
}),
|
|
2519
|
-
(0, import_app_framework.createSurface)({
|
|
2520
|
-
id: `${import_chunk_46S3JOES.SPACE_PLUGIN}/object-settings-panel-fallback`,
|
|
2521
|
-
role: "complementary--settings",
|
|
2522
|
-
disposition: "fallback",
|
|
2523
|
-
filter: (data) => (0, import_echo.isEchoObject)(data.subject),
|
|
2524
|
-
component: ({ data }) => /* @__PURE__ */ import_react.default.createElement(DefaultObjectSettings, {
|
|
2525
|
-
object: data.subject
|
|
2526
|
-
})
|
|
2527
|
-
}),
|
|
2528
|
-
(0, import_app_framework.createSurface)({
|
|
2529
|
-
id: SPACE_SETTINGS_DIALOG,
|
|
2530
|
-
role: "dialog",
|
|
2531
|
-
filter: (data) => data.component === SPACE_SETTINGS_DIALOG,
|
|
2532
|
-
component: ({ data }) => /* @__PURE__ */ import_react.default.createElement(SpaceSettingsDialog, {
|
|
2533
|
-
...data.subject,
|
|
2534
|
-
createInvitationUrl: createSpaceInvitationUrl
|
|
2535
|
-
})
|
|
2536
|
-
}),
|
|
2537
|
-
(0, import_app_framework.createSurface)({
|
|
2538
|
-
id: JOIN_DIALOG,
|
|
2539
|
-
role: "dialog",
|
|
2540
|
-
filter: (data) => data.component === JOIN_DIALOG,
|
|
2541
|
-
component: ({ data }) => /* @__PURE__ */ import_react.default.createElement(JoinDialog, data.subject)
|
|
2542
|
-
}),
|
|
2543
|
-
(0, import_app_framework.createSurface)({
|
|
2544
|
-
id: CREATE_SPACE_DIALOG,
|
|
2545
|
-
role: "dialog",
|
|
2546
|
-
filter: (data) => data.component === CREATE_SPACE_DIALOG,
|
|
2547
|
-
component: () => /* @__PURE__ */ import_react.default.createElement(CreateSpaceDialog, null)
|
|
2548
|
-
}),
|
|
2549
|
-
(0, import_app_framework.createSurface)({
|
|
2550
|
-
id: CREATE_OBJECT_DIALOG,
|
|
2551
|
-
role: "dialog",
|
|
2552
|
-
filter: (data) => data.component === CREATE_OBJECT_DIALOG,
|
|
2553
|
-
component: ({ data }) => /* @__PURE__ */ import_react.default.createElement(CreateObjectDialog, {
|
|
2554
|
-
schemas,
|
|
2555
|
-
resolve,
|
|
2556
|
-
...data.subject
|
|
2557
|
-
})
|
|
2558
|
-
}),
|
|
2559
|
-
(0, import_app_framework.createSurface)({
|
|
2560
|
-
id: POPOVER_RENAME_SPACE,
|
|
2561
|
-
role: "popover",
|
|
2562
|
-
filter: (data) => data.component === POPOVER_RENAME_SPACE && (0, import_echo.isSpace)(data.subject),
|
|
2563
|
-
component: ({ data }) => /* @__PURE__ */ import_react.default.createElement(PopoverRenameSpace, {
|
|
2564
|
-
space: data.subject
|
|
2565
|
-
})
|
|
2566
|
-
}),
|
|
2567
|
-
(0, import_app_framework.createSurface)({
|
|
2568
|
-
id: POPOVER_RENAME_OBJECT,
|
|
2569
|
-
role: "popover",
|
|
2570
|
-
filter: (data) => data.component === POPOVER_RENAME_OBJECT && (0, import_live_object.isReactiveObject)(data.subject),
|
|
2571
|
-
component: ({ data }) => /* @__PURE__ */ import_react.default.createElement(PopoverRenameObject, {
|
|
2572
|
-
object: data.subject
|
|
2573
|
-
})
|
|
2574
|
-
}),
|
|
2575
|
-
(0, import_app_framework.createSurface)({
|
|
2576
|
-
id: `${import_chunk_46S3JOES.SPACE_PLUGIN}/navtree-presence`,
|
|
2577
|
-
role: "navtree-item-end",
|
|
2578
|
-
filter: (data) => typeof data.id === "string" && (0, import_echo.isEchoObject)(data.subject),
|
|
2579
|
-
component: ({ data }) => /* @__PURE__ */ import_react.default.createElement(SmallPresenceLive, {
|
|
2580
|
-
id: data.id,
|
|
2581
|
-
open: data.open,
|
|
2582
|
-
viewers: state.values.viewersByObject[data.id]
|
|
2583
|
-
})
|
|
2584
|
-
}),
|
|
2585
|
-
(0, import_app_framework.createSurface)({
|
|
2586
|
-
// TODO(wittjosiah): Attention glyph for non-echo items should be handled elsewhere.
|
|
2587
|
-
id: `${import_chunk_46S3JOES.SPACE_PLUGIN}/navtree-presence-fallback`,
|
|
2588
|
-
role: "navtree-item-end",
|
|
2589
|
-
disposition: "fallback",
|
|
2590
|
-
filter: (data) => typeof data.id === "string",
|
|
2591
|
-
component: ({ data }) => /* @__PURE__ */ import_react.default.createElement(SmallPresenceLive, {
|
|
2592
|
-
id: data.id,
|
|
2593
|
-
open: data.open
|
|
2594
|
-
})
|
|
2595
|
-
}),
|
|
2596
|
-
(0, import_app_framework.createSurface)({
|
|
2597
|
-
id: `${import_chunk_46S3JOES.SPACE_PLUGIN}/navtree-sync-status`,
|
|
2598
|
-
role: "navtree-item-end",
|
|
2599
|
-
filter: (data) => (0, import_echo.isSpace)(data.subject),
|
|
2600
|
-
component: ({ data }) => /* @__PURE__ */ import_react.default.createElement(InlineSyncStatus, {
|
|
2601
|
-
space: data.subject,
|
|
2602
|
-
open: data.open
|
|
2603
|
-
})
|
|
2604
|
-
}),
|
|
2605
|
-
(0, import_app_framework.createSurface)({
|
|
2606
|
-
id: `${import_chunk_46S3JOES.SPACE_PLUGIN}/navbar-presence`,
|
|
2607
|
-
role: "navbar-end",
|
|
2608
|
-
disposition: "hoist",
|
|
2609
|
-
filter: (data) => (0, import_echo.isSpace)(data.subject) || (0, import_echo.isEchoObject)(data.subject),
|
|
2610
|
-
component: ({ data }) => {
|
|
2611
|
-
const space = (0, import_echo.isSpace)(data.subject) ? data.subject : (0, import_echo.getSpace)(data.subject);
|
|
2612
|
-
const object = (0, import_echo.isSpace)(data.subject) ? data.subject.state.get() === import_echo.SpaceState.SPACE_READY ? space?.properties[import_chunk_YF2AQ7KP.CollectionType.typename]?.target : void 0 : data.subject;
|
|
2613
|
-
return space && object ? /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(SpacePresence, {
|
|
2614
|
-
object
|
|
2615
|
-
}), space.properties[COMPOSER_SPACE_LOCK] ? null : /* @__PURE__ */ import_react.default.createElement(ShareSpaceButton, {
|
|
2616
|
-
space
|
|
2617
|
-
})) : null;
|
|
2618
|
-
}
|
|
2619
|
-
}),
|
|
2620
|
-
(0, import_app_framework.createSurface)({
|
|
2621
|
-
id: `${import_chunk_46S3JOES.SPACE_PLUGIN}/collection-section`,
|
|
2622
|
-
role: "section",
|
|
2623
|
-
filter: (data) => data.subject instanceof import_chunk_YF2AQ7KP.CollectionType,
|
|
2624
|
-
component: ({ data }) => /* @__PURE__ */ import_react.default.createElement(CollectionSection, {
|
|
2625
|
-
collection: data.subject
|
|
2626
|
-
})
|
|
2627
|
-
}),
|
|
2628
|
-
(0, import_app_framework.createSurface)({
|
|
2629
|
-
id: `${import_chunk_46S3JOES.SPACE_PLUGIN}/settings`,
|
|
2630
|
-
role: "settings",
|
|
2631
|
-
filter: (data) => data.subject === import_chunk_46S3JOES.SPACE_PLUGIN,
|
|
2632
|
-
component: () => /* @__PURE__ */ import_react.default.createElement(SpacePluginSettings, {
|
|
2633
|
-
settings: settings.values
|
|
2634
|
-
})
|
|
2635
|
-
}),
|
|
2636
|
-
(0, import_app_framework.createSurface)({
|
|
2637
|
-
id: `${import_chunk_46S3JOES.SPACE_PLUGIN}/menu-footer`,
|
|
2638
|
-
role: "menu-footer",
|
|
2639
|
-
filter: (data) => (0, import_echo.isEchoObject)(data.subject),
|
|
2640
|
-
component: ({ data }) => /* @__PURE__ */ import_react.default.createElement(MenuFooter, {
|
|
2641
|
-
object: data.subject
|
|
2642
|
-
})
|
|
2643
|
-
}),
|
|
2644
|
-
(0, import_app_framework.createSurface)({
|
|
2645
|
-
id: `${import_chunk_46S3JOES.SPACE_PLUGIN}/status`,
|
|
2646
|
-
role: "status",
|
|
2647
|
-
component: () => /* @__PURE__ */ import_react.default.createElement(SyncStatus, null)
|
|
2648
|
-
})
|
|
2649
|
-
];
|
|
2650
|
-
}
|
|
2651
|
-
},
|
|
2652
|
-
graph: {
|
|
2653
|
-
builder: (plugins) => {
|
|
2654
|
-
const clientPlugin2 = (0, import_app_framework.resolvePlugin)(plugins, import_types.parseClientPlugin);
|
|
2655
|
-
const metadataPlugin = (0, import_app_framework.resolvePlugin)(plugins, import_app_framework.parseMetadataResolverPlugin);
|
|
2656
|
-
const graphPlugin2 = (0, import_app_framework.resolvePlugin)(plugins, import_app_framework.parseGraphPlugin);
|
|
2657
|
-
const client = clientPlugin2?.provides.client;
|
|
2658
|
-
const dispatch = intentPlugin?.provides.intent.dispatchPromise;
|
|
2659
|
-
const resolve = metadataPlugin?.provides.metadata.resolver;
|
|
2660
|
-
const graph = graphPlugin2?.provides.graph;
|
|
2661
|
-
if (!client || !dispatch || !resolve || !graph) {
|
|
2662
|
-
return [];
|
|
2663
|
-
}
|
|
2664
|
-
const spacesNode = {
|
|
2665
|
-
id: SPACES,
|
|
2666
|
-
type: SPACES,
|
|
2667
|
-
cacheable: [
|
|
2668
|
-
"label",
|
|
2669
|
-
"role"
|
|
2670
|
-
],
|
|
2671
|
-
properties: {
|
|
2672
|
-
label: [
|
|
2673
|
-
"spaces label",
|
|
2674
|
-
{
|
|
2675
|
-
ns: import_chunk_46S3JOES.SPACE_PLUGIN
|
|
2676
|
-
}
|
|
2677
|
-
],
|
|
2678
|
-
testId: "spacePlugin.spaces",
|
|
2679
|
-
role: "branch",
|
|
2680
|
-
disabled: true,
|
|
2681
|
-
childrenPersistenceClass: "echo",
|
|
2682
|
-
onRearrangeChildren: async (nextOrder) => {
|
|
2683
|
-
graph._sortEdges(SPACES, "outbound", nextOrder.map(({ id }) => id));
|
|
2684
|
-
const { objects: [spacesOrder] } = await client.spaces.default.db.query(import_echo.Filter.schema(import_echo.Expando, {
|
|
2685
|
-
key: SHARED
|
|
2686
|
-
})).run();
|
|
2687
|
-
if (spacesOrder) {
|
|
2688
|
-
spacesOrder.order = nextOrder.map(({ id }) => id);
|
|
2689
|
-
} else {
|
|
2690
|
-
import_log.log.warn("spaces order object not found", void 0, {
|
|
2691
|
-
F: __dxlog_file6,
|
|
2692
|
-
L: 694,
|
|
2693
|
-
S: void 0,
|
|
2694
|
-
C: (f, a) => f(...a)
|
|
2695
|
-
});
|
|
2696
|
-
}
|
|
2697
|
-
}
|
|
2698
|
-
}
|
|
2699
|
-
};
|
|
2700
|
-
return [
|
|
2701
|
-
// Primary actions.
|
|
2702
|
-
(0, import_plugin_graph.createExtension)({
|
|
2703
|
-
id: `${import_chunk_46S3JOES.SPACE_PLUGIN}/primary-actions`,
|
|
2704
|
-
filter: (node) => node.id === "root",
|
|
2705
|
-
actions: () => [
|
|
2706
|
-
{
|
|
2707
|
-
id: import_chunk_YF2AQ7KP.SpaceAction.OpenCreateSpace._tag,
|
|
2708
|
-
data: async () => {
|
|
2709
|
-
await dispatch((0, import_app_framework.createIntent)(import_chunk_YF2AQ7KP.SpaceAction.OpenCreateSpace));
|
|
2710
|
-
},
|
|
2711
|
-
properties: {
|
|
2712
|
-
label: [
|
|
2713
|
-
"create space label",
|
|
2714
|
-
{
|
|
2715
|
-
ns: import_chunk_46S3JOES.SPACE_PLUGIN
|
|
2716
|
-
}
|
|
2717
|
-
],
|
|
2718
|
-
icon: "ph--plus--regular",
|
|
2719
|
-
testId: "spacePlugin.createSpace",
|
|
2720
|
-
disposition: "item"
|
|
2721
|
-
}
|
|
2722
|
-
},
|
|
2723
|
-
{
|
|
2724
|
-
id: import_chunk_YF2AQ7KP.SpaceAction.Join._tag,
|
|
2725
|
-
data: async () => {
|
|
2726
|
-
await dispatch((0, import_app_framework.createIntent)(import_chunk_YF2AQ7KP.SpaceAction.Join));
|
|
2727
|
-
},
|
|
2728
|
-
properties: {
|
|
2729
|
-
label: [
|
|
2730
|
-
"join space label",
|
|
2731
|
-
{
|
|
2732
|
-
ns: import_chunk_46S3JOES.SPACE_PLUGIN
|
|
2733
|
-
}
|
|
2734
|
-
],
|
|
2735
|
-
icon: "ph--sign-in--regular",
|
|
2736
|
-
testId: "spacePlugin.joinSpace",
|
|
2737
|
-
disposition: "item",
|
|
2738
|
-
className: "border-b border-separator"
|
|
2739
|
-
}
|
|
2740
|
-
}
|
|
2741
|
-
]
|
|
2742
|
-
}),
|
|
2743
|
-
// Create spaces group node.
|
|
2744
|
-
(0, import_plugin_graph.createExtension)({
|
|
2745
|
-
id: `${import_chunk_46S3JOES.SPACE_PLUGIN}/root`,
|
|
2746
|
-
filter: (node) => node.id === "root",
|
|
2747
|
-
connector: () => [
|
|
2748
|
-
spacesNode
|
|
2749
|
-
],
|
|
2750
|
-
resolver: ({ id }) => id === SPACES ? spacesNode : void 0
|
|
2751
|
-
}),
|
|
2752
|
-
// Create space nodes.
|
|
2753
|
-
(0, import_plugin_graph.createExtension)({
|
|
2754
|
-
id: SPACES,
|
|
2755
|
-
filter: (node) => node.id === SPACES,
|
|
2756
|
-
connector: () => {
|
|
2757
|
-
const spaces = (0, import_plugin_graph.toSignal)((onChange) => client.spaces.subscribe(() => onChange()).unsubscribe, () => client.spaces.get());
|
|
2758
|
-
const isReady = (0, import_plugin_graph.toSignal)((onChange) => client.spaces.isReady.subscribe(() => onChange()).unsubscribe, () => client.spaces.isReady.get());
|
|
2759
|
-
if (!spaces || !isReady) {
|
|
2760
|
-
return;
|
|
2761
|
-
}
|
|
2762
|
-
try {
|
|
2763
|
-
const [spacesOrder] = memoizeQuery(client.spaces.default, import_echo.Filter.schema(import_echo.Expando, {
|
|
2764
|
-
key: SHARED
|
|
2765
|
-
}));
|
|
2766
|
-
const order = spacesOrder?.order ?? [];
|
|
2767
|
-
const orderMap = new Map(order.map((id, index) => [
|
|
2768
|
-
id,
|
|
2769
|
-
index
|
|
2770
|
-
]));
|
|
2771
|
-
return [
|
|
2772
|
-
...spaces.filter((space) => orderMap.has(space.id)).sort((a, b) => orderMap.get(a.id) - orderMap.get(b.id)),
|
|
2773
|
-
...spaces.filter((space) => !orderMap.has(space.id))
|
|
2774
|
-
].filter((space) => settings.values.showHidden ? true : space.state.get() !== import_echo.SpaceState.SPACE_INACTIVE).map((space) => constructSpaceNode({
|
|
2775
|
-
space,
|
|
2776
|
-
navigable: state.values.navigableCollections,
|
|
2777
|
-
personal: space === client.spaces.default,
|
|
2778
|
-
namesCache: state.values.spaceNames,
|
|
2779
|
-
resolve
|
|
2780
|
-
}));
|
|
2781
|
-
} catch {
|
|
2782
|
-
}
|
|
2783
|
-
},
|
|
2784
|
-
resolver: ({ id }) => {
|
|
2785
|
-
if (id.length !== import_echo.SPACE_ID_LENGTH) {
|
|
2786
|
-
return;
|
|
2787
|
-
}
|
|
2788
|
-
const spaces = (0, import_plugin_graph.toSignal)((onChange) => client.spaces.subscribe(() => onChange()).unsubscribe, () => client.spaces.get());
|
|
2789
|
-
const isReady = (0, import_plugin_graph.toSignal)((onChange) => client.spaces.isReady.subscribe(() => onChange()).unsubscribe, () => client.spaces.isReady.get());
|
|
2790
|
-
if (!spaces || !isReady) {
|
|
2791
|
-
return;
|
|
2792
|
-
}
|
|
2793
|
-
const space = spaces.find((space2) => space2.id === id);
|
|
2794
|
-
if (!space) {
|
|
2795
|
-
return;
|
|
2796
|
-
}
|
|
2797
|
-
if (space.state.get() === import_echo.SpaceState.SPACE_INACTIVE) {
|
|
2798
|
-
return false;
|
|
2799
|
-
} else {
|
|
2800
|
-
return constructSpaceNode({
|
|
2801
|
-
space,
|
|
2802
|
-
navigable: state.values.navigableCollections,
|
|
2803
|
-
personal: space === client.spaces.default,
|
|
2804
|
-
namesCache: state.values.spaceNames,
|
|
2805
|
-
resolve
|
|
2806
|
-
});
|
|
2807
|
-
}
|
|
2808
|
-
}
|
|
2809
|
-
}),
|
|
2810
|
-
// Create space actions.
|
|
2811
|
-
(0, import_plugin_graph.createExtension)({
|
|
2812
|
-
id: `${import_chunk_46S3JOES.SPACE_PLUGIN}/actions`,
|
|
2813
|
-
filter: (node) => (0, import_echo.isSpace)(node.data),
|
|
2814
|
-
actions: ({ node }) => {
|
|
2815
|
-
const space = node.data;
|
|
2816
|
-
return constructSpaceActions({
|
|
2817
|
-
space,
|
|
2818
|
-
dispatch,
|
|
2819
|
-
personal: space === client.spaces.default,
|
|
2820
|
-
migrating: state.values.sdkMigrationRunning[space.id]
|
|
2821
|
-
});
|
|
2822
|
-
}
|
|
2823
|
-
}),
|
|
2824
|
-
// Create nodes for objects in the root collection of a space.
|
|
2825
|
-
(0, import_plugin_graph.createExtension)({
|
|
2826
|
-
id: `${import_chunk_46S3JOES.SPACE_PLUGIN}/root-collection`,
|
|
2827
|
-
filter: (node) => (0, import_echo.isSpace)(node.data),
|
|
2828
|
-
connector: ({ node }) => {
|
|
2829
|
-
const space = node.data;
|
|
2830
|
-
const spaceState = (0, import_plugin_graph.toSignal)((onChange) => space.state.subscribe(() => onChange()).unsubscribe, () => space.state.get(), space.id);
|
|
2831
|
-
if (spaceState !== import_echo.SpaceState.SPACE_READY) {
|
|
2832
|
-
return;
|
|
2833
|
-
}
|
|
2834
|
-
const collection = space.properties[import_chunk_YF2AQ7KP.CollectionType.typename]?.target;
|
|
2835
|
-
if (!collection) {
|
|
2836
|
-
return;
|
|
2837
|
-
}
|
|
2838
|
-
return collection.objects.map((object) => object.target).filter(import_util.nonNullable).map((object) => createObjectNode({
|
|
2839
|
-
object,
|
|
2840
|
-
space,
|
|
2841
|
-
resolve,
|
|
2842
|
-
navigable: state.values.navigableCollections
|
|
2843
|
-
})).filter(import_util.nonNullable);
|
|
2844
|
-
}
|
|
2845
|
-
}),
|
|
2846
|
-
// Create nodes for objects in a collection or by its fully qualified id.
|
|
2847
|
-
(0, import_plugin_graph.createExtension)({
|
|
2848
|
-
id: `${import_chunk_46S3JOES.SPACE_PLUGIN}/objects`,
|
|
2849
|
-
filter: (node) => node.data instanceof import_chunk_YF2AQ7KP.CollectionType,
|
|
2850
|
-
connector: ({ node }) => {
|
|
2851
|
-
const collection = node.data;
|
|
2852
|
-
const space = (0, import_echo.getSpace)(collection);
|
|
2853
|
-
if (!space) {
|
|
2854
|
-
return;
|
|
2855
|
-
}
|
|
2856
|
-
return collection.objects.map((object) => object.target).filter(import_util.nonNullable).map((object) => createObjectNode({
|
|
2857
|
-
object,
|
|
2858
|
-
space,
|
|
2859
|
-
resolve,
|
|
2860
|
-
navigable: state.values.navigableCollections
|
|
2861
|
-
})).filter(import_util.nonNullable);
|
|
2862
|
-
},
|
|
2863
|
-
resolver: ({ id }) => {
|
|
2864
|
-
if (id.length !== import_echo.FQ_ID_LENGTH) {
|
|
2865
|
-
return;
|
|
2866
|
-
}
|
|
2867
|
-
const [spaceId, objectId] = id.split(":");
|
|
2868
|
-
if (spaceId.length !== import_echo.SPACE_ID_LENGTH && objectId.length !== import_echo.OBJECT_ID_LENGTH) {
|
|
2869
|
-
return;
|
|
2870
|
-
}
|
|
2871
|
-
const space = client.spaces.get().find((space2) => space2.id === spaceId);
|
|
2872
|
-
if (!space) {
|
|
2873
|
-
return;
|
|
2874
|
-
}
|
|
2875
|
-
const spaceState = (0, import_plugin_graph.toSignal)((onChange) => space.state.subscribe(() => onChange()).unsubscribe, () => space.state.get(), space.id);
|
|
2876
|
-
if (spaceState !== import_echo.SpaceState.SPACE_READY) {
|
|
2877
|
-
return;
|
|
2878
|
-
}
|
|
2879
|
-
const store = (0, import_plugin_graph.memoize)(() => (0, import_signals_core.signal)(space.db.getObjectById(objectId)), id);
|
|
2880
|
-
(0, import_plugin_graph.memoize)(() => {
|
|
2881
|
-
if (!store.value) {
|
|
2882
|
-
void space.db.query({
|
|
2883
|
-
id: objectId
|
|
2884
|
-
}, {
|
|
2885
|
-
deleted: import_echo.QueryOptions.ShowDeletedOption.SHOW_DELETED
|
|
2886
|
-
}).first().then((o) => store.value = o).catch((err) => import_log.log.catch(err, {
|
|
2887
|
-
objectId
|
|
2888
|
-
}, {
|
|
2889
|
-
F: __dxlog_file6,
|
|
2890
|
-
L: 919,
|
|
2891
|
-
S: void 0,
|
|
2892
|
-
C: (f, a) => f(...a)
|
|
2893
|
-
}));
|
|
2894
|
-
}
|
|
2895
|
-
}, id);
|
|
2896
|
-
const object = store.value;
|
|
2897
|
-
if (!object) {
|
|
2898
|
-
return;
|
|
2899
|
-
}
|
|
2900
|
-
if ((0, import_live_object.isDeleted)(object)) {
|
|
2901
|
-
return false;
|
|
2902
|
-
} else {
|
|
2903
|
-
return createObjectNode({
|
|
2904
|
-
object,
|
|
2905
|
-
space,
|
|
2906
|
-
resolve,
|
|
2907
|
-
navigable: state.values.navigableCollections
|
|
2908
|
-
});
|
|
2909
|
-
}
|
|
2910
|
-
}
|
|
2911
|
-
}),
|
|
2912
|
-
// Create collection actions and action groups.
|
|
2913
|
-
(0, import_plugin_graph.createExtension)({
|
|
2914
|
-
id: `${import_chunk_46S3JOES.SPACE_PLUGIN}/object-actions`,
|
|
2915
|
-
filter: (node) => (0, import_echo.isEchoObject)(node.data),
|
|
2916
|
-
actions: ({ node }) => constructObjectActions({
|
|
2917
|
-
node,
|
|
2918
|
-
dispatch
|
|
2919
|
-
})
|
|
2920
|
-
}),
|
|
2921
|
-
// Create nodes for object settings.
|
|
2922
|
-
(0, import_plugin_graph.createExtension)({
|
|
2923
|
-
id: `${import_chunk_46S3JOES.SPACE_PLUGIN}/settings-for-subject`,
|
|
2924
|
-
resolver: ({ id }) => {
|
|
2925
|
-
if (!id.endsWith("~settings")) {
|
|
2926
|
-
return;
|
|
2927
|
-
}
|
|
2928
|
-
const type = "orphan-settings-for-subject";
|
|
2929
|
-
const icon = "ph--gear--regular";
|
|
2930
|
-
const [subjectId] = id.split("~");
|
|
2931
|
-
const { spaceId, objectId } = (0, import_echo.parseId)(subjectId);
|
|
2932
|
-
const spaces = (0, import_plugin_graph.toSignal)((onChange) => client.spaces.subscribe(() => onChange()).unsubscribe, () => client.spaces.get());
|
|
2933
|
-
const space = spaces?.find((space2) => space2.id === spaceId && space2.state.get() === import_echo.SpaceState.SPACE_READY);
|
|
2934
|
-
if (!objectId) {
|
|
2935
|
-
const label2 = space ? space.properties.name || [
|
|
2936
|
-
"unnamed space label",
|
|
2937
|
-
{
|
|
2938
|
-
ns: import_chunk_46S3JOES.SPACE_PLUGIN
|
|
2939
|
-
}
|
|
2940
|
-
] : [
|
|
2941
|
-
"unnamed object settings label",
|
|
2942
|
-
{
|
|
2943
|
-
ns: import_chunk_46S3JOES.SPACE_PLUGIN
|
|
2944
|
-
}
|
|
2945
|
-
];
|
|
2946
|
-
return {
|
|
2947
|
-
id,
|
|
2948
|
-
type,
|
|
2949
|
-
data: null,
|
|
2950
|
-
properties: {
|
|
2951
|
-
icon,
|
|
2952
|
-
label: label2,
|
|
2953
|
-
showResolvedThreads: false,
|
|
2954
|
-
object: null,
|
|
2955
|
-
space
|
|
2956
|
-
}
|
|
2957
|
-
};
|
|
2958
|
-
}
|
|
2959
|
-
const [object] = memoizeQuery(space, {
|
|
2960
|
-
id: objectId
|
|
2961
|
-
});
|
|
2962
|
-
if (!object || !subjectId) {
|
|
2963
|
-
return;
|
|
2964
|
-
}
|
|
2965
|
-
const meta = resolve((0, import_echo.getTypename)(object) ?? "");
|
|
2966
|
-
const label = meta.label?.(object) || object.name || meta.placeholder || [
|
|
2967
|
-
"unnamed object settings label",
|
|
2968
|
-
{
|
|
2969
|
-
ns: import_chunk_46S3JOES.SPACE_PLUGIN
|
|
2970
|
-
}
|
|
2971
|
-
];
|
|
2972
|
-
return {
|
|
2973
|
-
id,
|
|
2974
|
-
type,
|
|
2975
|
-
data: null,
|
|
2976
|
-
properties: {
|
|
2977
|
-
icon,
|
|
2978
|
-
label,
|
|
2979
|
-
object
|
|
2980
|
-
}
|
|
2981
|
-
};
|
|
2982
|
-
}
|
|
2983
|
-
})
|
|
2984
|
-
];
|
|
2985
|
-
},
|
|
2986
|
-
serializer: (plugins) => {
|
|
2987
|
-
const dispatch = (0, import_app_framework.resolvePlugin)(plugins, import_app_framework.parseIntentPlugin)?.provides.intent.dispatchPromise;
|
|
2988
|
-
if (!dispatch) {
|
|
2989
|
-
return [];
|
|
2990
|
-
}
|
|
2991
|
-
return [
|
|
2992
|
-
{
|
|
2993
|
-
inputType: SPACES,
|
|
2994
|
-
outputType: DIRECTORY_TYPE,
|
|
2995
|
-
serialize: (node) => ({
|
|
2996
|
-
name: translations_default[0]["en-US"][import_chunk_46S3JOES.SPACE_PLUGIN]["spaces label"],
|
|
2997
|
-
data: translations_default[0]["en-US"][import_chunk_46S3JOES.SPACE_PLUGIN]["spaces label"],
|
|
2998
|
-
type: DIRECTORY_TYPE
|
|
2999
|
-
}),
|
|
3000
|
-
deserialize: () => {
|
|
3001
|
-
}
|
|
3002
|
-
},
|
|
3003
|
-
{
|
|
3004
|
-
inputType: SPACE_TYPE,
|
|
3005
|
-
outputType: DIRECTORY_TYPE,
|
|
3006
|
-
serialize: (node) => ({
|
|
3007
|
-
name: node.data.properties.name ?? translations_default[0]["en-US"][import_chunk_46S3JOES.SPACE_PLUGIN]["unnamed space label"],
|
|
3008
|
-
data: node.data.properties.name ?? translations_default[0]["en-US"][import_chunk_46S3JOES.SPACE_PLUGIN]["unnamed space label"],
|
|
3009
|
-
type: DIRECTORY_TYPE
|
|
3010
|
-
}),
|
|
3011
|
-
deserialize: async (data) => {
|
|
3012
|
-
const result = await dispatch((0, import_app_framework.createIntent)(import_chunk_YF2AQ7KP.SpaceAction.Create, {
|
|
3013
|
-
name: data.name,
|
|
3014
|
-
edgeReplication: true
|
|
3015
|
-
}));
|
|
3016
|
-
return result.data?.space;
|
|
3017
|
-
}
|
|
3018
|
-
},
|
|
3019
|
-
{
|
|
3020
|
-
inputType: import_chunk_YF2AQ7KP.CollectionType.typename,
|
|
3021
|
-
outputType: DIRECTORY_TYPE,
|
|
3022
|
-
serialize: (node) => ({
|
|
3023
|
-
name: node.data.name ?? translations_default[0]["en-US"][import_chunk_46S3JOES.SPACE_PLUGIN]["unnamed collection label"],
|
|
3024
|
-
data: node.data.name ?? translations_default[0]["en-US"][import_chunk_46S3JOES.SPACE_PLUGIN]["unnamed collection label"],
|
|
3025
|
-
type: DIRECTORY_TYPE
|
|
3026
|
-
}),
|
|
3027
|
-
deserialize: async (data, ancestors) => {
|
|
3028
|
-
const space = ancestors.find(import_echo.isSpace);
|
|
3029
|
-
const collection = ancestors.findLast((ancestor) => ancestor instanceof import_chunk_YF2AQ7KP.CollectionType) ?? space?.properties[import_chunk_YF2AQ7KP.CollectionType.typename]?.target;
|
|
3030
|
-
if (!space || !collection) {
|
|
3031
|
-
return;
|
|
3032
|
-
}
|
|
3033
|
-
const result = await dispatch((0, import_app_framework.createIntent)(import_chunk_YF2AQ7KP.SpaceAction.AddObject, {
|
|
3034
|
-
target: collection,
|
|
3035
|
-
object: (0, import_live_object.create)(import_chunk_YF2AQ7KP.CollectionType, {
|
|
3036
|
-
name: data.name,
|
|
3037
|
-
objects: [],
|
|
3038
|
-
views: {}
|
|
3039
|
-
})
|
|
3040
|
-
}));
|
|
3041
|
-
return result.data?.object;
|
|
3042
|
-
}
|
|
3043
|
-
}
|
|
3044
|
-
];
|
|
3045
|
-
}
|
|
3046
|
-
},
|
|
3047
|
-
intent: {
|
|
3048
|
-
resolvers: ({ plugins, dispatchPromise: dispatch }) => {
|
|
3049
|
-
const activeParts = (0, import_app_framework.resolvePlugin)(plugins, import_app_framework.parseNavigationPlugin)?.provides.location.active;
|
|
3050
|
-
const client = (0, import_app_framework.resolvePlugin)(plugins, import_types.parseClientPlugin)?.provides.client;
|
|
3051
|
-
const resolve = (0, import_app_framework.resolvePlugin)(plugins, import_app_framework.parseMetadataResolverPlugin)?.provides.metadata.resolver;
|
|
3052
|
-
(0, import_invariant.invariant)(activeParts, "Active parts not available.", {
|
|
3053
|
-
F: __dxlog_file6,
|
|
3054
|
-
L: 1078,
|
|
3055
|
-
S: void 0,
|
|
3056
|
-
A: [
|
|
3057
|
-
"activeParts",
|
|
3058
|
-
"'Active parts not available.'"
|
|
3059
|
-
]
|
|
3060
|
-
});
|
|
3061
|
-
(0, import_invariant.invariant)(client, "Client not available.", {
|
|
3062
|
-
F: __dxlog_file6,
|
|
3063
|
-
L: 1079,
|
|
3064
|
-
S: void 0,
|
|
3065
|
-
A: [
|
|
3066
|
-
"client",
|
|
3067
|
-
"'Client not available.'"
|
|
3068
|
-
]
|
|
3069
|
-
});
|
|
3070
|
-
(0, import_invariant.invariant)(resolve, "Metadata resolver not available.", {
|
|
3071
|
-
F: __dxlog_file6,
|
|
3072
|
-
L: 1080,
|
|
3073
|
-
S: void 0,
|
|
3074
|
-
A: [
|
|
3075
|
-
"resolve",
|
|
3076
|
-
"'Metadata resolver not available.'"
|
|
3077
|
-
]
|
|
3078
|
-
});
|
|
3079
|
-
return [
|
|
3080
|
-
(0, import_app_framework.createResolver)(import_chunk_YF2AQ7KP.SpaceAction.OpenCreateSpace, () => ({
|
|
3081
|
-
intents: [
|
|
3082
|
-
(0, import_app_framework.createIntent)(import_app_framework.LayoutAction.SetLayout, {
|
|
3083
|
-
element: "dialog",
|
|
3084
|
-
component: CREATE_SPACE_DIALOG,
|
|
3085
|
-
dialogBlockAlign: "start"
|
|
3086
|
-
})
|
|
3087
|
-
]
|
|
3088
|
-
})),
|
|
3089
|
-
(0, import_app_framework.createResolver)(import_chunk_YF2AQ7KP.SpaceAction.Create, async ({ name, edgeReplication }) => {
|
|
3090
|
-
const space = await client.spaces.create({
|
|
3091
|
-
name
|
|
3092
|
-
});
|
|
3093
|
-
if (edgeReplication) {
|
|
3094
|
-
await space.internal.setEdgeReplicationPreference(import_metadata.EdgeReplicationSetting.ENABLED);
|
|
3095
|
-
}
|
|
3096
|
-
await space.waitUntilReady();
|
|
3097
|
-
const collection = (0, import_live_object.create)(import_chunk_YF2AQ7KP.CollectionType, {
|
|
3098
|
-
objects: [],
|
|
3099
|
-
views: {}
|
|
3100
|
-
});
|
|
3101
|
-
space.properties[import_chunk_YF2AQ7KP.CollectionType.typename] = (0, import_live_object.makeRef)(collection);
|
|
3102
|
-
if (import_migrations.Migrations.versionProperty) {
|
|
3103
|
-
space.properties[import_migrations.Migrations.versionProperty] = import_migrations.Migrations.targetVersion;
|
|
3104
|
-
}
|
|
3105
|
-
return {
|
|
3106
|
-
data: {
|
|
3107
|
-
space,
|
|
3108
|
-
id: space.id,
|
|
3109
|
-
activeParts: {
|
|
3110
|
-
main: [
|
|
3111
|
-
space.id
|
|
3112
|
-
]
|
|
3113
|
-
}
|
|
3114
|
-
},
|
|
3115
|
-
intents: [
|
|
3116
|
-
(0, import_app_framework.createIntent)(import_types2.ObservabilityAction.SendEvent, {
|
|
3117
|
-
name: "space.create",
|
|
3118
|
-
properties: {
|
|
3119
|
-
spaceId: space.id
|
|
3120
|
-
}
|
|
3121
|
-
})
|
|
3122
|
-
]
|
|
3123
|
-
};
|
|
3124
|
-
}),
|
|
3125
|
-
(0, import_app_framework.createResolver)(import_chunk_YF2AQ7KP.SpaceAction.Join, ({ invitationCode }) => ({
|
|
3126
|
-
intents: [
|
|
3127
|
-
(0, import_app_framework.createIntent)(import_app_framework.LayoutAction.SetLayout, {
|
|
3128
|
-
element: "dialog",
|
|
3129
|
-
component: JOIN_DIALOG,
|
|
3130
|
-
dialogBlockAlign: "start",
|
|
3131
|
-
subject: {
|
|
3132
|
-
initialInvitationCode: invitationCode
|
|
3133
|
-
}
|
|
3134
|
-
})
|
|
3135
|
-
]
|
|
3136
|
-
})),
|
|
3137
|
-
(0, import_app_framework.createResolver)(import_chunk_YF2AQ7KP.SpaceAction.Share, ({ space }) => {
|
|
3138
|
-
const active = navigationPlugin?.provides.location.active;
|
|
3139
|
-
const mode = layoutPlugin?.provides.layout.layoutMode;
|
|
3140
|
-
const current = active ? (0, import_app_framework.firstIdInPart)(active, mode === "solo" ? "solo" : "main") : void 0;
|
|
3141
|
-
const target = current?.startsWith(space.id) ? current : void 0;
|
|
3142
|
-
return {
|
|
3143
|
-
intents: [
|
|
3144
|
-
(0, import_app_framework.createIntent)(import_app_framework.LayoutAction.SetLayout, {
|
|
3145
|
-
element: "dialog",
|
|
3146
|
-
component: SPACE_SETTINGS_DIALOG,
|
|
3147
|
-
dialogBlockAlign: "start",
|
|
3148
|
-
subject: {
|
|
3149
|
-
space,
|
|
3150
|
-
target,
|
|
3151
|
-
initialTab: "members",
|
|
3152
|
-
createInvitationUrl: createSpaceInvitationUrl
|
|
3153
|
-
}
|
|
3154
|
-
}),
|
|
3155
|
-
(0, import_app_framework.createIntent)(import_types2.ObservabilityAction.SendEvent, {
|
|
3156
|
-
name: "space.share",
|
|
3157
|
-
properties: {
|
|
3158
|
-
space: space.id
|
|
3159
|
-
}
|
|
3160
|
-
})
|
|
3161
|
-
]
|
|
3162
|
-
};
|
|
3163
|
-
}, {
|
|
3164
|
-
filter: (data) => !data.space.properties[COMPOSER_SPACE_LOCK]
|
|
3165
|
-
}),
|
|
3166
|
-
(0, import_app_framework.createResolver)(import_chunk_YF2AQ7KP.SpaceAction.Lock, ({ space }) => {
|
|
3167
|
-
space.properties[COMPOSER_SPACE_LOCK] = true;
|
|
3168
|
-
return {
|
|
3169
|
-
intents: [
|
|
3170
|
-
(0, import_app_framework.createIntent)(import_types2.ObservabilityAction.SendEvent, {
|
|
3171
|
-
name: "space.lock",
|
|
3172
|
-
properties: {
|
|
3173
|
-
spaceId: space.id
|
|
3174
|
-
}
|
|
3175
|
-
})
|
|
3176
|
-
]
|
|
3177
|
-
};
|
|
3178
|
-
}),
|
|
3179
|
-
(0, import_app_framework.createResolver)(import_chunk_YF2AQ7KP.SpaceAction.Unlock, ({ space }) => {
|
|
3180
|
-
space.properties[COMPOSER_SPACE_LOCK] = false;
|
|
3181
|
-
return {
|
|
3182
|
-
intents: [
|
|
3183
|
-
(0, import_app_framework.createIntent)(import_types2.ObservabilityAction.SendEvent, {
|
|
3184
|
-
name: "space.unlock",
|
|
3185
|
-
properties: {
|
|
3186
|
-
spaceId: space.id
|
|
3187
|
-
}
|
|
3188
|
-
})
|
|
3189
|
-
]
|
|
3190
|
-
};
|
|
3191
|
-
}),
|
|
3192
|
-
(0, import_app_framework.createResolver)(import_chunk_YF2AQ7KP.SpaceAction.Rename, ({ caller, space }) => {
|
|
3193
|
-
return {
|
|
3194
|
-
intents: [
|
|
3195
|
-
(0, import_app_framework.createIntent)(import_app_framework.LayoutAction.SetLayout, {
|
|
3196
|
-
element: "popover",
|
|
3197
|
-
anchorId: `dxos.org/ui/${caller}/${space.id}`,
|
|
3198
|
-
component: POPOVER_RENAME_SPACE,
|
|
3199
|
-
subject: space
|
|
3200
|
-
})
|
|
3201
|
-
]
|
|
3202
|
-
};
|
|
3203
|
-
}),
|
|
3204
|
-
(0, import_app_framework.createResolver)(import_chunk_YF2AQ7KP.SpaceAction.OpenSettings, ({ space }) => {
|
|
3205
|
-
return {
|
|
3206
|
-
intents: [
|
|
3207
|
-
(0, import_app_framework.createIntent)(import_app_framework.LayoutAction.SetLayout, {
|
|
3208
|
-
element: "dialog",
|
|
3209
|
-
component: SPACE_SETTINGS_DIALOG,
|
|
3210
|
-
dialogBlockAlign: "start",
|
|
3211
|
-
subject: {
|
|
3212
|
-
space,
|
|
3213
|
-
initialTab: "settings",
|
|
3214
|
-
createInvitationUrl: createSpaceInvitationUrl
|
|
3215
|
-
}
|
|
3216
|
-
})
|
|
3217
|
-
]
|
|
3218
|
-
};
|
|
3219
|
-
}),
|
|
3220
|
-
(0, import_app_framework.createResolver)(import_chunk_YF2AQ7KP.SpaceAction.Open, async ({ space }) => {
|
|
3221
|
-
await space.open();
|
|
3222
|
-
}),
|
|
3223
|
-
(0, import_app_framework.createResolver)(import_chunk_YF2AQ7KP.SpaceAction.Close, async ({ space }) => {
|
|
3224
|
-
await space.close();
|
|
3225
|
-
}),
|
|
3226
|
-
(0, import_app_framework.createResolver)(import_chunk_YF2AQ7KP.SpaceAction.Migrate, async ({ space, version }) => {
|
|
3227
|
-
if (space.state.get() === import_echo.SpaceState.SPACE_REQUIRES_MIGRATION) {
|
|
3228
|
-
state.values.sdkMigrationRunning[space.id] = true;
|
|
3229
|
-
await space.internal.migrate();
|
|
3230
|
-
state.values.sdkMigrationRunning[space.id] = false;
|
|
3231
|
-
}
|
|
3232
|
-
const result = await import_migrations.Migrations.migrate(space, version);
|
|
3233
|
-
return {
|
|
3234
|
-
data: result,
|
|
3235
|
-
intents: [
|
|
3236
|
-
(0, import_app_framework.createIntent)(import_types2.ObservabilityAction.SendEvent, {
|
|
3237
|
-
name: "space.migrate",
|
|
3238
|
-
properties: {
|
|
3239
|
-
spaceId: space.id,
|
|
3240
|
-
version
|
|
3241
|
-
}
|
|
3242
|
-
})
|
|
3243
|
-
]
|
|
3244
|
-
};
|
|
3245
|
-
}),
|
|
3246
|
-
(0, import_app_framework.createResolver)(import_chunk_YF2AQ7KP.SpaceAction.OpenCreateObject, ({ target, navigable = true }) => {
|
|
3247
|
-
return {
|
|
3248
|
-
intents: [
|
|
3249
|
-
(0, import_app_framework.createIntent)(import_app_framework.LayoutAction.SetLayout, {
|
|
3250
|
-
element: "dialog",
|
|
3251
|
-
component: CREATE_OBJECT_DIALOG,
|
|
3252
|
-
dialogBlockAlign: "start",
|
|
3253
|
-
subject: {
|
|
3254
|
-
target,
|
|
3255
|
-
shouldNavigate: navigable ? (object) => !(object instanceof import_chunk_YF2AQ7KP.CollectionType) || state.values.navigableCollections : () => false
|
|
3256
|
-
}
|
|
3257
|
-
})
|
|
3258
|
-
]
|
|
3259
|
-
};
|
|
3260
|
-
}),
|
|
3261
|
-
(0, import_app_framework.createResolver)(import_chunk_YF2AQ7KP.SpaceAction.AddObject, async ({ target, object }) => {
|
|
3262
|
-
const space = (0, import_echo.isSpace)(target) ? target : (0, import_echo.getSpace)(target);
|
|
3263
|
-
(0, import_invariant.invariant)(space, "Space not found.", {
|
|
3264
|
-
F: __dxlog_file6,
|
|
3265
|
-
L: 1265,
|
|
3266
|
-
S: void 0,
|
|
3267
|
-
A: [
|
|
3268
|
-
"space",
|
|
3269
|
-
"'Space not found.'"
|
|
3270
|
-
]
|
|
3271
|
-
});
|
|
3272
|
-
if (space.db.coreDatabase.getAllObjectIds().length >= SPACE_MAX_OBJECTS) {
|
|
3273
|
-
void dispatch((0, import_app_framework.createIntent)(import_app_framework.LayoutAction.SetLayout, {
|
|
3274
|
-
element: "toast",
|
|
3275
|
-
subject: {
|
|
3276
|
-
id: `${import_chunk_46S3JOES.SPACE_PLUGIN}/space-limit`,
|
|
3277
|
-
title: [
|
|
3278
|
-
"space limit label",
|
|
3279
|
-
{
|
|
3280
|
-
ns: import_chunk_46S3JOES.SPACE_PLUGIN
|
|
3281
|
-
}
|
|
3282
|
-
],
|
|
3283
|
-
description: [
|
|
3284
|
-
"space limit description",
|
|
3285
|
-
{
|
|
3286
|
-
ns: import_chunk_46S3JOES.SPACE_PLUGIN
|
|
3287
|
-
}
|
|
3288
|
-
],
|
|
3289
|
-
duration: 5e3,
|
|
3290
|
-
icon: "ph--warning--regular",
|
|
3291
|
-
actionLabel: [
|
|
3292
|
-
"remove deleted objects label",
|
|
3293
|
-
{
|
|
3294
|
-
ns: import_chunk_46S3JOES.SPACE_PLUGIN
|
|
3295
|
-
}
|
|
3296
|
-
],
|
|
3297
|
-
actionAlt: [
|
|
3298
|
-
"remove deleted objects alt",
|
|
3299
|
-
{
|
|
3300
|
-
ns: import_chunk_46S3JOES.SPACE_PLUGIN
|
|
3301
|
-
}
|
|
3302
|
-
],
|
|
3303
|
-
closeLabel: [
|
|
3304
|
-
"close label",
|
|
3305
|
-
{
|
|
3306
|
-
ns: "os"
|
|
3307
|
-
}
|
|
3308
|
-
],
|
|
3309
|
-
onAction: () => space.db.coreDatabase.unlinkDeletedObjects()
|
|
3310
|
-
}
|
|
3311
|
-
}));
|
|
3312
|
-
void dispatch((0, import_app_framework.createIntent)(import_types2.ObservabilityAction.SendEvent, {
|
|
3313
|
-
name: "space.limit",
|
|
3314
|
-
properties: {
|
|
3315
|
-
spaceId: space.id
|
|
3316
|
-
}
|
|
3317
|
-
}));
|
|
3318
|
-
throw new Error("Space limit reached.");
|
|
3319
|
-
}
|
|
3320
|
-
if (target instanceof import_chunk_YF2AQ7KP.CollectionType) {
|
|
3321
|
-
target.objects.push((0, import_live_object.makeRef)(object));
|
|
3322
|
-
} else if ((0, import_echo.isSpace)(target)) {
|
|
3323
|
-
const collection = space.properties[import_chunk_YF2AQ7KP.CollectionType.typename]?.target;
|
|
3324
|
-
if (collection instanceof import_chunk_YF2AQ7KP.CollectionType) {
|
|
3325
|
-
collection.objects.push((0, import_live_object.makeRef)(object));
|
|
3326
|
-
} else {
|
|
3327
|
-
const collection2 = (0, import_live_object.create)(import_chunk_YF2AQ7KP.CollectionType, {
|
|
3328
|
-
objects: [
|
|
3329
|
-
(0, import_live_object.makeRef)(object)
|
|
3330
|
-
],
|
|
3331
|
-
views: {}
|
|
3332
|
-
});
|
|
3333
|
-
space.properties[import_chunk_YF2AQ7KP.CollectionType.typename] = (0, import_live_object.makeRef)(collection2);
|
|
3334
|
-
}
|
|
3335
|
-
}
|
|
3336
|
-
return {
|
|
3337
|
-
data: {
|
|
3338
|
-
id: (0, import_echo.fullyQualifiedId)(object),
|
|
3339
|
-
object,
|
|
3340
|
-
activeParts: {
|
|
3341
|
-
main: [
|
|
3342
|
-
(0, import_echo.fullyQualifiedId)(object)
|
|
3343
|
-
]
|
|
3344
|
-
}
|
|
3345
|
-
},
|
|
3346
|
-
intents: [
|
|
3347
|
-
(0, import_app_framework.createIntent)(import_types2.ObservabilityAction.SendEvent, {
|
|
3348
|
-
name: "space.object.add",
|
|
3349
|
-
properties: {
|
|
3350
|
-
spaceId: space.id,
|
|
3351
|
-
objectId: object.id,
|
|
3352
|
-
typename: (0, import_echo.getTypename)(object)
|
|
3353
|
-
}
|
|
3354
|
-
})
|
|
3355
|
-
]
|
|
3356
|
-
};
|
|
3357
|
-
}),
|
|
3358
|
-
(0, import_app_framework.createResolver)(import_chunk_YF2AQ7KP.SpaceAction.RemoveObjects, async ({ objects, target, deletionData }, undo) => {
|
|
3359
|
-
const space = (0, import_echo.getSpace)(objects[0]);
|
|
3360
|
-
(0, import_invariant.invariant)(space && objects.every((obj) => (0, import_echo.isEchoObject)(obj) && (0, import_echo.getSpace)(obj) === space), void 0, {
|
|
3361
|
-
F: __dxlog_file6,
|
|
3362
|
-
L: 1330,
|
|
3363
|
-
S: void 0,
|
|
3364
|
-
A: [
|
|
3365
|
-
"space && objects.every((obj) => isEchoObject(obj) && getSpace(obj) === space)",
|
|
3366
|
-
""
|
|
3367
|
-
]
|
|
3368
|
-
});
|
|
3369
|
-
const openObjectIds = new Set((0, import_app_framework.openIds)(activeParts ?? {}));
|
|
3370
|
-
if (!undo) {
|
|
3371
|
-
const parentCollection = target ?? space.properties[import_chunk_YF2AQ7KP.CollectionType.typename]?.target;
|
|
3372
|
-
const nestedObjectsList = await Promise.all(objects.map((obj) => getNestedObjects(obj, resolve)));
|
|
3373
|
-
const deletionData2 = {
|
|
3374
|
-
objects,
|
|
3375
|
-
parentCollection,
|
|
3376
|
-
indices: objects.map((obj) => parentCollection instanceof import_chunk_YF2AQ7KP.CollectionType ? parentCollection.objects.findIndex((object) => object.target === obj) : -1),
|
|
3377
|
-
nestedObjectsList,
|
|
3378
|
-
wasActive: objects.flatMap((obj, i) => [
|
|
3379
|
-
obj,
|
|
3380
|
-
...nestedObjectsList[i]
|
|
3381
|
-
]).map((obj) => (0, import_echo.fullyQualifiedId)(obj)).filter((id) => openObjectIds.has(id))
|
|
3382
|
-
};
|
|
3383
|
-
if (deletionData2.parentCollection instanceof import_chunk_YF2AQ7KP.CollectionType) {
|
|
3384
|
-
[
|
|
3385
|
-
...deletionData2.indices
|
|
3386
|
-
].sort((a, b) => b - a).forEach((index) => {
|
|
3387
|
-
if (index !== -1) {
|
|
3388
|
-
deletionData2.parentCollection.objects.splice(index, 1);
|
|
3389
|
-
}
|
|
3390
|
-
});
|
|
3391
|
-
}
|
|
3392
|
-
deletionData2.nestedObjectsList.flat().forEach((obj) => {
|
|
3393
|
-
space.db.remove(obj);
|
|
3394
|
-
});
|
|
3395
|
-
objects.forEach((obj) => space.db.remove(obj));
|
|
3396
|
-
const undoMessageKey = objects.some((obj) => obj instanceof import_chunk_YF2AQ7KP.CollectionType) ? "collection deleted label" : objects.length > 1 ? "objects deleted label" : "object deleted label";
|
|
3397
|
-
return {
|
|
3398
|
-
undoable: {
|
|
3399
|
-
// TODO(ZaymonFC): Pluralize if more than one object.
|
|
3400
|
-
message: [
|
|
3401
|
-
undoMessageKey,
|
|
3402
|
-
{
|
|
3403
|
-
ns: import_chunk_46S3JOES.SPACE_PLUGIN
|
|
3404
|
-
}
|
|
3405
|
-
],
|
|
3406
|
-
data: {
|
|
3407
|
-
deletionData: deletionData2
|
|
3408
|
-
}
|
|
3409
|
-
},
|
|
3410
|
-
intents: deletionData2.wasActive.length > 0 ? [
|
|
3411
|
-
(0, import_app_framework.createIntent)(import_app_framework.NavigationAction.Close, {
|
|
3412
|
-
activeParts: {
|
|
3413
|
-
main: deletionData2.wasActive
|
|
3414
|
-
}
|
|
3415
|
-
})
|
|
3416
|
-
] : void 0
|
|
3417
|
-
};
|
|
3418
|
-
} else {
|
|
3419
|
-
if (deletionData?.objects?.length && deletionData.objects.every(import_echo.isEchoObject) && deletionData.parentCollection instanceof import_chunk_YF2AQ7KP.CollectionType) {
|
|
3420
|
-
const restoredObjects = deletionData.objects.map((obj) => space.db.add(obj));
|
|
3421
|
-
deletionData.nestedObjectsList.flat().forEach((obj) => {
|
|
3422
|
-
space.db.add(obj);
|
|
3423
|
-
});
|
|
3424
|
-
deletionData.indices.forEach((index, i) => {
|
|
3425
|
-
if (index !== -1) {
|
|
3426
|
-
deletionData.parentCollection.objects.splice(index, 0, (0, import_live_object.makeRef)(restoredObjects[i]));
|
|
3427
|
-
}
|
|
3428
|
-
});
|
|
3429
|
-
return {
|
|
3430
|
-
intents: deletionData.wasActive.length > 0 ? [
|
|
3431
|
-
(0, import_app_framework.createIntent)(import_app_framework.NavigationAction.Open, {
|
|
3432
|
-
activeParts: {
|
|
3433
|
-
main: deletionData.wasActive
|
|
3434
|
-
}
|
|
3435
|
-
})
|
|
3436
|
-
] : void 0
|
|
3437
|
-
};
|
|
3438
|
-
}
|
|
3439
|
-
}
|
|
3440
|
-
}),
|
|
3441
|
-
(0, import_app_framework.createResolver)(import_chunk_YF2AQ7KP.SpaceAction.RenameObject, async ({ object, caller }) => ({
|
|
3442
|
-
intents: [
|
|
3443
|
-
(0, import_app_framework.createIntent)(import_app_framework.LayoutAction.SetLayout, {
|
|
3444
|
-
element: "popover",
|
|
3445
|
-
anchorId: `dxos.org/ui/${caller}/${(0, import_echo.fullyQualifiedId)(object)}`,
|
|
3446
|
-
component: POPOVER_RENAME_OBJECT,
|
|
3447
|
-
subject: object
|
|
3448
|
-
})
|
|
3449
|
-
]
|
|
3450
|
-
})),
|
|
3451
|
-
(0, import_app_framework.createResolver)(import_chunk_YF2AQ7KP.SpaceAction.DuplicateObject, async ({ object, target }) => {
|
|
3452
|
-
const space = (0, import_echo.isSpace)(target) ? target : (0, import_echo.getSpace)(target);
|
|
3453
|
-
(0, import_invariant.invariant)(space, "Space not found.", {
|
|
3454
|
-
F: __dxlog_file6,
|
|
3455
|
-
L: 1429,
|
|
3456
|
-
S: void 0,
|
|
3457
|
-
A: [
|
|
3458
|
-
"space",
|
|
3459
|
-
"'Space not found.'"
|
|
3460
|
-
]
|
|
3461
|
-
});
|
|
3462
|
-
const newObject = await cloneObject(object, resolve, space);
|
|
3463
|
-
return {
|
|
3464
|
-
intents: [
|
|
3465
|
-
(0, import_app_framework.createIntent)(import_chunk_YF2AQ7KP.SpaceAction.AddObject, {
|
|
3466
|
-
object: newObject,
|
|
3467
|
-
target
|
|
3468
|
-
})
|
|
3469
|
-
]
|
|
3470
|
-
};
|
|
3471
|
-
}),
|
|
3472
|
-
(0, import_app_framework.createResolver)(import_chunk_YF2AQ7KP.SpaceAction.WaitForObject, async ({ id }) => {
|
|
3473
|
-
state.values.awaiting = id;
|
|
3474
|
-
}),
|
|
3475
|
-
(0, import_app_framework.createResolver)(import_chunk_YF2AQ7KP.SpaceAction.ToggleHidden, async ({ state: state2 }) => {
|
|
3476
|
-
settings.values.showHidden = state2;
|
|
3477
|
-
}),
|
|
3478
|
-
(0, import_app_framework.createResolver)(import_chunk_YF2AQ7KP.CollectionAction.Create, async ({ name }) => ({
|
|
3479
|
-
data: {
|
|
3480
|
-
object: (0, import_live_object.create)(import_chunk_YF2AQ7KP.CollectionType, {
|
|
3481
|
-
name,
|
|
3482
|
-
objects: [],
|
|
3483
|
-
views: {}
|
|
3484
|
-
})
|
|
3485
|
-
}
|
|
3486
|
-
}))
|
|
3487
|
-
];
|
|
3488
|
-
}
|
|
3489
|
-
}
|
|
3490
|
-
}
|
|
3491
|
-
};
|
|
229
|
+
activate: import_chunk_N2FS7PRA.IdentityCreated
|
|
230
|
+
}),
|
|
231
|
+
(0, import_app_framework2.defineModule)({
|
|
232
|
+
id: `${import_chunk_WZR6OAN3.meta.id}/module/spaces-ready`,
|
|
233
|
+
activatesOn: (0, import_app_framework2.allOf)(import_app_framework2.Events.DispatcherReady, import_app_framework2.Events.LayoutReady, import_app_framework2.Events.AppGraphReady, import_plugin_attention.AttentionEvents.AttentionReady, SpaceEvents.StateReady, import_plugin_client.ClientEvents.SpacesReady),
|
|
234
|
+
activate: import_chunk_N2FS7PRA.SpacesReady
|
|
235
|
+
})
|
|
236
|
+
]);
|
|
3492
237
|
};
|
|
3493
|
-
var src_default = SpacePlugin;
|
|
3494
238
|
// Annotate the CommonJS export names for ESM import in node:
|
|
3495
239
|
0 && (module.exports = {
|
|
3496
|
-
|
|
240
|
+
AdvancedObjectSettings,
|
|
3497
241
|
AwaitingObject,
|
|
242
|
+
BaseObjectSettings,
|
|
3498
243
|
COMPOSER_SPACE_LOCK,
|
|
3499
244
|
CREATE_OBJECT_DIALOG,
|
|
3500
245
|
CREATE_SPACE_DIALOG,
|
|
3501
|
-
ChannelType,
|
|
3502
|
-
CollectionAction,
|
|
3503
246
|
CollectionMain,
|
|
3504
247
|
CollectionSection,
|
|
3505
|
-
CollectionType,
|
|
3506
|
-
ContactType,
|
|
3507
248
|
CreateObjectDialog,
|
|
3508
249
|
CreateSpaceDialog,
|
|
3509
|
-
DefaultObjectSettings,
|
|
3510
250
|
FullPresence,
|
|
3511
251
|
InlineSyncStatus,
|
|
3512
252
|
JOIN_DIALOG,
|
|
3513
253
|
JoinDialog,
|
|
3514
254
|
MenuFooter,
|
|
3515
|
-
|
|
3516
|
-
MessageType,
|
|
255
|
+
POPOVER_ADD_SPACE,
|
|
3517
256
|
POPOVER_RENAME_OBJECT,
|
|
3518
257
|
POPOVER_RENAME_SPACE,
|
|
3519
258
|
PersistenceStatus,
|
|
259
|
+
PopoverAddSpace,
|
|
3520
260
|
PopoverRenameObject,
|
|
3521
261
|
PopoverRenameSpace,
|
|
3522
262
|
SHARED,
|
|
3523
263
|
SPACES,
|
|
3524
|
-
SPACE_ACTION,
|
|
3525
|
-
SPACE_DIRECTORY_HANDLE,
|
|
3526
264
|
SPACE_PLUGIN,
|
|
3527
|
-
SPACE_PLUGIN_SHORT_ID,
|
|
3528
265
|
SPACE_SETTINGS_DIALOG,
|
|
3529
266
|
SPACE_TYPE,
|
|
3530
267
|
ShareSpaceButton,
|
|
3531
268
|
ShareSpaceButtonImpl,
|
|
3532
269
|
SmallPresence,
|
|
3533
270
|
SmallPresenceLive,
|
|
3534
|
-
|
|
3535
|
-
|
|
271
|
+
SpaceCapabilities,
|
|
272
|
+
SpaceEvents,
|
|
3536
273
|
SpacePlugin,
|
|
3537
274
|
SpacePluginSettings,
|
|
3538
275
|
SpacePresence,
|
|
@@ -3541,8 +278,8 @@ var src_default = SpacePlugin;
|
|
|
3541
278
|
SyncStatus,
|
|
3542
279
|
SyncStatusDetail,
|
|
3543
280
|
SyncStatusIndicator,
|
|
3544
|
-
|
|
3545
|
-
|
|
281
|
+
ThreadCapabilities,
|
|
282
|
+
ThreadEvents,
|
|
3546
283
|
cloneObject,
|
|
3547
284
|
constructObjectActions,
|
|
3548
285
|
constructSpaceActions,
|
|
@@ -3552,8 +289,6 @@ var src_default = SpacePlugin;
|
|
|
3552
289
|
getNestedObjects,
|
|
3553
290
|
getSpaceDisplayName,
|
|
3554
291
|
memoizeQuery,
|
|
3555
|
-
|
|
3556
|
-
parseSpacePlugin,
|
|
3557
|
-
translations
|
|
292
|
+
meta
|
|
3558
293
|
});
|
|
3559
294
|
//# sourceMappingURL=index.cjs.map
|