@dxos/plugin-space 0.7.5-labs.a279d8c → 0.7.5-labs.f5080a1
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-TTM2YZVS.mjs} +10 -8
- package/dist/lib/browser/app-graph-builder-TTM2YZVS.mjs.map +7 -0
- package/dist/lib/browser/{app-graph-serializer-VNWPLPDF.mjs → app-graph-serializer-ZGM5NDXE.mjs} +5 -5
- package/dist/lib/browser/{chunk-PDJ4MLA4.mjs → chunk-2NMUVDMZ.mjs} +293 -250
- package/dist/lib/browser/chunk-2NMUVDMZ.mjs.map +7 -0
- package/dist/lib/browser/{chunk-5TBRONF6.mjs → chunk-ENRYFGYE.mjs} +3 -3
- package/dist/lib/browser/{chunk-HCXWKGTE.mjs → chunk-H2AR4OLP.mjs} +4 -4
- package/dist/lib/browser/{chunk-HCXWKGTE.mjs.map → chunk-H2AR4OLP.mjs.map} +3 -3
- 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-ZBKFJNHH.mjs → chunk-S5IGZNXJ.mjs} +14 -9
- package/dist/lib/browser/chunk-S5IGZNXJ.mjs.map +7 -0
- package/dist/lib/browser/{identity-created-EC5FOCX2.mjs → identity-created-VICTPQX7.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-A5274MUR.mjs +537 -0
- package/dist/lib/browser/intent-resolver-A5274MUR.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-root-4QQST3T2.mjs → react-root-N6QTWYCV.mjs} +6 -6
- package/dist/lib/browser/{react-surface-JTNUNOJG.mjs → react-surface-STMNA7W7.mjs} +26 -33
- package/dist/lib/browser/react-surface-STMNA7W7.mjs.map +7 -0
- package/dist/lib/browser/{settings-ASFF5BZL.mjs → settings-HN5UIYQO.mjs} +3 -3
- package/dist/lib/browser/{spaces-ready-4SFNS5JQ.mjs → spaces-ready-F57ITJDR.mjs} +31 -32
- package/dist/lib/browser/spaces-ready-F57ITJDR.mjs.map +7 -0
- package/dist/lib/browser/{state-MS4KYJWI.mjs → state-6DCY5YJP.mjs} +3 -3
- package/dist/lib/browser/types/index.mjs +2 -2
- package/dist/lib/node/{app-graph-builder-ZQ5S62YR.cjs → app-graph-builder-6N4TEVHH.cjs} +58 -56
- package/dist/lib/node/app-graph-builder-6N4TEVHH.cjs.map +7 -0
- package/dist/lib/node/{app-graph-serializer-72S7P33H.cjs → app-graph-serializer-AWKVTYAB.cjs} +21 -21
- package/dist/lib/node/{chunk-VCPICVIE.cjs → chunk-2RCJT3P2.cjs} +294 -251
- package/dist/lib/node/chunk-2RCJT3P2.cjs.map +7 -0
- package/dist/lib/node/{chunk-BQRNTKSQ.cjs → chunk-I2LRRRMV.cjs} +8 -8
- package/dist/lib/node/{chunk-Z34MTEU7.cjs → chunk-MMXP2NHE.cjs} +65 -60
- package/dist/lib/node/chunk-MMXP2NHE.cjs.map +7 -0
- package/dist/lib/node/{chunk-DDZYVNVP.cjs → chunk-SPCSJ2CY.cjs} +8 -8
- package/dist/lib/node/{chunk-DDZYVNVP.cjs.map → chunk-SPCSJ2CY.cjs.map} +3 -3
- 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-JNDKMFKI.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-NVTAESKB.cjs +536 -0
- package/dist/lib/node/intent-resolver-NVTAESKB.cjs.map +7 -0
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/{react-root-TCHYZQY3.cjs → react-root-YCHSAYQE.cjs} +12 -12
- package/dist/lib/node/{react-surface-TFPR6QAQ.cjs → react-surface-ANSZ4FKK.cjs} +72 -76
- package/dist/lib/node/react-surface-ANSZ4FKK.cjs.map +7 -0
- package/dist/lib/node/{settings-QLCKAUHK.cjs → settings-RBBL22DJ.cjs} +8 -8
- package/dist/lib/node/{spaces-ready-RZTKEXOL.cjs → spaces-ready-WHU4J6E5.cjs} +39 -40
- package/dist/lib/node/spaces-ready-WHU4J6E5.cjs.map +7 -0
- package/dist/lib/node/{state-4UIOUKLJ.cjs → state-WPZC4JXB.cjs} +8 -8
- package/dist/lib/node/types/index.cjs +17 -17
- package/dist/lib/node/types/index.cjs.map +1 -1
- package/dist/lib/node-esm/{app-graph-builder-CD6IYPSS.mjs → app-graph-builder-MS6BI5EW.mjs} +10 -8
- package/dist/lib/node-esm/app-graph-builder-MS6BI5EW.mjs.map +7 -0
- package/dist/lib/node-esm/{app-graph-serializer-CFXS6ZE2.mjs → app-graph-serializer-AWAWDSCM.mjs} +5 -5
- package/dist/lib/node-esm/{chunk-I75ZN2YH.mjs → chunk-4HICD7AU.mjs} +293 -250
- package/dist/lib/node-esm/chunk-4HICD7AU.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-FUMGYUD3.mjs → chunk-77RE7Y5J.mjs} +14 -9
- package/dist/lib/node-esm/chunk-77RE7Y5J.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-M4XTHK35.mjs → chunk-ESWV7ICX.mjs} +3 -3
- 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-CLGCKZ2D.mjs → chunk-S6VAU6VJ.mjs} +4 -4
- package/dist/lib/node-esm/{chunk-CLGCKZ2D.mjs.map → chunk-S6VAU6VJ.mjs.map} +3 -3
- package/dist/lib/node-esm/{identity-created-SJYZZ7Q3.mjs → identity-created-3AUSSVEK.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-KJ67TU34.mjs +538 -0
- package/dist/lib/node-esm/intent-resolver-KJ67TU34.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-root-BEX2XFJK.mjs → react-root-NBQQKAZD.mjs} +6 -6
- package/dist/lib/node-esm/{react-surface-TRLHCJZ3.mjs → react-surface-G2H5T2D2.mjs} +26 -33
- package/dist/lib/node-esm/react-surface-G2H5T2D2.mjs.map +7 -0
- package/dist/lib/node-esm/{settings-WLVEO4JM.mjs → settings-VBAUB37B.mjs} +3 -3
- package/dist/lib/node-esm/{spaces-ready-ITGYYT5A.mjs → spaces-ready-ABADUX2P.mjs} +31 -32
- package/dist/lib/node-esm/spaces-ready-ABADUX2P.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 -2
- 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/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.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 -2
- package/dist/types/src/util.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +38 -37
- package/src/SpacePlugin.tsx +11 -6
- package/src/capabilities/app-graph-builder.ts +4 -3
- 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/CreateDialog/CreateObjectDialog.tsx +15 -15
- package/src/components/CreateDialog/CreateObjectPanel.tsx +113 -114
- 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.tsx +3 -4
- 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 -2
- package/src/util.tsx +8 -4
- package/dist/lib/browser/app-graph-builder-5D2QB43K.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-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-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-ZGM5NDXE.mjs.map} +0 -0
- /package/dist/lib/browser/{chunk-5TBRONF6.mjs.map → chunk-ENRYFGYE.mjs.map} +0 -0
- /package/dist/lib/browser/{identity-created-EC5FOCX2.mjs.map → identity-created-VICTPQX7.mjs.map} +0 -0
- /package/dist/lib/browser/{react-root-4QQST3T2.mjs.map → react-root-N6QTWYCV.mjs.map} +0 -0
- /package/dist/lib/browser/{settings-ASFF5BZL.mjs.map → settings-HN5UIYQO.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-AWKVTYAB.cjs.map} +0 -0
- /package/dist/lib/node/{chunk-BQRNTKSQ.cjs.map → chunk-I2LRRRMV.cjs.map} +0 -0
- /package/dist/lib/node/{identity-created-IMDS4A6A.cjs.map → identity-created-JNDKMFKI.cjs.map} +0 -0
- /package/dist/lib/node/{react-root-TCHYZQY3.cjs.map → react-root-YCHSAYQE.cjs.map} +0 -0
- /package/dist/lib/node/{settings-QLCKAUHK.cjs.map → settings-RBBL22DJ.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-AWAWDSCM.mjs.map} +0 -0
- /package/dist/lib/node-esm/{chunk-M4XTHK35.mjs.map → chunk-ESWV7ICX.mjs.map} +0 -0
- /package/dist/lib/node-esm/{identity-created-SJYZZ7Q3.mjs.map → identity-created-3AUSSVEK.mjs.map} +0 -0
- /package/dist/lib/node-esm/{react-root-BEX2XFJK.mjs.map → react-root-NBQQKAZD.mjs.map} +0 -0
- /package/dist/lib/node-esm/{settings-WLVEO4JM.mjs.map → settings-VBAUB37B.mjs.map} +0 -0
- /package/dist/lib/node-esm/{state-BMISGQ2O.mjs.map → state-5GH2D5U4.mjs.map} +0 -0
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SpaceCapabilities
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-RLZQJD47.mjs";
|
|
4
4
|
import {
|
|
5
5
|
COMPOSER_SPACE_LOCK,
|
|
6
6
|
getSpaceDisplayName
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-S5IGZNXJ.mjs";
|
|
8
8
|
import {
|
|
9
9
|
CollectionType,
|
|
10
10
|
SpaceAction,
|
|
11
11
|
SpaceForm
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-H2AR4OLP.mjs";
|
|
13
13
|
import {
|
|
14
14
|
SPACE_PLUGIN
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-PQXZCNAU.mjs";
|
|
16
16
|
|
|
17
17
|
// packages/plugins/plugin-space/src/components/AdvancedObjectSettings/AdvancedObjectSettings.tsx
|
|
18
18
|
import React2, { useCallback as useCallback2, useState } from "react";
|
|
@@ -111,7 +111,7 @@ var AdvancedObjectSettings = ({ object }) => {
|
|
|
111
111
|
// packages/plugins/plugin-space/src/components/AwaitingObject.tsx
|
|
112
112
|
import { CheckCircle, CircleDashed, CircleNotch } from "@phosphor-icons/react";
|
|
113
113
|
import React3, { useCallback as useCallback3, useEffect, useState as useState2 } from "react";
|
|
114
|
-
import {
|
|
114
|
+
import { createIntent, LayoutAction, useIntentDispatcher, useLayout } from "@dxos/app-framework";
|
|
115
115
|
import { useClient } from "@dxos/react-client";
|
|
116
116
|
import { Filter, fullyQualifiedId, useQuery } from "@dxos/react-client/echo";
|
|
117
117
|
import { Button, Toast, useTranslation as useTranslation3 } from "@dxos/react-ui";
|
|
@@ -124,7 +124,7 @@ var AwaitingObject = ({ id }) => {
|
|
|
124
124
|
const [found, setFound] = useState2(false);
|
|
125
125
|
const { t } = useTranslation3(SPACE_PLUGIN);
|
|
126
126
|
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
127
|
-
const
|
|
127
|
+
const layout = useLayout();
|
|
128
128
|
const client = useClient();
|
|
129
129
|
const objects = useQuery(client.spaces, Filter.all());
|
|
130
130
|
useEffect(() => {
|
|
@@ -141,14 +141,14 @@ var AwaitingObject = ({ id }) => {
|
|
|
141
141
|
useEffect(() => {
|
|
142
142
|
if (objects.findIndex((object) => fullyQualifiedId(object) === id) > -1) {
|
|
143
143
|
setFound(true);
|
|
144
|
-
if (
|
|
144
|
+
if (layout.active.includes(id)) {
|
|
145
145
|
setOpen(false);
|
|
146
146
|
}
|
|
147
147
|
}
|
|
148
148
|
}, [
|
|
149
149
|
id,
|
|
150
150
|
objects,
|
|
151
|
-
|
|
151
|
+
layout
|
|
152
152
|
]);
|
|
153
153
|
const handleClose = useCallback3(async () => dispatch(createIntent(SpaceAction.WaitForObject, {
|
|
154
154
|
id: void 0
|
|
@@ -156,12 +156,11 @@ var AwaitingObject = ({ id }) => {
|
|
|
156
156
|
dispatch
|
|
157
157
|
]);
|
|
158
158
|
const handleNavigate = useCallback3(() => {
|
|
159
|
-
void dispatch(createIntent(
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
}
|
|
159
|
+
void dispatch(createIntent(LayoutAction.Open, {
|
|
160
|
+
part: "main",
|
|
161
|
+
subject: [
|
|
162
|
+
id
|
|
163
|
+
]
|
|
165
164
|
}));
|
|
166
165
|
void handleClose();
|
|
167
166
|
}, [
|
|
@@ -222,19 +221,19 @@ var BaseObjectSettings = ({ object }) => {
|
|
|
222
221
|
// packages/plugins/plugin-space/src/components/CreateDialog/CreateObjectDialog.tsx
|
|
223
222
|
import { pipe } from "effect";
|
|
224
223
|
import React6, { useCallback as useCallback5, useRef } from "react";
|
|
225
|
-
import { chain, createIntent as createIntent2,
|
|
224
|
+
import { chain, createIntent as createIntent2, LayoutAction as LayoutAction2, useIntentDispatcher as useIntentDispatcher2 } from "@dxos/app-framework";
|
|
226
225
|
import { useClient as useClient2 } from "@dxos/react-client";
|
|
227
|
-
import { getSpace, isReactiveObject, isSpace
|
|
226
|
+
import { getSpace, isReactiveObject, isSpace, useSpaces } from "@dxos/react-client/echo";
|
|
228
227
|
import { Button as Button2, Dialog, Icon as Icon2, useTranslation as useTranslation6 } from "@dxos/react-ui";
|
|
229
228
|
|
|
230
229
|
// packages/plugins/plugin-space/src/components/CreateDialog/CreateObjectPanel.tsx
|
|
231
230
|
import React5, { useCallback as useCallback4, useMemo, useState as useState3 } from "react";
|
|
232
231
|
import { Surface, isSurfaceAvailable, usePluginManager } from "@dxos/app-framework";
|
|
233
232
|
import { getObjectAnnotation, S } from "@dxos/echo-schema";
|
|
234
|
-
import {
|
|
235
|
-
import {
|
|
236
|
-
import { Form as Form2, InputHeader } from "@dxos/react-ui-form";
|
|
233
|
+
import { Icon, toLocalizedString, useTranslation as useTranslation5 } from "@dxos/react-ui";
|
|
234
|
+
import { Form as Form2 } from "@dxos/react-ui-form";
|
|
237
235
|
import { SearchList } from "@dxos/react-ui-searchlist";
|
|
236
|
+
import { mx as mx2 } from "@dxos/react-ui-theme";
|
|
238
237
|
import { nonNullable } from "@dxos/util";
|
|
239
238
|
var useInputSurfaceLookup = (baseData) => {
|
|
240
239
|
const pluginManager = usePluginManager();
|
|
@@ -260,14 +259,22 @@ var useInputSurfaceLookup = (baseData) => {
|
|
|
260
259
|
baseData
|
|
261
260
|
]);
|
|
262
261
|
};
|
|
263
|
-
var CreateObjectPanel = ({ schemas, spaces, typename: initialTypename, target: initialTarget, name: initialName, defaultSpaceId, resolve, onCreateObject }) => {
|
|
262
|
+
var CreateObjectPanel = ({ classNames, schemas, spaces, typename: initialTypename, target: initialTarget, name: initialName, defaultSpaceId, resolve, onCreateObject }) => {
|
|
264
263
|
const { t } = useTranslation5(SPACE_PLUGIN);
|
|
265
264
|
const [typename, setTypename] = useState3(initialTypename);
|
|
266
265
|
const [target, setTarget] = useState3(initialTarget);
|
|
267
266
|
const schema = schemas.find((schema2) => getObjectAnnotation(schema2)?.typename === typename);
|
|
268
|
-
const options = schemas.map(getObjectAnnotation).filter(nonNullable)
|
|
269
|
-
|
|
270
|
-
|
|
267
|
+
const options = schemas.map(getObjectAnnotation).filter(nonNullable).sort((a, b) => {
|
|
268
|
+
const nameA = t("typename label", {
|
|
269
|
+
ns: a.typename,
|
|
270
|
+
defaultValue: a.typename
|
|
271
|
+
});
|
|
272
|
+
const nameB = t("typename label", {
|
|
273
|
+
ns: b.typename,
|
|
274
|
+
defaultValue: b.typename
|
|
275
|
+
});
|
|
276
|
+
return nameA.localeCompare(nameB);
|
|
277
|
+
});
|
|
271
278
|
const handleCreateObject = useCallback4(async (props) => {
|
|
272
279
|
if (!schema || !target) {
|
|
273
280
|
return;
|
|
@@ -291,55 +298,6 @@ var CreateObjectPanel = ({ schemas, spaces, typename: initialTypename, target: i
|
|
|
291
298
|
resolve,
|
|
292
299
|
typename
|
|
293
300
|
]);
|
|
294
|
-
const schemaInput = /* @__PURE__ */ React5.createElement(SearchList.Root, {
|
|
295
|
-
label: t("schema input label"),
|
|
296
|
-
classNames: "flex flex-col grow overflow-hidden"
|
|
297
|
-
}, /* @__PURE__ */ React5.createElement(SearchList.Input, {
|
|
298
|
-
autoFocus: true,
|
|
299
|
-
"data-testid": "create-object-form.schema-input",
|
|
300
|
-
placeholder: t("schema input placeholder"),
|
|
301
|
-
classNames: "px-1 my-2"
|
|
302
|
-
}), /* @__PURE__ */ React5.createElement(SearchList.Content, {
|
|
303
|
-
classNames: "max-bs-[24rem] overflow-auto"
|
|
304
|
-
}, options.map((option) => /* @__PURE__ */ React5.createElement(SearchList.Item, {
|
|
305
|
-
key: option.typename,
|
|
306
|
-
value: t("typename label", {
|
|
307
|
-
ns: option.typename,
|
|
308
|
-
defaultValue: option.typename
|
|
309
|
-
}),
|
|
310
|
-
onSelect: () => setTypename(option.typename),
|
|
311
|
-
classNames: "flex items-center gap-2"
|
|
312
|
-
}, /* @__PURE__ */ React5.createElement("span", {
|
|
313
|
-
className: "flex gap-2 items-center grow truncate"
|
|
314
|
-
}, /* @__PURE__ */ React5.createElement(Icon, {
|
|
315
|
-
icon: resolve?.(option.typename).icon ?? "ph--placeholder--regular",
|
|
316
|
-
size: 5
|
|
317
|
-
}), t("typename label", {
|
|
318
|
-
ns: option.typename,
|
|
319
|
-
defaultValue: option.typename
|
|
320
|
-
}))))));
|
|
321
|
-
const spaceInput = /* @__PURE__ */ React5.createElement(SearchList.Root, {
|
|
322
|
-
label: t("space input label"),
|
|
323
|
-
classNames: "flex flex-col grow overflow-hidden"
|
|
324
|
-
}, /* @__PURE__ */ React5.createElement(SearchList.Input, {
|
|
325
|
-
autoFocus: true,
|
|
326
|
-
"data-testid": "create-object-form.space-input",
|
|
327
|
-
placeholder: t("space input placeholder"),
|
|
328
|
-
classNames: "px-1 my-2"
|
|
329
|
-
}), /* @__PURE__ */ React5.createElement(SearchList.Content, {
|
|
330
|
-
classNames: "max-bs-[24rem] overflow-auto"
|
|
331
|
-
}, spaces.map((space) => /* @__PURE__ */ React5.createElement(SearchList.Item, {
|
|
332
|
-
key: space.id,
|
|
333
|
-
value: toLocalizedString(getSpaceDisplayName(space, {
|
|
334
|
-
personal: space.id === defaultSpaceId
|
|
335
|
-
}), t),
|
|
336
|
-
onSelect: () => setTarget(space),
|
|
337
|
-
classNames: "flex items-center gap-2"
|
|
338
|
-
}, /* @__PURE__ */ React5.createElement("span", {
|
|
339
|
-
className: "grow truncate"
|
|
340
|
-
}, toLocalizedString(getSpaceDisplayName(space, {
|
|
341
|
-
personal: space.id === defaultSpaceId
|
|
342
|
-
}), t))))));
|
|
343
301
|
const inputSurfaceLookup = useInputSurfaceLookup({
|
|
344
302
|
target
|
|
345
303
|
});
|
|
@@ -348,6 +306,7 @@ var CreateObjectPanel = ({ schemas, spaces, typename: initialTypename, target: i
|
|
|
348
306
|
name: S.optional(S.String)
|
|
349
307
|
});
|
|
350
308
|
return /* @__PURE__ */ React5.createElement(Form2, {
|
|
309
|
+
classNames: "!p-0",
|
|
351
310
|
autoFocus: true,
|
|
352
311
|
values: {
|
|
353
312
|
name: initialName
|
|
@@ -364,39 +323,79 @@ var CreateObjectPanel = ({ schemas, spaces, typename: initialTypename, target: i
|
|
|
364
323
|
]);
|
|
365
324
|
return /* @__PURE__ */ React5.createElement("div", {
|
|
366
325
|
role: "form",
|
|
367
|
-
className: "flex flex-col gap-2"
|
|
368
|
-
},
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
label: t("
|
|
382
|
-
|
|
383
|
-
}
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
}, /* @__PURE__ */ React5.createElement(
|
|
389
|
-
|
|
326
|
+
className: mx2("flex flex-col gap-2", classNames)
|
|
327
|
+
}, !schema ? /* @__PURE__ */ React5.createElement(SelectSchema, {
|
|
328
|
+
options,
|
|
329
|
+
resolve,
|
|
330
|
+
onChange: setTypename
|
|
331
|
+
}) : !target ? /* @__PURE__ */ React5.createElement(SelectSpace, {
|
|
332
|
+
spaces,
|
|
333
|
+
defaultSpaceId,
|
|
334
|
+
onChange: setTarget
|
|
335
|
+
}) : form);
|
|
336
|
+
};
|
|
337
|
+
var SelectSpace = ({ spaces, defaultSpaceId, onChange }) => {
|
|
338
|
+
const { t } = useTranslation5(SPACE_PLUGIN);
|
|
339
|
+
return /* @__PURE__ */ React5.createElement(SearchList.Root, {
|
|
340
|
+
label: t("space input label"),
|
|
341
|
+
classNames: "flex flex-col grow overflow-hidden"
|
|
342
|
+
}, /* @__PURE__ */ React5.createElement(SearchList.Input, {
|
|
343
|
+
autoFocus: true,
|
|
344
|
+
"data-testid": "create-object-form.space-input",
|
|
345
|
+
placeholder: t("space input placeholder"),
|
|
346
|
+
classNames: "px-1 my-2"
|
|
347
|
+
}), /* @__PURE__ */ React5.createElement(SearchList.Content, {
|
|
348
|
+
classNames: "max-bs-[24rem] overflow-auto"
|
|
349
|
+
}, spaces.sort((a, b) => {
|
|
350
|
+
const aName = toLocalizedString(getSpaceDisplayName(a, {
|
|
351
|
+
personal: a.id === defaultSpaceId
|
|
352
|
+
}), t);
|
|
353
|
+
const bName = toLocalizedString(getSpaceDisplayName(b, {
|
|
354
|
+
personal: b.id === defaultSpaceId
|
|
355
|
+
}), t);
|
|
356
|
+
return aName.localeCompare(bName);
|
|
357
|
+
}).map((space) => /* @__PURE__ */ React5.createElement(SearchList.Item, {
|
|
358
|
+
key: space.id,
|
|
359
|
+
value: toLocalizedString(getSpaceDisplayName(space, {
|
|
360
|
+
personal: space.id === defaultSpaceId
|
|
361
|
+
}), t),
|
|
362
|
+
onSelect: () => onChange(space),
|
|
363
|
+
classNames: "flex items-center gap-2"
|
|
364
|
+
}, /* @__PURE__ */ React5.createElement("span", {
|
|
365
|
+
className: "grow truncate"
|
|
366
|
+
}, toLocalizedString(getSpaceDisplayName(space, {
|
|
367
|
+
personal: space.id === defaultSpaceId
|
|
368
|
+
}), t))))));
|
|
369
|
+
};
|
|
370
|
+
var SelectSchema = ({ options, resolve, onChange }) => {
|
|
371
|
+
const { t } = useTranslation5(SPACE_PLUGIN);
|
|
372
|
+
return /* @__PURE__ */ React5.createElement(SearchList.Root, {
|
|
373
|
+
label: t("schema input label"),
|
|
374
|
+
classNames: "flex flex-col grow overflow-hidden"
|
|
375
|
+
}, /* @__PURE__ */ React5.createElement(SearchList.Input, {
|
|
376
|
+
autoFocus: true,
|
|
377
|
+
"data-testid": "create-object-form.schema-input",
|
|
378
|
+
placeholder: t("schema input placeholder"),
|
|
379
|
+
classNames: "px-1 my-2"
|
|
380
|
+
}), /* @__PURE__ */ React5.createElement(SearchList.Content, {
|
|
381
|
+
classNames: "max-bs-[24rem] overflow-auto"
|
|
382
|
+
}, options.map((option) => /* @__PURE__ */ React5.createElement(SearchList.Item, {
|
|
383
|
+
key: option.typename,
|
|
390
384
|
value: t("typename label", {
|
|
391
|
-
ns:
|
|
392
|
-
defaultValue:
|
|
393
|
-
})
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
385
|
+
ns: option.typename,
|
|
386
|
+
defaultValue: option.typename
|
|
387
|
+
}),
|
|
388
|
+
onSelect: () => onChange(option.typename),
|
|
389
|
+
classNames: "flex items-center gap-2"
|
|
390
|
+
}, /* @__PURE__ */ React5.createElement("span", {
|
|
391
|
+
className: "flex gap-2 items-center grow truncate"
|
|
392
|
+
}, /* @__PURE__ */ React5.createElement(Icon, {
|
|
393
|
+
icon: resolve?.(option.typename).icon ?? "ph--placeholder--regular",
|
|
394
|
+
size: 5
|
|
395
|
+
}), t("typename label", {
|
|
396
|
+
ns: option.typename,
|
|
397
|
+
defaultValue: option.typename
|
|
398
|
+
}))))));
|
|
400
399
|
};
|
|
401
400
|
|
|
402
401
|
// packages/plugins/plugin-space/src/components/CreateDialog/CreateObjectDialog.tsx
|
|
@@ -408,13 +407,13 @@ var CreateObjectDialog = ({ schemas, target, typename, name, shouldNavigate: _sh
|
|
|
408
407
|
const spaces = useSpaces();
|
|
409
408
|
const { dispatchPromise: dispatch } = useIntentDispatcher2();
|
|
410
409
|
const handleCreateObject = useCallback5(async ({ schema, target: _target, data }) => {
|
|
411
|
-
const target2 =
|
|
410
|
+
const target2 = isSpace(_target) ? _target.properties[CollectionType.typename]?.target : _target;
|
|
412
411
|
const createObjectIntent = resolve?.(schema.typename)?.createObject;
|
|
413
412
|
if (!createObjectIntent || !target2) {
|
|
414
413
|
return;
|
|
415
414
|
}
|
|
416
415
|
closeRef.current?.click();
|
|
417
|
-
const space =
|
|
416
|
+
const space = isSpace(target2) ? target2 : getSpace(target2);
|
|
418
417
|
const result = await dispatch(createObjectIntent(data, {
|
|
419
418
|
space
|
|
420
419
|
}));
|
|
@@ -426,7 +425,9 @@ var CreateObjectDialog = ({ schemas, target, typename, name, shouldNavigate: _sh
|
|
|
426
425
|
});
|
|
427
426
|
const shouldNavigate = _shouldNavigate ?? (() => true);
|
|
428
427
|
if (shouldNavigate(object)) {
|
|
429
|
-
await dispatch(pipe(addObjectIntent, chain(
|
|
428
|
+
await dispatch(pipe(addObjectIntent, chain(LayoutAction2.Open, {
|
|
429
|
+
part: "main"
|
|
430
|
+
})));
|
|
430
431
|
} else {
|
|
431
432
|
await dispatch(addObjectIntent);
|
|
432
433
|
}
|
|
@@ -439,7 +440,7 @@ var CreateObjectDialog = ({ schemas, target, typename, name, shouldNavigate: _sh
|
|
|
439
440
|
// TODO(wittjosiah): The tablist dialog pattern is copied from @dxos/plugin-manager.
|
|
440
441
|
// Consider factoring it out to the tabs package.
|
|
441
442
|
/* @__PURE__ */ React6.createElement(Dialog.Content, {
|
|
442
|
-
classNames: "p-0 bs-content
|
|
443
|
+
classNames: "p-0 bs-content max-bs-full md:max-is-[40rem] overflow-hidden"
|
|
443
444
|
}, /* @__PURE__ */ React6.createElement("div", {
|
|
444
445
|
role: "none",
|
|
445
446
|
className: "flex justify-between pbs-2 pis-2 pie-2 @md:pbs-4 @md:pis-4 @md:pie-4"
|
|
@@ -453,9 +454,8 @@ var CreateObjectDialog = ({ schemas, target, typename, name, shouldNavigate: _sh
|
|
|
453
454
|
}, /* @__PURE__ */ React6.createElement(Icon2, {
|
|
454
455
|
icon: "ph--x--regular",
|
|
455
456
|
size: 4
|
|
456
|
-
})))), /* @__PURE__ */ React6.createElement(
|
|
457
|
-
|
|
458
|
-
}, /* @__PURE__ */ React6.createElement(CreateObjectPanel, {
|
|
457
|
+
})))), /* @__PURE__ */ React6.createElement(CreateObjectPanel, {
|
|
458
|
+
classNames: "p-4",
|
|
459
459
|
schemas,
|
|
460
460
|
spaces,
|
|
461
461
|
target,
|
|
@@ -464,13 +464,14 @@ var CreateObjectDialog = ({ schemas, target, typename, name, shouldNavigate: _sh
|
|
|
464
464
|
defaultSpaceId: client.spaces.default.id,
|
|
465
465
|
resolve,
|
|
466
466
|
onCreateObject: handleCreateObject
|
|
467
|
-
}))
|
|
467
|
+
}))
|
|
468
468
|
);
|
|
469
469
|
};
|
|
470
470
|
|
|
471
471
|
// packages/plugins/plugin-space/src/components/CreateDialog/CreateSpaceDialog.tsx
|
|
472
|
+
import { Effect } from "effect";
|
|
472
473
|
import React7, { useCallback as useCallback6, useRef as useRef2 } from "react";
|
|
473
|
-
import { createIntent as createIntent3, useIntentDispatcher as useIntentDispatcher3 } from "@dxos/app-framework";
|
|
474
|
+
import { createIntent as createIntent3, LayoutAction as LayoutAction3, useIntentDispatcher as useIntentDispatcher3 } from "@dxos/app-framework";
|
|
474
475
|
import { Button as Button3, Dialog as Dialog2, Icon as Icon3, useTranslation as useTranslation7 } from "@dxos/react-ui";
|
|
475
476
|
import { Form as Form3 } from "@dxos/react-ui-form";
|
|
476
477
|
var CREATE_SPACE_DIALOG = `${SPACE_PLUGIN}/CreateSpaceDialog`;
|
|
@@ -480,15 +481,19 @@ var initialValues2 = {
|
|
|
480
481
|
var CreateSpaceDialog = () => {
|
|
481
482
|
const closeRef = useRef2(null);
|
|
482
483
|
const { t } = useTranslation7(SPACE_PLUGIN);
|
|
483
|
-
const {
|
|
484
|
+
const { dispatch } = useIntentDispatcher3();
|
|
484
485
|
const handleCreateSpace = useCallback6(async (data) => {
|
|
485
|
-
const
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
486
|
+
const program = Effect.gen(function* () {
|
|
487
|
+
const { space } = yield* dispatch(createIntent3(SpaceAction.Create, data));
|
|
488
|
+
yield* dispatch(createIntent3(LayoutAction3.SwitchWorkspace, {
|
|
489
|
+
part: "workspace",
|
|
490
|
+
subject: space.id
|
|
490
491
|
}));
|
|
491
|
-
|
|
492
|
+
yield* dispatch(createIntent3(SpaceAction.OpenCreateObject, {
|
|
493
|
+
target: space
|
|
494
|
+
}));
|
|
495
|
+
});
|
|
496
|
+
await Effect.runPromise(program);
|
|
492
497
|
}, [
|
|
493
498
|
dispatch
|
|
494
499
|
]);
|
|
@@ -496,7 +501,7 @@ var CreateSpaceDialog = () => {
|
|
|
496
501
|
// TODO(wittjosiah): The tablist dialog pattern is copied from @dxos/plugin-manager.
|
|
497
502
|
// Consider factoring it out to the tabs package.
|
|
498
503
|
/* @__PURE__ */ React7.createElement(Dialog2.Content, {
|
|
499
|
-
classNames: "p-0 bs-content min-bs-[
|
|
504
|
+
classNames: "p-0 bs-content min-bs-[16rem] max-bs-full md:max-is-[32rem] overflow-hidden"
|
|
500
505
|
}, /* @__PURE__ */ React7.createElement("div", {
|
|
501
506
|
role: "none",
|
|
502
507
|
className: "flex justify-between pbs-2 pis-2 pie-2 @md:pbs-4 @md:pis-4 @md:pie-4"
|
|
@@ -514,6 +519,8 @@ var CreateSpaceDialog = () => {
|
|
|
514
519
|
className: "p-4"
|
|
515
520
|
}, /* @__PURE__ */ React7.createElement(Form3, {
|
|
516
521
|
testId: "create-space-form",
|
|
522
|
+
classNames: "!p-0",
|
|
523
|
+
autoFocus: true,
|
|
517
524
|
values: initialValues2,
|
|
518
525
|
schema: SpaceForm,
|
|
519
526
|
onSave: handleCreateSpace
|
|
@@ -524,16 +531,16 @@ var CreateSpaceDialog = () => {
|
|
|
524
531
|
// packages/plugins/plugin-space/src/components/CollectionMain.tsx
|
|
525
532
|
import React8 from "react";
|
|
526
533
|
import { useTranslation as useTranslation8 } from "@dxos/react-ui";
|
|
527
|
-
import { baseSurface, descriptionText, mx as
|
|
534
|
+
import { baseSurface, descriptionText, mx as mx3 } from "@dxos/react-ui-theme";
|
|
528
535
|
var CollectionMain = ({ collection }) => {
|
|
529
536
|
const { t } = useTranslation8(SPACE_PLUGIN);
|
|
530
537
|
return /* @__PURE__ */ React8.createElement("div", {
|
|
531
538
|
role: "none",
|
|
532
|
-
className:
|
|
539
|
+
className: mx3(baseSurface, "min-bs-screen is-full flex items-center justify-center p-8"),
|
|
533
540
|
"data-testid": "composer.firstRunMessage"
|
|
534
541
|
}, /* @__PURE__ */ React8.createElement("p", {
|
|
535
542
|
role: "alert",
|
|
536
|
-
className:
|
|
543
|
+
className: mx3(descriptionText, "border border-dashed border-neutral-400/50 rounded-lg p-8 font-normal text-lg max-is-[24rem] break-words")
|
|
537
544
|
}, collection.name ?? t("unnamed collection label")));
|
|
538
545
|
};
|
|
539
546
|
|
|
@@ -551,37 +558,62 @@ var CollectionSection = ({ collection }) => {
|
|
|
551
558
|
|
|
552
559
|
// packages/plugins/plugin-space/src/components/JoinDialog.tsx
|
|
553
560
|
import React10, { useCallback as useCallback7 } from "react";
|
|
554
|
-
import { createIntent as createIntent4, LayoutAction
|
|
555
|
-
import {
|
|
561
|
+
import { createIntent as createIntent4, LayoutAction as LayoutAction4, useAppGraph, useIntentDispatcher as useIntentDispatcher4 } from "@dxos/app-framework";
|
|
562
|
+
import { log } from "@dxos/log";
|
|
556
563
|
import { ObservabilityAction } from "@dxos/plugin-observability/types";
|
|
557
|
-
import {
|
|
558
|
-
import { Dialog as Dialog3
|
|
564
|
+
import { useClient as useClient3 } from "@dxos/react-client";
|
|
565
|
+
import { Dialog as Dialog3 } from "@dxos/react-ui";
|
|
559
566
|
import { JoinPanel } from "@dxos/shell/react";
|
|
567
|
+
var __dxlog_file = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/JoinDialog.tsx";
|
|
560
568
|
var JOIN_DIALOG = `${SPACE_PLUGIN}/JoinDialog`;
|
|
561
569
|
var JoinDialog = ({ navigableCollections, onDone, ...props }) => {
|
|
562
|
-
const { t } = useTranslation10(SPACE_PLUGIN);
|
|
563
570
|
const { dispatchPromise: dispatch } = useIntentDispatcher4();
|
|
564
|
-
const
|
|
565
|
-
const { graph } =
|
|
571
|
+
const client = useClient3();
|
|
572
|
+
const { graph } = useAppGraph();
|
|
566
573
|
const handleDone = useCallback7(async (result) => {
|
|
567
574
|
if (result?.spaceKey) {
|
|
568
575
|
await Promise.all([
|
|
569
|
-
dispatch(createIntent4(
|
|
570
|
-
|
|
576
|
+
dispatch(createIntent4(LayoutAction4.AddToast, {
|
|
577
|
+
part: "toast",
|
|
571
578
|
subject: {
|
|
572
579
|
id: `${SPACE_PLUGIN}/join-success`,
|
|
573
580
|
duration: 5e3,
|
|
574
|
-
title:
|
|
575
|
-
|
|
581
|
+
title: [
|
|
582
|
+
"join success label",
|
|
583
|
+
{
|
|
584
|
+
ns: SPACE_PLUGIN
|
|
585
|
+
}
|
|
586
|
+
],
|
|
587
|
+
closeLabel: [
|
|
588
|
+
"dismiss label",
|
|
589
|
+
{
|
|
590
|
+
ns: SPACE_PLUGIN
|
|
591
|
+
}
|
|
592
|
+
]
|
|
576
593
|
}
|
|
577
594
|
})),
|
|
578
|
-
dispatch(createIntent4(
|
|
579
|
-
|
|
580
|
-
|
|
595
|
+
dispatch(createIntent4(LayoutAction4.UpdateDialog, {
|
|
596
|
+
part: "dialog",
|
|
597
|
+
options: {
|
|
598
|
+
state: false
|
|
599
|
+
}
|
|
581
600
|
}))
|
|
582
601
|
]);
|
|
583
602
|
}
|
|
584
|
-
const space = spaces.
|
|
603
|
+
const space = result?.spaceKey ? client.spaces.get(result.spaceKey) : void 0;
|
|
604
|
+
if (!space) {
|
|
605
|
+
log.warn("Space not found", result?.spaceKey, {
|
|
606
|
+
F: __dxlog_file,
|
|
607
|
+
L: 56,
|
|
608
|
+
S: void 0,
|
|
609
|
+
C: (f, a) => f(...a)
|
|
610
|
+
});
|
|
611
|
+
return;
|
|
612
|
+
}
|
|
613
|
+
await dispatch(createIntent4(LayoutAction4.SwitchWorkspace, {
|
|
614
|
+
part: "workspace",
|
|
615
|
+
subject: space.id
|
|
616
|
+
}));
|
|
585
617
|
const target = result?.target || (navigableCollections ? space?.id : void 0);
|
|
586
618
|
if (target) {
|
|
587
619
|
await graph.waitForPath({
|
|
@@ -589,15 +621,15 @@ var JoinDialog = ({ navigableCollections, onDone, ...props }) => {
|
|
|
589
621
|
}).catch(() => {
|
|
590
622
|
});
|
|
591
623
|
await Promise.all([
|
|
592
|
-
dispatch(createIntent4(
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
}
|
|
624
|
+
dispatch(createIntent4(LayoutAction4.Open, {
|
|
625
|
+
part: "main",
|
|
626
|
+
subject: [
|
|
627
|
+
target
|
|
628
|
+
]
|
|
598
629
|
})),
|
|
599
|
-
dispatch(createIntent4(
|
|
600
|
-
|
|
630
|
+
dispatch(createIntent4(LayoutAction4.Expose, {
|
|
631
|
+
part: "navigation",
|
|
632
|
+
subject: target
|
|
601
633
|
}))
|
|
602
634
|
]);
|
|
603
635
|
}
|
|
@@ -612,7 +644,8 @@ var JoinDialog = ({ navigableCollections, onDone, ...props }) => {
|
|
|
612
644
|
}
|
|
613
645
|
}, [
|
|
614
646
|
dispatch,
|
|
615
|
-
|
|
647
|
+
client,
|
|
648
|
+
graph
|
|
616
649
|
]);
|
|
617
650
|
return /* @__PURE__ */ React10.createElement(Dialog3.Content, null, /* @__PURE__ */ React10.createElement(JoinPanel, {
|
|
618
651
|
...props,
|
|
@@ -630,11 +663,11 @@ var JoinDialog = ({ navigableCollections, onDone, ...props }) => {
|
|
|
630
663
|
import { Planet } from "@phosphor-icons/react";
|
|
631
664
|
import React11 from "react";
|
|
632
665
|
import { getSpace as getSpace2 } from "@dxos/client/echo";
|
|
633
|
-
import { useClient as
|
|
634
|
-
import { DropdownMenu, toLocalizedString as toLocalizedString2, useTranslation as
|
|
666
|
+
import { useClient as useClient4 } from "@dxos/react-client";
|
|
667
|
+
import { DropdownMenu, toLocalizedString as toLocalizedString2, useTranslation as useTranslation10 } from "@dxos/react-ui";
|
|
635
668
|
var MenuFooter = ({ object }) => {
|
|
636
|
-
const { t } =
|
|
637
|
-
const client =
|
|
669
|
+
const { t } = useTranslation10(SPACE_PLUGIN);
|
|
670
|
+
const client = useClient4();
|
|
638
671
|
const space = getSpace2(object);
|
|
639
672
|
const spaceName = space ? getSpaceDisplayName(space, {
|
|
640
673
|
personal: client.spaces.default === space
|
|
@@ -654,8 +687,8 @@ var MenuFooter = ({ object }) => {
|
|
|
654
687
|
import { ArrowsCounterClockwise, CheckCircle as CheckCircle2, Warning } from "@phosphor-icons/react";
|
|
655
688
|
import React12, { useEffect as useEffect2, useState as useState4 } from "react";
|
|
656
689
|
import { debounce } from "@dxos/async";
|
|
657
|
-
import { Tooltip, useTranslation as
|
|
658
|
-
import { getSize as getSize2, mx as
|
|
690
|
+
import { Tooltip, useTranslation as useTranslation11 } from "@dxos/react-ui";
|
|
691
|
+
import { getSize as getSize2, mx as mx4, staticPlaceholderText, warningText } from "@dxos/react-ui-theme";
|
|
659
692
|
var Status;
|
|
660
693
|
(function(Status2) {
|
|
661
694
|
Status2[Status2["PERSISTED_LOCALLY"] = 0] = "PERSISTED_LOCALLY";
|
|
@@ -663,7 +696,7 @@ var Status;
|
|
|
663
696
|
Status2[Status2["ERROR"] = 2] = "ERROR";
|
|
664
697
|
})(Status || (Status = {}));
|
|
665
698
|
var PersistenceStatus = ({ db }) => {
|
|
666
|
-
const { t } =
|
|
699
|
+
const { t } = useTranslation11(SPACE_PLUGIN);
|
|
667
700
|
const [displayMessage, setDisplayMessage] = useState4(false);
|
|
668
701
|
const [status, naturalSetStatus] = useState4(0);
|
|
669
702
|
const [prevStatus, setPrevStatus] = useState4(0);
|
|
@@ -683,17 +716,17 @@ var PersistenceStatus = ({ db }) => {
|
|
|
683
716
|
return /* @__PURE__ */ React12.createElement("div", {
|
|
684
717
|
className: "flex items-center"
|
|
685
718
|
}, /* @__PURE__ */ React12.createElement(Warning, {
|
|
686
|
-
className:
|
|
719
|
+
className: mx4(getSize2(4), "me-1")
|
|
687
720
|
}), /* @__PURE__ */ React12.createElement("span", {
|
|
688
|
-
className:
|
|
721
|
+
className: mx4("text-sm", warningText)
|
|
689
722
|
}, t("persistence error label")));
|
|
690
723
|
case 1:
|
|
691
724
|
return /* @__PURE__ */ React12.createElement("div", {
|
|
692
725
|
className: "flex items-center"
|
|
693
726
|
}, /* @__PURE__ */ React12.createElement(ArrowsCounterClockwise, {
|
|
694
|
-
className:
|
|
727
|
+
className: mx4(getSize2(4), "me-1")
|
|
695
728
|
}), /* @__PURE__ */ React12.createElement("span", {
|
|
696
|
-
className:
|
|
729
|
+
className: mx4("text-sm", staticPlaceholderText)
|
|
697
730
|
}, t("persistence pending label")));
|
|
698
731
|
case 0:
|
|
699
732
|
default:
|
|
@@ -703,21 +736,21 @@ var PersistenceStatus = ({ db }) => {
|
|
|
703
736
|
role: "status",
|
|
704
737
|
className: "flex items-center"
|
|
705
738
|
}, /* @__PURE__ */ React12.createElement(CheckCircle2, {
|
|
706
|
-
className:
|
|
739
|
+
className: mx4(getSize2(4), "me-1")
|
|
707
740
|
}), displayMessage && /* @__PURE__ */ React12.createElement("span", {
|
|
708
|
-
className:
|
|
741
|
+
className: mx4("text-sm", staticPlaceholderText)
|
|
709
742
|
}, 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))));
|
|
710
743
|
}
|
|
711
744
|
};
|
|
712
745
|
|
|
713
746
|
// packages/plugins/plugin-space/src/components/PopoverRenameObject.tsx
|
|
714
747
|
import React13, { useCallback as useCallback8, useRef as useRef3, useState as useState5 } from "react";
|
|
715
|
-
import { log } from "@dxos/log";
|
|
716
|
-
import { Button as Button4, Input as
|
|
717
|
-
var
|
|
748
|
+
import { log as log2 } from "@dxos/log";
|
|
749
|
+
import { Button as Button4, Input as Input2, Popover, useTranslation as useTranslation12 } from "@dxos/react-ui";
|
|
750
|
+
var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/PopoverRenameObject.tsx";
|
|
718
751
|
var POPOVER_RENAME_OBJECT = `${SPACE_PLUGIN}/PopoverRenameObject`;
|
|
719
752
|
var PopoverRenameObject = ({ object: obj }) => {
|
|
720
|
-
const { t } =
|
|
753
|
+
const { t } = useTranslation12(SPACE_PLUGIN);
|
|
721
754
|
const doneButton = useRef3(null);
|
|
722
755
|
const object = obj;
|
|
723
756
|
const [name, setName] = useState5(object.name || object.title || "");
|
|
@@ -728,10 +761,10 @@ var PopoverRenameObject = ({ object: obj }) => {
|
|
|
728
761
|
try {
|
|
729
762
|
object.title = name;
|
|
730
763
|
} catch (err) {
|
|
731
|
-
|
|
764
|
+
log2.error("Failed to rename object", {
|
|
732
765
|
err
|
|
733
766
|
}, {
|
|
734
|
-
F:
|
|
767
|
+
F: __dxlog_file2,
|
|
735
768
|
L: 30,
|
|
736
769
|
S: void 0,
|
|
737
770
|
C: (f, a) => f(...a)
|
|
@@ -748,9 +781,9 @@ var PopoverRenameObject = ({ object: obj }) => {
|
|
|
748
781
|
}, /* @__PURE__ */ React13.createElement("div", {
|
|
749
782
|
role: "none",
|
|
750
783
|
className: "flex-1"
|
|
751
|
-
}, /* @__PURE__ */ React13.createElement(
|
|
784
|
+
}, /* @__PURE__ */ React13.createElement(Input2.Root, null, /* @__PURE__ */ React13.createElement(Input2.Label, {
|
|
752
785
|
srOnly: true
|
|
753
|
-
}, t("object name label")), /* @__PURE__ */ React13.createElement(
|
|
786
|
+
}, t("object name label")), /* @__PURE__ */ React13.createElement(Input2.TextInput, {
|
|
754
787
|
placeholder: t("object title placeholder"),
|
|
755
788
|
value: name,
|
|
756
789
|
"data-testid": "spacePlugin.renameObject.input",
|
|
@@ -769,10 +802,10 @@ var PopoverRenameObject = ({ object: obj }) => {
|
|
|
769
802
|
|
|
770
803
|
// packages/plugins/plugin-space/src/components/PopoverRenameSpace.tsx
|
|
771
804
|
import React14, { useCallback as useCallback9, useRef as useRef4, useState as useState6 } from "react";
|
|
772
|
-
import { Button as Button5, Input as
|
|
805
|
+
import { Button as Button5, Input as Input3, Popover as Popover2, useTranslation as useTranslation13 } from "@dxos/react-ui";
|
|
773
806
|
var POPOVER_RENAME_SPACE = `${SPACE_PLUGIN}/PopoverRenameSpace`;
|
|
774
807
|
var PopoverRenameSpace = ({ space }) => {
|
|
775
|
-
const { t } =
|
|
808
|
+
const { t } = useTranslation13(SPACE_PLUGIN);
|
|
776
809
|
const doneButton = useRef4(null);
|
|
777
810
|
const [name, setName] = useState6(space.properties.name ?? "");
|
|
778
811
|
const handleDone = useCallback9(() => {
|
|
@@ -787,9 +820,9 @@ var PopoverRenameSpace = ({ space }) => {
|
|
|
787
820
|
}, /* @__PURE__ */ React14.createElement("div", {
|
|
788
821
|
role: "none",
|
|
789
822
|
className: "flex-1"
|
|
790
|
-
}, /* @__PURE__ */ React14.createElement(
|
|
823
|
+
}, /* @__PURE__ */ React14.createElement(Input3.Root, null, /* @__PURE__ */ React14.createElement(Input3.Label, {
|
|
791
824
|
srOnly: true
|
|
792
|
-
}, t("space name label")), /* @__PURE__ */ React14.createElement(
|
|
825
|
+
}, t("space name label")), /* @__PURE__ */ React14.createElement(Input3.TextInput, {
|
|
793
826
|
defaultValue: space.properties.name ?? "",
|
|
794
827
|
placeholder: t("unnamed space label"),
|
|
795
828
|
onChange: ({ target: { value } }) => setName(value),
|
|
@@ -810,7 +843,7 @@ var PopoverRenameSpace = ({ space }) => {
|
|
|
810
843
|
// packages/plugins/plugin-space/src/components/ShareSpaceButton.tsx
|
|
811
844
|
import React15 from "react";
|
|
812
845
|
import { createIntent as createIntent5, useIntentDispatcher as useIntentDispatcher5 } from "@dxos/app-framework";
|
|
813
|
-
import { IconButton as
|
|
846
|
+
import { IconButton as IconButton3, useTranslation as useTranslation14 } from "@dxos/react-ui";
|
|
814
847
|
var ShareSpaceButton = ({ space }) => {
|
|
815
848
|
const { dispatchPromise: dispatch } = useIntentDispatcher5();
|
|
816
849
|
return /* @__PURE__ */ React15.createElement(ShareSpaceButtonImpl, {
|
|
@@ -820,8 +853,8 @@ var ShareSpaceButton = ({ space }) => {
|
|
|
820
853
|
});
|
|
821
854
|
};
|
|
822
855
|
var ShareSpaceButtonImpl = ({ onClick }) => {
|
|
823
|
-
const { t } =
|
|
824
|
-
return /* @__PURE__ */ React15.createElement(
|
|
856
|
+
const { t } = useTranslation14(SPACE_PLUGIN);
|
|
857
|
+
return /* @__PURE__ */ React15.createElement(IconButton3, {
|
|
825
858
|
"data-testid": "spacePlugin.shareSpaceButton",
|
|
826
859
|
icon: "ph--users--regular",
|
|
827
860
|
label: t("share space label"),
|
|
@@ -831,27 +864,26 @@ var ShareSpaceButtonImpl = ({ onClick }) => {
|
|
|
831
864
|
|
|
832
865
|
// packages/plugins/plugin-space/src/components/SpacePresence.tsx
|
|
833
866
|
import React16, { useCallback as useCallback10, useEffect as useEffect4, useState as useState8 } from "react";
|
|
834
|
-
import {
|
|
867
|
+
import { useAppGraph as useAppGraph2, useCapability } from "@dxos/app-framework";
|
|
835
868
|
import { generateName } from "@dxos/display-name";
|
|
836
|
-
import {
|
|
837
|
-
import { PublicKey, useClient as useClient4 } from "@dxos/react-client";
|
|
869
|
+
import { PublicKey, useClient as useClient5 } from "@dxos/react-client";
|
|
838
870
|
import { getSpace as getSpace3, useMembers, fullyQualifiedId as fullyQualifiedId2 } from "@dxos/react-client/echo";
|
|
839
871
|
import { useIdentity } from "@dxos/react-client/halo";
|
|
840
|
-
import { Avatar, AvatarGroup, AvatarGroupItem, Tooltip as Tooltip2, useTranslation as
|
|
872
|
+
import { Avatar, AvatarGroup, AvatarGroupItem, Tooltip as Tooltip2, useTranslation as useTranslation15, List as List2, ListItem as ListItem2, useDefaultValue } from "@dxos/react-ui";
|
|
841
873
|
import { AttentionGlyph, useAttended, useAttention } from "@dxos/react-ui-attention";
|
|
842
874
|
import { ComplexMap, keyToFallback } from "@dxos/util";
|
|
843
875
|
|
|
844
876
|
// packages/plugins/plugin-space/src/capabilities/index.ts
|
|
845
877
|
import { lazy } from "@dxos/app-framework";
|
|
846
|
-
var AppGraphBuilder = lazy(() => import("./app-graph-builder-
|
|
847
|
-
var AppGraphSerializer = lazy(() => import("./app-graph-serializer-
|
|
848
|
-
var IdentityCreated = lazy(() => import("./identity-created-
|
|
849
|
-
var IntentResolver = lazy(() => import("./intent-resolver-
|
|
850
|
-
var ReactRoot = lazy(() => import("./react-root-
|
|
851
|
-
var ReactSurface = lazy(() => import("./react-surface-
|
|
852
|
-
var SpaceSettings = lazy(() => import("./settings-
|
|
853
|
-
var SpaceState = lazy(() => import("./state-
|
|
854
|
-
var SpacesReady = lazy(() => import("./spaces-ready-
|
|
878
|
+
var AppGraphBuilder = lazy(() => import("./app-graph-builder-TTM2YZVS.mjs"));
|
|
879
|
+
var AppGraphSerializer = lazy(() => import("./app-graph-serializer-ZGM5NDXE.mjs"));
|
|
880
|
+
var IdentityCreated = lazy(() => import("./identity-created-VICTPQX7.mjs"));
|
|
881
|
+
var IntentResolver = lazy(() => import("./intent-resolver-A5274MUR.mjs"));
|
|
882
|
+
var ReactRoot = lazy(() => import("./react-root-N6QTWYCV.mjs"));
|
|
883
|
+
var ReactSurface = lazy(() => import("./react-surface-STMNA7W7.mjs"));
|
|
884
|
+
var SpaceSettings = lazy(() => import("./settings-HN5UIYQO.mjs"));
|
|
885
|
+
var SpaceState = lazy(() => import("./state-6DCY5YJP.mjs"));
|
|
886
|
+
var SpacesReady = lazy(() => import("./spaces-ready-F57ITJDR.mjs"));
|
|
855
887
|
|
|
856
888
|
// packages/plugins/plugin-space/src/hooks/usePath.ts
|
|
857
889
|
import { useEffect as useEffect3, useState as useState7 } from "react";
|
|
@@ -895,8 +927,8 @@ var ACTIVITY_DURATION = 3e4;
|
|
|
895
927
|
var noViewers = new ComplexMap(PublicKey.hash);
|
|
896
928
|
var getName = (identity) => identity.profile?.displayName ?? generateName(identity.identityKey.toHex());
|
|
897
929
|
var SpacePresence = ({ object, spaceKey }) => {
|
|
898
|
-
const spaceState =
|
|
899
|
-
const client =
|
|
930
|
+
const spaceState = useCapability(SpaceCapabilities.MutableState);
|
|
931
|
+
const client = useClient5();
|
|
900
932
|
const identity = useIdentity();
|
|
901
933
|
const space = spaceKey ? client.spaces.get(spaceKey) : getSpace3(object);
|
|
902
934
|
const spaceMembers = useMembers(space?.key);
|
|
@@ -995,7 +1027,7 @@ var PrensenceAvatar = ({ identity, showName, match, group, index, onClick }) =>
|
|
|
995
1027
|
var SmallPresenceLive = ({ id, open, viewers }) => {
|
|
996
1028
|
const { hasAttention, isAncestor, isRelated } = useAttention(id);
|
|
997
1029
|
const isAttended = hasAttention || isAncestor || isRelated;
|
|
998
|
-
const { graph } =
|
|
1030
|
+
const { graph } = useAppGraph2();
|
|
999
1031
|
const attended = useAttended();
|
|
1000
1032
|
const startOfAttention = attended.at(-1);
|
|
1001
1033
|
const path = usePath(graph, startOfAttention);
|
|
@@ -1023,7 +1055,7 @@ var SmallPresenceLive = ({ id, open, viewers }) => {
|
|
|
1023
1055
|
});
|
|
1024
1056
|
};
|
|
1025
1057
|
var SmallPresence = ({ count = 0, attended, containsAttended }) => {
|
|
1026
|
-
const { t } =
|
|
1058
|
+
const { t } = useTranslation15(SPACE_PLUGIN);
|
|
1027
1059
|
return /* @__PURE__ */ React16.createElement(Tooltip2.Root, null, /* @__PURE__ */ React16.createElement(Tooltip2.Trigger, {
|
|
1028
1060
|
asChild: true
|
|
1029
1061
|
}, /* @__PURE__ */ React16.createElement(AttentionGlyph, {
|
|
@@ -1040,13 +1072,13 @@ var SmallPresence = ({ count = 0, attended, containsAttended }) => {
|
|
|
1040
1072
|
|
|
1041
1073
|
// packages/plugins/plugin-space/src/components/SpacePluginSettings.tsx
|
|
1042
1074
|
import React17 from "react";
|
|
1043
|
-
import { Input as
|
|
1044
|
-
import { DeprecatedFormInput } from "@dxos/react-ui-form";
|
|
1075
|
+
import { Input as Input4, useTranslation as useTranslation16 } from "@dxos/react-ui";
|
|
1076
|
+
import { DeprecatedFormContainer, DeprecatedFormInput } from "@dxos/react-ui-form";
|
|
1045
1077
|
var SpacePluginSettings = ({ settings }) => {
|
|
1046
|
-
const { t } =
|
|
1047
|
-
return /* @__PURE__ */ React17.createElement(
|
|
1078
|
+
const { t } = useTranslation16(SPACE_PLUGIN);
|
|
1079
|
+
return /* @__PURE__ */ React17.createElement(DeprecatedFormContainer, null, /* @__PURE__ */ React17.createElement(DeprecatedFormInput, {
|
|
1048
1080
|
label: t("show hidden spaces label")
|
|
1049
|
-
}, /* @__PURE__ */ React17.createElement(
|
|
1081
|
+
}, /* @__PURE__ */ React17.createElement(Input4.Switch, {
|
|
1050
1082
|
checked: settings.showHidden,
|
|
1051
1083
|
onCheckedChange: (checked) => settings.showHidden = !!checked
|
|
1052
1084
|
})));
|
|
@@ -1054,24 +1086,23 @@ var SpacePluginSettings = ({ settings }) => {
|
|
|
1054
1086
|
|
|
1055
1087
|
// packages/plugins/plugin-space/src/components/SpaceSettings/SpaceSettingsPanel.tsx
|
|
1056
1088
|
import React18, { useCallback as useCallback11, useState as useState9 } from "react";
|
|
1057
|
-
import { log as
|
|
1089
|
+
import { log as log3 } from "@dxos/log";
|
|
1058
1090
|
import { EdgeReplicationSetting } from "@dxos/protocols/proto/dxos/echo/metadata";
|
|
1059
|
-
import { useClient as
|
|
1060
|
-
import { Input as
|
|
1061
|
-
import { DeprecatedFormInput as DeprecatedFormInput2 } from "@dxos/react-ui-form";
|
|
1062
|
-
|
|
1063
|
-
var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/SpaceSettings/SpaceSettingsPanel.tsx";
|
|
1091
|
+
import { useClient as useClient6 } from "@dxos/react-client";
|
|
1092
|
+
import { Input as Input5, useTranslation as useTranslation17 } from "@dxos/react-ui";
|
|
1093
|
+
import { DeprecatedFormContainer as DeprecatedFormContainer2, DeprecatedFormInput as DeprecatedFormInput2 } from "@dxos/react-ui-form";
|
|
1094
|
+
var __dxlog_file3 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/SpaceSettings/SpaceSettingsPanel.tsx";
|
|
1064
1095
|
var SpaceSettingsPanel = ({ classNames, space }) => {
|
|
1065
|
-
const { t } =
|
|
1066
|
-
const client =
|
|
1096
|
+
const { t } = useTranslation17(SPACE_PLUGIN);
|
|
1097
|
+
const client = useClient6();
|
|
1067
1098
|
const edgeEnabled = Boolean(client.config.values.runtime?.client?.edgeFeatures?.echoReplicator);
|
|
1068
1099
|
const [edgeReplication, setEdgeReplication] = useState9(space.internal.data.edgeReplication === EdgeReplicationSetting.ENABLED);
|
|
1069
1100
|
const toggleEdgeReplication = useCallback11(async (next) => {
|
|
1070
1101
|
setEdgeReplication(next);
|
|
1071
1102
|
await space?.internal.setEdgeReplicationPreference(next ? EdgeReplicationSetting.ENABLED : EdgeReplicationSetting.DISABLED).catch((err) => {
|
|
1072
|
-
|
|
1073
|
-
F:
|
|
1074
|
-
L:
|
|
1103
|
+
log3.catch(err, void 0, {
|
|
1104
|
+
F: __dxlog_file3,
|
|
1105
|
+
L: 35,
|
|
1075
1106
|
S: void 0,
|
|
1076
1107
|
C: (f, a) => f(...a)
|
|
1077
1108
|
});
|
|
@@ -1080,12 +1111,9 @@ var SpaceSettingsPanel = ({ classNames, space }) => {
|
|
|
1080
1111
|
}, [
|
|
1081
1112
|
space
|
|
1082
1113
|
]);
|
|
1083
|
-
return /* @__PURE__ */ React18.createElement(
|
|
1084
|
-
role: "form",
|
|
1085
|
-
className: mx4("flex flex-col", classNames)
|
|
1086
|
-
}, /* @__PURE__ */ React18.createElement(DeprecatedFormInput2, {
|
|
1114
|
+
return /* @__PURE__ */ React18.createElement(DeprecatedFormContainer2, null, /* @__PURE__ */ React18.createElement(DeprecatedFormInput2, {
|
|
1087
1115
|
label: t("name label")
|
|
1088
|
-
}, /* @__PURE__ */ React18.createElement(
|
|
1116
|
+
}, /* @__PURE__ */ React18.createElement(Input5.TextInput, {
|
|
1089
1117
|
placeholder: t("unnamed space label"),
|
|
1090
1118
|
value: space.properties.name ?? "",
|
|
1091
1119
|
onChange: (event) => {
|
|
@@ -1093,22 +1121,23 @@ var SpaceSettingsPanel = ({ classNames, space }) => {
|
|
|
1093
1121
|
}
|
|
1094
1122
|
})), edgeEnabled && /* @__PURE__ */ React18.createElement(DeprecatedFormInput2, {
|
|
1095
1123
|
label: t("edge replication label")
|
|
1096
|
-
}, /* @__PURE__ */ React18.createElement(
|
|
1124
|
+
}, /* @__PURE__ */ React18.createElement(Input5.Switch, {
|
|
1097
1125
|
checked: edgeReplication,
|
|
1098
1126
|
onCheckedChange: toggleEdgeReplication
|
|
1099
1127
|
})));
|
|
1100
1128
|
};
|
|
1101
1129
|
|
|
1102
1130
|
// packages/plugins/plugin-space/src/components/SpaceSettings/SpaceSettingsDialog.tsx
|
|
1103
|
-
import React19, { useState as useState10 } from "react";
|
|
1104
|
-
import {
|
|
1105
|
-
import {
|
|
1131
|
+
import React19, { useMemo as useMemo2, useState as useState10 } from "react";
|
|
1132
|
+
import { Surface as Surface2, useCapabilities } from "@dxos/app-framework";
|
|
1133
|
+
import { useClient as useClient7 } from "@dxos/react-client";
|
|
1134
|
+
import { Button as Button6, Clipboard, Dialog as Dialog4, Icon as Icon4, toLocalizedString as toLocalizedString3, useTranslation as useTranslation18 } from "@dxos/react-ui";
|
|
1106
1135
|
import { Tabs } from "@dxos/react-ui-tabs";
|
|
1107
1136
|
import { SpacePanel } from "@dxos/shell/react";
|
|
1108
1137
|
var SPACE_SETTINGS_DIALOG = `${SPACE_PLUGIN}/SpaceSettingsDialog`;
|
|
1109
1138
|
var SpaceSettingsDialog = ({ space, target, createInvitationUrl, initialTab = "members", namesCache }) => {
|
|
1110
|
-
const { t } =
|
|
1111
|
-
const client =
|
|
1139
|
+
const { t } = useTranslation18(SPACE_PLUGIN);
|
|
1140
|
+
const client = useClient7();
|
|
1112
1141
|
const [tabsActivePart, setTabsActivePart] = useState10("list");
|
|
1113
1142
|
const [selected, setSelected] = useState10(initialTab);
|
|
1114
1143
|
const locked = space.properties[COMPOSER_SPACE_LOCK];
|
|
@@ -1116,6 +1145,12 @@ var SpaceSettingsDialog = ({ space, target, createInvitationUrl, initialTab = "m
|
|
|
1116
1145
|
personal: client.spaces.default === space,
|
|
1117
1146
|
namesCache
|
|
1118
1147
|
});
|
|
1148
|
+
const panels = useCapabilities(SpaceCapabilities.SettingsPanel);
|
|
1149
|
+
const data = useMemo2(() => ({
|
|
1150
|
+
subject: space
|
|
1151
|
+
}), [
|
|
1152
|
+
space
|
|
1153
|
+
]);
|
|
1119
1154
|
return (
|
|
1120
1155
|
// TODO(wittjosiah): The tablist dialog pattern is copied from @dxos/plugin-manager.
|
|
1121
1156
|
// Consider factoring it out to the tabs package.
|
|
@@ -1168,7 +1203,10 @@ var SpaceSettingsDialog = ({ space, target, createInvitationUrl, initialTab = "m
|
|
|
1168
1203
|
}, t("settings tab label")), /* @__PURE__ */ React19.createElement(Tabs.Tab, {
|
|
1169
1204
|
value: "members",
|
|
1170
1205
|
disabled: locked
|
|
1171
|
-
}, t("members tab label"))
|
|
1206
|
+
}, t("members tab label")), panels.map((panel) => /* @__PURE__ */ React19.createElement(Tabs.Tab, {
|
|
1207
|
+
key: panel.id,
|
|
1208
|
+
value: panel.id
|
|
1209
|
+
}, toLocalizedString3(panel.label, t)))))), /* @__PURE__ */ React19.createElement(Tabs.Tabpanel, {
|
|
1172
1210
|
value: "settings",
|
|
1173
1211
|
classNames: "pli-3 @md:pli-5 max-bs-dvh overflow-y-auto"
|
|
1174
1212
|
}, /* @__PURE__ */ React19.createElement(SpaceSettingsPanel, {
|
|
@@ -1181,25 +1219,32 @@ var SpaceSettingsDialog = ({ space, target, createInvitationUrl, initialTab = "m
|
|
|
1181
1219
|
hideHeading: true,
|
|
1182
1220
|
target,
|
|
1183
1221
|
createInvitationUrl
|
|
1222
|
+
}))), panels.map((panel) => /* @__PURE__ */ React19.createElement(Tabs.Tabpanel, {
|
|
1223
|
+
key: panel.id,
|
|
1224
|
+
value: panel.id,
|
|
1225
|
+
classNames: "pli-3 @md:pli-5 max-bs-dvh overflow-y-auto"
|
|
1226
|
+
}, /* @__PURE__ */ React19.createElement(Surface2, {
|
|
1227
|
+
role: `space-settings--${panel.id}`,
|
|
1228
|
+
data
|
|
1184
1229
|
}))))))
|
|
1185
1230
|
);
|
|
1186
1231
|
};
|
|
1187
1232
|
|
|
1188
1233
|
// packages/plugins/plugin-space/src/components/SyncStatus/InlineSyncStatus.tsx
|
|
1189
1234
|
import React20, { useEffect as useEffect6, useState as useState12 } from "react";
|
|
1190
|
-
import {
|
|
1235
|
+
import { useAppGraph as useAppGraph3 } from "@dxos/app-framework";
|
|
1191
1236
|
import { QueryEdgeStatusResponse } from "@dxos/protocols/proto/dxos/client/services";
|
|
1192
1237
|
import { EdgeReplicationSetting as EdgeReplicationSetting2 } from "@dxos/protocols/proto/dxos/echo/metadata";
|
|
1193
|
-
import { useClient as
|
|
1194
|
-
import { Tooltip as Tooltip3, useTranslation as
|
|
1238
|
+
import { useClient as useClient9 } from "@dxos/react-client";
|
|
1239
|
+
import { Tooltip as Tooltip3, useTranslation as useTranslation19 } from "@dxos/react-ui";
|
|
1195
1240
|
import { AttentionGlyph as AttentionGlyph2, useAttended as useAttended2, useAttention as useAttention2 } from "@dxos/react-ui-attention";
|
|
1196
1241
|
|
|
1197
1242
|
// packages/plugins/plugin-space/src/components/SyncStatus/sync-state.ts
|
|
1198
1243
|
import { useEffect as useEffect5, useState as useState11 } from "react";
|
|
1199
1244
|
import { Context } from "@dxos/context";
|
|
1200
1245
|
import { EdgeService } from "@dxos/protocols";
|
|
1201
|
-
import { useClient as
|
|
1202
|
-
var
|
|
1246
|
+
import { useClient as useClient8 } from "@dxos/react-client";
|
|
1247
|
+
var __dxlog_file4 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/SyncStatus/sync-state.ts";
|
|
1203
1248
|
var createEmptyEdgeSyncState = () => ({
|
|
1204
1249
|
missingOnLocal: 0,
|
|
1205
1250
|
missingOnRemote: 0,
|
|
@@ -1219,11 +1264,11 @@ var getSyncSummary = (syncMap) => {
|
|
|
1219
1264
|
};
|
|
1220
1265
|
var isEdgePeerId = (peerId, spaceId) => peerId.startsWith(`${EdgeService.AUTOMERGE_REPLICATOR}:${spaceId}`);
|
|
1221
1266
|
var useSyncState = () => {
|
|
1222
|
-
const client =
|
|
1267
|
+
const client = useClient8();
|
|
1223
1268
|
const [spaceState, setSpaceState] = useState11({});
|
|
1224
1269
|
useEffect5(() => {
|
|
1225
1270
|
const ctx = new Context(void 0, {
|
|
1226
|
-
F:
|
|
1271
|
+
F: __dxlog_file4,
|
|
1227
1272
|
L: 48
|
|
1228
1273
|
});
|
|
1229
1274
|
const createSubscriptions = (spaces) => {
|
|
@@ -1258,7 +1303,7 @@ var useSpaceSyncState = (space) => {
|
|
|
1258
1303
|
const [spaceState, setSpaceState] = useState11();
|
|
1259
1304
|
useEffect5(() => {
|
|
1260
1305
|
const ctx = new Context(void 0, {
|
|
1261
|
-
F:
|
|
1306
|
+
F: __dxlog_file4,
|
|
1262
1307
|
L: 87
|
|
1263
1308
|
});
|
|
1264
1309
|
space.crud.subscribeToSyncState(ctx, ({ peers = [] }) => {
|
|
@@ -1279,7 +1324,7 @@ var useSpaceSyncState = (space) => {
|
|
|
1279
1324
|
// packages/plugins/plugin-space/src/components/SyncStatus/InlineSyncStatus.tsx
|
|
1280
1325
|
var useEdgeStatus = () => {
|
|
1281
1326
|
const [status, setStatus] = useState12(QueryEdgeStatusResponse.EdgeStatus.NOT_CONNECTED);
|
|
1282
|
-
const client =
|
|
1327
|
+
const client = useClient9();
|
|
1283
1328
|
useEffect6(() => {
|
|
1284
1329
|
client.services.services.EdgeAgentService?.queryEdgeStatus().subscribe(({ status: status2 }) => {
|
|
1285
1330
|
setStatus(status2);
|
|
@@ -1290,11 +1335,11 @@ var useEdgeStatus = () => {
|
|
|
1290
1335
|
return status;
|
|
1291
1336
|
};
|
|
1292
1337
|
var InlineSyncStatus = ({ space, open }) => {
|
|
1293
|
-
const { t } =
|
|
1338
|
+
const { t } = useTranslation19(SPACE_PLUGIN);
|
|
1294
1339
|
const id = space.id;
|
|
1295
1340
|
const { hasAttention, isAncestor, isRelated } = useAttention2(id);
|
|
1296
1341
|
const isAttended = hasAttention || isAncestor || isRelated;
|
|
1297
|
-
const { graph } =
|
|
1342
|
+
const { graph } = useAppGraph3();
|
|
1298
1343
|
const attended = useAttended2();
|
|
1299
1344
|
const startOfAttention = attended.at(-1);
|
|
1300
1345
|
const path = usePath(graph, startOfAttention);
|
|
@@ -1319,16 +1364,16 @@ var InlineSyncStatus = ({ space, open }) => {
|
|
|
1319
1364
|
// packages/plugins/plugin-space/src/components/SyncStatus/SyncStatus.tsx
|
|
1320
1365
|
import React22, { useCallback as useCallback12, useEffect as useEffect8, useState as useState14 } from "react";
|
|
1321
1366
|
import { StatusBar } from "@dxos/plugin-status-bar";
|
|
1322
|
-
import { useClient as
|
|
1323
|
-
import { Icon as Icon6, Input as
|
|
1367
|
+
import { useClient as useClient11 } from "@dxos/react-client";
|
|
1368
|
+
import { Icon as Icon6, Input as Input6, Popover as Popover3, useTranslation as useTranslation21 } from "@dxos/react-ui";
|
|
1324
1369
|
import { SyntaxHighlighter } from "@dxos/react-ui-syntax-highlighter";
|
|
1325
1370
|
import { mx as mx6 } from "@dxos/react-ui-theme";
|
|
1326
1371
|
|
|
1327
1372
|
// packages/plugins/plugin-space/src/components/SyncStatus/Space.tsx
|
|
1328
1373
|
import React21, { useEffect as useEffect7, useState as useState13 } from "react";
|
|
1329
|
-
import { useClient as
|
|
1374
|
+
import { useClient as useClient10 } from "@dxos/react-client";
|
|
1330
1375
|
import { useSpace } from "@dxos/react-client/echo";
|
|
1331
|
-
import { Icon as Icon5, toLocalizedString as toLocalizedString4, useTranslation as
|
|
1376
|
+
import { Icon as Icon5, toLocalizedString as toLocalizedString4, useTranslation as useTranslation20 } from "@dxos/react-ui";
|
|
1332
1377
|
import { mx as mx5 } from "@dxos/react-ui-theme";
|
|
1333
1378
|
var SYNC_STALLED_TIMEOUT = 5e3;
|
|
1334
1379
|
var styles = {
|
|
@@ -1360,8 +1405,8 @@ var useActive = (count) => {
|
|
|
1360
1405
|
return active;
|
|
1361
1406
|
};
|
|
1362
1407
|
var SpaceRowContainer = ({ spaceId, state }) => {
|
|
1363
|
-
const { t } =
|
|
1364
|
-
const client =
|
|
1408
|
+
const { t } = useTranslation20(SPACE_PLUGIN);
|
|
1409
|
+
const client = useClient10();
|
|
1365
1410
|
const space = useSpace(spaceId);
|
|
1366
1411
|
if (!space) {
|
|
1367
1412
|
return null;
|
|
@@ -1437,7 +1482,7 @@ var Bar = ({ classNames, count, total }) => {
|
|
|
1437
1482
|
|
|
1438
1483
|
// packages/plugins/plugin-space/src/components/SyncStatus/save-tracker.ts
|
|
1439
1484
|
import { Context as Context2 } from "@dxos/context";
|
|
1440
|
-
var
|
|
1485
|
+
var __dxlog_file5 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/SyncStatus/save-tracker.ts";
|
|
1441
1486
|
var createClientSaveTracker = (client, cb) => {
|
|
1442
1487
|
const unsubscribeCallbacks = {};
|
|
1443
1488
|
const state = {};
|
|
@@ -1465,7 +1510,7 @@ var createClientSaveTracker = (client, cb) => {
|
|
|
1465
1510
|
};
|
|
1466
1511
|
var createSpaceSaveTracker = (space, cb) => {
|
|
1467
1512
|
const ctx = new Context2(void 0, {
|
|
1468
|
-
F:
|
|
1513
|
+
F: __dxlog_file5,
|
|
1469
1514
|
L: 40
|
|
1470
1515
|
});
|
|
1471
1516
|
void space.waitUntilReady().then(() => {
|
|
@@ -1528,7 +1573,7 @@ var getIcon = (status) => {
|
|
|
1528
1573
|
|
|
1529
1574
|
// packages/plugins/plugin-space/src/components/SyncStatus/SyncStatus.tsx
|
|
1530
1575
|
var SyncStatus = () => {
|
|
1531
|
-
const client =
|
|
1576
|
+
const client = useClient11();
|
|
1532
1577
|
const state = useSyncState();
|
|
1533
1578
|
const [saved, setSaved] = useState14(true);
|
|
1534
1579
|
useEffect8(() => {
|
|
@@ -1542,7 +1587,7 @@ var SyncStatus = () => {
|
|
|
1542
1587
|
});
|
|
1543
1588
|
};
|
|
1544
1589
|
var SyncStatusIndicator = ({ state, saved }) => {
|
|
1545
|
-
const { t } =
|
|
1590
|
+
const { t } = useTranslation21(SPACE_PLUGIN);
|
|
1546
1591
|
const summary = getSyncSummary(state);
|
|
1547
1592
|
const offline = Object.values(state).length === 0;
|
|
1548
1593
|
const needsToUpload = summary.differentDocuments > 0 || summary.missingOnRemote > 0;
|
|
@@ -1583,18 +1628,16 @@ var SyncStatusIndicator = ({ state, saved }) => {
|
|
|
1583
1628
|
asChild: true
|
|
1584
1629
|
}, /* @__PURE__ */ React22.createElement(StatusBar.Button, {
|
|
1585
1630
|
title
|
|
1586
|
-
}, icon)), /* @__PURE__ */ React22.createElement(Popover3.Portal, null, /* @__PURE__ */ React22.createElement(Popover3.Content, {
|
|
1587
|
-
sideOffset: 16
|
|
1588
|
-
}, /* @__PURE__ */ React22.createElement(SyncStatusDetail, {
|
|
1631
|
+
}, icon)), /* @__PURE__ */ React22.createElement(Popover3.Portal, null, /* @__PURE__ */ React22.createElement(Popover3.Content, null, /* @__PURE__ */ React22.createElement(SyncStatusDetail, {
|
|
1589
1632
|
state,
|
|
1590
1633
|
summary,
|
|
1591
1634
|
debug: false
|
|
1592
|
-
}))));
|
|
1635
|
+
}), /* @__PURE__ */ React22.createElement(Popover3.Arrow, null))));
|
|
1593
1636
|
}
|
|
1594
1637
|
};
|
|
1595
1638
|
var SyncStatusDetail = ({ classNames, state, summary, debug }) => {
|
|
1596
1639
|
const [showAll, setShowAll] = useState14(false);
|
|
1597
|
-
const { t } =
|
|
1640
|
+
const { t } = useTranslation21(SPACE_PLUGIN);
|
|
1598
1641
|
const entries = Object.entries(state).filter(([_, value]) => showAll || value.missingOnLocal + value.missingOnRemote > 0).toSorted(([a], [b]) => a < b ? -1 : a > b ? 1 : 0);
|
|
1599
1642
|
const handleCheckedChange = useCallback12((state2) => setShowAll(state2), [
|
|
1600
1643
|
setShowAll
|
|
@@ -1608,9 +1651,9 @@ var SyncStatusDetail = ({ classNames, state, summary, debug }) => {
|
|
|
1608
1651
|
className: "flex-1"
|
|
1609
1652
|
}, t("sync status title")), /* @__PURE__ */ React22.createElement("div", {
|
|
1610
1653
|
className: "flex items-center gap-2"
|
|
1611
|
-
}, /* @__PURE__ */ React22.createElement(
|
|
1654
|
+
}, /* @__PURE__ */ React22.createElement(Input6.Root, null, /* @__PURE__ */ React22.createElement(Input6.Label, {
|
|
1612
1655
|
classNames: "text-xs"
|
|
1613
|
-
}, t("show all label")), /* @__PURE__ */ React22.createElement(
|
|
1656
|
+
}, t("show all label")), /* @__PURE__ */ React22.createElement(Input6.Checkbox, {
|
|
1614
1657
|
checked: showAll,
|
|
1615
1658
|
onCheckedChange: handleCheckedChange
|
|
1616
1659
|
})))), /* @__PURE__ */ React22.createElement("div", {
|
|
@@ -1669,4 +1712,4 @@ export {
|
|
|
1669
1712
|
SpaceState,
|
|
1670
1713
|
SpacesReady
|
|
1671
1714
|
};
|
|
1672
|
-
//# sourceMappingURL=chunk-
|
|
1715
|
+
//# sourceMappingURL=chunk-2NMUVDMZ.mjs.map
|