@fluid-app/portal-sdk 0.1.455 → 0.1.457
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/{AlertWidget-CdWJXZn1.mjs → AlertWidget-BtkVIGr9.mjs} +2 -2
- package/dist/{AlertWidget-CdWJXZn1.mjs.map → AlertWidget-BtkVIGr9.mjs.map} +1 -1
- package/dist/{AlertWidget-BJekf1r1.cjs → AlertWidget-C5sAMhqU.cjs} +2 -2
- package/dist/{AlertWidget-BJekf1r1.cjs.map → AlertWidget-C5sAMhqU.cjs.map} +1 -1
- package/dist/{ContactsScreen-DsHXXYfF.cjs → ContactsScreen-BTCUeDHl.cjs} +1 -1
- package/dist/{ContactsScreen-TO0LAuHz.cjs → ContactsScreen-Cu6-ckm9.cjs} +23 -13
- package/dist/ContactsScreen-Cu6-ckm9.cjs.map +1 -0
- package/dist/{ContactsScreen-DhMQm4w2.mjs → ContactsScreen-D0l3-Xof.mjs} +23 -13
- package/dist/ContactsScreen-D0l3-Xof.mjs.map +1 -0
- package/dist/{FluidProvider-BULkBuyn.cjs → FluidProvider-Dm5QH6EP.cjs} +2 -2
- package/dist/{FluidProvider-BULkBuyn.cjs.map → FluidProvider-Dm5QH6EP.cjs.map} +1 -1
- package/dist/{FluidProvider-CA_HAl9a.mjs → FluidProvider-KBZgRXjL.mjs} +2 -2
- package/dist/{FluidProvider-CA_HAl9a.mjs.map → FluidProvider-KBZgRXjL.mjs.map} +1 -1
- package/dist/{MessagingScreen-DWH9xBbq.cjs → MessagingScreen-BrbkMeld.cjs} +2 -2
- package/dist/{MessagingScreen-DWH9xBbq.cjs.map → MessagingScreen-BrbkMeld.cjs.map} +1 -1
- package/dist/{MessagingScreen-CYOGaqKX.mjs → MessagingScreen-BtoXnSqJ.mjs} +2 -2
- package/dist/{MessagingScreen-CYOGaqKX.mjs.map → MessagingScreen-BtoXnSqJ.mjs.map} +1 -1
- package/dist/{MessagingScreen-BG6clVDQ.mjs → MessagingScreen-CYqzOl6D.mjs} +6 -6
- package/dist/{MessagingScreen-B_nyIg2b.cjs → MessagingScreen-uuydnJEi.cjs} +5 -5
- package/dist/{OrdersScreen-DMlrdteQ.mjs → OrdersScreen-CutgAgyO.mjs} +6 -6
- package/dist/{OrdersScreen-Dh_nsi8j.cjs → OrdersScreen-DKQmax51.cjs} +2 -2
- package/dist/{OrdersScreen-Dh_nsi8j.cjs.map → OrdersScreen-DKQmax51.cjs.map} +1 -1
- package/dist/{OrdersScreen-CfchcnYB.cjs → OrdersScreen-UaQcR3IU.cjs} +5 -5
- package/dist/{OrdersScreen-CBF6uZSk.mjs → OrdersScreen-eqJy6_m3.mjs} +2 -2
- package/dist/{OrdersScreen-CBF6uZSk.mjs.map → OrdersScreen-eqJy6_m3.mjs.map} +1 -1
- package/dist/{ProfileScreen-t2V-W4Dv.cjs → ProfileScreen-B5DcNq7i.cjs} +6 -6
- package/dist/{ProfileScreen-CbYASEr9.mjs → ProfileScreen-C4SiOL-k.mjs} +7 -7
- package/dist/{ProfileScreen-DlPK9S_Q.mjs → ProfileScreen-CealQbpo.mjs} +3 -3
- package/dist/{ProfileScreen-DlPK9S_Q.mjs.map → ProfileScreen-CealQbpo.mjs.map} +1 -1
- package/dist/{ProfileScreen-CXqMOEza.cjs → ProfileScreen-DXSnyfCO.cjs} +3 -3
- package/dist/{ProfileScreen-CXqMOEza.cjs.map → ProfileScreen-DXSnyfCO.cjs.map} +1 -1
- package/dist/{ShopScreen-1vtAE4X7.mjs → ShopScreen-B6cf4gW-.mjs} +6 -6
- package/dist/{ShopScreen-CrObPeSv.cjs → ShopScreen-CcupxIut.cjs} +2 -2
- package/dist/{ShopScreen-CrObPeSv.cjs.map → ShopScreen-CcupxIut.cjs.map} +1 -1
- package/dist/{ShopScreen-BWDYXw4Q.cjs → ShopScreen-DH_TcNMs.cjs} +5 -5
- package/dist/{ShopScreen-BnuiYHKY.mjs → ShopScreen-z2J4fRfs.mjs} +3 -3
- package/dist/{ShopScreen-BnuiYHKY.mjs.map → ShopScreen-z2J4fRfs.mjs.map} +1 -1
- package/dist/{ShopWidget-CwiD88Sr.mjs → ShopWidget-DXVNRrFY.mjs} +2 -2
- package/dist/{ShopWidget-CwiD88Sr.mjs.map → ShopWidget-DXVNRrFY.mjs.map} +1 -1
- package/dist/{SubscriptionsScreen-CBIjEFKA.mjs → SubscriptionsScreen-CBEULwpU.mjs} +7 -7
- package/dist/{SubscriptionsScreen-Bjdz5fx-.cjs → SubscriptionsScreen-CTrOXRIz.cjs} +3 -3
- package/dist/{SubscriptionsScreen-Bjdz5fx-.cjs.map → SubscriptionsScreen-CTrOXRIz.cjs.map} +1 -1
- package/dist/{SubscriptionsScreen-BlB3Ppoa.cjs → SubscriptionsScreen-DdlwKkJ1.cjs} +6 -6
- package/dist/{SubscriptionsScreen-DyjmAOvJ.mjs → SubscriptionsScreen-DyL-7oeE.mjs} +3 -3
- package/dist/{SubscriptionsScreen-DyjmAOvJ.mjs.map → SubscriptionsScreen-DyL-7oeE.mjs.map} +1 -1
- package/dist/{TextWidget-CY71e66E.cjs → TextWidget-CNks2l1S.cjs} +4 -3
- package/dist/TextWidget-CNks2l1S.cjs.map +1 -0
- package/dist/{TextWidget-B-2RFD_g.mjs → TextWidget-cnDl92rJ.mjs} +4 -3
- package/dist/TextWidget-cnDl92rJ.mjs.map +1 -0
- package/dist/{build-widget-registry-L8a9-O3A.cjs → build-widget-registry-Bg8G7GQF.cjs} +29 -5
- package/dist/build-widget-registry-Bg8G7GQF.cjs.map +1 -0
- package/dist/{build-widget-registry-Dy8S7Ggy.mjs → build-widget-registry-fQIvocLa.mjs} +26 -8
- package/dist/build-widget-registry-fQIvocLa.mjs.map +1 -0
- package/dist/index.cjs +215 -24
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -0
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +7 -0
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +215 -24
- package/dist/index.mjs.map +1 -1
- package/dist/{use-portal-card-add-3ds-flow-B4wqRVNt.mjs → use-portal-card-add-3ds-flow-Caupep6C.mjs} +2 -2
- package/dist/{use-portal-card-add-3ds-flow-B4wqRVNt.mjs.map → use-portal-card-add-3ds-flow-Caupep6C.mjs.map} +1 -1
- package/dist/{use-portal-card-add-3ds-flow-Dt29-X8z.cjs → use-portal-card-add-3ds-flow-Cl3H-Dp7.cjs} +2 -2
- package/dist/{use-portal-card-add-3ds-flow-Dt29-X8z.cjs.map → use-portal-card-add-3ds-flow-Cl3H-Dp7.cjs.map} +1 -1
- package/dist/utils/build-remote-widget-plugin-manifests.cjs +3 -3
- package/dist/utils/build-remote-widget-plugin-manifests.mjs +4 -4
- package/package.json +9 -9
- package/dist/ContactsScreen-DhMQm4w2.mjs.map +0 -1
- package/dist/ContactsScreen-TO0LAuHz.cjs.map +0 -1
- package/dist/TextWidget-B-2RFD_g.mjs.map +0 -1
- package/dist/TextWidget-CY71e66E.cjs.map +0 -1
- package/dist/build-widget-registry-Dy8S7Ggy.mjs.map +0 -1
- package/dist/build-widget-registry-L8a9-O3A.cjs.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_chunk = require("./chunk-9hOWP6kD.cjs");
|
|
3
|
-
const require_build_widget_registry = require("./build-widget-registry-
|
|
3
|
+
const require_build_widget_registry = require("./build-widget-registry-Bg8G7GQF.cjs");
|
|
4
4
|
const require_ScreenRenderer = require("./ScreenRenderer-EGk5-w0h.cjs");
|
|
5
5
|
const require_use_account = require("./use-account-CPOGOGl6.cjs");
|
|
6
6
|
require("./use-optional-store-CIM4spDu.cjs");
|
|
7
|
-
const require_FluidProvider = require("./FluidProvider-
|
|
7
|
+
const require_FluidProvider = require("./FluidProvider-Dm5QH6EP.cjs");
|
|
8
8
|
require("./mysite-api-context-SWweFE49.cjs");
|
|
9
9
|
require("./ContactsTranslationBridge-BvkMkPED.cjs");
|
|
10
|
-
const require_ContactsScreen = require("./ContactsScreen-
|
|
10
|
+
const require_ContactsScreen = require("./ContactsScreen-Cu6-ckm9.cjs");
|
|
11
11
|
require("./translation-adapter-Bi65zBvS.cjs");
|
|
12
12
|
const require_PortalTenantClientProvider = require("./PortalTenantClientProvider-Ct2vdZPi.cjs");
|
|
13
13
|
require("./registry-context-Dw3vg1Fz.cjs");
|
|
@@ -27,8 +27,8 @@ require("./task-composer-form-oKkUtTAg.cjs");
|
|
|
27
27
|
const require_LayoutWidget = require("./LayoutWidget-CS8fOr1e.cjs");
|
|
28
28
|
const require_registries = require("./registries-zFvhorZ2.cjs");
|
|
29
29
|
require("./fields-Dj1992kh.cjs");
|
|
30
|
-
const require_TextWidget = require("./TextWidget-
|
|
31
|
-
const require_AlertWidget = require("./AlertWidget-
|
|
30
|
+
const require_TextWidget = require("./TextWidget-CNks2l1S.cjs");
|
|
31
|
+
const require_AlertWidget = require("./AlertWidget-C5sAMhqU.cjs");
|
|
32
32
|
const require_BulletListWidget = require("./BulletListWidget-Dz_32RH1.cjs");
|
|
33
33
|
require("./preview-context-C10PndIF.cjs");
|
|
34
34
|
const require_CalendarWidget = require("./CalendarWidget-Cq2SrfVW.cjs");
|
|
@@ -53,31 +53,31 @@ const require_SpacerWidget = require("./SpacerWidget-CBr--iyL.cjs");
|
|
|
53
53
|
const require_TableWidget = require("./TableWidget-Ce6SjQ22.cjs");
|
|
54
54
|
const require_ToDoWidget = require("./ToDoWidget-BFY7UXfe.cjs");
|
|
55
55
|
const require_VideoWidget = require("./VideoWidget-dt8fNuTR.cjs");
|
|
56
|
-
require("./ShopWidget-B9NX-1jS.cjs");
|
|
56
|
+
const require_ShopWidget = require("./ShopWidget-B9NX-1jS.cjs");
|
|
57
57
|
require("./translation-adapter-C-HAPTe6.cjs");
|
|
58
58
|
require("./translation-adapter--Z7rT1IQ.cjs");
|
|
59
59
|
const require_query_keys = require("./query-keys-COZw1P0l.cjs");
|
|
60
60
|
const require_AppNavigationContext = require("./AppNavigationContext-BTP4s7dH.cjs");
|
|
61
61
|
const require_use_store = require("./use-store-D89j_R7T.cjs");
|
|
62
62
|
require("./dist-CeXOqY2W.cjs");
|
|
63
|
-
const require_MessagingScreen = require("./MessagingScreen-
|
|
63
|
+
const require_MessagingScreen = require("./MessagingScreen-BrbkMeld.cjs");
|
|
64
64
|
const require_use_navigation_parent = require("./use-navigation-parent-MoWE_Lpu.cjs");
|
|
65
65
|
const require_ScreenHeaderContext = require("./ScreenHeaderContext-DFxs04W2.cjs");
|
|
66
66
|
const require_CustomersScreen = require("./CustomersScreen-GUfgSu6a.cjs");
|
|
67
67
|
const require_member_permissions = require("./member-permissions-DFM8-pTH.cjs");
|
|
68
68
|
const require_portal_function = require("./portal-function-CiRhBwaf.cjs");
|
|
69
|
-
require("./use-portal-card-add-3ds-flow-
|
|
69
|
+
require("./use-portal-card-add-3ds-flow-Cl3H-Dp7.cjs");
|
|
70
70
|
require("./display-Ca4zjZd5.cjs");
|
|
71
71
|
require("./use-mysite-portal-wFNLeXSG.cjs");
|
|
72
|
-
const require_ProfileScreen = require("./ProfileScreen-
|
|
73
|
-
const require_SubscriptionsScreen = require("./SubscriptionsScreen-
|
|
72
|
+
const require_ProfileScreen = require("./ProfileScreen-DXSnyfCO.cjs");
|
|
73
|
+
const require_SubscriptionsScreen = require("./SubscriptionsScreen-CTrOXRIz.cjs");
|
|
74
74
|
require("./dist-Cpt-uZEu.cjs");
|
|
75
75
|
require("./es-DgpoYsI0.cjs");
|
|
76
76
|
require("./dist-BGBmj4YO.cjs");
|
|
77
|
-
const require_OrdersScreen = require("./OrdersScreen-
|
|
77
|
+
const require_OrdersScreen = require("./OrdersScreen-DKQmax51.cjs");
|
|
78
78
|
const require_MySiteScreen = require("./MySiteScreen-DRFLkyJ0.cjs");
|
|
79
79
|
require("./dist-DbRyOeMz.cjs");
|
|
80
|
-
const require_ShopScreen = require("./ShopScreen-
|
|
80
|
+
const require_ShopScreen = require("./ShopScreen-CcupxIut.cjs");
|
|
81
81
|
require("./AppDownloadScreen-BUhwZtAN.cjs");
|
|
82
82
|
const require_utils_build_remote_widget_plugin_manifests = require("./utils/build-remote-widget-plugin-manifests.cjs");
|
|
83
83
|
let react = require("react");
|
|
@@ -1445,6 +1445,192 @@ function AccessDeniedScreen() {
|
|
|
1445
1445
|
});
|
|
1446
1446
|
}
|
|
1447
1447
|
//#endregion
|
|
1448
|
+
//#region src/core/default-property-schema-registry.ts
|
|
1449
|
+
const DEFAULT_PROPERTY_SCHEMA_REGISTRY = {
|
|
1450
|
+
AlertWidget: require_AlertWidget.alertWidgetPropertySchema,
|
|
1451
|
+
BulletListWidget: require_BulletListWidget.bulletListWidgetPropertySchema,
|
|
1452
|
+
CalendarWidget: require_CalendarWidget.calendarWidgetPropertySchema,
|
|
1453
|
+
CardWidget: require_CardWidget.cardWidgetPropertySchema,
|
|
1454
|
+
CarouselWidget: require_CarouselWidget.carouselWidgetPropertySchema,
|
|
1455
|
+
ChartWidget: require_ChartWidget.chartWidgetPropertySchema,
|
|
1456
|
+
ContainerWidget: require_ContainerWidget.containerWidgetPropertySchema,
|
|
1457
|
+
EmbedWidget: require_EmbedWidget.embedWidgetPropertySchema,
|
|
1458
|
+
ImageWidget: require_ImageWidget.imageWidgetPropertySchema,
|
|
1459
|
+
LayoutWidget: require_LayoutWidget.layoutWidgetPropertySchema,
|
|
1460
|
+
LinkWidget: require_LinkWidget.linkWidgetPropertySchema,
|
|
1461
|
+
ListWidget: require_ListWidget.listWidgetPropertySchema,
|
|
1462
|
+
MySiteWidget: require_MySiteWidget.mySiteWidgetPropertySchema,
|
|
1463
|
+
NestedWidget: require_NestedWidget.nestedWidgetPropertySchema,
|
|
1464
|
+
PointsWidget: require_PointsWidget.pointsWidgetPropertySchema,
|
|
1465
|
+
QuickLinksWidget: require_QuickLinksWidget.quickLinksWidgetPropertySchema,
|
|
1466
|
+
QuickShareWidget: require_QuickShareWidget.quickShareWidgetPropertySchema,
|
|
1467
|
+
RecentActivityWidget: require_RecentActivityWidget.recentActivityWidgetPropertySchema,
|
|
1468
|
+
SeparatorWidget: require_SeparatorWidget.separatorWidgetPropertySchema,
|
|
1469
|
+
ShopWidget: require_ShopWidget.shopWidgetPropertySchema,
|
|
1470
|
+
SpacerWidget: require_SpacerWidget.spacerWidgetPropertySchema,
|
|
1471
|
+
TableWidget: require_TableWidget.tableWidgetPropertySchema,
|
|
1472
|
+
TextWidget: require_TextWidget.textWidgetPropertySchema,
|
|
1473
|
+
ToDoWidget: require_ToDoWidget.toDoWidgetPropertySchema,
|
|
1474
|
+
VideoWidget: require_VideoWidget.videoWidgetPropertySchema
|
|
1475
|
+
};
|
|
1476
|
+
//#endregion
|
|
1477
|
+
//#region src/utils/warn-unknown-widget-props.ts
|
|
1478
|
+
/**
|
|
1479
|
+
* Props every widget instance may legitimately receive that are never part
|
|
1480
|
+
* of a widget's own editable property schema:
|
|
1481
|
+
* - Standard React/DOM pass-through props (`className`, `style`, `children`,
|
|
1482
|
+
* `id`, `key`).
|
|
1483
|
+
* - Structural identity props the screen-renderer pipeline injects itself
|
|
1484
|
+
* for container widgets so they can support drag/select wiring
|
|
1485
|
+
* (`widgetId`, `widgetPath`) — see `ScreenRenderer.tsx` in
|
|
1486
|
+
* `@fluid-app/portal-widgets/core` and `WidgetContent` in
|
|
1487
|
+
* `@fluid-app/portal-builder/core/widget-rendering`, which both inject
|
|
1488
|
+
* these for the same widget nodes rendered here.
|
|
1489
|
+
* Never warn about these even though they never appear in a widget's
|
|
1490
|
+
* `fields` list.
|
|
1491
|
+
*/
|
|
1492
|
+
const ALWAYS_ALLOWED_WIDGET_PROPS = new Set([
|
|
1493
|
+
"className",
|
|
1494
|
+
"style",
|
|
1495
|
+
"children",
|
|
1496
|
+
"id",
|
|
1497
|
+
"key",
|
|
1498
|
+
"widgetId",
|
|
1499
|
+
"widgetPath"
|
|
1500
|
+
]);
|
|
1501
|
+
/** Maximum Levenshtein distance for a "did you mean" suggestion to be shown. */
|
|
1502
|
+
const MAX_SUGGESTION_DISTANCE = 3;
|
|
1503
|
+
/**
|
|
1504
|
+
* Common authoring aliases → the canonical prop name to suggest. Levenshtein
|
|
1505
|
+
* only catches spelling slips; these are *semantic* misses (the motivating
|
|
1506
|
+
* incident authored `content` where the schema says `description` — edit
|
|
1507
|
+
* distance 9, far beyond any sane typo threshold). A suggestion is only shown
|
|
1508
|
+
* when the canonical name actually exists in the widget's schema.
|
|
1509
|
+
*/
|
|
1510
|
+
const PROP_NAME_SYNONYMS = {
|
|
1511
|
+
content: "description",
|
|
1512
|
+
text: "description",
|
|
1513
|
+
body: "description",
|
|
1514
|
+
copy: "description",
|
|
1515
|
+
message: "description",
|
|
1516
|
+
heading: "title",
|
|
1517
|
+
header: "title",
|
|
1518
|
+
label: "title"
|
|
1519
|
+
};
|
|
1520
|
+
/** `${widgetType}::${propName}` pairs already warned about this session. */
|
|
1521
|
+
const warnedPairs = /* @__PURE__ */ new Set();
|
|
1522
|
+
function isDevBuild() {
|
|
1523
|
+
return {}.env?.DEV === true;
|
|
1524
|
+
}
|
|
1525
|
+
/**
|
|
1526
|
+
* Levenshtein edit distance between two strings. Small inline helper (no new
|
|
1527
|
+
* dependency) — only ever called with short widget-prop-name strings.
|
|
1528
|
+
*/
|
|
1529
|
+
function levenshteinDistance(a, b) {
|
|
1530
|
+
if (a === b) return 0;
|
|
1531
|
+
if (a.length === 0) return b.length;
|
|
1532
|
+
if (b.length === 0) return a.length;
|
|
1533
|
+
let previousRow = Array.from({ length: b.length + 1 }, (_, j) => j);
|
|
1534
|
+
for (let i = 1; i <= a.length; i++) {
|
|
1535
|
+
const currentRow = [i];
|
|
1536
|
+
for (let j = 1; j <= b.length; j++) {
|
|
1537
|
+
const substitutionCost = a[i - 1] === b[j - 1] ? 0 : 1;
|
|
1538
|
+
const deletion = (previousRow[j] ?? Infinity) + 1;
|
|
1539
|
+
const insertion = (currentRow[j - 1] ?? Infinity) + 1;
|
|
1540
|
+
const substitution = (previousRow[j - 1] ?? Infinity) + substitutionCost;
|
|
1541
|
+
currentRow.push(Math.min(deletion, insertion, substitution));
|
|
1542
|
+
}
|
|
1543
|
+
previousRow = currentRow;
|
|
1544
|
+
}
|
|
1545
|
+
return previousRow[b.length] ?? Math.max(a.length, b.length);
|
|
1546
|
+
}
|
|
1547
|
+
/**
|
|
1548
|
+
* Finds the suggestion for an unknown prop: a known semantic synonym first
|
|
1549
|
+
* (see {@link PROP_NAME_SYNONYMS}), then the nearest known key by Levenshtein
|
|
1550
|
+
* distance within {@link MAX_SUGGESTION_DISTANCE}.
|
|
1551
|
+
*/
|
|
1552
|
+
function findNearestKey(propName, candidates) {
|
|
1553
|
+
const synonym = PROP_NAME_SYNONYMS[propName.toLowerCase()];
|
|
1554
|
+
if (synonym && candidates.includes(synonym)) return synonym;
|
|
1555
|
+
let nearest;
|
|
1556
|
+
let nearestDistance = MAX_SUGGESTION_DISTANCE + 1;
|
|
1557
|
+
for (const candidate of candidates) {
|
|
1558
|
+
const distance = levenshteinDistance(propName, candidate);
|
|
1559
|
+
if (distance < nearestDistance) {
|
|
1560
|
+
nearestDistance = distance;
|
|
1561
|
+
nearest = candidate;
|
|
1562
|
+
}
|
|
1563
|
+
}
|
|
1564
|
+
return nearestDistance <= MAX_SUGGESTION_DISTANCE ? nearest : void 0;
|
|
1565
|
+
}
|
|
1566
|
+
/**
|
|
1567
|
+
* Collects every prop name a widget's property schema actually recognizes as
|
|
1568
|
+
* a `widget.props` key:
|
|
1569
|
+
* - `borderRadius` fields are composite — their top-level `key` is a schema
|
|
1570
|
+
* grouping identifier, not a real widget prop, so its four corner keys are
|
|
1571
|
+
* expanded instead (mirrors `extractPropertyValues` in
|
|
1572
|
+
* `@fluid-app/portal-core/registries`).
|
|
1573
|
+
* - `dataSource` fields are excluded entirely. Per the same
|
|
1574
|
+
* `extractPropertyValues` reference, this field type only exists so the
|
|
1575
|
+
* property panel can gate other fields' visibility on whether a data
|
|
1576
|
+
* source is configured — its value is read from `widget.dataSource` (the
|
|
1577
|
+
* top-level, sibling-of-`props` config), never from `widget.props`.
|
|
1578
|
+
* Authoring a literal `props.dataSource` is a real mistake (the config
|
|
1579
|
+
* belongs one level up), so its field `key` must not be treated as an
|
|
1580
|
+
* accepted prop here.
|
|
1581
|
+
*/
|
|
1582
|
+
function collectKnownPropKeys(fields) {
|
|
1583
|
+
const keys = [];
|
|
1584
|
+
for (const field of fields) if (field.type === "borderRadius") keys.push(...Object.values(field.keys));
|
|
1585
|
+
else if (field.type !== "dataSource") keys.push(field.key);
|
|
1586
|
+
return keys;
|
|
1587
|
+
}
|
|
1588
|
+
/**
|
|
1589
|
+
* Merges schema field keys with `dataSourceTargetProps` — props a data
|
|
1590
|
+
* source may populate (e.g. ListWidget's `items`) that aren't necessarily
|
|
1591
|
+
* declared as editable fields — into one deduped list. Used for both the
|
|
1592
|
+
* known/unknown check and what's surfaced to the author (the "Known props:"
|
|
1593
|
+
* list and suggestion candidates), so a typo of a data-source-only prop
|
|
1594
|
+
* still gets a correct suggestion and the valid name is actually listed.
|
|
1595
|
+
*/
|
|
1596
|
+
function collectAllKnownKeys(schema) {
|
|
1597
|
+
const fieldKeys = collectKnownPropKeys(schema.fields);
|
|
1598
|
+
const targetProps = schema.dataSourceTargetProps ?? [];
|
|
1599
|
+
return Array.from(new Set([...fieldKeys, ...targetProps]));
|
|
1600
|
+
}
|
|
1601
|
+
/**
|
|
1602
|
+
* Dev-only console warning for widget props not declared in the widget's
|
|
1603
|
+
* registered property schema. Guards against the class of bug where an
|
|
1604
|
+
* authored screen sets a prop the widget doesn't know about (typo'd name,
|
|
1605
|
+
* stale field from a prior schema version) — the prop is silently dropped
|
|
1606
|
+
* and the widget renders its placeholder defaults with no signal to the
|
|
1607
|
+
* author.
|
|
1608
|
+
*
|
|
1609
|
+
* No-ops entirely outside a Vite dev build (checked first, before any prop
|
|
1610
|
+
* iteration, so there's zero overhead in production bundles) and for widget
|
|
1611
|
+
* types with no registered schema (custom/company widgets) — there's nothing
|
|
1612
|
+
* to validate against, so we skip silently rather than warn.
|
|
1613
|
+
*
|
|
1614
|
+
* Warns at most once per (widgetType, propName) pair per session.
|
|
1615
|
+
*/
|
|
1616
|
+
function warnUnknownWidgetProps({ widgetType, props, registry }) {
|
|
1617
|
+
if (!isDevBuild()) return;
|
|
1618
|
+
const schema = registry[widgetType];
|
|
1619
|
+
if (!schema) return;
|
|
1620
|
+
const knownKeys = collectAllKnownKeys(schema);
|
|
1621
|
+
const knownKeySet = new Set(knownKeys);
|
|
1622
|
+
for (const propName of Object.keys(props)) {
|
|
1623
|
+
if (knownKeySet.has(propName)) continue;
|
|
1624
|
+
if (ALWAYS_ALLOWED_WIDGET_PROPS.has(propName)) continue;
|
|
1625
|
+
const pairKey = `${widgetType}::${propName}`;
|
|
1626
|
+
if (warnedPairs.has(pairKey)) continue;
|
|
1627
|
+
warnedPairs.add(pairKey);
|
|
1628
|
+
const suggestion = findNearestKey(propName, knownKeys);
|
|
1629
|
+
const suggestionText = suggestion ? ` Did you mean "${suggestion}"?` : "";
|
|
1630
|
+
console.warn(`[portal] ${widgetType} received unknown prop "${propName}" — not in its schema.${suggestionText} Known props: ${knownKeys.join(", ")}.`);
|
|
1631
|
+
}
|
|
1632
|
+
}
|
|
1633
|
+
//#endregion
|
|
1448
1634
|
//#region src/shell/BuilderScreenView.tsx
|
|
1449
1635
|
/**
|
|
1450
1636
|
* BuilderScreenView — renders a builder screen's component_tree with
|
|
@@ -1462,6 +1648,11 @@ function WidgetRenderer({ widget, index }) {
|
|
|
1462
1648
|
console.warn(`[BuilderScreenView] Widget type "${String(widget.type)}" not found in registry`);
|
|
1463
1649
|
return null;
|
|
1464
1650
|
}
|
|
1651
|
+
if (require_build_widget_registry.isDefaultWidgetComponent(widget.type, Component)) warnUnknownWidgetProps({
|
|
1652
|
+
widgetType: widget.type,
|
|
1653
|
+
props: widget.props,
|
|
1654
|
+
registry: DEFAULT_PROPERTY_SCHEMA_REGISTRY
|
|
1655
|
+
});
|
|
1465
1656
|
if (widget.dataSource) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1466
1657
|
className: "h-full w-full overflow-x-hidden",
|
|
1467
1658
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ScreenRenderer.DataAwareWidget, {
|
|
@@ -1524,12 +1715,12 @@ function resolveMemberTypePage(registry, memberTypeSlug, currentSlug, baseSlug)
|
|
|
1524
1715
|
}
|
|
1525
1716
|
//#endregion
|
|
1526
1717
|
//#region src/shell/system-screen-map.ts
|
|
1527
|
-
const ProfileScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => require("./ProfileScreen-
|
|
1528
|
-
const OrdersScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => require("./OrdersScreen-
|
|
1529
|
-
const SubscriptionsScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => require("./SubscriptionsScreen-
|
|
1530
|
-
const MessagingScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => require("./MessagingScreen-
|
|
1531
|
-
const ContactsScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => require("./ContactsScreen-
|
|
1532
|
-
const ShopScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => require("./ShopScreen-
|
|
1718
|
+
const ProfileScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => require("./ProfileScreen-B5DcNq7i.cjs")).then((m) => ({ default: m.ProfileScreen })));
|
|
1719
|
+
const OrdersScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => require("./OrdersScreen-UaQcR3IU.cjs")).then((m) => ({ default: m.OrdersScreen })));
|
|
1720
|
+
const SubscriptionsScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => require("./SubscriptionsScreen-DdlwKkJ1.cjs")).then((m) => ({ default: m.SubscriptionsScreen })));
|
|
1721
|
+
const MessagingScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => require("./MessagingScreen-uuydnJEi.cjs")).then((m) => ({ default: m.MessagingScreen })));
|
|
1722
|
+
const ContactsScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => require("./ContactsScreen-BTCUeDHl.cjs")).then((m) => ({ default: m.ContactsScreen })));
|
|
1723
|
+
const ShopScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => require("./ShopScreen-DH_TcNMs.cjs")).then((m) => ({ default: m.ShopScreen })));
|
|
1533
1724
|
const CustomersScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => require("./CustomersScreen-sUkFLvP2.cjs")).then((m) => ({ default: m.CustomersScreen })));
|
|
1534
1725
|
const ShareablesScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => require("./ShareablesScreen-DAKdATIv.cjs")).then((m) => ({ default: m.ShareablesScreen })));
|
|
1535
1726
|
const MySiteScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => require("./MySiteScreen-DMTwqS2r.cjs")).then((m) => ({ default: m.MySiteScreen })));
|
|
@@ -3437,15 +3628,15 @@ const CORE_PAGE_IDS = {
|
|
|
3437
3628
|
//#endregion
|
|
3438
3629
|
//#region src/screens/index.ts
|
|
3439
3630
|
const screenPropertySchemas = {
|
|
3440
|
-
ProfileScreen: () => Promise.resolve().then(() => require("./ProfileScreen-
|
|
3441
|
-
MessagingScreen: () => Promise.resolve().then(() => require("./MessagingScreen-
|
|
3442
|
-
ContactsScreen: () => Promise.resolve().then(() => require("./ContactsScreen-
|
|
3443
|
-
OrdersScreen: () => Promise.resolve().then(() => require("./OrdersScreen-
|
|
3444
|
-
SubscriptionsScreen: () => Promise.resolve().then(() => require("./SubscriptionsScreen-
|
|
3631
|
+
ProfileScreen: () => Promise.resolve().then(() => require("./ProfileScreen-B5DcNq7i.cjs")).then((m) => m.profileScreenPropertySchema),
|
|
3632
|
+
MessagingScreen: () => Promise.resolve().then(() => require("./MessagingScreen-uuydnJEi.cjs")).then((m) => m.messagingScreenPropertySchema),
|
|
3633
|
+
ContactsScreen: () => Promise.resolve().then(() => require("./ContactsScreen-BTCUeDHl.cjs")).then((m) => m.contactsScreenPropertySchema),
|
|
3634
|
+
OrdersScreen: () => Promise.resolve().then(() => require("./OrdersScreen-UaQcR3IU.cjs")).then((m) => m.ordersScreenPropertySchema),
|
|
3635
|
+
SubscriptionsScreen: () => Promise.resolve().then(() => require("./SubscriptionsScreen-DdlwKkJ1.cjs")).then((m) => m.subscriptionsScreenPropertySchema),
|
|
3445
3636
|
CustomersScreen: () => Promise.resolve().then(() => require("./CustomersScreen-sUkFLvP2.cjs")).then((m) => m.customersScreenPropertySchema),
|
|
3446
3637
|
MySiteScreen: () => Promise.resolve().then(() => require("./MySiteScreen-DMTwqS2r.cjs")).then((m) => m.mySiteScreenPropertySchema),
|
|
3447
3638
|
ShareablesScreen: () => Promise.resolve().then(() => require("./ShareablesScreen-DAKdATIv.cjs")).then((m) => m.shareablesScreenPropertySchema),
|
|
3448
|
-
ShopScreen: () => Promise.resolve().then(() => require("./ShopScreen-
|
|
3639
|
+
ShopScreen: () => Promise.resolve().then(() => require("./ShopScreen-DH_TcNMs.cjs")).then((m) => m.shopScreenPropertySchema),
|
|
3449
3640
|
AppDownloadScreen: () => Promise.resolve().then(() => require("./AppDownloadScreen-BUhwZtAN.cjs")).then((n) => n.AppDownloadScreen_exports).then((m) => m.appDownloadScreenPropertySchema)
|
|
3450
3641
|
};
|
|
3451
3642
|
/**
|