@mochabug/adapt-web 1.0.1-rc.21 → 1.0.1-rc.23
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/dist/README.md +15 -15
- package/dist/esm/AdaptAutomationElement.js +1 -1
- package/dist/esm/cap-adapter.js +1 -1
- package/dist/types/AdaptAutomationElement.d.ts +12 -0
- package/dist/umd/adapt-web.cap.js +1 -1
- package/dist/umd/adapt-web.cap.js.br +0 -0
- package/dist/umd/adapt-web.cap.min.js +1 -1
- package/dist/umd/adapt-web.cap.min.js.br +0 -0
- package/dist/umd/adapt-web.core.js +40 -11
- package/dist/umd/adapt-web.core.js.br +0 -0
- package/dist/umd/adapt-web.core.min.js +3 -3
- package/dist/umd/adapt-web.core.min.js.br +0 -0
- package/dist/umd/adapt-web.js +41 -12
- package/dist/umd/adapt-web.js.br +0 -0
- package/dist/umd/adapt-web.min.js +5 -5
- package/dist/umd/adapt-web.min.js.br +0 -0
- package/package.json +2 -2
|
Binary file
|
package/dist/umd/adapt-web.js
CHANGED
|
@@ -11488,8 +11488,21 @@ html.mb-dragging webview {
|
|
|
11488
11488
|
}
|
|
11489
11489
|
}
|
|
11490
11490
|
// --- Lifecycle ---
|
|
11491
|
+
/**
|
|
11492
|
+
* Explicitly initialize the element after all properties are set.
|
|
11493
|
+
* Framework wrappers (React, Vue, Svelte, Angular, Astro) MUST call this
|
|
11494
|
+
* after setting non-serializable properties like `signals`, `inheritFrom`, etc.
|
|
11495
|
+
*
|
|
11496
|
+
* For plain HTML usage without a framework, the element auto-initializes
|
|
11497
|
+
* when `automation-id` is set (via `attributeChangedCallback`).
|
|
11498
|
+
*
|
|
11499
|
+
* Idempotent — safe to call multiple times. Only creates the client once.
|
|
11500
|
+
*/
|
|
11501
|
+
initialize() {
|
|
11502
|
+
this._tryInit();
|
|
11503
|
+
}
|
|
11491
11504
|
connectedCallback() {
|
|
11492
|
-
|
|
11505
|
+
requestAnimationFrame(() => this._tryInit());
|
|
11493
11506
|
}
|
|
11494
11507
|
disconnectedCallback() {
|
|
11495
11508
|
this._destroyClient();
|
|
@@ -11498,7 +11511,7 @@ html.mb-dragging webview {
|
|
|
11498
11511
|
if (oldValue === newValue) return;
|
|
11499
11512
|
if (name === "automation-id" || name === "persist" || name === "debug") {
|
|
11500
11513
|
this._destroyClient();
|
|
11501
|
-
|
|
11514
|
+
requestAnimationFrame(() => this._tryInit());
|
|
11502
11515
|
return;
|
|
11503
11516
|
}
|
|
11504
11517
|
if (!this._client) return;
|
|
@@ -11621,21 +11634,37 @@ html.mb-dragging webview {
|
|
|
11621
11634
|
if (challengeToken) options.challengeToken = challengeToken;
|
|
11622
11635
|
if (requiresChallenge) options.requiresChallenge = true;
|
|
11623
11636
|
if (inheritToken) options.inheritToken = inheritToken;
|
|
11624
|
-
|
|
11625
|
-
|
|
11626
|
-
|
|
11627
|
-
|
|
11628
|
-
|
|
11637
|
+
const signals = this.signals ?? this._parseData("adaptSignals");
|
|
11638
|
+
const capWidgetOptions = this.capWidgetOptions ?? this._parseData("adaptCapWidgetOptions");
|
|
11639
|
+
const inheritFrom = this.inheritFrom ?? this._parseData("adaptInheritFrom");
|
|
11640
|
+
const classNames = this.classNames ?? this._parseData("adaptClassNames");
|
|
11641
|
+
const text = this.text ?? this._parseData("adaptText");
|
|
11642
|
+
const theme = this._theme ?? this._parseData("adaptTheme");
|
|
11643
|
+
const persistOptions = this.persistOptions ?? this._parseData("adaptPersistOptions");
|
|
11644
|
+
if (signals !== void 0) options.signals = signals;
|
|
11645
|
+
if (capWidgetOptions !== void 0)
|
|
11646
|
+
options.capWidgetOptions = capWidgetOptions;
|
|
11647
|
+
if (inheritFrom !== void 0) options.inheritFrom = inheritFrom;
|
|
11648
|
+
if (classNames !== void 0) options.classNames = classNames;
|
|
11629
11649
|
if (this.styles !== void 0) options.styles = this.styles;
|
|
11630
|
-
if (
|
|
11631
|
-
if (
|
|
11632
|
-
if (
|
|
11633
|
-
options.persist =
|
|
11650
|
+
if (text !== void 0) options.text = text;
|
|
11651
|
+
if (theme !== void 0) options.theme = theme;
|
|
11652
|
+
if (persistOptions !== void 0) {
|
|
11653
|
+
options.persist = persistOptions;
|
|
11634
11654
|
} else if (this.persist) {
|
|
11635
11655
|
options.persist = true;
|
|
11636
11656
|
}
|
|
11637
11657
|
this._client = new AdaptWebClient(options);
|
|
11638
11658
|
}
|
|
11659
|
+
_parseData(key) {
|
|
11660
|
+
const raw = this.dataset[key];
|
|
11661
|
+
if (!raw) return void 0;
|
|
11662
|
+
try {
|
|
11663
|
+
return JSON.parse(raw);
|
|
11664
|
+
} catch {
|
|
11665
|
+
return void 0;
|
|
11666
|
+
}
|
|
11667
|
+
}
|
|
11639
11668
|
_destroyClient() {
|
|
11640
11669
|
if (this._client) {
|
|
11641
11670
|
this._client.destroy();
|
|
@@ -13631,7 +13660,7 @@ html.mb-dragging webview {
|
|
|
13631
13660
|
// src/cap-adapter.ts
|
|
13632
13661
|
if (typeof window !== "undefined" && true && !window.CAP_CUSTOM_WASM_URL) {
|
|
13633
13662
|
window.CAP_CUSTOM_WASM_URL = new URL(
|
|
13634
|
-
"https://cdn.mochabug.com/adapt/web/1.0.1-rc.
|
|
13663
|
+
"https://cdn.mochabug.com/adapt/web/1.0.1-rc.23/cap_wasm_bg.wasm",
|
|
13635
13664
|
window.location.href
|
|
13636
13665
|
).href;
|
|
13637
13666
|
}
|
package/dist/umd/adapt-web.js.br
CHANGED
|
Binary file
|