@dxos/plugin-space 0.6.13-main.ed424a1 → 0.6.13

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.
Files changed (92) hide show
  1. package/dist/lib/browser/{chunk-47SVNCZM.mjs → chunk-DTVUOG2C.mjs} +5 -24
  2. package/dist/lib/browser/chunk-DTVUOG2C.mjs.map +7 -0
  3. package/dist/lib/browser/{chunk-AVLRQF6L.mjs → chunk-LZEGRS7H.mjs} +1 -1
  4. package/dist/lib/browser/chunk-LZEGRS7H.mjs.map +7 -0
  5. package/dist/lib/browser/index.mjs +249 -595
  6. package/dist/lib/browser/index.mjs.map +4 -4
  7. package/dist/lib/browser/meta.json +1 -1
  8. package/dist/lib/browser/meta.mjs +1 -1
  9. package/dist/lib/browser/types/index.mjs +3 -7
  10. package/dist/lib/node/{chunk-P4XUXM7Y.cjs → chunk-6CNYF6YU.cjs} +4 -4
  11. package/dist/lib/node/chunk-6CNYF6YU.cjs.map +7 -0
  12. package/dist/lib/node/{chunk-CTYDNFGG.cjs → chunk-CVZPI2P3.cjs} +9 -30
  13. package/dist/lib/node/chunk-CVZPI2P3.cjs.map +7 -0
  14. package/dist/lib/node/index.cjs +470 -813
  15. package/dist/lib/node/index.cjs.map +4 -4
  16. package/dist/lib/node/meta.cjs +5 -5
  17. package/dist/lib/node/meta.cjs.map +1 -1
  18. package/dist/lib/node/meta.json +1 -1
  19. package/dist/lib/node/types/index.cjs +10 -14
  20. package/dist/lib/node/types/index.cjs.map +2 -2
  21. package/dist/types/src/SpacePlugin.d.ts.map +1 -1
  22. package/dist/types/src/components/EmptySpace.d.ts +3 -0
  23. package/dist/types/src/components/EmptySpace.d.ts.map +1 -0
  24. package/dist/types/src/components/EmptyTree.d.ts +3 -0
  25. package/dist/types/src/components/EmptyTree.d.ts.map +1 -0
  26. package/dist/types/src/components/MenuFooter.d.ts +1 -1
  27. package/dist/types/src/components/MenuFooter.d.ts.map +1 -1
  28. package/dist/types/src/components/ShareSpaceButton.stories.d.ts +0 -4
  29. package/dist/types/src/components/ShareSpaceButton.stories.d.ts.map +1 -1
  30. package/dist/types/src/components/SpaceMain/SpaceMain.d.ts.map +1 -1
  31. package/dist/types/src/components/SpacePresence.stories.d.ts +0 -4
  32. package/dist/types/src/components/SpacePresence.stories.d.ts.map +1 -1
  33. package/dist/types/src/components/SpaceSettings.d.ts.map +1 -1
  34. package/dist/types/src/components/index.d.ts +2 -3
  35. package/dist/types/src/components/index.d.ts.map +1 -1
  36. package/dist/types/src/meta.d.ts.map +1 -1
  37. package/dist/types/src/translations.d.ts +0 -4
  38. package/dist/types/src/translations.d.ts.map +1 -1
  39. package/dist/types/src/types/thread.d.ts +1 -15
  40. package/dist/types/src/types/thread.d.ts.map +1 -1
  41. package/dist/types/src/types/types.d.ts +1 -18
  42. package/dist/types/src/types/types.d.ts.map +1 -1
  43. package/dist/types/src/util.d.ts +6 -3
  44. package/dist/types/src/util.d.ts.map +1 -1
  45. package/package.json +36 -44
  46. package/src/SpacePlugin.tsx +86 -149
  47. package/src/components/EmptySpace.tsx +25 -0
  48. package/src/components/EmptyTree.tsx +25 -0
  49. package/src/components/MenuFooter.tsx +2 -2
  50. package/src/components/SpaceMain/SpaceMain.tsx +22 -1
  51. package/src/components/SpacePresence.tsx +1 -1
  52. package/src/components/SpaceSettings.tsx +3 -32
  53. package/src/components/index.ts +2 -3
  54. package/src/meta.ts +1 -3
  55. package/src/translations.ts +0 -4
  56. package/src/types/collection.ts +1 -1
  57. package/src/types/thread.ts +2 -12
  58. package/src/types/types.ts +1 -25
  59. package/src/util.tsx +55 -20
  60. package/dist/lib/browser/chunk-47SVNCZM.mjs.map +0 -7
  61. package/dist/lib/browser/chunk-AVLRQF6L.mjs.map +0 -7
  62. package/dist/lib/node/chunk-CTYDNFGG.cjs.map +0 -7
  63. package/dist/lib/node/chunk-P4XUXM7Y.cjs.map +0 -7
  64. package/dist/lib/node-esm/chunk-PLPMYTLC.mjs +0 -116
  65. package/dist/lib/node-esm/chunk-PLPMYTLC.mjs.map +0 -7
  66. package/dist/lib/node-esm/chunk-YPQGKWHJ.mjs +0 -37
  67. package/dist/lib/node-esm/chunk-YPQGKWHJ.mjs.map +0 -7
  68. package/dist/lib/node-esm/index.mjs +0 -2987
  69. package/dist/lib/node-esm/index.mjs.map +0 -7
  70. package/dist/lib/node-esm/meta.json +0 -1
  71. package/dist/lib/node-esm/meta.mjs +0 -14
  72. package/dist/lib/node-esm/meta.mjs.map +0 -7
  73. package/dist/lib/node-esm/types/index.mjs +0 -26
  74. package/dist/lib/node-esm/types/index.mjs.map +0 -7
  75. package/dist/types/src/components/FallbackSettings.d.ts +0 -8
  76. package/dist/types/src/components/FallbackSettings.d.ts.map +0 -1
  77. package/dist/types/src/components/SaveStatus.d.ts +0 -3
  78. package/dist/types/src/components/SaveStatus.d.ts.map +0 -1
  79. package/dist/types/src/components/SyncStatus/SyncStatus.d.ts +0 -13
  80. package/dist/types/src/components/SyncStatus/SyncStatus.d.ts.map +0 -1
  81. package/dist/types/src/components/SyncStatus/SyncStatus.stories.d.ts +0 -117
  82. package/dist/types/src/components/SyncStatus/SyncStatus.stories.d.ts.map +0 -1
  83. package/dist/types/src/components/SyncStatus/index.d.ts +0 -2
  84. package/dist/types/src/components/SyncStatus/index.d.ts.map +0 -1
  85. package/dist/types/src/components/SyncStatus/types.d.ts +0 -14
  86. package/dist/types/src/components/SyncStatus/types.d.ts.map +0 -1
  87. package/src/components/FallbackSettings.tsx +0 -35
  88. package/src/components/SaveStatus.tsx +0 -95
  89. package/src/components/SyncStatus/SyncStatus.stories.tsx +0 -62
  90. package/src/components/SyncStatus/SyncStatus.tsx +0 -188
  91. package/src/components/SyncStatus/index.ts +0 -5
  92. package/src/components/SyncStatus/types.ts +0 -77
@@ -1 +1 @@
1
- {"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../src/util.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,gBAAgB,EAAoB,KAAK,gBAAg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
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
@@ -10,24 +10,21 @@
10
10
  ".": {
11
11
  "browser": "./dist/lib/browser/index.mjs",
12
12
  "node": {
13
- "require": "./dist/lib/node/index.cjs",
14
- "default": "./dist/lib/node-esm/index.mjs"
13
+ "default": "./dist/lib/node/index.cjs"
15
14
  },
16
15
  "types": "./dist/types/src/index.d.ts"
17
16
  },
18
17
  "./meta": {
19
18
  "browser": "./dist/lib/browser/meta.mjs",
20
19
  "node": {
21
- "require": "./dist/lib/node/meta.cjs",
22
- "default": "./dist/lib/node-esm/meta.mjs"
20
+ "default": "./dist/lib/node/meta.cjs"
23
21
  },
24
22
  "types": "./dist/types/src/meta.d.ts"
25
23
  },
26
24
  "./types": {
27
25
  "browser": "./dist/lib/browser/types/index.mjs",
28
26
  "node": {
29
- "require": "./dist/lib/node/types/index.cjs",
30
- "default": "./dist/lib/node-esm/types/index.mjs"
27
+ "default": "./dist/lib/node/types/index.cjs"
31
28
  },
32
29
  "types": "./dist/types/src/types/index.d.ts"
33
30
  }
@@ -48,40 +45,34 @@
48
45
  "src"
49
46
  ],
50
47
  "dependencies": {
51
- "@effect/schema": "^0.75.1",
52
48
  "@preact/signals-core": "^1.6.0",
53
49
  "jszip": "^3.10.1",
54
50
  "localforage": "^1.10.0",
55
51
  "lodash.get": "^4.4.2",
56
52
  "react-drag-drop-files": "^2.3.8",
57
53
  "react-is": "~18.2.0",
58
- "@dxos/app-framework": "0.6.13-main.ed424a1",
59
- "@dxos/async": "0.6.13-main.ed424a1",
60
- "@dxos/automerge": "0.6.13-main.ed424a1",
61
- "@dxos/context": "0.6.13-main.ed424a1",
62
- "@dxos/client": "0.6.13-main.ed424a1",
63
- "@dxos/display-name": "0.6.13-main.ed424a1",
64
- "@dxos/echo-schema": "0.6.13-main.ed424a1",
65
- "@dxos/echo-signals": "0.6.13-main.ed424a1",
66
- "@dxos/invariant": "0.6.13-main.ed424a1",
67
- "@dxos/keys": "0.6.13-main.ed424a1",
68
- "@dxos/log": "0.6.13-main.ed424a1",
69
- "@dxos/local-storage": "0.6.13-main.ed424a1",
70
- "@dxos/plugin-attention": "0.6.13-main.ed424a1",
71
- "@dxos/migrations": "0.6.13-main.ed424a1",
72
- "@dxos/plugin-graph": "0.6.13-main.ed424a1",
73
- "@dxos/plugin-metadata": "0.6.13-main.ed424a1",
74
- "@dxos/plugin-observability": "0.6.13-main.ed424a1",
75
- "@dxos/plugin-client": "0.6.13-main.ed424a1",
76
- "@dxos/plugin-settings": "0.6.13-main.ed424a1",
77
- "@dxos/plugin-status-bar": "0.6.13-main.ed424a1",
78
- "@dxos/protocols": "0.6.13-main.ed424a1",
79
- "@dxos/react-client": "0.6.13-main.ed424a1",
80
- "@dxos/react-ui-editor": "0.6.13-main.ed424a1",
81
- "@dxos/react-ui-attention": "0.6.13-main.ed424a1",
82
- "@dxos/react-ui-syntax-highlighter": "0.6.13-main.ed424a1",
83
- "@dxos/util": "0.6.13-main.ed424a1",
84
- "@dxos/shell": "0.6.13-main.ed424a1"
54
+ "@dxos/app-framework": "0.6.13",
55
+ "@dxos/client": "0.6.13",
56
+ "@dxos/async": "0.6.13",
57
+ "@dxos/display-name": "0.6.13",
58
+ "@dxos/automerge": "0.6.13",
59
+ "@dxos/echo-schema": "0.6.13",
60
+ "@dxos/invariant": "0.6.13",
61
+ "@dxos/keys": "0.6.13",
62
+ "@dxos/local-storage": "0.6.13",
63
+ "@dxos/log": "0.6.13",
64
+ "@dxos/migrations": "0.6.13",
65
+ "@dxos/plugin-attention": "0.6.13",
66
+ "@dxos/plugin-client": "0.6.13",
67
+ "@dxos/plugin-graph": "0.6.13",
68
+ "@dxos/plugin-observability": "0.6.13",
69
+ "@dxos/plugin-metadata": "0.6.13",
70
+ "@dxos/plugin-settings": "0.6.13",
71
+ "@dxos/react-client": "0.6.13",
72
+ "@dxos/react-ui-attention": "0.6.13",
73
+ "@dxos/shell": "0.6.13",
74
+ "@dxos/react-ui-editor": "0.6.13",
75
+ "@dxos/util": "0.6.13"
85
76
  },
86
77
  "devDependencies": {
87
78
  "@babel/core": "^7.18.13",
@@ -91,17 +82,18 @@
91
82
  "@types/react-dom": "~18.2.0",
92
83
  "react": "~18.2.0",
93
84
  "react-dom": "~18.2.0",
94
- "vite": "5.4.7",
95
- "@dxos/react-ui-theme": "0.6.13-main.ed424a1",
96
- "@dxos/storybook-utils": "0.6.13-main.ed424a1",
97
- "@dxos/react-ui": "0.6.13-main.ed424a1"
85
+ "vite": "^5.3.4",
86
+ "@dxos/react-ui-theme": "0.6.13",
87
+ "@dxos/react-ui": "0.6.13",
88
+ "@dxos/storybook-utils": "0.6.13"
98
89
  },
99
- "peerDependencies": {
90
+ "optionalDependencies": {
91
+ "@babel/core": "^7.18.13",
100
92
  "@phosphor-icons/react": "^2.1.5",
101
- "react": "~18.2.0",
102
- "react-dom": "~18.2.0",
103
- "@dxos/react-ui": "0.6.13-main.ed424a1",
104
- "@dxos/react-ui-theme": "0.6.13-main.ed424a1"
93
+ "react": "^18.0.0",
94
+ "react-dom": "^18.0.0",
95
+ "@dxos/react-ui": "0.6.13",
96
+ "@dxos/react-ui-theme": "0.6.13"
105
97
  },
106
98
  "publishConfig": {
107
99
  "access": "public"
@@ -2,77 +2,74 @@
2
2
  // Copyright 2024 DXOS.org
3
3
  //
4
4
 
5
- import { signal } from '@preact/signals-core';
5
+ import { type IconProps, Plus, SignIn, CardsThree, Warning } from '@phosphor-icons/react';
6
+ import { effect, signal } from '@preact/signals-core';
6
7
  import React from 'react';
7
8
 
8
9
  import {
9
10
  type IntentDispatcher,
10
11
  type IntentPluginProvides,
11
12
  LayoutAction,
13
+ Surface,
12
14
  type LocationProvides,
13
15
  NavigationAction,
14
16
  type Plugin,
15
17
  type PluginDefinition,
16
- Surface,
17
- firstIdInPart,
18
18
  openIds,
19
- parseGraphPlugin,
19
+ firstIdInPart,
20
20
  parseIntentPlugin,
21
- parseMetadataResolverPlugin,
22
21
  parseNavigationPlugin,
22
+ parseMetadataResolverPlugin,
23
23
  resolvePlugin,
24
+ parseGraphPlugin,
24
25
  } from '@dxos/app-framework';
25
26
  import { EventSubscriptions, type Trigger, type UnsubscribeCallback } from '@dxos/async';
26
- import { type HasId, isReactiveObject } from '@dxos/echo-schema';
27
- import { scheduledEffect } from '@dxos/echo-signals/core';
27
+ import { type Identifiable, isReactiveObject, type EchoReactiveObject } from '@dxos/echo-schema';
28
28
  import { LocalStorageStore } from '@dxos/local-storage';
29
29
  import { log } from '@dxos/log';
30
30
  import { Migrations } from '@dxos/migrations';
31
31
  import { type AttentionPluginProvides, parseAttentionPlugin } from '@dxos/plugin-attention';
32
32
  import { type ClientPluginProvides, parseClientPlugin } from '@dxos/plugin-client';
33
- import { type Node, createExtension, memoize, toSignal } from '@dxos/plugin-graph';
33
+ import { createExtension, isGraphNode, memoize, type Node, toSignal } from '@dxos/plugin-graph';
34
34
  import { ObservabilityAction } from '@dxos/plugin-observability/meta';
35
35
  import { type Client, PublicKey } from '@dxos/react-client';
36
36
  import {
37
- Expando,
38
- type EchoReactiveObject,
39
- Filter,
40
37
  type PropertiesTypeProps,
41
38
  type Space,
42
- SpaceState,
43
39
  create,
40
+ Expando,
41
+ Filter,
44
42
  fullyQualifiedId,
45
43
  getSpace,
46
44
  getTypename,
47
45
  isEchoObject,
48
46
  isSpace,
49
47
  loadObjectReferences,
50
- parseFullyQualifiedId,
48
+ SpaceState,
51
49
  } from '@dxos/react-client/echo';
52
50
  import { Dialog } from '@dxos/react-ui';
53
- import { ClipboardProvider, InvitationManager, type InvitationManagerProps, osTranslations } from '@dxos/shell/react';
51
+ import { InvitationManager, type InvitationManagerProps, osTranslations, ClipboardProvider } from '@dxos/shell/react';
54
52
  import { ComplexMap, nonNullable, reduceGroupBy } from '@dxos/util';
55
53
 
56
54
  import {
57
55
  AwaitingObject,
58
56
  CollectionMain,
59
57
  CollectionSection,
60
- FallbackSettings,
58
+ EmptySpace,
59
+ EmptyTree,
61
60
  MenuFooter,
62
61
  MissingObject,
63
62
  PopoverRenameObject,
64
63
  PopoverRenameSpace,
65
- SaveStatus,
66
64
  ShareSpaceButton,
67
65
  SmallPresence,
68
66
  SmallPresenceLive,
69
67
  SpacePresence,
70
68
  SpaceSettings,
71
- SyncStatus,
72
69
  } from './components';
73
70
  import meta, { SPACE_PLUGIN, SpaceAction } from './meta';
74
71
  import translations from './translations';
75
- import { CollectionType, type PluginState, type SpacePluginProvides, type SpaceSettingsProps } from './types';
72
+ import { CollectionType, type SpacePluginProvides, type SpaceSettingsProps, type PluginState } from './types';
76
73
  import {
77
74
  COMPOSER_SPACE_LOCK,
78
75
  SHARED,
@@ -121,9 +118,7 @@ export const SpacePlugin = ({
121
118
  firstRun,
122
119
  onFirstRun,
123
120
  }: SpacePluginOptions = {}): PluginDefinition<SpacePluginProvides> => {
124
- const settings = new LocalStorageStore<SpaceSettingsProps>(SPACE_PLUGIN, {
125
- onSpaceCreate: 'dxos.org/plugin/markdown/action/create',
126
- });
121
+ const settings = new LocalStorageStore<SpaceSettingsProps>(SPACE_PLUGIN);
127
122
  const state = new LocalStorageStore<PluginState>(SPACE_PLUGIN, {
128
123
  awaiting: undefined,
129
124
  spaceNames: {},
@@ -176,10 +171,9 @@ export const SpacePlugin = ({
176
171
  .filter((space) => space.state.get() === SpaceState.SPACE_READY)
177
172
  .forEach((space) => {
178
173
  subscriptions.add(
179
- scheduledEffect(
180
- () => ({ name: space.properties.name }),
181
- ({ name }) => (state.values.spaceNames[space.id] = name),
182
- ),
174
+ effect(() => {
175
+ state.values.spaceNames[space.id] = space.properties.name;
176
+ }),
183
177
  );
184
178
  });
185
179
  }).unsubscribe,
@@ -187,56 +181,54 @@ export const SpacePlugin = ({
187
181
 
188
182
  // Broadcast active node to other peers in the space.
189
183
  subscriptions.add(
190
- scheduledEffect(
191
- () => ({
192
- ids: openIds(location.active),
193
- removed: location.closed ? [location.closed].flat() : [],
194
- }),
195
- ({ ids, removed }) => {
196
- const send = () => {
197
- const spaces = client.spaces.get();
198
- const identity = client.halo.identity.get();
199
- if (identity && location.active) {
200
- // Group parts by space for efficient messaging.
201
- const idsBySpace = reduceGroupBy(ids, (id) => {
202
- const [spaceId] = id.split(':'); // TODO(burdon): Factor out.
203
- return spaceId;
204
- });
205
-
206
- // NOTE: Ensure all spaces are included so that we send the correct `removed` object arrays.
207
- for (const space of spaces) {
208
- if (!idsBySpace.has(space.id)) {
209
- idsBySpace.set(space.id, []);
210
- }
184
+ effect(() => {
185
+ const send = () => {
186
+ const spaces = client.spaces.get();
187
+ const identity = client.halo.identity.get();
188
+ if (identity && location.active) {
189
+ const ids = openIds(location.active);
190
+
191
+ // Group parts by space for efficient messaging.
192
+ const idsBySpace = reduceGroupBy(ids, (id) => {
193
+ const [spaceId] = id.split(':'); // TODO(burdon): Factor out.
194
+ return spaceId;
195
+ });
196
+
197
+ // NOTE: Ensure all spaces are included so that we send the correct `removed` object arrays.
198
+ for (const space of spaces) {
199
+ if (!idsBySpace.has(space.id)) {
200
+ idsBySpace.set(space.id, []);
211
201
  }
202
+ }
212
203
 
213
- for (const [spaceId, ids] of idsBySpace) {
214
- const space = spaces.find((space) => space.id === spaceId);
215
- if (!space) {
216
- continue;
217
- }
218
-
219
- void space
220
- .postMessage('viewing', {
221
- identityKey: identity.identityKey.toHex(),
222
- attended: attention.attended ? [...attention.attended] : [],
223
- added: ids,
224
- // TODO(Zan): When we re-open a part, we should remove it from the removed list in the navigation plugin.
225
- removed: removed.filter((id) => !ids.includes(id)),
226
- })
227
- // TODO(burdon): This seems defensive; why would this fail? Backoff interval.
228
- .catch((err) => {
229
- log.warn('Failed to broadcast active node for presence.', { err: err.message });
230
- });
204
+ for (const [spaceId, ids] of idsBySpace) {
205
+ const space = spaces.find((space) => space.id === spaceId);
206
+ if (!space) {
207
+ continue;
231
208
  }
209
+
210
+ const removed = location.closed ? [location.closed].flat() : [];
211
+
212
+ void space
213
+ .postMessage('viewing', {
214
+ identityKey: identity.identityKey.toHex(),
215
+ attended: attention.attended ? [...attention.attended] : [],
216
+ added: ids,
217
+ // TODO(Zan): When we re-open a part, we should remove it from the removed list in the navigation plugin.
218
+ removed: removed.filter((id) => !ids.includes(id)),
219
+ })
220
+ // TODO(burdon): This seems defensive; why would this fail? Backoff interval.
221
+ .catch((err) => {
222
+ log.warn('Failed to broadcast active node for presence.', { err: err.message });
223
+ });
232
224
  }
233
- };
225
+ }
226
+ };
234
227
 
235
- send();
236
- const interval = setInterval(() => send(), ACTIVE_NODE_BROADCAST_INTERVAL);
237
- return () => clearInterval(interval);
238
- },
239
- ),
228
+ send();
229
+ const interval = setInterval(() => send(), ACTIVE_NODE_BROADCAST_INTERVAL);
230
+ return () => clearInterval(interval);
231
+ }),
240
232
  );
241
233
 
242
234
  // Listen for active nodes from other peers in the space.
@@ -348,7 +340,8 @@ export const SpacePlugin = ({
348
340
  records: {
349
341
  [CollectionType.typename]: {
350
342
  placeholder: ['unnamed collection label', { ns: SPACE_PLUGIN }],
351
- icon: 'ph--cards-three--regular',
343
+ icon: (props: IconProps) => <CardsThree {...props} />,
344
+ iconSymbol: 'ph--cards-three--regular',
352
345
  // TODO(wittjosiah): Move out of metadata.
353
346
  loadReferences: (collection: CollectionType) =>
354
347
  loadObjectReferences(collection, (collection) => [
@@ -369,18 +362,22 @@ export const SpacePlugin = ({
369
362
  case 'main':
370
363
  // TODO(wittjosiah): Need to avoid shotgun parsing space state everywhere.
371
364
  return isSpace(primary) && primary.state.get() === SpaceState.SPACE_READY ? (
372
- <Surface
373
- data={{ active: primary.properties[CollectionType.typename], id: primary.id }}
374
- role={role}
375
- {...rest}
376
- />
365
+ <Surface data={{ active: primary.properties[CollectionType.typename] }} role={role} {...rest} />
377
366
  ) : primary instanceof CollectionType ? (
378
367
  { node: <CollectionMain collection={primary} />, disposition: 'fallback' }
379
368
  ) : typeof primary === 'string' && primary.length === OBJECT_ID_LENGTH ? (
380
369
  <MissingObject id={primary} />
381
370
  ) : null;
382
- case 'complementary--settings':
383
- return isEchoObject(data.subject) ? <FallbackSettings object={data.subject} /> : null;
371
+ // TODO(burdon): Add role name syntax to minimal plugin docs.
372
+ case 'tree--empty':
373
+ switch (true) {
374
+ case data.plugin === SPACE_PLUGIN:
375
+ return <EmptyTree />;
376
+ case isGraphNode(data.activeNode) && isSpace(data.activeNode.data):
377
+ return <EmptySpace />;
378
+ default:
379
+ return null;
380
+ }
384
381
  case 'dialog':
385
382
  if (data.component === 'dxos.org/plugin/space/InvitationManagerDialog') {
386
383
  return (
@@ -401,7 +398,6 @@ export const SpacePlugin = ({
401
398
  return <PopoverRenameObject object={data.subject} />;
402
399
  }
403
400
  return null;
404
- // TODO(burdon): Add role name syntax to minimal plugin docs.
405
401
  case 'presence--glyph': {
406
402
  return isReactiveObject(data.object) ? (
407
403
  <SmallPresenceLive viewers={state.values.viewersByObject[fullyQualifiedId(data.object)]} />
@@ -445,14 +441,6 @@ export const SpacePlugin = ({
445
441
  } else {
446
442
  return <MenuFooter object={data.object} />;
447
443
  }
448
- case 'status': {
449
- return (
450
- <>
451
- <SyncStatus />
452
- <SaveStatus />
453
- </>
454
- );
455
- }
456
444
  default:
457
445
  return null;
458
446
  }
@@ -552,7 +540,8 @@ export const SpacePlugin = ({
552
540
  },
553
541
  properties: {
554
542
  label: ['create space label', { ns: SPACE_PLUGIN }],
555
- icon: 'ph--plus--regular',
543
+ icon: (props: IconProps) => <Plus {...props} />,
544
+ iconSymbol: 'ph--plus--regular',
556
545
  disposition: 'toolbar',
557
546
  testId: 'spacePlugin.createSpace',
558
547
  },
@@ -572,7 +561,8 @@ export const SpacePlugin = ({
572
561
  },
573
562
  properties: {
574
563
  label: ['join space label', { ns: SPACE_PLUGIN }],
575
- icon: 'ph--sign-in--regular',
564
+ icon: (props: IconProps) => <SignIn {...props} />,
565
+ iconSymbol: 'ph--sign-in--regular',
576
566
  testId: 'spacePlugin.joinSpace',
577
567
  },
578
568
  },
@@ -717,52 +707,6 @@ export const SpacePlugin = ({
717
707
  .filter(nonNullable);
718
708
  },
719
709
  }),
720
-
721
- // Create nodes for object settings.
722
- createExtension({
723
- id: `${SPACE_PLUGIN}/settings-for-subject`,
724
- resolver: ({ id }) => {
725
- // TODO(Zan): Find util (or make one).
726
- if (!id.endsWith('~settings')) {
727
- return;
728
- }
729
-
730
- const [subjectId] = id.split('~');
731
- const [spaceId, objectId] = parseFullyQualifiedId(subjectId);
732
- const space = client.spaces.get().find((space) => space.id === spaceId);
733
- const object = toSignal(
734
- (onChange) => {
735
- const timeout = setTimeout(async () => {
736
- await space?.db.loadObjectById(objectId);
737
- onChange();
738
- });
739
-
740
- return () => clearTimeout(timeout);
741
- },
742
- () => space?.db.getObjectById(objectId),
743
- subjectId,
744
- );
745
- if (!object || !subjectId) {
746
- return;
747
- }
748
-
749
- const meta = resolve(getTypename(object) ?? '');
750
- const label = meta.label?.(object) ||
751
- object.name ||
752
- meta.placeholder || ['unnamed object settings label', { ns: SPACE_PLUGIN }];
753
-
754
- return {
755
- id,
756
- type: 'orphan-settings-for-subject',
757
- data: null,
758
- properties: {
759
- icon: 'ph--gear--regular',
760
- label,
761
- object,
762
- },
763
- };
764
- },
765
- }),
766
710
  ];
767
711
  },
768
712
  serializer: (plugins) => {
@@ -861,15 +805,6 @@ export const SpacePlugin = ({
861
805
  data: { space, id: space.id, activeParts: { main: [space.id] } },
862
806
 
863
807
  intents: [
864
- ...(settings.values.onSpaceCreate
865
- ? [
866
- [
867
- { action: settings.values.onSpaceCreate, data: { space } },
868
- { action: SpaceAction.ADD_OBJECT, data: { target: space } },
869
- { action: NavigationAction.EXPOSE },
870
- ],
871
- ]
872
- : []),
873
808
  [
874
809
  {
875
810
  action: ObservabilityAction.SEND_EVENT,
@@ -1085,7 +1020,8 @@ export const SpacePlugin = ({
1085
1020
  title: translations[0]['en-US'][SPACE_PLUGIN]['space limit label'],
1086
1021
  description: translations[0]['en-US'][SPACE_PLUGIN]['space limit description'],
1087
1022
  duration: 5_000,
1088
- icon: 'ph--warning--regular',
1023
+ icon: (props: IconProps) => <Warning {...props} />,
1024
+ iconSymbol: 'ph--warning--regular',
1089
1025
  actionLabel: translations[0]['en-US'][SPACE_PLUGIN]['remove deleted objects label'],
1090
1026
  actionAlt: translations[0]['en-US'][SPACE_PLUGIN]['remove deleted objects alt'],
1091
1027
  // TODO(wittjosiah): Use OS namespace.
@@ -1111,20 +1047,20 @@ export const SpacePlugin = ({
1111
1047
  }
1112
1048
 
1113
1049
  if (intent.data?.target instanceof CollectionType) {
1114
- intent.data?.target.objects.push(object as HasId);
1050
+ intent.data?.target.objects.push(object as Identifiable);
1115
1051
  } else if (isSpace(intent.data?.target)) {
1116
1052
  const collection = space.properties[CollectionType.typename];
1117
1053
  if (collection instanceof CollectionType) {
1118
- collection.objects.push(object as HasId);
1054
+ collection.objects.push(object as Identifiable);
1119
1055
  } else {
1120
1056
  // TODO(wittjosiah): Can't add non-echo objects by including in a collection because of types.
1121
- const collection = create(CollectionType, { objects: [object as HasId], views: {} });
1057
+ const collection = create(CollectionType, { objects: [object as Identifiable], views: {} });
1122
1058
  space.properties[CollectionType.typename] = collection;
1123
1059
  }
1124
1060
  }
1125
1061
 
1126
1062
  return {
1127
- data: { id: fullyQualifiedId(object), object, activeParts: { main: [fullyQualifiedId(object)] } },
1063
+ data: { id: object.id, object, activeParts: { main: [fullyQualifiedId(object)] } },
1128
1064
  intents: [
1129
1065
  [
1130
1066
  {
@@ -1179,6 +1115,7 @@ export const SpacePlugin = ({
1179
1115
  activeParts: {
1180
1116
  main: deletionData.wasActive,
1181
1117
  sidebar: deletionData.wasActive,
1118
+ complementary: deletionData.wasActive,
1182
1119
  },
1183
1120
  },
1184
1121
  });
@@ -0,0 +1,25 @@
1
+ //
2
+ // Copyright 2023 DXOS.org
3
+ //
4
+
5
+ import React from 'react';
6
+
7
+ import { useTranslation } from '@dxos/react-ui';
8
+ import { descriptionText, mx } from '@dxos/react-ui-theme';
9
+
10
+ import { SPACE_PLUGIN } from '../meta';
11
+
12
+ export const EmptySpace = () => {
13
+ const { t } = useTranslation(SPACE_PLUGIN);
14
+ return (
15
+ <div
16
+ role='none'
17
+ className={mx(
18
+ 'p-2 mli-2 mbe-2 text-center border border-dashed border-neutral-400/50 rounded-lg',
19
+ descriptionText,
20
+ )}
21
+ >
22
+ {t('empty space message')}
23
+ </div>
24
+ );
25
+ };
@@ -0,0 +1,25 @@
1
+ //
2
+ // Copyright 2023 DXOS.org
3
+ //
4
+
5
+ import React from 'react';
6
+
7
+ import { useTranslation } from '@dxos/react-ui';
8
+ import { descriptionText, mx } from '@dxos/react-ui-theme';
9
+
10
+ import { SPACE_PLUGIN } from '../meta';
11
+
12
+ export const EmptyTree = () => {
13
+ const { t } = useTranslation(SPACE_PLUGIN);
14
+ return (
15
+ <div
16
+ role='none'
17
+ className={mx(
18
+ 'p-2 mli-2 mbe-2 text-center border border-dashed border-neutral-400/50 rounded-lg',
19
+ descriptionText,
20
+ )}
21
+ >
22
+ {t('empty tree message')}
23
+ </div>
24
+ );
25
+ };
@@ -1,11 +1,11 @@
1
1
  //
2
2
  // Copyright 2024 DXOS.org
3
3
  //
4
-
5
4
  import { Planet } from '@phosphor-icons/react';
6
5
  import React from 'react';
7
6
 
8
- import { type EchoReactiveObject, getSpace } from '@dxos/client/echo';
7
+ import { getSpace } from '@dxos/client/echo';
8
+ import type { EchoReactiveObject } from '@dxos/echo-schema';
9
9
  import { useClient } from '@dxos/react-client';
10
10
  import { DropdownMenu, toLocalizedString, useTranslation } from '@dxos/react-ui';
11
11
 
@@ -6,14 +6,35 @@ import { Command } from '@phosphor-icons/react';
6
6
  import React from 'react';
7
7
 
8
8
  import { Surface } from '@dxos/app-framework';
9
+ import { type Action } from '@dxos/plugin-graph';
9
10
  import { SpaceState, type Space } from '@dxos/react-client/echo';
10
- import { Main, useTranslation } from '@dxos/react-ui';
11
+ import { Button, Main, useTranslation, toLocalizedString } from '@dxos/react-ui';
11
12
  import { getSize, mx, topbarBlockPaddingStart } from '@dxos/react-ui-theme';
12
13
  import { ClipboardProvider } from '@dxos/shell/react';
13
14
 
14
15
  import { SpaceMembersSection } from './SpaceMembersSection';
15
16
  import { SPACE_PLUGIN } from '../../meta';
16
17
 
18
+ const _InFlowSpaceActions = ({ actionsMap }: { actionsMap: Record<string, Action> }) => {
19
+ const { t } = useTranslation(SPACE_PLUGIN);
20
+ return (
21
+ <section className='mbe-4 col-start-2 col-end-4 md:col-end-7 grid gap-2 auto-rows-min grid-cols-[repeat(auto-fill,minmax(8rem,1fr))]'>
22
+ {Object.entries(actionsMap)
23
+ .filter(([_, { properties }]) => properties?.mainAreaDisposition === 'in-flow')
24
+ .map(([actionId, { data: invoke, properties }]) => {
25
+ const Icon = properties?.icon;
26
+ const label = properties?.label;
27
+ return (
28
+ <Button key={actionId} classNames='block text-center plb-2 font-normal'>
29
+ {Icon && <Icon size={5} className='mli-auto' />}
30
+ <p>{toLocalizedString(label, t)}</p>
31
+ </Button>
32
+ );
33
+ })}
34
+ </section>
35
+ );
36
+ };
37
+
17
38
  const KeyShortcuts = () => {
18
39
  const { t } = useTranslation(SPACE_PLUGIN);
19
40
  return (
@@ -110,7 +110,7 @@ export type MemberPresenceProps = ThemedClassName<{
110
110
 
111
111
  export const FullPresence = (props: MemberPresenceProps) => {
112
112
  const { size = 9, onMemberClick } = props;
113
- const members = useDefaultValue(props.members, () => []);
113
+ const members = useDefaultValue(props.members, []);
114
114
 
115
115
  if (members.length === 0) {
116
116
  return null;