Skip to content

Commit

Permalink
MWPW-154549 | Integrating unity Block in CC (#386)
Browse files Browse the repository at this point in the history
  • Loading branch information
aishwaryamathuria authored Aug 8, 2024
1 parent d6a1ebd commit 3feca22
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
3 changes: 3 additions & 0 deletions creativecloud/blocks/unity/unity.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.unity {
display: none;
}
23 changes: 23 additions & 0 deletions creativecloud/blocks/unity/unity.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { loadStyle } from '../../scripts/utils.js';

function getUnityLibs(prodLibs = '/unitylibs') {
const { hostname } = window.location;
if (!hostname.includes('hlx.page')
&& !hostname.includes('hlx.live')
&& !hostname.includes('localhost')) {
return prodLibs;
}
const branch = new URLSearchParams(window.location.search).get('unitylibs') || 'main';
if (branch.indexOf('--') > -1) return `https://${branch}.hlx.live/unitylibs`;
return `https://${branch}--unity--adobecom.hlx.live/unitylibs`;
}

export default async function init(el) {
const unitylibs = getUnityLibs();
const stylePromise = new Promise((resolve) => {
loadStyle(`${unitylibs}/core/styles/styles.css`, resolve);
});
await stylePromise;
const { default: wfinit } = await import(`${unitylibs}/core/workflow/workflow.js`);
await wfinit(el, 'cc', unitylibs);
}
5 changes: 5 additions & 0 deletions creativecloud/scripts/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,11 @@ const CONFIG = {
prodDomains: ['www.adobe.com', 'helpx.adobe.com', 'business.adobe.com'],
stageDomainsMap,
decorateArea,
adobeid: {
api_parameters: { check_token: { guest_allowed: true } },
enableGuestAccounts: true,
enableGuestTokenForceRefresh: true,
},
stage: {
pdfViewerClientId: '9f7f19a46bd542e2b8548411e51eb4d4',
pdfViewerReportSuite: 'adbadobenonacdcqa',
Expand Down

0 comments on commit 3feca22

Please sign in to comment.