@jaak.ai/stamps 2.1.0-dev.9 → 2.2.0-beta.1
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/README.md +227 -14
- package/dist/cjs/app-globals-V2Kpy_OQ.js +8 -0
- package/dist/cjs/app-globals-V2Kpy_OQ.js.map +1 -0
- package/dist/cjs/{index-BfhtOB0D.js → index-D6NBn_qu.js} +203 -121
- package/dist/cjs/index-D6NBn_qu.js.map +1 -0
- package/dist/cjs/jaak-stamps-webcomponent.cjs.js +5 -4
- package/dist/cjs/jaak-stamps-webcomponent.cjs.js.map +1 -1
- package/dist/cjs/jaak-stamps.cjs.entry.js +17780 -442
- package/dist/cjs/jaak-stamps.cjs.entry.js.map +1 -1
- package/dist/cjs/jaak-stamps.entry.cjs.js.map +1 -1
- package/dist/cjs/loader.cjs.js +4 -3
- package/dist/cjs/loader.cjs.js.map +1 -1
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/my-component/my-component.css +106 -5
- package/dist/collection/components/my-component/my-component.js +558 -313
- package/dist/collection/components/my-component/my-component.js.map +1 -1
- package/dist/collection/services/CameraService.js +125 -11
- package/dist/collection/services/CameraService.js.map +1 -1
- package/dist/collection/services/DetectionService.js +7 -148
- package/dist/collection/services/DetectionService.js.map +1 -1
- package/dist/collection/services/LicenseValidationService.js +111 -0
- package/dist/collection/services/LicenseValidationService.js.map +1 -0
- package/dist/collection/services/MetricsService.js +350 -0
- package/dist/collection/services/MetricsService.js.map +1 -0
- package/dist/collection/services/ServiceContainer.js +66 -1
- package/dist/collection/services/ServiceContainer.js.map +1 -1
- package/dist/collection/services/TracingService.js +494 -0
- package/dist/collection/services/TracingService.js.map +1 -0
- package/dist/collection/services/interfaces/IDetectionService.js.map +1 -1
- package/dist/collection/services/interfaces/ILicenseValidationService.js +2 -0
- package/dist/collection/services/interfaces/ILicenseValidationService.js.map +1 -0
- package/dist/collection/services/interfaces/IMetricsService.js +2 -0
- package/dist/collection/services/interfaces/IMetricsService.js.map +1 -0
- package/dist/collection/services/interfaces/ITracingService.js +2 -0
- package/dist/collection/services/interfaces/ITracingService.js.map +1 -0
- package/dist/components/index.js +192 -115
- package/dist/components/index.js.map +1 -1
- package/dist/components/jaak-stamps.js +17796 -445
- package/dist/components/jaak-stamps.js.map +1 -1
- package/dist/esm/app-globals-DQuL1Twl.js +6 -0
- package/dist/esm/app-globals-DQuL1Twl.js.map +1 -0
- package/dist/esm/{index-BP1Q4KOg.js → index-BCfAsrzL.js} +204 -121
- package/dist/esm/index-BCfAsrzL.js.map +1 -0
- package/dist/esm/jaak-stamps-webcomponent.js +5 -4
- package/dist/esm/jaak-stamps-webcomponent.js.map +1 -1
- package/dist/esm/jaak-stamps.entry.js +17780 -442
- package/dist/esm/jaak-stamps.entry.js.map +1 -1
- package/dist/esm/loader.js +4 -3
- package/dist/esm/loader.js.map +1 -1
- package/dist/jaak-stamps-webcomponent/jaak-stamps-webcomponent.esm.js +1 -1
- package/dist/jaak-stamps-webcomponent/jaak-stamps-webcomponent.esm.js.map +1 -1
- package/dist/jaak-stamps-webcomponent/jaak-stamps.entry.esm.js.map +1 -1
- package/dist/jaak-stamps-webcomponent/loader.esm.js.map +1 -1
- package/dist/jaak-stamps-webcomponent/p-34bcebb1.entry.js +7 -0
- package/dist/jaak-stamps-webcomponent/p-34bcebb1.entry.js.map +1 -0
- package/dist/jaak-stamps-webcomponent/p-BCfAsrzL.js +3 -0
- package/dist/jaak-stamps-webcomponent/p-BCfAsrzL.js.map +1 -0
- package/dist/jaak-stamps-webcomponent/p-DQuL1Twl.js +2 -0
- package/dist/jaak-stamps-webcomponent/p-DQuL1Twl.js.map +1 -0
- package/dist/types/components/my-component/my-component.d.ts +25 -27
- package/dist/types/components.d.ts +77 -3
- package/dist/types/services/CameraService.d.ts +1 -0
- package/dist/types/services/DetectionService.d.ts +1 -9
- package/dist/types/services/LicenseValidationService.d.ts +59 -0
- package/dist/types/services/MetricsService.d.ts +74 -0
- package/dist/types/services/ServiceContainer.d.ts +14 -1
- package/dist/types/services/TracingService.d.ts +72 -0
- package/dist/types/services/interfaces/IDetectionService.d.ts +0 -6
- package/dist/types/services/interfaces/ILicenseValidationService.d.ts +4 -0
- package/dist/types/services/interfaces/IMetricsService.d.ts +70 -0
- package/dist/types/services/interfaces/ITracingService.d.ts +64 -0
- package/dist/types/stencil-public-runtime.d.ts +12 -5
- package/package.json +20 -2
- package/dist/cjs/index-BfhtOB0D.js.map +0 -1
- package/dist/esm/index-BP1Q4KOg.js.map +0 -1
- package/dist/jaak-stamps-webcomponent/p-BP1Q4KOg.js +0 -3
- package/dist/jaak-stamps-webcomponent/p-BP1Q4KOg.js.map +0 -1
- package/dist/jaak-stamps-webcomponent/p-c115e01a.entry.js +0 -2
- package/dist/jaak-stamps-webcomponent/p-c115e01a.entry.js.map +0 -1
package/dist/components/index.js
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
const globalStyles = "";
|
|
2
|
-
|
|
3
1
|
const NAMESPACE = 'jaak-stamps-webcomponent';
|
|
4
2
|
const BUILD = /* jaak-stamps-webcomponent */ { hydratedSelectorName: "hydrated", lazyLoad: false, updatable: true, watchCallback: false };
|
|
5
3
|
|
|
6
4
|
/*
|
|
7
|
-
Stencil Client Platform v4.
|
|
5
|
+
Stencil Client Platform v4.36.3 | MIT Licensed | https://stenciljs.com
|
|
8
6
|
*/
|
|
9
7
|
var __defProp = Object.defineProperty;
|
|
10
8
|
var __export = (target, all) => {
|
|
@@ -12,6 +10,10 @@ var __export = (target, all) => {
|
|
|
12
10
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
13
11
|
};
|
|
14
12
|
|
|
13
|
+
// src/utils/constants.ts
|
|
14
|
+
var SVG_NS = "http://www.w3.org/2000/svg";
|
|
15
|
+
var HTML_NS = "http://www.w3.org/1999/xhtml";
|
|
16
|
+
|
|
15
17
|
// src/utils/es2022-rewire-class-members.ts
|
|
16
18
|
var reWireGetterSetter = (instance, hostRef) => {
|
|
17
19
|
var _a;
|
|
@@ -67,7 +69,6 @@ var consoleError = (e, el) => (0, console.error)(e, el);
|
|
|
67
69
|
|
|
68
70
|
// src/client/client-style.ts
|
|
69
71
|
var styles = /* @__PURE__ */ new Map();
|
|
70
|
-
var HYDRATED_STYLE_ID = "sty-id";
|
|
71
72
|
var SLOT_FB_CSS = "slot-fb{display:contents}slot-fb[hidden]{display:none}";
|
|
72
73
|
var win = typeof window !== "undefined" ? window : {};
|
|
73
74
|
var H = win.HTMLElement || class {
|
|
@@ -90,6 +91,7 @@ var supportsConstructableStylesheets = /* @__PURE__ */ (() => {
|
|
|
90
91
|
}
|
|
91
92
|
return false;
|
|
92
93
|
})() ;
|
|
94
|
+
var supportsMutableAdoptedStyleSheets = supportsConstructableStylesheets ? /* @__PURE__ */ (() => !!win.document && Object.getOwnPropertyDescriptor(win.document.adoptedStyleSheets, "length").writable)() : false;
|
|
93
95
|
var queuePending = false;
|
|
94
96
|
var queueDomReads = [];
|
|
95
97
|
var queueDomWrites = [];
|
|
@@ -196,12 +198,24 @@ var unwrapErr = (result) => {
|
|
|
196
198
|
throw result.value;
|
|
197
199
|
}
|
|
198
200
|
};
|
|
201
|
+
|
|
202
|
+
// src/utils/style.ts
|
|
203
|
+
function createStyleSheetIfNeededAndSupported(styles2) {
|
|
204
|
+
return void 0;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
// src/utils/shadow-root.ts
|
|
208
|
+
var globalStyleSheet;
|
|
199
209
|
function createShadowRoot(cmpMeta) {
|
|
210
|
+
var _a;
|
|
200
211
|
const shadowRoot = this.attachShadow({ mode: "open" });
|
|
201
|
-
if (
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
212
|
+
if (globalStyleSheet === void 0) globalStyleSheet = (_a = createStyleSheetIfNeededAndSupported()) != null ? _a : null;
|
|
213
|
+
if (globalStyleSheet) {
|
|
214
|
+
if (supportsMutableAdoptedStyleSheets) {
|
|
215
|
+
shadowRoot.adoptedStyleSheets.push(globalStyleSheet);
|
|
216
|
+
} else {
|
|
217
|
+
shadowRoot.adoptedStyleSheets = [...shadowRoot.adoptedStyleSheets, globalStyleSheet];
|
|
218
|
+
}
|
|
205
219
|
}
|
|
206
220
|
}
|
|
207
221
|
var createTime = (fnName, tagName = "") => {
|
|
@@ -211,6 +225,110 @@ var createTime = (fnName, tagName = "") => {
|
|
|
211
225
|
};
|
|
212
226
|
}
|
|
213
227
|
};
|
|
228
|
+
var rootAppliedStyles = /* @__PURE__ */ new WeakMap();
|
|
229
|
+
var registerStyle = (scopeId2, cssText, allowCS) => {
|
|
230
|
+
let style = styles.get(scopeId2);
|
|
231
|
+
if (supportsConstructableStylesheets && allowCS) {
|
|
232
|
+
style = style || new CSSStyleSheet();
|
|
233
|
+
if (typeof style === "string") {
|
|
234
|
+
style = cssText;
|
|
235
|
+
} else {
|
|
236
|
+
style.replaceSync(cssText);
|
|
237
|
+
}
|
|
238
|
+
} else {
|
|
239
|
+
style = cssText;
|
|
240
|
+
}
|
|
241
|
+
styles.set(scopeId2, style);
|
|
242
|
+
};
|
|
243
|
+
var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
244
|
+
var _a;
|
|
245
|
+
const scopeId2 = getScopeId(cmpMeta);
|
|
246
|
+
const style = styles.get(scopeId2);
|
|
247
|
+
if (!win.document) {
|
|
248
|
+
return scopeId2;
|
|
249
|
+
}
|
|
250
|
+
styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : win.document;
|
|
251
|
+
if (style) {
|
|
252
|
+
if (typeof style === "string") {
|
|
253
|
+
styleContainerNode = styleContainerNode.head || styleContainerNode;
|
|
254
|
+
let appliedStyles = rootAppliedStyles.get(styleContainerNode);
|
|
255
|
+
let styleElm;
|
|
256
|
+
if (!appliedStyles) {
|
|
257
|
+
rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
|
|
258
|
+
}
|
|
259
|
+
if (!appliedStyles.has(scopeId2)) {
|
|
260
|
+
{
|
|
261
|
+
styleElm = win.document.createElement("style");
|
|
262
|
+
styleElm.innerHTML = style;
|
|
263
|
+
const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(win.document);
|
|
264
|
+
if (nonce != null) {
|
|
265
|
+
styleElm.setAttribute("nonce", nonce);
|
|
266
|
+
}
|
|
267
|
+
if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
|
|
268
|
+
if (styleContainerNode.nodeName === "HEAD") {
|
|
269
|
+
const preconnectLinks = styleContainerNode.querySelectorAll("link[rel=preconnect]");
|
|
270
|
+
const referenceNode2 = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling : styleContainerNode.querySelector("style");
|
|
271
|
+
styleContainerNode.insertBefore(
|
|
272
|
+
styleElm,
|
|
273
|
+
(referenceNode2 == null ? void 0 : referenceNode2.parentNode) === styleContainerNode ? referenceNode2 : null
|
|
274
|
+
);
|
|
275
|
+
} else if ("host" in styleContainerNode) {
|
|
276
|
+
if (supportsConstructableStylesheets) {
|
|
277
|
+
const stylesheet = new CSSStyleSheet();
|
|
278
|
+
stylesheet.replaceSync(style);
|
|
279
|
+
if (supportsMutableAdoptedStyleSheets) {
|
|
280
|
+
styleContainerNode.adoptedStyleSheets.unshift(stylesheet);
|
|
281
|
+
} else {
|
|
282
|
+
styleContainerNode.adoptedStyleSheets = [stylesheet, ...styleContainerNode.adoptedStyleSheets];
|
|
283
|
+
}
|
|
284
|
+
} else {
|
|
285
|
+
const existingStyleContainer = styleContainerNode.querySelector("style");
|
|
286
|
+
if (existingStyleContainer) {
|
|
287
|
+
existingStyleContainer.innerHTML = style + existingStyleContainer.innerHTML;
|
|
288
|
+
} else {
|
|
289
|
+
styleContainerNode.prepend(styleElm);
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
} else {
|
|
293
|
+
styleContainerNode.append(styleElm);
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
297
|
+
styleContainerNode.insertBefore(styleElm, null);
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
|
|
301
|
+
styleElm.innerHTML += SLOT_FB_CSS;
|
|
302
|
+
}
|
|
303
|
+
if (appliedStyles) {
|
|
304
|
+
appliedStyles.add(scopeId2);
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
} else if (!styleContainerNode.adoptedStyleSheets.includes(style)) {
|
|
308
|
+
if (supportsMutableAdoptedStyleSheets) {
|
|
309
|
+
styleContainerNode.adoptedStyleSheets.push(style);
|
|
310
|
+
} else {
|
|
311
|
+
styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
return scopeId2;
|
|
316
|
+
};
|
|
317
|
+
var attachStyles = (hostRef) => {
|
|
318
|
+
const cmpMeta = hostRef.$cmpMeta$;
|
|
319
|
+
const elm = hostRef.$hostElement$;
|
|
320
|
+
const flags = cmpMeta.$flags$;
|
|
321
|
+
const endAttachStyles = createTime("attachStyles", cmpMeta.$tagName$);
|
|
322
|
+
const scopeId2 = addStyle(
|
|
323
|
+
elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
|
|
324
|
+
cmpMeta);
|
|
325
|
+
if (flags & 10 /* needsScopedEncapsulation */) {
|
|
326
|
+
elm["s-sc"] = scopeId2;
|
|
327
|
+
elm.classList.add(scopeId2 + "-h");
|
|
328
|
+
}
|
|
329
|
+
endAttachStyles();
|
|
330
|
+
};
|
|
331
|
+
var getScopeId = (cmp, mode) => "sc-" + (cmp.$tagName$);
|
|
214
332
|
var h = (nodeName, vnodeData, ...children) => {
|
|
215
333
|
let child = null;
|
|
216
334
|
let key = null;
|
|
@@ -287,10 +405,18 @@ var createSupportsRuleRe = (selector) => {
|
|
|
287
405
|
createSupportsRuleRe("::slotted");
|
|
288
406
|
createSupportsRuleRe(":host");
|
|
289
407
|
createSupportsRuleRe(":host-context");
|
|
290
|
-
var parsePropertyValue = (propValue, propType) => {
|
|
408
|
+
var parsePropertyValue = (propValue, propType, isFormAssociated) => {
|
|
409
|
+
if (typeof propValue === "string" && (propType & 16 /* Unknown */ || propType & 8 /* Any */) && (propValue.startsWith("{") && propValue.endsWith("}") || propValue.startsWith("[") && propValue.endsWith("]"))) {
|
|
410
|
+
try {
|
|
411
|
+
return JSON.parse(propValue);
|
|
412
|
+
} catch (e) {
|
|
413
|
+
}
|
|
414
|
+
}
|
|
291
415
|
if (propValue != null && !isComplexType(propValue)) {
|
|
292
416
|
if (propType & 4 /* Boolean */) {
|
|
293
|
-
|
|
417
|
+
{
|
|
418
|
+
return propValue === "false" ? false : propValue === "" || !!propValue;
|
|
419
|
+
}
|
|
294
420
|
}
|
|
295
421
|
if (propType & 2 /* Number */) {
|
|
296
422
|
return typeof propValue === "string" ? parseFloat(propValue) : typeof propValue === "number" ? propValue : NaN;
|
|
@@ -302,7 +428,9 @@ var parsePropertyValue = (propValue, propType) => {
|
|
|
302
428
|
}
|
|
303
429
|
return propValue;
|
|
304
430
|
};
|
|
305
|
-
var getElement = (ref) =>
|
|
431
|
+
var getElement = (ref) => {
|
|
432
|
+
return ref;
|
|
433
|
+
};
|
|
306
434
|
|
|
307
435
|
// src/runtime/event-emitter.ts
|
|
308
436
|
var createEvent = (ref, name, flags) => {
|
|
@@ -323,102 +451,6 @@ var emitEvent = (elm, name, opts) => {
|
|
|
323
451
|
elm.dispatchEvent(ev);
|
|
324
452
|
return ev;
|
|
325
453
|
};
|
|
326
|
-
var rootAppliedStyles = /* @__PURE__ */ new WeakMap();
|
|
327
|
-
var registerStyle = (scopeId2, cssText, allowCS) => {
|
|
328
|
-
let style = styles.get(scopeId2);
|
|
329
|
-
if (supportsConstructableStylesheets && allowCS) {
|
|
330
|
-
style = style || new CSSStyleSheet();
|
|
331
|
-
if (typeof style === "string") {
|
|
332
|
-
style = cssText;
|
|
333
|
-
} else {
|
|
334
|
-
style.replaceSync(cssText);
|
|
335
|
-
}
|
|
336
|
-
} else {
|
|
337
|
-
style = cssText;
|
|
338
|
-
}
|
|
339
|
-
styles.set(scopeId2, style);
|
|
340
|
-
};
|
|
341
|
-
var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
342
|
-
var _a;
|
|
343
|
-
const scopeId2 = getScopeId(cmpMeta);
|
|
344
|
-
const style = styles.get(scopeId2);
|
|
345
|
-
if (!win.document) {
|
|
346
|
-
return scopeId2;
|
|
347
|
-
}
|
|
348
|
-
styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : win.document;
|
|
349
|
-
if (style) {
|
|
350
|
-
if (typeof style === "string") {
|
|
351
|
-
styleContainerNode = styleContainerNode.head || styleContainerNode;
|
|
352
|
-
let appliedStyles = rootAppliedStyles.get(styleContainerNode);
|
|
353
|
-
let styleElm;
|
|
354
|
-
if (!appliedStyles) {
|
|
355
|
-
rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
|
|
356
|
-
}
|
|
357
|
-
if (!appliedStyles.has(scopeId2)) {
|
|
358
|
-
{
|
|
359
|
-
styleElm = document.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`) || win.document.createElement("style");
|
|
360
|
-
styleElm.innerHTML = style;
|
|
361
|
-
const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(win.document);
|
|
362
|
-
if (nonce != null) {
|
|
363
|
-
styleElm.setAttribute("nonce", nonce);
|
|
364
|
-
}
|
|
365
|
-
if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
|
|
366
|
-
if (styleContainerNode.nodeName === "HEAD") {
|
|
367
|
-
const preconnectLinks = styleContainerNode.querySelectorAll("link[rel=preconnect]");
|
|
368
|
-
const referenceNode2 = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling : styleContainerNode.querySelector("style");
|
|
369
|
-
styleContainerNode.insertBefore(
|
|
370
|
-
styleElm,
|
|
371
|
-
(referenceNode2 == null ? void 0 : referenceNode2.parentNode) === styleContainerNode ? referenceNode2 : null
|
|
372
|
-
);
|
|
373
|
-
} else if ("host" in styleContainerNode) {
|
|
374
|
-
if (supportsConstructableStylesheets) {
|
|
375
|
-
const stylesheet = new CSSStyleSheet();
|
|
376
|
-
stylesheet.replaceSync(style);
|
|
377
|
-
styleContainerNode.adoptedStyleSheets = [stylesheet, ...styleContainerNode.adoptedStyleSheets];
|
|
378
|
-
} else {
|
|
379
|
-
const existingStyleContainer = styleContainerNode.querySelector("style");
|
|
380
|
-
if (existingStyleContainer) {
|
|
381
|
-
existingStyleContainer.innerHTML = style + existingStyleContainer.innerHTML;
|
|
382
|
-
} else {
|
|
383
|
-
styleContainerNode.prepend(styleElm);
|
|
384
|
-
}
|
|
385
|
-
}
|
|
386
|
-
} else {
|
|
387
|
-
styleContainerNode.append(styleElm);
|
|
388
|
-
}
|
|
389
|
-
}
|
|
390
|
-
if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
391
|
-
styleContainerNode.insertBefore(styleElm, null);
|
|
392
|
-
}
|
|
393
|
-
}
|
|
394
|
-
if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
|
|
395
|
-
styleElm.innerHTML += SLOT_FB_CSS;
|
|
396
|
-
}
|
|
397
|
-
if (appliedStyles) {
|
|
398
|
-
appliedStyles.add(scopeId2);
|
|
399
|
-
}
|
|
400
|
-
}
|
|
401
|
-
} else if (!styleContainerNode.adoptedStyleSheets.includes(style)) {
|
|
402
|
-
styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
|
|
403
|
-
}
|
|
404
|
-
}
|
|
405
|
-
return scopeId2;
|
|
406
|
-
};
|
|
407
|
-
var attachStyles = (hostRef) => {
|
|
408
|
-
const cmpMeta = hostRef.$cmpMeta$;
|
|
409
|
-
const elm = hostRef.$hostElement$;
|
|
410
|
-
const flags = cmpMeta.$flags$;
|
|
411
|
-
const endAttachStyles = createTime("attachStyles", cmpMeta.$tagName$);
|
|
412
|
-
const scopeId2 = addStyle(
|
|
413
|
-
elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
|
|
414
|
-
cmpMeta);
|
|
415
|
-
if (flags & 10 /* needsScopedEncapsulation */) {
|
|
416
|
-
elm["s-sc"] = scopeId2;
|
|
417
|
-
elm.classList.add(scopeId2 + "-h");
|
|
418
|
-
}
|
|
419
|
-
endAttachStyles();
|
|
420
|
-
};
|
|
421
|
-
var getScopeId = (cmp, mode) => "sc-" + (cmp.$tagName$);
|
|
422
454
|
var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRender) => {
|
|
423
455
|
if (oldValue === newValue) {
|
|
424
456
|
return;
|
|
@@ -478,7 +510,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRen
|
|
|
478
510
|
}
|
|
479
511
|
} else {
|
|
480
512
|
const isComplex = isComplexType(newValue);
|
|
481
|
-
if ((isProp || isComplex && newValue !== null) &&
|
|
513
|
+
if ((isProp || isComplex && newValue !== null) && !isSvg) {
|
|
482
514
|
try {
|
|
483
515
|
if (!elm.tagName.includes("-")) {
|
|
484
516
|
const n = newValue == null ? "" : newValue;
|
|
@@ -571,14 +603,21 @@ var createElm = (oldParentVNode, newParentVNode, childIndex) => {
|
|
|
571
603
|
if (newVNode2.$text$ !== null) {
|
|
572
604
|
elm = newVNode2.$elm$ = win.document.createTextNode(newVNode2.$text$);
|
|
573
605
|
} else {
|
|
606
|
+
if (!isSvgMode) {
|
|
607
|
+
isSvgMode = newVNode2.$tag$ === "svg";
|
|
608
|
+
}
|
|
574
609
|
if (!win.document) {
|
|
575
610
|
throw new Error(
|
|
576
611
|
"You are trying to render a Stencil component in an environment that doesn't support the DOM. Make sure to populate the [`window`](https://developer.mozilla.org/en-US/docs/Web/API/Window/window) object before rendering a component."
|
|
577
612
|
);
|
|
578
613
|
}
|
|
579
|
-
elm = newVNode2.$elm$ = win.document.
|
|
614
|
+
elm = newVNode2.$elm$ = win.document.createElementNS(
|
|
615
|
+
isSvgMode ? SVG_NS : HTML_NS,
|
|
580
616
|
newVNode2.$tag$
|
|
581
|
-
);
|
|
617
|
+
) ;
|
|
618
|
+
if (isSvgMode && newVNode2.$tag$ === "foreignObject") {
|
|
619
|
+
isSvgMode = false;
|
|
620
|
+
}
|
|
582
621
|
{
|
|
583
622
|
updateElement(null, newVNode2, isSvgMode);
|
|
584
623
|
}
|
|
@@ -590,6 +629,13 @@ var createElm = (oldParentVNode, newParentVNode, childIndex) => {
|
|
|
590
629
|
}
|
|
591
630
|
}
|
|
592
631
|
}
|
|
632
|
+
{
|
|
633
|
+
if (newVNode2.$tag$ === "svg") {
|
|
634
|
+
isSvgMode = false;
|
|
635
|
+
} else if (elm.tagName === "foreignObject") {
|
|
636
|
+
isSvgMode = true;
|
|
637
|
+
}
|
|
638
|
+
}
|
|
593
639
|
}
|
|
594
640
|
elm["s-hn"] = hostTagName;
|
|
595
641
|
return elm;
|
|
@@ -722,8 +768,12 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
|
|
|
722
768
|
const elm = newVNode2.$elm$ = oldVNode.$elm$;
|
|
723
769
|
const oldChildren = oldVNode.$children$;
|
|
724
770
|
const newChildren = newVNode2.$children$;
|
|
771
|
+
const tag = newVNode2.$tag$;
|
|
725
772
|
const text = newVNode2.$text$;
|
|
726
773
|
if (text === null) {
|
|
774
|
+
{
|
|
775
|
+
isSvgMode = tag === "svg" ? true : tag === "foreignObject" ? false : isSvgMode;
|
|
776
|
+
}
|
|
727
777
|
{
|
|
728
778
|
updateElement(oldVNode, newVNode2, isSvgMode);
|
|
729
779
|
}
|
|
@@ -739,6 +789,9 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
|
|
|
739
789
|
!isInitialRender && BUILD.updatable && oldChildren !== null
|
|
740
790
|
) {
|
|
741
791
|
removeVnodes(oldChildren, 0, oldChildren.length - 1);
|
|
792
|
+
} else ;
|
|
793
|
+
if (isSvgMode && tag === "svg") {
|
|
794
|
+
isSvgMode = false;
|
|
742
795
|
}
|
|
743
796
|
} else if (oldVNode.$text$ !== text) {
|
|
744
797
|
elm.data = text;
|
|
@@ -798,6 +851,12 @@ var scheduleUpdate = (hostRef, isInitialLoad) => {
|
|
|
798
851
|
}
|
|
799
852
|
attachToAncestor(hostRef, hostRef.$ancestorComponent$);
|
|
800
853
|
const dispatch = () => dispatchHooks(hostRef, isInitialLoad);
|
|
854
|
+
if (isInitialLoad) {
|
|
855
|
+
queueMicrotask(() => {
|
|
856
|
+
dispatch();
|
|
857
|
+
});
|
|
858
|
+
return;
|
|
859
|
+
}
|
|
801
860
|
return writeTask(dispatch) ;
|
|
802
861
|
};
|
|
803
862
|
var dispatchHooks = (hostRef, isInitialLoad) => {
|
|
@@ -932,11 +991,16 @@ var addHydratedFlag = (elm) => {
|
|
|
932
991
|
var getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
|
|
933
992
|
var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
934
993
|
const hostRef = getHostRef(ref);
|
|
994
|
+
if (!hostRef) {
|
|
995
|
+
return;
|
|
996
|
+
}
|
|
935
997
|
const elm = ref;
|
|
936
998
|
const oldVal = hostRef.$instanceValues$.get(propName);
|
|
937
999
|
const flags = hostRef.$flags$;
|
|
938
1000
|
const instance = elm;
|
|
939
|
-
newVal = parsePropertyValue(
|
|
1001
|
+
newVal = parsePropertyValue(
|
|
1002
|
+
newVal,
|
|
1003
|
+
cmpMeta.$members$[propName][0]);
|
|
940
1004
|
const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
|
|
941
1005
|
const didValueChange = newVal !== oldVal && !areBothNaN;
|
|
942
1006
|
if (didValueChange) {
|
|
@@ -979,6 +1043,9 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
979
1043
|
Object.defineProperty(prototype, memberName, {
|
|
980
1044
|
set(newValue) {
|
|
981
1045
|
const ref = getHostRef(this);
|
|
1046
|
+
if (!ref) {
|
|
1047
|
+
return;
|
|
1048
|
+
}
|
|
982
1049
|
if (origSetter) {
|
|
983
1050
|
const currentValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
|
|
984
1051
|
if (typeof currentValue === "undefined" && ref.$instanceValues$.get(memberName)) {
|
|
@@ -986,7 +1053,11 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
986
1053
|
} else if (!ref.$instanceValues$.get(memberName) && currentValue) {
|
|
987
1054
|
ref.$instanceValues$.set(memberName, currentValue);
|
|
988
1055
|
}
|
|
989
|
-
origSetter.apply(this, [
|
|
1056
|
+
origSetter.apply(this, [
|
|
1057
|
+
parsePropertyValue(
|
|
1058
|
+
newValue,
|
|
1059
|
+
memberFlags)
|
|
1060
|
+
]);
|
|
990
1061
|
newValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
|
|
991
1062
|
setValue(this, memberName, newValue, cmpMeta);
|
|
992
1063
|
return;
|
|
@@ -1011,7 +1082,7 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1011
1082
|
} else if (propName == null) {
|
|
1012
1083
|
const hostRef = getHostRef(this);
|
|
1013
1084
|
const flags2 = hostRef == null ? void 0 : hostRef.$flags$;
|
|
1014
|
-
if (flags2 && !(flags2 & 8 /* isConstructingInstance */) && flags2 & 128 /* isWatchReady */ && newValue !== oldValue) {
|
|
1085
|
+
if (hostRef && flags2 && !(flags2 & 8 /* isConstructingInstance */) && flags2 & 128 /* isWatchReady */ && newValue !== oldValue) {
|
|
1015
1086
|
const elm = this;
|
|
1016
1087
|
const instance = elm;
|
|
1017
1088
|
const entry = (_a2 = cmpMeta.$watchers$) == null ? void 0 : _a2[attrName];
|
|
@@ -1033,7 +1104,7 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1033
1104
|
Cstr.observedAttributes = Array.from(
|
|
1034
1105
|
/* @__PURE__ */ new Set([
|
|
1035
1106
|
...Object.keys((_b = cmpMeta.$watchers$) != null ? _b : {}),
|
|
1036
|
-
...members.filter(([_, m]) => m[0] &
|
|
1107
|
+
...members.filter(([_, m]) => m[0] & 31 /* HasAttribute */).map(([propName, m]) => {
|
|
1037
1108
|
const attrName = m[1] || propName;
|
|
1038
1109
|
attrNameToPropName.set(attrName, propName);
|
|
1039
1110
|
return attrName;
|
|
@@ -1083,6 +1154,9 @@ var fireConnectedCallback = (instance, elm) => {
|
|
|
1083
1154
|
var connectedCallback = (elm) => {
|
|
1084
1155
|
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
1085
1156
|
const hostRef = getHostRef(elm);
|
|
1157
|
+
if (!hostRef) {
|
|
1158
|
+
return;
|
|
1159
|
+
}
|
|
1086
1160
|
const cmpMeta = hostRef.$cmpMeta$;
|
|
1087
1161
|
const endConnected = createTime("connectedCallback", cmpMeta.$tagName$);
|
|
1088
1162
|
if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
|
|
@@ -1146,7 +1220,10 @@ var proxyCustomElement = (Cstr, compactMeta) => {
|
|
|
1146
1220
|
},
|
|
1147
1221
|
connectedCallback() {
|
|
1148
1222
|
if (!this.__hasHostListenerAttached) {
|
|
1149
|
-
getHostRef(this);
|
|
1223
|
+
const hostRef = getHostRef(this);
|
|
1224
|
+
if (!hostRef) {
|
|
1225
|
+
return;
|
|
1226
|
+
}
|
|
1150
1227
|
this.__hasHostListenerAttached = true;
|
|
1151
1228
|
}
|
|
1152
1229
|
connectedCallback(this);
|