@fluid-app/portal-sdk 0.1.456 → 0.1.458
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/{CardWidget-BbddboSI.cjs → CardWidget-8kubp1dh.cjs} +2 -2
- package/dist/{CardWidget-Bs0hqVjy.mjs → CardWidget-Dee9DpBH.mjs} +2 -2
- package/dist/{CardWidget-Bs0hqVjy.mjs.map → CardWidget-Dee9DpBH.mjs.map} +1 -1
- package/dist/{CardWidget-CGbAcMeq.cjs → CardWidget-YGsYcK7i.cjs} +2 -2
- package/dist/{CardWidget-CGbAcMeq.cjs.map → CardWidget-YGsYcK7i.cjs.map} +1 -1
- package/dist/{ContainerWidget-bbzSrNUJ.mjs → ContainerWidget-BVlY76wy.mjs} +2 -2
- package/dist/{ContainerWidget-bbzSrNUJ.mjs.map → ContainerWidget-BVlY76wy.mjs.map} +1 -1
- package/dist/{ContainerWidget-CRCAjF4G.cjs → ContainerWidget-Ba_Ti1Qh.cjs} +3 -3
- package/dist/{ContainerWidget-BOZYpAH1.cjs → ContainerWidget-DCDrjhgP.cjs} +2 -2
- package/dist/{ContainerWidget-BOZYpAH1.cjs.map → ContainerWidget-DCDrjhgP.cjs.map} +1 -1
- package/dist/{FluidProvider-CbA8KrhD.mjs → FluidProvider-C5JqeOGi.mjs} +3 -3
- package/dist/{FluidProvider-CbA8KrhD.mjs.map → FluidProvider-C5JqeOGi.mjs.map} +1 -1
- package/dist/{FluidProvider-JiGJqJQe.cjs → FluidProvider-LYDiXUkk.cjs} +3 -3
- package/dist/{FluidProvider-JiGJqJQe.cjs.map → FluidProvider-LYDiXUkk.cjs.map} +1 -1
- package/dist/{LayoutWidget-nea3CGc6.cjs → LayoutWidget-BKjkjoNO.cjs} +2 -2
- package/dist/{LayoutWidget-CS8fOr1e.cjs → LayoutWidget-CqIkNZNa.cjs} +2 -2
- package/dist/{LayoutWidget-CS8fOr1e.cjs.map → LayoutWidget-CqIkNZNa.cjs.map} +1 -1
- package/dist/{LayoutWidget-ENLd1G__.mjs → LayoutWidget-DkYKWC2P.mjs} +2 -2
- package/dist/{LayoutWidget-ENLd1G__.mjs.map → LayoutWidget-DkYKWC2P.mjs.map} +1 -1
- package/dist/{MessagingScreen-BeUhzBWr.cjs → MessagingScreen-BLZt8lMN.cjs} +2 -2
- package/dist/{MessagingScreen-BeUhzBWr.cjs.map → MessagingScreen-BLZt8lMN.cjs.map} +1 -1
- package/dist/{MessagingScreen-D6Bxoq0a.cjs → MessagingScreen-CoBvR0p4.cjs} +7 -7
- package/dist/{MessagingScreen-Dt6Rwk7_.mjs → MessagingScreen-CowNfnz0.mjs} +8 -8
- package/dist/{MessagingScreen-BtdVeSR5.mjs → MessagingScreen-kftHOAO7.mjs} +2 -2
- package/dist/{MessagingScreen-BtdVeSR5.mjs.map → MessagingScreen-kftHOAO7.mjs.map} +1 -1
- package/dist/{OrdersScreen-BirJq38x.cjs → OrdersScreen-B3Aa4ip-.cjs} +7 -7
- package/dist/{OrdersScreen-BSwESoF3.cjs → OrdersScreen-C-B6_Agy.cjs} +2 -2
- package/dist/{OrdersScreen-BSwESoF3.cjs.map → OrdersScreen-C-B6_Agy.cjs.map} +1 -1
- package/dist/{OrdersScreen-fZFg1l1W.mjs → OrdersScreen-DDQ8QXWo.mjs} +2 -2
- package/dist/{OrdersScreen-fZFg1l1W.mjs.map → OrdersScreen-DDQ8QXWo.mjs.map} +1 -1
- package/dist/{OrdersScreen-1kPmXJga.mjs → OrdersScreen-DPkq_mS2.mjs} +8 -8
- package/dist/{ProfileScreen-CirvTBwX.cjs → ProfileScreen-CK17yi8m.cjs} +8 -8
- package/dist/{ProfileScreen-Dj1pTzLz.mjs → ProfileScreen-DnlCxwh6.mjs} +3 -3
- package/dist/{ProfileScreen-Dj1pTzLz.mjs.map → ProfileScreen-DnlCxwh6.mjs.map} +1 -1
- package/dist/{ProfileScreen-BvxuA9P4.cjs → ProfileScreen-R4ulzpPu.cjs} +3 -3
- package/dist/{ProfileScreen-BvxuA9P4.cjs.map → ProfileScreen-R4ulzpPu.cjs.map} +1 -1
- package/dist/{ProfileScreen-Bqv7MNPH.mjs → ProfileScreen-ntvqBCpb.mjs} +9 -9
- package/dist/{ScreenRenderer-EGk5-w0h.cjs → ScreenRenderer-D0-ymcZV.cjs} +13 -4
- package/dist/ScreenRenderer-D0-ymcZV.cjs.map +1 -0
- package/dist/{ScreenRenderer-BQz-1cCn.mjs → ScreenRenderer-KJIcMne2.mjs} +13 -4
- package/dist/ScreenRenderer-KJIcMne2.mjs.map +1 -0
- package/dist/{ShopScreen-3ryiBWeh.cjs → ShopScreen-BtwvHTbN.cjs} +7 -7
- package/dist/{ShopScreen-CfvCqYJ9.mjs → ShopScreen-CGX6YHVV.mjs} +8 -8
- package/dist/{ShopScreen-BKWFrPHB.mjs → ShopScreen-CUoUECrG.mjs} +3 -3
- package/dist/{ShopScreen-BKWFrPHB.mjs.map → ShopScreen-CUoUECrG.mjs.map} +1 -1
- package/dist/{ShopScreen-C3vwiETG.cjs → ShopScreen-DS5-ICA-.cjs} +2 -2
- package/dist/{ShopScreen-C3vwiETG.cjs.map → ShopScreen-DS5-ICA-.cjs.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-DWB0E5Hu.cjs → SubscriptionsScreen-D04ldHXL.cjs} +3 -3
- package/dist/{SubscriptionsScreen-DWB0E5Hu.cjs.map → SubscriptionsScreen-D04ldHXL.cjs.map} +1 -1
- package/dist/{SubscriptionsScreen-Dv7PjXwb.mjs → SubscriptionsScreen-D0pn4_JR.mjs} +3 -3
- package/dist/{SubscriptionsScreen-Dv7PjXwb.mjs.map → SubscriptionsScreen-D0pn4_JR.mjs.map} +1 -1
- package/dist/{SubscriptionsScreen-COBaRHDG.cjs → SubscriptionsScreen-J4R7V7na.cjs} +8 -8
- package/dist/{SubscriptionsScreen-G64lYG5v.mjs → SubscriptionsScreen-qD8Mnh2A.mjs} +9 -9
- package/dist/{build-widget-registry-7slNHtKU.cjs → build-widget-registry-DMiPjMfG.cjs} +31 -7
- package/dist/build-widget-registry-DMiPjMfG.cjs.map +1 -0
- package/dist/{build-widget-registry-BZjLacQ8.mjs → build-widget-registry-Dveiky2q.mjs} +28 -10
- package/dist/build-widget-registry-Dveiky2q.mjs.map +1 -0
- package/dist/index.cjs +260 -26
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +260 -26
- package/dist/index.mjs.map +1 -1
- package/dist/{use-portal-card-add-3ds-flow-tvSUKAvl.mjs → use-portal-card-add-3ds-flow--PAh5qUt.mjs} +2 -2
- package/dist/{use-portal-card-add-3ds-flow-tvSUKAvl.mjs.map → use-portal-card-add-3ds-flow--PAh5qUt.mjs.map} +1 -1
- package/dist/{use-portal-card-add-3ds-flow-C_Frj80d.cjs → use-portal-card-add-3ds-flow-DzFfku22.cjs} +2 -2
- package/dist/{use-portal-card-add-3ds-flow-C_Frj80d.cjs.map → use-portal-card-add-3ds-flow-DzFfku22.cjs.map} +1 -1
- package/dist/utils/build-remote-widget-plugin-manifests.cjs +5 -5
- package/dist/utils/build-remote-widget-plugin-manifests.mjs +6 -6
- package/package.json +9 -9
- package/dist/ScreenRenderer-BQz-1cCn.mjs.map +0 -1
- package/dist/ScreenRenderer-EGk5-w0h.cjs.map +0 -1
- package/dist/build-widget-registry-7slNHtKU.cjs.map +0 -1
- package/dist/build-widget-registry-BZjLacQ8.mjs.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
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-
|
|
4
|
-
const require_ScreenRenderer = require("./ScreenRenderer-
|
|
3
|
+
const require_build_widget_registry = require("./build-widget-registry-DMiPjMfG.cjs");
|
|
4
|
+
const require_ScreenRenderer = require("./ScreenRenderer-D0-ymcZV.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-LYDiXUkk.cjs");
|
|
8
8
|
require("./mysite-api-context-SWweFE49.cjs");
|
|
9
9
|
require("./ContactsTranslationBridge-BvkMkPED.cjs");
|
|
10
10
|
const require_ContactsScreen = require("./ContactsScreen-Cu6-ckm9.cjs");
|
|
@@ -24,7 +24,7 @@ const require_shell_translation_api_context = require("./shell-translation-api-c
|
|
|
24
24
|
require("./error-state-Du7X9xIM.cjs");
|
|
25
25
|
const require_PointsWidget = require("./PointsWidget-BcBtWxS2.cjs");
|
|
26
26
|
require("./task-composer-form-oKkUtTAg.cjs");
|
|
27
|
-
const require_LayoutWidget = require("./LayoutWidget-
|
|
27
|
+
const require_LayoutWidget = require("./LayoutWidget-CqIkNZNa.cjs");
|
|
28
28
|
const require_registries = require("./registries-zFvhorZ2.cjs");
|
|
29
29
|
require("./fields-Dj1992kh.cjs");
|
|
30
30
|
const require_TextWidget = require("./TextWidget-CNks2l1S.cjs");
|
|
@@ -32,14 +32,14 @@ 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");
|
|
35
|
-
const require_CardWidget = require("./CardWidget-
|
|
35
|
+
const require_CardWidget = require("./CardWidget-YGsYcK7i.cjs");
|
|
36
36
|
require("./purify.es-C0e28NH_.cjs");
|
|
37
37
|
require("./MediaRenderer-6Pli48Yf.cjs");
|
|
38
38
|
const require_CarouselWidget = require("./CarouselWidget-jzWmuyJS.cjs");
|
|
39
39
|
const require_CatchUpWidget = require("./CatchUpWidget-D1U4Vtmr.cjs");
|
|
40
40
|
const require_src$1 = require("./src-CfWQyJTB.cjs");
|
|
41
41
|
const require_ChartWidget = require("./ChartWidget-84gwfoVQ.cjs");
|
|
42
|
-
const require_ContainerWidget = require("./ContainerWidget-
|
|
42
|
+
const require_ContainerWidget = require("./ContainerWidget-DCDrjhgP.cjs");
|
|
43
43
|
const require_EmbedWidget = require("./EmbedWidget-CcfJlAoz.cjs");
|
|
44
44
|
const require_ImageWidget = require("./ImageWidget-DDmrRAo2.cjs");
|
|
45
45
|
const require_LinkWidget = require("./LinkWidget-Bd1eErkP.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-BLZt8lMN.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-DzFfku22.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-R4ulzpPu.cjs");
|
|
73
|
+
const require_SubscriptionsScreen = require("./SubscriptionsScreen-D04ldHXL.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-C-B6_Agy.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-DS5-ICA-.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-
|
|
1718
|
+
const ProfileScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => require("./ProfileScreen-CK17yi8m.cjs")).then((m) => ({ default: m.ProfileScreen })));
|
|
1719
|
+
const OrdersScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => require("./OrdersScreen-B3Aa4ip-.cjs")).then((m) => ({ default: m.OrdersScreen })));
|
|
1720
|
+
const SubscriptionsScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => require("./SubscriptionsScreen-J4R7V7na.cjs")).then((m) => ({ default: m.SubscriptionsScreen })));
|
|
1721
|
+
const MessagingScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => require("./MessagingScreen-CoBvR0p4.cjs")).then((m) => ({ default: m.MessagingScreen })));
|
|
1531
1722
|
const ContactsScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => require("./ContactsScreen-BTCUeDHl.cjs")).then((m) => ({ default: m.ContactsScreen })));
|
|
1532
|
-
const ShopScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => require("./ShopScreen-
|
|
1723
|
+
const ShopScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => require("./ShopScreen-BtwvHTbN.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 })));
|
|
@@ -1977,6 +2168,35 @@ function TranslatedScreenHeader({ slug, title, trailingContent }) {
|
|
|
1977
2168
|
});
|
|
1978
2169
|
}
|
|
1979
2170
|
//#endregion
|
|
2171
|
+
//#region src/shell/mobile-back-target.ts
|
|
2172
|
+
const LEGACY_SHAREABLE_PARENT_SLUGS = {
|
|
2173
|
+
"share/page": "share/pages",
|
|
2174
|
+
"share/playlist": "share/playlists",
|
|
2175
|
+
"share/product": "share/products"
|
|
2176
|
+
};
|
|
2177
|
+
const SHAREABLE_DETAIL_ROUTE_PREFIXES = [
|
|
2178
|
+
"share/files",
|
|
2179
|
+
"share/media",
|
|
2180
|
+
"share/page",
|
|
2181
|
+
"share/pages",
|
|
2182
|
+
"share/playlist",
|
|
2183
|
+
"share/playlists",
|
|
2184
|
+
"share/product",
|
|
2185
|
+
"share/products"
|
|
2186
|
+
];
|
|
2187
|
+
function isShareableDetailRoute(normalizedSlug) {
|
|
2188
|
+
return SHAREABLE_DETAIL_ROUTE_PREFIXES.some((routePrefix) => normalizedSlug.startsWith(routePrefix + "/"));
|
|
2189
|
+
}
|
|
2190
|
+
function resolveMobileBackTarget(currentSlug, navSlugs, previousSlug) {
|
|
2191
|
+
const navMatch = require_use_navigation_parent.matchSlugPrefix(currentSlug, navSlugs);
|
|
2192
|
+
const normalized = require_use_navigation_parent.normalizeSlug(currentSlug);
|
|
2193
|
+
const isDrillDownRoute = !!navMatch?.rest || isShareableDetailRoute(normalized);
|
|
2194
|
+
const normalizedPrevious = require_use_navigation_parent.normalizeSlug(previousSlug ?? void 0);
|
|
2195
|
+
if (isDrillDownRoute && normalizedPrevious && normalizedPrevious !== normalized) return normalizedPrevious;
|
|
2196
|
+
if (navMatch?.rest) return navMatch.matchedSlug;
|
|
2197
|
+
for (const [routePrefix, parentSlug] of Object.entries(LEGACY_SHAREABLE_PARENT_SLUGS)) if (normalized.startsWith(routePrefix + "/") && navSlugs.includes(parentSlug)) return parentSlug;
|
|
2198
|
+
}
|
|
2199
|
+
//#endregion
|
|
1980
2200
|
//#region src/shell/AppShell.tsx
|
|
1981
2201
|
const THEME_STORAGE_KEY = "portal-theme-mode";
|
|
1982
2202
|
const SHAREABLE_TYPE_TO_SLUG = {
|
|
@@ -2169,9 +2389,11 @@ function AppShell({ appData: appDataProp, navigation: navigationProp, customPage
|
|
|
2169
2389
|
const activeSlug = controlledSlug ?? pathSlug;
|
|
2170
2390
|
const activeSlugRef = (0, react.useRef)(activeSlug);
|
|
2171
2391
|
activeSlugRef.current = activeSlug;
|
|
2172
|
-
const
|
|
2392
|
+
const navigateToSlug = (0, react.useCallback)((slug, options) => {
|
|
2173
2393
|
const current = activeSlugRef.current;
|
|
2174
|
-
|
|
2394
|
+
const recordPrevious = options?.recordPrevious ?? true;
|
|
2395
|
+
if (slug !== current && recordPrevious) setPreviousSlug(current || null);
|
|
2396
|
+
else if (slug !== current) setPreviousSlug(null);
|
|
2175
2397
|
if (onNavigateProp) {
|
|
2176
2398
|
onNavigateProp(slug);
|
|
2177
2399
|
return;
|
|
@@ -2180,6 +2402,9 @@ function AppShell({ appData: appDataProp, navigation: navigationProp, customPage
|
|
|
2180
2402
|
history.pushState(null, "", targetPath);
|
|
2181
2403
|
setPathSlug(slug);
|
|
2182
2404
|
}, [onNavigateProp, normalizedBasePath]);
|
|
2405
|
+
const handleNavigate = (0, react.useCallback)((slug) => {
|
|
2406
|
+
navigateToSlug(slug);
|
|
2407
|
+
}, [navigateToSlug]);
|
|
2183
2408
|
const handleWidgetItemClick = (0, react.useCallback)((item) => {
|
|
2184
2409
|
const subscriptionToken = item.subscription_token;
|
|
2185
2410
|
if (typeof subscriptionToken === "string" && subscriptionToken) {
|
|
@@ -2210,6 +2435,15 @@ function AppShell({ appData: appDataProp, navigation: navigationProp, customPage
|
|
|
2210
2435
|
const slugMatch = (0, react.useMemo)(() => require_use_navigation_parent.matchSlugPrefix(activeSlug, allNavSlugs), [activeSlug, allNavSlugs]);
|
|
2211
2436
|
const baseSlug = slugMatch?.matchedSlug ?? require_use_navigation_parent.normalizeSlug(activeSlug);
|
|
2212
2437
|
const restParams = slugMatch?.rest ?? "";
|
|
2438
|
+
const mobileBackTarget = (0, react.useMemo)(() => resolveMobileBackTarget(activeSlug, allNavSlugs, previousSlug), [
|
|
2439
|
+
activeSlug,
|
|
2440
|
+
allNavSlugs,
|
|
2441
|
+
previousSlug
|
|
2442
|
+
]);
|
|
2443
|
+
const handleMobileBack = (0, react.useCallback)(() => {
|
|
2444
|
+
if (!mobileBackTarget) return;
|
|
2445
|
+
navigateToSlug(mobileBackTarget, { recordPrevious: false });
|
|
2446
|
+
}, [mobileBackTarget, navigateToSlug]);
|
|
2213
2447
|
const mobileSecondLevelTabs = findCurrentSection(filteredMobileNavItems, baseSlug)?.children ?? [];
|
|
2214
2448
|
const currentNavItem = findNavItem(filteredNavItems, baseSlug) ?? findNavItem(filteredMobileNavItems, baseSlug);
|
|
2215
2449
|
const matchingScreen = screens?.find((s) => s.id === currentNavItem?.screen_id);
|
|
@@ -2294,7 +2528,7 @@ function AppShell({ appData: appDataProp, navigation: navigationProp, customPage
|
|
|
2294
2528
|
mobileTabs: mobileSecondLevelTabs,
|
|
2295
2529
|
currentSlug: activeSlug,
|
|
2296
2530
|
title: screenTitle,
|
|
2297
|
-
...
|
|
2531
|
+
...mobileBackTarget !== void 0 && { onBack: handleMobileBack },
|
|
2298
2532
|
onNavigate: handleNavigate,
|
|
2299
2533
|
onLogout: logout
|
|
2300
2534
|
}),
|
|
@@ -3437,15 +3671,15 @@ const CORE_PAGE_IDS = {
|
|
|
3437
3671
|
//#endregion
|
|
3438
3672
|
//#region src/screens/index.ts
|
|
3439
3673
|
const screenPropertySchemas = {
|
|
3440
|
-
ProfileScreen: () => Promise.resolve().then(() => require("./ProfileScreen-
|
|
3441
|
-
MessagingScreen: () => Promise.resolve().then(() => require("./MessagingScreen-
|
|
3674
|
+
ProfileScreen: () => Promise.resolve().then(() => require("./ProfileScreen-CK17yi8m.cjs")).then((m) => m.profileScreenPropertySchema),
|
|
3675
|
+
MessagingScreen: () => Promise.resolve().then(() => require("./MessagingScreen-CoBvR0p4.cjs")).then((m) => m.messagingScreenPropertySchema),
|
|
3442
3676
|
ContactsScreen: () => Promise.resolve().then(() => require("./ContactsScreen-BTCUeDHl.cjs")).then((m) => m.contactsScreenPropertySchema),
|
|
3443
|
-
OrdersScreen: () => Promise.resolve().then(() => require("./OrdersScreen-
|
|
3444
|
-
SubscriptionsScreen: () => Promise.resolve().then(() => require("./SubscriptionsScreen-
|
|
3677
|
+
OrdersScreen: () => Promise.resolve().then(() => require("./OrdersScreen-B3Aa4ip-.cjs")).then((m) => m.ordersScreenPropertySchema),
|
|
3678
|
+
SubscriptionsScreen: () => Promise.resolve().then(() => require("./SubscriptionsScreen-J4R7V7na.cjs")).then((m) => m.subscriptionsScreenPropertySchema),
|
|
3445
3679
|
CustomersScreen: () => Promise.resolve().then(() => require("./CustomersScreen-sUkFLvP2.cjs")).then((m) => m.customersScreenPropertySchema),
|
|
3446
3680
|
MySiteScreen: () => Promise.resolve().then(() => require("./MySiteScreen-DMTwqS2r.cjs")).then((m) => m.mySiteScreenPropertySchema),
|
|
3447
3681
|
ShareablesScreen: () => Promise.resolve().then(() => require("./ShareablesScreen-DAKdATIv.cjs")).then((m) => m.shareablesScreenPropertySchema),
|
|
3448
|
-
ShopScreen: () => Promise.resolve().then(() => require("./ShopScreen-
|
|
3682
|
+
ShopScreen: () => Promise.resolve().then(() => require("./ShopScreen-BtwvHTbN.cjs")).then((m) => m.shopScreenPropertySchema),
|
|
3449
3683
|
AppDownloadScreen: () => Promise.resolve().then(() => require("./AppDownloadScreen-BUhwZtAN.cjs")).then((n) => n.AppDownloadScreen_exports).then((m) => m.appDownloadScreenPropertySchema)
|
|
3450
3684
|
};
|
|
3451
3685
|
/**
|