@fluid-app/portal-sdk 0.1.197 → 0.1.199

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.
Files changed (85) hide show
  1. package/dist/{CardWidget-HgYL7cEj.cjs → CardWidget-BVYjwdua.cjs} +2 -2
  2. package/dist/{CardWidget-BDIscQev.mjs → CardWidget-BjvrudYQ.mjs} +2 -2
  3. package/dist/{CardWidget-BDIscQev.mjs.map → CardWidget-BjvrudYQ.mjs.map} +1 -1
  4. package/dist/{CardWidget-DSq_Q8kv.cjs → CardWidget-DVi0NVhb.cjs} +2 -2
  5. package/dist/{CardWidget-DSq_Q8kv.cjs.map → CardWidget-DVi0NVhb.cjs.map} +1 -1
  6. package/dist/{ContainerWidget-PjWuvAlm.mjs → ContainerWidget-B51UF7DK.mjs} +2 -2
  7. package/dist/{ContainerWidget-PjWuvAlm.mjs.map → ContainerWidget-B51UF7DK.mjs.map} +1 -1
  8. package/dist/{ContainerWidget-Blb9A9i6.cjs → ContainerWidget-DNo8CkQ7.cjs} +2 -2
  9. package/dist/{ContainerWidget-Blb9A9i6.cjs.map → ContainerWidget-DNo8CkQ7.cjs.map} +1 -1
  10. package/dist/{ContainerWidget-CTP4UZXI.cjs → ContainerWidget-gtjlMITv.cjs} +3 -3
  11. package/dist/{FluidProvider-j5QX1XRm.cjs → FluidProvider-D177ez3m.cjs} +56 -14
  12. package/dist/FluidProvider-D177ez3m.cjs.map +1 -0
  13. package/dist/{FluidProvider-CGqVqcHP.mjs → FluidProvider-DiJy4Zve.mjs} +56 -14
  14. package/dist/FluidProvider-DiJy4Zve.mjs.map +1 -0
  15. package/dist/{LayoutWidget-oVmk8nm9.mjs → LayoutWidget-CtqIb8_Z.mjs} +2 -2
  16. package/dist/{LayoutWidget-oVmk8nm9.mjs.map → LayoutWidget-CtqIb8_Z.mjs.map} +1 -1
  17. package/dist/{LayoutWidget-D05U-Fai.cjs → LayoutWidget-D5gh0ejr.cjs} +2 -2
  18. package/dist/{LayoutWidget-BUxgiC_H.cjs → LayoutWidget-DHlXzqUk.cjs} +2 -2
  19. package/dist/{LayoutWidget-BUxgiC_H.cjs.map → LayoutWidget-DHlXzqUk.cjs.map} +1 -1
  20. package/dist/{MessagingScreen-CpUfQIFf.mjs → MessagingScreen-Cu3tcpPs.mjs} +2 -2
  21. package/dist/{MessagingScreen-CpUfQIFf.mjs.map → MessagingScreen-Cu3tcpPs.mjs.map} +1 -1
  22. package/dist/{MessagingScreen-Beyb0TUm.cjs → MessagingScreen-Ysi48svi.cjs} +6 -6
  23. package/dist/{MessagingScreen-BaGLql5n.cjs → MessagingScreen-gKidMcrr.cjs} +2 -2
  24. package/dist/{MessagingScreen-BaGLql5n.cjs.map → MessagingScreen-gKidMcrr.cjs.map} +1 -1
  25. package/dist/{OrdersScreen-BgyMsZpn.mjs → OrdersScreen-BioiulGx.mjs} +2 -2
  26. package/dist/{OrdersScreen-BgyMsZpn.mjs.map → OrdersScreen-BioiulGx.mjs.map} +1 -1
  27. package/dist/{OrdersScreen-CCVPgVWa.cjs → OrdersScreen-DzCvZ6AW.cjs} +2 -2
  28. package/dist/{OrdersScreen-CCVPgVWa.cjs.map → OrdersScreen-DzCvZ6AW.cjs.map} +1 -1
  29. package/dist/{OrdersScreen-DWNylH_i.cjs → OrdersScreen-NIJGMwfQ.cjs} +1 -1
  30. package/dist/{PortalContentApiProvider-CmDBRz5Y.cjs → PortalContentApiProvider-CPnqELEX.cjs} +110 -8
  31. package/dist/{PortalContentApiProvider-CmDBRz5Y.cjs.map → PortalContentApiProvider-CPnqELEX.cjs.map} +1 -1
  32. package/dist/{PortalContentApiProvider-C2cVPFwK.mjs → PortalContentApiProvider-CWRAw9kL.mjs} +110 -8
  33. package/dist/PortalContentApiProvider-CWRAw9kL.mjs.map +1 -0
  34. package/dist/{PortalProductsApiProvider-D0jul2Fh.mjs → PortalProductsApiProvider-B1IjNhl8.mjs} +22 -2
  35. package/dist/PortalProductsApiProvider-B1IjNhl8.mjs.map +1 -0
  36. package/dist/{PortalProductsApiProvider-CRN-i8Rh.cjs → PortalProductsApiProvider-o1axGadc.cjs} +22 -2
  37. package/dist/{PortalProductsApiProvider-CRN-i8Rh.cjs.map → PortalProductsApiProvider-o1axGadc.cjs.map} +1 -1
  38. package/dist/{ProductsScreen-CgoKo7Zn.mjs → ProductsScreen-Al6H4ujs.mjs} +3 -3
  39. package/dist/{ProductsScreen-CgoKo7Zn.mjs.map → ProductsScreen-Al6H4ujs.mjs.map} +1 -1
  40. package/dist/{ProductsScreen-A6AmNu6A.cjs → ProductsScreen-BnwMOZ4-.cjs} +3 -3
  41. package/dist/{ProductsScreen-Dmu_hEzn.cjs → ProductsScreen-CQ5-A8AL.cjs} +3 -3
  42. package/dist/{ProductsScreen-Dmu_hEzn.cjs.map → ProductsScreen-CQ5-A8AL.cjs.map} +1 -1
  43. package/dist/{ProductsScreen-Bmvtrqwz.mjs → ProductsScreen-CexZ0gx9.mjs} +3 -5
  44. package/dist/{ProfileScreen-BoFYel4G.cjs → ProfileScreen-CGS7YkcT.cjs} +6 -6
  45. package/dist/{ProfileScreen-CtMB7I96.cjs → ProfileScreen-DJZoMzE6.cjs} +2 -2
  46. package/dist/{ProfileScreen-CtMB7I96.cjs.map → ProfileScreen-DJZoMzE6.cjs.map} +1 -1
  47. package/dist/{ProfileScreen-th1mmEn0.mjs → ProfileScreen-hE1S_99P.mjs} +2 -2
  48. package/dist/{ProfileScreen-th1mmEn0.mjs.map → ProfileScreen-hE1S_99P.mjs.map} +1 -1
  49. package/dist/{ScreenRenderer-CgSF9HEd.mjs → ScreenRenderer-Cv2rxvtF.mjs} +1 -9
  50. package/dist/ScreenRenderer-Cv2rxvtF.mjs.map +1 -0
  51. package/dist/{ScreenRenderer-Cx2KWPVu.cjs → ScreenRenderer-DfeRRgBO.cjs} +1 -9
  52. package/dist/ScreenRenderer-DfeRRgBO.cjs.map +1 -0
  53. package/dist/{ShareablesScreen-Dead0Hax.cjs → ShareablesScreen-CmZ5CX99.cjs} +3 -3
  54. package/dist/{ShareablesScreen-Dead0Hax.cjs.map → ShareablesScreen-CmZ5CX99.cjs.map} +1 -1
  55. package/dist/{ShareablesScreen-eZgLDxLb.mjs → ShareablesScreen-CzTU7e0l.mjs} +3 -3
  56. package/dist/{ShareablesScreen-eZgLDxLb.mjs.map → ShareablesScreen-CzTU7e0l.mjs.map} +1 -1
  57. package/dist/{ShareablesScreen-3G_tIwAB.cjs → ShareablesScreen-DujtMoAi.cjs} +3 -3
  58. package/dist/{ShareablesScreen-gaClu1n7.mjs → ShareablesScreen-yscAsNpq.mjs} +3 -5
  59. package/dist/{ShopScreen-BBFsy04y.mjs → ShopScreen-Bdo59te-.mjs} +3 -3
  60. package/dist/{ShopScreen-BBFsy04y.mjs.map → ShopScreen-Bdo59te-.mjs.map} +1 -1
  61. package/dist/{ShopScreen-BCZ_tsd3.cjs → ShopScreen-DKlDKNom.cjs} +3 -3
  62. package/dist/{ShopScreen-BCZ_tsd3.cjs.map → ShopScreen-DKlDKNom.cjs.map} +1 -1
  63. package/dist/{ShopScreen-tjFoj6_r.cjs → ShopScreen-R9zk7d5d.cjs} +7 -7
  64. package/dist/{SubscriptionsScreen-BwRoXYF8.mjs → SubscriptionsScreen-1G9oa46y.mjs} +2 -2
  65. package/dist/{SubscriptionsScreen-BwRoXYF8.mjs.map → SubscriptionsScreen-1G9oa46y.mjs.map} +1 -1
  66. package/dist/{SubscriptionsScreen-mhTl7OIp.cjs → SubscriptionsScreen-Bt_YtoA3.cjs} +1 -1
  67. package/dist/{SubscriptionsScreen-DbcnEDD0.cjs → SubscriptionsScreen-Dn6LldL3.cjs} +2 -2
  68. package/dist/{SubscriptionsScreen-DbcnEDD0.cjs.map → SubscriptionsScreen-Dn6LldL3.cjs.map} +1 -1
  69. package/dist/index.cjs +28 -28
  70. package/dist/index.mjs +28 -28
  71. package/dist/{portal_tenant-CWKHVgID.mjs → portal_tenant-8RPVJCll.mjs} +42 -2
  72. package/dist/{portal_tenant-CWKHVgID.mjs.map → portal_tenant-8RPVJCll.mjs.map} +1 -1
  73. package/dist/{portal_tenant-pozf8Ht6.cjs → portal_tenant-BdKp073-.cjs} +65 -1
  74. package/dist/{portal_tenant-pozf8Ht6.cjs.map → portal_tenant-BdKp073-.cjs.map} +1 -1
  75. package/dist/{portal_tenant_content-Dwmo8XZ-.cjs → portal_tenant_content-0zpnjBot.cjs} +97 -1
  76. package/dist/{portal_tenant_content-Dwmo8XZ-.cjs.map → portal_tenant_content-0zpnjBot.cjs.map} +1 -1
  77. package/dist/{portal_tenant_content-DgM42X08.mjs → portal_tenant_content-DzIQtSLE.mjs} +62 -2
  78. package/dist/{portal_tenant_content-DgM42X08.mjs.map → portal_tenant_content-DzIQtSLE.mjs.map} +1 -1
  79. package/package.json +15 -15
  80. package/dist/FluidProvider-CGqVqcHP.mjs.map +0 -1
  81. package/dist/FluidProvider-j5QX1XRm.cjs.map +0 -1
  82. package/dist/PortalContentApiProvider-C2cVPFwK.mjs.map +0 -1
  83. package/dist/PortalProductsApiProvider-D0jul2Fh.mjs.map +0 -1
  84. package/dist/ScreenRenderer-CgSF9HEd.mjs.map +0 -1
  85. package/dist/ScreenRenderer-Cx2KWPVu.cjs.map +0 -1
@@ -1,24 +1,24 @@
1
- import { d as DataSourceApiProvider, l as RegistryProvider } from "./ScreenRenderer-CgSF9HEd.mjs";
1
+ import { d as DataSourceApiProvider, l as RegistryProvider } from "./ScreenRenderer-Cv2rxvtF.mjs";
2
2
  import { t as AccountApiProvider } from "./account-api-context-BIZ_aibJ.mjs";
3
3
  import { t as StoreApiProvider } from "./store-api-context-C1lXT_3d.mjs";
4
4
  import { t as MySiteApiProvider } from "./mysite-api-context-bXtZ8Gbm.mjs";
5
5
  import { t as CountriesApiProvider } from "./countries-api-context-Dob_AzPO.mjs";
6
- import { a as enrollment_packs_show, c as products_list, d as products_show, f as store_show, i as calendar_events_list, m as subscriptions_list, n as account_update, o as orders_list, r as app_manifest_show, t as account_show, x as todos_list } from "./portal_tenant-CWKHVgID.mjs";
7
- import { C as playlists_show, g as pages_show, m as media_show } from "./portal_tenant_content-DgM42X08.mjs";
6
+ import { T as todos_list, a as enrollment_pack_metrics_share_visits, c as orders_list, d as product_metrics_visits, f as products_list, g as store_show, h as products_show, i as calendar_events_list, n as account_update, o as enrollment_pack_metrics_visits, r as app_manifest_show, s as enrollment_packs_show, t as account_show, u as product_metrics_share_visits, v as subscriptions_list } from "./portal_tenant-8RPVJCll.mjs";
7
+ import { S as pages_show, a as content_playlists_metrics_share_visits, b as media_show, i as content_pages_metrics_visits, k as playlists_show, n as content_media_metrics_visits, o as content_playlists_metrics_visits, r as content_pages_metrics_share_visits, t as content_media_metrics_share_visits } from "./portal_tenant_content-DzIQtSLE.mjs";
8
8
  import { n as usePortalTenantClient, t as PortalTenantClientProvider } from "./PortalTenantClientProvider-4ZmY6hac.mjs";
9
9
  import { t as DataSourceRegistryProvider } from "./registry-context-CrKm3pxA.mjs";
10
10
  import { t as EmbedWidget } from "./EmbedWidget-DmgayrKN.mjs";
11
11
  import { r as WidgetsApiProvider } from "./error-state-DSJb-3r5.mjs";
12
- import { t as LayoutWidget } from "./LayoutWidget-oVmk8nm9.mjs";
12
+ import { t as LayoutWidget } from "./LayoutWidget-CtqIb8_Z.mjs";
13
13
  import { t as TextWidget } from "./TextWidget-O550ivSg.mjs";
14
14
  import { t as AlertWidget } from "./AlertWidget-DRX_3F4c.mjs";
15
15
  import { t as BulletListWidget } from "./BulletListWidget-D0ivXcaY.mjs";
16
16
  import { t as CalendarWidget } from "./CalendarWidget-CoicJaJV.mjs";
17
- import { t as CardWidget } from "./CardWidget-BDIscQev.mjs";
17
+ import { t as CardWidget } from "./CardWidget-BjvrudYQ.mjs";
18
18
  import { t as CarouselWidget } from "./CarouselWidget-CCmfNNEU.mjs";
19
19
  import { t as CatchUpWidget } from "./CatchUpWidget-BU3Z0m-4.mjs";
20
20
  import { t as ChartWidget } from "./ChartWidget-BZDwNO8g.mjs";
21
- import { t as ContainerWidget } from "./ContainerWidget-PjWuvAlm.mjs";
21
+ import { t as ContainerWidget } from "./ContainerWidget-B51UF7DK.mjs";
22
22
  import { t as ImageWidget } from "./ImageWidget-C_pLQwbi.mjs";
23
23
  import { t as LinkWidget } from "./LinkWidget-DSOKZ1zC.mjs";
24
24
  import { t as ListWidget } from "./ListWidget-D6ASLbnl.mjs";
@@ -696,6 +696,40 @@ function throwIfAborted(signal) {
696
696
  function bffNotSupported(op) {
697
697
  throw new Error(`[portal-tenant-adapter] "${op}" is not available on the portal-tenant BFF. Wire the legacy adapter for this feature, or re-add the endpoint to the BFF spec.`);
698
698
  }
699
+ function isProduction() {
700
+ return globalThis.process?.env?.NODE_ENV === "production";
701
+ }
702
+ function narrowPeriod(value) {
703
+ if (value === "7d" || value === "30d" || value === "90d" || value === "1y" || value === "all") return value;
704
+ if (value !== void 0 && !isProduction()) console.warn(`[portal-sdk] narrowPeriod: unknown value "${value}" dropped`);
705
+ }
706
+ async function fetchShareVisited(shareableType, client, contentClient, query) {
707
+ switch (shareableType) {
708
+ case "products": return (await product_metrics_share_visits(client, query)).resources ?? [];
709
+ case "media": return (await content_media_metrics_share_visits(contentClient, query)).resources ?? [];
710
+ case "libraries": return (await content_playlists_metrics_share_visits(contentClient, query)).resources ?? [];
711
+ case "pages": return (await content_pages_metrics_share_visits(contentClient, query)).resources ?? [];
712
+ case "enrollment_packs": return (await enrollment_pack_metrics_share_visits(client, query)).resources ?? [];
713
+ case "promotions": bffNotSupported(`fetchMostShared(${shareableType})`);
714
+ }
715
+ }
716
+ async function fetchVisited(shareableType, client, contentClient, query) {
717
+ switch (shareableType) {
718
+ case "products": return (await product_metrics_visits(client, query)).resources ?? [];
719
+ case "media": return (await content_media_metrics_visits(contentClient, query)).resources ?? [];
720
+ case "libraries": return (await content_playlists_metrics_visits(contentClient, query)).resources ?? [];
721
+ case "pages": return (await content_pages_metrics_visits(contentClient, query)).resources ?? [];
722
+ case "enrollment_packs": return (await enrollment_pack_metrics_visits(client, query)).resources ?? [];
723
+ case "promotions": bffNotSupported(`fetchMostViewed(${shareableType})`);
724
+ }
725
+ }
726
+ function toMetricsQuery(options) {
727
+ const query = {};
728
+ const period = narrowPeriod(options.period);
729
+ if (period) query.period = period;
730
+ if (options.limit != null) query.limit = options.limit;
731
+ return query;
732
+ }
699
733
  /**
700
734
  * Map a BFF order response to the port's NormalizedOrder shape.
701
735
  * Centralizes the boundary between BFF wire format and our canonical type
@@ -748,11 +782,19 @@ function toNormalizedSubscription(raw) {
748
782
  */
749
783
  function createDataSourceApiAdapter(client, contentClient) {
750
784
  return {
751
- async fetchMostShared(_repId, _options) {
752
- bffNotSupported("fetchMostShared");
785
+ async fetchMostShared(_repId, options) {
786
+ throwIfAborted(options.signal);
787
+ const query = toMetricsQuery(options);
788
+ const result = await fetchShareVisited(options.shareableType, client, contentClient, query);
789
+ throwIfAborted(options.signal);
790
+ return result;
753
791
  },
754
- async fetchMostViewed(_repId, _options) {
755
- bffNotSupported("fetchMostViewed");
792
+ async fetchMostViewed(_repId, options) {
793
+ throwIfAborted(options.signal);
794
+ const query = toMetricsQuery(options);
795
+ const result = await fetchVisited(options.shareableType, client, contentClient, query);
796
+ throwIfAborted(options.signal);
797
+ return result;
756
798
  },
757
799
  async fetchOrders(_customerId, options) {
758
800
  throwIfAborted(options?.signal);
@@ -2714,14 +2756,14 @@ const widgetPropertySchemas = {
2714
2756
  AlertWidget: () => import("./AlertWidget-DRX_3F4c.mjs").then((n) => n.n).then((m) => m.alertWidgetPropertySchema),
2715
2757
  BulletListWidget: () => import("./BulletListWidget-D0ivXcaY.mjs").then((n) => n.n).then((m) => m.bulletListWidgetPropertySchema),
2716
2758
  CalendarWidget: () => import("./CalendarWidget-CoicJaJV.mjs").then((n) => n.n).then((m) => m.calendarWidgetPropertySchema),
2717
- CardWidget: () => import("./CardWidget-BDIscQev.mjs").then((n) => n.n).then((m) => m.cardWidgetPropertySchema),
2759
+ CardWidget: () => import("./CardWidget-BjvrudYQ.mjs").then((n) => n.n).then((m) => m.cardWidgetPropertySchema),
2718
2760
  CarouselWidget: () => import("./CarouselWidget-CCmfNNEU.mjs").then((n) => n.n).then((m) => m.carouselWidgetPropertySchema),
2719
2761
  CatchUpWidget: () => import("./CatchUpWidget-BU3Z0m-4.mjs").then((n) => n.n).then((m) => m.catchUpWidgetPropertySchema),
2720
2762
  ChartWidget: () => import("./ChartWidget-BZDwNO8g.mjs").then((n) => n.n).then((m) => m.chartWidgetPropertySchema),
2721
- ContainerWidget: () => import("./ContainerWidget-PjWuvAlm.mjs").then((n) => n.n).then((m) => m.containerWidgetPropertySchema),
2763
+ ContainerWidget: () => import("./ContainerWidget-B51UF7DK.mjs").then((n) => n.n).then((m) => m.containerWidgetPropertySchema),
2722
2764
  EmbedWidget: () => import("./EmbedWidget-DmgayrKN.mjs").then((n) => n.n).then((m) => m.embedWidgetPropertySchema),
2723
2765
  ImageWidget: () => import("./ImageWidget-C_pLQwbi.mjs").then((n) => n.n).then((m) => m.imageWidgetPropertySchema),
2724
- LayoutWidget: () => import("./LayoutWidget-oVmk8nm9.mjs").then((n) => n.n).then((m) => m.layoutWidgetPropertySchema),
2766
+ LayoutWidget: () => import("./LayoutWidget-CtqIb8_Z.mjs").then((n) => n.n).then((m) => m.layoutWidgetPropertySchema),
2725
2767
  LinkWidget: () => import("./LinkWidget-DSOKZ1zC.mjs").then((n) => n.n).then((m) => m.linkWidgetPropertySchema),
2726
2768
  ListWidget: () => import("./ListWidget-D6ASLbnl.mjs").then((n) => n.n).then((m) => m.listWidgetPropertySchema),
2727
2769
  MySiteWidget: () => import("./MySiteWidget-Q3Zduh9j.mjs").then((n) => n.n).then((m) => m.mySiteWidgetPropertySchema),
@@ -2910,4 +2952,4 @@ function useFluidContext() {
2910
2952
  //#endregion
2911
2953
  export { mergeDarkOverrides as A, usePayApi as B, DEFAULT_THEME_ID as C, deriveDarkVariant as D, generateThemeCSS as E, RADIUS_KEYS as F, createPersister as H, SEMANTIC_COLOR_NAMES as I, SHADE_STEPS as L, resolveTheme as M, FONT_FAMILY_KEYS as N, generateShades as O, FONT_SIZE_KEYS as P, ApiError as R, DEFAULT_SPACING as S, getDefaultThemeDefinition as T, deleteDatabase as U, useAppDefinitionApi as V, serialiseTheme as _, createScreen as a, DEFAULT_FONT_SIZES as b, FluidThemeProvider as c, removeAllThemes as d, removeTheme as f, deserialiseTheme as g, transformThemes as h, widgetPropertySchemas as i, parseColor as j, getForegroundColor as k, useThemeContext as l, getActiveThemeId as m, useFluidContext as n, createWidgetFromShareable as o, buildThemeDefinition as p, DEFAULT_SDK_WIDGET_REGISTRY as r, createWidgetRegistry as s, FluidProvider as t, applyTheme as u, DEFAULT_COLORS as v, DEFAULT_THEME_NAME as w, DEFAULT_RADII as x, DEFAULT_FONT_FAMILIES as y, useLanguagesApi as z };
2912
2954
 
2913
- //# sourceMappingURL=FluidProvider-CGqVqcHP.mjs.map
2955
+ //# sourceMappingURL=FluidProvider-DiJy4Zve.mjs.map