@fluid-app/portal-sdk 0.1.1204 → 0.1.1205
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/{ContactsScreen-C54JDgZV.mjs → ContactsScreen-CQZcqvxL.mjs} +2 -0
- package/dist/{MessagingScreen-BY1au1nq.mjs → MessagingScreen-S9HYaIT6.mjs} +3 -0
- package/dist/{MySiteScreen-DNUrMkMx.mjs → MySiteScreen-DVF95aPh.mjs} +2 -0
- package/dist/{OrdersScreen-BMnsKjiM.mjs → OrdersScreen-CNUF69bR.mjs} +3 -0
- package/dist/{ProfileScreen-CbGf23vK.mjs → ProfileScreen-CEmnfikF.mjs} +3 -0
- package/dist/{ShareablesScreen-ZcmpJMNN.mjs → ShareablesScreen-BFzwmEmQ.mjs} +3 -0
- package/dist/{ShopScreen-ZJQkTgpz.mjs → ShopScreen-Om5k59Qs.mjs} +2 -0
- package/dist/{SubscriptionsScreen-Jz1QTLV8.mjs → SubscriptionsScreen-g0O8LUxW.mjs} +3 -0
- package/dist/index.mjs +16 -16
- package/dist/utils/build-remote-widget-plugin-manifests.mjs +3 -0
- package/dist/utils/build-remote-widget-plugin-manifests.mjs.map +1 -1
- package/dist/utils/build-widget-registry.mjs +3 -0
- package/package.json +1 -1
|
@@ -2,6 +2,7 @@ import "./src-CnIm-Mtj.mjs";
|
|
|
2
2
|
import { n as contactsScreenPropertySchema, t as ContactsScreen } from "./ContactsScreen-Bp9Cm8fg.mjs";
|
|
3
3
|
import "./ContactsTranslationBridge-DTzIwVsL.mjs";
|
|
4
4
|
import "./account-api-context-DCEDXtbM.mjs";
|
|
5
|
+
import "./use-account-DGLFNV-5.mjs";
|
|
5
6
|
import "./Combobox-DB0JYBY9.mjs";
|
|
6
7
|
import "./MobileBottomSheet-DzdRiw1J.mjs";
|
|
7
8
|
import "./translations-CUmgrWYS.mjs";
|
|
@@ -9,6 +10,7 @@ import "./translation-api-context-factory-CqaWGIeb.mjs";
|
|
|
9
10
|
import "./task-composer-form-DJg1Z8RL.mjs";
|
|
10
11
|
import "./MobileActionSheet-DRMgDqMS.mjs";
|
|
11
12
|
import "./ResponsiveDialog-CsCcPmhl.mjs";
|
|
13
|
+
import "./AppNavigationContext-DqicaN-h.mjs";
|
|
12
14
|
import "./sidebar-_2EXK1ZW.mjs";
|
|
13
15
|
import "./ScreenHeaderContext-BJSvHwCS.mjs";
|
|
14
16
|
import "./dist-DfW-EeJM.mjs";
|
|
@@ -4,6 +4,7 @@ import "./ContactsTranslationBridge-DTzIwVsL.mjs";
|
|
|
4
4
|
import "./FluidProvider-DG3bkY2e.mjs";
|
|
5
5
|
import "./ScreenRenderer-Cvg0dAKx.mjs";
|
|
6
6
|
import "./account-api-context-DCEDXtbM.mjs";
|
|
7
|
+
import "./use-account-DGLFNV-5.mjs";
|
|
7
8
|
import "./use-optional-store-BtV6d6ON.mjs";
|
|
8
9
|
import "./use-mysite-portal-CzJ-PGXG.mjs";
|
|
9
10
|
import "./Combobox-DB0JYBY9.mjs";
|
|
@@ -67,6 +68,8 @@ import "./ShopWidget-PB5xCnVX.mjs";
|
|
|
67
68
|
import "./translation-adapter-CTYyUTEU.mjs";
|
|
68
69
|
import "./translation-adapter-CAK15sMp.mjs";
|
|
69
70
|
import "./translation-adapter-iJKgfFly.mjs";
|
|
71
|
+
import "./AppNavigationContext-DqicaN-h.mjs";
|
|
72
|
+
import "./use-store-CHtT1S6R.mjs";
|
|
70
73
|
import "./sidebar-_2EXK1ZW.mjs";
|
|
71
74
|
import "./ScreenHeaderContext-BJSvHwCS.mjs";
|
|
72
75
|
import "./dist-DfW-EeJM.mjs";
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import "./src-CnIm-Mtj.mjs";
|
|
2
2
|
import "./account-api-context-DCEDXtbM.mjs";
|
|
3
|
+
import "./use-account-DGLFNV-5.mjs";
|
|
3
4
|
import "./use-mysite-portal-CzJ-PGXG.mjs";
|
|
4
5
|
import "./MobileBottomSheet-DzdRiw1J.mjs";
|
|
5
6
|
import "./translations-CUmgrWYS.mjs";
|
|
6
7
|
import "./translation-api-context-factory-CqaWGIeb.mjs";
|
|
7
8
|
import "./ResponsiveDialog-CsCcPmhl.mjs";
|
|
8
9
|
import "./translation-adapter-iJKgfFly.mjs";
|
|
10
|
+
import "./AppNavigationContext-DqicaN-h.mjs";
|
|
9
11
|
import "./sidebar-_2EXK1ZW.mjs";
|
|
10
12
|
import "./ScreenHeaderContext-BJSvHwCS.mjs";
|
|
11
13
|
import { n as mySiteScreenPropertySchema, t as MySiteScreen } from "./MySiteScreen-CsqsWHiI.mjs";
|
|
@@ -4,6 +4,7 @@ import "./ContactsTranslationBridge-DTzIwVsL.mjs";
|
|
|
4
4
|
import "./FluidProvider-DG3bkY2e.mjs";
|
|
5
5
|
import "./ScreenRenderer-Cvg0dAKx.mjs";
|
|
6
6
|
import "./account-api-context-DCEDXtbM.mjs";
|
|
7
|
+
import "./use-account-DGLFNV-5.mjs";
|
|
7
8
|
import "./use-optional-store-BtV6d6ON.mjs";
|
|
8
9
|
import "./use-mysite-portal-CzJ-PGXG.mjs";
|
|
9
10
|
import "./Combobox-DB0JYBY9.mjs";
|
|
@@ -66,6 +67,8 @@ import "./ShopWidget-PB5xCnVX.mjs";
|
|
|
66
67
|
import "./translation-adapter-CTYyUTEU.mjs";
|
|
67
68
|
import "./translation-adapter-CAK15sMp.mjs";
|
|
68
69
|
import "./translation-adapter-iJKgfFly.mjs";
|
|
70
|
+
import "./AppNavigationContext-DqicaN-h.mjs";
|
|
71
|
+
import "./use-store-CHtT1S6R.mjs";
|
|
69
72
|
import "./ScreenHeaderContext-BJSvHwCS.mjs";
|
|
70
73
|
import { n as ordersScreenPropertySchema, t as OrdersScreen } from "./OrdersScreen-CVC-ePwl.mjs";
|
|
71
74
|
export { OrdersScreen, ordersScreenPropertySchema };
|
|
@@ -4,6 +4,7 @@ import "./ContactsTranslationBridge-DTzIwVsL.mjs";
|
|
|
4
4
|
import "./FluidProvider-DG3bkY2e.mjs";
|
|
5
5
|
import "./ScreenRenderer-Cvg0dAKx.mjs";
|
|
6
6
|
import "./account-api-context-DCEDXtbM.mjs";
|
|
7
|
+
import "./use-account-DGLFNV-5.mjs";
|
|
7
8
|
import "./use-optional-store-BtV6d6ON.mjs";
|
|
8
9
|
import "./use-mysite-portal-CzJ-PGXG.mjs";
|
|
9
10
|
import "./Combobox-DB0JYBY9.mjs";
|
|
@@ -66,6 +67,8 @@ import "./ShopWidget-PB5xCnVX.mjs";
|
|
|
66
67
|
import "./translation-adapter-CTYyUTEU.mjs";
|
|
67
68
|
import "./translation-adapter-CAK15sMp.mjs";
|
|
68
69
|
import "./translation-adapter-iJKgfFly.mjs";
|
|
70
|
+
import "./AppNavigationContext-DqicaN-h.mjs";
|
|
71
|
+
import "./use-store-CHtT1S6R.mjs";
|
|
69
72
|
import "./sidebar-_2EXK1ZW.mjs";
|
|
70
73
|
import "./ScreenHeaderContext-BJSvHwCS.mjs";
|
|
71
74
|
import "./use-portal-card-add-3ds-flow-ezuDSsz2.mjs";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import "./src-CnIm-Mtj.mjs";
|
|
2
2
|
import "./account-api-context-DCEDXtbM.mjs";
|
|
3
|
+
import "./use-account-DGLFNV-5.mjs";
|
|
3
4
|
import "./use-optional-store-BtV6d6ON.mjs";
|
|
4
5
|
import "./use-mysite-portal-CzJ-PGXG.mjs";
|
|
5
6
|
import "./prop-types-C3v9Sv4q.mjs";
|
|
@@ -13,6 +14,8 @@ import "./purify.es-Ckb34wqr.mjs";
|
|
|
13
14
|
import "./MobileActionSheet-DRMgDqMS.mjs";
|
|
14
15
|
import "./ResponsiveDialog-CsCcPmhl.mjs";
|
|
15
16
|
import "./translation-adapter-CTYyUTEU.mjs";
|
|
17
|
+
import "./AppNavigationContext-DqicaN-h.mjs";
|
|
18
|
+
import "./use-store-CHtT1S6R.mjs";
|
|
16
19
|
import "./ScreenHeaderContext-BJSvHwCS.mjs";
|
|
17
20
|
import "./dist-DfW-EeJM.mjs";
|
|
18
21
|
import "./es-CKZlLpGQ.mjs";
|
|
@@ -7,6 +7,8 @@ import "./translation-api-context-factory-CqaWGIeb.mjs";
|
|
|
7
7
|
import "./translation-api-context-DwmI-ll0.mjs";
|
|
8
8
|
import "./use-can-show-volume-BIE0134R.mjs";
|
|
9
9
|
import "./MobileActionSheet-DRMgDqMS.mjs";
|
|
10
|
+
import "./AppNavigationContext-DqicaN-h.mjs";
|
|
11
|
+
import "./use-store-CHtT1S6R.mjs";
|
|
10
12
|
import "./ScreenHeaderContext-BJSvHwCS.mjs";
|
|
11
13
|
import { n as shopScreenPropertySchema, t as ShopScreen } from "./ShopScreen-DvC7oE5o.mjs";
|
|
12
14
|
export { ShopScreen, shopScreenPropertySchema };
|
|
@@ -4,6 +4,7 @@ import "./ContactsTranslationBridge-DTzIwVsL.mjs";
|
|
|
4
4
|
import "./FluidProvider-DG3bkY2e.mjs";
|
|
5
5
|
import "./ScreenRenderer-Cvg0dAKx.mjs";
|
|
6
6
|
import "./account-api-context-DCEDXtbM.mjs";
|
|
7
|
+
import "./use-account-DGLFNV-5.mjs";
|
|
7
8
|
import "./use-optional-store-BtV6d6ON.mjs";
|
|
8
9
|
import "./use-mysite-portal-CzJ-PGXG.mjs";
|
|
9
10
|
import "./Combobox-DB0JYBY9.mjs";
|
|
@@ -67,6 +68,8 @@ import "./ShopWidget-PB5xCnVX.mjs";
|
|
|
67
68
|
import "./translation-adapter-CTYyUTEU.mjs";
|
|
68
69
|
import "./translation-adapter-CAK15sMp.mjs";
|
|
69
70
|
import "./translation-adapter-iJKgfFly.mjs";
|
|
71
|
+
import "./AppNavigationContext-DqicaN-h.mjs";
|
|
72
|
+
import "./use-store-CHtT1S6R.mjs";
|
|
70
73
|
import "./sidebar-_2EXK1ZW.mjs";
|
|
71
74
|
import "./ScreenHeaderContext-BJSvHwCS.mjs";
|
|
72
75
|
import "./use-portal-card-add-3ds-flow-ezuDSsz2.mjs";
|
package/dist/index.mjs
CHANGED
|
@@ -2149,15 +2149,15 @@ function resolveMemberTypePage(registry, memberTypeSlug, currentSlug, baseSlug)
|
|
|
2149
2149
|
}
|
|
2150
2150
|
//#endregion
|
|
2151
2151
|
//#region src/shell/system-screen-map.ts
|
|
2152
|
-
const ProfileScreen$1 = lazy(() => import("./ProfileScreen-
|
|
2153
|
-
const OrdersScreen$1 = lazy(() => import("./OrdersScreen-
|
|
2154
|
-
const SubscriptionsScreen$1 = lazy(() => import("./SubscriptionsScreen-
|
|
2155
|
-
const MessagingScreen$1 = lazy(() => import("./MessagingScreen-
|
|
2156
|
-
const ContactsScreen$1 = lazy(() => import("./ContactsScreen-
|
|
2157
|
-
const ShopScreen$1 = lazy(() => import("./ShopScreen-
|
|
2152
|
+
const ProfileScreen$1 = lazy(() => import("./ProfileScreen-CEmnfikF.mjs").then((m) => ({ default: m.ProfileScreen })));
|
|
2153
|
+
const OrdersScreen$1 = lazy(() => import("./OrdersScreen-CNUF69bR.mjs").then((m) => ({ default: m.OrdersScreen })));
|
|
2154
|
+
const SubscriptionsScreen$1 = lazy(() => import("./SubscriptionsScreen-g0O8LUxW.mjs").then((m) => ({ default: m.SubscriptionsScreen })));
|
|
2155
|
+
const MessagingScreen$1 = lazy(() => import("./MessagingScreen-S9HYaIT6.mjs").then((m) => ({ default: m.MessagingScreen })));
|
|
2156
|
+
const ContactsScreen$1 = lazy(() => import("./ContactsScreen-CQZcqvxL.mjs").then((m) => ({ default: m.ContactsScreen })));
|
|
2157
|
+
const ShopScreen$1 = lazy(() => import("./ShopScreen-Om5k59Qs.mjs").then((m) => ({ default: m.ShopScreen })));
|
|
2158
2158
|
const CustomersScreen$1 = lazy(() => import("./CustomersScreen-Ddv4PP_T.mjs").then((n) => n.n).then((m) => ({ default: m.CustomersScreen })));
|
|
2159
|
-
const ShareablesScreen$1 = lazy(() => import("./ShareablesScreen-
|
|
2160
|
-
const MySiteScreen$1 = lazy(() => import("./MySiteScreen-
|
|
2159
|
+
const ShareablesScreen$1 = lazy(() => import("./ShareablesScreen-BFzwmEmQ.mjs").then((m) => ({ default: m.ShareablesScreen })));
|
|
2160
|
+
const MySiteScreen$1 = lazy(() => import("./MySiteScreen-DVF95aPh.mjs").then((m) => ({ default: m.MySiteScreen })));
|
|
2161
2161
|
const AppDownloadScreen = lazy(() => import("./AppDownloadScreen-DgGzQNik.mjs").then((n) => n.t).then((m) => ({ default: m.AppDownloadScreen })));
|
|
2162
2162
|
const ActivityScreen$1 = lazy(() => import("./ActivityScreen-cv7X1PHf.mjs").then((n) => n.n).then((m) => ({ default: m.ActivityScreen })));
|
|
2163
2163
|
const SCREEN_FOR_SLUG = {
|
|
@@ -4806,15 +4806,15 @@ const CORE_PAGE_IDS = {
|
|
|
4806
4806
|
//#endregion
|
|
4807
4807
|
//#region src/screens/index.ts
|
|
4808
4808
|
const screenPropertySchemas = {
|
|
4809
|
-
ProfileScreen: () => import("./ProfileScreen-
|
|
4810
|
-
MessagingScreen: () => import("./MessagingScreen-
|
|
4811
|
-
ContactsScreen: () => import("./ContactsScreen-
|
|
4812
|
-
OrdersScreen: () => import("./OrdersScreen-
|
|
4813
|
-
SubscriptionsScreen: () => import("./SubscriptionsScreen-
|
|
4809
|
+
ProfileScreen: () => import("./ProfileScreen-CEmnfikF.mjs").then((m) => m.profileScreenPropertySchema),
|
|
4810
|
+
MessagingScreen: () => import("./MessagingScreen-S9HYaIT6.mjs").then((m) => m.messagingScreenPropertySchema),
|
|
4811
|
+
ContactsScreen: () => import("./ContactsScreen-CQZcqvxL.mjs").then((m) => m.contactsScreenPropertySchema),
|
|
4812
|
+
OrdersScreen: () => import("./OrdersScreen-CNUF69bR.mjs").then((m) => m.ordersScreenPropertySchema),
|
|
4813
|
+
SubscriptionsScreen: () => import("./SubscriptionsScreen-g0O8LUxW.mjs").then((m) => m.subscriptionsScreenPropertySchema),
|
|
4814
4814
|
CustomersScreen: () => import("./CustomersScreen-Ddv4PP_T.mjs").then((n) => n.n).then((m) => m.customersScreenPropertySchema),
|
|
4815
|
-
MySiteScreen: () => import("./MySiteScreen-
|
|
4816
|
-
ShareablesScreen: () => import("./ShareablesScreen-
|
|
4817
|
-
ShopScreen: () => import("./ShopScreen-
|
|
4815
|
+
MySiteScreen: () => import("./MySiteScreen-DVF95aPh.mjs").then((m) => m.mySiteScreenPropertySchema),
|
|
4816
|
+
ShareablesScreen: () => import("./ShareablesScreen-BFzwmEmQ.mjs").then((m) => m.shareablesScreenPropertySchema),
|
|
4817
|
+
ShopScreen: () => import("./ShopScreen-Om5k59Qs.mjs").then((m) => m.shopScreenPropertySchema),
|
|
4818
4818
|
AppDownloadScreen: () => import("./AppDownloadScreen-DgGzQNik.mjs").then((n) => n.t).then((m) => m.appDownloadScreenPropertySchema),
|
|
4819
4819
|
ActivityScreen: () => import("./ActivityScreen-cv7X1PHf.mjs").then((n) => n.n).then((m) => m.activityScreenPropertySchema)
|
|
4820
4820
|
};
|
|
@@ -2,6 +2,7 @@ import "../src-CnIm-Mtj.mjs";
|
|
|
2
2
|
import { a as createRemoteWidgetCapabilityGrants, i as projectRemoteWidgetPackages } from "../build-widget-registry-BiWa_rUL.mjs";
|
|
3
3
|
import "../ScreenRenderer-Cvg0dAKx.mjs";
|
|
4
4
|
import "../account-api-context-DCEDXtbM.mjs";
|
|
5
|
+
import "../use-account-DGLFNV-5.mjs";
|
|
5
6
|
import "../use-optional-store-BtV6d6ON.mjs";
|
|
6
7
|
import "../use-mysite-portal-CzJ-PGXG.mjs";
|
|
7
8
|
import "../Combobox-DB0JYBY9.mjs";
|
|
@@ -59,6 +60,8 @@ import "../ToDoWidget-B7TpUvT6.mjs";
|
|
|
59
60
|
import "../ResponsiveDialog-CsCcPmhl.mjs";
|
|
60
61
|
import "../VideoWidget-Byrdtjfa.mjs";
|
|
61
62
|
import "../ShopWidget-PB5xCnVX.mjs";
|
|
63
|
+
import "../AppNavigationContext-DqicaN-h.mjs";
|
|
64
|
+
import "../use-store-CHtT1S6R.mjs";
|
|
62
65
|
//#region src/utils/build-remote-widget-plugin-manifests.ts
|
|
63
66
|
const REMOTE_WIDGET_PACKAGE_CATEGORY_PREFIX = "custom-widget-package";
|
|
64
67
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-remote-widget-plugin-manifests.mjs","names":[],"sources":["../../src/utils/build-remote-widget-plugin-manifests.ts"],"sourcesContent":["import type { ComponentType } from \"react\";\nimport { createRemoteWidgetCapabilityGrants } from \"@fluid-app/portal-core/remote-widget-capability-grants\";\nimport {\n isPropertyFieldType,\n type PropertyField,\n type WidgetManifest,\n} from \"@fluid-app/portal-core/registries\";\nimport type {\n RemoteDomWidgetDefinition,\n RemoteDomWidgetPackageDescriptor,\n} from \"@fluid-app/portal-core/remote-dom-widget-package\";\nimport {\n projectRemoteWidgetPackages,\n type RemoteDomWidgetRegistryOptions,\n type WidgetRegistryWarningSink,\n} from \"../widgets/remote/host/build-widget-registry\";\n\nconst REMOTE_WIDGET_PACKAGE_CATEGORY_PREFIX = \"custom-widget-package\";\n\nexport interface RemoteWidgetPluginHostOptions extends RemoteDomWidgetRegistryOptions {\n readonly warningSink?: WidgetRegistryWarningSink;\n}\n\n/**\n * Projects accepted canonical packages into builder manifests using the same\n * package-atomic acceptance pass as the runtime registry.\n */\nexport function buildRemoteWidgetPluginManifests(\n packages: readonly RemoteDomWidgetPackageDescriptor[],\n hostOptions: RemoteWidgetPluginHostOptions = {},\n): WidgetManifest[] {\n const { warningSink, ...registryOptions } = hostOptions;\n const projection = projectRemoteWidgetPackages(\n {},\n packages,\n registryOptions,\n warningSink ?? console.warn,\n );\n return projection.acceptedWidgets.map(\n ({ remotePackage, widget, component }) =>\n toWidgetManifest(remotePackage, widget, component),\n );\n}\n\nexport function getRemoteWidgetPackageCategoryId(\n remotePackage: Pick<RemoteDomWidgetPackageDescriptor, \"packageId\" | \"source\">,\n): string {\n return [\n REMOTE_WIDGET_PACKAGE_CATEGORY_PREFIX,\n remotePackage.source,\n encodeURIComponent(remotePackage.packageId),\n ].join(\":\");\n}\n\nfunction toWidgetManifest(\n remotePackage: RemoteDomWidgetPackageDescriptor,\n widget: RemoteDomWidgetDefinition,\n component: ComponentType<Record<string, unknown>>,\n): WidgetManifest {\n const resizable = toResizable(widget.resizable);\n const capabilityGrants = createRemoteWidgetCapabilityGrants(\n remotePackage,\n widget,\n );\n return {\n manifestVersion: 1,\n type: widget.type,\n component,\n displayName: widget.displayName,\n description: widget.description,\n icon: widget.icon,\n category: getRemoteWidgetPackageCategoryId(remotePackage),\n propertySchema: normalizePropertySchema(widget),\n defaultProps: { ...widget.defaultProps },\n minSdkVersion: widget.minSdkVersion,\n ...(resizable === undefined ? {} : { resizable }),\n ...(capabilityGrants === undefined ? {} : { capabilityGrants }),\n };\n}\n\nfunction normalizePropertySchema(\n widget: RemoteDomWidgetDefinition,\n): WidgetManifest[\"propertySchema\"] {\n const fields = Array.isArray(widget.propertySchema.fields)\n ? widget.propertySchema.fields.filter(isPropertyField)\n : [];\n return {\n ...widget.propertySchema,\n widgetType: widget.type,\n displayName:\n typeof widget.propertySchema.displayName === \"string\"\n ? widget.propertySchema.displayName\n : widget.displayName,\n fields,\n } as WidgetManifest[\"propertySchema\"];\n}\n\nfunction toResizable(\n resizable: RemoteDomWidgetDefinition[\"resizable\"],\n): WidgetManifest[\"resizable\"] {\n if (resizable === false) return undefined;\n if (resizable === true || resizable === \"both\") {\n return { horizontal: true, vertical: true };\n }\n return resizable === \"horizontal\" ? { horizontal: true } : { vertical: true };\n}\n\nfunction isPropertyField(value: unknown): value is PropertyField {\n return (\n typeof value === \"object\" &&\n value !== null &&\n \"key\" in value &&\n typeof value.key === \"string\" &&\n \"label\" in value &&\n typeof value.label === \"string\" &&\n \"type\" in value &&\n typeof value.type === \"string\" &&\n isPropertyFieldType(value.type)\n );\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"build-remote-widget-plugin-manifests.mjs","names":[],"sources":["../../src/utils/build-remote-widget-plugin-manifests.ts"],"sourcesContent":["import type { ComponentType } from \"react\";\nimport { createRemoteWidgetCapabilityGrants } from \"@fluid-app/portal-core/remote-widget-capability-grants\";\nimport {\n isPropertyFieldType,\n type PropertyField,\n type WidgetManifest,\n} from \"@fluid-app/portal-core/registries\";\nimport type {\n RemoteDomWidgetDefinition,\n RemoteDomWidgetPackageDescriptor,\n} from \"@fluid-app/portal-core/remote-dom-widget-package\";\nimport {\n projectRemoteWidgetPackages,\n type RemoteDomWidgetRegistryOptions,\n type WidgetRegistryWarningSink,\n} from \"../widgets/remote/host/build-widget-registry\";\n\nconst REMOTE_WIDGET_PACKAGE_CATEGORY_PREFIX = \"custom-widget-package\";\n\nexport interface RemoteWidgetPluginHostOptions extends RemoteDomWidgetRegistryOptions {\n readonly warningSink?: WidgetRegistryWarningSink;\n}\n\n/**\n * Projects accepted canonical packages into builder manifests using the same\n * package-atomic acceptance pass as the runtime registry.\n */\nexport function buildRemoteWidgetPluginManifests(\n packages: readonly RemoteDomWidgetPackageDescriptor[],\n hostOptions: RemoteWidgetPluginHostOptions = {},\n): WidgetManifest[] {\n const { warningSink, ...registryOptions } = hostOptions;\n const projection = projectRemoteWidgetPackages(\n {},\n packages,\n registryOptions,\n warningSink ?? console.warn,\n );\n return projection.acceptedWidgets.map(\n ({ remotePackage, widget, component }) =>\n toWidgetManifest(remotePackage, widget, component),\n );\n}\n\nexport function getRemoteWidgetPackageCategoryId(\n remotePackage: Pick<RemoteDomWidgetPackageDescriptor, \"packageId\" | \"source\">,\n): string {\n return [\n REMOTE_WIDGET_PACKAGE_CATEGORY_PREFIX,\n remotePackage.source,\n encodeURIComponent(remotePackage.packageId),\n ].join(\":\");\n}\n\nfunction toWidgetManifest(\n remotePackage: RemoteDomWidgetPackageDescriptor,\n widget: RemoteDomWidgetDefinition,\n component: ComponentType<Record<string, unknown>>,\n): WidgetManifest {\n const resizable = toResizable(widget.resizable);\n const capabilityGrants = createRemoteWidgetCapabilityGrants(\n remotePackage,\n widget,\n );\n return {\n manifestVersion: 1,\n type: widget.type,\n component,\n displayName: widget.displayName,\n description: widget.description,\n icon: widget.icon,\n category: getRemoteWidgetPackageCategoryId(remotePackage),\n propertySchema: normalizePropertySchema(widget),\n defaultProps: { ...widget.defaultProps },\n minSdkVersion: widget.minSdkVersion,\n ...(resizable === undefined ? {} : { resizable }),\n ...(capabilityGrants === undefined ? {} : { capabilityGrants }),\n };\n}\n\nfunction normalizePropertySchema(\n widget: RemoteDomWidgetDefinition,\n): WidgetManifest[\"propertySchema\"] {\n const fields = Array.isArray(widget.propertySchema.fields)\n ? widget.propertySchema.fields.filter(isPropertyField)\n : [];\n return {\n ...widget.propertySchema,\n widgetType: widget.type,\n displayName:\n typeof widget.propertySchema.displayName === \"string\"\n ? widget.propertySchema.displayName\n : widget.displayName,\n fields,\n } as WidgetManifest[\"propertySchema\"];\n}\n\nfunction toResizable(\n resizable: RemoteDomWidgetDefinition[\"resizable\"],\n): WidgetManifest[\"resizable\"] {\n if (resizable === false) return undefined;\n if (resizable === true || resizable === \"both\") {\n return { horizontal: true, vertical: true };\n }\n return resizable === \"horizontal\" ? { horizontal: true } : { vertical: true };\n}\n\nfunction isPropertyField(value: unknown): value is PropertyField {\n return (\n typeof value === \"object\" &&\n value !== null &&\n \"key\" in value &&\n typeof value.key === \"string\" &&\n \"label\" in value &&\n typeof value.label === \"string\" &&\n \"type\" in value &&\n typeof value.type === \"string\" &&\n isPropertyFieldType(value.type)\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBA,MAAM,wCAAwC;;;;;AAU9C,SAAgB,iCACd,UACA,cAA6C,EAAE,EAC7B;CAClB,MAAM,EAAE,aAAa,GAAG,oBAAoB;AAO5C,QANmB,4BACjB,EAAE,EACF,UACA,iBACA,eAAe,QAAQ,KACxB,CACiB,gBAAgB,KAC/B,EAAE,eAAe,QAAQ,gBACxB,iBAAiB,eAAe,QAAQ,UAAU,CACrD;;AAGH,SAAgB,iCACd,eACQ;AACR,QAAO;EACL;EACA,cAAc;EACd,mBAAmB,cAAc,UAAU;EAC5C,CAAC,KAAK,IAAI;;AAGb,SAAS,iBACP,eACA,QACA,WACgB;CAChB,MAAM,YAAY,YAAY,OAAO,UAAU;CAC/C,MAAM,mBAAmB,mCACvB,eACA,OACD;AACD,QAAO;EACL,iBAAiB;EACjB,MAAM,OAAO;EACb;EACA,aAAa,OAAO;EACpB,aAAa,OAAO;EACpB,MAAM,OAAO;EACb,UAAU,iCAAiC,cAAc;EACzD,gBAAgB,wBAAwB,OAAO;EAC/C,cAAc,EAAE,GAAG,OAAO,cAAc;EACxC,eAAe,OAAO;EACtB,GAAI,cAAc,KAAA,IAAY,EAAE,GAAG,EAAE,WAAW;EAChD,GAAI,qBAAqB,KAAA,IAAY,EAAE,GAAG,EAAE,kBAAkB;EAC/D;;AAGH,SAAS,wBACP,QACkC;CAClC,MAAM,SAAS,MAAM,QAAQ,OAAO,eAAe,OAAO,GACtD,OAAO,eAAe,OAAO,OAAO,gBAAgB,GACpD,EAAE;AACN,QAAO;EACL,GAAG,OAAO;EACV,YAAY,OAAO;EACnB,aACE,OAAO,OAAO,eAAe,gBAAgB,WACzC,OAAO,eAAe,cACtB,OAAO;EACb;EACD;;AAGH,SAAS,YACP,WAC6B;AAC7B,KAAI,cAAc,MAAO,QAAO,KAAA;AAChC,KAAI,cAAc,QAAQ,cAAc,OACtC,QAAO;EAAE,YAAY;EAAM,UAAU;EAAM;AAE7C,QAAO,cAAc,eAAe,EAAE,YAAY,MAAM,GAAG,EAAE,UAAU,MAAM;;AAG/E,SAAS,gBAAgB,OAAwC;AAC/D,QACE,OAAO,UAAU,YACjB,UAAU,QACV,SAAS,SACT,OAAO,MAAM,QAAQ,YACrB,WAAW,SACX,OAAO,MAAM,UAAU,YACvB,UAAU,SACV,OAAO,MAAM,SAAS,YACtB,oBAAoB,MAAM,KAAK"}
|
|
@@ -2,6 +2,7 @@ import "../src-CnIm-Mtj.mjs";
|
|
|
2
2
|
import { i as projectRemoteWidgetPackages, n as buildRemoteWidgetRegistry, r as isBuiltInWidgetType, t as buildNavigateHandler } from "../build-widget-registry-BiWa_rUL.mjs";
|
|
3
3
|
import "../ScreenRenderer-Cvg0dAKx.mjs";
|
|
4
4
|
import "../account-api-context-DCEDXtbM.mjs";
|
|
5
|
+
import "../use-account-DGLFNV-5.mjs";
|
|
5
6
|
import "../use-optional-store-BtV6d6ON.mjs";
|
|
6
7
|
import "../use-mysite-portal-CzJ-PGXG.mjs";
|
|
7
8
|
import "../Combobox-DB0JYBY9.mjs";
|
|
@@ -59,4 +60,6 @@ import "../ToDoWidget-B7TpUvT6.mjs";
|
|
|
59
60
|
import "../ResponsiveDialog-CsCcPmhl.mjs";
|
|
60
61
|
import "../VideoWidget-Byrdtjfa.mjs";
|
|
61
62
|
import "../ShopWidget-PB5xCnVX.mjs";
|
|
63
|
+
import "../AppNavigationContext-DqicaN-h.mjs";
|
|
64
|
+
import "../use-store-CHtT1S6R.mjs";
|
|
62
65
|
export { buildNavigateHandler, buildRemoteWidgetRegistry, isBuiltInWidgetType, projectRemoteWidgetPackages };
|