@dxos/plugin-space 0.6.14-main.2b6a0f3 → 0.6.14-main.f49f251
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/{chunk-47SVNCZM.mjs → chunk-FOI7DAUV.mjs} +1 -1
- package/dist/lib/browser/{chunk-47SVNCZM.mjs.map → chunk-FOI7DAUV.mjs.map} +2 -2
- package/dist/lib/browser/index.mjs +208 -108
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/types/index.mjs +1 -1
- package/dist/lib/node/{chunk-CTYDNFGG.cjs → chunk-OTDRTHT4.cjs} +4 -4
- package/dist/lib/node/{chunk-CTYDNFGG.cjs.map → chunk-OTDRTHT4.cjs.map} +2 -2
- package/dist/lib/node/index.cjs +234 -135
- package/dist/lib/node/index.cjs.map +4 -4
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/types/index.cjs +11 -11
- package/dist/lib/node/types/index.cjs.map +1 -1
- package/dist/lib/node-esm/{chunk-PLPMYTLC.mjs → chunk-FYDGMPSC.mjs} +1 -1
- package/dist/lib/node-esm/{chunk-PLPMYTLC.mjs.map → chunk-FYDGMPSC.mjs.map} +2 -2
- package/dist/lib/node-esm/index.mjs +208 -108
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/types/index.mjs +1 -1
- package/dist/types/src/SpacePlugin.d.ts.map +1 -1
- package/dist/types/src/components/DefaultObjectSettings.d.ts +1 -1
- package/dist/types/src/components/DefaultObjectSettings.d.ts.map +1 -1
- package/dist/types/src/components/SpacePresence.d.ts +4 -2
- package/dist/types/src/components/SpacePresence.d.ts.map +1 -1
- package/dist/types/src/components/SpaceSettingsPanel.d.ts +7 -0
- package/dist/types/src/components/SpaceSettingsPanel.d.ts.map +1 -0
- package/dist/types/src/components/SyncStatus/SyncStatus.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +1 -0
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +2 -0
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +3 -0
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/src/util.d.ts +1 -1
- package/dist/types/src/util.d.ts.map +1 -1
- package/package.json +40 -49
- package/src/SpacePlugin.tsx +62 -32
- package/src/components/DefaultObjectSettings.tsx +3 -2
- package/src/components/SpacePresence.tsx +33 -22
- package/src/components/SpaceSettings.tsx +5 -5
- package/src/components/SpaceSettingsPanel.tsx +59 -0
- package/src/components/SyncStatus/SyncStatus.tsx +1 -1
- package/src/components/index.ts +1 -0
- package/src/translations.ts +4 -2
- package/src/types/types.ts +3 -1
- package/src/util.tsx +3 -3
package/dist/lib/node/index.cjs
CHANGED
|
@@ -28,26 +28,26 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
29
|
var node_exports = {};
|
|
30
30
|
__export(node_exports, {
|
|
31
|
-
ActorSchema: () =>
|
|
31
|
+
ActorSchema: () => import_chunk_OTDRTHT4.ActorSchema,
|
|
32
32
|
AwaitingObject: () => AwaitingObject,
|
|
33
33
|
COMPOSER_SPACE_LOCK: () => COMPOSER_SPACE_LOCK,
|
|
34
|
-
ChannelType: () =>
|
|
34
|
+
ChannelType: () => import_chunk_OTDRTHT4.ChannelType,
|
|
35
35
|
CollectionMain: () => CollectionMain,
|
|
36
36
|
CollectionSection: () => CollectionSection,
|
|
37
|
-
CollectionType: () =>
|
|
38
|
-
ContactType: () =>
|
|
37
|
+
CollectionType: () => import_chunk_OTDRTHT4.CollectionType,
|
|
38
|
+
ContactType: () => import_chunk_OTDRTHT4.ContactType,
|
|
39
39
|
DefaultObjectSettings: () => DefaultObjectSettings,
|
|
40
40
|
FullPresence: () => FullPresence,
|
|
41
41
|
MenuFooter: () => MenuFooter,
|
|
42
|
-
MessageState: () =>
|
|
43
|
-
MessageType: () =>
|
|
42
|
+
MessageState: () => import_chunk_OTDRTHT4.MessageState,
|
|
43
|
+
MessageType: () => import_chunk_OTDRTHT4.MessageType,
|
|
44
44
|
MissingObject: () => MissingObject,
|
|
45
45
|
PersistenceStatus: () => PersistenceStatus,
|
|
46
46
|
PopoverRenameObject: () => PopoverRenameObject,
|
|
47
47
|
PopoverRenameSpace: () => PopoverRenameSpace,
|
|
48
48
|
SHARED: () => SHARED,
|
|
49
49
|
SPACES: () => SPACES,
|
|
50
|
-
SPACE_DIRECTORY_HANDLE: () =>
|
|
50
|
+
SPACE_DIRECTORY_HANDLE: () => import_chunk_OTDRTHT4.SPACE_DIRECTORY_HANDLE,
|
|
51
51
|
SPACE_PLUGIN: () => import_chunk_P4XUXM7Y.SPACE_PLUGIN,
|
|
52
52
|
SPACE_PLUGIN_SHORT_ID: () => import_chunk_P4XUXM7Y.SPACE_PLUGIN_SHORT_ID,
|
|
53
53
|
SPACE_TYPE: () => SPACE_TYPE,
|
|
@@ -61,11 +61,12 @@ __export(node_exports, {
|
|
|
61
61
|
SpacePlugin: () => SpacePlugin,
|
|
62
62
|
SpacePresence: () => SpacePresence,
|
|
63
63
|
SpaceSettings: () => SpaceSettings,
|
|
64
|
+
SpaceSettingsPanel: () => SpaceSettingsPanel,
|
|
64
65
|
SyncStatus: () => SyncStatus,
|
|
65
66
|
SyncStatusDetail: () => SyncStatusDetail,
|
|
66
67
|
SyncStatusIndicator: () => SyncStatusIndicator,
|
|
67
|
-
ThreadStatus: () =>
|
|
68
|
-
ThreadType: () =>
|
|
68
|
+
ThreadStatus: () => import_chunk_OTDRTHT4.ThreadStatus,
|
|
69
|
+
ThreadType: () => import_chunk_OTDRTHT4.ThreadType,
|
|
69
70
|
cloneObject: () => cloneObject,
|
|
70
71
|
constructObjectActionGroups: () => constructObjectActionGroups,
|
|
71
72
|
constructObjectActions: () => constructObjectActions,
|
|
@@ -78,13 +79,13 @@ __export(node_exports, {
|
|
|
78
79
|
getNestedObjects: () => getNestedObjects,
|
|
79
80
|
getSpaceDisplayName: () => getSpaceDisplayName,
|
|
80
81
|
memoizeQuery: () => memoizeQuery,
|
|
81
|
-
parseSpaceInitPlugin: () =>
|
|
82
|
+
parseSpaceInitPlugin: () => import_chunk_OTDRTHT4.parseSpaceInitPlugin,
|
|
82
83
|
parseSpacePlugin: () => parseSpacePlugin,
|
|
83
84
|
translations: () => translations_default
|
|
84
85
|
});
|
|
85
86
|
module.exports = __toCommonJS(node_exports);
|
|
86
87
|
var import_chunk_P4XUXM7Y = require("./chunk-P4XUXM7Y.cjs");
|
|
87
|
-
var
|
|
88
|
+
var import_chunk_OTDRTHT4 = require("./chunk-OTDRTHT4.cjs");
|
|
88
89
|
var import_signals_core = require("@preact/signals-core");
|
|
89
90
|
var import_react = __toESM(require("react"));
|
|
90
91
|
var import_app_framework = require("@dxos/app-framework");
|
|
@@ -172,19 +173,23 @@ var import_react_ui_attention = require("@dxos/react-ui-attention");
|
|
|
172
173
|
var import_util2 = require("@dxos/util");
|
|
173
174
|
var import_react23 = __toESM(require("react"));
|
|
174
175
|
var import_app_framework9 = require("@dxos/app-framework");
|
|
175
|
-
var import_plugin_settings = require("@dxos/plugin-settings");
|
|
176
176
|
var import_react_ui15 = require("@dxos/react-ui");
|
|
177
|
+
var import_react_ui_data = require("@dxos/react-ui-data");
|
|
177
178
|
var import_react24 = __toESM(require("react"));
|
|
179
|
+
var import_log3 = require("@dxos/log");
|
|
180
|
+
var import_metadata = require("@dxos/protocols/proto/dxos/echo/metadata");
|
|
181
|
+
var import_react_ui16 = require("@dxos/react-ui");
|
|
182
|
+
var import_react25 = __toESM(require("react"));
|
|
178
183
|
var import_context = require("@dxos/context");
|
|
179
184
|
var import_plugin_status_bar = require("@dxos/plugin-status-bar");
|
|
180
185
|
var import_react_client5 = require("@dxos/react-client");
|
|
181
|
-
var import_react_ui16 = require("@dxos/react-ui");
|
|
182
|
-
var import_react25 = __toESM(require("react"));
|
|
183
|
-
var import_plugin_status_bar2 = require("@dxos/plugin-status-bar");
|
|
184
186
|
var import_react_ui17 = require("@dxos/react-ui");
|
|
187
|
+
var import_react26 = __toESM(require("react"));
|
|
188
|
+
var import_plugin_status_bar2 = require("@dxos/plugin-status-bar");
|
|
189
|
+
var import_react_ui18 = require("@dxos/react-ui");
|
|
185
190
|
var import_react_ui_syntax_highlighter = require("@dxos/react-ui-syntax-highlighter");
|
|
186
191
|
var import_react_ui_theme7 = require("@dxos/react-ui-theme");
|
|
187
|
-
var
|
|
192
|
+
var import_react27 = require("react");
|
|
188
193
|
var import_context2 = require("@dxos/context");
|
|
189
194
|
var import_protocols = require("@dxos/protocols");
|
|
190
195
|
var import_react_client6 = require("@dxos/react-client");
|
|
@@ -300,7 +305,7 @@ var DefaultObjectSettings = ({ object }) => {
|
|
|
300
305
|
className: "flex flex-col w-full p-2 gap-1"
|
|
301
306
|
}, /* @__PURE__ */ import_react7.default.createElement(import_react_ui5.Input.Root, null, /* @__PURE__ */ import_react7.default.createElement(import_react_ui5.Input.Label, null, t("name label")), /* @__PURE__ */ import_react7.default.createElement(import_react_ui5.Input.TextInput, {
|
|
302
307
|
placeholder: t("name placeholder"),
|
|
303
|
-
value: object.name,
|
|
308
|
+
value: object.name ?? "",
|
|
304
309
|
onChange: (event) => {
|
|
305
310
|
object.name = event.target.value;
|
|
306
311
|
}
|
|
@@ -360,7 +365,7 @@ var getCollectionGraphNodePartials = ({ collection, space, resolve }) => {
|
|
|
360
365
|
}
|
|
361
366
|
},
|
|
362
367
|
onCopy: async (child, index) => {
|
|
363
|
-
const newObject = await cloneObject(child.data, resolve);
|
|
368
|
+
const newObject = await cloneObject(child.data, resolve, space);
|
|
364
369
|
space.db.add(newObject);
|
|
365
370
|
if (typeof index !== "undefined") {
|
|
366
371
|
collection.objects.splice(index, 0, newObject);
|
|
@@ -375,8 +380,8 @@ var checkPendingMigration = (space) => {
|
|
|
375
380
|
};
|
|
376
381
|
var constructSpaceNode = ({ space, personal, namesCache, resolve }) => {
|
|
377
382
|
const hasPendingMigration = checkPendingMigration(space);
|
|
378
|
-
const collection = space.state.get() === import_echo4.SpaceState.SPACE_READY && space.properties[
|
|
379
|
-
const partials = space.state.get() === import_echo4.SpaceState.SPACE_READY && collection instanceof
|
|
383
|
+
const collection = space.state.get() === import_echo4.SpaceState.SPACE_READY && space.properties[import_chunk_OTDRTHT4.CollectionType.typename];
|
|
384
|
+
const partials = space.state.get() === import_echo4.SpaceState.SPACE_READY && collection instanceof import_chunk_OTDRTHT4.CollectionType ? getCollectionGraphNodePartials({
|
|
380
385
|
collection,
|
|
381
386
|
space,
|
|
382
387
|
resolve
|
|
@@ -405,7 +410,7 @@ var constructSpaceActionGroups = ({ space, dispatch }) => {
|
|
|
405
410
|
if (state !== import_echo4.SpaceState.SPACE_READY || hasPendingMigration) {
|
|
406
411
|
return [];
|
|
407
412
|
}
|
|
408
|
-
const collection = space.properties[
|
|
413
|
+
const collection = space.properties[import_chunk_OTDRTHT4.CollectionType.typename];
|
|
409
414
|
const actions = [
|
|
410
415
|
{
|
|
411
416
|
id: getId(import_chunk_P4XUXM7Y.SpaceAction.ADD_OBJECT),
|
|
@@ -435,7 +440,7 @@ var constructSpaceActionGroups = ({ space, dispatch }) => {
|
|
|
435
440
|
action: import_chunk_P4XUXM7Y.SpaceAction.ADD_OBJECT,
|
|
436
441
|
data: {
|
|
437
442
|
target: collection,
|
|
438
|
-
object: (0, import_echo_schema2.create)(
|
|
443
|
+
object: (0, import_echo_schema2.create)(import_chunk_OTDRTHT4.CollectionType, {
|
|
439
444
|
objects: [],
|
|
440
445
|
views: {}
|
|
441
446
|
})
|
|
@@ -638,7 +643,7 @@ var createObjectNode = ({ object, space, resolve }) => {
|
|
|
638
643
|
if (Object.keys(metadata).length === 0) {
|
|
639
644
|
return void 0;
|
|
640
645
|
}
|
|
641
|
-
const partials = object instanceof
|
|
646
|
+
const partials = object instanceof import_chunk_OTDRTHT4.CollectionType ? getCollectionGraphNodePartials({
|
|
642
647
|
collection: object,
|
|
643
648
|
space,
|
|
644
649
|
resolve
|
|
@@ -663,7 +668,7 @@ var createObjectNode = ({ object, space, resolve }) => {
|
|
|
663
668
|
};
|
|
664
669
|
};
|
|
665
670
|
var constructObjectActionGroups = ({ object, dispatch }) => {
|
|
666
|
-
if (!(object instanceof
|
|
671
|
+
if (!(object instanceof import_chunk_OTDRTHT4.CollectionType)) {
|
|
667
672
|
return [];
|
|
668
673
|
}
|
|
669
674
|
const collection = object;
|
|
@@ -697,7 +702,7 @@ var constructObjectActionGroups = ({ object, dispatch }) => {
|
|
|
697
702
|
action: import_chunk_P4XUXM7Y.SpaceAction.ADD_OBJECT,
|
|
698
703
|
data: {
|
|
699
704
|
target: collection,
|
|
700
|
-
object: (0, import_echo_schema2.create)(
|
|
705
|
+
object: (0, import_echo_schema2.create)(import_chunk_OTDRTHT4.CollectionType, {
|
|
701
706
|
objects: [],
|
|
702
707
|
views: {}
|
|
703
708
|
})
|
|
@@ -741,7 +746,7 @@ var constructObjectActions = ({ node, dispatch }) => {
|
|
|
741
746
|
},
|
|
742
747
|
properties: {
|
|
743
748
|
label: [
|
|
744
|
-
object instanceof
|
|
749
|
+
object instanceof import_chunk_OTDRTHT4.CollectionType ? "rename collection label" : "rename object label",
|
|
745
750
|
{
|
|
746
751
|
ns: import_chunk_P4XUXM7Y.SPACE_PLUGIN
|
|
747
752
|
}
|
|
@@ -759,7 +764,7 @@ var constructObjectActions = ({ node, dispatch }) => {
|
|
|
759
764
|
const graph = (0, import_plugin_graph2.getGraph)(node);
|
|
760
765
|
const collection = graph.nodes(node, {
|
|
761
766
|
relation: "inbound"
|
|
762
|
-
}).find(({ data }) => data instanceof
|
|
767
|
+
}).find(({ data }) => data instanceof import_chunk_OTDRTHT4.CollectionType)?.data;
|
|
763
768
|
await dispatch([
|
|
764
769
|
{
|
|
765
770
|
action: import_chunk_P4XUXM7Y.SpaceAction.REMOVE_OBJECT,
|
|
@@ -772,13 +777,13 @@ var constructObjectActions = ({ node, dispatch }) => {
|
|
|
772
777
|
},
|
|
773
778
|
properties: {
|
|
774
779
|
label: [
|
|
775
|
-
object instanceof
|
|
780
|
+
object instanceof import_chunk_OTDRTHT4.CollectionType ? "delete collection label" : "delete object label",
|
|
776
781
|
{
|
|
777
782
|
ns: import_chunk_P4XUXM7Y.SPACE_PLUGIN
|
|
778
783
|
}
|
|
779
784
|
],
|
|
780
785
|
icon: "ph--trash--regular",
|
|
781
|
-
keyBinding: object instanceof
|
|
786
|
+
keyBinding: object instanceof import_chunk_OTDRTHT4.CollectionType ? void 0 : "shift+meta+Backspace",
|
|
782
787
|
testId: "spacePlugin.deleteObject"
|
|
783
788
|
}
|
|
784
789
|
},
|
|
@@ -830,7 +835,7 @@ var getNestedObjects = async (object, resolve) => {
|
|
|
830
835
|
...nested.flat()
|
|
831
836
|
];
|
|
832
837
|
};
|
|
833
|
-
var cloneObject = async (object, resolve) => {
|
|
838
|
+
var cloneObject = async (object, resolve, newSpace) => {
|
|
834
839
|
const schema = (0, import_echo_schema2.getSchema)(object);
|
|
835
840
|
const typename = schema ? (0, import_echo_schema2.getObjectAnnotation)(schema)?.typename ?? import_echo_schema2.EXPANDO_TYPENAME : import_echo_schema2.EXPANDO_TYPENAME;
|
|
836
841
|
const metadata = resolve(typename);
|
|
@@ -849,6 +854,7 @@ var cloneObject = async (object, resolve) => {
|
|
|
849
854
|
});
|
|
850
855
|
return serializer.deserialize({
|
|
851
856
|
content,
|
|
857
|
+
space: newSpace,
|
|
852
858
|
newId: true
|
|
853
859
|
});
|
|
854
860
|
};
|
|
@@ -1281,7 +1287,6 @@ var ACTIVITY_DURATION = 3e4;
|
|
|
1281
1287
|
var noViewers = new import_util2.ComplexMap(import_react_client4.PublicKey.hash);
|
|
1282
1288
|
var getName = (identity) => identity.profile?.displayName ?? (0, import_display_name.generateName)(identity.identityKey.toHex());
|
|
1283
1289
|
var SpacePresence = ({ object, spaceKey }) => {
|
|
1284
|
-
const density = (0, import_react_ui14.useDensityContext)();
|
|
1285
1290
|
const spacePlugin = (0, import_app_framework8.usePlugin)(import_chunk_P4XUXM7Y.SPACE_PLUGIN);
|
|
1286
1291
|
const client = (0, import_react_client4.useClient)();
|
|
1287
1292
|
const identity = (0, import_halo.useIdentity)();
|
|
@@ -1311,9 +1316,7 @@ var SpacePresence = ({ object, spaceKey }) => {
|
|
|
1311
1316
|
lastSeen
|
|
1312
1317
|
};
|
|
1313
1318
|
}).toSorted((a, b) => a.lastSeen - b.lastSeen);
|
|
1314
|
-
return
|
|
1315
|
-
count: membersForObject.length
|
|
1316
|
-
}) : /* @__PURE__ */ import_react22.default.createElement(FullPresence, {
|
|
1319
|
+
return /* @__PURE__ */ import_react22.default.createElement(FullPresence, {
|
|
1317
1320
|
members: membersForObject
|
|
1318
1321
|
});
|
|
1319
1322
|
};
|
|
@@ -1382,25 +1385,42 @@ var PrensenceAvatar = ({ identity, showName, match, group, index, onClick }) =>
|
|
|
1382
1385
|
classNames: "text-sm truncate pli-2"
|
|
1383
1386
|
}, getName(identity)));
|
|
1384
1387
|
};
|
|
1385
|
-
var SmallPresenceLive = ({ viewers }) => {
|
|
1386
|
-
const
|
|
1388
|
+
var SmallPresenceLive = ({ id, viewers }) => {
|
|
1389
|
+
const getActiveViewers = (viewers2) => {
|
|
1390
|
+
const moment = Date.now();
|
|
1391
|
+
return Array.from(viewers2.values()).filter(({ lastSeen }) => moment - lastSeen < ACTIVITY_DURATION);
|
|
1392
|
+
};
|
|
1393
|
+
const [activeViewers, setActiveViewers] = (0, import_react22.useState)(viewers ? getActiveViewers(viewers) : []);
|
|
1387
1394
|
(0, import_react22.useEffect)(() => {
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1395
|
+
if (viewers) {
|
|
1396
|
+
setActiveViewers(getActiveViewers(viewers));
|
|
1397
|
+
const interval = setInterval(() => {
|
|
1398
|
+
setActiveViewers(getActiveViewers(viewers));
|
|
1399
|
+
}, REFRESH_INTERVAL);
|
|
1400
|
+
return () => clearInterval(interval);
|
|
1401
|
+
}
|
|
1402
|
+
}, [
|
|
1403
|
+
viewers
|
|
1404
|
+
]);
|
|
1392
1405
|
return /* @__PURE__ */ import_react22.default.createElement(SmallPresence, {
|
|
1406
|
+
id,
|
|
1393
1407
|
count: activeViewers.length
|
|
1394
1408
|
});
|
|
1395
1409
|
};
|
|
1396
|
-
var SmallPresence = ({ count }) => {
|
|
1410
|
+
var SmallPresence = ({ id, count }) => {
|
|
1397
1411
|
const { t } = (0, import_react_ui14.useTranslation)(import_chunk_P4XUXM7Y.SPACE_PLUGIN);
|
|
1412
|
+
const { hasAttention, isAncestor, isRelated } = (0, import_react_ui_attention.useAttention)(id);
|
|
1413
|
+
const attention = hasAttention || isAncestor || isRelated;
|
|
1398
1414
|
return /* @__PURE__ */ import_react22.default.createElement(import_react_ui14.Tooltip.Root, null, /* @__PURE__ */ import_react22.default.createElement(import_react_ui14.Tooltip.Trigger, {
|
|
1399
1415
|
asChild: true
|
|
1416
|
+
}, /* @__PURE__ */ import_react22.default.createElement("div", {
|
|
1417
|
+
role: "none",
|
|
1418
|
+
className: "flex",
|
|
1419
|
+
"data-attention": attention
|
|
1400
1420
|
}, /* @__PURE__ */ import_react22.default.createElement(import_react_ui_attention.AttentionGlyph, {
|
|
1401
1421
|
presence: count > 1 ? "many" : count === 1 ? "one" : "none",
|
|
1402
1422
|
classNames: "self-center mie-1"
|
|
1403
|
-
})), /* @__PURE__ */ import_react22.default.createElement(import_react_ui14.Tooltip.Portal, null, /* @__PURE__ */ import_react22.default.createElement(import_react_ui14.Tooltip.Content, {
|
|
1423
|
+
}))), /* @__PURE__ */ import_react22.default.createElement(import_react_ui14.Tooltip.Portal, null, /* @__PURE__ */ import_react22.default.createElement(import_react_ui14.Tooltip.Content, {
|
|
1404
1424
|
side: "bottom",
|
|
1405
1425
|
classNames: "z-[70]"
|
|
1406
1426
|
}, /* @__PURE__ */ import_react22.default.createElement("span", null, t("presence label", {
|
|
@@ -1410,8 +1430,8 @@ var SmallPresence = ({ count }) => {
|
|
|
1410
1430
|
var SpaceSettings = ({ settings }) => {
|
|
1411
1431
|
const { t } = (0, import_react_ui15.useTranslation)(import_chunk_P4XUXM7Y.SPACE_PLUGIN);
|
|
1412
1432
|
const dispatch = (0, import_app_framework9.useIntentDispatcher)();
|
|
1413
|
-
const plugins = (0, import_app_framework9.useResolvePlugins)(
|
|
1414
|
-
return /* @__PURE__ */ import_react23.default.createElement(import_react23.default.Fragment, null, /* @__PURE__ */ import_react23.default.createElement(
|
|
1433
|
+
const plugins = (0, import_app_framework9.useResolvePlugins)(import_chunk_OTDRTHT4.parseSpaceInitPlugin);
|
|
1434
|
+
return /* @__PURE__ */ import_react23.default.createElement(import_react23.default.Fragment, null, /* @__PURE__ */ import_react23.default.createElement(import_react_ui_data.FormInput, {
|
|
1415
1435
|
label: t("show hidden spaces label")
|
|
1416
1436
|
}, /* @__PURE__ */ import_react23.default.createElement(import_react_ui15.Input.Switch, {
|
|
1417
1437
|
checked: settings.showHidden,
|
|
@@ -1422,7 +1442,7 @@ var SpaceSettings = ({ settings }) => {
|
|
|
1422
1442
|
state: !!checked
|
|
1423
1443
|
}
|
|
1424
1444
|
})
|
|
1425
|
-
})), /* @__PURE__ */ import_react23.default.createElement(
|
|
1445
|
+
})), /* @__PURE__ */ import_react23.default.createElement(import_react_ui_data.FormInput, {
|
|
1426
1446
|
label: t("default on space create label")
|
|
1427
1447
|
}, /* @__PURE__ */ import_react23.default.createElement(import_react_ui15.Select.Root, {
|
|
1428
1448
|
value: settings.onSpaceCreate,
|
|
@@ -1434,19 +1454,57 @@ var SpaceSettings = ({ settings }) => {
|
|
|
1434
1454
|
value: onSpaceCreate.action
|
|
1435
1455
|
}, (0, import_react_ui15.toLocalizedString)(onSpaceCreate.label, t)))))))));
|
|
1436
1456
|
};
|
|
1437
|
-
var __dxlog_file3 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/
|
|
1438
|
-
var
|
|
1457
|
+
var __dxlog_file3 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/SpaceSettingsPanel.tsx";
|
|
1458
|
+
var SpaceSettingsPanel = ({ space }) => {
|
|
1439
1459
|
const { t } = (0, import_react_ui16.useTranslation)(import_chunk_P4XUXM7Y.SPACE_PLUGIN);
|
|
1460
|
+
const [edgeReplication, setEdgeReplication] = (0, import_react24.useState)(space.internal.data.edgeReplication === import_metadata.EdgeReplicationSetting.ENABLED);
|
|
1461
|
+
const toggleEdgeReplication = (0, import_react24.useCallback)(async (next) => {
|
|
1462
|
+
setEdgeReplication(next);
|
|
1463
|
+
await space?.internal.setEdgeReplicationPreference(next ? import_metadata.EdgeReplicationSetting.ENABLED : import_metadata.EdgeReplicationSetting.DISABLED).catch((err) => {
|
|
1464
|
+
import_log3.log.catch(err, void 0, {
|
|
1465
|
+
F: __dxlog_file3,
|
|
1466
|
+
L: 30,
|
|
1467
|
+
S: void 0,
|
|
1468
|
+
C: (f, a) => f(...a)
|
|
1469
|
+
});
|
|
1470
|
+
setEdgeReplication(!next);
|
|
1471
|
+
});
|
|
1472
|
+
}, [
|
|
1473
|
+
space
|
|
1474
|
+
]);
|
|
1475
|
+
return /* @__PURE__ */ import_react24.default.createElement("div", {
|
|
1476
|
+
role: "form",
|
|
1477
|
+
className: "flex flex-col w-full p-2 gap-4"
|
|
1478
|
+
}, /* @__PURE__ */ import_react24.default.createElement(import_react_ui16.Input.Root, null, /* @__PURE__ */ import_react24.default.createElement("div", {
|
|
1479
|
+
role: "none",
|
|
1480
|
+
className: "flex flex-col gap-1"
|
|
1481
|
+
}, /* @__PURE__ */ import_react24.default.createElement(import_react_ui16.Input.Label, null, t("name label")), /* @__PURE__ */ import_react24.default.createElement(import_react_ui16.Input.TextInput, {
|
|
1482
|
+
placeholder: t("name placeholder"),
|
|
1483
|
+
value: space.properties.name,
|
|
1484
|
+
onChange: (event) => {
|
|
1485
|
+
space.properties.name = event.target.value;
|
|
1486
|
+
}
|
|
1487
|
+
}))), /* @__PURE__ */ import_react24.default.createElement(import_react_ui16.Input.Root, null, /* @__PURE__ */ import_react24.default.createElement("div", {
|
|
1488
|
+
role: "none",
|
|
1489
|
+
className: "flex justify-between"
|
|
1490
|
+
}, /* @__PURE__ */ import_react24.default.createElement(import_react_ui16.Input.Label, null, t("edge replication label")), /* @__PURE__ */ import_react24.default.createElement(import_react_ui16.Input.Switch, {
|
|
1491
|
+
checked: edgeReplication,
|
|
1492
|
+
onCheckedChange: toggleEdgeReplication
|
|
1493
|
+
}))));
|
|
1494
|
+
};
|
|
1495
|
+
var __dxlog_file4 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/SaveStatus.tsx";
|
|
1496
|
+
var SaveStatus = () => {
|
|
1497
|
+
const { t } = (0, import_react_ui17.useTranslation)(import_chunk_P4XUXM7Y.SPACE_PLUGIN);
|
|
1440
1498
|
const client = (0, import_react_client5.useClient)();
|
|
1441
|
-
const [state, setState] = (0,
|
|
1442
|
-
(0,
|
|
1499
|
+
const [state, setState] = (0, import_react25.useState)("saved");
|
|
1500
|
+
(0, import_react25.useEffect)(() => {
|
|
1443
1501
|
return createClientSaveTracker(client, (state2) => {
|
|
1444
1502
|
setState(state2);
|
|
1445
1503
|
});
|
|
1446
1504
|
}, []);
|
|
1447
|
-
return /* @__PURE__ */
|
|
1505
|
+
return /* @__PURE__ */ import_react25.default.createElement(import_plugin_status_bar.StatusBar.Item, {
|
|
1448
1506
|
title: state === "saving" ? t("saving label") : t("saved label")
|
|
1449
|
-
}, /* @__PURE__ */
|
|
1507
|
+
}, /* @__PURE__ */ import_react25.default.createElement(import_react_ui17.Icon, {
|
|
1450
1508
|
icon: state === "saving" ? "ph--arrows-clockwise--regular" : "ph--check-circle--regular",
|
|
1451
1509
|
size: 4
|
|
1452
1510
|
}));
|
|
@@ -1478,7 +1536,7 @@ var createClientSaveTracker = (client, cb) => {
|
|
|
1478
1536
|
};
|
|
1479
1537
|
var createSpaceSaveTracker = (space, cb) => {
|
|
1480
1538
|
const ctx = new import_context.Context(void 0, {
|
|
1481
|
-
F:
|
|
1539
|
+
F: __dxlog_file4,
|
|
1482
1540
|
L: 64
|
|
1483
1541
|
});
|
|
1484
1542
|
void space.waitUntilReady().then(() => {
|
|
@@ -1509,7 +1567,7 @@ var createSpaceSaveTracker = (space, cb) => {
|
|
|
1509
1567
|
void ctx.dispose();
|
|
1510
1568
|
};
|
|
1511
1569
|
};
|
|
1512
|
-
var
|
|
1570
|
+
var __dxlog_file5 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/SyncStatus/types.ts";
|
|
1513
1571
|
var createEmptyEdgeSyncState = () => ({
|
|
1514
1572
|
missingOnLocal: 0,
|
|
1515
1573
|
missingOnRemote: 0,
|
|
@@ -1530,10 +1588,10 @@ var getSyncSummary = (syncMap) => {
|
|
|
1530
1588
|
var isEdgePeerId = (peerId, spaceId) => peerId.startsWith(`${import_protocols.EdgeService.AUTOMERGE_REPLICATOR}:${spaceId}`);
|
|
1531
1589
|
var useSyncState = () => {
|
|
1532
1590
|
const client = (0, import_react_client6.useClient)();
|
|
1533
|
-
const [spaceState, setSpaceState] = (0,
|
|
1534
|
-
(0,
|
|
1591
|
+
const [spaceState, setSpaceState] = (0, import_react27.useState)({});
|
|
1592
|
+
(0, import_react27.useEffect)(() => {
|
|
1535
1593
|
const ctx = new import_context2.Context(void 0, {
|
|
1536
|
-
F:
|
|
1594
|
+
F: __dxlog_file5,
|
|
1537
1595
|
L: 48
|
|
1538
1596
|
});
|
|
1539
1597
|
const createSubscriptions = (spaces) => {
|
|
@@ -1572,7 +1630,7 @@ var styles = {
|
|
|
1572
1630
|
};
|
|
1573
1631
|
var SyncStatus = () => {
|
|
1574
1632
|
const state = useSyncState();
|
|
1575
|
-
return /* @__PURE__ */
|
|
1633
|
+
return /* @__PURE__ */ import_react26.default.createElement(SyncStatusIndicator, {
|
|
1576
1634
|
state
|
|
1577
1635
|
});
|
|
1578
1636
|
};
|
|
@@ -1581,8 +1639,8 @@ var SyncStatusIndicator = ({ state }) => {
|
|
|
1581
1639
|
const offline = false;
|
|
1582
1640
|
const needsToUpload = summary.differentDocuments > 0 || summary.missingOnRemote > 0;
|
|
1583
1641
|
const needsToDownload = summary.differentDocuments > 0 || summary.missingOnLocal > 0;
|
|
1584
|
-
const [classNames, setClassNames] = (0,
|
|
1585
|
-
(0,
|
|
1642
|
+
const [classNames, setClassNames] = (0, import_react26.useState)();
|
|
1643
|
+
(0, import_react26.useEffect)(() => {
|
|
1586
1644
|
setClassNames(void 0);
|
|
1587
1645
|
if (!needsToUpload && !needsToDownload) {
|
|
1588
1646
|
return;
|
|
@@ -1595,37 +1653,39 @@ var SyncStatusIndicator = ({ state }) => {
|
|
|
1595
1653
|
needsToUpload,
|
|
1596
1654
|
needsToDownload
|
|
1597
1655
|
]);
|
|
1598
|
-
return /* @__PURE__ */
|
|
1656
|
+
return /* @__PURE__ */ import_react26.default.createElement(import_plugin_status_bar2.StatusBar.Item, null, /* @__PURE__ */ import_react26.default.createElement(import_react_ui18.Popover.Root, null, /* @__PURE__ */ import_react26.default.createElement(import_react_ui18.Popover.Trigger, null, /* @__PURE__ */ import_react26.default.createElement(import_react_ui18.Icon, {
|
|
1599
1657
|
icon: offline ? "ph--cloud-x--regular" : needsToUpload ? "ph--cloud-arrow-up--regular" : needsToDownload ? "ph--cloud-arrow-down--regular" : "ph--cloud-check--regular",
|
|
1600
1658
|
size: 4,
|
|
1601
1659
|
classNames
|
|
1602
|
-
})), /* @__PURE__ */
|
|
1660
|
+
})), /* @__PURE__ */ import_react26.default.createElement(import_react_ui18.Popover.Content, {
|
|
1661
|
+
sideOffset: 16
|
|
1662
|
+
}, /* @__PURE__ */ import_react26.default.createElement(SyncStatusDetail, {
|
|
1603
1663
|
state,
|
|
1604
1664
|
summary,
|
|
1605
1665
|
debug: false
|
|
1606
1666
|
}))));
|
|
1607
1667
|
};
|
|
1608
1668
|
var SyncStatusDetail = ({ classNames, state, summary, debug }) => {
|
|
1609
|
-
const { t } = (0,
|
|
1669
|
+
const { t } = (0, import_react_ui18.useTranslation)(import_chunk_P4XUXM7Y.SPACE_PLUGIN);
|
|
1610
1670
|
const entries = Object.entries(state).sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0);
|
|
1611
|
-
return /* @__PURE__ */
|
|
1671
|
+
return /* @__PURE__ */ import_react26.default.createElement("div", {
|
|
1612
1672
|
className: (0, import_react_ui_theme7.mx)("flex flex-col text-xs min-w-[16rem]", classNames)
|
|
1613
|
-
}, /* @__PURE__ */
|
|
1673
|
+
}, /* @__PURE__ */ import_react26.default.createElement("h1", {
|
|
1614
1674
|
className: "p-2"
|
|
1615
|
-
}, t("sync status title")), /* @__PURE__ */
|
|
1675
|
+
}, t("sync status title")), /* @__PURE__ */ import_react26.default.createElement("div", {
|
|
1616
1676
|
className: "flex flex-col gap-[2px] my-[2px]"
|
|
1617
|
-
}, entries.map(([spaceId, state2]) => /* @__PURE__ */
|
|
1677
|
+
}, entries.map(([spaceId, state2]) => /* @__PURE__ */ import_react26.default.createElement(SpaceRow, {
|
|
1618
1678
|
key: spaceId,
|
|
1619
1679
|
spaceId,
|
|
1620
1680
|
state: state2
|
|
1621
|
-
}))), debug && /* @__PURE__ */
|
|
1681
|
+
}))), debug && /* @__PURE__ */ import_react26.default.createElement(import_react_ui_syntax_highlighter.SyntaxHighlighter, {
|
|
1622
1682
|
language: "json"
|
|
1623
1683
|
}, JSON.stringify(summary, null, 2)));
|
|
1624
1684
|
};
|
|
1625
1685
|
var useActive = (count) => {
|
|
1626
|
-
const [current, setCurrent] = (0,
|
|
1627
|
-
const [active, setActive] = (0,
|
|
1628
|
-
(0,
|
|
1686
|
+
const [current, setCurrent] = (0, import_react26.useState)(count);
|
|
1687
|
+
const [active, setActive] = (0, import_react26.useState)(false);
|
|
1688
|
+
(0, import_react26.useEffect)(() => {
|
|
1629
1689
|
let t;
|
|
1630
1690
|
if (count !== current) {
|
|
1631
1691
|
setActive(true);
|
|
@@ -1648,17 +1708,17 @@ var useActive = (count) => {
|
|
|
1648
1708
|
var SpaceRow = ({ spaceId, state: { localDocumentCount, remoteDocumentCount, missingOnLocal, missingOnRemote } }) => {
|
|
1649
1709
|
const downActive = useActive(localDocumentCount);
|
|
1650
1710
|
const upActive = useActive(remoteDocumentCount);
|
|
1651
|
-
return /* @__PURE__ */
|
|
1711
|
+
return /* @__PURE__ */ import_react26.default.createElement("div", {
|
|
1652
1712
|
className: (0, import_react_ui_theme7.mx)("flex items-center mx-[2px] gap-[2px] cursor-pointer", styles.barHover),
|
|
1653
1713
|
title: spaceId,
|
|
1654
1714
|
onClick: () => {
|
|
1655
1715
|
void navigator.clipboard.writeText(spaceId);
|
|
1656
1716
|
}
|
|
1657
|
-
}, /* @__PURE__ */
|
|
1717
|
+
}, /* @__PURE__ */ import_react26.default.createElement(import_react_ui18.Icon, {
|
|
1658
1718
|
icon: "ph--arrow-fat-line-left--regular",
|
|
1659
1719
|
size: 3,
|
|
1660
1720
|
classNames: (0, import_react_ui_theme7.mx)(downActive && "animate-[pulse_1s_infinite]")
|
|
1661
|
-
}), /* @__PURE__ */
|
|
1721
|
+
}), /* @__PURE__ */ import_react26.default.createElement(Candle, {
|
|
1662
1722
|
up: {
|
|
1663
1723
|
count: remoteDocumentCount,
|
|
1664
1724
|
total: remoteDocumentCount + missingOnRemote
|
|
@@ -1668,37 +1728,37 @@ var SpaceRow = ({ spaceId, state: { localDocumentCount, remoteDocumentCount, mis
|
|
|
1668
1728
|
total: localDocumentCount + missingOnLocal
|
|
1669
1729
|
},
|
|
1670
1730
|
title: spaceId
|
|
1671
|
-
}), /* @__PURE__ */
|
|
1731
|
+
}), /* @__PURE__ */ import_react26.default.createElement(import_react_ui18.Icon, {
|
|
1672
1732
|
icon: "ph--arrow-fat-line-right--regular",
|
|
1673
1733
|
size: 3,
|
|
1674
1734
|
classNames: (0, import_react_ui_theme7.mx)(upActive && "animate-[pulse_1s_step-start_infinite]")
|
|
1675
1735
|
}));
|
|
1676
1736
|
};
|
|
1677
1737
|
var Candle = ({ classNames, up, down }) => {
|
|
1678
|
-
return /* @__PURE__ */
|
|
1738
|
+
return /* @__PURE__ */ import_react26.default.createElement("div", {
|
|
1679
1739
|
className: (0, import_react_ui_theme7.mx)("grid grid-cols-[1fr_2rem_1fr] w-full h-3", classNames)
|
|
1680
|
-
}, /* @__PURE__ */
|
|
1740
|
+
}, /* @__PURE__ */ import_react26.default.createElement(Bar, {
|
|
1681
1741
|
classNames: "justify-end",
|
|
1682
1742
|
...up
|
|
1683
|
-
}), /* @__PURE__ */
|
|
1743
|
+
}), /* @__PURE__ */ import_react26.default.createElement("div", {
|
|
1684
1744
|
className: "relative"
|
|
1685
|
-
}, /* @__PURE__ */
|
|
1745
|
+
}, /* @__PURE__ */ import_react26.default.createElement("div", {
|
|
1686
1746
|
className: (0, import_react_ui_theme7.mx)("absolute inset-0 flex items-center justify-center text-xs", styles.barBg)
|
|
1687
|
-
}, up.total)), /* @__PURE__ */
|
|
1747
|
+
}, up.total)), /* @__PURE__ */ import_react26.default.createElement(Bar, down));
|
|
1688
1748
|
};
|
|
1689
1749
|
var Bar = ({ classNames, count, total }) => {
|
|
1690
1750
|
let p = count / total * 100;
|
|
1691
1751
|
if (count < total) {
|
|
1692
1752
|
p = Math.min(p, 95);
|
|
1693
1753
|
}
|
|
1694
|
-
return /* @__PURE__ */
|
|
1754
|
+
return /* @__PURE__ */ import_react26.default.createElement("div", {
|
|
1695
1755
|
className: (0, import_react_ui_theme7.mx)("relative flex w-full", styles.barBg, classNames)
|
|
1696
|
-
}, /* @__PURE__ */
|
|
1756
|
+
}, /* @__PURE__ */ import_react26.default.createElement("div", {
|
|
1697
1757
|
className: (0, import_react_ui_theme7.mx)("shrink-0", styles.barFg),
|
|
1698
1758
|
style: {
|
|
1699
1759
|
width: `${p}%`
|
|
1700
1760
|
}
|
|
1701
|
-
}), count !== total && /* @__PURE__ */
|
|
1761
|
+
}), count !== total && /* @__PURE__ */ import_react26.default.createElement("div", {
|
|
1702
1762
|
className: "absolute top-0 bottom-0 flex items-center mx-0.5 text-black text-xs"
|
|
1703
1763
|
}, count));
|
|
1704
1764
|
};
|
|
@@ -1708,8 +1768,8 @@ var translations_default = [
|
|
|
1708
1768
|
[import_chunk_P4XUXM7Y.SPACE_PLUGIN]: {
|
|
1709
1769
|
"plugin name": "Spaces",
|
|
1710
1770
|
"first run message": "Nothing selected.",
|
|
1711
|
-
"create space label": "Create
|
|
1712
|
-
"join space label": "Join
|
|
1771
|
+
"create space label": "Create space",
|
|
1772
|
+
"join space label": "Join space",
|
|
1713
1773
|
"empty space message": "No documents",
|
|
1714
1774
|
"empty tree message": "No spaces",
|
|
1715
1775
|
"unnamed space label": "New space",
|
|
@@ -1786,12 +1846,14 @@ var translations_default = [
|
|
|
1786
1846
|
"dismiss label": "Dismiss",
|
|
1787
1847
|
"join success label": "Successfully joined space",
|
|
1788
1848
|
"name label": "Name",
|
|
1789
|
-
"name placeholder": "Name"
|
|
1849
|
+
"name placeholder": "Name",
|
|
1850
|
+
"unnamed object settings label": "Settings",
|
|
1851
|
+
"edge replication label": "Enable EDGE Replication"
|
|
1790
1852
|
}
|
|
1791
1853
|
}
|
|
1792
1854
|
}
|
|
1793
1855
|
];
|
|
1794
|
-
var
|
|
1856
|
+
var __dxlog_file6 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/SpacePlugin.tsx";
|
|
1795
1857
|
var ACTIVE_NODE_BROADCAST_INTERVAL = 3e4;
|
|
1796
1858
|
var OBJECT_ID_LENGTH = 60;
|
|
1797
1859
|
var SPACE_MAX_OBJECTS = 500;
|
|
@@ -1805,6 +1867,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
1805
1867
|
awaiting: void 0,
|
|
1806
1868
|
spaceNames: {},
|
|
1807
1869
|
viewersByObject: {},
|
|
1870
|
+
// TODO(wittjosiah): Stop using (Complex)Map inside reactive object.
|
|
1808
1871
|
viewersByIdentity: new import_util.ComplexMap(import_react_client.PublicKey.hash),
|
|
1809
1872
|
sdkMigrationRunning: {}
|
|
1810
1873
|
});
|
|
@@ -1881,8 +1944,8 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
1881
1944
|
import_log.log.warn("Failed to broadcast active node for presence.", {
|
|
1882
1945
|
err: err.message
|
|
1883
1946
|
}, {
|
|
1884
|
-
F:
|
|
1885
|
-
L:
|
|
1947
|
+
F: __dxlog_file6,
|
|
1948
|
+
L: 231,
|
|
1886
1949
|
S: void 0,
|
|
1887
1950
|
C: (f, a) => f(...a)
|
|
1888
1951
|
});
|
|
@@ -1932,14 +1995,12 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
1932
1995
|
ready: async (plugins) => {
|
|
1933
1996
|
settings.prop({
|
|
1934
1997
|
key: "showHidden",
|
|
1935
|
-
storageKey: "show-hidden",
|
|
1936
1998
|
type: import_local_storage.LocalStorageStore.bool({
|
|
1937
1999
|
allowUndefined: true
|
|
1938
2000
|
})
|
|
1939
2001
|
});
|
|
1940
2002
|
state.prop({
|
|
1941
2003
|
key: "spaceNames",
|
|
1942
|
-
storageKey: "space-names",
|
|
1943
2004
|
type: import_local_storage.LocalStorageStore.json()
|
|
1944
2005
|
});
|
|
1945
2006
|
navigationPlugin = (0, import_app_framework.resolvePlugin)(plugins, import_app_framework.parseNavigationPlugin);
|
|
@@ -1953,7 +2014,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
1953
2014
|
const dispatch = intentPlugin.provides.intent.dispatch;
|
|
1954
2015
|
const handleFirstRun = async () => {
|
|
1955
2016
|
const defaultSpace = client.spaces.default;
|
|
1956
|
-
defaultSpace.properties[
|
|
2017
|
+
defaultSpace.properties[import_chunk_OTDRTHT4.CollectionType.typename] = (0, import_echo.create)(import_chunk_OTDRTHT4.CollectionType, {
|
|
1957
2018
|
objects: [],
|
|
1958
2019
|
views: {}
|
|
1959
2020
|
});
|
|
@@ -1996,7 +2057,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
1996
2057
|
}) : null,
|
|
1997
2058
|
metadata: {
|
|
1998
2059
|
records: {
|
|
1999
|
-
[
|
|
2060
|
+
[import_chunk_OTDRTHT4.CollectionType.typename]: {
|
|
2000
2061
|
placeholder: [
|
|
2001
2062
|
"unnamed collection label",
|
|
2002
2063
|
{
|
|
@@ -2014,7 +2075,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2014
2075
|
},
|
|
2015
2076
|
echo: {
|
|
2016
2077
|
schema: [
|
|
2017
|
-
|
|
2078
|
+
import_chunk_OTDRTHT4.CollectionType
|
|
2018
2079
|
]
|
|
2019
2080
|
},
|
|
2020
2081
|
surface: {
|
|
@@ -2025,12 +2086,12 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2025
2086
|
case "main":
|
|
2026
2087
|
return (0, import_echo.isSpace)(primary) && primary.state.get() === import_echo.SpaceState.SPACE_READY ? /* @__PURE__ */ import_react.default.createElement(import_app_framework.Surface, {
|
|
2027
2088
|
data: {
|
|
2028
|
-
active: primary.properties[
|
|
2089
|
+
active: primary.properties[import_chunk_OTDRTHT4.CollectionType.typename],
|
|
2029
2090
|
id: primary.id
|
|
2030
2091
|
},
|
|
2031
2092
|
role,
|
|
2032
2093
|
...rest
|
|
2033
|
-
}) : primary instanceof
|
|
2094
|
+
}) : primary instanceof import_chunk_OTDRTHT4.CollectionType ? {
|
|
2034
2095
|
node: /* @__PURE__ */ import_react.default.createElement(CollectionMain, {
|
|
2035
2096
|
collection: primary
|
|
2036
2097
|
}),
|
|
@@ -2039,19 +2100,23 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2039
2100
|
id: primary
|
|
2040
2101
|
}) : null;
|
|
2041
2102
|
case "complementary--settings":
|
|
2042
|
-
return (0, import_echo.
|
|
2043
|
-
|
|
2044
|
-
}) :
|
|
2103
|
+
return (0, import_echo.isSpace)(data.subject) ? /* @__PURE__ */ import_react.default.createElement(SpaceSettingsPanel, {
|
|
2104
|
+
space: data.subject
|
|
2105
|
+
}) : (0, import_echo.isEchoObject)(data.subject) ? {
|
|
2106
|
+
node: /* @__PURE__ */ import_react.default.createElement(DefaultObjectSettings, {
|
|
2107
|
+
object: data.subject
|
|
2108
|
+
}),
|
|
2109
|
+
disposition: "fallback"
|
|
2110
|
+
} : null;
|
|
2045
2111
|
case "dialog":
|
|
2046
2112
|
if (data.component === "dxos.org/plugin/space/InvitationManagerDialog") {
|
|
2047
2113
|
return /* @__PURE__ */ import_react.default.createElement(import_react_ui.Dialog.Content, null, /* @__PURE__ */ import_react.default.createElement(import_react2.ClipboardProvider, null, /* @__PURE__ */ import_react.default.createElement(import_react2.InvitationManager, {
|
|
2048
2114
|
active: true,
|
|
2049
2115
|
...data.subject
|
|
2050
2116
|
})));
|
|
2051
|
-
} else {
|
|
2052
|
-
return null;
|
|
2053
2117
|
}
|
|
2054
|
-
|
|
2118
|
+
return null;
|
|
2119
|
+
case "popover": {
|
|
2055
2120
|
if (data.component === "dxos.org/plugin/space/RenameSpacePopover" && (0, import_echo.isSpace)(data.subject)) {
|
|
2056
2121
|
return /* @__PURE__ */ import_react.default.createElement(PopoverRenameSpace, {
|
|
2057
2122
|
space: data.subject
|
|
@@ -2063,11 +2128,14 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2063
2128
|
});
|
|
2064
2129
|
}
|
|
2065
2130
|
return null;
|
|
2131
|
+
}
|
|
2066
2132
|
// TODO(burdon): Add role name syntax to minimal plugin docs.
|
|
2067
2133
|
case "presence--glyph": {
|
|
2068
2134
|
return (0, import_echo_schema.isReactiveObject)(data.object) ? /* @__PURE__ */ import_react.default.createElement(SmallPresenceLive, {
|
|
2135
|
+
id: data.id,
|
|
2069
2136
|
viewers: state.values.viewersByObject[(0, import_echo.fullyQualifiedId)(data.object)]
|
|
2070
2137
|
}) : /* @__PURE__ */ import_react.default.createElement(SmallPresence, {
|
|
2138
|
+
id: data.id,
|
|
2071
2139
|
count: 0
|
|
2072
2140
|
});
|
|
2073
2141
|
}
|
|
@@ -2079,7 +2147,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2079
2147
|
return null;
|
|
2080
2148
|
}
|
|
2081
2149
|
const space = (0, import_echo.isSpace)(data.object) ? data.object : (0, import_echo.getSpace)(data.object);
|
|
2082
|
-
const object = (0, import_echo.isSpace)(data.object) ? data.object.state.get() === import_echo.SpaceState.SPACE_READY ? space?.properties[
|
|
2150
|
+
const object = (0, import_echo.isSpace)(data.object) ? data.object.state.get() === import_echo.SpaceState.SPACE_READY ? space?.properties[import_chunk_OTDRTHT4.CollectionType.typename] : void 0 : data.object;
|
|
2083
2151
|
return space && object ? {
|
|
2084
2152
|
node: /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(SpacePresence, {
|
|
2085
2153
|
object
|
|
@@ -2090,7 +2158,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2090
2158
|
} : null;
|
|
2091
2159
|
}
|
|
2092
2160
|
case "section":
|
|
2093
|
-
return data.object instanceof
|
|
2161
|
+
return data.object instanceof import_chunk_OTDRTHT4.CollectionType ? /* @__PURE__ */ import_react.default.createElement(CollectionSection, {
|
|
2094
2162
|
collection: data.object
|
|
2095
2163
|
}) : null;
|
|
2096
2164
|
case "settings":
|
|
@@ -2098,12 +2166,12 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2098
2166
|
settings: settings.values
|
|
2099
2167
|
}) : null;
|
|
2100
2168
|
case "menu-footer":
|
|
2101
|
-
if (
|
|
2102
|
-
return null;
|
|
2103
|
-
} else {
|
|
2169
|
+
if ((0, import_echo.isEchoObject)(data.object)) {
|
|
2104
2170
|
return /* @__PURE__ */ import_react.default.createElement(MenuFooter, {
|
|
2105
2171
|
object: data.object
|
|
2106
2172
|
});
|
|
2173
|
+
} else {
|
|
2174
|
+
return null;
|
|
2107
2175
|
}
|
|
2108
2176
|
case "status": {
|
|
2109
2177
|
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(SyncStatus, null), /* @__PURE__ */ import_react.default.createElement(SaveStatus, null));
|
|
@@ -2122,7 +2190,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2122
2190
|
const dispatch = intentPlugin?.provides.intent.dispatch;
|
|
2123
2191
|
const resolve = metadataPlugin?.provides.metadata.resolver;
|
|
2124
2192
|
const graph = graphPlugin?.provides.graph;
|
|
2125
|
-
if (!
|
|
2193
|
+
if (!client || !dispatch || !resolve || !graph) {
|
|
2126
2194
|
return [];
|
|
2127
2195
|
}
|
|
2128
2196
|
return [
|
|
@@ -2154,7 +2222,6 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2154
2222
|
ns: import_chunk_P4XUXM7Y.SPACE_PLUGIN
|
|
2155
2223
|
}
|
|
2156
2224
|
],
|
|
2157
|
-
palette: "teal",
|
|
2158
2225
|
testId: "spacePlugin.spaces",
|
|
2159
2226
|
role: "branch",
|
|
2160
2227
|
childrenPersistenceClass: "echo",
|
|
@@ -2167,8 +2234,8 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2167
2234
|
spacesOrder.order = nextOrder.map(({ id }) => id);
|
|
2168
2235
|
} else {
|
|
2169
2236
|
import_log.log.warn("spaces order object not found", void 0, {
|
|
2170
|
-
F:
|
|
2171
|
-
L:
|
|
2237
|
+
F: __dxlog_file6,
|
|
2238
|
+
L: 528,
|
|
2172
2239
|
S: void 0,
|
|
2173
2240
|
C: (f, a) => f(...a)
|
|
2174
2241
|
});
|
|
@@ -2205,8 +2272,9 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2205
2272
|
}
|
|
2206
2273
|
],
|
|
2207
2274
|
icon: "ph--plus--regular",
|
|
2208
|
-
disposition: "
|
|
2209
|
-
testId: "spacePlugin.createSpace"
|
|
2275
|
+
disposition: "item",
|
|
2276
|
+
testId: "spacePlugin.createSpace",
|
|
2277
|
+
className: "pbs-4"
|
|
2210
2278
|
}
|
|
2211
2279
|
},
|
|
2212
2280
|
{
|
|
@@ -2230,7 +2298,9 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2230
2298
|
}
|
|
2231
2299
|
],
|
|
2232
2300
|
icon: "ph--sign-in--regular",
|
|
2233
|
-
|
|
2301
|
+
disposition: "item",
|
|
2302
|
+
testId: "spacePlugin.joinSpace",
|
|
2303
|
+
className: "pbe-4"
|
|
2234
2304
|
}
|
|
2235
2305
|
}
|
|
2236
2306
|
],
|
|
@@ -2317,7 +2387,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2317
2387
|
if (state2 !== import_echo.SpaceState.SPACE_READY) {
|
|
2318
2388
|
return;
|
|
2319
2389
|
}
|
|
2320
|
-
const collection = space.properties[
|
|
2390
|
+
const collection = space.properties[import_chunk_OTDRTHT4.CollectionType.typename];
|
|
2321
2391
|
if (!collection) {
|
|
2322
2392
|
return;
|
|
2323
2393
|
}
|
|
@@ -2344,7 +2414,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2344
2414
|
// Create nodes for objects in collections.
|
|
2345
2415
|
(0, import_plugin_graph.createExtension)({
|
|
2346
2416
|
id: `${import_chunk_P4XUXM7Y.SPACE_PLUGIN}/collection-objects`,
|
|
2347
|
-
filter: (node) => node.data instanceof
|
|
2417
|
+
filter: (node) => node.data instanceof import_chunk_OTDRTHT4.CollectionType,
|
|
2348
2418
|
connector: ({ node }) => {
|
|
2349
2419
|
const collection = node.data;
|
|
2350
2420
|
const space = (0, import_echo.getSpace)(collection);
|
|
@@ -2365,9 +2435,36 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2365
2435
|
if (!id.endsWith("~settings")) {
|
|
2366
2436
|
return;
|
|
2367
2437
|
}
|
|
2438
|
+
const type = "orphan-settings-for-subject";
|
|
2439
|
+
const icon = "ph--gear--regular";
|
|
2368
2440
|
const [subjectId] = id.split("~");
|
|
2369
|
-
const
|
|
2441
|
+
const { spaceId, objectId } = (0, import_echo.parseId)(subjectId);
|
|
2370
2442
|
const space = client.spaces.get().find((space2) => space2.id === spaceId);
|
|
2443
|
+
if (!objectId) {
|
|
2444
|
+
const label2 = space ? space.properties.name || [
|
|
2445
|
+
"unnamed space label",
|
|
2446
|
+
{
|
|
2447
|
+
ns: import_chunk_P4XUXM7Y.SPACE_PLUGIN
|
|
2448
|
+
}
|
|
2449
|
+
] : [
|
|
2450
|
+
"unnamed object settings label",
|
|
2451
|
+
{
|
|
2452
|
+
ns: import_chunk_P4XUXM7Y.SPACE_PLUGIN
|
|
2453
|
+
}
|
|
2454
|
+
];
|
|
2455
|
+
return {
|
|
2456
|
+
id,
|
|
2457
|
+
type,
|
|
2458
|
+
data: null,
|
|
2459
|
+
properties: {
|
|
2460
|
+
icon,
|
|
2461
|
+
label: label2,
|
|
2462
|
+
showResolvedThreads: false,
|
|
2463
|
+
object: null,
|
|
2464
|
+
space
|
|
2465
|
+
}
|
|
2466
|
+
};
|
|
2467
|
+
}
|
|
2371
2468
|
const object = (0, import_plugin_graph.toSignal)((onChange) => {
|
|
2372
2469
|
const timeout = setTimeout(async () => {
|
|
2373
2470
|
await space?.db.loadObjectById(objectId);
|
|
@@ -2387,10 +2484,10 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2387
2484
|
];
|
|
2388
2485
|
return {
|
|
2389
2486
|
id,
|
|
2390
|
-
type
|
|
2487
|
+
type,
|
|
2391
2488
|
data: null,
|
|
2392
2489
|
properties: {
|
|
2393
|
-
icon
|
|
2490
|
+
icon,
|
|
2394
2491
|
label,
|
|
2395
2492
|
object
|
|
2396
2493
|
}
|
|
@@ -2436,7 +2533,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2436
2533
|
}
|
|
2437
2534
|
},
|
|
2438
2535
|
{
|
|
2439
|
-
inputType:
|
|
2536
|
+
inputType: import_chunk_OTDRTHT4.CollectionType.typename,
|
|
2440
2537
|
outputType: DIRECTORY_TYPE,
|
|
2441
2538
|
serialize: (node) => ({
|
|
2442
2539
|
name: node.data.name ?? translations_default[0]["en-US"][import_chunk_P4XUXM7Y.SPACE_PLUGIN]["unnamed collection label"],
|
|
@@ -2445,7 +2542,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2445
2542
|
}),
|
|
2446
2543
|
deserialize: async (data, ancestors) => {
|
|
2447
2544
|
const space = ancestors.find(import_echo.isSpace);
|
|
2448
|
-
const collection = ancestors.findLast((ancestor) => ancestor instanceof
|
|
2545
|
+
const collection = ancestors.findLast((ancestor) => ancestor instanceof import_chunk_OTDRTHT4.CollectionType) ?? space?.properties[import_chunk_OTDRTHT4.CollectionType.typename];
|
|
2449
2546
|
if (!space || !collection) {
|
|
2450
2547
|
return;
|
|
2451
2548
|
}
|
|
@@ -2454,7 +2551,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2454
2551
|
action: import_chunk_P4XUXM7Y.SpaceAction.ADD_OBJECT,
|
|
2455
2552
|
data: {
|
|
2456
2553
|
target: collection,
|
|
2457
|
-
object: (0, import_echo.create)(
|
|
2554
|
+
object: (0, import_echo.create)(import_chunk_OTDRTHT4.CollectionType, {
|
|
2458
2555
|
name: data.name,
|
|
2459
2556
|
objects: [],
|
|
2460
2557
|
views: {}
|
|
@@ -2484,11 +2581,11 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2484
2581
|
}
|
|
2485
2582
|
const space = await client.spaces.create(intent.data);
|
|
2486
2583
|
await space.waitUntilReady();
|
|
2487
|
-
const collection = (0, import_echo.create)(
|
|
2584
|
+
const collection = (0, import_echo.create)(import_chunk_OTDRTHT4.CollectionType, {
|
|
2488
2585
|
objects: [],
|
|
2489
2586
|
views: {}
|
|
2490
2587
|
});
|
|
2491
|
-
space.properties[
|
|
2588
|
+
space.properties[import_chunk_OTDRTHT4.CollectionType.typename] = collection;
|
|
2492
2589
|
if (import_migrations.Migrations.versionProperty) {
|
|
2493
2590
|
space.properties[import_migrations.Migrations.versionProperty] = import_migrations.Migrations.targetVersion;
|
|
2494
2591
|
}
|
|
@@ -2780,20 +2877,20 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2780
2877
|
]
|
|
2781
2878
|
};
|
|
2782
2879
|
}
|
|
2783
|
-
if (intent.data?.target instanceof
|
|
2880
|
+
if (intent.data?.target instanceof import_chunk_OTDRTHT4.CollectionType) {
|
|
2784
2881
|
intent.data?.target.objects.push(object);
|
|
2785
2882
|
} else if ((0, import_echo.isSpace)(intent.data?.target)) {
|
|
2786
|
-
const collection = space.properties[
|
|
2787
|
-
if (collection instanceof
|
|
2883
|
+
const collection = space.properties[import_chunk_OTDRTHT4.CollectionType.typename];
|
|
2884
|
+
if (collection instanceof import_chunk_OTDRTHT4.CollectionType) {
|
|
2788
2885
|
collection.objects.push(object);
|
|
2789
2886
|
} else {
|
|
2790
|
-
const collection2 = (0, import_echo.create)(
|
|
2887
|
+
const collection2 = (0, import_echo.create)(import_chunk_OTDRTHT4.CollectionType, {
|
|
2791
2888
|
objects: [
|
|
2792
2889
|
object
|
|
2793
2890
|
],
|
|
2794
2891
|
views: {}
|
|
2795
2892
|
});
|
|
2796
|
-
space.properties[
|
|
2893
|
+
space.properties[import_chunk_OTDRTHT4.CollectionType.typename] = collection2;
|
|
2797
2894
|
}
|
|
2798
2895
|
}
|
|
2799
2896
|
return {
|
|
@@ -2833,12 +2930,12 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2833
2930
|
const activeParts = navigationPlugin?.provides.location.active;
|
|
2834
2931
|
const openObjectIds = new Set((0, import_app_framework.openIds)(activeParts ?? {}));
|
|
2835
2932
|
if (!intent.undo && resolve) {
|
|
2836
|
-
const parentCollection = intent.data?.collection ?? space.properties[
|
|
2933
|
+
const parentCollection = intent.data?.collection ?? space.properties[import_chunk_OTDRTHT4.CollectionType.typename];
|
|
2837
2934
|
const nestedObjects = await getNestedObjects(object, resolve);
|
|
2838
2935
|
const deletionData = {
|
|
2839
2936
|
object,
|
|
2840
2937
|
parentCollection,
|
|
2841
|
-
index: parentCollection instanceof
|
|
2938
|
+
index: parentCollection instanceof import_chunk_OTDRTHT4.CollectionType ? parentCollection.objects.indexOf(object) : -1,
|
|
2842
2939
|
nestedObjects,
|
|
2843
2940
|
wasActive: [
|
|
2844
2941
|
object,
|
|
@@ -2856,7 +2953,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2856
2953
|
}
|
|
2857
2954
|
});
|
|
2858
2955
|
}
|
|
2859
|
-
if (parentCollection instanceof
|
|
2956
|
+
if (parentCollection instanceof import_chunk_OTDRTHT4.CollectionType) {
|
|
2860
2957
|
const index = parentCollection.objects.indexOf(object);
|
|
2861
2958
|
if (index !== -1) {
|
|
2862
2959
|
parentCollection.objects.splice(index, 1);
|
|
@@ -2866,7 +2963,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2866
2963
|
space.db.remove(obj);
|
|
2867
2964
|
});
|
|
2868
2965
|
space.db.remove(object);
|
|
2869
|
-
const undoMessageKey = object instanceof
|
|
2966
|
+
const undoMessageKey = object instanceof import_chunk_OTDRTHT4.CollectionType ? "collection deleted label" : "object deleted label";
|
|
2870
2967
|
return {
|
|
2871
2968
|
data: true,
|
|
2872
2969
|
undoable: {
|
|
@@ -2877,7 +2974,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2877
2974
|
};
|
|
2878
2975
|
} else {
|
|
2879
2976
|
const undoData = intent.data;
|
|
2880
|
-
if (undoData && (0, import_echo.isEchoObject)(undoData.object) && undoData.parentCollection instanceof
|
|
2977
|
+
if (undoData && (0, import_echo.isEchoObject)(undoData.object) && undoData.parentCollection instanceof import_chunk_OTDRTHT4.CollectionType) {
|
|
2881
2978
|
const restoredObject = space.db.add(undoData.object);
|
|
2882
2979
|
undoData.nestedObjects.forEach((obj) => {
|
|
2883
2980
|
space.db.add(obj);
|
|
@@ -2929,10 +3026,11 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2929
3026
|
case import_chunk_P4XUXM7Y.SpaceAction.DUPLICATE_OBJECT: {
|
|
2930
3027
|
const originalObject = intent.data?.object ?? intent.data?.result;
|
|
2931
3028
|
const resolve = (0, import_app_framework.resolvePlugin)(plugins, import_app_framework.parseMetadataResolverPlugin)?.provides.metadata.resolver;
|
|
2932
|
-
|
|
3029
|
+
const space = (0, import_echo.isSpace)(intent.data?.target) ? intent.data?.target : (0, import_echo.getSpace)(intent.data?.target);
|
|
3030
|
+
if (!(0, import_echo.isEchoObject)(originalObject) || !resolve || !space) {
|
|
2933
3031
|
return;
|
|
2934
3032
|
}
|
|
2935
|
-
const newObject = await cloneObject(originalObject, resolve);
|
|
3033
|
+
const newObject = await cloneObject(originalObject, resolve, space);
|
|
2936
3034
|
return {
|
|
2937
3035
|
intents: [
|
|
2938
3036
|
[
|
|
@@ -2995,6 +3093,7 @@ var src_default = SpacePlugin;
|
|
|
2995
3093
|
SpacePlugin,
|
|
2996
3094
|
SpacePresence,
|
|
2997
3095
|
SpaceSettings,
|
|
3096
|
+
SpaceSettingsPanel,
|
|
2998
3097
|
SyncStatus,
|
|
2999
3098
|
SyncStatusDetail,
|
|
3000
3099
|
SyncStatusIndicator,
|