@smart-cloud/ai-kit-ui 1.5.0 → 1.5.1
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/package.json
CHANGED
|
@@ -563,8 +563,14 @@ const AiChatbotBase: FC<AiChatbotProps & AiKitShellInjectedProps> = (props) => {
|
|
|
563
563
|
}, [question, isChatBusy, composerAudio]);
|
|
564
564
|
|
|
565
565
|
const openButtonLabel = useMemo(() => {
|
|
566
|
-
const
|
|
567
|
-
|
|
566
|
+
const resolvedOpenButtonTitle = openButtonTitle?.trim();
|
|
567
|
+
const resolvedAskMeLabel = labels.askMeLabel?.trim();
|
|
568
|
+
const raw =
|
|
569
|
+
resolvedOpenButtonTitle ||
|
|
570
|
+
resolvedAskMeLabel ||
|
|
571
|
+
DEFAULT_CHATBOT_LABELS.askMeLabel;
|
|
572
|
+
const translated = I18n.get(raw).trim();
|
|
573
|
+
return translated || I18n.get(DEFAULT_CHATBOT_LABELS.askMeLabel);
|
|
568
574
|
}, [openButtonTitle, labels.askMeLabel, language]);
|
|
569
575
|
|
|
570
576
|
const modalTitle = useMemo(() => {
|
|
@@ -1424,6 +1424,8 @@ Follow these additional instructions: ${instructions}`
|
|
|
1424
1424
|
};
|
|
1425
1425
|
}, [close, variation]);
|
|
1426
1426
|
|
|
1427
|
+
const openButtonAccessibleLabel = I18n.get(openButtonTitle || defaultTitle);
|
|
1428
|
+
|
|
1427
1429
|
return (
|
|
1428
1430
|
<>
|
|
1429
1431
|
{showOpenButton && (
|
|
@@ -1444,6 +1446,7 @@ Follow these additional instructions: ${instructions}`
|
|
|
1444
1446
|
variant={"filled"}
|
|
1445
1447
|
disabled={featureOpen}
|
|
1446
1448
|
onClick={() => setFeatureOpen(true)}
|
|
1449
|
+
aria-label={openButtonAccessibleLabel}
|
|
1447
1450
|
data-ai-kit-open-button
|
|
1448
1451
|
>
|
|
1449
1452
|
{showOpenButtonTitle && I18n.get(openButtonTitle || defaultTitle)}
|
|
@@ -271,6 +271,9 @@ const DocSearchBase: FC<Props> = (props) => {
|
|
|
271
271
|
return I18n.get(title || "Search with AI-Kit");
|
|
272
272
|
}, [language]);
|
|
273
273
|
|
|
274
|
+
const openButtonAccessibleLabel = I18n.get(openButtonTitle || defaultTitle);
|
|
275
|
+
const searchButtonAccessibleLabel = I18n.get("Search");
|
|
276
|
+
|
|
274
277
|
const statusText = useMemo(() => {
|
|
275
278
|
const e: AiKitStatusEvent | null = statusEvent;
|
|
276
279
|
if (!e) return null;
|
|
@@ -690,6 +693,7 @@ const DocSearchBase: FC<Props> = (props) => {
|
|
|
690
693
|
variant={"filled"}
|
|
691
694
|
disabled={featureOpen}
|
|
692
695
|
onClick={() => setFeatureOpen(true)}
|
|
696
|
+
aria-label={openButtonAccessibleLabel}
|
|
693
697
|
data-ai-kit-open-button
|
|
694
698
|
>
|
|
695
699
|
{showOpenButtonTitle && I18n.get(openButtonTitle || defaultTitle)}
|
|
@@ -851,6 +855,7 @@ const DocSearchBase: FC<Props> = (props) => {
|
|
|
851
855
|
leftSection={buttonLeftIcon}
|
|
852
856
|
onClick={() => void onSearch()}
|
|
853
857
|
disabled={!canSearch}
|
|
858
|
+
aria-label={searchButtonAccessibleLabel}
|
|
854
859
|
className={
|
|
855
860
|
showSearchButtonTitle
|
|
856
861
|
? "doc-search-button"
|