@dxos/plugin-space 0.8.4-main.f9ba587 → 0.8.4-main.fd6878d
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/CollectionMain-D2B75XBS.mjs +31 -0
- package/dist/lib/browser/CollectionMain-D2B75XBS.mjs.map +7 -0
- package/dist/lib/browser/ObjectDetailsPanel-SY6FYTYC.mjs +88 -0
- package/dist/lib/browser/ObjectDetailsPanel-SY6FYTYC.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-PMDF6PJV.mjs → app-graph-builder-VZW75QPJ.mjs} +174 -26
- package/dist/lib/browser/app-graph-builder-VZW75QPJ.mjs.map +7 -0
- package/dist/lib/browser/{app-graph-serializer-UKYMBX4O.mjs → app-graph-serializer-YPHYVZAP.mjs} +4 -4
- package/dist/lib/browser/{chunk-S6NY637J.mjs → chunk-3UFG6LQQ.mjs} +57 -3
- package/dist/lib/browser/chunk-3UFG6LQQ.mjs.map +7 -0
- package/dist/lib/browser/{chunk-C7KGJTAL.mjs → chunk-CBYL62HG.mjs} +3 -2
- package/dist/lib/browser/chunk-CBYL62HG.mjs.map +7 -0
- package/dist/lib/browser/{chunk-VLBRSGJ2.mjs → chunk-DYKFFVN6.mjs} +2 -2
- package/dist/lib/browser/{chunk-VLBRSGJ2.mjs.map → chunk-DYKFFVN6.mjs.map} +3 -3
- package/dist/lib/browser/{chunk-GVTXQCIW.mjs → chunk-PSIBVBTA.mjs} +386 -319
- package/dist/lib/browser/chunk-PSIBVBTA.mjs.map +7 -0
- package/dist/lib/browser/{chunk-XXIPJLJF.mjs → chunk-Q5EEPP3S.mjs} +2 -1
- package/dist/lib/browser/chunk-Q5EEPP3S.mjs.map +7 -0
- package/dist/lib/browser/{chunk-WBSEOLEM.mjs → chunk-SMB4DGYO.mjs} +129 -25
- package/dist/lib/browser/chunk-SMB4DGYO.mjs.map +7 -0
- package/dist/lib/browser/{chunk-6VLSHG4A.mjs → chunk-WAXS2ZVX.mjs} +68 -7
- package/dist/lib/browser/chunk-WAXS2ZVX.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 +103 -12
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-resolver-WK5WYFH3.mjs → intent-resolver-TS6CCKST.mjs} +166 -16
- package/dist/lib/browser/intent-resolver-TS6CCKST.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-root-7S6FIC5G.mjs → react-root-RQGTZ2ZO.mjs} +6 -6
- package/dist/lib/browser/{react-root-7S6FIC5G.mjs.map → react-root-RQGTZ2ZO.mjs.map} +2 -2
- package/dist/lib/browser/{react-surface-6C3YJNDK.mjs → react-surface-V3ARS2BP.mjs} +48 -16
- package/dist/lib/browser/react-surface-V3ARS2BP.mjs.map +7 -0
- package/dist/lib/browser/{schema-defs-K3B3OAH4.mjs → schema-defs-5LBA43X5.mjs} +2 -2
- package/dist/lib/browser/schema-defs-5LBA43X5.mjs.map +7 -0
- package/dist/lib/browser/{schema-tools-BNP4JTD7.mjs → schema-tools-LPL35WOJ.mjs} +11 -11
- package/dist/lib/browser/schema-tools-LPL35WOJ.mjs.map +7 -0
- package/dist/lib/browser/{settings-XNWYRWNM.mjs → settings-FLLBP5KI.mjs} +2 -2
- package/dist/lib/browser/{spaces-ready-K7NSNBHM.mjs → spaces-ready-FXEP6XEW.mjs} +14 -12
- package/dist/lib/browser/spaces-ready-FXEP6XEW.mjs.map +7 -0
- package/dist/lib/browser/{state-522XTUR4.mjs → state-K3UBPKYP.mjs} +2 -2
- package/dist/lib/{node-esm/state-C4IOXPZP.mjs.map → browser/state-K3UBPKYP.mjs.map} +2 -2
- package/dist/lib/browser/types/index.mjs +1 -1
- package/dist/lib/node-esm/CollectionMain-ZJIFCWKZ.mjs +32 -0
- package/dist/lib/node-esm/CollectionMain-ZJIFCWKZ.mjs.map +7 -0
- package/dist/lib/node-esm/ObjectDetailsPanel-3MYLTMXN.mjs +89 -0
- package/dist/lib/node-esm/ObjectDetailsPanel-3MYLTMXN.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-TO72W6MI.mjs → app-graph-builder-XNVQOJLE.mjs} +174 -26
- package/dist/lib/node-esm/app-graph-builder-XNVQOJLE.mjs.map +7 -0
- package/dist/lib/node-esm/{app-graph-serializer-LA3IZDXJ.mjs → app-graph-serializer-PKVLWV6V.mjs} +4 -4
- package/dist/lib/node-esm/{chunk-AT7LGFER.mjs → chunk-7MZ3J3LI.mjs} +2 -1
- package/dist/lib/node-esm/chunk-7MZ3J3LI.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-HJJHLWKY.mjs → chunk-CTQMR7E3.mjs} +129 -25
- package/dist/lib/node-esm/chunk-CTQMR7E3.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-72QMMRKC.mjs → chunk-FJZNSJC4.mjs} +3 -2
- package/dist/lib/node-esm/chunk-FJZNSJC4.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-SXD6T2N4.mjs → chunk-HYIZVPOA.mjs} +68 -7
- package/dist/lib/node-esm/chunk-HYIZVPOA.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-SSLBYZEY.mjs → chunk-KLG4Y4GY.mjs} +2 -2
- package/dist/lib/node-esm/{chunk-SSLBYZEY.mjs.map → chunk-KLG4Y4GY.mjs.map} +3 -3
- package/dist/lib/node-esm/{chunk-OUBADVJE.mjs → chunk-KYUHPPRN.mjs} +386 -319
- package/dist/lib/node-esm/chunk-KYUHPPRN.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-2THX6G4C.mjs → chunk-S7MKRQHY.mjs} +57 -3
- package/dist/lib/node-esm/chunk-S7MKRQHY.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 +103 -12
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/{intent-resolver-HSR27ME4.mjs → intent-resolver-W6P27SCF.mjs} +166 -16
- package/dist/lib/node-esm/intent-resolver-W6P27SCF.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-root-HUK3ANLV.mjs → react-root-N27KETKT.mjs} +6 -6
- package/dist/lib/node-esm/{react-root-HUK3ANLV.mjs.map → react-root-N27KETKT.mjs.map} +2 -2
- package/dist/lib/node-esm/{react-surface-AGAWX7DD.mjs → react-surface-TNPAUQCM.mjs} +48 -16
- package/dist/lib/node-esm/react-surface-TNPAUQCM.mjs.map +7 -0
- package/dist/lib/node-esm/{schema-defs-4MCDG4DV.mjs → schema-defs-TPWZPDCR.mjs} +2 -2
- package/dist/lib/node-esm/schema-defs-TPWZPDCR.mjs.map +7 -0
- package/dist/lib/node-esm/{schema-tools-KWW5PTML.mjs → schema-tools-PJE2FKWH.mjs} +11 -11
- package/dist/lib/node-esm/schema-tools-PJE2FKWH.mjs.map +7 -0
- package/dist/lib/node-esm/{settings-YGKHGFPH.mjs → settings-WKUWY3P6.mjs} +2 -2
- package/dist/lib/node-esm/{spaces-ready-UM2P3DCR.mjs → spaces-ready-PQLLIO5W.mjs} +14 -12
- package/dist/lib/node-esm/spaces-ready-PQLLIO5W.mjs.map +7 -0
- package/dist/lib/node-esm/{state-C4IOXPZP.mjs → state-4M5A6OSB.mjs} +2 -2
- package/dist/lib/node-esm/state-4M5A6OSB.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.map +1 -1
- package/dist/types/src/capabilities/capabilities.d.ts +9 -3
- package/dist/types/src/capabilities/capabilities.d.ts.map +1 -1
- package/dist/types/src/capabilities/identity-created.d.ts.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-root.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/schema-defs.d.ts.map +1 -1
- package/dist/types/src/capabilities/schema-tools.d.ts.map +1 -1
- package/dist/types/src/capabilities/spaces-ready.d.ts.map +1 -1
- package/dist/types/src/capabilities/state.d.ts.map +1 -1
- package/dist/types/src/components/AwaitingObject.d.ts.map +1 -1
- package/dist/types/src/components/CollectionMain.d.ts +1 -0
- package/dist/types/src/components/CollectionMain.d.ts.map +1 -1
- package/dist/types/src/components/CreateDialog/CreateObjectDialog.d.ts +3 -2
- package/dist/types/src/components/CreateDialog/CreateObjectDialog.d.ts.map +1 -1
- package/dist/types/src/components/CreateDialog/CreateObjectDialog.stories.d.ts.map +1 -1
- package/dist/types/src/components/CreateDialog/CreateObjectPanel.d.ts +1 -1
- package/dist/types/src/components/CreateDialog/CreateObjectPanel.d.ts.map +1 -1
- package/dist/types/src/components/MembersContainer.d.ts.map +1 -1
- package/dist/types/src/components/MembersContainer.stories.d.ts +1 -1
- package/dist/types/src/components/MembersContainer.stories.d.ts.map +1 -1
- package/dist/types/src/components/MenuFooter.d.ts.map +1 -1
- package/dist/types/src/components/ObjectDetailsPanel.d.ts +9 -0
- package/dist/types/src/components/ObjectDetailsPanel.d.ts.map +1 -0
- package/dist/types/src/components/ObjectSettings/AdvancedObjectSettings.d.ts.map +1 -1
- package/dist/types/src/components/PersistenceStatus.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/SpacePresence.d.ts.map +1 -1
- 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.map +1 -1
- package/dist/types/src/components/SyncStatus/SyncStatus.d.ts +1 -1
- package/dist/types/src/components/SyncStatus/SyncStatus.d.ts.map +1 -1
- package/dist/types/src/components/SyncStatus/SyncStatus.stories.d.ts.map +1 -1
- package/dist/types/src/components/SyncStatus/status.d.ts +5 -5
- package/dist/types/src/components/ViewEditor.d.ts +8 -0
- package/dist/types/src/components/ViewEditor.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +11 -1
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/events.d.ts +1 -0
- package/dist/types/src/events.d.ts.map +1 -1
- package/dist/types/src/hooks/useActiveSpace.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +65 -4
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +82 -2
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/src/util.d.ts +31 -5
- package/dist/types/src/util.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +50 -50
- package/src/SpacePlugin.ts +88 -5
- package/src/capabilities/app-graph-builder.ts +210 -12
- package/src/capabilities/capabilities.ts +8 -3
- package/src/capabilities/identity-created.ts +1 -1
- package/src/capabilities/intent-resolver.ts +120 -10
- package/src/capabilities/react-root.tsx +2 -1
- package/src/capabilities/react-surface.tsx +66 -15
- package/src/capabilities/schema-defs.ts +3 -2
- package/src/capabilities/schema-tool.test.ts +1 -1
- package/src/capabilities/schema-tools.ts +11 -11
- package/src/capabilities/spaces-ready.ts +10 -7
- package/src/capabilities/state.ts +3 -2
- package/src/components/AwaitingObject.tsx +5 -7
- package/src/components/CollectionMain.tsx +2 -0
- package/src/components/CreateDialog/CreateObjectDialog.stories.tsx +2 -1
- package/src/components/CreateDialog/CreateObjectDialog.tsx +32 -27
- package/src/components/CreateDialog/CreateObjectPanel.tsx +3 -3
- package/src/components/CreateDialog/CreateSpaceDialog.tsx +1 -1
- package/src/components/JoinDialog.tsx +1 -1
- package/src/components/MembersContainer.stories.tsx +4 -3
- package/src/components/MembersContainer.tsx +7 -5
- package/src/components/MenuFooter.tsx +2 -3
- package/src/components/ObjectDetailsPanel.tsx +77 -0
- package/src/components/ObjectSettings/AdvancedObjectSettings.tsx +2 -1
- package/src/components/PersistenceStatus.tsx +5 -6
- package/src/components/PopoverRenameObject.tsx +7 -13
- 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 +2 -2
- package/src/components/SpacePresence.stories.tsx +2 -1
- package/src/components/SpacePresence.tsx +7 -7
- package/src/components/SpaceSettings/SpaceSettingsContainer.stories.tsx +2 -1
- package/src/components/SpaceSettings/SpaceSettingsContainer.tsx +6 -6
- package/src/components/SyncStatus/SyncStatus.stories.tsx +2 -1
- package/src/components/SyncStatus/SyncStatus.tsx +4 -3
- package/src/components/SyncStatus/status.ts +4 -4
- package/src/components/ViewEditor.tsx +64 -0
- package/src/components/index.ts +7 -1
- package/src/events.ts +2 -1
- package/src/hooks/useActiveSpace.ts +1 -1
- package/src/hooks/useInputSurfaceLookup.tsx +1 -1
- package/src/translations.ts +66 -4
- package/src/types/types.ts +56 -3
- package/src/util.tsx +126 -25
- package/dist/lib/browser/app-graph-builder-PMDF6PJV.mjs.map +0 -7
- package/dist/lib/browser/chunk-6VLSHG4A.mjs.map +0 -7
- package/dist/lib/browser/chunk-C7KGJTAL.mjs.map +0 -7
- package/dist/lib/browser/chunk-GVTXQCIW.mjs.map +0 -7
- package/dist/lib/browser/chunk-S6NY637J.mjs.map +0 -7
- package/dist/lib/browser/chunk-WBSEOLEM.mjs.map +0 -7
- package/dist/lib/browser/chunk-XXIPJLJF.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-WK5WYFH3.mjs.map +0 -7
- package/dist/lib/browser/react-surface-6C3YJNDK.mjs.map +0 -7
- package/dist/lib/browser/schema-defs-K3B3OAH4.mjs.map +0 -7
- package/dist/lib/browser/schema-tools-BNP4JTD7.mjs.map +0 -7
- package/dist/lib/browser/spaces-ready-K7NSNBHM.mjs.map +0 -7
- package/dist/lib/browser/state-522XTUR4.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-TO72W6MI.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-2THX6G4C.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-72QMMRKC.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-AT7LGFER.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HJJHLWKY.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-OUBADVJE.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-SXD6T2N4.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-HSR27ME4.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-AGAWX7DD.mjs.map +0 -7
- package/dist/lib/node-esm/schema-defs-4MCDG4DV.mjs.map +0 -7
- package/dist/lib/node-esm/schema-tools-KWW5PTML.mjs.map +0 -7
- package/dist/lib/node-esm/spaces-ready-UM2P3DCR.mjs.map +0 -7
- /package/dist/lib/browser/{app-graph-serializer-UKYMBX4O.mjs.map → app-graph-serializer-YPHYVZAP.mjs.map} +0 -0
- /package/dist/lib/browser/{settings-XNWYRWNM.mjs.map → settings-FLLBP5KI.mjs.map} +0 -0
- /package/dist/lib/node-esm/{app-graph-serializer-LA3IZDXJ.mjs.map → app-graph-serializer-PKVLWV6V.mjs.map} +0 -0
- /package/dist/lib/node-esm/{settings-YGKHGFPH.mjs.map → settings-WKUWY3P6.mjs.map} +0 -0
|
@@ -12,31 +12,32 @@ import {
|
|
|
12
12
|
createIntent,
|
|
13
13
|
createResolver,
|
|
14
14
|
} from '@dxos/app-framework';
|
|
15
|
-
import { Obj, Ref, Relation,
|
|
15
|
+
import { Obj, Ref, Relation, Type } from '@dxos/echo';
|
|
16
16
|
import { invariant } from '@dxos/invariant';
|
|
17
17
|
import { Migrations } from '@dxos/migrations';
|
|
18
18
|
import { ClientCapabilities } from '@dxos/plugin-client';
|
|
19
19
|
import { ObservabilityAction } from '@dxos/plugin-observability/types';
|
|
20
20
|
import { EdgeReplicationSetting } from '@dxos/protocols/proto/dxos/echo/metadata';
|
|
21
|
-
import {
|
|
21
|
+
import { SpaceState, fullyQualifiedId, getSpace, isSpace } from '@dxos/react-client/echo';
|
|
22
22
|
import { Invitation, InvitationEncoder } from '@dxos/react-client/invitations';
|
|
23
23
|
import { ATTENDABLE_PATH_SEPARATOR } from '@dxos/react-ui-attention';
|
|
24
|
-
import { DataType } from '@dxos/schema';
|
|
24
|
+
import { DataType, ProjectionModel } from '@dxos/schema';
|
|
25
25
|
|
|
26
|
-
import { SpaceCapabilities } from './capabilities';
|
|
27
26
|
import {
|
|
28
27
|
CREATE_OBJECT_DIALOG,
|
|
29
28
|
CREATE_SPACE_DIALOG,
|
|
29
|
+
type CreateObjectDialogProps,
|
|
30
30
|
JOIN_DIALOG,
|
|
31
|
+
type JoinDialogProps,
|
|
31
32
|
POPOVER_RENAME_OBJECT,
|
|
32
33
|
POPOVER_RENAME_SPACE,
|
|
33
|
-
type CreateObjectDialogProps,
|
|
34
|
-
type JoinDialogProps,
|
|
35
34
|
} from '../components';
|
|
36
35
|
import { SpaceEvents } from '../events';
|
|
37
36
|
import { SPACE_PLUGIN } from '../meta';
|
|
38
37
|
import { CollectionAction, SpaceAction } from '../types';
|
|
39
|
-
import {
|
|
38
|
+
import { COMPOSER_SPACE_LOCK, cloneObject, getNestedObjects } from '../util';
|
|
39
|
+
|
|
40
|
+
import { SpaceCapabilities } from './capabilities';
|
|
40
41
|
|
|
41
42
|
// TODO(wittjosiah): Remove.
|
|
42
43
|
const SPACE_MAX_OBJECTS = 500;
|
|
@@ -75,17 +76,27 @@ export default ({ context, observability, createInvitationUrl }: IntentResolverO
|
|
|
75
76
|
await space.internal.setEdgeReplicationPreference(EdgeReplicationSetting.ENABLED);
|
|
76
77
|
}
|
|
77
78
|
await space.waitUntilReady();
|
|
79
|
+
|
|
80
|
+
// Create root collection.
|
|
78
81
|
const collection = Obj.make(DataType.Collection, { objects: [] });
|
|
79
82
|
space.properties[DataType.Collection.typename] = Ref.make(collection);
|
|
80
83
|
|
|
84
|
+
// Set current migration version.
|
|
81
85
|
if (Migrations.versionProperty) {
|
|
82
86
|
space.properties[Migrations.versionProperty] = Migrations.targetVersion;
|
|
83
87
|
}
|
|
84
88
|
|
|
89
|
+
// Create records smart collection.
|
|
90
|
+
const records = Obj.make(DataType.QueryCollection, {
|
|
91
|
+
query: { typename: DataType.StoredSchema.typename },
|
|
92
|
+
});
|
|
93
|
+
collection.objects.push(Ref.make(records));
|
|
94
|
+
|
|
95
|
+
// Allow other plugins to add default content.
|
|
85
96
|
await context.activatePromise(SpaceEvents.SpaceCreated);
|
|
86
97
|
const onSpaceCreatedCallbacks = context.getCapabilities(SpaceCapabilities.OnSpaceCreated);
|
|
87
|
-
|
|
88
|
-
|
|
98
|
+
const spaceCreatedIntents = onSpaceCreatedCallbacks.map((onSpaceCreated) =>
|
|
99
|
+
onSpaceCreated({ space, rootCollection: collection }),
|
|
89
100
|
);
|
|
90
101
|
|
|
91
102
|
return {
|
|
@@ -95,6 +106,7 @@ export default ({ context, observability, createInvitationUrl }: IntentResolverO
|
|
|
95
106
|
space,
|
|
96
107
|
},
|
|
97
108
|
intents: [
|
|
109
|
+
...spaceCreatedIntents,
|
|
98
110
|
...(observability
|
|
99
111
|
? [
|
|
100
112
|
createIntent(ObservabilityAction.SendEvent, {
|
|
@@ -309,9 +321,106 @@ export default ({ context, observability, createInvitationUrl }: IntentResolverO
|
|
|
309
321
|
};
|
|
310
322
|
},
|
|
311
323
|
}),
|
|
324
|
+
createResolver({
|
|
325
|
+
intent: SpaceAction.UseStaticSchema,
|
|
326
|
+
resolve: async ({ space, typename }) => {
|
|
327
|
+
const client = context.getCapability(ClientCapabilities.Client);
|
|
328
|
+
const schema = client.graph.schemaRegistry.schemas.find((schema) => Type.getTypename(schema) === typename);
|
|
329
|
+
invariant(schema, `Schema not found: ${typename}`);
|
|
330
|
+
|
|
331
|
+
if (!space.properties.staticRecords) {
|
|
332
|
+
space.properties.staticRecords = [];
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
if (!space.properties.staticRecords.includes(typename)) {
|
|
336
|
+
space.properties.staticRecords.push(typename);
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
await context.activatePromise(SpaceEvents.SchemaAdded);
|
|
340
|
+
const onSchemaAdded = context.getCapabilities(SpaceCapabilities.OnSchemaAdded);
|
|
341
|
+
const schemaAddedIntents = onSchemaAdded.map((onSchemaAdded) => onSchemaAdded({ space, schema }));
|
|
342
|
+
|
|
343
|
+
return {
|
|
344
|
+
data: {},
|
|
345
|
+
intents: [
|
|
346
|
+
...schemaAddedIntents,
|
|
347
|
+
...(observability
|
|
348
|
+
? [
|
|
349
|
+
createIntent(ObservabilityAction.SendEvent, {
|
|
350
|
+
name: 'space.schema.use',
|
|
351
|
+
properties: {
|
|
352
|
+
spaceId: space.id,
|
|
353
|
+
typename: Type.getTypename(schema),
|
|
354
|
+
},
|
|
355
|
+
}),
|
|
356
|
+
]
|
|
357
|
+
: []),
|
|
358
|
+
],
|
|
359
|
+
};
|
|
360
|
+
},
|
|
361
|
+
}),
|
|
362
|
+
createResolver({
|
|
363
|
+
intent: SpaceAction.AddSchema,
|
|
364
|
+
resolve: async ({ space, name, schema: schemaInput }) => {
|
|
365
|
+
const [schema] = await space.db.schemaRegistry.register([schemaInput]);
|
|
366
|
+
if (name) {
|
|
367
|
+
schema.storedSchema.name = name;
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
await context.activatePromise(SpaceEvents.SchemaAdded);
|
|
371
|
+
const onSchemaAdded = context.getCapabilities(SpaceCapabilities.OnSchemaAdded);
|
|
372
|
+
const schemaAddedIntents = onSchemaAdded.map((onSchemaAdded) => onSchemaAdded({ space, schema }));
|
|
373
|
+
|
|
374
|
+
return {
|
|
375
|
+
data: {
|
|
376
|
+
id: schema.id,
|
|
377
|
+
object: schema.storedSchema,
|
|
378
|
+
schema,
|
|
379
|
+
},
|
|
380
|
+
intents: [
|
|
381
|
+
...schemaAddedIntents,
|
|
382
|
+
...(observability
|
|
383
|
+
? [
|
|
384
|
+
createIntent(ObservabilityAction.SendEvent, {
|
|
385
|
+
name: 'space.schema.add',
|
|
386
|
+
properties: {
|
|
387
|
+
spaceId: space.id,
|
|
388
|
+
objectId: schema.id,
|
|
389
|
+
typename: schema.typename,
|
|
390
|
+
},
|
|
391
|
+
}),
|
|
392
|
+
]
|
|
393
|
+
: []),
|
|
394
|
+
],
|
|
395
|
+
};
|
|
396
|
+
},
|
|
397
|
+
}),
|
|
398
|
+
createResolver({
|
|
399
|
+
intent: SpaceAction.DeleteField,
|
|
400
|
+
resolve: async ({ view, fieldId, deletionData }, undo) => {
|
|
401
|
+
const space = getSpace(view);
|
|
402
|
+
invariant(space);
|
|
403
|
+
invariant(view.query.typename);
|
|
404
|
+
const schema = await space.db.schemaRegistry.query({ typename: view.query.typename }).firstOrUndefined();
|
|
405
|
+
invariant(schema);
|
|
406
|
+
const projection = new ProjectionModel(schema.jsonSchema, view.projection);
|
|
407
|
+
if (!undo) {
|
|
408
|
+
const { deleted, index } = projection.deleteFieldProjection(fieldId);
|
|
409
|
+
return {
|
|
410
|
+
undoable: {
|
|
411
|
+
message: ['field deleted label', { ns: SPACE_PLUGIN }],
|
|
412
|
+
data: { deletionData: { ...deleted, index } },
|
|
413
|
+
},
|
|
414
|
+
};
|
|
415
|
+
} else if (undo && deletionData) {
|
|
416
|
+
const { field, props, index } = deletionData;
|
|
417
|
+
projection.setFieldProjection({ field, props }, index);
|
|
418
|
+
}
|
|
419
|
+
},
|
|
420
|
+
}),
|
|
312
421
|
createResolver({
|
|
313
422
|
intent: SpaceAction.OpenCreateObject,
|
|
314
|
-
resolve: ({ target, typename, navigable = true }) => {
|
|
423
|
+
resolve: ({ target, typename, navigable = true, onCreateObject }) => {
|
|
315
424
|
const state = context.getCapability(SpaceCapabilities.State);
|
|
316
425
|
|
|
317
426
|
return {
|
|
@@ -324,6 +433,7 @@ export default ({ context, observability, createInvitationUrl }: IntentResolverO
|
|
|
324
433
|
props: {
|
|
325
434
|
target,
|
|
326
435
|
typename,
|
|
436
|
+
onCreateObject,
|
|
327
437
|
shouldNavigate: navigable
|
|
328
438
|
? (object: Obj.Any) => {
|
|
329
439
|
const isCollection = Obj.instanceOf(DataType.Collection, object);
|
|
@@ -6,10 +6,11 @@ import React from 'react';
|
|
|
6
6
|
|
|
7
7
|
import { Capabilities, contributes, useCapability } from '@dxos/app-framework';
|
|
8
8
|
|
|
9
|
-
import { SpaceCapabilities } from './capabilities';
|
|
10
9
|
import { AwaitingObject } from '../components';
|
|
11
10
|
import { SPACE_PLUGIN } from '../meta';
|
|
12
11
|
|
|
12
|
+
import { SpaceCapabilities } from './capabilities';
|
|
13
|
+
|
|
13
14
|
export default () =>
|
|
14
15
|
contributes(Capabilities.ReactRoot, {
|
|
15
16
|
id: SPACE_PLUGIN,
|
|
@@ -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,
|
|
@@ -19,42 +19,55 @@ import { findAnnotation } from '@dxos/effect';
|
|
|
19
19
|
import { SettingsStore } from '@dxos/local-storage';
|
|
20
20
|
import { ClientCapabilities } from '@dxos/plugin-client';
|
|
21
21
|
import { useClient } from '@dxos/react-client';
|
|
22
|
-
import {
|
|
22
|
+
import {
|
|
23
|
+
type Space,
|
|
24
|
+
SpaceState,
|
|
25
|
+
fullyQualifiedId,
|
|
26
|
+
getSpace,
|
|
27
|
+
isLiveObject,
|
|
28
|
+
isSpace,
|
|
29
|
+
parseId,
|
|
30
|
+
useSpace,
|
|
31
|
+
} from '@dxos/react-client/echo';
|
|
23
32
|
import { Input, useTranslation } from '@dxos/react-ui';
|
|
24
33
|
import { type InputProps, SelectInput } from '@dxos/react-ui-form';
|
|
25
34
|
import { HuePicker, IconPicker } from '@dxos/react-ui-pickers';
|
|
26
35
|
import { DataType, type TypenameAnnotation, TypenameAnnotationId } from '@dxos/schema';
|
|
27
36
|
import { type JoinPanelProps } from '@dxos/shell/react';
|
|
28
37
|
|
|
29
|
-
import { SpaceCapabilities } from './capabilities';
|
|
30
38
|
import {
|
|
31
|
-
CollectionMain,
|
|
32
|
-
CollectionSection,
|
|
33
39
|
CREATE_OBJECT_DIALOG,
|
|
34
40
|
CREATE_SPACE_DIALOG,
|
|
41
|
+
CollectionMain,
|
|
42
|
+
CollectionSection,
|
|
35
43
|
CreateObjectDialog,
|
|
44
|
+
type CreateObjectDialogProps,
|
|
36
45
|
CreateSpaceDialog,
|
|
37
46
|
InlineSyncStatus,
|
|
38
47
|
JOIN_DIALOG,
|
|
39
48
|
JoinDialog,
|
|
40
49
|
MembersContainer,
|
|
41
50
|
MenuFooter,
|
|
51
|
+
ObjectDetailsPanel,
|
|
42
52
|
ObjectSettingsContainer,
|
|
43
53
|
POPOVER_RENAME_OBJECT,
|
|
44
54
|
POPOVER_RENAME_SPACE,
|
|
45
55
|
PopoverRenameObject,
|
|
46
56
|
PopoverRenameSpace,
|
|
57
|
+
RecordMain,
|
|
47
58
|
SchemaContainer,
|
|
48
59
|
SmallPresenceLive,
|
|
49
60
|
SpacePluginSettings,
|
|
50
61
|
SpacePresence,
|
|
51
62
|
SpaceSettingsContainer,
|
|
52
63
|
SyncStatus,
|
|
53
|
-
|
|
64
|
+
ViewEditor,
|
|
54
65
|
} from '../components';
|
|
55
66
|
import { SPACE_PLUGIN } from '../meta';
|
|
56
67
|
import { HueAnnotationId, IconAnnotationId, type SpaceSettingsProps } from '../types';
|
|
57
68
|
|
|
69
|
+
import { SpaceCapabilities } from './capabilities';
|
|
70
|
+
|
|
58
71
|
type ReactSurfaceOptions = {
|
|
59
72
|
createInvitationUrl: (invitationCode: string) => string;
|
|
60
73
|
};
|
|
@@ -80,6 +93,13 @@ export default ({ createInvitationUrl }: ReactSurfaceOptions) =>
|
|
|
80
93
|
/>
|
|
81
94
|
),
|
|
82
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
|
+
}),
|
|
83
103
|
createSurface({
|
|
84
104
|
id: `${SPACE_PLUGIN}/collection-fallback`,
|
|
85
105
|
role: 'article',
|
|
@@ -146,6 +166,19 @@ export default ({ createInvitationUrl }: ReactSurfaceOptions) =>
|
|
|
146
166
|
return <SchemaContainer space={space} />;
|
|
147
167
|
},
|
|
148
168
|
}),
|
|
169
|
+
createSurface({
|
|
170
|
+
id: `${SPACE_PLUGIN}/selected-objects`,
|
|
171
|
+
role: 'article',
|
|
172
|
+
filter: (data): data is { companionTo: DataType.View; subject: 'selected-objects' } =>
|
|
173
|
+
Obj.instanceOf(DataType.View, data.companionTo) && data.subject === 'selected-objects',
|
|
174
|
+
component: ({ data }) => (
|
|
175
|
+
<ObjectDetailsPanel
|
|
176
|
+
key={fullyQualifiedId(data.companionTo)}
|
|
177
|
+
objectId={fullyQualifiedId(data.companionTo)}
|
|
178
|
+
view={data.companionTo}
|
|
179
|
+
/>
|
|
180
|
+
),
|
|
181
|
+
}),
|
|
149
182
|
createSurface({
|
|
150
183
|
id: JOIN_DIALOG,
|
|
151
184
|
role: 'dialog',
|
|
@@ -228,7 +261,7 @@ export default ({ createInvitationUrl }: ReactSurfaceOptions) =>
|
|
|
228
261
|
|
|
229
262
|
const schemaWhitelists = useCapabilities(ClientCapabilities.SchemaWhiteList);
|
|
230
263
|
const whitelistedTypenames = useMemo(
|
|
231
|
-
() => new Set(schemaWhitelists.flatMap((typeArray) => typeArray.map((type) => type
|
|
264
|
+
() => new Set(schemaWhitelists.flatMap((typeArray) => typeArray.map((type) => Type.getTypename(type)))),
|
|
232
265
|
[schemaWhitelists],
|
|
233
266
|
);
|
|
234
267
|
|
|
@@ -239,7 +272,7 @@ export default ({ createInvitationUrl }: ReactSurfaceOptions) =>
|
|
|
239
272
|
objectForms
|
|
240
273
|
.map((form) => Type.getTypename(form.objectSchema))
|
|
241
274
|
// TODO(wittjosiah): Remove.
|
|
242
|
-
.filter((typename) => !OMIT.includes(typename)),
|
|
275
|
+
.filter((typename) => !OMIT.includes(typename) && !typename.endsWith('View')),
|
|
243
276
|
),
|
|
244
277
|
[objectForms],
|
|
245
278
|
);
|
|
@@ -247,13 +280,23 @@ export default ({ createInvitationUrl }: ReactSurfaceOptions) =>
|
|
|
247
280
|
const fixed = client.graph.schemaRegistry.schemas.filter((schema) => {
|
|
248
281
|
const limitedStatic =
|
|
249
282
|
annotation.includes('limited-static') && whitelistedTypenames.has(Type.getTypename(schema));
|
|
283
|
+
const unusedStatic =
|
|
284
|
+
annotation.includes('unused-static') &&
|
|
285
|
+
whitelistedTypenames.has(Type.getTypename(schema)) &&
|
|
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));
|
|
250
291
|
const objectForm = annotation.includes('object-form') && objectFormTypenames.has(Type.getTypename(schema));
|
|
251
|
-
return annotation.includes('static') || limitedStatic || objectForm;
|
|
292
|
+
return annotation.includes('static') || limitedStatic || unusedStatic || usedStatic || objectForm;
|
|
252
293
|
});
|
|
253
294
|
const dynamic = space?.db.schemaRegistry.query().runSync();
|
|
254
295
|
const typenames = Array.from(
|
|
255
296
|
new Set<string>([
|
|
256
297
|
...(annotation.includes('limited-static') ||
|
|
298
|
+
annotation.includes('unused-static') ||
|
|
299
|
+
annotation.includes('used-static') ||
|
|
257
300
|
annotation.includes('static') ||
|
|
258
301
|
annotation.includes('object-form')
|
|
259
302
|
? fixed.map((schema) => Type.getTypename(schema))
|
|
@@ -264,25 +307,33 @@ export default ({ createInvitationUrl }: ReactSurfaceOptions) =>
|
|
|
264
307
|
|
|
265
308
|
const options = useMemo(
|
|
266
309
|
() =>
|
|
267
|
-
typenames
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
310
|
+
typenames
|
|
311
|
+
.map((typename) => ({
|
|
312
|
+
value: typename,
|
|
313
|
+
label: t('typename label', { ns: typename, defaultValue: typename }),
|
|
314
|
+
}))
|
|
315
|
+
.toSorted((a, b) => a.label.localeCompare(b.label)),
|
|
271
316
|
[t, typenames],
|
|
272
317
|
);
|
|
273
318
|
|
|
274
319
|
return <SelectInput {...props} options={options} />;
|
|
275
320
|
},
|
|
276
321
|
}),
|
|
322
|
+
createSurface({
|
|
323
|
+
id: `${SPACE_PLUGIN}/object-settings`,
|
|
324
|
+
role: 'object-settings',
|
|
325
|
+
filter: (data): data is { subject: DataType.View } => Obj.instanceOf(DataType.View, data.subject),
|
|
326
|
+
component: ({ data }) => <ViewEditor view={data.subject} />,
|
|
327
|
+
}),
|
|
277
328
|
createSurface({
|
|
278
329
|
id: POPOVER_RENAME_SPACE,
|
|
279
|
-
role: 'popover',
|
|
330
|
+
role: 'card--popover',
|
|
280
331
|
filter: (data): data is { props: Space } => data.component === POPOVER_RENAME_SPACE && isSpace(data.props),
|
|
281
332
|
component: ({ data }) => <PopoverRenameSpace space={data.props} />,
|
|
282
333
|
}),
|
|
283
334
|
createSurface({
|
|
284
335
|
id: POPOVER_RENAME_OBJECT,
|
|
285
|
-
role: 'popover',
|
|
336
|
+
role: 'card--popover',
|
|
286
337
|
filter: (data): data is { props: Obj.Any } =>
|
|
287
338
|
data.component === POPOVER_RENAME_OBJECT && isLiveObject(data.props),
|
|
288
339
|
component: ({ data }) => <PopoverRenameObject object={data.props} />,
|
|
@@ -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,8 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
import { Schema, SchemaAST } from 'effect';
|
|
6
6
|
|
|
7
|
-
import {
|
|
8
|
-
import { Capabilities,
|
|
7
|
+
import { ToolResult, createTool } from '@dxos/ai';
|
|
8
|
+
import { Capabilities, type PromiseIntentDispatcher, contributes } from '@dxos/app-framework';
|
|
9
9
|
import { type Space } from '@dxos/client/echo';
|
|
10
10
|
import { Type } from '@dxos/echo';
|
|
11
11
|
import { FormatEnum, FormatEnums, SelectOptionSchema } from '@dxos/echo-schema';
|
|
@@ -61,8 +61,8 @@ export default () =>
|
|
|
61
61
|
contributes(Capabilities.Tools, [
|
|
62
62
|
createTool(SYSTEM_NAMESPACE, {
|
|
63
63
|
name: 'list',
|
|
64
|
-
description: 'List registered
|
|
65
|
-
caption: 'Listing registered
|
|
64
|
+
description: 'List registered record types in the space.',
|
|
65
|
+
caption: 'Listing registered record types...',
|
|
66
66
|
schema: Schema.Struct({}),
|
|
67
67
|
execute: async (_input, { extensions }) => {
|
|
68
68
|
invariant(extensions?.space, 'No space.');
|
|
@@ -79,11 +79,11 @@ export default () =>
|
|
|
79
79
|
}),
|
|
80
80
|
createTool(SYSTEM_NAMESPACE, {
|
|
81
81
|
name: 'get',
|
|
82
|
-
description: 'Get a specific
|
|
83
|
-
caption: 'Getting
|
|
82
|
+
description: 'Get a specific record type by its name.',
|
|
83
|
+
caption: 'Getting record...',
|
|
84
84
|
schema: Schema.Struct({
|
|
85
85
|
typename: Schema.String.annotations({
|
|
86
|
-
description: 'The fully qualified
|
|
86
|
+
description: 'The fully qualified name of the record type.',
|
|
87
87
|
}),
|
|
88
88
|
}),
|
|
89
89
|
execute: async ({ typename }, { extensions }) => {
|
|
@@ -100,15 +100,15 @@ export default () =>
|
|
|
100
100
|
}),
|
|
101
101
|
createTool(SYSTEM_NAMESPACE, {
|
|
102
102
|
name: 'create',
|
|
103
|
-
description: 'Create a new
|
|
104
|
-
caption: 'Creating
|
|
103
|
+
description: 'Create a new record type with the provided definition.',
|
|
104
|
+
caption: 'Creating record type...',
|
|
105
105
|
schema: Schema.Struct({
|
|
106
106
|
typename: TypeNameSchema.annotations({
|
|
107
107
|
description:
|
|
108
|
-
'The fully qualified
|
|
108
|
+
'The fully qualified name of the record type. Must start with a domain, and then one or more path components (e.g., "example.com/type/TypeName").',
|
|
109
109
|
}),
|
|
110
110
|
properties: Schema.Array(PropertyDefinitionSchema).pipe(
|
|
111
|
-
Schema.annotations({ description: 'Array of property definitions for the
|
|
111
|
+
Schema.annotations({ description: 'Array of property definitions for the record.' }),
|
|
112
112
|
Schema.mutable,
|
|
113
113
|
),
|
|
114
114
|
}),
|
|
@@ -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,
|
|
@@ -2,14 +2,12 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { CheckCircle, CircleDashed, CircleNotch } from '@phosphor-icons/react';
|
|
6
5
|
import React, { useCallback, useEffect, useState } from 'react';
|
|
7
6
|
|
|
8
|
-
import {
|
|
7
|
+
import { LayoutAction, createIntent, useIntentDispatcher, useLayout } from '@dxos/app-framework';
|
|
9
8
|
import { useClient } from '@dxos/react-client';
|
|
10
9
|
import { Filter, fullyQualifiedId, useQuery } from '@dxos/react-client/echo';
|
|
11
|
-
import { Button, Toast, useTranslation } from '@dxos/react-ui';
|
|
12
|
-
import { getSize, mx } from '@dxos/react-ui-theme';
|
|
10
|
+
import { Button, Icon, Toast, useTranslation } from '@dxos/react-ui';
|
|
13
11
|
|
|
14
12
|
import { SPACE_PLUGIN } from '../meta';
|
|
15
13
|
import { SpaceAction } from '../types';
|
|
@@ -66,17 +64,17 @@ export const AwaitingObject = ({ id }: { id: string }) => {
|
|
|
66
64
|
<Toast.Title classNames='flex items-center gap-2'>
|
|
67
65
|
{found ? (
|
|
68
66
|
<>
|
|
69
|
-
<
|
|
67
|
+
<Icon icon='ph--check-circle--regular' size={5} />
|
|
70
68
|
<span>{t('found object label')}</span>
|
|
71
69
|
</>
|
|
72
70
|
) : waiting ? (
|
|
73
71
|
<>
|
|
74
|
-
<
|
|
72
|
+
<Icon icon='ph--circle-notch--regular' size={5} classNames='animate-spin' />
|
|
75
73
|
<span>{t('waiting for object label')}</span>
|
|
76
74
|
</>
|
|
77
75
|
) : (
|
|
78
76
|
<>
|
|
79
|
-
<
|
|
77
|
+
<Icon icon='ph--circle-dashed--regular' size={5} />
|
|
80
78
|
<span>{t('object not found label')}</span>
|
|
81
79
|
</>
|
|
82
80
|
)}
|
|
@@ -15,9 +15,10 @@ 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
|
|
|
20
|
+
import { CreateObjectDialog, type CreateObjectDialogProps } from './CreateObjectDialog';
|
|
21
|
+
|
|
21
22
|
const Story = (args: CreateObjectDialogProps) => {
|
|
22
23
|
return (
|
|
23
24
|
<Dialog.Root open>
|