@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.mjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import "./translation-adapter-RsuBioxm.mjs";
|
|
2
|
-
import { A as
|
|
2
|
+
import { A as serialiseTheme, B as deriveDarkVariant, C as applyTheme, D as getActiveThemeId, E as buildThemeDefinition, F as DEFAULT_SPACING, G as FONT_FAMILY_KEYS, H as mergeDarkOverrides, I as DEFAULT_THEME_ID, J as SEMANTIC_COLOR_NAMES, K as FONT_SIZE_KEYS, L as DEFAULT_THEME_NAME, M as DEFAULT_FONT_FAMILIES, N as DEFAULT_FONT_SIZES, O as transformThemes, P as DEFAULT_RADII, Q as deleteDatabase, R as getDefaultThemeDefinition, S as createWidgetRegistry, T as removeTheme, U as parseColor, V as getForegroundColor, W as resolveTheme, X as useAppDefinitionApi, _ as DEFAULT_SDK_WIDGET_REGISTRY, a as useScreenAreaFullscreenSnapshot, b as createScreen, c as useFluidApp, d as toNavigationItem, f as normalizeComponentTree, h as useCompanyScopedQueryKey, i as useOptionalScreenAreaFullscreenCoordinator, j as DEFAULT_COLORS, k as deserialiseTheme, l as toRawManifest, m as createCompanyQueryKey, o as APP_DATA_QUERY_KEY, p as toScreenDefinition, q as RADIUS_KEYS, r as ScreenAreaFullscreenProvider, s as fetchRawManifest, t as buildRemoteWidgetRegistry, u as transformManifestToRepAppData, v as isDefaultWidgetComponent, w as removeAllThemes, x as createWidgetFromShareable, y as widgetPropertySchemas, z as generateThemeCSS } from "./build-widget-registry-fQIvocLa.mjs";
|
|
3
3
|
import { a as assertNever, i as assertDefined, n as DataAwareWidget, o as isWidgetType, r as WIDGET_TYPE_NAMES, s as isWidgetTypeName, u as useRegistry } from "./ScreenRenderer-BQz-1cCn.mjs";
|
|
4
4
|
import { t as useAccount } from "./use-account-DR6HXMw_.mjs";
|
|
5
5
|
import "./use-optional-store-DpB_jK4Q.mjs";
|
|
6
|
-
import { g as useNativeCapabilities, h as useThemeContext, m as FluidThemeProvider, n as useFluidContext, p as shellEn, r as SUPPORTED_LANGUAGES, t as FluidProvider, x as useLanguagesApi } from "./FluidProvider-
|
|
6
|
+
import { g as useNativeCapabilities, h as useThemeContext, m as FluidThemeProvider, n as useFluidContext, p as shellEn, r as SUPPORTED_LANGUAGES, t as FluidProvider, x as useLanguagesApi } from "./FluidProvider-KBZgRXjL.mjs";
|
|
7
7
|
import "./mysite-api-context-BbxSfNft.mjs";
|
|
8
8
|
import "./ContactsTranslationBridge-DCSWCdyq.mjs";
|
|
9
|
-
import { r as contactsScreenPropertySchema, t as ContactsScreen } from "./ContactsScreen-
|
|
9
|
+
import { r as contactsScreenPropertySchema, t as ContactsScreen } from "./ContactsScreen-D0l3-Xof.mjs";
|
|
10
10
|
import { n as usePortalTenantClient } from "./PortalTenantClientProvider-lBrYQEsw.mjs";
|
|
11
11
|
import "./registry-context-l1jip-6W.mjs";
|
|
12
12
|
import { t as WidgetInteractionProvider } from "./WidgetInteractionContext-D8HZx_Gf.mjs";
|
|
@@ -25,8 +25,8 @@ import "./task-composer-form-DzVUCin2.mjs";
|
|
|
25
25
|
import { a as sectionLayoutConfig, i as groupChildrenByColumn, r as layoutWidgetPropertySchema, t as LayoutWidget } from "./LayoutWidget-ENLd1G__.mjs";
|
|
26
26
|
import { _ as extractPropertyValues, g as applyPropertyValues, h as PROPERTY_FIELD_TYPES, r as gapValues, v as groupPropertyFields, y as isPropertyFieldType } from "./registries-DXVOnKV2.mjs";
|
|
27
27
|
import "./fields-Cz7BkKd6.mjs";
|
|
28
|
-
import { r as textWidgetPropertySchema, t as TextWidget } from "./TextWidget-
|
|
29
|
-
import { r as alertWidgetPropertySchema, t as AlertWidget } from "./AlertWidget-
|
|
28
|
+
import { r as textWidgetPropertySchema, t as TextWidget } from "./TextWidget-cnDl92rJ.mjs";
|
|
29
|
+
import { r as alertWidgetPropertySchema, t as AlertWidget } from "./AlertWidget-BtkVIGr9.mjs";
|
|
30
30
|
import { r as bulletListWidgetPropertySchema, t as BulletListWidget } from "./BulletListWidget-DZrlNEa4.mjs";
|
|
31
31
|
import "./preview-context-DvXxVZ0z.mjs";
|
|
32
32
|
import { r as calendarWidgetPropertySchema, t as CalendarWidget } from "./CalendarWidget-DwZ5hrXx.mjs";
|
|
@@ -36,8 +36,8 @@ import "./MediaRenderer-DflyyaXq.mjs";
|
|
|
36
36
|
import { r as carouselWidgetPropertySchema, t as CarouselWidget } from "./CarouselWidget-DEyRWj_S.mjs";
|
|
37
37
|
import { r as catchUpWidgetPropertySchema, t as CatchUpWidget } from "./CatchUpWidget-dROZKeGW.mjs";
|
|
38
38
|
import { Cn as Button, Ln as cn, N as IconButton, ct as PopoverContent, dt as CollapsibleContent, ft as CollapsibleTrigger, g as Skeleton, lt as PopoverTrigger, m as Toaster, st as Popover, ut as Collapsible } from "./src-v1U7mjgR.mjs";
|
|
39
|
-
import { _ as SidebarProvider, a as BottomNavVisibilityProvider, c as SidebarContent, d as SidebarHeader, f as SidebarInset, g as SidebarMenuSub, h as SidebarMenuItem, i as useMessagingAuth, l as SidebarFooter, m as SidebarMenuButton, n as messagingScreenPropertySchema, o as useBottomNavHidden, p as SidebarMenu, r as useMessagingConfig, s as Sidebar, t as MessagingScreen, u as SidebarGroupLabel, v as useSidebar } from "./MessagingScreen-
|
|
40
|
-
import { n as subscriptionsScreenPropertySchema, t as SubscriptionsScreen } from "./SubscriptionsScreen-
|
|
39
|
+
import { _ as SidebarProvider, a as BottomNavVisibilityProvider, c as SidebarContent, d as SidebarHeader, f as SidebarInset, g as SidebarMenuSub, h as SidebarMenuItem, i as useMessagingAuth, l as SidebarFooter, m as SidebarMenuButton, n as messagingScreenPropertySchema, o as useBottomNavHidden, p as SidebarMenu, r as useMessagingConfig, s as Sidebar, t as MessagingScreen, u as SidebarGroupLabel, v as useSidebar } from "./MessagingScreen-BtoXnSqJ.mjs";
|
|
40
|
+
import { n as subscriptionsScreenPropertySchema, t as SubscriptionsScreen } from "./SubscriptionsScreen-DyL-7oeE.mjs";
|
|
41
41
|
import { r as chartWidgetPropertySchema, t as ChartWidget } from "./ChartWidget-LcbtV1uD.mjs";
|
|
42
42
|
import { r as containerWidgetPropertySchema, t as ContainerWidget } from "./ContainerWidget-bbzSrNUJ.mjs";
|
|
43
43
|
import { r as embedWidgetPropertySchema, t as EmbedWidget } from "./EmbedWidget-EjCuOFOz.mjs";
|
|
@@ -53,7 +53,7 @@ import { r as spacerWidgetPropertySchema, t as SpacerWidget } from "./SpacerWidg
|
|
|
53
53
|
import { r as tableWidgetPropertySchema, t as TableWidget } from "./TableWidget-BCIzecMi.mjs";
|
|
54
54
|
import { r as toDoWidgetPropertySchema, t as ToDoWidget } from "./ToDoWidget-DtM9JWAS.mjs";
|
|
55
55
|
import { r as videoWidgetPropertySchema, t as VideoWidget } from "./VideoWidget-DyyX7THj.mjs";
|
|
56
|
-
import "./ShopWidget-
|
|
56
|
+
import { r as shopWidgetPropertySchema } from "./ShopWidget-DXVNRrFY.mjs";
|
|
57
57
|
import "./translation-adapter-DfT1IP6Z.mjs";
|
|
58
58
|
import "./translation-adapter-C-L9dSVl.mjs";
|
|
59
59
|
import { r as storeKeys } from "./query-keys-QbaHKNsd.mjs";
|
|
@@ -65,17 +65,17 @@ import { i as useScreenHeaderSlotRefs, r as ScreenHeaderProvider } from "./Scree
|
|
|
65
65
|
import { a as FallbackCard, i as CoreScreenPlaceholder, r as customersScreenPropertySchema, t as CustomersScreen } from "./CustomersScreen-B_dmvOqk.mjs";
|
|
66
66
|
import { a as memberTypeSlug, i as memberTypeName, n as deniesRepSurfaces, r as hasMemberPermission, t as canAccessRepSurfaces } from "./member-permissions-CXsp_VS_.mjs";
|
|
67
67
|
import { a as implementPortalFunction } from "./portal-function-VnzSP78n.mjs";
|
|
68
|
-
import "./use-portal-card-add-3ds-flow-
|
|
68
|
+
import "./use-portal-card-add-3ds-flow-Caupep6C.mjs";
|
|
69
69
|
import "./display-CG8t6Bv8.mjs";
|
|
70
70
|
import "./use-mysite-portal-B9dx249L.mjs";
|
|
71
|
-
import { n as profileScreenPropertySchema, t as ProfileScreen } from "./ProfileScreen-
|
|
71
|
+
import { n as profileScreenPropertySchema, t as ProfileScreen } from "./ProfileScreen-CealQbpo.mjs";
|
|
72
72
|
import "./dist-CBZLrT5S.mjs";
|
|
73
73
|
import "./es-B3I_oMk-.mjs";
|
|
74
74
|
import "./dist-CU-tsJ00.mjs";
|
|
75
|
-
import { n as ordersScreenPropertySchema, t as OrdersScreen } from "./OrdersScreen-
|
|
75
|
+
import { n as ordersScreenPropertySchema, t as OrdersScreen } from "./OrdersScreen-eqJy6_m3.mjs";
|
|
76
76
|
import { r as mySiteScreenPropertySchema, t as MySiteScreen } from "./MySiteScreen-DVkGc2_9.mjs";
|
|
77
77
|
import "./sortable.esm-B6B4nWkF.mjs";
|
|
78
|
-
import { r as shopScreenPropertySchema, t as ShopScreen } from "./ShopScreen-
|
|
78
|
+
import { r as shopScreenPropertySchema, t as ShopScreen } from "./ShopScreen-z2J4fRfs.mjs";
|
|
79
79
|
import "./AppDownloadScreen-OiFZo-I_.mjs";
|
|
80
80
|
import { buildRemoteWidgetPluginManifests } from "./utils/build-remote-widget-plugin-manifests.mjs";
|
|
81
81
|
import * as React$1 from "react";
|
|
@@ -1443,6 +1443,192 @@ function AccessDeniedScreen() {
|
|
|
1443
1443
|
});
|
|
1444
1444
|
}
|
|
1445
1445
|
//#endregion
|
|
1446
|
+
//#region src/core/default-property-schema-registry.ts
|
|
1447
|
+
const DEFAULT_PROPERTY_SCHEMA_REGISTRY = {
|
|
1448
|
+
AlertWidget: alertWidgetPropertySchema,
|
|
1449
|
+
BulletListWidget: bulletListWidgetPropertySchema,
|
|
1450
|
+
CalendarWidget: calendarWidgetPropertySchema,
|
|
1451
|
+
CardWidget: cardWidgetPropertySchema,
|
|
1452
|
+
CarouselWidget: carouselWidgetPropertySchema,
|
|
1453
|
+
ChartWidget: chartWidgetPropertySchema,
|
|
1454
|
+
ContainerWidget: containerWidgetPropertySchema,
|
|
1455
|
+
EmbedWidget: embedWidgetPropertySchema,
|
|
1456
|
+
ImageWidget: imageWidgetPropertySchema,
|
|
1457
|
+
LayoutWidget: layoutWidgetPropertySchema,
|
|
1458
|
+
LinkWidget: linkWidgetPropertySchema,
|
|
1459
|
+
ListWidget: listWidgetPropertySchema,
|
|
1460
|
+
MySiteWidget: mySiteWidgetPropertySchema,
|
|
1461
|
+
NestedWidget: nestedWidgetPropertySchema,
|
|
1462
|
+
PointsWidget: pointsWidgetPropertySchema,
|
|
1463
|
+
QuickLinksWidget: quickLinksWidgetPropertySchema,
|
|
1464
|
+
QuickShareWidget: quickShareWidgetPropertySchema,
|
|
1465
|
+
RecentActivityWidget: recentActivityWidgetPropertySchema,
|
|
1466
|
+
SeparatorWidget: separatorWidgetPropertySchema,
|
|
1467
|
+
ShopWidget: shopWidgetPropertySchema,
|
|
1468
|
+
SpacerWidget: spacerWidgetPropertySchema,
|
|
1469
|
+
TableWidget: tableWidgetPropertySchema,
|
|
1470
|
+
TextWidget: textWidgetPropertySchema,
|
|
1471
|
+
ToDoWidget: toDoWidgetPropertySchema,
|
|
1472
|
+
VideoWidget: videoWidgetPropertySchema
|
|
1473
|
+
};
|
|
1474
|
+
//#endregion
|
|
1475
|
+
//#region src/utils/warn-unknown-widget-props.ts
|
|
1476
|
+
/**
|
|
1477
|
+
* Props every widget instance may legitimately receive that are never part
|
|
1478
|
+
* of a widget's own editable property schema:
|
|
1479
|
+
* - Standard React/DOM pass-through props (`className`, `style`, `children`,
|
|
1480
|
+
* `id`, `key`).
|
|
1481
|
+
* - Structural identity props the screen-renderer pipeline injects itself
|
|
1482
|
+
* for container widgets so they can support drag/select wiring
|
|
1483
|
+
* (`widgetId`, `widgetPath`) — see `ScreenRenderer.tsx` in
|
|
1484
|
+
* `@fluid-app/portal-widgets/core` and `WidgetContent` in
|
|
1485
|
+
* `@fluid-app/portal-builder/core/widget-rendering`, which both inject
|
|
1486
|
+
* these for the same widget nodes rendered here.
|
|
1487
|
+
* Never warn about these even though they never appear in a widget's
|
|
1488
|
+
* `fields` list.
|
|
1489
|
+
*/
|
|
1490
|
+
const ALWAYS_ALLOWED_WIDGET_PROPS = new Set([
|
|
1491
|
+
"className",
|
|
1492
|
+
"style",
|
|
1493
|
+
"children",
|
|
1494
|
+
"id",
|
|
1495
|
+
"key",
|
|
1496
|
+
"widgetId",
|
|
1497
|
+
"widgetPath"
|
|
1498
|
+
]);
|
|
1499
|
+
/** Maximum Levenshtein distance for a "did you mean" suggestion to be shown. */
|
|
1500
|
+
const MAX_SUGGESTION_DISTANCE = 3;
|
|
1501
|
+
/**
|
|
1502
|
+
* Common authoring aliases → the canonical prop name to suggest. Levenshtein
|
|
1503
|
+
* only catches spelling slips; these are *semantic* misses (the motivating
|
|
1504
|
+
* incident authored `content` where the schema says `description` — edit
|
|
1505
|
+
* distance 9, far beyond any sane typo threshold). A suggestion is only shown
|
|
1506
|
+
* when the canonical name actually exists in the widget's schema.
|
|
1507
|
+
*/
|
|
1508
|
+
const PROP_NAME_SYNONYMS = {
|
|
1509
|
+
content: "description",
|
|
1510
|
+
text: "description",
|
|
1511
|
+
body: "description",
|
|
1512
|
+
copy: "description",
|
|
1513
|
+
message: "description",
|
|
1514
|
+
heading: "title",
|
|
1515
|
+
header: "title",
|
|
1516
|
+
label: "title"
|
|
1517
|
+
};
|
|
1518
|
+
/** `${widgetType}::${propName}` pairs already warned about this session. */
|
|
1519
|
+
const warnedPairs = /* @__PURE__ */ new Set();
|
|
1520
|
+
function isDevBuild() {
|
|
1521
|
+
return import.meta.env?.DEV === true;
|
|
1522
|
+
}
|
|
1523
|
+
/**
|
|
1524
|
+
* Levenshtein edit distance between two strings. Small inline helper (no new
|
|
1525
|
+
* dependency) — only ever called with short widget-prop-name strings.
|
|
1526
|
+
*/
|
|
1527
|
+
function levenshteinDistance(a, b) {
|
|
1528
|
+
if (a === b) return 0;
|
|
1529
|
+
if (a.length === 0) return b.length;
|
|
1530
|
+
if (b.length === 0) return a.length;
|
|
1531
|
+
let previousRow = Array.from({ length: b.length + 1 }, (_, j) => j);
|
|
1532
|
+
for (let i = 1; i <= a.length; i++) {
|
|
1533
|
+
const currentRow = [i];
|
|
1534
|
+
for (let j = 1; j <= b.length; j++) {
|
|
1535
|
+
const substitutionCost = a[i - 1] === b[j - 1] ? 0 : 1;
|
|
1536
|
+
const deletion = (previousRow[j] ?? Infinity) + 1;
|
|
1537
|
+
const insertion = (currentRow[j - 1] ?? Infinity) + 1;
|
|
1538
|
+
const substitution = (previousRow[j - 1] ?? Infinity) + substitutionCost;
|
|
1539
|
+
currentRow.push(Math.min(deletion, insertion, substitution));
|
|
1540
|
+
}
|
|
1541
|
+
previousRow = currentRow;
|
|
1542
|
+
}
|
|
1543
|
+
return previousRow[b.length] ?? Math.max(a.length, b.length);
|
|
1544
|
+
}
|
|
1545
|
+
/**
|
|
1546
|
+
* Finds the suggestion for an unknown prop: a known semantic synonym first
|
|
1547
|
+
* (see {@link PROP_NAME_SYNONYMS}), then the nearest known key by Levenshtein
|
|
1548
|
+
* distance within {@link MAX_SUGGESTION_DISTANCE}.
|
|
1549
|
+
*/
|
|
1550
|
+
function findNearestKey(propName, candidates) {
|
|
1551
|
+
const synonym = PROP_NAME_SYNONYMS[propName.toLowerCase()];
|
|
1552
|
+
if (synonym && candidates.includes(synonym)) return synonym;
|
|
1553
|
+
let nearest;
|
|
1554
|
+
let nearestDistance = MAX_SUGGESTION_DISTANCE + 1;
|
|
1555
|
+
for (const candidate of candidates) {
|
|
1556
|
+
const distance = levenshteinDistance(propName, candidate);
|
|
1557
|
+
if (distance < nearestDistance) {
|
|
1558
|
+
nearestDistance = distance;
|
|
1559
|
+
nearest = candidate;
|
|
1560
|
+
}
|
|
1561
|
+
}
|
|
1562
|
+
return nearestDistance <= MAX_SUGGESTION_DISTANCE ? nearest : void 0;
|
|
1563
|
+
}
|
|
1564
|
+
/**
|
|
1565
|
+
* Collects every prop name a widget's property schema actually recognizes as
|
|
1566
|
+
* a `widget.props` key:
|
|
1567
|
+
* - `borderRadius` fields are composite — their top-level `key` is a schema
|
|
1568
|
+
* grouping identifier, not a real widget prop, so its four corner keys are
|
|
1569
|
+
* expanded instead (mirrors `extractPropertyValues` in
|
|
1570
|
+
* `@fluid-app/portal-core/registries`).
|
|
1571
|
+
* - `dataSource` fields are excluded entirely. Per the same
|
|
1572
|
+
* `extractPropertyValues` reference, this field type only exists so the
|
|
1573
|
+
* property panel can gate other fields' visibility on whether a data
|
|
1574
|
+
* source is configured — its value is read from `widget.dataSource` (the
|
|
1575
|
+
* top-level, sibling-of-`props` config), never from `widget.props`.
|
|
1576
|
+
* Authoring a literal `props.dataSource` is a real mistake (the config
|
|
1577
|
+
* belongs one level up), so its field `key` must not be treated as an
|
|
1578
|
+
* accepted prop here.
|
|
1579
|
+
*/
|
|
1580
|
+
function collectKnownPropKeys(fields) {
|
|
1581
|
+
const keys = [];
|
|
1582
|
+
for (const field of fields) if (field.type === "borderRadius") keys.push(...Object.values(field.keys));
|
|
1583
|
+
else if (field.type !== "dataSource") keys.push(field.key);
|
|
1584
|
+
return keys;
|
|
1585
|
+
}
|
|
1586
|
+
/**
|
|
1587
|
+
* Merges schema field keys with `dataSourceTargetProps` — props a data
|
|
1588
|
+
* source may populate (e.g. ListWidget's `items`) that aren't necessarily
|
|
1589
|
+
* declared as editable fields — into one deduped list. Used for both the
|
|
1590
|
+
* known/unknown check and what's surfaced to the author (the "Known props:"
|
|
1591
|
+
* list and suggestion candidates), so a typo of a data-source-only prop
|
|
1592
|
+
* still gets a correct suggestion and the valid name is actually listed.
|
|
1593
|
+
*/
|
|
1594
|
+
function collectAllKnownKeys(schema) {
|
|
1595
|
+
const fieldKeys = collectKnownPropKeys(schema.fields);
|
|
1596
|
+
const targetProps = schema.dataSourceTargetProps ?? [];
|
|
1597
|
+
return Array.from(new Set([...fieldKeys, ...targetProps]));
|
|
1598
|
+
}
|
|
1599
|
+
/**
|
|
1600
|
+
* Dev-only console warning for widget props not declared in the widget's
|
|
1601
|
+
* registered property schema. Guards against the class of bug where an
|
|
1602
|
+
* authored screen sets a prop the widget doesn't know about (typo'd name,
|
|
1603
|
+
* stale field from a prior schema version) — the prop is silently dropped
|
|
1604
|
+
* and the widget renders its placeholder defaults with no signal to the
|
|
1605
|
+
* author.
|
|
1606
|
+
*
|
|
1607
|
+
* No-ops entirely outside a Vite dev build (checked first, before any prop
|
|
1608
|
+
* iteration, so there's zero overhead in production bundles) and for widget
|
|
1609
|
+
* types with no registered schema (custom/company widgets) — there's nothing
|
|
1610
|
+
* to validate against, so we skip silently rather than warn.
|
|
1611
|
+
*
|
|
1612
|
+
* Warns at most once per (widgetType, propName) pair per session.
|
|
1613
|
+
*/
|
|
1614
|
+
function warnUnknownWidgetProps({ widgetType, props, registry }) {
|
|
1615
|
+
if (!isDevBuild()) return;
|
|
1616
|
+
const schema = registry[widgetType];
|
|
1617
|
+
if (!schema) return;
|
|
1618
|
+
const knownKeys = collectAllKnownKeys(schema);
|
|
1619
|
+
const knownKeySet = new Set(knownKeys);
|
|
1620
|
+
for (const propName of Object.keys(props)) {
|
|
1621
|
+
if (knownKeySet.has(propName)) continue;
|
|
1622
|
+
if (ALWAYS_ALLOWED_WIDGET_PROPS.has(propName)) continue;
|
|
1623
|
+
const pairKey = `${widgetType}::${propName}`;
|
|
1624
|
+
if (warnedPairs.has(pairKey)) continue;
|
|
1625
|
+
warnedPairs.add(pairKey);
|
|
1626
|
+
const suggestion = findNearestKey(propName, knownKeys);
|
|
1627
|
+
const suggestionText = suggestion ? ` Did you mean "${suggestion}"?` : "";
|
|
1628
|
+
console.warn(`[portal] ${widgetType} received unknown prop "${propName}" — not in its schema.${suggestionText} Known props: ${knownKeys.join(", ")}.`);
|
|
1629
|
+
}
|
|
1630
|
+
}
|
|
1631
|
+
//#endregion
|
|
1446
1632
|
//#region src/shell/BuilderScreenView.tsx
|
|
1447
1633
|
/**
|
|
1448
1634
|
* BuilderScreenView — renders a builder screen's component_tree with
|
|
@@ -1460,6 +1646,11 @@ function WidgetRenderer({ widget, index }) {
|
|
|
1460
1646
|
console.warn(`[BuilderScreenView] Widget type "${String(widget.type)}" not found in registry`);
|
|
1461
1647
|
return null;
|
|
1462
1648
|
}
|
|
1649
|
+
if (isDefaultWidgetComponent(widget.type, Component)) warnUnknownWidgetProps({
|
|
1650
|
+
widgetType: widget.type,
|
|
1651
|
+
props: widget.props,
|
|
1652
|
+
registry: DEFAULT_PROPERTY_SCHEMA_REGISTRY
|
|
1653
|
+
});
|
|
1463
1654
|
if (widget.dataSource) return /* @__PURE__ */ jsx("div", {
|
|
1464
1655
|
className: "h-full w-full overflow-x-hidden",
|
|
1465
1656
|
children: /* @__PURE__ */ jsx(DataAwareWidget, {
|
|
@@ -1522,12 +1713,12 @@ function resolveMemberTypePage(registry, memberTypeSlug, currentSlug, baseSlug)
|
|
|
1522
1713
|
}
|
|
1523
1714
|
//#endregion
|
|
1524
1715
|
//#region src/shell/system-screen-map.ts
|
|
1525
|
-
const ProfileScreen$1 = lazy(() => import("./ProfileScreen-
|
|
1526
|
-
const OrdersScreen$1 = lazy(() => import("./OrdersScreen-
|
|
1527
|
-
const SubscriptionsScreen$1 = lazy(() => import("./SubscriptionsScreen-
|
|
1528
|
-
const MessagingScreen$1 = lazy(() => import("./MessagingScreen-
|
|
1529
|
-
const ContactsScreen$1 = lazy(() => import("./ContactsScreen-
|
|
1530
|
-
const ShopScreen$1 = lazy(() => import("./ShopScreen-
|
|
1716
|
+
const ProfileScreen$1 = lazy(() => import("./ProfileScreen-C4SiOL-k.mjs").then((m) => ({ default: m.ProfileScreen })));
|
|
1717
|
+
const OrdersScreen$1 = lazy(() => import("./OrdersScreen-CutgAgyO.mjs").then((m) => ({ default: m.OrdersScreen })));
|
|
1718
|
+
const SubscriptionsScreen$1 = lazy(() => import("./SubscriptionsScreen-CBEULwpU.mjs").then((m) => ({ default: m.SubscriptionsScreen })));
|
|
1719
|
+
const MessagingScreen$1 = lazy(() => import("./MessagingScreen-CYqzOl6D.mjs").then((m) => ({ default: m.MessagingScreen })));
|
|
1720
|
+
const ContactsScreen$1 = lazy(() => import("./ContactsScreen-D0l3-Xof.mjs").then((n) => n.n).then((m) => ({ default: m.ContactsScreen })));
|
|
1721
|
+
const ShopScreen$1 = lazy(() => import("./ShopScreen-B6cf4gW-.mjs").then((m) => ({ default: m.ShopScreen })));
|
|
1531
1722
|
const CustomersScreen$1 = lazy(() => import("./CustomersScreen-B_dmvOqk.mjs").then((n) => n.n).then((m) => ({ default: m.CustomersScreen })));
|
|
1532
1723
|
const ShareablesScreen$1 = lazy(() => import("./ShareablesScreen-u6O-4LI4.mjs").then((m) => ({ default: m.ShareablesScreen })));
|
|
1533
1724
|
const MySiteScreen$1 = lazy(() => import("./MySiteScreen-DVkGc2_9.mjs").then((n) => n.n).then((m) => ({ default: m.MySiteScreen })));
|
|
@@ -3435,15 +3626,15 @@ const CORE_PAGE_IDS = {
|
|
|
3435
3626
|
//#endregion
|
|
3436
3627
|
//#region src/screens/index.ts
|
|
3437
3628
|
const screenPropertySchemas = {
|
|
3438
|
-
ProfileScreen: () => import("./ProfileScreen-
|
|
3439
|
-
MessagingScreen: () => import("./MessagingScreen-
|
|
3440
|
-
ContactsScreen: () => import("./ContactsScreen-
|
|
3441
|
-
OrdersScreen: () => import("./OrdersScreen-
|
|
3442
|
-
SubscriptionsScreen: () => import("./SubscriptionsScreen-
|
|
3629
|
+
ProfileScreen: () => import("./ProfileScreen-C4SiOL-k.mjs").then((m) => m.profileScreenPropertySchema),
|
|
3630
|
+
MessagingScreen: () => import("./MessagingScreen-CYqzOl6D.mjs").then((m) => m.messagingScreenPropertySchema),
|
|
3631
|
+
ContactsScreen: () => import("./ContactsScreen-D0l3-Xof.mjs").then((n) => n.n).then((m) => m.contactsScreenPropertySchema),
|
|
3632
|
+
OrdersScreen: () => import("./OrdersScreen-CutgAgyO.mjs").then((m) => m.ordersScreenPropertySchema),
|
|
3633
|
+
SubscriptionsScreen: () => import("./SubscriptionsScreen-CBEULwpU.mjs").then((m) => m.subscriptionsScreenPropertySchema),
|
|
3443
3634
|
CustomersScreen: () => import("./CustomersScreen-B_dmvOqk.mjs").then((n) => n.n).then((m) => m.customersScreenPropertySchema),
|
|
3444
3635
|
MySiteScreen: () => import("./MySiteScreen-DVkGc2_9.mjs").then((n) => n.n).then((m) => m.mySiteScreenPropertySchema),
|
|
3445
3636
|
ShareablesScreen: () => import("./ShareablesScreen-u6O-4LI4.mjs").then((m) => m.shareablesScreenPropertySchema),
|
|
3446
|
-
ShopScreen: () => import("./ShopScreen-
|
|
3637
|
+
ShopScreen: () => import("./ShopScreen-B6cf4gW-.mjs").then((m) => m.shopScreenPropertySchema),
|
|
3447
3638
|
AppDownloadScreen: () => import("./AppDownloadScreen-OiFZo-I_.mjs").then((n) => n.t).then((m) => m.appDownloadScreenPropertySchema)
|
|
3448
3639
|
};
|
|
3449
3640
|
/**
|