@ezeep/ezeep-js 1.0.314 → 1.0.316
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/ezeep.cjs.js +1 -1
- package/dist/cjs/ezp-auth_16.cjs.entry.js +65 -10
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/ezp-auth/ezp-auth.js +67 -9
- package/dist/collection/components/ezp-backdrop/ezp-backdrop.js +1 -1
- package/dist/collection/components/ezp-dialog/ezp-dialog.js +1 -1
- package/dist/components/ezp-auth2.js +1 -1
- package/dist/components/ezp-backdrop2.js +1 -1
- package/dist/components/ezp-dialog2.js +1 -1
- package/dist/components/utils.js +1 -1
- package/dist/directives/proxies.ts +7 -1
- package/dist/esm/ezeep.js +1 -1
- package/dist/esm/ezp-auth_16.entry.js +65 -10
- package/dist/esm/loader.js +1 -1
- package/dist/esm-es5/ezeep.js +1 -1
- package/dist/esm-es5/ezp-auth_16.entry.js +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/ezeep/ezeep.esm.js +1 -1
- package/dist/ezeep/p-98a77798.entry.js +1 -0
- package/dist/ezeep/p-DCznw2Ee.system.js +1 -1
- package/dist/ezeep/{p-82546765.system.entry.js → p-f348cbab.system.entry.js} +2 -2
- package/dist/types/components/ezp-auth/ezp-auth.d.ts +16 -3
- package/dist/types/components.d.ts +5 -0
- package/package.json +1 -1
- package/www/build/ezeep.esm.js +1 -1
- package/www/build/{p-222b1c4b.js → p-4f218598.js} +1 -1
- package/www/build/p-98a77798.entry.js +1 -0
- package/www/build/p-DCznw2Ee.system.js +1 -1
- package/www/build/{p-82546765.system.entry.js → p-f348cbab.system.entry.js} +2 -2
- package/www/data/locales/de.json +5 -0
- package/www/data/locales/en.json +5 -0
- package/www/index.html +1 -1
- package/dist/ezeep/p-7b8ac37f.entry.js +0 -1
- package/www/build/p-7b8ac37f.entry.js +0 -1
package/dist/cjs/ezeep.cjs.js
CHANGED
|
@@ -46,7 +46,7 @@ var patchCloneNodeFix = (HTMLElementPrototype) => {
|
|
|
46
46
|
|
|
47
47
|
patchBrowser().then(async (options) => {
|
|
48
48
|
await appGlobals.globalScripts();
|
|
49
|
-
return index.bootstrapLazy([["ezp-auth_16.cjs",[[257,"ezp-printing",{"clientid":[1],"redirecturi":[1],"filename":[1025],"fileurl":[1],"filetype":[1],"custom":[4],"hidelogin":[4],"hidemenu":[4],"hideheader":[4],"authapihosturl":[1],"printapihosturl":[1],"theme":[1],"fileid":[1],"appearance":[1],"trigger":[1],"language":[1],"code":[1],"filedata":[1],"seamless":[4],"printOpen":[32],"authOpen":[32],"onlyGetSasUri":[32],"noDocumentOpen":[32],"systemAppearance":[32],"files":[32],"open":[64],"logOut":[64],"getSasUri":[64],"getAuthUri":[64],"setAuthRefreshToken":[64],"checkAuth":[64]},[[0,"printCancel","listenPrintCancel"],[0,"printDismiss","listenPrintDismiss"],[0,"printSubmit","listenPrintSubmit"],[0,"authCancel","listenAuthCancel"],[0,"userCancel","listenUserCancel"],[0,"authSuccess","listenAuthSuccess"],[0,"uploadFile","listenUploadFile"],[0,"uploadContinue","listenUploadContinue"],[0,"dialogClose","listenDialogClose"],[0,"dialogAction","listenDialogAction"],[0,"logout","listenLogout"]],{"filedata":[{"watchFileData":0}],"filename":[{"watchFilename":0}],"fileurl":[{"watchFileUrl":0}],"language":[{"watchLanguage":0}]}],[1,"ezp-printer-selection",{"clientID":[1,"client-i-d"],"redirectURI":[1,"redirect-u-r-i"],"filename":[1025],"fileurl":[1],"filetype":[1025],"fileid":[1025],"files":[16],"hidemenu":[4],"hideheader":[4],"seamless":[4],"loading":[32],"printProcessing":[32],"pageRangeInvalid":[32],"uploading":[32],"preparingUpload":[32],"printSuccess":[32],"printFailed":[32],"printTimedOut":[32],"notSupported":[32],"noPrinters":[32],"hubDriverError":[32],"userMenuOpen":[32],"printStopped":[32],"firstVisibleFile":[32],"userName":[32],"printers":[32],"selectedPrinter":[32],"printerConfig":[32],"selectedPrinterConfig":[32],"selectedProperties":[32],"loadingPrinterConfig":[32],"paperid":[32],"currentFileIndex":[32],"totalFiles":[32],"failedFiles":[32],"successfulFiles":[32],"partialSuccess":[32]},[[0,"inputValueChanged","listenInputValueChanged"],[0,"selectSelection","listenSelectSelection"],[0,"stepperChanged","listenStepperChanged"],[0,"userMenuClosure","listenUserMenuClosure"],[0,"logoutEmitter","listenLogout"],[0,"statusCancel","listenStatusCancel"],[0,"statusClose","listenStatusClose"],[0,"statusRetry","listenStatusRetry"]]],[1,"ezp-auth",{"clientID":[1025,"client-i-d"],"redirectURI":[1025,"redirect-u-r-i"],"hidelogin":[4],"trigger":[1],"code":[1],"auth":[32],"authURI":[32],"accessToken":[32]},[[0,"dialogAction","listenDialogAction"],[0,"dialogClose","listenDialogClose"],[0,"statusCancel","listenStatusCancel"]]],[1,"ezp-upload",{"selectedFiles":[32],"dragging":[32],"firstVisibleFile":[32]},[[0,"dragenter","handleDragEnter"],[0,"dragover","handleDragOver"],[1,"dragleave","handleDragLeave"],[0,"drop","handleDrop"],[9,"drop","resetDrag"],[9,"dragend","resetDrag"],[4,"printCancel","listenPrintCancel"]]],[1,"ezp-dialog",{"heading":[1],"description":[1],"action":[1],"iconName":[1,"icon-name"],"iconSize":[1,"icon-size"],"iconFramed":[4,"icon-framed"],"instance":[1]},[[8,"keydown","handleKeydown"]]],[1,"ezp-user-menu",{"name":[1],"open":[1028]},null,{"open":[{"watchOpen":0}]}],[1,"ezp-select",{"icon":[1],"label":[1],"optionFlow":[1,"option-flow"],"options":[16],"placeholder":[1],"preSelected":[8,"pre-selected"],"toggleFlow":[1,"toggle-flow"],"disabled":[4],"expanded":[32],"selected":[32]},null,{"expanded":[{"watchExpanded":0}],"preSelected":[{"preSelectedChanged":0}]}],[1,"ezp-input",{"label":[1],"value":[1032],"type":[1],"icon":[1],"suffix":[513],"eventType":[1,"event-type"],"placeholder":[1],"focused":[32]}],[1,"ezp-stepper",{"icon":[1],"label":[1],"max":[2],"min":[2],"canDecrease":[32],"canIncrease":[32],"focused":[32],"value":[32]},null,{"value":[{"watchValue":0}]}],[1,"ezp-status",{"description":[1],"subtext":[1],"processing":[4],"instance":[1],"icon":[1],"cancel":[8],"close":[8],"retry":[8]}],[1,"ezp-file-name",{"name":[1],"level":[1],"weight":[1],"placement":[1],"anchor":[1],"expanded":[32],"tooltipOpen":[32]},[[10,"keydown","handleKeyDown"]],{"tooltipOpen":[{"watchTooltipOpen":0}]}],[1,"ezp-backdrop",{"visible":[1028]},[[0,"animationend","listenAnimationEnd"]]],[1,"ezp-icon-button",{"blank":[4],"disabled":[4],"href":[1],"icon":[1],"level":[1],"type":[1]}],[1,"ezp-text-button",{"blank":[4],"disabled":[4],"href":[1],"level":[1],"label":[1],"type":[1],"small":[4]}],[1,"ezp-icon",{"name":[1],"size":[1],"framed":[4]}],[1,"ezp-label",{"ellipsis":[4],"level":[1],"noWrap":[4,"no-wrap"],"text":[1],"weight":[1],"isTruncated":[64]}]]]], options);
|
|
49
|
+
return index.bootstrapLazy([["ezp-auth_16.cjs",[[257,"ezp-printing",{"clientid":[1],"redirecturi":[1],"filename":[1025],"fileurl":[1],"filetype":[1],"custom":[4],"hidelogin":[4],"hidemenu":[4],"hideheader":[4],"authapihosturl":[1],"printapihosturl":[1],"theme":[1],"fileid":[1],"appearance":[1],"trigger":[1],"language":[1],"code":[1],"filedata":[1],"seamless":[4],"printOpen":[32],"authOpen":[32],"onlyGetSasUri":[32],"noDocumentOpen":[32],"systemAppearance":[32],"files":[32],"open":[64],"logOut":[64],"getSasUri":[64],"getAuthUri":[64],"setAuthRefreshToken":[64],"checkAuth":[64]},[[0,"printCancel","listenPrintCancel"],[0,"printDismiss","listenPrintDismiss"],[0,"printSubmit","listenPrintSubmit"],[0,"authCancel","listenAuthCancel"],[0,"userCancel","listenUserCancel"],[0,"authSuccess","listenAuthSuccess"],[0,"uploadFile","listenUploadFile"],[0,"uploadContinue","listenUploadContinue"],[0,"dialogClose","listenDialogClose"],[0,"dialogAction","listenDialogAction"],[0,"logout","listenLogout"]],{"filedata":[{"watchFileData":0}],"filename":[{"watchFilename":0}],"fileurl":[{"watchFileUrl":0}],"language":[{"watchLanguage":0}]}],[1,"ezp-printer-selection",{"clientID":[1,"client-i-d"],"redirectURI":[1,"redirect-u-r-i"],"filename":[1025],"fileurl":[1],"filetype":[1025],"fileid":[1025],"files":[16],"hidemenu":[4],"hideheader":[4],"seamless":[4],"loading":[32],"printProcessing":[32],"pageRangeInvalid":[32],"uploading":[32],"preparingUpload":[32],"printSuccess":[32],"printFailed":[32],"printTimedOut":[32],"notSupported":[32],"noPrinters":[32],"hubDriverError":[32],"userMenuOpen":[32],"printStopped":[32],"firstVisibleFile":[32],"userName":[32],"printers":[32],"selectedPrinter":[32],"printerConfig":[32],"selectedPrinterConfig":[32],"selectedProperties":[32],"loadingPrinterConfig":[32],"paperid":[32],"currentFileIndex":[32],"totalFiles":[32],"failedFiles":[32],"successfulFiles":[32],"partialSuccess":[32]},[[0,"inputValueChanged","listenInputValueChanged"],[0,"selectSelection","listenSelectSelection"],[0,"stepperChanged","listenStepperChanged"],[0,"userMenuClosure","listenUserMenuClosure"],[0,"logoutEmitter","listenLogout"],[0,"statusCancel","listenStatusCancel"],[0,"statusClose","listenStatusClose"],[0,"statusRetry","listenStatusRetry"]]],[1,"ezp-auth",{"clientID":[1025,"client-i-d"],"redirectURI":[1025,"redirect-u-r-i"],"hidelogin":[4],"trigger":[1],"code":[1],"auth":[32],"authURI":[32],"accessToken":[32],"isPopupBlocked":[32]},[[0,"dialogAction","listenDialogAction"],[0,"dialogClose","listenDialogClose"],[0,"statusCancel","listenStatusCancel"]]],[1,"ezp-upload",{"selectedFiles":[32],"dragging":[32],"firstVisibleFile":[32]},[[0,"dragenter","handleDragEnter"],[0,"dragover","handleDragOver"],[1,"dragleave","handleDragLeave"],[0,"drop","handleDrop"],[9,"drop","resetDrag"],[9,"dragend","resetDrag"],[4,"printCancel","listenPrintCancel"]]],[1,"ezp-dialog",{"heading":[1],"description":[1],"action":[1],"iconName":[1,"icon-name"],"iconSize":[1,"icon-size"],"iconFramed":[4,"icon-framed"],"instance":[1]},[[8,"keydown","handleKeydown"]]],[1,"ezp-user-menu",{"name":[1],"open":[1028]},null,{"open":[{"watchOpen":0}]}],[1,"ezp-select",{"icon":[1],"label":[1],"optionFlow":[1,"option-flow"],"options":[16],"placeholder":[1],"preSelected":[8,"pre-selected"],"toggleFlow":[1,"toggle-flow"],"disabled":[4],"expanded":[32],"selected":[32]},null,{"expanded":[{"watchExpanded":0}],"preSelected":[{"preSelectedChanged":0}]}],[1,"ezp-input",{"label":[1],"value":[1032],"type":[1],"icon":[1],"suffix":[513],"eventType":[1,"event-type"],"placeholder":[1],"focused":[32]}],[1,"ezp-stepper",{"icon":[1],"label":[1],"max":[2],"min":[2],"canDecrease":[32],"canIncrease":[32],"focused":[32],"value":[32]},null,{"value":[{"watchValue":0}]}],[1,"ezp-status",{"description":[1],"subtext":[1],"processing":[4],"instance":[1],"icon":[1],"cancel":[8],"close":[8],"retry":[8]}],[1,"ezp-file-name",{"name":[1],"level":[1],"weight":[1],"placement":[1],"anchor":[1],"expanded":[32],"tooltipOpen":[32]},[[10,"keydown","handleKeyDown"]],{"tooltipOpen":[{"watchTooltipOpen":0}]}],[1,"ezp-backdrop",{"visible":[1028]},[[0,"animationend","listenAnimationEnd"]]],[1,"ezp-icon-button",{"blank":[4],"disabled":[4],"href":[1],"icon":[1],"level":[1],"type":[1]}],[1,"ezp-text-button",{"blank":[4],"disabled":[4],"href":[1],"level":[1],"label":[1],"type":[1],"small":[4]}],[1,"ezp-icon",{"name":[1],"size":[1],"framed":[4]}],[1,"ezp-label",{"ellipsis":[4],"level":[1],"noWrap":[4,"no-wrap"],"text":[1],"weight":[1],"isTruncated":[64]}]]]], options);
|
|
50
50
|
});
|
|
51
51
|
|
|
52
52
|
exports.setNonce = index.setNonce;
|
|
@@ -2519,6 +2519,11 @@ const login_dialog$1 = {
|
|
|
2519
2519
|
description: "Melde dich mit deinem ezeep Blue-Konto an, um zu drucken.",
|
|
2520
2520
|
action: "Anmelden"
|
|
2521
2521
|
};
|
|
2522
|
+
const popup_blocked_dialog$1 = {
|
|
2523
|
+
heading: "Anmeldefenster wurde blockiert",
|
|
2524
|
+
description: "Dein Browser hat das Anmelde-Pop-up blockiert. Erlaube Pop-ups für diese Website und tippe dann auf Erneut versuchen. Auf dem iPhone oder iPad öffne Einstellungen → Safari und deaktiviere Pop-ups blockieren.",
|
|
2525
|
+
action: "Erneut versuchen"
|
|
2526
|
+
};
|
|
2522
2527
|
const no_document_dialog$1 = {
|
|
2523
2528
|
heading: "Keine Datei ausgewählt",
|
|
2524
2529
|
description: "Wähle zunächst eine Datei zum Drucken aus.",
|
|
@@ -2598,6 +2603,7 @@ const user_menu$1 = {
|
|
|
2598
2603
|
};
|
|
2599
2604
|
var translationsDE = {
|
|
2600
2605
|
login_dialog: login_dialog$1,
|
|
2606
|
+
popup_blocked_dialog: popup_blocked_dialog$1,
|
|
2601
2607
|
no_document_dialog: no_document_dialog$1,
|
|
2602
2608
|
printer_selection: printer_selection$1,
|
|
2603
2609
|
button_actions: button_actions$1,
|
|
@@ -2610,6 +2616,11 @@ const login_dialog = {
|
|
|
2610
2616
|
description: "Sign in with your ezeep Blue account to print.",
|
|
2611
2617
|
action: "Sign in"
|
|
2612
2618
|
};
|
|
2619
|
+
const popup_blocked_dialog = {
|
|
2620
|
+
heading: "Sign-in window was blocked",
|
|
2621
|
+
description: "Your browser blocked the sign-in pop-up. Allow pop-ups for this site, then tap Try again. On iPhone or iPad, open Settings → Safari and turn off Block Pop-ups.",
|
|
2622
|
+
action: "Try again"
|
|
2623
|
+
};
|
|
2613
2624
|
const no_document_dialog = {
|
|
2614
2625
|
heading: "No file selected",
|
|
2615
2626
|
description: "Select a file first to print.",
|
|
@@ -2689,6 +2700,7 @@ const user_menu = {
|
|
|
2689
2700
|
};
|
|
2690
2701
|
var translationsEN = {
|
|
2691
2702
|
login_dialog: login_dialog,
|
|
2703
|
+
popup_blocked_dialog: popup_blocked_dialog,
|
|
2692
2704
|
no_document_dialog: no_document_dialog,
|
|
2693
2705
|
printer_selection: printer_selection,
|
|
2694
2706
|
button_actions: button_actions,
|
|
@@ -3149,6 +3161,9 @@ const EzpAuth = class {
|
|
|
3149
3161
|
this.authCancel = index.createEvent(this, "authCancel", 7);
|
|
3150
3162
|
this.authSuccess = index.createEvent(this, "authSuccess", 7);
|
|
3151
3163
|
this.userCancel = index.createEvent(this, "userCancel", 7);
|
|
3164
|
+
this.popupBlocked = index.createEvent(this, "popupBlocked", 7);
|
|
3165
|
+
/** True when the browser blocked the sign-in popup; shows the popup-blocked dialog. */
|
|
3166
|
+
this.isPopupBlocked = false;
|
|
3152
3167
|
this.oauthPopupWindow = null;
|
|
3153
3168
|
this.previousUrl = null;
|
|
3154
3169
|
// Bound once (arrow property) so add/removeEventListener share the same
|
|
@@ -3188,10 +3203,23 @@ const EzpAuth = class {
|
|
|
3188
3203
|
});
|
|
3189
3204
|
};
|
|
3190
3205
|
}
|
|
3191
|
-
listenDialogAction() {
|
|
3206
|
+
listenDialogAction(event) {
|
|
3207
|
+
if (event.detail === 'popup-blocked') {
|
|
3208
|
+
this.handleRetry();
|
|
3209
|
+
return;
|
|
3210
|
+
}
|
|
3192
3211
|
this.openSignInWindow(this.auth.authURI.toString(), 'ezeep Login');
|
|
3193
3212
|
}
|
|
3194
|
-
listenDialogClose() {
|
|
3213
|
+
listenDialogClose(event) {
|
|
3214
|
+
if (event.detail === 'popup-blocked') {
|
|
3215
|
+
// Dismissing the blocked-popup dialog cancels like the screen it replaced:
|
|
3216
|
+
// the sign-in status (hidelogin) or the login dialog.
|
|
3217
|
+
this.isPopupBlocked = false;
|
|
3218
|
+
if (this.showsSignInStatus()) {
|
|
3219
|
+
this.listenStatusCancel();
|
|
3220
|
+
return;
|
|
3221
|
+
}
|
|
3222
|
+
}
|
|
3195
3223
|
this.authCancel.emit();
|
|
3196
3224
|
}
|
|
3197
3225
|
listenStatusCancel() {
|
|
@@ -3229,16 +3257,24 @@ const EzpAuth = class {
|
|
|
3229
3257
|
/* if the pointer to the window object in memory does not exist
|
|
3230
3258
|
or if such pointer exists but the window was closed */
|
|
3231
3259
|
this.oauthPopupWindow = window.open(url, name, windowFeatures);
|
|
3260
|
+
if (this.isWindowBlocked(this.oauthPopupWindow)) {
|
|
3261
|
+
this.handlePopupBlocked();
|
|
3262
|
+
return;
|
|
3263
|
+
}
|
|
3232
3264
|
}
|
|
3233
3265
|
else if (this.previousUrl !== this.auth.authURI.toString()) {
|
|
3234
3266
|
/* if the resource to load is different,
|
|
3235
3267
|
then we load it in the already opened secondary window and then
|
|
3236
3268
|
we bring such window back on top/in front of its parent window. */
|
|
3269
|
+
const previousPopup = this.oauthPopupWindow;
|
|
3237
3270
|
this.oauthPopupWindow = window.open(url, name, windowFeatures);
|
|
3238
|
-
if (
|
|
3239
|
-
|
|
3240
|
-
|
|
3241
|
-
|
|
3271
|
+
if (this.isWindowBlocked(this.oauthPopupWindow)) {
|
|
3272
|
+
// The still-open popup carries the outdated auth URL (and PKCE
|
|
3273
|
+
// challenge), so finishing sign-in there could never succeed. Close it
|
|
3274
|
+
// so the user goes through the retry dialog with a fresh window.
|
|
3275
|
+
previousPopup === null || previousPopup === void 0 ? void 0 : previousPopup.close();
|
|
3276
|
+
this.handlePopupBlocked();
|
|
3277
|
+
return;
|
|
3242
3278
|
}
|
|
3243
3279
|
(_a = this.oauthPopupWindow) === null || _a === void 0 ? void 0 : _a.focus();
|
|
3244
3280
|
}
|
|
@@ -3252,7 +3288,26 @@ const EzpAuth = class {
|
|
|
3252
3288
|
// add the listener for receiving a message from the popup (same bound
|
|
3253
3289
|
// reference used by removeEventListener above, so it never stacks)
|
|
3254
3290
|
window.addEventListener('message', this.receiveMessage, false);
|
|
3255
|
-
|
|
3291
|
+
// Store the string form: it is compared against authURI.toString() above.
|
|
3292
|
+
this.previousUrl = this.auth.authURI.toString();
|
|
3293
|
+
}
|
|
3294
|
+
showsSignInStatus() {
|
|
3295
|
+
return this.hidelogin && (this.trigger === 'button' || this.trigger === 'file');
|
|
3296
|
+
}
|
|
3297
|
+
/** A blocked window.open() returns null, or a window that is closed / has no `closed` flag. */
|
|
3298
|
+
isWindowBlocked(popup) {
|
|
3299
|
+
return !popup || popup.closed || typeof popup.closed === 'undefined';
|
|
3300
|
+
}
|
|
3301
|
+
handlePopupBlocked() {
|
|
3302
|
+
// Drop the dead reference so a retry goes through the fresh-open branch.
|
|
3303
|
+
this.oauthPopupWindow = null;
|
|
3304
|
+
this.isPopupBlocked = true;
|
|
3305
|
+
this.popupBlocked.emit();
|
|
3306
|
+
}
|
|
3307
|
+
/** "Try again" on the popup-blocked dialog: runs from a user gesture, so the popup may now open. */
|
|
3308
|
+
handleRetry() {
|
|
3309
|
+
this.isPopupBlocked = false;
|
|
3310
|
+
this.openSignInWindow(this.auth.authURI.toString(), 'ezeep Login');
|
|
3256
3311
|
}
|
|
3257
3312
|
async componentWillLoad() {
|
|
3258
3313
|
this.auth = new EzpAuthorizationService(this.redirectURI, this.clientID);
|
|
@@ -3283,7 +3338,7 @@ const EzpAuth = class {
|
|
|
3283
3338
|
}
|
|
3284
3339
|
}
|
|
3285
3340
|
render() {
|
|
3286
|
-
return (index.h(index.Host, { key: '
|
|
3341
|
+
return (index.h(index.Host, { key: 'b947c930b88083bbcde53215bcb6159f2d2a79ce' }, this.isPopupBlocked ? (index.h("ezp-dialog", { heading: instance.t('popup_blocked_dialog.heading'), description: instance.t('popup_blocked_dialog.description'), action: instance.t('popup_blocked_dialog.action'), iconName: "exclamation-mark", instance: "popup-blocked", key: "popup-blocked" })) : this.showsSignInStatus() ? (index.h("ezp-status", { description: instance.t('login_dialog.action'), processing: true, cancel: true })) : (index.h("ezp-dialog", { heading: instance.t('login_dialog.heading'), description: instance.t('login_dialog.description'), action: instance.t('login_dialog.action'), iconName: "logo", iconSize: "huge", iconFramed: false, instance: "login", key: "login" }))));
|
|
3287
3342
|
}
|
|
3288
3343
|
};
|
|
3289
3344
|
EzpAuth.style = ezpAuthCss();
|
|
@@ -3307,7 +3362,7 @@ const EzpBackdrop = class {
|
|
|
3307
3362
|
}
|
|
3308
3363
|
}
|
|
3309
3364
|
render() {
|
|
3310
|
-
return index.h(index.Host, { key: '
|
|
3365
|
+
return index.h(index.Host, { key: '7a559a59b645ba3610c90c872a8bc60de2ce5645', class: { hide: !this.visible }, onClick: () => this.handleClick() });
|
|
3311
3366
|
}
|
|
3312
3367
|
get component() { return index.getElement(this); }
|
|
3313
3368
|
};
|
|
@@ -3409,7 +3464,7 @@ const EzpDialog = class {
|
|
|
3409
3464
|
*
|
|
3410
3465
|
*/
|
|
3411
3466
|
render() {
|
|
3412
|
-
return (index.h(index.Host, { key: '
|
|
3467
|
+
return (index.h(index.Host, { key: '31add15a63c15bd40f88056c8db4b1621be8365c' }, index.h("div", { key: '4027e801bd98fea212c079282ace0e414cf23525', id: "box", role: "dialog", "aria-modal": "true", "aria-label": this.heading, tabindex: -1, ref: (el) => (this.box = el) }, index.h("div", { key: '8efa479a250d00b64400ca75c2fe7b1e490a5f78', id: "header" }, index.h("ezp-icon-button", { key: '492ca4802b7ddf20c37a0ce712f77cb0beea07d5', level: "tertiary", icon: "close", type: "button", onClick: this.handleClose })), index.h("div", { key: '65c7484b089a30b71f24014a5705a870522f4b65', id: "body" }, this.iconName && (index.h("ezp-icon", { key: '9d7689c2c5bc50196e7a4a7a25e9c314e0ca7372', name: this.iconName, size: this.iconSize, framed: this.iconFramed })), index.h("div", { key: 'd2d9418cef0d876f9a59200b6c4a0995e18b8624', id: "text" }, index.h("ezp-label", { key: 'cf5ac182ee507a4e558e6d77a8ceae2fcd33912e', text: this.heading, weight: "heavy" }), index.h("ezp-label", { key: 'b925e9c5e830cf2b42b36b1fc60903ddc6aa9613', text: this.description }))), index.h("div", { key: '9d5d1663b68c8187d4e1767eee3587486974e7c5', id: "footer" }, index.h("ezp-text-button", { key: '3093c085f0001afec6a57aadb5f6866b1f4f2d22', type: "button", level: "primary", onClick: this.handleAction, label: this.action })))));
|
|
3413
3468
|
}
|
|
3414
3469
|
};
|
|
3415
3470
|
EzpDialog.style = ezpDialogCss();
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -6,7 +6,7 @@ var appGlobals = require('./app-globals-L_3XPZxT.js');
|
|
|
6
6
|
const defineCustomElements = async (win, options) => {
|
|
7
7
|
if (typeof window === 'undefined') return undefined;
|
|
8
8
|
await appGlobals.globalScripts();
|
|
9
|
-
return index.bootstrapLazy([["ezp-auth_16.cjs",[[257,"ezp-printing",{"clientid":[1],"redirecturi":[1],"filename":[1025],"fileurl":[1],"filetype":[1],"custom":[4],"hidelogin":[4],"hidemenu":[4],"hideheader":[4],"authapihosturl":[1],"printapihosturl":[1],"theme":[1],"fileid":[1],"appearance":[1],"trigger":[1],"language":[1],"code":[1],"filedata":[1],"seamless":[4],"printOpen":[32],"authOpen":[32],"onlyGetSasUri":[32],"noDocumentOpen":[32],"systemAppearance":[32],"files":[32],"open":[64],"logOut":[64],"getSasUri":[64],"getAuthUri":[64],"setAuthRefreshToken":[64],"checkAuth":[64]},[[0,"printCancel","listenPrintCancel"],[0,"printDismiss","listenPrintDismiss"],[0,"printSubmit","listenPrintSubmit"],[0,"authCancel","listenAuthCancel"],[0,"userCancel","listenUserCancel"],[0,"authSuccess","listenAuthSuccess"],[0,"uploadFile","listenUploadFile"],[0,"uploadContinue","listenUploadContinue"],[0,"dialogClose","listenDialogClose"],[0,"dialogAction","listenDialogAction"],[0,"logout","listenLogout"]],{"filedata":[{"watchFileData":0}],"filename":[{"watchFilename":0}],"fileurl":[{"watchFileUrl":0}],"language":[{"watchLanguage":0}]}],[1,"ezp-printer-selection",{"clientID":[1,"client-i-d"],"redirectURI":[1,"redirect-u-r-i"],"filename":[1025],"fileurl":[1],"filetype":[1025],"fileid":[1025],"files":[16],"hidemenu":[4],"hideheader":[4],"seamless":[4],"loading":[32],"printProcessing":[32],"pageRangeInvalid":[32],"uploading":[32],"preparingUpload":[32],"printSuccess":[32],"printFailed":[32],"printTimedOut":[32],"notSupported":[32],"noPrinters":[32],"hubDriverError":[32],"userMenuOpen":[32],"printStopped":[32],"firstVisibleFile":[32],"userName":[32],"printers":[32],"selectedPrinter":[32],"printerConfig":[32],"selectedPrinterConfig":[32],"selectedProperties":[32],"loadingPrinterConfig":[32],"paperid":[32],"currentFileIndex":[32],"totalFiles":[32],"failedFiles":[32],"successfulFiles":[32],"partialSuccess":[32]},[[0,"inputValueChanged","listenInputValueChanged"],[0,"selectSelection","listenSelectSelection"],[0,"stepperChanged","listenStepperChanged"],[0,"userMenuClosure","listenUserMenuClosure"],[0,"logoutEmitter","listenLogout"],[0,"statusCancel","listenStatusCancel"],[0,"statusClose","listenStatusClose"],[0,"statusRetry","listenStatusRetry"]]],[1,"ezp-auth",{"clientID":[1025,"client-i-d"],"redirectURI":[1025,"redirect-u-r-i"],"hidelogin":[4],"trigger":[1],"code":[1],"auth":[32],"authURI":[32],"accessToken":[32]},[[0,"dialogAction","listenDialogAction"],[0,"dialogClose","listenDialogClose"],[0,"statusCancel","listenStatusCancel"]]],[1,"ezp-upload",{"selectedFiles":[32],"dragging":[32],"firstVisibleFile":[32]},[[0,"dragenter","handleDragEnter"],[0,"dragover","handleDragOver"],[1,"dragleave","handleDragLeave"],[0,"drop","handleDrop"],[9,"drop","resetDrag"],[9,"dragend","resetDrag"],[4,"printCancel","listenPrintCancel"]]],[1,"ezp-dialog",{"heading":[1],"description":[1],"action":[1],"iconName":[1,"icon-name"],"iconSize":[1,"icon-size"],"iconFramed":[4,"icon-framed"],"instance":[1]},[[8,"keydown","handleKeydown"]]],[1,"ezp-user-menu",{"name":[1],"open":[1028]},null,{"open":[{"watchOpen":0}]}],[1,"ezp-select",{"icon":[1],"label":[1],"optionFlow":[1,"option-flow"],"options":[16],"placeholder":[1],"preSelected":[8,"pre-selected"],"toggleFlow":[1,"toggle-flow"],"disabled":[4],"expanded":[32],"selected":[32]},null,{"expanded":[{"watchExpanded":0}],"preSelected":[{"preSelectedChanged":0}]}],[1,"ezp-input",{"label":[1],"value":[1032],"type":[1],"icon":[1],"suffix":[513],"eventType":[1,"event-type"],"placeholder":[1],"focused":[32]}],[1,"ezp-stepper",{"icon":[1],"label":[1],"max":[2],"min":[2],"canDecrease":[32],"canIncrease":[32],"focused":[32],"value":[32]},null,{"value":[{"watchValue":0}]}],[1,"ezp-status",{"description":[1],"subtext":[1],"processing":[4],"instance":[1],"icon":[1],"cancel":[8],"close":[8],"retry":[8]}],[1,"ezp-file-name",{"name":[1],"level":[1],"weight":[1],"placement":[1],"anchor":[1],"expanded":[32],"tooltipOpen":[32]},[[10,"keydown","handleKeyDown"]],{"tooltipOpen":[{"watchTooltipOpen":0}]}],[1,"ezp-backdrop",{"visible":[1028]},[[0,"animationend","listenAnimationEnd"]]],[1,"ezp-icon-button",{"blank":[4],"disabled":[4],"href":[1],"icon":[1],"level":[1],"type":[1]}],[1,"ezp-text-button",{"blank":[4],"disabled":[4],"href":[1],"level":[1],"label":[1],"type":[1],"small":[4]}],[1,"ezp-icon",{"name":[1],"size":[1],"framed":[4]}],[1,"ezp-label",{"ellipsis":[4],"level":[1],"noWrap":[4,"no-wrap"],"text":[1],"weight":[1],"isTruncated":[64]}]]]], options);
|
|
9
|
+
return index.bootstrapLazy([["ezp-auth_16.cjs",[[257,"ezp-printing",{"clientid":[1],"redirecturi":[1],"filename":[1025],"fileurl":[1],"filetype":[1],"custom":[4],"hidelogin":[4],"hidemenu":[4],"hideheader":[4],"authapihosturl":[1],"printapihosturl":[1],"theme":[1],"fileid":[1],"appearance":[1],"trigger":[1],"language":[1],"code":[1],"filedata":[1],"seamless":[4],"printOpen":[32],"authOpen":[32],"onlyGetSasUri":[32],"noDocumentOpen":[32],"systemAppearance":[32],"files":[32],"open":[64],"logOut":[64],"getSasUri":[64],"getAuthUri":[64],"setAuthRefreshToken":[64],"checkAuth":[64]},[[0,"printCancel","listenPrintCancel"],[0,"printDismiss","listenPrintDismiss"],[0,"printSubmit","listenPrintSubmit"],[0,"authCancel","listenAuthCancel"],[0,"userCancel","listenUserCancel"],[0,"authSuccess","listenAuthSuccess"],[0,"uploadFile","listenUploadFile"],[0,"uploadContinue","listenUploadContinue"],[0,"dialogClose","listenDialogClose"],[0,"dialogAction","listenDialogAction"],[0,"logout","listenLogout"]],{"filedata":[{"watchFileData":0}],"filename":[{"watchFilename":0}],"fileurl":[{"watchFileUrl":0}],"language":[{"watchLanguage":0}]}],[1,"ezp-printer-selection",{"clientID":[1,"client-i-d"],"redirectURI":[1,"redirect-u-r-i"],"filename":[1025],"fileurl":[1],"filetype":[1025],"fileid":[1025],"files":[16],"hidemenu":[4],"hideheader":[4],"seamless":[4],"loading":[32],"printProcessing":[32],"pageRangeInvalid":[32],"uploading":[32],"preparingUpload":[32],"printSuccess":[32],"printFailed":[32],"printTimedOut":[32],"notSupported":[32],"noPrinters":[32],"hubDriverError":[32],"userMenuOpen":[32],"printStopped":[32],"firstVisibleFile":[32],"userName":[32],"printers":[32],"selectedPrinter":[32],"printerConfig":[32],"selectedPrinterConfig":[32],"selectedProperties":[32],"loadingPrinterConfig":[32],"paperid":[32],"currentFileIndex":[32],"totalFiles":[32],"failedFiles":[32],"successfulFiles":[32],"partialSuccess":[32]},[[0,"inputValueChanged","listenInputValueChanged"],[0,"selectSelection","listenSelectSelection"],[0,"stepperChanged","listenStepperChanged"],[0,"userMenuClosure","listenUserMenuClosure"],[0,"logoutEmitter","listenLogout"],[0,"statusCancel","listenStatusCancel"],[0,"statusClose","listenStatusClose"],[0,"statusRetry","listenStatusRetry"]]],[1,"ezp-auth",{"clientID":[1025,"client-i-d"],"redirectURI":[1025,"redirect-u-r-i"],"hidelogin":[4],"trigger":[1],"code":[1],"auth":[32],"authURI":[32],"accessToken":[32],"isPopupBlocked":[32]},[[0,"dialogAction","listenDialogAction"],[0,"dialogClose","listenDialogClose"],[0,"statusCancel","listenStatusCancel"]]],[1,"ezp-upload",{"selectedFiles":[32],"dragging":[32],"firstVisibleFile":[32]},[[0,"dragenter","handleDragEnter"],[0,"dragover","handleDragOver"],[1,"dragleave","handleDragLeave"],[0,"drop","handleDrop"],[9,"drop","resetDrag"],[9,"dragend","resetDrag"],[4,"printCancel","listenPrintCancel"]]],[1,"ezp-dialog",{"heading":[1],"description":[1],"action":[1],"iconName":[1,"icon-name"],"iconSize":[1,"icon-size"],"iconFramed":[4,"icon-framed"],"instance":[1]},[[8,"keydown","handleKeydown"]]],[1,"ezp-user-menu",{"name":[1],"open":[1028]},null,{"open":[{"watchOpen":0}]}],[1,"ezp-select",{"icon":[1],"label":[1],"optionFlow":[1,"option-flow"],"options":[16],"placeholder":[1],"preSelected":[8,"pre-selected"],"toggleFlow":[1,"toggle-flow"],"disabled":[4],"expanded":[32],"selected":[32]},null,{"expanded":[{"watchExpanded":0}],"preSelected":[{"preSelectedChanged":0}]}],[1,"ezp-input",{"label":[1],"value":[1032],"type":[1],"icon":[1],"suffix":[513],"eventType":[1,"event-type"],"placeholder":[1],"focused":[32]}],[1,"ezp-stepper",{"icon":[1],"label":[1],"max":[2],"min":[2],"canDecrease":[32],"canIncrease":[32],"focused":[32],"value":[32]},null,{"value":[{"watchValue":0}]}],[1,"ezp-status",{"description":[1],"subtext":[1],"processing":[4],"instance":[1],"icon":[1],"cancel":[8],"close":[8],"retry":[8]}],[1,"ezp-file-name",{"name":[1],"level":[1],"weight":[1],"placement":[1],"anchor":[1],"expanded":[32],"tooltipOpen":[32]},[[10,"keydown","handleKeyDown"]],{"tooltipOpen":[{"watchTooltipOpen":0}]}],[1,"ezp-backdrop",{"visible":[1028]},[[0,"animationend","listenAnimationEnd"]]],[1,"ezp-icon-button",{"blank":[4],"disabled":[4],"href":[1],"icon":[1],"level":[1],"type":[1]}],[1,"ezp-text-button",{"blank":[4],"disabled":[4],"href":[1],"level":[1],"label":[1],"type":[1],"small":[4]}],[1,"ezp-icon",{"name":[1],"size":[1],"framed":[4]}],[1,"ezp-label",{"ellipsis":[4],"level":[1],"noWrap":[4,"no-wrap"],"text":[1],"weight":[1],"isTruncated":[64]}]]]], options);
|
|
10
10
|
};
|
|
11
11
|
|
|
12
12
|
exports.setNonce = index.setNonce;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"entries": [
|
|
3
3
|
"components/ezp-auth/ezp-auth.js",
|
|
4
|
-
"components/ezp-backdrop/ezp-backdrop.js",
|
|
5
4
|
"components/ezp-dialog/ezp-dialog.js",
|
|
5
|
+
"components/ezp-backdrop/ezp-backdrop.js",
|
|
6
6
|
"components/ezp-file-name/ezp-file-name.js",
|
|
7
7
|
"components/ezp-icon/ezp-icon.js",
|
|
8
8
|
"components/ezp-icon-button/ezp-icon-button.js",
|
|
@@ -5,6 +5,8 @@ import { subscribeToLanguageChange } from "../../utils/utils";
|
|
|
5
5
|
import i18next from "i18next";
|
|
6
6
|
export class EzpAuth {
|
|
7
7
|
constructor() {
|
|
8
|
+
/** True when the browser blocked the sign-in popup; shows the popup-blocked dialog. */
|
|
9
|
+
this.isPopupBlocked = false;
|
|
8
10
|
this.oauthPopupWindow = null;
|
|
9
11
|
this.previousUrl = null;
|
|
10
12
|
// Bound once (arrow property) so add/removeEventListener share the same
|
|
@@ -44,10 +46,23 @@ export class EzpAuth {
|
|
|
44
46
|
});
|
|
45
47
|
};
|
|
46
48
|
}
|
|
47
|
-
listenDialogAction() {
|
|
49
|
+
listenDialogAction(event) {
|
|
50
|
+
if (event.detail === 'popup-blocked') {
|
|
51
|
+
this.handleRetry();
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
48
54
|
this.openSignInWindow(this.auth.authURI.toString(), 'ezeep Login');
|
|
49
55
|
}
|
|
50
|
-
listenDialogClose() {
|
|
56
|
+
listenDialogClose(event) {
|
|
57
|
+
if (event.detail === 'popup-blocked') {
|
|
58
|
+
// Dismissing the blocked-popup dialog cancels like the screen it replaced:
|
|
59
|
+
// the sign-in status (hidelogin) or the login dialog.
|
|
60
|
+
this.isPopupBlocked = false;
|
|
61
|
+
if (this.showsSignInStatus()) {
|
|
62
|
+
this.listenStatusCancel();
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
51
66
|
this.authCancel.emit();
|
|
52
67
|
}
|
|
53
68
|
listenStatusCancel() {
|
|
@@ -85,16 +100,24 @@ export class EzpAuth {
|
|
|
85
100
|
/* if the pointer to the window object in memory does not exist
|
|
86
101
|
or if such pointer exists but the window was closed */
|
|
87
102
|
this.oauthPopupWindow = window.open(url, name, windowFeatures);
|
|
103
|
+
if (this.isWindowBlocked(this.oauthPopupWindow)) {
|
|
104
|
+
this.handlePopupBlocked();
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
88
107
|
}
|
|
89
108
|
else if (this.previousUrl !== this.auth.authURI.toString()) {
|
|
90
109
|
/* if the resource to load is different,
|
|
91
110
|
then we load it in the already opened secondary window and then
|
|
92
111
|
we bring such window back on top/in front of its parent window. */
|
|
112
|
+
const previousPopup = this.oauthPopupWindow;
|
|
93
113
|
this.oauthPopupWindow = window.open(url, name, windowFeatures);
|
|
94
|
-
if (
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
114
|
+
if (this.isWindowBlocked(this.oauthPopupWindow)) {
|
|
115
|
+
// The still-open popup carries the outdated auth URL (and PKCE
|
|
116
|
+
// challenge), so finishing sign-in there could never succeed. Close it
|
|
117
|
+
// so the user goes through the retry dialog with a fresh window.
|
|
118
|
+
previousPopup === null || previousPopup === void 0 ? void 0 : previousPopup.close();
|
|
119
|
+
this.handlePopupBlocked();
|
|
120
|
+
return;
|
|
98
121
|
}
|
|
99
122
|
(_a = this.oauthPopupWindow) === null || _a === void 0 ? void 0 : _a.focus();
|
|
100
123
|
}
|
|
@@ -108,7 +131,26 @@ export class EzpAuth {
|
|
|
108
131
|
// add the listener for receiving a message from the popup (same bound
|
|
109
132
|
// reference used by removeEventListener above, so it never stacks)
|
|
110
133
|
window.addEventListener('message', this.receiveMessage, false);
|
|
111
|
-
|
|
134
|
+
// Store the string form: it is compared against authURI.toString() above.
|
|
135
|
+
this.previousUrl = this.auth.authURI.toString();
|
|
136
|
+
}
|
|
137
|
+
showsSignInStatus() {
|
|
138
|
+
return this.hidelogin && (this.trigger === 'button' || this.trigger === 'file');
|
|
139
|
+
}
|
|
140
|
+
/** A blocked window.open() returns null, or a window that is closed / has no `closed` flag. */
|
|
141
|
+
isWindowBlocked(popup) {
|
|
142
|
+
return !popup || popup.closed || typeof popup.closed === 'undefined';
|
|
143
|
+
}
|
|
144
|
+
handlePopupBlocked() {
|
|
145
|
+
// Drop the dead reference so a retry goes through the fresh-open branch.
|
|
146
|
+
this.oauthPopupWindow = null;
|
|
147
|
+
this.isPopupBlocked = true;
|
|
148
|
+
this.popupBlocked.emit();
|
|
149
|
+
}
|
|
150
|
+
/** "Try again" on the popup-blocked dialog: runs from a user gesture, so the popup may now open. */
|
|
151
|
+
handleRetry() {
|
|
152
|
+
this.isPopupBlocked = false;
|
|
153
|
+
this.openSignInWindow(this.auth.authURI.toString(), 'ezeep Login');
|
|
112
154
|
}
|
|
113
155
|
async componentWillLoad() {
|
|
114
156
|
this.auth = new EzpAuthorizationService(this.redirectURI, this.clientID);
|
|
@@ -139,7 +181,7 @@ export class EzpAuth {
|
|
|
139
181
|
}
|
|
140
182
|
}
|
|
141
183
|
render() {
|
|
142
|
-
return (h(Host, { key: '
|
|
184
|
+
return (h(Host, { key: 'b947c930b88083bbcde53215bcb6159f2d2a79ce' }, this.isPopupBlocked ? (h("ezp-dialog", { heading: i18next.t('popup_blocked_dialog.heading'), description: i18next.t('popup_blocked_dialog.description'), action: i18next.t('popup_blocked_dialog.action'), iconName: "exclamation-mark", instance: "popup-blocked", key: "popup-blocked" })) : this.showsSignInStatus() ? (h("ezp-status", { description: i18next.t('login_dialog.action'), processing: true, cancel: true })) : (h("ezp-dialog", { heading: i18next.t('login_dialog.heading'), description: i18next.t('login_dialog.description'), action: i18next.t('login_dialog.action'), iconName: "logo", iconSize: "huge", iconFramed: false, instance: "login", key: "login" }))));
|
|
143
185
|
}
|
|
144
186
|
static get is() { return "ezp-auth"; }
|
|
145
187
|
static get encapsulation() { return "shadow"; }
|
|
@@ -256,7 +298,8 @@ export class EzpAuth {
|
|
|
256
298
|
return {
|
|
257
299
|
"auth": {},
|
|
258
300
|
"authURI": {},
|
|
259
|
-
"accessToken": {}
|
|
301
|
+
"accessToken": {},
|
|
302
|
+
"isPopupBlocked": {}
|
|
260
303
|
};
|
|
261
304
|
}
|
|
262
305
|
static get events() {
|
|
@@ -310,6 +353,21 @@ export class EzpAuth {
|
|
|
310
353
|
"resolved": "void",
|
|
311
354
|
"references": {}
|
|
312
355
|
}
|
|
356
|
+
}, {
|
|
357
|
+
"method": "popupBlocked",
|
|
358
|
+
"name": "popupBlocked",
|
|
359
|
+
"bubbles": true,
|
|
360
|
+
"cancelable": true,
|
|
361
|
+
"composed": true,
|
|
362
|
+
"docs": {
|
|
363
|
+
"tags": [],
|
|
364
|
+
"text": "Emitted when the browser blocks the sign-in popup (e.g. iOS Safari with\n\"Block Pop-ups\" on). Host apps can listen to layer additional UI on top."
|
|
365
|
+
},
|
|
366
|
+
"complexType": {
|
|
367
|
+
"original": "void",
|
|
368
|
+
"resolved": "void",
|
|
369
|
+
"references": {}
|
|
370
|
+
}
|
|
313
371
|
}];
|
|
314
372
|
}
|
|
315
373
|
static get listeners() {
|
|
@@ -13,7 +13,7 @@ export class EzpBackdrop {
|
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
render() {
|
|
16
|
-
return h(Host, { key: '
|
|
16
|
+
return h(Host, { key: '7a559a59b645ba3610c90c872a8bc60de2ce5645', class: { hide: !this.visible }, onClick: () => this.handleClick() });
|
|
17
17
|
}
|
|
18
18
|
static get is() { return "ezp-backdrop"; }
|
|
19
19
|
static get encapsulation() { return "shadow"; }
|
|
@@ -92,7 +92,7 @@ export class EzpDialog {
|
|
|
92
92
|
*
|
|
93
93
|
*/
|
|
94
94
|
render() {
|
|
95
|
-
return (h(Host, { key: '
|
|
95
|
+
return (h(Host, { key: '31add15a63c15bd40f88056c8db4b1621be8365c' }, h("div", { key: '4027e801bd98fea212c079282ace0e414cf23525', id: "box", role: "dialog", "aria-modal": "true", "aria-label": this.heading, tabindex: -1, ref: (el) => (this.box = el) }, h("div", { key: '8efa479a250d00b64400ca75c2fe7b1e490a5f78', id: "header" }, h("ezp-icon-button", { key: '492ca4802b7ddf20c37a0ce712f77cb0beea07d5', level: "tertiary", icon: "close", type: "button", onClick: this.handleClose })), h("div", { key: '65c7484b089a30b71f24014a5705a870522f4b65', id: "body" }, this.iconName && (h("ezp-icon", { key: '9d7689c2c5bc50196e7a4a7a25e9c314e0ca7372', name: this.iconName, size: this.iconSize, framed: this.iconFramed })), h("div", { key: 'd2d9418cef0d876f9a59200b6c4a0995e18b8624', id: "text" }, h("ezp-label", { key: 'cf5ac182ee507a4e558e6d77a8ceae2fcd33912e', text: this.heading, weight: "heavy" }), h("ezp-label", { key: 'b925e9c5e830cf2b42b36b1fc60903ddc6aa9613', text: this.description }))), h("div", { key: '9d5d1663b68c8187d4e1767eee3587486974e7c5', id: "footer" }, h("ezp-text-button", { key: '3093c085f0001afec6a57aadb5f6866b1f4f2d22', type: "button", level: "primary", onClick: this.handleAction, label: this.action })))));
|
|
96
96
|
}
|
|
97
97
|
static get is() { return "ezp-dialog"; }
|
|
98
98
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as t,HTMLElement as
|
|
1
|
+
import{proxyCustomElement as t,HTMLElement as i,createEvent as e,h as s,Host as o,transformTag as n}from"@stencil/core/internal/client";import{a,E as l}from"./auth.js";import{s as h,i as c}from"./utils.js";import{d as p}from"./ezp-dialog2.js";import{d}from"./ezp-icon2.js";import{d as r}from"./ezp-icon-button2.js";import{d as u}from"./ezp-label2.js";import{d as m}from"./ezp-status2.js";import{d as g}from"./ezp-text-button2.js";const b=t(class extends i{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.authCancel=e(this,"authCancel",7),this.authSuccess=e(this,"authSuccess",7),this.userCancel=e(this,"userCancel",7),this.popupBlocked=e(this,"popupBlocked",7),this.isPopupBlocked=!1,this.oauthPopupWindow=null,this.previousUrl=null,this.receiveMessage=t=>{if(this.oauthPopupWindow&&t.source&&t.source!==this.oauthPopupWindow)return void console.warn("[ezeep] Ignored auth message from an unexpected source window.");let i=null;try{i=new URL(this.redirectURI).origin}catch(t){i=null}i&&t.origin!==i?console.warn(`[ezeep] Ignored auth message from unexpected origin "${t.origin}" (expected "${i}").`):(a.state.code=t.data,this.auth.getAccessToken().then((()=>{this.authCancel.emit(),this.authSuccess.emit()})))}}listenDialogAction(t){"popup-blocked"!==t.detail?this.openSignInWindow(this.auth.authURI.toString(),"ezeep Login"):this.handleRetry()}listenDialogClose(t){"popup-blocked"===t.detail&&(this.isPopupBlocked=!1,this.showsSignInStatus())?this.listenStatusCancel():this.authCancel.emit()}listenStatusCancel(){"file"===this.trigger?this.userCancel.emit():this.authCancel.emit()}connectedCallback(){this.unsubscribeLanguage=h(this)}disconnectedCallback(){var t;null===(t=this.unsubscribeLanguage)||void 0===t||t.call(this),window.removeEventListener("message",this.receiveMessage)}openSignInWindow(t,i){var e;if(a.state.isAuthorized)return this.authCancel.emit(),void this.authSuccess.emit();window.removeEventListener("message",this.receiveMessage);const s="toolbar=no, menubar=no, width=600, height=7000, top=100, left=100";if(null===this.oauthPopupWindow||this.oauthPopupWindow.closed){if(this.oauthPopupWindow=window.open(t,i,s),this.isWindowBlocked(this.oauthPopupWindow))return void this.handlePopupBlocked()}else if(this.previousUrl!==this.auth.authURI.toString()){const o=this.oauthPopupWindow;if(this.oauthPopupWindow=window.open(t,i,s),this.isWindowBlocked(this.oauthPopupWindow))return null==o||o.close(),void this.handlePopupBlocked();null===(e=this.oauthPopupWindow)||void 0===e||e.focus()}else this.oauthPopupWindow.focus();window.addEventListener("message",this.receiveMessage,!1),this.previousUrl=this.auth.authURI.toString()}showsSignInStatus(){return this.hidelogin&&("button"===this.trigger||"file"===this.trigger)}isWindowBlocked(t){return!t||t.closed||void 0===t.closed}handlePopupBlocked(){this.oauthPopupWindow=null,this.isPopupBlocked=!0,this.popupBlocked.emit()}handleRetry(){this.isPopupBlocked=!1,this.openSignInWindow(this.auth.authURI.toString(),"ezeep Login")}async componentWillLoad(){this.auth=new l(this.redirectURI,this.clientID),this.code&&(a.state.code=this.code,await this.auth.getAccessToken(),this.authCancel.emit(),this.authSuccess.emit()),!1===a.state.isAuthorized&&(this.auth.generateCodeVerifier(),await this.auth.generateCodeChallenge(a.state.codeVerifier),this.auth.buildAuthURI()),!this.hidelogin||"button"!==this.trigger&&"file"!==this.trigger||(a.state.isAuthorized?(this.authCancel.emit(),this.authSuccess.emit()):this.openSignInWindow(this.auth.authURI.toString(),"ezeep Login"))}render(){return s(o,{key:"b947c930b88083bbcde53215bcb6159f2d2a79ce"},this.isPopupBlocked?s("ezp-dialog",{heading:c.t("popup_blocked_dialog.heading"),description:c.t("popup_blocked_dialog.description"),action:c.t("popup_blocked_dialog.action"),iconName:"exclamation-mark",instance:"popup-blocked",key:"popup-blocked"}):this.showsSignInStatus()?s("ezp-status",{description:c.t("login_dialog.action"),processing:!0,cancel:!0}):s("ezp-dialog",{heading:c.t("login_dialog.heading"),description:c.t("login_dialog.description"),action:c.t("login_dialog.action"),iconName:"logo",iconSize:"huge",iconFramed:!1,instance:"login",key:"login"}))}static get style(){return":host{--ezp-theme-solid:var(--ezp-accent-cyan-solid);--ezp-theme-translucent:var(--ezp-accent-cyan-translucent);display:block}"}},[1,"ezp-auth",{clientID:[1025,"client-i-d"],redirectURI:[1025,"redirect-u-r-i"],hidelogin:[4],trigger:[1],code:[1],auth:[32],authURI:[32],accessToken:[32],isPopupBlocked:[32]},[[0,"dialogAction","listenDialogAction"],[0,"dialogClose","listenDialogClose"],[0,"statusCancel","listenStatusCancel"]]]);function z(){"undefined"!=typeof customElements&&["ezp-auth","ezp-dialog","ezp-icon","ezp-icon-button","ezp-label","ezp-status","ezp-text-button"].forEach((t=>{switch(t){case"ezp-auth":customElements.get(n(t))||customElements.define(n(t),b);break;case"ezp-dialog":customElements.get(n(t))||p();break;case"ezp-icon":customElements.get(n(t))||d();break;case"ezp-icon-button":customElements.get(n(t))||r();break;case"ezp-label":customElements.get(n(t))||u();break;case"ezp-status":customElements.get(n(t))||m();break;case"ezp-text-button":customElements.get(n(t))||g()}}))}export{b as E,z as d}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as t,HTMLElement as
|
|
1
|
+
import{proxyCustomElement as t,HTMLElement as i,createEvent as a,h as e,Host as o,transformTag as n}from"@stencil/core/internal/client";const s=t(class extends i{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.backdropHideStart=a(this,"backdropHideStart",7),this.backdropHideEnd=a(this,"backdropHideEnd",7),this.visible=!0}handleClick(){this.visible=!1,this.backdropHideStart.emit()}listenAnimationEnd(){this.visible||this.backdropHideEnd.emit()}render(){return e(o,{key:"7a559a59b645ba3610c90c872a8bc60de2ce5645",class:{hide:!this.visible},onClick:()=>this.handleClick()})}get component(){return this}static get style(){return":host{-webkit-animation:var(--ezp-backdrop-animation-name, host-in) var(--ezp-duration-3) forwards var(--ezp-easing-out-quart);animation:var(--ezp-backdrop-animation-name, host-in) var(--ezp-duration-3) forwards var(--ezp-easing-out-quart);background:var(--ezp-core-backdrop);border-radius:var(--ezp-backdrop-border-radius, 6px);display:block;height:100%;left:0;opacity:0;position:absolute;top:0;width:100%;z-index:4}:host(.hide){--ezp-backdrop-animation-name:host-out}@-webkit-keyframes host-in{0%{opacity:0}100%{opacity:1}}@keyframes host-in{0%{opacity:0}100%{opacity:1}}@-webkit-keyframes host-out{0%{opacity:1}100%{opacity:0}}@keyframes host-out{0%{opacity:1}100%{opacity:0}}"}},[1,"ezp-backdrop",{visible:[1028]},[[0,"animationend","listenAnimationEnd"]]]);function r(){"undefined"!=typeof customElements&&["ezp-backdrop"].forEach((t=>{"ezp-backdrop"===t&&(customElements.get(n(t))||customElements.define(n(t),s))}))}export{s as E,r as d}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as e,HTMLElement as t,createEvent as i,h as a,Host as o,transformTag as c}from"@stencil/core/internal/client";import{i as n,s}from"./utils.js";import{d}from"./ezp-icon2.js";import{d as l}from"./ezp-icon-button2.js";import{d as r}from"./ezp-label2.js";import{d as p}from"./ezp-text-button2.js";const b=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.dialogClose=i(this,"dialogClose",7),this.dialogAction=i(this,"dialogAction",7),this.action=n.t("button_actions.close"),this.iconSize="large",this.iconFramed=!0,this.handleClose=()=>{this.dialogClose.emit(this.instance)},this.handleAction=()=>{this.dialogAction.emit(this.instance)}}connectedCallback(){this.unsubscribeLanguage=s(this)}componentDidLoad(){var e;null===(e=this.box)||void 0===e||e.focus()}disconnectedCallback(){var e;null===(e=this.unsubscribeLanguage)||void 0===e||e.call(this)}handleKeydown(e){"Escape"!==e.key?"Tab"===e.key&&this.trapFocus(e):this.handleClose()}trapFocus(e){if(!this.box)return;const t=this.collectFocusable(this.box);if(0===t.length)return;const i=t[0],a=t[t.length-1],o=this.deepActiveElement();o&&t.includes(o)?e.shiftKey&&o===i?(e.preventDefault(),a.focus()):e.shiftKey||o!==a||(e.preventDefault(),i.focus()):(e.preventDefault(),i.focus())}collectFocusable(e){const t=[],i=e=>{e.querySelectorAll("*").forEach((e=>{e.tabIndex>=0&&!e.disabled&&t.push(e),e.shadowRoot&&i(e.shadowRoot)}))};return i(e),t}deepActiveElement(){var e;let t=document.activeElement;for(;null===(e=null==t?void 0:t.shadowRoot)||void 0===e?void 0:e.activeElement;)t=t.shadowRoot.activeElement;return t}render(){return a(o,{key:"
|
|
1
|
+
import{proxyCustomElement as e,HTMLElement as t,createEvent as i,h as a,Host as o,transformTag as c}from"@stencil/core/internal/client";import{i as n,s}from"./utils.js";import{d}from"./ezp-icon2.js";import{d as l}from"./ezp-icon-button2.js";import{d as r}from"./ezp-label2.js";import{d as p}from"./ezp-text-button2.js";const b=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.dialogClose=i(this,"dialogClose",7),this.dialogAction=i(this,"dialogAction",7),this.action=n.t("button_actions.close"),this.iconSize="large",this.iconFramed=!0,this.handleClose=()=>{this.dialogClose.emit(this.instance)},this.handleAction=()=>{this.dialogAction.emit(this.instance)}}connectedCallback(){this.unsubscribeLanguage=s(this)}componentDidLoad(){var e;null===(e=this.box)||void 0===e||e.focus()}disconnectedCallback(){var e;null===(e=this.unsubscribeLanguage)||void 0===e||e.call(this)}handleKeydown(e){"Escape"!==e.key?"Tab"===e.key&&this.trapFocus(e):this.handleClose()}trapFocus(e){if(!this.box)return;const t=this.collectFocusable(this.box);if(0===t.length)return;const i=t[0],a=t[t.length-1],o=this.deepActiveElement();o&&t.includes(o)?e.shiftKey&&o===i?(e.preventDefault(),a.focus()):e.shiftKey||o!==a||(e.preventDefault(),i.focus()):(e.preventDefault(),i.focus())}collectFocusable(e){const t=[],i=e=>{e.querySelectorAll("*").forEach((e=>{e.tabIndex>=0&&!e.disabled&&t.push(e),e.shadowRoot&&i(e.shadowRoot)}))};return i(e),t}deepActiveElement(){var e;let t=document.activeElement;for(;null===(e=null==t?void 0:t.shadowRoot)||void 0===e?void 0:e.activeElement;)t=t.shadowRoot.activeElement;return t}render(){return a(o,{key:"31add15a63c15bd40f88056c8db4b1621be8365c"},a("div",{key:"4027e801bd98fea212c079282ace0e414cf23525",id:"box",role:"dialog","aria-modal":"true","aria-label":this.heading,tabindex:-1,ref:e=>this.box=e},a("div",{key:"8efa479a250d00b64400ca75c2fe7b1e490a5f78",id:"header"},a("ezp-icon-button",{key:"492ca4802b7ddf20c37a0ce712f77cb0beea07d5",level:"tertiary",icon:"close",type:"button",onClick:this.handleClose})),a("div",{key:"65c7484b089a30b71f24014a5705a870522f4b65",id:"body"},this.iconName&&a("ezp-icon",{key:"9d7689c2c5bc50196e7a4a7a25e9c314e0ca7372",name:this.iconName,size:this.iconSize,framed:this.iconFramed}),a("div",{key:"d2d9418cef0d876f9a59200b6c4a0995e18b8624",id:"text"},a("ezp-label",{key:"cf5ac182ee507a4e558e6d77a8ceae2fcd33912e",text:this.heading,weight:"heavy"}),a("ezp-label",{key:"b925e9c5e830cf2b42b36b1fc60903ddc6aa9613",text:this.description}))),a("div",{key:"9d5d1663b68c8187d4e1767eee3587486974e7c5",id:"footer"},a("ezp-text-button",{key:"3093c085f0001afec6a57aadb5f6866b1f4f2d22",type:"button",level:"primary",onClick:this.handleAction,label:this.action}))))}static get style(){return":host{--ezp-icon-fill:var(--ezp-theme-solid);-ms-flex-line-pack:center;align-content:center;background:var(--ezp-core-backdrop);display:grid;grid-template:auto/minmax(auto, 280px);height:100%;-ms-flex-pack:center;justify-content:center;left:0;position:fixed;top:0;width:100%}#box{background:var(--ezp-core-surface-tertiary);border-radius:6px;-webkit-box-shadow:var(--ezp-dialog-box-boxShadow, 0 0 0 1px var(--ezp-black-10));box-shadow:var(--ezp-dialog-box-boxShadow, 0 0 0 1px var(--ezp-black-10))}#header{display:-ms-flexbox;display:flex;-ms-flex-pack:end;justify-content:flex-end;padding:var(--ezp-spacing-2) var(--ezp-spacing-3)}#body{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:var(--ezp-spacing-5);padding:0 var(--ezp-spacing-5);text-align:center}#text{color:var(--ezp-core-foreground-primary);display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:var(--ezp-spacing-4)}#footer{display:grid;grid-template:auto/minmax(144px, auto);-ms-flex-pack:center;justify-content:center;padding:var(--ezp-spacing-5)}"}},[1,"ezp-dialog",{heading:[1],description:[1],action:[1],iconName:[1,"icon-name"],iconSize:[1,"icon-size"],iconFramed:[4,"icon-framed"],instance:[1]},[[8,"keydown","handleKeydown"]]]);function f(){"undefined"!=typeof customElements&&["ezp-dialog","ezp-icon","ezp-icon-button","ezp-label","ezp-text-button"].forEach((e=>{switch(e){case"ezp-dialog":customElements.get(c(e))||customElements.define(c(e),b);break;case"ezp-icon":customElements.get(c(e))||d();break;case"ezp-icon-button":customElements.get(c(e))||l();break;case"ezp-label":customElements.get(c(e))||r();break;case"ezp-text-button":customElements.get(c(e))||p()}}))}export{b as E,f as d}
|