@sparkelf/dsh-group-chat 0.5.3 → 0.5.4
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 +190 -171
- package/lib/client.js.map +1 -1
- package/lib/index.js +59 -0
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -513,11 +513,11 @@ window.__ModuleLoader__.load({
|
|
|
513
513
|
document.head.appendChild(tag);
|
|
514
514
|
}
|
|
515
515
|
var Avatar_module_css_default = {
|
|
516
|
+
"over": "Ohch6W_over",
|
|
516
517
|
"md": "Ohch6W_md",
|
|
518
|
+
"sm": "Ohch6W_sm",
|
|
517
519
|
"avatar": "Ohch6W_avatar",
|
|
518
|
-
"stack": "Ohch6W_stack"
|
|
519
|
-
"over": "Ohch6W_over",
|
|
520
|
-
"sm": "Ohch6W_sm"
|
|
520
|
+
"stack": "Ohch6W_stack"
|
|
521
521
|
};
|
|
522
522
|
//#endregion
|
|
523
523
|
//#region src/client/Avatar.tsx
|
|
@@ -557,13 +557,13 @@ window.__ModuleLoader__.load({
|
|
|
557
557
|
document.head.appendChild(tag);
|
|
558
558
|
}
|
|
559
559
|
var Picker_module_css_default = {
|
|
560
|
-
"secondary": "sKjJ-a_secondary",
|
|
561
560
|
"row": "sKjJ-a_row",
|
|
561
|
+
"note": "sKjJ-a_note",
|
|
562
|
+
"list": "sKjJ-a_list",
|
|
562
563
|
"rowActive": "sKjJ-a_rowActive",
|
|
563
|
-
"label": "sKjJ-a_label",
|
|
564
564
|
"box": "sKjJ-a_box",
|
|
565
|
-
"
|
|
566
|
-
"
|
|
565
|
+
"label": "sKjJ-a_label",
|
|
566
|
+
"secondary": "sKjJ-a_secondary"
|
|
567
567
|
};
|
|
568
568
|
//#endregion
|
|
569
569
|
//#region src/client/Picker.tsx
|
|
@@ -736,11 +736,11 @@ window.__ModuleLoader__.load({
|
|
|
736
736
|
document.head.appendChild(tag);
|
|
737
737
|
}
|
|
738
738
|
var PresetSelect_module_css_default = {
|
|
739
|
-
"name": "xjnmxG_name",
|
|
740
|
-
"trigger": "xjnmxG_trigger",
|
|
741
739
|
"row": "xjnmxG_row",
|
|
740
|
+
"description": "xjnmxG_description",
|
|
742
741
|
"triggerLabel": "xjnmxG_triggerLabel",
|
|
743
|
-
"
|
|
742
|
+
"trigger": "xjnmxG_trigger",
|
|
743
|
+
"name": "xjnmxG_name"
|
|
744
744
|
};
|
|
745
745
|
//#endregion
|
|
746
746
|
//#region src/client/PresetSelect.tsx
|
|
@@ -828,6 +828,36 @@ window.__ModuleLoader__.load({
|
|
|
828
828
|
});
|
|
829
829
|
};
|
|
830
830
|
//#endregion
|
|
831
|
+
//#region src/session-id.ts
|
|
832
|
+
/**
|
|
833
|
+
* The room/session binding, shared by both halves of the plugin.
|
|
834
|
+
*
|
|
835
|
+
* The browser half needs it to open a room's Session; the host half needs it to create and
|
|
836
|
+
* recognize one. It lives in its own module because the two halves are built for different
|
|
837
|
+
* runtimes: importing it from the host entry would drag the whole server side into the client
|
|
838
|
+
* bundle, which the build's platform guard refuses — correctly, since none of it can run there.
|
|
839
|
+
*
|
|
840
|
+
* @module @sparkelf/dsh-group-chat/session-id
|
|
841
|
+
*/
|
|
842
|
+
/**
|
|
843
|
+
* Every room session id starts with this, so a room's session is recognizable after a restart
|
|
844
|
+
* and an ordinary session never matches.
|
|
845
|
+
*
|
|
846
|
+
* The binding lives in the id rather than in `SessionHeader` because the header carries no
|
|
847
|
+
* free-form metadata field.
|
|
848
|
+
*/
|
|
849
|
+
const ROOM_SESSION_PREFIX = "group-room-";
|
|
850
|
+
/** Deterministic session id for a room. */
|
|
851
|
+
const roomSessionId = (roomId) => `${ROOM_SESSION_PREFIX}${roomId}`;
|
|
852
|
+
/** Reads the room a session is bound to, or `undefined` for an ordinary session. */
|
|
853
|
+
const roomIdOfSession = (session) => {
|
|
854
|
+
if (typeof session !== "object" || session === null) return void 0;
|
|
855
|
+
const id = session.id;
|
|
856
|
+
if (typeof id !== "string" || !id.startsWith("group-room-")) return void 0;
|
|
857
|
+
const roomId = id.slice(11);
|
|
858
|
+
return roomId.length > 0 ? roomId : void 0;
|
|
859
|
+
};
|
|
860
|
+
//#endregion
|
|
831
861
|
//#region src/client/store.ts
|
|
832
862
|
/**
|
|
833
863
|
* The room list both client surfaces read.
|
|
@@ -842,16 +872,12 @@ window.__ModuleLoader__.load({
|
|
|
842
872
|
*
|
|
843
873
|
* @module @sparkelf/dsh-group-chat/client/store
|
|
844
874
|
*/
|
|
845
|
-
|
|
846
|
-
* Create the shared store.
|
|
847
|
-
* @returns a store whose `getState` returns a stable reference between changes, which is
|
|
848
|
-
* what `useSyncExternalStore` requires to avoid a render loop.
|
|
849
|
-
*/
|
|
850
|
-
function createRoomStore() {
|
|
875
|
+
function createRoomStore(deps = {}) {
|
|
851
876
|
let state = {
|
|
852
877
|
rooms: void 0,
|
|
853
878
|
activeRoomId: void 0,
|
|
854
879
|
failure: void 0,
|
|
880
|
+
openFailure: void 0,
|
|
855
881
|
searchQuery: "",
|
|
856
882
|
selfId: void 0,
|
|
857
883
|
administrator: false,
|
|
@@ -918,6 +944,7 @@ window.__ModuleLoader__.load({
|
|
|
918
944
|
open: (roomId) => {
|
|
919
945
|
set({
|
|
920
946
|
activeRoomId: roomId,
|
|
947
|
+
openFailure: void 0,
|
|
921
948
|
...state.rooms === void 0 ? {} : { rooms: state.rooms.map((room) => room.id === roomId ? {
|
|
922
949
|
...room,
|
|
923
950
|
unreadCount: 0,
|
|
@@ -925,6 +952,13 @@ window.__ModuleLoader__.load({
|
|
|
925
952
|
} : room) }
|
|
926
953
|
});
|
|
927
954
|
loadMembersInto(roomId);
|
|
955
|
+
const sessionId = roomSessionId(roomId);
|
|
956
|
+
try {
|
|
957
|
+
deps.openSession?.(sessionId);
|
|
958
|
+
} catch (error) {
|
|
959
|
+
console.error("[group-chat] selecting the room session failed", sessionId, error);
|
|
960
|
+
set({ openFailure: "roomOpenFailed" });
|
|
961
|
+
}
|
|
928
962
|
},
|
|
929
963
|
discover: async (query) => {
|
|
930
964
|
try {
|
|
@@ -1005,23 +1039,23 @@ window.__ModuleLoader__.load({
|
|
|
1005
1039
|
document.head.appendChild(tag);
|
|
1006
1040
|
}
|
|
1007
1041
|
var CreateRoomDialog_module_css_default = {
|
|
1008
|
-
"
|
|
1042
|
+
"memberName": "Z3w8WW_memberName",
|
|
1009
1043
|
"body": "Z3w8WW_body",
|
|
1010
|
-
"pill": "Z3w8WW_pill",
|
|
1011
|
-
"hint": "Z3w8WW_hint",
|
|
1012
|
-
"memberRow": "Z3w8WW_memberRow",
|
|
1013
|
-
"label": "Z3w8WW_label",
|
|
1014
|
-
"notice": "Z3w8WW_notice",
|
|
1015
1044
|
"memberBadge": "Z3w8WW_memberBadge",
|
|
1016
|
-
"
|
|
1017
|
-
"field": "Z3w8WW_field",
|
|
1045
|
+
"label": "Z3w8WW_label",
|
|
1018
1046
|
"error": "Z3w8WW_error",
|
|
1019
|
-
"
|
|
1047
|
+
"pill": "Z3w8WW_pill",
|
|
1048
|
+
"memberList": "Z3w8WW_memberList",
|
|
1020
1049
|
"footer": "Z3w8WW_footer",
|
|
1021
|
-
"memberName": "Z3w8WW_memberName",
|
|
1022
1050
|
"switches": "Z3w8WW_switches",
|
|
1023
|
-
"
|
|
1024
|
-
"
|
|
1051
|
+
"policyRow": "Z3w8WW_policyRow",
|
|
1052
|
+
"warn": "Z3w8WW_warn",
|
|
1053
|
+
"field": "Z3w8WW_field",
|
|
1054
|
+
"hint": "Z3w8WW_hint",
|
|
1055
|
+
"pillActive": "Z3w8WW_pillActive",
|
|
1056
|
+
"notice": "Z3w8WW_notice",
|
|
1057
|
+
"memberRow": "Z3w8WW_memberRow",
|
|
1058
|
+
"triggerExtra": "Z3w8WW_triggerExtra"
|
|
1025
1059
|
};
|
|
1026
1060
|
//#endregion
|
|
1027
1061
|
//#region src/client/CreateRoomDialog.tsx
|
|
@@ -1289,27 +1323,27 @@ window.__ModuleLoader__.load({
|
|
|
1289
1323
|
}
|
|
1290
1324
|
var InviteDialog_module_css_default = {
|
|
1291
1325
|
"rowHandle": "r4uCba_rowHandle",
|
|
1292
|
-
"content": "r4uCba_content",
|
|
1293
|
-
"note": "r4uCba_note",
|
|
1294
|
-
"errorRow": "r4uCba_errorRow",
|
|
1295
1326
|
"error": "r4uCba_error",
|
|
1296
|
-
"checkHidden": "r4uCba_checkHidden",
|
|
1297
|
-
"chipName": "r4uCba_chipName",
|
|
1298
|
-
"chipRemove": "r4uCba_chipRemove",
|
|
1299
|
-
"list": "r4uCba_list",
|
|
1300
|
-
"searchRow": "r4uCba_searchRow",
|
|
1301
|
-
"dialog": "r4uCba_dialog",
|
|
1302
|
-
"visuallyHidden": "r4uCba_visuallyHidden",
|
|
1303
1327
|
"inviteSpin": "r4uCba_inviteSpin",
|
|
1304
|
-
"
|
|
1305
|
-
"
|
|
1306
|
-
"check": "r4uCba_check",
|
|
1328
|
+
"search": "r4uCba_search",
|
|
1329
|
+
"dialog": "r4uCba_dialog",
|
|
1307
1330
|
"row": "r4uCba_row",
|
|
1308
1331
|
"rowSelected": "r4uCba_rowSelected",
|
|
1309
|
-
"
|
|
1332
|
+
"check": "r4uCba_check",
|
|
1333
|
+
"chipRemove": "r4uCba_chipRemove",
|
|
1334
|
+
"errorRow": "r4uCba_errorRow",
|
|
1310
1335
|
"spinner": "r4uCba_spinner",
|
|
1311
|
-
"
|
|
1312
|
-
"
|
|
1336
|
+
"list": "r4uCba_list",
|
|
1337
|
+
"field": "r4uCba_field",
|
|
1338
|
+
"note": "r4uCba_note",
|
|
1339
|
+
"content": "r4uCba_content",
|
|
1340
|
+
"chips": "r4uCba_chips",
|
|
1341
|
+
"chip": "r4uCba_chip",
|
|
1342
|
+
"chipName": "r4uCba_chipName",
|
|
1343
|
+
"checkHidden": "r4uCba_checkHidden",
|
|
1344
|
+
"visuallyHidden": "r4uCba_visuallyHidden",
|
|
1345
|
+
"rowName": "r4uCba_rowName",
|
|
1346
|
+
"searchRow": "r4uCba_searchRow"
|
|
1313
1347
|
};
|
|
1314
1348
|
//#endregion
|
|
1315
1349
|
//#region src/client/RoomDialogs.tsx
|
|
@@ -1926,67 +1960,67 @@ window.__ModuleLoader__.load({
|
|
|
1926
1960
|
document.head.appendChild(tag);
|
|
1927
1961
|
}
|
|
1928
1962
|
var SidebarRooms_module_css_default = {
|
|
1929
|
-
"
|
|
1930
|
-
"sectionHeader": "s0QgKq_sectionHeader",
|
|
1931
|
-
"rowWrap": "s0QgKq_rowWrap",
|
|
1932
|
-
"searchSlotExpanded": "s0QgKq_searchSlotExpanded",
|
|
1933
|
-
"clearButton": "s0QgKq_clearButton",
|
|
1934
|
-
"searchButton": "s0QgKq_searchButton",
|
|
1935
|
-
"visuallyHidden": "s0QgKq_visuallyHidden",
|
|
1936
|
-
"unreadMentioned": "s0QgKq_unreadMentioned",
|
|
1937
|
-
"searchSlot": "s0QgKq_searchSlot",
|
|
1938
|
-
"fade": "s0QgKq_fade",
|
|
1939
|
-
"leaveBody": "s0QgKq_leaveBody",
|
|
1940
|
-
"time": "s0QgKq_time",
|
|
1941
|
-
"root": "s0QgKq_root",
|
|
1942
|
-
"leaveConfirmDanger": "s0QgKq_leaveConfirmDanger",
|
|
1943
|
-
"hit": "s0QgKq_hit",
|
|
1944
|
-
"hitText": "s0QgKq_hitText",
|
|
1945
|
-
"menu": "s0QgKq_menu",
|
|
1963
|
+
"empty": "s0QgKq_empty",
|
|
1946
1964
|
"leaveCopy": "s0QgKq_leaveCopy",
|
|
1947
|
-
"
|
|
1948
|
-
"
|
|
1965
|
+
"flatList": "s0QgKq_flatList",
|
|
1966
|
+
"menuLayer": "s0QgKq_menuLayer",
|
|
1967
|
+
"menuRename": "s0QgKq_menuRename",
|
|
1968
|
+
"discoverMeta": "s0QgKq_discoverMeta",
|
|
1969
|
+
"menuInput": "s0QgKq_menuInput",
|
|
1970
|
+
"hitRoom": "s0QgKq_hitRoom",
|
|
1949
1971
|
"searchInput": "s0QgKq_searchInput",
|
|
1950
|
-
"
|
|
1951
|
-
"leaveError": "s0QgKq_leaveError",
|
|
1952
|
-
"unread": "s0QgKq_unread",
|
|
1972
|
+
"discoverName": "s0QgKq_discoverName",
|
|
1953
1973
|
"search": "s0QgKq_search",
|
|
1974
|
+
"clearButton": "s0QgKq_clearButton",
|
|
1975
|
+
"rowIcon": "s0QgKq_rowIcon",
|
|
1976
|
+
"emptyState": "s0QgKq_emptyState",
|
|
1977
|
+
"menu": "s0QgKq_menu",
|
|
1978
|
+
"leaveError": "s0QgKq_leaveError",
|
|
1954
1979
|
"sectionLabel": "s0QgKq_sectionLabel",
|
|
1980
|
+
"fade": "s0QgKq_fade",
|
|
1981
|
+
"unread": "s0QgKq_unread",
|
|
1982
|
+
"viewWrap": "s0QgKq_viewWrap",
|
|
1983
|
+
"sessionRow": "s0QgKq_sessionRow",
|
|
1955
1984
|
"menuHeading": "s0QgKq_menuHeading",
|
|
1956
|
-
"
|
|
1957
|
-
"
|
|
1958
|
-
"
|
|
1959
|
-
"
|
|
1985
|
+
"discoverSection": "s0QgKq_discoverSection",
|
|
1986
|
+
"mark": "s0QgKq_mark",
|
|
1987
|
+
"unreadMentioned": "s0QgKq_unreadMentioned",
|
|
1988
|
+
"iconButton": "s0QgKq_iconButton",
|
|
1989
|
+
"root": "s0QgKq_root",
|
|
1990
|
+
"list": "s0QgKq_list",
|
|
1991
|
+
"joinButton": "s0QgKq_joinButton",
|
|
1992
|
+
"hitAuthor": "s0QgKq_hitAuthor",
|
|
1960
1993
|
"searchExpanded": "s0QgKq_searchExpanded",
|
|
1961
|
-
"menuItem": "s0QgKq_menuItem",
|
|
1962
|
-
"emptyState": "s0QgKq_emptyState",
|
|
1963
|
-
"resizer": "s0QgKq_resizer",
|
|
1964
|
-
"check": "s0QgKq_check",
|
|
1965
|
-
"menuCancel": "s0QgKq_menuCancel",
|
|
1966
|
-
"menuInput": "s0QgKq_menuInput",
|
|
1967
|
-
"menuRename": "s0QgKq_menuRename",
|
|
1968
|
-
"hitList": "s0QgKq_hitList",
|
|
1969
|
-
"viewWrap": "s0QgKq_viewWrap",
|
|
1970
|
-
"title": "s0QgKq_title",
|
|
1971
|
-
"listArea": "s0QgKq_listArea",
|
|
1972
1994
|
"sessionRowSelected": "s0QgKq_sessionRowSelected",
|
|
1973
|
-
"menuActions": "s0QgKq_menuActions",
|
|
1974
|
-
"menuLayer": "s0QgKq_menuLayer",
|
|
1975
|
-
"iconButton": "s0QgKq_iconButton",
|
|
1976
1995
|
"headerActions": "s0QgKq_headerActions",
|
|
1996
|
+
"hit": "s0QgKq_hit",
|
|
1997
|
+
"searchSlot": "s0QgKq_searchSlot",
|
|
1998
|
+
"check": "s0QgKq_check",
|
|
1999
|
+
"discoverHeading": "s0QgKq_discoverHeading",
|
|
2000
|
+
"menuCancel": "s0QgKq_menuCancel",
|
|
2001
|
+
"leaveConfirmDanger": "s0QgKq_leaveConfirmDanger",
|
|
2002
|
+
"hitText": "s0QgKq_hitText",
|
|
2003
|
+
"footer": "s0QgKq_footer",
|
|
2004
|
+
"visuallyHidden": "s0QgKq_visuallyHidden",
|
|
1977
2005
|
"leaveRoomName": "s0QgKq_leaveRoomName",
|
|
1978
|
-
"
|
|
1979
|
-
"menuConfirm": "s0QgKq_menuConfirm",
|
|
1980
|
-
"discoverName": "s0QgKq_discoverName",
|
|
1981
|
-
"mark": "s0QgKq_mark",
|
|
2006
|
+
"menuItem": "s0QgKq_menuItem",
|
|
1982
2007
|
"railButton": "s0QgKq_railButton",
|
|
1983
|
-
"
|
|
1984
|
-
"
|
|
1985
|
-
"
|
|
1986
|
-
"
|
|
1987
|
-
"
|
|
1988
|
-
"
|
|
1989
|
-
"
|
|
2008
|
+
"menuActions": "s0QgKq_menuActions",
|
|
2009
|
+
"menuInline": "s0QgKq_menuInline",
|
|
2010
|
+
"rowWrap": "s0QgKq_rowWrap",
|
|
2011
|
+
"searchButton": "s0QgKq_searchButton",
|
|
2012
|
+
"listArea": "s0QgKq_listArea",
|
|
2013
|
+
"menuConfirm": "s0QgKq_menuConfirm",
|
|
2014
|
+
"discoverRow": "s0QgKq_discoverRow",
|
|
2015
|
+
"resizer": "s0QgKq_resizer",
|
|
2016
|
+
"hitHead": "s0QgKq_hitHead",
|
|
2017
|
+
"hitList": "s0QgKq_hitList",
|
|
2018
|
+
"leaveBody": "s0QgKq_leaveBody",
|
|
2019
|
+
"hitHint": "s0QgKq_hitHint",
|
|
2020
|
+
"searchSlotExpanded": "s0QgKq_searchSlotExpanded",
|
|
2021
|
+
"title": "s0QgKq_title",
|
|
2022
|
+
"time": "s0QgKq_time",
|
|
2023
|
+
"sectionHeader": "s0QgKq_sectionHeader"
|
|
1990
2024
|
};
|
|
1991
2025
|
//#endregion
|
|
1992
2026
|
//#region src/client/SidebarRooms.tsx
|
|
@@ -2086,7 +2120,7 @@ window.__ModuleLoader__.load({
|
|
|
2086
2120
|
}
|
|
2087
2121
|
});
|
|
2088
2122
|
}
|
|
2089
|
-
const { rooms, activeRoomId, failure, searchQuery, discoverable } = (0, react.useSyncExternalStore)(store.subscribe, store.getState, store.getState);
|
|
2123
|
+
const { rooms, activeRoomId, failure, openFailure, searchQuery, discoverable } = (0, react.useSyncExternalStore)(store.subscribe, store.getState, store.getState);
|
|
2090
2124
|
const [searchExpanded, setSearchExpanded] = (0, react.useState)(false);
|
|
2091
2125
|
const [viewOpen, setViewOpen] = (0, react.useState)(false);
|
|
2092
2126
|
const [orderBy, setOrderBy] = (0, react.useState)("updated");
|
|
@@ -2426,6 +2460,11 @@ window.__ModuleLoader__.load({
|
|
|
2426
2460
|
className: SidebarRooms_module_css_default.empty,
|
|
2427
2461
|
children: t(failure)
|
|
2428
2462
|
}),
|
|
2463
|
+
openFailure !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
2464
|
+
className: SidebarRooms_module_css_default.empty,
|
|
2465
|
+
role: "alert",
|
|
2466
|
+
children: t(openFailure)
|
|
2467
|
+
}),
|
|
2429
2468
|
failure === void 0 && rooms === void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
2430
2469
|
className: SidebarRooms_module_css_default.empty,
|
|
2431
2470
|
children: t("loading")
|
|
@@ -3079,20 +3118,20 @@ window.__ModuleLoader__.load({
|
|
|
3079
3118
|
document.head.appendChild(tag);
|
|
3080
3119
|
}
|
|
3081
3120
|
var MessageSide_module_css_default = {
|
|
3082
|
-
"
|
|
3083
|
-
"quoteBar": "KXabfq_quoteBar",
|
|
3084
|
-
"selfBody": "KXabfq_selfBody",
|
|
3085
|
-
"authorName": "KXabfq_authorName",
|
|
3086
|
-
"rowActionsSelf": "KXabfq_rowActionsSelf",
|
|
3087
|
-
"quoteBody": "KXabfq_quoteBody",
|
|
3121
|
+
"otherRow": "KXabfq_otherRow",
|
|
3088
3122
|
"quoteText": "KXabfq_quoteText",
|
|
3123
|
+
"quoteAuthor": "KXabfq_quoteAuthor",
|
|
3089
3124
|
"rowActions": "KXabfq_rowActions",
|
|
3090
3125
|
"author": "KXabfq_author",
|
|
3091
|
-
"quoteMark": "KXabfq_quoteMark",
|
|
3092
|
-
"rowBody": "KXabfq_rowBody",
|
|
3093
3126
|
"replyButton": "KXabfq_replyButton",
|
|
3094
|
-
"
|
|
3095
|
-
"
|
|
3127
|
+
"selfRow": "KXabfq_selfRow",
|
|
3128
|
+
"rowBody": "KXabfq_rowBody",
|
|
3129
|
+
"selfBody": "KXabfq_selfBody",
|
|
3130
|
+
"quoteBar": "KXabfq_quoteBar",
|
|
3131
|
+
"quoteMark": "KXabfq_quoteMark",
|
|
3132
|
+
"rowActionsSelf": "KXabfq_rowActionsSelf",
|
|
3133
|
+
"quoteBody": "KXabfq_quoteBody",
|
|
3134
|
+
"authorName": "KXabfq_authorName"
|
|
3096
3135
|
};
|
|
3097
3136
|
//#endregion
|
|
3098
3137
|
//#region src/client/MessageSide.tsx
|
|
@@ -3342,36 +3381,6 @@ window.__ModuleLoader__.load({
|
|
|
3342
3381
|
});
|
|
3343
3382
|
};
|
|
3344
3383
|
//#endregion
|
|
3345
|
-
//#region src/session-id.ts
|
|
3346
|
-
/**
|
|
3347
|
-
* The room/session binding, shared by both halves of the plugin.
|
|
3348
|
-
*
|
|
3349
|
-
* The browser half needs it to open a room's Session; the host half needs it to create and
|
|
3350
|
-
* recognize one. It lives in its own module because the two halves are built for different
|
|
3351
|
-
* runtimes: importing it from the host entry would drag the whole server side into the client
|
|
3352
|
-
* bundle, which the build's platform guard refuses — correctly, since none of it can run there.
|
|
3353
|
-
*
|
|
3354
|
-
* @module @sparkelf/dsh-group-chat/session-id
|
|
3355
|
-
*/
|
|
3356
|
-
/**
|
|
3357
|
-
* Every room session id starts with this, so a room's session is recognizable after a restart
|
|
3358
|
-
* and an ordinary session never matches.
|
|
3359
|
-
*
|
|
3360
|
-
* The binding lives in the id rather than in `SessionHeader` because the header carries no
|
|
3361
|
-
* free-form metadata field.
|
|
3362
|
-
*/
|
|
3363
|
-
const ROOM_SESSION_PREFIX = "group-room-";
|
|
3364
|
-
/** Deterministic session id for a room. */
|
|
3365
|
-
const roomSessionId = (roomId) => `${ROOM_SESSION_PREFIX}${roomId}`;
|
|
3366
|
-
/** Reads the room a session is bound to, or `undefined` for an ordinary session. */
|
|
3367
|
-
const roomIdOfSession = (session) => {
|
|
3368
|
-
if (typeof session !== "object" || session === null) return void 0;
|
|
3369
|
-
const id = session.id;
|
|
3370
|
-
if (typeof id !== "string" || !id.startsWith("group-room-")) return void 0;
|
|
3371
|
-
const roomId = id.slice(11);
|
|
3372
|
-
return roomId.length > 0 ? roomId : void 0;
|
|
3373
|
-
};
|
|
3374
|
-
//#endregion
|
|
3375
3384
|
//#region \0dsh-css:/root/projects/dsh-plugins-plus/packages/group-chat/src/client/MembersPanel.module.css.mjs
|
|
3376
3385
|
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}";
|
|
3377
3386
|
const tagId$2 = "@sparkelf/dsh-group-chat/MembersPanel.module.css";
|
|
@@ -3384,45 +3393,45 @@ window.__ModuleLoader__.load({
|
|
|
3384
3393
|
}
|
|
3385
3394
|
var MembersPanel_module_css_default = {
|
|
3386
3395
|
"linkButton": "VeQVAa_linkButton",
|
|
3387
|
-
"
|
|
3388
|
-
"
|
|
3389
|
-
"
|
|
3396
|
+
"filePicker": "VeQVAa_filePicker",
|
|
3397
|
+
"fileButton": "VeQVAa_fileButton",
|
|
3398
|
+
"crumbGroup": "VeQVAa_crumbGroup",
|
|
3399
|
+
"sectionToggle": "VeQVAa_sectionToggle",
|
|
3400
|
+
"section": "VeQVAa_section",
|
|
3401
|
+
"search": "VeQVAa_search",
|
|
3402
|
+
"sectionBody": "VeQVAa_sectionBody",
|
|
3390
3403
|
"crumb": "VeQVAa_crumb",
|
|
3391
|
-
"crumbSep": "VeQVAa_crumbSep",
|
|
3392
|
-
"fileSize": "VeQVAa_fileSize",
|
|
3393
|
-
"editorFooter": "VeQVAa_editorFooter",
|
|
3394
3404
|
"sectionHeader": "VeQVAa_sectionHeader",
|
|
3395
|
-
"
|
|
3405
|
+
"previewHeader": "VeQVAa_previewHeader",
|
|
3396
3406
|
"refresh": "VeQVAa_refresh",
|
|
3397
|
-
"
|
|
3407
|
+
"announcementText": "VeQVAa_announcementText",
|
|
3408
|
+
"fileIcon": "VeQVAa_fileIcon",
|
|
3409
|
+
"previewClose": "VeQVAa_previewClose",
|
|
3410
|
+
"unavailable": "VeQVAa_unavailable",
|
|
3411
|
+
"editorFooter": "VeQVAa_editorFooter",
|
|
3398
3412
|
"row": "VeQVAa_row",
|
|
3413
|
+
"crumbs": "VeQVAa_crumbs",
|
|
3414
|
+
"count": "VeQVAa_count",
|
|
3399
3415
|
"list": "VeQVAa_list",
|
|
3400
|
-
"previewTitle": "VeQVAa_previewTitle",
|
|
3401
|
-
"previewClose": "VeQVAa_previewClose",
|
|
3402
|
-
"sectionLabel": "VeQVAa_sectionLabel",
|
|
3403
|
-
"previewImage": "VeQVAa_previewImage",
|
|
3404
|
-
"selfTag": "VeQVAa_selfTag",
|
|
3405
3416
|
"root": "VeQVAa_root",
|
|
3406
3417
|
"searchToggle": "VeQVAa_searchToggle",
|
|
3418
|
+
"textarea": "VeQVAa_textarea",
|
|
3419
|
+
"crumbSep": "VeQVAa_crumbSep",
|
|
3420
|
+
"notice": "VeQVAa_notice",
|
|
3407
3421
|
"editor": "VeQVAa_editor",
|
|
3408
3422
|
"ownerTag": "VeQVAa_ownerTag",
|
|
3409
|
-
"
|
|
3410
|
-
"announcementText": "VeQVAa_announcementText",
|
|
3411
|
-
"fileButton": "VeQVAa_fileButton",
|
|
3412
|
-
"sectionBody": "VeQVAa_sectionBody",
|
|
3413
|
-
"previewHeader": "VeQVAa_previewHeader",
|
|
3414
|
-
"sectionToggle": "VeQVAa_sectionToggle",
|
|
3415
|
-
"remove": "VeQVAa_remove",
|
|
3423
|
+
"sectionLabel": "VeQVAa_sectionLabel",
|
|
3416
3424
|
"previewBody": "VeQVAa_previewBody",
|
|
3417
|
-
"
|
|
3418
|
-
"
|
|
3419
|
-
"
|
|
3420
|
-
"textarea": "VeQVAa_textarea",
|
|
3425
|
+
"remove": "VeQVAa_remove",
|
|
3426
|
+
"fileSize": "VeQVAa_fileSize",
|
|
3427
|
+
"hint": "VeQVAa_hint",
|
|
3421
3428
|
"caret": "VeQVAa_caret",
|
|
3422
|
-
"
|
|
3423
|
-
"
|
|
3424
|
-
"
|
|
3425
|
-
"
|
|
3429
|
+
"previewImage": "VeQVAa_previewImage",
|
|
3430
|
+
"selfTag": "VeQVAa_selfTag",
|
|
3431
|
+
"name": "VeQVAa_name",
|
|
3432
|
+
"previewTitle": "VeQVAa_previewTitle",
|
|
3433
|
+
"error": "VeQVAa_error",
|
|
3434
|
+
"preview": "VeQVAa_preview"
|
|
3426
3435
|
};
|
|
3427
3436
|
//#endregion
|
|
3428
3437
|
//#region src/client/MembersPanel.tsx
|
|
@@ -4045,11 +4054,11 @@ window.__ModuleLoader__.load({
|
|
|
4045
4054
|
document.head.appendChild(tag);
|
|
4046
4055
|
}
|
|
4047
4056
|
var GuideEntry_module_css_default = {
|
|
4048
|
-
"icon": "_0Vnsuq_icon",
|
|
4049
|
-
"text": "_0Vnsuq_text",
|
|
4050
|
-
"entry": "_0Vnsuq_entry",
|
|
4051
4057
|
"title": "_0Vnsuq_title",
|
|
4052
|
-
"
|
|
4058
|
+
"entry": "_0Vnsuq_entry",
|
|
4059
|
+
"icon": "_0Vnsuq_icon",
|
|
4060
|
+
"description": "_0Vnsuq_description",
|
|
4061
|
+
"text": "_0Vnsuq_text"
|
|
4053
4062
|
};
|
|
4054
4063
|
//#endregion
|
|
4055
4064
|
//#region src/client/GuideEntry.tsx
|
|
@@ -4118,8 +4127,8 @@ window.__ModuleLoader__.load({
|
|
|
4118
4127
|
var QuoteComposer_module_css_default = {
|
|
4119
4128
|
"dismiss": "AK6KxW_dismiss",
|
|
4120
4129
|
"button": "AK6KxW_button",
|
|
4121
|
-
"body": "AK6KxW_body",
|
|
4122
4130
|
"author": "AK6KxW_author",
|
|
4131
|
+
"body": "AK6KxW_body",
|
|
4123
4132
|
"mark": "AK6KxW_mark",
|
|
4124
4133
|
"text": "AK6KxW_text",
|
|
4125
4134
|
"bar": "AK6KxW_bar"
|
|
@@ -4434,6 +4443,7 @@ window.__ModuleLoader__.load({
|
|
|
4434
4443
|
description: "Rooms this workspace has joined. @ yourself to make the agent answer; every other message is recorded and read, but nothing runs.",
|
|
4435
4444
|
loading: "Loading rooms…",
|
|
4436
4445
|
retry: "Retry",
|
|
4446
|
+
roomOpenFailed: "Could not open this room. Please retry.",
|
|
4437
4447
|
emptyRooms: "No rooms yet",
|
|
4438
4448
|
createRoom: "New room",
|
|
4439
4449
|
roomName: "Room name",
|
|
@@ -4584,6 +4594,7 @@ window.__ModuleLoader__.load({
|
|
|
4584
4594
|
title: "群聊",
|
|
4585
4595
|
description: "本工作区已加入的群聊。@ 自己会触发 agent 应答;其他消息都会记录并进入上下文,但不执行。",
|
|
4586
4596
|
loading: "正在加载群聊…",
|
|
4597
|
+
roomOpenFailed: "无法打开该房间,请稍后重试。",
|
|
4587
4598
|
retry: "重试",
|
|
4588
4599
|
emptyRooms: "暂无群聊",
|
|
4589
4600
|
createRoom: "新建群聊",
|
|
@@ -4799,7 +4810,9 @@ window.__ModuleLoader__.load({
|
|
|
4799
4810
|
"uiWorkspace",
|
|
4800
4811
|
"workspaces",
|
|
4801
4812
|
"sidebarRightTabs",
|
|
4802
|
-
"sidebarRight"
|
|
4813
|
+
"sidebarRight",
|
|
4814
|
+
"sessions",
|
|
4815
|
+
"layout"
|
|
4803
4816
|
];
|
|
4804
4817
|
/**
|
|
4805
4818
|
* Register the sidebar region and the room page.
|
|
@@ -4833,7 +4846,13 @@ window.__ModuleLoader__.load({
|
|
|
4833
4846
|
}), "group-chat: copy");
|
|
4834
4847
|
const t = ctx.locale.bind(NS);
|
|
4835
4848
|
const tPreset = ctx.locale.bind(PRESET_LOCALE_NS);
|
|
4836
|
-
const
|
|
4849
|
+
const navigation = ctx.get("uiWorkspace");
|
|
4850
|
+
if (navigation?.openSession === void 0) console.warn("[group-chat] uiWorkspace.openSession is unavailable; room selection cannot navigate");
|
|
4851
|
+
const layout = ctx.get("layout");
|
|
4852
|
+
const base = createRoomStore({ openSession: (sessionId) => {
|
|
4853
|
+
navigation?.openSession?.(sessionId);
|
|
4854
|
+
layout?.selectPanel?.(null);
|
|
4855
|
+
} });
|
|
4837
4856
|
const quotes = createQuoteStore();
|
|
4838
4857
|
/**
|
|
4839
4858
|
* Drops the pending reply once the composer submits.
|