@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
|
@@ -31,7 +31,6 @@ import { useQuery } from "@tanstack/react-query";
|
|
|
31
31
|
import { jsx } from "react/jsx-runtime";
|
|
32
32
|
import Color from "colorjs.io";
|
|
33
33
|
import { SearchSort } from "@fluid-app/ui-components/components/SearchSort";
|
|
34
|
-
import { isRemoteDomSerializableValue, mountRemoteDomWidget } from "@fluid-app/widget-runtime/remote-dom";
|
|
35
34
|
import { createRoot } from "react-dom/client";
|
|
36
35
|
//#region ../../../node_modules/.pnpm/@tanstack+query-core@5.101.0/node_modules/@tanstack/query-core/build/modern/timeoutManager.js
|
|
37
36
|
var defaultTimeoutProvider = {
|
|
@@ -1449,6 +1448,149 @@ const DEFAULT_SDK_WIDGET_REGISTRY = createWidgetRegistry({
|
|
|
1449
1448
|
ToDoWidget,
|
|
1450
1449
|
VideoWidget
|
|
1451
1450
|
});
|
|
1451
|
+
const REMOTE_DOM_WIDGET_RUNTIME = "remote-dom";
|
|
1452
|
+
const PACKAGE_FIELDS = new Set([
|
|
1453
|
+
"manifestVersion",
|
|
1454
|
+
"runtime",
|
|
1455
|
+
"packageId",
|
|
1456
|
+
"source",
|
|
1457
|
+
"version",
|
|
1458
|
+
"workerEntryUrl",
|
|
1459
|
+
"cssUrls",
|
|
1460
|
+
"assetUrls",
|
|
1461
|
+
"widgets"
|
|
1462
|
+
]);
|
|
1463
|
+
const WIDGET_FIELDS = new Set([
|
|
1464
|
+
"type",
|
|
1465
|
+
"displayName",
|
|
1466
|
+
"description",
|
|
1467
|
+
"icon",
|
|
1468
|
+
"category",
|
|
1469
|
+
"propertySchema",
|
|
1470
|
+
"defaultProps",
|
|
1471
|
+
"container",
|
|
1472
|
+
"resizable",
|
|
1473
|
+
"minSdkVersion",
|
|
1474
|
+
"capabilities"
|
|
1475
|
+
]);
|
|
1476
|
+
const CAPABILITY_FIELDS = new Set(["name", "version"]);
|
|
1477
|
+
const UNSAFE_JSON_KEYS = new Set([
|
|
1478
|
+
"__proto__",
|
|
1479
|
+
"constructor",
|
|
1480
|
+
"prototype"
|
|
1481
|
+
]);
|
|
1482
|
+
function isRemoteDomWidgetPackageDescriptor(value) {
|
|
1483
|
+
return getRemoteDomWidgetPackageInvalidReason(value) === void 0;
|
|
1484
|
+
}
|
|
1485
|
+
function getRemoteDomWidgetPackageInvalidReason(value) {
|
|
1486
|
+
if (!isRecord$1(value)) return "descriptor must be an object";
|
|
1487
|
+
const unexpectedFieldReason = getUnexpectedFieldReason(value, PACKAGE_FIELDS, "descriptor");
|
|
1488
|
+
if (unexpectedFieldReason) return unexpectedFieldReason;
|
|
1489
|
+
if (value.manifestVersion !== 1) return `manifestVersion must be 1`;
|
|
1490
|
+
if (value.runtime !== "remote-dom") return `runtime must be ${REMOTE_DOM_WIDGET_RUNTIME}`;
|
|
1491
|
+
const packageIdReason = getNonEmptyStringReason(value.packageId, "packageId");
|
|
1492
|
+
if (packageIdReason) return packageIdReason;
|
|
1493
|
+
if (value.source !== "company" && value.source !== "droplet") return "source must be company or droplet";
|
|
1494
|
+
const versionReason = getNonEmptyStringReason(value.version, "version");
|
|
1495
|
+
if (versionReason) return versionReason;
|
|
1496
|
+
const workerEntryUrlReason = getHttpUrlReason(value.workerEntryUrl, "workerEntryUrl");
|
|
1497
|
+
if (workerEntryUrlReason) return workerEntryUrlReason;
|
|
1498
|
+
const cssUrlsReason = getUrlArrayReason(value.cssUrls, "cssUrls");
|
|
1499
|
+
if (cssUrlsReason) return cssUrlsReason;
|
|
1500
|
+
const assetUrlsReason = getUrlArrayReason(value.assetUrls, "assetUrls");
|
|
1501
|
+
if (assetUrlsReason) return assetUrlsReason;
|
|
1502
|
+
if (!Array.isArray(value.widgets) || value.widgets.length === 0) return "widgets must be a non-empty array";
|
|
1503
|
+
const widgetTypes = /* @__PURE__ */ new Set();
|
|
1504
|
+
for (let index = 0; index < value.widgets.length; index += 1) {
|
|
1505
|
+
const widget = value.widgets[index];
|
|
1506
|
+
const widgetReason = getWidgetReason(widget, `widgets[${index}]`);
|
|
1507
|
+
if (widgetReason) return widgetReason;
|
|
1508
|
+
const widgetType = widget.type;
|
|
1509
|
+
if (widgetTypes.has(widgetType)) return `widgets contains duplicate type ${widgetType}`;
|
|
1510
|
+
widgetTypes.add(widgetType);
|
|
1511
|
+
}
|
|
1512
|
+
}
|
|
1513
|
+
function getWidgetReason(value, path) {
|
|
1514
|
+
if (!isRecord$1(value)) return `${path} must be an object`;
|
|
1515
|
+
const unexpectedFieldReason = getUnexpectedFieldReason(value, WIDGET_FIELDS, path);
|
|
1516
|
+
if (unexpectedFieldReason) return unexpectedFieldReason;
|
|
1517
|
+
for (const field of [
|
|
1518
|
+
"type",
|
|
1519
|
+
"displayName",
|
|
1520
|
+
"description",
|
|
1521
|
+
"icon",
|
|
1522
|
+
"category",
|
|
1523
|
+
"minSdkVersion"
|
|
1524
|
+
]) {
|
|
1525
|
+
const reason = getNonEmptyStringReason(value[field], `${path}.${field}`);
|
|
1526
|
+
if (reason) return reason;
|
|
1527
|
+
}
|
|
1528
|
+
if (!isRecord$1(value.propertySchema) || !isJsonValue(value.propertySchema)) return `${path}.propertySchema must be a JSON object`;
|
|
1529
|
+
if (!isRecord$1(value.defaultProps) || !isJsonValue(value.defaultProps)) return `${path}.defaultProps must be a JSON object`;
|
|
1530
|
+
if (value.container !== "inline" && value.container !== "block" && value.container !== "card" && value.container !== "fullscreen") return `${path}.container is unsupported`;
|
|
1531
|
+
if (typeof value.resizable !== "boolean" && value.resizable !== "horizontal" && value.resizable !== "vertical" && value.resizable !== "both") return `${path}.resizable is unsupported`;
|
|
1532
|
+
if (!Array.isArray(value.capabilities)) return `${path}.capabilities must be an array`;
|
|
1533
|
+
const capabilityNames = /* @__PURE__ */ new Set();
|
|
1534
|
+
for (let index = 0; index < value.capabilities.length; index += 1) {
|
|
1535
|
+
const capability = value.capabilities[index];
|
|
1536
|
+
const capabilityPath = `${path}.capabilities[${index}]`;
|
|
1537
|
+
if (!isRecord$1(capability)) return `${capabilityPath} must be an object`;
|
|
1538
|
+
const unexpectedFieldReason = getUnexpectedFieldReason(capability, CAPABILITY_FIELDS, capabilityPath);
|
|
1539
|
+
if (unexpectedFieldReason) return unexpectedFieldReason;
|
|
1540
|
+
const capabilityName = capability.name;
|
|
1541
|
+
const nameReason = getNonEmptyStringReason(capabilityName, `${capabilityPath}.name`);
|
|
1542
|
+
if (nameReason) return nameReason;
|
|
1543
|
+
if (typeof capabilityName !== "string") return `${capabilityPath}.name must be a non-empty string`;
|
|
1544
|
+
const versionReason = getNonEmptyStringReason(capability.version, `${capabilityPath}.version`);
|
|
1545
|
+
if (versionReason) return versionReason;
|
|
1546
|
+
if (capabilityNames.has(capabilityName)) return `${path}.capabilities contains duplicate name ${capabilityName}`;
|
|
1547
|
+
capabilityNames.add(capabilityName);
|
|
1548
|
+
}
|
|
1549
|
+
}
|
|
1550
|
+
function getUrlArrayReason(value, path) {
|
|
1551
|
+
if (!Array.isArray(value)) return `${path} must be an array`;
|
|
1552
|
+
for (let index = 0; index < value.length; index += 1) {
|
|
1553
|
+
const reason = getHttpUrlReason(value[index], `${path}[${index}]`);
|
|
1554
|
+
if (reason) return reason;
|
|
1555
|
+
}
|
|
1556
|
+
}
|
|
1557
|
+
function getHttpUrlReason(value, path) {
|
|
1558
|
+
const stringReason = getNonEmptyStringReason(value, path);
|
|
1559
|
+
if (stringReason) return stringReason;
|
|
1560
|
+
if (typeof value !== "string") return `${path} must be a non-empty string`;
|
|
1561
|
+
try {
|
|
1562
|
+
const url = new URL(value);
|
|
1563
|
+
if (url.protocol !== "http:" && url.protocol !== "https:") return `${path} must use http or https`;
|
|
1564
|
+
if (url.username || url.password) return `${path} must not contain credentials`;
|
|
1565
|
+
} catch {
|
|
1566
|
+
return `${path} must be an absolute URL`;
|
|
1567
|
+
}
|
|
1568
|
+
}
|
|
1569
|
+
function getNonEmptyStringReason(value, path) {
|
|
1570
|
+
if (typeof value !== "string" || value.trim().length === 0) return `${path} must be a non-empty string`;
|
|
1571
|
+
if (value !== value.trim()) return `${path} must not have surrounding whitespace`;
|
|
1572
|
+
if (/\p{Cc}/u.test(value)) return `${path} must not contain control characters`;
|
|
1573
|
+
}
|
|
1574
|
+
function isJsonValue(value) {
|
|
1575
|
+
return isJsonValueAtDepth(value, /* @__PURE__ */ new WeakSet(), 0);
|
|
1576
|
+
}
|
|
1577
|
+
function isJsonValueAtDepth(value, ancestors, depth) {
|
|
1578
|
+
if (value === null || typeof value === "string" || typeof value === "boolean") return true;
|
|
1579
|
+
if (typeof value === "number") return Number.isFinite(value);
|
|
1580
|
+
if (typeof value !== "object" || depth > 50 || ancestors.has(value)) return false;
|
|
1581
|
+
ancestors.add(value);
|
|
1582
|
+
const prototype = Object.getPrototypeOf(value);
|
|
1583
|
+
const isJson = Array.isArray(value) ? value.every((item) => isJsonValueAtDepth(item, ancestors, depth + 1)) : (prototype === Object.prototype || prototype === null) && isRecord$1(value) && Object.entries(value).every(([key, item]) => !UNSAFE_JSON_KEYS.has(key) && isJsonValueAtDepth(item, ancestors, depth + 1));
|
|
1584
|
+
ancestors.delete(value);
|
|
1585
|
+
return isJson;
|
|
1586
|
+
}
|
|
1587
|
+
function isRecord$1(value) {
|
|
1588
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
1589
|
+
}
|
|
1590
|
+
function getUnexpectedFieldReason(value, allowedFields, path) {
|
|
1591
|
+
const unexpectedField = Object.keys(value).find((field) => !allowedFields.has(field));
|
|
1592
|
+
return unexpectedField ? `${path} contains unsupported field ${unexpectedField}` : void 0;
|
|
1593
|
+
}
|
|
1452
1594
|
//#endregion
|
|
1453
1595
|
//#region src/hooks/query-keys.ts
|
|
1454
1596
|
/**
|
|
@@ -2228,43 +2370,46 @@ function useScreenAreaFullscreenSnapshot() {
|
|
|
2228
2370
|
const FLUID_SPACER_WIDGET_TAG_NAME = "fluid-spacer-widget";
|
|
2229
2371
|
/** Registers the one portal-widgets element available to remote workers. */
|
|
2230
2372
|
function registerFluidSpacerWidgetElement() {
|
|
2231
|
-
if (typeof customElements === "undefined" || customElements.get("fluid-spacer-widget")) return;
|
|
2232
|
-
customElements.define(FLUID_SPACER_WIDGET_TAG_NAME,
|
|
2233
|
-
}
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
};
|
|
2373
|
+
if (typeof customElements === "undefined" || typeof HTMLElement === "undefined" || customElements.get("fluid-spacer-widget")) return;
|
|
2374
|
+
customElements.define(FLUID_SPACER_WIDGET_TAG_NAME, createFluidSpacerWidgetElement());
|
|
2375
|
+
}
|
|
2376
|
+
/** Keeps browser globals lazy so importing the registry remains safe during SSR. */
|
|
2377
|
+
function createFluidSpacerWidgetElement() {
|
|
2378
|
+
return class FluidSpacerWidgetElement extends HTMLElement {
|
|
2379
|
+
#root;
|
|
2380
|
+
#customHeight;
|
|
2381
|
+
#previewMode = false;
|
|
2382
|
+
set customHeight(value) {
|
|
2383
|
+
this.#customHeight = typeof value === "string" ? value : void 0;
|
|
2384
|
+
this.#render();
|
|
2385
|
+
}
|
|
2386
|
+
get customHeight() {
|
|
2387
|
+
return this.#customHeight;
|
|
2388
|
+
}
|
|
2389
|
+
set previewMode(value) {
|
|
2390
|
+
this.#previewMode = value === true;
|
|
2391
|
+
this.#render();
|
|
2392
|
+
}
|
|
2393
|
+
get previewMode() {
|
|
2394
|
+
return this.#previewMode;
|
|
2395
|
+
}
|
|
2396
|
+
connectedCallback() {
|
|
2397
|
+
this.#render();
|
|
2398
|
+
}
|
|
2399
|
+
disconnectedCallback() {
|
|
2400
|
+
this.#root?.unmount();
|
|
2401
|
+
this.#root = void 0;
|
|
2402
|
+
}
|
|
2403
|
+
#render() {
|
|
2404
|
+
if (!this.isConnected) return;
|
|
2405
|
+
this.#root ??= createRoot(this);
|
|
2406
|
+
this.#root.render(/* @__PURE__ */ jsx(SpacerWidget, {
|
|
2407
|
+
...this.#customHeight === void 0 ? {} : { customHeight: this.#customHeight },
|
|
2408
|
+
previewMode: this.#previewMode
|
|
2409
|
+
}));
|
|
2410
|
+
}
|
|
2411
|
+
};
|
|
2412
|
+
}
|
|
2268
2413
|
//#endregion
|
|
2269
2414
|
//#region src/widgets/remote-dom-elements.tsx
|
|
2270
2415
|
const FLUID_SEARCH_SORT_TAG_NAME = "fluid-ui-search-sort";
|
|
@@ -2417,7 +2562,8 @@ function createRemoteWidgetComponent(remotePackage, widget, options, functionImp
|
|
|
2417
2562
|
if (!host || !serialization.ok) return;
|
|
2418
2563
|
let handle;
|
|
2419
2564
|
let active = true;
|
|
2420
|
-
|
|
2565
|
+
import("@fluid-app/widget-runtime/remote-dom").then(({ mountRemoteDomWidget }) => {
|
|
2566
|
+
if (!active) return;
|
|
2421
2567
|
setError(null);
|
|
2422
2568
|
handle = mountRemoteDomWidget({
|
|
2423
2569
|
host,
|
|
@@ -2431,7 +2577,7 @@ function createRemoteWidgetComponent(remotePackage, widget, options, functionImp
|
|
|
2431
2577
|
capabilities: widget.capabilities
|
|
2432
2578
|
},
|
|
2433
2579
|
props: serializablePropsRef.current,
|
|
2434
|
-
|
|
2580
|
+
hostOrigin: window.location.origin,
|
|
2435
2581
|
onNavigate: (intent) => {
|
|
2436
2582
|
if (options.onNavigate) {
|
|
2437
2583
|
options.onNavigate(intent);
|
|
@@ -2446,7 +2592,7 @@ function createRemoteWidgetComponent(remotePackage, widget, options, functionImp
|
|
|
2446
2592
|
const onFullscreen = options.onFullscreen;
|
|
2447
2593
|
const observe = onFullscreen ? async (observedRequest) => {
|
|
2448
2594
|
try {
|
|
2449
|
-
if (!
|
|
2595
|
+
if (!isJsonValue(await onFullscreen(observedRequest))) throwPortalFunctionHostError("INVALID_RESPONSE", "Host implementation returned an invalid response for portal function \"fullscreen\".");
|
|
2450
2596
|
} catch (error) {
|
|
2451
2597
|
if (isPortalFunctionHostError(error)) throw error;
|
|
2452
2598
|
throwPortalFunctionHostError("HOST_FAILURE", "Host implementation failed for portal function \"fullscreen\".");
|
|
@@ -2480,26 +2626,25 @@ function createRemoteWidgetComponent(remotePackage, widget, options, functionImp
|
|
|
2480
2626
|
} catch {
|
|
2481
2627
|
throwPortalFunctionHostError("HOST_FAILURE", `Host implementation failed for portal function "${capability}.${method}".`);
|
|
2482
2628
|
}
|
|
2483
|
-
if (!
|
|
2629
|
+
if (!isJsonValue(result)) throwPortalFunctionHostError("INVALID_RESPONSE", `Host implementation returned an invalid response for portal function "${capability}.${method}".`);
|
|
2484
2630
|
return result;
|
|
2485
2631
|
},
|
|
2486
2632
|
onError: (runtimeError) => {
|
|
2487
2633
|
if (active) setError(runtimeError);
|
|
2488
2634
|
}
|
|
2489
2635
|
});
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
if (active) setError(toError(readyError));
|
|
2636
|
+
handleRef.current = handle;
|
|
2637
|
+
handle.ready.catch((readyError) => {
|
|
2638
|
+
if (active) setError(toError(readyError));
|
|
2639
|
+
});
|
|
2640
|
+
}).catch((mountError) => {
|
|
2641
|
+
if (active) setError(toError(mountError));
|
|
2497
2642
|
});
|
|
2498
2643
|
return () => {
|
|
2499
2644
|
active = false;
|
|
2500
2645
|
fullscreenCoordinatorRef.current?.disposeOwner(fullscreenOwner);
|
|
2501
2646
|
handleRef.current = null;
|
|
2502
|
-
handle
|
|
2647
|
+
handle?.dispose();
|
|
2503
2648
|
};
|
|
2504
2649
|
}, [fullscreenOwner, serialization.ok]);
|
|
2505
2650
|
useEffect(() => {
|
|
@@ -2546,7 +2691,7 @@ function isPortalFunctionHostError(error) {
|
|
|
2546
2691
|
return error instanceof Error && error.message.includes("PORTAL_FUNCTION_ERROR:");
|
|
2547
2692
|
}
|
|
2548
2693
|
function serializeProps(value) {
|
|
2549
|
-
return
|
|
2694
|
+
return isJsonValue(value) ? {
|
|
2550
2695
|
ok: true,
|
|
2551
2696
|
value
|
|
2552
2697
|
} : {
|
|
@@ -2566,6 +2711,6 @@ function isBuiltInWidgetType(widgetType) {
|
|
|
2566
2711
|
return Object.prototype.hasOwnProperty.call(DEFAULT_SDK_WIDGET_REGISTRY, widgetType);
|
|
2567
2712
|
}
|
|
2568
2713
|
//#endregion
|
|
2569
|
-
export {
|
|
2714
|
+
export { DEFAULT_COLORS as A, getForegroundColor as B, removeAllThemes as C, transformThemes as D, getActiveThemeId as E, DEFAULT_THEME_ID as F, FONT_SIZE_KEYS as G, parseColor as H, DEFAULT_THEME_NAME as I, AppDefinitionApiProvider as J, RADIUS_KEYS as K, getDefaultThemeDefinition as L, DEFAULT_FONT_SIZES as M, DEFAULT_RADII as N, deserialiseTheme as O, DEFAULT_SPACING as P, generateThemeCSS as R, applyTheme as S, buildThemeDefinition as T, resolveTheme as U, mergeDarkOverrides as V, FONT_FAMILY_KEYS as W, createPersister as X, useAppDefinitionApi as Y, deleteDatabase as Z, DEFAULT_SDK_WIDGET_REGISTRY as _, useScreenAreaFullscreenSnapshot as a, createWidgetFromShareable as b, useFluidApp as c, toNavigationItem as d, normalizeComponentTree as f, isRemoteDomWidgetPackageDescriptor as g, useCompanyScopedQueryKey as h, useOptionalScreenAreaFullscreenCoordinator as i, DEFAULT_FONT_FAMILIES as j, serialiseTheme as k, toRawManifest as l, createCompanyQueryKey as m, projectRemoteWidgetPackages as n, APP_DATA_QUERY_KEY as o, toScreenDefinition as p, SEMANTIC_COLOR_NAMES as q, ScreenAreaFullscreenProvider as r, fetchRawManifest as s, buildRemoteWidgetRegistry as t, transformManifestToRepAppData as u, widgetPropertySchemas as v, removeTheme as w, createWidgetRegistry as x, createScreen as y, deriveDarkVariant as z };
|
|
2570
2715
|
|
|
2571
|
-
//# sourceMappingURL=build-widget-registry-
|
|
2716
|
+
//# sourceMappingURL=build-widget-registry-DPQbuyej.mjs.map
|