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

Main #86

Merged
merged 83 commits into from
Dec 6, 2024
Merged

Main #86

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
be90c7d
[Release] Stage to Main (#2359)
milo-pr-merge[bot] Jun 3, 2024
d9af238
[Release] Stage to Main (#2409)
milo-pr-merge[bot] Jun 4, 2024
b07f1a5
[Release] Stage to Main (#2414)
milo-pr-merge[bot] Jun 5, 2024
e5bff30
[Release] Stage to Main (#2423)
milo-pr-merge[bot] Jun 6, 2024
81d0085
[Release] Stage to Main (#2432)
milo-pr-merge[bot] Jun 10, 2024
e8300af
[Release] Stage to Main (#2447)
milo-pr-merge[bot] Jun 11, 2024
2350bd0
[Release] Stage to Main (#2462)
milo-pr-merge[bot] Jun 12, 2024
931fa67
[Release] Stage to Main (#2470)
milo-pr-merge[bot] Jun 13, 2024
ead382f
[Release] Stage to Main (#2472)
milo-pr-merge[bot] Jun 17, 2024
ddbdf7a
[Release] Stage to Main (#2479)
milo-pr-merge[bot] Jun 18, 2024
02bf1a6
[Release] Stage to Main (#2482)
milo-pr-merge[bot] Jun 19, 2024
f6fc4bf
[Release] Stage to Main (#2489)
milo-pr-merge[bot] Jun 20, 2024
47aaef0
[Release] Stage to Main (#2495)
milo-pr-merge[bot] Jun 24, 2024
03578fb
[Release] Stage to Main (#2503)
milo-pr-merge[bot] Jun 25, 2024
32f61f0
[Release] Stage to Main (#2515)
milo-pr-merge[bot] Jun 26, 2024
2217784
[Release] Stage to Main (#2520)
milo-pr-merge[bot] Jun 27, 2024
862fdab
[Release] Stage to Main (#2528)
milo-pr-merge[bot] Jul 8, 2024
88577c7
[Release] Stage to Main (#2540)
milo-pr-merge[bot] Jul 10, 2024
830f7e1
[Release] Stage to Main (#2556)
milo-pr-merge[bot] Jul 15, 2024
bc210e6
[Release] Stage to Main (#2568)
milo-pr-merge[bot] Jul 16, 2024
04e211c
[Release] Stage to Main (#2571)
milo-pr-merge[bot] Jul 17, 2024
4e99424
[Release] Stage to Main (#2580)
milo-pr-merge[bot] Jul 18, 2024
61f8c81
[Release] Stage to Main (#2592)
milo-pr-merge[bot] Jul 22, 2024
3365940
[Release] Stage to Main (#2602)
milo-pr-merge[bot] Jul 23, 2024
e89908c
[Release] Stage to Main (#2609)
milo-pr-merge[bot] Jul 24, 2024
f551e5b
[Release] Stage to Main (#2617)
milo-pr-merge[bot] Jul 25, 2024
5028ef5
[Release] Stage to Main (#2629)
milo-pr-merge[bot] Jul 29, 2024
0073337
[Release] Stage to Main (#2641)
milo-pr-merge[bot] Jul 30, 2024
c3371ce
[Release] Stage to Main (#2648)
milo-pr-merge[bot] Jul 31, 2024
8f6bc8f
[Release] Stage to Main (#2666)
milo-pr-merge[bot] Aug 5, 2024
498b7c8
[Release] Stage to Main (#2688)
milo-pr-merge[bot] Aug 6, 2024
5401829
[Release] Stage to Main (#2697)
milo-pr-merge[bot] Aug 7, 2024
833abd4
[Release] Stage to Main (#2701)
milo-pr-merge[bot] Aug 8, 2024
3abbe4d
[Release] Stage to Main (#2716)
milo-pr-merge[bot] Aug 12, 2024
0b80fa1
[Release] Stage to Main (#2722)
milo-pr-merge[bot] Aug 13, 2024
baef0d5
[Release] Stage to Main (#2734)
milo-pr-merge[bot] Aug 14, 2024
53f37de
[Release] Stage to Main (#2742)
milo-pr-merge[bot] Aug 19, 2024
7dbef3a
[Release] Stage to Main (#2756)
milo-pr-merge[bot] Aug 20, 2024
c06c15d
[Release] Stage to Main (#2766)
milo-pr-merge[bot] Aug 21, 2024
eeddca4
[Release] Stage to Main (#2775)
milo-pr-merge[bot] Sep 2, 2024
91afbee
[Release] Stage to Main (#2811)
milo-pr-merge[bot] Sep 3, 2024
95fb526
[Release] Stage to Main (#2821)
milo-pr-merge[bot] Sep 5, 2024
c8d526f
[Release] Stage to Main (#2842)
milo-pr-merge[bot] Sep 9, 2024
28a75e5
[Release] Stage to Main (#2852)
milo-pr-merge[bot] Sep 10, 2024
c7a5d14
[Release] Stage to Main (#2859)
milo-pr-merge[bot] Sep 11, 2024
a35fcb3
[Release] Stage to Main (#2868)
milo-pr-merge[bot] Sep 12, 2024
b60741a
[Release] Stage to Main (#2874)
milo-pr-merge[bot] Sep 16, 2024
d4cb64b
[Release] Stage to Main (#2879)
milo-pr-merge[bot] Sep 17, 2024
cc08e6e
[Release] Stage to Main (#2893)
milo-pr-merge[bot] Sep 18, 2024
fb228f1
Revert "MWPW-156749: Fix video CLS " (#2899) (#2900)
mokimo Sep 18, 2024
132d69f
[Release] Stage to Main (#2898)
Blainegunn Sep 18, 2024
7c2d611
[Release] Stage to Main (#2910)
milo-pr-merge[bot] Sep 24, 2024
3d3a739
[Release] Stage to Main (#2943)
milo-pr-merge[bot] Sep 25, 2024
4e0704d
[Release] Stage to Main (#2951)
milo-pr-merge[bot] Sep 26, 2024
23e81de
[Release] Stage to Main (#2965)
milo-pr-merge[bot] Sep 30, 2024
668448b
[Release] Stage to Main (#2980)
milo-pr-merge[bot] Oct 1, 2024
ee9d4a1
[Release] Stage to Main (#2990)
milo-pr-merge[bot] Oct 3, 2024
490b2b6
[MWPW-159903] Fix quiz video marquees (#3009) (#3013)
mokimo Oct 4, 2024
8cf856d
[MWPW-159328] handle a case where there are not placeholders availabl…
mokimo Oct 4, 2024
0afc1ce
MWPW-146211 [MILO][MEP] Option to select all elements (#2976) (#3023)
overmyheadandbody Oct 8, 2024
482c220
MWPW-158455: Promobar overlays with localnav elements in devices (#2991)
akanshaa-18 Oct 11, 2024
9c82c3a
MWPW-158455: Promobar overlays with localnav elements in devices (#29…
overmyheadandbody Oct 11, 2024
c3175bc
[Release] Stage to Main (#3004)
milo-pr-merge[bot] Oct 21, 2024
f18df4f
[Release] Stage to Main (#3069)
milo-pr-merge[bot] Oct 22, 2024
b6e139d
[Release] Stage to Main (#3072)
milo-pr-merge[bot] Oct 23, 2024
6314173
[Release] Stage to Main (#3085)
milo-pr-merge[bot] Oct 28, 2024
fc2cb0a
[Release] Stage to Main (#3093)
milo-pr-merge[bot] Oct 29, 2024
9d89ed8
[Release] Stage to Main (#3102)
milo-pr-merge[bot] Oct 30, 2024
1a21c48
[Release] Stage to Main (#3118)
milo-pr-merge[bot] Nov 4, 2024
721dd71
[Release] Stage to Main (#3138)
milo-pr-merge[bot] Nov 6, 2024
9b9b998
[Release] Stage to Main (#3146)
milo-pr-merge[bot] Nov 7, 2024
82c26e1
[Release] Stage to Main (#3160)
milo-pr-merge[bot] Nov 12, 2024
42a621d
Revert "MWPW-140452 - Icon authoring in milo using the federal repo a…
overmyheadandbody Nov 12, 2024
b28af5f
Revert "MWPW-140452 - Icon authoring in milo using the federal repo a…
overmyheadandbody Nov 12, 2024
eb83ef4
[Release] Stage to Main (#3181)
milo-pr-merge[bot] Nov 13, 2024
966fae7
Merge branch 'stage' into fix-main
mokimo Nov 13, 2024
cf2b92c
Merge stage into main (#3189)
mokimo Nov 13, 2024
6fe3d53
[Release] Stage to Main (#3187)
milo-pr-merge[bot] Nov 14, 2024
b169130
[Release] Stage to Main (#3200)
overmyheadandbody Nov 15, 2024
5b44555
[Release] Stage to Main (#3283)
milo-pr-merge[bot] Dec 3, 2024
271afa8
[Release] Stage to Main (#3294)
milo-pr-merge[bot] Dec 4, 2024
218ae53
[Release] Stage to Main (#3300)
milo-pr-merge[bot] Dec 5, 2024
8025cb7
Revert "MWPW-161273 Standalone Gnav needs a release cycle [Bundle] (#…
narcis-radu Dec 5, 2024
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: 0 additions & 1 deletion .eslintrc-code-compatibility.js
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [eslint] reported by reviewdog 🐶
File ignored by default. Use a negated ignore pattern (like "--ignore-pattern '!<relative/path/to/filename>'") to override.

Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ module.exports = {
],
ignorePatterns: [
'/libs/deps/*',
'/libs/navigation/dist/*',
'/tools/loc/*',
],
};
1 change: 0 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ module.exports = {
'/libs/features/mas/*',
'/tools/loc/*',
'/libs/features/spectrum-web-components/*',
'/libs/navigation/dist/*',
],
plugins: [
'chai-friendly',
Expand Down
55 changes: 0 additions & 55 deletions .github/workflows/release-standalone-feds.yml

This file was deleted.

1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,3 @@ logs/*
test-html-results/
test-results/
test-a11y-results/
libs/navigation/dist/
14 changes: 0 additions & 14 deletions libs/blocks/global-footer/global-footer.css
Original file line number Diff line number Diff line change
Expand Up @@ -252,20 +252,6 @@
height: 12px;
}

@media (min-width: 600px) {
dialog.feds-dialog {
max-width: 80vw;
width: fit-content;
}
}

@media (min-width: 1200px) {
dialog.feds-dialog {
width: 1200px;
max-width: calc((100% - 6px) - 2em);
}
}

@media (min-width: 900px) {
/* If there is too much content, float it on multiple rows */
.feds-footer-wrapper .feds-menu-content {
Expand Down
40 changes: 6 additions & 34 deletions libs/blocks/global-footer/global-footer.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import {
decorateLinks,
getMetadata,
getConfig,
loadBlock,
localizeLink,
loadStyle,
} from '../../utils/utils.js';

import {
Expand Down Expand Up @@ -217,8 +217,6 @@ class Footer {
</svg>
${regionPickerTextElem}
</a>`;
regionPickerElem.dataset.modalPath = `${url.pathname}#_inline`;
regionPickerElem.dataset.modalHash = url.hash;
const regionPickerWrapperClass = 'feds-regionPicker-wrapper';
this.elements.regionPicker = toFragment`<div class="${regionPickerWrapperClass}">
${regionPickerElem}
Expand All @@ -232,48 +230,24 @@ class Footer {
// Hash -> region selector opens a modal
decorateAutoBlock(regionPickerElem); // add modal-specific attributes
// TODO remove logs after finding the root cause for the region picker 404s -> MWPW-143627
regionPickerElem.href = url.hash;
if (regionPickerElem.classList[0] !== 'modal') {
lanaLog({
message: `Modal block class missing from region picker pre loading the block; locale: ${locale}; regionPickerElem: ${regionPickerElem.outerHTML}`,
tags: 'errorType=warn,module=global-footer',
});
}
loadStyle(`${base}/blocks/modal/modal.css`);
const { default: initModal } = await import('../modal/modal.js');
const modal = await initModal(regionPickerElem);

const loadRegionNav = async () => {
const block = document.querySelector('.region-nav');
if (block && getConfig().standaloneGnav) {
// on standalone the region-nav will fail to load automatically through
// the modal calling fragment.js. In that case we will have data-failed=true
// and we should manually load region nav
// If that's not the case then we're not a standalone gnav
// and we mustn't load region-nav twice.
if (block.getAttribute('data-failed') !== 'true') return;
block.classList.add('hide');
loadStyle(`${base}/blocks/region-nav/region-nav.css`);
const { default: initRegionNav } = await import('../region-nav/region-nav.js');
initRegionNav(block);
// decoratePlaceholders(block, getConfig());
block.classList.remove('hide');
}
};

if (modal) await loadRegionNav(); // just in case the modal is already open

await loadBlock(regionPickerElem); // load modal logic and styles
if (regionPickerElem.classList[0] !== 'modal') {
lanaLog({
message: `Modal block class missing from region picker post loading the block; locale: ${locale}; regionPickerElem: ${regionPickerElem.outerHTML}`,
tags: 'errorType=warn,module=global-footer',
});
}
// 'decorateAutoBlock' logic replaces class name entirely, need to add it back
regionPickerElem.classList.add(regionPickerClass);
regionPickerElem.addEventListener('click', () => {
if (!isRegionPickerExpanded()) {
regionPickerElem.setAttribute('aria-expanded', 'true');
// wait for the modal to load before we load the region nav
window.addEventListener('milo:modal:loaded', loadRegionNav, { once: true });
}
});
// Set aria-expanded to false when region modal is closed
Expand All @@ -288,8 +262,7 @@ class Footer {
regionSelector.href = localizeLink(regionSelector.href);
decorateAutoBlock(regionSelector); // add fragment-specific class(es)
this.elements.regionPicker.append(regionSelector); // add fragment after regionPickerElem
const { default: initFragment } = await import('../fragment/fragment.js');
await initFragment(regionSelector); // load fragment and replace original link
await loadBlock(regionSelector); // load fragment and replace original link
// Update aria-expanded on click
regionPickerElem.addEventListener('click', (e) => {
e.preventDefault();
Expand All @@ -298,15 +271,14 @@ class Footer {
});
// Close region picker dropdown on outside click
document.addEventListener('click', (e) => {
e.preventDefault();
if (isRegionPickerExpanded()
&& !e.target.closest(`.${regionPickerWrapperClass}`)) {
regionPickerElem.setAttribute('aria-expanded', false);
}
});
}

return this.elements.regionPicker;
return this.regionPicker;
};

decorateSocial = () => {
Expand Down
4 changes: 2 additions & 2 deletions libs/blocks/global-navigation/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@
align-items: center;
}

header.global-navigation.ready {
visibility: visible !important;
header.global-navigation {
visibility: visible;
}

/* Desktop styles */
Expand Down
19 changes: 9 additions & 10 deletions libs/blocks/global-navigation/global-navigation.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint import/no-relative-packages: 0 */
/* eslint-disable no-async-promise-executor */
import {
getConfig,
Expand All @@ -21,6 +20,7 @@ import {
isTangentToViewport,
lanaLog,
loadBaseStyles,
loadBlock,
loadDecorateMenu,
rootPath,
loadStyles,
Expand Down Expand Up @@ -222,7 +222,7 @@ const decorateProfileTrigger = async ({ avatar }) => {
let keyboardNav;
const setupKeyboardNav = async () => {
keyboardNav = keyboardNav || new Promise(async (resolve) => {
const { default: KeyboardNavigation } = await import('./utilities/keyboard/index.js');
const KeyboardNavigation = await loadBlock('./keyboard/index.js');
const instance = new KeyboardNavigation();
resolve(instance);
});
Expand Down Expand Up @@ -425,17 +425,17 @@ class Gnav {
this.block.removeEventListener('keydown', this.loadDelayed);
if (this.searchPresent()) {
const [
{ default: Search },
Search,
] = await Promise.all([
import('./features/search/gnav-search.js'),
loadBlock('../features/search/gnav-search.js'),
loadStyles(rootPath('features/search/gnav-search.css')),
]);
this.Search = Search;
}

if (!this.useUniversalNav) {
const [{ default: ProfileDropdown }] = await Promise.all([
import('./features/profile/dropdown.js'),
const [ProfileDropdown] = await Promise.all([
loadBlock('../features/profile/dropdown.js'),
loadStyles(rootPath('features/profile/dropdown.css')),
]);
this.ProfileDropdown = ProfileDropdown;
Expand Down Expand Up @@ -540,7 +540,7 @@ class Gnav {
const unavVersion = new URLSearchParams(window.location.search).get('unavVersion') || '1.3';
await Promise.all([
loadScript(`https://${environment}.adobeccstatic.com/unav/${unavVersion}/UniversalNav.js`),
loadStyles(`https://${environment}.adobeccstatic.com/unav/${unavVersion}/UniversalNav.css`, true),
loadStyles(`https://${environment}.adobeccstatic.com/unav/${unavVersion}/UniversalNav.css`),
]);

const getChildren = () => {
Expand Down Expand Up @@ -910,7 +910,7 @@ class Gnav {

const menuLogic = await loadDecorateMenu();

await menuLogic.decorateMenu({
menuLogic.decorateMenu({
item,
template,
type: itemType,
Expand Down Expand Up @@ -1021,7 +1021,7 @@ class Gnav {
const breadcrumbsElem = this.block.querySelector('.breadcrumbs');
// Breadcrumbs are not initially part of the nav, need to decorate the links
if (breadcrumbsElem) decorateLinks(breadcrumbsElem);
const { default: createBreadcrumbs } = await import('./features/breadcrumbs/breadcrumbs.js');
const createBreadcrumbs = await loadBlock('../features/breadcrumbs/breadcrumbs.js');
this.elements.breadcrumbsWrapper = await createBreadcrumbs(breadcrumbsElem);
return this.elements.breadcrumbsWrapper;
};
Expand Down Expand Up @@ -1091,6 +1091,5 @@ export default async function init(block) {
const mepMartech = mep?.martech || '';
block.setAttribute('daa-lh', `gnav|${getExperienceName()}${mepMartech}`);
if (isDarkMode()) block.classList.add('feds--dark');
block.classList.add('ready');
return gnav;
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint import/no-relative-packages: 0 */
/* eslint-disable camelcase */
import { getConfig } from '../../../utils/utils.js';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint import/no-relative-packages: 0 */
/* eslint-disable no-promise-executor-return, no-async-promise-executor */
import { getConfig } from '../../../utils/utils.js';

Expand Down
20 changes: 11 additions & 9 deletions libs/blocks/global-navigation/utilities/utilities.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint import/no-relative-packages: 0 */
import {
getConfig, getMetadata, loadStyle, loadLana, decorateLinks, localizeLink,
} from '../../../utils/utils.js';
Expand Down Expand Up @@ -135,9 +134,7 @@ export function rootPath(path) {
return url;
}

export function loadStyles(url, override = false) {
const { standaloneGnav } = getConfig();
if (standaloneGnav && !override) return;
export function loadStyles(url) {
loadStyle(url, (e) => {
if (e === 'error') {
lanaLog({
Expand All @@ -158,8 +155,6 @@ export function isDarkMode() {
// since they can be independent of each other.
// CSS imports were not used due to duplication of file include
export async function loadBaseStyles() {
const { standaloneGnav } = getConfig();
if (standaloneGnav) return;
if (isDarkMode()) {
new Promise((resolve) => { loadStyle(rootPath('base.css'), resolve); })
.then(() => loadStyles(rootPath('dark-nav.css')));
Expand All @@ -169,6 +164,10 @@ export async function loadBaseStyles() {
}
}

export function loadBlock(path) {
return import(path).then((module) => module.default);
}

let cachedDecorateMenu;
export async function loadDecorateMenu() {
if (cachedDecorateMenu) return cachedDecorateMenu;
Expand All @@ -178,12 +177,15 @@ export async function loadDecorateMenu() {
resolve = _resolve;
});

const [menu] = await Promise.all([
import('./menu/menu.js'),
const [{ decorateMenu, decorateLinkGroup }] = await Promise.all([
loadBlock('./menu/menu.js'),
loadStyles(rootPath('utilities/menu/menu.css')),
]);

resolve(menu.default);
resolve({
decorateMenu,
decorateLinkGroup,
});
return cachedDecorateMenu;
}

Expand Down
4 changes: 0 additions & 4 deletions libs/blocks/region-nav/region-nav.css
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,6 @@
column-count: 1;
}

.region-nav.hide {
display: none;
}

@media (min-width: 600px) {
.region-nav > div:nth-of-type(2) {
column-count: 3;
Expand Down
1 change: 0 additions & 1 deletion libs/navigation/base.css

This file was deleted.

11 changes: 7 additions & 4 deletions libs/navigation/bootstrapper.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
/* eslint import/no-relative-packages: 0 */
export default async function bootstrapBlock(initBlock, blockConfig) {
export default async function bootstrapBlock(miloLibs, blockConfig) {
const { name, targetEl, layout, noBorder, jarvis } = blockConfig;
const { getConfig, createTag, loadScript } = await import('../utils/utils.js');
const { getConfig, createTag, loadLink, loadScript } = await import(`${miloLibs}/utils/utils.js`);
const { default: initBlock } = await import(`${miloLibs}/blocks/${name}/${name}.js`);

const styles = [`${miloLibs}/blocks/${name}/${name}.css`, `${miloLibs}/navigation/navigation.css`];
styles.forEach((url) => loadLink(url, { rel: 'stylesheet' }));

const setNavLayout = () => {
const element = document.querySelector(targetEl);
Expand Down Expand Up @@ -38,7 +41,7 @@ export default async function bootstrapBlock(initBlock, blockConfig) {

await initBlock(document.querySelector(targetEl));
if (blockConfig.targetEl === 'footer') {
const { loadPrivacy } = await import('../scripts/delayed.js');
const { loadPrivacy } = await import(`${miloLibs}/scripts/delayed.js`);
setTimeout(() => {
loadPrivacy(getConfig, loadScript);
}, blockConfig.delay);
Expand Down
Loading
Loading