@sparkelf/dsh-group-chat 0.5.4 → 0.5.6
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 +184 -171
- package/lib/client.js.map +1 -1
- package/lib/index.js +70 -50
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -262,6 +262,16 @@ window.__ModuleLoader__.load({
|
|
|
262
262
|
});
|
|
263
263
|
/** Drops a pending reply that will not be sent. */
|
|
264
264
|
const clearQuote = (roomId) => call(`/rooms/${encodeURIComponent(roomId)}/quote`, { method: "DELETE" });
|
|
265
|
+
/**
|
|
266
|
+
* Ask the Host to make one room the view: it resolves the room's Session and the workspace that
|
|
267
|
+
* owns it, then hands back the Session id the shell should select.
|
|
268
|
+
*
|
|
269
|
+
* The browser cannot do this itself: the Session belongs to no workspace until the Host creates
|
|
270
|
+
* one at the Session's own directory, and `openSession` only selects a Session a workspace owns.
|
|
271
|
+
* @param roomId - the room to open.
|
|
272
|
+
* @returns the Session to select.
|
|
273
|
+
*/
|
|
274
|
+
const openRoom = (roomId) => call(`/rooms/${encodeURIComponent(roomId)}/open`, { method: "POST" });
|
|
265
275
|
//#endregion
|
|
266
276
|
//#region src/client/rows.ts
|
|
267
277
|
/**
|
|
@@ -513,11 +523,11 @@ window.__ModuleLoader__.load({
|
|
|
513
523
|
document.head.appendChild(tag);
|
|
514
524
|
}
|
|
515
525
|
var Avatar_module_css_default = {
|
|
516
|
-
"over": "Ohch6W_over",
|
|
517
526
|
"md": "Ohch6W_md",
|
|
518
|
-
"
|
|
527
|
+
"stack": "Ohch6W_stack",
|
|
519
528
|
"avatar": "Ohch6W_avatar",
|
|
520
|
-
"
|
|
529
|
+
"over": "Ohch6W_over",
|
|
530
|
+
"sm": "Ohch6W_sm"
|
|
521
531
|
};
|
|
522
532
|
//#endregion
|
|
523
533
|
//#region src/client/Avatar.tsx
|
|
@@ -557,13 +567,13 @@ window.__ModuleLoader__.load({
|
|
|
557
567
|
document.head.appendChild(tag);
|
|
558
568
|
}
|
|
559
569
|
var Picker_module_css_default = {
|
|
560
|
-
"
|
|
561
|
-
"note": "sKjJ-a_note",
|
|
570
|
+
"box": "sKjJ-a_box",
|
|
562
571
|
"list": "sKjJ-a_list",
|
|
572
|
+
"row": "sKjJ-a_row",
|
|
563
573
|
"rowActive": "sKjJ-a_rowActive",
|
|
564
|
-
"
|
|
574
|
+
"secondary": "sKjJ-a_secondary",
|
|
565
575
|
"label": "sKjJ-a_label",
|
|
566
|
-
"
|
|
576
|
+
"note": "sKjJ-a_note"
|
|
567
577
|
};
|
|
568
578
|
//#endregion
|
|
569
579
|
//#region src/client/Picker.tsx
|
|
@@ -736,9 +746,9 @@ window.__ModuleLoader__.load({
|
|
|
736
746
|
document.head.appendChild(tag);
|
|
737
747
|
}
|
|
738
748
|
var PresetSelect_module_css_default = {
|
|
739
|
-
"row": "xjnmxG_row",
|
|
740
749
|
"description": "xjnmxG_description",
|
|
741
750
|
"triggerLabel": "xjnmxG_triggerLabel",
|
|
751
|
+
"row": "xjnmxG_row",
|
|
742
752
|
"trigger": "xjnmxG_trigger",
|
|
743
753
|
"name": "xjnmxG_name"
|
|
744
754
|
};
|
|
@@ -828,36 +838,6 @@ window.__ModuleLoader__.load({
|
|
|
828
838
|
});
|
|
829
839
|
};
|
|
830
840
|
//#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
|
|
861
841
|
//#region src/client/store.ts
|
|
862
842
|
/**
|
|
863
843
|
* The room list both client surfaces read.
|
|
@@ -952,13 +932,10 @@ window.__ModuleLoader__.load({
|
|
|
952
932
|
} : room) }
|
|
953
933
|
});
|
|
954
934
|
loadMembersInto(roomId);
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
deps.openSession?.(sessionId);
|
|
958
|
-
} catch (error) {
|
|
959
|
-
console.error("[group-chat] selecting the room session failed", sessionId, error);
|
|
935
|
+
Promise.resolve().then(() => deps.openSession?.(roomId)).catch((error) => {
|
|
936
|
+
console.error("[group-chat] opening the room failed", roomId, error);
|
|
960
937
|
set({ openFailure: "roomOpenFailed" });
|
|
961
|
-
}
|
|
938
|
+
});
|
|
962
939
|
},
|
|
963
940
|
discover: async (query) => {
|
|
964
941
|
try {
|
|
@@ -1039,23 +1016,23 @@ window.__ModuleLoader__.load({
|
|
|
1039
1016
|
document.head.appendChild(tag);
|
|
1040
1017
|
}
|
|
1041
1018
|
var CreateRoomDialog_module_css_default = {
|
|
1042
|
-
"
|
|
1019
|
+
"pillActive": "Z3w8WW_pillActive",
|
|
1020
|
+
"memberRow": "Z3w8WW_memberRow",
|
|
1021
|
+
"notice": "Z3w8WW_notice",
|
|
1022
|
+
"field": "Z3w8WW_field",
|
|
1023
|
+
"switches": "Z3w8WW_switches",
|
|
1024
|
+
"policyRow": "Z3w8WW_policyRow",
|
|
1043
1025
|
"body": "Z3w8WW_body",
|
|
1044
|
-
"memberBadge": "Z3w8WW_memberBadge",
|
|
1045
|
-
"label": "Z3w8WW_label",
|
|
1046
|
-
"error": "Z3w8WW_error",
|
|
1047
|
-
"pill": "Z3w8WW_pill",
|
|
1048
1026
|
"memberList": "Z3w8WW_memberList",
|
|
1027
|
+
"memberName": "Z3w8WW_memberName",
|
|
1028
|
+
"memberBadge": "Z3w8WW_memberBadge",
|
|
1049
1029
|
"footer": "Z3w8WW_footer",
|
|
1050
|
-
"switches": "Z3w8WW_switches",
|
|
1051
|
-
"policyRow": "Z3w8WW_policyRow",
|
|
1052
1030
|
"warn": "Z3w8WW_warn",
|
|
1053
|
-
"
|
|
1031
|
+
"triggerExtra": "Z3w8WW_triggerExtra",
|
|
1032
|
+
"label": "Z3w8WW_label",
|
|
1054
1033
|
"hint": "Z3w8WW_hint",
|
|
1055
|
-
"
|
|
1056
|
-
"
|
|
1057
|
-
"memberRow": "Z3w8WW_memberRow",
|
|
1058
|
-
"triggerExtra": "Z3w8WW_triggerExtra"
|
|
1034
|
+
"pill": "Z3w8WW_pill",
|
|
1035
|
+
"error": "Z3w8WW_error"
|
|
1059
1036
|
};
|
|
1060
1037
|
//#endregion
|
|
1061
1038
|
//#region src/client/CreateRoomDialog.tsx
|
|
@@ -1083,7 +1060,7 @@ window.__ModuleLoader__.load({
|
|
|
1083
1060
|
const open = store.getState().pendingCreate;
|
|
1084
1061
|
const [name, setName] = (0, react.useState)("");
|
|
1085
1062
|
const [cwd, setCwd] = (0, react.useState)("");
|
|
1086
|
-
const [preset, setPreset] = (0, react.useState)("");
|
|
1063
|
+
const [preset, setPreset] = (0, react.useState)("standard");
|
|
1087
1064
|
const [invitePolicy, setInvitePolicy] = (0, react.useState)("anyone");
|
|
1088
1065
|
const [discoverability, setDiscoverability] = (0, react.useState)("discoverable");
|
|
1089
1066
|
const [agentTrigger, setAgentTrigger] = (0, react.useState)("mention");
|
|
@@ -1322,28 +1299,28 @@ window.__ModuleLoader__.load({
|
|
|
1322
1299
|
document.head.appendChild(tag);
|
|
1323
1300
|
}
|
|
1324
1301
|
var InviteDialog_module_css_default = {
|
|
1325
|
-
"
|
|
1326
|
-
"
|
|
1327
|
-
"
|
|
1328
|
-
"
|
|
1329
|
-
"
|
|
1302
|
+
"searchRow": "r4uCba_searchRow",
|
|
1303
|
+
"errorRow": "r4uCba_errorRow",
|
|
1304
|
+
"chip": "r4uCba_chip",
|
|
1305
|
+
"chipRemove": "r4uCba_chipRemove",
|
|
1306
|
+
"rowName": "r4uCba_rowName",
|
|
1307
|
+
"note": "r4uCba_note",
|
|
1330
1308
|
"row": "r4uCba_row",
|
|
1309
|
+
"visuallyHidden": "r4uCba_visuallyHidden",
|
|
1331
1310
|
"rowSelected": "r4uCba_rowSelected",
|
|
1311
|
+
"chips": "r4uCba_chips",
|
|
1312
|
+
"content": "r4uCba_content",
|
|
1313
|
+
"rowHandle": "r4uCba_rowHandle",
|
|
1332
1314
|
"check": "r4uCba_check",
|
|
1333
|
-
"
|
|
1334
|
-
"
|
|
1315
|
+
"error": "r4uCba_error",
|
|
1316
|
+
"inviteSpin": "r4uCba_inviteSpin",
|
|
1317
|
+
"checkHidden": "r4uCba_checkHidden",
|
|
1318
|
+
"field": "r4uCba_field",
|
|
1335
1319
|
"spinner": "r4uCba_spinner",
|
|
1336
1320
|
"list": "r4uCba_list",
|
|
1337
|
-
"field": "r4uCba_field",
|
|
1338
|
-
"note": "r4uCba_note",
|
|
1339
|
-
"content": "r4uCba_content",
|
|
1340
|
-
"chips": "r4uCba_chips",
|
|
1341
|
-
"chip": "r4uCba_chip",
|
|
1342
1321
|
"chipName": "r4uCba_chipName",
|
|
1343
|
-
"
|
|
1344
|
-
"
|
|
1345
|
-
"rowName": "r4uCba_rowName",
|
|
1346
|
-
"searchRow": "r4uCba_searchRow"
|
|
1322
|
+
"dialog": "r4uCba_dialog",
|
|
1323
|
+
"search": "r4uCba_search"
|
|
1347
1324
|
};
|
|
1348
1325
|
//#endregion
|
|
1349
1326
|
//#region src/client/RoomDialogs.tsx
|
|
@@ -1960,67 +1937,67 @@ window.__ModuleLoader__.load({
|
|
|
1960
1937
|
document.head.appendChild(tag);
|
|
1961
1938
|
}
|
|
1962
1939
|
var SidebarRooms_module_css_default = {
|
|
1963
|
-
"
|
|
1964
|
-
"
|
|
1940
|
+
"hitText": "s0QgKq_hitText",
|
|
1941
|
+
"unread": "s0QgKq_unread",
|
|
1965
1942
|
"flatList": "s0QgKq_flatList",
|
|
1943
|
+
"hit": "s0QgKq_hit",
|
|
1944
|
+
"resizer": "s0QgKq_resizer",
|
|
1945
|
+
"menuCancel": "s0QgKq_menuCancel",
|
|
1946
|
+
"viewWrap": "s0QgKq_viewWrap",
|
|
1947
|
+
"sessionRowSelected": "s0QgKq_sessionRowSelected",
|
|
1948
|
+
"emptyState": "s0QgKq_emptyState",
|
|
1949
|
+
"title": "s0QgKq_title",
|
|
1950
|
+
"searchSlot": "s0QgKq_searchSlot",
|
|
1951
|
+
"footer": "s0QgKq_footer",
|
|
1952
|
+
"menuInput": "s0QgKq_menuInput",
|
|
1953
|
+
"railButton": "s0QgKq_railButton",
|
|
1954
|
+
"leaveRoomName": "s0QgKq_leaveRoomName",
|
|
1955
|
+
"clearButton": "s0QgKq_clearButton",
|
|
1956
|
+
"searchInput": "s0QgKq_searchInput",
|
|
1957
|
+
"menu": "s0QgKq_menu",
|
|
1958
|
+
"menuConfirm": "s0QgKq_menuConfirm",
|
|
1959
|
+
"leaveConfirmDanger": "s0QgKq_leaveConfirmDanger",
|
|
1960
|
+
"searchExpanded": "s0QgKq_searchExpanded",
|
|
1961
|
+
"search": "s0QgKq_search",
|
|
1962
|
+
"searchButton": "s0QgKq_searchButton",
|
|
1963
|
+
"time": "s0QgKq_time",
|
|
1964
|
+
"rowWrap": "s0QgKq_rowWrap",
|
|
1965
|
+
"listArea": "s0QgKq_listArea",
|
|
1966
|
+
"discoverRow": "s0QgKq_discoverRow",
|
|
1967
|
+
"leaveError": "s0QgKq_leaveError",
|
|
1968
|
+
"hitAuthor": "s0QgKq_hitAuthor",
|
|
1966
1969
|
"menuLayer": "s0QgKq_menuLayer",
|
|
1967
|
-
"menuRename": "s0QgKq_menuRename",
|
|
1968
1970
|
"discoverMeta": "s0QgKq_discoverMeta",
|
|
1969
|
-
"
|
|
1971
|
+
"hitHead": "s0QgKq_hitHead",
|
|
1970
1972
|
"hitRoom": "s0QgKq_hitRoom",
|
|
1971
|
-
"
|
|
1973
|
+
"headerActions": "s0QgKq_headerActions",
|
|
1974
|
+
"menuHeading": "s0QgKq_menuHeading",
|
|
1972
1975
|
"discoverName": "s0QgKq_discoverName",
|
|
1973
|
-
"search": "s0QgKq_search",
|
|
1974
|
-
"clearButton": "s0QgKq_clearButton",
|
|
1975
1976
|
"rowIcon": "s0QgKq_rowIcon",
|
|
1976
|
-
"
|
|
1977
|
-
"
|
|
1978
|
-
"
|
|
1979
|
-
"
|
|
1977
|
+
"mark": "s0QgKq_mark",
|
|
1978
|
+
"menuItem": "s0QgKq_menuItem",
|
|
1979
|
+
"check": "s0QgKq_check",
|
|
1980
|
+
"empty": "s0QgKq_empty",
|
|
1980
1981
|
"fade": "s0QgKq_fade",
|
|
1981
|
-
"unread": "s0QgKq_unread",
|
|
1982
|
-
"viewWrap": "s0QgKq_viewWrap",
|
|
1983
|
-
"sessionRow": "s0QgKq_sessionRow",
|
|
1984
|
-
"menuHeading": "s0QgKq_menuHeading",
|
|
1985
1982
|
"discoverSection": "s0QgKq_discoverSection",
|
|
1986
|
-
"
|
|
1987
|
-
"
|
|
1983
|
+
"discoverHeading": "s0QgKq_discoverHeading",
|
|
1984
|
+
"leaveCopy": "s0QgKq_leaveCopy",
|
|
1985
|
+
"leaveBody": "s0QgKq_leaveBody",
|
|
1986
|
+
"searchSlotExpanded": "s0QgKq_searchSlotExpanded",
|
|
1988
1987
|
"iconButton": "s0QgKq_iconButton",
|
|
1989
|
-
"root": "s0QgKq_root",
|
|
1990
1988
|
"list": "s0QgKq_list",
|
|
1991
|
-
"joinButton": "s0QgKq_joinButton",
|
|
1992
|
-
"hitAuthor": "s0QgKq_hitAuthor",
|
|
1993
|
-
"searchExpanded": "s0QgKq_searchExpanded",
|
|
1994
|
-
"sessionRowSelected": "s0QgKq_sessionRowSelected",
|
|
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
1989
|
"visuallyHidden": "s0QgKq_visuallyHidden",
|
|
2005
|
-
"
|
|
2006
|
-
"menuItem": "s0QgKq_menuItem",
|
|
2007
|
-
"railButton": "s0QgKq_railButton",
|
|
2008
|
-
"menuActions": "s0QgKq_menuActions",
|
|
1990
|
+
"menuRename": "s0QgKq_menuRename",
|
|
2009
1991
|
"menuInline": "s0QgKq_menuInline",
|
|
2010
|
-
"
|
|
2011
|
-
"
|
|
2012
|
-
"listArea": "s0QgKq_listArea",
|
|
2013
|
-
"menuConfirm": "s0QgKq_menuConfirm",
|
|
2014
|
-
"discoverRow": "s0QgKq_discoverRow",
|
|
2015
|
-
"resizer": "s0QgKq_resizer",
|
|
2016
|
-
"hitHead": "s0QgKq_hitHead",
|
|
1992
|
+
"root": "s0QgKq_root",
|
|
1993
|
+
"menuActions": "s0QgKq_menuActions",
|
|
2017
1994
|
"hitList": "s0QgKq_hitList",
|
|
2018
|
-
"
|
|
1995
|
+
"joinButton": "s0QgKq_joinButton",
|
|
2019
1996
|
"hitHint": "s0QgKq_hitHint",
|
|
2020
|
-
"
|
|
2021
|
-
"
|
|
2022
|
-
"
|
|
2023
|
-
"
|
|
1997
|
+
"sectionHeader": "s0QgKq_sectionHeader",
|
|
1998
|
+
"unreadMentioned": "s0QgKq_unreadMentioned",
|
|
1999
|
+
"sessionRow": "s0QgKq_sessionRow",
|
|
2000
|
+
"sectionLabel": "s0QgKq_sectionLabel"
|
|
2024
2001
|
};
|
|
2025
2002
|
//#endregion
|
|
2026
2003
|
//#region src/client/SidebarRooms.tsx
|
|
@@ -3118,20 +3095,20 @@ window.__ModuleLoader__.load({
|
|
|
3118
3095
|
document.head.appendChild(tag);
|
|
3119
3096
|
}
|
|
3120
3097
|
var MessageSide_module_css_default = {
|
|
3121
|
-
"otherRow": "KXabfq_otherRow",
|
|
3122
|
-
"quoteText": "KXabfq_quoteText",
|
|
3123
|
-
"quoteAuthor": "KXabfq_quoteAuthor",
|
|
3124
|
-
"rowActions": "KXabfq_rowActions",
|
|
3125
|
-
"author": "KXabfq_author",
|
|
3126
|
-
"replyButton": "KXabfq_replyButton",
|
|
3127
|
-
"selfRow": "KXabfq_selfRow",
|
|
3128
|
-
"rowBody": "KXabfq_rowBody",
|
|
3129
3098
|
"selfBody": "KXabfq_selfBody",
|
|
3130
|
-
"
|
|
3099
|
+
"rowBody": "KXabfq_rowBody",
|
|
3100
|
+
"author": "KXabfq_author",
|
|
3101
|
+
"authorName": "KXabfq_authorName",
|
|
3131
3102
|
"quoteMark": "KXabfq_quoteMark",
|
|
3103
|
+
"rowActions": "KXabfq_rowActions",
|
|
3104
|
+
"quoteBar": "KXabfq_quoteBar",
|
|
3105
|
+
"replyButton": "KXabfq_replyButton",
|
|
3106
|
+
"quoteText": "KXabfq_quoteText",
|
|
3132
3107
|
"rowActionsSelf": "KXabfq_rowActionsSelf",
|
|
3133
|
-
"
|
|
3134
|
-
"
|
|
3108
|
+
"selfRow": "KXabfq_selfRow",
|
|
3109
|
+
"quoteAuthor": "KXabfq_quoteAuthor",
|
|
3110
|
+
"otherRow": "KXabfq_otherRow",
|
|
3111
|
+
"quoteBody": "KXabfq_quoteBody"
|
|
3135
3112
|
};
|
|
3136
3113
|
//#endregion
|
|
3137
3114
|
//#region src/client/MessageSide.tsx
|
|
@@ -3381,6 +3358,36 @@ window.__ModuleLoader__.load({
|
|
|
3381
3358
|
});
|
|
3382
3359
|
};
|
|
3383
3360
|
//#endregion
|
|
3361
|
+
//#region src/session-id.ts
|
|
3362
|
+
/**
|
|
3363
|
+
* The room/session binding, shared by both halves of the plugin.
|
|
3364
|
+
*
|
|
3365
|
+
* The browser half needs it to open a room's Session; the host half needs it to create and
|
|
3366
|
+
* recognize one. It lives in its own module because the two halves are built for different
|
|
3367
|
+
* runtimes: importing it from the host entry would drag the whole server side into the client
|
|
3368
|
+
* bundle, which the build's platform guard refuses — correctly, since none of it can run there.
|
|
3369
|
+
*
|
|
3370
|
+
* @module @sparkelf/dsh-group-chat/session-id
|
|
3371
|
+
*/
|
|
3372
|
+
/**
|
|
3373
|
+
* Every room session id starts with this, so a room's session is recognizable after a restart
|
|
3374
|
+
* and an ordinary session never matches.
|
|
3375
|
+
*
|
|
3376
|
+
* The binding lives in the id rather than in `SessionHeader` because the header carries no
|
|
3377
|
+
* free-form metadata field.
|
|
3378
|
+
*/
|
|
3379
|
+
const ROOM_SESSION_PREFIX = "group-room-";
|
|
3380
|
+
/** Deterministic session id for a room. */
|
|
3381
|
+
const roomSessionId = (roomId) => `${ROOM_SESSION_PREFIX}${roomId}`;
|
|
3382
|
+
/** Reads the room a session is bound to, or `undefined` for an ordinary session. */
|
|
3383
|
+
const roomIdOfSession = (session) => {
|
|
3384
|
+
if (typeof session !== "object" || session === null) return void 0;
|
|
3385
|
+
const id = session.id;
|
|
3386
|
+
if (typeof id !== "string" || !id.startsWith("group-room-")) return void 0;
|
|
3387
|
+
const roomId = id.slice(11);
|
|
3388
|
+
return roomId.length > 0 ? roomId : void 0;
|
|
3389
|
+
};
|
|
3390
|
+
//#endregion
|
|
3384
3391
|
//#region \0dsh-css:/root/projects/dsh-plugins-plus/packages/group-chat/src/client/MembersPanel.module.css.mjs
|
|
3385
3392
|
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}";
|
|
3386
3393
|
const tagId$2 = "@sparkelf/dsh-group-chat/MembersPanel.module.css";
|
|
@@ -3392,46 +3399,46 @@ window.__ModuleLoader__.load({
|
|
|
3392
3399
|
document.head.appendChild(tag);
|
|
3393
3400
|
}
|
|
3394
3401
|
var MembersPanel_module_css_default = {
|
|
3395
|
-
"linkButton": "VeQVAa_linkButton",
|
|
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
3402
|
"sectionBody": "VeQVAa_sectionBody",
|
|
3403
|
+
"selfTag": "VeQVAa_selfTag",
|
|
3404
|
+
"searchToggle": "VeQVAa_searchToggle",
|
|
3405
|
+
"announcementText": "VeQVAa_announcementText",
|
|
3406
|
+
"list": "VeQVAa_list",
|
|
3403
3407
|
"crumb": "VeQVAa_crumb",
|
|
3404
|
-
"sectionHeader": "VeQVAa_sectionHeader",
|
|
3405
|
-
"previewHeader": "VeQVAa_previewHeader",
|
|
3406
3408
|
"refresh": "VeQVAa_refresh",
|
|
3407
|
-
"
|
|
3408
|
-
"
|
|
3409
|
+
"caret": "VeQVAa_caret",
|
|
3410
|
+
"sectionHeader": "VeQVAa_sectionHeader",
|
|
3411
|
+
"hint": "VeQVAa_hint",
|
|
3412
|
+
"notice": "VeQVAa_notice",
|
|
3413
|
+
"crumbGroup": "VeQVAa_crumbGroup",
|
|
3409
3414
|
"previewClose": "VeQVAa_previewClose",
|
|
3410
|
-
"
|
|
3411
|
-
"
|
|
3415
|
+
"sectionLabel": "VeQVAa_sectionLabel",
|
|
3416
|
+
"sectionToggle": "VeQVAa_sectionToggle",
|
|
3417
|
+
"linkButton": "VeQVAa_linkButton",
|
|
3418
|
+
"filePicker": "VeQVAa_filePicker",
|
|
3419
|
+
"preview": "VeQVAa_preview",
|
|
3420
|
+
"error": "VeQVAa_error",
|
|
3412
3421
|
"row": "VeQVAa_row",
|
|
3422
|
+
"search": "VeQVAa_search",
|
|
3423
|
+
"previewHeader": "VeQVAa_previewHeader",
|
|
3413
3424
|
"crumbs": "VeQVAa_crumbs",
|
|
3414
|
-
"count": "VeQVAa_count",
|
|
3415
|
-
"list": "VeQVAa_list",
|
|
3416
|
-
"root": "VeQVAa_root",
|
|
3417
|
-
"searchToggle": "VeQVAa_searchToggle",
|
|
3418
|
-
"textarea": "VeQVAa_textarea",
|
|
3419
|
-
"crumbSep": "VeQVAa_crumbSep",
|
|
3420
|
-
"notice": "VeQVAa_notice",
|
|
3421
|
-
"editor": "VeQVAa_editor",
|
|
3422
|
-
"ownerTag": "VeQVAa_ownerTag",
|
|
3423
|
-
"sectionLabel": "VeQVAa_sectionLabel",
|
|
3424
|
-
"previewBody": "VeQVAa_previewBody",
|
|
3425
|
-
"remove": "VeQVAa_remove",
|
|
3426
3425
|
"fileSize": "VeQVAa_fileSize",
|
|
3427
|
-
"
|
|
3428
|
-
"caret": "VeQVAa_caret",
|
|
3426
|
+
"ownerTag": "VeQVAa_ownerTag",
|
|
3429
3427
|
"previewImage": "VeQVAa_previewImage",
|
|
3430
|
-
"
|
|
3428
|
+
"remove": "VeQVAa_remove",
|
|
3429
|
+
"section": "VeQVAa_section",
|
|
3430
|
+
"fileButton": "VeQVAa_fileButton",
|
|
3431
|
+
"textarea": "VeQVAa_textarea",
|
|
3432
|
+
"fileIcon": "VeQVAa_fileIcon",
|
|
3431
3433
|
"name": "VeQVAa_name",
|
|
3432
|
-
"
|
|
3433
|
-
"
|
|
3434
|
-
"
|
|
3434
|
+
"previewBody": "VeQVAa_previewBody",
|
|
3435
|
+
"editorFooter": "VeQVAa_editorFooter",
|
|
3436
|
+
"unavailable": "VeQVAa_unavailable",
|
|
3437
|
+
"crumbSep": "VeQVAa_crumbSep",
|
|
3438
|
+
"root": "VeQVAa_root",
|
|
3439
|
+
"count": "VeQVAa_count",
|
|
3440
|
+
"editor": "VeQVAa_editor",
|
|
3441
|
+
"previewTitle": "VeQVAa_previewTitle"
|
|
3435
3442
|
};
|
|
3436
3443
|
//#endregion
|
|
3437
3444
|
//#region src/client/MembersPanel.tsx
|
|
@@ -4054,10 +4061,10 @@ window.__ModuleLoader__.load({
|
|
|
4054
4061
|
document.head.appendChild(tag);
|
|
4055
4062
|
}
|
|
4056
4063
|
var GuideEntry_module_css_default = {
|
|
4064
|
+
"description": "_0Vnsuq_description",
|
|
4057
4065
|
"title": "_0Vnsuq_title",
|
|
4058
|
-
"entry": "_0Vnsuq_entry",
|
|
4059
4066
|
"icon": "_0Vnsuq_icon",
|
|
4060
|
-
"
|
|
4067
|
+
"entry": "_0Vnsuq_entry",
|
|
4061
4068
|
"text": "_0Vnsuq_text"
|
|
4062
4069
|
};
|
|
4063
4070
|
//#endregion
|
|
@@ -4126,12 +4133,12 @@ window.__ModuleLoader__.load({
|
|
|
4126
4133
|
}
|
|
4127
4134
|
var QuoteComposer_module_css_default = {
|
|
4128
4135
|
"dismiss": "AK6KxW_dismiss",
|
|
4129
|
-
"button": "AK6KxW_button",
|
|
4130
|
-
"author": "AK6KxW_author",
|
|
4131
|
-
"body": "AK6KxW_body",
|
|
4132
4136
|
"mark": "AK6KxW_mark",
|
|
4137
|
+
"bar": "AK6KxW_bar",
|
|
4133
4138
|
"text": "AK6KxW_text",
|
|
4134
|
-
"
|
|
4139
|
+
"button": "AK6KxW_button",
|
|
4140
|
+
"author": "AK6KxW_author",
|
|
4141
|
+
"body": "AK6KxW_body"
|
|
4135
4142
|
};
|
|
4136
4143
|
//#endregion
|
|
4137
4144
|
//#region src/client/QuoteComposer.tsx
|
|
@@ -4265,6 +4272,7 @@ window.__ModuleLoader__.load({
|
|
|
4265
4272
|
const source = {
|
|
4266
4273
|
trigger: "@",
|
|
4267
4274
|
name: SOURCE_NAME$1,
|
|
4275
|
+
label: "消息",
|
|
4268
4276
|
order: 30,
|
|
4269
4277
|
showGroupTitle: true,
|
|
4270
4278
|
async candidates(_session, request) {
|
|
@@ -4382,11 +4390,13 @@ window.__ModuleLoader__.load({
|
|
|
4382
4390
|
const source = {
|
|
4383
4391
|
trigger: "@",
|
|
4384
4392
|
name: SOURCE_NAME,
|
|
4393
|
+
label: "成员",
|
|
4385
4394
|
order: 20,
|
|
4386
4395
|
showGroupTitle: true,
|
|
4387
|
-
async candidates(
|
|
4396
|
+
async candidates(session, request) {
|
|
4388
4397
|
const roomId = store.getState().activeRoomId;
|
|
4389
4398
|
if (roomId === void 0) return [];
|
|
4399
|
+
if (session.sessionId !== void 0 && session.sessionId !== roomSessionId(roomId)) return [];
|
|
4390
4400
|
const members = await listMembers(roomId);
|
|
4391
4401
|
const roster = mentionSourceOf(members);
|
|
4392
4402
|
const owners = new Set(members.filter((member) => member.owner).map((member) => member.userId));
|
|
@@ -4849,8 +4859,11 @@ window.__ModuleLoader__.load({
|
|
|
4849
4859
|
const navigation = ctx.get("uiWorkspace");
|
|
4850
4860
|
if (navigation?.openSession === void 0) console.warn("[group-chat] uiWorkspace.openSession is unavailable; room selection cannot navigate");
|
|
4851
4861
|
const layout = ctx.get("layout");
|
|
4852
|
-
const
|
|
4853
|
-
|
|
4862
|
+
const catalog = ctx.get("sessions");
|
|
4863
|
+
const base = createRoomStore({ openSession: async (roomId) => {
|
|
4864
|
+
const opened = await openRoom(roomId);
|
|
4865
|
+
await catalog?.refresh?.();
|
|
4866
|
+
navigation?.openSession?.(opened.sessionId);
|
|
4854
4867
|
layout?.selectPanel?.(null);
|
|
4855
4868
|
} });
|
|
4856
4869
|
const quotes = createQuoteStore();
|