@fluid-app/portal-sdk 0.1.440 → 0.1.441
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/{FluidProvider-DBDlV2iq.cjs → FluidProvider-C_cuWVZC.cjs} +3 -146
- package/dist/FluidProvider-C_cuWVZC.cjs.map +1 -0
- package/dist/{FluidProvider-CkF8Whc3.mjs → FluidProvider-CsJUgoSM.mjs} +2 -145
- package/dist/FluidProvider-CsJUgoSM.mjs.map +1 -0
- package/dist/{MessagingScreen-ByQsherQ.mjs → MessagingScreen-CDnFbmbw.mjs} +2 -2
- package/dist/{MessagingScreen-ByQsherQ.mjs.map → MessagingScreen-CDnFbmbw.mjs.map} +1 -1
- package/dist/{MessagingScreen-CmKVY0He.mjs → MessagingScreen-DQupd_PN.mjs} +6 -3
- package/dist/{MessagingScreen-l_B0c2aV.cjs → MessagingScreen-Ny_orpNI.cjs} +2 -2
- package/dist/{MessagingScreen-l_B0c2aV.cjs.map → MessagingScreen-Ny_orpNI.cjs.map} +1 -1
- package/dist/{MessagingScreen-BwfTkYQC.cjs → MessagingScreen-Vt_hHDFR.cjs} +3 -3
- package/dist/{OrdersScreen-CUthnvdK.cjs → OrdersScreen-BP-RKjuy.cjs} +2 -2
- package/dist/{OrdersScreen-CUthnvdK.cjs.map → OrdersScreen-BP-RKjuy.cjs.map} +1 -1
- package/dist/{OrdersScreen-CDYR24I0.mjs → OrdersScreen-CcQE6M8k.mjs} +6 -3
- package/dist/{OrdersScreen-CHfKKpNj.mjs → OrdersScreen-ga8MvNCy.mjs} +2 -2
- package/dist/{OrdersScreen-CHfKKpNj.mjs.map → OrdersScreen-ga8MvNCy.mjs.map} +1 -1
- package/dist/{OrdersScreen-rZ5lOk4X.cjs → OrdersScreen-uJSCULoa.cjs} +3 -3
- package/dist/{ProfileScreen-DsiYj2jf.mjs → ProfileScreen-BH-AhZwH.mjs} +7 -4
- package/dist/{ProfileScreen-CahfNnG9.mjs → ProfileScreen-BK-x4vjE.mjs} +3 -3
- package/dist/{ProfileScreen-CahfNnG9.mjs.map → ProfileScreen-BK-x4vjE.mjs.map} +1 -1
- package/dist/{ProfileScreen-Cgva1mW4.cjs → ProfileScreen-Dnn9xC7Y.cjs} +3 -3
- package/dist/{ProfileScreen-Cgva1mW4.cjs.map → ProfileScreen-Dnn9xC7Y.cjs.map} +1 -1
- package/dist/{ProfileScreen-Dj6X-ujW.cjs → ProfileScreen-e5kl6PKN.cjs} +4 -4
- package/dist/{ShareablesScreen-VAb4ZRkI.mjs → ShareablesScreen-WgGyMd_5.mjs} +3 -0
- package/dist/{ShopScreen-BSrWQpcJ.cjs → ShopScreen-CXk4U0TH.cjs} +3 -3
- package/dist/{ShopScreen-BBulD_rH.cjs → ShopScreen-CgmIvtS3.cjs} +2 -2
- package/dist/{ShopScreen-BBulD_rH.cjs.map → ShopScreen-CgmIvtS3.cjs.map} +1 -1
- package/dist/{ShopScreen-Cjj7mn9_.mjs → ShopScreen-LVPXySQ2.mjs} +6 -3
- package/dist/{ShopScreen-DSjZYt-8.mjs → ShopScreen-Tmq0_NAx.mjs} +2 -2
- package/dist/{ShopScreen-DSjZYt-8.mjs.map → ShopScreen-Tmq0_NAx.mjs.map} +1 -1
- package/dist/{SubscriptionsScreen-b4VbNe9j.mjs → SubscriptionsScreen-BAAgX5uH.mjs} +3 -3
- package/dist/{SubscriptionsScreen-b4VbNe9j.mjs.map → SubscriptionsScreen-BAAgX5uH.mjs.map} +1 -1
- package/dist/{SubscriptionsScreen-q64Zsn2K.cjs → SubscriptionsScreen-BvKkEmIk.cjs} +3 -3
- package/dist/{SubscriptionsScreen-q64Zsn2K.cjs.map → SubscriptionsScreen-BvKkEmIk.cjs.map} +1 -1
- package/dist/{SubscriptionsScreen-_-g8yZJp.cjs → SubscriptionsScreen-DmMC_ARB.cjs} +4 -4
- package/dist/{SubscriptionsScreen-CUDYT7aW.mjs → SubscriptionsScreen-WxtRBnWb.mjs} +7 -4
- package/dist/build-remote-widget-plugin-manifests-CEaKMrqR.d.cts.map +1 -1
- package/dist/build-remote-widget-plugin-manifests-DUbQaMsx.d.mts.map +1 -1
- package/dist/{build-widget-registry-M8PLSoaQ.cjs → build-widget-registry-BQ1Re7ib.cjs} +204 -53
- package/dist/build-widget-registry-BQ1Re7ib.cjs.map +1 -0
- package/dist/{build-widget-registry-DCUqmbJi.mjs → build-widget-registry-DPQbuyej.mjs} +198 -53
- package/dist/build-widget-registry-DPQbuyej.mjs.map +1 -0
- package/dist/index.cjs +18 -18
- package/dist/index.mjs +20 -20
- package/dist/{use-portal-card-add-3ds-flow-CLQ8CieI.cjs → use-portal-card-add-3ds-flow-5bwm5fdZ.cjs} +2 -2
- package/dist/{use-portal-card-add-3ds-flow-CLQ8CieI.cjs.map → use-portal-card-add-3ds-flow-5bwm5fdZ.cjs.map} +1 -1
- package/dist/{use-portal-card-add-3ds-flow-CM2zXEw1.mjs → use-portal-card-add-3ds-flow-DasoWy59.mjs} +2 -2
- package/dist/{use-portal-card-add-3ds-flow-CM2zXEw1.mjs.map → use-portal-card-add-3ds-flow-DasoWy59.mjs.map} +1 -1
- package/dist/utils/build-remote-widget-plugin-manifests.cjs +1 -1
- package/dist/utils/build-remote-widget-plugin-manifests.mjs +3 -1
- package/dist/utils/build-remote-widget-plugin-manifests.mjs.map +1 -1
- package/package.json +14 -14
- package/dist/FluidProvider-CkF8Whc3.mjs.map +0 -1
- package/dist/FluidProvider-DBDlV2iq.cjs.map +0 -1
- package/dist/build-widget-registry-DCUqmbJi.mjs.map +0 -1
- package/dist/build-widget-registry-M8PLSoaQ.cjs.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { $ as subscriptions_list, A as activities_list, C as content_playlists_by_shares, D as playlists_show, E as pages_show, F as catch_ups_list, G as products_search, H as product_by_visits, I as enrollment_pack_by_shares, K as products_show, L as enrollment_pack_by_visits, M as app_widget_packages_list, N as calendar_events_list, O as account_show, R as enrollment_packs_show, S as content_pages_by_visits, T as media_show, U as products_list, V as product_by_shares, W as products_media_list, b as content_media_by_visits, ct as todos_destroy, ft as __exportAll, j as app_manifest_show, k as account_update, lt as todos_list, n as shareablesDomain, q as store_show, r as PortalContentApiProvider, st as todos_create, ut as todos_update, w as content_playlists_by_visits, x as content_pages_by_shares, y as content_media_by_shares, z as orders_list } from "./translation-adapter-DfYF3TS7.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { J as AppDefinitionApiProvider, S as applyTheme, U as resolveTheme, X as createPersister, _ as DEFAULT_SDK_WIDGET_REGISTRY, g as isRemoteDomWidgetPackageDescriptor, t as buildRemoteWidgetRegistry, w as removeTheme } from "./build-widget-registry-DPQbuyej.mjs";
|
|
3
3
|
import { d as DataSourceApiProvider, l as RegistryProvider } from "./ScreenRenderer-BQz-1cCn.mjs";
|
|
4
4
|
import { n as AccountApiProvider, t as useAccount } from "./use-account-DR6HXMw_.mjs";
|
|
5
5
|
import { a as StoreApiProvider } from "./use-optional-store-DpB_jK4Q.mjs";
|
|
@@ -7340,149 +7340,6 @@ function resolveLocale(supportedCodes) {
|
|
|
7340
7340
|
if (match) return match;
|
|
7341
7341
|
return supportedCodes[0] ?? "en";
|
|
7342
7342
|
}
|
|
7343
|
-
const REMOTE_DOM_WIDGET_RUNTIME = "remote-dom";
|
|
7344
|
-
const PACKAGE_FIELDS = new Set([
|
|
7345
|
-
"manifestVersion",
|
|
7346
|
-
"runtime",
|
|
7347
|
-
"packageId",
|
|
7348
|
-
"source",
|
|
7349
|
-
"version",
|
|
7350
|
-
"workerEntryUrl",
|
|
7351
|
-
"cssUrls",
|
|
7352
|
-
"assetUrls",
|
|
7353
|
-
"widgets"
|
|
7354
|
-
]);
|
|
7355
|
-
const WIDGET_FIELDS = new Set([
|
|
7356
|
-
"type",
|
|
7357
|
-
"displayName",
|
|
7358
|
-
"description",
|
|
7359
|
-
"icon",
|
|
7360
|
-
"category",
|
|
7361
|
-
"propertySchema",
|
|
7362
|
-
"defaultProps",
|
|
7363
|
-
"container",
|
|
7364
|
-
"resizable",
|
|
7365
|
-
"minSdkVersion",
|
|
7366
|
-
"capabilities"
|
|
7367
|
-
]);
|
|
7368
|
-
const CAPABILITY_FIELDS = new Set(["name", "version"]);
|
|
7369
|
-
const UNSAFE_JSON_KEYS = new Set([
|
|
7370
|
-
"__proto__",
|
|
7371
|
-
"constructor",
|
|
7372
|
-
"prototype"
|
|
7373
|
-
]);
|
|
7374
|
-
function isRemoteDomWidgetPackageDescriptor(value) {
|
|
7375
|
-
return getRemoteDomWidgetPackageInvalidReason(value) === void 0;
|
|
7376
|
-
}
|
|
7377
|
-
function getRemoteDomWidgetPackageInvalidReason(value) {
|
|
7378
|
-
if (!isRecord(value)) return "descriptor must be an object";
|
|
7379
|
-
const unexpectedFieldReason = getUnexpectedFieldReason(value, PACKAGE_FIELDS, "descriptor");
|
|
7380
|
-
if (unexpectedFieldReason) return unexpectedFieldReason;
|
|
7381
|
-
if (value.manifestVersion !== 1) return `manifestVersion must be 1`;
|
|
7382
|
-
if (value.runtime !== "remote-dom") return `runtime must be ${REMOTE_DOM_WIDGET_RUNTIME}`;
|
|
7383
|
-
const packageIdReason = getNonEmptyStringReason(value.packageId, "packageId");
|
|
7384
|
-
if (packageIdReason) return packageIdReason;
|
|
7385
|
-
if (value.source !== "company" && value.source !== "droplet") return "source must be company or droplet";
|
|
7386
|
-
const versionReason = getNonEmptyStringReason(value.version, "version");
|
|
7387
|
-
if (versionReason) return versionReason;
|
|
7388
|
-
const workerEntryUrlReason = getHttpUrlReason(value.workerEntryUrl, "workerEntryUrl");
|
|
7389
|
-
if (workerEntryUrlReason) return workerEntryUrlReason;
|
|
7390
|
-
const cssUrlsReason = getUrlArrayReason(value.cssUrls, "cssUrls");
|
|
7391
|
-
if (cssUrlsReason) return cssUrlsReason;
|
|
7392
|
-
const assetUrlsReason = getUrlArrayReason(value.assetUrls, "assetUrls");
|
|
7393
|
-
if (assetUrlsReason) return assetUrlsReason;
|
|
7394
|
-
if (!Array.isArray(value.widgets) || value.widgets.length === 0) return "widgets must be a non-empty array";
|
|
7395
|
-
const widgetTypes = /* @__PURE__ */ new Set();
|
|
7396
|
-
for (let index = 0; index < value.widgets.length; index += 1) {
|
|
7397
|
-
const widget = value.widgets[index];
|
|
7398
|
-
const widgetReason = getWidgetReason(widget, `widgets[${index}]`);
|
|
7399
|
-
if (widgetReason) return widgetReason;
|
|
7400
|
-
const widgetType = widget.type;
|
|
7401
|
-
if (widgetTypes.has(widgetType)) return `widgets contains duplicate type ${widgetType}`;
|
|
7402
|
-
widgetTypes.add(widgetType);
|
|
7403
|
-
}
|
|
7404
|
-
}
|
|
7405
|
-
function getWidgetReason(value, path) {
|
|
7406
|
-
if (!isRecord(value)) return `${path} must be an object`;
|
|
7407
|
-
const unexpectedFieldReason = getUnexpectedFieldReason(value, WIDGET_FIELDS, path);
|
|
7408
|
-
if (unexpectedFieldReason) return unexpectedFieldReason;
|
|
7409
|
-
for (const field of [
|
|
7410
|
-
"type",
|
|
7411
|
-
"displayName",
|
|
7412
|
-
"description",
|
|
7413
|
-
"icon",
|
|
7414
|
-
"category",
|
|
7415
|
-
"minSdkVersion"
|
|
7416
|
-
]) {
|
|
7417
|
-
const reason = getNonEmptyStringReason(value[field], `${path}.${field}`);
|
|
7418
|
-
if (reason) return reason;
|
|
7419
|
-
}
|
|
7420
|
-
if (!isRecord(value.propertySchema) || !isJsonValue(value.propertySchema)) return `${path}.propertySchema must be a JSON object`;
|
|
7421
|
-
if (!isRecord(value.defaultProps) || !isJsonValue(value.defaultProps)) return `${path}.defaultProps must be a JSON object`;
|
|
7422
|
-
if (value.container !== "inline" && value.container !== "block" && value.container !== "card" && value.container !== "fullscreen") return `${path}.container is unsupported`;
|
|
7423
|
-
if (typeof value.resizable !== "boolean" && value.resizable !== "horizontal" && value.resizable !== "vertical" && value.resizable !== "both") return `${path}.resizable is unsupported`;
|
|
7424
|
-
if (!Array.isArray(value.capabilities)) return `${path}.capabilities must be an array`;
|
|
7425
|
-
const capabilityNames = /* @__PURE__ */ new Set();
|
|
7426
|
-
for (let index = 0; index < value.capabilities.length; index += 1) {
|
|
7427
|
-
const capability = value.capabilities[index];
|
|
7428
|
-
const capabilityPath = `${path}.capabilities[${index}]`;
|
|
7429
|
-
if (!isRecord(capability)) return `${capabilityPath} must be an object`;
|
|
7430
|
-
const unexpectedFieldReason = getUnexpectedFieldReason(capability, CAPABILITY_FIELDS, capabilityPath);
|
|
7431
|
-
if (unexpectedFieldReason) return unexpectedFieldReason;
|
|
7432
|
-
const capabilityName = capability.name;
|
|
7433
|
-
const nameReason = getNonEmptyStringReason(capabilityName, `${capabilityPath}.name`);
|
|
7434
|
-
if (nameReason) return nameReason;
|
|
7435
|
-
if (typeof capabilityName !== "string") return `${capabilityPath}.name must be a non-empty string`;
|
|
7436
|
-
const versionReason = getNonEmptyStringReason(capability.version, `${capabilityPath}.version`);
|
|
7437
|
-
if (versionReason) return versionReason;
|
|
7438
|
-
if (capabilityNames.has(capabilityName)) return `${path}.capabilities contains duplicate name ${capabilityName}`;
|
|
7439
|
-
capabilityNames.add(capabilityName);
|
|
7440
|
-
}
|
|
7441
|
-
}
|
|
7442
|
-
function getUrlArrayReason(value, path) {
|
|
7443
|
-
if (!Array.isArray(value)) return `${path} must be an array`;
|
|
7444
|
-
for (let index = 0; index < value.length; index += 1) {
|
|
7445
|
-
const reason = getHttpUrlReason(value[index], `${path}[${index}]`);
|
|
7446
|
-
if (reason) return reason;
|
|
7447
|
-
}
|
|
7448
|
-
}
|
|
7449
|
-
function getHttpUrlReason(value, path) {
|
|
7450
|
-
const stringReason = getNonEmptyStringReason(value, path);
|
|
7451
|
-
if (stringReason) return stringReason;
|
|
7452
|
-
if (typeof value !== "string") return `${path} must be a non-empty string`;
|
|
7453
|
-
try {
|
|
7454
|
-
const url = new URL(value);
|
|
7455
|
-
if (url.protocol !== "http:" && url.protocol !== "https:") return `${path} must use http or https`;
|
|
7456
|
-
if (url.username || url.password) return `${path} must not contain credentials`;
|
|
7457
|
-
} catch {
|
|
7458
|
-
return `${path} must be an absolute URL`;
|
|
7459
|
-
}
|
|
7460
|
-
}
|
|
7461
|
-
function getNonEmptyStringReason(value, path) {
|
|
7462
|
-
if (typeof value !== "string" || value.trim().length === 0) return `${path} must be a non-empty string`;
|
|
7463
|
-
if (value !== value.trim()) return `${path} must not have surrounding whitespace`;
|
|
7464
|
-
if (/\p{Cc}/u.test(value)) return `${path} must not contain control characters`;
|
|
7465
|
-
}
|
|
7466
|
-
function isJsonValue(value) {
|
|
7467
|
-
return isJsonValueAtDepth(value, /* @__PURE__ */ new WeakSet(), 0);
|
|
7468
|
-
}
|
|
7469
|
-
function isJsonValueAtDepth(value, ancestors, depth) {
|
|
7470
|
-
if (value === null || typeof value === "string" || typeof value === "boolean") return true;
|
|
7471
|
-
if (typeof value === "number") return Number.isFinite(value);
|
|
7472
|
-
if (typeof value !== "object" || depth > 50 || ancestors.has(value)) return false;
|
|
7473
|
-
ancestors.add(value);
|
|
7474
|
-
const prototype = Object.getPrototypeOf(value);
|
|
7475
|
-
const isJson = Array.isArray(value) ? value.every((item) => isJsonValueAtDepth(item, ancestors, depth + 1)) : (prototype === Object.prototype || prototype === null) && isRecord(value) && Object.entries(value).every(([key, item]) => !UNSAFE_JSON_KEYS.has(key) && isJsonValueAtDepth(item, ancestors, depth + 1));
|
|
7476
|
-
ancestors.delete(value);
|
|
7477
|
-
return isJson;
|
|
7478
|
-
}
|
|
7479
|
-
function isRecord(value) {
|
|
7480
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
7481
|
-
}
|
|
7482
|
-
function getUnexpectedFieldReason(value, allowedFields, path) {
|
|
7483
|
-
const unexpectedField = Object.keys(value).find((field) => !allowedFields.has(field));
|
|
7484
|
-
return unexpectedField ? `${path} contains unsupported field ${unexpectedField}` : void 0;
|
|
7485
|
-
}
|
|
7486
7343
|
//#endregion
|
|
7487
7344
|
//#region src/adapters/remote-widget-catalog-api-adapter.ts
|
|
7488
7345
|
/** Creates the canonical Remote DOM catalog adapter backed by portal-tenant. */
|
|
@@ -7842,4 +7699,4 @@ function useFluidContext() {
|
|
|
7842
7699
|
//#endregion
|
|
7843
7700
|
export { isApiError as _, messagingDomain as a, useLanguagesApi as b, createSubscriptionsTranslationAdapter as c, ordersDomain as d, useShopTranslation as f, ApiError as g, useThemeContext as h, createMessagingTranslationAdapter as i, subscriptionsDomain as l, FluidThemeProvider as m, useFluidContext as n, createProfileTranslationAdapter as o, shellEn as p, SUPPORTED_LANGUAGES as r, profileDomain as s, FluidProvider as t, createOrdersTranslationAdapter as u, useAddressFieldsApiOptional as v, usePayApi as x, useAddressAutocompleteApi as y };
|
|
7844
7701
|
|
|
7845
|
-
//# sourceMappingURL=FluidProvider-
|
|
7702
|
+
//# sourceMappingURL=FluidProvider-CsJUgoSM.mjs.map
|