@ezeep/ezeep-js 1.0.142 → 1.0.143
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 +2 -2
- package/dist/cjs/ezp-auth_14.cjs.entry.js +33750 -0
- package/dist/cjs/{index-a93095ed.js → index-62fc857c.js} +7 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +3 -1
- package/dist/collection/components/ezp-auth/ezp-auth.css +3 -77
- package/dist/collection/components/ezp-auth/ezp-auth.js +26 -20
- package/dist/collection/components/ezp-backdrop/ezp-backdrop.css +3 -3
- package/dist/collection/components/ezp-dialog/ezp-dialog.css +48 -0
- package/dist/collection/components/ezp-dialog/ezp-dialog.js +220 -0
- package/dist/collection/components/ezp-icon/assets/glyph-account.svg +2 -2
- package/dist/collection/components/ezp-icon/assets/glyph-checkmark-alt.svg +3 -0
- package/dist/collection/components/ezp-icon/assets/glyph-checkmark.svg +2 -2
- package/dist/collection/components/ezp-icon/assets/glyph-close.svg +2 -2
- package/dist/collection/components/ezp-icon/assets/glyph-color.svg +2 -2
- package/dist/collection/components/ezp-icon/assets/glyph-copies.svg +2 -2
- package/dist/collection/components/ezp-icon/assets/glyph-dark.svg +2 -2
- package/dist/collection/components/ezp-icon/assets/glyph-drag-drop.svg +3 -0
- package/dist/collection/components/ezp-icon/assets/glyph-duplex.svg +2 -2
- package/dist/collection/components/ezp-icon/assets/glyph-exclamation-mark.svg +3 -0
- package/dist/collection/components/ezp-icon/assets/glyph-expand.svg +2 -2
- package/dist/collection/components/ezp-icon/assets/glyph-help.svg +2 -2
- package/dist/collection/components/ezp-icon/assets/glyph-light.svg +2 -2
- package/dist/collection/components/ezp-icon/assets/glyph-logo.svg +3 -0
- package/dist/collection/components/ezp-icon/assets/glyph-logout.svg +2 -2
- package/dist/collection/components/ezp-icon/assets/glyph-menu.svg +2 -2
- package/dist/collection/components/ezp-icon/assets/glyph-minus.svg +2 -2
- package/dist/collection/components/ezp-icon/assets/glyph-orientation.svg +2 -2
- package/dist/collection/components/ezp-icon/assets/glyph-plus.svg +2 -2
- package/dist/collection/components/ezp-icon/assets/glyph-printer.svg +2 -2
- package/dist/collection/components/ezp-icon/assets/glyph-quality.svg +2 -2
- package/dist/collection/components/ezp-icon/assets/glyph-question-mark.svg +3 -0
- package/dist/collection/components/ezp-icon/assets/glyph-size.svg +2 -2
- package/dist/collection/components/ezp-icon/assets/glyph-system.svg +2 -2
- package/dist/collection/components/ezp-icon/ezp-icon.css +25 -9
- package/dist/collection/components/ezp-icon/ezp-icon.js +23 -3
- package/dist/collection/components/ezp-icon-button/ezp-icon-button.css +43 -34
- package/dist/collection/components/ezp-icon-button/ezp-icon-button.js +1 -1
- package/dist/collection/components/ezp-label/ezp-label.css +32 -32
- package/dist/collection/components/ezp-printer-selection/ezp-printer-selection.css +21 -27
- package/dist/collection/components/ezp-printer-selection/ezp-printer-selection.js +278 -302
- package/dist/collection/components/ezp-printing/ezp-printing.css +175 -273
- package/dist/collection/components/ezp-printing/ezp-printing.js +109 -13
- package/dist/collection/components/ezp-select/ezp-select.css +98 -151
- package/dist/collection/components/ezp-select/ezp-select.js +51 -20
- package/dist/collection/components/ezp-status/ezp-status.css +111 -0
- package/dist/collection/components/ezp-status/ezp-status.js +236 -0
- package/dist/collection/components/ezp-stepper/ezp-stepper.css +21 -21
- package/dist/collection/components/ezp-stepper/ezp-stepper.js +1 -1
- package/dist/collection/components/ezp-text-button/ezp-text-button.css +44 -34
- package/dist/collection/components/ezp-text-button/ezp-text-button.js +22 -2
- package/dist/collection/components/ezp-upload/ezp-upload.css +67 -0
- package/dist/collection/components/ezp-upload/ezp-upload.js +121 -0
- package/dist/collection/components/ezp-user-menu/ezp-user-menu.css +75 -71
- package/dist/collection/components/ezp-user-menu/ezp-user-menu.js +12 -9
- package/dist/collection/services/print.js +50 -10
- package/dist/custom-elements/index.d.ts +18 -6
- package/dist/custom-elements/index.js +29053 -590
- package/dist/directives/proxies.ts +81 -25
- package/dist/esm/ezeep.js +2 -2
- package/dist/esm/ezp-auth_14.entry.js +33733 -0
- package/dist/esm/{index-9ecf6ae0.js → index-265d8cca.js} +7 -1
- package/dist/esm/loader.js +2 -2
- package/dist/esm-es5/ezeep.js +1 -1
- package/dist/esm-es5/ezp-auth_14.entry.js +21 -0
- package/dist/esm-es5/{index-9ecf6ae0.js → index-265d8cca.js} +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/ezeep/assets/glyph-account.svg +2 -2
- package/dist/ezeep/assets/glyph-checkmark-alt.svg +3 -0
- package/dist/ezeep/assets/glyph-checkmark.svg +2 -2
- package/dist/ezeep/assets/glyph-close.svg +2 -2
- package/dist/ezeep/assets/glyph-color.svg +2 -2
- package/dist/ezeep/assets/glyph-copies.svg +2 -2
- package/dist/ezeep/assets/glyph-dark.svg +2 -2
- package/dist/ezeep/assets/glyph-drag-drop.svg +3 -0
- package/dist/ezeep/assets/glyph-duplex.svg +2 -2
- package/dist/ezeep/assets/glyph-exclamation-mark.svg +3 -0
- package/dist/ezeep/assets/glyph-expand.svg +2 -2
- package/dist/ezeep/assets/glyph-help.svg +2 -2
- package/dist/ezeep/assets/glyph-light.svg +2 -2
- package/dist/ezeep/assets/glyph-logo.svg +3 -0
- package/dist/ezeep/assets/glyph-logout.svg +2 -2
- package/dist/ezeep/assets/glyph-menu.svg +2 -2
- package/dist/ezeep/assets/glyph-minus.svg +2 -2
- package/dist/ezeep/assets/glyph-orientation.svg +2 -2
- package/dist/ezeep/assets/glyph-plus.svg +2 -2
- package/dist/ezeep/assets/glyph-printer.svg +2 -2
- package/dist/ezeep/assets/glyph-quality.svg +2 -2
- package/dist/ezeep/assets/glyph-question-mark.svg +3 -0
- package/dist/ezeep/assets/glyph-size.svg +2 -2
- package/dist/ezeep/assets/glyph-system.svg +2 -2
- package/dist/ezeep/ezeep.esm.js +1 -1
- package/dist/ezeep/ezeep.js +1 -1
- package/dist/ezeep/p-6d99f6f4.system.entry.js +21 -0
- package/dist/ezeep/p-972c2256.entry.js +15 -0
- package/dist/ezeep/p-98ec6965.system.js +1 -0
- package/dist/ezeep/p-f3065800.js +1 -0
- package/dist/ezeep/p-f89804ee.system.js +1 -0
- package/dist/types/components/ezp-auth/ezp-auth.d.ts +3 -2
- package/dist/types/components/ezp-dialog/ezp-dialog.d.ts +42 -0
- package/dist/types/components/ezp-icon/ezp-icon.d.ts +2 -0
- package/dist/types/components/ezp-printer-selection/ezp-printer-selection.d.ts +19 -1
- package/dist/types/components/ezp-printing/ezp-printing.d.ts +10 -3
- package/dist/types/components/ezp-select/ezp-select.d.ts +4 -0
- package/dist/types/components/ezp-status/ezp-status.d.ts +44 -0
- package/dist/types/components/ezp-text-button/ezp-text-button.d.ts +2 -0
- package/dist/types/components/ezp-upload/ezp-upload.d.ts +43 -0
- package/dist/types/components.d.ts +126 -21
- package/dist/types/services/print.d.ts +7 -2
- package/dist/types/shared/types.d.ts +15 -3
- package/package.json +12 -2
- package/readme.md +53 -17
- package/www/build/assets/glyph-account.svg +2 -2
- package/www/build/assets/glyph-checkmark-alt.svg +3 -0
- package/www/build/assets/glyph-checkmark.svg +2 -2
- package/www/build/assets/glyph-close.svg +2 -2
- package/www/build/assets/glyph-color.svg +2 -2
- package/www/build/assets/glyph-copies.svg +2 -2
- package/www/build/assets/glyph-dark.svg +2 -2
- package/www/build/assets/glyph-drag-drop.svg +3 -0
- package/www/build/assets/glyph-duplex.svg +2 -2
- package/www/build/assets/glyph-exclamation-mark.svg +3 -0
- package/www/build/assets/glyph-expand.svg +2 -2
- package/www/build/assets/glyph-help.svg +2 -2
- package/www/build/assets/glyph-light.svg +2 -2
- package/www/build/assets/glyph-logo.svg +3 -0
- package/www/build/assets/glyph-logout.svg +2 -2
- package/www/build/assets/glyph-menu.svg +2 -2
- package/www/build/assets/glyph-minus.svg +2 -2
- package/www/build/assets/glyph-orientation.svg +2 -2
- package/www/build/assets/glyph-plus.svg +2 -2
- package/www/build/assets/glyph-printer.svg +2 -2
- package/www/build/assets/glyph-quality.svg +2 -2
- package/www/build/assets/glyph-question-mark.svg +3 -0
- package/www/build/assets/glyph-size.svg +2 -2
- package/www/build/assets/glyph-system.svg +2 -2
- package/www/build/ezeep.esm.js +1 -1
- package/www/build/ezeep.js +1 -1
- package/www/build/p-6d99f6f4.system.entry.js +21 -0
- package/www/build/p-972c2256.entry.js +15 -0
- package/www/build/p-98ec6965.system.js +1 -0
- package/www/build/p-f3065800.js +1 -0
- package/www/build/p-f89804ee.system.js +1 -0
- package/www/data/file-types.json +68 -0
- package/www/data/locales/de.json +61 -30
- package/www/data/locales/en.json +61 -30
- package/www/index.html +27 -7
- package/dist/cjs/ezp-auth_12.cjs.entry.js +0 -5293
- package/dist/collection/components/ezp-progress/ezp-progress.css +0 -110
- package/dist/collection/components/ezp-progress/ezp-progress.js +0 -53
- package/dist/esm/ezp-auth_12.entry.js +0 -5278
- package/dist/esm-es5/ezp-auth_12.entry.js +0 -1
- package/dist/ezeep/p-c488ee3f.system.js +0 -1
- package/dist/ezeep/p-c7eac982.system.entry.js +0 -1
- package/dist/ezeep/p-c9ef1ce0.entry.js +0 -1
- package/dist/ezeep/p-eb3b8dbd.system.js +0 -1
- package/dist/ezeep/p-ff843eb4.js +0 -1
- package/dist/types/components/ezp-progress/ezp-progress.d.ts +0 -15
- package/www/build/p-c488ee3f.system.js +0 -1
- package/www/build/p-c7eac982.system.entry.js +0 -1
- package/www/build/p-c9ef1ce0.entry.js +0 -1
- package/www/build/p-eb3b8dbd.system.js +0 -1
- package/www/build/p-ff843eb4.js +0 -1
|
@@ -1,26 +1,28 @@
|
|
|
1
1
|
import { Component, Host, Prop, Event, Element, Watch, h } from '@stencil/core';
|
|
2
2
|
import authStore from '../../services/auth';
|
|
3
3
|
import userStore from '../../services/user';
|
|
4
|
+
import { initi18n } from '../../utils/utils';
|
|
5
|
+
import i18next from 'i18next';
|
|
4
6
|
export class EzpUserMenu {
|
|
5
7
|
constructor() {
|
|
6
8
|
this.backdrop = document.createElement('ezp-backdrop');
|
|
7
9
|
this.links = [
|
|
8
10
|
{
|
|
9
|
-
title: '
|
|
11
|
+
title: i18next.t('user_menu.account'),
|
|
10
12
|
icon: 'account',
|
|
11
13
|
href: 'https://app.ezeep.com',
|
|
12
14
|
},
|
|
13
15
|
{
|
|
14
|
-
title: '
|
|
16
|
+
title: i18next.t('user_menu.help'),
|
|
15
17
|
icon: 'help',
|
|
16
18
|
href: 'https://support.ezeep.com',
|
|
17
19
|
},
|
|
18
20
|
];
|
|
19
21
|
this.themes = ['pink', 'red', 'orange', 'green', 'cyan', 'blue', 'violet'];
|
|
20
22
|
this.appearances = [
|
|
21
|
-
{ title: '
|
|
22
|
-
{ title: '
|
|
23
|
-
{ title: '
|
|
23
|
+
{ title: i18next.t('user_menu.system'), name: 'system' },
|
|
24
|
+
{ title: i18next.t('user_menu.light'), name: 'light' },
|
|
25
|
+
{ title: i18next.t('user_menu.dark'), name: 'dark' },
|
|
24
26
|
];
|
|
25
27
|
this.name = 'John Doe';
|
|
26
28
|
this.open = false;
|
|
@@ -65,6 +67,7 @@ export class EzpUserMenu {
|
|
|
65
67
|
*
|
|
66
68
|
*/
|
|
67
69
|
componentWillLoad() {
|
|
70
|
+
initi18n();
|
|
68
71
|
this.container = this.component.closest('[data-backdrop-surface]');
|
|
69
72
|
this.backdrop.addEventListener('backdropHideStart', () => {
|
|
70
73
|
this.open = false;
|
|
@@ -81,7 +84,7 @@ export class EzpUserMenu {
|
|
|
81
84
|
render() {
|
|
82
85
|
return (h(Host, { class: this.open ? 'is-open' : '' },
|
|
83
86
|
h("div", { id: "header" },
|
|
84
|
-
h("ezp-label", { ellipsis: true, id: "name", weight: "
|
|
87
|
+
h("ezp-label", { ellipsis: true, id: "name", weight: "heavy", text: this.name }),
|
|
85
88
|
h("ezp-icon-button", { id: "close", level: "tertiary", icon: "close", onClick: this.handleClose })),
|
|
86
89
|
h("div", { id: "links" },
|
|
87
90
|
this.links.map((link) => (h("a", { class: "link", href: link.href, target: "_blank", rel: "noopener noreferrer" },
|
|
@@ -89,13 +92,13 @@ export class EzpUserMenu {
|
|
|
89
92
|
h("ezp-label", { text: link.title })))),
|
|
90
93
|
h("a", { class: "link", onClick: this.logOut },
|
|
91
94
|
h("ezp-icon", { class: "link__icon", name: "logout" }),
|
|
92
|
-
h("ezp-label", { text:
|
|
95
|
+
h("ezp-label", { text: i18next.t('user_menu.logout') }))),
|
|
93
96
|
h("div", { id: "theme" },
|
|
94
|
-
h("ezp-label", {
|
|
97
|
+
h("ezp-label", { class: "caption", text: `${i18next.t('user_menu.theme')}:`, weight: "heavy" }),
|
|
95
98
|
h("div", { id: "swatches" }, this.themes.map((theme) => (h("button", { class: `swatch swatch--${theme} ${theme === userStore.state.theme ? 'selected' : ''}`, onClick: () => this.handleTheme(theme) },
|
|
96
99
|
h("span", { class: "dot" })))))),
|
|
97
100
|
h("div", { id: "appearance" },
|
|
98
|
-
h("ezp-label", {
|
|
101
|
+
h("ezp-label", { class: "caption", text: `${i18next.t('user_menu.appearance')}:`, weight: "heavy" }),
|
|
99
102
|
h("div", { id: "tabs" }, this.appearances.map((appearance) => (h("button", { class: `tab ${appearance.name === userStore.state.appearance ? 'selected' : ''}`, onClick: () => this.handleAppearance(appearance.name) },
|
|
100
103
|
h("ezp-icon", { name: appearance.name }),
|
|
101
104
|
h("ezp-label", { text: appearance.title, level: "tertiary", weight: "strong" }))))))));
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { createStore } from '@stencil/store';
|
|
2
2
|
import authStore, { EzpAuthorizationService } from './auth';
|
|
3
3
|
import fetchIntercept from 'fetch-intercept';
|
|
4
|
+
import { AnonymousCredential, BlockBlobClient, newPipeline } from '@azure/storage-blob';
|
|
4
5
|
export class EzpPrintService {
|
|
5
6
|
constructor(redirectURI, clientID) {
|
|
6
7
|
this.getPrintStatus = () => {
|
|
@@ -63,20 +64,12 @@ export class EzpPrintService {
|
|
|
63
64
|
},
|
|
64
65
|
}).then((response) => response.json());
|
|
65
66
|
}
|
|
66
|
-
getConfig(accessToken) {
|
|
67
|
+
async getConfig(accessToken) {
|
|
67
68
|
return fetch(`https://${this.printingApi}/sfapi/GetConfiguration/`, {
|
|
68
69
|
method: 'GET',
|
|
69
70
|
headers: {
|
|
70
71
|
Authorization: 'Bearer ' + accessToken,
|
|
71
72
|
},
|
|
72
|
-
}).then((response) => {
|
|
73
|
-
if (response.ok) {
|
|
74
|
-
authStore.state.isAuthorized = true;
|
|
75
|
-
}
|
|
76
|
-
if (!response.ok) {
|
|
77
|
-
throw new Error('http status ' + response.status);
|
|
78
|
-
}
|
|
79
|
-
return response.json();
|
|
80
73
|
});
|
|
81
74
|
}
|
|
82
75
|
getPrinterProperties(accessToken, printerID) {
|
|
@@ -117,7 +110,52 @@ export class EzpPrintService {
|
|
|
117
110
|
'Content-Type': 'application/json',
|
|
118
111
|
},
|
|
119
112
|
body: JSON.stringify(Object.assign(Object.assign(Object.assign({ fileid: fileID, type: fileType, printerid: printerID }, (filename && { alias: filename })), (printAndDelete && { printanddelete: printAndDelete })), { properties })),
|
|
113
|
+
}).then((response) => response.json());
|
|
114
|
+
}
|
|
115
|
+
prepareFileUpload(accessToken) {
|
|
116
|
+
return fetch(`https://${this.printingApi}/sfapi/PrepareUpload/`, {
|
|
117
|
+
method: 'GET',
|
|
118
|
+
headers: {
|
|
119
|
+
Authorization: 'Bearer ' + accessToken,
|
|
120
|
+
},
|
|
121
|
+
}).then((response) => response.json());
|
|
122
|
+
}
|
|
123
|
+
uploadFile(sasURI, formData) {
|
|
124
|
+
return fetch(`${sasURI}`, {
|
|
125
|
+
method: 'PUT',
|
|
126
|
+
headers: {
|
|
127
|
+
'x-ms-blob-type': 'BlockBlob',
|
|
128
|
+
'Content-Type:': 'multipart/form-data', // try and not set it, see if it does it automatically
|
|
129
|
+
},
|
|
130
|
+
body: formData,
|
|
131
|
+
}).then((response) => response.json());
|
|
132
|
+
}
|
|
133
|
+
async uploadBlobFiles(sasUri, file) {
|
|
134
|
+
printStore.state.uploadProgress = 0;
|
|
135
|
+
const pipeline = newPipeline(new AnonymousCredential(), {
|
|
136
|
+
retryOptions: { maxTries: 4 },
|
|
137
|
+
userAgentOptions: { userAgentPrefix: 'AdvancedSample V1.0.0' },
|
|
138
|
+
keepAliveOptions: {
|
|
139
|
+
// Keep alive is enabled by default, disable keep alive by setting false
|
|
140
|
+
enable: false,
|
|
141
|
+
},
|
|
142
|
+
});
|
|
143
|
+
const client = new BlockBlobClient(sasUri, pipeline);
|
|
144
|
+
// upload
|
|
145
|
+
// for (let index = 0; index < files.length; index++) {
|
|
146
|
+
// const file = files[index]
|
|
147
|
+
// console.log(response._response.status)
|
|
148
|
+
// }
|
|
149
|
+
const response = await client.uploadData(file, {
|
|
150
|
+
blockSize: 4 * 1024 * 1024,
|
|
151
|
+
concurrency: 20,
|
|
152
|
+
onProgress: (e) => {
|
|
153
|
+
let progress = (100 * e.loadedBytes) / file.size;
|
|
154
|
+
printStore.state.uploadProgress = progress;
|
|
155
|
+
},
|
|
156
|
+
blobHTTPHeaders: { blobContentType: file.type },
|
|
120
157
|
});
|
|
158
|
+
return response;
|
|
121
159
|
}
|
|
122
160
|
}
|
|
123
161
|
const printStore = createStore({
|
|
@@ -130,6 +168,8 @@ const printStore = createStore({
|
|
|
130
168
|
fileUrl: '',
|
|
131
169
|
fileType: '',
|
|
132
170
|
printerID: '',
|
|
133
|
-
fileName: ''
|
|
171
|
+
fileName: '',
|
|
172
|
+
uploadProgress: 0,
|
|
173
|
+
supportedFileExtensions: '',
|
|
134
174
|
});
|
|
135
175
|
export default printStore;
|
|
@@ -14,6 +14,12 @@ export const EzpBackdrop: {
|
|
|
14
14
|
new (): EzpBackdrop;
|
|
15
15
|
};
|
|
16
16
|
|
|
17
|
+
interface EzpDialog extends Components.EzpDialog, HTMLElement {}
|
|
18
|
+
export const EzpDialog: {
|
|
19
|
+
prototype: EzpDialog;
|
|
20
|
+
new (): EzpDialog;
|
|
21
|
+
};
|
|
22
|
+
|
|
17
23
|
interface EzpIcon extends Components.EzpIcon, HTMLElement {}
|
|
18
24
|
export const EzpIcon: {
|
|
19
25
|
prototype: EzpIcon;
|
|
@@ -44,18 +50,18 @@ export const EzpPrinting: {
|
|
|
44
50
|
new (): EzpPrinting;
|
|
45
51
|
};
|
|
46
52
|
|
|
47
|
-
interface EzpProgress extends Components.EzpProgress, HTMLElement {}
|
|
48
|
-
export const EzpProgress: {
|
|
49
|
-
prototype: EzpProgress;
|
|
50
|
-
new (): EzpProgress;
|
|
51
|
-
};
|
|
52
|
-
|
|
53
53
|
interface EzpSelect extends Components.EzpSelect, HTMLElement {}
|
|
54
54
|
export const EzpSelect: {
|
|
55
55
|
prototype: EzpSelect;
|
|
56
56
|
new (): EzpSelect;
|
|
57
57
|
};
|
|
58
58
|
|
|
59
|
+
interface EzpStatus extends Components.EzpStatus, HTMLElement {}
|
|
60
|
+
export const EzpStatus: {
|
|
61
|
+
prototype: EzpStatus;
|
|
62
|
+
new (): EzpStatus;
|
|
63
|
+
};
|
|
64
|
+
|
|
59
65
|
interface EzpStepper extends Components.EzpStepper, HTMLElement {}
|
|
60
66
|
export const EzpStepper: {
|
|
61
67
|
prototype: EzpStepper;
|
|
@@ -68,6 +74,12 @@ export const EzpTextButton: {
|
|
|
68
74
|
new (): EzpTextButton;
|
|
69
75
|
};
|
|
70
76
|
|
|
77
|
+
interface EzpUpload extends Components.EzpUpload, HTMLElement {}
|
|
78
|
+
export const EzpUpload: {
|
|
79
|
+
prototype: EzpUpload;
|
|
80
|
+
new (): EzpUpload;
|
|
81
|
+
};
|
|
82
|
+
|
|
71
83
|
interface EzpUserMenu extends Components.EzpUserMenu, HTMLElement {}
|
|
72
84
|
export const EzpUserMenu: {
|
|
73
85
|
prototype: EzpUserMenu;
|