Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Release] Stage to Main #2157

Merged
merged 4 commits into from
Apr 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions libs/blocks/library-config/library-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
});
});

Expand Down
2 changes: 2 additions & 0 deletions libs/blocks/library-config/lists/blocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 2 additions & 0 deletions libs/blocks/library-config/lists/icons.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 2 additions & 0 deletions libs/blocks/library-config/lists/personalization.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
Expand Down
2 changes: 2 additions & 0 deletions libs/blocks/library-config/lists/placeholders.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion tools/sidekick/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -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**" ]
},
{
Expand Down
Loading