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 #2965

Merged
merged 6 commits into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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
63 changes: 31 additions & 32 deletions libs/blocks/brick/brick.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@
color: var(--color-white);
}

.brick.border {
border: 1px solid var(--color-gray-200);
}

.brick.click > a {
text-decoration: none;
}

.brick .background {
position: absolute;
bottom: 0;
Expand All @@ -30,7 +38,7 @@
}

.brick .foreground {
position: relative;
position: relative;
display: flex;
flex-grow: 1;
padding: var(--spacing-m);
Expand Down Expand Up @@ -116,17 +124,31 @@
.brick .foreground p.action-area {
display: flex;
flex-wrap: wrap;
gap: 24px;
gap: var(--spacing-s);
margin-top: var(--spacing-s);
}

.brick .icon-stack-area li,
.brick .icon-stack-area li a {
display: flex;
align-items: center;
gap: var(--spacing-xs);
text-align: start;
flex-shrink: 0;
}

.brick .icon-stack-area li picture {
display: flex;
margin: 0;
padding: 0;
flex-shrink: 0;
}

.brick .foreground a:not([class]),
.brick .foreground span.first-link {
font-weight: 700;
}

.brick .foreground .icon-area picture {
display: flex;
}
Expand All @@ -145,10 +167,6 @@
width: auto;
}

.brick.click > a {
text-decoration: none;
}

.brick .icon-stack-area {
display: flex;
flex-flow: row wrap;
Expand All @@ -165,25 +183,6 @@
width: auto;
}

.brick .icon-stack-area li,
.brick .icon-stack-area li a {
display: flex;
align-items: center;
gap: var(--spacing-xs);
text-align: left;
flex-shrink: 0;
}

.brick .foreground a:not([class]),
.brick .foreground span.first-link {
font-weight: 700;
}

[dir="rtl"] .brick .icon-stack-area li,
[dir="rtl"] .brick .icon-stack-area li a {
text-align: right;
}

.brick.click a.foreground .first-link:not([class*="button"]) {
color: var(--link-color);
text-decoration: none;
Expand Down Expand Up @@ -295,6 +294,12 @@
width: 41.66%;
}

.brick.split.row .foreground,
.brick.split.row .foreground .brick-media,
.brick.split.row .foreground picture {
border-radius: inherit;
}

.brick.split.horizontal-center .foreground .brick-text,
.brick.split.center .foreground .brick-text {
margin: 0;
Expand All @@ -320,12 +325,6 @@
grid-column: 8 / span 5;
}

.brick.split.row .foreground,
.brick.split.row .foreground .brick-media,
.brick.split.row .foreground picture {
border-radius: inherit;
}

.brick.stack .foreground .brick-media picture,
.brick.stack .foreground .brick-media img,
.brick.stack .foreground .brick-media video {
Expand All @@ -342,7 +341,7 @@
margin: 0;
position: absolute;
}

.brick .foreground .brick-media video,
.brick.split.row .foreground .brick-media video {
object-fit: fill;
Expand Down
3 changes: 3 additions & 0 deletions libs/blocks/global-navigation/global-navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -639,9 +639,12 @@ class Gnav {
const state = getMetadata('app-prompt')?.toLowerCase();
const entName = getMetadata('app-prompt-entitlement')?.toLowerCase();
const promptPath = getMetadata('app-prompt-path')?.toLowerCase();
const hasMobileUA = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini|Touch/i.test(navigator.userAgent);

if (state === 'off'
|| !window.adobeIMS?.isSignedInUser()
|| !isDesktop.matches
|| hasMobileUA
|| !entName?.length
|| !promptPath?.length) return;

Expand Down
4 changes: 4 additions & 0 deletions libs/blocks/merch-card/merch-card.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ div[class*="-merch-card"] > div,
display: none;
}

merch-card .body-lower > hr {
width: 100%
}

.merch-card-price {
margin-top: 8px;
margin-bottom: 16px;
Expand Down
18 changes: 17 additions & 1 deletion libs/blocks/merch-card/merch-card.js
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,22 @@ const simplifyHrs = (el) => {
hr.parentElement.replaceWith(hr);
}
});
if (el.variant === PRODUCT) {
const calloutContent = el.querySelector('div[slot="callout-content"]');
const bodySlot = el.querySelector('div[slot="body-xs"]');
if (calloutContent && bodySlot) {
const bodyLowerContent = createTag('div', { slot: 'body-lower' });
const elements = [...bodySlot.children];
elements.forEach((element) => {
if (element.tagName !== 'P') {
bodyLowerContent.append(element);
}
});
if (bodyLowerContent.childNodes.length > 0) {
calloutContent.parentElement.appendChild(bodyLowerContent);
}
}
}
};

const getMiniCompareChartFooterRows = (el) => {
Expand Down Expand Up @@ -496,7 +512,7 @@ export default async function init(el) {
}
}
let footerRows;
if ([MINI_COMPARE_CHART, PLANS, SEGMENT].includes(cardType)) {
if ([MINI_COMPARE_CHART, PLANS, SEGMENT, PRODUCT].includes(cardType)) {
intersectionObserver.observe(merchCard);
}
if (cardType === MINI_COMPARE_CHART) {
Expand Down
298 changes: 204 additions & 94 deletions libs/deps/mas/mas.js
Copy link
Contributor

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 because of a matching ignore pattern. Use "--no-ignore" to override.

Large diffs are not rendered by default.

164 changes: 95 additions & 69 deletions libs/deps/mas/merch-card.js
Copy link
Contributor

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 because of a matching ignore pattern. Use "--no-ignore" to override.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion libs/features/jarvis-chat.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ const openChat = (event) => {
};

const startInitialization = async (config, event, onDemand) => {
const asset = 'https://client.messaging.adobe.com/latest/AdobeMessagingClient';
const asset = `https://${config.env.name !== 'prod' ? 'stage-' : ''}client.messaging.adobe.com/latest/AdobeMessagingClient`;
await Promise.all([
loadStyle(`${asset}.css`),
loadScript(`${asset}.js`),
Expand Down
40 changes: 39 additions & 1 deletion libs/features/mas/mocks/offers.json
Original file line number Diff line number Diff line change
Expand Up @@ -1102,5 +1102,43 @@
"language": "MULT",
"merchant": "ADOBE"
}
]
],
"nTbB50pS4lLGv_x1l_UKggd-lxxo2zAJ7WYDa2mW19s-mult": [
{
"offerSelectorIds": [
"nTbB50pS4lLGv_x1l_UKggd-lxxo2zAJ7WYDa2mW19s"
],
"offerId": "44C623423443E5D4D7F53719C25F71D7",
"startDate": "2022-08-08T07:00:00.000Z",
"endDate": "2099-12-20T07:58:00.000Z",
"priceDetails": {
"price": 22.19,
"priceWithoutDiscount": 23.99,
"priceWithoutTax": 22.19,
"priceWithoutDiscountAndTax": 23.99,
"usePrecision": true,
"formatString": "'US$'#,##0.00",
"taxDisplay": "TAX_EXCLUSIVE",
"taxTerm": "TAX"
},
"analytics": "{\"offerId\":\"44C623423443E5D4D7F53719C25F71D7\",\"label\":\"acrobat_pro_dc_plus_sign_funnel_team\",\"price\":\"22.19\",\"amountWithoutTax\":\"22.19\",\"commitmentType\":\"YEAR\",\"billingFrequency\":\"MONTHLY\",\"currencyCode\":\"USD\"}",
"productArrangementCode": "acrobat_pro_dc_plus_sign_funnel_team",
"productArrangement": {
"productFamily": "ACROBAT",
"productCode": "ASIG"
},
"buyingProgram": "RETAIL",
"commitment": "YEAR",
"term": "MONTHLY",
"customerSegment": "TEAM",
"marketSegments": [
"COM"
],
"salesChannel": "DIRECT",
"offerType": "PROMOTION",
"pricePoint": "ACROBAT_PRO_ASIG_FY22_LO_TEAM_BUNDLE_7_5_OFF_WW_COM",
"language": "MULT",
"merchant": "ADOBE"
}
]
}
53 changes: 14 additions & 39 deletions libs/features/mas/web-components/src/variants/mini-compare-chart.js
Copy link
Contributor

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 because of a matching ignore pattern. Use "--no-ignore" to override.

Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,9 @@ export class MiniCompareChart extends VariantLayout {
super(card);
}

#container;

getRowMinHeightPropertyName = (index) =>
`--consonant-merch-card-footer-row-${index}-min-height`;

getContainer() {
this.#container = this.#container ?? this.card.closest('[class*="-merch-cards"]') ?? this.card.parentElement;
return this.#container;
}

getGlobalCSS() {
return CSS;
}
Expand All @@ -35,28 +28,10 @@ export class MiniCompareChart extends VariantLayout {
return html`<footer>${secureLabel}<slot name="footer"></slot></footer>`;
}

updateMiniCompareElementMinHeight (el, name) {
const elMinHeightPropertyName = `--consonant-merch-card-mini-compare-${name}-height`;
const height = Math.max(
0,
parseFloat(window.getComputedStyle(el).height) || 0,
);
const maxMinHeight =
parseFloat(
this.getContainer().style.getPropertyValue(elMinHeightPropertyName),
) || 0;
if (height > maxMinHeight) {
this.getContainer().style.setProperty(
elMinHeightPropertyName,
`${height}px`,
);
}
}

adjustMiniCompareBodySlots () {
if (this.card.getBoundingClientRect().width <= 2) return;

this.updateMiniCompareElementMinHeight(
this.updateCardElementMinHeight(
this.card.shadowRoot.querySelector('.top-section'),
'top-section',
);
Expand All @@ -73,12 +48,12 @@ export class MiniCompareChart extends VariantLayout {
];

slots.forEach((slot) =>
this.updateMiniCompareElementMinHeight(
this.updateCardElementMinHeight(
this.card.shadowRoot.querySelector(`slot[name="${slot}"]`),
slot,
),
);
this.updateMiniCompareElementMinHeight(
this.updateCardElementMinHeight(
this.card.shadowRoot.querySelector('footer'),
'footer',
);
Expand All @@ -88,7 +63,7 @@ export class MiniCompareChart extends VariantLayout {
);
if (badge && badge.textContent !== '') {
this.getContainer().style.setProperty(
'--consonant-merch-card-mini-compare-top-section-mobile-height',
'--consonant-merch-card-mini-compare-chart-top-section-mobile-height',
'32px',
);
}
Expand Down Expand Up @@ -158,15 +133,15 @@ export class MiniCompareChart extends VariantLayout {
display: block;
}
:host([variant='mini-compare-chart']) footer {
min-height: var(--consonant-merch-card-mini-compare-footer-height);
min-height: var(--consonant-merch-card-mini-compare-chart-footer-height);
padding: var(--consonant-merch-spacing-xs);
}

/* mini-compare card */
:host([variant='mini-compare-chart']) .top-section {
padding-top: var(--consonant-merch-spacing-s);
padding-inline-start: var(--consonant-merch-spacing-s);
height: var(--consonant-merch-card-mini-compare-top-section-height);
height: var(--consonant-merch-card-mini-compare-chart-top-section-height);
}

@media screen and ${unsafeCSS(TABLET_DOWN)} {
Expand Down Expand Up @@ -194,35 +169,35 @@ export class MiniCompareChart extends VariantLayout {
}
/* mini-compare card heights for the slots: heading-m, body-m, heading-m-price, price-commitment, offers, promo-text, footer */
:host([variant='mini-compare-chart']) slot[name='heading-m'] {
min-height: var(--consonant-merch-card-mini-compare-heading-m-height);
min-height: var(--consonant-merch-card-mini-compare-chart-heading-m-height);
}
:host([variant='mini-compare-chart']) slot[name='body-m'] {
min-height: var(--consonant-merch-card-mini-compare-body-m-height);
min-height: var(--consonant-merch-card-mini-compare-chart-body-m-height);
}
:host([variant='mini-compare-chart']) slot[name='heading-m-price'] {
min-height: var(
--consonant-merch-card-mini-compare-heading-m-price-height
--consonant-merch-card-mini-compare-chart-heading-m-price-height
);
}
:host([variant='mini-compare-chart']) slot[name='body-xxs'] {
min-height: var(
--consonant-merch-card-mini-compare-body-xxs-height
--consonant-merch-card-mini-compare-chart-body-xxs-height
);
}
:host([variant='mini-compare-chart']) slot[name='price-commitment'] {
min-height: var(
--consonant-merch-card-mini-compare-price-commitment-height
--consonant-merch-card-mini-compare-chart-price-commitment-height
);
}
:host([variant='mini-compare-chart']) slot[name='offers'] {
min-height: var(--consonant-merch-card-mini-compare-offers-height);
min-height: var(--consonant-merch-card-mini-compare-chart-offers-height);
}
:host([variant='mini-compare-chart']) slot[name='promo-text'] {
min-height: var(--consonant-merch-card-mini-compare-promo-text-height);
min-height: var(--consonant-merch-card-mini-compare-chart-promo-text-height);
}
:host([variant='mini-compare-chart']) slot[name='callout-content'] {
min-height: var(
--consonant-merch-card-mini-compare-callout-content-height
--consonant-merch-card-mini-compare-chart-callout-content-height
);
}
`;
Expand Down
Loading
Loading