@dxos/plugin-space 0.7.5-labs.a279d8c → 0.7.5-labs.c0e040f
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/{app-graph-builder-5D2QB43K.mjs → app-graph-builder-GSS3V7IN.mjs} +15 -13
- package/dist/lib/browser/app-graph-builder-GSS3V7IN.mjs.map +7 -0
- package/dist/lib/browser/{app-graph-serializer-VNWPLPDF.mjs → app-graph-serializer-QDXM5M6K.mjs} +5 -5
- package/dist/lib/browser/{chunk-PDJ4MLA4.mjs → chunk-DIBLC24B.mjs} +308 -251
- package/dist/lib/browser/chunk-DIBLC24B.mjs.map +7 -0
- package/dist/lib/browser/{chunk-SOXNANA6.mjs → chunk-PQXZCNAU.mjs} +3 -2
- package/dist/lib/browser/{chunk-SOXNANA6.mjs.map → chunk-PQXZCNAU.mjs.map} +3 -3
- package/dist/lib/browser/{chunk-UH5P4UL3.mjs → chunk-RLZQJD47.mjs} +3 -2
- package/dist/lib/browser/chunk-RLZQJD47.mjs.map +7 -0
- package/dist/lib/browser/{chunk-5TBRONF6.mjs → chunk-SDK7RZI3.mjs} +3 -3
- package/dist/lib/browser/{chunk-HCXWKGTE.mjs → chunk-XPZ6IIXF.mjs} +4 -9
- package/dist/lib/browser/chunk-XPZ6IIXF.mjs.map +7 -0
- package/dist/lib/browser/{chunk-ZBKFJNHH.mjs → chunk-ZL5ZFGBK.mjs} +15 -9
- package/dist/lib/browser/chunk-ZL5ZFGBK.mjs.map +7 -0
- package/dist/lib/browser/{identity-created-EC5FOCX2.mjs → identity-created-25TK5XNO.mjs} +3 -3
- package/dist/lib/browser/index.mjs +14 -13
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/intent-resolver-LNTCXZ57.mjs +537 -0
- package/dist/lib/browser/intent-resolver-LNTCXZ57.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-root-4QQST3T2.mjs → react-root-Q7JJDCPB.mjs} +6 -6
- package/dist/lib/browser/{react-surface-JTNUNOJG.mjs → react-surface-BDMYLARO.mjs} +26 -33
- package/dist/lib/browser/react-surface-BDMYLARO.mjs.map +7 -0
- package/dist/lib/browser/{settings-ASFF5BZL.mjs → settings-K4JPYYEM.mjs} +3 -3
- package/dist/lib/browser/{spaces-ready-4SFNS5JQ.mjs → spaces-ready-THYJEJYZ.mjs} +31 -32
- package/dist/lib/browser/spaces-ready-THYJEJYZ.mjs.map +7 -0
- package/dist/lib/browser/{state-MS4KYJWI.mjs → state-6DCY5YJP.mjs} +3 -3
- package/dist/lib/browser/types/index.mjs +2 -4
- package/dist/lib/node/{app-graph-builder-ZQ5S62YR.cjs → app-graph-builder-V3RCGDV7.cjs} +60 -58
- package/dist/lib/node/app-graph-builder-V3RCGDV7.cjs.map +7 -0
- package/dist/lib/node/{app-graph-serializer-72S7P33H.cjs → app-graph-serializer-H4UACG57.cjs} +21 -21
- package/dist/lib/node/{chunk-VCPICVIE.cjs → chunk-4AZ2DD4G.cjs} +308 -251
- package/dist/lib/node/chunk-4AZ2DD4G.cjs.map +7 -0
- package/dist/lib/node/{chunk-DDZYVNVP.cjs → chunk-6MEOP3DH.cjs} +8 -14
- package/dist/lib/node/chunk-6MEOP3DH.cjs.map +7 -0
- package/dist/lib/node/{chunk-BQRNTKSQ.cjs → chunk-D6BFKOXY.cjs} +8 -8
- package/dist/lib/node/{chunk-Z34MTEU7.cjs → chunk-SYVPVU3K.cjs} +66 -60
- package/dist/lib/node/chunk-SYVPVU3K.cjs.map +7 -0
- package/dist/lib/node/{chunk-56NGXG2A.cjs → chunk-UX3U4RU2.cjs} +9 -8
- package/dist/lib/node/chunk-UX3U4RU2.cjs.map +7 -0
- package/dist/lib/node/{chunk-AO4EW2RX.cjs → chunk-WZR6OAN3.cjs} +6 -5
- package/dist/lib/node/{chunk-AO4EW2RX.cjs.map → chunk-WZR6OAN3.cjs.map} +3 -3
- package/dist/lib/node/{identity-created-IMDS4A6A.cjs → identity-created-7G5U7R36.cjs} +7 -7
- package/dist/lib/node/index.cjs +93 -92
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/intent-resolver-CDE4M3TW.cjs +536 -0
- package/dist/lib/node/intent-resolver-CDE4M3TW.cjs.map +7 -0
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/{react-root-TCHYZQY3.cjs → react-root-JN6AIHMS.cjs} +12 -12
- package/dist/lib/node/{react-surface-TFPR6QAQ.cjs → react-surface-XSK2QEQV.cjs} +72 -76
- package/dist/lib/node/react-surface-XSK2QEQV.cjs.map +7 -0
- package/dist/lib/node/{settings-QLCKAUHK.cjs → settings-TEELGWS4.cjs} +8 -8
- package/dist/lib/node/{spaces-ready-RZTKEXOL.cjs → spaces-ready-L4MJTFQ6.cjs} +39 -40
- package/dist/lib/node/spaces-ready-L4MJTFQ6.cjs.map +7 -0
- package/dist/lib/node/{state-4UIOUKLJ.cjs → state-WPZC4JXB.cjs} +8 -8
- package/dist/lib/node/types/index.cjs +16 -18
- package/dist/lib/node/types/index.cjs.map +2 -2
- package/dist/lib/node-esm/{app-graph-builder-CD6IYPSS.mjs → app-graph-builder-VFHK7OQI.mjs} +15 -13
- package/dist/lib/node-esm/app-graph-builder-VFHK7OQI.mjs.map +7 -0
- package/dist/lib/node-esm/{app-graph-serializer-CFXS6ZE2.mjs → app-graph-serializer-PIPJVXYZ.mjs} +5 -5
- package/dist/lib/node-esm/{chunk-M4XTHK35.mjs → chunk-4UX5WGKJ.mjs} +3 -3
- package/dist/lib/node-esm/{chunk-CLGCKZ2D.mjs → chunk-AAQRELDK.mjs} +4 -9
- package/dist/lib/node-esm/chunk-AAQRELDK.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-I75ZN2YH.mjs → chunk-FTVEA5LO.mjs} +308 -251
- package/dist/lib/node-esm/chunk-FTVEA5LO.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-7FUVU45N.mjs → chunk-ICCM4YRJ.mjs} +3 -2
- package/dist/lib/node-esm/{chunk-7FUVU45N.mjs.map → chunk-ICCM4YRJ.mjs.map} +3 -3
- package/dist/lib/node-esm/{chunk-375RB3CZ.mjs → chunk-LGL4A5B5.mjs} +3 -2
- package/dist/lib/node-esm/chunk-LGL4A5B5.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-FUMGYUD3.mjs → chunk-RCZRYXI3.mjs} +15 -9
- package/dist/lib/node-esm/chunk-RCZRYXI3.mjs.map +7 -0
- package/dist/lib/node-esm/{identity-created-SJYZZ7Q3.mjs → identity-created-7THGZ7EW.mjs} +3 -3
- package/dist/lib/node-esm/index.mjs +14 -13
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/intent-resolver-7L3GJAZE.mjs +538 -0
- package/dist/lib/node-esm/intent-resolver-7L3GJAZE.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-root-BEX2XFJK.mjs → react-root-BNA6PBFZ.mjs} +6 -6
- package/dist/lib/node-esm/{react-surface-TRLHCJZ3.mjs → react-surface-FTI2LQNL.mjs} +26 -33
- package/dist/lib/node-esm/react-surface-FTI2LQNL.mjs.map +7 -0
- package/dist/lib/node-esm/{settings-WLVEO4JM.mjs → settings-KXYUZBLN.mjs} +3 -3
- package/dist/lib/node-esm/{spaces-ready-ITGYYT5A.mjs → spaces-ready-ZC2R73H3.mjs} +31 -32
- package/dist/lib/node-esm/spaces-ready-ZC2R73H3.mjs.map +7 -0
- package/dist/lib/node-esm/{state-BMISGQ2O.mjs → state-5GH2D5U4.mjs} +3 -3
- package/dist/lib/node-esm/types/index.mjs +2 -4
- package/dist/types/src/SpacePlugin.d.ts +5 -1
- package/dist/types/src/SpacePlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts +22 -22
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/capabilities.d.ts +6 -0
- package/dist/types/src/capabilities/capabilities.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +34 -33
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +2 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/spaces-ready.d.ts.map +1 -1
- package/dist/types/src/components/BaseObjectSettings.d.ts.map +1 -1
- package/dist/types/src/components/CreateDialog/CreateObjectPanel.d.ts +4 -3
- package/dist/types/src/components/CreateDialog/CreateObjectPanel.d.ts.map +1 -1
- package/dist/types/src/components/CreateDialog/CreateSpaceDialog.d.ts.map +1 -1
- package/dist/types/src/components/JoinDialog.d.ts.map +1 -1
- package/dist/types/src/components/SpacePresence.d.ts.map +1 -1
- package/dist/types/src/components/SpaceSettings/SpaceSettingsDialog.d.ts.map +1 -1
- package/dist/types/src/components/SpaceSettings/SpaceSettingsPanel.d.ts +3 -4
- package/dist/types/src/components/SpaceSettings/SpaceSettingsPanel.d.ts.map +1 -1
- package/dist/types/src/components/SpaceSettings/SpaceSettingsPanel.stories.d.ts.map +1 -1
- package/dist/types/src/components/SyncStatus/SyncStatus.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +1 -0
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +2 -5
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/src/util.d.ts +1 -0
- package/dist/types/src/util.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +39 -37
- package/src/SpacePlugin.tsx +11 -6
- package/src/capabilities/app-graph-builder.ts +9 -8
- package/src/capabilities/capabilities.ts +4 -1
- package/src/capabilities/intent-resolver.ts +410 -312
- package/src/capabilities/react-surface.tsx +22 -30
- package/src/capabilities/spaces-ready.ts +20 -21
- package/src/components/AwaitingObject.tsx +5 -5
- package/src/components/BaseObjectSettings.tsx +7 -0
- package/src/components/CreateDialog/CreateObjectDialog.tsx +15 -15
- package/src/components/CreateDialog/CreateObjectPanel.tsx +114 -115
- package/src/components/CreateDialog/CreateSpaceDialog.tsx +18 -9
- package/src/components/JoinDialog.tsx +27 -19
- package/src/components/SpacePluginSettings.tsx +3 -3
- package/src/components/SpacePresence.stories.tsx +2 -2
- package/src/components/SpacePresence.tsx +2 -3
- package/src/components/SpaceSettings/SpaceSettingsDialog.tsx +16 -1
- package/src/components/SpaceSettings/SpaceSettingsPanel.stories.tsx +5 -1
- package/src/components/SpaceSettings/SpaceSettingsPanel.tsx +15 -8
- package/src/components/SyncStatus/InlineSyncStatus.tsx +2 -2
- package/src/components/SyncStatus/SyncStatus.tsx +2 -1
- package/src/meta.ts +1 -0
- package/src/types/types.ts +2 -7
- package/src/util.tsx +9 -4
- package/dist/lib/browser/app-graph-builder-5D2QB43K.mjs.map +0 -7
- package/dist/lib/browser/chunk-HCXWKGTE.mjs.map +0 -7
- package/dist/lib/browser/chunk-PDJ4MLA4.mjs.map +0 -7
- package/dist/lib/browser/chunk-UH5P4UL3.mjs.map +0 -7
- package/dist/lib/browser/chunk-ZBKFJNHH.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-Y6AZTVRL.mjs +0 -459
- package/dist/lib/browser/intent-resolver-Y6AZTVRL.mjs.map +0 -7
- package/dist/lib/browser/react-surface-JTNUNOJG.mjs.map +0 -7
- package/dist/lib/browser/spaces-ready-4SFNS5JQ.mjs.map +0 -7
- package/dist/lib/node/app-graph-builder-ZQ5S62YR.cjs.map +0 -7
- package/dist/lib/node/chunk-56NGXG2A.cjs.map +0 -7
- package/dist/lib/node/chunk-DDZYVNVP.cjs.map +0 -7
- package/dist/lib/node/chunk-VCPICVIE.cjs.map +0 -7
- package/dist/lib/node/chunk-Z34MTEU7.cjs.map +0 -7
- package/dist/lib/node/intent-resolver-MUGCKZPN.cjs +0 -458
- package/dist/lib/node/intent-resolver-MUGCKZPN.cjs.map +0 -7
- package/dist/lib/node/react-surface-TFPR6QAQ.cjs.map +0 -7
- package/dist/lib/node/spaces-ready-RZTKEXOL.cjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-CD6IYPSS.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-375RB3CZ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-CLGCKZ2D.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-FUMGYUD3.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-I75ZN2YH.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-6PNQKHDL.mjs +0 -460
- package/dist/lib/node-esm/intent-resolver-6PNQKHDL.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-TRLHCJZ3.mjs.map +0 -7
- package/dist/lib/node-esm/spaces-ready-ITGYYT5A.mjs.map +0 -7
- /package/dist/lib/browser/{app-graph-serializer-VNWPLPDF.mjs.map → app-graph-serializer-QDXM5M6K.mjs.map} +0 -0
- /package/dist/lib/browser/{chunk-5TBRONF6.mjs.map → chunk-SDK7RZI3.mjs.map} +0 -0
- /package/dist/lib/browser/{identity-created-EC5FOCX2.mjs.map → identity-created-25TK5XNO.mjs.map} +0 -0
- /package/dist/lib/browser/{react-root-4QQST3T2.mjs.map → react-root-Q7JJDCPB.mjs.map} +0 -0
- /package/dist/lib/browser/{settings-ASFF5BZL.mjs.map → settings-K4JPYYEM.mjs.map} +0 -0
- /package/dist/lib/browser/{state-MS4KYJWI.mjs.map → state-6DCY5YJP.mjs.map} +0 -0
- /package/dist/lib/node/{app-graph-serializer-72S7P33H.cjs.map → app-graph-serializer-H4UACG57.cjs.map} +0 -0
- /package/dist/lib/node/{chunk-BQRNTKSQ.cjs.map → chunk-D6BFKOXY.cjs.map} +0 -0
- /package/dist/lib/node/{identity-created-IMDS4A6A.cjs.map → identity-created-7G5U7R36.cjs.map} +0 -0
- /package/dist/lib/node/{react-root-TCHYZQY3.cjs.map → react-root-JN6AIHMS.cjs.map} +0 -0
- /package/dist/lib/node/{settings-QLCKAUHK.cjs.map → settings-TEELGWS4.cjs.map} +0 -0
- /package/dist/lib/node/{state-4UIOUKLJ.cjs.map → state-WPZC4JXB.cjs.map} +0 -0
- /package/dist/lib/node-esm/{app-graph-serializer-CFXS6ZE2.mjs.map → app-graph-serializer-PIPJVXYZ.mjs.map} +0 -0
- /package/dist/lib/node-esm/{chunk-M4XTHK35.mjs.map → chunk-4UX5WGKJ.mjs.map} +0 -0
- /package/dist/lib/node-esm/{identity-created-SJYZZ7Q3.mjs.map → identity-created-7THGZ7EW.mjs.map} +0 -0
- /package/dist/lib/node-esm/{react-root-BEX2XFJK.mjs.map → react-root-BNA6PBFZ.mjs.map} +0 -0
- /package/dist/lib/node-esm/{settings-WLVEO4JM.mjs.map → settings-KXYUZBLN.mjs.map} +0 -0
- /package/dist/lib/node-esm/{state-BMISGQ2O.mjs.map → state-5GH2D5U4.mjs.map} +0 -0
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
SpaceCapabilities
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-LGL4A5B5.mjs";
|
|
5
5
|
import {
|
|
6
6
|
COMPOSER_SPACE_LOCK,
|
|
7
7
|
getSpaceDisplayName
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-RCZRYXI3.mjs";
|
|
9
9
|
import {
|
|
10
10
|
CollectionType,
|
|
11
11
|
SpaceAction,
|
|
12
12
|
SpaceForm
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-AAQRELDK.mjs";
|
|
14
14
|
import {
|
|
15
15
|
SPACE_PLUGIN
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-ICCM4YRJ.mjs";
|
|
17
17
|
|
|
18
18
|
// packages/plugins/plugin-space/src/components/AdvancedObjectSettings/AdvancedObjectSettings.tsx
|
|
19
19
|
import React2, { useCallback as useCallback2, useState } from "react";
|
|
@@ -112,7 +112,7 @@ var AdvancedObjectSettings = ({ object }) => {
|
|
|
112
112
|
// packages/plugins/plugin-space/src/components/AwaitingObject.tsx
|
|
113
113
|
import { CheckCircle, CircleDashed, CircleNotch } from "@phosphor-icons/react";
|
|
114
114
|
import React3, { useCallback as useCallback3, useEffect, useState as useState2 } from "react";
|
|
115
|
-
import {
|
|
115
|
+
import { createIntent, LayoutAction, useIntentDispatcher, useLayout } from "@dxos/app-framework";
|
|
116
116
|
import { useClient } from "@dxos/react-client";
|
|
117
117
|
import { Filter, fullyQualifiedId, useQuery } from "@dxos/react-client/echo";
|
|
118
118
|
import { Button, Toast, useTranslation as useTranslation3 } from "@dxos/react-ui";
|
|
@@ -125,7 +125,7 @@ var AwaitingObject = ({ id }) => {
|
|
|
125
125
|
const [found, setFound] = useState2(false);
|
|
126
126
|
const { t } = useTranslation3(SPACE_PLUGIN);
|
|
127
127
|
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
128
|
-
const
|
|
128
|
+
const layout = useLayout();
|
|
129
129
|
const client = useClient();
|
|
130
130
|
const objects = useQuery(client.spaces, Filter.all());
|
|
131
131
|
useEffect(() => {
|
|
@@ -142,14 +142,14 @@ var AwaitingObject = ({ id }) => {
|
|
|
142
142
|
useEffect(() => {
|
|
143
143
|
if (objects.findIndex((object) => fullyQualifiedId(object) === id) > -1) {
|
|
144
144
|
setFound(true);
|
|
145
|
-
if (
|
|
145
|
+
if (layout.active.includes(id)) {
|
|
146
146
|
setOpen(false);
|
|
147
147
|
}
|
|
148
148
|
}
|
|
149
149
|
}, [
|
|
150
150
|
id,
|
|
151
151
|
objects,
|
|
152
|
-
|
|
152
|
+
layout
|
|
153
153
|
]);
|
|
154
154
|
const handleClose = useCallback3(async () => dispatch(createIntent(SpaceAction.WaitForObject, {
|
|
155
155
|
id: void 0
|
|
@@ -157,12 +157,11 @@ var AwaitingObject = ({ id }) => {
|
|
|
157
157
|
dispatch
|
|
158
158
|
]);
|
|
159
159
|
const handleNavigate = useCallback3(() => {
|
|
160
|
-
void dispatch(createIntent(
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
}
|
|
160
|
+
void dispatch(createIntent(LayoutAction.Open, {
|
|
161
|
+
part: "main",
|
|
162
|
+
subject: [
|
|
163
|
+
id
|
|
164
|
+
]
|
|
166
165
|
}));
|
|
167
166
|
void handleClose();
|
|
168
167
|
}, [
|
|
@@ -208,14 +207,21 @@ import React4 from "react";
|
|
|
208
207
|
import { Input, useTranslation as useTranslation4 } from "@dxos/react-ui";
|
|
209
208
|
var BaseObjectSettings = ({ object }) => {
|
|
210
209
|
const { t } = useTranslation4(SPACE_PLUGIN);
|
|
210
|
+
const inputRef = React4.useRef(null);
|
|
211
211
|
return /* @__PURE__ */ React4.createElement("div", {
|
|
212
212
|
role: "form",
|
|
213
213
|
className: "flex flex-col w-full p-2 gap-1"
|
|
214
214
|
}, /* @__PURE__ */ React4.createElement(Input.Root, null, /* @__PURE__ */ React4.createElement(Input.Label, null, t("name label")), /* @__PURE__ */ React4.createElement(Input.TextInput, {
|
|
215
|
+
ref: inputRef,
|
|
215
216
|
placeholder: t("name placeholder"),
|
|
216
217
|
value: object.name ?? "",
|
|
217
218
|
onChange: (event) => {
|
|
218
219
|
object.name = event.target.value;
|
|
220
|
+
},
|
|
221
|
+
onKeyDown: (event) => {
|
|
222
|
+
if (event.key === "Enter") {
|
|
223
|
+
inputRef.current?.blur();
|
|
224
|
+
}
|
|
219
225
|
}
|
|
220
226
|
})));
|
|
221
227
|
};
|
|
@@ -223,20 +229,20 @@ var BaseObjectSettings = ({ object }) => {
|
|
|
223
229
|
// packages/plugins/plugin-space/src/components/CreateDialog/CreateObjectDialog.tsx
|
|
224
230
|
import { pipe } from "effect";
|
|
225
231
|
import React6, { useCallback as useCallback5, useRef } from "react";
|
|
226
|
-
import { chain, createIntent as createIntent2,
|
|
232
|
+
import { chain, createIntent as createIntent2, LayoutAction as LayoutAction2, useIntentDispatcher as useIntentDispatcher2 } from "@dxos/app-framework";
|
|
227
233
|
import { useClient as useClient2 } from "@dxos/react-client";
|
|
228
|
-
import { getSpace, isReactiveObject, isSpace
|
|
234
|
+
import { getSpace, isReactiveObject, isSpace, useSpaces } from "@dxos/react-client/echo";
|
|
229
235
|
import { Button as Button2, Dialog, Icon as Icon2, useTranslation as useTranslation6 } from "@dxos/react-ui";
|
|
230
236
|
|
|
231
237
|
// packages/plugins/plugin-space/src/components/CreateDialog/CreateObjectPanel.tsx
|
|
232
238
|
import React5, { useCallback as useCallback4, useMemo, useState as useState3 } from "react";
|
|
233
239
|
import { Surface, isSurfaceAvailable, usePluginManager } from "@dxos/app-framework";
|
|
234
240
|
import { getObjectAnnotation, S } from "@dxos/echo-schema";
|
|
235
|
-
import {
|
|
236
|
-
import {
|
|
237
|
-
import { Form as Form2, InputHeader } from "@dxos/react-ui-form";
|
|
241
|
+
import { Icon, toLocalizedString, useTranslation as useTranslation5 } from "@dxos/react-ui";
|
|
242
|
+
import { Form as Form2 } from "@dxos/react-ui-form";
|
|
238
243
|
import { SearchList } from "@dxos/react-ui-searchlist";
|
|
239
|
-
import {
|
|
244
|
+
import { mx as mx2 } from "@dxos/react-ui-theme";
|
|
245
|
+
import { isNonNullable } from "@dxos/util";
|
|
240
246
|
var useInputSurfaceLookup = (baseData) => {
|
|
241
247
|
const pluginManager = usePluginManager();
|
|
242
248
|
return useCallback4(({ prop, schema, inputProps }) => {
|
|
@@ -261,14 +267,22 @@ var useInputSurfaceLookup = (baseData) => {
|
|
|
261
267
|
baseData
|
|
262
268
|
]);
|
|
263
269
|
};
|
|
264
|
-
var CreateObjectPanel = ({ schemas, spaces, typename: initialTypename, target: initialTarget, name: initialName, defaultSpaceId, resolve, onCreateObject }) => {
|
|
270
|
+
var CreateObjectPanel = ({ classNames, schemas, spaces, typename: initialTypename, target: initialTarget, name: initialName, defaultSpaceId, resolve, onCreateObject }) => {
|
|
265
271
|
const { t } = useTranslation5(SPACE_PLUGIN);
|
|
266
272
|
const [typename, setTypename] = useState3(initialTypename);
|
|
267
273
|
const [target, setTarget] = useState3(initialTarget);
|
|
268
274
|
const schema = schemas.find((schema2) => getObjectAnnotation(schema2)?.typename === typename);
|
|
269
|
-
const options = schemas.map(getObjectAnnotation).filter(
|
|
270
|
-
|
|
271
|
-
|
|
275
|
+
const options = schemas.map(getObjectAnnotation).filter(isNonNullable).sort((a, b) => {
|
|
276
|
+
const nameA = t("typename label", {
|
|
277
|
+
ns: a.typename,
|
|
278
|
+
defaultValue: a.typename
|
|
279
|
+
});
|
|
280
|
+
const nameB = t("typename label", {
|
|
281
|
+
ns: b.typename,
|
|
282
|
+
defaultValue: b.typename
|
|
283
|
+
});
|
|
284
|
+
return nameA.localeCompare(nameB);
|
|
285
|
+
});
|
|
272
286
|
const handleCreateObject = useCallback4(async (props) => {
|
|
273
287
|
if (!schema || !target) {
|
|
274
288
|
return;
|
|
@@ -292,55 +306,6 @@ var CreateObjectPanel = ({ schemas, spaces, typename: initialTypename, target: i
|
|
|
292
306
|
resolve,
|
|
293
307
|
typename
|
|
294
308
|
]);
|
|
295
|
-
const schemaInput = /* @__PURE__ */ React5.createElement(SearchList.Root, {
|
|
296
|
-
label: t("schema input label"),
|
|
297
|
-
classNames: "flex flex-col grow overflow-hidden"
|
|
298
|
-
}, /* @__PURE__ */ React5.createElement(SearchList.Input, {
|
|
299
|
-
autoFocus: true,
|
|
300
|
-
"data-testid": "create-object-form.schema-input",
|
|
301
|
-
placeholder: t("schema input placeholder"),
|
|
302
|
-
classNames: "px-1 my-2"
|
|
303
|
-
}), /* @__PURE__ */ React5.createElement(SearchList.Content, {
|
|
304
|
-
classNames: "max-bs-[24rem] overflow-auto"
|
|
305
|
-
}, options.map((option) => /* @__PURE__ */ React5.createElement(SearchList.Item, {
|
|
306
|
-
key: option.typename,
|
|
307
|
-
value: t("typename label", {
|
|
308
|
-
ns: option.typename,
|
|
309
|
-
defaultValue: option.typename
|
|
310
|
-
}),
|
|
311
|
-
onSelect: () => setTypename(option.typename),
|
|
312
|
-
classNames: "flex items-center gap-2"
|
|
313
|
-
}, /* @__PURE__ */ React5.createElement("span", {
|
|
314
|
-
className: "flex gap-2 items-center grow truncate"
|
|
315
|
-
}, /* @__PURE__ */ React5.createElement(Icon, {
|
|
316
|
-
icon: resolve?.(option.typename).icon ?? "ph--placeholder--regular",
|
|
317
|
-
size: 5
|
|
318
|
-
}), t("typename label", {
|
|
319
|
-
ns: option.typename,
|
|
320
|
-
defaultValue: option.typename
|
|
321
|
-
}))))));
|
|
322
|
-
const spaceInput = /* @__PURE__ */ React5.createElement(SearchList.Root, {
|
|
323
|
-
label: t("space input label"),
|
|
324
|
-
classNames: "flex flex-col grow overflow-hidden"
|
|
325
|
-
}, /* @__PURE__ */ React5.createElement(SearchList.Input, {
|
|
326
|
-
autoFocus: true,
|
|
327
|
-
"data-testid": "create-object-form.space-input",
|
|
328
|
-
placeholder: t("space input placeholder"),
|
|
329
|
-
classNames: "px-1 my-2"
|
|
330
|
-
}), /* @__PURE__ */ React5.createElement(SearchList.Content, {
|
|
331
|
-
classNames: "max-bs-[24rem] overflow-auto"
|
|
332
|
-
}, spaces.map((space) => /* @__PURE__ */ React5.createElement(SearchList.Item, {
|
|
333
|
-
key: space.id,
|
|
334
|
-
value: toLocalizedString(getSpaceDisplayName(space, {
|
|
335
|
-
personal: space.id === defaultSpaceId
|
|
336
|
-
}), t),
|
|
337
|
-
onSelect: () => setTarget(space),
|
|
338
|
-
classNames: "flex items-center gap-2"
|
|
339
|
-
}, /* @__PURE__ */ React5.createElement("span", {
|
|
340
|
-
className: "grow truncate"
|
|
341
|
-
}, toLocalizedString(getSpaceDisplayName(space, {
|
|
342
|
-
personal: space.id === defaultSpaceId
|
|
343
|
-
}), t))))));
|
|
344
309
|
const inputSurfaceLookup = useInputSurfaceLookup({
|
|
345
310
|
target
|
|
346
311
|
});
|
|
@@ -349,6 +314,7 @@ var CreateObjectPanel = ({ schemas, spaces, typename: initialTypename, target: i
|
|
|
349
314
|
name: S.optional(S.String)
|
|
350
315
|
});
|
|
351
316
|
return /* @__PURE__ */ React5.createElement(Form2, {
|
|
317
|
+
classNames: "!p-0",
|
|
352
318
|
autoFocus: true,
|
|
353
319
|
values: {
|
|
354
320
|
name: initialName
|
|
@@ -365,39 +331,79 @@ var CreateObjectPanel = ({ schemas, spaces, typename: initialTypename, target: i
|
|
|
365
331
|
]);
|
|
366
332
|
return /* @__PURE__ */ React5.createElement("div", {
|
|
367
333
|
role: "form",
|
|
368
|
-
className: "flex flex-col gap-2"
|
|
369
|
-
},
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
label: t("
|
|
383
|
-
|
|
384
|
-
}
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
}, /* @__PURE__ */ React5.createElement(
|
|
390
|
-
|
|
334
|
+
className: mx2("flex flex-col gap-2", classNames)
|
|
335
|
+
}, !schema ? /* @__PURE__ */ React5.createElement(SelectSchema, {
|
|
336
|
+
options,
|
|
337
|
+
resolve,
|
|
338
|
+
onChange: setTypename
|
|
339
|
+
}) : !target ? /* @__PURE__ */ React5.createElement(SelectSpace, {
|
|
340
|
+
spaces,
|
|
341
|
+
defaultSpaceId,
|
|
342
|
+
onChange: setTarget
|
|
343
|
+
}) : form);
|
|
344
|
+
};
|
|
345
|
+
var SelectSpace = ({ spaces, defaultSpaceId, onChange }) => {
|
|
346
|
+
const { t } = useTranslation5(SPACE_PLUGIN);
|
|
347
|
+
return /* @__PURE__ */ React5.createElement(SearchList.Root, {
|
|
348
|
+
label: t("space input label"),
|
|
349
|
+
classNames: "flex flex-col grow overflow-hidden"
|
|
350
|
+
}, /* @__PURE__ */ React5.createElement(SearchList.Input, {
|
|
351
|
+
autoFocus: true,
|
|
352
|
+
"data-testid": "create-object-form.space-input",
|
|
353
|
+
placeholder: t("space input placeholder"),
|
|
354
|
+
classNames: "px-1 my-2"
|
|
355
|
+
}), /* @__PURE__ */ React5.createElement(SearchList.Content, {
|
|
356
|
+
classNames: "max-bs-[24rem] overflow-auto"
|
|
357
|
+
}, spaces.sort((a, b) => {
|
|
358
|
+
const aName = toLocalizedString(getSpaceDisplayName(a, {
|
|
359
|
+
personal: a.id === defaultSpaceId
|
|
360
|
+
}), t);
|
|
361
|
+
const bName = toLocalizedString(getSpaceDisplayName(b, {
|
|
362
|
+
personal: b.id === defaultSpaceId
|
|
363
|
+
}), t);
|
|
364
|
+
return aName.localeCompare(bName);
|
|
365
|
+
}).map((space) => /* @__PURE__ */ React5.createElement(SearchList.Item, {
|
|
366
|
+
key: space.id,
|
|
367
|
+
value: toLocalizedString(getSpaceDisplayName(space, {
|
|
368
|
+
personal: space.id === defaultSpaceId
|
|
369
|
+
}), t),
|
|
370
|
+
onSelect: () => onChange(space),
|
|
371
|
+
classNames: "flex items-center gap-2"
|
|
372
|
+
}, /* @__PURE__ */ React5.createElement("span", {
|
|
373
|
+
className: "grow truncate"
|
|
374
|
+
}, toLocalizedString(getSpaceDisplayName(space, {
|
|
375
|
+
personal: space.id === defaultSpaceId
|
|
376
|
+
}), t))))));
|
|
377
|
+
};
|
|
378
|
+
var SelectSchema = ({ options, resolve, onChange }) => {
|
|
379
|
+
const { t } = useTranslation5(SPACE_PLUGIN);
|
|
380
|
+
return /* @__PURE__ */ React5.createElement(SearchList.Root, {
|
|
381
|
+
label: t("schema input label"),
|
|
382
|
+
classNames: "flex flex-col grow overflow-hidden"
|
|
383
|
+
}, /* @__PURE__ */ React5.createElement(SearchList.Input, {
|
|
384
|
+
autoFocus: true,
|
|
385
|
+
"data-testid": "create-object-form.schema-input",
|
|
386
|
+
placeholder: t("schema input placeholder"),
|
|
387
|
+
classNames: "px-1 my-2"
|
|
388
|
+
}), /* @__PURE__ */ React5.createElement(SearchList.Content, {
|
|
389
|
+
classNames: "max-bs-[24rem] overflow-auto"
|
|
390
|
+
}, options.map((option) => /* @__PURE__ */ React5.createElement(SearchList.Item, {
|
|
391
|
+
key: option.typename,
|
|
391
392
|
value: t("typename label", {
|
|
392
|
-
ns:
|
|
393
|
-
defaultValue:
|
|
394
|
-
})
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
393
|
+
ns: option.typename,
|
|
394
|
+
defaultValue: option.typename
|
|
395
|
+
}),
|
|
396
|
+
onSelect: () => onChange(option.typename),
|
|
397
|
+
classNames: "flex items-center gap-2"
|
|
398
|
+
}, /* @__PURE__ */ React5.createElement("span", {
|
|
399
|
+
className: "flex gap-2 items-center grow truncate"
|
|
400
|
+
}, /* @__PURE__ */ React5.createElement(Icon, {
|
|
401
|
+
icon: resolve?.(option.typename).icon ?? "ph--placeholder--regular",
|
|
402
|
+
size: 5
|
|
403
|
+
}), t("typename label", {
|
|
404
|
+
ns: option.typename,
|
|
405
|
+
defaultValue: option.typename
|
|
406
|
+
}))))));
|
|
401
407
|
};
|
|
402
408
|
|
|
403
409
|
// packages/plugins/plugin-space/src/components/CreateDialog/CreateObjectDialog.tsx
|
|
@@ -409,13 +415,13 @@ var CreateObjectDialog = ({ schemas, target, typename, name, shouldNavigate: _sh
|
|
|
409
415
|
const spaces = useSpaces();
|
|
410
416
|
const { dispatchPromise: dispatch } = useIntentDispatcher2();
|
|
411
417
|
const handleCreateObject = useCallback5(async ({ schema, target: _target, data }) => {
|
|
412
|
-
const target2 =
|
|
418
|
+
const target2 = isSpace(_target) ? _target.properties[CollectionType.typename]?.target : _target;
|
|
413
419
|
const createObjectIntent = resolve?.(schema.typename)?.createObject;
|
|
414
420
|
if (!createObjectIntent || !target2) {
|
|
415
421
|
return;
|
|
416
422
|
}
|
|
417
423
|
closeRef.current?.click();
|
|
418
|
-
const space =
|
|
424
|
+
const space = isSpace(target2) ? target2 : getSpace(target2);
|
|
419
425
|
const result = await dispatch(createObjectIntent(data, {
|
|
420
426
|
space
|
|
421
427
|
}));
|
|
@@ -427,7 +433,9 @@ var CreateObjectDialog = ({ schemas, target, typename, name, shouldNavigate: _sh
|
|
|
427
433
|
});
|
|
428
434
|
const shouldNavigate = _shouldNavigate ?? (() => true);
|
|
429
435
|
if (shouldNavigate(object)) {
|
|
430
|
-
await dispatch(pipe(addObjectIntent, chain(
|
|
436
|
+
await dispatch(pipe(addObjectIntent, chain(LayoutAction2.Open, {
|
|
437
|
+
part: "main"
|
|
438
|
+
})));
|
|
431
439
|
} else {
|
|
432
440
|
await dispatch(addObjectIntent);
|
|
433
441
|
}
|
|
@@ -440,7 +448,7 @@ var CreateObjectDialog = ({ schemas, target, typename, name, shouldNavigate: _sh
|
|
|
440
448
|
// TODO(wittjosiah): The tablist dialog pattern is copied from @dxos/plugin-manager.
|
|
441
449
|
// Consider factoring it out to the tabs package.
|
|
442
450
|
/* @__PURE__ */ React6.createElement(Dialog.Content, {
|
|
443
|
-
classNames: "p-0 bs-content
|
|
451
|
+
classNames: "p-0 bs-content max-bs-full md:max-is-[40rem] overflow-hidden"
|
|
444
452
|
}, /* @__PURE__ */ React6.createElement("div", {
|
|
445
453
|
role: "none",
|
|
446
454
|
className: "flex justify-between pbs-2 pis-2 pie-2 @md:pbs-4 @md:pis-4 @md:pie-4"
|
|
@@ -454,9 +462,8 @@ var CreateObjectDialog = ({ schemas, target, typename, name, shouldNavigate: _sh
|
|
|
454
462
|
}, /* @__PURE__ */ React6.createElement(Icon2, {
|
|
455
463
|
icon: "ph--x--regular",
|
|
456
464
|
size: 4
|
|
457
|
-
})))), /* @__PURE__ */ React6.createElement(
|
|
458
|
-
|
|
459
|
-
}, /* @__PURE__ */ React6.createElement(CreateObjectPanel, {
|
|
465
|
+
})))), /* @__PURE__ */ React6.createElement(CreateObjectPanel, {
|
|
466
|
+
classNames: "p-4",
|
|
460
467
|
schemas,
|
|
461
468
|
spaces,
|
|
462
469
|
target,
|
|
@@ -465,13 +472,14 @@ var CreateObjectDialog = ({ schemas, target, typename, name, shouldNavigate: _sh
|
|
|
465
472
|
defaultSpaceId: client.spaces.default.id,
|
|
466
473
|
resolve,
|
|
467
474
|
onCreateObject: handleCreateObject
|
|
468
|
-
}))
|
|
475
|
+
}))
|
|
469
476
|
);
|
|
470
477
|
};
|
|
471
478
|
|
|
472
479
|
// packages/plugins/plugin-space/src/components/CreateDialog/CreateSpaceDialog.tsx
|
|
480
|
+
import { Effect } from "effect";
|
|
473
481
|
import React7, { useCallback as useCallback6, useRef as useRef2 } from "react";
|
|
474
|
-
import { createIntent as createIntent3, useIntentDispatcher as useIntentDispatcher3 } from "@dxos/app-framework";
|
|
482
|
+
import { createIntent as createIntent3, LayoutAction as LayoutAction3, useIntentDispatcher as useIntentDispatcher3 } from "@dxos/app-framework";
|
|
475
483
|
import { Button as Button3, Dialog as Dialog2, Icon as Icon3, useTranslation as useTranslation7 } from "@dxos/react-ui";
|
|
476
484
|
import { Form as Form3 } from "@dxos/react-ui-form";
|
|
477
485
|
var CREATE_SPACE_DIALOG = `${SPACE_PLUGIN}/CreateSpaceDialog`;
|
|
@@ -481,15 +489,19 @@ var initialValues2 = {
|
|
|
481
489
|
var CreateSpaceDialog = () => {
|
|
482
490
|
const closeRef = useRef2(null);
|
|
483
491
|
const { t } = useTranslation7(SPACE_PLUGIN);
|
|
484
|
-
const {
|
|
492
|
+
const { dispatch } = useIntentDispatcher3();
|
|
485
493
|
const handleCreateSpace = useCallback6(async (data) => {
|
|
486
|
-
const
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
494
|
+
const program = Effect.gen(function* () {
|
|
495
|
+
const { space } = yield* dispatch(createIntent3(SpaceAction.Create, data));
|
|
496
|
+
yield* dispatch(createIntent3(LayoutAction3.SwitchWorkspace, {
|
|
497
|
+
part: "workspace",
|
|
498
|
+
subject: space.id
|
|
491
499
|
}));
|
|
492
|
-
|
|
500
|
+
yield* dispatch(createIntent3(SpaceAction.OpenCreateObject, {
|
|
501
|
+
target: space
|
|
502
|
+
}));
|
|
503
|
+
});
|
|
504
|
+
await Effect.runPromise(program);
|
|
493
505
|
}, [
|
|
494
506
|
dispatch
|
|
495
507
|
]);
|
|
@@ -497,7 +509,7 @@ var CreateSpaceDialog = () => {
|
|
|
497
509
|
// TODO(wittjosiah): The tablist dialog pattern is copied from @dxos/plugin-manager.
|
|
498
510
|
// Consider factoring it out to the tabs package.
|
|
499
511
|
/* @__PURE__ */ React7.createElement(Dialog2.Content, {
|
|
500
|
-
classNames: "p-0 bs-content min-bs-[
|
|
512
|
+
classNames: "p-0 bs-content min-bs-[16rem] max-bs-full md:max-is-[32rem] overflow-hidden"
|
|
501
513
|
}, /* @__PURE__ */ React7.createElement("div", {
|
|
502
514
|
role: "none",
|
|
503
515
|
className: "flex justify-between pbs-2 pis-2 pie-2 @md:pbs-4 @md:pis-4 @md:pie-4"
|
|
@@ -515,6 +527,8 @@ var CreateSpaceDialog = () => {
|
|
|
515
527
|
className: "p-4"
|
|
516
528
|
}, /* @__PURE__ */ React7.createElement(Form3, {
|
|
517
529
|
testId: "create-space-form",
|
|
530
|
+
classNames: "!p-0",
|
|
531
|
+
autoFocus: true,
|
|
518
532
|
values: initialValues2,
|
|
519
533
|
schema: SpaceForm,
|
|
520
534
|
onSave: handleCreateSpace
|
|
@@ -525,16 +539,16 @@ var CreateSpaceDialog = () => {
|
|
|
525
539
|
// packages/plugins/plugin-space/src/components/CollectionMain.tsx
|
|
526
540
|
import React8 from "react";
|
|
527
541
|
import { useTranslation as useTranslation8 } from "@dxos/react-ui";
|
|
528
|
-
import { baseSurface, descriptionText, mx as
|
|
542
|
+
import { baseSurface, descriptionText, mx as mx3 } from "@dxos/react-ui-theme";
|
|
529
543
|
var CollectionMain = ({ collection }) => {
|
|
530
544
|
const { t } = useTranslation8(SPACE_PLUGIN);
|
|
531
545
|
return /* @__PURE__ */ React8.createElement("div", {
|
|
532
546
|
role: "none",
|
|
533
|
-
className:
|
|
547
|
+
className: mx3(baseSurface, "min-bs-screen is-full flex items-center justify-center p-8"),
|
|
534
548
|
"data-testid": "composer.firstRunMessage"
|
|
535
549
|
}, /* @__PURE__ */ React8.createElement("p", {
|
|
536
550
|
role: "alert",
|
|
537
|
-
className:
|
|
551
|
+
className: mx3(descriptionText, "border border-dashed border-neutral-400/50 rounded-lg p-8 font-normal text-lg max-is-[24rem] break-words")
|
|
538
552
|
}, collection.name ?? t("unnamed collection label")));
|
|
539
553
|
};
|
|
540
554
|
|
|
@@ -552,37 +566,62 @@ var CollectionSection = ({ collection }) => {
|
|
|
552
566
|
|
|
553
567
|
// packages/plugins/plugin-space/src/components/JoinDialog.tsx
|
|
554
568
|
import React10, { useCallback as useCallback7 } from "react";
|
|
555
|
-
import { createIntent as createIntent4, LayoutAction
|
|
556
|
-
import {
|
|
569
|
+
import { createIntent as createIntent4, LayoutAction as LayoutAction4, useAppGraph, useIntentDispatcher as useIntentDispatcher4 } from "@dxos/app-framework";
|
|
570
|
+
import { log } from "@dxos/log";
|
|
557
571
|
import { ObservabilityAction } from "@dxos/plugin-observability/types";
|
|
558
|
-
import {
|
|
559
|
-
import { Dialog as Dialog3
|
|
572
|
+
import { useClient as useClient3 } from "@dxos/react-client";
|
|
573
|
+
import { Dialog as Dialog3 } from "@dxos/react-ui";
|
|
560
574
|
import { JoinPanel } from "@dxos/shell/react";
|
|
575
|
+
var __dxlog_file = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/JoinDialog.tsx";
|
|
561
576
|
var JOIN_DIALOG = `${SPACE_PLUGIN}/JoinDialog`;
|
|
562
577
|
var JoinDialog = ({ navigableCollections, onDone, ...props }) => {
|
|
563
|
-
const { t } = useTranslation10(SPACE_PLUGIN);
|
|
564
578
|
const { dispatchPromise: dispatch } = useIntentDispatcher4();
|
|
565
|
-
const
|
|
566
|
-
const { graph } =
|
|
579
|
+
const client = useClient3();
|
|
580
|
+
const { graph } = useAppGraph();
|
|
567
581
|
const handleDone = useCallback7(async (result) => {
|
|
568
582
|
if (result?.spaceKey) {
|
|
569
583
|
await Promise.all([
|
|
570
|
-
dispatch(createIntent4(
|
|
571
|
-
|
|
584
|
+
dispatch(createIntent4(LayoutAction4.AddToast, {
|
|
585
|
+
part: "toast",
|
|
572
586
|
subject: {
|
|
573
587
|
id: `${SPACE_PLUGIN}/join-success`,
|
|
574
588
|
duration: 5e3,
|
|
575
|
-
title:
|
|
576
|
-
|
|
589
|
+
title: [
|
|
590
|
+
"join success label",
|
|
591
|
+
{
|
|
592
|
+
ns: SPACE_PLUGIN
|
|
593
|
+
}
|
|
594
|
+
],
|
|
595
|
+
closeLabel: [
|
|
596
|
+
"dismiss label",
|
|
597
|
+
{
|
|
598
|
+
ns: SPACE_PLUGIN
|
|
599
|
+
}
|
|
600
|
+
]
|
|
577
601
|
}
|
|
578
602
|
})),
|
|
579
|
-
dispatch(createIntent4(
|
|
580
|
-
|
|
581
|
-
|
|
603
|
+
dispatch(createIntent4(LayoutAction4.UpdateDialog, {
|
|
604
|
+
part: "dialog",
|
|
605
|
+
options: {
|
|
606
|
+
state: false
|
|
607
|
+
}
|
|
582
608
|
}))
|
|
583
609
|
]);
|
|
584
610
|
}
|
|
585
|
-
const space = spaces.
|
|
611
|
+
const space = result?.spaceKey ? client.spaces.get(result.spaceKey) : void 0;
|
|
612
|
+
if (!space) {
|
|
613
|
+
log.warn("Space not found", result?.spaceKey, {
|
|
614
|
+
F: __dxlog_file,
|
|
615
|
+
L: 56,
|
|
616
|
+
S: void 0,
|
|
617
|
+
C: (f, a) => f(...a)
|
|
618
|
+
});
|
|
619
|
+
return;
|
|
620
|
+
}
|
|
621
|
+
await dispatch(createIntent4(LayoutAction4.SwitchWorkspace, {
|
|
622
|
+
part: "workspace",
|
|
623
|
+
subject: space.id
|
|
624
|
+
}));
|
|
586
625
|
const target = result?.target || (navigableCollections ? space?.id : void 0);
|
|
587
626
|
if (target) {
|
|
588
627
|
await graph.waitForPath({
|
|
@@ -590,15 +629,15 @@ var JoinDialog = ({ navigableCollections, onDone, ...props }) => {
|
|
|
590
629
|
}).catch(() => {
|
|
591
630
|
});
|
|
592
631
|
await Promise.all([
|
|
593
|
-
dispatch(createIntent4(
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
}
|
|
632
|
+
dispatch(createIntent4(LayoutAction4.Open, {
|
|
633
|
+
part: "main",
|
|
634
|
+
subject: [
|
|
635
|
+
target
|
|
636
|
+
]
|
|
599
637
|
})),
|
|
600
|
-
dispatch(createIntent4(
|
|
601
|
-
|
|
638
|
+
dispatch(createIntent4(LayoutAction4.Expose, {
|
|
639
|
+
part: "navigation",
|
|
640
|
+
subject: target
|
|
602
641
|
}))
|
|
603
642
|
]);
|
|
604
643
|
}
|
|
@@ -613,7 +652,8 @@ var JoinDialog = ({ navigableCollections, onDone, ...props }) => {
|
|
|
613
652
|
}
|
|
614
653
|
}, [
|
|
615
654
|
dispatch,
|
|
616
|
-
|
|
655
|
+
client,
|
|
656
|
+
graph
|
|
617
657
|
]);
|
|
618
658
|
return /* @__PURE__ */ React10.createElement(Dialog3.Content, null, /* @__PURE__ */ React10.createElement(JoinPanel, {
|
|
619
659
|
...props,
|
|
@@ -631,11 +671,11 @@ var JoinDialog = ({ navigableCollections, onDone, ...props }) => {
|
|
|
631
671
|
import { Planet } from "@phosphor-icons/react";
|
|
632
672
|
import React11 from "react";
|
|
633
673
|
import { getSpace as getSpace2 } from "@dxos/client/echo";
|
|
634
|
-
import { useClient as
|
|
635
|
-
import { DropdownMenu, toLocalizedString as toLocalizedString2, useTranslation as
|
|
674
|
+
import { useClient as useClient4 } from "@dxos/react-client";
|
|
675
|
+
import { DropdownMenu, toLocalizedString as toLocalizedString2, useTranslation as useTranslation10 } from "@dxos/react-ui";
|
|
636
676
|
var MenuFooter = ({ object }) => {
|
|
637
|
-
const { t } =
|
|
638
|
-
const client =
|
|
677
|
+
const { t } = useTranslation10(SPACE_PLUGIN);
|
|
678
|
+
const client = useClient4();
|
|
639
679
|
const space = getSpace2(object);
|
|
640
680
|
const spaceName = space ? getSpaceDisplayName(space, {
|
|
641
681
|
personal: client.spaces.default === space
|
|
@@ -655,8 +695,8 @@ var MenuFooter = ({ object }) => {
|
|
|
655
695
|
import { ArrowsCounterClockwise, CheckCircle as CheckCircle2, Warning } from "@phosphor-icons/react";
|
|
656
696
|
import React12, { useEffect as useEffect2, useState as useState4 } from "react";
|
|
657
697
|
import { debounce } from "@dxos/async";
|
|
658
|
-
import { Tooltip, useTranslation as
|
|
659
|
-
import { getSize as getSize2, mx as
|
|
698
|
+
import { Tooltip, useTranslation as useTranslation11 } from "@dxos/react-ui";
|
|
699
|
+
import { getSize as getSize2, mx as mx4, staticPlaceholderText, warningText } from "@dxos/react-ui-theme";
|
|
660
700
|
var Status;
|
|
661
701
|
(function(Status2) {
|
|
662
702
|
Status2[Status2["PERSISTED_LOCALLY"] = 0] = "PERSISTED_LOCALLY";
|
|
@@ -664,7 +704,7 @@ var Status;
|
|
|
664
704
|
Status2[Status2["ERROR"] = 2] = "ERROR";
|
|
665
705
|
})(Status || (Status = {}));
|
|
666
706
|
var PersistenceStatus = ({ db }) => {
|
|
667
|
-
const { t } =
|
|
707
|
+
const { t } = useTranslation11(SPACE_PLUGIN);
|
|
668
708
|
const [displayMessage, setDisplayMessage] = useState4(false);
|
|
669
709
|
const [status, naturalSetStatus] = useState4(0);
|
|
670
710
|
const [prevStatus, setPrevStatus] = useState4(0);
|
|
@@ -684,17 +724,17 @@ var PersistenceStatus = ({ db }) => {
|
|
|
684
724
|
return /* @__PURE__ */ React12.createElement("div", {
|
|
685
725
|
className: "flex items-center"
|
|
686
726
|
}, /* @__PURE__ */ React12.createElement(Warning, {
|
|
687
|
-
className:
|
|
727
|
+
className: mx4(getSize2(4), "me-1")
|
|
688
728
|
}), /* @__PURE__ */ React12.createElement("span", {
|
|
689
|
-
className:
|
|
729
|
+
className: mx4("text-sm", warningText)
|
|
690
730
|
}, t("persistence error label")));
|
|
691
731
|
case 1:
|
|
692
732
|
return /* @__PURE__ */ React12.createElement("div", {
|
|
693
733
|
className: "flex items-center"
|
|
694
734
|
}, /* @__PURE__ */ React12.createElement(ArrowsCounterClockwise, {
|
|
695
|
-
className:
|
|
735
|
+
className: mx4(getSize2(4), "me-1")
|
|
696
736
|
}), /* @__PURE__ */ React12.createElement("span", {
|
|
697
|
-
className:
|
|
737
|
+
className: mx4("text-sm", staticPlaceholderText)
|
|
698
738
|
}, t("persistence pending label")));
|
|
699
739
|
case 0:
|
|
700
740
|
default:
|
|
@@ -704,21 +744,21 @@ var PersistenceStatus = ({ db }) => {
|
|
|
704
744
|
role: "status",
|
|
705
745
|
className: "flex items-center"
|
|
706
746
|
}, /* @__PURE__ */ React12.createElement(CheckCircle2, {
|
|
707
|
-
className:
|
|
747
|
+
className: mx4(getSize2(4), "me-1")
|
|
708
748
|
}), displayMessage && /* @__PURE__ */ React12.createElement("span", {
|
|
709
|
-
className:
|
|
749
|
+
className: mx4("text-sm", staticPlaceholderText)
|
|
710
750
|
}, t("persisted locally label"))), /* @__PURE__ */ React12.createElement(Tooltip.Portal, null, /* @__PURE__ */ React12.createElement(Tooltip.Content, null, t("persisted locally message"), /* @__PURE__ */ React12.createElement(Tooltip.Arrow, null))));
|
|
711
751
|
}
|
|
712
752
|
};
|
|
713
753
|
|
|
714
754
|
// packages/plugins/plugin-space/src/components/PopoverRenameObject.tsx
|
|
715
755
|
import React13, { useCallback as useCallback8, useRef as useRef3, useState as useState5 } from "react";
|
|
716
|
-
import { log } from "@dxos/log";
|
|
717
|
-
import { Button as Button4, Input as
|
|
718
|
-
var
|
|
756
|
+
import { log as log2 } from "@dxos/log";
|
|
757
|
+
import { Button as Button4, Input as Input2, Popover, useTranslation as useTranslation12 } from "@dxos/react-ui";
|
|
758
|
+
var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/PopoverRenameObject.tsx";
|
|
719
759
|
var POPOVER_RENAME_OBJECT = `${SPACE_PLUGIN}/PopoverRenameObject`;
|
|
720
760
|
var PopoverRenameObject = ({ object: obj }) => {
|
|
721
|
-
const { t } =
|
|
761
|
+
const { t } = useTranslation12(SPACE_PLUGIN);
|
|
722
762
|
const doneButton = useRef3(null);
|
|
723
763
|
const object = obj;
|
|
724
764
|
const [name, setName] = useState5(object.name || object.title || "");
|
|
@@ -729,10 +769,10 @@ var PopoverRenameObject = ({ object: obj }) => {
|
|
|
729
769
|
try {
|
|
730
770
|
object.title = name;
|
|
731
771
|
} catch (err) {
|
|
732
|
-
|
|
772
|
+
log2.error("Failed to rename object", {
|
|
733
773
|
err
|
|
734
774
|
}, {
|
|
735
|
-
F:
|
|
775
|
+
F: __dxlog_file2,
|
|
736
776
|
L: 30,
|
|
737
777
|
S: void 0,
|
|
738
778
|
C: (f, a) => f(...a)
|
|
@@ -749,9 +789,9 @@ var PopoverRenameObject = ({ object: obj }) => {
|
|
|
749
789
|
}, /* @__PURE__ */ React13.createElement("div", {
|
|
750
790
|
role: "none",
|
|
751
791
|
className: "flex-1"
|
|
752
|
-
}, /* @__PURE__ */ React13.createElement(
|
|
792
|
+
}, /* @__PURE__ */ React13.createElement(Input2.Root, null, /* @__PURE__ */ React13.createElement(Input2.Label, {
|
|
753
793
|
srOnly: true
|
|
754
|
-
}, t("object name label")), /* @__PURE__ */ React13.createElement(
|
|
794
|
+
}, t("object name label")), /* @__PURE__ */ React13.createElement(Input2.TextInput, {
|
|
755
795
|
placeholder: t("object title placeholder"),
|
|
756
796
|
value: name,
|
|
757
797
|
"data-testid": "spacePlugin.renameObject.input",
|
|
@@ -770,10 +810,10 @@ var PopoverRenameObject = ({ object: obj }) => {
|
|
|
770
810
|
|
|
771
811
|
// packages/plugins/plugin-space/src/components/PopoverRenameSpace.tsx
|
|
772
812
|
import React14, { useCallback as useCallback9, useRef as useRef4, useState as useState6 } from "react";
|
|
773
|
-
import { Button as Button5, Input as
|
|
813
|
+
import { Button as Button5, Input as Input3, Popover as Popover2, useTranslation as useTranslation13 } from "@dxos/react-ui";
|
|
774
814
|
var POPOVER_RENAME_SPACE = `${SPACE_PLUGIN}/PopoverRenameSpace`;
|
|
775
815
|
var PopoverRenameSpace = ({ space }) => {
|
|
776
|
-
const { t } =
|
|
816
|
+
const { t } = useTranslation13(SPACE_PLUGIN);
|
|
777
817
|
const doneButton = useRef4(null);
|
|
778
818
|
const [name, setName] = useState6(space.properties.name ?? "");
|
|
779
819
|
const handleDone = useCallback9(() => {
|
|
@@ -788,9 +828,9 @@ var PopoverRenameSpace = ({ space }) => {
|
|
|
788
828
|
}, /* @__PURE__ */ React14.createElement("div", {
|
|
789
829
|
role: "none",
|
|
790
830
|
className: "flex-1"
|
|
791
|
-
}, /* @__PURE__ */ React14.createElement(
|
|
831
|
+
}, /* @__PURE__ */ React14.createElement(Input3.Root, null, /* @__PURE__ */ React14.createElement(Input3.Label, {
|
|
792
832
|
srOnly: true
|
|
793
|
-
}, t("space name label")), /* @__PURE__ */ React14.createElement(
|
|
833
|
+
}, t("space name label")), /* @__PURE__ */ React14.createElement(Input3.TextInput, {
|
|
794
834
|
defaultValue: space.properties.name ?? "",
|
|
795
835
|
placeholder: t("unnamed space label"),
|
|
796
836
|
onChange: ({ target: { value } }) => setName(value),
|
|
@@ -811,7 +851,7 @@ var PopoverRenameSpace = ({ space }) => {
|
|
|
811
851
|
// packages/plugins/plugin-space/src/components/ShareSpaceButton.tsx
|
|
812
852
|
import React15 from "react";
|
|
813
853
|
import { createIntent as createIntent5, useIntentDispatcher as useIntentDispatcher5 } from "@dxos/app-framework";
|
|
814
|
-
import { IconButton as
|
|
854
|
+
import { IconButton as IconButton3, useTranslation as useTranslation14 } from "@dxos/react-ui";
|
|
815
855
|
var ShareSpaceButton = ({ space }) => {
|
|
816
856
|
const { dispatchPromise: dispatch } = useIntentDispatcher5();
|
|
817
857
|
return /* @__PURE__ */ React15.createElement(ShareSpaceButtonImpl, {
|
|
@@ -821,8 +861,8 @@ var ShareSpaceButton = ({ space }) => {
|
|
|
821
861
|
});
|
|
822
862
|
};
|
|
823
863
|
var ShareSpaceButtonImpl = ({ onClick }) => {
|
|
824
|
-
const { t } =
|
|
825
|
-
return /* @__PURE__ */ React15.createElement(
|
|
864
|
+
const { t } = useTranslation14(SPACE_PLUGIN);
|
|
865
|
+
return /* @__PURE__ */ React15.createElement(IconButton3, {
|
|
826
866
|
"data-testid": "spacePlugin.shareSpaceButton",
|
|
827
867
|
icon: "ph--users--regular",
|
|
828
868
|
label: t("share space label"),
|
|
@@ -832,27 +872,26 @@ var ShareSpaceButtonImpl = ({ onClick }) => {
|
|
|
832
872
|
|
|
833
873
|
// packages/plugins/plugin-space/src/components/SpacePresence.tsx
|
|
834
874
|
import React16, { useCallback as useCallback10, useEffect as useEffect4, useState as useState8 } from "react";
|
|
835
|
-
import {
|
|
875
|
+
import { useAppGraph as useAppGraph2, useCapability } from "@dxos/app-framework";
|
|
836
876
|
import { generateName } from "@dxos/display-name";
|
|
837
|
-
import {
|
|
838
|
-
import { PublicKey, useClient as useClient4 } from "@dxos/react-client";
|
|
877
|
+
import { PublicKey, useClient as useClient5 } from "@dxos/react-client";
|
|
839
878
|
import { getSpace as getSpace3, useMembers, fullyQualifiedId as fullyQualifiedId2 } from "@dxos/react-client/echo";
|
|
840
879
|
import { useIdentity } from "@dxos/react-client/halo";
|
|
841
|
-
import { Avatar, AvatarGroup, AvatarGroupItem, Tooltip as Tooltip2, useTranslation as
|
|
880
|
+
import { Avatar, AvatarGroup, AvatarGroupItem, Tooltip as Tooltip2, useTranslation as useTranslation15, List as List2, ListItem as ListItem2, useDefaultValue } from "@dxos/react-ui";
|
|
842
881
|
import { AttentionGlyph, useAttended, useAttention } from "@dxos/react-ui-attention";
|
|
843
882
|
import { ComplexMap, keyToFallback } from "@dxos/util";
|
|
844
883
|
|
|
845
884
|
// packages/plugins/plugin-space/src/capabilities/index.ts
|
|
846
885
|
import { lazy } from "@dxos/app-framework";
|
|
847
|
-
var AppGraphBuilder = lazy(() => import("./app-graph-builder-
|
|
848
|
-
var AppGraphSerializer = lazy(() => import("./app-graph-serializer-
|
|
849
|
-
var IdentityCreated = lazy(() => import("./identity-created-
|
|
850
|
-
var IntentResolver = lazy(() => import("./intent-resolver-
|
|
851
|
-
var ReactRoot = lazy(() => import("./react-root-
|
|
852
|
-
var ReactSurface = lazy(() => import("./react-surface-
|
|
853
|
-
var SpaceSettings = lazy(() => import("./settings-
|
|
854
|
-
var SpaceState = lazy(() => import("./state-
|
|
855
|
-
var SpacesReady = lazy(() => import("./spaces-ready-
|
|
886
|
+
var AppGraphBuilder = lazy(() => import("./app-graph-builder-VFHK7OQI.mjs"));
|
|
887
|
+
var AppGraphSerializer = lazy(() => import("./app-graph-serializer-PIPJVXYZ.mjs"));
|
|
888
|
+
var IdentityCreated = lazy(() => import("./identity-created-7THGZ7EW.mjs"));
|
|
889
|
+
var IntentResolver = lazy(() => import("./intent-resolver-7L3GJAZE.mjs"));
|
|
890
|
+
var ReactRoot = lazy(() => import("./react-root-BNA6PBFZ.mjs"));
|
|
891
|
+
var ReactSurface = lazy(() => import("./react-surface-FTI2LQNL.mjs"));
|
|
892
|
+
var SpaceSettings = lazy(() => import("./settings-KXYUZBLN.mjs"));
|
|
893
|
+
var SpaceState = lazy(() => import("./state-5GH2D5U4.mjs"));
|
|
894
|
+
var SpacesReady = lazy(() => import("./spaces-ready-ZC2R73H3.mjs"));
|
|
856
895
|
|
|
857
896
|
// packages/plugins/plugin-space/src/hooks/usePath.ts
|
|
858
897
|
import { useEffect as useEffect3, useState as useState7 } from "react";
|
|
@@ -896,8 +935,8 @@ var ACTIVITY_DURATION = 3e4;
|
|
|
896
935
|
var noViewers = new ComplexMap(PublicKey.hash);
|
|
897
936
|
var getName = (identity) => identity.profile?.displayName ?? generateName(identity.identityKey.toHex());
|
|
898
937
|
var SpacePresence = ({ object, spaceKey }) => {
|
|
899
|
-
const spaceState =
|
|
900
|
-
const client =
|
|
938
|
+
const spaceState = useCapability(SpaceCapabilities.MutableState);
|
|
939
|
+
const client = useClient5();
|
|
901
940
|
const identity = useIdentity();
|
|
902
941
|
const space = spaceKey ? client.spaces.get(spaceKey) : getSpace3(object);
|
|
903
942
|
const spaceMembers = useMembers(space?.key);
|
|
@@ -996,7 +1035,7 @@ var PrensenceAvatar = ({ identity, showName, match, group, index, onClick }) =>
|
|
|
996
1035
|
var SmallPresenceLive = ({ id, open, viewers }) => {
|
|
997
1036
|
const { hasAttention, isAncestor, isRelated } = useAttention(id);
|
|
998
1037
|
const isAttended = hasAttention || isAncestor || isRelated;
|
|
999
|
-
const { graph } =
|
|
1038
|
+
const { graph } = useAppGraph2();
|
|
1000
1039
|
const attended = useAttended();
|
|
1001
1040
|
const startOfAttention = attended.at(-1);
|
|
1002
1041
|
const path = usePath(graph, startOfAttention);
|
|
@@ -1024,7 +1063,7 @@ var SmallPresenceLive = ({ id, open, viewers }) => {
|
|
|
1024
1063
|
});
|
|
1025
1064
|
};
|
|
1026
1065
|
var SmallPresence = ({ count = 0, attended, containsAttended }) => {
|
|
1027
|
-
const { t } =
|
|
1066
|
+
const { t } = useTranslation15(SPACE_PLUGIN);
|
|
1028
1067
|
return /* @__PURE__ */ React16.createElement(Tooltip2.Root, null, /* @__PURE__ */ React16.createElement(Tooltip2.Trigger, {
|
|
1029
1068
|
asChild: true
|
|
1030
1069
|
}, /* @__PURE__ */ React16.createElement(AttentionGlyph, {
|
|
@@ -1041,13 +1080,13 @@ var SmallPresence = ({ count = 0, attended, containsAttended }) => {
|
|
|
1041
1080
|
|
|
1042
1081
|
// packages/plugins/plugin-space/src/components/SpacePluginSettings.tsx
|
|
1043
1082
|
import React17 from "react";
|
|
1044
|
-
import { Input as
|
|
1045
|
-
import { DeprecatedFormInput } from "@dxos/react-ui-form";
|
|
1083
|
+
import { Input as Input4, useTranslation as useTranslation16 } from "@dxos/react-ui";
|
|
1084
|
+
import { DeprecatedFormContainer, DeprecatedFormInput } from "@dxos/react-ui-form";
|
|
1046
1085
|
var SpacePluginSettings = ({ settings }) => {
|
|
1047
|
-
const { t } =
|
|
1048
|
-
return /* @__PURE__ */ React17.createElement(
|
|
1086
|
+
const { t } = useTranslation16(SPACE_PLUGIN);
|
|
1087
|
+
return /* @__PURE__ */ React17.createElement(DeprecatedFormContainer, null, /* @__PURE__ */ React17.createElement(DeprecatedFormInput, {
|
|
1049
1088
|
label: t("show hidden spaces label")
|
|
1050
|
-
}, /* @__PURE__ */ React17.createElement(
|
|
1089
|
+
}, /* @__PURE__ */ React17.createElement(Input4.Switch, {
|
|
1051
1090
|
checked: settings.showHidden,
|
|
1052
1091
|
onCheckedChange: (checked) => settings.showHidden = !!checked
|
|
1053
1092
|
})));
|
|
@@ -1055,23 +1094,23 @@ var SpacePluginSettings = ({ settings }) => {
|
|
|
1055
1094
|
|
|
1056
1095
|
// packages/plugins/plugin-space/src/components/SpaceSettings/SpaceSettingsPanel.tsx
|
|
1057
1096
|
import React18, { useCallback as useCallback11, useState as useState9 } from "react";
|
|
1058
|
-
import { log as
|
|
1097
|
+
import { log as log3 } from "@dxos/log";
|
|
1059
1098
|
import { EdgeReplicationSetting } from "@dxos/protocols/proto/dxos/echo/metadata";
|
|
1060
|
-
import { useClient as
|
|
1061
|
-
import { Input as
|
|
1062
|
-
import { DeprecatedFormInput as DeprecatedFormInput2 } from "@dxos/react-ui-form";
|
|
1063
|
-
import {
|
|
1064
|
-
var
|
|
1065
|
-
var SpaceSettingsPanel = ({
|
|
1066
|
-
const { t } =
|
|
1067
|
-
const client =
|
|
1099
|
+
import { useClient as useClient6 } from "@dxos/react-client";
|
|
1100
|
+
import { Input as Input5, useTranslation as useTranslation17 } from "@dxos/react-ui";
|
|
1101
|
+
import { DeprecatedFormContainer as DeprecatedFormContainer2, DeprecatedFormInput as DeprecatedFormInput2 } from "@dxos/react-ui-form";
|
|
1102
|
+
import { HuePickerBlock } from "@dxos/react-ui-pickers";
|
|
1103
|
+
var __dxlog_file3 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/SpaceSettings/SpaceSettingsPanel.tsx";
|
|
1104
|
+
var SpaceSettingsPanel = ({ space }) => {
|
|
1105
|
+
const { t } = useTranslation17(SPACE_PLUGIN);
|
|
1106
|
+
const client = useClient6();
|
|
1068
1107
|
const edgeEnabled = Boolean(client.config.values.runtime?.client?.edgeFeatures?.echoReplicator);
|
|
1069
1108
|
const [edgeReplication, setEdgeReplication] = useState9(space.internal.data.edgeReplication === EdgeReplicationSetting.ENABLED);
|
|
1070
1109
|
const toggleEdgeReplication = useCallback11(async (next) => {
|
|
1071
1110
|
setEdgeReplication(next);
|
|
1072
1111
|
await space?.internal.setEdgeReplicationPreference(next ? EdgeReplicationSetting.ENABLED : EdgeReplicationSetting.DISABLED).catch((err) => {
|
|
1073
|
-
|
|
1074
|
-
F:
|
|
1112
|
+
log3.catch(err, void 0, {
|
|
1113
|
+
F: __dxlog_file3,
|
|
1075
1114
|
L: 36,
|
|
1076
1115
|
S: void 0,
|
|
1077
1116
|
C: (f, a) => f(...a)
|
|
@@ -1081,35 +1120,39 @@ var SpaceSettingsPanel = ({ classNames, space }) => {
|
|
|
1081
1120
|
}, [
|
|
1082
1121
|
space
|
|
1083
1122
|
]);
|
|
1084
|
-
return /* @__PURE__ */ React18.createElement(
|
|
1085
|
-
role: "form",
|
|
1086
|
-
className: mx4("flex flex-col", classNames)
|
|
1087
|
-
}, /* @__PURE__ */ React18.createElement(DeprecatedFormInput2, {
|
|
1123
|
+
return /* @__PURE__ */ React18.createElement(DeprecatedFormContainer2, null, /* @__PURE__ */ React18.createElement(DeprecatedFormInput2, {
|
|
1088
1124
|
label: t("name label")
|
|
1089
|
-
}, /* @__PURE__ */ React18.createElement(
|
|
1125
|
+
}, /* @__PURE__ */ React18.createElement(Input5.TextInput, {
|
|
1090
1126
|
placeholder: t("unnamed space label"),
|
|
1091
1127
|
value: space.properties.name ?? "",
|
|
1092
1128
|
onChange: (event) => {
|
|
1093
1129
|
space.properties.name = event.target.value;
|
|
1094
1130
|
}
|
|
1131
|
+
})), /* @__PURE__ */ React18.createElement(DeprecatedFormInput2, {
|
|
1132
|
+
label: t("hue label")
|
|
1133
|
+
}, /* @__PURE__ */ React18.createElement(HuePickerBlock, {
|
|
1134
|
+
hue: space.properties.hue,
|
|
1135
|
+
onChangeHue: (nextHue) => space.properties.hue = nextHue,
|
|
1136
|
+
onClickClear: () => space.properties.hue = void 0
|
|
1095
1137
|
})), edgeEnabled && /* @__PURE__ */ React18.createElement(DeprecatedFormInput2, {
|
|
1096
1138
|
label: t("edge replication label")
|
|
1097
|
-
}, /* @__PURE__ */ React18.createElement(
|
|
1139
|
+
}, /* @__PURE__ */ React18.createElement(Input5.Switch, {
|
|
1098
1140
|
checked: edgeReplication,
|
|
1099
1141
|
onCheckedChange: toggleEdgeReplication
|
|
1100
1142
|
})));
|
|
1101
1143
|
};
|
|
1102
1144
|
|
|
1103
1145
|
// packages/plugins/plugin-space/src/components/SpaceSettings/SpaceSettingsDialog.tsx
|
|
1104
|
-
import React19, { useState as useState10 } from "react";
|
|
1105
|
-
import {
|
|
1106
|
-
import {
|
|
1146
|
+
import React19, { useMemo as useMemo2, useState as useState10 } from "react";
|
|
1147
|
+
import { Surface as Surface2, useCapabilities } from "@dxos/app-framework";
|
|
1148
|
+
import { useClient as useClient7 } from "@dxos/react-client";
|
|
1149
|
+
import { Button as Button6, Clipboard, Dialog as Dialog4, Icon as Icon4, toLocalizedString as toLocalizedString3, useTranslation as useTranslation18 } from "@dxos/react-ui";
|
|
1107
1150
|
import { Tabs } from "@dxos/react-ui-tabs";
|
|
1108
1151
|
import { SpacePanel } from "@dxos/shell/react";
|
|
1109
1152
|
var SPACE_SETTINGS_DIALOG = `${SPACE_PLUGIN}/SpaceSettingsDialog`;
|
|
1110
1153
|
var SpaceSettingsDialog = ({ space, target, createInvitationUrl, initialTab = "members", namesCache }) => {
|
|
1111
|
-
const { t } =
|
|
1112
|
-
const client =
|
|
1154
|
+
const { t } = useTranslation18(SPACE_PLUGIN);
|
|
1155
|
+
const client = useClient7();
|
|
1113
1156
|
const [tabsActivePart, setTabsActivePart] = useState10("list");
|
|
1114
1157
|
const [selected, setSelected] = useState10(initialTab);
|
|
1115
1158
|
const locked = space.properties[COMPOSER_SPACE_LOCK];
|
|
@@ -1117,6 +1160,12 @@ var SpaceSettingsDialog = ({ space, target, createInvitationUrl, initialTab = "m
|
|
|
1117
1160
|
personal: client.spaces.default === space,
|
|
1118
1161
|
namesCache
|
|
1119
1162
|
});
|
|
1163
|
+
const panels = useCapabilities(SpaceCapabilities.SettingsPanel);
|
|
1164
|
+
const data = useMemo2(() => ({
|
|
1165
|
+
subject: space
|
|
1166
|
+
}), [
|
|
1167
|
+
space
|
|
1168
|
+
]);
|
|
1120
1169
|
return (
|
|
1121
1170
|
// TODO(wittjosiah): The tablist dialog pattern is copied from @dxos/plugin-manager.
|
|
1122
1171
|
// Consider factoring it out to the tabs package.
|
|
@@ -1169,7 +1218,10 @@ var SpaceSettingsDialog = ({ space, target, createInvitationUrl, initialTab = "m
|
|
|
1169
1218
|
}, t("settings tab label")), /* @__PURE__ */ React19.createElement(Tabs.Tab, {
|
|
1170
1219
|
value: "members",
|
|
1171
1220
|
disabled: locked
|
|
1172
|
-
}, t("members tab label"))
|
|
1221
|
+
}, t("members tab label")), panels.map((panel) => /* @__PURE__ */ React19.createElement(Tabs.Tab, {
|
|
1222
|
+
key: panel.id,
|
|
1223
|
+
value: panel.id
|
|
1224
|
+
}, toLocalizedString3(panel.label, t)))))), /* @__PURE__ */ React19.createElement(Tabs.Tabpanel, {
|
|
1173
1225
|
value: "settings",
|
|
1174
1226
|
classNames: "pli-3 @md:pli-5 max-bs-dvh overflow-y-auto"
|
|
1175
1227
|
}, /* @__PURE__ */ React19.createElement(SpaceSettingsPanel, {
|
|
@@ -1182,25 +1234,32 @@ var SpaceSettingsDialog = ({ space, target, createInvitationUrl, initialTab = "m
|
|
|
1182
1234
|
hideHeading: true,
|
|
1183
1235
|
target,
|
|
1184
1236
|
createInvitationUrl
|
|
1237
|
+
}))), panels.map((panel) => /* @__PURE__ */ React19.createElement(Tabs.Tabpanel, {
|
|
1238
|
+
key: panel.id,
|
|
1239
|
+
value: panel.id,
|
|
1240
|
+
classNames: "pli-3 @md:pli-5 max-bs-dvh overflow-y-auto"
|
|
1241
|
+
}, /* @__PURE__ */ React19.createElement(Surface2, {
|
|
1242
|
+
role: `space-settings--${panel.id}`,
|
|
1243
|
+
data
|
|
1185
1244
|
}))))))
|
|
1186
1245
|
);
|
|
1187
1246
|
};
|
|
1188
1247
|
|
|
1189
1248
|
// packages/plugins/plugin-space/src/components/SyncStatus/InlineSyncStatus.tsx
|
|
1190
1249
|
import React20, { useEffect as useEffect6, useState as useState12 } from "react";
|
|
1191
|
-
import {
|
|
1250
|
+
import { useAppGraph as useAppGraph3 } from "@dxos/app-framework";
|
|
1192
1251
|
import { QueryEdgeStatusResponse } from "@dxos/protocols/proto/dxos/client/services";
|
|
1193
1252
|
import { EdgeReplicationSetting as EdgeReplicationSetting2 } from "@dxos/protocols/proto/dxos/echo/metadata";
|
|
1194
|
-
import { useClient as
|
|
1195
|
-
import { Tooltip as Tooltip3, useTranslation as
|
|
1253
|
+
import { useClient as useClient9 } from "@dxos/react-client";
|
|
1254
|
+
import { Tooltip as Tooltip3, useTranslation as useTranslation19 } from "@dxos/react-ui";
|
|
1196
1255
|
import { AttentionGlyph as AttentionGlyph2, useAttended as useAttended2, useAttention as useAttention2 } from "@dxos/react-ui-attention";
|
|
1197
1256
|
|
|
1198
1257
|
// packages/plugins/plugin-space/src/components/SyncStatus/sync-state.ts
|
|
1199
1258
|
import { useEffect as useEffect5, useState as useState11 } from "react";
|
|
1200
1259
|
import { Context } from "@dxos/context";
|
|
1201
1260
|
import { EdgeService } from "@dxos/protocols";
|
|
1202
|
-
import { useClient as
|
|
1203
|
-
var
|
|
1261
|
+
import { useClient as useClient8 } from "@dxos/react-client";
|
|
1262
|
+
var __dxlog_file4 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/SyncStatus/sync-state.ts";
|
|
1204
1263
|
var createEmptyEdgeSyncState = () => ({
|
|
1205
1264
|
missingOnLocal: 0,
|
|
1206
1265
|
missingOnRemote: 0,
|
|
@@ -1220,11 +1279,11 @@ var getSyncSummary = (syncMap) => {
|
|
|
1220
1279
|
};
|
|
1221
1280
|
var isEdgePeerId = (peerId, spaceId) => peerId.startsWith(`${EdgeService.AUTOMERGE_REPLICATOR}:${spaceId}`);
|
|
1222
1281
|
var useSyncState = () => {
|
|
1223
|
-
const client =
|
|
1282
|
+
const client = useClient8();
|
|
1224
1283
|
const [spaceState, setSpaceState] = useState11({});
|
|
1225
1284
|
useEffect5(() => {
|
|
1226
1285
|
const ctx = new Context(void 0, {
|
|
1227
|
-
F:
|
|
1286
|
+
F: __dxlog_file4,
|
|
1228
1287
|
L: 48
|
|
1229
1288
|
});
|
|
1230
1289
|
const createSubscriptions = (spaces) => {
|
|
@@ -1259,7 +1318,7 @@ var useSpaceSyncState = (space) => {
|
|
|
1259
1318
|
const [spaceState, setSpaceState] = useState11();
|
|
1260
1319
|
useEffect5(() => {
|
|
1261
1320
|
const ctx = new Context(void 0, {
|
|
1262
|
-
F:
|
|
1321
|
+
F: __dxlog_file4,
|
|
1263
1322
|
L: 87
|
|
1264
1323
|
});
|
|
1265
1324
|
space.crud.subscribeToSyncState(ctx, ({ peers = [] }) => {
|
|
@@ -1280,7 +1339,7 @@ var useSpaceSyncState = (space) => {
|
|
|
1280
1339
|
// packages/plugins/plugin-space/src/components/SyncStatus/InlineSyncStatus.tsx
|
|
1281
1340
|
var useEdgeStatus = () => {
|
|
1282
1341
|
const [status, setStatus] = useState12(QueryEdgeStatusResponse.EdgeStatus.NOT_CONNECTED);
|
|
1283
|
-
const client =
|
|
1342
|
+
const client = useClient9();
|
|
1284
1343
|
useEffect6(() => {
|
|
1285
1344
|
client.services.services.EdgeAgentService?.queryEdgeStatus().subscribe(({ status: status2 }) => {
|
|
1286
1345
|
setStatus(status2);
|
|
@@ -1291,11 +1350,11 @@ var useEdgeStatus = () => {
|
|
|
1291
1350
|
return status;
|
|
1292
1351
|
};
|
|
1293
1352
|
var InlineSyncStatus = ({ space, open }) => {
|
|
1294
|
-
const { t } =
|
|
1353
|
+
const { t } = useTranslation19(SPACE_PLUGIN);
|
|
1295
1354
|
const id = space.id;
|
|
1296
1355
|
const { hasAttention, isAncestor, isRelated } = useAttention2(id);
|
|
1297
1356
|
const isAttended = hasAttention || isAncestor || isRelated;
|
|
1298
|
-
const { graph } =
|
|
1357
|
+
const { graph } = useAppGraph3();
|
|
1299
1358
|
const attended = useAttended2();
|
|
1300
1359
|
const startOfAttention = attended.at(-1);
|
|
1301
1360
|
const path = usePath(graph, startOfAttention);
|
|
@@ -1320,16 +1379,16 @@ var InlineSyncStatus = ({ space, open }) => {
|
|
|
1320
1379
|
// packages/plugins/plugin-space/src/components/SyncStatus/SyncStatus.tsx
|
|
1321
1380
|
import React22, { useCallback as useCallback12, useEffect as useEffect8, useState as useState14 } from "react";
|
|
1322
1381
|
import { StatusBar } from "@dxos/plugin-status-bar";
|
|
1323
|
-
import { useClient as
|
|
1324
|
-
import { Icon as Icon6, Input as
|
|
1382
|
+
import { useClient as useClient11 } from "@dxos/react-client";
|
|
1383
|
+
import { Icon as Icon6, Input as Input6, Popover as Popover3, useTranslation as useTranslation21 } from "@dxos/react-ui";
|
|
1325
1384
|
import { SyntaxHighlighter } from "@dxos/react-ui-syntax-highlighter";
|
|
1326
1385
|
import { mx as mx6 } from "@dxos/react-ui-theme";
|
|
1327
1386
|
|
|
1328
1387
|
// packages/plugins/plugin-space/src/components/SyncStatus/Space.tsx
|
|
1329
1388
|
import React21, { useEffect as useEffect7, useState as useState13 } from "react";
|
|
1330
|
-
import { useClient as
|
|
1389
|
+
import { useClient as useClient10 } from "@dxos/react-client";
|
|
1331
1390
|
import { useSpace } from "@dxos/react-client/echo";
|
|
1332
|
-
import { Icon as Icon5, toLocalizedString as toLocalizedString4, useTranslation as
|
|
1391
|
+
import { Icon as Icon5, toLocalizedString as toLocalizedString4, useTranslation as useTranslation20 } from "@dxos/react-ui";
|
|
1333
1392
|
import { mx as mx5 } from "@dxos/react-ui-theme";
|
|
1334
1393
|
var SYNC_STALLED_TIMEOUT = 5e3;
|
|
1335
1394
|
var styles = {
|
|
@@ -1361,8 +1420,8 @@ var useActive = (count) => {
|
|
|
1361
1420
|
return active;
|
|
1362
1421
|
};
|
|
1363
1422
|
var SpaceRowContainer = ({ spaceId, state }) => {
|
|
1364
|
-
const { t } =
|
|
1365
|
-
const client =
|
|
1423
|
+
const { t } = useTranslation20(SPACE_PLUGIN);
|
|
1424
|
+
const client = useClient10();
|
|
1366
1425
|
const space = useSpace(spaceId);
|
|
1367
1426
|
if (!space) {
|
|
1368
1427
|
return null;
|
|
@@ -1438,7 +1497,7 @@ var Bar = ({ classNames, count, total }) => {
|
|
|
1438
1497
|
|
|
1439
1498
|
// packages/plugins/plugin-space/src/components/SyncStatus/save-tracker.ts
|
|
1440
1499
|
import { Context as Context2 } from "@dxos/context";
|
|
1441
|
-
var
|
|
1500
|
+
var __dxlog_file5 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/SyncStatus/save-tracker.ts";
|
|
1442
1501
|
var createClientSaveTracker = (client, cb) => {
|
|
1443
1502
|
const unsubscribeCallbacks = {};
|
|
1444
1503
|
const state = {};
|
|
@@ -1466,7 +1525,7 @@ var createClientSaveTracker = (client, cb) => {
|
|
|
1466
1525
|
};
|
|
1467
1526
|
var createSpaceSaveTracker = (space, cb) => {
|
|
1468
1527
|
const ctx = new Context2(void 0, {
|
|
1469
|
-
F:
|
|
1528
|
+
F: __dxlog_file5,
|
|
1470
1529
|
L: 40
|
|
1471
1530
|
});
|
|
1472
1531
|
void space.waitUntilReady().then(() => {
|
|
@@ -1529,7 +1588,7 @@ var getIcon = (status) => {
|
|
|
1529
1588
|
|
|
1530
1589
|
// packages/plugins/plugin-space/src/components/SyncStatus/SyncStatus.tsx
|
|
1531
1590
|
var SyncStatus = () => {
|
|
1532
|
-
const client =
|
|
1591
|
+
const client = useClient11();
|
|
1533
1592
|
const state = useSyncState();
|
|
1534
1593
|
const [saved, setSaved] = useState14(true);
|
|
1535
1594
|
useEffect8(() => {
|
|
@@ -1543,7 +1602,7 @@ var SyncStatus = () => {
|
|
|
1543
1602
|
});
|
|
1544
1603
|
};
|
|
1545
1604
|
var SyncStatusIndicator = ({ state, saved }) => {
|
|
1546
|
-
const { t } =
|
|
1605
|
+
const { t } = useTranslation21(SPACE_PLUGIN);
|
|
1547
1606
|
const summary = getSyncSummary(state);
|
|
1548
1607
|
const offline = Object.values(state).length === 0;
|
|
1549
1608
|
const needsToUpload = summary.differentDocuments > 0 || summary.missingOnRemote > 0;
|
|
@@ -1584,18 +1643,16 @@ var SyncStatusIndicator = ({ state, saved }) => {
|
|
|
1584
1643
|
asChild: true
|
|
1585
1644
|
}, /* @__PURE__ */ React22.createElement(StatusBar.Button, {
|
|
1586
1645
|
title
|
|
1587
|
-
}, icon)), /* @__PURE__ */ React22.createElement(Popover3.Portal, null, /* @__PURE__ */ React22.createElement(Popover3.Content, {
|
|
1588
|
-
sideOffset: 16
|
|
1589
|
-
}, /* @__PURE__ */ React22.createElement(SyncStatusDetail, {
|
|
1646
|
+
}, icon)), /* @__PURE__ */ React22.createElement(Popover3.Portal, null, /* @__PURE__ */ React22.createElement(Popover3.Content, null, /* @__PURE__ */ React22.createElement(SyncStatusDetail, {
|
|
1590
1647
|
state,
|
|
1591
1648
|
summary,
|
|
1592
1649
|
debug: false
|
|
1593
|
-
}))));
|
|
1650
|
+
}), /* @__PURE__ */ React22.createElement(Popover3.Arrow, null))));
|
|
1594
1651
|
}
|
|
1595
1652
|
};
|
|
1596
1653
|
var SyncStatusDetail = ({ classNames, state, summary, debug }) => {
|
|
1597
1654
|
const [showAll, setShowAll] = useState14(false);
|
|
1598
|
-
const { t } =
|
|
1655
|
+
const { t } = useTranslation21(SPACE_PLUGIN);
|
|
1599
1656
|
const entries = Object.entries(state).filter(([_, value]) => showAll || value.missingOnLocal + value.missingOnRemote > 0).toSorted(([a], [b]) => a < b ? -1 : a > b ? 1 : 0);
|
|
1600
1657
|
const handleCheckedChange = useCallback12((state2) => setShowAll(state2), [
|
|
1601
1658
|
setShowAll
|
|
@@ -1609,9 +1666,9 @@ var SyncStatusDetail = ({ classNames, state, summary, debug }) => {
|
|
|
1609
1666
|
className: "flex-1"
|
|
1610
1667
|
}, t("sync status title")), /* @__PURE__ */ React22.createElement("div", {
|
|
1611
1668
|
className: "flex items-center gap-2"
|
|
1612
|
-
}, /* @__PURE__ */ React22.createElement(
|
|
1669
|
+
}, /* @__PURE__ */ React22.createElement(Input6.Root, null, /* @__PURE__ */ React22.createElement(Input6.Label, {
|
|
1613
1670
|
classNames: "text-xs"
|
|
1614
|
-
}, t("show all label")), /* @__PURE__ */ React22.createElement(
|
|
1671
|
+
}, t("show all label")), /* @__PURE__ */ React22.createElement(Input6.Checkbox, {
|
|
1615
1672
|
checked: showAll,
|
|
1616
1673
|
onCheckedChange: handleCheckedChange
|
|
1617
1674
|
})))), /* @__PURE__ */ React22.createElement("div", {
|
|
@@ -1670,4 +1727,4 @@ export {
|
|
|
1670
1727
|
SpaceState,
|
|
1671
1728
|
SpacesReady
|
|
1672
1729
|
};
|
|
1673
|
-
//# sourceMappingURL=chunk-
|
|
1730
|
+
//# sourceMappingURL=chunk-FTVEA5LO.mjs.map
|