@myop/sdk 0.3.28 → 0.3.29
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/bundled-declarations.d.ts +13 -0
- package/dist/cjs/{_IframeSDK.7c201b5c.js → _IframeSDK.a588c953.js} +23 -4
- package/dist/cjs/{_IframeSDK.7c201b5c.js.map → _IframeSDK.a588c953.js.map} +2 -2
- package/dist/cjs/_IframeSDK.aad83b0e.min.js +1 -0
- package/dist/cjs/{_MyopHelpers.3eeac406.js → _MyopHelpers.39adea76.js} +28 -3
- package/dist/cjs/{_MyopHelpers.3eeac406.js.map → _MyopHelpers.39adea76.js.map} +2 -2
- package/dist/cjs/_MyopHelpers.ce80c342.min.js +1 -0
- package/dist/cjs/{_WebComponentSDK.952f7c87.js → _WebComponentSDK.54cf170b.js} +23 -4
- package/dist/cjs/{_WebComponentSDK.952f7c87.js.map → _WebComponentSDK.54cf170b.js.map} +2 -2
- package/dist/cjs/_WebComponentSDK.7cb826f6.min.js +1 -0
- package/dist/cjs/_hostSDK.5ff6334c.min.js +1 -0
- package/dist/cjs/{_hostSDK.a73e7b24.js → _hostSDK.cde5ef67.js} +23 -4
- package/dist/cjs/{_hostSDK.a73e7b24.js.map → _hostSDK.cde5ef67.js.map} +2 -2
- package/dist/cjs/myop_sdk.js +14 -14
- package/dist/cjs/myop_sdk.js.map +1 -1
- package/dist/cjs/myop_sdk.min.js +1 -1
- package/dist/cjs-bundled/myop_sdk.bundled.js +31 -6
- package/dist/cjs-bundled/myop_sdk.bundled.js.map +2 -2
- package/dist/cjs-bundled/myop_sdk.bundled.min.js +1 -1
- package/dist/module/Iframe/index.js +24 -5
- package/dist/module/Iframe/index.js.map +2 -2
- package/dist/module/SDK.js +31 -6
- package/dist/module/SDK.js.map +2 -2
- package/dist/module/embeddedSDK.js +1 -1
- package/dist/module/helpers/CloudRepository.d.ts +7 -0
- package/dist/module/helpers/cloudRepositoryHelpers.d.ts +6 -0
- package/dist/module/helpers/index.js +28 -4
- package/dist/module/helpers/index.js.map +2 -2
- package/dist/module/host/embeddedSDK.js +1 -1
- package/dist/module/host/index.js +24 -5
- package/dist/module/host/index.js.map +2 -2
- package/dist/module/webcomponent/index.js +24 -5
- package/dist/module/webcomponent/index.js.map +2 -2
- package/package.json +1 -1
- package/dist/cjs/_IframeSDK.7cd7468c.min.js +0 -1
- package/dist/cjs/_MyopHelpers.e8e1216b.min.js +0 -1
- package/dist/cjs/_WebComponentSDK.ead0b8a6.min.js +0 -1
- package/dist/cjs/_hostSDK.a882a5c1.min.js +0 -1
|
@@ -2040,7 +2040,7 @@ var WebcomponentLoader = class extends BaseMyopLoader {
|
|
|
2040
2040
|
};
|
|
2041
2041
|
|
|
2042
2042
|
// version:myop-sdk-version
|
|
2043
|
-
var myop_sdk_version_default = "0.3.
|
|
2043
|
+
var myop_sdk_version_default = "0.3.29";
|
|
2044
2044
|
|
|
2045
2045
|
// src/host/embeddedSDK.ts
|
|
2046
2046
|
var EMBEDDED_SDK_CONTENT = "";
|
|
@@ -2360,6 +2360,7 @@ var _CloudRepository = class _CloudRepository {
|
|
|
2360
2360
|
__publicField(this, "userFlows", {});
|
|
2361
2361
|
__publicField(this, "_defaultEnv", "production");
|
|
2362
2362
|
__publicField(this, "_envExplicitlySet", false);
|
|
2363
|
+
__publicField(this, "_staticMode", false);
|
|
2363
2364
|
}
|
|
2364
2365
|
static get Main() {
|
|
2365
2366
|
const globalMain = getGlobalMain();
|
|
@@ -2372,6 +2373,14 @@ var _CloudRepository = class _CloudRepository {
|
|
|
2372
2373
|
}
|
|
2373
2374
|
return _CloudRepository._main;
|
|
2374
2375
|
}
|
|
2376
|
+
/**
|
|
2377
|
+
* Enable static mode for self-hosted component registries.
|
|
2378
|
+
* In static mode, URLs are constructed as file paths instead of query params:
|
|
2379
|
+
* ${baseUrl}/components/${componentId}/${env}.json
|
|
2380
|
+
*/
|
|
2381
|
+
enableStaticMode() {
|
|
2382
|
+
this._staticMode = true;
|
|
2383
|
+
}
|
|
2375
2384
|
/**
|
|
2376
2385
|
* Set the default environment for this CloudRepository instance
|
|
2377
2386
|
*/
|
|
@@ -2436,11 +2445,21 @@ var _CloudRepository = class _CloudRepository {
|
|
|
2436
2445
|
this.variants[cacheKey] = new Promise(
|
|
2437
2446
|
async (resolve, reject) => {
|
|
2438
2447
|
try {
|
|
2439
|
-
let url
|
|
2440
|
-
if (
|
|
2441
|
-
|
|
2448
|
+
let url;
|
|
2449
|
+
if (this._staticMode) {
|
|
2450
|
+
const file = usePreview ? "preview" : env;
|
|
2451
|
+
url = "".concat(this._baseUrl, "/components/").concat(componentId, "/").concat(file, ".json");
|
|
2452
|
+
} else {
|
|
2453
|
+
url = "".concat(this._baseUrl, "/consume?id=").concat(componentId, "&env=").concat(env);
|
|
2454
|
+
if (usePreview) {
|
|
2455
|
+
url += "&preview=true";
|
|
2456
|
+
}
|
|
2442
2457
|
}
|
|
2443
2458
|
const res = await fetch(url);
|
|
2459
|
+
if (!res.ok) {
|
|
2460
|
+
reject(new Error('Failed to load component "'.concat(componentId, '" (').concat(res.status).concat(this._staticMode ? " from ".concat(url) : "", ")")));
|
|
2461
|
+
return;
|
|
2462
|
+
}
|
|
2444
2463
|
const json = await res.json();
|
|
2445
2464
|
const variant = json.item;
|
|
2446
2465
|
if (!variant) {
|