Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
05aa8db
feat: read resource paths from adp-site-metadata.json with fallback t…
Feb 27, 2026
725ef5a
fix the orgdropdown issue
BaskarMitrah Mar 3, 2026
b5c7ecf
fixed the org dropdown issue
BaskarMitrah Mar 3, 2026
8f809db
added console
BaskarMitrah Mar 3, 2026
3f2a8e1
added fetch entitlment
BaskarMitrah Mar 3, 2026
b7842d8
added fetch entitlment
BaskarMitrah Mar 3, 2026
fff2bd7
remove the console
BaskarMitrah Mar 3, 2026
e1463a3
disable buttonn
BaskarMitrah Mar 4, 2026
cfc3be4
fix the undefined issue
BaskarMitrah Mar 4, 2026
35ade2e
added css for disabled button
BaskarMitrah Mar 4, 2026
1b60e87
removed the fill in disable button
BaskarMitrah Mar 4, 2026
cc149a2
test change to IS_DEV_DOCS
dianeba3 Mar 6, 2026
36f0058
remove console log for non-documentation pages in buildEmbeds function
dianeba3 Mar 6, 2026
d7c8aa9
fix : codeblock try in playground issue
BaskarMitrah Mar 10, 2026
cbcfe03
fix : test url issue
BaskarMitrah Mar 10, 2026
62c08f7
fix : pr comments
BaskarMitrah Mar 10, 2026
1760f51
feat : added test case - playground
BaskarMitrah Mar 10, 2026
3c68772
added playground url for the stage
BaskarMitrah Mar 3, 2026
de5e6b7
added : local url test for playground
BaskarMitrah Mar 4, 2026
1e6758e
checked islocal path
BaskarMitrah Mar 5, 2026
a65eebb
fix : PR comments
BaskarMitrah Mar 10, 2026
28391cc
fix : typo mistake
BaskarMitrah Mar 10, 2026
913969c
feat: dynamic contributors
Mar 10, 2026
92c70fb
Add in ai assistant
timkim Mar 10, 2026
806008c
feat : added custom analytics
BaskarMitrah Mar 12, 2026
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
547 changes: 547 additions & 0 deletions hlx_statics/blocks/ai-assistant/ai-assistant.css

Large diffs are not rendered by default.

1,067 changes: 1,067 additions & 0 deletions hlx_statics/blocks/ai-assistant/ai-assistant.js

Large diffs are not rendered by default.

36 changes: 3 additions & 33 deletions hlx_statics/blocks/code/code.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import decoratePreformattedCode, { applyLanguageDirectives, extractLanguageDirectives } from '../../components/code.js';
import decoratePreformattedCode, { applyLanguageDirectives } from '../../components/code.js';

export default function decorate(block) {
const code = block.querySelector('code');
Expand All @@ -10,39 +10,9 @@ export default function decorate(block) {
code.parentElement.replaceChild(pre, code);
pre.appendChild(code);
}
// Process each class from code element
[...code.classList].forEach(cls => {
if (cls.includes('-data')) {
const parts = cls.split('-data');
const languagePart = parts.find(item => item.includes('language-'));

// Add data attributes from class parts
parts.forEach(item => {
if (!item.includes('language-') && item.includes('=')) {
const match = item.match(/^-?([^=]+)="?([^"]*)"?$/);
if (match) {
const attrName = `data-${match[1]}`;
const attrValue = match[2];
pre.setAttribute(attrName, attrValue);
code.setAttribute(attrName, attrValue);
}
}
});

// Remove the messy class and add clean language class
code.classList.remove(cls);
pre.classList.remove(cls);
if (languagePart) {
const cleanClass = languagePart.trim();
code.classList.add(cleanClass);
pre.classList.add(cleanClass);
}
} else {
pre.classList.add(cls);
}
});

const languageClass = [...pre.classList].find(cls => cls.startsWith('language-'));
const languageClass = [...pre.classList].find(cls => cls.startsWith('language-'))
|| (code && [...code.classList].find(cls => cls.startsWith('language-')));
let language = languageClass ? languageClass.replace('language-', '') : 'none';

if (language) {
Expand Down
5 changes: 5 additions & 0 deletions hlx_statics/blocks/contributors/contributors.css
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ main div.contributors-wrapper .imageList {
padding-left: 16px;
}

main div.contributors-wrapper .imageList:empty,
main div.contributors-wrapper .lastUpdatedText:empty {
display: none;
}

.contributor-modal .model-comp-contributors {
display: flex;
justify-content: center;
Expand Down
60 changes: 45 additions & 15 deletions hlx_statics/blocks/contributors/contributors.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,33 @@
import { getMetadata, getContributorsJsonPath } from '../../scripts/lib-helix.js';
import insertWrapperContainer from '../../components/wrapperContainer.js';

async function fetchContributorsData() {
try {
const pathPrefix = getMetadata('pathprefix');
const pagePath = window.location.pathname;
if (!pathPrefix || !pagePath || !pagePath.startsWith(pathPrefix)) {
return null;
}

const jsonPath = await getContributorsJsonPath();
if (!jsonPath) return null;

const response = await fetch(jsonPath);
if (!response.ok) {
console.warn('Network response was not ok:', jsonPath);
return null;
}

const json = await response.json();
const page = pagePath.slice(pathPrefix.length);
return json?.data?.find(item => item.page === page) ?? null;

} catch (e) {
console.error('Contributors fetch error:', e);
return null;
}
}

/**
* Decorates the contributors block
* @param {Element} block The contributors block element
Expand Down Expand Up @@ -38,13 +66,12 @@ export default async function decorate(block) {
modal.innerHTML = modalHTML;
document.body.appendChild(modal);

const github_user_profile_pic = [
"https://github.com/hollyschinsky.png",
"https://github.com/vamshich13.png",
"https://github.com/nimithajalal.png"
];
const data = await fetchContributorsData();
const avatars = data?.avatars ?? [];
const lastUpdated = data?.lastUpdated ?? '';

const contribution_date = "2/21/2024";
const blobUrl = getMetadata('githubblobpath');
const commitsUrl = blobUrl?.replace('/blob/', '/commits/');

const firstDiv = block.querySelector('div');
firstDiv.classList.add("contributors-content");
Expand All @@ -57,14 +84,16 @@ export default async function decorate(block) {

const lastUpdate = document.createElement("div");
lastUpdate.classList.add("lastUpdateDetails");
const lastUpdateWrapper = document.createElement("a");
lastUpdateWrapper.href = "https://github.com/AdobeDocs/express-add-ons-docs/commits/main/src/pages/references/index.md";
lastUpdateWrapper.target = "_blank";
lastUpdate.appendChild(lastUpdateWrapper);
const lastUpdatedWrapper = document.createElement("a");
if (commitsUrl) {
lastUpdatedWrapper.href = commitsUrl;
lastUpdatedWrapper.target = "_blank";
}
lastUpdate.appendChild(lastUpdatedWrapper);

const imageList = document.createElement("div");
imageList.classList.add("imageList");
github_user_profile_pic.forEach(src => {
avatars.forEach(src => {
const img = document.createElement('img');
img.src = src;
img.classList.add("image-contributor");
Expand All @@ -73,11 +102,12 @@ export default async function decorate(block) {
span.appendChild(img);
imageList.appendChild(span);
});
lastUpdateWrapper.appendChild(imageList);
lastUpdatedWrapper.appendChild(imageList);

const imageTextWrapper = document.createElement("span");
imageTextWrapper.innerText = `Last updated ${contribution_date}`;
lastUpdateWrapper.appendChild(imageTextWrapper);
const lastUpdatedText = document.createElement("span");
lastUpdatedText.classList.add("lastUpdatedText");
lastUpdatedText.innerText = lastUpdated ? `Last updated ${lastUpdated}` : '';
lastUpdatedWrapper.appendChild(lastUpdatedText);

const feedback = document.createElement("div");
feedback.classList.add("feedback");
Expand Down
8 changes: 5 additions & 3 deletions hlx_statics/blocks/getcredential/getcredential-components.js
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,8 @@ export function createOrganizationModal(organizations, currentOrg, onOrgChange)
organizations.forEach((org, index) => {
const option = createTag('option', { value: org.code || org.id });
option.textContent = org.name || org.code || `Organization ${index + 1}`;
if (currentOrg && (org.code === currentOrg.code || org.id === currentOrg.code)) {
const currentId = currentOrg?.code || currentOrg?.id;
if (currentId && (org.code || org.id) === currentId) {
option.selected = true;
}
dropdown.appendChild(option);
Expand Down Expand Up @@ -979,7 +980,7 @@ export function createCredentialSection(config) {
return credentialSection;
}

export function createOrgNotice(text, className = 'org-notice', organizationsData = null, currentOrg = null, onOrgChange = null) {
export function createOrgNotice(text, className = 'org-notice', organizationsData = null, currentOrg = null, onOrgChange = null, getCurrentOrg = null) {
const orgNotice = createTag('div', { class: className });
const orgText = createTag('span', { class: 'org-text' });
orgText.textContent = text;
Expand All @@ -988,7 +989,8 @@ export function createOrgNotice(text, className = 'org-notice', organizationsDat
changeOrgLink.textContent = 'Change organization';
changeOrgLink.addEventListener('click', (e) => {
e.preventDefault();
document.body.appendChild(createOrganizationModal(organizationsData, currentOrg, onOrgChange));
const orgForModal = (typeof getCurrentOrg === 'function' ? getCurrentOrg() : null) ?? currentOrg;
document.body.appendChild(createOrganizationModal(organizationsData, orgForModal, onOrgChange));
});

orgNotice.appendChild(orgText);
Expand Down
73 changes: 73 additions & 0 deletions hlx_statics/blocks/getcredential/getcredential.css
Original file line number Diff line number Diff line change
Expand Up @@ -2551,6 +2551,79 @@
align-self: flex-start;
}

.request-access-request-btn-wrap {
position: relative;
margin-top: 8px;
display: inline-flex;
align-items: center;
gap: 8px;
align-self: flex-start;
}

.request-access-request-btn.request-access-request-btn--disabled {
background: #f5f5f5;
border-color: #d7d7d7;
color: #8b8b8b;
cursor: not-allowed;
opacity: 1;
}

.request-access-request-btn.request-access-request-btn--disabled .spectrum-Button-label {
color: #8b8b8b;
}

.request-access-pending-info-trigger {
width: 18px;
height: 18px;
border: none;
background: transparent;
color: #4b4b4b;
display: inline-flex;
align-items: center;
justify-content: center;
padding: 0;
cursor: pointer;
}

.request-access-pending-popover {
position: absolute;
top: 24px;
left: calc(100% + 8px);
width: 230px;
background: var(--color-white);
border: 1px solid var(--color-light-gray-border);
border-radius: 4px;
box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
padding: 12px;
z-index: 5;
}

.request-access-pending-popover.hidden {
display: none;
}

.request-access-pending-title {
margin: 0 0 8px;
font-size: 0.875rem;
font-weight: 700;
color: var(--color-dark-bg);
}

.request-access-pending-body {
margin: 0;
font-size: 0.75rem;
line-height: 1.4;
color: var(--color-text);
}

.request-access-pending-link {
display: inline-block;
margin-top: 8px;
font-size: 0.75rem;
color: var(--color-primary);
text-decoration: underline;
}

/* EdgeCase variants (NoProduct, Type1User, NotMember, NotSignUp) from credential JSON */
.request-access-edge-case-card {
border: 2px solid var(--color-primary);
Expand Down
Loading
Loading