@dxos/plugin-space 0.8.2-main.f11618f → 0.8.2-staging.7ac8446
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-ZWNOWRAX.mjs → app-graph-builder-GMFCSOLG.mjs} +7 -61
- package/dist/lib/browser/app-graph-builder-GMFCSOLG.mjs.map +7 -0
- package/dist/lib/browser/{app-graph-serializer-UUJH7JRN.mjs → app-graph-serializer-DSF2U3A5.mjs} +8 -8
- package/dist/lib/browser/app-graph-serializer-DSF2U3A5.mjs.map +7 -0
- package/dist/lib/browser/{chunk-DIJ7LMCS.mjs → chunk-5BDV575R.mjs} +8 -20
- package/dist/lib/browser/chunk-5BDV575R.mjs.map +7 -0
- package/dist/lib/browser/{chunk-O7WGQVLQ.mjs → chunk-AYW4IDRT.mjs} +4 -35
- package/dist/lib/browser/chunk-AYW4IDRT.mjs.map +7 -0
- package/dist/lib/browser/{chunk-4226DMDP.mjs → chunk-JZXWPMLA.mjs} +666 -522
- package/dist/lib/browser/chunk-JZXWPMLA.mjs.map +7 -0
- package/dist/lib/browser/{chunk-JS6ZV4GV.mjs → chunk-LO5UL6RU.mjs} +141 -60
- package/dist/lib/browser/chunk-LO5UL6RU.mjs.map +7 -0
- package/dist/lib/browser/{identity-created-NRVE4XLL.mjs → identity-created-JR7BNXFH.mjs} +4 -4
- package/dist/lib/browser/identity-created-JR7BNXFH.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +33 -12
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-resolver-NP55M7C7.mjs → intent-resolver-RKYILWWQ.mjs} +82 -92
- package/dist/lib/browser/intent-resolver-RKYILWWQ.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-root-XKAUZ3X2.mjs → react-root-6H7NX2M2.mjs} +4 -4
- package/dist/lib/browser/{react-surface-2DW2UDRX.mjs → react-surface-7AGLOVMK.mjs} +47 -121
- package/dist/lib/browser/react-surface-7AGLOVMK.mjs.map +7 -0
- package/dist/lib/browser/{settings-MVT32NP6.mjs → settings-PJPTJUPE.mjs} +4 -4
- package/dist/lib/browser/settings-PJPTJUPE.mjs.map +7 -0
- package/dist/lib/browser/{spaces-ready-ERNSICUW.mjs → spaces-ready-BSSP7HHG.mjs} +5 -5
- package/dist/lib/browser/spaces-ready-BSSP7HHG.mjs.map +7 -0
- package/dist/lib/browser/{state-CYV6QCTN.mjs → state-X7VLCC6E.mjs} +3 -1
- package/dist/lib/browser/state-X7VLCC6E.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +1 -7
- package/dist/lib/node/{app-graph-builder-LLIV422L.cjs → app-graph-builder-DPY7AUZE.cjs} +30 -83
- package/dist/lib/node/app-graph-builder-DPY7AUZE.cjs.map +7 -0
- package/dist/lib/node/{app-graph-serializer-M6Z2OPA4.cjs → app-graph-serializer-JELGJUAY.cjs} +20 -20
- package/dist/lib/node/app-graph-serializer-JELGJUAY.cjs.map +7 -0
- package/dist/lib/node/{chunk-ZMQO74LX.cjs → chunk-3GKCNADA.cjs} +655 -513
- package/dist/lib/node/chunk-3GKCNADA.cjs.map +7 -0
- package/dist/lib/node/{chunk-UOCR4G2D.cjs → chunk-PU2EYH4E.cjs} +12 -24
- package/dist/lib/node/chunk-PU2EYH4E.cjs.map +7 -0
- package/dist/lib/node/{chunk-XADZLQAJ.cjs → chunk-TUZWEPGX.cjs} +167 -84
- package/dist/lib/node/chunk-TUZWEPGX.cjs.map +7 -0
- package/dist/lib/node/{chunk-EQ5BPSQ7.cjs → chunk-WDEIFDTX.cjs} +7 -41
- package/dist/lib/node/chunk-WDEIFDTX.cjs.map +7 -0
- package/dist/lib/node/{identity-created-YDTRMOMX.cjs → identity-created-XU4HFV2T.cjs} +6 -6
- package/dist/lib/node/identity-created-XU4HFV2T.cjs.map +7 -0
- package/dist/lib/node/index.cjs +89 -68
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/{intent-resolver-3J52ARFL.cjs → intent-resolver-VJ7YV74L.cjs} +131 -141
- package/dist/lib/node/intent-resolver-VJ7YV74L.cjs.map +7 -0
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/{react-root-XUE2J7HT.cjs → react-root-TEL5RW3N.cjs} +8 -8
- package/dist/lib/node/{react-surface-IWSTOZ2E.cjs → react-surface-2H3S5TY5.cjs} +74 -146
- package/dist/lib/node/react-surface-2H3S5TY5.cjs.map +7 -0
- package/dist/lib/node/{settings-JLV7YT6Q.cjs → settings-WVFP2UEP.cjs} +7 -7
- package/dist/lib/node/settings-WVFP2UEP.cjs.map +7 -0
- package/dist/lib/node/{spaces-ready-6EBR4SM4.cjs → spaces-ready-7DNZSUOG.cjs} +12 -12
- package/dist/lib/node/spaces-ready-7DNZSUOG.cjs.map +7 -0
- package/dist/lib/node/{state-JLN7TGRR.cjs → state-5KX6WBJH.cjs} +6 -4
- package/dist/lib/node/state-5KX6WBJH.cjs.map +7 -0
- package/dist/lib/node/types/index.cjs +12 -18
- package/dist/lib/node/types/index.cjs.map +2 -2
- package/dist/lib/node-esm/{app-graph-builder-HSGLCS76.mjs → app-graph-builder-42IGWRPL.mjs} +7 -61
- package/dist/lib/node-esm/app-graph-builder-42IGWRPL.mjs.map +7 -0
- package/dist/lib/node-esm/{app-graph-serializer-J3B4WSXU.mjs → app-graph-serializer-FXONFKOE.mjs} +8 -8
- package/dist/lib/node-esm/app-graph-serializer-FXONFKOE.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-OLISVDCF.mjs → chunk-3ZOUV4DF.mjs} +8 -20
- package/dist/lib/node-esm/chunk-3ZOUV4DF.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-PQI4D4SH.mjs → chunk-BEWBZ4Q4.mjs} +666 -522
- package/dist/lib/node-esm/chunk-BEWBZ4Q4.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-FJPCLEKN.mjs → chunk-FC4UHDPL.mjs} +4 -35
- package/dist/lib/node-esm/chunk-FC4UHDPL.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-ABTVMAG5.mjs → chunk-ZGLK25WQ.mjs} +141 -60
- package/dist/lib/node-esm/chunk-ZGLK25WQ.mjs.map +7 -0
- package/dist/lib/node-esm/{identity-created-EC6SVYB5.mjs → identity-created-WJKAS2PV.mjs} +4 -4
- package/dist/lib/node-esm/identity-created-WJKAS2PV.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +33 -12
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/{intent-resolver-MXQIFIRC.mjs → intent-resolver-ZFNSA4CM.mjs} +82 -92
- package/dist/lib/node-esm/intent-resolver-ZFNSA4CM.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-root-ZBCJCEFS.mjs → react-root-PRBJMWLQ.mjs} +4 -4
- package/dist/lib/node-esm/{react-surface-JCHDAPGM.mjs → react-surface-RCZG2PNF.mjs} +47 -121
- package/dist/lib/node-esm/react-surface-RCZG2PNF.mjs.map +7 -0
- package/dist/lib/node-esm/{settings-AILIMHTE.mjs → settings-FJZPC2TV.mjs} +4 -4
- package/dist/lib/node-esm/settings-FJZPC2TV.mjs.map +7 -0
- package/dist/lib/node-esm/{spaces-ready-5PXESKHX.mjs → spaces-ready-7X5PGB2V.mjs} +5 -5
- package/dist/lib/node-esm/spaces-ready-7X5PGB2V.mjs.map +7 -0
- package/dist/lib/node-esm/{state-YZPY5T5A.mjs → state-Z6E2YTNC.mjs} +3 -1
- package/dist/lib/node-esm/state-Z6E2YTNC.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +1 -7
- package/dist/types/src/SpacePlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +0 -1
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +1 -2
- 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/state.d.ts.map +1 -1
- package/dist/types/src/components/CollectionMain.d.ts.map +1 -1
- package/dist/types/src/components/CreateDialog/CreateObjectDialog.d.ts +2 -2
- package/dist/types/src/components/CreateDialog/CreateObjectDialog.d.ts.map +1 -1
- 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/MembersContainer.d.ts.map +1 -1
- package/dist/types/src/components/ObjectSettingsContainer/AdvancedObjectSettings.d.ts.map +1 -0
- package/dist/types/src/components/ObjectSettingsContainer/BaseObjectSettings.d.ts.map +1 -0
- package/dist/types/src/components/ObjectSettingsContainer/ForeignKeys.d.ts.map +1 -0
- package/dist/types/src/components/ObjectSettingsContainer/ObjectSettingsContainer.d.ts.map +1 -0
- package/dist/types/src/components/ObjectSettingsContainer/index.d.ts.map +1 -0
- package/dist/types/src/components/PopoverAddSpace.d.ts.map +1 -1
- package/dist/types/src/components/PopoverRenameObject.d.ts +2 -2
- package/dist/types/src/components/PopoverRenameObject.d.ts.map +1 -1
- package/dist/types/src/components/PopoverRenameSpace.d.ts.map +1 -1
- package/dist/types/src/components/ShareSpaceButton.d.ts +9 -0
- package/dist/types/src/components/ShareSpaceButton.d.ts.map +1 -0
- package/dist/types/src/components/ShareSpaceButton.stories.d.ts +10 -0
- package/dist/types/src/components/ShareSpaceButton.stories.d.ts.map +1 -0
- package/dist/types/src/components/SpacePluginSettings.d.ts.map +1 -1
- package/dist/types/src/components/SpacePresence.d.ts.map +1 -1
- package/dist/types/src/components/SpaceSettings/SpacePropertiesForm.d.ts +7 -0
- package/dist/types/src/components/SpaceSettings/SpacePropertiesForm.d.ts.map +1 -0
- package/dist/types/src/components/SpaceSettings/SpacePropertiesForm.stories.d.ts +7 -0
- package/dist/types/src/components/SpaceSettings/SpacePropertiesForm.stories.d.ts.map +1 -0
- package/dist/types/src/components/SpaceSettings/SpaceSettingsContainer.d.ts +2 -0
- package/dist/types/src/components/SpaceSettings/SpaceSettingsContainer.d.ts.map +1 -1
- package/dist/types/src/components/SpaceSettings/index.d.ts +1 -0
- package/dist/types/src/components/SpaceSettings/index.d.ts.map +1 -1
- package/dist/types/src/components/SyncStatus/InlineSyncStatus.d.ts.map +1 -1
- package/dist/types/src/components/SyncStatus/Space.d.ts +13 -0
- package/dist/types/src/components/SyncStatus/Space.d.ts.map +1 -0
- package/dist/types/src/components/SyncStatus/SyncStatus.d.ts +8 -1
- package/dist/types/src/components/SyncStatus/SyncStatus.d.ts.map +1 -1
- package/dist/types/src/components/SyncStatus/SyncStatusDetail.stories.d.ts +9 -0
- package/dist/types/src/components/SyncStatus/SyncStatusDetail.stories.d.ts.map +1 -0
- package/dist/types/src/components/SyncStatus/sync-state.d.ts +18 -0
- package/dist/types/src/components/SyncStatus/sync-state.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +2 -2
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/hooks/index.d.ts +0 -1
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +9 -45
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/thread.d.ts +17 -241
- package/dist/types/src/types/thread.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +14 -40
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/src/util.d.ts +5 -27
- package/dist/types/src/util.d.ts.map +1 -1
- package/package.json +43 -44
- package/src/SpacePlugin.tsx +13 -3
- package/src/capabilities/app-graph-builder.ts +5 -44
- package/src/capabilities/app-graph-serializer.ts +4 -4
- package/src/capabilities/identity-created.ts +2 -2
- package/src/capabilities/intent-resolver.ts +84 -87
- package/src/capabilities/react-surface.tsx +37 -106
- package/src/capabilities/settings.ts +2 -2
- package/src/capabilities/spaces-ready.ts +2 -2
- package/src/capabilities/state.ts +2 -0
- package/src/components/CollectionMain.tsx +5 -2
- package/src/components/CreateDialog/CreateObjectDialog.stories.tsx +2 -2
- package/src/components/CreateDialog/CreateObjectDialog.tsx +3 -3
- package/src/components/CreateDialog/CreateObjectPanel.tsx +25 -3
- package/src/components/CreateDialog/CreateSpaceDialog.tsx +0 -4
- package/src/components/MembersContainer.tsx +54 -80
- package/src/components/PopoverAddSpace.tsx +3 -9
- package/src/components/PopoverRenameObject.tsx +8 -14
- package/src/components/PopoverRenameSpace.tsx +0 -8
- package/src/components/ShareSpaceButton.stories.tsx +27 -0
- package/src/components/ShareSpaceButton.tsx +32 -0
- package/src/components/SpacePluginSettings.tsx +2 -27
- package/src/components/SpacePresence.tsx +25 -29
- package/src/components/SpaceSettings/{SpaceSettingsContainer.stories.tsx → SpacePropertiesForm.stories.tsx} +6 -6
- package/src/components/SpaceSettings/SpacePropertiesForm.tsx +136 -0
- package/src/components/SpaceSettings/SpaceSettingsContainer.tsx +39 -157
- package/src/components/SpaceSettings/index.ts +1 -0
- package/src/components/SyncStatus/InlineSyncStatus.tsx +7 -5
- package/src/components/SyncStatus/Space.tsx +133 -0
- package/src/components/SyncStatus/SyncStatus.tsx +69 -6
- package/src/components/SyncStatus/SyncStatusDetail.stories.tsx +89 -0
- package/src/components/SyncStatus/sync-state.ts +101 -0
- package/src/components/index.ts +2 -2
- package/src/hooks/index.ts +0 -1
- package/src/translations.ts +5 -18
- package/src/types/types.ts +8 -30
- package/src/util.tsx +103 -43
- package/dist/lib/browser/app-graph-builder-ZWNOWRAX.mjs.map +0 -7
- package/dist/lib/browser/app-graph-serializer-UUJH7JRN.mjs.map +0 -7
- package/dist/lib/browser/chunk-4226DMDP.mjs.map +0 -7
- package/dist/lib/browser/chunk-DIJ7LMCS.mjs.map +0 -7
- package/dist/lib/browser/chunk-JS6ZV4GV.mjs.map +0 -7
- package/dist/lib/browser/chunk-O7WGQVLQ.mjs.map +0 -7
- package/dist/lib/browser/identity-created-NRVE4XLL.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-NP55M7C7.mjs.map +0 -7
- package/dist/lib/browser/react-surface-2DW2UDRX.mjs.map +0 -7
- package/dist/lib/browser/settings-MVT32NP6.mjs.map +0 -7
- package/dist/lib/browser/spaces-ready-ERNSICUW.mjs.map +0 -7
- package/dist/lib/browser/state-CYV6QCTN.mjs.map +0 -7
- package/dist/lib/node/app-graph-builder-LLIV422L.cjs.map +0 -7
- package/dist/lib/node/app-graph-serializer-M6Z2OPA4.cjs.map +0 -7
- package/dist/lib/node/chunk-EQ5BPSQ7.cjs.map +0 -7
- package/dist/lib/node/chunk-UOCR4G2D.cjs.map +0 -7
- package/dist/lib/node/chunk-XADZLQAJ.cjs.map +0 -7
- package/dist/lib/node/chunk-ZMQO74LX.cjs.map +0 -7
- package/dist/lib/node/identity-created-YDTRMOMX.cjs.map +0 -7
- package/dist/lib/node/intent-resolver-3J52ARFL.cjs.map +0 -7
- package/dist/lib/node/react-surface-IWSTOZ2E.cjs.map +0 -7
- package/dist/lib/node/settings-JLV7YT6Q.cjs.map +0 -7
- package/dist/lib/node/spaces-ready-6EBR4SM4.cjs.map +0 -7
- package/dist/lib/node/state-JLN7TGRR.cjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-HSGLCS76.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-serializer-J3B4WSXU.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-ABTVMAG5.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-FJPCLEKN.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-OLISVDCF.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-PQI4D4SH.mjs.map +0 -7
- package/dist/lib/node-esm/identity-created-EC6SVYB5.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-MXQIFIRC.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-JCHDAPGM.mjs.map +0 -7
- package/dist/lib/node-esm/settings-AILIMHTE.mjs.map +0 -7
- package/dist/lib/node-esm/spaces-ready-5PXESKHX.mjs.map +0 -7
- package/dist/lib/node-esm/state-YZPY5T5A.mjs.map +0 -7
- package/dist/types/src/components/ObjectSettings/AdvancedObjectSettings.d.ts.map +0 -1
- package/dist/types/src/components/ObjectSettings/BaseObjectSettings.d.ts.map +0 -1
- package/dist/types/src/components/ObjectSettings/ForeignKeys.d.ts.map +0 -1
- package/dist/types/src/components/ObjectSettings/ObjectSettingsContainer.d.ts.map +0 -1
- package/dist/types/src/components/ObjectSettings/index.d.ts.map +0 -1
- package/dist/types/src/components/SchemaContainer.d.ts +0 -13
- package/dist/types/src/components/SchemaContainer.d.ts.map +0 -1
- package/dist/types/src/components/SpaceSettings/SpaceSettingsContainer.stories.d.ts +0 -7
- package/dist/types/src/components/SpaceSettings/SpaceSettingsContainer.stories.d.ts.map +0 -1
- package/dist/types/src/hooks/useInputSurfaceLookup.d.ts +0 -14
- package/dist/types/src/hooks/useInputSurfaceLookup.d.ts.map +0 -1
- package/src/components/SchemaContainer.tsx +0 -59
- package/src/hooks/useInputSurfaceLookup.tsx +0 -31
- /package/dist/lib/browser/{react-root-XKAUZ3X2.mjs.map → react-root-6H7NX2M2.mjs.map} +0 -0
- /package/dist/lib/node/{react-root-XUE2J7HT.cjs.map → react-root-TEL5RW3N.cjs.map} +0 -0
- /package/dist/lib/node-esm/{react-root-ZBCJCEFS.mjs.map → react-root-PRBJMWLQ.mjs.map} +0 -0
- /package/dist/types/src/components/{ObjectSettings → ObjectSettingsContainer}/AdvancedObjectSettings.d.ts +0 -0
- /package/dist/types/src/components/{ObjectSettings → ObjectSettingsContainer}/BaseObjectSettings.d.ts +0 -0
- /package/dist/types/src/components/{ObjectSettings → ObjectSettingsContainer}/ForeignKeys.d.ts +0 -0
- /package/dist/types/src/components/{ObjectSettings → ObjectSettingsContainer}/ObjectSettingsContainer.d.ts +0 -0
- /package/dist/types/src/components/{ObjectSettings → ObjectSettingsContainer}/index.d.ts +0 -0
- /package/src/components/{ObjectSettings → ObjectSettingsContainer}/AdvancedObjectSettings.tsx +0 -0
- /package/src/components/{ObjectSettings → ObjectSettingsContainer}/BaseObjectSettings.tsx +0 -0
- /package/src/components/{ObjectSettings → ObjectSettingsContainer}/ForeignKeys.tsx +0 -0
- /package/src/components/{ObjectSettings → ObjectSettingsContainer}/ObjectSettingsContainer.tsx +0 -0
- /package/src/components/{ObjectSettings → ObjectSettingsContainer}/index.ts +0 -0
|
@@ -2,27 +2,20 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import
|
|
6
|
-
import React, { useCallback } from 'react';
|
|
5
|
+
import React from 'react';
|
|
7
6
|
|
|
8
|
-
import { Capabilities, contributes, createSurface, Surface, useCapability
|
|
7
|
+
import { Capabilities, contributes, createSurface, Surface, useCapability } from '@dxos/app-framework';
|
|
9
8
|
import { isInstanceOf } from '@dxos/echo-schema';
|
|
10
|
-
import { findAnnotation } from '@dxos/effect';
|
|
11
9
|
import { SettingsStore } from '@dxos/local-storage';
|
|
12
10
|
import {
|
|
13
11
|
getSpace,
|
|
14
12
|
isEchoObject,
|
|
15
|
-
|
|
13
|
+
isReactiveObject,
|
|
16
14
|
isSpace,
|
|
17
|
-
parseId,
|
|
18
15
|
SpaceState,
|
|
19
|
-
useSpace,
|
|
20
16
|
type ReactiveEchoObject,
|
|
21
17
|
type Space,
|
|
22
18
|
} from '@dxos/react-client/echo';
|
|
23
|
-
import { Input } from '@dxos/react-ui';
|
|
24
|
-
import { type InputProps } from '@dxos/react-ui-form';
|
|
25
|
-
import { HuePicker, IconPicker } from '@dxos/react-ui-pickers';
|
|
26
19
|
import { type JoinPanelProps } from '@dxos/shell/react';
|
|
27
20
|
|
|
28
21
|
import { SpaceCapabilities } from './capabilities';
|
|
@@ -48,13 +41,13 @@ import {
|
|
|
48
41
|
type CreateObjectDialogProps,
|
|
49
42
|
POPOVER_ADD_SPACE,
|
|
50
43
|
PopoverAddSpace,
|
|
44
|
+
SpaceSettingsContainer,
|
|
45
|
+
SpacePropertiesForm,
|
|
51
46
|
MembersContainer,
|
|
52
47
|
ObjectSettingsContainer,
|
|
53
|
-
SpaceSettingsContainer,
|
|
54
|
-
SchemaContainer,
|
|
55
48
|
} from '../components';
|
|
56
49
|
import { SPACE_PLUGIN } from '../meta';
|
|
57
|
-
import { CollectionType,
|
|
50
|
+
import { CollectionType, type SpaceSettingsProps } from '../types';
|
|
58
51
|
|
|
59
52
|
type ReactSurfaceOptions = {
|
|
60
53
|
createInvitationUrl: (invitationCode: string) => string;
|
|
@@ -84,11 +77,20 @@ export default ({ createInvitationUrl }: ReactSurfaceOptions) =>
|
|
|
84
77
|
component: ({ data }) => <CollectionMain collection={data.subject} />,
|
|
85
78
|
}),
|
|
86
79
|
createSurface({
|
|
87
|
-
id: `${SPACE_PLUGIN}/
|
|
80
|
+
id: `${SPACE_PLUGIN}/members`,
|
|
88
81
|
role: 'article',
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
82
|
+
position: 'hoist',
|
|
83
|
+
filter: (data): data is { subject: Space; variant: 'members' } =>
|
|
84
|
+
isSpace(data.subject) && data.variant === 'members',
|
|
85
|
+
component: ({ data }) => <MembersContainer space={data.subject} createInvitationUrl={createInvitationUrl} />,
|
|
86
|
+
}),
|
|
87
|
+
createSurface({
|
|
88
|
+
id: `${SPACE_PLUGIN}/settings`,
|
|
89
|
+
role: 'article',
|
|
90
|
+
position: 'hoist',
|
|
91
|
+
filter: (data): data is { subject: Space; variant: 'settings' } =>
|
|
92
|
+
isSpace(data.subject) && data.variant === 'settings',
|
|
93
|
+
component: ({ data }) => <SpaceSettingsContainer space={data.subject} />,
|
|
92
94
|
}),
|
|
93
95
|
createSurface({
|
|
94
96
|
id: `${SPACE_PLUGIN}/companion/object-settings`,
|
|
@@ -98,50 +100,10 @@ export default ({ createInvitationUrl }: ReactSurfaceOptions) =>
|
|
|
98
100
|
component: ({ data, role }) => <ObjectSettingsContainer object={data.companionTo} role={role} />,
|
|
99
101
|
}),
|
|
100
102
|
createSurface({
|
|
101
|
-
id: `${SPACE_PLUGIN}/space-settings
|
|
102
|
-
role: '
|
|
103
|
-
filter: (data): data is { subject:
|
|
104
|
-
component: () => {
|
|
105
|
-
const layout = useLayout();
|
|
106
|
-
const { spaceId } = parseId(layout.workspace);
|
|
107
|
-
const space = useSpace(spaceId);
|
|
108
|
-
if (!space || !spaceId) {
|
|
109
|
-
return null;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
return <SpaceSettingsContainer space={space} />;
|
|
113
|
-
},
|
|
114
|
-
}),
|
|
115
|
-
createSurface({
|
|
116
|
-
id: `${SPACE_PLUGIN}/space-settings-members`,
|
|
117
|
-
role: 'article',
|
|
118
|
-
position: 'hoist',
|
|
119
|
-
filter: (data): data is { subject: string } => data.subject === `${SPACE_PLUGIN}/members`,
|
|
120
|
-
component: () => {
|
|
121
|
-
const layout = useLayout();
|
|
122
|
-
const { spaceId } = parseId(layout.workspace);
|
|
123
|
-
const space = useSpace(spaceId);
|
|
124
|
-
if (!space || !spaceId) {
|
|
125
|
-
return null;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
return <MembersContainer space={space} createInvitationUrl={createInvitationUrl} />;
|
|
129
|
-
},
|
|
130
|
-
}),
|
|
131
|
-
createSurface({
|
|
132
|
-
id: `${SPACE_PLUGIN}/space-settings-schema`,
|
|
133
|
-
role: 'article',
|
|
134
|
-
filter: (data): data is { subject: string } => data.subject === `${SPACE_PLUGIN}/schema`,
|
|
135
|
-
component: () => {
|
|
136
|
-
const layout = useLayout();
|
|
137
|
-
const { spaceId } = parseId(layout.workspace);
|
|
138
|
-
const space = useSpace(spaceId);
|
|
139
|
-
if (!space || !spaceId) {
|
|
140
|
-
return null;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
return <SchemaContainer space={space} />;
|
|
144
|
-
},
|
|
103
|
+
id: `${SPACE_PLUGIN}/space-settings--properties`,
|
|
104
|
+
role: 'space-settings--properties',
|
|
105
|
+
filter: (data): data is { subject: Space } => isSpace(data.subject),
|
|
106
|
+
component: ({ data }) => <SpacePropertiesForm space={data.subject} />,
|
|
145
107
|
}),
|
|
146
108
|
createSurface({
|
|
147
109
|
id: JOIN_DIALOG,
|
|
@@ -161,44 +123,6 @@ export default ({ createInvitationUrl }: ReactSurfaceOptions) =>
|
|
|
161
123
|
filter: (data): data is { props: CreateObjectDialogProps } => data.component === CREATE_OBJECT_DIALOG,
|
|
162
124
|
component: ({ data }) => <CreateObjectDialog {...data.props} />,
|
|
163
125
|
}),
|
|
164
|
-
createSurface({
|
|
165
|
-
id: `${SPACE_PLUGIN}/create-initial-space-form-[hue]`,
|
|
166
|
-
role: 'form-input',
|
|
167
|
-
filter: (data): data is { prop: string; schema: S.Schema<any> } => {
|
|
168
|
-
const annotation = findAnnotation<boolean>((data.schema as S.Schema.All).ast, HueAnnotationId);
|
|
169
|
-
return !!annotation;
|
|
170
|
-
},
|
|
171
|
-
component: ({ data: _, ...inputProps }) => {
|
|
172
|
-
const { label, disabled, type, getValue, onValueChange } = inputProps as any as InputProps;
|
|
173
|
-
const handleChange = useCallback((nextHue: string) => onValueChange(type, nextHue), [onValueChange]);
|
|
174
|
-
const handleReset = useCallback(() => onValueChange(type, undefined), [onValueChange]);
|
|
175
|
-
return (
|
|
176
|
-
<Input.Root>
|
|
177
|
-
<Input.Label>{label}</Input.Label>
|
|
178
|
-
<HuePicker disabled={disabled} value={getValue() ?? ''} onChange={handleChange} onReset={handleReset} />
|
|
179
|
-
</Input.Root>
|
|
180
|
-
);
|
|
181
|
-
},
|
|
182
|
-
}),
|
|
183
|
-
createSurface({
|
|
184
|
-
id: `${SPACE_PLUGIN}/create-initial-space-form-[icon]`,
|
|
185
|
-
role: 'form-input',
|
|
186
|
-
filter: (data): data is { prop: string; schema: S.Schema<any> } => {
|
|
187
|
-
const annotation = findAnnotation<boolean>((data.schema as S.Schema.All).ast, IconAnnotationId);
|
|
188
|
-
return !!annotation;
|
|
189
|
-
},
|
|
190
|
-
component: ({ data: _, ...inputProps }) => {
|
|
191
|
-
const { label, disabled, type, getValue, onValueChange } = inputProps as any as InputProps;
|
|
192
|
-
const handleChange = useCallback((nextIcon: string) => onValueChange(type, nextIcon), [onValueChange]);
|
|
193
|
-
const handleReset = useCallback(() => onValueChange(type, undefined), [onValueChange]);
|
|
194
|
-
return (
|
|
195
|
-
<Input.Root>
|
|
196
|
-
<Input.Label>{label}</Input.Label>
|
|
197
|
-
<IconPicker disabled={disabled} value={getValue() ?? ''} onChange={handleChange} onReset={handleReset} />
|
|
198
|
-
</Input.Root>
|
|
199
|
-
);
|
|
200
|
-
},
|
|
201
|
-
}),
|
|
202
126
|
createSurface({
|
|
203
127
|
id: POPOVER_RENAME_SPACE,
|
|
204
128
|
role: 'popover',
|
|
@@ -209,7 +133,7 @@ export default ({ createInvitationUrl }: ReactSurfaceOptions) =>
|
|
|
209
133
|
id: POPOVER_RENAME_OBJECT,
|
|
210
134
|
role: 'popover',
|
|
211
135
|
filter: (data): data is { props: ReactiveEchoObject<any> } =>
|
|
212
|
-
data.component === POPOVER_RENAME_OBJECT &&
|
|
136
|
+
data.component === POPOVER_RENAME_OBJECT && isReactiveObject(data.props),
|
|
213
137
|
component: ({ data }) => <PopoverRenameObject object={data.props} />,
|
|
214
138
|
}),
|
|
215
139
|
createSurface({
|
|
@@ -218,12 +142,6 @@ export default ({ createInvitationUrl }: ReactSurfaceOptions) =>
|
|
|
218
142
|
filter: (data): data is any => data.component === POPOVER_ADD_SPACE,
|
|
219
143
|
component: () => <PopoverAddSpace />,
|
|
220
144
|
}),
|
|
221
|
-
createSurface({
|
|
222
|
-
id: `${SPACE_PLUGIN}/menu-footer`,
|
|
223
|
-
role: 'menu-footer',
|
|
224
|
-
filter: (data): data is { subject: ReactiveEchoObject<any> } => isEchoObject(data.subject),
|
|
225
|
-
component: ({ data }) => <MenuFooter object={data.subject} />,
|
|
226
|
-
}),
|
|
227
145
|
createSurface({
|
|
228
146
|
id: `${SPACE_PLUGIN}/navtree-presence`,
|
|
229
147
|
role: 'navtree-item-end',
|
|
@@ -273,6 +191,19 @@ export default ({ createInvitationUrl }: ReactSurfaceOptions) =>
|
|
|
273
191
|
filter: (data): data is { subject: CollectionType } => isInstanceOf(CollectionType, data.subject),
|
|
274
192
|
component: ({ data }) => <CollectionSection collection={data.subject} />,
|
|
275
193
|
}),
|
|
194
|
+
createSurface({
|
|
195
|
+
id: `${SPACE_PLUGIN}/plugin-settings`,
|
|
196
|
+
role: 'article',
|
|
197
|
+
filter: (data): data is { subject: SettingsStore<SpaceSettingsProps> } =>
|
|
198
|
+
data.subject instanceof SettingsStore && data.subject.prefix === SPACE_PLUGIN,
|
|
199
|
+
component: ({ data: { subject } }) => <SpacePluginSettings settings={subject.value} />,
|
|
200
|
+
}),
|
|
201
|
+
createSurface({
|
|
202
|
+
id: `${SPACE_PLUGIN}/menu-footer`,
|
|
203
|
+
role: 'menu-footer',
|
|
204
|
+
filter: (data): data is { subject: ReactiveEchoObject<any> } => isEchoObject(data.subject),
|
|
205
|
+
component: ({ data }) => <MenuFooter object={data.subject} />,
|
|
206
|
+
}),
|
|
276
207
|
createSurface({
|
|
277
208
|
id: `${SPACE_PLUGIN}/status`,
|
|
278
209
|
role: 'status',
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { Capabilities, contributes } from '@dxos/app-framework';
|
|
6
|
-
import {
|
|
6
|
+
import { create } from '@dxos/live-object';
|
|
7
7
|
|
|
8
8
|
import { SPACE_PLUGIN } from '../meta';
|
|
9
9
|
import { type SpaceSettingsProps, SpaceSettingsSchema } from '../types';
|
|
10
10
|
|
|
11
11
|
export default () => {
|
|
12
|
-
const settings =
|
|
12
|
+
const settings = create<SpaceSettingsProps>({
|
|
13
13
|
showHidden: false,
|
|
14
14
|
});
|
|
15
15
|
|
|
@@ -6,7 +6,7 @@ import { contributes, createIntent, type PluginsContext, Capabilities, LayoutAct
|
|
|
6
6
|
import { SubscriptionList } from '@dxos/async';
|
|
7
7
|
import { Expando } from '@dxos/echo-schema';
|
|
8
8
|
import { scheduledEffect } from '@dxos/echo-signals/core';
|
|
9
|
-
import {
|
|
9
|
+
import { create } from '@dxos/live-object';
|
|
10
10
|
import { log } from '@dxos/log';
|
|
11
11
|
import { AttentionCapabilities } from '@dxos/plugin-attention';
|
|
12
12
|
import { ClientCapabilities } from '@dxos/plugin-client';
|
|
@@ -53,7 +53,7 @@ export default async (context: PluginsContext) => {
|
|
|
53
53
|
if (!spacesOrder) {
|
|
54
54
|
// TODO(wittjosiah): Cannot be a Folder because Spaces are not TypedObjects so can't be saved in the database.
|
|
55
55
|
// Instead, we store order as an array of space ids.
|
|
56
|
-
defaultSpace.db.add(
|
|
56
|
+
defaultSpace.db.add(create({ key: SHARED, order: [] }));
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
// Await missing objects.
|
|
@@ -14,9 +14,11 @@ import { SPACE_PLUGIN } from '../meta';
|
|
|
14
14
|
import { type PluginState } from '../types';
|
|
15
15
|
|
|
16
16
|
export default (context: PluginsContext) => {
|
|
17
|
+
const sections = context.requestCapabilities(SpaceCapabilities.SettingsSection);
|
|
17
18
|
const state = new LocalStorageStore<PluginState>(SPACE_PLUGIN, {
|
|
18
19
|
awaiting: undefined,
|
|
19
20
|
spaceNames: {},
|
|
21
|
+
spaceSettingsOpenSections: sections.map((section) => section.id),
|
|
20
22
|
viewersByObject: {},
|
|
21
23
|
// TODO(wittjosiah): Stop using (Complex)Map inside reactive object.
|
|
22
24
|
viewersByIdentity: new ComplexMap(PublicKey.hash),
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
7
|
import { useTranslation } from '@dxos/react-ui';
|
|
8
|
-
import { baseSurface,
|
|
8
|
+
import { baseSurface, descriptionText, mx } from '@dxos/react-ui-theme';
|
|
9
9
|
|
|
10
10
|
import { SPACE_PLUGIN } from '../meta';
|
|
11
11
|
import type { CollectionType } from '../types';
|
|
@@ -21,7 +21,10 @@ export const CollectionMain = ({ collection }: { collection: CollectionType }) =
|
|
|
21
21
|
>
|
|
22
22
|
<p
|
|
23
23
|
role='alert'
|
|
24
|
-
className={mx(
|
|
24
|
+
className={mx(
|
|
25
|
+
descriptionText,
|
|
26
|
+
'border border-dashed border-neutral-400/50 rounded-lg p-8 font-normal text-lg max-is-[24rem] break-words',
|
|
27
|
+
)}
|
|
25
28
|
>
|
|
26
29
|
{collection.name ?? t('unnamed collection label')}
|
|
27
30
|
</p>
|
|
@@ -7,7 +7,7 @@ import '@dxos-theme';
|
|
|
7
7
|
import { type Meta, type StoryObj } from '@storybook/react';
|
|
8
8
|
import React, { useEffect } from 'react';
|
|
9
9
|
|
|
10
|
-
import {
|
|
10
|
+
import { create, Filter, useQuery, useSpace } from '@dxos/react-client/echo';
|
|
11
11
|
import { withClientProvider } from '@dxos/react-client/testing';
|
|
12
12
|
import { Dialog } from '@dxos/react-ui';
|
|
13
13
|
import { osTranslations } from '@dxos/shell/react';
|
|
@@ -70,7 +70,7 @@ export const TargetCollection: StoryObj<typeof CreateObjectDialog> = {
|
|
|
70
70
|
|
|
71
71
|
useEffect(() => {
|
|
72
72
|
if (space) {
|
|
73
|
-
space.db.add(
|
|
73
|
+
space.db.add(create(CollectionType, { name: 'My Collection', objects: [], views: {} }));
|
|
74
74
|
}
|
|
75
75
|
}, [space]);
|
|
76
76
|
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
} from '@dxos/app-framework';
|
|
17
17
|
import { invariant } from '@dxos/invariant';
|
|
18
18
|
import { useClient } from '@dxos/react-client';
|
|
19
|
-
import { getSpace,
|
|
19
|
+
import { getSpace, isReactiveObject, isSpace, type ReactiveObject, useSpaces } from '@dxos/react-client/echo';
|
|
20
20
|
import { Button, Dialog, Icon, useTranslation } from '@dxos/react-ui';
|
|
21
21
|
|
|
22
22
|
import { CreateObjectPanel, type CreateObjectPanelProps } from './CreateObjectPanel';
|
|
@@ -27,7 +27,7 @@ import { type ObjectForm, SpaceAction } from '../../types';
|
|
|
27
27
|
export const CREATE_OBJECT_DIALOG = `${SPACE_PLUGIN}/CreateObjectDialog`;
|
|
28
28
|
|
|
29
29
|
export type CreateObjectDialogProps = Pick<CreateObjectPanelProps, 'target' | 'typename' | 'name'> & {
|
|
30
|
-
shouldNavigate?: (object:
|
|
30
|
+
shouldNavigate?: (object: ReactiveObject<any>) => boolean;
|
|
31
31
|
};
|
|
32
32
|
|
|
33
33
|
export const CreateObjectDialog = ({
|
|
@@ -72,7 +72,7 @@ export const CreateObjectDialog = ({
|
|
|
72
72
|
invariant(space, 'Missing space');
|
|
73
73
|
const result = await dispatch(form.getIntent(data, { space }));
|
|
74
74
|
const object = result.data?.object;
|
|
75
|
-
if (
|
|
75
|
+
if (isReactiveObject(object)) {
|
|
76
76
|
const addObjectIntent = createIntent(SpaceAction.AddObject, { target, object, hidden: form.hidden });
|
|
77
77
|
const shouldNavigate = _shouldNavigate ?? (() => true);
|
|
78
78
|
if (shouldNavigate(object)) {
|
|
@@ -4,20 +4,42 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { useCallback, useState } from 'react';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { Surface, isSurfaceAvailable, usePluginManager } from '@dxos/app-framework';
|
|
8
|
+
import { getTypeAnnotation, type TypeAnnotation, type S } from '@dxos/echo-schema';
|
|
8
9
|
import { invariant } from '@dxos/invariant';
|
|
9
10
|
import { type SpaceId, type Space } from '@dxos/react-client/echo';
|
|
10
11
|
import { Icon, type ThemedClassName, toLocalizedString, useTranslation } from '@dxos/react-ui';
|
|
11
|
-
import { Form } from '@dxos/react-ui-form';
|
|
12
|
+
import { Form, type InputProps } from '@dxos/react-ui-form';
|
|
12
13
|
import { SearchList } from '@dxos/react-ui-searchlist';
|
|
13
14
|
import { mx } from '@dxos/react-ui-theme';
|
|
14
15
|
import { isNonNullable, type MaybePromise } from '@dxos/util';
|
|
15
16
|
|
|
16
|
-
import { useInputSurfaceLookup } from '../../hooks';
|
|
17
17
|
import { SPACE_PLUGIN } from '../../meta';
|
|
18
18
|
import { type ObjectForm, type CollectionType } from '../../types';
|
|
19
19
|
import { getSpaceDisplayName } from '../../util';
|
|
20
20
|
|
|
21
|
+
// TODO(ZaymonFC): Move this if you find yourself needing it elsewhere.
|
|
22
|
+
/**
|
|
23
|
+
* Creates a surface input component based on plugin context.
|
|
24
|
+
* @param baseData Additional data that will be merged with form data and passed to the surface.
|
|
25
|
+
* This allows providing more context to the surface than what's available from the form itself.
|
|
26
|
+
*/
|
|
27
|
+
const useInputSurfaceLookup = (baseData?: Record<string, any>) => {
|
|
28
|
+
const pluginManager = usePluginManager();
|
|
29
|
+
|
|
30
|
+
return useCallback(
|
|
31
|
+
({ prop, schema, inputProps }: { prop: string; schema: S.Schema<any>; inputProps: InputProps }) => {
|
|
32
|
+
const composedData = { prop, schema, ...baseData };
|
|
33
|
+
if (!isSurfaceAvailable(pluginManager.context, { role: 'form-input', data: composedData })) {
|
|
34
|
+
return undefined;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return <Surface role='form-input' data={composedData} {...inputProps} />;
|
|
38
|
+
},
|
|
39
|
+
[pluginManager, baseData],
|
|
40
|
+
);
|
|
41
|
+
};
|
|
42
|
+
|
|
21
43
|
export type CreateObjectPanelProps = ThemedClassName<{
|
|
22
44
|
forms: ObjectForm[];
|
|
23
45
|
spaces: Space[];
|
|
@@ -10,7 +10,6 @@ import { type S } from '@dxos/echo-schema';
|
|
|
10
10
|
import { Button, Dialog, Icon, useTranslation } from '@dxos/react-ui';
|
|
11
11
|
import { Form } from '@dxos/react-ui-form';
|
|
12
12
|
|
|
13
|
-
import { useInputSurfaceLookup } from '../../hooks';
|
|
14
13
|
import { SPACE_PLUGIN } from '../../meta';
|
|
15
14
|
import { SpaceAction, SpaceForm } from '../../types';
|
|
16
15
|
|
|
@@ -24,8 +23,6 @@ export const CreateSpaceDialog = () => {
|
|
|
24
23
|
const { t } = useTranslation(SPACE_PLUGIN);
|
|
25
24
|
const { dispatch } = useIntentDispatcher();
|
|
26
25
|
|
|
27
|
-
const inputSurfaceLookup = useInputSurfaceLookup();
|
|
28
|
-
|
|
29
26
|
const handleCreateSpace = useCallback(
|
|
30
27
|
async (data: FormValues) => {
|
|
31
28
|
const program = Effect.gen(function* () {
|
|
@@ -57,7 +54,6 @@ export const CreateSpaceDialog = () => {
|
|
|
57
54
|
autoFocus
|
|
58
55
|
values={initialValues}
|
|
59
56
|
schema={SpaceForm}
|
|
60
|
-
lookupComponent={inputSurfaceLookup}
|
|
61
57
|
onSave={handleCreateSpace}
|
|
62
58
|
/>
|
|
63
59
|
</div>
|
|
@@ -3,16 +3,15 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { Check, X } from '@phosphor-icons/react';
|
|
6
|
-
import React, { type Dispatch, type SetStateAction,
|
|
6
|
+
import React, { type Dispatch, type SetStateAction, useMemo, useState } from 'react';
|
|
7
7
|
import { QR } from 'react-qr-rounded';
|
|
8
8
|
|
|
9
|
-
import { createIntent, useIntentDispatcher } from '@dxos/app-framework';
|
|
10
9
|
import { log } from '@dxos/log';
|
|
11
10
|
import { useConfig } from '@dxos/react-client';
|
|
12
11
|
import { fullyQualifiedId, useSpaceInvitations, type Space } from '@dxos/react-client/echo';
|
|
13
12
|
import { type CancellableInvitationObservable, Invitation, InvitationEncoder } from '@dxos/react-client/invitations';
|
|
14
|
-
import { Button, Clipboard, Icon,
|
|
15
|
-
import {
|
|
13
|
+
import { Button, Clipboard, Icon, useId, useTranslation } from '@dxos/react-ui';
|
|
14
|
+
import { ControlSection, ControlFrame, ControlFrameItem } from '@dxos/react-ui-form';
|
|
16
15
|
import { StackItem } from '@dxos/react-ui-stack';
|
|
17
16
|
import { getSize, mx } from '@dxos/react-ui-theme';
|
|
18
17
|
import {
|
|
@@ -28,8 +27,7 @@ import {
|
|
|
28
27
|
import { hexToEmoji } from '@dxos/util';
|
|
29
28
|
|
|
30
29
|
import { SPACE_PLUGIN } from '../meta';
|
|
31
|
-
import { CollectionType
|
|
32
|
-
import { COMPOSER_SPACE_LOCK } from '../util';
|
|
30
|
+
import { CollectionType } from '../types';
|
|
33
31
|
|
|
34
32
|
// TODO(wittjosiah): Copied from Shell.
|
|
35
33
|
const activeActionKey = 'dxos:react-shell/space-manager/active-action';
|
|
@@ -49,9 +47,8 @@ export const MembersContainer = ({
|
|
|
49
47
|
space: Space;
|
|
50
48
|
createInvitationUrl: (invitationCode: string) => string;
|
|
51
49
|
}) => {
|
|
52
|
-
const { t } = useTranslation(
|
|
50
|
+
const { t } = useTranslation('os');
|
|
53
51
|
const config = useConfig();
|
|
54
|
-
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
55
52
|
const invitations = useSpaceInvitations(space.key);
|
|
56
53
|
const visibleInvitations = invitations?.filter(
|
|
57
54
|
(invitation) => ![Invitation.State.CANCELLED].includes(invitation.get().state),
|
|
@@ -67,28 +64,20 @@ export const MembersContainer = ({
|
|
|
67
64
|
// TODO(wittjosiah): Track which was the most recently viewed object.
|
|
68
65
|
const target = space.properties[CollectionType.typename]?.target?.objects[0]?.target;
|
|
69
66
|
|
|
70
|
-
const locked = space.properties[COMPOSER_SPACE_LOCK];
|
|
71
|
-
const handleChangeLocked = useCallback(() => {
|
|
72
|
-
space.properties[COMPOSER_SPACE_LOCK] = !locked;
|
|
73
|
-
}, [locked, space]);
|
|
74
|
-
|
|
75
67
|
const inviteActions = useMemo(
|
|
76
68
|
(): Record<string, ActionMenuItem> => ({
|
|
77
69
|
inviteOne: {
|
|
78
|
-
label: t('invite one label'
|
|
79
|
-
description: t('invite one description'
|
|
70
|
+
label: t('invite one label'),
|
|
71
|
+
description: t('invite one description'),
|
|
80
72
|
icon: () => <Icon icon='ph--user-plus--regular' size={5} />,
|
|
81
73
|
testId: 'membersContainer.inviteOne',
|
|
82
|
-
onClick:
|
|
83
|
-
const
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
target: target && fullyQualifiedId(target),
|
|
90
|
-
}),
|
|
91
|
-
);
|
|
74
|
+
onClick: () => {
|
|
75
|
+
const invitation = space.share?.({
|
|
76
|
+
type: Invitation.Type.INTERACTIVE,
|
|
77
|
+
authMethod: Invitation.AuthMethod.SHARED_SECRET,
|
|
78
|
+
multiUse: false,
|
|
79
|
+
target: target && fullyQualifiedId(target),
|
|
80
|
+
});
|
|
92
81
|
if (invitation && config.values.runtime?.app?.env?.DX_ENVIRONMENT !== 'production') {
|
|
93
82
|
const subscription: ZenObservable.Subscription = invitation.subscribe((invitation) =>
|
|
94
83
|
handleInvitationEvent(invitation, subscription),
|
|
@@ -97,20 +86,17 @@ export const MembersContainer = ({
|
|
|
97
86
|
},
|
|
98
87
|
},
|
|
99
88
|
inviteMany: {
|
|
100
|
-
label: t('invite many label'
|
|
101
|
-
description: t('invite many description'
|
|
89
|
+
label: t('invite many label'),
|
|
90
|
+
description: t('invite many description'),
|
|
102
91
|
icon: () => <Icon icon='ph--users-three--regular' size={5} />,
|
|
103
92
|
testId: 'membersContainer.inviteMany',
|
|
104
|
-
onClick:
|
|
105
|
-
const
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
target: target && fullyQualifiedId(target),
|
|
112
|
-
}),
|
|
113
|
-
);
|
|
93
|
+
onClick: () => {
|
|
94
|
+
const invitation = space.share?.({
|
|
95
|
+
type: Invitation.Type.DELEGATED,
|
|
96
|
+
authMethod: Invitation.AuthMethod.KNOWN_PUBLIC_KEY,
|
|
97
|
+
multiUse: true,
|
|
98
|
+
target: target && fullyQualifiedId(target),
|
|
99
|
+
});
|
|
114
100
|
if (invitation && config.values.runtime?.app?.env?.DX_ENVIRONMENT !== 'production') {
|
|
115
101
|
const subscription: ZenObservable.Subscription = invitation.subscribe((invitation) =>
|
|
116
102
|
handleInvitationEvent(invitation, subscription),
|
|
@@ -132,50 +118,38 @@ export const MembersContainer = ({
|
|
|
132
118
|
|
|
133
119
|
return (
|
|
134
120
|
<Clipboard.Provider>
|
|
135
|
-
<StackItem.Content classNames='block overflow-y-auto'>
|
|
136
|
-
<
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
{
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
onChangeActiveAction={setActiveAction as Dispatch<SetStateAction<string>>}
|
|
164
|
-
data-testid='membersContainer.createInvitation'
|
|
165
|
-
/>
|
|
166
|
-
</>
|
|
167
|
-
)}
|
|
168
|
-
</ControlFrameItem>
|
|
121
|
+
<StackItem.Content classNames='p-2 block overflow-y-auto'>
|
|
122
|
+
<ControlSection
|
|
123
|
+
title={t('members verbose label', { ns: SPACE_PLUGIN })}
|
|
124
|
+
description={t('members description', { ns: SPACE_PLUGIN })}
|
|
125
|
+
>
|
|
126
|
+
<ControlFrame>
|
|
127
|
+
<ControlFrameItem title={t('members label', { ns: SPACE_PLUGIN })}>
|
|
128
|
+
<SpaceMemberList spaceKey={space.key} includeSelf />
|
|
129
|
+
</ControlFrameItem>
|
|
130
|
+
<ControlFrameItem title={t('invitations label', { ns: SPACE_PLUGIN })}>
|
|
131
|
+
{selectedInvitation && <InvitationSection {...selectedInvitation} onBack={handleBack} />}
|
|
132
|
+
{!selectedInvitation && (
|
|
133
|
+
<>
|
|
134
|
+
<p className='text-description mbe-2'>{t('space invitation description', { ns: SPACE_PLUGIN })}</p>
|
|
135
|
+
<InvitationList
|
|
136
|
+
className='mb-2'
|
|
137
|
+
send={handleSend}
|
|
138
|
+
invitations={visibleInvitations ?? []}
|
|
139
|
+
onClickRemove={(invitation) => invitation.cancel()}
|
|
140
|
+
createInvitationUrl={createInvitationUrl}
|
|
141
|
+
/>
|
|
142
|
+
<BifurcatedAction
|
|
143
|
+
actions={inviteActions}
|
|
144
|
+
activeAction={activeAction}
|
|
145
|
+
onChangeActiveAction={setActiveAction as Dispatch<SetStateAction<string>>}
|
|
146
|
+
data-testid='membersContainer.createInvitation'
|
|
147
|
+
/>
|
|
148
|
+
</>
|
|
169
149
|
)}
|
|
170
|
-
</
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
<ControlItemInput title={t('space locked label')} description={t('space locked description')}>
|
|
174
|
-
<Input.Switch checked={locked} onCheckedChange={handleChangeLocked} classNames='justify-self-end' />
|
|
175
|
-
</ControlItemInput>
|
|
176
|
-
</div>
|
|
177
|
-
</ControlSection>
|
|
178
|
-
</ControlPage>
|
|
150
|
+
</ControlFrameItem>
|
|
151
|
+
</ControlFrame>
|
|
152
|
+
</ControlSection>
|
|
179
153
|
</StackItem.Content>
|
|
180
154
|
</Clipboard.Provider>
|
|
181
155
|
);
|
|
@@ -16,7 +16,7 @@ export const PopoverAddSpace = () => {
|
|
|
16
16
|
const { t } = useTranslation(SPACE_PLUGIN);
|
|
17
17
|
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
18
18
|
return (
|
|
19
|
-
<div role='none' className='
|
|
19
|
+
<div role='none' className='grid grid-cols-1 gap-1 [&>button]:justify-start'>
|
|
20
20
|
<IconButton
|
|
21
21
|
variant='ghost'
|
|
22
22
|
label={t('create space label')}
|
|
@@ -24,10 +24,7 @@ export const PopoverAddSpace = () => {
|
|
|
24
24
|
onClick={() => {
|
|
25
25
|
void dispatch(createIntent(SpaceAction.OpenCreateSpace));
|
|
26
26
|
void dispatch(
|
|
27
|
-
createIntent(LayoutAction.UpdatePopover, {
|
|
28
|
-
part: 'popover',
|
|
29
|
-
options: { variant: 'react', anchorId: '', state: false },
|
|
30
|
-
}),
|
|
27
|
+
createIntent(LayoutAction.UpdatePopover, { part: 'popover', options: { anchorId: '', state: false } }),
|
|
31
28
|
);
|
|
32
29
|
}}
|
|
33
30
|
data-testid='spacePlugin.createSpace'
|
|
@@ -39,10 +36,7 @@ export const PopoverAddSpace = () => {
|
|
|
39
36
|
onClick={() => {
|
|
40
37
|
void dispatch(createIntent(SpaceAction.Join));
|
|
41
38
|
void dispatch(
|
|
42
|
-
createIntent(LayoutAction.UpdatePopover, {
|
|
43
|
-
part: 'popover',
|
|
44
|
-
options: { variant: 'react', anchorId: '', state: false },
|
|
45
|
-
}),
|
|
39
|
+
createIntent(LayoutAction.UpdatePopover, { part: 'popover', options: { anchorId: '', state: false } }),
|
|
46
40
|
);
|
|
47
41
|
}}
|
|
48
42
|
data-testid='spacePlugin.joinSpace'
|