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

DC MILO Release 0.2503 #948

Merged
merged 44 commits into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
27cdff3
handle redirectUrl
TsayAdobe Jan 3, 2025
3648169
Remove localMap reference
TsayAdobe Jan 3, 2025
30ab0f2
DCXY-28094 Map Unity locales to supported Acrobat Web locales
peller Jan 7, 2025
9f30a76
Use hlx domain as default
TsayAdobe Jan 7, 2025
82f30f0
Merge pull request #936 from adobecom/MWPW-163684
TsayAdobe Jan 8, 2025
3f40ac4
Merge branch 'stage' into MWPW-164637
TsayAdobe Jan 8, 2025
c092803
Merge branch 'stage' into aw-locales
TsayAdobe Jan 9, 2025
0befaab
Merge pull request #933 from adobecom/aw-locales
TsayAdobe Jan 9, 2025
8078f59
Merge branch 'stage' into MWPW-164637
TsayAdobe Jan 9, 2025
df00938
Merge pull request #932 from adobecom/MWPW-164637
TsayAdobe Jan 9, 2025
7595b6a
Set trial limit and show upsell
TsayAdobe Jan 9, 2025
7de75d0
Merge branch 'stage' into MWPW-163684
TsayAdobe Jan 9, 2025
5f360ff
ESLint fixes
TsayAdobe Jan 9, 2025
0fcf8f4
Add SUSI Light Block
TsayAdobe Jan 10, 2025
8b9b2f1
Update client_id
TsayAdobe Jan 10, 2025
a6bc03d
Merge branch 'MWPW-163684' into MWPW-164959
TsayAdobe Jan 10, 2025
1b25769
Add social CTA
TsayAdobe Jan 10, 2025
1c22b7f
Fix CSP
TsayAdobe Jan 10, 2025
cd2050b
Verb widget mobile version
joaquinrivero Jan 9, 2025
b89ffc4
Update Styles
TsayAdobe Jan 10, 2025
b2ed8e4
Merge pull request #937 from adobecom/MWPW-163649
TsayAdobe Jan 13, 2025
eb59a97
Merge branch 'stage' into MWPW-164959
joaquinrivero Jan 13, 2025
2ee5d63
Flex direction & padding
joaquinrivero Jan 13, 2025
81a5a7b
Merge pull request #941 from adobecom/MWPW-163649-fix
joaquinrivero Jan 13, 2025
b9434b5
Verb widget analytics
joaquinrivero Jan 13, 2025
57c8180
Fix color
TsayAdobe Jan 13, 2025
8045c37
Merge pull request #942 from adobecom/MWPW-163647
joaquinrivero Jan 13, 2025
5a0e6e0
Merge branch 'stage' into MWPW-163684
TsayAdobe Jan 13, 2025
1e9f4dd
Merge pull request #938 from adobecom/MWPW-163684
TsayAdobe Jan 13, 2025
92cf99d
Merge branch 'stage' into MWPW-164959
TsayAdobe Jan 13, 2025
603ce4e
Merge pull request #939 from adobecom/MWPW-164959
TsayAdobe Jan 13, 2025
4f17d07
Merge branch 'stage' into MWPW-163684x
TsayAdobe Jan 13, 2025
26743f8
Merge pull request #940 from adobecom/MWPW-163684x
TsayAdobe Jan 13, 2025
1428b2a
add learn folder
vgoodric Jan 14, 2025
9aa7fe4
Fix for signed in user
TsayAdobe Jan 14, 2025
fa79317
Merge branch 'stage' into MWPW-163684x
TsayAdobe Jan 14, 2025
5f5628d
Merge pull request #944 from adobecom/MWPW-163684x
TsayAdobe Jan 14, 2025
e8fe71e
Skip trial count if signed in
TsayAdobe Jan 14, 2025
9971301
Merge branch 'stage' into MWPW-163684x
TsayAdobe Jan 14, 2025
4bf789b
Merge pull request #945 from adobecom/MWPW-163684x
TsayAdobe Jan 14, 2025
aaeb295
Compress legacy analytics events fix to be dispatched
joaquinrivero Jan 14, 2025
ee02528
Merge pull request #947 from adobecom/MWPW-163647-fix
joaquinrivero Jan 14, 2025
4226971
Merge branch 'stage' into excludelearn
TsayAdobe Jan 14, 2025
3fc1a5c
Merge pull request #943 from adobecom/excludelearn
TsayAdobe Jan 14, 2025
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
5 changes: 5 additions & 0 deletions acrobat/blocks/susi-light/susi-light.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/* preserving modal space for ux */
.dialog-modal:has(.susi-light) {
width: 360px;
min-height: 462px;
}
125 changes: 125 additions & 0 deletions acrobat/blocks/susi-light/susi-light.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
/* eslint-disable chai-friendly/no-unused-expressions */
/* eslint-disable camelcase */
/* eslint-disable compat/compat */
/* eslint-disable no-underscore-dangle */
import { setLibs, getEnv } from '../../scripts/utils.js';

const miloLibs = setLibs('/libs');
const { createTag, loadScript, getConfig } = await import(`${miloLibs}/utils/utils.js`);

const variant = 'standard';
const isStage = ['stage', 'dev'].includes(getEnv());

const onRedirect = (e) => {
// eslint-disable-next-line no-console
console.log('redirecting to:', e.detail);
setTimeout(() => {
window.location.assign(e.detail);
// temporary solution: allows analytics to go thru
}, 100);
};
const onError = (e) => {
window.lana?.log('on error:', e);
};

export function loadWrapper() {
const CDN_URL = `https://auth-light.identity${
isStage ? '-stage' : ''
}.adobe.com/sentry/wrapper.js`;
return loadScript(CDN_URL);
}

function getDestURL(url) {
let destURL;
try {
destURL = new URL(url);
} catch (err) {
window.lana?.log(`invalid redirect uri for susi-light: ${url}`);
destURL = new URL('https://www.adobe.com');
}
if (isStage) {
destURL.hostname = 'www.stage.adobe.com';
}
return destURL.toString();
}

export default async function init(el) {
const rows = el.querySelectorAll(':scope> div > div');
const redirectUrl = rows[0]?.textContent?.trim().toLowerCase();
const { client_id, redirect_uri } = window.adobeid;
const title = rows[2]?.textContent?.trim();
const authParams = {
dt: false,
locale: getConfig().locale.ietf.toLowerCase(),
response_type: 'code',
client_id: 'AdobeExpressWeb',
redirect_uri: redirectUrl || redirect_uri,
scope: 'AdobeID,openid',
};
const destURL = getDestURL(redirectUrl);
const goDest = () => window.location.assign(destURL);
if (window.feds?.utilities?.imslib) {
const { imslib } = window.feds.utilities;
imslib.isReady() && imslib.isSignedInUser() && goDest();
imslib.onReady().then(() => imslib.isSignedInUser() && goDest());
}
el.innerHTML = '';
await loadWrapper();
const config = { consentProfile: 'free' };
if (title) {
config.title = title;
}
const susi = createTag('susi-sentry-light');
susi.authParams = authParams;
susi.authParams.redirect_uri = destURL;
susi.config = config;
if (isStage) susi.stage = 'true';
susi.variant = variant;
function sendEventToAnalytics(type, eventName) {
const sendEvent = () => {
window._satellite.track('event', {
xdm: {},
data: {
eventType: 'web.webinteraction.linkClicks',
web: {
webInteraction: {
name: eventName,
linkClicks: { value: 1 },
type,
},
},
_adobe_corpnew: {
digitalData: {
primaryEvent: {
eventInfo: {
eventName,
client_id,
},
},
},
},
},
});
};
if (window._satellite?.track) {
sendEvent();
} else {
window.addEventListener(
'alloy_sendEvent',
() => {
sendEvent();
},
{ once: true },
);
}
}

const onAnalytics = (e) => {
const { type, event } = e.detail;
sendEventToAnalytics(type, event);
};
susi.addEventListener('redirect', onRedirect);
susi.addEventListener('on-error', onError);
susi.addEventListener('on-analytics', onAnalytics);
el.append(susi);
}
130 changes: 65 additions & 65 deletions acrobat/blocks/unity/unity.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,94 +3,94 @@ import LIMITS from '../verb-widget/limits.js';
export const localeMap = {
'': 'en-us',
br: 'pt-br',
ca: 'en-ca',
ca_fr: 'fr-ca',
mx: 'es-mx',
la: 'es-la',
africa: 'en-za',
za: 'en-za',
be_nl: 'nl-be',
be_fr: 'fr-be',
be_en: 'en-be',
ca: 'en-us',
ca_fr: 'fr-fr',
mx: 'es-es',
la: 'es-es',
africa: 'en-us',
za: 'en-us',
be_nl: 'nl-nl',
be_fr: 'fr-fr',
be_en: 'en-us',
cz: 'cs-cz',
cy_en: 'en-cy',
cy_en: 'en-us',
dk: 'da-dk',
de: 'de-de',
ee: 'et-ee',
ee: 'en-us',
es: 'es-es',
fr: 'fr-fr',
gr_en: 'en-gr',
gr_el: 'el-gr',
ie: 'en-ie',
il_en: 'en-il',
il_he: 'he-il',
gr_en: 'en-us',
gr_el: 'en-us',
ie: 'en-us',
il_en: 'en-us',
il_he: 'en-us',
it: 'it-it',
lv: 'lv-lv',
lt: 'lt-lt',
lu_de: 'de-lu',
lu_en: 'en-lu',
lu_fr: 'fr-lu',
hu: 'hu-hu',
mt: 'en-mt',
mena_en: 'en-ae',
mena_ar: 'ar-ae',
lv: 'en-us',
lt: 'en-us',
lu_de: 'de-de',
lu_en: 'en-us',
lu_fr: 'fr-fr',
hu: 'en-us',
mt: 'en-us',
mena_en: 'en-us',
mena_ar: 'en-us',
nl: 'nl-nl',
no: 'nb-no',
at: 'de-at',
at: 'de-de',
pl: 'pl-pl',
pt: 'pt-pt',
pt: 'pt-br',
ro: 'ro-ro',
ch_de: 'de-ch',
si: 'sl-si',
sk: 'sk-sk',
ch_fr: 'fr-ch',
ch_de: 'de-de',
si: 'en-us',
sk: 'en-us',
ch_fr: 'fr-fr',
fi: 'fi-fi',
se: 'sv-se',
ch_it: 'it-ch',
ch_it: 'it-it',
tr: 'tr-tr',
uk: 'en-gb',
bg: 'bg-bg',
bg: 'en-us',
ru: 'ru-ru',
ua: 'uk-ua',
ua: 'en-us',
au: 'en-au',
hk_en: 'en-hk',
in: 'en-in',
hk_en: 'en-us',
in: 'en-us',
in_hi: 'hi-in',
nz: 'en-nz',
hk_zh: 'zh-tw',
tw: 'zh-tw',
jp: 'ja-jp',
kr: 'ko-kr',
ae_en: 'en-ae',
ae_ar: 'ar-ae',
sa_en: 'en-sa',
sa_ar: 'ar-sa',
th_en: 'en-th',
ae_en: 'en-us',
ae_ar: 'en-us',
sa_en: 'en-us',
sa_ar: 'en-us',
th_en: 'en-us',
th_th: 'th-th',
sg: 'en-sg',
cl: 'es-cl',
co: 'es-co',
ar: 'es-ar',
cr: 'es-cr',
pr: 'es-pr',
ec: 'es-ec',
pe: 'es-pe',
eg_en: 'en-eg',
eg_ar: 'ar-eg',
gt: 'es-gt',
id_en: 'en-id',
sg: 'en-us',
cl: 'es-es',
co: 'es-es',
ar: 'es-es',
cr: 'es-es',
pr: 'es-es',
ec: 'es-es',
pe: 'es-es',
eg_en: 'en-us',
eg_ar: 'en-us',
gt: 'es-es',
id_en: 'en-us',
id_id: 'id-id',
ph_en: 'en-ph',
ph_fil: 'en-ph',
my_en: 'en-my',
my_ms: 'ms-my',
kw_en: 'en-kw',
kw_ar: 'ar-kw',
ng: 'en-ng',
qa_en: 'en-qa',
qa_ar: 'ar-qa',
vn_en: 'en-vn',
vn_vi: 'vi-vn',
ph_en: 'en-us',
ph_fil: 'en-us',
my_en: 'en-us',
my_ms: 'en-us',
kw_en: 'en-us',
kw_ar: 'en-us',
ng: 'en-us',
qa_en: 'en-us',
qa_ar: 'en-us',
vn_en: 'en-us',
vn_vi: 'en-us',
};

function getUnityLibs(prodLibs = '/unitylibs') {
Expand All @@ -99,7 +99,7 @@ function getUnityLibs(prodLibs = '/unitylibs') {
// eslint-disable-next-line compat/compat
const branch = new URLSearchParams(search).get('unitylibs') || 'main';
if (branch === 'main' && hostname === 'www.stage.adobe.com') return prodLibs;
const env = hostname.includes('.hlx.') ? 'hlx' : 'aem';
const env = hostname.includes('.aem.') ? 'aem' : 'hlx';
return `https://${branch}${branch.includes('--') ? '' : '--unity--adobecom'}.${env}.live/unitylibs`;
}

Expand Down
Loading
Loading