@dxos/plugin-space 0.8.2-main.12df754 → 0.8.2-main.30e4dbb
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-6KVRD7OJ.mjs} +30 -13
- package/dist/lib/browser/app-graph-builder-6KVRD7OJ.mjs.map +7 -0
- package/dist/lib/browser/{app-graph-serializer-6WIAFHYK.mjs → app-graph-serializer-N7KZGCST.mjs} +4 -4
- package/dist/lib/browser/chunk-CY35NLWL.mjs +296 -0
- package/dist/lib/browser/chunk-CY35NLWL.mjs.map +7 -0
- package/dist/lib/browser/{chunk-FSHDAPFY.mjs → chunk-F57CTUM6.mjs} +4 -4
- package/dist/lib/browser/chunk-F57CTUM6.mjs.map +7 -0
- package/dist/lib/browser/{chunk-MHTZAZT2.mjs → chunk-V4VNP2WY.mjs} +161 -213
- package/dist/lib/browser/chunk-V4VNP2WY.mjs.map +7 -0
- package/dist/lib/browser/{chunk-MIJHUABE.mjs → chunk-XC4BXZVV.mjs} +2 -3
- package/dist/lib/browser/chunk-XC4BXZVV.mjs.map +7 -0
- package/dist/lib/browser/{identity-created-DVHNLGYU.mjs → identity-created-74EHBH7M.mjs} +2 -2
- package/dist/lib/browser/index.mjs +13 -20
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-resolver-72IWBVYE.mjs → intent-resolver-FZ64VJKZ.mjs} +83 -88
- package/dist/lib/browser/intent-resolver-FZ64VJKZ.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-root-DRVM5ACV.mjs → react-root-2EFJCOX7.mjs} +4 -4
- package/dist/lib/browser/{react-surface-KODNQYDN.mjs → react-surface-N5OGF7TQ.mjs} +5 -30
- package/dist/lib/browser/react-surface-N5OGF7TQ.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-G24447B7.mjs} +2 -2
- package/dist/lib/browser/{spaces-ready-3URIMLCR.mjs → spaces-ready-ZSUEPHJF.mjs} +3 -3
- package/dist/lib/browser/types/index.mjs +1 -1
- package/dist/lib/node/{app-graph-builder-3BNPC5GB.cjs → app-graph-builder-6VR2TBBF.cjs} +56 -39
- package/dist/lib/node/app-graph-builder-6VR2TBBF.cjs.map +7 -0
- package/dist/lib/node/{app-graph-serializer-GOLCQHFQ.cjs → app-graph-serializer-IKQLWTCX.cjs} +20 -20
- package/dist/lib/node/{chunk-U63V2254.cjs → chunk-FILCZU6V.cjs} +29 -29
- package/dist/lib/node/chunk-FILCZU6V.cjs.map +7 -0
- package/dist/lib/node/chunk-K6ZO4WDJ.cjs +324 -0
- package/dist/lib/node/chunk-K6ZO4WDJ.cjs.map +7 -0
- package/dist/lib/node/{chunk-GPZPEQXP.cjs → chunk-P2ZIVXGY.cjs} +215 -267
- package/dist/lib/node/chunk-P2ZIVXGY.cjs.map +7 -0
- package/dist/lib/node/{chunk-EI3ZPOLJ.cjs → chunk-YAE6CCDB.cjs} +6 -7
- package/dist/lib/node/chunk-YAE6CCDB.cjs.map +7 -0
- package/dist/lib/node/{identity-created-YYTW4K3Z.cjs → identity-created-PCQPDULV.cjs} +6 -6
- package/dist/lib/node/index.cjs +66 -73
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/{intent-resolver-KA56XGUX.cjs → intent-resolver-BK6JDXY4.cjs} +126 -130
- package/dist/lib/node/intent-resolver-BK6JDXY4.cjs.map +7 -0
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/{react-root-6WGN5WRQ.cjs → react-root-DEQFKQVD.cjs} +8 -8
- package/dist/lib/node/{react-surface-37AVZFPL.cjs → react-surface-UQD7LR67.cjs} +41 -64
- package/dist/lib/node/react-surface-UQD7LR67.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-AFWO4AWK.cjs} +6 -6
- package/dist/lib/node/{spaces-ready-IWDDIAAD.cjs → spaces-ready-MHLUFLXN.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-O7M6MVS5.mjs} +30 -13
- package/dist/lib/node-esm/app-graph-builder-O7M6MVS5.mjs.map +7 -0
- package/dist/lib/node-esm/{app-graph-serializer-AZXSO7HK.mjs → app-graph-serializer-I6XBQJLA.mjs} +4 -4
- package/dist/lib/node-esm/chunk-CLRCW6PU.mjs +297 -0
- package/dist/lib/node-esm/chunk-CLRCW6PU.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-TVN6VHTT.mjs → chunk-COHDPHM7.mjs} +4 -4
- package/dist/lib/node-esm/chunk-COHDPHM7.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-DUA32XUX.mjs → chunk-HEXOMJIR.mjs} +2 -3
- package/dist/lib/node-esm/chunk-HEXOMJIR.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-ABKX22IP.mjs → chunk-TB557OBD.mjs} +161 -213
- package/dist/lib/node-esm/chunk-TB557OBD.mjs.map +7 -0
- package/dist/lib/node-esm/{identity-created-MP4GLXHO.mjs → identity-created-GXS46A3C.mjs} +2 -2
- package/dist/lib/node-esm/index.mjs +13 -20
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/{intent-resolver-SG2ECM5R.mjs → intent-resolver-6VPP3ZDO.mjs} +83 -88
- package/dist/lib/node-esm/intent-resolver-6VPP3ZDO.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-root-MSUT6S2S.mjs → react-root-2RJ2S5E6.mjs} +4 -4
- package/dist/lib/node-esm/{react-surface-G73SO23W.mjs → react-surface-2RSRATVY.mjs} +5 -30
- package/dist/lib/node-esm/react-surface-2RSRATVY.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-MJVSCOI4.mjs} +2 -2
- package/dist/lib/node-esm/{spaces-ready-Z3SXKWX2.mjs → spaces-ready-35U5BBTH.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/app-graph-serializer.d.ts.map +1 -1
- package/dist/types/src/capabilities/identity-created.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/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.map +1 -1
- package/dist/types/src/components/CollectionSection.d.ts.map +1 -1
- package/dist/types/src/components/CreateDialog/CreateObjectDialog.d.ts.map +1 -1
- package/dist/types/src/components/CreateDialog/CreateObjectPanel.d.ts.map +1 -1
- package/dist/types/src/components/CreateDialog/CreateSpaceDialog.d.ts.map +1 -1
- package/dist/types/src/components/JoinDialog.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.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/ForeignKeys.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/PersistenceStatus.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/SchemaContainer.d.ts.map +1 -1
- 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.map +1 -1
- package/dist/types/src/components/SpaceSettings/SpaceSettingsContainer.d.ts.map +1 -1
- package/dist/types/src/components/SyncStatus/InlineSyncStatus.d.ts.map +1 -1
- package/dist/types/src/components/SyncStatus/SyncStatus.d.ts.map +1 -1
- package/dist/types/src/components/SyncStatus/save-tracker.d.ts.map +1 -1
- package/dist/types/src/components/SyncStatus/status.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +0 -2
- 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/hooks/usePath.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +2 -263
- package/dist/types/src/translations.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 +154 -142
- 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/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +46 -45
- package/src/SpacePlugin.tsx +9 -8
- package/src/capabilities/app-graph-builder.ts +26 -14
- package/src/capabilities/index.ts +2 -2
- package/src/capabilities/intent-resolver.ts +77 -87
- package/src/capabilities/react-surface.tsx +13 -34
- 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/CreateObjectDialog.stories.tsx +1 -1
- package/src/components/CreateDialog/CreateSpaceDialog.tsx +2 -3
- package/src/components/MembersContainer.stories.tsx +1 -5
- 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/PersistenceStatus.tsx +11 -14
- package/src/components/PopoverRenameObject.tsx +12 -6
- package/src/components/PopoverRenameSpace.tsx +8 -0
- package/src/components/SpacePresence.stories.tsx +1 -1
- package/src/components/SpacePresence.tsx +32 -42
- package/src/components/SpaceSettings/SpaceSettingsContainer.tsx +5 -3
- package/src/components/SyncStatus/InlineSyncStatus.tsx +8 -16
- package/src/components/index.ts +0 -2
- package/src/hooks/useInputSurfaceLookup.tsx +2 -2
- package/src/translations.ts +0 -1
- package/src/types/collection.ts +6 -4
- package/src/types/thread.ts +14 -8
- package/src/types/types.ts +109 -96
- package/src/util.tsx +13 -13
- 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/chunk-MIJHUABE.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-EI3ZPOLJ.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-DUA32XUX.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/PopoverAddSpace.d.ts +0 -4
- package/dist/types/src/components/PopoverAddSpace.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/PopoverAddSpace.tsx +0 -52
- 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-N7KZGCST.mjs.map} +0 -0
- /package/dist/lib/browser/{identity-created-DVHNLGYU.mjs.map → identity-created-74EHBH7M.mjs.map} +0 -0
- /package/dist/lib/browser/{react-root-DRVM5ACV.mjs.map → react-root-2EFJCOX7.mjs.map} +0 -0
- /package/dist/lib/browser/{settings-2UIV5WX5.mjs.map → settings-G24447B7.mjs.map} +0 -0
- /package/dist/lib/browser/{spaces-ready-3URIMLCR.mjs.map → spaces-ready-ZSUEPHJF.mjs.map} +0 -0
- /package/dist/lib/node/{app-graph-serializer-GOLCQHFQ.cjs.map → app-graph-serializer-IKQLWTCX.cjs.map} +0 -0
- /package/dist/lib/node/{identity-created-YYTW4K3Z.cjs.map → identity-created-PCQPDULV.cjs.map} +0 -0
- /package/dist/lib/node/{react-root-6WGN5WRQ.cjs.map → react-root-DEQFKQVD.cjs.map} +0 -0
- /package/dist/lib/node/{settings-HJROTHC4.cjs.map → settings-AFWO4AWK.cjs.map} +0 -0
- /package/dist/lib/node/{spaces-ready-IWDDIAAD.cjs.map → spaces-ready-MHLUFLXN.cjs.map} +0 -0
- /package/dist/lib/node-esm/{app-graph-serializer-AZXSO7HK.mjs.map → app-graph-serializer-I6XBQJLA.mjs.map} +0 -0
- /package/dist/lib/node-esm/{identity-created-MP4GLXHO.mjs.map → identity-created-GXS46A3C.mjs.map} +0 -0
- /package/dist/lib/node-esm/{react-root-MSUT6S2S.mjs.map → react-root-2RJ2S5E6.mjs.map} +0 -0
- /package/dist/lib/node-esm/{settings-KCLKPJVY.mjs.map → settings-MJVSCOI4.mjs.map} +0 -0
- /package/dist/lib/node-esm/{spaces-ready-Z3SXKWX2.mjs.map → spaces-ready-35U5BBTH.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,
|
|
@@ -20,7 +20,7 @@ import { isDeleted } from '@dxos/live-object';
|
|
|
20
20
|
import { log } from '@dxos/log';
|
|
21
21
|
import { ClientCapabilities } from '@dxos/plugin-client';
|
|
22
22
|
import { PLANK_COMPANION_TYPE, ATTENDABLE_PATH_SEPARATOR } from '@dxos/plugin-deck/types';
|
|
23
|
-
import { createExtension, toSignal, type Node
|
|
23
|
+
import { createExtension, toSignal, type Node } from '@dxos/plugin-graph';
|
|
24
24
|
import { isNonNullable } from '@dxos/util';
|
|
25
25
|
|
|
26
26
|
import { SpaceCapabilities } from './capabilities';
|
|
@@ -85,28 +85,40 @@ export default (context: PluginsContext) => {
|
|
|
85
85
|
filter: (node): node is Node<null> => node.id === 'root',
|
|
86
86
|
actions: () => [
|
|
87
87
|
{
|
|
88
|
-
id: SpaceAction.
|
|
89
|
-
data: async (
|
|
88
|
+
id: SpaceAction.OpenCreateSpace._tag,
|
|
89
|
+
data: async () => {
|
|
90
90
|
const { dispatchPromise: dispatch } = context.requestCapability(Capabilities.IntentDispatcher);
|
|
91
|
-
await dispatch(createIntent(SpaceAction.
|
|
91
|
+
await dispatch(createIntent(SpaceAction.OpenCreateSpace));
|
|
92
92
|
},
|
|
93
93
|
properties: {
|
|
94
|
-
label: ['
|
|
94
|
+
label: ['create space label', { ns: SPACE_PLUGIN }],
|
|
95
95
|
icon: 'ph--plus--regular',
|
|
96
|
-
testId: 'spacePlugin.
|
|
97
|
-
disposition: '
|
|
98
|
-
|
|
96
|
+
testId: 'spacePlugin.createSpace',
|
|
97
|
+
disposition: 'menu',
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
id: SpaceAction.Join._tag,
|
|
102
|
+
data: async () => {
|
|
103
|
+
const { dispatchPromise: dispatch } = context.requestCapability(Capabilities.IntentDispatcher);
|
|
104
|
+
await dispatch(createIntent(SpaceAction.Join));
|
|
105
|
+
},
|
|
106
|
+
properties: {
|
|
107
|
+
label: ['join space label', { ns: SPACE_PLUGIN }],
|
|
108
|
+
icon: 'ph--sign-in--regular',
|
|
109
|
+
testId: 'spacePlugin.joinSpace',
|
|
110
|
+
disposition: 'menu',
|
|
99
111
|
},
|
|
100
112
|
},
|
|
101
113
|
{
|
|
102
|
-
id: SpaceAction.
|
|
114
|
+
id: SpaceAction.OpenMembers._tag,
|
|
103
115
|
data: async () => {
|
|
104
116
|
const { dispatchPromise: dispatch } = context.requestCapability(Capabilities.IntentDispatcher);
|
|
105
117
|
const layout = context.requestCapability(Capabilities.Layout);
|
|
106
118
|
const client = context.requestCapability(ClientCapabilities.Client);
|
|
107
119
|
const { spaceId } = parseId(layout.workspace);
|
|
108
120
|
const space = (spaceId && client.spaces.get(spaceId)) ?? client.spaces.default;
|
|
109
|
-
await dispatch(createIntent(SpaceAction.
|
|
121
|
+
await dispatch(createIntent(SpaceAction.OpenMembers, { space }));
|
|
110
122
|
},
|
|
111
123
|
properties: {
|
|
112
124
|
label: ['share space label', { ns: SPACE_PLUGIN }],
|
|
@@ -348,7 +360,7 @@ export default (context: PluginsContext) => {
|
|
|
348
360
|
// Create collection actions and action groups.
|
|
349
361
|
createExtension({
|
|
350
362
|
id: `${SPACE_PLUGIN}/object-actions`,
|
|
351
|
-
filter: (node): node is Node<
|
|
363
|
+
filter: (node): node is Node<AnyLiveObject<any>> => isEchoObject(node.data),
|
|
352
364
|
actions: ({ node }) => {
|
|
353
365
|
const { dispatchPromise: dispatch } = context.requestCapability(Capabilities.IntentDispatcher);
|
|
354
366
|
const state = context.requestCapability(SpaceCapabilities.State);
|
|
@@ -359,7 +371,7 @@ export default (context: PluginsContext) => {
|
|
|
359
371
|
// Object settings plank companion.
|
|
360
372
|
createExtension({
|
|
361
373
|
id: `${SPACE_PLUGIN}/settings`,
|
|
362
|
-
filter: (node): node is Node<
|
|
374
|
+
filter: (node): node is Node<AnyLiveObject<any>> => isEchoObject(node.data),
|
|
363
375
|
connector: ({ node }) => [
|
|
364
376
|
{
|
|
365
377
|
id: [node.id, 'settings'].join(ATTENDABLE_PATH_SEPARATOR),
|
|
@@ -369,7 +381,7 @@ export default (context: PluginsContext) => {
|
|
|
369
381
|
label: ['object settings label', { ns: SPACE_PLUGIN }],
|
|
370
382
|
icon: 'ph--sliders--regular',
|
|
371
383
|
disposition: 'hidden',
|
|
372
|
-
position: '
|
|
384
|
+
position: 'fallback',
|
|
373
385
|
},
|
|
374
386
|
},
|
|
375
387
|
],
|
|
@@ -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';
|
|
@@ -32,7 +32,6 @@ import {
|
|
|
32
32
|
CREATE_OBJECT_DIALOG,
|
|
33
33
|
type CreateObjectDialogProps,
|
|
34
34
|
POPOVER_RENAME_OBJECT,
|
|
35
|
-
POPOVER_ADD_SPACE,
|
|
36
35
|
} from '../components';
|
|
37
36
|
import { SPACE_PLUGIN } from '../meta';
|
|
38
37
|
import { CollectionAction, CollectionType, SpaceAction } from '../types';
|
|
@@ -43,10 +42,11 @@ const SPACE_MAX_OBJECTS = 500;
|
|
|
43
42
|
|
|
44
43
|
type IntentResolverOptions = {
|
|
45
44
|
context: PluginsContext;
|
|
45
|
+
createInvitationUrl: (invitationCode: string) => string;
|
|
46
46
|
observability?: boolean;
|
|
47
47
|
};
|
|
48
48
|
|
|
49
|
-
export default ({ context, observability }: IntentResolverOptions) => {
|
|
49
|
+
export default ({ context, observability, createInvitationUrl }: IntentResolverOptions) => {
|
|
50
50
|
const resolve = (typename: string) =>
|
|
51
51
|
context.requestCapabilities(Capabilities.Metadata).find(({ id }) => id === typename)?.metadata ?? {};
|
|
52
52
|
|
|
@@ -120,48 +120,74 @@ export default ({ context, observability }: IntentResolverOptions) => {
|
|
|
120
120
|
],
|
|
121
121
|
}),
|
|
122
122
|
}),
|
|
123
|
+
createResolver({
|
|
124
|
+
intent: SpaceAction.OpenMembers,
|
|
125
|
+
resolve: ({ space }) => ({
|
|
126
|
+
intents: [
|
|
127
|
+
createIntent(LayoutAction.Open, {
|
|
128
|
+
part: 'main',
|
|
129
|
+
subject: [`members-settings${ATTENDABLE_PATH_SEPARATOR}${space.id}`],
|
|
130
|
+
options: {
|
|
131
|
+
workspace: space.id,
|
|
132
|
+
},
|
|
133
|
+
}),
|
|
134
|
+
],
|
|
135
|
+
}),
|
|
136
|
+
}),
|
|
123
137
|
createResolver({
|
|
124
138
|
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
|
-
|
|
139
|
+
resolve: ({ space, type, authMethod, multiUse, target }) => {
|
|
140
|
+
const invitation = space.share({ type, authMethod, multiUse, target });
|
|
139
141
|
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
|
-
],
|
|
142
|
+
data: invitation,
|
|
143
|
+
intents: observability
|
|
144
|
+
? [
|
|
145
|
+
createIntent(ObservabilityAction.SendEvent, {
|
|
146
|
+
name: 'space.share',
|
|
147
|
+
properties: {
|
|
148
|
+
spaceId: space.id,
|
|
149
|
+
},
|
|
150
|
+
}),
|
|
151
|
+
]
|
|
152
|
+
: [],
|
|
162
153
|
};
|
|
163
154
|
},
|
|
164
155
|
}),
|
|
156
|
+
createResolver({
|
|
157
|
+
intent: SpaceAction.GetShareLink,
|
|
158
|
+
resolve: ({ space, target, copyToClipboard }) =>
|
|
159
|
+
Effect.gen(function* () {
|
|
160
|
+
const { dispatch } = context.requestCapability(Capabilities.IntentDispatcher);
|
|
161
|
+
const invitation = yield* dispatch(
|
|
162
|
+
createIntent(SpaceAction.Share, {
|
|
163
|
+
space,
|
|
164
|
+
type: Invitation.Type.DELEGATED,
|
|
165
|
+
authMethod: Invitation.AuthMethod.KNOWN_PUBLIC_KEY,
|
|
166
|
+
multiUse: true,
|
|
167
|
+
target,
|
|
168
|
+
}),
|
|
169
|
+
);
|
|
170
|
+
|
|
171
|
+
// TODO(wittjosiah): Better api to for this.
|
|
172
|
+
// NOTE: Delegated invitations are invalid until the connecting state when keys are filled in.
|
|
173
|
+
const invitationCode = yield* Effect.tryPromise(
|
|
174
|
+
() =>
|
|
175
|
+
new Promise<string>((resolve) => {
|
|
176
|
+
invitation.subscribe((invitation) => {
|
|
177
|
+
if (invitation.state === Invitation.State.CONNECTING) {
|
|
178
|
+
resolve(InvitationEncoder.encode(invitation));
|
|
179
|
+
}
|
|
180
|
+
});
|
|
181
|
+
}),
|
|
182
|
+
);
|
|
183
|
+
const url = createInvitationUrl(invitationCode);
|
|
184
|
+
if (copyToClipboard) {
|
|
185
|
+
yield* Effect.tryPromise(() => navigator.clipboard.writeText(url));
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
return { data: url };
|
|
189
|
+
}),
|
|
190
|
+
}),
|
|
165
191
|
createResolver({
|
|
166
192
|
intent: SpaceAction.Lock,
|
|
167
193
|
resolve: ({ space }) => {
|
|
@@ -219,55 +245,19 @@ export default ({ context, observability }: IntentResolverOptions) => {
|
|
|
219
245
|
};
|
|
220
246
|
},
|
|
221
247
|
}),
|
|
222
|
-
createResolver({
|
|
223
|
-
intent: SpaceAction.AddSpace,
|
|
224
|
-
resolve: () => {
|
|
225
|
-
return {
|
|
226
|
-
intents: [
|
|
227
|
-
createIntent(LayoutAction.UpdatePopover, {
|
|
228
|
-
part: 'popover',
|
|
229
|
-
subject: POPOVER_ADD_SPACE,
|
|
230
|
-
options: {
|
|
231
|
-
variant: 'react',
|
|
232
|
-
anchorId: SpaceAction.AddSpace._tag,
|
|
233
|
-
side: 'right',
|
|
234
|
-
},
|
|
235
|
-
}),
|
|
236
|
-
],
|
|
237
|
-
};
|
|
238
|
-
},
|
|
239
|
-
}),
|
|
240
248
|
createResolver({
|
|
241
249
|
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
|
-
},
|
|
250
|
+
resolve: ({ space }) => ({
|
|
251
|
+
intents: [
|
|
252
|
+
createIntent(LayoutAction.Open, {
|
|
253
|
+
part: 'main',
|
|
254
|
+
subject: [`properties-settings${ATTENDABLE_PATH_SEPARATOR}${space.id}`],
|
|
255
|
+
options: {
|
|
256
|
+
workspace: space.id,
|
|
257
|
+
},
|
|
258
|
+
}),
|
|
259
|
+
],
|
|
260
|
+
}),
|
|
271
261
|
}),
|
|
272
262
|
createResolver({
|
|
273
263
|
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
|
|
|
@@ -46,8 +46,6 @@ import {
|
|
|
46
46
|
SpacePresence,
|
|
47
47
|
SyncStatus,
|
|
48
48
|
type CreateObjectDialogProps,
|
|
49
|
-
POPOVER_ADD_SPACE,
|
|
50
|
-
PopoverAddSpace,
|
|
51
49
|
MembersContainer,
|
|
52
50
|
ObjectSettingsContainer,
|
|
53
51
|
SpaceSettingsContainer,
|
|
@@ -93,7 +91,7 @@ export default ({ createInvitationUrl }: ReactSurfaceOptions) =>
|
|
|
93
91
|
createSurface({
|
|
94
92
|
id: `${SPACE_PLUGIN}/companion/object-settings`,
|
|
95
93
|
role: 'article',
|
|
96
|
-
filter: (data): data is { companionTo:
|
|
94
|
+
filter: (data): data is { companionTo: AnyLiveObject<any> } =>
|
|
97
95
|
isEchoObject(data.companionTo) && data.subject === 'settings',
|
|
98
96
|
component: ({ data, role }) => <ObjectSettingsContainer object={data.companionTo} role={role} />,
|
|
99
97
|
}),
|
|
@@ -164,8 +162,8 @@ export default ({ createInvitationUrl }: ReactSurfaceOptions) =>
|
|
|
164
162
|
createSurface({
|
|
165
163
|
id: `${SPACE_PLUGIN}/create-initial-space-form-[hue]`,
|
|
166
164
|
role: 'form-input',
|
|
167
|
-
filter: (data): data is { prop: string; schema:
|
|
168
|
-
const annotation = findAnnotation<boolean>((data.schema as
|
|
165
|
+
filter: (data): data is { prop: string; schema: Schema.Schema<any> } => {
|
|
166
|
+
const annotation = findAnnotation<boolean>((data.schema as Schema.Schema.All).ast, HueAnnotationId);
|
|
169
167
|
return !!annotation;
|
|
170
168
|
},
|
|
171
169
|
component: ({ data: _, ...inputProps }) => {
|
|
@@ -183,8 +181,8 @@ export default ({ createInvitationUrl }: ReactSurfaceOptions) =>
|
|
|
183
181
|
createSurface({
|
|
184
182
|
id: `${SPACE_PLUGIN}/create-initial-space-form-[icon]`,
|
|
185
183
|
role: 'form-input',
|
|
186
|
-
filter: (data): data is { prop: string; schema:
|
|
187
|
-
const annotation = findAnnotation<boolean>((data.schema as
|
|
184
|
+
filter: (data): data is { prop: string; schema: Schema.Schema<any> } => {
|
|
185
|
+
const annotation = findAnnotation<boolean>((data.schema as Schema.Schema.All).ast, IconAnnotationId);
|
|
188
186
|
return !!annotation;
|
|
189
187
|
},
|
|
190
188
|
component: ({ data: _, ...inputProps }) => {
|
|
@@ -199,19 +197,6 @@ export default ({ createInvitationUrl }: ReactSurfaceOptions) =>
|
|
|
199
197
|
);
|
|
200
198
|
},
|
|
201
199
|
}),
|
|
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
200
|
createSurface({
|
|
216
201
|
id: POPOVER_RENAME_SPACE,
|
|
217
202
|
role: 'popover',
|
|
@@ -221,26 +206,20 @@ export default ({ createInvitationUrl }: ReactSurfaceOptions) =>
|
|
|
221
206
|
createSurface({
|
|
222
207
|
id: POPOVER_RENAME_OBJECT,
|
|
223
208
|
role: 'popover',
|
|
224
|
-
filter: (data): data is { props:
|
|
209
|
+
filter: (data): data is { props: AnyLiveObject<any> } =>
|
|
225
210
|
data.component === POPOVER_RENAME_OBJECT && isLiveObject(data.props),
|
|
226
211
|
component: ({ data }) => <PopoverRenameObject object={data.props} />,
|
|
227
212
|
}),
|
|
228
|
-
createSurface({
|
|
229
|
-
id: POPOVER_ADD_SPACE,
|
|
230
|
-
role: 'popover',
|
|
231
|
-
filter: (data): data is any => data.component === POPOVER_ADD_SPACE,
|
|
232
|
-
component: () => <PopoverAddSpace />,
|
|
233
|
-
}),
|
|
234
213
|
createSurface({
|
|
235
214
|
id: `${SPACE_PLUGIN}/menu-footer`,
|
|
236
215
|
role: 'menu-footer',
|
|
237
|
-
filter: (data): data is { subject:
|
|
216
|
+
filter: (data): data is { subject: AnyLiveObject<any> } => isEchoObject(data.subject),
|
|
238
217
|
component: ({ data }) => <MenuFooter object={data.subject} />,
|
|
239
218
|
}),
|
|
240
219
|
createSurface({
|
|
241
220
|
id: `${SPACE_PLUGIN}/navtree-presence`,
|
|
242
221
|
role: 'navtree-item-end',
|
|
243
|
-
filter: (data): data is { id: string; subject:
|
|
222
|
+
filter: (data): data is { id: string; subject: AnyLiveObject<any>; open?: boolean } =>
|
|
244
223
|
typeof data.id === 'string' && isEchoObject(data.subject),
|
|
245
224
|
component: ({ data }) => {
|
|
246
225
|
// TODO(wittjosiah): Doesn't need to be mutable but readonly type messes with ComplexMap.
|
|
@@ -267,7 +246,7 @@ export default ({ createInvitationUrl }: ReactSurfaceOptions) =>
|
|
|
267
246
|
id: `${SPACE_PLUGIN}/navbar-presence`,
|
|
268
247
|
role: 'navbar-end',
|
|
269
248
|
position: 'hoist',
|
|
270
|
-
filter: (data): data is { subject: Space |
|
|
249
|
+
filter: (data): data is { subject: Space | AnyLiveObject<any> } =>
|
|
271
250
|
isSpace(data.subject) || isEchoObject(data.subject),
|
|
272
251
|
component: ({ data }) => {
|
|
273
252
|
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>
|
|
@@ -35,7 +35,7 @@ const meta: Meta<typeof CreateObjectDialog> = {
|
|
|
35
35
|
decorators: [
|
|
36
36
|
withClientProvider({ createIdentity: true, createSpace: true, types: [CollectionType] }),
|
|
37
37
|
withTheme,
|
|
38
|
-
withLayout(
|
|
38
|
+
withLayout(),
|
|
39
39
|
],
|
|
40
40
|
parameters: {
|
|
41
41
|
translations: [...translations, osTranslations],
|