@dxos/plugin-space 0.7.4 → 0.7.5-main.499c70c

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 (120) hide show
  1. package/dist/lib/browser/chunk-54VE4GTA.mjs +315 -0
  2. package/dist/lib/browser/chunk-54VE4GTA.mjs.map +7 -0
  3. package/dist/lib/browser/chunk-73BCBSLP.mjs +15 -0
  4. package/dist/lib/browser/chunk-73BCBSLP.mjs.map +7 -0
  5. package/dist/lib/browser/index.mjs +928 -962
  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 -5
  9. package/dist/lib/browser/types/index.mjs +8 -1
  10. package/dist/lib/node/chunk-46S3JOES.cjs +39 -0
  11. package/dist/lib/node/chunk-46S3JOES.cjs.map +7 -0
  12. package/dist/lib/node/chunk-YF2AQ7KP.cjs +343 -0
  13. package/dist/lib/node/chunk-YF2AQ7KP.cjs.map +7 -0
  14. package/dist/lib/node/index.cjs +1053 -1086
  15. package/dist/lib/node/index.cjs.map +4 -4
  16. package/dist/lib/node/meta.cjs +5 -9
  17. package/dist/lib/node/meta.cjs.map +2 -2
  18. package/dist/lib/node/meta.json +1 -1
  19. package/dist/lib/node/types/index.cjs +19 -12
  20. package/dist/lib/node/types/index.cjs.map +2 -2
  21. package/dist/lib/node-esm/chunk-2MNFEB23.mjs +17 -0
  22. package/dist/lib/node-esm/chunk-2MNFEB23.mjs.map +7 -0
  23. package/dist/lib/node-esm/chunk-CDZETPO7.mjs +316 -0
  24. package/dist/lib/node-esm/chunk-CDZETPO7.mjs.map +7 -0
  25. package/dist/lib/node-esm/index.mjs +928 -962
  26. package/dist/lib/node-esm/index.mjs.map +4 -4
  27. package/dist/lib/node-esm/meta.json +1 -1
  28. package/dist/lib/node-esm/meta.mjs +1 -5
  29. package/dist/lib/node-esm/types/index.mjs +8 -1
  30. package/dist/types/src/SpacePlugin.d.ts +2 -2
  31. package/dist/types/src/SpacePlugin.d.ts.map +1 -1
  32. package/dist/types/src/components/AwaitingObject.d.ts.map +1 -1
  33. package/dist/types/src/components/CreateDialog/CreateObjectDialog.d.ts +4 -2
  34. package/dist/types/src/components/CreateDialog/CreateObjectDialog.d.ts.map +1 -1
  35. package/dist/types/src/components/CreateDialog/CreateObjectPanel.d.ts +3 -3
  36. package/dist/types/src/components/CreateDialog/CreateObjectPanel.d.ts.map +1 -1
  37. package/dist/types/src/components/CreateDialog/CreateSpaceDialog.d.ts +1 -0
  38. package/dist/types/src/components/CreateDialog/CreateSpaceDialog.d.ts.map +1 -1
  39. package/dist/types/src/components/JoinDialog.d.ts +1 -0
  40. package/dist/types/src/components/JoinDialog.d.ts.map +1 -1
  41. package/dist/types/src/components/PopoverRenameObject.d.ts +1 -0
  42. package/dist/types/src/components/PopoverRenameObject.d.ts.map +1 -1
  43. package/dist/types/src/components/PopoverRenameSpace.d.ts +1 -0
  44. package/dist/types/src/components/PopoverRenameSpace.d.ts.map +1 -1
  45. package/dist/types/src/components/ShareSpaceButton.d.ts.map +1 -1
  46. package/dist/types/src/components/SpacePluginSettings.d.ts.map +1 -1
  47. package/dist/types/src/components/SpacePresence.d.ts +9 -6
  48. package/dist/types/src/components/SpacePresence.d.ts.map +1 -1
  49. package/dist/types/src/components/SpacePresence.stories.d.ts +1 -1
  50. package/dist/types/src/components/SpacePresence.stories.d.ts.map +1 -1
  51. package/dist/types/src/components/SpaceSettings/SpaceSettingsDialog.d.ts +1 -0
  52. package/dist/types/src/components/SpaceSettings/SpaceSettingsDialog.d.ts.map +1 -1
  53. package/dist/types/src/components/SpaceSettings/SpaceSettingsDialog.stories.d.ts.map +1 -1
  54. package/dist/types/src/components/SpaceSettings/SpaceSettingsPanel.d.ts +4 -3
  55. package/dist/types/src/components/SpaceSettings/SpaceSettingsPanel.d.ts.map +1 -1
  56. package/dist/types/src/components/SpaceSettings/SpaceSettingsPanel.stories.d.ts.map +1 -1
  57. package/dist/types/src/components/SyncStatus/InlineSyncStatus.d.ts +3 -3
  58. package/dist/types/src/components/SyncStatus/InlineSyncStatus.d.ts.map +1 -1
  59. package/dist/types/src/components/SyncStatus/SyncStatusDetail.stories.d.ts +2 -2
  60. package/dist/types/src/components/SyncStatus/SyncStatusDetail.stories.d.ts.map +1 -1
  61. package/dist/types/src/hooks/index.d.ts +2 -0
  62. package/dist/types/src/hooks/index.d.ts.map +1 -0
  63. package/dist/types/src/hooks/usePath.d.ts +11 -0
  64. package/dist/types/src/hooks/usePath.d.ts.map +1 -0
  65. package/dist/types/src/meta.d.ts +0 -23
  66. package/dist/types/src/meta.d.ts.map +1 -1
  67. package/dist/types/src/translations.d.ts +6 -3
  68. package/dist/types/src/translations.d.ts.map +1 -1
  69. package/dist/types/src/types/collection.d.ts +8 -12
  70. package/dist/types/src/types/collection.d.ts.map +1 -1
  71. package/dist/types/src/types/thread.d.ts +180 -186
  72. package/dist/types/src/types/thread.d.ts.map +1 -1
  73. package/dist/types/src/types/types.d.ts +234 -4
  74. package/dist/types/src/types/types.d.ts.map +1 -1
  75. package/dist/types/src/util.d.ts +3 -3
  76. package/dist/types/src/util.d.ts.map +1 -1
  77. package/dist/types/tsconfig.tsbuildinfo +1 -0
  78. package/package.json +39 -38
  79. package/src/SpacePlugin.tsx +477 -602
  80. package/src/components/AwaitingObject.tsx +19 -17
  81. package/src/components/CreateDialog/CreateObjectDialog.tsx +33 -22
  82. package/src/components/CreateDialog/CreateObjectPanel.tsx +7 -7
  83. package/src/components/CreateDialog/CreateSpaceDialog.tsx +10 -14
  84. package/src/components/JoinDialog.tsx +18 -34
  85. package/src/components/PersistenceStatus.tsx +1 -1
  86. package/src/components/PopoverRenameObject.tsx +2 -0
  87. package/src/components/PopoverRenameSpace.tsx +2 -0
  88. package/src/components/ShareSpaceButton.tsx +5 -4
  89. package/src/components/SpacePluginSettings.tsx +5 -11
  90. package/src/components/SpacePresence.stories.tsx +25 -17
  91. package/src/components/SpacePresence.tsx +36 -16
  92. package/src/components/SpaceSettings/SpaceSettingsDialog.stories.tsx +2 -3
  93. package/src/components/SpaceSettings/SpaceSettingsDialog.tsx +3 -1
  94. package/src/components/SpaceSettings/SpaceSettingsPanel.stories.tsx +7 -5
  95. package/src/components/SpaceSettings/SpaceSettingsPanel.tsx +6 -5
  96. package/src/components/SyncStatus/InlineSyncStatus.tsx +37 -27
  97. package/src/components/SyncStatus/SyncStatusDetail.stories.tsx +55 -51
  98. package/src/hooks/index.ts +5 -0
  99. package/src/hooks/usePath.ts +44 -0
  100. package/src/meta.ts +0 -26
  101. package/src/translations.ts +3 -2
  102. package/src/types/collection.ts +3 -3
  103. package/src/types/thread.ts +6 -6
  104. package/src/types/types.ts +182 -13
  105. package/src/util.tsx +59 -52
  106. package/dist/lib/browser/chunk-FTKV32QZ.mjs +0 -43
  107. package/dist/lib/browser/chunk-FTKV32QZ.mjs.map +0 -7
  108. package/dist/lib/browser/chunk-MWKXNS5S.mjs +0 -124
  109. package/dist/lib/browser/chunk-MWKXNS5S.mjs.map +0 -7
  110. package/dist/lib/node/chunk-6SNOZF7Y.cjs +0 -152
  111. package/dist/lib/node/chunk-6SNOZF7Y.cjs.map +0 -7
  112. package/dist/lib/node/chunk-QNVEU2UD.cjs +0 -69
  113. package/dist/lib/node/chunk-QNVEU2UD.cjs.map +0 -7
  114. package/dist/lib/node-esm/chunk-OHEAWSCA.mjs +0 -126
  115. package/dist/lib/node-esm/chunk-OHEAWSCA.mjs.map +0 -7
  116. package/dist/lib/node-esm/chunk-UMV7XREB.mjs +0 -45
  117. package/dist/lib/node-esm/chunk-UMV7XREB.mjs.map +0 -7
  118. package/dist/types/src/components/SyncStatus/InlineSyncStatus.stories.d.ts +0 -6
  119. package/dist/types/src/components/SyncStatus/InlineSyncStatus.stories.d.ts.map +0 -1
  120. package/src/components/SyncStatus/InlineSyncStatus.stories.tsx +0 -57
@@ -28,40 +28,46 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
28
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
29
  var node_exports = {};
30
30
  __export(node_exports, {
31
- ActorSchema: () => import_chunk_6SNOZF7Y.ActorSchema,
31
+ ActorSchema: () => import_chunk_YF2AQ7KP.ActorSchema,
32
32
  AwaitingObject: () => AwaitingObject,
33
33
  COMPOSER_SPACE_LOCK: () => COMPOSER_SPACE_LOCK,
34
- ChannelType: () => import_chunk_6SNOZF7Y.ChannelType,
35
- CollectionAction: () => import_chunk_QNVEU2UD.CollectionAction,
34
+ CREATE_OBJECT_DIALOG: () => CREATE_OBJECT_DIALOG,
35
+ CREATE_SPACE_DIALOG: () => CREATE_SPACE_DIALOG,
36
+ ChannelType: () => import_chunk_YF2AQ7KP.ChannelType,
37
+ CollectionAction: () => import_chunk_YF2AQ7KP.CollectionAction,
36
38
  CollectionMain: () => CollectionMain,
37
39
  CollectionSection: () => CollectionSection,
38
- CollectionType: () => import_chunk_6SNOZF7Y.CollectionType,
39
- ContactType: () => import_chunk_6SNOZF7Y.ContactType,
40
+ CollectionType: () => import_chunk_YF2AQ7KP.CollectionType,
41
+ ContactType: () => import_chunk_YF2AQ7KP.ContactType,
40
42
  CreateObjectDialog: () => CreateObjectDialog,
41
43
  CreateSpaceDialog: () => CreateSpaceDialog,
42
44
  DefaultObjectSettings: () => DefaultObjectSettings,
43
45
  FullPresence: () => FullPresence,
44
46
  InlineSyncStatus: () => InlineSyncStatus,
45
- InlineSyncStatusIndicator: () => InlineSyncStatusIndicator,
47
+ JOIN_DIALOG: () => JOIN_DIALOG,
46
48
  JoinDialog: () => JoinDialog,
47
49
  MenuFooter: () => MenuFooter,
48
- MessageState: () => import_chunk_6SNOZF7Y.MessageState,
49
- MessageType: () => import_chunk_6SNOZF7Y.MessageType,
50
+ MessageState: () => import_chunk_YF2AQ7KP.MessageState,
51
+ MessageType: () => import_chunk_YF2AQ7KP.MessageType,
52
+ POPOVER_RENAME_OBJECT: () => POPOVER_RENAME_OBJECT,
53
+ POPOVER_RENAME_SPACE: () => POPOVER_RENAME_SPACE,
50
54
  PersistenceStatus: () => PersistenceStatus,
51
55
  PopoverRenameObject: () => PopoverRenameObject,
52
56
  PopoverRenameSpace: () => PopoverRenameSpace,
53
57
  SHARED: () => SHARED,
54
58
  SPACES: () => SPACES,
55
- SPACE_DIRECTORY_HANDLE: () => import_chunk_6SNOZF7Y.SPACE_DIRECTORY_HANDLE,
56
- SPACE_PLUGIN: () => import_chunk_QNVEU2UD.SPACE_PLUGIN,
57
- SPACE_PLUGIN_SHORT_ID: () => import_chunk_QNVEU2UD.SPACE_PLUGIN_SHORT_ID,
59
+ SPACE_ACTION: () => import_chunk_YF2AQ7KP.SPACE_ACTION,
60
+ SPACE_DIRECTORY_HANDLE: () => import_chunk_YF2AQ7KP.SPACE_DIRECTORY_HANDLE,
61
+ SPACE_PLUGIN: () => import_chunk_46S3JOES.SPACE_PLUGIN,
62
+ SPACE_PLUGIN_SHORT_ID: () => import_chunk_46S3JOES.SPACE_PLUGIN_SHORT_ID,
63
+ SPACE_SETTINGS_DIALOG: () => SPACE_SETTINGS_DIALOG,
58
64
  SPACE_TYPE: () => SPACE_TYPE,
59
65
  ShareSpaceButton: () => ShareSpaceButton,
60
66
  ShareSpaceButtonImpl: () => ShareSpaceButtonImpl,
61
67
  SmallPresence: () => SmallPresence,
62
68
  SmallPresenceLive: () => SmallPresenceLive,
63
- SpaceAction: () => import_chunk_QNVEU2UD.SpaceAction,
64
- SpaceForm: () => import_chunk_6SNOZF7Y.SpaceForm,
69
+ SpaceAction: () => import_chunk_YF2AQ7KP.SpaceAction,
70
+ SpaceForm: () => import_chunk_YF2AQ7KP.SpaceForm,
65
71
  SpacePlugin: () => SpacePlugin,
66
72
  SpacePluginSettings: () => SpacePluginSettings,
67
73
  SpacePresence: () => SpacePresence,
@@ -70,8 +76,8 @@ __export(node_exports, {
70
76
  SyncStatus: () => SyncStatus,
71
77
  SyncStatusDetail: () => SyncStatusDetail,
72
78
  SyncStatusIndicator: () => SyncStatusIndicator,
73
- ThreadStatus: () => import_chunk_6SNOZF7Y.ThreadStatus,
74
- ThreadType: () => import_chunk_6SNOZF7Y.ThreadType,
79
+ ThreadStatus: () => import_chunk_YF2AQ7KP.ThreadStatus,
80
+ ThreadType: () => import_chunk_YF2AQ7KP.ThreadType,
75
81
  cloneObject: () => cloneObject,
76
82
  constructObjectActions: () => constructObjectActions,
77
83
  constructSpaceActions: () => constructSpaceActions,
@@ -82,18 +88,17 @@ __export(node_exports, {
82
88
  getNestedObjects: () => getNestedObjects,
83
89
  getSpaceDisplayName: () => getSpaceDisplayName,
84
90
  memoizeQuery: () => memoizeQuery,
85
- parseSchemaPlugin: () => import_chunk_6SNOZF7Y.parseSchemaPlugin,
91
+ parseSchemaPlugin: () => import_chunk_YF2AQ7KP.parseSchemaPlugin,
86
92
  parseSpacePlugin: () => parseSpacePlugin,
87
93
  translations: () => translations_default
88
94
  });
89
95
  module.exports = __toCommonJS(node_exports);
90
- var import_chunk_QNVEU2UD = require("./chunk-QNVEU2UD.cjs");
91
- var import_chunk_6SNOZF7Y = require("./chunk-6SNOZF7Y.cjs");
96
+ var import_chunk_YF2AQ7KP = require("./chunk-YF2AQ7KP.cjs");
97
+ var import_chunk_46S3JOES = require("./chunk-46S3JOES.cjs");
92
98
  var import_signals_core = require("@preact/signals-core");
93
99
  var import_react = __toESM(require("react"));
94
100
  var import_app_framework = require("@dxos/app-framework");
95
101
  var import_async = require("@dxos/async");
96
- var import_echo_schema = require("@dxos/echo-schema");
97
102
  var import_core = require("@dxos/echo-signals/core");
98
103
  var import_invariant = require("@dxos/invariant");
99
104
  var import_live_object = require("@dxos/live-object");
@@ -101,9 +106,9 @@ var import_local_storage = require("@dxos/local-storage");
101
106
  var import_log = require("@dxos/log");
102
107
  var import_migrations = require("@dxos/migrations");
103
108
  var import_plugin_attention = require("@dxos/plugin-attention");
104
- var import_plugin_client = require("@dxos/plugin-client");
109
+ var import_types = require("@dxos/plugin-client/types");
105
110
  var import_plugin_graph = require("@dxos/plugin-graph");
106
- var import_meta = require("@dxos/plugin-observability/meta");
111
+ var import_types2 = require("@dxos/plugin-observability/types");
107
112
  var import_metadata = require("@dxos/protocols/proto/dxos/echo/metadata");
108
113
  var import_react_client = require("@dxos/react-client");
109
114
  var import_echo = require("@dxos/react-client/echo");
@@ -116,26 +121,28 @@ var import_react_client2 = require("@dxos/react-client");
116
121
  var import_echo2 = require("@dxos/react-client/echo");
117
122
  var import_react_ui = require("@dxos/react-ui");
118
123
  var import_react_ui_theme = require("@dxos/react-ui-theme");
124
+ var import_effect = require("effect");
119
125
  var import_react5 = __toESM(require("react"));
120
126
  var import_app_framework3 = require("@dxos/app-framework");
121
127
  var import_react_client3 = require("@dxos/react-client");
122
128
  var import_echo3 = require("@dxos/react-client/echo");
123
129
  var import_react_ui2 = require("@dxos/react-ui");
124
130
  var import_react6 = __toESM(require("react"));
125
- var import_echo_schema2 = require("@dxos/echo-schema");
131
+ var import_echo_schema = require("@dxos/echo-schema");
126
132
  var import_echo4 = require("@dxos/react-client/echo");
127
133
  var import_react_ui3 = require("@dxos/react-ui");
128
134
  var import_react_ui_form = require("@dxos/react-ui-form");
129
135
  var import_react_ui_searchlist = require("@dxos/react-ui-searchlist");
130
136
  var import_util2 = require("@dxos/util");
131
- var import_echo_schema3 = require("@dxos/echo-schema");
137
+ var import_app_framework4 = require("@dxos/app-framework");
138
+ var import_echo_schema2 = require("@dxos/echo-schema");
132
139
  var import_invariant2 = require("@dxos/invariant");
133
140
  var import_live_object2 = require("@dxos/live-object");
134
141
  var import_migrations2 = require("@dxos/migrations");
135
142
  var import_plugin_graph2 = require("@dxos/plugin-graph");
136
143
  var import_echo5 = require("@dxos/react-client/echo");
137
144
  var import_react7 = __toESM(require("react"));
138
- var import_app_framework4 = require("@dxos/app-framework");
145
+ var import_app_framework5 = require("@dxos/app-framework");
139
146
  var import_react_ui4 = require("@dxos/react-ui");
140
147
  var import_react_ui_form2 = require("@dxos/react-ui-form");
141
148
  var import_react8 = __toESM(require("react"));
@@ -146,9 +153,9 @@ var import_react_ui6 = require("@dxos/react-ui");
146
153
  var import_react10 = __toESM(require("react"));
147
154
  var import_react_ui7 = require("@dxos/react-ui");
148
155
  var import_react11 = __toESM(require("react"));
149
- var import_app_framework5 = require("@dxos/app-framework");
156
+ var import_app_framework6 = require("@dxos/app-framework");
150
157
  var import_plugin_graph3 = require("@dxos/plugin-graph");
151
- var import_meta2 = require("@dxos/plugin-observability/meta");
158
+ var import_types3 = require("@dxos/plugin-observability/types");
152
159
  var import_echo6 = require("@dxos/react-client/echo");
153
160
  var import_react_ui8 = require("@dxos/react-ui");
154
161
  var import_react12 = require("@dxos/shell/react");
@@ -168,52 +175,57 @@ var import_react_ui11 = require("@dxos/react-ui");
168
175
  var import_react18 = __toESM(require("react"));
169
176
  var import_react_ui12 = require("@dxos/react-ui");
170
177
  var import_react19 = __toESM(require("react"));
171
- var import_app_framework6 = require("@dxos/app-framework");
178
+ var import_app_framework7 = require("@dxos/app-framework");
172
179
  var import_react_ui13 = require("@dxos/react-ui");
173
180
  var import_react20 = __toESM(require("react"));
174
- var import_app_framework7 = require("@dxos/app-framework");
181
+ var import_app_framework8 = require("@dxos/app-framework");
175
182
  var import_display_name = require("@dxos/display-name");
183
+ var import_plugin_graph4 = require("@dxos/plugin-graph");
176
184
  var import_react_client5 = require("@dxos/react-client");
177
185
  var import_echo8 = require("@dxos/react-client/echo");
178
186
  var import_halo = require("@dxos/react-client/halo");
179
187
  var import_react_ui14 = require("@dxos/react-ui");
180
188
  var import_react_ui_attention = require("@dxos/react-ui-attention");
181
189
  var import_util3 = require("@dxos/util");
182
- var import_react21 = __toESM(require("react"));
183
- var import_app_framework8 = require("@dxos/app-framework");
190
+ var import_react21 = require("react");
191
+ var import_react22 = __toESM(require("react"));
192
+ var import_app_framework9 = require("@dxos/app-framework");
184
193
  var import_react_ui15 = require("@dxos/react-ui");
185
194
  var import_react_ui_form3 = require("@dxos/react-ui-form");
186
- var import_react22 = __toESM(require("react"));
195
+ var import_react23 = __toESM(require("react"));
187
196
  var import_react_client6 = require("@dxos/react-client");
188
197
  var import_react_ui16 = require("@dxos/react-ui");
189
198
  var import_react_ui_tabs = require("@dxos/react-ui-tabs");
190
- var import_react23 = require("@dxos/shell/react");
191
- var import_react24 = __toESM(require("react"));
199
+ var import_react24 = require("@dxos/shell/react");
200
+ var import_react25 = __toESM(require("react"));
192
201
  var import_log3 = require("@dxos/log");
193
202
  var import_metadata2 = require("@dxos/protocols/proto/dxos/echo/metadata");
194
203
  var import_react_client7 = require("@dxos/react-client");
195
204
  var import_react_ui17 = require("@dxos/react-ui");
196
205
  var import_react_ui_form4 = require("@dxos/react-ui-form");
197
- var import_react25 = __toESM(require("react"));
206
+ var import_react_ui_theme4 = require("@dxos/react-ui-theme");
207
+ var import_react26 = __toESM(require("react"));
208
+ var import_plugin_graph5 = require("@dxos/plugin-graph");
198
209
  var import_services = require("@dxos/protocols/proto/dxos/client/services");
199
210
  var import_metadata3 = require("@dxos/protocols/proto/dxos/echo/metadata");
200
211
  var import_react_client8 = require("@dxos/react-client");
201
212
  var import_react_ui18 = require("@dxos/react-ui");
202
- var import_react26 = require("react");
213
+ var import_react_ui_attention2 = require("@dxos/react-ui-attention");
214
+ var import_react27 = require("react");
203
215
  var import_context = require("@dxos/context");
204
216
  var import_protocols = require("@dxos/protocols");
205
217
  var import_react_client9 = require("@dxos/react-client");
206
- var import_react27 = __toESM(require("react"));
218
+ var import_react28 = __toESM(require("react"));
207
219
  var import_plugin_status_bar = require("@dxos/plugin-status-bar");
208
220
  var import_react_client10 = require("@dxos/react-client");
209
221
  var import_react_ui19 = require("@dxos/react-ui");
210
222
  var import_react_ui_syntax_highlighter = require("@dxos/react-ui-syntax-highlighter");
211
- var import_react_ui_theme4 = require("@dxos/react-ui-theme");
212
- var import_react28 = __toESM(require("react"));
223
+ var import_react_ui_theme5 = require("@dxos/react-ui-theme");
224
+ var import_react29 = __toESM(require("react"));
213
225
  var import_react_client11 = require("@dxos/react-client");
214
226
  var import_echo9 = require("@dxos/react-client/echo");
215
227
  var import_react_ui20 = require("@dxos/react-ui");
216
- var import_react_ui_theme5 = require("@dxos/react-ui-theme");
228
+ var import_react_ui_theme6 = require("@dxos/react-ui-theme");
217
229
  var import_context2 = require("@dxos/context");
218
230
  var WAIT_FOR_OBJECT_TIMEOUT = 18e4;
219
231
  var TOAST_TIMEOUT = 24e4;
@@ -221,8 +233,8 @@ var AwaitingObject = ({ id }) => {
221
233
  const [open, setOpen] = (0, import_react4.useState)(true);
222
234
  const [waiting, setWaiting] = (0, import_react4.useState)(true);
223
235
  const [found, setFound] = (0, import_react4.useState)(false);
224
- const { t } = (0, import_react_ui.useTranslation)(import_chunk_QNVEU2UD.SPACE_PLUGIN);
225
- const intentPlugin = (0, import_app_framework2.useResolvePlugin)(import_app_framework2.parseIntentPlugin);
236
+ const { t } = (0, import_react_ui.useTranslation)(import_chunk_46S3JOES.SPACE_PLUGIN);
237
+ const { dispatchPromise: dispatch } = (0, import_app_framework2.useIntentDispatcher)();
226
238
  const navigationPlugin = (0, import_app_framework2.useResolvePlugin)(import_app_framework2.parseNavigationPlugin);
227
239
  const client = (0, import_react_client2.useClient)();
228
240
  const objects = (0, import_echo2.useQuery)(client.spaces, import_echo2.Filter.all());
@@ -247,28 +259,27 @@ var AwaitingObject = ({ id }) => {
247
259
  }, [
248
260
  id,
249
261
  objects,
250
- intentPlugin
262
+ navigationPlugin
251
263
  ]);
252
- const handleClose = async () => intentPlugin?.provides.intent.dispatch({
253
- plugin: import_chunk_QNVEU2UD.SPACE_PLUGIN,
254
- action: import_chunk_QNVEU2UD.SpaceAction.WAIT_FOR_OBJECT,
255
- data: {
256
- id: void 0
257
- }
258
- });
259
- const handleNavigate = () => {
260
- void intentPlugin?.provides.intent.dispatch({
261
- action: import_app_framework2.NavigationAction.OPEN,
262
- data: {
263
- activeParts: {
264
- main: [
265
- id
266
- ]
267
- }
264
+ const handleClose = (0, import_react4.useCallback)(async () => dispatch((0, import_app_framework2.createIntent)(import_chunk_YF2AQ7KP.SpaceAction.WaitForObject, {
265
+ id: void 0
266
+ })), [
267
+ dispatch
268
+ ]);
269
+ const handleNavigate = (0, import_react4.useCallback)(() => {
270
+ void dispatch((0, import_app_framework2.createIntent)(import_app_framework2.NavigationAction.Open, {
271
+ activeParts: {
272
+ main: [
273
+ id
274
+ ]
268
275
  }
269
- });
276
+ }));
270
277
  void handleClose();
271
- };
278
+ }, [
279
+ id,
280
+ handleClose,
281
+ dispatch
282
+ ]);
272
283
  return /* @__PURE__ */ import_react4.default.createElement(import_react_ui.Toast.Root, {
273
284
  open,
274
285
  duration: TOAST_TIMEOUT,
@@ -302,7 +313,7 @@ var AwaitingObject = ({ id }) => {
302
313
  })))));
303
314
  };
304
315
  var __dxlog_file = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/util.tsx";
305
- var SPACES = `${import_chunk_QNVEU2UD.SPACE_PLUGIN}-spaces`;
316
+ var SPACES = `${import_chunk_46S3JOES.SPACE_PLUGIN}-spaces`;
306
317
  var SPACE_TYPE = "dxos.org/type/Space";
307
318
  var COMPOSER_SPACE_LOCK = "dxos.org/plugin/space/lock";
308
319
  var SHARED = "shared-spaces";
@@ -321,12 +332,12 @@ var getSpaceDisplayName = (space, { personal, namesCache = {} } = {}) => {
321
332
  return space.state.get() === import_echo5.SpaceState.SPACE_READY && (space.properties.name?.length ?? 0) > 0 ? space.properties.name : namesCache[space.id] ? namesCache[space.id] : personal ? [
322
333
  "personal space label",
323
334
  {
324
- ns: import_chunk_QNVEU2UD.SPACE_PLUGIN
335
+ ns: import_chunk_46S3JOES.SPACE_PLUGIN
325
336
  }
326
337
  ] : [
327
338
  "unnamed space label",
328
339
  {
329
- ns: import_chunk_QNVEU2UD.SPACE_PLUGIN
340
+ ns: import_chunk_46S3JOES.SPACE_PLUGIN
330
341
  }
331
342
  ];
332
343
  };
@@ -341,19 +352,19 @@ var getCollectionGraphNodePartials = ({ navigable, collection, space, resolve })
341
352
  ]),
342
353
  role: "branch",
343
354
  onRearrangeChildren: (nextOrder) => {
344
- collection.objects = nextOrder.filter(import_echo5.isEchoObject);
355
+ collection.objects = nextOrder.filter(import_echo5.isEchoObject).map(import_live_object2.makeRef);
345
356
  },
346
357
  onTransferStart: (child, index) => {
347
- if (!collection.objects.includes(child.data)) {
358
+ if (!collection.objects.find((object) => object.target === child.data)) {
348
359
  if (typeof index !== "undefined") {
349
- collection.objects.splice(index, 0, child.data);
360
+ collection.objects.splice(index, 0, (0, import_live_object2.makeRef)(child.data));
350
361
  } else {
351
- collection.objects.push(child.data);
362
+ collection.objects.push((0, import_live_object2.makeRef)(child.data));
352
363
  }
353
364
  }
354
365
  },
355
366
  onTransferEnd: (child, destination) => {
356
- const index = collection.objects.indexOf(child.data);
367
+ const index = collection.objects.findIndex((object) => object.target === child.data);
357
368
  if (index > -1) {
358
369
  collection.objects.splice(index, 1);
359
370
  }
@@ -362,9 +373,9 @@ var getCollectionGraphNodePartials = ({ navigable, collection, space, resolve })
362
373
  const newObject = await cloneObject(child.data, resolve, space);
363
374
  space.db.add(newObject);
364
375
  if (typeof index !== "undefined") {
365
- collection.objects.splice(index, 0, newObject);
376
+ collection.objects.splice(index, 0, (0, import_live_object2.makeRef)(newObject));
366
377
  } else {
367
- collection.objects.push(newObject);
378
+ collection.objects.push((0, import_live_object2.makeRef)(newObject));
368
379
  }
369
380
  }
370
381
  };
@@ -374,8 +385,8 @@ var checkPendingMigration = (space) => {
374
385
  };
375
386
  var constructSpaceNode = ({ space, navigable = false, personal, namesCache, resolve }) => {
376
387
  const hasPendingMigration = checkPendingMigration(space);
377
- const collection = space.state.get() === import_echo5.SpaceState.SPACE_READY && space.properties[import_chunk_6SNOZF7Y.CollectionType.typename];
378
- const partials = space.state.get() === import_echo5.SpaceState.SPACE_READY && collection instanceof import_chunk_6SNOZF7Y.CollectionType ? getCollectionGraphNodePartials({
388
+ const collection = space.state.get() === import_echo5.SpaceState.SPACE_READY && space.properties[import_chunk_YF2AQ7KP.CollectionType.typename]?.target;
389
+ const partials = space.state.get() === import_echo5.SpaceState.SPACE_READY && collection instanceof import_chunk_YF2AQ7KP.CollectionType ? getCollectionGraphNodePartials({
379
390
  collection,
380
391
  space,
381
392
  resolve,
@@ -410,22 +421,18 @@ var constructSpaceActions = ({ space, dispatch, personal, migrating }) => {
410
421
  const actions = [];
411
422
  if (hasPendingMigration) {
412
423
  actions.push({
413
- id: getId(import_chunk_QNVEU2UD.SpaceAction.MIGRATE),
424
+ id: getId(import_chunk_YF2AQ7KP.SpaceAction.Migrate._tag),
414
425
  type: import_plugin_graph2.ACTION_GROUP_TYPE,
415
426
  data: async () => {
416
- await dispatch({
417
- plugin: import_chunk_QNVEU2UD.SPACE_PLUGIN,
418
- action: import_chunk_QNVEU2UD.SpaceAction.MIGRATE,
419
- data: {
420
- space
421
- }
422
- });
427
+ await dispatch((0, import_app_framework4.createIntent)(import_chunk_YF2AQ7KP.SpaceAction.Migrate, {
428
+ space
429
+ }));
423
430
  },
424
431
  properties: {
425
432
  label: [
426
433
  "migrate space label",
427
434
  {
428
- ns: import_chunk_QNVEU2UD.SPACE_PLUGIN
435
+ ns: import_chunk_46S3JOES.SPACE_PLUGIN
429
436
  }
430
437
  ],
431
438
  icon: "ph--database--regular",
@@ -437,22 +444,18 @@ var constructSpaceActions = ({ space, dispatch, personal, migrating }) => {
437
444
  if (state === import_echo5.SpaceState.SPACE_READY && !hasPendingMigration) {
438
445
  const locked = space.properties[COMPOSER_SPACE_LOCK];
439
446
  actions.push({
440
- id: getId(import_chunk_QNVEU2UD.SpaceAction.OPEN_CREATE_OBJECT),
447
+ id: getId(import_chunk_YF2AQ7KP.SpaceAction.OpenCreateObject._tag),
441
448
  type: import_plugin_graph2.ACTION_TYPE,
442
449
  data: async () => {
443
- await dispatch({
444
- plugin: import_chunk_QNVEU2UD.SPACE_PLUGIN,
445
- action: import_chunk_QNVEU2UD.SpaceAction.OPEN_CREATE_OBJECT,
446
- data: {
447
- target: space
448
- }
449
- });
450
+ await dispatch((0, import_app_framework4.createIntent)(import_chunk_YF2AQ7KP.SpaceAction.OpenCreateObject, {
451
+ target: space
452
+ }));
450
453
  },
451
454
  properties: {
452
455
  label: [
453
456
  "create object in space label",
454
457
  {
455
- ns: import_chunk_QNVEU2UD.SPACE_PLUGIN
458
+ ns: import_chunk_46S3JOES.SPACE_PLUGIN
456
459
  }
457
460
  ],
458
461
  icon: "ph--plus--regular",
@@ -460,25 +463,21 @@ var constructSpaceActions = ({ space, dispatch, personal, migrating }) => {
460
463
  testId: "spacePlugin.createObject"
461
464
  }
462
465
  }, {
463
- id: getId(import_chunk_QNVEU2UD.SpaceAction.SHARE),
466
+ id: getId(import_chunk_YF2AQ7KP.SpaceAction.Share._tag),
464
467
  type: import_plugin_graph2.ACTION_TYPE,
465
468
  data: async () => {
466
469
  if (locked) {
467
470
  return;
468
471
  }
469
- await dispatch({
470
- plugin: import_chunk_QNVEU2UD.SPACE_PLUGIN,
471
- action: import_chunk_QNVEU2UD.SpaceAction.SHARE,
472
- data: {
473
- space
474
- }
475
- });
472
+ await dispatch((0, import_app_framework4.createIntent)(import_chunk_YF2AQ7KP.SpaceAction.Share, {
473
+ space
474
+ }));
476
475
  },
477
476
  properties: {
478
477
  label: [
479
478
  "share space label",
480
479
  {
481
- ns: import_chunk_QNVEU2UD.SPACE_PLUGIN
480
+ ns: import_chunk_46S3JOES.SPACE_PLUGIN
482
481
  }
483
482
  ],
484
483
  icon: "ph--users--regular",
@@ -489,44 +488,42 @@ var constructSpaceActions = ({ space, dispatch, personal, migrating }) => {
489
488
  }
490
489
  }
491
490
  }, {
492
- id: locked ? getId(import_chunk_QNVEU2UD.SpaceAction.UNLOCK) : getId(import_chunk_QNVEU2UD.SpaceAction.LOCK),
491
+ id: locked ? getId(import_chunk_YF2AQ7KP.SpaceAction.Unlock._tag) : getId(import_chunk_YF2AQ7KP.SpaceAction.Lock._tag),
493
492
  type: import_plugin_graph2.ACTION_TYPE,
494
493
  data: async () => {
495
- await dispatch({
496
- plugin: import_chunk_QNVEU2UD.SPACE_PLUGIN,
497
- action: locked ? import_chunk_QNVEU2UD.SpaceAction.UNLOCK : import_chunk_QNVEU2UD.SpaceAction.LOCK,
498
- data: {
494
+ if (locked) {
495
+ await dispatch((0, import_app_framework4.createIntent)(import_chunk_YF2AQ7KP.SpaceAction.Unlock, {
499
496
  space
500
- }
501
- });
497
+ }));
498
+ } else {
499
+ await dispatch((0, import_app_framework4.createIntent)(import_chunk_YF2AQ7KP.SpaceAction.Lock, {
500
+ space
501
+ }));
502
+ }
502
503
  },
503
504
  properties: {
504
505
  label: [
505
506
  locked ? "unlock space label" : "lock space label",
506
507
  {
507
- ns: import_chunk_QNVEU2UD.SPACE_PLUGIN
508
+ ns: import_chunk_46S3JOES.SPACE_PLUGIN
508
509
  }
509
510
  ],
510
511
  icon: locked ? "ph--lock-simple-open--regular" : "ph--lock-simple--regular"
511
512
  }
512
513
  }, {
513
- id: getId(import_chunk_QNVEU2UD.SpaceAction.RENAME),
514
+ id: getId(import_chunk_YF2AQ7KP.SpaceAction.Rename._tag),
514
515
  type: import_plugin_graph2.ACTION_TYPE,
515
516
  data: async (params) => {
516
- await dispatch({
517
- plugin: import_chunk_QNVEU2UD.SPACE_PLUGIN,
518
- action: import_chunk_QNVEU2UD.SpaceAction.RENAME,
519
- data: {
520
- space,
521
- ...params
522
- }
523
- });
517
+ await dispatch((0, import_app_framework4.createIntent)(import_chunk_YF2AQ7KP.SpaceAction.Rename, {
518
+ space,
519
+ caller: params.caller
520
+ }));
524
521
  },
525
522
  properties: {
526
523
  label: [
527
524
  "rename space label",
528
525
  {
529
- ns: import_chunk_QNVEU2UD.SPACE_PLUGIN
526
+ ns: import_chunk_46S3JOES.SPACE_PLUGIN
530
527
  }
531
528
  ],
532
529
  icon: "ph--pencil-simple-line--regular",
@@ -536,22 +533,18 @@ var constructSpaceActions = ({ space, dispatch, personal, migrating }) => {
536
533
  }
537
534
  }
538
535
  }, {
539
- id: getId(import_chunk_QNVEU2UD.SpaceAction.OPEN_SETTINGS),
536
+ id: getId(import_chunk_YF2AQ7KP.SpaceAction.OpenSettings._tag),
540
537
  type: import_plugin_graph2.ACTION_TYPE,
541
538
  data: async () => {
542
- await dispatch({
543
- plugin: import_chunk_QNVEU2UD.SPACE_PLUGIN,
544
- action: import_chunk_QNVEU2UD.SpaceAction.OPEN_SETTINGS,
545
- data: {
546
- space
547
- }
548
- });
539
+ await dispatch((0, import_app_framework4.createIntent)(import_chunk_YF2AQ7KP.SpaceAction.OpenSettings, {
540
+ space
541
+ }));
549
542
  },
550
543
  properties: {
551
544
  label: [
552
545
  "open space settings label",
553
546
  {
554
- ns: import_chunk_QNVEU2UD.SPACE_PLUGIN
547
+ ns: import_chunk_46S3JOES.SPACE_PLUGIN
555
548
  }
556
549
  ],
557
550
  icon: "ph--gear--regular"
@@ -560,22 +553,18 @@ var constructSpaceActions = ({ space, dispatch, personal, migrating }) => {
560
553
  }
561
554
  if (state !== import_echo5.SpaceState.SPACE_INACTIVE && !hasPendingMigration) {
562
555
  actions.push({
563
- id: getId(import_chunk_QNVEU2UD.SpaceAction.CLOSE),
556
+ id: getId(import_chunk_YF2AQ7KP.SpaceAction.Close._tag),
564
557
  type: import_plugin_graph2.ACTION_TYPE,
565
558
  data: async () => {
566
- await dispatch({
567
- plugin: import_chunk_QNVEU2UD.SPACE_PLUGIN,
568
- action: import_chunk_QNVEU2UD.SpaceAction.CLOSE,
569
- data: {
570
- space
571
- }
572
- });
559
+ await dispatch((0, import_app_framework4.createIntent)(import_chunk_YF2AQ7KP.SpaceAction.Close, {
560
+ space
561
+ }));
573
562
  },
574
563
  properties: {
575
564
  label: [
576
565
  "close space label",
577
566
  {
578
- ns: import_chunk_QNVEU2UD.SPACE_PLUGIN
567
+ ns: import_chunk_46S3JOES.SPACE_PLUGIN
579
568
  }
580
569
  ],
581
570
  icon: "ph--x--regular",
@@ -585,22 +574,18 @@ var constructSpaceActions = ({ space, dispatch, personal, migrating }) => {
585
574
  }
586
575
  if (state === import_echo5.SpaceState.SPACE_INACTIVE) {
587
576
  actions.push({
588
- id: getId(import_chunk_QNVEU2UD.SpaceAction.OPEN),
577
+ id: getId(import_chunk_YF2AQ7KP.SpaceAction.Open._tag),
589
578
  type: import_plugin_graph2.ACTION_TYPE,
590
579
  data: async () => {
591
- await dispatch({
592
- plugin: import_chunk_QNVEU2UD.SPACE_PLUGIN,
593
- action: import_chunk_QNVEU2UD.SpaceAction.OPEN,
594
- data: {
595
- space
596
- }
597
- });
580
+ await dispatch((0, import_app_framework4.createIntent)(import_chunk_YF2AQ7KP.SpaceAction.Open, {
581
+ space
582
+ }));
598
583
  },
599
584
  properties: {
600
585
  label: [
601
586
  "open space label",
602
587
  {
603
- ns: import_chunk_QNVEU2UD.SPACE_PLUGIN
588
+ ns: import_chunk_46S3JOES.SPACE_PLUGIN
604
589
  }
605
590
  ],
606
591
  icon: "ph--clock-counter-clockwise--regular",
@@ -611,7 +596,7 @@ var constructSpaceActions = ({ space, dispatch, personal, migrating }) => {
611
596
  return actions;
612
597
  };
613
598
  var createObjectNode = ({ object, space, navigable = false, resolve }) => {
614
- const type = (0, import_echo_schema3.getTypename)(object);
599
+ const type = (0, import_echo_schema2.getTypename)(object);
615
600
  if (!type) {
616
601
  return void 0;
617
602
  }
@@ -619,7 +604,7 @@ var createObjectNode = ({ object, space, navigable = false, resolve }) => {
619
604
  if (Object.keys(metadata).length === 0) {
620
605
  return void 0;
621
606
  }
622
- const partials = object instanceof import_chunk_6SNOZF7Y.CollectionType ? getCollectionGraphNodePartials({
607
+ const partials = object instanceof import_chunk_YF2AQ7KP.CollectionType ? getCollectionGraphNodePartials({
623
608
  collection: object,
624
609
  space,
625
610
  resolve,
@@ -639,7 +624,7 @@ var createObjectNode = ({ object, space, navigable = false, resolve }) => {
639
624
  label: metadata.label?.(object) || object.name || metadata.placeholder || [
640
625
  "unnamed object label",
641
626
  {
642
- ns: import_chunk_QNVEU2UD.SPACE_PLUGIN
627
+ ns: import_chunk_46S3JOES.SPACE_PLUGIN
643
628
  }
644
629
  ],
645
630
  icon: metadata.icon ?? "ph--placeholder--regular",
@@ -653,24 +638,20 @@ var constructObjectActions = ({ node, dispatch }) => {
653
638
  const object = node.data;
654
639
  const getId = (id) => `${id}/${(0, import_echo5.fullyQualifiedId)(object)}`;
655
640
  const actions = [
656
- ...object instanceof import_chunk_6SNOZF7Y.CollectionType ? [
641
+ ...object instanceof import_chunk_YF2AQ7KP.CollectionType ? [
657
642
  {
658
- id: getId(import_chunk_QNVEU2UD.SpaceAction.ADD_OBJECT),
643
+ id: getId(import_chunk_YF2AQ7KP.SpaceAction.OpenCreateObject._tag),
659
644
  type: import_plugin_graph2.ACTION_TYPE,
660
645
  data: async () => {
661
- await dispatch({
662
- plugin: import_chunk_QNVEU2UD.SPACE_PLUGIN,
663
- action: import_chunk_QNVEU2UD.SpaceAction.OPEN_CREATE_OBJECT,
664
- data: {
665
- target: object
666
- }
667
- });
646
+ await dispatch((0, import_app_framework4.createIntent)(import_chunk_YF2AQ7KP.SpaceAction.OpenCreateObject, {
647
+ target: object
648
+ }));
668
649
  },
669
650
  properties: {
670
651
  label: [
671
652
  "create object in collection label",
672
653
  {
673
- ns: import_chunk_QNVEU2UD.SPACE_PLUGIN
654
+ ns: import_chunk_46S3JOES.SPACE_PLUGIN
674
655
  }
675
656
  ],
676
657
  icon: "ph--plus--regular",
@@ -680,22 +661,19 @@ var constructObjectActions = ({ node, dispatch }) => {
680
661
  }
681
662
  ] : [],
682
663
  {
683
- id: getId(import_chunk_QNVEU2UD.SpaceAction.RENAME_OBJECT),
664
+ id: getId(import_chunk_YF2AQ7KP.SpaceAction.RenameObject._tag),
684
665
  type: import_plugin_graph2.ACTION_TYPE,
685
666
  data: async (params) => {
686
- await dispatch({
687
- action: import_chunk_QNVEU2UD.SpaceAction.RENAME_OBJECT,
688
- data: {
689
- object,
690
- ...params
691
- }
692
- });
667
+ await dispatch((0, import_app_framework4.createIntent)(import_chunk_YF2AQ7KP.SpaceAction.RenameObject, {
668
+ object,
669
+ caller: params.caller
670
+ }));
693
671
  },
694
672
  properties: {
695
673
  label: [
696
- object instanceof import_chunk_6SNOZF7Y.CollectionType ? "rename collection label" : "rename object label",
674
+ object instanceof import_chunk_YF2AQ7KP.CollectionType ? "rename collection label" : "rename object label",
697
675
  {
698
- ns: import_chunk_QNVEU2UD.SPACE_PLUGIN
676
+ ns: import_chunk_46S3JOES.SPACE_PLUGIN
699
677
  }
700
678
  ],
701
679
  icon: "ph--pencil-simple-line--regular",
@@ -705,34 +683,29 @@ var constructObjectActions = ({ node, dispatch }) => {
705
683
  }
706
684
  },
707
685
  {
708
- id: getId(import_chunk_QNVEU2UD.SpaceAction.REMOVE_OBJECTS),
686
+ id: getId(import_chunk_YF2AQ7KP.SpaceAction.RemoveObjects._tag),
709
687
  type: import_plugin_graph2.ACTION_TYPE,
710
688
  data: async () => {
711
689
  const graph = (0, import_plugin_graph2.getGraph)(node);
712
690
  const collection = graph.nodes(node, {
713
691
  relation: "inbound"
714
- }).find(({ data }) => data instanceof import_chunk_6SNOZF7Y.CollectionType)?.data;
715
- await dispatch([
716
- {
717
- action: import_chunk_QNVEU2UD.SpaceAction.REMOVE_OBJECTS,
718
- data: {
719
- objects: [
720
- object
721
- ],
722
- collection
723
- }
724
- }
725
- ]);
692
+ }).find(({ data }) => data instanceof import_chunk_YF2AQ7KP.CollectionType)?.data;
693
+ await dispatch((0, import_app_framework4.createIntent)(import_chunk_YF2AQ7KP.SpaceAction.RemoveObjects, {
694
+ objects: [
695
+ object
696
+ ],
697
+ target: collection
698
+ }));
726
699
  },
727
700
  properties: {
728
701
  label: [
729
- object instanceof import_chunk_6SNOZF7Y.CollectionType ? "delete collection label" : "delete object label",
702
+ object instanceof import_chunk_YF2AQ7KP.CollectionType ? "delete collection label" : "delete object label",
730
703
  {
731
- ns: import_chunk_QNVEU2UD.SPACE_PLUGIN
704
+ ns: import_chunk_46S3JOES.SPACE_PLUGIN
732
705
  }
733
706
  ],
734
707
  icon: "ph--trash--regular",
735
- keyBinding: object instanceof import_chunk_6SNOZF7Y.CollectionType ? void 0 : "shift+meta+Backspace",
708
+ keyBinding: object instanceof import_chunk_YF2AQ7KP.CollectionType ? void 0 : "shift+meta+Backspace",
736
709
  testId: "spacePlugin.deleteObject"
737
710
  }
738
711
  },
@@ -747,12 +720,32 @@ var constructObjectActions = ({ node, dispatch }) => {
747
720
  label: [
748
721
  "copy link label",
749
722
  {
750
- ns: import_chunk_QNVEU2UD.SPACE_PLUGIN
723
+ ns: import_chunk_46S3JOES.SPACE_PLUGIN
751
724
  }
752
725
  ],
753
726
  icon: "ph--link--regular",
754
727
  testId: "spacePlugin.copyLink"
755
728
  }
729
+ },
730
+ // TODO(wittjosiah): Factor out and apply to all nodes.
731
+ {
732
+ id: import_app_framework4.NavigationAction.Expose._tag,
733
+ type: import_plugin_graph2.ACTION_TYPE,
734
+ data: async () => {
735
+ await dispatch((0, import_app_framework4.createIntent)(import_app_framework4.NavigationAction.Expose, {
736
+ id: (0, import_echo5.fullyQualifiedId)(object)
737
+ }));
738
+ },
739
+ properties: {
740
+ label: [
741
+ "expose object label",
742
+ {
743
+ ns: import_chunk_46S3JOES.SPACE_PLUGIN
744
+ }
745
+ ],
746
+ icon: "ph--eye--regular",
747
+ testId: "spacePlugin.exposeObject"
748
+ }
756
749
  }
757
750
  ];
758
751
  return actions;
@@ -768,7 +761,7 @@ var getActiveSpace = (graph, active) => {
768
761
  return (0, import_echo5.getSpace)(node.data);
769
762
  };
770
763
  var getNestedObjects = async (object, resolve) => {
771
- const type = (0, import_echo_schema3.getTypename)(object);
764
+ const type = (0, import_echo_schema2.getTypename)(object);
772
765
  if (!type) {
773
766
  return [];
774
767
  }
@@ -786,12 +779,12 @@ var getNestedObjects = async (object, resolve) => {
786
779
  };
787
780
  var cloneObject = async (object, resolve, newSpace) => {
788
781
  const schema = (0, import_live_object2.getSchema)(object);
789
- const typename = schema ? (0, import_echo_schema3.getObjectAnnotation)(schema)?.typename ?? import_echo_schema3.EXPANDO_TYPENAME : import_echo_schema3.EXPANDO_TYPENAME;
782
+ const typename = schema ? (0, import_echo_schema2.getObjectAnnotation)(schema)?.typename ?? import_echo_schema2.EXPANDO_TYPENAME : import_echo_schema2.EXPANDO_TYPENAME;
790
783
  const metadata = resolve(typename);
791
784
  const serializer = metadata.serializer;
792
785
  (0, import_invariant2.invariant)(serializer, `No serializer for type: ${typename}`, {
793
786
  F: __dxlog_file,
794
- L: 544,
787
+ L: 551,
795
788
  S: void 0,
796
789
  A: [
797
790
  "serializer",
@@ -808,11 +801,11 @@ var cloneObject = async (object, resolve, newSpace) => {
808
801
  });
809
802
  };
810
803
  var CreateObjectPanel = ({ schemas, spaces, typename: initialTypename, target: initialTarget, name: initialName, defaultSpaceId, resolve, onCreateObject }) => {
811
- const { t } = (0, import_react_ui3.useTranslation)(import_chunk_QNVEU2UD.SPACE_PLUGIN);
804
+ const { t } = (0, import_react_ui3.useTranslation)(import_chunk_46S3JOES.SPACE_PLUGIN);
812
805
  const [typename, setTypename] = (0, import_react6.useState)(initialTypename);
813
806
  const [target, setTarget] = (0, import_react6.useState)(initialTarget);
814
- const schema = schemas.find((schema2) => (0, import_echo_schema2.getObjectAnnotation)(schema2)?.typename === typename);
815
- const options = schemas.map(import_echo_schema2.getObjectAnnotation).filter(import_util2.nonNullable);
807
+ const schema = schemas.find((schema2) => (0, import_echo_schema.getObjectAnnotation)(schema2)?.typename === typename);
808
+ const options = schemas.map(import_echo_schema.getObjectAnnotation).filter(import_util2.nonNullable);
816
809
  const handleClearSchema = (0, import_react6.useCallback)(() => setTypename(void 0), []);
817
810
  const handleClearTarget = (0, import_react6.useCallback)(() => setTarget(void 0), []);
818
811
  const handleCreateObject = (0, import_react6.useCallback)(async ({ name }) => {
@@ -831,7 +824,7 @@ var CreateObjectPanel = ({ schemas, spaces, typename: initialTypename, target: i
831
824
  ]);
832
825
  const schemaInput = /* @__PURE__ */ import_react6.default.createElement(import_react_ui_searchlist.SearchList.Root, {
833
826
  label: t("schema input label"),
834
- classNames: "flex flex-col grow overflow-hidden my-2 px-2"
827
+ classNames: "flex flex-col grow overflow-hidden"
835
828
  }, /* @__PURE__ */ import_react6.default.createElement(import_react_ui_searchlist.SearchList.Input, {
836
829
  autoFocus: true,
837
830
  "data-testid": "create-object-form.schema-input",
@@ -858,7 +851,7 @@ var CreateObjectPanel = ({ schemas, spaces, typename: initialTypename, target: i
858
851
  }))))));
859
852
  const spaceInput = /* @__PURE__ */ import_react6.default.createElement(import_react_ui_searchlist.SearchList.Root, {
860
853
  label: t("space input label"),
861
- classNames: "flex flex-col grow overflow-hidden my-2 px-2"
854
+ classNames: "flex flex-col grow overflow-hidden"
862
855
  }, /* @__PURE__ */ import_react6.default.createElement(import_react_ui_searchlist.SearchList.Input, {
863
856
  autoFocus: true,
864
857
  "data-testid": "create-object-form.space-input",
@@ -883,8 +876,8 @@ var CreateObjectPanel = ({ schemas, spaces, typename: initialTypename, target: i
883
876
  values: {
884
877
  name: initialName
885
878
  },
886
- schema: import_echo_schema2.S.Struct({
887
- name: import_echo_schema2.S.optional(import_echo_schema2.S.String)
879
+ schema: import_echo_schema.S.Struct({
880
+ name: import_echo_schema.S.optional(import_echo_schema.S.String)
888
881
  }),
889
882
  testId: "create-object-form",
890
883
  onSave: handleCreateObject
@@ -893,8 +886,7 @@ var CreateObjectPanel = ({ schemas, spaces, typename: initialTypename, target: i
893
886
  role: "form",
894
887
  className: "flex flex-col gap-2"
895
888
  }, target && /* @__PURE__ */ import_react6.default.createElement("div", {
896
- role: "none",
897
- className: "px-2"
889
+ role: "none"
898
890
  }, /* @__PURE__ */ import_react6.default.createElement(import_react_ui3.Input.Root, null, /* @__PURE__ */ import_react6.default.createElement(import_react_ui_form.InputHeader, null, /* @__PURE__ */ import_react6.default.createElement(import_react_ui3.Input.Label, null, t((0, import_echo4.isSpace)(target) ? "creating in space label" : "creating in collection label"))), /* @__PURE__ */ import_react6.default.createElement("div", {
899
891
  role: "none",
900
892
  className: "flex gap-2"
@@ -909,8 +901,7 @@ var CreateObjectPanel = ({ schemas, spaces, typename: initialTypename, target: i
909
901
  label: t("clear input label"),
910
902
  onClick: handleClearTarget
911
903
  })))), schema && /* @__PURE__ */ import_react6.default.createElement("div", {
912
- role: "none",
913
- className: "px-2"
904
+ role: "none"
914
905
  }, /* @__PURE__ */ import_react6.default.createElement(import_react_ui3.Input.Root, null, /* @__PURE__ */ import_react6.default.createElement(import_react_ui_form.InputHeader, null, /* @__PURE__ */ import_react6.default.createElement(import_react_ui3.Input.Label, null, t("creating object type label"))), /* @__PURE__ */ import_react6.default.createElement("div", {
915
906
  role: "none",
916
907
  className: "flex gap-2"
@@ -927,44 +918,37 @@ var CreateObjectPanel = ({ schemas, spaces, typename: initialTypename, target: i
927
918
  onClick: handleClearSchema
928
919
  })))), !schema ? schemaInput : !target ? spaceInput : form);
929
920
  };
930
- var CreateObjectDialog = ({ schemas, target, typename, name, navigableCollections, resolve }) => {
921
+ var CREATE_OBJECT_DIALOG = `${import_chunk_46S3JOES.SPACE_PLUGIN}/CreateObjectDialog`;
922
+ var CreateObjectDialog = ({ schemas, target, typename, name, shouldNavigate: _shouldNavigate, resolve }) => {
931
923
  const closeRef = (0, import_react5.useRef)(null);
932
- const { t } = (0, import_react_ui2.useTranslation)(import_chunk_QNVEU2UD.SPACE_PLUGIN);
924
+ const { t } = (0, import_react_ui2.useTranslation)(import_chunk_46S3JOES.SPACE_PLUGIN);
933
925
  const client = (0, import_react_client3.useClient)();
934
926
  const spaces = (0, import_echo3.useSpaces)();
935
- const dispatch = (0, import_app_framework3.useIntentDispatcher)();
927
+ const { dispatchPromise: dispatch } = (0, import_app_framework3.useIntentDispatcher)();
936
928
  const handleCreateObject = (0, import_react5.useCallback)(async ({ schema, target: _target, name: name2 }) => {
937
- const target2 = (0, import_echo3.isSpace)(_target) ? _target.properties[import_chunk_6SNOZF7Y.CollectionType.typename] : _target;
938
- const createObjectAction = resolve?.(schema.typename)?.createObject;
939
- if (!createObjectAction || !target2) {
929
+ const target2 = (0, import_echo3.isSpace)(_target) ? _target.properties[import_chunk_YF2AQ7KP.CollectionType.typename]?.target : _target;
930
+ const createObjectIntent = resolve?.(schema.typename)?.createObject;
931
+ if (!createObjectIntent || !target2) {
940
932
  return;
941
933
  }
942
934
  closeRef.current?.click();
943
935
  const space = (0, import_echo3.isSpace)(target2) ? target2 : (0, import_echo3.getSpace)(target2);
944
- const result = await dispatch({
945
- action: createObjectAction,
946
- data: {
947
- name: name2,
948
- space
949
- }
950
- });
951
- const object = result?.data;
936
+ const result = await dispatch(createObjectIntent({
937
+ name: name2,
938
+ space
939
+ }));
940
+ const object = result.data?.object;
952
941
  if ((0, import_echo3.isReactiveObject)(object)) {
953
- await dispatch([
954
- {
955
- plugin: import_chunk_QNVEU2UD.SPACE_PLUGIN,
956
- action: import_chunk_QNVEU2UD.SpaceAction.ADD_OBJECT,
957
- data: {
958
- target: target2,
959
- object
960
- }
961
- },
962
- ...!(object instanceof import_chunk_6SNOZF7Y.CollectionType) || navigableCollections ? [
963
- {
964
- action: import_app_framework3.NavigationAction.OPEN
965
- }
966
- ] : []
967
- ]);
942
+ const addObjectIntent = (0, import_app_framework3.createIntent)(import_chunk_YF2AQ7KP.SpaceAction.AddObject, {
943
+ target: target2,
944
+ object
945
+ });
946
+ const shouldNavigate = _shouldNavigate ?? (() => true);
947
+ if (shouldNavigate(object)) {
948
+ await dispatch((0, import_effect.pipe)(addObjectIntent, (0, import_app_framework3.chain)(import_app_framework3.NavigationAction.Open, {})));
949
+ } else {
950
+ await dispatch(addObjectIntent);
951
+ }
968
952
  }
969
953
  }, [
970
954
  dispatch,
@@ -977,7 +961,7 @@ var CreateObjectDialog = ({ schemas, target, typename, name, navigableCollection
977
961
  classNames: "p-0 bs-content min-bs-[15rem] max-bs-full md:max-is-[40rem] overflow-hidden"
978
962
  }, /* @__PURE__ */ import_react5.default.createElement("div", {
979
963
  role: "none",
980
- className: "flex justify-between pbs-3 pis-2 pie-3 @md:pbs-4 @md:pis-4 @md:pie-5"
964
+ className: "flex justify-between pbs-2 pis-2 pie-2 @md:pbs-4 @md:pis-4 @md:pie-4"
981
965
  }, /* @__PURE__ */ import_react5.default.createElement(import_react_ui2.Dialog.Title, null, t("create object dialog title")), /* @__PURE__ */ import_react5.default.createElement(import_react_ui2.Dialog.Close, {
982
966
  asChild: true
983
967
  }, /* @__PURE__ */ import_react5.default.createElement(import_react_ui2.Button, {
@@ -1002,26 +986,21 @@ var CreateObjectDialog = ({ schemas, target, typename, name, navigableCollection
1002
986
  })))
1003
987
  );
1004
988
  };
989
+ var CREATE_SPACE_DIALOG = `${import_chunk_46S3JOES.SPACE_PLUGIN}/CreateSpaceDialog`;
1005
990
  var initialValues = {
1006
991
  edgeReplication: true
1007
992
  };
1008
993
  var CreateSpaceDialog = () => {
1009
994
  const closeRef = (0, import_react7.useRef)(null);
1010
- const { t } = (0, import_react_ui4.useTranslation)(import_chunk_QNVEU2UD.SPACE_PLUGIN);
1011
- const dispatch = (0, import_app_framework4.useIntentDispatcher)();
995
+ const { t } = (0, import_react_ui4.useTranslation)(import_chunk_46S3JOES.SPACE_PLUGIN);
996
+ const { dispatchPromise: dispatch } = (0, import_app_framework5.useIntentDispatcher)();
1012
997
  const handleCreateSpace = (0, import_react7.useCallback)(async (data) => {
1013
- const result = await dispatch({
1014
- action: import_chunk_QNVEU2UD.SpaceAction.CREATE,
1015
- data
1016
- });
1017
- const target = result?.data.space;
998
+ const result = await dispatch((0, import_app_framework5.createIntent)(import_chunk_YF2AQ7KP.SpaceAction.Create, data));
999
+ const target = result.data?.space;
1018
1000
  if (target) {
1019
- await dispatch({
1020
- action: import_chunk_QNVEU2UD.SpaceAction.OPEN_CREATE_OBJECT,
1021
- data: {
1022
- target
1023
- }
1024
- });
1001
+ await dispatch((0, import_app_framework5.createIntent)(import_chunk_YF2AQ7KP.SpaceAction.OpenCreateObject, {
1002
+ target
1003
+ }));
1025
1004
  }
1026
1005
  }, [
1027
1006
  dispatch
@@ -1033,7 +1012,7 @@ var CreateSpaceDialog = () => {
1033
1012
  classNames: "p-0 bs-content min-bs-[15rem] max-bs-full md:max-is-[40rem] overflow-hidden"
1034
1013
  }, /* @__PURE__ */ import_react7.default.createElement("div", {
1035
1014
  role: "none",
1036
- className: "flex justify-between pbs-3 pis-2 pie-3 @md:pbs-4 @md:pis-4 @md:pie-5"
1015
+ className: "flex justify-between pbs-2 pis-2 pie-2 @md:pbs-4 @md:pis-4 @md:pie-4"
1037
1016
  }, /* @__PURE__ */ import_react7.default.createElement(import_react_ui4.Dialog.Title, null, t("create space dialog title")), /* @__PURE__ */ import_react7.default.createElement(import_react_ui4.Dialog.Close, {
1038
1017
  asChild: true
1039
1018
  }, /* @__PURE__ */ import_react7.default.createElement(import_react_ui4.Button, {
@@ -1049,13 +1028,13 @@ var CreateSpaceDialog = () => {
1049
1028
  }, /* @__PURE__ */ import_react7.default.createElement(import_react_ui_form2.Form, {
1050
1029
  testId: "create-space-form",
1051
1030
  values: initialValues,
1052
- schema: import_chunk_6SNOZF7Y.SpaceForm,
1031
+ schema: import_chunk_YF2AQ7KP.SpaceForm,
1053
1032
  onSave: handleCreateSpace
1054
1033
  })))
1055
1034
  );
1056
1035
  };
1057
1036
  var CollectionMain = ({ collection }) => {
1058
- const { t } = (0, import_react_ui5.useTranslation)(import_chunk_QNVEU2UD.SPACE_PLUGIN);
1037
+ const { t } = (0, import_react_ui5.useTranslation)(import_chunk_46S3JOES.SPACE_PLUGIN);
1059
1038
  return /* @__PURE__ */ import_react8.default.createElement("div", {
1060
1039
  role: "none",
1061
1040
  className: (0, import_react_ui_theme2.mx)(import_react_ui_theme2.baseSurface, "min-bs-screen is-full flex items-center justify-center p-8"),
@@ -1066,7 +1045,7 @@ var CollectionMain = ({ collection }) => {
1066
1045
  }, collection.name ?? t("unnamed collection label")));
1067
1046
  };
1068
1047
  var CollectionSection = ({ collection }) => {
1069
- const { t } = (0, import_react_ui6.useTranslation)(import_chunk_QNVEU2UD.SPACE_PLUGIN);
1048
+ const { t } = (0, import_react_ui6.useTranslation)(import_chunk_46S3JOES.SPACE_PLUGIN);
1070
1049
  return /* @__PURE__ */ import_react9.default.createElement("div", {
1071
1050
  className: "min-bs-[3.5rem] grid grid-rows-subgrid grid-cols-subgrid items-center"
1072
1051
  }, /* @__PURE__ */ import_react9.default.createElement("span", {
@@ -1074,7 +1053,7 @@ var CollectionSection = ({ collection }) => {
1074
1053
  }, collection.name ?? t("unnamed collection label")));
1075
1054
  };
1076
1055
  var DefaultObjectSettings = ({ object }) => {
1077
- const { t } = (0, import_react_ui7.useTranslation)(import_chunk_QNVEU2UD.SPACE_PLUGIN);
1056
+ const { t } = (0, import_react_ui7.useTranslation)(import_chunk_46S3JOES.SPACE_PLUGIN);
1078
1057
  return /* @__PURE__ */ import_react10.default.createElement("div", {
1079
1058
  role: "form",
1080
1059
  className: "flex flex-col w-full p-2 gap-1"
@@ -1086,33 +1065,28 @@ var DefaultObjectSettings = ({ object }) => {
1086
1065
  }
1087
1066
  })));
1088
1067
  };
1068
+ var JOIN_DIALOG = `${import_chunk_46S3JOES.SPACE_PLUGIN}/JoinDialog`;
1089
1069
  var JoinDialog = ({ navigableCollections, onDone, ...props }) => {
1090
- const { t } = (0, import_react_ui8.useTranslation)(import_chunk_QNVEU2UD.SPACE_PLUGIN);
1091
- const dispatch = (0, import_app_framework5.useIntentDispatcher)();
1070
+ const { t } = (0, import_react_ui8.useTranslation)(import_chunk_46S3JOES.SPACE_PLUGIN);
1071
+ const { dispatchPromise: dispatch } = (0, import_app_framework6.useIntentDispatcher)();
1092
1072
  const spaces = (0, import_echo6.useSpaces)();
1093
1073
  const { graph } = (0, import_plugin_graph3.useGraph)();
1094
1074
  const handleDone = (0, import_react11.useCallback)(async (result) => {
1095
1075
  if (result?.spaceKey) {
1096
1076
  await Promise.all([
1097
- dispatch({
1098
- action: import_app_framework5.LayoutAction.SET_LAYOUT,
1099
- data: {
1100
- element: "toast",
1101
- subject: {
1102
- id: `${import_chunk_QNVEU2UD.SPACE_PLUGIN}/join-success`,
1103
- duration: 5e3,
1104
- title: t("join success label"),
1105
- closeLabel: t("dismiss label")
1106
- }
1107
- }
1108
- }),
1109
- dispatch({
1110
- action: import_app_framework5.LayoutAction.SET_LAYOUT,
1111
- data: {
1112
- element: "dialog",
1113
- state: false
1077
+ dispatch((0, import_app_framework6.createIntent)(import_app_framework6.LayoutAction.SetLayout, {
1078
+ element: "toast",
1079
+ subject: {
1080
+ id: `${import_chunk_46S3JOES.SPACE_PLUGIN}/join-success`,
1081
+ duration: 5e3,
1082
+ title: t("join success label"),
1083
+ closeLabel: t("dismiss label")
1114
1084
  }
1115
- })
1085
+ })),
1086
+ dispatch((0, import_app_framework6.createIntent)(import_app_framework6.LayoutAction.SetLayout, {
1087
+ element: "dialog",
1088
+ state: false
1089
+ }))
1116
1090
  ]);
1117
1091
  }
1118
1092
  const space = spaces.find(({ key }) => result?.spaceKey?.equals(key));
@@ -1123,35 +1097,26 @@ var JoinDialog = ({ navigableCollections, onDone, ...props }) => {
1123
1097
  }).catch(() => {
1124
1098
  });
1125
1099
  await Promise.all([
1126
- dispatch({
1127
- action: import_app_framework5.NavigationAction.OPEN,
1128
- data: {
1129
- activeParts: {
1130
- main: [
1131
- target
1132
- ]
1133
- }
1134
- }
1135
- }),
1136
- dispatch({
1137
- action: import_app_framework5.NavigationAction.EXPOSE,
1138
- data: {
1139
- id: target
1100
+ dispatch((0, import_app_framework6.createIntent)(import_app_framework6.NavigationAction.Open, {
1101
+ activeParts: {
1102
+ main: [
1103
+ target
1104
+ ]
1140
1105
  }
1141
- })
1106
+ })),
1107
+ dispatch((0, import_app_framework6.createIntent)(import_app_framework6.NavigationAction.Expose, {
1108
+ id: target
1109
+ }))
1142
1110
  ]);
1143
1111
  }
1144
1112
  await onDone?.(result);
1145
1113
  if (space) {
1146
- await dispatch({
1147
- action: import_meta2.ObservabilityAction.SEND_EVENT,
1148
- data: {
1149
- name: "space.join",
1150
- properties: {
1151
- spaceId: space.id
1152
- }
1114
+ await dispatch((0, import_app_framework6.createIntent)(import_types3.ObservabilityAction.SendEvent, {
1115
+ name: "space.join",
1116
+ properties: {
1117
+ spaceId: space.id
1153
1118
  }
1154
- });
1119
+ }));
1155
1120
  }
1156
1121
  }, [
1157
1122
  dispatch,
@@ -1169,7 +1134,7 @@ var JoinDialog = ({ navigableCollections, onDone, ...props }) => {
1169
1134
  }));
1170
1135
  };
1171
1136
  var MenuFooter = ({ object }) => {
1172
- const { t } = (0, import_react_ui9.useTranslation)(import_chunk_QNVEU2UD.SPACE_PLUGIN);
1137
+ const { t } = (0, import_react_ui9.useTranslation)(import_chunk_46S3JOES.SPACE_PLUGIN);
1173
1138
  const client = (0, import_react_client4.useClient)();
1174
1139
  const space = (0, import_echo7.getSpace)(object);
1175
1140
  const spaceName = space ? getSpaceDisplayName(space, {
@@ -1192,7 +1157,7 @@ var Status;
1192
1157
  Status2[Status2["ERROR"] = 2] = "ERROR";
1193
1158
  })(Status || (Status = {}));
1194
1159
  var PersistenceStatus = ({ db }) => {
1195
- const { t } = (0, import_react_ui10.useTranslation)(import_chunk_QNVEU2UD.SPACE_PLUGIN);
1160
+ const { t } = (0, import_react_ui10.useTranslation)(import_chunk_46S3JOES.SPACE_PLUGIN);
1196
1161
  const [displayMessage, setDisplayMessage] = (0, import_react16.useState)(false);
1197
1162
  const [status, naturalSetStatus] = (0, import_react16.useState)(0);
1198
1163
  const [prevStatus, setPrevStatus] = (0, import_react16.useState)(0);
@@ -1235,14 +1200,13 @@ var PersistenceStatus = ({ db }) => {
1235
1200
  className: (0, import_react_ui_theme3.mx)((0, import_react_ui_theme3.getSize)(4), "me-1")
1236
1201
  }), displayMessage && /* @__PURE__ */ import_react16.default.createElement("span", {
1237
1202
  className: (0, import_react_ui_theme3.mx)("text-sm", import_react_ui_theme3.staticPlaceholderText)
1238
- }, t("persisted locally label"))), /* @__PURE__ */ import_react16.default.createElement(import_react_ui10.Tooltip.Portal, null, /* @__PURE__ */ import_react16.default.createElement(import_react_ui10.Tooltip.Content, {
1239
- classNames: "z-10"
1240
- }, t("persisted locally message"), /* @__PURE__ */ import_react16.default.createElement(import_react_ui10.Tooltip.Arrow, null))));
1203
+ }, t("persisted locally label"))), /* @__PURE__ */ import_react16.default.createElement(import_react_ui10.Tooltip.Portal, null, /* @__PURE__ */ import_react16.default.createElement(import_react_ui10.Tooltip.Content, null, t("persisted locally message"), /* @__PURE__ */ import_react16.default.createElement(import_react_ui10.Tooltip.Arrow, null))));
1241
1204
  }
1242
1205
  };
1243
1206
  var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/PopoverRenameObject.tsx";
1207
+ var POPOVER_RENAME_OBJECT = `${import_chunk_46S3JOES.SPACE_PLUGIN}/PopoverRenameObject`;
1244
1208
  var PopoverRenameObject = ({ object: obj }) => {
1245
- const { t } = (0, import_react_ui11.useTranslation)(import_chunk_QNVEU2UD.SPACE_PLUGIN);
1209
+ const { t } = (0, import_react_ui11.useTranslation)(import_chunk_46S3JOES.SPACE_PLUGIN);
1246
1210
  const doneButton = (0, import_react17.useRef)(null);
1247
1211
  const object = obj;
1248
1212
  const [name, setName] = (0, import_react17.useState)(object.name || object.title || "");
@@ -1257,7 +1221,7 @@ var PopoverRenameObject = ({ object: obj }) => {
1257
1221
  err
1258
1222
  }, {
1259
1223
  F: __dxlog_file2,
1260
- L: 28,
1224
+ L: 30,
1261
1225
  S: void 0,
1262
1226
  C: (f, a) => f(...a)
1263
1227
  });
@@ -1291,8 +1255,9 @@ var PopoverRenameObject = ({ object: obj }) => {
1291
1255
  ns: "os"
1292
1256
  }))));
1293
1257
  };
1258
+ var POPOVER_RENAME_SPACE = `${import_chunk_46S3JOES.SPACE_PLUGIN}/PopoverRenameSpace`;
1294
1259
  var PopoverRenameSpace = ({ space }) => {
1295
- const { t } = (0, import_react_ui12.useTranslation)(import_chunk_QNVEU2UD.SPACE_PLUGIN);
1260
+ const { t } = (0, import_react_ui12.useTranslation)(import_chunk_46S3JOES.SPACE_PLUGIN);
1296
1261
  const doneButton = (0, import_react18.useRef)(null);
1297
1262
  const [name, setName] = (0, import_react18.useState)(space.properties.name ?? "");
1298
1263
  const handleDone = (0, import_react18.useCallback)(() => {
@@ -1327,18 +1292,15 @@ var PopoverRenameSpace = ({ space }) => {
1327
1292
  }))));
1328
1293
  };
1329
1294
  var ShareSpaceButton = ({ space }) => {
1330
- const dispatch = (0, import_app_framework6.useIntentDispatcher)();
1295
+ const { dispatchPromise: dispatch } = (0, import_app_framework7.useIntentDispatcher)();
1331
1296
  return /* @__PURE__ */ import_react19.default.createElement(ShareSpaceButtonImpl, {
1332
- onClick: () => dispatch({
1333
- action: import_chunk_QNVEU2UD.SpaceAction.SHARE,
1334
- data: {
1335
- space
1336
- }
1337
- })
1297
+ onClick: () => dispatch((0, import_app_framework7.createIntent)(import_chunk_YF2AQ7KP.SpaceAction.Share, {
1298
+ space
1299
+ }))
1338
1300
  });
1339
1301
  };
1340
1302
  var ShareSpaceButtonImpl = ({ onClick }) => {
1341
- const { t } = (0, import_react_ui13.useTranslation)(import_chunk_QNVEU2UD.SPACE_PLUGIN);
1303
+ const { t } = (0, import_react_ui13.useTranslation)(import_chunk_46S3JOES.SPACE_PLUGIN);
1342
1304
  return /* @__PURE__ */ import_react19.default.createElement(import_react_ui13.IconButton, {
1343
1305
  "data-testid": "spacePlugin.shareSpaceButton",
1344
1306
  icon: "ph--users--regular",
@@ -1346,12 +1308,45 @@ var ShareSpaceButtonImpl = ({ onClick }) => {
1346
1308
  onClick
1347
1309
  });
1348
1310
  };
1311
+ var usePath = (graph, id, timeout) => {
1312
+ const [pathState, setPathState] = (0, import_react21.useState)(id ? graph.getPath({
1313
+ target: id
1314
+ }) : void 0);
1315
+ (0, import_react21.useEffect)(() => {
1316
+ if (!id && pathState) {
1317
+ setPathState(void 0);
1318
+ }
1319
+ if (pathState?.at(-1) === id || !id) {
1320
+ return;
1321
+ }
1322
+ const frame = requestAnimationFrame(async () => {
1323
+ try {
1324
+ const path = await graph.waitForPath({
1325
+ target: id
1326
+ }, {
1327
+ timeout
1328
+ });
1329
+ if (path) {
1330
+ setPathState(path);
1331
+ }
1332
+ } catch {
1333
+ }
1334
+ });
1335
+ return () => cancelAnimationFrame(frame);
1336
+ }, [
1337
+ graph,
1338
+ id,
1339
+ timeout,
1340
+ pathState
1341
+ ]);
1342
+ return pathState;
1343
+ };
1349
1344
  var REFRESH_INTERVAL = 5e3;
1350
1345
  var ACTIVITY_DURATION = 3e4;
1351
1346
  var noViewers = new import_util3.ComplexMap(import_react_client5.PublicKey.hash);
1352
1347
  var getName = (identity) => identity.profile?.displayName ?? (0, import_display_name.generateName)(identity.identityKey.toHex());
1353
1348
  var SpacePresence = ({ object, spaceKey }) => {
1354
- const spacePlugin = (0, import_app_framework7.usePlugin)(import_chunk_QNVEU2UD.SPACE_PLUGIN);
1349
+ const spacePlugin = (0, import_app_framework8.usePlugin)(import_chunk_46S3JOES.SPACE_PLUGIN);
1355
1350
  const client = (0, import_react_client5.useClient)();
1356
1351
  const identity = (0, import_halo.useIdentity)();
1357
1352
  const space = spaceKey ? client.spaces.get(spaceKey) : (0, import_echo8.getSpace)(object);
@@ -1449,10 +1444,17 @@ var PrensenceAvatar = ({ identity, showName, match, group, index, onClick }) =>
1449
1444
  classNames: "text-sm truncate pli-2"
1450
1445
  }, getName(identity)));
1451
1446
  };
1452
- var SmallPresenceLive = ({ id, viewers }) => {
1447
+ var SmallPresenceLive = ({ id, open, viewers }) => {
1448
+ const { hasAttention, isAncestor, isRelated } = (0, import_react_ui_attention.useAttention)(id);
1449
+ const isAttended = hasAttention || isAncestor || isRelated;
1450
+ const { graph } = (0, import_plugin_graph4.useGraph)();
1451
+ const attended = (0, import_react_ui_attention.useAttended)();
1452
+ const startOfAttention = attended.at(-1);
1453
+ const path = usePath(graph, startOfAttention);
1454
+ const containsAttended = !open && !isAttended && id && path ? path.includes(id) : false;
1453
1455
  const getActiveViewers = (viewers2) => {
1454
1456
  const moment = Date.now();
1455
- return Array.from(viewers2.values()).filter(({ lastSeen }) => moment - lastSeen < ACTIVITY_DURATION);
1457
+ return Array.from(viewers2.values()).filter((viewer) => moment - viewer.lastSeen < ACTIVITY_DURATION);
1456
1458
  };
1457
1459
  const [activeViewers, setActiveViewers] = (0, import_react20.useState)(viewers ? getActiveViewers(viewers) : []);
1458
1460
  (0, import_react20.useEffect)(() => {
@@ -1467,58 +1469,50 @@ var SmallPresenceLive = ({ id, viewers }) => {
1467
1469
  viewers
1468
1470
  ]);
1469
1471
  return /* @__PURE__ */ import_react20.default.createElement(SmallPresence, {
1470
- id,
1471
- count: activeViewers.length
1472
+ count: activeViewers.length,
1473
+ attended: isAttended,
1474
+ containsAttended
1472
1475
  });
1473
1476
  };
1474
- var SmallPresence = ({ id, count }) => {
1475
- const { t } = (0, import_react_ui14.useTranslation)(import_chunk_QNVEU2UD.SPACE_PLUGIN);
1476
- const { hasAttention, isAncestor, isRelated } = (0, import_react_ui_attention.useAttention)(id);
1477
- const attention = hasAttention || isAncestor || isRelated;
1477
+ var SmallPresence = ({ count = 0, attended, containsAttended }) => {
1478
+ const { t } = (0, import_react_ui14.useTranslation)(import_chunk_46S3JOES.SPACE_PLUGIN);
1478
1479
  return /* @__PURE__ */ import_react20.default.createElement(import_react_ui14.Tooltip.Root, null, /* @__PURE__ */ import_react20.default.createElement(import_react_ui14.Tooltip.Trigger, {
1479
1480
  asChild: true
1480
- }, /* @__PURE__ */ import_react20.default.createElement("div", {
1481
- role: "none",
1482
- className: "flex",
1483
- "data-attention": attention
1484
1481
  }, /* @__PURE__ */ import_react20.default.createElement(import_react_ui_attention.AttentionGlyph, {
1482
+ attended,
1483
+ containsAttended,
1485
1484
  presence: count > 1 ? "many" : count === 1 ? "one" : "none",
1486
1485
  classNames: "self-center mie-1"
1487
- }))), /* @__PURE__ */ import_react20.default.createElement(import_react_ui14.Tooltip.Portal, null, /* @__PURE__ */ import_react20.default.createElement(import_react_ui14.Tooltip.Content, {
1488
- side: "bottom",
1489
- classNames: "z-[70]"
1486
+ })), /* @__PURE__ */ import_react20.default.createElement(import_react_ui14.Tooltip.Portal, null, /* @__PURE__ */ import_react20.default.createElement(import_react_ui14.Tooltip.Content, {
1487
+ side: "bottom"
1490
1488
  }, /* @__PURE__ */ import_react20.default.createElement("span", null, t("presence label", {
1491
1489
  count
1492
1490
  })), /* @__PURE__ */ import_react20.default.createElement(import_react_ui14.Tooltip.Arrow, null))));
1493
1491
  };
1494
1492
  var SpacePluginSettings = ({ settings }) => {
1495
- const { t } = (0, import_react_ui15.useTranslation)(import_chunk_QNVEU2UD.SPACE_PLUGIN);
1496
- const dispatch = (0, import_app_framework8.useIntentDispatcher)();
1497
- return /* @__PURE__ */ import_react21.default.createElement(import_react21.default.Fragment, null, /* @__PURE__ */ import_react21.default.createElement(import_react_ui_form3.DeprecatedFormInput, {
1493
+ const { t } = (0, import_react_ui15.useTranslation)(import_chunk_46S3JOES.SPACE_PLUGIN);
1494
+ const { dispatchPromise: dispatch } = (0, import_app_framework9.useIntentDispatcher)();
1495
+ return /* @__PURE__ */ import_react22.default.createElement(import_react22.default.Fragment, null, /* @__PURE__ */ import_react22.default.createElement(import_react_ui_form3.DeprecatedFormInput, {
1498
1496
  label: t("show hidden spaces label")
1499
- }, /* @__PURE__ */ import_react21.default.createElement(import_react_ui15.Input.Switch, {
1497
+ }, /* @__PURE__ */ import_react22.default.createElement(import_react_ui15.Input.Switch, {
1500
1498
  checked: settings.showHidden,
1501
- onCheckedChange: (checked) => dispatch({
1502
- plugin: import_chunk_QNVEU2UD.SPACE_PLUGIN,
1503
- action: import_chunk_QNVEU2UD.SpaceAction.TOGGLE_HIDDEN,
1504
- data: {
1505
- state: !!checked
1506
- }
1507
- })
1499
+ onCheckedChange: (checked) => dispatch((0, import_app_framework9.createIntent)(import_chunk_YF2AQ7KP.SpaceAction.ToggleHidden, {
1500
+ state: !!checked
1501
+ }))
1508
1502
  })));
1509
1503
  };
1510
1504
  var __dxlog_file3 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/SpaceSettings/SpaceSettingsPanel.tsx";
1511
- var SpaceSettingsPanel = ({ space }) => {
1512
- const { t } = (0, import_react_ui17.useTranslation)(import_chunk_QNVEU2UD.SPACE_PLUGIN);
1505
+ var SpaceSettingsPanel = ({ classNames, space }) => {
1506
+ const { t } = (0, import_react_ui17.useTranslation)(import_chunk_46S3JOES.SPACE_PLUGIN);
1513
1507
  const client = (0, import_react_client7.useClient)();
1514
1508
  const edgeEnabled = Boolean(client.config.values.runtime?.client?.edgeFeatures?.echoReplicator);
1515
- const [edgeReplication, setEdgeReplication] = (0, import_react24.useState)(space.internal.data.edgeReplication === import_metadata2.EdgeReplicationSetting.ENABLED);
1516
- const toggleEdgeReplication = (0, import_react24.useCallback)(async (next) => {
1509
+ const [edgeReplication, setEdgeReplication] = (0, import_react25.useState)(space.internal.data.edgeReplication === import_metadata2.EdgeReplicationSetting.ENABLED);
1510
+ const toggleEdgeReplication = (0, import_react25.useCallback)(async (next) => {
1517
1511
  setEdgeReplication(next);
1518
1512
  await space?.internal.setEdgeReplicationPreference(next ? import_metadata2.EdgeReplicationSetting.ENABLED : import_metadata2.EdgeReplicationSetting.DISABLED).catch((err) => {
1519
1513
  import_log3.log.catch(err, void 0, {
1520
1514
  F: __dxlog_file3,
1521
- L: 35,
1515
+ L: 36,
1522
1516
  S: void 0,
1523
1517
  C: (f, a) => f(...a)
1524
1518
  });
@@ -1527,29 +1521,30 @@ var SpaceSettingsPanel = ({ space }) => {
1527
1521
  }, [
1528
1522
  space
1529
1523
  ]);
1530
- return /* @__PURE__ */ import_react24.default.createElement("div", {
1524
+ return /* @__PURE__ */ import_react25.default.createElement("div", {
1531
1525
  role: "form",
1532
- className: "flex flex-col"
1533
- }, /* @__PURE__ */ import_react24.default.createElement(import_react_ui_form4.DeprecatedFormInput, {
1526
+ className: (0, import_react_ui_theme4.mx)("flex flex-col", classNames)
1527
+ }, /* @__PURE__ */ import_react25.default.createElement(import_react_ui_form4.DeprecatedFormInput, {
1534
1528
  label: t("name label")
1535
- }, /* @__PURE__ */ import_react24.default.createElement(import_react_ui17.Input.TextInput, {
1529
+ }, /* @__PURE__ */ import_react25.default.createElement(import_react_ui17.Input.TextInput, {
1536
1530
  placeholder: t("unnamed space label"),
1537
1531
  value: space.properties.name ?? "",
1538
1532
  onChange: (event) => {
1539
1533
  space.properties.name = event.target.value;
1540
1534
  }
1541
- })), edgeEnabled && /* @__PURE__ */ import_react24.default.createElement(import_react_ui_form4.DeprecatedFormInput, {
1535
+ })), edgeEnabled && /* @__PURE__ */ import_react25.default.createElement(import_react_ui_form4.DeprecatedFormInput, {
1542
1536
  label: t("edge replication label")
1543
- }, /* @__PURE__ */ import_react24.default.createElement(import_react_ui17.Input.Switch, {
1537
+ }, /* @__PURE__ */ import_react25.default.createElement(import_react_ui17.Input.Switch, {
1544
1538
  checked: edgeReplication,
1545
1539
  onCheckedChange: toggleEdgeReplication
1546
1540
  })));
1547
1541
  };
1542
+ var SPACE_SETTINGS_DIALOG = `${import_chunk_46S3JOES.SPACE_PLUGIN}/SpaceSettingsDialog`;
1548
1543
  var SpaceSettingsDialog = ({ space, target, createInvitationUrl, initialTab = "members", namesCache }) => {
1549
- const { t } = (0, import_react_ui16.useTranslation)(import_chunk_QNVEU2UD.SPACE_PLUGIN);
1544
+ const { t } = (0, import_react_ui16.useTranslation)(import_chunk_46S3JOES.SPACE_PLUGIN);
1550
1545
  const client = (0, import_react_client6.useClient)();
1551
- const [tabsActivePart, setTabsActivePart] = (0, import_react22.useState)("list");
1552
- const [selected, setSelected] = (0, import_react22.useState)(initialTab);
1546
+ const [tabsActivePart, setTabsActivePart] = (0, import_react23.useState)("list");
1547
+ const [selected, setSelected] = (0, import_react23.useState)(initialTab);
1553
1548
  const locked = space.properties[COMPOSER_SPACE_LOCK];
1554
1549
  const name = getSpaceDisplayName(space, {
1555
1550
  personal: client.spaces.default === space,
@@ -1558,64 +1553,64 @@ var SpaceSettingsDialog = ({ space, target, createInvitationUrl, initialTab = "m
1558
1553
  return (
1559
1554
  // TODO(wittjosiah): The tablist dialog pattern is copied from @dxos/plugin-manager.
1560
1555
  // Consider factoring it out to the tabs package.
1561
- /* @__PURE__ */ import_react22.default.createElement(import_react_ui16.Dialog.Content, {
1556
+ /* @__PURE__ */ import_react23.default.createElement(import_react_ui16.Dialog.Content, {
1562
1557
  classNames: "p-0 bs-content min-bs-[15rem] max-bs-full md:max-is-[40rem] overflow-hidden"
1563
- }, /* @__PURE__ */ import_react22.default.createElement("div", {
1558
+ }, /* @__PURE__ */ import_react23.default.createElement("div", {
1564
1559
  role: "none",
1565
- className: "flex justify-between pbs-3 pis-2 pie-3 @md:pbs-4 @md:pis-4 @md:pie-5"
1566
- }, /* @__PURE__ */ import_react22.default.createElement(import_react_ui16.Dialog.Title, {
1560
+ className: "flex justify-between pbs-2 pis-2 pie-2 @md:pbs-4 @md:pis-4 @md:pie-4"
1561
+ }, /* @__PURE__ */ import_react23.default.createElement(import_react_ui16.Dialog.Title, {
1567
1562
  onClick: () => setTabsActivePart("list"),
1568
1563
  "aria-description": t("click to return to tablist description"),
1569
1564
  classNames: "flex cursor-pointer items-center group/title"
1570
- }, /* @__PURE__ */ import_react22.default.createElement(import_react_ui16.Icon, {
1565
+ }, /* @__PURE__ */ import_react23.default.createElement(import_react_ui16.Icon, {
1571
1566
  icon: "ph--caret-left--regular",
1572
1567
  size: 4,
1573
1568
  classNames: [
1574
1569
  "@md:hidden",
1575
1570
  tabsActivePart === "list" && "invisible"
1576
1571
  ]
1577
- }), /* @__PURE__ */ import_react22.default.createElement("span", {
1572
+ }), /* @__PURE__ */ import_react23.default.createElement("span", {
1578
1573
  className: tabsActivePart !== "list" ? "group-hover/title:underline @md:group-hover/title:no-underline underline-offset-4 decoration-1" : ""
1579
- }, (0, import_react_ui16.toLocalizedString)(name, t))), /* @__PURE__ */ import_react22.default.createElement(import_react_ui16.Dialog.Close, {
1574
+ }, (0, import_react_ui16.toLocalizedString)(name, t))), /* @__PURE__ */ import_react23.default.createElement(import_react_ui16.Dialog.Close, {
1580
1575
  asChild: true
1581
- }, /* @__PURE__ */ import_react22.default.createElement(import_react_ui16.Button, {
1576
+ }, /* @__PURE__ */ import_react23.default.createElement(import_react_ui16.Button, {
1582
1577
  density: "fine",
1583
1578
  variant: "ghost",
1584
1579
  autoFocus: true
1585
- }, /* @__PURE__ */ import_react22.default.createElement(import_react_ui16.Icon, {
1580
+ }, /* @__PURE__ */ import_react23.default.createElement(import_react_ui16.Icon, {
1586
1581
  icon: "ph--x--regular",
1587
1582
  size: 4
1588
- })))), /* @__PURE__ */ import_react22.default.createElement(import_react_ui_tabs.Tabs.Root, {
1583
+ })))), /* @__PURE__ */ import_react23.default.createElement(import_react_ui_tabs.Tabs.Root, {
1589
1584
  orientation: "vertical",
1590
1585
  value: selected,
1591
1586
  onValueChange: setSelected,
1592
1587
  activePart: tabsActivePart,
1593
1588
  onActivePartChange: setTabsActivePart,
1594
1589
  classNames: "flex flex-col flex-1 mbs-2"
1595
- }, /* @__PURE__ */ import_react22.default.createElement(import_react_ui_tabs.Tabs.Viewport, {
1590
+ }, /* @__PURE__ */ import_react23.default.createElement(import_react_ui_tabs.Tabs.Viewport, {
1596
1591
  classNames: "flex-1 min-bs-0"
1597
- }, /* @__PURE__ */ import_react22.default.createElement("div", {
1592
+ }, /* @__PURE__ */ import_react23.default.createElement("div", {
1598
1593
  role: "none",
1599
1594
  className: "overflow-y-auto pli-3 @md:pis-2 @md:pie-0 mbe-4 border-r border-separator"
1600
- }, /* @__PURE__ */ import_react22.default.createElement(import_react_ui_tabs.Tabs.Tablist, {
1595
+ }, /* @__PURE__ */ import_react23.default.createElement(import_react_ui_tabs.Tabs.Tablist, {
1601
1596
  classNames: "flex flex-col max-bs-none min-is-[200px] gap-4 overflow-y-auto"
1602
- }, /* @__PURE__ */ import_react22.default.createElement("div", {
1597
+ }, /* @__PURE__ */ import_react23.default.createElement("div", {
1603
1598
  role: "none",
1604
1599
  className: "flex flex-col ml-1"
1605
- }, /* @__PURE__ */ import_react22.default.createElement(import_react_ui_tabs.Tabs.Tab, {
1600
+ }, /* @__PURE__ */ import_react23.default.createElement(import_react_ui_tabs.Tabs.Tab, {
1606
1601
  value: "settings"
1607
- }, t("settings tab label")), /* @__PURE__ */ import_react22.default.createElement(import_react_ui_tabs.Tabs.Tab, {
1602
+ }, t("settings tab label")), /* @__PURE__ */ import_react23.default.createElement(import_react_ui_tabs.Tabs.Tab, {
1608
1603
  value: "members",
1609
1604
  disabled: locked
1610
- }, t("members tab label"))))), /* @__PURE__ */ import_react22.default.createElement(import_react_ui_tabs.Tabs.Tabpanel, {
1605
+ }, t("members tab label"))))), /* @__PURE__ */ import_react23.default.createElement(import_react_ui_tabs.Tabs.Tabpanel, {
1611
1606
  value: "settings",
1612
1607
  classNames: "pli-3 @md:pli-5 max-bs-dvh overflow-y-auto"
1613
- }, /* @__PURE__ */ import_react22.default.createElement(SpaceSettingsPanel, {
1608
+ }, /* @__PURE__ */ import_react23.default.createElement(SpaceSettingsPanel, {
1614
1609
  space
1615
- })), /* @__PURE__ */ import_react22.default.createElement(import_react_ui_tabs.Tabs.Tabpanel, {
1610
+ })), /* @__PURE__ */ import_react23.default.createElement(import_react_ui_tabs.Tabs.Tabpanel, {
1616
1611
  value: "members",
1617
1612
  classNames: "pli-3 @md:pli-5 max-bs-dvh overflow-y-auto"
1618
- }, /* @__PURE__ */ import_react22.default.createElement(import_react_ui16.Clipboard.Provider, null, /* @__PURE__ */ import_react22.default.createElement(import_react23.SpacePanel, {
1613
+ }, /* @__PURE__ */ import_react23.default.createElement(import_react_ui16.Clipboard.Provider, null, /* @__PURE__ */ import_react23.default.createElement(import_react24.SpacePanel, {
1619
1614
  space,
1620
1615
  hideHeading: true,
1621
1616
  target,
@@ -1644,8 +1639,8 @@ var getSyncSummary = (syncMap) => {
1644
1639
  var isEdgePeerId = (peerId, spaceId) => peerId.startsWith(`${import_protocols.EdgeService.AUTOMERGE_REPLICATOR}:${spaceId}`);
1645
1640
  var useSyncState = () => {
1646
1641
  const client = (0, import_react_client9.useClient)();
1647
- const [spaceState, setSpaceState] = (0, import_react26.useState)({});
1648
- (0, import_react26.useEffect)(() => {
1642
+ const [spaceState, setSpaceState] = (0, import_react27.useState)({});
1643
+ (0, import_react27.useEffect)(() => {
1649
1644
  const ctx = new import_context.Context(void 0, {
1650
1645
  F: __dxlog_file4,
1651
1646
  L: 48
@@ -1679,8 +1674,8 @@ var useSyncState = () => {
1679
1674
  return spaceState;
1680
1675
  };
1681
1676
  var useSpaceSyncState = (space) => {
1682
- const [spaceState, setSpaceState] = (0, import_react26.useState)();
1683
- (0, import_react26.useEffect)(() => {
1677
+ const [spaceState, setSpaceState] = (0, import_react27.useState)();
1678
+ (0, import_react27.useEffect)(() => {
1684
1679
  const ctx = new import_context.Context(void 0, {
1685
1680
  F: __dxlog_file4,
1686
1681
  L: 87
@@ -1700,9 +1695,9 @@ var useSpaceSyncState = (space) => {
1700
1695
  return spaceState;
1701
1696
  };
1702
1697
  var useEdgeStatus = () => {
1703
- const [status, setStatus] = (0, import_react25.useState)(import_services.QueryEdgeStatusResponse.EdgeStatus.NOT_CONNECTED);
1698
+ const [status, setStatus] = (0, import_react26.useState)(import_services.QueryEdgeStatusResponse.EdgeStatus.NOT_CONNECTED);
1704
1699
  const client = (0, import_react_client8.useClient)();
1705
- (0, import_react25.useEffect)(() => {
1700
+ (0, import_react26.useEffect)(() => {
1706
1701
  client.services.services.EdgeAgentService?.queryEdgeStatus().subscribe(({ status: status2 }) => {
1707
1702
  setStatus(status2);
1708
1703
  });
@@ -1711,31 +1706,31 @@ var useEdgeStatus = () => {
1711
1706
  ]);
1712
1707
  return status;
1713
1708
  };
1714
- var InlineSyncStatus = ({ space }) => {
1709
+ var InlineSyncStatus = ({ space, open }) => {
1710
+ const { t } = (0, import_react_ui18.useTranslation)(import_chunk_46S3JOES.SPACE_PLUGIN);
1711
+ const id = space.id;
1712
+ const { hasAttention, isAncestor, isRelated } = (0, import_react_ui_attention2.useAttention)(id);
1713
+ const isAttended = hasAttention || isAncestor || isRelated;
1714
+ const { graph } = (0, import_plugin_graph5.useGraph)();
1715
+ const attended = (0, import_react_ui_attention2.useAttended)();
1716
+ const startOfAttention = attended.at(-1);
1717
+ const path = usePath(graph, startOfAttention);
1718
+ const containsAttended = !open && !isAttended && id && path ? path.includes(id) : false;
1715
1719
  const connectedToEdge = useEdgeStatus() === import_services.QueryEdgeStatusResponse.EdgeStatus.CONNECTED;
1716
1720
  const edgeSyncEnabled = space.internal.data.edgeReplication === import_metadata3.EdgeReplicationSetting.ENABLED;
1717
1721
  const syncState = useSpaceSyncState(space);
1718
- if (!connectedToEdge || !edgeSyncEnabled || !syncState || syncState.missingOnLocal === 0) {
1719
- return null;
1720
- }
1721
- return /* @__PURE__ */ import_react25.default.createElement(InlineSyncStatusIndicator, null);
1722
- };
1723
- var InlineSyncStatusIndicator = () => {
1724
- const { t } = (0, import_react_ui18.useTranslation)(import_chunk_QNVEU2UD.SPACE_PLUGIN);
1725
- const animationProps = (0, import_react25.useMemo)(() => ({
1726
- // Synchronize animations.
1727
- animationDelay: `-${Date.now() % 2e3}ms`
1728
- }), []);
1729
- return /* @__PURE__ */ import_react25.default.createElement("div", {
1730
- role: "status",
1731
- "aria-label": t("syncing message"),
1732
- className: "flex items-center"
1733
- }, /* @__PURE__ */ import_react25.default.createElement(import_react_ui18.Icon, {
1734
- icon: "ph--circle-notch--regular",
1735
- size: 3,
1736
- style: animationProps,
1737
- classNames: "text-subdued animate-[spin_2s_linear_infinite]"
1738
- }));
1722
+ const syncing = connectedToEdge && edgeSyncEnabled && syncState && syncState.missingOnLocal > 0;
1723
+ return /* @__PURE__ */ import_react26.default.createElement(import_react_ui18.Tooltip.Root, null, /* @__PURE__ */ import_react26.default.createElement(import_react_ui18.Tooltip.Trigger, {
1724
+ asChild: true
1725
+ }, /* @__PURE__ */ import_react26.default.createElement(import_react_ui_attention2.AttentionGlyph, {
1726
+ syncing,
1727
+ attended: isAttended,
1728
+ containsAttended,
1729
+ classNames: "self-center mie-1"
1730
+ })), /* @__PURE__ */ import_react26.default.createElement(import_react_ui18.Tooltip.Portal, null, /* @__PURE__ */ import_react26.default.createElement(import_react_ui18.Tooltip.Content, {
1731
+ side: "bottom",
1732
+ classNames: "z-[70]"
1733
+ }, /* @__PURE__ */ import_react26.default.createElement("span", null, t("syncing label")), /* @__PURE__ */ import_react26.default.createElement(import_react_ui18.Tooltip.Arrow, null))));
1739
1734
  };
1740
1735
  var SYNC_STALLED_TIMEOUT = 5e3;
1741
1736
  var styles = {
@@ -1744,9 +1739,9 @@ var styles = {
1744
1739
  barHover: "dark:hover:bg-green-500"
1745
1740
  };
1746
1741
  var useActive = (count) => {
1747
- const [current, setCurrent] = (0, import_react28.useState)(count);
1748
- const [active, setActive] = (0, import_react28.useState)(false);
1749
- (0, import_react28.useEffect)(() => {
1742
+ const [current, setCurrent] = (0, import_react29.useState)(count);
1743
+ const [active, setActive] = (0, import_react29.useState)(false);
1744
+ (0, import_react29.useEffect)(() => {
1750
1745
  let t;
1751
1746
  if (count !== current) {
1752
1747
  setActive(true);
@@ -1767,7 +1762,7 @@ var useActive = (count) => {
1767
1762
  return active;
1768
1763
  };
1769
1764
  var SpaceRowContainer = ({ spaceId, state }) => {
1770
- const { t } = (0, import_react_ui20.useTranslation)(import_chunk_QNVEU2UD.SPACE_PLUGIN);
1765
+ const { t } = (0, import_react_ui20.useTranslation)(import_chunk_46S3JOES.SPACE_PLUGIN);
1771
1766
  const client = (0, import_react_client11.useClient)();
1772
1767
  const space = (0, import_echo9.useSpace)(spaceId);
1773
1768
  if (!space) {
@@ -1776,7 +1771,7 @@ var SpaceRowContainer = ({ spaceId, state }) => {
1776
1771
  const spaceName = (0, import_react_ui20.toLocalizedString)(getSpaceDisplayName(space, {
1777
1772
  personal: space === client.spaces.default
1778
1773
  }), t);
1779
- return /* @__PURE__ */ import_react28.default.createElement(SpaceRow, {
1774
+ return /* @__PURE__ */ import_react29.default.createElement(SpaceRow, {
1780
1775
  spaceId,
1781
1776
  spaceName,
1782
1777
  state
@@ -1785,19 +1780,19 @@ var SpaceRowContainer = ({ spaceId, state }) => {
1785
1780
  var SpaceRow = ({ spaceId, spaceName, state: { localDocumentCount, remoteDocumentCount, missingOnLocal, missingOnRemote } }) => {
1786
1781
  const downActive = useActive(localDocumentCount);
1787
1782
  const upActive = useActive(remoteDocumentCount);
1788
- return /* @__PURE__ */ import_react28.default.createElement("div", {
1783
+ return /* @__PURE__ */ import_react29.default.createElement("div", {
1789
1784
  className: "flex items-center mx-0.5 gap-0.5 cursor-pointer",
1790
1785
  title: spaceId,
1791
1786
  onClick: () => {
1792
1787
  void navigator.clipboard.writeText(spaceId);
1793
1788
  }
1794
- }, /* @__PURE__ */ import_react28.default.createElement("span", {
1789
+ }, /* @__PURE__ */ import_react29.default.createElement("span", {
1795
1790
  className: "is-1/2 truncate"
1796
- }, spaceName), /* @__PURE__ */ import_react28.default.createElement(import_react_ui20.Icon, {
1791
+ }, spaceName), /* @__PURE__ */ import_react29.default.createElement(import_react_ui20.Icon, {
1797
1792
  icon: "ph--arrow-fat-line-left--regular",
1798
1793
  size: 3,
1799
- classNames: (0, import_react_ui_theme5.mx)(downActive && "animate-[pulse_1s_infinite]")
1800
- }), /* @__PURE__ */ import_react28.default.createElement(Candle, {
1794
+ classNames: (0, import_react_ui_theme6.mx)(downActive && "animate-[pulse_1s_infinite]")
1795
+ }), /* @__PURE__ */ import_react29.default.createElement(Candle, {
1801
1796
  up: {
1802
1797
  count: remoteDocumentCount,
1803
1798
  total: remoteDocumentCount + missingOnRemote
@@ -1807,37 +1802,37 @@ var SpaceRow = ({ spaceId, spaceName, state: { localDocumentCount, remoteDocumen
1807
1802
  total: localDocumentCount + missingOnLocal
1808
1803
  },
1809
1804
  title: spaceId
1810
- }), /* @__PURE__ */ import_react28.default.createElement(import_react_ui20.Icon, {
1805
+ }), /* @__PURE__ */ import_react29.default.createElement(import_react_ui20.Icon, {
1811
1806
  icon: "ph--arrow-fat-line-right--regular",
1812
1807
  size: 3,
1813
- classNames: (0, import_react_ui_theme5.mx)(upActive && "animate-[pulse_1s_step-start_infinite]")
1808
+ classNames: (0, import_react_ui_theme6.mx)(upActive && "animate-[pulse_1s_step-start_infinite]")
1814
1809
  }));
1815
1810
  };
1816
1811
  var Candle = ({ classNames, up, down }) => {
1817
- return /* @__PURE__ */ import_react28.default.createElement("div", {
1818
- className: (0, import_react_ui_theme5.mx)("grid grid-cols-[1fr_2rem_1fr] w-full h-3", classNames)
1819
- }, /* @__PURE__ */ import_react28.default.createElement(Bar, {
1812
+ return /* @__PURE__ */ import_react29.default.createElement("div", {
1813
+ className: (0, import_react_ui_theme6.mx)("grid grid-cols-[1fr_2rem_1fr] w-full h-3", classNames)
1814
+ }, /* @__PURE__ */ import_react29.default.createElement(Bar, {
1820
1815
  classNames: "justify-end",
1821
1816
  ...up
1822
- }), /* @__PURE__ */ import_react28.default.createElement("div", {
1817
+ }), /* @__PURE__ */ import_react29.default.createElement("div", {
1823
1818
  className: "relative"
1824
- }, /* @__PURE__ */ import_react28.default.createElement("div", {
1825
- className: (0, import_react_ui_theme5.mx)("absolute inset-0 flex items-center justify-center text-xs", styles.barBg)
1826
- }, up.total)), /* @__PURE__ */ import_react28.default.createElement(Bar, down));
1819
+ }, /* @__PURE__ */ import_react29.default.createElement("div", {
1820
+ className: (0, import_react_ui_theme6.mx)("absolute inset-0 flex items-center justify-center text-xs", styles.barBg)
1821
+ }, up.total)), /* @__PURE__ */ import_react29.default.createElement(Bar, down));
1827
1822
  };
1828
1823
  var Bar = ({ classNames, count, total }) => {
1829
1824
  let p = count / total * 100;
1830
1825
  if (count < total) {
1831
1826
  p = Math.min(p, 95);
1832
1827
  }
1833
- return /* @__PURE__ */ import_react28.default.createElement("div", {
1834
- className: (0, import_react_ui_theme5.mx)("relative flex w-full", styles.barBg, classNames)
1835
- }, /* @__PURE__ */ import_react28.default.createElement("div", {
1836
- className: (0, import_react_ui_theme5.mx)("shrink-0", styles.barFg),
1828
+ return /* @__PURE__ */ import_react29.default.createElement("div", {
1829
+ className: (0, import_react_ui_theme6.mx)("relative flex w-full", styles.barBg, classNames)
1830
+ }, /* @__PURE__ */ import_react29.default.createElement("div", {
1831
+ className: (0, import_react_ui_theme6.mx)("shrink-0", styles.barFg),
1837
1832
  style: {
1838
1833
  width: `${p}%`
1839
1834
  }
1840
- }), count !== total && /* @__PURE__ */ import_react28.default.createElement("div", {
1835
+ }), count !== total && /* @__PURE__ */ import_react29.default.createElement("div", {
1841
1836
  className: "absolute top-0 bottom-0 flex items-center mx-0.5 text-black text-xs"
1842
1837
  }, count));
1843
1838
  };
@@ -1930,19 +1925,19 @@ var getIcon = (status) => {
1930
1925
  var SyncStatus = () => {
1931
1926
  const client = (0, import_react_client10.useClient)();
1932
1927
  const state = useSyncState();
1933
- const [saved, setSaved] = (0, import_react27.useState)(true);
1934
- (0, import_react27.useEffect)(() => {
1928
+ const [saved, setSaved] = (0, import_react28.useState)(true);
1929
+ (0, import_react28.useEffect)(() => {
1935
1930
  return createClientSaveTracker(client, (state2) => {
1936
1931
  setSaved(state2 === "saved");
1937
1932
  });
1938
1933
  }, []);
1939
- return /* @__PURE__ */ import_react27.default.createElement(SyncStatusIndicator, {
1934
+ return /* @__PURE__ */ import_react28.default.createElement(SyncStatusIndicator, {
1940
1935
  state,
1941
1936
  saved
1942
1937
  });
1943
1938
  };
1944
1939
  var SyncStatusIndicator = ({ state, saved }) => {
1945
- const { t } = (0, import_react_ui19.useTranslation)(import_chunk_QNVEU2UD.SPACE_PLUGIN);
1940
+ const { t } = (0, import_react_ui19.useTranslation)(import_chunk_46S3JOES.SPACE_PLUGIN);
1946
1941
  const summary = getSyncSummary(state);
1947
1942
  const offline = Object.values(state).length === 0;
1948
1943
  const needsToUpload = summary.differentDocuments > 0 || summary.missingOnRemote > 0;
@@ -1953,8 +1948,8 @@ var SyncStatusIndicator = ({ state, saved }) => {
1953
1948
  needsToUpload,
1954
1949
  needsToDownload
1955
1950
  });
1956
- const [classNames, setClassNames] = (0, import_react27.useState)();
1957
- (0, import_react27.useEffect)(() => {
1951
+ const [classNames, setClassNames] = (0, import_react28.useState)();
1952
+ (0, import_react28.useEffect)(() => {
1958
1953
  setClassNames(void 0);
1959
1954
  if (offline || !needsToUpload && !needsToDownload) {
1960
1955
  return;
@@ -1969,23 +1964,23 @@ var SyncStatusIndicator = ({ state, saved }) => {
1969
1964
  needsToDownload
1970
1965
  ]);
1971
1966
  const title = t(`${status} label`);
1972
- const icon = /* @__PURE__ */ import_react27.default.createElement(import_react_ui19.Icon, {
1967
+ const icon = /* @__PURE__ */ import_react28.default.createElement(import_react_ui19.Icon, {
1973
1968
  icon: getIcon(status),
1974
1969
  size: 4,
1975
1970
  classNames
1976
1971
  });
1977
1972
  if (offline) {
1978
- return /* @__PURE__ */ import_react27.default.createElement(import_plugin_status_bar.StatusBar.Item, {
1973
+ return /* @__PURE__ */ import_react28.default.createElement(import_plugin_status_bar.StatusBar.Item, {
1979
1974
  title
1980
1975
  }, icon);
1981
1976
  } else {
1982
- return /* @__PURE__ */ import_react27.default.createElement(import_react_ui19.Popover.Root, null, /* @__PURE__ */ import_react27.default.createElement(import_react_ui19.Popover.Trigger, {
1977
+ return /* @__PURE__ */ import_react28.default.createElement(import_react_ui19.Popover.Root, null, /* @__PURE__ */ import_react28.default.createElement(import_react_ui19.Popover.Trigger, {
1983
1978
  asChild: true
1984
- }, /* @__PURE__ */ import_react27.default.createElement(import_plugin_status_bar.StatusBar.Button, {
1979
+ }, /* @__PURE__ */ import_react28.default.createElement(import_plugin_status_bar.StatusBar.Button, {
1985
1980
  title
1986
- }, icon)), /* @__PURE__ */ import_react27.default.createElement(import_react_ui19.Popover.Portal, null, /* @__PURE__ */ import_react27.default.createElement(import_react_ui19.Popover.Content, {
1981
+ }, icon)), /* @__PURE__ */ import_react28.default.createElement(import_react_ui19.Popover.Portal, null, /* @__PURE__ */ import_react28.default.createElement(import_react_ui19.Popover.Content, {
1987
1982
  sideOffset: 16
1988
- }, /* @__PURE__ */ import_react27.default.createElement(SyncStatusDetail, {
1983
+ }, /* @__PURE__ */ import_react28.default.createElement(SyncStatusDetail, {
1989
1984
  state,
1990
1985
  summary,
1991
1986
  debug: false
@@ -1993,46 +1988,46 @@ var SyncStatusIndicator = ({ state, saved }) => {
1993
1988
  }
1994
1989
  };
1995
1990
  var SyncStatusDetail = ({ classNames, state, summary, debug }) => {
1996
- const [showAll, setShowAll] = (0, import_react27.useState)(false);
1997
- const { t } = (0, import_react_ui19.useTranslation)(import_chunk_QNVEU2UD.SPACE_PLUGIN);
1991
+ const [showAll, setShowAll] = (0, import_react28.useState)(false);
1992
+ const { t } = (0, import_react_ui19.useTranslation)(import_chunk_46S3JOES.SPACE_PLUGIN);
1998
1993
  const entries = Object.entries(state).filter(([_, value]) => showAll || value.missingOnLocal + value.missingOnRemote > 0).toSorted(([a], [b]) => a < b ? -1 : a > b ? 1 : 0);
1999
- const handleCheckedChange = (0, import_react27.useCallback)((state2) => setShowAll(state2), [
1994
+ const handleCheckedChange = (0, import_react28.useCallback)((state2) => setShowAll(state2), [
2000
1995
  setShowAll
2001
1996
  ]);
2002
- return /* @__PURE__ */ import_react27.default.createElement("div", {
2003
- className: (0, import_react_ui_theme4.mx)("flex flex-col gap-3 p-2 text-xs min-w-96", classNames)
2004
- }, /* @__PURE__ */ import_react27.default.createElement("div", {
1997
+ return /* @__PURE__ */ import_react28.default.createElement("div", {
1998
+ className: (0, import_react_ui_theme5.mx)("flex flex-col gap-3 p-2 text-xs min-w-96", classNames)
1999
+ }, /* @__PURE__ */ import_react28.default.createElement("div", {
2005
2000
  role: "none",
2006
2001
  className: "flex items-center"
2007
- }, /* @__PURE__ */ import_react27.default.createElement("h1", {
2002
+ }, /* @__PURE__ */ import_react28.default.createElement("h1", {
2008
2003
  className: "flex-1"
2009
- }, t("sync status title")), /* @__PURE__ */ import_react27.default.createElement("div", {
2004
+ }, t("sync status title")), /* @__PURE__ */ import_react28.default.createElement("div", {
2010
2005
  className: "flex items-center gap-2"
2011
- }, /* @__PURE__ */ import_react27.default.createElement(import_react_ui19.Input.Root, null, /* @__PURE__ */ import_react27.default.createElement(import_react_ui19.Input.Label, {
2006
+ }, /* @__PURE__ */ import_react28.default.createElement(import_react_ui19.Input.Root, null, /* @__PURE__ */ import_react28.default.createElement(import_react_ui19.Input.Label, {
2012
2007
  classNames: "text-xs"
2013
- }, t("show all label")), /* @__PURE__ */ import_react27.default.createElement(import_react_ui19.Input.Checkbox, {
2008
+ }, t("show all label")), /* @__PURE__ */ import_react28.default.createElement(import_react_ui19.Input.Checkbox, {
2014
2009
  checked: showAll,
2015
2010
  onCheckedChange: handleCheckedChange
2016
- })))), /* @__PURE__ */ import_react27.default.createElement("div", {
2011
+ })))), /* @__PURE__ */ import_react28.default.createElement("div", {
2017
2012
  className: "flex flex-col gap-2"
2018
- }, entries.length === 0 && /* @__PURE__ */ import_react27.default.createElement("div", {
2013
+ }, entries.length === 0 && /* @__PURE__ */ import_react28.default.createElement("div", {
2019
2014
  role: "none",
2020
2015
  className: "flex justify-center"
2021
- }, t("no sync status label")), entries.map(([spaceId, state2]) => /* @__PURE__ */ import_react27.default.createElement(SpaceRowContainer, {
2016
+ }, t("no sync status label")), entries.map(([spaceId, state2]) => /* @__PURE__ */ import_react28.default.createElement(SpaceRowContainer, {
2022
2017
  key: spaceId,
2023
2018
  spaceId,
2024
2019
  state: state2
2025
- }))), debug && /* @__PURE__ */ import_react27.default.createElement(import_react_ui_syntax_highlighter.SyntaxHighlighter, {
2020
+ }))), debug && /* @__PURE__ */ import_react28.default.createElement(import_react_ui_syntax_highlighter.SyntaxHighlighter, {
2026
2021
  language: "json"
2027
2022
  }, JSON.stringify(summary, null, 2)));
2028
2023
  };
2029
2024
  var translations_default = [
2030
2025
  {
2031
2026
  "en-US": {
2032
- [import_chunk_6SNOZF7Y.CollectionType.typename]: {
2027
+ [import_chunk_YF2AQ7KP.CollectionType.typename]: {
2033
2028
  "typename label": "Collection"
2034
2029
  },
2035
- [import_chunk_QNVEU2UD.SPACE_PLUGIN]: {
2030
+ [import_chunk_46S3JOES.SPACE_PLUGIN]: {
2036
2031
  "plugin name": "Spaces",
2037
2032
  "first run message": "Nothing selected.",
2038
2033
  "create space label": "Create space",
@@ -2126,7 +2121,7 @@ var translations_default = [
2126
2121
  "open space settings label": "Space Settings",
2127
2122
  "members tab label": "Members",
2128
2123
  "settings tab label": "Settings",
2129
- "syncing message": "Space syncing",
2124
+ "syncing label": "Space syncing",
2130
2125
  "show all label": "Show all",
2131
2126
  "no sync status label": "No space with missing objects.",
2132
2127
  "create space dialog title": "Create Space",
@@ -2134,9 +2129,10 @@ var translations_default = [
2134
2129
  "space input placeholder": "Select space",
2135
2130
  "schema input placeholder": "Select object type",
2136
2131
  "creating object type label": "Type",
2137
- "creating in space label": "In Space",
2132
+ "creating in space label": "Location",
2138
2133
  "creating in collection label": "In Collection",
2139
- "clear input label": "Clear"
2134
+ "clear input label": "Clear",
2135
+ "expose object label": "Expose in navtree"
2140
2136
  }
2141
2137
  }
2142
2138
  }
@@ -2148,8 +2144,8 @@ var SPACE_MAX_OBJECTS = 500;
2148
2144
  var DIRECTORY_TYPE = "text/directory";
2149
2145
  var parseSpacePlugin = (plugin) => Array.isArray(plugin?.provides.space?.enabled) ? plugin : void 0;
2150
2146
  var SpacePlugin = ({ invitationUrl = window.location.origin, invitationParam = "spaceInvitationCode", firstRun, onFirstRun } = {}) => {
2151
- const settings = new import_local_storage.LocalStorageStore(import_chunk_QNVEU2UD.SPACE_PLUGIN, {});
2152
- const state = new import_local_storage.LocalStorageStore(import_chunk_QNVEU2UD.SPACE_PLUGIN, {
2147
+ const settings = new import_local_storage.LocalStorageStore(import_chunk_46S3JOES.SPACE_PLUGIN, {});
2148
+ const state = new import_local_storage.LocalStorageStore(import_chunk_46S3JOES.SPACE_PLUGIN, {
2153
2149
  awaiting: void 0,
2154
2150
  spaceNames: {},
2155
2151
  viewersByObject: {},
@@ -2169,7 +2165,6 @@ var SpacePlugin = ({ invitationUrl = window.location.origin, invitationParam = "
2169
2165
  let layoutPlugin;
2170
2166
  let navigationPlugin;
2171
2167
  let attentionPlugin;
2172
- let metadataPlugin;
2173
2168
  const createSpaceInvitationUrl = (invitationCode) => {
2174
2169
  const baseUrl = new URL(invitationUrl);
2175
2170
  baseUrl.searchParams.set(invitationParam, invitationCode);
@@ -2210,13 +2205,9 @@ var SpacePlugin = ({ invitationUrl = window.location.origin, invitationParam = "
2210
2205
  const timeout = setTimeout(async () => {
2211
2206
  const node2 = graph.findNode(soloPart.id);
2212
2207
  if (!node2) {
2213
- await dispatch({
2214
- plugin: import_chunk_QNVEU2UD.SPACE_PLUGIN,
2215
- action: import_chunk_QNVEU2UD.SpaceAction.WAIT_FOR_OBJECT,
2216
- data: {
2217
- id: soloPart.id
2218
- }
2219
- });
2208
+ await dispatch((0, import_app_framework.createIntent)(import_chunk_YF2AQ7KP.SpaceAction.WaitForObject, {
2209
+ id: soloPart.id
2210
+ }));
2220
2211
  }
2221
2212
  }, WAIT_FOR_OBJECT_TIMEOUT2);
2222
2213
  return () => clearTimeout(timeout);
@@ -2285,7 +2276,7 @@ var SpacePlugin = ({ invitationUrl = window.location.origin, invitationParam = "
2285
2276
  err: err.message
2286
2277
  }, {
2287
2278
  F: __dxlog_file6,
2288
- L: 320,
2279
+ L: 324,
2289
2280
  S: void 0,
2290
2281
  C: (f, a) => f(...a)
2291
2282
  });
@@ -2338,15 +2329,15 @@ var SpacePlugin = ({ invitationUrl = window.location.origin, invitationParam = "
2338
2329
  } catch (err) {
2339
2330
  import_log.log.catch(err, void 0, {
2340
2331
  F: __dxlog_file6,
2341
- L: 389,
2332
+ L: 393,
2342
2333
  S: void 0,
2343
2334
  C: (f, a) => f(...a)
2344
2335
  });
2345
2336
  }
2346
2337
  };
2347
2338
  return {
2348
- meta: import_chunk_QNVEU2UD.meta_default,
2349
- ready: async (plugins) => {
2339
+ meta: import_chunk_46S3JOES.meta_default,
2340
+ ready: async ({ plugins }) => {
2350
2341
  settings.prop({
2351
2342
  key: "showHidden",
2352
2343
  type: import_local_storage.LocalStorageStore.bool({
@@ -2365,34 +2356,33 @@ var SpacePlugin = ({ invitationUrl = window.location.origin, invitationParam = "
2365
2356
  }
2366
2357
  graphPlugin = (0, import_app_framework.resolvePlugin)(plugins, import_app_framework.parseGraphPlugin);
2367
2358
  layoutPlugin = (0, import_app_framework.resolvePlugin)(plugins, import_app_framework.parseLayoutPlugin);
2368
- metadataPlugin = (0, import_app_framework.resolvePlugin)(plugins, import_app_framework.parseMetadataResolverPlugin);
2369
2359
  navigationPlugin = (0, import_app_framework.resolvePlugin)(plugins, import_app_framework.parseNavigationPlugin);
2370
2360
  attentionPlugin = (0, import_app_framework.resolvePlugin)(plugins, import_plugin_attention.parseAttentionPlugin);
2371
- clientPlugin = (0, import_app_framework.resolvePlugin)(plugins, import_plugin_client.parseClientPlugin);
2361
+ clientPlugin = (0, import_app_framework.resolvePlugin)(plugins, import_types.parseClientPlugin);
2372
2362
  intentPlugin = (0, import_app_framework.resolvePlugin)(plugins, import_app_framework.parseIntentPlugin);
2373
2363
  if (!clientPlugin || !intentPlugin) {
2374
2364
  return;
2375
2365
  }
2376
2366
  const client = clientPlugin.provides.client;
2377
- const dispatch = intentPlugin.provides.intent.dispatch;
2378
- schemas.push(...(0, import_app_framework.filterPlugins)(plugins, import_chunk_6SNOZF7Y.parseSchemaPlugin).map((plugin) => plugin.provides.echo.schema).filter(import_util.nonNullable).reduce((acc, schema) => {
2367
+ const dispatch = intentPlugin.provides.intent.dispatchPromise;
2368
+ schemas.push(...(0, import_app_framework.filterPlugins)(plugins, import_chunk_YF2AQ7KP.parseSchemaPlugin).map((plugin) => plugin.provides.echo.schema).filter(import_util.nonNullable).reduce((acc, schema) => {
2379
2369
  return [
2380
2370
  ...acc,
2381
2371
  ...schema
2382
2372
  ];
2383
2373
  }));
2384
2374
  client.addTypes(schemas);
2385
- (0, import_app_framework.filterPlugins)(plugins, import_chunk_6SNOZF7Y.parseSchemaPlugin).forEach((plugin) => {
2375
+ (0, import_app_framework.filterPlugins)(plugins, import_chunk_YF2AQ7KP.parseSchemaPlugin).forEach((plugin) => {
2386
2376
  if (plugin.provides.echo.system) {
2387
2377
  client.addTypes(plugin.provides.echo.system);
2388
2378
  }
2389
2379
  });
2390
2380
  const handleFirstRun = async () => {
2391
2381
  const defaultSpace = client.spaces.default;
2392
- defaultSpace.properties[import_chunk_6SNOZF7Y.CollectionType.typename] = (0, import_live_object.create)(import_chunk_6SNOZF7Y.CollectionType, {
2382
+ defaultSpace.properties[import_chunk_YF2AQ7KP.CollectionType.typename] = (0, import_live_object.makeRef)((0, import_live_object.create)(import_chunk_YF2AQ7KP.CollectionType, {
2393
2383
  objects: [],
2394
2384
  views: {}
2395
- });
2385
+ }));
2396
2386
  if (import_migrations.Migrations.versionProperty) {
2397
2387
  defaultSpace.properties[import_migrations.Migrations.versionProperty] = import_migrations.Migrations.targetVersion;
2398
2388
  }
@@ -2435,7 +2425,7 @@ var SpacePlugin = ({ invitationUrl = window.location.origin, invitationParam = "
2435
2425
  label: [
2436
2426
  "open settings panel label",
2437
2427
  {
2438
- ns: import_chunk_QNVEU2UD.SPACE_PLUGIN
2428
+ ns: import_chunk_46S3JOES.SPACE_PLUGIN
2439
2429
  }
2440
2430
  ],
2441
2431
  icon: "ph--gear--regular"
@@ -2447,148 +2437,226 @@ var SpacePlugin = ({ invitationUrl = window.location.origin, invitationParam = "
2447
2437
  }) : null,
2448
2438
  metadata: {
2449
2439
  records: {
2450
- [import_chunk_6SNOZF7Y.CollectionType.typename]: {
2451
- createObject: import_chunk_QNVEU2UD.CollectionAction.CREATE,
2440
+ [import_chunk_YF2AQ7KP.CollectionType.typename]: {
2441
+ createObject: (props) => (0, import_app_framework.createIntent)(import_chunk_YF2AQ7KP.CollectionAction.Create, props),
2452
2442
  placeholder: [
2453
2443
  "unnamed collection label",
2454
2444
  {
2455
- ns: import_chunk_QNVEU2UD.SPACE_PLUGIN
2445
+ ns: import_chunk_46S3JOES.SPACE_PLUGIN
2456
2446
  }
2457
2447
  ],
2458
2448
  icon: "ph--cards-three--regular",
2459
2449
  // TODO(wittjosiah): Move out of metadata.
2460
- loadReferences: (collection) => (0, import_echo.loadObjectReferences)(collection, (collection2) => [
2461
- ...collection2.objects,
2462
- ...Object.values(collection2.views)
2450
+ loadReferences: async (collection) => await import_live_object.RefArray.loadAll([
2451
+ ...collection.objects,
2452
+ ...Object.values(collection.views)
2463
2453
  ])
2464
2454
  }
2465
2455
  }
2466
2456
  },
2467
2457
  echo: {
2468
2458
  schema: [
2469
- import_chunk_6SNOZF7Y.CollectionType
2459
+ import_chunk_YF2AQ7KP.CollectionType
2470
2460
  ]
2471
2461
  },
2472
2462
  surface: {
2473
- component: ({ data, role, ...rest }) => {
2474
- switch (role) {
2475
- case "article":
2476
- return (0, import_echo.isSpace)(data.object) && data.object.state.get() === import_echo.SpaceState.SPACE_READY ? /* @__PURE__ */ import_react.default.createElement(import_app_framework.Surface, {
2463
+ definitions: ({ plugins }) => {
2464
+ const resolve = (0, import_app_framework.resolvePlugin)(plugins, import_app_framework.parseMetadataResolverPlugin)?.provides.metadata.resolver;
2465
+ const attention = (0, import_app_framework.resolvePlugin)(plugins, import_plugin_attention.parseAttentionPlugin)?.provides.attention;
2466
+ (0, import_invariant.invariant)(resolve, "Metadata plugin not found.", {
2467
+ F: __dxlog_file6,
2468
+ L: 503,
2469
+ S: void 0,
2470
+ A: [
2471
+ "resolve",
2472
+ "'Metadata plugin not found.'"
2473
+ ]
2474
+ });
2475
+ (0, import_invariant.invariant)(attention, "Attention plugin not found.", {
2476
+ F: __dxlog_file6,
2477
+ L: 504,
2478
+ S: void 0,
2479
+ A: [
2480
+ "attention",
2481
+ "'Attention plugin not found.'"
2482
+ ]
2483
+ });
2484
+ return [
2485
+ (0, import_app_framework.createSurface)({
2486
+ id: `${import_chunk_46S3JOES.SPACE_PLUGIN}/article`,
2487
+ role: "article",
2488
+ filter: (data) => (
2489
+ // TODO(wittjosiah): Need to avoid shotgun parsing space state everywhere.
2490
+ (0, import_echo.isSpace)(data.subject) && data.subject.state.get() === import_echo.SpaceState.SPACE_READY
2491
+ ),
2492
+ component: ({ data, role, ...rest }) => /* @__PURE__ */ import_react.default.createElement(import_app_framework.Surface, {
2477
2493
  data: {
2478
- object: data.object.properties[import_chunk_6SNOZF7Y.CollectionType.typename],
2479
- id: data.object.id
2494
+ id: data.subject.id,
2495
+ subject: data.subject.properties[import_chunk_YF2AQ7KP.CollectionType.typename]?.target
2480
2496
  },
2481
2497
  role,
2482
2498
  ...rest
2483
- }) : data.object instanceof import_chunk_6SNOZF7Y.CollectionType ? {
2484
- node: /* @__PURE__ */ import_react.default.createElement(CollectionMain, {
2485
- collection: data.object
2486
- }),
2487
- disposition: "fallback"
2488
- } : null;
2489
- // TODO(burdon): Add role name syntax to minimal plugin docs.
2490
- case "complementary--settings":
2491
- return (0, import_echo.isSpace)(data.subject) ? /* @__PURE__ */ import_react.default.createElement(SpaceSettingsPanel, {
2499
+ })
2500
+ }),
2501
+ (0, import_app_framework.createSurface)({
2502
+ id: `${import_chunk_46S3JOES.SPACE_PLUGIN}/collection-fallback`,
2503
+ role: "article",
2504
+ disposition: "fallback",
2505
+ filter: (data) => data.subject instanceof import_chunk_YF2AQ7KP.CollectionType,
2506
+ component: ({ data }) => /* @__PURE__ */ import_react.default.createElement(CollectionMain, {
2507
+ collection: data.subject
2508
+ })
2509
+ }),
2510
+ (0, import_app_framework.createSurface)({
2511
+ id: `${import_chunk_46S3JOES.SPACE_PLUGIN}/settings-panel`,
2512
+ // TODO(burdon): Add role name syntax to minimal plugin docs.
2513
+ role: "complementary--settings",
2514
+ filter: (data) => (0, import_echo.isSpace)(data.subject),
2515
+ component: ({ data }) => /* @__PURE__ */ import_react.default.createElement(SpaceSettingsPanel, {
2492
2516
  space: data.subject
2493
- }) : (0, import_echo.isEchoObject)(data.subject) ? {
2494
- node: /* @__PURE__ */ import_react.default.createElement(DefaultObjectSettings, {
2495
- object: data.subject
2496
- }),
2497
- disposition: "fallback"
2498
- } : null;
2499
- case "dialog":
2500
- if (data.component === "dxos.org/plugin/space/SpaceSettingsDialog") {
2501
- return /* @__PURE__ */ import_react.default.createElement(SpaceSettingsDialog, {
2502
- ...data.subject,
2503
- createInvitationUrl: createSpaceInvitationUrl
2504
- });
2505
- } else if (data.component === "dxos.org/plugin/space/JoinDialog") {
2506
- return /* @__PURE__ */ import_react.default.createElement(JoinDialog, data.subject);
2507
- } else if (data.component === "dxos.org/plugin/space/CreateSpaceDialog") {
2508
- return /* @__PURE__ */ import_react.default.createElement(CreateSpaceDialog, null);
2509
- } else if (data.component === "dxos.org/plugin/space/CreateObjectDialog") {
2510
- return /* @__PURE__ */ import_react.default.createElement(CreateObjectDialog, {
2511
- ...data.subject,
2512
- schemas,
2513
- navigableCollections: state.values.navigableCollections,
2514
- resolve: metadataPlugin?.provides.metadata.resolver
2515
- });
2516
- }
2517
- return null;
2518
- case "popover": {
2519
- if (data.component === "dxos.org/plugin/space/RenameSpacePopover" && (0, import_echo.isSpace)(data.subject)) {
2520
- return /* @__PURE__ */ import_react.default.createElement(PopoverRenameSpace, {
2521
- space: data.subject
2522
- });
2523
- }
2524
- if (data.component === "dxos.org/plugin/space/RenameObjectPopover" && (0, import_live_object.isReactiveObject)(data.subject)) {
2525
- return /* @__PURE__ */ import_react.default.createElement(PopoverRenameObject, {
2526
- object: data.subject
2527
- });
2528
- }
2529
- return null;
2530
- }
2531
- case "navtree-item-end": {
2532
- return (0, import_live_object.isReactiveObject)(data.object) ? /* @__PURE__ */ import_react.default.createElement(SmallPresenceLive, {
2517
+ })
2518
+ }),
2519
+ (0, import_app_framework.createSurface)({
2520
+ id: `${import_chunk_46S3JOES.SPACE_PLUGIN}/object-settings-panel-fallback`,
2521
+ role: "complementary--settings",
2522
+ disposition: "fallback",
2523
+ filter: (data) => (0, import_echo.isEchoObject)(data.subject),
2524
+ component: ({ data }) => /* @__PURE__ */ import_react.default.createElement(DefaultObjectSettings, {
2525
+ object: data.subject
2526
+ })
2527
+ }),
2528
+ (0, import_app_framework.createSurface)({
2529
+ id: SPACE_SETTINGS_DIALOG,
2530
+ role: "dialog",
2531
+ filter: (data) => data.component === SPACE_SETTINGS_DIALOG,
2532
+ component: ({ data }) => /* @__PURE__ */ import_react.default.createElement(SpaceSettingsDialog, {
2533
+ ...data.subject,
2534
+ createInvitationUrl: createSpaceInvitationUrl
2535
+ })
2536
+ }),
2537
+ (0, import_app_framework.createSurface)({
2538
+ id: JOIN_DIALOG,
2539
+ role: "dialog",
2540
+ filter: (data) => data.component === JOIN_DIALOG,
2541
+ component: ({ data }) => /* @__PURE__ */ import_react.default.createElement(JoinDialog, data.subject)
2542
+ }),
2543
+ (0, import_app_framework.createSurface)({
2544
+ id: CREATE_SPACE_DIALOG,
2545
+ role: "dialog",
2546
+ filter: (data) => data.component === CREATE_SPACE_DIALOG,
2547
+ component: () => /* @__PURE__ */ import_react.default.createElement(CreateSpaceDialog, null)
2548
+ }),
2549
+ (0, import_app_framework.createSurface)({
2550
+ id: CREATE_OBJECT_DIALOG,
2551
+ role: "dialog",
2552
+ filter: (data) => data.component === CREATE_OBJECT_DIALOG,
2553
+ component: ({ data }) => /* @__PURE__ */ import_react.default.createElement(CreateObjectDialog, {
2554
+ schemas,
2555
+ resolve,
2556
+ ...data.subject
2557
+ })
2558
+ }),
2559
+ (0, import_app_framework.createSurface)({
2560
+ id: POPOVER_RENAME_SPACE,
2561
+ role: "popover",
2562
+ filter: (data) => data.component === POPOVER_RENAME_SPACE && (0, import_echo.isSpace)(data.subject),
2563
+ component: ({ data }) => /* @__PURE__ */ import_react.default.createElement(PopoverRenameSpace, {
2564
+ space: data.subject
2565
+ })
2566
+ }),
2567
+ (0, import_app_framework.createSurface)({
2568
+ id: POPOVER_RENAME_OBJECT,
2569
+ role: "popover",
2570
+ filter: (data) => data.component === POPOVER_RENAME_OBJECT && (0, import_live_object.isReactiveObject)(data.subject),
2571
+ component: ({ data }) => /* @__PURE__ */ import_react.default.createElement(PopoverRenameObject, {
2572
+ object: data.subject
2573
+ })
2574
+ }),
2575
+ (0, import_app_framework.createSurface)({
2576
+ id: `${import_chunk_46S3JOES.SPACE_PLUGIN}/navtree-presence`,
2577
+ role: "navtree-item-end",
2578
+ filter: (data) => typeof data.id === "string" && (0, import_echo.isEchoObject)(data.subject),
2579
+ component: ({ data }) => /* @__PURE__ */ import_react.default.createElement(SmallPresenceLive, {
2533
2580
  id: data.id,
2534
- viewers: state.values.viewersByObject[(0, import_echo.fullyQualifiedId)(data.object)]
2535
- }) : (0, import_echo.isSpace)(data.object) ? /* @__PURE__ */ import_react.default.createElement(InlineSyncStatus, {
2536
- space: data.object
2537
- }) : (
2538
- // TODO(wittjosiah): Attention glyph for non-echo items should be handled elsewhere.
2539
- /* @__PURE__ */ import_react.default.createElement(SmallPresence, {
2540
- id: data.id,
2541
- count: 0
2542
- })
2543
- );
2544
- }
2545
- case "navbar-end": {
2546
- if (!(0, import_echo.isEchoObject)(data.object) && !(0, import_echo.isSpace)(data.object)) {
2547
- return null;
2548
- }
2549
- const space = (0, import_echo.isSpace)(data.object) ? data.object : (0, import_echo.getSpace)(data.object);
2550
- const object = (0, import_echo.isSpace)(data.object) ? data.object.state.get() === import_echo.SpaceState.SPACE_READY ? space?.properties[import_chunk_6SNOZF7Y.CollectionType.typename] : void 0 : data.object;
2551
- return space && object ? {
2552
- node: /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(SpacePresence, {
2581
+ open: data.open,
2582
+ viewers: state.values.viewersByObject[data.id]
2583
+ })
2584
+ }),
2585
+ (0, import_app_framework.createSurface)({
2586
+ // TODO(wittjosiah): Attention glyph for non-echo items should be handled elsewhere.
2587
+ id: `${import_chunk_46S3JOES.SPACE_PLUGIN}/navtree-presence-fallback`,
2588
+ role: "navtree-item-end",
2589
+ disposition: "fallback",
2590
+ filter: (data) => typeof data.id === "string",
2591
+ component: ({ data }) => /* @__PURE__ */ import_react.default.createElement(SmallPresenceLive, {
2592
+ id: data.id,
2593
+ open: data.open
2594
+ })
2595
+ }),
2596
+ (0, import_app_framework.createSurface)({
2597
+ id: `${import_chunk_46S3JOES.SPACE_PLUGIN}/navtree-sync-status`,
2598
+ role: "navtree-item-end",
2599
+ filter: (data) => (0, import_echo.isSpace)(data.subject),
2600
+ component: ({ data }) => /* @__PURE__ */ import_react.default.createElement(InlineSyncStatus, {
2601
+ space: data.subject,
2602
+ open: data.open
2603
+ })
2604
+ }),
2605
+ (0, import_app_framework.createSurface)({
2606
+ id: `${import_chunk_46S3JOES.SPACE_PLUGIN}/navbar-presence`,
2607
+ role: "navbar-end",
2608
+ disposition: "hoist",
2609
+ filter: (data) => (0, import_echo.isSpace)(data.subject) || (0, import_echo.isEchoObject)(data.subject),
2610
+ component: ({ data }) => {
2611
+ const space = (0, import_echo.isSpace)(data.subject) ? data.subject : (0, import_echo.getSpace)(data.subject);
2612
+ const object = (0, import_echo.isSpace)(data.subject) ? data.subject.state.get() === import_echo.SpaceState.SPACE_READY ? space?.properties[import_chunk_YF2AQ7KP.CollectionType.typename]?.target : void 0 : data.subject;
2613
+ return space && object ? /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(SpacePresence, {
2553
2614
  object
2554
2615
  }), space.properties[COMPOSER_SPACE_LOCK] ? null : /* @__PURE__ */ import_react.default.createElement(ShareSpaceButton, {
2555
2616
  space
2556
- })),
2557
- disposition: "hoist"
2558
- } : null;
2559
- }
2560
- case "section":
2561
- return data.object instanceof import_chunk_6SNOZF7Y.CollectionType ? /* @__PURE__ */ import_react.default.createElement(CollectionSection, {
2562
- collection: data.object
2563
- }) : null;
2564
- case "settings":
2565
- return data.plugin === import_chunk_QNVEU2UD.meta_default.id ? /* @__PURE__ */ import_react.default.createElement(SpacePluginSettings, {
2566
- settings: settings.values
2567
- }) : null;
2568
- case "menu-footer":
2569
- if ((0, import_echo.isEchoObject)(data.object)) {
2570
- return /* @__PURE__ */ import_react.default.createElement(MenuFooter, {
2571
- object: data.object
2572
- });
2573
- } else {
2574
- return null;
2617
+ })) : null;
2575
2618
  }
2576
- case "status": {
2577
- return /* @__PURE__ */ import_react.default.createElement(SyncStatus, null);
2578
- }
2579
- default:
2580
- return null;
2581
- }
2619
+ }),
2620
+ (0, import_app_framework.createSurface)({
2621
+ id: `${import_chunk_46S3JOES.SPACE_PLUGIN}/collection-section`,
2622
+ role: "section",
2623
+ filter: (data) => data.subject instanceof import_chunk_YF2AQ7KP.CollectionType,
2624
+ component: ({ data }) => /* @__PURE__ */ import_react.default.createElement(CollectionSection, {
2625
+ collection: data.subject
2626
+ })
2627
+ }),
2628
+ (0, import_app_framework.createSurface)({
2629
+ id: `${import_chunk_46S3JOES.SPACE_PLUGIN}/settings`,
2630
+ role: "settings",
2631
+ filter: (data) => data.subject === import_chunk_46S3JOES.SPACE_PLUGIN,
2632
+ component: () => /* @__PURE__ */ import_react.default.createElement(SpacePluginSettings, {
2633
+ settings: settings.values
2634
+ })
2635
+ }),
2636
+ (0, import_app_framework.createSurface)({
2637
+ id: `${import_chunk_46S3JOES.SPACE_PLUGIN}/menu-footer`,
2638
+ role: "menu-footer",
2639
+ filter: (data) => (0, import_echo.isEchoObject)(data.subject),
2640
+ component: ({ data }) => /* @__PURE__ */ import_react.default.createElement(MenuFooter, {
2641
+ object: data.subject
2642
+ })
2643
+ }),
2644
+ (0, import_app_framework.createSurface)({
2645
+ id: `${import_chunk_46S3JOES.SPACE_PLUGIN}/status`,
2646
+ role: "status",
2647
+ component: () => /* @__PURE__ */ import_react.default.createElement(SyncStatus, null)
2648
+ })
2649
+ ];
2582
2650
  }
2583
2651
  },
2584
2652
  graph: {
2585
2653
  builder: (plugins) => {
2586
- const clientPlugin2 = (0, import_app_framework.resolvePlugin)(plugins, import_plugin_client.parseClientPlugin);
2587
- const metadataPlugin2 = (0, import_app_framework.resolvePlugin)(plugins, import_app_framework.parseMetadataResolverPlugin);
2654
+ const clientPlugin2 = (0, import_app_framework.resolvePlugin)(plugins, import_types.parseClientPlugin);
2655
+ const metadataPlugin = (0, import_app_framework.resolvePlugin)(plugins, import_app_framework.parseMetadataResolverPlugin);
2588
2656
  const graphPlugin2 = (0, import_app_framework.resolvePlugin)(plugins, import_app_framework.parseGraphPlugin);
2589
2657
  const client = clientPlugin2?.provides.client;
2590
- const dispatch = intentPlugin?.provides.intent.dispatch;
2591
- const resolve = metadataPlugin2?.provides.metadata.resolver;
2658
+ const dispatch = intentPlugin?.provides.intent.dispatchPromise;
2659
+ const resolve = metadataPlugin?.provides.metadata.resolver;
2592
2660
  const graph = graphPlugin2?.provides.graph;
2593
2661
  if (!client || !dispatch || !resolve || !graph) {
2594
2662
  return [];
@@ -2604,7 +2672,7 @@ var SpacePlugin = ({ invitationUrl = window.location.origin, invitationParam = "
2604
2672
  label: [
2605
2673
  "spaces label",
2606
2674
  {
2607
- ns: import_chunk_QNVEU2UD.SPACE_PLUGIN
2675
+ ns: import_chunk_46S3JOES.SPACE_PLUGIN
2608
2676
  }
2609
2677
  ],
2610
2678
  testId: "spacePlugin.spaces",
@@ -2621,7 +2689,7 @@ var SpacePlugin = ({ invitationUrl = window.location.origin, invitationParam = "
2621
2689
  } else {
2622
2690
  import_log.log.warn("spaces order object not found", void 0, {
2623
2691
  F: __dxlog_file6,
2624
- L: 649,
2692
+ L: 694,
2625
2693
  S: void 0,
2626
2694
  C: (f, a) => f(...a)
2627
2695
  });
@@ -2630,62 +2698,61 @@ var SpacePlugin = ({ invitationUrl = window.location.origin, invitationParam = "
2630
2698
  }
2631
2699
  };
2632
2700
  return [
2633
- // Create spaces group node.
2701
+ // Primary actions.
2634
2702
  (0, import_plugin_graph.createExtension)({
2635
- id: `${import_chunk_QNVEU2UD.SPACE_PLUGIN}/root`,
2703
+ id: `${import_chunk_46S3JOES.SPACE_PLUGIN}/primary-actions`,
2636
2704
  filter: (node) => node.id === "root",
2637
- connector: () => [
2638
- spacesNode
2639
- ],
2640
- resolver: ({ id }) => id === SPACES ? spacesNode : void 0
2641
- }),
2642
- // Create space nodes.
2643
- (0, import_plugin_graph.createExtension)({
2644
- id: SPACES,
2645
- filter: (node) => node.id === SPACES,
2646
2705
  actions: () => [
2647
2706
  {
2648
- id: import_chunk_QNVEU2UD.SpaceAction.OPEN_CREATE_SPACE,
2707
+ id: import_chunk_YF2AQ7KP.SpaceAction.OpenCreateSpace._tag,
2649
2708
  data: async () => {
2650
- await dispatch({
2651
- plugin: import_chunk_QNVEU2UD.SPACE_PLUGIN,
2652
- action: import_chunk_QNVEU2UD.SpaceAction.OPEN_CREATE_SPACE
2653
- });
2709
+ await dispatch((0, import_app_framework.createIntent)(import_chunk_YF2AQ7KP.SpaceAction.OpenCreateSpace));
2654
2710
  },
2655
2711
  properties: {
2656
2712
  label: [
2657
2713
  "create space label",
2658
2714
  {
2659
- ns: import_chunk_QNVEU2UD.SPACE_PLUGIN
2715
+ ns: import_chunk_46S3JOES.SPACE_PLUGIN
2660
2716
  }
2661
2717
  ],
2662
2718
  icon: "ph--plus--regular",
2663
2719
  testId: "spacePlugin.createSpace",
2664
- disposition: "item",
2665
- className: "border-t border-separator"
2720
+ disposition: "item"
2666
2721
  }
2667
2722
  },
2668
2723
  {
2669
- id: import_chunk_QNVEU2UD.SpaceAction.JOIN,
2724
+ id: import_chunk_YF2AQ7KP.SpaceAction.Join._tag,
2670
2725
  data: async () => {
2671
- await dispatch({
2672
- plugin: import_chunk_QNVEU2UD.SPACE_PLUGIN,
2673
- action: import_chunk_QNVEU2UD.SpaceAction.JOIN
2674
- });
2726
+ await dispatch((0, import_app_framework.createIntent)(import_chunk_YF2AQ7KP.SpaceAction.Join));
2675
2727
  },
2676
2728
  properties: {
2677
2729
  label: [
2678
2730
  "join space label",
2679
2731
  {
2680
- ns: import_chunk_QNVEU2UD.SPACE_PLUGIN
2732
+ ns: import_chunk_46S3JOES.SPACE_PLUGIN
2681
2733
  }
2682
2734
  ],
2683
2735
  icon: "ph--sign-in--regular",
2684
2736
  testId: "spacePlugin.joinSpace",
2685
- disposition: "item"
2737
+ disposition: "item",
2738
+ className: "border-b border-separator"
2686
2739
  }
2687
2740
  }
2741
+ ]
2742
+ }),
2743
+ // Create spaces group node.
2744
+ (0, import_plugin_graph.createExtension)({
2745
+ id: `${import_chunk_46S3JOES.SPACE_PLUGIN}/root`,
2746
+ filter: (node) => node.id === "root",
2747
+ connector: () => [
2748
+ spacesNode
2688
2749
  ],
2750
+ resolver: ({ id }) => id === SPACES ? spacesNode : void 0
2751
+ }),
2752
+ // Create space nodes.
2753
+ (0, import_plugin_graph.createExtension)({
2754
+ id: SPACES,
2755
+ filter: (node) => node.id === SPACES,
2689
2756
  connector: () => {
2690
2757
  const spaces = (0, import_plugin_graph.toSignal)((onChange) => client.spaces.subscribe(() => onChange()).unsubscribe, () => client.spaces.get());
2691
2758
  const isReady = (0, import_plugin_graph.toSignal)((onChange) => client.spaces.isReady.subscribe(() => onChange()).unsubscribe, () => client.spaces.isReady.get());
@@ -2742,7 +2809,7 @@ var SpacePlugin = ({ invitationUrl = window.location.origin, invitationParam = "
2742
2809
  }),
2743
2810
  // Create space actions.
2744
2811
  (0, import_plugin_graph.createExtension)({
2745
- id: `${import_chunk_QNVEU2UD.SPACE_PLUGIN}/actions`,
2812
+ id: `${import_chunk_46S3JOES.SPACE_PLUGIN}/actions`,
2746
2813
  filter: (node) => (0, import_echo.isSpace)(node.data),
2747
2814
  actions: ({ node }) => {
2748
2815
  const space = node.data;
@@ -2756,7 +2823,7 @@ var SpacePlugin = ({ invitationUrl = window.location.origin, invitationParam = "
2756
2823
  }),
2757
2824
  // Create nodes for objects in the root collection of a space.
2758
2825
  (0, import_plugin_graph.createExtension)({
2759
- id: `${import_chunk_QNVEU2UD.SPACE_PLUGIN}/root-collection`,
2826
+ id: `${import_chunk_46S3JOES.SPACE_PLUGIN}/root-collection`,
2760
2827
  filter: (node) => (0, import_echo.isSpace)(node.data),
2761
2828
  connector: ({ node }) => {
2762
2829
  const space = node.data;
@@ -2764,11 +2831,11 @@ var SpacePlugin = ({ invitationUrl = window.location.origin, invitationParam = "
2764
2831
  if (spaceState !== import_echo.SpaceState.SPACE_READY) {
2765
2832
  return;
2766
2833
  }
2767
- const collection = space.properties[import_chunk_6SNOZF7Y.CollectionType.typename];
2834
+ const collection = space.properties[import_chunk_YF2AQ7KP.CollectionType.typename]?.target;
2768
2835
  if (!collection) {
2769
2836
  return;
2770
2837
  }
2771
- return collection.objects.filter(import_util.nonNullable).map((object) => createObjectNode({
2838
+ return collection.objects.map((object) => object.target).filter(import_util.nonNullable).map((object) => createObjectNode({
2772
2839
  object,
2773
2840
  space,
2774
2841
  resolve,
@@ -2778,15 +2845,15 @@ var SpacePlugin = ({ invitationUrl = window.location.origin, invitationParam = "
2778
2845
  }),
2779
2846
  // Create nodes for objects in a collection or by its fully qualified id.
2780
2847
  (0, import_plugin_graph.createExtension)({
2781
- id: `${import_chunk_QNVEU2UD.SPACE_PLUGIN}/objects`,
2782
- filter: (node) => node.data instanceof import_chunk_6SNOZF7Y.CollectionType,
2848
+ id: `${import_chunk_46S3JOES.SPACE_PLUGIN}/objects`,
2849
+ filter: (node) => node.data instanceof import_chunk_YF2AQ7KP.CollectionType,
2783
2850
  connector: ({ node }) => {
2784
2851
  const collection = node.data;
2785
2852
  const space = (0, import_echo.getSpace)(collection);
2786
2853
  if (!space) {
2787
2854
  return;
2788
2855
  }
2789
- return collection.objects.filter(import_util.nonNullable).map((object) => createObjectNode({
2856
+ return collection.objects.map((object) => object.target).filter(import_util.nonNullable).map((object) => createObjectNode({
2790
2857
  object,
2791
2858
  space,
2792
2859
  resolve,
@@ -2814,11 +2881,13 @@ var SpacePlugin = ({ invitationUrl = window.location.origin, invitationParam = "
2814
2881
  if (!store.value) {
2815
2882
  void space.db.query({
2816
2883
  id: objectId
2884
+ }, {
2885
+ deleted: import_echo.QueryOptions.ShowDeletedOption.SHOW_DELETED
2817
2886
  }).first().then((o) => store.value = o).catch((err) => import_log.log.catch(err, {
2818
2887
  objectId
2819
2888
  }, {
2820
2889
  F: __dxlog_file6,
2821
- L: 872,
2890
+ L: 919,
2822
2891
  S: void 0,
2823
2892
  C: (f, a) => f(...a)
2824
2893
  }));
@@ -2842,7 +2911,7 @@ var SpacePlugin = ({ invitationUrl = window.location.origin, invitationParam = "
2842
2911
  }),
2843
2912
  // Create collection actions and action groups.
2844
2913
  (0, import_plugin_graph.createExtension)({
2845
- id: `${import_chunk_QNVEU2UD.SPACE_PLUGIN}/object-actions`,
2914
+ id: `${import_chunk_46S3JOES.SPACE_PLUGIN}/object-actions`,
2846
2915
  filter: (node) => (0, import_echo.isEchoObject)(node.data),
2847
2916
  actions: ({ node }) => constructObjectActions({
2848
2917
  node,
@@ -2851,7 +2920,7 @@ var SpacePlugin = ({ invitationUrl = window.location.origin, invitationParam = "
2851
2920
  }),
2852
2921
  // Create nodes for object settings.
2853
2922
  (0, import_plugin_graph.createExtension)({
2854
- id: `${import_chunk_QNVEU2UD.SPACE_PLUGIN}/settings-for-subject`,
2923
+ id: `${import_chunk_46S3JOES.SPACE_PLUGIN}/settings-for-subject`,
2855
2924
  resolver: ({ id }) => {
2856
2925
  if (!id.endsWith("~settings")) {
2857
2926
  return;
@@ -2866,12 +2935,12 @@ var SpacePlugin = ({ invitationUrl = window.location.origin, invitationParam = "
2866
2935
  const label2 = space ? space.properties.name || [
2867
2936
  "unnamed space label",
2868
2937
  {
2869
- ns: import_chunk_QNVEU2UD.SPACE_PLUGIN
2938
+ ns: import_chunk_46S3JOES.SPACE_PLUGIN
2870
2939
  }
2871
2940
  ] : [
2872
2941
  "unnamed object settings label",
2873
2942
  {
2874
- ns: import_chunk_QNVEU2UD.SPACE_PLUGIN
2943
+ ns: import_chunk_46S3JOES.SPACE_PLUGIN
2875
2944
  }
2876
2945
  ];
2877
2946
  return {
@@ -2897,7 +2966,7 @@ var SpacePlugin = ({ invitationUrl = window.location.origin, invitationParam = "
2897
2966
  const label = meta.label?.(object) || object.name || meta.placeholder || [
2898
2967
  "unnamed object settings label",
2899
2968
  {
2900
- ns: import_chunk_QNVEU2UD.SPACE_PLUGIN
2969
+ ns: import_chunk_46S3JOES.SPACE_PLUGIN
2901
2970
  }
2902
2971
  ];
2903
2972
  return {
@@ -2915,7 +2984,7 @@ var SpacePlugin = ({ invitationUrl = window.location.origin, invitationParam = "
2915
2984
  ];
2916
2985
  },
2917
2986
  serializer: (plugins) => {
2918
- const dispatch = (0, import_app_framework.resolvePlugin)(plugins, import_app_framework.parseIntentPlugin)?.provides.intent.dispatch;
2987
+ const dispatch = (0, import_app_framework.resolvePlugin)(plugins, import_app_framework.parseIntentPlugin)?.provides.intent.dispatchPromise;
2919
2988
  if (!dispatch) {
2920
2989
  return [];
2921
2990
  }
@@ -2924,8 +2993,8 @@ var SpacePlugin = ({ invitationUrl = window.location.origin, invitationParam = "
2924
2993
  inputType: SPACES,
2925
2994
  outputType: DIRECTORY_TYPE,
2926
2995
  serialize: (node) => ({
2927
- name: translations_default[0]["en-US"][import_chunk_QNVEU2UD.SPACE_PLUGIN]["spaces label"],
2928
- data: translations_default[0]["en-US"][import_chunk_QNVEU2UD.SPACE_PLUGIN]["spaces label"],
2996
+ name: translations_default[0]["en-US"][import_chunk_46S3JOES.SPACE_PLUGIN]["spaces label"],
2997
+ data: translations_default[0]["en-US"][import_chunk_46S3JOES.SPACE_PLUGIN]["spaces label"],
2929
2998
  type: DIRECTORY_TYPE
2930
2999
  }),
2931
3000
  deserialize: () => {
@@ -2935,98 +3004,101 @@ var SpacePlugin = ({ invitationUrl = window.location.origin, invitationParam = "
2935
3004
  inputType: SPACE_TYPE,
2936
3005
  outputType: DIRECTORY_TYPE,
2937
3006
  serialize: (node) => ({
2938
- name: node.data.properties.name ?? translations_default[0]["en-US"][import_chunk_QNVEU2UD.SPACE_PLUGIN]["unnamed space label"],
2939
- data: node.data.properties.name ?? translations_default[0]["en-US"][import_chunk_QNVEU2UD.SPACE_PLUGIN]["unnamed space label"],
3007
+ name: node.data.properties.name ?? translations_default[0]["en-US"][import_chunk_46S3JOES.SPACE_PLUGIN]["unnamed space label"],
3008
+ data: node.data.properties.name ?? translations_default[0]["en-US"][import_chunk_46S3JOES.SPACE_PLUGIN]["unnamed space label"],
2940
3009
  type: DIRECTORY_TYPE
2941
3010
  }),
2942
3011
  deserialize: async (data) => {
2943
- const result = await dispatch({
2944
- plugin: import_chunk_QNVEU2UD.SPACE_PLUGIN,
2945
- action: import_chunk_QNVEU2UD.SpaceAction.CREATE,
2946
- data: {
2947
- name: data.name
2948
- }
2949
- });
2950
- return result?.data.space;
3012
+ const result = await dispatch((0, import_app_framework.createIntent)(import_chunk_YF2AQ7KP.SpaceAction.Create, {
3013
+ name: data.name,
3014
+ edgeReplication: true
3015
+ }));
3016
+ return result.data?.space;
2951
3017
  }
2952
3018
  },
2953
3019
  {
2954
- inputType: import_chunk_6SNOZF7Y.CollectionType.typename,
3020
+ inputType: import_chunk_YF2AQ7KP.CollectionType.typename,
2955
3021
  outputType: DIRECTORY_TYPE,
2956
3022
  serialize: (node) => ({
2957
- name: node.data.name ?? translations_default[0]["en-US"][import_chunk_QNVEU2UD.SPACE_PLUGIN]["unnamed collection label"],
2958
- data: node.data.name ?? translations_default[0]["en-US"][import_chunk_QNVEU2UD.SPACE_PLUGIN]["unnamed collection label"],
3023
+ name: node.data.name ?? translations_default[0]["en-US"][import_chunk_46S3JOES.SPACE_PLUGIN]["unnamed collection label"],
3024
+ data: node.data.name ?? translations_default[0]["en-US"][import_chunk_46S3JOES.SPACE_PLUGIN]["unnamed collection label"],
2959
3025
  type: DIRECTORY_TYPE
2960
3026
  }),
2961
3027
  deserialize: async (data, ancestors) => {
2962
3028
  const space = ancestors.find(import_echo.isSpace);
2963
- const collection = ancestors.findLast((ancestor) => ancestor instanceof import_chunk_6SNOZF7Y.CollectionType) ?? space?.properties[import_chunk_6SNOZF7Y.CollectionType.typename];
3029
+ const collection = ancestors.findLast((ancestor) => ancestor instanceof import_chunk_YF2AQ7KP.CollectionType) ?? space?.properties[import_chunk_YF2AQ7KP.CollectionType.typename]?.target;
2964
3030
  if (!space || !collection) {
2965
3031
  return;
2966
3032
  }
2967
- const result = await dispatch({
2968
- plugin: import_chunk_QNVEU2UD.SPACE_PLUGIN,
2969
- action: import_chunk_QNVEU2UD.SpaceAction.ADD_OBJECT,
2970
- data: {
2971
- target: collection,
2972
- object: (0, import_live_object.create)(import_chunk_6SNOZF7Y.CollectionType, {
2973
- name: data.name,
2974
- objects: [],
2975
- views: {}
2976
- })
2977
- }
2978
- });
2979
- return result?.data.object;
3033
+ const result = await dispatch((0, import_app_framework.createIntent)(import_chunk_YF2AQ7KP.SpaceAction.AddObject, {
3034
+ target: collection,
3035
+ object: (0, import_live_object.create)(import_chunk_YF2AQ7KP.CollectionType, {
3036
+ name: data.name,
3037
+ objects: [],
3038
+ views: {}
3039
+ })
3040
+ }));
3041
+ return result.data?.object;
2980
3042
  }
2981
3043
  }
2982
3044
  ];
2983
3045
  }
2984
3046
  },
2985
3047
  intent: {
2986
- resolver: async (intent, plugins) => {
2987
- const clientPlugin2 = (0, import_app_framework.resolvePlugin)(plugins, import_plugin_client.parseClientPlugin);
2988
- const client = clientPlugin2?.provides.client;
2989
- switch (intent.action) {
2990
- case import_chunk_QNVEU2UD.SpaceAction.WAIT_FOR_OBJECT: {
2991
- state.values.awaiting = intent.data?.id;
2992
- return {
2993
- data: true
2994
- };
2995
- }
2996
- case import_chunk_QNVEU2UD.SpaceAction.OPEN_CREATE_SPACE: {
2997
- return {
2998
- data: true,
2999
- intents: [
3000
- [
3001
- {
3002
- action: import_app_framework.LayoutAction.SET_LAYOUT,
3003
- data: {
3004
- element: "dialog",
3005
- component: "dxos.org/plugin/space/CreateSpaceDialog",
3006
- dialogBlockAlign: "start",
3007
- subject: intent.data
3008
- }
3009
- }
3010
- ]
3011
- ]
3012
- };
3013
- }
3014
- case import_chunk_QNVEU2UD.SpaceAction.CREATE: {
3015
- if (!client || !import_echo_schema.S.is(import_chunk_6SNOZF7Y.SpaceForm)(intent.data)) {
3016
- return;
3017
- }
3048
+ resolvers: ({ plugins, dispatchPromise: dispatch }) => {
3049
+ const activeParts = (0, import_app_framework.resolvePlugin)(plugins, import_app_framework.parseNavigationPlugin)?.provides.location.active;
3050
+ const client = (0, import_app_framework.resolvePlugin)(plugins, import_types.parseClientPlugin)?.provides.client;
3051
+ const resolve = (0, import_app_framework.resolvePlugin)(plugins, import_app_framework.parseMetadataResolverPlugin)?.provides.metadata.resolver;
3052
+ (0, import_invariant.invariant)(activeParts, "Active parts not available.", {
3053
+ F: __dxlog_file6,
3054
+ L: 1078,
3055
+ S: void 0,
3056
+ A: [
3057
+ "activeParts",
3058
+ "'Active parts not available.'"
3059
+ ]
3060
+ });
3061
+ (0, import_invariant.invariant)(client, "Client not available.", {
3062
+ F: __dxlog_file6,
3063
+ L: 1079,
3064
+ S: void 0,
3065
+ A: [
3066
+ "client",
3067
+ "'Client not available.'"
3068
+ ]
3069
+ });
3070
+ (0, import_invariant.invariant)(resolve, "Metadata resolver not available.", {
3071
+ F: __dxlog_file6,
3072
+ L: 1080,
3073
+ S: void 0,
3074
+ A: [
3075
+ "resolve",
3076
+ "'Metadata resolver not available.'"
3077
+ ]
3078
+ });
3079
+ return [
3080
+ (0, import_app_framework.createResolver)(import_chunk_YF2AQ7KP.SpaceAction.OpenCreateSpace, () => ({
3081
+ intents: [
3082
+ (0, import_app_framework.createIntent)(import_app_framework.LayoutAction.SetLayout, {
3083
+ element: "dialog",
3084
+ component: CREATE_SPACE_DIALOG,
3085
+ dialogBlockAlign: "start"
3086
+ })
3087
+ ]
3088
+ })),
3089
+ (0, import_app_framework.createResolver)(import_chunk_YF2AQ7KP.SpaceAction.Create, async ({ name, edgeReplication }) => {
3018
3090
  const space = await client.spaces.create({
3019
- name: intent.data.name
3091
+ name
3020
3092
  });
3021
- if (intent.data.edgeReplication) {
3093
+ if (edgeReplication) {
3022
3094
  await space.internal.setEdgeReplicationPreference(import_metadata.EdgeReplicationSetting.ENABLED);
3023
3095
  }
3024
3096
  await space.waitUntilReady();
3025
- const collection = (0, import_live_object.create)(import_chunk_6SNOZF7Y.CollectionType, {
3097
+ const collection = (0, import_live_object.create)(import_chunk_YF2AQ7KP.CollectionType, {
3026
3098
  objects: [],
3027
3099
  views: {}
3028
3100
  });
3029
- space.properties[import_chunk_6SNOZF7Y.CollectionType.typename] = collection;
3101
+ space.properties[import_chunk_YF2AQ7KP.CollectionType.typename] = (0, import_live_object.makeRef)(collection);
3030
3102
  if (import_migrations.Migrations.versionProperty) {
3031
3103
  space.properties[import_migrations.Migrations.versionProperty] = import_migrations.Migrations.targetVersion;
3032
3104
  }
@@ -3041,304 +3113,224 @@ var SpacePlugin = ({ invitationUrl = window.location.origin, invitationParam = "
3041
3113
  }
3042
3114
  },
3043
3115
  intents: [
3044
- [
3045
- {
3046
- action: import_meta.ObservabilityAction.SEND_EVENT,
3047
- data: {
3048
- name: "space.create",
3049
- properties: {
3050
- spaceId: space.id
3051
- }
3052
- }
3116
+ (0, import_app_framework.createIntent)(import_types2.ObservabilityAction.SendEvent, {
3117
+ name: "space.create",
3118
+ properties: {
3119
+ spaceId: space.id
3053
3120
  }
3054
- ]
3121
+ })
3055
3122
  ]
3056
3123
  };
3057
- }
3058
- case import_chunk_QNVEU2UD.SpaceAction.JOIN: {
3124
+ }),
3125
+ (0, import_app_framework.createResolver)(import_chunk_YF2AQ7KP.SpaceAction.Join, ({ invitationCode }) => ({
3126
+ intents: [
3127
+ (0, import_app_framework.createIntent)(import_app_framework.LayoutAction.SetLayout, {
3128
+ element: "dialog",
3129
+ component: JOIN_DIALOG,
3130
+ dialogBlockAlign: "start",
3131
+ subject: {
3132
+ initialInvitationCode: invitationCode
3133
+ }
3134
+ })
3135
+ ]
3136
+ })),
3137
+ (0, import_app_framework.createResolver)(import_chunk_YF2AQ7KP.SpaceAction.Share, ({ space }) => {
3138
+ const active = navigationPlugin?.provides.location.active;
3139
+ const mode = layoutPlugin?.provides.layout.layoutMode;
3140
+ const current = active ? (0, import_app_framework.firstIdInPart)(active, mode === "solo" ? "solo" : "main") : void 0;
3141
+ const target = current?.startsWith(space.id) ? current : void 0;
3059
3142
  return {
3060
- data: true,
3061
3143
  intents: [
3062
- [
3063
- {
3064
- action: import_app_framework.LayoutAction.SET_LAYOUT,
3065
- data: {
3066
- element: "dialog",
3067
- component: "dxos.org/plugin/space/JoinDialog",
3068
- dialogBlockAlign: "start",
3069
- subject: {
3070
- initialInvitationCode: intent.data?.invitationCode,
3071
- onDone: intent.data?.onDone
3072
- }
3073
- }
3144
+ (0, import_app_framework.createIntent)(import_app_framework.LayoutAction.SetLayout, {
3145
+ element: "dialog",
3146
+ component: SPACE_SETTINGS_DIALOG,
3147
+ dialogBlockAlign: "start",
3148
+ subject: {
3149
+ space,
3150
+ target,
3151
+ initialTab: "members",
3152
+ createInvitationUrl: createSpaceInvitationUrl
3074
3153
  }
3075
- ]
3154
+ }),
3155
+ (0, import_app_framework.createIntent)(import_types2.ObservabilityAction.SendEvent, {
3156
+ name: "space.share",
3157
+ properties: {
3158
+ space: space.id
3159
+ }
3160
+ })
3076
3161
  ]
3077
3162
  };
3078
- }
3079
- case import_chunk_QNVEU2UD.SpaceAction.SHARE: {
3080
- const space = intent.data?.space;
3081
- if ((0, import_echo.isSpace)(space) && !space.properties[COMPOSER_SPACE_LOCK]) {
3082
- const active = navigationPlugin?.provides.location.active;
3083
- const mode = layoutPlugin?.provides.layout.layoutMode;
3084
- const current = active ? (0, import_app_framework.firstIdInPart)(active, mode === "solo" ? "solo" : "main") : void 0;
3085
- const target = current?.startsWith(space.id) ? current : void 0;
3086
- return {
3087
- data: true,
3088
- intents: [
3089
- [
3090
- {
3091
- action: import_app_framework.LayoutAction.SET_LAYOUT,
3092
- data: {
3093
- element: "dialog",
3094
- component: "dxos.org/plugin/space/SpaceSettingsDialog",
3095
- dialogBlockAlign: "start",
3096
- subject: {
3097
- space,
3098
- target,
3099
- initialTab: "members",
3100
- createInvitationUrl: createSpaceInvitationUrl
3101
- }
3102
- }
3103
- }
3104
- ],
3105
- [
3106
- {
3107
- action: import_meta.ObservabilityAction.SEND_EVENT,
3108
- data: {
3109
- name: "space.share",
3110
- properties: {
3111
- space: space.id
3112
- }
3113
- }
3114
- }
3115
- ]
3116
- ]
3117
- };
3118
- }
3119
- break;
3120
- }
3121
- case import_chunk_QNVEU2UD.SpaceAction.LOCK: {
3122
- const space = intent.data?.space;
3123
- if ((0, import_echo.isSpace)(space)) {
3124
- space.properties[COMPOSER_SPACE_LOCK] = true;
3125
- return {
3126
- data: true,
3127
- intents: [
3128
- [
3129
- {
3130
- action: import_meta.ObservabilityAction.SEND_EVENT,
3131
- data: {
3132
- name: "space.lock",
3133
- properties: {
3134
- spaceId: space.id
3135
- }
3136
- }
3137
- }
3138
- ]
3139
- ]
3140
- };
3141
- }
3142
- break;
3143
- }
3144
- case import_chunk_QNVEU2UD.SpaceAction.UNLOCK: {
3145
- const space = intent.data?.space;
3146
- if ((0, import_echo.isSpace)(space)) {
3147
- space.properties[COMPOSER_SPACE_LOCK] = false;
3148
- return {
3149
- data: true,
3150
- intents: [
3151
- [
3152
- {
3153
- action: import_meta.ObservabilityAction.SEND_EVENT,
3154
- data: {
3155
- name: "space.unlock",
3156
- properties: {
3157
- spaceId: space.id
3158
- }
3159
- }
3160
- }
3161
- ]
3162
- ]
3163
- };
3164
- }
3165
- break;
3166
- }
3167
- case import_chunk_QNVEU2UD.SpaceAction.RENAME: {
3168
- const { caller, space } = intent.data ?? {};
3169
- if (typeof caller === "string" && (0, import_echo.isSpace)(space)) {
3170
- return {
3171
- intents: [
3172
- [
3173
- {
3174
- action: import_app_framework.LayoutAction.SET_LAYOUT,
3175
- data: {
3176
- element: "popover",
3177
- anchorId: `dxos.org/ui/${caller}/${space.id}`,
3178
- component: "dxos.org/plugin/space/RenameSpacePopover",
3179
- subject: space
3180
- }
3181
- }
3182
- ]
3183
- ]
3184
- };
3185
- }
3186
- break;
3187
- }
3188
- case import_chunk_QNVEU2UD.SpaceAction.OPEN_SETTINGS: {
3189
- const space = intent.data?.space;
3190
- if ((0, import_echo.isSpace)(space)) {
3191
- return {
3192
- data: true,
3193
- intents: [
3194
- [
3195
- {
3196
- action: import_app_framework.LayoutAction.SET_LAYOUT,
3197
- data: {
3198
- element: "dialog",
3199
- component: "dxos.org/plugin/space/SpaceSettingsDialog",
3200
- dialogBlockAlign: "start",
3201
- subject: {
3202
- space,
3203
- initialTab: "settings",
3204
- createInvitationUrl: createSpaceInvitationUrl
3205
- }
3206
- }
3207
- }
3208
- ]
3209
- ]
3210
- };
3211
- }
3212
- break;
3213
- }
3214
- case import_chunk_QNVEU2UD.SpaceAction.OPEN: {
3215
- const space = intent.data?.space;
3216
- if ((0, import_echo.isSpace)(space)) {
3217
- await space.open();
3218
- return {
3219
- data: true
3220
- };
3221
- }
3222
- break;
3223
- }
3224
- case import_chunk_QNVEU2UD.SpaceAction.CLOSE: {
3225
- const space = intent.data?.space;
3226
- if ((0, import_echo.isSpace)(space)) {
3227
- await space.close();
3228
- return {
3229
- data: true
3230
- };
3231
- }
3232
- break;
3233
- }
3234
- case import_chunk_QNVEU2UD.SpaceAction.MIGRATE: {
3235
- const space = intent.data?.space;
3236
- if ((0, import_echo.isSpace)(space)) {
3237
- if (space.state.get() === import_echo.SpaceState.SPACE_REQUIRES_MIGRATION) {
3238
- state.values.sdkMigrationRunning[space.id] = true;
3239
- await space.internal.migrate();
3240
- state.values.sdkMigrationRunning[space.id] = false;
3241
- }
3242
- const result = await import_migrations.Migrations.migrate(space, intent.data?.version);
3243
- return {
3244
- data: result,
3245
- intents: [
3246
- [
3247
- {
3248
- action: import_meta.ObservabilityAction.SEND_EVENT,
3249
- data: {
3250
- name: "space.migrate",
3251
- properties: {
3252
- spaceId: space.id,
3253
- version: intent.data?.version
3254
- }
3255
- }
3256
- }
3257
- ]
3258
- ]
3259
- };
3260
- }
3261
- break;
3262
- }
3263
- case import_chunk_QNVEU2UD.SpaceAction.OPEN_CREATE_OBJECT: {
3163
+ }, {
3164
+ filter: (data) => !data.space.properties[COMPOSER_SPACE_LOCK]
3165
+ }),
3166
+ (0, import_app_framework.createResolver)(import_chunk_YF2AQ7KP.SpaceAction.Lock, ({ space }) => {
3167
+ space.properties[COMPOSER_SPACE_LOCK] = true;
3264
3168
  return {
3265
- data: true,
3266
3169
  intents: [
3267
- [
3268
- {
3269
- action: import_app_framework.LayoutAction.SET_LAYOUT,
3270
- data: {
3271
- element: "dialog",
3272
- component: "dxos.org/plugin/space/CreateObjectDialog",
3273
- dialogBlockAlign: "start",
3274
- subject: intent.data
3275
- }
3170
+ (0, import_app_framework.createIntent)(import_types2.ObservabilityAction.SendEvent, {
3171
+ name: "space.lock",
3172
+ properties: {
3173
+ spaceId: space.id
3276
3174
  }
3277
- ]
3175
+ })
3278
3176
  ]
3279
3177
  };
3280
- }
3281
- case import_chunk_QNVEU2UD.SpaceAction.ADD_OBJECT: {
3282
- const object = intent.data?.object ?? intent.data?.result;
3283
- if (!(0, import_live_object.isReactiveObject)(object)) {
3284
- return;
3285
- }
3286
- const space = (0, import_echo.isSpace)(intent.data?.target) ? intent.data?.target : (0, import_echo.getSpace)(intent.data?.target);
3287
- if (!space) {
3288
- return;
3178
+ }),
3179
+ (0, import_app_framework.createResolver)(import_chunk_YF2AQ7KP.SpaceAction.Unlock, ({ space }) => {
3180
+ space.properties[COMPOSER_SPACE_LOCK] = false;
3181
+ return {
3182
+ intents: [
3183
+ (0, import_app_framework.createIntent)(import_types2.ObservabilityAction.SendEvent, {
3184
+ name: "space.unlock",
3185
+ properties: {
3186
+ spaceId: space.id
3187
+ }
3188
+ })
3189
+ ]
3190
+ };
3191
+ }),
3192
+ (0, import_app_framework.createResolver)(import_chunk_YF2AQ7KP.SpaceAction.Rename, ({ caller, space }) => {
3193
+ return {
3194
+ intents: [
3195
+ (0, import_app_framework.createIntent)(import_app_framework.LayoutAction.SetLayout, {
3196
+ element: "popover",
3197
+ anchorId: `dxos.org/ui/${caller}/${space.id}`,
3198
+ component: POPOVER_RENAME_SPACE,
3199
+ subject: space
3200
+ })
3201
+ ]
3202
+ };
3203
+ }),
3204
+ (0, import_app_framework.createResolver)(import_chunk_YF2AQ7KP.SpaceAction.OpenSettings, ({ space }) => {
3205
+ return {
3206
+ intents: [
3207
+ (0, import_app_framework.createIntent)(import_app_framework.LayoutAction.SetLayout, {
3208
+ element: "dialog",
3209
+ component: SPACE_SETTINGS_DIALOG,
3210
+ dialogBlockAlign: "start",
3211
+ subject: {
3212
+ space,
3213
+ initialTab: "settings",
3214
+ createInvitationUrl: createSpaceInvitationUrl
3215
+ }
3216
+ })
3217
+ ]
3218
+ };
3219
+ }),
3220
+ (0, import_app_framework.createResolver)(import_chunk_YF2AQ7KP.SpaceAction.Open, async ({ space }) => {
3221
+ await space.open();
3222
+ }),
3223
+ (0, import_app_framework.createResolver)(import_chunk_YF2AQ7KP.SpaceAction.Close, async ({ space }) => {
3224
+ await space.close();
3225
+ }),
3226
+ (0, import_app_framework.createResolver)(import_chunk_YF2AQ7KP.SpaceAction.Migrate, async ({ space, version }) => {
3227
+ if (space.state.get() === import_echo.SpaceState.SPACE_REQUIRES_MIGRATION) {
3228
+ state.values.sdkMigrationRunning[space.id] = true;
3229
+ await space.internal.migrate();
3230
+ state.values.sdkMigrationRunning[space.id] = false;
3289
3231
  }
3232
+ const result = await import_migrations.Migrations.migrate(space, version);
3233
+ return {
3234
+ data: result,
3235
+ intents: [
3236
+ (0, import_app_framework.createIntent)(import_types2.ObservabilityAction.SendEvent, {
3237
+ name: "space.migrate",
3238
+ properties: {
3239
+ spaceId: space.id,
3240
+ version
3241
+ }
3242
+ })
3243
+ ]
3244
+ };
3245
+ }),
3246
+ (0, import_app_framework.createResolver)(import_chunk_YF2AQ7KP.SpaceAction.OpenCreateObject, ({ target, navigable = true }) => {
3247
+ return {
3248
+ intents: [
3249
+ (0, import_app_framework.createIntent)(import_app_framework.LayoutAction.SetLayout, {
3250
+ element: "dialog",
3251
+ component: CREATE_OBJECT_DIALOG,
3252
+ dialogBlockAlign: "start",
3253
+ subject: {
3254
+ target,
3255
+ shouldNavigate: navigable ? (object) => !(object instanceof import_chunk_YF2AQ7KP.CollectionType) || state.values.navigableCollections : () => false
3256
+ }
3257
+ })
3258
+ ]
3259
+ };
3260
+ }),
3261
+ (0, import_app_framework.createResolver)(import_chunk_YF2AQ7KP.SpaceAction.AddObject, async ({ target, object }) => {
3262
+ const space = (0, import_echo.isSpace)(target) ? target : (0, import_echo.getSpace)(target);
3263
+ (0, import_invariant.invariant)(space, "Space not found.", {
3264
+ F: __dxlog_file6,
3265
+ L: 1265,
3266
+ S: void 0,
3267
+ A: [
3268
+ "space",
3269
+ "'Space not found.'"
3270
+ ]
3271
+ });
3290
3272
  if (space.db.coreDatabase.getAllObjectIds().length >= SPACE_MAX_OBJECTS) {
3291
- return {
3292
- data: false,
3293
- intents: [
3294
- [
3273
+ void dispatch((0, import_app_framework.createIntent)(import_app_framework.LayoutAction.SetLayout, {
3274
+ element: "toast",
3275
+ subject: {
3276
+ id: `${import_chunk_46S3JOES.SPACE_PLUGIN}/space-limit`,
3277
+ title: [
3278
+ "space limit label",
3295
3279
  {
3296
- action: import_app_framework.LayoutAction.SET_LAYOUT,
3297
- data: {
3298
- element: "toast",
3299
- subject: {
3300
- id: `${import_chunk_QNVEU2UD.SPACE_PLUGIN}/space-limit`,
3301
- title: translations_default[0]["en-US"][import_chunk_QNVEU2UD.SPACE_PLUGIN]["space limit label"],
3302
- description: translations_default[0]["en-US"][import_chunk_QNVEU2UD.SPACE_PLUGIN]["space limit description"],
3303
- duration: 5e3,
3304
- icon: "ph--warning--regular",
3305
- actionLabel: translations_default[0]["en-US"][import_chunk_QNVEU2UD.SPACE_PLUGIN]["remove deleted objects label"],
3306
- actionAlt: translations_default[0]["en-US"][import_chunk_QNVEU2UD.SPACE_PLUGIN]["remove deleted objects alt"],
3307
- // TODO(wittjosiah): Use OS namespace.
3308
- closeLabel: translations_default[0]["en-US"][import_chunk_QNVEU2UD.SPACE_PLUGIN]["space limit close label"],
3309
- onAction: () => space.db.coreDatabase.unlinkDeletedObjects()
3310
- }
3311
- }
3280
+ ns: import_chunk_46S3JOES.SPACE_PLUGIN
3312
3281
  }
3313
3282
  ],
3314
- [
3283
+ description: [
3284
+ "space limit description",
3315
3285
  {
3316
- action: import_meta.ObservabilityAction.SEND_EVENT,
3317
- data: {
3318
- name: "space.limit",
3319
- properties: {
3320
- spaceId: space.id
3321
- }
3322
- }
3286
+ ns: import_chunk_46S3JOES.SPACE_PLUGIN
3323
3287
  }
3324
- ]
3325
- ]
3326
- };
3288
+ ],
3289
+ duration: 5e3,
3290
+ icon: "ph--warning--regular",
3291
+ actionLabel: [
3292
+ "remove deleted objects label",
3293
+ {
3294
+ ns: import_chunk_46S3JOES.SPACE_PLUGIN
3295
+ }
3296
+ ],
3297
+ actionAlt: [
3298
+ "remove deleted objects alt",
3299
+ {
3300
+ ns: import_chunk_46S3JOES.SPACE_PLUGIN
3301
+ }
3302
+ ],
3303
+ closeLabel: [
3304
+ "close label",
3305
+ {
3306
+ ns: "os"
3307
+ }
3308
+ ],
3309
+ onAction: () => space.db.coreDatabase.unlinkDeletedObjects()
3310
+ }
3311
+ }));
3312
+ void dispatch((0, import_app_framework.createIntent)(import_types2.ObservabilityAction.SendEvent, {
3313
+ name: "space.limit",
3314
+ properties: {
3315
+ spaceId: space.id
3316
+ }
3317
+ }));
3318
+ throw new Error("Space limit reached.");
3327
3319
  }
3328
- if (intent.data?.target instanceof import_chunk_6SNOZF7Y.CollectionType) {
3329
- intent.data?.target.objects.push(object);
3330
- } else if ((0, import_echo.isSpace)(intent.data?.target)) {
3331
- const collection = space.properties[import_chunk_6SNOZF7Y.CollectionType.typename];
3332
- if (collection instanceof import_chunk_6SNOZF7Y.CollectionType) {
3333
- collection.objects.push(object);
3320
+ if (target instanceof import_chunk_YF2AQ7KP.CollectionType) {
3321
+ target.objects.push((0, import_live_object.makeRef)(object));
3322
+ } else if ((0, import_echo.isSpace)(target)) {
3323
+ const collection = space.properties[import_chunk_YF2AQ7KP.CollectionType.typename]?.target;
3324
+ if (collection instanceof import_chunk_YF2AQ7KP.CollectionType) {
3325
+ collection.objects.push((0, import_live_object.makeRef)(object));
3334
3326
  } else {
3335
- const collection2 = (0, import_live_object.create)(import_chunk_6SNOZF7Y.CollectionType, {
3327
+ const collection2 = (0, import_live_object.create)(import_chunk_YF2AQ7KP.CollectionType, {
3336
3328
  objects: [
3337
- object
3329
+ (0, import_live_object.makeRef)(object)
3338
3330
  ],
3339
3331
  views: {}
3340
3332
  });
3341
- space.properties[import_chunk_6SNOZF7Y.CollectionType.typename] = collection2;
3333
+ space.properties[import_chunk_YF2AQ7KP.CollectionType.typename] = (0, import_live_object.makeRef)(collection2);
3342
3334
  }
3343
3335
  }
3344
3336
  return {
@@ -3352,178 +3344,147 @@ var SpacePlugin = ({ invitationUrl = window.location.origin, invitationParam = "
3352
3344
  }
3353
3345
  },
3354
3346
  intents: [
3355
- [
3356
- {
3357
- action: import_meta.ObservabilityAction.SEND_EVENT,
3358
- data: {
3359
- name: "space.object.add",
3360
- properties: {
3361
- spaceId: space.id,
3362
- objectId: object.id,
3363
- typename: (0, import_echo.getTypename)(object)
3364
- }
3365
- }
3347
+ (0, import_app_framework.createIntent)(import_types2.ObservabilityAction.SendEvent, {
3348
+ name: "space.object.add",
3349
+ properties: {
3350
+ spaceId: space.id,
3351
+ objectId: object.id,
3352
+ typename: (0, import_echo.getTypename)(object)
3366
3353
  }
3367
- ]
3354
+ })
3368
3355
  ]
3369
3356
  };
3370
- }
3371
- case import_chunk_QNVEU2UD.SpaceAction.REMOVE_OBJECTS: {
3372
- const objects = intent.data?.objects ?? intent.data?.result;
3373
- (0, import_invariant.invariant)(Array.isArray(objects), void 0, {
3357
+ }),
3358
+ (0, import_app_framework.createResolver)(import_chunk_YF2AQ7KP.SpaceAction.RemoveObjects, async ({ objects, target, deletionData }, undo) => {
3359
+ const space = (0, import_echo.getSpace)(objects[0]);
3360
+ (0, import_invariant.invariant)(space && objects.every((obj) => (0, import_echo.isEchoObject)(obj) && (0, import_echo.getSpace)(obj) === space), void 0, {
3374
3361
  F: __dxlog_file6,
3375
- L: 1412,
3362
+ L: 1330,
3376
3363
  S: void 0,
3377
3364
  A: [
3378
- "Array.isArray(objects)",
3365
+ "space && objects.every((obj) => isEchoObject(obj) && getSpace(obj) === space)",
3379
3366
  ""
3380
3367
  ]
3381
3368
  });
3382
- const space = (0, import_echo.getSpace)(objects[0]);
3383
- if (!space || !objects.every((obj) => (0, import_echo.isEchoObject)(obj) && (0, import_echo.getSpace)(obj) === space)) {
3384
- return;
3385
- }
3386
- const resolve = (0, import_app_framework.resolvePlugin)(plugins, import_app_framework.parseMetadataResolverPlugin)?.provides.metadata.resolver;
3387
- const activeParts = navigationPlugin?.provides.location.active;
3388
3369
  const openObjectIds = new Set((0, import_app_framework.openIds)(activeParts ?? {}));
3389
- if (!intent.undo && resolve) {
3390
- const parentCollection = intent.data?.collection ?? space.properties[import_chunk_6SNOZF7Y.CollectionType.typename];
3370
+ if (!undo) {
3371
+ const parentCollection = target ?? space.properties[import_chunk_YF2AQ7KP.CollectionType.typename]?.target;
3391
3372
  const nestedObjectsList = await Promise.all(objects.map((obj) => getNestedObjects(obj, resolve)));
3392
- const deletionData = {
3373
+ const deletionData2 = {
3393
3374
  objects,
3394
3375
  parentCollection,
3395
- indices: objects.map((obj) => parentCollection instanceof import_chunk_6SNOZF7Y.CollectionType ? parentCollection.objects.indexOf(obj) : -1),
3376
+ indices: objects.map((obj) => parentCollection instanceof import_chunk_YF2AQ7KP.CollectionType ? parentCollection.objects.findIndex((object) => object.target === obj) : -1),
3396
3377
  nestedObjectsList,
3397
3378
  wasActive: objects.flatMap((obj, i) => [
3398
3379
  obj,
3399
3380
  ...nestedObjectsList[i]
3400
3381
  ]).map((obj) => (0, import_echo.fullyQualifiedId)(obj)).filter((id) => openObjectIds.has(id))
3401
3382
  };
3402
- if (deletionData.wasActive.length > 0) {
3403
- await intentPlugin?.provides.intent.dispatch({
3404
- action: import_app_framework.NavigationAction.CLOSE,
3405
- data: {
3406
- activeParts: {
3407
- main: deletionData.wasActive,
3408
- sidebar: deletionData.wasActive
3409
- }
3410
- }
3411
- });
3412
- }
3413
- if (deletionData.parentCollection instanceof import_chunk_6SNOZF7Y.CollectionType) {
3383
+ if (deletionData2.parentCollection instanceof import_chunk_YF2AQ7KP.CollectionType) {
3414
3384
  [
3415
- ...deletionData.indices
3385
+ ...deletionData2.indices
3416
3386
  ].sort((a, b) => b - a).forEach((index) => {
3417
3387
  if (index !== -1) {
3418
- deletionData.parentCollection.objects.splice(index, 1);
3388
+ deletionData2.parentCollection.objects.splice(index, 1);
3419
3389
  }
3420
3390
  });
3421
3391
  }
3422
- deletionData.nestedObjectsList.flat().forEach((obj) => {
3392
+ deletionData2.nestedObjectsList.flat().forEach((obj) => {
3423
3393
  space.db.remove(obj);
3424
3394
  });
3425
3395
  objects.forEach((obj) => space.db.remove(obj));
3426
- const undoMessageKey = objects.some((obj) => obj instanceof import_chunk_6SNOZF7Y.CollectionType) ? "collection deleted label" : objects.length > 1 ? "objects deleted label" : "object deleted label";
3396
+ const undoMessageKey = objects.some((obj) => obj instanceof import_chunk_YF2AQ7KP.CollectionType) ? "collection deleted label" : objects.length > 1 ? "objects deleted label" : "object deleted label";
3427
3397
  return {
3428
- data: true,
3429
3398
  undoable: {
3430
3399
  // TODO(ZaymonFC): Pluralize if more than one object.
3431
- message: translations_default[0]["en-US"][import_chunk_QNVEU2UD.SPACE_PLUGIN][undoMessageKey],
3432
- data: deletionData
3433
- }
3400
+ message: [
3401
+ undoMessageKey,
3402
+ {
3403
+ ns: import_chunk_46S3JOES.SPACE_PLUGIN
3404
+ }
3405
+ ],
3406
+ data: {
3407
+ deletionData: deletionData2
3408
+ }
3409
+ },
3410
+ intents: deletionData2.wasActive.length > 0 ? [
3411
+ (0, import_app_framework.createIntent)(import_app_framework.NavigationAction.Close, {
3412
+ activeParts: {
3413
+ main: deletionData2.wasActive
3414
+ }
3415
+ })
3416
+ ] : void 0
3434
3417
  };
3435
3418
  } else {
3436
- const undoData = intent.data;
3437
- if (undoData?.objects?.length && undoData.objects.every(import_echo.isEchoObject) && undoData.parentCollection instanceof import_chunk_6SNOZF7Y.CollectionType) {
3438
- const restoredObjects = undoData.objects.map((obj) => space.db.add(obj));
3439
- undoData.nestedObjectsList.flat().forEach((obj) => {
3419
+ if (deletionData?.objects?.length && deletionData.objects.every(import_echo.isEchoObject) && deletionData.parentCollection instanceof import_chunk_YF2AQ7KP.CollectionType) {
3420
+ const restoredObjects = deletionData.objects.map((obj) => space.db.add(obj));
3421
+ deletionData.nestedObjectsList.flat().forEach((obj) => {
3440
3422
  space.db.add(obj);
3441
3423
  });
3442
- undoData.indices.forEach((index, i) => {
3424
+ deletionData.indices.forEach((index, i) => {
3443
3425
  if (index !== -1) {
3444
- undoData.parentCollection.objects.splice(index, 0, restoredObjects[i]);
3426
+ deletionData.parentCollection.objects.splice(index, 0, (0, import_live_object.makeRef)(restoredObjects[i]));
3445
3427
  }
3446
3428
  });
3447
- if (undoData.wasActive.length > 0) {
3448
- await intentPlugin?.provides.intent.dispatch({
3449
- action: import_app_framework.NavigationAction.OPEN,
3450
- data: {
3429
+ return {
3430
+ intents: deletionData.wasActive.length > 0 ? [
3431
+ (0, import_app_framework.createIntent)(import_app_framework.NavigationAction.Open, {
3451
3432
  activeParts: {
3452
- main: undoData.wasActive
3433
+ main: deletionData.wasActive
3453
3434
  }
3454
- }
3455
- });
3456
- }
3457
- return {
3458
- data: true
3435
+ })
3436
+ ] : void 0
3459
3437
  };
3460
3438
  }
3461
- return {
3462
- data: false
3463
- };
3464
- }
3465
- }
3466
- case import_chunk_QNVEU2UD.SpaceAction.RENAME_OBJECT: {
3467
- const object = intent.data?.object ?? intent.data?.result;
3468
- const caller = intent.data?.caller;
3469
- if ((0, import_live_object.isReactiveObject)(object) && caller) {
3470
- return {
3471
- intents: [
3472
- [
3473
- {
3474
- action: import_app_framework.LayoutAction.SET_LAYOUT,
3475
- data: {
3476
- element: "popover",
3477
- anchorId: `dxos.org/ui/${caller}/${(0, import_echo.fullyQualifiedId)(object)}`,
3478
- component: "dxos.org/plugin/space/RenameObjectPopover",
3479
- subject: object
3480
- }
3481
- }
3482
- ]
3483
- ]
3484
- };
3485
3439
  }
3486
- break;
3487
- }
3488
- case import_chunk_QNVEU2UD.SpaceAction.DUPLICATE_OBJECT: {
3489
- const originalObject = intent.data?.object ?? intent.data?.result;
3490
- const resolve = (0, import_app_framework.resolvePlugin)(plugins, import_app_framework.parseMetadataResolverPlugin)?.provides.metadata.resolver;
3491
- const space = (0, import_echo.isSpace)(intent.data?.target) ? intent.data?.target : (0, import_echo.getSpace)(intent.data?.target);
3492
- if (!(0, import_echo.isEchoObject)(originalObject) || !resolve || !space) {
3493
- return;
3494
- }
3495
- const newObject = await cloneObject(originalObject, resolve, space);
3496
- return {
3497
- intents: [
3498
- [
3499
- {
3500
- action: import_chunk_QNVEU2UD.SpaceAction.ADD_OBJECT,
3501
- data: {
3502
- object: newObject,
3503
- target: intent.data?.target
3504
- }
3505
- }
3506
- ]
3440
+ }),
3441
+ (0, import_app_framework.createResolver)(import_chunk_YF2AQ7KP.SpaceAction.RenameObject, async ({ object, caller }) => ({
3442
+ intents: [
3443
+ (0, import_app_framework.createIntent)(import_app_framework.LayoutAction.SetLayout, {
3444
+ element: "popover",
3445
+ anchorId: `dxos.org/ui/${caller}/${(0, import_echo.fullyQualifiedId)(object)}`,
3446
+ component: POPOVER_RENAME_OBJECT,
3447
+ subject: object
3448
+ })
3449
+ ]
3450
+ })),
3451
+ (0, import_app_framework.createResolver)(import_chunk_YF2AQ7KP.SpaceAction.DuplicateObject, async ({ object, target }) => {
3452
+ const space = (0, import_echo.isSpace)(target) ? target : (0, import_echo.getSpace)(target);
3453
+ (0, import_invariant.invariant)(space, "Space not found.", {
3454
+ F: __dxlog_file6,
3455
+ L: 1429,
3456
+ S: void 0,
3457
+ A: [
3458
+ "space",
3459
+ "'Space not found.'"
3507
3460
  ]
3508
- };
3509
- }
3510
- case import_chunk_QNVEU2UD.SpaceAction.TOGGLE_HIDDEN: {
3511
- settings.values.showHidden = intent.data?.state ?? !settings.values.showHidden;
3512
- return {
3513
- data: true
3514
- };
3515
- }
3516
- case import_chunk_QNVEU2UD.CollectionAction.CREATE: {
3517
- const collection = (0, import_live_object.create)(import_chunk_6SNOZF7Y.CollectionType, {
3518
- name: intent.data?.name,
3519
- objects: [],
3520
- views: {}
3521
3461
  });
3462
+ const newObject = await cloneObject(object, resolve, space);
3522
3463
  return {
3523
- data: collection
3464
+ intents: [
3465
+ (0, import_app_framework.createIntent)(import_chunk_YF2AQ7KP.SpaceAction.AddObject, {
3466
+ object: newObject,
3467
+ target
3468
+ })
3469
+ ]
3524
3470
  };
3525
- }
3526
- }
3471
+ }),
3472
+ (0, import_app_framework.createResolver)(import_chunk_YF2AQ7KP.SpaceAction.WaitForObject, async ({ id }) => {
3473
+ state.values.awaiting = id;
3474
+ }),
3475
+ (0, import_app_framework.createResolver)(import_chunk_YF2AQ7KP.SpaceAction.ToggleHidden, async ({ state: state2 }) => {
3476
+ settings.values.showHidden = state2;
3477
+ }),
3478
+ (0, import_app_framework.createResolver)(import_chunk_YF2AQ7KP.CollectionAction.Create, async ({ name }) => ({
3479
+ data: {
3480
+ object: (0, import_live_object.create)(import_chunk_YF2AQ7KP.CollectionType, {
3481
+ name,
3482
+ objects: [],
3483
+ views: {}
3484
+ })
3485
+ }
3486
+ }))
3487
+ ];
3527
3488
  }
3528
3489
  }
3529
3490
  }
@@ -3535,6 +3496,8 @@ var src_default = SpacePlugin;
3535
3496
  ActorSchema,
3536
3497
  AwaitingObject,
3537
3498
  COMPOSER_SPACE_LOCK,
3499
+ CREATE_OBJECT_DIALOG,
3500
+ CREATE_SPACE_DIALOG,
3538
3501
  ChannelType,
3539
3502
  CollectionAction,
3540
3503
  CollectionMain,
@@ -3546,19 +3509,23 @@ var src_default = SpacePlugin;
3546
3509
  DefaultObjectSettings,
3547
3510
  FullPresence,
3548
3511
  InlineSyncStatus,
3549
- InlineSyncStatusIndicator,
3512
+ JOIN_DIALOG,
3550
3513
  JoinDialog,
3551
3514
  MenuFooter,
3552
3515
  MessageState,
3553
3516
  MessageType,
3517
+ POPOVER_RENAME_OBJECT,
3518
+ POPOVER_RENAME_SPACE,
3554
3519
  PersistenceStatus,
3555
3520
  PopoverRenameObject,
3556
3521
  PopoverRenameSpace,
3557
3522
  SHARED,
3558
3523
  SPACES,
3524
+ SPACE_ACTION,
3559
3525
  SPACE_DIRECTORY_HANDLE,
3560
3526
  SPACE_PLUGIN,
3561
3527
  SPACE_PLUGIN_SHORT_ID,
3528
+ SPACE_SETTINGS_DIALOG,
3562
3529
  SPACE_TYPE,
3563
3530
  ShareSpaceButton,
3564
3531
  ShareSpaceButtonImpl,