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