generated from adobe/aem-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathstudio.html
114 lines (113 loc) · 5.32 KB
/
studio.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
<!doctype html>
<html>
<head>
<title>Merch at Scale Studio</title>
<meta property="og:title" content="Merch at Scale Studio" />
<meta name="robots" content="noindex, nofollow" />
<meta name="nofollow-links" content="on" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="aem-base-url" />
<script type="importmap">
{
"imports": {
"lit": "https://cdn.jsdelivr.net/gh/lit/[email protected]/all/lit-all.min.js",
"lit/directives/unsafe-html.js": "https://cdn.jsdelivr.net/gh/lit/[email protected]/all/lit-all.min.js",
"lit/directives/style-map.js": "https://cdn.jsdelivr.net/gh/lit/[email protected]/all/lit-all.min.js",
"lit/directives/class-map.js": "https://cdn.jsdelivr.net/gh/lit/[email protected]/all/lit-all.min.js",
"lit/directives/repeat.js": "https://cdn.jsdelivr.net/gh/lit/[email protected]/all/lit-all.min.js",
"prosemirror-state": "/studio/libs/prosemirror.js",
"prosemirror-model": "/studio/libs/prosemirror.js",
"prosemirror-view": "/studio/libs/prosemirror.js",
"prosemirror-keymap": "/studio/libs/prosemirror.js",
"prosemirror-schema-basic": "/studio/libs/prosemirror.js",
"prosemirror-commands": "/studio/libs/prosemirror.js",
"prosemirror-schema-list": "/studio/libs/prosemirror.js",
"prosemirror-history": "/studio/libs/prosemirror.js"
}
}
</script>
<script>
const BUCKETS = {
qa: 'e155390',
stage: 'e59471',
prod: 'e59433',
};
const params = new URLSearchParams(window.location.search);
const envOverride = params.get('aem.env');
const isLocal = window.location.href.includes('localhost');
let bucket;
let baseUrl;
if (isLocal) {
baseUrl = 'http://localhost:8080';
} else {
bucket =
envOverride && BUCKETS[envOverride]
? BUCKETS[envOverride]
: BUCKETS.prod;
baseUrl = `https://author-p22655-${bucket}.adobeaemcloud.com`;
}
document
.querySelector('meta[name="aem-base-url"]')
?.setAttribute('content', baseUrl);
</script>
<script src="studio/src/maslib.js" type="module"></script>
<script src="studio/libs/swc.js" type="module"></script>
<script src="studio/src/studio.js" type="module"></script>
<!-- OST -->
<script src="studio/ost/index.js"></script>
<link rel="stylesheet" href="studio/libs/spectrum.css" />
<link rel="stylesheet" href="./studio/ost/index.css" />
<link rel="stylesheet" href="./studio/style.css" />
<link rel="stylesheet" href="https://use.typekit.net/hah7vzn.css" />
<script>
window.adobeid = {
api_parameters: {
profile_filter:
"isOwnedByOrg('3B962FB55F5F922E0A495C88@AdobeOrg')",
},
client_id: 'mas-studio',
environment: 'prod',
locale: 'en_US',
redirect_uri: location.href.substring(
0,
location.href.length - location.hash.length,
),
response_type: 'id_token',
scope: 'additional_info,additional_info.projectedProductContext,additional_info.roles,AdobeID,openid,read_organizations,read_pc,read_pc.acp,read_pc.dma_aem_ams,read_pc.dma_aem_cloud,read_pc.dma_tartan',
useLocalStorage: true,
authorize() {
const { expire, token } =
window.adobeIMS?.getAccessToken() ?? {};
if (token && (expire?.valueOf() ?? 0) > Date.now())
return token;
window.adobeIMS?.signIn();
},
onError(error) {
console.error('[M@S Studio] IMS error: ', error);
},
onReady() {
if (adobeIMS.isSignedInUser()) {
console.info('[M@S Studio] IMS is ready, signed in');
} else {
console.info('[M@S Studio] IMS is ready, signing in');
adobeIMS.signIn();
}
},
};
</script>
<script src="https://www.adobe.com/libs/deps/imslib.min.js"></script>
</head>
<body class="spectrum spectrum--medium spectrum--light">
<main>
<sp-theme color="light" scale="medium">
<script>
const studio = document.createElement('mas-studio');
studio.setAttribute('base-url', baseUrl);
bucket && studio.setAttribute('aem-bucket', bucket);
params.get('commerce.env') && studio.setAttribute('commerce-env', params.get('commerce.env'));
document.querySelector('sp-theme').appendChild(studio);
</script>
</sp-theme>
</main>
</body>
</html>