@dxos/plugin-space 0.8.4-main.67995b8 → 0.8.4-main.a4bbb77
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 → CollectionMain-AX7KKXWP.mjs} +4 -4
- package/dist/lib/browser/CollectionMain-AX7KKXWP.mjs.map +7 -0
- package/dist/lib/browser/{ObjectDetailsPanel-YPTDQKMG.mjs → ObjectDetailsPanel-ETI5YBTH.mjs} +10 -8
- package/dist/lib/browser/ObjectDetailsPanel-ETI5YBTH.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-V3MP3CDK.mjs → app-graph-builder-W7RVDAUA.mjs} +80 -43
- package/dist/lib/browser/app-graph-builder-W7RVDAUA.mjs.map +7 -0
- package/dist/lib/browser/{app-graph-serializer-H6AW7KGS.mjs → app-graph-serializer-VLHVTDX4.mjs} +14 -14
- package/dist/lib/browser/app-graph-serializer-VLHVTDX4.mjs.map +7 -0
- package/dist/lib/browser/{chunk-FBJEXW54.mjs → chunk-2BFVC5K6.mjs} +139 -150
- package/dist/lib/browser/chunk-2BFVC5K6.mjs.map +7 -0
- package/dist/lib/browser/chunk-E2I747A7.mjs +20 -0
- package/dist/lib/browser/chunk-E2I747A7.mjs.map +7 -0
- package/dist/lib/browser/chunk-EIXZABXD.mjs +19 -0
- package/dist/lib/browser/chunk-EIXZABXD.mjs.map +7 -0
- package/dist/lib/browser/{chunk-VLBRSGJ2.mjs → chunk-ELJDGQTO.mjs} +3 -3
- package/dist/lib/browser/{chunk-VLBRSGJ2.mjs.map → chunk-ELJDGQTO.mjs.map} +3 -3
- package/dist/lib/browser/chunk-IRKDREHY.mjs +11 -0
- package/dist/lib/browser/chunk-IRKDREHY.mjs.map +7 -0
- package/dist/lib/browser/{chunk-SGTQ52SU.mjs → chunk-JCHSUOPF.mjs} +14 -8
- package/dist/lib/browser/chunk-JCHSUOPF.mjs.map +7 -0
- package/dist/lib/browser/{chunk-XUYKJUU7.mjs → chunk-PN27K4I7.mjs} +93 -41
- package/dist/lib/browser/chunk-PN27K4I7.mjs.map +7 -0
- package/dist/lib/browser/{chunk-QACNNDOT.mjs → chunk-ZIZ2JLW6.mjs} +10 -9
- package/dist/lib/browser/chunk-ZIZ2JLW6.mjs.map +7 -0
- package/dist/lib/browser/{identity-created-23XJJV2N.mjs → identity-created-PW2BA46S.mjs} +4 -4
- package/dist/lib/browser/{identity-created-23XJJV2N.mjs.map → identity-created-PW2BA46S.mjs.map} +3 -3
- package/dist/lib/browser/index.mjs +19 -39
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-resolver-XHGD73WZ.mjs → intent-resolver-HA7DPAUE.mjs} +46 -41
- package/dist/lib/browser/intent-resolver-HA7DPAUE.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-root-CMWOGJG5.mjs → react-root-YQUJU64P.mjs} +11 -11
- package/dist/lib/browser/react-root-YQUJU64P.mjs.map +7 -0
- package/dist/lib/browser/{react-surface-YWZZQF7H.mjs → react-surface-HTXYMRSW.mjs} +50 -40
- package/dist/lib/browser/react-surface-HTXYMRSW.mjs.map +7 -0
- package/dist/lib/browser/{schema-defs-Z6FC4AHC.mjs → schema-defs-R56ZDBZ7.mjs} +5 -5
- package/dist/lib/browser/schema-defs-R56ZDBZ7.mjs.map +7 -0
- package/dist/lib/browser/{settings-4IMP5RYT.mjs → settings-5XPQMSPO.mjs} +5 -5
- package/dist/lib/browser/{settings-4IMP5RYT.mjs.map → settings-5XPQMSPO.mjs.map} +1 -1
- package/dist/lib/browser/{spaces-ready-TOPG6IV4.mjs → spaces-ready-YY77ANIF.mjs} +17 -15
- package/dist/lib/browser/spaces-ready-YY77ANIF.mjs.map +7 -0
- package/dist/lib/browser/{state-QYZAB45H.mjs → state-Y4RVCG4A.mjs} +7 -7
- package/dist/lib/browser/state-Y4RVCG4A.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +2 -2
- package/dist/lib/node-esm/{CollectionMain-ZJIFCWKZ.mjs → CollectionMain-EU57SRYK.mjs} +4 -4
- package/dist/lib/node-esm/CollectionMain-EU57SRYK.mjs.map +7 -0
- package/dist/lib/node-esm/{ObjectDetailsPanel-QKZEDSZK.mjs → ObjectDetailsPanel-TQ5GN4QJ.mjs} +10 -8
- package/dist/lib/node-esm/ObjectDetailsPanel-TQ5GN4QJ.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-SG4VECBB.mjs → app-graph-builder-5ZJJUMQI.mjs} +80 -43
- package/dist/lib/node-esm/app-graph-builder-5ZJJUMQI.mjs.map +7 -0
- package/dist/lib/node-esm/{app-graph-serializer-2ICUGQQT.mjs → app-graph-serializer-EZJSGJUT.mjs} +14 -14
- package/dist/lib/node-esm/app-graph-serializer-EZJSGJUT.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-P442DOQ3.mjs → chunk-5XRYHWL7.mjs} +10 -9
- package/dist/lib/node-esm/chunk-5XRYHWL7.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-JH6F4C3I.mjs → chunk-6WNZW6KT.mjs} +14 -8
- package/dist/lib/node-esm/chunk-6WNZW6KT.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-2A3VBXBP.mjs → chunk-BLPXWPLB.mjs} +139 -150
- package/dist/lib/node-esm/chunk-BLPXWPLB.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-IJVBBVCL.mjs +21 -0
- package/dist/lib/node-esm/chunk-IJVBBVCL.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-HWNG4MEU.mjs → chunk-MWNATOXL.mjs} +2 -4
- package/dist/lib/node-esm/chunk-MWNATOXL.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-SSLBYZEY.mjs → chunk-Q6AAQLQG.mjs} +3 -3
- package/dist/lib/node-esm/{chunk-SSLBYZEY.mjs.map → chunk-Q6AAQLQG.mjs.map} +3 -3
- package/dist/lib/node-esm/chunk-SVFKU7EW.mjs +20 -0
- package/dist/lib/node-esm/chunk-SVFKU7EW.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-4AOMYKDE.mjs → chunk-XDQXUZMK.mjs} +93 -41
- package/dist/lib/node-esm/chunk-XDQXUZMK.mjs.map +7 -0
- package/dist/lib/node-esm/{identity-created-IJQO6GCR.mjs → identity-created-MWTLGQRU.mjs} +4 -4
- package/dist/lib/node-esm/{identity-created-IJQO6GCR.mjs.map → identity-created-MWTLGQRU.mjs.map} +3 -3
- package/dist/lib/node-esm/index.mjs +19 -39
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/{intent-resolver-LEANKSKZ.mjs → intent-resolver-LQNHMPIX.mjs} +46 -41
- package/dist/lib/node-esm/intent-resolver-LQNHMPIX.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-root-5Y7LJRX6.mjs → react-root-UTLJEIKE.mjs} +11 -11
- package/dist/lib/node-esm/react-root-UTLJEIKE.mjs.map +7 -0
- package/dist/lib/node-esm/{react-surface-YQFNIKYT.mjs → react-surface-LYDYON3U.mjs} +50 -40
- package/dist/lib/node-esm/react-surface-LYDYON3U.mjs.map +7 -0
- package/dist/lib/node-esm/{schema-defs-WHJM7UZE.mjs → schema-defs-7IMJPIWS.mjs} +5 -5
- package/dist/lib/node-esm/schema-defs-7IMJPIWS.mjs.map +7 -0
- package/dist/lib/node-esm/{settings-SAOBPND3.mjs → settings-XBSK5KHH.mjs} +5 -5
- package/dist/lib/node-esm/{settings-SAOBPND3.mjs.map → settings-XBSK5KHH.mjs.map} +1 -1
- package/dist/lib/node-esm/{spaces-ready-HIUKNDZK.mjs → spaces-ready-YX4IHT4P.mjs} +17 -15
- package/dist/lib/node-esm/spaces-ready-YX4IHT4P.mjs.map +7 -0
- package/dist/lib/node-esm/{state-ZVEHQ4BJ.mjs → state-HOHAVPUO.mjs} +7 -7
- package/dist/lib/node-esm/state-HOHAVPUO.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +2 -2
- package/dist/types/src/SpacePlugin.d.ts +1 -1
- package/dist/types/src/SpacePlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-serializer.d.ts +1 -1
- package/dist/types/src/capabilities/capabilities.d.ts +3 -3
- package/dist/types/src/capabilities/capabilities.d.ts.map +1 -1
- package/dist/types/src/capabilities/identity-created.d.ts +1 -1
- package/dist/types/src/capabilities/identity-created.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +11 -12
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-root.d.ts +2 -2
- package/dist/types/src/capabilities/react-root.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/schema-defs.d.ts +1 -1
- package/dist/types/src/capabilities/schema-defs.d.ts.map +1 -1
- package/dist/types/src/capabilities/settings.d.ts +1 -1
- package/dist/types/src/capabilities/spaces-ready.d.ts +1 -1
- package/dist/types/src/capabilities/spaces-ready.d.ts.map +1 -1
- package/dist/types/src/capabilities/state.d.ts +1 -1
- package/dist/types/src/capabilities/state.d.ts.map +1 -1
- package/dist/types/src/components/CreateDialog/CreateObjectDialog.d.ts +3 -3
- package/dist/types/src/components/CreateDialog/CreateObjectDialog.d.ts.map +1 -1
- package/dist/types/src/components/CreateDialog/CreateObjectDialog.stories.d.ts +1584 -4
- package/dist/types/src/components/CreateDialog/CreateObjectDialog.stories.d.ts.map +1 -1
- package/dist/types/src/components/CreateDialog/CreateObjectPanel.d.ts +5 -3
- package/dist/types/src/components/CreateDialog/CreateObjectPanel.d.ts.map +1 -1
- package/dist/types/src/components/CreateDialog/CreateSpaceDialog.d.ts +1 -1
- package/dist/types/src/components/CreateDialog/CreateSpaceDialog.d.ts.map +1 -1
- package/dist/types/src/components/JoinDialog.d.ts +1 -1
- package/dist/types/src/components/JoinDialog.d.ts.map +1 -1
- package/dist/types/src/components/MembersContainer.d.ts +3 -2
- package/dist/types/src/components/MembersContainer.d.ts.map +1 -1
- package/dist/types/src/components/MembersContainer.stories.d.ts +1584 -5
- package/dist/types/src/components/MembersContainer.stories.d.ts.map +1 -1
- package/dist/types/src/components/ObjectDetailsPanel.d.ts.map +1 -1
- package/dist/types/src/components/ObjectSettings/AdvancedObjectSettings.d.ts.map +1 -1
- package/dist/types/src/components/ObjectSettings/ObjectSettingsContainer.d.ts.map +1 -1
- package/dist/types/src/components/PopoverRenameObject.d.ts +2 -2
- package/dist/types/src/components/PopoverRenameObject.d.ts.map +1 -1
- package/dist/types/src/components/PopoverRenameSpace.d.ts +1 -1
- package/dist/types/src/components/PopoverRenameSpace.d.ts.map +1 -1
- package/dist/types/src/components/RecordMain.d.ts +7 -0
- package/dist/types/src/components/RecordMain.d.ts.map +1 -0
- package/dist/types/src/components/SpacePluginSettings.d.ts.map +1 -1
- package/dist/types/src/components/SpacePresence.d.ts.map +1 -1
- package/dist/types/src/components/SpacePresence.stories.d.ts +1412 -4
- package/dist/types/src/components/SpacePresence.stories.d.ts.map +1 -1
- package/dist/types/src/components/SpaceSettings/SpaceSettingsContainer.d.ts.map +1 -1
- package/dist/types/src/components/SpaceSettings/SpaceSettingsContainer.stories.d.ts +1417 -4
- package/dist/types/src/components/SpaceSettings/SpaceSettingsContainer.stories.d.ts.map +1 -1
- package/dist/types/src/components/SyncStatus/SyncStatus.d.ts.map +1 -1
- package/dist/types/src/components/SyncStatus/SyncStatus.stories.d.ts +1418 -5
- package/dist/types/src/components/SyncStatus/SyncStatus.stories.d.ts.map +1 -1
- package/dist/types/src/components/ViewEditor.d.ts +1 -1
- package/dist/types/src/components/ViewEditor.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +8 -2
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/events.d.ts.map +1 -1
- package/dist/types/src/hooks/useActiveSpace.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +0 -1
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +1216 -26
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +73 -93
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/src/util.d.ts +8 -6
- package/dist/types/src/util.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +63 -62
- package/src/SpacePlugin.ts +203 -218
- package/src/capabilities/app-graph-builder.ts +100 -53
- package/src/capabilities/app-graph-serializer.ts +7 -7
- package/src/capabilities/capabilities.ts +11 -10
- package/src/capabilities/identity-created.ts +1 -1
- package/src/capabilities/index.ts +0 -1
- package/src/capabilities/intent-resolver.ts +36 -24
- package/src/capabilities/react-root.tsx +4 -3
- package/src/capabilities/react-surface.tsx +45 -36
- package/src/capabilities/schema-defs.ts +3 -2
- package/src/capabilities/spaces-ready.ts +10 -7
- package/src/capabilities/state.ts +5 -4
- package/src/components/AwaitingObject.tsx +3 -3
- package/src/components/CollectionMain.tsx +2 -2
- package/src/components/CollectionSection.tsx +2 -2
- package/src/components/CreateDialog/CreateObjectDialog.stories.tsx +11 -10
- package/src/components/CreateDialog/CreateObjectDialog.tsx +21 -11
- package/src/components/CreateDialog/CreateObjectPanel.tsx +22 -11
- package/src/components/CreateDialog/CreateSpaceDialog.tsx +4 -4
- package/src/components/JoinDialog.tsx +7 -7
- package/src/components/MembersContainer.stories.tsx +36 -10
- package/src/components/MembersContainer.tsx +12 -13
- package/src/components/MenuFooter.tsx +2 -2
- package/src/components/ObjectDetailsPanel.tsx +6 -4
- package/src/components/ObjectSettings/AdvancedObjectSettings.tsx +3 -2
- package/src/components/ObjectSettings/ForeignKeys.tsx +2 -2
- package/src/components/ObjectSettings/ObjectSettingsContainer.tsx +3 -2
- package/src/components/PersistenceStatus.tsx +2 -2
- package/src/components/PopoverRenameObject.tsx +9 -15
- package/src/components/PopoverRenameSpace.tsx +4 -4
- package/src/components/RecordMain.tsx +43 -0
- package/src/components/SchemaContainer.tsx +4 -4
- package/src/components/SpacePluginSettings.tsx +8 -9
- package/src/components/SpacePresence.stories.tsx +23 -22
- package/src/components/SpacePresence.tsx +9 -9
- package/src/components/SpaceSettings/SpaceSettingsContainer.stories.tsx +17 -9
- package/src/components/SpaceSettings/SpaceSettingsContainer.tsx +17 -17
- package/src/components/SyncStatus/InlineSyncStatus.tsx +2 -2
- package/src/components/SyncStatus/SyncStatus.stories.tsx +6 -7
- package/src/components/SyncStatus/SyncStatus.tsx +4 -3
- package/src/components/ViewEditor.tsx +13 -18
- package/src/components/index.ts +1 -0
- package/src/events.ts +7 -7
- package/src/hooks/useActiveSpace.ts +2 -2
- package/src/hooks/useInputSurfaceLookup.tsx +1 -1
- package/src/meta.ts +1 -3
- package/src/translations.ts +8 -7
- package/src/types/types.ts +15 -10
- package/src/util.tsx +86 -37
- package/dist/lib/browser/CollectionMain-D2B75XBS.mjs.map +0 -7
- package/dist/lib/browser/ObjectDetailsPanel-YPTDQKMG.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-V3MP3CDK.mjs.map +0 -7
- package/dist/lib/browser/app-graph-serializer-H6AW7KGS.mjs.map +0 -7
- package/dist/lib/browser/chunk-CEFHNVU7.mjs +0 -20
- package/dist/lib/browser/chunk-CEFHNVU7.mjs.map +0 -7
- package/dist/lib/browser/chunk-FBCGT5YY.mjs +0 -13
- package/dist/lib/browser/chunk-FBCGT5YY.mjs.map +0 -7
- package/dist/lib/browser/chunk-FBJEXW54.mjs.map +0 -7
- package/dist/lib/browser/chunk-JS3MMC42.mjs +0 -19
- package/dist/lib/browser/chunk-JS3MMC42.mjs.map +0 -7
- package/dist/lib/browser/chunk-QACNNDOT.mjs.map +0 -7
- package/dist/lib/browser/chunk-SGTQ52SU.mjs.map +0 -7
- package/dist/lib/browser/chunk-XUYKJUU7.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-XHGD73WZ.mjs.map +0 -7
- package/dist/lib/browser/react-root-CMWOGJG5.mjs.map +0 -7
- package/dist/lib/browser/react-surface-YWZZQF7H.mjs.map +0 -7
- package/dist/lib/browser/schema-defs-Z6FC4AHC.mjs.map +0 -7
- package/dist/lib/browser/schema-tools-BNP4JTD7.mjs +0 -124
- package/dist/lib/browser/schema-tools-BNP4JTD7.mjs.map +0 -7
- package/dist/lib/browser/spaces-ready-TOPG6IV4.mjs.map +0 -7
- package/dist/lib/browser/state-QYZAB45H.mjs.map +0 -7
- package/dist/lib/node-esm/CollectionMain-ZJIFCWKZ.mjs.map +0 -7
- package/dist/lib/node-esm/ObjectDetailsPanel-QKZEDSZK.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-SG4VECBB.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-serializer-2ICUGQQT.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-2A3VBXBP.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-4AOMYKDE.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-5HHYE264.mjs +0 -20
- package/dist/lib/node-esm/chunk-5HHYE264.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-5T3ZH23B.mjs +0 -21
- package/dist/lib/node-esm/chunk-5T3ZH23B.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HWNG4MEU.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-JH6F4C3I.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-P442DOQ3.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-LEANKSKZ.mjs.map +0 -7
- package/dist/lib/node-esm/react-root-5Y7LJRX6.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-YQFNIKYT.mjs.map +0 -7
- package/dist/lib/node-esm/schema-defs-WHJM7UZE.mjs.map +0 -7
- package/dist/lib/node-esm/schema-tools-KWW5PTML.mjs +0 -126
- package/dist/lib/node-esm/schema-tools-KWW5PTML.mjs.map +0 -7
- package/dist/lib/node-esm/spaces-ready-HIUKNDZK.mjs.map +0 -7
- package/dist/lib/node-esm/state-ZVEHQ4BJ.mjs.map +0 -7
- package/dist/types/src/capabilities/schema-tool.test.d.ts +0 -2
- package/dist/types/src/capabilities/schema-tool.test.d.ts.map +0 -1
- package/dist/types/src/capabilities/schema-tools.d.ts +0 -13
- package/dist/types/src/capabilities/schema-tools.d.ts.map +0 -1
- package/src/capabilities/schema-tool.test.ts +0 -44
- package/src/capabilities/schema-tools.ts +0 -125
|
@@ -3,23 +3,24 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { Rx } from '@effect-rx/rx-react';
|
|
6
|
-
import { Array, Option,
|
|
6
|
+
import { Array, Option, Schema, pipe } from 'effect';
|
|
7
7
|
|
|
8
|
-
import { Capabilities, contributes, createIntent
|
|
9
|
-
import {
|
|
8
|
+
import { Capabilities, type PluginContext, contributes, createIntent } from '@dxos/app-framework';
|
|
9
|
+
import { type QueryResult, type Space, SpaceState, getSpace, isSpace, parseId } from '@dxos/client/echo';
|
|
10
10
|
import { Filter, Obj, Query, Type } from '@dxos/echo';
|
|
11
11
|
import { log } from '@dxos/log';
|
|
12
12
|
import { ClientCapabilities } from '@dxos/plugin-client';
|
|
13
|
-
import {
|
|
14
|
-
import { createExtension, rxFromObservable,
|
|
15
|
-
import { DataType } from '@dxos/schema';
|
|
13
|
+
import { ATTENDABLE_PATH_SEPARATOR, PLANK_COMPANION_TYPE } from '@dxos/plugin-deck/types';
|
|
14
|
+
import { ROOT_ID, createExtension, rxFromObservable, rxFromSignal } from '@dxos/plugin-graph';
|
|
15
|
+
import { DataType, typenameFromQuery } from '@dxos/schema';
|
|
16
16
|
import { isNonNullable } from '@dxos/util';
|
|
17
17
|
|
|
18
|
-
import { SpaceCapabilities } from './capabilities';
|
|
19
18
|
import { getActiveSpace } from '../hooks';
|
|
20
|
-
import {
|
|
19
|
+
import { meta } from '../meta';
|
|
21
20
|
import { SPACE_TYPE, SpaceAction, type SpaceSettingsProps } from '../types';
|
|
22
21
|
import {
|
|
22
|
+
SHARED,
|
|
23
|
+
SPACES,
|
|
23
24
|
constructObjectActions,
|
|
24
25
|
constructSpaceActions,
|
|
25
26
|
constructSpaceNode,
|
|
@@ -27,10 +28,10 @@ import {
|
|
|
27
28
|
createStaticSchemaActions,
|
|
28
29
|
createStaticSchemaNode,
|
|
29
30
|
rxFromQuery,
|
|
30
|
-
SHARED,
|
|
31
|
-
SPACES,
|
|
32
31
|
} from '../util';
|
|
33
32
|
|
|
33
|
+
import { SpaceCapabilities } from './capabilities';
|
|
34
|
+
|
|
34
35
|
export default (context: PluginContext) => {
|
|
35
36
|
// TODO(wittjosiah): Make reactive.
|
|
36
37
|
const resolve = (typename: string) =>
|
|
@@ -41,7 +42,7 @@ export default (context: PluginContext) => {
|
|
|
41
42
|
type: SPACES,
|
|
42
43
|
cacheable: ['label', 'role'],
|
|
43
44
|
properties: {
|
|
44
|
-
label: ['spaces label', { ns:
|
|
45
|
+
label: ['spaces label', { ns: meta.id }],
|
|
45
46
|
icon: 'ph--planet--regular',
|
|
46
47
|
testId: 'spacePlugin.spaces',
|
|
47
48
|
role: 'branch',
|
|
@@ -76,7 +77,7 @@ export default (context: PluginContext) => {
|
|
|
76
77
|
return contributes(Capabilities.AppGraphBuilder, [
|
|
77
78
|
// Primary actions.
|
|
78
79
|
createExtension({
|
|
79
|
-
id: `${
|
|
80
|
+
id: `${meta.id}/primary-actions`,
|
|
80
81
|
position: 'hoist',
|
|
81
82
|
actions: (node) =>
|
|
82
83
|
Rx.make((get) =>
|
|
@@ -91,7 +92,7 @@ export default (context: PluginContext) => {
|
|
|
91
92
|
await dispatch(createIntent(SpaceAction.OpenCreateSpace));
|
|
92
93
|
},
|
|
93
94
|
properties: {
|
|
94
|
-
label: ['create space label', { ns:
|
|
95
|
+
label: ['create space label', { ns: meta.id }],
|
|
95
96
|
icon: 'ph--plus--regular',
|
|
96
97
|
testId: 'spacePlugin.createSpace',
|
|
97
98
|
disposition: 'menu',
|
|
@@ -104,7 +105,7 @@ export default (context: PluginContext) => {
|
|
|
104
105
|
await dispatch(createIntent(SpaceAction.Join));
|
|
105
106
|
},
|
|
106
107
|
properties: {
|
|
107
|
-
label: ['join space label', { ns:
|
|
108
|
+
label: ['join space label', { ns: meta.id }],
|
|
108
109
|
icon: 'ph--sign-in--regular',
|
|
109
110
|
testId: 'spacePlugin.joinSpace',
|
|
110
111
|
disposition: 'menu',
|
|
@@ -119,7 +120,7 @@ export default (context: PluginContext) => {
|
|
|
119
120
|
await dispatch(createIntent(SpaceAction.OpenMembers, { space }));
|
|
120
121
|
},
|
|
121
122
|
properties: {
|
|
122
|
-
label: ['share space label', { ns:
|
|
123
|
+
label: ['share space label', { ns: meta.id }],
|
|
123
124
|
icon: 'ph--users--regular',
|
|
124
125
|
testId: 'spacePlugin.shareSpace',
|
|
125
126
|
keyBinding: {
|
|
@@ -137,7 +138,7 @@ export default (context: PluginContext) => {
|
|
|
137
138
|
await dispatch(createIntent(SpaceAction.OpenSettings, { space }));
|
|
138
139
|
},
|
|
139
140
|
properties: {
|
|
140
|
-
label: ['open current space settings label', { ns:
|
|
141
|
+
label: ['open current space settings label', { ns: meta.id }],
|
|
141
142
|
icon: 'ph--faders--regular',
|
|
142
143
|
keyBinding: {
|
|
143
144
|
macos: 'meta+shift+,',
|
|
@@ -153,7 +154,7 @@ export default (context: PluginContext) => {
|
|
|
153
154
|
|
|
154
155
|
// Create spaces group node.
|
|
155
156
|
createExtension({
|
|
156
|
-
id: `${
|
|
157
|
+
id: `${meta.id}/root`,
|
|
157
158
|
position: 'hoist',
|
|
158
159
|
connector: (node) =>
|
|
159
160
|
Rx.make((get) =>
|
|
@@ -190,7 +191,7 @@ export default (context: PluginContext) => {
|
|
|
190
191
|
}
|
|
191
192
|
|
|
192
193
|
const settings = get(context.capabilities(Capabilities.SettingsStore))[0]?.getStore<SpaceSettingsProps>(
|
|
193
|
-
|
|
194
|
+
meta.id,
|
|
194
195
|
)?.value;
|
|
195
196
|
|
|
196
197
|
// TODO(wittjosiah): During client reset, accessing default space throws.
|
|
@@ -275,7 +276,7 @@ export default (context: PluginContext) => {
|
|
|
275
276
|
|
|
276
277
|
// Create space actions.
|
|
277
278
|
createExtension({
|
|
278
|
-
id: `${
|
|
279
|
+
id: `${meta.id}/actions`,
|
|
279
280
|
actions: (node) =>
|
|
280
281
|
Rx.make((get) =>
|
|
281
282
|
pipe(
|
|
@@ -307,7 +308,7 @@ export default (context: PluginContext) => {
|
|
|
307
308
|
|
|
308
309
|
// Create nodes for objects in the root collection of a space.
|
|
309
310
|
createExtension({
|
|
310
|
-
id: `${
|
|
311
|
+
id: `${meta.id}/root-collection`,
|
|
311
312
|
connector: (node) =>
|
|
312
313
|
Rx.make((get) =>
|
|
313
314
|
pipe(
|
|
@@ -357,7 +358,7 @@ export default (context: PluginContext) => {
|
|
|
357
358
|
|
|
358
359
|
// Create nodes for objects in a collection or by its fully qualified id.
|
|
359
360
|
createExtension({
|
|
360
|
-
id: `${
|
|
361
|
+
id: `${meta.id}/objects`,
|
|
361
362
|
connector: (node) =>
|
|
362
363
|
Rx.make((get) =>
|
|
363
364
|
pipe(
|
|
@@ -428,7 +429,7 @@ export default (context: PluginContext) => {
|
|
|
428
429
|
|
|
429
430
|
// Create nodes for objects in a query collection.
|
|
430
431
|
createExtension({
|
|
431
|
-
id: `${
|
|
432
|
+
id: `${meta.id}/query-collection-objects`,
|
|
432
433
|
connector: (node) => {
|
|
433
434
|
let query: QueryResult<Type.Expando> | undefined;
|
|
434
435
|
return Rx.make((get) =>
|
|
@@ -439,9 +440,8 @@ export default (context: PluginContext) => {
|
|
|
439
440
|
),
|
|
440
441
|
Option.flatMap((collection) => {
|
|
441
442
|
const space = getSpace(collection);
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
: Option.none();
|
|
443
|
+
const typename = typenameFromQuery(collection.query);
|
|
444
|
+
return typename && space ? Option.some({ typename, space }) : Option.none();
|
|
445
445
|
}),
|
|
446
446
|
Option.map(({ typename, space }) => {
|
|
447
447
|
const state = context.getCapability(SpaceCapabilities.State);
|
|
@@ -458,21 +458,25 @@ export default (context: PluginContext) => {
|
|
|
458
458
|
),
|
|
459
459
|
);
|
|
460
460
|
}
|
|
461
|
-
return
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
461
|
+
return (
|
|
462
|
+
get(rxFromQuery(query))
|
|
463
|
+
// TODO(wittjosiah): This should be the default sort order.
|
|
464
|
+
.toSorted((a, b) => a.id.localeCompare(b.id))
|
|
465
|
+
.map((object) =>
|
|
466
|
+
get(
|
|
467
|
+
rxFromSignal(() =>
|
|
468
|
+
createObjectNode({
|
|
469
|
+
object,
|
|
470
|
+
space,
|
|
471
|
+
resolve,
|
|
472
|
+
droppable: false, // Cannot rearrange query collections.
|
|
473
|
+
navigable: state.navigableCollections,
|
|
474
|
+
}),
|
|
475
|
+
),
|
|
472
476
|
),
|
|
473
|
-
)
|
|
474
|
-
|
|
475
|
-
|
|
477
|
+
)
|
|
478
|
+
.filter(isNonNullable)
|
|
479
|
+
);
|
|
476
480
|
}),
|
|
477
481
|
Option.getOrElse(() => []),
|
|
478
482
|
),
|
|
@@ -482,7 +486,7 @@ export default (context: PluginContext) => {
|
|
|
482
486
|
|
|
483
487
|
// Static schema records.
|
|
484
488
|
createExtension({
|
|
485
|
-
id: `${
|
|
489
|
+
id: `${meta.id}/static-schemas`,
|
|
486
490
|
connector: (node) => {
|
|
487
491
|
const client = context.getCapability(ClientCapabilities.Client);
|
|
488
492
|
return Rx.make((get) =>
|
|
@@ -490,7 +494,7 @@ export default (context: PluginContext) => {
|
|
|
490
494
|
get(node),
|
|
491
495
|
Option.flatMap((node) =>
|
|
492
496
|
Obj.instanceOf(DataType.QueryCollection, node.data) &&
|
|
493
|
-
node.data.query
|
|
497
|
+
typenameFromQuery(node.data.query) === DataType.StoredSchema.typename
|
|
494
498
|
? Option.some(node.data)
|
|
495
499
|
: Option.none(),
|
|
496
500
|
),
|
|
@@ -514,7 +518,7 @@ export default (context: PluginContext) => {
|
|
|
514
518
|
|
|
515
519
|
// Create static schema actions.
|
|
516
520
|
createExtension({
|
|
517
|
-
id: `${
|
|
521
|
+
id: `${meta.id}/static-schema-actions`,
|
|
518
522
|
actions: (node) => {
|
|
519
523
|
let query: QueryResult<DataType.View> | undefined;
|
|
520
524
|
return Rx.make((get) =>
|
|
@@ -534,13 +538,25 @@ export default (context: PluginContext) => {
|
|
|
534
538
|
const filteredViews = get(
|
|
535
539
|
rxFromSignal(() =>
|
|
536
540
|
// TODO(wittjosiah): Remove cast.
|
|
537
|
-
views.filter(
|
|
541
|
+
views.filter(
|
|
542
|
+
(view) => typenameFromQuery(view.query.ast) === Type.getTypename(schema as Type.Obj.Any),
|
|
543
|
+
),
|
|
538
544
|
),
|
|
539
545
|
);
|
|
540
546
|
const deletable = filteredViews.length === 0;
|
|
541
547
|
|
|
548
|
+
const [dispatcher] = get(context.capabilities(Capabilities.IntentDispatcher));
|
|
549
|
+
if (!dispatcher) {
|
|
550
|
+
return [];
|
|
551
|
+
}
|
|
552
|
+
|
|
542
553
|
// TODO(wittjosiah): Remove cast.
|
|
543
|
-
return createStaticSchemaActions({
|
|
554
|
+
return createStaticSchemaActions({
|
|
555
|
+
schema: schema as Type.Obj.Any,
|
|
556
|
+
space,
|
|
557
|
+
dispatch: dispatcher.dispatchPromise,
|
|
558
|
+
deletable,
|
|
559
|
+
});
|
|
544
560
|
}),
|
|
545
561
|
Option.getOrElse(() => []),
|
|
546
562
|
),
|
|
@@ -550,7 +566,7 @@ export default (context: PluginContext) => {
|
|
|
550
566
|
|
|
551
567
|
// Create nodes for schema views.
|
|
552
568
|
createExtension({
|
|
553
|
-
id: `${
|
|
569
|
+
id: `${meta.id}/schema-views`,
|
|
554
570
|
connector: (node) => {
|
|
555
571
|
let query: QueryResult<DataType.View> | undefined;
|
|
556
572
|
return Rx.make((get) =>
|
|
@@ -571,7 +587,7 @@ export default (context: PluginContext) => {
|
|
|
571
587
|
// TODO(wittjosiah): Remove cast.
|
|
572
588
|
const typename = Schema.isSchema(schema) ? Type.getTypename(schema as Type.Obj.Any) : schema.typename;
|
|
573
589
|
return get(rxFromQuery(query))
|
|
574
|
-
.filter((view) => view.query.
|
|
590
|
+
.filter((view) => typenameFromQuery(view.query.ast) === typename)
|
|
575
591
|
.map((view) =>
|
|
576
592
|
get(
|
|
577
593
|
rxFromSignal(() =>
|
|
@@ -592,9 +608,40 @@ export default (context: PluginContext) => {
|
|
|
592
608
|
},
|
|
593
609
|
}),
|
|
594
610
|
|
|
611
|
+
// Create record nodes.
|
|
612
|
+
createExtension({
|
|
613
|
+
id: `${meta.id}/records`,
|
|
614
|
+
resolver: (id) => {
|
|
615
|
+
let query: QueryResult<Type.Expando> | undefined;
|
|
616
|
+
return Rx.make((get) => {
|
|
617
|
+
const client = context.getCapability(ClientCapabilities.Client);
|
|
618
|
+
const { spaceId, objectId } = parseId(id);
|
|
619
|
+
if (!spaceId || !objectId) {
|
|
620
|
+
return null;
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
const space = client.spaces.get(spaceId);
|
|
624
|
+
if (!space) {
|
|
625
|
+
return null;
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
if (!query) {
|
|
629
|
+
query = space.db.query(Filter.ids(objectId));
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
const object = get(rxFromQuery(query)).at(0);
|
|
633
|
+
if (!object) {
|
|
634
|
+
return null;
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
return createObjectNode({ object, space, resolve, disposition: 'hidden' });
|
|
638
|
+
});
|
|
639
|
+
},
|
|
640
|
+
}),
|
|
641
|
+
|
|
595
642
|
// Create collection actions and action groups.
|
|
596
643
|
createExtension({
|
|
597
|
-
id: `${
|
|
644
|
+
id: `${meta.id}/object-actions`,
|
|
598
645
|
actions: (node) => {
|
|
599
646
|
let query: QueryResult<DataType.View> | undefined;
|
|
600
647
|
return Rx.make((get) =>
|
|
@@ -616,12 +663,12 @@ export default (context: PluginContext) => {
|
|
|
616
663
|
// Don't allow the Records smart collection to be deleted.
|
|
617
664
|
!(
|
|
618
665
|
Obj.instanceOf(DataType.QueryCollection, object) &&
|
|
619
|
-
object.query
|
|
666
|
+
typenameFromQuery(object.query) === DataType.StoredSchema.typename
|
|
620
667
|
);
|
|
621
668
|
if (isSchema && query) {
|
|
622
669
|
const views = get(rxFromQuery(query));
|
|
623
670
|
const filteredViews = get(
|
|
624
|
-
rxFromSignal(() => views.filter((view) => view.query.
|
|
671
|
+
rxFromSignal(() => views.filter((view) => typenameFromQuery(view.query.ast) === object.typename)),
|
|
625
672
|
);
|
|
626
673
|
deletable = filteredViews.length === 0;
|
|
627
674
|
}
|
|
@@ -653,7 +700,7 @@ export default (context: PluginContext) => {
|
|
|
653
700
|
|
|
654
701
|
// View selected objects.
|
|
655
702
|
createExtension({
|
|
656
|
-
id: `${
|
|
703
|
+
id: `${meta.id}/selected-objects`,
|
|
657
704
|
connector: (node) =>
|
|
658
705
|
Rx.make((get) =>
|
|
659
706
|
pipe(
|
|
@@ -665,7 +712,7 @@ export default (context: PluginContext) => {
|
|
|
665
712
|
type: PLANK_COMPANION_TYPE,
|
|
666
713
|
data: 'selected-objects',
|
|
667
714
|
properties: {
|
|
668
|
-
label: ['companion selected objects label', { ns:
|
|
715
|
+
label: ['companion selected objects label', { ns: meta.id }],
|
|
669
716
|
icon: 'ph--tree-view--regular',
|
|
670
717
|
disposition: 'hidden',
|
|
671
718
|
},
|
|
@@ -678,7 +725,7 @@ export default (context: PluginContext) => {
|
|
|
678
725
|
|
|
679
726
|
// Object settings plank companion.
|
|
680
727
|
createExtension({
|
|
681
|
-
id: `${
|
|
728
|
+
id: `${meta.id}/settings`,
|
|
682
729
|
connector: (node) =>
|
|
683
730
|
Rx.make((get) =>
|
|
684
731
|
pipe(
|
|
@@ -690,7 +737,7 @@ export default (context: PluginContext) => {
|
|
|
690
737
|
type: PLANK_COMPANION_TYPE,
|
|
691
738
|
data: 'settings',
|
|
692
739
|
properties: {
|
|
693
|
-
label: ['object settings label', { ns:
|
|
740
|
+
label: ['object settings label', { ns: meta.id }],
|
|
694
741
|
icon: 'ph--sliders--regular',
|
|
695
742
|
disposition: 'hidden',
|
|
696
743
|
position: 'fallback',
|
|
@@ -7,7 +7,7 @@ import { isSpace } from '@dxos/client/echo';
|
|
|
7
7
|
import { Obj, Type } from '@dxos/echo';
|
|
8
8
|
import { DataType } from '@dxos/schema';
|
|
9
9
|
|
|
10
|
-
import {
|
|
10
|
+
import { meta } from '../meta';
|
|
11
11
|
import { translations } from '../translations';
|
|
12
12
|
import { SPACE_TYPE, SpaceAction } from '../types';
|
|
13
13
|
import { SPACES } from '../util';
|
|
@@ -23,8 +23,8 @@ export default (context: PluginContext) =>
|
|
|
23
23
|
inputType: SPACES,
|
|
24
24
|
outputType: DIRECTORY_TYPE,
|
|
25
25
|
serialize: (node) => ({
|
|
26
|
-
name: translations[0]['en-US'][
|
|
27
|
-
data: translations[0]['en-US'][
|
|
26
|
+
name: translations[0]['en-US'][meta.id]['spaces label'] ?? 'Spaces',
|
|
27
|
+
data: translations[0]['en-US'][meta.id]['spaces label'] ?? 'Spaces',
|
|
28
28
|
type: DIRECTORY_TYPE,
|
|
29
29
|
}),
|
|
30
30
|
deserialize: () => {
|
|
@@ -35,8 +35,8 @@ export default (context: PluginContext) =>
|
|
|
35
35
|
inputType: SPACE_TYPE,
|
|
36
36
|
outputType: DIRECTORY_TYPE,
|
|
37
37
|
serialize: (node) => ({
|
|
38
|
-
name: node.data.properties.name ?? translations[0]['en-US'][
|
|
39
|
-
data: node.data.properties.name ?? translations[0]['en-US'][
|
|
38
|
+
name: node.data.properties.name ?? translations[0]['en-US'][meta.id]['unnamed space label'],
|
|
39
|
+
data: node.data.properties.name ?? translations[0]['en-US'][meta.id]['unnamed space label'],
|
|
40
40
|
type: DIRECTORY_TYPE,
|
|
41
41
|
}),
|
|
42
42
|
deserialize: async (data) => {
|
|
@@ -49,8 +49,8 @@ export default (context: PluginContext) =>
|
|
|
49
49
|
inputType: COLLECTION_TYPE,
|
|
50
50
|
outputType: DIRECTORY_TYPE,
|
|
51
51
|
serialize: (node) => ({
|
|
52
|
-
name: node.data.name ?? translations[0]['en-US'][
|
|
53
|
-
data: node.data.name ?? translations[0]['en-US'][
|
|
52
|
+
name: node.data.name ?? translations[0]['en-US'][meta.id]['object name placeholder'],
|
|
53
|
+
data: node.data.name ?? translations[0]['en-US'][meta.id]['object name placeholder'],
|
|
54
54
|
type: DIRECTORY_TYPE,
|
|
55
55
|
}),
|
|
56
56
|
deserialize: async (data, ancestors) => {
|
|
@@ -4,26 +4,27 @@
|
|
|
4
4
|
|
|
5
5
|
import { type Schema } from 'effect';
|
|
6
6
|
|
|
7
|
-
import { type AnyIntentChain,
|
|
7
|
+
import { type AnyIntentChain, type Label, defineCapability } from '@dxos/app-framework';
|
|
8
8
|
import { type Space } from '@dxos/react-client/echo';
|
|
9
9
|
import { type DataType } from '@dxos/schema';
|
|
10
|
-
import { type
|
|
10
|
+
import { type DeepReadonly, type Position } from '@dxos/util';
|
|
11
11
|
|
|
12
|
-
import {
|
|
12
|
+
import { meta } from '../meta';
|
|
13
13
|
import { type ObjectForm, type PluginState } from '../types';
|
|
14
14
|
|
|
15
15
|
export namespace SpaceCapabilities {
|
|
16
|
-
export const State = defineCapability<DeepReadonly<PluginState>>(`${
|
|
17
|
-
export const MutableState = defineCapability<PluginState>(`${
|
|
16
|
+
export const State = defineCapability<DeepReadonly<PluginState>>(`${meta.id}/capability/state`);
|
|
17
|
+
export const MutableState = defineCapability<PluginState>(`${meta.id}/capability/state`);
|
|
18
18
|
|
|
19
19
|
export type SettingsSection = { id: string; label: Label; position?: Position };
|
|
20
|
-
export const SettingsSection = defineCapability<SettingsSection>(`${
|
|
20
|
+
export const SettingsSection = defineCapability<SettingsSection>(`${meta.id}/capability/settings-section`);
|
|
21
21
|
|
|
22
|
-
export type
|
|
23
|
-
export const
|
|
22
|
+
export type onCreateSpace = (params: { space: Space; rootCollection: DataType.Collection }) => AnyIntentChain;
|
|
23
|
+
export const onCreateSpace = defineCapability<onCreateSpace>(`${meta.id}/capability/on-space-created`);
|
|
24
24
|
|
|
25
25
|
export type OnSchemaAdded = (params: { space: Space; schema: Schema.Schema.AnyNoContext }) => AnyIntentChain;
|
|
26
|
-
export const OnSchemaAdded = defineCapability<OnSchemaAdded>(`${
|
|
26
|
+
export const OnSchemaAdded = defineCapability<OnSchemaAdded>(`${meta.id}/capability/on-schema-added`);
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
// TODO(burdon): Should this be view? Forms are UI concepts? (associated with a View/schema).
|
|
29
|
+
export const ObjectForm = defineCapability<ObjectForm<any>>(`${meta.id}/capability/object-form`);
|
|
29
30
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { Capabilities, type PluginContext, contributes } from '@dxos/app-framework';
|
|
6
6
|
import { Obj, Ref } from '@dxos/echo';
|
|
7
7
|
import { Migrations } from '@dxos/migrations';
|
|
8
8
|
import { ClientCapabilities } from '@dxos/plugin-client';
|
|
@@ -11,7 +11,6 @@ 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
13
|
export const SchemaDefs = lazy(() => import('./schema-defs'));
|
|
14
|
-
export const SchemaTools = lazy(() => import('./schema-tools'));
|
|
15
14
|
export const SpaceSettings = lazy(() => import('./settings'));
|
|
16
15
|
export const SpaceState = lazy(() => import('./state'));
|
|
17
16
|
export const SpacesReady = lazy(() => import('./spaces-ready'));
|
|
@@ -12,31 +12,32 @@ import {
|
|
|
12
12
|
createIntent,
|
|
13
13
|
createResolver,
|
|
14
14
|
} from '@dxos/app-framework';
|
|
15
|
-
import { Obj, Ref, Relation, Type } from '@dxos/echo';
|
|
15
|
+
import { Filter, Obj, Query, 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, ProjectionModel } from '@dxos/schema';
|
|
24
|
+
import { DataType, ProjectionModel, typenameFromQuery } 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
|
-
import {
|
|
36
|
+
import { meta } 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;
|
|
@@ -87,15 +88,15 @@ export default ({ context, observability, createInvitationUrl }: IntentResolverO
|
|
|
87
88
|
|
|
88
89
|
// Create records smart collection.
|
|
89
90
|
const records = Obj.make(DataType.QueryCollection, {
|
|
90
|
-
query:
|
|
91
|
+
query: Query.select(Filter.typename(DataType.StoredSchema.typename)).ast,
|
|
91
92
|
});
|
|
92
93
|
collection.objects.push(Ref.make(records));
|
|
93
94
|
|
|
94
95
|
// Allow other plugins to add default content.
|
|
95
96
|
await context.activatePromise(SpaceEvents.SpaceCreated);
|
|
96
|
-
const
|
|
97
|
-
const spaceCreatedIntents =
|
|
98
|
-
|
|
97
|
+
const onCreateSpaceCallbacks = context.getCapabilities(SpaceCapabilities.onCreateSpace);
|
|
98
|
+
const spaceCreatedIntents = onCreateSpaceCallbacks.map((onCreateSpace) =>
|
|
99
|
+
onCreateSpace({ space, rootCollection: collection }),
|
|
99
100
|
);
|
|
100
101
|
|
|
101
102
|
return {
|
|
@@ -360,11 +361,17 @@ export default ({ context, observability, createInvitationUrl }: IntentResolverO
|
|
|
360
361
|
}),
|
|
361
362
|
createResolver({
|
|
362
363
|
intent: SpaceAction.AddSchema,
|
|
363
|
-
resolve: async ({ space, name, schema: schemaInput }) => {
|
|
364
|
+
resolve: async ({ space, name, typename, version, schema: schemaInput }) => {
|
|
364
365
|
const [schema] = await space.db.schemaRegistry.register([schemaInput]);
|
|
365
366
|
if (name) {
|
|
366
367
|
schema.storedSchema.name = name;
|
|
367
368
|
}
|
|
369
|
+
if (typename) {
|
|
370
|
+
schema.storedSchema.typename = typename;
|
|
371
|
+
}
|
|
372
|
+
if (version) {
|
|
373
|
+
schema.storedSchema.version = version;
|
|
374
|
+
}
|
|
368
375
|
|
|
369
376
|
await context.activatePromise(SpaceEvents.SchemaAdded);
|
|
370
377
|
const onSchemaAdded = context.getCapabilities(SpaceCapabilities.OnSchemaAdded);
|
|
@@ -399,15 +406,16 @@ export default ({ context, observability, createInvitationUrl }: IntentResolverO
|
|
|
399
406
|
resolve: async ({ view, fieldId, deletionData }, undo) => {
|
|
400
407
|
const space = getSpace(view);
|
|
401
408
|
invariant(space);
|
|
402
|
-
|
|
403
|
-
|
|
409
|
+
const typename = typenameFromQuery(view.query.ast);
|
|
410
|
+
invariant(typename);
|
|
411
|
+
const schema = await space.db.schemaRegistry.query({ typename }).firstOrUndefined();
|
|
404
412
|
invariant(schema);
|
|
405
413
|
const projection = new ProjectionModel(schema.jsonSchema, view.projection);
|
|
406
414
|
if (!undo) {
|
|
407
415
|
const { deleted, index } = projection.deleteFieldProjection(fieldId);
|
|
408
416
|
return {
|
|
409
417
|
undoable: {
|
|
410
|
-
message: ['field deleted label', { ns:
|
|
418
|
+
message: ['field deleted label', { ns: meta.id }],
|
|
411
419
|
data: { deletionData: { ...deleted, index } },
|
|
412
420
|
},
|
|
413
421
|
};
|
|
@@ -419,7 +427,7 @@ export default ({ context, observability, createInvitationUrl }: IntentResolverO
|
|
|
419
427
|
}),
|
|
420
428
|
createResolver({
|
|
421
429
|
intent: SpaceAction.OpenCreateObject,
|
|
422
|
-
resolve: ({ target, typename, navigable = true, onCreateObject }) => {
|
|
430
|
+
resolve: ({ target, views, typename, initialFormValues, navigable = true, onCreateObject }) => {
|
|
423
431
|
const state = context.getCapability(SpaceCapabilities.State);
|
|
424
432
|
|
|
425
433
|
return {
|
|
@@ -431,7 +439,9 @@ export default ({ context, observability, createInvitationUrl }: IntentResolverO
|
|
|
431
439
|
blockAlign: 'start',
|
|
432
440
|
props: {
|
|
433
441
|
target,
|
|
442
|
+
views,
|
|
434
443
|
typename,
|
|
444
|
+
initialFormValues,
|
|
435
445
|
onCreateObject,
|
|
436
446
|
shouldNavigate: navigable
|
|
437
447
|
? (object: Obj.Any) => {
|
|
@@ -460,13 +470,13 @@ export default ({ context, observability, createInvitationUrl }: IntentResolverO
|
|
|
460
470
|
createIntent(LayoutAction.AddToast, {
|
|
461
471
|
part: 'toast',
|
|
462
472
|
subject: {
|
|
463
|
-
id: `${
|
|
464
|
-
title: ['space limit label', { ns:
|
|
465
|
-
description: ['space limit description', { ns:
|
|
473
|
+
id: `${meta.id}/space-limit`,
|
|
474
|
+
title: ['space limit label', { ns: meta.id }],
|
|
475
|
+
description: ['space limit description', { ns: meta.id }],
|
|
466
476
|
duration: 5_000,
|
|
467
477
|
icon: 'ph--warning--regular',
|
|
468
|
-
actionLabel: ['remove deleted objects label', { ns:
|
|
469
|
-
actionAlt: ['remove deleted objects alt', { ns:
|
|
478
|
+
actionLabel: ['remove deleted objects label', { ns: meta.id }],
|
|
479
|
+
actionAlt: ['remove deleted objects alt', { ns: meta.id }],
|
|
470
480
|
closeLabel: ['close label', { ns: 'os' }],
|
|
471
481
|
onAction: () => space.db.coreDatabase.unlinkDeletedObjects(),
|
|
472
482
|
},
|
|
@@ -595,7 +605,7 @@ export default ({ context, observability, createInvitationUrl }: IntentResolverO
|
|
|
595
605
|
return {
|
|
596
606
|
undoable: {
|
|
597
607
|
// TODO(ZaymonFC): Pluralize if more than one object.
|
|
598
|
-
message: [undoMessageKey, { ns:
|
|
608
|
+
message: [undoMessageKey, { ns: meta.id }],
|
|
599
609
|
data: { deletionData },
|
|
600
610
|
},
|
|
601
611
|
intents:
|
|
@@ -687,7 +697,9 @@ export default ({ context, observability, createInvitationUrl }: IntentResolverO
|
|
|
687
697
|
createResolver({
|
|
688
698
|
intent: CollectionAction.CreateQueryCollection,
|
|
689
699
|
resolve: async ({ name, typename }) => ({
|
|
690
|
-
data: {
|
|
700
|
+
data: {
|
|
701
|
+
object: Obj.make(DataType.QueryCollection, { name, query: Query.select(Filter.typename(typename)).ast }),
|
|
702
|
+
},
|
|
691
703
|
}),
|
|
692
704
|
}),
|
|
693
705
|
]);
|
|
@@ -6,13 +6,14 @@ 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
|
-
import {
|
|
10
|
+
import { meta } from '../meta';
|
|
11
|
+
|
|
12
|
+
import { SpaceCapabilities } from './capabilities';
|
|
12
13
|
|
|
13
14
|
export default () =>
|
|
14
15
|
contributes(Capabilities.ReactRoot, {
|
|
15
|
-
id:
|
|
16
|
+
id: meta.id,
|
|
16
17
|
root: () => {
|
|
17
18
|
const state = useCapability(SpaceCapabilities.State);
|
|
18
19
|
return state.awaiting ? <AwaitingObject id={state.awaiting} /> : null;
|