@dxos/plugin-space 0.6.12-main.5cc132e → 0.6.12-main.c974201
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-DTVUOG2C.mjs → chunk-WBMH5WIP.mjs} +14 -2
- package/dist/lib/browser/chunk-WBMH5WIP.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +400 -177
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/types/index.mjs +7 -3
- package/dist/lib/node/{chunk-CVZPI2P3.cjs → chunk-GF3SRAQM.cjs} +20 -6
- package/dist/lib/node/chunk-GF3SRAQM.cjs.map +7 -0
- package/dist/lib/node/index.cjs +509 -289
- package/dist/lib/node/index.cjs.map +4 -4
- 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-LZEGRS7H.mjs → chunk-GM2YUC77.mjs} +3 -1
- package/dist/lib/node-esm/{chunk-LZEGRS7H.mjs.map → chunk-GM2YUC77.mjs.map} +1 -1
- package/dist/lib/node-esm/{chunk-DTVUOG2C.mjs → chunk-N5VC55UM.mjs} +16 -2
- package/dist/lib/node-esm/chunk-N5VC55UM.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +402 -178
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/meta.mjs +2 -1
- package/dist/lib/node-esm/types/index.mjs +8 -3
- package/dist/types/src/SpacePlugin.d.ts.map +1 -1
- package/dist/types/src/components/SaveStatus.d.ts.map +1 -1
- package/dist/types/src/components/ShareSpaceButton.stories.d.ts +2 -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 +2 -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 +115 -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 +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/thread.d.ts +13 -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 +34 -32
- package/src/SpacePlugin.tsx +24 -13
- package/src/components/SaveStatus.tsx +6 -9
- package/src/components/SpaceMain/SpaceMain.tsx +1 -22
- 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 +1 -0
- package/src/translations.ts +2 -0
- package/src/types/thread.ts +9 -0
- 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/node/chunk-CVZPI2P3.cjs.map +0 -7
- package/dist/lib/node-esm/chunk-DTVUOG2C.mjs.map +0 -7
|
@@ -9,14 +9,15 @@ import {
|
|
|
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-WBMH5WIP.mjs";
|
|
17
19
|
|
|
18
20
|
// packages/plugins/plugin-space/src/SpacePlugin.tsx
|
|
19
|
-
import { CardsThree as CardsThree2, Plus as Plus2, SignIn, Warning as Warning2 } from "@phosphor-icons/react";
|
|
20
21
|
import { effect, signal } from "@preact/signals-core";
|
|
21
22
|
import React18 from "react";
|
|
22
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";
|
|
@@ -183,15 +184,13 @@ var EmptyTree = () => {
|
|
|
183
184
|
};
|
|
184
185
|
|
|
185
186
|
// packages/plugins/plugin-space/src/components/MenuFooter.tsx
|
|
186
|
-
import { Planet
|
|
187
|
-
import
|
|
187
|
+
import { Planet } from "@phosphor-icons/react";
|
|
188
|
+
import React6 from "react";
|
|
188
189
|
import { getSpace as getSpace2 } from "@dxos/client/echo";
|
|
189
190
|
import { useClient as useClient2 } from "@dxos/react-client";
|
|
190
191
|
import { DropdownMenu, toLocalizedString, useTranslation as useTranslation6 } from "@dxos/react-ui";
|
|
191
192
|
|
|
192
193
|
// 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
194
|
import { NavigationAction as NavigationAction2 } from "@dxos/app-framework";
|
|
196
195
|
import { create, isReactiveObject, getTypename, getSchema, getEchoObjectAnnotation, EXPANDO_TYPENAME } from "@dxos/echo-schema";
|
|
197
196
|
import { invariant } from "@dxos/invariant";
|
|
@@ -284,8 +283,7 @@ var constructSpaceNode = ({ space, personal, namesCache, resolve }) => {
|
|
|
284
283
|
namesCache
|
|
285
284
|
}),
|
|
286
285
|
description: space.state.get() === SpaceState.SPACE_READY && space.properties.description,
|
|
287
|
-
icon:
|
|
288
|
-
iconSymbol: "ph--planet--regular",
|
|
286
|
+
icon: "ph--planet--regular",
|
|
289
287
|
disabled: space.state.get() !== SpaceState.SPACE_READY || hasPendingMigration,
|
|
290
288
|
testId: "spacePlugin.space"
|
|
291
289
|
}
|
|
@@ -311,8 +309,7 @@ var constructSpaceActionGroups = ({ space, dispatch }) => {
|
|
|
311
309
|
ns: SPACE_PLUGIN
|
|
312
310
|
}
|
|
313
311
|
],
|
|
314
|
-
icon:
|
|
315
|
-
iconSymbol: "ph--plus--regular",
|
|
312
|
+
icon: "ph--plus--regular",
|
|
316
313
|
disposition: "toolbar",
|
|
317
314
|
// TODO(wittjosiah): This is currently a navtree feature. Address this with cmd+k integration.
|
|
318
315
|
// mainAreaDisposition: 'in-flow',
|
|
@@ -346,8 +343,7 @@ var constructSpaceActionGroups = ({ space, dispatch }) => {
|
|
|
346
343
|
ns: SPACE_PLUGIN
|
|
347
344
|
}
|
|
348
345
|
],
|
|
349
|
-
icon:
|
|
350
|
-
iconSymbol: "ph--cards-three--regular",
|
|
346
|
+
icon: "ph--cards-three--regular",
|
|
351
347
|
testId: "spacePlugin.createCollection"
|
|
352
348
|
}
|
|
353
349
|
}
|
|
@@ -381,8 +377,7 @@ var constructSpaceActions = ({ space, dispatch, personal, migrating }) => {
|
|
|
381
377
|
ns: SPACE_PLUGIN
|
|
382
378
|
}
|
|
383
379
|
],
|
|
384
|
-
icon:
|
|
385
|
-
iconSymbol: "ph--database--regular",
|
|
380
|
+
icon: "ph--database--regular",
|
|
386
381
|
disposition: "toolbar",
|
|
387
382
|
mainAreaDisposition: "in-flow",
|
|
388
383
|
disabled: migrating || Migrations.running(space)
|
|
@@ -413,8 +408,7 @@ var constructSpaceActions = ({ space, dispatch, personal, migrating }) => {
|
|
|
413
408
|
ns: SPACE_PLUGIN
|
|
414
409
|
}
|
|
415
410
|
],
|
|
416
|
-
icon:
|
|
417
|
-
iconSymbol: "ph--users--regular",
|
|
411
|
+
icon: "ph--users--regular",
|
|
418
412
|
disabled: locked,
|
|
419
413
|
keyBinding: {
|
|
420
414
|
macos: "meta+.",
|
|
@@ -441,8 +435,7 @@ var constructSpaceActions = ({ space, dispatch, personal, migrating }) => {
|
|
|
441
435
|
ns: SPACE_PLUGIN
|
|
442
436
|
}
|
|
443
437
|
],
|
|
444
|
-
icon: locked ?
|
|
445
|
-
iconSymbol: locked ? "ph--lock-simple-open--regular" : "ph--lock-simple--regular"
|
|
438
|
+
icon: locked ? "ph--lock-simple-open--regular" : "ph--lock-simple--regular"
|
|
446
439
|
}
|
|
447
440
|
}, {
|
|
448
441
|
id: getId(SpaceAction.RENAME),
|
|
@@ -464,8 +457,7 @@ var constructSpaceActions = ({ space, dispatch, personal, migrating }) => {
|
|
|
464
457
|
ns: SPACE_PLUGIN
|
|
465
458
|
}
|
|
466
459
|
],
|
|
467
|
-
icon:
|
|
468
|
-
iconSymbol: "ph--pencil-simple-line--regular",
|
|
460
|
+
icon: "ph--pencil-simple-line--regular",
|
|
469
461
|
keyBinding: {
|
|
470
462
|
macos: "shift+F6",
|
|
471
463
|
windows: "shift+F6"
|
|
@@ -494,8 +486,7 @@ var constructSpaceActions = ({ space, dispatch, personal, migrating }) => {
|
|
|
494
486
|
ns: SPACE_PLUGIN
|
|
495
487
|
}
|
|
496
488
|
],
|
|
497
|
-
icon:
|
|
498
|
-
iconSymbol: "ph--x--regular",
|
|
489
|
+
icon: "ph--x--regular",
|
|
499
490
|
mainAreaDisposition: "menu",
|
|
500
491
|
disabled: personal
|
|
501
492
|
}
|
|
@@ -521,8 +512,7 @@ var constructSpaceActions = ({ space, dispatch, personal, migrating }) => {
|
|
|
521
512
|
ns: SPACE_PLUGIN
|
|
522
513
|
}
|
|
523
514
|
],
|
|
524
|
-
icon:
|
|
525
|
-
iconSymbol: "ph--clock-counter-clockwise--regular",
|
|
515
|
+
icon: "ph--clock-counter-clockwise--regular",
|
|
526
516
|
disposition: "toolbar",
|
|
527
517
|
mainAreaDisposition: "in-flow"
|
|
528
518
|
}
|
|
@@ -556,8 +546,7 @@ var createObjectNode = ({ object, space, resolve }) => {
|
|
|
556
546
|
ns: SPACE_PLUGIN
|
|
557
547
|
}
|
|
558
548
|
],
|
|
559
|
-
icon: metadata.icon ??
|
|
560
|
-
iconSymbol: metadata.iconSymbol ?? "ph--placeholder--regular",
|
|
549
|
+
icon: metadata.icon ?? "ph--placeholder--regular",
|
|
561
550
|
testId: "spacePlugin.object",
|
|
562
551
|
persistenceClass: "echo",
|
|
563
552
|
persistenceKey: space?.id
|
|
@@ -582,8 +571,7 @@ var constructObjectActionGroups = ({ object, dispatch }) => {
|
|
|
582
571
|
ns: SPACE_PLUGIN
|
|
583
572
|
}
|
|
584
573
|
],
|
|
585
|
-
icon:
|
|
586
|
-
iconSymbol: "ph--plus--regular",
|
|
574
|
+
icon: "ph--plus--regular",
|
|
587
575
|
disposition: "toolbar",
|
|
588
576
|
// TODO(wittjosiah): This is currently a navtree feature. Address this with cmd+k integration.
|
|
589
577
|
// mainAreaDisposition: 'in-flow',
|
|
@@ -617,8 +605,7 @@ var constructObjectActionGroups = ({ object, dispatch }) => {
|
|
|
617
605
|
ns: SPACE_PLUGIN
|
|
618
606
|
}
|
|
619
607
|
],
|
|
620
|
-
icon:
|
|
621
|
-
iconSymbol: "ph--cards-three--regular",
|
|
608
|
+
icon: "ph--cards-three--regular",
|
|
622
609
|
testId: "spacePlugin.createCollection"
|
|
623
610
|
}
|
|
624
611
|
}
|
|
@@ -650,8 +637,7 @@ var constructObjectActions = ({ node, dispatch }) => {
|
|
|
650
637
|
ns: SPACE_PLUGIN
|
|
651
638
|
}
|
|
652
639
|
],
|
|
653
|
-
icon:
|
|
654
|
-
iconSymbol: "ph--pencil-simple-line--regular",
|
|
640
|
+
icon: "ph--pencil-simple-line--regular",
|
|
655
641
|
// TODO(wittjosiah): Doesn't work.
|
|
656
642
|
// keyBinding: 'shift+F6',
|
|
657
643
|
testId: "spacePlugin.renameObject"
|
|
@@ -682,8 +668,7 @@ var constructObjectActions = ({ node, dispatch }) => {
|
|
|
682
668
|
ns: SPACE_PLUGIN
|
|
683
669
|
}
|
|
684
670
|
],
|
|
685
|
-
icon:
|
|
686
|
-
iconSymbol: "ph--trash--regular",
|
|
671
|
+
icon: "ph--trash--regular",
|
|
687
672
|
keyBinding: object instanceof CollectionType ? void 0 : "shift+meta+Backspace",
|
|
688
673
|
testId: "spacePlugin.deleteObject"
|
|
689
674
|
}
|
|
@@ -702,8 +687,7 @@ var constructObjectActions = ({ node, dispatch }) => {
|
|
|
702
687
|
ns: SPACE_PLUGIN
|
|
703
688
|
}
|
|
704
689
|
],
|
|
705
|
-
icon:
|
|
706
|
-
iconSymbol: "ph--link--regular",
|
|
690
|
+
icon: "ph--link--regular",
|
|
707
691
|
testId: "spacePlugin.copyLink"
|
|
708
692
|
}
|
|
709
693
|
}
|
|
@@ -744,7 +728,7 @@ var cloneObject = async (object, resolve) => {
|
|
|
744
728
|
const serializer = metadata.serializer;
|
|
745
729
|
invariant(serializer, `No serializer for type: ${typename}`, {
|
|
746
730
|
F: __dxlog_file,
|
|
747
|
-
L:
|
|
731
|
+
L: 604,
|
|
748
732
|
S: void 0,
|
|
749
733
|
A: [
|
|
750
734
|
"serializer",
|
|
@@ -768,19 +752,19 @@ var MenuFooter = ({ object }) => {
|
|
|
768
752
|
const spaceName = space ? getSpaceDisplayName(space, {
|
|
769
753
|
personal: client.spaces.default === space
|
|
770
754
|
}) : "";
|
|
771
|
-
return space ? /* @__PURE__ */
|
|
755
|
+
return space ? /* @__PURE__ */ React6.createElement(React6.Fragment, null, /* @__PURE__ */ React6.createElement(DropdownMenu.Separator, null), /* @__PURE__ */ React6.createElement(DropdownMenu.GroupLabel, null, t("menu footer label")), /* @__PURE__ */ React6.createElement("dl", {
|
|
772
756
|
className: "pis-2 mbe-2 text-xs grid grid-cols-[max-content_1fr] gap-2"
|
|
773
|
-
}, /* @__PURE__ */
|
|
757
|
+
}, /* @__PURE__ */ React6.createElement("dt", {
|
|
774
758
|
className: "uppercase text-[.75em] tracking-wide font-medium mbs-px self-start"
|
|
775
|
-
}, t("location label")), /* @__PURE__ */
|
|
759
|
+
}, t("location label")), /* @__PURE__ */ React6.createElement("dd", {
|
|
776
760
|
className: "line-clamp-3"
|
|
777
|
-
}, /* @__PURE__ */
|
|
761
|
+
}, /* @__PURE__ */ React6.createElement(Planet, {
|
|
778
762
|
className: "inline-block mie-1"
|
|
779
763
|
}), toLocalizedString(spaceName, t)))) : null;
|
|
780
764
|
};
|
|
781
765
|
|
|
782
766
|
// packages/plugins/plugin-space/src/components/MissingObject.tsx
|
|
783
|
-
import
|
|
767
|
+
import React7, { useEffect as useEffect2, useState as useState2 } from "react";
|
|
784
768
|
import { parseIntentPlugin as parseIntentPlugin2, useResolvePlugin as useResolvePlugin2 } from "@dxos/app-framework";
|
|
785
769
|
import { Status, useTranslation as useTranslation7 } from "@dxos/react-ui";
|
|
786
770
|
import { baseSurface as baseSurface2, descriptionText as descriptionText4, mx as mx5 } from "@dxos/react-ui-theme";
|
|
@@ -808,13 +792,13 @@ var MissingObject = ({ id }) => {
|
|
|
808
792
|
intentPlugin,
|
|
809
793
|
id
|
|
810
794
|
]);
|
|
811
|
-
return /* @__PURE__ */
|
|
795
|
+
return /* @__PURE__ */ React7.createElement("div", {
|
|
812
796
|
role: "none",
|
|
813
797
|
className: mx5(baseSurface2, "min-bs-screen is-full flex items-center justify-center p-8")
|
|
814
|
-
}, waiting ? /* @__PURE__ */
|
|
798
|
+
}, waiting ? /* @__PURE__ */ React7.createElement("p", {
|
|
815
799
|
role: "alert",
|
|
816
800
|
className: mx5(descriptionText4, "border border-dashed border-neutral-400/50 rounded-lg flex items-center justify-center p-8 font-normal text-lg")
|
|
817
|
-
}, t("missing object message")) : /* @__PURE__ */
|
|
801
|
+
}, t("missing object message")) : /* @__PURE__ */ React7.createElement(Status, {
|
|
818
802
|
indeterminate: true,
|
|
819
803
|
"aria-label": "Initializing"
|
|
820
804
|
}));
|
|
@@ -822,7 +806,7 @@ var MissingObject = ({ id }) => {
|
|
|
822
806
|
|
|
823
807
|
// packages/plugins/plugin-space/src/components/PersistenceStatus.tsx
|
|
824
808
|
import { ArrowsCounterClockwise, CheckCircle as CheckCircle2, Warning } from "@phosphor-icons/react";
|
|
825
|
-
import
|
|
809
|
+
import React8, { useEffect as useEffect3, useState as useState3 } from "react";
|
|
826
810
|
import { debounce } from "@dxos/async";
|
|
827
811
|
import { Tooltip, useTranslation as useTranslation8 } from "@dxos/react-ui";
|
|
828
812
|
import { getSize as getSize2, mx as mx6, staticPlaceholderText, warningText } from "@dxos/react-ui-theme";
|
|
@@ -850,40 +834,40 @@ var PersistenceStatus = ({ db }) => {
|
|
|
850
834
|
]);
|
|
851
835
|
switch (status) {
|
|
852
836
|
case 2:
|
|
853
|
-
return /* @__PURE__ */
|
|
837
|
+
return /* @__PURE__ */ React8.createElement("div", {
|
|
854
838
|
className: "flex items-center"
|
|
855
|
-
}, /* @__PURE__ */
|
|
839
|
+
}, /* @__PURE__ */ React8.createElement(Warning, {
|
|
856
840
|
className: mx6(getSize2(4), "me-1")
|
|
857
|
-
}), /* @__PURE__ */
|
|
841
|
+
}), /* @__PURE__ */ React8.createElement("span", {
|
|
858
842
|
className: mx6("text-sm", warningText)
|
|
859
843
|
}, t("persistence error label")));
|
|
860
844
|
case 1:
|
|
861
|
-
return /* @__PURE__ */
|
|
845
|
+
return /* @__PURE__ */ React8.createElement("div", {
|
|
862
846
|
className: "flex items-center"
|
|
863
|
-
}, /* @__PURE__ */
|
|
847
|
+
}, /* @__PURE__ */ React8.createElement(ArrowsCounterClockwise, {
|
|
864
848
|
className: mx6(getSize2(4), "me-1")
|
|
865
|
-
}), /* @__PURE__ */
|
|
849
|
+
}), /* @__PURE__ */ React8.createElement("span", {
|
|
866
850
|
className: mx6("text-sm", staticPlaceholderText)
|
|
867
851
|
}, t("persistence pending label")));
|
|
868
852
|
case 0:
|
|
869
853
|
default:
|
|
870
|
-
return /* @__PURE__ */
|
|
854
|
+
return /* @__PURE__ */ React8.createElement(Tooltip.Root, {
|
|
871
855
|
delayDuration: 400
|
|
872
|
-
}, /* @__PURE__ */
|
|
856
|
+
}, /* @__PURE__ */ React8.createElement(Tooltip.Trigger, {
|
|
873
857
|
role: "status",
|
|
874
858
|
className: "flex items-center"
|
|
875
|
-
}, /* @__PURE__ */
|
|
859
|
+
}, /* @__PURE__ */ React8.createElement(CheckCircle2, {
|
|
876
860
|
className: mx6(getSize2(4), "me-1")
|
|
877
|
-
}), displayMessage && /* @__PURE__ */
|
|
861
|
+
}), displayMessage && /* @__PURE__ */ React8.createElement("span", {
|
|
878
862
|
className: mx6("text-sm", staticPlaceholderText)
|
|
879
|
-
}, t("persisted locally label"))), /* @__PURE__ */
|
|
863
|
+
}, t("persisted locally label"))), /* @__PURE__ */ React8.createElement(Tooltip.Portal, null, /* @__PURE__ */ React8.createElement(Tooltip.Content, {
|
|
880
864
|
classNames: "z-10"
|
|
881
|
-
}, t("persisted locally message"), /* @__PURE__ */
|
|
865
|
+
}, t("persisted locally message"), /* @__PURE__ */ React8.createElement(Tooltip.Arrow, null))));
|
|
882
866
|
}
|
|
883
867
|
};
|
|
884
868
|
|
|
885
869
|
// packages/plugins/plugin-space/src/components/PopoverRenameObject.tsx
|
|
886
|
-
import
|
|
870
|
+
import React9, { useCallback, useRef, useState as useState4 } from "react";
|
|
887
871
|
import { log } from "@dxos/log";
|
|
888
872
|
import { Button as Button2, Input, Popover, useTranslation as useTranslation9 } from "@dxos/react-ui";
|
|
889
873
|
var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/PopoverRenameObject.tsx";
|
|
@@ -913,23 +897,23 @@ var PopoverRenameObject = ({ object: obj }) => {
|
|
|
913
897
|
object,
|
|
914
898
|
name
|
|
915
899
|
]);
|
|
916
|
-
return /* @__PURE__ */
|
|
900
|
+
return /* @__PURE__ */ React9.createElement("div", {
|
|
917
901
|
role: "none",
|
|
918
902
|
className: "p-1 flex gap-2"
|
|
919
|
-
}, /* @__PURE__ */
|
|
903
|
+
}, /* @__PURE__ */ React9.createElement("div", {
|
|
920
904
|
role: "none",
|
|
921
905
|
className: "flex-1"
|
|
922
|
-
}, /* @__PURE__ */
|
|
906
|
+
}, /* @__PURE__ */ React9.createElement(Input.Root, null, /* @__PURE__ */ React9.createElement(Input.Label, {
|
|
923
907
|
srOnly: true
|
|
924
|
-
}, t("object name label")), /* @__PURE__ */
|
|
908
|
+
}, t("object name label")), /* @__PURE__ */ React9.createElement(Input.TextInput, {
|
|
925
909
|
placeholder: t("object title placeholder"),
|
|
926
910
|
value: name,
|
|
927
911
|
"data-testid": "spacePlugin.renameObject.input",
|
|
928
912
|
onChange: ({ target: { value } }) => setName(value),
|
|
929
913
|
onKeyDown: ({ key }) => key === "Enter" && doneButton.current?.click()
|
|
930
|
-
}))), /* @__PURE__ */
|
|
914
|
+
}))), /* @__PURE__ */ React9.createElement(Popover.Close, {
|
|
931
915
|
asChild: true
|
|
932
|
-
}, /* @__PURE__ */
|
|
916
|
+
}, /* @__PURE__ */ React9.createElement(Button2, {
|
|
933
917
|
ref: doneButton,
|
|
934
918
|
classNames: "self-stretch",
|
|
935
919
|
onClick: handleDone
|
|
@@ -939,7 +923,7 @@ var PopoverRenameObject = ({ object: obj }) => {
|
|
|
939
923
|
};
|
|
940
924
|
|
|
941
925
|
// packages/plugins/plugin-space/src/components/PopoverRenameSpace.tsx
|
|
942
|
-
import
|
|
926
|
+
import React10, { useCallback as useCallback2, useRef as useRef2, useState as useState5 } from "react";
|
|
943
927
|
import { Button as Button3, Input as Input2, Popover as Popover2, useTranslation as useTranslation10 } from "@dxos/react-ui";
|
|
944
928
|
var PopoverRenameSpace = ({ space }) => {
|
|
945
929
|
const { t } = useTranslation10(SPACE_PLUGIN);
|
|
@@ -951,24 +935,24 @@ var PopoverRenameSpace = ({ space }) => {
|
|
|
951
935
|
space,
|
|
952
936
|
name
|
|
953
937
|
]);
|
|
954
|
-
return /* @__PURE__ */
|
|
938
|
+
return /* @__PURE__ */ React10.createElement("div", {
|
|
955
939
|
role: "none",
|
|
956
940
|
className: "p-1 flex gap-2"
|
|
957
|
-
}, /* @__PURE__ */
|
|
941
|
+
}, /* @__PURE__ */ React10.createElement("div", {
|
|
958
942
|
role: "none",
|
|
959
943
|
className: "flex-1"
|
|
960
|
-
}, /* @__PURE__ */
|
|
944
|
+
}, /* @__PURE__ */ React10.createElement(Input2.Root, null, /* @__PURE__ */ React10.createElement(Input2.Label, {
|
|
961
945
|
srOnly: true
|
|
962
|
-
}, t("space name label")), /* @__PURE__ */
|
|
946
|
+
}, t("space name label")), /* @__PURE__ */ React10.createElement(Input2.TextInput, {
|
|
963
947
|
defaultValue: space.properties.name ?? "",
|
|
964
948
|
placeholder: t("unnamed space label"),
|
|
965
949
|
onChange: ({ target: { value } }) => setName(value),
|
|
966
950
|
// TODO(wittjosiah): Ideally this should access the popover context to close the popover.
|
|
967
951
|
// Currently this is not possible because Radix does not expose the popover context.
|
|
968
952
|
onKeyDown: ({ key }) => key === "Enter" && doneButton.current?.click()
|
|
969
|
-
}))), /* @__PURE__ */
|
|
953
|
+
}))), /* @__PURE__ */ React10.createElement(Popover2.Close, {
|
|
970
954
|
asChild: true
|
|
971
|
-
}, /* @__PURE__ */
|
|
955
|
+
}, /* @__PURE__ */ React10.createElement(Button3, {
|
|
972
956
|
ref: doneButton,
|
|
973
957
|
classNames: "self-stretch",
|
|
974
958
|
onClick: handleDone
|
|
@@ -978,12 +962,12 @@ var PopoverRenameSpace = ({ space }) => {
|
|
|
978
962
|
};
|
|
979
963
|
|
|
980
964
|
// packages/plugins/plugin-space/src/components/ShareSpaceButton.tsx
|
|
981
|
-
import
|
|
965
|
+
import React11 from "react";
|
|
982
966
|
import { useIntentDispatcher } from "@dxos/app-framework";
|
|
983
967
|
import { Button as Button4, useTranslation as useTranslation11 } from "@dxos/react-ui";
|
|
984
968
|
var ShareSpaceButton = ({ spaceId }) => {
|
|
985
969
|
const dispatch = useIntentDispatcher();
|
|
986
|
-
return /* @__PURE__ */
|
|
970
|
+
return /* @__PURE__ */ React11.createElement(ShareSpaceButtonImpl, {
|
|
987
971
|
onClick: () => dispatch({
|
|
988
972
|
action: SpaceAction.SHARE,
|
|
989
973
|
data: {
|
|
@@ -994,7 +978,7 @@ var ShareSpaceButton = ({ spaceId }) => {
|
|
|
994
978
|
};
|
|
995
979
|
var ShareSpaceButtonImpl = ({ onClick }) => {
|
|
996
980
|
const { t } = useTranslation11(SPACE_PLUGIN);
|
|
997
|
-
return /* @__PURE__ */
|
|
981
|
+
return /* @__PURE__ */ React11.createElement(Button4, {
|
|
998
982
|
"data-testid": "spacePlugin.shareSpaceButton",
|
|
999
983
|
onClick,
|
|
1000
984
|
classNames: "mli-1"
|
|
@@ -1003,16 +987,16 @@ var ShareSpaceButtonImpl = ({ onClick }) => {
|
|
|
1003
987
|
|
|
1004
988
|
// packages/plugins/plugin-space/src/components/SpaceMain/SpaceMain.tsx
|
|
1005
989
|
import { Command } from "@phosphor-icons/react";
|
|
1006
|
-
import
|
|
990
|
+
import React13 from "react";
|
|
1007
991
|
import { Surface } from "@dxos/app-framework";
|
|
1008
992
|
import { SpaceState as SpaceState2 } from "@dxos/react-client/echo";
|
|
1009
|
-
import {
|
|
993
|
+
import { Main, useTranslation as useTranslation13 } from "@dxos/react-ui";
|
|
1010
994
|
import { getSize as getSize4, mx as mx8, topbarBlockPaddingStart } from "@dxos/react-ui-theme";
|
|
1011
995
|
import { ClipboardProvider } from "@dxos/shell/react";
|
|
1012
996
|
|
|
1013
997
|
// packages/plugins/plugin-space/src/components/SpaceMain/SpaceMembersSection.tsx
|
|
1014
998
|
import { CaretDown, Check, UserPlus, UsersThree } from "@phosphor-icons/react";
|
|
1015
|
-
import
|
|
999
|
+
import React12, { useCallback as useCallback3, useState as useState6 } from "react";
|
|
1016
1000
|
import { LayoutAction, useIntent } from "@dxos/app-framework";
|
|
1017
1001
|
import { useMembers, SpaceMember, useSpaceInvitations } from "@dxos/react-client/echo";
|
|
1018
1002
|
import { InvitationEncoder } from "@dxos/react-client/invitations";
|
|
@@ -1024,9 +1008,9 @@ var activeActionKeyStorageKey = "dxos:react-shell/space-manager/active-action";
|
|
|
1024
1008
|
var Presence = SpaceMember.PresenceState;
|
|
1025
1009
|
var handleCreateInvitationUrl = (invitationCode) => `${origin}?spaceInvitationCode=${invitationCode}`;
|
|
1026
1010
|
var SpaceMemberList = ({ members }) => {
|
|
1027
|
-
return members.length > 0 ? /* @__PURE__ */
|
|
1011
|
+
return members.length > 0 ? /* @__PURE__ */ React12.createElement(List, {
|
|
1028
1012
|
classNames: "col-start-2 col-end-5 gap-y-1 grid grid-cols-subgrid items-center"
|
|
1029
|
-
}, members.map((member) => /* @__PURE__ */
|
|
1013
|
+
}, members.map((member) => /* @__PURE__ */ React12.createElement(IdentityListItem, {
|
|
1030
1014
|
classNames: "contents",
|
|
1031
1015
|
key: member.identity.identityKey.toHex(),
|
|
1032
1016
|
identity: member.identity,
|
|
@@ -1112,83 +1096,83 @@ var SpaceMembersSection = ({ space }) => {
|
|
|
1112
1096
|
[Presence.ONLINE]: [],
|
|
1113
1097
|
[Presence.OFFLINE]: []
|
|
1114
1098
|
});
|
|
1115
|
-
return /* @__PURE__ */
|
|
1099
|
+
return /* @__PURE__ */ React12.createElement("section", {
|
|
1116
1100
|
className: "mbe-4 col-span-3 grid gap-y-2 grid-cols-subgrid auto-rows-min"
|
|
1117
|
-
}, /* @__PURE__ */
|
|
1101
|
+
}, /* @__PURE__ */ React12.createElement("h2", {
|
|
1118
1102
|
className: "contents"
|
|
1119
|
-
}, /* @__PURE__ */
|
|
1103
|
+
}, /* @__PURE__ */ React12.createElement(UsersThree, {
|
|
1120
1104
|
weight: "duotone",
|
|
1121
1105
|
className: mx7(getSize3(5), "place-self-center")
|
|
1122
|
-
}), /* @__PURE__ */
|
|
1106
|
+
}), /* @__PURE__ */ React12.createElement("span", {
|
|
1123
1107
|
className: "text-lg col-span-2"
|
|
1124
|
-
}, t("space members label"))), /* @__PURE__ */
|
|
1108
|
+
}, t("space members label"))), /* @__PURE__ */ React12.createElement("h3", {
|
|
1125
1109
|
className: "col-start-2 col-span-3 text-sm italic text-description"
|
|
1126
|
-
}, t("invitations heading")), invitations.length > 0 && /* @__PURE__ */
|
|
1110
|
+
}, t("invitations heading")), invitations.length > 0 && /* @__PURE__ */ React12.createElement(List, {
|
|
1127
1111
|
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__ */
|
|
1112
|
+
}, invitations.map((invitation) => /* @__PURE__ */ React12.createElement(InvitationListItem, {
|
|
1129
1113
|
reverseEffects: true,
|
|
1130
1114
|
classNames: "pis-0 pie-0 gap-0 col-span-4 grid grid-cols-subgrid",
|
|
1131
1115
|
key: invitation.get().invitationId,
|
|
1132
1116
|
invitation,
|
|
1133
1117
|
send: handleInvitationSelect,
|
|
1134
1118
|
createInvitationUrl: handleCreateInvitationUrl
|
|
1135
|
-
}))), /* @__PURE__ */
|
|
1119
|
+
}))), /* @__PURE__ */ React12.createElement(ButtonGroup, {
|
|
1136
1120
|
classNames: "col-start-2 col-end-4 grid grid-cols-[1fr_var(--rail-action)] place-self-grow gap-px"
|
|
1137
|
-
}, /* @__PURE__ */
|
|
1121
|
+
}, /* @__PURE__ */ React12.createElement(Button5, {
|
|
1138
1122
|
classNames: "gap-2",
|
|
1139
1123
|
onClick: activeAction.onClick
|
|
1140
|
-
}, /* @__PURE__ */
|
|
1124
|
+
}, /* @__PURE__ */ React12.createElement(activeAction.icon, {
|
|
1141
1125
|
className: getSize3(5)
|
|
1142
|
-
}), /* @__PURE__ */
|
|
1126
|
+
}), /* @__PURE__ */ React12.createElement("span", null, t(activeAction.label, {
|
|
1143
1127
|
ns: "os"
|
|
1144
|
-
}))), /* @__PURE__ */
|
|
1128
|
+
}))), /* @__PURE__ */ React12.createElement(DropdownMenu2.Root, null, /* @__PURE__ */ React12.createElement(DropdownMenu2.Trigger, {
|
|
1145
1129
|
asChild: true
|
|
1146
|
-
}, /* @__PURE__ */
|
|
1130
|
+
}, /* @__PURE__ */ React12.createElement(Button5, {
|
|
1147
1131
|
classNames: "pli-0"
|
|
1148
|
-
}, /* @__PURE__ */
|
|
1132
|
+
}, /* @__PURE__ */ React12.createElement(CaretDown, {
|
|
1149
1133
|
className: getSize3(4)
|
|
1150
|
-
}))), /* @__PURE__ */
|
|
1151
|
-
return /* @__PURE__ */
|
|
1134
|
+
}))), /* @__PURE__ */ React12.createElement(DropdownMenu2.Content, null, /* @__PURE__ */ React12.createElement(DropdownMenu2.Viewport, null, Object.entries(inviteActions).map(([id, action]) => {
|
|
1135
|
+
return /* @__PURE__ */ React12.createElement(DropdownMenu2.CheckboxItem, {
|
|
1152
1136
|
key: id,
|
|
1153
1137
|
"aria-labelledby": `${id}__label`,
|
|
1154
1138
|
"aria-describedby": `${id}__description`,
|
|
1155
1139
|
checked: activeActionKey === id,
|
|
1156
1140
|
onCheckedChange: (checked) => checked && setActiveActionKey(id),
|
|
1157
1141
|
classNames: "gap-2"
|
|
1158
|
-
}, action.icon && /* @__PURE__ */
|
|
1142
|
+
}, action.icon && /* @__PURE__ */ React12.createElement(action.icon, {
|
|
1159
1143
|
className: getSize3(5)
|
|
1160
|
-
}), /* @__PURE__ */
|
|
1144
|
+
}), /* @__PURE__ */ React12.createElement("div", {
|
|
1161
1145
|
role: "none",
|
|
1162
1146
|
className: "flex-1 min-is-0 space-b-1"
|
|
1163
|
-
}, /* @__PURE__ */
|
|
1147
|
+
}, /* @__PURE__ */ React12.createElement("p", {
|
|
1164
1148
|
id: `${id}__label`
|
|
1165
1149
|
}, t(action.label, {
|
|
1166
1150
|
ns: "os"
|
|
1167
|
-
})), action.description && /* @__PURE__ */
|
|
1151
|
+
})), action.description && /* @__PURE__ */ React12.createElement("p", {
|
|
1168
1152
|
id: `${id}__description`,
|
|
1169
1153
|
className: descriptionText5
|
|
1170
1154
|
}, t(action.description, {
|
|
1171
1155
|
ns: "os"
|
|
1172
|
-
}))), /* @__PURE__ */
|
|
1156
|
+
}))), /* @__PURE__ */ React12.createElement(DropdownMenu2.ItemIndicator, {
|
|
1173
1157
|
asChild: true
|
|
1174
|
-
}, /* @__PURE__ */
|
|
1158
|
+
}, /* @__PURE__ */ React12.createElement(Check, {
|
|
1175
1159
|
className: getSize3(4)
|
|
1176
1160
|
})));
|
|
1177
|
-
})), /* @__PURE__ */
|
|
1161
|
+
})), /* @__PURE__ */ React12.createElement(DropdownMenu2.Arrow, null)))), members[Presence.ONLINE].length + members[Presence.OFFLINE].length < 1 ? /* @__PURE__ */ React12.createElement("p", {
|
|
1178
1162
|
className: mx7(descriptionText5, "text-center is-full mlb-2")
|
|
1179
1163
|
}, t("empty space members message", {
|
|
1180
1164
|
ns: "os"
|
|
1181
|
-
})) : /* @__PURE__ */
|
|
1165
|
+
})) : /* @__PURE__ */ React12.createElement(React12.Fragment, null, /* @__PURE__ */ React12.createElement("h3", {
|
|
1182
1166
|
className: "col-start-2 col-end-5 text-sm italic text-description"
|
|
1183
1167
|
}, t("active space members heading", {
|
|
1184
1168
|
count: members[Presence.ONLINE].length
|
|
1185
|
-
})), /* @__PURE__ */
|
|
1169
|
+
})), /* @__PURE__ */ React12.createElement(SpaceMemberList, {
|
|
1186
1170
|
members: members[Presence.ONLINE]
|
|
1187
|
-
}), /* @__PURE__ */
|
|
1171
|
+
}), /* @__PURE__ */ React12.createElement("h3", {
|
|
1188
1172
|
className: "col-start-2 col-end-5 text-sm italic text-description"
|
|
1189
1173
|
}, t("inactive space members heading", {
|
|
1190
1174
|
count: members[Presence.OFFLINE].length
|
|
1191
|
-
})), /* @__PURE__ */
|
|
1175
|
+
})), /* @__PURE__ */ React12.createElement(SpaceMemberList, {
|
|
1192
1176
|
members: members[Presence.OFFLINE]
|
|
1193
1177
|
})));
|
|
1194
1178
|
};
|
|
@@ -1196,19 +1180,19 @@ var SpaceMembersSection = ({ space }) => {
|
|
|
1196
1180
|
// packages/plugins/plugin-space/src/components/SpaceMain/SpaceMain.tsx
|
|
1197
1181
|
var KeyShortcuts = () => {
|
|
1198
1182
|
const { t } = useTranslation13(SPACE_PLUGIN);
|
|
1199
|
-
return /* @__PURE__ */
|
|
1183
|
+
return /* @__PURE__ */ React13.createElement("section", {
|
|
1200
1184
|
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__ */
|
|
1185
|
+
}, /* @__PURE__ */ React13.createElement("h2", {
|
|
1202
1186
|
className: "contents"
|
|
1203
|
-
}, /* @__PURE__ */
|
|
1187
|
+
}, /* @__PURE__ */ React13.createElement(Command, {
|
|
1204
1188
|
weight: "duotone",
|
|
1205
1189
|
className: mx8(getSize4(5), "place-self-center")
|
|
1206
|
-
}), /* @__PURE__ */
|
|
1190
|
+
}), /* @__PURE__ */ React13.createElement("span", {
|
|
1207
1191
|
className: "text-lg col-span-2 md:col-span-1"
|
|
1208
|
-
}, t("keyshortcuts label"))), /* @__PURE__ */
|
|
1192
|
+
}, t("keyshortcuts label"))), /* @__PURE__ */ React13.createElement("div", {
|
|
1209
1193
|
role: "none",
|
|
1210
1194
|
className: "col-start-2 col-end-4 md:col-end-5 pie-2"
|
|
1211
|
-
}, /* @__PURE__ */
|
|
1195
|
+
}, /* @__PURE__ */ React13.createElement(Surface, {
|
|
1212
1196
|
role: "keyshortcuts"
|
|
1213
1197
|
})));
|
|
1214
1198
|
};
|
|
@@ -1217,7 +1201,7 @@ var SpaceMain = ({ space, role }) => {
|
|
|
1217
1201
|
const state = space.state.get();
|
|
1218
1202
|
const ready = state === SpaceState2.SPACE_READY;
|
|
1219
1203
|
const Root = role === "main" ? Main.Content : "div";
|
|
1220
|
-
return /* @__PURE__ */
|
|
1204
|
+
return /* @__PURE__ */ React13.createElement(ClipboardProvider, null, /* @__PURE__ */ React13.createElement(Root, {
|
|
1221
1205
|
...role === "main" ? {
|
|
1222
1206
|
classNames: [
|
|
1223
1207
|
topbarBlockPaddingStart,
|
|
@@ -1230,13 +1214,13 @@ var SpaceMain = ({ space, role }) => {
|
|
|
1230
1214
|
},
|
|
1231
1215
|
"data-testid": `spacePlugin.${role}`,
|
|
1232
1216
|
"data-isready": ready ? "true" : "false"
|
|
1233
|
-
}, ready && /* @__PURE__ */
|
|
1217
|
+
}, ready && /* @__PURE__ */ React13.createElement(SpaceMembersSection, {
|
|
1234
1218
|
space
|
|
1235
|
-
}), /* @__PURE__ */
|
|
1219
|
+
}), /* @__PURE__ */ React13.createElement(KeyShortcuts, null)));
|
|
1236
1220
|
};
|
|
1237
1221
|
|
|
1238
1222
|
// packages/plugins/plugin-space/src/components/SpacePresence.tsx
|
|
1239
|
-
import
|
|
1223
|
+
import React14, { useCallback as useCallback4, useEffect as useEffect4, useState as useState7 } from "react";
|
|
1240
1224
|
import { usePlugin } from "@dxos/app-framework";
|
|
1241
1225
|
import { generateName } from "@dxos/display-name";
|
|
1242
1226
|
import { PublicKey, useClient as useClient3 } from "@dxos/react-client";
|
|
@@ -1280,9 +1264,9 @@ var SpacePresence = ({ object, spaceKey }) => {
|
|
|
1280
1264
|
lastSeen
|
|
1281
1265
|
};
|
|
1282
1266
|
}).toSorted((a, b) => a.lastSeen - b.lastSeen);
|
|
1283
|
-
return density === "fine" ? /* @__PURE__ */
|
|
1267
|
+
return density === "fine" ? /* @__PURE__ */ React14.createElement(SmallPresence, {
|
|
1284
1268
|
count: membersForObject.length
|
|
1285
|
-
}) : /* @__PURE__ */
|
|
1269
|
+
}) : /* @__PURE__ */ React14.createElement(FullPresence, {
|
|
1286
1270
|
members: membersForObject
|
|
1287
1271
|
});
|
|
1288
1272
|
};
|
|
@@ -1292,38 +1276,38 @@ var FullPresence = (props) => {
|
|
|
1292
1276
|
if (members.length === 0) {
|
|
1293
1277
|
return null;
|
|
1294
1278
|
}
|
|
1295
|
-
return /* @__PURE__ */
|
|
1279
|
+
return /* @__PURE__ */ React14.createElement(AvatarGroup.Root, {
|
|
1296
1280
|
size,
|
|
1297
1281
|
classNames: "mbs-2 mie-4",
|
|
1298
1282
|
"data-testid": "spacePlugin.presence"
|
|
1299
|
-
}, members.slice(0, 3).map((member, i) => /* @__PURE__ */
|
|
1283
|
+
}, members.slice(0, 3).map((member, i) => /* @__PURE__ */ React14.createElement(Tooltip2.Root, {
|
|
1300
1284
|
key: member.identity.identityKey.toHex()
|
|
1301
|
-
}, /* @__PURE__ */
|
|
1285
|
+
}, /* @__PURE__ */ React14.createElement(Tooltip2.Trigger, null, /* @__PURE__ */ React14.createElement(PrensenceAvatar, {
|
|
1302
1286
|
identity: member.identity,
|
|
1303
1287
|
group: true,
|
|
1304
1288
|
match: member.currentlyAttended,
|
|
1305
1289
|
index: members.length - i,
|
|
1306
1290
|
onClick: () => onMemberClick?.(member)
|
|
1307
|
-
})), /* @__PURE__ */
|
|
1291
|
+
})), /* @__PURE__ */ React14.createElement(Tooltip2.Portal, null, /* @__PURE__ */ React14.createElement(Tooltip2.Content, {
|
|
1308
1292
|
side: "bottom"
|
|
1309
|
-
}, /* @__PURE__ */
|
|
1293
|
+
}, /* @__PURE__ */ React14.createElement("span", null, getName(member.identity)), /* @__PURE__ */ React14.createElement(Tooltip2.Arrow, null))))), members.length > 3 && /* @__PURE__ */ React14.createElement(Tooltip2.Root, null, /* @__PURE__ */ React14.createElement(Tooltip2.Trigger, null, /* @__PURE__ */ React14.createElement(AvatarGroupItem.Root, {
|
|
1310
1294
|
status: "inactive"
|
|
1311
|
-
}, /* @__PURE__ */
|
|
1295
|
+
}, /* @__PURE__ */ React14.createElement(Avatar.Frame, {
|
|
1312
1296
|
style: {
|
|
1313
1297
|
zIndex: members.length - 4
|
|
1314
1298
|
}
|
|
1315
|
-
}, /* @__PURE__ */
|
|
1299
|
+
}, /* @__PURE__ */ React14.createElement(Avatar.Fallback, {
|
|
1316
1300
|
text: `+${members.length - 3}`
|
|
1317
|
-
})))), /* @__PURE__ */
|
|
1301
|
+
})))), /* @__PURE__ */ React14.createElement(Tooltip2.Portal, null, /* @__PURE__ */ React14.createElement(Tooltip2.Content, {
|
|
1318
1302
|
side: "bottom"
|
|
1319
|
-
}, /* @__PURE__ */
|
|
1303
|
+
}, /* @__PURE__ */ React14.createElement(Tooltip2.Arrow, null), /* @__PURE__ */ React14.createElement(List2, {
|
|
1320
1304
|
classNames: "max-h-56 overflow-y-auto"
|
|
1321
|
-
}, members.map((member) => /* @__PURE__ */
|
|
1305
|
+
}, members.map((member) => /* @__PURE__ */ React14.createElement(ListItem.Root, {
|
|
1322
1306
|
key: member.identity.identityKey.toHex(),
|
|
1323
1307
|
classNames: "flex gap-2 items-center cursor-pointer mbe-2",
|
|
1324
1308
|
onClick: () => onMemberClick?.(member),
|
|
1325
1309
|
"data-testid": "identity-list-item"
|
|
1326
|
-
}, /* @__PURE__ */
|
|
1310
|
+
}, /* @__PURE__ */ React14.createElement(PrensenceAvatar, {
|
|
1327
1311
|
identity: member.identity,
|
|
1328
1312
|
showName: true,
|
|
1329
1313
|
match: member.currentlyAttended
|
|
@@ -1333,10 +1317,10 @@ var PrensenceAvatar = ({ identity, showName, match, group, index, onClick }) =>
|
|
|
1333
1317
|
const Root = group ? AvatarGroupItem.Root : Avatar.Root;
|
|
1334
1318
|
const status = match ? "current" : "active";
|
|
1335
1319
|
const fallbackValue = keyToFallback(identity.identityKey);
|
|
1336
|
-
return /* @__PURE__ */
|
|
1320
|
+
return /* @__PURE__ */ React14.createElement(Root, {
|
|
1337
1321
|
status,
|
|
1338
1322
|
hue: identity.profile?.data?.hue || fallbackValue.hue
|
|
1339
|
-
}, /* @__PURE__ */
|
|
1323
|
+
}, /* @__PURE__ */ React14.createElement(Avatar.Frame, {
|
|
1340
1324
|
"data-testid": "spacePlugin.presence.member",
|
|
1341
1325
|
"data-status": status,
|
|
1342
1326
|
...index ? {
|
|
@@ -1345,9 +1329,9 @@ var PrensenceAvatar = ({ identity, showName, match, group, index, onClick }) =>
|
|
|
1345
1329
|
}
|
|
1346
1330
|
} : {},
|
|
1347
1331
|
onClick: () => onClick?.()
|
|
1348
|
-
}, /* @__PURE__ */
|
|
1332
|
+
}, /* @__PURE__ */ React14.createElement(Avatar.Fallback, {
|
|
1349
1333
|
text: identity.profile?.data?.emoji || fallbackValue.emoji
|
|
1350
|
-
})), showName && /* @__PURE__ */
|
|
1334
|
+
})), showName && /* @__PURE__ */ React14.createElement(Avatar.Label, {
|
|
1351
1335
|
classNames: "text-sm truncate pli-2"
|
|
1352
1336
|
}, getName(identity)));
|
|
1353
1337
|
};
|
|
@@ -1358,36 +1342,37 @@ var SmallPresenceLive = ({ viewers }) => {
|
|
|
1358
1342
|
return () => clearInterval(interval);
|
|
1359
1343
|
}, []);
|
|
1360
1344
|
const activeViewers = viewers ? Array.from(viewers.values()).filter(({ lastSeen }) => moment - lastSeen < ACTIVITY_DURATION) : [];
|
|
1361
|
-
return /* @__PURE__ */
|
|
1345
|
+
return /* @__PURE__ */ React14.createElement(SmallPresence, {
|
|
1362
1346
|
count: activeViewers.length
|
|
1363
1347
|
});
|
|
1364
1348
|
};
|
|
1365
1349
|
var SmallPresence = ({ count }) => {
|
|
1366
1350
|
const { t } = useTranslation14(SPACE_PLUGIN);
|
|
1367
|
-
return /* @__PURE__ */
|
|
1351
|
+
return /* @__PURE__ */ React14.createElement(Tooltip2.Root, null, /* @__PURE__ */ React14.createElement(Tooltip2.Trigger, {
|
|
1368
1352
|
asChild: true
|
|
1369
|
-
}, /* @__PURE__ */
|
|
1353
|
+
}, /* @__PURE__ */ React14.createElement(AttentionGlyph, {
|
|
1370
1354
|
presence: count > 1 ? "many" : count === 1 ? "one" : "none",
|
|
1371
1355
|
classNames: "self-center mie-1"
|
|
1372
|
-
})), /* @__PURE__ */
|
|
1356
|
+
})), /* @__PURE__ */ React14.createElement(Tooltip2.Portal, null, /* @__PURE__ */ React14.createElement(Tooltip2.Content, {
|
|
1373
1357
|
side: "bottom",
|
|
1374
1358
|
classNames: "z-[70]"
|
|
1375
|
-
}, /* @__PURE__ */
|
|
1359
|
+
}, /* @__PURE__ */ React14.createElement("span", null, t("presence label", {
|
|
1376
1360
|
count
|
|
1377
|
-
})), /* @__PURE__ */
|
|
1361
|
+
})), /* @__PURE__ */ React14.createElement(Tooltip2.Arrow, null))));
|
|
1378
1362
|
};
|
|
1379
1363
|
|
|
1380
1364
|
// packages/plugins/plugin-space/src/components/SpaceSettings.tsx
|
|
1381
|
-
import
|
|
1382
|
-
import { useIntentDispatcher as useIntentDispatcher2 } from "@dxos/app-framework";
|
|
1365
|
+
import React15 from "react";
|
|
1366
|
+
import { useIntentDispatcher as useIntentDispatcher2, useResolvePlugins } from "@dxos/app-framework";
|
|
1383
1367
|
import { SettingsValue } from "@dxos/plugin-settings";
|
|
1384
|
-
import { Input as Input3, useTranslation as useTranslation15 } from "@dxos/react-ui";
|
|
1368
|
+
import { Input as Input3, Select, toLocalizedString as toLocalizedString2, useTranslation as useTranslation15 } from "@dxos/react-ui";
|
|
1385
1369
|
var SpaceSettings = ({ settings }) => {
|
|
1386
1370
|
const { t } = useTranslation15(SPACE_PLUGIN);
|
|
1387
1371
|
const dispatch = useIntentDispatcher2();
|
|
1388
|
-
|
|
1372
|
+
const plugins = useResolvePlugins(parseSpaceInitPlugin);
|
|
1373
|
+
return /* @__PURE__ */ React15.createElement(React15.Fragment, null, /* @__PURE__ */ React15.createElement(SettingsValue, {
|
|
1389
1374
|
label: t("show hidden spaces label")
|
|
1390
|
-
}, /* @__PURE__ */
|
|
1375
|
+
}, /* @__PURE__ */ React15.createElement(Input3.Switch, {
|
|
1391
1376
|
checked: settings.showHidden,
|
|
1392
1377
|
onCheckedChange: (checked) => dispatch({
|
|
1393
1378
|
plugin: SPACE_PLUGIN,
|
|
@@ -1396,33 +1381,40 @@ var SpaceSettings = ({ settings }) => {
|
|
|
1396
1381
|
state: !!checked
|
|
1397
1382
|
}
|
|
1398
1383
|
})
|
|
1399
|
-
}))
|
|
1384
|
+
})), /* @__PURE__ */ React15.createElement(SettingsValue, {
|
|
1385
|
+
label: t("default on space create label")
|
|
1386
|
+
}, /* @__PURE__ */ React15.createElement(Select.Root, {
|
|
1387
|
+
value: settings.onSpaceCreate,
|
|
1388
|
+
onValueChange: (value) => {
|
|
1389
|
+
settings.onSpaceCreate = value;
|
|
1390
|
+
}
|
|
1391
|
+
}, /* @__PURE__ */ React15.createElement(Select.TriggerButton, null), /* @__PURE__ */ React15.createElement(Select.Portal, null, /* @__PURE__ */ React15.createElement(Select.Content, null, /* @__PURE__ */ React15.createElement(Select.Viewport, null, plugins.map(({ provides: { space: { onSpaceCreate } } }) => /* @__PURE__ */ React15.createElement(Select.Option, {
|
|
1392
|
+
key: onSpaceCreate.action,
|
|
1393
|
+
value: onSpaceCreate.action
|
|
1394
|
+
}, toLocalizedString2(onSpaceCreate.label, t)))))))));
|
|
1400
1395
|
};
|
|
1401
1396
|
|
|
1402
1397
|
// packages/plugins/plugin-space/src/components/SaveStatus.tsx
|
|
1403
|
-
import {
|
|
1404
|
-
import React17, { useEffect as useEffect5 } from "react";
|
|
1398
|
+
import React16, { useEffect as useEffect5, useState as useState8 } from "react";
|
|
1405
1399
|
import { Context } from "@dxos/context";
|
|
1406
1400
|
import { StatusBar } from "@dxos/plugin-status-bar";
|
|
1407
1401
|
import { useClient as useClient4 } from "@dxos/react-client";
|
|
1408
|
-
import { useTranslation as useTranslation16 } from "@dxos/react-ui";
|
|
1409
|
-
import { getSize as getSize5 } from "@dxos/react-ui-theme";
|
|
1402
|
+
import { Icon, useTranslation as useTranslation16 } from "@dxos/react-ui";
|
|
1410
1403
|
var __dxlog_file3 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/SaveStatus.tsx";
|
|
1411
1404
|
var SaveStatus = () => {
|
|
1412
1405
|
const { t } = useTranslation16(SPACE_PLUGIN);
|
|
1413
1406
|
const client = useClient4();
|
|
1414
|
-
const [state, setState] =
|
|
1407
|
+
const [state, setState] = useState8("saved");
|
|
1415
1408
|
useEffect5(() => {
|
|
1416
1409
|
return createClientSaveTracker(client, (state2) => {
|
|
1417
1410
|
setState(state2);
|
|
1418
1411
|
});
|
|
1419
1412
|
}, []);
|
|
1420
|
-
return /* @__PURE__ */
|
|
1413
|
+
return /* @__PURE__ */ React16.createElement(StatusBar.Item, {
|
|
1421
1414
|
title: state === "saving" ? t("saving label") : t("saved label")
|
|
1422
|
-
},
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
className: getSize5(3)
|
|
1415
|
+
}, /* @__PURE__ */ React16.createElement(Icon, {
|
|
1416
|
+
icon: state === "saving" ? "ph--arrows-clockwise--regular" : "ph--check-circle--regular",
|
|
1417
|
+
size: 4
|
|
1426
1418
|
}));
|
|
1427
1419
|
};
|
|
1428
1420
|
var createClientSaveTracker = (client, cb) => {
|
|
@@ -1453,7 +1445,7 @@ var createClientSaveTracker = (client, cb) => {
|
|
|
1453
1445
|
var createSpaceSaveTracker = (space, cb) => {
|
|
1454
1446
|
const ctx = new Context(void 0, {
|
|
1455
1447
|
F: __dxlog_file3,
|
|
1456
|
-
L:
|
|
1448
|
+
L: 64
|
|
1457
1449
|
});
|
|
1458
1450
|
void space.waitUntilReady().then(() => {
|
|
1459
1451
|
if (ctx.disposed) {
|
|
@@ -1484,6 +1476,214 @@ var createSpaceSaveTracker = (space, cb) => {
|
|
|
1484
1476
|
};
|
|
1485
1477
|
};
|
|
1486
1478
|
|
|
1479
|
+
// packages/plugins/plugin-space/src/components/SyncStatus/SyncStatus.tsx
|
|
1480
|
+
import React17, { useEffect as useEffect7, useState as useState10 } from "react";
|
|
1481
|
+
import { StatusBar as StatusBar2 } from "@dxos/plugin-status-bar";
|
|
1482
|
+
import { Icon as Icon2, Popover as Popover3, useTranslation as useTranslation17 } from "@dxos/react-ui";
|
|
1483
|
+
import { SyntaxHighlighter } from "@dxos/react-ui-syntax-highlighter";
|
|
1484
|
+
import { mx as mx9 } from "@dxos/react-ui-theme";
|
|
1485
|
+
|
|
1486
|
+
// packages/plugins/plugin-space/src/components/SyncStatus/types.ts
|
|
1487
|
+
import { useEffect as useEffect6, useState as useState9 } from "react";
|
|
1488
|
+
import { Context as Context2 } from "@dxos/context";
|
|
1489
|
+
import { EdgeService } from "@dxos/protocols";
|
|
1490
|
+
import { useClient as useClient5 } from "@dxos/react-client";
|
|
1491
|
+
var __dxlog_file4 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/SyncStatus/types.ts";
|
|
1492
|
+
var createEmptyEdgeSyncState = () => ({
|
|
1493
|
+
missingOnLocal: 0,
|
|
1494
|
+
missingOnRemote: 0,
|
|
1495
|
+
localDocumentCount: 0,
|
|
1496
|
+
remoteDocumentCount: 0,
|
|
1497
|
+
differentDocuments: 0
|
|
1498
|
+
});
|
|
1499
|
+
var getSyncSummary = (syncMap) => {
|
|
1500
|
+
return Object.entries(syncMap).reduce((summary, [_spaceId, peerState]) => {
|
|
1501
|
+
summary.missingOnLocal += peerState.missingOnLocal;
|
|
1502
|
+
summary.missingOnRemote += peerState.missingOnRemote;
|
|
1503
|
+
summary.localDocumentCount += peerState.localDocumentCount;
|
|
1504
|
+
summary.remoteDocumentCount += peerState.remoteDocumentCount;
|
|
1505
|
+
summary.differentDocuments += peerState.differentDocuments;
|
|
1506
|
+
return summary;
|
|
1507
|
+
}, createEmptyEdgeSyncState());
|
|
1508
|
+
};
|
|
1509
|
+
var isEdgePeerId = (peerId, spaceId) => peerId.startsWith(`${EdgeService.AUTOMERGE_REPLICATOR}:${spaceId}`);
|
|
1510
|
+
var useSyncState = () => {
|
|
1511
|
+
const client = useClient5();
|
|
1512
|
+
const [spaceState, setSpaceState] = useState9({});
|
|
1513
|
+
useEffect6(() => {
|
|
1514
|
+
const ctx = new Context2(void 0, {
|
|
1515
|
+
F: __dxlog_file4,
|
|
1516
|
+
L: 48
|
|
1517
|
+
});
|
|
1518
|
+
const createSubscriptions = (spaces) => {
|
|
1519
|
+
for (const space of spaces) {
|
|
1520
|
+
if (spaceState[space.id]) {
|
|
1521
|
+
continue;
|
|
1522
|
+
}
|
|
1523
|
+
ctx.onDispose(space.crud.subscribeToSyncState(ctx, ({ peers = [] }) => {
|
|
1524
|
+
const syncState = peers.find((state) => isEdgePeerId(state.peerId, space.id));
|
|
1525
|
+
if (syncState) {
|
|
1526
|
+
setSpaceState((spaceState2) => ({
|
|
1527
|
+
...spaceState2,
|
|
1528
|
+
[space.id]: syncState
|
|
1529
|
+
}));
|
|
1530
|
+
}
|
|
1531
|
+
}));
|
|
1532
|
+
}
|
|
1533
|
+
};
|
|
1534
|
+
createSubscriptions(client.spaces.get());
|
|
1535
|
+
client.spaces.subscribe((spaces) => {
|
|
1536
|
+
createSubscriptions(spaces);
|
|
1537
|
+
});
|
|
1538
|
+
return () => {
|
|
1539
|
+
void ctx.dispose();
|
|
1540
|
+
};
|
|
1541
|
+
}, [
|
|
1542
|
+
client
|
|
1543
|
+
]);
|
|
1544
|
+
return spaceState;
|
|
1545
|
+
};
|
|
1546
|
+
|
|
1547
|
+
// packages/plugins/plugin-space/src/components/SyncStatus/SyncStatus.tsx
|
|
1548
|
+
var SYNC_STALLED_TIMEOUT = 5e3;
|
|
1549
|
+
var styles = {
|
|
1550
|
+
barBg: "bg-neutral-50 dark:bg-green-900 text-black",
|
|
1551
|
+
barFg: "bg-neutral-100 bg-green-500",
|
|
1552
|
+
barHover: "dark:hover:bg-green-500"
|
|
1553
|
+
};
|
|
1554
|
+
var SyncStatus = () => {
|
|
1555
|
+
const state = useSyncState();
|
|
1556
|
+
return /* @__PURE__ */ React17.createElement(SyncStatusIndicator, {
|
|
1557
|
+
state
|
|
1558
|
+
});
|
|
1559
|
+
};
|
|
1560
|
+
var SyncStatusIndicator = ({ state }) => {
|
|
1561
|
+
const summary = getSyncSummary(state);
|
|
1562
|
+
const offline = false;
|
|
1563
|
+
const needsToUpload = summary.differentDocuments > 0 || summary.missingOnRemote > 0;
|
|
1564
|
+
const needsToDownload = summary.differentDocuments > 0 || summary.missingOnLocal > 0;
|
|
1565
|
+
const [classNames, setClassNames] = useState10();
|
|
1566
|
+
useEffect7(() => {
|
|
1567
|
+
setClassNames(void 0);
|
|
1568
|
+
if (!needsToUpload && !needsToDownload) {
|
|
1569
|
+
return;
|
|
1570
|
+
}
|
|
1571
|
+
const t = setTimeout(() => {
|
|
1572
|
+
setClassNames("text-orange-500");
|
|
1573
|
+
}, SYNC_STALLED_TIMEOUT);
|
|
1574
|
+
return () => clearTimeout(t);
|
|
1575
|
+
}, [
|
|
1576
|
+
needsToUpload,
|
|
1577
|
+
needsToDownload
|
|
1578
|
+
]);
|
|
1579
|
+
return /* @__PURE__ */ React17.createElement(StatusBar2.Item, null, /* @__PURE__ */ React17.createElement(Popover3.Root, null, /* @__PURE__ */ React17.createElement(Popover3.Trigger, null, /* @__PURE__ */ React17.createElement(Icon2, {
|
|
1580
|
+
icon: offline ? "ph--cloud-x--regular" : needsToUpload ? "ph--cloud-arrow-up--regular" : needsToDownload ? "ph--cloud-arrow-down--regular" : "ph--cloud-check--regular",
|
|
1581
|
+
size: 4,
|
|
1582
|
+
classNames
|
|
1583
|
+
})), /* @__PURE__ */ React17.createElement(Popover3.Content, null, /* @__PURE__ */ React17.createElement(SyncStatusDetail, {
|
|
1584
|
+
state,
|
|
1585
|
+
summary,
|
|
1586
|
+
debug: false
|
|
1587
|
+
}))));
|
|
1588
|
+
};
|
|
1589
|
+
var SyncStatusDetail = ({ classNames, state, summary, debug }) => {
|
|
1590
|
+
const { t } = useTranslation17(SPACE_PLUGIN);
|
|
1591
|
+
const entries = Object.entries(state).sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0);
|
|
1592
|
+
return /* @__PURE__ */ React17.createElement("div", {
|
|
1593
|
+
className: mx9("flex flex-col text-xs min-w-[16rem]", classNames)
|
|
1594
|
+
}, /* @__PURE__ */ React17.createElement("h1", {
|
|
1595
|
+
className: "p-2"
|
|
1596
|
+
}, t("sync status title")), /* @__PURE__ */ React17.createElement("div", {
|
|
1597
|
+
className: "flex flex-col gap-[2px] my-[2px]"
|
|
1598
|
+
}, entries.map(([spaceId, state2]) => /* @__PURE__ */ React17.createElement(SpaceRow, {
|
|
1599
|
+
key: spaceId,
|
|
1600
|
+
spaceId,
|
|
1601
|
+
state: state2
|
|
1602
|
+
}))), debug && /* @__PURE__ */ React17.createElement(SyntaxHighlighter, {
|
|
1603
|
+
language: "json"
|
|
1604
|
+
}, JSON.stringify(summary, null, 2)));
|
|
1605
|
+
};
|
|
1606
|
+
var useActive = (count) => {
|
|
1607
|
+
const [current, setCurrent] = useState10(count);
|
|
1608
|
+
const [active, setActive] = useState10(false);
|
|
1609
|
+
useEffect7(() => {
|
|
1610
|
+
let t;
|
|
1611
|
+
if (count !== current) {
|
|
1612
|
+
setActive(true);
|
|
1613
|
+
setCurrent(count);
|
|
1614
|
+
t && clearTimeout(t);
|
|
1615
|
+
t = setTimeout(() => {
|
|
1616
|
+
setActive(false);
|
|
1617
|
+
}, SYNC_STALLED_TIMEOUT);
|
|
1618
|
+
}
|
|
1619
|
+
return () => {
|
|
1620
|
+
setActive(false);
|
|
1621
|
+
clearTimeout(t);
|
|
1622
|
+
};
|
|
1623
|
+
}, [
|
|
1624
|
+
count,
|
|
1625
|
+
current
|
|
1626
|
+
]);
|
|
1627
|
+
return active;
|
|
1628
|
+
};
|
|
1629
|
+
var SpaceRow = ({ spaceId, state: { localDocumentCount, remoteDocumentCount, missingOnLocal, missingOnRemote } }) => {
|
|
1630
|
+
const downActive = useActive(localDocumentCount);
|
|
1631
|
+
const upActive = useActive(remoteDocumentCount);
|
|
1632
|
+
return /* @__PURE__ */ React17.createElement("div", {
|
|
1633
|
+
className: mx9("flex items-center mx-[2px] gap-[2px] cursor-pointer", styles.barHover),
|
|
1634
|
+
title: spaceId,
|
|
1635
|
+
onClick: () => {
|
|
1636
|
+
void navigator.clipboard.writeText(spaceId);
|
|
1637
|
+
}
|
|
1638
|
+
}, /* @__PURE__ */ React17.createElement(Icon2, {
|
|
1639
|
+
icon: "ph--arrow-fat-line-left--regular",
|
|
1640
|
+
size: 3,
|
|
1641
|
+
classNames: mx9(downActive && "animate-[pulse_1s_infinite]")
|
|
1642
|
+
}), /* @__PURE__ */ React17.createElement(Candle, {
|
|
1643
|
+
up: {
|
|
1644
|
+
count: remoteDocumentCount,
|
|
1645
|
+
total: remoteDocumentCount + missingOnRemote
|
|
1646
|
+
},
|
|
1647
|
+
down: {
|
|
1648
|
+
count: localDocumentCount,
|
|
1649
|
+
total: localDocumentCount + missingOnLocal
|
|
1650
|
+
},
|
|
1651
|
+
title: spaceId
|
|
1652
|
+
}), /* @__PURE__ */ React17.createElement(Icon2, {
|
|
1653
|
+
icon: "ph--arrow-fat-line-right--regular",
|
|
1654
|
+
size: 3,
|
|
1655
|
+
classNames: mx9(upActive && "animate-[pulse_1s_step-start_infinite]")
|
|
1656
|
+
}));
|
|
1657
|
+
};
|
|
1658
|
+
var Candle = ({ classNames, up, down }) => {
|
|
1659
|
+
return /* @__PURE__ */ React17.createElement("div", {
|
|
1660
|
+
className: mx9("grid grid-cols-[1fr_2rem_1fr] w-full h-3", classNames)
|
|
1661
|
+
}, /* @__PURE__ */ React17.createElement(Bar, {
|
|
1662
|
+
classNames: "justify-end",
|
|
1663
|
+
...up
|
|
1664
|
+
}), /* @__PURE__ */ React17.createElement("div", {
|
|
1665
|
+
className: "relative"
|
|
1666
|
+
}, /* @__PURE__ */ React17.createElement("div", {
|
|
1667
|
+
className: mx9("absolute inset-0 flex items-center justify-center text-xs", styles.barBg)
|
|
1668
|
+
}, up.total)), /* @__PURE__ */ React17.createElement(Bar, down));
|
|
1669
|
+
};
|
|
1670
|
+
var Bar = ({ classNames, count, total }) => {
|
|
1671
|
+
let p = count / total * 100;
|
|
1672
|
+
if (count < total) {
|
|
1673
|
+
p = Math.min(p, 95);
|
|
1674
|
+
}
|
|
1675
|
+
return /* @__PURE__ */ React17.createElement("div", {
|
|
1676
|
+
className: mx9("relative flex w-full", styles.barBg, classNames)
|
|
1677
|
+
}, /* @__PURE__ */ React17.createElement("div", {
|
|
1678
|
+
className: mx9("shrink-0", styles.barFg),
|
|
1679
|
+
style: {
|
|
1680
|
+
width: `${p}%`
|
|
1681
|
+
}
|
|
1682
|
+
}), count !== total && /* @__PURE__ */ React17.createElement("div", {
|
|
1683
|
+
className: "absolute top-0 bottom-0 flex items-center mx-0.5 text-black text-xs"
|
|
1684
|
+
}, count));
|
|
1685
|
+
};
|
|
1686
|
+
|
|
1487
1687
|
// packages/plugins/plugin-space/src/translations.ts
|
|
1488
1688
|
var translations_default = [
|
|
1489
1689
|
{
|
|
@@ -1563,21 +1763,25 @@ var translations_default = [
|
|
|
1563
1763
|
"space limit close label": "Close",
|
|
1564
1764
|
"remove deleted objects label": "Cleanup",
|
|
1565
1765
|
"remove deleted objects alt": "Permanently remove deleted objects to free up space.",
|
|
1566
|
-
"copy link label": "Copy link"
|
|
1766
|
+
"copy link label": "Copy link",
|
|
1767
|
+
"default on space create label": "On space create",
|
|
1768
|
+
"sync status title": "Sync status"
|
|
1567
1769
|
}
|
|
1568
1770
|
}
|
|
1569
1771
|
}
|
|
1570
1772
|
];
|
|
1571
1773
|
|
|
1572
1774
|
// packages/plugins/plugin-space/src/SpacePlugin.tsx
|
|
1573
|
-
var
|
|
1775
|
+
var __dxlog_file5 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/SpacePlugin.tsx";
|
|
1574
1776
|
var ACTIVE_NODE_BROADCAST_INTERVAL = 3e4;
|
|
1575
1777
|
var OBJECT_ID_LENGTH = 60;
|
|
1576
1778
|
var SPACE_MAX_OBJECTS = 500;
|
|
1577
1779
|
var DIRECTORY_TYPE = "text/directory";
|
|
1578
1780
|
var parseSpacePlugin = (plugin) => Array.isArray(plugin?.provides.space?.enabled) ? plugin : void 0;
|
|
1579
1781
|
var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
1580
|
-
const settings = new LocalStorageStore(SPACE_PLUGIN
|
|
1782
|
+
const settings = new LocalStorageStore(SPACE_PLUGIN, {
|
|
1783
|
+
onSpaceCreate: "dxos.org/plugin/markdown/action/create"
|
|
1784
|
+
});
|
|
1581
1785
|
const state = new LocalStorageStore(SPACE_PLUGIN, {
|
|
1582
1786
|
awaiting: void 0,
|
|
1583
1787
|
spaceNames: {},
|
|
@@ -1657,8 +1861,8 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
1657
1861
|
log2.warn("Failed to broadcast active node for presence.", {
|
|
1658
1862
|
err: err.message
|
|
1659
1863
|
}, {
|
|
1660
|
-
F:
|
|
1661
|
-
L:
|
|
1864
|
+
F: __dxlog_file5,
|
|
1865
|
+
L: 225,
|
|
1662
1866
|
S: void 0,
|
|
1663
1867
|
C: (f, a) => f(...a)
|
|
1664
1868
|
});
|
|
@@ -1779,8 +1983,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
1779
1983
|
ns: SPACE_PLUGIN
|
|
1780
1984
|
}
|
|
1781
1985
|
],
|
|
1782
|
-
icon:
|
|
1783
|
-
iconSymbol: "ph--cards-three--regular",
|
|
1986
|
+
icon: "ph--cards-three--regular",
|
|
1784
1987
|
// TODO(wittjosiah): Move out of metadata.
|
|
1785
1988
|
loadReferences: (collection) => loadObjectReferences(collection, (collection2) => [
|
|
1786
1989
|
...collection2.objects,
|
|
@@ -1887,7 +2090,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
1887
2090
|
});
|
|
1888
2091
|
}
|
|
1889
2092
|
case "status": {
|
|
1890
|
-
return /* @__PURE__ */ React18.createElement(SaveStatus, null);
|
|
2093
|
+
return /* @__PURE__ */ React18.createElement(React18.Fragment, null, /* @__PURE__ */ React18.createElement(SyncStatus, null), /* @__PURE__ */ React18.createElement(SaveStatus, null));
|
|
1891
2094
|
}
|
|
1892
2095
|
default:
|
|
1893
2096
|
return null;
|
|
@@ -1948,8 +2151,8 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
1948
2151
|
spacesOrder.order = nextOrder.map(({ id }) => id);
|
|
1949
2152
|
} else {
|
|
1950
2153
|
log2.warn("spaces order object not found", void 0, {
|
|
1951
|
-
F:
|
|
1952
|
-
L:
|
|
2154
|
+
F: __dxlog_file5,
|
|
2155
|
+
L: 524,
|
|
1953
2156
|
S: void 0,
|
|
1954
2157
|
C: (f, a) => f(...a)
|
|
1955
2158
|
});
|
|
@@ -1985,8 +2188,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
1985
2188
|
ns: SPACE_PLUGIN
|
|
1986
2189
|
}
|
|
1987
2190
|
],
|
|
1988
|
-
icon:
|
|
1989
|
-
iconSymbol: "ph--plus--regular",
|
|
2191
|
+
icon: "ph--plus--regular",
|
|
1990
2192
|
disposition: "toolbar",
|
|
1991
2193
|
testId: "spacePlugin.createSpace"
|
|
1992
2194
|
}
|
|
@@ -2011,8 +2213,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2011
2213
|
ns: SPACE_PLUGIN
|
|
2012
2214
|
}
|
|
2013
2215
|
],
|
|
2014
|
-
icon:
|
|
2015
|
-
iconSymbol: "ph--sign-in--regular",
|
|
2216
|
+
icon: "ph--sign-in--regular",
|
|
2016
2217
|
testId: "spacePlugin.joinSpace"
|
|
2017
2218
|
}
|
|
2018
2219
|
}
|
|
@@ -2247,6 +2448,25 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2247
2448
|
}
|
|
2248
2449
|
},
|
|
2249
2450
|
intents: [
|
|
2451
|
+
...settings.values.onSpaceCreate ? [
|
|
2452
|
+
[
|
|
2453
|
+
{
|
|
2454
|
+
action: settings.values.onSpaceCreate,
|
|
2455
|
+
data: {
|
|
2456
|
+
space
|
|
2457
|
+
}
|
|
2458
|
+
},
|
|
2459
|
+
{
|
|
2460
|
+
action: SpaceAction.ADD_OBJECT,
|
|
2461
|
+
data: {
|
|
2462
|
+
target: space
|
|
2463
|
+
}
|
|
2464
|
+
},
|
|
2465
|
+
{
|
|
2466
|
+
action: NavigationAction3.EXPOSE
|
|
2467
|
+
}
|
|
2468
|
+
]
|
|
2469
|
+
] : [],
|
|
2250
2470
|
[
|
|
2251
2471
|
{
|
|
2252
2472
|
action: ObservabilityAction.SEND_EVENT,
|
|
@@ -2467,8 +2687,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2467
2687
|
title: translations_default[0]["en-US"][SPACE_PLUGIN]["space limit label"],
|
|
2468
2688
|
description: translations_default[0]["en-US"][SPACE_PLUGIN]["space limit description"],
|
|
2469
2689
|
duration: 5e3,
|
|
2470
|
-
icon:
|
|
2471
|
-
iconSymbol: "ph--warning--regular",
|
|
2690
|
+
icon: "ph--warning--regular",
|
|
2472
2691
|
actionLabel: translations_default[0]["en-US"][SPACE_PLUGIN]["remove deleted objects label"],
|
|
2473
2692
|
actionAlt: translations_default[0]["en-US"][SPACE_PLUGIN]["remove deleted objects alt"],
|
|
2474
2693
|
// TODO(wittjosiah): Use OS namespace.
|
|
@@ -2510,7 +2729,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2510
2729
|
}
|
|
2511
2730
|
return {
|
|
2512
2731
|
data: {
|
|
2513
|
-
id: object
|
|
2732
|
+
id: fullyQualifiedId4(object),
|
|
2514
2733
|
object,
|
|
2515
2734
|
activeParts: {
|
|
2516
2735
|
main: [
|
|
@@ -2563,8 +2782,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2563
2782
|
data: {
|
|
2564
2783
|
activeParts: {
|
|
2565
2784
|
main: deletionData.wasActive,
|
|
2566
|
-
sidebar: deletionData.wasActive
|
|
2567
|
-
complementary: deletionData.wasActive
|
|
2785
|
+
sidebar: deletionData.wasActive
|
|
2568
2786
|
}
|
|
2569
2787
|
}
|
|
2570
2788
|
});
|
|
@@ -2688,6 +2906,7 @@ export {
|
|
|
2688
2906
|
EmptyTree,
|
|
2689
2907
|
FullPresence,
|
|
2690
2908
|
MenuFooter,
|
|
2909
|
+
MessageState,
|
|
2691
2910
|
MessageType,
|
|
2692
2911
|
MissingObject,
|
|
2693
2912
|
PersistenceStatus,
|
|
@@ -2709,6 +2928,9 @@ export {
|
|
|
2709
2928
|
SpacePlugin,
|
|
2710
2929
|
SpacePresence,
|
|
2711
2930
|
SpaceSettings,
|
|
2931
|
+
SyncStatus,
|
|
2932
|
+
SyncStatusDetail,
|
|
2933
|
+
SyncStatusIndicator,
|
|
2712
2934
|
ThreadStatus,
|
|
2713
2935
|
ThreadType,
|
|
2714
2936
|
cloneObject,
|
|
@@ -2723,6 +2945,7 @@ export {
|
|
|
2723
2945
|
getNestedObjects,
|
|
2724
2946
|
getSpaceDisplayName,
|
|
2725
2947
|
memoizeQuery,
|
|
2948
|
+
parseSpaceInitPlugin,
|
|
2726
2949
|
parseSpacePlugin,
|
|
2727
2950
|
translations_default as translations
|
|
2728
2951
|
};
|