@fluid-app/portal-sdk 0.1.248 → 0.1.249
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/{fluid-pay-api-adapter-CJ7-I8k-.mjs → AddressAutocompleteInput-B0qLrCHN.mjs} +153 -3
- package/dist/AddressAutocompleteInput-B0qLrCHN.mjs.map +1 -0
- package/dist/{fluid-pay-api-adapter-D63KLi5c.cjs → AddressAutocompleteInput-CbpNjpwB.cjs} +157 -1
- package/dist/AddressAutocompleteInput-CbpNjpwB.cjs.map +1 -0
- package/dist/{AlertWidget-CbhrQa9Z.mjs → AlertWidget-CcIBGBik.mjs} +3 -3
- package/dist/{AlertWidget-CbhrQa9Z.mjs.map → AlertWidget-CcIBGBik.mjs.map} +1 -1
- package/dist/{AppDownloadScreen-DPnbWP5G.mjs → AppDownloadScreen-ZxlnSAZ6.mjs} +3 -3
- package/dist/{AppDownloadScreen-DPnbWP5G.mjs.map → AppDownloadScreen-ZxlnSAZ6.mjs.map} +1 -1
- package/dist/{AppNavigationContext-DNod9mf6.mjs → AppNavigationContext-BcZZMtV6.mjs} +1 -1
- package/dist/{AppNavigationContext-DNod9mf6.mjs.map → AppNavigationContext-BcZZMtV6.mjs.map} +1 -1
- package/dist/{BulletListWidget-qvZIZ_B-.mjs → BulletListWidget-mRwUgtzN.mjs} +3 -3
- package/dist/{BulletListWidget-qvZIZ_B-.mjs.map → BulletListWidget-mRwUgtzN.mjs.map} +1 -1
- package/dist/{CalendarWidget-C03VcDLQ.mjs → CalendarWidget-Cn3Ngl8_.mjs} +5 -5
- package/dist/{CalendarWidget-C03VcDLQ.mjs.map → CalendarWidget-Cn3Ngl8_.mjs.map} +1 -1
- package/dist/{CardWidget-2wcjCf2M.mjs → CardWidget-DHTqvQPa.mjs} +4 -4
- package/dist/{CardWidget-2wcjCf2M.mjs.map → CardWidget-DHTqvQPa.mjs.map} +1 -1
- package/dist/{CarouselWidget-Cn5P4FVN.mjs → CarouselWidget-C0X-nFyW.mjs} +5 -5
- package/dist/{CarouselWidget-Cn5P4FVN.mjs.map → CarouselWidget-C0X-nFyW.mjs.map} +1 -1
- package/dist/{CatchUpWidget-B9CI7lq0.mjs → CatchUpWidget-BkeZR91e.mjs} +5 -5
- package/dist/{CatchUpWidget-B9CI7lq0.mjs.map → CatchUpWidget-BkeZR91e.mjs.map} +1 -1
- package/dist/{ChartWidget-obje-Xj9.mjs → ChartWidget-Ci4Q0Ig-.mjs} +4 -4
- package/dist/{ChartWidget-obje-Xj9.mjs.map → ChartWidget-Ci4Q0Ig-.mjs.map} +1 -1
- package/dist/{ContactsScreen-DuhDzRtI.mjs → ContactsScreen-Bq8zrA8k.mjs} +11 -11
- package/dist/{ContactsScreen-DuhDzRtI.mjs.map → ContactsScreen-Bq8zrA8k.mjs.map} +1 -1
- package/dist/{ContainerWidget-DNenbORS.mjs → ContainerWidget-cbX_KEOQ.mjs} +4 -4
- package/dist/{ContainerWidget-DNenbORS.mjs.map → ContainerWidget-cbX_KEOQ.mjs.map} +1 -1
- package/dist/{CustomersScreen-BJOBG5f5.mjs → CustomersScreen-0uI1R9lm.mjs} +2 -2
- package/dist/{CustomersScreen-BJOBG5f5.mjs.map → CustomersScreen-0uI1R9lm.mjs.map} +1 -1
- package/dist/{EmbedWidget-LYnd3TZD.mjs → EmbedWidget-BwR9mICd.mjs} +3 -3
- package/dist/{EmbedWidget-LYnd3TZD.mjs.map → EmbedWidget-BwR9mICd.mjs.map} +1 -1
- package/dist/FluidProvider-DGxCCmVB.cjs +17240 -0
- package/dist/FluidProvider-DGxCCmVB.cjs.map +1 -0
- package/dist/FluidProvider-DS1QKy5j.mjs +6371 -0
- package/dist/FluidProvider-DS1QKy5j.mjs.map +1 -0
- package/dist/{ImageWidget-vNWT_O1E.mjs → ImageWidget-DmaAQZBK.mjs} +4 -4
- package/dist/{ImageWidget-vNWT_O1E.mjs.map → ImageWidget-DmaAQZBK.mjs.map} +1 -1
- package/dist/{InfiniteScrollSentinel-D0XRJi51.mjs → InfiniteScrollSentinel-BHIgNtHI.mjs} +2 -2
- package/dist/{InfiniteScrollSentinel-D0XRJi51.mjs.map → InfiniteScrollSentinel-BHIgNtHI.mjs.map} +1 -1
- package/dist/{LayoutWidget-UI5fbsx4.mjs → LayoutWidget-CxaMx1nd.mjs} +4 -4
- package/dist/{LayoutWidget-UI5fbsx4.mjs.map → LayoutWidget-CxaMx1nd.mjs.map} +1 -1
- package/dist/{LinkWidget-CO-Cxf7Z.mjs → LinkWidget-utkZrvAV.mjs} +5 -5
- package/dist/{LinkWidget-CO-Cxf7Z.mjs.map → LinkWidget-utkZrvAV.mjs.map} +1 -1
- package/dist/{ListWidget-f88QhcGI.mjs → ListWidget-CNAxW_3c.mjs} +6 -6
- package/dist/{ListWidget-f88QhcGI.mjs.map → ListWidget-CNAxW_3c.mjs.map} +1 -1
- package/dist/{MediaRenderer-DMdb_5xw.mjs → MediaRenderer-13Jlf38P.mjs} +1 -1
- package/dist/{MediaRenderer-DMdb_5xw.mjs.map → MediaRenderer-13Jlf38P.mjs.map} +1 -1
- package/dist/{MessagingScreen-DGhqsVXi.mjs → MessagingScreen-CJ_9yIHK.mjs} +9 -12
- package/dist/{MessagingScreen-DGhqsVXi.mjs.map → MessagingScreen-CJ_9yIHK.mjs.map} +1 -1
- package/dist/{MessagingScreen-CDiLGmMi.cjs → MessagingScreen-DeYSVcMd.cjs} +2 -2
- package/dist/{MessagingScreen-CDiLGmMi.cjs.map → MessagingScreen-DeYSVcMd.cjs.map} +1 -1
- package/dist/{MessagingScreen-BKb4mWGa.cjs → MessagingScreen-FHwytr8B.cjs} +3 -3
- package/dist/MessagingScreen-s7CL9vPN.mjs +47 -0
- package/dist/{MySiteScreen-CK84vXa9.mjs → MySiteScreen-DX8tBz8Z.mjs} +7 -7
- package/dist/{MySiteScreen-CK84vXa9.mjs.map → MySiteScreen-DX8tBz8Z.mjs.map} +1 -1
- package/dist/{MySiteWidget-CQNASVaF.mjs → MySiteWidget-C0n9cSw7.mjs} +5 -5
- package/dist/{MySiteWidget-CQNASVaF.mjs.map → MySiteWidget-C0n9cSw7.mjs.map} +1 -1
- package/dist/{NestedWidget-RuyrOrFn.mjs → NestedWidget-BMKtDP_4.mjs} +6 -6
- package/dist/{NestedWidget-RuyrOrFn.mjs.map → NestedWidget-BMKtDP_4.mjs.map} +1 -1
- package/dist/{OrdersScreen-b-ZC4_NI.mjs → OrdersScreen-B3vtWt8_.mjs} +7 -7
- package/dist/{OrdersScreen-b-ZC4_NI.mjs.map → OrdersScreen-B3vtWt8_.mjs.map} +1 -1
- package/dist/{PointsWidget-BwA6aGVZ.mjs → PointsWidget-CaWklfIH.mjs} +5 -5
- package/dist/{PointsWidget-BwA6aGVZ.mjs.map → PointsWidget-CaWklfIH.mjs.map} +1 -1
- package/dist/{PortalProductsApiProvider-BFdHFvog.mjs → PortalProductsApiProvider-CNAu2pAb.mjs} +2 -2
- package/dist/{PortalProductsApiProvider-BFdHFvog.mjs.map → PortalProductsApiProvider-CNAu2pAb.mjs.map} +1 -1
- package/dist/{PortalTenantClientProvider-CjJzBCTL.mjs → PortalTenantClientProvider-Bni6J3KS.mjs} +1 -1
- package/dist/{PortalTenantClientProvider-CjJzBCTL.mjs.map → PortalTenantClientProvider-Bni6J3KS.mjs.map} +1 -1
- package/dist/{ProfileScreen-DHv2Cjpz.cjs → ProfileScreen-BJzW-gC_.cjs} +4 -4
- package/dist/{ProfileScreen-BDLJgcXg.cjs → ProfileScreen-DucZeLWI.cjs} +40 -20
- package/dist/ProfileScreen-DucZeLWI.cjs.map +1 -0
- package/dist/{ProfileScreen-CmQDKNaP.mjs → ProfileScreen-IPuXlf9V.mjs} +33 -18
- package/dist/ProfileScreen-IPuXlf9V.mjs.map +1 -0
- package/dist/ProfileScreen-m3fTsHyw.mjs +48 -0
- package/dist/{QuickLinksWidget-CJqwiBJ7.mjs → QuickLinksWidget-D0b33oyn.mjs} +3 -3
- package/dist/{QuickLinksWidget-CJqwiBJ7.mjs.map → QuickLinksWidget-D0b33oyn.mjs.map} +1 -1
- package/dist/{QuickShareWidget-DKE7Tba2.mjs → QuickShareWidget-DJ0Y71om.mjs} +3 -3
- package/dist/{QuickShareWidget-DKE7Tba2.mjs.map → QuickShareWidget-DJ0Y71om.mjs.map} +1 -1
- package/dist/{RecentActivityWidget-D1AlZgfV.mjs → RecentActivityWidget-Rpj33TiN.mjs} +5 -5
- package/dist/{RecentActivityWidget-D1AlZgfV.mjs.map → RecentActivityWidget-Rpj33TiN.mjs.map} +1 -1
- package/dist/{ScreenHeaderContext-Cemdo7bM.mjs → ScreenHeaderContext-4WYXIqQ5.mjs} +1 -1
- package/dist/{ScreenHeaderContext-Cemdo7bM.mjs.map → ScreenHeaderContext-4WYXIqQ5.mjs.map} +1 -1
- package/dist/{ScreenRenderer-Cl2aAJ7D.mjs → ScreenRenderer-BQal-fnZ.mjs} +2 -2
- package/dist/{ScreenRenderer-Cl2aAJ7D.mjs.map → ScreenRenderer-BQal-fnZ.mjs.map} +1 -1
- package/dist/{SearchSort-CokMCrhy.mjs → SearchSort-B5Jrk5lW.mjs} +2 -2
- package/dist/{SearchSort-CokMCrhy.mjs.map → SearchSort-B5Jrk5lW.mjs.map} +1 -1
- package/dist/{SeparatorWidget-gVlyr1MV.mjs → SeparatorWidget-Bgzsloji.mjs} +3 -3
- package/dist/{SeparatorWidget-gVlyr1MV.mjs.map → SeparatorWidget-Bgzsloji.mjs.map} +1 -1
- package/dist/ShareablesScreen-Cd8chxk4.mjs +13 -0
- package/dist/{ShareablesScreen-BZZ-RT71.mjs → ShareablesScreen-NMoZH9ed.mjs} +14 -18
- package/dist/{ShareablesScreen-BZZ-RT71.mjs.map → ShareablesScreen-NMoZH9ed.mjs.map} +1 -1
- package/dist/ShopScreen-BvSiWgsJ.mjs +47 -0
- package/dist/{ShopScreen---dB03HI.cjs → ShopScreen-CM3DDvLt.cjs} +2 -2
- package/dist/{ShopScreen---dB03HI.cjs.map → ShopScreen-CM3DDvLt.cjs.map} +1 -1
- package/dist/{ShopScreen-B6ygTHDB.cjs → ShopScreen-Cz0dbkhp.cjs} +3 -3
- package/dist/{ShopScreen-kiVwC38W.mjs → ShopScreen-DJANOOka.mjs} +29 -34
- package/dist/{ShopScreen-kiVwC38W.mjs.map → ShopScreen-DJANOOka.mjs.map} +1 -1
- package/dist/{SpacerWidget-BY7ywGP4.mjs → SpacerWidget-C1byII28.mjs} +2 -2
- package/dist/{SpacerWidget-BY7ywGP4.mjs.map → SpacerWidget-C1byII28.mjs.map} +1 -1
- package/dist/{SubscriptionsScreen-dhnfYn4L.cjs → SubscriptionsScreen-BgKpfzi0.cjs} +3 -3
- package/dist/{SubscriptionsScreen-B88_dLfE.cjs → SubscriptionsScreen-DCUwHrdm.cjs} +22 -32
- package/dist/SubscriptionsScreen-DCUwHrdm.cjs.map +1 -0
- package/dist/{SubscriptionsScreen-DK9-h3Cz.mjs → SubscriptionsScreen-rZxqb0eR.mjs} +21 -31
- package/dist/{SubscriptionsScreen-DK9-h3Cz.mjs.map → SubscriptionsScreen-rZxqb0eR.mjs.map} +1 -1
- package/dist/{TableWidget-dfUvhH0S.mjs → TableWidget-CNCHDRrR.mjs} +6 -6
- package/dist/{TableWidget-dfUvhH0S.mjs.map → TableWidget-CNCHDRrR.mjs.map} +1 -1
- package/dist/{TextWidget-BteaMIsX.mjs → TextWidget-CfLUQr6V.mjs} +3 -3
- package/dist/{TextWidget-BteaMIsX.mjs.map → TextWidget-CfLUQr6V.mjs.map} +1 -1
- package/dist/{ToDoWidget-BciI_D70.mjs → ToDoWidget-C3lh-3SB.mjs} +7 -7
- package/dist/{ToDoWidget-BciI_D70.mjs.map → ToDoWidget-C3lh-3SB.mjs.map} +1 -1
- package/dist/{UpgradeScreen-X6j0_625.mjs → UpgradeScreen-D_CM1n1M.mjs} +3 -3
- package/dist/{UpgradeScreen-X6j0_625.mjs.map → UpgradeScreen-D_CM1n1M.mjs.map} +1 -1
- package/dist/{VideoWidget-Dj9wue7j.mjs → VideoWidget-DKhqN_Rx.mjs} +4 -4
- package/dist/{VideoWidget-Dj9wue7j.mjs.map → VideoWidget-DKhqN_Rx.mjs.map} +1 -1
- package/dist/{WidgetInteractionContext-B1mELhQ_.mjs → WidgetInteractionContext-pLGNr8_2.mjs} +1 -1
- package/dist/{WidgetInteractionContext-B1mELhQ_.mjs.map → WidgetInteractionContext-pLGNr8_2.mjs.map} +1 -1
- package/dist/api-context-3GmfqvIB.mjs +22 -0
- package/dist/api-context-3GmfqvIB.mjs.map +1 -0
- package/dist/api-context-BkBvyFVK.cjs +46 -0
- package/dist/api-context-BkBvyFVK.cjs.map +1 -0
- package/dist/{components-CjgEvBYG.mjs → components-D2h9u3tH.mjs} +3 -3
- package/dist/{components-CjgEvBYG.mjs.map → components-D2h9u3tH.mjs.map} +1 -1
- package/dist/{de-DWONEOZS.mjs → de-CH__cDep.mjs} +1 -1
- package/dist/de-CH__cDep.mjs.map +1 -0
- package/dist/{dist-CTLDCXCc.mjs → dist-Di1hciu4.mjs} +1 -1
- package/dist/{dist-CTLDCXCc.mjs.map → dist-Di1hciu4.mjs.map} +1 -1
- package/dist/{el-De7Ne7it.mjs → el-De9QZiqh.mjs} +1 -1
- package/dist/el-De9QZiqh.mjs.map +1 -0
- package/dist/{error-state-DYzHx8tt.mjs → error-state--Z2OlDFr.mjs} +1 -1
- package/dist/{error-state-DYzHx8tt.mjs.map → error-state--Z2OlDFr.mjs.map} +1 -1
- package/dist/{es-BXxGlAp6.mjs → es-C5dhBJ9E.mjs} +4 -39
- package/dist/{es-BXxGlAp6.mjs.map → es-C5dhBJ9E.mjs.map} +1 -1
- package/dist/{es-B5_ItPIn.mjs → es-CZLh7tET.mjs} +1 -1
- package/dist/es-CZLh7tET.mjs.map +1 -0
- package/dist/{fr-jgEDP2og.mjs → fr-CIfM_0kG.mjs} +1 -1
- package/dist/fr-CIfM_0kG.mjs.map +1 -0
- package/dist/{he-DLQdVr_g.mjs → he-BTK1iEJE.mjs} +1 -1
- package/dist/he-BTK1iEJE.mjs.map +1 -0
- package/dist/{hu-CC4QdkPb.mjs → hu-CrZGIbz9.mjs} +1 -1
- package/dist/hu-CrZGIbz9.mjs.map +1 -0
- package/dist/{id-CwGC2v1d.mjs → id-B-LeCfHj.mjs} +1 -1
- package/dist/id-B-LeCfHj.mjs.map +1 -0
- package/dist/index.cjs +16 -15
- 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 +86 -85
- package/dist/index.mjs.map +1 -1
- package/dist/{it-jUZZ5sjO.mjs → it-rIkFmAF3.mjs} +1 -1
- package/dist/it-rIkFmAF3.mjs.map +1 -0
- package/dist/{ja-QVQymwAE.mjs → ja--J_bhk3I.mjs} +1 -1
- package/dist/ja--J_bhk3I.mjs.map +1 -0
- package/dist/{ko-DfzzTwZI.mjs → ko-B2fghWQ9.mjs} +1 -1
- package/dist/ko-B2fghWQ9.mjs.map +1 -0
- package/dist/{nl-Dys3mUo2.mjs → nl-KgHmrRKy.mjs} +1 -1
- package/dist/nl-KgHmrRKy.mjs.map +1 -0
- package/dist/{order-status-badge-xuJ732eH.mjs → order-status-badge-CjX7Qxdk.mjs} +4 -4
- package/dist/{order-status-badge-xuJ732eH.mjs.map → order-status-badge-CjX7Qxdk.mjs.map} +1 -1
- package/dist/{parse-task-body-DEmYvdNM.mjs → parse-task-body-BK1v2806.mjs} +1 -1
- package/dist/{parse-task-body-DEmYvdNM.mjs.map → parse-task-body-BK1v2806.mjs.map} +1 -1
- package/dist/{pl-CBwEisEK.mjs → pl-BJvDPvs3.mjs} +1 -1
- package/dist/pl-BJvDPvs3.mjs.map +1 -0
- package/dist/{portal_tenant_content-CQQfNOTc.mjs → portal_tenant_content-DPLnrtOG.mjs} +38 -2
- package/dist/{portal_tenant_content-CQQfNOTc.mjs.map → portal_tenant_content-DPLnrtOG.mjs.map} +1 -1
- package/dist/{pt-D5al7xw3.mjs → pt-CmZpxftX.mjs} +1 -1
- package/dist/pt-CmZpxftX.mjs.map +1 -0
- package/dist/{purify.es-DzInNL5X.mjs → purify.es-Ba5Ug4-y.mjs} +1 -1
- package/dist/{purify.es-DzInNL5X.mjs.map → purify.es-Ba5Ug4-y.mjs.map} +1 -1
- package/dist/{query-keys-8SVs82aF.mjs → query-keys-DXle2tm8.mjs} +1 -1
- package/dist/{query-keys-8SVs82aF.mjs.map → query-keys-DXle2tm8.mjs.map} +1 -1
- package/dist/{registries-Ct8o2YRe.mjs → registries-kvRRUHcO.mjs} +1 -1
- package/dist/{registries-Ct8o2YRe.mjs.map → registries-kvRRUHcO.mjs.map} +1 -1
- package/dist/{registry-context-CTHUCfEc.mjs → registry-context-Bc-2fQnr.mjs} +1 -1
- package/dist/{registry-context-CTHUCfEc.mjs.map → registry-context-Bc-2fQnr.mjs.map} +1 -1
- package/dist/{ro-B43SoGdE.mjs → ro-C_4rHVWp.mjs} +1 -1
- package/dist/ro-C_4rHVWp.mjs.map +1 -0
- package/dist/{ru-ChwnncDc.mjs → ru-B0lzoBye.mjs} +1 -1
- package/dist/ru-B0lzoBye.mjs.map +1 -0
- package/dist/{scroll-arrows-CqDxJ0Pe.mjs → scroll-arrows-D90Miaz_.mjs} +1 -1
- package/dist/{scroll-arrows-CqDxJ0Pe.mjs.map → scroll-arrows-D90Miaz_.mjs.map} +1 -1
- package/dist/{sortable.esm-C8riJ_zv.mjs → sortable.esm-NmKxJoc7.mjs} +1 -1
- package/dist/{sortable.esm-C8riJ_zv.mjs.map → sortable.esm-NmKxJoc7.mjs.map} +1 -1
- package/dist/{src-C9vtVoJs.mjs → src-CSFJnkfN.mjs} +1 -1
- package/dist/{src-C9vtVoJs.mjs.map → src-CSFJnkfN.mjs.map} +1 -1
- package/dist/{src-pgBBOcJa.mjs → src-KINQ78Nj.mjs} +1 -1
- package/dist/{src-pgBBOcJa.mjs.map → src-KINQ78Nj.mjs.map} +1 -1
- package/dist/{th-C9S_8Tv6.mjs → th-QhoPGZ6C.mjs} +1 -1
- package/dist/th-QhoPGZ6C.mjs.map +1 -0
- package/dist/{tl-CiPbx_5F.mjs → tl-Dsfp243U.mjs} +1 -1
- package/dist/tl-Dsfp243U.mjs.map +1 -0
- package/dist/{tr-CUd4dp2u.mjs → tr-BiolaqkO.mjs} +1 -1
- package/dist/tr-BiolaqkO.mjs.map +1 -0
- package/dist/{use-account-DsTz5BlS.mjs → use-account-CGaDP8xd.mjs} +2 -2
- package/dist/{use-account-DsTz5BlS.mjs.map → use-account-CGaDP8xd.mjs.map} +1 -1
- package/dist/{use-store-C2KBIS41.mjs → use-store-BVCCB9kx.mjs} +1 -1
- package/dist/{use-store-C2KBIS41.mjs.map → use-store-BVCCB9kx.mjs.map} +1 -1
- package/dist/{zh_CN-D46-GUTP.mjs → zh_CN-DcGf3QsR.mjs} +1 -1
- package/dist/zh_CN-DcGf3QsR.mjs.map +1 -0
- package/dist/{zh_TW-XqA7UKxt.mjs → zh_TW-DFw2O0OX.mjs} +1 -1
- package/dist/zh_TW-DFw2O0OX.mjs.map +1 -0
- package/package.json +14 -13
- package/dist/FluidProvider-Bwg1cGSY.mjs +0 -2409
- package/dist/FluidProvider-Bwg1cGSY.mjs.map +0 -1
- package/dist/FluidProvider-DprqXNu4.cjs +0 -2520
- package/dist/FluidProvider-DprqXNu4.cjs.map +0 -1
- package/dist/ProfileScreen-BDLJgcXg.cjs.map +0 -1
- package/dist/ProfileScreen-CmQDKNaP.mjs.map +0 -1
- package/dist/SubscriptionsScreen-B88_dLfE.cjs.map +0 -1
- package/dist/de-DWONEOZS.mjs.map +0 -1
- package/dist/el-De7Ne7it.mjs.map +0 -1
- package/dist/es-B5_ItPIn.mjs.map +0 -1
- package/dist/fluid-pay-api-adapter-CJ7-I8k-.mjs.map +0 -1
- package/dist/fluid-pay-api-adapter-D63KLi5c.cjs.map +0 -1
- package/dist/fr-jgEDP2og.mjs.map +0 -1
- package/dist/he-DLQdVr_g.mjs.map +0 -1
- package/dist/hu-CC4QdkPb.mjs.map +0 -1
- package/dist/id-CwGC2v1d.mjs.map +0 -1
- package/dist/it-jUZZ5sjO.mjs.map +0 -1
- package/dist/ja-QVQymwAE.mjs.map +0 -1
- package/dist/ko-DfzzTwZI.mjs.map +0 -1
- package/dist/nl-Dys3mUo2.mjs.map +0 -1
- package/dist/pay-api-context-CqKGSXnP.mjs +0 -13
- package/dist/pay-api-context-CqKGSXnP.mjs.map +0 -1
- package/dist/pay-api-context-_o5ZEXYt.cjs +0 -25
- package/dist/pay-api-context-_o5ZEXYt.cjs.map +0 -1
- package/dist/pl-CBwEisEK.mjs.map +0 -1
- package/dist/pt-D5al7xw3.mjs.map +0 -1
- package/dist/ro-B43SoGdE.mjs.map +0 -1
- package/dist/ru-ChwnncDc.mjs.map +0 -1
- package/dist/th-C9S_8Tv6.mjs.map +0 -1
- package/dist/tl-CiPbx_5F.mjs.map +0 -1
- package/dist/tr-CUd4dp2u.mjs.map +0 -1
- package/dist/zh_CN-D46-GUTP.mjs.map +0 -1
- package/dist/zh_TW-XqA7UKxt.mjs.map +0 -1
- /package/dist/{fields-B_iAnFXl.mjs → fields-FTgjMOdh.mjs} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QuickShareWidget-DKE7Tba2.mjs","names":["ImageIcon"],"sources":["../../widgets/src/widgets/QuickShareWidget.tsx"],"sourcesContent":["import {\n useCallback,\n useEffect,\n useState,\n type ComponentProps,\n type CSSProperties,\n} from \"react\";\nimport type React from \"react\";\nimport type {\n BorderRadiusOptions,\n BorderWidthOptions,\n ColorOptions,\n FontSizeOptions,\n PaddingOptions,\n ShareableItem,\n} from \"@fluid-app/portal-core/types\";\nimport type { WidgetPropertySchema } from \"@fluid-app/portal-core/registries\";\nimport {\n borderColorClasses,\n borderWidthClasses,\n getBorderColorField,\n getBorderRadiusField,\n getBorderWidthField,\n getColorField,\n getFontSizeField,\n getPaddingField,\n} from \"../core/fields\";\nimport { QRCodeSVG } from \"qrcode.react\";\nimport {\n BookOpen,\n Check,\n CircleDot,\n Copy,\n FileText,\n Image as ImageIcon,\n Mail,\n MessageCircle,\n Package,\n Share2,\n ShoppingCart,\n Ticket,\n type LucideIcon,\n} from \"lucide-react\";\n\ntype QuickShareWidgetProps = ComponentProps<\"div\"> & {\n // Resource\n shareableResource?: ShareableItem;\n\n // Title\n titleEnabled?: boolean;\n titleText?: string;\n titleFontSize?: FontSizeOptions;\n titleColor?: ColorOptions;\n\n // Styling\n textColor?: ColorOptions;\n accentColor?: ColorOptions;\n padding?: PaddingOptions;\n borderRadius?: BorderRadiusOptions;\n borderWidth?: BorderWidthOptions;\n borderColor?: ColorOptions;\n\n // Overlay\n overlayEnabled?: boolean;\n overlayType?: \"solid\" | \"gradient\";\n overlayIntensity?: number;\n\n // Actions\n showBuyButton?: boolean;\n\n // Polish (new, additive)\n showResourceType?: boolean;\n showShareActions?: boolean;\n showDomainPrefix?: boolean;\n};\n\ntype ResourceDescriptor = {\n label: string;\n icon: LucideIcon;\n};\n\ntype QuickShareCSSProperties = CSSProperties &\n Record<`--${string}`, string | number | undefined>;\n\nconst RESOURCE_TYPE_MAP: Record<string, ResourceDescriptor> = {\n Product: { label: \"Product\", icon: Package },\n Page: { label: \"Page\", icon: FileText },\n EnrollmentPack: { label: \"Enrollment\", icon: Ticket },\n Medium: { label: \"Media\", icon: ImageIcon },\n Library: { label: \"Library\", icon: BookOpen },\n};\n\nconst getResourceDescriptor = (\n resource: ShareableItem | undefined,\n): ResourceDescriptor | null => {\n const rawType = (resource?.type || resource?.shareableType || \"\") as string;\n if (!rawType) return null;\n return RESOURCE_TYPE_MAP[rawType] ?? { label: rawType, icon: CircleDot };\n};\n\nconst splitUrl = (url: string): { prefix: string; path: string } => {\n try {\n const parsed = new URL(url);\n return {\n prefix: `${parsed.protocol}//${parsed.host}`,\n path: `${parsed.pathname}${parsed.search}${parsed.hash}`,\n };\n } catch {\n return { prefix: \"\", path: url };\n }\n};\n\nconst CURRENCY_FIELD_KEYS = [\n \"currency\",\n \"currency_code\",\n \"currencyCode\",\n \"currencyIso\",\n \"currency_iso\",\n] as const;\n\nconst getResourceCurrency = (\n resource: ShareableItem | undefined,\n): string | null => {\n if (!resource) return null;\n for (const key of CURRENCY_FIELD_KEYS) {\n const value = resource[key];\n if (typeof value === \"string\" && /^[A-Z]{3}$/i.test(value)) {\n return value.toUpperCase();\n }\n }\n return null;\n};\n\nconst formatNumericPrice = (price: number, resource: ShareableItem): string => {\n const currency = getResourceCurrency(resource);\n if (!currency) return String(price);\n try {\n return price.toLocaleString(undefined, { style: \"currency\", currency });\n } catch {\n return String(price);\n }\n};\n\nconst getDisplayPrice = (\n resource: ShareableItem | undefined,\n): string | null => {\n if (!resource) return null;\n if (typeof resource.display_price === \"string\" && resource.display_price) {\n return resource.display_price;\n }\n if (resource.price != null) {\n return typeof resource.price === \"number\"\n ? formatNumericPrice(resource.price, resource)\n : String(resource.price);\n }\n return null;\n};\n\nconst getColorCssValue = (color: ColorOptions): string =>\n color === \"transparent\" ? \"transparent\" : `var(--color-${color})`;\n\nconst colorMix = (color: ColorOptions, amount: number): string =>\n color === \"transparent\"\n ? \"transparent\"\n : `color-mix(in oklch, ${getColorCssValue(color)} ${amount}%, transparent)`;\n\nconst insetBorder = (color: ColorOptions, amount: number): string =>\n `inset 0 0 0 1px ${colorMix(color, amount)}`;\n\ntype CopyState = \"idle\" | \"copied\";\n\nfunction useTimedCopyState(timeoutMs: number) {\n const [copyState, setCopyState] = useState<CopyState>(\"idle\");\n\n useEffect(() => {\n if (copyState !== \"copied\") return;\n const id = window.setTimeout(() => setCopyState(\"idle\"), timeoutMs);\n return () => window.clearTimeout(id);\n }, [copyState, timeoutMs]);\n\n const markCopied = useCallback(() => {\n setCopyState(\"copied\");\n }, []);\n\n return { copyState, markCopied };\n}\n\nfunction useImageFailureFallback(imageUrl: string) {\n const [imageFailed, setImageFailed] = useState(false);\n\n // Reset the failed-image state when the resource (and thus the image URL)\n // changes — otherwise switching to a new resource keeps showing EmptyHero\n // because the React state outlives the previous load failure.\n useEffect(() => {\n setImageFailed(false);\n }, [imageUrl]);\n\n const handleImageError = useCallback(() => {\n setImageFailed(true);\n }, []);\n\n return { imageFailed, handleImageError };\n}\n\nfunction useShareCapabilities() {\n const [canNativeShare, setCanNativeShare] = useState(false);\n const [canSendSms, setCanSendSms] = useState(false);\n\n useEffect(() => {\n setCanNativeShare(\n typeof navigator !== \"undefined\" && typeof navigator.share === \"function\",\n );\n setCanSendSms(\n typeof navigator !== \"undefined\" &&\n (/Android|iPhone|iPad|iPod/i.test(navigator.userAgent) ||\n (/Macintosh/i.test(navigator.userAgent) &&\n navigator.maxTouchPoints > 1)),\n );\n }, []);\n\n return { canNativeShare, canSendSms };\n}\n\nexport function QuickShareWidget({\n shareableResource,\n\n titleEnabled = true,\n titleText = \"\",\n titleFontSize = \"2xl\",\n titleColor = \"background\",\n\n textColor = \"background\",\n accentColor = \"primary\",\n padding = 6,\n borderRadius = \"xl\",\n borderWidth = \"none\",\n borderColor = \"muted\",\n\n overlayEnabled = true,\n overlayType = \"gradient\",\n overlayIntensity = 70,\n\n showBuyButton = false,\n\n showResourceType = true,\n showShareActions = true,\n showDomainPrefix = true,\n\n className,\n style,\n ...props\n}: QuickShareWidgetProps): React.JSX.Element {\n const backgroundImageUrl =\n shareableResource?.image_url || shareableResource?.imageUrl || \"\";\n const { copyState, markCopied } = useTimedCopyState(1600);\n // Hero image fallback: if the resource image 404s or fails to decode, flip\n // to the EmptyHero treatment instead of rendering a broken image.\n const { imageFailed, handleImageError } =\n useImageFailureFallback(backgroundImageUrl);\n\n const showHeroImage = Boolean(backgroundImageUrl) && !imageFailed;\n const shareLink = shareableResource?.share_link || \"\";\n const hasShareLink = !!shareLink;\n\n const displayTitle =\n titleText || shareableResource?.title || \"Select content to share\";\n const resourceDescriptor = getResourceDescriptor(shareableResource);\n const displayPrice = getDisplayPrice(shareableResource);\n\n const isProduct =\n shareableResource?.type === \"Product\" ||\n shareableResource?.shareableType === \"Product\";\n const shouldShowBuyButton = showBuyButton && isProduct;\n\n const parsedOverlayIntensity = Number(\n String(overlayIntensity).replace(\"%\", \"\"),\n );\n const overlayOpacity =\n (Number.isFinite(parsedOverlayIntensity)\n ? Math.min(100, Math.max(0, parsedOverlayIntensity))\n : 70) / 100;\n\n const editorialGradient: CSSProperties | undefined =\n overlayEnabled && showHeroImage\n ? {\n background: `linear-gradient(to top, color-mix(in oklch, var(--color-foreground) ${Math.round(overlayOpacity * 100)}%, transparent), color-mix(in oklch, var(--color-foreground) ${Math.round(overlayOpacity * 55)}%, transparent) 45%, transparent 85%)`,\n }\n : undefined;\n\n const handleCopy = async () => {\n if (!hasShareLink) return;\n try {\n await navigator.clipboard.writeText(shareLink);\n markCopied();\n } catch (error) {\n console.error(\"Failed to copy to clipboard:\", error);\n }\n };\n\n const handleNativeShare = async () => {\n if (!hasShareLink) return;\n if (typeof navigator.share === \"function\") {\n try {\n await navigator.share({\n title: displayTitle,\n url: shareLink,\n });\n } catch {\n // Ignore abort\n }\n } else {\n await handleCopy();\n }\n };\n\n const { prefix, path } = hasShareLink\n ? splitUrl(shareLink)\n : { prefix: \"\", path: \"\" };\n\n return (\n <div\n className={`relative isolate overflow-hidden rounded-${borderRadius} ${borderWidthClasses[borderWidth]} ${borderWidth !== \"none\" ? borderColorClasses[borderColor] : \"\"} bg-muted text-${textColor} ${className ?? \"\"}`}\n style={{\n // Themed dual-shadow (crisp + soft ambient), derived from the\n // foreground token so the lift reads in both light and dark.\n boxShadow: `0 1px 2px color-mix(in oklch, var(--color-foreground) 4%, transparent), 0 20px 40px -20px color-mix(in oklch, var(--color-foreground) 25%, transparent)`,\n ...style,\n }}\n {...props}\n >\n {/* Hero image or empty-state surface */}\n {showHeroImage ? (\n <div className=\"absolute inset-0\">\n <img\n src={backgroundImageUrl}\n alt=\"\"\n loading=\"lazy\"\n onError={handleImageError}\n className=\"h-full w-full object-cover\"\n />\n {overlayEnabled && (\n <>\n {/* Layer 1 — main bottom-to-top legibility gradient */}\n <div\n className=\"pointer-events-none absolute inset-0\"\n style={editorialGradient}\n />\n {/* Layer 2 — diagonal bottom-left anchor (image reads top-right, content reads bottom-left) */}\n <div\n className=\"pointer-events-none absolute inset-0\"\n style={{\n background: `linear-gradient(to top right, color-mix(in oklch, var(--color-foreground) ${Math.round(overlayOpacity * 65)}%, transparent), color-mix(in oklch, var(--color-foreground) ${Math.round(overlayOpacity * 25)}%, transparent) 35%, transparent 65%)`,\n }}\n />\n {/* Layer 3 — radial pool anchoring the bottom-left share panel */}\n <div\n className=\"pointer-events-none absolute inset-0\"\n style={{\n background: `radial-gradient(ellipse 70% 55% at 15% 100%, color-mix(in oklch, var(--color-foreground) ${Math.round(overlayOpacity * 45)}%, transparent), transparent 70%)`,\n }}\n />\n {overlayType === \"solid\" && (\n <div\n className=\"bg-foreground pointer-events-none absolute inset-0\"\n style={{ opacity: overlayOpacity * 0.35 }}\n />\n )}\n </>\n )}\n </div>\n ) : (\n <EmptyHero accentColor={accentColor} textColor={textColor} />\n )}\n\n {/* Content */}\n <div className={`relative flex min-h-[440px] flex-col p-${padding}`}>\n {/* Top row: resource type eyebrow + optional price chip */}\n {(showResourceType && resourceDescriptor) || displayPrice ? (\n <div className=\"flex items-start justify-between gap-3\">\n {showResourceType && resourceDescriptor ? (\n (() => {\n const { icon: ResourceIcon, label } = resourceDescriptor;\n return (\n <span\n className={`inline-flex items-center gap-1.5 rounded-${borderRadius} bg-${textColor}/15 px-2.5 py-1 text-[10px] font-bold tracking-[0.18em] uppercase text-${textColor} backdrop-blur-sm`}\n style={{\n boxShadow: insetBorder(textColor, 15),\n }}\n >\n <ResourceIcon className=\"size-3\" />\n {label}\n </span>\n );\n })()\n ) : (\n <span />\n )}\n {displayPrice && (\n <span\n className={`inline-flex items-center rounded-${borderRadius} bg-${accentColor} px-2.5 py-1 text-[11px] font-bold tabular-nums text-${accentColor}-foreground`}\n style={{\n boxShadow: `0 4px 14px -4px color-mix(in oklch, var(--color-foreground) 30%, transparent)`,\n }}\n >\n {displayPrice}\n </span>\n )}\n </div>\n ) : null}\n\n {/* Middle: spacer that keeps share panel bottom-anchored.\n Optional title renders inside it without changing layout rhythm. */}\n <div className=\"mt-4 flex flex-1 flex-col justify-end\">\n {titleEnabled && displayTitle && (\n <h2\n className={`text-${titleFontSize} font-header leading-[1.12] font-bold tracking-[-0.015em] text-${titleColor}`}\n style={{\n // Themed via foreground so the legibility shadow flips with\n // the title color when the theme switches to dark mode.\n textShadow: showHeroImage\n ? `0 2px 12px color-mix(in oklch, var(--color-foreground) 40%, transparent)`\n : undefined,\n }}\n >\n {displayTitle}\n </h2>\n )}\n </div>\n\n {/* Bottom: share panel */}\n <div className=\"mt-6 flex flex-col gap-3\">\n <div className=\"flex items-stretch gap-3\">\n {/* QR card */}\n <div\n className={`group relative shrink-0 rounded-${borderRadius} bg-white p-2.5 transition-transform duration-300 hover:scale-[1.02]`}\n style={{\n // QR card stays white for scanner contrast; lift shadow is\n // themed via foreground so it reads in dark mode too.\n boxShadow: `0 4px 16px -4px color-mix(in oklch, var(--color-foreground) 25%, transparent), inset 0 0 0 1px rgba(255,255,255,0.4)`,\n }}\n aria-label=\"QR code for share link\"\n >\n <QRCodeSVG\n value={shareLink || \"https://example.com\"}\n size={96}\n level=\"H\"\n bgColor=\"#ffffff\"\n fgColor=\"#0f172a\"\n />\n </div>\n\n {/* URL chip + share actions rail */}\n <div className=\"flex min-w-0 flex-1 flex-col gap-2\">\n <span\n className={`text-[10px] font-bold tracking-[0.16em] uppercase text-${textColor}/70`}\n >\n Share link\n </span>\n <button\n type=\"button\"\n onClick={handleCopy}\n disabled={!hasShareLink}\n aria-label={\n copyState === \"copied\" ? \"Copied to clipboard\" : \"Copy link\"\n }\n className={`group flex items-center justify-between gap-2 rounded-${borderRadius} bg-${textColor}/10 px-3 py-2 text-left text-[12px] backdrop-blur-sm transition-all duration-300 hover:bg-${textColor}/15 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--quick-share-focus-ring)] disabled:opacity-50 ${copyState === \"copied\" ? `bg-${accentColor}/20` : \"\"}`}\n style={\n {\n \"--quick-share-focus-ring\": colorMix(accentColor, 40),\n boxShadow: insetBorder(textColor, 15),\n } as QuickShareCSSProperties\n }\n >\n <span\n className={`min-w-0 flex-1 truncate font-medium tabular-nums text-${textColor}`}\n >\n {hasShareLink ? (\n <>\n {showDomainPrefix && prefix && (\n <span className={`opacity-60`}>{prefix}</span>\n )}\n <span className=\"font-semibold\">{path}</span>\n </>\n ) : (\n <span className={`opacity-60`}>No link yet</span>\n )}\n </span>\n <span\n className={`flex size-7 shrink-0 items-center justify-center rounded-full transition-all duration-300 ${copyState === \"copied\" ? `bg-${accentColor} text-${accentColor}-foreground scale-110` : `bg-${textColor}/15 text-${textColor}`}`}\n >\n {copyState === \"copied\" ? (\n <Check className=\"size-3.5\" />\n ) : (\n <Copy className=\"size-3.5\" />\n )}\n </span>\n </button>\n <span className=\"sr-only\" aria-live=\"polite\" role=\"status\">\n {copyState === \"copied\" ? \"Copied to clipboard\" : \"\"}\n </span>\n\n {showShareActions && (\n <ShareActionRow\n shareLink={shareLink}\n displayTitle={displayTitle}\n accentColor={accentColor}\n textColor={textColor}\n borderRadius={borderRadius}\n onNative={handleNativeShare}\n />\n )}\n </div>\n </div>\n\n {shouldShowBuyButton &&\n (hasShareLink ? (\n <a\n href={shareLink}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className={`flex w-full items-center justify-center gap-2 rounded-${borderRadius} bg-${accentColor} px-4 py-3 text-[13px] font-bold text-${accentColor}-foreground transition-transform hover:scale-[1.01]`}\n style={{\n boxShadow: `0 8px 22px -8px color-mix(in oklch, var(--color-foreground) 35%, transparent)`,\n }}\n >\n <ShoppingCart className=\"size-4\" />\n <span>Buy now</span>\n </a>\n ) : (\n <button\n type=\"button\"\n disabled\n className={`flex w-full cursor-not-allowed items-center justify-center gap-2 rounded-${borderRadius} bg-${accentColor} px-4 py-3 text-[13px] font-bold text-${accentColor}-foreground opacity-50`}\n style={{\n boxShadow: `0 8px 22px -8px color-mix(in oklch, var(--color-foreground) 35%, transparent)`,\n }}\n >\n <ShoppingCart className=\"size-4\" />\n <span>Buy now</span>\n </button>\n ))}\n </div>\n </div>\n </div>\n );\n}\n\ntype ShareActionRowProps = {\n shareLink: string;\n displayTitle: string;\n accentColor: ColorOptions;\n textColor: ColorOptions;\n borderRadius: BorderRadiusOptions;\n onNative: () => void;\n};\n\nfunction ShareActionRow({\n shareLink,\n displayTitle,\n accentColor,\n textColor,\n borderRadius,\n onNative,\n}: ShareActionRowProps) {\n const disabled = !shareLink;\n const { canNativeShare, canSendSms } = useShareCapabilities();\n\n const emailHref = shareLink\n ? `mailto:?subject=${encodeURIComponent(displayTitle)}&body=${encodeURIComponent(shareLink)}`\n : undefined;\n const smsHref = shareLink\n ? `sms:?body=${encodeURIComponent(`${displayTitle} — ${shareLink}`)}`\n : undefined;\n\n return (\n <div className=\"flex items-center gap-1.5\">\n <ShareActionButton\n icon={Mail}\n label=\"Email\"\n href={emailHref}\n disabled={disabled}\n accentColor={accentColor}\n textColor={textColor}\n borderRadius={borderRadius}\n />\n {canSendSms && (\n <ShareActionButton\n icon={MessageCircle}\n label=\"Text\"\n href={smsHref}\n disabled={disabled}\n accentColor={accentColor}\n textColor={textColor}\n borderRadius={borderRadius}\n />\n )}\n {canNativeShare && (\n <ShareActionButton\n icon={Share2}\n label=\"Share\"\n onClick={onNative}\n disabled={disabled}\n accentColor={accentColor}\n textColor={textColor}\n borderRadius={borderRadius}\n />\n )}\n </div>\n );\n}\n\ntype ShareActionButtonProps = {\n icon: LucideIcon;\n label: string;\n href?: string | undefined;\n onClick?: () => void;\n disabled: boolean;\n accentColor: ColorOptions;\n textColor: ColorOptions;\n borderRadius: BorderRadiusOptions;\n};\n\nfunction ShareActionButton({\n icon: Icon,\n label,\n href,\n onClick,\n disabled,\n accentColor,\n textColor,\n borderRadius,\n}: ShareActionButtonProps) {\n const className = `group inline-flex items-center gap-1.5 rounded-${borderRadius} bg-${textColor}/10 px-2.5 py-1.5 text-[11px] font-semibold text-${textColor} backdrop-blur-sm transition-all duration-200 hover:-translate-y-0.5 hover:bg-${accentColor} hover:text-${accentColor}-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--quick-share-focus-ring)] disabled:cursor-not-allowed disabled:opacity-40 disabled:hover:translate-y-0`;\n const style: QuickShareCSSProperties = {\n \"--quick-share-focus-ring\": colorMix(accentColor, 40),\n boxShadow: insetBorder(textColor, 15),\n };\n\n const content = (\n <>\n <Icon className=\"size-3\" />\n <span>{label}</span>\n </>\n );\n\n if (href && !disabled) {\n return (\n <a href={href} className={className} style={style} aria-label={label}>\n {content}\n </a>\n );\n }\n\n return (\n <button\n type=\"button\"\n onClick={onClick}\n disabled={disabled}\n className={className}\n style={style}\n aria-label={label}\n >\n {content}\n </button>\n );\n}\n\nfunction EmptyHero({\n accentColor,\n textColor,\n}: {\n accentColor: ColorOptions;\n textColor: ColorOptions;\n}) {\n return (\n <div className={`bg-muted absolute inset-0`}>\n <div\n className=\"absolute inset-0\"\n style={{\n background: `radial-gradient(circle at 30% 20%, ${colorMix(accentColor, 15)}, transparent 60%), radial-gradient(circle at 80% 90%, ${colorMix(accentColor, 10)}, transparent 55%)`,\n }}\n />\n <div className=\"absolute inset-0 flex flex-col items-center justify-center gap-3\">\n <div\n className={`flex size-14 items-center justify-center rounded-2xl bg-${textColor}/5`}\n style={{ boxShadow: insetBorder(textColor, 10) }}\n >\n <ImageIcon className={`size-6 text-${textColor}/40`} />\n </div>\n <span\n className={`text-[10px] font-bold tracking-[0.2em] uppercase text-${textColor}/45`}\n >\n Nothing selected\n </span>\n </div>\n </div>\n );\n}\n\nexport const quickShareWidgetPropertySchema: WidgetPropertySchema = {\n widgetType: \"QuickShareWidget\",\n displayName: \"Quick Share Widget\",\n tabsConfig: [{ id: \"styling\", label: \"Styling\" }],\n fields: [\n // Content\n {\n key: \"shareableResource\",\n label: \"Shareable Content\",\n type: \"resource\",\n description: \"Select the content to generate a share link for\",\n allowedTypes: [\"Product\", \"Page\", \"EnrollmentPack\", \"Medium\", \"Library\"],\n tab: \"styling\",\n group: \"Content\",\n },\n\n // Title\n {\n key: \"titleEnabled\",\n label: \"Show Title\",\n type: \"boolean\",\n description: \"Display a title on the hero\",\n defaultValue: true,\n tab: \"styling\",\n group: \"Title\",\n },\n {\n key: \"titleText\",\n label: \"Title\",\n type: \"text\",\n description:\n \"Custom title text (defaults to the resource title if empty)\",\n defaultValue: \"\",\n tab: \"styling\",\n group: \"Title\",\n requiresKeyToBeTrue: \"titleEnabled\",\n },\n getFontSizeField({\n key: \"titleFontSize\",\n label: \"Title Font Size\",\n description: \"Font size for the title\",\n defaultValue: \"2xl\",\n tab: \"styling\",\n group: \"Title\",\n requiresKeyToBeTrue: \"titleEnabled\",\n }),\n getColorField({\n key: \"titleColor\",\n label: \"Title Color\",\n description: \"Color for the title\",\n defaultValue: \"background\",\n tab: \"styling\",\n group: \"Title\",\n requiresKeyToBeTrue: \"titleEnabled\",\n }),\n\n // Share panel polish (new)\n {\n key: \"showResourceType\",\n label: \"Show Resource Type Pill\",\n type: \"boolean\",\n description:\n \"Display a small type eyebrow chip (Product · Page · Media…)\",\n defaultValue: true,\n tab: \"styling\",\n group: \"Share Panel\",\n },\n {\n key: \"showShareActions\",\n label: \"Show Share Actions\",\n type: \"boolean\",\n description:\n \"Show Email, Text, and native Share buttons under the link chip\",\n defaultValue: true,\n tab: \"styling\",\n group: \"Share Panel\",\n },\n {\n key: \"showDomainPrefix\",\n label: \"Show Domain Prefix\",\n type: \"boolean\",\n description:\n \"Include the domain in the link chip (dimmed) with the path emphasized\",\n defaultValue: true,\n tab: \"styling\",\n group: \"Share Panel\",\n },\n {\n key: \"showBuyButton\",\n label: \"Show Buy Button\",\n type: \"boolean\",\n description: \"Display the Buy button (only shown for Product resources)\",\n defaultValue: false,\n tab: \"styling\",\n group: \"Share Panel\",\n },\n\n // Design\n getColorField({\n key: \"textColor\",\n label: \"Text Color\",\n description: \"Default text color for widget content (over the hero)\",\n defaultValue: \"background\",\n tab: \"styling\",\n group: \"Design\",\n }),\n getColorField({\n key: \"accentColor\",\n label: \"Accent Color\",\n description:\n \"Drives the price chip, primary button, and copy-success flash\",\n defaultValue: \"primary\",\n tab: \"styling\",\n group: \"Design\",\n }),\n {\n key: \"overlayEnabled\",\n label: \"Enable Overlay\",\n type: \"boolean\",\n description: \"Add editorial gradient stack for legibility over the hero\",\n defaultValue: true,\n tab: \"styling\",\n group: \"Design\",\n },\n {\n key: \"overlayType\",\n label: \"Overlay Type\",\n type: \"buttonGroup\",\n description:\n \"Gradient only (recommended) or gradient + solid wash (heavier)\",\n defaultValue: \"gradient\",\n options: [\n { label: \"Gradient\", value: \"gradient\" },\n { label: \"Solid\", value: \"solid\" },\n ],\n tab: \"styling\",\n group: \"Design\",\n requiresKeyToBeTrue: \"overlayEnabled\",\n },\n {\n key: \"overlayIntensity\",\n label: \"Overlay Intensity\",\n type: \"slider\",\n description: \"Opacity of the overlay (0-100)\",\n min: 0,\n max: 100,\n step: 5,\n defaultValue: 70,\n unit: \"%\",\n tab: \"styling\",\n group: \"Design\",\n requiresKeyToBeTrue: \"overlayEnabled\",\n },\n {\n key: \"separator\",\n type: \"separator\",\n label: \"Separator\",\n tab: \"styling\",\n group: \"Design\",\n },\n getPaddingField({\n key: \"padding\",\n label: \"Padding\",\n description: \"Padding around the widget content\",\n defaultValue: 6,\n tab: \"styling\",\n group: \"Design\",\n }),\n getBorderRadiusField({\n key: \"borderRadius\",\n label: \"Border Radius\",\n description: \"Border radius for the widget container\",\n defaultValue: \"xl\",\n tab: \"styling\",\n group: \"Design\",\n }),\n getBorderWidthField({\n key: \"borderWidth\",\n label: \"Border Width\",\n description: \"Border width for the widget container\",\n defaultValue: \"none\",\n tab: \"styling\",\n group: \"Design\",\n }),\n getBorderColorField({\n key: \"borderColor\",\n label: \"Border Color\",\n description: \"Border color for the widget container\",\n defaultValue: \"muted\",\n tab: \"styling\",\n group: \"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;EACD;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR;EAGD,cAAc;GACZ,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EACF,cAAc;GACZ,KAAK;GACL,OAAO;GACP,aACE;GACF,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EACF;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR;EACD;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aACE;GACF,cAAc;GACd,SAAS,CACP;IAAE,OAAO;IAAY,OAAO;IAAY,EACxC;IAAE,OAAO;IAAS,OAAO;IAAS,CACnC;GACD,KAAK;GACL,OAAO;GACP,qBAAqB;GACtB;EACD;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,KAAK;GACL,KAAK;GACL,MAAM;GACN,cAAc;GACd,MAAM;GACN,KAAK;GACL,OAAO;GACP,qBAAqB;GACtB;EACD;GACE,KAAK;GACL,MAAM;GACN,OAAO;GACP,KAAK;GACL,OAAO;GACR;EACD,gBAAgB;GACd,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EACF,qBAAqB;GACnB,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EACF,oBAAoB;GAClB,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EACF,oBAAoB;GAClB,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EACH;CACF"}
|
|
1
|
+
{"version":3,"file":"QuickShareWidget-DJ0Y71om.mjs","names":["ImageIcon"],"sources":["../../widgets/src/widgets/QuickShareWidget.tsx"],"sourcesContent":["import {\n useCallback,\n useEffect,\n useState,\n type ComponentProps,\n type CSSProperties,\n} from \"react\";\nimport type React from \"react\";\nimport type {\n BorderRadiusOptions,\n BorderWidthOptions,\n ColorOptions,\n FontSizeOptions,\n PaddingOptions,\n ShareableItem,\n} from \"@fluid-app/portal-core/types\";\nimport type { WidgetPropertySchema } from \"@fluid-app/portal-core/registries\";\nimport {\n borderColorClasses,\n borderWidthClasses,\n getBorderColorField,\n getBorderRadiusField,\n getBorderWidthField,\n getColorField,\n getFontSizeField,\n getPaddingField,\n} from \"../core/fields\";\nimport { QRCodeSVG } from \"qrcode.react\";\nimport {\n BookOpen,\n Check,\n CircleDot,\n Copy,\n FileText,\n Image as ImageIcon,\n Mail,\n MessageCircle,\n Package,\n Share2,\n ShoppingCart,\n Ticket,\n type LucideIcon,\n} from \"lucide-react\";\n\ntype QuickShareWidgetProps = ComponentProps<\"div\"> & {\n // Resource\n shareableResource?: ShareableItem;\n\n // Title\n titleEnabled?: boolean;\n titleText?: string;\n titleFontSize?: FontSizeOptions;\n titleColor?: ColorOptions;\n\n // Styling\n textColor?: ColorOptions;\n accentColor?: ColorOptions;\n padding?: PaddingOptions;\n borderRadius?: BorderRadiusOptions;\n borderWidth?: BorderWidthOptions;\n borderColor?: ColorOptions;\n\n // Overlay\n overlayEnabled?: boolean;\n overlayType?: \"solid\" | \"gradient\";\n overlayIntensity?: number;\n\n // Actions\n showBuyButton?: boolean;\n\n // Polish (new, additive)\n showResourceType?: boolean;\n showShareActions?: boolean;\n showDomainPrefix?: boolean;\n};\n\ntype ResourceDescriptor = {\n label: string;\n icon: LucideIcon;\n};\n\ntype QuickShareCSSProperties = CSSProperties &\n Record<`--${string}`, string | number | undefined>;\n\nconst RESOURCE_TYPE_MAP: Record<string, ResourceDescriptor> = {\n Product: { label: \"Product\", icon: Package },\n Page: { label: \"Page\", icon: FileText },\n EnrollmentPack: { label: \"Enrollment\", icon: Ticket },\n Medium: { label: \"Media\", icon: ImageIcon },\n Library: { label: \"Library\", icon: BookOpen },\n};\n\nconst getResourceDescriptor = (\n resource: ShareableItem | undefined,\n): ResourceDescriptor | null => {\n const rawType = (resource?.type || resource?.shareableType || \"\") as string;\n if (!rawType) return null;\n return RESOURCE_TYPE_MAP[rawType] ?? { label: rawType, icon: CircleDot };\n};\n\nconst splitUrl = (url: string): { prefix: string; path: string } => {\n try {\n const parsed = new URL(url);\n return {\n prefix: `${parsed.protocol}//${parsed.host}`,\n path: `${parsed.pathname}${parsed.search}${parsed.hash}`,\n };\n } catch {\n return { prefix: \"\", path: url };\n }\n};\n\nconst CURRENCY_FIELD_KEYS = [\n \"currency\",\n \"currency_code\",\n \"currencyCode\",\n \"currencyIso\",\n \"currency_iso\",\n] as const;\n\nconst getResourceCurrency = (\n resource: ShareableItem | undefined,\n): string | null => {\n if (!resource) return null;\n for (const key of CURRENCY_FIELD_KEYS) {\n const value = resource[key];\n if (typeof value === \"string\" && /^[A-Z]{3}$/i.test(value)) {\n return value.toUpperCase();\n }\n }\n return null;\n};\n\nconst formatNumericPrice = (price: number, resource: ShareableItem): string => {\n const currency = getResourceCurrency(resource);\n if (!currency) return String(price);\n try {\n return price.toLocaleString(undefined, { style: \"currency\", currency });\n } catch {\n return String(price);\n }\n};\n\nconst getDisplayPrice = (\n resource: ShareableItem | undefined,\n): string | null => {\n if (!resource) return null;\n if (typeof resource.display_price === \"string\" && resource.display_price) {\n return resource.display_price;\n }\n if (resource.price != null) {\n return typeof resource.price === \"number\"\n ? formatNumericPrice(resource.price, resource)\n : String(resource.price);\n }\n return null;\n};\n\nconst getColorCssValue = (color: ColorOptions): string =>\n color === \"transparent\" ? \"transparent\" : `var(--color-${color})`;\n\nconst colorMix = (color: ColorOptions, amount: number): string =>\n color === \"transparent\"\n ? \"transparent\"\n : `color-mix(in oklch, ${getColorCssValue(color)} ${amount}%, transparent)`;\n\nconst insetBorder = (color: ColorOptions, amount: number): string =>\n `inset 0 0 0 1px ${colorMix(color, amount)}`;\n\ntype CopyState = \"idle\" | \"copied\";\n\nfunction useTimedCopyState(timeoutMs: number) {\n const [copyState, setCopyState] = useState<CopyState>(\"idle\");\n\n useEffect(() => {\n if (copyState !== \"copied\") return;\n const id = window.setTimeout(() => setCopyState(\"idle\"), timeoutMs);\n return () => window.clearTimeout(id);\n }, [copyState, timeoutMs]);\n\n const markCopied = useCallback(() => {\n setCopyState(\"copied\");\n }, []);\n\n return { copyState, markCopied };\n}\n\nfunction useImageFailureFallback(imageUrl: string) {\n const [imageFailed, setImageFailed] = useState(false);\n\n // Reset the failed-image state when the resource (and thus the image URL)\n // changes — otherwise switching to a new resource keeps showing EmptyHero\n // because the React state outlives the previous load failure.\n useEffect(() => {\n setImageFailed(false);\n }, [imageUrl]);\n\n const handleImageError = useCallback(() => {\n setImageFailed(true);\n }, []);\n\n return { imageFailed, handleImageError };\n}\n\nfunction useShareCapabilities() {\n const [canNativeShare, setCanNativeShare] = useState(false);\n const [canSendSms, setCanSendSms] = useState(false);\n\n useEffect(() => {\n setCanNativeShare(\n typeof navigator !== \"undefined\" && typeof navigator.share === \"function\",\n );\n setCanSendSms(\n typeof navigator !== \"undefined\" &&\n (/Android|iPhone|iPad|iPod/i.test(navigator.userAgent) ||\n (/Macintosh/i.test(navigator.userAgent) &&\n navigator.maxTouchPoints > 1)),\n );\n }, []);\n\n return { canNativeShare, canSendSms };\n}\n\nexport function QuickShareWidget({\n shareableResource,\n\n titleEnabled = true,\n titleText = \"\",\n titleFontSize = \"2xl\",\n titleColor = \"background\",\n\n textColor = \"background\",\n accentColor = \"primary\",\n padding = 6,\n borderRadius = \"xl\",\n borderWidth = \"none\",\n borderColor = \"muted\",\n\n overlayEnabled = true,\n overlayType = \"gradient\",\n overlayIntensity = 70,\n\n showBuyButton = false,\n\n showResourceType = true,\n showShareActions = true,\n showDomainPrefix = true,\n\n className,\n style,\n ...props\n}: QuickShareWidgetProps): React.JSX.Element {\n const backgroundImageUrl =\n shareableResource?.image_url || shareableResource?.imageUrl || \"\";\n const { copyState, markCopied } = useTimedCopyState(1600);\n // Hero image fallback: if the resource image 404s or fails to decode, flip\n // to the EmptyHero treatment instead of rendering a broken image.\n const { imageFailed, handleImageError } =\n useImageFailureFallback(backgroundImageUrl);\n\n const showHeroImage = Boolean(backgroundImageUrl) && !imageFailed;\n const shareLink = shareableResource?.share_link || \"\";\n const hasShareLink = !!shareLink;\n\n const displayTitle =\n titleText || shareableResource?.title || \"Select content to share\";\n const resourceDescriptor = getResourceDescriptor(shareableResource);\n const displayPrice = getDisplayPrice(shareableResource);\n\n const isProduct =\n shareableResource?.type === \"Product\" ||\n shareableResource?.shareableType === \"Product\";\n const shouldShowBuyButton = showBuyButton && isProduct;\n\n const parsedOverlayIntensity = Number(\n String(overlayIntensity).replace(\"%\", \"\"),\n );\n const overlayOpacity =\n (Number.isFinite(parsedOverlayIntensity)\n ? Math.min(100, Math.max(0, parsedOverlayIntensity))\n : 70) / 100;\n\n const editorialGradient: CSSProperties | undefined =\n overlayEnabled && showHeroImage\n ? {\n background: `linear-gradient(to top, color-mix(in oklch, var(--color-foreground) ${Math.round(overlayOpacity * 100)}%, transparent), color-mix(in oklch, var(--color-foreground) ${Math.round(overlayOpacity * 55)}%, transparent) 45%, transparent 85%)`,\n }\n : undefined;\n\n const handleCopy = async () => {\n if (!hasShareLink) return;\n try {\n await navigator.clipboard.writeText(shareLink);\n markCopied();\n } catch (error) {\n console.error(\"Failed to copy to clipboard:\", error);\n }\n };\n\n const handleNativeShare = async () => {\n if (!hasShareLink) return;\n if (typeof navigator.share === \"function\") {\n try {\n await navigator.share({\n title: displayTitle,\n url: shareLink,\n });\n } catch {\n // Ignore abort\n }\n } else {\n await handleCopy();\n }\n };\n\n const { prefix, path } = hasShareLink\n ? splitUrl(shareLink)\n : { prefix: \"\", path: \"\" };\n\n return (\n <div\n className={`relative isolate overflow-hidden rounded-${borderRadius} ${borderWidthClasses[borderWidth]} ${borderWidth !== \"none\" ? borderColorClasses[borderColor] : \"\"} bg-muted text-${textColor} ${className ?? \"\"}`}\n style={{\n // Themed dual-shadow (crisp + soft ambient), derived from the\n // foreground token so the lift reads in both light and dark.\n boxShadow: `0 1px 2px color-mix(in oklch, var(--color-foreground) 4%, transparent), 0 20px 40px -20px color-mix(in oklch, var(--color-foreground) 25%, transparent)`,\n ...style,\n }}\n {...props}\n >\n {/* Hero image or empty-state surface */}\n {showHeroImage ? (\n <div className=\"absolute inset-0\">\n <img\n src={backgroundImageUrl}\n alt=\"\"\n loading=\"lazy\"\n onError={handleImageError}\n className=\"h-full w-full object-cover\"\n />\n {overlayEnabled && (\n <>\n {/* Layer 1 — main bottom-to-top legibility gradient */}\n <div\n className=\"pointer-events-none absolute inset-0\"\n style={editorialGradient}\n />\n {/* Layer 2 — diagonal bottom-left anchor (image reads top-right, content reads bottom-left) */}\n <div\n className=\"pointer-events-none absolute inset-0\"\n style={{\n background: `linear-gradient(to top right, color-mix(in oklch, var(--color-foreground) ${Math.round(overlayOpacity * 65)}%, transparent), color-mix(in oklch, var(--color-foreground) ${Math.round(overlayOpacity * 25)}%, transparent) 35%, transparent 65%)`,\n }}\n />\n {/* Layer 3 — radial pool anchoring the bottom-left share panel */}\n <div\n className=\"pointer-events-none absolute inset-0\"\n style={{\n background: `radial-gradient(ellipse 70% 55% at 15% 100%, color-mix(in oklch, var(--color-foreground) ${Math.round(overlayOpacity * 45)}%, transparent), transparent 70%)`,\n }}\n />\n {overlayType === \"solid\" && (\n <div\n className=\"bg-foreground pointer-events-none absolute inset-0\"\n style={{ opacity: overlayOpacity * 0.35 }}\n />\n )}\n </>\n )}\n </div>\n ) : (\n <EmptyHero accentColor={accentColor} textColor={textColor} />\n )}\n\n {/* Content */}\n <div className={`relative flex min-h-[440px] flex-col p-${padding}`}>\n {/* Top row: resource type eyebrow + optional price chip */}\n {(showResourceType && resourceDescriptor) || displayPrice ? (\n <div className=\"flex items-start justify-between gap-3\">\n {showResourceType && resourceDescriptor ? (\n (() => {\n const { icon: ResourceIcon, label } = resourceDescriptor;\n return (\n <span\n className={`inline-flex items-center gap-1.5 rounded-${borderRadius} bg-${textColor}/15 px-2.5 py-1 text-[10px] font-bold tracking-[0.18em] uppercase text-${textColor} backdrop-blur-sm`}\n style={{\n boxShadow: insetBorder(textColor, 15),\n }}\n >\n <ResourceIcon className=\"size-3\" />\n {label}\n </span>\n );\n })()\n ) : (\n <span />\n )}\n {displayPrice && (\n <span\n className={`inline-flex items-center rounded-${borderRadius} bg-${accentColor} px-2.5 py-1 text-[11px] font-bold tabular-nums text-${accentColor}-foreground`}\n style={{\n boxShadow: `0 4px 14px -4px color-mix(in oklch, var(--color-foreground) 30%, transparent)`,\n }}\n >\n {displayPrice}\n </span>\n )}\n </div>\n ) : null}\n\n {/* Middle: spacer that keeps share panel bottom-anchored.\n Optional title renders inside it without changing layout rhythm. */}\n <div className=\"mt-4 flex flex-1 flex-col justify-end\">\n {titleEnabled && displayTitle && (\n <h2\n className={`text-${titleFontSize} font-header leading-[1.12] font-bold tracking-[-0.015em] text-${titleColor}`}\n style={{\n // Themed via foreground so the legibility shadow flips with\n // the title color when the theme switches to dark mode.\n textShadow: showHeroImage\n ? `0 2px 12px color-mix(in oklch, var(--color-foreground) 40%, transparent)`\n : undefined,\n }}\n >\n {displayTitle}\n </h2>\n )}\n </div>\n\n {/* Bottom: share panel */}\n <div className=\"mt-6 flex flex-col gap-3\">\n <div className=\"flex items-stretch gap-3\">\n {/* QR card */}\n <div\n className={`group relative shrink-0 rounded-${borderRadius} bg-white p-2.5 transition-transform duration-300 hover:scale-[1.02]`}\n style={{\n // QR card stays white for scanner contrast; lift shadow is\n // themed via foreground so it reads in dark mode too.\n boxShadow: `0 4px 16px -4px color-mix(in oklch, var(--color-foreground) 25%, transparent), inset 0 0 0 1px rgba(255,255,255,0.4)`,\n }}\n aria-label=\"QR code for share link\"\n >\n <QRCodeSVG\n value={shareLink || \"https://example.com\"}\n size={96}\n level=\"H\"\n bgColor=\"#ffffff\"\n fgColor=\"#0f172a\"\n />\n </div>\n\n {/* URL chip + share actions rail */}\n <div className=\"flex min-w-0 flex-1 flex-col gap-2\">\n <span\n className={`text-[10px] font-bold tracking-[0.16em] uppercase text-${textColor}/70`}\n >\n Share link\n </span>\n <button\n type=\"button\"\n onClick={handleCopy}\n disabled={!hasShareLink}\n aria-label={\n copyState === \"copied\" ? \"Copied to clipboard\" : \"Copy link\"\n }\n className={`group flex items-center justify-between gap-2 rounded-${borderRadius} bg-${textColor}/10 px-3 py-2 text-left text-[12px] backdrop-blur-sm transition-all duration-300 hover:bg-${textColor}/15 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--quick-share-focus-ring)] disabled:opacity-50 ${copyState === \"copied\" ? `bg-${accentColor}/20` : \"\"}`}\n style={\n {\n \"--quick-share-focus-ring\": colorMix(accentColor, 40),\n boxShadow: insetBorder(textColor, 15),\n } as QuickShareCSSProperties\n }\n >\n <span\n className={`min-w-0 flex-1 truncate font-medium tabular-nums text-${textColor}`}\n >\n {hasShareLink ? (\n <>\n {showDomainPrefix && prefix && (\n <span className={`opacity-60`}>{prefix}</span>\n )}\n <span className=\"font-semibold\">{path}</span>\n </>\n ) : (\n <span className={`opacity-60`}>No link yet</span>\n )}\n </span>\n <span\n className={`flex size-7 shrink-0 items-center justify-center rounded-full transition-all duration-300 ${copyState === \"copied\" ? `bg-${accentColor} text-${accentColor}-foreground scale-110` : `bg-${textColor}/15 text-${textColor}`}`}\n >\n {copyState === \"copied\" ? (\n <Check className=\"size-3.5\" />\n ) : (\n <Copy className=\"size-3.5\" />\n )}\n </span>\n </button>\n <span className=\"sr-only\" aria-live=\"polite\" role=\"status\">\n {copyState === \"copied\" ? \"Copied to clipboard\" : \"\"}\n </span>\n\n {showShareActions && (\n <ShareActionRow\n shareLink={shareLink}\n displayTitle={displayTitle}\n accentColor={accentColor}\n textColor={textColor}\n borderRadius={borderRadius}\n onNative={handleNativeShare}\n />\n )}\n </div>\n </div>\n\n {shouldShowBuyButton &&\n (hasShareLink ? (\n <a\n href={shareLink}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className={`flex w-full items-center justify-center gap-2 rounded-${borderRadius} bg-${accentColor} px-4 py-3 text-[13px] font-bold text-${accentColor}-foreground transition-transform hover:scale-[1.01]`}\n style={{\n boxShadow: `0 8px 22px -8px color-mix(in oklch, var(--color-foreground) 35%, transparent)`,\n }}\n >\n <ShoppingCart className=\"size-4\" />\n <span>Buy now</span>\n </a>\n ) : (\n <button\n type=\"button\"\n disabled\n className={`flex w-full cursor-not-allowed items-center justify-center gap-2 rounded-${borderRadius} bg-${accentColor} px-4 py-3 text-[13px] font-bold text-${accentColor}-foreground opacity-50`}\n style={{\n boxShadow: `0 8px 22px -8px color-mix(in oklch, var(--color-foreground) 35%, transparent)`,\n }}\n >\n <ShoppingCart className=\"size-4\" />\n <span>Buy now</span>\n </button>\n ))}\n </div>\n </div>\n </div>\n );\n}\n\ntype ShareActionRowProps = {\n shareLink: string;\n displayTitle: string;\n accentColor: ColorOptions;\n textColor: ColorOptions;\n borderRadius: BorderRadiusOptions;\n onNative: () => void;\n};\n\nfunction ShareActionRow({\n shareLink,\n displayTitle,\n accentColor,\n textColor,\n borderRadius,\n onNative,\n}: ShareActionRowProps) {\n const disabled = !shareLink;\n const { canNativeShare, canSendSms } = useShareCapabilities();\n\n const emailHref = shareLink\n ? `mailto:?subject=${encodeURIComponent(displayTitle)}&body=${encodeURIComponent(shareLink)}`\n : undefined;\n const smsHref = shareLink\n ? `sms:?body=${encodeURIComponent(`${displayTitle} — ${shareLink}`)}`\n : undefined;\n\n return (\n <div className=\"flex items-center gap-1.5\">\n <ShareActionButton\n icon={Mail}\n label=\"Email\"\n href={emailHref}\n disabled={disabled}\n accentColor={accentColor}\n textColor={textColor}\n borderRadius={borderRadius}\n />\n {canSendSms && (\n <ShareActionButton\n icon={MessageCircle}\n label=\"Text\"\n href={smsHref}\n disabled={disabled}\n accentColor={accentColor}\n textColor={textColor}\n borderRadius={borderRadius}\n />\n )}\n {canNativeShare && (\n <ShareActionButton\n icon={Share2}\n label=\"Share\"\n onClick={onNative}\n disabled={disabled}\n accentColor={accentColor}\n textColor={textColor}\n borderRadius={borderRadius}\n />\n )}\n </div>\n );\n}\n\ntype ShareActionButtonProps = {\n icon: LucideIcon;\n label: string;\n href?: string | undefined;\n onClick?: () => void;\n disabled: boolean;\n accentColor: ColorOptions;\n textColor: ColorOptions;\n borderRadius: BorderRadiusOptions;\n};\n\nfunction ShareActionButton({\n icon: Icon,\n label,\n href,\n onClick,\n disabled,\n accentColor,\n textColor,\n borderRadius,\n}: ShareActionButtonProps) {\n const className = `group inline-flex items-center gap-1.5 rounded-${borderRadius} bg-${textColor}/10 px-2.5 py-1.5 text-[11px] font-semibold text-${textColor} backdrop-blur-sm transition-all duration-200 hover:-translate-y-0.5 hover:bg-${accentColor} hover:text-${accentColor}-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--quick-share-focus-ring)] disabled:cursor-not-allowed disabled:opacity-40 disabled:hover:translate-y-0`;\n const style: QuickShareCSSProperties = {\n \"--quick-share-focus-ring\": colorMix(accentColor, 40),\n boxShadow: insetBorder(textColor, 15),\n };\n\n const content = (\n <>\n <Icon className=\"size-3\" />\n <span>{label}</span>\n </>\n );\n\n if (href && !disabled) {\n return (\n <a href={href} className={className} style={style} aria-label={label}>\n {content}\n </a>\n );\n }\n\n return (\n <button\n type=\"button\"\n onClick={onClick}\n disabled={disabled}\n className={className}\n style={style}\n aria-label={label}\n >\n {content}\n </button>\n );\n}\n\nfunction EmptyHero({\n accentColor,\n textColor,\n}: {\n accentColor: ColorOptions;\n textColor: ColorOptions;\n}) {\n return (\n <div className={`bg-muted absolute inset-0`}>\n <div\n className=\"absolute inset-0\"\n style={{\n background: `radial-gradient(circle at 30% 20%, ${colorMix(accentColor, 15)}, transparent 60%), radial-gradient(circle at 80% 90%, ${colorMix(accentColor, 10)}, transparent 55%)`,\n }}\n />\n <div className=\"absolute inset-0 flex flex-col items-center justify-center gap-3\">\n <div\n className={`flex size-14 items-center justify-center rounded-2xl bg-${textColor}/5`}\n style={{ boxShadow: insetBorder(textColor, 10) }}\n >\n <ImageIcon className={`size-6 text-${textColor}/40`} />\n </div>\n <span\n className={`text-[10px] font-bold tracking-[0.2em] uppercase text-${textColor}/45`}\n >\n Nothing selected\n </span>\n </div>\n </div>\n );\n}\n\nexport const quickShareWidgetPropertySchema: WidgetPropertySchema = {\n widgetType: \"QuickShareWidget\",\n displayName: \"Quick Share Widget\",\n tabsConfig: [{ id: \"styling\", label: \"Styling\" }],\n fields: [\n // Content\n {\n key: \"shareableResource\",\n label: \"Shareable Content\",\n type: \"resource\",\n description: \"Select the content to generate a share link for\",\n allowedTypes: [\"Product\", \"Page\", \"EnrollmentPack\", \"Medium\", \"Library\"],\n tab: \"styling\",\n group: \"Content\",\n },\n\n // Title\n {\n key: \"titleEnabled\",\n label: \"Show Title\",\n type: \"boolean\",\n description: \"Display a title on the hero\",\n defaultValue: true,\n tab: \"styling\",\n group: \"Title\",\n },\n {\n key: \"titleText\",\n label: \"Title\",\n type: \"text\",\n description:\n \"Custom title text (defaults to the resource title if empty)\",\n defaultValue: \"\",\n tab: \"styling\",\n group: \"Title\",\n requiresKeyToBeTrue: \"titleEnabled\",\n },\n getFontSizeField({\n key: \"titleFontSize\",\n label: \"Title Font Size\",\n description: \"Font size for the title\",\n defaultValue: \"2xl\",\n tab: \"styling\",\n group: \"Title\",\n requiresKeyToBeTrue: \"titleEnabled\",\n }),\n getColorField({\n key: \"titleColor\",\n label: \"Title Color\",\n description: \"Color for the title\",\n defaultValue: \"background\",\n tab: \"styling\",\n group: \"Title\",\n requiresKeyToBeTrue: \"titleEnabled\",\n }),\n\n // Share panel polish (new)\n {\n key: \"showResourceType\",\n label: \"Show Resource Type Pill\",\n type: \"boolean\",\n description:\n \"Display a small type eyebrow chip (Product · Page · Media…)\",\n defaultValue: true,\n tab: \"styling\",\n group: \"Share Panel\",\n },\n {\n key: \"showShareActions\",\n label: \"Show Share Actions\",\n type: \"boolean\",\n description:\n \"Show Email, Text, and native Share buttons under the link chip\",\n defaultValue: true,\n tab: \"styling\",\n group: \"Share Panel\",\n },\n {\n key: \"showDomainPrefix\",\n label: \"Show Domain Prefix\",\n type: \"boolean\",\n description:\n \"Include the domain in the link chip (dimmed) with the path emphasized\",\n defaultValue: true,\n tab: \"styling\",\n group: \"Share Panel\",\n },\n {\n key: \"showBuyButton\",\n label: \"Show Buy Button\",\n type: \"boolean\",\n description: \"Display the Buy button (only shown for Product resources)\",\n defaultValue: false,\n tab: \"styling\",\n group: \"Share Panel\",\n },\n\n // Design\n getColorField({\n key: \"textColor\",\n label: \"Text Color\",\n description: \"Default text color for widget content (over the hero)\",\n defaultValue: \"background\",\n tab: \"styling\",\n group: \"Design\",\n }),\n getColorField({\n key: \"accentColor\",\n label: \"Accent Color\",\n description:\n \"Drives the price chip, primary button, and copy-success flash\",\n defaultValue: \"primary\",\n tab: \"styling\",\n group: \"Design\",\n }),\n {\n key: \"overlayEnabled\",\n label: \"Enable Overlay\",\n type: \"boolean\",\n description: \"Add editorial gradient stack for legibility over the hero\",\n defaultValue: true,\n tab: \"styling\",\n group: \"Design\",\n },\n {\n key: \"overlayType\",\n label: \"Overlay Type\",\n type: \"buttonGroup\",\n description:\n \"Gradient only (recommended) or gradient + solid wash (heavier)\",\n defaultValue: \"gradient\",\n options: [\n { label: \"Gradient\", value: \"gradient\" },\n { label: \"Solid\", value: \"solid\" },\n ],\n tab: \"styling\",\n group: \"Design\",\n requiresKeyToBeTrue: \"overlayEnabled\",\n },\n {\n key: \"overlayIntensity\",\n label: \"Overlay Intensity\",\n type: \"slider\",\n description: \"Opacity of the overlay (0-100)\",\n min: 0,\n max: 100,\n step: 5,\n defaultValue: 70,\n unit: \"%\",\n tab: \"styling\",\n group: \"Design\",\n requiresKeyToBeTrue: \"overlayEnabled\",\n },\n {\n key: \"separator\",\n type: \"separator\",\n label: \"Separator\",\n tab: \"styling\",\n group: \"Design\",\n },\n getPaddingField({\n key: \"padding\",\n label: \"Padding\",\n description: \"Padding around the widget content\",\n defaultValue: 6,\n tab: \"styling\",\n group: \"Design\",\n }),\n getBorderRadiusField({\n key: \"borderRadius\",\n label: \"Border Radius\",\n description: \"Border radius for the widget container\",\n defaultValue: \"xl\",\n tab: \"styling\",\n group: \"Design\",\n }),\n getBorderWidthField({\n key: \"borderWidth\",\n label: \"Border Width\",\n description: \"Border width for the widget container\",\n defaultValue: \"none\",\n tab: \"styling\",\n group: \"Design\",\n }),\n getBorderColorField({\n key: \"borderColor\",\n label: \"Border Color\",\n description: \"Border color for the widget container\",\n defaultValue: \"muted\",\n tab: \"styling\",\n group: \"Design\",\n }),\n ],\n} as const satisfies WidgetPropertySchema;\n"],"mappings":";;;;;;;;;;;AAoFA,MAAM,oBAAwD;CAC5D,SAAS;EAAE,OAAO;EAAW,MAAM;EAAS;CAC5C,MAAM;EAAE,OAAO;EAAQ,MAAM;EAAU;CACvC,gBAAgB;EAAE,OAAO;EAAc,MAAM;EAAQ;CACrD,QAAQ;EAAE,OAAO;EAAS,MAAMA;EAAW;CAC3C,SAAS;EAAE,OAAO;EAAW,MAAM;EAAU;CAC9C;AAED,MAAM,yBACJ,aAC8B;CAC9B,MAAM,UAAW,UAAU,QAAQ,UAAU,iBAAiB;AAC9D,KAAI,CAAC,QAAS,QAAO;AACrB,QAAO,kBAAkB,YAAY;EAAE,OAAO;EAAS,MAAM;EAAW;;AAG1E,MAAM,YAAY,QAAkD;AAClE,KAAI;EACF,MAAM,SAAS,IAAI,IAAI,IAAI;AAC3B,SAAO;GACL,QAAQ,GAAG,OAAO,SAAS,IAAI,OAAO;GACtC,MAAM,GAAG,OAAO,WAAW,OAAO,SAAS,OAAO;GACnD;SACK;AACN,SAAO;GAAE,QAAQ;GAAI,MAAM;GAAK;;;AAIpC,MAAM,sBAAsB;CAC1B;CACA;CACA;CACA;CACA;CACD;AAED,MAAM,uBACJ,aACkB;AAClB,KAAI,CAAC,SAAU,QAAO;AACtB,MAAK,MAAM,OAAO,qBAAqB;EACrC,MAAM,QAAQ,SAAS;AAC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AAC;EACF,cAAc;GACZ,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACP,qBAAqB;GACtB,CAAC;EAGF;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aACE;GACF,cAAc;GACd,KAAK;GACL,OAAO;GACR;EACD;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aACE;GACF,cAAc;GACd,KAAK;GACL,OAAO;GACR;EACD;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aACE;GACF,cAAc;GACd,KAAK;GACL,OAAO;GACR;EACD;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR;EAGD,cAAc;GACZ,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EACF,cAAc;GACZ,KAAK;GACL,OAAO;GACP,aACE;GACF,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EACF;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR;EACD;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aACE;GACF,cAAc;GACd,SAAS,CACP;IAAE,OAAO;IAAY,OAAO;IAAY,EACxC;IAAE,OAAO;IAAS,OAAO;IAAS,CACnC;GACD,KAAK;GACL,OAAO;GACP,qBAAqB;GACtB;EACD;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,KAAK;GACL,KAAK;GACL,MAAM;GACN,cAAc;GACd,MAAM;GACN,KAAK;GACL,OAAO;GACP,qBAAqB;GACtB;EACD;GACE,KAAK;GACL,MAAM;GACN,OAAO;GACP,KAAK;GACL,OAAO;GACR;EACD,gBAAgB;GACd,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EACF,qBAAqB;GACnB,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EACF,oBAAoB;GAClB,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EACF,oBAAoB;GAClB,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EACH;CACF"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as useDataSourceRegistryConfig } from "./registry-context-
|
|
3
|
-
import { i as useWidgetsApi, n as useWidgetPreviewContext, t as ErrorState } from "./error-state
|
|
4
|
-
import { i as getBorderColorField, l as getColorField, m as getPaddingField, n as borderWidthClasses, o as getBorderRadiusField, s as getBorderWidthField, t as borderColorClasses, u as getFontSizeField } from "./registries-
|
|
1
|
+
import { I as __exportAll } from "./portal_tenant_content-DPLnrtOG.mjs";
|
|
2
|
+
import { n as useDataSourceRegistryConfig } from "./registry-context-Bc-2fQnr.mjs";
|
|
3
|
+
import { i as useWidgetsApi, n as useWidgetPreviewContext, t as ErrorState } from "./error-state--Z2OlDFr.mjs";
|
|
4
|
+
import { i as getBorderColorField, l as getColorField, m as getPaddingField, n as borderWidthClasses, o as getBorderRadiusField, s as getBorderWidthField, t as borderColorClasses, u as getFontSizeField } from "./registries-kvRRUHcO.mjs";
|
|
5
5
|
import { useEffect, useMemo, useState } from "react";
|
|
6
6
|
import { useQuery } from "@tanstack/react-query";
|
|
7
7
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -561,4 +561,4 @@ const recentActivityWidgetPropertySchema = {
|
|
|
561
561
|
//#endregion
|
|
562
562
|
export { RecentActivityWidget_exports as n, recentActivityWidgetPropertySchema as r, RecentActivityWidget as t };
|
|
563
563
|
|
|
564
|
-
//# sourceMappingURL=RecentActivityWidget-
|
|
564
|
+
//# sourceMappingURL=RecentActivityWidget-Rpj33TiN.mjs.map
|
package/dist/{RecentActivityWidget-D1AlZgfV.mjs.map → RecentActivityWidget-Rpj33TiN.mjs.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RecentActivityWidget-D1AlZgfV.mjs","names":[],"sources":["../../widgets/src/hooks/use-activities.preview.ts","../../widgets/src/hooks/use-activities.ts","../../widgets/src/widgets/RecentActivityWidget.tsx"],"sourcesContent":["import type { Activity } from \"@fluid-app/portal-core/widgets-api-types\";\n\nconst now = new Date();\n\nfunction minutesAgo(minutes: number): string {\n return new Date(now.getTime() - minutes * 60_000).toISOString();\n}\n\nexport const PREVIEW_DATA: Activity[] = [\n {\n id: 1,\n userName: \"Sarah Johnson\",\n avatarUrl: null,\n activityType: \"Order Placed\",\n targetName: \"Wellness Starter Kit\",\n timestamp: minutesAgo(12),\n slug: \"order_placed\",\n },\n {\n id: 2,\n userName: \"Mike Chen\",\n avatarUrl: null,\n activityType: \"New Lead\",\n targetName: \"Signed up from Instagram link\",\n timestamp: minutesAgo(45),\n slug: \"new_lead\",\n },\n {\n id: 3,\n userName: \"Visitor from Austin, TX\",\n avatarUrl: null,\n activityType: \"Page Views\",\n targetName: \"Viewed product catalog (3 pages)\",\n timestamp: minutesAgo(90),\n slug: \"page_views\",\n },\n {\n id: 4,\n userName: \"Lisa Park\",\n avatarUrl: null,\n activityType: \"Video Complete\",\n targetName: \"Watched: Getting Started Guide\",\n timestamp: minutesAgo(180),\n slug: \"video_complete\",\n },\n];\n","import { useQuery, type UseQueryResult } from \"@tanstack/react-query\";\nimport { useWidgetsApi } from \"@fluid-app/portal-core/widgets-api-context\";\nimport { useWidgetPreviewContext } from \"@fluid-app/portal-react/data-sources/preview-context\";\nimport { useDataSourceRegistryConfig } from \"@fluid-app/portal-react/data-sources/registry-context\";\nimport { PREVIEW_DATA } from \"./use-activities.preview\";\nimport type { Activity } from \"@fluid-app/portal-core/widgets-api-types\";\n\nexport type {\n Activity,\n ActivitySlug,\n} from \"@fluid-app/portal-core/widgets-api-types\";\n\nexport function useActivities(): UseQueryResult<Activity[], Error> {\n const widgetsApi = useWidgetsApi();\n const { isPreview } = useWidgetPreviewContext();\n const { baseUrl } = useDataSourceRegistryConfig();\n\n return useQuery({\n queryKey: [\n \"portal-widget-use\",\n \"activities\",\n isPreview ? \"preview\" : baseUrl,\n ] as const,\n queryFn: ({ signal }) => widgetsApi.fetchActivities(signal),\n enabled: !isPreview,\n ...(isPreview && { placeholderData: PREVIEW_DATA }),\n });\n}\n","import { useEffect, useMemo, useState, type ComponentProps } from \"react\";\nimport type React from \"react\";\nimport type {\n BackgroundValue,\n BorderRadiusOptions,\n BorderWidthOptions,\n ColorOptions,\n FontSizeOptions,\n PaddingOptions,\n} from \"@fluid-app/portal-core/types\";\nimport type { WidgetPropertySchema } from \"@fluid-app/portal-core/registries\";\nimport {\n borderColorClasses,\n borderWidthClasses,\n getBorderColorField,\n getBorderRadiusField,\n getBorderWidthField,\n getColorField,\n getFontSizeField,\n getPaddingField,\n} from \"../core/fields\";\nimport {\n useActivities,\n type Activity,\n type ActivitySlug,\n} from \"../hooks/use-activities\";\nimport { ErrorState } from \"../components/error-state\";\nimport {\n AudioWaveform,\n Bell,\n Calendar,\n CheckSquare,\n Eye,\n MessageCircle,\n Play,\n ShoppingCart,\n Star,\n Trophy,\n User,\n UserPlus,\n type LucideIcon,\n} from \"lucide-react\";\n\n// ---------- helpers ----------\n\nconst RELATIVE_TIME_REFRESH_MS = 60_000;\nconst DEFAULT_MAX_ITEMS_TO_SHOW = 6;\nconst MAX_ITEMS_TO_SHOW_LIMIT = 20;\n\nconst ACTIVITY_ICON_MAP: Record<ActivitySlug, LucideIcon> = {\n order_placed: ShoppingCart,\n abandoned_cart: ShoppingCart,\n cart_items_added: ShoppingCart,\n new_cart_items_added: ShoppingCart,\n direct_message: MessageCircle,\n comment_reply: MessageCircle,\n message_received: MessageCircle,\n message_sent: MessageCircle,\n video: Play,\n video_complete: Play,\n video_contact: Play,\n video_complete_contact: Play,\n new_lead: UserPlus,\n page_views_contact: UserPlus,\n smart_link_clicked: UserPlus,\n page_views: Eye,\n upcoming_event: Calendar,\n review_left: Star,\n tasks: CheckSquare,\n announcements: Bell,\n fantasy_point: Trophy,\n};\n\nconst getActivityIcon = (slug: ActivitySlug): LucideIcon =>\n ACTIVITY_ICON_MAP[slug] ?? User;\n\nconst formatAbsoluteTime = (timestamp: string): string =>\n new Date(timestamp).toLocaleTimeString(\"en-US\", {\n hour: \"numeric\",\n minute: \"2-digit\",\n hour12: true,\n });\n\nconst formatRelativeTime = (timestamp: string, now: number): string => {\n const then = new Date(timestamp).getTime();\n const diffSec = Math.max(0, Math.round((now - then) / 1000));\n\n if (diffSec < 60) return \"now\";\n const diffMin = Math.floor(diffSec / 60);\n if (diffMin < 60) return `${diffMin}m`;\n const diffHr = Math.floor(diffMin / 60);\n if (diffHr < 24) return `${diffHr}h`;\n const diffDay = Math.floor(diffHr / 24);\n if (diffDay < 7) return `${diffDay}d`;\n return new Date(timestamp).toLocaleDateString(\"en-US\", {\n month: \"short\",\n day: \"numeric\",\n });\n};\n\nconst toLocalDateKey = (date: Date): string => {\n const year = date.getFullYear();\n const month = String(date.getMonth() + 1).padStart(2, \"0\");\n const day = String(date.getDate()).padStart(2, \"0\");\n return `${year}-${month}-${day}`;\n};\n\nconst formatDateHeader = (timestamp: string, nowMs: number): string => {\n const date = new Date(timestamp);\n if (!Number.isFinite(date.getTime())) return timestamp;\n\n const now = new Date(nowMs);\n const yesterday = new Date(now);\n yesterday.setDate(now.getDate() - 1);\n\n const todayKey = toLocalDateKey(now);\n const yesterdayKey = toLocalDateKey(yesterday);\n const dateKey = toLocalDateKey(date);\n\n if (dateKey === todayKey) return \"Today\";\n if (dateKey === yesterdayKey) return \"Yesterday\";\n return date.toLocaleDateString(\"en-US\", {\n month: \"long\",\n day: \"numeric\",\n });\n};\n\nconst getDateKey = (timestamp: string): string => {\n const date = new Date(timestamp);\n if (!Number.isFinite(date.getTime())) return timestamp;\n return toLocalDateKey(date);\n};\n\nconst getColorCssValue = (color: ColorOptions): string =>\n color === \"transparent\" ? \"transparent\" : `var(--color-${color})`;\n\nconst normalizeMaxItemsToShow = (value: number): number => {\n if (!Number.isFinite(value)) return DEFAULT_MAX_ITEMS_TO_SHOW;\n return Math.min(MAX_ITEMS_TO_SHOW_LIMIT, Math.max(1, Math.floor(value)));\n};\n\nconst shouldRenderEyebrow = (\n showEyebrow: boolean,\n titleText: string,\n): boolean =>\n showEyebrow && titleText.trim().toLowerCase() !== \"recent activity\";\n\nconst isUnknownUser = (name: string | undefined): boolean => {\n if (!name) return true;\n const lower = name.trim().toLowerCase();\n if (!lower) return true;\n return (\n lower === \"unknown\" ||\n lower.includes(\"unknown visitor\") ||\n lower === \"anonymous\" ||\n lower === \"guest\"\n );\n};\n\nconst getInitials = (name: string | undefined): string => {\n if (!name) return \"\";\n const parts = name.trim().split(/\\s+/).slice(0, 2);\n return parts.map((p) => p[0]?.toUpperCase() ?? \"\").join(\"\");\n};\n\n// ---------- avatar ----------\n\ntype AvatarProps = {\n activity: Activity;\n textColor: ColorOptions;\n accentColor: ColorOptions;\n surfaceColor: ColorOptions;\n showTypeBadge: boolean;\n};\n\nfunction Avatar({\n activity,\n textColor,\n accentColor,\n surfaceColor,\n showTypeBadge,\n}: AvatarProps) {\n const TypeIcon = getActivityIcon(activity.slug);\n const unknown = isUnknownUser(activity.userName);\n const initials = unknown ? \"\" : getInitials(activity.userName);\n // 3-tier fallback: image → initials → person icon. If avatarUrl 404s or\n // fails to decode, flip to the next tier instead of showing a broken image.\n const [failedAvatarUrl, setFailedAvatarUrl] = useState<string | null>(null);\n const avatarUrl = activity.avatarUrl;\n const showImage = Boolean(avatarUrl) && failedAvatarUrl !== avatarUrl;\n\n return (\n <div className=\"relative shrink-0\">\n {showImage ? (\n <img\n src={avatarUrl ?? undefined}\n alt={unknown ? \"\" : activity.userName}\n width={36}\n height={36}\n loading=\"lazy\"\n onError={() => setFailedAvatarUrl(avatarUrl)}\n className=\"size-9 rounded-full object-cover\"\n style={{\n boxShadow: `inset 0 0 0 1px color-mix(in oklch, var(--color-${textColor}) 10%, transparent)`,\n }}\n />\n ) : initials ? (\n <div\n className={`flex size-9 items-center justify-center rounded-full text-[11px] font-bold tracking-[0.04em] text-${textColor}/80`}\n style={{\n background: `color-mix(in oklch, var(--color-${accentColor}) 12%, transparent)`,\n boxShadow: `inset 0 0 0 1px color-mix(in oklch, var(--color-${textColor}) 10%, transparent)`,\n }}\n aria-label={activity.userName}\n >\n {initials}\n </div>\n ) : (\n <div\n className={`flex size-9 items-center justify-center rounded-full`}\n style={{\n background: `color-mix(in oklch, var(--color-${textColor}) 5%, transparent)`,\n boxShadow: `inset 0 0 0 1px color-mix(in oklch, var(--color-${textColor}) 10%, transparent)`,\n }}\n aria-label=\"Unknown visitor\"\n >\n <User className={`size-3.5 text-${textColor}/55`} />\n </div>\n )}\n\n {/* Type badge — shows what kind of event, regardless of avatar kind. */}\n {showTypeBadge && (\n <span\n className={`bg-${accentColor} text-${accentColor}-foreground absolute -right-0.5 -bottom-0.5 flex size-4 items-center justify-center rounded-full`}\n style={{\n boxShadow: `0 0 0 2px ${getColorCssValue(surfaceColor)}`,\n }}\n aria-hidden=\"true\"\n >\n <TypeIcon style={{ width: 8, height: 8 }} />\n </span>\n )}\n </div>\n );\n}\n\n// ---------- activity row ----------\n\ntype ActivityRowProps = {\n activity: Activity;\n accentColor: ColorOptions;\n textColor: ColorOptions;\n surfaceColor: ColorOptions;\n showRelativeTime: boolean;\n nowMs: number;\n};\n\nfunction ActivityRow({\n activity,\n accentColor,\n textColor,\n surfaceColor,\n showRelativeTime,\n nowMs,\n}: ActivityRowProps) {\n const timeText = showRelativeTime\n ? formatRelativeTime(activity.timestamp, nowMs)\n : formatAbsoluteTime(activity.timestamp);\n\n const absoluteTooltip = new Date(activity.timestamp).toLocaleString(\"en-US\", {\n weekday: \"short\",\n month: \"short\",\n day: \"numeric\",\n hour: \"numeric\",\n minute: \"2-digit\",\n });\n\n return (\n <li\n role=\"article\"\n className=\"relative flex items-start gap-3 rounded-md px-2 py-2\"\n >\n <Avatar\n activity={activity}\n textColor={textColor}\n accentColor={accentColor}\n surfaceColor={surfaceColor}\n showTypeBadge\n />\n\n <div className=\"flex min-w-0 flex-1 flex-col\">\n <div className=\"flex items-baseline gap-2\">\n <p\n className={`min-w-0 flex-1 truncate text-[13px] leading-tight font-semibold text-${textColor}`}\n >\n {activity.activityType}\n </p>\n <span\n title={absoluteTooltip}\n className={`shrink-0 font-mono text-[10px] font-medium tabular-nums text-${textColor}/45`}\n >\n {timeText}\n </span>\n </div>\n <p\n className={`mt-0.5 truncate text-[12px] leading-snug text-${textColor}/65`}\n >\n <span className={`font-semibold text-${textColor}/85`}>\n {activity.userName}\n </span>\n {activity.targetName && (\n <>\n <span className={`mx-1 text-${textColor}/35`}>·</span>\n <span>{activity.targetName}</span>\n </>\n )}\n </p>\n </div>\n </li>\n );\n}\n\n// ---------- widget ----------\n\ntype RecentActivityWidgetProps = ComponentProps<\"div\"> & {\n titleEnabled?: boolean;\n titleText?: string;\n titleFontSize?: FontSizeOptions;\n titleColor?: ColorOptions;\n\n background?: BackgroundValue;\n textColor?: ColorOptions;\n accentColor?: ColorOptions;\n padding?: PaddingOptions;\n borderRadius?: BorderRadiusOptions;\n borderWidth?: BorderWidthOptions;\n borderColor?: ColorOptions;\n\n maxItemsToShow?: number;\n\n // Polish (additive)\n showTimeline?: boolean;\n showRelativeTime?: boolean;\n showCountChip?: boolean;\n showEyebrow?: boolean;\n};\n\nfunction useRelativeTimeNow(): number {\n const [nowMs, setNowMs] = useState(() => Date.now());\n\n useEffect(() => {\n const timer = window.setInterval(() => {\n setNowMs(Date.now());\n }, RELATIVE_TIME_REFRESH_MS);\n\n return () => window.clearInterval(timer);\n }, []);\n\n return nowMs;\n}\n\nexport function RecentActivityWidget({\n titleEnabled = true,\n titleText = \"Activity\",\n titleFontSize = \"xl\",\n titleColor = \"foreground\",\n\n background = { type: \"solid\", color: \"background\" },\n textColor = \"foreground\",\n accentColor = \"primary\",\n padding = 4,\n borderRadius = \"md\",\n borderWidth = \"thin\",\n borderColor = \"muted\",\n\n maxItemsToShow = 6,\n\n showTimeline = true,\n showRelativeTime = true,\n showCountChip = true,\n showEyebrow = true,\n\n className,\n ...props\n}: RecentActivityWidgetProps): React.JSX.Element {\n const backgroundColor = background.color || \"background\";\n const backgroundImage =\n (background.resource?.image_url || background.resource?.imageUrl) &&\n background.type === \"image\"\n ? `url(${background.resource.image_url || background.resource.imageUrl})`\n : \"none\";\n\n const { data: activities = [], isLoading, isError } = useActivities();\n const nowMs = useRelativeTimeNow();\n const maxVisibleItems = normalizeMaxItemsToShow(maxItemsToShow);\n\n const activitiesToShow = useMemo(() => {\n if (activities.length === 0)\n return [] as { date: string; items: Activity[] }[];\n const groups = new Map<string, Activity[]>();\n for (const activity of activities.slice(0, maxVisibleItems)) {\n const key = getDateKey(activity.timestamp);\n const existing = groups.get(key);\n if (existing) existing.push(activity);\n else groups.set(key, [activity]);\n }\n return Array.from(groups.entries()).map(([key, items]) => ({\n // `key` is only a defensive fallback; every group is created with at\n // least one activity, so the item timestamp is what normally labels it.\n date: formatDateHeader(items[0]?.timestamp ?? key, nowMs),\n items,\n }));\n }, [activities, maxVisibleItems, nowMs]);\n\n const totalCount = Math.min(activities.length, maxVisibleItems);\n\n return (\n <div\n className={`@container overflow-hidden rounded-${borderRadius} bg-${backgroundColor} text-${textColor} ${borderWidthClasses[borderWidth]} ${borderWidth !== \"none\" ? borderColorClasses[borderColor] : \"\"} ${className ?? \"\"}`}\n style={{\n backgroundImage,\n // Soft ambient lift derived from theme tokens. The configured border\n // props own the crisp outline so saved border settings stay intact.\n boxShadow: `0 1px 2px color-mix(in oklch, var(--color-foreground) 4%, transparent), 0 14px 32px -20px color-mix(in oklch, var(--color-foreground) 14%, transparent)`,\n }}\n {...props}\n >\n <div className={`p-${padding} flex flex-col`}>\n {/* Header */}\n {titleEnabled && titleText && (\n <div className=\"mb-4 flex items-end justify-between gap-3\">\n <div className=\"flex min-w-0 flex-col\">\n {shouldRenderEyebrow(showEyebrow, titleText) && (\n <span\n className={`text-[10px] font-bold tracking-[0.2em] uppercase text-${textColor}/55`}\n >\n Recent\n </span>\n )}\n <h2\n className={`mt-0.5 text-${titleFontSize} leading-tight font-bold tracking-[-0.015em] text-${titleColor}`}\n >\n {titleText}\n </h2>\n </div>\n {!isLoading && !isError && showCountChip && totalCount > 0 && (\n <span\n className={`inline-flex shrink-0 items-center gap-1.5 rounded-full bg-${accentColor}/10 px-2 py-1 text-[10px] font-bold tracking-[0.06em] text-${accentColor}`}\n >\n <span\n aria-hidden=\"true\"\n className={`size-1.5 rounded-full bg-${accentColor}`}\n />\n {totalCount} {totalCount === 1 ? \"update\" : \"updates\"}\n </span>\n )}\n </div>\n )}\n\n {/* States */}\n {isLoading ? (\n <ActivitySkeleton\n textColor={textColor}\n showTimeline={showTimeline}\n rowCount={maxVisibleItems}\n />\n ) : isError ? (\n <ErrorState />\n ) : activities.length === 0 ? (\n <EmptyState textColor={textColor} accentColor={accentColor} />\n ) : (\n /* Feed */\n <div role=\"feed\" className=\"flex flex-col gap-3\">\n {activitiesToShow.map((group, groupIdx) => (\n <section\n key={`${group.date}-${groupIdx}`}\n className=\"flex flex-col gap-1\"\n >\n <header className=\"flex items-center gap-2 px-2\">\n <span\n className={`text-[10px] font-bold tracking-[0.18em] uppercase text-${textColor}/55`}\n >\n {group.date}\n </span>\n <span\n aria-hidden=\"true\"\n className=\"h-px flex-1\"\n style={{\n background: `color-mix(in oklch, var(--color-${textColor}) 8%, transparent)`,\n }}\n />\n </header>\n\n <ul className=\"relative flex flex-col\">\n {/* Single continuous spine — anchored to the first and last\n avatar centers. Avatar is size-9 (36px), inside a li with\n px-2 py-2 (8px padding). So avatar center = 8 + 18 = 26px\n from the edges, which is also where the spine lives. */}\n {showTimeline && group.items.length > 1 && (\n <span\n aria-hidden=\"true\"\n className=\"pointer-events-none absolute top-[26px] bottom-[26px] left-[26px] w-px\"\n style={{\n background: `color-mix(in oklch, var(--color-${textColor}) 10%, transparent)`,\n }}\n />\n )}\n {group.items.map((activity) => (\n <ActivityRow\n key={activity.id}\n activity={activity}\n accentColor={accentColor}\n textColor={textColor}\n surfaceColor={backgroundColor}\n showRelativeTime={showRelativeTime}\n nowMs={nowMs}\n />\n ))}\n </ul>\n </section>\n ))}\n </div>\n )}\n </div>\n </div>\n );\n}\n\n// ---------- empty state ----------\n\ntype EmptyStateProps = {\n textColor: ColorOptions;\n accentColor: ColorOptions;\n};\n\nfunction EmptyState({ textColor, accentColor }: EmptyStateProps) {\n return (\n <div className=\"flex flex-col items-center justify-center gap-3 px-4 py-10\">\n <div\n className=\"relative flex size-12 items-center justify-center rounded-full\"\n style={{\n background: `color-mix(in oklch, var(--color-${accentColor}) 10%, transparent)`,\n boxShadow: `inset 0 0 0 1px color-mix(in oklch, var(--color-${textColor}) 8%, transparent)`,\n }}\n >\n <AudioWaveform className={`size-5 text-${accentColor}/80`} />\n </div>\n <div className=\"flex flex-col items-center gap-1\">\n <p className={`text-[13px] font-semibold text-${textColor}/80`}>\n No activity yet\n </p>\n <p\n className={`max-w-[24ch] text-center text-[11px] leading-snug text-${textColor}/55`}\n >\n Orders, messages, views and leads will show up here as they happen.\n </p>\n </div>\n </div>\n );\n}\n\n// ---------- skeleton ----------\n\ntype ActivitySkeletonProps = {\n textColor: ColorOptions;\n showTimeline: boolean;\n rowCount: number;\n};\n\nfunction ActivitySkeleton({\n textColor,\n showTimeline,\n rowCount,\n}: ActivitySkeletonProps) {\n return (\n <div className=\"relative flex flex-col\" aria-busy=\"true\">\n {showTimeline && (\n <span\n aria-hidden=\"true\"\n className=\"pointer-events-none absolute top-[26px] bottom-[26px] left-[26px] w-px\"\n style={{\n background: `color-mix(in oklch, var(--color-${textColor}) 10%, transparent)`,\n }}\n />\n )}\n {Array.from({ length: rowCount }, (_, i) => i).map((i) => (\n <div\n key={i}\n className=\"relative flex items-start gap-3 rounded-md px-2 py-2\"\n >\n <div\n className={`size-9 shrink-0 animate-pulse rounded-full bg-${textColor}/10`}\n />\n <div className=\"flex min-w-0 flex-1 flex-col gap-1.5\">\n <div\n className={`h-2 w-2/3 animate-pulse rounded-full bg-${textColor}/10`}\n />\n <div\n className={`h-2 w-1/2 animate-pulse rounded-full bg-${textColor}/10`}\n />\n </div>\n </div>\n ))}\n </div>\n );\n}\n\n// ---------- schema ----------\n\nexport const recentActivityWidgetPropertySchema: WidgetPropertySchema = {\n widgetType: \"RecentActivityWidget\",\n displayName: \"Recent Activity Widget\",\n tabsConfig: [{ id: \"styling\", label: \"Styling\" }],\n fields: [\n // Title\n {\n key: \"titleEnabled\",\n label: \"Widget Title\",\n type: \"boolean\",\n description: \"Display the title and eyebrow above the feed\",\n defaultValue: true,\n tab: \"styling\",\n group: \"Title\",\n },\n {\n key: \"titleText\",\n label: \"Title\",\n type: \"text\",\n description: \"Title text displayed above the activity feed\",\n defaultValue: \"Activity\",\n tab: \"styling\",\n group: \"Title\",\n requiresKeyToBeTrue: \"titleEnabled\",\n },\n getFontSizeField({\n key: \"titleFontSize\",\n label: \"Title Font Size\",\n description: \"Font size for the widget title\",\n defaultValue: \"xl\",\n tab: \"styling\",\n group: \"Title\",\n requiresKeyToBeTrue: \"titleEnabled\",\n }),\n getColorField({\n key: \"titleColor\",\n label: \"Title Color\",\n description: \"Color for the widget title\",\n defaultValue: \"foreground\",\n tab: \"styling\",\n group: \"Title\",\n requiresKeyToBeTrue: \"titleEnabled\",\n }),\n {\n key: \"showEyebrow\",\n label: \"Show 'RECENT' Eyebrow\",\n type: \"boolean\",\n description: \"Small uppercase label above the title\",\n defaultValue: true,\n tab: \"styling\",\n group: \"Title\",\n requiresKeyToBeTrue: \"titleEnabled\",\n },\n {\n key: \"showCountChip\",\n label: \"Show Updates Count Chip\",\n type: \"boolean\",\n description: \"Accent pill next to the title showing how many updates\",\n defaultValue: true,\n tab: \"styling\",\n group: \"Title\",\n requiresKeyToBeTrue: \"titleEnabled\",\n },\n\n // Feed\n {\n key: \"maxItemsToShow\",\n label: \"Max Items\",\n type: \"number\",\n description: \"Maximum number of activity items to display\",\n defaultValue: DEFAULT_MAX_ITEMS_TO_SHOW,\n min: 1,\n max: MAX_ITEMS_TO_SHOW_LIMIT,\n step: 1,\n tab: \"styling\",\n group: \"Feed\",\n },\n {\n key: \"showTimeline\",\n label: \"Timeline Spine\",\n type: \"boolean\",\n description: \"Draw a vertical line connecting activity avatars\",\n defaultValue: true,\n tab: \"styling\",\n group: \"Feed\",\n },\n {\n key: \"showRelativeTime\",\n label: \"Relative Timestamps\",\n type: \"boolean\",\n description: \"Show 'now / 2m / 1h / 3d' instead of absolute times\",\n defaultValue: true,\n tab: \"styling\",\n group: \"Feed\",\n },\n\n // Design\n {\n type: \"background\",\n key: \"background\",\n label: \"Background\",\n description: \"Background for the widget container\",\n defaultValue: \"background\",\n tab: \"styling\",\n group: \"Design\",\n },\n getColorField({\n key: \"textColor\",\n label: \"Text Color\",\n description: \"Default text color for activity content\",\n defaultValue: \"foreground\",\n tab: \"styling\",\n group: \"Design\",\n }),\n getColorField({\n key: \"accentColor\",\n label: \"Accent Color\",\n description:\n \"Drives the count chip, type badge, initials avatar, and empty-state icon\",\n defaultValue: \"primary\",\n tab: \"styling\",\n group: \"Design\",\n }),\n {\n key: \"separator\",\n type: \"separator\",\n label: \"Separator\",\n tab: \"styling\",\n group: \"Design\",\n },\n getPaddingField({\n key: \"padding\",\n label: \"Padding\",\n description: \"Padding around the widget container\",\n defaultValue: 4,\n tab: \"styling\",\n group: \"Design\",\n }),\n getBorderRadiusField({\n key: \"borderRadius\",\n label: \"Border Radius\",\n description: \"Border radius for the widget container\",\n defaultValue: \"md\",\n tab: \"styling\",\n group: \"Design\",\n }),\n getBorderWidthField({\n key: \"borderWidth\",\n label: \"Border Width\",\n description: \"Border width for the widget container\",\n defaultValue: \"thin\",\n tab: \"styling\",\n group: \"Design\",\n }),\n getBorderColorField({\n key: \"borderColor\",\n label: \"Border Color\",\n description: \"Border color for the widget container\",\n defaultValue: \"muted\",\n tab: \"styling\",\n group: \"Design\",\n }),\n ],\n} as const satisfies WidgetPropertySchema;\n"],"mappings":";;;;;;;;;AAEA,MAAM,sBAAM,IAAI,MAAM;AAEtB,SAAS,WAAW,SAAyB;AAC3C,yBAAO,IAAI,KAAK,IAAI,SAAS,GAAG,UAAU,IAAO,EAAC,aAAa;;AAGjE,MAAa,eAA2B;CACtC;EACE,IAAI;EACJ,UAAU;EACV,WAAW;EACX,cAAc;EACd,YAAY;EACZ,WAAW,WAAW,GAAG;EACzB,MAAM;EACP;CACD;EACE,IAAI;EACJ,UAAU;EACV,WAAW;EACX,cAAc;EACd,YAAY;EACZ,WAAW,WAAW,GAAG;EACzB,MAAM;EACP;CACD;EACE,IAAI;EACJ,UAAU;EACV,WAAW;EACX,cAAc;EACd,YAAY;EACZ,WAAW,WAAW,GAAG;EACzB,MAAM;EACP;CACD;EACE,IAAI;EACJ,UAAU;EACV,WAAW;EACX,cAAc;EACd,YAAY;EACZ,WAAW,WAAW,IAAI;EAC1B,MAAM;EACP;CACF;;;ACjCD,SAAgB,gBAAmD;CACjE,MAAM,aAAa,eAAe;CAClC,MAAM,EAAE,cAAc,yBAAyB;CAC/C,MAAM,EAAE,YAAY,6BAA6B;AAEjD,QAAO,SAAS;EACd,UAAU;GACR;GACA;GACA,YAAY,YAAY;GACzB;EACD,UAAU,EAAE,aAAa,WAAW,gBAAgB,OAAO;EAC3D,SAAS,CAAC;EACV,GAAI,aAAa,EAAE,iBAAiB,cAAc;EACnD,CAAC;;;;;;;;ACmBJ,MAAM,2BAA2B;AACjC,MAAM,4BAA4B;AAClC,MAAM,0BAA0B;AAEhC,MAAM,oBAAsD;CAC1D,cAAc;CACd,gBAAgB;CAChB,kBAAkB;CAClB,sBAAsB;CACtB,gBAAgB;CAChB,eAAe;CACf,kBAAkB;CAClB,cAAc;CACd,OAAO;CACP,gBAAgB;CAChB,eAAe;CACf,wBAAwB;CACxB,UAAU;CACV,oBAAoB;CACpB,oBAAoB;CAC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ACb,cAAc;GACd,KAAK;GACL,OAAO;GACP,qBAAqB;GACtB;EACD;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACP,qBAAqB;GACtB;EAGD;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,cAAc;GACd,KAAK;GACL,KAAK;GACL,MAAM;GACN,KAAK;GACL,OAAO;GACR;EACD;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR;EACD;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR;EAGD;GACE,MAAM;GACN,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR;EACD,cAAc;GACZ,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EACF,cAAc;GACZ,KAAK;GACL,OAAO;GACP,aACE;GACF,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EACF;GACE,KAAK;GACL,MAAM;GACN,OAAO;GACP,KAAK;GACL,OAAO;GACR;EACD,gBAAgB;GACd,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EACF,qBAAqB;GACnB,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EACF,oBAAoB;GAClB,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EACF,oBAAoB;GAClB,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EACH;CACF"}
|
|
1
|
+
{"version":3,"file":"RecentActivityWidget-Rpj33TiN.mjs","names":[],"sources":["../../widgets/src/hooks/use-activities.preview.ts","../../widgets/src/hooks/use-activities.ts","../../widgets/src/widgets/RecentActivityWidget.tsx"],"sourcesContent":["import type { Activity } from \"@fluid-app/portal-core/widgets-api-types\";\n\nconst now = new Date();\n\nfunction minutesAgo(minutes: number): string {\n return new Date(now.getTime() - minutes * 60_000).toISOString();\n}\n\nexport const PREVIEW_DATA: Activity[] = [\n {\n id: 1,\n userName: \"Sarah Johnson\",\n avatarUrl: null,\n activityType: \"Order Placed\",\n targetName: \"Wellness Starter Kit\",\n timestamp: minutesAgo(12),\n slug: \"order_placed\",\n },\n {\n id: 2,\n userName: \"Mike Chen\",\n avatarUrl: null,\n activityType: \"New Lead\",\n targetName: \"Signed up from Instagram link\",\n timestamp: minutesAgo(45),\n slug: \"new_lead\",\n },\n {\n id: 3,\n userName: \"Visitor from Austin, TX\",\n avatarUrl: null,\n activityType: \"Page Views\",\n targetName: \"Viewed product catalog (3 pages)\",\n timestamp: minutesAgo(90),\n slug: \"page_views\",\n },\n {\n id: 4,\n userName: \"Lisa Park\",\n avatarUrl: null,\n activityType: \"Video Complete\",\n targetName: \"Watched: Getting Started Guide\",\n timestamp: minutesAgo(180),\n slug: \"video_complete\",\n },\n];\n","import { useQuery, type UseQueryResult } from \"@tanstack/react-query\";\nimport { useWidgetsApi } from \"@fluid-app/portal-core/widgets-api-context\";\nimport { useWidgetPreviewContext } from \"@fluid-app/portal-react/data-sources/preview-context\";\nimport { useDataSourceRegistryConfig } from \"@fluid-app/portal-react/data-sources/registry-context\";\nimport { PREVIEW_DATA } from \"./use-activities.preview\";\nimport type { Activity } from \"@fluid-app/portal-core/widgets-api-types\";\n\nexport type {\n Activity,\n ActivitySlug,\n} from \"@fluid-app/portal-core/widgets-api-types\";\n\nexport function useActivities(): UseQueryResult<Activity[], Error> {\n const widgetsApi = useWidgetsApi();\n const { isPreview } = useWidgetPreviewContext();\n const { baseUrl } = useDataSourceRegistryConfig();\n\n return useQuery({\n queryKey: [\n \"portal-widget-use\",\n \"activities\",\n isPreview ? \"preview\" : baseUrl,\n ] as const,\n queryFn: ({ signal }) => widgetsApi.fetchActivities(signal),\n enabled: !isPreview,\n ...(isPreview && { placeholderData: PREVIEW_DATA }),\n });\n}\n","import { useEffect, useMemo, useState, type ComponentProps } from \"react\";\nimport type React from \"react\";\nimport type {\n BackgroundValue,\n BorderRadiusOptions,\n BorderWidthOptions,\n ColorOptions,\n FontSizeOptions,\n PaddingOptions,\n} from \"@fluid-app/portal-core/types\";\nimport type { WidgetPropertySchema } from \"@fluid-app/portal-core/registries\";\nimport {\n borderColorClasses,\n borderWidthClasses,\n getBorderColorField,\n getBorderRadiusField,\n getBorderWidthField,\n getColorField,\n getFontSizeField,\n getPaddingField,\n} from \"../core/fields\";\nimport {\n useActivities,\n type Activity,\n type ActivitySlug,\n} from \"../hooks/use-activities\";\nimport { ErrorState } from \"../components/error-state\";\nimport {\n AudioWaveform,\n Bell,\n Calendar,\n CheckSquare,\n Eye,\n MessageCircle,\n Play,\n ShoppingCart,\n Star,\n Trophy,\n User,\n UserPlus,\n type LucideIcon,\n} from \"lucide-react\";\n\n// ---------- helpers ----------\n\nconst RELATIVE_TIME_REFRESH_MS = 60_000;\nconst DEFAULT_MAX_ITEMS_TO_SHOW = 6;\nconst MAX_ITEMS_TO_SHOW_LIMIT = 20;\n\nconst ACTIVITY_ICON_MAP: Record<ActivitySlug, LucideIcon> = {\n order_placed: ShoppingCart,\n abandoned_cart: ShoppingCart,\n cart_items_added: ShoppingCart,\n new_cart_items_added: ShoppingCart,\n direct_message: MessageCircle,\n comment_reply: MessageCircle,\n message_received: MessageCircle,\n message_sent: MessageCircle,\n video: Play,\n video_complete: Play,\n video_contact: Play,\n video_complete_contact: Play,\n new_lead: UserPlus,\n page_views_contact: UserPlus,\n smart_link_clicked: UserPlus,\n page_views: Eye,\n upcoming_event: Calendar,\n review_left: Star,\n tasks: CheckSquare,\n announcements: Bell,\n fantasy_point: Trophy,\n};\n\nconst getActivityIcon = (slug: ActivitySlug): LucideIcon =>\n ACTIVITY_ICON_MAP[slug] ?? User;\n\nconst formatAbsoluteTime = (timestamp: string): string =>\n new Date(timestamp).toLocaleTimeString(\"en-US\", {\n hour: \"numeric\",\n minute: \"2-digit\",\n hour12: true,\n });\n\nconst formatRelativeTime = (timestamp: string, now: number): string => {\n const then = new Date(timestamp).getTime();\n const diffSec = Math.max(0, Math.round((now - then) / 1000));\n\n if (diffSec < 60) return \"now\";\n const diffMin = Math.floor(diffSec / 60);\n if (diffMin < 60) return `${diffMin}m`;\n const diffHr = Math.floor(diffMin / 60);\n if (diffHr < 24) return `${diffHr}h`;\n const diffDay = Math.floor(diffHr / 24);\n if (diffDay < 7) return `${diffDay}d`;\n return new Date(timestamp).toLocaleDateString(\"en-US\", {\n month: \"short\",\n day: \"numeric\",\n });\n};\n\nconst toLocalDateKey = (date: Date): string => {\n const year = date.getFullYear();\n const month = String(date.getMonth() + 1).padStart(2, \"0\");\n const day = String(date.getDate()).padStart(2, \"0\");\n return `${year}-${month}-${day}`;\n};\n\nconst formatDateHeader = (timestamp: string, nowMs: number): string => {\n const date = new Date(timestamp);\n if (!Number.isFinite(date.getTime())) return timestamp;\n\n const now = new Date(nowMs);\n const yesterday = new Date(now);\n yesterday.setDate(now.getDate() - 1);\n\n const todayKey = toLocalDateKey(now);\n const yesterdayKey = toLocalDateKey(yesterday);\n const dateKey = toLocalDateKey(date);\n\n if (dateKey === todayKey) return \"Today\";\n if (dateKey === yesterdayKey) return \"Yesterday\";\n return date.toLocaleDateString(\"en-US\", {\n month: \"long\",\n day: \"numeric\",\n });\n};\n\nconst getDateKey = (timestamp: string): string => {\n const date = new Date(timestamp);\n if (!Number.isFinite(date.getTime())) return timestamp;\n return toLocalDateKey(date);\n};\n\nconst getColorCssValue = (color: ColorOptions): string =>\n color === \"transparent\" ? \"transparent\" : `var(--color-${color})`;\n\nconst normalizeMaxItemsToShow = (value: number): number => {\n if (!Number.isFinite(value)) return DEFAULT_MAX_ITEMS_TO_SHOW;\n return Math.min(MAX_ITEMS_TO_SHOW_LIMIT, Math.max(1, Math.floor(value)));\n};\n\nconst shouldRenderEyebrow = (\n showEyebrow: boolean,\n titleText: string,\n): boolean =>\n showEyebrow && titleText.trim().toLowerCase() !== \"recent activity\";\n\nconst isUnknownUser = (name: string | undefined): boolean => {\n if (!name) return true;\n const lower = name.trim().toLowerCase();\n if (!lower) return true;\n return (\n lower === \"unknown\" ||\n lower.includes(\"unknown visitor\") ||\n lower === \"anonymous\" ||\n lower === \"guest\"\n );\n};\n\nconst getInitials = (name: string | undefined): string => {\n if (!name) return \"\";\n const parts = name.trim().split(/\\s+/).slice(0, 2);\n return parts.map((p) => p[0]?.toUpperCase() ?? \"\").join(\"\");\n};\n\n// ---------- avatar ----------\n\ntype AvatarProps = {\n activity: Activity;\n textColor: ColorOptions;\n accentColor: ColorOptions;\n surfaceColor: ColorOptions;\n showTypeBadge: boolean;\n};\n\nfunction Avatar({\n activity,\n textColor,\n accentColor,\n surfaceColor,\n showTypeBadge,\n}: AvatarProps) {\n const TypeIcon = getActivityIcon(activity.slug);\n const unknown = isUnknownUser(activity.userName);\n const initials = unknown ? \"\" : getInitials(activity.userName);\n // 3-tier fallback: image → initials → person icon. If avatarUrl 404s or\n // fails to decode, flip to the next tier instead of showing a broken image.\n const [failedAvatarUrl, setFailedAvatarUrl] = useState<string | null>(null);\n const avatarUrl = activity.avatarUrl;\n const showImage = Boolean(avatarUrl) && failedAvatarUrl !== avatarUrl;\n\n return (\n <div className=\"relative shrink-0\">\n {showImage ? (\n <img\n src={avatarUrl ?? undefined}\n alt={unknown ? \"\" : activity.userName}\n width={36}\n height={36}\n loading=\"lazy\"\n onError={() => setFailedAvatarUrl(avatarUrl)}\n className=\"size-9 rounded-full object-cover\"\n style={{\n boxShadow: `inset 0 0 0 1px color-mix(in oklch, var(--color-${textColor}) 10%, transparent)`,\n }}\n />\n ) : initials ? (\n <div\n className={`flex size-9 items-center justify-center rounded-full text-[11px] font-bold tracking-[0.04em] text-${textColor}/80`}\n style={{\n background: `color-mix(in oklch, var(--color-${accentColor}) 12%, transparent)`,\n boxShadow: `inset 0 0 0 1px color-mix(in oklch, var(--color-${textColor}) 10%, transparent)`,\n }}\n aria-label={activity.userName}\n >\n {initials}\n </div>\n ) : (\n <div\n className={`flex size-9 items-center justify-center rounded-full`}\n style={{\n background: `color-mix(in oklch, var(--color-${textColor}) 5%, transparent)`,\n boxShadow: `inset 0 0 0 1px color-mix(in oklch, var(--color-${textColor}) 10%, transparent)`,\n }}\n aria-label=\"Unknown visitor\"\n >\n <User className={`size-3.5 text-${textColor}/55`} />\n </div>\n )}\n\n {/* Type badge — shows what kind of event, regardless of avatar kind. */}\n {showTypeBadge && (\n <span\n className={`bg-${accentColor} text-${accentColor}-foreground absolute -right-0.5 -bottom-0.5 flex size-4 items-center justify-center rounded-full`}\n style={{\n boxShadow: `0 0 0 2px ${getColorCssValue(surfaceColor)}`,\n }}\n aria-hidden=\"true\"\n >\n <TypeIcon style={{ width: 8, height: 8 }} />\n </span>\n )}\n </div>\n );\n}\n\n// ---------- activity row ----------\n\ntype ActivityRowProps = {\n activity: Activity;\n accentColor: ColorOptions;\n textColor: ColorOptions;\n surfaceColor: ColorOptions;\n showRelativeTime: boolean;\n nowMs: number;\n};\n\nfunction ActivityRow({\n activity,\n accentColor,\n textColor,\n surfaceColor,\n showRelativeTime,\n nowMs,\n}: ActivityRowProps) {\n const timeText = showRelativeTime\n ? formatRelativeTime(activity.timestamp, nowMs)\n : formatAbsoluteTime(activity.timestamp);\n\n const absoluteTooltip = new Date(activity.timestamp).toLocaleString(\"en-US\", {\n weekday: \"short\",\n month: \"short\",\n day: \"numeric\",\n hour: \"numeric\",\n minute: \"2-digit\",\n });\n\n return (\n <li\n role=\"article\"\n className=\"relative flex items-start gap-3 rounded-md px-2 py-2\"\n >\n <Avatar\n activity={activity}\n textColor={textColor}\n accentColor={accentColor}\n surfaceColor={surfaceColor}\n showTypeBadge\n />\n\n <div className=\"flex min-w-0 flex-1 flex-col\">\n <div className=\"flex items-baseline gap-2\">\n <p\n className={`min-w-0 flex-1 truncate text-[13px] leading-tight font-semibold text-${textColor}`}\n >\n {activity.activityType}\n </p>\n <span\n title={absoluteTooltip}\n className={`shrink-0 font-mono text-[10px] font-medium tabular-nums text-${textColor}/45`}\n >\n {timeText}\n </span>\n </div>\n <p\n className={`mt-0.5 truncate text-[12px] leading-snug text-${textColor}/65`}\n >\n <span className={`font-semibold text-${textColor}/85`}>\n {activity.userName}\n </span>\n {activity.targetName && (\n <>\n <span className={`mx-1 text-${textColor}/35`}>·</span>\n <span>{activity.targetName}</span>\n </>\n )}\n </p>\n </div>\n </li>\n );\n}\n\n// ---------- widget ----------\n\ntype RecentActivityWidgetProps = ComponentProps<\"div\"> & {\n titleEnabled?: boolean;\n titleText?: string;\n titleFontSize?: FontSizeOptions;\n titleColor?: ColorOptions;\n\n background?: BackgroundValue;\n textColor?: ColorOptions;\n accentColor?: ColorOptions;\n padding?: PaddingOptions;\n borderRadius?: BorderRadiusOptions;\n borderWidth?: BorderWidthOptions;\n borderColor?: ColorOptions;\n\n maxItemsToShow?: number;\n\n // Polish (additive)\n showTimeline?: boolean;\n showRelativeTime?: boolean;\n showCountChip?: boolean;\n showEyebrow?: boolean;\n};\n\nfunction useRelativeTimeNow(): number {\n const [nowMs, setNowMs] = useState(() => Date.now());\n\n useEffect(() => {\n const timer = window.setInterval(() => {\n setNowMs(Date.now());\n }, RELATIVE_TIME_REFRESH_MS);\n\n return () => window.clearInterval(timer);\n }, []);\n\n return nowMs;\n}\n\nexport function RecentActivityWidget({\n titleEnabled = true,\n titleText = \"Activity\",\n titleFontSize = \"xl\",\n titleColor = \"foreground\",\n\n background = { type: \"solid\", color: \"background\" },\n textColor = \"foreground\",\n accentColor = \"primary\",\n padding = 4,\n borderRadius = \"md\",\n borderWidth = \"thin\",\n borderColor = \"muted\",\n\n maxItemsToShow = 6,\n\n showTimeline = true,\n showRelativeTime = true,\n showCountChip = true,\n showEyebrow = true,\n\n className,\n ...props\n}: RecentActivityWidgetProps): React.JSX.Element {\n const backgroundColor = background.color || \"background\";\n const backgroundImage =\n (background.resource?.image_url || background.resource?.imageUrl) &&\n background.type === \"image\"\n ? `url(${background.resource.image_url || background.resource.imageUrl})`\n : \"none\";\n\n const { data: activities = [], isLoading, isError } = useActivities();\n const nowMs = useRelativeTimeNow();\n const maxVisibleItems = normalizeMaxItemsToShow(maxItemsToShow);\n\n const activitiesToShow = useMemo(() => {\n if (activities.length === 0)\n return [] as { date: string; items: Activity[] }[];\n const groups = new Map<string, Activity[]>();\n for (const activity of activities.slice(0, maxVisibleItems)) {\n const key = getDateKey(activity.timestamp);\n const existing = groups.get(key);\n if (existing) existing.push(activity);\n else groups.set(key, [activity]);\n }\n return Array.from(groups.entries()).map(([key, items]) => ({\n // `key` is only a defensive fallback; every group is created with at\n // least one activity, so the item timestamp is what normally labels it.\n date: formatDateHeader(items[0]?.timestamp ?? key, nowMs),\n items,\n }));\n }, [activities, maxVisibleItems, nowMs]);\n\n const totalCount = Math.min(activities.length, maxVisibleItems);\n\n return (\n <div\n className={`@container overflow-hidden rounded-${borderRadius} bg-${backgroundColor} text-${textColor} ${borderWidthClasses[borderWidth]} ${borderWidth !== \"none\" ? borderColorClasses[borderColor] : \"\"} ${className ?? \"\"}`}\n style={{\n backgroundImage,\n // Soft ambient lift derived from theme tokens. The configured border\n // props own the crisp outline so saved border settings stay intact.\n boxShadow: `0 1px 2px color-mix(in oklch, var(--color-foreground) 4%, transparent), 0 14px 32px -20px color-mix(in oklch, var(--color-foreground) 14%, transparent)`,\n }}\n {...props}\n >\n <div className={`p-${padding} flex flex-col`}>\n {/* Header */}\n {titleEnabled && titleText && (\n <div className=\"mb-4 flex items-end justify-between gap-3\">\n <div className=\"flex min-w-0 flex-col\">\n {shouldRenderEyebrow(showEyebrow, titleText) && (\n <span\n className={`text-[10px] font-bold tracking-[0.2em] uppercase text-${textColor}/55`}\n >\n Recent\n </span>\n )}\n <h2\n className={`mt-0.5 text-${titleFontSize} leading-tight font-bold tracking-[-0.015em] text-${titleColor}`}\n >\n {titleText}\n </h2>\n </div>\n {!isLoading && !isError && showCountChip && totalCount > 0 && (\n <span\n className={`inline-flex shrink-0 items-center gap-1.5 rounded-full bg-${accentColor}/10 px-2 py-1 text-[10px] font-bold tracking-[0.06em] text-${accentColor}`}\n >\n <span\n aria-hidden=\"true\"\n className={`size-1.5 rounded-full bg-${accentColor}`}\n />\n {totalCount} {totalCount === 1 ? \"update\" : \"updates\"}\n </span>\n )}\n </div>\n )}\n\n {/* States */}\n {isLoading ? (\n <ActivitySkeleton\n textColor={textColor}\n showTimeline={showTimeline}\n rowCount={maxVisibleItems}\n />\n ) : isError ? (\n <ErrorState />\n ) : activities.length === 0 ? (\n <EmptyState textColor={textColor} accentColor={accentColor} />\n ) : (\n /* Feed */\n <div role=\"feed\" className=\"flex flex-col gap-3\">\n {activitiesToShow.map((group, groupIdx) => (\n <section\n key={`${group.date}-${groupIdx}`}\n className=\"flex flex-col gap-1\"\n >\n <header className=\"flex items-center gap-2 px-2\">\n <span\n className={`text-[10px] font-bold tracking-[0.18em] uppercase text-${textColor}/55`}\n >\n {group.date}\n </span>\n <span\n aria-hidden=\"true\"\n className=\"h-px flex-1\"\n style={{\n background: `color-mix(in oklch, var(--color-${textColor}) 8%, transparent)`,\n }}\n />\n </header>\n\n <ul className=\"relative flex flex-col\">\n {/* Single continuous spine — anchored to the first and last\n avatar centers. Avatar is size-9 (36px), inside a li with\n px-2 py-2 (8px padding). So avatar center = 8 + 18 = 26px\n from the edges, which is also where the spine lives. */}\n {showTimeline && group.items.length > 1 && (\n <span\n aria-hidden=\"true\"\n className=\"pointer-events-none absolute top-[26px] bottom-[26px] left-[26px] w-px\"\n style={{\n background: `color-mix(in oklch, var(--color-${textColor}) 10%, transparent)`,\n }}\n />\n )}\n {group.items.map((activity) => (\n <ActivityRow\n key={activity.id}\n activity={activity}\n accentColor={accentColor}\n textColor={textColor}\n surfaceColor={backgroundColor}\n showRelativeTime={showRelativeTime}\n nowMs={nowMs}\n />\n ))}\n </ul>\n </section>\n ))}\n </div>\n )}\n </div>\n </div>\n );\n}\n\n// ---------- empty state ----------\n\ntype EmptyStateProps = {\n textColor: ColorOptions;\n accentColor: ColorOptions;\n};\n\nfunction EmptyState({ textColor, accentColor }: EmptyStateProps) {\n return (\n <div className=\"flex flex-col items-center justify-center gap-3 px-4 py-10\">\n <div\n className=\"relative flex size-12 items-center justify-center rounded-full\"\n style={{\n background: `color-mix(in oklch, var(--color-${accentColor}) 10%, transparent)`,\n boxShadow: `inset 0 0 0 1px color-mix(in oklch, var(--color-${textColor}) 8%, transparent)`,\n }}\n >\n <AudioWaveform className={`size-5 text-${accentColor}/80`} />\n </div>\n <div className=\"flex flex-col items-center gap-1\">\n <p className={`text-[13px] font-semibold text-${textColor}/80`}>\n No activity yet\n </p>\n <p\n className={`max-w-[24ch] text-center text-[11px] leading-snug text-${textColor}/55`}\n >\n Orders, messages, views and leads will show up here as they happen.\n </p>\n </div>\n </div>\n );\n}\n\n// ---------- skeleton ----------\n\ntype ActivitySkeletonProps = {\n textColor: ColorOptions;\n showTimeline: boolean;\n rowCount: number;\n};\n\nfunction ActivitySkeleton({\n textColor,\n showTimeline,\n rowCount,\n}: ActivitySkeletonProps) {\n return (\n <div className=\"relative flex flex-col\" aria-busy=\"true\">\n {showTimeline && (\n <span\n aria-hidden=\"true\"\n className=\"pointer-events-none absolute top-[26px] bottom-[26px] left-[26px] w-px\"\n style={{\n background: `color-mix(in oklch, var(--color-${textColor}) 10%, transparent)`,\n }}\n />\n )}\n {Array.from({ length: rowCount }, (_, i) => i).map((i) => (\n <div\n key={i}\n className=\"relative flex items-start gap-3 rounded-md px-2 py-2\"\n >\n <div\n className={`size-9 shrink-0 animate-pulse rounded-full bg-${textColor}/10`}\n />\n <div className=\"flex min-w-0 flex-1 flex-col gap-1.5\">\n <div\n className={`h-2 w-2/3 animate-pulse rounded-full bg-${textColor}/10`}\n />\n <div\n className={`h-2 w-1/2 animate-pulse rounded-full bg-${textColor}/10`}\n />\n </div>\n </div>\n ))}\n </div>\n );\n}\n\n// ---------- schema ----------\n\nexport const recentActivityWidgetPropertySchema: WidgetPropertySchema = {\n widgetType: \"RecentActivityWidget\",\n displayName: \"Recent Activity Widget\",\n tabsConfig: [{ id: \"styling\", label: \"Styling\" }],\n fields: [\n // Title\n {\n key: \"titleEnabled\",\n label: \"Widget Title\",\n type: \"boolean\",\n description: \"Display the title and eyebrow above the feed\",\n defaultValue: true,\n tab: \"styling\",\n group: \"Title\",\n },\n {\n key: \"titleText\",\n label: \"Title\",\n type: \"text\",\n description: \"Title text displayed above the activity feed\",\n defaultValue: \"Activity\",\n tab: \"styling\",\n group: \"Title\",\n requiresKeyToBeTrue: \"titleEnabled\",\n },\n getFontSizeField({\n key: \"titleFontSize\",\n label: \"Title Font Size\",\n description: \"Font size for the widget title\",\n defaultValue: \"xl\",\n tab: \"styling\",\n group: \"Title\",\n requiresKeyToBeTrue: \"titleEnabled\",\n }),\n getColorField({\n key: \"titleColor\",\n label: \"Title Color\",\n description: \"Color for the widget title\",\n defaultValue: \"foreground\",\n tab: \"styling\",\n group: \"Title\",\n requiresKeyToBeTrue: \"titleEnabled\",\n }),\n {\n key: \"showEyebrow\",\n label: \"Show 'RECENT' Eyebrow\",\n type: \"boolean\",\n description: \"Small uppercase label above the title\",\n defaultValue: true,\n tab: \"styling\",\n group: \"Title\",\n requiresKeyToBeTrue: \"titleEnabled\",\n },\n {\n key: \"showCountChip\",\n label: \"Show Updates Count Chip\",\n type: \"boolean\",\n description: \"Accent pill next to the title showing how many updates\",\n defaultValue: true,\n tab: \"styling\",\n group: \"Title\",\n requiresKeyToBeTrue: \"titleEnabled\",\n },\n\n // Feed\n {\n key: \"maxItemsToShow\",\n label: \"Max Items\",\n type: \"number\",\n description: \"Maximum number of activity items to display\",\n defaultValue: DEFAULT_MAX_ITEMS_TO_SHOW,\n min: 1,\n max: MAX_ITEMS_TO_SHOW_LIMIT,\n step: 1,\n tab: \"styling\",\n group: \"Feed\",\n },\n {\n key: \"showTimeline\",\n label: \"Timeline Spine\",\n type: \"boolean\",\n description: \"Draw a vertical line connecting activity avatars\",\n defaultValue: true,\n tab: \"styling\",\n group: \"Feed\",\n },\n {\n key: \"showRelativeTime\",\n label: \"Relative Timestamps\",\n type: \"boolean\",\n description: \"Show 'now / 2m / 1h / 3d' instead of absolute times\",\n defaultValue: true,\n tab: \"styling\",\n group: \"Feed\",\n },\n\n // Design\n {\n type: \"background\",\n key: \"background\",\n label: \"Background\",\n description: \"Background for the widget container\",\n defaultValue: \"background\",\n tab: \"styling\",\n group: \"Design\",\n },\n getColorField({\n key: \"textColor\",\n label: \"Text Color\",\n description: \"Default text color for activity content\",\n defaultValue: \"foreground\",\n tab: \"styling\",\n group: \"Design\",\n }),\n getColorField({\n key: \"accentColor\",\n label: \"Accent Color\",\n description:\n \"Drives the count chip, type badge, initials avatar, and empty-state icon\",\n defaultValue: \"primary\",\n tab: \"styling\",\n group: \"Design\",\n }),\n {\n key: \"separator\",\n type: \"separator\",\n label: \"Separator\",\n tab: \"styling\",\n group: \"Design\",\n },\n getPaddingField({\n key: \"padding\",\n label: \"Padding\",\n description: \"Padding around the widget container\",\n defaultValue: 4,\n tab: \"styling\",\n group: \"Design\",\n }),\n getBorderRadiusField({\n key: \"borderRadius\",\n label: \"Border Radius\",\n description: \"Border radius for the widget container\",\n defaultValue: \"md\",\n tab: \"styling\",\n group: \"Design\",\n }),\n getBorderWidthField({\n key: \"borderWidth\",\n label: \"Border Width\",\n description: \"Border width for the widget container\",\n defaultValue: \"thin\",\n tab: \"styling\",\n group: \"Design\",\n }),\n getBorderColorField({\n key: \"borderColor\",\n label: \"Border Color\",\n description: \"Border color for the widget container\",\n defaultValue: \"muted\",\n tab: \"styling\",\n group: \"Design\",\n }),\n ],\n} as const satisfies WidgetPropertySchema;\n"],"mappings":";;;;;;;;;AAEA,MAAM,sBAAM,IAAI,MAAM;AAEtB,SAAS,WAAW,SAAyB;AAC3C,yBAAO,IAAI,KAA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OAAO;GACP,MAAM;GACN,aAAa;GACb,cAAc;GACd,KAAK;GACL,KAAK;GACL,MAAM;GACN,KAAK;GACL,OAAO;GACR;EACD;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR;EACD;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR;EAGD;GACE,MAAM;GACN,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR;EACD,cAAc;GACZ,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EACF,cAAc;GACZ,KAAK;GACL,OAAO;GACP,aACE;GACF,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EACF;GACE,KAAK;GACL,MAAM;GACN,OAAO;GACP,KAAK;GACL,OAAO;GACR;EACD,gBAAgB;GACd,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EACF,qBAAqB;GACnB,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EACF,oBAAoB;GAClB,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EACF,oBAAoB;GAClB,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EACH;CACF"}
|
|
@@ -82,4 +82,4 @@ function useScreenHeaderContext() {
|
|
|
82
82
|
//#endregion
|
|
83
83
|
export { useScreenHeaderContext as i, useScreenHeaderActions as n, useScreenHeaderBreadcrumbs as r, ScreenHeaderProvider as t };
|
|
84
84
|
|
|
85
|
-
//# sourceMappingURL=ScreenHeaderContext-
|
|
85
|
+
//# sourceMappingURL=ScreenHeaderContext-4WYXIqQ5.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScreenHeaderContext-
|
|
1
|
+
{"version":3,"file":"ScreenHeaderContext-4WYXIqQ5.mjs","names":[],"sources":["../../react/src/shell/ScreenHeaderContext.tsx"],"sourcesContent":["\"use client\";\n\nimport type React from \"react\";\nimport {\n createContext,\n useContext,\n useState,\n useEffect,\n useRef,\n type ReactNode,\n} from \"react\";\n\ntype SetActions = (actions: ReactNode) => void;\ntype SetBreadcrumbs = (breadcrumbs: ReactNode) => void;\n\n/**\n * Split into separate read/write contexts so that components calling\n * useScreenHeaderActions (writers) don't re-render when the actions\n * state changes — only the ScreenHeader (reader) re-renders.\n */\nconst ScreenHeaderWriteContext = createContext<SetActions | null>(null);\nconst ScreenHeaderReadContext = createContext<ReactNode>(null);\n\nconst ScreenHeaderBreadcrumbsWriteContext =\n createContext<SetBreadcrumbs | null>(null);\nconst ScreenHeaderBreadcrumbsReadContext = createContext<ReactNode>(null);\n\nexport function ScreenHeaderProvider({\n children,\n}: {\n children: ReactNode;\n}): React.JSX.Element {\n const [actions, setActions] = useState<ReactNode>(null);\n const [breadcrumbs, setBreadcrumbs] = useState<ReactNode>(null);\n\n return (\n <ScreenHeaderWriteContext.Provider value={setActions}>\n <ScreenHeaderReadContext.Provider value={actions}>\n <ScreenHeaderBreadcrumbsWriteContext.Provider value={setBreadcrumbs}>\n <ScreenHeaderBreadcrumbsReadContext.Provider value={breadcrumbs}>\n {children}\n </ScreenHeaderBreadcrumbsReadContext.Provider>\n </ScreenHeaderBreadcrumbsWriteContext.Provider>\n </ScreenHeaderReadContext.Provider>\n </ScreenHeaderWriteContext.Provider>\n );\n}\n\n/**\n * Sets actions to display in the ScreenHeader.\n * Returns `true` if inside a ScreenHeaderProvider (i.e., in the portal shell),\n * `false` otherwise. Pages can use this boolean to conditionally skip\n * rendering their own PageHeader.\n *\n * Cleans up actions on unmount so navigating away doesn't leave stale actions.\n */\nexport function useScreenHeaderActions(actions: ReactNode): boolean {\n const setActions = useContext(ScreenHeaderWriteContext);\n const setActionsRef = useRef(setActions);\n setActionsRef.current = setActions;\n\n // Update actions when the value changes\n useEffect(() => {\n if (!setActions) return;\n setActions(actions);\n }, [actions, setActions]);\n\n // Clear actions only on unmount\n useEffect(() => {\n return () => setActionsRef.current?.(null);\n }, []);\n\n return setActions !== null;\n}\n\n/**\n * Sets breadcrumbs to display in the ScreenHeader (in place of the plain title).\n * Returns `true` if inside a ScreenHeaderProvider (i.e., in the portal shell),\n * `false` otherwise.\n *\n * Cleans up breadcrumbs on unmount so navigating away doesn't leave stale breadcrumbs.\n */\nexport function useScreenHeaderBreadcrumbs(breadcrumbs: ReactNode): boolean {\n const setBreadcrumbs = useContext(ScreenHeaderBreadcrumbsWriteContext);\n const setBreadcrumbsRef = useRef(setBreadcrumbs);\n setBreadcrumbsRef.current = setBreadcrumbs;\n\n // Update breadcrumbs when the value changes\n useEffect(() => {\n if (!setBreadcrumbs) return;\n setBreadcrumbs(breadcrumbs);\n }, [breadcrumbs, setBreadcrumbs]);\n\n // Clear breadcrumbs only on unmount\n useEffect(() => {\n return () => setBreadcrumbsRef.current?.(null);\n }, []);\n\n return setBreadcrumbs !== null;\n}\n\n/**\n * Reads the current screen header actions and breadcrumbs. Used internally by ScreenHeader.\n */\nexport function useScreenHeaderContext(): {\n actions: ReactNode;\n breadcrumbs: ReactNode;\n} {\n const actions = useContext(ScreenHeaderReadContext);\n const breadcrumbs = useContext(ScreenHeaderBreadcrumbsReadContext);\n return { actions: actions ?? null, breadcrumbs: breadcrumbs ?? null };\n}\n"],"mappings":";;;;;;;;AAoBA,MAAM,2BAA2B,cAAiC,KAAK;AACvE,MAAM,0BAA0B,cAAyB,KAAK;AAE9D,MAAM,sCACJ,cAAqC,KAAK;AAC5C,MAAM,qCAAqC,cAAyB,KAAK;AAEzE,SAAgB,qBAAqB,EACnC,YAGoB;CACpB,MAAM,CAAC,SAAS,cAAc,SAAoB,KAAK;CACvD,MAAM,CAAC,aAAa,kBAAkB,SAAoB,KAAK;AAE/D,QACE,oBAAC,yBAAyB,UAA1B;EAAmC,OAAO;YACxC,oBAAC,wBAAwB,UAAzB;GAAkC,OAAO;aACvC,oBAAC,oCAAoC,UAArC;IAA8C,OAAO;cACnD,oBAAC,mCAAmC,UAApC;KAA6C,OAAO;KACjD;KAC2C,CAAA;IACD,CAAA;GACd,CAAA;EACD,CAAA;;;;;;;;;;AAYxC,SAAgB,uBAAuB,SAA6B;CAClE,MAAM,aAAa,WAAW,yBAAyB;CACvD,MAAM,gBAAgB,OAAO,WAAW;AACxC,eAAc,UAAU;AAGxB,iBAAgB;AACd,MAAI,CAAC,WAAY;AACjB,aAAW,QAAQ;IAClB,CAAC,SAAS,WAAW,CAAC;AAGzB,iBAAgB;AACd,eAAa,cAAc,UAAU,KAAK;IACzC,EAAE,CAAC;AAEN,QAAO,eAAe;;;;;;;;;AAUxB,SAAgB,2BAA2B,aAAiC;CAC1E,MAAM,iBAAiB,WAAW,oCAAoC;CACtE,MAAM,oBAAoB,OAAO,eAAe;AAChD,mBAAkB,UAAU;AAG5B,iBAAgB;AACd,MAAI,CAAC,eAAgB;AACrB,iBAAe,YAAY;IAC1B,CAAC,aAAa,eAAe,CAAC;AAGjC,iBAAgB;AACd,eAAa,kBAAkB,UAAU,KAAK;IAC7C,EAAE,CAAC;AAEN,QAAO,mBAAmB;;;;;AAM5B,SAAgB,yBAGd;CACA,MAAM,UAAU,WAAW,wBAAwB;CACnD,MAAM,cAAc,WAAW,mCAAmC;AAClE,QAAO;EAAE,SAAS,WAAW;EAAM,aAAa,eAAe;EAAM"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as useDataSourceRegistryConfig } from "./registry-context-
|
|
1
|
+
import { n as useDataSourceRegistryConfig } from "./registry-context-Bc-2fQnr.mjs";
|
|
2
2
|
import { createContext, memo, useCallback, useContext, useMemo, useRef } from "react";
|
|
3
3
|
import { useQueries } from "@tanstack/react-query";
|
|
4
4
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -671,4 +671,4 @@ function ScreenRenderer(props) {
|
|
|
671
671
|
//#endregion
|
|
672
672
|
export { assertNever as a, useScreenRenderer as c, DataSourceApiProvider as d, assertDefined as i, RegistryProvider as l, DataAwareWidget as n, isWidgetType as o, WIDGET_TYPE_NAMES as r, isWidgetTypeName as s, ScreenRenderer as t, useRegistry as u };
|
|
673
673
|
|
|
674
|
-
//# sourceMappingURL=ScreenRenderer-
|
|
674
|
+
//# sourceMappingURL=ScreenRenderer-BQal-fnZ.mjs.map
|