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