@dxos/plugin-space 0.6.12-staging.e11e696 → 0.6.13-main.09887cd
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-LZEGRS7H.mjs → chunk-AVLRQF6L.mjs} +1 -1
- package/dist/lib/browser/chunk-AVLRQF6L.mjs.map +7 -0
- package/dist/lib/browser/{chunk-WBMH5WIP.mjs → chunk-QK5I2EPF.mjs} +10 -3
- package/dist/lib/browser/chunk-QK5I2EPF.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +278 -245
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/meta.mjs +1 -1
- package/dist/lib/browser/types/index.mjs +1 -1
- package/dist/lib/node/{chunk-GF3SRAQM.cjs → chunk-HE2GHO6Z.cjs} +13 -6
- package/dist/lib/node/chunk-HE2GHO6Z.cjs.map +7 -0
- package/dist/lib/node/{chunk-6CNYF6YU.cjs → chunk-P4XUXM7Y.cjs} +4 -4
- package/dist/lib/node/chunk-P4XUXM7Y.cjs.map +7 -0
- package/dist/lib/node/index.cjs +467 -433
- package/dist/lib/node/index.cjs.map +4 -4
- package/dist/lib/node/meta.cjs +5 -5
- package/dist/lib/node/meta.cjs.map +1 -1
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/types/index.cjs +11 -11
- package/dist/lib/node/types/index.cjs.map +1 -1
- package/dist/lib/node-esm/{chunk-N5VC55UM.mjs → chunk-2TR4WD6U.mjs} +10 -3
- package/dist/lib/node-esm/chunk-2TR4WD6U.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-GM2YUC77.mjs → chunk-YPQGKWHJ.mjs} +1 -1
- package/dist/lib/node-esm/chunk-YPQGKWHJ.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +278 -245
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/meta.mjs +1 -1
- package/dist/lib/node-esm/types/index.mjs +1 -1
- package/dist/types/src/SpacePlugin.d.ts.map +1 -1
- package/dist/types/src/components/FallbackSettings.d.ts +8 -0
- package/dist/types/src/components/FallbackSettings.d.ts.map +1 -0
- package/dist/types/src/components/ShareSpaceButton.stories.d.ts +2 -0
- package/dist/types/src/components/ShareSpaceButton.stories.d.ts.map +1 -1
- package/dist/types/src/components/SpacePresence.stories.d.ts +2 -0
- package/dist/types/src/components/SpacePresence.stories.d.ts.map +1 -1
- package/dist/types/src/components/SyncStatus/SyncStatus.stories.d.ts +2 -0
- package/dist/types/src/components/SyncStatus/SyncStatus.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +1 -2
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +2 -0
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/thread.d.ts +1 -0
- package/dist/types/src/types/thread.d.ts.map +1 -1
- package/package.json +34 -33
- package/src/SpacePlugin.tsx +103 -60
- package/src/components/FallbackSettings.tsx +35 -0
- package/src/components/index.ts +1 -2
- package/src/meta.ts +3 -1
- package/src/translations.ts +2 -0
- package/src/types/collection.ts +1 -1
- package/src/types/thread.ts +2 -1
- package/dist/lib/browser/chunk-LZEGRS7H.mjs.map +0 -7
- package/dist/lib/browser/chunk-WBMH5WIP.mjs.map +0 -7
- package/dist/lib/node/chunk-6CNYF6YU.cjs.map +0 -7
- package/dist/lib/node/chunk-GF3SRAQM.cjs.map +0 -7
- package/dist/lib/node-esm/chunk-GM2YUC77.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-N5VC55UM.mjs.map +0 -7
- package/dist/types/src/components/EmptySpace.d.ts +0 -3
- package/dist/types/src/components/EmptySpace.d.ts.map +0 -1
- package/dist/types/src/components/EmptyTree.d.ts +0 -3
- package/dist/types/src/components/EmptyTree.d.ts.map +0 -1
- package/src/components/EmptySpace.tsx +0 -25
- package/src/components/EmptyTree.tsx +0 -25
package/dist/lib/node/index.cjs
CHANGED
|
@@ -28,36 +28,35 @@ 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_HE2GHO6Z.ActorSchema,
|
|
32
32
|
AwaitingObject: () => AwaitingObject,
|
|
33
33
|
COMPOSER_SPACE_LOCK: () => COMPOSER_SPACE_LOCK,
|
|
34
|
-
ChannelType: () =>
|
|
34
|
+
ChannelType: () => import_chunk_HE2GHO6Z.ChannelType,
|
|
35
35
|
CollectionMain: () => CollectionMain,
|
|
36
36
|
CollectionSection: () => CollectionSection,
|
|
37
|
-
CollectionType: () =>
|
|
38
|
-
ContactType: () =>
|
|
39
|
-
|
|
40
|
-
EmptyTree: () => EmptyTree,
|
|
37
|
+
CollectionType: () => import_chunk_HE2GHO6Z.CollectionType,
|
|
38
|
+
ContactType: () => import_chunk_HE2GHO6Z.ContactType,
|
|
39
|
+
FallbackSettings: () => FallbackSettings,
|
|
41
40
|
FullPresence: () => FullPresence,
|
|
42
41
|
MenuFooter: () => MenuFooter,
|
|
43
|
-
MessageState: () =>
|
|
44
|
-
MessageType: () =>
|
|
42
|
+
MessageState: () => import_chunk_HE2GHO6Z.MessageState,
|
|
43
|
+
MessageType: () => import_chunk_HE2GHO6Z.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: () =>
|
|
52
|
-
SPACE_PLUGIN: () =>
|
|
53
|
-
SPACE_PLUGIN_SHORT_ID: () =>
|
|
50
|
+
SPACE_DIRECTORY_HANDLE: () => import_chunk_HE2GHO6Z.SPACE_DIRECTORY_HANDLE,
|
|
51
|
+
SPACE_PLUGIN: () => import_chunk_P4XUXM7Y.SPACE_PLUGIN,
|
|
52
|
+
SPACE_PLUGIN_SHORT_ID: () => import_chunk_P4XUXM7Y.SPACE_PLUGIN_SHORT_ID,
|
|
54
53
|
SPACE_TYPE: () => SPACE_TYPE,
|
|
55
54
|
SaveStatus: () => SaveStatus,
|
|
56
55
|
ShareSpaceButton: () => ShareSpaceButton,
|
|
57
56
|
ShareSpaceButtonImpl: () => ShareSpaceButtonImpl,
|
|
58
57
|
SmallPresence: () => SmallPresence,
|
|
59
58
|
SmallPresenceLive: () => SmallPresenceLive,
|
|
60
|
-
SpaceAction: () =>
|
|
59
|
+
SpaceAction: () => import_chunk_P4XUXM7Y.SpaceAction,
|
|
61
60
|
SpaceMain: () => SpaceMain,
|
|
62
61
|
SpacePlugin: () => SpacePlugin,
|
|
63
62
|
SpacePresence: () => SpacePresence,
|
|
@@ -65,8 +64,8 @@ __export(node_exports, {
|
|
|
65
64
|
SyncStatus: () => SyncStatus,
|
|
66
65
|
SyncStatusDetail: () => SyncStatusDetail,
|
|
67
66
|
SyncStatusIndicator: () => SyncStatusIndicator,
|
|
68
|
-
ThreadStatus: () =>
|
|
69
|
-
ThreadType: () =>
|
|
67
|
+
ThreadStatus: () => import_chunk_HE2GHO6Z.ThreadStatus,
|
|
68
|
+
ThreadType: () => import_chunk_HE2GHO6Z.ThreadType,
|
|
70
69
|
cloneObject: () => cloneObject,
|
|
71
70
|
constructObjectActionGroups: () => constructObjectActionGroups,
|
|
72
71
|
constructObjectActions: () => constructObjectActions,
|
|
@@ -79,18 +78,19 @@ __export(node_exports, {
|
|
|
79
78
|
getNestedObjects: () => getNestedObjects,
|
|
80
79
|
getSpaceDisplayName: () => getSpaceDisplayName,
|
|
81
80
|
memoizeQuery: () => memoizeQuery,
|
|
82
|
-
parseSpaceInitPlugin: () =>
|
|
81
|
+
parseSpaceInitPlugin: () => import_chunk_HE2GHO6Z.parseSpaceInitPlugin,
|
|
83
82
|
parseSpacePlugin: () => parseSpacePlugin,
|
|
84
83
|
translations: () => translations_default
|
|
85
84
|
});
|
|
86
85
|
module.exports = __toCommonJS(node_exports);
|
|
87
|
-
var
|
|
88
|
-
var
|
|
86
|
+
var import_chunk_P4XUXM7Y = require("./chunk-P4XUXM7Y.cjs");
|
|
87
|
+
var import_chunk_HE2GHO6Z = require("./chunk-HE2GHO6Z.cjs");
|
|
89
88
|
var import_signals_core = require("@preact/signals-core");
|
|
90
89
|
var import_react = __toESM(require("react"));
|
|
91
90
|
var import_app_framework = require("@dxos/app-framework");
|
|
92
91
|
var import_async = require("@dxos/async");
|
|
93
92
|
var import_echo_schema = require("@dxos/echo-schema");
|
|
93
|
+
var import_core = require("@dxos/echo-signals/core");
|
|
94
94
|
var import_local_storage = require("@dxos/local-storage");
|
|
95
95
|
var import_log = require("@dxos/log");
|
|
96
96
|
var import_migrations = require("@dxos/migrations");
|
|
@@ -117,78 +117,74 @@ var import_react6 = __toESM(require("react"));
|
|
|
117
117
|
var import_react_ui4 = require("@dxos/react-ui");
|
|
118
118
|
var import_react7 = __toESM(require("react"));
|
|
119
119
|
var import_react_ui5 = require("@dxos/react-ui");
|
|
120
|
-
var
|
|
121
|
-
var
|
|
122
|
-
var import_react_ui6 = require("@dxos/react-ui");
|
|
123
|
-
var import_react_ui_theme4 = require("@dxos/react-ui-theme");
|
|
124
|
-
var import_react9 = require("@phosphor-icons/react");
|
|
125
|
-
var import_react10 = __toESM(require("react"));
|
|
120
|
+
var import_react8 = require("@phosphor-icons/react");
|
|
121
|
+
var import_react9 = __toESM(require("react"));
|
|
126
122
|
var import_echo3 = require("@dxos/client/echo");
|
|
127
123
|
var import_react_client3 = require("@dxos/react-client");
|
|
128
|
-
var
|
|
124
|
+
var import_react_ui6 = require("@dxos/react-ui");
|
|
129
125
|
var import_app_framework3 = require("@dxos/app-framework");
|
|
130
126
|
var import_echo_schema2 = require("@dxos/echo-schema");
|
|
131
127
|
var import_invariant = require("@dxos/invariant");
|
|
132
128
|
var import_migrations2 = require("@dxos/migrations");
|
|
133
129
|
var import_plugin_graph2 = require("@dxos/plugin-graph");
|
|
134
130
|
var import_echo4 = require("@dxos/react-client/echo");
|
|
135
|
-
var
|
|
131
|
+
var import_react10 = __toESM(require("react"));
|
|
136
132
|
var import_app_framework4 = require("@dxos/app-framework");
|
|
133
|
+
var import_react_ui7 = require("@dxos/react-ui");
|
|
134
|
+
var import_react_ui_theme3 = require("@dxos/react-ui-theme");
|
|
135
|
+
var import_react11 = require("@phosphor-icons/react");
|
|
136
|
+
var import_react12 = __toESM(require("react"));
|
|
137
|
+
var import_async2 = require("@dxos/async");
|
|
137
138
|
var import_react_ui8 = require("@dxos/react-ui");
|
|
138
|
-
var
|
|
139
|
-
var import_react12 = require("@phosphor-icons/react");
|
|
139
|
+
var import_react_ui_theme4 = require("@dxos/react-ui-theme");
|
|
140
140
|
var import_react13 = __toESM(require("react"));
|
|
141
|
-
var
|
|
141
|
+
var import_log2 = require("@dxos/log");
|
|
142
142
|
var import_react_ui9 = require("@dxos/react-ui");
|
|
143
|
-
var import_react_ui_theme6 = require("@dxos/react-ui-theme");
|
|
144
143
|
var import_react14 = __toESM(require("react"));
|
|
145
|
-
var import_log2 = require("@dxos/log");
|
|
146
144
|
var import_react_ui10 = require("@dxos/react-ui");
|
|
147
145
|
var import_react15 = __toESM(require("react"));
|
|
148
|
-
var import_react_ui11 = require("@dxos/react-ui");
|
|
149
|
-
var import_react16 = __toESM(require("react"));
|
|
150
146
|
var import_app_framework5 = require("@dxos/app-framework");
|
|
151
|
-
var
|
|
152
|
-
var
|
|
153
|
-
var
|
|
147
|
+
var import_react_ui11 = require("@dxos/react-ui");
|
|
148
|
+
var import_react16 = require("@phosphor-icons/react");
|
|
149
|
+
var import_react17 = __toESM(require("react"));
|
|
154
150
|
var import_app_framework6 = require("@dxos/app-framework");
|
|
155
151
|
var import_echo5 = require("@dxos/react-client/echo");
|
|
156
|
-
var
|
|
157
|
-
var
|
|
158
|
-
var
|
|
159
|
-
var
|
|
160
|
-
var
|
|
152
|
+
var import_react_ui12 = require("@dxos/react-ui");
|
|
153
|
+
var import_react_ui_theme5 = require("@dxos/react-ui-theme");
|
|
154
|
+
var import_react18 = require("@dxos/shell/react");
|
|
155
|
+
var import_react19 = require("@phosphor-icons/react");
|
|
156
|
+
var import_react20 = __toESM(require("react"));
|
|
161
157
|
var import_app_framework7 = require("@dxos/app-framework");
|
|
162
158
|
var import_echo6 = require("@dxos/react-client/echo");
|
|
163
159
|
var import_invitations = require("@dxos/react-client/invitations");
|
|
164
160
|
var import_invitations2 = require("@dxos/react-client/invitations");
|
|
165
|
-
var
|
|
166
|
-
var
|
|
167
|
-
var
|
|
168
|
-
var
|
|
161
|
+
var import_react_ui13 = require("@dxos/react-ui");
|
|
162
|
+
var import_react_ui_theme6 = require("@dxos/react-ui-theme");
|
|
163
|
+
var import_react21 = require("@dxos/shell/react");
|
|
164
|
+
var import_react22 = __toESM(require("react"));
|
|
169
165
|
var import_app_framework8 = require("@dxos/app-framework");
|
|
170
166
|
var import_display_name = require("@dxos/display-name");
|
|
171
167
|
var import_react_client4 = require("@dxos/react-client");
|
|
172
168
|
var import_echo7 = require("@dxos/react-client/echo");
|
|
173
169
|
var import_halo = require("@dxos/react-client/halo");
|
|
174
|
-
var
|
|
170
|
+
var import_react_ui14 = require("@dxos/react-ui");
|
|
175
171
|
var import_react_ui_attention = require("@dxos/react-ui-attention");
|
|
176
172
|
var import_util2 = require("@dxos/util");
|
|
177
|
-
var
|
|
173
|
+
var import_react23 = __toESM(require("react"));
|
|
178
174
|
var import_app_framework9 = require("@dxos/app-framework");
|
|
179
175
|
var import_plugin_settings = require("@dxos/plugin-settings");
|
|
180
|
-
var
|
|
181
|
-
var
|
|
176
|
+
var import_react_ui15 = require("@dxos/react-ui");
|
|
177
|
+
var import_react24 = __toESM(require("react"));
|
|
182
178
|
var import_context = require("@dxos/context");
|
|
183
179
|
var import_plugin_status_bar = require("@dxos/plugin-status-bar");
|
|
184
180
|
var import_react_client5 = require("@dxos/react-client");
|
|
185
|
-
var
|
|
186
|
-
var
|
|
181
|
+
var import_react_ui16 = require("@dxos/react-ui");
|
|
182
|
+
var import_react25 = __toESM(require("react"));
|
|
187
183
|
var import_plugin_status_bar2 = require("@dxos/plugin-status-bar");
|
|
188
|
-
var
|
|
184
|
+
var import_react_ui17 = require("@dxos/react-ui");
|
|
189
185
|
var import_react_ui_syntax_highlighter = require("@dxos/react-ui-syntax-highlighter");
|
|
190
|
-
var
|
|
191
|
-
var
|
|
186
|
+
var import_react_ui_theme7 = require("@dxos/react-ui-theme");
|
|
187
|
+
var import_react26 = require("react");
|
|
192
188
|
var import_context2 = require("@dxos/context");
|
|
193
189
|
var import_protocols = require("@dxos/protocols");
|
|
194
190
|
var import_react_client6 = require("@dxos/react-client");
|
|
@@ -198,7 +194,7 @@ var AwaitingObject = ({ id }) => {
|
|
|
198
194
|
const [open, setOpen] = (0, import_react4.useState)(true);
|
|
199
195
|
const [waiting, setWaiting] = (0, import_react4.useState)(true);
|
|
200
196
|
const [found, setFound] = (0, import_react4.useState)(false);
|
|
201
|
-
const { t } = (0, import_react_ui2.useTranslation)(
|
|
197
|
+
const { t } = (0, import_react_ui2.useTranslation)(import_chunk_P4XUXM7Y.SPACE_PLUGIN);
|
|
202
198
|
const intentPlugin = (0, import_app_framework2.useResolvePlugin)(import_app_framework2.parseIntentPlugin);
|
|
203
199
|
const navigationPlugin = (0, import_app_framework2.useResolvePlugin)(import_app_framework2.parseNavigationPlugin);
|
|
204
200
|
const client = (0, import_react_client2.useClient)();
|
|
@@ -227,8 +223,8 @@ var AwaitingObject = ({ id }) => {
|
|
|
227
223
|
intentPlugin
|
|
228
224
|
]);
|
|
229
225
|
const handleClose = async () => intentPlugin?.provides.intent.dispatch({
|
|
230
|
-
plugin:
|
|
231
|
-
action:
|
|
226
|
+
plugin: import_chunk_P4XUXM7Y.SPACE_PLUGIN,
|
|
227
|
+
action: import_chunk_P4XUXM7Y.SpaceAction.WAIT_FOR_OBJECT,
|
|
232
228
|
data: {
|
|
233
229
|
id: void 0
|
|
234
230
|
}
|
|
@@ -279,7 +275,7 @@ var AwaitingObject = ({ id }) => {
|
|
|
279
275
|
})))));
|
|
280
276
|
};
|
|
281
277
|
var CollectionMain = ({ collection }) => {
|
|
282
|
-
const { t } = (0, import_react_ui3.useTranslation)(
|
|
278
|
+
const { t } = (0, import_react_ui3.useTranslation)(import_chunk_P4XUXM7Y.SPACE_PLUGIN);
|
|
283
279
|
return /* @__PURE__ */ import_react5.default.createElement("div", {
|
|
284
280
|
role: "none",
|
|
285
281
|
className: (0, import_react_ui_theme2.mx)(import_react_ui_theme2.baseSurface, "min-bs-screen is-full flex items-center justify-center p-8"),
|
|
@@ -290,29 +286,31 @@ var CollectionMain = ({ collection }) => {
|
|
|
290
286
|
}, collection.name ?? t("unnamed collection label")));
|
|
291
287
|
};
|
|
292
288
|
var CollectionSection = ({ collection }) => {
|
|
293
|
-
const { t } = (0, import_react_ui4.useTranslation)(
|
|
289
|
+
const { t } = (0, import_react_ui4.useTranslation)(import_chunk_P4XUXM7Y.SPACE_PLUGIN);
|
|
294
290
|
return /* @__PURE__ */ import_react6.default.createElement("div", {
|
|
295
291
|
className: "min-bs-[3.5rem] grid grid-rows-subgrid grid-cols-subgrid items-center"
|
|
296
292
|
}, /* @__PURE__ */ import_react6.default.createElement("span", {
|
|
297
293
|
className: "truncate"
|
|
298
294
|
}, collection.name ?? t("unnamed collection label")));
|
|
299
295
|
};
|
|
300
|
-
var
|
|
301
|
-
const { t } = (0, import_react_ui5.useTranslation)(
|
|
296
|
+
var FallbackSettings = ({ object }) => {
|
|
297
|
+
const { t } = (0, import_react_ui5.useTranslation)(import_chunk_P4XUXM7Y.SPACE_PLUGIN);
|
|
302
298
|
return /* @__PURE__ */ import_react7.default.createElement("div", {
|
|
299
|
+
role: "form",
|
|
300
|
+
className: "p-3 flex flex-col gap-2"
|
|
301
|
+
}, /* @__PURE__ */ import_react7.default.createElement("div", {
|
|
303
302
|
role: "none",
|
|
304
|
-
className:
|
|
305
|
-
}, t("
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
}, t("empty tree message"));
|
|
303
|
+
className: "space-b-1"
|
|
304
|
+
}, /* @__PURE__ */ import_react7.default.createElement(import_react_ui5.Input.Root, null, /* @__PURE__ */ import_react7.default.createElement(import_react_ui5.Input.Label, null, t("name label")), /* @__PURE__ */ import_react7.default.createElement(import_react_ui5.Input.TextInput, {
|
|
305
|
+
placeholder: t("name placeholder"),
|
|
306
|
+
value: object.name,
|
|
307
|
+
onChange: (event) => {
|
|
308
|
+
object.name = event.target.value;
|
|
309
|
+
}
|
|
310
|
+
}))));
|
|
313
311
|
};
|
|
314
312
|
var __dxlog_file = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/util.tsx";
|
|
315
|
-
var SPACES = `${
|
|
313
|
+
var SPACES = `${import_chunk_P4XUXM7Y.SPACE_PLUGIN}-spaces`;
|
|
316
314
|
var SPACE_TYPE = "dxos.org/type/Space";
|
|
317
315
|
var COMPOSER_SPACE_LOCK = "dxos.org/plugin/space/lock";
|
|
318
316
|
var SHARED = "shared-spaces";
|
|
@@ -328,12 +326,12 @@ var getSpaceDisplayName = (space, { personal, namesCache = {} } = {}) => {
|
|
|
328
326
|
return space.state.get() === import_echo4.SpaceState.SPACE_READY && (space.properties.name?.length ?? 0) > 0 ? space.properties.name : namesCache[space.id] ? namesCache[space.id] : personal ? [
|
|
329
327
|
"personal space label",
|
|
330
328
|
{
|
|
331
|
-
ns:
|
|
329
|
+
ns: import_chunk_P4XUXM7Y.SPACE_PLUGIN
|
|
332
330
|
}
|
|
333
331
|
] : [
|
|
334
332
|
"unnamed space label",
|
|
335
333
|
{
|
|
336
|
-
ns:
|
|
334
|
+
ns: import_chunk_P4XUXM7Y.SPACE_PLUGIN
|
|
337
335
|
}
|
|
338
336
|
];
|
|
339
337
|
};
|
|
@@ -380,8 +378,8 @@ var checkPendingMigration = (space) => {
|
|
|
380
378
|
};
|
|
381
379
|
var constructSpaceNode = ({ space, personal, namesCache, resolve }) => {
|
|
382
380
|
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
|
|
381
|
+
const collection = space.state.get() === import_echo4.SpaceState.SPACE_READY && space.properties[import_chunk_HE2GHO6Z.CollectionType.typename];
|
|
382
|
+
const partials = space.state.get() === import_echo4.SpaceState.SPACE_READY && collection instanceof import_chunk_HE2GHO6Z.CollectionType ? getCollectionGraphNodePartials({
|
|
385
383
|
collection,
|
|
386
384
|
space,
|
|
387
385
|
resolve
|
|
@@ -410,17 +408,17 @@ var constructSpaceActionGroups = ({ space, dispatch }) => {
|
|
|
410
408
|
if (state !== import_echo4.SpaceState.SPACE_READY || hasPendingMigration) {
|
|
411
409
|
return [];
|
|
412
410
|
}
|
|
413
|
-
const collection = space.properties[
|
|
411
|
+
const collection = space.properties[import_chunk_HE2GHO6Z.CollectionType.typename];
|
|
414
412
|
const actions = [
|
|
415
413
|
{
|
|
416
|
-
id: getId(
|
|
414
|
+
id: getId(import_chunk_P4XUXM7Y.SpaceAction.ADD_OBJECT),
|
|
417
415
|
type: import_plugin_graph2.ACTION_GROUP_TYPE,
|
|
418
416
|
data: import_plugin_graph2.actionGroupSymbol,
|
|
419
417
|
properties: {
|
|
420
418
|
label: [
|
|
421
419
|
"create object in space label",
|
|
422
420
|
{
|
|
423
|
-
ns:
|
|
421
|
+
ns: import_chunk_P4XUXM7Y.SPACE_PLUGIN
|
|
424
422
|
}
|
|
425
423
|
],
|
|
426
424
|
icon: "ph--plus--regular",
|
|
@@ -432,15 +430,15 @@ var constructSpaceActionGroups = ({ space, dispatch }) => {
|
|
|
432
430
|
},
|
|
433
431
|
nodes: [
|
|
434
432
|
{
|
|
435
|
-
id: getId(
|
|
433
|
+
id: getId(import_chunk_P4XUXM7Y.SpaceAction.ADD_OBJECT.replace("object", "collection")),
|
|
436
434
|
type: import_plugin_graph2.ACTION_TYPE,
|
|
437
435
|
data: () => dispatch([
|
|
438
436
|
{
|
|
439
|
-
plugin:
|
|
440
|
-
action:
|
|
437
|
+
plugin: import_chunk_P4XUXM7Y.SPACE_PLUGIN,
|
|
438
|
+
action: import_chunk_P4XUXM7Y.SpaceAction.ADD_OBJECT,
|
|
441
439
|
data: {
|
|
442
440
|
target: collection,
|
|
443
|
-
object: (0, import_echo_schema2.create)(
|
|
441
|
+
object: (0, import_echo_schema2.create)(import_chunk_HE2GHO6Z.CollectionType, {
|
|
444
442
|
objects: [],
|
|
445
443
|
views: {}
|
|
446
444
|
})
|
|
@@ -454,7 +452,7 @@ var constructSpaceActionGroups = ({ space, dispatch }) => {
|
|
|
454
452
|
label: [
|
|
455
453
|
"create collection label",
|
|
456
454
|
{
|
|
457
|
-
ns:
|
|
455
|
+
ns: import_chunk_P4XUXM7Y.SPACE_PLUGIN
|
|
458
456
|
}
|
|
459
457
|
],
|
|
460
458
|
icon: "ph--cards-three--regular",
|
|
@@ -473,12 +471,12 @@ var constructSpaceActions = ({ space, dispatch, personal, migrating }) => {
|
|
|
473
471
|
const actions = [];
|
|
474
472
|
if (hasPendingMigration) {
|
|
475
473
|
actions.push({
|
|
476
|
-
id: getId(
|
|
474
|
+
id: getId(import_chunk_P4XUXM7Y.SpaceAction.MIGRATE),
|
|
477
475
|
type: import_plugin_graph2.ACTION_GROUP_TYPE,
|
|
478
476
|
data: async () => {
|
|
479
477
|
await dispatch({
|
|
480
|
-
plugin:
|
|
481
|
-
action:
|
|
478
|
+
plugin: import_chunk_P4XUXM7Y.SPACE_PLUGIN,
|
|
479
|
+
action: import_chunk_P4XUXM7Y.SpaceAction.MIGRATE,
|
|
482
480
|
data: {
|
|
483
481
|
space
|
|
484
482
|
}
|
|
@@ -488,7 +486,7 @@ var constructSpaceActions = ({ space, dispatch, personal, migrating }) => {
|
|
|
488
486
|
label: [
|
|
489
487
|
"migrate space label",
|
|
490
488
|
{
|
|
491
|
-
ns:
|
|
489
|
+
ns: import_chunk_P4XUXM7Y.SPACE_PLUGIN
|
|
492
490
|
}
|
|
493
491
|
],
|
|
494
492
|
icon: "ph--database--regular",
|
|
@@ -501,15 +499,15 @@ var constructSpaceActions = ({ space, dispatch, personal, migrating }) => {
|
|
|
501
499
|
if (state === import_echo4.SpaceState.SPACE_READY && !hasPendingMigration) {
|
|
502
500
|
const locked = space.properties[COMPOSER_SPACE_LOCK];
|
|
503
501
|
actions.push({
|
|
504
|
-
id: getId(
|
|
502
|
+
id: getId(import_chunk_P4XUXM7Y.SpaceAction.SHARE),
|
|
505
503
|
type: import_plugin_graph2.ACTION_TYPE,
|
|
506
504
|
data: async () => {
|
|
507
505
|
if (locked) {
|
|
508
506
|
return;
|
|
509
507
|
}
|
|
510
508
|
await dispatch({
|
|
511
|
-
plugin:
|
|
512
|
-
action:
|
|
509
|
+
plugin: import_chunk_P4XUXM7Y.SPACE_PLUGIN,
|
|
510
|
+
action: import_chunk_P4XUXM7Y.SpaceAction.SHARE,
|
|
513
511
|
data: {
|
|
514
512
|
spaceId: space.id
|
|
515
513
|
}
|
|
@@ -519,7 +517,7 @@ var constructSpaceActions = ({ space, dispatch, personal, migrating }) => {
|
|
|
519
517
|
label: [
|
|
520
518
|
"share space label",
|
|
521
519
|
{
|
|
522
|
-
ns:
|
|
520
|
+
ns: import_chunk_P4XUXM7Y.SPACE_PLUGIN
|
|
523
521
|
}
|
|
524
522
|
],
|
|
525
523
|
icon: "ph--users--regular",
|
|
@@ -531,12 +529,12 @@ var constructSpaceActions = ({ space, dispatch, personal, migrating }) => {
|
|
|
531
529
|
mainAreaDisposition: "absent"
|
|
532
530
|
}
|
|
533
531
|
}, {
|
|
534
|
-
id: locked ? getId(
|
|
532
|
+
id: locked ? getId(import_chunk_P4XUXM7Y.SpaceAction.UNLOCK) : getId(import_chunk_P4XUXM7Y.SpaceAction.LOCK),
|
|
535
533
|
type: import_plugin_graph2.ACTION_TYPE,
|
|
536
534
|
data: async () => {
|
|
537
535
|
await dispatch({
|
|
538
|
-
plugin:
|
|
539
|
-
action: locked ?
|
|
536
|
+
plugin: import_chunk_P4XUXM7Y.SPACE_PLUGIN,
|
|
537
|
+
action: locked ? import_chunk_P4XUXM7Y.SpaceAction.UNLOCK : import_chunk_P4XUXM7Y.SpaceAction.LOCK,
|
|
540
538
|
data: {
|
|
541
539
|
space
|
|
542
540
|
}
|
|
@@ -546,18 +544,18 @@ var constructSpaceActions = ({ space, dispatch, personal, migrating }) => {
|
|
|
546
544
|
label: [
|
|
547
545
|
locked ? "unlock space label" : "lock space label",
|
|
548
546
|
{
|
|
549
|
-
ns:
|
|
547
|
+
ns: import_chunk_P4XUXM7Y.SPACE_PLUGIN
|
|
550
548
|
}
|
|
551
549
|
],
|
|
552
550
|
icon: locked ? "ph--lock-simple-open--regular" : "ph--lock-simple--regular"
|
|
553
551
|
}
|
|
554
552
|
}, {
|
|
555
|
-
id: getId(
|
|
553
|
+
id: getId(import_chunk_P4XUXM7Y.SpaceAction.RENAME),
|
|
556
554
|
type: import_plugin_graph2.ACTION_TYPE,
|
|
557
555
|
data: async (params) => {
|
|
558
556
|
await dispatch({
|
|
559
|
-
plugin:
|
|
560
|
-
action:
|
|
557
|
+
plugin: import_chunk_P4XUXM7Y.SPACE_PLUGIN,
|
|
558
|
+
action: import_chunk_P4XUXM7Y.SpaceAction.RENAME,
|
|
561
559
|
data: {
|
|
562
560
|
space,
|
|
563
561
|
...params
|
|
@@ -568,7 +566,7 @@ var constructSpaceActions = ({ space, dispatch, personal, migrating }) => {
|
|
|
568
566
|
label: [
|
|
569
567
|
"rename space label",
|
|
570
568
|
{
|
|
571
|
-
ns:
|
|
569
|
+
ns: import_chunk_P4XUXM7Y.SPACE_PLUGIN
|
|
572
570
|
}
|
|
573
571
|
],
|
|
574
572
|
icon: "ph--pencil-simple-line--regular",
|
|
@@ -582,12 +580,12 @@ var constructSpaceActions = ({ space, dispatch, personal, migrating }) => {
|
|
|
582
580
|
}
|
|
583
581
|
if (state !== import_echo4.SpaceState.SPACE_INACTIVE && !hasPendingMigration) {
|
|
584
582
|
actions.push({
|
|
585
|
-
id: getId(
|
|
583
|
+
id: getId(import_chunk_P4XUXM7Y.SpaceAction.CLOSE),
|
|
586
584
|
type: import_plugin_graph2.ACTION_TYPE,
|
|
587
585
|
data: async () => {
|
|
588
586
|
await dispatch({
|
|
589
|
-
plugin:
|
|
590
|
-
action:
|
|
587
|
+
plugin: import_chunk_P4XUXM7Y.SPACE_PLUGIN,
|
|
588
|
+
action: import_chunk_P4XUXM7Y.SpaceAction.CLOSE,
|
|
591
589
|
data: {
|
|
592
590
|
space
|
|
593
591
|
}
|
|
@@ -597,7 +595,7 @@ var constructSpaceActions = ({ space, dispatch, personal, migrating }) => {
|
|
|
597
595
|
label: [
|
|
598
596
|
"close space label",
|
|
599
597
|
{
|
|
600
|
-
ns:
|
|
598
|
+
ns: import_chunk_P4XUXM7Y.SPACE_PLUGIN
|
|
601
599
|
}
|
|
602
600
|
],
|
|
603
601
|
icon: "ph--x--regular",
|
|
@@ -608,12 +606,12 @@ var constructSpaceActions = ({ space, dispatch, personal, migrating }) => {
|
|
|
608
606
|
}
|
|
609
607
|
if (state === import_echo4.SpaceState.SPACE_INACTIVE) {
|
|
610
608
|
actions.push({
|
|
611
|
-
id: getId(
|
|
609
|
+
id: getId(import_chunk_P4XUXM7Y.SpaceAction.OPEN),
|
|
612
610
|
type: import_plugin_graph2.ACTION_TYPE,
|
|
613
611
|
data: async () => {
|
|
614
612
|
await dispatch({
|
|
615
|
-
plugin:
|
|
616
|
-
action:
|
|
613
|
+
plugin: import_chunk_P4XUXM7Y.SPACE_PLUGIN,
|
|
614
|
+
action: import_chunk_P4XUXM7Y.SpaceAction.OPEN,
|
|
617
615
|
data: {
|
|
618
616
|
space
|
|
619
617
|
}
|
|
@@ -623,7 +621,7 @@ var constructSpaceActions = ({ space, dispatch, personal, migrating }) => {
|
|
|
623
621
|
label: [
|
|
624
622
|
"open space label",
|
|
625
623
|
{
|
|
626
|
-
ns:
|
|
624
|
+
ns: import_chunk_P4XUXM7Y.SPACE_PLUGIN
|
|
627
625
|
}
|
|
628
626
|
],
|
|
629
627
|
icon: "ph--clock-counter-clockwise--regular",
|
|
@@ -643,7 +641,7 @@ var createObjectNode = ({ object, space, resolve }) => {
|
|
|
643
641
|
if (Object.keys(metadata).length === 0) {
|
|
644
642
|
return void 0;
|
|
645
643
|
}
|
|
646
|
-
const partials = object instanceof
|
|
644
|
+
const partials = object instanceof import_chunk_HE2GHO6Z.CollectionType ? getCollectionGraphNodePartials({
|
|
647
645
|
collection: object,
|
|
648
646
|
space,
|
|
649
647
|
resolve
|
|
@@ -657,7 +655,7 @@ var createObjectNode = ({ object, space, resolve }) => {
|
|
|
657
655
|
label: metadata.label?.(object) || object.name || metadata.placeholder || [
|
|
658
656
|
"unnamed object label",
|
|
659
657
|
{
|
|
660
|
-
ns:
|
|
658
|
+
ns: import_chunk_P4XUXM7Y.SPACE_PLUGIN
|
|
661
659
|
}
|
|
662
660
|
],
|
|
663
661
|
icon: metadata.icon ?? "ph--placeholder--regular",
|
|
@@ -668,21 +666,21 @@ var createObjectNode = ({ object, space, resolve }) => {
|
|
|
668
666
|
};
|
|
669
667
|
};
|
|
670
668
|
var constructObjectActionGroups = ({ object, dispatch }) => {
|
|
671
|
-
if (!(object instanceof
|
|
669
|
+
if (!(object instanceof import_chunk_HE2GHO6Z.CollectionType)) {
|
|
672
670
|
return [];
|
|
673
671
|
}
|
|
674
672
|
const collection = object;
|
|
675
673
|
const getId = (id) => `${id}/${(0, import_echo4.fullyQualifiedId)(object)}`;
|
|
676
674
|
const actions = [
|
|
677
675
|
{
|
|
678
|
-
id: getId(
|
|
676
|
+
id: getId(import_chunk_P4XUXM7Y.SpaceAction.ADD_OBJECT),
|
|
679
677
|
type: import_plugin_graph2.ACTION_GROUP_TYPE,
|
|
680
678
|
data: import_plugin_graph2.actionGroupSymbol,
|
|
681
679
|
properties: {
|
|
682
680
|
label: [
|
|
683
681
|
"create object in collection label",
|
|
684
682
|
{
|
|
685
|
-
ns:
|
|
683
|
+
ns: import_chunk_P4XUXM7Y.SPACE_PLUGIN
|
|
686
684
|
}
|
|
687
685
|
],
|
|
688
686
|
icon: "ph--plus--regular",
|
|
@@ -694,15 +692,15 @@ var constructObjectActionGroups = ({ object, dispatch }) => {
|
|
|
694
692
|
},
|
|
695
693
|
nodes: [
|
|
696
694
|
{
|
|
697
|
-
id: getId(
|
|
695
|
+
id: getId(import_chunk_P4XUXM7Y.SpaceAction.ADD_OBJECT.replace("object", "collection")),
|
|
698
696
|
type: import_plugin_graph2.ACTION_TYPE,
|
|
699
697
|
data: () => dispatch([
|
|
700
698
|
{
|
|
701
|
-
plugin:
|
|
702
|
-
action:
|
|
699
|
+
plugin: import_chunk_P4XUXM7Y.SPACE_PLUGIN,
|
|
700
|
+
action: import_chunk_P4XUXM7Y.SpaceAction.ADD_OBJECT,
|
|
703
701
|
data: {
|
|
704
702
|
target: collection,
|
|
705
|
-
object: (0, import_echo_schema2.create)(
|
|
703
|
+
object: (0, import_echo_schema2.create)(import_chunk_HE2GHO6Z.CollectionType, {
|
|
706
704
|
objects: [],
|
|
707
705
|
views: {}
|
|
708
706
|
})
|
|
@@ -716,7 +714,7 @@ var constructObjectActionGroups = ({ object, dispatch }) => {
|
|
|
716
714
|
label: [
|
|
717
715
|
"create collection label",
|
|
718
716
|
{
|
|
719
|
-
ns:
|
|
717
|
+
ns: import_chunk_P4XUXM7Y.SPACE_PLUGIN
|
|
720
718
|
}
|
|
721
719
|
],
|
|
722
720
|
icon: "ph--cards-three--regular",
|
|
@@ -733,11 +731,11 @@ var constructObjectActions = ({ node, dispatch }) => {
|
|
|
733
731
|
const getId = (id) => `${id}/${(0, import_echo4.fullyQualifiedId)(object)}`;
|
|
734
732
|
const actions = [
|
|
735
733
|
{
|
|
736
|
-
id: getId(
|
|
734
|
+
id: getId(import_chunk_P4XUXM7Y.SpaceAction.RENAME_OBJECT),
|
|
737
735
|
type: import_plugin_graph2.ACTION_TYPE,
|
|
738
736
|
data: async (params) => {
|
|
739
737
|
await dispatch({
|
|
740
|
-
action:
|
|
738
|
+
action: import_chunk_P4XUXM7Y.SpaceAction.RENAME_OBJECT,
|
|
741
739
|
data: {
|
|
742
740
|
object,
|
|
743
741
|
...params
|
|
@@ -746,9 +744,9 @@ var constructObjectActions = ({ node, dispatch }) => {
|
|
|
746
744
|
},
|
|
747
745
|
properties: {
|
|
748
746
|
label: [
|
|
749
|
-
object instanceof
|
|
747
|
+
object instanceof import_chunk_HE2GHO6Z.CollectionType ? "rename collection label" : "rename object label",
|
|
750
748
|
{
|
|
751
|
-
ns:
|
|
749
|
+
ns: import_chunk_P4XUXM7Y.SPACE_PLUGIN
|
|
752
750
|
}
|
|
753
751
|
],
|
|
754
752
|
icon: "ph--pencil-simple-line--regular",
|
|
@@ -758,16 +756,16 @@ var constructObjectActions = ({ node, dispatch }) => {
|
|
|
758
756
|
}
|
|
759
757
|
},
|
|
760
758
|
{
|
|
761
|
-
id: getId(
|
|
759
|
+
id: getId(import_chunk_P4XUXM7Y.SpaceAction.REMOVE_OBJECT),
|
|
762
760
|
type: import_plugin_graph2.ACTION_TYPE,
|
|
763
761
|
data: async () => {
|
|
764
762
|
const graph = (0, import_plugin_graph2.getGraph)(node);
|
|
765
763
|
const collection = graph.nodes(node, {
|
|
766
764
|
relation: "inbound"
|
|
767
|
-
}).find(({ data }) => data instanceof
|
|
765
|
+
}).find(({ data }) => data instanceof import_chunk_HE2GHO6Z.CollectionType)?.data;
|
|
768
766
|
await dispatch([
|
|
769
767
|
{
|
|
770
|
-
action:
|
|
768
|
+
action: import_chunk_P4XUXM7Y.SpaceAction.REMOVE_OBJECT,
|
|
771
769
|
data: {
|
|
772
770
|
object,
|
|
773
771
|
collection
|
|
@@ -777,13 +775,13 @@ var constructObjectActions = ({ node, dispatch }) => {
|
|
|
777
775
|
},
|
|
778
776
|
properties: {
|
|
779
777
|
label: [
|
|
780
|
-
object instanceof
|
|
778
|
+
object instanceof import_chunk_HE2GHO6Z.CollectionType ? "delete collection label" : "delete object label",
|
|
781
779
|
{
|
|
782
|
-
ns:
|
|
780
|
+
ns: import_chunk_P4XUXM7Y.SPACE_PLUGIN
|
|
783
781
|
}
|
|
784
782
|
],
|
|
785
783
|
icon: "ph--trash--regular",
|
|
786
|
-
keyBinding: object instanceof
|
|
784
|
+
keyBinding: object instanceof import_chunk_HE2GHO6Z.CollectionType ? void 0 : "shift+meta+Backspace",
|
|
787
785
|
testId: "spacePlugin.deleteObject"
|
|
788
786
|
}
|
|
789
787
|
},
|
|
@@ -798,7 +796,7 @@ var constructObjectActions = ({ node, dispatch }) => {
|
|
|
798
796
|
label: [
|
|
799
797
|
"copy link label",
|
|
800
798
|
{
|
|
801
|
-
ns:
|
|
799
|
+
ns: import_chunk_P4XUXM7Y.SPACE_PLUGIN
|
|
802
800
|
}
|
|
803
801
|
],
|
|
804
802
|
icon: "ph--link--regular",
|
|
@@ -858,36 +856,36 @@ var cloneObject = async (object, resolve) => {
|
|
|
858
856
|
});
|
|
859
857
|
};
|
|
860
858
|
var MenuFooter = ({ object }) => {
|
|
861
|
-
const { t } = (0,
|
|
859
|
+
const { t } = (0, import_react_ui6.useTranslation)(import_chunk_P4XUXM7Y.SPACE_PLUGIN);
|
|
862
860
|
const client = (0, import_react_client3.useClient)();
|
|
863
861
|
const space = (0, import_echo3.getSpace)(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_react9.default.createElement(import_react9.default.Fragment, null, /* @__PURE__ */ import_react9.default.createElement(import_react_ui6.DropdownMenu.Separator, null), /* @__PURE__ */ import_react9.default.createElement(import_react_ui6.DropdownMenu.GroupLabel, null, t("menu footer label")), /* @__PURE__ */ import_react9.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_react9.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_react9.default.createElement("dd", {
|
|
872
870
|
className: "line-clamp-3"
|
|
873
|
-
}, /* @__PURE__ */
|
|
871
|
+
}, /* @__PURE__ */ import_react9.default.createElement(import_react8.Planet, {
|
|
874
872
|
className: "inline-block mie-1"
|
|
875
|
-
}), (0,
|
|
873
|
+
}), (0, import_react_ui6.toLocalizedString)(spaceName, t)))) : null;
|
|
876
874
|
};
|
|
877
875
|
var WAIT_FOR_OBJECT_TIMEOUT2 = 1e3;
|
|
878
876
|
var MissingObject = ({ id }) => {
|
|
879
|
-
const { t } = (0,
|
|
880
|
-
const [waiting, setWaiting] = (0,
|
|
877
|
+
const { t } = (0, import_react_ui7.useTranslation)(import_chunk_P4XUXM7Y.SPACE_PLUGIN);
|
|
878
|
+
const [waiting, setWaiting] = (0, import_react10.useState)(false);
|
|
881
879
|
const intentPlugin = (0, import_app_framework4.useResolvePlugin)(import_app_framework4.parseIntentPlugin);
|
|
882
|
-
(0,
|
|
880
|
+
(0, import_react10.useEffect)(() => {
|
|
883
881
|
if (!intentPlugin) {
|
|
884
882
|
return;
|
|
885
883
|
}
|
|
886
884
|
const timeout = setTimeout(async () => {
|
|
887
885
|
setWaiting(true);
|
|
888
886
|
await intentPlugin.provides.intent.dispatch({
|
|
889
|
-
plugin:
|
|
890
|
-
action:
|
|
887
|
+
plugin: import_chunk_P4XUXM7Y.SPACE_PLUGIN,
|
|
888
|
+
action: import_chunk_P4XUXM7Y.SpaceAction.WAIT_FOR_OBJECT,
|
|
891
889
|
data: {
|
|
892
890
|
id
|
|
893
891
|
}
|
|
@@ -898,13 +896,13 @@ var MissingObject = ({ id }) => {
|
|
|
898
896
|
intentPlugin,
|
|
899
897
|
id
|
|
900
898
|
]);
|
|
901
|
-
return /* @__PURE__ */
|
|
899
|
+
return /* @__PURE__ */ import_react10.default.createElement("div", {
|
|
902
900
|
role: "none",
|
|
903
|
-
className: (0,
|
|
904
|
-
}, waiting ? /* @__PURE__ */
|
|
901
|
+
className: (0, import_react_ui_theme3.mx)(import_react_ui_theme3.baseSurface, "min-bs-screen is-full flex items-center justify-center p-8")
|
|
902
|
+
}, waiting ? /* @__PURE__ */ import_react10.default.createElement("p", {
|
|
905
903
|
role: "alert",
|
|
906
|
-
className: (0,
|
|
907
|
-
}, t("missing object message")) : /* @__PURE__ */
|
|
904
|
+
className: (0, import_react_ui_theme3.mx)(import_react_ui_theme3.descriptionText, "border border-dashed border-neutral-400/50 rounded-lg flex items-center justify-center p-8 font-normal text-lg")
|
|
905
|
+
}, t("missing object message")) : /* @__PURE__ */ import_react10.default.createElement(import_react_ui7.Status, {
|
|
908
906
|
indeterminate: true,
|
|
909
907
|
"aria-label": "Initializing"
|
|
910
908
|
}));
|
|
@@ -916,12 +914,12 @@ var Status2;
|
|
|
916
914
|
Status3[Status3["ERROR"] = 2] = "ERROR";
|
|
917
915
|
})(Status2 || (Status2 = {}));
|
|
918
916
|
var PersistenceStatus = ({ db }) => {
|
|
919
|
-
const { t } = (0,
|
|
920
|
-
const [displayMessage, setDisplayMessage] = (0,
|
|
921
|
-
const [status, naturalSetStatus] = (0,
|
|
922
|
-
const [prevStatus, setPrevStatus] = (0,
|
|
917
|
+
const { t } = (0, import_react_ui8.useTranslation)(import_chunk_P4XUXM7Y.SPACE_PLUGIN);
|
|
918
|
+
const [displayMessage, setDisplayMessage] = (0, import_react12.useState)(false);
|
|
919
|
+
const [status, naturalSetStatus] = (0, import_react12.useState)(0);
|
|
920
|
+
const [prevStatus, setPrevStatus] = (0, import_react12.useState)(0);
|
|
923
921
|
const _setStatus = (0, import_async2.debounce)(naturalSetStatus, 500);
|
|
924
|
-
(0,
|
|
922
|
+
(0, import_react12.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_react12.default.createElement("div", {
|
|
937
935
|
className: "flex items-center"
|
|
938
|
-
}, /* @__PURE__ */
|
|
939
|
-
className: (0,
|
|
940
|
-
}), /* @__PURE__ */
|
|
941
|
-
className: (0,
|
|
936
|
+
}, /* @__PURE__ */ import_react12.default.createElement(import_react11.Warning, {
|
|
937
|
+
className: (0, import_react_ui_theme4.mx)((0, import_react_ui_theme4.getSize)(4), "me-1")
|
|
938
|
+
}), /* @__PURE__ */ import_react12.default.createElement("span", {
|
|
939
|
+
className: (0, import_react_ui_theme4.mx)("text-sm", import_react_ui_theme4.warningText)
|
|
942
940
|
}, t("persistence error label")));
|
|
943
941
|
case 1:
|
|
944
|
-
return /* @__PURE__ */
|
|
942
|
+
return /* @__PURE__ */ import_react12.default.createElement("div", {
|
|
945
943
|
className: "flex items-center"
|
|
946
|
-
}, /* @__PURE__ */
|
|
947
|
-
className: (0,
|
|
948
|
-
}), /* @__PURE__ */
|
|
949
|
-
className: (0,
|
|
944
|
+
}, /* @__PURE__ */ import_react12.default.createElement(import_react11.ArrowsCounterClockwise, {
|
|
945
|
+
className: (0, import_react_ui_theme4.mx)((0, import_react_ui_theme4.getSize)(4), "me-1")
|
|
946
|
+
}), /* @__PURE__ */ import_react12.default.createElement("span", {
|
|
947
|
+
className: (0, import_react_ui_theme4.mx)("text-sm", import_react_ui_theme4.staticPlaceholderText)
|
|
950
948
|
}, t("persistence pending label")));
|
|
951
949
|
case 0:
|
|
952
950
|
default:
|
|
953
|
-
return /* @__PURE__ */
|
|
951
|
+
return /* @__PURE__ */ import_react12.default.createElement(import_react_ui8.Tooltip.Root, {
|
|
954
952
|
delayDuration: 400
|
|
955
|
-
}, /* @__PURE__ */
|
|
953
|
+
}, /* @__PURE__ */ import_react12.default.createElement(import_react_ui8.Tooltip.Trigger, {
|
|
956
954
|
role: "status",
|
|
957
955
|
className: "flex items-center"
|
|
958
|
-
}, /* @__PURE__ */
|
|
959
|
-
className: (0,
|
|
960
|
-
}), displayMessage && /* @__PURE__ */
|
|
961
|
-
className: (0,
|
|
962
|
-
}, t("persisted locally label"))), /* @__PURE__ */
|
|
956
|
+
}, /* @__PURE__ */ import_react12.default.createElement(import_react11.CheckCircle, {
|
|
957
|
+
className: (0, import_react_ui_theme4.mx)((0, import_react_ui_theme4.getSize)(4), "me-1")
|
|
958
|
+
}), displayMessage && /* @__PURE__ */ import_react12.default.createElement("span", {
|
|
959
|
+
className: (0, import_react_ui_theme4.mx)("text-sm", import_react_ui_theme4.staticPlaceholderText)
|
|
960
|
+
}, t("persisted locally label"))), /* @__PURE__ */ import_react12.default.createElement(import_react_ui8.Tooltip.Portal, null, /* @__PURE__ */ import_react12.default.createElement(import_react_ui8.Tooltip.Content, {
|
|
963
961
|
classNames: "z-10"
|
|
964
|
-
}, t("persisted locally message"), /* @__PURE__ */
|
|
962
|
+
}, t("persisted locally message"), /* @__PURE__ */ import_react12.default.createElement(import_react_ui8.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
|
-
const { t } = (0,
|
|
970
|
-
const doneButton = (0,
|
|
967
|
+
const { t } = (0, import_react_ui9.useTranslation)(import_chunk_P4XUXM7Y.SPACE_PLUGIN);
|
|
968
|
+
const doneButton = (0, import_react13.useRef)(null);
|
|
971
969
|
const object = obj;
|
|
972
|
-
const [name, setName] = (0,
|
|
973
|
-
const handleDone = (0,
|
|
970
|
+
const [name, setName] = (0, import_react13.useState)(object.name || object.title || "");
|
|
971
|
+
const handleDone = (0, import_react13.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_react13.default.createElement("div", {
|
|
995
993
|
role: "none",
|
|
996
994
|
className: "p-1 flex gap-2"
|
|
997
|
-
}, /* @__PURE__ */
|
|
995
|
+
}, /* @__PURE__ */ import_react13.default.createElement("div", {
|
|
998
996
|
role: "none",
|
|
999
997
|
className: "flex-1"
|
|
1000
|
-
}, /* @__PURE__ */
|
|
998
|
+
}, /* @__PURE__ */ import_react13.default.createElement(import_react_ui9.Input.Root, null, /* @__PURE__ */ import_react13.default.createElement(import_react_ui9.Input.Label, {
|
|
1001
999
|
srOnly: true
|
|
1002
|
-
}, t("object name label")), /* @__PURE__ */
|
|
1000
|
+
}, t("object name label")), /* @__PURE__ */ import_react13.default.createElement(import_react_ui9.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_react13.default.createElement(import_react_ui9.Popover.Close, {
|
|
1009
1007
|
asChild: true
|
|
1010
|
-
}, /* @__PURE__ */
|
|
1008
|
+
}, /* @__PURE__ */ import_react13.default.createElement(import_react_ui9.Button, {
|
|
1011
1009
|
ref: doneButton,
|
|
1012
1010
|
classNames: "self-stretch",
|
|
1013
1011
|
onClick: handleDone
|
|
@@ -1016,33 +1014,33 @@ var PopoverRenameObject = ({ object: obj }) => {
|
|
|
1016
1014
|
}))));
|
|
1017
1015
|
};
|
|
1018
1016
|
var PopoverRenameSpace = ({ space }) => {
|
|
1019
|
-
const { t } = (0,
|
|
1020
|
-
const doneButton = (0,
|
|
1021
|
-
const [name, setName] = (0,
|
|
1022
|
-
const handleDone = (0,
|
|
1017
|
+
const { t } = (0, import_react_ui10.useTranslation)(import_chunk_P4XUXM7Y.SPACE_PLUGIN);
|
|
1018
|
+
const doneButton = (0, import_react14.useRef)(null);
|
|
1019
|
+
const [name, setName] = (0, import_react14.useState)(space.properties.name ?? "");
|
|
1020
|
+
const handleDone = (0, import_react14.useCallback)(() => {
|
|
1023
1021
|
space.properties.name = name;
|
|
1024
1022
|
}, [
|
|
1025
1023
|
space,
|
|
1026
1024
|
name
|
|
1027
1025
|
]);
|
|
1028
|
-
return /* @__PURE__ */
|
|
1026
|
+
return /* @__PURE__ */ import_react14.default.createElement("div", {
|
|
1029
1027
|
role: "none",
|
|
1030
1028
|
className: "p-1 flex gap-2"
|
|
1031
|
-
}, /* @__PURE__ */
|
|
1029
|
+
}, /* @__PURE__ */ import_react14.default.createElement("div", {
|
|
1032
1030
|
role: "none",
|
|
1033
1031
|
className: "flex-1"
|
|
1034
|
-
}, /* @__PURE__ */
|
|
1032
|
+
}, /* @__PURE__ */ import_react14.default.createElement(import_react_ui10.Input.Root, null, /* @__PURE__ */ import_react14.default.createElement(import_react_ui10.Input.Label, {
|
|
1035
1033
|
srOnly: true
|
|
1036
|
-
}, t("space name label")), /* @__PURE__ */
|
|
1034
|
+
}, t("space name label")), /* @__PURE__ */ import_react14.default.createElement(import_react_ui10.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_react14.default.createElement(import_react_ui10.Popover.Close, {
|
|
1044
1042
|
asChild: true
|
|
1045
|
-
}, /* @__PURE__ */
|
|
1043
|
+
}, /* @__PURE__ */ import_react14.default.createElement(import_react_ui10.Button, {
|
|
1046
1044
|
ref: doneButton,
|
|
1047
1045
|
classNames: "self-stretch",
|
|
1048
1046
|
onClick: handleDone
|
|
@@ -1052,9 +1050,9 @@ 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_react15.default.createElement(ShareSpaceButtonImpl, {
|
|
1056
1054
|
onClick: () => dispatch({
|
|
1057
|
-
action:
|
|
1055
|
+
action: import_chunk_P4XUXM7Y.SpaceAction.SHARE,
|
|
1058
1056
|
data: {
|
|
1059
1057
|
spaceId
|
|
1060
1058
|
}
|
|
@@ -1062,8 +1060,8 @@ var ShareSpaceButton = ({ spaceId }) => {
|
|
|
1062
1060
|
});
|
|
1063
1061
|
};
|
|
1064
1062
|
var ShareSpaceButtonImpl = ({ onClick }) => {
|
|
1065
|
-
const { t } = (0,
|
|
1066
|
-
return /* @__PURE__ */
|
|
1063
|
+
const { t } = (0, import_react_ui11.useTranslation)(import_chunk_P4XUXM7Y.SPACE_PLUGIN);
|
|
1064
|
+
return /* @__PURE__ */ import_react15.default.createElement(import_react_ui11.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_react20.default.createElement(import_react_ui13.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_react20.default.createElement(import_react21.IdentityListItem, {
|
|
1079
1077
|
classNames: "contents",
|
|
1080
1078
|
key: member.identity.identityKey.toHex(),
|
|
1081
1079
|
identity: member.identity,
|
|
@@ -1083,7 +1081,7 @@ var SpaceMemberList = ({ members }) => {
|
|
|
1083
1081
|
}))) : null;
|
|
1084
1082
|
};
|
|
1085
1083
|
var SpaceMembersSection = ({ space }) => {
|
|
1086
|
-
const { t } = (0,
|
|
1084
|
+
const { t } = (0, import_react_ui13.useTranslation)(import_chunk_P4XUXM7Y.SPACE_PLUGIN);
|
|
1087
1085
|
const invitations = (0, import_echo6.useSpaceInvitations)(space.key);
|
|
1088
1086
|
const { dispatch } = (0, import_app_framework7.useIntent)();
|
|
1089
1087
|
const handleCloseDialog = () => dispatch({
|
|
@@ -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_react19.UserPlus,
|
|
1121
|
+
onClick: (0, import_react20.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_react19.UsersThree,
|
|
1138
|
+
onClick: (0, import_react20.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_react20.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_react20.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_react20.default.createElement("h2", {
|
|
1167
1165
|
className: "contents"
|
|
1168
|
-
}, /* @__PURE__ */
|
|
1166
|
+
}, /* @__PURE__ */ import_react20.default.createElement(import_react19.UsersThree, {
|
|
1169
1167
|
weight: "duotone",
|
|
1170
|
-
className: (0,
|
|
1171
|
-
}), /* @__PURE__ */
|
|
1168
|
+
className: (0, import_react_ui_theme6.mx)((0, import_react_ui_theme6.getSize)(5), "place-self-center")
|
|
1169
|
+
}), /* @__PURE__ */ import_react20.default.createElement("span", {
|
|
1172
1170
|
className: "text-lg col-span-2"
|
|
1173
|
-
}, t("space members label"))), /* @__PURE__ */
|
|
1171
|
+
}, t("space members label"))), /* @__PURE__ */ import_react20.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_react20.default.createElement(import_react_ui13.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_react20.default.createElement(import_react21.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_react20.default.createElement(import_react_ui13.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_react20.default.createElement(import_react_ui13.Button, {
|
|
1187
1185
|
classNames: "gap-2",
|
|
1188
1186
|
onClick: activeAction.onClick
|
|
1189
|
-
}, /* @__PURE__ */
|
|
1190
|
-
className: (0,
|
|
1191
|
-
}), /* @__PURE__ */
|
|
1187
|
+
}, /* @__PURE__ */ import_react20.default.createElement(activeAction.icon, {
|
|
1188
|
+
className: (0, import_react_ui_theme6.getSize)(5)
|
|
1189
|
+
}), /* @__PURE__ */ import_react20.default.createElement("span", null, t(activeAction.label, {
|
|
1192
1190
|
ns: "os"
|
|
1193
|
-
}))), /* @__PURE__ */
|
|
1191
|
+
}))), /* @__PURE__ */ import_react20.default.createElement(import_react_ui13.DropdownMenu.Root, null, /* @__PURE__ */ import_react20.default.createElement(import_react_ui13.DropdownMenu.Trigger, {
|
|
1194
1192
|
asChild: true
|
|
1195
|
-
}, /* @__PURE__ */
|
|
1193
|
+
}, /* @__PURE__ */ import_react20.default.createElement(import_react_ui13.Button, {
|
|
1196
1194
|
classNames: "pli-0"
|
|
1197
|
-
}, /* @__PURE__ */
|
|
1198
|
-
className: (0,
|
|
1199
|
-
}))), /* @__PURE__ */
|
|
1200
|
-
return /* @__PURE__ */
|
|
1195
|
+
}, /* @__PURE__ */ import_react20.default.createElement(import_react19.CaretDown, {
|
|
1196
|
+
className: (0, import_react_ui_theme6.getSize)(4)
|
|
1197
|
+
}))), /* @__PURE__ */ import_react20.default.createElement(import_react_ui13.DropdownMenu.Content, null, /* @__PURE__ */ import_react20.default.createElement(import_react_ui13.DropdownMenu.Viewport, null, Object.entries(inviteActions).map(([id, action]) => {
|
|
1198
|
+
return /* @__PURE__ */ import_react20.default.createElement(import_react_ui13.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__ */
|
|
1208
|
-
className: (0,
|
|
1209
|
-
}), /* @__PURE__ */
|
|
1205
|
+
}, action.icon && /* @__PURE__ */ import_react20.default.createElement(action.icon, {
|
|
1206
|
+
className: (0, import_react_ui_theme6.getSize)(5)
|
|
1207
|
+
}), /* @__PURE__ */ import_react20.default.createElement("div", {
|
|
1210
1208
|
role: "none",
|
|
1211
1209
|
className: "flex-1 min-is-0 space-b-1"
|
|
1212
|
-
}, /* @__PURE__ */
|
|
1210
|
+
}, /* @__PURE__ */ import_react20.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_react20.default.createElement("p", {
|
|
1217
1215
|
id: `${id}__description`,
|
|
1218
|
-
className:
|
|
1216
|
+
className: import_react_ui_theme6.descriptionText
|
|
1219
1217
|
}, t(action.description, {
|
|
1220
1218
|
ns: "os"
|
|
1221
|
-
}))), /* @__PURE__ */
|
|
1219
|
+
}))), /* @__PURE__ */ import_react20.default.createElement(import_react_ui13.DropdownMenu.ItemIndicator, {
|
|
1222
1220
|
asChild: true
|
|
1223
|
-
}, /* @__PURE__ */
|
|
1224
|
-
className: (0,
|
|
1221
|
+
}, /* @__PURE__ */ import_react20.default.createElement(import_react19.Check, {
|
|
1222
|
+
className: (0, import_react_ui_theme6.getSize)(4)
|
|
1225
1223
|
})));
|
|
1226
|
-
})), /* @__PURE__ */
|
|
1227
|
-
className: (0,
|
|
1224
|
+
})), /* @__PURE__ */ import_react20.default.createElement(import_react_ui13.DropdownMenu.Arrow, null)))), members[Presence.ONLINE].length + members[Presence.OFFLINE].length < 1 ? /* @__PURE__ */ import_react20.default.createElement("p", {
|
|
1225
|
+
className: (0, import_react_ui_theme6.mx)(import_react_ui_theme6.descriptionText, "text-center is-full mlb-2")
|
|
1228
1226
|
}, t("empty space members message", {
|
|
1229
1227
|
ns: "os"
|
|
1230
|
-
})) : /* @__PURE__ */
|
|
1228
|
+
})) : /* @__PURE__ */ import_react20.default.createElement(import_react20.default.Fragment, null, /* @__PURE__ */ import_react20.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_react20.default.createElement(SpaceMemberList, {
|
|
1235
1233
|
members: members[Presence.ONLINE]
|
|
1236
|
-
}), /* @__PURE__ */
|
|
1234
|
+
}), /* @__PURE__ */ import_react20.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_react20.default.createElement(SpaceMemberList, {
|
|
1241
1239
|
members: members[Presence.OFFLINE]
|
|
1242
1240
|
})));
|
|
1243
1241
|
};
|
|
1244
1242
|
var KeyShortcuts = () => {
|
|
1245
|
-
const { t } = (0,
|
|
1246
|
-
return /* @__PURE__ */
|
|
1243
|
+
const { t } = (0, import_react_ui12.useTranslation)(import_chunk_P4XUXM7Y.SPACE_PLUGIN);
|
|
1244
|
+
return /* @__PURE__ */ import_react17.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_react17.default.createElement("h2", {
|
|
1249
1247
|
className: "contents"
|
|
1250
|
-
}, /* @__PURE__ */
|
|
1248
|
+
}, /* @__PURE__ */ import_react17.default.createElement(import_react16.Command, {
|
|
1251
1249
|
weight: "duotone",
|
|
1252
|
-
className: (0,
|
|
1253
|
-
}), /* @__PURE__ */
|
|
1250
|
+
className: (0, import_react_ui_theme5.mx)((0, import_react_ui_theme5.getSize)(5), "place-self-center")
|
|
1251
|
+
}), /* @__PURE__ */ import_react17.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_react17.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_react17.default.createElement(import_app_framework6.Surface, {
|
|
1259
1257
|
role: "keyshortcuts"
|
|
1260
1258
|
})));
|
|
1261
1259
|
};
|
|
@@ -1263,42 +1261,42 @@ var spaceMainLayout = "grid gap-y-2 auto-rows-min before:bs-2 before:col-span-5
|
|
|
1263
1261
|
var SpaceMain = ({ space, role }) => {
|
|
1264
1262
|
const state = space.state.get();
|
|
1265
1263
|
const ready = state === import_echo5.SpaceState.SPACE_READY;
|
|
1266
|
-
const Root = role === "main" ?
|
|
1267
|
-
return /* @__PURE__ */
|
|
1264
|
+
const Root = role === "main" ? import_react_ui12.Main.Content : "div";
|
|
1265
|
+
return /* @__PURE__ */ import_react17.default.createElement(import_react18.ClipboardProvider, null, /* @__PURE__ */ import_react17.default.createElement(Root, {
|
|
1268
1266
|
...role === "main" ? {
|
|
1269
1267
|
classNames: [
|
|
1270
|
-
|
|
1268
|
+
import_react_ui_theme5.topbarBlockPaddingStart,
|
|
1271
1269
|
"min-bs-dvh",
|
|
1272
1270
|
spaceMainLayout
|
|
1273
1271
|
]
|
|
1274
1272
|
} : {
|
|
1275
1273
|
role: "none",
|
|
1276
|
-
className: (0,
|
|
1274
|
+
className: (0, import_react_ui_theme5.mx)(import_react_ui_theme5.topbarBlockPaddingStart, "row-span-2", spaceMainLayout)
|
|
1277
1275
|
},
|
|
1278
1276
|
"data-testid": `spacePlugin.${role}`,
|
|
1279
1277
|
"data-isready": ready ? "true" : "false"
|
|
1280
|
-
}, ready && /* @__PURE__ */
|
|
1278
|
+
}, ready && /* @__PURE__ */ import_react17.default.createElement(SpaceMembersSection, {
|
|
1281
1279
|
space
|
|
1282
|
-
}), /* @__PURE__ */
|
|
1280
|
+
}), /* @__PURE__ */ import_react17.default.createElement(KeyShortcuts, null)));
|
|
1283
1281
|
};
|
|
1284
1282
|
var REFRESH_INTERVAL = 5e3;
|
|
1285
1283
|
var ACTIVITY_DURATION = 3e4;
|
|
1286
1284
|
var noViewers = new import_util2.ComplexMap(import_react_client4.PublicKey.hash);
|
|
1287
1285
|
var getName = (identity) => identity.profile?.displayName ?? (0, import_display_name.generateName)(identity.identityKey.toHex());
|
|
1288
1286
|
var SpacePresence = ({ object, spaceKey }) => {
|
|
1289
|
-
const density = (0,
|
|
1290
|
-
const spacePlugin = (0, import_app_framework8.usePlugin)(
|
|
1287
|
+
const density = (0, import_react_ui14.useDensityContext)();
|
|
1288
|
+
const spacePlugin = (0, import_app_framework8.usePlugin)(import_chunk_P4XUXM7Y.SPACE_PLUGIN);
|
|
1291
1289
|
const client = (0, import_react_client4.useClient)();
|
|
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_react22.useState)(Date.now());
|
|
1294
|
+
(0, import_react22.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_react22.useCallback)((member) => member.presence === 1, []);
|
|
1299
|
+
const memberIsNotSelf = (0, import_react22.useCallback)((member) => !identity?.identityKey.equals(member.identity.identityKey), [
|
|
1302
1300
|
identity?.identityKey
|
|
1303
1301
|
]);
|
|
1304
1302
|
if (!identity || !spacePlugin || !space) {
|
|
@@ -1316,63 +1314,63 @@ 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_react22.default.createElement(SmallPresence, {
|
|
1320
1318
|
count: membersForObject.length
|
|
1321
|
-
}) : /* @__PURE__ */
|
|
1319
|
+
}) : /* @__PURE__ */ import_react22.default.createElement(FullPresence, {
|
|
1322
1320
|
members: membersForObject
|
|
1323
1321
|
});
|
|
1324
1322
|
};
|
|
1325
1323
|
var FullPresence = (props) => {
|
|
1326
1324
|
const { size = 9, onMemberClick } = props;
|
|
1327
|
-
const members = (0,
|
|
1325
|
+
const members = (0, import_react_ui14.useDefaultValue)(props.members, () => []);
|
|
1328
1326
|
if (members.length === 0) {
|
|
1329
1327
|
return null;
|
|
1330
1328
|
}
|
|
1331
|
-
return /* @__PURE__ */
|
|
1329
|
+
return /* @__PURE__ */ import_react22.default.createElement(import_react_ui14.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_react22.default.createElement(import_react_ui14.Tooltip.Root, {
|
|
1336
1334
|
key: member.identity.identityKey.toHex()
|
|
1337
|
-
}, /* @__PURE__ */
|
|
1335
|
+
}, /* @__PURE__ */ import_react22.default.createElement(import_react_ui14.Tooltip.Trigger, null, /* @__PURE__ */ import_react22.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_react22.default.createElement(import_react_ui14.Tooltip.Portal, null, /* @__PURE__ */ import_react22.default.createElement(import_react_ui14.Tooltip.Content, {
|
|
1344
1342
|
side: "bottom"
|
|
1345
|
-
}, /* @__PURE__ */
|
|
1343
|
+
}, /* @__PURE__ */ import_react22.default.createElement("span", null, getName(member.identity)), /* @__PURE__ */ import_react22.default.createElement(import_react_ui14.Tooltip.Arrow, null))))), members.length > 3 && /* @__PURE__ */ import_react22.default.createElement(import_react_ui14.Tooltip.Root, null, /* @__PURE__ */ import_react22.default.createElement(import_react_ui14.Tooltip.Trigger, null, /* @__PURE__ */ import_react22.default.createElement(import_react_ui14.AvatarGroupItem.Root, {
|
|
1346
1344
|
status: "inactive"
|
|
1347
|
-
}, /* @__PURE__ */
|
|
1345
|
+
}, /* @__PURE__ */ import_react22.default.createElement(import_react_ui14.Avatar.Frame, {
|
|
1348
1346
|
style: {
|
|
1349
1347
|
zIndex: members.length - 4
|
|
1350
1348
|
}
|
|
1351
|
-
}, /* @__PURE__ */
|
|
1349
|
+
}, /* @__PURE__ */ import_react22.default.createElement(import_react_ui14.Avatar.Fallback, {
|
|
1352
1350
|
text: `+${members.length - 3}`
|
|
1353
|
-
})))), /* @__PURE__ */
|
|
1351
|
+
})))), /* @__PURE__ */ import_react22.default.createElement(import_react_ui14.Tooltip.Portal, null, /* @__PURE__ */ import_react22.default.createElement(import_react_ui14.Tooltip.Content, {
|
|
1354
1352
|
side: "bottom"
|
|
1355
|
-
}, /* @__PURE__ */
|
|
1353
|
+
}, /* @__PURE__ */ import_react22.default.createElement(import_react_ui14.Tooltip.Arrow, null), /* @__PURE__ */ import_react22.default.createElement(import_react_ui14.List, {
|
|
1356
1354
|
classNames: "max-h-56 overflow-y-auto"
|
|
1357
|
-
}, members.map((member) => /* @__PURE__ */
|
|
1355
|
+
}, members.map((member) => /* @__PURE__ */ import_react22.default.createElement(import_react_ui14.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_react22.default.createElement(PrensenceAvatar, {
|
|
1363
1361
|
identity: member.identity,
|
|
1364
1362
|
showName: true,
|
|
1365
1363
|
match: member.currentlyAttended
|
|
1366
1364
|
}))))))));
|
|
1367
1365
|
};
|
|
1368
1366
|
var PrensenceAvatar = ({ identity, showName, match, group, index, onClick }) => {
|
|
1369
|
-
const Root = group ?
|
|
1367
|
+
const Root = group ? import_react_ui14.AvatarGroupItem.Root : import_react_ui14.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_react22.default.createElement(Root, {
|
|
1373
1371
|
status,
|
|
1374
1372
|
hue: identity.profile?.data?.hue || fallbackValue.hue
|
|
1375
|
-
}, /* @__PURE__ */
|
|
1373
|
+
}, /* @__PURE__ */ import_react22.default.createElement(import_react_ui14.Avatar.Frame, {
|
|
1376
1374
|
"data-testid": "spacePlugin.presence.member",
|
|
1377
1375
|
"data-status": status,
|
|
1378
1376
|
...index ? {
|
|
@@ -1381,77 +1379,77 @@ var PrensenceAvatar = ({ identity, showName, match, group, index, onClick }) =>
|
|
|
1381
1379
|
}
|
|
1382
1380
|
} : {},
|
|
1383
1381
|
onClick: () => onClick?.()
|
|
1384
|
-
}, /* @__PURE__ */
|
|
1382
|
+
}, /* @__PURE__ */ import_react22.default.createElement(import_react_ui14.Avatar.Fallback, {
|
|
1385
1383
|
text: identity.profile?.data?.emoji || fallbackValue.emoji
|
|
1386
|
-
})), showName && /* @__PURE__ */
|
|
1384
|
+
})), showName && /* @__PURE__ */ import_react22.default.createElement(import_react_ui14.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_react22.useState)(Date.now());
|
|
1390
|
+
(0, import_react22.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_react22.default.createElement(SmallPresence, {
|
|
1398
1396
|
count: activeViewers.length
|
|
1399
1397
|
});
|
|
1400
1398
|
};
|
|
1401
1399
|
var SmallPresence = ({ count }) => {
|
|
1402
|
-
const { t } = (0,
|
|
1403
|
-
return /* @__PURE__ */
|
|
1400
|
+
const { t } = (0, import_react_ui14.useTranslation)(import_chunk_P4XUXM7Y.SPACE_PLUGIN);
|
|
1401
|
+
return /* @__PURE__ */ import_react22.default.createElement(import_react_ui14.Tooltip.Root, null, /* @__PURE__ */ import_react22.default.createElement(import_react_ui14.Tooltip.Trigger, {
|
|
1404
1402
|
asChild: true
|
|
1405
|
-
}, /* @__PURE__ */
|
|
1403
|
+
}, /* @__PURE__ */ import_react22.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_react22.default.createElement(import_react_ui14.Tooltip.Portal, null, /* @__PURE__ */ import_react22.default.createElement(import_react_ui14.Tooltip.Content, {
|
|
1409
1407
|
side: "bottom",
|
|
1410
1408
|
classNames: "z-[70]"
|
|
1411
|
-
}, /* @__PURE__ */
|
|
1409
|
+
}, /* @__PURE__ */ import_react22.default.createElement("span", null, t("presence label", {
|
|
1412
1410
|
count
|
|
1413
|
-
})), /* @__PURE__ */
|
|
1411
|
+
})), /* @__PURE__ */ import_react22.default.createElement(import_react_ui14.Tooltip.Arrow, null))));
|
|
1414
1412
|
};
|
|
1415
1413
|
var SpaceSettings = ({ settings }) => {
|
|
1416
|
-
const { t } = (0,
|
|
1414
|
+
const { t } = (0, import_react_ui15.useTranslation)(import_chunk_P4XUXM7Y.SPACE_PLUGIN);
|
|
1417
1415
|
const dispatch = (0, import_app_framework9.useIntentDispatcher)();
|
|
1418
|
-
const plugins = (0, import_app_framework9.useResolvePlugins)(
|
|
1419
|
-
return /* @__PURE__ */
|
|
1416
|
+
const plugins = (0, import_app_framework9.useResolvePlugins)(import_chunk_HE2GHO6Z.parseSpaceInitPlugin);
|
|
1417
|
+
return /* @__PURE__ */ import_react23.default.createElement(import_react23.default.Fragment, null, /* @__PURE__ */ import_react23.default.createElement(import_plugin_settings.SettingsValue, {
|
|
1420
1418
|
label: t("show hidden spaces label")
|
|
1421
|
-
}, /* @__PURE__ */
|
|
1419
|
+
}, /* @__PURE__ */ import_react23.default.createElement(import_react_ui15.Input.Switch, {
|
|
1422
1420
|
checked: settings.showHidden,
|
|
1423
1421
|
onCheckedChange: (checked) => dispatch({
|
|
1424
|
-
plugin:
|
|
1425
|
-
action:
|
|
1422
|
+
plugin: import_chunk_P4XUXM7Y.SPACE_PLUGIN,
|
|
1423
|
+
action: import_chunk_P4XUXM7Y.SpaceAction.TOGGLE_HIDDEN,
|
|
1426
1424
|
data: {
|
|
1427
1425
|
state: !!checked
|
|
1428
1426
|
}
|
|
1429
1427
|
})
|
|
1430
|
-
})), /* @__PURE__ */
|
|
1428
|
+
})), /* @__PURE__ */ import_react23.default.createElement(import_plugin_settings.SettingsValue, {
|
|
1431
1429
|
label: t("default on space create label")
|
|
1432
|
-
}, /* @__PURE__ */
|
|
1430
|
+
}, /* @__PURE__ */ import_react23.default.createElement(import_react_ui15.Select.Root, {
|
|
1433
1431
|
value: settings.onSpaceCreate,
|
|
1434
1432
|
onValueChange: (value) => {
|
|
1435
1433
|
settings.onSpaceCreate = value;
|
|
1436
1434
|
}
|
|
1437
|
-
}, /* @__PURE__ */
|
|
1435
|
+
}, /* @__PURE__ */ import_react23.default.createElement(import_react_ui15.Select.TriggerButton, null), /* @__PURE__ */ import_react23.default.createElement(import_react_ui15.Select.Portal, null, /* @__PURE__ */ import_react23.default.createElement(import_react_ui15.Select.Content, null, /* @__PURE__ */ import_react23.default.createElement(import_react_ui15.Select.Viewport, null, plugins.map(({ provides: { space: { onSpaceCreate } } }) => /* @__PURE__ */ import_react23.default.createElement(import_react_ui15.Select.Option, {
|
|
1438
1436
|
key: onSpaceCreate.action,
|
|
1439
1437
|
value: onSpaceCreate.action
|
|
1440
|
-
}, (0,
|
|
1438
|
+
}, (0, import_react_ui15.toLocalizedString)(onSpaceCreate.label, t)))))))));
|
|
1441
1439
|
};
|
|
1442
1440
|
var __dxlog_file3 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/SaveStatus.tsx";
|
|
1443
1441
|
var SaveStatus = () => {
|
|
1444
|
-
const { t } = (0,
|
|
1442
|
+
const { t } = (0, import_react_ui16.useTranslation)(import_chunk_P4XUXM7Y.SPACE_PLUGIN);
|
|
1445
1443
|
const client = (0, import_react_client5.useClient)();
|
|
1446
|
-
const [state, setState] = (0,
|
|
1447
|
-
(0,
|
|
1444
|
+
const [state, setState] = (0, import_react24.useState)("saved");
|
|
1445
|
+
(0, import_react24.useEffect)(() => {
|
|
1448
1446
|
return createClientSaveTracker(client, (state2) => {
|
|
1449
1447
|
setState(state2);
|
|
1450
1448
|
});
|
|
1451
1449
|
}, []);
|
|
1452
|
-
return /* @__PURE__ */
|
|
1450
|
+
return /* @__PURE__ */ import_react24.default.createElement(import_plugin_status_bar.StatusBar.Item, {
|
|
1453
1451
|
title: state === "saving" ? t("saving label") : t("saved label")
|
|
1454
|
-
}, /* @__PURE__ */
|
|
1452
|
+
}, /* @__PURE__ */ import_react24.default.createElement(import_react_ui16.Icon, {
|
|
1455
1453
|
icon: state === "saving" ? "ph--arrows-clockwise--regular" : "ph--check-circle--regular",
|
|
1456
1454
|
size: 4
|
|
1457
1455
|
}));
|
|
@@ -1535,8 +1533,8 @@ var getSyncSummary = (syncMap) => {
|
|
|
1535
1533
|
var isEdgePeerId = (peerId, spaceId) => peerId.startsWith(`${import_protocols.EdgeService.AUTOMERGE_REPLICATOR}:${spaceId}`);
|
|
1536
1534
|
var useSyncState = () => {
|
|
1537
1535
|
const client = (0, import_react_client6.useClient)();
|
|
1538
|
-
const [spaceState, setSpaceState] = (0,
|
|
1539
|
-
(0,
|
|
1536
|
+
const [spaceState, setSpaceState] = (0, import_react26.useState)({});
|
|
1537
|
+
(0, import_react26.useEffect)(() => {
|
|
1540
1538
|
const ctx = new import_context2.Context(void 0, {
|
|
1541
1539
|
F: __dxlog_file4,
|
|
1542
1540
|
L: 48
|
|
@@ -1577,7 +1575,7 @@ var styles = {
|
|
|
1577
1575
|
};
|
|
1578
1576
|
var SyncStatus = () => {
|
|
1579
1577
|
const state = useSyncState();
|
|
1580
|
-
return /* @__PURE__ */
|
|
1578
|
+
return /* @__PURE__ */ import_react25.default.createElement(SyncStatusIndicator, {
|
|
1581
1579
|
state
|
|
1582
1580
|
});
|
|
1583
1581
|
};
|
|
@@ -1586,8 +1584,8 @@ var SyncStatusIndicator = ({ state }) => {
|
|
|
1586
1584
|
const offline = false;
|
|
1587
1585
|
const needsToUpload = summary.differentDocuments > 0 || summary.missingOnRemote > 0;
|
|
1588
1586
|
const needsToDownload = summary.differentDocuments > 0 || summary.missingOnLocal > 0;
|
|
1589
|
-
const [classNames, setClassNames] = (0,
|
|
1590
|
-
(0,
|
|
1587
|
+
const [classNames, setClassNames] = (0, import_react25.useState)();
|
|
1588
|
+
(0, import_react25.useEffect)(() => {
|
|
1591
1589
|
setClassNames(void 0);
|
|
1592
1590
|
if (!needsToUpload && !needsToDownload) {
|
|
1593
1591
|
return;
|
|
@@ -1600,37 +1598,37 @@ var SyncStatusIndicator = ({ state }) => {
|
|
|
1600
1598
|
needsToUpload,
|
|
1601
1599
|
needsToDownload
|
|
1602
1600
|
]);
|
|
1603
|
-
return /* @__PURE__ */
|
|
1601
|
+
return /* @__PURE__ */ import_react25.default.createElement(import_plugin_status_bar2.StatusBar.Item, null, /* @__PURE__ */ import_react25.default.createElement(import_react_ui17.Popover.Root, null, /* @__PURE__ */ import_react25.default.createElement(import_react_ui17.Popover.Trigger, null, /* @__PURE__ */ import_react25.default.createElement(import_react_ui17.Icon, {
|
|
1604
1602
|
icon: offline ? "ph--cloud-x--regular" : needsToUpload ? "ph--cloud-arrow-up--regular" : needsToDownload ? "ph--cloud-arrow-down--regular" : "ph--cloud-check--regular",
|
|
1605
1603
|
size: 4,
|
|
1606
1604
|
classNames
|
|
1607
|
-
})), /* @__PURE__ */
|
|
1605
|
+
})), /* @__PURE__ */ import_react25.default.createElement(import_react_ui17.Popover.Content, null, /* @__PURE__ */ import_react25.default.createElement(SyncStatusDetail, {
|
|
1608
1606
|
state,
|
|
1609
1607
|
summary,
|
|
1610
1608
|
debug: false
|
|
1611
1609
|
}))));
|
|
1612
1610
|
};
|
|
1613
1611
|
var SyncStatusDetail = ({ classNames, state, summary, debug }) => {
|
|
1614
|
-
const { t } = (0,
|
|
1612
|
+
const { t } = (0, import_react_ui17.useTranslation)(import_chunk_P4XUXM7Y.SPACE_PLUGIN);
|
|
1615
1613
|
const entries = Object.entries(state).sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0);
|
|
1616
|
-
return /* @__PURE__ */
|
|
1617
|
-
className: (0,
|
|
1618
|
-
}, /* @__PURE__ */
|
|
1614
|
+
return /* @__PURE__ */ import_react25.default.createElement("div", {
|
|
1615
|
+
className: (0, import_react_ui_theme7.mx)("flex flex-col text-xs min-w-[16rem]", classNames)
|
|
1616
|
+
}, /* @__PURE__ */ import_react25.default.createElement("h1", {
|
|
1619
1617
|
className: "p-2"
|
|
1620
|
-
}, t("sync status title")), /* @__PURE__ */
|
|
1618
|
+
}, t("sync status title")), /* @__PURE__ */ import_react25.default.createElement("div", {
|
|
1621
1619
|
className: "flex flex-col gap-[2px] my-[2px]"
|
|
1622
|
-
}, entries.map(([spaceId, state2]) => /* @__PURE__ */
|
|
1620
|
+
}, entries.map(([spaceId, state2]) => /* @__PURE__ */ import_react25.default.createElement(SpaceRow, {
|
|
1623
1621
|
key: spaceId,
|
|
1624
1622
|
spaceId,
|
|
1625
1623
|
state: state2
|
|
1626
|
-
}))), debug && /* @__PURE__ */
|
|
1624
|
+
}))), debug && /* @__PURE__ */ import_react25.default.createElement(import_react_ui_syntax_highlighter.SyntaxHighlighter, {
|
|
1627
1625
|
language: "json"
|
|
1628
1626
|
}, JSON.stringify(summary, null, 2)));
|
|
1629
1627
|
};
|
|
1630
1628
|
var useActive = (count) => {
|
|
1631
|
-
const [current, setCurrent] = (0,
|
|
1632
|
-
const [active, setActive] = (0,
|
|
1633
|
-
(0,
|
|
1629
|
+
const [current, setCurrent] = (0, import_react25.useState)(count);
|
|
1630
|
+
const [active, setActive] = (0, import_react25.useState)(false);
|
|
1631
|
+
(0, import_react25.useEffect)(() => {
|
|
1634
1632
|
let t;
|
|
1635
1633
|
if (count !== current) {
|
|
1636
1634
|
setActive(true);
|
|
@@ -1653,17 +1651,17 @@ var useActive = (count) => {
|
|
|
1653
1651
|
var SpaceRow = ({ spaceId, state: { localDocumentCount, remoteDocumentCount, missingOnLocal, missingOnRemote } }) => {
|
|
1654
1652
|
const downActive = useActive(localDocumentCount);
|
|
1655
1653
|
const upActive = useActive(remoteDocumentCount);
|
|
1656
|
-
return /* @__PURE__ */
|
|
1657
|
-
className: (0,
|
|
1654
|
+
return /* @__PURE__ */ import_react25.default.createElement("div", {
|
|
1655
|
+
className: (0, import_react_ui_theme7.mx)("flex items-center mx-[2px] gap-[2px] cursor-pointer", styles.barHover),
|
|
1658
1656
|
title: spaceId,
|
|
1659
1657
|
onClick: () => {
|
|
1660
1658
|
void navigator.clipboard.writeText(spaceId);
|
|
1661
1659
|
}
|
|
1662
|
-
}, /* @__PURE__ */
|
|
1660
|
+
}, /* @__PURE__ */ import_react25.default.createElement(import_react_ui17.Icon, {
|
|
1663
1661
|
icon: "ph--arrow-fat-line-left--regular",
|
|
1664
1662
|
size: 3,
|
|
1665
|
-
classNames: (0,
|
|
1666
|
-
}), /* @__PURE__ */
|
|
1663
|
+
classNames: (0, import_react_ui_theme7.mx)(downActive && "animate-[pulse_1s_infinite]")
|
|
1664
|
+
}), /* @__PURE__ */ import_react25.default.createElement(Candle, {
|
|
1667
1665
|
up: {
|
|
1668
1666
|
count: remoteDocumentCount,
|
|
1669
1667
|
total: remoteDocumentCount + missingOnRemote
|
|
@@ -1673,44 +1671,44 @@ var SpaceRow = ({ spaceId, state: { localDocumentCount, remoteDocumentCount, mis
|
|
|
1673
1671
|
total: localDocumentCount + missingOnLocal
|
|
1674
1672
|
},
|
|
1675
1673
|
title: spaceId
|
|
1676
|
-
}), /* @__PURE__ */
|
|
1674
|
+
}), /* @__PURE__ */ import_react25.default.createElement(import_react_ui17.Icon, {
|
|
1677
1675
|
icon: "ph--arrow-fat-line-right--regular",
|
|
1678
1676
|
size: 3,
|
|
1679
|
-
classNames: (0,
|
|
1677
|
+
classNames: (0, import_react_ui_theme7.mx)(upActive && "animate-[pulse_1s_step-start_infinite]")
|
|
1680
1678
|
}));
|
|
1681
1679
|
};
|
|
1682
1680
|
var Candle = ({ classNames, up, down }) => {
|
|
1683
|
-
return /* @__PURE__ */
|
|
1684
|
-
className: (0,
|
|
1685
|
-
}, /* @__PURE__ */
|
|
1681
|
+
return /* @__PURE__ */ import_react25.default.createElement("div", {
|
|
1682
|
+
className: (0, import_react_ui_theme7.mx)("grid grid-cols-[1fr_2rem_1fr] w-full h-3", classNames)
|
|
1683
|
+
}, /* @__PURE__ */ import_react25.default.createElement(Bar, {
|
|
1686
1684
|
classNames: "justify-end",
|
|
1687
1685
|
...up
|
|
1688
|
-
}), /* @__PURE__ */
|
|
1686
|
+
}), /* @__PURE__ */ import_react25.default.createElement("div", {
|
|
1689
1687
|
className: "relative"
|
|
1690
|
-
}, /* @__PURE__ */
|
|
1691
|
-
className: (0,
|
|
1692
|
-
}, up.total)), /* @__PURE__ */
|
|
1688
|
+
}, /* @__PURE__ */ import_react25.default.createElement("div", {
|
|
1689
|
+
className: (0, import_react_ui_theme7.mx)("absolute inset-0 flex items-center justify-center text-xs", styles.barBg)
|
|
1690
|
+
}, up.total)), /* @__PURE__ */ import_react25.default.createElement(Bar, down));
|
|
1693
1691
|
};
|
|
1694
1692
|
var Bar = ({ classNames, count, total }) => {
|
|
1695
1693
|
let p = count / total * 100;
|
|
1696
1694
|
if (count < total) {
|
|
1697
1695
|
p = Math.min(p, 95);
|
|
1698
1696
|
}
|
|
1699
|
-
return /* @__PURE__ */
|
|
1700
|
-
className: (0,
|
|
1701
|
-
}, /* @__PURE__ */
|
|
1702
|
-
className: (0,
|
|
1697
|
+
return /* @__PURE__ */ import_react25.default.createElement("div", {
|
|
1698
|
+
className: (0, import_react_ui_theme7.mx)("relative flex w-full", styles.barBg, classNames)
|
|
1699
|
+
}, /* @__PURE__ */ import_react25.default.createElement("div", {
|
|
1700
|
+
className: (0, import_react_ui_theme7.mx)("shrink-0", styles.barFg),
|
|
1703
1701
|
style: {
|
|
1704
1702
|
width: `${p}%`
|
|
1705
1703
|
}
|
|
1706
|
-
}), count !== total && /* @__PURE__ */
|
|
1704
|
+
}), count !== total && /* @__PURE__ */ import_react25.default.createElement("div", {
|
|
1707
1705
|
className: "absolute top-0 bottom-0 flex items-center mx-0.5 text-black text-xs"
|
|
1708
1706
|
}, count));
|
|
1709
1707
|
};
|
|
1710
1708
|
var translations_default = [
|
|
1711
1709
|
{
|
|
1712
1710
|
"en-US": {
|
|
1713
|
-
[
|
|
1711
|
+
[import_chunk_P4XUXM7Y.SPACE_PLUGIN]: {
|
|
1714
1712
|
"plugin name": "Spaces",
|
|
1715
1713
|
"first run message": "Nothing selected.",
|
|
1716
1714
|
"create space label": "Create a new space",
|
|
@@ -1787,7 +1785,9 @@ var translations_default = [
|
|
|
1787
1785
|
"remove deleted objects alt": "Permanently remove deleted objects to free up space.",
|
|
1788
1786
|
"copy link label": "Copy link",
|
|
1789
1787
|
"default on space create label": "On space create",
|
|
1790
|
-
"sync status title": "Sync status"
|
|
1788
|
+
"sync status title": "Sync status",
|
|
1789
|
+
"name label": "Name",
|
|
1790
|
+
"name placeholder": "Name"
|
|
1791
1791
|
}
|
|
1792
1792
|
}
|
|
1793
1793
|
}
|
|
@@ -1799,10 +1799,10 @@ var SPACE_MAX_OBJECTS = 500;
|
|
|
1799
1799
|
var DIRECTORY_TYPE = "text/directory";
|
|
1800
1800
|
var parseSpacePlugin = (plugin) => Array.isArray(plugin?.provides.space?.enabled) ? plugin : void 0;
|
|
1801
1801
|
var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
1802
|
-
const settings = new import_local_storage.LocalStorageStore(
|
|
1802
|
+
const settings = new import_local_storage.LocalStorageStore(import_chunk_P4XUXM7Y.SPACE_PLUGIN, {
|
|
1803
1803
|
onSpaceCreate: "dxos.org/plugin/markdown/action/create"
|
|
1804
1804
|
});
|
|
1805
|
-
const state = new import_local_storage.LocalStorageStore(
|
|
1805
|
+
const state = new import_local_storage.LocalStorageStore(import_chunk_P4XUXM7Y.SPACE_PLUGIN, {
|
|
1806
1806
|
awaiting: void 0,
|
|
1807
1807
|
spaceNames: {},
|
|
1808
1808
|
viewersByObject: {},
|
|
@@ -1841,17 +1841,21 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
1841
1841
|
await defaultSpace.internal.migrate();
|
|
1842
1842
|
}
|
|
1843
1843
|
spaces.filter((space) => space.state.get() === import_echo.SpaceState.SPACE_READY).forEach((space) => {
|
|
1844
|
-
subscriptions.add((0,
|
|
1845
|
-
|
|
1846
|
-
}));
|
|
1844
|
+
subscriptions.add((0, import_core.scheduledEffect)(() => ({
|
|
1845
|
+
name: space.properties.name
|
|
1846
|
+
}), ({ name }) => state.values.spaceNames[space.id] = name));
|
|
1847
1847
|
});
|
|
1848
1848
|
}).unsubscribe);
|
|
1849
|
-
subscriptions.add((0,
|
|
1849
|
+
subscriptions.add((0, import_core.scheduledEffect)(() => ({
|
|
1850
|
+
ids: (0, import_app_framework.openIds)(location.active),
|
|
1851
|
+
removed: location.closed ? [
|
|
1852
|
+
location.closed
|
|
1853
|
+
].flat() : []
|
|
1854
|
+
}), ({ ids, removed }) => {
|
|
1850
1855
|
const send = () => {
|
|
1851
1856
|
const spaces = client.spaces.get();
|
|
1852
1857
|
const identity = client.halo.identity.get();
|
|
1853
1858
|
if (identity && location.active) {
|
|
1854
|
-
const ids = (0, import_app_framework.openIds)(location.active);
|
|
1855
1859
|
const idsBySpace = (0, import_util.reduceGroupBy)(ids, (id) => {
|
|
1856
1860
|
const [spaceId] = id.split(":");
|
|
1857
1861
|
return spaceId;
|
|
@@ -1866,9 +1870,6 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
1866
1870
|
if (!space) {
|
|
1867
1871
|
continue;
|
|
1868
1872
|
}
|
|
1869
|
-
const removed = location.closed ? [
|
|
1870
|
-
location.closed
|
|
1871
|
-
].flat() : [];
|
|
1872
1873
|
void space.postMessage("viewing", {
|
|
1873
1874
|
identityKey: identity.identityKey.toHex(),
|
|
1874
1875
|
attended: attention.attended ? [
|
|
@@ -1882,7 +1883,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
1882
1883
|
err: err.message
|
|
1883
1884
|
}, {
|
|
1884
1885
|
F: __dxlog_file5,
|
|
1885
|
-
L:
|
|
1886
|
+
L: 228,
|
|
1886
1887
|
S: void 0,
|
|
1887
1888
|
C: (f, a) => f(...a)
|
|
1888
1889
|
});
|
|
@@ -1928,7 +1929,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
1928
1929
|
}).unsubscribe);
|
|
1929
1930
|
};
|
|
1930
1931
|
return {
|
|
1931
|
-
meta:
|
|
1932
|
+
meta: import_chunk_P4XUXM7Y.meta_default,
|
|
1932
1933
|
ready: async (plugins) => {
|
|
1933
1934
|
settings.prop({
|
|
1934
1935
|
key: "showHidden",
|
|
@@ -1953,7 +1954,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
1953
1954
|
const dispatch = intentPlugin.provides.intent.dispatch;
|
|
1954
1955
|
const handleFirstRun = async () => {
|
|
1955
1956
|
const defaultSpace = client.spaces.default;
|
|
1956
|
-
defaultSpace.properties[
|
|
1957
|
+
defaultSpace.properties[import_chunk_HE2GHO6Z.CollectionType.typename] = (0, import_echo.create)(import_chunk_HE2GHO6Z.CollectionType, {
|
|
1957
1958
|
objects: [],
|
|
1958
1959
|
views: {}
|
|
1959
1960
|
});
|
|
@@ -1996,11 +1997,11 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
1996
1997
|
}) : null,
|
|
1997
1998
|
metadata: {
|
|
1998
1999
|
records: {
|
|
1999
|
-
[
|
|
2000
|
+
[import_chunk_HE2GHO6Z.CollectionType.typename]: {
|
|
2000
2001
|
placeholder: [
|
|
2001
2002
|
"unnamed collection label",
|
|
2002
2003
|
{
|
|
2003
|
-
ns:
|
|
2004
|
+
ns: import_chunk_P4XUXM7Y.SPACE_PLUGIN
|
|
2004
2005
|
}
|
|
2005
2006
|
],
|
|
2006
2007
|
icon: "ph--cards-three--regular",
|
|
@@ -2014,7 +2015,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2014
2015
|
},
|
|
2015
2016
|
echo: {
|
|
2016
2017
|
schema: [
|
|
2017
|
-
|
|
2018
|
+
import_chunk_HE2GHO6Z.CollectionType
|
|
2018
2019
|
]
|
|
2019
2020
|
},
|
|
2020
2021
|
surface: {
|
|
@@ -2025,12 +2026,12 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2025
2026
|
case "main":
|
|
2026
2027
|
return (0, import_echo.isSpace)(primary) && primary.state.get() === import_echo.SpaceState.SPACE_READY ? /* @__PURE__ */ import_react.default.createElement(import_app_framework.Surface, {
|
|
2027
2028
|
data: {
|
|
2028
|
-
active: primary.properties[
|
|
2029
|
+
active: primary.properties[import_chunk_HE2GHO6Z.CollectionType.typename],
|
|
2029
2030
|
id: primary.id
|
|
2030
2031
|
},
|
|
2031
2032
|
role,
|
|
2032
2033
|
...rest
|
|
2033
|
-
}) : primary instanceof
|
|
2034
|
+
}) : primary instanceof import_chunk_HE2GHO6Z.CollectionType ? {
|
|
2034
2035
|
node: /* @__PURE__ */ import_react.default.createElement(CollectionMain, {
|
|
2035
2036
|
collection: primary
|
|
2036
2037
|
}),
|
|
@@ -2038,16 +2039,10 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2038
2039
|
} : typeof primary === "string" && primary.length === OBJECT_ID_LENGTH ? /* @__PURE__ */ import_react.default.createElement(MissingObject, {
|
|
2039
2040
|
id: primary
|
|
2040
2041
|
}) : null;
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
return /* @__PURE__ */ import_react.default.createElement(EmptyTree, null);
|
|
2046
|
-
case ((0, import_plugin_graph.isGraphNode)(data.activeNode) && (0, import_echo.isSpace)(data.activeNode.data)):
|
|
2047
|
-
return /* @__PURE__ */ import_react.default.createElement(EmptySpace, null);
|
|
2048
|
-
default:
|
|
2049
|
-
return null;
|
|
2050
|
-
}
|
|
2042
|
+
case "complementary--settings":
|
|
2043
|
+
return (0, import_echo.isEchoObject)(data.subject) ? /* @__PURE__ */ import_react.default.createElement(FallbackSettings, {
|
|
2044
|
+
object: data.subject
|
|
2045
|
+
}) : null;
|
|
2051
2046
|
case "dialog":
|
|
2052
2047
|
if (data.component === "dxos.org/plugin/space/InvitationManagerDialog") {
|
|
2053
2048
|
return /* @__PURE__ */ import_react.default.createElement(import_react_ui.Dialog.Content, null, /* @__PURE__ */ import_react.default.createElement(import_react2.ClipboardProvider, null, /* @__PURE__ */ import_react.default.createElement(import_react2.InvitationManager, {
|
|
@@ -2069,6 +2064,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2069
2064
|
});
|
|
2070
2065
|
}
|
|
2071
2066
|
return null;
|
|
2067
|
+
// TODO(burdon): Add role name syntax to minimal plugin docs.
|
|
2072
2068
|
case "presence--glyph": {
|
|
2073
2069
|
return (0, import_echo_schema.isReactiveObject)(data.object) ? /* @__PURE__ */ import_react.default.createElement(SmallPresenceLive, {
|
|
2074
2070
|
viewers: state.values.viewersByObject[(0, import_echo.fullyQualifiedId)(data.object)]
|
|
@@ -2084,7 +2080,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2084
2080
|
return null;
|
|
2085
2081
|
}
|
|
2086
2082
|
const space = (0, import_echo.isSpace)(data.object) ? data.object : (0, import_echo.getSpace)(data.object);
|
|
2087
|
-
const object = (0, import_echo.isSpace)(data.object) ? data.object.state.get() === import_echo.SpaceState.SPACE_READY ? space?.properties[
|
|
2083
|
+
const object = (0, import_echo.isSpace)(data.object) ? data.object.state.get() === import_echo.SpaceState.SPACE_READY ? space?.properties[import_chunk_HE2GHO6Z.CollectionType.typename] : void 0 : data.object;
|
|
2088
2084
|
return space && object ? {
|
|
2089
2085
|
node: /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(SpacePresence, {
|
|
2090
2086
|
object
|
|
@@ -2095,11 +2091,11 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2095
2091
|
} : null;
|
|
2096
2092
|
}
|
|
2097
2093
|
case "section":
|
|
2098
|
-
return data.object instanceof
|
|
2094
|
+
return data.object instanceof import_chunk_HE2GHO6Z.CollectionType ? /* @__PURE__ */ import_react.default.createElement(CollectionSection, {
|
|
2099
2095
|
collection: data.object
|
|
2100
2096
|
}) : null;
|
|
2101
2097
|
case "settings":
|
|
2102
|
-
return data.plugin ===
|
|
2098
|
+
return data.plugin === import_chunk_P4XUXM7Y.meta_default.id ? /* @__PURE__ */ import_react.default.createElement(SpaceSettings, {
|
|
2103
2099
|
settings: settings.values
|
|
2104
2100
|
}) : null;
|
|
2105
2101
|
case "menu-footer":
|
|
@@ -2133,7 +2129,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2133
2129
|
return [
|
|
2134
2130
|
// Create spaces group node.
|
|
2135
2131
|
(0, import_plugin_graph.createExtension)({
|
|
2136
|
-
id: `${
|
|
2132
|
+
id: `${import_chunk_P4XUXM7Y.SPACE_PLUGIN}/root`,
|
|
2137
2133
|
filter: (node) => node.id === "root",
|
|
2138
2134
|
connector: () => {
|
|
2139
2135
|
const isReady = (0, import_plugin_graph.toSignal)((onChange) => {
|
|
@@ -2156,7 +2152,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2156
2152
|
label: [
|
|
2157
2153
|
"spaces label",
|
|
2158
2154
|
{
|
|
2159
|
-
ns:
|
|
2155
|
+
ns: import_chunk_P4XUXM7Y.SPACE_PLUGIN
|
|
2160
2156
|
}
|
|
2161
2157
|
],
|
|
2162
2158
|
palette: "teal",
|
|
@@ -2173,7 +2169,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2173
2169
|
} else {
|
|
2174
2170
|
import_log.log.warn("spaces order object not found", void 0, {
|
|
2175
2171
|
F: __dxlog_file5,
|
|
2176
|
-
L:
|
|
2172
|
+
L: 525,
|
|
2177
2173
|
S: void 0,
|
|
2178
2174
|
C: (f, a) => f(...a)
|
|
2179
2175
|
});
|
|
@@ -2190,12 +2186,12 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2190
2186
|
filter: (node) => node.id === SPACES,
|
|
2191
2187
|
actions: () => [
|
|
2192
2188
|
{
|
|
2193
|
-
id:
|
|
2189
|
+
id: import_chunk_P4XUXM7Y.SpaceAction.CREATE,
|
|
2194
2190
|
data: async () => {
|
|
2195
2191
|
await dispatch([
|
|
2196
2192
|
{
|
|
2197
|
-
plugin:
|
|
2198
|
-
action:
|
|
2193
|
+
plugin: import_chunk_P4XUXM7Y.SPACE_PLUGIN,
|
|
2194
|
+
action: import_chunk_P4XUXM7Y.SpaceAction.CREATE
|
|
2199
2195
|
},
|
|
2200
2196
|
{
|
|
2201
2197
|
action: import_app_framework.NavigationAction.OPEN
|
|
@@ -2206,7 +2202,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2206
2202
|
label: [
|
|
2207
2203
|
"create space label",
|
|
2208
2204
|
{
|
|
2209
|
-
ns:
|
|
2205
|
+
ns: import_chunk_P4XUXM7Y.SPACE_PLUGIN
|
|
2210
2206
|
}
|
|
2211
2207
|
],
|
|
2212
2208
|
icon: "ph--plus--regular",
|
|
@@ -2215,12 +2211,12 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2215
2211
|
}
|
|
2216
2212
|
},
|
|
2217
2213
|
{
|
|
2218
|
-
id:
|
|
2214
|
+
id: import_chunk_P4XUXM7Y.SpaceAction.JOIN,
|
|
2219
2215
|
data: async () => {
|
|
2220
2216
|
await dispatch([
|
|
2221
2217
|
{
|
|
2222
|
-
plugin:
|
|
2223
|
-
action:
|
|
2218
|
+
plugin: import_chunk_P4XUXM7Y.SPACE_PLUGIN,
|
|
2219
|
+
action: import_chunk_P4XUXM7Y.SpaceAction.JOIN
|
|
2224
2220
|
},
|
|
2225
2221
|
{
|
|
2226
2222
|
action: import_app_framework.NavigationAction.OPEN
|
|
@@ -2231,7 +2227,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2231
2227
|
label: [
|
|
2232
2228
|
"join space label",
|
|
2233
2229
|
{
|
|
2234
|
-
ns:
|
|
2230
|
+
ns: import_chunk_P4XUXM7Y.SPACE_PLUGIN
|
|
2235
2231
|
}
|
|
2236
2232
|
],
|
|
2237
2233
|
icon: "ph--sign-in--regular",
|
|
@@ -2266,7 +2262,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2266
2262
|
}),
|
|
2267
2263
|
// Find an object by its fully qualified id.
|
|
2268
2264
|
(0, import_plugin_graph.createExtension)({
|
|
2269
|
-
id: `${
|
|
2265
|
+
id: `${import_chunk_P4XUXM7Y.SPACE_PLUGIN}/objects`,
|
|
2270
2266
|
resolver: ({ id }) => {
|
|
2271
2267
|
const [spaceId, objectId] = id.split(":");
|
|
2272
2268
|
const space = client.spaces.get().find((space2) => space2.id === spaceId);
|
|
@@ -2296,7 +2292,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2296
2292
|
}),
|
|
2297
2293
|
// Create space actions and action groups.
|
|
2298
2294
|
(0, import_plugin_graph.createExtension)({
|
|
2299
|
-
id: `${
|
|
2295
|
+
id: `${import_chunk_P4XUXM7Y.SPACE_PLUGIN}/actions`,
|
|
2300
2296
|
filter: (node) => (0, import_echo.isSpace)(node.data),
|
|
2301
2297
|
actionGroups: ({ node }) => constructSpaceActionGroups({
|
|
2302
2298
|
space: node.data,
|
|
@@ -2314,7 +2310,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2314
2310
|
}),
|
|
2315
2311
|
// Create nodes for objects in the root collection of a space.
|
|
2316
2312
|
(0, import_plugin_graph.createExtension)({
|
|
2317
|
-
id: `${
|
|
2313
|
+
id: `${import_chunk_P4XUXM7Y.SPACE_PLUGIN}/root-collection`,
|
|
2318
2314
|
filter: (node) => (0, import_echo.isSpace)(node.data),
|
|
2319
2315
|
connector: ({ node }) => {
|
|
2320
2316
|
const space = node.data;
|
|
@@ -2322,7 +2318,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2322
2318
|
if (state2 !== import_echo.SpaceState.SPACE_READY) {
|
|
2323
2319
|
return;
|
|
2324
2320
|
}
|
|
2325
|
-
const collection = space.properties[
|
|
2321
|
+
const collection = space.properties[import_chunk_HE2GHO6Z.CollectionType.typename];
|
|
2326
2322
|
if (!collection) {
|
|
2327
2323
|
return;
|
|
2328
2324
|
}
|
|
@@ -2335,7 +2331,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2335
2331
|
}),
|
|
2336
2332
|
// Create collection actions and action groups.
|
|
2337
2333
|
(0, import_plugin_graph.createExtension)({
|
|
2338
|
-
id: `${
|
|
2334
|
+
id: `${import_chunk_P4XUXM7Y.SPACE_PLUGIN}/object-actions`,
|
|
2339
2335
|
filter: (node) => (0, import_echo.isEchoObject)(node.data),
|
|
2340
2336
|
actionGroups: ({ node }) => constructObjectActionGroups({
|
|
2341
2337
|
object: node.data,
|
|
@@ -2348,8 +2344,8 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2348
2344
|
}),
|
|
2349
2345
|
// Create nodes for objects in collections.
|
|
2350
2346
|
(0, import_plugin_graph.createExtension)({
|
|
2351
|
-
id: `${
|
|
2352
|
-
filter: (node) => node.data instanceof
|
|
2347
|
+
id: `${import_chunk_P4XUXM7Y.SPACE_PLUGIN}/collection-objects`,
|
|
2348
|
+
filter: (node) => node.data instanceof import_chunk_HE2GHO6Z.CollectionType,
|
|
2353
2349
|
connector: ({ node }) => {
|
|
2354
2350
|
const collection = node.data;
|
|
2355
2351
|
const space = (0, import_echo.getSpace)(collection);
|
|
@@ -2362,6 +2358,45 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2362
2358
|
resolve
|
|
2363
2359
|
})).filter(import_util.nonNullable);
|
|
2364
2360
|
}
|
|
2361
|
+
}),
|
|
2362
|
+
// Create nodes for object settings.
|
|
2363
|
+
(0, import_plugin_graph.createExtension)({
|
|
2364
|
+
id: `${import_chunk_P4XUXM7Y.SPACE_PLUGIN}/settings-for-subject`,
|
|
2365
|
+
resolver: ({ id }) => {
|
|
2366
|
+
if (!id.endsWith("~settings")) {
|
|
2367
|
+
return;
|
|
2368
|
+
}
|
|
2369
|
+
const [subjectId] = id.split("~");
|
|
2370
|
+
const [spaceId, objectId] = (0, import_echo.parseFullyQualifiedId)(subjectId);
|
|
2371
|
+
const space = client.spaces.get().find((space2) => space2.id === spaceId);
|
|
2372
|
+
const object = (0, import_plugin_graph.toSignal)((onChange) => {
|
|
2373
|
+
const timeout = setTimeout(async () => {
|
|
2374
|
+
await space?.db.loadObjectById(objectId);
|
|
2375
|
+
onChange();
|
|
2376
|
+
});
|
|
2377
|
+
return () => clearTimeout(timeout);
|
|
2378
|
+
}, () => space?.db.getObjectById(objectId), subjectId);
|
|
2379
|
+
if (!object || !subjectId) {
|
|
2380
|
+
return;
|
|
2381
|
+
}
|
|
2382
|
+
const meta = resolve((0, import_echo.getTypename)(object) ?? "");
|
|
2383
|
+
const label = meta.label?.(object) || object.name || meta.placeholder || [
|
|
2384
|
+
"unnamed object settings label",
|
|
2385
|
+
{
|
|
2386
|
+
ns: import_chunk_P4XUXM7Y.SPACE_PLUGIN
|
|
2387
|
+
}
|
|
2388
|
+
];
|
|
2389
|
+
return {
|
|
2390
|
+
id,
|
|
2391
|
+
type: "orphan-settings-for-subject",
|
|
2392
|
+
data: null,
|
|
2393
|
+
properties: {
|
|
2394
|
+
icon: "ph--gear--regular",
|
|
2395
|
+
label,
|
|
2396
|
+
object
|
|
2397
|
+
}
|
|
2398
|
+
};
|
|
2399
|
+
}
|
|
2365
2400
|
})
|
|
2366
2401
|
];
|
|
2367
2402
|
},
|
|
@@ -2375,8 +2410,8 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2375
2410
|
inputType: SPACES,
|
|
2376
2411
|
outputType: DIRECTORY_TYPE,
|
|
2377
2412
|
serialize: (node) => ({
|
|
2378
|
-
name: translations_default[0]["en-US"][
|
|
2379
|
-
data: translations_default[0]["en-US"][
|
|
2413
|
+
name: translations_default[0]["en-US"][import_chunk_P4XUXM7Y.SPACE_PLUGIN]["spaces label"],
|
|
2414
|
+
data: translations_default[0]["en-US"][import_chunk_P4XUXM7Y.SPACE_PLUGIN]["spaces label"],
|
|
2380
2415
|
type: DIRECTORY_TYPE
|
|
2381
2416
|
}),
|
|
2382
2417
|
deserialize: () => {
|
|
@@ -2386,14 +2421,14 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2386
2421
|
inputType: SPACE_TYPE,
|
|
2387
2422
|
outputType: DIRECTORY_TYPE,
|
|
2388
2423
|
serialize: (node) => ({
|
|
2389
|
-
name: node.data.properties.name ?? translations_default[0]["en-US"][
|
|
2390
|
-
data: node.data.properties.name ?? translations_default[0]["en-US"][
|
|
2424
|
+
name: node.data.properties.name ?? translations_default[0]["en-US"][import_chunk_P4XUXM7Y.SPACE_PLUGIN]["unnamed space label"],
|
|
2425
|
+
data: node.data.properties.name ?? translations_default[0]["en-US"][import_chunk_P4XUXM7Y.SPACE_PLUGIN]["unnamed space label"],
|
|
2391
2426
|
type: DIRECTORY_TYPE
|
|
2392
2427
|
}),
|
|
2393
2428
|
deserialize: async (data) => {
|
|
2394
2429
|
const result = await dispatch({
|
|
2395
|
-
plugin:
|
|
2396
|
-
action:
|
|
2430
|
+
plugin: import_chunk_P4XUXM7Y.SPACE_PLUGIN,
|
|
2431
|
+
action: import_chunk_P4XUXM7Y.SpaceAction.CREATE,
|
|
2397
2432
|
data: {
|
|
2398
2433
|
name: data.name
|
|
2399
2434
|
}
|
|
@@ -2402,25 +2437,25 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2402
2437
|
}
|
|
2403
2438
|
},
|
|
2404
2439
|
{
|
|
2405
|
-
inputType:
|
|
2440
|
+
inputType: import_chunk_HE2GHO6Z.CollectionType.typename,
|
|
2406
2441
|
outputType: DIRECTORY_TYPE,
|
|
2407
2442
|
serialize: (node) => ({
|
|
2408
|
-
name: node.data.name ?? translations_default[0]["en-US"][
|
|
2409
|
-
data: node.data.name ?? translations_default[0]["en-US"][
|
|
2443
|
+
name: node.data.name ?? translations_default[0]["en-US"][import_chunk_P4XUXM7Y.SPACE_PLUGIN]["unnamed collection label"],
|
|
2444
|
+
data: node.data.name ?? translations_default[0]["en-US"][import_chunk_P4XUXM7Y.SPACE_PLUGIN]["unnamed collection label"],
|
|
2410
2445
|
type: DIRECTORY_TYPE
|
|
2411
2446
|
}),
|
|
2412
2447
|
deserialize: async (data, ancestors) => {
|
|
2413
2448
|
const space = ancestors.find(import_echo.isSpace);
|
|
2414
|
-
const collection = ancestors.findLast((ancestor) => ancestor instanceof
|
|
2449
|
+
const collection = ancestors.findLast((ancestor) => ancestor instanceof import_chunk_HE2GHO6Z.CollectionType) ?? space?.properties[import_chunk_HE2GHO6Z.CollectionType.typename];
|
|
2415
2450
|
if (!space || !collection) {
|
|
2416
2451
|
return;
|
|
2417
2452
|
}
|
|
2418
2453
|
const result = await dispatch({
|
|
2419
|
-
plugin:
|
|
2420
|
-
action:
|
|
2454
|
+
plugin: import_chunk_P4XUXM7Y.SPACE_PLUGIN,
|
|
2455
|
+
action: import_chunk_P4XUXM7Y.SpaceAction.ADD_OBJECT,
|
|
2421
2456
|
data: {
|
|
2422
2457
|
target: collection,
|
|
2423
|
-
object: (0, import_echo.create)(
|
|
2458
|
+
object: (0, import_echo.create)(import_chunk_HE2GHO6Z.CollectionType, {
|
|
2424
2459
|
name: data.name,
|
|
2425
2460
|
objects: [],
|
|
2426
2461
|
views: {}
|
|
@@ -2438,23 +2473,23 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2438
2473
|
const clientPlugin2 = (0, import_app_framework.resolvePlugin)(plugins, import_plugin_client.parseClientPlugin);
|
|
2439
2474
|
const client = clientPlugin2?.provides.client;
|
|
2440
2475
|
switch (intent.action) {
|
|
2441
|
-
case
|
|
2476
|
+
case import_chunk_P4XUXM7Y.SpaceAction.WAIT_FOR_OBJECT: {
|
|
2442
2477
|
state.values.awaiting = intent.data?.id;
|
|
2443
2478
|
return {
|
|
2444
2479
|
data: true
|
|
2445
2480
|
};
|
|
2446
2481
|
}
|
|
2447
|
-
case
|
|
2482
|
+
case import_chunk_P4XUXM7Y.SpaceAction.CREATE: {
|
|
2448
2483
|
if (!client) {
|
|
2449
2484
|
return;
|
|
2450
2485
|
}
|
|
2451
2486
|
const space = await client.spaces.create(intent.data);
|
|
2452
2487
|
await space.waitUntilReady();
|
|
2453
|
-
const collection = (0, import_echo.create)(
|
|
2488
|
+
const collection = (0, import_echo.create)(import_chunk_HE2GHO6Z.CollectionType, {
|
|
2454
2489
|
objects: [],
|
|
2455
2490
|
views: {}
|
|
2456
2491
|
});
|
|
2457
|
-
space.properties[
|
|
2492
|
+
space.properties[import_chunk_HE2GHO6Z.CollectionType.typename] = collection;
|
|
2458
2493
|
if (import_migrations.Migrations.versionProperty) {
|
|
2459
2494
|
space.properties[import_migrations.Migrations.versionProperty] = import_migrations.Migrations.targetVersion;
|
|
2460
2495
|
}
|
|
@@ -2478,7 +2513,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2478
2513
|
}
|
|
2479
2514
|
},
|
|
2480
2515
|
{
|
|
2481
|
-
action:
|
|
2516
|
+
action: import_chunk_P4XUXM7Y.SpaceAction.ADD_OBJECT,
|
|
2482
2517
|
data: {
|
|
2483
2518
|
target: space
|
|
2484
2519
|
}
|
|
@@ -2502,7 +2537,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2502
2537
|
]
|
|
2503
2538
|
};
|
|
2504
2539
|
}
|
|
2505
|
-
case
|
|
2540
|
+
case import_chunk_P4XUXM7Y.SpaceAction.JOIN: {
|
|
2506
2541
|
if (client) {
|
|
2507
2542
|
const { space } = await client.shell.joinSpace({
|
|
2508
2543
|
invitationCode: intent.data?.invitationCode
|
|
@@ -2536,7 +2571,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2536
2571
|
}
|
|
2537
2572
|
break;
|
|
2538
2573
|
}
|
|
2539
|
-
case
|
|
2574
|
+
case import_chunk_P4XUXM7Y.SpaceAction.SHARE: {
|
|
2540
2575
|
const spaceId = intent.data?.spaceId;
|
|
2541
2576
|
if (clientPlugin2 && typeof spaceId === "string") {
|
|
2542
2577
|
if (!navigationPlugin?.provides.location.active) {
|
|
@@ -2569,7 +2604,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2569
2604
|
}
|
|
2570
2605
|
break;
|
|
2571
2606
|
}
|
|
2572
|
-
case
|
|
2607
|
+
case import_chunk_P4XUXM7Y.SpaceAction.LOCK: {
|
|
2573
2608
|
const space = intent.data?.space;
|
|
2574
2609
|
if ((0, import_echo.isSpace)(space)) {
|
|
2575
2610
|
space.properties[COMPOSER_SPACE_LOCK] = true;
|
|
@@ -2592,7 +2627,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2592
2627
|
}
|
|
2593
2628
|
break;
|
|
2594
2629
|
}
|
|
2595
|
-
case
|
|
2630
|
+
case import_chunk_P4XUXM7Y.SpaceAction.UNLOCK: {
|
|
2596
2631
|
const space = intent.data?.space;
|
|
2597
2632
|
if ((0, import_echo.isSpace)(space)) {
|
|
2598
2633
|
space.properties[COMPOSER_SPACE_LOCK] = false;
|
|
@@ -2615,7 +2650,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2615
2650
|
}
|
|
2616
2651
|
break;
|
|
2617
2652
|
}
|
|
2618
|
-
case
|
|
2653
|
+
case import_chunk_P4XUXM7Y.SpaceAction.RENAME: {
|
|
2619
2654
|
const { caller, space } = intent.data ?? {};
|
|
2620
2655
|
if (typeof caller === "string" && (0, import_echo.isSpace)(space)) {
|
|
2621
2656
|
return {
|
|
@@ -2636,7 +2671,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2636
2671
|
}
|
|
2637
2672
|
break;
|
|
2638
2673
|
}
|
|
2639
|
-
case
|
|
2674
|
+
case import_chunk_P4XUXM7Y.SpaceAction.OPEN: {
|
|
2640
2675
|
const space = intent.data?.space;
|
|
2641
2676
|
if ((0, import_echo.isSpace)(space)) {
|
|
2642
2677
|
await space.open();
|
|
@@ -2646,7 +2681,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2646
2681
|
}
|
|
2647
2682
|
break;
|
|
2648
2683
|
}
|
|
2649
|
-
case
|
|
2684
|
+
case import_chunk_P4XUXM7Y.SpaceAction.CLOSE: {
|
|
2650
2685
|
const space = intent.data?.space;
|
|
2651
2686
|
if ((0, import_echo.isSpace)(space)) {
|
|
2652
2687
|
await space.close();
|
|
@@ -2656,7 +2691,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2656
2691
|
}
|
|
2657
2692
|
break;
|
|
2658
2693
|
}
|
|
2659
|
-
case
|
|
2694
|
+
case import_chunk_P4XUXM7Y.SpaceAction.MIGRATE: {
|
|
2660
2695
|
const space = intent.data?.space;
|
|
2661
2696
|
if ((0, import_echo.isSpace)(space)) {
|
|
2662
2697
|
if (space.state.get() === import_echo.SpaceState.SPACE_REQUIRES_MIGRATION) {
|
|
@@ -2685,7 +2720,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2685
2720
|
}
|
|
2686
2721
|
break;
|
|
2687
2722
|
}
|
|
2688
|
-
case
|
|
2723
|
+
case import_chunk_P4XUXM7Y.SpaceAction.ADD_OBJECT: {
|
|
2689
2724
|
const object = intent.data?.object ?? intent.data?.result;
|
|
2690
2725
|
if (!(0, import_echo_schema.isReactiveObject)(object)) {
|
|
2691
2726
|
return;
|
|
@@ -2704,15 +2739,15 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2704
2739
|
data: {
|
|
2705
2740
|
element: "toast",
|
|
2706
2741
|
subject: {
|
|
2707
|
-
id: `${
|
|
2708
|
-
title: translations_default[0]["en-US"][
|
|
2709
|
-
description: translations_default[0]["en-US"][
|
|
2742
|
+
id: `${import_chunk_P4XUXM7Y.SPACE_PLUGIN}/space-limit`,
|
|
2743
|
+
title: translations_default[0]["en-US"][import_chunk_P4XUXM7Y.SPACE_PLUGIN]["space limit label"],
|
|
2744
|
+
description: translations_default[0]["en-US"][import_chunk_P4XUXM7Y.SPACE_PLUGIN]["space limit description"],
|
|
2710
2745
|
duration: 5e3,
|
|
2711
2746
|
icon: "ph--warning--regular",
|
|
2712
|
-
actionLabel: translations_default[0]["en-US"][
|
|
2713
|
-
actionAlt: translations_default[0]["en-US"][
|
|
2747
|
+
actionLabel: translations_default[0]["en-US"][import_chunk_P4XUXM7Y.SPACE_PLUGIN]["remove deleted objects label"],
|
|
2748
|
+
actionAlt: translations_default[0]["en-US"][import_chunk_P4XUXM7Y.SPACE_PLUGIN]["remove deleted objects alt"],
|
|
2714
2749
|
// TODO(wittjosiah): Use OS namespace.
|
|
2715
|
-
closeLabel: translations_default[0]["en-US"][
|
|
2750
|
+
closeLabel: translations_default[0]["en-US"][import_chunk_P4XUXM7Y.SPACE_PLUGIN]["space limit close label"],
|
|
2716
2751
|
onAction: () => space.db.coreDatabase.unlinkDeletedObjects()
|
|
2717
2752
|
}
|
|
2718
2753
|
}
|
|
@@ -2732,20 +2767,20 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2732
2767
|
]
|
|
2733
2768
|
};
|
|
2734
2769
|
}
|
|
2735
|
-
if (intent.data?.target instanceof
|
|
2770
|
+
if (intent.data?.target instanceof import_chunk_HE2GHO6Z.CollectionType) {
|
|
2736
2771
|
intent.data?.target.objects.push(object);
|
|
2737
2772
|
} else if ((0, import_echo.isSpace)(intent.data?.target)) {
|
|
2738
|
-
const collection = space.properties[
|
|
2739
|
-
if (collection instanceof
|
|
2773
|
+
const collection = space.properties[import_chunk_HE2GHO6Z.CollectionType.typename];
|
|
2774
|
+
if (collection instanceof import_chunk_HE2GHO6Z.CollectionType) {
|
|
2740
2775
|
collection.objects.push(object);
|
|
2741
2776
|
} else {
|
|
2742
|
-
const collection2 = (0, import_echo.create)(
|
|
2777
|
+
const collection2 = (0, import_echo.create)(import_chunk_HE2GHO6Z.CollectionType, {
|
|
2743
2778
|
objects: [
|
|
2744
2779
|
object
|
|
2745
2780
|
],
|
|
2746
2781
|
views: {}
|
|
2747
2782
|
});
|
|
2748
|
-
space.properties[
|
|
2783
|
+
space.properties[import_chunk_HE2GHO6Z.CollectionType.typename] = collection2;
|
|
2749
2784
|
}
|
|
2750
2785
|
}
|
|
2751
2786
|
return {
|
|
@@ -2775,7 +2810,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2775
2810
|
]
|
|
2776
2811
|
};
|
|
2777
2812
|
}
|
|
2778
|
-
case
|
|
2813
|
+
case import_chunk_P4XUXM7Y.SpaceAction.REMOVE_OBJECT: {
|
|
2779
2814
|
const object = intent.data?.object ?? intent.data?.result;
|
|
2780
2815
|
const space = (0, import_echo.getSpace)(object);
|
|
2781
2816
|
if (!((0, import_echo.isEchoObject)(object) && space)) {
|
|
@@ -2785,12 +2820,12 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2785
2820
|
const activeParts = navigationPlugin?.provides.location.active;
|
|
2786
2821
|
const openObjectIds = new Set((0, import_app_framework.openIds)(activeParts ?? {}));
|
|
2787
2822
|
if (!intent.undo && resolve) {
|
|
2788
|
-
const parentCollection = intent.data?.collection ?? space.properties[
|
|
2823
|
+
const parentCollection = intent.data?.collection ?? space.properties[import_chunk_HE2GHO6Z.CollectionType.typename];
|
|
2789
2824
|
const nestedObjects = await getNestedObjects(object, resolve);
|
|
2790
2825
|
const deletionData = {
|
|
2791
2826
|
object,
|
|
2792
2827
|
parentCollection,
|
|
2793
|
-
index: parentCollection instanceof
|
|
2828
|
+
index: parentCollection instanceof import_chunk_HE2GHO6Z.CollectionType ? parentCollection.objects.indexOf(object) : -1,
|
|
2794
2829
|
nestedObjects,
|
|
2795
2830
|
wasActive: [
|
|
2796
2831
|
object,
|
|
@@ -2808,7 +2843,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2808
2843
|
}
|
|
2809
2844
|
});
|
|
2810
2845
|
}
|
|
2811
|
-
if (parentCollection instanceof
|
|
2846
|
+
if (parentCollection instanceof import_chunk_HE2GHO6Z.CollectionType) {
|
|
2812
2847
|
const index = parentCollection.objects.indexOf(object);
|
|
2813
2848
|
if (index !== -1) {
|
|
2814
2849
|
parentCollection.objects.splice(index, 1);
|
|
@@ -2818,18 +2853,18 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2818
2853
|
space.db.remove(obj);
|
|
2819
2854
|
});
|
|
2820
2855
|
space.db.remove(object);
|
|
2821
|
-
const undoMessageKey = object instanceof
|
|
2856
|
+
const undoMessageKey = object instanceof import_chunk_HE2GHO6Z.CollectionType ? "collection deleted label" : "object deleted label";
|
|
2822
2857
|
return {
|
|
2823
2858
|
data: true,
|
|
2824
2859
|
undoable: {
|
|
2825
2860
|
// Consider using a translation key here.
|
|
2826
|
-
message: translations_default[0]["en-US"][
|
|
2861
|
+
message: translations_default[0]["en-US"][import_chunk_P4XUXM7Y.SPACE_PLUGIN][undoMessageKey],
|
|
2827
2862
|
data: deletionData
|
|
2828
2863
|
}
|
|
2829
2864
|
};
|
|
2830
2865
|
} else {
|
|
2831
2866
|
const undoData = intent.data;
|
|
2832
|
-
if (undoData && (0, import_echo.isEchoObject)(undoData.object) && undoData.parentCollection instanceof
|
|
2867
|
+
if (undoData && (0, import_echo.isEchoObject)(undoData.object) && undoData.parentCollection instanceof import_chunk_HE2GHO6Z.CollectionType) {
|
|
2833
2868
|
const restoredObject = space.db.add(undoData.object);
|
|
2834
2869
|
undoData.nestedObjects.forEach((obj) => {
|
|
2835
2870
|
space.db.add(obj);
|
|
@@ -2856,7 +2891,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2856
2891
|
};
|
|
2857
2892
|
}
|
|
2858
2893
|
}
|
|
2859
|
-
case
|
|
2894
|
+
case import_chunk_P4XUXM7Y.SpaceAction.RENAME_OBJECT: {
|
|
2860
2895
|
const object = intent.data?.object ?? intent.data?.result;
|
|
2861
2896
|
const caller = intent.data?.caller;
|
|
2862
2897
|
if ((0, import_echo_schema.isReactiveObject)(object) && caller) {
|
|
@@ -2878,7 +2913,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2878
2913
|
}
|
|
2879
2914
|
break;
|
|
2880
2915
|
}
|
|
2881
|
-
case
|
|
2916
|
+
case import_chunk_P4XUXM7Y.SpaceAction.DUPLICATE_OBJECT: {
|
|
2882
2917
|
const originalObject = intent.data?.object ?? intent.data?.result;
|
|
2883
2918
|
const resolve = (0, import_app_framework.resolvePlugin)(plugins, import_app_framework.parseMetadataResolverPlugin)?.provides.metadata.resolver;
|
|
2884
2919
|
if (!(0, import_echo.isEchoObject)(originalObject) || !resolve) {
|
|
@@ -2889,7 +2924,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2889
2924
|
intents: [
|
|
2890
2925
|
[
|
|
2891
2926
|
{
|
|
2892
|
-
action:
|
|
2927
|
+
action: import_chunk_P4XUXM7Y.SpaceAction.ADD_OBJECT,
|
|
2893
2928
|
data: {
|
|
2894
2929
|
object: newObject,
|
|
2895
2930
|
target: intent.data?.target
|
|
@@ -2899,7 +2934,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2899
2934
|
]
|
|
2900
2935
|
};
|
|
2901
2936
|
}
|
|
2902
|
-
case
|
|
2937
|
+
case import_chunk_P4XUXM7Y.SpaceAction.TOGGLE_HIDDEN: {
|
|
2903
2938
|
settings.values.showHidden = intent.data?.state ?? !settings.values.showHidden;
|
|
2904
2939
|
return {
|
|
2905
2940
|
data: true
|
|
@@ -2922,8 +2957,7 @@ var src_default = SpacePlugin;
|
|
|
2922
2957
|
CollectionSection,
|
|
2923
2958
|
CollectionType,
|
|
2924
2959
|
ContactType,
|
|
2925
|
-
|
|
2926
|
-
EmptyTree,
|
|
2960
|
+
FallbackSettings,
|
|
2927
2961
|
FullPresence,
|
|
2928
2962
|
MenuFooter,
|
|
2929
2963
|
MessageState,
|