@dxos/plugin-space 0.8.4-main.c1de068 → 0.8.4-main.e098934
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-J7KGPJJK.mjs} +7 -5
- package/dist/lib/browser/ObjectDetailsPanel-J7KGPJJK.mjs.map +7 -0
- 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-AFC6PNAB.mjs} +57 -19
- package/dist/lib/browser/app-graph-builder-AFC6PNAB.mjs.map +7 -0
- package/dist/lib/browser/{app-graph-serializer-H6AW7KGS.mjs → app-graph-serializer-Q7QG4EKW.mjs} +4 -4
- package/dist/lib/browser/{chunk-V7MJSSBQ.mjs → chunk-6GRF7NEF.mjs} +100 -104
- package/dist/lib/browser/chunk-6GRF7NEF.mjs.map +7 -0
- 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-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-XUYKJUU7.mjs → chunk-S33AYKSS.mjs} +68 -16
- package/dist/lib/browser/chunk-S33AYKSS.mjs.map +7 -0
- 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-SGTQ52SU.mjs → chunk-URST7EEN.mjs} +10 -4
- package/dist/lib/{node-esm/chunk-JH6F4C3I.mjs.map → browser/chunk-URST7EEN.mjs.map} +3 -3
- package/dist/lib/browser/{chunk-QACNNDOT.mjs → chunk-WZYRDFW7.mjs} +9 -8
- package/dist/lib/browser/chunk-WZYRDFW7.mjs.map +7 -0
- 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 +14 -32
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-resolver-TIXVDYN7.mjs → intent-resolver-CO262Q44.mjs} +33 -28
- package/dist/lib/browser/intent-resolver-CO262Q44.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-root-N2J7TDRX.mjs → react-root-K4IVLFYZ.mjs} +6 -6
- package/dist/lib/browser/{react-root-N2J7TDRX.mjs.map → react-root-K4IVLFYZ.mjs.map} +2 -2
- package/dist/lib/browser/{react-surface-TPNLWJJH.mjs → react-surface-TPUOK2LC.mjs} +26 -15
- package/dist/lib/browser/react-surface-TPUOK2LC.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-ZYH2JWNI.mjs} +2 -2
- package/dist/lib/browser/{spaces-ready-TOPG6IV4.mjs → spaces-ready-3I5LISH4.mjs} +14 -12
- package/dist/lib/browser/spaces-ready-3I5LISH4.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-7ADOXZ5W.mjs} +7 -5
- package/dist/lib/node-esm/ObjectDetailsPanel-7ADOXZ5W.mjs.map +7 -0
- 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-OW2EBYRI.mjs} +57 -19
- package/dist/lib/node-esm/app-graph-builder-OW2EBYRI.mjs.map +7 -0
- package/dist/lib/node-esm/{app-graph-serializer-2ICUGQQT.mjs → app-graph-serializer-6PGC5WR5.mjs} +4 -4
- 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-LGNPMOXU.mjs} +9 -8
- package/dist/lib/node-esm/chunk-LGNPMOXU.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-6X5DLJM5.mjs → chunk-NMCD2PSG.mjs} +100 -104
- package/dist/lib/node-esm/chunk-NMCD2PSG.mjs.map +7 -0
- 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-RXDT5LA5.mjs} +10 -4
- package/dist/lib/node-esm/chunk-RXDT5LA5.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-4AOMYKDE.mjs → chunk-TEUN2E4F.mjs} +68 -16
- package/dist/lib/node-esm/chunk-TEUN2E4F.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 +14 -32
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/{intent-resolver-MHGHRGDT.mjs → intent-resolver-EXPK4B76.mjs} +33 -28
- package/dist/lib/node-esm/intent-resolver-EXPK4B76.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-root-KW3TGJGY.mjs → react-root-4OQ7MPGW.mjs} +6 -6
- package/dist/lib/node-esm/{react-root-KW3TGJGY.mjs.map → react-root-4OQ7MPGW.mjs.map} +2 -2
- package/dist/lib/node-esm/{react-surface-UUIUUD6P.mjs → react-surface-WXEXIDB7.mjs} +26 -15
- package/dist/lib/node-esm/react-surface-WXEXIDB7.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-2RYFMMTP.mjs} +2 -2
- package/dist/lib/node-esm/{spaces-ready-HIUKNDZK.mjs → spaces-ready-JAP22P57.mjs} +14 -12
- package/dist/lib/node-esm/spaces-ready-JAP22P57.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/ObjectDetailsPanel.d.ts.map +1 -1
- package/dist/types/src/components/ObjectSettings/AdvancedObjectSettings.d.ts.map +1 -1
- package/dist/types/src/components/ObjectSettings/ObjectSettingsContainer.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/ViewEditor.d.ts +1 -1
- package/dist/types/src/components/ViewEditor.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 +1216 -26
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +25 -45
- 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 +52 -49
- package/src/SpacePlugin.ts +6 -24
- package/src/capabilities/app-graph-builder.ts +83 -32
- 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 +25 -13
- package/src/capabilities/react-root.tsx +2 -1
- package/src/capabilities/react-surface.tsx +27 -13
- 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 +18 -8
- 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 +4 -2
- package/src/components/ObjectSettings/AdvancedObjectSettings.tsx +2 -1
- package/src/components/ObjectSettings/ObjectSettingsContainer.tsx +3 -2
- 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/ViewEditor.tsx +13 -18
- 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 +8 -7
- package/src/types/types.ts +11 -7
- package/src/util.tsx +62 -13
- package/dist/lib/browser/ObjectDetailsPanel-YPTDQKMG.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-7CZZJS3S.mjs.map +0 -7
- package/dist/lib/browser/chunk-QACNNDOT.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/chunk-XUYKJUU7.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/ObjectDetailsPanel-QKZEDSZK.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-KGIGWC72.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-4AOMYKDE.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-6X5DLJM5.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-P442DOQ3.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-Q7QG4EKW.mjs.map} +0 -0
- /package/dist/lib/browser/{settings-4IMP5RYT.mjs.map → settings-ZYH2JWNI.mjs.map} +0 -0
- /package/dist/lib/node-esm/{app-graph-serializer-2ICUGQQT.mjs.map → app-graph-serializer-6PGC5WR5.mjs.map} +0 -0
- /package/dist/lib/node-esm/{settings-SAOBPND3.mjs.map → settings-2RYFMMTP.mjs.map} +0 -0
|
@@ -7,9 +7,9 @@ import React, { useCallback, useMemo } from 'react';
|
|
|
7
7
|
|
|
8
8
|
import {
|
|
9
9
|
Capabilities,
|
|
10
|
+
Surface,
|
|
10
11
|
contributes,
|
|
11
12
|
createSurface,
|
|
12
|
-
Surface,
|
|
13
13
|
useCapabilities,
|
|
14
14
|
useCapability,
|
|
15
15
|
useLayout,
|
|
@@ -20,14 +20,14 @@ import { SettingsStore } from '@dxos/local-storage';
|
|
|
20
20
|
import { ClientCapabilities } from '@dxos/plugin-client';
|
|
21
21
|
import { useClient } from '@dxos/react-client';
|
|
22
22
|
import {
|
|
23
|
+
type Space,
|
|
24
|
+
SpaceState,
|
|
23
25
|
fullyQualifiedId,
|
|
24
26
|
getSpace,
|
|
25
27
|
isLiveObject,
|
|
26
28
|
isSpace,
|
|
27
29
|
parseId,
|
|
28
|
-
SpaceState,
|
|
29
30
|
useSpace,
|
|
30
|
-
type Space,
|
|
31
31
|
} from '@dxos/react-client/echo';
|
|
32
32
|
import { Input, useTranslation } from '@dxos/react-ui';
|
|
33
33
|
import { type InputProps, SelectInput } from '@dxos/react-ui-form';
|
|
@@ -35,13 +35,13 @@ import { HuePicker, IconPicker } from '@dxos/react-ui-pickers';
|
|
|
35
35
|
import { DataType, type TypenameAnnotation, TypenameAnnotationId } from '@dxos/schema';
|
|
36
36
|
import { type JoinPanelProps } from '@dxos/shell/react';
|
|
37
37
|
|
|
38
|
-
import { SpaceCapabilities } from './capabilities';
|
|
39
38
|
import {
|
|
40
|
-
CollectionMain,
|
|
41
|
-
CollectionSection,
|
|
42
39
|
CREATE_OBJECT_DIALOG,
|
|
43
40
|
CREATE_SPACE_DIALOG,
|
|
41
|
+
CollectionMain,
|
|
42
|
+
CollectionSection,
|
|
44
43
|
CreateObjectDialog,
|
|
44
|
+
type CreateObjectDialogProps,
|
|
45
45
|
CreateSpaceDialog,
|
|
46
46
|
InlineSyncStatus,
|
|
47
47
|
JOIN_DIALOG,
|
|
@@ -54,6 +54,7 @@ import {
|
|
|
54
54
|
POPOVER_RENAME_SPACE,
|
|
55
55
|
PopoverRenameObject,
|
|
56
56
|
PopoverRenameSpace,
|
|
57
|
+
RecordMain,
|
|
57
58
|
SchemaContainer,
|
|
58
59
|
SmallPresenceLive,
|
|
59
60
|
SpacePluginSettings,
|
|
@@ -61,16 +62,17 @@ import {
|
|
|
61
62
|
SpaceSettingsContainer,
|
|
62
63
|
SyncStatus,
|
|
63
64
|
ViewEditor,
|
|
64
|
-
type CreateObjectDialogProps,
|
|
65
65
|
} from '../components';
|
|
66
66
|
import { SPACE_PLUGIN } from '../meta';
|
|
67
67
|
import { HueAnnotationId, IconAnnotationId, type SpaceSettingsProps } from '../types';
|
|
68
68
|
|
|
69
|
+
import { SpaceCapabilities } from './capabilities';
|
|
70
|
+
|
|
69
71
|
type ReactSurfaceOptions = {
|
|
70
72
|
createInvitationUrl: (invitationCode: string) => string;
|
|
71
73
|
};
|
|
72
74
|
|
|
73
|
-
const OMIT = [DataType.Collection.typename, DataType.QueryCollection
|
|
75
|
+
const OMIT = [DataType.Collection.typename, Type.getTypename(DataType.QueryCollection)];
|
|
74
76
|
|
|
75
77
|
export default ({ createInvitationUrl }: ReactSurfaceOptions) =>
|
|
76
78
|
contributes(Capabilities.ReactSurface, [
|
|
@@ -91,6 +93,13 @@ export default ({ createInvitationUrl }: ReactSurfaceOptions) =>
|
|
|
91
93
|
/>
|
|
92
94
|
),
|
|
93
95
|
}),
|
|
96
|
+
createSurface({
|
|
97
|
+
id: `${SPACE_PLUGIN}/record-article`,
|
|
98
|
+
role: 'article',
|
|
99
|
+
position: 'fallback',
|
|
100
|
+
filter: (data): data is { subject: Obj.Any } => Obj.isObject(data.subject),
|
|
101
|
+
component: ({ data }) => <RecordMain record={data.subject} />,
|
|
102
|
+
}),
|
|
94
103
|
createSurface({
|
|
95
104
|
id: `${SPACE_PLUGIN}/collection-fallback`,
|
|
96
105
|
role: 'article',
|
|
@@ -196,13 +205,13 @@ export default ({ createInvitationUrl }: ReactSurfaceOptions) =>
|
|
|
196
205
|
return !!annotation;
|
|
197
206
|
},
|
|
198
207
|
component: ({ data: _, ...inputProps }) => {
|
|
199
|
-
const { label,
|
|
208
|
+
const { label, readonly, type, getValue, onValueChange } = inputProps as any as InputProps;
|
|
200
209
|
const handleChange = useCallback((nextHue: string) => onValueChange(type, nextHue), [onValueChange]);
|
|
201
210
|
const handleReset = useCallback(() => onValueChange(type, undefined), [onValueChange]);
|
|
202
211
|
return (
|
|
203
212
|
<Input.Root>
|
|
204
213
|
<Input.Label>{label}</Input.Label>
|
|
205
|
-
<HuePicker disabled={
|
|
214
|
+
<HuePicker disabled={!!readonly} value={getValue() ?? ''} onChange={handleChange} onReset={handleReset} />
|
|
206
215
|
</Input.Root>
|
|
207
216
|
);
|
|
208
217
|
},
|
|
@@ -215,13 +224,13 @@ export default ({ createInvitationUrl }: ReactSurfaceOptions) =>
|
|
|
215
224
|
return !!annotation;
|
|
216
225
|
},
|
|
217
226
|
component: ({ data: _, ...inputProps }) => {
|
|
218
|
-
const { label,
|
|
227
|
+
const { label, readonly, type, getValue, onValueChange } = inputProps as any as InputProps;
|
|
219
228
|
const handleChange = useCallback((nextIcon: string) => onValueChange(type, nextIcon), [onValueChange]);
|
|
220
229
|
const handleReset = useCallback(() => onValueChange(type, undefined), [onValueChange]);
|
|
221
230
|
return (
|
|
222
231
|
<Input.Root>
|
|
223
232
|
<Input.Label>{label}</Input.Label>
|
|
224
|
-
<IconPicker disabled={
|
|
233
|
+
<IconPicker disabled={!!readonly} value={getValue() ?? ''} onChange={handleChange} onReset={handleReset} />
|
|
225
234
|
</Input.Root>
|
|
226
235
|
);
|
|
227
236
|
},
|
|
@@ -275,14 +284,19 @@ export default ({ createInvitationUrl }: ReactSurfaceOptions) =>
|
|
|
275
284
|
annotation.includes('unused-static') &&
|
|
276
285
|
whitelistedTypenames.has(Type.getTypename(schema)) &&
|
|
277
286
|
!space.properties.staticRecords?.includes(Type.getTypename(schema));
|
|
287
|
+
const usedStatic =
|
|
288
|
+
annotation.includes('used-static') &&
|
|
289
|
+
whitelistedTypenames.has(Type.getTypename(schema)) &&
|
|
290
|
+
space.properties.staticRecords?.includes(Type.getTypename(schema));
|
|
278
291
|
const objectForm = annotation.includes('object-form') && objectFormTypenames.has(Type.getTypename(schema));
|
|
279
|
-
return annotation.includes('static') || limitedStatic || unusedStatic || objectForm;
|
|
292
|
+
return annotation.includes('static') || limitedStatic || unusedStatic || usedStatic || objectForm;
|
|
280
293
|
});
|
|
281
294
|
const dynamic = space?.db.schemaRegistry.query().runSync();
|
|
282
295
|
const typenames = Array.from(
|
|
283
296
|
new Set<string>([
|
|
284
297
|
...(annotation.includes('limited-static') ||
|
|
285
298
|
annotation.includes('unused-static') ||
|
|
299
|
+
annotation.includes('used-static') ||
|
|
286
300
|
annotation.includes('static') ||
|
|
287
301
|
annotation.includes('object-form')
|
|
288
302
|
? fixed.map((schema) => Type.getTypename(schema))
|
|
@@ -2,12 +2,13 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { Capabilities,
|
|
5
|
+
import { Capabilities, type PluginContext, contributes } from '@dxos/app-framework';
|
|
6
6
|
import { ClientCapabilities } from '@dxos/plugin-client';
|
|
7
7
|
|
|
8
|
-
import { SpaceCapabilities } from './capabilities';
|
|
9
8
|
import { type ObjectForm } from '../types';
|
|
10
9
|
|
|
10
|
+
import { SpaceCapabilities } from './capabilities';
|
|
11
|
+
|
|
11
12
|
export default (context: PluginContext) => {
|
|
12
13
|
const registry = context.getCapability(Capabilities.RxRegistry);
|
|
13
14
|
const client = context.getCapability(ClientCapabilities.Client);
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { Option } from 'effect';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { Capabilities, LayoutAction, type PluginContext, contributes, createIntent } from '@dxos/app-framework';
|
|
8
8
|
import { SubscriptionList } from '@dxos/async';
|
|
9
9
|
import { Filter, Obj, Type } from '@dxos/echo';
|
|
10
10
|
import { scheduledEffect } from '@dxos/echo-signals/core';
|
|
@@ -14,13 +14,14 @@ import { ClientCapabilities } from '@dxos/plugin-client';
|
|
|
14
14
|
import { DeckCapabilities } from '@dxos/plugin-deck';
|
|
15
15
|
import { EdgeReplicationSetting } from '@dxos/protocols/proto/dxos/echo/metadata';
|
|
16
16
|
import { PublicKey } from '@dxos/react-client';
|
|
17
|
-
import { FQ_ID_LENGTH,
|
|
17
|
+
import { FQ_ID_LENGTH, SpaceState, parseFullyQualifiedId } from '@dxos/react-client/echo';
|
|
18
18
|
import { ComplexMap, reduceGroupBy } from '@dxos/util';
|
|
19
19
|
|
|
20
|
-
import { SpaceCapabilities } from './capabilities';
|
|
21
20
|
import { SpaceAction } from '../types';
|
|
22
21
|
import { COMPOSER_SPACE_LOCK, SHARED } from '../util';
|
|
23
22
|
|
|
23
|
+
import { SpaceCapabilities } from './capabilities';
|
|
24
|
+
|
|
24
25
|
const ACTIVE_NODE_BROADCAST_INTERVAL = 30_000;
|
|
25
26
|
const WAIT_FOR_OBJECT_TIMEOUT = 5_000;
|
|
26
27
|
|
|
@@ -66,12 +67,14 @@ export default async (context: PluginContext) => {
|
|
|
66
67
|
return;
|
|
67
68
|
}
|
|
68
69
|
|
|
69
|
-
const
|
|
70
|
-
|
|
70
|
+
const id = active[0];
|
|
71
|
+
const node = graph.getNode(id).pipe(Option.getOrNull);
|
|
72
|
+
if (!node && id.length === FQ_ID_LENGTH) {
|
|
73
|
+
void graph.initialize(id);
|
|
71
74
|
const timeout = setTimeout(async () => {
|
|
72
|
-
const node = graph.getNode(
|
|
75
|
+
const node = graph.getNode(id).pipe(Option.getOrNull);
|
|
73
76
|
if (!node) {
|
|
74
|
-
await dispatch(createIntent(SpaceAction.WaitForObject, { id
|
|
77
|
+
await dispatch(createIntent(SpaceAction.WaitForObject, { id }));
|
|
75
78
|
}
|
|
76
79
|
}, WAIT_FOR_OBJECT_TIMEOUT);
|
|
77
80
|
|
|
@@ -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
|
-
import { DataType } from '@dxos/schema';
|
|
23
|
+
import { DataType, typenameFromQuery } 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) => {
|
|
@@ -53,7 +58,9 @@ export const CreateObjectDialog = ({
|
|
|
53
58
|
const [typename, setTypename] = useState<string | undefined>(initialTypename);
|
|
54
59
|
const space = isSpace(target) ? target : getSpace(target);
|
|
55
60
|
const queryCollections = useQuery(space, Query.type(DataType.QueryCollection));
|
|
56
|
-
const hiddenTypenames = queryCollections
|
|
61
|
+
const hiddenTypenames = queryCollections
|
|
62
|
+
.map((collection) => typenameFromQuery(collection.query))
|
|
63
|
+
.filter(isNonNullable);
|
|
57
64
|
|
|
58
65
|
const resolve = useCallback<NonNullable<CreateObjectPanelProps['resolve']>>(
|
|
59
66
|
(typename) =>
|
|
@@ -98,7 +105,9 @@ export const CreateObjectDialog = ({
|
|
|
98
105
|
<Dialog.Content classNames={cardDialogContent}>
|
|
99
106
|
<div role='none' className={cardDialogHeader}>
|
|
100
107
|
<Dialog.Title>
|
|
101
|
-
{t('create object dialog title', {
|
|
108
|
+
{t('create object dialog title', {
|
|
109
|
+
object: t('typename label', { ns: typename, defaultValue: views ? 'View' : 'Item' }),
|
|
110
|
+
})}
|
|
102
111
|
</Dialog.Title>
|
|
103
112
|
<Dialog.Close asChild>
|
|
104
113
|
<Button ref={closeRef} density='fine' variant='ghost' autoFocus>
|
|
@@ -111,8 +120,9 @@ export const CreateObjectDialog = ({
|
|
|
111
120
|
forms={forms}
|
|
112
121
|
spaces={spaces}
|
|
113
122
|
target={target}
|
|
123
|
+
views={views}
|
|
114
124
|
typename={typename}
|
|
115
|
-
|
|
125
|
+
initialFormValues={initialFormValues}
|
|
116
126
|
defaultSpaceId={client.spaces.default.id}
|
|
117
127
|
resolve={resolve}
|
|
118
128
|
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,11 +7,12 @@ 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';
|
|
14
14
|
import { type DataType } from '@dxos/schema';
|
|
15
|
+
import { typenameFromQuery } from '@dxos/schema';
|
|
15
16
|
import { isNonNullable } from '@dxos/util';
|
|
16
17
|
|
|
17
18
|
import { SPACE_PLUGIN } from '../meta';
|
|
@@ -22,7 +23,8 @@ const ObjectDetailsPanel = ({ objectId, view }: RowDetailsPanelProps) => {
|
|
|
22
23
|
const { t } = useTranslation(SPACE_PLUGIN);
|
|
23
24
|
const client = useClient();
|
|
24
25
|
const space = getSpace(view);
|
|
25
|
-
const
|
|
26
|
+
const typename = view.query ? typenameFromQuery(view.query) : undefined;
|
|
27
|
+
const schema = useSchema(client, space, typename);
|
|
26
28
|
|
|
27
29
|
const queriedObjects = useQuery(space, schema ? Filter.type(schema) : Filter.nothing());
|
|
28
30
|
const selectedRows = useSelected(objectId, 'multi');
|
|
@@ -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: '',
|
|
@@ -6,7 +6,7 @@ import React, { useMemo } from 'react';
|
|
|
6
6
|
|
|
7
7
|
import { Surface } from '@dxos/app-framework';
|
|
8
8
|
import { type Obj } from '@dxos/echo';
|
|
9
|
-
import { Clipboard } from '@dxos/react-ui';
|
|
9
|
+
import { Clipboard, Toolbar } from '@dxos/react-ui';
|
|
10
10
|
import { StackItem } from '@dxos/react-ui-stack';
|
|
11
11
|
|
|
12
12
|
import { BaseObjectSettings } from './BaseObjectSettings';
|
|
@@ -21,7 +21,8 @@ export const ObjectSettingsContainer = ({ object, role }: ObjectSettingsContaine
|
|
|
21
21
|
|
|
22
22
|
return (
|
|
23
23
|
<Clipboard.Provider>
|
|
24
|
-
<StackItem.Content toolbar
|
|
24
|
+
<StackItem.Content toolbar>
|
|
25
|
+
<Toolbar.Root></Toolbar.Root>
|
|
25
26
|
<div role='none' className='overflow-y-auto pli-cardSpacingInline plb-cardSpacingBlock'>
|
|
26
27
|
<BaseObjectSettings object={object}>
|
|
27
28
|
<Surface role='base-object-settings' data={data} />
|
|
@@ -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
|
|