@jaak.ai/stamps 2.0.1 → 2.1.0-beta.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/README.md +11 -1
- 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-Ga0t6BMe.js} +176 -119
- package/dist/cjs/index-Ga0t6BMe.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 +1273 -663
- 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 +225 -14
- package/dist/collection/components/my-component/my-component.js +964 -286
- package/dist/collection/components/my-component/my-component.js.map +1 -1
- package/dist/collection/services/CameraService.js +236 -342
- package/dist/collection/services/CameraService.js.map +1 -1
- package/dist/collection/services/DetectionService.js +100 -42
- package/dist/collection/services/DetectionService.js.map +1 -1
- package/dist/collection/services/EventBusService.js +1 -1
- package/dist/collection/services/EventBusService.js.map +1 -1
- package/dist/collection/services/ServiceContainer.js +4 -13
- package/dist/collection/services/ServiceContainer.js.map +1 -1
- package/dist/collection/services/interfaces/ICameraService.js.map +1 -1
- package/dist/collection/types/component-types.js.map +1 -1
- package/dist/components/index.js +165 -113
- package/dist/components/index.js.map +1 -1
- package/dist/components/jaak-stamps.js +1281 -666
- 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-Drbzcuq-.js} +177 -119
- package/dist/esm/index-Drbzcuq-.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 +1273 -663
- 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-DQuL1Twl.js +2 -0
- package/dist/jaak-stamps-webcomponent/p-DQuL1Twl.js.map +1 -0
- package/dist/jaak-stamps-webcomponent/p-Drbzcuq-.js +3 -0
- package/dist/jaak-stamps-webcomponent/p-Drbzcuq-.js.map +1 -0
- package/dist/jaak-stamps-webcomponent/p-c06e5d7b.entry.js +2 -0
- package/dist/jaak-stamps-webcomponent/p-c06e5d7b.entry.js.map +1 -0
- package/dist/types/components/my-component/my-component.d.ts +87 -17
- package/dist/types/components.d.ts +14 -8
- package/dist/types/services/CameraService.d.ts +13 -14
- package/dist/types/services/DetectionService.d.ts +10 -3
- package/dist/types/services/ServiceContainer.d.ts +1 -2
- package/dist/types/services/interfaces/ICameraService.d.ts +3 -12
- package/dist/types/stencil-public-runtime.d.ts +12 -5
- package/dist/types/types/component-types.d.ts +3 -0
- package/package.json +6 -4
- package/dist/cjs/index-BfhtOB0D.js.map +0 -1
- package/dist/collection/services/LoggerService.js +0 -40
- package/dist/collection/services/LoggerService.js.map +0 -1
- package/dist/collection/services/interfaces/ILogger.js +0 -2
- package/dist/collection/services/interfaces/ILogger.js.map +0 -1
- package/dist/esm/index-BP1Q4KOg.js.map +0 -1
- package/dist/jaak-stamps-webcomponent/p-2264b5b4.entry.js +0 -2
- package/dist/jaak-stamps-webcomponent/p-2264b5b4.entry.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/types/services/LoggerService.d.ts +0 -12
- package/dist/types/services/interfaces/ILogger.d.ts +0 -8
package/README.md
CHANGED
|
@@ -65,6 +65,7 @@ yarn add @jaak.ai/stamps
|
|
|
65
65
|
| `crop-margin` | `number` | `20` | Margin in pixels around detected document for cropping |
|
|
66
66
|
| `preferred-camera` | `'auto' \| 'front' \| 'back'` | `'auto'` | Preferred camera selection |
|
|
67
67
|
| `use-document-classification` | `boolean` | `false` | Enable AI document classification |
|
|
68
|
+
| `use-document-detector` | `boolean` | `true` | Enable/disable AI document detection model |
|
|
68
69
|
| `enable-back-document-timer` | `boolean` | `false` | Enable timer for back document capture |
|
|
69
70
|
| `back-document-timer-duration` | `number` | `20` | Duration in seconds for back document capture timer |
|
|
70
71
|
|
|
@@ -207,6 +208,7 @@ interface StatusResponse {
|
|
|
207
208
|
id="documentScanner"
|
|
208
209
|
preferred-camera="auto"
|
|
209
210
|
capture-delay="1500"
|
|
211
|
+
use-document-detector="true"
|
|
210
212
|
debug="false">
|
|
211
213
|
</jaak-stamps>
|
|
212
214
|
|
|
@@ -319,6 +321,7 @@ const DocumentScanner: React.FC = () => {
|
|
|
319
321
|
preferred-camera="auto"
|
|
320
322
|
capture-delay={1500}
|
|
321
323
|
use-document-classification={true}
|
|
324
|
+
use-document-detector={true}
|
|
322
325
|
/>
|
|
323
326
|
|
|
324
327
|
<div style={{ marginTop: '20px' }}>
|
|
@@ -389,7 +392,8 @@ interface CapturedImages {
|
|
|
389
392
|
#scanner
|
|
390
393
|
preferred-camera="auto"
|
|
391
394
|
[capture-delay]="1500"
|
|
392
|
-
[use-document-classification]="true"
|
|
395
|
+
[use-document-classification]="true"
|
|
396
|
+
[use-document-detector]="true">
|
|
393
397
|
</jaak-stamps>
|
|
394
398
|
|
|
395
399
|
<div class="controls">
|
|
@@ -741,6 +745,12 @@ A: Enable document classification:
|
|
|
741
745
|
**Q: Can I customize the detection area?**
|
|
742
746
|
A: Yes, use the `mask-size` property to adjust the detection frame size.
|
|
743
747
|
|
|
748
|
+
**Q: Can I disable automatic document detection?**
|
|
749
|
+
A: Yes, set `use-document-detector="false"` to disable AI detection and enable manual capture mode:
|
|
750
|
+
```html
|
|
751
|
+
<jaak-stamps use-document-detector="false"></jaak-stamps>
|
|
752
|
+
```
|
|
753
|
+
|
|
744
754
|
**Q: How do I get only the cropped images?**
|
|
745
755
|
A: Access the `cropped` property from the captured images:
|
|
746
756
|
```javascript
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-globals-V2Kpy_OQ.js","sources":["@stencil/core/internal/app-globals"],"sourcesContent":["export const globalScripts = () => {};\nexport const globalStyles = \"\";\n"],"names":[],"mappings":";;AAAY,MAAC,aAAa,GAAG,MAAM;;;;"}
|
|
@@ -3,11 +3,8 @@
|
|
|
3
3
|
const NAMESPACE = 'jaak-stamps-webcomponent';
|
|
4
4
|
const BUILD = /* jaak-stamps-webcomponent */ { hydratedSelectorName: "hydrated", lazyLoad: true, updatable: true, watchCallback: false };
|
|
5
5
|
|
|
6
|
-
const globalScripts = () => {};
|
|
7
|
-
const globalStyles = "";
|
|
8
|
-
|
|
9
6
|
/*
|
|
10
|
-
Stencil Client Platform v4.
|
|
7
|
+
Stencil Client Platform v4.36.3 | MIT Licensed | https://stenciljs.com
|
|
11
8
|
*/
|
|
12
9
|
var __defProp = Object.defineProperty;
|
|
13
10
|
var __export = (target, all) => {
|
|
@@ -109,7 +106,6 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
109
106
|
|
|
110
107
|
// src/client/client-style.ts
|
|
111
108
|
var styles = /* @__PURE__ */ new Map();
|
|
112
|
-
var HYDRATED_STYLE_ID = "sty-id";
|
|
113
109
|
var HYDRATED_CSS = "{visibility:hidden}.hydrated{visibility:inherit}";
|
|
114
110
|
var SLOT_FB_CSS = "slot-fb{display:contents}slot-fb[hidden]{display:none}";
|
|
115
111
|
var win = typeof window !== "undefined" ? window : {};
|
|
@@ -131,6 +127,7 @@ var supportsConstructableStylesheets = /* @__PURE__ */ (() => {
|
|
|
131
127
|
}
|
|
132
128
|
return false;
|
|
133
129
|
})() ;
|
|
130
|
+
var supportsMutableAdoptedStyleSheets = supportsConstructableStylesheets ? /* @__PURE__ */ (() => !!win.document && Object.getOwnPropertyDescriptor(win.document.adoptedStyleSheets, "length").writable)() : false;
|
|
134
131
|
var queuePending = false;
|
|
135
132
|
var queueDomReads = [];
|
|
136
133
|
var queueDomWrites = [];
|
|
@@ -230,12 +227,24 @@ var unwrapErr = (result) => {
|
|
|
230
227
|
throw result.value;
|
|
231
228
|
}
|
|
232
229
|
};
|
|
230
|
+
|
|
231
|
+
// src/utils/style.ts
|
|
232
|
+
function createStyleSheetIfNeededAndSupported(styles2) {
|
|
233
|
+
return void 0;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
// src/utils/shadow-root.ts
|
|
237
|
+
var globalStyleSheet;
|
|
233
238
|
function createShadowRoot(cmpMeta) {
|
|
239
|
+
var _a;
|
|
234
240
|
const shadowRoot = this.attachShadow({ mode: "open" });
|
|
235
|
-
if (
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
241
|
+
if (globalStyleSheet === void 0) globalStyleSheet = (_a = createStyleSheetIfNeededAndSupported()) != null ? _a : null;
|
|
242
|
+
if (globalStyleSheet) {
|
|
243
|
+
if (supportsMutableAdoptedStyleSheets) {
|
|
244
|
+
shadowRoot.adoptedStyleSheets.push(globalStyleSheet);
|
|
245
|
+
} else {
|
|
246
|
+
shadowRoot.adoptedStyleSheets = [...shadowRoot.adoptedStyleSheets, globalStyleSheet];
|
|
247
|
+
}
|
|
239
248
|
}
|
|
240
249
|
}
|
|
241
250
|
var createTime = (fnName, tagName = "") => {
|
|
@@ -252,6 +261,110 @@ var uniqueTime = (key, measureText) => {
|
|
|
252
261
|
};
|
|
253
262
|
}
|
|
254
263
|
};
|
|
264
|
+
var rootAppliedStyles = /* @__PURE__ */ new WeakMap();
|
|
265
|
+
var registerStyle = (scopeId2, cssText, allowCS) => {
|
|
266
|
+
let style = styles.get(scopeId2);
|
|
267
|
+
if (supportsConstructableStylesheets && allowCS) {
|
|
268
|
+
style = style || new CSSStyleSheet();
|
|
269
|
+
if (typeof style === "string") {
|
|
270
|
+
style = cssText;
|
|
271
|
+
} else {
|
|
272
|
+
style.replaceSync(cssText);
|
|
273
|
+
}
|
|
274
|
+
} else {
|
|
275
|
+
style = cssText;
|
|
276
|
+
}
|
|
277
|
+
styles.set(scopeId2, style);
|
|
278
|
+
};
|
|
279
|
+
var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
280
|
+
var _a;
|
|
281
|
+
const scopeId2 = getScopeId(cmpMeta);
|
|
282
|
+
const style = styles.get(scopeId2);
|
|
283
|
+
if (!win.document) {
|
|
284
|
+
return scopeId2;
|
|
285
|
+
}
|
|
286
|
+
styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : win.document;
|
|
287
|
+
if (style) {
|
|
288
|
+
if (typeof style === "string") {
|
|
289
|
+
styleContainerNode = styleContainerNode.head || styleContainerNode;
|
|
290
|
+
let appliedStyles = rootAppliedStyles.get(styleContainerNode);
|
|
291
|
+
let styleElm;
|
|
292
|
+
if (!appliedStyles) {
|
|
293
|
+
rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
|
|
294
|
+
}
|
|
295
|
+
if (!appliedStyles.has(scopeId2)) {
|
|
296
|
+
{
|
|
297
|
+
styleElm = win.document.createElement("style");
|
|
298
|
+
styleElm.innerHTML = style;
|
|
299
|
+
const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(win.document);
|
|
300
|
+
if (nonce != null) {
|
|
301
|
+
styleElm.setAttribute("nonce", nonce);
|
|
302
|
+
}
|
|
303
|
+
if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
|
|
304
|
+
if (styleContainerNode.nodeName === "HEAD") {
|
|
305
|
+
const preconnectLinks = styleContainerNode.querySelectorAll("link[rel=preconnect]");
|
|
306
|
+
const referenceNode2 = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling : styleContainerNode.querySelector("style");
|
|
307
|
+
styleContainerNode.insertBefore(
|
|
308
|
+
styleElm,
|
|
309
|
+
(referenceNode2 == null ? void 0 : referenceNode2.parentNode) === styleContainerNode ? referenceNode2 : null
|
|
310
|
+
);
|
|
311
|
+
} else if ("host" in styleContainerNode) {
|
|
312
|
+
if (supportsConstructableStylesheets) {
|
|
313
|
+
const stylesheet = new CSSStyleSheet();
|
|
314
|
+
stylesheet.replaceSync(style);
|
|
315
|
+
if (supportsMutableAdoptedStyleSheets) {
|
|
316
|
+
styleContainerNode.adoptedStyleSheets.unshift(stylesheet);
|
|
317
|
+
} else {
|
|
318
|
+
styleContainerNode.adoptedStyleSheets = [stylesheet, ...styleContainerNode.adoptedStyleSheets];
|
|
319
|
+
}
|
|
320
|
+
} else {
|
|
321
|
+
const existingStyleContainer = styleContainerNode.querySelector("style");
|
|
322
|
+
if (existingStyleContainer) {
|
|
323
|
+
existingStyleContainer.innerHTML = style + existingStyleContainer.innerHTML;
|
|
324
|
+
} else {
|
|
325
|
+
styleContainerNode.prepend(styleElm);
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
} else {
|
|
329
|
+
styleContainerNode.append(styleElm);
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
333
|
+
styleContainerNode.insertBefore(styleElm, null);
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
|
|
337
|
+
styleElm.innerHTML += SLOT_FB_CSS;
|
|
338
|
+
}
|
|
339
|
+
if (appliedStyles) {
|
|
340
|
+
appliedStyles.add(scopeId2);
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
} else if (!styleContainerNode.adoptedStyleSheets.includes(style)) {
|
|
344
|
+
if (supportsMutableAdoptedStyleSheets) {
|
|
345
|
+
styleContainerNode.adoptedStyleSheets.push(style);
|
|
346
|
+
} else {
|
|
347
|
+
styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
return scopeId2;
|
|
352
|
+
};
|
|
353
|
+
var attachStyles = (hostRef) => {
|
|
354
|
+
const cmpMeta = hostRef.$cmpMeta$;
|
|
355
|
+
const elm = hostRef.$hostElement$;
|
|
356
|
+
const flags = cmpMeta.$flags$;
|
|
357
|
+
const endAttachStyles = createTime("attachStyles", cmpMeta.$tagName$);
|
|
358
|
+
const scopeId2 = addStyle(
|
|
359
|
+
elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
|
|
360
|
+
cmpMeta);
|
|
361
|
+
if (flags & 10 /* needsScopedEncapsulation */) {
|
|
362
|
+
elm["s-sc"] = scopeId2;
|
|
363
|
+
elm.classList.add(scopeId2 + "-h");
|
|
364
|
+
}
|
|
365
|
+
endAttachStyles();
|
|
366
|
+
};
|
|
367
|
+
var getScopeId = (cmp, mode) => "sc-" + (cmp.$tagName$);
|
|
255
368
|
var h = (nodeName, vnodeData, ...children) => {
|
|
256
369
|
let child = null;
|
|
257
370
|
let key = null;
|
|
@@ -328,10 +441,18 @@ var createSupportsRuleRe = (selector) => {
|
|
|
328
441
|
createSupportsRuleRe("::slotted");
|
|
329
442
|
createSupportsRuleRe(":host");
|
|
330
443
|
createSupportsRuleRe(":host-context");
|
|
331
|
-
var parsePropertyValue = (propValue, propType) => {
|
|
444
|
+
var parsePropertyValue = (propValue, propType, isFormAssociated) => {
|
|
445
|
+
if (typeof propValue === "string" && (propType & 16 /* Unknown */ || propType & 8 /* Any */) && (propValue.startsWith("{") && propValue.endsWith("}") || propValue.startsWith("[") && propValue.endsWith("]"))) {
|
|
446
|
+
try {
|
|
447
|
+
return JSON.parse(propValue);
|
|
448
|
+
} catch (e) {
|
|
449
|
+
}
|
|
450
|
+
}
|
|
332
451
|
if (propValue != null && !isComplexType(propValue)) {
|
|
333
452
|
if (propType & 4 /* Boolean */) {
|
|
334
|
-
|
|
453
|
+
{
|
|
454
|
+
return propValue === "false" ? false : propValue === "" || !!propValue;
|
|
455
|
+
}
|
|
335
456
|
}
|
|
336
457
|
if (propType & 2 /* Number */) {
|
|
337
458
|
return typeof propValue === "string" ? parseFloat(propValue) : typeof propValue === "number" ? propValue : NaN;
|
|
@@ -343,7 +464,10 @@ var parsePropertyValue = (propValue, propType) => {
|
|
|
343
464
|
}
|
|
344
465
|
return propValue;
|
|
345
466
|
};
|
|
346
|
-
var getElement = (ref) =>
|
|
467
|
+
var getElement = (ref) => {
|
|
468
|
+
var _a;
|
|
469
|
+
return (_a = getHostRef(ref)) == null ? void 0 : _a.$hostElement$ ;
|
|
470
|
+
};
|
|
347
471
|
|
|
348
472
|
// src/runtime/event-emitter.ts
|
|
349
473
|
var createEvent = (ref, name, flags) => {
|
|
@@ -364,102 +488,6 @@ var emitEvent = (elm, name, opts) => {
|
|
|
364
488
|
elm.dispatchEvent(ev);
|
|
365
489
|
return ev;
|
|
366
490
|
};
|
|
367
|
-
var rootAppliedStyles = /* @__PURE__ */ new WeakMap();
|
|
368
|
-
var registerStyle = (scopeId2, cssText, allowCS) => {
|
|
369
|
-
let style = styles.get(scopeId2);
|
|
370
|
-
if (supportsConstructableStylesheets && allowCS) {
|
|
371
|
-
style = style || new CSSStyleSheet();
|
|
372
|
-
if (typeof style === "string") {
|
|
373
|
-
style = cssText;
|
|
374
|
-
} else {
|
|
375
|
-
style.replaceSync(cssText);
|
|
376
|
-
}
|
|
377
|
-
} else {
|
|
378
|
-
style = cssText;
|
|
379
|
-
}
|
|
380
|
-
styles.set(scopeId2, style);
|
|
381
|
-
};
|
|
382
|
-
var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
383
|
-
var _a;
|
|
384
|
-
const scopeId2 = getScopeId(cmpMeta);
|
|
385
|
-
const style = styles.get(scopeId2);
|
|
386
|
-
if (!win.document) {
|
|
387
|
-
return scopeId2;
|
|
388
|
-
}
|
|
389
|
-
styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : win.document;
|
|
390
|
-
if (style) {
|
|
391
|
-
if (typeof style === "string") {
|
|
392
|
-
styleContainerNode = styleContainerNode.head || styleContainerNode;
|
|
393
|
-
let appliedStyles = rootAppliedStyles.get(styleContainerNode);
|
|
394
|
-
let styleElm;
|
|
395
|
-
if (!appliedStyles) {
|
|
396
|
-
rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
|
|
397
|
-
}
|
|
398
|
-
if (!appliedStyles.has(scopeId2)) {
|
|
399
|
-
{
|
|
400
|
-
styleElm = document.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`) || win.document.createElement("style");
|
|
401
|
-
styleElm.innerHTML = style;
|
|
402
|
-
const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(win.document);
|
|
403
|
-
if (nonce != null) {
|
|
404
|
-
styleElm.setAttribute("nonce", nonce);
|
|
405
|
-
}
|
|
406
|
-
if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
|
|
407
|
-
if (styleContainerNode.nodeName === "HEAD") {
|
|
408
|
-
const preconnectLinks = styleContainerNode.querySelectorAll("link[rel=preconnect]");
|
|
409
|
-
const referenceNode2 = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling : styleContainerNode.querySelector("style");
|
|
410
|
-
styleContainerNode.insertBefore(
|
|
411
|
-
styleElm,
|
|
412
|
-
(referenceNode2 == null ? void 0 : referenceNode2.parentNode) === styleContainerNode ? referenceNode2 : null
|
|
413
|
-
);
|
|
414
|
-
} else if ("host" in styleContainerNode) {
|
|
415
|
-
if (supportsConstructableStylesheets) {
|
|
416
|
-
const stylesheet = new CSSStyleSheet();
|
|
417
|
-
stylesheet.replaceSync(style);
|
|
418
|
-
styleContainerNode.adoptedStyleSheets = [stylesheet, ...styleContainerNode.adoptedStyleSheets];
|
|
419
|
-
} else {
|
|
420
|
-
const existingStyleContainer = styleContainerNode.querySelector("style");
|
|
421
|
-
if (existingStyleContainer) {
|
|
422
|
-
existingStyleContainer.innerHTML = style + existingStyleContainer.innerHTML;
|
|
423
|
-
} else {
|
|
424
|
-
styleContainerNode.prepend(styleElm);
|
|
425
|
-
}
|
|
426
|
-
}
|
|
427
|
-
} else {
|
|
428
|
-
styleContainerNode.append(styleElm);
|
|
429
|
-
}
|
|
430
|
-
}
|
|
431
|
-
if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
432
|
-
styleContainerNode.insertBefore(styleElm, null);
|
|
433
|
-
}
|
|
434
|
-
}
|
|
435
|
-
if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
|
|
436
|
-
styleElm.innerHTML += SLOT_FB_CSS;
|
|
437
|
-
}
|
|
438
|
-
if (appliedStyles) {
|
|
439
|
-
appliedStyles.add(scopeId2);
|
|
440
|
-
}
|
|
441
|
-
}
|
|
442
|
-
} else if (!styleContainerNode.adoptedStyleSheets.includes(style)) {
|
|
443
|
-
styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
|
|
444
|
-
}
|
|
445
|
-
}
|
|
446
|
-
return scopeId2;
|
|
447
|
-
};
|
|
448
|
-
var attachStyles = (hostRef) => {
|
|
449
|
-
const cmpMeta = hostRef.$cmpMeta$;
|
|
450
|
-
const elm = hostRef.$hostElement$;
|
|
451
|
-
const flags = cmpMeta.$flags$;
|
|
452
|
-
const endAttachStyles = createTime("attachStyles", cmpMeta.$tagName$);
|
|
453
|
-
const scopeId2 = addStyle(
|
|
454
|
-
elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
|
|
455
|
-
cmpMeta);
|
|
456
|
-
if (flags & 10 /* needsScopedEncapsulation */) {
|
|
457
|
-
elm["s-sc"] = scopeId2;
|
|
458
|
-
elm.classList.add(scopeId2 + "-h");
|
|
459
|
-
}
|
|
460
|
-
endAttachStyles();
|
|
461
|
-
};
|
|
462
|
-
var getScopeId = (cmp, mode) => "sc-" + (cmp.$tagName$);
|
|
463
491
|
var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRender) => {
|
|
464
492
|
if (oldValue === newValue) {
|
|
465
493
|
return;
|
|
@@ -780,7 +808,7 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
|
|
|
780
808
|
!isInitialRender && BUILD.updatable && oldChildren !== null
|
|
781
809
|
) {
|
|
782
810
|
removeVnodes(oldChildren, 0, oldChildren.length - 1);
|
|
783
|
-
}
|
|
811
|
+
} else ;
|
|
784
812
|
} else if (oldVNode.$text$ !== text) {
|
|
785
813
|
elm.data = text;
|
|
786
814
|
}
|
|
@@ -839,6 +867,12 @@ var scheduleUpdate = (hostRef, isInitialLoad) => {
|
|
|
839
867
|
}
|
|
840
868
|
attachToAncestor(hostRef, hostRef.$ancestorComponent$);
|
|
841
869
|
const dispatch = () => dispatchHooks(hostRef, isInitialLoad);
|
|
870
|
+
if (isInitialLoad) {
|
|
871
|
+
queueMicrotask(() => {
|
|
872
|
+
dispatch();
|
|
873
|
+
});
|
|
874
|
+
return;
|
|
875
|
+
}
|
|
842
876
|
return writeTask(dispatch) ;
|
|
843
877
|
};
|
|
844
878
|
var dispatchHooks = (hostRef, isInitialLoad) => {
|
|
@@ -976,6 +1010,9 @@ var addHydratedFlag = (elm) => {
|
|
|
976
1010
|
var getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
|
|
977
1011
|
var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
978
1012
|
const hostRef = getHostRef(ref);
|
|
1013
|
+
if (!hostRef) {
|
|
1014
|
+
return;
|
|
1015
|
+
}
|
|
979
1016
|
if (!hostRef) {
|
|
980
1017
|
throw new Error(
|
|
981
1018
|
`Couldn't find host element for "${cmpMeta.$tagName$}" as it is unknown to this Stencil runtime. This usually happens when integrating a 3rd party Stencil component with another Stencil component or application. Please reach out to the maintainers of the 3rd party Stencil component or report this on the Stencil Discord server (https://chat.stenciljs.com) or comment on this similar [GitHub issue](https://github.com/stenciljs/core/issues/5457).`
|
|
@@ -984,7 +1021,9 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
984
1021
|
const oldVal = hostRef.$instanceValues$.get(propName);
|
|
985
1022
|
const flags = hostRef.$flags$;
|
|
986
1023
|
const instance = hostRef.$lazyInstance$ ;
|
|
987
|
-
newVal = parsePropertyValue(
|
|
1024
|
+
newVal = parsePropertyValue(
|
|
1025
|
+
newVal,
|
|
1026
|
+
cmpMeta.$members$[propName][0]);
|
|
988
1027
|
const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
|
|
989
1028
|
const didValueChange = newVal !== oldVal && !areBothNaN;
|
|
990
1029
|
if ((!(flags & 8 /* isConstructingInstance */) || oldVal === void 0) && didValueChange) {
|
|
@@ -1033,6 +1072,9 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1033
1072
|
Object.defineProperty(prototype, memberName, {
|
|
1034
1073
|
set(newValue) {
|
|
1035
1074
|
const ref = getHostRef(this);
|
|
1075
|
+
if (!ref) {
|
|
1076
|
+
return;
|
|
1077
|
+
}
|
|
1036
1078
|
if (origSetter) {
|
|
1037
1079
|
const currentValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
|
|
1038
1080
|
if (typeof currentValue === "undefined" && ref.$instanceValues$.get(memberName)) {
|
|
@@ -1040,7 +1082,11 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1040
1082
|
} else if (!ref.$instanceValues$.get(memberName) && currentValue) {
|
|
1041
1083
|
ref.$instanceValues$.set(memberName, currentValue);
|
|
1042
1084
|
}
|
|
1043
|
-
origSetter.apply(this, [
|
|
1085
|
+
origSetter.apply(this, [
|
|
1086
|
+
parsePropertyValue(
|
|
1087
|
+
newValue,
|
|
1088
|
+
memberFlags)
|
|
1089
|
+
]);
|
|
1044
1090
|
newValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
|
|
1045
1091
|
setValue(this, memberName, newValue, cmpMeta);
|
|
1046
1092
|
return;
|
|
@@ -1062,7 +1108,9 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1062
1108
|
if (!ref.$instanceValues$.get(memberName) && currentValue) {
|
|
1063
1109
|
ref.$instanceValues$.set(memberName, currentValue);
|
|
1064
1110
|
}
|
|
1065
|
-
ref.$lazyInstance$[memberName] = parsePropertyValue(
|
|
1111
|
+
ref.$lazyInstance$[memberName] = parsePropertyValue(
|
|
1112
|
+
newValue,
|
|
1113
|
+
memberFlags);
|
|
1066
1114
|
setValue(this, memberName, ref.$lazyInstance$[memberName], cmpMeta);
|
|
1067
1115
|
};
|
|
1068
1116
|
if (ref.$lazyInstance$) {
|
|
@@ -1101,7 +1149,7 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1101
1149
|
} else if (propName == null) {
|
|
1102
1150
|
const hostRef = getHostRef(this);
|
|
1103
1151
|
const flags2 = hostRef == null ? void 0 : hostRef.$flags$;
|
|
1104
|
-
if (flags2 && !(flags2 & 8 /* isConstructingInstance */) && flags2 & 128 /* isWatchReady */ && newValue !== oldValue) {
|
|
1152
|
+
if (hostRef && flags2 && !(flags2 & 8 /* isConstructingInstance */) && flags2 & 128 /* isWatchReady */ && newValue !== oldValue) {
|
|
1105
1153
|
const instance = hostRef.$lazyInstance$ ;
|
|
1106
1154
|
const entry = (_a2 = cmpMeta.$watchers$) == null ? void 0 : _a2[attrName];
|
|
1107
1155
|
entry == null ? void 0 : entry.forEach((callbackName) => {
|
|
@@ -1122,7 +1170,7 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1122
1170
|
Cstr.observedAttributes = Array.from(
|
|
1123
1171
|
/* @__PURE__ */ new Set([
|
|
1124
1172
|
...Object.keys((_b = cmpMeta.$watchers$) != null ? _b : {}),
|
|
1125
|
-
...members.filter(([_, m]) => m[0] &
|
|
1173
|
+
...members.filter(([_, m]) => m[0] & 31 /* HasAttribute */).map(([propName, m]) => {
|
|
1126
1174
|
const attrName = m[1] || propName;
|
|
1127
1175
|
attrNameToPropName.set(attrName, propName);
|
|
1128
1176
|
return attrName;
|
|
@@ -1206,6 +1254,9 @@ var fireConnectedCallback = (instance, elm) => {
|
|
|
1206
1254
|
var connectedCallback = (elm) => {
|
|
1207
1255
|
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
1208
1256
|
const hostRef = getHostRef(elm);
|
|
1257
|
+
if (!hostRef) {
|
|
1258
|
+
return;
|
|
1259
|
+
}
|
|
1209
1260
|
const cmpMeta = hostRef.$cmpMeta$;
|
|
1210
1261
|
const endConnected = createTime("connectedCallback", cmpMeta.$tagName$);
|
|
1211
1262
|
if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
|
|
@@ -1320,7 +1371,10 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1320
1371
|
}
|
|
1321
1372
|
}
|
|
1322
1373
|
connectedCallback() {
|
|
1323
|
-
getHostRef(this);
|
|
1374
|
+
const hostRef = getHostRef(this);
|
|
1375
|
+
if (!hostRef) {
|
|
1376
|
+
return;
|
|
1377
|
+
}
|
|
1324
1378
|
if (!this.hasRegisteredEventListeners) {
|
|
1325
1379
|
this.hasRegisteredEventListeners = true;
|
|
1326
1380
|
}
|
|
@@ -1339,6 +1393,9 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1339
1393
|
plt.raf(() => {
|
|
1340
1394
|
var _a3;
|
|
1341
1395
|
const hostRef = getHostRef(this);
|
|
1396
|
+
if (!hostRef) {
|
|
1397
|
+
return;
|
|
1398
|
+
}
|
|
1342
1399
|
const i2 = deferredConnectedCallbacks.findIndex((host) => host === this);
|
|
1343
1400
|
if (i2 > -1) {
|
|
1344
1401
|
deferredConnectedCallbacks.splice(i2, 1);
|
|
@@ -1349,7 +1406,8 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1349
1406
|
});
|
|
1350
1407
|
}
|
|
1351
1408
|
componentOnReady() {
|
|
1352
|
-
|
|
1409
|
+
var _a3;
|
|
1410
|
+
return (_a3 = getHostRef(this)) == null ? void 0 : _a3.$onReadyPromise$;
|
|
1353
1411
|
}
|
|
1354
1412
|
};
|
|
1355
1413
|
cmpMeta.$lazyBundleId$ = lazyBundle[0];
|
|
@@ -1395,11 +1453,10 @@ var setNonce = (nonce) => plt.$nonce$ = nonce;
|
|
|
1395
1453
|
exports.bootstrapLazy = bootstrapLazy;
|
|
1396
1454
|
exports.createEvent = createEvent;
|
|
1397
1455
|
exports.getElement = getElement;
|
|
1398
|
-
exports.globalScripts = globalScripts;
|
|
1399
1456
|
exports.h = h;
|
|
1400
1457
|
exports.promiseResolve = promiseResolve;
|
|
1401
1458
|
exports.registerInstance = registerInstance;
|
|
1402
1459
|
exports.setNonce = setNonce;
|
|
1403
|
-
//# sourceMappingURL=index-
|
|
1460
|
+
//# sourceMappingURL=index-Ga0t6BMe.js.map
|
|
1404
1461
|
|
|
1405
|
-
//# sourceMappingURL=index-
|
|
1462
|
+
//# sourceMappingURL=index-Ga0t6BMe.js.map
|