@dxos/plugin-space 0.8.4-main.3f58842 → 0.8.4-main.5ea62a8
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/{ObjectDetailsPanel-YPTDQKMG.mjs → ObjectDetailsPanel-SY6FYTYC.mjs} +2 -2
- package/dist/lib/browser/{ObjectDetailsPanel-YPTDQKMG.mjs.map → ObjectDetailsPanel-SY6FYTYC.mjs.map} +3 -3
- package/dist/lib/browser/RecordMain-TEBGAVSL.mjs +68 -0
- package/dist/lib/browser/RecordMain-TEBGAVSL.mjs.map +7 -0
- package/dist/lib/browser/{app-graph-builder-7CZZJS3S.mjs → app-graph-builder-FLF7XMQO.mjs} +49 -12
- package/dist/lib/browser/app-graph-builder-FLF7XMQO.mjs.map +7 -0
- package/dist/lib/browser/{app-graph-serializer-H6AW7KGS.mjs → app-graph-serializer-3A6KBYWT.mjs} +4 -4
- package/dist/lib/browser/{chunk-JS3MMC42.mjs → chunk-CBYL62HG.mjs} +2 -2
- package/dist/lib/{node-esm/chunk-5HHYE264.mjs.map → browser/chunk-CBYL62HG.mjs.map} +3 -3
- package/dist/lib/browser/{chunk-XUYKJUU7.mjs → chunk-DCY3W36E.mjs} +62 -11
- package/dist/lib/browser/{chunk-XUYKJUU7.mjs.map → chunk-DCY3W36E.mjs.map} +3 -3
- package/dist/lib/browser/{chunk-VLBRSGJ2.mjs → chunk-ELJDGQTO.mjs} +3 -3
- package/dist/lib/browser/{chunk-VLBRSGJ2.mjs.map → chunk-ELJDGQTO.mjs.map} +3 -3
- package/dist/lib/browser/{chunk-V7MJSSBQ.mjs → chunk-J6YZG77T.mjs} +79 -78
- package/dist/lib/browser/chunk-J6YZG77T.mjs.map +7 -0
- package/dist/lib/browser/{chunk-SGTQ52SU.mjs → chunk-RQVV4XVF.mjs} +6 -1
- package/dist/lib/{node-esm/chunk-JH6F4C3I.mjs.map → browser/chunk-RQVV4XVF.mjs.map} +3 -3
- package/dist/lib/browser/{chunk-CEFHNVU7.mjs → chunk-TUQZO5P4.mjs} +1 -1
- package/dist/lib/browser/{chunk-CEFHNVU7.mjs.map → chunk-TUQZO5P4.mjs.map} +2 -2
- package/dist/lib/browser/{chunk-QACNNDOT.mjs → chunk-WAXS2ZVX.mjs} +5 -5
- package/dist/lib/browser/{chunk-QACNNDOT.mjs.map → chunk-WAXS2ZVX.mjs.map} +1 -1
- package/dist/lib/browser/{identity-created-23XJJV2N.mjs → identity-created-T6ZNVE7S.mjs} +2 -2
- package/dist/lib/browser/{identity-created-23XJJV2N.mjs.map → identity-created-T6ZNVE7S.mjs.map} +3 -3
- package/dist/lib/browser/index.mjs +12 -16
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-resolver-TIXVDYN7.mjs → intent-resolver-7E3IZIJS.mjs} +25 -17
- package/dist/lib/browser/intent-resolver-7E3IZIJS.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-root-N2J7TDRX.mjs → react-root-RWMT2RCK.mjs} +6 -6
- package/dist/lib/browser/{react-root-N2J7TDRX.mjs.map → react-root-RWMT2RCK.mjs.map} +2 -2
- package/dist/lib/browser/{react-surface-TPNLWJJH.mjs → react-surface-GL4CE2F4.mjs} +25 -14
- package/dist/lib/browser/react-surface-GL4CE2F4.mjs.map +7 -0
- package/dist/lib/browser/{schema-defs-Z6FC4AHC.mjs → schema-defs-YDPFZELA.mjs} +2 -2
- package/dist/lib/browser/schema-defs-YDPFZELA.mjs.map +7 -0
- package/dist/lib/browser/{settings-4IMP5RYT.mjs → settings-B6MMHLPS.mjs} +2 -2
- package/dist/lib/browser/{spaces-ready-TOPG6IV4.mjs → spaces-ready-QVABOCO3.mjs} +14 -12
- package/dist/lib/browser/spaces-ready-QVABOCO3.mjs.map +7 -0
- package/dist/lib/browser/{state-QYZAB45H.mjs → state-2RGW7FQG.mjs} +2 -2
- package/dist/lib/{node-esm/state-ZVEHQ4BJ.mjs.map → browser/state-2RGW7FQG.mjs.map} +2 -2
- package/dist/lib/browser/types/index.mjs +1 -1
- package/dist/lib/node-esm/{ObjectDetailsPanel-QKZEDSZK.mjs → ObjectDetailsPanel-3MYLTMXN.mjs} +2 -2
- package/dist/lib/node-esm/{ObjectDetailsPanel-QKZEDSZK.mjs.map → ObjectDetailsPanel-3MYLTMXN.mjs.map} +3 -3
- package/dist/lib/node-esm/RecordMain-WLYJMYER.mjs +70 -0
- package/dist/lib/node-esm/RecordMain-WLYJMYER.mjs.map +7 -0
- package/dist/lib/node-esm/{app-graph-builder-KGIGWC72.mjs → app-graph-builder-D5YPOJS5.mjs} +49 -12
- package/dist/lib/node-esm/app-graph-builder-D5YPOJS5.mjs.map +7 -0
- package/dist/lib/node-esm/{app-graph-serializer-2ICUGQQT.mjs → app-graph-serializer-M45TH5LR.mjs} +4 -4
- package/dist/lib/node-esm/{chunk-4AOMYKDE.mjs → chunk-AUQ3SKL2.mjs} +62 -11
- package/dist/lib/node-esm/{chunk-4AOMYKDE.mjs.map → chunk-AUQ3SKL2.mjs.map} +3 -3
- package/dist/lib/node-esm/{chunk-5HHYE264.mjs → chunk-FJZNSJC4.mjs} +2 -2
- package/dist/lib/{browser/chunk-JS3MMC42.mjs.map → node-esm/chunk-FJZNSJC4.mjs.map} +3 -3
- package/dist/lib/node-esm/{chunk-5T3ZH23B.mjs → chunk-HC677WUJ.mjs} +1 -1
- package/dist/lib/node-esm/{chunk-5T3ZH23B.mjs.map → chunk-HC677WUJ.mjs.map} +2 -2
- package/dist/lib/node-esm/{chunk-P442DOQ3.mjs → chunk-HYIZVPOA.mjs} +5 -5
- package/dist/lib/node-esm/{chunk-P442DOQ3.mjs.map → chunk-HYIZVPOA.mjs.map} +1 -1
- package/dist/lib/node-esm/{chunk-SSLBYZEY.mjs → chunk-Q6AAQLQG.mjs} +3 -3
- package/dist/lib/node-esm/{chunk-SSLBYZEY.mjs.map → chunk-Q6AAQLQG.mjs.map} +3 -3
- package/dist/lib/node-esm/{chunk-JH6F4C3I.mjs → chunk-WKQTO37U.mjs} +6 -1
- package/dist/lib/node-esm/chunk-WKQTO37U.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-6X5DLJM5.mjs → chunk-ZCEH2VYE.mjs} +79 -78
- package/dist/lib/node-esm/chunk-ZCEH2VYE.mjs.map +7 -0
- package/dist/lib/node-esm/{identity-created-IJQO6GCR.mjs → identity-created-AL7NNCKH.mjs} +2 -2
- package/dist/lib/node-esm/{identity-created-IJQO6GCR.mjs.map → identity-created-AL7NNCKH.mjs.map} +3 -3
- package/dist/lib/node-esm/index.mjs +12 -16
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/{intent-resolver-MHGHRGDT.mjs → intent-resolver-UVO4MKWX.mjs} +25 -17
- package/dist/lib/node-esm/intent-resolver-UVO4MKWX.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-root-KW3TGJGY.mjs → react-root-5EKYI66P.mjs} +6 -6
- package/dist/lib/node-esm/{react-root-KW3TGJGY.mjs.map → react-root-5EKYI66P.mjs.map} +2 -2
- package/dist/lib/node-esm/{react-surface-UUIUUD6P.mjs → react-surface-IOC6YSVQ.mjs} +25 -14
- package/dist/lib/node-esm/react-surface-IOC6YSVQ.mjs.map +7 -0
- package/dist/lib/node-esm/{schema-defs-WHJM7UZE.mjs → schema-defs-OYBCWKAS.mjs} +2 -2
- package/dist/lib/node-esm/schema-defs-OYBCWKAS.mjs.map +7 -0
- package/dist/lib/node-esm/{settings-SAOBPND3.mjs → settings-IOFU6EAS.mjs} +2 -2
- package/dist/lib/node-esm/{spaces-ready-HIUKNDZK.mjs → spaces-ready-MS6GHPFR.mjs} +14 -12
- package/dist/lib/node-esm/spaces-ready-MS6GHPFR.mjs.map +7 -0
- package/dist/lib/node-esm/{state-ZVEHQ4BJ.mjs → state-7VBVBGNS.mjs} +2 -2
- package/dist/lib/node-esm/state-7VBVBGNS.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +1 -1
- package/dist/types/src/SpacePlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-serializer.d.ts +1 -1
- package/dist/types/src/capabilities/capabilities.d.ts +1 -1
- package/dist/types/src/capabilities/capabilities.d.ts.map +1 -1
- package/dist/types/src/capabilities/identity-created.d.ts +1 -1
- package/dist/types/src/capabilities/identity-created.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +11 -12
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-root.d.ts +2 -2
- package/dist/types/src/capabilities/react-root.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/schema-defs.d.ts +1 -1
- package/dist/types/src/capabilities/schema-defs.d.ts.map +1 -1
- package/dist/types/src/capabilities/settings.d.ts +1 -1
- package/dist/types/src/capabilities/spaces-ready.d.ts +1 -1
- package/dist/types/src/capabilities/spaces-ready.d.ts.map +1 -1
- package/dist/types/src/capabilities/state.d.ts +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/CreateObjectDialog.stories.d.ts +1584 -3
- package/dist/types/src/components/CreateDialog/CreateObjectDialog.stories.d.ts.map +1 -1
- package/dist/types/src/components/CreateDialog/CreateObjectPanel.d.ts +5 -3
- package/dist/types/src/components/CreateDialog/CreateObjectPanel.d.ts.map +1 -1
- package/dist/types/src/components/MembersContainer.d.ts +3 -2
- package/dist/types/src/components/MembersContainer.d.ts.map +1 -1
- package/dist/types/src/components/MembersContainer.stories.d.ts +1584 -4
- package/dist/types/src/components/MembersContainer.stories.d.ts.map +1 -1
- package/dist/types/src/components/ObjectSettings/AdvancedObjectSettings.d.ts.map +1 -1
- package/dist/types/src/components/PopoverRenameObject.d.ts +1 -1
- package/dist/types/src/components/PopoverRenameObject.d.ts.map +1 -1
- package/dist/types/src/components/RecordMain.d.ts +7 -0
- package/dist/types/src/components/RecordMain.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/SpacePresence.stories.d.ts +1411 -2
- package/dist/types/src/components/SpacePresence.stories.d.ts.map +1 -1
- package/dist/types/src/components/SpaceSettings/SpaceSettingsContainer.d.ts.map +1 -1
- package/dist/types/src/components/SpaceSettings/SpaceSettingsContainer.stories.d.ts +1417 -3
- package/dist/types/src/components/SpaceSettings/SpaceSettingsContainer.stories.d.ts.map +1 -1
- package/dist/types/src/components/SyncStatus/SyncStatus.d.ts.map +1 -1
- package/dist/types/src/components/SyncStatus/SyncStatus.stories.d.ts +1418 -4
- package/dist/types/src/components/SyncStatus/SyncStatus.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +8 -2
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useActiveSpace.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +4 -4
- package/dist/types/src/types/types.d.ts +33 -34
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/src/util.d.ts +6 -4
- package/dist/types/src/util.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +51 -49
- package/src/SpacePlugin.ts +3 -9
- package/src/capabilities/app-graph-builder.ts +76 -24
- package/src/capabilities/capabilities.ts +3 -2
- package/src/capabilities/identity-created.ts +1 -1
- package/src/capabilities/index.ts +0 -1
- package/src/capabilities/intent-resolver.ts +16 -7
- package/src/capabilities/react-root.tsx +2 -1
- package/src/capabilities/react-surface.tsx +26 -12
- package/src/capabilities/schema-defs.ts +3 -2
- package/src/capabilities/spaces-ready.ts +10 -7
- package/src/capabilities/state.ts +3 -2
- package/src/components/AwaitingObject.tsx +1 -1
- package/src/components/CreateDialog/CreateObjectDialog.stories.tsx +6 -5
- package/src/components/CreateDialog/CreateObjectDialog.tsx +14 -6
- package/src/components/CreateDialog/CreateObjectPanel.tsx +18 -7
- package/src/components/CreateDialog/CreateSpaceDialog.tsx +1 -1
- package/src/components/JoinDialog.tsx +1 -1
- package/src/components/MembersContainer.stories.tsx +33 -8
- package/src/components/MembersContainer.tsx +7 -8
- package/src/components/ObjectDetailsPanel.tsx +1 -1
- package/src/components/ObjectSettings/AdvancedObjectSettings.tsx +2 -1
- package/src/components/PopoverRenameObject.tsx +6 -12
- package/src/components/PopoverRenameSpace.tsx +1 -1
- package/src/components/RecordMain.tsx +43 -0
- package/src/components/SchemaContainer.tsx +2 -2
- package/src/components/SpacePluginSettings.tsx +6 -7
- package/src/components/SpacePresence.stories.tsx +7 -4
- package/src/components/SpacePresence.tsx +7 -7
- package/src/components/SpaceSettings/SpaceSettingsContainer.stories.tsx +8 -5
- package/src/components/SpaceSettings/SpaceSettingsContainer.tsx +8 -8
- package/src/components/SyncStatus/SyncStatus.stories.tsx +5 -4
- package/src/components/SyncStatus/SyncStatus.tsx +3 -2
- package/src/components/index.ts +1 -0
- package/src/events.ts +1 -1
- package/src/hooks/useActiveSpace.ts +2 -2
- package/src/hooks/useInputSurfaceLookup.tsx +1 -1
- package/src/translations.ts +4 -4
- package/src/types/types.ts +6 -1
- package/src/util.tsx +56 -6
- package/dist/lib/browser/app-graph-builder-7CZZJS3S.mjs.map +0 -7
- package/dist/lib/browser/chunk-SGTQ52SU.mjs.map +0 -7
- package/dist/lib/browser/chunk-V7MJSSBQ.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-TIXVDYN7.mjs.map +0 -7
- package/dist/lib/browser/react-surface-TPNLWJJH.mjs.map +0 -7
- package/dist/lib/browser/schema-defs-Z6FC4AHC.mjs.map +0 -7
- package/dist/lib/browser/schema-tools-BNP4JTD7.mjs +0 -124
- package/dist/lib/browser/schema-tools-BNP4JTD7.mjs.map +0 -7
- package/dist/lib/browser/spaces-ready-TOPG6IV4.mjs.map +0 -7
- package/dist/lib/browser/state-QYZAB45H.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-KGIGWC72.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-6X5DLJM5.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-MHGHRGDT.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-UUIUUD6P.mjs.map +0 -7
- package/dist/lib/node-esm/schema-defs-WHJM7UZE.mjs.map +0 -7
- package/dist/lib/node-esm/schema-tools-KWW5PTML.mjs +0 -126
- package/dist/lib/node-esm/schema-tools-KWW5PTML.mjs.map +0 -7
- package/dist/lib/node-esm/spaces-ready-HIUKNDZK.mjs.map +0 -7
- package/dist/types/src/capabilities/schema-tool.test.d.ts +0 -2
- package/dist/types/src/capabilities/schema-tool.test.d.ts.map +0 -1
- package/dist/types/src/capabilities/schema-tools.d.ts +0 -13
- package/dist/types/src/capabilities/schema-tools.d.ts.map +0 -1
- package/src/capabilities/schema-tool.test.ts +0 -44
- package/src/capabilities/schema-tools.ts +0 -125
- /package/dist/lib/browser/{app-graph-serializer-H6AW7KGS.mjs.map → app-graph-serializer-3A6KBYWT.mjs.map} +0 -0
- /package/dist/lib/browser/{settings-4IMP5RYT.mjs.map → settings-B6MMHLPS.mjs.map} +0 -0
- /package/dist/lib/node-esm/{app-graph-serializer-2ICUGQQT.mjs.map → app-graph-serializer-M45TH5LR.mjs.map} +0 -0
- /package/dist/lib/node-esm/{settings-SAOBPND3.mjs.map → settings-IOFU6EAS.mjs.map} +0 -0
|
@@ -4,15 +4,16 @@
|
|
|
4
4
|
|
|
5
5
|
import { effect } from '@preact/signals-core';
|
|
6
6
|
|
|
7
|
-
import { Capabilities,
|
|
7
|
+
import { Capabilities, type PluginContext, contributes } from '@dxos/app-framework';
|
|
8
8
|
import { PublicKey } from '@dxos/keys';
|
|
9
9
|
import { LocalStorageStore } from '@dxos/local-storage';
|
|
10
10
|
import { ComplexMap } from '@dxos/util';
|
|
11
11
|
|
|
12
|
-
import { SpaceCapabilities } from './capabilities';
|
|
13
12
|
import { SPACE_PLUGIN } from '../meta';
|
|
14
13
|
import { type PluginState } from '../types';
|
|
15
14
|
|
|
15
|
+
import { SpaceCapabilities } from './capabilities';
|
|
16
|
+
|
|
16
17
|
export default (context: PluginContext) => {
|
|
17
18
|
const state = new LocalStorageStore<PluginState>(SPACE_PLUGIN, {
|
|
18
19
|
awaiting: undefined,
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { useCallback, useEffect, useState } from 'react';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { LayoutAction, createIntent, useIntentDispatcher, useLayout } from '@dxos/app-framework';
|
|
8
8
|
import { useClient } from '@dxos/react-client';
|
|
9
9
|
import { Filter, fullyQualifiedId, useQuery } from '@dxos/react-client/echo';
|
|
10
10
|
import { Button, Icon, Toast, useTranslation } from '@dxos/react-ui';
|
|
@@ -15,21 +15,22 @@ import { DataType } from '@dxos/schema';
|
|
|
15
15
|
import { translations as shellTranslations } from '@dxos/shell/react';
|
|
16
16
|
import { withLayout, withTheme } from '@dxos/storybook-utils';
|
|
17
17
|
|
|
18
|
-
import { CreateObjectDialog, type CreateObjectDialogProps } from './CreateObjectDialog';
|
|
19
18
|
import { translations } from '../../translations';
|
|
20
19
|
|
|
21
|
-
|
|
20
|
+
import { CreateObjectDialog, type CreateObjectDialogProps } from './CreateObjectDialog';
|
|
21
|
+
|
|
22
|
+
const Story = (props: CreateObjectDialogProps) => {
|
|
22
23
|
return (
|
|
23
24
|
<Dialog.Root open>
|
|
24
25
|
<Dialog.Overlay blockAlign='start'>
|
|
25
|
-
<CreateObjectDialog {...
|
|
26
|
+
<CreateObjectDialog {...props} />
|
|
26
27
|
</Dialog.Overlay>
|
|
27
28
|
</Dialog.Root>
|
|
28
29
|
);
|
|
29
30
|
};
|
|
30
31
|
|
|
31
32
|
// TODO(wittjosiah): Story should be for CreateObjectPanel.
|
|
32
|
-
const meta
|
|
33
|
+
const meta = {
|
|
33
34
|
title: 'plugins/plugin-space/CreateObjectDialog',
|
|
34
35
|
component: CreateObjectDialog,
|
|
35
36
|
render: Story,
|
|
@@ -42,7 +43,7 @@ const meta: Meta<typeof CreateObjectDialog> = {
|
|
|
42
43
|
translations: [...translations, ...shellTranslations],
|
|
43
44
|
},
|
|
44
45
|
args: {},
|
|
45
|
-
}
|
|
46
|
+
} satisfies Meta<typeof CreateObjectDialog>;
|
|
46
47
|
|
|
47
48
|
export default meta;
|
|
48
49
|
|
|
@@ -17,20 +17,24 @@ import {
|
|
|
17
17
|
import { Obj, Query, Type } from '@dxos/echo';
|
|
18
18
|
import { invariant } from '@dxos/invariant';
|
|
19
19
|
import { useClient } from '@dxos/react-client';
|
|
20
|
-
import { getSpace, isLiveObject, isSpace,
|
|
20
|
+
import { type Space, getSpace, isLiveObject, isSpace, useQuery, useSpaces } from '@dxos/react-client/echo';
|
|
21
21
|
import { Button, Dialog, Icon, useTranslation } from '@dxos/react-ui';
|
|
22
22
|
import { cardDialogContent, cardDialogHeader } from '@dxos/react-ui-stack';
|
|
23
23
|
import { DataType } from '@dxos/schema';
|
|
24
24
|
import { isNonNullable } from '@dxos/util';
|
|
25
25
|
|
|
26
|
-
import { CreateObjectPanel, type CreateObjectPanelProps } from './CreateObjectPanel';
|
|
27
26
|
import { SpaceCapabilities } from '../../capabilities';
|
|
28
27
|
import { SPACE_PLUGIN } from '../../meta';
|
|
29
28
|
import { SpaceAction } from '../../types';
|
|
30
29
|
|
|
30
|
+
import { CreateObjectPanel, type CreateObjectPanelProps } from './CreateObjectPanel';
|
|
31
|
+
|
|
31
32
|
export const CREATE_OBJECT_DIALOG = `${SPACE_PLUGIN}/CreateObjectDialog`;
|
|
32
33
|
|
|
33
|
-
export type CreateObjectDialogProps = Pick<
|
|
34
|
+
export type CreateObjectDialogProps = Pick<
|
|
35
|
+
CreateObjectPanelProps,
|
|
36
|
+
'target' | 'views' | 'typename' | 'initialFormValues'
|
|
37
|
+
> & {
|
|
34
38
|
onCreateObject?: (object: Obj.Any) => void;
|
|
35
39
|
shouldNavigate?: (object: Obj.Any) => boolean;
|
|
36
40
|
};
|
|
@@ -38,7 +42,8 @@ export type CreateObjectDialogProps = Pick<CreateObjectPanelProps, 'target' | 't
|
|
|
38
42
|
export const CreateObjectDialog = ({
|
|
39
43
|
target: initialTarget,
|
|
40
44
|
typename: initialTypename,
|
|
41
|
-
|
|
45
|
+
views,
|
|
46
|
+
initialFormValues,
|
|
42
47
|
onCreateObject,
|
|
43
48
|
shouldNavigate: _shouldNavigate,
|
|
44
49
|
}: CreateObjectDialogProps) => {
|
|
@@ -98,7 +103,9 @@ export const CreateObjectDialog = ({
|
|
|
98
103
|
<Dialog.Content classNames={cardDialogContent}>
|
|
99
104
|
<div role='none' className={cardDialogHeader}>
|
|
100
105
|
<Dialog.Title>
|
|
101
|
-
{t('create object dialog title', {
|
|
106
|
+
{t('create object dialog title', {
|
|
107
|
+
object: t('typename label', { ns: typename, defaultValue: views ? 'View' : 'Item' }),
|
|
108
|
+
})}
|
|
102
109
|
</Dialog.Title>
|
|
103
110
|
<Dialog.Close asChild>
|
|
104
111
|
<Button ref={closeRef} density='fine' variant='ghost' autoFocus>
|
|
@@ -111,8 +118,9 @@ export const CreateObjectDialog = ({
|
|
|
111
118
|
forms={forms}
|
|
112
119
|
spaces={spaces}
|
|
113
120
|
target={target}
|
|
121
|
+
views={views}
|
|
114
122
|
typename={typename}
|
|
115
|
-
|
|
123
|
+
initialFormValues={initialFormValues}
|
|
116
124
|
defaultSpaceId={client.spaces.default.id}
|
|
117
125
|
resolve={resolve}
|
|
118
126
|
onTargetChange={setTarget}
|
|
@@ -2,17 +2,18 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
import { Option } from 'effect';
|
|
5
6
|
import React, { useCallback } from 'react';
|
|
6
7
|
|
|
7
8
|
import { Type } from '@dxos/echo';
|
|
8
|
-
import {
|
|
9
|
-
import { type
|
|
10
|
-
import { Icon, toLocalizedString, useTranslation } from '@dxos/react-ui';
|
|
9
|
+
import { type BaseObject, type TypeAnnotation, ViewAnnotation, getTypeAnnotation } from '@dxos/echo-schema';
|
|
10
|
+
import { type Space, type SpaceId } from '@dxos/react-client/echo';
|
|
11
|
+
import { Icon, toLocalizedString, useDefaultValue, useTranslation } from '@dxos/react-ui';
|
|
11
12
|
import { Form } from '@dxos/react-ui-form';
|
|
12
13
|
import { SearchList } from '@dxos/react-ui-searchlist';
|
|
13
14
|
import { cardDialogOverflow, cardDialogPaddedOverflow, cardDialogSearchListRoot } from '@dxos/react-ui-stack';
|
|
14
15
|
import { type DataType } from '@dxos/schema';
|
|
15
|
-
import {
|
|
16
|
+
import { type MaybePromise, isNonNullable } from '@dxos/util';
|
|
16
17
|
|
|
17
18
|
import { useInputSurfaceLookup } from '../../hooks';
|
|
18
19
|
import { SPACE_PLUGIN } from '../../meta';
|
|
@@ -24,7 +25,8 @@ export type CreateObjectPanelProps = {
|
|
|
24
25
|
spaces: Space[];
|
|
25
26
|
typename?: string;
|
|
26
27
|
target?: Space | DataType.Collection;
|
|
27
|
-
|
|
28
|
+
views?: boolean;
|
|
29
|
+
initialFormValues?: Partial<BaseObject>;
|
|
28
30
|
defaultSpaceId?: SpaceId;
|
|
29
31
|
resolve?: (typename: string) => Record<string, any>;
|
|
30
32
|
onTargetChange?: (target: Space) => void;
|
|
@@ -37,7 +39,8 @@ export const CreateObjectPanel = ({
|
|
|
37
39
|
spaces,
|
|
38
40
|
typename,
|
|
39
41
|
target,
|
|
40
|
-
|
|
42
|
+
views,
|
|
43
|
+
initialFormValues: _initialFormValues,
|
|
41
44
|
defaultSpaceId,
|
|
42
45
|
resolve,
|
|
43
46
|
onTargetChange,
|
|
@@ -45,8 +48,16 @@ export const CreateObjectPanel = ({
|
|
|
45
48
|
onCreateObject,
|
|
46
49
|
}: CreateObjectPanelProps) => {
|
|
47
50
|
const { t } = useTranslation(SPACE_PLUGIN);
|
|
51
|
+
const initialFormValues = useDefaultValue(_initialFormValues, () => ({}));
|
|
48
52
|
const form = forms.find((form) => Type.getTypename(form.objectSchema) === typename);
|
|
49
53
|
const options: TypeAnnotation[] = forms
|
|
54
|
+
.filter((form) => {
|
|
55
|
+
if (views == null) {
|
|
56
|
+
return true;
|
|
57
|
+
} else {
|
|
58
|
+
return views === ViewAnnotation.get(form.objectSchema).pipe(Option.getOrElse(() => false));
|
|
59
|
+
}
|
|
60
|
+
})
|
|
50
61
|
.map((form) => getTypeAnnotation(form.objectSchema))
|
|
51
62
|
.filter(isNonNullable)
|
|
52
63
|
.sort((a, b) => {
|
|
@@ -88,7 +99,7 @@ export const CreateObjectPanel = ({
|
|
|
88
99
|
<div role='none' className={cardDialogOverflow}>
|
|
89
100
|
<Form
|
|
90
101
|
autoFocus
|
|
91
|
-
values={
|
|
102
|
+
values={initialFormValues}
|
|
92
103
|
schema={form.formSchema}
|
|
93
104
|
testId='create-object-form'
|
|
94
105
|
onSave={handleCreateObject}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { Effect, type Schema } from 'effect';
|
|
6
6
|
import React, { useCallback, useRef } from 'react';
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import { LayoutAction, createIntent, useIntentDispatcher } from '@dxos/app-framework';
|
|
9
9
|
import { Button, Dialog, Icon, useTranslation } from '@dxos/react-ui';
|
|
10
10
|
import { Form } from '@dxos/react-ui-form';
|
|
11
11
|
import { cardDialogContent, cardDialogHeader } from '@dxos/react-ui-stack';
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { useCallback } from 'react';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { LayoutAction, createIntent, useAppGraph, useIntentDispatcher } from '@dxos/app-framework';
|
|
8
8
|
import { Trigger } from '@dxos/async';
|
|
9
9
|
import { ObservabilityAction } from '@dxos/plugin-observability/types';
|
|
10
10
|
import { useClient } from '@dxos/react-client';
|
|
@@ -4,27 +4,52 @@
|
|
|
4
4
|
|
|
5
5
|
import '@dxos-theme';
|
|
6
6
|
|
|
7
|
-
import { type
|
|
7
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
8
|
+
import React from 'react';
|
|
8
9
|
|
|
10
|
+
import { useSpace } from '@dxos/react-client/echo';
|
|
9
11
|
import { withClientProvider } from '@dxos/react-client/testing';
|
|
10
12
|
import { translations as shellTranslations } from '@dxos/shell/react';
|
|
11
|
-
import {
|
|
13
|
+
import { render, withLayout, withTheme } from '@dxos/storybook-utils';
|
|
12
14
|
|
|
13
|
-
import { MembersContainer } from './MembersContainer';
|
|
14
15
|
import { translations } from '../translations';
|
|
15
16
|
|
|
16
|
-
|
|
17
|
+
import { MembersContainer } from './MembersContainer';
|
|
18
|
+
|
|
19
|
+
const DefaultStory = () => {
|
|
20
|
+
const space = useSpace();
|
|
21
|
+
if (!space) {
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return (
|
|
26
|
+
<MembersContainer
|
|
27
|
+
space={space}
|
|
28
|
+
createInvitationUrl={(invitationCode) => `https://dxos.org/invite/${invitationCode}`}
|
|
29
|
+
/>
|
|
30
|
+
);
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
const meta = {
|
|
17
34
|
title: 'plugins/plugin-space/MembersContainer',
|
|
18
|
-
component: MembersContainer,
|
|
19
|
-
|
|
35
|
+
component: MembersContainer as any,
|
|
36
|
+
render: render(DefaultStory),
|
|
37
|
+
decorators: [
|
|
38
|
+
withClientProvider({
|
|
39
|
+
createIdentity: true,
|
|
40
|
+
createSpace: true,
|
|
41
|
+
}),
|
|
42
|
+
withTheme,
|
|
43
|
+
withLayout(),
|
|
44
|
+
],
|
|
20
45
|
parameters: {
|
|
21
46
|
layout: 'fullscreen',
|
|
22
47
|
translations: [...translations, ...shellTranslations],
|
|
23
48
|
},
|
|
24
|
-
}
|
|
49
|
+
} satisfies Meta<typeof DefaultStory>;
|
|
25
50
|
|
|
26
51
|
export default meta;
|
|
27
52
|
|
|
28
|
-
type Story = StoryObj<typeof
|
|
53
|
+
type Story = StoryObj<typeof meta>;
|
|
29
54
|
|
|
30
55
|
export const Default: Story = {};
|
|
@@ -8,10 +8,10 @@ import { QR } from 'react-qr-rounded';
|
|
|
8
8
|
import { createIntent, useIntentDispatcher } from '@dxos/app-framework';
|
|
9
9
|
import { log } from '@dxos/log';
|
|
10
10
|
import { useConfig } from '@dxos/react-client';
|
|
11
|
-
import { fullyQualifiedId, useSpaceInvitations
|
|
11
|
+
import { type Space, fullyQualifiedId, useSpaceInvitations } from '@dxos/react-client/echo';
|
|
12
12
|
import { type CancellableInvitationObservable, Invitation, InvitationEncoder } from '@dxos/react-client/invitations';
|
|
13
13
|
import { Button, Clipboard, Icon, Input, useId, useTranslation } from '@dxos/react-ui';
|
|
14
|
-
import {
|
|
14
|
+
import { ControlFrame, ControlFrameItem, ControlItemInput, ControlPage, ControlSection } from '@dxos/react-ui-form';
|
|
15
15
|
import { StackItem } from '@dxos/react-ui-stack';
|
|
16
16
|
import { DataType } from '@dxos/schema';
|
|
17
17
|
import {
|
|
@@ -41,13 +41,12 @@ const handleInvitationEvent = (invitation: Invitation, subscription: ZenObservab
|
|
|
41
41
|
}
|
|
42
42
|
};
|
|
43
43
|
|
|
44
|
-
export
|
|
45
|
-
space,
|
|
46
|
-
createInvitationUrl,
|
|
47
|
-
}: {
|
|
44
|
+
export type MembersContainerProps = {
|
|
48
45
|
space: Space;
|
|
49
46
|
createInvitationUrl: (invitationCode: string) => string;
|
|
50
|
-
}
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export const MembersContainer = ({ space, createInvitationUrl }: MembersContainerProps) => {
|
|
51
50
|
const { t } = useTranslation(SPACE_PLUGIN);
|
|
52
51
|
const config = useConfig();
|
|
53
52
|
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
@@ -168,7 +167,7 @@ export const MembersContainer = ({
|
|
|
168
167
|
)}
|
|
169
168
|
</ControlFrame>
|
|
170
169
|
{/* TODO(wittjosiah): Make ControlItemInput & ControlFrame compatible. */}
|
|
171
|
-
<div className='justify-center
|
|
170
|
+
<div className='justify-center p-0 mbs-4 container-max-width grid grid-cols-1 md:grid-cols-[1fr_min-content]'>
|
|
172
171
|
<ControlItemInput title={t('space locked label')} description={t('space locked description')}>
|
|
173
172
|
<Input.Switch checked={locked} onCheckedChange={handleChangeLocked} classNames='justify-self-end' />
|
|
174
173
|
</ControlItemInput>
|
|
@@ -7,7 +7,7 @@ import React, { useCallback } from 'react';
|
|
|
7
7
|
import { type JsonPath, setValue } from '@dxos/echo-schema';
|
|
8
8
|
import { invariant } from '@dxos/invariant';
|
|
9
9
|
import { useClient } from '@dxos/react-client';
|
|
10
|
-
import {
|
|
10
|
+
import { Filter, getSpace, useQuery, useSchema } from '@dxos/react-client/echo';
|
|
11
11
|
import { Callout, useTranslation } from '@dxos/react-ui';
|
|
12
12
|
import { useSelected } from '@dxos/react-ui-attention';
|
|
13
13
|
import { Form, useRefQueryLookupHandler } from '@dxos/react-ui-form';
|
|
@@ -9,9 +9,10 @@ import { ForeignKey } from '@dxos/echo-schema';
|
|
|
9
9
|
import { IconButton, useTranslation } from '@dxos/react-ui';
|
|
10
10
|
import { Form } from '@dxos/react-ui-form';
|
|
11
11
|
|
|
12
|
-
import { ForeignKeys } from './ForeignKeys';
|
|
13
12
|
import { SPACE_PLUGIN } from '../../meta';
|
|
14
13
|
|
|
14
|
+
import { ForeignKeys } from './ForeignKeys';
|
|
15
|
+
|
|
15
16
|
const initialValues = {
|
|
16
17
|
source: '',
|
|
17
18
|
id: '',
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { useCallback, useRef, useState } from 'react';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { LayoutAction, createIntent, useIntentDispatcher } from '@dxos/app-framework';
|
|
8
|
+
import { Obj } from '@dxos/echo';
|
|
8
9
|
import { type Live } from '@dxos/live-object';
|
|
9
10
|
import { log } from '@dxos/log';
|
|
10
11
|
import { Button, Input, useTranslation } from '@dxos/react-ui';
|
|
@@ -13,24 +14,17 @@ import { SPACE_PLUGIN } from '../meta';
|
|
|
13
14
|
|
|
14
15
|
export const POPOVER_RENAME_OBJECT = `${SPACE_PLUGIN}/PopoverRenameObject`;
|
|
15
16
|
|
|
16
|
-
export const PopoverRenameObject = ({ object
|
|
17
|
+
export const PopoverRenameObject = ({ object }: { object: Live<any> }) => {
|
|
17
18
|
const { t } = useTranslation(SPACE_PLUGIN);
|
|
18
19
|
const doneButton = useRef<HTMLButtonElement>(null);
|
|
19
|
-
|
|
20
|
-
const object = obj as any;
|
|
21
|
-
// TODO(burdon): Field should not be hardcoded field.
|
|
22
|
-
const [name, setName] = useState(object.name || object.title || '');
|
|
20
|
+
const [name, setName] = useState(Obj.getLabel(object));
|
|
23
21
|
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
24
22
|
|
|
25
23
|
const handleDone = useCallback(() => {
|
|
26
24
|
try {
|
|
27
|
-
|
|
25
|
+
name && Obj.setLabel(object, name);
|
|
28
26
|
} catch (err) {
|
|
29
|
-
|
|
30
|
-
object.title = name;
|
|
31
|
-
} catch {
|
|
32
|
-
log.error('Failed to rename object', { err });
|
|
33
|
-
}
|
|
27
|
+
log.error('Failed to rename object', { err });
|
|
34
28
|
}
|
|
35
29
|
void dispatch(
|
|
36
30
|
createIntent(LayoutAction.UpdatePopover, {
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { useCallback, useRef, useState } from 'react';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { LayoutAction, createIntent, useIntentDispatcher } from '@dxos/app-framework';
|
|
8
8
|
import { type Space } from '@dxos/react-client/echo';
|
|
9
9
|
import { Button, Input, Popover, useTranslation } from '@dxos/react-ui';
|
|
10
10
|
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React, { useCallback } from 'react';
|
|
6
|
+
|
|
7
|
+
import { Obj } from '@dxos/echo';
|
|
8
|
+
import { type JsonPath, setValue } from '@dxos/echo-schema';
|
|
9
|
+
import { invariant } from '@dxos/invariant';
|
|
10
|
+
import { getSpace } from '@dxos/react-client/echo';
|
|
11
|
+
import { Form, useRefQueryLookupHandler } from '@dxos/react-ui-form';
|
|
12
|
+
|
|
13
|
+
export const RecordMain = ({ record }: { record: Obj.Any }) => {
|
|
14
|
+
const space = getSpace(record);
|
|
15
|
+
const schema = Obj.getSchema(record);
|
|
16
|
+
invariant(schema, 'Record has no schema.');
|
|
17
|
+
|
|
18
|
+
const handleRefQueryLookup = useRefQueryLookupHandler({ space });
|
|
19
|
+
|
|
20
|
+
const handleSave = useCallback(
|
|
21
|
+
(values: any, { changed }: { changed: Record<JsonPath, boolean> }) => {
|
|
22
|
+
const id = values.id;
|
|
23
|
+
invariant(typeof id === 'string');
|
|
24
|
+
|
|
25
|
+
const changedPaths = Object.keys(changed).filter((path) => changed[path as JsonPath]) as JsonPath[];
|
|
26
|
+
for (const path of changedPaths) {
|
|
27
|
+
const value = values[path];
|
|
28
|
+
setValue(record, path, value);
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
[record],
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
return (
|
|
35
|
+
<div role='none' className='container-max-width flex flex-col p-2 gap-1 overflow-y-auto'>
|
|
36
|
+
<div key={record.id} className='border border-separator rounded'>
|
|
37
|
+
<Form autoSave schema={schema} values={record} onSave={handleSave} onQueryRefOptions={handleRefQueryLookup} />
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
40
|
+
);
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export default RecordMain;
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import React, {
|
|
5
|
+
import React, { useEffect, useState } from 'react';
|
|
6
6
|
|
|
7
7
|
import { type Type } from '@dxos/echo';
|
|
8
8
|
import { type Space } from '@dxos/react-client/echo';
|
|
9
9
|
import { useTranslation } from '@dxos/react-ui';
|
|
10
|
-
import {
|
|
10
|
+
import { ControlPage, ControlSection, controlItemClasses } from '@dxos/react-ui-form';
|
|
11
11
|
import { StackItem } from '@dxos/react-ui-stack';
|
|
12
12
|
|
|
13
13
|
import { SPACE_PLUGIN } from '../meta';
|
|
@@ -7,8 +7,8 @@ import React from 'react';
|
|
|
7
7
|
import { createIntent, useIntentDispatcher } from '@dxos/app-framework';
|
|
8
8
|
import { useClient } from '@dxos/react-client';
|
|
9
9
|
import { useSpaces } from '@dxos/react-client/echo';
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
10
|
+
import { IconButton, Input, List, ListItem, toLocalizedString, useTranslation } from '@dxos/react-ui';
|
|
11
|
+
import { ControlGroup, ControlItemInput, ControlPage, ControlSection, controlItemClasses } from '@dxos/react-ui-form';
|
|
12
12
|
|
|
13
13
|
import { SPACE_PLUGIN } from '../meta';
|
|
14
14
|
import { SpaceAction, type SpaceSettingsProps } from '../types';
|
|
@@ -20,18 +20,17 @@ export const SpacePluginSettings = ({ settings }: { settings: SpaceSettingsProps
|
|
|
20
20
|
const spaces = useSpaces({ all: settings.showHidden });
|
|
21
21
|
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
22
22
|
|
|
23
|
-
// TODO(wittjosiah): Migrate to new form container.
|
|
24
23
|
return (
|
|
25
24
|
<ControlPage>
|
|
26
25
|
<ControlSection title={t('space settings label')} description={t('space settings description')}>
|
|
27
|
-
<
|
|
28
|
-
<
|
|
26
|
+
<ControlGroup>
|
|
27
|
+
<ControlItemInput title={t('show hidden spaces label')}>
|
|
29
28
|
<Input.Switch
|
|
30
29
|
checked={settings.showHidden}
|
|
31
30
|
onCheckedChange={(checked) => (settings.showHidden = !!checked)}
|
|
32
31
|
/>
|
|
33
|
-
</
|
|
34
|
-
</
|
|
32
|
+
</ControlItemInput>
|
|
33
|
+
</ControlGroup>
|
|
35
34
|
<List classNames={[controlItemClasses, 'flex flex-col gap-trimSm']}>
|
|
36
35
|
{spaces.map((space) => (
|
|
37
36
|
<ListItem.Root key={space.id} classNames='is-full items-center'>
|
|
@@ -4,16 +4,17 @@
|
|
|
4
4
|
|
|
5
5
|
import '@dxos-theme';
|
|
6
6
|
|
|
7
|
-
import { type Meta } from '@storybook/react-vite';
|
|
7
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
8
8
|
import React from 'react';
|
|
9
9
|
|
|
10
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
|
|
|
14
|
-
import { FullPresence, type MemberPresenceProps, SmallPresence, type Member } from './SpacePresence';
|
|
15
14
|
import { translations } from '../translations';
|
|
16
15
|
|
|
16
|
+
import { FullPresence, type Member, type MemberPresenceProps, SmallPresence } from './SpacePresence';
|
|
17
|
+
|
|
17
18
|
const nViewers = (n: number, currentlyAttended = true): Member[] =>
|
|
18
19
|
Array.from({ length: n }, () => ({
|
|
19
20
|
role: HaloSpaceMember.Role.ADMIN,
|
|
@@ -98,10 +99,12 @@ export const Small = () => {
|
|
|
98
99
|
);
|
|
99
100
|
};
|
|
100
101
|
|
|
101
|
-
const meta
|
|
102
|
+
const meta = {
|
|
102
103
|
title: 'plugins/plugin-space/SpacePresence',
|
|
103
104
|
decorators: [withTheme, withLayout()],
|
|
104
105
|
parameters: { translations },
|
|
105
|
-
}
|
|
106
|
+
} satisfies Meta<typeof IdentityDid>;
|
|
106
107
|
|
|
107
108
|
export default meta;
|
|
109
|
+
|
|
110
|
+
type Story = StoryObj<typeof meta>;
|
|
@@ -9,22 +9,22 @@ import { useAppGraph, useCapability } from '@dxos/app-framework';
|
|
|
9
9
|
import { generateName } from '@dxos/display-name';
|
|
10
10
|
import { type Type } from '@dxos/echo';
|
|
11
11
|
import { PublicKey, useClient } from '@dxos/react-client';
|
|
12
|
-
import {
|
|
12
|
+
import { type SpaceMember, fullyQualifiedId, getSpace, useMembers } from '@dxos/react-client/echo';
|
|
13
13
|
import { type Identity, useIdentity } from '@dxos/react-client/halo';
|
|
14
14
|
import {
|
|
15
15
|
Avatar,
|
|
16
16
|
type AvatarContentProps,
|
|
17
|
+
type DxAvatar,
|
|
18
|
+
List,
|
|
19
|
+
ListItem,
|
|
20
|
+
Popover,
|
|
17
21
|
type Size,
|
|
18
22
|
type ThemedClassName,
|
|
19
23
|
Tooltip,
|
|
20
|
-
Popover,
|
|
21
|
-
useTranslation,
|
|
22
|
-
List,
|
|
23
|
-
ListItem,
|
|
24
24
|
useDefaultValue,
|
|
25
|
-
|
|
25
|
+
useTranslation,
|
|
26
26
|
} from '@dxos/react-ui';
|
|
27
|
-
import { AttentionGlyph, useAttended, useAttention
|
|
27
|
+
import { AttentionGlyph, type AttentionGlyphProps, useAttended, useAttention } from '@dxos/react-ui-attention';
|
|
28
28
|
import { ComplexMap, keyToFallback } from '@dxos/util';
|
|
29
29
|
|
|
30
30
|
import { SpaceCapabilities } from '../capabilities';
|
|
@@ -10,19 +10,20 @@ 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 { SpaceSettingsContainer, type SpaceSettingsContainerProps } from './SpaceSettingsContainer';
|
|
14
13
|
import { translations } from '../../translations';
|
|
15
14
|
|
|
16
|
-
|
|
15
|
+
import { SpaceSettingsContainer, type SpaceSettingsContainerProps } from './SpaceSettingsContainer';
|
|
16
|
+
|
|
17
|
+
const Story = (props: Partial<SpaceSettingsContainerProps>) => {
|
|
17
18
|
const { space } = useClientProvider();
|
|
18
19
|
return (
|
|
19
20
|
<div role='none' className='p-2 border border-primary-500 rounded'>
|
|
20
|
-
<SpaceSettingsContainer {...
|
|
21
|
+
<SpaceSettingsContainer {...props} space={space!} />
|
|
21
22
|
</div>
|
|
22
23
|
);
|
|
23
24
|
};
|
|
24
25
|
|
|
25
|
-
const meta
|
|
26
|
+
const meta = {
|
|
26
27
|
title: 'plugins/plugin-space/SpaceSettingsContainer',
|
|
27
28
|
component: SpaceSettingsContainer,
|
|
28
29
|
render: Story,
|
|
@@ -31,8 +32,10 @@ const meta: Meta = {
|
|
|
31
32
|
translations,
|
|
32
33
|
layout: 'centered',
|
|
33
34
|
},
|
|
34
|
-
}
|
|
35
|
+
} satisfies Meta<typeof SpaceSettingsContainer>;
|
|
35
36
|
|
|
36
37
|
export default meta;
|
|
37
38
|
|
|
39
|
+
type Story = StoryObj<typeof meta>;
|
|
40
|
+
|
|
38
41
|
export const Default: StoryObj<typeof SpaceSettingsContainer> = {};
|
|
@@ -2,22 +2,22 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { Schema, pipe } from 'effect';
|
|
6
6
|
import React, { type ChangeEvent, useCallback, useMemo, useState } from 'react';
|
|
7
7
|
|
|
8
|
-
import { chain, createIntent,
|
|
8
|
+
import { LayoutAction, chain, createIntent, useIntentDispatcher } from '@dxos/app-framework';
|
|
9
9
|
import { log } from '@dxos/log';
|
|
10
10
|
import { EdgeReplicationSetting } from '@dxos/protocols/proto/dxos/echo/metadata';
|
|
11
11
|
import { useClient } from '@dxos/react-client';
|
|
12
|
-
import {
|
|
12
|
+
import { type Space, SpaceState } from '@dxos/react-client/echo';
|
|
13
13
|
import { Button, Input, useMulticastObservable, useTranslation } from '@dxos/react-ui';
|
|
14
14
|
import {
|
|
15
|
-
Form,
|
|
16
|
-
type InputComponent,
|
|
17
15
|
ControlItem,
|
|
18
16
|
ControlItemInput,
|
|
19
|
-
ControlSection,
|
|
20
17
|
ControlPage,
|
|
18
|
+
ControlSection,
|
|
19
|
+
Form,
|
|
20
|
+
type InputComponent,
|
|
21
21
|
} from '@dxos/react-ui-form';
|
|
22
22
|
import { HuePicker, IconPicker } from '@dxos/react-ui-pickers';
|
|
23
23
|
import { StackItem } from '@dxos/react-ui-stack';
|
|
@@ -162,7 +162,7 @@ export const SpaceSettingsContainer = ({ space }: SpaceSettingsContainerProps) =
|
|
|
162
162
|
);
|
|
163
163
|
|
|
164
164
|
return (
|
|
165
|
-
<StackItem.Content classNames='block overflow-y-auto
|
|
165
|
+
<StackItem.Content classNames='block overflow-y-auto'>
|
|
166
166
|
<ControlPage>
|
|
167
167
|
<ControlSection
|
|
168
168
|
title={t('space properties settings verbose label', { ns: SPACE_PLUGIN })}
|
|
@@ -175,7 +175,7 @@ export const SpaceSettingsContainer = ({ space }: SpaceSettingsContainerProps) =
|
|
|
175
175
|
onSave={handleSave}
|
|
176
176
|
Custom={customElements}
|
|
177
177
|
outerSpacing={false}
|
|
178
|
-
classNames='container-max-width grid grid-cols-1 md:grid-cols-[1fr_min-content]
|
|
178
|
+
classNames='container-max-width grid grid-cols-1 md:grid-cols-[1fr_min-content]'
|
|
179
179
|
/>
|
|
180
180
|
</ControlSection>
|
|
181
181
|
</ControlPage>
|