@helpai/elements 0.14.2 → 0.15.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/configurator.mjs +5 -5
- package/elements-web-component.esm.js +7 -7
- package/elements-web-component.esm.js.map +4 -4
- package/elements.cjs.js +7 -7
- package/elements.cjs.js.map +4 -4
- package/elements.esm.js +7 -7
- package/elements.esm.js.map +4 -4
- package/elements.js +7 -7
- package/elements.js.map +4 -4
- package/index.d.ts +6 -6
- package/index.mjs +227 -216
- package/package.json +1 -1
- package/schema.d.ts +51 -51
- package/schema.json +10 -10
- package/schema.mjs +5 -5
- package/web-component.mjs +226 -215
package/web-component.mjs
CHANGED
|
@@ -35,7 +35,8 @@ var STRINGS_EN = {
|
|
|
35
35
|
attachmentMimeRejected: "File type not supported",
|
|
36
36
|
attachmentTooLarge: "File is too large",
|
|
37
37
|
attachmentTooMany: "Attachment limit reached",
|
|
38
|
-
|
|
38
|
+
conversationClosed: "This conversation is closed",
|
|
39
|
+
conversationLoading: "Loading conversation\u2026",
|
|
39
40
|
close: "Close",
|
|
40
41
|
collapse: "Collapse",
|
|
41
42
|
collapseSidebar: "Collapse sidebar",
|
|
@@ -55,12 +56,10 @@ var STRINGS_EN = {
|
|
|
55
56
|
history: "History",
|
|
56
57
|
historyBack: "Back to chat",
|
|
57
58
|
historyEmpty: "No previous conversations yet",
|
|
58
|
-
historyLoading: "Loading your
|
|
59
|
-
|
|
60
|
-
historyTitle: "Chat history",
|
|
59
|
+
historyLoading: "Loading your conversations\u2026",
|
|
60
|
+
historyTitle: "Conversation history",
|
|
61
61
|
language: "Language",
|
|
62
62
|
launcherOpen: "Open chat",
|
|
63
|
-
messagesLoading: "Loading conversation\u2026",
|
|
64
63
|
micStart: "Start voice input",
|
|
65
64
|
micStop: "Stop voice input",
|
|
66
65
|
micUnsupported: "Voice input is not supported in this browser",
|
|
@@ -85,7 +84,7 @@ var STRINGS_EN = {
|
|
|
85
84
|
usedTool: "Used tool",
|
|
86
85
|
// ── Messenger modules ──────────────────────────────────────────
|
|
87
86
|
tabHome: "Home",
|
|
88
|
-
|
|
87
|
+
tabConversations: "Conversations",
|
|
89
88
|
tabHelp: "Help",
|
|
90
89
|
tabNews: "News",
|
|
91
90
|
modulesEmpty: "Nothing here yet",
|
|
@@ -140,7 +139,8 @@ var STRINGS_FR = {
|
|
|
140
139
|
attachmentMimeRejected: "Type de fichier non pris en charge",
|
|
141
140
|
attachmentTooLarge: "Le fichier est trop volumineux",
|
|
142
141
|
attachmentTooMany: "Limite de pi\xE8ces jointes atteinte",
|
|
143
|
-
|
|
142
|
+
conversationClosed: "Cette conversation est ferm\xE9e",
|
|
143
|
+
conversationLoading: "Chargement de la conversation\u2026",
|
|
144
144
|
close: "Fermer",
|
|
145
145
|
collapse: "R\xE9duire",
|
|
146
146
|
collapseSidebar: "R\xE9duire la barre lat\xE9rale",
|
|
@@ -161,11 +161,9 @@ var STRINGS_FR = {
|
|
|
161
161
|
historyBack: "Retour au chat",
|
|
162
162
|
historyEmpty: "Aucune conversation pour le moment",
|
|
163
163
|
historyLoading: "Chargement de vos conversations\u2026",
|
|
164
|
-
historyNewChat: "Nouvelle conversation",
|
|
165
164
|
historyTitle: "Historique des conversations",
|
|
166
165
|
language: "Langue",
|
|
167
166
|
launcherOpen: "Ouvrir le chat",
|
|
168
|
-
messagesLoading: "Chargement de la conversation\u2026",
|
|
169
167
|
micStart: "D\xE9marrer la saisie vocale",
|
|
170
168
|
micStop: "Arr\xEAter la saisie vocale",
|
|
171
169
|
micUnsupported: "La saisie vocale n'est pas prise en charge par ce navigateur",
|
|
@@ -190,7 +188,7 @@ var STRINGS_FR = {
|
|
|
190
188
|
usedTool: "Outil utilis\xE9",
|
|
191
189
|
// ── Messenger modules ──────────────────────────────────────────
|
|
192
190
|
tabHome: "Accueil",
|
|
193
|
-
|
|
191
|
+
tabConversations: "Conversations",
|
|
194
192
|
tabHelp: "Aide",
|
|
195
193
|
tabNews: "Actualit\xE9s",
|
|
196
194
|
modulesEmpty: "Rien pour le moment",
|
|
@@ -473,7 +471,7 @@ var DEFAULT_HAPTICS = {
|
|
|
473
471
|
enabled: true,
|
|
474
472
|
events: void 0
|
|
475
473
|
};
|
|
476
|
-
var DEFAULT_MODULES = [{ label: "
|
|
474
|
+
var DEFAULT_MODULES = [{ label: "tabConversations", layout: "chat" }];
|
|
477
475
|
var DEFAULT_HOME_MODULE = { showSearchBar: true };
|
|
478
476
|
|
|
479
477
|
// src/core/config/resolve.ts
|
|
@@ -605,7 +603,7 @@ function resolveModules(overrides) {
|
|
|
605
603
|
resolved.greetingText = m.greetingText;
|
|
606
604
|
resolved.showGreeting = m.showGreeting ?? true;
|
|
607
605
|
resolved.showSearchBar = m.showSearchBar ?? DEFAULT_HOME_MODULE.showSearchBar;
|
|
608
|
-
resolved.
|
|
606
|
+
resolved.showRecentConversations = m.showRecentConversations ?? true;
|
|
609
607
|
if (m.userAvatars && m.userAvatars.length > 0) resolved.userAvatars = m.userAvatars;
|
|
610
608
|
if (m.status) resolved.status = m.status;
|
|
611
609
|
resolved.contentBlockTitle = m.contentBlockTitle;
|
|
@@ -2809,8 +2807,8 @@ var TID = {
|
|
|
2809
2807
|
sidebar: `${p2}-sidebar`,
|
|
2810
2808
|
/** Sidebar collapse / expand toggle. */
|
|
2811
2809
|
sidebarToggle: `${p2}-sidebar-toggle`,
|
|
2812
|
-
/** Sidebar "New
|
|
2813
|
-
|
|
2810
|
+
/** Sidebar "New conversation" button. */
|
|
2811
|
+
sidebarNewConversation: `${p2}-sidebar-new-conversation`,
|
|
2814
2812
|
/** Sidebar history row — suffix `-{conversationId}` at the JSX site. */
|
|
2815
2813
|
sidebarItem: `${p2}-sidebar-item`,
|
|
2816
2814
|
// ── Messenger modules ───────────────────────────────────────────
|
|
@@ -2820,7 +2818,7 @@ var TID = {
|
|
|
2820
2818
|
modulesEmpty: `${p2}-modules-empty`,
|
|
2821
2819
|
/** Bottom-nav tab button — suffix `-{moduleId}` at the JSX site. */
|
|
2822
2820
|
tab: `${p2}-tab`,
|
|
2823
|
-
/** Unread badge on the
|
|
2821
|
+
/** Unread badge on the Conversations tab. */
|
|
2824
2822
|
tabBadge: `${p2}-tab-badge`,
|
|
2825
2823
|
/** Home module root. */
|
|
2826
2824
|
homeView: `${p2}-home-view`,
|
|
@@ -2835,7 +2833,7 @@ var TID = {
|
|
|
2835
2833
|
/** Home / Help search bar. */
|
|
2836
2834
|
homeSearch: `${p2}-home-search`,
|
|
2837
2835
|
helpSearch: `${p2}-help-search`,
|
|
2838
|
-
/** Home recent-
|
|
2836
|
+
/** Home recent-conversation card. */
|
|
2839
2837
|
homeRecent: `${p2}-home-recent`,
|
|
2840
2838
|
/** Home content-list row ("Popular articles") — suffix `-{id}`. */
|
|
2841
2839
|
homeContentRow: `${p2}-home-content-row`,
|
|
@@ -4852,7 +4850,7 @@ function MessageList({
|
|
|
4852
4850
|
"aria-relevant": "additions text",
|
|
4853
4851
|
"data-scrolling": scrolling ? "true" : void 0,
|
|
4854
4852
|
children: [
|
|
4855
|
-
loading && messages.value.length === 0 ? /* @__PURE__ */ jsx17("div", { class: `${p15}-list-loading`, role: "status", children: strings.
|
|
4853
|
+
loading && messages.value.length === 0 ? /* @__PURE__ */ jsx17("div", { class: `${p15}-list-loading`, role: "status", children: strings.conversationLoading }) : null,
|
|
4856
4854
|
rows
|
|
4857
4855
|
]
|
|
4858
4856
|
}
|
|
@@ -4933,7 +4931,13 @@ var BUCKET_TO_STRING = {
|
|
|
4933
4931
|
lastWeek: "dateLastWeek",
|
|
4934
4932
|
older: "dateOlder"
|
|
4935
4933
|
};
|
|
4936
|
-
function ConversationList({
|
|
4934
|
+
function ConversationList({
|
|
4935
|
+
transport,
|
|
4936
|
+
strings,
|
|
4937
|
+
visitorId,
|
|
4938
|
+
onSelect,
|
|
4939
|
+
onNewConversation
|
|
4940
|
+
}) {
|
|
4937
4941
|
const p33 = BRAND.cssPrefix;
|
|
4938
4942
|
const [state, setState] = useState7("loading");
|
|
4939
4943
|
const [conversations, setChats] = useState7([]);
|
|
@@ -4952,10 +4956,19 @@ function ConversationList({ transport, strings, visitorId, onSelect, onNewChat }
|
|
|
4952
4956
|
cancelled = true;
|
|
4953
4957
|
};
|
|
4954
4958
|
}, [transport, visitorId]);
|
|
4955
|
-
const newChatButton =
|
|
4956
|
-
|
|
4957
|
-
|
|
4958
|
-
|
|
4959
|
+
const newChatButton = onNewConversation ? /* @__PURE__ */ jsx18("div", { class: `${p33}-history-footer`, children: /* @__PURE__ */ jsxs15(
|
|
4960
|
+
"button",
|
|
4961
|
+
{
|
|
4962
|
+
type: "button",
|
|
4963
|
+
class: `${p33}-history-new`,
|
|
4964
|
+
onClick: onNewConversation,
|
|
4965
|
+
"data-testid": TID.sidebarNewConversation,
|
|
4966
|
+
children: [
|
|
4967
|
+
/* @__PURE__ */ jsx18(PlusIcon, {}),
|
|
4968
|
+
strings.newConversation
|
|
4969
|
+
]
|
|
4970
|
+
}
|
|
4971
|
+
) }) : null;
|
|
4959
4972
|
if (state === "loading") {
|
|
4960
4973
|
return /* @__PURE__ */ jsxs15(Fragment2, { children: [
|
|
4961
4974
|
/* @__PURE__ */ jsx18("div", { class: `${p33}-history-empty`, children: strings.historyLoading }),
|
|
@@ -4993,18 +5006,12 @@ function ConversationList({ transport, strings, visitorId, onSelect, onNewChat }
|
|
|
4993
5006
|
] });
|
|
4994
5007
|
}
|
|
4995
5008
|
|
|
4996
|
-
// src/ui/chat-history-pane.tsx
|
|
4997
|
-
import { jsx as jsx19 } from "preact/jsx-runtime";
|
|
4998
|
-
function ChatHistoryPane(props2) {
|
|
4999
|
-
return /* @__PURE__ */ jsx19(ConversationList, { ...props2 });
|
|
5000
|
-
}
|
|
5001
|
-
|
|
5002
5009
|
// src/ui/suggestions.tsx
|
|
5003
|
-
import { jsx as
|
|
5010
|
+
import { jsx as jsx19 } from "preact/jsx-runtime";
|
|
5004
5011
|
var p16 = BRAND.cssPrefix;
|
|
5005
5012
|
function Suggestions({ suggestions, onPick }) {
|
|
5006
5013
|
if (suggestions.length === 0) return null;
|
|
5007
|
-
return /* @__PURE__ */
|
|
5014
|
+
return /* @__PURE__ */ jsx19("div", { class: `${p16}-suggestions`, role: "group", "aria-label": "Suggested replies", children: suggestions.map((s, i) => /* @__PURE__ */ jsx19(
|
|
5008
5015
|
"button",
|
|
5009
5016
|
{
|
|
5010
5017
|
type: "button",
|
|
@@ -5018,7 +5025,7 @@ function Suggestions({ suggestions, onPick }) {
|
|
|
5018
5025
|
}
|
|
5019
5026
|
|
|
5020
5027
|
// src/ui/panel.tsx
|
|
5021
|
-
import { Fragment as Fragment3, jsx as
|
|
5028
|
+
import { Fragment as Fragment3, jsx as jsx20, jsxs as jsxs16 } from "preact/jsx-runtime";
|
|
5022
5029
|
var p17 = BRAND.cssPrefix;
|
|
5023
5030
|
function Panel(props2) {
|
|
5024
5031
|
const { options, onClose } = props2;
|
|
@@ -5054,7 +5061,7 @@ function Panel(props2) {
|
|
|
5054
5061
|
style: { position: "relative" },
|
|
5055
5062
|
"data-testid": TID.panel,
|
|
5056
5063
|
children: [
|
|
5057
|
-
/* @__PURE__ */
|
|
5064
|
+
/* @__PURE__ */ jsx20(
|
|
5058
5065
|
PanelContent,
|
|
5059
5066
|
{
|
|
5060
5067
|
...props2,
|
|
@@ -5063,7 +5070,7 @@ function Panel(props2) {
|
|
|
5063
5070
|
composerAttachApiRef
|
|
5064
5071
|
}
|
|
5065
5072
|
),
|
|
5066
|
-
/* @__PURE__ */
|
|
5073
|
+
/* @__PURE__ */ jsx20(PoweredByBar, { poweredBy: props2.options.poweredBy })
|
|
5067
5074
|
]
|
|
5068
5075
|
}
|
|
5069
5076
|
);
|
|
@@ -5088,8 +5095,8 @@ function PanelContent(props2) {
|
|
|
5088
5095
|
onBack,
|
|
5089
5096
|
onClear,
|
|
5090
5097
|
onToggleHistory,
|
|
5091
|
-
|
|
5092
|
-
|
|
5098
|
+
onSelectHistoryConversation,
|
|
5099
|
+
onNewConversation,
|
|
5093
5100
|
onWidgetSizeChange,
|
|
5094
5101
|
onSend,
|
|
5095
5102
|
onStop,
|
|
@@ -5105,11 +5112,11 @@ function PanelContent(props2) {
|
|
|
5105
5112
|
const s = options.strings;
|
|
5106
5113
|
let composerArea;
|
|
5107
5114
|
if (activeForm) {
|
|
5108
|
-
composerArea = /* @__PURE__ */
|
|
5115
|
+
composerArea = /* @__PURE__ */ jsx20(FormGate, { form: activeForm, strings: s, onSubmit: onFormSubmit, onSkip: onFormSkip });
|
|
5109
5116
|
} else if (canSend) {
|
|
5110
5117
|
composerArea = /* @__PURE__ */ jsxs16(Fragment3, { children: [
|
|
5111
|
-
/* @__PURE__ */
|
|
5112
|
-
/* @__PURE__ */
|
|
5118
|
+
/* @__PURE__ */ jsx20(Suggestions, { suggestions, onPick: onSuggestion }),
|
|
5119
|
+
/* @__PURE__ */ jsx20(
|
|
5113
5120
|
Composer,
|
|
5114
5121
|
{
|
|
5115
5122
|
options,
|
|
@@ -5124,10 +5131,10 @@ function PanelContent(props2) {
|
|
|
5124
5131
|
)
|
|
5125
5132
|
] });
|
|
5126
5133
|
} else {
|
|
5127
|
-
composerArea = /* @__PURE__ */
|
|
5134
|
+
composerArea = /* @__PURE__ */ jsx20(ReadOnlyBanner, { label: s.conversationClosed, ctaLabel: s.startNewConversation, onNewConversation: onClear });
|
|
5128
5135
|
}
|
|
5129
5136
|
return /* @__PURE__ */ jsxs16(Fragment3, { children: [
|
|
5130
|
-
view === "history" ? /* @__PURE__ */
|
|
5137
|
+
view === "history" ? /* @__PURE__ */ jsx20(
|
|
5131
5138
|
HistoryHeader,
|
|
5132
5139
|
{
|
|
5133
5140
|
strings: s,
|
|
@@ -5136,7 +5143,7 @@ function PanelContent(props2) {
|
|
|
5136
5143
|
showClose: canShowClose(options.mode, panelSize, options.actions)
|
|
5137
5144
|
}
|
|
5138
5145
|
) : /* @__PURE__ */ jsxs16("header", { class: `${p17}-header`, "data-testid": TID.panelHeader, children: [
|
|
5139
|
-
onBack ? /* @__PURE__ */
|
|
5146
|
+
onBack ? /* @__PURE__ */ jsx20(
|
|
5140
5147
|
"button",
|
|
5141
5148
|
{
|
|
5142
5149
|
type: "button",
|
|
@@ -5144,24 +5151,24 @@ function PanelContent(props2) {
|
|
|
5144
5151
|
onClick: onBack,
|
|
5145
5152
|
"aria-label": s.moduleBack,
|
|
5146
5153
|
title: s.moduleBack,
|
|
5147
|
-
children: /* @__PURE__ */
|
|
5154
|
+
children: /* @__PURE__ */ jsx20(BackIcon, {})
|
|
5148
5155
|
}
|
|
5149
5156
|
) : null,
|
|
5150
|
-
agent ? /* @__PURE__ */
|
|
5151
|
-
/* @__PURE__ */
|
|
5157
|
+
agent ? /* @__PURE__ */ jsx20(AgentBadge, { agent }) : /* @__PURE__ */ jsx20("h1", { children: s.panelTitle }),
|
|
5158
|
+
/* @__PURE__ */ jsx20(HeaderActions, { panelProps: props2, variant: "chat" })
|
|
5152
5159
|
] }),
|
|
5153
|
-
view === "history" ? /* @__PURE__ */
|
|
5154
|
-
|
|
5160
|
+
view === "history" ? /* @__PURE__ */ jsx20(
|
|
5161
|
+
ConversationList,
|
|
5155
5162
|
{
|
|
5156
5163
|
transport,
|
|
5157
5164
|
strings: s,
|
|
5158
5165
|
visitorId,
|
|
5159
|
-
onSelect: (
|
|
5160
|
-
|
|
5166
|
+
onSelect: (conversation) => onSelectHistoryConversation(conversation.conversationId),
|
|
5167
|
+
onNewConversation
|
|
5161
5168
|
}
|
|
5162
5169
|
) : /* @__PURE__ */ jsxs16(Fragment3, { children: [
|
|
5163
|
-
/* @__PURE__ */
|
|
5164
|
-
/* @__PURE__ */
|
|
5170
|
+
/* @__PURE__ */ jsx20(DropZone, { visible: dragOver, strings: s }),
|
|
5171
|
+
/* @__PURE__ */ jsx20(
|
|
5165
5172
|
MessageList,
|
|
5166
5173
|
{
|
|
5167
5174
|
messagesSig,
|
|
@@ -5175,9 +5182,9 @@ function PanelContent(props2) {
|
|
|
5175
5182
|
}
|
|
5176
5183
|
),
|
|
5177
5184
|
composerArea,
|
|
5178
|
-
/* @__PURE__ */
|
|
5185
|
+
/* @__PURE__ */ jsx20(ComposerFooter, { disclaimer: options.composerDisclaimer })
|
|
5179
5186
|
] }),
|
|
5180
|
-
options.size.resize?.enabled ? /* @__PURE__ */
|
|
5187
|
+
options.size.resize?.enabled ? /* @__PURE__ */ jsx20(
|
|
5181
5188
|
ResizeGrip,
|
|
5182
5189
|
{
|
|
5183
5190
|
panelEl: containerEl,
|
|
@@ -5197,7 +5204,7 @@ function HistoryHeader({
|
|
|
5197
5204
|
showClose
|
|
5198
5205
|
}) {
|
|
5199
5206
|
return /* @__PURE__ */ jsxs16("header", { class: `${p17}-header`, children: [
|
|
5200
|
-
/* @__PURE__ */
|
|
5207
|
+
/* @__PURE__ */ jsx20(
|
|
5201
5208
|
"button",
|
|
5202
5209
|
{
|
|
5203
5210
|
type: "button",
|
|
@@ -5205,11 +5212,11 @@ function HistoryHeader({
|
|
|
5205
5212
|
onClick: onBack,
|
|
5206
5213
|
"aria-label": strings.historyBack,
|
|
5207
5214
|
title: strings.historyBack,
|
|
5208
|
-
children: /* @__PURE__ */
|
|
5215
|
+
children: /* @__PURE__ */ jsx20(BackIcon, {})
|
|
5209
5216
|
}
|
|
5210
5217
|
),
|
|
5211
|
-
/* @__PURE__ */
|
|
5212
|
-
showClose ? /* @__PURE__ */
|
|
5218
|
+
/* @__PURE__ */ jsx20("h1", { children: strings.historyTitle }),
|
|
5219
|
+
showClose ? /* @__PURE__ */ jsx20(
|
|
5213
5220
|
"button",
|
|
5214
5221
|
{
|
|
5215
5222
|
type: "button",
|
|
@@ -5217,34 +5224,38 @@ function HistoryHeader({
|
|
|
5217
5224
|
onClick: onClose,
|
|
5218
5225
|
"aria-label": strings.close,
|
|
5219
5226
|
title: strings.close,
|
|
5220
|
-
children: /* @__PURE__ */
|
|
5227
|
+
children: /* @__PURE__ */ jsx20(CloseIcon, {})
|
|
5221
5228
|
}
|
|
5222
5229
|
) : null
|
|
5223
5230
|
] });
|
|
5224
5231
|
}
|
|
5225
|
-
function ReadOnlyBanner({
|
|
5232
|
+
function ReadOnlyBanner({
|
|
5233
|
+
label,
|
|
5234
|
+
ctaLabel,
|
|
5235
|
+
onNewConversation
|
|
5236
|
+
}) {
|
|
5226
5237
|
return /* @__PURE__ */ jsxs16("div", { class: `${p17}-readonly-banner`, role: "note", children: [
|
|
5227
|
-
/* @__PURE__ */
|
|
5228
|
-
/* @__PURE__ */
|
|
5238
|
+
/* @__PURE__ */ jsx20("span", { class: `${p17}-readonly-label`, children: label }),
|
|
5239
|
+
/* @__PURE__ */ jsx20("button", { type: "button", class: `${p17}-readonly-cta`, onClick: onNewConversation, children: ctaLabel })
|
|
5229
5240
|
] });
|
|
5230
5241
|
}
|
|
5231
5242
|
function ComposerFooter({ disclaimer }) {
|
|
5232
5243
|
if (!disclaimer) return null;
|
|
5233
|
-
return /* @__PURE__ */
|
|
5244
|
+
return /* @__PURE__ */ jsx20("div", { class: `${p17}-composer-footer`, children: /* @__PURE__ */ jsx20("div", { class: `${p17}-disclaimer`, children: disclaimer }) });
|
|
5234
5245
|
}
|
|
5235
5246
|
function PoweredByBar({ poweredBy }) {
|
|
5236
5247
|
if (!poweredBy) return null;
|
|
5237
|
-
return /* @__PURE__ */
|
|
5248
|
+
return /* @__PURE__ */ jsx20("div", { class: `${p17}-poweredby-bar`, children: /* @__PURE__ */ jsx20(PoweredBy, { logoUrl: poweredBy.logoUrl, text: poweredBy.text, href: poweredBy.href }) });
|
|
5238
5249
|
}
|
|
5239
5250
|
function PoweredBy({ logoUrl, text, href }) {
|
|
5240
5251
|
const inner = /* @__PURE__ */ jsxs16(Fragment3, { children: [
|
|
5241
|
-
logoUrl ? /* @__PURE__ */
|
|
5242
|
-
text ? /* @__PURE__ */
|
|
5252
|
+
logoUrl ? /* @__PURE__ */ jsx20("img", { class: `${p17}-poweredby-logo`, src: logoUrl, alt: "", loading: "lazy" }) : null,
|
|
5253
|
+
text ? /* @__PURE__ */ jsx20("span", { children: text }) : null
|
|
5243
5254
|
] });
|
|
5244
5255
|
if (href) {
|
|
5245
|
-
return /* @__PURE__ */
|
|
5256
|
+
return /* @__PURE__ */ jsx20("a", { class: `${p17}-poweredby`, href, target: "_blank", rel: "noopener noreferrer", children: inner });
|
|
5246
5257
|
}
|
|
5247
|
-
return /* @__PURE__ */
|
|
5258
|
+
return /* @__PURE__ */ jsx20("span", { class: `${p17}-poweredby`, children: inner });
|
|
5248
5259
|
}
|
|
5249
5260
|
|
|
5250
5261
|
// src/ui/form/form-controller.ts
|
|
@@ -5320,7 +5331,7 @@ function whenPasses(form, d) {
|
|
|
5320
5331
|
}
|
|
5321
5332
|
|
|
5322
5333
|
// src/ui/sidebar.tsx
|
|
5323
|
-
import { Fragment as Fragment4, jsx as
|
|
5334
|
+
import { Fragment as Fragment4, jsx as jsx21, jsxs as jsxs17 } from "preact/jsx-runtime";
|
|
5324
5335
|
function Sidebar(props2) {
|
|
5325
5336
|
const p33 = BRAND.cssPrefix;
|
|
5326
5337
|
const { site, blocks, strings, collapsed } = props2;
|
|
@@ -5329,8 +5340,8 @@ function Sidebar(props2) {
|
|
|
5329
5340
|
const toggleLabel = collapsed ? strings.expandSidebar : strings.collapseSidebar;
|
|
5330
5341
|
return /* @__PURE__ */ jsxs17("aside", { class: `${p33}-sidebar`, "data-collapsed": collapsed ? "true" : "false", "data-testid": TID.sidebar, children: [
|
|
5331
5342
|
/* @__PURE__ */ jsxs17("div", { class: `${p33}-sidebar-header`, children: [
|
|
5332
|
-
/* @__PURE__ */
|
|
5333
|
-
/* @__PURE__ */
|
|
5343
|
+
/* @__PURE__ */ jsx21(SidebarBrand, { site }),
|
|
5344
|
+
/* @__PURE__ */ jsx21(
|
|
5334
5345
|
"button",
|
|
5335
5346
|
{
|
|
5336
5347
|
type: "button",
|
|
@@ -5340,21 +5351,21 @@ function Sidebar(props2) {
|
|
|
5340
5351
|
title: toggleLabel,
|
|
5341
5352
|
onClick: props2.onToggleCollapsed,
|
|
5342
5353
|
"data-testid": TID.sidebarToggle,
|
|
5343
|
-
children: /* @__PURE__ */
|
|
5354
|
+
children: /* @__PURE__ */ jsx21(SidebarToggleIcon, { collapsed })
|
|
5344
5355
|
}
|
|
5345
5356
|
)
|
|
5346
5357
|
] }),
|
|
5347
5358
|
collapsed ? null : /* @__PURE__ */ jsxs17(Fragment4, { children: [
|
|
5348
|
-
navigation.length > 0 ? /* @__PURE__ */
|
|
5349
|
-
linkCards.length > 0 ? /* @__PURE__ */
|
|
5350
|
-
props2.showConversations ? /* @__PURE__ */
|
|
5359
|
+
navigation.length > 0 ? /* @__PURE__ */ jsx21("nav", { class: `${p33}-sidebar-section`, "data-section": "navigation", children: /* @__PURE__ */ jsx21(SidebarNav, { items: navigation }) }) : null,
|
|
5360
|
+
linkCards.length > 0 ? /* @__PURE__ */ jsx21("div", { class: `${p33}-sidebar-section`, "data-section": "link-cards", children: /* @__PURE__ */ jsx21(SidebarCards, { items: linkCards }) }) : null,
|
|
5361
|
+
props2.showConversations ? /* @__PURE__ */ jsx21("div", { class: `${p33}-sidebar-conversations`, children: /* @__PURE__ */ jsx21(
|
|
5351
5362
|
ConversationList,
|
|
5352
5363
|
{
|
|
5353
5364
|
transport: props2.transport,
|
|
5354
5365
|
strings: props2.strings,
|
|
5355
5366
|
visitorId: props2.visitorId,
|
|
5356
|
-
onSelect: props2.
|
|
5357
|
-
|
|
5367
|
+
onSelect: props2.onSelectConversation,
|
|
5368
|
+
onNewConversation: props2.onNewConversation
|
|
5358
5369
|
}
|
|
5359
5370
|
) }) : null
|
|
5360
5371
|
] })
|
|
@@ -5365,14 +5376,14 @@ function SidebarBrand({ site }) {
|
|
|
5365
5376
|
if (site?.logo?.url) {
|
|
5366
5377
|
const alt = site.logo.alt ?? site.title ?? "Logo";
|
|
5367
5378
|
return /* @__PURE__ */ jsxs17("picture", { children: [
|
|
5368
|
-
site.logoDark?.url ? /* @__PURE__ */
|
|
5369
|
-
/* @__PURE__ */
|
|
5379
|
+
site.logoDark?.url ? /* @__PURE__ */ jsx21("source", { srcset: site.logoDark.url, media: "(prefers-color-scheme: dark)" }) : null,
|
|
5380
|
+
/* @__PURE__ */ jsx21("img", { class: `${p33}-sidebar-logo`, src: site.logo.url, alt })
|
|
5370
5381
|
] });
|
|
5371
5382
|
}
|
|
5372
|
-
return /* @__PURE__ */
|
|
5383
|
+
return /* @__PURE__ */ jsx21("div", { class: `${p33}-sidebar-title`, children: site?.title ?? BRAND.name });
|
|
5373
5384
|
}
|
|
5374
5385
|
function SidebarToggleIcon({ collapsed }) {
|
|
5375
|
-
return /* @__PURE__ */
|
|
5386
|
+
return /* @__PURE__ */ jsx21(
|
|
5376
5387
|
"svg",
|
|
5377
5388
|
{
|
|
5378
5389
|
width: "16",
|
|
@@ -5382,13 +5393,13 @@ function SidebarToggleIcon({ collapsed }) {
|
|
|
5382
5393
|
stroke: "currentColor",
|
|
5383
5394
|
"stroke-width": "2",
|
|
5384
5395
|
"aria-hidden": "true",
|
|
5385
|
-
children: collapsed ? /* @__PURE__ */
|
|
5396
|
+
children: collapsed ? /* @__PURE__ */ jsx21("polyline", { points: "9 6 15 12 9 18" }) : /* @__PURE__ */ jsx21("polyline", { points: "15 6 9 12 15 18" })
|
|
5386
5397
|
}
|
|
5387
5398
|
);
|
|
5388
5399
|
}
|
|
5389
5400
|
function SidebarNav({ items }) {
|
|
5390
5401
|
const p33 = BRAND.cssPrefix;
|
|
5391
|
-
return /* @__PURE__ */
|
|
5402
|
+
return /* @__PURE__ */ jsx21("ul", { class: `${p33}-sidebar-nav`, children: items.map((item) => /* @__PURE__ */ jsx21("li", { children: /* @__PURE__ */ jsxs17(
|
|
5392
5403
|
"a",
|
|
5393
5404
|
{
|
|
5394
5405
|
class: `${p33}-sidebar-nav-item`,
|
|
@@ -5396,15 +5407,15 @@ function SidebarNav({ items }) {
|
|
|
5396
5407
|
target: item.href ? "_blank" : void 0,
|
|
5397
5408
|
rel: item.href ? "noreferrer" : void 0,
|
|
5398
5409
|
children: [
|
|
5399
|
-
item.icon ? /* @__PURE__ */
|
|
5400
|
-
/* @__PURE__ */
|
|
5410
|
+
item.icon ? /* @__PURE__ */ jsx21("span", { class: `${p33}-sidebar-nav-icon`, "data-icon": item.icon }) : null,
|
|
5411
|
+
/* @__PURE__ */ jsx21("span", { class: `${p33}-sidebar-nav-label`, children: item.label })
|
|
5401
5412
|
]
|
|
5402
5413
|
}
|
|
5403
5414
|
) }, item.id ?? item.label)) });
|
|
5404
5415
|
}
|
|
5405
5416
|
function SidebarCards({ items }) {
|
|
5406
5417
|
const p33 = BRAND.cssPrefix;
|
|
5407
|
-
return /* @__PURE__ */
|
|
5418
|
+
return /* @__PURE__ */ jsx21("div", { class: `${p33}-sidebar-cards`, children: items.map((item) => /* @__PURE__ */ jsxs17(
|
|
5408
5419
|
"a",
|
|
5409
5420
|
{
|
|
5410
5421
|
class: `${p33}-sidebar-card`,
|
|
@@ -5412,8 +5423,8 @@ function SidebarCards({ items }) {
|
|
|
5412
5423
|
target: item.href ? "_blank" : void 0,
|
|
5413
5424
|
rel: item.href ? "noreferrer" : void 0,
|
|
5414
5425
|
children: [
|
|
5415
|
-
/* @__PURE__ */
|
|
5416
|
-
item.description ? /* @__PURE__ */
|
|
5426
|
+
/* @__PURE__ */ jsx21("div", { class: `${p33}-sidebar-card-label`, children: item.label }),
|
|
5427
|
+
item.description ? /* @__PURE__ */ jsx21("div", { class: `${p33}-sidebar-card-desc`, children: item.description }) : null
|
|
5417
5428
|
]
|
|
5418
5429
|
},
|
|
5419
5430
|
item.id ?? item.label
|
|
@@ -5421,11 +5432,11 @@ function SidebarCards({ items }) {
|
|
|
5421
5432
|
}
|
|
5422
5433
|
|
|
5423
5434
|
// src/ui/page-shell.tsx
|
|
5424
|
-
import { jsx as
|
|
5435
|
+
import { jsx as jsx22, jsxs as jsxs18 } from "preact/jsx-runtime";
|
|
5425
5436
|
var p18 = BRAND.cssPrefix;
|
|
5426
5437
|
function PageShell(props2) {
|
|
5427
5438
|
return /* @__PURE__ */ jsxs18("main", { class: `${p18}-page-shell`, "data-sidebar-collapsed": props2.sidebarCollapsed ? "true" : "false", children: [
|
|
5428
|
-
/* @__PURE__ */
|
|
5439
|
+
/* @__PURE__ */ jsx22(
|
|
5429
5440
|
Sidebar,
|
|
5430
5441
|
{
|
|
5431
5442
|
site: props2.site,
|
|
@@ -5434,13 +5445,13 @@ function PageShell(props2) {
|
|
|
5434
5445
|
strings: props2.strings,
|
|
5435
5446
|
visitorId: props2.visitorId,
|
|
5436
5447
|
showConversations: props2.showConversations,
|
|
5437
|
-
|
|
5438
|
-
|
|
5448
|
+
onSelectConversation: props2.onSelectConversation,
|
|
5449
|
+
onNewConversation: props2.onNewConversation,
|
|
5439
5450
|
collapsed: props2.sidebarCollapsed,
|
|
5440
5451
|
onToggleCollapsed: props2.onToggleSidebarCollapsed
|
|
5441
5452
|
}
|
|
5442
5453
|
),
|
|
5443
|
-
/* @__PURE__ */
|
|
5454
|
+
/* @__PURE__ */ jsx22("section", { class: `${p18}-page-chat`, "aria-label": "Chat", children: props2.children })
|
|
5444
5455
|
] });
|
|
5445
5456
|
}
|
|
5446
5457
|
|
|
@@ -5480,7 +5491,7 @@ var atTabRoot = (s) => activeStack(s).length === 0;
|
|
|
5480
5491
|
import { useCallback as useCallback4, useEffect as useEffect15, useRef as useRef8 } from "preact/hooks";
|
|
5481
5492
|
import { useComputed as useComputed6 } from "@preact/signals";
|
|
5482
5493
|
|
|
5483
|
-
// src/ui/modules/
|
|
5494
|
+
// src/ui/modules/chat.tsx
|
|
5484
5495
|
var chatLayout = {
|
|
5485
5496
|
Icon: BubblesIcon
|
|
5486
5497
|
// No `Root`: MessengerHome renders the existing chat panel for this tab.
|
|
@@ -5490,35 +5501,35 @@ var chatLayout = {
|
|
|
5490
5501
|
import { useEffect as useEffect11, useMemo as useMemo2, useState as useState8 } from "preact/hooks";
|
|
5491
5502
|
|
|
5492
5503
|
// src/ui/back-header.tsx
|
|
5493
|
-
import { jsx as
|
|
5504
|
+
import { jsx as jsx23, jsxs as jsxs19 } from "preact/jsx-runtime";
|
|
5494
5505
|
var p19 = BRAND.cssPrefix;
|
|
5495
5506
|
function TitleBar({ title, actions }) {
|
|
5496
5507
|
return /* @__PURE__ */ jsxs19("header", { class: `${p19}-back-header`, "data-variant": "title", children: [
|
|
5497
|
-
/* @__PURE__ */
|
|
5498
|
-
/* @__PURE__ */
|
|
5499
|
-
actions ?? /* @__PURE__ */
|
|
5508
|
+
/* @__PURE__ */ jsx23("span", { class: `${p19}-back-spacer`, "aria-hidden": "true" }),
|
|
5509
|
+
/* @__PURE__ */ jsx23("h1", { class: `${p19}-back-title`, children: title }),
|
|
5510
|
+
actions ?? /* @__PURE__ */ jsx23("span", { class: `${p19}-back-spacer`, "aria-hidden": "true" })
|
|
5500
5511
|
] });
|
|
5501
5512
|
}
|
|
5502
5513
|
function BackHeader({ title, backLabel, onBack, actions, testid }) {
|
|
5503
5514
|
return /* @__PURE__ */ jsxs19("header", { class: `${p19}-back-header`, "data-testid": testid, children: [
|
|
5504
|
-
/* @__PURE__ */
|
|
5505
|
-
/* @__PURE__ */
|
|
5506
|
-
actions ?? /* @__PURE__ */
|
|
5515
|
+
/* @__PURE__ */ jsx23("button", { type: "button", class: `${p19}-icon-btn`, onClick: onBack, "aria-label": backLabel, title: backLabel, children: /* @__PURE__ */ jsx23(BackIcon, {}) }),
|
|
5516
|
+
/* @__PURE__ */ jsx23("h1", { class: `${p19}-back-title`, children: title }),
|
|
5517
|
+
actions ?? /* @__PURE__ */ jsx23("span", { class: `${p19}-back-spacer`, "aria-hidden": "true" })
|
|
5507
5518
|
] });
|
|
5508
5519
|
}
|
|
5509
5520
|
|
|
5510
5521
|
// src/ui/home-search.tsx
|
|
5511
|
-
import { jsx as
|
|
5522
|
+
import { jsx as jsx24, jsxs as jsxs20 } from "preact/jsx-runtime";
|
|
5512
5523
|
var p20 = BRAND.cssPrefix;
|
|
5513
5524
|
function HomeSearchButton({ placeholder, onActivate }) {
|
|
5514
5525
|
return /* @__PURE__ */ jsxs20("button", { type: "button", class: `${p20}-home-search`, onClick: onActivate, "data-testid": TID.homeSearch, children: [
|
|
5515
|
-
/* @__PURE__ */
|
|
5516
|
-
/* @__PURE__ */
|
|
5526
|
+
/* @__PURE__ */ jsx24("span", { class: `${p20}-home-search-text`, children: placeholder }),
|
|
5527
|
+
/* @__PURE__ */ jsx24("span", { class: `${p20}-home-search-icon`, "aria-hidden": "true", children: /* @__PURE__ */ jsx24(SearchIcon, {}) })
|
|
5517
5528
|
] });
|
|
5518
5529
|
}
|
|
5519
5530
|
function HelpSearchInput({ placeholder, value, onInput }) {
|
|
5520
5531
|
return /* @__PURE__ */ jsxs20("div", { class: `${p20}-home-search`, "data-input": "true", children: [
|
|
5521
|
-
/* @__PURE__ */
|
|
5532
|
+
/* @__PURE__ */ jsx24(
|
|
5522
5533
|
"input",
|
|
5523
5534
|
{
|
|
5524
5535
|
type: "search",
|
|
@@ -5529,25 +5540,25 @@ function HelpSearchInput({ placeholder, value, onInput }) {
|
|
|
5529
5540
|
"data-testid": TID.helpSearch
|
|
5530
5541
|
}
|
|
5531
5542
|
),
|
|
5532
|
-
/* @__PURE__ */
|
|
5543
|
+
/* @__PURE__ */ jsx24("span", { class: `${p20}-home-search-icon`, "aria-hidden": "true", children: /* @__PURE__ */ jsx24(SearchIcon, {}) })
|
|
5533
5544
|
] });
|
|
5534
5545
|
}
|
|
5535
5546
|
|
|
5536
5547
|
// src/ui/list-row.tsx
|
|
5537
|
-
import { jsx as
|
|
5548
|
+
import { jsx as jsx25, jsxs as jsxs21 } from "preact/jsx-runtime";
|
|
5538
5549
|
var p21 = BRAND.cssPrefix;
|
|
5539
5550
|
function ListRow({ title, subtitle, onClick, testid }) {
|
|
5540
5551
|
return /* @__PURE__ */ jsxs21("button", { type: "button", class: `${p21}-list-row`, onClick, "data-testid": testid, children: [
|
|
5541
5552
|
/* @__PURE__ */ jsxs21("span", { class: `${p21}-list-row-body`, children: [
|
|
5542
|
-
/* @__PURE__ */
|
|
5543
|
-
subtitle ? /* @__PURE__ */
|
|
5553
|
+
/* @__PURE__ */ jsx25("span", { class: `${p21}-list-row-title`, children: title }),
|
|
5554
|
+
subtitle ? /* @__PURE__ */ jsx25("span", { class: `${p21}-list-row-sub`, children: subtitle }) : null
|
|
5544
5555
|
] }),
|
|
5545
|
-
/* @__PURE__ */
|
|
5556
|
+
/* @__PURE__ */ jsx25("span", { class: `${p21}-list-row-chevron`, "aria-hidden": "true", children: /* @__PURE__ */ jsx25(ChevronRightIcon, {}) })
|
|
5546
5557
|
] });
|
|
5547
5558
|
}
|
|
5548
5559
|
|
|
5549
5560
|
// src/ui/module-state.tsx
|
|
5550
|
-
import { jsx as
|
|
5561
|
+
import { jsx as jsx26, jsxs as jsxs22 } from "preact/jsx-runtime";
|
|
5551
5562
|
var p22 = BRAND.cssPrefix;
|
|
5552
5563
|
function ModuleState({
|
|
5553
5564
|
tone = "info",
|
|
@@ -5556,13 +5567,13 @@ function ModuleState({
|
|
|
5556
5567
|
strings
|
|
5557
5568
|
}) {
|
|
5558
5569
|
return /* @__PURE__ */ jsxs22("div", { class: `${p22}-module-empty`, role: tone === "error" ? "alert" : "status", "aria-live": "polite", children: [
|
|
5559
|
-
/* @__PURE__ */
|
|
5560
|
-
onRetry ? /* @__PURE__ */
|
|
5570
|
+
/* @__PURE__ */ jsx26("span", { children: message }),
|
|
5571
|
+
onRetry ? /* @__PURE__ */ jsx26("button", { type: "button", class: `${p22}-module-retry`, onClick: onRetry, children: strings.errorRetry }) : null
|
|
5561
5572
|
] });
|
|
5562
5573
|
}
|
|
5563
5574
|
|
|
5564
5575
|
// src/ui/modules/help.tsx
|
|
5565
|
-
import { jsx as
|
|
5576
|
+
import { jsx as jsx27, jsxs as jsxs23 } from "preact/jsx-runtime";
|
|
5566
5577
|
var p23 = BRAND.cssPrefix;
|
|
5567
5578
|
var log12 = logger.scope("help");
|
|
5568
5579
|
var openArticle = (nav, a) => a.url ? nav.push({ kind: "iframe", url: a.url, title: a.title }) : nav.push({ kind: "content", id: a.id, title: a.title });
|
|
@@ -5592,7 +5603,7 @@ function fuzzySearch(items, query) {
|
|
|
5592
5603
|
return items.map((item) => ({ item, score: Math.max(fuzzyScore(q, item.title) * 2, fuzzyScore(q, item.description ?? "")) })).filter((r) => r.score > 0).toSorted((a, b) => b.score - a.score).map((r) => r.item);
|
|
5593
5604
|
}
|
|
5594
5605
|
function ArticleRow({ article, nav }) {
|
|
5595
|
-
return /* @__PURE__ */
|
|
5606
|
+
return /* @__PURE__ */ jsx27(
|
|
5596
5607
|
ListRow,
|
|
5597
5608
|
{
|
|
5598
5609
|
title: article.title,
|
|
@@ -5629,45 +5640,45 @@ function HelpRoot({ transport, strings, config, nav, panelProps }) {
|
|
|
5629
5640
|
const results = useMemo2(() => fuzzySearch(items, query), [items, query]);
|
|
5630
5641
|
function renderBody() {
|
|
5631
5642
|
if (query.trim().length > 0) {
|
|
5632
|
-
if (results.length === 0) return /* @__PURE__ */
|
|
5633
|
-
return /* @__PURE__ */
|
|
5643
|
+
if (results.length === 0) return /* @__PURE__ */ jsx27(ModuleState, { message: strings.helpSearchEmpty, strings });
|
|
5644
|
+
return /* @__PURE__ */ jsx27("div", { class: `${p23}-help-card`, children: results.map((a) => /* @__PURE__ */ jsx27(ArticleRow, { article: a, nav }, a.id)) });
|
|
5634
5645
|
}
|
|
5635
|
-
if (state === "loading") return /* @__PURE__ */
|
|
5646
|
+
if (state === "loading") return /* @__PURE__ */ jsx27(ModuleState, { message: strings.helpLoading, strings });
|
|
5636
5647
|
if (state === "error") {
|
|
5637
|
-
return /* @__PURE__ */
|
|
5648
|
+
return /* @__PURE__ */ jsx27(ModuleState, { tone: "error", message: errorMsg, onRetry: () => setReloadKey((k) => k + 1), strings });
|
|
5638
5649
|
}
|
|
5639
|
-
if (items.length === 0) return /* @__PURE__ */
|
|
5650
|
+
if (items.length === 0) return /* @__PURE__ */ jsx27(ModuleState, { message: strings.helpEmpty, strings });
|
|
5640
5651
|
return groupByCategory(items).map(([category, rows]) => /* @__PURE__ */ jsxs23("section", { class: `${p23}-help-group`, children: [
|
|
5641
|
-
category ? /* @__PURE__ */
|
|
5642
|
-
/* @__PURE__ */
|
|
5652
|
+
category ? /* @__PURE__ */ jsx27("h2", { class: `${p23}-help-section-title`, children: category }) : null,
|
|
5653
|
+
/* @__PURE__ */ jsx27("div", { class: `${p23}-help-card`, children: rows.map((a) => /* @__PURE__ */ jsx27(ArticleRow, { article: a, nav }, a.id)) })
|
|
5643
5654
|
] }, category));
|
|
5644
5655
|
}
|
|
5645
5656
|
return /* @__PURE__ */ jsxs23("div", { class: `${p23}-module`, children: [
|
|
5646
|
-
/* @__PURE__ */
|
|
5647
|
-
/* @__PURE__ */
|
|
5648
|
-
/* @__PURE__ */
|
|
5657
|
+
/* @__PURE__ */ jsx27(TitleBar, { title: strings.helpTitle, actions: /* @__PURE__ */ jsx27(HeaderActions, { panelProps, variant: "plain" }) }),
|
|
5658
|
+
/* @__PURE__ */ jsx27("div", { class: `${p23}-module-pad`, children: /* @__PURE__ */ jsx27(HelpSearchInput, { placeholder: strings.helpSearchPlaceholder, value: query, onInput: setQuery }) }),
|
|
5659
|
+
/* @__PURE__ */ jsx27("div", { class: `${p23}-help-list`, children: renderBody() })
|
|
5649
5660
|
] });
|
|
5650
5661
|
}
|
|
5651
5662
|
var helpLayout = {
|
|
5652
5663
|
Icon: HelpIcon,
|
|
5653
|
-
Root: (props2) => /* @__PURE__ */
|
|
5664
|
+
Root: (props2) => /* @__PURE__ */ jsx27(HelpRoot, { ...props2 })
|
|
5654
5665
|
};
|
|
5655
5666
|
|
|
5656
5667
|
// src/ui/modules/home.tsx
|
|
5657
5668
|
import { useEffect as useEffect12, useState as useState9 } from "preact/hooks";
|
|
5658
5669
|
|
|
5659
5670
|
// src/ui/home-card.tsx
|
|
5660
|
-
import { jsx as
|
|
5671
|
+
import { jsx as jsx28 } from "preact/jsx-runtime";
|
|
5661
5672
|
var p24 = BRAND.cssPrefix;
|
|
5662
5673
|
function HomeCard({ onClick, children, testid }) {
|
|
5663
5674
|
if (onClick) {
|
|
5664
|
-
return /* @__PURE__ */
|
|
5675
|
+
return /* @__PURE__ */ jsx28("button", { type: "button", class: `${p24}-home-card`, "data-interactive": "true", onClick, "data-testid": testid, children });
|
|
5665
5676
|
}
|
|
5666
|
-
return /* @__PURE__ */
|
|
5677
|
+
return /* @__PURE__ */ jsx28("div", { class: `${p24}-home-card`, "data-testid": testid, children });
|
|
5667
5678
|
}
|
|
5668
5679
|
|
|
5669
5680
|
// src/ui/modules/home.tsx
|
|
5670
|
-
import { Fragment as Fragment5, jsx as
|
|
5681
|
+
import { Fragment as Fragment5, jsx as jsx29, jsxs as jsxs24 } from "preact/jsx-runtime";
|
|
5671
5682
|
var p25 = BRAND.cssPrefix;
|
|
5672
5683
|
var log13 = logger.scope("home");
|
|
5673
5684
|
function resolveGreeting(props2) {
|
|
@@ -5686,13 +5697,13 @@ function HomeRoot(props2) {
|
|
|
5686
5697
|
const [content, setContent] = useState9([]);
|
|
5687
5698
|
const tagsKey = config.contentTags?.join(",");
|
|
5688
5699
|
useEffect12(() => {
|
|
5689
|
-
if (!config.
|
|
5700
|
+
if (!config.showRecentConversations) return;
|
|
5690
5701
|
let cancelled = false;
|
|
5691
5702
|
transport.listConversations({ limit: 1 }).then((res) => !cancelled && setRecent(res.conversations?.[0] ?? null)).catch((err) => !cancelled && log13.warn("listConversations (home) failed", { err }));
|
|
5692
5703
|
return () => {
|
|
5693
5704
|
cancelled = true;
|
|
5694
5705
|
};
|
|
5695
|
-
}, [transport, config.
|
|
5706
|
+
}, [transport, config.showRecentConversations]);
|
|
5696
5707
|
useEffect12(() => {
|
|
5697
5708
|
if (!config.contentTags?.length) return;
|
|
5698
5709
|
let cancelled = false;
|
|
@@ -5705,49 +5716,49 @@ function HomeRoot(props2) {
|
|
|
5705
5716
|
const avatars = config.userAvatars ?? [];
|
|
5706
5717
|
const status = config.status;
|
|
5707
5718
|
const contentTitle = config.contentBlockTitle ? moduleLabel(strings, config.contentBlockTitle) : strings.homeContentTitle;
|
|
5708
|
-
return /* @__PURE__ */
|
|
5719
|
+
return /* @__PURE__ */ jsx29("div", { class: `${p25}-module ${p25}-home`, "data-testid": TID.homeView, children: /* @__PURE__ */ jsxs24("div", { class: `${p25}-home-scroll`, children: [
|
|
5709
5720
|
/* @__PURE__ */ jsxs24("div", { class: `${p25}-home-hero`, children: [
|
|
5710
5721
|
/* @__PURE__ */ jsxs24("div", { class: `${p25}-home-hero-top`, children: [
|
|
5711
|
-
config.brandName ? /* @__PURE__ */
|
|
5722
|
+
config.brandName ? /* @__PURE__ */ jsx29("span", { class: `${p25}-home-brand`, "data-testid": TID.homeBrand, children: config.brandName }) : /* @__PURE__ */ jsx29("span", { class: `${p25}-home-brand-spacer`, "aria-hidden": "true" }),
|
|
5712
5723
|
/* @__PURE__ */ jsxs24("div", { class: `${p25}-home-hero-actions`, children: [
|
|
5713
|
-
avatars.length > 0 ? /* @__PURE__ */
|
|
5714
|
-
/* @__PURE__ */
|
|
5724
|
+
avatars.length > 0 ? /* @__PURE__ */ jsx29("div", { class: `${p25}-home-avatars`, children: avatars.map((a) => /* @__PURE__ */ jsx29("span", { class: `${p25}-home-avatar`, title: a.role ? `${a.name} \xB7 ${a.role}` : a.name, children: a.avatar ? /* @__PURE__ */ jsx29("img", { src: a.avatar, alt: "", loading: "lazy" }) : /* @__PURE__ */ jsx29("span", { children: initials(a.name) }) }, a.name)) }) : null,
|
|
5725
|
+
/* @__PURE__ */ jsx29(HeaderActions, { panelProps, variant: "plain" })
|
|
5715
5726
|
] })
|
|
5716
5727
|
] }),
|
|
5717
5728
|
config.showGreeting !== false ? /* @__PURE__ */ jsxs24(Fragment5, { children: [
|
|
5718
|
-
/* @__PURE__ */
|
|
5719
|
-
greeting.subtitle ? /* @__PURE__ */
|
|
5729
|
+
/* @__PURE__ */ jsx29("h1", { class: `${p25}-home-greeting`, "data-testid": TID.homeGreeting, children: greeting.title }),
|
|
5730
|
+
greeting.subtitle ? /* @__PURE__ */ jsx29("p", { class: `${p25}-home-lead`, children: greeting.subtitle }) : null
|
|
5720
5731
|
] }) : null
|
|
5721
5732
|
] }),
|
|
5722
5733
|
/* @__PURE__ */ jsxs24("div", { class: `${p25}-home-cards`, children: [
|
|
5723
|
-
config.showSearchBar !== false ? /* @__PURE__ */
|
|
5734
|
+
config.showSearchBar !== false ? /* @__PURE__ */ jsx29(
|
|
5724
5735
|
HomeSearchButton,
|
|
5725
5736
|
{
|
|
5726
5737
|
placeholder: strings.homeSearchPlaceholder,
|
|
5727
5738
|
onActivate: () => nav.switchToLayout("help")
|
|
5728
5739
|
}
|
|
5729
5740
|
) : null,
|
|
5730
|
-
recent ? /* @__PURE__ */
|
|
5731
|
-
/* @__PURE__ */
|
|
5741
|
+
recent ? /* @__PURE__ */ jsx29(HomeCard, { onClick: () => nav.selectConversation(recent.conversationId), testid: TID.homeRecent, children: /* @__PURE__ */ jsxs24("div", { class: `${p25}-home-recent-row`, "data-unread": (recent.unreadCount ?? 0) > 0 ? "true" : void 0, children: [
|
|
5742
|
+
/* @__PURE__ */ jsx29("span", { class: `${p25}-home-recent-avatar`, "aria-hidden": "true", children: /* @__PURE__ */ jsx29(BubblesIcon, {}) }),
|
|
5732
5743
|
/* @__PURE__ */ jsxs24("span", { class: `${p25}-home-recent-body`, children: [
|
|
5733
|
-
/* @__PURE__ */
|
|
5734
|
-
recent.preview ? /* @__PURE__ */
|
|
5744
|
+
/* @__PURE__ */ jsx29("span", { class: `${p25}-home-recent-title`, children: recent.title }),
|
|
5745
|
+
recent.preview ? /* @__PURE__ */ jsx29("span", { class: `${p25}-home-recent-preview`, children: recent.preview }) : null
|
|
5735
5746
|
] }),
|
|
5736
|
-
(recent.unreadCount ?? 0) > 0 ? /* @__PURE__ */
|
|
5747
|
+
(recent.unreadCount ?? 0) > 0 ? /* @__PURE__ */ jsx29("span", { class: `${p25}-home-recent-dot`, "aria-label": "Unread" }) : null
|
|
5737
5748
|
] }) }) : null,
|
|
5738
|
-
status ? /* @__PURE__ */
|
|
5749
|
+
status ? /* @__PURE__ */ jsx29(
|
|
5739
5750
|
HomeCard,
|
|
5740
5751
|
{
|
|
5741
5752
|
onClick: status.url ? () => nav.push({ kind: "iframe", url: status.url, title: status.text }) : void 0,
|
|
5742
5753
|
children: /* @__PURE__ */ jsxs24("div", { class: `${p25}-home-status`, "data-level": status.level ?? "operational", children: [
|
|
5743
|
-
/* @__PURE__ */
|
|
5744
|
-
/* @__PURE__ */
|
|
5754
|
+
/* @__PURE__ */ jsx29("span", { class: `${p25}-home-status-icon`, "aria-hidden": "true", children: /* @__PURE__ */ jsx29(StatusOkIcon, {}) }),
|
|
5755
|
+
/* @__PURE__ */ jsx29("span", { class: `${p25}-home-status-text`, children: status.text })
|
|
5745
5756
|
] })
|
|
5746
5757
|
}
|
|
5747
5758
|
) : null,
|
|
5748
5759
|
content.length > 0 ? /* @__PURE__ */ jsxs24("section", { class: `${p25}-home-content`, children: [
|
|
5749
|
-
/* @__PURE__ */
|
|
5750
|
-
/* @__PURE__ */
|
|
5760
|
+
/* @__PURE__ */ jsx29("div", { class: `${p25}-home-content-title`, children: contentTitle }),
|
|
5761
|
+
/* @__PURE__ */ jsx29("div", { class: `${p25}-home-content-list`, children: content.map((item) => /* @__PURE__ */ jsx29(
|
|
5751
5762
|
ListRow,
|
|
5752
5763
|
{
|
|
5753
5764
|
title: item.title,
|
|
@@ -5763,12 +5774,12 @@ function HomeRoot(props2) {
|
|
|
5763
5774
|
}
|
|
5764
5775
|
var homeLayout = {
|
|
5765
5776
|
Icon: HomeIcon,
|
|
5766
|
-
Root: (props2) => /* @__PURE__ */
|
|
5777
|
+
Root: (props2) => /* @__PURE__ */ jsx29(HomeRoot, { ...props2 })
|
|
5767
5778
|
};
|
|
5768
5779
|
|
|
5769
5780
|
// src/ui/modules/news.tsx
|
|
5770
5781
|
import { useEffect as useEffect13, useState as useState10 } from "preact/hooks";
|
|
5771
|
-
import { jsx as
|
|
5782
|
+
import { jsx as jsx30, jsxs as jsxs25 } from "preact/jsx-runtime";
|
|
5772
5783
|
var p26 = BRAND.cssPrefix;
|
|
5773
5784
|
var log14 = logger.scope("news");
|
|
5774
5785
|
function NewsRoot({ transport, strings, config, nav, panelProps }) {
|
|
@@ -5795,12 +5806,12 @@ function NewsRoot({ transport, strings, config, nav, panelProps }) {
|
|
|
5795
5806
|
};
|
|
5796
5807
|
}, [transport, tags, reloadKey]);
|
|
5797
5808
|
function renderBody() {
|
|
5798
|
-
if (state === "loading") return /* @__PURE__ */
|
|
5809
|
+
if (state === "loading") return /* @__PURE__ */ jsx30(ModuleState, { message: strings.newsLoading, strings });
|
|
5799
5810
|
if (state === "error") {
|
|
5800
|
-
return /* @__PURE__ */
|
|
5811
|
+
return /* @__PURE__ */ jsx30(ModuleState, { tone: "error", message: errorMsg, onRetry: () => setReloadKey((k) => k + 1), strings });
|
|
5801
5812
|
}
|
|
5802
|
-
if (items.length === 0) return /* @__PURE__ */
|
|
5803
|
-
return /* @__PURE__ */
|
|
5813
|
+
if (items.length === 0) return /* @__PURE__ */ jsx30(ModuleState, { message: strings.newsEmpty, strings });
|
|
5814
|
+
return /* @__PURE__ */ jsx30("div", { class: `${p26}-news-list`, children: items.map((item) => /* @__PURE__ */ jsxs25(
|
|
5804
5815
|
"button",
|
|
5805
5816
|
{
|
|
5806
5817
|
type: "button",
|
|
@@ -5808,11 +5819,11 @@ function NewsRoot({ transport, strings, config, nav, panelProps }) {
|
|
|
5808
5819
|
onClick: () => nav.push({ kind: "content", id: item.id, title: item.title }),
|
|
5809
5820
|
"data-testid": tid(TID.newsItem, item.id),
|
|
5810
5821
|
children: [
|
|
5811
|
-
item.image ? /* @__PURE__ */
|
|
5822
|
+
item.image ? /* @__PURE__ */ jsx30("img", { class: `${p26}-news-hero`, src: item.image, alt: "", loading: "lazy" }) : null,
|
|
5812
5823
|
/* @__PURE__ */ jsxs25("span", { class: `${p26}-news-body`, children: [
|
|
5813
|
-
item.tags && item.tags.length > 0 ? /* @__PURE__ */
|
|
5814
|
-
/* @__PURE__ */
|
|
5815
|
-
item.description ? /* @__PURE__ */
|
|
5824
|
+
item.tags && item.tags.length > 0 ? /* @__PURE__ */ jsx30("span", { class: `${p26}-news-tags`, children: item.tags.map((t) => /* @__PURE__ */ jsx30("span", { class: `${p26}-news-tag`, children: t }, t)) }) : null,
|
|
5825
|
+
/* @__PURE__ */ jsx30("span", { class: `${p26}-news-title`, children: item.title }),
|
|
5826
|
+
item.description ? /* @__PURE__ */ jsx30("span", { class: `${p26}-news-summary`, children: item.description }) : null
|
|
5816
5827
|
] })
|
|
5817
5828
|
]
|
|
5818
5829
|
},
|
|
@@ -5820,13 +5831,13 @@ function NewsRoot({ transport, strings, config, nav, panelProps }) {
|
|
|
5820
5831
|
)) });
|
|
5821
5832
|
}
|
|
5822
5833
|
return /* @__PURE__ */ jsxs25("div", { class: `${p26}-module`, children: [
|
|
5823
|
-
/* @__PURE__ */
|
|
5824
|
-
/* @__PURE__ */
|
|
5834
|
+
/* @__PURE__ */ jsx30(TitleBar, { title: strings.newsTitle, actions: /* @__PURE__ */ jsx30(HeaderActions, { panelProps, variant: "plain" }) }),
|
|
5835
|
+
/* @__PURE__ */ jsx30("div", { class: `${p26}-module-scroll`, children: renderBody() })
|
|
5825
5836
|
] });
|
|
5826
5837
|
}
|
|
5827
5838
|
var newsLayout = {
|
|
5828
5839
|
Icon: NewsIcon,
|
|
5829
|
-
Root: (props2) => /* @__PURE__ */
|
|
5840
|
+
Root: (props2) => /* @__PURE__ */ jsx30(NewsRoot, { ...props2 })
|
|
5830
5841
|
};
|
|
5831
5842
|
|
|
5832
5843
|
// src/ui/modules/registry.ts
|
|
@@ -5838,10 +5849,10 @@ var LAYOUTS = {
|
|
|
5838
5849
|
};
|
|
5839
5850
|
|
|
5840
5851
|
// src/ui/home-tab-bar.tsx
|
|
5841
|
-
import { jsx as
|
|
5852
|
+
import { jsx as jsx31, jsxs as jsxs26 } from "preact/jsx-runtime";
|
|
5842
5853
|
var p27 = BRAND.cssPrefix;
|
|
5843
5854
|
function HomeTabBar({ modules, activeTab, strings, unreadCount, onSelect }) {
|
|
5844
|
-
return /* @__PURE__ */
|
|
5855
|
+
return /* @__PURE__ */ jsx31("nav", { class: `${p27}-tabbar`, role: "tablist", "aria-label": strings.panelTitle, children: modules.map((m) => {
|
|
5845
5856
|
const Icon = LAYOUTS[m.layout].Icon;
|
|
5846
5857
|
const selected = m.id === activeTab;
|
|
5847
5858
|
const badge = m.layout === "chat" && unreadCount > 0 ? unreadCount > 9 ? "9+" : String(unreadCount) : null;
|
|
@@ -5856,10 +5867,10 @@ function HomeTabBar({ modules, activeTab, strings, unreadCount, onSelect }) {
|
|
|
5856
5867
|
"data-testid": tid(TID.tab, m.id),
|
|
5857
5868
|
children: [
|
|
5858
5869
|
/* @__PURE__ */ jsxs26("span", { class: `${p27}-tab-icon`, "aria-hidden": "true", children: [
|
|
5859
|
-
/* @__PURE__ */
|
|
5860
|
-
badge ? /* @__PURE__ */
|
|
5870
|
+
/* @__PURE__ */ jsx31(Icon, {}),
|
|
5871
|
+
badge ? /* @__PURE__ */ jsx31("span", { class: `${p27}-tab-badge`, "data-testid": TID.tabBadge, children: badge }) : null
|
|
5861
5872
|
] }),
|
|
5862
|
-
/* @__PURE__ */
|
|
5873
|
+
/* @__PURE__ */ jsx31("span", { class: `${p27}-tab-label`, children: moduleLabel(strings, m.label) })
|
|
5863
5874
|
]
|
|
5864
5875
|
},
|
|
5865
5876
|
m.id
|
|
@@ -5868,12 +5879,12 @@ function HomeTabBar({ modules, activeTab, strings, unreadCount, onSelect }) {
|
|
|
5868
5879
|
}
|
|
5869
5880
|
|
|
5870
5881
|
// src/ui/iframe-view.tsx
|
|
5871
|
-
import { jsx as
|
|
5882
|
+
import { jsx as jsx32, jsxs as jsxs27 } from "preact/jsx-runtime";
|
|
5872
5883
|
var p28 = BRAND.cssPrefix;
|
|
5873
5884
|
var SANDBOX = "allow-scripts allow-forms allow-popups allow-popups-to-escape-sandbox allow-downloads";
|
|
5874
5885
|
function IframeView({ url, title, strings, onBack, actions }) {
|
|
5875
5886
|
return /* @__PURE__ */ jsxs27("div", { class: `${p28}-module`, children: [
|
|
5876
|
-
/* @__PURE__ */
|
|
5887
|
+
/* @__PURE__ */ jsx32(
|
|
5877
5888
|
BackHeader,
|
|
5878
5889
|
{
|
|
5879
5890
|
title: title || strings.moduleBack,
|
|
@@ -5882,7 +5893,7 @@ function IframeView({ url, title, strings, onBack, actions }) {
|
|
|
5882
5893
|
actions
|
|
5883
5894
|
}
|
|
5884
5895
|
),
|
|
5885
|
-
/* @__PURE__ */
|
|
5896
|
+
/* @__PURE__ */ jsx32(
|
|
5886
5897
|
"iframe",
|
|
5887
5898
|
{
|
|
5888
5899
|
class: `${p28}-content-frame`,
|
|
@@ -5899,7 +5910,7 @@ function IframeView({ url, title, strings, onBack, actions }) {
|
|
|
5899
5910
|
|
|
5900
5911
|
// src/ui/content-view.tsx
|
|
5901
5912
|
import { useCallback as useCallback3, useEffect as useEffect14, useState as useState11 } from "preact/hooks";
|
|
5902
|
-
import { jsx as
|
|
5913
|
+
import { jsx as jsx33, jsxs as jsxs28 } from "preact/jsx-runtime";
|
|
5903
5914
|
var p29 = BRAND.cssPrefix;
|
|
5904
5915
|
var log15 = logger.scope("content");
|
|
5905
5916
|
function ContentView({ id, title, transport, strings, onBack, actions }) {
|
|
@@ -5928,17 +5939,17 @@ function ContentView({ id, title, transport, strings, onBack, actions }) {
|
|
|
5928
5939
|
};
|
|
5929
5940
|
}, [transport, id, reloadKey]);
|
|
5930
5941
|
function renderBody() {
|
|
5931
|
-
if (failed) return /* @__PURE__ */
|
|
5932
|
-
if (item === null) return /* @__PURE__ */
|
|
5942
|
+
if (failed) return /* @__PURE__ */ jsx33(ModuleState, { tone: "error", message: strings.errorGeneric, onRetry: retry, strings });
|
|
5943
|
+
if (item === null) return /* @__PURE__ */ jsx33(ModuleState, { message: strings.contentLoading, strings });
|
|
5933
5944
|
return /* @__PURE__ */ jsxs28("article", { class: `${p29}-content`, "data-testid": TID.contentView, children: [
|
|
5934
|
-
item.image ? /* @__PURE__ */
|
|
5935
|
-
item.description ? /* @__PURE__ */
|
|
5936
|
-
item.tags && item.tags.length > 0 ? /* @__PURE__ */
|
|
5937
|
-
/* @__PURE__ */
|
|
5945
|
+
item.image ? /* @__PURE__ */ jsx33("img", { class: `${p29}-content-hero`, src: item.image, alt: "", loading: "lazy" }) : null,
|
|
5946
|
+
item.description ? /* @__PURE__ */ jsx33("p", { class: `${p29}-content-subtitle`, children: item.description }) : null,
|
|
5947
|
+
item.tags && item.tags.length > 0 ? /* @__PURE__ */ jsx33("span", { class: `${p29}-news-tags`, children: item.tags.map((t) => /* @__PURE__ */ jsx33("span", { class: `${p29}-news-tag`, children: t }, t)) }) : null,
|
|
5948
|
+
/* @__PURE__ */ jsx33(StaticMarkdown, { text: item.content ?? "" })
|
|
5938
5949
|
] });
|
|
5939
5950
|
}
|
|
5940
5951
|
return /* @__PURE__ */ jsxs28("div", { class: `${p29}-module`, children: [
|
|
5941
|
-
/* @__PURE__ */
|
|
5952
|
+
/* @__PURE__ */ jsx33(
|
|
5942
5953
|
BackHeader,
|
|
5943
5954
|
{
|
|
5944
5955
|
title: item?.title || title || strings.moduleBack,
|
|
@@ -5948,12 +5959,12 @@ function ContentView({ id, title, transport, strings, onBack, actions }) {
|
|
|
5948
5959
|
testid: TID.backHeader
|
|
5949
5960
|
}
|
|
5950
5961
|
),
|
|
5951
|
-
/* @__PURE__ */
|
|
5962
|
+
/* @__PURE__ */ jsx33("div", { class: `${p29}-module-scroll`, "data-testid": TID.contentScroll, children: renderBody() })
|
|
5952
5963
|
] });
|
|
5953
5964
|
}
|
|
5954
5965
|
|
|
5955
5966
|
// src/ui/messenger-home.tsx
|
|
5956
|
-
import { jsx as
|
|
5967
|
+
import { jsx as jsx34, jsxs as jsxs29 } from "preact/jsx-runtime";
|
|
5957
5968
|
var p30 = BRAND.cssPrefix;
|
|
5958
5969
|
function MessengerHome({
|
|
5959
5970
|
panelProps,
|
|
@@ -6022,12 +6033,12 @@ function MessengerHome({
|
|
|
6022
6033
|
nav: moduleNav,
|
|
6023
6034
|
panelProps
|
|
6024
6035
|
});
|
|
6025
|
-
const plainActions = /* @__PURE__ */
|
|
6036
|
+
const plainActions = /* @__PURE__ */ jsx34(HeaderActions, { panelProps, variant: "plain" });
|
|
6026
6037
|
let body;
|
|
6027
6038
|
if (top?.kind === "iframe") {
|
|
6028
|
-
body = /* @__PURE__ */
|
|
6039
|
+
body = /* @__PURE__ */ jsx34(IframeView, { url: top.url, title: top.title, strings, onBack: nav.pop, actions: plainActions });
|
|
6029
6040
|
} else if (top?.kind === "content") {
|
|
6030
|
-
body = /* @__PURE__ */
|
|
6041
|
+
body = /* @__PURE__ */ jsx34(
|
|
6031
6042
|
ContentView,
|
|
6032
6043
|
{
|
|
6033
6044
|
id: top.id,
|
|
@@ -6039,7 +6050,7 @@ function MessengerHome({
|
|
|
6039
6050
|
}
|
|
6040
6051
|
);
|
|
6041
6052
|
} else if (activeModule?.layout === "chat") {
|
|
6042
|
-
body = /* @__PURE__ */
|
|
6053
|
+
body = /* @__PURE__ */ jsx34(
|
|
6043
6054
|
PanelContent,
|
|
6044
6055
|
{
|
|
6045
6056
|
...panelProps,
|
|
@@ -6050,7 +6061,7 @@ function MessengerHome({
|
|
|
6050
6061
|
);
|
|
6051
6062
|
} else if (activeModule) {
|
|
6052
6063
|
const Root = LAYOUTS[activeModule.layout].Root;
|
|
6053
|
-
body = Root ? /* @__PURE__ */
|
|
6064
|
+
body = Root ? /* @__PURE__ */ jsx34(Root, { ...screenProps(activeModule) }, activeModule.id) : null;
|
|
6054
6065
|
} else {
|
|
6055
6066
|
body = null;
|
|
6056
6067
|
}
|
|
@@ -6065,8 +6076,8 @@ function MessengerHome({
|
|
|
6065
6076
|
style: { position: "relative" },
|
|
6066
6077
|
"data-testid": TID.messengerHome,
|
|
6067
6078
|
children: [
|
|
6068
|
-
/* @__PURE__ */
|
|
6069
|
-
showTabBar ? /* @__PURE__ */
|
|
6079
|
+
/* @__PURE__ */ jsx34("div", { class: `${p30}-messenger-body`, children: body }),
|
|
6080
|
+
showTabBar ? /* @__PURE__ */ jsx34(
|
|
6070
6081
|
HomeTabBar,
|
|
6071
6082
|
{
|
|
6072
6083
|
modules: enabledModules,
|
|
@@ -6076,8 +6087,8 @@ function MessengerHome({
|
|
|
6076
6087
|
onSelect: nav.switchTab
|
|
6077
6088
|
}
|
|
6078
6089
|
) : null,
|
|
6079
|
-
/* @__PURE__ */
|
|
6080
|
-
options.size.resize?.enabled && !(activeModule?.layout === "chat" && !top) ? /* @__PURE__ */
|
|
6090
|
+
/* @__PURE__ */ jsx34(PoweredByBar, { poweredBy: options.poweredBy }),
|
|
6091
|
+
options.size.resize?.enabled && !(activeModule?.layout === "chat" && !top) ? /* @__PURE__ */ jsx34(
|
|
6081
6092
|
ResizeGrip,
|
|
6082
6093
|
{
|
|
6083
6094
|
panelEl: containerRef.current,
|
|
@@ -6094,7 +6105,7 @@ function MessengerHome({
|
|
|
6094
6105
|
}
|
|
6095
6106
|
|
|
6096
6107
|
// src/ui/modules-empty.tsx
|
|
6097
|
-
import { jsx as
|
|
6108
|
+
import { jsx as jsx35, jsxs as jsxs30 } from "preact/jsx-runtime";
|
|
6098
6109
|
var p31 = BRAND.cssPrefix;
|
|
6099
6110
|
function ModulesEmpty({ strings, onClose }) {
|
|
6100
6111
|
return /* @__PURE__ */ jsxs30(
|
|
@@ -6105,7 +6116,7 @@ function ModulesEmpty({ strings, onClose }) {
|
|
|
6105
6116
|
"aria-label": strings.panelTitle,
|
|
6106
6117
|
"data-testid": TID.modulesEmpty,
|
|
6107
6118
|
children: [
|
|
6108
|
-
onClose ? /* @__PURE__ */
|
|
6119
|
+
onClose ? /* @__PURE__ */ jsx35(
|
|
6109
6120
|
"button",
|
|
6110
6121
|
{
|
|
6111
6122
|
type: "button",
|
|
@@ -6113,10 +6124,10 @@ function ModulesEmpty({ strings, onClose }) {
|
|
|
6113
6124
|
onClick: onClose,
|
|
6114
6125
|
"aria-label": strings.close,
|
|
6115
6126
|
title: strings.close,
|
|
6116
|
-
children: /* @__PURE__ */
|
|
6127
|
+
children: /* @__PURE__ */ jsx35(CloseIcon, {})
|
|
6117
6128
|
}
|
|
6118
6129
|
) : null,
|
|
6119
|
-
/* @__PURE__ */
|
|
6130
|
+
/* @__PURE__ */ jsx35("p", { class: `${p31}-modules-empty-text`, children: strings.modulesEmpty })
|
|
6120
6131
|
]
|
|
6121
6132
|
}
|
|
6122
6133
|
);
|
|
@@ -6188,7 +6199,7 @@ function useLauncherCallout({ callout, persistence }) {
|
|
|
6188
6199
|
}
|
|
6189
6200
|
|
|
6190
6201
|
// src/ui/app.tsx
|
|
6191
|
-
import { jsx as
|
|
6202
|
+
import { jsx as jsx36, jsxs as jsxs31 } from "preact/jsx-runtime";
|
|
6192
6203
|
var log16 = logger.scope("app");
|
|
6193
6204
|
var p32 = BRAND.cssPrefix;
|
|
6194
6205
|
function App({ options, hostElement, bus }) {
|
|
@@ -6777,7 +6788,7 @@ function App({ options, hostElement, bus }) {
|
|
|
6777
6788
|
const handlePopOut = useCallback6(() => {
|
|
6778
6789
|
if (!options.popOutUrl) return;
|
|
6779
6790
|
const url = new URL(options.popOutUrl);
|
|
6780
|
-
if (conversationIdSig.value) url.searchParams.set("
|
|
6791
|
+
if (conversationIdSig.value) url.searchParams.set("conversation", conversationIdSig.value);
|
|
6781
6792
|
if (options.widgetId !== "default") url.searchParams.set("widgetId", options.widgetId);
|
|
6782
6793
|
log16.info("popOut", { url: url.toString() });
|
|
6783
6794
|
window.open(url.toString(), "_blank", "noopener,noreferrer");
|
|
@@ -6827,12 +6838,12 @@ function App({ options, hostElement, bus }) {
|
|
|
6827
6838
|
},
|
|
6828
6839
|
[patchAndSync, bus]
|
|
6829
6840
|
);
|
|
6830
|
-
const
|
|
6831
|
-
async (
|
|
6832
|
-
log16.info("
|
|
6833
|
-
bus.emit("
|
|
6841
|
+
const handleSelectHistoryConversation = useCallback6(
|
|
6842
|
+
async (targetConversationId) => {
|
|
6843
|
+
log16.info("selectConversation", { conversationId: targetConversationId });
|
|
6844
|
+
bus.emit("selectConversation", { conversationId: targetConversationId });
|
|
6834
6845
|
try {
|
|
6835
|
-
const res = await transport.loadConversation(
|
|
6846
|
+
const res = await transport.loadConversation(targetConversationId);
|
|
6836
6847
|
const hydrated = res.messages.map(fromWireMessage);
|
|
6837
6848
|
messagesSig.value = hydrated;
|
|
6838
6849
|
conversationIdSig.value = res.conversationId;
|
|
@@ -6841,7 +6852,7 @@ function App({ options, hostElement, bus }) {
|
|
|
6841
6852
|
setCanSend(res.canContinue);
|
|
6842
6853
|
setSuggestions(res.suggestions ?? []);
|
|
6843
6854
|
setView("chat");
|
|
6844
|
-
await transport.markRead(
|
|
6855
|
+
await transport.markRead(targetConversationId);
|
|
6845
6856
|
refreshUnread();
|
|
6846
6857
|
} catch (err) {
|
|
6847
6858
|
bus.emit("error", err);
|
|
@@ -6886,8 +6897,8 @@ function App({ options, hostElement, bus }) {
|
|
|
6886
6897
|
onPopOut: handlePopOut,
|
|
6887
6898
|
onSoundToggle: handleSoundToggle,
|
|
6888
6899
|
onToggleHistory: handleToggleHistory,
|
|
6889
|
-
|
|
6890
|
-
|
|
6900
|
+
onSelectHistoryConversation: handleSelectHistoryConversation,
|
|
6901
|
+
onNewConversation: handleNewChat,
|
|
6891
6902
|
onLocaleChange: handleLocaleChange,
|
|
6892
6903
|
onThemeChange: handleThemeChange,
|
|
6893
6904
|
onWidgetSizeChange: handleWidgetSizeChange,
|
|
@@ -6907,7 +6918,7 @@ function App({ options, hostElement, bus }) {
|
|
|
6907
6918
|
tool: toolInteraction
|
|
6908
6919
|
};
|
|
6909
6920
|
const onSelectConversation = (conversationId) => {
|
|
6910
|
-
void
|
|
6921
|
+
void handleSelectHistoryConversation(conversationId);
|
|
6911
6922
|
const chatId = chatTabId();
|
|
6912
6923
|
if (chatId) homeNav.switchTab(chatId);
|
|
6913
6924
|
};
|
|
@@ -6916,12 +6927,12 @@ function App({ options, hostElement, bus }) {
|
|
|
6916
6927
|
const renderSurface = (size) => {
|
|
6917
6928
|
const closeable = isActionVisible("close", effectiveOptions.mode, size);
|
|
6918
6929
|
if (enabledModules.length === 0) {
|
|
6919
|
-
return /* @__PURE__ */
|
|
6930
|
+
return /* @__PURE__ */ jsx36(ModulesEmpty, { strings: effectiveOptions.strings, onClose: closeable ? handleClose : void 0 });
|
|
6920
6931
|
}
|
|
6921
6932
|
if (enabledModules.length === 1 && enabledModules[0]?.layout === "chat") {
|
|
6922
|
-
return /* @__PURE__ */
|
|
6933
|
+
return /* @__PURE__ */ jsx36(Panel, { ...panelProps, panelSize: size });
|
|
6923
6934
|
}
|
|
6924
|
-
return /* @__PURE__ */
|
|
6935
|
+
return /* @__PURE__ */ jsx36(
|
|
6925
6936
|
MessengerHome,
|
|
6926
6937
|
{
|
|
6927
6938
|
panelProps: { ...panelProps, panelSize: size, onClose: closeable ? handleClose : void 0 },
|
|
@@ -6935,11 +6946,11 @@ function App({ options, hostElement, bus }) {
|
|
|
6935
6946
|
);
|
|
6936
6947
|
};
|
|
6937
6948
|
if (options.mode === "page") {
|
|
6938
|
-
const
|
|
6939
|
-
void
|
|
6949
|
+
const onSelectConversationFromSidebar = (chat) => {
|
|
6950
|
+
void handleSelectHistoryConversation(chat.conversationId);
|
|
6940
6951
|
};
|
|
6941
|
-
const
|
|
6942
|
-
return /* @__PURE__ */
|
|
6952
|
+
const conversationsEnabled = enabledModules.some((m) => m.layout === "chat");
|
|
6953
|
+
return /* @__PURE__ */ jsx36("div", { class: `${p32}-anchor`, children: /* @__PURE__ */ jsx36(
|
|
6943
6954
|
PageShell,
|
|
6944
6955
|
{
|
|
6945
6956
|
site: parsedSite,
|
|
@@ -6947,9 +6958,9 @@ function App({ options, hostElement, bus }) {
|
|
|
6947
6958
|
transport,
|
|
6948
6959
|
strings: effectiveOptions.strings,
|
|
6949
6960
|
visitorId,
|
|
6950
|
-
showConversations:
|
|
6951
|
-
|
|
6952
|
-
|
|
6961
|
+
showConversations: conversationsEnabled,
|
|
6962
|
+
onSelectConversation: onSelectConversationFromSidebar,
|
|
6963
|
+
onNewConversation: handleNewChat,
|
|
6953
6964
|
sidebarCollapsed,
|
|
6954
6965
|
onToggleSidebarCollapsed: handleToggleSidebarCollapsed,
|
|
6955
6966
|
children: renderSurface("fullscreen")
|
|
@@ -6958,7 +6969,7 @@ function App({ options, hostElement, bus }) {
|
|
|
6958
6969
|
}
|
|
6959
6970
|
if (isInlineLike) {
|
|
6960
6971
|
const inlineSize = options.mode === "standalone" ? "fullscreen" : panelSize;
|
|
6961
|
-
return /* @__PURE__ */
|
|
6972
|
+
return /* @__PURE__ */ jsx36("div", { class: `${p32}-anchor`, children: renderSurface(inlineSize) });
|
|
6962
6973
|
}
|
|
6963
6974
|
const drawerEdgeTab = options.mode === "drawer";
|
|
6964
6975
|
const triggerOwnedByPage = options.mode === "modal";
|
|
@@ -6966,7 +6977,7 @@ function App({ options, hostElement, bus }) {
|
|
|
6966
6977
|
const calloutToRender = launcherVisible && !launcherLeaving && !calloutDismissed && !drawerEdgeTab ? effectiveOptions.launcher.callout : null;
|
|
6967
6978
|
return /* @__PURE__ */ jsxs31("div", { class: `${p32}-anchor`, "data-launcher-size": effectiveOptions.launcher.size, children: [
|
|
6968
6979
|
isOpen ? renderSurface(panelSize) : null,
|
|
6969
|
-
launcherVisible ? /* @__PURE__ */
|
|
6980
|
+
launcherVisible ? /* @__PURE__ */ jsx36(
|
|
6970
6981
|
Launcher,
|
|
6971
6982
|
{
|
|
6972
6983
|
onToggle: handleOpen,
|
|
@@ -6976,7 +6987,7 @@ function App({ options, hostElement, bus }) {
|
|
|
6976
6987
|
edgeTab: drawerEdgeTab
|
|
6977
6988
|
}
|
|
6978
6989
|
) : null,
|
|
6979
|
-
calloutToRender ? /* @__PURE__ */
|
|
6990
|
+
calloutToRender ? /* @__PURE__ */ jsx36(
|
|
6980
6991
|
LauncherCallout,
|
|
6981
6992
|
{
|
|
6982
6993
|
callout: calloutToRender,
|