@dxos/plugin-space 0.6.12-main.f9d0246 → 0.6.12-staging.0b4bb48
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/browser/{chunk-WBMH5WIP.mjs → chunk-DTVUOG2C.mjs} +2 -14
- package/dist/lib/browser/chunk-DTVUOG2C.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +185 -497
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/types/index.mjs +3 -7
- package/dist/lib/node/{chunk-GF3SRAQM.cjs → chunk-CVZPI2P3.cjs} +6 -20
- package/dist/lib/node/chunk-CVZPI2P3.cjs.map +7 -0
- package/dist/lib/node/index.cjs +278 -586
- package/dist/lib/node/index.cjs.map +4 -4
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/types/index.cjs +10 -14
- package/dist/lib/node/types/index.cjs.map +2 -2
- package/dist/types/src/SpacePlugin.d.ts.map +1 -1
- package/dist/types/src/components/MenuFooter.d.ts.map +1 -1
- package/dist/types/src/components/ShareSpaceButton.stories.d.ts +0 -2
- package/dist/types/src/components/ShareSpaceButton.stories.d.ts.map +1 -1
- package/dist/types/src/components/SpaceMain/SpaceMain.d.ts.map +1 -1
- package/dist/types/src/components/SpacePresence.stories.d.ts +0 -2
- package/dist/types/src/components/SpacePresence.stories.d.ts.map +1 -1
- package/dist/types/src/components/SpaceSettings.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +0 -2
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +0 -2
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/thread.d.ts +0 -13
- package/dist/types/src/types/thread.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +1 -18
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/src/util.d.ts +4 -1
- package/dist/types/src/util.d.ts.map +1 -1
- package/package.json +34 -41
- package/src/SpacePlugin.tsx +23 -38
- package/src/components/MenuFooter.tsx +0 -1
- package/src/components/SpaceMain/SpaceMain.tsx +22 -1
- package/src/components/SpaceSettings.tsx +3 -32
- package/src/components/index.ts +0 -2
- package/src/translations.ts +0 -2
- package/src/types/thread.ts +0 -9
- package/src/types/types.ts +1 -25
- package/src/util.tsx +50 -15
- package/dist/lib/browser/chunk-WBMH5WIP.mjs.map +0 -7
- package/dist/lib/node/chunk-GF3SRAQM.cjs.map +0 -7
- package/dist/lib/node-esm/chunk-GM2YUC77.mjs +0 -37
- package/dist/lib/node-esm/chunk-GM2YUC77.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-N5VC55UM.mjs +0 -109
- package/dist/lib/node-esm/chunk-N5VC55UM.mjs.map +0 -7
- package/dist/lib/node-esm/index.mjs +0 -2953
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/lib/node-esm/meta.mjs +0 -14
- package/dist/lib/node-esm/meta.mjs.map +0 -7
- package/dist/lib/node-esm/types/index.mjs +0 -26
- package/dist/lib/node-esm/types/index.mjs.map +0 -7
- package/dist/types/src/components/SaveStatus.d.ts +0 -3
- package/dist/types/src/components/SaveStatus.d.ts.map +0 -1
- package/dist/types/src/components/SyncStatus/SyncStatus.d.ts +0 -13
- package/dist/types/src/components/SyncStatus/SyncStatus.d.ts.map +0 -1
- package/dist/types/src/components/SyncStatus/SyncStatus.stories.d.ts +0 -115
- package/dist/types/src/components/SyncStatus/SyncStatus.stories.d.ts.map +0 -1
- package/dist/types/src/components/SyncStatus/index.d.ts +0 -2
- package/dist/types/src/components/SyncStatus/index.d.ts.map +0 -1
- package/dist/types/src/components/SyncStatus/types.d.ts +0 -14
- package/dist/types/src/components/SyncStatus/types.d.ts.map +0 -1
- package/src/components/SaveStatus.tsx +0 -95
- package/src/components/SyncStatus/SyncStatus.stories.tsx +0 -62
- package/src/components/SyncStatus/SyncStatus.tsx +0 -188
- package/src/components/SyncStatus/index.ts +0 -5
- package/src/components/SyncStatus/types.ts +0 -77
package/dist/lib/node/index.cjs
CHANGED
|
@@ -28,31 +28,29 @@ 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: () =>
|
|
31
|
+
ActorSchema: () => import_chunk_CVZPI2P3.ActorSchema,
|
|
32
32
|
AwaitingObject: () => AwaitingObject,
|
|
33
33
|
COMPOSER_SPACE_LOCK: () => COMPOSER_SPACE_LOCK,
|
|
34
|
-
ChannelType: () =>
|
|
34
|
+
ChannelType: () => import_chunk_CVZPI2P3.ChannelType,
|
|
35
35
|
CollectionMain: () => CollectionMain,
|
|
36
36
|
CollectionSection: () => CollectionSection,
|
|
37
|
-
CollectionType: () =>
|
|
38
|
-
ContactType: () =>
|
|
37
|
+
CollectionType: () => import_chunk_CVZPI2P3.CollectionType,
|
|
38
|
+
ContactType: () => import_chunk_CVZPI2P3.ContactType,
|
|
39
39
|
EmptySpace: () => EmptySpace,
|
|
40
40
|
EmptyTree: () => EmptyTree,
|
|
41
41
|
FullPresence: () => FullPresence,
|
|
42
42
|
MenuFooter: () => MenuFooter,
|
|
43
|
-
|
|
44
|
-
MessageType: () => import_chunk_GF3SRAQM.MessageType,
|
|
43
|
+
MessageType: () => import_chunk_CVZPI2P3.MessageType,
|
|
45
44
|
MissingObject: () => MissingObject,
|
|
46
45
|
PersistenceStatus: () => PersistenceStatus,
|
|
47
46
|
PopoverRenameObject: () => PopoverRenameObject,
|
|
48
47
|
PopoverRenameSpace: () => PopoverRenameSpace,
|
|
49
48
|
SHARED: () => SHARED,
|
|
50
49
|
SPACES: () => SPACES,
|
|
51
|
-
SPACE_DIRECTORY_HANDLE: () =>
|
|
50
|
+
SPACE_DIRECTORY_HANDLE: () => import_chunk_CVZPI2P3.SPACE_DIRECTORY_HANDLE,
|
|
52
51
|
SPACE_PLUGIN: () => import_chunk_6CNYF6YU.SPACE_PLUGIN,
|
|
53
52
|
SPACE_PLUGIN_SHORT_ID: () => import_chunk_6CNYF6YU.SPACE_PLUGIN_SHORT_ID,
|
|
54
53
|
SPACE_TYPE: () => SPACE_TYPE,
|
|
55
|
-
SaveStatus: () => SaveStatus,
|
|
56
54
|
ShareSpaceButton: () => ShareSpaceButton,
|
|
57
55
|
ShareSpaceButtonImpl: () => ShareSpaceButtonImpl,
|
|
58
56
|
SmallPresence: () => SmallPresence,
|
|
@@ -62,11 +60,8 @@ __export(node_exports, {
|
|
|
62
60
|
SpacePlugin: () => SpacePlugin,
|
|
63
61
|
SpacePresence: () => SpacePresence,
|
|
64
62
|
SpaceSettings: () => SpaceSettings,
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
SyncStatusIndicator: () => SyncStatusIndicator,
|
|
68
|
-
ThreadStatus: () => import_chunk_GF3SRAQM.ThreadStatus,
|
|
69
|
-
ThreadType: () => import_chunk_GF3SRAQM.ThreadType,
|
|
63
|
+
ThreadStatus: () => import_chunk_CVZPI2P3.ThreadStatus,
|
|
64
|
+
ThreadType: () => import_chunk_CVZPI2P3.ThreadType,
|
|
70
65
|
cloneObject: () => cloneObject,
|
|
71
66
|
constructObjectActionGroups: () => constructObjectActionGroups,
|
|
72
67
|
constructObjectActions: () => constructObjectActions,
|
|
@@ -79,15 +74,15 @@ __export(node_exports, {
|
|
|
79
74
|
getNestedObjects: () => getNestedObjects,
|
|
80
75
|
getSpaceDisplayName: () => getSpaceDisplayName,
|
|
81
76
|
memoizeQuery: () => memoizeQuery,
|
|
82
|
-
parseSpaceInitPlugin: () => import_chunk_GF3SRAQM.parseSpaceInitPlugin,
|
|
83
77
|
parseSpacePlugin: () => parseSpacePlugin,
|
|
84
78
|
translations: () => translations_default
|
|
85
79
|
});
|
|
86
80
|
module.exports = __toCommonJS(node_exports);
|
|
87
81
|
var import_chunk_6CNYF6YU = require("./chunk-6CNYF6YU.cjs");
|
|
88
|
-
var
|
|
82
|
+
var import_chunk_CVZPI2P3 = require("./chunk-CVZPI2P3.cjs");
|
|
83
|
+
var import_react = require("@phosphor-icons/react");
|
|
89
84
|
var import_signals_core = require("@preact/signals-core");
|
|
90
|
-
var
|
|
85
|
+
var import_react2 = __toESM(require("react"));
|
|
91
86
|
var import_app_framework = require("@dxos/app-framework");
|
|
92
87
|
var import_async = require("@dxos/async");
|
|
93
88
|
var import_echo_schema = require("@dxos/echo-schema");
|
|
@@ -101,71 +96,73 @@ var import_meta = require("@dxos/plugin-observability/meta");
|
|
|
101
96
|
var import_react_client = require("@dxos/react-client");
|
|
102
97
|
var import_echo = require("@dxos/react-client/echo");
|
|
103
98
|
var import_react_ui = require("@dxos/react-ui");
|
|
104
|
-
var
|
|
99
|
+
var import_react3 = require("@dxos/shell/react");
|
|
105
100
|
var import_util = require("@dxos/util");
|
|
106
|
-
var
|
|
107
|
-
var
|
|
101
|
+
var import_react4 = require("@phosphor-icons/react");
|
|
102
|
+
var import_react5 = __toESM(require("react"));
|
|
108
103
|
var import_app_framework2 = require("@dxos/app-framework");
|
|
109
104
|
var import_react_client2 = require("@dxos/react-client");
|
|
110
105
|
var import_echo2 = require("@dxos/react-client/echo");
|
|
111
106
|
var import_react_ui2 = require("@dxos/react-ui");
|
|
112
107
|
var import_react_ui_theme = require("@dxos/react-ui-theme");
|
|
113
|
-
var
|
|
108
|
+
var import_react6 = __toESM(require("react"));
|
|
114
109
|
var import_react_ui3 = require("@dxos/react-ui");
|
|
115
110
|
var import_react_ui_theme2 = require("@dxos/react-ui-theme");
|
|
116
|
-
var import_react6 = __toESM(require("react"));
|
|
117
|
-
var import_react_ui4 = require("@dxos/react-ui");
|
|
118
111
|
var import_react7 = __toESM(require("react"));
|
|
112
|
+
var import_react_ui4 = require("@dxos/react-ui");
|
|
113
|
+
var import_react8 = __toESM(require("react"));
|
|
119
114
|
var import_react_ui5 = require("@dxos/react-ui");
|
|
120
115
|
var import_react_ui_theme3 = require("@dxos/react-ui-theme");
|
|
121
|
-
var
|
|
116
|
+
var import_react9 = __toESM(require("react"));
|
|
122
117
|
var import_react_ui6 = require("@dxos/react-ui");
|
|
123
118
|
var import_react_ui_theme4 = require("@dxos/react-ui-theme");
|
|
124
|
-
var
|
|
125
|
-
var
|
|
119
|
+
var import_react10 = require("@phosphor-icons/react");
|
|
120
|
+
var import_react11 = __toESM(require("react"));
|
|
126
121
|
var import_echo3 = require("@dxos/client/echo");
|
|
127
122
|
var import_react_client3 = require("@dxos/react-client");
|
|
128
123
|
var import_react_ui7 = require("@dxos/react-ui");
|
|
124
|
+
var import_react12 = require("@phosphor-icons/react");
|
|
125
|
+
var import_react13 = __toESM(require("react"));
|
|
129
126
|
var import_app_framework3 = require("@dxos/app-framework");
|
|
130
127
|
var import_echo_schema2 = require("@dxos/echo-schema");
|
|
131
128
|
var import_invariant = require("@dxos/invariant");
|
|
132
129
|
var import_migrations2 = require("@dxos/migrations");
|
|
133
130
|
var import_plugin_graph2 = require("@dxos/plugin-graph");
|
|
134
131
|
var import_echo4 = require("@dxos/react-client/echo");
|
|
135
|
-
var
|
|
132
|
+
var import_react14 = __toESM(require("react"));
|
|
136
133
|
var import_app_framework4 = require("@dxos/app-framework");
|
|
137
134
|
var import_react_ui8 = require("@dxos/react-ui");
|
|
138
135
|
var import_react_ui_theme5 = require("@dxos/react-ui-theme");
|
|
139
|
-
var
|
|
140
|
-
var
|
|
136
|
+
var import_react15 = require("@phosphor-icons/react");
|
|
137
|
+
var import_react16 = __toESM(require("react"));
|
|
141
138
|
var import_async2 = require("@dxos/async");
|
|
142
139
|
var import_react_ui9 = require("@dxos/react-ui");
|
|
143
140
|
var import_react_ui_theme6 = require("@dxos/react-ui-theme");
|
|
144
|
-
var
|
|
141
|
+
var import_react17 = __toESM(require("react"));
|
|
145
142
|
var import_log2 = require("@dxos/log");
|
|
146
143
|
var import_react_ui10 = require("@dxos/react-ui");
|
|
147
|
-
var
|
|
144
|
+
var import_react18 = __toESM(require("react"));
|
|
148
145
|
var import_react_ui11 = require("@dxos/react-ui");
|
|
149
|
-
var
|
|
146
|
+
var import_react19 = __toESM(require("react"));
|
|
150
147
|
var import_app_framework5 = require("@dxos/app-framework");
|
|
151
148
|
var import_react_ui12 = require("@dxos/react-ui");
|
|
152
|
-
var
|
|
153
|
-
var
|
|
149
|
+
var import_react20 = require("@phosphor-icons/react");
|
|
150
|
+
var import_react21 = __toESM(require("react"));
|
|
154
151
|
var import_app_framework6 = require("@dxos/app-framework");
|
|
155
152
|
var import_echo5 = require("@dxos/react-client/echo");
|
|
156
153
|
var import_react_ui13 = require("@dxos/react-ui");
|
|
157
154
|
var import_react_ui_theme7 = require("@dxos/react-ui-theme");
|
|
158
|
-
var
|
|
159
|
-
var
|
|
160
|
-
var
|
|
155
|
+
var import_react22 = require("@dxos/shell/react");
|
|
156
|
+
var import_react23 = require("@phosphor-icons/react");
|
|
157
|
+
var import_react24 = __toESM(require("react"));
|
|
161
158
|
var import_app_framework7 = require("@dxos/app-framework");
|
|
162
159
|
var import_echo6 = require("@dxos/react-client/echo");
|
|
163
160
|
var import_invitations = require("@dxos/react-client/invitations");
|
|
164
161
|
var import_invitations2 = require("@dxos/react-client/invitations");
|
|
165
162
|
var import_react_ui14 = require("@dxos/react-ui");
|
|
166
163
|
var import_react_ui_theme8 = require("@dxos/react-ui-theme");
|
|
167
|
-
var
|
|
168
|
-
var
|
|
164
|
+
var import_react25 = require("@dxos/shell/react");
|
|
165
|
+
var import_react26 = __toESM(require("react"));
|
|
169
166
|
var import_app_framework8 = require("@dxos/app-framework");
|
|
170
167
|
var import_display_name = require("@dxos/display-name");
|
|
171
168
|
var import_react_client4 = require("@dxos/react-client");
|
|
@@ -174,36 +171,22 @@ var import_halo = require("@dxos/react-client/halo");
|
|
|
174
171
|
var import_react_ui15 = require("@dxos/react-ui");
|
|
175
172
|
var import_react_ui_attention = require("@dxos/react-ui-attention");
|
|
176
173
|
var import_util2 = require("@dxos/util");
|
|
177
|
-
var
|
|
174
|
+
var import_react27 = __toESM(require("react"));
|
|
178
175
|
var import_app_framework9 = require("@dxos/app-framework");
|
|
179
176
|
var import_plugin_settings = require("@dxos/plugin-settings");
|
|
180
177
|
var import_react_ui16 = require("@dxos/react-ui");
|
|
181
|
-
var import_react25 = __toESM(require("react"));
|
|
182
|
-
var import_context = require("@dxos/context");
|
|
183
|
-
var import_plugin_status_bar = require("@dxos/plugin-status-bar");
|
|
184
|
-
var import_react_client5 = require("@dxos/react-client");
|
|
185
|
-
var import_react_ui17 = require("@dxos/react-ui");
|
|
186
|
-
var import_react26 = __toESM(require("react"));
|
|
187
|
-
var import_plugin_status_bar2 = require("@dxos/plugin-status-bar");
|
|
188
|
-
var import_react_ui18 = require("@dxos/react-ui");
|
|
189
|
-
var import_react_ui_syntax_highlighter = require("@dxos/react-ui-syntax-highlighter");
|
|
190
|
-
var import_react_ui_theme9 = require("@dxos/react-ui-theme");
|
|
191
|
-
var import_react27 = require("react");
|
|
192
|
-
var import_context2 = require("@dxos/context");
|
|
193
|
-
var import_protocols = require("@dxos/protocols");
|
|
194
|
-
var import_react_client6 = require("@dxos/react-client");
|
|
195
178
|
var WAIT_FOR_OBJECT_TIMEOUT = 18e4;
|
|
196
179
|
var TOAST_TIMEOUT = 24e4;
|
|
197
180
|
var AwaitingObject = ({ id }) => {
|
|
198
|
-
const [open, setOpen] = (0,
|
|
199
|
-
const [waiting, setWaiting] = (0,
|
|
200
|
-
const [found, setFound] = (0,
|
|
181
|
+
const [open, setOpen] = (0, import_react5.useState)(true);
|
|
182
|
+
const [waiting, setWaiting] = (0, import_react5.useState)(true);
|
|
183
|
+
const [found, setFound] = (0, import_react5.useState)(false);
|
|
201
184
|
const { t } = (0, import_react_ui2.useTranslation)(import_chunk_6CNYF6YU.SPACE_PLUGIN);
|
|
202
185
|
const intentPlugin = (0, import_app_framework2.useResolvePlugin)(import_app_framework2.parseIntentPlugin);
|
|
203
186
|
const navigationPlugin = (0, import_app_framework2.useResolvePlugin)(import_app_framework2.parseNavigationPlugin);
|
|
204
187
|
const client = (0, import_react_client2.useClient)();
|
|
205
188
|
const objects = (0, import_echo2.useQuery)(client.spaces);
|
|
206
|
-
(0,
|
|
189
|
+
(0, import_react5.useEffect)(() => {
|
|
207
190
|
if (!id) {
|
|
208
191
|
return;
|
|
209
192
|
}
|
|
@@ -214,7 +197,7 @@ var AwaitingObject = ({ id }) => {
|
|
|
214
197
|
}, [
|
|
215
198
|
id
|
|
216
199
|
]);
|
|
217
|
-
(0,
|
|
200
|
+
(0, import_react5.useEffect)(() => {
|
|
218
201
|
if (objects.findIndex((object) => (0, import_echo2.fullyQualifiedId)(object) === id) > -1) {
|
|
219
202
|
setFound(true);
|
|
220
203
|
if (navigationPlugin?.provides.location.active === id) {
|
|
@@ -246,33 +229,33 @@ var AwaitingObject = ({ id }) => {
|
|
|
246
229
|
});
|
|
247
230
|
void handleClose();
|
|
248
231
|
};
|
|
249
|
-
return /* @__PURE__ */
|
|
232
|
+
return /* @__PURE__ */ import_react5.default.createElement(import_react_ui2.Toast.Root, {
|
|
250
233
|
open,
|
|
251
234
|
duration: TOAST_TIMEOUT,
|
|
252
235
|
onOpenChange: setOpen
|
|
253
|
-
}, /* @__PURE__ */
|
|
236
|
+
}, /* @__PURE__ */ import_react5.default.createElement(import_react_ui2.Toast.Body, null, /* @__PURE__ */ import_react5.default.createElement(import_react_ui2.Toast.Title, {
|
|
254
237
|
classNames: "flex items-center gap-2"
|
|
255
|
-
}, found ? /* @__PURE__ */
|
|
238
|
+
}, found ? /* @__PURE__ */ import_react5.default.createElement(import_react5.default.Fragment, null, /* @__PURE__ */ import_react5.default.createElement(import_react4.CheckCircle, {
|
|
256
239
|
className: (0, import_react_ui_theme.getSize)(5)
|
|
257
|
-
}), /* @__PURE__ */
|
|
240
|
+
}), /* @__PURE__ */ import_react5.default.createElement("span", null, t("found object label"))) : waiting ? /* @__PURE__ */ import_react5.default.createElement(import_react5.default.Fragment, null, /* @__PURE__ */ import_react5.default.createElement(import_react4.CircleNotch, {
|
|
258
241
|
className: (0, import_react_ui_theme.mx)((0, import_react_ui_theme.getSize)(5), "animate-spin")
|
|
259
|
-
}), /* @__PURE__ */
|
|
242
|
+
}), /* @__PURE__ */ import_react5.default.createElement("span", null, t("waiting for object label"))) : /* @__PURE__ */ import_react5.default.createElement(import_react5.default.Fragment, null, /* @__PURE__ */ import_react5.default.createElement(import_react4.CircleDashed, {
|
|
260
243
|
className: (0, import_react_ui_theme.getSize)(5)
|
|
261
|
-
}), /* @__PURE__ */
|
|
244
|
+
}), /* @__PURE__ */ import_react5.default.createElement("span", null, t("object not found label")))), /* @__PURE__ */ import_react5.default.createElement(import_react_ui2.Toast.Description, null, t(found ? "found object description" : waiting ? "waiting for object description" : "object not found description"))), /* @__PURE__ */ import_react5.default.createElement(import_react_ui2.Toast.Actions, null, found ? /* @__PURE__ */ import_react5.default.createElement(import_react5.default.Fragment, null, /* @__PURE__ */ import_react5.default.createElement(import_react_ui2.Toast.Action, {
|
|
262
245
|
altText: t("go to object alt"),
|
|
263
246
|
asChild: true
|
|
264
|
-
}, /* @__PURE__ */
|
|
247
|
+
}, /* @__PURE__ */ import_react5.default.createElement(import_react_ui2.Button, {
|
|
265
248
|
variant: "primary",
|
|
266
249
|
onClick: handleNavigate
|
|
267
|
-
}, t("go to object label"))), /* @__PURE__ */
|
|
250
|
+
}, t("go to object label"))), /* @__PURE__ */ import_react5.default.createElement(import_react_ui2.Toast.Close, {
|
|
268
251
|
asChild: true
|
|
269
|
-
}, /* @__PURE__ */
|
|
252
|
+
}, /* @__PURE__ */ import_react5.default.createElement(import_react_ui2.Button, {
|
|
270
253
|
onClick: handleClose
|
|
271
254
|
}, t("close label", {
|
|
272
255
|
ns: "appkit"
|
|
273
|
-
})))) : /* @__PURE__ */
|
|
256
|
+
})))) : /* @__PURE__ */ import_react5.default.createElement(import_react_ui2.Toast.Close, {
|
|
274
257
|
asChild: true
|
|
275
|
-
}, /* @__PURE__ */
|
|
258
|
+
}, /* @__PURE__ */ import_react5.default.createElement(import_react_ui2.Button, {
|
|
276
259
|
onClick: handleClose
|
|
277
260
|
}, t(waiting ? "close label" : "confirm label", {
|
|
278
261
|
ns: "appkit"
|
|
@@ -280,33 +263,33 @@ var AwaitingObject = ({ id }) => {
|
|
|
280
263
|
};
|
|
281
264
|
var CollectionMain = ({ collection }) => {
|
|
282
265
|
const { t } = (0, import_react_ui3.useTranslation)(import_chunk_6CNYF6YU.SPACE_PLUGIN);
|
|
283
|
-
return /* @__PURE__ */
|
|
266
|
+
return /* @__PURE__ */ import_react6.default.createElement("div", {
|
|
284
267
|
role: "none",
|
|
285
268
|
className: (0, import_react_ui_theme2.mx)(import_react_ui_theme2.baseSurface, "min-bs-screen is-full flex items-center justify-center p-8"),
|
|
286
269
|
"data-testid": "composer.firstRunMessage"
|
|
287
|
-
}, /* @__PURE__ */
|
|
270
|
+
}, /* @__PURE__ */ import_react6.default.createElement("p", {
|
|
288
271
|
role: "alert",
|
|
289
272
|
className: (0, import_react_ui_theme2.mx)(import_react_ui_theme2.descriptionText, "border border-dashed border-neutral-400/50 rounded-lg p-8 font-normal text-lg max-is-[24rem] break-words")
|
|
290
273
|
}, collection.name ?? t("unnamed collection label")));
|
|
291
274
|
};
|
|
292
275
|
var CollectionSection = ({ collection }) => {
|
|
293
276
|
const { t } = (0, import_react_ui4.useTranslation)(import_chunk_6CNYF6YU.SPACE_PLUGIN);
|
|
294
|
-
return /* @__PURE__ */
|
|
277
|
+
return /* @__PURE__ */ import_react7.default.createElement("div", {
|
|
295
278
|
className: "min-bs-[3.5rem] grid grid-rows-subgrid grid-cols-subgrid items-center"
|
|
296
|
-
}, /* @__PURE__ */
|
|
279
|
+
}, /* @__PURE__ */ import_react7.default.createElement("span", {
|
|
297
280
|
className: "truncate"
|
|
298
281
|
}, collection.name ?? t("unnamed collection label")));
|
|
299
282
|
};
|
|
300
283
|
var EmptySpace = () => {
|
|
301
284
|
const { t } = (0, import_react_ui5.useTranslation)(import_chunk_6CNYF6YU.SPACE_PLUGIN);
|
|
302
|
-
return /* @__PURE__ */
|
|
285
|
+
return /* @__PURE__ */ import_react8.default.createElement("div", {
|
|
303
286
|
role: "none",
|
|
304
287
|
className: (0, import_react_ui_theme3.mx)("p-2 mli-2 mbe-2 text-center border border-dashed border-neutral-400/50 rounded-lg", import_react_ui_theme3.descriptionText)
|
|
305
288
|
}, t("empty space message"));
|
|
306
289
|
};
|
|
307
290
|
var EmptyTree = () => {
|
|
308
291
|
const { t } = (0, import_react_ui6.useTranslation)(import_chunk_6CNYF6YU.SPACE_PLUGIN);
|
|
309
|
-
return /* @__PURE__ */
|
|
292
|
+
return /* @__PURE__ */ import_react9.default.createElement("div", {
|
|
310
293
|
role: "none",
|
|
311
294
|
className: (0, import_react_ui_theme4.mx)("p-2 mli-2 mbe-2 text-center border border-dashed border-neutral-400/50 rounded-lg", import_react_ui_theme4.descriptionText)
|
|
312
295
|
}, t("empty tree message"));
|
|
@@ -380,8 +363,8 @@ var checkPendingMigration = (space) => {
|
|
|
380
363
|
};
|
|
381
364
|
var constructSpaceNode = ({ space, personal, namesCache, resolve }) => {
|
|
382
365
|
const hasPendingMigration = checkPendingMigration(space);
|
|
383
|
-
const collection = space.state.get() === import_echo4.SpaceState.SPACE_READY && space.properties[
|
|
384
|
-
const partials = space.state.get() === import_echo4.SpaceState.SPACE_READY && collection instanceof
|
|
366
|
+
const collection = space.state.get() === import_echo4.SpaceState.SPACE_READY && space.properties[import_chunk_CVZPI2P3.CollectionType.typename];
|
|
367
|
+
const partials = space.state.get() === import_echo4.SpaceState.SPACE_READY && collection instanceof import_chunk_CVZPI2P3.CollectionType ? getCollectionGraphNodePartials({
|
|
385
368
|
collection,
|
|
386
369
|
space,
|
|
387
370
|
resolve
|
|
@@ -397,7 +380,8 @@ var constructSpaceNode = ({ space, personal, namesCache, resolve }) => {
|
|
|
397
380
|
namesCache
|
|
398
381
|
}),
|
|
399
382
|
description: space.state.get() === import_echo4.SpaceState.SPACE_READY && space.properties.description,
|
|
400
|
-
icon:
|
|
383
|
+
icon: (props) => /* @__PURE__ */ import_react13.default.createElement(import_react12.Planet, props),
|
|
384
|
+
iconSymbol: "ph--planet--regular",
|
|
401
385
|
disabled: space.state.get() !== import_echo4.SpaceState.SPACE_READY || hasPendingMigration,
|
|
402
386
|
testId: "spacePlugin.space"
|
|
403
387
|
}
|
|
@@ -410,7 +394,7 @@ var constructSpaceActionGroups = ({ space, dispatch }) => {
|
|
|
410
394
|
if (state !== import_echo4.SpaceState.SPACE_READY || hasPendingMigration) {
|
|
411
395
|
return [];
|
|
412
396
|
}
|
|
413
|
-
const collection = space.properties[
|
|
397
|
+
const collection = space.properties[import_chunk_CVZPI2P3.CollectionType.typename];
|
|
414
398
|
const actions = [
|
|
415
399
|
{
|
|
416
400
|
id: getId(import_chunk_6CNYF6YU.SpaceAction.ADD_OBJECT),
|
|
@@ -423,7 +407,8 @@ var constructSpaceActionGroups = ({ space, dispatch }) => {
|
|
|
423
407
|
ns: import_chunk_6CNYF6YU.SPACE_PLUGIN
|
|
424
408
|
}
|
|
425
409
|
],
|
|
426
|
-
icon:
|
|
410
|
+
icon: (props) => /* @__PURE__ */ import_react13.default.createElement(import_react12.Plus, props),
|
|
411
|
+
iconSymbol: "ph--plus--regular",
|
|
427
412
|
disposition: "toolbar",
|
|
428
413
|
// TODO(wittjosiah): This is currently a navtree feature. Address this with cmd+k integration.
|
|
429
414
|
// mainAreaDisposition: 'in-flow',
|
|
@@ -440,7 +425,7 @@ var constructSpaceActionGroups = ({ space, dispatch }) => {
|
|
|
440
425
|
action: import_chunk_6CNYF6YU.SpaceAction.ADD_OBJECT,
|
|
441
426
|
data: {
|
|
442
427
|
target: collection,
|
|
443
|
-
object: (0, import_echo_schema2.create)(
|
|
428
|
+
object: (0, import_echo_schema2.create)(import_chunk_CVZPI2P3.CollectionType, {
|
|
444
429
|
objects: [],
|
|
445
430
|
views: {}
|
|
446
431
|
})
|
|
@@ -457,7 +442,8 @@ var constructSpaceActionGroups = ({ space, dispatch }) => {
|
|
|
457
442
|
ns: import_chunk_6CNYF6YU.SPACE_PLUGIN
|
|
458
443
|
}
|
|
459
444
|
],
|
|
460
|
-
icon:
|
|
445
|
+
icon: (props) => /* @__PURE__ */ import_react13.default.createElement(import_react12.CardsThree, props),
|
|
446
|
+
iconSymbol: "ph--cards-three--regular",
|
|
461
447
|
testId: "spacePlugin.createCollection"
|
|
462
448
|
}
|
|
463
449
|
}
|
|
@@ -491,7 +477,8 @@ var constructSpaceActions = ({ space, dispatch, personal, migrating }) => {
|
|
|
491
477
|
ns: import_chunk_6CNYF6YU.SPACE_PLUGIN
|
|
492
478
|
}
|
|
493
479
|
],
|
|
494
|
-
icon:
|
|
480
|
+
icon: (props) => /* @__PURE__ */ import_react13.default.createElement(import_react12.Database, props),
|
|
481
|
+
iconSymbol: "ph--database--regular",
|
|
495
482
|
disposition: "toolbar",
|
|
496
483
|
mainAreaDisposition: "in-flow",
|
|
497
484
|
disabled: migrating || import_migrations2.Migrations.running(space)
|
|
@@ -522,7 +509,8 @@ var constructSpaceActions = ({ space, dispatch, personal, migrating }) => {
|
|
|
522
509
|
ns: import_chunk_6CNYF6YU.SPACE_PLUGIN
|
|
523
510
|
}
|
|
524
511
|
],
|
|
525
|
-
icon:
|
|
512
|
+
icon: (props) => /* @__PURE__ */ import_react13.default.createElement(import_react12.Users, props),
|
|
513
|
+
iconSymbol: "ph--users--regular",
|
|
526
514
|
disabled: locked,
|
|
527
515
|
keyBinding: {
|
|
528
516
|
macos: "meta+.",
|
|
@@ -549,7 +537,8 @@ var constructSpaceActions = ({ space, dispatch, personal, migrating }) => {
|
|
|
549
537
|
ns: import_chunk_6CNYF6YU.SPACE_PLUGIN
|
|
550
538
|
}
|
|
551
539
|
],
|
|
552
|
-
icon: locked ?
|
|
540
|
+
icon: locked ? (props) => /* @__PURE__ */ import_react13.default.createElement(import_react12.LockSimpleOpen, props) : (props) => /* @__PURE__ */ import_react13.default.createElement(import_react12.LockSimple, props),
|
|
541
|
+
iconSymbol: locked ? "ph--lock-simple-open--regular" : "ph--lock-simple--regular"
|
|
553
542
|
}
|
|
554
543
|
}, {
|
|
555
544
|
id: getId(import_chunk_6CNYF6YU.SpaceAction.RENAME),
|
|
@@ -571,7 +560,8 @@ var constructSpaceActions = ({ space, dispatch, personal, migrating }) => {
|
|
|
571
560
|
ns: import_chunk_6CNYF6YU.SPACE_PLUGIN
|
|
572
561
|
}
|
|
573
562
|
],
|
|
574
|
-
icon:
|
|
563
|
+
icon: (props) => /* @__PURE__ */ import_react13.default.createElement(import_react12.PencilSimpleLine, props),
|
|
564
|
+
iconSymbol: "ph--pencil-simple-line--regular",
|
|
575
565
|
keyBinding: {
|
|
576
566
|
macos: "shift+F6",
|
|
577
567
|
windows: "shift+F6"
|
|
@@ -600,7 +590,8 @@ var constructSpaceActions = ({ space, dispatch, personal, migrating }) => {
|
|
|
600
590
|
ns: import_chunk_6CNYF6YU.SPACE_PLUGIN
|
|
601
591
|
}
|
|
602
592
|
],
|
|
603
|
-
icon:
|
|
593
|
+
icon: (props) => /* @__PURE__ */ import_react13.default.createElement(import_react12.X, props),
|
|
594
|
+
iconSymbol: "ph--x--regular",
|
|
604
595
|
mainAreaDisposition: "menu",
|
|
605
596
|
disabled: personal
|
|
606
597
|
}
|
|
@@ -626,7 +617,8 @@ var constructSpaceActions = ({ space, dispatch, personal, migrating }) => {
|
|
|
626
617
|
ns: import_chunk_6CNYF6YU.SPACE_PLUGIN
|
|
627
618
|
}
|
|
628
619
|
],
|
|
629
|
-
icon:
|
|
620
|
+
icon: (props) => /* @__PURE__ */ import_react13.default.createElement(import_react12.ClockCounterClockwise, props),
|
|
621
|
+
iconSymbol: "ph--clock-counter-clockwise--regular",
|
|
630
622
|
disposition: "toolbar",
|
|
631
623
|
mainAreaDisposition: "in-flow"
|
|
632
624
|
}
|
|
@@ -643,7 +635,7 @@ var createObjectNode = ({ object, space, resolve }) => {
|
|
|
643
635
|
if (Object.keys(metadata).length === 0) {
|
|
644
636
|
return void 0;
|
|
645
637
|
}
|
|
646
|
-
const partials = object instanceof
|
|
638
|
+
const partials = object instanceof import_chunk_CVZPI2P3.CollectionType ? getCollectionGraphNodePartials({
|
|
647
639
|
collection: object,
|
|
648
640
|
space,
|
|
649
641
|
resolve
|
|
@@ -660,7 +652,8 @@ var createObjectNode = ({ object, space, resolve }) => {
|
|
|
660
652
|
ns: import_chunk_6CNYF6YU.SPACE_PLUGIN
|
|
661
653
|
}
|
|
662
654
|
],
|
|
663
|
-
icon: metadata.icon ??
|
|
655
|
+
icon: metadata.icon ?? (() => /* @__PURE__ */ import_react13.default.createElement(import_react12.Placeholder, null)),
|
|
656
|
+
iconSymbol: metadata.iconSymbol ?? "ph--placeholder--regular",
|
|
664
657
|
testId: "spacePlugin.object",
|
|
665
658
|
persistenceClass: "echo",
|
|
666
659
|
persistenceKey: space?.id
|
|
@@ -668,7 +661,7 @@ var createObjectNode = ({ object, space, resolve }) => {
|
|
|
668
661
|
};
|
|
669
662
|
};
|
|
670
663
|
var constructObjectActionGroups = ({ object, dispatch }) => {
|
|
671
|
-
if (!(object instanceof
|
|
664
|
+
if (!(object instanceof import_chunk_CVZPI2P3.CollectionType)) {
|
|
672
665
|
return [];
|
|
673
666
|
}
|
|
674
667
|
const collection = object;
|
|
@@ -685,7 +678,8 @@ var constructObjectActionGroups = ({ object, dispatch }) => {
|
|
|
685
678
|
ns: import_chunk_6CNYF6YU.SPACE_PLUGIN
|
|
686
679
|
}
|
|
687
680
|
],
|
|
688
|
-
icon:
|
|
681
|
+
icon: (props) => /* @__PURE__ */ import_react13.default.createElement(import_react12.Plus, props),
|
|
682
|
+
iconSymbol: "ph--plus--regular",
|
|
689
683
|
disposition: "toolbar",
|
|
690
684
|
// TODO(wittjosiah): This is currently a navtree feature. Address this with cmd+k integration.
|
|
691
685
|
// mainAreaDisposition: 'in-flow',
|
|
@@ -702,7 +696,7 @@ var constructObjectActionGroups = ({ object, dispatch }) => {
|
|
|
702
696
|
action: import_chunk_6CNYF6YU.SpaceAction.ADD_OBJECT,
|
|
703
697
|
data: {
|
|
704
698
|
target: collection,
|
|
705
|
-
object: (0, import_echo_schema2.create)(
|
|
699
|
+
object: (0, import_echo_schema2.create)(import_chunk_CVZPI2P3.CollectionType, {
|
|
706
700
|
objects: [],
|
|
707
701
|
views: {}
|
|
708
702
|
})
|
|
@@ -719,7 +713,8 @@ var constructObjectActionGroups = ({ object, dispatch }) => {
|
|
|
719
713
|
ns: import_chunk_6CNYF6YU.SPACE_PLUGIN
|
|
720
714
|
}
|
|
721
715
|
],
|
|
722
|
-
icon:
|
|
716
|
+
icon: (props) => /* @__PURE__ */ import_react13.default.createElement(import_react12.CardsThree, props),
|
|
717
|
+
iconSymbol: "ph--cards-three--regular",
|
|
723
718
|
testId: "spacePlugin.createCollection"
|
|
724
719
|
}
|
|
725
720
|
}
|
|
@@ -746,12 +741,13 @@ var constructObjectActions = ({ node, dispatch }) => {
|
|
|
746
741
|
},
|
|
747
742
|
properties: {
|
|
748
743
|
label: [
|
|
749
|
-
object instanceof
|
|
744
|
+
object instanceof import_chunk_CVZPI2P3.CollectionType ? "rename collection label" : "rename object label",
|
|
750
745
|
{
|
|
751
746
|
ns: import_chunk_6CNYF6YU.SPACE_PLUGIN
|
|
752
747
|
}
|
|
753
748
|
],
|
|
754
|
-
icon:
|
|
749
|
+
icon: (props) => /* @__PURE__ */ import_react13.default.createElement(import_react12.PencilSimpleLine, props),
|
|
750
|
+
iconSymbol: "ph--pencil-simple-line--regular",
|
|
755
751
|
// TODO(wittjosiah): Doesn't work.
|
|
756
752
|
// keyBinding: 'shift+F6',
|
|
757
753
|
testId: "spacePlugin.renameObject"
|
|
@@ -764,7 +760,7 @@ var constructObjectActions = ({ node, dispatch }) => {
|
|
|
764
760
|
const graph = (0, import_plugin_graph2.getGraph)(node);
|
|
765
761
|
const collection = graph.nodes(node, {
|
|
766
762
|
relation: "inbound"
|
|
767
|
-
}).find(({ data }) => data instanceof
|
|
763
|
+
}).find(({ data }) => data instanceof import_chunk_CVZPI2P3.CollectionType)?.data;
|
|
768
764
|
await dispatch([
|
|
769
765
|
{
|
|
770
766
|
action: import_chunk_6CNYF6YU.SpaceAction.REMOVE_OBJECT,
|
|
@@ -777,13 +773,14 @@ var constructObjectActions = ({ node, dispatch }) => {
|
|
|
777
773
|
},
|
|
778
774
|
properties: {
|
|
779
775
|
label: [
|
|
780
|
-
object instanceof
|
|
776
|
+
object instanceof import_chunk_CVZPI2P3.CollectionType ? "delete collection label" : "delete object label",
|
|
781
777
|
{
|
|
782
778
|
ns: import_chunk_6CNYF6YU.SPACE_PLUGIN
|
|
783
779
|
}
|
|
784
780
|
],
|
|
785
|
-
icon:
|
|
786
|
-
|
|
781
|
+
icon: (props) => /* @__PURE__ */ import_react13.default.createElement(import_react12.Trash, props),
|
|
782
|
+
iconSymbol: "ph--trash--regular",
|
|
783
|
+
keyBinding: object instanceof import_chunk_CVZPI2P3.CollectionType ? void 0 : "shift+meta+Backspace",
|
|
787
784
|
testId: "spacePlugin.deleteObject"
|
|
788
785
|
}
|
|
789
786
|
},
|
|
@@ -801,7 +798,8 @@ var constructObjectActions = ({ node, dispatch }) => {
|
|
|
801
798
|
ns: import_chunk_6CNYF6YU.SPACE_PLUGIN
|
|
802
799
|
}
|
|
803
800
|
],
|
|
804
|
-
icon:
|
|
801
|
+
icon: (props) => /* @__PURE__ */ import_react13.default.createElement(import_react12.Link, props),
|
|
802
|
+
iconSymbol: "ph--link--regular",
|
|
805
803
|
testId: "spacePlugin.copyLink"
|
|
806
804
|
}
|
|
807
805
|
}
|
|
@@ -842,7 +840,7 @@ var cloneObject = async (object, resolve) => {
|
|
|
842
840
|
const serializer = metadata.serializer;
|
|
843
841
|
(0, import_invariant.invariant)(serializer, `No serializer for type: ${typename}`, {
|
|
844
842
|
F: __dxlog_file,
|
|
845
|
-
L:
|
|
843
|
+
L: 639,
|
|
846
844
|
S: void 0,
|
|
847
845
|
A: [
|
|
848
846
|
"serializer",
|
|
@@ -864,22 +862,22 @@ var MenuFooter = ({ object }) => {
|
|
|
864
862
|
const spaceName = space ? getSpaceDisplayName(space, {
|
|
865
863
|
personal: client.spaces.default === space
|
|
866
864
|
}) : "";
|
|
867
|
-
return space ? /* @__PURE__ */
|
|
865
|
+
return space ? /* @__PURE__ */ import_react11.default.createElement(import_react11.default.Fragment, null, /* @__PURE__ */ import_react11.default.createElement(import_react_ui7.DropdownMenu.Separator, null), /* @__PURE__ */ import_react11.default.createElement(import_react_ui7.DropdownMenu.GroupLabel, null, t("menu footer label")), /* @__PURE__ */ import_react11.default.createElement("dl", {
|
|
868
866
|
className: "pis-2 mbe-2 text-xs grid grid-cols-[max-content_1fr] gap-2"
|
|
869
|
-
}, /* @__PURE__ */
|
|
867
|
+
}, /* @__PURE__ */ import_react11.default.createElement("dt", {
|
|
870
868
|
className: "uppercase text-[.75em] tracking-wide font-medium mbs-px self-start"
|
|
871
|
-
}, t("location label")), /* @__PURE__ */
|
|
869
|
+
}, t("location label")), /* @__PURE__ */ import_react11.default.createElement("dd", {
|
|
872
870
|
className: "line-clamp-3"
|
|
873
|
-
}, /* @__PURE__ */
|
|
871
|
+
}, /* @__PURE__ */ import_react11.default.createElement(import_react10.Planet, {
|
|
874
872
|
className: "inline-block mie-1"
|
|
875
873
|
}), (0, import_react_ui7.toLocalizedString)(spaceName, t)))) : null;
|
|
876
874
|
};
|
|
877
875
|
var WAIT_FOR_OBJECT_TIMEOUT2 = 1e3;
|
|
878
876
|
var MissingObject = ({ id }) => {
|
|
879
877
|
const { t } = (0, import_react_ui8.useTranslation)(import_chunk_6CNYF6YU.SPACE_PLUGIN);
|
|
880
|
-
const [waiting, setWaiting] = (0,
|
|
878
|
+
const [waiting, setWaiting] = (0, import_react14.useState)(false);
|
|
881
879
|
const intentPlugin = (0, import_app_framework4.useResolvePlugin)(import_app_framework4.parseIntentPlugin);
|
|
882
|
-
(0,
|
|
880
|
+
(0, import_react14.useEffect)(() => {
|
|
883
881
|
if (!intentPlugin) {
|
|
884
882
|
return;
|
|
885
883
|
}
|
|
@@ -898,13 +896,13 @@ var MissingObject = ({ id }) => {
|
|
|
898
896
|
intentPlugin,
|
|
899
897
|
id
|
|
900
898
|
]);
|
|
901
|
-
return /* @__PURE__ */
|
|
899
|
+
return /* @__PURE__ */ import_react14.default.createElement("div", {
|
|
902
900
|
role: "none",
|
|
903
901
|
className: (0, import_react_ui_theme5.mx)(import_react_ui_theme5.baseSurface, "min-bs-screen is-full flex items-center justify-center p-8")
|
|
904
|
-
}, waiting ? /* @__PURE__ */
|
|
902
|
+
}, waiting ? /* @__PURE__ */ import_react14.default.createElement("p", {
|
|
905
903
|
role: "alert",
|
|
906
904
|
className: (0, import_react_ui_theme5.mx)(import_react_ui_theme5.descriptionText, "border border-dashed border-neutral-400/50 rounded-lg flex items-center justify-center p-8 font-normal text-lg")
|
|
907
|
-
}, t("missing object message")) : /* @__PURE__ */
|
|
905
|
+
}, t("missing object message")) : /* @__PURE__ */ import_react14.default.createElement(import_react_ui8.Status, {
|
|
908
906
|
indeterminate: true,
|
|
909
907
|
"aria-label": "Initializing"
|
|
910
908
|
}));
|
|
@@ -917,11 +915,11 @@ var Status2;
|
|
|
917
915
|
})(Status2 || (Status2 = {}));
|
|
918
916
|
var PersistenceStatus = ({ db }) => {
|
|
919
917
|
const { t } = (0, import_react_ui9.useTranslation)(import_chunk_6CNYF6YU.SPACE_PLUGIN);
|
|
920
|
-
const [displayMessage, setDisplayMessage] = (0,
|
|
921
|
-
const [status, naturalSetStatus] = (0,
|
|
922
|
-
const [prevStatus, setPrevStatus] = (0,
|
|
918
|
+
const [displayMessage, setDisplayMessage] = (0, import_react16.useState)(false);
|
|
919
|
+
const [status, naturalSetStatus] = (0, import_react16.useState)(0);
|
|
920
|
+
const [prevStatus, setPrevStatus] = (0, import_react16.useState)(0);
|
|
923
921
|
const _setStatus = (0, import_async2.debounce)(naturalSetStatus, 500);
|
|
924
|
-
(0,
|
|
922
|
+
(0, import_react16.useEffect)(() => {
|
|
925
923
|
setPrevStatus(status);
|
|
926
924
|
if (prevStatus !== status && status === 0) {
|
|
927
925
|
setDisplayMessage(true);
|
|
@@ -933,44 +931,44 @@ var PersistenceStatus = ({ db }) => {
|
|
|
933
931
|
]);
|
|
934
932
|
switch (status) {
|
|
935
933
|
case 2:
|
|
936
|
-
return /* @__PURE__ */
|
|
934
|
+
return /* @__PURE__ */ import_react16.default.createElement("div", {
|
|
937
935
|
className: "flex items-center"
|
|
938
|
-
}, /* @__PURE__ */
|
|
936
|
+
}, /* @__PURE__ */ import_react16.default.createElement(import_react15.Warning, {
|
|
939
937
|
className: (0, import_react_ui_theme6.mx)((0, import_react_ui_theme6.getSize)(4), "me-1")
|
|
940
|
-
}), /* @__PURE__ */
|
|
938
|
+
}), /* @__PURE__ */ import_react16.default.createElement("span", {
|
|
941
939
|
className: (0, import_react_ui_theme6.mx)("text-sm", import_react_ui_theme6.warningText)
|
|
942
940
|
}, t("persistence error label")));
|
|
943
941
|
case 1:
|
|
944
|
-
return /* @__PURE__ */
|
|
942
|
+
return /* @__PURE__ */ import_react16.default.createElement("div", {
|
|
945
943
|
className: "flex items-center"
|
|
946
|
-
}, /* @__PURE__ */
|
|
944
|
+
}, /* @__PURE__ */ import_react16.default.createElement(import_react15.ArrowsCounterClockwise, {
|
|
947
945
|
className: (0, import_react_ui_theme6.mx)((0, import_react_ui_theme6.getSize)(4), "me-1")
|
|
948
|
-
}), /* @__PURE__ */
|
|
946
|
+
}), /* @__PURE__ */ import_react16.default.createElement("span", {
|
|
949
947
|
className: (0, import_react_ui_theme6.mx)("text-sm", import_react_ui_theme6.staticPlaceholderText)
|
|
950
948
|
}, t("persistence pending label")));
|
|
951
949
|
case 0:
|
|
952
950
|
default:
|
|
953
|
-
return /* @__PURE__ */
|
|
951
|
+
return /* @__PURE__ */ import_react16.default.createElement(import_react_ui9.Tooltip.Root, {
|
|
954
952
|
delayDuration: 400
|
|
955
|
-
}, /* @__PURE__ */
|
|
953
|
+
}, /* @__PURE__ */ import_react16.default.createElement(import_react_ui9.Tooltip.Trigger, {
|
|
956
954
|
role: "status",
|
|
957
955
|
className: "flex items-center"
|
|
958
|
-
}, /* @__PURE__ */
|
|
956
|
+
}, /* @__PURE__ */ import_react16.default.createElement(import_react15.CheckCircle, {
|
|
959
957
|
className: (0, import_react_ui_theme6.mx)((0, import_react_ui_theme6.getSize)(4), "me-1")
|
|
960
|
-
}), displayMessage && /* @__PURE__ */
|
|
958
|
+
}), displayMessage && /* @__PURE__ */ import_react16.default.createElement("span", {
|
|
961
959
|
className: (0, import_react_ui_theme6.mx)("text-sm", import_react_ui_theme6.staticPlaceholderText)
|
|
962
|
-
}, t("persisted locally label"))), /* @__PURE__ */
|
|
960
|
+
}, t("persisted locally label"))), /* @__PURE__ */ import_react16.default.createElement(import_react_ui9.Tooltip.Portal, null, /* @__PURE__ */ import_react16.default.createElement(import_react_ui9.Tooltip.Content, {
|
|
963
961
|
classNames: "z-10"
|
|
964
|
-
}, t("persisted locally message"), /* @__PURE__ */
|
|
962
|
+
}, t("persisted locally message"), /* @__PURE__ */ import_react16.default.createElement(import_react_ui9.Tooltip.Arrow, null))));
|
|
965
963
|
}
|
|
966
964
|
};
|
|
967
965
|
var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/PopoverRenameObject.tsx";
|
|
968
966
|
var PopoverRenameObject = ({ object: obj }) => {
|
|
969
967
|
const { t } = (0, import_react_ui10.useTranslation)(import_chunk_6CNYF6YU.SPACE_PLUGIN);
|
|
970
|
-
const doneButton = (0,
|
|
968
|
+
const doneButton = (0, import_react17.useRef)(null);
|
|
971
969
|
const object = obj;
|
|
972
|
-
const [name, setName] = (0,
|
|
973
|
-
const handleDone = (0,
|
|
970
|
+
const [name, setName] = (0, import_react17.useState)(object.name || object.title || "");
|
|
971
|
+
const handleDone = (0, import_react17.useCallback)(() => {
|
|
974
972
|
try {
|
|
975
973
|
object.name = name;
|
|
976
974
|
} catch {
|
|
@@ -991,23 +989,23 @@ var PopoverRenameObject = ({ object: obj }) => {
|
|
|
991
989
|
object,
|
|
992
990
|
name
|
|
993
991
|
]);
|
|
994
|
-
return /* @__PURE__ */
|
|
992
|
+
return /* @__PURE__ */ import_react17.default.createElement("div", {
|
|
995
993
|
role: "none",
|
|
996
994
|
className: "p-1 flex gap-2"
|
|
997
|
-
}, /* @__PURE__ */
|
|
995
|
+
}, /* @__PURE__ */ import_react17.default.createElement("div", {
|
|
998
996
|
role: "none",
|
|
999
997
|
className: "flex-1"
|
|
1000
|
-
}, /* @__PURE__ */
|
|
998
|
+
}, /* @__PURE__ */ import_react17.default.createElement(import_react_ui10.Input.Root, null, /* @__PURE__ */ import_react17.default.createElement(import_react_ui10.Input.Label, {
|
|
1001
999
|
srOnly: true
|
|
1002
|
-
}, t("object name label")), /* @__PURE__ */
|
|
1000
|
+
}, t("object name label")), /* @__PURE__ */ import_react17.default.createElement(import_react_ui10.Input.TextInput, {
|
|
1003
1001
|
placeholder: t("object title placeholder"),
|
|
1004
1002
|
value: name,
|
|
1005
1003
|
"data-testid": "spacePlugin.renameObject.input",
|
|
1006
1004
|
onChange: ({ target: { value } }) => setName(value),
|
|
1007
1005
|
onKeyDown: ({ key }) => key === "Enter" && doneButton.current?.click()
|
|
1008
|
-
}))), /* @__PURE__ */
|
|
1006
|
+
}))), /* @__PURE__ */ import_react17.default.createElement(import_react_ui10.Popover.Close, {
|
|
1009
1007
|
asChild: true
|
|
1010
|
-
}, /* @__PURE__ */
|
|
1008
|
+
}, /* @__PURE__ */ import_react17.default.createElement(import_react_ui10.Button, {
|
|
1011
1009
|
ref: doneButton,
|
|
1012
1010
|
classNames: "self-stretch",
|
|
1013
1011
|
onClick: handleDone
|
|
@@ -1017,32 +1015,32 @@ var PopoverRenameObject = ({ object: obj }) => {
|
|
|
1017
1015
|
};
|
|
1018
1016
|
var PopoverRenameSpace = ({ space }) => {
|
|
1019
1017
|
const { t } = (0, import_react_ui11.useTranslation)(import_chunk_6CNYF6YU.SPACE_PLUGIN);
|
|
1020
|
-
const doneButton = (0,
|
|
1021
|
-
const [name, setName] = (0,
|
|
1022
|
-
const handleDone = (0,
|
|
1018
|
+
const doneButton = (0, import_react18.useRef)(null);
|
|
1019
|
+
const [name, setName] = (0, import_react18.useState)(space.properties.name ?? "");
|
|
1020
|
+
const handleDone = (0, import_react18.useCallback)(() => {
|
|
1023
1021
|
space.properties.name = name;
|
|
1024
1022
|
}, [
|
|
1025
1023
|
space,
|
|
1026
1024
|
name
|
|
1027
1025
|
]);
|
|
1028
|
-
return /* @__PURE__ */
|
|
1026
|
+
return /* @__PURE__ */ import_react18.default.createElement("div", {
|
|
1029
1027
|
role: "none",
|
|
1030
1028
|
className: "p-1 flex gap-2"
|
|
1031
|
-
}, /* @__PURE__ */
|
|
1029
|
+
}, /* @__PURE__ */ import_react18.default.createElement("div", {
|
|
1032
1030
|
role: "none",
|
|
1033
1031
|
className: "flex-1"
|
|
1034
|
-
}, /* @__PURE__ */
|
|
1032
|
+
}, /* @__PURE__ */ import_react18.default.createElement(import_react_ui11.Input.Root, null, /* @__PURE__ */ import_react18.default.createElement(import_react_ui11.Input.Label, {
|
|
1035
1033
|
srOnly: true
|
|
1036
|
-
}, t("space name label")), /* @__PURE__ */
|
|
1034
|
+
}, t("space name label")), /* @__PURE__ */ import_react18.default.createElement(import_react_ui11.Input.TextInput, {
|
|
1037
1035
|
defaultValue: space.properties.name ?? "",
|
|
1038
1036
|
placeholder: t("unnamed space label"),
|
|
1039
1037
|
onChange: ({ target: { value } }) => setName(value),
|
|
1040
1038
|
// TODO(wittjosiah): Ideally this should access the popover context to close the popover.
|
|
1041
1039
|
// Currently this is not possible because Radix does not expose the popover context.
|
|
1042
1040
|
onKeyDown: ({ key }) => key === "Enter" && doneButton.current?.click()
|
|
1043
|
-
}))), /* @__PURE__ */
|
|
1041
|
+
}))), /* @__PURE__ */ import_react18.default.createElement(import_react_ui11.Popover.Close, {
|
|
1044
1042
|
asChild: true
|
|
1045
|
-
}, /* @__PURE__ */
|
|
1043
|
+
}, /* @__PURE__ */ import_react18.default.createElement(import_react_ui11.Button, {
|
|
1046
1044
|
ref: doneButton,
|
|
1047
1045
|
classNames: "self-stretch",
|
|
1048
1046
|
onClick: handleDone
|
|
@@ -1052,7 +1050,7 @@ var PopoverRenameSpace = ({ space }) => {
|
|
|
1052
1050
|
};
|
|
1053
1051
|
var ShareSpaceButton = ({ spaceId }) => {
|
|
1054
1052
|
const dispatch = (0, import_app_framework5.useIntentDispatcher)();
|
|
1055
|
-
return /* @__PURE__ */
|
|
1053
|
+
return /* @__PURE__ */ import_react19.default.createElement(ShareSpaceButtonImpl, {
|
|
1056
1054
|
onClick: () => dispatch({
|
|
1057
1055
|
action: import_chunk_6CNYF6YU.SpaceAction.SHARE,
|
|
1058
1056
|
data: {
|
|
@@ -1063,7 +1061,7 @@ var ShareSpaceButton = ({ spaceId }) => {
|
|
|
1063
1061
|
};
|
|
1064
1062
|
var ShareSpaceButtonImpl = ({ onClick }) => {
|
|
1065
1063
|
const { t } = (0, import_react_ui12.useTranslation)(import_chunk_6CNYF6YU.SPACE_PLUGIN);
|
|
1066
|
-
return /* @__PURE__ */
|
|
1064
|
+
return /* @__PURE__ */ import_react19.default.createElement(import_react_ui12.Button, {
|
|
1067
1065
|
"data-testid": "spacePlugin.shareSpaceButton",
|
|
1068
1066
|
onClick,
|
|
1069
1067
|
classNames: "mli-1"
|
|
@@ -1073,9 +1071,9 @@ var activeActionKeyStorageKey = "dxos:react-shell/space-manager/active-action";
|
|
|
1073
1071
|
var Presence = import_echo6.SpaceMember.PresenceState;
|
|
1074
1072
|
var handleCreateInvitationUrl = (invitationCode) => `${origin}?spaceInvitationCode=${invitationCode}`;
|
|
1075
1073
|
var SpaceMemberList = ({ members }) => {
|
|
1076
|
-
return members.length > 0 ? /* @__PURE__ */
|
|
1074
|
+
return members.length > 0 ? /* @__PURE__ */ import_react24.default.createElement(import_react_ui14.List, {
|
|
1077
1075
|
classNames: "col-start-2 col-end-5 gap-y-1 grid grid-cols-subgrid items-center"
|
|
1078
|
-
}, members.map((member) => /* @__PURE__ */
|
|
1076
|
+
}, members.map((member) => /* @__PURE__ */ import_react24.default.createElement(import_react25.IdentityListItem, {
|
|
1079
1077
|
classNames: "contents",
|
|
1080
1078
|
key: member.identity.identityKey.toHex(),
|
|
1081
1079
|
identity: member.identity,
|
|
@@ -1119,8 +1117,8 @@ var SpaceMembersSection = ({ space }) => {
|
|
|
1119
1117
|
description: t("invite one description", {
|
|
1120
1118
|
ns: "os"
|
|
1121
1119
|
}),
|
|
1122
|
-
icon:
|
|
1123
|
-
onClick: (0,
|
|
1120
|
+
icon: import_react23.UserPlus,
|
|
1121
|
+
onClick: (0, import_react24.useCallback)(() => {
|
|
1124
1122
|
space.share?.({
|
|
1125
1123
|
type: import_invitations2.Invitation.Type.INTERACTIVE,
|
|
1126
1124
|
authMethod: import_invitations2.Invitation.AuthMethod.SHARED_SECRET
|
|
@@ -1136,8 +1134,8 @@ var SpaceMembersSection = ({ space }) => {
|
|
|
1136
1134
|
description: t("invite many description", {
|
|
1137
1135
|
ns: "os"
|
|
1138
1136
|
}),
|
|
1139
|
-
icon:
|
|
1140
|
-
onClick: (0,
|
|
1137
|
+
icon: import_react23.UsersThree,
|
|
1138
|
+
onClick: (0, import_react24.useCallback)(() => {
|
|
1141
1139
|
space.share?.({
|
|
1142
1140
|
type: import_invitations2.Invitation.Type.INTERACTIVE,
|
|
1143
1141
|
authMethod: import_invitations2.Invitation.AuthMethod.NONE,
|
|
@@ -1148,7 +1146,7 @@ var SpaceMembersSection = ({ space }) => {
|
|
|
1148
1146
|
])
|
|
1149
1147
|
}
|
|
1150
1148
|
};
|
|
1151
|
-
const [activeActionKey, setInternalActiveActionKey] = (0,
|
|
1149
|
+
const [activeActionKey, setInternalActiveActionKey] = (0, import_react24.useState)(localStorage.getItem(activeActionKeyStorageKey) ?? "inviteOne");
|
|
1152
1150
|
const setActiveActionKey = (nextKey) => {
|
|
1153
1151
|
setInternalActiveActionKey(nextKey);
|
|
1154
1152
|
localStorage.setItem(activeActionKeyStorageKey, nextKey);
|
|
@@ -1161,101 +1159,101 @@ var SpaceMembersSection = ({ space }) => {
|
|
|
1161
1159
|
[Presence.ONLINE]: [],
|
|
1162
1160
|
[Presence.OFFLINE]: []
|
|
1163
1161
|
});
|
|
1164
|
-
return /* @__PURE__ */
|
|
1162
|
+
return /* @__PURE__ */ import_react24.default.createElement("section", {
|
|
1165
1163
|
className: "mbe-4 col-span-3 grid gap-y-2 grid-cols-subgrid auto-rows-min"
|
|
1166
|
-
}, /* @__PURE__ */
|
|
1164
|
+
}, /* @__PURE__ */ import_react24.default.createElement("h2", {
|
|
1167
1165
|
className: "contents"
|
|
1168
|
-
}, /* @__PURE__ */
|
|
1166
|
+
}, /* @__PURE__ */ import_react24.default.createElement(import_react23.UsersThree, {
|
|
1169
1167
|
weight: "duotone",
|
|
1170
1168
|
className: (0, import_react_ui_theme8.mx)((0, import_react_ui_theme8.getSize)(5), "place-self-center")
|
|
1171
|
-
}), /* @__PURE__ */
|
|
1169
|
+
}), /* @__PURE__ */ import_react24.default.createElement("span", {
|
|
1172
1170
|
className: "text-lg col-span-2"
|
|
1173
|
-
}, t("space members label"))), /* @__PURE__ */
|
|
1171
|
+
}, t("space members label"))), /* @__PURE__ */ import_react24.default.createElement("h3", {
|
|
1174
1172
|
className: "col-start-2 col-span-3 text-sm italic text-description"
|
|
1175
|
-
}, t("invitations heading")), invitations.length > 0 && /* @__PURE__ */
|
|
1173
|
+
}, t("invitations heading")), invitations.length > 0 && /* @__PURE__ */ import_react24.default.createElement(import_react_ui14.List, {
|
|
1176
1174
|
classNames: "col-start-2 col-span-2 gap-y-2 grid grid-cols-[var(--rail-size)_1fr_var(--rail-action)_var(--rail-action)]"
|
|
1177
|
-
}, invitations.map((invitation) => /* @__PURE__ */
|
|
1175
|
+
}, invitations.map((invitation) => /* @__PURE__ */ import_react24.default.createElement(import_react25.InvitationListItem, {
|
|
1178
1176
|
reverseEffects: true,
|
|
1179
1177
|
classNames: "pis-0 pie-0 gap-0 col-span-4 grid grid-cols-subgrid",
|
|
1180
1178
|
key: invitation.get().invitationId,
|
|
1181
1179
|
invitation,
|
|
1182
1180
|
send: handleInvitationSelect,
|
|
1183
1181
|
createInvitationUrl: handleCreateInvitationUrl
|
|
1184
|
-
}))), /* @__PURE__ */
|
|
1182
|
+
}))), /* @__PURE__ */ import_react24.default.createElement(import_react_ui14.ButtonGroup, {
|
|
1185
1183
|
classNames: "col-start-2 col-end-4 grid grid-cols-[1fr_var(--rail-action)] place-self-grow gap-px"
|
|
1186
|
-
}, /* @__PURE__ */
|
|
1184
|
+
}, /* @__PURE__ */ import_react24.default.createElement(import_react_ui14.Button, {
|
|
1187
1185
|
classNames: "gap-2",
|
|
1188
1186
|
onClick: activeAction.onClick
|
|
1189
|
-
}, /* @__PURE__ */
|
|
1187
|
+
}, /* @__PURE__ */ import_react24.default.createElement(activeAction.icon, {
|
|
1190
1188
|
className: (0, import_react_ui_theme8.getSize)(5)
|
|
1191
|
-
}), /* @__PURE__ */
|
|
1189
|
+
}), /* @__PURE__ */ import_react24.default.createElement("span", null, t(activeAction.label, {
|
|
1192
1190
|
ns: "os"
|
|
1193
|
-
}))), /* @__PURE__ */
|
|
1191
|
+
}))), /* @__PURE__ */ import_react24.default.createElement(import_react_ui14.DropdownMenu.Root, null, /* @__PURE__ */ import_react24.default.createElement(import_react_ui14.DropdownMenu.Trigger, {
|
|
1194
1192
|
asChild: true
|
|
1195
|
-
}, /* @__PURE__ */
|
|
1193
|
+
}, /* @__PURE__ */ import_react24.default.createElement(import_react_ui14.Button, {
|
|
1196
1194
|
classNames: "pli-0"
|
|
1197
|
-
}, /* @__PURE__ */
|
|
1195
|
+
}, /* @__PURE__ */ import_react24.default.createElement(import_react23.CaretDown, {
|
|
1198
1196
|
className: (0, import_react_ui_theme8.getSize)(4)
|
|
1199
|
-
}))), /* @__PURE__ */
|
|
1200
|
-
return /* @__PURE__ */
|
|
1197
|
+
}))), /* @__PURE__ */ import_react24.default.createElement(import_react_ui14.DropdownMenu.Content, null, /* @__PURE__ */ import_react24.default.createElement(import_react_ui14.DropdownMenu.Viewport, null, Object.entries(inviteActions).map(([id, action]) => {
|
|
1198
|
+
return /* @__PURE__ */ import_react24.default.createElement(import_react_ui14.DropdownMenu.CheckboxItem, {
|
|
1201
1199
|
key: id,
|
|
1202
1200
|
"aria-labelledby": `${id}__label`,
|
|
1203
1201
|
"aria-describedby": `${id}__description`,
|
|
1204
1202
|
checked: activeActionKey === id,
|
|
1205
1203
|
onCheckedChange: (checked) => checked && setActiveActionKey(id),
|
|
1206
1204
|
classNames: "gap-2"
|
|
1207
|
-
}, action.icon && /* @__PURE__ */
|
|
1205
|
+
}, action.icon && /* @__PURE__ */ import_react24.default.createElement(action.icon, {
|
|
1208
1206
|
className: (0, import_react_ui_theme8.getSize)(5)
|
|
1209
|
-
}), /* @__PURE__ */
|
|
1207
|
+
}), /* @__PURE__ */ import_react24.default.createElement("div", {
|
|
1210
1208
|
role: "none",
|
|
1211
1209
|
className: "flex-1 min-is-0 space-b-1"
|
|
1212
|
-
}, /* @__PURE__ */
|
|
1210
|
+
}, /* @__PURE__ */ import_react24.default.createElement("p", {
|
|
1213
1211
|
id: `${id}__label`
|
|
1214
1212
|
}, t(action.label, {
|
|
1215
1213
|
ns: "os"
|
|
1216
|
-
})), action.description && /* @__PURE__ */
|
|
1214
|
+
})), action.description && /* @__PURE__ */ import_react24.default.createElement("p", {
|
|
1217
1215
|
id: `${id}__description`,
|
|
1218
1216
|
className: import_react_ui_theme8.descriptionText
|
|
1219
1217
|
}, t(action.description, {
|
|
1220
1218
|
ns: "os"
|
|
1221
|
-
}))), /* @__PURE__ */
|
|
1219
|
+
}))), /* @__PURE__ */ import_react24.default.createElement(import_react_ui14.DropdownMenu.ItemIndicator, {
|
|
1222
1220
|
asChild: true
|
|
1223
|
-
}, /* @__PURE__ */
|
|
1221
|
+
}, /* @__PURE__ */ import_react24.default.createElement(import_react23.Check, {
|
|
1224
1222
|
className: (0, import_react_ui_theme8.getSize)(4)
|
|
1225
1223
|
})));
|
|
1226
|
-
})), /* @__PURE__ */
|
|
1224
|
+
})), /* @__PURE__ */ import_react24.default.createElement(import_react_ui14.DropdownMenu.Arrow, null)))), members[Presence.ONLINE].length + members[Presence.OFFLINE].length < 1 ? /* @__PURE__ */ import_react24.default.createElement("p", {
|
|
1227
1225
|
className: (0, import_react_ui_theme8.mx)(import_react_ui_theme8.descriptionText, "text-center is-full mlb-2")
|
|
1228
1226
|
}, t("empty space members message", {
|
|
1229
1227
|
ns: "os"
|
|
1230
|
-
})) : /* @__PURE__ */
|
|
1228
|
+
})) : /* @__PURE__ */ import_react24.default.createElement(import_react24.default.Fragment, null, /* @__PURE__ */ import_react24.default.createElement("h3", {
|
|
1231
1229
|
className: "col-start-2 col-end-5 text-sm italic text-description"
|
|
1232
1230
|
}, t("active space members heading", {
|
|
1233
1231
|
count: members[Presence.ONLINE].length
|
|
1234
|
-
})), /* @__PURE__ */
|
|
1232
|
+
})), /* @__PURE__ */ import_react24.default.createElement(SpaceMemberList, {
|
|
1235
1233
|
members: members[Presence.ONLINE]
|
|
1236
|
-
}), /* @__PURE__ */
|
|
1234
|
+
}), /* @__PURE__ */ import_react24.default.createElement("h3", {
|
|
1237
1235
|
className: "col-start-2 col-end-5 text-sm italic text-description"
|
|
1238
1236
|
}, t("inactive space members heading", {
|
|
1239
1237
|
count: members[Presence.OFFLINE].length
|
|
1240
|
-
})), /* @__PURE__ */
|
|
1238
|
+
})), /* @__PURE__ */ import_react24.default.createElement(SpaceMemberList, {
|
|
1241
1239
|
members: members[Presence.OFFLINE]
|
|
1242
1240
|
})));
|
|
1243
1241
|
};
|
|
1244
1242
|
var KeyShortcuts = () => {
|
|
1245
1243
|
const { t } = (0, import_react_ui13.useTranslation)(import_chunk_6CNYF6YU.SPACE_PLUGIN);
|
|
1246
|
-
return /* @__PURE__ */
|
|
1244
|
+
return /* @__PURE__ */ import_react21.default.createElement("section", {
|
|
1247
1245
|
className: "mbe-4 col-span-4 md:col-start-5 md:col-end-7 grid grid-cols-subgrid gap-y-2 auto-rows-min"
|
|
1248
|
-
}, /* @__PURE__ */
|
|
1246
|
+
}, /* @__PURE__ */ import_react21.default.createElement("h2", {
|
|
1249
1247
|
className: "contents"
|
|
1250
|
-
}, /* @__PURE__ */
|
|
1248
|
+
}, /* @__PURE__ */ import_react21.default.createElement(import_react20.Command, {
|
|
1251
1249
|
weight: "duotone",
|
|
1252
1250
|
className: (0, import_react_ui_theme7.mx)((0, import_react_ui_theme7.getSize)(5), "place-self-center")
|
|
1253
|
-
}), /* @__PURE__ */
|
|
1251
|
+
}), /* @__PURE__ */ import_react21.default.createElement("span", {
|
|
1254
1252
|
className: "text-lg col-span-2 md:col-span-1"
|
|
1255
|
-
}, t("keyshortcuts label"))), /* @__PURE__ */
|
|
1253
|
+
}, t("keyshortcuts label"))), /* @__PURE__ */ import_react21.default.createElement("div", {
|
|
1256
1254
|
role: "none",
|
|
1257
1255
|
className: "col-start-2 col-end-4 md:col-end-5 pie-2"
|
|
1258
|
-
}, /* @__PURE__ */
|
|
1256
|
+
}, /* @__PURE__ */ import_react21.default.createElement(import_app_framework6.Surface, {
|
|
1259
1257
|
role: "keyshortcuts"
|
|
1260
1258
|
})));
|
|
1261
1259
|
};
|
|
@@ -1264,7 +1262,7 @@ var SpaceMain = ({ space, role }) => {
|
|
|
1264
1262
|
const state = space.state.get();
|
|
1265
1263
|
const ready = state === import_echo5.SpaceState.SPACE_READY;
|
|
1266
1264
|
const Root = role === "main" ? import_react_ui13.Main.Content : "div";
|
|
1267
|
-
return /* @__PURE__ */
|
|
1265
|
+
return /* @__PURE__ */ import_react21.default.createElement(import_react22.ClipboardProvider, null, /* @__PURE__ */ import_react21.default.createElement(Root, {
|
|
1268
1266
|
...role === "main" ? {
|
|
1269
1267
|
classNames: [
|
|
1270
1268
|
import_react_ui_theme7.topbarBlockPaddingStart,
|
|
@@ -1277,9 +1275,9 @@ var SpaceMain = ({ space, role }) => {
|
|
|
1277
1275
|
},
|
|
1278
1276
|
"data-testid": `spacePlugin.${role}`,
|
|
1279
1277
|
"data-isready": ready ? "true" : "false"
|
|
1280
|
-
}, ready && /* @__PURE__ */
|
|
1278
|
+
}, ready && /* @__PURE__ */ import_react21.default.createElement(SpaceMembersSection, {
|
|
1281
1279
|
space
|
|
1282
|
-
}), /* @__PURE__ */
|
|
1280
|
+
}), /* @__PURE__ */ import_react21.default.createElement(KeyShortcuts, null)));
|
|
1283
1281
|
};
|
|
1284
1282
|
var REFRESH_INTERVAL = 5e3;
|
|
1285
1283
|
var ACTIVITY_DURATION = 3e4;
|
|
@@ -1292,13 +1290,13 @@ var SpacePresence = ({ object, spaceKey }) => {
|
|
|
1292
1290
|
const identity = (0, import_halo.useIdentity)();
|
|
1293
1291
|
const space = spaceKey ? client.spaces.get(spaceKey) : (0, import_echo7.getSpace)(object);
|
|
1294
1292
|
const spaceMembers = (0, import_echo7.useMembers)(space?.key);
|
|
1295
|
-
const [_moment, setMoment] = (0,
|
|
1296
|
-
(0,
|
|
1293
|
+
const [_moment, setMoment] = (0, import_react26.useState)(Date.now());
|
|
1294
|
+
(0, import_react26.useEffect)(() => {
|
|
1297
1295
|
const interval = setInterval(() => setMoment(Date.now()), REFRESH_INTERVAL);
|
|
1298
1296
|
return () => clearInterval(interval);
|
|
1299
1297
|
}, []);
|
|
1300
|
-
const memberOnline = (0,
|
|
1301
|
-
const memberIsNotSelf = (0,
|
|
1298
|
+
const memberOnline = (0, import_react26.useCallback)((member) => member.presence === 1, []);
|
|
1299
|
+
const memberIsNotSelf = (0, import_react26.useCallback)((member) => !identity?.identityKey.equals(member.identity.identityKey), [
|
|
1302
1300
|
identity?.identityKey
|
|
1303
1301
|
]);
|
|
1304
1302
|
if (!identity || !spacePlugin || !space) {
|
|
@@ -1316,9 +1314,9 @@ var SpacePresence = ({ object, spaceKey }) => {
|
|
|
1316
1314
|
lastSeen
|
|
1317
1315
|
};
|
|
1318
1316
|
}).toSorted((a, b) => a.lastSeen - b.lastSeen);
|
|
1319
|
-
return density === "fine" ? /* @__PURE__ */
|
|
1317
|
+
return density === "fine" ? /* @__PURE__ */ import_react26.default.createElement(SmallPresence, {
|
|
1320
1318
|
count: membersForObject.length
|
|
1321
|
-
}) : /* @__PURE__ */
|
|
1319
|
+
}) : /* @__PURE__ */ import_react26.default.createElement(FullPresence, {
|
|
1322
1320
|
members: membersForObject
|
|
1323
1321
|
});
|
|
1324
1322
|
};
|
|
@@ -1328,38 +1326,38 @@ var FullPresence = (props) => {
|
|
|
1328
1326
|
if (members.length === 0) {
|
|
1329
1327
|
return null;
|
|
1330
1328
|
}
|
|
1331
|
-
return /* @__PURE__ */
|
|
1329
|
+
return /* @__PURE__ */ import_react26.default.createElement(import_react_ui15.AvatarGroup.Root, {
|
|
1332
1330
|
size,
|
|
1333
1331
|
classNames: "mbs-2 mie-4",
|
|
1334
1332
|
"data-testid": "spacePlugin.presence"
|
|
1335
|
-
}, members.slice(0, 3).map((member, i) => /* @__PURE__ */
|
|
1333
|
+
}, members.slice(0, 3).map((member, i) => /* @__PURE__ */ import_react26.default.createElement(import_react_ui15.Tooltip.Root, {
|
|
1336
1334
|
key: member.identity.identityKey.toHex()
|
|
1337
|
-
}, /* @__PURE__ */
|
|
1335
|
+
}, /* @__PURE__ */ import_react26.default.createElement(import_react_ui15.Tooltip.Trigger, null, /* @__PURE__ */ import_react26.default.createElement(PrensenceAvatar, {
|
|
1338
1336
|
identity: member.identity,
|
|
1339
1337
|
group: true,
|
|
1340
1338
|
match: member.currentlyAttended,
|
|
1341
1339
|
index: members.length - i,
|
|
1342
1340
|
onClick: () => onMemberClick?.(member)
|
|
1343
|
-
})), /* @__PURE__ */
|
|
1341
|
+
})), /* @__PURE__ */ import_react26.default.createElement(import_react_ui15.Tooltip.Portal, null, /* @__PURE__ */ import_react26.default.createElement(import_react_ui15.Tooltip.Content, {
|
|
1344
1342
|
side: "bottom"
|
|
1345
|
-
}, /* @__PURE__ */
|
|
1343
|
+
}, /* @__PURE__ */ import_react26.default.createElement("span", null, getName(member.identity)), /* @__PURE__ */ import_react26.default.createElement(import_react_ui15.Tooltip.Arrow, null))))), members.length > 3 && /* @__PURE__ */ import_react26.default.createElement(import_react_ui15.Tooltip.Root, null, /* @__PURE__ */ import_react26.default.createElement(import_react_ui15.Tooltip.Trigger, null, /* @__PURE__ */ import_react26.default.createElement(import_react_ui15.AvatarGroupItem.Root, {
|
|
1346
1344
|
status: "inactive"
|
|
1347
|
-
}, /* @__PURE__ */
|
|
1345
|
+
}, /* @__PURE__ */ import_react26.default.createElement(import_react_ui15.Avatar.Frame, {
|
|
1348
1346
|
style: {
|
|
1349
1347
|
zIndex: members.length - 4
|
|
1350
1348
|
}
|
|
1351
|
-
}, /* @__PURE__ */
|
|
1349
|
+
}, /* @__PURE__ */ import_react26.default.createElement(import_react_ui15.Avatar.Fallback, {
|
|
1352
1350
|
text: `+${members.length - 3}`
|
|
1353
|
-
})))), /* @__PURE__ */
|
|
1351
|
+
})))), /* @__PURE__ */ import_react26.default.createElement(import_react_ui15.Tooltip.Portal, null, /* @__PURE__ */ import_react26.default.createElement(import_react_ui15.Tooltip.Content, {
|
|
1354
1352
|
side: "bottom"
|
|
1355
|
-
}, /* @__PURE__ */
|
|
1353
|
+
}, /* @__PURE__ */ import_react26.default.createElement(import_react_ui15.Tooltip.Arrow, null), /* @__PURE__ */ import_react26.default.createElement(import_react_ui15.List, {
|
|
1356
1354
|
classNames: "max-h-56 overflow-y-auto"
|
|
1357
|
-
}, members.map((member) => /* @__PURE__ */
|
|
1355
|
+
}, members.map((member) => /* @__PURE__ */ import_react26.default.createElement(import_react_ui15.ListItem.Root, {
|
|
1358
1356
|
key: member.identity.identityKey.toHex(),
|
|
1359
1357
|
classNames: "flex gap-2 items-center cursor-pointer mbe-2",
|
|
1360
1358
|
onClick: () => onMemberClick?.(member),
|
|
1361
1359
|
"data-testid": "identity-list-item"
|
|
1362
|
-
}, /* @__PURE__ */
|
|
1360
|
+
}, /* @__PURE__ */ import_react26.default.createElement(PrensenceAvatar, {
|
|
1363
1361
|
identity: member.identity,
|
|
1364
1362
|
showName: true,
|
|
1365
1363
|
match: member.currentlyAttended
|
|
@@ -1369,10 +1367,10 @@ var PrensenceAvatar = ({ identity, showName, match, group, index, onClick }) =>
|
|
|
1369
1367
|
const Root = group ? import_react_ui15.AvatarGroupItem.Root : import_react_ui15.Avatar.Root;
|
|
1370
1368
|
const status = match ? "current" : "active";
|
|
1371
1369
|
const fallbackValue = (0, import_util2.keyToFallback)(identity.identityKey);
|
|
1372
|
-
return /* @__PURE__ */
|
|
1370
|
+
return /* @__PURE__ */ import_react26.default.createElement(Root, {
|
|
1373
1371
|
status,
|
|
1374
1372
|
hue: identity.profile?.data?.hue || fallbackValue.hue
|
|
1375
|
-
}, /* @__PURE__ */
|
|
1373
|
+
}, /* @__PURE__ */ import_react26.default.createElement(import_react_ui15.Avatar.Frame, {
|
|
1376
1374
|
"data-testid": "spacePlugin.presence.member",
|
|
1377
1375
|
"data-status": status,
|
|
1378
1376
|
...index ? {
|
|
@@ -1381,44 +1379,43 @@ var PrensenceAvatar = ({ identity, showName, match, group, index, onClick }) =>
|
|
|
1381
1379
|
}
|
|
1382
1380
|
} : {},
|
|
1383
1381
|
onClick: () => onClick?.()
|
|
1384
|
-
}, /* @__PURE__ */
|
|
1382
|
+
}, /* @__PURE__ */ import_react26.default.createElement(import_react_ui15.Avatar.Fallback, {
|
|
1385
1383
|
text: identity.profile?.data?.emoji || fallbackValue.emoji
|
|
1386
|
-
})), showName && /* @__PURE__ */
|
|
1384
|
+
})), showName && /* @__PURE__ */ import_react26.default.createElement(import_react_ui15.Avatar.Label, {
|
|
1387
1385
|
classNames: "text-sm truncate pli-2"
|
|
1388
1386
|
}, getName(identity)));
|
|
1389
1387
|
};
|
|
1390
1388
|
var SmallPresenceLive = ({ viewers }) => {
|
|
1391
|
-
const [moment, setMoment] = (0,
|
|
1392
|
-
(0,
|
|
1389
|
+
const [moment, setMoment] = (0, import_react26.useState)(Date.now());
|
|
1390
|
+
(0, import_react26.useEffect)(() => {
|
|
1393
1391
|
const interval = setInterval(() => setMoment(Date.now()), REFRESH_INTERVAL);
|
|
1394
1392
|
return () => clearInterval(interval);
|
|
1395
1393
|
}, []);
|
|
1396
1394
|
const activeViewers = viewers ? Array.from(viewers.values()).filter(({ lastSeen }) => moment - lastSeen < ACTIVITY_DURATION) : [];
|
|
1397
|
-
return /* @__PURE__ */
|
|
1395
|
+
return /* @__PURE__ */ import_react26.default.createElement(SmallPresence, {
|
|
1398
1396
|
count: activeViewers.length
|
|
1399
1397
|
});
|
|
1400
1398
|
};
|
|
1401
1399
|
var SmallPresence = ({ count }) => {
|
|
1402
1400
|
const { t } = (0, import_react_ui15.useTranslation)(import_chunk_6CNYF6YU.SPACE_PLUGIN);
|
|
1403
|
-
return /* @__PURE__ */
|
|
1401
|
+
return /* @__PURE__ */ import_react26.default.createElement(import_react_ui15.Tooltip.Root, null, /* @__PURE__ */ import_react26.default.createElement(import_react_ui15.Tooltip.Trigger, {
|
|
1404
1402
|
asChild: true
|
|
1405
|
-
}, /* @__PURE__ */
|
|
1403
|
+
}, /* @__PURE__ */ import_react26.default.createElement(import_react_ui_attention.AttentionGlyph, {
|
|
1406
1404
|
presence: count > 1 ? "many" : count === 1 ? "one" : "none",
|
|
1407
1405
|
classNames: "self-center mie-1"
|
|
1408
|
-
})), /* @__PURE__ */
|
|
1406
|
+
})), /* @__PURE__ */ import_react26.default.createElement(import_react_ui15.Tooltip.Portal, null, /* @__PURE__ */ import_react26.default.createElement(import_react_ui15.Tooltip.Content, {
|
|
1409
1407
|
side: "bottom",
|
|
1410
1408
|
classNames: "z-[70]"
|
|
1411
|
-
}, /* @__PURE__ */
|
|
1409
|
+
}, /* @__PURE__ */ import_react26.default.createElement("span", null, t("presence label", {
|
|
1412
1410
|
count
|
|
1413
|
-
})), /* @__PURE__ */
|
|
1411
|
+
})), /* @__PURE__ */ import_react26.default.createElement(import_react_ui15.Tooltip.Arrow, null))));
|
|
1414
1412
|
};
|
|
1415
1413
|
var SpaceSettings = ({ settings }) => {
|
|
1416
1414
|
const { t } = (0, import_react_ui16.useTranslation)(import_chunk_6CNYF6YU.SPACE_PLUGIN);
|
|
1417
1415
|
const dispatch = (0, import_app_framework9.useIntentDispatcher)();
|
|
1418
|
-
|
|
1419
|
-
return /* @__PURE__ */ import_react24.default.createElement(import_react24.default.Fragment, null, /* @__PURE__ */ import_react24.default.createElement(import_plugin_settings.SettingsValue, {
|
|
1416
|
+
return /* @__PURE__ */ import_react27.default.createElement(import_react27.default.Fragment, null, /* @__PURE__ */ import_react27.default.createElement(import_plugin_settings.SettingsValue, {
|
|
1420
1417
|
label: t("show hidden spaces label")
|
|
1421
|
-
}, /* @__PURE__ */
|
|
1418
|
+
}, /* @__PURE__ */ import_react27.default.createElement(import_react_ui16.Input.Switch, {
|
|
1422
1419
|
checked: settings.showHidden,
|
|
1423
1420
|
onCheckedChange: (checked) => dispatch({
|
|
1424
1421
|
plugin: import_chunk_6CNYF6YU.SPACE_PLUGIN,
|
|
@@ -1427,285 +1424,7 @@ var SpaceSettings = ({ settings }) => {
|
|
|
1427
1424
|
state: !!checked
|
|
1428
1425
|
}
|
|
1429
1426
|
})
|
|
1430
|
-
}))
|
|
1431
|
-
label: t("default on space create label")
|
|
1432
|
-
}, /* @__PURE__ */ import_react24.default.createElement(import_react_ui16.Select.Root, {
|
|
1433
|
-
value: settings.onSpaceCreate,
|
|
1434
|
-
onValueChange: (value) => {
|
|
1435
|
-
settings.onSpaceCreate = value;
|
|
1436
|
-
}
|
|
1437
|
-
}, /* @__PURE__ */ import_react24.default.createElement(import_react_ui16.Select.TriggerButton, null), /* @__PURE__ */ import_react24.default.createElement(import_react_ui16.Select.Portal, null, /* @__PURE__ */ import_react24.default.createElement(import_react_ui16.Select.Content, null, /* @__PURE__ */ import_react24.default.createElement(import_react_ui16.Select.Viewport, null, plugins.map(({ provides: { space: { onSpaceCreate } } }) => /* @__PURE__ */ import_react24.default.createElement(import_react_ui16.Select.Option, {
|
|
1438
|
-
key: onSpaceCreate.action,
|
|
1439
|
-
value: onSpaceCreate.action
|
|
1440
|
-
}, (0, import_react_ui16.toLocalizedString)(onSpaceCreate.label, t)))))))));
|
|
1441
|
-
};
|
|
1442
|
-
var __dxlog_file3 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/SaveStatus.tsx";
|
|
1443
|
-
var SaveStatus = () => {
|
|
1444
|
-
const { t } = (0, import_react_ui17.useTranslation)(import_chunk_6CNYF6YU.SPACE_PLUGIN);
|
|
1445
|
-
const client = (0, import_react_client5.useClient)();
|
|
1446
|
-
const [state, setState] = (0, import_react25.useState)("saved");
|
|
1447
|
-
(0, import_react25.useEffect)(() => {
|
|
1448
|
-
return createClientSaveTracker(client, (state2) => {
|
|
1449
|
-
setState(state2);
|
|
1450
|
-
});
|
|
1451
|
-
}, []);
|
|
1452
|
-
return /* @__PURE__ */ import_react25.default.createElement(import_plugin_status_bar.StatusBar.Item, {
|
|
1453
|
-
title: state === "saving" ? t("saving label") : t("saved label")
|
|
1454
|
-
}, /* @__PURE__ */ import_react25.default.createElement(import_react_ui17.Icon, {
|
|
1455
|
-
icon: state === "saving" ? "ph--arrows-clockwise--regular" : "ph--check-circle--regular",
|
|
1456
|
-
size: 4
|
|
1457
|
-
}));
|
|
1458
|
-
};
|
|
1459
|
-
var createClientSaveTracker = (client, cb) => {
|
|
1460
|
-
const unsubscribeCallbacks = {};
|
|
1461
|
-
const state = {};
|
|
1462
|
-
const install = (spaces) => {
|
|
1463
|
-
for (const space of spaces) {
|
|
1464
|
-
if (state[space.id]) {
|
|
1465
|
-
continue;
|
|
1466
|
-
}
|
|
1467
|
-
state[space.id] = "saved";
|
|
1468
|
-
unsubscribeCallbacks[space.id] = createSpaceSaveTracker(space, (s) => {
|
|
1469
|
-
state[space.id] = s;
|
|
1470
|
-
cb(Object.values(state).some((s2) => s2 === "saving") ? "saving" : "saved");
|
|
1471
|
-
});
|
|
1472
|
-
}
|
|
1473
|
-
};
|
|
1474
|
-
client.spaces.subscribe((spaces) => {
|
|
1475
|
-
install(spaces);
|
|
1476
|
-
});
|
|
1477
|
-
install(client.spaces.get());
|
|
1478
|
-
return () => {
|
|
1479
|
-
for (const unsubscribe of Object.values(unsubscribeCallbacks)) {
|
|
1480
|
-
unsubscribe();
|
|
1481
|
-
}
|
|
1482
|
-
};
|
|
1483
|
-
};
|
|
1484
|
-
var createSpaceSaveTracker = (space, cb) => {
|
|
1485
|
-
const ctx = new import_context.Context(void 0, {
|
|
1486
|
-
F: __dxlog_file3,
|
|
1487
|
-
L: 64
|
|
1488
|
-
});
|
|
1489
|
-
void space.waitUntilReady().then(() => {
|
|
1490
|
-
if (ctx.disposed) {
|
|
1491
|
-
return;
|
|
1492
|
-
}
|
|
1493
|
-
let hasUnsavedChanges = false;
|
|
1494
|
-
let lastFlushPromise;
|
|
1495
|
-
space.crud.saveStateChanged.on(ctx, ({ unsavedDocuments }) => {
|
|
1496
|
-
hasUnsavedChanges = unsavedDocuments.length > 0;
|
|
1497
|
-
});
|
|
1498
|
-
space.crud.saveStateChanged.debounce(500).on(ctx, () => {
|
|
1499
|
-
if (hasUnsavedChanges) {
|
|
1500
|
-
lastFlushPromise = void 0;
|
|
1501
|
-
cb("saving");
|
|
1502
|
-
} else {
|
|
1503
|
-
const flushPromise = space.crud.flush();
|
|
1504
|
-
lastFlushPromise = flushPromise;
|
|
1505
|
-
void flushPromise.then(() => {
|
|
1506
|
-
if (lastFlushPromise === flushPromise) {
|
|
1507
|
-
cb("saved");
|
|
1508
|
-
}
|
|
1509
|
-
});
|
|
1510
|
-
}
|
|
1511
|
-
});
|
|
1512
|
-
});
|
|
1513
|
-
return () => {
|
|
1514
|
-
void ctx.dispose();
|
|
1515
|
-
};
|
|
1516
|
-
};
|
|
1517
|
-
var __dxlog_file4 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/SyncStatus/types.ts";
|
|
1518
|
-
var createEmptyEdgeSyncState = () => ({
|
|
1519
|
-
missingOnLocal: 0,
|
|
1520
|
-
missingOnRemote: 0,
|
|
1521
|
-
localDocumentCount: 0,
|
|
1522
|
-
remoteDocumentCount: 0,
|
|
1523
|
-
differentDocuments: 0
|
|
1524
|
-
});
|
|
1525
|
-
var getSyncSummary = (syncMap) => {
|
|
1526
|
-
return Object.entries(syncMap).reduce((summary, [_spaceId, peerState]) => {
|
|
1527
|
-
summary.missingOnLocal += peerState.missingOnLocal;
|
|
1528
|
-
summary.missingOnRemote += peerState.missingOnRemote;
|
|
1529
|
-
summary.localDocumentCount += peerState.localDocumentCount;
|
|
1530
|
-
summary.remoteDocumentCount += peerState.remoteDocumentCount;
|
|
1531
|
-
summary.differentDocuments += peerState.differentDocuments;
|
|
1532
|
-
return summary;
|
|
1533
|
-
}, createEmptyEdgeSyncState());
|
|
1534
|
-
};
|
|
1535
|
-
var isEdgePeerId = (peerId, spaceId) => peerId.startsWith(`${import_protocols.EdgeService.AUTOMERGE_REPLICATOR}:${spaceId}`);
|
|
1536
|
-
var useSyncState = () => {
|
|
1537
|
-
const client = (0, import_react_client6.useClient)();
|
|
1538
|
-
const [spaceState, setSpaceState] = (0, import_react27.useState)({});
|
|
1539
|
-
(0, import_react27.useEffect)(() => {
|
|
1540
|
-
const ctx = new import_context2.Context(void 0, {
|
|
1541
|
-
F: __dxlog_file4,
|
|
1542
|
-
L: 48
|
|
1543
|
-
});
|
|
1544
|
-
const createSubscriptions = (spaces) => {
|
|
1545
|
-
for (const space of spaces) {
|
|
1546
|
-
if (spaceState[space.id]) {
|
|
1547
|
-
continue;
|
|
1548
|
-
}
|
|
1549
|
-
ctx.onDispose(space.crud.subscribeToSyncState(ctx, ({ peers = [] }) => {
|
|
1550
|
-
const syncState = peers.find((state) => isEdgePeerId(state.peerId, space.id));
|
|
1551
|
-
if (syncState) {
|
|
1552
|
-
setSpaceState((spaceState2) => ({
|
|
1553
|
-
...spaceState2,
|
|
1554
|
-
[space.id]: syncState
|
|
1555
|
-
}));
|
|
1556
|
-
}
|
|
1557
|
-
}));
|
|
1558
|
-
}
|
|
1559
|
-
};
|
|
1560
|
-
createSubscriptions(client.spaces.get());
|
|
1561
|
-
client.spaces.subscribe((spaces) => {
|
|
1562
|
-
createSubscriptions(spaces);
|
|
1563
|
-
});
|
|
1564
|
-
return () => {
|
|
1565
|
-
void ctx.dispose();
|
|
1566
|
-
};
|
|
1567
|
-
}, [
|
|
1568
|
-
client
|
|
1569
|
-
]);
|
|
1570
|
-
return spaceState;
|
|
1571
|
-
};
|
|
1572
|
-
var SYNC_STALLED_TIMEOUT = 5e3;
|
|
1573
|
-
var styles = {
|
|
1574
|
-
barBg: "bg-neutral-50 dark:bg-green-900 text-black",
|
|
1575
|
-
barFg: "bg-neutral-100 bg-green-500",
|
|
1576
|
-
barHover: "dark:hover:bg-green-500"
|
|
1577
|
-
};
|
|
1578
|
-
var SyncStatus = () => {
|
|
1579
|
-
const state = useSyncState();
|
|
1580
|
-
return /* @__PURE__ */ import_react26.default.createElement(SyncStatusIndicator, {
|
|
1581
|
-
state
|
|
1582
|
-
});
|
|
1583
|
-
};
|
|
1584
|
-
var SyncStatusIndicator = ({ state }) => {
|
|
1585
|
-
const summary = getSyncSummary(state);
|
|
1586
|
-
const offline = false;
|
|
1587
|
-
const needsToUpload = summary.differentDocuments > 0 || summary.missingOnRemote > 0;
|
|
1588
|
-
const needsToDownload = summary.differentDocuments > 0 || summary.missingOnLocal > 0;
|
|
1589
|
-
const [classNames, setClassNames] = (0, import_react26.useState)();
|
|
1590
|
-
(0, import_react26.useEffect)(() => {
|
|
1591
|
-
setClassNames(void 0);
|
|
1592
|
-
if (!needsToUpload && !needsToDownload) {
|
|
1593
|
-
return;
|
|
1594
|
-
}
|
|
1595
|
-
const t = setTimeout(() => {
|
|
1596
|
-
setClassNames("text-orange-500");
|
|
1597
|
-
}, SYNC_STALLED_TIMEOUT);
|
|
1598
|
-
return () => clearTimeout(t);
|
|
1599
|
-
}, [
|
|
1600
|
-
needsToUpload,
|
|
1601
|
-
needsToDownload
|
|
1602
|
-
]);
|
|
1603
|
-
return /* @__PURE__ */ import_react26.default.createElement(import_plugin_status_bar2.StatusBar.Item, null, /* @__PURE__ */ import_react26.default.createElement(import_react_ui18.Popover.Root, null, /* @__PURE__ */ import_react26.default.createElement(import_react_ui18.Popover.Trigger, null, /* @__PURE__ */ import_react26.default.createElement(import_react_ui18.Icon, {
|
|
1604
|
-
icon: offline ? "ph--cloud-x--regular" : needsToUpload ? "ph--cloud-arrow-up--regular" : needsToDownload ? "ph--cloud-arrow-down--regular" : "ph--cloud-check--regular",
|
|
1605
|
-
size: 4,
|
|
1606
|
-
classNames
|
|
1607
|
-
})), /* @__PURE__ */ import_react26.default.createElement(import_react_ui18.Popover.Content, null, /* @__PURE__ */ import_react26.default.createElement(SyncStatusDetail, {
|
|
1608
|
-
state,
|
|
1609
|
-
summary,
|
|
1610
|
-
debug: false
|
|
1611
|
-
}))));
|
|
1612
|
-
};
|
|
1613
|
-
var SyncStatusDetail = ({ classNames, state, summary, debug }) => {
|
|
1614
|
-
const { t } = (0, import_react_ui18.useTranslation)(import_chunk_6CNYF6YU.SPACE_PLUGIN);
|
|
1615
|
-
const entries = Object.entries(state).sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0);
|
|
1616
|
-
return /* @__PURE__ */ import_react26.default.createElement("div", {
|
|
1617
|
-
className: (0, import_react_ui_theme9.mx)("flex flex-col text-xs min-w-[16rem]", classNames)
|
|
1618
|
-
}, /* @__PURE__ */ import_react26.default.createElement("h1", {
|
|
1619
|
-
className: "p-2"
|
|
1620
|
-
}, t("sync status title")), /* @__PURE__ */ import_react26.default.createElement("div", {
|
|
1621
|
-
className: "flex flex-col gap-[2px] my-[2px]"
|
|
1622
|
-
}, entries.map(([spaceId, state2]) => /* @__PURE__ */ import_react26.default.createElement(SpaceRow, {
|
|
1623
|
-
key: spaceId,
|
|
1624
|
-
spaceId,
|
|
1625
|
-
state: state2
|
|
1626
|
-
}))), debug && /* @__PURE__ */ import_react26.default.createElement(import_react_ui_syntax_highlighter.SyntaxHighlighter, {
|
|
1627
|
-
language: "json"
|
|
1628
|
-
}, JSON.stringify(summary, null, 2)));
|
|
1629
|
-
};
|
|
1630
|
-
var useActive = (count) => {
|
|
1631
|
-
const [current, setCurrent] = (0, import_react26.useState)(count);
|
|
1632
|
-
const [active, setActive] = (0, import_react26.useState)(false);
|
|
1633
|
-
(0, import_react26.useEffect)(() => {
|
|
1634
|
-
let t;
|
|
1635
|
-
if (count !== current) {
|
|
1636
|
-
setActive(true);
|
|
1637
|
-
setCurrent(count);
|
|
1638
|
-
t && clearTimeout(t);
|
|
1639
|
-
t = setTimeout(() => {
|
|
1640
|
-
setActive(false);
|
|
1641
|
-
}, SYNC_STALLED_TIMEOUT);
|
|
1642
|
-
}
|
|
1643
|
-
return () => {
|
|
1644
|
-
setActive(false);
|
|
1645
|
-
clearTimeout(t);
|
|
1646
|
-
};
|
|
1647
|
-
}, [
|
|
1648
|
-
count,
|
|
1649
|
-
current
|
|
1650
|
-
]);
|
|
1651
|
-
return active;
|
|
1652
|
-
};
|
|
1653
|
-
var SpaceRow = ({ spaceId, state: { localDocumentCount, remoteDocumentCount, missingOnLocal, missingOnRemote } }) => {
|
|
1654
|
-
const downActive = useActive(localDocumentCount);
|
|
1655
|
-
const upActive = useActive(remoteDocumentCount);
|
|
1656
|
-
return /* @__PURE__ */ import_react26.default.createElement("div", {
|
|
1657
|
-
className: (0, import_react_ui_theme9.mx)("flex items-center mx-[2px] gap-[2px] cursor-pointer", styles.barHover),
|
|
1658
|
-
title: spaceId,
|
|
1659
|
-
onClick: () => {
|
|
1660
|
-
void navigator.clipboard.writeText(spaceId);
|
|
1661
|
-
}
|
|
1662
|
-
}, /* @__PURE__ */ import_react26.default.createElement(import_react_ui18.Icon, {
|
|
1663
|
-
icon: "ph--arrow-fat-line-left--regular",
|
|
1664
|
-
size: 3,
|
|
1665
|
-
classNames: (0, import_react_ui_theme9.mx)(downActive && "animate-[pulse_1s_infinite]")
|
|
1666
|
-
}), /* @__PURE__ */ import_react26.default.createElement(Candle, {
|
|
1667
|
-
up: {
|
|
1668
|
-
count: remoteDocumentCount,
|
|
1669
|
-
total: remoteDocumentCount + missingOnRemote
|
|
1670
|
-
},
|
|
1671
|
-
down: {
|
|
1672
|
-
count: localDocumentCount,
|
|
1673
|
-
total: localDocumentCount + missingOnLocal
|
|
1674
|
-
},
|
|
1675
|
-
title: spaceId
|
|
1676
|
-
}), /* @__PURE__ */ import_react26.default.createElement(import_react_ui18.Icon, {
|
|
1677
|
-
icon: "ph--arrow-fat-line-right--regular",
|
|
1678
|
-
size: 3,
|
|
1679
|
-
classNames: (0, import_react_ui_theme9.mx)(upActive && "animate-[pulse_1s_step-start_infinite]")
|
|
1680
|
-
}));
|
|
1681
|
-
};
|
|
1682
|
-
var Candle = ({ classNames, up, down }) => {
|
|
1683
|
-
return /* @__PURE__ */ import_react26.default.createElement("div", {
|
|
1684
|
-
className: (0, import_react_ui_theme9.mx)("grid grid-cols-[1fr_2rem_1fr] w-full h-3", classNames)
|
|
1685
|
-
}, /* @__PURE__ */ import_react26.default.createElement(Bar, {
|
|
1686
|
-
classNames: "justify-end",
|
|
1687
|
-
...up
|
|
1688
|
-
}), /* @__PURE__ */ import_react26.default.createElement("div", {
|
|
1689
|
-
className: "relative"
|
|
1690
|
-
}, /* @__PURE__ */ import_react26.default.createElement("div", {
|
|
1691
|
-
className: (0, import_react_ui_theme9.mx)("absolute inset-0 flex items-center justify-center text-xs", styles.barBg)
|
|
1692
|
-
}, up.total)), /* @__PURE__ */ import_react26.default.createElement(Bar, down));
|
|
1693
|
-
};
|
|
1694
|
-
var Bar = ({ classNames, count, total }) => {
|
|
1695
|
-
let p = count / total * 100;
|
|
1696
|
-
if (count < total) {
|
|
1697
|
-
p = Math.min(p, 95);
|
|
1698
|
-
}
|
|
1699
|
-
return /* @__PURE__ */ import_react26.default.createElement("div", {
|
|
1700
|
-
className: (0, import_react_ui_theme9.mx)("relative flex w-full", styles.barBg, classNames)
|
|
1701
|
-
}, /* @__PURE__ */ import_react26.default.createElement("div", {
|
|
1702
|
-
className: (0, import_react_ui_theme9.mx)("shrink-0", styles.barFg),
|
|
1703
|
-
style: {
|
|
1704
|
-
width: `${p}%`
|
|
1705
|
-
}
|
|
1706
|
-
}), count !== total && /* @__PURE__ */ import_react26.default.createElement("div", {
|
|
1707
|
-
className: "absolute top-0 bottom-0 flex items-center mx-0.5 text-black text-xs"
|
|
1708
|
-
}, count));
|
|
1427
|
+
})));
|
|
1709
1428
|
};
|
|
1710
1429
|
var translations_default = [
|
|
1711
1430
|
{
|
|
@@ -1785,23 +1504,19 @@ var translations_default = [
|
|
|
1785
1504
|
"space limit close label": "Close",
|
|
1786
1505
|
"remove deleted objects label": "Cleanup",
|
|
1787
1506
|
"remove deleted objects alt": "Permanently remove deleted objects to free up space.",
|
|
1788
|
-
"copy link label": "Copy link"
|
|
1789
|
-
"default on space create label": "On space create",
|
|
1790
|
-
"sync status title": "Sync status"
|
|
1507
|
+
"copy link label": "Copy link"
|
|
1791
1508
|
}
|
|
1792
1509
|
}
|
|
1793
1510
|
}
|
|
1794
1511
|
];
|
|
1795
|
-
var
|
|
1512
|
+
var __dxlog_file3 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/SpacePlugin.tsx";
|
|
1796
1513
|
var ACTIVE_NODE_BROADCAST_INTERVAL = 3e4;
|
|
1797
1514
|
var OBJECT_ID_LENGTH = 60;
|
|
1798
1515
|
var SPACE_MAX_OBJECTS = 500;
|
|
1799
1516
|
var DIRECTORY_TYPE = "text/directory";
|
|
1800
1517
|
var parseSpacePlugin = (plugin) => Array.isArray(plugin?.provides.space?.enabled) ? plugin : void 0;
|
|
1801
1518
|
var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
1802
|
-
const settings = new import_local_storage.LocalStorageStore(import_chunk_6CNYF6YU.SPACE_PLUGIN
|
|
1803
|
-
onSpaceCreate: "dxos.org/plugin/markdown/action/create"
|
|
1804
|
-
});
|
|
1519
|
+
const settings = new import_local_storage.LocalStorageStore(import_chunk_6CNYF6YU.SPACE_PLUGIN);
|
|
1805
1520
|
const state = new import_local_storage.LocalStorageStore(import_chunk_6CNYF6YU.SPACE_PLUGIN, {
|
|
1806
1521
|
awaiting: void 0,
|
|
1807
1522
|
spaceNames: {},
|
|
@@ -1881,8 +1596,8 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
1881
1596
|
import_log.log.warn("Failed to broadcast active node for presence.", {
|
|
1882
1597
|
err: err.message
|
|
1883
1598
|
}, {
|
|
1884
|
-
F:
|
|
1885
|
-
L:
|
|
1599
|
+
F: __dxlog_file3,
|
|
1600
|
+
L: 222,
|
|
1886
1601
|
S: void 0,
|
|
1887
1602
|
C: (f, a) => f(...a)
|
|
1888
1603
|
});
|
|
@@ -1953,7 +1668,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
1953
1668
|
const dispatch = intentPlugin.provides.intent.dispatch;
|
|
1954
1669
|
const handleFirstRun = async () => {
|
|
1955
1670
|
const defaultSpace = client.spaces.default;
|
|
1956
|
-
defaultSpace.properties[
|
|
1671
|
+
defaultSpace.properties[import_chunk_CVZPI2P3.CollectionType.typename] = (0, import_echo.create)(import_chunk_CVZPI2P3.CollectionType, {
|
|
1957
1672
|
objects: [],
|
|
1958
1673
|
views: {}
|
|
1959
1674
|
});
|
|
@@ -1989,21 +1704,22 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
1989
1704
|
settings: settings.values,
|
|
1990
1705
|
translations: [
|
|
1991
1706
|
...translations_default,
|
|
1992
|
-
|
|
1707
|
+
import_react3.osTranslations
|
|
1993
1708
|
],
|
|
1994
|
-
root: () => state.values.awaiting ? /* @__PURE__ */
|
|
1709
|
+
root: () => state.values.awaiting ? /* @__PURE__ */ import_react2.default.createElement(AwaitingObject, {
|
|
1995
1710
|
id: state.values.awaiting
|
|
1996
1711
|
}) : null,
|
|
1997
1712
|
metadata: {
|
|
1998
1713
|
records: {
|
|
1999
|
-
[
|
|
1714
|
+
[import_chunk_CVZPI2P3.CollectionType.typename]: {
|
|
2000
1715
|
placeholder: [
|
|
2001
1716
|
"unnamed collection label",
|
|
2002
1717
|
{
|
|
2003
1718
|
ns: import_chunk_6CNYF6YU.SPACE_PLUGIN
|
|
2004
1719
|
}
|
|
2005
1720
|
],
|
|
2006
|
-
icon:
|
|
1721
|
+
icon: (props) => /* @__PURE__ */ import_react2.default.createElement(import_react.CardsThree, props),
|
|
1722
|
+
iconSymbol: "ph--cards-three--regular",
|
|
2007
1723
|
// TODO(wittjosiah): Move out of metadata.
|
|
2008
1724
|
loadReferences: (collection) => (0, import_echo.loadObjectReferences)(collection, (collection2) => [
|
|
2009
1725
|
...collection2.objects,
|
|
@@ -2014,7 +1730,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2014
1730
|
},
|
|
2015
1731
|
echo: {
|
|
2016
1732
|
schema: [
|
|
2017
|
-
|
|
1733
|
+
import_chunk_CVZPI2P3.CollectionType
|
|
2018
1734
|
]
|
|
2019
1735
|
},
|
|
2020
1736
|
surface: {
|
|
@@ -2023,33 +1739,33 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2023
1739
|
switch (role) {
|
|
2024
1740
|
case "article":
|
|
2025
1741
|
case "main":
|
|
2026
|
-
return (0, import_echo.isSpace)(primary) && primary.state.get() === import_echo.SpaceState.SPACE_READY ? /* @__PURE__ */
|
|
1742
|
+
return (0, import_echo.isSpace)(primary) && primary.state.get() === import_echo.SpaceState.SPACE_READY ? /* @__PURE__ */ import_react2.default.createElement(import_app_framework.Surface, {
|
|
2027
1743
|
data: {
|
|
2028
|
-
active: primary.properties[
|
|
1744
|
+
active: primary.properties[import_chunk_CVZPI2P3.CollectionType.typename]
|
|
2029
1745
|
},
|
|
2030
1746
|
role,
|
|
2031
1747
|
...rest
|
|
2032
|
-
}) : primary instanceof
|
|
2033
|
-
node: /* @__PURE__ */
|
|
1748
|
+
}) : primary instanceof import_chunk_CVZPI2P3.CollectionType ? {
|
|
1749
|
+
node: /* @__PURE__ */ import_react2.default.createElement(CollectionMain, {
|
|
2034
1750
|
collection: primary
|
|
2035
1751
|
}),
|
|
2036
1752
|
disposition: "fallback"
|
|
2037
|
-
} : typeof primary === "string" && primary.length === OBJECT_ID_LENGTH ? /* @__PURE__ */
|
|
1753
|
+
} : typeof primary === "string" && primary.length === OBJECT_ID_LENGTH ? /* @__PURE__ */ import_react2.default.createElement(MissingObject, {
|
|
2038
1754
|
id: primary
|
|
2039
1755
|
}) : null;
|
|
2040
1756
|
// TODO(burdon): Add role name syntax to minimal plugin docs.
|
|
2041
1757
|
case "tree--empty":
|
|
2042
1758
|
switch (true) {
|
|
2043
1759
|
case data.plugin === import_chunk_6CNYF6YU.SPACE_PLUGIN:
|
|
2044
|
-
return /* @__PURE__ */
|
|
1760
|
+
return /* @__PURE__ */ import_react2.default.createElement(EmptyTree, null);
|
|
2045
1761
|
case ((0, import_plugin_graph.isGraphNode)(data.activeNode) && (0, import_echo.isSpace)(data.activeNode.data)):
|
|
2046
|
-
return /* @__PURE__ */
|
|
1762
|
+
return /* @__PURE__ */ import_react2.default.createElement(EmptySpace, null);
|
|
2047
1763
|
default:
|
|
2048
1764
|
return null;
|
|
2049
1765
|
}
|
|
2050
1766
|
case "dialog":
|
|
2051
1767
|
if (data.component === "dxos.org/plugin/space/InvitationManagerDialog") {
|
|
2052
|
-
return /* @__PURE__ */
|
|
1768
|
+
return /* @__PURE__ */ import_react2.default.createElement(import_react_ui.Dialog.Content, null, /* @__PURE__ */ import_react2.default.createElement(import_react3.ClipboardProvider, null, /* @__PURE__ */ import_react2.default.createElement(import_react3.InvitationManager, {
|
|
2053
1769
|
active: true,
|
|
2054
1770
|
...data.subject
|
|
2055
1771
|
})));
|
|
@@ -2058,20 +1774,20 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2058
1774
|
}
|
|
2059
1775
|
case "popover":
|
|
2060
1776
|
if (data.component === "dxos.org/plugin/space/RenameSpacePopover" && (0, import_echo.isSpace)(data.subject)) {
|
|
2061
|
-
return /* @__PURE__ */
|
|
1777
|
+
return /* @__PURE__ */ import_react2.default.createElement(PopoverRenameSpace, {
|
|
2062
1778
|
space: data.subject
|
|
2063
1779
|
});
|
|
2064
1780
|
}
|
|
2065
1781
|
if (data.component === "dxos.org/plugin/space/RenameObjectPopover" && (0, import_echo_schema.isReactiveObject)(data.subject)) {
|
|
2066
|
-
return /* @__PURE__ */
|
|
1782
|
+
return /* @__PURE__ */ import_react2.default.createElement(PopoverRenameObject, {
|
|
2067
1783
|
object: data.subject
|
|
2068
1784
|
});
|
|
2069
1785
|
}
|
|
2070
1786
|
return null;
|
|
2071
1787
|
case "presence--glyph": {
|
|
2072
|
-
return (0, import_echo_schema.isReactiveObject)(data.object) ? /* @__PURE__ */
|
|
1788
|
+
return (0, import_echo_schema.isReactiveObject)(data.object) ? /* @__PURE__ */ import_react2.default.createElement(SmallPresenceLive, {
|
|
2073
1789
|
viewers: state.values.viewersByObject[(0, import_echo.fullyQualifiedId)(data.object)]
|
|
2074
|
-
}) : /* @__PURE__ */
|
|
1790
|
+
}) : /* @__PURE__ */ import_react2.default.createElement(SmallPresence, {
|
|
2075
1791
|
count: 0
|
|
2076
1792
|
});
|
|
2077
1793
|
}
|
|
@@ -2083,35 +1799,32 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2083
1799
|
return null;
|
|
2084
1800
|
}
|
|
2085
1801
|
const space = (0, import_echo.isSpace)(data.object) ? data.object : (0, import_echo.getSpace)(data.object);
|
|
2086
|
-
const object = (0, import_echo.isSpace)(data.object) ? data.object.state.get() === import_echo.SpaceState.SPACE_READY ? space?.properties[
|
|
1802
|
+
const object = (0, import_echo.isSpace)(data.object) ? data.object.state.get() === import_echo.SpaceState.SPACE_READY ? space?.properties[import_chunk_CVZPI2P3.CollectionType.typename] : void 0 : data.object;
|
|
2087
1803
|
return space && object ? {
|
|
2088
|
-
node: /* @__PURE__ */
|
|
1804
|
+
node: /* @__PURE__ */ import_react2.default.createElement(import_react2.default.Fragment, null, /* @__PURE__ */ import_react2.default.createElement(SpacePresence, {
|
|
2089
1805
|
object
|
|
2090
|
-
}), space.properties[COMPOSER_SPACE_LOCK] ? null : /* @__PURE__ */
|
|
1806
|
+
}), space.properties[COMPOSER_SPACE_LOCK] ? null : /* @__PURE__ */ import_react2.default.createElement(ShareSpaceButton, {
|
|
2091
1807
|
spaceId: space.id
|
|
2092
1808
|
})),
|
|
2093
1809
|
disposition: "hoist"
|
|
2094
1810
|
} : null;
|
|
2095
1811
|
}
|
|
2096
1812
|
case "section":
|
|
2097
|
-
return data.object instanceof
|
|
1813
|
+
return data.object instanceof import_chunk_CVZPI2P3.CollectionType ? /* @__PURE__ */ import_react2.default.createElement(CollectionSection, {
|
|
2098
1814
|
collection: data.object
|
|
2099
1815
|
}) : null;
|
|
2100
1816
|
case "settings":
|
|
2101
|
-
return data.plugin === import_chunk_6CNYF6YU.meta_default.id ? /* @__PURE__ */
|
|
1817
|
+
return data.plugin === import_chunk_6CNYF6YU.meta_default.id ? /* @__PURE__ */ import_react2.default.createElement(SpaceSettings, {
|
|
2102
1818
|
settings: settings.values
|
|
2103
1819
|
}) : null;
|
|
2104
1820
|
case "menu-footer":
|
|
2105
1821
|
if (!(0, import_echo.isEchoObject)(data.object)) {
|
|
2106
1822
|
return null;
|
|
2107
1823
|
} else {
|
|
2108
|
-
return /* @__PURE__ */
|
|
1824
|
+
return /* @__PURE__ */ import_react2.default.createElement(MenuFooter, {
|
|
2109
1825
|
object: data.object
|
|
2110
1826
|
});
|
|
2111
1827
|
}
|
|
2112
|
-
case "status": {
|
|
2113
|
-
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(SyncStatus, null), /* @__PURE__ */ import_react.default.createElement(SaveStatus, null));
|
|
2114
|
-
}
|
|
2115
1828
|
default:
|
|
2116
1829
|
return null;
|
|
2117
1830
|
}
|
|
@@ -2171,8 +1884,8 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2171
1884
|
spacesOrder.order = nextOrder.map(({ id }) => id);
|
|
2172
1885
|
} else {
|
|
2173
1886
|
import_log.log.warn("spaces order object not found", void 0, {
|
|
2174
|
-
F:
|
|
2175
|
-
L:
|
|
1887
|
+
F: __dxlog_file3,
|
|
1888
|
+
L: 514,
|
|
2176
1889
|
S: void 0,
|
|
2177
1890
|
C: (f, a) => f(...a)
|
|
2178
1891
|
});
|
|
@@ -2208,7 +1921,8 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2208
1921
|
ns: import_chunk_6CNYF6YU.SPACE_PLUGIN
|
|
2209
1922
|
}
|
|
2210
1923
|
],
|
|
2211
|
-
icon:
|
|
1924
|
+
icon: (props) => /* @__PURE__ */ import_react2.default.createElement(import_react.Plus, props),
|
|
1925
|
+
iconSymbol: "ph--plus--regular",
|
|
2212
1926
|
disposition: "toolbar",
|
|
2213
1927
|
testId: "spacePlugin.createSpace"
|
|
2214
1928
|
}
|
|
@@ -2233,7 +1947,8 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2233
1947
|
ns: import_chunk_6CNYF6YU.SPACE_PLUGIN
|
|
2234
1948
|
}
|
|
2235
1949
|
],
|
|
2236
|
-
icon:
|
|
1950
|
+
icon: (props) => /* @__PURE__ */ import_react2.default.createElement(import_react.SignIn, props),
|
|
1951
|
+
iconSymbol: "ph--sign-in--regular",
|
|
2237
1952
|
testId: "spacePlugin.joinSpace"
|
|
2238
1953
|
}
|
|
2239
1954
|
}
|
|
@@ -2321,7 +2036,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2321
2036
|
if (state2 !== import_echo.SpaceState.SPACE_READY) {
|
|
2322
2037
|
return;
|
|
2323
2038
|
}
|
|
2324
|
-
const collection = space.properties[
|
|
2039
|
+
const collection = space.properties[import_chunk_CVZPI2P3.CollectionType.typename];
|
|
2325
2040
|
if (!collection) {
|
|
2326
2041
|
return;
|
|
2327
2042
|
}
|
|
@@ -2348,7 +2063,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2348
2063
|
// Create nodes for objects in collections.
|
|
2349
2064
|
(0, import_plugin_graph.createExtension)({
|
|
2350
2065
|
id: `${import_chunk_6CNYF6YU.SPACE_PLUGIN}/collection-objects`,
|
|
2351
|
-
filter: (node) => node.data instanceof
|
|
2066
|
+
filter: (node) => node.data instanceof import_chunk_CVZPI2P3.CollectionType,
|
|
2352
2067
|
connector: ({ node }) => {
|
|
2353
2068
|
const collection = node.data;
|
|
2354
2069
|
const space = (0, import_echo.getSpace)(collection);
|
|
@@ -2401,7 +2116,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2401
2116
|
}
|
|
2402
2117
|
},
|
|
2403
2118
|
{
|
|
2404
|
-
inputType:
|
|
2119
|
+
inputType: import_chunk_CVZPI2P3.CollectionType.typename,
|
|
2405
2120
|
outputType: DIRECTORY_TYPE,
|
|
2406
2121
|
serialize: (node) => ({
|
|
2407
2122
|
name: node.data.name ?? translations_default[0]["en-US"][import_chunk_6CNYF6YU.SPACE_PLUGIN]["unnamed collection label"],
|
|
@@ -2410,7 +2125,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2410
2125
|
}),
|
|
2411
2126
|
deserialize: async (data, ancestors) => {
|
|
2412
2127
|
const space = ancestors.find(import_echo.isSpace);
|
|
2413
|
-
const collection = ancestors.findLast((ancestor) => ancestor instanceof
|
|
2128
|
+
const collection = ancestors.findLast((ancestor) => ancestor instanceof import_chunk_CVZPI2P3.CollectionType) ?? space?.properties[import_chunk_CVZPI2P3.CollectionType.typename];
|
|
2414
2129
|
if (!space || !collection) {
|
|
2415
2130
|
return;
|
|
2416
2131
|
}
|
|
@@ -2419,7 +2134,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2419
2134
|
action: import_chunk_6CNYF6YU.SpaceAction.ADD_OBJECT,
|
|
2420
2135
|
data: {
|
|
2421
2136
|
target: collection,
|
|
2422
|
-
object: (0, import_echo.create)(
|
|
2137
|
+
object: (0, import_echo.create)(import_chunk_CVZPI2P3.CollectionType, {
|
|
2423
2138
|
name: data.name,
|
|
2424
2139
|
objects: [],
|
|
2425
2140
|
views: {}
|
|
@@ -2449,11 +2164,11 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2449
2164
|
}
|
|
2450
2165
|
const space = await client.spaces.create(intent.data);
|
|
2451
2166
|
await space.waitUntilReady();
|
|
2452
|
-
const collection = (0, import_echo.create)(
|
|
2167
|
+
const collection = (0, import_echo.create)(import_chunk_CVZPI2P3.CollectionType, {
|
|
2453
2168
|
objects: [],
|
|
2454
2169
|
views: {}
|
|
2455
2170
|
});
|
|
2456
|
-
space.properties[
|
|
2171
|
+
space.properties[import_chunk_CVZPI2P3.CollectionType.typename] = collection;
|
|
2457
2172
|
if (import_migrations.Migrations.versionProperty) {
|
|
2458
2173
|
space.properties[import_migrations.Migrations.versionProperty] = import_migrations.Migrations.targetVersion;
|
|
2459
2174
|
}
|
|
@@ -2468,25 +2183,6 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2468
2183
|
}
|
|
2469
2184
|
},
|
|
2470
2185
|
intents: [
|
|
2471
|
-
...settings.values.onSpaceCreate ? [
|
|
2472
|
-
[
|
|
2473
|
-
{
|
|
2474
|
-
action: settings.values.onSpaceCreate,
|
|
2475
|
-
data: {
|
|
2476
|
-
space
|
|
2477
|
-
}
|
|
2478
|
-
},
|
|
2479
|
-
{
|
|
2480
|
-
action: import_chunk_6CNYF6YU.SpaceAction.ADD_OBJECT,
|
|
2481
|
-
data: {
|
|
2482
|
-
target: space
|
|
2483
|
-
}
|
|
2484
|
-
},
|
|
2485
|
-
{
|
|
2486
|
-
action: import_app_framework.NavigationAction.EXPOSE
|
|
2487
|
-
}
|
|
2488
|
-
]
|
|
2489
|
-
] : [],
|
|
2490
2186
|
[
|
|
2491
2187
|
{
|
|
2492
2188
|
action: import_meta.ObservabilityAction.SEND_EVENT,
|
|
@@ -2707,7 +2403,8 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2707
2403
|
title: translations_default[0]["en-US"][import_chunk_6CNYF6YU.SPACE_PLUGIN]["space limit label"],
|
|
2708
2404
|
description: translations_default[0]["en-US"][import_chunk_6CNYF6YU.SPACE_PLUGIN]["space limit description"],
|
|
2709
2405
|
duration: 5e3,
|
|
2710
|
-
icon:
|
|
2406
|
+
icon: (props) => /* @__PURE__ */ import_react2.default.createElement(import_react.Warning, props),
|
|
2407
|
+
iconSymbol: "ph--warning--regular",
|
|
2711
2408
|
actionLabel: translations_default[0]["en-US"][import_chunk_6CNYF6YU.SPACE_PLUGIN]["remove deleted objects label"],
|
|
2712
2409
|
actionAlt: translations_default[0]["en-US"][import_chunk_6CNYF6YU.SPACE_PLUGIN]["remove deleted objects alt"],
|
|
2713
2410
|
// TODO(wittjosiah): Use OS namespace.
|
|
@@ -2731,25 +2428,25 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2731
2428
|
]
|
|
2732
2429
|
};
|
|
2733
2430
|
}
|
|
2734
|
-
if (intent.data?.target instanceof
|
|
2431
|
+
if (intent.data?.target instanceof import_chunk_CVZPI2P3.CollectionType) {
|
|
2735
2432
|
intent.data?.target.objects.push(object);
|
|
2736
2433
|
} else if ((0, import_echo.isSpace)(intent.data?.target)) {
|
|
2737
|
-
const collection = space.properties[
|
|
2738
|
-
if (collection instanceof
|
|
2434
|
+
const collection = space.properties[import_chunk_CVZPI2P3.CollectionType.typename];
|
|
2435
|
+
if (collection instanceof import_chunk_CVZPI2P3.CollectionType) {
|
|
2739
2436
|
collection.objects.push(object);
|
|
2740
2437
|
} else {
|
|
2741
|
-
const collection2 = (0, import_echo.create)(
|
|
2438
|
+
const collection2 = (0, import_echo.create)(import_chunk_CVZPI2P3.CollectionType, {
|
|
2742
2439
|
objects: [
|
|
2743
2440
|
object
|
|
2744
2441
|
],
|
|
2745
2442
|
views: {}
|
|
2746
2443
|
});
|
|
2747
|
-
space.properties[
|
|
2444
|
+
space.properties[import_chunk_CVZPI2P3.CollectionType.typename] = collection2;
|
|
2748
2445
|
}
|
|
2749
2446
|
}
|
|
2750
2447
|
return {
|
|
2751
2448
|
data: {
|
|
2752
|
-
id:
|
|
2449
|
+
id: object.id,
|
|
2753
2450
|
object,
|
|
2754
2451
|
activeParts: {
|
|
2755
2452
|
main: [
|
|
@@ -2784,12 +2481,12 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2784
2481
|
const activeParts = navigationPlugin?.provides.location.active;
|
|
2785
2482
|
const openObjectIds = new Set((0, import_app_framework.openIds)(activeParts ?? {}));
|
|
2786
2483
|
if (!intent.undo && resolve) {
|
|
2787
|
-
const parentCollection = intent.data?.collection ?? space.properties[
|
|
2484
|
+
const parentCollection = intent.data?.collection ?? space.properties[import_chunk_CVZPI2P3.CollectionType.typename];
|
|
2788
2485
|
const nestedObjects = await getNestedObjects(object, resolve);
|
|
2789
2486
|
const deletionData = {
|
|
2790
2487
|
object,
|
|
2791
2488
|
parentCollection,
|
|
2792
|
-
index: parentCollection instanceof
|
|
2489
|
+
index: parentCollection instanceof import_chunk_CVZPI2P3.CollectionType ? parentCollection.objects.indexOf(object) : -1,
|
|
2793
2490
|
nestedObjects,
|
|
2794
2491
|
wasActive: [
|
|
2795
2492
|
object,
|
|
@@ -2802,12 +2499,13 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2802
2499
|
data: {
|
|
2803
2500
|
activeParts: {
|
|
2804
2501
|
main: deletionData.wasActive,
|
|
2805
|
-
sidebar: deletionData.wasActive
|
|
2502
|
+
sidebar: deletionData.wasActive,
|
|
2503
|
+
complementary: deletionData.wasActive
|
|
2806
2504
|
}
|
|
2807
2505
|
}
|
|
2808
2506
|
});
|
|
2809
2507
|
}
|
|
2810
|
-
if (parentCollection instanceof
|
|
2508
|
+
if (parentCollection instanceof import_chunk_CVZPI2P3.CollectionType) {
|
|
2811
2509
|
const index = parentCollection.objects.indexOf(object);
|
|
2812
2510
|
if (index !== -1) {
|
|
2813
2511
|
parentCollection.objects.splice(index, 1);
|
|
@@ -2817,7 +2515,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2817
2515
|
space.db.remove(obj);
|
|
2818
2516
|
});
|
|
2819
2517
|
space.db.remove(object);
|
|
2820
|
-
const undoMessageKey = object instanceof
|
|
2518
|
+
const undoMessageKey = object instanceof import_chunk_CVZPI2P3.CollectionType ? "collection deleted label" : "object deleted label";
|
|
2821
2519
|
return {
|
|
2822
2520
|
data: true,
|
|
2823
2521
|
undoable: {
|
|
@@ -2828,7 +2526,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2828
2526
|
};
|
|
2829
2527
|
} else {
|
|
2830
2528
|
const undoData = intent.data;
|
|
2831
|
-
if (undoData && (0, import_echo.isEchoObject)(undoData.object) && undoData.parentCollection instanceof
|
|
2529
|
+
if (undoData && (0, import_echo.isEchoObject)(undoData.object) && undoData.parentCollection instanceof import_chunk_CVZPI2P3.CollectionType) {
|
|
2832
2530
|
const restoredObject = space.db.add(undoData.object);
|
|
2833
2531
|
undoData.nestedObjects.forEach((obj) => {
|
|
2834
2532
|
space.db.add(obj);
|
|
@@ -2925,7 +2623,6 @@ var src_default = SpacePlugin;
|
|
|
2925
2623
|
EmptyTree,
|
|
2926
2624
|
FullPresence,
|
|
2927
2625
|
MenuFooter,
|
|
2928
|
-
MessageState,
|
|
2929
2626
|
MessageType,
|
|
2930
2627
|
MissingObject,
|
|
2931
2628
|
PersistenceStatus,
|
|
@@ -2937,7 +2634,6 @@ var src_default = SpacePlugin;
|
|
|
2937
2634
|
SPACE_PLUGIN,
|
|
2938
2635
|
SPACE_PLUGIN_SHORT_ID,
|
|
2939
2636
|
SPACE_TYPE,
|
|
2940
|
-
SaveStatus,
|
|
2941
2637
|
ShareSpaceButton,
|
|
2942
2638
|
ShareSpaceButtonImpl,
|
|
2943
2639
|
SmallPresence,
|
|
@@ -2947,9 +2643,6 @@ var src_default = SpacePlugin;
|
|
|
2947
2643
|
SpacePlugin,
|
|
2948
2644
|
SpacePresence,
|
|
2949
2645
|
SpaceSettings,
|
|
2950
|
-
SyncStatus,
|
|
2951
|
-
SyncStatusDetail,
|
|
2952
|
-
SyncStatusIndicator,
|
|
2953
2646
|
ThreadStatus,
|
|
2954
2647
|
ThreadType,
|
|
2955
2648
|
cloneObject,
|
|
@@ -2963,7 +2656,6 @@ var src_default = SpacePlugin;
|
|
|
2963
2656
|
getNestedObjects,
|
|
2964
2657
|
getSpaceDisplayName,
|
|
2965
2658
|
memoizeQuery,
|
|
2966
|
-
parseSpaceInitPlugin,
|
|
2967
2659
|
parseSpacePlugin,
|
|
2968
2660
|
translations
|
|
2969
2661
|
});
|