@ezeep/ezeep-js 1.0.272 → 1.0.284
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/{app-globals-D7ISNeUi.js → app-globals-L_3XPZxT.js} +7 -1
- package/dist/cjs/ezeep.cjs.js +4 -4
- package/dist/cjs/ezp-auth_15.cjs.entry.js +7338 -3700
- package/dist/cjs/{index-dv_gozsq.js → index-DM5v_sge.js} +3 -2
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/ezp-auth/ezp-auth.css +0 -12
- package/dist/collection/components/ezp-auth/ezp-auth.js +78 -18
- package/dist/collection/components/ezp-backdrop/ezp-backdrop.js +5 -5
- package/dist/collection/components/ezp-dialog/ezp-dialog.js +85 -13
- package/dist/collection/components/ezp-icon/assets/glyph-cloud-upload.svg +4 -0
- package/dist/collection/components/ezp-icon/assets/glyph-file.svg +3 -0
- package/dist/collection/components/ezp-icon/ezp-icon.js +8 -3
- package/dist/collection/components/ezp-icon-button/ezp-icon-button.js +5 -2
- package/dist/collection/components/ezp-input/ezp-input.css +19 -38
- package/dist/collection/components/ezp-input/ezp-input.js +16 -14
- package/dist/collection/components/ezp-printer-selection/ezp-printer-selection.css +175 -48
- package/dist/collection/components/ezp-printer-selection/ezp-printer-selection.js +215 -329
- package/dist/collection/components/ezp-printing/ezp-printing.css +23 -23
- package/dist/collection/components/ezp-printing/ezp-printing.js +119 -35
- package/dist/collection/components/ezp-select/ezp-select.css +56 -38
- package/dist/collection/components/ezp-select/ezp-select.js +93 -14
- package/dist/collection/components/ezp-status/ezp-status.css +94 -9
- package/dist/collection/components/ezp-status/ezp-status.js +42 -13
- package/dist/collection/components/ezp-stepper/ezp-stepper.css +37 -35
- package/dist/collection/components/ezp-stepper/ezp-stepper.js +14 -7
- package/dist/collection/components/ezp-text-button/ezp-text-button.css +3 -3
- package/dist/collection/components/ezp-text-button/ezp-text-button.js +1 -1
- package/dist/collection/components/ezp-upload/ezp-upload.css +243 -77
- package/dist/collection/components/ezp-upload/ezp-upload.js +80 -10
- package/dist/collection/components/ezp-user-menu/ezp-user-menu.css +2 -1
- package/dist/collection/components/ezp-user-menu/ezp-user-menu.js +15 -15
- package/dist/collection/services/auth.js +37 -36
- package/dist/collection/services/http.js +11 -0
- package/dist/collection/services/print-job.js +72 -0
- package/dist/collection/services/print.js +21 -69
- package/dist/collection/services/user.js +2 -9
- package/dist/collection/shared/constants.js +55 -0
- package/dist/collection/shared/global.js +7 -1
- package/dist/collection/shared/storage.js +71 -0
- package/dist/collection/types/shared/types.d.ts +42 -9
- package/dist/collection/utils/printer.js +68 -0
- package/dist/collection/utils/utils.js +24 -9
- package/dist/components/auth.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/ezp-icon-button2.js +1 -1
- package/dist/components/ezp-icon2.js +1 -1
- package/dist/components/ezp-input2.js +1 -1
- package/dist/components/ezp-printer-selection2.js +1 -1
- package/dist/components/ezp-printing.js +1 -1
- package/dist/components/ezp-select2.js +1 -1
- package/dist/components/ezp-status2.js +1 -1
- package/dist/components/ezp-stepper2.js +1 -1
- package/dist/components/ezp-text-button2.js +1 -1
- package/dist/components/ezp-upload2.js +1 -1
- package/dist/components/ezp-user-menu.js +1 -1
- package/dist/components/ezp-user-menu2.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/utils.js +1 -0
- package/dist/directives/proxies.ts +74 -47
- package/dist/esm/{app-globals-CpP67t2l.js → app-globals-C0WTlb31.js} +7 -1
- package/dist/esm/ezeep.js +5 -5
- package/dist/esm/ezp-auth_15.entry.js +7338 -3700
- package/dist/esm/{index-BTfWEHH9.js → index-BButrLnB.js} +3 -3
- package/dist/esm/loader.js +4 -4
- package/dist/esm-es5/{app-globals-CpP67t2l.js → app-globals-C0WTlb31.js} +1 -1
- package/dist/esm-es5/ezeep.js +1 -1
- package/dist/esm-es5/ezp-auth_15.entry.js +2 -2
- package/dist/esm-es5/{index-BTfWEHH9.js → index-BButrLnB.js} +3 -3
- package/dist/esm-es5/loader.js +1 -1
- package/dist/ezeep/assets/glyph-cloud-upload.svg +4 -0
- package/dist/ezeep/assets/glyph-file.svg +3 -0
- package/dist/ezeep/ezeep.esm.js +1 -1
- package/dist/ezeep/ezeep.js +1 -1
- package/dist/ezeep/p-1e286bd1.system.entry.js +7 -0
- package/dist/ezeep/{p-BTfWEHH9.js → p-BButrLnB.js} +2 -2
- package/dist/ezeep/{p-CpP67t2l.js → p-C0WTlb31.js} +1 -1
- package/{www/build/p-DhXN1yGM.system.js → dist/ezeep/p-CYpousxy.system.js} +2 -2
- package/dist/ezeep/{p-5ok9OZMg.system.js → p-D4aCr1OK.system.js} +1 -1
- package/dist/ezeep/p-DCznw2Ee.system.js +1 -0
- package/dist/ezeep/p-a2b688f0.entry.js +1 -0
- package/dist/ezeep/types/shared/types.d.ts +42 -9
- package/dist/types/components/ezp-auth/ezp-auth.d.ts +8 -5
- package/dist/types/components/ezp-backdrop/ezp-backdrop.d.ts +2 -2
- package/dist/types/components/ezp-dialog/ezp-dialog.d.ts +14 -3
- package/dist/types/components/ezp-input/ezp-input.d.ts +17 -14
- package/dist/types/components/ezp-printer-selection/ezp-printer-selection.d.ts +23 -7
- package/dist/types/components/ezp-printing/ezp-printing.d.ts +26 -2
- package/dist/types/components/ezp-select/ezp-select.d.ts +10 -4
- package/dist/types/components/ezp-status/ezp-status.d.ts +7 -4
- package/dist/types/components/ezp-stepper/ezp-stepper.d.ts +1 -1
- package/dist/types/components/ezp-upload/ezp-upload.d.ts +13 -1
- package/dist/types/components/ezp-user-menu/ezp-user-menu.d.ts +5 -2
- package/dist/types/components.d.ts +47 -39
- package/dist/types/services/auth.d.ts +10 -0
- package/dist/types/services/http.d.ts +4 -0
- package/dist/types/services/print-job.d.ts +48 -0
- package/dist/types/services/print.d.ts +10 -9
- package/dist/types/services/user.d.ts +13 -2
- package/dist/types/shared/constants.d.ts +51 -0
- package/dist/types/shared/storage.d.ts +24 -0
- package/dist/types/shared/types.d.ts +42 -9
- package/dist/types/stencil-public-runtime.d.ts +1 -0
- package/dist/types/utils/printer.d.ts +22 -0
- package/dist/types/utils/utils.d.ts +22 -10
- package/package.json +30 -18
- package/readme.md +1 -0
- package/www/build/assets/glyph-cloud-upload.svg +4 -0
- package/www/build/assets/glyph-file.svg +3 -0
- package/www/build/ezeep.esm.js +1 -1
- package/www/build/ezeep.js +1 -1
- package/www/build/p-1e286bd1.system.entry.js +7 -0
- package/www/build/p-544b7033.js +1 -0
- package/www/build/{p-BTfWEHH9.js → p-BButrLnB.js} +2 -2
- package/www/build/{p-CpP67t2l.js → p-C0WTlb31.js} +1 -1
- package/{dist/ezeep/p-DhXN1yGM.system.js → www/build/p-CYpousxy.system.js} +2 -2
- package/www/build/{p-5ok9OZMg.system.js → p-D4aCr1OK.system.js} +1 -1
- package/www/build/p-DCznw2Ee.system.js +1 -0
- package/www/build/p-a2b688f0.entry.js +1 -0
- package/www/data/locales/de.json +14 -5
- package/www/data/locales/en.json +14 -5
- package/www/index.html +2 -5
- package/dist/components/i18next.js +0 -1
- package/dist/ezeep/p-2177b8f4.system.entry.js +0 -7
- package/dist/ezeep/p-CfQRcOh8.system.js +0 -1
- package/dist/ezeep/p-de8f6583.entry.js +0 -1
- package/www/build/p-2177b8f4.system.entry.js +0 -7
- package/www/build/p-256870db.js +0 -1
- package/www/build/p-CfQRcOh8.system.js +0 -1
- package/www/build/p-de8f6583.entry.js +0 -1
|
@@ -59,6 +59,7 @@
|
|
|
59
59
|
*
|
|
60
60
|
*/
|
|
61
61
|
:host {
|
|
62
|
+
box-sizing: border-box;
|
|
62
63
|
font-family: "Inter", sans-serif;
|
|
63
64
|
font-feature-settings: "calt", "liga", "ss03", "zero", "cv05", "cv10";
|
|
64
65
|
font-kerning: normal;
|
|
@@ -68,7 +69,6 @@
|
|
|
68
69
|
-webkit-tap-highlight-color: transparent;
|
|
69
70
|
text-rendering: optimizeLegibility;
|
|
70
71
|
-webkit-text-size-adjust: none;
|
|
71
|
-
box-sizing: border-box;
|
|
72
72
|
--ezp-duration-1: 0.1s;
|
|
73
73
|
--ezp-duration-2: 0.16s;
|
|
74
74
|
--ezp-duration-3: 0.26s;
|
|
@@ -135,10 +135,10 @@
|
|
|
135
135
|
--ezp-accent-teal-solid-alt: rgb(0, 132, 110);
|
|
136
136
|
--ezp-accent-teal-translucent: rgba(0, 150, 124, 0.16);
|
|
137
137
|
--ezp-accent-teal-faded: rgba(0, 150, 124, 0.1);
|
|
138
|
-
--ezp-accent-cyan-solid: rgb(0,
|
|
139
|
-
--ezp-accent-cyan-solid-alt: rgb(0,
|
|
140
|
-
--ezp-accent-cyan-translucent: rgba(0,
|
|
141
|
-
--ezp-accent-cyan-faded: rgba(0,
|
|
138
|
+
--ezp-accent-cyan-solid: rgb(0, 143, 178);
|
|
139
|
+
--ezp-accent-cyan-solid-alt: rgb(0, 126, 158);
|
|
140
|
+
--ezp-accent-cyan-translucent: rgba(0, 143, 178, 0.1);
|
|
141
|
+
--ezp-accent-cyan-faded: rgba(0, 143, 178, 0.1);
|
|
142
142
|
--ezp-accent-blue-solid: rgb(80, 129, 241);
|
|
143
143
|
--ezp-accent-blue-solid-alt: rgb(59, 114, 223);
|
|
144
144
|
--ezp-accent-blue-translucent: rgba(80, 129, 241, 0.16);
|
|
@@ -179,10 +179,10 @@
|
|
|
179
179
|
--ezp-accent-teal-solid-alt: color(display-p3 0 0.518 0.431 / 100%);
|
|
180
180
|
--ezp-accent-teal-translucent: color(display-p3 0 0.588 0.486 / 16%);
|
|
181
181
|
--ezp-accent-teal-faded: color(display-p3 0 0.588 0.486 / 10%);
|
|
182
|
-
--ezp-accent-cyan-solid: color(display-p3 0 0.
|
|
183
|
-
--ezp-accent-cyan-solid-alt: color(display-p3 0 0.
|
|
184
|
-
--ezp-accent-cyan-translucent: color(display-p3 0 0.
|
|
185
|
-
--ezp-accent-cyan-faded: color(display-p3 0 0.
|
|
182
|
+
--ezp-accent-cyan-solid: color(display-p3 0 0.561 0.698 / 100%);
|
|
183
|
+
--ezp-accent-cyan-solid-alt: color(display-p3 0 0.494 0.62 / 100%);
|
|
184
|
+
--ezp-accent-cyan-translucent: color(display-p3 0 0.561 0.698 / 10%);
|
|
185
|
+
--ezp-accent-cyan-faded: color(display-p3 0 0.561 0.698 / 10%);
|
|
186
186
|
--ezp-accent-blue-solid: color(display-p3 0.314 0.506 0.945 / 100%);
|
|
187
187
|
--ezp-accent-blue-solid-alt: color(display-p3 0.231 0.447 0.875 / 100%);
|
|
188
188
|
--ezp-accent-blue-translucent: color(display-p3 0.314 0.506 0.945 / 16%);
|
|
@@ -234,10 +234,10 @@
|
|
|
234
234
|
}
|
|
235
235
|
|
|
236
236
|
:host(.dark) {
|
|
237
|
-
--ezp-dialog-box-boxShadow:
|
|
238
|
-
0 0 0 1px var(--ezp-black-60);
|
|
239
|
-
--ezp-printerSelection-body-boxShadow:
|
|
240
|
-
inset -1px 0 0 0 var(--ezp-core-outline);
|
|
237
|
+
--ezp-dialog-box-boxShadow:
|
|
238
|
+
inset 0 0 0 1px var(--ezp-core-outline), 0 0 0 1px var(--ezp-black-60);
|
|
239
|
+
--ezp-printerSelection-body-boxShadow:
|
|
240
|
+
inset 1px 0 0 0 var(--ezp-core-outline), inset -1px 0 0 0 var(--ezp-core-outline);
|
|
241
241
|
--ezp-printerSelection-box-boxShadow: 0 0 0 1px var(--ezp-black-60);
|
|
242
242
|
--ezp-printerSelection-footer-boxShadowPosition: inset 0 0 0 1px;
|
|
243
243
|
--ezp-printerSelection-header-boxShadowPosition: inset 0 0 0 1px;
|
|
@@ -245,11 +245,11 @@
|
|
|
245
245
|
--ezp-select-wrap-boxShadowPositionLeft: inset 1px 0 0 0;
|
|
246
246
|
--ezp-select-wrap-boxShadowPositionRight: inset -1px 0 0 0;
|
|
247
247
|
--ezp-select-wrap-boxShadowPositionTop: inset 0 1px 0 0;
|
|
248
|
-
--ezp-status-box-boxShadow:
|
|
249
|
-
0 0 0 1px var(--ezp-black-60);
|
|
248
|
+
--ezp-status-box-boxShadow:
|
|
249
|
+
inset 0 0 0 1px var(--ezp-core-outline), 0 0 0 1px var(--ezp-black-60);
|
|
250
250
|
--ezp-stepper-boxShadowPosition: inset 0 0 0 1px;
|
|
251
|
-
--ezp-userMenu-boxShadow:
|
|
252
|
-
0 0 0 1px var(--ezp-black-60);
|
|
251
|
+
--ezp-userMenu-boxShadow:
|
|
252
|
+
inset 0 0 0 1px var(--ezp-core-outline), 0 0 0 1px var(--ezp-black-60);
|
|
253
253
|
--ezp-userMenu-header-boxShadowPosition: inset 0 -1px 0 0;
|
|
254
254
|
--ezp-userMenu-links-boxShadowPosition: inset 0 -1px 0 0;
|
|
255
255
|
--ezp-userMenu-theme-boxShadowPosition: inset 0 -1px 0 0;
|
|
@@ -275,9 +275,9 @@
|
|
|
275
275
|
--ezp-accent-teal-solid: rgb(29, 160, 134);
|
|
276
276
|
--ezp-accent-teal-translucent: rgba(29, 160, 134, 0.26);
|
|
277
277
|
--ezp-accent-teal-faded: rgba(29, 160, 134, 0.16);
|
|
278
|
-
--ezp-accent-cyan-solid: rgb(32,
|
|
279
|
-
--ezp-accent-cyan-translucent: rgba(32,
|
|
280
|
-
--ezp-accent-cyan-faded: rgba(32,
|
|
278
|
+
--ezp-accent-cyan-solid: rgb(32, 153, 189);
|
|
279
|
+
--ezp-accent-cyan-translucent: rgba(32, 153, 189, 0.26);
|
|
280
|
+
--ezp-accent-cyan-faded: rgba(32, 153, 189, 0.16);
|
|
281
281
|
--ezp-accent-blue-solid: rgb(93, 139, 253);
|
|
282
282
|
--ezp-accent-blue-translucent: rgba(93, 139, 253, 0.26);
|
|
283
283
|
--ezp-accent-blue-faded: rgba(93, 139, 253, 0.16);
|
|
@@ -309,9 +309,9 @@
|
|
|
309
309
|
--ezp-accent-teal-solid: color(display-p3 0.114 0.627 0.525 / 100%);
|
|
310
310
|
--ezp-accent-teal-translucent: color(display-p3 0.114 0.627 0.525 / 26%);
|
|
311
311
|
--ezp-accent-teal-faded: color(display-p3 0.114 0.627 0.525 / 16%);
|
|
312
|
-
--ezp-accent-cyan-solid: color(display-p3 0.125 0.
|
|
313
|
-
--ezp-accent-cyan-translucent: color(display-p3 0.125 0.
|
|
314
|
-
--ezp-accent-cyan-faded: color(display-p3 0.125 0.
|
|
312
|
+
--ezp-accent-cyan-solid: color(display-p3 0.125 0.6 0.741 / 100%);
|
|
313
|
+
--ezp-accent-cyan-translucent: color(display-p3 0.125 0.6 0.741 / 26%);
|
|
314
|
+
--ezp-accent-cyan-faded: color(display-p3 0.125 0.6 0.741 / 16%);
|
|
315
315
|
--ezp-accent-blue-solid: color(display-p3 0.365 0.545 0.992 / 100%);
|
|
316
316
|
--ezp-accent-blue-translucent: color(display-p3 0.365 0.545 0.992 / 26%);
|
|
317
317
|
--ezp-accent-blue-faded: color(display-p3 0.365 0.545 0.992 / 16%);
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { Host, h, } from "@stencil/core";
|
|
2
2
|
import authStore, { EzpAuthorizationService, sendCodeToParentWindow } from "../../services/auth";
|
|
3
3
|
import printStore, { EzpPrintService } from "../../services/print";
|
|
4
|
-
import userStore from "../../services/user";
|
|
4
|
+
import userStore, { EzpUserService } from "../../services/user";
|
|
5
5
|
import config from "../../shared/config.json";
|
|
6
6
|
import i18next from "i18next";
|
|
7
|
-
import { initi18n } from "../../utils/utils";
|
|
7
|
+
import { initi18n, subscribeToLanguageChange } from "../../utils/utils";
|
|
8
|
+
import { storage } from "../../shared/storage";
|
|
9
|
+
import { TOKEN_REFRESH_INTERVAL_S } from "../../shared/constants";
|
|
8
10
|
export class EzpPrinting {
|
|
9
11
|
constructor() {
|
|
10
12
|
this.filename = '';
|
|
@@ -28,9 +30,8 @@ export class EzpPrinting {
|
|
|
28
30
|
}
|
|
29
31
|
/** Watchers */
|
|
30
32
|
watchFileData(newValue, oldValue) {
|
|
31
|
-
console.log(newValue);
|
|
32
33
|
if (newValue !== oldValue && newValue.length > 0) {
|
|
33
|
-
|
|
34
|
+
const array = new Uint8Array(newValue.length);
|
|
34
35
|
for (let i = 0; i < newValue.length; i++) {
|
|
35
36
|
array[i] = newValue.charCodeAt(i);
|
|
36
37
|
}
|
|
@@ -50,6 +51,8 @@ export class EzpPrinting {
|
|
|
50
51
|
watchLanguage(newValue, oldValue) {
|
|
51
52
|
if (newValue !== oldValue && newValue.length > 0) {
|
|
52
53
|
this.language = newValue;
|
|
54
|
+
// Apply the new language so any dialog opened afterwards is translated.
|
|
55
|
+
i18next.changeLanguage(newValue);
|
|
53
56
|
}
|
|
54
57
|
}
|
|
55
58
|
/**
|
|
@@ -95,7 +98,10 @@ export class EzpPrinting {
|
|
|
95
98
|
document.dispatchEvent(printCancelEvent);
|
|
96
99
|
this.checkAuth();
|
|
97
100
|
}
|
|
98
|
-
listenAuthSuccess() {
|
|
101
|
+
async listenAuthSuccess() {
|
|
102
|
+
// Adopt the user's account language before opening the dialog so it renders
|
|
103
|
+
// in the right language (and picks up a language change made in the host app).
|
|
104
|
+
await this.syncPreferredLanguage();
|
|
99
105
|
if (this.onlyGetSasUri) {
|
|
100
106
|
this.printOpen = false;
|
|
101
107
|
this.onlyGetSasUri = false;
|
|
@@ -108,6 +114,12 @@ export class EzpPrinting {
|
|
|
108
114
|
}
|
|
109
115
|
}
|
|
110
116
|
listenUploadFile(event) {
|
|
117
|
+
// Keep the selection in sync as files are added/removed, but stay on the
|
|
118
|
+
// upload step until the user explicitly continues (see listenUploadContinue).
|
|
119
|
+
this.files = event.detail;
|
|
120
|
+
this.filename = this.files.length > 0 ? this.files[0].name : '';
|
|
121
|
+
}
|
|
122
|
+
listenUploadContinue(event) {
|
|
111
123
|
this.files = event.detail;
|
|
112
124
|
this.filename = this.files.length > 0 ? this.files[0].name : '';
|
|
113
125
|
this.open();
|
|
@@ -137,24 +149,49 @@ export class EzpPrinting {
|
|
|
137
149
|
}
|
|
138
150
|
async logOut() {
|
|
139
151
|
this.auth.revokeRefreshToken();
|
|
140
|
-
|
|
141
|
-
localStorage.removeItem('refreshToken');
|
|
142
|
-
localStorage.removeItem('access_token');
|
|
143
|
-
localStorage.removeItem('printer');
|
|
144
|
-
localStorage.removeItem('isAuthorized');
|
|
152
|
+
storage.clearSession();
|
|
145
153
|
this.printOpen = false;
|
|
146
154
|
}
|
|
155
|
+
/**
|
|
156
|
+
* Make sure an access token is available before a token-dependent call. The
|
|
157
|
+
* token is in-memory only, so after a reload it must be refreshed from the
|
|
158
|
+
* persisted refresh token first. Returns a shared in-flight promise so
|
|
159
|
+
* concurrent callers don't fire duplicate refreshes, and swallows a transient
|
|
160
|
+
* failure (the caller then falls through to the unauthorized path; the
|
|
161
|
+
* periodic refresh and next checkAuth retry).
|
|
162
|
+
*/
|
|
163
|
+
ensureAccessToken() {
|
|
164
|
+
if (authStore.state.accessToken !== '' || authStore.state.refreshToken === '' || !this.auth) {
|
|
165
|
+
return Promise.resolve();
|
|
166
|
+
}
|
|
167
|
+
if (!this.refreshInFlight) {
|
|
168
|
+
this.refreshInFlight = this.auth
|
|
169
|
+
.refreshTokens()
|
|
170
|
+
.catch(() => {
|
|
171
|
+
// Transient token-endpoint failure — leave the token empty.
|
|
172
|
+
})
|
|
173
|
+
.finally(() => {
|
|
174
|
+
this.refreshInFlight = undefined;
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
return this.refreshInFlight;
|
|
178
|
+
}
|
|
147
179
|
async getSasUri() {
|
|
148
180
|
this.onlyGetSasUri = true;
|
|
181
|
+
// Wait for a reload-time token refresh to settle so we don't call the API
|
|
182
|
+
// with an empty bearer (which would spuriously open the login dialog).
|
|
183
|
+
await this.ensureAccessToken();
|
|
149
184
|
const printService = new EzpPrintService(this.redirecturi, this.clientid);
|
|
150
|
-
|
|
185
|
+
const response = await printService
|
|
186
|
+
.prepareFileUpload(authStore.state.accessToken)
|
|
187
|
+
.catch(() => {
|
|
151
188
|
this.open();
|
|
152
189
|
return null;
|
|
153
190
|
});
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
191
|
+
// Keep the original public signature (Promise<string>) for backward
|
|
192
|
+
// compatibility. On the prepare-failure path this resolves to undefined at
|
|
193
|
+
// runtime, exactly as it always has.
|
|
194
|
+
return response ? response.sasUri : undefined;
|
|
158
195
|
}
|
|
159
196
|
async getAuthUri() {
|
|
160
197
|
this.auth.generateCodeVerifier();
|
|
@@ -165,20 +202,23 @@ export class EzpPrinting {
|
|
|
165
202
|
async setAuthRefreshToken(refreshToken) {
|
|
166
203
|
// Store the refresh token in the same way as the component does in self-managed auth
|
|
167
204
|
authStore.state.refreshToken = refreshToken;
|
|
168
|
-
|
|
205
|
+
storage.setRefreshToken(refreshToken);
|
|
169
206
|
// Use the refresh token to obtain a valid access token
|
|
170
207
|
// This ensures the user doesn't see the login dialog
|
|
171
208
|
await this.auth.refreshTokens();
|
|
172
209
|
}
|
|
173
210
|
async checkAuth() {
|
|
211
|
+
// Constructing the print service also loads any persisted refresh token.
|
|
174
212
|
const printService = new EzpPrintService(this.redirecturi, this.clientid);
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
213
|
+
// The access token is kept in memory only (never written to localStorage),
|
|
214
|
+
// to limit XSS exposure. If it's missing — e.g. after a page reload — obtain
|
|
215
|
+
// a fresh one from the persisted refresh token so the user stays signed in.
|
|
216
|
+
// A transient refresh failure is swallowed here so checkAuth still completes
|
|
217
|
+
// and reports unauthorized (rather than rejecting); getConfig below then
|
|
218
|
+
// runs and the periodic refresh retries.
|
|
219
|
+
await this.ensureAccessToken();
|
|
220
|
+
if (storage.hasIsAuthorized()) {
|
|
221
|
+
authStore.state.isAuthorized = storage.getIsAuthorized();
|
|
182
222
|
}
|
|
183
223
|
await printService
|
|
184
224
|
.getConfig(authStore.state.accessToken)
|
|
@@ -194,7 +234,7 @@ export class EzpPrinting {
|
|
|
194
234
|
.catch(() => {
|
|
195
235
|
authStore.state.isAuthorized = false;
|
|
196
236
|
});
|
|
197
|
-
|
|
237
|
+
storage.setIsAuthorized(authStore.state.isAuthorized);
|
|
198
238
|
return authStore.state.isAuthorized;
|
|
199
239
|
}
|
|
200
240
|
/**
|
|
@@ -212,25 +252,29 @@ export class EzpPrinting {
|
|
|
212
252
|
return url.host;
|
|
213
253
|
}
|
|
214
254
|
}
|
|
215
|
-
catch (
|
|
216
|
-
// If URL parsing fails, return the original value
|
|
217
|
-
console.warn('Failed to parse URL:', hostUrl, e);
|
|
255
|
+
catch (_a) {
|
|
256
|
+
// If URL parsing fails, fall through and return the original value.
|
|
218
257
|
}
|
|
219
258
|
// Return as-is if it's already just a hostname
|
|
220
259
|
return hostUrl;
|
|
221
260
|
}
|
|
222
261
|
refreshTokensPeriodically(seconds) {
|
|
223
262
|
const authService = new EzpAuthorizationService(this.redirecturi, this.clientid);
|
|
224
|
-
setInterval(() => {
|
|
263
|
+
this.tokenRefreshInterval = setInterval(() => {
|
|
225
264
|
authService.refreshTokens();
|
|
226
265
|
}, seconds * 1000);
|
|
227
266
|
}
|
|
267
|
+
connectedCallback() {
|
|
268
|
+
this.unsubscribeLanguage = subscribeToLanguageChange(this);
|
|
269
|
+
}
|
|
228
270
|
async componentWillLoad() {
|
|
229
271
|
const systemAppearanceDark = window.matchMedia('(prefers-color-scheme: dark)');
|
|
230
272
|
this.systemAppearance = systemAppearanceDark.matches ? 'dark' : 'light';
|
|
231
|
-
|
|
273
|
+
this.systemAppearanceQuery = systemAppearanceDark;
|
|
274
|
+
this.systemAppearanceListener = (event) => {
|
|
232
275
|
this.systemAppearance = event.matches ? 'dark' : 'light';
|
|
233
|
-
}
|
|
276
|
+
};
|
|
277
|
+
systemAppearanceDark.addEventListener('change', this.systemAppearanceListener);
|
|
234
278
|
authStore.state.redirectUri = this.redirecturi;
|
|
235
279
|
userStore.state.theme = this.theme;
|
|
236
280
|
userStore.state.appearance = this.appearance;
|
|
@@ -249,10 +293,44 @@ export class EzpPrinting {
|
|
|
249
293
|
this.auth = new EzpAuthorizationService(this.redirecturi, this.clientid);
|
|
250
294
|
sendCodeToParentWindow();
|
|
251
295
|
initi18n(this.language);
|
|
252
|
-
this.checkAuth();
|
|
296
|
+
this.checkAuth().then(() => this.syncPreferredLanguage());
|
|
297
|
+
}
|
|
298
|
+
/**
|
|
299
|
+
* Adopt the signed-in user's account language (`preferred_language` from
|
|
300
|
+
* /v1/users/me) so the print UI matches the language chosen in the host app.
|
|
301
|
+
* An explicit `language` prop always wins. Requires an access token, so it
|
|
302
|
+
* runs after auth. Best-effort: on any failure the current language is kept.
|
|
303
|
+
*/
|
|
304
|
+
async syncPreferredLanguage() {
|
|
305
|
+
if (this.language)
|
|
306
|
+
return;
|
|
307
|
+
if (!authStore.state.accessToken)
|
|
308
|
+
return;
|
|
309
|
+
try {
|
|
310
|
+
const user = await new EzpUserService().getUserInfo();
|
|
311
|
+
const lang = user === null || user === void 0 ? void 0 : user.preferred_language;
|
|
312
|
+
if (lang && lang !== i18next.language) {
|
|
313
|
+
await i18next.changeLanguage(lang);
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
catch (_a) {
|
|
317
|
+
// Language sync is best-effort; keep the current language on failure.
|
|
318
|
+
}
|
|
253
319
|
}
|
|
254
320
|
componentDidLoad() {
|
|
255
|
-
this.refreshTokensPeriodically(
|
|
321
|
+
this.refreshTokensPeriodically(TOKEN_REFRESH_INTERVAL_S);
|
|
322
|
+
}
|
|
323
|
+
disconnectedCallback() {
|
|
324
|
+
var _a;
|
|
325
|
+
// Stop the periodic token refresh and the colour-scheme listener so they
|
|
326
|
+
// don't leak (and keep firing) after the component is removed.
|
|
327
|
+
if (this.tokenRefreshInterval) {
|
|
328
|
+
clearInterval(this.tokenRefreshInterval);
|
|
329
|
+
}
|
|
330
|
+
if (this.systemAppearanceQuery && this.systemAppearanceListener) {
|
|
331
|
+
this.systemAppearanceQuery.removeEventListener('change', this.systemAppearanceListener);
|
|
332
|
+
}
|
|
333
|
+
(_a = this.unsubscribeLanguage) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
256
334
|
}
|
|
257
335
|
/**
|
|
258
336
|
*
|
|
@@ -260,7 +338,7 @@ export class EzpPrinting {
|
|
|
260
338
|
*
|
|
261
339
|
*/
|
|
262
340
|
render() {
|
|
263
|
-
return (h(Host, { key: '
|
|
341
|
+
return (h(Host, { key: 'e25b56d55da0fdcc0485d5e07e176397f2503dde', class: `${userStore.state.theme} ${userStore.state.appearance === 'system'
|
|
264
342
|
? this.systemAppearance
|
|
265
343
|
: userStore.state.appearance} ${this.seamless ? 'seamless' : ''}` }, this.trigger === 'custom' ? (h("slot", null)) : this.trigger === 'file' ? (h("ezp-upload", null)) : (this.trigger === 'button' && (h("ezp-icon-button", { id: "print-trigger", icon: "printer", slot: "trigger", type: "button", onClick: () => this.open() }))), this.authOpen ? (h("ezp-auth", { clientID: this.clientid, redirectURI: this.redirecturi, hidelogin: this.hidelogin, trigger: this.trigger, code: this.code })) : this.printOpen ? (h("ezp-printer-selection", { clientID: this.clientid, redirectURI: this.redirecturi, filename: this.filename, fileurl: this.fileurl, filetype: this.filetype, fileid: this.fileid, files: this.files, hidemenu: this.hidemenu, hideheader: this.hideheader, seamless: this.seamless })) : this.noDocumentOpen ? (h("ezp-dialog", { heading: i18next.t('no_document_dialog.heading'), description: i18next.t('no_document_dialog.description'), action: i18next.t('no_document_dialog.action'), iconName: "question-mark", instance: "no-document-selected" })) : null));
|
|
266
344
|
}
|
|
@@ -691,8 +769,8 @@ export class EzpPrinting {
|
|
|
691
769
|
"text": "Events"
|
|
692
770
|
},
|
|
693
771
|
"complexType": {
|
|
694
|
-
"original": "
|
|
695
|
-
"resolved": "
|
|
772
|
+
"original": "void",
|
|
773
|
+
"resolved": "void",
|
|
696
774
|
"references": {}
|
|
697
775
|
}
|
|
698
776
|
}];
|
|
@@ -859,6 +937,12 @@ export class EzpPrinting {
|
|
|
859
937
|
"target": undefined,
|
|
860
938
|
"capture": false,
|
|
861
939
|
"passive": false
|
|
940
|
+
}, {
|
|
941
|
+
"name": "uploadContinue",
|
|
942
|
+
"method": "listenUploadContinue",
|
|
943
|
+
"target": undefined,
|
|
944
|
+
"capture": false,
|
|
945
|
+
"passive": false
|
|
862
946
|
}, {
|
|
863
947
|
"name": "dialogClose",
|
|
864
948
|
"method": "listenDialogClose",
|
|
@@ -5,35 +5,24 @@
|
|
|
5
5
|
*/
|
|
6
6
|
:host {
|
|
7
7
|
--ezp-select-duration: var(--ezp-duration-3);
|
|
8
|
+
--ezp-badge-gradient: linear-gradient(
|
|
9
|
+
135deg,
|
|
10
|
+
color-mix(in srgb, var(--ezp-theme-solid), white 14%) 0%,
|
|
11
|
+
color-mix(in srgb, var(--ezp-theme-solid), black 22%) 100%
|
|
12
|
+
);
|
|
8
13
|
display: block;
|
|
9
14
|
height: var(--ezp-select-toggle-height);
|
|
10
15
|
position: relative;
|
|
11
16
|
transition: var(--ezp-select-transition, z-index 0s var(--ezp-select-duration));
|
|
12
17
|
z-index: var(--ezp-select-zIndex, 3);
|
|
13
18
|
}
|
|
14
|
-
:host(:first-child) {
|
|
15
|
-
--ezp-select-wrap-borderRadius: 3px 3px 0 0;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
:host(:last-child) {
|
|
19
|
-
--ezp-select-wrap-borderRadius: 0 0 3px 3px;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
:host(:first-child:last-child) {
|
|
23
|
-
--ezp-select-wrap-borderRadius: 3px;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
:host(:not(:last-child):not(.is-expanded)) {
|
|
27
|
-
--ezp-select-wrap-boxShadowPositionBottom: 0 0 0 0;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
19
|
:host(.toggle-horizontal) {
|
|
31
|
-
--ezp-select-label-alignSelf:
|
|
20
|
+
--ezp-select-label-alignSelf: center;
|
|
32
21
|
--ezp-select-toggle-gridTemplateAreas: 'label value accessory';
|
|
33
22
|
--ezp-select-toggle-gridTemplateColumns: 1fr repeat(2, auto);
|
|
34
|
-
--ezp-select-toggle-height:
|
|
23
|
+
--ezp-select-toggle-height: 56px;
|
|
35
24
|
--ezp-select-toggle-gridTemplateRows: auto;
|
|
36
|
-
--ezp-select-value-alignSelf:
|
|
25
|
+
--ezp-select-value-alignSelf: center;
|
|
37
26
|
}
|
|
38
27
|
|
|
39
28
|
:host(.toggle-horizontal.has-icon) {
|
|
@@ -45,7 +34,7 @@
|
|
|
45
34
|
--ezp-select-label-alignSelf: center;
|
|
46
35
|
--ezp-select-toggle-gridTemplateAreas: 'label accessory' 'value accessory';
|
|
47
36
|
--ezp-select-toggle-gridTemplateColumns: 1fr auto;
|
|
48
|
-
--ezp-select-toggle-height:
|
|
37
|
+
--ezp-select-toggle-height: 64px;
|
|
49
38
|
--ezp-select-toggle-gridTemplateRows: repeat(2, auto);
|
|
50
39
|
--ezp-select-value-alignSelf: center;
|
|
51
40
|
}
|
|
@@ -58,52 +47,73 @@
|
|
|
58
47
|
:host(.option-horizontal) {
|
|
59
48
|
--ezp-select-details-gridTemplateColumns: repeat(2, 1fr);
|
|
60
49
|
--ezp-select-details-gridTemplateRows: auto;
|
|
61
|
-
--ezp-select-option-height:
|
|
50
|
+
--ezp-select-option-height: 44px;
|
|
62
51
|
}
|
|
63
52
|
|
|
64
53
|
:host(.option-vertical) {
|
|
65
54
|
--ezp-select-details-gridTemplateColumns: 1fr;
|
|
66
55
|
--ezp-select-details-gridTemplateRows: repeat(2, auto);
|
|
67
|
-
--ezp-select-option-height:
|
|
56
|
+
--ezp-select-option-height: 52px;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/* The printer selector reads as a solid, prominent badge (screen 3). */
|
|
60
|
+
:host(.toggle-vertical.has-icon) {
|
|
61
|
+
--ezp-select-badge-background: var(--ezp-badge-gradient);
|
|
62
|
+
--ezp-select-badge-color: var(--ezp-white-100);
|
|
63
|
+
--ezp-select-badge-height: 44px;
|
|
64
|
+
--ezp-select-badge-width: 44px;
|
|
65
|
+
--ezp-select-label-textTransform: uppercase;
|
|
66
|
+
--ezp-select-label-letterSpacing: 0.08em;
|
|
67
|
+
--ezp-select-label-fontSize: 11px;
|
|
68
|
+
--ezp-select-value-fontSize: 16px;
|
|
69
|
+
--ezp-select-value-fontWeight: 600;
|
|
70
|
+
--ezp-select-value-color: var(--ezp-core-foreground-primary);
|
|
68
71
|
}
|
|
69
72
|
|
|
70
73
|
:host(.is-expanded) {
|
|
71
74
|
--ezp-select-accessory-color: var(--ezp-theme-solid);
|
|
72
75
|
--ezp-select-transition: z-index 0s 0s;
|
|
73
76
|
--ezp-select-zIndex: 9999;
|
|
74
|
-
--ezp-select-icon-color: var(--ezp-theme-solid);
|
|
75
77
|
--ezp-select-label-color: var(--ezp-theme-solid);
|
|
76
|
-
--ezp-select-
|
|
78
|
+
--ezp-select-toggle-background: var(--ezp-theme-translucent);
|
|
79
|
+
--ezp-select-wrap-background: var(--ezp-core-surface-tertiary);
|
|
80
|
+
--ezp-select-wrap-borderRadius: 12px;
|
|
81
|
+
--ezp-select-wrap-boxShadow:
|
|
82
|
+
0 0 0 1px var(--ezp-core-outline), 0 16px 40px -16px var(--ezp-core-backdrop);
|
|
77
83
|
}
|
|
78
84
|
|
|
79
85
|
:host(.disabled) {
|
|
80
86
|
--ezp-select-accessory-color: var(--ezp-core-foreground-tertiary);
|
|
81
|
-
--ezp-select-
|
|
87
|
+
--ezp-select-badge-background: var(--ezp-core-shade-primary);
|
|
88
|
+
--ezp-select-badge-color: var(--ezp-core-foreground-tertiary);
|
|
82
89
|
--ezp-select-label-color: var(--ezp-core-foreground-tertiary);
|
|
83
90
|
--ezp-select-toggle-background-hover: transparent;
|
|
84
91
|
--ezp-select-toggle-cursor: default;
|
|
92
|
+
--ezp-select-value-color: var(--ezp-core-foreground-tertiary);
|
|
85
93
|
--value-color: var(--ezp-core-foreground-tertiary);
|
|
86
94
|
}
|
|
87
95
|
|
|
88
96
|
#wrap {
|
|
89
|
-
background: var(--ezp-
|
|
90
|
-
border-radius: var(--ezp-select-wrap-borderRadius,
|
|
91
|
-
box-shadow: var(--ezp-select-wrap-
|
|
97
|
+
background: var(--ezp-select-wrap-background, transparent);
|
|
98
|
+
border-radius: var(--ezp-select-wrap-borderRadius, 12px);
|
|
99
|
+
box-shadow: var(--ezp-select-wrap-boxShadow, none);
|
|
92
100
|
transform: translateY(var(--ezp-select-wrap-translateY, 0));
|
|
93
101
|
transition: transform var(--ezp-select-duration) var(--ezp-easing-out-quart), border-radius var(--ezp-select-duration) var(--ezp-easing-out-quart), box-shadow var(--ezp-select-duration) var(--ezp-easing-out-quart);
|
|
94
102
|
}
|
|
95
103
|
|
|
96
104
|
#toggle {
|
|
97
105
|
background: var(--ezp-select-toggle-background, transparent);
|
|
106
|
+
border-radius: var(--ezp-select-wrap-borderRadius, 12px);
|
|
98
107
|
box-sizing: border-box;
|
|
99
108
|
cursor: var(--ezp-select-toggle-cursor, pointer);
|
|
100
109
|
display: grid;
|
|
101
|
-
gap:
|
|
110
|
+
gap: 2px var(--ezp-spacing-3);
|
|
102
111
|
grid-template-areas: var(--ezp-select-toggle-gridTemplateAreas, none);
|
|
103
112
|
grid-template-columns: var(--ezp-select-toggle-gridTemplateColumns, none);
|
|
104
113
|
grid-template-rows: var(--ezp-select-toggle-gridTemplateRows, auto);
|
|
105
114
|
height: var(--ezp-select-toggle-height, auto);
|
|
106
|
-
padding: var(--ezp-spacing-3);
|
|
115
|
+
padding: var(--ezp-spacing-2) var(--ezp-spacing-3);
|
|
116
|
+
transition: background-color var(--ezp-duration-2) var(--ezp-easing-out-quart);
|
|
107
117
|
}
|
|
108
118
|
#toggle:hover {
|
|
109
119
|
--ezp-select-toggle-background: var(
|
|
@@ -113,29 +123,37 @@
|
|
|
113
123
|
}
|
|
114
124
|
|
|
115
125
|
#icon {
|
|
126
|
+
--ezp-icon-background: var(--ezp-select-badge-background, var(--ezp-theme-translucent));
|
|
127
|
+
--ezp-icon-borderRadius: 50%;
|
|
128
|
+
--ezp-icon-height: var(--ezp-select-badge-height, 40px);
|
|
129
|
+
--ezp-icon-width: var(--ezp-select-badge-width, 40px);
|
|
116
130
|
align-self: center;
|
|
117
|
-
color: var(--ezp-select-
|
|
131
|
+
color: var(--ezp-select-badge-color, var(--ezp-theme-solid));
|
|
118
132
|
grid-area: icon;
|
|
119
|
-
margin: calc(var(--ezp-spacing-2) * -1) 0;
|
|
120
133
|
}
|
|
121
134
|
|
|
122
135
|
#label {
|
|
136
|
+
--ezp-label-fontSize: var(--ezp-select-label-fontSize, 14px);
|
|
137
|
+
--ezp-label-letterSpacing: var(--ezp-select-label-letterSpacing, normal);
|
|
123
138
|
align-self: var(--ezp-select-label-alignSelf, auto);
|
|
124
|
-
color: var(--ezp-select-label-color, var(--ezp-core-foreground-
|
|
139
|
+
color: var(--ezp-select-label-color, var(--ezp-core-foreground-primary));
|
|
125
140
|
grid-area: label;
|
|
141
|
+
text-transform: var(--ezp-select-label-textTransform, none);
|
|
126
142
|
}
|
|
127
143
|
|
|
128
144
|
#value {
|
|
145
|
+
--ezp-label-fontSize: var(--ezp-select-value-fontSize, 14px);
|
|
146
|
+
--ezp-label-fontWeight: var(--ezp-select-value-fontWeight, 400);
|
|
129
147
|
align-self: var(--ezp-select-value-alignSelf, auto);
|
|
130
|
-
color: var(--value-color, var(--ezp-core-foreground-
|
|
148
|
+
color: var(--ezp-select-value-color, var(--value-color, var(--ezp-core-foreground-secondary)));
|
|
131
149
|
grid-area: value;
|
|
150
|
+
text-align: right;
|
|
132
151
|
}
|
|
133
152
|
|
|
134
153
|
#accessory {
|
|
135
154
|
align-self: center;
|
|
136
|
-
color: var(--ezp-select-accessory-color, var(--ezp-core-foreground-
|
|
155
|
+
color: var(--ezp-select-accessory-color, var(--ezp-core-foreground-tertiary));
|
|
137
156
|
grid-area: accessory;
|
|
138
|
-
margin: calc(var(--ezp-spacing-2) * -1) 0;
|
|
139
157
|
}
|
|
140
158
|
|
|
141
159
|
#list {
|
|
@@ -167,8 +185,8 @@
|
|
|
167
185
|
.option.is-selected {
|
|
168
186
|
--ezp-select-indicator-opacity: 1;
|
|
169
187
|
--ezp-select-indicator-transform: translateX(0);
|
|
170
|
-
--ezp-select-indicator-transition:
|
|
171
|
-
|
|
188
|
+
--ezp-select-indicator-transition:
|
|
189
|
+
opacity var(--ezp-select-duration) var(--ezp-easing-out-quart),
|
|
172
190
|
transform var(--ezp-select-duration) var(--ezp-easing-out-quart), visibility 0s 0s;
|
|
173
191
|
--ezp-select-indicator-visibility: visible;
|
|
174
192
|
}
|