@dxos/plugin-space 0.6.12 → 0.6.13-main.548ca8d

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 (91) hide show
  1. package/dist/lib/browser/{chunk-LZEGRS7H.mjs → chunk-AVLRQF6L.mjs} +1 -1
  2. package/dist/lib/browser/chunk-AVLRQF6L.mjs.map +7 -0
  3. package/dist/lib/browser/{chunk-DTVUOG2C.mjs → chunk-QK5I2EPF.mjs} +23 -4
  4. package/dist/lib/browser/chunk-QK5I2EPF.mjs.map +7 -0
  5. package/dist/lib/browser/index.mjs +592 -246
  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 +7 -3
  10. package/dist/lib/node/{chunk-CVZPI2P3.cjs → chunk-HE2GHO6Z.cjs} +29 -8
  11. package/dist/lib/node/chunk-HE2GHO6Z.cjs.map +7 -0
  12. package/dist/lib/node/{chunk-6CNYF6YU.cjs → chunk-P4XUXM7Y.cjs} +4 -4
  13. package/dist/lib/node/chunk-P4XUXM7Y.cjs.map +7 -0
  14. package/dist/lib/node/index.cjs +812 -469
  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 +14 -10
  20. package/dist/lib/node/types/index.cjs.map +2 -2
  21. package/dist/lib/node-esm/chunk-2TR4WD6U.mjs +116 -0
  22. package/dist/lib/node-esm/chunk-2TR4WD6U.mjs.map +7 -0
  23. package/dist/lib/node-esm/chunk-YPQGKWHJ.mjs +37 -0
  24. package/dist/lib/node-esm/chunk-YPQGKWHJ.mjs.map +7 -0
  25. package/dist/lib/node-esm/index.mjs +2987 -0
  26. package/dist/lib/node-esm/index.mjs.map +7 -0
  27. package/dist/lib/node-esm/meta.json +1 -0
  28. package/dist/lib/node-esm/meta.mjs +14 -0
  29. package/dist/lib/node-esm/meta.mjs.map +7 -0
  30. package/dist/lib/node-esm/types/index.mjs +26 -0
  31. package/dist/lib/node-esm/types/index.mjs.map +7 -0
  32. package/dist/types/src/SpacePlugin.d.ts.map +1 -1
  33. package/dist/types/src/components/FallbackSettings.d.ts +8 -0
  34. package/dist/types/src/components/FallbackSettings.d.ts.map +1 -0
  35. package/dist/types/src/components/MenuFooter.d.ts.map +1 -1
  36. package/dist/types/src/components/SaveStatus.d.ts +3 -0
  37. package/dist/types/src/components/SaveStatus.d.ts.map +1 -0
  38. package/dist/types/src/components/ShareSpaceButton.stories.d.ts +4 -0
  39. package/dist/types/src/components/ShareSpaceButton.stories.d.ts.map +1 -1
  40. package/dist/types/src/components/SpaceMain/SpaceMain.d.ts.map +1 -1
  41. package/dist/types/src/components/SpacePresence.stories.d.ts +4 -0
  42. package/dist/types/src/components/SpacePresence.stories.d.ts.map +1 -1
  43. package/dist/types/src/components/SpaceSettings.d.ts.map +1 -1
  44. package/dist/types/src/components/SyncStatus/SyncStatus.d.ts +13 -0
  45. package/dist/types/src/components/SyncStatus/SyncStatus.d.ts.map +1 -0
  46. package/dist/types/src/components/SyncStatus/SyncStatus.stories.d.ts +117 -0
  47. package/dist/types/src/components/SyncStatus/SyncStatus.stories.d.ts.map +1 -0
  48. package/dist/types/src/components/SyncStatus/index.d.ts +2 -0
  49. package/dist/types/src/components/SyncStatus/index.d.ts.map +1 -0
  50. package/dist/types/src/components/SyncStatus/types.d.ts +14 -0
  51. package/dist/types/src/components/SyncStatus/types.d.ts.map +1 -0
  52. package/dist/types/src/components/index.d.ts +3 -2
  53. package/dist/types/src/components/index.d.ts.map +1 -1
  54. package/dist/types/src/meta.d.ts.map +1 -1
  55. package/dist/types/src/translations.d.ts +4 -0
  56. package/dist/types/src/translations.d.ts.map +1 -1
  57. package/dist/types/src/types/thread.d.ts +14 -0
  58. package/dist/types/src/types/thread.d.ts.map +1 -1
  59. package/dist/types/src/types/types.d.ts +18 -1
  60. package/dist/types/src/types/types.d.ts.map +1 -1
  61. package/dist/types/src/util.d.ts +1 -4
  62. package/dist/types/src/util.d.ts.map +1 -1
  63. package/package.json +44 -36
  64. package/src/SpacePlugin.tsx +145 -83
  65. package/src/components/FallbackSettings.tsx +35 -0
  66. package/src/components/MenuFooter.tsx +1 -0
  67. package/src/components/SaveStatus.tsx +95 -0
  68. package/src/components/SpaceMain/SpaceMain.tsx +1 -22
  69. package/src/components/SpacePresence.tsx +1 -1
  70. package/src/components/SpaceSettings.tsx +32 -3
  71. package/src/components/SyncStatus/SyncStatus.stories.tsx +62 -0
  72. package/src/components/SyncStatus/SyncStatus.tsx +188 -0
  73. package/src/components/SyncStatus/index.ts +5 -0
  74. package/src/components/SyncStatus/types.ts +77 -0
  75. package/src/components/index.ts +3 -2
  76. package/src/meta.ts +3 -1
  77. package/src/translations.ts +4 -0
  78. package/src/types/collection.ts +1 -1
  79. package/src/types/thread.ts +11 -1
  80. package/src/types/types.ts +25 -1
  81. package/src/util.tsx +15 -50
  82. package/dist/lib/browser/chunk-DTVUOG2C.mjs.map +0 -7
  83. package/dist/lib/browser/chunk-LZEGRS7H.mjs.map +0 -7
  84. package/dist/lib/node/chunk-6CNYF6YU.cjs.map +0 -7
  85. package/dist/lib/node/chunk-CVZPI2P3.cjs.map +0 -7
  86. package/dist/types/src/components/EmptySpace.d.ts +0 -3
  87. package/dist/types/src/components/EmptySpace.d.ts.map +0 -1
  88. package/dist/types/src/components/EmptyTree.d.ts +0 -3
  89. package/dist/types/src/components/EmptyTree.d.ts.map +0 -1
  90. package/src/components/EmptySpace.tsx +0 -25
  91. package/src/components/EmptyTree.tsx +0 -25
@@ -1 +1 @@
1
- {"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../src/util.tsx"],"names":[],"mappings":"AAIA,OAAO,EAUL,KAAK,SAAS,EAKf,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,MAAM,OA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AAC;IAAC,QAAQ,EAAE,gBAAgB,CAAA;CAAE,wCAkD3G,CAAC;AAEF,eAAO,MAAM,qBAAqB,8CAK/B;IACD,KAAK,EAAE,KAAK,CAAC;IACb,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,0BAiHA,CAAC;AAEF,eAAO,MAAM,gBAAgB,gCAI1B;IACD,MAAM,EAAE,kBAAkB,CAAC,GAAG,CAAC,CAAC;IAChC,KAAK,EAAE,KAAK,CAAC;IACb,OAAO,EAAE,gBAAgB,CAAC;CAC3B;;;;;aA+BA,CAAC;AAEF,eAAO,MAAM,2BAA2B,0BAGrC;IACD,MAAM,EAAE,kBAAkB,CAAC,GAAG,CAAC,CAAC;IAChC,QAAQ,EAAE,gBAAgB,CAAC;CAC5B,wCA+CA,CAAC;AAEF,eAAO,MAAM,sBAAsB,wBAGhC;IACD,IAAI,EAAE,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC,CAAC;IACpC,QAAQ,EAAE,gBAAgB,CAAC;CAC5B,0BAiEA,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,cAAc,UAAW,KAAK,WAAW,MAAM,sBAW3D,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB,WACnB,kBAAkB,CAAC,GAAG,CAAC,WACtB,gBAAgB,KACxB,OAAO,CAAC,kBAAkB,CAAC,GAAG,CAAC,EAAE,CAenC,CAAC;AAEF;;GAEG;AAEH,eAAO,MAAM,WAAW,WAAkB,OAAO,WAAW,gBAAgB,KAAG,OAAO,CAAC,OAAO,CAQ7F,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/plugin-space",
3
- "version": "0.6.12",
3
+ "version": "0.6.13-main.548ca8d",
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",
@@ -10,21 +10,24 @@
10
10
  ".": {
11
11
  "browser": "./dist/lib/browser/index.mjs",
12
12
  "node": {
13
- "default": "./dist/lib/node/index.cjs"
13
+ "require": "./dist/lib/node/index.cjs",
14
+ "default": "./dist/lib/node-esm/index.mjs"
14
15
  },
15
16
  "types": "./dist/types/src/index.d.ts"
16
17
  },
17
18
  "./meta": {
18
19
  "browser": "./dist/lib/browser/meta.mjs",
19
20
  "node": {
20
- "default": "./dist/lib/node/meta.cjs"
21
+ "require": "./dist/lib/node/meta.cjs",
22
+ "default": "./dist/lib/node-esm/meta.mjs"
21
23
  },
22
24
  "types": "./dist/types/src/meta.d.ts"
23
25
  },
24
26
  "./types": {
25
27
  "browser": "./dist/lib/browser/types/index.mjs",
26
28
  "node": {
27
- "default": "./dist/lib/node/types/index.cjs"
29
+ "require": "./dist/lib/node/types/index.cjs",
30
+ "default": "./dist/lib/node-esm/types/index.mjs"
28
31
  },
29
32
  "types": "./dist/types/src/types/index.d.ts"
30
33
  }
@@ -45,34 +48,40 @@
45
48
  "src"
46
49
  ],
47
50
  "dependencies": {
51
+ "@effect/schema": "^0.75.1",
48
52
  "@preact/signals-core": "^1.6.0",
49
53
  "jszip": "^3.10.1",
50
54
  "localforage": "^1.10.0",
51
55
  "lodash.get": "^4.4.2",
52
56
  "react-drag-drop-files": "^2.3.8",
53
57
  "react-is": "~18.2.0",
54
- "@dxos/app-framework": "0.6.12",
55
- "@dxos/async": "0.6.12",
56
- "@dxos/automerge": "0.6.12",
57
- "@dxos/client": "0.6.12",
58
- "@dxos/display-name": "0.6.12",
59
- "@dxos/echo-schema": "0.6.12",
60
- "@dxos/local-storage": "0.6.12",
61
- "@dxos/keys": "0.6.12",
62
- "@dxos/log": "0.6.12",
63
- "@dxos/invariant": "0.6.12",
64
- "@dxos/migrations": "0.6.12",
65
- "@dxos/plugin-attention": "0.6.12",
66
- "@dxos/plugin-client": "0.6.12",
67
- "@dxos/plugin-graph": "0.6.12",
68
- "@dxos/plugin-metadata": "0.6.12",
69
- "@dxos/plugin-observability": "0.6.12",
70
- "@dxos/plugin-settings": "0.6.12",
71
- "@dxos/react-client": "0.6.12",
72
- "@dxos/react-ui-editor": "0.6.12",
73
- "@dxos/react-ui-attention": "0.6.12",
74
- "@dxos/shell": "0.6.12",
75
- "@dxos/util": "0.6.12"
58
+ "@dxos/app-framework": "0.6.13-main.548ca8d",
59
+ "@dxos/async": "0.6.13-main.548ca8d",
60
+ "@dxos/client": "0.6.13-main.548ca8d",
61
+ "@dxos/automerge": "0.6.13-main.548ca8d",
62
+ "@dxos/context": "0.6.13-main.548ca8d",
63
+ "@dxos/display-name": "0.6.13-main.548ca8d",
64
+ "@dxos/invariant": "0.6.13-main.548ca8d",
65
+ "@dxos/echo-schema": "0.6.13-main.548ca8d",
66
+ "@dxos/echo-signals": "0.6.13-main.548ca8d",
67
+ "@dxos/local-storage": "0.6.13-main.548ca8d",
68
+ "@dxos/keys": "0.6.13-main.548ca8d",
69
+ "@dxos/migrations": "0.6.13-main.548ca8d",
70
+ "@dxos/log": "0.6.13-main.548ca8d",
71
+ "@dxos/plugin-attention": "0.6.13-main.548ca8d",
72
+ "@dxos/plugin-client": "0.6.13-main.548ca8d",
73
+ "@dxos/plugin-metadata": "0.6.13-main.548ca8d",
74
+ "@dxos/plugin-observability": "0.6.13-main.548ca8d",
75
+ "@dxos/plugin-graph": "0.6.13-main.548ca8d",
76
+ "@dxos/plugin-status-bar": "0.6.13-main.548ca8d",
77
+ "@dxos/plugin-settings": "0.6.13-main.548ca8d",
78
+ "@dxos/react-client": "0.6.13-main.548ca8d",
79
+ "@dxos/protocols": "0.6.13-main.548ca8d",
80
+ "@dxos/react-ui-attention": "0.6.13-main.548ca8d",
81
+ "@dxos/react-ui-syntax-highlighter": "0.6.13-main.548ca8d",
82
+ "@dxos/react-ui-editor": "0.6.13-main.548ca8d",
83
+ "@dxos/shell": "0.6.13-main.548ca8d",
84
+ "@dxos/util": "0.6.13-main.548ca8d"
76
85
  },
77
86
  "devDependencies": {
78
87
  "@babel/core": "^7.18.13",
@@ -82,18 +91,17 @@
82
91
  "@types/react-dom": "~18.2.0",
83
92
  "react": "~18.2.0",
84
93
  "react-dom": "~18.2.0",
85
- "vite": "^5.3.4",
86
- "@dxos/react-ui": "0.6.12",
87
- "@dxos/react-ui-theme": "0.6.12",
88
- "@dxos/storybook-utils": "0.6.12"
94
+ "vite": "5.4.7",
95
+ "@dxos/react-ui-theme": "0.6.13-main.548ca8d",
96
+ "@dxos/react-ui": "0.6.13-main.548ca8d",
97
+ "@dxos/storybook-utils": "0.6.13-main.548ca8d"
89
98
  },
90
- "optionalDependencies": {
91
- "@babel/core": "^7.18.13",
99
+ "peerDependencies": {
92
100
  "@phosphor-icons/react": "^2.1.5",
93
- "react": "^18.0.0",
94
- "react-dom": "^18.0.0",
95
- "@dxos/react-ui": "0.6.12",
96
- "@dxos/react-ui-theme": "0.6.12"
101
+ "react": "~18.2.0",
102
+ "react-dom": "~18.2.0",
103
+ "@dxos/react-ui": "0.6.13-main.548ca8d",
104
+ "@dxos/react-ui-theme": "0.6.13-main.548ca8d"
97
105
  },
98
106
  "publishConfig": {
99
107
  "access": "public"
@@ -2,74 +2,76 @@
2
2
  // Copyright 2024 DXOS.org
3
3
  //
4
4
 
5
- import { type IconProps, Plus, SignIn, CardsThree, Warning } from '@phosphor-icons/react';
6
- import { effect, signal } from '@preact/signals-core';
5
+ import { signal } from '@preact/signals-core';
7
6
  import React from 'react';
8
7
 
9
8
  import {
10
9
  type IntentDispatcher,
11
10
  type IntentPluginProvides,
12
11
  LayoutAction,
13
- Surface,
14
12
  type LocationProvides,
15
13
  NavigationAction,
16
14
  type Plugin,
17
15
  type PluginDefinition,
18
- openIds,
16
+ Surface,
19
17
  firstIdInPart,
18
+ openIds,
19
+ parseGraphPlugin,
20
20
  parseIntentPlugin,
21
- parseNavigationPlugin,
22
21
  parseMetadataResolverPlugin,
22
+ parseNavigationPlugin,
23
23
  resolvePlugin,
24
- parseGraphPlugin,
25
24
  } from '@dxos/app-framework';
26
25
  import { EventSubscriptions, type Trigger, type UnsubscribeCallback } from '@dxos/async';
27
- import { type Identifiable, isReactiveObject, type EchoReactiveObject } from '@dxos/echo-schema';
26
+ import { type EchoReactiveObject, type Identifiable, isReactiveObject } from '@dxos/echo-schema';
27
+ import { scheduledEffect } from '@dxos/echo-signals/core';
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 { createExtension, isGraphNode, memoize, type Node, toSignal } from '@dxos/plugin-graph';
33
+ import { type Node, createExtension, memoize, 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
+ Filter,
37
39
  type PropertiesTypeProps,
38
40
  type Space,
41
+ SpaceState,
39
42
  create,
40
- Expando,
41
- Filter,
42
43
  fullyQualifiedId,
43
44
  getSpace,
44
45
  getTypename,
45
46
  isEchoObject,
46
47
  isSpace,
47
48
  loadObjectReferences,
48
- SpaceState,
49
+ parseFullyQualifiedId,
49
50
  } from '@dxos/react-client/echo';
50
51
  import { Dialog } from '@dxos/react-ui';
51
- import { InvitationManager, type InvitationManagerProps, osTranslations, ClipboardProvider } from '@dxos/shell/react';
52
+ import { ClipboardProvider, InvitationManager, type InvitationManagerProps, osTranslations } from '@dxos/shell/react';
52
53
  import { ComplexMap, nonNullable, reduceGroupBy } from '@dxos/util';
53
54
 
54
55
  import {
55
56
  AwaitingObject,
56
57
  CollectionMain,
57
58
  CollectionSection,
58
- EmptySpace,
59
- EmptyTree,
59
+ FallbackSettings,
60
60
  MenuFooter,
61
61
  MissingObject,
62
62
  PopoverRenameObject,
63
63
  PopoverRenameSpace,
64
+ SaveStatus,
64
65
  ShareSpaceButton,
65
66
  SmallPresence,
66
67
  SmallPresenceLive,
67
68
  SpacePresence,
68
69
  SpaceSettings,
70
+ SyncStatus,
69
71
  } from './components';
70
72
  import meta, { SPACE_PLUGIN, SpaceAction } from './meta';
71
73
  import translations from './translations';
72
- import { CollectionType, type SpacePluginProvides, type SpaceSettingsProps, type PluginState } from './types';
74
+ import { CollectionType, type PluginState, type SpacePluginProvides, type SpaceSettingsProps } from './types';
73
75
  import {
74
76
  COMPOSER_SPACE_LOCK,
75
77
  SHARED,
@@ -118,7 +120,9 @@ export const SpacePlugin = ({
118
120
  firstRun,
119
121
  onFirstRun,
120
122
  }: SpacePluginOptions = {}): PluginDefinition<SpacePluginProvides> => {
121
- const settings = new LocalStorageStore<SpaceSettingsProps>(SPACE_PLUGIN);
123
+ const settings = new LocalStorageStore<SpaceSettingsProps>(SPACE_PLUGIN, {
124
+ onSpaceCreate: 'dxos.org/plugin/markdown/action/create',
125
+ });
122
126
  const state = new LocalStorageStore<PluginState>(SPACE_PLUGIN, {
123
127
  awaiting: undefined,
124
128
  spaceNames: {},
@@ -171,9 +175,10 @@ export const SpacePlugin = ({
171
175
  .filter((space) => space.state.get() === SpaceState.SPACE_READY)
172
176
  .forEach((space) => {
173
177
  subscriptions.add(
174
- effect(() => {
175
- state.values.spaceNames[space.id] = space.properties.name;
176
- }),
178
+ scheduledEffect(
179
+ () => ({ name: space.properties.name }),
180
+ ({ name }) => (state.values.spaceNames[space.id] = name),
181
+ ),
177
182
  );
178
183
  });
179
184
  }).unsubscribe,
@@ -181,54 +186,56 @@ export const SpacePlugin = ({
181
186
 
182
187
  // Broadcast active node to other peers in the space.
183
188
  subscriptions.add(
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, []);
189
+ scheduledEffect(
190
+ () => ({
191
+ ids: openIds(location.active),
192
+ removed: location.closed ? [location.closed].flat() : [],
193
+ }),
194
+ ({ ids, removed }) => {
195
+ const send = () => {
196
+ const spaces = client.spaces.get();
197
+ const identity = client.halo.identity.get();
198
+ if (identity && location.active) {
199
+ // Group parts by space for efficient messaging.
200
+ const idsBySpace = reduceGroupBy(ids, (id) => {
201
+ const [spaceId] = id.split(':'); // TODO(burdon): Factor out.
202
+ return spaceId;
203
+ });
204
+
205
+ // NOTE: Ensure all spaces are included so that we send the correct `removed` object arrays.
206
+ for (const space of spaces) {
207
+ if (!idsBySpace.has(space.id)) {
208
+ idsBySpace.set(space.id, []);
209
+ }
201
210
  }
202
- }
203
211
 
204
- for (const [spaceId, ids] of idsBySpace) {
205
- const space = spaces.find((space) => space.id === spaceId);
206
- if (!space) {
207
- continue;
208
- }
212
+ for (const [spaceId, ids] of idsBySpace) {
213
+ const space = spaces.find((space) => space.id === spaceId);
214
+ if (!space) {
215
+ continue;
216
+ }
209
217
 
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
- });
218
+ void space
219
+ .postMessage('viewing', {
220
+ identityKey: identity.identityKey.toHex(),
221
+ attended: attention.attended ? [...attention.attended] : [],
222
+ added: ids,
223
+ // TODO(Zan): When we re-open a part, we should remove it from the removed list in the navigation plugin.
224
+ removed: removed.filter((id) => !ids.includes(id)),
225
+ })
226
+ // TODO(burdon): This seems defensive; why would this fail? Backoff interval.
227
+ .catch((err) => {
228
+ log.warn('Failed to broadcast active node for presence.', { err: err.message });
229
+ });
230
+ }
224
231
  }
225
- }
226
- };
232
+ };
227
233
 
228
- send();
229
- const interval = setInterval(() => send(), ACTIVE_NODE_BROADCAST_INTERVAL);
230
- return () => clearInterval(interval);
231
- }),
234
+ send();
235
+ const interval = setInterval(() => send(), ACTIVE_NODE_BROADCAST_INTERVAL);
236
+ return () => clearInterval(interval);
237
+ },
238
+ ),
232
239
  );
233
240
 
234
241
  // Listen for active nodes from other peers in the space.
@@ -340,8 +347,7 @@ export const SpacePlugin = ({
340
347
  records: {
341
348
  [CollectionType.typename]: {
342
349
  placeholder: ['unnamed collection label', { ns: SPACE_PLUGIN }],
343
- icon: (props: IconProps) => <CardsThree {...props} />,
344
- iconSymbol: 'ph--cards-three--regular',
350
+ icon: 'ph--cards-three--regular',
345
351
  // TODO(wittjosiah): Move out of metadata.
346
352
  loadReferences: (collection: CollectionType) =>
347
353
  loadObjectReferences(collection, (collection) => [
@@ -362,22 +368,18 @@ export const SpacePlugin = ({
362
368
  case 'main':
363
369
  // TODO(wittjosiah): Need to avoid shotgun parsing space state everywhere.
364
370
  return isSpace(primary) && primary.state.get() === SpaceState.SPACE_READY ? (
365
- <Surface data={{ active: primary.properties[CollectionType.typename] }} role={role} {...rest} />
371
+ <Surface
372
+ data={{ active: primary.properties[CollectionType.typename], id: primary.id }}
373
+ role={role}
374
+ {...rest}
375
+ />
366
376
  ) : primary instanceof CollectionType ? (
367
377
  { node: <CollectionMain collection={primary} />, disposition: 'fallback' }
368
378
  ) : typeof primary === 'string' && primary.length === OBJECT_ID_LENGTH ? (
369
379
  <MissingObject id={primary} />
370
380
  ) : 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
- }
381
+ case 'complementary--settings':
382
+ return isEchoObject(data.subject) ? <FallbackSettings object={data.subject} /> : null;
381
383
  case 'dialog':
382
384
  if (data.component === 'dxos.org/plugin/space/InvitationManagerDialog') {
383
385
  return (
@@ -398,6 +400,7 @@ export const SpacePlugin = ({
398
400
  return <PopoverRenameObject object={data.subject} />;
399
401
  }
400
402
  return null;
403
+ // TODO(burdon): Add role name syntax to minimal plugin docs.
401
404
  case 'presence--glyph': {
402
405
  return isReactiveObject(data.object) ? (
403
406
  <SmallPresenceLive viewers={state.values.viewersByObject[fullyQualifiedId(data.object)]} />
@@ -441,6 +444,14 @@ export const SpacePlugin = ({
441
444
  } else {
442
445
  return <MenuFooter object={data.object} />;
443
446
  }
447
+ case 'status': {
448
+ return (
449
+ <>
450
+ <SyncStatus />
451
+ <SaveStatus />
452
+ </>
453
+ );
454
+ }
444
455
  default:
445
456
  return null;
446
457
  }
@@ -540,8 +551,7 @@ export const SpacePlugin = ({
540
551
  },
541
552
  properties: {
542
553
  label: ['create space label', { ns: SPACE_PLUGIN }],
543
- icon: (props: IconProps) => <Plus {...props} />,
544
- iconSymbol: 'ph--plus--regular',
554
+ icon: 'ph--plus--regular',
545
555
  disposition: 'toolbar',
546
556
  testId: 'spacePlugin.createSpace',
547
557
  },
@@ -561,8 +571,7 @@ export const SpacePlugin = ({
561
571
  },
562
572
  properties: {
563
573
  label: ['join space label', { ns: SPACE_PLUGIN }],
564
- icon: (props: IconProps) => <SignIn {...props} />,
565
- iconSymbol: 'ph--sign-in--regular',
574
+ icon: 'ph--sign-in--regular',
566
575
  testId: 'spacePlugin.joinSpace',
567
576
  },
568
577
  },
@@ -707,6 +716,52 @@ export const SpacePlugin = ({
707
716
  .filter(nonNullable);
708
717
  },
709
718
  }),
719
+
720
+ // Create nodes for object settings.
721
+ createExtension({
722
+ id: `${SPACE_PLUGIN}/settings-for-subject`,
723
+ resolver: ({ id }) => {
724
+ // TODO(Zan): Find util (or make one).
725
+ if (!id.endsWith('~settings')) {
726
+ return;
727
+ }
728
+
729
+ const [subjectId] = id.split('~');
730
+ const [spaceId, objectId] = parseFullyQualifiedId(subjectId);
731
+ const space = client.spaces.get().find((space) => space.id === spaceId);
732
+ const object = toSignal(
733
+ (onChange) => {
734
+ const timeout = setTimeout(async () => {
735
+ await space?.db.loadObjectById(objectId);
736
+ onChange();
737
+ });
738
+
739
+ return () => clearTimeout(timeout);
740
+ },
741
+ () => space?.db.getObjectById(objectId),
742
+ subjectId,
743
+ );
744
+ if (!object || !subjectId) {
745
+ return;
746
+ }
747
+
748
+ const meta = resolve(getTypename(object) ?? '');
749
+ const label = meta.label?.(object) ||
750
+ object.name ||
751
+ meta.placeholder || ['unnamed object settings label', { ns: SPACE_PLUGIN }];
752
+
753
+ return {
754
+ id,
755
+ type: 'orphan-settings-for-subject',
756
+ data: null,
757
+ properties: {
758
+ icon: 'ph--gear--regular',
759
+ label,
760
+ object,
761
+ },
762
+ };
763
+ },
764
+ }),
710
765
  ];
711
766
  },
712
767
  serializer: (plugins) => {
@@ -805,6 +860,15 @@ export const SpacePlugin = ({
805
860
  data: { space, id: space.id, activeParts: { main: [space.id] } },
806
861
 
807
862
  intents: [
863
+ ...(settings.values.onSpaceCreate
864
+ ? [
865
+ [
866
+ { action: settings.values.onSpaceCreate, data: { space } },
867
+ { action: SpaceAction.ADD_OBJECT, data: { target: space } },
868
+ { action: NavigationAction.EXPOSE },
869
+ ],
870
+ ]
871
+ : []),
808
872
  [
809
873
  {
810
874
  action: ObservabilityAction.SEND_EVENT,
@@ -1020,8 +1084,7 @@ export const SpacePlugin = ({
1020
1084
  title: translations[0]['en-US'][SPACE_PLUGIN]['space limit label'],
1021
1085
  description: translations[0]['en-US'][SPACE_PLUGIN]['space limit description'],
1022
1086
  duration: 5_000,
1023
- icon: (props: IconProps) => <Warning {...props} />,
1024
- iconSymbol: 'ph--warning--regular',
1087
+ icon: 'ph--warning--regular',
1025
1088
  actionLabel: translations[0]['en-US'][SPACE_PLUGIN]['remove deleted objects label'],
1026
1089
  actionAlt: translations[0]['en-US'][SPACE_PLUGIN]['remove deleted objects alt'],
1027
1090
  // TODO(wittjosiah): Use OS namespace.
@@ -1060,7 +1123,7 @@ export const SpacePlugin = ({
1060
1123
  }
1061
1124
 
1062
1125
  return {
1063
- data: { id: object.id, object, activeParts: { main: [fullyQualifiedId(object)] } },
1126
+ data: { id: fullyQualifiedId(object), object, activeParts: { main: [fullyQualifiedId(object)] } },
1064
1127
  intents: [
1065
1128
  [
1066
1129
  {
@@ -1115,7 +1178,6 @@ export const SpacePlugin = ({
1115
1178
  activeParts: {
1116
1179
  main: deletionData.wasActive,
1117
1180
  sidebar: deletionData.wasActive,
1118
- complementary: deletionData.wasActive,
1119
1181
  },
1120
1182
  },
1121
1183
  });
@@ -0,0 +1,35 @@
1
+ //
2
+ // Copyright 2024 DXOS.org
3
+ //
4
+
5
+ import React from 'react';
6
+
7
+ import { type EchoReactiveObject } from '@dxos/echo-schema';
8
+ import { Input, useTranslation } from '@dxos/react-ui';
9
+
10
+ import { SPACE_PLUGIN } from '../meta';
11
+
12
+ type FallbackSettingsProps = {
13
+ object: EchoReactiveObject<any>;
14
+ };
15
+
16
+ export const FallbackSettings = ({ object }: FallbackSettingsProps) => {
17
+ const { t } = useTranslation(SPACE_PLUGIN);
18
+
19
+ return (
20
+ <div role='form' className='p-3 flex flex-col gap-2'>
21
+ <div role='none' className='space-b-1'>
22
+ <Input.Root>
23
+ <Input.Label>{t('name label')}</Input.Label>
24
+ <Input.TextInput
25
+ placeholder={t('name placeholder')}
26
+ value={object.name}
27
+ onChange={(event) => {
28
+ object.name = event.target.value;
29
+ }}
30
+ />
31
+ </Input.Root>
32
+ </div>
33
+ </div>
34
+ );
35
+ };
@@ -1,6 +1,7 @@
1
1
  //
2
2
  // Copyright 2024 DXOS.org
3
3
  //
4
+
4
5
  import { Planet } from '@phosphor-icons/react';
5
6
  import React from 'react';
6
7