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

MWPW-144801 - [Hero-Marquee] 🆕 block #2412

Merged
merged 83 commits into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes from 63 commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
eadaf75
initial marquee-hero block
ryanmparrish Apr 3, 2024
6a596e2
allow key w/ classes structure
ryanmparrish Apr 3, 2024
7922245
button-l default
ryanmparrish Apr 3, 2024
5093a71
rename lockup class to flex-row
ryanmparrish Apr 3, 2024
0b56877
added icon-list item types
ryanmparrish Apr 3, 2024
93fb5d2
Enable meta rows be authored above main content && authored Icon list…
ryanmparrish Apr 5, 2024
d66123a
update block name to just hero and row keys to hero-
ryanmparrish Apr 9, 2024
394897f
added textOverrides
ryanmparrish Apr 10, 2024
5e41165
support for 'reverse, reverse-mobile' and remove empty split asset div
ryanmparrish Apr 11, 2024
b699b7a
fixed padding on split mobile views, linting
ryanmparrish Apr 11, 2024
cd0eb09
multi classes on key rows. Cleaned up some format
ryanmparrish Apr 12, 2024
18564a1
decorateBg, order-reverse, con-block dark/light tablet, desktop selec…
ryanmparrish Apr 17, 2024
f2e2796
default copy margins, extended decorateText for target
ryanmparrish Apr 22, 2024
281d830
updated block name to hero-marquee, per GWP reques, renamed row key t…
ryanmparrish Apr 24, 2024
0a73dc6
decorateBgRow fix for selector
ryanmparrish Apr 24, 2024
28809f9
Fixed icon-size inheritance across rows and block variant
ryanmparrish Apr 24, 2024
4db0f9f
lockup default
ryanmparrish Apr 24, 2024
645d2e4
Extending button class in row-text types
ryanmparrish Apr 24, 2024
dd52689
min-height on tablet/desk
ryanmparrish Apr 25, 2024
7408c4a
trim badge titles and set approp margin
ryanmparrish Apr 25, 2024
8bf7215
Few design feedback items, removed badge
ryanmparrish Apr 26, 2024
496c567
Default spacing on bg-stack
ryanmparrish Apr 26, 2024
76aff1d
Few design feedback refeinments
ryanmparrish Apr 26, 2024
d7ae95f
added tests
ryanmparrish Apr 29, 2024
906d086
fix align items action area
ryanmparrish Apr 29, 2024
14cac41
no default padding on bg-stack
ryanmparrish Apr 29, 2024
d3c5f0c
refine naming conventions
ryanmparrish Apr 30, 2024
0692bb3
Fixed decorate text logic to not rely on buttonClass to continue
ryanmparrish May 1, 2024
b206f51
distill sup content
ryanmparrish May 1, 2024
08f4d25
bgcolor naming
ryanmparrish May 7, 2024
12d505f
bgcolor Type
ryanmparrish May 7, 2024
e7faedc
con-vars support for bg-stack-*
ryanmparrish May 7, 2024
08ddb24
- Split image display cover and 0 padding on stacked mobile/tablet. …
ryanmparrish May 7, 2024
4d9b4e3
milo_blocks list
ryanmparrish May 13, 2024
cadfe95
split variant default padding bottom
ryanmparrish May 13, 2024
15200d7
added block to adobetv list
ryanmparrish May 13, 2024
6e0c9d1
updated test row type -row-bgcolor
ryanmparrish May 13, 2024
0e7bccf
typo in class
ryanmparrish May 13, 2024
90ee78d
moved bg-stack out of styles.css and scoped to hero, shared bg poslti…
ryanmparrish May 14, 2024
7896ab0
logic style for split-asset
ryanmparrish May 14, 2024
750def9
refactor asset selector for autoblock content
ryanmparrish May 15, 2024
7babebe
updated naming convention of fg-media
ryanmparrish May 16, 2024
8c59952
refactored .split to .fg-media-cover && .foreground-split to .foregro…
ryanmparrish May 16, 2024
3bc522a
fg-media-top -> fg-media-stack-top. same as bg-stack
ryanmparrish May 16, 2024
3f70418
fixed fg-media-cover sel to fix poly elem
ryanmparrish May 16, 2024
297b2d6
refactored min-height-l, to l-min-height for naming convention
ryanmparrish May 16, 2024
dbdfa7c
addressed a few rtl lang displays
ryanmparrish May 17, 2024
bb535f2
updated icons to use margin-inline for better rtl support. Added sele…
ryanmparrish May 20, 2024
5dfeeec
moved breakpoint-thheme into own file and imported based on classFind
ryanmparrish May 20, 2024
496e767
decorateBtns by defatult on row-text type
ryanmparrish May 20, 2024
41b5e8c
few missing selectors in bg-stack, removed order .action-area defatul
ryanmparrish May 21, 2024
f467c6f
fixed scope of .fg-media .foreground
ryanmparrish May 21, 2024
9c47c80
added -only to tablet/desktop breakpoint-theme
ryanmparrish May 21, 2024
3572086
fixed scope of fg-stack-top
ryanmparrish May 21, 2024
1982273
distill CLass in -list, fg-media-hidden-mobile w/ foreground-asset
ryanmparrish May 21, 2024
8126007
padding fix for media-hidden
ryanmparrish May 21, 2024
63257ed
lockup transform
ryanmparrish May 21, 2024
67deeac
padding on bg-stack-bottom
ryanmparrish May 21, 2024
c308ff6
default min-height, helper classes tablet/desktop
ryanmparrish May 21, 2024
83ccbb5
-min-height defaults
ryanmparrish May 21, 2024
563cb13
clean up a few stylss
ryanmparrish May 21, 2024
6a92dc2
rtl fix for foreground-media
ryanmparrish May 30, 2024
be90c7d
[Release] Stage to Main (#2359)
milo-pr-merge[bot] Jun 3, 2024
65d5939
code coverage
ryanmparrish Jun 3, 2024
76fdf7d
removed blocks/marquee-hero - fragments of the past
ryanmparrish 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
a3b6d08
Few nit PR formatting feeback issues resolve
ryanmparrish Jun 5, 2024
fb3eb4d
Few PR feedback refactors
ryanmparrish Jun 5, 2024
72c17a3
minor css optimizing
ryanmparrish Jun 5, 2024
9bf23db
Merge branch 'main' into rparrish/marquee-hero
ryanmparrish Jun 5, 2024
f884041
fixed some linting issues and optimized selectors
ryanmparrish Jun 5, 2024
4f7648f
refined the breakpoint-theme a bit w/ :is scopes
ryanmparrish Jun 5, 2024
3613317
revert style.css
ryanmparrish Jun 5, 2024
1c89821
added conditional for distillClasses, removed if w/ switch
ryanmparrish 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
c8f90ae
removed variant names `fg-` and `stack-`
ryanmparrish Jun 10, 2024
09710fa
bg-top, vs bg-stack
ryanmparrish Jun 10, 2024
f58a5ef
linting
ryanmparrish Jun 10, 2024
b83ee09
removed shorthand `mobile-tablet` vp selectors
ryanmparrish Jun 10, 2024
22dd8fe
Merge branch 'main' into rparrish/marquee-hero
ryanmparrish Jun 10, 2024
6f27e7f
check rtl support fix
ryanmparrish Jun 10, 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
2 changes: 1 addition & 1 deletion libs/blocks/adobetv/adobetv.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { applyHoverPlay, getVideoAttrs } from '../../utils/decorate.js';
const ROOT_MARGIN = 1000;

const loadAdobeTv = (a) => {
const bgBlocks = ['aside', 'marquee'];
const bgBlocks = ['aside', 'marquee', 'hero-marquee'];
if (a.href.includes('.mp4') && bgBlocks.some((b) => a.closest(`.${b}`))) {
a.classList.add('hide');
const { href, hash } = a;
Expand Down
30 changes: 4 additions & 26 deletions libs/blocks/brick/brick.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import { decorateTextOverrides, decorateBlockText, decorateBlockBg, decorateIconStack, decorateButtons } from '../../utils/decorate.js';
import {
// eslint-disable-next-line max-len
decorateTextOverrides, decorateBlockText, decorateBlockBg, decorateIconStack, decorateButtons, handleObjectFit,
ryanmparrish marked this conversation as resolved.
Show resolved Hide resolved
} from '../../utils/decorate.js';
import { createTag, getConfig, loadStyle } from '../../utils/utils.js';

const blockTypeSizes = {
large: ['xxl', 'm', 'l'],
default: ['xl', 'm', 'l'],
};
const objFitOptions = ['fill', 'contain', 'cover', 'none', 'scale-down'];

function getBlockSize(el) {
const sizes = Object.keys(blockTypeSizes);
Expand All @@ -21,30 +23,6 @@ function handleSupplementalText(foreground) {
if (lastP) lastP.className = 'supplemental-text';
}

function setObjectFitAndPos(text, pic, bgEl) {
const backgroundConfig = text.split(',').map((c) => c.toLowerCase().trim());
const fitOption = objFitOptions.filter((c) => backgroundConfig.includes(c));
const focusOption = backgroundConfig.filter((c) => !fitOption.includes(c));
if (fitOption) [pic.querySelector('img').style.objectFit] = fitOption;
bgEl.innerHTML = '';
bgEl.append(pic);
bgEl.append(document.createTextNode(focusOption.join(',')));
}

function handleObjectFit(bgRow) {
const bgConfig = bgRow.querySelectorAll('div');
[...bgConfig].forEach((r) => {
const pic = r.querySelector('picture');
if (!pic) return;
let text = '';
const pchild = [...r.querySelectorAll('p:not(:empty)')].filter((p) => p.innerHTML.trim() !== '');
if (pchild.length > 2) text = pchild[1]?.textContent.trim();
if (!text && r.textContent) text = r.textContent;
if (!text) return;
setObjectFitAndPos(text, pic, r);
});
}

function handleClickableBrick(el, foreground) {
if (!el.classList.contains('click')) return;
const links = foreground.querySelectorAll('.brick-text a');
Expand Down
Loading
Loading