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