@sparkelf/dsh-group-chat 0.1.1 → 0.2.0
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/lib/client.js +839 -221
- package/lib/client.js.map +1 -1
- package/lib/index.js +66 -3
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -233,6 +233,246 @@ window.__ModuleLoader__.load({
|
|
|
233
233
|
* pre-empted here.
|
|
234
234
|
*/
|
|
235
235
|
const dissolveRoom = (roomId) => call(`/rooms/${encodeURIComponent(roomId)}`, { method: "DELETE" });
|
|
236
|
+
/**
|
|
237
|
+
* Searches message text across the rooms this account can read.
|
|
238
|
+
*
|
|
239
|
+
* The room server owns the visibility rule; this only passes the words. An empty query is not
|
|
240
|
+
* sent at all — every message would match it.
|
|
241
|
+
*/
|
|
242
|
+
const searchMessages = (query) => {
|
|
243
|
+
const trimmed = query.trim();
|
|
244
|
+
if (trimmed.length === 0) return Promise.resolve([]);
|
|
245
|
+
return call(`/rooms/messages/search?query=${encodeURIComponent(trimmed)}`);
|
|
246
|
+
};
|
|
247
|
+
/**
|
|
248
|
+
* Registers a pending reply with the host.
|
|
249
|
+
*
|
|
250
|
+
* The message itself is submitted by the official composer, which this plugin neither wraps nor
|
|
251
|
+
* intercepts, so the quote travels beside it rather than inside it: the host attaches it to the
|
|
252
|
+
* next message this member sends in the room and then forgets it.
|
|
253
|
+
*/
|
|
254
|
+
const registerQuote = (roomId, quote) => call(`/rooms/${encodeURIComponent(roomId)}/quote`, {
|
|
255
|
+
method: "POST",
|
|
256
|
+
body: JSON.stringify(quote)
|
|
257
|
+
});
|
|
258
|
+
/** Drops a pending reply that will not be sent. */
|
|
259
|
+
const clearQuote = (roomId) => call(`/rooms/${encodeURIComponent(roomId)}/quote`, { method: "DELETE" });
|
|
260
|
+
//#endregion
|
|
261
|
+
//#region \0dsh-css:/root/projects/dsh-plugins-plus/packages/group-chat/src/client/MessageSearch.module.css.mjs
|
|
262
|
+
const css$10 = ".NBSFYa_root{box-sizing:border-box;flex-direction:column;width:100%;min-width:0;display:flex}.NBSFYa_bar{align-items:center;gap:6px;min-width:0;min-height:28px;padding:0 12px;display:flex}.NBSFYa_toggle{width:24px;height:24px;color:var(--dsw-alias-label-secondary,inherit);cursor:pointer;opacity:.75;background:0 0;border:none;border-radius:6px;flex:none;justify-content:center;align-items:center;padding:0;display:inline-flex}.NBSFYa_toggle:hover,.NBSFYa_toggle[aria-expanded=true]{opacity:1;background:var(--dsw-alias-bg-l2,#ffffff14)}.NBSFYa_toggle:focus-visible{outline:2px solid var(--dsw-alias-brand-primary,currentcolor);outline-offset:1px}.NBSFYa_input{background:var(--dsw-alias-bg-l2,#ffffff0f);min-width:0;height:24px;color:var(--dsw-alias-label-primary,inherit);border:none;border-radius:6px;outline:none;flex:auto;padding:0 6px;font-size:12px}.NBSFYa_input::placeholder{color:var(--dsw-alias-label-secondary,inherit);opacity:.7}.NBSFYa_results{flex-direction:column;gap:2px;max-height:240px;padding:2px 8px 4px;display:flex;overflow-y:auto}.NBSFYa_hint{color:var(--dsw-alias-label-secondary,inherit);opacity:.75;margin:6px 4px;font-size:12px;line-height:16px}.NBSFYa_hit{width:100%;color:inherit;text-align:left;cursor:pointer;background:0 0;border:none;border-radius:6px;flex-direction:column;gap:1px;padding:5px 8px;display:flex}.NBSFYa_hit:hover,.NBSFYa_hit:focus-visible{background:var(--dsw-alias-bg-l2,#ffffff14);outline:none}.NBSFYa_hitHead{min-width:0;color:var(--dsw-alias-label-secondary,inherit);align-items:baseline;gap:6px;font-size:11px;line-height:14px;display:flex}.NBSFYa_hitRoom{flex:none;font-weight:500}.NBSFYa_hitAuthor{text-overflow:ellipsis;white-space:nowrap;opacity:.8;min-width:0;overflow:hidden}.NBSFYa_hitText{text-overflow:ellipsis;white-space:nowrap;min-width:0;font-size:12px;line-height:16px;display:block;overflow:hidden}.NBSFYa_mark{background:var(--dsw-alias-bg-brand-weak,#ffd66659);color:inherit;border-radius:2px;padding:0;font-weight:600}";
|
|
263
|
+
const tagId$10 = "@sparkelf/dsh-group-chat/MessageSearch.module.css";
|
|
264
|
+
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$10) + "]") === null) {
|
|
265
|
+
const tag = document.createElement("style");
|
|
266
|
+
tag.dataset.plugin = "@sparkelf/dsh-group-chat";
|
|
267
|
+
tag.dataset.pluginCss = tagId$10;
|
|
268
|
+
tag.textContent = css$10;
|
|
269
|
+
document.head.appendChild(tag);
|
|
270
|
+
}
|
|
271
|
+
var MessageSearch_module_css_default = {
|
|
272
|
+
"results": "NBSFYa_results",
|
|
273
|
+
"bar": "NBSFYa_bar",
|
|
274
|
+
"hitHead": "NBSFYa_hitHead",
|
|
275
|
+
"hitRoom": "NBSFYa_hitRoom",
|
|
276
|
+
"toggle": "NBSFYa_toggle",
|
|
277
|
+
"hint": "NBSFYa_hint",
|
|
278
|
+
"hit": "NBSFYa_hit",
|
|
279
|
+
"mark": "NBSFYa_mark",
|
|
280
|
+
"root": "NBSFYa_root",
|
|
281
|
+
"input": "NBSFYa_input",
|
|
282
|
+
"hitAuthor": "NBSFYa_hitAuthor",
|
|
283
|
+
"hitText": "NBSFYa_hitText"
|
|
284
|
+
};
|
|
285
|
+
//#endregion
|
|
286
|
+
//#region src/client/MessageSearch.tsx
|
|
287
|
+
/**
|
|
288
|
+
* The message search box and its result list.
|
|
289
|
+
*
|
|
290
|
+
* A separate surface from the room filter above it: that one narrows the list of rooms by name,
|
|
291
|
+
* this one finds text inside them. Combining the two would mean one box whose meaning changes
|
|
292
|
+
* with what it matched, which is the sort of ambiguity that makes a search feel broken.
|
|
293
|
+
*
|
|
294
|
+
* The panel is a list seat in the sidebar footer, below the room rows: results are transient and
|
|
295
|
+
* belong to the moment the reader is looking for something, not beside the rooms they live in.
|
|
296
|
+
*
|
|
297
|
+
* @module @sparkelf/dsh-group-chat/client/MessageSearch
|
|
298
|
+
*/
|
|
299
|
+
/** How long to wait after the last keystroke before asking the server. */
|
|
300
|
+
const DEBOUNCE_MS = 250;
|
|
301
|
+
/**
|
|
302
|
+
* Renders the search field and, once something was typed, the hits.
|
|
303
|
+
*
|
|
304
|
+
* Results are debounced and the newest request wins: typing quickly issues several searches, and
|
|
305
|
+
* an early one resolving late would replace the results of a later, more specific query.
|
|
306
|
+
*/
|
|
307
|
+
/**
|
|
308
|
+
* The hit text with the matched words marked.
|
|
309
|
+
*
|
|
310
|
+
* Splitting on the query rather than rendering the raw string gives the reader the one thing a
|
|
311
|
+
* result list has to offer: where in a long message the words actually are. Case is preserved
|
|
312
|
+
* from the source text; only the comparison is case-insensitive.
|
|
313
|
+
*/
|
|
314
|
+
const highlighted = (text, query) => {
|
|
315
|
+
const needle = query.trim();
|
|
316
|
+
if (needle.length === 0) return text;
|
|
317
|
+
const parts = [];
|
|
318
|
+
const lower = text.toLowerCase();
|
|
319
|
+
const target = needle.toLowerCase();
|
|
320
|
+
let from = 0;
|
|
321
|
+
let at = lower.indexOf(target);
|
|
322
|
+
let key = 0;
|
|
323
|
+
while (at !== -1) {
|
|
324
|
+
if (at > from) parts.push(text.slice(from, at));
|
|
325
|
+
parts.push(/* @__PURE__ */ (0, react_jsx_runtime.jsx)("mark", {
|
|
326
|
+
className: MessageSearch_module_css_default["mark"],
|
|
327
|
+
children: text.slice(at, at + needle.length)
|
|
328
|
+
}, key));
|
|
329
|
+
key += 1;
|
|
330
|
+
from = at + needle.length;
|
|
331
|
+
at = lower.indexOf(target, from);
|
|
332
|
+
}
|
|
333
|
+
if (from < text.length) parts.push(text.slice(from));
|
|
334
|
+
return parts;
|
|
335
|
+
};
|
|
336
|
+
const MessageSearch = (props) => {
|
|
337
|
+
const { t, onOpen } = props;
|
|
338
|
+
const [open, setOpen] = (0, react.useState)(false);
|
|
339
|
+
const [query, setQuery] = (0, react.useState)("");
|
|
340
|
+
const [hits, setHits] = (0, react.useState)([]);
|
|
341
|
+
const [busy, setBusy] = (0, react.useState)(false);
|
|
342
|
+
const input = (0, react.useRef)(null);
|
|
343
|
+
/** Increments per issued search, so a stale response can be recognized and dropped. */
|
|
344
|
+
const issued = (0, react.useRef)(0);
|
|
345
|
+
(0, react.useEffect)(() => {
|
|
346
|
+
if (!open) return;
|
|
347
|
+
const trimmed = query.trim();
|
|
348
|
+
if (trimmed.length === 0) {
|
|
349
|
+
setHits([]);
|
|
350
|
+
setBusy(false);
|
|
351
|
+
return;
|
|
352
|
+
}
|
|
353
|
+
const ticket = issued.current + 1;
|
|
354
|
+
issued.current = ticket;
|
|
355
|
+
setBusy(true);
|
|
356
|
+
const timer = setTimeout(() => {
|
|
357
|
+
searchMessages(trimmed).then((found) => {
|
|
358
|
+
if (issued.current === ticket) setHits(found);
|
|
359
|
+
}).catch(() => {
|
|
360
|
+
if (issued.current === ticket) setHits([]);
|
|
361
|
+
}).finally(() => {
|
|
362
|
+
if (issued.current === ticket) setBusy(false);
|
|
363
|
+
});
|
|
364
|
+
}, DEBOUNCE_MS);
|
|
365
|
+
return () => {
|
|
366
|
+
clearTimeout(timer);
|
|
367
|
+
};
|
|
368
|
+
}, [query, open]);
|
|
369
|
+
(0, react.useEffect)(() => {
|
|
370
|
+
if (!open) return;
|
|
371
|
+
const onKey = (event) => {
|
|
372
|
+
if (event.key !== "Escape") return;
|
|
373
|
+
setQuery("");
|
|
374
|
+
setHits([]);
|
|
375
|
+
setOpen(false);
|
|
376
|
+
};
|
|
377
|
+
document.addEventListener("keydown", onKey);
|
|
378
|
+
return () => {
|
|
379
|
+
document.removeEventListener("keydown", onKey);
|
|
380
|
+
};
|
|
381
|
+
}, [open]);
|
|
382
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
383
|
+
className: MessageSearch_module_css_default["root"],
|
|
384
|
+
"data-group-chat-message-search": "",
|
|
385
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
386
|
+
className: MessageSearch_module_css_default["bar"],
|
|
387
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
388
|
+
type: "button",
|
|
389
|
+
className: MessageSearch_module_css_default["toggle"],
|
|
390
|
+
"aria-label": t("searchMessages"),
|
|
391
|
+
"aria-expanded": open,
|
|
392
|
+
title: t("searchMessages"),
|
|
393
|
+
onClick: () => {
|
|
394
|
+
setOpen((was) => {
|
|
395
|
+
const next = !was;
|
|
396
|
+
if (next) requestAnimationFrame(() => {
|
|
397
|
+
input.current?.focus();
|
|
398
|
+
});
|
|
399
|
+
else {
|
|
400
|
+
setQuery("");
|
|
401
|
+
setHits([]);
|
|
402
|
+
}
|
|
403
|
+
return next;
|
|
404
|
+
});
|
|
405
|
+
},
|
|
406
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
|
|
407
|
+
width: "14",
|
|
408
|
+
height: "14",
|
|
409
|
+
viewBox: "0 0 16 16",
|
|
410
|
+
fill: "none",
|
|
411
|
+
stroke: "currentColor",
|
|
412
|
+
strokeWidth: "1.4",
|
|
413
|
+
strokeLinecap: "round",
|
|
414
|
+
strokeLinejoin: "round",
|
|
415
|
+
"aria-hidden": "true",
|
|
416
|
+
children: [
|
|
417
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("circle", {
|
|
418
|
+
cx: "7",
|
|
419
|
+
cy: "7",
|
|
420
|
+
r: "4.2"
|
|
421
|
+
}),
|
|
422
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "m10.2 10.2 3 3" }),
|
|
423
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M4.2 5.4h5.6" }),
|
|
424
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M4.2 7.4h4" })
|
|
425
|
+
]
|
|
426
|
+
})
|
|
427
|
+
}), open ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
428
|
+
ref: input,
|
|
429
|
+
className: MessageSearch_module_css_default["input"],
|
|
430
|
+
type: "search",
|
|
431
|
+
value: query,
|
|
432
|
+
placeholder: t("searchMessagesPlaceholder"),
|
|
433
|
+
"aria-label": t("searchMessages"),
|
|
434
|
+
onChange: (event) => {
|
|
435
|
+
setQuery(event.target.value);
|
|
436
|
+
}
|
|
437
|
+
}) : null]
|
|
438
|
+
}), open && query.trim().length > 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
439
|
+
className: MessageSearch_module_css_default["results"],
|
|
440
|
+
role: "listbox",
|
|
441
|
+
"aria-label": t("searchMessages"),
|
|
442
|
+
children: busy && hits.length === 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
443
|
+
className: MessageSearch_module_css_default["hint"],
|
|
444
|
+
children: t("searching")
|
|
445
|
+
}) : hits.length === 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
446
|
+
className: MessageSearch_module_css_default["hint"],
|
|
447
|
+
children: t("searchMessagesEmpty")
|
|
448
|
+
}) : hits.map((hit) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
449
|
+
type: "button",
|
|
450
|
+
role: "option",
|
|
451
|
+
"aria-selected": false,
|
|
452
|
+
className: MessageSearch_module_css_default["hit"],
|
|
453
|
+
onClick: () => {
|
|
454
|
+
onOpen(hit.roomId, hit.eventId);
|
|
455
|
+
setQuery("");
|
|
456
|
+
setHits([]);
|
|
457
|
+
setOpen(false);
|
|
458
|
+
},
|
|
459
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
460
|
+
className: MessageSearch_module_css_default["hitHead"],
|
|
461
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
462
|
+
className: MessageSearch_module_css_default["hitRoom"],
|
|
463
|
+
children: hit.roomName
|
|
464
|
+
}), hit.authorName === null ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
465
|
+
className: MessageSearch_module_css_default["hitAuthor"],
|
|
466
|
+
children: hit.authorName
|
|
467
|
+
})]
|
|
468
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
469
|
+
className: MessageSearch_module_css_default["hitText"],
|
|
470
|
+
children: highlighted(hit.text, query)
|
|
471
|
+
})]
|
|
472
|
+
}, `${hit.roomId}:${hit.eventId}`))
|
|
473
|
+
}) : null]
|
|
474
|
+
});
|
|
475
|
+
};
|
|
236
476
|
//#endregion
|
|
237
477
|
//#region src/client/rows.ts
|
|
238
478
|
/**
|
|
@@ -474,20 +714,20 @@ window.__ModuleLoader__.load({
|
|
|
474
714
|
const announcementMissing = (error) => error instanceof RoomError && (error.status === 404 || error.status === 405 || error.status === 501);
|
|
475
715
|
//#endregion
|
|
476
716
|
//#region \0dsh-css:/root/projects/dsh-plugins-plus/packages/group-chat/src/client/Avatar.module.css.mjs
|
|
477
|
-
const css$
|
|
478
|
-
const tagId$
|
|
479
|
-
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$
|
|
717
|
+
const css$9 = ".Ohch6W_avatar{letter-spacing:.02em;color:#fff;background:var(--dsw-static-blue-600,#2563eb);user-select:none;border-radius:50%;flex:none;justify-content:center;align-items:center;font-weight:600;display:inline-flex;overflow:hidden}.Ohch6W_md{width:30px;height:30px;font-size:12px;line-height:30px}.Ohch6W_sm{width:24px;height:24px;font-size:10px;line-height:24px}.Ohch6W_stack{flex:none;display:inline-flex;position:relative}.Ohch6W_over{background:0 0;position:absolute;inset:0}img.Ohch6W_avatar{object-fit:cover;background:0 0}";
|
|
718
|
+
const tagId$9 = "@sparkelf/dsh-group-chat/Avatar.module.css";
|
|
719
|
+
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$9) + "]") === null) {
|
|
480
720
|
const tag = document.createElement("style");
|
|
481
721
|
tag.dataset.plugin = "@sparkelf/dsh-group-chat";
|
|
482
|
-
tag.dataset.pluginCss = tagId$
|
|
483
|
-
tag.textContent = css$
|
|
722
|
+
tag.dataset.pluginCss = tagId$9;
|
|
723
|
+
tag.textContent = css$9;
|
|
484
724
|
document.head.appendChild(tag);
|
|
485
725
|
}
|
|
486
726
|
var Avatar_module_css_default = {
|
|
487
|
-
"sm": "Ohch6W_sm",
|
|
488
727
|
"over": "Ohch6W_over",
|
|
489
|
-
"
|
|
728
|
+
"sm": "Ohch6W_sm",
|
|
490
729
|
"avatar": "Ohch6W_avatar",
|
|
730
|
+
"md": "Ohch6W_md",
|
|
491
731
|
"stack": "Ohch6W_stack"
|
|
492
732
|
};
|
|
493
733
|
//#endregion
|
|
@@ -518,22 +758,22 @@ window.__ModuleLoader__.load({
|
|
|
518
758
|
};
|
|
519
759
|
//#endregion
|
|
520
760
|
//#region \0dsh-css:/root/projects/dsh-plugins-plus/packages/group-chat/src/client/Picker.module.css.mjs
|
|
521
|
-
const css$
|
|
522
|
-
const tagId$
|
|
523
|
-
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$
|
|
761
|
+
const css$8 = ".sKjJ-a_box{flex-direction:column;min-width:0;display:flex;position:relative}.sKjJ-a_list{z-index:10;border:1px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);background:var(--dsw-alias-bg-base,var(--dsw-alias-interactive-bg-hover));max-height:240px;padding:4px;position:absolute;top:calc(100% + 4px);left:0;right:0;overflow-y:auto;box-shadow:0 8px 24px #0000003d}.sKjJ-a_row,.sKjJ-a_rowActive{border-radius:var(--dsw-radius-sm);width:100%;color:var(--dsw-alias-label-primary);text-align:left;cursor:pointer;background:0 0;border:none;align-items:center;gap:8px;padding:6px 8px;font-size:13px;line-height:18px;display:flex}.sKjJ-a_rowActive{background:var(--dsw-alias-interactive-bg-hover)}.sKjJ-a_label{text-overflow:ellipsis;white-space:nowrap;flex:auto;min-width:0;overflow:hidden}.sKjJ-a_secondary{color:var(--dsw-alias-label-tertiary);flex:none;font-size:12px}.sKjJ-a_note{color:var(--dsw-alias-label-tertiary);margin:6px 8px;font-size:12px;line-height:17px}";
|
|
762
|
+
const tagId$8 = "@sparkelf/dsh-group-chat/Picker.module.css";
|
|
763
|
+
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$8) + "]") === null) {
|
|
524
764
|
const tag = document.createElement("style");
|
|
525
765
|
tag.dataset.plugin = "@sparkelf/dsh-group-chat";
|
|
526
|
-
tag.dataset.pluginCss = tagId$
|
|
527
|
-
tag.textContent = css$
|
|
766
|
+
tag.dataset.pluginCss = tagId$8;
|
|
767
|
+
tag.textContent = css$8;
|
|
528
768
|
document.head.appendChild(tag);
|
|
529
769
|
}
|
|
530
770
|
var Picker_module_css_default = {
|
|
531
|
-
"note": "sKjJ-a_note",
|
|
532
771
|
"secondary": "sKjJ-a_secondary",
|
|
772
|
+
"note": "sKjJ-a_note",
|
|
533
773
|
"list": "sKjJ-a_list",
|
|
534
774
|
"row": "sKjJ-a_row",
|
|
535
|
-
"box": "sKjJ-a_box",
|
|
536
775
|
"rowActive": "sKjJ-a_rowActive",
|
|
776
|
+
"box": "sKjJ-a_box",
|
|
537
777
|
"label": "sKjJ-a_label"
|
|
538
778
|
};
|
|
539
779
|
//#endregion
|
|
@@ -697,21 +937,21 @@ window.__ModuleLoader__.load({
|
|
|
697
937
|
};
|
|
698
938
|
//#endregion
|
|
699
939
|
//#region \0dsh-css:/root/projects/dsh-plugins-plus/packages/group-chat/src/client/PresetSelect.module.css.mjs
|
|
700
|
-
const css$
|
|
701
|
-
const tagId$
|
|
702
|
-
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$
|
|
940
|
+
const css$7 = ".xjnmxG_trigger{border:1px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);width:100%;color:var(--dsw-alias-label-primary);text-align:left;cursor:pointer;background:0 0;align-items:center;gap:6px;padding:6px 10px;font-size:13px;line-height:18px;display:flex}.xjnmxG_trigger:hover{background:var(--dsw-alias-interactive-bg-hover)}.xjnmxG_triggerLabel{text-overflow:ellipsis;white-space:nowrap;flex:auto;min-width:0;overflow:hidden}.xjnmxG_trigger:after{border-right:1.5px solid var(--dsw-alias-label-tertiary);border-bottom:1.5px solid var(--dsw-alias-label-tertiary);content:\"\";flex:none;width:6px;height:6px;margin-left:2px;transform:translateY(-1px)rotate(45deg)}.xjnmxG_row{flex-direction:column;gap:2px;min-width:0;display:flex}.xjnmxG_name{color:var(--dsw-alias-label-primary);font-size:13px;line-height:18px}.xjnmxG_description{color:var(--dsw-alias-label-tertiary);white-space:normal;font-size:12px;line-height:17px}";
|
|
941
|
+
const tagId$7 = "@sparkelf/dsh-group-chat/PresetSelect.module.css";
|
|
942
|
+
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$7) + "]") === null) {
|
|
703
943
|
const tag = document.createElement("style");
|
|
704
944
|
tag.dataset.plugin = "@sparkelf/dsh-group-chat";
|
|
705
|
-
tag.dataset.pluginCss = tagId$
|
|
706
|
-
tag.textContent = css$
|
|
945
|
+
tag.dataset.pluginCss = tagId$7;
|
|
946
|
+
tag.textContent = css$7;
|
|
707
947
|
document.head.appendChild(tag);
|
|
708
948
|
}
|
|
709
949
|
var PresetSelect_module_css_default = {
|
|
710
|
-
"description": "xjnmxG_description",
|
|
711
|
-
"triggerLabel": "xjnmxG_triggerLabel",
|
|
712
950
|
"row": "xjnmxG_row",
|
|
713
|
-
"
|
|
714
|
-
"trigger": "xjnmxG_trigger"
|
|
951
|
+
"triggerLabel": "xjnmxG_triggerLabel",
|
|
952
|
+
"trigger": "xjnmxG_trigger",
|
|
953
|
+
"description": "xjnmxG_description",
|
|
954
|
+
"name": "xjnmxG_name"
|
|
715
955
|
};
|
|
716
956
|
//#endregion
|
|
717
957
|
//#region src/client/PresetSelect.tsx
|
|
@@ -959,33 +1199,33 @@ window.__ModuleLoader__.load({
|
|
|
959
1199
|
};
|
|
960
1200
|
//#endregion
|
|
961
1201
|
//#region \0dsh-css:/root/projects/dsh-plugins-plus/packages/group-chat/src/client/CreateRoomDialog.module.css.mjs
|
|
962
|
-
const css$
|
|
963
|
-
const tagId$
|
|
964
|
-
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$
|
|
1202
|
+
const css$6 = ".Z3w8WW_body{flex-direction:column;gap:14px;min-width:0;display:flex}.Z3w8WW_field{flex-direction:column;gap:5px;min-width:0;display:flex}.Z3w8WW_label{color:var(--dsw-alias-label-primary);font-size:13px;line-height:18px}.Z3w8WW_hint{color:var(--dsw-alias-label-tertiary);font-size:12px;line-height:17px}.Z3w8WW_warn{border-radius:var(--dsw-radius-sm);background:var(--dsw-alias-bg-warning,#d299221f);color:var(--dsw-alias-state-warning-primary,#d29922);padding:6px 8px;font-size:12px;line-height:17px;display:block}.Z3w8WW_switches{border-top:1px solid var(--dsw-alias-border-l3);flex-direction:column;gap:8px;padding:10px 0 0;display:flex}.Z3w8WW_triggerExtra{flex-wrap:wrap;gap:6px;padding-left:0;display:flex}.Z3w8WW_pill,.Z3w8WW_pillActive{border:1px solid var(--dsw-alias-border-l3);color:var(--dsw-alias-label-secondary);font:inherit;cursor:pointer;background:0 0;border-radius:999px;padding:4px 10px;font-size:12px}.Z3w8WW_pillActive{border-color:var(--dsw-alias-state-business-primary);color:var(--dsw-alias-label-primary)}.Z3w8WW_notice{border-radius:var(--dsw-radius-sm);background:var(--dsw-alias-bg-layer-2,#80808014);color:var(--dsw-alias-label-secondary);margin:0;padding:8px 10px;font-size:12px;line-height:17px}.Z3w8WW_error{color:var(--dsw-alias-state-error-primary,#f85149);margin:0;font-size:12px;line-height:17px}.Z3w8WW_footer{justify-content:flex-end;gap:8px;display:flex}.Z3w8WW_policyRow{flex-direction:column;gap:5px;display:flex}.Z3w8WW_memberList{flex-direction:column;gap:2px;margin:0;padding:0;list-style:none;display:flex}.Z3w8WW_memberRow{border-radius:var(--dsw-radius-sm);align-items:center;gap:8px;padding:6px 8px;font-size:13px;display:flex}.Z3w8WW_memberRow:hover{background:var(--dsw-alias-interactive-bg-hover)}.Z3w8WW_memberName{text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;overflow:hidden}.Z3w8WW_memberBadge{background:var(--dsw-alias-bg-layer-2,#8080801f);color:var(--dsw-alias-label-secondary);border-radius:999px;padding:0 6px;font-size:11px;line-height:16px}";
|
|
1203
|
+
const tagId$6 = "@sparkelf/dsh-group-chat/CreateRoomDialog.module.css";
|
|
1204
|
+
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$6) + "]") === null) {
|
|
965
1205
|
const tag = document.createElement("style");
|
|
966
1206
|
tag.dataset.plugin = "@sparkelf/dsh-group-chat";
|
|
967
|
-
tag.dataset.pluginCss = tagId$
|
|
968
|
-
tag.textContent = css$
|
|
1207
|
+
tag.dataset.pluginCss = tagId$6;
|
|
1208
|
+
tag.textContent = css$6;
|
|
969
1209
|
document.head.appendChild(tag);
|
|
970
1210
|
}
|
|
971
1211
|
var CreateRoomDialog_module_css_default = {
|
|
972
|
-
"
|
|
973
|
-
"pillActive": "Z3w8WW_pillActive",
|
|
974
|
-
"notice": "Z3w8WW_notice",
|
|
1212
|
+
"switches": "Z3w8WW_switches",
|
|
975
1213
|
"hint": "Z3w8WW_hint",
|
|
976
|
-
"policyRow": "Z3w8WW_policyRow",
|
|
977
|
-
"pill": "Z3w8WW_pill",
|
|
978
1214
|
"field": "Z3w8WW_field",
|
|
1215
|
+
"policyRow": "Z3w8WW_policyRow",
|
|
1216
|
+
"body": "Z3w8WW_body",
|
|
979
1217
|
"memberList": "Z3w8WW_memberList",
|
|
980
|
-
"memberName": "Z3w8WW_memberName",
|
|
981
1218
|
"memberBadge": "Z3w8WW_memberBadge",
|
|
982
|
-
"
|
|
983
|
-
"
|
|
1219
|
+
"pillActive": "Z3w8WW_pillActive",
|
|
1220
|
+
"notice": "Z3w8WW_notice",
|
|
984
1221
|
"triggerExtra": "Z3w8WW_triggerExtra",
|
|
1222
|
+
"error": "Z3w8WW_error",
|
|
1223
|
+
"label": "Z3w8WW_label",
|
|
985
1224
|
"memberRow": "Z3w8WW_memberRow",
|
|
986
|
-
"body": "Z3w8WW_body",
|
|
987
1225
|
"footer": "Z3w8WW_footer",
|
|
988
|
-
"
|
|
1226
|
+
"warn": "Z3w8WW_warn",
|
|
1227
|
+
"pill": "Z3w8WW_pill",
|
|
1228
|
+
"memberName": "Z3w8WW_memberName"
|
|
989
1229
|
};
|
|
990
1230
|
//#endregion
|
|
991
1231
|
//#region src/client/CreateRoomDialog.tsx
|
|
@@ -1242,38 +1482,38 @@ window.__ModuleLoader__.load({
|
|
|
1242
1482
|
}
|
|
1243
1483
|
//#endregion
|
|
1244
1484
|
//#region \0dsh-css:/root/projects/dsh-plugins-plus/packages/group-chat/src/client/InviteDialog.module.css.mjs
|
|
1245
|
-
const css$
|
|
1246
|
-
const tagId$
|
|
1247
|
-
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$
|
|
1485
|
+
const css$5 = ".r4uCba_dialog.r4uCba_dialog{width:min(760px,100%);max-height:100%}.r4uCba_content{overscroll-behavior:contain;min-height:0;overflow-y:auto}.r4uCba_searchRow{align-items:center;gap:8px;min-width:0;display:flex;position:relative}.r4uCba_search{flex:1;min-width:0}.r4uCba_spinner{color:var(--dsw-alias-label-tertiary);flex:none;animation:.9s linear infinite r4uCba_inviteSpin}@keyframes r4uCba_inviteSpin{to{transform:rotate(360deg)}}@media (prefers-reduced-motion:reduce){.r4uCba_spinner{animation:none}}.r4uCba_visuallyHidden{clip-path:inset(50%);white-space:nowrap;width:1px;height:1px;position:absolute;overflow:hidden}.r4uCba_field{flex-direction:column;gap:5px;min-width:0;display:flex}.r4uCba_chips{flex-wrap:wrap;gap:6px;margin:0;padding:0;list-style:none;display:flex}.r4uCba_chip{border:1px solid var(--dsw-alias-border-l3);border-radius:999px;align-items:center;gap:6px;max-width:100%;padding:3px 6px 3px 3px;font-size:12px;line-height:18px;display:inline-flex}.r4uCba_chipName{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.r4uCba_chipRemove{color:var(--dsw-alias-label-tertiary);cursor:pointer;background:0 0;border:none;flex:none;padding:0 2px;font-size:14px;line-height:14px}.r4uCba_chipRemove:hover{color:var(--dsw-alias-label-primary)}.r4uCba_chipRemove:focus-visible{outline:var(--dsw-focus-ring-width,2px) solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary));outline-offset:1px;border-radius:var(--dsw-radius-sm)}.r4uCba_list{scrollbar-gutter:stable;border:1px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-md);background:var(--dsw-alias-bg-layer-1);max-height:min(46vh,420px);margin:0;padding:4px;list-style:none;overflow-y:auto}.r4uCba_list>li+li{margin-top:2px}.r4uCba_row,.r4uCba_rowSelected{box-sizing:border-box;border-radius:var(--dsw-radius-sm);width:100%;min-height:38px;color:var(--dsw-alias-label-primary);font:inherit;text-align:left;cursor:pointer;background:0 0;border:1px solid #0000;align-items:center;gap:8px;padding:5px 8px;font-size:13px;line-height:18px;display:flex}.r4uCba_row:hover{background:var(--dsw-alias-interactive-bg-hover)}.r4uCba_rowSelected{border-color:var(--dsw-alias-state-business-primary);background:var(--dsw-alias-interactive-bg-active)}.r4uCba_rowSelected:hover{background:var(--dsw-alias-interactive-bg-hover-accent)}.r4uCba_row:focus-visible,.r4uCba_rowSelected:focus-visible{outline:var(--dsw-focus-ring-width,2px) solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary));outline-offset:-2px}.r4uCba_rowName{text-overflow:ellipsis;white-space:nowrap;flex:auto;min-width:0;overflow:hidden}.r4uCba_rowHandle{color:var(--dsw-alias-label-tertiary);flex:none;font-size:12px}.r4uCba_check,.r4uCba_checkHidden{width:14px;color:var(--dsw-alias-state-business-primary);flex:none;justify-content:center;align-items:center;display:inline-flex}.r4uCba_checkHidden{visibility:hidden}.r4uCba_note{color:var(--dsw-alias-label-tertiary);margin:0;padding:14px 10px;font-size:12px;line-height:17px}.r4uCba_errorRow{align-items:center;gap:8px;min-width:0;display:flex}.r4uCba_errorRow>span{flex:1;min-width:0}.r4uCba_error{color:var(--dsw-alias-state-error-primary,#f85149);margin:0;font-size:12px;line-height:17px}";
|
|
1486
|
+
const tagId$5 = "@sparkelf/dsh-group-chat/InviteDialog.module.css";
|
|
1487
|
+
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$5) + "]") === null) {
|
|
1248
1488
|
const tag = document.createElement("style");
|
|
1249
1489
|
tag.dataset.plugin = "@sparkelf/dsh-group-chat";
|
|
1250
|
-
tag.dataset.pluginCss = tagId$
|
|
1251
|
-
tag.textContent = css$
|
|
1490
|
+
tag.dataset.pluginCss = tagId$5;
|
|
1491
|
+
tag.textContent = css$5;
|
|
1252
1492
|
document.head.appendChild(tag);
|
|
1253
1493
|
}
|
|
1254
1494
|
var InviteDialog_module_css_default = {
|
|
1495
|
+
"checkHidden": "r4uCba_checkHidden",
|
|
1496
|
+
"row": "r4uCba_row",
|
|
1255
1497
|
"inviteSpin": "r4uCba_inviteSpin",
|
|
1256
|
-
"
|
|
1498
|
+
"content": "r4uCba_content",
|
|
1499
|
+
"chipRemove": "r4uCba_chipRemove",
|
|
1500
|
+
"error": "r4uCba_error",
|
|
1501
|
+
"rowHandle": "r4uCba_rowHandle",
|
|
1502
|
+
"errorRow": "r4uCba_errorRow",
|
|
1257
1503
|
"search": "r4uCba_search",
|
|
1504
|
+
"searchRow": "r4uCba_searchRow",
|
|
1505
|
+
"field": "r4uCba_field",
|
|
1506
|
+
"chips": "r4uCba_chips",
|
|
1507
|
+
"spinner": "r4uCba_spinner",
|
|
1508
|
+
"chipName": "r4uCba_chipName",
|
|
1258
1509
|
"rowSelected": "r4uCba_rowSelected",
|
|
1510
|
+
"rowName": "r4uCba_rowName",
|
|
1511
|
+
"visuallyHidden": "r4uCba_visuallyHidden",
|
|
1512
|
+
"chip": "r4uCba_chip",
|
|
1259
1513
|
"note": "r4uCba_note",
|
|
1260
|
-
"chipName": "r4uCba_chipName",
|
|
1261
|
-
"spinner": "r4uCba_spinner",
|
|
1262
|
-
"errorRow": "r4uCba_errorRow",
|
|
1263
|
-
"rowHandle": "r4uCba_rowHandle",
|
|
1264
|
-
"error": "r4uCba_error",
|
|
1265
1514
|
"dialog": "r4uCba_dialog",
|
|
1266
1515
|
"check": "r4uCba_check",
|
|
1267
|
-
"
|
|
1268
|
-
"checkHidden": "r4uCba_checkHidden",
|
|
1269
|
-
"chipRemove": "r4uCba_chipRemove",
|
|
1270
|
-
"row": "r4uCba_row",
|
|
1271
|
-
"list": "r4uCba_list",
|
|
1272
|
-
"visuallyHidden": "r4uCba_visuallyHidden",
|
|
1273
|
-
"content": "r4uCba_content",
|
|
1274
|
-
"searchRow": "r4uCba_searchRow",
|
|
1275
|
-
"field": "r4uCba_field",
|
|
1276
|
-
"chips": "r4uCba_chips"
|
|
1516
|
+
"list": "r4uCba_list"
|
|
1277
1517
|
};
|
|
1278
1518
|
//#endregion
|
|
1279
1519
|
//#region src/client/RoomDialogs.tsx
|
|
@@ -1880,68 +2120,68 @@ window.__ModuleLoader__.load({
|
|
|
1880
2120
|
}
|
|
1881
2121
|
//#endregion
|
|
1882
2122
|
//#region \0dsh-css:/root/projects/dsh-plugins-plus/packages/group-chat/src/client/SidebarRooms.module.css.mjs
|
|
1883
|
-
const css$3 = ".s0QgKq_root{--dsh-session-list-edge-inset:var(--dsh-sidebar-inline-padding,12px);--dsh-session-list-scrollbar-width:5px;--dsh-session-list-scrollbar-offset:2px;box-sizing:border-box;flex-direction:column;flex:auto;width:100%;min-width:0;min-height:0;max-height:20vh;display:flex;position:relative}.s0QgKq_resizer{z-index:1;cursor:row-resize;touch-action:none;background:0 0;height:6px;position:absolute;top:-3px;left:0;right:0}.s0QgKq_resizer:after{content:\"\";background:var(--dsw-alias-border-l1,var(--dsw-alias-separator-primary));opacity:0;border-radius:1px;height:1px;transition:opacity .12s;position:absolute;top:3px;left:8px;right:8px}.s0QgKq_root:hover .s0QgKq_resizer:after,.s0QgKq_resizer:focus-visible:after{opacity:1}.s0QgKq_resizer:focus-visible{outline:none}.s0QgKq_resizer:focus-visible:after{background:var(--dsw-alias-brand-primary,var(--dsw-alias-label-primary));height:2px}.s0QgKq_sectionHeader{box-sizing:border-box;border-radius:var(--dsw-radius-md);height:36px;color:var(--dsw-alias-label-tertiary);flex:none;justify-content:flex-end;align-items:center;gap:4px;margin-bottom:4px;margin-right:-4px;padding-left:4px;display:flex;overflow:hidden}.s0QgKq_sectionLabel{white-space:nowrap;flex:none;min-width:0;max-width:45%;line-height:20px;overflow:hidden}.s0QgKq_searchSlot{box-sizing:border-box;flex:1;align-items:center;min-width:0;max-width:28px;margin-left:auto;padding-left:0;display:flex}.s0QgKq_searchSlotExpanded{box-sizing:border-box;flex:1;align-items:center;min-width:0;max-width:100%;margin-left:auto;display:flex}.s0QgKq_search,.s0QgKq_searchExpanded{box-sizing:border-box;border-radius:var(--dsw-radius-sm);width:100%;height:28px;color:var(--dsw-alias-label-secondary);cursor:text;background:0 0;border:none;flex:none;align-items:center;margin:0;padding:0;display:flex;overflow:hidden}.s0QgKq_searchExpanded{border:.5px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-md);width:calc(100% + 4px);height:30px;color:var(--dsw-alias-label-caption);margin-inline:-2px;padding:0 4px 0 0}.s0QgKq_iconButton{border-radius:var(--dsw-radius-sm);width:28px;height:28px;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:none;flex:none;justify-content:center;align-items:center;padding:0;display:inline-flex}.s0QgKq_iconButton:hover{background:var(--dsw-alias-interactive-bg-hover)}.s0QgKq_iconButton:focus-visible,.s0QgKq_searchButton:focus-visible,.s0QgKq_clearButton:focus-visible{outline:var(--dsw-focus-ring-width,2px) solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary));outline-offset:-2px}.s0QgKq_searchButton{border-radius:var(--dsw-radius-sm);width:28px;height:28px;color:inherit;cursor:pointer;background:0 0;border:none;flex:none;justify-content:center;align-items:center;padding:0;display:inline-flex}.s0QgKq_searchExpanded .s0QgKq_searchButton{width:28px;height:30px}.s0QgKq_searchButton:hover{background:var(--dsw-alias-interactive-bg-hover)}.s0QgKq_searchExpanded .s0QgKq_searchButton:hover{background:0 0}.s0QgKq_searchInput{width:0;min-width:0;color:var(--dsw-alias-label-primary);opacity:0;pointer-events:none;transition:opacity .12s var(--ds-ease-in-out);background:0 0;border:none;outline:none;flex:1;padding:0;font-size:13px;line-height:18px}.s0QgKq_searchExpanded .s0QgKq_searchInput{opacity:1;pointer-events:auto;margin-left:-2px}.s0QgKq_searchInput::placeholder{color:var(--dsw-alias-label-tertiary)}.s0QgKq_clearButton{border-radius:var(--dsw-radius-sm);width:24px;height:24px;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:none;flex:none;justify-content:center;align-items:center;padding:0;display:inline-flex}.s0QgKq_clearButton:hover{background:var(--dsw-alias-interactive-bg-hover)}.s0QgKq_headerActions{flex:none;align-items:center;gap:4px;display:flex}.s0QgKq_viewWrap{display:flex;position:relative}.s0QgKq_listArea{min-height:0;margin-left:-4px;margin-right:calc(-1 * var(--dsh-session-list-edge-inset));flex-direction:column;flex:1;padding-left:4px;display:flex;position:relative}.s0QgKq_list{min-height:0;max-height:100%;margin-left:-4px;margin-right:var(--dsh-session-list-scrollbar-offset);padding-left:4px;padding-right:calc(var(--dsh-session-list-edge-inset) - var(--dsh-session-list-scrollbar-width) - var(--dsh-session-list-scrollbar-offset));scrollbar-gutter:stable;padding-bottom:8px;overflow-y:auto}.s0QgKq_flatList{margin:0;padding:0;list-style:none}.s0QgKq_flatList>*+*{margin-top:2px}.s0QgKq_sessionRow,.s0QgKq_sessionRowSelected{box-sizing:border-box;border-radius:var(--dsw-radius-sm);width:100%;height:32px;color:var(--dsw-alias-label-primary);font:inherit;text-align:left;cursor:pointer;background:0 0;border:none;align-items:center;gap:8px;padding:0 8px;font-size:14px;display:flex}.s0QgKq_sessionRow:hover,.s0QgKq_sessionRowSelected{background:var(--dsw-alias-interactive-bg-hover)}.s0QgKq_rowIcon{width:16px;color:var(--dsw-alias-label-secondary);flex:none;justify-content:center;align-items:center;display:flex}.s0QgKq_title{text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;overflow:hidden}.s0QgKq_time{color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums;flex:none;font-size:12px;line-height:17px}.s0QgKq_unread{background:var(--dsw-alias-bg-layer-3,var(--dsw-alias-interactive-bg-hover));min-width:18px;color:var(--dsw-alias-label-primary);font-variant-numeric:tabular-nums;text-align:center;border-radius:9px;flex:none;padding:0 5px;font-size:11px;font-weight:600;line-height:17px}.s0QgKq_unreadMentioned{background:var(--dsw-alias-state-business-primary);min-width:18px;color:var(--dsw-alias-label-primary);font-variant-numeric:tabular-nums;text-align:center;border-radius:9px;flex:none;padding:0 5px;font-size:11px;font-weight:600;line-height:17px}.s0QgKq_empty{color:var(--dsw-alias-label-tertiary);margin:0;padding:16px 12px;font-size:13px}.s0QgKq_emptyState{color:var(--dsw-alias-label-tertiary);text-align:center;flex-direction:column;align-items:center;gap:8px;margin-top:80px;padding:0 12px;font-size:13px;line-height:20px;display:flex}.s0QgKq_emptyState>svg{color:var(--dsw-alias-label-caption);margin-bottom:4px}.s0QgKq_fade{left:0;right:var(--dsh-session-list-edge-inset);background:linear-gradient(to bottom, transparent, var(--dsw-specific-sidebar-fill));pointer-events:none;height:24px;position:absolute;bottom:0}.s0QgKq_menuLayer{z-index:60;max-height:calc(100vh - 16px);position:fixed;overflow-y:auto}.s0QgKq_menuInline{z-index:30;position:absolute;top:32px;right:0}.s0QgKq_menu{border:1px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-md);background:var(--dsw-alias-bg-layer-1,var(--dsw-specific-sidebar-fill));min-width:200px;padding:4px;position:relative;box-shadow:0 6px 20px #0000002e}.s0QgKq_menuHeading{color:var(--dsw-alias-label-tertiary);padding:4px 8px 2px;font-size:11px;line-height:16px;display:block}.s0QgKq_menuItem{border-radius:var(--dsw-radius-sm);width:100%;color:var(--dsw-alias-label-primary);font:inherit;text-align:left;cursor:pointer;background:0 0;border:none;align-items:center;gap:8px;padding:6px 8px;font-size:13px;display:flex}.s0QgKq_menuItem:hover{background:var(--dsw-alias-interactive-bg-hover)}.s0QgKq_check{color:var(--dsw-alias-state-business-primary);margin-left:auto}.s0QgKq_visuallyHidden{clip-path:inset(50%);white-space:nowrap;width:1px;height:1px;position:absolute;overflow:hidden}.s0QgKq_rowWrap{position:relative}.s0QgKq_menuRename{box-sizing:border-box;border:1px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-md);background:var(--dsw-alias-bg-layer-1,var(--dsw-specific-sidebar-fill));min-width:240px;padding:8px;box-shadow:0 6px 20px #0000002e}.s0QgKq_menuRename .s0QgKq_menuHeading{padding:0 0 6px}.s0QgKq_menuInput{box-sizing:border-box;border:1px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-sm);appearance:none;background:var(--dsw-alias-bg-base);width:100%;color:var(--dsw-alias-label-primary);font:inherit;outline:none;margin:2px 0 6px;padding:6px 8px;font-size:13px;line-height:20px}.s0QgKq_menuInput:focus-visible{border-color:var(--dsw-alias-state-business-primary)}.s0QgKq_menuInput::placeholder{color:var(--dsw-alias-label-tertiary)}.s0QgKq_menuActions{justify-content:flex-end;gap:6px;padding-top:2px;display:flex}.s0QgKq_menuConfirm{box-sizing:border-box;border-radius:var(--dsw-radius-sm);background:var(--dsw-alias-button-primary-fill);color:var(--dsw-alias-label-primary-foreground);font:inherit;cursor:pointer;border:1px solid #0000;padding:5px 12px;font-size:12px;line-height:18px}.s0QgKq_menuConfirm:hover:not(:disabled){filter:brightness(1.06)}.s0QgKq_menuConfirm:disabled{opacity:.5;cursor:default}.s0QgKq_menuCancel{box-sizing:border-box;border:1px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);color:var(--dsw-alias-label-secondary);font:inherit;cursor:pointer;background:0 0;padding:5px 12px;font-size:12px;line-height:18px}.s0QgKq_menuCancel:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover)}.s0QgKq_menuItem:disabled{opacity:.5;cursor:default}.s0QgKq_discoverSection{border-top:1px solid var(--dsw-alias-border-l3);margin-top:8px;padding-top:8px}.s0QgKq_discoverHeading{color:var(--dsw-alias-label-tertiary);margin:0 0 4px;padding:0 12px;font-size:11px;line-height:16px}.s0QgKq_discoverRow{border-radius:var(--dsw-radius-sm);color:var(--dsw-alias-label-primary);align-items:center;gap:8px;padding:4px 12px;font-size:13px;line-height:18px;display:flex}.s0QgKq_discoverRow:hover{background:var(--dsw-alias-interactive-bg-hover)}.s0QgKq_discoverName{text-overflow:ellipsis;white-space:nowrap;flex:auto;min-width:0;overflow:hidden}.s0QgKq_discoverMeta{color:var(--dsw-alias-label-tertiary);flex:none;font-size:11px}.s0QgKq_joinButton{border:1px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);color:var(--dsw-alias-state-business-primary);font:inherit;cursor:pointer;background:0 0;flex:none;padding:2px 10px;font-size:12px}.s0QgKq_joinButton:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover)}.s0QgKq_joinButton:disabled{opacity:.5;cursor:default}.s0QgKq_leaveBody{flex-direction:column;gap:8px;min-width:0;display:flex}.s0QgKq_leaveCopy{color:var(--dsw-alias-label-primary);margin:0;font-size:14px;line-height:22px}.s0QgKq_leaveRoomName{color:var(--dsw-alias-label-primary);overflow-wrap:anywhere;margin:0;font-size:14px;line-height:22px}.s0QgKq_leaveRoomName strong{font-weight:600}.s0QgKq_leaveError{color:var(--dsw-alias-state-error-primary,#f85149);margin:0;font-size:12px;line-height:17px}.s0QgKq_footer{justify-content:flex-end;gap:8px;display:flex}.s0QgKq_leaveConfirmDanger{background:var(--dsw-alias-state-error-primary);color:var(--dsw-alias-label-primary)}.s0QgKq_leaveConfirmDanger.s0QgKq_leaveConfirmDanger{color:var(--dsw-alias-label-primary)}.s0QgKq_leaveConfirmDanger:hover:not(:disabled){background:var(--dsw-alias-state-error-primary);filter:brightness(1.08)}.s0QgKq_leaveConfirmDanger:disabled{opacity:.5}";
|
|
1884
|
-
const tagId$
|
|
1885
|
-
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$
|
|
2123
|
+
const css$4 = ".s0QgKq_root{--dsh-session-list-edge-inset:var(--dsh-sidebar-inline-padding,12px);--dsh-session-list-scrollbar-width:5px;--dsh-session-list-scrollbar-offset:2px;box-sizing:border-box;flex-direction:column;flex:auto;width:100%;min-width:0;min-height:0;max-height:20vh;display:flex;position:relative}.s0QgKq_resizer{z-index:1;cursor:row-resize;touch-action:none;background:0 0;height:6px;position:absolute;top:-3px;left:0;right:0}.s0QgKq_resizer:after{content:\"\";background:var(--dsw-alias-border-l1,var(--dsw-alias-separator-primary));opacity:0;border-radius:1px;height:1px;transition:opacity .12s;position:absolute;top:3px;left:8px;right:8px}.s0QgKq_root:hover .s0QgKq_resizer:after,.s0QgKq_resizer:focus-visible:after{opacity:1}.s0QgKq_resizer:focus-visible{outline:none}.s0QgKq_resizer:focus-visible:after{background:var(--dsw-alias-brand-primary,var(--dsw-alias-label-primary));height:2px}.s0QgKq_sectionHeader{box-sizing:border-box;border-radius:var(--dsw-radius-md);height:36px;color:var(--dsw-alias-label-tertiary);flex:none;justify-content:flex-end;align-items:center;gap:4px;margin-bottom:4px;margin-right:-4px;padding-left:4px;display:flex;overflow:hidden}.s0QgKq_sectionLabel{white-space:nowrap;flex:none;min-width:0;max-width:45%;line-height:20px;overflow:hidden}.s0QgKq_searchSlot{box-sizing:border-box;flex:1;align-items:center;min-width:0;max-width:28px;margin-left:auto;padding-left:0;display:flex}.s0QgKq_searchSlotExpanded{box-sizing:border-box;flex:1;align-items:center;min-width:0;max-width:100%;margin-left:auto;display:flex}.s0QgKq_search,.s0QgKq_searchExpanded{box-sizing:border-box;border-radius:var(--dsw-radius-sm);width:100%;height:28px;color:var(--dsw-alias-label-secondary);cursor:text;background:0 0;border:none;flex:none;align-items:center;margin:0;padding:0;display:flex;overflow:hidden}.s0QgKq_searchExpanded{border:.5px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-md);width:calc(100% + 4px);height:30px;color:var(--dsw-alias-label-caption);margin-inline:-2px;padding:0 4px 0 0}.s0QgKq_iconButton{border-radius:var(--dsw-radius-sm);width:28px;height:28px;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:none;flex:none;justify-content:center;align-items:center;padding:0;display:inline-flex}.s0QgKq_iconButton:hover{background:var(--dsw-alias-interactive-bg-hover)}.s0QgKq_iconButton:focus-visible,.s0QgKq_searchButton:focus-visible,.s0QgKq_clearButton:focus-visible{outline:var(--dsw-focus-ring-width,2px) solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary));outline-offset:-2px}.s0QgKq_searchButton{border-radius:var(--dsw-radius-sm);width:28px;height:28px;color:inherit;cursor:pointer;background:0 0;border:none;flex:none;justify-content:center;align-items:center;padding:0;display:inline-flex}.s0QgKq_searchExpanded .s0QgKq_searchButton{width:28px;height:30px}.s0QgKq_searchButton:hover{background:var(--dsw-alias-interactive-bg-hover)}.s0QgKq_searchExpanded .s0QgKq_searchButton:hover{background:0 0}.s0QgKq_searchInput{width:0;min-width:0;color:var(--dsw-alias-label-primary);opacity:0;pointer-events:none;transition:opacity .12s var(--ds-ease-in-out);background:0 0;border:none;outline:none;flex:1;padding:0;font-size:13px;line-height:18px}.s0QgKq_searchExpanded .s0QgKq_searchInput{opacity:1;pointer-events:auto;margin-left:-2px}.s0QgKq_searchInput::placeholder{color:var(--dsw-alias-label-tertiary)}.s0QgKq_clearButton{border-radius:var(--dsw-radius-sm);width:24px;height:24px;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:none;flex:none;justify-content:center;align-items:center;padding:0;display:inline-flex}.s0QgKq_clearButton:hover{background:var(--dsw-alias-interactive-bg-hover)}.s0QgKq_headerActions{flex:none;align-items:center;gap:4px;display:flex}.s0QgKq_viewWrap{display:flex;position:relative}.s0QgKq_listArea{min-height:0;margin-left:-4px;margin-right:calc(-1 * var(--dsh-session-list-edge-inset));flex-direction:column;flex:1;padding-left:4px;display:flex;position:relative}.s0QgKq_list{min-height:0;max-height:100%;margin-left:-4px;margin-right:var(--dsh-session-list-scrollbar-offset);padding-left:4px;padding-right:calc(var(--dsh-session-list-edge-inset) - var(--dsh-session-list-scrollbar-width) - var(--dsh-session-list-scrollbar-offset));scrollbar-gutter:stable;padding-bottom:8px;overflow-y:auto}.s0QgKq_flatList{margin:0;padding:0;list-style:none}.s0QgKq_flatList>*+*{margin-top:2px}.s0QgKq_sessionRow,.s0QgKq_sessionRowSelected{box-sizing:border-box;border-radius:var(--dsw-radius-sm);width:100%;height:32px;color:var(--dsw-alias-label-primary);font:inherit;text-align:left;cursor:pointer;background:0 0;border:none;align-items:center;gap:8px;padding:0 8px;font-size:14px;display:flex}.s0QgKq_sessionRow:hover,.s0QgKq_sessionRowSelected{background:var(--dsw-alias-interactive-bg-hover)}.s0QgKq_rowIcon{width:16px;color:var(--dsw-alias-label-secondary);flex:none;justify-content:center;align-items:center;display:flex}.s0QgKq_title{text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;overflow:hidden}.s0QgKq_time{color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums;flex:none;font-size:12px;line-height:17px}.s0QgKq_unread{background:var(--dsw-alias-bg-layer-3,var(--dsw-alias-interactive-bg-hover));min-width:18px;color:var(--dsw-alias-label-primary);font-variant-numeric:tabular-nums;text-align:center;border-radius:9px;flex:none;padding:0 5px;font-size:11px;font-weight:600;line-height:17px}.s0QgKq_unreadMentioned{background:var(--dsw-alias-state-business-primary);min-width:18px;color:var(--dsw-alias-label-primary);font-variant-numeric:tabular-nums;text-align:center;border-radius:9px;flex:none;padding:0 5px;font-size:11px;font-weight:600;line-height:17px}.s0QgKq_empty{color:var(--dsw-alias-label-tertiary);margin:0;padding:16px 12px;font-size:13px}.s0QgKq_emptyState{color:var(--dsw-alias-label-tertiary);text-align:center;flex-direction:column;align-items:center;gap:8px;margin-top:80px;padding:0 12px;font-size:13px;line-height:20px;display:flex}.s0QgKq_emptyState>svg{color:var(--dsw-alias-label-caption);margin-bottom:4px}.s0QgKq_fade{left:0;right:var(--dsh-session-list-edge-inset);background:linear-gradient(to bottom, transparent, var(--dsw-specific-sidebar-fill));pointer-events:none;height:24px;position:absolute;bottom:0}.s0QgKq_menuLayer{z-index:60;max-height:calc(100vh - 16px);position:fixed;overflow-y:auto}.s0QgKq_menuInline{z-index:30;position:absolute;top:32px;right:0}.s0QgKq_menu{border:1px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-md);background:var(--dsw-alias-bg-layer-1,var(--dsw-specific-sidebar-fill));min-width:200px;padding:4px;position:relative;box-shadow:0 6px 20px #0000002e}.s0QgKq_menuHeading{color:var(--dsw-alias-label-tertiary);padding:4px 8px 2px;font-size:11px;line-height:16px;display:block}.s0QgKq_menuItem{border-radius:var(--dsw-radius-sm);width:100%;color:var(--dsw-alias-label-primary);font:inherit;text-align:left;cursor:pointer;background:0 0;border:none;align-items:center;gap:8px;padding:6px 8px;font-size:13px;display:flex}.s0QgKq_menuItem:hover{background:var(--dsw-alias-interactive-bg-hover)}.s0QgKq_check{color:var(--dsw-alias-state-business-primary);margin-left:auto}.s0QgKq_visuallyHidden{clip-path:inset(50%);white-space:nowrap;width:1px;height:1px;position:absolute;overflow:hidden}.s0QgKq_rowWrap{position:relative}.s0QgKq_menuRename{box-sizing:border-box;border:1px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-md);background:var(--dsw-alias-bg-layer-1,var(--dsw-specific-sidebar-fill));min-width:240px;padding:8px;box-shadow:0 6px 20px #0000002e}.s0QgKq_menuRename .s0QgKq_menuHeading{padding:0 0 6px}.s0QgKq_menuInput{box-sizing:border-box;border:1px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-sm);appearance:none;background:var(--dsw-alias-bg-base);width:100%;color:var(--dsw-alias-label-primary);font:inherit;outline:none;margin:2px 0 6px;padding:6px 8px;font-size:13px;line-height:20px}.s0QgKq_menuInput:focus-visible{border-color:var(--dsw-alias-state-business-primary)}.s0QgKq_menuInput::placeholder{color:var(--dsw-alias-label-tertiary)}.s0QgKq_menuActions{justify-content:flex-end;gap:6px;padding-top:2px;display:flex}.s0QgKq_menuConfirm{box-sizing:border-box;border-radius:var(--dsw-radius-sm);background:var(--dsw-alias-button-primary-fill);color:var(--dsw-alias-label-primary-foreground);font:inherit;cursor:pointer;border:1px solid #0000;padding:5px 12px;font-size:12px;line-height:18px}.s0QgKq_menuConfirm:hover:not(:disabled){filter:brightness(1.06)}.s0QgKq_menuConfirm:disabled{opacity:.5;cursor:default}.s0QgKq_menuCancel{box-sizing:border-box;border:1px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);color:var(--dsw-alias-label-secondary);font:inherit;cursor:pointer;background:0 0;padding:5px 12px;font-size:12px;line-height:18px}.s0QgKq_menuCancel:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover)}.s0QgKq_menuItem:disabled{opacity:.5;cursor:default}.s0QgKq_discoverSection{border-top:1px solid var(--dsw-alias-border-l3);margin-top:8px;padding-top:8px}.s0QgKq_discoverHeading{color:var(--dsw-alias-label-tertiary);margin:0 0 4px;padding:0 12px;font-size:11px;line-height:16px}.s0QgKq_discoverRow{border-radius:var(--dsw-radius-sm);color:var(--dsw-alias-label-primary);align-items:center;gap:8px;padding:4px 12px;font-size:13px;line-height:18px;display:flex}.s0QgKq_discoverRow:hover{background:var(--dsw-alias-interactive-bg-hover)}.s0QgKq_discoverName{text-overflow:ellipsis;white-space:nowrap;flex:auto;min-width:0;overflow:hidden}.s0QgKq_discoverMeta{color:var(--dsw-alias-label-tertiary);flex:none;font-size:11px}.s0QgKq_joinButton{border:1px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);color:var(--dsw-alias-state-business-primary);font:inherit;cursor:pointer;background:0 0;flex:none;padding:2px 10px;font-size:12px}.s0QgKq_joinButton:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover)}.s0QgKq_joinButton:disabled{opacity:.5;cursor:default}.s0QgKq_leaveBody{flex-direction:column;gap:8px;min-width:0;display:flex}.s0QgKq_leaveCopy{color:var(--dsw-alias-label-primary);margin:0;font-size:14px;line-height:22px}.s0QgKq_leaveRoomName{color:var(--dsw-alias-label-primary);overflow-wrap:anywhere;margin:0;font-size:14px;line-height:22px}.s0QgKq_leaveRoomName strong{font-weight:600}.s0QgKq_leaveError{color:var(--dsw-alias-state-error-primary,#f85149);margin:0;font-size:12px;line-height:17px}.s0QgKq_footer{justify-content:flex-end;gap:8px;display:flex}.s0QgKq_leaveConfirmDanger{background:var(--dsw-alias-state-error-primary);color:var(--dsw-alias-label-primary)}.s0QgKq_leaveConfirmDanger.s0QgKq_leaveConfirmDanger{color:var(--dsw-alias-label-primary)}.s0QgKq_leaveConfirmDanger:hover:not(:disabled){background:var(--dsw-alias-state-error-primary);filter:brightness(1.08)}.s0QgKq_leaveConfirmDanger:disabled{opacity:.5}";
|
|
2124
|
+
const tagId$4 = "@sparkelf/dsh-group-chat/SidebarRooms.module.css";
|
|
2125
|
+
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$4) + "]") === null) {
|
|
1886
2126
|
const tag = document.createElement("style");
|
|
1887
2127
|
tag.dataset.plugin = "@sparkelf/dsh-group-chat";
|
|
1888
|
-
tag.dataset.pluginCss = tagId$
|
|
1889
|
-
tag.textContent = css$
|
|
2128
|
+
tag.dataset.pluginCss = tagId$4;
|
|
2129
|
+
tag.textContent = css$4;
|
|
1890
2130
|
document.head.appendChild(tag);
|
|
1891
2131
|
}
|
|
1892
2132
|
var SidebarRooms_module_css_default = {
|
|
1893
|
-
"
|
|
1894
|
-
"
|
|
1895
|
-
"
|
|
1896
|
-
"
|
|
1897
|
-
"menu": "s0QgKq_menu",
|
|
1898
|
-
"menuRename": "s0QgKq_menuRename",
|
|
1899
|
-
"searchSlotExpanded": "s0QgKq_searchSlotExpanded",
|
|
1900
|
-
"rowWrap": "s0QgKq_rowWrap",
|
|
1901
|
-
"menuConfirm": "s0QgKq_menuConfirm",
|
|
1902
|
-
"viewWrap": "s0QgKq_viewWrap",
|
|
1903
|
-
"joinButton": "s0QgKq_joinButton",
|
|
1904
|
-
"listArea": "s0QgKq_listArea",
|
|
1905
|
-
"sessionRowSelected": "s0QgKq_sessionRowSelected",
|
|
1906
|
-
"fade": "s0QgKq_fade",
|
|
1907
|
-
"sectionLabel": "s0QgKq_sectionLabel",
|
|
2133
|
+
"clearButton": "s0QgKq_clearButton",
|
|
2134
|
+
"resizer": "s0QgKq_resizer",
|
|
2135
|
+
"time": "s0QgKq_time",
|
|
2136
|
+
"menuActions": "s0QgKq_menuActions",
|
|
1908
2137
|
"discoverHeading": "s0QgKq_discoverHeading",
|
|
1909
|
-
"
|
|
1910
|
-
"discoverName": "s0QgKq_discoverName",
|
|
2138
|
+
"leaveConfirmDanger": "s0QgKq_leaveConfirmDanger",
|
|
1911
2139
|
"iconButton": "s0QgKq_iconButton",
|
|
1912
|
-
"menuLayer": "s0QgKq_menuLayer",
|
|
1913
|
-
"leaveCopy": "s0QgKq_leaveCopy",
|
|
1914
|
-
"empty": "s0QgKq_empty",
|
|
1915
|
-
"emptyState": "s0QgKq_emptyState",
|
|
1916
|
-
"clearButton": "s0QgKq_clearButton",
|
|
1917
2140
|
"discoverRow": "s0QgKq_discoverRow",
|
|
1918
|
-
"
|
|
1919
|
-
"
|
|
2141
|
+
"rowWrap": "s0QgKq_rowWrap",
|
|
2142
|
+
"menuConfirm": "s0QgKq_menuConfirm",
|
|
1920
2143
|
"searchButton": "s0QgKq_searchButton",
|
|
1921
|
-
"
|
|
1922
|
-
"
|
|
2144
|
+
"headerActions": "s0QgKq_headerActions",
|
|
2145
|
+
"empty": "s0QgKq_empty",
|
|
2146
|
+
"unreadMentioned": "s0QgKq_unreadMentioned",
|
|
2147
|
+
"sectionHeader": "s0QgKq_sectionHeader",
|
|
2148
|
+
"searchExpanded": "s0QgKq_searchExpanded",
|
|
2149
|
+
"rowIcon": "s0QgKq_rowIcon",
|
|
2150
|
+
"leaveCopy": "s0QgKq_leaveCopy",
|
|
2151
|
+
"footer": "s0QgKq_footer",
|
|
2152
|
+
"menuInput": "s0QgKq_menuInput",
|
|
2153
|
+
"discoverName": "s0QgKq_discoverName",
|
|
2154
|
+
"unread": "s0QgKq_unread",
|
|
2155
|
+
"menuInline": "s0QgKq_menuInline",
|
|
2156
|
+
"menuCancel": "s0QgKq_menuCancel",
|
|
2157
|
+
"menuRename": "s0QgKq_menuRename",
|
|
2158
|
+
"leaveBody": "s0QgKq_leaveBody",
|
|
2159
|
+
"leaveRoomName": "s0QgKq_leaveRoomName",
|
|
1923
2160
|
"discoverSection": "s0QgKq_discoverSection",
|
|
2161
|
+
"root": "s0QgKq_root",
|
|
2162
|
+
"fade": "s0QgKq_fade",
|
|
2163
|
+
"searchInput": "s0QgKq_searchInput",
|
|
1924
2164
|
"sessionRow": "s0QgKq_sessionRow",
|
|
1925
|
-
"
|
|
1926
|
-
"
|
|
1927
|
-
"
|
|
2165
|
+
"menuLayer": "s0QgKq_menuLayer",
|
|
2166
|
+
"discoverMeta": "s0QgKq_discoverMeta",
|
|
2167
|
+
"menu": "s0QgKq_menu",
|
|
2168
|
+
"joinButton": "s0QgKq_joinButton",
|
|
2169
|
+
"leaveError": "s0QgKq_leaveError",
|
|
2170
|
+
"search": "s0QgKq_search",
|
|
2171
|
+
"check": "s0QgKq_check",
|
|
2172
|
+
"list": "s0QgKq_list",
|
|
2173
|
+
"sectionLabel": "s0QgKq_sectionLabel",
|
|
1928
2174
|
"searchSlot": "s0QgKq_searchSlot",
|
|
1929
|
-
"
|
|
2175
|
+
"emptyState": "s0QgKq_emptyState",
|
|
2176
|
+
"searchSlotExpanded": "s0QgKq_searchSlotExpanded",
|
|
2177
|
+
"listArea": "s0QgKq_listArea",
|
|
1930
2178
|
"flatList": "s0QgKq_flatList",
|
|
1931
|
-
"
|
|
1932
|
-
"time": "s0QgKq_time",
|
|
1933
|
-
"menuInline": "s0QgKq_menuInline",
|
|
2179
|
+
"sessionRowSelected": "s0QgKq_sessionRowSelected",
|
|
1934
2180
|
"menuHeading": "s0QgKq_menuHeading",
|
|
1935
|
-
"
|
|
1936
|
-
"
|
|
1937
|
-
"
|
|
1938
|
-
"
|
|
1939
|
-
"visuallyHidden": "s0QgKq_visuallyHidden",
|
|
1940
|
-
"leaveBody": "s0QgKq_leaveBody",
|
|
1941
|
-
"leaveError": "s0QgKq_leaveError",
|
|
1942
|
-
"footer": "s0QgKq_footer",
|
|
1943
|
-
"menuActions": "s0QgKq_menuActions",
|
|
1944
|
-
"discoverMeta": "s0QgKq_discoverMeta"
|
|
2181
|
+
"title": "s0QgKq_title",
|
|
2182
|
+
"menuItem": "s0QgKq_menuItem",
|
|
2183
|
+
"viewWrap": "s0QgKq_viewWrap",
|
|
2184
|
+
"visuallyHidden": "s0QgKq_visuallyHidden"
|
|
1945
2185
|
};
|
|
1946
2186
|
//#endregion
|
|
1947
2187
|
//#region src/client/SidebarRooms.tsx
|
|
@@ -2216,67 +2456,91 @@ window.__ModuleLoader__.load({
|
|
|
2216
2456
|
}),
|
|
2217
2457
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2218
2458
|
className: SidebarRooms_module_css_default.listArea,
|
|
2219
|
-
children: [
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2459
|
+
children: [
|
|
2460
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(MessageSearch, {
|
|
2461
|
+
t,
|
|
2462
|
+
onOpen: (roomId, eventId) => {
|
|
2463
|
+
store.open(roomId);
|
|
2464
|
+
if (typeof document === "undefined") return;
|
|
2465
|
+
let attempts = 0;
|
|
2466
|
+
const look = () => {
|
|
2467
|
+
const node = document.querySelector(`[data-group-chat-message="${eventId}"]`);
|
|
2468
|
+
if (node !== null) {
|
|
2469
|
+
node.scrollIntoView({
|
|
2470
|
+
block: "center",
|
|
2471
|
+
behavior: "smooth"
|
|
2472
|
+
});
|
|
2473
|
+
return;
|
|
2474
|
+
}
|
|
2475
|
+
attempts += 1;
|
|
2476
|
+
if (attempts < 40) window.setTimeout(look, 250);
|
|
2477
|
+
};
|
|
2478
|
+
window.setTimeout(look, 400);
|
|
2479
|
+
}
|
|
2480
|
+
}),
|
|
2481
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2482
|
+
className: SidebarRooms_module_css_default.list,
|
|
2483
|
+
children: [
|
|
2484
|
+
failure !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
2485
|
+
className: SidebarRooms_module_css_default.empty,
|
|
2486
|
+
children: t(failure)
|
|
2487
|
+
}),
|
|
2488
|
+
failure === void 0 && rooms === void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
2489
|
+
className: SidebarRooms_module_css_default.empty,
|
|
2490
|
+
children: t("loading")
|
|
2491
|
+
}),
|
|
2492
|
+
failure === void 0 && rooms !== void 0 && visible.length === 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2493
|
+
className: SidebarRooms_module_css_default.emptyState,
|
|
2494
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconQueueOutlineRegular, { size: 28 }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: query.length > 0 ? t("searchEmpty") : t("emptyRooms") })]
|
|
2495
|
+
}),
|
|
2496
|
+
visible.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", {
|
|
2250
2497
|
className: SidebarRooms_module_css_default.flatList,
|
|
2251
|
-
children:
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
}),
|
|
2258
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2259
|
-
className: SidebarRooms_module_css_default.discoverMeta,
|
|
2260
|
-
children: t("discoverMembers").replace("{count}", String(room.memberCount))
|
|
2261
|
-
}),
|
|
2262
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
2263
|
-
type: "button",
|
|
2264
|
-
className: SidebarRooms_module_css_default.joinButton,
|
|
2265
|
-
disabled: joining === room.id,
|
|
2266
|
-
onClick: () => {
|
|
2267
|
-
onJoin(room.id);
|
|
2268
|
-
},
|
|
2269
|
-
children: joining === room.id ? t("joining") : t("joinRoom")
|
|
2270
|
-
})
|
|
2271
|
-
]
|
|
2498
|
+
children: visible.map((room) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RoomRow, {
|
|
2499
|
+
room,
|
|
2500
|
+
t,
|
|
2501
|
+
store,
|
|
2502
|
+
selected: room.id === activeRoomId,
|
|
2503
|
+
onOpen: () => store.open(room.id)
|
|
2272
2504
|
}) }, room.id))
|
|
2273
|
-
})
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2505
|
+
}),
|
|
2506
|
+
query.length > 0 && discoverable !== void 0 && joinable.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2507
|
+
className: SidebarRooms_module_css_default.discoverSection,
|
|
2508
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
2509
|
+
className: SidebarRooms_module_css_default.discoverHeading,
|
|
2510
|
+
children: t("discoverHeading")
|
|
2511
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", {
|
|
2512
|
+
className: SidebarRooms_module_css_default.flatList,
|
|
2513
|
+
children: joinable.map((room) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2514
|
+
className: SidebarRooms_module_css_default.discoverRow,
|
|
2515
|
+
children: [
|
|
2516
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2517
|
+
className: SidebarRooms_module_css_default.discoverName,
|
|
2518
|
+
children: room.name
|
|
2519
|
+
}),
|
|
2520
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2521
|
+
className: SidebarRooms_module_css_default.discoverMeta,
|
|
2522
|
+
children: t("discoverMembers").replace("{count}", String(room.memberCount))
|
|
2523
|
+
}),
|
|
2524
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
2525
|
+
type: "button",
|
|
2526
|
+
className: SidebarRooms_module_css_default.joinButton,
|
|
2527
|
+
disabled: joining === room.id,
|
|
2528
|
+
onClick: () => {
|
|
2529
|
+
onJoin(room.id);
|
|
2530
|
+
},
|
|
2531
|
+
children: joining === room.id ? t("joining") : t("joinRoom")
|
|
2532
|
+
})
|
|
2533
|
+
]
|
|
2534
|
+
}) }, room.id))
|
|
2535
|
+
})]
|
|
2536
|
+
})
|
|
2537
|
+
]
|
|
2538
|
+
}),
|
|
2539
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
2540
|
+
className: SidebarRooms_module_css_default.fade,
|
|
2541
|
+
"aria-hidden": "true"
|
|
2542
|
+
})
|
|
2543
|
+
]
|
|
2280
2544
|
}),
|
|
2281
2545
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(CreateRoomDialog, {
|
|
2282
2546
|
t,
|
|
@@ -2771,21 +3035,123 @@ window.__ModuleLoader__.load({
|
|
|
2771
3035
|
})]
|
|
2772
3036
|
});
|
|
2773
3037
|
}
|
|
3038
|
+
/**
|
|
3039
|
+
* Reads the quoted message out of a reply, if it has one.
|
|
3040
|
+
*
|
|
3041
|
+
* Returns `undefined` rather than a partial object: a quote with no preview has nothing to show,
|
|
3042
|
+
* and drawing an empty bar above the bubble would look like a rendering fault.
|
|
3043
|
+
*
|
|
3044
|
+
* @param message - the message data the node carries.
|
|
3045
|
+
* @returns the quote to draw, or `undefined` for an ordinary message.
|
|
3046
|
+
*/
|
|
3047
|
+
/**
|
|
3048
|
+
* The text of a message, joined from its text blocks.
|
|
3049
|
+
*
|
|
3050
|
+
* Only `text` blocks contribute: an image or a file has no words to quote, and including a
|
|
3051
|
+
* placeholder for it would put text in the reply that the author never wrote.
|
|
3052
|
+
*
|
|
3053
|
+
* @param message - the message data the node carries.
|
|
3054
|
+
* @returns the collapsed text, or `''` when the message has none.
|
|
3055
|
+
*/
|
|
3056
|
+
const previewOf = (message) => {
|
|
3057
|
+
const content = message?.content;
|
|
3058
|
+
if (typeof content === "string") return content.replace(/\s+/g, " ").trim();
|
|
3059
|
+
if (!Array.isArray(content)) return "";
|
|
3060
|
+
const parts = [];
|
|
3061
|
+
for (const block of content) {
|
|
3062
|
+
if (typeof block !== "object" || block === null) continue;
|
|
3063
|
+
const record = block;
|
|
3064
|
+
if (record["type"] !== "text") continue;
|
|
3065
|
+
const text = record["text"];
|
|
3066
|
+
if (typeof text === "string" && text.trim().length > 0) parts.push(text);
|
|
3067
|
+
}
|
|
3068
|
+
return parts.join(" ").replace(/\s+/g, " ").trim();
|
|
3069
|
+
};
|
|
3070
|
+
const quoteOf = (message) => {
|
|
3071
|
+
const content = message?.content;
|
|
3072
|
+
if (!Array.isArray(content)) return void 0;
|
|
3073
|
+
for (const block of content) {
|
|
3074
|
+
if (typeof block !== "object" || block === null) continue;
|
|
3075
|
+
const record = block;
|
|
3076
|
+
if (record["type"] !== "group-chat-quote") continue;
|
|
3077
|
+
const messageId = record["messageId"];
|
|
3078
|
+
const preview = record["preview"];
|
|
3079
|
+
if (typeof messageId !== "string" || messageId.length === 0) return void 0;
|
|
3080
|
+
if (typeof preview !== "string") return void 0;
|
|
3081
|
+
const authorName = typeof record["authorName"] === "string" && record["authorName"].trim().length > 0 ? record["authorName"].trim() : void 0;
|
|
3082
|
+
return {
|
|
3083
|
+
messageId,
|
|
3084
|
+
...authorName === void 0 ? {} : { authorName },
|
|
3085
|
+
preview
|
|
3086
|
+
};
|
|
3087
|
+
}
|
|
3088
|
+
};
|
|
3089
|
+
/**
|
|
3090
|
+
* Creates the store.
|
|
3091
|
+
*
|
|
3092
|
+
* A plain observable rather than a framework store, for the same reason the room list is one:
|
|
3093
|
+
* every consumer is a component this plugin already owns, so the subscription contract is just
|
|
3094
|
+
* `useSyncExternalStore`.
|
|
3095
|
+
*
|
|
3096
|
+
* @returns the store the client entry hands to the components that need it.
|
|
3097
|
+
*/
|
|
3098
|
+
const createQuoteStore = () => {
|
|
3099
|
+
const quotes = /* @__PURE__ */ new Map();
|
|
3100
|
+
const listeners = /* @__PURE__ */ new Set();
|
|
3101
|
+
const notify = () => {
|
|
3102
|
+
for (const listener of [...listeners]) listener();
|
|
3103
|
+
};
|
|
3104
|
+
return {
|
|
3105
|
+
getQuote: (roomId) => quotes.get(roomId),
|
|
3106
|
+
peek: (roomId) => quotes.get(roomId),
|
|
3107
|
+
subscribe: (listener) => {
|
|
3108
|
+
listeners.add(listener);
|
|
3109
|
+
return () => {
|
|
3110
|
+
listeners.delete(listener);
|
|
3111
|
+
};
|
|
3112
|
+
},
|
|
3113
|
+
start: (quote) => {
|
|
3114
|
+
quotes.set(quote.roomId, quote);
|
|
3115
|
+
notify();
|
|
3116
|
+
registerQuote(quote.roomId, quote).catch(() => void 0);
|
|
3117
|
+
},
|
|
3118
|
+
clear: (roomId) => {
|
|
3119
|
+
const had = quotes.delete(roomId);
|
|
3120
|
+
notify();
|
|
3121
|
+
if (had) clearQuote(roomId).catch(() => void 0);
|
|
3122
|
+
},
|
|
3123
|
+
clearLocal: (roomId) => {
|
|
3124
|
+
if (!quotes.delete(roomId)) return;
|
|
3125
|
+
notify();
|
|
3126
|
+
}
|
|
3127
|
+
};
|
|
3128
|
+
};
|
|
2774
3129
|
//#endregion
|
|
2775
3130
|
//#region \0dsh-css:/root/projects/dsh-plugins-plus/packages/group-chat/src/client/MessageSide.module.css.mjs
|
|
2776
|
-
const css$
|
|
2777
|
-
const tagId$
|
|
2778
|
-
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$
|
|
3131
|
+
const css$3 = ".KXabfq_otherRow{display:contents}.KXabfq_otherRow.KXabfq_otherRow>*{align-items:flex-start}.KXabfq_otherRow{flex-direction:column;align-items:flex-start;min-width:0;max-width:100%;display:flex}.KXabfq_author{min-width:0;max-width:100%;color:var(--dsw-alias-label-tertiary);align-items:center;gap:6px;margin:0 0 4px 2px;font-size:12px;line-height:16px;display:flex}.KXabfq_authorName{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.KXabfq_otherRow.KXabfq_otherRow>:not(.KXabfq_author){align-items:flex-start;max-width:100%}.KXabfq_quoteBar{box-sizing:border-box;background:var(--dsw-alias-bg-l2,#ffffff0a);border-radius:4px;align-items:stretch;gap:6px;max-width:min(420px,100%);margin-bottom:4px;padding:4px 8px 4px 0;display:flex;overflow:hidden}.KXabfq_quoteMark{background:var(--dsw-alias-brand-primary,currentcolor);opacity:.6;border-radius:1px;flex:none;width:2px}.KXabfq_quoteBody{min-width:0;color:var(--dsw-alias-label-secondary,inherit);align-items:baseline;gap:6px;font-size:12px;line-height:16px;display:flex}.KXabfq_quoteAuthor{white-space:nowrap;flex:none;font-weight:500}.KXabfq_quoteText{text-overflow:ellipsis;white-space:nowrap;opacity:.85;min-width:0;overflow:hidden}.KXabfq_selfRow{flex-direction:column;align-items:flex-end;min-width:0;max-width:100%;display:flex}.KXabfq_rowBody{align-items:flex-start;min-width:0;max-width:100%;display:flex;position:relative}.KXabfq_rowActions{opacity:0;align-items:center;transition:opacity .12s;display:flex;position:absolute;top:0;right:-28px}.KXabfq_otherRow:hover .KXabfq_rowActions,.KXabfq_rowActions:focus-within{opacity:1}.KXabfq_replyButton{width:calc(28px + var(--dsh-content-font-delta,0px));height:calc(28px + var(--dsh-content-font-delta,0px));border-radius:var(--dsw-radius-sm,6px);color:var(--dsw-alias-label-tertiary,inherit);cursor:pointer;background:0 0;border:none;justify-content:center;align-items:center;padding:6px;display:inline-flex}.KXabfq_replyButton:hover{background:var(--dsw-alias-bg-l2,#ffffff14);color:var(--dsw-alias-label-primary,inherit)}.KXabfq_replyButton:focus-visible{outline:2px solid var(--dsw-alias-brand-primary,currentcolor);outline-offset:1px}.KXabfq_selfBody{justify-content:flex-end;align-items:flex-start;min-width:0;max-width:100%;display:flex;position:relative}.KXabfq_rowActionsSelf{opacity:0;align-items:center;transition:opacity .12s;display:flex;position:absolute;top:0;left:-28px}.KXabfq_selfRow:hover .KXabfq_rowActionsSelf,.KXabfq_rowActionsSelf:focus-within{opacity:1}";
|
|
3132
|
+
const tagId$3 = "@sparkelf/dsh-group-chat/MessageSide.module.css";
|
|
3133
|
+
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$3) + "]") === null) {
|
|
2779
3134
|
const tag = document.createElement("style");
|
|
2780
3135
|
tag.dataset.plugin = "@sparkelf/dsh-group-chat";
|
|
2781
|
-
tag.dataset.pluginCss = tagId$
|
|
2782
|
-
tag.textContent = css$
|
|
3136
|
+
tag.dataset.pluginCss = tagId$3;
|
|
3137
|
+
tag.textContent = css$3;
|
|
2783
3138
|
document.head.appendChild(tag);
|
|
2784
3139
|
}
|
|
2785
3140
|
var MessageSide_module_css_default = {
|
|
2786
|
-
"
|
|
3141
|
+
"rowActionsSelf": "KXabfq_rowActionsSelf",
|
|
2787
3142
|
"author": "KXabfq_author",
|
|
2788
|
-
"
|
|
3143
|
+
"selfBody": "KXabfq_selfBody",
|
|
3144
|
+
"rowActions": "KXabfq_rowActions",
|
|
3145
|
+
"quoteBar": "KXabfq_quoteBar",
|
|
3146
|
+
"rowBody": "KXabfq_rowBody",
|
|
3147
|
+
"quoteMark": "KXabfq_quoteMark",
|
|
3148
|
+
"quoteText": "KXabfq_quoteText",
|
|
3149
|
+
"replyButton": "KXabfq_replyButton",
|
|
3150
|
+
"otherRow": "KXabfq_otherRow",
|
|
3151
|
+
"quoteBody": "KXabfq_quoteBody",
|
|
3152
|
+
"quoteAuthor": "KXabfq_quoteAuthor",
|
|
3153
|
+
"authorName": "KXabfq_authorName",
|
|
3154
|
+
"selfRow": "KXabfq_selfRow"
|
|
2789
3155
|
};
|
|
2790
3156
|
//#endregion
|
|
2791
3157
|
//#region src/client/MessageSide.tsx
|
|
@@ -2888,15 +3254,100 @@ window.__ModuleLoader__.load({
|
|
|
2888
3254
|
* @param props - the official props plus this wrapper's placement inputs.
|
|
2889
3255
|
* @returns the official view, wrapped only when the message is another author's room message.
|
|
2890
3256
|
*/
|
|
3257
|
+
/**
|
|
3258
|
+
* The bar above a bubble showing which message it answers.
|
|
3259
|
+
*
|
|
3260
|
+
* Drawn by this plugin rather than by the official view: the quote travels as a content block
|
|
3261
|
+
* whose type the official renderer does not know, so it would otherwise be dropped. The bar sits
|
|
3262
|
+
* outside the bubble so the reply's own text keeps the official layout.
|
|
3263
|
+
*
|
|
3264
|
+
* @param props - the quote to show.
|
|
3265
|
+
* @returns the bar, or `null` when there is nothing worth quoting.
|
|
3266
|
+
*/
|
|
3267
|
+
const QuoteBar = ({ quote }) => {
|
|
3268
|
+
if (quote.preview.length === 0) return null;
|
|
3269
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3270
|
+
className: MessageSide_module_css_default["quoteBar"],
|
|
3271
|
+
"data-group-chat-quote": quote.messageId,
|
|
3272
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3273
|
+
className: MessageSide_module_css_default["quoteMark"],
|
|
3274
|
+
"aria-hidden": "true"
|
|
3275
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
3276
|
+
className: MessageSide_module_css_default["quoteBody"],
|
|
3277
|
+
children: [quote.authorName === void 0 ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3278
|
+
className: MessageSide_module_css_default["quoteAuthor"],
|
|
3279
|
+
children: quote.authorName
|
|
3280
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3281
|
+
className: MessageSide_module_css_default["quoteText"],
|
|
3282
|
+
children: quote.preview
|
|
3283
|
+
})]
|
|
3284
|
+
})]
|
|
3285
|
+
});
|
|
3286
|
+
};
|
|
3287
|
+
/**
|
|
3288
|
+
* The control that starts a reply to one message.
|
|
3289
|
+
*
|
|
3290
|
+
* Rendered inside the wrapper this plugin already draws around another author's row, which is
|
|
3291
|
+
* the only place the message id is known. It reads its own hover state so the button appears
|
|
3292
|
+
* over the row it belongs to and nowhere else.
|
|
3293
|
+
*
|
|
3294
|
+
* @param props - the message it replies to, and the store the pick lands in.
|
|
3295
|
+
* @returns the button, or `null` when the message cannot be replied to.
|
|
3296
|
+
*/
|
|
3297
|
+
const ReplyControl = (props) => {
|
|
3298
|
+
const { roomId, messageId, authorName, preview, quotes, t } = props;
|
|
3299
|
+
if (preview.length === 0) return null;
|
|
3300
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
3301
|
+
type: "button",
|
|
3302
|
+
className: MessageSide_module_css_default["replyButton"],
|
|
3303
|
+
"data-group-chat-reply": "",
|
|
3304
|
+
"aria-label": t("reply"),
|
|
3305
|
+
title: t("reply"),
|
|
3306
|
+
onClick: () => {
|
|
3307
|
+
quotes.start({
|
|
3308
|
+
roomId,
|
|
3309
|
+
messageId,
|
|
3310
|
+
preview,
|
|
3311
|
+
...authorName === void 0 ? {} : { authorName }
|
|
3312
|
+
});
|
|
3313
|
+
},
|
|
3314
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
|
|
3315
|
+
width: "13",
|
|
3316
|
+
height: "13",
|
|
3317
|
+
viewBox: "0 0 16 16",
|
|
3318
|
+
fill: "none",
|
|
3319
|
+
stroke: "currentColor",
|
|
3320
|
+
strokeWidth: "1.5",
|
|
3321
|
+
strokeLinecap: "round",
|
|
3322
|
+
strokeLinejoin: "round",
|
|
3323
|
+
"aria-hidden": "true",
|
|
3324
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M6 4 2.5 7.5 6 11" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M2.5 7.5h7A3.5 3.5 0 0 1 13 11v1.5" })]
|
|
3325
|
+
})
|
|
3326
|
+
});
|
|
3327
|
+
};
|
|
2891
3328
|
const MessageSide = (props) => {
|
|
2892
|
-
const { node, Official, getSelfId, subscribeSelf, sided, getRoster } = props;
|
|
3329
|
+
const { node, Official, getSelfId, subscribeSelf, sided, getRoster, quotes } = props;
|
|
2893
3330
|
const selfId = (0, react.useSyncExternalStore)(subscribeSelf, getSelfId, getSelfId);
|
|
2894
3331
|
if (typeof Official !== "function" && typeof Official !== "object") return null;
|
|
2895
3332
|
const view = (0, react.createElement)(Official, props);
|
|
2896
3333
|
const message = node?.data;
|
|
2897
|
-
|
|
3334
|
+
const side = sided ? messageSide(message, selfId) : void 0;
|
|
3335
|
+
const quote = quoteOf(message);
|
|
2898
3336
|
const roomId = message?.source?.roomId;
|
|
2899
|
-
const
|
|
3337
|
+
const roomKnown = typeof roomId === "string" && roomId.length > 0;
|
|
3338
|
+
const sourceMessageId = message?.source?.messageId;
|
|
3339
|
+
const rawId = message?.id;
|
|
3340
|
+
const messageId = typeof sourceMessageId === "string" && sourceMessageId.length > 0 ? sourceMessageId : typeof rawId === "string" && rawId.length > 0 ? rawId : void 0;
|
|
3341
|
+
if (side === void 0 || !roomKnown) {
|
|
3342
|
+
if (quote === void 0) return view;
|
|
3343
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3344
|
+
className: MessageSide_module_css_default["selfRow"],
|
|
3345
|
+
"data-group-chat-side": "self",
|
|
3346
|
+
...messageId === void 0 ? {} : { "data-group-chat-message": messageId },
|
|
3347
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(QuoteBar, { quote }), view]
|
|
3348
|
+
});
|
|
3349
|
+
}
|
|
3350
|
+
const member = authorOf(message, getRoster(roomId));
|
|
2900
3351
|
const name = authorNameOf(member);
|
|
2901
3352
|
const head = name === void 0 || member === void 0 ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2902
3353
|
className: MessageSide_module_css_default["author"],
|
|
@@ -2910,10 +3361,40 @@ window.__ModuleLoader__.load({
|
|
|
2910
3361
|
children: name
|
|
2911
3362
|
})]
|
|
2912
3363
|
});
|
|
3364
|
+
const rawPreview = previewOf(message);
|
|
3365
|
+
const preview = name === void 0 ? rawPreview : rawPreview.replace(new RegExp(`^${name.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}\\s*[::]\\s*`), "");
|
|
3366
|
+
const actions = quotes !== void 0 && messageId !== void 0 && preview.length > 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3367
|
+
className: side === "self" ? MessageSide_module_css_default["rowActionsSelf"] : MessageSide_module_css_default["rowActions"],
|
|
3368
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ReplyControl, {
|
|
3369
|
+
roomId,
|
|
3370
|
+
messageId,
|
|
3371
|
+
...name === void 0 ? {} : { authorName: name },
|
|
3372
|
+
preview,
|
|
3373
|
+
quotes,
|
|
3374
|
+
t: props.tOwn ?? ((key) => key)
|
|
3375
|
+
})
|
|
3376
|
+
}) : null;
|
|
3377
|
+
if (side === "self") return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3378
|
+
className: MessageSide_module_css_default["selfRow"],
|
|
3379
|
+
"data-group-chat-side": "self",
|
|
3380
|
+
...messageId === void 0 ? {} : { "data-group-chat-message": messageId },
|
|
3381
|
+
children: [quote === void 0 ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(QuoteBar, { quote }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3382
|
+
className: MessageSide_module_css_default["selfBody"],
|
|
3383
|
+
children: [view, actions]
|
|
3384
|
+
})]
|
|
3385
|
+
});
|
|
2913
3386
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2914
3387
|
className: MessageSide_module_css_default["otherRow"],
|
|
2915
3388
|
"data-group-chat-side": "other",
|
|
2916
|
-
|
|
3389
|
+
...messageId === void 0 ? {} : { "data-group-chat-message": messageId },
|
|
3390
|
+
children: [
|
|
3391
|
+
head,
|
|
3392
|
+
quote === void 0 ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(QuoteBar, { quote }),
|
|
3393
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3394
|
+
className: MessageSide_module_css_default["rowBody"],
|
|
3395
|
+
children: [view, actions]
|
|
3396
|
+
})
|
|
3397
|
+
]
|
|
2917
3398
|
});
|
|
2918
3399
|
};
|
|
2919
3400
|
//#endregion
|
|
@@ -2948,56 +3429,56 @@ window.__ModuleLoader__.load({
|
|
|
2948
3429
|
};
|
|
2949
3430
|
//#endregion
|
|
2950
3431
|
//#region \0dsh-css:/root/projects/dsh-plugins-plus/packages/group-chat/src/client/MembersPanel.module.css.mjs
|
|
2951
|
-
const css$
|
|
2952
|
-
const tagId$
|
|
2953
|
-
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$
|
|
3432
|
+
const css$2 = ".VeQVAa_root{box-sizing:border-box;flex-direction:column;gap:16px;min-width:200px;padding:12px 12px 20px;display:flex}.VeQVAa_section{flex-direction:column;gap:8px;min-width:0;display:flex}.VeQVAa_section+.VeQVAa_section{border-top:1px solid var(--dsw-alias-border-l3);padding-top:14px}.VeQVAa_sectionHeader{align-items:center;gap:6px;min-width:0;display:flex}.VeQVAa_sectionToggle{min-width:0;color:inherit;font:inherit;cursor:pointer;text-align:start;background:0 0;border:0;align-items:center;gap:4px;padding:0;display:flex}.VeQVAa_caret{width:10px;color:var(--dsw-alias-label-tertiary);flex:none;font-size:10px;line-height:12px}.VeQVAa_sectionBody{flex-direction:column;gap:8px;min-width:0;display:flex}.VeQVAa_sectionLabel{color:var(--dsw-alias-label-primary);font-size:13px;font-weight:600;line-height:18px}.VeQVAa_count{color:var(--dsw-alias-label-tertiary);font-size:12px;line-height:16px}.VeQVAa_searchToggle{border-radius:var(--dsw-radius-sm);width:20px;height:20px;color:var(--dsw-alias-label-tertiary);cursor:pointer;background:0 0;border:0;flex:none;justify-content:center;align-items:center;margin-left:auto;padding:0;display:flex}.VeQVAa_searchToggle:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}.VeQVAa_searchToggle:focus-visible{outline:2px solid var(--dsw-alias-label-primary);outline-offset:1px}.VeQVAa_linkButton{border-radius:var(--dsw-radius-sm);color:var(--dsw-alias-state-business-primary);font:inherit;cursor:pointer;background:0 0;border:none;margin-left:auto;padding:2px 6px;font-size:12px}.VeQVAa_linkButton:hover{background:var(--dsw-alias-interactive-bg-hover)}.VeQVAa_announcementText{border-radius:var(--dsw-radius-sm);background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary);white-space:pre-wrap;overflow-wrap:anywhere;margin:0;padding:8px 10px;font-size:13px;line-height:20px}.VeQVAa_editor{flex-direction:column;gap:8px;display:flex}.VeQVAa_textarea{box-sizing:border-box;border:1px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);width:100%;color:var(--dsw-alias-label-primary);font:inherit;resize:vertical;background:0 0;padding:8px 10px;font-size:13px;line-height:20px}.VeQVAa_textarea:focus{border-color:var(--dsw-alias-state-business-primary);outline:none}.VeQVAa_editorFooter{align-items:center;gap:6px;display:flex}.VeQVAa_editorFooter .VeQVAa_hint{margin-right:auto}.VeQVAa_hint{color:var(--dsw-alias-label-tertiary);margin:0;font-size:12px;line-height:16px}.VeQVAa_unavailable{color:var(--dsw-alias-label-tertiary);margin:0;font-size:12px;line-height:18px}.VeQVAa_error{color:var(--dsw-alias-state-error-primary,var(--dsw-alias-label-primary));margin:0;font-size:12px;line-height:16px}.VeQVAa_notice{color:var(--dsw-alias-label-tertiary);margin:0;padding:16px 12px;font-size:12px;line-height:18px}.VeQVAa_search{min-width:0}.VeQVAa_list{flex-direction:column;margin:0;padding:0;list-style:none;display:flex}.VeQVAa_row{border-radius:var(--dsw-radius-sm);align-items:center;gap:8px;min-width:0;padding:5px 4px;display:flex}.VeQVAa_row:hover{background:var(--dsw-alias-interactive-bg-hover)}.VeQVAa_name{min-width:0;color:var(--dsw-alias-label-primary);text-overflow:ellipsis;white-space:nowrap;flex:auto;font-size:13px;line-height:18px;overflow:hidden}.VeQVAa_fileButton{width:100%;color:inherit;font:inherit;text-align:start;cursor:pointer;border-radius:var(--dsw-alias-border-radius-s);background:0 0;border:0;align-items:center;gap:8px;padding:0;display:flex}.VeQVAa_fileButton:hover .VeQVAa_name{text-decoration:underline}.VeQVAa_filePicker{display:none}.VeQVAa_crumbs{flex-wrap:wrap;align-items:center;gap:2px;min-width:0;display:flex}.VeQVAa_crumbGroup{align-items:center;gap:2px;min-width:0;display:inline-flex}.VeQVAa_crumb{text-overflow:ellipsis;white-space:nowrap;max-width:120px;color:var(--dsw-alias-label-secondary);font:inherit;cursor:pointer;background:0 0;border:0;padding:0 2px;font-size:11px;overflow:hidden}.VeQVAa_crumb:hover{color:var(--dsw-alias-label-primary);text-decoration:underline}.VeQVAa_crumbSep{color:var(--dsw-alias-label-tertiary);font-size:11px}.VeQVAa_refresh{color:var(--dsw-alias-label-tertiary);cursor:pointer;background:0 0;border:0;margin-inline-start:auto;padding:0 4px;font-size:12px;line-height:16px}.VeQVAa_refresh:hover{color:var(--dsw-alias-label-primary)}.VeQVAa_preview{border:1px solid var(--dsw-alias-border-l1);border-radius:var(--dsw-alias-border-radius-m);background:var(--dsw-alias-bg-layer-1,var(--dsw-alias-bg-base));margin-top:8px;overflow:hidden}.VeQVAa_previewHeader{border-bottom:1px solid var(--dsw-alias-border-l1);align-items:center;gap:8px;padding:6px 8px;display:flex}.VeQVAa_previewTitle{text-overflow:ellipsis;white-space:nowrap;flex:auto;min-width:0;font-size:12px;font-weight:500;overflow:hidden}.VeQVAa_previewClose{color:var(--dsw-alias-label-tertiary);cursor:pointer;background:0 0;border:0;flex:none;padding:0 4px;font-size:14px;line-height:16px}.VeQVAa_previewClose:hover{color:var(--dsw-alias-label-primary)}.VeQVAa_previewImage{border-radius:var(--dsw-alias-border-radius-s);background:var(--dsw-alias-bg-base);max-width:100%;height:auto;display:block}.VeQVAa_previewBody{max-height:240px;font-family:var(--dsw-alias-font-family-mono,monospace);white-space:pre-wrap;word-break:break-word;margin:0;padding:8px;font-size:11px;line-height:16px;overflow:auto}.VeQVAa_fileIcon{text-align:center;flex:none;width:16px;font-size:12px;line-height:16px}.VeQVAa_fileSize{color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums;flex:none;font-size:11px}.VeQVAa_remove{border-radius:var(--dsw-radius-sm);width:20px;height:20px;color:var(--dsw-alias-label-tertiary);opacity:0;cursor:pointer;background:0 0;border:none;flex:none;justify-content:center;align-items:center;padding:0;transition:opacity .12s,background .12s,color .12s;display:inline-flex}.VeQVAa_row:hover .VeQVAa_remove,.VeQVAa_remove:focus-visible{opacity:1}.VeQVAa_remove:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-state-error-primary)}.VeQVAa_selfTag{border-radius:var(--dsw-radius-sm);background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-tertiary);flex:none;padding:0 5px;font-size:11px;line-height:16px}.VeQVAa_ownerTag{border:1px solid color-mix(in srgb, var(--dsw-alias-state-warning-primary,#f7ad31) 40%, transparent);border-radius:var(--dsw-radius-sm);color:var(--dsw-alias-state-warning-primary,#f7ad31);flex:none;padding:0 5px;font-size:11px;line-height:16px}";
|
|
3433
|
+
const tagId$2 = "@sparkelf/dsh-group-chat/MembersPanel.module.css";
|
|
3434
|
+
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$2) + "]") === null) {
|
|
2954
3435
|
const tag = document.createElement("style");
|
|
2955
3436
|
tag.dataset.plugin = "@sparkelf/dsh-group-chat";
|
|
2956
|
-
tag.dataset.pluginCss = tagId$
|
|
2957
|
-
tag.textContent = css$
|
|
3437
|
+
tag.dataset.pluginCss = tagId$2;
|
|
3438
|
+
tag.textContent = css$2;
|
|
2958
3439
|
document.head.appendChild(tag);
|
|
2959
3440
|
}
|
|
2960
3441
|
var MembersPanel_module_css_default = {
|
|
2961
|
-
"
|
|
2962
|
-
"
|
|
2963
|
-
"name": "VeQVAa_name",
|
|
2964
|
-
"previewClose": "VeQVAa_previewClose",
|
|
2965
|
-
"unavailable": "VeQVAa_unavailable",
|
|
2966
|
-
"crumbGroup": "VeQVAa_crumbGroup",
|
|
2967
|
-
"textarea": "VeQVAa_textarea",
|
|
2968
|
-
"search": "VeQVAa_search",
|
|
3442
|
+
"filePicker": "VeQVAa_filePicker",
|
|
3443
|
+
"sectionLabel": "VeQVAa_sectionLabel",
|
|
2969
3444
|
"linkButton": "VeQVAa_linkButton",
|
|
2970
|
-
"
|
|
2971
|
-
"previewImage": "VeQVAa_previewImage",
|
|
2972
|
-
"section": "VeQVAa_section",
|
|
2973
|
-
"sectionToggle": "VeQVAa_sectionToggle",
|
|
3445
|
+
"row": "VeQVAa_row",
|
|
2974
3446
|
"fileSize": "VeQVAa_fileSize",
|
|
2975
|
-
"
|
|
2976
|
-
"
|
|
2977
|
-
"ownerTag": "VeQVAa_ownerTag",
|
|
2978
|
-
"sectionBody": "VeQVAa_sectionBody",
|
|
3447
|
+
"crumbs": "VeQVAa_crumbs",
|
|
3448
|
+
"fileIcon": "VeQVAa_fileIcon",
|
|
2979
3449
|
"preview": "VeQVAa_preview",
|
|
2980
|
-
"
|
|
2981
|
-
"sectionHeader": "VeQVAa_sectionHeader",
|
|
2982
|
-
"remove": "VeQVAa_remove",
|
|
2983
|
-
"editor": "VeQVAa_editor",
|
|
2984
|
-
"error": "VeQVAa_error",
|
|
2985
|
-
"caret": "VeQVAa_caret",
|
|
2986
|
-
"count": "VeQVAa_count",
|
|
3450
|
+
"searchToggle": "VeQVAa_searchToggle",
|
|
2987
3451
|
"crumb": "VeQVAa_crumb",
|
|
2988
|
-
"row": "VeQVAa_row",
|
|
2989
|
-
"filePicker": "VeQVAa_filePicker",
|
|
2990
|
-
"refresh": "VeQVAa_refresh",
|
|
2991
|
-
"previewHeader": "VeQVAa_previewHeader",
|
|
2992
3452
|
"editorFooter": "VeQVAa_editorFooter",
|
|
3453
|
+
"previewClose": "VeQVAa_previewClose",
|
|
2993
3454
|
"root": "VeQVAa_root",
|
|
3455
|
+
"error": "VeQVAa_error",
|
|
3456
|
+
"sectionToggle": "VeQVAa_sectionToggle",
|
|
3457
|
+
"unavailable": "VeQVAa_unavailable",
|
|
3458
|
+
"editor": "VeQVAa_editor",
|
|
3459
|
+
"previewTitle": "VeQVAa_previewTitle",
|
|
3460
|
+
"previewImage": "VeQVAa_previewImage",
|
|
2994
3461
|
"previewBody": "VeQVAa_previewBody",
|
|
2995
|
-
"
|
|
2996
|
-
"
|
|
3462
|
+
"count": "VeQVAa_count",
|
|
3463
|
+
"crumbSep": "VeQVAa_crumbSep",
|
|
3464
|
+
"sectionBody": "VeQVAa_sectionBody",
|
|
3465
|
+
"notice": "VeQVAa_notice",
|
|
3466
|
+
"textarea": "VeQVAa_textarea",
|
|
3467
|
+
"selfTag": "VeQVAa_selfTag",
|
|
2997
3468
|
"hint": "VeQVAa_hint",
|
|
2998
|
-
"
|
|
3469
|
+
"refresh": "VeQVAa_refresh",
|
|
3470
|
+
"section": "VeQVAa_section",
|
|
3471
|
+
"ownerTag": "VeQVAa_ownerTag",
|
|
3472
|
+
"caret": "VeQVAa_caret",
|
|
3473
|
+
"crumbGroup": "VeQVAa_crumbGroup",
|
|
3474
|
+
"fileButton": "VeQVAa_fileButton",
|
|
3475
|
+
"name": "VeQVAa_name",
|
|
3476
|
+
"previewHeader": "VeQVAa_previewHeader",
|
|
3477
|
+
"search": "VeQVAa_search",
|
|
2999
3478
|
"list": "VeQVAa_list",
|
|
3000
|
-
"
|
|
3479
|
+
"announcementText": "VeQVAa_announcementText",
|
|
3480
|
+
"remove": "VeQVAa_remove",
|
|
3481
|
+
"sectionHeader": "VeQVAa_sectionHeader"
|
|
3001
3482
|
};
|
|
3002
3483
|
//#endregion
|
|
3003
3484
|
//#region src/client/MembersPanel.tsx
|
|
@@ -3610,21 +4091,21 @@ window.__ModuleLoader__.load({
|
|
|
3610
4091
|
}
|
|
3611
4092
|
//#endregion
|
|
3612
4093
|
//#region \0dsh-css:/root/projects/dsh-plugins-plus/packages/group-chat/src/client/GuideEntry.module.css.mjs
|
|
3613
|
-
const css = "._0Vnsuq_entry{box-sizing:border-box;border:.5px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-xl);background:var(--dsw-alias-bg-layer-1);width:380px;max-width:100%;min-height:56px;color:var(--dsw-alias-label-primary);font:inherit;text-align:left;cursor:pointer;align-items:center;gap:14px;padding:14px 20px;display:flex}._0Vnsuq_entry:hover{background:var(--dsw-alias-interactive-bg-hover)}._0Vnsuq_icon{width:26px;height:26px;color:var(--dsw-alias-label-secondary);flex:none;justify-content:center;align-items:center;display:flex}._0Vnsuq_text{flex-direction:column;flex:1;gap:3px;min-width:0;display:flex}._0Vnsuq_title{text-overflow:ellipsis;white-space:nowrap;font-size:14px;line-height:1.4;overflow:hidden}._0Vnsuq_description{color:var(--dsw-alias-label-tertiary);text-overflow:ellipsis;white-space:nowrap;font-size:11px;line-height:1.4;overflow:hidden}";
|
|
3614
|
-
const tagId = "@sparkelf/dsh-group-chat/GuideEntry.module.css";
|
|
3615
|
-
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId) + "]") === null) {
|
|
4094
|
+
const css$1 = "._0Vnsuq_entry{box-sizing:border-box;border:.5px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-xl);background:var(--dsw-alias-bg-layer-1);width:380px;max-width:100%;min-height:56px;color:var(--dsw-alias-label-primary);font:inherit;text-align:left;cursor:pointer;align-items:center;gap:14px;padding:14px 20px;display:flex}._0Vnsuq_entry:hover{background:var(--dsw-alias-interactive-bg-hover)}._0Vnsuq_icon{width:26px;height:26px;color:var(--dsw-alias-label-secondary);flex:none;justify-content:center;align-items:center;display:flex}._0Vnsuq_text{flex-direction:column;flex:1;gap:3px;min-width:0;display:flex}._0Vnsuq_title{text-overflow:ellipsis;white-space:nowrap;font-size:14px;line-height:1.4;overflow:hidden}._0Vnsuq_description{color:var(--dsw-alias-label-tertiary);text-overflow:ellipsis;white-space:nowrap;font-size:11px;line-height:1.4;overflow:hidden}";
|
|
4095
|
+
const tagId$1 = "@sparkelf/dsh-group-chat/GuideEntry.module.css";
|
|
4096
|
+
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$1) + "]") === null) {
|
|
3616
4097
|
const tag = document.createElement("style");
|
|
3617
4098
|
tag.dataset.plugin = "@sparkelf/dsh-group-chat";
|
|
3618
|
-
tag.dataset.pluginCss = tagId;
|
|
3619
|
-
tag.textContent = css;
|
|
4099
|
+
tag.dataset.pluginCss = tagId$1;
|
|
4100
|
+
tag.textContent = css$1;
|
|
3620
4101
|
document.head.appendChild(tag);
|
|
3621
4102
|
}
|
|
3622
4103
|
var GuideEntry_module_css_default = {
|
|
3623
4104
|
"title": "_0Vnsuq_title",
|
|
3624
|
-
"text": "_0Vnsuq_text",
|
|
3625
4105
|
"icon": "_0Vnsuq_icon",
|
|
4106
|
+
"entry": "_0Vnsuq_entry",
|
|
3626
4107
|
"description": "_0Vnsuq_description",
|
|
3627
|
-
"
|
|
4108
|
+
"text": "_0Vnsuq_text"
|
|
3628
4109
|
};
|
|
3629
4110
|
//#endregion
|
|
3630
4111
|
//#region src/client/GuideEntry.tsx
|
|
@@ -3680,6 +4161,82 @@ window.__ModuleLoader__.load({
|
|
|
3680
4161
|
});
|
|
3681
4162
|
}
|
|
3682
4163
|
//#endregion
|
|
4164
|
+
//#region \0dsh-css:/root/projects/dsh-plugins-plus/packages/group-chat/src/client/QuoteComposer.module.css.mjs
|
|
4165
|
+
const css = ".AK6KxW_button{width:24px;height:24px;color:var(--dsw-alias-label-secondary,inherit);cursor:pointer;opacity:.7;background:0 0;border:none;border-radius:6px;justify-content:center;align-items:center;padding:0;transition:opacity .12s,background-color .12s;display:inline-flex}.AK6KxW_button:hover{opacity:1;background:var(--dsw-alias-bg-l2,#ffffff14)}.AK6KxW_button:focus-visible{outline:2px solid var(--dsw-alias-brand-primary,currentcolor);outline-offset:1px}.AK6KxW_bar{box-sizing:border-box;width:100%;max-width:var(--dsh-chat-content-width,100%);background:var(--dsw-alias-bg-l2,#ffffff0a);border-radius:8px;align-items:center;gap:6px;margin:0 auto 4px;padding:6px 8px;display:flex}.AK6KxW_mark{background:var(--dsw-alias-brand-primary,currentcolor);opacity:.6;border-radius:1px;flex:none;align-self:stretch;width:2px}.AK6KxW_body{min-width:0;color:var(--dsw-alias-label-secondary,inherit);align-items:baseline;gap:6px;font-size:12px;line-height:16px;display:flex}.AK6KxW_author{white-space:nowrap;flex:none;font-weight:500}.AK6KxW_text{text-overflow:ellipsis;white-space:nowrap;opacity:.85;min-width:0;overflow:hidden}.AK6KxW_dismiss{width:20px;height:20px;color:var(--dsw-alias-label-secondary,inherit);cursor:pointer;background:0 0;border:none;border-radius:4px;flex:none;margin-left:auto;padding:0;font-size:16px;line-height:1}.AK6KxW_dismiss:hover{background:var(--dsw-alias-bg-l3,#ffffff1a);color:var(--dsw-alias-label-primary,inherit)}";
|
|
4166
|
+
const tagId = "@sparkelf/dsh-group-chat/QuoteComposer.module.css";
|
|
4167
|
+
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId) + "]") === null) {
|
|
4168
|
+
const tag = document.createElement("style");
|
|
4169
|
+
tag.dataset.plugin = "@sparkelf/dsh-group-chat";
|
|
4170
|
+
tag.dataset.pluginCss = tagId;
|
|
4171
|
+
tag.textContent = css;
|
|
4172
|
+
document.head.appendChild(tag);
|
|
4173
|
+
}
|
|
4174
|
+
var QuoteComposer_module_css_default = {
|
|
4175
|
+
"button": "AK6KxW_button",
|
|
4176
|
+
"mark": "AK6KxW_mark",
|
|
4177
|
+
"body": "AK6KxW_body",
|
|
4178
|
+
"bar": "AK6KxW_bar",
|
|
4179
|
+
"author": "AK6KxW_author",
|
|
4180
|
+
"dismiss": "AK6KxW_dismiss",
|
|
4181
|
+
"text": "AK6KxW_text"
|
|
4182
|
+
};
|
|
4183
|
+
//#endregion
|
|
4184
|
+
//#region src/client/QuoteComposer.tsx
|
|
4185
|
+
/**
|
|
4186
|
+
* The two composer-side pieces of a reply: the button that starts one and the bar that shows
|
|
4187
|
+
* the message being answered.
|
|
4188
|
+
*
|
|
4189
|
+
* Both are seats on official composers, and both are deliberately dumb: they read a pending
|
|
4190
|
+
* quote from the store and call back into it. Nothing here sends a message — the quote reaches
|
|
4191
|
+
* the room because `MessageSide` attaches it when the reply is submitted, and keeping that
|
|
4192
|
+
* decision in one place is why these two do not also try to.
|
|
4193
|
+
*
|
|
4194
|
+
* @module @sparkelf/dsh-group-chat/client/QuoteComposer
|
|
4195
|
+
*/
|
|
4196
|
+
/**
|
|
4197
|
+
* The bar above the composer showing what the reply answers.
|
|
4198
|
+
*
|
|
4199
|
+
* Sits in the composer's own stack rather than over the input, so the text the reader types is
|
|
4200
|
+
* never covered by it. Absent when nothing is being answered, which is the common case.
|
|
4201
|
+
*/
|
|
4202
|
+
const PendingQuoteBar = (props) => {
|
|
4203
|
+
const { t, quotes, store } = props;
|
|
4204
|
+
const roomId = (0, react.useSyncExternalStore)(store.subscribe, () => store.getState().activeRoomId, () => store.getState().activeRoomId);
|
|
4205
|
+
const read = () => roomId === void 0 ? void 0 : quotes.getQuote(roomId);
|
|
4206
|
+
const quote = (0, react.useSyncExternalStore)(quotes.subscribe, read, read);
|
|
4207
|
+
if (roomId === void 0 || quote === void 0) return null;
|
|
4208
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4209
|
+
className: QuoteComposer_module_css_default.bar,
|
|
4210
|
+
"data-group-chat-pending-quote": quote.messageId,
|
|
4211
|
+
children: [
|
|
4212
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4213
|
+
className: QuoteComposer_module_css_default.mark,
|
|
4214
|
+
"aria-hidden": "true"
|
|
4215
|
+
}),
|
|
4216
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
4217
|
+
className: QuoteComposer_module_css_default.body,
|
|
4218
|
+
children: [quote.authorName === void 0 ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4219
|
+
className: QuoteComposer_module_css_default.author,
|
|
4220
|
+
children: quote.authorName
|
|
4221
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4222
|
+
className: QuoteComposer_module_css_default.text,
|
|
4223
|
+
children: quote.preview
|
|
4224
|
+
})]
|
|
4225
|
+
}),
|
|
4226
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
4227
|
+
type: "button",
|
|
4228
|
+
className: QuoteComposer_module_css_default.dismiss,
|
|
4229
|
+
"aria-label": t("replyCancel"),
|
|
4230
|
+
title: t("replyCancel"),
|
|
4231
|
+
onClick: () => {
|
|
4232
|
+
quotes.clear(roomId);
|
|
4233
|
+
},
|
|
4234
|
+
children: "×"
|
|
4235
|
+
})
|
|
4236
|
+
]
|
|
4237
|
+
});
|
|
4238
|
+
};
|
|
4239
|
+
//#endregion
|
|
3683
4240
|
//#region src/client/locales.ts
|
|
3684
4241
|
/**
|
|
3685
4242
|
* Group-chat copy, in the shape every locale-backed DSH client plugin uses: one
|
|
@@ -3782,6 +4339,12 @@ window.__ModuleLoader__.load({
|
|
|
3782
4339
|
membersFileUpload: "Upload a file",
|
|
3783
4340
|
membersFileUploadFailed: "Upload failed.",
|
|
3784
4341
|
resizeRegion: "Resize the group chat region",
|
|
4342
|
+
reply: "Reply",
|
|
4343
|
+
replyCancel: "Cancel reply",
|
|
4344
|
+
searchMessages: "Search messages",
|
|
4345
|
+
searchMessagesPlaceholder: "Search message text",
|
|
4346
|
+
searchMessagesEmpty: "No message matches",
|
|
4347
|
+
searching: "Searching…",
|
|
3785
4348
|
membersFilesRoot: "Files",
|
|
3786
4349
|
membersOwner: "Owner",
|
|
3787
4350
|
membersNotARoom: "This conversation is not a group chat, so it has no members.",
|
|
@@ -3926,6 +4489,12 @@ window.__ModuleLoader__.load({
|
|
|
3926
4489
|
membersFileUpload: "上传文件",
|
|
3927
4490
|
membersFileUploadFailed: "上传失败。",
|
|
3928
4491
|
resizeRegion: "拖动调节群聊区域高度",
|
|
4492
|
+
reply: "引用",
|
|
4493
|
+
replyCancel: "取消引用",
|
|
4494
|
+
searchMessages: "搜索消息",
|
|
4495
|
+
searchMessagesPlaceholder: "搜索消息内容",
|
|
4496
|
+
searchMessagesEmpty: "没有匹配的消息",
|
|
4497
|
+
searching: "搜索中…",
|
|
3929
4498
|
membersFilesRoot: "群文件",
|
|
3930
4499
|
membersOwner: "群主",
|
|
3931
4500
|
membersNotARoom: "该会话不是群聊,没有群成员。",
|
|
@@ -4031,6 +4600,8 @@ window.__ModuleLoader__.load({
|
|
|
4031
4600
|
* is keyed by id — the same split the official schedule plugin makes.
|
|
4032
4601
|
*/
|
|
4033
4602
|
const MEMBERS_TAB_ID = "@sparkelf/dsh-group-chat/members";
|
|
4603
|
+
/** Id of the pending-reply bar in the composer's dock. */
|
|
4604
|
+
const QUOTE_DOCK_ID = "@sparkelf/dsh-group-chat/quote";
|
|
4034
4605
|
/**
|
|
4035
4606
|
* The guide entry's own identity, and where it sorts on the start page.
|
|
4036
4607
|
*
|
|
@@ -4060,6 +4631,41 @@ window.__ModuleLoader__.load({
|
|
|
4060
4631
|
const t = ctx.locale.bind(NS);
|
|
4061
4632
|
const tPreset = ctx.locale.bind(PRESET_LOCALE_NS);
|
|
4062
4633
|
const base = createRoomStore();
|
|
4634
|
+
const quotes = createQuoteStore();
|
|
4635
|
+
/**
|
|
4636
|
+
* Drops the pending reply once the composer submits.
|
|
4637
|
+
*
|
|
4638
|
+
* The composer belongs to the official chat surface, so there is no submit callback to hook.
|
|
4639
|
+
* What is stable is how a submission looks: Enter inside the editor, or a click on the send
|
|
4640
|
+
* button. Both are observed at the document in the capture phase — before the official handler
|
|
4641
|
+
* runs — and this side's pending reply is dropped for the open room. Only the local copy goes:
|
|
4642
|
+
* the host still needs its own to attach the quote to the message being published, and deleting
|
|
4643
|
+
* it here would send the reply bare.
|
|
4644
|
+
*/
|
|
4645
|
+
const dropQuoteOnSubmit = () => {
|
|
4646
|
+
const clearActive = () => {
|
|
4647
|
+
const roomId = store.getState().activeRoomId;
|
|
4648
|
+
if (roomId !== void 0) quotes.clearLocal(roomId);
|
|
4649
|
+
};
|
|
4650
|
+
const onSubmitKey = (event) => {
|
|
4651
|
+
if (event.key !== "Enter" || event.shiftKey || event.isComposing) return;
|
|
4652
|
+
const target = event.target;
|
|
4653
|
+
if (target instanceof Element && target.closest("[contenteditable=\"true\"]") !== null) clearActive();
|
|
4654
|
+
};
|
|
4655
|
+
const onSubmitClick = (event) => {
|
|
4656
|
+
const target = event.target;
|
|
4657
|
+
if (!(target instanceof Element)) return;
|
|
4658
|
+
const label = target.closest("button[aria-label]")?.getAttribute("aria-label") ?? "";
|
|
4659
|
+
if (/发送|send/i.test(label)) clearActive();
|
|
4660
|
+
};
|
|
4661
|
+
document.addEventListener("keydown", onSubmitKey, true);
|
|
4662
|
+
document.addEventListener("click", onSubmitClick, true);
|
|
4663
|
+
return () => {
|
|
4664
|
+
document.removeEventListener("keydown", onSubmitKey, true);
|
|
4665
|
+
document.removeEventListener("click", onSubmitClick, true);
|
|
4666
|
+
};
|
|
4667
|
+
};
|
|
4668
|
+
ctx.effect(dropQuoteOnSubmit);
|
|
4063
4669
|
const store = {
|
|
4064
4670
|
...base,
|
|
4065
4671
|
open: (roomId) => {
|
|
@@ -4212,7 +4818,9 @@ window.__ModuleLoader__.load({
|
|
|
4212
4818
|
getSelfId: store.selfId,
|
|
4213
4819
|
subscribeSelf: store.subscribe,
|
|
4214
4820
|
getRoster: (roomId) => store.getState().members[roomId],
|
|
4215
|
-
sided: props["node"] !== void 0
|
|
4821
|
+
sided: props["node"] !== void 0,
|
|
4822
|
+
quotes,
|
|
4823
|
+
tOwn: t
|
|
4216
4824
|
}));
|
|
4217
4825
|
} catch (error) {
|
|
4218
4826
|
logClaimFailure(key, error);
|
|
@@ -4227,6 +4835,16 @@ window.__ModuleLoader__.load({
|
|
|
4227
4835
|
release();
|
|
4228
4836
|
};
|
|
4229
4837
|
});
|
|
4838
|
+
ctx.effect(() => ctx.slots.inject("conversation.input.dock", () => ctx.slots.register({
|
|
4839
|
+
name: "conversation.input.dock",
|
|
4840
|
+
id: QUOTE_DOCK_ID,
|
|
4841
|
+
locale: NS,
|
|
4842
|
+
inject: (() => ({
|
|
4843
|
+
t,
|
|
4844
|
+
quotes,
|
|
4845
|
+
store
|
|
4846
|
+
}))
|
|
4847
|
+
}, PendingQuoteBar)), "group-chat: pending quote bar");
|
|
4230
4848
|
}
|
|
4231
4849
|
//#endregion
|
|
4232
4850
|
exports.apply = apply;
|