@dxos/plugin-space 0.7.5-main.9d26e3a → 0.7.5-main.b19bfc8
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-MGK5HWPZ.mjs +288 -0
- package/dist/lib/browser/app-graph-builder-MGK5HWPZ.mjs.map +7 -0
- package/dist/lib/browser/app-graph-serializer-FOWFLYGU.mjs +80 -0
- package/dist/lib/browser/app-graph-serializer-FOWFLYGU.mjs.map +7 -0
- package/dist/lib/browser/chunk-23RVI5FZ.mjs +539 -0
- package/dist/lib/browser/chunk-23RVI5FZ.mjs.map +7 -0
- package/dist/lib/browser/chunk-NU7WDVGN.mjs +23 -0
- package/dist/lib/browser/chunk-NU7WDVGN.mjs.map +7 -0
- package/dist/lib/browser/chunk-PQXZCNAU.mjs +13 -0
- package/dist/lib/browser/chunk-PQXZCNAU.mjs.map +7 -0
- package/dist/lib/browser/chunk-S6B7627U.mjs +1809 -0
- package/dist/lib/browser/chunk-S6B7627U.mjs.map +7 -0
- package/dist/lib/browser/chunk-UDWHTKB5.mjs +136 -0
- package/dist/lib/browser/chunk-UDWHTKB5.mjs.map +7 -0
- package/dist/lib/browser/{chunk-54VE4GTA.mjs → chunk-ULA2UQJ4.mjs} +25 -15
- package/dist/lib/browser/chunk-ULA2UQJ4.mjs.map +7 -0
- package/dist/lib/browser/identity-created-FYGS6TBH.mjs +28 -0
- package/dist/lib/browser/identity-created-FYGS6TBH.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +219 -3480
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/intent-resolver-QVR4MSJV.mjs +555 -0
- package/dist/lib/browser/intent-resolver-QVR4MSJV.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/react-root-IP2ZB245.mjs +28 -0
- package/dist/lib/browser/react-root-IP2ZB245.mjs.map +7 -0
- package/dist/lib/browser/react-surface-BT3EHB6V.mjs +225 -0
- package/dist/lib/browser/react-surface-BT3EHB6V.mjs.map +7 -0
- package/dist/lib/browser/schema-5W3DSY2E.mjs +24 -0
- package/dist/lib/browser/schema-5W3DSY2E.mjs.map +7 -0
- package/dist/lib/browser/settings-PHPCXX33.mjs +24 -0
- package/dist/lib/browser/settings-PHPCXX33.mjs.map +7 -0
- package/dist/lib/browser/spaces-ready-K47RR7N2.mjs +199 -0
- package/dist/lib/browser/spaces-ready-K47RR7N2.mjs.map +7 -0
- package/dist/lib/browser/state-INJ63O57.mjs +47 -0
- package/dist/lib/browser/state-INJ63O57.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +6 -4
- package/dist/lib/node/app-graph-builder-ZIUBXRPA.cjs +291 -0
- package/dist/lib/node/app-graph-builder-ZIUBXRPA.cjs.map +7 -0
- package/dist/lib/node/app-graph-serializer-VQOGHKXL.cjs +88 -0
- package/dist/lib/node/app-graph-serializer-VQOGHKXL.cjs.map +7 -0
- package/dist/lib/node/chunk-N2FS7PRA.cjs +1807 -0
- package/dist/lib/node/chunk-N2FS7PRA.cjs.map +7 -0
- package/dist/lib/node/chunk-OVGKWJOC.cjs +567 -0
- package/dist/lib/node/chunk-OVGKWJOC.cjs.map +7 -0
- package/dist/lib/node/chunk-U6DYXAR3.cjs +153 -0
- package/dist/lib/node/chunk-U6DYXAR3.cjs.map +7 -0
- package/dist/lib/node/{chunk-YF2AQ7KP.cjs → chunk-WAJKBO3J.cjs} +31 -20
- package/dist/lib/node/chunk-WAJKBO3J.cjs.map +7 -0
- package/dist/lib/node/{chunk-46S3JOES.cjs → chunk-WZR6OAN3.cjs} +9 -12
- package/dist/lib/node/chunk-WZR6OAN3.cjs.map +7 -0
- package/dist/lib/node/chunk-YZKNRFHU.cjs +43 -0
- package/dist/lib/node/chunk-YZKNRFHU.cjs.map +7 -0
- package/dist/lib/node/identity-created-AXI64BLE.cjs +44 -0
- package/dist/lib/node/identity-created-AXI64BLE.cjs.map +7 -0
- package/dist/lib/node/index.cjs +203 -3468
- package/dist/lib/node/index.cjs.map +4 -4
- package/dist/lib/node/intent-resolver-MLENGECT.cjs +553 -0
- package/dist/lib/node/intent-resolver-MLENGECT.cjs.map +7 -0
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/react-root-3OX5Z5CX.cjs +50 -0
- package/dist/lib/node/react-root-3OX5Z5CX.cjs.map +7 -0
- package/dist/lib/node/react-surface-5NYCMXSM.cjs +221 -0
- package/dist/lib/node/react-surface-5NYCMXSM.cjs.map +7 -0
- package/dist/lib/node/schema-YN7WVFRX.cjs +40 -0
- package/dist/lib/node/schema-YN7WVFRX.cjs.map +7 -0
- package/dist/lib/node/{meta.cjs → settings-5QYFWNH7.cjs} +19 -13
- package/dist/lib/node/settings-5QYFWNH7.cjs.map +7 -0
- package/dist/lib/node/spaces-ready-FQNAKR7G.cjs +210 -0
- package/dist/lib/node/spaces-ready-FQNAKR7G.cjs.map +7 -0
- package/dist/lib/node/state-57UE3DYE.cjs +61 -0
- package/dist/lib/node/state-57UE3DYE.cjs.map +7 -0
- package/dist/lib/node/types/index.cjs +19 -17
- package/dist/lib/node/types/index.cjs.map +2 -2
- package/dist/lib/node-esm/app-graph-builder-TERVM2SL.mjs +289 -0
- package/dist/lib/node-esm/app-graph-builder-TERVM2SL.mjs.map +7 -0
- package/dist/lib/node-esm/app-graph-serializer-GZRSWHEN.mjs +81 -0
- package/dist/lib/node-esm/app-graph-serializer-GZRSWHEN.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-2TQ2AJEZ.mjs +137 -0
- package/dist/lib/node-esm/chunk-2TQ2AJEZ.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-6RSVVEPS.mjs +24 -0
- package/dist/lib/node-esm/chunk-6RSVVEPS.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-DIKRH2IK.mjs +1810 -0
- package/dist/lib/node-esm/chunk-DIKRH2IK.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-2MNFEB23.mjs → chunk-ICCM4YRJ.mjs} +5 -7
- package/dist/lib/node-esm/chunk-ICCM4YRJ.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-PGH5L7MV.mjs +540 -0
- package/dist/lib/node-esm/chunk-PGH5L7MV.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-CDZETPO7.mjs → chunk-TRNZQEEN.mjs} +25 -15
- package/dist/lib/node-esm/chunk-TRNZQEEN.mjs.map +7 -0
- package/dist/lib/node-esm/identity-created-3CGEXNPO.mjs +29 -0
- package/dist/lib/node-esm/identity-created-3CGEXNPO.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +219 -3480
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/intent-resolver-BLW4RM6X.mjs +556 -0
- package/dist/lib/node-esm/intent-resolver-BLW4RM6X.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/react-root-7XXGP56B.mjs +29 -0
- package/dist/lib/node-esm/react-root-7XXGP56B.mjs.map +7 -0
- package/dist/lib/node-esm/react-surface-R2ECJSFB.mjs +226 -0
- package/dist/lib/node-esm/react-surface-R2ECJSFB.mjs.map +7 -0
- package/dist/lib/node-esm/schema-LOR2EVGY.mjs +25 -0
- package/dist/lib/node-esm/schema-LOR2EVGY.mjs.map +7 -0
- package/dist/lib/node-esm/settings-H6MXTEQM.mjs +25 -0
- package/dist/lib/node-esm/settings-H6MXTEQM.mjs.map +7 -0
- package/dist/lib/node-esm/spaces-ready-HKAQG5SA.mjs +200 -0
- package/dist/lib/node-esm/spaces-ready-HKAQG5SA.mjs.map +7 -0
- package/dist/lib/node-esm/state-VYA6OFHD.mjs +48 -0
- package/dist/lib/node-esm/state-VYA6OFHD.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +6 -4
- package/dist/types/src/SpacePlugin.d.ts +3 -22
- package/dist/types/src/SpacePlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts +181 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-serializer.d.ts +4 -0
- package/dist/types/src/capabilities/app-graph-serializer.d.ts.map +1 -0
- package/dist/types/src/capabilities/capabilities.d.ts +22 -0
- package/dist/types/src/capabilities/capabilities.d.ts.map +1 -0
- package/dist/types/src/capabilities/identity-created.d.ts +4 -0
- package/dist/types/src/capabilities/identity-created.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +197 -0
- package/dist/types/src/capabilities/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/intent-resolver.d.ts +9 -0
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-root.d.ts +7 -0
- package/dist/types/src/capabilities/react-root.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface.d.ts +7 -0
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
- package/dist/types/src/capabilities/schema.d.ts +4 -0
- package/dist/types/src/capabilities/schema.d.ts.map +1 -0
- package/dist/types/src/capabilities/settings.d.ts +4 -0
- package/dist/types/src/capabilities/settings.d.ts.map +1 -0
- package/dist/types/src/capabilities/spaces-ready.d.ts +4 -0
- package/dist/types/src/capabilities/spaces-ready.d.ts.map +1 -0
- package/dist/types/src/capabilities/state.d.ts +5 -0
- package/dist/types/src/capabilities/state.d.ts.map +1 -0
- package/dist/types/src/components/AdvancedObjectSettings/AdvancedObjectSettings.d.ts +6 -0
- package/dist/types/src/components/AdvancedObjectSettings/AdvancedObjectSettings.d.ts.map +1 -0
- package/dist/types/src/components/AdvancedObjectSettings/ForeignKeys.d.ts +7 -0
- package/dist/types/src/components/AdvancedObjectSettings/ForeignKeys.d.ts.map +1 -0
- package/dist/types/src/components/AdvancedObjectSettings/index.d.ts +2 -0
- package/dist/types/src/components/AdvancedObjectSettings/index.d.ts.map +1 -0
- package/dist/types/src/components/AwaitingObject.d.ts +1 -2
- package/dist/types/src/components/AwaitingObject.d.ts.map +1 -1
- package/dist/types/src/components/BaseObjectSettings.d.ts +6 -0
- package/dist/types/src/components/BaseObjectSettings.d.ts.map +1 -0
- package/dist/types/src/components/CollectionMain.d.ts +1 -2
- package/dist/types/src/components/CollectionMain.d.ts.map +1 -1
- package/dist/types/src/components/CollectionSection.d.ts +1 -2
- package/dist/types/src/components/CollectionSection.d.ts.map +1 -1
- package/dist/types/src/components/CreateDialog/CreateObjectDialog.d.ts +2 -5
- package/dist/types/src/components/CreateDialog/CreateObjectDialog.d.ts.map +1 -1
- package/dist/types/src/components/CreateDialog/CreateObjectDialog.stories.d.ts.map +1 -1
- package/dist/types/src/components/CreateDialog/CreateObjectPanel.d.ts +9 -11
- package/dist/types/src/components/CreateDialog/CreateObjectPanel.d.ts.map +1 -1
- package/dist/types/src/components/CreateDialog/CreateSpaceDialog.d.ts +1 -2
- package/dist/types/src/components/CreateDialog/CreateSpaceDialog.d.ts.map +1 -1
- package/dist/types/src/components/JoinDialog.d.ts +1 -2
- package/dist/types/src/components/JoinDialog.d.ts.map +1 -1
- package/dist/types/src/components/MenuFooter.d.ts +1 -2
- package/dist/types/src/components/MenuFooter.d.ts.map +1 -1
- package/dist/types/src/components/PersistenceStatus.d.ts +1 -2
- package/dist/types/src/components/PersistenceStatus.d.ts.map +1 -1
- package/dist/types/src/components/PopoverAddSpace.d.ts +3 -0
- package/dist/types/src/components/PopoverAddSpace.d.ts.map +1 -0
- package/dist/types/src/components/PopoverRenameObject.d.ts +1 -2
- package/dist/types/src/components/PopoverRenameObject.d.ts.map +1 -1
- package/dist/types/src/components/PopoverRenameSpace.d.ts +1 -2
- package/dist/types/src/components/PopoverRenameSpace.d.ts.map +1 -1
- package/dist/types/src/components/ShareSpaceButton.d.ts +2 -3
- package/dist/types/src/components/ShareSpaceButton.d.ts.map +1 -1
- package/dist/types/src/components/SpacePluginSettings.d.ts +1 -2
- package/dist/types/src/components/SpacePluginSettings.d.ts.map +1 -1
- package/dist/types/src/components/SpacePresence.d.ts +4 -5
- package/dist/types/src/components/SpacePresence.d.ts.map +1 -1
- package/dist/types/src/components/SpacePresence.stories.d.ts +2 -3
- package/dist/types/src/components/SpacePresence.stories.d.ts.map +1 -1
- package/dist/types/src/components/SpaceSettings/SpaceSettingsDialog.d.ts +1 -2
- package/dist/types/src/components/SpaceSettings/SpaceSettingsDialog.d.ts.map +1 -1
- package/dist/types/src/components/SpaceSettings/SpaceSettingsPanel.d.ts +3 -5
- package/dist/types/src/components/SpaceSettings/SpaceSettingsPanel.d.ts.map +1 -1
- package/dist/types/src/components/SpaceSettings/SpaceSettingsPanel.stories.d.ts.map +1 -1
- package/dist/types/src/components/SyncStatus/InlineSyncStatus.d.ts +1 -2
- package/dist/types/src/components/SyncStatus/InlineSyncStatus.d.ts.map +1 -1
- package/dist/types/src/components/SyncStatus/Space.d.ts +2 -3
- package/dist/types/src/components/SyncStatus/Space.d.ts.map +1 -1
- package/dist/types/src/components/SyncStatus/SyncStatus.d.ts +3 -4
- package/dist/types/src/components/SyncStatus/SyncStatus.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +3 -1
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/events.d.ts +9 -0
- package/dist/types/src/events.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +3 -5
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +2 -4
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +21 -0
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/collection.d.ts +2 -2
- package/dist/types/src/types/thread.d.ts +34 -34
- package/dist/types/src/types/types.d.ts +41 -37
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/src/util.d.ts +10 -8
- package/dist/types/src/util.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +41 -47
- package/src/SpacePlugin.tsx +141 -1410
- package/src/capabilities/app-graph-builder.ts +319 -0
- package/src/capabilities/app-graph-serializer.ts +73 -0
- package/src/capabilities/capabilities.ts +28 -0
- package/src/capabilities/identity-created.ts +26 -0
- package/src/capabilities/index.ts +18 -0
- package/src/capabilities/intent-resolver.ts +536 -0
- package/src/capabilities/react-root.tsx +20 -0
- package/src/capabilities/react-surface.tsx +210 -0
- package/src/capabilities/schema.ts +27 -0
- package/src/capabilities/settings.ts +17 -0
- package/src/capabilities/spaces-ready.ts +230 -0
- package/src/capabilities/state.ts +45 -0
- package/src/components/AdvancedObjectSettings/AdvancedObjectSettings.tsx +72 -0
- package/src/components/AdvancedObjectSettings/ForeignKeys.tsx +51 -0
- package/src/components/AdvancedObjectSettings/index.ts +5 -0
- package/src/components/AwaitingObject.tsx +5 -11
- package/src/components/{DefaultObjectSettings.tsx → BaseObjectSettings.tsx} +9 -2
- package/src/components/CreateDialog/CreateObjectDialog.stories.tsx +1 -3
- package/src/components/CreateDialog/CreateObjectDialog.tsx +43 -35
- package/src/components/CreateDialog/CreateObjectPanel.tsx +139 -105
- package/src/components/CreateDialog/CreateSpaceDialog.tsx +18 -9
- package/src/components/JoinDialog.tsx +27 -19
- package/src/components/PopoverAddSpace.tsx +46 -0
- package/src/components/SpacePluginSettings.tsx +5 -10
- package/src/components/SpacePresence.stories.tsx +2 -2
- package/src/components/SpacePresence.tsx +7 -7
- package/src/components/SpaceSettings/SpaceSettingsDialog.tsx +16 -1
- package/src/components/SpaceSettings/SpaceSettingsPanel.stories.tsx +5 -1
- package/src/components/SpaceSettings/SpaceSettingsPanel.tsx +30 -8
- package/src/components/SyncStatus/InlineSyncStatus.tsx +2 -2
- package/src/components/SyncStatus/SyncStatus.tsx +2 -1
- package/src/components/index.ts +3 -1
- package/src/events.ts +18 -0
- package/src/index.ts +3 -7
- package/src/meta.ts +2 -3
- package/src/translations.ts +7 -0
- package/src/types/types.ts +32 -51
- package/src/util.tsx +45 -29
- package/dist/lib/browser/chunk-54VE4GTA.mjs.map +0 -7
- package/dist/lib/browser/chunk-73BCBSLP.mjs +0 -15
- package/dist/lib/browser/chunk-73BCBSLP.mjs.map +0 -7
- package/dist/lib/browser/meta.mjs +0 -11
- package/dist/lib/browser/meta.mjs.map +0 -7
- package/dist/lib/node/chunk-46S3JOES.cjs.map +0 -7
- package/dist/lib/node/chunk-YF2AQ7KP.cjs.map +0 -7
- package/dist/lib/node/meta.cjs.map +0 -7
- package/dist/lib/node-esm/chunk-2MNFEB23.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-CDZETPO7.mjs.map +0 -7
- package/dist/lib/node-esm/meta.mjs +0 -12
- package/dist/lib/node-esm/meta.mjs.map +0 -7
- package/dist/types/src/components/DefaultObjectSettings.d.ts +0 -7
- package/dist/types/src/components/DefaultObjectSettings.d.ts.map +0 -1
|
@@ -4,12 +4,12 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { useCallback } from 'react';
|
|
6
6
|
|
|
7
|
-
import { createIntent, LayoutAction,
|
|
8
|
-
import {
|
|
7
|
+
import { createIntent, LayoutAction, useAppGraph, useIntentDispatcher } from '@dxos/app-framework';
|
|
8
|
+
import { log } from '@dxos/log';
|
|
9
9
|
import { ObservabilityAction } from '@dxos/plugin-observability/types';
|
|
10
|
-
import {
|
|
10
|
+
import { useClient } from '@dxos/react-client';
|
|
11
11
|
import { type InvitationResult } from '@dxos/react-client/invitations';
|
|
12
|
-
import { Dialog
|
|
12
|
+
import { Dialog } from '@dxos/react-ui';
|
|
13
13
|
import { JoinPanel, type JoinPanelProps } from '@dxos/shell/react';
|
|
14
14
|
|
|
15
15
|
import { SPACE_PLUGIN } from '../meta';
|
|
@@ -21,47 +21,55 @@ export type JoinDialogProps = JoinPanelProps & {
|
|
|
21
21
|
};
|
|
22
22
|
|
|
23
23
|
export const JoinDialog = ({ navigableCollections, onDone, ...props }: JoinDialogProps) => {
|
|
24
|
-
const { t } = useTranslation(SPACE_PLUGIN);
|
|
25
24
|
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
26
|
-
const
|
|
27
|
-
const { graph } =
|
|
25
|
+
const client = useClient();
|
|
26
|
+
const { graph } = useAppGraph();
|
|
28
27
|
|
|
29
28
|
const handleDone = useCallback(
|
|
30
29
|
async (result: InvitationResult | null) => {
|
|
31
30
|
if (result?.spaceKey) {
|
|
32
31
|
await Promise.all([
|
|
33
32
|
dispatch(
|
|
34
|
-
createIntent(LayoutAction.
|
|
35
|
-
|
|
33
|
+
createIntent(LayoutAction.AddToast, {
|
|
34
|
+
part: 'toast',
|
|
36
35
|
subject: {
|
|
37
36
|
id: `${SPACE_PLUGIN}/join-success`,
|
|
38
37
|
duration: 5_000,
|
|
39
|
-
title:
|
|
40
|
-
closeLabel:
|
|
38
|
+
title: ['join success label', { ns: SPACE_PLUGIN }],
|
|
39
|
+
closeLabel: ['dismiss label', { ns: SPACE_PLUGIN }],
|
|
41
40
|
},
|
|
42
41
|
}),
|
|
43
42
|
),
|
|
44
43
|
dispatch(
|
|
45
|
-
createIntent(LayoutAction.
|
|
46
|
-
|
|
47
|
-
|
|
44
|
+
createIntent(LayoutAction.UpdateDialog, {
|
|
45
|
+
part: 'dialog',
|
|
46
|
+
options: {
|
|
47
|
+
state: false,
|
|
48
|
+
},
|
|
48
49
|
}),
|
|
49
50
|
),
|
|
50
51
|
]);
|
|
51
52
|
}
|
|
52
53
|
|
|
53
|
-
const space = spaces.
|
|
54
|
+
const space = result?.spaceKey ? client.spaces.get(result.spaceKey) : undefined;
|
|
55
|
+
if (!space) {
|
|
56
|
+
log.warn('Space not found', result?.spaceKey);
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
await dispatch(createIntent(LayoutAction.SwitchWorkspace, { part: 'workspace', subject: space.id }));
|
|
61
|
+
|
|
54
62
|
// TODO(wittjosiah): If navigableCollections is false and there's no target,
|
|
55
63
|
// should try to navigate to the first object of the space replicates.
|
|
56
64
|
// Potentially this could also be done on the inviters side to ensure there's always a target.
|
|
57
65
|
const target = result?.target || (navigableCollections ? space?.id : undefined);
|
|
58
66
|
if (target) {
|
|
59
|
-
// Wait
|
|
67
|
+
// Wait before navigating to the target node.
|
|
60
68
|
// If the target has not yet replicated, this will trigger a loading toast.
|
|
61
69
|
await graph.waitForPath({ target }).catch(() => {});
|
|
62
70
|
await Promise.all([
|
|
63
|
-
dispatch(createIntent(
|
|
64
|
-
dispatch(createIntent(
|
|
71
|
+
dispatch(createIntent(LayoutAction.Open, { part: 'main', subject: [target] })),
|
|
72
|
+
dispatch(createIntent(LayoutAction.Expose, { part: 'navigation', subject: target })),
|
|
65
73
|
]);
|
|
66
74
|
}
|
|
67
75
|
|
|
@@ -73,7 +81,7 @@ export const JoinDialog = ({ navigableCollections, onDone, ...props }: JoinDialo
|
|
|
73
81
|
);
|
|
74
82
|
}
|
|
75
83
|
},
|
|
76
|
-
[dispatch,
|
|
84
|
+
[dispatch, client, graph],
|
|
77
85
|
);
|
|
78
86
|
|
|
79
87
|
return (
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React from 'react';
|
|
6
|
+
|
|
7
|
+
import { createIntent, LayoutAction, useIntentDispatcher } from '@dxos/app-framework';
|
|
8
|
+
import { IconButton, useTranslation } from '@dxos/react-ui';
|
|
9
|
+
|
|
10
|
+
import { SPACE_PLUGIN } from '../meta';
|
|
11
|
+
import { SpaceAction } from '../types';
|
|
12
|
+
|
|
13
|
+
export const POPOVER_ADD_SPACE = `${SPACE_PLUGIN}/PopoverRenameSpace`;
|
|
14
|
+
|
|
15
|
+
export const PopoverAddSpace = () => {
|
|
16
|
+
const { t } = useTranslation(SPACE_PLUGIN);
|
|
17
|
+
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
18
|
+
return (
|
|
19
|
+
<div role='none' className='grid grid-cols-1 gap-1 [&>button]:justify-start'>
|
|
20
|
+
<IconButton
|
|
21
|
+
variant='ghost'
|
|
22
|
+
label={t('create space label')}
|
|
23
|
+
icon='ph--plus--regular'
|
|
24
|
+
onClick={() => {
|
|
25
|
+
void dispatch(createIntent(SpaceAction.OpenCreateSpace));
|
|
26
|
+
void dispatch(
|
|
27
|
+
createIntent(LayoutAction.UpdatePopover, { part: 'popover', options: { anchorId: '', state: false } }),
|
|
28
|
+
);
|
|
29
|
+
}}
|
|
30
|
+
data-testid='spacePlugin.createSpace'
|
|
31
|
+
/>
|
|
32
|
+
<IconButton
|
|
33
|
+
variant='ghost'
|
|
34
|
+
label={t('join space label')}
|
|
35
|
+
icon='ph--sign-in--regular'
|
|
36
|
+
onClick={() => {
|
|
37
|
+
void dispatch(createIntent(SpaceAction.Join));
|
|
38
|
+
void dispatch(
|
|
39
|
+
createIntent(LayoutAction.UpdatePopover, { part: 'popover', options: { anchorId: '', state: false } }),
|
|
40
|
+
);
|
|
41
|
+
}}
|
|
42
|
+
data-testid='spacePlugin.joinSpace'
|
|
43
|
+
/>
|
|
44
|
+
</div>
|
|
45
|
+
);
|
|
46
|
+
};
|
|
@@ -4,25 +4,20 @@
|
|
|
4
4
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
|
-
import { createIntent, useIntentDispatcher } from '@dxos/app-framework';
|
|
8
7
|
import { Input, useTranslation } from '@dxos/react-ui';
|
|
9
|
-
import { DeprecatedFormInput } from '@dxos/react-ui-form';
|
|
8
|
+
import { DeprecatedFormContainer, DeprecatedFormInput } from '@dxos/react-ui-form';
|
|
10
9
|
|
|
11
10
|
import { SPACE_PLUGIN } from '../meta';
|
|
12
|
-
import {
|
|
11
|
+
import { type SpaceSettingsProps } from '../types';
|
|
13
12
|
|
|
14
13
|
export const SpacePluginSettings = ({ settings }: { settings: SpaceSettingsProps }) => {
|
|
15
14
|
const { t } = useTranslation(SPACE_PLUGIN);
|
|
16
|
-
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
17
15
|
|
|
18
16
|
return (
|
|
19
|
-
|
|
17
|
+
<DeprecatedFormContainer>
|
|
20
18
|
<DeprecatedFormInput label={t('show hidden spaces label')}>
|
|
21
|
-
<Input.Switch
|
|
22
|
-
checked={settings.showHidden}
|
|
23
|
-
onCheckedChange={(checked) => dispatch(createIntent(SpaceAction.ToggleHidden, { state: !!checked }))}
|
|
24
|
-
/>
|
|
19
|
+
<Input.Switch checked={settings.showHidden} onCheckedChange={(checked) => (settings.showHidden = !!checked)} />
|
|
25
20
|
</DeprecatedFormInput>
|
|
26
|
-
|
|
21
|
+
</DeprecatedFormContainer>
|
|
27
22
|
);
|
|
28
23
|
};
|
|
@@ -7,7 +7,7 @@ import '@dxos-theme';
|
|
|
7
7
|
import { type Meta } from '@storybook/react';
|
|
8
8
|
import React from 'react';
|
|
9
9
|
|
|
10
|
-
import { PublicKey } from '@dxos/keys';
|
|
10
|
+
import { IdentityDid, PublicKey } from '@dxos/keys';
|
|
11
11
|
import { HaloSpaceMember, SpaceMember } from '@dxos/react-client/echo';
|
|
12
12
|
import { withLayout, withTheme } from '@dxos/storybook-utils';
|
|
13
13
|
|
|
@@ -17,7 +17,7 @@ import translations from '../translations';
|
|
|
17
17
|
const nViewers = (n: number, currentlyAttended = true): Member[] =>
|
|
18
18
|
Array.from({ length: n }, () => ({
|
|
19
19
|
role: HaloSpaceMember.Role.ADMIN,
|
|
20
|
-
identity: { identityKey: PublicKey.random() },
|
|
20
|
+
identity: { did: IdentityDid.random(), identityKey: PublicKey.random() },
|
|
21
21
|
presence: SpaceMember.PresenceState.ONLINE,
|
|
22
22
|
lastSeen: Date.now(),
|
|
23
23
|
currentlyAttended,
|
|
@@ -4,10 +4,9 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { useCallback, useEffect, useState } from 'react';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { useAppGraph, useCapability } from '@dxos/app-framework';
|
|
8
8
|
import { generateName } from '@dxos/display-name';
|
|
9
9
|
import { type Expando } from '@dxos/echo-schema';
|
|
10
|
-
import { useGraph } from '@dxos/plugin-graph';
|
|
11
10
|
import { PublicKey, useClient } from '@dxos/react-client';
|
|
12
11
|
import { getSpace, useMembers, type SpaceMember, fullyQualifiedId } from '@dxos/react-client/echo';
|
|
13
12
|
import { type Identity, useIdentity } from '@dxos/react-client/halo';
|
|
@@ -26,9 +25,10 @@ import {
|
|
|
26
25
|
import { AttentionGlyph, useAttended, useAttention, type AttentionGlyphProps } from '@dxos/react-ui-attention';
|
|
27
26
|
import { ComplexMap, keyToFallback } from '@dxos/util';
|
|
28
27
|
|
|
28
|
+
import { SpaceCapabilities } from '../capabilities';
|
|
29
29
|
import { usePath } from '../hooks';
|
|
30
30
|
import { SPACE_PLUGIN } from '../meta';
|
|
31
|
-
import type { ObjectViewerProps
|
|
31
|
+
import type { ObjectViewerProps } from '../types';
|
|
32
32
|
|
|
33
33
|
// TODO(thure): Get/derive these values from protocol
|
|
34
34
|
const REFRESH_INTERVAL = 5000;
|
|
@@ -41,7 +41,8 @@ const noViewers = new ComplexMap<PublicKey, ObjectViewerProps>(PublicKey.hash);
|
|
|
41
41
|
const getName = (identity: Identity) => identity.profile?.displayName ?? generateName(identity.identityKey.toHex());
|
|
42
42
|
|
|
43
43
|
export const SpacePresence = ({ object, spaceKey }: { object: Expando; spaceKey?: PublicKey }) => {
|
|
44
|
-
|
|
44
|
+
// TODO(wittjosiah): Doesn't need to be mutable but readonly type messes with ComplexMap.
|
|
45
|
+
const spaceState = useCapability(SpaceCapabilities.MutableState);
|
|
45
46
|
const client = useClient();
|
|
46
47
|
const identity = useIdentity();
|
|
47
48
|
const space = spaceKey ? client.spaces.get(spaceKey) : getSpace(object);
|
|
@@ -63,11 +64,10 @@ export const SpacePresence = ({ object, spaceKey }: { object: Expando; spaceKey?
|
|
|
63
64
|
|
|
64
65
|
// TODO(thure): Could it be a smell to return early when there are interactions with `deepSignal` later, since it
|
|
65
66
|
// prevents reactivity?
|
|
66
|
-
if (!identity || !
|
|
67
|
+
if (!identity || !spaceState || !space) {
|
|
67
68
|
return null;
|
|
68
69
|
}
|
|
69
70
|
|
|
70
|
-
const spaceState = spacePlugin.provides.space;
|
|
71
71
|
const currentObjectViewers = spaceState.viewersByObject[fullyQualifiedId(object)] ?? noViewers;
|
|
72
72
|
|
|
73
73
|
const membersForObject = spaceMembers
|
|
@@ -209,7 +209,7 @@ export const SmallPresenceLive = ({ id, open, viewers }: SmallPresenceLiveProps)
|
|
|
209
209
|
// TODO(wittjosiah): If the attended node is deep in the graph and the graph is not fully loaded
|
|
210
210
|
// this will result in an empty path until the graph is connected.
|
|
211
211
|
// TODO(wittjosiah): Consider using this indicator for all open nodes instead of just attended.
|
|
212
|
-
const { graph } =
|
|
212
|
+
const { graph } = useAppGraph();
|
|
213
213
|
const attended = useAttended();
|
|
214
214
|
const startOfAttention = attended.at(-1);
|
|
215
215
|
const path = usePath(graph, startOfAttention);
|
|
@@ -2,14 +2,16 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import React, { useState } from 'react';
|
|
5
|
+
import React, { useMemo, useState } from 'react';
|
|
6
6
|
|
|
7
|
+
import { Surface, useCapabilities } from '@dxos/app-framework';
|
|
7
8
|
import { useClient } from '@dxos/react-client';
|
|
8
9
|
import { Button, Clipboard, Dialog, Icon, toLocalizedString, useTranslation } from '@dxos/react-ui';
|
|
9
10
|
import { Tabs, type TabsRootProps, type TabsActivePart } from '@dxos/react-ui-tabs';
|
|
10
11
|
import { SpacePanel, type SpacePanelProps } from '@dxos/shell/react';
|
|
11
12
|
|
|
12
13
|
import { SpaceSettingsPanel, type SpaceSettingsPanelProps } from './SpaceSettingsPanel';
|
|
14
|
+
import { SpaceCapabilities } from '../../capabilities';
|
|
13
15
|
import { SPACE_PLUGIN } from '../../meta';
|
|
14
16
|
import { COMPOSER_SPACE_LOCK, getSpaceDisplayName } from '../../util';
|
|
15
17
|
|
|
@@ -36,6 +38,8 @@ export const SpaceSettingsDialog = ({
|
|
|
36
38
|
const [selected, setSelected] = useState<SpaceSettingsTab>(initialTab);
|
|
37
39
|
const locked = space.properties[COMPOSER_SPACE_LOCK];
|
|
38
40
|
const name = getSpaceDisplayName(space, { personal: client.spaces.default === space, namesCache });
|
|
41
|
+
const panels = useCapabilities(SpaceCapabilities.SettingsPanel);
|
|
42
|
+
const data = useMemo(() => ({ subject: space }), [space]);
|
|
39
43
|
|
|
40
44
|
return (
|
|
41
45
|
// TODO(wittjosiah): The tablist dialog pattern is copied from @dxos/plugin-manager.
|
|
@@ -84,6 +88,11 @@ export const SpaceSettingsDialog = ({
|
|
|
84
88
|
<Tabs.Tab value='members' disabled={locked}>
|
|
85
89
|
{t('members tab label')}
|
|
86
90
|
</Tabs.Tab>
|
|
91
|
+
{panels.map((panel) => (
|
|
92
|
+
<Tabs.Tab key={panel.id} value={panel.id}>
|
|
93
|
+
{toLocalizedString(panel.label, t)}
|
|
94
|
+
</Tabs.Tab>
|
|
95
|
+
))}
|
|
87
96
|
</div>
|
|
88
97
|
</Tabs.Tablist>
|
|
89
98
|
</div>
|
|
@@ -98,6 +107,12 @@ export const SpaceSettingsDialog = ({
|
|
|
98
107
|
<SpacePanel space={space} hideHeading target={target} createInvitationUrl={createInvitationUrl} />
|
|
99
108
|
</Clipboard.Provider>
|
|
100
109
|
</Tabs.Tabpanel>
|
|
110
|
+
|
|
111
|
+
{panels.map((panel) => (
|
|
112
|
+
<Tabs.Tabpanel key={panel.id} value={panel.id} classNames='pli-3 @md:pli-5 max-bs-dvh overflow-y-auto'>
|
|
113
|
+
<Surface role={`space-settings--${panel.id}`} data={data} />
|
|
114
|
+
</Tabs.Tabpanel>
|
|
115
|
+
))}
|
|
101
116
|
</Tabs.Viewport>
|
|
102
117
|
</Tabs.Root>
|
|
103
118
|
</Dialog.Content>
|
|
@@ -15,7 +15,11 @@ import translations from '../../translations';
|
|
|
15
15
|
|
|
16
16
|
const Story = (args: Partial<SpaceSettingsPanelProps>) => {
|
|
17
17
|
const { space } = useClientProvider();
|
|
18
|
-
return
|
|
18
|
+
return (
|
|
19
|
+
<div role='none' className='p-2 border border-primary-500 rounded'>
|
|
20
|
+
<SpaceSettingsPanel {...args} space={space!} />
|
|
21
|
+
</div>
|
|
22
|
+
);
|
|
19
23
|
};
|
|
20
24
|
|
|
21
25
|
const meta: Meta = {
|
|
@@ -8,17 +8,17 @@ import { log } from '@dxos/log';
|
|
|
8
8
|
import { EdgeReplicationSetting } from '@dxos/protocols/proto/dxos/echo/metadata';
|
|
9
9
|
import { useClient } from '@dxos/react-client';
|
|
10
10
|
import { type Space } from '@dxos/react-client/echo';
|
|
11
|
-
import {
|
|
12
|
-
import { DeprecatedFormInput } from '@dxos/react-ui-form';
|
|
13
|
-
import {
|
|
11
|
+
import { Input, Toolbar, useTranslation } from '@dxos/react-ui';
|
|
12
|
+
import { DeprecatedFormContainer, DeprecatedFormInput } from '@dxos/react-ui-form';
|
|
13
|
+
import { HuePicker, IconPicker } from '@dxos/react-ui-pickers';
|
|
14
14
|
|
|
15
15
|
import { SPACE_PLUGIN } from '../../meta';
|
|
16
16
|
|
|
17
|
-
export type SpaceSettingsPanelProps =
|
|
17
|
+
export type SpaceSettingsPanelProps = {
|
|
18
18
|
space: Space;
|
|
19
|
-
}
|
|
19
|
+
};
|
|
20
20
|
|
|
21
|
-
export const SpaceSettingsPanel = ({
|
|
21
|
+
export const SpaceSettingsPanel = ({ space }: SpaceSettingsPanelProps) => {
|
|
22
22
|
const { t } = useTranslation(SPACE_PLUGIN);
|
|
23
23
|
|
|
24
24
|
const client = useClient();
|
|
@@ -41,7 +41,7 @@ export const SpaceSettingsPanel = ({ classNames, space }: SpaceSettingsPanelProp
|
|
|
41
41
|
);
|
|
42
42
|
|
|
43
43
|
return (
|
|
44
|
-
<
|
|
44
|
+
<DeprecatedFormContainer>
|
|
45
45
|
<DeprecatedFormInput label={t('name label')}>
|
|
46
46
|
<Input.TextInput
|
|
47
47
|
placeholder={t('unnamed space label')}
|
|
@@ -51,11 +51,33 @@ export const SpaceSettingsPanel = ({ classNames, space }: SpaceSettingsPanelProp
|
|
|
51
51
|
}}
|
|
52
52
|
/>
|
|
53
53
|
</DeprecatedFormInput>
|
|
54
|
+
<DeprecatedFormInput label={t('icon label')}>
|
|
55
|
+
<Toolbar.Root>
|
|
56
|
+
<IconPicker
|
|
57
|
+
value={space.properties.icon}
|
|
58
|
+
onChange={(nextIcon) => (space.properties.icon = nextIcon)}
|
|
59
|
+
onReset={() => {
|
|
60
|
+
space.properties.icon = undefined;
|
|
61
|
+
}}
|
|
62
|
+
/>
|
|
63
|
+
</Toolbar.Root>
|
|
64
|
+
</DeprecatedFormInput>
|
|
65
|
+
<DeprecatedFormInput label={t('hue label')}>
|
|
66
|
+
<Toolbar.Root>
|
|
67
|
+
<HuePicker
|
|
68
|
+
value={space.properties.hue}
|
|
69
|
+
onChange={(nextHue) => (space.properties.hue = nextHue)}
|
|
70
|
+
onReset={() => {
|
|
71
|
+
space.properties.hue = undefined;
|
|
72
|
+
}}
|
|
73
|
+
/>
|
|
74
|
+
</Toolbar.Root>
|
|
75
|
+
</DeprecatedFormInput>
|
|
54
76
|
{edgeEnabled && (
|
|
55
77
|
<DeprecatedFormInput label={t('edge replication label')}>
|
|
56
78
|
<Input.Switch checked={edgeReplication} onCheckedChange={toggleEdgeReplication} />
|
|
57
79
|
</DeprecatedFormInput>
|
|
58
80
|
)}
|
|
59
|
-
</
|
|
81
|
+
</DeprecatedFormContainer>
|
|
60
82
|
);
|
|
61
83
|
};
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { useEffect, useState } from 'react';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { useAppGraph } from '@dxos/app-framework';
|
|
8
8
|
import { QueryEdgeStatusResponse } from '@dxos/protocols/proto/dxos/client/services';
|
|
9
9
|
import { EdgeReplicationSetting } from '@dxos/protocols/proto/dxos/echo/metadata';
|
|
10
10
|
import { useClient } from '@dxos/react-client';
|
|
@@ -38,7 +38,7 @@ export const InlineSyncStatus = ({ space, open }: { space: Space; open?: boolean
|
|
|
38
38
|
// TODO(wittjosiah): If the attended node is deep in the graph and the graph is not fully loaded
|
|
39
39
|
// this will result in an empty path until the graph is connected.
|
|
40
40
|
// TODO(wittjosiah): Consider using this indicator for all open nodes instead of just attended.
|
|
41
|
-
const { graph } =
|
|
41
|
+
const { graph } = useAppGraph();
|
|
42
42
|
const attended = useAttended();
|
|
43
43
|
const startOfAttention = attended.at(-1);
|
|
44
44
|
const path = usePath(graph, startOfAttention);
|
|
@@ -66,8 +66,9 @@ export const SyncStatusIndicator = ({ state, saved }: { state: SpaceSyncStateMap
|
|
|
66
66
|
<StatusBar.Button title={title}>{icon}</StatusBar.Button>
|
|
67
67
|
</Popover.Trigger>
|
|
68
68
|
<Popover.Portal>
|
|
69
|
-
<Popover.Content
|
|
69
|
+
<Popover.Content>
|
|
70
70
|
<SyncStatusDetail state={state} summary={summary} debug={false} />
|
|
71
|
+
<Popover.Arrow />
|
|
71
72
|
</Popover.Content>
|
|
72
73
|
</Popover.Portal>
|
|
73
74
|
</Popover.Root>
|
package/src/components/index.ts
CHANGED
|
@@ -2,14 +2,16 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
export * from './AdvancedObjectSettings';
|
|
5
6
|
export * from './AwaitingObject';
|
|
7
|
+
export * from './BaseObjectSettings';
|
|
6
8
|
export * from './CreateDialog';
|
|
7
9
|
export * from './CollectionMain';
|
|
8
10
|
export * from './CollectionSection';
|
|
9
|
-
export * from './DefaultObjectSettings';
|
|
10
11
|
export * from './JoinDialog';
|
|
11
12
|
export * from './MenuFooter';
|
|
12
13
|
export * from './PersistenceStatus';
|
|
14
|
+
export * from './PopoverAddSpace';
|
|
13
15
|
export * from './PopoverRenameObject';
|
|
14
16
|
export * from './PopoverRenameSpace';
|
|
15
17
|
export * from './ShareSpaceButton';
|
package/src/events.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { defineEvent } from '@dxos/app-framework';
|
|
6
|
+
|
|
7
|
+
import { SPACE_PLUGIN } from './meta';
|
|
8
|
+
|
|
9
|
+
export namespace SpaceEvents {
|
|
10
|
+
export const SetupSettingsPanel = defineEvent(`${SPACE_PLUGIN}/event/setup-settings-panel`);
|
|
11
|
+
export const StateReady = defineEvent(`${SPACE_PLUGIN}/event/state-ready`);
|
|
12
|
+
export const DefaultSpaceReady = defineEvent(`${SPACE_PLUGIN}/event/default-space-ready`);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
// TODO(wittjosiah): Factor out.
|
|
16
|
+
export namespace ThreadEvents {
|
|
17
|
+
export const SetupThread = defineEvent(`${SPACE_PLUGIN}/event/setup-thread`);
|
|
18
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -2,14 +2,10 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export default SpacePlugin;
|
|
5
|
+
export { SpaceCapabilities, ThreadCapabilities } from './capabilities';
|
|
6
|
+
export { SpaceEvents, ThreadEvents } from './events';
|
|
8
7
|
|
|
9
8
|
export * from './components';
|
|
10
9
|
export * from './meta';
|
|
11
|
-
export * from './types';
|
|
12
|
-
export * from './util';
|
|
13
|
-
export { default as translations } from './translations';
|
|
14
|
-
|
|
15
10
|
export * from './SpacePlugin';
|
|
11
|
+
export * from './util';
|
package/src/meta.ts
CHANGED
|
@@ -5,10 +5,9 @@
|
|
|
5
5
|
import { type PluginMeta } from '@dxos/app-framework';
|
|
6
6
|
|
|
7
7
|
export const SPACE_PLUGIN = 'dxos.org/plugin/space';
|
|
8
|
-
export const SPACE_PLUGIN_SHORT_ID = 'space';
|
|
9
8
|
|
|
10
|
-
export
|
|
9
|
+
export const meta = {
|
|
11
10
|
id: SPACE_PLUGIN,
|
|
12
|
-
shortId: SPACE_PLUGIN_SHORT_ID,
|
|
13
11
|
name: 'Spaces',
|
|
12
|
+
icon: 'ph--planet--regular',
|
|
14
13
|
} satisfies PluginMeta;
|
package/src/translations.ts
CHANGED
|
@@ -14,6 +14,7 @@ export default [
|
|
|
14
14
|
[SPACE_PLUGIN]: {
|
|
15
15
|
'plugin name': 'Spaces',
|
|
16
16
|
'first run message': 'Nothing selected.',
|
|
17
|
+
'add space label': 'Create or join a space',
|
|
17
18
|
'create space label': 'Create space',
|
|
18
19
|
'join space label': 'Join space',
|
|
19
20
|
'empty space message': 'No documents',
|
|
@@ -105,6 +106,7 @@ export default [
|
|
|
105
106
|
'offline persisted label': 'Saved to disk (offline)',
|
|
106
107
|
'remote synced label': 'Synced with peers',
|
|
107
108
|
'open settings panel label': 'Show Settings',
|
|
109
|
+
'settings panel label': 'Settings',
|
|
108
110
|
'open space settings label': 'Space Settings',
|
|
109
111
|
'members tab label': 'Members',
|
|
110
112
|
'settings tab label': 'Settings',
|
|
@@ -120,6 +122,11 @@ export default [
|
|
|
120
122
|
'creating in collection label': 'In Collection',
|
|
121
123
|
'clear input label': 'Clear',
|
|
122
124
|
'expose object label': 'Expose in navtree',
|
|
125
|
+
'advanced settings label': 'Advanced',
|
|
126
|
+
'foreign keys': 'Foreign Keys',
|
|
127
|
+
'add key': 'Add Key',
|
|
128
|
+
'icon label': 'Icon',
|
|
129
|
+
'hue label': 'Color',
|
|
123
130
|
},
|
|
124
131
|
},
|
|
125
132
|
},
|
package/src/types/types.ts
CHANGED
|
@@ -2,20 +2,10 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
type GraphSerializerProvides,
|
|
8
|
-
type IntentResolverProvides,
|
|
9
|
-
type MetadataRecordsProvides,
|
|
10
|
-
type SettingsProvides,
|
|
11
|
-
type SurfaceProvides,
|
|
12
|
-
type TranslationsProvides,
|
|
13
|
-
type Plugin,
|
|
14
|
-
ActiveParts,
|
|
15
|
-
} from '@dxos/app-framework';
|
|
16
|
-
import { AST, S, type TypedObject, type Expando } from '@dxos/echo-schema';
|
|
17
|
-
import { type PanelProvides } from '@dxos/plugin-deck/types';
|
|
5
|
+
import { type AnyIntentChain } from '@dxos/app-framework';
|
|
6
|
+
import { AST, S, type Expando, type BaseObject, type TypedObject } from '@dxos/echo-schema';
|
|
18
7
|
import { type PublicKey } from '@dxos/react-client';
|
|
8
|
+
// TODO(wittjosiah): This pulls in full client.
|
|
19
9
|
import { EchoObjectSchema, ReactiveObjectSchema, type Space, SpaceSchema } from '@dxos/react-client/echo';
|
|
20
10
|
import { type ComplexMap } from '@dxos/util';
|
|
21
11
|
|
|
@@ -71,36 +61,16 @@ export type PluginState = {
|
|
|
71
61
|
enabledEdgeReplication: boolean;
|
|
72
62
|
};
|
|
73
63
|
|
|
74
|
-
export
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
64
|
+
export const SpaceSettingsSchema = S.mutable(
|
|
65
|
+
S.Struct({
|
|
66
|
+
/**
|
|
67
|
+
* Show closed spaces.
|
|
68
|
+
*/
|
|
69
|
+
showHidden: S.Boolean,
|
|
70
|
+
}),
|
|
71
|
+
);
|
|
80
72
|
|
|
81
|
-
export type
|
|
82
|
-
echo: {
|
|
83
|
-
schema?: TypedObject[];
|
|
84
|
-
system?: TypedObject[];
|
|
85
|
-
};
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
export const parseSchemaPlugin = (plugin?: Plugin) =>
|
|
89
|
-
Array.isArray((plugin?.provides as any).echo?.schema) || Array.isArray((plugin?.provides as any).echo?.system)
|
|
90
|
-
? (plugin as Plugin<SchemaProvides>)
|
|
91
|
-
: undefined;
|
|
92
|
-
|
|
93
|
-
export type SpacePluginProvides = SurfaceProvides &
|
|
94
|
-
IntentResolverProvides &
|
|
95
|
-
GraphBuilderProvides &
|
|
96
|
-
GraphSerializerProvides &
|
|
97
|
-
MetadataRecordsProvides &
|
|
98
|
-
SettingsProvides<SpaceSettingsProps> &
|
|
99
|
-
TranslationsProvides &
|
|
100
|
-
SchemaProvides &
|
|
101
|
-
PanelProvides & {
|
|
102
|
-
space: Readonly<PluginState>;
|
|
103
|
-
};
|
|
73
|
+
export type SpaceSettingsProps = S.Schema.Type<typeof SpaceSettingsSchema>;
|
|
104
74
|
|
|
105
75
|
// TODO(wittjosiah): Reconcile with graph export serializers.
|
|
106
76
|
|
|
@@ -123,6 +93,14 @@ export const SpaceForm = S.Struct({
|
|
|
123
93
|
edgeReplication: S.Boolean.annotations({ [AST.TitleAnnotationId]: 'Enable EDGE Replication' }),
|
|
124
94
|
});
|
|
125
95
|
|
|
96
|
+
export type ObjectForm<T extends BaseObject = BaseObject> = {
|
|
97
|
+
objectSchema: TypedObject;
|
|
98
|
+
formSchema?: S.Schema<T, any>;
|
|
99
|
+
getIntent: (props: T, options: { space: Space }) => AnyIntentChain;
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
export const defineObjectForm = <T extends BaseObject>(form: ObjectForm<T>) => form;
|
|
103
|
+
|
|
126
104
|
export const SPACE_ACTION = `${SPACE_PLUGIN}/action`;
|
|
127
105
|
|
|
128
106
|
export namespace SpaceAction {
|
|
@@ -135,7 +113,7 @@ export namespace SpaceAction {
|
|
|
135
113
|
input: SpaceForm,
|
|
136
114
|
output: S.Struct({
|
|
137
115
|
id: S.String,
|
|
138
|
-
|
|
116
|
+
subject: S.Array(S.String),
|
|
139
117
|
space: SpaceSchema,
|
|
140
118
|
}),
|
|
141
119
|
}) {}
|
|
@@ -177,6 +155,16 @@ export namespace SpaceAction {
|
|
|
177
155
|
output: S.Void,
|
|
178
156
|
}) {}
|
|
179
157
|
|
|
158
|
+
export class AddSpace extends S.TaggedClass<AddSpace>()(`${SPACE_ACTION}/add-space`, {
|
|
159
|
+
input: S.Void,
|
|
160
|
+
output: S.Void,
|
|
161
|
+
}) {}
|
|
162
|
+
|
|
163
|
+
export class AddSpaceMenuGroup extends S.TaggedClass<AddSpaceMenuGroup>()(`${SPACE_ACTION}/add-space-menu-group`, {
|
|
164
|
+
input: S.Void,
|
|
165
|
+
output: S.Void,
|
|
166
|
+
}) {}
|
|
167
|
+
|
|
180
168
|
export class OpenSettings extends S.TaggedClass<OpenSettings>()(`${SPACE_ACTION}/open-settings`, {
|
|
181
169
|
input: S.Struct({
|
|
182
170
|
space: SpaceSchema,
|
|
@@ -221,7 +209,7 @@ export namespace SpaceAction {
|
|
|
221
209
|
}),
|
|
222
210
|
output: S.Struct({
|
|
223
211
|
id: S.String,
|
|
224
|
-
|
|
212
|
+
subject: S.Array(S.String),
|
|
225
213
|
object: EchoObjectSchema,
|
|
226
214
|
}),
|
|
227
215
|
}) {}
|
|
@@ -267,13 +255,6 @@ export namespace SpaceAction {
|
|
|
267
255
|
}),
|
|
268
256
|
output: S.Void,
|
|
269
257
|
}) {}
|
|
270
|
-
|
|
271
|
-
export class ToggleHidden extends S.TaggedClass<ToggleHidden>()(`${SPACE_ACTION}/toggle-hidden`, {
|
|
272
|
-
input: S.Struct({
|
|
273
|
-
state: S.optional(S.Boolean),
|
|
274
|
-
}),
|
|
275
|
-
output: S.Void,
|
|
276
|
-
}) {}
|
|
277
258
|
}
|
|
278
259
|
|
|
279
260
|
export namespace CollectionAction {
|