@schukai/monster 4.1.0 → 4.1.2

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/CHANGELOG.md CHANGED
@@ -2,6 +2,25 @@
2
2
 
3
3
 
4
4
 
5
+ ## [4.1.2] - 2025-05-11
6
+
7
+ ### Bug Fixes
8
+
9
+ - Improved code formatting for clarity in camera-capture component
10
+ ### Changes
11
+
12
+ - update doc
13
+
14
+
15
+
16
+ ## [4.1.1] - 2025-05-11
17
+
18
+ ### Bug Fixes
19
+
20
+ - Modify PDF object tag for clearer intent
21
+
22
+
23
+
5
24
  ## [4.1.0] - 2025-05-11
6
25
 
7
26
  ### Add Features
package/package.json CHANGED
@@ -1 +1 @@
1
- {"author":"schukai GmbH","dependencies":{"@floating-ui/dom":"^1.7.0","@popperjs/core":"^2.11.8"},"description":"Monster is a simple library for creating fast, robust and lightweight websites.","homepage":"https://monsterjs.org/","keywords":["framework","web","dom","css","sass","mobile-first","app","front-end","templates","schukai","core","shopcloud","alvine","monster","buildmap","stack","observer","observable","uuid","node","nodelist","css-in-js","logger","log","theme"],"license":"AGPL 3.0","main":"source/monster.mjs","module":"source/monster.mjs","name":"@schukai/monster","repository":{"type":"git","url":"https://gitlab.schukai.com/oss/libraries/javascript/monster.git"},"type":"module","version":"4.1.0"}
1
+ {"author":"schukai GmbH","dependencies":{"@floating-ui/dom":"^1.7.0","@popperjs/core":"^2.11.8"},"description":"Monster is a simple library for creating fast, robust and lightweight websites.","homepage":"https://monsterjs.org/","keywords":["framework","web","dom","css","sass","mobile-first","app","front-end","templates","schukai","core","shopcloud","alvine","monster","buildmap","stack","observer","observable","uuid","node","nodelist","css-in-js","logger","log","theme"],"license":"AGPL 3.0","main":"source/monster.mjs","module":"source/monster.mjs","name":"@schukai/monster","repository":{"type":"git","url":"https://gitlab.schukai.com/oss/libraries/javascript/monster.git"},"type":"module","version":"4.1.2"}
@@ -12,21 +12,22 @@
12
12
  * SPDX-License-Identifier: AGPL-3.0
13
13
  */
14
14
 
15
- import { instanceSymbol } from "../../constants.mjs";
16
- import { ATTRIBUTE_ROLE } from "../../dom/constants.mjs";
17
- import { CustomElement } from "../../dom/customelement.mjs";
15
+ import {instanceSymbol} from "../../constants.mjs";
16
+ import {ATTRIBUTE_ROLE} from "../../dom/constants.mjs";
17
+ import {CustomElement} from "../../dom/customelement.mjs";
18
18
  import {
19
- assembleMethodSymbol,
20
- registerCustomElement,
19
+ assembleMethodSymbol,
20
+ registerCustomElement,
21
21
  } from "../../dom/customelement.mjs";
22
- import { CameraCaptureStyleSheet } from "./stylesheet/camera-capture.mjs";
22
+ import {CameraCaptureStyleSheet} from "./stylesheet/camera-capture.mjs";
23
23
  import "../form/button.mjs";
24
24
  import "../state/state.mjs";
25
- import { getLocaleOfDocument } from "../../dom/locale.mjs";
26
- import { addErrorAttribute } from "../../dom/error.mjs";
27
- import { Queue } from "../../types/queue.mjs";
25
+ import {getLocaleOfDocument} from "../../dom/locale.mjs";
26
+ import {addErrorAttribute} from "../../dom/error.mjs";
27
+ import {Queue} from "../../types/queue.mjs";
28
+ import {fireCustomEvent} from "../../dom/events.mjs";
28
29
 
29
- export { CameraCapture };
30
+ export {CameraCapture};
30
31
 
31
32
  /**
32
33
  * @private
@@ -74,150 +75,151 @@ const emptyHistoryStateElementSymbol = Symbol("emptyHistoryStateElement");
74
75
  * @since 3.111.0
75
76
  * @copyright schukai GmbH
76
77
  * @summary A simple but powerful camera capture component. It can be used to capture images from the camera.
78
+ * @fires monster-camera-capture-take-picture
77
79
  */
78
80
  class CameraCapture extends CustomElement {
79
- /**
80
- * Constructor for the CameraCapture class.
81
- * Calls the parent class constructor.
82
- */
83
- constructor() {
84
- super();
85
-
86
- this[queueSymbol] = new Queue();
87
- }
88
-
89
- /**
90
- * This method is called by the `instanceof` operator.
91
- * @return {symbol}
92
- */
93
- static get [instanceSymbol]() {
94
- return Symbol.for(
95
- "@schukai/monster/components/content/camera-capture@instance",
96
- );
97
- }
98
-
99
- /**
100
- *
101
- * @return {Components.Content.Copy
102
- */
103
- [assembleMethodSymbol]() {
104
- super[assembleMethodSymbol]();
105
- initControlReferences.call(this);
106
- initEventHandler.call(this);
107
- initCameraControl.call(this);
108
- return this;
109
- }
110
-
111
- /**
112
- * To set the options via the HTML Tag, the attribute `data-monster-options` must be used.
113
- * @see {@link https://monsterjs.org/en/doc/#configurate-a-monster-control}
114
- *
115
- * The individual configuration values can be found in the table.
116
- *
117
- * @property {Object} templates Template definitions
118
- * @property {string} templates.main Main template
119
- * @property {Object} actions Callbacks
120
- * @property {string} actions.click="throw Error" Callback when clicked
121
- * @property {Object} features Features
122
- * @property {boolean} features.stripTags=true Strip tags from the copied text
123
- * @property {boolean} features.preventOpenEventSent=false Prevent open event from being sent
124
- * @property {Object} popper Popper configuration
125
- * @property {string} popper.placement="top" Popper placement
126
- * @property {string[]} popper.middleware=["autoPlacement", "shift", "offset:15", "arrow"] Popper middleware
127
- * @property {boolean} disabled=false Disabled state
128
- */
129
- get defaults() {
130
- return Object.assign({}, super.defaults, {
131
- templates: {
132
- main: getTemplate(),
133
- },
134
-
135
- disabled: false,
136
- features: {},
137
-
138
- labels: getTranslations(),
139
- });
140
- }
141
-
142
- /**
143
- * @return {string}
144
- */
145
- static getTag() {
146
- return "monster-camera-capture";
147
- }
148
-
149
- /**
150
- * @return {CSSStyleSheet[]}
151
- */
152
- static getCSSStyleSheet() {
153
- return [CameraCaptureStyleSheet];
154
- }
155
-
156
- /**
157
- * Retrieve the next image from the queue.
158
- * If the queue is empty, it returns `null`.
159
- * @returns {string|null}
160
- */
161
- getNextImage() {
162
- if (!this[queueSymbol].isEmpty()) {
163
- const next = this[queueSymbol].poll();
164
- if (!next) {
165
- return null;
166
- }
167
- return next;
168
- }
169
- return null;
170
- }
171
-
172
- /**
173
- * Capture an image from the camera and add it to the queue.
174
- * The image is returned as a data URL.
175
- * @returns {string}
176
- */
177
- capture() {
178
- this[canvasElementSymbol].width = this[videoElementSymbol].videoWidth;
179
- this[canvasElementSymbol].height = this[videoElementSymbol].videoHeight;
180
- const ctx = this[canvasElementSymbol].getContext("2d");
181
- ctx.drawImage(
182
- this[videoElementSymbol],
183
- 0,
184
- 0,
185
- this[canvasElementSymbol].width,
186
- this[canvasElementSymbol].height,
187
- );
188
- const dataURL = this[canvasElementSymbol].toDataURL("image/png");
189
- this[queueSymbol].add(dataURL);
190
- return dataURL;
191
- }
81
+ /**
82
+ * Constructor for the CameraCapture class.
83
+ * Calls the parent class constructor.
84
+ */
85
+ constructor() {
86
+ super();
87
+
88
+ this[queueSymbol] = new Queue();
89
+ }
90
+
91
+ /**
92
+ * This method is called by the `instanceof` operator.
93
+ * @return {symbol}
94
+ */
95
+ static get [instanceSymbol]() {
96
+ return Symbol.for(
97
+ "@schukai/monster/components/content/camera-capture@instance",
98
+ );
99
+ }
100
+
101
+ /**
102
+ *
103
+ * @return {Components.Content.Copy
104
+ */
105
+ [assembleMethodSymbol]() {
106
+ super[assembleMethodSymbol]();
107
+ initControlReferences.call(this);
108
+ initEventHandler.call(this);
109
+ initCameraControl.call(this);
110
+ return this;
111
+ }
112
+
113
+ /**
114
+ * To set the options via the HTML Tag, the attribute `data-monster-options` must be used.
115
+ * @see {@link https://monsterjs.org/en/doc/#configurate-a-monster-control}
116
+ *
117
+ * The individual configuration values can be found in the table.
118
+ *
119
+ * @property {Object} templates Template definitions
120
+ * @property {string} templates.main Main template
121
+ * @property {Object} actions Callbacks
122
+ * @property {string} actions.click="throw Error" Callback when clicked
123
+ * @property {Object} features Features
124
+ * @property {boolean} features.stripTags=true Strip tags from the copied text
125
+ * @property {boolean} features.preventOpenEventSent=false Prevent open event from being sent
126
+ * @property {Object} popper Popper configuration
127
+ * @property {string} popper.placement="top" Popper placement
128
+ * @property {string[]} popper.middleware=["autoPlacement", "shift", "offset:15", "arrow"] Popper middleware
129
+ * @property {boolean} disabled=false Disabled state
130
+ */
131
+ get defaults() {
132
+ return Object.assign({}, super.defaults, {
133
+ templates: {
134
+ main: getTemplate(),
135
+ },
136
+
137
+ disabled: false,
138
+ features: {},
139
+
140
+ labels: getTranslations(),
141
+ });
142
+ }
143
+
144
+ /**
145
+ * @return {string}
146
+ */
147
+ static getTag() {
148
+ return "monster-camera-capture";
149
+ }
150
+
151
+ /**
152
+ * @return {CSSStyleSheet[]}
153
+ */
154
+ static getCSSStyleSheet() {
155
+ return [CameraCaptureStyleSheet];
156
+ }
157
+
158
+ /**
159
+ * Retrieve the next image from the queue.
160
+ * If the queue is empty, it returns `null`.
161
+ * @returns {string|null}
162
+ */
163
+ getNextImage() {
164
+ if (!this[queueSymbol].isEmpty()) {
165
+ const next = this[queueSymbol].poll();
166
+ if (!next) {
167
+ return null;
168
+ }
169
+ return next;
170
+ }
171
+ return null;
172
+ }
173
+
174
+ /**
175
+ * Capture an image from the camera and add it to the queue.
176
+ * The image is returned as a data URL.
177
+ * @returns {string}
178
+ */
179
+ capture() {
180
+ this[canvasElementSymbol].width = this[videoElementSymbol].videoWidth;
181
+ this[canvasElementSymbol].height = this[videoElementSymbol].videoHeight;
182
+ const ctx = this[canvasElementSymbol].getContext("2d");
183
+ ctx.drawImage(
184
+ this[videoElementSymbol],
185
+ 0,
186
+ 0,
187
+ this[canvasElementSymbol].width,
188
+ this[canvasElementSymbol].height,
189
+ );
190
+ const dataURL = this[canvasElementSymbol].toDataURL("image/png");
191
+ this[queueSymbol].add(dataURL);
192
+ return dataURL;
193
+ }
192
194
  }
193
195
 
194
196
  /**
195
197
  * @private
196
198
  */
197
199
  function initCameraControl() {
198
- const self = this;
199
-
200
- if (
201
- !navigator ||
202
- !navigator.mediaDevices ||
203
- !navigator.mediaDevices.getUserMedia
204
- ) {
205
- addErrorAttribute(self, "Browser not supported");
206
- return;
207
- }
208
-
209
- navigator.mediaDevices
210
- .getUserMedia({ video: true })
211
- .then(function (stream) {
212
- self[takePictureButtonElementSymbol].style.display = "block";
213
- self[videoElementSymbol].style.display = "block";
214
- self[emptyHistoryStateElementSymbol].style.display = "none";
215
-
216
- self[videoElementSymbol].srcObject = stream;
217
- })
218
- .catch(function (e) {
219
- addErrorAttribute(self, e);
220
- });
200
+ const self = this;
201
+
202
+ if (
203
+ !navigator ||
204
+ !navigator.mediaDevices ||
205
+ !navigator.mediaDevices.getUserMedia
206
+ ) {
207
+ addErrorAttribute(self, "Browser not supported");
208
+ return;
209
+ }
210
+
211
+ navigator.mediaDevices
212
+ .getUserMedia({video: true})
213
+ .then(function (stream) {
214
+ self[takePictureButtonElementSymbol].style.display = "block";
215
+ self[videoElementSymbol].style.display = "block";
216
+ self[emptyHistoryStateElementSymbol].style.display = "none";
217
+
218
+ self[videoElementSymbol].srcObject = stream;
219
+ })
220
+ .catch(function (e) {
221
+ addErrorAttribute(self, e);
222
+ });
221
223
  }
222
224
 
223
225
  /**
@@ -225,161 +227,166 @@ function initCameraControl() {
225
227
  * @returns {{takePicture: string}}
226
228
  */
227
229
  function getTranslations() {
228
- const locale = getLocaleOfDocument();
229
- switch (locale.language) {
230
- case "de":
231
- return {
232
- takePicture: "Bild aufnehmen",
233
- cameraNotSupportedOrNotAllowed:
234
- "Die Kamera wird nicht unterstützt oder die Berechtigung wurde nicht erteilt.",
235
- };
236
-
237
- case "es":
238
- return {
239
- takePicture: "Tomar una foto",
240
- cameraNotSupportedOrNotAllowed:
241
- "La cámara no es compatible o no se ha otorgado permiso.",
242
- };
243
-
244
- case "zh":
245
- return {
246
- takePicture: "拍照",
247
- cameraNotSupportedOrNotAllowed: "相机不受支持或未授予权限。",
248
- };
249
-
250
- case "hi":
251
- return {
252
- takePicture: "तस्वीर खींचें",
253
- cameraNotSupportedOrNotAllowed:
254
- "कैमरा समर्थित नहीं है या अनुमति नहीं दी गई है।",
255
- };
256
-
257
- case "bn":
258
- return {
259
- takePicture: "ছবি তুলুন",
260
- cameraNotSupportedOrNotAllowed: "ক্যামেরা সমর্থিত নয় বা অনুমতি দেয়া হয়নি।",
261
- };
262
-
263
- case "pt":
264
- return {
265
- takePicture: "Tirar uma foto",
266
- cameraNotSupportedOrNotAllowed:
267
- "A câmera não é suportada ou a permissão não foi concedida.",
268
- };
269
-
270
- case "ru":
271
- return {
272
- takePicture: "Сделать фото",
273
- cameraNotSupportedOrNotAllowed:
274
- "Камера не поддерживается или разрешение не предоставлено.",
275
- };
276
-
277
- case "ja":
278
- return {
279
- takePicture: "写真を撮る",
280
- cameraNotSupportedOrNotAllowed:
281
- "カメラがサポートされていないか、許可が付与されていません。",
282
- };
283
-
284
- case "pa":
285
- return {
286
- takePicture: "ਤਸਵੀਰ ਖਿੱਚੋ",
287
- cameraNotSupportedOrNotAllowed:
288
- "ਕੈਮਰਾ ਦਾ ਸਮਰਥਨ ਨਹੀਂ ਹੈ ਜਾਂ ਅਨੁਮਤੀ ਨਹੀਂ ਦਿੱਤੀ ਗਈ ਹੈ।",
289
- };
290
-
291
- case "mr":
292
- return {
293
- takePicture: "फोटो घ्या",
294
- cameraNotSupportedOrNotAllowed:
295
- "कॅमेरा समर्थित नाही किंवा परवानगी दिलेली नाही.",
296
- };
297
-
298
- case "fr":
299
- return {
300
- takePicture: "Prendre une photo",
301
- cameraNotSupportedOrNotAllowed:
302
- "La caméra n'est pas prise en charge ou l'autorisation n'a pas été accordée.",
303
- };
304
-
305
- case "it":
306
- return {
307
- takePicture: "Scattare una foto",
308
- cameraNotSupportedOrNotAllowed:
309
- "La fotocamera non è supportata o l'autorizzazione non è stata concessa.",
310
- };
311
-
312
- case "nl":
313
- return {
314
- takePicture: "Maak een foto",
315
- cameraNotSupportedOrNotAllowed:
316
- "De camera wordt niet ondersteund of er is geen toestemming verleend.",
317
- };
318
-
319
- case "sv":
320
- return {
321
- takePicture: "Ta ett foto",
322
- cameraNotSupportedOrNotAllowed:
323
- "Kameran stöds inte eller tillståndet har inte beviljats.",
324
- };
325
-
326
- case "pl":
327
- return {
328
- takePicture: "Zrób zdjęcie",
329
- cameraNotSupportedOrNotAllowed:
330
- "Kamera nie jest obsługiwana lub nie udzielono zgody.",
331
- };
332
-
333
- case "da":
334
- return {
335
- takePicture: "Tag et billede",
336
- cameraNotSupportedOrNotAllowed:
337
- "Kameraen understøttes ikke eller tilladelsen er ikke givet.",
338
- };
339
-
340
- case "fi":
341
- return {
342
- takePicture: "Ota kuva",
343
- cameraNotSupportedOrNotAllowed:
344
- "Kameraa ei tueta tai lupaa ei ole myönnetty.",
345
- };
346
-
347
- case "no":
348
- return {
349
- takePicture: "Ta et bilde",
350
- cameraNotSupportedOrNotAllowed:
351
- "Kameraen støttes ikke eller tillatelsen er ikke gitt.",
352
- };
353
-
354
- case "cs":
355
- return {
356
- takePicture: "Vyfotit",
357
- cameraNotSupportedOrNotAllowed:
358
- "Fotoaparát není podporován nebo povolení nebylo uděleno.",
359
- };
360
-
361
- case "en":
362
- default:
363
- return {
364
- takePicture: "Take a picture",
365
- cameraNotSupportedOrNotAllowed:
366
- "The camera is not supported or permission has not been granted.",
367
- };
368
- }
230
+ const locale = getLocaleOfDocument();
231
+ switch (locale.language) {
232
+ case "de":
233
+ return {
234
+ takePicture: "Bild aufnehmen",
235
+ cameraNotSupportedOrNotAllowed:
236
+ "Die Kamera wird nicht unterstützt oder die Berechtigung wurde nicht erteilt.",
237
+ };
238
+
239
+ case "es":
240
+ return {
241
+ takePicture: "Tomar una foto",
242
+ cameraNotSupportedOrNotAllowed:
243
+ "La cámara no es compatible o no se ha otorgado permiso.",
244
+ };
245
+
246
+ case "zh":
247
+ return {
248
+ takePicture: "拍照",
249
+ cameraNotSupportedOrNotAllowed: "相机不受支持或未授予权限。",
250
+ };
251
+
252
+ case "hi":
253
+ return {
254
+ takePicture: "तस्वीर खींचें",
255
+ cameraNotSupportedOrNotAllowed:
256
+ "कैमरा समर्थित नहीं है या अनुमति नहीं दी गई है।",
257
+ };
258
+
259
+ case "bn":
260
+ return {
261
+ takePicture: "ছবি তুলুন",
262
+ cameraNotSupportedOrNotAllowed: "ক্যামেরা সমর্থিত নয় বা অনুমতি দেয়া হয়নি।",
263
+ };
264
+
265
+ case "pt":
266
+ return {
267
+ takePicture: "Tirar uma foto",
268
+ cameraNotSupportedOrNotAllowed:
269
+ "A câmera não é suportada ou a permissão não foi concedida.",
270
+ };
271
+
272
+ case "ru":
273
+ return {
274
+ takePicture: "Сделать фото",
275
+ cameraNotSupportedOrNotAllowed:
276
+ "Камера не поддерживается или разрешение не предоставлено.",
277
+ };
278
+
279
+ case "ja":
280
+ return {
281
+ takePicture: "写真を撮る",
282
+ cameraNotSupportedOrNotAllowed:
283
+ "カメラがサポートされていないか、許可が付与されていません。",
284
+ };
285
+
286
+ case "pa":
287
+ return {
288
+ takePicture: "ਤਸਵੀਰ ਖਿੱਚੋ",
289
+ cameraNotSupportedOrNotAllowed:
290
+ "ਕੈਮਰਾ ਦਾ ਸਮਰਥਨ ਨਹੀਂ ਹੈ ਜਾਂ ਅਨੁਮਤੀ ਨਹੀਂ ਦਿੱਤੀ ਗਈ ਹੈ।",
291
+ };
292
+
293
+ case "mr":
294
+ return {
295
+ takePicture: "फोटो घ्या",
296
+ cameraNotSupportedOrNotAllowed:
297
+ "कॅमेरा समर्थित नाही किंवा परवानगी दिलेली नाही.",
298
+ };
299
+
300
+ case "fr":
301
+ return {
302
+ takePicture: "Prendre une photo",
303
+ cameraNotSupportedOrNotAllowed:
304
+ "La caméra n'est pas prise en charge ou l'autorisation n'a pas été accordée.",
305
+ };
306
+
307
+ case "it":
308
+ return {
309
+ takePicture: "Scattare una foto",
310
+ cameraNotSupportedOrNotAllowed:
311
+ "La fotocamera non è supportata o l'autorizzazione non è stata concessa.",
312
+ };
313
+
314
+ case "nl":
315
+ return {
316
+ takePicture: "Maak een foto",
317
+ cameraNotSupportedOrNotAllowed:
318
+ "De camera wordt niet ondersteund of er is geen toestemming verleend.",
319
+ };
320
+
321
+ case "sv":
322
+ return {
323
+ takePicture: "Ta ett foto",
324
+ cameraNotSupportedOrNotAllowed:
325
+ "Kameran stöds inte eller tillståndet har inte beviljats.",
326
+ };
327
+
328
+ case "pl":
329
+ return {
330
+ takePicture: "Zrób zdjęcie",
331
+ cameraNotSupportedOrNotAllowed:
332
+ "Kamera nie jest obsługiwana lub nie udzielono zgody.",
333
+ };
334
+
335
+ case "da":
336
+ return {
337
+ takePicture: "Tag et billede",
338
+ cameraNotSupportedOrNotAllowed:
339
+ "Kameraen understøttes ikke eller tilladelsen er ikke givet.",
340
+ };
341
+
342
+ case "fi":
343
+ return {
344
+ takePicture: "Ota kuva",
345
+ cameraNotSupportedOrNotAllowed:
346
+ "Kameraa ei tueta tai lupaa ei ole myönnetty.",
347
+ };
348
+
349
+ case "no":
350
+ return {
351
+ takePicture: "Ta et bilde",
352
+ cameraNotSupportedOrNotAllowed:
353
+ "Kameraen støttes ikke eller tillatelsen er ikke gitt.",
354
+ };
355
+
356
+ case "cs":
357
+ return {
358
+ takePicture: "Vyfotit",
359
+ cameraNotSupportedOrNotAllowed:
360
+ "Fotoaparát není podporován nebo povolení nebylo uděleno.",
361
+ };
362
+
363
+ case "en":
364
+ default:
365
+ return {
366
+ takePicture: "Take a picture",
367
+ cameraNotSupportedOrNotAllowed:
368
+ "The camera is not supported or permission has not been granted.",
369
+ };
370
+ }
369
371
  }
370
372
 
371
373
  /**
372
374
  * @private
373
375
  * @return {initEventHandler}
376
+ * @fires monster-camera-capture-take-picture
374
377
  */
375
378
  function initEventHandler() {
376
- const self = this;
379
+ const self = this;
377
380
 
378
- this[takePictureButtonElementSymbol].setOption("actions.click", function () {
379
- self.capture();
380
- });
381
+ this[takePictureButtonElementSymbol].setOption("actions.click", function () {
382
+ fireCustomEvent(self, "monster-camera-capture-take-picture", {
383
+ element: self,
384
+ });
381
385
 
382
- return this;
386
+ self.capture();
387
+ });
388
+
389
+ return this;
383
390
  }
384
391
 
385
392
  /**
@@ -387,22 +394,22 @@ function initEventHandler() {
387
394
  * @return {void}
388
395
  */
389
396
  function initControlReferences() {
390
- this[controlElementSymbol] = this.shadowRoot.querySelector(
391
- `[${ATTRIBUTE_ROLE}="control"]`,
392
- );
397
+ this[controlElementSymbol] = this.shadowRoot.querySelector(
398
+ `[${ATTRIBUTE_ROLE}="control"]`,
399
+ );
393
400
 
394
- this[takePictureButtonElementSymbol] = this.shadowRoot.querySelector(
395
- `[data-monster-role="takePicture"]`,
396
- );
401
+ this[takePictureButtonElementSymbol] = this.shadowRoot.querySelector(
402
+ `[data-monster-role="takePicture"]`,
403
+ );
397
404
 
398
- this[videoElementSymbol] = this.shadowRoot.querySelector(`video`);
405
+ this[videoElementSymbol] = this.shadowRoot.querySelector(`video`);
399
406
 
400
- this[canvasElementSymbol] = this.shadowRoot.querySelector(`canvas`);
407
+ this[canvasElementSymbol] = this.shadowRoot.querySelector(`canvas`);
401
408
 
402
- // data-monster-role="emptyHistoryState"
403
- this[emptyHistoryStateElementSymbol] = this.shadowRoot.querySelector(
404
- `[data-monster-role="emptyHistoryState"]`,
405
- );
409
+ // data-monster-role="emptyHistoryState"
410
+ this[emptyHistoryStateElementSymbol] = this.shadowRoot.querySelector(
411
+ `[data-monster-role="emptyHistoryState"]`,
412
+ );
406
413
  }
407
414
 
408
415
  /**
@@ -410,8 +417,8 @@ function initControlReferences() {
410
417
  * @return {string}
411
418
  */
412
419
  function getTemplate() {
413
- // language=HTML
414
- return `
420
+ // language=HTML
421
+ return `
415
422
  <div data-monster-role="control" part="control">
416
423
  <monster-state data-monster-role="emptyHistoryState">
417
424
  <svg slot="visual" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
@@ -167,7 +167,7 @@ class Viewer extends CustomElement {
167
167
  }
168
168
 
169
169
  const html =
170
- '<object data="' +
170
+ '<object part="pdf" data="' +
171
171
  pdfURL +
172
172
  '" width="100%" height="100%" type="application/pdf"></object>';
173
173
 
@@ -171,7 +171,7 @@ class Header extends Base {
171
171
  }
172
172
 
173
173
  /**
174
- * @param {string} grid
174
+ * @return {string}
175
175
  */
176
176
  get grid() {
177
177
  return this.getInternal("grid");
@@ -191,6 +191,9 @@ class Header extends Base {
191
191
  return this.getInternal("html");
192
192
  }
193
193
 
194
+ /**
195
+ * @return {string}
196
+ */
194
197
  get order() {
195
198
  return this.getInternal("order");
196
199
  }