@dxos/plugin-space 0.6.12-staging.e11e696 → 0.6.13-main.09887cd
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-WBMH5WIP.mjs → chunk-QK5I2EPF.mjs} +10 -3
- package/dist/lib/browser/chunk-QK5I2EPF.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +278 -245
- 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 +1 -1
- package/dist/lib/node/{chunk-GF3SRAQM.cjs → chunk-HE2GHO6Z.cjs} +13 -6
- 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 +467 -433
- 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 +11 -11
- package/dist/lib/node/types/index.cjs.map +1 -1
- package/dist/lib/node-esm/{chunk-N5VC55UM.mjs → chunk-2TR4WD6U.mjs} +10 -3
- package/dist/lib/node-esm/chunk-2TR4WD6U.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-GM2YUC77.mjs → chunk-YPQGKWHJ.mjs} +1 -1
- package/dist/lib/node-esm/chunk-YPQGKWHJ.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +278 -245
- 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 +1 -1
- package/dist/lib/node-esm/types/index.mjs +1 -1
- package/dist/types/src/SpacePlugin.d.ts.map +1 -1
- package/dist/types/src/components/FallbackSettings.d.ts +8 -0
- package/dist/types/src/components/FallbackSettings.d.ts.map +1 -0
- 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/SpacePresence.stories.d.ts +2 -0
- package/dist/types/src/components/SpacePresence.stories.d.ts.map +1 -1
- package/dist/types/src/components/SyncStatus/SyncStatus.stories.d.ts +2 -0
- package/dist/types/src/components/SyncStatus/SyncStatus.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +1 -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 +2 -0
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/thread.d.ts +1 -0
- package/dist/types/src/types/thread.d.ts.map +1 -1
- package/package.json +34 -33
- package/src/SpacePlugin.tsx +103 -60
- package/src/components/FallbackSettings.tsx +35 -0
- package/src/components/index.ts +1 -2
- package/src/meta.ts +3 -1
- package/src/translations.ts +2 -0
- package/src/types/collection.ts +1 -1
- package/src/types/thread.ts +2 -1
- package/dist/lib/browser/chunk-LZEGRS7H.mjs.map +0 -7
- package/dist/lib/browser/chunk-WBMH5WIP.mjs.map +0 -7
- package/dist/lib/node/chunk-6CNYF6YU.cjs.map +0 -7
- package/dist/lib/node/chunk-GF3SRAQM.cjs.map +0 -7
- package/dist/lib/node-esm/chunk-GM2YUC77.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-N5VC55UM.mjs.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
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
SPACE_PLUGIN_SHORT_ID,
|
|
5
5
|
SpaceAction,
|
|
6
6
|
meta_default
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-YPQGKWHJ.mjs";
|
|
8
8
|
import {
|
|
9
9
|
ActorSchema,
|
|
10
10
|
ChannelType,
|
|
@@ -16,23 +16,24 @@ import {
|
|
|
16
16
|
ThreadStatus,
|
|
17
17
|
ThreadType,
|
|
18
18
|
parseSpaceInitPlugin
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-2TR4WD6U.mjs";
|
|
20
20
|
|
|
21
21
|
// packages/plugins/plugin-space/src/SpacePlugin.tsx
|
|
22
|
-
import {
|
|
23
|
-
import
|
|
22
|
+
import { signal } from "@preact/signals-core";
|
|
23
|
+
import React17 from "react";
|
|
24
24
|
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";
|
|
25
25
|
import { EventSubscriptions } from "@dxos/async";
|
|
26
26
|
import { isReactiveObject as isReactiveObject2 } from "@dxos/echo-schema";
|
|
27
|
+
import { scheduledEffect } from "@dxos/echo-signals/core";
|
|
27
28
|
import { LocalStorageStore } from "@dxos/local-storage";
|
|
28
29
|
import { log as log2 } from "@dxos/log";
|
|
29
30
|
import { Migrations as Migrations2 } from "@dxos/migrations";
|
|
30
31
|
import { parseAttentionPlugin } from "@dxos/plugin-attention";
|
|
31
32
|
import { parseClientPlugin } from "@dxos/plugin-client";
|
|
32
|
-
import { createExtension,
|
|
33
|
+
import { createExtension, memoize as memoize2, toSignal } from "@dxos/plugin-graph";
|
|
33
34
|
import { ObservabilityAction } from "@dxos/plugin-observability/meta";
|
|
34
35
|
import { PublicKey as PublicKey2 } from "@dxos/react-client";
|
|
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 } from "@dxos/react-client/echo";
|
|
36
|
+
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";
|
|
36
37
|
import { Dialog } from "@dxos/react-ui";
|
|
37
38
|
import { ClipboardProvider as ClipboardProvider2, InvitationManager, osTranslations } from "@dxos/shell/react";
|
|
38
39
|
import { ComplexMap as ComplexMap2, nonNullable, reduceGroupBy } from "@dxos/util";
|
|
@@ -160,36 +161,32 @@ var CollectionSection = ({ collection }) => {
|
|
|
160
161
|
}, collection.name ?? t("unnamed collection label")));
|
|
161
162
|
};
|
|
162
163
|
|
|
163
|
-
// packages/plugins/plugin-space/src/components/
|
|
164
|
+
// packages/plugins/plugin-space/src/components/FallbackSettings.tsx
|
|
164
165
|
import React4 from "react";
|
|
165
|
-
import { useTranslation as useTranslation4 } from "@dxos/react-ui";
|
|
166
|
-
|
|
167
|
-
var EmptySpace = () => {
|
|
166
|
+
import { Input, useTranslation as useTranslation4 } from "@dxos/react-ui";
|
|
167
|
+
var FallbackSettings = ({ object }) => {
|
|
168
168
|
const { t } = useTranslation4(SPACE_PLUGIN);
|
|
169
169
|
return /* @__PURE__ */ React4.createElement("div", {
|
|
170
|
+
role: "form",
|
|
171
|
+
className: "p-3 flex flex-col gap-2"
|
|
172
|
+
}, /* @__PURE__ */ React4.createElement("div", {
|
|
170
173
|
role: "none",
|
|
171
|
-
className:
|
|
172
|
-
}, t("
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
var EmptyTree = () => {
|
|
180
|
-
const { t } = useTranslation5(SPACE_PLUGIN);
|
|
181
|
-
return /* @__PURE__ */ React5.createElement("div", {
|
|
182
|
-
role: "none",
|
|
183
|
-
className: mx4("p-2 mli-2 mbe-2 text-center border border-dashed border-neutral-400/50 rounded-lg", descriptionText3)
|
|
184
|
-
}, t("empty tree message"));
|
|
174
|
+
className: "space-b-1"
|
|
175
|
+
}, /* @__PURE__ */ React4.createElement(Input.Root, null, /* @__PURE__ */ React4.createElement(Input.Label, null, t("name label")), /* @__PURE__ */ React4.createElement(Input.TextInput, {
|
|
176
|
+
placeholder: t("name placeholder"),
|
|
177
|
+
value: object.name,
|
|
178
|
+
onChange: (event) => {
|
|
179
|
+
object.name = event.target.value;
|
|
180
|
+
}
|
|
181
|
+
}))));
|
|
185
182
|
};
|
|
186
183
|
|
|
187
184
|
// packages/plugins/plugin-space/src/components/MenuFooter.tsx
|
|
188
185
|
import { Planet } from "@phosphor-icons/react";
|
|
189
|
-
import
|
|
186
|
+
import React5 from "react";
|
|
190
187
|
import { getSpace as getSpace2 } from "@dxos/client/echo";
|
|
191
188
|
import { useClient as useClient2 } from "@dxos/react-client";
|
|
192
|
-
import { DropdownMenu, toLocalizedString, useTranslation as
|
|
189
|
+
import { DropdownMenu, toLocalizedString, useTranslation as useTranslation5 } from "@dxos/react-ui";
|
|
193
190
|
|
|
194
191
|
// packages/plugins/plugin-space/src/util.tsx
|
|
195
192
|
import { NavigationAction as NavigationAction2 } from "@dxos/app-framework";
|
|
@@ -747,31 +744,31 @@ var cloneObject = async (object, resolve) => {
|
|
|
747
744
|
|
|
748
745
|
// packages/plugins/plugin-space/src/components/MenuFooter.tsx
|
|
749
746
|
var MenuFooter = ({ object }) => {
|
|
750
|
-
const { t } =
|
|
747
|
+
const { t } = useTranslation5(SPACE_PLUGIN);
|
|
751
748
|
const client = useClient2();
|
|
752
749
|
const space = getSpace2(object);
|
|
753
750
|
const spaceName = space ? getSpaceDisplayName(space, {
|
|
754
751
|
personal: client.spaces.default === space
|
|
755
752
|
}) : "";
|
|
756
|
-
return space ? /* @__PURE__ */
|
|
753
|
+
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", {
|
|
757
754
|
className: "pis-2 mbe-2 text-xs grid grid-cols-[max-content_1fr] gap-2"
|
|
758
|
-
}, /* @__PURE__ */
|
|
755
|
+
}, /* @__PURE__ */ React5.createElement("dt", {
|
|
759
756
|
className: "uppercase text-[.75em] tracking-wide font-medium mbs-px self-start"
|
|
760
|
-
}, t("location label")), /* @__PURE__ */
|
|
757
|
+
}, t("location label")), /* @__PURE__ */ React5.createElement("dd", {
|
|
761
758
|
className: "line-clamp-3"
|
|
762
|
-
}, /* @__PURE__ */
|
|
759
|
+
}, /* @__PURE__ */ React5.createElement(Planet, {
|
|
763
760
|
className: "inline-block mie-1"
|
|
764
761
|
}), toLocalizedString(spaceName, t)))) : null;
|
|
765
762
|
};
|
|
766
763
|
|
|
767
764
|
// packages/plugins/plugin-space/src/components/MissingObject.tsx
|
|
768
|
-
import
|
|
765
|
+
import React6, { useEffect as useEffect2, useState as useState2 } from "react";
|
|
769
766
|
import { parseIntentPlugin as parseIntentPlugin2, useResolvePlugin as useResolvePlugin2 } from "@dxos/app-framework";
|
|
770
|
-
import { Status, useTranslation as
|
|
771
|
-
import { baseSurface as baseSurface2, descriptionText as
|
|
767
|
+
import { Status, useTranslation as useTranslation6 } from "@dxos/react-ui";
|
|
768
|
+
import { baseSurface as baseSurface2, descriptionText as descriptionText2, mx as mx3 } from "@dxos/react-ui-theme";
|
|
772
769
|
var WAIT_FOR_OBJECT_TIMEOUT2 = 1e3;
|
|
773
770
|
var MissingObject = ({ id }) => {
|
|
774
|
-
const { t } =
|
|
771
|
+
const { t } = useTranslation6(SPACE_PLUGIN);
|
|
775
772
|
const [waiting, setWaiting] = useState2(false);
|
|
776
773
|
const intentPlugin = useResolvePlugin2(parseIntentPlugin2);
|
|
777
774
|
useEffect2(() => {
|
|
@@ -793,13 +790,13 @@ var MissingObject = ({ id }) => {
|
|
|
793
790
|
intentPlugin,
|
|
794
791
|
id
|
|
795
792
|
]);
|
|
796
|
-
return /* @__PURE__ */
|
|
793
|
+
return /* @__PURE__ */ React6.createElement("div", {
|
|
797
794
|
role: "none",
|
|
798
|
-
className:
|
|
799
|
-
}, waiting ? /* @__PURE__ */
|
|
795
|
+
className: mx3(baseSurface2, "min-bs-screen is-full flex items-center justify-center p-8")
|
|
796
|
+
}, waiting ? /* @__PURE__ */ React6.createElement("p", {
|
|
800
797
|
role: "alert",
|
|
801
|
-
className:
|
|
802
|
-
}, t("missing object message")) : /* @__PURE__ */
|
|
798
|
+
className: mx3(descriptionText2, "border border-dashed border-neutral-400/50 rounded-lg flex items-center justify-center p-8 font-normal text-lg")
|
|
799
|
+
}, t("missing object message")) : /* @__PURE__ */ React6.createElement(Status, {
|
|
803
800
|
indeterminate: true,
|
|
804
801
|
"aria-label": "Initializing"
|
|
805
802
|
}));
|
|
@@ -807,10 +804,10 @@ var MissingObject = ({ id }) => {
|
|
|
807
804
|
|
|
808
805
|
// packages/plugins/plugin-space/src/components/PersistenceStatus.tsx
|
|
809
806
|
import { ArrowsCounterClockwise, CheckCircle as CheckCircle2, Warning } from "@phosphor-icons/react";
|
|
810
|
-
import
|
|
807
|
+
import React7, { useEffect as useEffect3, useState as useState3 } from "react";
|
|
811
808
|
import { debounce } from "@dxos/async";
|
|
812
|
-
import { Tooltip, useTranslation as
|
|
813
|
-
import { getSize as getSize2, mx as
|
|
809
|
+
import { Tooltip, useTranslation as useTranslation7 } from "@dxos/react-ui";
|
|
810
|
+
import { getSize as getSize2, mx as mx4, staticPlaceholderText, warningText } from "@dxos/react-ui-theme";
|
|
814
811
|
var Status2;
|
|
815
812
|
(function(Status3) {
|
|
816
813
|
Status3[Status3["PERSISTED_LOCALLY"] = 0] = "PERSISTED_LOCALLY";
|
|
@@ -818,7 +815,7 @@ var Status2;
|
|
|
818
815
|
Status3[Status3["ERROR"] = 2] = "ERROR";
|
|
819
816
|
})(Status2 || (Status2 = {}));
|
|
820
817
|
var PersistenceStatus = ({ db }) => {
|
|
821
|
-
const { t } =
|
|
818
|
+
const { t } = useTranslation7(SPACE_PLUGIN);
|
|
822
819
|
const [displayMessage, setDisplayMessage] = useState3(false);
|
|
823
820
|
const [status, naturalSetStatus] = useState3(0);
|
|
824
821
|
const [prevStatus, setPrevStatus] = useState3(0);
|
|
@@ -835,45 +832,45 @@ var PersistenceStatus = ({ db }) => {
|
|
|
835
832
|
]);
|
|
836
833
|
switch (status) {
|
|
837
834
|
case 2:
|
|
838
|
-
return /* @__PURE__ */
|
|
835
|
+
return /* @__PURE__ */ React7.createElement("div", {
|
|
839
836
|
className: "flex items-center"
|
|
840
|
-
}, /* @__PURE__ */
|
|
841
|
-
className:
|
|
842
|
-
}), /* @__PURE__ */
|
|
843
|
-
className:
|
|
837
|
+
}, /* @__PURE__ */ React7.createElement(Warning, {
|
|
838
|
+
className: mx4(getSize2(4), "me-1")
|
|
839
|
+
}), /* @__PURE__ */ React7.createElement("span", {
|
|
840
|
+
className: mx4("text-sm", warningText)
|
|
844
841
|
}, t("persistence error label")));
|
|
845
842
|
case 1:
|
|
846
|
-
return /* @__PURE__ */
|
|
843
|
+
return /* @__PURE__ */ React7.createElement("div", {
|
|
847
844
|
className: "flex items-center"
|
|
848
|
-
}, /* @__PURE__ */
|
|
849
|
-
className:
|
|
850
|
-
}), /* @__PURE__ */
|
|
851
|
-
className:
|
|
845
|
+
}, /* @__PURE__ */ React7.createElement(ArrowsCounterClockwise, {
|
|
846
|
+
className: mx4(getSize2(4), "me-1")
|
|
847
|
+
}), /* @__PURE__ */ React7.createElement("span", {
|
|
848
|
+
className: mx4("text-sm", staticPlaceholderText)
|
|
852
849
|
}, t("persistence pending label")));
|
|
853
850
|
case 0:
|
|
854
851
|
default:
|
|
855
|
-
return /* @__PURE__ */
|
|
852
|
+
return /* @__PURE__ */ React7.createElement(Tooltip.Root, {
|
|
856
853
|
delayDuration: 400
|
|
857
|
-
}, /* @__PURE__ */
|
|
854
|
+
}, /* @__PURE__ */ React7.createElement(Tooltip.Trigger, {
|
|
858
855
|
role: "status",
|
|
859
856
|
className: "flex items-center"
|
|
860
|
-
}, /* @__PURE__ */
|
|
861
|
-
className:
|
|
862
|
-
}), displayMessage && /* @__PURE__ */
|
|
863
|
-
className:
|
|
864
|
-
}, t("persisted locally label"))), /* @__PURE__ */
|
|
857
|
+
}, /* @__PURE__ */ React7.createElement(CheckCircle2, {
|
|
858
|
+
className: mx4(getSize2(4), "me-1")
|
|
859
|
+
}), displayMessage && /* @__PURE__ */ React7.createElement("span", {
|
|
860
|
+
className: mx4("text-sm", staticPlaceholderText)
|
|
861
|
+
}, t("persisted locally label"))), /* @__PURE__ */ React7.createElement(Tooltip.Portal, null, /* @__PURE__ */ React7.createElement(Tooltip.Content, {
|
|
865
862
|
classNames: "z-10"
|
|
866
|
-
}, t("persisted locally message"), /* @__PURE__ */
|
|
863
|
+
}, t("persisted locally message"), /* @__PURE__ */ React7.createElement(Tooltip.Arrow, null))));
|
|
867
864
|
}
|
|
868
865
|
};
|
|
869
866
|
|
|
870
867
|
// packages/plugins/plugin-space/src/components/PopoverRenameObject.tsx
|
|
871
|
-
import
|
|
868
|
+
import React8, { useCallback, useRef, useState as useState4 } from "react";
|
|
872
869
|
import { log } from "@dxos/log";
|
|
873
|
-
import { Button as Button2, Input, Popover, useTranslation as
|
|
870
|
+
import { Button as Button2, Input as Input2, Popover, useTranslation as useTranslation8 } from "@dxos/react-ui";
|
|
874
871
|
var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/PopoverRenameObject.tsx";
|
|
875
872
|
var PopoverRenameObject = ({ object: obj }) => {
|
|
876
|
-
const { t } =
|
|
873
|
+
const { t } = useTranslation8(SPACE_PLUGIN);
|
|
877
874
|
const doneButton = useRef(null);
|
|
878
875
|
const object = obj;
|
|
879
876
|
const [name, setName] = useState4(object.name || object.title || "");
|
|
@@ -898,23 +895,23 @@ var PopoverRenameObject = ({ object: obj }) => {
|
|
|
898
895
|
object,
|
|
899
896
|
name
|
|
900
897
|
]);
|
|
901
|
-
return /* @__PURE__ */
|
|
898
|
+
return /* @__PURE__ */ React8.createElement("div", {
|
|
902
899
|
role: "none",
|
|
903
900
|
className: "p-1 flex gap-2"
|
|
904
|
-
}, /* @__PURE__ */
|
|
901
|
+
}, /* @__PURE__ */ React8.createElement("div", {
|
|
905
902
|
role: "none",
|
|
906
903
|
className: "flex-1"
|
|
907
|
-
}, /* @__PURE__ */
|
|
904
|
+
}, /* @__PURE__ */ React8.createElement(Input2.Root, null, /* @__PURE__ */ React8.createElement(Input2.Label, {
|
|
908
905
|
srOnly: true
|
|
909
|
-
}, t("object name label")), /* @__PURE__ */
|
|
906
|
+
}, t("object name label")), /* @__PURE__ */ React8.createElement(Input2.TextInput, {
|
|
910
907
|
placeholder: t("object title placeholder"),
|
|
911
908
|
value: name,
|
|
912
909
|
"data-testid": "spacePlugin.renameObject.input",
|
|
913
910
|
onChange: ({ target: { value } }) => setName(value),
|
|
914
911
|
onKeyDown: ({ key }) => key === "Enter" && doneButton.current?.click()
|
|
915
|
-
}))), /* @__PURE__ */
|
|
912
|
+
}))), /* @__PURE__ */ React8.createElement(Popover.Close, {
|
|
916
913
|
asChild: true
|
|
917
|
-
}, /* @__PURE__ */
|
|
914
|
+
}, /* @__PURE__ */ React8.createElement(Button2, {
|
|
918
915
|
ref: doneButton,
|
|
919
916
|
classNames: "self-stretch",
|
|
920
917
|
onClick: handleDone
|
|
@@ -924,10 +921,10 @@ var PopoverRenameObject = ({ object: obj }) => {
|
|
|
924
921
|
};
|
|
925
922
|
|
|
926
923
|
// packages/plugins/plugin-space/src/components/PopoverRenameSpace.tsx
|
|
927
|
-
import
|
|
928
|
-
import { Button as Button3, Input as
|
|
924
|
+
import React9, { useCallback as useCallback2, useRef as useRef2, useState as useState5 } from "react";
|
|
925
|
+
import { Button as Button3, Input as Input3, Popover as Popover2, useTranslation as useTranslation9 } from "@dxos/react-ui";
|
|
929
926
|
var PopoverRenameSpace = ({ space }) => {
|
|
930
|
-
const { t } =
|
|
927
|
+
const { t } = useTranslation9(SPACE_PLUGIN);
|
|
931
928
|
const doneButton = useRef2(null);
|
|
932
929
|
const [name, setName] = useState5(space.properties.name ?? "");
|
|
933
930
|
const handleDone = useCallback2(() => {
|
|
@@ -936,24 +933,24 @@ var PopoverRenameSpace = ({ space }) => {
|
|
|
936
933
|
space,
|
|
937
934
|
name
|
|
938
935
|
]);
|
|
939
|
-
return /* @__PURE__ */
|
|
936
|
+
return /* @__PURE__ */ React9.createElement("div", {
|
|
940
937
|
role: "none",
|
|
941
938
|
className: "p-1 flex gap-2"
|
|
942
|
-
}, /* @__PURE__ */
|
|
939
|
+
}, /* @__PURE__ */ React9.createElement("div", {
|
|
943
940
|
role: "none",
|
|
944
941
|
className: "flex-1"
|
|
945
|
-
}, /* @__PURE__ */
|
|
942
|
+
}, /* @__PURE__ */ React9.createElement(Input3.Root, null, /* @__PURE__ */ React9.createElement(Input3.Label, {
|
|
946
943
|
srOnly: true
|
|
947
|
-
}, t("space name label")), /* @__PURE__ */
|
|
944
|
+
}, t("space name label")), /* @__PURE__ */ React9.createElement(Input3.TextInput, {
|
|
948
945
|
defaultValue: space.properties.name ?? "",
|
|
949
946
|
placeholder: t("unnamed space label"),
|
|
950
947
|
onChange: ({ target: { value } }) => setName(value),
|
|
951
948
|
// TODO(wittjosiah): Ideally this should access the popover context to close the popover.
|
|
952
949
|
// Currently this is not possible because Radix does not expose the popover context.
|
|
953
950
|
onKeyDown: ({ key }) => key === "Enter" && doneButton.current?.click()
|
|
954
|
-
}))), /* @__PURE__ */
|
|
951
|
+
}))), /* @__PURE__ */ React9.createElement(Popover2.Close, {
|
|
955
952
|
asChild: true
|
|
956
|
-
}, /* @__PURE__ */
|
|
953
|
+
}, /* @__PURE__ */ React9.createElement(Button3, {
|
|
957
954
|
ref: doneButton,
|
|
958
955
|
classNames: "self-stretch",
|
|
959
956
|
onClick: handleDone
|
|
@@ -963,12 +960,12 @@ var PopoverRenameSpace = ({ space }) => {
|
|
|
963
960
|
};
|
|
964
961
|
|
|
965
962
|
// packages/plugins/plugin-space/src/components/ShareSpaceButton.tsx
|
|
966
|
-
import
|
|
963
|
+
import React10 from "react";
|
|
967
964
|
import { useIntentDispatcher } from "@dxos/app-framework";
|
|
968
|
-
import { Button as Button4, useTranslation as
|
|
965
|
+
import { Button as Button4, useTranslation as useTranslation10 } from "@dxos/react-ui";
|
|
969
966
|
var ShareSpaceButton = ({ spaceId }) => {
|
|
970
967
|
const dispatch = useIntentDispatcher();
|
|
971
|
-
return /* @__PURE__ */
|
|
968
|
+
return /* @__PURE__ */ React10.createElement(ShareSpaceButtonImpl, {
|
|
972
969
|
onClick: () => dispatch({
|
|
973
970
|
action: SpaceAction.SHARE,
|
|
974
971
|
data: {
|
|
@@ -978,8 +975,8 @@ var ShareSpaceButton = ({ spaceId }) => {
|
|
|
978
975
|
});
|
|
979
976
|
};
|
|
980
977
|
var ShareSpaceButtonImpl = ({ onClick }) => {
|
|
981
|
-
const { t } =
|
|
982
|
-
return /* @__PURE__ */
|
|
978
|
+
const { t } = useTranslation10(SPACE_PLUGIN);
|
|
979
|
+
return /* @__PURE__ */ React10.createElement(Button4, {
|
|
983
980
|
"data-testid": "spacePlugin.shareSpaceButton",
|
|
984
981
|
onClick,
|
|
985
982
|
classNames: "mli-1"
|
|
@@ -988,30 +985,30 @@ var ShareSpaceButtonImpl = ({ onClick }) => {
|
|
|
988
985
|
|
|
989
986
|
// packages/plugins/plugin-space/src/components/SpaceMain/SpaceMain.tsx
|
|
990
987
|
import { Command } from "@phosphor-icons/react";
|
|
991
|
-
import
|
|
988
|
+
import React12 from "react";
|
|
992
989
|
import { Surface } from "@dxos/app-framework";
|
|
993
990
|
import { SpaceState as SpaceState2 } from "@dxos/react-client/echo";
|
|
994
|
-
import { Main, useTranslation as
|
|
995
|
-
import { getSize as getSize4, mx as
|
|
991
|
+
import { Main, useTranslation as useTranslation12 } from "@dxos/react-ui";
|
|
992
|
+
import { getSize as getSize4, mx as mx6, topbarBlockPaddingStart } from "@dxos/react-ui-theme";
|
|
996
993
|
import { ClipboardProvider } from "@dxos/shell/react";
|
|
997
994
|
|
|
998
995
|
// packages/plugins/plugin-space/src/components/SpaceMain/SpaceMembersSection.tsx
|
|
999
996
|
import { CaretDown, Check, UserPlus, UsersThree } from "@phosphor-icons/react";
|
|
1000
|
-
import
|
|
997
|
+
import React11, { useCallback as useCallback3, useState as useState6 } from "react";
|
|
1001
998
|
import { LayoutAction, useIntent } from "@dxos/app-framework";
|
|
1002
999
|
import { useMembers, SpaceMember, useSpaceInvitations } from "@dxos/react-client/echo";
|
|
1003
1000
|
import { InvitationEncoder } from "@dxos/react-client/invitations";
|
|
1004
1001
|
import { Invitation } from "@dxos/react-client/invitations";
|
|
1005
|
-
import { Button as Button5, ButtonGroup, DropdownMenu as DropdownMenu2, List, useTranslation as
|
|
1006
|
-
import { descriptionText as
|
|
1002
|
+
import { Button as Button5, ButtonGroup, DropdownMenu as DropdownMenu2, List, useTranslation as useTranslation11 } from "@dxos/react-ui";
|
|
1003
|
+
import { descriptionText as descriptionText3, getSize as getSize3, mx as mx5 } from "@dxos/react-ui-theme";
|
|
1007
1004
|
import { InvitationListItem, IdentityListItem } from "@dxos/shell/react";
|
|
1008
1005
|
var activeActionKeyStorageKey = "dxos:react-shell/space-manager/active-action";
|
|
1009
1006
|
var Presence = SpaceMember.PresenceState;
|
|
1010
1007
|
var handleCreateInvitationUrl = (invitationCode) => `${origin}?spaceInvitationCode=${invitationCode}`;
|
|
1011
1008
|
var SpaceMemberList = ({ members }) => {
|
|
1012
|
-
return members.length > 0 ? /* @__PURE__ */
|
|
1009
|
+
return members.length > 0 ? /* @__PURE__ */ React11.createElement(List, {
|
|
1013
1010
|
classNames: "col-start-2 col-end-5 gap-y-1 grid grid-cols-subgrid items-center"
|
|
1014
|
-
}, members.map((member) => /* @__PURE__ */
|
|
1011
|
+
}, members.map((member) => /* @__PURE__ */ React11.createElement(IdentityListItem, {
|
|
1015
1012
|
classNames: "contents",
|
|
1016
1013
|
key: member.identity.identityKey.toHex(),
|
|
1017
1014
|
identity: member.identity,
|
|
@@ -1019,7 +1016,7 @@ var SpaceMemberList = ({ members }) => {
|
|
|
1019
1016
|
}))) : null;
|
|
1020
1017
|
};
|
|
1021
1018
|
var SpaceMembersSection = ({ space }) => {
|
|
1022
|
-
const { t } =
|
|
1019
|
+
const { t } = useTranslation11(SPACE_PLUGIN);
|
|
1023
1020
|
const invitations = useSpaceInvitations(space.key);
|
|
1024
1021
|
const { dispatch } = useIntent();
|
|
1025
1022
|
const handleCloseDialog = () => dispatch({
|
|
@@ -1097,103 +1094,103 @@ var SpaceMembersSection = ({ space }) => {
|
|
|
1097
1094
|
[Presence.ONLINE]: [],
|
|
1098
1095
|
[Presence.OFFLINE]: []
|
|
1099
1096
|
});
|
|
1100
|
-
return /* @__PURE__ */
|
|
1097
|
+
return /* @__PURE__ */ React11.createElement("section", {
|
|
1101
1098
|
className: "mbe-4 col-span-3 grid gap-y-2 grid-cols-subgrid auto-rows-min"
|
|
1102
|
-
}, /* @__PURE__ */
|
|
1099
|
+
}, /* @__PURE__ */ React11.createElement("h2", {
|
|
1103
1100
|
className: "contents"
|
|
1104
|
-
}, /* @__PURE__ */
|
|
1101
|
+
}, /* @__PURE__ */ React11.createElement(UsersThree, {
|
|
1105
1102
|
weight: "duotone",
|
|
1106
|
-
className:
|
|
1107
|
-
}), /* @__PURE__ */
|
|
1103
|
+
className: mx5(getSize3(5), "place-self-center")
|
|
1104
|
+
}), /* @__PURE__ */ React11.createElement("span", {
|
|
1108
1105
|
className: "text-lg col-span-2"
|
|
1109
|
-
}, t("space members label"))), /* @__PURE__ */
|
|
1106
|
+
}, t("space members label"))), /* @__PURE__ */ React11.createElement("h3", {
|
|
1110
1107
|
className: "col-start-2 col-span-3 text-sm italic text-description"
|
|
1111
|
-
}, t("invitations heading")), invitations.length > 0 && /* @__PURE__ */
|
|
1108
|
+
}, t("invitations heading")), invitations.length > 0 && /* @__PURE__ */ React11.createElement(List, {
|
|
1112
1109
|
classNames: "col-start-2 col-span-2 gap-y-2 grid grid-cols-[var(--rail-size)_1fr_var(--rail-action)_var(--rail-action)]"
|
|
1113
|
-
}, invitations.map((invitation) => /* @__PURE__ */
|
|
1110
|
+
}, invitations.map((invitation) => /* @__PURE__ */ React11.createElement(InvitationListItem, {
|
|
1114
1111
|
reverseEffects: true,
|
|
1115
1112
|
classNames: "pis-0 pie-0 gap-0 col-span-4 grid grid-cols-subgrid",
|
|
1116
1113
|
key: invitation.get().invitationId,
|
|
1117
1114
|
invitation,
|
|
1118
1115
|
send: handleInvitationSelect,
|
|
1119
1116
|
createInvitationUrl: handleCreateInvitationUrl
|
|
1120
|
-
}))), /* @__PURE__ */
|
|
1117
|
+
}))), /* @__PURE__ */ React11.createElement(ButtonGroup, {
|
|
1121
1118
|
classNames: "col-start-2 col-end-4 grid grid-cols-[1fr_var(--rail-action)] place-self-grow gap-px"
|
|
1122
|
-
}, /* @__PURE__ */
|
|
1119
|
+
}, /* @__PURE__ */ React11.createElement(Button5, {
|
|
1123
1120
|
classNames: "gap-2",
|
|
1124
1121
|
onClick: activeAction.onClick
|
|
1125
|
-
}, /* @__PURE__ */
|
|
1122
|
+
}, /* @__PURE__ */ React11.createElement(activeAction.icon, {
|
|
1126
1123
|
className: getSize3(5)
|
|
1127
|
-
}), /* @__PURE__ */
|
|
1124
|
+
}), /* @__PURE__ */ React11.createElement("span", null, t(activeAction.label, {
|
|
1128
1125
|
ns: "os"
|
|
1129
|
-
}))), /* @__PURE__ */
|
|
1126
|
+
}))), /* @__PURE__ */ React11.createElement(DropdownMenu2.Root, null, /* @__PURE__ */ React11.createElement(DropdownMenu2.Trigger, {
|
|
1130
1127
|
asChild: true
|
|
1131
|
-
}, /* @__PURE__ */
|
|
1128
|
+
}, /* @__PURE__ */ React11.createElement(Button5, {
|
|
1132
1129
|
classNames: "pli-0"
|
|
1133
|
-
}, /* @__PURE__ */
|
|
1130
|
+
}, /* @__PURE__ */ React11.createElement(CaretDown, {
|
|
1134
1131
|
className: getSize3(4)
|
|
1135
|
-
}))), /* @__PURE__ */
|
|
1136
|
-
return /* @__PURE__ */
|
|
1132
|
+
}))), /* @__PURE__ */ React11.createElement(DropdownMenu2.Content, null, /* @__PURE__ */ React11.createElement(DropdownMenu2.Viewport, null, Object.entries(inviteActions).map(([id, action]) => {
|
|
1133
|
+
return /* @__PURE__ */ React11.createElement(DropdownMenu2.CheckboxItem, {
|
|
1137
1134
|
key: id,
|
|
1138
1135
|
"aria-labelledby": `${id}__label`,
|
|
1139
1136
|
"aria-describedby": `${id}__description`,
|
|
1140
1137
|
checked: activeActionKey === id,
|
|
1141
1138
|
onCheckedChange: (checked) => checked && setActiveActionKey(id),
|
|
1142
1139
|
classNames: "gap-2"
|
|
1143
|
-
}, action.icon && /* @__PURE__ */
|
|
1140
|
+
}, action.icon && /* @__PURE__ */ React11.createElement(action.icon, {
|
|
1144
1141
|
className: getSize3(5)
|
|
1145
|
-
}), /* @__PURE__ */
|
|
1142
|
+
}), /* @__PURE__ */ React11.createElement("div", {
|
|
1146
1143
|
role: "none",
|
|
1147
1144
|
className: "flex-1 min-is-0 space-b-1"
|
|
1148
|
-
}, /* @__PURE__ */
|
|
1145
|
+
}, /* @__PURE__ */ React11.createElement("p", {
|
|
1149
1146
|
id: `${id}__label`
|
|
1150
1147
|
}, t(action.label, {
|
|
1151
1148
|
ns: "os"
|
|
1152
|
-
})), action.description && /* @__PURE__ */
|
|
1149
|
+
})), action.description && /* @__PURE__ */ React11.createElement("p", {
|
|
1153
1150
|
id: `${id}__description`,
|
|
1154
|
-
className:
|
|
1151
|
+
className: descriptionText3
|
|
1155
1152
|
}, t(action.description, {
|
|
1156
1153
|
ns: "os"
|
|
1157
|
-
}))), /* @__PURE__ */
|
|
1154
|
+
}))), /* @__PURE__ */ React11.createElement(DropdownMenu2.ItemIndicator, {
|
|
1158
1155
|
asChild: true
|
|
1159
|
-
}, /* @__PURE__ */
|
|
1156
|
+
}, /* @__PURE__ */ React11.createElement(Check, {
|
|
1160
1157
|
className: getSize3(4)
|
|
1161
1158
|
})));
|
|
1162
|
-
})), /* @__PURE__ */
|
|
1163
|
-
className:
|
|
1159
|
+
})), /* @__PURE__ */ React11.createElement(DropdownMenu2.Arrow, null)))), members[Presence.ONLINE].length + members[Presence.OFFLINE].length < 1 ? /* @__PURE__ */ React11.createElement("p", {
|
|
1160
|
+
className: mx5(descriptionText3, "text-center is-full mlb-2")
|
|
1164
1161
|
}, t("empty space members message", {
|
|
1165
1162
|
ns: "os"
|
|
1166
|
-
})) : /* @__PURE__ */
|
|
1163
|
+
})) : /* @__PURE__ */ React11.createElement(React11.Fragment, null, /* @__PURE__ */ React11.createElement("h3", {
|
|
1167
1164
|
className: "col-start-2 col-end-5 text-sm italic text-description"
|
|
1168
1165
|
}, t("active space members heading", {
|
|
1169
1166
|
count: members[Presence.ONLINE].length
|
|
1170
|
-
})), /* @__PURE__ */
|
|
1167
|
+
})), /* @__PURE__ */ React11.createElement(SpaceMemberList, {
|
|
1171
1168
|
members: members[Presence.ONLINE]
|
|
1172
|
-
}), /* @__PURE__ */
|
|
1169
|
+
}), /* @__PURE__ */ React11.createElement("h3", {
|
|
1173
1170
|
className: "col-start-2 col-end-5 text-sm italic text-description"
|
|
1174
1171
|
}, t("inactive space members heading", {
|
|
1175
1172
|
count: members[Presence.OFFLINE].length
|
|
1176
|
-
})), /* @__PURE__ */
|
|
1173
|
+
})), /* @__PURE__ */ React11.createElement(SpaceMemberList, {
|
|
1177
1174
|
members: members[Presence.OFFLINE]
|
|
1178
1175
|
})));
|
|
1179
1176
|
};
|
|
1180
1177
|
|
|
1181
1178
|
// packages/plugins/plugin-space/src/components/SpaceMain/SpaceMain.tsx
|
|
1182
1179
|
var KeyShortcuts = () => {
|
|
1183
|
-
const { t } =
|
|
1184
|
-
return /* @__PURE__ */
|
|
1180
|
+
const { t } = useTranslation12(SPACE_PLUGIN);
|
|
1181
|
+
return /* @__PURE__ */ React12.createElement("section", {
|
|
1185
1182
|
className: "mbe-4 col-span-4 md:col-start-5 md:col-end-7 grid grid-cols-subgrid gap-y-2 auto-rows-min"
|
|
1186
|
-
}, /* @__PURE__ */
|
|
1183
|
+
}, /* @__PURE__ */ React12.createElement("h2", {
|
|
1187
1184
|
className: "contents"
|
|
1188
|
-
}, /* @__PURE__ */
|
|
1185
|
+
}, /* @__PURE__ */ React12.createElement(Command, {
|
|
1189
1186
|
weight: "duotone",
|
|
1190
|
-
className:
|
|
1191
|
-
}), /* @__PURE__ */
|
|
1187
|
+
className: mx6(getSize4(5), "place-self-center")
|
|
1188
|
+
}), /* @__PURE__ */ React12.createElement("span", {
|
|
1192
1189
|
className: "text-lg col-span-2 md:col-span-1"
|
|
1193
|
-
}, t("keyshortcuts label"))), /* @__PURE__ */
|
|
1190
|
+
}, t("keyshortcuts label"))), /* @__PURE__ */ React12.createElement("div", {
|
|
1194
1191
|
role: "none",
|
|
1195
1192
|
className: "col-start-2 col-end-4 md:col-end-5 pie-2"
|
|
1196
|
-
}, /* @__PURE__ */
|
|
1193
|
+
}, /* @__PURE__ */ React12.createElement(Surface, {
|
|
1197
1194
|
role: "keyshortcuts"
|
|
1198
1195
|
})));
|
|
1199
1196
|
};
|
|
@@ -1202,7 +1199,7 @@ var SpaceMain = ({ space, role }) => {
|
|
|
1202
1199
|
const state = space.state.get();
|
|
1203
1200
|
const ready = state === SpaceState2.SPACE_READY;
|
|
1204
1201
|
const Root = role === "main" ? Main.Content : "div";
|
|
1205
|
-
return /* @__PURE__ */
|
|
1202
|
+
return /* @__PURE__ */ React12.createElement(ClipboardProvider, null, /* @__PURE__ */ React12.createElement(Root, {
|
|
1206
1203
|
...role === "main" ? {
|
|
1207
1204
|
classNames: [
|
|
1208
1205
|
topbarBlockPaddingStart,
|
|
@@ -1211,23 +1208,23 @@ var SpaceMain = ({ space, role }) => {
|
|
|
1211
1208
|
]
|
|
1212
1209
|
} : {
|
|
1213
1210
|
role: "none",
|
|
1214
|
-
className:
|
|
1211
|
+
className: mx6(topbarBlockPaddingStart, "row-span-2", spaceMainLayout)
|
|
1215
1212
|
},
|
|
1216
1213
|
"data-testid": `spacePlugin.${role}`,
|
|
1217
1214
|
"data-isready": ready ? "true" : "false"
|
|
1218
|
-
}, ready && /* @__PURE__ */
|
|
1215
|
+
}, ready && /* @__PURE__ */ React12.createElement(SpaceMembersSection, {
|
|
1219
1216
|
space
|
|
1220
|
-
}), /* @__PURE__ */
|
|
1217
|
+
}), /* @__PURE__ */ React12.createElement(KeyShortcuts, null)));
|
|
1221
1218
|
};
|
|
1222
1219
|
|
|
1223
1220
|
// packages/plugins/plugin-space/src/components/SpacePresence.tsx
|
|
1224
|
-
import
|
|
1221
|
+
import React13, { useCallback as useCallback4, useEffect as useEffect4, useState as useState7 } from "react";
|
|
1225
1222
|
import { usePlugin } from "@dxos/app-framework";
|
|
1226
1223
|
import { generateName } from "@dxos/display-name";
|
|
1227
1224
|
import { PublicKey, useClient as useClient3 } from "@dxos/react-client";
|
|
1228
1225
|
import { getSpace as getSpace3, useMembers as useMembers2, fullyQualifiedId as fullyQualifiedId3 } from "@dxos/react-client/echo";
|
|
1229
1226
|
import { useIdentity } from "@dxos/react-client/halo";
|
|
1230
|
-
import { Avatar, AvatarGroup, AvatarGroupItem, Tooltip as Tooltip2, useDensityContext, useTranslation as
|
|
1227
|
+
import { Avatar, AvatarGroup, AvatarGroupItem, Tooltip as Tooltip2, useDensityContext, useTranslation as useTranslation13, List as List2, ListItem, useDefaultValue } from "@dxos/react-ui";
|
|
1231
1228
|
import { AttentionGlyph } from "@dxos/react-ui-attention";
|
|
1232
1229
|
import { ComplexMap, keyToFallback } from "@dxos/util";
|
|
1233
1230
|
var REFRESH_INTERVAL = 5e3;
|
|
@@ -1265,9 +1262,9 @@ var SpacePresence = ({ object, spaceKey }) => {
|
|
|
1265
1262
|
lastSeen
|
|
1266
1263
|
};
|
|
1267
1264
|
}).toSorted((a, b) => a.lastSeen - b.lastSeen);
|
|
1268
|
-
return density === "fine" ? /* @__PURE__ */
|
|
1265
|
+
return density === "fine" ? /* @__PURE__ */ React13.createElement(SmallPresence, {
|
|
1269
1266
|
count: membersForObject.length
|
|
1270
|
-
}) : /* @__PURE__ */
|
|
1267
|
+
}) : /* @__PURE__ */ React13.createElement(FullPresence, {
|
|
1271
1268
|
members: membersForObject
|
|
1272
1269
|
});
|
|
1273
1270
|
};
|
|
@@ -1277,38 +1274,38 @@ var FullPresence = (props) => {
|
|
|
1277
1274
|
if (members.length === 0) {
|
|
1278
1275
|
return null;
|
|
1279
1276
|
}
|
|
1280
|
-
return /* @__PURE__ */
|
|
1277
|
+
return /* @__PURE__ */ React13.createElement(AvatarGroup.Root, {
|
|
1281
1278
|
size,
|
|
1282
1279
|
classNames: "mbs-2 mie-4",
|
|
1283
1280
|
"data-testid": "spacePlugin.presence"
|
|
1284
|
-
}, members.slice(0, 3).map((member, i) => /* @__PURE__ */
|
|
1281
|
+
}, members.slice(0, 3).map((member, i) => /* @__PURE__ */ React13.createElement(Tooltip2.Root, {
|
|
1285
1282
|
key: member.identity.identityKey.toHex()
|
|
1286
|
-
}, /* @__PURE__ */
|
|
1283
|
+
}, /* @__PURE__ */ React13.createElement(Tooltip2.Trigger, null, /* @__PURE__ */ React13.createElement(PrensenceAvatar, {
|
|
1287
1284
|
identity: member.identity,
|
|
1288
1285
|
group: true,
|
|
1289
1286
|
match: member.currentlyAttended,
|
|
1290
1287
|
index: members.length - i,
|
|
1291
1288
|
onClick: () => onMemberClick?.(member)
|
|
1292
|
-
})), /* @__PURE__ */
|
|
1289
|
+
})), /* @__PURE__ */ React13.createElement(Tooltip2.Portal, null, /* @__PURE__ */ React13.createElement(Tooltip2.Content, {
|
|
1293
1290
|
side: "bottom"
|
|
1294
|
-
}, /* @__PURE__ */
|
|
1291
|
+
}, /* @__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, {
|
|
1295
1292
|
status: "inactive"
|
|
1296
|
-
}, /* @__PURE__ */
|
|
1293
|
+
}, /* @__PURE__ */ React13.createElement(Avatar.Frame, {
|
|
1297
1294
|
style: {
|
|
1298
1295
|
zIndex: members.length - 4
|
|
1299
1296
|
}
|
|
1300
|
-
}, /* @__PURE__ */
|
|
1297
|
+
}, /* @__PURE__ */ React13.createElement(Avatar.Fallback, {
|
|
1301
1298
|
text: `+${members.length - 3}`
|
|
1302
|
-
})))), /* @__PURE__ */
|
|
1299
|
+
})))), /* @__PURE__ */ React13.createElement(Tooltip2.Portal, null, /* @__PURE__ */ React13.createElement(Tooltip2.Content, {
|
|
1303
1300
|
side: "bottom"
|
|
1304
|
-
}, /* @__PURE__ */
|
|
1301
|
+
}, /* @__PURE__ */ React13.createElement(Tooltip2.Arrow, null), /* @__PURE__ */ React13.createElement(List2, {
|
|
1305
1302
|
classNames: "max-h-56 overflow-y-auto"
|
|
1306
|
-
}, members.map((member) => /* @__PURE__ */
|
|
1303
|
+
}, members.map((member) => /* @__PURE__ */ React13.createElement(ListItem.Root, {
|
|
1307
1304
|
key: member.identity.identityKey.toHex(),
|
|
1308
1305
|
classNames: "flex gap-2 items-center cursor-pointer mbe-2",
|
|
1309
1306
|
onClick: () => onMemberClick?.(member),
|
|
1310
1307
|
"data-testid": "identity-list-item"
|
|
1311
|
-
}, /* @__PURE__ */
|
|
1308
|
+
}, /* @__PURE__ */ React13.createElement(PrensenceAvatar, {
|
|
1312
1309
|
identity: member.identity,
|
|
1313
1310
|
showName: true,
|
|
1314
1311
|
match: member.currentlyAttended
|
|
@@ -1318,10 +1315,10 @@ var PrensenceAvatar = ({ identity, showName, match, group, index, onClick }) =>
|
|
|
1318
1315
|
const Root = group ? AvatarGroupItem.Root : Avatar.Root;
|
|
1319
1316
|
const status = match ? "current" : "active";
|
|
1320
1317
|
const fallbackValue = keyToFallback(identity.identityKey);
|
|
1321
|
-
return /* @__PURE__ */
|
|
1318
|
+
return /* @__PURE__ */ React13.createElement(Root, {
|
|
1322
1319
|
status,
|
|
1323
1320
|
hue: identity.profile?.data?.hue || fallbackValue.hue
|
|
1324
|
-
}, /* @__PURE__ */
|
|
1321
|
+
}, /* @__PURE__ */ React13.createElement(Avatar.Frame, {
|
|
1325
1322
|
"data-testid": "spacePlugin.presence.member",
|
|
1326
1323
|
"data-status": status,
|
|
1327
1324
|
...index ? {
|
|
@@ -1330,9 +1327,9 @@ var PrensenceAvatar = ({ identity, showName, match, group, index, onClick }) =>
|
|
|
1330
1327
|
}
|
|
1331
1328
|
} : {},
|
|
1332
1329
|
onClick: () => onClick?.()
|
|
1333
|
-
}, /* @__PURE__ */
|
|
1330
|
+
}, /* @__PURE__ */ React13.createElement(Avatar.Fallback, {
|
|
1334
1331
|
text: identity.profile?.data?.emoji || fallbackValue.emoji
|
|
1335
|
-
})), showName && /* @__PURE__ */
|
|
1332
|
+
})), showName && /* @__PURE__ */ React13.createElement(Avatar.Label, {
|
|
1336
1333
|
classNames: "text-sm truncate pli-2"
|
|
1337
1334
|
}, getName(identity)));
|
|
1338
1335
|
};
|
|
@@ -1343,37 +1340,37 @@ var SmallPresenceLive = ({ viewers }) => {
|
|
|
1343
1340
|
return () => clearInterval(interval);
|
|
1344
1341
|
}, []);
|
|
1345
1342
|
const activeViewers = viewers ? Array.from(viewers.values()).filter(({ lastSeen }) => moment - lastSeen < ACTIVITY_DURATION) : [];
|
|
1346
|
-
return /* @__PURE__ */
|
|
1343
|
+
return /* @__PURE__ */ React13.createElement(SmallPresence, {
|
|
1347
1344
|
count: activeViewers.length
|
|
1348
1345
|
});
|
|
1349
1346
|
};
|
|
1350
1347
|
var SmallPresence = ({ count }) => {
|
|
1351
|
-
const { t } =
|
|
1352
|
-
return /* @__PURE__ */
|
|
1348
|
+
const { t } = useTranslation13(SPACE_PLUGIN);
|
|
1349
|
+
return /* @__PURE__ */ React13.createElement(Tooltip2.Root, null, /* @__PURE__ */ React13.createElement(Tooltip2.Trigger, {
|
|
1353
1350
|
asChild: true
|
|
1354
|
-
}, /* @__PURE__ */
|
|
1351
|
+
}, /* @__PURE__ */ React13.createElement(AttentionGlyph, {
|
|
1355
1352
|
presence: count > 1 ? "many" : count === 1 ? "one" : "none",
|
|
1356
1353
|
classNames: "self-center mie-1"
|
|
1357
|
-
})), /* @__PURE__ */
|
|
1354
|
+
})), /* @__PURE__ */ React13.createElement(Tooltip2.Portal, null, /* @__PURE__ */ React13.createElement(Tooltip2.Content, {
|
|
1358
1355
|
side: "bottom",
|
|
1359
1356
|
classNames: "z-[70]"
|
|
1360
|
-
}, /* @__PURE__ */
|
|
1357
|
+
}, /* @__PURE__ */ React13.createElement("span", null, t("presence label", {
|
|
1361
1358
|
count
|
|
1362
|
-
})), /* @__PURE__ */
|
|
1359
|
+
})), /* @__PURE__ */ React13.createElement(Tooltip2.Arrow, null))));
|
|
1363
1360
|
};
|
|
1364
1361
|
|
|
1365
1362
|
// packages/plugins/plugin-space/src/components/SpaceSettings.tsx
|
|
1366
|
-
import
|
|
1363
|
+
import React14 from "react";
|
|
1367
1364
|
import { useIntentDispatcher as useIntentDispatcher2, useResolvePlugins } from "@dxos/app-framework";
|
|
1368
1365
|
import { SettingsValue } from "@dxos/plugin-settings";
|
|
1369
|
-
import { Input as
|
|
1366
|
+
import { Input as Input4, Select, toLocalizedString as toLocalizedString2, useTranslation as useTranslation14 } from "@dxos/react-ui";
|
|
1370
1367
|
var SpaceSettings = ({ settings }) => {
|
|
1371
|
-
const { t } =
|
|
1368
|
+
const { t } = useTranslation14(SPACE_PLUGIN);
|
|
1372
1369
|
const dispatch = useIntentDispatcher2();
|
|
1373
1370
|
const plugins = useResolvePlugins(parseSpaceInitPlugin);
|
|
1374
|
-
return /* @__PURE__ */
|
|
1371
|
+
return /* @__PURE__ */ React14.createElement(React14.Fragment, null, /* @__PURE__ */ React14.createElement(SettingsValue, {
|
|
1375
1372
|
label: t("show hidden spaces label")
|
|
1376
|
-
}, /* @__PURE__ */
|
|
1373
|
+
}, /* @__PURE__ */ React14.createElement(Input4.Switch, {
|
|
1377
1374
|
checked: settings.showHidden,
|
|
1378
1375
|
onCheckedChange: (checked) => dispatch({
|
|
1379
1376
|
plugin: SPACE_PLUGIN,
|
|
@@ -1382,28 +1379,28 @@ var SpaceSettings = ({ settings }) => {
|
|
|
1382
1379
|
state: !!checked
|
|
1383
1380
|
}
|
|
1384
1381
|
})
|
|
1385
|
-
})), /* @__PURE__ */
|
|
1382
|
+
})), /* @__PURE__ */ React14.createElement(SettingsValue, {
|
|
1386
1383
|
label: t("default on space create label")
|
|
1387
|
-
}, /* @__PURE__ */
|
|
1384
|
+
}, /* @__PURE__ */ React14.createElement(Select.Root, {
|
|
1388
1385
|
value: settings.onSpaceCreate,
|
|
1389
1386
|
onValueChange: (value) => {
|
|
1390
1387
|
settings.onSpaceCreate = value;
|
|
1391
1388
|
}
|
|
1392
|
-
}, /* @__PURE__ */
|
|
1389
|
+
}, /* @__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, {
|
|
1393
1390
|
key: onSpaceCreate.action,
|
|
1394
1391
|
value: onSpaceCreate.action
|
|
1395
1392
|
}, toLocalizedString2(onSpaceCreate.label, t)))))))));
|
|
1396
1393
|
};
|
|
1397
1394
|
|
|
1398
1395
|
// packages/plugins/plugin-space/src/components/SaveStatus.tsx
|
|
1399
|
-
import
|
|
1396
|
+
import React15, { useEffect as useEffect5, useState as useState8 } from "react";
|
|
1400
1397
|
import { Context } from "@dxos/context";
|
|
1401
1398
|
import { StatusBar } from "@dxos/plugin-status-bar";
|
|
1402
1399
|
import { useClient as useClient4 } from "@dxos/react-client";
|
|
1403
|
-
import { Icon, useTranslation as
|
|
1400
|
+
import { Icon, useTranslation as useTranslation15 } from "@dxos/react-ui";
|
|
1404
1401
|
var __dxlog_file3 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/SaveStatus.tsx";
|
|
1405
1402
|
var SaveStatus = () => {
|
|
1406
|
-
const { t } =
|
|
1403
|
+
const { t } = useTranslation15(SPACE_PLUGIN);
|
|
1407
1404
|
const client = useClient4();
|
|
1408
1405
|
const [state, setState] = useState8("saved");
|
|
1409
1406
|
useEffect5(() => {
|
|
@@ -1411,9 +1408,9 @@ var SaveStatus = () => {
|
|
|
1411
1408
|
setState(state2);
|
|
1412
1409
|
});
|
|
1413
1410
|
}, []);
|
|
1414
|
-
return /* @__PURE__ */
|
|
1411
|
+
return /* @__PURE__ */ React15.createElement(StatusBar.Item, {
|
|
1415
1412
|
title: state === "saving" ? t("saving label") : t("saved label")
|
|
1416
|
-
}, /* @__PURE__ */
|
|
1413
|
+
}, /* @__PURE__ */ React15.createElement(Icon, {
|
|
1417
1414
|
icon: state === "saving" ? "ph--arrows-clockwise--regular" : "ph--check-circle--regular",
|
|
1418
1415
|
size: 4
|
|
1419
1416
|
}));
|
|
@@ -1478,11 +1475,11 @@ var createSpaceSaveTracker = (space, cb) => {
|
|
|
1478
1475
|
};
|
|
1479
1476
|
|
|
1480
1477
|
// packages/plugins/plugin-space/src/components/SyncStatus/SyncStatus.tsx
|
|
1481
|
-
import
|
|
1478
|
+
import React16, { useEffect as useEffect7, useState as useState10 } from "react";
|
|
1482
1479
|
import { StatusBar as StatusBar2 } from "@dxos/plugin-status-bar";
|
|
1483
|
-
import { Icon as Icon2, Popover as Popover3, useTranslation as
|
|
1480
|
+
import { Icon as Icon2, Popover as Popover3, useTranslation as useTranslation16 } from "@dxos/react-ui";
|
|
1484
1481
|
import { SyntaxHighlighter } from "@dxos/react-ui-syntax-highlighter";
|
|
1485
|
-
import { mx as
|
|
1482
|
+
import { mx as mx7 } from "@dxos/react-ui-theme";
|
|
1486
1483
|
|
|
1487
1484
|
// packages/plugins/plugin-space/src/components/SyncStatus/types.ts
|
|
1488
1485
|
import { useEffect as useEffect6, useState as useState9 } from "react";
|
|
@@ -1554,7 +1551,7 @@ var styles = {
|
|
|
1554
1551
|
};
|
|
1555
1552
|
var SyncStatus = () => {
|
|
1556
1553
|
const state = useSyncState();
|
|
1557
|
-
return /* @__PURE__ */
|
|
1554
|
+
return /* @__PURE__ */ React16.createElement(SyncStatusIndicator, {
|
|
1558
1555
|
state
|
|
1559
1556
|
});
|
|
1560
1557
|
};
|
|
@@ -1577,30 +1574,30 @@ var SyncStatusIndicator = ({ state }) => {
|
|
|
1577
1574
|
needsToUpload,
|
|
1578
1575
|
needsToDownload
|
|
1579
1576
|
]);
|
|
1580
|
-
return /* @__PURE__ */
|
|
1577
|
+
return /* @__PURE__ */ React16.createElement(StatusBar2.Item, null, /* @__PURE__ */ React16.createElement(Popover3.Root, null, /* @__PURE__ */ React16.createElement(Popover3.Trigger, null, /* @__PURE__ */ React16.createElement(Icon2, {
|
|
1581
1578
|
icon: offline ? "ph--cloud-x--regular" : needsToUpload ? "ph--cloud-arrow-up--regular" : needsToDownload ? "ph--cloud-arrow-down--regular" : "ph--cloud-check--regular",
|
|
1582
1579
|
size: 4,
|
|
1583
1580
|
classNames
|
|
1584
|
-
})), /* @__PURE__ */
|
|
1581
|
+
})), /* @__PURE__ */ React16.createElement(Popover3.Content, null, /* @__PURE__ */ React16.createElement(SyncStatusDetail, {
|
|
1585
1582
|
state,
|
|
1586
1583
|
summary,
|
|
1587
1584
|
debug: false
|
|
1588
1585
|
}))));
|
|
1589
1586
|
};
|
|
1590
1587
|
var SyncStatusDetail = ({ classNames, state, summary, debug }) => {
|
|
1591
|
-
const { t } =
|
|
1588
|
+
const { t } = useTranslation16(SPACE_PLUGIN);
|
|
1592
1589
|
const entries = Object.entries(state).sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0);
|
|
1593
|
-
return /* @__PURE__ */
|
|
1594
|
-
className:
|
|
1595
|
-
}, /* @__PURE__ */
|
|
1590
|
+
return /* @__PURE__ */ React16.createElement("div", {
|
|
1591
|
+
className: mx7("flex flex-col text-xs min-w-[16rem]", classNames)
|
|
1592
|
+
}, /* @__PURE__ */ React16.createElement("h1", {
|
|
1596
1593
|
className: "p-2"
|
|
1597
|
-
}, t("sync status title")), /* @__PURE__ */
|
|
1594
|
+
}, t("sync status title")), /* @__PURE__ */ React16.createElement("div", {
|
|
1598
1595
|
className: "flex flex-col gap-[2px] my-[2px]"
|
|
1599
|
-
}, entries.map(([spaceId, state2]) => /* @__PURE__ */
|
|
1596
|
+
}, entries.map(([spaceId, state2]) => /* @__PURE__ */ React16.createElement(SpaceRow, {
|
|
1600
1597
|
key: spaceId,
|
|
1601
1598
|
spaceId,
|
|
1602
1599
|
state: state2
|
|
1603
|
-
}))), debug && /* @__PURE__ */
|
|
1600
|
+
}))), debug && /* @__PURE__ */ React16.createElement(SyntaxHighlighter, {
|
|
1604
1601
|
language: "json"
|
|
1605
1602
|
}, JSON.stringify(summary, null, 2)));
|
|
1606
1603
|
};
|
|
@@ -1630,17 +1627,17 @@ var useActive = (count) => {
|
|
|
1630
1627
|
var SpaceRow = ({ spaceId, state: { localDocumentCount, remoteDocumentCount, missingOnLocal, missingOnRemote } }) => {
|
|
1631
1628
|
const downActive = useActive(localDocumentCount);
|
|
1632
1629
|
const upActive = useActive(remoteDocumentCount);
|
|
1633
|
-
return /* @__PURE__ */
|
|
1634
|
-
className:
|
|
1630
|
+
return /* @__PURE__ */ React16.createElement("div", {
|
|
1631
|
+
className: mx7("flex items-center mx-[2px] gap-[2px] cursor-pointer", styles.barHover),
|
|
1635
1632
|
title: spaceId,
|
|
1636
1633
|
onClick: () => {
|
|
1637
1634
|
void navigator.clipboard.writeText(spaceId);
|
|
1638
1635
|
}
|
|
1639
|
-
}, /* @__PURE__ */
|
|
1636
|
+
}, /* @__PURE__ */ React16.createElement(Icon2, {
|
|
1640
1637
|
icon: "ph--arrow-fat-line-left--regular",
|
|
1641
1638
|
size: 3,
|
|
1642
|
-
classNames:
|
|
1643
|
-
}), /* @__PURE__ */
|
|
1639
|
+
classNames: mx7(downActive && "animate-[pulse_1s_infinite]")
|
|
1640
|
+
}), /* @__PURE__ */ React16.createElement(Candle, {
|
|
1644
1641
|
up: {
|
|
1645
1642
|
count: remoteDocumentCount,
|
|
1646
1643
|
total: remoteDocumentCount + missingOnRemote
|
|
@@ -1650,37 +1647,37 @@ var SpaceRow = ({ spaceId, state: { localDocumentCount, remoteDocumentCount, mis
|
|
|
1650
1647
|
total: localDocumentCount + missingOnLocal
|
|
1651
1648
|
},
|
|
1652
1649
|
title: spaceId
|
|
1653
|
-
}), /* @__PURE__ */
|
|
1650
|
+
}), /* @__PURE__ */ React16.createElement(Icon2, {
|
|
1654
1651
|
icon: "ph--arrow-fat-line-right--regular",
|
|
1655
1652
|
size: 3,
|
|
1656
|
-
classNames:
|
|
1653
|
+
classNames: mx7(upActive && "animate-[pulse_1s_step-start_infinite]")
|
|
1657
1654
|
}));
|
|
1658
1655
|
};
|
|
1659
1656
|
var Candle = ({ classNames, up, down }) => {
|
|
1660
|
-
return /* @__PURE__ */
|
|
1661
|
-
className:
|
|
1662
|
-
}, /* @__PURE__ */
|
|
1657
|
+
return /* @__PURE__ */ React16.createElement("div", {
|
|
1658
|
+
className: mx7("grid grid-cols-[1fr_2rem_1fr] w-full h-3", classNames)
|
|
1659
|
+
}, /* @__PURE__ */ React16.createElement(Bar, {
|
|
1663
1660
|
classNames: "justify-end",
|
|
1664
1661
|
...up
|
|
1665
|
-
}), /* @__PURE__ */
|
|
1662
|
+
}), /* @__PURE__ */ React16.createElement("div", {
|
|
1666
1663
|
className: "relative"
|
|
1667
|
-
}, /* @__PURE__ */
|
|
1668
|
-
className:
|
|
1669
|
-
}, up.total)), /* @__PURE__ */
|
|
1664
|
+
}, /* @__PURE__ */ React16.createElement("div", {
|
|
1665
|
+
className: mx7("absolute inset-0 flex items-center justify-center text-xs", styles.barBg)
|
|
1666
|
+
}, up.total)), /* @__PURE__ */ React16.createElement(Bar, down));
|
|
1670
1667
|
};
|
|
1671
1668
|
var Bar = ({ classNames, count, total }) => {
|
|
1672
1669
|
let p = count / total * 100;
|
|
1673
1670
|
if (count < total) {
|
|
1674
1671
|
p = Math.min(p, 95);
|
|
1675
1672
|
}
|
|
1676
|
-
return /* @__PURE__ */
|
|
1677
|
-
className:
|
|
1678
|
-
}, /* @__PURE__ */
|
|
1679
|
-
className:
|
|
1673
|
+
return /* @__PURE__ */ React16.createElement("div", {
|
|
1674
|
+
className: mx7("relative flex w-full", styles.barBg, classNames)
|
|
1675
|
+
}, /* @__PURE__ */ React16.createElement("div", {
|
|
1676
|
+
className: mx7("shrink-0", styles.barFg),
|
|
1680
1677
|
style: {
|
|
1681
1678
|
width: `${p}%`
|
|
1682
1679
|
}
|
|
1683
|
-
}), count !== total && /* @__PURE__ */
|
|
1680
|
+
}), count !== total && /* @__PURE__ */ React16.createElement("div", {
|
|
1684
1681
|
className: "absolute top-0 bottom-0 flex items-center mx-0.5 text-black text-xs"
|
|
1685
1682
|
}, count));
|
|
1686
1683
|
};
|
|
@@ -1766,7 +1763,9 @@ var translations_default = [
|
|
|
1766
1763
|
"remove deleted objects alt": "Permanently remove deleted objects to free up space.",
|
|
1767
1764
|
"copy link label": "Copy link",
|
|
1768
1765
|
"default on space create label": "On space create",
|
|
1769
|
-
"sync status title": "Sync status"
|
|
1766
|
+
"sync status title": "Sync status",
|
|
1767
|
+
"name label": "Name",
|
|
1768
|
+
"name placeholder": "Name"
|
|
1770
1769
|
}
|
|
1771
1770
|
}
|
|
1772
1771
|
}
|
|
@@ -1822,17 +1821,21 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
1822
1821
|
await defaultSpace.internal.migrate();
|
|
1823
1822
|
}
|
|
1824
1823
|
spaces.filter((space) => space.state.get() === SpaceState3.SPACE_READY).forEach((space) => {
|
|
1825
|
-
subscriptions.add(
|
|
1826
|
-
|
|
1827
|
-
}));
|
|
1824
|
+
subscriptions.add(scheduledEffect(() => ({
|
|
1825
|
+
name: space.properties.name
|
|
1826
|
+
}), ({ name }) => state.values.spaceNames[space.id] = name));
|
|
1828
1827
|
});
|
|
1829
1828
|
}).unsubscribe);
|
|
1830
|
-
subscriptions.add(
|
|
1829
|
+
subscriptions.add(scheduledEffect(() => ({
|
|
1830
|
+
ids: openIds(location.active),
|
|
1831
|
+
removed: location.closed ? [
|
|
1832
|
+
location.closed
|
|
1833
|
+
].flat() : []
|
|
1834
|
+
}), ({ ids, removed }) => {
|
|
1831
1835
|
const send = () => {
|
|
1832
1836
|
const spaces = client.spaces.get();
|
|
1833
1837
|
const identity = client.halo.identity.get();
|
|
1834
1838
|
if (identity && location.active) {
|
|
1835
|
-
const ids = openIds(location.active);
|
|
1836
1839
|
const idsBySpace = reduceGroupBy(ids, (id) => {
|
|
1837
1840
|
const [spaceId] = id.split(":");
|
|
1838
1841
|
return spaceId;
|
|
@@ -1847,9 +1850,6 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
1847
1850
|
if (!space) {
|
|
1848
1851
|
continue;
|
|
1849
1852
|
}
|
|
1850
|
-
const removed = location.closed ? [
|
|
1851
|
-
location.closed
|
|
1852
|
-
].flat() : [];
|
|
1853
1853
|
void space.postMessage("viewing", {
|
|
1854
1854
|
identityKey: identity.identityKey.toHex(),
|
|
1855
1855
|
attended: attention.attended ? [
|
|
@@ -1863,7 +1863,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
1863
1863
|
err: err.message
|
|
1864
1864
|
}, {
|
|
1865
1865
|
F: __dxlog_file5,
|
|
1866
|
-
L:
|
|
1866
|
+
L: 228,
|
|
1867
1867
|
S: void 0,
|
|
1868
1868
|
C: (f, a) => f(...a)
|
|
1869
1869
|
});
|
|
@@ -1972,7 +1972,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
1972
1972
|
...translations_default,
|
|
1973
1973
|
osTranslations
|
|
1974
1974
|
],
|
|
1975
|
-
root: () => state.values.awaiting ? /* @__PURE__ */
|
|
1975
|
+
root: () => state.values.awaiting ? /* @__PURE__ */ React17.createElement(AwaitingObject, {
|
|
1976
1976
|
id: state.values.awaiting
|
|
1977
1977
|
}) : null,
|
|
1978
1978
|
metadata: {
|
|
@@ -2004,7 +2004,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2004
2004
|
switch (role) {
|
|
2005
2005
|
case "article":
|
|
2006
2006
|
case "main":
|
|
2007
|
-
return isSpace2(primary) && primary.state.get() === SpaceState3.SPACE_READY ? /* @__PURE__ */
|
|
2007
|
+
return isSpace2(primary) && primary.state.get() === SpaceState3.SPACE_READY ? /* @__PURE__ */ React17.createElement(Surface2, {
|
|
2008
2008
|
data: {
|
|
2009
2009
|
active: primary.properties[CollectionType.typename],
|
|
2010
2010
|
id: primary.id
|
|
@@ -2012,26 +2012,20 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2012
2012
|
role,
|
|
2013
2013
|
...rest
|
|
2014
2014
|
}) : primary instanceof CollectionType ? {
|
|
2015
|
-
node: /* @__PURE__ */
|
|
2015
|
+
node: /* @__PURE__ */ React17.createElement(CollectionMain, {
|
|
2016
2016
|
collection: primary
|
|
2017
2017
|
}),
|
|
2018
2018
|
disposition: "fallback"
|
|
2019
|
-
} : typeof primary === "string" && primary.length === OBJECT_ID_LENGTH ? /* @__PURE__ */
|
|
2019
|
+
} : typeof primary === "string" && primary.length === OBJECT_ID_LENGTH ? /* @__PURE__ */ React17.createElement(MissingObject, {
|
|
2020
2020
|
id: primary
|
|
2021
2021
|
}) : null;
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
return /* @__PURE__ */ React18.createElement(EmptyTree, null);
|
|
2027
|
-
case (isGraphNode(data.activeNode) && isSpace2(data.activeNode.data)):
|
|
2028
|
-
return /* @__PURE__ */ React18.createElement(EmptySpace, null);
|
|
2029
|
-
default:
|
|
2030
|
-
return null;
|
|
2031
|
-
}
|
|
2022
|
+
case "complementary--settings":
|
|
2023
|
+
return isEchoObject2(data.subject) ? /* @__PURE__ */ React17.createElement(FallbackSettings, {
|
|
2024
|
+
object: data.subject
|
|
2025
|
+
}) : null;
|
|
2032
2026
|
case "dialog":
|
|
2033
2027
|
if (data.component === "dxos.org/plugin/space/InvitationManagerDialog") {
|
|
2034
|
-
return /* @__PURE__ */
|
|
2028
|
+
return /* @__PURE__ */ React17.createElement(Dialog.Content, null, /* @__PURE__ */ React17.createElement(ClipboardProvider2, null, /* @__PURE__ */ React17.createElement(InvitationManager, {
|
|
2035
2029
|
active: true,
|
|
2036
2030
|
...data.subject
|
|
2037
2031
|
})));
|
|
@@ -2040,20 +2034,21 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2040
2034
|
}
|
|
2041
2035
|
case "popover":
|
|
2042
2036
|
if (data.component === "dxos.org/plugin/space/RenameSpacePopover" && isSpace2(data.subject)) {
|
|
2043
|
-
return /* @__PURE__ */
|
|
2037
|
+
return /* @__PURE__ */ React17.createElement(PopoverRenameSpace, {
|
|
2044
2038
|
space: data.subject
|
|
2045
2039
|
});
|
|
2046
2040
|
}
|
|
2047
2041
|
if (data.component === "dxos.org/plugin/space/RenameObjectPopover" && isReactiveObject2(data.subject)) {
|
|
2048
|
-
return /* @__PURE__ */
|
|
2042
|
+
return /* @__PURE__ */ React17.createElement(PopoverRenameObject, {
|
|
2049
2043
|
object: data.subject
|
|
2050
2044
|
});
|
|
2051
2045
|
}
|
|
2052
2046
|
return null;
|
|
2047
|
+
// TODO(burdon): Add role name syntax to minimal plugin docs.
|
|
2053
2048
|
case "presence--glyph": {
|
|
2054
|
-
return isReactiveObject2(data.object) ? /* @__PURE__ */
|
|
2049
|
+
return isReactiveObject2(data.object) ? /* @__PURE__ */ React17.createElement(SmallPresenceLive, {
|
|
2055
2050
|
viewers: state.values.viewersByObject[fullyQualifiedId4(data.object)]
|
|
2056
|
-
}) : /* @__PURE__ */
|
|
2051
|
+
}) : /* @__PURE__ */ React17.createElement(SmallPresence, {
|
|
2057
2052
|
count: 0
|
|
2058
2053
|
});
|
|
2059
2054
|
}
|
|
@@ -2067,32 +2062,32 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2067
2062
|
const space = isSpace2(data.object) ? data.object : getSpace4(data.object);
|
|
2068
2063
|
const object = isSpace2(data.object) ? data.object.state.get() === SpaceState3.SPACE_READY ? space?.properties[CollectionType.typename] : void 0 : data.object;
|
|
2069
2064
|
return space && object ? {
|
|
2070
|
-
node: /* @__PURE__ */
|
|
2065
|
+
node: /* @__PURE__ */ React17.createElement(React17.Fragment, null, /* @__PURE__ */ React17.createElement(SpacePresence, {
|
|
2071
2066
|
object
|
|
2072
|
-
}), space.properties[COMPOSER_SPACE_LOCK] ? null : /* @__PURE__ */
|
|
2067
|
+
}), space.properties[COMPOSER_SPACE_LOCK] ? null : /* @__PURE__ */ React17.createElement(ShareSpaceButton, {
|
|
2073
2068
|
spaceId: space.id
|
|
2074
2069
|
})),
|
|
2075
2070
|
disposition: "hoist"
|
|
2076
2071
|
} : null;
|
|
2077
2072
|
}
|
|
2078
2073
|
case "section":
|
|
2079
|
-
return data.object instanceof CollectionType ? /* @__PURE__ */
|
|
2074
|
+
return data.object instanceof CollectionType ? /* @__PURE__ */ React17.createElement(CollectionSection, {
|
|
2080
2075
|
collection: data.object
|
|
2081
2076
|
}) : null;
|
|
2082
2077
|
case "settings":
|
|
2083
|
-
return data.plugin === meta_default.id ? /* @__PURE__ */
|
|
2078
|
+
return data.plugin === meta_default.id ? /* @__PURE__ */ React17.createElement(SpaceSettings, {
|
|
2084
2079
|
settings: settings.values
|
|
2085
2080
|
}) : null;
|
|
2086
2081
|
case "menu-footer":
|
|
2087
2082
|
if (!isEchoObject2(data.object)) {
|
|
2088
2083
|
return null;
|
|
2089
2084
|
} else {
|
|
2090
|
-
return /* @__PURE__ */
|
|
2085
|
+
return /* @__PURE__ */ React17.createElement(MenuFooter, {
|
|
2091
2086
|
object: data.object
|
|
2092
2087
|
});
|
|
2093
2088
|
}
|
|
2094
2089
|
case "status": {
|
|
2095
|
-
return /* @__PURE__ */
|
|
2090
|
+
return /* @__PURE__ */ React17.createElement(React17.Fragment, null, /* @__PURE__ */ React17.createElement(SyncStatus, null), /* @__PURE__ */ React17.createElement(SaveStatus, null));
|
|
2096
2091
|
}
|
|
2097
2092
|
default:
|
|
2098
2093
|
return null;
|
|
@@ -2154,7 +2149,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2154
2149
|
} else {
|
|
2155
2150
|
log2.warn("spaces order object not found", void 0, {
|
|
2156
2151
|
F: __dxlog_file5,
|
|
2157
|
-
L:
|
|
2152
|
+
L: 525,
|
|
2158
2153
|
S: void 0,
|
|
2159
2154
|
C: (f, a) => f(...a)
|
|
2160
2155
|
});
|
|
@@ -2343,6 +2338,45 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2343
2338
|
resolve
|
|
2344
2339
|
})).filter(nonNullable);
|
|
2345
2340
|
}
|
|
2341
|
+
}),
|
|
2342
|
+
// Create nodes for object settings.
|
|
2343
|
+
createExtension({
|
|
2344
|
+
id: `${SPACE_PLUGIN}/settings-for-subject`,
|
|
2345
|
+
resolver: ({ id }) => {
|
|
2346
|
+
if (!id.endsWith("~settings")) {
|
|
2347
|
+
return;
|
|
2348
|
+
}
|
|
2349
|
+
const [subjectId] = id.split("~");
|
|
2350
|
+
const [spaceId, objectId] = parseFullyQualifiedId(subjectId);
|
|
2351
|
+
const space = client.spaces.get().find((space2) => space2.id === spaceId);
|
|
2352
|
+
const object = toSignal((onChange) => {
|
|
2353
|
+
const timeout = setTimeout(async () => {
|
|
2354
|
+
await space?.db.loadObjectById(objectId);
|
|
2355
|
+
onChange();
|
|
2356
|
+
});
|
|
2357
|
+
return () => clearTimeout(timeout);
|
|
2358
|
+
}, () => space?.db.getObjectById(objectId), subjectId);
|
|
2359
|
+
if (!object || !subjectId) {
|
|
2360
|
+
return;
|
|
2361
|
+
}
|
|
2362
|
+
const meta = resolve(getTypename2(object) ?? "");
|
|
2363
|
+
const label = meta.label?.(object) || object.name || meta.placeholder || [
|
|
2364
|
+
"unnamed object settings label",
|
|
2365
|
+
{
|
|
2366
|
+
ns: SPACE_PLUGIN
|
|
2367
|
+
}
|
|
2368
|
+
];
|
|
2369
|
+
return {
|
|
2370
|
+
id,
|
|
2371
|
+
type: "orphan-settings-for-subject",
|
|
2372
|
+
data: null,
|
|
2373
|
+
properties: {
|
|
2374
|
+
icon: "ph--gear--regular",
|
|
2375
|
+
label,
|
|
2376
|
+
object
|
|
2377
|
+
}
|
|
2378
|
+
};
|
|
2379
|
+
}
|
|
2346
2380
|
})
|
|
2347
2381
|
];
|
|
2348
2382
|
},
|
|
@@ -2904,8 +2938,7 @@ export {
|
|
|
2904
2938
|
CollectionSection,
|
|
2905
2939
|
CollectionType,
|
|
2906
2940
|
ContactType,
|
|
2907
|
-
|
|
2908
|
-
EmptyTree,
|
|
2941
|
+
FallbackSettings,
|
|
2909
2942
|
FullPresence,
|
|
2910
2943
|
MenuFooter,
|
|
2911
2944
|
MessageState,
|