@dxos/plugin-space 0.8.1 → 0.8.2-main.12df754
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-GMFCSOLG.mjs → app-graph-builder-J4PN5HOM.mjs} +60 -6
- package/dist/lib/browser/app-graph-builder-J4PN5HOM.mjs.map +7 -0
- package/dist/lib/browser/{app-graph-serializer-DSF2U3A5.mjs → app-graph-serializer-6WIAFHYK.mjs} +8 -8
- package/dist/lib/browser/app-graph-serializer-6WIAFHYK.mjs.map +7 -0
- package/dist/lib/browser/{chunk-LO5UL6RU.mjs → chunk-FSHDAPFY.mjs} +60 -141
- package/dist/lib/browser/chunk-FSHDAPFY.mjs.map +7 -0
- package/dist/lib/browser/{chunk-AYW4IDRT.mjs → chunk-KDNV4YRD.mjs} +11 -3
- package/dist/lib/browser/chunk-KDNV4YRD.mjs.map +7 -0
- package/dist/lib/browser/{chunk-JZXWPMLA.mjs → chunk-MHTZAZT2.mjs} +497 -639
- package/dist/lib/browser/chunk-MHTZAZT2.mjs.map +7 -0
- package/dist/lib/browser/{chunk-5BDV575R.mjs → chunk-MIJHUABE.mjs} +20 -8
- package/dist/lib/browser/chunk-MIJHUABE.mjs.map +7 -0
- package/dist/lib/browser/{identity-created-JR7BNXFH.mjs → identity-created-DVHNLGYU.mjs} +4 -4
- package/dist/lib/browser/identity-created-DVHNLGYU.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +11 -29
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-resolver-RKYILWWQ.mjs → intent-resolver-72IWBVYE.mjs} +23 -27
- package/dist/lib/browser/intent-resolver-72IWBVYE.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-root-6H7NX2M2.mjs → react-root-DRVM5ACV.mjs} +4 -4
- package/dist/lib/browser/{react-surface-7AGLOVMK.mjs → react-surface-KODNQYDN.mjs} +139 -48
- package/dist/lib/browser/react-surface-KODNQYDN.mjs.map +7 -0
- package/dist/lib/browser/{settings-PJPTJUPE.mjs → settings-2UIV5WX5.mjs} +4 -4
- package/dist/lib/browser/settings-2UIV5WX5.mjs.map +7 -0
- package/dist/lib/browser/{spaces-ready-BSSP7HHG.mjs → spaces-ready-3URIMLCR.mjs} +5 -5
- package/dist/lib/browser/spaces-ready-3URIMLCR.mjs.map +7 -0
- package/dist/lib/browser/{state-X7VLCC6E.mjs → state-CYV6QCTN.mjs} +1 -3
- package/dist/lib/browser/state-CYV6QCTN.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +7 -1
- package/dist/lib/node/{app-graph-builder-DPY7AUZE.cjs → app-graph-builder-3BNPC5GB.cjs} +82 -29
- package/dist/lib/node/app-graph-builder-3BNPC5GB.cjs.map +7 -0
- package/dist/lib/node/{app-graph-serializer-JELGJUAY.cjs → app-graph-serializer-GOLCQHFQ.cjs} +20 -20
- package/dist/lib/node/app-graph-serializer-GOLCQHFQ.cjs.map +7 -0
- package/dist/lib/node/{chunk-WDEIFDTX.cjs → chunk-3UKLWXNJ.cjs} +17 -6
- package/dist/lib/node/chunk-3UKLWXNJ.cjs.map +7 -0
- package/dist/lib/node/{chunk-PU2EYH4E.cjs → chunk-EI3ZPOLJ.cjs} +24 -12
- package/dist/lib/node/chunk-EI3ZPOLJ.cjs.map +7 -0
- package/dist/lib/node/{chunk-3GKCNADA.cjs → chunk-GPZPEQXP.cjs} +482 -622
- package/dist/lib/node/chunk-GPZPEQXP.cjs.map +7 -0
- package/dist/lib/node/{chunk-TUZWEPGX.cjs → chunk-U63V2254.cjs} +84 -167
- package/dist/lib/node/chunk-U63V2254.cjs.map +7 -0
- package/dist/lib/node/{identity-created-XU4HFV2T.cjs → identity-created-YYTW4K3Z.cjs} +6 -6
- package/dist/lib/node/identity-created-YYTW4K3Z.cjs.map +7 -0
- package/dist/lib/node/index.cjs +69 -87
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/{intent-resolver-VJ7YV74L.cjs → intent-resolver-KA56XGUX.cjs} +75 -79
- package/dist/lib/node/intent-resolver-KA56XGUX.cjs.map +7 -0
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/{react-root-TEL5RW3N.cjs → react-root-6WGN5WRQ.cjs} +8 -8
- package/dist/lib/node/{react-surface-2H3S5TY5.cjs → react-surface-37AVZFPL.cjs} +163 -74
- package/dist/lib/node/react-surface-37AVZFPL.cjs.map +7 -0
- package/dist/lib/node/{settings-WVFP2UEP.cjs → settings-HJROTHC4.cjs} +7 -7
- package/dist/lib/node/settings-HJROTHC4.cjs.map +7 -0
- package/dist/lib/node/{spaces-ready-7DNZSUOG.cjs → spaces-ready-IWDDIAAD.cjs} +12 -12
- package/dist/lib/node/spaces-ready-IWDDIAAD.cjs.map +7 -0
- package/dist/lib/node/{state-5KX6WBJH.cjs → state-JLN7TGRR.cjs} +4 -6
- package/dist/lib/node/state-JLN7TGRR.cjs.map +7 -0
- package/dist/lib/node/types/index.cjs +18 -12
- package/dist/lib/node/types/index.cjs.map +2 -2
- package/dist/lib/node-esm/{app-graph-builder-42IGWRPL.mjs → app-graph-builder-OVMSUAX3.mjs} +60 -6
- package/dist/lib/node-esm/app-graph-builder-OVMSUAX3.mjs.map +7 -0
- package/dist/lib/node-esm/{app-graph-serializer-FXONFKOE.mjs → app-graph-serializer-AZXSO7HK.mjs} +8 -8
- package/dist/lib/node-esm/app-graph-serializer-AZXSO7HK.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-FC4UHDPL.mjs → chunk-35OHQARN.mjs} +11 -3
- package/dist/lib/node-esm/chunk-35OHQARN.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-BEWBZ4Q4.mjs → chunk-ABKX22IP.mjs} +497 -639
- package/dist/lib/node-esm/chunk-ABKX22IP.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-3ZOUV4DF.mjs → chunk-DUA32XUX.mjs} +20 -8
- package/dist/lib/node-esm/chunk-DUA32XUX.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-ZGLK25WQ.mjs → chunk-TVN6VHTT.mjs} +60 -141
- package/dist/lib/node-esm/chunk-TVN6VHTT.mjs.map +7 -0
- package/dist/lib/node-esm/{identity-created-WJKAS2PV.mjs → identity-created-MP4GLXHO.mjs} +4 -4
- package/dist/lib/node-esm/identity-created-MP4GLXHO.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +11 -29
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/{intent-resolver-ZFNSA4CM.mjs → intent-resolver-SG2ECM5R.mjs} +23 -27
- package/dist/lib/node-esm/intent-resolver-SG2ECM5R.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-root-PRBJMWLQ.mjs → react-root-MSUT6S2S.mjs} +4 -4
- package/dist/lib/node-esm/{react-surface-RCZG2PNF.mjs → react-surface-G73SO23W.mjs} +139 -48
- package/dist/lib/node-esm/react-surface-G73SO23W.mjs.map +7 -0
- package/dist/lib/node-esm/{settings-FJZPC2TV.mjs → settings-KCLKPJVY.mjs} +4 -4
- package/dist/lib/node-esm/settings-KCLKPJVY.mjs.map +7 -0
- package/dist/lib/node-esm/{spaces-ready-7X5PGB2V.mjs → spaces-ready-Z3SXKWX2.mjs} +5 -5
- package/dist/lib/node-esm/spaces-ready-Z3SXKWX2.mjs.map +7 -0
- package/dist/lib/node-esm/{state-Z6E2YTNC.mjs → state-YZPY5T5A.mjs} +1 -3
- package/dist/lib/node-esm/state-YZPY5T5A.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +7 -1
- 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/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/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/ObjectSettings/AdvancedObjectSettings.d.ts.map +1 -0
- package/dist/types/src/components/ObjectSettings/BaseObjectSettings.d.ts.map +1 -0
- package/dist/types/src/components/ObjectSettings/ForeignKeys.d.ts.map +1 -0
- package/dist/types/src/components/ObjectSettings/ObjectSettingsContainer.d.ts.map +1 -0
- package/dist/types/src/components/ObjectSettings/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/SchemaContainer.d.ts +13 -0
- package/dist/types/src/components/SchemaContainer.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/SpaceSettingsContainer.d.ts +0 -2
- package/dist/types/src/components/SpaceSettings/SpaceSettingsContainer.d.ts.map +1 -1
- package/dist/types/src/components/SpaceSettings/SpaceSettingsContainer.stories.d.ts +7 -0
- package/dist/types/src/components/SpaceSettings/SpaceSettingsContainer.stories.d.ts.map +1 -0
- package/dist/types/src/components/SpaceSettings/index.d.ts +0 -1
- 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/SyncStatus.d.ts +1 -8
- package/dist/types/src/components/SyncStatus/SyncStatus.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +2 -1
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/hooks/index.d.ts +1 -0
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useInputSurfaceLookup.d.ts +14 -0
- package/dist/types/src/hooks/useInputSurfaceLookup.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +45 -9
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +12 -13
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/src/util.d.ts +27 -5
- package/dist/types/src/util.d.ts.map +1 -1
- package/package.json +44 -43
- package/src/SpacePlugin.tsx +2 -12
- package/src/capabilities/app-graph-builder.ts +43 -4
- package/src/capabilities/app-graph-serializer.ts +4 -4
- package/src/capabilities/identity-created.ts +2 -2
- package/src/capabilities/intent-resolver.ts +14 -20
- package/src/capabilities/react-surface.tsx +120 -38
- package/src/capabilities/settings.ts +2 -2
- package/src/capabilities/spaces-ready.ts +2 -2
- package/src/capabilities/state.ts +0 -2
- package/src/components/CreateDialog/CreateObjectDialog.stories.tsx +2 -2
- package/src/components/CreateDialog/CreateObjectDialog.tsx +3 -3
- package/src/components/CreateDialog/CreateObjectPanel.tsx +3 -25
- package/src/components/CreateDialog/CreateSpaceDialog.tsx +4 -0
- package/src/components/MembersContainer.tsx +57 -39
- package/src/components/PopoverAddSpace.tsx +8 -2
- package/src/components/PopoverRenameObject.tsx +2 -2
- package/src/components/SchemaContainer.tsx +59 -0
- package/src/components/SpacePluginSettings.tsx +27 -2
- package/src/components/SpacePresence.tsx +29 -25
- package/src/components/SpaceSettings/{SpacePropertiesForm.stories.tsx → SpaceSettingsContainer.stories.tsx} +6 -6
- package/src/components/SpaceSettings/SpaceSettingsContainer.tsx +157 -39
- package/src/components/SpaceSettings/index.ts +0 -1
- package/src/components/SyncStatus/InlineSyncStatus.tsx +5 -7
- package/src/components/SyncStatus/SyncStatus.tsx +6 -69
- package/src/components/index.ts +2 -1
- package/src/hooks/index.ts +1 -0
- package/src/hooks/useInputSurfaceLookup.tsx +31 -0
- package/src/translations.ts +18 -5
- package/src/types/types.ts +8 -7
- package/src/util.tsx +43 -103
- package/dist/lib/browser/app-graph-builder-GMFCSOLG.mjs.map +0 -7
- package/dist/lib/browser/app-graph-serializer-DSF2U3A5.mjs.map +0 -7
- package/dist/lib/browser/chunk-5BDV575R.mjs.map +0 -7
- package/dist/lib/browser/chunk-AYW4IDRT.mjs.map +0 -7
- package/dist/lib/browser/chunk-JZXWPMLA.mjs.map +0 -7
- package/dist/lib/browser/chunk-LO5UL6RU.mjs.map +0 -7
- package/dist/lib/browser/identity-created-JR7BNXFH.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-RKYILWWQ.mjs.map +0 -7
- package/dist/lib/browser/react-surface-7AGLOVMK.mjs.map +0 -7
- package/dist/lib/browser/settings-PJPTJUPE.mjs.map +0 -7
- package/dist/lib/browser/spaces-ready-BSSP7HHG.mjs.map +0 -7
- package/dist/lib/browser/state-X7VLCC6E.mjs.map +0 -7
- package/dist/lib/node/app-graph-builder-DPY7AUZE.cjs.map +0 -7
- package/dist/lib/node/app-graph-serializer-JELGJUAY.cjs.map +0 -7
- package/dist/lib/node/chunk-3GKCNADA.cjs.map +0 -7
- package/dist/lib/node/chunk-PU2EYH4E.cjs.map +0 -7
- package/dist/lib/node/chunk-TUZWEPGX.cjs.map +0 -7
- package/dist/lib/node/chunk-WDEIFDTX.cjs.map +0 -7
- package/dist/lib/node/identity-created-XU4HFV2T.cjs.map +0 -7
- package/dist/lib/node/intent-resolver-VJ7YV74L.cjs.map +0 -7
- package/dist/lib/node/react-surface-2H3S5TY5.cjs.map +0 -7
- package/dist/lib/node/settings-WVFP2UEP.cjs.map +0 -7
- package/dist/lib/node/spaces-ready-7DNZSUOG.cjs.map +0 -7
- package/dist/lib/node/state-5KX6WBJH.cjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-42IGWRPL.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-serializer-FXONFKOE.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-3ZOUV4DF.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-BEWBZ4Q4.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-FC4UHDPL.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-ZGLK25WQ.mjs.map +0 -7
- package/dist/lib/node-esm/identity-created-WJKAS2PV.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-ZFNSA4CM.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-RCZG2PNF.mjs.map +0 -7
- package/dist/lib/node-esm/settings-FJZPC2TV.mjs.map +0 -7
- package/dist/lib/node-esm/spaces-ready-7X5PGB2V.mjs.map +0 -7
- package/dist/lib/node-esm/state-Z6E2YTNC.mjs.map +0 -7
- package/dist/types/src/components/ObjectSettingsContainer/AdvancedObjectSettings.d.ts.map +0 -1
- package/dist/types/src/components/ObjectSettingsContainer/BaseObjectSettings.d.ts.map +0 -1
- package/dist/types/src/components/ObjectSettingsContainer/ForeignKeys.d.ts.map +0 -1
- package/dist/types/src/components/ObjectSettingsContainer/ObjectSettingsContainer.d.ts.map +0 -1
- package/dist/types/src/components/ObjectSettingsContainer/index.d.ts.map +0 -1
- package/dist/types/src/components/SpaceSettings/SpacePropertiesForm.d.ts +0 -7
- package/dist/types/src/components/SpaceSettings/SpacePropertiesForm.d.ts.map +0 -1
- package/dist/types/src/components/SpaceSettings/SpacePropertiesForm.stories.d.ts +0 -7
- package/dist/types/src/components/SpaceSettings/SpacePropertiesForm.stories.d.ts.map +0 -1
- package/dist/types/src/components/SyncStatus/Space.d.ts +0 -13
- package/dist/types/src/components/SyncStatus/Space.d.ts.map +0 -1
- package/dist/types/src/components/SyncStatus/SyncStatusDetail.stories.d.ts +0 -9
- package/dist/types/src/components/SyncStatus/SyncStatusDetail.stories.d.ts.map +0 -1
- package/dist/types/src/components/SyncStatus/sync-state.d.ts +0 -18
- package/dist/types/src/components/SyncStatus/sync-state.d.ts.map +0 -1
- package/src/components/SpaceSettings/SpacePropertiesForm.tsx +0 -136
- package/src/components/SyncStatus/Space.tsx +0 -133
- package/src/components/SyncStatus/SyncStatusDetail.stories.tsx +0 -89
- package/src/components/SyncStatus/sync-state.ts +0 -101
- /package/dist/lib/browser/{react-root-6H7NX2M2.mjs.map → react-root-DRVM5ACV.mjs.map} +0 -0
- /package/dist/lib/node/{react-root-TEL5RW3N.cjs.map → react-root-6WGN5WRQ.cjs.map} +0 -0
- /package/dist/lib/node-esm/{react-root-PRBJMWLQ.mjs.map → react-root-MSUT6S2S.mjs.map} +0 -0
- /package/dist/types/src/components/{ObjectSettingsContainer → ObjectSettings}/AdvancedObjectSettings.d.ts +0 -0
- /package/dist/types/src/components/{ObjectSettingsContainer → ObjectSettings}/BaseObjectSettings.d.ts +0 -0
- /package/dist/types/src/components/{ObjectSettingsContainer → ObjectSettings}/ForeignKeys.d.ts +0 -0
- /package/dist/types/src/components/{ObjectSettingsContainer → ObjectSettings}/ObjectSettingsContainer.d.ts +0 -0
- /package/dist/types/src/components/{ObjectSettingsContainer → ObjectSettings}/index.d.ts +0 -0
- /package/src/components/{ObjectSettingsContainer → ObjectSettings}/AdvancedObjectSettings.tsx +0 -0
- /package/src/components/{ObjectSettingsContainer → ObjectSettings}/BaseObjectSettings.tsx +0 -0
- /package/src/components/{ObjectSettingsContainer → ObjectSettings}/ForeignKeys.tsx +0 -0
- /package/src/components/{ObjectSettingsContainer → ObjectSettings}/ObjectSettingsContainer.tsx +0 -0
- /package/src/components/{ObjectSettingsContainer → ObjectSettings}/index.ts +0 -0
|
@@ -14,11 +14,9 @@ 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);
|
|
18
17
|
const state = new LocalStorageStore<PluginState>(SPACE_PLUGIN, {
|
|
19
18
|
awaiting: undefined,
|
|
20
19
|
spaceNames: {},
|
|
21
|
-
spaceSettingsOpenSections: sections.map((section) => section.id),
|
|
22
20
|
viewersByObject: {},
|
|
23
21
|
// TODO(wittjosiah): Stop using (Complex)Map inside reactive object.
|
|
24
22
|
viewersByIdentity: new ComplexMap(PublicKey.hash),
|
|
@@ -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 { live, 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(live(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, isLiveObject, isSpace, type Live, 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: Live<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 (isLiveObject(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,42 +4,20 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { useCallback, useState } from 'react';
|
|
6
6
|
|
|
7
|
-
import {
|
|
8
|
-
import { getTypeAnnotation, type TypeAnnotation, type S } from '@dxos/echo-schema';
|
|
7
|
+
import { getTypeAnnotation, type TypeAnnotation } from '@dxos/echo-schema';
|
|
9
8
|
import { invariant } from '@dxos/invariant';
|
|
10
9
|
import { type SpaceId, type Space } from '@dxos/react-client/echo';
|
|
11
10
|
import { Icon, type ThemedClassName, toLocalizedString, useTranslation } from '@dxos/react-ui';
|
|
12
|
-
import { Form
|
|
11
|
+
import { Form } from '@dxos/react-ui-form';
|
|
13
12
|
import { SearchList } from '@dxos/react-ui-searchlist';
|
|
14
13
|
import { mx } from '@dxos/react-ui-theme';
|
|
15
14
|
import { isNonNullable, type MaybePromise } from '@dxos/util';
|
|
16
15
|
|
|
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
|
-
|
|
43
21
|
export type CreateObjectPanelProps = ThemedClassName<{
|
|
44
22
|
forms: ObjectForm[];
|
|
45
23
|
spaces: Space[];
|
|
@@ -10,6 +10,7 @@ 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';
|
|
13
14
|
import { SPACE_PLUGIN } from '../../meta';
|
|
14
15
|
import { SpaceAction, SpaceForm } from '../../types';
|
|
15
16
|
|
|
@@ -23,6 +24,8 @@ export const CreateSpaceDialog = () => {
|
|
|
23
24
|
const { t } = useTranslation(SPACE_PLUGIN);
|
|
24
25
|
const { dispatch } = useIntentDispatcher();
|
|
25
26
|
|
|
27
|
+
const inputSurfaceLookup = useInputSurfaceLookup();
|
|
28
|
+
|
|
26
29
|
const handleCreateSpace = useCallback(
|
|
27
30
|
async (data: FormValues) => {
|
|
28
31
|
const program = Effect.gen(function* () {
|
|
@@ -54,6 +57,7 @@ export const CreateSpaceDialog = () => {
|
|
|
54
57
|
autoFocus
|
|
55
58
|
values={initialValues}
|
|
56
59
|
schema={SpaceForm}
|
|
60
|
+
lookupComponent={inputSurfaceLookup}
|
|
57
61
|
onSave={handleCreateSpace}
|
|
58
62
|
/>
|
|
59
63
|
</div>
|
|
@@ -3,15 +3,15 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { Check, X } from '@phosphor-icons/react';
|
|
6
|
-
import React, { type Dispatch, type SetStateAction, useMemo, useState } from 'react';
|
|
6
|
+
import React, { type Dispatch, type SetStateAction, useCallback, useMemo, useState } from 'react';
|
|
7
7
|
import { QR } from 'react-qr-rounded';
|
|
8
8
|
|
|
9
9
|
import { log } from '@dxos/log';
|
|
10
10
|
import { useConfig } from '@dxos/react-client';
|
|
11
11
|
import { fullyQualifiedId, useSpaceInvitations, type Space } from '@dxos/react-client/echo';
|
|
12
12
|
import { type CancellableInvitationObservable, Invitation, InvitationEncoder } from '@dxos/react-client/invitations';
|
|
13
|
-
import { Button, Clipboard, Icon, useId, useTranslation } from '@dxos/react-ui';
|
|
14
|
-
import { ControlSection, ControlFrame, ControlFrameItem } from '@dxos/react-ui-form';
|
|
13
|
+
import { Button, Clipboard, Icon, Input, useId, useTranslation } from '@dxos/react-ui';
|
|
14
|
+
import { ControlPage, ControlSection, ControlFrame, ControlFrameItem, ControlItemInput } from '@dxos/react-ui-form';
|
|
15
15
|
import { StackItem } from '@dxos/react-ui-stack';
|
|
16
16
|
import { getSize, mx } from '@dxos/react-ui-theme';
|
|
17
17
|
import {
|
|
@@ -28,6 +28,7 @@ import { hexToEmoji } from '@dxos/util';
|
|
|
28
28
|
|
|
29
29
|
import { SPACE_PLUGIN } from '../meta';
|
|
30
30
|
import { CollectionType } from '../types';
|
|
31
|
+
import { COMPOSER_SPACE_LOCK } from '../util';
|
|
31
32
|
|
|
32
33
|
// TODO(wittjosiah): Copied from Shell.
|
|
33
34
|
const activeActionKey = 'dxos:react-shell/space-manager/active-action';
|
|
@@ -47,7 +48,7 @@ export const MembersContainer = ({
|
|
|
47
48
|
space: Space;
|
|
48
49
|
createInvitationUrl: (invitationCode: string) => string;
|
|
49
50
|
}) => {
|
|
50
|
-
const { t } = useTranslation(
|
|
51
|
+
const { t } = useTranslation(SPACE_PLUGIN);
|
|
51
52
|
const config = useConfig();
|
|
52
53
|
const invitations = useSpaceInvitations(space.key);
|
|
53
54
|
const visibleInvitations = invitations?.filter(
|
|
@@ -64,11 +65,16 @@ export const MembersContainer = ({
|
|
|
64
65
|
// TODO(wittjosiah): Track which was the most recently viewed object.
|
|
65
66
|
const target = space.properties[CollectionType.typename]?.target?.objects[0]?.target;
|
|
66
67
|
|
|
68
|
+
const locked = space.properties[COMPOSER_SPACE_LOCK];
|
|
69
|
+
const handleChangeLocked = useCallback(() => {
|
|
70
|
+
space.properties[COMPOSER_SPACE_LOCK] = !locked;
|
|
71
|
+
}, [locked, space]);
|
|
72
|
+
|
|
67
73
|
const inviteActions = useMemo(
|
|
68
74
|
(): Record<string, ActionMenuItem> => ({
|
|
69
75
|
inviteOne: {
|
|
70
|
-
label: t('invite one label'),
|
|
71
|
-
description: t('invite one description'),
|
|
76
|
+
label: t('invite one label', { ns: 'os' }),
|
|
77
|
+
description: t('invite one description', { ns: 'os' }),
|
|
72
78
|
icon: () => <Icon icon='ph--user-plus--regular' size={5} />,
|
|
73
79
|
testId: 'membersContainer.inviteOne',
|
|
74
80
|
onClick: () => {
|
|
@@ -86,8 +92,8 @@ export const MembersContainer = ({
|
|
|
86
92
|
},
|
|
87
93
|
},
|
|
88
94
|
inviteMany: {
|
|
89
|
-
label: t('invite many label'),
|
|
90
|
-
description: t('invite many description'),
|
|
95
|
+
label: t('invite many label', { ns: 'os' }),
|
|
96
|
+
description: t('invite many description', { ns: 'os' }),
|
|
91
97
|
icon: () => <Icon icon='ph--users-three--regular' size={5} />,
|
|
92
98
|
testId: 'membersContainer.inviteMany',
|
|
93
99
|
onClick: () => {
|
|
@@ -118,38 +124,50 @@ export const MembersContainer = ({
|
|
|
118
124
|
|
|
119
125
|
return (
|
|
120
126
|
<Clipboard.Provider>
|
|
121
|
-
<StackItem.Content classNames='
|
|
122
|
-
<
|
|
123
|
-
title={t('members verbose label'
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
<
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
127
|
+
<StackItem.Content classNames='block overflow-y-auto'>
|
|
128
|
+
<ControlPage>
|
|
129
|
+
<ControlSection title={t('members verbose label')} description={t('members description')}>
|
|
130
|
+
<ControlFrame>
|
|
131
|
+
<ControlFrameItem title={t('members label')}>
|
|
132
|
+
<SpaceMemberList spaceKey={space.key} includeSelf />
|
|
133
|
+
</ControlFrameItem>
|
|
134
|
+
{locked && (
|
|
135
|
+
<ControlFrameItem title={t('invitations label')}>
|
|
136
|
+
<p className='text-description mbe-2'>{t('locked space description')}</p>
|
|
137
|
+
</ControlFrameItem>
|
|
138
|
+
)}
|
|
139
|
+
{!locked && (
|
|
140
|
+
<ControlFrameItem title={t('invitations label')}>
|
|
141
|
+
{selectedInvitation && <InvitationSection {...selectedInvitation} onBack={handleBack} />}
|
|
142
|
+
{!selectedInvitation && (
|
|
143
|
+
<>
|
|
144
|
+
<p className='text-description mbe-2'>{t('space invitation description')}</p>
|
|
145
|
+
<InvitationList
|
|
146
|
+
className='mb-2'
|
|
147
|
+
send={handleSend}
|
|
148
|
+
invitations={visibleInvitations ?? []}
|
|
149
|
+
onClickRemove={(invitation) => invitation.cancel()}
|
|
150
|
+
createInvitationUrl={createInvitationUrl}
|
|
151
|
+
/>
|
|
152
|
+
<BifurcatedAction
|
|
153
|
+
actions={inviteActions}
|
|
154
|
+
activeAction={activeAction}
|
|
155
|
+
onChangeActiveAction={setActiveAction as Dispatch<SetStateAction<string>>}
|
|
156
|
+
data-testid='membersContainer.createInvitation'
|
|
157
|
+
/>
|
|
158
|
+
</>
|
|
159
|
+
)}
|
|
160
|
+
</ControlFrameItem>
|
|
149
161
|
)}
|
|
150
|
-
</
|
|
151
|
-
|
|
152
|
-
|
|
162
|
+
</ControlFrame>
|
|
163
|
+
{/* TODO(wittjosiah): Make ControlItemInput & ControlFrame compatible. */}
|
|
164
|
+
<div className='justify-center gap-4 p-0 mbs-4 container-max-width grid grid-cols-1 md:grid-cols-[1fr_min-content]'>
|
|
165
|
+
<ControlItemInput title={t('space locked label')} description={t('space locked description')}>
|
|
166
|
+
<Input.Switch checked={locked} onCheckedChange={handleChangeLocked} classNames='justify-self-end' />
|
|
167
|
+
</ControlItemInput>
|
|
168
|
+
</div>
|
|
169
|
+
</ControlSection>
|
|
170
|
+
</ControlPage>
|
|
153
171
|
</StackItem.Content>
|
|
154
172
|
</Clipboard.Provider>
|
|
155
173
|
);
|
|
@@ -24,7 +24,10 @@ export const PopoverAddSpace = () => {
|
|
|
24
24
|
onClick={() => {
|
|
25
25
|
void dispatch(createIntent(SpaceAction.OpenCreateSpace));
|
|
26
26
|
void dispatch(
|
|
27
|
-
createIntent(LayoutAction.UpdatePopover, {
|
|
27
|
+
createIntent(LayoutAction.UpdatePopover, {
|
|
28
|
+
part: 'popover',
|
|
29
|
+
options: { variant: 'react', anchorId: '', state: false },
|
|
30
|
+
}),
|
|
28
31
|
);
|
|
29
32
|
}}
|
|
30
33
|
data-testid='spacePlugin.createSpace'
|
|
@@ -36,7 +39,10 @@ export const PopoverAddSpace = () => {
|
|
|
36
39
|
onClick={() => {
|
|
37
40
|
void dispatch(createIntent(SpaceAction.Join));
|
|
38
41
|
void dispatch(
|
|
39
|
-
createIntent(LayoutAction.UpdatePopover, {
|
|
42
|
+
createIntent(LayoutAction.UpdatePopover, {
|
|
43
|
+
part: 'popover',
|
|
44
|
+
options: { variant: 'react', anchorId: '', state: false },
|
|
45
|
+
}),
|
|
40
46
|
);
|
|
41
47
|
}}
|
|
42
48
|
data-testid='spacePlugin.joinSpace'
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { useCallback, useRef, useState } from 'react';
|
|
6
6
|
|
|
7
|
-
import { type
|
|
7
|
+
import { type Live } from '@dxos/live-object';
|
|
8
8
|
import { log } from '@dxos/log';
|
|
9
9
|
import { Button, Input, Popover, useTranslation } from '@dxos/react-ui';
|
|
10
10
|
|
|
@@ -12,7 +12,7 @@ import { SPACE_PLUGIN } from '../meta';
|
|
|
12
12
|
|
|
13
13
|
export const POPOVER_RENAME_OBJECT = `${SPACE_PLUGIN}/PopoverRenameObject`;
|
|
14
14
|
|
|
15
|
-
export const PopoverRenameObject = ({ object: obj }: { object:
|
|
15
|
+
export const PopoverRenameObject = ({ object: obj }: { object: Live<any> }) => {
|
|
16
16
|
const { t } = useTranslation(SPACE_PLUGIN);
|
|
17
17
|
const doneButton = useRef<HTMLButtonElement>(null);
|
|
18
18
|
// TODO(wittjosiah): Use schema here.
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React, { useState, useEffect } from 'react';
|
|
6
|
+
|
|
7
|
+
import { type EchoSchema } from '@dxos/echo-schema';
|
|
8
|
+
import { type Space } from '@dxos/react-client/echo';
|
|
9
|
+
import { useTranslation } from '@dxos/react-ui';
|
|
10
|
+
import { controlItemClasses, ControlPage, ControlSection } from '@dxos/react-ui-form';
|
|
11
|
+
import { StackItem } from '@dxos/react-ui-stack';
|
|
12
|
+
|
|
13
|
+
import { SPACE_PLUGIN } from '../meta';
|
|
14
|
+
|
|
15
|
+
type SchemaPanelProps = { space: Space };
|
|
16
|
+
|
|
17
|
+
// TODO(ZaymonFC):
|
|
18
|
+
// - Support deleting Schema. This should tie in to some sort of
|
|
19
|
+
// 'DangerZone™️' / 'Are you really sure?' / 'this might have consequences' component.
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Subscribe to and retrieve all schemas from a space's schema registry.
|
|
23
|
+
*/
|
|
24
|
+
export const useQuerySpaceSchemas = (space: Space): EchoSchema[] => {
|
|
25
|
+
const [schemas, setSchemas] = useState<EchoSchema[]>([]);
|
|
26
|
+
|
|
27
|
+
useEffect(() => {
|
|
28
|
+
const query = space.db.schemaRegistry.query();
|
|
29
|
+
const initialResults = query.runSync();
|
|
30
|
+
setSchemas(initialResults);
|
|
31
|
+
|
|
32
|
+
const unsubscribe = query.subscribe(() => setSchemas(query.results));
|
|
33
|
+
return () => unsubscribe();
|
|
34
|
+
}, [space]);
|
|
35
|
+
|
|
36
|
+
return schemas;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export const SchemaContainer = ({ space }: SchemaPanelProps) => {
|
|
40
|
+
const { t } = useTranslation(SPACE_PLUGIN);
|
|
41
|
+
const schemas = useQuerySpaceSchemas(space);
|
|
42
|
+
|
|
43
|
+
return (
|
|
44
|
+
<StackItem.Content classNames='block overflow-y-auto'>
|
|
45
|
+
<ControlPage>
|
|
46
|
+
<ControlSection title={t('schema verbose label')} description={t('schema description')}>
|
|
47
|
+
<div role='none' className={controlItemClasses}>
|
|
48
|
+
{schemas.length === 0 && <div className='text-center plb-4'>{t('no schemas found message')}</div>}
|
|
49
|
+
{schemas.map((schema) => (
|
|
50
|
+
<div key={schema.id}>
|
|
51
|
+
<div>{schema.typename}</div>
|
|
52
|
+
</div>
|
|
53
|
+
))}
|
|
54
|
+
</div>
|
|
55
|
+
</ControlSection>
|
|
56
|
+
</ControlPage>
|
|
57
|
+
</StackItem.Content>
|
|
58
|
+
);
|
|
59
|
+
};
|
|
@@ -4,20 +4,45 @@
|
|
|
4
4
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { createIntent, useIntentDispatcher } from '@dxos/app-framework';
|
|
8
|
+
import { useClient } from '@dxos/react-client';
|
|
9
|
+
import { useSpaces } from '@dxos/react-client/echo';
|
|
10
|
+
import { Input, toLocalizedString, useTranslation, List, ListItem, Button } from '@dxos/react-ui';
|
|
8
11
|
import { DeprecatedFormContainer, DeprecatedFormInput } from '@dxos/react-ui-form';
|
|
9
12
|
|
|
10
13
|
import { SPACE_PLUGIN } from '../meta';
|
|
11
|
-
import { type SpaceSettingsProps } from '../types';
|
|
14
|
+
import { SpaceAction, type SpaceSettingsProps } from '../types';
|
|
15
|
+
import { getSpaceDisplayName } from '../util';
|
|
12
16
|
|
|
13
17
|
export const SpacePluginSettings = ({ settings }: { settings: SpaceSettingsProps }) => {
|
|
14
18
|
const { t } = useTranslation(SPACE_PLUGIN);
|
|
19
|
+
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
20
|
+
const client = useClient();
|
|
21
|
+
const spaces = useSpaces({ all: settings.showHidden });
|
|
15
22
|
|
|
23
|
+
// TODO(wittjosiah): Migrate to new form container.
|
|
16
24
|
return (
|
|
17
25
|
<DeprecatedFormContainer>
|
|
18
26
|
<DeprecatedFormInput label={t('show hidden spaces label')}>
|
|
19
27
|
<Input.Switch checked={settings.showHidden} onCheckedChange={(checked) => (settings.showHidden = !!checked)} />
|
|
20
28
|
</DeprecatedFormInput>
|
|
29
|
+
<div role='none'>
|
|
30
|
+
<h2 className='text-xl my-4'>Space Settings</h2>
|
|
31
|
+
<List classNames='max-w-md mx-auto'>
|
|
32
|
+
{spaces.map((space) => (
|
|
33
|
+
<ListItem.Root key={space.id}>
|
|
34
|
+
<ListItem.Heading classNames='flex flex-col grow truncate mbe-2'>
|
|
35
|
+
{toLocalizedString(getSpaceDisplayName(space, { personal: space === client.spaces.default }), t)}
|
|
36
|
+
</ListItem.Heading>
|
|
37
|
+
<ListItem.Endcap>
|
|
38
|
+
<Button onClick={() => dispatch(createIntent(SpaceAction.OpenSettings, { space }))}>
|
|
39
|
+
{t('open space settings label')}
|
|
40
|
+
</Button>
|
|
41
|
+
</ListItem.Endcap>
|
|
42
|
+
</ListItem.Root>
|
|
43
|
+
))}
|
|
44
|
+
</List>
|
|
45
|
+
</div>
|
|
21
46
|
</DeprecatedFormContainer>
|
|
22
47
|
);
|
|
23
48
|
};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import React, { useCallback, useEffect, useState } from 'react';
|
|
5
|
+
import React, { forwardRef, useCallback, useEffect, useState } from 'react';
|
|
6
6
|
|
|
7
7
|
import { useAppGraph, useCapability } from '@dxos/app-framework';
|
|
8
8
|
import { generateName } from '@dxos/display-name';
|
|
@@ -20,6 +20,7 @@ import {
|
|
|
20
20
|
List,
|
|
21
21
|
ListItem,
|
|
22
22
|
useDefaultValue,
|
|
23
|
+
type DxAvatar,
|
|
23
24
|
} from '@dxos/react-ui';
|
|
24
25
|
import { AttentionGlyph, useAttended, useAttention, type AttentionGlyphProps } from '@dxos/react-ui-attention';
|
|
25
26
|
import { ComplexMap, keyToFallback } from '@dxos/util';
|
|
@@ -115,8 +116,8 @@ export const FullPresence = (props: MemberPresenceProps) => {
|
|
|
115
116
|
<div className='dx-avatar-group' data-testid='spacePlugin.presence'>
|
|
116
117
|
{members.slice(0, 3).map((member, i) => (
|
|
117
118
|
<Tooltip.Root key={member.identity.identityKey.toHex()}>
|
|
118
|
-
<Tooltip.Trigger>
|
|
119
|
-
<
|
|
119
|
+
<Tooltip.Trigger className='grid focus:outline-none'>
|
|
120
|
+
<PresenceAvatar
|
|
120
121
|
identity={member.identity}
|
|
121
122
|
match={member.currentlyAttended} // TODO(Zan): Match always true now we're showing 'members viewing current object'.
|
|
122
123
|
index={members.length - i}
|
|
@@ -135,13 +136,14 @@ export const FullPresence = (props: MemberPresenceProps) => {
|
|
|
135
136
|
|
|
136
137
|
{members.length > 3 && (
|
|
137
138
|
<Tooltip.Root>
|
|
138
|
-
<Tooltip.Trigger>
|
|
139
|
+
<Tooltip.Trigger className='grid focus:outline-none'>
|
|
139
140
|
<Avatar.Root>
|
|
140
141
|
{/* TODO(wittjosiah): Make text fit. */}
|
|
141
142
|
<Avatar.Content
|
|
142
143
|
status='inactive'
|
|
143
144
|
style={{ zIndex: members.length - 4 }}
|
|
144
145
|
fallback={`+${members.length - 3}`}
|
|
146
|
+
size={size}
|
|
145
147
|
/>
|
|
146
148
|
</Avatar.Root>
|
|
147
149
|
</Tooltip.Trigger>
|
|
@@ -157,7 +159,7 @@ export const FullPresence = (props: MemberPresenceProps) => {
|
|
|
157
159
|
data-testid='identity-list-item'
|
|
158
160
|
>
|
|
159
161
|
{/* TODO(Zan): Match always true now we're showing 'members viewing current object'. */}
|
|
160
|
-
<
|
|
162
|
+
<PresenceAvatar identity={member.identity} size={size} showName match={member.currentlyAttended} />
|
|
161
163
|
</ListItem.Root>
|
|
162
164
|
))}
|
|
163
165
|
</List>
|
|
@@ -177,26 +179,28 @@ type PresenceAvatarProps = Pick<AvatarContentProps, 'size'> & {
|
|
|
177
179
|
onClick?: () => void;
|
|
178
180
|
};
|
|
179
181
|
|
|
180
|
-
const
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
<Avatar.
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
182
|
+
const PresenceAvatar = forwardRef<DxAvatar, PresenceAvatarProps>(
|
|
183
|
+
({ identity, showName, match, index, onClick, size }, forwardedRef) => {
|
|
184
|
+
const status = match ? 'current' : 'active';
|
|
185
|
+
const fallbackValue = keyToFallback(identity.identityKey);
|
|
186
|
+
return (
|
|
187
|
+
<Avatar.Root>
|
|
188
|
+
<Avatar.Content
|
|
189
|
+
status={status}
|
|
190
|
+
hue={identity.profile?.data?.hue || fallbackValue.hue}
|
|
191
|
+
data-testid='spacePlugin.presence.member'
|
|
192
|
+
data-status={status}
|
|
193
|
+
size={size}
|
|
194
|
+
{...(index ? { style: { zIndex: index } } : {})}
|
|
195
|
+
onClick={onClick}
|
|
196
|
+
fallback={identity.profile?.data?.emoji || fallbackValue.emoji}
|
|
197
|
+
ref={forwardedRef}
|
|
198
|
+
/>
|
|
199
|
+
<Avatar.Label classNames={showName ? 'text-sm truncate pli-2' : 'sr-only'}>{getName(identity)}</Avatar.Label>
|
|
200
|
+
</Avatar.Root>
|
|
201
|
+
);
|
|
202
|
+
},
|
|
203
|
+
);
|
|
200
204
|
|
|
201
205
|
export type SmallPresenceLiveProps = {
|
|
202
206
|
id?: string;
|
|
@@ -10,21 +10,21 @@ import React from 'react';
|
|
|
10
10
|
import { useClientProvider, withClientProvider } from '@dxos/react-client/testing';
|
|
11
11
|
import { withTheme } from '@dxos/storybook-utils';
|
|
12
12
|
|
|
13
|
-
import {
|
|
13
|
+
import { SpaceSettingsContainer, type SpaceSettingsContainerProps } from './SpaceSettingsContainer';
|
|
14
14
|
import translations from '../../translations';
|
|
15
15
|
|
|
16
|
-
const Story = (args: Partial<
|
|
16
|
+
const Story = (args: Partial<SpaceSettingsContainerProps>) => {
|
|
17
17
|
const { space } = useClientProvider();
|
|
18
18
|
return (
|
|
19
19
|
<div role='none' className='p-2 border border-primary-500 rounded'>
|
|
20
|
-
<
|
|
20
|
+
<SpaceSettingsContainer {...args} space={space!} />
|
|
21
21
|
</div>
|
|
22
22
|
);
|
|
23
23
|
};
|
|
24
24
|
|
|
25
25
|
const meta: Meta = {
|
|
26
|
-
title: 'plugins/plugin-space/
|
|
27
|
-
component:
|
|
26
|
+
title: 'plugins/plugin-space/SpaceSettingsContainer',
|
|
27
|
+
component: SpaceSettingsContainer,
|
|
28
28
|
render: Story,
|
|
29
29
|
decorators: [withClientProvider({ createIdentity: true, createSpace: true }), withTheme],
|
|
30
30
|
parameters: {
|
|
@@ -35,4 +35,4 @@ const meta: Meta = {
|
|
|
35
35
|
|
|
36
36
|
export default meta;
|
|
37
37
|
|
|
38
|
-
export const Default: StoryObj<typeof
|
|
38
|
+
export const Default: StoryObj<typeof SpaceSettingsContainer> = {};
|