@dxos/plugin-space 0.6.12 → 0.6.13-main.548ca8d
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-LZEGRS7H.mjs → chunk-AVLRQF6L.mjs} +1 -1
- package/dist/lib/browser/chunk-AVLRQF6L.mjs.map +7 -0
- package/dist/lib/browser/{chunk-DTVUOG2C.mjs → chunk-QK5I2EPF.mjs} +23 -4
- package/dist/lib/browser/chunk-QK5I2EPF.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +592 -246
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/meta.mjs +1 -1
- package/dist/lib/browser/types/index.mjs +7 -3
- package/dist/lib/node/{chunk-CVZPI2P3.cjs → chunk-HE2GHO6Z.cjs} +29 -8
- package/dist/lib/node/chunk-HE2GHO6Z.cjs.map +7 -0
- package/dist/lib/node/{chunk-6CNYF6YU.cjs → chunk-P4XUXM7Y.cjs} +4 -4
- package/dist/lib/node/chunk-P4XUXM7Y.cjs.map +7 -0
- package/dist/lib/node/index.cjs +812 -469
- package/dist/lib/node/index.cjs.map +4 -4
- package/dist/lib/node/meta.cjs +5 -5
- package/dist/lib/node/meta.cjs.map +1 -1
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/types/index.cjs +14 -10
- package/dist/lib/node/types/index.cjs.map +2 -2
- package/dist/lib/node-esm/chunk-2TR4WD6U.mjs +116 -0
- package/dist/lib/node-esm/chunk-2TR4WD6U.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-YPQGKWHJ.mjs +37 -0
- package/dist/lib/node-esm/chunk-YPQGKWHJ.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +2987 -0
- package/dist/lib/node-esm/index.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -0
- package/dist/lib/node-esm/meta.mjs +14 -0
- package/dist/lib/node-esm/meta.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +26 -0
- package/dist/lib/node-esm/types/index.mjs.map +7 -0
- package/dist/types/src/SpacePlugin.d.ts.map +1 -1
- package/dist/types/src/components/FallbackSettings.d.ts +8 -0
- package/dist/types/src/components/FallbackSettings.d.ts.map +1 -0
- package/dist/types/src/components/MenuFooter.d.ts.map +1 -1
- package/dist/types/src/components/SaveStatus.d.ts +3 -0
- package/dist/types/src/components/SaveStatus.d.ts.map +1 -0
- package/dist/types/src/components/ShareSpaceButton.stories.d.ts +4 -0
- package/dist/types/src/components/ShareSpaceButton.stories.d.ts.map +1 -1
- package/dist/types/src/components/SpaceMain/SpaceMain.d.ts.map +1 -1
- package/dist/types/src/components/SpacePresence.stories.d.ts +4 -0
- package/dist/types/src/components/SpacePresence.stories.d.ts.map +1 -1
- package/dist/types/src/components/SpaceSettings.d.ts.map +1 -1
- package/dist/types/src/components/SyncStatus/SyncStatus.d.ts +13 -0
- package/dist/types/src/components/SyncStatus/SyncStatus.d.ts.map +1 -0
- package/dist/types/src/components/SyncStatus/SyncStatus.stories.d.ts +117 -0
- package/dist/types/src/components/SyncStatus/SyncStatus.stories.d.ts.map +1 -0
- package/dist/types/src/components/SyncStatus/index.d.ts +2 -0
- package/dist/types/src/components/SyncStatus/index.d.ts.map +1 -0
- package/dist/types/src/components/SyncStatus/types.d.ts +14 -0
- package/dist/types/src/components/SyncStatus/types.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +3 -2
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +4 -0
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/thread.d.ts +14 -0
- package/dist/types/src/types/thread.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +18 -1
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/src/util.d.ts +1 -4
- package/dist/types/src/util.d.ts.map +1 -1
- package/package.json +44 -36
- package/src/SpacePlugin.tsx +145 -83
- package/src/components/FallbackSettings.tsx +35 -0
- package/src/components/MenuFooter.tsx +1 -0
- package/src/components/SaveStatus.tsx +95 -0
- package/src/components/SpaceMain/SpaceMain.tsx +1 -22
- package/src/components/SpacePresence.tsx +1 -1
- package/src/components/SpaceSettings.tsx +32 -3
- package/src/components/SyncStatus/SyncStatus.stories.tsx +62 -0
- package/src/components/SyncStatus/SyncStatus.tsx +188 -0
- package/src/components/SyncStatus/index.ts +5 -0
- package/src/components/SyncStatus/types.ts +77 -0
- package/src/components/index.ts +3 -2
- package/src/meta.ts +3 -1
- package/src/translations.ts +4 -0
- package/src/types/collection.ts +1 -1
- package/src/types/thread.ts +11 -1
- package/src/types/types.ts +25 -1
- package/src/util.tsx +15 -50
- package/dist/lib/browser/chunk-DTVUOG2C.mjs.map +0 -7
- package/dist/lib/browser/chunk-LZEGRS7H.mjs.map +0 -7
- package/dist/lib/node/chunk-6CNYF6YU.cjs.map +0 -7
- package/dist/lib/node/chunk-CVZPI2P3.cjs.map +0 -7
- package/dist/types/src/components/EmptySpace.d.ts +0 -3
- package/dist/types/src/components/EmptySpace.d.ts.map +0 -1
- package/dist/types/src/components/EmptyTree.d.ts +0 -3
- package/dist/types/src/components/EmptyTree.d.ts.map +0 -1
- package/src/components/EmptySpace.tsx +0 -25
- package/src/components/EmptyTree.tsx +0 -25
|
@@ -3,36 +3,38 @@ import {
|
|
|
3
3
|
SPACE_PLUGIN_SHORT_ID,
|
|
4
4
|
SpaceAction,
|
|
5
5
|
meta_default
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-AVLRQF6L.mjs";
|
|
7
7
|
import {
|
|
8
8
|
ActorSchema,
|
|
9
9
|
ChannelType,
|
|
10
10
|
CollectionType,
|
|
11
11
|
ContactType,
|
|
12
|
+
MessageState,
|
|
12
13
|
MessageType,
|
|
13
14
|
SPACE_DIRECTORY_HANDLE,
|
|
14
15
|
ThreadStatus,
|
|
15
|
-
ThreadType
|
|
16
|
-
|
|
16
|
+
ThreadType,
|
|
17
|
+
parseSpaceInitPlugin
|
|
18
|
+
} from "./chunk-QK5I2EPF.mjs";
|
|
17
19
|
|
|
18
20
|
// packages/plugins/plugin-space/src/SpacePlugin.tsx
|
|
19
|
-
import {
|
|
20
|
-
import { effect, signal } from "@preact/signals-core";
|
|
21
|
+
import { signal } from "@preact/signals-core";
|
|
21
22
|
import React17 from "react";
|
|
22
|
-
import { LayoutAction as LayoutAction2,
|
|
23
|
+
import { LayoutAction as LayoutAction2, NavigationAction as NavigationAction3, Surface as Surface2, firstIdInPart, openIds, parseGraphPlugin, parseIntentPlugin as parseIntentPlugin3, parseMetadataResolverPlugin, parseNavigationPlugin as parseNavigationPlugin2, resolvePlugin } from "@dxos/app-framework";
|
|
23
24
|
import { EventSubscriptions } from "@dxos/async";
|
|
24
25
|
import { isReactiveObject as isReactiveObject2 } from "@dxos/echo-schema";
|
|
26
|
+
import { scheduledEffect } from "@dxos/echo-signals/core";
|
|
25
27
|
import { LocalStorageStore } from "@dxos/local-storage";
|
|
26
28
|
import { log as log2 } from "@dxos/log";
|
|
27
29
|
import { Migrations as Migrations2 } from "@dxos/migrations";
|
|
28
30
|
import { parseAttentionPlugin } from "@dxos/plugin-attention";
|
|
29
31
|
import { parseClientPlugin } from "@dxos/plugin-client";
|
|
30
|
-
import { createExtension,
|
|
32
|
+
import { createExtension, memoize as memoize2, toSignal } from "@dxos/plugin-graph";
|
|
31
33
|
import { ObservabilityAction } from "@dxos/plugin-observability/meta";
|
|
32
34
|
import { PublicKey as PublicKey2 } from "@dxos/react-client";
|
|
33
|
-
import {
|
|
35
|
+
import { Expando, Filter, SpaceState as SpaceState3, create as create2, fullyQualifiedId as fullyQualifiedId4, getSpace as getSpace4, getTypename as getTypename2, isEchoObject as isEchoObject2, isSpace as isSpace2, loadObjectReferences, parseFullyQualifiedId } from "@dxos/react-client/echo";
|
|
34
36
|
import { Dialog } from "@dxos/react-ui";
|
|
35
|
-
import {
|
|
37
|
+
import { ClipboardProvider as ClipboardProvider2, InvitationManager, osTranslations } from "@dxos/shell/react";
|
|
36
38
|
import { ComplexMap as ComplexMap2, nonNullable, reduceGroupBy } from "@dxos/util";
|
|
37
39
|
|
|
38
40
|
// packages/plugins/plugin-space/src/components/AwaitingObject.tsx
|
|
@@ -158,40 +160,34 @@ var CollectionSection = ({ collection }) => {
|
|
|
158
160
|
}, collection.name ?? t("unnamed collection label")));
|
|
159
161
|
};
|
|
160
162
|
|
|
161
|
-
// packages/plugins/plugin-space/src/components/
|
|
163
|
+
// packages/plugins/plugin-space/src/components/FallbackSettings.tsx
|
|
162
164
|
import React4 from "react";
|
|
163
|
-
import { useTranslation as useTranslation4 } from "@dxos/react-ui";
|
|
164
|
-
|
|
165
|
-
var EmptySpace = () => {
|
|
165
|
+
import { Input, useTranslation as useTranslation4 } from "@dxos/react-ui";
|
|
166
|
+
var FallbackSettings = ({ object }) => {
|
|
166
167
|
const { t } = useTranslation4(SPACE_PLUGIN);
|
|
167
168
|
return /* @__PURE__ */ React4.createElement("div", {
|
|
169
|
+
role: "form",
|
|
170
|
+
className: "p-3 flex flex-col gap-2"
|
|
171
|
+
}, /* @__PURE__ */ React4.createElement("div", {
|
|
168
172
|
role: "none",
|
|
169
|
-
className:
|
|
170
|
-
}, t("
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
var EmptyTree = () => {
|
|
178
|
-
const { t } = useTranslation5(SPACE_PLUGIN);
|
|
179
|
-
return /* @__PURE__ */ React5.createElement("div", {
|
|
180
|
-
role: "none",
|
|
181
|
-
className: mx4("p-2 mli-2 mbe-2 text-center border border-dashed border-neutral-400/50 rounded-lg", descriptionText3)
|
|
182
|
-
}, t("empty tree message"));
|
|
173
|
+
className: "space-b-1"
|
|
174
|
+
}, /* @__PURE__ */ React4.createElement(Input.Root, null, /* @__PURE__ */ React4.createElement(Input.Label, null, t("name label")), /* @__PURE__ */ React4.createElement(Input.TextInput, {
|
|
175
|
+
placeholder: t("name placeholder"),
|
|
176
|
+
value: object.name,
|
|
177
|
+
onChange: (event) => {
|
|
178
|
+
object.name = event.target.value;
|
|
179
|
+
}
|
|
180
|
+
}))));
|
|
183
181
|
};
|
|
184
182
|
|
|
185
183
|
// packages/plugins/plugin-space/src/components/MenuFooter.tsx
|
|
186
|
-
import { Planet
|
|
187
|
-
import
|
|
184
|
+
import { Planet } from "@phosphor-icons/react";
|
|
185
|
+
import React5 from "react";
|
|
188
186
|
import { getSpace as getSpace2 } from "@dxos/client/echo";
|
|
189
187
|
import { useClient as useClient2 } from "@dxos/react-client";
|
|
190
|
-
import { DropdownMenu, toLocalizedString, useTranslation as
|
|
188
|
+
import { DropdownMenu, toLocalizedString, useTranslation as useTranslation5 } from "@dxos/react-ui";
|
|
191
189
|
|
|
192
190
|
// packages/plugins/plugin-space/src/util.tsx
|
|
193
|
-
import { CardsThree, Database, PencilSimpleLine, Planet, Plus, Trash, Users, X, ClockCounterClockwise, LockSimpleOpen, LockSimple, Placeholder, Link } from "@phosphor-icons/react";
|
|
194
|
-
import React6 from "react";
|
|
195
191
|
import { NavigationAction as NavigationAction2 } from "@dxos/app-framework";
|
|
196
192
|
import { create, isReactiveObject, getTypename, getSchema, getEchoObjectAnnotation, EXPANDO_TYPENAME } from "@dxos/echo-schema";
|
|
197
193
|
import { invariant } from "@dxos/invariant";
|
|
@@ -284,8 +280,7 @@ var constructSpaceNode = ({ space, personal, namesCache, resolve }) => {
|
|
|
284
280
|
namesCache
|
|
285
281
|
}),
|
|
286
282
|
description: space.state.get() === SpaceState.SPACE_READY && space.properties.description,
|
|
287
|
-
icon:
|
|
288
|
-
iconSymbol: "ph--planet--regular",
|
|
283
|
+
icon: "ph--planet--regular",
|
|
289
284
|
disabled: space.state.get() !== SpaceState.SPACE_READY || hasPendingMigration,
|
|
290
285
|
testId: "spacePlugin.space"
|
|
291
286
|
}
|
|
@@ -311,8 +306,7 @@ var constructSpaceActionGroups = ({ space, dispatch }) => {
|
|
|
311
306
|
ns: SPACE_PLUGIN
|
|
312
307
|
}
|
|
313
308
|
],
|
|
314
|
-
icon:
|
|
315
|
-
iconSymbol: "ph--plus--regular",
|
|
309
|
+
icon: "ph--plus--regular",
|
|
316
310
|
disposition: "toolbar",
|
|
317
311
|
// TODO(wittjosiah): This is currently a navtree feature. Address this with cmd+k integration.
|
|
318
312
|
// mainAreaDisposition: 'in-flow',
|
|
@@ -346,8 +340,7 @@ var constructSpaceActionGroups = ({ space, dispatch }) => {
|
|
|
346
340
|
ns: SPACE_PLUGIN
|
|
347
341
|
}
|
|
348
342
|
],
|
|
349
|
-
icon:
|
|
350
|
-
iconSymbol: "ph--cards-three--regular",
|
|
343
|
+
icon: "ph--cards-three--regular",
|
|
351
344
|
testId: "spacePlugin.createCollection"
|
|
352
345
|
}
|
|
353
346
|
}
|
|
@@ -381,8 +374,7 @@ var constructSpaceActions = ({ space, dispatch, personal, migrating }) => {
|
|
|
381
374
|
ns: SPACE_PLUGIN
|
|
382
375
|
}
|
|
383
376
|
],
|
|
384
|
-
icon:
|
|
385
|
-
iconSymbol: "ph--database--regular",
|
|
377
|
+
icon: "ph--database--regular",
|
|
386
378
|
disposition: "toolbar",
|
|
387
379
|
mainAreaDisposition: "in-flow",
|
|
388
380
|
disabled: migrating || Migrations.running(space)
|
|
@@ -413,8 +405,7 @@ var constructSpaceActions = ({ space, dispatch, personal, migrating }) => {
|
|
|
413
405
|
ns: SPACE_PLUGIN
|
|
414
406
|
}
|
|
415
407
|
],
|
|
416
|
-
icon:
|
|
417
|
-
iconSymbol: "ph--users--regular",
|
|
408
|
+
icon: "ph--users--regular",
|
|
418
409
|
disabled: locked,
|
|
419
410
|
keyBinding: {
|
|
420
411
|
macos: "meta+.",
|
|
@@ -441,8 +432,7 @@ var constructSpaceActions = ({ space, dispatch, personal, migrating }) => {
|
|
|
441
432
|
ns: SPACE_PLUGIN
|
|
442
433
|
}
|
|
443
434
|
],
|
|
444
|
-
icon: locked ?
|
|
445
|
-
iconSymbol: locked ? "ph--lock-simple-open--regular" : "ph--lock-simple--regular"
|
|
435
|
+
icon: locked ? "ph--lock-simple-open--regular" : "ph--lock-simple--regular"
|
|
446
436
|
}
|
|
447
437
|
}, {
|
|
448
438
|
id: getId(SpaceAction.RENAME),
|
|
@@ -464,8 +454,7 @@ var constructSpaceActions = ({ space, dispatch, personal, migrating }) => {
|
|
|
464
454
|
ns: SPACE_PLUGIN
|
|
465
455
|
}
|
|
466
456
|
],
|
|
467
|
-
icon:
|
|
468
|
-
iconSymbol: "ph--pencil-simple-line--regular",
|
|
457
|
+
icon: "ph--pencil-simple-line--regular",
|
|
469
458
|
keyBinding: {
|
|
470
459
|
macos: "shift+F6",
|
|
471
460
|
windows: "shift+F6"
|
|
@@ -494,8 +483,7 @@ var constructSpaceActions = ({ space, dispatch, personal, migrating }) => {
|
|
|
494
483
|
ns: SPACE_PLUGIN
|
|
495
484
|
}
|
|
496
485
|
],
|
|
497
|
-
icon:
|
|
498
|
-
iconSymbol: "ph--x--regular",
|
|
486
|
+
icon: "ph--x--regular",
|
|
499
487
|
mainAreaDisposition: "menu",
|
|
500
488
|
disabled: personal
|
|
501
489
|
}
|
|
@@ -521,8 +509,7 @@ var constructSpaceActions = ({ space, dispatch, personal, migrating }) => {
|
|
|
521
509
|
ns: SPACE_PLUGIN
|
|
522
510
|
}
|
|
523
511
|
],
|
|
524
|
-
icon:
|
|
525
|
-
iconSymbol: "ph--clock-counter-clockwise--regular",
|
|
512
|
+
icon: "ph--clock-counter-clockwise--regular",
|
|
526
513
|
disposition: "toolbar",
|
|
527
514
|
mainAreaDisposition: "in-flow"
|
|
528
515
|
}
|
|
@@ -556,8 +543,7 @@ var createObjectNode = ({ object, space, resolve }) => {
|
|
|
556
543
|
ns: SPACE_PLUGIN
|
|
557
544
|
}
|
|
558
545
|
],
|
|
559
|
-
icon: metadata.icon ??
|
|
560
|
-
iconSymbol: metadata.iconSymbol ?? "ph--placeholder--regular",
|
|
546
|
+
icon: metadata.icon ?? "ph--placeholder--regular",
|
|
561
547
|
testId: "spacePlugin.object",
|
|
562
548
|
persistenceClass: "echo",
|
|
563
549
|
persistenceKey: space?.id
|
|
@@ -582,8 +568,7 @@ var constructObjectActionGroups = ({ object, dispatch }) => {
|
|
|
582
568
|
ns: SPACE_PLUGIN
|
|
583
569
|
}
|
|
584
570
|
],
|
|
585
|
-
icon:
|
|
586
|
-
iconSymbol: "ph--plus--regular",
|
|
571
|
+
icon: "ph--plus--regular",
|
|
587
572
|
disposition: "toolbar",
|
|
588
573
|
// TODO(wittjosiah): This is currently a navtree feature. Address this with cmd+k integration.
|
|
589
574
|
// mainAreaDisposition: 'in-flow',
|
|
@@ -617,8 +602,7 @@ var constructObjectActionGroups = ({ object, dispatch }) => {
|
|
|
617
602
|
ns: SPACE_PLUGIN
|
|
618
603
|
}
|
|
619
604
|
],
|
|
620
|
-
icon:
|
|
621
|
-
iconSymbol: "ph--cards-three--regular",
|
|
605
|
+
icon: "ph--cards-three--regular",
|
|
622
606
|
testId: "spacePlugin.createCollection"
|
|
623
607
|
}
|
|
624
608
|
}
|
|
@@ -650,8 +634,7 @@ var constructObjectActions = ({ node, dispatch }) => {
|
|
|
650
634
|
ns: SPACE_PLUGIN
|
|
651
635
|
}
|
|
652
636
|
],
|
|
653
|
-
icon:
|
|
654
|
-
iconSymbol: "ph--pencil-simple-line--regular",
|
|
637
|
+
icon: "ph--pencil-simple-line--regular",
|
|
655
638
|
// TODO(wittjosiah): Doesn't work.
|
|
656
639
|
// keyBinding: 'shift+F6',
|
|
657
640
|
testId: "spacePlugin.renameObject"
|
|
@@ -682,8 +665,7 @@ var constructObjectActions = ({ node, dispatch }) => {
|
|
|
682
665
|
ns: SPACE_PLUGIN
|
|
683
666
|
}
|
|
684
667
|
],
|
|
685
|
-
icon:
|
|
686
|
-
iconSymbol: "ph--trash--regular",
|
|
668
|
+
icon: "ph--trash--regular",
|
|
687
669
|
keyBinding: object instanceof CollectionType ? void 0 : "shift+meta+Backspace",
|
|
688
670
|
testId: "spacePlugin.deleteObject"
|
|
689
671
|
}
|
|
@@ -702,8 +684,7 @@ var constructObjectActions = ({ node, dispatch }) => {
|
|
|
702
684
|
ns: SPACE_PLUGIN
|
|
703
685
|
}
|
|
704
686
|
],
|
|
705
|
-
icon:
|
|
706
|
-
iconSymbol: "ph--link--regular",
|
|
687
|
+
icon: "ph--link--regular",
|
|
707
688
|
testId: "spacePlugin.copyLink"
|
|
708
689
|
}
|
|
709
690
|
}
|
|
@@ -744,7 +725,7 @@ var cloneObject = async (object, resolve) => {
|
|
|
744
725
|
const serializer = metadata.serializer;
|
|
745
726
|
invariant(serializer, `No serializer for type: ${typename}`, {
|
|
746
727
|
F: __dxlog_file,
|
|
747
|
-
L:
|
|
728
|
+
L: 604,
|
|
748
729
|
S: void 0,
|
|
749
730
|
A: [
|
|
750
731
|
"serializer",
|
|
@@ -762,31 +743,31 @@ var cloneObject = async (object, resolve) => {
|
|
|
762
743
|
|
|
763
744
|
// packages/plugins/plugin-space/src/components/MenuFooter.tsx
|
|
764
745
|
var MenuFooter = ({ object }) => {
|
|
765
|
-
const { t } =
|
|
746
|
+
const { t } = useTranslation5(SPACE_PLUGIN);
|
|
766
747
|
const client = useClient2();
|
|
767
748
|
const space = getSpace2(object);
|
|
768
749
|
const spaceName = space ? getSpaceDisplayName(space, {
|
|
769
750
|
personal: client.spaces.default === space
|
|
770
751
|
}) : "";
|
|
771
|
-
return space ? /* @__PURE__ */
|
|
752
|
+
return space ? /* @__PURE__ */ React5.createElement(React5.Fragment, null, /* @__PURE__ */ React5.createElement(DropdownMenu.Separator, null), /* @__PURE__ */ React5.createElement(DropdownMenu.GroupLabel, null, t("menu footer label")), /* @__PURE__ */ React5.createElement("dl", {
|
|
772
753
|
className: "pis-2 mbe-2 text-xs grid grid-cols-[max-content_1fr] gap-2"
|
|
773
|
-
}, /* @__PURE__ */
|
|
754
|
+
}, /* @__PURE__ */ React5.createElement("dt", {
|
|
774
755
|
className: "uppercase text-[.75em] tracking-wide font-medium mbs-px self-start"
|
|
775
|
-
}, t("location label")), /* @__PURE__ */
|
|
756
|
+
}, t("location label")), /* @__PURE__ */ React5.createElement("dd", {
|
|
776
757
|
className: "line-clamp-3"
|
|
777
|
-
}, /* @__PURE__ */
|
|
758
|
+
}, /* @__PURE__ */ React5.createElement(Planet, {
|
|
778
759
|
className: "inline-block mie-1"
|
|
779
760
|
}), toLocalizedString(spaceName, t)))) : null;
|
|
780
761
|
};
|
|
781
762
|
|
|
782
763
|
// packages/plugins/plugin-space/src/components/MissingObject.tsx
|
|
783
|
-
import
|
|
764
|
+
import React6, { useEffect as useEffect2, useState as useState2 } from "react";
|
|
784
765
|
import { parseIntentPlugin as parseIntentPlugin2, useResolvePlugin as useResolvePlugin2 } from "@dxos/app-framework";
|
|
785
|
-
import { Status, useTranslation as
|
|
786
|
-
import { baseSurface as baseSurface2, descriptionText as
|
|
766
|
+
import { Status, useTranslation as useTranslation6 } from "@dxos/react-ui";
|
|
767
|
+
import { baseSurface as baseSurface2, descriptionText as descriptionText2, mx as mx3 } from "@dxos/react-ui-theme";
|
|
787
768
|
var WAIT_FOR_OBJECT_TIMEOUT2 = 1e3;
|
|
788
769
|
var MissingObject = ({ id }) => {
|
|
789
|
-
const { t } =
|
|
770
|
+
const { t } = useTranslation6(SPACE_PLUGIN);
|
|
790
771
|
const [waiting, setWaiting] = useState2(false);
|
|
791
772
|
const intentPlugin = useResolvePlugin2(parseIntentPlugin2);
|
|
792
773
|
useEffect2(() => {
|
|
@@ -808,13 +789,13 @@ var MissingObject = ({ id }) => {
|
|
|
808
789
|
intentPlugin,
|
|
809
790
|
id
|
|
810
791
|
]);
|
|
811
|
-
return /* @__PURE__ */
|
|
792
|
+
return /* @__PURE__ */ React6.createElement("div", {
|
|
812
793
|
role: "none",
|
|
813
|
-
className:
|
|
814
|
-
}, waiting ? /* @__PURE__ */
|
|
794
|
+
className: mx3(baseSurface2, "min-bs-screen is-full flex items-center justify-center p-8")
|
|
795
|
+
}, waiting ? /* @__PURE__ */ React6.createElement("p", {
|
|
815
796
|
role: "alert",
|
|
816
|
-
className:
|
|
817
|
-
}, t("missing object message")) : /* @__PURE__ */
|
|
797
|
+
className: mx3(descriptionText2, "border border-dashed border-neutral-400/50 rounded-lg flex items-center justify-center p-8 font-normal text-lg")
|
|
798
|
+
}, t("missing object message")) : /* @__PURE__ */ React6.createElement(Status, {
|
|
818
799
|
indeterminate: true,
|
|
819
800
|
"aria-label": "Initializing"
|
|
820
801
|
}));
|
|
@@ -822,10 +803,10 @@ var MissingObject = ({ id }) => {
|
|
|
822
803
|
|
|
823
804
|
// packages/plugins/plugin-space/src/components/PersistenceStatus.tsx
|
|
824
805
|
import { ArrowsCounterClockwise, CheckCircle as CheckCircle2, Warning } from "@phosphor-icons/react";
|
|
825
|
-
import
|
|
806
|
+
import React7, { useEffect as useEffect3, useState as useState3 } from "react";
|
|
826
807
|
import { debounce } from "@dxos/async";
|
|
827
|
-
import { Tooltip, useTranslation as
|
|
828
|
-
import { getSize as getSize2, mx as
|
|
808
|
+
import { Tooltip, useTranslation as useTranslation7 } from "@dxos/react-ui";
|
|
809
|
+
import { getSize as getSize2, mx as mx4, staticPlaceholderText, warningText } from "@dxos/react-ui-theme";
|
|
829
810
|
var Status2;
|
|
830
811
|
(function(Status3) {
|
|
831
812
|
Status3[Status3["PERSISTED_LOCALLY"] = 0] = "PERSISTED_LOCALLY";
|
|
@@ -833,7 +814,7 @@ var Status2;
|
|
|
833
814
|
Status3[Status3["ERROR"] = 2] = "ERROR";
|
|
834
815
|
})(Status2 || (Status2 = {}));
|
|
835
816
|
var PersistenceStatus = ({ db }) => {
|
|
836
|
-
const { t } =
|
|
817
|
+
const { t } = useTranslation7(SPACE_PLUGIN);
|
|
837
818
|
const [displayMessage, setDisplayMessage] = useState3(false);
|
|
838
819
|
const [status, naturalSetStatus] = useState3(0);
|
|
839
820
|
const [prevStatus, setPrevStatus] = useState3(0);
|
|
@@ -850,45 +831,45 @@ var PersistenceStatus = ({ db }) => {
|
|
|
850
831
|
]);
|
|
851
832
|
switch (status) {
|
|
852
833
|
case 2:
|
|
853
|
-
return /* @__PURE__ */
|
|
834
|
+
return /* @__PURE__ */ React7.createElement("div", {
|
|
854
835
|
className: "flex items-center"
|
|
855
|
-
}, /* @__PURE__ */
|
|
856
|
-
className:
|
|
857
|
-
}), /* @__PURE__ */
|
|
858
|
-
className:
|
|
836
|
+
}, /* @__PURE__ */ React7.createElement(Warning, {
|
|
837
|
+
className: mx4(getSize2(4), "me-1")
|
|
838
|
+
}), /* @__PURE__ */ React7.createElement("span", {
|
|
839
|
+
className: mx4("text-sm", warningText)
|
|
859
840
|
}, t("persistence error label")));
|
|
860
841
|
case 1:
|
|
861
|
-
return /* @__PURE__ */
|
|
842
|
+
return /* @__PURE__ */ React7.createElement("div", {
|
|
862
843
|
className: "flex items-center"
|
|
863
|
-
}, /* @__PURE__ */
|
|
864
|
-
className:
|
|
865
|
-
}), /* @__PURE__ */
|
|
866
|
-
className:
|
|
844
|
+
}, /* @__PURE__ */ React7.createElement(ArrowsCounterClockwise, {
|
|
845
|
+
className: mx4(getSize2(4), "me-1")
|
|
846
|
+
}), /* @__PURE__ */ React7.createElement("span", {
|
|
847
|
+
className: mx4("text-sm", staticPlaceholderText)
|
|
867
848
|
}, t("persistence pending label")));
|
|
868
849
|
case 0:
|
|
869
850
|
default:
|
|
870
|
-
return /* @__PURE__ */
|
|
851
|
+
return /* @__PURE__ */ React7.createElement(Tooltip.Root, {
|
|
871
852
|
delayDuration: 400
|
|
872
|
-
}, /* @__PURE__ */
|
|
853
|
+
}, /* @__PURE__ */ React7.createElement(Tooltip.Trigger, {
|
|
873
854
|
role: "status",
|
|
874
855
|
className: "flex items-center"
|
|
875
|
-
}, /* @__PURE__ */
|
|
876
|
-
className:
|
|
877
|
-
}), displayMessage && /* @__PURE__ */
|
|
878
|
-
className:
|
|
879
|
-
}, t("persisted locally label"))), /* @__PURE__ */
|
|
856
|
+
}, /* @__PURE__ */ React7.createElement(CheckCircle2, {
|
|
857
|
+
className: mx4(getSize2(4), "me-1")
|
|
858
|
+
}), displayMessage && /* @__PURE__ */ React7.createElement("span", {
|
|
859
|
+
className: mx4("text-sm", staticPlaceholderText)
|
|
860
|
+
}, t("persisted locally label"))), /* @__PURE__ */ React7.createElement(Tooltip.Portal, null, /* @__PURE__ */ React7.createElement(Tooltip.Content, {
|
|
880
861
|
classNames: "z-10"
|
|
881
|
-
}, t("persisted locally message"), /* @__PURE__ */
|
|
862
|
+
}, t("persisted locally message"), /* @__PURE__ */ React7.createElement(Tooltip.Arrow, null))));
|
|
882
863
|
}
|
|
883
864
|
};
|
|
884
865
|
|
|
885
866
|
// packages/plugins/plugin-space/src/components/PopoverRenameObject.tsx
|
|
886
|
-
import
|
|
867
|
+
import React8, { useCallback, useRef, useState as useState4 } from "react";
|
|
887
868
|
import { log } from "@dxos/log";
|
|
888
|
-
import { Button as Button2, Input, Popover, useTranslation as
|
|
869
|
+
import { Button as Button2, Input as Input2, Popover, useTranslation as useTranslation8 } from "@dxos/react-ui";
|
|
889
870
|
var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/PopoverRenameObject.tsx";
|
|
890
871
|
var PopoverRenameObject = ({ object: obj }) => {
|
|
891
|
-
const { t } =
|
|
872
|
+
const { t } = useTranslation8(SPACE_PLUGIN);
|
|
892
873
|
const doneButton = useRef(null);
|
|
893
874
|
const object = obj;
|
|
894
875
|
const [name, setName] = useState4(object.name || object.title || "");
|
|
@@ -913,23 +894,23 @@ var PopoverRenameObject = ({ object: obj }) => {
|
|
|
913
894
|
object,
|
|
914
895
|
name
|
|
915
896
|
]);
|
|
916
|
-
return /* @__PURE__ */
|
|
897
|
+
return /* @__PURE__ */ React8.createElement("div", {
|
|
917
898
|
role: "none",
|
|
918
899
|
className: "p-1 flex gap-2"
|
|
919
|
-
}, /* @__PURE__ */
|
|
900
|
+
}, /* @__PURE__ */ React8.createElement("div", {
|
|
920
901
|
role: "none",
|
|
921
902
|
className: "flex-1"
|
|
922
|
-
}, /* @__PURE__ */
|
|
903
|
+
}, /* @__PURE__ */ React8.createElement(Input2.Root, null, /* @__PURE__ */ React8.createElement(Input2.Label, {
|
|
923
904
|
srOnly: true
|
|
924
|
-
}, t("object name label")), /* @__PURE__ */
|
|
905
|
+
}, t("object name label")), /* @__PURE__ */ React8.createElement(Input2.TextInput, {
|
|
925
906
|
placeholder: t("object title placeholder"),
|
|
926
907
|
value: name,
|
|
927
908
|
"data-testid": "spacePlugin.renameObject.input",
|
|
928
909
|
onChange: ({ target: { value } }) => setName(value),
|
|
929
910
|
onKeyDown: ({ key }) => key === "Enter" && doneButton.current?.click()
|
|
930
|
-
}))), /* @__PURE__ */
|
|
911
|
+
}))), /* @__PURE__ */ React8.createElement(Popover.Close, {
|
|
931
912
|
asChild: true
|
|
932
|
-
}, /* @__PURE__ */
|
|
913
|
+
}, /* @__PURE__ */ React8.createElement(Button2, {
|
|
933
914
|
ref: doneButton,
|
|
934
915
|
classNames: "self-stretch",
|
|
935
916
|
onClick: handleDone
|
|
@@ -939,10 +920,10 @@ var PopoverRenameObject = ({ object: obj }) => {
|
|
|
939
920
|
};
|
|
940
921
|
|
|
941
922
|
// packages/plugins/plugin-space/src/components/PopoverRenameSpace.tsx
|
|
942
|
-
import
|
|
943
|
-
import { Button as Button3, Input as
|
|
923
|
+
import React9, { useCallback as useCallback2, useRef as useRef2, useState as useState5 } from "react";
|
|
924
|
+
import { Button as Button3, Input as Input3, Popover as Popover2, useTranslation as useTranslation9 } from "@dxos/react-ui";
|
|
944
925
|
var PopoverRenameSpace = ({ space }) => {
|
|
945
|
-
const { t } =
|
|
926
|
+
const { t } = useTranslation9(SPACE_PLUGIN);
|
|
946
927
|
const doneButton = useRef2(null);
|
|
947
928
|
const [name, setName] = useState5(space.properties.name ?? "");
|
|
948
929
|
const handleDone = useCallback2(() => {
|
|
@@ -951,24 +932,24 @@ var PopoverRenameSpace = ({ space }) => {
|
|
|
951
932
|
space,
|
|
952
933
|
name
|
|
953
934
|
]);
|
|
954
|
-
return /* @__PURE__ */
|
|
935
|
+
return /* @__PURE__ */ React9.createElement("div", {
|
|
955
936
|
role: "none",
|
|
956
937
|
className: "p-1 flex gap-2"
|
|
957
|
-
}, /* @__PURE__ */
|
|
938
|
+
}, /* @__PURE__ */ React9.createElement("div", {
|
|
958
939
|
role: "none",
|
|
959
940
|
className: "flex-1"
|
|
960
|
-
}, /* @__PURE__ */
|
|
941
|
+
}, /* @__PURE__ */ React9.createElement(Input3.Root, null, /* @__PURE__ */ React9.createElement(Input3.Label, {
|
|
961
942
|
srOnly: true
|
|
962
|
-
}, t("space name label")), /* @__PURE__ */
|
|
943
|
+
}, t("space name label")), /* @__PURE__ */ React9.createElement(Input3.TextInput, {
|
|
963
944
|
defaultValue: space.properties.name ?? "",
|
|
964
945
|
placeholder: t("unnamed space label"),
|
|
965
946
|
onChange: ({ target: { value } }) => setName(value),
|
|
966
947
|
// TODO(wittjosiah): Ideally this should access the popover context to close the popover.
|
|
967
948
|
// Currently this is not possible because Radix does not expose the popover context.
|
|
968
949
|
onKeyDown: ({ key }) => key === "Enter" && doneButton.current?.click()
|
|
969
|
-
}))), /* @__PURE__ */
|
|
950
|
+
}))), /* @__PURE__ */ React9.createElement(Popover2.Close, {
|
|
970
951
|
asChild: true
|
|
971
|
-
}, /* @__PURE__ */
|
|
952
|
+
}, /* @__PURE__ */ React9.createElement(Button3, {
|
|
972
953
|
ref: doneButton,
|
|
973
954
|
classNames: "self-stretch",
|
|
974
955
|
onClick: handleDone
|
|
@@ -978,12 +959,12 @@ var PopoverRenameSpace = ({ space }) => {
|
|
|
978
959
|
};
|
|
979
960
|
|
|
980
961
|
// packages/plugins/plugin-space/src/components/ShareSpaceButton.tsx
|
|
981
|
-
import
|
|
962
|
+
import React10 from "react";
|
|
982
963
|
import { useIntentDispatcher } from "@dxos/app-framework";
|
|
983
|
-
import { Button as Button4, useTranslation as
|
|
964
|
+
import { Button as Button4, useTranslation as useTranslation10 } from "@dxos/react-ui";
|
|
984
965
|
var ShareSpaceButton = ({ spaceId }) => {
|
|
985
966
|
const dispatch = useIntentDispatcher();
|
|
986
|
-
return /* @__PURE__ */
|
|
967
|
+
return /* @__PURE__ */ React10.createElement(ShareSpaceButtonImpl, {
|
|
987
968
|
onClick: () => dispatch({
|
|
988
969
|
action: SpaceAction.SHARE,
|
|
989
970
|
data: {
|
|
@@ -993,8 +974,8 @@ var ShareSpaceButton = ({ spaceId }) => {
|
|
|
993
974
|
});
|
|
994
975
|
};
|
|
995
976
|
var ShareSpaceButtonImpl = ({ onClick }) => {
|
|
996
|
-
const { t } =
|
|
997
|
-
return /* @__PURE__ */
|
|
977
|
+
const { t } = useTranslation10(SPACE_PLUGIN);
|
|
978
|
+
return /* @__PURE__ */ React10.createElement(Button4, {
|
|
998
979
|
"data-testid": "spacePlugin.shareSpaceButton",
|
|
999
980
|
onClick,
|
|
1000
981
|
classNames: "mli-1"
|
|
@@ -1003,30 +984,30 @@ var ShareSpaceButtonImpl = ({ onClick }) => {
|
|
|
1003
984
|
|
|
1004
985
|
// packages/plugins/plugin-space/src/components/SpaceMain/SpaceMain.tsx
|
|
1005
986
|
import { Command } from "@phosphor-icons/react";
|
|
1006
|
-
import
|
|
987
|
+
import React12 from "react";
|
|
1007
988
|
import { Surface } from "@dxos/app-framework";
|
|
1008
989
|
import { SpaceState as SpaceState2 } from "@dxos/react-client/echo";
|
|
1009
|
-
import {
|
|
1010
|
-
import { getSize as getSize4, mx as
|
|
990
|
+
import { Main, useTranslation as useTranslation12 } from "@dxos/react-ui";
|
|
991
|
+
import { getSize as getSize4, mx as mx6, topbarBlockPaddingStart } from "@dxos/react-ui-theme";
|
|
1011
992
|
import { ClipboardProvider } from "@dxos/shell/react";
|
|
1012
993
|
|
|
1013
994
|
// packages/plugins/plugin-space/src/components/SpaceMain/SpaceMembersSection.tsx
|
|
1014
995
|
import { CaretDown, Check, UserPlus, UsersThree } from "@phosphor-icons/react";
|
|
1015
|
-
import
|
|
996
|
+
import React11, { useCallback as useCallback3, useState as useState6 } from "react";
|
|
1016
997
|
import { LayoutAction, useIntent } from "@dxos/app-framework";
|
|
1017
998
|
import { useMembers, SpaceMember, useSpaceInvitations } from "@dxos/react-client/echo";
|
|
1018
999
|
import { InvitationEncoder } from "@dxos/react-client/invitations";
|
|
1019
1000
|
import { Invitation } from "@dxos/react-client/invitations";
|
|
1020
|
-
import { Button as Button5, ButtonGroup, DropdownMenu as DropdownMenu2, List, useTranslation as
|
|
1021
|
-
import { descriptionText as
|
|
1001
|
+
import { Button as Button5, ButtonGroup, DropdownMenu as DropdownMenu2, List, useTranslation as useTranslation11 } from "@dxos/react-ui";
|
|
1002
|
+
import { descriptionText as descriptionText3, getSize as getSize3, mx as mx5 } from "@dxos/react-ui-theme";
|
|
1022
1003
|
import { InvitationListItem, IdentityListItem } from "@dxos/shell/react";
|
|
1023
1004
|
var activeActionKeyStorageKey = "dxos:react-shell/space-manager/active-action";
|
|
1024
1005
|
var Presence = SpaceMember.PresenceState;
|
|
1025
1006
|
var handleCreateInvitationUrl = (invitationCode) => `${origin}?spaceInvitationCode=${invitationCode}`;
|
|
1026
1007
|
var SpaceMemberList = ({ members }) => {
|
|
1027
|
-
return members.length > 0 ? /* @__PURE__ */
|
|
1008
|
+
return members.length > 0 ? /* @__PURE__ */ React11.createElement(List, {
|
|
1028
1009
|
classNames: "col-start-2 col-end-5 gap-y-1 grid grid-cols-subgrid items-center"
|
|
1029
|
-
}, members.map((member) => /* @__PURE__ */
|
|
1010
|
+
}, members.map((member) => /* @__PURE__ */ React11.createElement(IdentityListItem, {
|
|
1030
1011
|
classNames: "contents",
|
|
1031
1012
|
key: member.identity.identityKey.toHex(),
|
|
1032
1013
|
identity: member.identity,
|
|
@@ -1034,7 +1015,7 @@ var SpaceMemberList = ({ members }) => {
|
|
|
1034
1015
|
}))) : null;
|
|
1035
1016
|
};
|
|
1036
1017
|
var SpaceMembersSection = ({ space }) => {
|
|
1037
|
-
const { t } =
|
|
1018
|
+
const { t } = useTranslation11(SPACE_PLUGIN);
|
|
1038
1019
|
const invitations = useSpaceInvitations(space.key);
|
|
1039
1020
|
const { dispatch } = useIntent();
|
|
1040
1021
|
const handleCloseDialog = () => dispatch({
|
|
@@ -1112,103 +1093,103 @@ var SpaceMembersSection = ({ space }) => {
|
|
|
1112
1093
|
[Presence.ONLINE]: [],
|
|
1113
1094
|
[Presence.OFFLINE]: []
|
|
1114
1095
|
});
|
|
1115
|
-
return /* @__PURE__ */
|
|
1096
|
+
return /* @__PURE__ */ React11.createElement("section", {
|
|
1116
1097
|
className: "mbe-4 col-span-3 grid gap-y-2 grid-cols-subgrid auto-rows-min"
|
|
1117
|
-
}, /* @__PURE__ */
|
|
1098
|
+
}, /* @__PURE__ */ React11.createElement("h2", {
|
|
1118
1099
|
className: "contents"
|
|
1119
|
-
}, /* @__PURE__ */
|
|
1100
|
+
}, /* @__PURE__ */ React11.createElement(UsersThree, {
|
|
1120
1101
|
weight: "duotone",
|
|
1121
|
-
className:
|
|
1122
|
-
}), /* @__PURE__ */
|
|
1102
|
+
className: mx5(getSize3(5), "place-self-center")
|
|
1103
|
+
}), /* @__PURE__ */ React11.createElement("span", {
|
|
1123
1104
|
className: "text-lg col-span-2"
|
|
1124
|
-
}, t("space members label"))), /* @__PURE__ */
|
|
1105
|
+
}, t("space members label"))), /* @__PURE__ */ React11.createElement("h3", {
|
|
1125
1106
|
className: "col-start-2 col-span-3 text-sm italic text-description"
|
|
1126
|
-
}, t("invitations heading")), invitations.length > 0 && /* @__PURE__ */
|
|
1107
|
+
}, t("invitations heading")), invitations.length > 0 && /* @__PURE__ */ React11.createElement(List, {
|
|
1127
1108
|
classNames: "col-start-2 col-span-2 gap-y-2 grid grid-cols-[var(--rail-size)_1fr_var(--rail-action)_var(--rail-action)]"
|
|
1128
|
-
}, invitations.map((invitation) => /* @__PURE__ */
|
|
1109
|
+
}, invitations.map((invitation) => /* @__PURE__ */ React11.createElement(InvitationListItem, {
|
|
1129
1110
|
reverseEffects: true,
|
|
1130
1111
|
classNames: "pis-0 pie-0 gap-0 col-span-4 grid grid-cols-subgrid",
|
|
1131
1112
|
key: invitation.get().invitationId,
|
|
1132
1113
|
invitation,
|
|
1133
1114
|
send: handleInvitationSelect,
|
|
1134
1115
|
createInvitationUrl: handleCreateInvitationUrl
|
|
1135
|
-
}))), /* @__PURE__ */
|
|
1116
|
+
}))), /* @__PURE__ */ React11.createElement(ButtonGroup, {
|
|
1136
1117
|
classNames: "col-start-2 col-end-4 grid grid-cols-[1fr_var(--rail-action)] place-self-grow gap-px"
|
|
1137
|
-
}, /* @__PURE__ */
|
|
1118
|
+
}, /* @__PURE__ */ React11.createElement(Button5, {
|
|
1138
1119
|
classNames: "gap-2",
|
|
1139
1120
|
onClick: activeAction.onClick
|
|
1140
|
-
}, /* @__PURE__ */
|
|
1121
|
+
}, /* @__PURE__ */ React11.createElement(activeAction.icon, {
|
|
1141
1122
|
className: getSize3(5)
|
|
1142
|
-
}), /* @__PURE__ */
|
|
1123
|
+
}), /* @__PURE__ */ React11.createElement("span", null, t(activeAction.label, {
|
|
1143
1124
|
ns: "os"
|
|
1144
|
-
}))), /* @__PURE__ */
|
|
1125
|
+
}))), /* @__PURE__ */ React11.createElement(DropdownMenu2.Root, null, /* @__PURE__ */ React11.createElement(DropdownMenu2.Trigger, {
|
|
1145
1126
|
asChild: true
|
|
1146
|
-
}, /* @__PURE__ */
|
|
1127
|
+
}, /* @__PURE__ */ React11.createElement(Button5, {
|
|
1147
1128
|
classNames: "pli-0"
|
|
1148
|
-
}, /* @__PURE__ */
|
|
1129
|
+
}, /* @__PURE__ */ React11.createElement(CaretDown, {
|
|
1149
1130
|
className: getSize3(4)
|
|
1150
|
-
}))), /* @__PURE__ */
|
|
1151
|
-
return /* @__PURE__ */
|
|
1131
|
+
}))), /* @__PURE__ */ React11.createElement(DropdownMenu2.Content, null, /* @__PURE__ */ React11.createElement(DropdownMenu2.Viewport, null, Object.entries(inviteActions).map(([id, action]) => {
|
|
1132
|
+
return /* @__PURE__ */ React11.createElement(DropdownMenu2.CheckboxItem, {
|
|
1152
1133
|
key: id,
|
|
1153
1134
|
"aria-labelledby": `${id}__label`,
|
|
1154
1135
|
"aria-describedby": `${id}__description`,
|
|
1155
1136
|
checked: activeActionKey === id,
|
|
1156
1137
|
onCheckedChange: (checked) => checked && setActiveActionKey(id),
|
|
1157
1138
|
classNames: "gap-2"
|
|
1158
|
-
}, action.icon && /* @__PURE__ */
|
|
1139
|
+
}, action.icon && /* @__PURE__ */ React11.createElement(action.icon, {
|
|
1159
1140
|
className: getSize3(5)
|
|
1160
|
-
}), /* @__PURE__ */
|
|
1141
|
+
}), /* @__PURE__ */ React11.createElement("div", {
|
|
1161
1142
|
role: "none",
|
|
1162
1143
|
className: "flex-1 min-is-0 space-b-1"
|
|
1163
|
-
}, /* @__PURE__ */
|
|
1144
|
+
}, /* @__PURE__ */ React11.createElement("p", {
|
|
1164
1145
|
id: `${id}__label`
|
|
1165
1146
|
}, t(action.label, {
|
|
1166
1147
|
ns: "os"
|
|
1167
|
-
})), action.description && /* @__PURE__ */
|
|
1148
|
+
})), action.description && /* @__PURE__ */ React11.createElement("p", {
|
|
1168
1149
|
id: `${id}__description`,
|
|
1169
|
-
className:
|
|
1150
|
+
className: descriptionText3
|
|
1170
1151
|
}, t(action.description, {
|
|
1171
1152
|
ns: "os"
|
|
1172
|
-
}))), /* @__PURE__ */
|
|
1153
|
+
}))), /* @__PURE__ */ React11.createElement(DropdownMenu2.ItemIndicator, {
|
|
1173
1154
|
asChild: true
|
|
1174
|
-
}, /* @__PURE__ */
|
|
1155
|
+
}, /* @__PURE__ */ React11.createElement(Check, {
|
|
1175
1156
|
className: getSize3(4)
|
|
1176
1157
|
})));
|
|
1177
|
-
})), /* @__PURE__ */
|
|
1178
|
-
className:
|
|
1158
|
+
})), /* @__PURE__ */ React11.createElement(DropdownMenu2.Arrow, null)))), members[Presence.ONLINE].length + members[Presence.OFFLINE].length < 1 ? /* @__PURE__ */ React11.createElement("p", {
|
|
1159
|
+
className: mx5(descriptionText3, "text-center is-full mlb-2")
|
|
1179
1160
|
}, t("empty space members message", {
|
|
1180
1161
|
ns: "os"
|
|
1181
|
-
})) : /* @__PURE__ */
|
|
1162
|
+
})) : /* @__PURE__ */ React11.createElement(React11.Fragment, null, /* @__PURE__ */ React11.createElement("h3", {
|
|
1182
1163
|
className: "col-start-2 col-end-5 text-sm italic text-description"
|
|
1183
1164
|
}, t("active space members heading", {
|
|
1184
1165
|
count: members[Presence.ONLINE].length
|
|
1185
|
-
})), /* @__PURE__ */
|
|
1166
|
+
})), /* @__PURE__ */ React11.createElement(SpaceMemberList, {
|
|
1186
1167
|
members: members[Presence.ONLINE]
|
|
1187
|
-
}), /* @__PURE__ */
|
|
1168
|
+
}), /* @__PURE__ */ React11.createElement("h3", {
|
|
1188
1169
|
className: "col-start-2 col-end-5 text-sm italic text-description"
|
|
1189
1170
|
}, t("inactive space members heading", {
|
|
1190
1171
|
count: members[Presence.OFFLINE].length
|
|
1191
|
-
})), /* @__PURE__ */
|
|
1172
|
+
})), /* @__PURE__ */ React11.createElement(SpaceMemberList, {
|
|
1192
1173
|
members: members[Presence.OFFLINE]
|
|
1193
1174
|
})));
|
|
1194
1175
|
};
|
|
1195
1176
|
|
|
1196
1177
|
// packages/plugins/plugin-space/src/components/SpaceMain/SpaceMain.tsx
|
|
1197
1178
|
var KeyShortcuts = () => {
|
|
1198
|
-
const { t } =
|
|
1199
|
-
return /* @__PURE__ */
|
|
1179
|
+
const { t } = useTranslation12(SPACE_PLUGIN);
|
|
1180
|
+
return /* @__PURE__ */ React12.createElement("section", {
|
|
1200
1181
|
className: "mbe-4 col-span-4 md:col-start-5 md:col-end-7 grid grid-cols-subgrid gap-y-2 auto-rows-min"
|
|
1201
|
-
}, /* @__PURE__ */
|
|
1182
|
+
}, /* @__PURE__ */ React12.createElement("h2", {
|
|
1202
1183
|
className: "contents"
|
|
1203
|
-
}, /* @__PURE__ */
|
|
1184
|
+
}, /* @__PURE__ */ React12.createElement(Command, {
|
|
1204
1185
|
weight: "duotone",
|
|
1205
|
-
className:
|
|
1206
|
-
}), /* @__PURE__ */
|
|
1186
|
+
className: mx6(getSize4(5), "place-self-center")
|
|
1187
|
+
}), /* @__PURE__ */ React12.createElement("span", {
|
|
1207
1188
|
className: "text-lg col-span-2 md:col-span-1"
|
|
1208
|
-
}, t("keyshortcuts label"))), /* @__PURE__ */
|
|
1189
|
+
}, t("keyshortcuts label"))), /* @__PURE__ */ React12.createElement("div", {
|
|
1209
1190
|
role: "none",
|
|
1210
1191
|
className: "col-start-2 col-end-4 md:col-end-5 pie-2"
|
|
1211
|
-
}, /* @__PURE__ */
|
|
1192
|
+
}, /* @__PURE__ */ React12.createElement(Surface, {
|
|
1212
1193
|
role: "keyshortcuts"
|
|
1213
1194
|
})));
|
|
1214
1195
|
};
|
|
@@ -1217,7 +1198,7 @@ var SpaceMain = ({ space, role }) => {
|
|
|
1217
1198
|
const state = space.state.get();
|
|
1218
1199
|
const ready = state === SpaceState2.SPACE_READY;
|
|
1219
1200
|
const Root = role === "main" ? Main.Content : "div";
|
|
1220
|
-
return /* @__PURE__ */
|
|
1201
|
+
return /* @__PURE__ */ React12.createElement(ClipboardProvider, null, /* @__PURE__ */ React12.createElement(Root, {
|
|
1221
1202
|
...role === "main" ? {
|
|
1222
1203
|
classNames: [
|
|
1223
1204
|
topbarBlockPaddingStart,
|
|
@@ -1226,23 +1207,23 @@ var SpaceMain = ({ space, role }) => {
|
|
|
1226
1207
|
]
|
|
1227
1208
|
} : {
|
|
1228
1209
|
role: "none",
|
|
1229
|
-
className:
|
|
1210
|
+
className: mx6(topbarBlockPaddingStart, "row-span-2", spaceMainLayout)
|
|
1230
1211
|
},
|
|
1231
1212
|
"data-testid": `spacePlugin.${role}`,
|
|
1232
1213
|
"data-isready": ready ? "true" : "false"
|
|
1233
|
-
}, ready && /* @__PURE__ */
|
|
1214
|
+
}, ready && /* @__PURE__ */ React12.createElement(SpaceMembersSection, {
|
|
1234
1215
|
space
|
|
1235
|
-
}), /* @__PURE__ */
|
|
1216
|
+
}), /* @__PURE__ */ React12.createElement(KeyShortcuts, null)));
|
|
1236
1217
|
};
|
|
1237
1218
|
|
|
1238
1219
|
// packages/plugins/plugin-space/src/components/SpacePresence.tsx
|
|
1239
|
-
import
|
|
1220
|
+
import React13, { useCallback as useCallback4, useEffect as useEffect4, useState as useState7 } from "react";
|
|
1240
1221
|
import { usePlugin } from "@dxos/app-framework";
|
|
1241
1222
|
import { generateName } from "@dxos/display-name";
|
|
1242
1223
|
import { PublicKey, useClient as useClient3 } from "@dxos/react-client";
|
|
1243
1224
|
import { getSpace as getSpace3, useMembers as useMembers2, fullyQualifiedId as fullyQualifiedId3 } from "@dxos/react-client/echo";
|
|
1244
1225
|
import { useIdentity } from "@dxos/react-client/halo";
|
|
1245
|
-
import { Avatar, AvatarGroup, AvatarGroupItem, Tooltip as Tooltip2, useDensityContext, useTranslation as
|
|
1226
|
+
import { Avatar, AvatarGroup, AvatarGroupItem, Tooltip as Tooltip2, useDensityContext, useTranslation as useTranslation13, List as List2, ListItem, useDefaultValue } from "@dxos/react-ui";
|
|
1246
1227
|
import { AttentionGlyph } from "@dxos/react-ui-attention";
|
|
1247
1228
|
import { ComplexMap, keyToFallback } from "@dxos/util";
|
|
1248
1229
|
var REFRESH_INTERVAL = 5e3;
|
|
@@ -1280,50 +1261,50 @@ var SpacePresence = ({ object, spaceKey }) => {
|
|
|
1280
1261
|
lastSeen
|
|
1281
1262
|
};
|
|
1282
1263
|
}).toSorted((a, b) => a.lastSeen - b.lastSeen);
|
|
1283
|
-
return density === "fine" ? /* @__PURE__ */
|
|
1264
|
+
return density === "fine" ? /* @__PURE__ */ React13.createElement(SmallPresence, {
|
|
1284
1265
|
count: membersForObject.length
|
|
1285
|
-
}) : /* @__PURE__ */
|
|
1266
|
+
}) : /* @__PURE__ */ React13.createElement(FullPresence, {
|
|
1286
1267
|
members: membersForObject
|
|
1287
1268
|
});
|
|
1288
1269
|
};
|
|
1289
1270
|
var FullPresence = (props) => {
|
|
1290
1271
|
const { size = 9, onMemberClick } = props;
|
|
1291
|
-
const members = useDefaultValue(props.members, []);
|
|
1272
|
+
const members = useDefaultValue(props.members, () => []);
|
|
1292
1273
|
if (members.length === 0) {
|
|
1293
1274
|
return null;
|
|
1294
1275
|
}
|
|
1295
|
-
return /* @__PURE__ */
|
|
1276
|
+
return /* @__PURE__ */ React13.createElement(AvatarGroup.Root, {
|
|
1296
1277
|
size,
|
|
1297
1278
|
classNames: "mbs-2 mie-4",
|
|
1298
1279
|
"data-testid": "spacePlugin.presence"
|
|
1299
|
-
}, members.slice(0, 3).map((member, i) => /* @__PURE__ */
|
|
1280
|
+
}, members.slice(0, 3).map((member, i) => /* @__PURE__ */ React13.createElement(Tooltip2.Root, {
|
|
1300
1281
|
key: member.identity.identityKey.toHex()
|
|
1301
|
-
}, /* @__PURE__ */
|
|
1282
|
+
}, /* @__PURE__ */ React13.createElement(Tooltip2.Trigger, null, /* @__PURE__ */ React13.createElement(PrensenceAvatar, {
|
|
1302
1283
|
identity: member.identity,
|
|
1303
1284
|
group: true,
|
|
1304
1285
|
match: member.currentlyAttended,
|
|
1305
1286
|
index: members.length - i,
|
|
1306
1287
|
onClick: () => onMemberClick?.(member)
|
|
1307
|
-
})), /* @__PURE__ */
|
|
1288
|
+
})), /* @__PURE__ */ React13.createElement(Tooltip2.Portal, null, /* @__PURE__ */ React13.createElement(Tooltip2.Content, {
|
|
1308
1289
|
side: "bottom"
|
|
1309
|
-
}, /* @__PURE__ */
|
|
1290
|
+
}, /* @__PURE__ */ React13.createElement("span", null, getName(member.identity)), /* @__PURE__ */ React13.createElement(Tooltip2.Arrow, null))))), members.length > 3 && /* @__PURE__ */ React13.createElement(Tooltip2.Root, null, /* @__PURE__ */ React13.createElement(Tooltip2.Trigger, null, /* @__PURE__ */ React13.createElement(AvatarGroupItem.Root, {
|
|
1310
1291
|
status: "inactive"
|
|
1311
|
-
}, /* @__PURE__ */
|
|
1292
|
+
}, /* @__PURE__ */ React13.createElement(Avatar.Frame, {
|
|
1312
1293
|
style: {
|
|
1313
1294
|
zIndex: members.length - 4
|
|
1314
1295
|
}
|
|
1315
|
-
}, /* @__PURE__ */
|
|
1296
|
+
}, /* @__PURE__ */ React13.createElement(Avatar.Fallback, {
|
|
1316
1297
|
text: `+${members.length - 3}`
|
|
1317
|
-
})))), /* @__PURE__ */
|
|
1298
|
+
})))), /* @__PURE__ */ React13.createElement(Tooltip2.Portal, null, /* @__PURE__ */ React13.createElement(Tooltip2.Content, {
|
|
1318
1299
|
side: "bottom"
|
|
1319
|
-
}, /* @__PURE__ */
|
|
1300
|
+
}, /* @__PURE__ */ React13.createElement(Tooltip2.Arrow, null), /* @__PURE__ */ React13.createElement(List2, {
|
|
1320
1301
|
classNames: "max-h-56 overflow-y-auto"
|
|
1321
|
-
}, members.map((member) => /* @__PURE__ */
|
|
1302
|
+
}, members.map((member) => /* @__PURE__ */ React13.createElement(ListItem.Root, {
|
|
1322
1303
|
key: member.identity.identityKey.toHex(),
|
|
1323
1304
|
classNames: "flex gap-2 items-center cursor-pointer mbe-2",
|
|
1324
1305
|
onClick: () => onMemberClick?.(member),
|
|
1325
1306
|
"data-testid": "identity-list-item"
|
|
1326
|
-
}, /* @__PURE__ */
|
|
1307
|
+
}, /* @__PURE__ */ React13.createElement(PrensenceAvatar, {
|
|
1327
1308
|
identity: member.identity,
|
|
1328
1309
|
showName: true,
|
|
1329
1310
|
match: member.currentlyAttended
|
|
@@ -1333,10 +1314,10 @@ var PrensenceAvatar = ({ identity, showName, match, group, index, onClick }) =>
|
|
|
1333
1314
|
const Root = group ? AvatarGroupItem.Root : Avatar.Root;
|
|
1334
1315
|
const status = match ? "current" : "active";
|
|
1335
1316
|
const fallbackValue = keyToFallback(identity.identityKey);
|
|
1336
|
-
return /* @__PURE__ */
|
|
1317
|
+
return /* @__PURE__ */ React13.createElement(Root, {
|
|
1337
1318
|
status,
|
|
1338
1319
|
hue: identity.profile?.data?.hue || fallbackValue.hue
|
|
1339
|
-
}, /* @__PURE__ */
|
|
1320
|
+
}, /* @__PURE__ */ React13.createElement(Avatar.Frame, {
|
|
1340
1321
|
"data-testid": "spacePlugin.presence.member",
|
|
1341
1322
|
"data-status": status,
|
|
1342
1323
|
...index ? {
|
|
@@ -1345,9 +1326,9 @@ var PrensenceAvatar = ({ identity, showName, match, group, index, onClick }) =>
|
|
|
1345
1326
|
}
|
|
1346
1327
|
} : {},
|
|
1347
1328
|
onClick: () => onClick?.()
|
|
1348
|
-
}, /* @__PURE__ */
|
|
1329
|
+
}, /* @__PURE__ */ React13.createElement(Avatar.Fallback, {
|
|
1349
1330
|
text: identity.profile?.data?.emoji || fallbackValue.emoji
|
|
1350
|
-
})), showName && /* @__PURE__ */
|
|
1331
|
+
})), showName && /* @__PURE__ */ React13.createElement(Avatar.Label, {
|
|
1351
1332
|
classNames: "text-sm truncate pli-2"
|
|
1352
1333
|
}, getName(identity)));
|
|
1353
1334
|
};
|
|
@@ -1358,36 +1339,37 @@ var SmallPresenceLive = ({ viewers }) => {
|
|
|
1358
1339
|
return () => clearInterval(interval);
|
|
1359
1340
|
}, []);
|
|
1360
1341
|
const activeViewers = viewers ? Array.from(viewers.values()).filter(({ lastSeen }) => moment - lastSeen < ACTIVITY_DURATION) : [];
|
|
1361
|
-
return /* @__PURE__ */
|
|
1342
|
+
return /* @__PURE__ */ React13.createElement(SmallPresence, {
|
|
1362
1343
|
count: activeViewers.length
|
|
1363
1344
|
});
|
|
1364
1345
|
};
|
|
1365
1346
|
var SmallPresence = ({ count }) => {
|
|
1366
|
-
const { t } =
|
|
1367
|
-
return /* @__PURE__ */
|
|
1347
|
+
const { t } = useTranslation13(SPACE_PLUGIN);
|
|
1348
|
+
return /* @__PURE__ */ React13.createElement(Tooltip2.Root, null, /* @__PURE__ */ React13.createElement(Tooltip2.Trigger, {
|
|
1368
1349
|
asChild: true
|
|
1369
|
-
}, /* @__PURE__ */
|
|
1350
|
+
}, /* @__PURE__ */ React13.createElement(AttentionGlyph, {
|
|
1370
1351
|
presence: count > 1 ? "many" : count === 1 ? "one" : "none",
|
|
1371
1352
|
classNames: "self-center mie-1"
|
|
1372
|
-
})), /* @__PURE__ */
|
|
1353
|
+
})), /* @__PURE__ */ React13.createElement(Tooltip2.Portal, null, /* @__PURE__ */ React13.createElement(Tooltip2.Content, {
|
|
1373
1354
|
side: "bottom",
|
|
1374
1355
|
classNames: "z-[70]"
|
|
1375
|
-
}, /* @__PURE__ */
|
|
1356
|
+
}, /* @__PURE__ */ React13.createElement("span", null, t("presence label", {
|
|
1376
1357
|
count
|
|
1377
|
-
})), /* @__PURE__ */
|
|
1358
|
+
})), /* @__PURE__ */ React13.createElement(Tooltip2.Arrow, null))));
|
|
1378
1359
|
};
|
|
1379
1360
|
|
|
1380
1361
|
// packages/plugins/plugin-space/src/components/SpaceSettings.tsx
|
|
1381
|
-
import
|
|
1382
|
-
import { useIntentDispatcher as useIntentDispatcher2 } from "@dxos/app-framework";
|
|
1362
|
+
import React14 from "react";
|
|
1363
|
+
import { useIntentDispatcher as useIntentDispatcher2, useResolvePlugins } from "@dxos/app-framework";
|
|
1383
1364
|
import { SettingsValue } from "@dxos/plugin-settings";
|
|
1384
|
-
import { Input as
|
|
1365
|
+
import { Input as Input4, Select, toLocalizedString as toLocalizedString2, useTranslation as useTranslation14 } from "@dxos/react-ui";
|
|
1385
1366
|
var SpaceSettings = ({ settings }) => {
|
|
1386
|
-
const { t } =
|
|
1367
|
+
const { t } = useTranslation14(SPACE_PLUGIN);
|
|
1387
1368
|
const dispatch = useIntentDispatcher2();
|
|
1388
|
-
|
|
1369
|
+
const plugins = useResolvePlugins(parseSpaceInitPlugin);
|
|
1370
|
+
return /* @__PURE__ */ React14.createElement(React14.Fragment, null, /* @__PURE__ */ React14.createElement(SettingsValue, {
|
|
1389
1371
|
label: t("show hidden spaces label")
|
|
1390
|
-
}, /* @__PURE__ */
|
|
1372
|
+
}, /* @__PURE__ */ React14.createElement(Input4.Switch, {
|
|
1391
1373
|
checked: settings.showHidden,
|
|
1392
1374
|
onCheckedChange: (checked) => dispatch({
|
|
1393
1375
|
plugin: SPACE_PLUGIN,
|
|
@@ -1396,7 +1378,307 @@ var SpaceSettings = ({ settings }) => {
|
|
|
1396
1378
|
state: !!checked
|
|
1397
1379
|
}
|
|
1398
1380
|
})
|
|
1399
|
-
}))
|
|
1381
|
+
})), /* @__PURE__ */ React14.createElement(SettingsValue, {
|
|
1382
|
+
label: t("default on space create label")
|
|
1383
|
+
}, /* @__PURE__ */ React14.createElement(Select.Root, {
|
|
1384
|
+
value: settings.onSpaceCreate,
|
|
1385
|
+
onValueChange: (value) => {
|
|
1386
|
+
settings.onSpaceCreate = value;
|
|
1387
|
+
}
|
|
1388
|
+
}, /* @__PURE__ */ React14.createElement(Select.TriggerButton, null), /* @__PURE__ */ React14.createElement(Select.Portal, null, /* @__PURE__ */ React14.createElement(Select.Content, null, /* @__PURE__ */ React14.createElement(Select.Viewport, null, plugins.map(({ provides: { space: { onSpaceCreate } } }) => /* @__PURE__ */ React14.createElement(Select.Option, {
|
|
1389
|
+
key: onSpaceCreate.action,
|
|
1390
|
+
value: onSpaceCreate.action
|
|
1391
|
+
}, toLocalizedString2(onSpaceCreate.label, t)))))))));
|
|
1392
|
+
};
|
|
1393
|
+
|
|
1394
|
+
// packages/plugins/plugin-space/src/components/SaveStatus.tsx
|
|
1395
|
+
import React15, { useEffect as useEffect5, useState as useState8 } from "react";
|
|
1396
|
+
import { Context } from "@dxos/context";
|
|
1397
|
+
import { StatusBar } from "@dxos/plugin-status-bar";
|
|
1398
|
+
import { useClient as useClient4 } from "@dxos/react-client";
|
|
1399
|
+
import { Icon, useTranslation as useTranslation15 } from "@dxos/react-ui";
|
|
1400
|
+
var __dxlog_file3 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/SaveStatus.tsx";
|
|
1401
|
+
var SaveStatus = () => {
|
|
1402
|
+
const { t } = useTranslation15(SPACE_PLUGIN);
|
|
1403
|
+
const client = useClient4();
|
|
1404
|
+
const [state, setState] = useState8("saved");
|
|
1405
|
+
useEffect5(() => {
|
|
1406
|
+
return createClientSaveTracker(client, (state2) => {
|
|
1407
|
+
setState(state2);
|
|
1408
|
+
});
|
|
1409
|
+
}, []);
|
|
1410
|
+
return /* @__PURE__ */ React15.createElement(StatusBar.Item, {
|
|
1411
|
+
title: state === "saving" ? t("saving label") : t("saved label")
|
|
1412
|
+
}, /* @__PURE__ */ React15.createElement(Icon, {
|
|
1413
|
+
icon: state === "saving" ? "ph--arrows-clockwise--regular" : "ph--check-circle--regular",
|
|
1414
|
+
size: 4
|
|
1415
|
+
}));
|
|
1416
|
+
};
|
|
1417
|
+
var createClientSaveTracker = (client, cb) => {
|
|
1418
|
+
const unsubscribeCallbacks = {};
|
|
1419
|
+
const state = {};
|
|
1420
|
+
const install = (spaces) => {
|
|
1421
|
+
for (const space of spaces) {
|
|
1422
|
+
if (state[space.id]) {
|
|
1423
|
+
continue;
|
|
1424
|
+
}
|
|
1425
|
+
state[space.id] = "saved";
|
|
1426
|
+
unsubscribeCallbacks[space.id] = createSpaceSaveTracker(space, (s) => {
|
|
1427
|
+
state[space.id] = s;
|
|
1428
|
+
cb(Object.values(state).some((s2) => s2 === "saving") ? "saving" : "saved");
|
|
1429
|
+
});
|
|
1430
|
+
}
|
|
1431
|
+
};
|
|
1432
|
+
client.spaces.subscribe((spaces) => {
|
|
1433
|
+
install(spaces);
|
|
1434
|
+
});
|
|
1435
|
+
install(client.spaces.get());
|
|
1436
|
+
return () => {
|
|
1437
|
+
for (const unsubscribe of Object.values(unsubscribeCallbacks)) {
|
|
1438
|
+
unsubscribe();
|
|
1439
|
+
}
|
|
1440
|
+
};
|
|
1441
|
+
};
|
|
1442
|
+
var createSpaceSaveTracker = (space, cb) => {
|
|
1443
|
+
const ctx = new Context(void 0, {
|
|
1444
|
+
F: __dxlog_file3,
|
|
1445
|
+
L: 64
|
|
1446
|
+
});
|
|
1447
|
+
void space.waitUntilReady().then(() => {
|
|
1448
|
+
if (ctx.disposed) {
|
|
1449
|
+
return;
|
|
1450
|
+
}
|
|
1451
|
+
let hasUnsavedChanges = false;
|
|
1452
|
+
let lastFlushPromise;
|
|
1453
|
+
space.crud.saveStateChanged.on(ctx, ({ unsavedDocuments }) => {
|
|
1454
|
+
hasUnsavedChanges = unsavedDocuments.length > 0;
|
|
1455
|
+
});
|
|
1456
|
+
space.crud.saveStateChanged.debounce(500).on(ctx, () => {
|
|
1457
|
+
if (hasUnsavedChanges) {
|
|
1458
|
+
lastFlushPromise = void 0;
|
|
1459
|
+
cb("saving");
|
|
1460
|
+
} else {
|
|
1461
|
+
const flushPromise = space.crud.flush();
|
|
1462
|
+
lastFlushPromise = flushPromise;
|
|
1463
|
+
void flushPromise.then(() => {
|
|
1464
|
+
if (lastFlushPromise === flushPromise) {
|
|
1465
|
+
cb("saved");
|
|
1466
|
+
}
|
|
1467
|
+
});
|
|
1468
|
+
}
|
|
1469
|
+
});
|
|
1470
|
+
});
|
|
1471
|
+
return () => {
|
|
1472
|
+
void ctx.dispose();
|
|
1473
|
+
};
|
|
1474
|
+
};
|
|
1475
|
+
|
|
1476
|
+
// packages/plugins/plugin-space/src/components/SyncStatus/SyncStatus.tsx
|
|
1477
|
+
import React16, { useEffect as useEffect7, useState as useState10 } from "react";
|
|
1478
|
+
import { StatusBar as StatusBar2 } from "@dxos/plugin-status-bar";
|
|
1479
|
+
import { Icon as Icon2, Popover as Popover3, useTranslation as useTranslation16 } from "@dxos/react-ui";
|
|
1480
|
+
import { SyntaxHighlighter } from "@dxos/react-ui-syntax-highlighter";
|
|
1481
|
+
import { mx as mx7 } from "@dxos/react-ui-theme";
|
|
1482
|
+
|
|
1483
|
+
// packages/plugins/plugin-space/src/components/SyncStatus/types.ts
|
|
1484
|
+
import { useEffect as useEffect6, useState as useState9 } from "react";
|
|
1485
|
+
import { Context as Context2 } from "@dxos/context";
|
|
1486
|
+
import { EdgeService } from "@dxos/protocols";
|
|
1487
|
+
import { useClient as useClient5 } from "@dxos/react-client";
|
|
1488
|
+
var __dxlog_file4 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/SyncStatus/types.ts";
|
|
1489
|
+
var createEmptyEdgeSyncState = () => ({
|
|
1490
|
+
missingOnLocal: 0,
|
|
1491
|
+
missingOnRemote: 0,
|
|
1492
|
+
localDocumentCount: 0,
|
|
1493
|
+
remoteDocumentCount: 0,
|
|
1494
|
+
differentDocuments: 0
|
|
1495
|
+
});
|
|
1496
|
+
var getSyncSummary = (syncMap) => {
|
|
1497
|
+
return Object.entries(syncMap).reduce((summary, [_spaceId, peerState]) => {
|
|
1498
|
+
summary.missingOnLocal += peerState.missingOnLocal;
|
|
1499
|
+
summary.missingOnRemote += peerState.missingOnRemote;
|
|
1500
|
+
summary.localDocumentCount += peerState.localDocumentCount;
|
|
1501
|
+
summary.remoteDocumentCount += peerState.remoteDocumentCount;
|
|
1502
|
+
summary.differentDocuments += peerState.differentDocuments;
|
|
1503
|
+
return summary;
|
|
1504
|
+
}, createEmptyEdgeSyncState());
|
|
1505
|
+
};
|
|
1506
|
+
var isEdgePeerId = (peerId, spaceId) => peerId.startsWith(`${EdgeService.AUTOMERGE_REPLICATOR}:${spaceId}`);
|
|
1507
|
+
var useSyncState = () => {
|
|
1508
|
+
const client = useClient5();
|
|
1509
|
+
const [spaceState, setSpaceState] = useState9({});
|
|
1510
|
+
useEffect6(() => {
|
|
1511
|
+
const ctx = new Context2(void 0, {
|
|
1512
|
+
F: __dxlog_file4,
|
|
1513
|
+
L: 48
|
|
1514
|
+
});
|
|
1515
|
+
const createSubscriptions = (spaces) => {
|
|
1516
|
+
for (const space of spaces) {
|
|
1517
|
+
if (spaceState[space.id]) {
|
|
1518
|
+
continue;
|
|
1519
|
+
}
|
|
1520
|
+
ctx.onDispose(space.crud.subscribeToSyncState(ctx, ({ peers = [] }) => {
|
|
1521
|
+
const syncState = peers.find((state) => isEdgePeerId(state.peerId, space.id));
|
|
1522
|
+
if (syncState) {
|
|
1523
|
+
setSpaceState((spaceState2) => ({
|
|
1524
|
+
...spaceState2,
|
|
1525
|
+
[space.id]: syncState
|
|
1526
|
+
}));
|
|
1527
|
+
}
|
|
1528
|
+
}));
|
|
1529
|
+
}
|
|
1530
|
+
};
|
|
1531
|
+
createSubscriptions(client.spaces.get());
|
|
1532
|
+
client.spaces.subscribe((spaces) => {
|
|
1533
|
+
createSubscriptions(spaces);
|
|
1534
|
+
});
|
|
1535
|
+
return () => {
|
|
1536
|
+
void ctx.dispose();
|
|
1537
|
+
};
|
|
1538
|
+
}, [
|
|
1539
|
+
client
|
|
1540
|
+
]);
|
|
1541
|
+
return spaceState;
|
|
1542
|
+
};
|
|
1543
|
+
|
|
1544
|
+
// packages/plugins/plugin-space/src/components/SyncStatus/SyncStatus.tsx
|
|
1545
|
+
var SYNC_STALLED_TIMEOUT = 5e3;
|
|
1546
|
+
var styles = {
|
|
1547
|
+
barBg: "bg-neutral-50 dark:bg-green-900 text-black",
|
|
1548
|
+
barFg: "bg-neutral-100 bg-green-500",
|
|
1549
|
+
barHover: "dark:hover:bg-green-500"
|
|
1550
|
+
};
|
|
1551
|
+
var SyncStatus = () => {
|
|
1552
|
+
const state = useSyncState();
|
|
1553
|
+
return /* @__PURE__ */ React16.createElement(SyncStatusIndicator, {
|
|
1554
|
+
state
|
|
1555
|
+
});
|
|
1556
|
+
};
|
|
1557
|
+
var SyncStatusIndicator = ({ state }) => {
|
|
1558
|
+
const summary = getSyncSummary(state);
|
|
1559
|
+
const offline = false;
|
|
1560
|
+
const needsToUpload = summary.differentDocuments > 0 || summary.missingOnRemote > 0;
|
|
1561
|
+
const needsToDownload = summary.differentDocuments > 0 || summary.missingOnLocal > 0;
|
|
1562
|
+
const [classNames, setClassNames] = useState10();
|
|
1563
|
+
useEffect7(() => {
|
|
1564
|
+
setClassNames(void 0);
|
|
1565
|
+
if (!needsToUpload && !needsToDownload) {
|
|
1566
|
+
return;
|
|
1567
|
+
}
|
|
1568
|
+
const t = setTimeout(() => {
|
|
1569
|
+
setClassNames("text-orange-500");
|
|
1570
|
+
}, SYNC_STALLED_TIMEOUT);
|
|
1571
|
+
return () => clearTimeout(t);
|
|
1572
|
+
}, [
|
|
1573
|
+
needsToUpload,
|
|
1574
|
+
needsToDownload
|
|
1575
|
+
]);
|
|
1576
|
+
return /* @__PURE__ */ React16.createElement(StatusBar2.Item, null, /* @__PURE__ */ React16.createElement(Popover3.Root, null, /* @__PURE__ */ React16.createElement(Popover3.Trigger, null, /* @__PURE__ */ React16.createElement(Icon2, {
|
|
1577
|
+
icon: offline ? "ph--cloud-x--regular" : needsToUpload ? "ph--cloud-arrow-up--regular" : needsToDownload ? "ph--cloud-arrow-down--regular" : "ph--cloud-check--regular",
|
|
1578
|
+
size: 4,
|
|
1579
|
+
classNames
|
|
1580
|
+
})), /* @__PURE__ */ React16.createElement(Popover3.Content, null, /* @__PURE__ */ React16.createElement(SyncStatusDetail, {
|
|
1581
|
+
state,
|
|
1582
|
+
summary,
|
|
1583
|
+
debug: false
|
|
1584
|
+
}))));
|
|
1585
|
+
};
|
|
1586
|
+
var SyncStatusDetail = ({ classNames, state, summary, debug }) => {
|
|
1587
|
+
const { t } = useTranslation16(SPACE_PLUGIN);
|
|
1588
|
+
const entries = Object.entries(state).sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0);
|
|
1589
|
+
return /* @__PURE__ */ React16.createElement("div", {
|
|
1590
|
+
className: mx7("flex flex-col text-xs min-w-[16rem]", classNames)
|
|
1591
|
+
}, /* @__PURE__ */ React16.createElement("h1", {
|
|
1592
|
+
className: "p-2"
|
|
1593
|
+
}, t("sync status title")), /* @__PURE__ */ React16.createElement("div", {
|
|
1594
|
+
className: "flex flex-col gap-[2px] my-[2px]"
|
|
1595
|
+
}, entries.map(([spaceId, state2]) => /* @__PURE__ */ React16.createElement(SpaceRow, {
|
|
1596
|
+
key: spaceId,
|
|
1597
|
+
spaceId,
|
|
1598
|
+
state: state2
|
|
1599
|
+
}))), debug && /* @__PURE__ */ React16.createElement(SyntaxHighlighter, {
|
|
1600
|
+
language: "json"
|
|
1601
|
+
}, JSON.stringify(summary, null, 2)));
|
|
1602
|
+
};
|
|
1603
|
+
var useActive = (count) => {
|
|
1604
|
+
const [current, setCurrent] = useState10(count);
|
|
1605
|
+
const [active, setActive] = useState10(false);
|
|
1606
|
+
useEffect7(() => {
|
|
1607
|
+
let t;
|
|
1608
|
+
if (count !== current) {
|
|
1609
|
+
setActive(true);
|
|
1610
|
+
setCurrent(count);
|
|
1611
|
+
t && clearTimeout(t);
|
|
1612
|
+
t = setTimeout(() => {
|
|
1613
|
+
setActive(false);
|
|
1614
|
+
}, SYNC_STALLED_TIMEOUT);
|
|
1615
|
+
}
|
|
1616
|
+
return () => {
|
|
1617
|
+
setActive(false);
|
|
1618
|
+
clearTimeout(t);
|
|
1619
|
+
};
|
|
1620
|
+
}, [
|
|
1621
|
+
count,
|
|
1622
|
+
current
|
|
1623
|
+
]);
|
|
1624
|
+
return active;
|
|
1625
|
+
};
|
|
1626
|
+
var SpaceRow = ({ spaceId, state: { localDocumentCount, remoteDocumentCount, missingOnLocal, missingOnRemote } }) => {
|
|
1627
|
+
const downActive = useActive(localDocumentCount);
|
|
1628
|
+
const upActive = useActive(remoteDocumentCount);
|
|
1629
|
+
return /* @__PURE__ */ React16.createElement("div", {
|
|
1630
|
+
className: mx7("flex items-center mx-[2px] gap-[2px] cursor-pointer", styles.barHover),
|
|
1631
|
+
title: spaceId,
|
|
1632
|
+
onClick: () => {
|
|
1633
|
+
void navigator.clipboard.writeText(spaceId);
|
|
1634
|
+
}
|
|
1635
|
+
}, /* @__PURE__ */ React16.createElement(Icon2, {
|
|
1636
|
+
icon: "ph--arrow-fat-line-left--regular",
|
|
1637
|
+
size: 3,
|
|
1638
|
+
classNames: mx7(downActive && "animate-[pulse_1s_infinite]")
|
|
1639
|
+
}), /* @__PURE__ */ React16.createElement(Candle, {
|
|
1640
|
+
up: {
|
|
1641
|
+
count: remoteDocumentCount,
|
|
1642
|
+
total: remoteDocumentCount + missingOnRemote
|
|
1643
|
+
},
|
|
1644
|
+
down: {
|
|
1645
|
+
count: localDocumentCount,
|
|
1646
|
+
total: localDocumentCount + missingOnLocal
|
|
1647
|
+
},
|
|
1648
|
+
title: spaceId
|
|
1649
|
+
}), /* @__PURE__ */ React16.createElement(Icon2, {
|
|
1650
|
+
icon: "ph--arrow-fat-line-right--regular",
|
|
1651
|
+
size: 3,
|
|
1652
|
+
classNames: mx7(upActive && "animate-[pulse_1s_step-start_infinite]")
|
|
1653
|
+
}));
|
|
1654
|
+
};
|
|
1655
|
+
var Candle = ({ classNames, up, down }) => {
|
|
1656
|
+
return /* @__PURE__ */ React16.createElement("div", {
|
|
1657
|
+
className: mx7("grid grid-cols-[1fr_2rem_1fr] w-full h-3", classNames)
|
|
1658
|
+
}, /* @__PURE__ */ React16.createElement(Bar, {
|
|
1659
|
+
classNames: "justify-end",
|
|
1660
|
+
...up
|
|
1661
|
+
}), /* @__PURE__ */ React16.createElement("div", {
|
|
1662
|
+
className: "relative"
|
|
1663
|
+
}, /* @__PURE__ */ React16.createElement("div", {
|
|
1664
|
+
className: mx7("absolute inset-0 flex items-center justify-center text-xs", styles.barBg)
|
|
1665
|
+
}, up.total)), /* @__PURE__ */ React16.createElement(Bar, down));
|
|
1666
|
+
};
|
|
1667
|
+
var Bar = ({ classNames, count, total }) => {
|
|
1668
|
+
let p = count / total * 100;
|
|
1669
|
+
if (count < total) {
|
|
1670
|
+
p = Math.min(p, 95);
|
|
1671
|
+
}
|
|
1672
|
+
return /* @__PURE__ */ React16.createElement("div", {
|
|
1673
|
+
className: mx7("relative flex w-full", styles.barBg, classNames)
|
|
1674
|
+
}, /* @__PURE__ */ React16.createElement("div", {
|
|
1675
|
+
className: mx7("shrink-0", styles.barFg),
|
|
1676
|
+
style: {
|
|
1677
|
+
width: `${p}%`
|
|
1678
|
+
}
|
|
1679
|
+
}), count !== total && /* @__PURE__ */ React16.createElement("div", {
|
|
1680
|
+
className: "absolute top-0 bottom-0 flex items-center mx-0.5 text-black text-xs"
|
|
1681
|
+
}, count));
|
|
1400
1682
|
};
|
|
1401
1683
|
|
|
1402
1684
|
// packages/plugins/plugin-space/src/translations.ts
|
|
@@ -1478,21 +1760,27 @@ var translations_default = [
|
|
|
1478
1760
|
"space limit close label": "Close",
|
|
1479
1761
|
"remove deleted objects label": "Cleanup",
|
|
1480
1762
|
"remove deleted objects alt": "Permanently remove deleted objects to free up space.",
|
|
1481
|
-
"copy link label": "Copy link"
|
|
1763
|
+
"copy link label": "Copy link",
|
|
1764
|
+
"default on space create label": "On space create",
|
|
1765
|
+
"sync status title": "Sync status",
|
|
1766
|
+
"name label": "Name",
|
|
1767
|
+
"name placeholder": "Name"
|
|
1482
1768
|
}
|
|
1483
1769
|
}
|
|
1484
1770
|
}
|
|
1485
1771
|
];
|
|
1486
1772
|
|
|
1487
1773
|
// packages/plugins/plugin-space/src/SpacePlugin.tsx
|
|
1488
|
-
var
|
|
1774
|
+
var __dxlog_file5 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/SpacePlugin.tsx";
|
|
1489
1775
|
var ACTIVE_NODE_BROADCAST_INTERVAL = 3e4;
|
|
1490
1776
|
var OBJECT_ID_LENGTH = 60;
|
|
1491
1777
|
var SPACE_MAX_OBJECTS = 500;
|
|
1492
1778
|
var DIRECTORY_TYPE = "text/directory";
|
|
1493
1779
|
var parseSpacePlugin = (plugin) => Array.isArray(plugin?.provides.space?.enabled) ? plugin : void 0;
|
|
1494
1780
|
var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
1495
|
-
const settings = new LocalStorageStore(SPACE_PLUGIN
|
|
1781
|
+
const settings = new LocalStorageStore(SPACE_PLUGIN, {
|
|
1782
|
+
onSpaceCreate: "dxos.org/plugin/markdown/action/create"
|
|
1783
|
+
});
|
|
1496
1784
|
const state = new LocalStorageStore(SPACE_PLUGIN, {
|
|
1497
1785
|
awaiting: void 0,
|
|
1498
1786
|
spaceNames: {},
|
|
@@ -1532,17 +1820,21 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
1532
1820
|
await defaultSpace.internal.migrate();
|
|
1533
1821
|
}
|
|
1534
1822
|
spaces.filter((space) => space.state.get() === SpaceState3.SPACE_READY).forEach((space) => {
|
|
1535
|
-
subscriptions.add(
|
|
1536
|
-
|
|
1537
|
-
}));
|
|
1823
|
+
subscriptions.add(scheduledEffect(() => ({
|
|
1824
|
+
name: space.properties.name
|
|
1825
|
+
}), ({ name }) => state.values.spaceNames[space.id] = name));
|
|
1538
1826
|
});
|
|
1539
1827
|
}).unsubscribe);
|
|
1540
|
-
subscriptions.add(
|
|
1828
|
+
subscriptions.add(scheduledEffect(() => ({
|
|
1829
|
+
ids: openIds(location.active),
|
|
1830
|
+
removed: location.closed ? [
|
|
1831
|
+
location.closed
|
|
1832
|
+
].flat() : []
|
|
1833
|
+
}), ({ ids, removed }) => {
|
|
1541
1834
|
const send = () => {
|
|
1542
1835
|
const spaces = client.spaces.get();
|
|
1543
1836
|
const identity = client.halo.identity.get();
|
|
1544
1837
|
if (identity && location.active) {
|
|
1545
|
-
const ids = openIds(location.active);
|
|
1546
1838
|
const idsBySpace = reduceGroupBy(ids, (id) => {
|
|
1547
1839
|
const [spaceId] = id.split(":");
|
|
1548
1840
|
return spaceId;
|
|
@@ -1557,9 +1849,6 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
1557
1849
|
if (!space) {
|
|
1558
1850
|
continue;
|
|
1559
1851
|
}
|
|
1560
|
-
const removed = location.closed ? [
|
|
1561
|
-
location.closed
|
|
1562
|
-
].flat() : [];
|
|
1563
1852
|
void space.postMessage("viewing", {
|
|
1564
1853
|
identityKey: identity.identityKey.toHex(),
|
|
1565
1854
|
attended: attention.attended ? [
|
|
@@ -1572,8 +1861,8 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
1572
1861
|
log2.warn("Failed to broadcast active node for presence.", {
|
|
1573
1862
|
err: err.message
|
|
1574
1863
|
}, {
|
|
1575
|
-
F:
|
|
1576
|
-
L:
|
|
1864
|
+
F: __dxlog_file5,
|
|
1865
|
+
L: 228,
|
|
1577
1866
|
S: void 0,
|
|
1578
1867
|
C: (f, a) => f(...a)
|
|
1579
1868
|
});
|
|
@@ -1694,8 +1983,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
1694
1983
|
ns: SPACE_PLUGIN
|
|
1695
1984
|
}
|
|
1696
1985
|
],
|
|
1697
|
-
icon:
|
|
1698
|
-
iconSymbol: "ph--cards-three--regular",
|
|
1986
|
+
icon: "ph--cards-three--regular",
|
|
1699
1987
|
// TODO(wittjosiah): Move out of metadata.
|
|
1700
1988
|
loadReferences: (collection) => loadObjectReferences(collection, (collection2) => [
|
|
1701
1989
|
...collection2.objects,
|
|
@@ -1717,7 +2005,8 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
1717
2005
|
case "main":
|
|
1718
2006
|
return isSpace2(primary) && primary.state.get() === SpaceState3.SPACE_READY ? /* @__PURE__ */ React17.createElement(Surface2, {
|
|
1719
2007
|
data: {
|
|
1720
|
-
active: primary.properties[CollectionType.typename]
|
|
2008
|
+
active: primary.properties[CollectionType.typename],
|
|
2009
|
+
id: primary.id
|
|
1721
2010
|
},
|
|
1722
2011
|
role,
|
|
1723
2012
|
...rest
|
|
@@ -1729,16 +2018,10 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
1729
2018
|
} : typeof primary === "string" && primary.length === OBJECT_ID_LENGTH ? /* @__PURE__ */ React17.createElement(MissingObject, {
|
|
1730
2019
|
id: primary
|
|
1731
2020
|
}) : null;
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
return /* @__PURE__ */ React17.createElement(EmptyTree, null);
|
|
1737
|
-
case (isGraphNode(data.activeNode) && isSpace2(data.activeNode.data)):
|
|
1738
|
-
return /* @__PURE__ */ React17.createElement(EmptySpace, null);
|
|
1739
|
-
default:
|
|
1740
|
-
return null;
|
|
1741
|
-
}
|
|
2021
|
+
case "complementary--settings":
|
|
2022
|
+
return isEchoObject2(data.subject) ? /* @__PURE__ */ React17.createElement(FallbackSettings, {
|
|
2023
|
+
object: data.subject
|
|
2024
|
+
}) : null;
|
|
1742
2025
|
case "dialog":
|
|
1743
2026
|
if (data.component === "dxos.org/plugin/space/InvitationManagerDialog") {
|
|
1744
2027
|
return /* @__PURE__ */ React17.createElement(Dialog.Content, null, /* @__PURE__ */ React17.createElement(ClipboardProvider2, null, /* @__PURE__ */ React17.createElement(InvitationManager, {
|
|
@@ -1760,6 +2043,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
1760
2043
|
});
|
|
1761
2044
|
}
|
|
1762
2045
|
return null;
|
|
2046
|
+
// TODO(burdon): Add role name syntax to minimal plugin docs.
|
|
1763
2047
|
case "presence--glyph": {
|
|
1764
2048
|
return isReactiveObject2(data.object) ? /* @__PURE__ */ React17.createElement(SmallPresenceLive, {
|
|
1765
2049
|
viewers: state.values.viewersByObject[fullyQualifiedId4(data.object)]
|
|
@@ -1801,6 +2085,9 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
1801
2085
|
object: data.object
|
|
1802
2086
|
});
|
|
1803
2087
|
}
|
|
2088
|
+
case "status": {
|
|
2089
|
+
return /* @__PURE__ */ React17.createElement(React17.Fragment, null, /* @__PURE__ */ React17.createElement(SyncStatus, null), /* @__PURE__ */ React17.createElement(SaveStatus, null));
|
|
2090
|
+
}
|
|
1804
2091
|
default:
|
|
1805
2092
|
return null;
|
|
1806
2093
|
}
|
|
@@ -1860,8 +2147,8 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
1860
2147
|
spacesOrder.order = nextOrder.map(({ id }) => id);
|
|
1861
2148
|
} else {
|
|
1862
2149
|
log2.warn("spaces order object not found", void 0, {
|
|
1863
|
-
F:
|
|
1864
|
-
L:
|
|
2150
|
+
F: __dxlog_file5,
|
|
2151
|
+
L: 525,
|
|
1865
2152
|
S: void 0,
|
|
1866
2153
|
C: (f, a) => f(...a)
|
|
1867
2154
|
});
|
|
@@ -1897,8 +2184,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
1897
2184
|
ns: SPACE_PLUGIN
|
|
1898
2185
|
}
|
|
1899
2186
|
],
|
|
1900
|
-
icon:
|
|
1901
|
-
iconSymbol: "ph--plus--regular",
|
|
2187
|
+
icon: "ph--plus--regular",
|
|
1902
2188
|
disposition: "toolbar",
|
|
1903
2189
|
testId: "spacePlugin.createSpace"
|
|
1904
2190
|
}
|
|
@@ -1923,8 +2209,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
1923
2209
|
ns: SPACE_PLUGIN
|
|
1924
2210
|
}
|
|
1925
2211
|
],
|
|
1926
|
-
icon:
|
|
1927
|
-
iconSymbol: "ph--sign-in--regular",
|
|
2212
|
+
icon: "ph--sign-in--regular",
|
|
1928
2213
|
testId: "spacePlugin.joinSpace"
|
|
1929
2214
|
}
|
|
1930
2215
|
}
|
|
@@ -2052,6 +2337,45 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2052
2337
|
resolve
|
|
2053
2338
|
})).filter(nonNullable);
|
|
2054
2339
|
}
|
|
2340
|
+
}),
|
|
2341
|
+
// Create nodes for object settings.
|
|
2342
|
+
createExtension({
|
|
2343
|
+
id: `${SPACE_PLUGIN}/settings-for-subject`,
|
|
2344
|
+
resolver: ({ id }) => {
|
|
2345
|
+
if (!id.endsWith("~settings")) {
|
|
2346
|
+
return;
|
|
2347
|
+
}
|
|
2348
|
+
const [subjectId] = id.split("~");
|
|
2349
|
+
const [spaceId, objectId] = parseFullyQualifiedId(subjectId);
|
|
2350
|
+
const space = client.spaces.get().find((space2) => space2.id === spaceId);
|
|
2351
|
+
const object = toSignal((onChange) => {
|
|
2352
|
+
const timeout = setTimeout(async () => {
|
|
2353
|
+
await space?.db.loadObjectById(objectId);
|
|
2354
|
+
onChange();
|
|
2355
|
+
});
|
|
2356
|
+
return () => clearTimeout(timeout);
|
|
2357
|
+
}, () => space?.db.getObjectById(objectId), subjectId);
|
|
2358
|
+
if (!object || !subjectId) {
|
|
2359
|
+
return;
|
|
2360
|
+
}
|
|
2361
|
+
const meta = resolve(getTypename2(object) ?? "");
|
|
2362
|
+
const label = meta.label?.(object) || object.name || meta.placeholder || [
|
|
2363
|
+
"unnamed object settings label",
|
|
2364
|
+
{
|
|
2365
|
+
ns: SPACE_PLUGIN
|
|
2366
|
+
}
|
|
2367
|
+
];
|
|
2368
|
+
return {
|
|
2369
|
+
id,
|
|
2370
|
+
type: "orphan-settings-for-subject",
|
|
2371
|
+
data: null,
|
|
2372
|
+
properties: {
|
|
2373
|
+
icon: "ph--gear--regular",
|
|
2374
|
+
label,
|
|
2375
|
+
object
|
|
2376
|
+
}
|
|
2377
|
+
};
|
|
2378
|
+
}
|
|
2055
2379
|
})
|
|
2056
2380
|
];
|
|
2057
2381
|
},
|
|
@@ -2159,6 +2483,25 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2159
2483
|
}
|
|
2160
2484
|
},
|
|
2161
2485
|
intents: [
|
|
2486
|
+
...settings.values.onSpaceCreate ? [
|
|
2487
|
+
[
|
|
2488
|
+
{
|
|
2489
|
+
action: settings.values.onSpaceCreate,
|
|
2490
|
+
data: {
|
|
2491
|
+
space
|
|
2492
|
+
}
|
|
2493
|
+
},
|
|
2494
|
+
{
|
|
2495
|
+
action: SpaceAction.ADD_OBJECT,
|
|
2496
|
+
data: {
|
|
2497
|
+
target: space
|
|
2498
|
+
}
|
|
2499
|
+
},
|
|
2500
|
+
{
|
|
2501
|
+
action: NavigationAction3.EXPOSE
|
|
2502
|
+
}
|
|
2503
|
+
]
|
|
2504
|
+
] : [],
|
|
2162
2505
|
[
|
|
2163
2506
|
{
|
|
2164
2507
|
action: ObservabilityAction.SEND_EVENT,
|
|
@@ -2379,8 +2722,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2379
2722
|
title: translations_default[0]["en-US"][SPACE_PLUGIN]["space limit label"],
|
|
2380
2723
|
description: translations_default[0]["en-US"][SPACE_PLUGIN]["space limit description"],
|
|
2381
2724
|
duration: 5e3,
|
|
2382
|
-
icon:
|
|
2383
|
-
iconSymbol: "ph--warning--regular",
|
|
2725
|
+
icon: "ph--warning--regular",
|
|
2384
2726
|
actionLabel: translations_default[0]["en-US"][SPACE_PLUGIN]["remove deleted objects label"],
|
|
2385
2727
|
actionAlt: translations_default[0]["en-US"][SPACE_PLUGIN]["remove deleted objects alt"],
|
|
2386
2728
|
// TODO(wittjosiah): Use OS namespace.
|
|
@@ -2422,7 +2764,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2422
2764
|
}
|
|
2423
2765
|
return {
|
|
2424
2766
|
data: {
|
|
2425
|
-
id: object
|
|
2767
|
+
id: fullyQualifiedId4(object),
|
|
2426
2768
|
object,
|
|
2427
2769
|
activeParts: {
|
|
2428
2770
|
main: [
|
|
@@ -2475,8 +2817,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2475
2817
|
data: {
|
|
2476
2818
|
activeParts: {
|
|
2477
2819
|
main: deletionData.wasActive,
|
|
2478
|
-
sidebar: deletionData.wasActive
|
|
2479
|
-
complementary: deletionData.wasActive
|
|
2820
|
+
sidebar: deletionData.wasActive
|
|
2480
2821
|
}
|
|
2481
2822
|
}
|
|
2482
2823
|
});
|
|
@@ -2596,10 +2937,10 @@ export {
|
|
|
2596
2937
|
CollectionSection,
|
|
2597
2938
|
CollectionType,
|
|
2598
2939
|
ContactType,
|
|
2599
|
-
|
|
2600
|
-
EmptyTree,
|
|
2940
|
+
FallbackSettings,
|
|
2601
2941
|
FullPresence,
|
|
2602
2942
|
MenuFooter,
|
|
2943
|
+
MessageState,
|
|
2603
2944
|
MessageType,
|
|
2604
2945
|
MissingObject,
|
|
2605
2946
|
PersistenceStatus,
|
|
@@ -2611,6 +2952,7 @@ export {
|
|
|
2611
2952
|
SPACE_PLUGIN,
|
|
2612
2953
|
SPACE_PLUGIN_SHORT_ID,
|
|
2613
2954
|
SPACE_TYPE,
|
|
2955
|
+
SaveStatus,
|
|
2614
2956
|
ShareSpaceButton,
|
|
2615
2957
|
ShareSpaceButtonImpl,
|
|
2616
2958
|
SmallPresence,
|
|
@@ -2620,6 +2962,9 @@ export {
|
|
|
2620
2962
|
SpacePlugin,
|
|
2621
2963
|
SpacePresence,
|
|
2622
2964
|
SpaceSettings,
|
|
2965
|
+
SyncStatus,
|
|
2966
|
+
SyncStatusDetail,
|
|
2967
|
+
SyncStatusIndicator,
|
|
2623
2968
|
ThreadStatus,
|
|
2624
2969
|
ThreadType,
|
|
2625
2970
|
cloneObject,
|
|
@@ -2634,6 +2979,7 @@ export {
|
|
|
2634
2979
|
getNestedObjects,
|
|
2635
2980
|
getSpaceDisplayName,
|
|
2636
2981
|
memoizeQuery,
|
|
2982
|
+
parseSpaceInitPlugin,
|
|
2637
2983
|
parseSpacePlugin,
|
|
2638
2984
|
translations_default as translations
|
|
2639
2985
|
};
|