diff --git a/hlx_statics/blocks/ai-assistant/ai-assistant.js b/hlx_statics/blocks/ai-assistant/ai-assistant.js
index 8253480b..2d940d45 100644
--- a/hlx_statics/blocks/ai-assistant/ai-assistant.js
+++ b/hlx_statics/blocks/ai-assistant/ai-assistant.js
@@ -45,7 +45,7 @@ export default async function decorate(block) {
* @param {string} options.text
*/
link({ href, title, text }) {
- return `${text}`;
+ return `${text}`;
},
},
});
diff --git a/hlx_statics/blocks/ai-assistant/ai-assistant_chat-bubble.js b/hlx_statics/blocks/ai-assistant/ai-assistant_chat-bubble.js
index bb8bf7df..b16486dc 100644
--- a/hlx_statics/blocks/ai-assistant/ai-assistant_chat-bubble.js
+++ b/hlx_statics/blocks/ai-assistant/ai-assistant_chat-bubble.js
@@ -42,7 +42,6 @@ export class ChatBubble {
const bubble = createTag("div", { class: "chat-bubble" });
const contentElement = createTag("div", {
class: "chat-bubble-content",
- "daa-lh": "AI Assistant - Message bubble",
});
if (this.source === "ai") {
@@ -114,7 +113,7 @@ export class ChatBubble {
class: "chat-bubble-copy",
type: "button",
"aria-label": COPY_BUTTON_LABEL,
- "daa-ll": COPY_BUTTON_LABEL,
+ "daa-ll": "DevsiteAI Assistant:Message:Button:Copy",
})
);
button.innerHTML = COPY_ICON_SVG;
@@ -184,7 +183,7 @@ export class ChatBubble {
class: "chat-bubble-feedback",
type: "button",
"aria-label": THUMB_UP_LABEL,
- "daa-ll": THUMB_UP_LABEL,
+ "daa-ll": "DevsiteAI Assistant:Message:Button:Upvote",
})
);
thumbUpButton.innerHTML = THUMB_UP_ICON_SVG;
@@ -197,7 +196,7 @@ export class ChatBubble {
class: "chat-bubble-feedback",
type: "button",
"aria-label": THUMB_DOWN_LABEL,
- "daa-ll": THUMB_DOWN_LABEL,
+ "daa-ll": "DevsiteAI Assistant:Message:Button:Downvote",
})
);
thumbDownButton.innerHTML = THUMB_DOWN_ICON_SVG;
@@ -332,7 +331,6 @@ export class ChatBubble {
const wrapper = createTag("div", {
class: "chat-bubble-sources",
- "daa-lh": "AI Assistant - Message sources",
});
const heading = createTag("p", { class: "chat-bubble-sources-heading" });
heading.textContent = "Sources:";
@@ -347,7 +345,10 @@ export class ChatBubble {
rel: "noopener noreferrer",
});
a.textContent = title || url;
- a.setAttribute("daa-ll", a.textContent);
+ a.setAttribute(
+ "daa-ll",
+ `DevsiteAI Assistant:Message:Sources:Link:${a.textContent}|${url}`,
+ );
li.appendChild(a);
list.appendChild(li);
});
diff --git a/hlx_statics/blocks/ai-assistant/ai-assistant_chat-ui.js b/hlx_statics/blocks/ai-assistant/ai-assistant_chat-ui.js
index bfff6451..9ca2b7e8 100644
--- a/hlx_statics/blocks/ai-assistant/ai-assistant_chat-ui.js
+++ b/hlx_statics/blocks/ai-assistant/ai-assistant_chat-ui.js
@@ -31,7 +31,6 @@ export const createAiAvatar = () => {
export const createChatWindowHeader = () => {
const chatWindowHeader = createTag("header", {
class: "chat-window-header",
- "daa-lh": "AI Assistant - Window header",
});
chatWindowHeader.appendChild(createAiAvatar());
const label = createTag("h2", {
@@ -47,7 +46,7 @@ export const createChatWindowHeader = () => {
class: "chat-window-clear",
type: "button",
"aria-label": CHAT_BUTTON_LABEL_CLEAR,
- "daa-ll": "Open clear dialog",
+ "daa-ll": "DevsiteAI Assistant:Clear dialog:Open",
});
const clearButtonIcon = createTag("img", {
src: "/hlx_statics/icons/delete.svg",
@@ -60,7 +59,7 @@ export const createChatWindowHeader = () => {
class: "chat-window-close",
type: "button",
"aria-label": CHAT_BUTTON_LABEL_CLOSE,
- "daa-ll": CHAT_BUTTON_LABEL_CLOSE,
+ "daa-ll": "DevsiteAI Assistant:Close",
});
const closeButtonIcon = createTag("img", {
src: "/hlx_statics/icons/dismiss.svg",
@@ -85,7 +84,6 @@ export const createChatWindowHeader = () => {
export const createInputSection = () => {
const inputSection = createTag("div", {
class: "chat-window-input-section",
- "daa-lh": "AI Assistant - Input section",
});
const textarea = /** @type {HTMLTextAreaElement} */ (
createTag("textarea", {
@@ -95,14 +93,14 @@ export const createInputSection = () => {
})
);
const disclaimerText = createTag("div", { class: "chat-disclaimer-text" });
- disclaimerText.innerHTML = `By using AI Assistant, you agree to the Generative AI User Guidelines.`;
+ disclaimerText.innerHTML = `By using AI Assistant, you agree to the Generative AI User Guidelines.`;
const sendButton = /** @type {HTMLButtonElement} */ (
createTag("button", {
class: "chat-send-button",
type: "button",
"aria-label": "Send message",
- "daa-ll": "Send message",
+ "daa-ll": "DevsiteAI Assistant:Send message",
})
);
const sendButtonIcon = createTag("img", {
@@ -157,7 +155,7 @@ export const createChatButton = () => {
"aria-expanded": "false",
"aria-haspopup": "dialog",
"aria-label": CHAT_BUTTON_LABEL_OPEN,
- "daa-ll": CHAT_BUTTON_LABEL_OPEN,
+ "daa-ll": "DevsiteAI Assistant:Open",
});
chatButton.innerHTML = ``;
ELEMENTS.CHAT_BUTTON = chatButton;
@@ -169,7 +167,6 @@ export const createClearDialog = () => {
const card = createTag("section", {
class: "chat-window-dialog-card",
- "daa-lh": "AI Assistant - Clear dialog",
});
const heading = createTag("h2", { class: "chat-window-dialog-heading" });
@@ -186,7 +183,7 @@ export const createClearDialog = () => {
const cancelButton = createTag("button", {
class: "chat-window-dialog-cancel",
type: "button",
- "daa-ll": "Cancel",
+ "daa-ll": "DevsiteAI Assistant:Clear dialog:Cancel",
});
cancelButton.textContent = "Cancel";
cancelButton.addEventListener("click", () => dialog.remove());
@@ -194,7 +191,7 @@ export const createClearDialog = () => {
const clearButton = createTag("button", {
class: "chat-window-dialog-clear",
type: "button",
- "daa-ll": "Clear",
+ "daa-ll": "DevsiteAI Assistant:Clear dialog:Clear",
});
clearButton.textContent = "Clear";
clearButton.addEventListener("click", () => {
diff --git a/hlx_statics/blocks/ai-assistant/ai-assistant_suggested-questions.js b/hlx_statics/blocks/ai-assistant/ai-assistant_suggested-questions.js
index 58778be5..b9603e94 100644
--- a/hlx_statics/blocks/ai-assistant/ai-assistant_suggested-questions.js
+++ b/hlx_statics/blocks/ai-assistant/ai-assistant_suggested-questions.js
@@ -57,7 +57,7 @@ export const updateSuggestedQuestions = (questions) => {
const button = createTag("button", {
type: "button",
class: "chat-suggested-questions-button",
- "daa-ll": label,
+ "daa-ll": `DevsiteAI Assistant:Suggested questions:${label}`,
});
const icon = createTag("img", {
src: "/hlx_statics/icons/arrow-curved.svg",
@@ -100,7 +100,6 @@ export const createSuggestedQuestionsSection = () => {
title.textContent = "or choose from the following:";
const list = createTag("div", {
class: "chat-suggested-questions-list",
- "daa-lh": "AI Assistant - Suggested questions",
});
wrapper.appendChild(title);