@dxos/plugin-space 0.8.3-main.7f5a14c → 0.8.3-staging.0fa589b
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-UNXUTH53.mjs → app-graph-builder-M2RH72VL.mjs} +43 -9
- package/dist/lib/browser/app-graph-builder-M2RH72VL.mjs.map +7 -0
- package/dist/lib/browser/{app-graph-serializer-KPKPMC4M.mjs → app-graph-serializer-F7ISRRBV.mjs} +13 -13
- package/dist/lib/browser/app-graph-serializer-F7ISRRBV.mjs.map +7 -0
- package/dist/lib/browser/{chunk-TQPBDRXV.mjs → chunk-4ZKSFDXM.mjs} +29 -17
- package/dist/lib/browser/chunk-4ZKSFDXM.mjs.map +7 -0
- package/dist/lib/browser/{chunk-3LN4LJN6.mjs → chunk-BXNL6SDI.mjs} +2 -1
- package/dist/lib/browser/chunk-BXNL6SDI.mjs.map +7 -0
- package/dist/lib/browser/{chunk-CF4FBDGP.mjs → chunk-NFUKCRGE.mjs} +148 -134
- package/dist/lib/browser/chunk-NFUKCRGE.mjs.map +7 -0
- package/dist/lib/browser/chunk-TW7O2EPP.mjs +284 -0
- package/dist/lib/browser/chunk-TW7O2EPP.mjs.map +7 -0
- package/dist/lib/browser/{chunk-RRJIDXPY.mjs → chunk-V24VASAJ.mjs} +100 -31
- package/dist/lib/browser/chunk-V24VASAJ.mjs.map +7 -0
- package/dist/lib/browser/chunk-YMCZR6EZ.mjs +18 -0
- package/dist/lib/browser/chunk-YMCZR6EZ.mjs.map +7 -0
- package/dist/lib/browser/{identity-created-EM6GZDNF.mjs → identity-created-PI7TKANR.mjs} +5 -10
- package/dist/lib/browser/identity-created-PI7TKANR.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +61 -51
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/{intent-resolver-K3ULKQ6V.mjs → intent-resolver-RWU6ZE4H.mjs} +56 -32
- package/dist/lib/browser/intent-resolver-RWU6ZE4H.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-root-ECO7G77L.mjs → react-root-QIKHSNT2.mjs} +5 -5
- package/dist/lib/browser/{react-surface-Y5AZBYA7.mjs → react-surface-W56UD53I.mjs} +74 -14
- package/dist/lib/browser/react-surface-W56UD53I.mjs.map +7 -0
- package/dist/lib/browser/{schema-defs-JMN74RNK.mjs → schema-defs-WREJNMIC.mjs} +2 -2
- package/dist/lib/browser/{settings-MU7O6JDD.mjs → settings-K54STC5A.mjs} +2 -2
- package/dist/lib/browser/{spaces-ready-NXZAWHGI.mjs → spaces-ready-3PDRDHPC.mjs} +7 -7
- package/dist/lib/browser/spaces-ready-3PDRDHPC.mjs.map +7 -0
- package/dist/lib/browser/{state-6HOSHLIN.mjs → state-HRZ4VRXU.mjs} +2 -2
- package/dist/lib/browser/types/index.mjs +1 -3
- package/dist/lib/node/{app-graph-builder-6QDQEYHS.cjs → app-graph-builder-6LK5HLLE.cjs} +73 -38
- package/dist/lib/node/app-graph-builder-6LK5HLLE.cjs.map +7 -0
- package/dist/lib/node/{app-graph-serializer-6SWKHDE2.cjs → app-graph-serializer-HKHBNHA3.cjs} +23 -22
- package/dist/lib/node/app-graph-serializer-HKHBNHA3.cjs.map +7 -0
- package/dist/lib/node/chunk-3X4EA4XL.cjs +37 -0
- package/dist/lib/node/chunk-3X4EA4XL.cjs.map +7 -0
- package/dist/lib/node/{chunk-SF3NU7EW.cjs → chunk-DOC5XEZ4.cjs} +32 -18
- package/dist/lib/node/chunk-DOC5XEZ4.cjs.map +7 -0
- package/dist/lib/node/{chunk-QCANR24R.cjs → chunk-NCHF433F.cjs} +201 -186
- package/dist/lib/node/chunk-NCHF433F.cjs.map +7 -0
- package/dist/lib/node/{chunk-7GQGM4ZF.cjs → chunk-NL5Y4EDX.cjs} +5 -4
- package/dist/lib/node/chunk-NL5Y4EDX.cjs.map +7 -0
- package/dist/lib/node/chunk-ULJZPATP.cjs +312 -0
- package/dist/lib/node/chunk-ULJZPATP.cjs.map +7 -0
- package/dist/lib/node/{chunk-KDBPQ6L3.cjs → chunk-XHWVT7LW.cjs} +113 -43
- package/dist/lib/node/chunk-XHWVT7LW.cjs.map +7 -0
- package/dist/lib/node/{identity-created-KCJAOFZC.cjs → identity-created-FF4WZ2WY.cjs} +7 -9
- package/dist/lib/node/identity-created-FF4WZ2WY.cjs.map +7 -0
- package/dist/lib/node/index.cjs +129 -118
- package/dist/lib/node/index.cjs.map +4 -4
- package/dist/lib/node/{intent-resolver-XR4S7LME.cjs → intent-resolver-AV4CMM3Z.cjs} +91 -68
- package/dist/lib/node/intent-resolver-AV4CMM3Z.cjs.map +7 -0
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/{react-root-Z2YM6JYC.cjs → react-root-RQUU3A45.cjs} +10 -10
- package/dist/lib/node/{react-surface-H6XNU6DS.cjs → react-surface-AZFJLE72.cjs} +104 -43
- package/dist/lib/node/react-surface-AZFJLE72.cjs.map +7 -0
- package/dist/lib/node/{schema-defs-XLFBG3XK.cjs → schema-defs-OB2X2HBH.cjs} +6 -6
- package/dist/lib/node/{settings-XRAT3YMN.cjs → settings-P2EQ7VKQ.cjs} +6 -6
- package/dist/lib/node/{spaces-ready-KKFEN2MM.cjs → spaces-ready-DXPOHYV7.cjs} +16 -16
- package/dist/lib/node/spaces-ready-DXPOHYV7.cjs.map +7 -0
- package/dist/lib/node/{state-ZT3MTZXB.cjs → state-M35DK75Z.cjs} +6 -6
- package/dist/lib/node/types/index.cjs +11 -13
- package/dist/lib/node/types/index.cjs.map +2 -2
- package/dist/lib/node-esm/{app-graph-builder-5EAV4CDH.mjs → app-graph-builder-BCHVZ4OM.mjs} +43 -9
- package/dist/lib/node-esm/app-graph-builder-BCHVZ4OM.mjs.map +7 -0
- package/dist/lib/node-esm/{app-graph-serializer-BRLVJW6I.mjs → app-graph-serializer-TXRGGNP2.mjs} +13 -13
- package/dist/lib/node-esm/app-graph-serializer-TXRGGNP2.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-3CP67AYY.mjs +19 -0
- package/dist/lib/node-esm/chunk-3CP67AYY.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-4X4Y63ND.mjs → chunk-BSLREHIX.mjs} +2 -1
- package/dist/lib/node-esm/chunk-BSLREHIX.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-D4QMPPS7.mjs +285 -0
- package/dist/lib/node-esm/chunk-D4QMPPS7.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-FTL5AMXF.mjs → chunk-HO7AIKQS.mjs} +100 -31
- package/dist/lib/node-esm/chunk-HO7AIKQS.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-55OOAFBS.mjs → chunk-JBQKU4K5.mjs} +29 -17
- package/dist/lib/node-esm/chunk-JBQKU4K5.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-AVONUBZO.mjs → chunk-LA6AVVH6.mjs} +148 -134
- package/dist/lib/node-esm/chunk-LA6AVVH6.mjs.map +7 -0
- package/dist/lib/node-esm/{identity-created-FOFH2WPI.mjs → identity-created-35CTAQWI.mjs} +5 -9
- package/dist/lib/node-esm/identity-created-35CTAQWI.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +61 -51
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/{intent-resolver-72KTB4S2.mjs → intent-resolver-JO6L2VXC.mjs} +56 -32
- package/dist/lib/node-esm/intent-resolver-JO6L2VXC.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-root-FU2I5U2M.mjs → react-root-YFGL3B4J.mjs} +5 -5
- package/dist/lib/node-esm/{react-surface-L4SMKRYF.mjs → react-surface-CVAPDLEZ.mjs} +74 -14
- package/dist/lib/node-esm/react-surface-CVAPDLEZ.mjs.map +7 -0
- package/dist/lib/node-esm/{schema-defs-QZJS6UXN.mjs → schema-defs-4MEJETVX.mjs} +2 -2
- package/dist/lib/node-esm/{settings-C7GQAEDU.mjs → settings-TD76LTQS.mjs} +2 -2
- package/dist/lib/node-esm/{spaces-ready-WTISHKEH.mjs → spaces-ready-FJMGPAVV.mjs} +7 -7
- package/dist/lib/node-esm/spaces-ready-FJMGPAVV.mjs.map +7 -0
- package/dist/lib/node-esm/{state-4ATRHSKA.mjs → state-XQNDCN37.mjs} +2 -2
- package/dist/lib/node-esm/types/index.mjs +1 -3
- 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/capabilities.d.ts +8 -1
- package/dist/types/src/capabilities/capabilities.d.ts.map +1 -1
- package/dist/types/src/capabilities/identity-created.d.ts.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/components/CollectionMain.d.ts +2 -2
- package/dist/types/src/components/CollectionMain.d.ts.map +1 -1
- package/dist/types/src/components/CollectionSection.d.ts +2 -2
- package/dist/types/src/components/CollectionSection.d.ts.map +1 -1
- package/dist/types/src/components/CreateDialog/CreateObjectDialog.d.ts +1 -1
- package/dist/types/src/components/CreateDialog/CreateObjectDialog.d.ts.map +1 -1
- package/dist/types/src/components/CreateDialog/CreateObjectDialog.stories.d.ts.map +1 -1
- package/dist/types/src/components/CreateDialog/CreateObjectPanel.d.ts +8 -7
- 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/MembersContainer.d.ts.map +1 -1
- package/dist/types/src/components/ObjectSettings/AdvancedObjectSettings.d.ts.map +1 -1
- package/dist/types/src/components/ObjectSettings/BaseObjectSettings.d.ts.map +1 -1
- package/dist/types/src/components/SpacePluginSettings.d.ts.map +1 -1
- package/dist/types/src/events.d.ts +1 -3
- package/dist/types/src/events.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +275 -2
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/index.d.ts +0 -1
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +80 -12
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/src/util.d.ts +8 -3
- package/dist/types/src/util.d.ts.map +1 -1
- package/package.json +45 -45
- package/src/{SpacePlugin.tsx → SpacePlugin.ts} +28 -8
- package/src/capabilities/app-graph-builder.ts +67 -4
- package/src/capabilities/app-graph-serializer.ts +11 -8
- package/src/capabilities/capabilities.ts +6 -1
- package/src/capabilities/identity-created.ts +5 -4
- package/src/capabilities/intent-resolver.ts +38 -18
- package/src/capabilities/react-surface.tsx +98 -10
- package/src/capabilities/spaces-ready.ts +3 -3
- package/src/components/CollectionMain.tsx +3 -3
- package/src/components/CollectionSection.tsx +2 -2
- package/src/components/CreateDialog/CreateObjectDialog.stories.tsx +6 -6
- package/src/components/CreateDialog/CreateObjectDialog.tsx +25 -12
- package/src/components/CreateDialog/CreateObjectPanel.tsx +43 -51
- package/src/components/CreateDialog/CreateSpaceDialog.tsx +6 -5
- package/src/components/MembersContainer.tsx +4 -2
- package/src/components/ObjectSettings/AdvancedObjectSettings.tsx +9 -1
- package/src/components/ObjectSettings/BaseObjectSettings.tsx +2 -3
- package/src/components/ObjectSettings/ObjectSettingsContainer.tsx +2 -2
- package/src/components/SpacePluginSettings.tsx +24 -19
- package/src/components/SpaceSettings/SpaceSettingsContainer.tsx +2 -2
- package/src/events.ts +1 -5
- package/src/translations.ts +30 -14
- package/src/types/index.ts +0 -1
- package/src/types/types.ts +29 -9
- package/src/util.tsx +111 -23
- package/dist/lib/browser/app-graph-builder-UNXUTH53.mjs.map +0 -7
- package/dist/lib/browser/app-graph-serializer-KPKPMC4M.mjs.map +0 -7
- package/dist/lib/browser/chunk-3LN4LJN6.mjs.map +0 -7
- package/dist/lib/browser/chunk-CF4FBDGP.mjs.map +0 -7
- package/dist/lib/browser/chunk-LGEIVEYC.mjs +0 -289
- package/dist/lib/browser/chunk-LGEIVEYC.mjs.map +0 -7
- package/dist/lib/browser/chunk-RRJIDXPY.mjs.map +0 -7
- package/dist/lib/browser/chunk-TQPBDRXV.mjs.map +0 -7
- package/dist/lib/browser/identity-created-EM6GZDNF.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-K3ULKQ6V.mjs.map +0 -7
- package/dist/lib/browser/react-surface-Y5AZBYA7.mjs.map +0 -7
- package/dist/lib/browser/spaces-ready-NXZAWHGI.mjs.map +0 -7
- package/dist/lib/node/app-graph-builder-6QDQEYHS.cjs.map +0 -7
- package/dist/lib/node/app-graph-serializer-6SWKHDE2.cjs.map +0 -7
- package/dist/lib/node/chunk-7GQGM4ZF.cjs.map +0 -7
- package/dist/lib/node/chunk-KDBPQ6L3.cjs.map +0 -7
- package/dist/lib/node/chunk-QCANR24R.cjs.map +0 -7
- package/dist/lib/node/chunk-SF3NU7EW.cjs.map +0 -7
- package/dist/lib/node/chunk-UUBPYP7E.cjs +0 -316
- package/dist/lib/node/chunk-UUBPYP7E.cjs.map +0 -7
- package/dist/lib/node/identity-created-KCJAOFZC.cjs.map +0 -7
- package/dist/lib/node/intent-resolver-XR4S7LME.cjs.map +0 -7
- package/dist/lib/node/react-surface-H6XNU6DS.cjs.map +0 -7
- package/dist/lib/node/spaces-ready-KKFEN2MM.cjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-5EAV4CDH.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-serializer-BRLVJW6I.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-226REPOB.mjs +0 -290
- package/dist/lib/node-esm/chunk-226REPOB.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-4X4Y63ND.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-55OOAFBS.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-AVONUBZO.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-FTL5AMXF.mjs.map +0 -7
- package/dist/lib/node-esm/identity-created-FOFH2WPI.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-72KTB4S2.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-L4SMKRYF.mjs.map +0 -7
- package/dist/lib/node-esm/spaces-ready-WTISHKEH.mjs.map +0 -7
- package/dist/types/src/types/collection.d.ts +0 -15
- package/dist/types/src/types/collection.d.ts.map +0 -1
- package/src/types/collection.ts +0 -27
- /package/dist/lib/browser/{react-root-ECO7G77L.mjs.map → react-root-QIKHSNT2.mjs.map} +0 -0
- /package/dist/lib/browser/{schema-defs-JMN74RNK.mjs.map → schema-defs-WREJNMIC.mjs.map} +0 -0
- /package/dist/lib/browser/{settings-MU7O6JDD.mjs.map → settings-K54STC5A.mjs.map} +0 -0
- /package/dist/lib/browser/{state-6HOSHLIN.mjs.map → state-HRZ4VRXU.mjs.map} +0 -0
- /package/dist/lib/node/{react-root-Z2YM6JYC.cjs.map → react-root-RQUU3A45.cjs.map} +0 -0
- /package/dist/lib/node/{schema-defs-XLFBG3XK.cjs.map → schema-defs-OB2X2HBH.cjs.map} +0 -0
- /package/dist/lib/node/{settings-XRAT3YMN.cjs.map → settings-P2EQ7VKQ.cjs.map} +0 -0
- /package/dist/lib/node/{state-ZT3MTZXB.cjs.map → state-M35DK75Z.cjs.map} +0 -0
- /package/dist/lib/node-esm/{react-root-FU2I5U2M.mjs.map → react-root-YFGL3B4J.mjs.map} +0 -0
- /package/dist/lib/node-esm/{schema-defs-QZJS6UXN.mjs.map → schema-defs-4MEJETVX.mjs.map} +0 -0
- /package/dist/lib/node-esm/{settings-C7GQAEDU.mjs.map → settings-TD76LTQS.mjs.map} +0 -0
- /package/dist/lib/node-esm/{state-4ATRHSKA.mjs.map → state-XQNDCN37.mjs.map} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-space",
|
|
3
|
-
"version": "0.8.3-
|
|
3
|
+
"version": "0.8.3-staging.0fa589b",
|
|
4
4
|
"description": "DXOS Surface plugin for DXOS ECHO Spaces",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -42,44 +42,44 @@
|
|
|
42
42
|
"react-drag-drop-files": "^2.3.8",
|
|
43
43
|
"react-is": "~18.2.0",
|
|
44
44
|
"react-qr-rounded": "^1.0.0",
|
|
45
|
-
"@dxos/ai": "0.8.3-
|
|
46
|
-
"@dxos/
|
|
47
|
-
"@dxos/
|
|
48
|
-
"@dxos/
|
|
49
|
-
"@dxos/
|
|
50
|
-
"@dxos/
|
|
51
|
-
"@dxos/display-name": "0.8.3-
|
|
52
|
-
"@dxos/echo": "0.8.3-
|
|
53
|
-
"@dxos/echo
|
|
54
|
-
"@dxos/echo-signals": "0.8.3-
|
|
55
|
-
"@dxos/
|
|
56
|
-
"@dxos/
|
|
57
|
-
"@dxos/
|
|
58
|
-
"@dxos/live-object": "0.8.3-
|
|
59
|
-
"@dxos/local-storage": "0.8.3-
|
|
60
|
-
"@dxos/
|
|
61
|
-
"@dxos/
|
|
62
|
-
"@dxos/
|
|
63
|
-
"@dxos/plugin-
|
|
64
|
-
"@dxos/plugin-
|
|
65
|
-
"@dxos/plugin-graph": "0.8.3-
|
|
66
|
-
"@dxos/plugin-observability": "0.8.3-
|
|
67
|
-
"@dxos/
|
|
68
|
-
"@dxos/
|
|
69
|
-
"@dxos/
|
|
70
|
-
"@dxos/react-ui-attention": "0.8.3-
|
|
71
|
-
"@dxos/react-ui-editor": "0.8.3-
|
|
72
|
-
"@dxos/react-ui-
|
|
73
|
-
"@dxos/react-ui-
|
|
74
|
-
"@dxos/react-ui-pickers": "0.8.3-
|
|
75
|
-
"@dxos/react-ui-
|
|
76
|
-
"@dxos/react-ui-
|
|
77
|
-
"@dxos/react-ui-
|
|
78
|
-
"@dxos/react-ui-tabs": "0.8.3-
|
|
79
|
-
"@dxos/
|
|
80
|
-
"@dxos/schema": "0.8.3-
|
|
81
|
-
"@dxos/
|
|
82
|
-
"@dxos/
|
|
45
|
+
"@dxos/ai": "0.8.3-staging.0fa589b",
|
|
46
|
+
"@dxos/artifact": "0.8.3-staging.0fa589b",
|
|
47
|
+
"@dxos/app-framework": "0.8.3-staging.0fa589b",
|
|
48
|
+
"@dxos/async": "0.8.3-staging.0fa589b",
|
|
49
|
+
"@dxos/context": "0.8.3-staging.0fa589b",
|
|
50
|
+
"@dxos/client": "0.8.3-staging.0fa589b",
|
|
51
|
+
"@dxos/display-name": "0.8.3-staging.0fa589b",
|
|
52
|
+
"@dxos/echo-schema": "0.8.3-staging.0fa589b",
|
|
53
|
+
"@dxos/echo": "0.8.3-staging.0fa589b",
|
|
54
|
+
"@dxos/echo-signals": "0.8.3-staging.0fa589b",
|
|
55
|
+
"@dxos/keys": "0.8.3-staging.0fa589b",
|
|
56
|
+
"@dxos/effect": "0.8.3-staging.0fa589b",
|
|
57
|
+
"@dxos/invariant": "0.8.3-staging.0fa589b",
|
|
58
|
+
"@dxos/live-object": "0.8.3-staging.0fa589b",
|
|
59
|
+
"@dxos/local-storage": "0.8.3-staging.0fa589b",
|
|
60
|
+
"@dxos/log": "0.8.3-staging.0fa589b",
|
|
61
|
+
"@dxos/migrations": "0.8.3-staging.0fa589b",
|
|
62
|
+
"@dxos/plugin-client": "0.8.3-staging.0fa589b",
|
|
63
|
+
"@dxos/plugin-attention": "0.8.3-staging.0fa589b",
|
|
64
|
+
"@dxos/plugin-deck": "0.8.3-staging.0fa589b",
|
|
65
|
+
"@dxos/plugin-graph": "0.8.3-staging.0fa589b",
|
|
66
|
+
"@dxos/plugin-observability": "0.8.3-staging.0fa589b",
|
|
67
|
+
"@dxos/protocols": "0.8.3-staging.0fa589b",
|
|
68
|
+
"@dxos/plugin-status-bar": "0.8.3-staging.0fa589b",
|
|
69
|
+
"@dxos/react-client": "0.8.3-staging.0fa589b",
|
|
70
|
+
"@dxos/react-ui-attention": "0.8.3-staging.0fa589b",
|
|
71
|
+
"@dxos/react-ui-editor": "0.8.3-staging.0fa589b",
|
|
72
|
+
"@dxos/react-ui-list": "0.8.3-staging.0fa589b",
|
|
73
|
+
"@dxos/react-ui-form": "0.8.3-staging.0fa589b",
|
|
74
|
+
"@dxos/react-ui-pickers": "0.8.3-staging.0fa589b",
|
|
75
|
+
"@dxos/react-ui-searchlist": "0.8.3-staging.0fa589b",
|
|
76
|
+
"@dxos/react-ui-syntax-highlighter": "0.8.3-staging.0fa589b",
|
|
77
|
+
"@dxos/react-ui-stack": "0.8.3-staging.0fa589b",
|
|
78
|
+
"@dxos/react-ui-tabs": "0.8.3-staging.0fa589b",
|
|
79
|
+
"@dxos/shell": "0.8.3-staging.0fa589b",
|
|
80
|
+
"@dxos/schema": "0.8.3-staging.0fa589b",
|
|
81
|
+
"@dxos/util": "0.8.3-staging.0fa589b",
|
|
82
|
+
"@dxos/react-ui-theme": "0.8.3-staging.0fa589b"
|
|
83
83
|
},
|
|
84
84
|
"devDependencies": {
|
|
85
85
|
"@babel/core": "^7.18.13",
|
|
@@ -91,10 +91,10 @@
|
|
|
91
91
|
"react": "~18.2.0",
|
|
92
92
|
"react-dom": "~18.2.0",
|
|
93
93
|
"vite": "5.4.7",
|
|
94
|
-
"@dxos/random": "0.8.3-
|
|
95
|
-
"@dxos/react-ui
|
|
96
|
-
"@dxos/react-ui": "0.8.3-
|
|
97
|
-
"@dxos/storybook-utils": "0.8.3-
|
|
94
|
+
"@dxos/random": "0.8.3-staging.0fa589b",
|
|
95
|
+
"@dxos/react-ui": "0.8.3-staging.0fa589b",
|
|
96
|
+
"@dxos/react-ui-theme": "0.8.3-staging.0fa589b",
|
|
97
|
+
"@dxos/storybook-utils": "0.8.3-staging.0fa589b"
|
|
98
98
|
},
|
|
99
99
|
"peerDependencies": {
|
|
100
100
|
"@effect-rx/rx-react": "^0.34.1",
|
|
@@ -103,8 +103,8 @@
|
|
|
103
103
|
"effect": "^3.13.3",
|
|
104
104
|
"react": "~18.2.0",
|
|
105
105
|
"react-dom": "~18.2.0",
|
|
106
|
-
"@dxos/react-ui": "0.8.3-
|
|
107
|
-
"@dxos/react-ui-theme": "0.8.3-
|
|
106
|
+
"@dxos/react-ui": "0.8.3-staging.0fa589b",
|
|
107
|
+
"@dxos/react-ui-theme": "0.8.3-staging.0fa589b"
|
|
108
108
|
},
|
|
109
109
|
"publishConfig": {
|
|
110
110
|
"access": "public"
|
|
@@ -14,9 +14,10 @@ import {
|
|
|
14
14
|
definePlugin,
|
|
15
15
|
oneOf,
|
|
16
16
|
} from '@dxos/app-framework';
|
|
17
|
-
import { Ref } from '@dxos/echo';
|
|
17
|
+
import { Ref, Type } from '@dxos/echo';
|
|
18
18
|
import { AttentionEvents } from '@dxos/plugin-attention';
|
|
19
19
|
import { ClientEvents } from '@dxos/plugin-client';
|
|
20
|
+
import { DataType } from '@dxos/schema';
|
|
20
21
|
import { osTranslations } from '@dxos/shell/react';
|
|
21
22
|
|
|
22
23
|
import {
|
|
@@ -36,7 +37,7 @@ import {
|
|
|
36
37
|
import { SpaceEvents } from './events';
|
|
37
38
|
import { meta } from './meta';
|
|
38
39
|
import translations from './translations';
|
|
39
|
-
import { CollectionAction,
|
|
40
|
+
import { CollectionAction, defineObjectForm } from './types';
|
|
40
41
|
|
|
41
42
|
export type SpacePluginOptions = {
|
|
42
43
|
/**
|
|
@@ -89,29 +90,48 @@ export const SpacePlugin = ({
|
|
|
89
90
|
defineModule({
|
|
90
91
|
id: `${meta.id}/module/metadata`,
|
|
91
92
|
activatesOn: Events.SetupMetadata,
|
|
92
|
-
activate: () =>
|
|
93
|
+
activate: () => [
|
|
93
94
|
contributes(Capabilities.Metadata, {
|
|
94
|
-
id:
|
|
95
|
+
id: Type.getTypename(DataType.Collection),
|
|
95
96
|
metadata: {
|
|
96
97
|
icon: 'ph--cards-three--regular',
|
|
97
98
|
// TODO(wittjosiah): Move out of metadata.
|
|
98
|
-
loadReferences: async (collection:
|
|
99
|
-
await Ref.Array.loadAll([...collection.objects, ...Object.values(collection.views)]),
|
|
99
|
+
loadReferences: async (collection: DataType.Collection) => await Ref.Array.loadAll(collection.objects),
|
|
100
100
|
},
|
|
101
101
|
}),
|
|
102
|
+
contributes(Capabilities.Metadata, {
|
|
103
|
+
id: Type.getTypename(DataType.QueryCollection),
|
|
104
|
+
metadata: {
|
|
105
|
+
label: (object: DataType.QueryCollection) => [
|
|
106
|
+
'typename label',
|
|
107
|
+
{ ns: object.query.typename, count: 2, defaultValue: 'New smart collection' },
|
|
108
|
+
],
|
|
109
|
+
icon: 'ph--funnel-simple--regular',
|
|
110
|
+
},
|
|
111
|
+
}),
|
|
112
|
+
],
|
|
102
113
|
}),
|
|
103
114
|
defineModule({
|
|
104
115
|
id: `${meta.id}/module/object-form`,
|
|
105
116
|
activatesOn: ClientEvents.SetupSchema,
|
|
106
|
-
activate: () =>
|
|
117
|
+
activate: () => [
|
|
107
118
|
contributes(
|
|
108
119
|
SpaceCapabilities.ObjectForm,
|
|
109
120
|
defineObjectForm({
|
|
110
|
-
objectSchema:
|
|
121
|
+
objectSchema: DataType.Collection,
|
|
111
122
|
formSchema: Schema.Struct({ name: Schema.optional(Schema.String) }),
|
|
112
123
|
getIntent: (props) => createIntent(CollectionAction.Create, props),
|
|
113
124
|
}),
|
|
114
125
|
),
|
|
126
|
+
contributes(
|
|
127
|
+
SpaceCapabilities.ObjectForm,
|
|
128
|
+
defineObjectForm({
|
|
129
|
+
objectSchema: DataType.QueryCollection,
|
|
130
|
+
formSchema: CollectionAction.QueryCollectionForm,
|
|
131
|
+
getIntent: (props) => createIntent(CollectionAction.CreateQueryCollection, props),
|
|
132
|
+
}),
|
|
133
|
+
),
|
|
134
|
+
],
|
|
115
135
|
}),
|
|
116
136
|
defineModule({
|
|
117
137
|
id: `${meta.id}/module/schema`,
|
|
@@ -7,17 +7,18 @@ import { Array, Option, pipe } from 'effect';
|
|
|
7
7
|
|
|
8
8
|
import { Capabilities, contributes, createIntent, type PluginContext } from '@dxos/app-framework';
|
|
9
9
|
import { getSpace, SpaceState, type Space, isSpace, type QueryResult } from '@dxos/client/echo';
|
|
10
|
-
import { Filter, Obj, Type } from '@dxos/echo';
|
|
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
13
|
import { PLANK_COMPANION_TYPE, ATTENDABLE_PATH_SEPARATOR } from '@dxos/plugin-deck/types';
|
|
14
14
|
import { createExtension, rxFromObservable, ROOT_ID, rxFromSignal } from '@dxos/plugin-graph';
|
|
15
|
+
import { DataType } from '@dxos/schema';
|
|
15
16
|
import { isNonNullable } from '@dxos/util';
|
|
16
17
|
|
|
17
18
|
import { SpaceCapabilities } from './capabilities';
|
|
18
19
|
import { getActiveSpace } from '../hooks';
|
|
19
20
|
import { SPACE_PLUGIN } from '../meta';
|
|
20
|
-
import {
|
|
21
|
+
import { SPACE_TYPE, SpaceAction, type SpaceSettingsProps } from '../types';
|
|
21
22
|
import {
|
|
22
23
|
constructObjectActions,
|
|
23
24
|
constructSpaceActions,
|
|
@@ -29,6 +30,7 @@ import {
|
|
|
29
30
|
} from '../util';
|
|
30
31
|
|
|
31
32
|
export default (context: PluginContext) => {
|
|
33
|
+
// TODO(wittjosiah): Make reactive.
|
|
32
34
|
const resolve = (typename: string) =>
|
|
33
35
|
context.getCapabilities(Capabilities.Metadata).find(({ id }) => id === typename)?.metadata ?? {};
|
|
34
36
|
|
|
@@ -319,7 +321,10 @@ export default (context: PluginContext) => {
|
|
|
319
321
|
}
|
|
320
322
|
|
|
321
323
|
const collection = get(
|
|
322
|
-
rxFromSignal(
|
|
324
|
+
rxFromSignal(
|
|
325
|
+
() =>
|
|
326
|
+
space.properties[Type.getTypename(DataType.Collection)]?.target as DataType.Collection | undefined,
|
|
327
|
+
),
|
|
323
328
|
);
|
|
324
329
|
if (!collection) {
|
|
325
330
|
return [];
|
|
@@ -356,7 +361,9 @@ export default (context: PluginContext) => {
|
|
|
356
361
|
Rx.make((get) =>
|
|
357
362
|
pipe(
|
|
358
363
|
get(node),
|
|
359
|
-
Option.flatMap((node) =>
|
|
364
|
+
Option.flatMap((node) =>
|
|
365
|
+
Obj.instanceOf(DataType.Collection, node.data) ? Option.some(node.data) : Option.none(),
|
|
366
|
+
),
|
|
360
367
|
Option.map((collection) => {
|
|
361
368
|
const state = context.getCapability(SpaceCapabilities.State);
|
|
362
369
|
const space = getSpace(collection);
|
|
@@ -418,6 +425,60 @@ export default (context: PluginContext) => {
|
|
|
418
425
|
// },
|
|
419
426
|
}),
|
|
420
427
|
|
|
428
|
+
// Create nodes for objects in a query collection.
|
|
429
|
+
createExtension({
|
|
430
|
+
id: `${SPACE_PLUGIN}/query-collection-objects`,
|
|
431
|
+
connector: (node) => {
|
|
432
|
+
let query: QueryResult<Type.Expando> | undefined;
|
|
433
|
+
return Rx.make((get) =>
|
|
434
|
+
pipe(
|
|
435
|
+
get(node),
|
|
436
|
+
Option.flatMap((node) =>
|
|
437
|
+
Obj.instanceOf(DataType.QueryCollection, node.data) ? Option.some(node.data) : Option.none(),
|
|
438
|
+
),
|
|
439
|
+
Option.flatMap((collection) => {
|
|
440
|
+
const space = getSpace(collection);
|
|
441
|
+
return collection.query.typename && space
|
|
442
|
+
? Option.some({ typename: collection.query.typename, space })
|
|
443
|
+
: Option.none();
|
|
444
|
+
}),
|
|
445
|
+
Option.map(({ typename, space }) => {
|
|
446
|
+
const state = context.getCapability(SpaceCapabilities.State);
|
|
447
|
+
if (!query) {
|
|
448
|
+
query = space.db.query(
|
|
449
|
+
Query.without(
|
|
450
|
+
Query.select(Filter.typename(typename)),
|
|
451
|
+
// TODO(wittjosiah): This query is broader than it should be.
|
|
452
|
+
// It will return all objects in the collection, not just the ones of the given type.
|
|
453
|
+
// However this works fine for now because this query is only used for exclusions.
|
|
454
|
+
Query.select(Filter.typename(typename))
|
|
455
|
+
.referencedBy(DataType.Collection, 'objects')
|
|
456
|
+
.reference('objects'),
|
|
457
|
+
),
|
|
458
|
+
);
|
|
459
|
+
}
|
|
460
|
+
return get(rxFromQuery(query))
|
|
461
|
+
.map((object) =>
|
|
462
|
+
get(
|
|
463
|
+
rxFromSignal(() =>
|
|
464
|
+
createObjectNode({
|
|
465
|
+
object,
|
|
466
|
+
space,
|
|
467
|
+
resolve,
|
|
468
|
+
droppable: false, // Cannot rearrange query collections.
|
|
469
|
+
navigable: state.navigableCollections,
|
|
470
|
+
}),
|
|
471
|
+
),
|
|
472
|
+
),
|
|
473
|
+
)
|
|
474
|
+
.filter(isNonNullable);
|
|
475
|
+
}),
|
|
476
|
+
Option.getOrElse(() => []),
|
|
477
|
+
),
|
|
478
|
+
);
|
|
479
|
+
},
|
|
480
|
+
}),
|
|
481
|
+
|
|
421
482
|
// Create collection actions and action groups.
|
|
422
483
|
createExtension({
|
|
423
484
|
id: `${SPACE_PLUGIN}/object-actions`,
|
|
@@ -430,6 +491,7 @@ export default (context: PluginContext) => {
|
|
|
430
491
|
const [dispatcher] = get(context.capabilities(Capabilities.IntentDispatcher));
|
|
431
492
|
const [appGraph] = get(context.capabilities(Capabilities.AppGraph));
|
|
432
493
|
const [state] = get(context.capabilities(SpaceCapabilities.State));
|
|
494
|
+
const objectForms = get(context.capabilities(SpaceCapabilities.ObjectForm));
|
|
433
495
|
|
|
434
496
|
if (!dispatcher || !appGraph || !state) {
|
|
435
497
|
return Option.none();
|
|
@@ -438,6 +500,7 @@ export default (context: PluginContext) => {
|
|
|
438
500
|
object,
|
|
439
501
|
graph: appGraph.graph,
|
|
440
502
|
dispatch: dispatcher.dispatchPromise,
|
|
503
|
+
objectForms,
|
|
441
504
|
navigable: get(rxFromSignal(() => state.navigableCollections)),
|
|
442
505
|
});
|
|
443
506
|
}
|
|
@@ -4,13 +4,16 @@
|
|
|
4
4
|
|
|
5
5
|
import { Capabilities, contributes, createIntent, type PluginContext } from '@dxos/app-framework';
|
|
6
6
|
import { isSpace } from '@dxos/client/echo';
|
|
7
|
-
import { Obj } from '@dxos/echo';
|
|
7
|
+
import { Obj, Type } from '@dxos/echo';
|
|
8
|
+
import { DataType } from '@dxos/schema';
|
|
8
9
|
|
|
9
10
|
import { SPACE_PLUGIN } from '../meta';
|
|
10
11
|
import translations from '../translations';
|
|
11
|
-
import { SPACE_TYPE,
|
|
12
|
+
import { SPACE_TYPE, SpaceAction } from '../types';
|
|
12
13
|
import { SPACES } from '../util';
|
|
13
14
|
|
|
15
|
+
const COLLECTION_TYPE = Type.getTypename(DataType.Collection);
|
|
16
|
+
|
|
14
17
|
// https://stackoverflow.com/a/19016910
|
|
15
18
|
const DIRECTORY_TYPE = 'text/directory';
|
|
16
19
|
|
|
@@ -43,18 +46,18 @@ export default (context: PluginContext) =>
|
|
|
43
46
|
},
|
|
44
47
|
},
|
|
45
48
|
{
|
|
46
|
-
inputType:
|
|
49
|
+
inputType: COLLECTION_TYPE,
|
|
47
50
|
outputType: DIRECTORY_TYPE,
|
|
48
51
|
serialize: (node) => ({
|
|
49
|
-
name: node.data.name ?? translations[0]['en-US'][
|
|
50
|
-
data: node.data.name ?? translations[0]['en-US'][
|
|
52
|
+
name: node.data.name ?? translations[0]['en-US'][COLLECTION_TYPE]['object name placeholder'],
|
|
53
|
+
data: node.data.name ?? translations[0]['en-US'][COLLECTION_TYPE]['object name placeholder'],
|
|
51
54
|
type: DIRECTORY_TYPE,
|
|
52
55
|
}),
|
|
53
56
|
deserialize: async (data, ancestors) => {
|
|
54
57
|
const space = ancestors.find(isSpace);
|
|
55
58
|
const collection =
|
|
56
|
-
ancestors.findLast((ancestor) => ancestor
|
|
57
|
-
space?.properties[
|
|
59
|
+
ancestors.findLast((ancestor) => Obj.instanceOf(DataType.Collection, ancestor)) ??
|
|
60
|
+
space?.properties[COLLECTION_TYPE]?.target;
|
|
58
61
|
if (!space || !collection) {
|
|
59
62
|
return;
|
|
60
63
|
}
|
|
@@ -63,7 +66,7 @@ export default (context: PluginContext) =>
|
|
|
63
66
|
const result = await dispatch(
|
|
64
67
|
createIntent(SpaceAction.AddObject, {
|
|
65
68
|
target: collection,
|
|
66
|
-
object: Obj.make(
|
|
69
|
+
object: Obj.make(DataType.Collection, { name: data.name, objects: [] }),
|
|
67
70
|
}),
|
|
68
71
|
);
|
|
69
72
|
|
|
@@ -3,7 +3,9 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { defineCapability, type Label } from '@dxos/app-framework';
|
|
6
|
-
import { type
|
|
6
|
+
import { type Space } from '@dxos/react-client/echo';
|
|
7
|
+
import { type DataType } from '@dxos/schema';
|
|
8
|
+
import { type Position, type DeepReadonly, type MaybePromise } from '@dxos/util';
|
|
7
9
|
|
|
8
10
|
import { SPACE_PLUGIN } from '../meta';
|
|
9
11
|
import { type ObjectForm, type PluginState } from '../types';
|
|
@@ -15,5 +17,8 @@ export namespace SpaceCapabilities {
|
|
|
15
17
|
export type SettingsSection = { id: string; label: Label; position?: Position };
|
|
16
18
|
export const SettingsSection = defineCapability<SettingsSection>(`${SPACE_PLUGIN}/capability/settings-section`);
|
|
17
19
|
|
|
20
|
+
export type OnSpaceCreated = (params: { space: Space; rootCollection: DataType.Collection }) => MaybePromise<void>;
|
|
21
|
+
export const OnSpaceCreated = defineCapability<OnSpaceCreated>(`${SPACE_PLUGIN}/capability/on-space-created`);
|
|
22
|
+
|
|
18
23
|
export const ObjectForm = defineCapability<ObjectForm<any>>(`${SPACE_PLUGIN}/capability/object-form`);
|
|
19
24
|
}
|
|
@@ -3,11 +3,10 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { contributes, type PluginContext, Capabilities } from '@dxos/app-framework';
|
|
6
|
-
import { Obj, Ref } from '@dxos/echo';
|
|
6
|
+
import { Obj, Ref, Type } from '@dxos/echo';
|
|
7
7
|
import { Migrations } from '@dxos/migrations';
|
|
8
8
|
import { ClientCapabilities } from '@dxos/plugin-client';
|
|
9
|
-
|
|
10
|
-
import { CollectionType } from '../types';
|
|
9
|
+
import { DataType } from '@dxos/schema';
|
|
11
10
|
|
|
12
11
|
export default async (context: PluginContext) => {
|
|
13
12
|
const client = context.getCapability(ClientCapabilities.Client);
|
|
@@ -17,7 +16,9 @@ export default async (context: PluginContext) => {
|
|
|
17
16
|
await defaultSpace.waitUntilReady();
|
|
18
17
|
|
|
19
18
|
// Create root collection structure.
|
|
20
|
-
defaultSpace.properties[
|
|
19
|
+
defaultSpace.properties[Type.getTypename(DataType.Collection)] = Ref.make(
|
|
20
|
+
Obj.make(DataType.Collection, { objects: [] }),
|
|
21
|
+
);
|
|
21
22
|
if (Migrations.versionProperty) {
|
|
22
23
|
defaultSpace.properties[Migrations.versionProperty] = Migrations.targetVersion;
|
|
23
24
|
}
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
createIntent,
|
|
13
13
|
createResolver,
|
|
14
14
|
} from '@dxos/app-framework';
|
|
15
|
-
import { Obj, Ref, Relation,
|
|
15
|
+
import { Obj, Ref, Relation, Type } from '@dxos/echo';
|
|
16
16
|
import { invariant } from '@dxos/invariant';
|
|
17
17
|
import { Migrations } from '@dxos/migrations';
|
|
18
18
|
import { ClientCapabilities } from '@dxos/plugin-client';
|
|
@@ -21,6 +21,7 @@ import { EdgeReplicationSetting } from '@dxos/protocols/proto/dxos/echo/metadata
|
|
|
21
21
|
import { isSpace, getSpace, SpaceState, fullyQualifiedId } from '@dxos/react-client/echo';
|
|
22
22
|
import { Invitation, InvitationEncoder } from '@dxos/react-client/invitations';
|
|
23
23
|
import { ATTENDABLE_PATH_SEPARATOR } from '@dxos/react-ui-attention';
|
|
24
|
+
import { DataType } from '@dxos/schema';
|
|
24
25
|
|
|
25
26
|
import { SpaceCapabilities } from './capabilities';
|
|
26
27
|
import {
|
|
@@ -32,8 +33,9 @@ import {
|
|
|
32
33
|
type CreateObjectDialogProps,
|
|
33
34
|
type JoinDialogProps,
|
|
34
35
|
} from '../components';
|
|
36
|
+
import { SpaceEvents } from '../events';
|
|
35
37
|
import { SPACE_PLUGIN } from '../meta';
|
|
36
|
-
import { CollectionAction,
|
|
38
|
+
import { CollectionAction, SpaceAction } from '../types';
|
|
37
39
|
import { cloneObject, COMPOSER_SPACE_LOCK, getNestedObjects } from '../util';
|
|
38
40
|
|
|
39
41
|
// TODO(wittjosiah): Remove.
|
|
@@ -73,13 +75,19 @@ export default ({ context, observability, createInvitationUrl }: IntentResolverO
|
|
|
73
75
|
await space.internal.setEdgeReplicationPreference(EdgeReplicationSetting.ENABLED);
|
|
74
76
|
}
|
|
75
77
|
await space.waitUntilReady();
|
|
76
|
-
const collection = Obj.make(
|
|
77
|
-
space.properties[
|
|
78
|
+
const collection = Obj.make(DataType.Collection, { objects: [] });
|
|
79
|
+
space.properties[Type.getTypename(DataType.Collection)] = Ref.make(collection);
|
|
78
80
|
|
|
79
81
|
if (Migrations.versionProperty) {
|
|
80
82
|
space.properties[Migrations.versionProperty] = Migrations.targetVersion;
|
|
81
83
|
}
|
|
82
84
|
|
|
85
|
+
await context.activatePromise(SpaceEvents.SpaceCreated);
|
|
86
|
+
const onSpaceCreatedCallbacks = context.getCapabilities(SpaceCapabilities.OnSpaceCreated);
|
|
87
|
+
await Promise.all(
|
|
88
|
+
onSpaceCreatedCallbacks.map((onSpaceCreated) => onSpaceCreated({ space, rootCollection: collection })),
|
|
89
|
+
);
|
|
90
|
+
|
|
83
91
|
return {
|
|
84
92
|
data: {
|
|
85
93
|
id: space.id,
|
|
@@ -303,7 +311,7 @@ export default ({ context, observability, createInvitationUrl }: IntentResolverO
|
|
|
303
311
|
}),
|
|
304
312
|
createResolver({
|
|
305
313
|
intent: SpaceAction.OpenCreateObject,
|
|
306
|
-
resolve: ({ target, navigable = true }) => {
|
|
314
|
+
resolve: ({ target, typename, navigable = true }) => {
|
|
307
315
|
const state = context.getCapability(SpaceCapabilities.State);
|
|
308
316
|
|
|
309
317
|
return {
|
|
@@ -315,8 +323,13 @@ export default ({ context, observability, createInvitationUrl }: IntentResolverO
|
|
|
315
323
|
blockAlign: 'start',
|
|
316
324
|
props: {
|
|
317
325
|
target,
|
|
326
|
+
typename,
|
|
318
327
|
shouldNavigate: navigable
|
|
319
|
-
? (object: Obj.Any) =>
|
|
328
|
+
? (object: Obj.Any) => {
|
|
329
|
+
const isCollection = Obj.instanceOf(DataType.Collection, object);
|
|
330
|
+
const isQueryCollection = Obj.instanceOf(DataType.QueryCollection, object);
|
|
331
|
+
return (!isCollection && !isQueryCollection) || state.navigableCollections;
|
|
332
|
+
}
|
|
320
333
|
: () => false,
|
|
321
334
|
} satisfies Partial<CreateObjectDialogProps>,
|
|
322
335
|
},
|
|
@@ -363,18 +376,18 @@ export default ({ context, observability, createInvitationUrl }: IntentResolverO
|
|
|
363
376
|
};
|
|
364
377
|
}
|
|
365
378
|
|
|
366
|
-
if (target
|
|
379
|
+
if (Obj.instanceOf(DataType.Collection, target)) {
|
|
367
380
|
target.objects.push(Ref.make(object));
|
|
368
381
|
} else if (isSpace(target) && hidden) {
|
|
369
382
|
space.db.add(object);
|
|
370
383
|
} else if (isSpace(target)) {
|
|
371
|
-
const collection = space.properties[
|
|
372
|
-
if (collection
|
|
384
|
+
const collection = space.properties[Type.getTypename(DataType.Collection)]?.target;
|
|
385
|
+
if (Obj.instanceOf(DataType.Collection, collection)) {
|
|
373
386
|
collection.objects.push(Ref.make(object));
|
|
374
387
|
} else {
|
|
375
388
|
// TODO(wittjosiah): Can't add non-echo objects by including in a collection because of types.
|
|
376
|
-
const collection = Obj.make(
|
|
377
|
-
space.properties[
|
|
389
|
+
const collection = Obj.make(DataType.Collection, { objects: [Ref.make(object)] });
|
|
390
|
+
space.properties[Type.getTypename(DataType.Collection)] = Ref.make(collection);
|
|
378
391
|
}
|
|
379
392
|
}
|
|
380
393
|
|
|
@@ -405,7 +418,7 @@ export default ({ context, observability, createInvitationUrl }: IntentResolverO
|
|
|
405
418
|
intent: SpaceAction.AddRelation,
|
|
406
419
|
resolve: ({ space, schema, source, target, fields }) => {
|
|
407
420
|
const relation = space.db.add(
|
|
408
|
-
|
|
421
|
+
Relation.make(schema, {
|
|
409
422
|
[Relation.Source]: source,
|
|
410
423
|
[Relation.Target]: target,
|
|
411
424
|
...fields,
|
|
@@ -430,14 +443,15 @@ export default ({ context, observability, createInvitationUrl }: IntentResolverO
|
|
|
430
443
|
const openObjectIds = new Set<string>(layout.active);
|
|
431
444
|
|
|
432
445
|
if (!undo) {
|
|
433
|
-
const parentCollection:
|
|
446
|
+
const parentCollection: DataType.Collection =
|
|
447
|
+
target ?? space.properties[Type.getTypename(DataType.Collection)]?.target;
|
|
434
448
|
const nestedObjectsList = await Promise.all(objects.map((obj) => getNestedObjects(obj, resolve)));
|
|
435
449
|
|
|
436
450
|
const deletionData = {
|
|
437
451
|
objects,
|
|
438
452
|
parentCollection,
|
|
439
453
|
indices: objects.map((obj) =>
|
|
440
|
-
parentCollection
|
|
454
|
+
Obj.instanceOf(DataType.Collection, parentCollection)
|
|
441
455
|
? parentCollection.objects.findIndex((object) => object.target === obj)
|
|
442
456
|
: -1,
|
|
443
457
|
),
|
|
@@ -448,7 +462,7 @@ export default ({ context, observability, createInvitationUrl }: IntentResolverO
|
|
|
448
462
|
.filter((id) => openObjectIds.has(id)),
|
|
449
463
|
} satisfies SpaceAction.DeletionData;
|
|
450
464
|
|
|
451
|
-
if (deletionData.parentCollection
|
|
465
|
+
if (Obj.instanceOf(DataType.Collection, deletionData.parentCollection)) {
|
|
452
466
|
[...deletionData.indices]
|
|
453
467
|
.sort((a, b) => b - a)
|
|
454
468
|
.forEach((index: number) => {
|
|
@@ -463,7 +477,7 @@ export default ({ context, observability, createInvitationUrl }: IntentResolverO
|
|
|
463
477
|
});
|
|
464
478
|
objects.forEach((obj) => space.db.remove(obj));
|
|
465
479
|
|
|
466
|
-
const undoMessageKey = objects.some((obj) => obj
|
|
480
|
+
const undoMessageKey = objects.some((obj) => Obj.instanceOf(DataType.Collection, obj))
|
|
467
481
|
? 'collection deleted label'
|
|
468
482
|
: objects.length > 1
|
|
469
483
|
? 'objects deleted label'
|
|
@@ -490,7 +504,7 @@ export default ({ context, observability, createInvitationUrl }: IntentResolverO
|
|
|
490
504
|
if (
|
|
491
505
|
deletionData?.objects?.length &&
|
|
492
506
|
deletionData.objects.every(Obj.isObject) &&
|
|
493
|
-
deletionData.parentCollection
|
|
507
|
+
Obj.instanceOf(DataType.Collection, deletionData.parentCollection)
|
|
494
508
|
) {
|
|
495
509
|
// Restore the object to the space.
|
|
496
510
|
const restoredObjects = deletionData.objects.map((obj: Type.Expando) => space.db.add(obj));
|
|
@@ -558,7 +572,13 @@ export default ({ context, observability, createInvitationUrl }: IntentResolverO
|
|
|
558
572
|
createResolver({
|
|
559
573
|
intent: CollectionAction.Create,
|
|
560
574
|
resolve: async ({ name }) => ({
|
|
561
|
-
data: { object: Obj.make(
|
|
575
|
+
data: { object: Obj.make(DataType.Collection, { name, objects: [] }) },
|
|
576
|
+
}),
|
|
577
|
+
}),
|
|
578
|
+
createResolver({
|
|
579
|
+
intent: CollectionAction.CreateQueryCollection,
|
|
580
|
+
resolve: async ({ name, typename }) => ({
|
|
581
|
+
data: { object: Obj.make(DataType.QueryCollection, { name, query: { typename } }) },
|
|
562
582
|
}),
|
|
563
583
|
}),
|
|
564
584
|
]);
|