@dxos/plugin-space 0.8.2-main.12df754 → 0.8.2-main.2f9c567
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/browser/{app-graph-builder-J4PN5HOM.mjs → app-graph-builder-I2BU35J5.mjs} +6 -6
- package/dist/lib/browser/app-graph-builder-I2BU35J5.mjs.map +7 -0
- package/dist/lib/browser/{app-graph-serializer-6WIAFHYK.mjs → app-graph-serializer-HPYDOKA5.mjs} +4 -4
- package/dist/lib/browser/{chunk-MIJHUABE.mjs → chunk-OS5QKO4Z.mjs} +2 -2
- package/dist/lib/browser/{chunk-FSHDAPFY.mjs → chunk-RERTVPBV.mjs} +2 -2
- package/dist/lib/browser/chunk-RERTVPBV.mjs.map +7 -0
- package/dist/lib/browser/{chunk-MHTZAZT2.mjs → chunk-TSX67XGX.mjs} +136 -138
- package/dist/lib/browser/chunk-TSX67XGX.mjs.map +7 -0
- package/dist/lib/browser/chunk-YQNBTJI4.mjs +308 -0
- package/dist/lib/browser/chunk-YQNBTJI4.mjs.map +7 -0
- package/dist/lib/browser/{identity-created-DVHNLGYU.mjs → identity-created-DWFKBGOA.mjs} +2 -2
- package/dist/lib/browser/index.mjs +13 -16
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-resolver-72IWBVYE.mjs → intent-resolver-GKDCJ4H2.mjs} +83 -69
- package/dist/lib/browser/intent-resolver-GKDCJ4H2.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-root-DRVM5ACV.mjs → react-root-667IZ2Q4.mjs} +4 -4
- package/dist/lib/browser/{react-surface-KODNQYDN.mjs → react-surface-I4RNTGGN.mjs} +5 -22
- package/dist/lib/browser/react-surface-I4RNTGGN.mjs.map +7 -0
- package/dist/lib/browser/{schema-FHTA26SW.mjs → schema-defs-FLFEUSLB.mjs} +4 -4
- package/dist/lib/browser/{schema-FHTA26SW.mjs.map → schema-defs-FLFEUSLB.mjs.map} +2 -2
- package/dist/lib/browser/{schema-tools-YAXPRIXP.mjs → schema-tools-MYC4LTQD.mjs} +22 -22
- package/dist/lib/browser/schema-tools-MYC4LTQD.mjs.map +7 -0
- package/dist/lib/browser/{settings-2UIV5WX5.mjs → settings-ILGGNYJ7.mjs} +2 -2
- package/dist/lib/browser/{spaces-ready-3URIMLCR.mjs → spaces-ready-IXZF3RWW.mjs} +3 -3
- package/dist/lib/browser/types/index.mjs +1 -1
- package/dist/lib/node/{app-graph-builder-3BNPC5GB.cjs → app-graph-builder-H7MDHM3X.cjs} +34 -34
- package/dist/lib/node/app-graph-builder-H7MDHM3X.cjs.map +7 -0
- package/dist/lib/node/{app-graph-serializer-GOLCQHFQ.cjs → app-graph-serializer-G7UYFWG6.cjs} +20 -20
- package/dist/lib/node/chunk-AR3JHVCY.cjs +336 -0
- package/dist/lib/node/chunk-AR3JHVCY.cjs.map +7 -0
- package/dist/lib/node/{chunk-U63V2254.cjs → chunk-EG3WAZLA.cjs} +27 -27
- package/dist/lib/node/chunk-EG3WAZLA.cjs.map +7 -0
- package/dist/lib/node/{chunk-GPZPEQXP.cjs → chunk-HD4C6KKO.cjs} +183 -185
- package/dist/lib/node/chunk-HD4C6KKO.cjs.map +7 -0
- package/dist/lib/node/{chunk-EI3ZPOLJ.cjs → chunk-NCSFM6RA.cjs} +6 -6
- package/dist/lib/node/{identity-created-YYTW4K3Z.cjs → identity-created-YLGVEWAJ.cjs} +6 -6
- package/dist/lib/node/index.cjs +68 -71
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/{intent-resolver-KA56XGUX.cjs → intent-resolver-V7UJKLE7.cjs} +129 -115
- package/dist/lib/node/intent-resolver-V7UJKLE7.cjs.map +7 -0
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/{react-root-6WGN5WRQ.cjs → react-root-I3SSFA5O.cjs} +8 -8
- package/dist/lib/node/{react-surface-37AVZFPL.cjs → react-surface-OLMQCCYD.cjs} +44 -61
- package/dist/lib/node/react-surface-OLMQCCYD.cjs.map +7 -0
- package/dist/lib/node/{schema-PPJ5BZ3A.cjs → schema-defs-PKZVL52M.cjs} +6 -6
- package/dist/lib/node/{schema-PPJ5BZ3A.cjs.map → schema-defs-PKZVL52M.cjs.map} +2 -2
- package/dist/lib/node/{schema-tools-BLIMOZYY.cjs → schema-tools-OE3MFYYH.cjs} +24 -24
- package/dist/lib/node/schema-tools-OE3MFYYH.cjs.map +7 -0
- package/dist/lib/node/{settings-HJROTHC4.cjs → settings-7TC55JP4.cjs} +6 -6
- package/dist/lib/node/{spaces-ready-IWDDIAAD.cjs → spaces-ready-4H3Q46GV.cjs} +11 -11
- package/dist/lib/node/types/index.cjs +15 -15
- package/dist/lib/node/types/index.cjs.map +1 -1
- package/dist/lib/node-esm/{app-graph-builder-OVMSUAX3.mjs → app-graph-builder-NI7X6W3Q.mjs} +6 -6
- package/dist/lib/node-esm/app-graph-builder-NI7X6W3Q.mjs.map +7 -0
- package/dist/lib/node-esm/{app-graph-serializer-AZXSO7HK.mjs → app-graph-serializer-CVPYWWW3.mjs} +4 -4
- package/dist/lib/node-esm/{chunk-TVN6VHTT.mjs → chunk-B2P24Q5R.mjs} +2 -2
- package/dist/lib/node-esm/chunk-B2P24Q5R.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-ABKX22IP.mjs → chunk-BU6F7ZU4.mjs} +136 -138
- package/dist/lib/node-esm/chunk-BU6F7ZU4.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-DUA32XUX.mjs → chunk-FUH5OODY.mjs} +2 -2
- package/dist/lib/node-esm/chunk-RUWTHAV7.mjs +309 -0
- package/dist/lib/node-esm/chunk-RUWTHAV7.mjs.map +7 -0
- package/dist/lib/node-esm/{identity-created-MP4GLXHO.mjs → identity-created-7NHGER3Q.mjs} +2 -2
- package/dist/lib/node-esm/index.mjs +13 -16
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/{intent-resolver-SG2ECM5R.mjs → intent-resolver-IL63YTIT.mjs} +83 -69
- package/dist/lib/node-esm/intent-resolver-IL63YTIT.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-root-MSUT6S2S.mjs → react-root-JEGVIVVK.mjs} +4 -4
- package/dist/lib/node-esm/{react-surface-G73SO23W.mjs → react-surface-DRRXIJBE.mjs} +5 -22
- package/dist/lib/node-esm/react-surface-DRRXIJBE.mjs.map +7 -0
- package/dist/lib/node-esm/{schema-OUZKVYM5.mjs → schema-defs-IIEQR7B3.mjs} +4 -4
- package/dist/lib/node-esm/{schema-OUZKVYM5.mjs.map → schema-defs-IIEQR7B3.mjs.map} +2 -2
- package/dist/lib/node-esm/{schema-tools-IU7EX5A5.mjs → schema-tools-YTJLA3NQ.mjs} +22 -22
- package/dist/lib/node-esm/schema-tools-YTJLA3NQ.mjs.map +7 -0
- package/dist/lib/node-esm/{settings-KCLKPJVY.mjs → settings-CXMV2AFR.mjs} +2 -2
- package/dist/lib/node-esm/{spaces-ready-Z3SXKWX2.mjs → spaces-ready-QMXLQ4QV.mjs} +3 -3
- 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/index.d.ts +3 -2
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +2 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/{schema.d.ts → schema-defs.d.ts} +1 -1
- package/dist/types/src/capabilities/schema-defs.d.ts.map +1 -0
- package/dist/types/src/capabilities/schema-tools.d.ts +2 -2
- package/dist/types/src/capabilities/schema-tools.d.ts.map +1 -1
- package/dist/types/src/components/CollectionMain.d.ts.map +1 -1
- package/dist/types/src/components/CreateDialog/CreateSpaceDialog.d.ts.map +1 -1
- package/dist/types/src/components/MembersContainer.d.ts.map +1 -1
- package/dist/types/src/components/MenuFooter.d.ts +2 -2
- package/dist/types/src/components/MenuFooter.d.ts.map +1 -1
- package/dist/types/src/components/ObjectSettings/AdvancedObjectSettings.d.ts +2 -2
- package/dist/types/src/components/ObjectSettings/AdvancedObjectSettings.d.ts.map +1 -1
- package/dist/types/src/components/ObjectSettings/BaseObjectSettings.d.ts +2 -2
- package/dist/types/src/components/ObjectSettings/BaseObjectSettings.d.ts.map +1 -1
- package/dist/types/src/components/ObjectSettings/ObjectSettingsContainer.d.ts +2 -2
- package/dist/types/src/components/ObjectSettings/ObjectSettingsContainer.d.ts.map +1 -1
- package/dist/types/src/components/PopoverRenameObject.d.ts.map +1 -1
- package/dist/types/src/components/PopoverRenameSpace.d.ts.map +1 -1
- package/dist/types/src/components/SpaceSettings/SpaceSettingsContainer.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +0 -1
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useInputSurfaceLookup.d.ts +2 -2
- package/dist/types/src/hooks/useInputSurfaceLookup.d.ts.map +1 -1
- package/dist/types/src/types/collection.d.ts +9 -8
- package/dist/types/src/types/collection.d.ts.map +1 -1
- package/dist/types/src/types/thread.d.ts +329 -110
- package/dist/types/src/types/thread.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +164 -136
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/src/util.d.ts +4 -4
- package/dist/types/src/util.d.ts.map +1 -1
- package/package.json +46 -45
- package/src/SpacePlugin.tsx +9 -8
- package/src/capabilities/app-graph-builder.ts +6 -6
- package/src/capabilities/index.ts +2 -2
- package/src/capabilities/intent-resolver.ts +77 -68
- package/src/capabilities/react-surface.tsx +13 -26
- package/src/capabilities/schema-tool.test.ts +2 -3
- package/src/capabilities/schema-tools.ts +25 -25
- package/src/components/CollectionMain.tsx +2 -5
- package/src/components/CreateDialog/CreateSpaceDialog.tsx +2 -3
- package/src/components/MembersContainer.tsx +23 -15
- package/src/components/MenuFooter.tsx +2 -2
- package/src/components/ObjectSettings/AdvancedObjectSettings.tsx +2 -2
- package/src/components/ObjectSettings/BaseObjectSettings.tsx +2 -2
- package/src/components/ObjectSettings/ObjectSettingsContainer.tsx +2 -2
- package/src/components/PopoverAddSpace.tsx +1 -1
- package/src/components/PopoverRenameObject.tsx +12 -6
- package/src/components/PopoverRenameSpace.tsx +8 -0
- package/src/components/SpaceSettings/SpaceSettingsContainer.tsx +5 -3
- package/src/components/index.ts +0 -1
- package/src/hooks/useInputSurfaceLookup.tsx +2 -2
- package/src/types/collection.ts +6 -4
- package/src/types/thread.ts +14 -8
- package/src/types/types.ts +122 -96
- package/src/util.tsx +9 -9
- package/dist/lib/browser/app-graph-builder-J4PN5HOM.mjs.map +0 -7
- package/dist/lib/browser/chunk-FSHDAPFY.mjs.map +0 -7
- package/dist/lib/browser/chunk-KDNV4YRD.mjs +0 -283
- package/dist/lib/browser/chunk-KDNV4YRD.mjs.map +0 -7
- package/dist/lib/browser/chunk-MHTZAZT2.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-72IWBVYE.mjs.map +0 -7
- package/dist/lib/browser/react-surface-KODNQYDN.mjs.map +0 -7
- package/dist/lib/browser/schema-tools-YAXPRIXP.mjs.map +0 -7
- package/dist/lib/node/app-graph-builder-3BNPC5GB.cjs.map +0 -7
- package/dist/lib/node/chunk-3UKLWXNJ.cjs +0 -311
- package/dist/lib/node/chunk-3UKLWXNJ.cjs.map +0 -7
- package/dist/lib/node/chunk-GPZPEQXP.cjs.map +0 -7
- package/dist/lib/node/chunk-U63V2254.cjs.map +0 -7
- package/dist/lib/node/intent-resolver-KA56XGUX.cjs.map +0 -7
- package/dist/lib/node/react-surface-37AVZFPL.cjs.map +0 -7
- package/dist/lib/node/schema-tools-BLIMOZYY.cjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-OVMSUAX3.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-35OHQARN.mjs +0 -284
- package/dist/lib/node-esm/chunk-35OHQARN.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-ABKX22IP.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-TVN6VHTT.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-SG2ECM5R.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-G73SO23W.mjs.map +0 -7
- package/dist/lib/node-esm/schema-tools-IU7EX5A5.mjs.map +0 -7
- package/dist/types/src/capabilities/schema.d.ts.map +0 -1
- package/dist/types/src/components/ShareSpaceButton.d.ts +0 -9
- package/dist/types/src/components/ShareSpaceButton.d.ts.map +0 -1
- package/dist/types/src/components/ShareSpaceButton.stories.d.ts +0 -10
- package/dist/types/src/components/ShareSpaceButton.stories.d.ts.map +0 -1
- package/src/components/ShareSpaceButton.stories.tsx +0 -27
- package/src/components/ShareSpaceButton.tsx +0 -32
- /package/dist/lib/browser/{app-graph-serializer-6WIAFHYK.mjs.map → app-graph-serializer-HPYDOKA5.mjs.map} +0 -0
- /package/dist/lib/browser/{chunk-MIJHUABE.mjs.map → chunk-OS5QKO4Z.mjs.map} +0 -0
- /package/dist/lib/browser/{identity-created-DVHNLGYU.mjs.map → identity-created-DWFKBGOA.mjs.map} +0 -0
- /package/dist/lib/browser/{react-root-DRVM5ACV.mjs.map → react-root-667IZ2Q4.mjs.map} +0 -0
- /package/dist/lib/browser/{settings-2UIV5WX5.mjs.map → settings-ILGGNYJ7.mjs.map} +0 -0
- /package/dist/lib/browser/{spaces-ready-3URIMLCR.mjs.map → spaces-ready-IXZF3RWW.mjs.map} +0 -0
- /package/dist/lib/node/{app-graph-serializer-GOLCQHFQ.cjs.map → app-graph-serializer-G7UYFWG6.cjs.map} +0 -0
- /package/dist/lib/node/{chunk-EI3ZPOLJ.cjs.map → chunk-NCSFM6RA.cjs.map} +0 -0
- /package/dist/lib/node/{identity-created-YYTW4K3Z.cjs.map → identity-created-YLGVEWAJ.cjs.map} +0 -0
- /package/dist/lib/node/{react-root-6WGN5WRQ.cjs.map → react-root-I3SSFA5O.cjs.map} +0 -0
- /package/dist/lib/node/{settings-HJROTHC4.cjs.map → settings-7TC55JP4.cjs.map} +0 -0
- /package/dist/lib/node/{spaces-ready-IWDDIAAD.cjs.map → spaces-ready-4H3Q46GV.cjs.map} +0 -0
- /package/dist/lib/node-esm/{app-graph-serializer-AZXSO7HK.mjs.map → app-graph-serializer-CVPYWWW3.mjs.map} +0 -0
- /package/dist/lib/node-esm/{chunk-DUA32XUX.mjs.map → chunk-FUH5OODY.mjs.map} +0 -0
- /package/dist/lib/node-esm/{identity-created-MP4GLXHO.mjs.map → identity-created-7NHGER3Q.mjs.map} +0 -0
- /package/dist/lib/node-esm/{react-root-MSUT6S2S.mjs.map → react-root-JEGVIVVK.mjs.map} +0 -0
- /package/dist/lib/node-esm/{settings-KCLKPJVY.mjs.map → settings-CXMV2AFR.mjs.map} +0 -0
- /package/dist/lib/node-esm/{spaces-ready-Z3SXKWX2.mjs.map → spaces-ready-QMXLQ4QV.mjs.map} +0 -0
- /package/src/capabilities/{schema.ts → schema-defs.ts} +0 -0
package/src/SpacePlugin.tsx
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
import { Schema } from 'effect';
|
|
6
|
+
|
|
5
7
|
import {
|
|
6
8
|
allOf,
|
|
7
9
|
Capabilities,
|
|
@@ -12,10 +14,9 @@ import {
|
|
|
12
14
|
Events,
|
|
13
15
|
oneOf,
|
|
14
16
|
} from '@dxos/app-framework';
|
|
15
|
-
import { S } from '@dxos/echo-schema';
|
|
16
|
-
import { RefArray } from '@dxos/live-object';
|
|
17
17
|
import { AttentionEvents } from '@dxos/plugin-attention';
|
|
18
18
|
import { ClientEvents } from '@dxos/plugin-client';
|
|
19
|
+
import { RefArray } from '@dxos/react-client/echo';
|
|
19
20
|
import { osTranslations } from '@dxos/shell/react';
|
|
20
21
|
|
|
21
22
|
import {
|
|
@@ -25,8 +26,8 @@ import {
|
|
|
25
26
|
IntentResolver,
|
|
26
27
|
ReactRoot,
|
|
27
28
|
ReactSurface,
|
|
28
|
-
|
|
29
|
-
|
|
29
|
+
SchemaDefs,
|
|
30
|
+
SchemaTools,
|
|
30
31
|
SpaceCapabilities,
|
|
31
32
|
SpaceSettings,
|
|
32
33
|
SpacesReady,
|
|
@@ -107,7 +108,7 @@ export const SpacePlugin = ({
|
|
|
107
108
|
SpaceCapabilities.ObjectForm,
|
|
108
109
|
defineObjectForm({
|
|
109
110
|
objectSchema: CollectionType,
|
|
110
|
-
formSchema:
|
|
111
|
+
formSchema: Schema.Struct({ name: Schema.optional(Schema.String) }),
|
|
111
112
|
getIntent: (props) => createIntent(CollectionAction.Create, props),
|
|
112
113
|
}),
|
|
113
114
|
),
|
|
@@ -116,7 +117,7 @@ export const SpacePlugin = ({
|
|
|
116
117
|
id: `${meta.id}/module/schema`,
|
|
117
118
|
activatesOn: ClientEvents.ClientReady,
|
|
118
119
|
activatesBefore: [ClientEvents.SetupSchema],
|
|
119
|
-
activate:
|
|
120
|
+
activate: SchemaDefs,
|
|
120
121
|
}),
|
|
121
122
|
defineModule({
|
|
122
123
|
id: `${meta.id}/module/react-root`,
|
|
@@ -133,7 +134,7 @@ export const SpacePlugin = ({
|
|
|
133
134
|
defineModule({
|
|
134
135
|
id: `${meta.id}/module/intent-resolver`,
|
|
135
136
|
activatesOn: Events.SetupIntentResolver,
|
|
136
|
-
activate: (context) => IntentResolver({ context, observability }),
|
|
137
|
+
activate: (context) => IntentResolver({ context, createInvitationUrl, observability }),
|
|
137
138
|
}),
|
|
138
139
|
defineModule({
|
|
139
140
|
id: `${meta.id}/module/app-graph-builder`,
|
|
@@ -167,7 +168,7 @@ export const SpacePlugin = ({
|
|
|
167
168
|
defineModule({
|
|
168
169
|
id: `${meta.id}/module/tools`,
|
|
169
170
|
activatesOn: Events.SetupArtifactDefinition,
|
|
170
|
-
activate:
|
|
171
|
+
activate: SchemaTools,
|
|
171
172
|
}),
|
|
172
173
|
]);
|
|
173
174
|
};
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
getSpace,
|
|
11
11
|
isEchoObject,
|
|
12
12
|
OBJECT_ID_LENGTH,
|
|
13
|
-
type
|
|
13
|
+
type AnyLiveObject,
|
|
14
14
|
SPACE_ID_LENGTH,
|
|
15
15
|
SpaceState,
|
|
16
16
|
type Space,
|
|
@@ -99,14 +99,14 @@ export default (context: PluginsContext) => {
|
|
|
99
99
|
},
|
|
100
100
|
},
|
|
101
101
|
{
|
|
102
|
-
id: SpaceAction.
|
|
102
|
+
id: SpaceAction.OpenMembers._tag,
|
|
103
103
|
data: async () => {
|
|
104
104
|
const { dispatchPromise: dispatch } = context.requestCapability(Capabilities.IntentDispatcher);
|
|
105
105
|
const layout = context.requestCapability(Capabilities.Layout);
|
|
106
106
|
const client = context.requestCapability(ClientCapabilities.Client);
|
|
107
107
|
const { spaceId } = parseId(layout.workspace);
|
|
108
108
|
const space = (spaceId && client.spaces.get(spaceId)) ?? client.spaces.default;
|
|
109
|
-
await dispatch(createIntent(SpaceAction.
|
|
109
|
+
await dispatch(createIntent(SpaceAction.OpenMembers, { space }));
|
|
110
110
|
},
|
|
111
111
|
properties: {
|
|
112
112
|
label: ['share space label', { ns: SPACE_PLUGIN }],
|
|
@@ -348,7 +348,7 @@ export default (context: PluginsContext) => {
|
|
|
348
348
|
// Create collection actions and action groups.
|
|
349
349
|
createExtension({
|
|
350
350
|
id: `${SPACE_PLUGIN}/object-actions`,
|
|
351
|
-
filter: (node): node is Node<
|
|
351
|
+
filter: (node): node is Node<AnyLiveObject<any>> => isEchoObject(node.data),
|
|
352
352
|
actions: ({ node }) => {
|
|
353
353
|
const { dispatchPromise: dispatch } = context.requestCapability(Capabilities.IntentDispatcher);
|
|
354
354
|
const state = context.requestCapability(SpaceCapabilities.State);
|
|
@@ -359,7 +359,7 @@ export default (context: PluginsContext) => {
|
|
|
359
359
|
// Object settings plank companion.
|
|
360
360
|
createExtension({
|
|
361
361
|
id: `${SPACE_PLUGIN}/settings`,
|
|
362
|
-
filter: (node): node is Node<
|
|
362
|
+
filter: (node): node is Node<AnyLiveObject<any>> => isEchoObject(node.data),
|
|
363
363
|
connector: ({ node }) => [
|
|
364
364
|
{
|
|
365
365
|
id: [node.id, 'settings'].join(ATTENDABLE_PATH_SEPARATOR),
|
|
@@ -369,7 +369,7 @@ export default (context: PluginsContext) => {
|
|
|
369
369
|
label: ['object settings label', { ns: SPACE_PLUGIN }],
|
|
370
370
|
icon: 'ph--sliders--regular',
|
|
371
371
|
disposition: 'hidden',
|
|
372
|
-
position: '
|
|
372
|
+
position: 'fallback',
|
|
373
373
|
},
|
|
374
374
|
},
|
|
375
375
|
],
|
|
@@ -10,8 +10,8 @@ export const IdentityCreated = lazy(() => import('./identity-created'));
|
|
|
10
10
|
export const IntentResolver = lazy(() => import('./intent-resolver'));
|
|
11
11
|
export const ReactRoot = lazy(() => import('./react-root'));
|
|
12
12
|
export const ReactSurface = lazy(() => import('./react-surface'));
|
|
13
|
-
export const
|
|
14
|
-
export const
|
|
13
|
+
export const SchemaDefs = lazy(() => import('./schema-defs'));
|
|
14
|
+
export const SchemaTools = lazy(() => import('./schema-tools'));
|
|
15
15
|
export const SpaceSettings = lazy(() => import('./settings'));
|
|
16
16
|
export const SpaceState = lazy(() => import('./state'));
|
|
17
17
|
export const SpacesReady = lazy(() => import('./spaces-ready'));
|
|
@@ -2,11 +2,10 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { Effect } from 'effect';
|
|
6
6
|
|
|
7
7
|
import {
|
|
8
8
|
Capabilities,
|
|
9
|
-
chain,
|
|
10
9
|
contributes,
|
|
11
10
|
createIntent,
|
|
12
11
|
createResolver,
|
|
@@ -21,6 +20,7 @@ import { ClientCapabilities } from '@dxos/plugin-client';
|
|
|
21
20
|
import { ObservabilityAction } from '@dxos/plugin-observability/types';
|
|
22
21
|
import { EdgeReplicationSetting } from '@dxos/protocols/proto/dxos/echo/metadata';
|
|
23
22
|
import { isSpace, getSpace, SpaceState, fullyQualifiedId, isEchoObject } from '@dxos/react-client/echo';
|
|
23
|
+
import { Invitation, InvitationEncoder } from '@dxos/react-client/invitations';
|
|
24
24
|
import { ATTENDABLE_PATH_SEPARATOR } from '@dxos/react-ui-attention';
|
|
25
25
|
|
|
26
26
|
import { SpaceCapabilities } from './capabilities';
|
|
@@ -43,10 +43,11 @@ const SPACE_MAX_OBJECTS = 500;
|
|
|
43
43
|
|
|
44
44
|
type IntentResolverOptions = {
|
|
45
45
|
context: PluginsContext;
|
|
46
|
+
createInvitationUrl: (invitationCode: string) => string;
|
|
46
47
|
observability?: boolean;
|
|
47
48
|
};
|
|
48
49
|
|
|
49
|
-
export default ({ context, observability }: IntentResolverOptions) => {
|
|
50
|
+
export default ({ context, observability, createInvitationUrl }: IntentResolverOptions) => {
|
|
50
51
|
const resolve = (typename: string) =>
|
|
51
52
|
context.requestCapabilities(Capabilities.Metadata).find(({ id }) => id === typename)?.metadata ?? {};
|
|
52
53
|
|
|
@@ -120,48 +121,74 @@ export default ({ context, observability }: IntentResolverOptions) => {
|
|
|
120
121
|
],
|
|
121
122
|
}),
|
|
122
123
|
}),
|
|
124
|
+
createResolver({
|
|
125
|
+
intent: SpaceAction.OpenMembers,
|
|
126
|
+
resolve: ({ space }) => ({
|
|
127
|
+
intents: [
|
|
128
|
+
createIntent(LayoutAction.Open, {
|
|
129
|
+
part: 'main',
|
|
130
|
+
subject: [`members-settings${ATTENDABLE_PATH_SEPARATOR}${space.id}`],
|
|
131
|
+
options: {
|
|
132
|
+
workspace: space.id,
|
|
133
|
+
},
|
|
134
|
+
}),
|
|
135
|
+
],
|
|
136
|
+
}),
|
|
137
|
+
}),
|
|
123
138
|
createResolver({
|
|
124
139
|
intent: SpaceAction.Share,
|
|
125
|
-
resolve: ({ space }) => {
|
|
126
|
-
const
|
|
127
|
-
const id = `members-settings${ATTENDABLE_PATH_SEPARATOR}${space.id}`;
|
|
128
|
-
if (layout.active.includes(id)) {
|
|
129
|
-
return {
|
|
130
|
-
intents: [
|
|
131
|
-
createIntent(LayoutAction.ScrollIntoView, {
|
|
132
|
-
part: 'current',
|
|
133
|
-
subject: id,
|
|
134
|
-
}),
|
|
135
|
-
],
|
|
136
|
-
};
|
|
137
|
-
}
|
|
138
|
-
|
|
140
|
+
resolve: ({ space, type, authMethod, multiUse, target }) => {
|
|
141
|
+
const invitation = space.share({ type, authMethod, multiUse, target });
|
|
139
142
|
return {
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
...(observability
|
|
152
|
-
? [
|
|
153
|
-
createIntent(ObservabilityAction.SendEvent, {
|
|
154
|
-
name: 'space.share',
|
|
155
|
-
properties: {
|
|
156
|
-
spaceId: space.id,
|
|
157
|
-
},
|
|
158
|
-
}),
|
|
159
|
-
]
|
|
160
|
-
: []),
|
|
161
|
-
],
|
|
143
|
+
data: invitation,
|
|
144
|
+
intents: observability
|
|
145
|
+
? [
|
|
146
|
+
createIntent(ObservabilityAction.SendEvent, {
|
|
147
|
+
name: 'space.share',
|
|
148
|
+
properties: {
|
|
149
|
+
spaceId: space.id,
|
|
150
|
+
},
|
|
151
|
+
}),
|
|
152
|
+
]
|
|
153
|
+
: [],
|
|
162
154
|
};
|
|
163
155
|
},
|
|
164
156
|
}),
|
|
157
|
+
createResolver({
|
|
158
|
+
intent: SpaceAction.GetShareLink,
|
|
159
|
+
resolve: ({ space, target, copyToClipboard }) =>
|
|
160
|
+
Effect.gen(function* () {
|
|
161
|
+
const { dispatch } = context.requestCapability(Capabilities.IntentDispatcher);
|
|
162
|
+
const invitation = yield* dispatch(
|
|
163
|
+
createIntent(SpaceAction.Share, {
|
|
164
|
+
space,
|
|
165
|
+
type: Invitation.Type.DELEGATED,
|
|
166
|
+
authMethod: Invitation.AuthMethod.KNOWN_PUBLIC_KEY,
|
|
167
|
+
multiUse: true,
|
|
168
|
+
target,
|
|
169
|
+
}),
|
|
170
|
+
);
|
|
171
|
+
|
|
172
|
+
// TODO(wittjosiah): Better api to for this.
|
|
173
|
+
// NOTE: Delegated invitations are invalid until the connecting state when keys are filled in.
|
|
174
|
+
const invitationCode = yield* Effect.tryPromise(
|
|
175
|
+
() =>
|
|
176
|
+
new Promise<string>((resolve) => {
|
|
177
|
+
invitation.subscribe((invitation) => {
|
|
178
|
+
if (invitation.state === Invitation.State.CONNECTING) {
|
|
179
|
+
resolve(InvitationEncoder.encode(invitation));
|
|
180
|
+
}
|
|
181
|
+
});
|
|
182
|
+
}),
|
|
183
|
+
);
|
|
184
|
+
const url = createInvitationUrl(invitationCode);
|
|
185
|
+
if (copyToClipboard) {
|
|
186
|
+
yield* Effect.tryPromise(() => navigator.clipboard.writeText(url));
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
return { data: url };
|
|
190
|
+
}),
|
|
191
|
+
}),
|
|
165
192
|
createResolver({
|
|
166
193
|
intent: SpaceAction.Lock,
|
|
167
194
|
resolve: ({ space }) => {
|
|
@@ -239,35 +266,17 @@ export default ({ context, observability }: IntentResolverOptions) => {
|
|
|
239
266
|
}),
|
|
240
267
|
createResolver({
|
|
241
268
|
intent: SpaceAction.OpenSettings,
|
|
242
|
-
resolve: ({ space }) => {
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
};
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
return {
|
|
257
|
-
intents: [
|
|
258
|
-
pipe(
|
|
259
|
-
createIntent(LayoutAction.SwitchWorkspace, {
|
|
260
|
-
part: 'workspace',
|
|
261
|
-
subject: space.id,
|
|
262
|
-
}),
|
|
263
|
-
chain(LayoutAction.Open, {
|
|
264
|
-
part: 'main',
|
|
265
|
-
subject: [id],
|
|
266
|
-
}),
|
|
267
|
-
),
|
|
268
|
-
],
|
|
269
|
-
};
|
|
270
|
-
},
|
|
269
|
+
resolve: ({ space }) => ({
|
|
270
|
+
intents: [
|
|
271
|
+
createIntent(LayoutAction.Open, {
|
|
272
|
+
part: 'main',
|
|
273
|
+
subject: [`properties-settings${ATTENDABLE_PATH_SEPARATOR}${space.id}`],
|
|
274
|
+
options: {
|
|
275
|
+
workspace: space.id,
|
|
276
|
+
},
|
|
277
|
+
}),
|
|
278
|
+
],
|
|
279
|
+
}),
|
|
271
280
|
}),
|
|
272
281
|
createResolver({
|
|
273
282
|
intent: SpaceAction.Open,
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { type Schema
|
|
5
|
+
import { type Schema } from 'effect';
|
|
6
6
|
import React, { useCallback } from 'react';
|
|
7
7
|
|
|
8
8
|
import { Capabilities, contributes, createSurface, Surface, useCapability, useLayout } from '@dxos/app-framework';
|
|
9
|
-
import {
|
|
9
|
+
import { isInstanceOf } from '@dxos/echo-schema';
|
|
10
10
|
import { findAnnotation } from '@dxos/effect';
|
|
11
11
|
import { SettingsStore } from '@dxos/local-storage';
|
|
12
12
|
import {
|
|
@@ -17,11 +17,11 @@ import {
|
|
|
17
17
|
parseId,
|
|
18
18
|
SpaceState,
|
|
19
19
|
useSpace,
|
|
20
|
-
type
|
|
20
|
+
type AnyLiveObject,
|
|
21
21
|
type Space,
|
|
22
22
|
} from '@dxos/react-client/echo';
|
|
23
23
|
import { Input } from '@dxos/react-ui';
|
|
24
|
-
import {
|
|
24
|
+
import { type InputProps } from '@dxos/react-ui-form';
|
|
25
25
|
import { HuePicker, IconPicker } from '@dxos/react-ui-pickers';
|
|
26
26
|
import { type JoinPanelProps } from '@dxos/shell/react';
|
|
27
27
|
|
|
@@ -93,7 +93,7 @@ export default ({ createInvitationUrl }: ReactSurfaceOptions) =>
|
|
|
93
93
|
createSurface({
|
|
94
94
|
id: `${SPACE_PLUGIN}/companion/object-settings`,
|
|
95
95
|
role: 'article',
|
|
96
|
-
filter: (data): data is { companionTo:
|
|
96
|
+
filter: (data): data is { companionTo: AnyLiveObject<any> } =>
|
|
97
97
|
isEchoObject(data.companionTo) && data.subject === 'settings',
|
|
98
98
|
component: ({ data, role }) => <ObjectSettingsContainer object={data.companionTo} role={role} />,
|
|
99
99
|
}),
|
|
@@ -164,8 +164,8 @@ export default ({ createInvitationUrl }: ReactSurfaceOptions) =>
|
|
|
164
164
|
createSurface({
|
|
165
165
|
id: `${SPACE_PLUGIN}/create-initial-space-form-[hue]`,
|
|
166
166
|
role: 'form-input',
|
|
167
|
-
filter: (data): data is { prop: string; schema:
|
|
168
|
-
const annotation = findAnnotation<boolean>((data.schema as
|
|
167
|
+
filter: (data): data is { prop: string; schema: Schema.Schema<any> } => {
|
|
168
|
+
const annotation = findAnnotation<boolean>((data.schema as Schema.Schema.All).ast, HueAnnotationId);
|
|
169
169
|
return !!annotation;
|
|
170
170
|
},
|
|
171
171
|
component: ({ data: _, ...inputProps }) => {
|
|
@@ -183,8 +183,8 @@ export default ({ createInvitationUrl }: ReactSurfaceOptions) =>
|
|
|
183
183
|
createSurface({
|
|
184
184
|
id: `${SPACE_PLUGIN}/create-initial-space-form-[icon]`,
|
|
185
185
|
role: 'form-input',
|
|
186
|
-
filter: (data): data is { prop: string; schema:
|
|
187
|
-
const annotation = findAnnotation<boolean>((data.schema as
|
|
186
|
+
filter: (data): data is { prop: string; schema: Schema.Schema<any> } => {
|
|
187
|
+
const annotation = findAnnotation<boolean>((data.schema as Schema.Schema.All).ast, IconAnnotationId);
|
|
188
188
|
return !!annotation;
|
|
189
189
|
},
|
|
190
190
|
component: ({ data: _, ...inputProps }) => {
|
|
@@ -199,19 +199,6 @@ export default ({ createInvitationUrl }: ReactSurfaceOptions) =>
|
|
|
199
199
|
);
|
|
200
200
|
},
|
|
201
201
|
}),
|
|
202
|
-
createSurface({
|
|
203
|
-
id: `${SPACE_PLUGIN}/preview-popover`,
|
|
204
|
-
role: 'popover',
|
|
205
|
-
filter: (data): data is { subject: ReactiveEchoObject<any> } => isEchoObject(data.subject),
|
|
206
|
-
component: ({ data }) => {
|
|
207
|
-
const schema = getSchema(data.subject);
|
|
208
|
-
if (!schema) {
|
|
209
|
-
return null;
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
return <Form schema={schema} values={data.subject} readonly />;
|
|
213
|
-
},
|
|
214
|
-
}),
|
|
215
202
|
createSurface({
|
|
216
203
|
id: POPOVER_RENAME_SPACE,
|
|
217
204
|
role: 'popover',
|
|
@@ -221,7 +208,7 @@ export default ({ createInvitationUrl }: ReactSurfaceOptions) =>
|
|
|
221
208
|
createSurface({
|
|
222
209
|
id: POPOVER_RENAME_OBJECT,
|
|
223
210
|
role: 'popover',
|
|
224
|
-
filter: (data): data is { props:
|
|
211
|
+
filter: (data): data is { props: AnyLiveObject<any> } =>
|
|
225
212
|
data.component === POPOVER_RENAME_OBJECT && isLiveObject(data.props),
|
|
226
213
|
component: ({ data }) => <PopoverRenameObject object={data.props} />,
|
|
227
214
|
}),
|
|
@@ -234,13 +221,13 @@ export default ({ createInvitationUrl }: ReactSurfaceOptions) =>
|
|
|
234
221
|
createSurface({
|
|
235
222
|
id: `${SPACE_PLUGIN}/menu-footer`,
|
|
236
223
|
role: 'menu-footer',
|
|
237
|
-
filter: (data): data is { subject:
|
|
224
|
+
filter: (data): data is { subject: AnyLiveObject<any> } => isEchoObject(data.subject),
|
|
238
225
|
component: ({ data }) => <MenuFooter object={data.subject} />,
|
|
239
226
|
}),
|
|
240
227
|
createSurface({
|
|
241
228
|
id: `${SPACE_PLUGIN}/navtree-presence`,
|
|
242
229
|
role: 'navtree-item-end',
|
|
243
|
-
filter: (data): data is { id: string; subject:
|
|
230
|
+
filter: (data): data is { id: string; subject: AnyLiveObject<any>; open?: boolean } =>
|
|
244
231
|
typeof data.id === 'string' && isEchoObject(data.subject),
|
|
245
232
|
component: ({ data }) => {
|
|
246
233
|
// TODO(wittjosiah): Doesn't need to be mutable but readonly type messes with ComplexMap.
|
|
@@ -267,7 +254,7 @@ export default ({ createInvitationUrl }: ReactSurfaceOptions) =>
|
|
|
267
254
|
id: `${SPACE_PLUGIN}/navbar-presence`,
|
|
268
255
|
role: 'navbar-end',
|
|
269
256
|
position: 'hoist',
|
|
270
|
-
filter: (data): data is { subject: Space |
|
|
257
|
+
filter: (data): data is { subject: Space | AnyLiveObject<any> } =>
|
|
271
258
|
isSpace(data.subject) || isEchoObject(data.subject),
|
|
272
259
|
component: ({ data }) => {
|
|
273
260
|
const space = isSpace(data.subject) ? data.subject : getSpace(data.subject);
|
|
@@ -2,10 +2,9 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
import { Schema } from 'effect';
|
|
5
6
|
import { describe, it, expect } from 'vitest';
|
|
6
7
|
|
|
7
|
-
import { S } from '@dxos/echo-schema';
|
|
8
|
-
|
|
9
8
|
import { TypeNameSchema } from './schema-tools';
|
|
10
9
|
|
|
11
10
|
describe('TypeNameSchema format', () => {
|
|
@@ -29,7 +28,7 @@ describe('TypeNameSchema format', () => {
|
|
|
29
28
|
'.org/Type', // Must have domain
|
|
30
29
|
];
|
|
31
30
|
|
|
32
|
-
const validate =
|
|
31
|
+
const validate = Schema.validateSync(TypeNameSchema);
|
|
33
32
|
|
|
34
33
|
valid.forEach((typename) => {
|
|
35
34
|
it(`should accept valid typename: ${typename}`, () => {
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { Schema, SchemaAST } from 'effect';
|
|
6
6
|
|
|
7
7
|
import { Capabilities, contributes, type PromiseIntentDispatcher } from '@dxos/app-framework';
|
|
8
8
|
import { defineTool, ToolResult } from '@dxos/artifact';
|
|
9
9
|
import { type Space } from '@dxos/client/echo';
|
|
10
|
-
import { FormatEnum, FormatEnums,
|
|
10
|
+
import { FormatEnum, FormatEnums, SelectOptionSchema, GeoPoint, toJsonSchema } from '@dxos/echo-schema';
|
|
11
11
|
import { invariant } from '@dxos/invariant';
|
|
12
12
|
import { hues } from '@dxos/react-ui-theme';
|
|
13
13
|
import { getSchemaFromPropertyDefinitions } from '@dxos/schema';
|
|
@@ -21,13 +21,13 @@ declare global {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
// TODO(ZaymonFC): Move this somewhere common.
|
|
24
|
-
export const TypeNameSchema =
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
[TitleAnnotationId]: 'TypeName',
|
|
28
|
-
[DescriptionAnnotationId]:
|
|
24
|
+
export const TypeNameSchema = Schema.String.pipe(
|
|
25
|
+
Schema.pattern(/^\w+\.\w{2,}\/[\w/]+$/i),
|
|
26
|
+
Schema.annotations({
|
|
27
|
+
[SchemaAST.TitleAnnotationId]: 'TypeName',
|
|
28
|
+
[SchemaAST.DescriptionAnnotationId]:
|
|
29
29
|
'Domain-style type name path. Dashes are not allowed. Use camel case for the final component of the type name.',
|
|
30
|
-
[ExamplesAnnotationId]: ['example.com/type/Document', 'example.com/type/FlightList'],
|
|
30
|
+
[SchemaAST.ExamplesAnnotationId]: ['example.com/type/Document', 'example.com/type/FlightList'],
|
|
31
31
|
}),
|
|
32
32
|
);
|
|
33
33
|
|
|
@@ -36,23 +36,23 @@ const formatDescription = `The format of the property. Additional information:
|
|
|
36
36
|
This tuple is GeoJSON. You must specify \`${FormatEnum.GeoPoint}\` as [Longitude, Latitude]`;
|
|
37
37
|
|
|
38
38
|
// TODO(ZaymonFC): All properties are default optional, but maybe we should allow for required properties.
|
|
39
|
-
const PropertyDefinitionSchema =
|
|
40
|
-
name:
|
|
41
|
-
format:
|
|
42
|
-
[DescriptionAnnotationId]: formatDescription,
|
|
39
|
+
const PropertyDefinitionSchema = Schema.Struct({
|
|
40
|
+
name: Schema.String.annotations({ [SchemaAST.DescriptionAnnotationId]: 'The name of the property.' }),
|
|
41
|
+
format: Schema.Union(...FormatEnums.map((format) => Schema.Literal(format))).annotations({
|
|
42
|
+
[SchemaAST.DescriptionAnnotationId]: formatDescription,
|
|
43
43
|
}),
|
|
44
|
-
config:
|
|
45
|
-
|
|
46
|
-
options:
|
|
47
|
-
|
|
44
|
+
config: Schema.optional(
|
|
45
|
+
Schema.Struct({
|
|
46
|
+
options: Schema.optional(
|
|
47
|
+
Schema.Array(SelectOptionSchema)
|
|
48
48
|
.annotations({
|
|
49
49
|
description: `Options for SingleSelect/MultiSelect formats. Available colors: ${hues.join(', ')}`,
|
|
50
50
|
})
|
|
51
|
-
.pipe(
|
|
51
|
+
.pipe(Schema.mutable),
|
|
52
52
|
),
|
|
53
53
|
}),
|
|
54
54
|
),
|
|
55
|
-
}).pipe(
|
|
55
|
+
}).pipe(Schema.mutable);
|
|
56
56
|
|
|
57
57
|
const SYSTEM_NAMESPACE = 'dxos.org/echo/schema';
|
|
58
58
|
|
|
@@ -62,7 +62,7 @@ export default () =>
|
|
|
62
62
|
name: 'list',
|
|
63
63
|
description: 'List registered schemas in the space.',
|
|
64
64
|
caption: 'Listing registered schemas...',
|
|
65
|
-
schema:
|
|
65
|
+
schema: Schema.Struct({}),
|
|
66
66
|
execute: async (_input, { extensions }) => {
|
|
67
67
|
invariant(extensions?.space, 'No space.');
|
|
68
68
|
const space = extensions.space;
|
|
@@ -80,8 +80,8 @@ export default () =>
|
|
|
80
80
|
name: 'get',
|
|
81
81
|
description: 'Get a specific schema by its typename.',
|
|
82
82
|
caption: 'Getting schema...',
|
|
83
|
-
schema:
|
|
84
|
-
typename:
|
|
83
|
+
schema: Schema.Struct({
|
|
84
|
+
typename: Schema.String.annotations({
|
|
85
85
|
description: 'The fully qualified typename of the schema.',
|
|
86
86
|
}),
|
|
87
87
|
}),
|
|
@@ -101,14 +101,14 @@ export default () =>
|
|
|
101
101
|
name: 'create',
|
|
102
102
|
description: 'Create a new schema with the provided definition.',
|
|
103
103
|
caption: 'Creating schema...',
|
|
104
|
-
schema:
|
|
104
|
+
schema: Schema.Struct({
|
|
105
105
|
typename: TypeNameSchema.annotations({
|
|
106
106
|
description:
|
|
107
107
|
'The fully qualified schema typename. Must start with a domain, and then one or more path components (e.g., "example.com/type/TypeName").',
|
|
108
108
|
}),
|
|
109
|
-
properties:
|
|
110
|
-
|
|
111
|
-
|
|
109
|
+
properties: Schema.Array(PropertyDefinitionSchema).pipe(
|
|
110
|
+
Schema.annotations({ description: 'Array of property definitions for the schema.' }),
|
|
111
|
+
Schema.mutable,
|
|
112
112
|
),
|
|
113
113
|
}),
|
|
114
114
|
execute: async ({ typename, properties }, { extensions }) => {
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
7
|
import { useTranslation } from '@dxos/react-ui';
|
|
8
|
-
import { baseSurface,
|
|
8
|
+
import { baseSurface, descriptionMessage, mx } from '@dxos/react-ui-theme';
|
|
9
9
|
|
|
10
10
|
import { SPACE_PLUGIN } from '../meta';
|
|
11
11
|
import type { CollectionType } from '../types';
|
|
@@ -21,10 +21,7 @@ export const CollectionMain = ({ collection }: { collection: CollectionType }) =
|
|
|
21
21
|
>
|
|
22
22
|
<p
|
|
23
23
|
role='alert'
|
|
24
|
-
className={mx(
|
|
25
|
-
descriptionText,
|
|
26
|
-
'border border-dashed border-neutral-400/50 rounded-lg p-8 font-normal text-lg max-is-[24rem] break-words',
|
|
27
|
-
)}
|
|
24
|
+
className={mx(descriptionMessage, 'rounded-lg p-8 font-normal text-lg max-is-[24rem] break-words')}
|
|
28
25
|
>
|
|
29
26
|
{collection.name ?? t('unnamed collection label')}
|
|
30
27
|
</p>
|
|
@@ -2,11 +2,10 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { Effect } from 'effect';
|
|
5
|
+
import { Effect, type Schema } from 'effect';
|
|
6
6
|
import React, { useCallback, useRef } from 'react';
|
|
7
7
|
|
|
8
8
|
import { createIntent, LayoutAction, useIntentDispatcher } from '@dxos/app-framework';
|
|
9
|
-
import { type S } from '@dxos/echo-schema';
|
|
10
9
|
import { Button, Dialog, Icon, useTranslation } from '@dxos/react-ui';
|
|
11
10
|
import { Form } from '@dxos/react-ui-form';
|
|
12
11
|
|
|
@@ -16,7 +15,7 @@ import { SpaceAction, SpaceForm } from '../../types';
|
|
|
16
15
|
|
|
17
16
|
export const CREATE_SPACE_DIALOG = `${SPACE_PLUGIN}/CreateSpaceDialog`;
|
|
18
17
|
|
|
19
|
-
type FormValues =
|
|
18
|
+
type FormValues = Schema.Schema.Type<typeof SpaceForm>;
|
|
20
19
|
const initialValues: FormValues = { edgeReplication: true };
|
|
21
20
|
|
|
22
21
|
export const CreateSpaceDialog = () => {
|