@ezeep/ezeep-js 1.0.142 → 1.0.146

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.
Files changed (163) hide show
  1. package/dist/cjs/ezeep.cjs.js +2 -2
  2. package/dist/cjs/ezp-auth_14.cjs.entry.js +33752 -0
  3. package/dist/cjs/{index-a93095ed.js → index-62fc857c.js} +7 -0
  4. package/dist/cjs/loader.cjs.js +2 -2
  5. package/dist/collection/collection-manifest.json +3 -1
  6. package/dist/collection/components/ezp-auth/ezp-auth.css +3 -77
  7. package/dist/collection/components/ezp-auth/ezp-auth.js +26 -20
  8. package/dist/collection/components/ezp-backdrop/ezp-backdrop.css +3 -3
  9. package/dist/collection/components/ezp-dialog/ezp-dialog.css +48 -0
  10. package/dist/collection/components/ezp-dialog/ezp-dialog.js +220 -0
  11. package/dist/collection/components/ezp-icon/assets/glyph-account.svg +2 -2
  12. package/dist/collection/components/ezp-icon/assets/glyph-checkmark-alt.svg +3 -0
  13. package/dist/collection/components/ezp-icon/assets/glyph-checkmark.svg +2 -2
  14. package/dist/collection/components/ezp-icon/assets/glyph-close.svg +2 -2
  15. package/dist/collection/components/ezp-icon/assets/glyph-color.svg +2 -2
  16. package/dist/collection/components/ezp-icon/assets/glyph-copies.svg +2 -2
  17. package/dist/collection/components/ezp-icon/assets/glyph-dark.svg +2 -2
  18. package/dist/collection/components/ezp-icon/assets/glyph-drag-drop.svg +3 -0
  19. package/dist/collection/components/ezp-icon/assets/glyph-duplex.svg +2 -2
  20. package/dist/collection/components/ezp-icon/assets/glyph-exclamation-mark.svg +3 -0
  21. package/dist/collection/components/ezp-icon/assets/glyph-expand.svg +2 -2
  22. package/dist/collection/components/ezp-icon/assets/glyph-help.svg +2 -2
  23. package/dist/collection/components/ezp-icon/assets/glyph-light.svg +2 -2
  24. package/dist/collection/components/ezp-icon/assets/glyph-logo.svg +3 -0
  25. package/dist/collection/components/ezp-icon/assets/glyph-logout.svg +2 -2
  26. package/dist/collection/components/ezp-icon/assets/glyph-menu.svg +2 -2
  27. package/dist/collection/components/ezp-icon/assets/glyph-minus.svg +2 -2
  28. package/dist/collection/components/ezp-icon/assets/glyph-orientation.svg +2 -2
  29. package/dist/collection/components/ezp-icon/assets/glyph-plus.svg +2 -2
  30. package/dist/collection/components/ezp-icon/assets/glyph-printer.svg +2 -2
  31. package/dist/collection/components/ezp-icon/assets/glyph-quality.svg +2 -2
  32. package/dist/collection/components/ezp-icon/assets/glyph-question-mark.svg +3 -0
  33. package/dist/collection/components/ezp-icon/assets/glyph-size.svg +2 -2
  34. package/dist/collection/components/ezp-icon/assets/glyph-system.svg +2 -2
  35. package/dist/collection/components/ezp-icon/ezp-icon.css +25 -9
  36. package/dist/collection/components/ezp-icon/ezp-icon.js +23 -3
  37. package/dist/collection/components/ezp-icon-button/ezp-icon-button.css +43 -34
  38. package/dist/collection/components/ezp-icon-button/ezp-icon-button.js +1 -1
  39. package/dist/collection/components/ezp-label/ezp-label.css +32 -32
  40. package/dist/collection/components/ezp-printer-selection/ezp-printer-selection.css +21 -27
  41. package/dist/collection/components/ezp-printer-selection/ezp-printer-selection.js +280 -302
  42. package/dist/collection/components/ezp-printing/ezp-printing.css +175 -273
  43. package/dist/collection/components/ezp-printing/ezp-printing.js +111 -13
  44. package/dist/collection/components/ezp-select/ezp-select.css +98 -151
  45. package/dist/collection/components/ezp-select/ezp-select.js +51 -20
  46. package/dist/collection/components/ezp-status/ezp-status.css +111 -0
  47. package/dist/collection/components/ezp-status/ezp-status.js +236 -0
  48. package/dist/collection/components/ezp-stepper/ezp-stepper.css +21 -21
  49. package/dist/collection/components/ezp-stepper/ezp-stepper.js +1 -1
  50. package/dist/collection/components/ezp-text-button/ezp-text-button.css +44 -34
  51. package/dist/collection/components/ezp-text-button/ezp-text-button.js +22 -2
  52. package/dist/collection/components/ezp-upload/ezp-upload.css +67 -0
  53. package/dist/collection/components/ezp-upload/ezp-upload.js +121 -0
  54. package/dist/collection/components/ezp-user-menu/ezp-user-menu.css +75 -71
  55. package/dist/collection/components/ezp-user-menu/ezp-user-menu.js +12 -9
  56. package/dist/collection/services/print.js +50 -10
  57. package/dist/custom-elements/index.d.ts +18 -6
  58. package/dist/custom-elements/index.js +29055 -590
  59. package/dist/directives/proxies.ts +81 -25
  60. package/dist/esm/ezeep.js +2 -2
  61. package/dist/esm/ezp-auth_14.entry.js +33735 -0
  62. package/dist/esm/{index-9ecf6ae0.js → index-265d8cca.js} +7 -1
  63. package/dist/esm/loader.js +2 -2
  64. package/dist/esm-es5/ezeep.js +1 -1
  65. package/dist/esm-es5/ezp-auth_14.entry.js +21 -0
  66. package/dist/esm-es5/{index-9ecf6ae0.js → index-265d8cca.js} +1 -1
  67. package/dist/esm-es5/loader.js +1 -1
  68. package/dist/ezeep/assets/glyph-account.svg +2 -2
  69. package/dist/ezeep/assets/glyph-checkmark-alt.svg +3 -0
  70. package/dist/ezeep/assets/glyph-checkmark.svg +2 -2
  71. package/dist/ezeep/assets/glyph-close.svg +2 -2
  72. package/dist/ezeep/assets/glyph-color.svg +2 -2
  73. package/dist/ezeep/assets/glyph-copies.svg +2 -2
  74. package/dist/ezeep/assets/glyph-dark.svg +2 -2
  75. package/dist/ezeep/assets/glyph-drag-drop.svg +3 -0
  76. package/dist/ezeep/assets/glyph-duplex.svg +2 -2
  77. package/dist/ezeep/assets/glyph-exclamation-mark.svg +3 -0
  78. package/dist/ezeep/assets/glyph-expand.svg +2 -2
  79. package/dist/ezeep/assets/glyph-help.svg +2 -2
  80. package/dist/ezeep/assets/glyph-light.svg +2 -2
  81. package/dist/ezeep/assets/glyph-logo.svg +3 -0
  82. package/dist/ezeep/assets/glyph-logout.svg +2 -2
  83. package/dist/ezeep/assets/glyph-menu.svg +2 -2
  84. package/dist/ezeep/assets/glyph-minus.svg +2 -2
  85. package/dist/ezeep/assets/glyph-orientation.svg +2 -2
  86. package/dist/ezeep/assets/glyph-plus.svg +2 -2
  87. package/dist/ezeep/assets/glyph-printer.svg +2 -2
  88. package/dist/ezeep/assets/glyph-quality.svg +2 -2
  89. package/dist/ezeep/assets/glyph-question-mark.svg +3 -0
  90. package/dist/ezeep/assets/glyph-size.svg +2 -2
  91. package/dist/ezeep/assets/glyph-system.svg +2 -2
  92. package/dist/ezeep/ezeep.esm.js +1 -1
  93. package/dist/ezeep/ezeep.js +1 -1
  94. package/dist/ezeep/p-98ec6965.system.js +1 -0
  95. package/dist/ezeep/p-a1b0d17a.system.entry.js +21 -0
  96. package/dist/ezeep/p-a7b7b386.entry.js +15 -0
  97. package/dist/ezeep/p-f3065800.js +1 -0
  98. package/dist/ezeep/p-f89804ee.system.js +1 -0
  99. package/dist/types/components/ezp-auth/ezp-auth.d.ts +3 -2
  100. package/dist/types/components/ezp-dialog/ezp-dialog.d.ts +42 -0
  101. package/dist/types/components/ezp-icon/ezp-icon.d.ts +2 -0
  102. package/dist/types/components/ezp-printer-selection/ezp-printer-selection.d.ts +19 -1
  103. package/dist/types/components/ezp-printing/ezp-printing.d.ts +10 -3
  104. package/dist/types/components/ezp-select/ezp-select.d.ts +4 -0
  105. package/dist/types/components/ezp-status/ezp-status.d.ts +44 -0
  106. package/dist/types/components/ezp-text-button/ezp-text-button.d.ts +2 -0
  107. package/dist/types/components/ezp-upload/ezp-upload.d.ts +43 -0
  108. package/dist/types/components.d.ts +126 -21
  109. package/dist/types/services/print.d.ts +7 -2
  110. package/dist/types/shared/types.d.ts +15 -3
  111. package/package.json +12 -2
  112. package/readme.md +53 -17
  113. package/www/build/assets/glyph-account.svg +2 -2
  114. package/www/build/assets/glyph-checkmark-alt.svg +3 -0
  115. package/www/build/assets/glyph-checkmark.svg +2 -2
  116. package/www/build/assets/glyph-close.svg +2 -2
  117. package/www/build/assets/glyph-color.svg +2 -2
  118. package/www/build/assets/glyph-copies.svg +2 -2
  119. package/www/build/assets/glyph-dark.svg +2 -2
  120. package/www/build/assets/glyph-drag-drop.svg +3 -0
  121. package/www/build/assets/glyph-duplex.svg +2 -2
  122. package/www/build/assets/glyph-exclamation-mark.svg +3 -0
  123. package/www/build/assets/glyph-expand.svg +2 -2
  124. package/www/build/assets/glyph-help.svg +2 -2
  125. package/www/build/assets/glyph-light.svg +2 -2
  126. package/www/build/assets/glyph-logo.svg +3 -0
  127. package/www/build/assets/glyph-logout.svg +2 -2
  128. package/www/build/assets/glyph-menu.svg +2 -2
  129. package/www/build/assets/glyph-minus.svg +2 -2
  130. package/www/build/assets/glyph-orientation.svg +2 -2
  131. package/www/build/assets/glyph-plus.svg +2 -2
  132. package/www/build/assets/glyph-printer.svg +2 -2
  133. package/www/build/assets/glyph-quality.svg +2 -2
  134. package/www/build/assets/glyph-question-mark.svg +3 -0
  135. package/www/build/assets/glyph-size.svg +2 -2
  136. package/www/build/assets/glyph-system.svg +2 -2
  137. package/www/build/ezeep.esm.js +1 -1
  138. package/www/build/ezeep.js +1 -1
  139. package/www/build/p-98ec6965.system.js +1 -0
  140. package/www/build/p-a1b0d17a.system.entry.js +21 -0
  141. package/www/build/p-a7b7b386.entry.js +15 -0
  142. package/www/build/p-f3065800.js +1 -0
  143. package/www/build/p-f89804ee.system.js +1 -0
  144. package/www/data/file-types.json +68 -0
  145. package/www/data/locales/de.json +61 -30
  146. package/www/data/locales/en.json +61 -30
  147. package/www/index.html +27 -7
  148. package/dist/cjs/ezp-auth_12.cjs.entry.js +0 -5293
  149. package/dist/collection/components/ezp-progress/ezp-progress.css +0 -110
  150. package/dist/collection/components/ezp-progress/ezp-progress.js +0 -53
  151. package/dist/esm/ezp-auth_12.entry.js +0 -5278
  152. package/dist/esm-es5/ezp-auth_12.entry.js +0 -1
  153. package/dist/ezeep/p-c488ee3f.system.js +0 -1
  154. package/dist/ezeep/p-c7eac982.system.entry.js +0 -1
  155. package/dist/ezeep/p-c9ef1ce0.entry.js +0 -1
  156. package/dist/ezeep/p-eb3b8dbd.system.js +0 -1
  157. package/dist/ezeep/p-ff843eb4.js +0 -1
  158. package/dist/types/components/ezp-progress/ezp-progress.d.ts +0 -15
  159. package/www/build/p-c488ee3f.system.js +0 -1
  160. package/www/build/p-c7eac982.system.entry.js +0 -1
  161. package/www/build/p-c9ef1ce0.entry.js +0 -1
  162. package/www/build/p-eb3b8dbd.system.js +0 -1
  163. 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: 'Manage Account',
11
+ title: i18next.t('user_menu.account'),
10
12
  icon: 'account',
11
13
  href: 'https://app.ezeep.com',
12
14
  },
13
15
  {
14
- title: 'Help & Support',
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: 'System', name: 'system' },
22
- { title: 'Light', name: 'light' },
23
- { title: 'Dark', name: 'dark' },
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: "strong", text: this.name }),
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: "Logout" }))),
95
+ h("ezp-label", { text: i18next.t('user_menu.logout') }))),
93
96
  h("div", { id: "theme" },
94
- h("ezp-label", { text: "Color Theme:", weight: "strong" }),
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", { text: "Appearance:", weight: "strong" }),
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;