diff --git a/libs/blocks/library-config/library-config.js b/libs/blocks/library-config/library-config.js index 67a821f2da..885e7b089b 100644 --- a/libs/blocks/library-config/library-config.js +++ b/libs/blocks/library-config/library-config.js @@ -163,6 +163,7 @@ function createList(libraries) { list.classList.add('inset'); skLibrary.classList.add('allow-back'); loadList(type, libraries[type], list); + window.hlx?.rum.sampleRUM('click', { source: e.target }); }); }); diff --git a/libs/blocks/library-config/lists/blocks.js b/libs/blocks/library-config/lists/blocks.js index a7697c5ee6..ffd35d8395 100644 --- a/libs/blocks/library-config/lists/blocks.js +++ b/libs/blocks/library-config/lists/blocks.js @@ -283,12 +283,14 @@ export default async function loadBlocks(blocks, list, query) { const name = document.createElement('p'); name.textContent = getContainerName(container); const copy = document.createElement('button'); + copy.id = `${getContainerName(container)}-block-copy`; copy.addEventListener('click', (e) => { const containerHtml = getHtml(container, block.path); e.target.classList.add('copied'); setTimeout(() => { e.target.classList.remove('copied'); }, 3000); const blob = new Blob([`${BLOCK_SPACING}${containerHtml}${BLOCK_SPACING}`], { type: 'text/html' }); createCopy(blob); + window.hlx?.rum.sampleRUM('click', { source: e.target }); }); item.append(name, copy); diff --git a/libs/blocks/library-config/lists/icons.js b/libs/blocks/library-config/lists/icons.js index a0dac23dd9..e26533d87a 100644 --- a/libs/blocks/library-config/lists/icons.js +++ b/libs/blocks/library-config/lists/icons.js @@ -11,12 +11,14 @@ export default async function iconList(content, list) { const title = createTag('li', { class: 'icon-item' }, icon); title.append(titleText); const copy = createTag('button', { class: 'copy' }); + copy.id = `${key}-icon-copy`; copy.addEventListener('click', (e) => { e.target.classList.add('copied'); setTimeout(() => { e.target.classList.remove('copied'); }, 3000); const formatted = `:${key}:`; const blob = new Blob([formatted], { type: 'text/plain' }); createCopy(blob); + window.hlx?.rum.sampleRUM('click', { source: e.target }); }); title.append(copy); list.append(title); diff --git a/libs/blocks/library-config/lists/personalization.js b/libs/blocks/library-config/lists/personalization.js index 54c39d8832..1d6c12f824 100644 --- a/libs/blocks/library-config/lists/personalization.js +++ b/libs/blocks/library-config/lists/personalization.js @@ -20,11 +20,13 @@ const categorize = (tagData) => tagData const getCopyBtn = (tagName) => { const copy = createTag('button', { class: 'copy' }); + copy.id = `${tagName}-tag-copy`; copy.addEventListener('click', (e) => { e.target.classList.add('copied'); setTimeout(() => { e.target.classList.remove('copied'); }, 3000); const blob = new Blob([tagName], { type: 'text/plain' }); createCopy(blob); + window.hlx?.rum.sampleRUM('click', { source: e.target }); }); return copy; }; diff --git a/libs/blocks/library-config/lists/placeholders.js b/libs/blocks/library-config/lists/placeholders.js index 1dd50ce734..509d3e0044 100644 --- a/libs/blocks/library-config/lists/placeholders.js +++ b/libs/blocks/library-config/lists/placeholders.js @@ -14,12 +14,14 @@ export default async function placeholderList(content, list) { const titleText = createTag('p', { class: 'item-title' }, placeholder.value); const title = createTag('li', { class: 'placeholder' }, titleText); const copy = createTag('button', { class: 'copy' }); + copy.id = `${placeholder.value}-placeholder-copy`; copy.addEventListener('click', (e) => { e.target.classList.add('copied'); setTimeout(() => { e.target.classList.remove('copied'); }, 3000); const formatted = `{{${placeholder.key}}}`; const blob = new Blob([formatted], { type: 'text/plain' }); createCopy(blob); + window.hlx?.rum.sampleRUM('click', { source: e.target }); }); title.append(copy); list.append(title); diff --git a/tools/sidekick/config.json b/tools/sidekick/config.json index d50f756bfa..ff402aa561 100644 --- a/tools/sidekick/config.json +++ b/tools/sidekick/config.json @@ -14,7 +14,7 @@ "environments": [ "edit" ], "isPalette": true, "paletteRect": "top: auto; bottom: 25px; left: 25px; height: 388px; width: 360px;", - "url": "/tools/library", + "url": "/tools/library?skipConsent=true", "includePaths": [ "**.docx**" ] }, {