@fluid-app/portal-sdk 0.1.131 → 0.1.133

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (146) hide show
  1. package/dist/{AlertWidget-WQ_XPDRo.mjs → AlertWidget-BYbcGyNr.mjs} +3 -3
  2. package/dist/{AlertWidget-WQ_XPDRo.mjs.map → AlertWidget-BYbcGyNr.mjs.map} +1 -1
  3. package/dist/{AppDownloadScreen-zNP4k8ht.cjs → AppDownloadScreen-B-i6Rydi.cjs} +1 -1
  4. package/dist/{AppDownloadScreen-BOfG3cqC.mjs → AppDownloadScreen-BpExiJat.mjs} +3 -3
  5. package/dist/{AppDownloadScreen-BOfG3cqC.mjs.map → AppDownloadScreen-BpExiJat.mjs.map} +1 -1
  6. package/dist/{AppDownloadScreen-BjCtTMPU.cjs → AppDownloadScreen-CIqSvpV0.cjs} +1 -1
  7. package/dist/{AppDownloadScreen-BjCtTMPU.cjs.map → AppDownloadScreen-CIqSvpV0.cjs.map} +1 -1
  8. package/dist/{BulletListWidget-BYcaQnVH.mjs → BulletListWidget-Bo5Kj1W-.mjs} +2 -2
  9. package/dist/{BulletListWidget-BYcaQnVH.mjs.map → BulletListWidget-Bo5Kj1W-.mjs.map} +1 -1
  10. package/dist/{CalendarWidget-Qb-utCFD.mjs → CalendarWidget-CCsceh_0.mjs} +2 -2
  11. package/dist/{CalendarWidget-Qb-utCFD.mjs.map → CalendarWidget-CCsceh_0.mjs.map} +1 -1
  12. package/dist/{CardWidget-zVxobZDH.mjs → CardWidget-BkOMSBQ-.mjs} +2 -2
  13. package/dist/{CardWidget-zVxobZDH.mjs.map → CardWidget-BkOMSBQ-.mjs.map} +1 -1
  14. package/dist/{CarouselWidget-dpRCljEx.mjs → CarouselWidget-B9LsTYUF.mjs} +2 -2
  15. package/dist/{CarouselWidget-dpRCljEx.mjs.map → CarouselWidget-B9LsTYUF.mjs.map} +1 -1
  16. package/dist/{CatchUpWidget-CSIXsR82.mjs → CatchUpWidget-CSJdJgs-.mjs} +2 -2
  17. package/dist/{CatchUpWidget-CSIXsR82.mjs.map → CatchUpWidget-CSJdJgs-.mjs.map} +1 -1
  18. package/dist/{ChartWidget-88hpX7ft.mjs → ChartWidget-Cpzqi6W4.mjs} +2 -2
  19. package/dist/{ChartWidget-88hpX7ft.mjs.map → ChartWidget-Cpzqi6W4.mjs.map} +1 -1
  20. package/dist/{ContactsScreen-BvoMicyB.mjs → ContactsScreen-BRmYDosJ.mjs} +5 -5
  21. package/dist/{ContactsScreen-BvoMicyB.mjs.map → ContactsScreen-BRmYDosJ.mjs.map} +1 -1
  22. package/dist/{ContainerWidget-DNS7ynby.mjs → ContainerWidget-DTchKDKw.mjs} +3 -3
  23. package/dist/{ContainerWidget-DNS7ynby.mjs.map → ContainerWidget-DTchKDKw.mjs.map} +1 -1
  24. package/dist/{CustomersScreen-xAauAB-B.mjs → CustomersScreen-Cnn-Wcza.mjs} +2 -2
  25. package/dist/{CustomersScreen-xAauAB-B.mjs.map → CustomersScreen-Cnn-Wcza.mjs.map} +1 -1
  26. package/dist/{EmbedWidget-BQYixJLj.mjs → EmbedWidget-Du9DMpSo.mjs} +2 -2
  27. package/dist/{EmbedWidget-BQYixJLj.mjs.map → EmbedWidget-Du9DMpSo.mjs.map} +1 -1
  28. package/dist/{FluidProvider-B-f_JVal.mjs → FluidProvider-BUdNsR8f.mjs} +49 -49
  29. package/dist/{FluidProvider-B-f_JVal.mjs.map → FluidProvider-BUdNsR8f.mjs.map} +1 -1
  30. package/dist/FluidProvider-CQoQjYxU.cjs.map +1 -1
  31. package/dist/{ImageWidget-DE9Fp_oH.mjs → ImageWidget-B1Mx3qKN.mjs} +2 -2
  32. package/dist/{ImageWidget-DE9Fp_oH.mjs.map → ImageWidget-B1Mx3qKN.mjs.map} +1 -1
  33. package/dist/{LayoutWidget-BFO_PHWw.mjs → LayoutWidget-Bgodl7eR.mjs} +2 -2
  34. package/dist/{LayoutWidget-BFO_PHWw.mjs.map → LayoutWidget-Bgodl7eR.mjs.map} +1 -1
  35. package/dist/{LinkWidget-JSoDi-ag.mjs → LinkWidget-B5PlWJHe.mjs} +2 -2
  36. package/dist/{LinkWidget-JSoDi-ag.mjs.map → LinkWidget-B5PlWJHe.mjs.map} +1 -1
  37. package/dist/{ListWidget-CBLZ8CjD.mjs → ListWidget-BWfsmVoc.mjs} +2 -2
  38. package/dist/{ListWidget-CBLZ8CjD.mjs.map → ListWidget-BWfsmVoc.mjs.map} +1 -1
  39. package/dist/{MessagingScreen-COWASb0E.mjs → MessagingScreen-CQwR5WA1.mjs} +9 -6
  40. package/dist/{MessagingScreen-COWASb0E.mjs.map → MessagingScreen-CQwR5WA1.mjs.map} +1 -1
  41. package/dist/{MySiteScreen-BasZFpx7.cjs → MySiteScreen-C00HjZdl.cjs} +1 -1
  42. package/dist/{MySiteScreen-B5-bV1-O.mjs → MySiteScreen-CcxWz0IH.mjs} +4 -4
  43. package/dist/{MySiteScreen-B5-bV1-O.mjs.map → MySiteScreen-CcxWz0IH.mjs.map} +1 -1
  44. package/dist/{MySiteScreen-DURa034X.cjs → MySiteScreen-D56qESn0.cjs} +1 -1
  45. package/dist/{MySiteScreen-DURa034X.cjs.map → MySiteScreen-D56qESn0.cjs.map} +1 -1
  46. package/dist/{MySiteWidget-BqtLSExC.mjs → MySiteWidget-mK0Mj3DS.mjs} +2 -2
  47. package/dist/{MySiteWidget-BqtLSExC.mjs.map → MySiteWidget-mK0Mj3DS.mjs.map} +1 -1
  48. package/dist/{NestedWidget-DIwW-wM7.mjs → NestedWidget-B6cUOyI3.mjs} +2 -2
  49. package/dist/{NestedWidget-DIwW-wM7.mjs.map → NestedWidget-B6cUOyI3.mjs.map} +1 -1
  50. package/dist/{OrdersScreen-BcFvAtJ_.mjs → OrdersScreen-CpOywVHJ.mjs} +4 -4
  51. package/dist/{OrdersScreen-BcFvAtJ_.mjs.map → OrdersScreen-CpOywVHJ.mjs.map} +1 -1
  52. package/dist/{PointsWidget-DgLGU995.mjs → PointsWidget-BlEzqgbK.mjs} +2 -2
  53. package/dist/{PointsWidget-DgLGU995.mjs.map → PointsWidget-BlEzqgbK.mjs.map} +1 -1
  54. package/dist/{ProductsScreen-Mu8doz5F.cjs → ProductsScreen-BPNdpsYm.cjs} +2 -2
  55. package/dist/{src-CMByt6YP.cjs → ProductsScreen-BY285fh-.cjs} +90 -31
  56. package/dist/ProductsScreen-BY285fh-.cjs.map +1 -0
  57. package/dist/ProductsScreen-DMldTDPg.mjs +42 -0
  58. package/dist/{src-DryOJTBW.mjs → ProductsScreen-jdy2j9_J.mjs} +86 -28
  59. package/dist/ProductsScreen-jdy2j9_J.mjs.map +1 -0
  60. package/dist/{ProfileScreen-CnQqdYBE.mjs → ProfileScreen-mAUuAFhe.mjs} +5 -5
  61. package/dist/{ProfileScreen-CnQqdYBE.mjs.map → ProfileScreen-mAUuAFhe.mjs.map} +1 -1
  62. package/dist/{QuickShareWidget-CajKauDa.mjs → QuickShareWidget-Lpox79Cq.mjs} +2 -2
  63. package/dist/{QuickShareWidget-CajKauDa.mjs.map → QuickShareWidget-Lpox79Cq.mjs.map} +1 -1
  64. package/dist/{RecentActivityWidget-BZYB21eR.mjs → RecentActivityWidget-BdPmAQq4.mjs} +2 -2
  65. package/dist/{RecentActivityWidget-BZYB21eR.mjs.map → RecentActivityWidget-BdPmAQq4.mjs.map} +1 -1
  66. package/dist/{SeparatorWidget-Lsd6juu7.mjs → SeparatorWidget-BS966Lk4.mjs} +2 -2
  67. package/dist/{SeparatorWidget-Lsd6juu7.mjs.map → SeparatorWidget-BS966Lk4.mjs.map} +1 -1
  68. package/dist/ShareablesScreen-B6tMQzuX.mjs +1314 -0
  69. package/dist/ShareablesScreen-B6tMQzuX.mjs.map +1 -0
  70. package/dist/{ShareablesScreen-oZhW2jGu.cjs → ShareablesScreen-DMBXIMMj.cjs} +2 -2
  71. package/dist/ShareablesScreen-d_ThfnNQ.mjs +42 -0
  72. package/dist/ShareablesScreen-znVUD_OK.cjs +1332 -0
  73. package/dist/ShareablesScreen-znVUD_OK.cjs.map +1 -0
  74. package/dist/{ShopScreen-B1UzSmK8.cjs → ShopScreen-BVIT_QS-.cjs} +6 -4
  75. package/dist/ShopScreen-BVIT_QS-.cjs.map +1 -0
  76. package/dist/{ShopScreen-7HWz_B6R.cjs → ShopScreen-Bsjdn-E9.cjs} +1 -1
  77. package/dist/{ShopScreen-D1N3RWm9.mjs → ShopScreen-C1bnhxpj.mjs} +9 -7
  78. package/dist/ShopScreen-C1bnhxpj.mjs.map +1 -0
  79. package/dist/{SpacerWidget-B3zkEePP.mjs → SpacerWidget-BimE1fjJ.mjs} +2 -2
  80. package/dist/{SpacerWidget-B3zkEePP.mjs.map → SpacerWidget-BimE1fjJ.mjs.map} +1 -1
  81. package/dist/{SubscriptionsScreen-Bw3xkq7t.mjs → SubscriptionsScreen-QHf54yD7.mjs} +5 -5
  82. package/dist/{SubscriptionsScreen-Bw3xkq7t.mjs.map → SubscriptionsScreen-QHf54yD7.mjs.map} +1 -1
  83. package/dist/{TableWidget-Xz0d4UH5.mjs → TableWidget-CfSqeNQj.mjs} +2 -2
  84. package/dist/{TableWidget-Xz0d4UH5.mjs.map → TableWidget-CfSqeNQj.mjs.map} +1 -1
  85. package/dist/{TextWidget-CzUlNmCl.mjs → TextWidget-DYpbUtQh.mjs} +2 -2
  86. package/dist/{TextWidget-CzUlNmCl.mjs.map → TextWidget-DYpbUtQh.mjs.map} +1 -1
  87. package/dist/{ToDoWidget-qyFLHU_o.mjs → ToDoWidget-DaxkgCEl.mjs} +2 -2
  88. package/dist/{ToDoWidget-qyFLHU_o.mjs.map → ToDoWidget-DaxkgCEl.mjs.map} +1 -1
  89. package/dist/{UpgradeScreen-CIiEjeTZ.cjs → UpgradeScreen--eiiE1rX.cjs} +1 -1
  90. package/dist/{UpgradeScreen-IaYxGm7M.cjs → UpgradeScreen-7on9GOgu.cjs} +1 -1
  91. package/dist/{UpgradeScreen-IaYxGm7M.cjs.map → UpgradeScreen-7on9GOgu.cjs.map} +1 -1
  92. package/dist/{UpgradeScreen-BZdJQxb9.mjs → UpgradeScreen-p7aAXWFM.mjs} +2 -2
  93. package/dist/{UpgradeScreen-BZdJQxb9.mjs.map → UpgradeScreen-p7aAXWFM.mjs.map} +1 -1
  94. package/dist/{VideoWidget-CpUPsOI7.mjs → VideoWidget-CHktk3hs.mjs} +2 -2
  95. package/dist/{VideoWidget-CpUPsOI7.mjs.map → VideoWidget-CHktk3hs.mjs.map} +1 -1
  96. package/dist/{dist-B1HwSrso.mjs → dist-CayuD99K.mjs} +1 -1
  97. package/dist/{dist-B1HwSrso.mjs.map → dist-CayuD99K.mjs.map} +1 -1
  98. package/dist/{es-BcjHf1ZX.mjs → es-CTLNkiWp.mjs} +38 -3
  99. package/dist/{es-BcjHf1ZX.mjs.map → es-CTLNkiWp.mjs.map} +1 -1
  100. package/dist/index.cjs +19 -19
  101. package/dist/index.d.cts.map +1 -1
  102. package/dist/index.d.mts.map +1 -1
  103. package/dist/index.mjs +70 -70
  104. package/dist/index.mjs.map +1 -1
  105. package/dist/{order-status-badge-OZ1InBwZ.mjs → order-status-badge-Bt2gMEPZ.mjs} +1 -1
  106. package/dist/{order-status-badge-OZ1InBwZ.mjs.map → order-status-badge-Bt2gMEPZ.mjs.map} +1 -1
  107. package/dist/{sortable.esm-DSrWP4x9.mjs → sortable.esm-BzPsVjTI.mjs} +1 -1
  108. package/dist/{sortable.esm-DSrWP4x9.mjs.map → sortable.esm-BzPsVjTI.mjs.map} +1 -1
  109. package/dist/{src-DIcd2_ex.cjs → src-C5GUPE_i.cjs} +37 -26
  110. package/dist/src-C5GUPE_i.cjs.map +1 -0
  111. package/dist/{src-k03GJfKt.mjs → src-DcIV4Mpe.mjs} +41 -30
  112. package/dist/src-DcIV4Mpe.mjs.map +1 -0
  113. package/dist/{use-account-clients-CZw8FqxD.mjs → use-account-clients-BjK5QVYl.mjs} +2 -2
  114. package/dist/{use-account-clients-CZw8FqxD.mjs.map → use-account-clients-BjK5QVYl.mjs.map} +1 -1
  115. package/dist/{use-current-user-C6af9r0B.mjs → use-current-user-BP_GJuQe.mjs} +3 -3
  116. package/dist/{use-current-user-C6af9r0B.mjs.map → use-current-user-BP_GJuQe.mjs.map} +1 -1
  117. package/dist/{use-fluid-api-R0Qybt_F.mjs → use-fluid-api-UtVBk6E-.mjs} +2 -2
  118. package/dist/{use-fluid-api-R0Qybt_F.mjs.map → use-fluid-api-UtVBk6E-.mjs.map} +1 -1
  119. package/dist/{use-fluid-auth-_pnjCu2c.mjs → use-fluid-auth-DrPeCmW-.mjs} +2 -2
  120. package/dist/{use-fluid-auth-_pnjCu2c.mjs.map → use-fluid-auth-DrPeCmW-.mjs.map} +1 -1
  121. package/dist/{use-portal-products-client-Bl-yd0Tl.cjs → use-portal-products-client-CIrRGIxC.cjs} +5 -14
  122. package/dist/use-portal-products-client-CIrRGIxC.cjs.map +1 -0
  123. package/dist/{use-portal-products-client-tJi4q54S.mjs → use-portal-products-client-dV5jIXpp.mjs} +6 -15
  124. package/dist/use-portal-products-client-dV5jIXpp.mjs.map +1 -0
  125. package/package.json +18 -18
  126. package/dist/MessagingScreen-CWm4iQnk.mjs +0 -38
  127. package/dist/ProductsScreen-BHeRiKUM.cjs +0 -101
  128. package/dist/ProductsScreen-BHeRiKUM.cjs.map +0 -1
  129. package/dist/ProductsScreen-C_1ghW3w.mjs +0 -42
  130. package/dist/ProductsScreen-DJOPzE9v.mjs +0 -89
  131. package/dist/ProductsScreen-DJOPzE9v.mjs.map +0 -1
  132. package/dist/ShareablesScreen-BSRbPf6u.cjs +0 -414
  133. package/dist/ShareablesScreen-BSRbPf6u.cjs.map +0 -1
  134. package/dist/ShareablesScreen-COyBtpDy.mjs +0 -42
  135. package/dist/ShareablesScreen-kBJFUklJ.mjs +0 -396
  136. package/dist/ShareablesScreen-kBJFUklJ.mjs.map +0 -1
  137. package/dist/ShopScreen-B1UzSmK8.cjs.map +0 -1
  138. package/dist/ShopScreen-D1N3RWm9.mjs.map +0 -1
  139. package/dist/chunk-ByhMGyNw.mjs +0 -37
  140. package/dist/src-CMByt6YP.cjs.map +0 -1
  141. package/dist/src-DIcd2_ex.cjs.map +0 -1
  142. package/dist/src-DryOJTBW.mjs.map +0 -1
  143. package/dist/src-k03GJfKt.mjs.map +0 -1
  144. package/dist/use-portal-products-client-Bl-yd0Tl.cjs.map +0 -1
  145. package/dist/use-portal-products-client-tJi4q54S.mjs.map +0 -1
  146. /package/dist/{src-DAC9DwXZ.mjs → src-6SxtfYk9.mjs} +0 -0
@@ -1,4 +1,4 @@
1
- import { n as __exportAll } from "./chunk-ByhMGyNw.mjs";
1
+ import { r as __exportAll } from "./es-CTLNkiWp.mjs";
2
2
  import { i as getBorderColorField, n as borderWidthClasses, o as getBorderRadiusField, p as getHeightField, s as getBorderWidthField, t as borderColorClasses } from "./registries-CM_NlECC.mjs";
3
3
  import { t as MediaRenderer } from "./MediaRenderer-Cfvg51w8.mjs";
4
4
  import { jsx } from "react/jsx-runtime";
@@ -158,4 +158,4 @@ const imageWidgetPropertySchema = {
158
158
  //#endregion
159
159
  export { ImageWidget_exports as n, imageWidgetPropertySchema as r, ImageWidget as t };
160
160
 
161
- //# sourceMappingURL=ImageWidget-DE9Fp_oH.mjs.map
161
+ //# sourceMappingURL=ImageWidget-B1Mx3qKN.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"ImageWidget-DE9Fp_oH.mjs","names":[],"sources":["../../widgets/src/widgets/ImageWidget.tsx"],"sourcesContent":["import type { ComponentProps } from \"react\";\nimport type React from \"react\";\nimport {\n getBorderRadiusField,\n getHeightField,\n type WidgetPropertySchema,\n} from \"@fluid-app/portal-core/registries\";\nimport type {\n BorderRadiusOptions,\n BorderWidthOptions,\n ColorOptions,\n ShareableItem,\n} from \"@fluid-app/portal-core/types\";\nimport {\n getBorderWidthField,\n getBorderColorField,\n borderWidthClasses,\n borderColorClasses,\n} from \"../core/fields\";\nimport { MediaRenderer } from \"../components/MediaRenderer\";\n\ntype ImageWidgetProps = ComponentProps<\"div\"> & {\n src?: string;\n alt?: string;\n borderRadius?: BorderRadiusOptions;\n borderWidth?: BorderWidthOptions;\n borderColor?: ColorOptions;\n verticalSizing?: \"auto\" | \"fixed\";\n fixedHeight?: string;\n displayFit?: \"cover\" | \"contain\";\n focusPoint?: string;\n linkUrl?: string;\n resource?: ShareableItem;\n useCustomUrl?: boolean;\n editMode?: boolean;\n};\n\nexport function ImageWidget({\n src = \"\",\n alt = \"\",\n borderRadius = \"md\",\n borderWidth = \"none\",\n borderColor = \"muted\",\n verticalSizing = \"auto\",\n fixedHeight = \"200px\",\n displayFit = \"cover\",\n focusPoint,\n linkUrl,\n resource,\n useCustomUrl,\n editMode = false,\n}: ImageWidgetProps): React.JSX.Element {\n const effectiveSrc = useCustomUrl ? src : (resource?.imageUrl ?? src);\n const effectiveAlt = resource?.title ?? alt;\n\n const isFixed = verticalSizing === \"fixed\";\n\n const content = (\n <div\n className={`w-full rounded-${borderRadius} ${borderWidthClasses[borderWidth]} ${borderWidth !== \"none\" ? borderColorClasses[borderColor] : \"\"} overflow-hidden`}\n style={isFixed ? { height: fixedHeight } : undefined}\n >\n <MediaRenderer\n mediaType=\"image\"\n src={effectiveSrc}\n alt={effectiveAlt}\n objectFit={isFixed ? displayFit : \"contain\"}\n focusPoint={isFixed ? focusPoint : undefined}\n />\n </div>\n );\n\n if (linkUrl && !editMode) {\n return (\n <a href={linkUrl} target=\"_blank\" rel=\"noopener noreferrer\">\n {content}\n </a>\n );\n }\n\n return content;\n}\n\nexport const imageWidgetPropertySchema: WidgetPropertySchema = {\n widgetType: \"ImageWidget\",\n displayName: \"Image\",\n fields: [\n // Content\n {\n key: \"resource\",\n label: \"Select Image\",\n type: \"resource\",\n description: \"Browse and select an image\",\n allowedTypes: [\"Medium\"],\n group: \"Content\",\n },\n {\n key: \"useCustomUrl\",\n label: \"Use Custom URL\",\n type: \"boolean\",\n description: \"Enter a custom image URL instead of selecting media\",\n defaultValue: false,\n group: \"Content\",\n },\n {\n key: \"src\",\n label: \"Image URL\",\n type: \"text\",\n description: \"The source URL of the image\",\n defaultValue:\n \"https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=800&auto=format&fit=crop\",\n group: \"Content\",\n requiresKeyToBeTrue: \"useCustomUrl\",\n },\n {\n key: \"alt\",\n label: \"Alt Text\",\n type: \"text\",\n description: \"Alternative text for the image (for accessibility)\",\n defaultValue: \"Placeholder image\",\n group: \"Content\",\n },\n\n // Design\n getBorderRadiusField({\n key: \"borderRadius\",\n label: \"Border Radius\",\n description: \"Border radius for the container\",\n defaultValue: \"md\",\n group: \"Design\",\n }),\n getBorderWidthField({\n key: \"borderWidth\",\n label: \"Border Width\",\n description: \"Border width for the widget\",\n defaultValue: \"none\",\n group: \"Design\",\n }),\n getBorderColorField({\n key: \"borderColor\",\n label: \"Border Color\",\n description: \"Border color for the widget\",\n defaultValue: \"muted\",\n group: \"Design\",\n }),\n {\n key: \"verticalSizing\",\n label: \"Vertical Sizing\",\n type: \"buttonGroup\",\n description: \"How the image height is determined\",\n options: [\n { label: \"Auto\", value: \"auto\" },\n { label: \"Fixed\", value: \"fixed\" },\n ],\n defaultValue: \"auto\",\n group: \"Design\",\n },\n getHeightField({\n key: \"fixedHeight\",\n label: \"Height\",\n description: \"Fixed height of the image container\",\n defaultValue: \"200px\",\n group: \"Design\",\n requiresKeyValue: { key: \"verticalSizing\", value: \"fixed\" },\n }),\n {\n key: \"displayFit\",\n label: \"Display Fit\",\n type: \"buttonGroup\",\n description: \"How the image fills its container\",\n options: [\n { label: \"Cover\", value: \"cover\" },\n { label: \"Contain\", value: \"contain\" },\n ],\n defaultValue: \"cover\",\n group: \"Design\",\n requiresKeyValue: { key: \"verticalSizing\", value: \"fixed\" },\n },\n {\n key: \"focusPoint\",\n label: \"Focus Point\",\n type: \"contentPosition\",\n description: \"The focal point of the image within its container\",\n defaultValue: \"center\",\n group: \"Design\",\n requiresKeyValue: { key: \"verticalSizing\", value: \"fixed\" },\n },\n\n // Link\n {\n key: \"linkUrl\",\n label: \"Link URL\",\n type: \"text\",\n description: \"Optional URL to wrap the image in a link\",\n defaultValue: \"\",\n group: \"Link\",\n },\n ],\n};\n"],"mappings":";;;;;;;;;AAqCA,SAAgB,YAAY,EAC1B,MAAM,IACN,MAAM,IACN,eAAe,MACf,cAAc,QACd,cAAc,SACd,iBAAiB,QACjB,cAAc,SACd,aAAa,SACb,YACA,SACA,UACA,cACA,WAAW,SAC2B;CACtC,MAAM,eAAe,eAAe,MAAO,UAAU,YAAY;CACjE,MAAM,eAAe,UAAU,SAAS;CAExC,MAAM,UAAU,mBAAmB;CAEnC,MAAM,UACJ,oBAAC,OAAD;EACE,WAAW,kBAAkB,aAAa,GAAG,mBAAmB,aAAa,GAAG,gBAAgB,SAAS,mBAAmB,eAAe,GAAG;EAC9I,OAAO,UAAU,EAAE,QAAQ,aAAa,GAAG,KAAA;YAE3C,oBAAC,eAAD;GACE,WAAU;GACV,KAAK;GACL,KAAK;GACL,WAAW,UAAU,aAAa;GAClC,YAAY,UAAU,aAAa,KAAA;GACnC,CAAA;EACE,CAAA;AAGR,KAAI,WAAW,CAAC,SACd,QACE,oBAAC,KAAD;EAAG,MAAM;EAAS,QAAO;EAAS,KAAI;YACnC;EACC,CAAA;AAIR,QAAO;;AAGT,MAAa,4BAAkD;CAC7D,YAAY;CACZ,aAAa;CACb,QAAQ;EAEN;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,cAAc,CAAC,SAAS;GACxB,OAAO;GACR;EACD;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,cAAc;GACd,OAAO;GACR;EACD;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,cACE;GACF,OAAO;GACP,qBAAqB;GACtB;EACD;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,cAAc;GACd,OAAO;GACR;EAGD,qBAAqB;GACnB,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,OAAO;GACR,CAAC;EACF,oBAAoB;GAClB,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,OAAO;GACR,CAAC;EACF,oBAAoB;GAClB,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,OAAO;GACR,CAAC;EACF;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,SAAS,CACP;IAAE,OAAO;IAAQ,OAAO;IAAQ,EAChC;IAAE,OAAO;IAAS,OAAO;IAAS,CACnC;GACD,cAAc;GACd,OAAO;GACR;EACD,eAAe;GACb,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,OAAO;GACP,kBAAkB;IAAE,KAAK;IAAkB,OAAO;IAAS;GAC5D,CAAC;EACF;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,SAAS,CACP;IAAE,OAAO;IAAS,OAAO;IAAS,EAClC;IAAE,OAAO;IAAW,OAAO;IAAW,CACvC;GACD,cAAc;GACd,OAAO;GACP,kBAAkB;IAAE,KAAK;IAAkB,OAAO;IAAS;GAC5D;EACD;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,cAAc;GACd,OAAO;GACP,kBAAkB;IAAE,KAAK;IAAkB,OAAO;IAAS;GAC5D;EAGD;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,cAAc;GACd,OAAO;GACR;EACF;CACF"}
1
+ {"version":3,"file":"ImageWidget-B1Mx3qKN.mjs","names":[],"sources":["../../widgets/src/widgets/ImageWidget.tsx"],"sourcesContent":["import type { ComponentProps } from \"react\";\nimport type React from \"react\";\nimport {\n getBorderRadiusField,\n getHeightField,\n type WidgetPropertySchema,\n} from \"@fluid-app/portal-core/registries\";\nimport type {\n BorderRadiusOptions,\n BorderWidthOptions,\n ColorOptions,\n ShareableItem,\n} from \"@fluid-app/portal-core/types\";\nimport {\n getBorderWidthField,\n getBorderColorField,\n borderWidthClasses,\n borderColorClasses,\n} from \"../core/fields\";\nimport { MediaRenderer } from \"../components/MediaRenderer\";\n\ntype ImageWidgetProps = ComponentProps<\"div\"> & {\n src?: string;\n alt?: string;\n borderRadius?: BorderRadiusOptions;\n borderWidth?: BorderWidthOptions;\n borderColor?: ColorOptions;\n verticalSizing?: \"auto\" | \"fixed\";\n fixedHeight?: string;\n displayFit?: \"cover\" | \"contain\";\n focusPoint?: string;\n linkUrl?: string;\n resource?: ShareableItem;\n useCustomUrl?: boolean;\n editMode?: boolean;\n};\n\nexport function ImageWidget({\n src = \"\",\n alt = \"\",\n borderRadius = \"md\",\n borderWidth = \"none\",\n borderColor = \"muted\",\n verticalSizing = \"auto\",\n fixedHeight = \"200px\",\n displayFit = \"cover\",\n focusPoint,\n linkUrl,\n resource,\n useCustomUrl,\n editMode = false,\n}: ImageWidgetProps): React.JSX.Element {\n const effectiveSrc = useCustomUrl ? src : (resource?.imageUrl ?? src);\n const effectiveAlt = resource?.title ?? alt;\n\n const isFixed = verticalSizing === \"fixed\";\n\n const content = (\n <div\n className={`w-full rounded-${borderRadius} ${borderWidthClasses[borderWidth]} ${borderWidth !== \"none\" ? borderColorClasses[borderColor] : \"\"} overflow-hidden`}\n style={isFixed ? { height: fixedHeight } : undefined}\n >\n <MediaRenderer\n mediaType=\"image\"\n src={effectiveSrc}\n alt={effectiveAlt}\n objectFit={isFixed ? displayFit : \"contain\"}\n focusPoint={isFixed ? focusPoint : undefined}\n />\n </div>\n );\n\n if (linkUrl && !editMode) {\n return (\n <a href={linkUrl} target=\"_blank\" rel=\"noopener noreferrer\">\n {content}\n </a>\n );\n }\n\n return content;\n}\n\nexport const imageWidgetPropertySchema: WidgetPropertySchema = {\n widgetType: \"ImageWidget\",\n displayName: \"Image\",\n fields: [\n // Content\n {\n key: \"resource\",\n label: \"Select Image\",\n type: \"resource\",\n description: \"Browse and select an image\",\n allowedTypes: [\"Medium\"],\n group: \"Content\",\n },\n {\n key: \"useCustomUrl\",\n label: \"Use Custom URL\",\n type: \"boolean\",\n description: \"Enter a custom image URL instead of selecting media\",\n defaultValue: false,\n group: \"Content\",\n },\n {\n key: \"src\",\n label: \"Image URL\",\n type: \"text\",\n description: \"The source URL of the image\",\n defaultValue:\n \"https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=800&auto=format&fit=crop\",\n group: \"Content\",\n requiresKeyToBeTrue: \"useCustomUrl\",\n },\n {\n key: \"alt\",\n label: \"Alt Text\",\n type: \"text\",\n description: \"Alternative text for the image (for accessibility)\",\n defaultValue: \"Placeholder image\",\n group: \"Content\",\n },\n\n // Design\n getBorderRadiusField({\n key: \"borderRadius\",\n label: \"Border Radius\",\n description: \"Border radius for the container\",\n defaultValue: \"md\",\n group: \"Design\",\n }),\n getBorderWidthField({\n key: \"borderWidth\",\n label: \"Border Width\",\n description: \"Border width for the widget\",\n defaultValue: \"none\",\n group: \"Design\",\n }),\n getBorderColorField({\n key: \"borderColor\",\n label: \"Border Color\",\n description: \"Border color for the widget\",\n defaultValue: \"muted\",\n group: \"Design\",\n }),\n {\n key: \"verticalSizing\",\n label: \"Vertical Sizing\",\n type: \"buttonGroup\",\n description: \"How the image height is determined\",\n options: [\n { label: \"Auto\", value: \"auto\" },\n { label: \"Fixed\", value: \"fixed\" },\n ],\n defaultValue: \"auto\",\n group: \"Design\",\n },\n getHeightField({\n key: \"fixedHeight\",\n label: \"Height\",\n description: \"Fixed height of the image container\",\n defaultValue: \"200px\",\n group: \"Design\",\n requiresKeyValue: { key: \"verticalSizing\", value: \"fixed\" },\n }),\n {\n key: \"displayFit\",\n label: \"Display Fit\",\n type: \"buttonGroup\",\n description: \"How the image fills its container\",\n options: [\n { label: \"Cover\", value: \"cover\" },\n { label: \"Contain\", value: \"contain\" },\n ],\n defaultValue: \"cover\",\n group: \"Design\",\n requiresKeyValue: { key: \"verticalSizing\", value: \"fixed\" },\n },\n {\n key: \"focusPoint\",\n label: \"Focus Point\",\n type: \"contentPosition\",\n description: \"The focal point of the image within its container\",\n defaultValue: \"center\",\n group: \"Design\",\n requiresKeyValue: { key: \"verticalSizing\", value: \"fixed\" },\n },\n\n // Link\n {\n key: \"linkUrl\",\n label: \"Link URL\",\n type: \"text\",\n description: \"Optional URL to wrap the image in a link\",\n defaultValue: \"\",\n group: \"Link\",\n },\n ],\n};\n"],"mappings":";;;;;;;;;AAqCA,SAAgB,YAAY,EAC1B,MAAM,IACN,MAAM,IACN,eAAe,MACf,cAAc,QACd,cAAc,SACd,iBAAiB,QACjB,cAAc,SACd,aAAa,SACb,YACA,SACA,UACA,cACA,WAAW,SAC2B;CACtC,MAAM,eAAe,eAAe,MAAO,UAAU,YAAY;CACjE,MAAM,eAAe,UAAU,SAAS;CAExC,MAAM,UAAU,mBAAmB;CAEnC,MAAM,UACJ,oBAAC,OAAD;EACE,WAAW,kBAAkB,aAAa,GAAG,mBAAmB,aAAa,GAAG,gBAAgB,SAAS,mBAAmB,eAAe,GAAG;EAC9I,OAAO,UAAU,EAAE,QAAQ,aAAa,GAAG,KAAA;YAE3C,oBAAC,eAAD;GACE,WAAU;GACV,KAAK;GACL,KAAK;GACL,WAAW,UAAU,aAAa;GAClC,YAAY,UAAU,aAAa,KAAA;GACnC,CAAA;EACE,CAAA;AAGR,KAAI,WAAW,CAAC,SACd,QACE,oBAAC,KAAD;EAAG,MAAM;EAAS,QAAO;EAAS,KAAI;YACnC;EACC,CAAA;AAIR,QAAO;;AAGT,MAAa,4BAAkD;CAC7D,YAAY;CACZ,aAAa;CACb,QAAQ;EAEN;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,cAAc,CAAC,SAAS;GACxB,OAAO;GACR;EACD;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,cAAc;GACd,OAAO;GACR;EACD;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,cACE;GACF,OAAO;GACP,qBAAqB;GACtB;EACD;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,cAAc;GACd,OAAO;GACR;EAGD,qBAAqB;GACnB,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,OAAO;GACR,CAAC;EACF,oBAAoB;GAClB,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,OAAO;GACR,CAAC;EACF,oBAAoB;GAClB,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,OAAO;GACR,CAAC;EACF;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,SAAS,CACP;IAAE,OAAO;IAAQ,OAAO;IAAQ,EAChC;IAAE,OAAO;IAAS,OAAO;IAAS,CACnC;GACD,cAAc;GACd,OAAO;GACR;EACD,eAAe;GACb,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,OAAO;GACP,kBAAkB;IAAE,KAAK;IAAkB,OAAO;IAAS;GAC5D,CAAC;EACF;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,SAAS,CACP;IAAE,OAAO;IAAS,OAAO;IAAS,EAClC;IAAE,OAAO;IAAW,OAAO;IAAW,CACvC;GACD,cAAc;GACd,OAAO;GACP,kBAAkB;IAAE,KAAK;IAAkB,OAAO;IAAS;GAC5D;EACD;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,cAAc;GACd,OAAO;GACP,kBAAkB;IAAE,KAAK;IAAkB,OAAO;IAAS;GAC5D;EAGD;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,cAAc;GACd,OAAO;GACR;EACF;CACF"}
@@ -1,4 +1,4 @@
1
- import { n as __exportAll } from "./chunk-ByhMGyNw.mjs";
1
+ import { r as __exportAll } from "./es-CTLNkiWp.mjs";
2
2
  import { l as useRegistry, s as useScreenRenderer, t as ScreenRenderer } from "./ScreenRenderer-DM-G72GL.mjs";
3
3
  import { f as getGapField, i as getBorderColorField, m as getPaddingField, n as borderWidthClasses, o as getBorderRadiusField, r as gapValues, s as getBorderWidthField, t as borderColorClasses } from "./registries-CM_NlECC.mjs";
4
4
  import { jsx } from "react/jsx-runtime";
@@ -181,4 +181,4 @@ const layoutWidgetPropertySchema = {
181
181
  //#endregion
182
182
  export { sectionLayoutConfig as a, groupChildrenByColumn as i, LayoutWidget_exports as n, layoutWidgetPropertySchema as r, LayoutWidget as t };
183
183
 
184
- //# sourceMappingURL=LayoutWidget-BFO_PHWw.mjs.map
184
+ //# sourceMappingURL=LayoutWidget-Bgodl7eR.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"LayoutWidget-BFO_PHWw.mjs","names":["ScreenRenderer","DefaultScreenRenderer"],"sources":["../../core/src/types/field-types.ts","../../core/src/widget-utils/widget-utils.ts","../../widgets/src/widgets/LayoutWidget.tsx"],"sourcesContent":["import type { ShareableItem } from \"./shareable-item\";\n\n// ============================================================================\n// Color Options - Derive type from constant for single source of truth\n// ============================================================================\n\n/**\n * Color options constant - single source of truth for color values.\n * Use COLOR_OPTIONS.primary instead of \"primary\" for type-safe comparisons.\n */\nexport const COLOR_OPTIONS = {\n background: \"background\",\n foreground: \"foreground\",\n primary: \"primary\",\n secondary: \"secondary\",\n accent: \"accent\",\n muted: \"muted\",\n border: \"border\",\n destructive: \"destructive\",\n transparent: \"transparent\",\n} as const;\n\n/**\n * Union type of all color options, derived from COLOR_OPTIONS constant.\n * @see deriving-typeof-for-object-keys pattern\n */\nexport type ColorOptions = (typeof COLOR_OPTIONS)[keyof typeof COLOR_OPTIONS];\n\n// ============================================================================\n// Size Options - Derive types from constants for single source of truth\n// ============================================================================\n\nexport const FONT_SIZE_OPTIONS = {\n \"2xl\": \"2xl\",\n xl: \"xl\",\n lg: \"lg\",\n md: \"md\",\n sm: \"sm\",\n xs: \"xs\",\n} as const;\n\nexport type FontSizeOptions =\n (typeof FONT_SIZE_OPTIONS)[keyof typeof FONT_SIZE_OPTIONS];\n\nexport const FONT_WEIGHT_OPTIONS = {\n normal: \"normal\",\n medium: \"medium\",\n semibold: \"semibold\",\n bold: \"bold\",\n} as const;\n\nexport type FontWeightOptions =\n (typeof FONT_WEIGHT_OPTIONS)[keyof typeof FONT_WEIGHT_OPTIONS];\n\nexport const BORDER_RADIUS_OPTIONS = {\n none: \"none\",\n sm: \"sm\",\n md: \"md\",\n lg: \"lg\",\n xl: \"xl\",\n full: \"full\",\n} as const;\n\nexport type BorderRadiusOptions =\n (typeof BORDER_RADIUS_OPTIONS)[keyof typeof BORDER_RADIUS_OPTIONS];\n\nexport const BORDER_WIDTH_OPTIONS = {\n none: \"none\",\n thin: \"thin\",\n medium: \"medium\",\n thick: \"thick\",\n} as const;\n\nexport type BorderWidthOptions =\n (typeof BORDER_WIDTH_OPTIONS)[keyof typeof BORDER_WIDTH_OPTIONS];\n\n/** Padding values - numeric, so we use a tuple for derivation */\nexport const PADDING_VALUES = [0, 2, 4, 6, 8, 10] as const;\nexport type PaddingOptions = (typeof PADDING_VALUES)[number];\n\nexport const BUTTON_SIZE_OPTIONS = {\n sm: \"sm\",\n default: \"default\",\n lg: \"lg\",\n xl: \"xl\",\n} as const;\n\nexport type ButtonSizeOptions =\n (typeof BUTTON_SIZE_OPTIONS)[keyof typeof BUTTON_SIZE_OPTIONS];\n\nexport const GAP_OPTIONS = {\n none: \"none\",\n xs: \"xs\",\n sm: \"sm\",\n md: \"md\",\n lg: \"lg\",\n xl: \"xl\",\n} as const;\n\nexport type GapOptions = (typeof GAP_OPTIONS)[keyof typeof GAP_OPTIONS];\n\n// ============================================================================\n// Alignment Options - Derive from constants\n// ============================================================================\n\nexport const VERTICAL_ALIGN_OPTIONS = {\n top: \"top\",\n center: \"center\",\n bottom: \"bottom\",\n} as const;\n\nexport type VerticalAlign =\n (typeof VERTICAL_ALIGN_OPTIONS)[keyof typeof VERTICAL_ALIGN_OPTIONS];\n\nexport const HORIZONTAL_ALIGN_OPTIONS = {\n left: \"left\",\n center: \"center\",\n right: \"right\",\n} as const;\n\nexport type HorizontalAlign =\n (typeof HORIZONTAL_ALIGN_OPTIONS)[keyof typeof HORIZONTAL_ALIGN_OPTIONS];\n\nexport type AlignOptions = {\n vertical?: VerticalAlign;\n horizontal?: HorizontalAlign;\n};\n\n// ============================================================================\n// Background Options - Derive from constant\n// ============================================================================\n\nexport const BACKGROUND_TYPES = {\n solid: \"solid\",\n image: \"image\",\n} as const;\n\nexport type BackgroundType =\n (typeof BACKGROUND_TYPES)[keyof typeof BACKGROUND_TYPES];\nexport interface BackgroundValue {\n type: BackgroundType;\n color?: ColorOptions;\n resource?: ShareableItem;\n}\n\n// ============================================================================\n// Section Layout - Derive type from config keys (single source of truth)\n// ============================================================================\n\n/**\n * Section layout configuration - single source of truth for layout types.\n * SectionLayoutType is derived from these keys to prevent drift.\n */\nexport const SECTION_LAYOUT_CONFIG: {\n readonly \"single-column\": {\n readonly columns: 1;\n readonly widths: readonly [\"1fr\"];\n readonly gridClasses: \"\";\n };\n readonly \"2c-equal\": {\n readonly columns: 2;\n readonly widths: readonly [\"1fr\", \"1fr\"];\n readonly gridClasses: \"@md:grid-cols-2\";\n };\n readonly \"2c-left-wider\": {\n readonly columns: 2;\n readonly widths: readonly [\"2fr\", \"1fr\"];\n readonly gridClasses: \"@md:grid-cols-[2fr_1fr]\";\n };\n readonly \"2c-right-wider\": {\n readonly columns: 2;\n readonly widths: readonly [\"1fr\", \"2fr\"];\n readonly gridClasses: \"@md:grid-cols-[1fr_2fr]\";\n };\n readonly \"2c-left-narrow\": {\n readonly columns: 2;\n readonly widths: readonly [\"1fr\", \"3fr\"];\n readonly gridClasses: \"@md:grid-cols-[1fr_3fr]\";\n };\n readonly \"2c-right-narrow\": {\n readonly columns: 2;\n readonly widths: readonly [\"3fr\", \"1fr\"];\n readonly gridClasses: \"@md:grid-cols-[3fr_1fr]\";\n };\n readonly \"3c-equal\": {\n readonly columns: 3;\n readonly widths: readonly [\"1fr\", \"1fr\", \"1fr\"];\n readonly gridClasses: \"@md:grid-cols-3\";\n };\n readonly \"3c-middle-wider\": {\n readonly columns: 3;\n readonly widths: readonly [\"1fr\", \"2fr\", \"1fr\"];\n readonly gridClasses: \"@md:grid-cols-[1fr_2fr_1fr]\";\n };\n} = {\n \"single-column\": { columns: 1, widths: [\"1fr\"], gridClasses: \"\" },\n \"2c-equal\": {\n columns: 2,\n widths: [\"1fr\", \"1fr\"],\n gridClasses: \"@md:grid-cols-2\",\n },\n \"2c-left-wider\": {\n columns: 2,\n widths: [\"2fr\", \"1fr\"],\n gridClasses: \"@md:grid-cols-[2fr_1fr]\",\n },\n \"2c-right-wider\": {\n columns: 2,\n widths: [\"1fr\", \"2fr\"],\n gridClasses: \"@md:grid-cols-[1fr_2fr]\",\n },\n \"2c-left-narrow\": {\n columns: 2,\n widths: [\"1fr\", \"3fr\"],\n gridClasses: \"@md:grid-cols-[1fr_3fr]\",\n },\n \"2c-right-narrow\": {\n columns: 2,\n widths: [\"3fr\", \"1fr\"],\n gridClasses: \"@md:grid-cols-[3fr_1fr]\",\n },\n \"3c-equal\": {\n columns: 3,\n widths: [\"1fr\", \"1fr\", \"1fr\"],\n gridClasses: \"@md:grid-cols-3\",\n },\n \"3c-middle-wider\": {\n columns: 3,\n widths: [\"1fr\", \"2fr\", \"1fr\"],\n gridClasses: \"@md:grid-cols-[1fr_2fr_1fr]\",\n },\n} as const satisfies Record<\n string,\n {\n readonly columns: number;\n readonly widths: readonly string[];\n readonly gridClasses: string;\n }\n>;\n\n/**\n * Union type of all section layout types, derived from SECTION_LAYOUT_CONFIG keys.\n * @see deriving-typeof-for-object-keys pattern\n */\nexport type SectionLayoutType = keyof typeof SECTION_LAYOUT_CONFIG;\n\n/** @deprecated Use SECTION_LAYOUT_CONFIG instead */\nexport const sectionLayoutConfig: typeof SECTION_LAYOUT_CONFIG =\n SECTION_LAYOUT_CONFIG;\n","import type { WidgetSchema, WidgetPath } from \"../types\";\nimport { WIDGET_TYPE_NAMES, isWidgetType } from \"../types\";\n\n/**\n * Generates a unique ID for a widget\n */\nexport function generateWidgetId(type?: string): string {\n const uuid = crypto.randomUUID();\n return type ? `${type}-${uuid}` : uuid;\n}\n\n/**\n * Converts a widget path to a unique string identifier\n */\nexport function pathToId(path: WidgetPath): string {\n return path.join(\"-\");\n}\n\n/**\n * Converts a path string back to a WidgetPath array\n */\nexport function idToPath(id: string): WidgetPath {\n return id.split(\"-\").map((segment) => parseInt(segment, 10));\n}\n\n/**\n * Ensures all widgets in an array have valid IDs\n * Note: Handles null values for sparse arrays (e.g., grid layouts with empty cells)\n */\nexport function ensureWidgetIds(\n widgets: readonly (WidgetSchema | null)[],\n): (WidgetSchema | null)[] {\n return widgets?.map((widget, index) => {\n if (!widget) return null;\n return {\n ...widget,\n id: widget.id || `widget-${index}-${crypto.randomUUID()}`,\n };\n });\n}\n\n/**\n * Deep clones a widget and regenerates all IDs (including nested children)\n */\nexport function deepCloneWidget(widget: WidgetSchema): WidgetSchema {\n // Handle LayoutWidget children recursively\n // Use type guard for discriminated union narrowing (narrowing-discriminated-unions rule)\n if (\n isWidgetType(widget, WIDGET_TYPE_NAMES.Layout) &&\n Array.isArray(widget.props.children)\n ) {\n // Build cloned widget with recursively cloned children\n return {\n type: widget.type,\n props: {\n ...widget.props,\n children: (\n widget.props.children as readonly (WidgetSchema | null)[]\n ).map((child) => (child ? deepCloneWidget(child) : null)),\n },\n id: generateWidgetId(widget.type),\n };\n }\n\n // Clone non-container widget\n return {\n type: widget.type,\n props: { ...widget.props },\n id: generateWidgetId(widget.type),\n };\n}\n\n/**\n * Deep clones an array of widgets and regenerates all IDs\n */\nexport function deepCloneWidgets(\n widgets: readonly WidgetSchema[],\n): WidgetSchema[] {\n return widgets.map((widget) => deepCloneWidget(widget));\n}\n\n/**\n * Gets a widget at a specific path in the widget tree\n */\nexport function getWidgetByPath(\n screen: readonly (WidgetSchema | null)[],\n path: WidgetPath,\n): WidgetSchema | null {\n if (path.length === 0 || path[0] === undefined) return null;\n\n let current: WidgetSchema | null = screen[path[0]] ?? null;\n\n for (let i = 1; i < path.length; i++) {\n // Use type guard for discriminated union narrowing (narrowing-discriminated-unions rule)\n if (!isWidgetType(current, WIDGET_TYPE_NAMES.Layout)) return null;\n\n const children = (current.props.children ??\n []) as readonly (WidgetSchema | null)[];\n const index = path[i];\n if (index === undefined) return null;\n current = children[index] ?? null;\n }\n\n return current;\n}\n\n/**\n * Groups children by column index.\n * Accepts nullable children (sparse arrays from grid layouts) and filters them out.\n */\nexport function groupChildrenByColumn(\n children: readonly (WidgetSchema | null)[],\n columnCount: number,\n): WidgetSchema[][] {\n // Use explicit type annotation to avoid never[] inference (narrowing-empty-array-type rule)\n const columns: WidgetSchema[][] = Array.from(\n { length: columnCount },\n (): WidgetSchema[] => [],\n );\n\n // Filter out nulls first, then process (truthiness narrowing rule)\n // This avoids the narrowing-callback-scope issue since we work with non-null array\n const nonNullChildren = children.filter(\n (child): child is WidgetSchema => child !== null,\n );\n\n for (const child of nonNullChildren) {\n // Default to column 0 if no columnIndex specified\n const colIndex = Math.min(child.columnIndex ?? 0, columnCount - 1);\n const column = columns[colIndex];\n if (column) {\n column.push(child);\n }\n }\n\n return columns;\n}\n","import { ScreenRenderer as DefaultScreenRenderer } from \"../core/ScreenRenderer\";\nimport { useRegistry } from \"../contexts/RegistryContext\";\nimport { useScreenRenderer } from \"../contexts/ScreenRendererContext\";\nimport type {\n TypedWidgetSchema,\n WidgetSchema,\n BorderRadiusOptions,\n BorderWidthOptions,\n ColorOptions,\n PaddingOptions,\n GapOptions,\n SectionLayoutType,\n BackgroundValue,\n} from \"@fluid-app/portal-core/types\";\nimport { sectionLayoutConfig } from \"@fluid-app/portal-core/types\";\nimport type { ComponentType } from \"react\";\nimport type React from \"react\";\nimport type { WidgetPropertySchema } from \"@fluid-app/portal-core/registries\";\nimport {\n getBorderRadiusField,\n getBorderWidthField,\n getBorderColorField,\n getGapField,\n getPaddingField,\n gapValues,\n borderWidthClasses,\n borderColorClasses,\n} from \"../core/fields\";\nimport { groupChildrenByColumn } from \"@fluid-app/portal-core/widget-utils\";\n\nconst DEFAULT_BACKGROUND: BackgroundValue = {\n type: \"solid\",\n color: \"background\",\n};\nconst DEFAULT_CHILDREN: (WidgetSchema | null)[] = [];\n\ntype LayoutProps<\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n T extends Record<string, ComponentType<any>> = Record<\n string,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ComponentType<any>\n >,\n> = {\n // Section layout type (masonry-style column configuration)\n sectionLayout?: SectionLayoutType;\n\n // Legacy props (deprecated, kept for backward compatibility)\n type?: \"flex\" | \"grid\";\n columns?: number;\n rows?: number;\n direction?: string;\n justify?: string;\n align?: string;\n wrap?: boolean;\n\n // Spacing\n gap?: number; // deprecated, use gapSize instead\n gapSize?: GapOptions;\n\n // Design\n background?: BackgroundValue;\n padding?: PaddingOptions;\n borderRadius?: BorderRadiusOptions;\n borderWidth?: BorderWidthOptions;\n borderColor?: ColorOptions;\n\n // Content - widgets with columnIndex property for masonry layout\n children: (TypedWidgetSchema<T> | null)[] | (WidgetSchema | null)[];\n\n // Widget registry (passed down from parent renderer)\n registry?: T;\n\n // Styling\n className?: string;\n minHeight?: number;\n};\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const LayoutWidget = <T extends Record<string, ComponentType<any>>>({\n sectionLayout = \"single-column\",\n gap = 4,\n gapSize,\n background = DEFAULT_BACKGROUND,\n padding = 0,\n borderRadius = \"md\",\n borderWidth = \"none\",\n borderColor = \"muted\",\n children = DEFAULT_CHILDREN,\n registry,\n className = \"\",\n minHeight,\n}: LayoutProps<T>): React.JSX.Element => {\n // Get registry from context if not provided as prop\n const contextRegistry = useRegistry();\n const effectiveRegistry = registry || contextRegistry;\n\n // Use ScreenRenderer from context (e.g. portal-builder's), fall back to local\n const ContextScreenRenderer = useScreenRenderer();\n const ScreenRenderer = ContextScreenRenderer ?? DefaultScreenRenderer;\n\n // Extract background values\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 // Get layout configuration\n const layoutConfig = sectionLayoutConfig[sectionLayout];\n const columnCount = layoutConfig.columns;\n\n // Calculate gap size\n const gapSizeValue = gapSize ? gapValues[gapSize] : gap;\n\n // Build CSS classes for masonry layout with responsive columns\n const layoutClasses = [\n \"grid\",\n \"grid-cols-1\", // Mobile: single column\n layoutConfig.gridClasses, // Desktop (@md+): configured columns\n `bg-${backgroundColor} p-${padding} rounded-${borderRadius} ${borderWidthClasses[borderWidth]} ${borderWidth !== \"none\" ? borderColorClasses[borderColor] : \"\"}`,\n `gap-${gapSizeValue}`,\n className,\n ]\n .filter(Boolean)\n .join(\" \");\n\n // Container style\n const containerStyle: React.CSSProperties = {\n ...(minHeight ? { minHeight: `${minHeight}px` } : {}),\n alignItems: \"start\", // Masonry-style: columns don't stretch to match height\n backgroundImage,\n };\n\n // If no registry is available, we can't render the children\n if (!effectiveRegistry) {\n console.warn(\"Layout widget: No registry provided, cannot render children\");\n return <div className={layoutClasses} style={containerStyle} />;\n }\n\n // Group children by column\n const columnGroups = groupChildrenByColumn(\n children as WidgetSchema[],\n columnCount,\n );\n\n // Regular render mode - render each column as a flex column\n return (\n <div className=\"@container\">\n <div className={layoutClasses} style={containerStyle}>\n {columnGroups.map((columnChildren, colIndex) => (\n <ScreenRenderer\n key={colIndex}\n screen={columnChildren}\n registry={effectiveRegistry}\n className={`flex flex-col gap-${gapSizeValue}`}\n />\n ))}\n </div>\n </div>\n );\n};\n\nexport const layoutWidgetPropertySchema: WidgetPropertySchema = {\n widgetType: \"LayoutWidget\",\n displayName: \"Layout\",\n fields: [\n // Layout Configuration - Visual selector matching Figma design\n {\n key: \"sectionLayout\",\n label: \"Layout Type\",\n type: \"sectionLayoutSelect\",\n description: \"Column layout configuration\",\n defaultValue: \"single-column\",\n group: \"Layout\",\n },\n\n // Design\n getGapField({\n key: \"gapSize\",\n label: \"Gap\",\n description: \"Gap between columns and widgets\",\n defaultValue: \"md\",\n group: \"Design\",\n }),\n {\n type: \"background\",\n key: \"background\",\n label: \"Background\",\n description: \"Background for the layout container\",\n defaultValue: \"background\",\n group: \"Design\",\n },\n getPaddingField({\n key: \"padding\",\n label: \"Padding\",\n description: \"Padding for the layout container\",\n defaultValue: 4,\n group: \"Design\",\n }),\n getBorderRadiusField({\n key: \"borderRadius\",\n label: \"Border Radius\",\n description: \"Border radius for the layout container\",\n defaultValue: \"md\",\n group: \"Design\",\n }),\n getBorderWidthField({\n key: \"borderWidth\",\n label: \"Border Width\",\n description: \"Border width for the widget\",\n defaultValue: \"none\",\n group: \"Design\",\n }),\n getBorderColorField({\n key: \"borderColor\",\n label: \"Border Color\",\n description: \"Border color for the widget\",\n defaultValue: \"muted\",\n group: \"Design\",\n }),\n ],\n};\n"],"mappings":";;;;;AAuPA,MAAa,sBArDT;CACF,iBAAiB;EAAE,SAAS;EAAG,QAAQ,CAAC,MAAM;EAAE,aAAa;EAAI;CACjE,YAAY;EACV,SAAS;EACT,QAAQ,CAAC,OAAO,MAAM;EACtB,aAAa;EACd;CACD,iBAAiB;EACf,SAAS;EACT,QAAQ,CAAC,OAAO,MAAM;EACtB,aAAa;EACd;CACD,kBAAkB;EAChB,SAAS;EACT,QAAQ,CAAC,OAAO,MAAM;EACtB,aAAa;EACd;CACD,kBAAkB;EAChB,SAAS;EACT,QAAQ,CAAC,OAAO,MAAM;EACtB,aAAa;EACd;CACD,mBAAmB;EACjB,SAAS;EACT,QAAQ,CAAC,OAAO,MAAM;EACtB,aAAa;EACd;CACD,YAAY;EACV,SAAS;EACT,QAAQ;GAAC;GAAO;GAAO;GAAM;EAC7B,aAAa;EACd;CACD,mBAAmB;EACjB,SAAS;EACT,QAAQ;GAAC;GAAO;GAAO;GAAM;EAC7B,aAAa;EACd;CACF;;;;;;;ACzHD,SAAgB,sBACd,UACA,aACkB;CAElB,MAAM,UAA4B,MAAM,KACtC,EAAE,QAAQ,aAAa,QACD,EAAE,CACzB;CAID,MAAM,kBAAkB,SAAS,QAC9B,UAAiC,UAAU,KAC7C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,UACA,YACD,CAMmB,KAAK,gBAAgB,aACjC,oBAACD,kBAAD;IAEE,QAAQ;IACR,UAAU;IACV,WAAW,qBAAqB;IAChC,EAJK,SAIL,CACF;GACE,CAAA;EACF,CAAA;;AAIV,MAAa,6BAAmD;CAC9D,YAAY;CACZ,aAAa;CACb,QAAQ;EAEN;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,cAAc;GACd,OAAO;GACR;EAGD,YAAY;GACV,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,OAAO;GACR,CAAC;EACF;GACE,MAAM;GACN,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,OAAO;GACR;EACD,gBAAgB;GACd,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,OAAO;GACR,CAAC;EACF,qBAAqB;GACnB,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,OAAO;GACR,CAAC;EACF,oBAAoB;GAClB,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,OAAO;GACR,CAAC;EACF,oBAAoB;GAClB,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,OAAO;GACR,CAAC;EACH;CACF"}
1
+ {"version":3,"file":"LayoutWidget-Bgodl7eR.mjs","names":["ScreenRenderer","DefaultScreenRenderer"],"sources":["../../core/src/types/field-types.ts","../../core/src/widget-utils/widget-utils.ts","../../widgets/src/widgets/LayoutWidget.tsx"],"sourcesContent":["import type { ShareableItem } from \"./shareable-item\";\n\n// ============================================================================\n// Color Options - Derive type from constant for single source of truth\n// ============================================================================\n\n/**\n * Color options constant - single source of truth for color values.\n * Use COLOR_OPTIONS.primary instead of \"primary\" for type-safe comparisons.\n */\nexport const COLOR_OPTIONS = {\n background: \"background\",\n foreground: \"foreground\",\n primary: \"primary\",\n secondary: \"secondary\",\n accent: \"accent\",\n muted: \"muted\",\n border: \"border\",\n destructive: \"destructive\",\n transparent: \"transparent\",\n} as const;\n\n/**\n * Union type of all color options, derived from COLOR_OPTIONS constant.\n * @see deriving-typeof-for-object-keys pattern\n */\nexport type ColorOptions = (typeof COLOR_OPTIONS)[keyof typeof COLOR_OPTIONS];\n\n// ============================================================================\n// Size Options - Derive types from constants for single source of truth\n// ============================================================================\n\nexport const FONT_SIZE_OPTIONS = {\n \"2xl\": \"2xl\",\n xl: \"xl\",\n lg: \"lg\",\n md: \"md\",\n sm: \"sm\",\n xs: \"xs\",\n} as const;\n\nexport type FontSizeOptions =\n (typeof FONT_SIZE_OPTIONS)[keyof typeof FONT_SIZE_OPTIONS];\n\nexport const FONT_WEIGHT_OPTIONS = {\n normal: \"normal\",\n medium: \"medium\",\n semibold: \"semibold\",\n bold: \"bold\",\n} as const;\n\nexport type FontWeightOptions =\n (typeof FONT_WEIGHT_OPTIONS)[keyof typeof FONT_WEIGHT_OPTIONS];\n\nexport const BORDER_RADIUS_OPTIONS = {\n none: \"none\",\n sm: \"sm\",\n md: \"md\",\n lg: \"lg\",\n xl: \"xl\",\n full: \"full\",\n} as const;\n\nexport type BorderRadiusOptions =\n (typeof BORDER_RADIUS_OPTIONS)[keyof typeof BORDER_RADIUS_OPTIONS];\n\nexport const BORDER_WIDTH_OPTIONS = {\n none: \"none\",\n thin: \"thin\",\n medium: \"medium\",\n thick: \"thick\",\n} as const;\n\nexport type BorderWidthOptions =\n (typeof BORDER_WIDTH_OPTIONS)[keyof typeof BORDER_WIDTH_OPTIONS];\n\n/** Padding values - numeric, so we use a tuple for derivation */\nexport const PADDING_VALUES = [0, 2, 4, 6, 8, 10] as const;\nexport type PaddingOptions = (typeof PADDING_VALUES)[number];\n\nexport const BUTTON_SIZE_OPTIONS = {\n sm: \"sm\",\n default: \"default\",\n lg: \"lg\",\n xl: \"xl\",\n} as const;\n\nexport type ButtonSizeOptions =\n (typeof BUTTON_SIZE_OPTIONS)[keyof typeof BUTTON_SIZE_OPTIONS];\n\nexport const GAP_OPTIONS = {\n none: \"none\",\n xs: \"xs\",\n sm: \"sm\",\n md: \"md\",\n lg: \"lg\",\n xl: \"xl\",\n} as const;\n\nexport type GapOptions = (typeof GAP_OPTIONS)[keyof typeof GAP_OPTIONS];\n\n// ============================================================================\n// Alignment Options - Derive from constants\n// ============================================================================\n\nexport const VERTICAL_ALIGN_OPTIONS = {\n top: \"top\",\n center: \"center\",\n bottom: \"bottom\",\n} as const;\n\nexport type VerticalAlign =\n (typeof VERTICAL_ALIGN_OPTIONS)[keyof typeof VERTICAL_ALIGN_OPTIONS];\n\nexport const HORIZONTAL_ALIGN_OPTIONS = {\n left: \"left\",\n center: \"center\",\n right: \"right\",\n} as const;\n\nexport type HorizontalAlign =\n (typeof HORIZONTAL_ALIGN_OPTIONS)[keyof typeof HORIZONTAL_ALIGN_OPTIONS];\n\nexport type AlignOptions = {\n vertical?: VerticalAlign;\n horizontal?: HorizontalAlign;\n};\n\n// ============================================================================\n// Background Options - Derive from constant\n// ============================================================================\n\nexport const BACKGROUND_TYPES = {\n solid: \"solid\",\n image: \"image\",\n} as const;\n\nexport type BackgroundType =\n (typeof BACKGROUND_TYPES)[keyof typeof BACKGROUND_TYPES];\nexport interface BackgroundValue {\n type: BackgroundType;\n color?: ColorOptions;\n resource?: ShareableItem;\n}\n\n// ============================================================================\n// Section Layout - Derive type from config keys (single source of truth)\n// ============================================================================\n\n/**\n * Section layout configuration - single source of truth for layout types.\n * SectionLayoutType is derived from these keys to prevent drift.\n */\nexport const SECTION_LAYOUT_CONFIG: {\n readonly \"single-column\": {\n readonly columns: 1;\n readonly widths: readonly [\"1fr\"];\n readonly gridClasses: \"\";\n };\n readonly \"2c-equal\": {\n readonly columns: 2;\n readonly widths: readonly [\"1fr\", \"1fr\"];\n readonly gridClasses: \"@md:grid-cols-2\";\n };\n readonly \"2c-left-wider\": {\n readonly columns: 2;\n readonly widths: readonly [\"2fr\", \"1fr\"];\n readonly gridClasses: \"@md:grid-cols-[2fr_1fr]\";\n };\n readonly \"2c-right-wider\": {\n readonly columns: 2;\n readonly widths: readonly [\"1fr\", \"2fr\"];\n readonly gridClasses: \"@md:grid-cols-[1fr_2fr]\";\n };\n readonly \"2c-left-narrow\": {\n readonly columns: 2;\n readonly widths: readonly [\"1fr\", \"3fr\"];\n readonly gridClasses: \"@md:grid-cols-[1fr_3fr]\";\n };\n readonly \"2c-right-narrow\": {\n readonly columns: 2;\n readonly widths: readonly [\"3fr\", \"1fr\"];\n readonly gridClasses: \"@md:grid-cols-[3fr_1fr]\";\n };\n readonly \"3c-equal\": {\n readonly columns: 3;\n readonly widths: readonly [\"1fr\", \"1fr\", \"1fr\"];\n readonly gridClasses: \"@md:grid-cols-3\";\n };\n readonly \"3c-middle-wider\": {\n readonly columns: 3;\n readonly widths: readonly [\"1fr\", \"2fr\", \"1fr\"];\n readonly gridClasses: \"@md:grid-cols-[1fr_2fr_1fr]\";\n };\n} = {\n \"single-column\": { columns: 1, widths: [\"1fr\"], gridClasses: \"\" },\n \"2c-equal\": {\n columns: 2,\n widths: [\"1fr\", \"1fr\"],\n gridClasses: \"@md:grid-cols-2\",\n },\n \"2c-left-wider\": {\n columns: 2,\n widths: [\"2fr\", \"1fr\"],\n gridClasses: \"@md:grid-cols-[2fr_1fr]\",\n },\n \"2c-right-wider\": {\n columns: 2,\n widths: [\"1fr\", \"2fr\"],\n gridClasses: \"@md:grid-cols-[1fr_2fr]\",\n },\n \"2c-left-narrow\": {\n columns: 2,\n widths: [\"1fr\", \"3fr\"],\n gridClasses: \"@md:grid-cols-[1fr_3fr]\",\n },\n \"2c-right-narrow\": {\n columns: 2,\n widths: [\"3fr\", \"1fr\"],\n gridClasses: \"@md:grid-cols-[3fr_1fr]\",\n },\n \"3c-equal\": {\n columns: 3,\n widths: [\"1fr\", \"1fr\", \"1fr\"],\n gridClasses: \"@md:grid-cols-3\",\n },\n \"3c-middle-wider\": {\n columns: 3,\n widths: [\"1fr\", \"2fr\", \"1fr\"],\n gridClasses: \"@md:grid-cols-[1fr_2fr_1fr]\",\n },\n} as const satisfies Record<\n string,\n {\n readonly columns: number;\n readonly widths: readonly string[];\n readonly gridClasses: string;\n }\n>;\n\n/**\n * Union type of all section layout types, derived from SECTION_LAYOUT_CONFIG keys.\n * @see deriving-typeof-for-object-keys pattern\n */\nexport type SectionLayoutType = keyof typeof SECTION_LAYOUT_CONFIG;\n\n/** @deprecated Use SECTION_LAYOUT_CONFIG instead */\nexport const sectionLayoutConfig: typeof SECTION_LAYOUT_CONFIG =\n SECTION_LAYOUT_CONFIG;\n","import type { WidgetSchema, WidgetPath } from \"../types\";\nimport { WIDGET_TYPE_NAMES, isWidgetType } from \"../types\";\n\n/**\n * Generates a unique ID for a widget\n */\nexport function generateWidgetId(type?: string): string {\n const uuid = crypto.randomUUID();\n return type ? `${type}-${uuid}` : uuid;\n}\n\n/**\n * Converts a widget path to a unique string identifier\n */\nexport function pathToId(path: WidgetPath): string {\n return path.join(\"-\");\n}\n\n/**\n * Converts a path string back to a WidgetPath array\n */\nexport function idToPath(id: string): WidgetPath {\n return id.split(\"-\").map((segment) => parseInt(segment, 10));\n}\n\n/**\n * Ensures all widgets in an array have valid IDs\n * Note: Handles null values for sparse arrays (e.g., grid layouts with empty cells)\n */\nexport function ensureWidgetIds(\n widgets: readonly (WidgetSchema | null)[],\n): (WidgetSchema | null)[] {\n return widgets?.map((widget, index) => {\n if (!widget) return null;\n return {\n ...widget,\n id: widget.id || `widget-${index}-${crypto.randomUUID()}`,\n };\n });\n}\n\n/**\n * Deep clones a widget and regenerates all IDs (including nested children)\n */\nexport function deepCloneWidget(widget: WidgetSchema): WidgetSchema {\n // Handle LayoutWidget children recursively\n // Use type guard for discriminated union narrowing (narrowing-discriminated-unions rule)\n if (\n isWidgetType(widget, WIDGET_TYPE_NAMES.Layout) &&\n Array.isArray(widget.props.children)\n ) {\n // Build cloned widget with recursively cloned children\n return {\n type: widget.type,\n props: {\n ...widget.props,\n children: (\n widget.props.children as readonly (WidgetSchema | null)[]\n ).map((child) => (child ? deepCloneWidget(child) : null)),\n },\n id: generateWidgetId(widget.type),\n };\n }\n\n // Clone non-container widget\n return {\n type: widget.type,\n props: { ...widget.props },\n id: generateWidgetId(widget.type),\n };\n}\n\n/**\n * Deep clones an array of widgets and regenerates all IDs\n */\nexport function deepCloneWidgets(\n widgets: readonly WidgetSchema[],\n): WidgetSchema[] {\n return widgets.map((widget) => deepCloneWidget(widget));\n}\n\n/**\n * Gets a widget at a specific path in the widget tree\n */\nexport function getWidgetByPath(\n screen: readonly (WidgetSchema | null)[],\n path: WidgetPath,\n): WidgetSchema | null {\n if (path.length === 0 || path[0] === undefined) return null;\n\n let current: WidgetSchema | null = screen[path[0]] ?? null;\n\n for (let i = 1; i < path.length; i++) {\n // Use type guard for discriminated union narrowing (narrowing-discriminated-unions rule)\n if (!isWidgetType(current, WIDGET_TYPE_NAMES.Layout)) return null;\n\n const children = (current.props.children ??\n []) as readonly (WidgetSchema | null)[];\n const index = path[i];\n if (index === undefined) return null;\n current = children[index] ?? null;\n }\n\n return current;\n}\n\n/**\n * Groups children by column index.\n * Accepts nullable children (sparse arrays from grid layouts) and filters them out.\n */\nexport function groupChildrenByColumn(\n children: readonly (WidgetSchema | null)[],\n columnCount: number,\n): WidgetSchema[][] {\n // Use explicit type annotation to avoid never[] inference (narrowing-empty-array-type rule)\n const columns: WidgetSchema[][] = Array.from(\n { length: columnCount },\n (): WidgetSchema[] => [],\n );\n\n // Filter out nulls first, then process (truthiness narrowing rule)\n // This avoids the narrowing-callback-scope issue since we work with non-null array\n const nonNullChildren = children.filter(\n (child): child is WidgetSchema => child !== null,\n );\n\n for (const child of nonNullChildren) {\n // Default to column 0 if no columnIndex specified\n const colIndex = Math.min(child.columnIndex ?? 0, columnCount - 1);\n const column = columns[colIndex];\n if (column) {\n column.push(child);\n }\n }\n\n return columns;\n}\n","import { ScreenRenderer as DefaultScreenRenderer } from \"../core/ScreenRenderer\";\nimport { useRegistry } from \"../contexts/RegistryContext\";\nimport { useScreenRenderer } from \"../contexts/ScreenRendererContext\";\nimport type {\n TypedWidgetSchema,\n WidgetSchema,\n BorderRadiusOptions,\n BorderWidthOptions,\n ColorOptions,\n PaddingOptions,\n GapOptions,\n SectionLayoutType,\n BackgroundValue,\n} from \"@fluid-app/portal-core/types\";\nimport { sectionLayoutConfig } from \"@fluid-app/portal-core/types\";\nimport type { ComponentType } from \"react\";\nimport type React from \"react\";\nimport type { WidgetPropertySchema } from \"@fluid-app/portal-core/registries\";\nimport {\n getBorderRadiusField,\n getBorderWidthField,\n getBorderColorField,\n getGapField,\n getPaddingField,\n gapValues,\n borderWidthClasses,\n borderColorClasses,\n} from \"../core/fields\";\nimport { groupChildrenByColumn } from \"@fluid-app/portal-core/widget-utils\";\n\nconst DEFAULT_BACKGROUND: BackgroundValue = {\n type: \"solid\",\n color: \"background\",\n};\nconst DEFAULT_CHILDREN: (WidgetSchema | null)[] = [];\n\ntype LayoutProps<\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n T extends Record<string, ComponentType<any>> = Record<\n string,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ComponentType<any>\n >,\n> = {\n // Section layout type (masonry-style column configuration)\n sectionLayout?: SectionLayoutType;\n\n // Legacy props (deprecated, kept for backward compatibility)\n type?: \"flex\" | \"grid\";\n columns?: number;\n rows?: number;\n direction?: string;\n justify?: string;\n align?: string;\n wrap?: boolean;\n\n // Spacing\n gap?: number; // deprecated, use gapSize instead\n gapSize?: GapOptions;\n\n // Design\n background?: BackgroundValue;\n padding?: PaddingOptions;\n borderRadius?: BorderRadiusOptions;\n borderWidth?: BorderWidthOptions;\n borderColor?: ColorOptions;\n\n // Content - widgets with columnIndex property for masonry layout\n children: (TypedWidgetSchema<T> | null)[] | (WidgetSchema | null)[];\n\n // Widget registry (passed down from parent renderer)\n registry?: T;\n\n // Styling\n className?: string;\n minHeight?: number;\n};\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const LayoutWidget = <T extends Record<string, ComponentType<any>>>({\n sectionLayout = \"single-column\",\n gap = 4,\n gapSize,\n background = DEFAULT_BACKGROUND,\n padding = 0,\n borderRadius = \"md\",\n borderWidth = \"none\",\n borderColor = \"muted\",\n children = DEFAULT_CHILDREN,\n registry,\n className = \"\",\n minHeight,\n}: LayoutProps<T>): React.JSX.Element => {\n // Get registry from context if not provided as prop\n const contextRegistry = useRegistry();\n const effectiveRegistry = registry || contextRegistry;\n\n // Use ScreenRenderer from context (e.g. portal-builder's), fall back to local\n const ContextScreenRenderer = useScreenRenderer();\n const ScreenRenderer = ContextScreenRenderer ?? DefaultScreenRenderer;\n\n // Extract background values\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 // Get layout configuration\n const layoutConfig = sectionLayoutConfig[sectionLayout];\n const columnCount = layoutConfig.columns;\n\n // Calculate gap size\n const gapSizeValue = gapSize ? gapValues[gapSize] : gap;\n\n // Build CSS classes for masonry layout with responsive columns\n const layoutClasses = [\n \"grid\",\n \"grid-cols-1\", // Mobile: single column\n layoutConfig.gridClasses, // Desktop (@md+): configured columns\n `bg-${backgroundColor} p-${padding} rounded-${borderRadius} ${borderWidthClasses[borderWidth]} ${borderWidth !== \"none\" ? borderColorClasses[borderColor] : \"\"}`,\n `gap-${gapSizeValue}`,\n className,\n ]\n .filter(Boolean)\n .join(\" \");\n\n // Container style\n const containerStyle: React.CSSProperties = {\n ...(minHeight ? { minHeight: `${minHeight}px` } : {}),\n alignItems: \"start\", // Masonry-style: columns don't stretch to match height\n backgroundImage,\n };\n\n // If no registry is available, we can't render the children\n if (!effectiveRegistry) {\n console.warn(\"Layout widget: No registry provided, cannot render children\");\n return <div className={layoutClasses} style={containerStyle} />;\n }\n\n // Group children by column\n const columnGroups = groupChildrenByColumn(\n children as WidgetSchema[],\n columnCount,\n );\n\n // Regular render mode - render each column as a flex column\n return (\n <div className=\"@container\">\n <div className={layoutClasses} style={containerStyle}>\n {columnGroups.map((columnChildren, colIndex) => (\n <ScreenRenderer\n key={colIndex}\n screen={columnChildren}\n registry={effectiveRegistry}\n className={`flex flex-col gap-${gapSizeValue}`}\n />\n ))}\n </div>\n </div>\n );\n};\n\nexport const layoutWidgetPropertySchema: WidgetPropertySchema = {\n widgetType: \"LayoutWidget\",\n displayName: \"Layout\",\n fields: [\n // Layout Configuration - Visual selector matching Figma design\n {\n key: \"sectionLayout\",\n label: \"Layout Type\",\n type: \"sectionLayoutSelect\",\n description: \"Column layout configuration\",\n defaultValue: \"single-column\",\n group: \"Layout\",\n },\n\n // Design\n getGapField({\n key: \"gapSize\",\n label: \"Gap\",\n description: \"Gap between columns and widgets\",\n defaultValue: \"md\",\n group: \"Design\",\n }),\n {\n type: \"background\",\n key: \"background\",\n label: \"Background\",\n description: \"Background for the layout container\",\n defaultValue: \"background\",\n group: \"Design\",\n },\n getPaddingField({\n key: \"padding\",\n label: \"Padding\",\n description: \"Padding for the layout container\",\n defaultValue: 4,\n group: \"Design\",\n }),\n getBorderRadiusField({\n key: \"borderRadius\",\n label: \"Border Radius\",\n description: \"Border radius for the layout container\",\n defaultValue: \"md\",\n group: \"Design\",\n }),\n getBorderWidthField({\n key: \"borderWidth\",\n label: \"Border Width\",\n description: \"Border width for the widget\",\n defaultValue: \"none\",\n group: \"Design\",\n }),\n getBorderColorField({\n key: \"borderColor\",\n label: \"Border Color\",\n description: \"Border color for the widget\",\n defaultValue: \"muted\",\n group: \"Design\",\n }),\n ],\n};\n"],"mappings":";;;;;AAuPA,MAAa,sBArDT;CACF,iBAAiB;EAAE,SAAS;EAAG,QAAQ,CAAC,MAAM;EAAE,aAAa;EAAI;CACjE,YAAY;EACV,SAAS;EACT,QAAQ,CAAC,OAAO,MAAM;EACtB,aAAa;EACd;CACD,iBAAiB;EACf,SAAS;EACT,QAAQ,CAAC,OAAO,MAAM;EACtB,aAAa;EACd;CACD,kBAAkB;EAChB,SAAS;EACT,QAAQ,CAAC,OAAO,MAAM;EACtB,aAAa;EACd;CACD,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1
- import { n as __exportAll } from "./chunk-ByhMGyNw.mjs";
1
+ import { r as __exportAll } from "./es-CTLNkiWp.mjs";
2
2
  import { t as useWidgetInteraction } from "./WidgetInteractionContext-DAN31Alw.mjs";
3
3
  import { a as getBorderRadiusCompositeField, c as getButtonSizeField, i as getBorderColorField, m as getPaddingField, n as borderWidthClasses, s as getBorderWidthField, t as borderColorClasses, u as getFontSizeField } from "./registries-CM_NlECC.mjs";
4
4
  import { ln as Button } from "./src-Duo2Iuw-.mjs";
@@ -376,4 +376,4 @@ const linkWidgetPropertySchema = {
376
376
  //#endregion
377
377
  export { LinkWidget_exports as n, linkWidgetPropertySchema as r, LinkWidget as t };
378
378
 
379
- //# sourceMappingURL=LinkWidget-JSoDi-ag.mjs.map
379
+ //# sourceMappingURL=LinkWidget-B5PlWJHe.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"LinkWidget-JSoDi-ag.mjs","names":[],"sources":["../../widgets/src/widgets/LinkWidget.tsx"],"sourcesContent":["import type { WidgetPropertySchema } from \"@fluid-app/portal-core/registries\";\nimport { useCallback, type ComponentProps } from \"react\";\nimport type React from \"react\";\nimport { Button } from \"@fluid-app/ui-primitives\";\nimport { useWidgetInteraction } from \"../contexts/WidgetInteractionContext\";\nimport {\n getBorderRadiusCompositeField,\n getBorderWidthField,\n getBorderColorField,\n borderWidthClasses,\n borderColorClasses,\n getButtonSizeField,\n getFontSizeField,\n getPaddingField,\n} from \"../core/fields\";\nimport type {\n BorderRadiusOptions,\n BorderWidthOptions,\n ButtonSizeOptions,\n ColorOptions,\n FontSizeOptions,\n PaddingOptions,\n} from \"@fluid-app/portal-core/types\";\nimport { AlignCenter, AlignLeft, AlignRight } from \"lucide-react\";\nimport type { ShareableItem } from \"@fluid-app/portal-core/types\";\n\ntype LinkVariant =\n | \"default\"\n | \"outline\"\n | \"secondary\"\n | \"ghost\"\n | \"destructive\";\n\nconst borderRadiusTLClasses: Record<BorderRadiusOptions, string> = {\n none: \"rounded-tl-none\",\n sm: \"rounded-tl-sm\",\n md: \"rounded-tl-md\",\n lg: \"rounded-tl-lg\",\n xl: \"rounded-tl-xl\",\n full: \"rounded-tl-full\",\n};\n\nconst borderRadiusTRClasses: Record<BorderRadiusOptions, string> = {\n none: \"rounded-tr-none\",\n sm: \"rounded-tr-sm\",\n md: \"rounded-tr-md\",\n lg: \"rounded-tr-lg\",\n xl: \"rounded-tr-xl\",\n full: \"rounded-tr-full\",\n};\n\nconst borderRadiusBLClasses: Record<BorderRadiusOptions, string> = {\n none: \"rounded-bl-none\",\n sm: \"rounded-bl-sm\",\n md: \"rounded-bl-md\",\n lg: \"rounded-bl-lg\",\n xl: \"rounded-bl-xl\",\n full: \"rounded-bl-full\",\n};\n\nconst borderRadiusBRClasses: Record<BorderRadiusOptions, string> = {\n none: \"rounded-br-none\",\n sm: \"rounded-br-sm\",\n md: \"rounded-br-md\",\n lg: \"rounded-br-lg\",\n xl: \"rounded-br-xl\",\n full: \"rounded-br-full\",\n};\n\nfunction sanitizeHref(url: string): string | undefined {\n if (!url) return undefined;\n if (/^(https?:|mailto:|tel:|\\/)/i.test(url)) return url;\n return undefined;\n}\n\nexport type LinkType = \"url\" | \"screen\" | \"share\";\nexport type ShareSource = \"resource\" | \"url\";\n\ntype LinkWidgetProps = ComponentProps<\"div\"> & {\n text?: string;\n linkType?: LinkType;\n // URL mode\n href?: string;\n openInNewTab?: boolean;\n // Screen mode\n screenSlug?: string;\n // Share mode\n shareSource?: ShareSource;\n shareResource?: ShareableItem;\n shareUrl?: string;\n // Styling\n variant?: LinkVariant;\n size?: ButtonSizeOptions;\n fontSize?: FontSizeOptions;\n alignment?: \"left\" | \"center\" | \"right\";\n fullWidth?: boolean;\n padding?: PaddingOptions;\n /** @deprecated Use per-corner props instead */\n borderRadius?: BorderRadiusOptions;\n borderRadiusTL?: BorderRadiusOptions;\n borderRadiusTR?: BorderRadiusOptions;\n borderRadiusBL?: BorderRadiusOptions;\n borderRadiusBR?: BorderRadiusOptions;\n borderWidth?: BorderWidthOptions;\n borderColor?: ColorOptions;\n underline?: boolean;\n previewMode?: boolean;\n editMode?: boolean;\n};\n\nconst alignmentClasses = {\n left: \"justify-start\",\n center: \"justify-center\",\n right: \"justify-end\",\n} as const;\n\nexport function LinkWidget({\n text = \"Click Here\",\n linkType = \"url\",\n href = \"\",\n openInNewTab = true,\n screenSlug,\n shareSource,\n shareResource,\n shareUrl,\n variant = \"default\",\n size = \"default\",\n fontSize = \"sm\",\n alignment = \"center\",\n fullWidth = false,\n padding = 0,\n borderRadius,\n borderRadiusTL,\n borderRadiusTR,\n borderRadiusBL,\n borderRadiusBR,\n borderWidth = \"none\",\n borderColor = \"muted\",\n underline = false,\n previewMode = false,\n editMode = false,\n className,\n ...props\n}: LinkWidgetProps): React.JSX.Element {\n const { onNavigate, buildHref } = useWidgetInteraction();\n\n const handleShareClick = useCallback(async () => {\n const isResourceMode = shareSource === \"resource\" || shareSource == null;\n const url = isResourceMode\n ? (shareResource?.share_link ?? undefined)\n : (shareUrl ?? undefined);\n if (!url) return;\n\n if (navigator.share) {\n try {\n await navigator.share({\n url,\n ...(isResourceMode && shareResource?.title\n ? { title: shareResource.title }\n : {}),\n });\n return;\n } catch (e) {\n // User intentionally dismissed the share sheet — do not copy to clipboard\n if (e instanceof DOMException && e.name === \"AbortError\") return;\n // Other errors (e.g. NotAllowedError) — fall through to clipboard\n }\n }\n\n try {\n await navigator.clipboard.writeText(url);\n } catch {\n // Clipboard API not available\n }\n }, [shareSource, shareUrl, shareResource]);\n\n const handleScreenClick = useCallback(\n (e: React.MouseEvent) => {\n if (onNavigate && screenSlug) {\n e.preventDefault();\n onNavigate(screenSlug);\n }\n },\n [onNavigate, screenSlug],\n );\n\n const screenHref = screenSlug\n ? (buildHref?.(screenSlug) ?? screenSlug)\n : undefined;\n if (previewMode) {\n return (\n <div className={`flex justify-center p-4 ${className ?? \"\"}`} {...props}>\n <span\n style={{\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n height: \"36px\",\n padding: \"0 16px\",\n borderRadius: \"6px\",\n backgroundColor: \"#18181b\",\n color: \"#ffffff\",\n fontSize: \"14px\",\n fontWeight: 500,\n }}\n >\n {text}\n </span>\n </div>\n );\n }\n\n const fallback = borderRadius ?? \"md\";\n const tl = borderRadiusTL ?? fallback;\n const tr = borderRadiusTR ?? fallback;\n const bl = borderRadiusBL ?? fallback;\n const br = borderRadiusBR ?? fallback;\n const borderRadiusClasses = `rounded-none ${borderRadiusTLClasses[tl]} ${borderRadiusTRClasses[tr]} ${borderRadiusBLClasses[bl]} ${borderRadiusBRClasses[br]}`;\n const buttonClasses = `text-${fontSize} ${borderRadiusClasses} ${fullWidth ? \"w-full\" : \"\"} ${underline ? \"underline\" : \"\"}`;\n\n return (\n <div\n className={`flex ${alignmentClasses[alignment]} p-${padding} ${borderWidthClasses[borderWidth]} ${borderWidth !== \"none\" ? borderColorClasses[borderColor] : \"\"} ${className ?? \"\"}`}\n {...props}\n >\n <Button asChild variant={variant} size={size} className={buttonClasses}>\n {editMode ? (\n <span className=\"cursor-default\">{text}</span>\n ) : linkType === \"share\" ? (\n <button type=\"button\" onClick={handleShareClick}>\n {text}\n </button>\n ) : linkType === \"screen\" ? (\n screenSlug ? (\n <a href={screenHref} onClick={handleScreenClick}>\n {text}\n </a>\n ) : (\n <span className=\"cursor-default\">{text}</span>\n )\n ) : (\n <a\n href={sanitizeHref(href)}\n {...(openInNewTab\n ? { target: \"_blank\", rel: \"noopener noreferrer\" }\n : {})}\n >\n {text}\n </a>\n )}\n </Button>\n </div>\n );\n}\n\nexport const linkWidgetPropertySchema: WidgetPropertySchema = {\n widgetType: \"LinkWidget\",\n displayName: \"Link Button\",\n fields: [\n // Link Group\n {\n key: \"linkType\",\n label: \"Link Type\",\n type: \"buttonGroup\",\n options: [\n { label: \"URL\", value: \"url\" },\n { label: \"Screen\", value: \"screen\" },\n { label: \"Share\", value: \"share\" },\n ],\n defaultValue: \"url\",\n group: \"Link\",\n },\n {\n key: \"text\",\n label: \"Text\",\n type: \"text\",\n description: \"The button label text\",\n defaultValue: \"Click Here\",\n group: \"Link\",\n },\n // URL mode fields\n {\n key: \"href\",\n label: \"URL\",\n type: \"text\",\n description: \"The destination URL\",\n defaultValue: \"\",\n group: \"Link\",\n requiresKeyValue: { key: \"linkType\", value: \"url\" },\n },\n {\n key: \"openInNewTab\",\n label: \"Open in New Tab\",\n type: \"boolean\",\n description: \"Whether to open the link in a new tab\",\n defaultValue: true,\n group: \"Link\",\n requiresKeyValue: { key: \"linkType\", value: \"url\" },\n },\n // Screen mode fields\n {\n key: \"screenSlug\",\n label: \"Screen\",\n type: \"screenPicker\",\n description: \"Select a screen to navigate to\",\n includeSystemItems: true,\n group: \"Link\",\n requiresKeyValue: { key: \"linkType\", value: \"screen\" },\n },\n // Share mode fields\n {\n key: \"shareSource\",\n label: \"Share Source\",\n type: \"buttonGroup\",\n options: [\n { label: \"Resource\", value: \"resource\" },\n { label: \"URL\", value: \"url\" },\n ],\n defaultValue: \"resource\",\n group: \"Link\",\n requiresKeyValue: { key: \"linkType\", value: \"share\" },\n },\n {\n key: \"shareResource\",\n label: \"Shareable Content\",\n type: \"resource\",\n description: \"Select content to share\",\n allowedTypes: [\"Product\", \"Medium\", \"Library\", \"Page\", \"EnrollmentPack\"],\n group: \"Link\",\n requiresKeyValue: [\n { key: \"linkType\", value: \"share\" },\n { key: \"shareSource\", value: \"resource\" },\n ],\n },\n {\n key: \"shareUrl\",\n label: \"Share URL\",\n type: \"text\",\n description: \"The URL to share\",\n defaultValue: \"\",\n group: \"Link\",\n requiresKeyValue: [\n { key: \"linkType\", value: \"share\" },\n { key: \"shareSource\", value: \"url\" },\n ],\n },\n // Button Style Group\n {\n key: \"variant\",\n label: \"Variant\",\n type: \"select\",\n description: \"The visual style of the button\",\n options: [\n { label: \"Default\", value: \"default\" },\n { label: \"Outline\", value: \"outline\" },\n { label: \"Secondary\", value: \"secondary\" },\n { label: \"Ghost\", value: \"ghost\" },\n { label: \"Destructive\", value: \"destructive\" },\n ],\n defaultValue: \"default\",\n group: \"Button Style\",\n },\n getButtonSizeField({\n key: \"size\",\n label: \"Size\",\n description: \"The size of the button\",\n defaultValue: \"default\",\n group: \"Button Style\",\n }),\n getFontSizeField({\n key: \"fontSize\",\n label: \"Text Size\",\n description: \"The font size of the button text\",\n defaultValue: \"sm\",\n group: \"Button Style\",\n }),\n {\n key: \"underline\",\n label: \"Underline\",\n type: \"boolean\",\n description: \"Underline the button text\",\n defaultValue: false,\n group: \"Button Style\",\n },\n // Layout Group\n {\n key: \"alignment\",\n label: \"Alignment\",\n type: \"buttonGroup\",\n description: \"Horizontal alignment of the button\",\n options: [\n { icon: AlignLeft, value: \"left\" },\n { icon: AlignCenter, value: \"center\" },\n { icon: AlignRight, value: \"right\" },\n ],\n defaultValue: \"center\",\n group: \"Layout\",\n },\n {\n key: \"fullWidth\",\n label: \"Full Width\",\n type: \"boolean\",\n description: \"Makes the button stretch to full container width\",\n defaultValue: false,\n group: \"Layout\",\n },\n getPaddingField({\n key: \"padding\",\n label: \"Padding\",\n description: \"Outer container padding\",\n defaultValue: 0,\n group: \"Layout\",\n }),\n // Design Group\n getBorderRadiusCompositeField({\n key: \"borderRadiusGroup\",\n label: \"Border Radius\",\n defaultValue: \"md\",\n group: \"Design\",\n }),\n getBorderWidthField({\n key: \"borderWidth\",\n label: \"Border Width\",\n description: \"Border width for the widget\",\n defaultValue: \"none\",\n group: \"Design\",\n }),\n getBorderColorField({\n key: \"borderColor\",\n label: \"Border Color\",\n description: \"Border color for the widget\",\n defaultValue: \"muted\",\n group: \"Design\",\n }),\n ],\n};\n"],"mappings":";;;;;;;;;;;;AAiCA,MAAM,wBAA6D;CACjE,MAAM;CACN,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,MAAM;CACP;AAED,MAAM,wBAA6D;CACjE,MAAM;CACN,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,MAAM;CACP;AAED,MAAM,wBAA6D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EAED;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,SAAS;IACP;KAAE,OAAO;KAAW,OAAO;KAAW;IACtC;KAAE,OAAO;KAAW,OAAO;KAAW;IACtC;KAAE,OAAO;KAAa,OAAO;KAAa;IAC1C;KAAE,OAAO;KAAS,OAAO;KAAS;IAClC;KAAE,OAAO;KAAe,OAAO;KAAe;IAC/C;GACD,cAAc;GACd,OAAO;GACR;EACD,mBAAmB;GACjB,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,OAAO;GACR,CAAC;EACF,iBAAiB;GACf,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,OAAO;GACR,CAAC;EACF;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,cAAc;GACd,OAAO;GACR;EAED;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,SAAS;IACP;KAAE,MAAM;KAAW,OAAO;KAAQ;IAClC;KAAE,MAAM;KAAa,OAAO;KAAU;IACtC;KAAE,MAAM;KAAY,OAAO;KAAS;IACrC;GACD,cAAc;GACd,OAAO;GACR;EACD;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,cAAc;GACd,OAAO;GACR;EACD,gBAAgB;GACd,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,OAAO;GACR,CAAC;EAEF,8BAA8B;GAC5B,KAAK;GACL,OAAO;GACP,cAAc;GACd,OAAO;GACR,CAAC;EACF,oBAAoB;GAClB,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,OAAO;GACR,CAAC;EACF,oBAAoB;GAClB,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,OAAO;GACR,CAAC;EACH;CACF"}
1
+ {"version":3,"file":"LinkWidget-B5PlWJHe.mjs","names":[],"sources":["../../widgets/src/widgets/LinkWidget.tsx"],"sourcesContent":["import type { WidgetPropertySchema } from \"@fluid-app/portal-core/registries\";\nimport { useCallback, type ComponentProps } from \"react\";\nimport type React from \"react\";\nimport { Button } from \"@fluid-app/ui-primitives\";\nimport { useWidgetInteraction } from \"../contexts/WidgetInteractionContext\";\nimport {\n getBorderRadiusCompositeField,\n getBorderWidthField,\n getBorderColorField,\n borderWidthClasses,\n borderColorClasses,\n getButtonSizeField,\n getFontSizeField,\n getPaddingField,\n} from \"../core/fields\";\nimport type {\n BorderRadiusOptions,\n BorderWidthOptions,\n ButtonSizeOptions,\n ColorOptions,\n FontSizeOptions,\n PaddingOptions,\n} from \"@fluid-app/portal-core/types\";\nimport { AlignCenter, AlignLeft, AlignRight } from \"lucide-react\";\nimport type { ShareableItem } from \"@fluid-app/portal-core/types\";\n\ntype LinkVariant =\n | \"default\"\n | \"outline\"\n | \"secondary\"\n | \"ghost\"\n | \"destructive\";\n\nconst borderRadiusTLClasses: Record<BorderRadiusOptions, string> = {\n none: \"rounded-tl-none\",\n sm: \"rounded-tl-sm\",\n md: \"rounded-tl-md\",\n lg: \"rounded-tl-lg\",\n xl: \"rounded-tl-xl\",\n full: \"rounded-tl-full\",\n};\n\nconst borderRadiusTRClasses: Record<BorderRadiusOptions, string> = {\n none: \"rounded-tr-none\",\n sm: \"rounded-tr-sm\",\n md: \"rounded-tr-md\",\n lg: \"rounded-tr-lg\",\n xl: \"rounded-tr-xl\",\n full: \"rounded-tr-full\",\n};\n\nconst borderRadiusBLClasses: Record<BorderRadiusOptions, string> = {\n none: \"rounded-bl-none\",\n sm: \"rounded-bl-sm\",\n md: \"rounded-bl-md\",\n lg: \"rounded-bl-lg\",\n xl: \"rounded-bl-xl\",\n full: \"rounded-bl-full\",\n};\n\nconst borderRadiusBRClasses: Record<BorderRadiusOptions, string> = {\n none: \"rounded-br-none\",\n sm: \"rounded-br-sm\",\n md: \"rounded-br-md\",\n lg: \"rounded-br-lg\",\n xl: \"rounded-br-xl\",\n full: \"rounded-br-full\",\n};\n\nfunction sanitizeHref(url: string): string | undefined {\n if (!url) return undefined;\n if (/^(https?:|mailto:|tel:|\\/)/i.test(url)) return url;\n return undefined;\n}\n\nexport type LinkType = \"url\" | \"screen\" | \"share\";\nexport type ShareSource = \"resource\" | \"url\";\n\ntype LinkWidgetProps = ComponentProps<\"div\"> & {\n text?: string;\n linkType?: LinkType;\n // URL mode\n href?: string;\n openInNewTab?: boolean;\n // Screen mode\n screenSlug?: string;\n // Share mode\n shareSource?: ShareSource;\n shareResource?: ShareableItem;\n shareUrl?: string;\n // Styling\n variant?: LinkVariant;\n size?: ButtonSizeOptions;\n fontSize?: FontSizeOptions;\n alignment?: \"left\" | \"center\" | \"right\";\n fullWidth?: boolean;\n padding?: PaddingOptions;\n /** @deprecated Use per-corner props instead */\n borderRadius?: BorderRadiusOptions;\n borderRadiusTL?: BorderRadiusOptions;\n borderRadiusTR?: BorderRadiusOptions;\n borderRadiusBL?: BorderRadiusOptions;\n borderRadiusBR?: BorderRadiusOptions;\n borderWidth?: BorderWidthOptions;\n borderColor?: ColorOptions;\n underline?: boolean;\n previewMode?: boolean;\n editMode?: boolean;\n};\n\nconst alignmentClasses = {\n left: \"justify-start\",\n center: \"justify-center\",\n right: \"justify-end\",\n} as const;\n\nexport function LinkWidget({\n text = \"Click Here\",\n linkType = \"url\",\n href = \"\",\n openInNewTab = true,\n screenSlug,\n shareSource,\n shareResource,\n shareUrl,\n variant = \"default\",\n size = \"default\",\n fontSize = \"sm\",\n alignment = \"center\",\n fullWidth = false,\n padding = 0,\n borderRadius,\n borderRadiusTL,\n borderRadiusTR,\n borderRadiusBL,\n borderRadiusBR,\n borderWidth = \"none\",\n borderColor = \"muted\",\n underline = false,\n previewMode = false,\n editMode = false,\n className,\n ...props\n}: LinkWidgetProps): React.JSX.Element {\n const { onNavigate, buildHref } = useWidgetInteraction();\n\n const handleShareClick = useCallback(async () => {\n const isResourceMode = shareSource === \"resource\" || shareSource == null;\n const url = isResourceMode\n ? (shareResource?.share_link ?? undefined)\n : (shareUrl ?? undefined);\n if (!url) return;\n\n if (navigator.share) {\n try {\n await navigator.share({\n url,\n ...(isResourceMode && shareResource?.title\n ? { title: shareResource.title }\n : {}),\n });\n return;\n } catch (e) {\n // User intentionally dismissed the share sheet — do not copy to clipboard\n if (e instanceof DOMException && e.name === \"AbortError\") return;\n // Other errors (e.g. NotAllowedError) — fall through to clipboard\n }\n }\n\n try {\n await navigator.clipboard.writeText(url);\n } catch {\n // Clipboard API not available\n }\n }, [shareSource, shareUrl, shareResource]);\n\n const handleScreenClick = useCallback(\n (e: React.MouseEvent) => {\n if (onNavigate && screenSlug) {\n e.preventDefault();\n onNavigate(screenSlug);\n }\n },\n [onNavigate, screenSlug],\n );\n\n const screenHref = screenSlug\n ? (buildHref?.(screenSlug) ?? screenSlug)\n : undefined;\n if (previewMode) {\n return (\n <div className={`flex justify-center p-4 ${className ?? \"\"}`} {...props}>\n <span\n style={{\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n height: \"36px\",\n padding: \"0 16px\",\n borderRadius: \"6px\",\n backgroundColor: \"#18181b\",\n color: \"#ffffff\",\n fontSize: \"14px\",\n fontWeight: 500,\n }}\n >\n {text}\n </span>\n </div>\n );\n }\n\n const fallback = borderRadius ?? \"md\";\n const tl = borderRadiusTL ?? fallback;\n const tr = borderRadiusTR ?? fallback;\n const bl = borderRadiusBL ?? fallback;\n const br = borderRadiusBR ?? fallback;\n const borderRadiusClasses = `rounded-none ${borderRadiusTLClasses[tl]} ${borderRadiusTRClasses[tr]} ${borderRadiusBLClasses[bl]} ${borderRadiusBRClasses[br]}`;\n const buttonClasses = `text-${fontSize} ${borderRadiusClasses} ${fullWidth ? \"w-full\" : \"\"} ${underline ? \"underline\" : \"\"}`;\n\n return (\n <div\n className={`flex ${alignmentClasses[alignment]} p-${padding} ${borderWidthClasses[borderWidth]} ${borderWidth !== \"none\" ? borderColorClasses[borderColor] : \"\"} ${className ?? \"\"}`}\n {...props}\n >\n <Button asChild variant={variant} size={size} className={buttonClasses}>\n {editMode ? (\n <span className=\"cursor-default\">{text}</span>\n ) : linkType === \"share\" ? (\n <button type=\"button\" onClick={handleShareClick}>\n {text}\n </button>\n ) : linkType === \"screen\" ? (\n screenSlug ? (\n <a href={screenHref} onClick={handleScreenClick}>\n {text}\n </a>\n ) : (\n <span className=\"cursor-default\">{text}</span>\n )\n ) : (\n <a\n href={sanitizeHref(href)}\n {...(openInNewTab\n ? { target: \"_blank\", rel: \"noopener noreferrer\" }\n : {})}\n >\n {text}\n </a>\n )}\n </Button>\n </div>\n );\n}\n\nexport const linkWidgetPropertySchema: WidgetPropertySchema = {\n widgetType: \"LinkWidget\",\n displayName: \"Link Button\",\n fields: [\n // Link Group\n {\n key: \"linkType\",\n label: \"Link Type\",\n type: \"buttonGroup\",\n options: [\n { label: \"URL\", value: \"url\" },\n { label: \"Screen\", value: \"screen\" },\n { label: \"Share\", value: \"share\" },\n ],\n defaultValue: \"url\",\n group: \"Link\",\n },\n {\n key: \"text\",\n label: \"Text\",\n type: \"text\",\n description: \"The button label text\",\n defaultValue: \"Click Here\",\n group: \"Link\",\n },\n // URL mode fields\n {\n key: \"href\",\n label: \"URL\",\n type: \"text\",\n description: \"The destination URL\",\n defaultValue: \"\",\n group: \"Link\",\n requiresKeyValue: { key: \"linkType\", value: \"url\" },\n },\n {\n key: \"openInNewTab\",\n label: \"Open in New Tab\",\n type: \"boolean\",\n description: \"Whether to open the link in a new tab\",\n defaultValue: true,\n group: \"Link\",\n requiresKeyValue: { key: \"linkType\", value: \"url\" },\n },\n // Screen mode fields\n {\n key: \"screenSlug\",\n label: \"Screen\",\n type: \"screenPicker\",\n description: \"Select a screen to navigate to\",\n includeSystemItems: true,\n group: \"Link\",\n requiresKeyValue: { key: \"linkType\", value: \"screen\" },\n },\n // Share mode fields\n {\n key: \"shareSource\",\n label: \"Share Source\",\n type: \"buttonGroup\",\n options: [\n { label: \"Resource\", value: \"resource\" },\n { label: \"URL\", value: \"url\" },\n ],\n defaultValue: \"resource\",\n group: \"Link\",\n requiresKeyValue: { key: \"linkType\", value: \"share\" },\n },\n {\n key: \"shareResource\",\n label: \"Shareable Content\",\n type: \"resource\",\n description: \"Select content to share\",\n allowedTypes: [\"Product\", \"Medium\", \"Library\", \"Page\", \"EnrollmentPack\"],\n group: \"Link\",\n requiresKeyValue: [\n { key: \"linkType\", value: \"share\" },\n { key: \"shareSource\", value: \"resource\" },\n ],\n },\n {\n key: \"shareUrl\",\n label: \"Share URL\",\n type: \"text\",\n description: \"The URL to share\",\n defaultValue: \"\",\n group: \"Link\",\n requiresKeyValue: [\n { key: \"linkType\", value: \"share\" },\n { key: \"shareSource\", value: \"url\" },\n ],\n },\n // Button Style Group\n {\n key: \"variant\",\n label: \"Variant\",\n type: \"select\",\n description: \"The visual style of the button\",\n options: [\n { label: \"Default\", value: \"default\" },\n { label: \"Outline\", value: \"outline\" },\n { label: \"Secondary\", value: \"secondary\" },\n { label: \"Ghost\", value: \"ghost\" },\n { label: \"Destructive\", value: \"destructive\" },\n ],\n defaultValue: \"default\",\n group: \"Button Style\",\n },\n getButtonSizeField({\n key: \"size\",\n label: \"Size\",\n description: \"The size of the button\",\n defaultValue: \"default\",\n group: \"Button Style\",\n }),\n getFontSizeField({\n key: \"fontSize\",\n label: \"Text Size\",\n description: \"The font size of the button text\",\n defaultValue: \"sm\",\n group: \"Button Style\",\n }),\n {\n key: \"underline\",\n label: \"Underline\",\n type: \"boolean\",\n description: \"Underline the button text\",\n defaultValue: false,\n group: \"Button Style\",\n },\n // Layout Group\n {\n key: \"alignment\",\n label: \"Alignment\",\n type: \"buttonGroup\",\n description: \"Horizontal alignment of the button\",\n options: [\n { icon: AlignLeft, value: \"left\" },\n { icon: AlignCenter, value: \"center\" },\n { icon: AlignRight, value: \"right\" },\n ],\n defaultValue: \"center\",\n group: \"Layout\",\n },\n {\n key: \"fullWidth\",\n label: \"Full Width\",\n type: \"boolean\",\n description: \"Makes the button stretch to full container width\",\n defaultValue: false,\n group: \"Layout\",\n },\n getPaddingField({\n key: \"padding\",\n label: \"Padding\",\n description: \"Outer container padding\",\n defaultValue: 0,\n group: \"Layout\",\n }),\n // Design Group\n getBorderRadiusCompositeField({\n key: \"borderRadiusGroup\",\n label: \"Border Radius\",\n defaultValue: \"md\",\n group: \"Design\",\n }),\n getBorderWidthField({\n key: \"borderWidth\",\n label: \"Border Width\",\n description: \"Border width for the widget\",\n defaultValue: \"none\",\n group: \"Design\",\n }),\n getBorderColorField({\n key: \"borderColor\",\n label: \"Border Color\",\n description: \"Border color for the widget\",\n defaultValue: \"muted\",\n group: \"Design\",\n }),\n ],\n};\n"],"mappings":";;;;;;;;;;;;AAiCA,MAAM,wBAA6D;CACjE,MAAM;CACN,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,MAAM;CACP;AAED,MAAM,wBAA6D;CACjE,MAAM;CACN,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,MAAM;CACP;AAED,MAAM,wBAA6D;CACjE,MAAM;CACN,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,MAAM;CACP;AAED,MAAM,wBAA6D;CACjE,MAAM;CACN,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,MAAM;CACP;AAED,SAAS,aAAa,KAAiC;AACrD,KAAI,CAAC,IAAK,QAAO,KAAA;AACjB,KAAI,8BAA8B,KAAK,IAAI,CAAE,QAAO;;AAuCtD,MAAM,mBAAmB;CACvB,MAAM;CACN,QAAQ;CACR,OAAO;CACR;AAED,SAAgB,WAAW,EACzB,OAAO,cACP,WAAW,OACX,OAAO,IACP,eAAe,MACf,YACA,aACA,eACA,UACA,UAAU,WACV,OAAO,WACP,WAAW,MACX,YAAY,UACZ,YAAY,OACZ,UAAU,GACV,cACA,gBACA,gBACA,gBACA,gBACA,cAAc,QACd,cAAc,SACd,YAAY,OACZ,cAAc,OACd,WAAW,OACX,WACA,GAAG,SACkC;CACrC,MAAM,EAAE,YAAY,cAAc,sBAAsB;CAExD,MAAM,mBAAmB,YAA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Y,OAAO;KAAS;IACrC;GACD,cAAc;GACd,OAAO;GACR;EACD;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,cAAc;GACd,OAAO;GACR;EACD,gBAAgB;GACd,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,OAAO;GACR,CAAC;EAEF,8BAA8B;GAC5B,KAAK;GACL,OAAO;GACP,cAAc;GACd,OAAO;GACR,CAAC;EACF,oBAAoB;GAClB,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,OAAO;GACR,CAAC;EACF,oBAAoB;GAClB,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,OAAO;GACR,CAAC;EACH;CACF"}
@@ -1,4 +1,4 @@
1
- import { n as __exportAll } from "./chunk-ByhMGyNw.mjs";
1
+ import { r as __exportAll } from "./es-CTLNkiWp.mjs";
2
2
  import { t as useWidgetInteraction } from "./WidgetInteractionContext-DAN31Alw.mjs";
3
3
  import { f as getGapField, i as getBorderColorField, l as getColorField, m as getPaddingField, n as borderWidthClasses, o as getBorderRadiusField, r as gapValues, s as getBorderWidthField, t as borderColorClasses, u as getFontSizeField } from "./registries-CM_NlECC.mjs";
4
4
  import { t as purify } from "./purify.es-CfNPLbup.mjs";
@@ -912,4 +912,4 @@ const listWidgetPropertySchema = {
912
912
  //#endregion
913
913
  export { ListWidget_exports as n, listWidgetPropertySchema as r, ListWidget as t };
914
914
 
915
- //# sourceMappingURL=ListWidget-CBLZ8CjD.mjs.map
915
+ //# sourceMappingURL=ListWidget-BWfsmVoc.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"ListWidget-CBLZ8CjD.mjs","names":["DOMPurify","getImageUrl","getAspectRatioClass"],"sources":["../../widgets/src/widgets/list-widget/FeaturedSection.tsx","../../widgets/src/widgets/list-widget/ListItemCard.tsx","../../widgets/src/widgets/list-widget/UnorderedList.tsx","../../widgets/src/widgets/list-widget/OrderedList.tsx","../../widgets/src/widgets/ListWidget.tsx"],"sourcesContent":["import type React from \"react\";\nimport type {\n BorderRadiusOptions,\n FontSizeOptions,\n ColorOptions,\n} from \"@fluid-app/portal-core/types\";\nimport { MediaRenderer } from \"../../components/MediaRenderer\";\n\ninterface FeaturedSectionProps {\n borderRadius: BorderRadiusOptions;\n titleSize: FontSizeOptions;\n featuredTitle?: string | undefined;\n featuredSubtitle?: string | undefined;\n featuredButtonText?: string | undefined;\n featuredButtonUrl?: string | undefined;\n featuredSubtitleColor: ColorOptions;\n featuredSubtitleSize: FontSizeOptions;\n asset: { url: string; isVideo: boolean };\n}\n\nexport function FeaturedSection({\n borderRadius,\n titleSize,\n featuredTitle,\n featuredSubtitle,\n featuredButtonText,\n featuredButtonUrl,\n featuredSubtitleColor,\n featuredSubtitleSize,\n asset,\n}: FeaturedSectionProps): React.JSX.Element {\n return (\n <div\n className={`relative h-full min-h-[300px] w-full overflow-hidden rounded-${borderRadius}`}\n >\n <div className=\"absolute inset-0 h-full w-full\">\n <MediaRenderer\n src={asset.url}\n mediaType={asset.isVideo ? \"video\" : \"image\"}\n alt={featuredTitle || \"Featured\"}\n objectFit=\"cover\"\n autoplay={asset.isVideo}\n loop={asset.isVideo}\n muted={asset.isVideo}\n controls={false}\n />\n </div>\n\n <div className=\"pointer-events-none absolute inset-0 bg-black/40\" />\n\n <div className=\"absolute inset-0 flex flex-col items-start justify-end p-8\">\n {featuredTitle && (\n <h3\n className={`font-header mb-2 font-bold text-white text-${titleSize === \"md\" ? \"base\" : titleSize}`}\n >\n {featuredTitle}\n </h3>\n )}\n {featuredSubtitle && (\n <p\n className={`mb-4 text-${featuredSubtitleColor} text-${featuredSubtitleSize === \"md\" ? \"base\" : featuredSubtitleSize}`}\n >\n {featuredSubtitle}\n </p>\n )}\n {featuredButtonText && (\n <a\n href={featuredButtonUrl || \"#\"}\n className={`text-foreground bg-white px-6 py-2 font-medium transition-opacity hover:opacity-90 rounded-${borderRadius}`}\n >\n {featuredButtonText}\n </a>\n )}\n </div>\n </div>\n );\n}\n","import type React from \"react\";\nimport DOMPurify from \"dompurify\";\nimport type {\n ColorOptions,\n FontSizeOptions,\n PaddingOptions,\n} from \"@fluid-app/portal-core/types\";\n\ntype ListItem = {\n id: string;\n image?: string;\n imageUrl?: string;\n videoUrl?: string;\n title?: string;\n description?: string;\n price?: string;\n display_price?: string;\n originalPrice?: string;\n discount?: string;\n qv?: string;\n cv?: string;\n [key: string]: unknown;\n};\n\nfunction getStringValue(value: unknown): string {\n if (!value) return \"\";\n if (typeof value === \"string\") return value;\n if (typeof value === \"number\") return String(value);\n if (typeof value === \"object\" && value !== null) {\n if (\"body\" in value) {\n const body = (value as { body: unknown }).body;\n if (typeof body === \"string\") return body;\n }\n if (\"text\" in value) {\n const text = (value as { text: unknown }).text;\n if (typeof text === \"string\") return text;\n }\n if (\"value\" in value) {\n const val = (value as { value: unknown }).value;\n if (typeof val === \"string\") return val;\n if (typeof val === \"number\") return String(val);\n }\n }\n return \"\";\n}\n\n/**\n * Strips parenthetical text like \"(USD)\" from price strings.\n * Matches the shop page's stripParentheticalText pattern.\n */\nfunction stripParentheticalText(text: string): string {\n return text.replace(/\\s*\\([^)]*\\)/g, \"\").trim();\n}\n\n/**\n * Formats a price for display. Follows the shop page pattern:\n * prices arrive pre-formatted from the API via display_price\n * (e.g. \"$19.99\", \"€15.00 (EUR)\") so we just extract the string\n * and strip parenthetical suffixes.\n */\nfunction formatPrice(value: unknown): string {\n const str = getStringValue(value);\n if (!str) return \"\";\n return stripParentheticalText(str);\n}\n\nexport interface ListItemCardContentProps {\n item: ListItem;\n padding: PaddingOptions;\n itemTitleColor: ColorOptions;\n itemTitleSize: FontSizeOptions;\n descriptionColor: ColorOptions;\n descriptionSize: FontSizeOptions;\n priceColor: ColorOptions;\n priceSize: FontSizeOptions;\n originalPriceColor: ColorOptions;\n metaTextColor: ColorOptions;\n metaTextSize: FontSizeOptions;\n showMetaText: boolean;\n}\n\nexport function ListItemCardContent({\n item,\n padding,\n itemTitleColor,\n itemTitleSize,\n descriptionColor,\n descriptionSize,\n priceColor,\n priceSize,\n originalPriceColor,\n metaTextColor,\n metaTextSize,\n showMetaText,\n}: ListItemCardContentProps): React.JSX.Element {\n return (\n <div className={`flex flex-1 flex-col p-${padding}`}>\n {item.title && (\n <h3\n className={`text-${itemTitleColor} text-${itemTitleSize === \"md\" ? \"base\" : itemTitleSize} font-header mb-1 font-semibold`}\n >\n {getStringValue(item.title)}\n </h3>\n )}\n {item.description && (\n <div\n className={`text-${descriptionColor} text-${descriptionSize === \"md\" ? \"base\" : descriptionSize} mb-2 line-clamp-2 overflow-hidden`}\n dangerouslySetInnerHTML={{\n __html: DOMPurify.sanitize(item.description ?? \"\", {\n ALLOWED_TAGS: [\n \"br\",\n \"strong\",\n \"em\",\n \"b\",\n \"i\",\n \"ul\",\n \"ol\",\n \"li\",\n \"p\",\n ],\n ALLOWED_ATTR: [],\n }),\n }}\n />\n )}\n <div className=\"flex items-center gap-2\">\n {(item.display_price || item.price) && (\n <span\n className={`text-${priceColor} text-${priceSize === \"md\" ? \"base\" : priceSize} font-bold`}\n >\n {formatPrice(item.display_price || item.price)}\n </span>\n )}\n {item.originalPrice && (\n <span\n className={`text-${originalPriceColor} text-${descriptionSize === \"md\" ? \"base\" : descriptionSize} line-through`}\n >\n {formatPrice(item.originalPrice)}\n </span>\n )}\n </div>\n {showMetaText && (item.qv || item.cv) && (\n <div\n className={`mt-2 flex gap-3 text-${metaTextColor} text-${metaTextSize === \"md\" ? \"base\" : metaTextSize}`}\n >\n {item.qv && <span>QV: {getStringValue(item.qv)}</span>}\n {item.cv && <span>CV: {getStringValue(item.cv)}</span>}\n </div>\n )}\n </div>\n );\n}\n\nexport function DiscountBadge({\n discount,\n}: {\n discount: string;\n}): React.JSX.Element {\n return (\n <div className=\"bg-destructive text-destructive-foreground absolute top-2 right-2 z-10 rounded-md px-2 py-1 text-xs font-bold\">\n {getStringValue(discount)}\n </div>\n );\n}\n\nexport { getStringValue };\nexport type { ListItem };\n","import type React from \"react\";\nimport type {\n ColorOptions,\n FontSizeOptions,\n BorderRadiusOptions,\n PaddingOptions,\n GapOptions,\n} from \"@fluid-app/portal-core/types\";\nimport { gapValues } from \"../../core/fields\";\nimport { useWidgetInteraction } from \"../../contexts/WidgetInteractionContext\";\nimport {\n ListItemCardContent,\n DiscountBadge,\n type ListItem,\n} from \"./ListItemCard\";\n\ntype ImageAspectRatio = \"square\" | \"landscape\" | \"portrait\";\n\nconst getImageUrl = (item: ListItem): string | undefined => {\n return item.imageUrl || item.image;\n};\n\nconst getAspectRatioClass = (ratio: ImageAspectRatio): string => {\n const ratios = {\n square: \"aspect-square\",\n landscape: \"aspect-video\",\n portrait: \"aspect-[3/4]\",\n };\n return ratios[ratio];\n};\n\nconst getResponsiveGridClass = (columns: number): string => {\n const responsiveClasses: Record<number, string> = {\n 1: \"grid-cols-2 @lg:grid-cols-1\",\n 2: \"grid-cols-2 @lg:grid-cols-2\",\n 3: \"grid-cols-2 @lg:grid-cols-3\",\n 4: \"grid-cols-2 @lg:grid-cols-4\",\n 5: \"grid-cols-2 @lg:grid-cols-5\",\n 6: \"grid-cols-2 @lg:grid-cols-6\",\n };\n return responsiveClasses[columns] || \"grid-cols-2 @lg:grid-cols-3\";\n};\n\nexport interface UnorderedListProps {\n items: ListItem[];\n columns: number;\n gap: GapOptions;\n borderRadius: BorderRadiusOptions;\n imageAspectRatio: ImageAspectRatio;\n showBadge: boolean;\n padding: PaddingOptions;\n itemTitleColor: ColorOptions;\n itemTitleSize: FontSizeOptions;\n descriptionColor: ColorOptions;\n descriptionSize: FontSizeOptions;\n priceColor: ColorOptions;\n priceSize: FontSizeOptions;\n originalPriceColor: ColorOptions;\n metaTextColor: ColorOptions;\n metaTextSize: FontSizeOptions;\n showMetaText: boolean;\n}\n\nexport function UnorderedList({\n items,\n columns,\n gap,\n borderRadius,\n imageAspectRatio,\n showBadge,\n padding,\n itemTitleColor,\n itemTitleSize,\n descriptionColor,\n descriptionSize,\n priceColor,\n priceSize,\n originalPriceColor,\n metaTextColor,\n metaTextSize,\n showMetaText,\n}: UnorderedListProps): React.JSX.Element {\n const gridClass = getResponsiveGridClass(columns);\n const { onItemClick } = useWidgetInteraction();\n\n return (\n <div className={`grid ${gridClass} gap-${gapValues[gap]}`}>\n {items.map((item) => {\n const imageUrl = getImageUrl(item);\n const aspectRatioClass = getAspectRatioClass(imageAspectRatio);\n\n return (\n <div\n key={item.id}\n className={`relative flex flex-col rounded-${borderRadius === \"full\" ? \"2xl\" : borderRadius} bg-background overflow-hidden shadow-sm transition-shadow hover:shadow-md ${onItemClick ? \"cursor-pointer\" : \"\"}`}\n {...(onItemClick\n ? {\n role: \"button\",\n tabIndex: 0,\n onClick: () => onItemClick(item),\n onKeyDown: (e: React.KeyboardEvent) => {\n if (e.key === \"Enter\" || e.key === \" \") {\n e.preventDefault();\n onItemClick(item);\n }\n },\n }\n : {})}\n >\n {showBadge && item.discount && (\n <DiscountBadge discount={item.discount} />\n )}\n {imageUrl && (\n <div className={`w-full ${aspectRatioClass} overflow-hidden`}>\n <img\n src={imageUrl}\n alt={item.title || \"Product\"}\n className=\"h-full w-full object-cover\"\n />\n </div>\n )}\n <ListItemCardContent\n item={item}\n padding={padding}\n itemTitleColor={itemTitleColor}\n itemTitleSize={itemTitleSize}\n descriptionColor={descriptionColor}\n descriptionSize={descriptionSize}\n priceColor={priceColor}\n priceSize={priceSize}\n originalPriceColor={originalPriceColor}\n metaTextColor={metaTextColor}\n metaTextSize={metaTextSize}\n showMetaText={showMetaText}\n />\n </div>\n );\n })}\n </div>\n );\n}\n","import { useRef } from \"react\";\nimport type React from \"react\";\nimport type {\n ColorOptions,\n FontSizeOptions,\n BorderRadiusOptions,\n PaddingOptions,\n GapOptions,\n} from \"@fluid-app/portal-core/types\";\nimport { gapValues } from \"../../core/fields\";\nimport { useWidgetInteraction } from \"../../contexts/WidgetInteractionContext\";\nimport { ScrollArrows } from \"../../ui/scroll-arrows\";\nimport {\n ListItemCardContent,\n DiscountBadge,\n getStringValue,\n type ListItem,\n} from \"./ListItemCard\";\n\ntype ImageAspectRatio = \"square\" | \"landscape\" | \"portrait\";\ntype ScrollAxis = \"horizontal\" | \"vertical\";\n\nconst SCROLL_ITEM_WIDTH = 300;\n\nconst getImageUrl = (item: ListItem): string | undefined => {\n return item.imageUrl || item.image;\n};\n\nconst getAspectRatioClass = (ratio: ImageAspectRatio): string => {\n const ratios = {\n square: \"aspect-square\",\n landscape: \"aspect-video\",\n portrait: \"aspect-[3/4]\",\n };\n return ratios[ratio];\n};\n\nexport interface OrderedListProps {\n items: ListItem[];\n scrollAxis: ScrollAxis;\n gap: GapOptions;\n borderRadius: BorderRadiusOptions;\n imageAspectRatio: ImageAspectRatio;\n showBadge: boolean;\n padding: PaddingOptions;\n itemTitleColor: ColorOptions;\n itemTitleSize: FontSizeOptions;\n descriptionColor: ColorOptions;\n descriptionSize: FontSizeOptions;\n priceColor: ColorOptions;\n priceSize: FontSizeOptions;\n originalPriceColor: ColorOptions;\n metaTextColor: ColorOptions;\n metaTextSize: FontSizeOptions;\n numberColor: ColorOptions;\n numberSize: FontSizeOptions;\n showMetaText: boolean;\n}\n\nconst largeNumberSizes: Record<FontSizeOptions, string> = {\n xs: \"8rem\",\n sm: \"10rem\",\n md: \"12rem\",\n lg: \"14rem\",\n xl: \"16rem\",\n \"2xl\": \"20rem\",\n};\n\nexport function OrderedList({\n items,\n scrollAxis,\n gap,\n borderRadius,\n imageAspectRatio,\n showBadge,\n padding,\n itemTitleColor,\n itemTitleSize,\n descriptionColor,\n descriptionSize,\n priceColor,\n priceSize,\n originalPriceColor,\n metaTextColor,\n metaTextSize,\n numberColor,\n numberSize,\n showMetaText,\n}: OrderedListProps): React.JSX.Element | null {\n const scrollContainerRef = useRef<HTMLDivElement>(null);\n\n const scrollByAmount = (direction: \"prev\" | \"next\") => {\n const container = scrollContainerRef.current;\n if (!container) return;\n\n const computedGap = parseFloat(getComputedStyle(container).gap) || 0;\n const scrollAmount = SCROLL_ITEM_WIDTH + computedGap;\n\n container.scrollTo({\n left:\n container.scrollLeft +\n (direction === \"next\" ? scrollAmount : -scrollAmount),\n behavior: \"smooth\",\n });\n };\n\n const { onItemClick } = useWidgetInteraction();\n\n const interactionProps = (item: ListItem) =>\n onItemClick\n ? ({\n role: \"button\" as const,\n tabIndex: 0,\n onClick: () => onItemClick(item),\n onKeyDown: (e: React.KeyboardEvent) => {\n if (e.key === \"Enter\" || e.key === \" \") {\n e.preventDefault();\n onItemClick(item);\n }\n },\n } as const)\n : {};\n\n const contentProps = {\n padding,\n itemTitleColor,\n itemTitleSize,\n descriptionColor,\n descriptionSize,\n priceColor,\n priceSize,\n originalPriceColor,\n metaTextColor,\n metaTextSize,\n showMetaText,\n };\n\n if (scrollAxis === \"horizontal\") {\n return (\n <div className=\"relative overflow-hidden\">\n <div\n ref={scrollContainerRef}\n className={`flex gap-${gapValues[gap]} scrollbar-hide overflow-x-auto overflow-y-hidden scroll-smooth pb-2`}\n >\n {items.map((item, index) => {\n const imageUrl = getImageUrl(item);\n const aspectRatioClass = getAspectRatioClass(imageAspectRatio);\n\n return (\n <div\n key={item.id}\n className={`relative flex w-[300px] flex-shrink-0 flex-col ${onItemClick ? \"cursor-pointer\" : \"\"}`}\n {...interactionProps(item)}\n >\n <div\n className={`absolute top-0 left-0 text-${numberColor} z-0 leading-none font-bold opacity-20`}\n style={{ fontSize: largeNumberSizes[numberSize] }}\n >\n {index + 1}\n </div>\n\n <div\n className={`relative z-10 ml-20 flex flex-1 flex-col rounded-${borderRadius === \"full\" ? \"2xl\" : borderRadius} bg-background overflow-hidden shadow-sm transition-shadow hover:shadow-md`}\n >\n {showBadge && item.discount && (\n <DiscountBadge discount={item.discount} />\n )}\n {imageUrl && (\n <div\n className={`w-full ${aspectRatioClass} overflow-hidden`}\n >\n <img\n src={imageUrl}\n alt={item.title || \"Product\"}\n className=\"h-full w-full object-cover\"\n />\n </div>\n )}\n <ListItemCardContent item={item} {...contentProps} />\n </div>\n </div>\n );\n })}\n </div>\n\n <div className=\"absolute inset-x-0 top-1/2 z-20 flex w-full -translate-y-1/2 items-center justify-between px-8\">\n <ScrollArrows\n onPrevious={() => scrollByAmount(\"prev\")}\n onNext={() => scrollByAmount(\"next\")}\n />\n </div>\n </div>\n );\n }\n\n if (scrollAxis === \"vertical\") {\n return (\n <div className={`flex flex-col gap-${gapValues[gap]}`}>\n {items.map((item, index) => {\n const imageUrl = getImageUrl(item);\n\n return (\n <div\n key={item.id}\n className={`relative flex gap-${gapValues[gap]} rounded-${borderRadius === \"full\" ? \"2xl\" : borderRadius} bg-background overflow-hidden shadow-sm transition-shadow hover:shadow-md ${`p-${padding}`} ${onItemClick ? \"cursor-pointer\" : \"\"}`}\n {...interactionProps(item)}\n >\n <div\n className={`flex-shrink-0 text-${numberColor} text-${numberSize === \"md\" ? \"base\" : numberSize} flex w-16 items-center justify-center font-bold`}\n >\n {index + 1}\n </div>\n {imageUrl && (\n <div className=\"h-24 w-24 flex-shrink-0 overflow-hidden rounded-md\">\n <img\n src={imageUrl}\n alt={item.title || \"Product\"}\n className=\"h-full w-full object-cover\"\n />\n </div>\n )}\n <div className=\"flex-1\">\n <ListItemCardContent item={item} {...contentProps} />\n </div>\n {showBadge && item.discount && (\n <div className=\"bg-destructive text-destructive-foreground absolute top-2 right-2 rounded-md px-2 py-1 text-xs font-bold\">\n {getStringValue(item.discount)}\n </div>\n )}\n </div>\n );\n })}\n </div>\n );\n }\n\n return null;\n}\n","import type { ComponentProps } from \"react\";\nimport type React from \"react\";\nimport type {\n BorderWidthOptions,\n ColorOptions,\n FontSizeOptions,\n BorderRadiusOptions,\n PaddingOptions,\n GapOptions,\n BackgroundValue,\n} from \"@fluid-app/portal-core/types\";\nimport type { WidgetPropertySchema } from \"@fluid-app/portal-core/registries\";\nimport {\n getBorderRadiusField,\n getBorderWidthField,\n getBorderColorField,\n borderWidthClasses,\n borderColorClasses,\n getColorField,\n getFontSizeField,\n getPaddingField,\n getGapField,\n} from \"../core/fields\";\nimport { FeaturedSection } from \"./list-widget/FeaturedSection\";\nimport { UnorderedList } from \"./list-widget/UnorderedList\";\nimport { OrderedList } from \"./list-widget/OrderedList\";\n\nconst DEFAULT_ITEMS: ListItem[] = [];\n\ntype ListItem = {\n id: string;\n image?: string;\n imageUrl?: string;\n videoUrl?: string;\n title?: string;\n description?: string;\n price?: string;\n originalPrice?: string;\n discount?: string;\n qv?: string;\n cv?: string;\n [key: string]: unknown;\n};\n\ntype ImageAspectRatio = \"square\" | \"landscape\" | \"portrait\";\ntype ListType = \"ordered\" | \"unordered\";\ntype ScrollAxis = \"horizontal\" | \"vertical\";\n\ntype ListWidgetProps = ComponentProps<\"div\"> & {\n // List configuration\n listType?: ListType;\n scrollAxis?: ScrollAxis;\n titleEnabled?: boolean;\n title?: string;\n items?: ListItem[];\n\n // Text styling\n titleColor?: ColorOptions;\n titleSize?: FontSizeOptions;\n itemTitleColor?: ColorOptions;\n itemTitleSize?: FontSizeOptions;\n descriptionColor?: ColorOptions;\n descriptionSize?: FontSizeOptions;\n priceColor?: ColorOptions;\n priceSize?: FontSizeOptions;\n originalPriceColor?: ColorOptions;\n metaTextColor?: ColorOptions;\n metaTextSize?: FontSizeOptions;\n\n // Ordered list styling\n numberColor?: ColorOptions;\n numberSize?: FontSizeOptions;\n\n // Layout\n borderRadius?: BorderRadiusOptions;\n borderWidth?: BorderWidthOptions;\n borderColor?: ColorOptions;\n padding?: PaddingOptions;\n gap?: GapOptions;\n columns?: number;\n imageAspectRatio?: ImageAspectRatio;\n background?: BackgroundValue;\n\n // Behavior\n showBadge?: boolean;\n showMetaText?: boolean;\n maxItems?: number;\n\n // Featured section\n showFeaturedSection?: boolean;\n featuredAsset?: string | { [key: string]: unknown };\n featuredTitle?: string;\n featuredSubtitle?: string;\n featuredButtonText?: string;\n featuredButtonUrl?: string;\n featuredSubtitleColor?: ColorOptions;\n featuredSubtitleSize?: FontSizeOptions;\n};\n\nfunction getFeaturedAssetUrl(\n value: string | { [key: string]: unknown } | undefined,\n): { url: string; isVideo: boolean } | undefined {\n if (!value) return undefined;\n\n // Handle string URLs\n if (typeof value === \"string\") {\n const isVideo = /\\.(mp4|webm|ogg|mov)$/i.test(value);\n return { url: value, isVideo };\n }\n\n // Handle ShareableItem objects\n if (typeof value === \"object\") {\n // Check for video URL first\n const videoUrl =\n (value.videoUrl as string) ||\n (value.video_url as string) ||\n (value.url as string);\n if (videoUrl && /\\.(mp4|webm|ogg|mov)$/i.test(videoUrl)) {\n return { url: videoUrl, isVideo: true };\n }\n\n // Fall back to image URL\n const imageUrl =\n (value.imageUrl as string) ||\n (value.image_url as string) ||\n (value.url as string);\n if (imageUrl) {\n return { url: imageUrl, isVideo: false };\n }\n }\n\n return undefined;\n}\n\nexport function ListWidget({\n listType = \"unordered\",\n scrollAxis = \"horizontal\",\n titleEnabled = true,\n title,\n items = DEFAULT_ITEMS,\n titleColor = \"foreground\",\n titleSize = \"lg\",\n itemTitleColor = \"foreground\",\n itemTitleSize = \"sm\",\n descriptionColor = \"foreground\",\n descriptionSize = \"sm\",\n priceColor = \"foreground\",\n priceSize = \"md\",\n originalPriceColor = \"muted\",\n metaTextColor = \"muted\",\n metaTextSize = \"xs\",\n numberColor = \"primary\",\n numberSize = \"2xl\",\n borderRadius = \"md\",\n borderWidth = \"none\",\n borderColor = \"muted\",\n padding = 4,\n gap = \"md\",\n columns = 3,\n imageAspectRatio = \"square\",\n background = { type: \"solid\", color: \"background\" },\n showBadge = true,\n showMetaText = true,\n maxItems = 12,\n showFeaturedSection = false,\n featuredAsset,\n featuredTitle,\n featuredSubtitle,\n featuredButtonText,\n featuredButtonUrl,\n featuredSubtitleColor = \"background\",\n featuredSubtitleSize = \"md\",\n className,\n ...props\n}: ListWidgetProps): React.JSX.Element {\n const displayItems = maxItems ? items.slice(0, maxItems) : items;\n const hasItems = displayItems.length > 0;\n\n const itemStyleProps = {\n padding,\n itemTitleColor,\n itemTitleSize,\n descriptionColor,\n descriptionSize,\n priceColor,\n priceSize,\n originalPriceColor,\n metaTextColor,\n metaTextSize,\n showMetaText,\n showBadge,\n borderRadius,\n imageAspectRatio,\n gap,\n };\n\n const hasFeaturedAsset = getFeaturedAssetUrl(featuredAsset);\n const shouldShowFeaturedSection = showFeaturedSection && hasFeaturedAsset;\n\n // Background styling\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 return (\n <div\n className={`@container bg-${backgroundColor} p-${padding} rounded-${borderRadius} ${borderWidthClasses[borderWidth]} ${borderWidth !== \"none\" ? borderColorClasses[borderColor] : \"\"} ${className}`}\n style={{ backgroundImage }}\n {...props}\n >\n {titleEnabled && title && (\n <h2\n className={`text-${titleColor} text-${titleSize === \"md\" ? \"base\" : titleSize} font-header mb-6 font-bold`}\n >\n {title}\n </h2>\n )}\n {!hasItems ? (\n <div className=\"border-border bg-muted flex items-center justify-center rounded-md border-2 border-dashed py-12 text-center\">\n <p className=\"text-muted\">No items to display</p>\n </div>\n ) : shouldShowFeaturedSection ? (\n <div className=\"flex flex-col gap-4 @lg:flex-row @lg:gap-6\">\n <div className=\"w-full @lg:w-[45%]\">\n <FeaturedSection\n borderRadius={borderRadius}\n titleSize={titleSize}\n featuredTitle={featuredTitle}\n featuredSubtitle={featuredSubtitle}\n featuredButtonText={featuredButtonText}\n featuredButtonUrl={featuredButtonUrl}\n featuredSubtitleColor={featuredSubtitleColor}\n featuredSubtitleSize={featuredSubtitleSize}\n asset={hasFeaturedAsset!}\n />\n </div>\n <div className=\"w-full @lg:w-[55%]\">\n {listType === \"unordered\" ? (\n <UnorderedList\n items={displayItems}\n columns={columns}\n {...itemStyleProps}\n />\n ) : (\n <OrderedList\n items={displayItems}\n scrollAxis={scrollAxis}\n numberColor={numberColor}\n numberSize={numberSize}\n {...itemStyleProps}\n />\n )}\n </div>\n </div>\n ) : listType === \"unordered\" ? (\n <UnorderedList\n items={displayItems}\n columns={columns}\n {...itemStyleProps}\n />\n ) : (\n <OrderedList\n items={displayItems}\n scrollAxis={scrollAxis}\n numberColor={numberColor}\n numberSize={numberSize}\n {...itemStyleProps}\n />\n )}\n </div>\n );\n}\n\nexport const listWidgetPropertySchema: WidgetPropertySchema = {\n widgetType: \"ListWidget\",\n displayName: \"List\",\n tabsConfig: [\n { id: \"styling\", label: \"Styling\" },\n { id: \"data\", label: \"Data\" },\n ],\n dataSourceTargetProps: [\"items\"],\n fields: [\n // Styling tab - Title group\n {\n key: \"titleEnabled\",\n label: \"Widget Title\",\n type: \"boolean\",\n description: \"Enable the title displayed above the list\",\n defaultValue: true,\n tab: \"styling\",\n group: \"Title\",\n },\n {\n key: \"title\",\n label: \"Title\",\n type: \"text\",\n description: \"Header text for the list\",\n defaultValue: \"List\",\n tab: \"styling\",\n group: \"Title\",\n requiresKeyToBeTrue: \"titleEnabled\",\n },\n getFontSizeField({\n key: \"titleSize\",\n label: \"Title Font Size\",\n description: \"Size of the list 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 list title\",\n defaultValue: \"foreground\",\n tab: \"styling\",\n group: \"Title\",\n requiresKeyToBeTrue: \"titleEnabled\",\n }),\n\n // Styling tab - Design group\n getPaddingField({\n key: \"padding\",\n label: \"Padding\",\n description: \"Padding inside the container\",\n defaultValue: 4,\n tab: \"styling\",\n group: \"Design\",\n }),\n getBorderRadiusField({\n key: \"borderRadius\",\n label: \"Border Radius\",\n description: \"Rounded corners for the container and images\",\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\",\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\",\n defaultValue: \"muted\",\n tab: \"styling\",\n group: \"Design\",\n }),\n getGapField({\n key: \"gap\",\n label: \"Gap\",\n description: \"Spacing between items\",\n defaultValue: \"md\",\n tab: \"styling\",\n group: \"Design\",\n }),\n {\n type: \"background\",\n defaultValue: \"background\",\n key: \"background\",\n label: \"Background\",\n description: \"Background color or image for the widget\",\n tab: \"styling\",\n group: \"Design\",\n },\n\n // Styling tab - List Configuration group\n {\n key: \"listType\",\n label: \"List Type\",\n type: \"select\",\n description: \"Type of list layout\",\n defaultValue: \"unordered\",\n options: [\n { label: \"Unordered (Grid)\", value: \"unordered\" },\n { label: \"Ordered (Numbered)\", value: \"ordered\" },\n ],\n tab: \"styling\",\n group: \"List Configuration\",\n },\n {\n key: \"maxItems\",\n label: \"Max Items\",\n type: \"number\",\n description: \"Maximum number of items to display\",\n min: 1,\n max: 100,\n step: 1,\n defaultValue: 12,\n tab: \"styling\",\n group: \"List Configuration\",\n },\n {\n key: \"imageAspectRatio\",\n label: \"Image Aspect Ratio\",\n type: \"buttonGroup\",\n description: \"Aspect ratio for item images\",\n defaultValue: \"square\",\n options: [\n { label: \"Square\", value: \"square\" },\n { label: \"Landscape\", value: \"landscape\" },\n { label: \"Portrait\", value: \"portrait\" },\n ],\n tab: \"styling\",\n group: \"List Configuration\",\n },\n {\n key: \"showBadge\",\n label: \"Show Discount Badge\",\n type: \"boolean\",\n description: \"Display discount badge on images\",\n defaultValue: true,\n tab: \"styling\",\n group: \"List Configuration\",\n },\n {\n key: \"showMetaText\",\n label: \"Show QV/CV Text\",\n type: \"boolean\",\n description: \"Display QV and CV values\",\n defaultValue: true,\n tab: \"styling\",\n group: \"List Configuration\",\n },\n\n // Styling tab - Unordered List Configuration\n {\n key: \"columns\",\n label: \"Grid Columns\",\n type: \"number\",\n description: \"Number of columns in the grid (unordered list only)\",\n min: 1,\n max: 6,\n step: 1,\n defaultValue: 3,\n tab: \"styling\",\n group: \"Unordered List Configuration\",\n requiresKeyValue: { key: \"listType\", value: \"unordered\" },\n },\n\n // Styling tab - Ordered List Configuration\n {\n key: \"scrollAxis\",\n label: \"Scroll Direction\",\n type: \"select\",\n description: \"Direction for ordered list scrolling\",\n defaultValue: \"horizontal\",\n options: [\n { label: \"Horizontal\", value: \"horizontal\" },\n { label: \"Vertical\", value: \"vertical\" },\n ],\n tab: \"styling\",\n group: \"Ordered List Configuration\",\n requiresKeyValue: { key: \"listType\", value: \"ordered\" },\n },\n getColorField({\n key: \"numberColor\",\n label: \"Number Color\",\n description: \"Color for ordered list numbers\",\n defaultValue: \"primary\",\n tab: \"styling\",\n group: \"Ordered List Configuration\",\n requiresKeyValue: { key: \"listType\", value: \"ordered\" },\n }),\n getFontSizeField({\n key: \"numberSize\",\n label: \"Number Font Size\",\n description: \"Size of ordered list numbers\",\n defaultValue: \"2xl\",\n tab: \"styling\",\n group: \"Ordered List Configuration\",\n requiresKeyValue: { key: \"listType\", value: \"ordered\" },\n }),\n\n // Styling tab - Item Styling group\n getColorField({\n key: \"itemTitleColor\",\n label: \"Item Title Color\",\n description: \"Color for item titles\",\n defaultValue: \"foreground\",\n tab: \"styling\",\n group: \"Item Styling\",\n }),\n getFontSizeField({\n key: \"itemTitleSize\",\n label: \"Item Title Font Size\",\n description: \"Size of item titles\",\n defaultValue: \"sm\",\n tab: \"styling\",\n group: \"Item Styling\",\n }),\n {\n key: \"separator2\",\n type: \"separator\",\n label: \"Separator\",\n tab: \"styling\",\n group: \"Item Styling\",\n },\n getColorField({\n key: \"descriptionColor\",\n label: \"Description Color\",\n description: \"Color for descriptions\",\n defaultValue: \"foreground\",\n tab: \"styling\",\n group: \"Item Styling\",\n }),\n getFontSizeField({\n key: \"descriptionSize\",\n label: \"Description Font Size\",\n description: \"Size of descriptions\",\n defaultValue: \"sm\",\n tab: \"styling\",\n group: \"Item Styling\",\n }),\n {\n key: \"separator3\",\n type: \"separator\",\n label: \"Separator\",\n tab: \"styling\",\n group: \"Item Styling\",\n },\n getColorField({\n key: \"priceColor\",\n label: \"Price Color\",\n description: \"Color for prices\",\n defaultValue: \"foreground\",\n tab: \"styling\",\n group: \"Item Styling\",\n }),\n getFontSizeField({\n key: \"priceSize\",\n label: \"Price Font Size\",\n description: \"Size of prices\",\n defaultValue: \"md\",\n tab: \"styling\",\n group: \"Item Styling\",\n }),\n getColorField({\n key: \"originalPriceColor\",\n label: \"Original Price Color\",\n description: \"Color for crossed-out original prices\",\n defaultValue: \"foreground\",\n tab: \"styling\",\n group: \"Item Styling\",\n }),\n {\n key: \"separator4\",\n type: \"separator\",\n label: \"Separator\",\n tab: \"styling\",\n group: \"Item Styling\",\n },\n getColorField({\n key: \"metaTextColor\",\n label: \"Meta Text Color\",\n description: \"Color for QV/CV text\",\n defaultValue: \"foreground\",\n tab: \"styling\",\n group: \"Item Styling\",\n }),\n getFontSizeField({\n key: \"metaTextSize\",\n label: \"Meta Text Font Size\",\n description: \"Size of QV/CV text\",\n defaultValue: \"xs\",\n tab: \"styling\",\n group: \"Item Styling\",\n }),\n\n // Styling tab - Featured Section group\n {\n key: \"showFeaturedSection\",\n label: \"Show Featured Section\",\n type: \"boolean\",\n description: \"Display a featured content section\",\n defaultValue: false,\n tab: \"styling\",\n group: \"Featured Section\",\n },\n {\n key: \"featuredAsset\",\n label: \"Featured Asset\",\n type: \"resource\",\n description:\n \"Select a single image or video resource for the featured section\",\n tab: \"styling\",\n group: \"Featured Section\",\n allowedTypes: [\"Medium\"],\n requiresKeyToBeTrue: \"showFeaturedSection\",\n },\n {\n key: \"featuredTitle\",\n label: \"Featured Title\",\n type: \"text\",\n description: \"Title for featured section\",\n tab: \"styling\",\n group: \"Featured Section\",\n requiresKeyToBeTrue: \"showFeaturedSection\",\n },\n {\n key: \"featuredSubtitle\",\n label: \"Featured Subtitle\",\n type: \"text\",\n description: \"Subtitle for featured section\",\n tab: \"styling\",\n group: \"Featured Section\",\n requiresKeyToBeTrue: \"showFeaturedSection\",\n },\n {\n key: \"featuredButtonText\",\n label: \"Featured Button Text\",\n type: \"text\",\n description: \"Text for featured section button\",\n tab: \"styling\",\n group: \"Featured Section\",\n requiresKeyToBeTrue: \"showFeaturedSection\",\n },\n {\n key: \"featuredButtonUrl\",\n label: \"Featured Button URL\",\n type: \"text\",\n description: \"URL for featured section button\",\n tab: \"styling\",\n group: \"Featured Section\",\n requiresKeyToBeTrue: \"showFeaturedSection\",\n },\n getColorField({\n key: \"featuredSubtitleColor\",\n label: \"Featured Subtitle Color\",\n description: \"Color for featured subtitle\",\n defaultValue: \"background\",\n tab: \"styling\",\n group: \"Featured Section\",\n requiresKeyToBeTrue: \"showFeaturedSection\",\n }),\n getFontSizeField({\n key: \"featuredSubtitleSize\",\n label: \"Featured Subtitle Font Size\",\n description: \"Size of featured subtitle\",\n defaultValue: \"md\",\n tab: \"styling\",\n group: \"Featured Section\",\n requiresKeyToBeTrue: \"showFeaturedSection\",\n }),\n\n // Data tab - Data Configuration\n {\n key: \"dataSource\",\n label: \"Data Source\",\n type: \"dataSource\",\n description: \"\",\n tab: \"data\",\n group: \"Data Configuration\",\n },\n ],\n itemConfigSchema: {\n description: \"Configure settings for this list item\",\n fields: [\n {\n key: \"title\",\n label: \"Custom Title\",\n type: \"text\",\n description: \"Override the item's title\",\n },\n {\n key: \"description\",\n label: \"Custom Description\",\n type: \"textarea\",\n description: \"Override the item's description\",\n rows: 3,\n },\n {\n key: \"price\",\n label: \"Price\",\n type: \"text\",\n description: \"Current price\",\n },\n {\n key: \"originalPrice\",\n label: \"Original Price\",\n type: \"text\",\n description: \"Original price (will be crossed out)\",\n },\n {\n key: \"discount\",\n label: \"Discount Badge\",\n type: \"text\",\n description: \"Discount text (e.g., '40% Off')\",\n },\n {\n key: \"qv\",\n label: \"QV Value\",\n type: \"text\",\n description: \"Qualifying Volume value\",\n },\n {\n key: \"cv\",\n label: \"CV Value\",\n type: \"text\",\n description: \"Commission Volume value\",\n },\n {\n key: \"image\",\n label: \"Image URL\",\n type: \"text\",\n description: \"Custom image URL for this item\",\n },\n ],\n },\n} as const satisfies WidgetPropertySchema;\n"],"mappings":";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Ac;GACd,KAAK;GACL,OAAO;GACP,kBAAkB;IAAE,KAAK;IAAY,OAAO;IAAW;GACxD,CAAC;EACF,iBAAiB;GACf,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACP,kBAAkB;IAAE,KAAK;IAAY,OAAO;IAAW;GACxD,CAAC;EAGF,cAAc;GACZ,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EACF,iBAAiB;GACf,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EACF;GACE,KAAK;GACL,MAAM;GACN,OAAO;GACP,KAAK;GACL,OAAO;GACR;EACD,cAAc;GACZ,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EACF,iBAAiB;GACf,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EACF;GACE,KAAK;GACL,MAAM;GACN,OAAO;GACP,KAAK;GACL,OAAO;GACR;EACD,cAAc;GACZ,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EACF,iBAAiB;GACf,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EACF,cAAc;GACZ,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EACF;GACE,KAAK;GACL,MAAM;GACN,OAAO;GACP,KAAK;GACL,OAAO;GACR;EACD,cAAc;GACZ,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EACF,iBAAiB;GACf,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EAGF;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,KAAK;GACL,OAAO;GACP,cAAc,CAAC,SAAS;GACxB,qBAAqB;GACtB;EACD;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,KAAK;GACL,OAAO;GACP,qBAAqB;GACtB;EACD;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,KAAK;GACL,OAAO;GACP,qBAAqB;GACtB;EACD;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,KAAK;GACL,OAAO;GACP,qBAAqB;GACtB;EACD;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,KAAK;GACL,OAAO;GACP,qBAAqB;GACtB;EACD,cAAc;GACZ,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACP,qBAAqB;GACtB,CAAC;EACF,iBAAiB;GACf,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACP,qBAAqB;GACtB,CAAC;EAGF;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,KAAK;GACL,OAAO;GACR;EACF;CACD,kBAAkB;EAChB,aAAa;EACb,QAAQ;GACN;IACE,KAAK;IACL,OAAO;IACP,MAAM;IACN,aAAa;IACd;GACD;IACE,KAAK;IACL,OAAO;IACP,MAAM;IACN,aAAa;IACb,MAAM;IACP;GACD;IACE,KAAK;IACL,OAAO;IACP,MAAM;IACN,aAAa;IACd;GACD;IACE,KAAK;IACL,OAAO;IACP,MAAM;IACN,aAAa;IACd;GACD;IACE,KAAK;IACL,OAAO;IACP,MAAM;IACN,aAAa;IACd;GACD;IACE,KAAK;IACL,OAAO;IACP,MAAM;IACN,aAAa;IACd;GACD;IACE,KAAK;IACL,OAAO;IACP,MAAM;IACN,aAAa;IACd;GACD;IACE,KAAK;IACL,OAAO;IACP,MAAM;IACN,aAAa;IACd;GACF;EACF;CACF"}
1
+ {"version":3,"file":"ListWidget-BWfsmVoc.mjs","names":["DOMPurify","getImageUrl","getAspectRatioClass"],"sources":["../../widgets/src/widgets/list-widget/FeaturedSection.tsx","../../widgets/src/widgets/list-widget/ListItemCard.tsx","../../widgets/src/widgets/list-widget/UnorderedList.tsx","../../widgets/src/widgets/list-widget/OrderedList.tsx","../../widgets/src/widgets/ListWidget.tsx"],"sourcesContent":["import type React from \"react\";\nimport type {\n BorderRadiusOptions,\n FontSizeOptions,\n ColorOptions,\n} from \"@fluid-app/portal-core/types\";\nimport { MediaRenderer } from \"../../components/MediaRenderer\";\n\ninterface FeaturedSectionProps {\n borderRadius: BorderRadiusOptions;\n titleSize: FontSizeOptions;\n featuredTitle?: string | undefined;\n featuredSubtitle?: string | undefined;\n featuredButtonText?: string | undefined;\n featuredButtonUrl?: string | undefined;\n featuredSubtitleColor: ColorOptions;\n featuredSubtitleSize: FontSizeOptions;\n asset: { url: string; isVideo: boolean };\n}\n\nexport function FeaturedSection({\n borderRadius,\n titleSize,\n featuredTitle,\n featuredSubtitle,\n featuredButtonText,\n featuredButtonUrl,\n featuredSubtitleColor,\n featuredSubtitleSize,\n asset,\n}: FeaturedSectionProps): React.JSX.Element {\n return (\n <div\n className={`relative h-full min-h-[300px] w-full overflow-hidden rounded-${borderRadius}`}\n >\n <div className=\"absolute inset-0 h-full w-full\">\n <MediaRenderer\n src={asset.url}\n mediaType={asset.isVideo ? \"video\" : \"image\"}\n alt={featuredTitle || \"Featured\"}\n objectFit=\"cover\"\n autoplay={asset.isVideo}\n loop={asset.isVideo}\n muted={asset.isVideo}\n controls={false}\n />\n </div>\n\n <div className=\"pointer-events-none absolute inset-0 bg-black/40\" />\n\n <div className=\"absolute inset-0 flex flex-col items-start justify-end p-8\">\n {featuredTitle && (\n <h3\n className={`font-header mb-2 font-bold text-white text-${titleSize === \"md\" ? \"base\" : titleSize}`}\n >\n {featuredTitle}\n </h3>\n )}\n {featuredSubtitle && (\n <p\n className={`mb-4 text-${featuredSubtitleColor} text-${featuredSubtitleSize === \"md\" ? \"base\" : featuredSubtitleSize}`}\n >\n {featuredSubtitle}\n </p>\n )}\n {featuredButtonText && (\n <a\n href={featuredButtonUrl || \"#\"}\n className={`text-foreground bg-white px-6 py-2 font-medium transition-opacity hover:opacity-90 rounded-${borderRadius}`}\n >\n {featuredButtonText}\n </a>\n )}\n </div>\n </div>\n );\n}\n","import type React from \"react\";\nimport DOMPurify from \"dompurify\";\nimport type {\n ColorOptions,\n FontSizeOptions,\n PaddingOptions,\n} from \"@fluid-app/portal-core/types\";\n\ntype ListItem = {\n id: string;\n image?: string;\n imageUrl?: string;\n videoUrl?: string;\n title?: string;\n description?: string;\n price?: string;\n display_price?: string;\n originalPrice?: string;\n discount?: string;\n qv?: string;\n cv?: string;\n [key: string]: unknown;\n};\n\nfunction getStringValue(value: unknown): string {\n if (!value) return \"\";\n if (typeof value === \"string\") return value;\n if (typeof value === \"number\") return String(value);\n if (typeof value === \"object\" && value !== null) {\n if (\"body\" in value) {\n const body = (value as { body: unknown }).body;\n if (typeof body === \"string\") return body;\n }\n if (\"text\" in value) {\n const text = (value as { text: unknown }).text;\n if (typeof text === \"string\") return text;\n }\n if (\"value\" in value) {\n const val = (value as { value: unknown }).value;\n if (typeof val === \"string\") return val;\n if (typeof val === \"number\") return String(val);\n }\n }\n return \"\";\n}\n\n/**\n * Strips parenthetical text like \"(USD)\" from price strings.\n * Matches the shop page's stripParentheticalText pattern.\n */\nfunction stripParentheticalText(text: string): string {\n return text.replace(/\\s*\\([^)]*\\)/g, \"\").trim();\n}\n\n/**\n * Formats a price for display. Follows the shop page pattern:\n * prices arrive pre-formatted from the API via display_price\n * (e.g. \"$19.99\", \"€15.00 (EUR)\") so we just extract the string\n * and strip parenthetical suffixes.\n */\nfunction formatPrice(value: unknown): string {\n const str = getStringValue(value);\n if (!str) return \"\";\n return stripParentheticalText(str);\n}\n\nexport interface ListItemCardContentProps {\n item: ListItem;\n padding: PaddingOptions;\n itemTitleColor: ColorOptions;\n itemTitleSize: FontSizeOptions;\n descriptionColor: ColorOptions;\n descriptionSize: FontSizeOptions;\n priceColor: ColorOptions;\n priceSize: FontSizeOptions;\n originalPriceColor: ColorOptions;\n metaTextColor: ColorOptions;\n metaTextSize: FontSizeOptions;\n showMetaText: boolean;\n}\n\nexport function ListItemCardContent({\n item,\n padding,\n itemTitleColor,\n itemTitleSize,\n descriptionColor,\n descriptionSize,\n priceColor,\n priceSize,\n originalPriceColor,\n metaTextColor,\n metaTextSize,\n showMetaText,\n}: ListItemCardContentProps): React.JSX.Element {\n return (\n <div className={`flex flex-1 flex-col p-${padding}`}>\n {item.title && (\n <h3\n className={`text-${itemTitleColor} text-${itemTitleSize === \"md\" ? \"base\" : itemTitleSize} font-header mb-1 font-semibold`}\n >\n {getStringValue(item.title)}\n </h3>\n )}\n {item.description && (\n <div\n className={`text-${descriptionColor} text-${descriptionSize === \"md\" ? \"base\" : descriptionSize} mb-2 line-clamp-2 overflow-hidden`}\n dangerouslySetInnerHTML={{\n __html: DOMPurify.sanitize(item.description ?? \"\", {\n ALLOWED_TAGS: [\n \"br\",\n \"strong\",\n \"em\",\n \"b\",\n \"i\",\n \"ul\",\n \"ol\",\n \"li\",\n \"p\",\n ],\n ALLOWED_ATTR: [],\n }),\n }}\n />\n )}\n <div className=\"flex items-center gap-2\">\n {(item.display_price || item.price) && (\n <span\n className={`text-${priceColor} text-${priceSize === \"md\" ? \"base\" : priceSize} font-bold`}\n >\n {formatPrice(item.display_price || item.price)}\n </span>\n )}\n {item.originalPrice && (\n <span\n className={`text-${originalPriceColor} text-${descriptionSize === \"md\" ? \"base\" : descriptionSize} line-through`}\n >\n {formatPrice(item.originalPrice)}\n </span>\n )}\n </div>\n {showMetaText && (item.qv || item.cv) && (\n <div\n className={`mt-2 flex gap-3 text-${metaTextColor} text-${metaTextSize === \"md\" ? \"base\" : metaTextSize}`}\n >\n {item.qv && <span>QV: {getStringValue(item.qv)}</span>}\n {item.cv && <span>CV: {getStringValue(item.cv)}</span>}\n </div>\n )}\n </div>\n );\n}\n\nexport function DiscountBadge({\n discount,\n}: {\n discount: string;\n}): React.JSX.Element {\n return (\n <div className=\"bg-destructive text-destructive-foreground absolute top-2 right-2 z-10 rounded-md px-2 py-1 text-xs font-bold\">\n {getStringValue(discount)}\n </div>\n );\n}\n\nexport { getStringValue };\nexport type { ListItem };\n","import type React from \"react\";\nimport type {\n ColorOptions,\n FontSizeOptions,\n BorderRadiusOptions,\n PaddingOptions,\n GapOptions,\n} from \"@fluid-app/portal-core/types\";\nimport { gapValues } from \"../../core/fields\";\nimport { useWidgetInteraction } from \"../../contexts/WidgetInteractionContext\";\nimport {\n ListItemCardContent,\n DiscountBadge,\n type ListItem,\n} from \"./ListItemCard\";\n\ntype ImageAspectRatio = \"square\" | \"landscape\" | \"portrait\";\n\nconst getImageUrl = (item: ListItem): string | undefined => {\n return item.imageUrl || item.image;\n};\n\nconst getAspectRatioClass = (ratio: ImageAspectRatio): string => {\n const ratios = {\n square: \"aspect-square\",\n landscape: \"aspect-video\",\n portrait: \"aspect-[3/4]\",\n };\n return ratios[ratio];\n};\n\nconst getResponsiveGridClass = (columns: number): string => {\n const responsiveClasses: Record<number, string> = {\n 1: \"grid-cols-2 @lg:grid-cols-1\",\n 2: \"grid-cols-2 @lg:grid-cols-2\",\n 3: \"grid-cols-2 @lg:grid-cols-3\",\n 4: \"grid-cols-2 @lg:grid-cols-4\",\n 5: \"grid-cols-2 @lg:grid-cols-5\",\n 6: \"grid-cols-2 @lg:grid-cols-6\",\n };\n return responsiveClasses[columns] || \"grid-cols-2 @lg:grid-cols-3\";\n};\n\nexport interface UnorderedListProps {\n items: ListItem[];\n columns: number;\n gap: GapOptions;\n borderRadius: BorderRadiusOptions;\n imageAspectRatio: ImageAspectRatio;\n showBadge: boolean;\n padding: PaddingOptions;\n itemTitleColor: ColorOptions;\n itemTitleSize: FontSizeOptions;\n descriptionColor: ColorOptions;\n descriptionSize: FontSizeOptions;\n priceColor: ColorOptions;\n priceSize: FontSizeOptions;\n originalPriceColor: ColorOptions;\n metaTextColor: ColorOptions;\n metaTextSize: FontSizeOptions;\n showMetaText: boolean;\n}\n\nexport function UnorderedList({\n items,\n columns,\n gap,\n borderRadius,\n imageAspectRatio,\n showBadge,\n padding,\n itemTitleColor,\n itemTitleSize,\n descriptionColor,\n descriptionSize,\n priceColor,\n priceSize,\n originalPriceColor,\n metaTextColor,\n metaTextSize,\n showMetaText,\n}: UnorderedListProps): React.JSX.Element {\n const gridClass = getResponsiveGridClass(columns);\n const { onItemClick } = useWidgetInteraction();\n\n return (\n <div className={`grid ${gridClass} gap-${gapValues[gap]}`}>\n {items.map((item) => {\n const imageUrl = getImageUrl(item);\n const aspectRatioClass = getAspectRatioClass(imageAspectRatio);\n\n return (\n <div\n key={item.id}\n className={`relative flex flex-col rounded-${borderRadius === \"full\" ? \"2xl\" : borderRadius} bg-background overflow-hidden shadow-sm transition-shadow hover:shadow-md ${onItemClick ? \"cursor-pointer\" : \"\"}`}\n {...(onItemClick\n ? {\n role: \"button\",\n tabIndex: 0,\n onClick: () => onItemClick(item),\n onKeyDown: (e: React.KeyboardEvent) => {\n if (e.key === \"Enter\" || e.key === \" \") {\n e.preventDefault();\n onItemClick(item);\n }\n },\n }\n : {})}\n >\n {showBadge && item.discount && (\n <DiscountBadge discount={item.discount} />\n )}\n {imageUrl && (\n <div className={`w-full ${aspectRatioClass} overflow-hidden`}>\n <img\n src={imageUrl}\n alt={item.title || \"Product\"}\n className=\"h-full w-full object-cover\"\n />\n </div>\n )}\n <ListItemCardContent\n item={item}\n padding={padding}\n itemTitleColor={itemTitleColor}\n itemTitleSize={itemTitleSize}\n descriptionColor={descriptionColor}\n descriptionSize={descriptionSize}\n priceColor={priceColor}\n priceSize={priceSize}\n originalPriceColor={originalPriceColor}\n metaTextColor={metaTextColor}\n metaTextSize={metaTextSize}\n showMetaText={showMetaText}\n />\n </div>\n );\n })}\n </div>\n );\n}\n","import { useRef } from \"react\";\nimport type React from \"react\";\nimport type {\n ColorOptions,\n FontSizeOptions,\n BorderRadiusOptions,\n PaddingOptions,\n GapOptions,\n} from \"@fluid-app/portal-core/types\";\nimport { gapValues } from \"../../core/fields\";\nimport { useWidgetInteraction } from \"../../contexts/WidgetInteractionContext\";\nimport { ScrollArrows } from \"../../ui/scroll-arrows\";\nimport {\n ListItemCardContent,\n DiscountBadge,\n getStringValue,\n type ListItem,\n} from \"./ListItemCard\";\n\ntype ImageAspectRatio = \"square\" | \"landscape\" | \"portrait\";\ntype ScrollAxis = \"horizontal\" | \"vertical\";\n\nconst SCROLL_ITEM_WIDTH = 300;\n\nconst getImageUrl = (item: ListItem): string | undefined => {\n return item.imageUrl || item.image;\n};\n\nconst getAspectRatioClass = (ratio: ImageAspectRatio): string => {\n const ratios = {\n square: \"aspect-square\",\n landscape: \"aspect-video\",\n portrait: \"aspect-[3/4]\",\n };\n return ratios[ratio];\n};\n\nexport interface OrderedListProps {\n items: ListItem[];\n scrollAxis: ScrollAxis;\n gap: GapOptions;\n borderRadius: BorderRadiusOptions;\n imageAspectRatio: ImageAspectRatio;\n showBadge: boolean;\n padding: PaddingOptions;\n itemTitleColor: ColorOptions;\n itemTitleSize: FontSizeOptions;\n descriptionColor: ColorOptions;\n descriptionSize: FontSizeOptions;\n priceColor: ColorOptions;\n priceSize: FontSizeOptions;\n originalPriceColor: ColorOptions;\n metaTextColor: ColorOptions;\n metaTextSize: FontSizeOptions;\n numberColor: ColorOptions;\n numberSize: FontSizeOptions;\n showMetaText: boolean;\n}\n\nconst largeNumberSizes: Record<FontSizeOptions, string> = {\n xs: \"8rem\",\n sm: \"10rem\",\n md: \"12rem\",\n lg: \"14rem\",\n xl: \"16rem\",\n \"2xl\": \"20rem\",\n};\n\nexport function OrderedList({\n items,\n scrollAxis,\n gap,\n borderRadius,\n imageAspectRatio,\n showBadge,\n padding,\n itemTitleColor,\n itemTitleSize,\n descriptionColor,\n descriptionSize,\n priceColor,\n priceSize,\n originalPriceColor,\n metaTextColor,\n metaTextSize,\n numberColor,\n numberSize,\n showMetaText,\n}: OrderedListProps): React.JSX.Element | null {\n const scrollContainerRef = useRef<HTMLDivElement>(null);\n\n const scrollByAmount = (direction: \"prev\" | \"next\") => {\n const container = scrollContainerRef.current;\n if (!container) return;\n\n const computedGap = parseFloat(getComputedStyle(container).gap) || 0;\n const scrollAmount = SCROLL_ITEM_WIDTH + computedGap;\n\n container.scrollTo({\n left:\n container.scrollLeft +\n (direction === \"next\" ? scrollAmount : -scrollAmount),\n behavior: \"smooth\",\n });\n };\n\n const { onItemClick } = useWidgetInteraction();\n\n const interactionProps = (item: ListItem) =>\n onItemClick\n ? ({\n role: \"button\" as const,\n tabIndex: 0,\n onClick: () => onItemClick(item),\n onKeyDown: (e: React.KeyboardEvent) => {\n if (e.key === \"Enter\" || e.key === \" \") {\n e.preventDefault();\n onItemClick(item);\n }\n },\n } as const)\n : {};\n\n const contentProps = {\n padding,\n itemTitleColor,\n itemTitleSize,\n descriptionColor,\n descriptionSize,\n priceColor,\n priceSize,\n originalPriceColor,\n metaTextColor,\n metaTextSize,\n showMetaText,\n };\n\n if (scrollAxis === \"horizontal\") {\n return (\n <div className=\"relative overflow-hidden\">\n <div\n ref={scrollContainerRef}\n className={`flex gap-${gapValues[gap]} scrollbar-hide overflow-x-auto overflow-y-hidden scroll-smooth pb-2`}\n >\n {items.map((item, index) => {\n const imageUrl = getImageUrl(item);\n const aspectRatioClass = getAspectRatioClass(imageAspectRatio);\n\n return (\n <div\n key={item.id}\n className={`relative flex w-[300px] flex-shrink-0 flex-col ${onItemClick ? \"cursor-pointer\" : \"\"}`}\n {...interactionProps(item)}\n >\n <div\n className={`absolute top-0 left-0 text-${numberColor} z-0 leading-none font-bold opacity-20`}\n style={{ fontSize: largeNumberSizes[numberSize] }}\n >\n {index + 1}\n </div>\n\n <div\n className={`relative z-10 ml-20 flex flex-1 flex-col rounded-${borderRadius === \"full\" ? \"2xl\" : borderRadius} bg-background overflow-hidden shadow-sm transition-shadow hover:shadow-md`}\n >\n {showBadge && item.discount && (\n <DiscountBadge discount={item.discount} />\n )}\n {imageUrl && (\n <div\n className={`w-full ${aspectRatioClass} overflow-hidden`}\n >\n <img\n src={imageUrl}\n alt={item.title || \"Product\"}\n className=\"h-full w-full object-cover\"\n />\n </div>\n )}\n <ListItemCardContent item={item} {...contentProps} />\n </div>\n </div>\n );\n })}\n </div>\n\n <div className=\"absolute inset-x-0 top-1/2 z-20 flex w-full -translate-y-1/2 items-center justify-between px-8\">\n <ScrollArrows\n onPrevious={() => scrollByAmount(\"prev\")}\n onNext={() => scrollByAmount(\"next\")}\n />\n </div>\n </div>\n );\n }\n\n if (scrollAxis === \"vertical\") {\n return (\n <div className={`flex flex-col gap-${gapValues[gap]}`}>\n {items.map((item, index) => {\n const imageUrl = getImageUrl(item);\n\n return (\n <div\n key={item.id}\n className={`relative flex gap-${gapValues[gap]} rounded-${borderRadius === \"full\" ? \"2xl\" : borderRadius} bg-background overflow-hidden shadow-sm transition-shadow hover:shadow-md ${`p-${padding}`} ${onItemClick ? \"cursor-pointer\" : \"\"}`}\n {...interactionProps(item)}\n >\n <div\n className={`flex-shrink-0 text-${numberColor} text-${numberSize === \"md\" ? \"base\" : numberSize} flex w-16 items-center justify-center font-bold`}\n >\n {index + 1}\n </div>\n {imageUrl && (\n <div className=\"h-24 w-24 flex-shrink-0 overflow-hidden rounded-md\">\n <img\n src={imageUrl}\n alt={item.title || \"Product\"}\n className=\"h-full w-full object-cover\"\n />\n </div>\n )}\n <div className=\"flex-1\">\n <ListItemCardContent item={item} {...contentProps} />\n </div>\n {showBadge && item.discount && (\n <div className=\"bg-destructive text-destructive-foreground absolute top-2 right-2 rounded-md px-2 py-1 text-xs font-bold\">\n {getStringValue(item.discount)}\n </div>\n )}\n </div>\n );\n })}\n </div>\n );\n }\n\n return null;\n}\n","import type { ComponentProps } from \"react\";\nimport type React from \"react\";\nimport type {\n BorderWidthOptions,\n ColorOptions,\n FontSizeOptions,\n BorderRadiusOptions,\n PaddingOptions,\n GapOptions,\n BackgroundValue,\n} from \"@fluid-app/portal-core/types\";\nimport type { WidgetPropertySchema } from \"@fluid-app/portal-core/registries\";\nimport {\n getBorderRadiusField,\n getBorderWidthField,\n getBorderColorField,\n borderWidthClasses,\n borderColorClasses,\n getColorField,\n getFontSizeField,\n getPaddingField,\n getGapField,\n} from \"../core/fields\";\nimport { FeaturedSection } from \"./list-widget/FeaturedSection\";\nimport { UnorderedList } from \"./list-widget/UnorderedList\";\nimport { OrderedList } from \"./list-widget/OrderedList\";\n\nconst DEFAULT_ITEMS: ListItem[] = [];\n\ntype ListItem = {\n id: string;\n image?: string;\n imageUrl?: string;\n videoUrl?: string;\n title?: string;\n description?: string;\n price?: string;\n originalPrice?: string;\n discount?: string;\n qv?: string;\n cv?: string;\n [key: string]: unknown;\n};\n\ntype ImageAspectRatio = \"square\" | \"landscape\" | \"portrait\";\ntype ListType = \"ordered\" | \"unordered\";\ntype ScrollAxis = \"horizontal\" | \"vertical\";\n\ntype ListWidgetProps = ComponentProps<\"div\"> & {\n // List configuration\n listType?: ListType;\n scrollAxis?: ScrollAxis;\n titleEnabled?: boolean;\n title?: string;\n items?: ListItem[];\n\n // Text styling\n titleColor?: ColorOptions;\n titleSize?: FontSizeOptions;\n itemTitleColor?: ColorOptions;\n itemTitleSize?: FontSizeOptions;\n descriptionColor?: ColorOptions;\n descriptionSize?: FontSizeOptions;\n priceColor?: ColorOptions;\n priceSize?: FontSizeOptions;\n originalPriceColor?: ColorOptions;\n metaTextColor?: ColorOptions;\n metaTextSize?: FontSizeOptions;\n\n // Ordered list styling\n numberColor?: ColorOptions;\n numberSize?: FontSizeOptions;\n\n // Layout\n borderRadius?: BorderRadiusOptions;\n borderWidth?: BorderWidthOptions;\n borderColor?: ColorOptions;\n padding?: PaddingOptions;\n gap?: GapOptions;\n columns?: number;\n imageAspectRatio?: ImageAspectRatio;\n background?: BackgroundValue;\n\n // Behavior\n showBadge?: boolean;\n showMetaText?: boolean;\n maxItems?: number;\n\n // Featured section\n showFeaturedSection?: boolean;\n featuredAsset?: string | { [key: string]: unknown };\n featuredTitle?: string;\n featuredSubtitle?: string;\n featuredButtonText?: string;\n featuredButtonUrl?: string;\n featuredSubtitleColor?: ColorOptions;\n featuredSubtitleSize?: FontSizeOptions;\n};\n\nfunction getFeaturedAssetUrl(\n value: string | { [key: string]: unknown } | undefined,\n): { url: string; isVideo: boolean } | undefined {\n if (!value) return undefined;\n\n // Handle string URLs\n if (typeof value === \"string\") {\n const isVideo = /\\.(mp4|webm|ogg|mov)$/i.test(value);\n return { url: value, isVideo };\n }\n\n // Handle ShareableItem objects\n if (typeof value === \"object\") {\n // Check for video URL first\n const videoUrl =\n (value.videoUrl as string) ||\n (value.video_url as string) ||\n (value.url as string);\n if (videoUrl && /\\.(mp4|webm|ogg|mov)$/i.test(videoUrl)) {\n return { url: videoUrl, isVideo: true };\n }\n\n // Fall back to image URL\n const imageUrl =\n (value.imageUrl as string) ||\n (value.image_url as string) ||\n (value.url as string);\n if (imageUrl) {\n return { url: imageUrl, isVideo: false };\n }\n }\n\n return undefined;\n}\n\nexport function ListWidget({\n listType = \"unordered\",\n scrollAxis = \"horizontal\",\n titleEnabled = true,\n title,\n items = DEFAULT_ITEMS,\n titleColor = \"foreground\",\n titleSize = \"lg\",\n itemTitleColor = \"foreground\",\n itemTitleSize = \"sm\",\n descriptionColor = \"foreground\",\n descriptionSize = \"sm\",\n priceColor = \"foreground\",\n priceSize = \"md\",\n originalPriceColor = \"muted\",\n metaTextColor = \"muted\",\n metaTextSize = \"xs\",\n numberColor = \"primary\",\n numberSize = \"2xl\",\n borderRadius = \"md\",\n borderWidth = \"none\",\n borderColor = \"muted\",\n padding = 4,\n gap = \"md\",\n columns = 3,\n imageAspectRatio = \"square\",\n background = { type: \"solid\", color: \"background\" },\n showBadge = true,\n showMetaText = true,\n maxItems = 12,\n showFeaturedSection = false,\n featuredAsset,\n featuredTitle,\n featuredSubtitle,\n featuredButtonText,\n featuredButtonUrl,\n featuredSubtitleColor = \"background\",\n featuredSubtitleSize = \"md\",\n className,\n ...props\n}: ListWidgetProps): React.JSX.Element {\n const displayItems = maxItems ? items.slice(0, maxItems) : items;\n const hasItems = displayItems.length > 0;\n\n const itemStyleProps = {\n padding,\n itemTitleColor,\n itemTitleSize,\n descriptionColor,\n descriptionSize,\n priceColor,\n priceSize,\n originalPriceColor,\n metaTextColor,\n metaTextSize,\n showMetaText,\n showBadge,\n borderRadius,\n imageAspectRatio,\n gap,\n };\n\n const hasFeaturedAsset = getFeaturedAssetUrl(featuredAsset);\n const shouldShowFeaturedSection = showFeaturedSection && hasFeaturedAsset;\n\n // Background styling\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 return (\n <div\n className={`@container bg-${backgroundColor} p-${padding} rounded-${borderRadius} ${borderWidthClasses[borderWidth]} ${borderWidth !== \"none\" ? borderColorClasses[borderColor] : \"\"} ${className}`}\n style={{ backgroundImage }}\n {...props}\n >\n {titleEnabled && title && (\n <h2\n className={`text-${titleColor} text-${titleSize === \"md\" ? \"base\" : titleSize} font-header mb-6 font-bold`}\n >\n {title}\n </h2>\n )}\n {!hasItems ? (\n <div className=\"border-border bg-muted flex items-center justify-center rounded-md border-2 border-dashed py-12 text-center\">\n <p className=\"text-muted\">No items to display</p>\n </div>\n ) : shouldShowFeaturedSection ? (\n <div className=\"flex flex-col gap-4 @lg:flex-row @lg:gap-6\">\n <div className=\"w-full @lg:w-[45%]\">\n <FeaturedSection\n borderRadius={borderRadius}\n titleSize={titleSize}\n featuredTitle={featuredTitle}\n featuredSubtitle={featuredSubtitle}\n featuredButtonText={featuredButtonText}\n featuredButtonUrl={featuredButtonUrl}\n featuredSubtitleColor={featuredSubtitleColor}\n featuredSubtitleSize={featuredSubtitleSize}\n asset={hasFeaturedAsset!}\n />\n </div>\n <div className=\"w-full @lg:w-[55%]\">\n {listType === \"unordered\" ? (\n <UnorderedList\n items={displayItems}\n columns={columns}\n {...itemStyleProps}\n />\n ) : (\n <OrderedList\n items={displayItems}\n scrollAxis={scrollAxis}\n numberColor={numberColor}\n numberSize={numberSize}\n {...itemStyleProps}\n />\n )}\n </div>\n </div>\n ) : listType === \"unordered\" ? (\n <UnorderedList\n items={displayItems}\n columns={columns}\n {...itemStyleProps}\n />\n ) : (\n <OrderedList\n items={displayItems}\n scrollAxis={scrollAxis}\n numberColor={numberColor}\n numberSize={numberSize}\n {...itemStyleProps}\n />\n )}\n </div>\n );\n}\n\nexport const listWidgetPropertySchema: WidgetPropertySchema = {\n widgetType: \"ListWidget\",\n displayName: \"List\",\n tabsConfig: [\n { id: \"styling\", label: \"Styling\" },\n { id: \"data\", label: \"Data\" },\n ],\n dataSourceTargetProps: [\"items\"],\n fields: [\n // Styling tab - Title group\n {\n key: \"titleEnabled\",\n label: \"Widget Title\",\n type: \"boolean\",\n description: \"Enable the title displayed above the list\",\n defaultValue: true,\n tab: \"styling\",\n group: \"Title\",\n },\n {\n key: \"title\",\n label: \"Title\",\n type: \"text\",\n description: \"Header text for the list\",\n defaultValue: \"List\",\n tab: \"styling\",\n group: \"Title\",\n requiresKeyToBeTrue: \"titleEnabled\",\n },\n getFontSizeField({\n key: \"titleSize\",\n label: \"Title Font Size\",\n description: \"Size of the list 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 list title\",\n defaultValue: \"foreground\",\n tab: \"styling\",\n group: \"Title\",\n requiresKeyToBeTrue: \"titleEnabled\",\n }),\n\n // Styling tab - Design group\n getPaddingField({\n key: \"padding\",\n label: \"Padding\",\n description: \"Padding inside the container\",\n defaultValue: 4,\n tab: \"styling\",\n group: \"Design\",\n }),\n getBorderRadiusField({\n key: \"borderRadius\",\n label: \"Border Radius\",\n description: \"Rounded corners for the container and images\",\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\",\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\",\n defaultValue: \"muted\",\n tab: \"styling\",\n group: \"Design\",\n }),\n getGapField({\n key: \"gap\",\n label: \"Gap\",\n description: \"Spacing between items\",\n defaultValue: \"md\",\n tab: \"styling\",\n group: \"Design\",\n }),\n {\n type: \"background\",\n defaultValue: \"background\",\n key: \"background\",\n label: \"Background\",\n description: \"Background color or image for the widget\",\n tab: \"styling\",\n group: \"Design\",\n },\n\n // Styling tab - List Configuration group\n {\n key: \"listType\",\n label: \"List Type\",\n type: \"select\",\n description: \"Type of list layout\",\n defaultValue: \"unordered\",\n options: [\n { label: \"Unordered (Grid)\", value: \"unordered\" },\n { label: \"Ordered (Numbered)\", value: \"ordered\" },\n ],\n tab: \"styling\",\n group: \"List Configuration\",\n },\n {\n key: \"maxItems\",\n label: \"Max Items\",\n type: \"number\",\n description: \"Maximum number of items to display\",\n min: 1,\n max: 100,\n step: 1,\n defaultValue: 12,\n tab: \"styling\",\n group: \"List Configuration\",\n },\n {\n key: \"imageAspectRatio\",\n label: \"Image Aspect Ratio\",\n type: \"buttonGroup\",\n description: \"Aspect ratio for item images\",\n defaultValue: \"square\",\n options: [\n { label: \"Square\", value: \"square\" },\n { label: \"Landscape\", value: \"landscape\" },\n { label: \"Portrait\", value: \"portrait\" },\n ],\n tab: \"styling\",\n group: \"List Configuration\",\n },\n {\n key: \"showBadge\",\n label: \"Show Discount Badge\",\n type: \"boolean\",\n description: \"Display discount badge on images\",\n defaultValue: true,\n tab: \"styling\",\n group: \"List Configuration\",\n },\n {\n key: \"showMetaText\",\n label: \"Show QV/CV Text\",\n type: \"boolean\",\n description: \"Display QV and CV values\",\n defaultValue: true,\n tab: \"styling\",\n group: \"List Configuration\",\n },\n\n // Styling tab - Unordered List Configuration\n {\n key: \"columns\",\n label: \"Grid Columns\",\n type: \"number\",\n description: \"Number of columns in the grid (unordered list only)\",\n min: 1,\n max: 6,\n step: 1,\n defaultValue: 3,\n tab: \"styling\",\n group: \"Unordered List Configuration\",\n requiresKeyValue: { key: \"listType\", value: \"unordered\" },\n },\n\n // Styling tab - Ordered List Configuration\n {\n key: \"scrollAxis\",\n label: \"Scroll Direction\",\n type: \"select\",\n description: \"Direction for ordered list scrolling\",\n defaultValue: \"horizontal\",\n options: [\n { label: \"Horizontal\", value: \"horizontal\" },\n { label: \"Vertical\", value: \"vertical\" },\n ],\n tab: \"styling\",\n group: \"Ordered List Configuration\",\n requiresKeyValue: { key: \"listType\", value: \"ordered\" },\n },\n getColorField({\n key: \"numberColor\",\n label: \"Number Color\",\n description: \"Color for ordered list numbers\",\n defaultValue: \"primary\",\n tab: \"styling\",\n group: \"Ordered List Configuration\",\n requiresKeyValue: { key: \"listType\", value: \"ordered\" },\n }),\n getFontSizeField({\n key: \"numberSize\",\n label: \"Number Font Size\",\n description: \"Size of ordered list numbers\",\n defaultValue: \"2xl\",\n tab: \"styling\",\n group: \"Ordered List Configuration\",\n requiresKeyValue: { key: \"listType\", value: \"ordered\" },\n }),\n\n // Styling tab - Item Styling group\n getColorField({\n key: \"itemTitleColor\",\n label: \"Item Title Color\",\n description: \"Color for item titles\",\n defaultValue: \"foreground\",\n tab: \"styling\",\n group: \"Item Styling\",\n }),\n getFontSizeField({\n key: \"itemTitleSize\",\n label: \"Item Title Font Size\",\n description: \"Size of item titles\",\n defaultValue: \"sm\",\n tab: \"styling\",\n group: \"Item Styling\",\n }),\n {\n key: \"separator2\",\n type: \"separator\",\n label: \"Separator\",\n tab: \"styling\",\n group: \"Item Styling\",\n },\n getColorField({\n key: \"descriptionColor\",\n label: \"Description Color\",\n description: \"Color for descriptions\",\n defaultValue: \"foreground\",\n tab: \"styling\",\n group: \"Item Styling\",\n }),\n getFontSizeField({\n key: \"descriptionSize\",\n label: \"Description Font Size\",\n description: \"Size of descriptions\",\n defaultValue: \"sm\",\n tab: \"styling\",\n group: \"Item Styling\",\n }),\n {\n key: \"separator3\",\n type: \"separator\",\n label: \"Separator\",\n tab: \"styling\",\n group: \"Item Styling\",\n },\n getColorField({\n key: \"priceColor\",\n label: \"Price Color\",\n description: \"Color for prices\",\n defaultValue: \"foreground\",\n tab: \"styling\",\n group: \"Item Styling\",\n }),\n getFontSizeField({\n key: \"priceSize\",\n label: \"Price Font Size\",\n description: \"Size of prices\",\n defaultValue: \"md\",\n tab: \"styling\",\n group: \"Item Styling\",\n }),\n getColorField({\n key: \"originalPriceColor\",\n label: \"Original Price Color\",\n description: \"Color for crossed-out original prices\",\n defaultValue: \"foreground\",\n tab: \"styling\",\n group: \"Item Styling\",\n }),\n {\n key: \"separator4\",\n type: \"separator\",\n label: \"Separator\",\n tab: \"styling\",\n group: \"Item Styling\",\n },\n getColorField({\n key: \"metaTextColor\",\n label: \"Meta Text Color\",\n description: \"Color for QV/CV text\",\n defaultValue: \"foreground\",\n tab: \"styling\",\n group: \"Item Styling\",\n }),\n getFontSizeField({\n key: \"metaTextSize\",\n label: \"Meta Text Font Size\",\n description: \"Size of QV/CV text\",\n defaultValue: \"xs\",\n tab: \"styling\",\n group: \"Item Styling\",\n }),\n\n // Styling tab - Featured Section group\n {\n key: \"showFeaturedSection\",\n label: \"Show Featured Section\",\n type: \"boolean\",\n description: \"Display a featured content section\",\n defaultValue: false,\n tab: \"styling\",\n group: \"Featured Section\",\n },\n {\n key: \"featuredAsset\",\n label: \"Featured Asset\",\n type: \"resource\",\n description:\n \"Select a single image or video resource for the featured section\",\n tab: \"styling\",\n group: \"Featured Section\",\n allowedTypes: [\"Medium\"],\n requiresKeyToBeTrue: \"showFeaturedSection\",\n },\n {\n key: \"featuredTitle\",\n label: \"Featured Title\",\n type: \"text\",\n description: \"Title for featured section\",\n tab: \"styling\",\n group: \"Featured Section\",\n requiresKeyToBeTrue: \"showFeaturedSection\",\n },\n {\n key: \"featuredSubtitle\",\n label: \"Featured Subtitle\",\n type: \"text\",\n description: \"Subtitle for featured section\",\n tab: \"styling\",\n group: \"Featured Section\",\n requiresKeyToBeTrue: \"showFeaturedSection\",\n },\n {\n key: \"featuredButtonText\",\n label: \"Featured Button Text\",\n type: \"text\",\n description: \"Text for featured section button\",\n tab: \"styling\",\n group: \"Featured Section\",\n requiresKeyToBeTrue: \"showFeaturedSection\",\n },\n {\n key: \"featuredButtonUrl\",\n label: \"Featured Button URL\",\n type: \"text\",\n description: \"URL for featured section button\",\n tab: \"styling\",\n group: \"Featured Section\",\n requiresKeyToBeTrue: \"showFeaturedSection\",\n },\n getColorField({\n key: \"featuredSubtitleColor\",\n label: \"Featured Subtitle Color\",\n description: \"Color for featured subtitle\",\n defaultValue: \"background\",\n tab: \"styling\",\n group: \"Featured Section\",\n requiresKeyToBeTrue: \"showFeaturedSection\",\n }),\n getFontSizeField({\n key: \"featuredSubtitleSize\",\n label: \"Featured Subtitle Font Size\",\n description: \"Size of featured subtitle\",\n defaultValue: \"md\",\n tab: \"styling\",\n group: \"Featured Section\",\n requiresKeyToBeTrue: \"showFeaturedSection\",\n }),\n\n // Data tab - Data Configuration\n {\n key: \"dataSource\",\n label: \"Data Source\",\n type: \"dataSource\",\n description: \"\",\n tab: \"data\",\n group: \"Data Configuration\",\n },\n ],\n itemConfigSchema: {\n description: \"Configure settings for this list item\",\n fields: [\n {\n key: \"title\",\n label: \"Custom Title\",\n type: \"text\",\n description: \"Override the item's title\",\n },\n {\n key: \"description\",\n label: \"Custom Description\",\n type: \"textarea\",\n description: \"Override the item's description\",\n rows: 3,\n },\n {\n key: \"price\",\n label: \"Price\",\n type: \"text\",\n description: \"Current price\",\n },\n {\n key: \"originalPrice\",\n label: \"Original Price\",\n type: \"text\",\n description: \"Original price (will be crossed out)\",\n },\n {\n key: \"discount\",\n label: \"Discount Badge\",\n type: \"text\",\n description: \"Discount text (e.g., '40% Off')\",\n },\n {\n key: \"qv\",\n label: \"QV Value\",\n type: \"text\",\n description: \"Qualifying Volume value\",\n },\n {\n key: \"cv\",\n label: \"CV Value\",\n type: \"text\",\n description: \"Commission Volume value\",\n },\n {\n key: \"image\",\n label: \"Image URL\",\n type: \"text\",\n description: \"Custom image URL for this item\",\n },\n ],\n },\n} as const satisfies WidgetPropertySchema;\n"],"mappings":";;;;;;;;;AAoBA,SAAgB,gBAAgB,EAC9B,cACA,WACA,eACA,kBACA,oBACA,mBACA,uBACA,sBACA,SAC0C;AAC1C,QACE,qBAAC,OAAD;EACE,WAAW,gEAAgE;YAD7E;GAGE,oBAAC,OAAD;IAAK,WAAU;cACb,oBAAC,eAAD;KACE,KAAK,MAAM;KACX,WAAW,MAAM,UAAU,UAAU;KACrC,KAAK,iBAAiB;KACtB,WAAU;KACV,UAAU,MAAM;KAChB,MAAM,MAAM;KACZ,OAAO,MAAM;KACb,UAAU;KACV,CAAA;IACE,CAAA;GAEN,oBAAC,OAAD,EAAK,WAAU,oDAAqD,CAAA;GAEpE,qBAAC,OAAD;IAAK,WAAU;cAAf;KACG,iBACC,oBAAC,MAAD;MACE,WAAW,8CAA8C,cAAc,OAAO,SAAS;gBAEtF;MACE,CAAA;KAEN,oBACC,oBAAC,KAAD;MACE,WAAW,aAAa,sBAAsB,QAAQ,yBAAyB,OAAO,SAAS;gBAE9F;MACC,CAAA;KAEL,sBACC,oBAAC,KAAD;MACE,MAAM,qBAAqB;MAC3B,WAAW,8FAA8F;gBAExG;MACC,CAAA;KAEF;;GACF;;;;;AClDV,SAAS,eAAe,OAAwB;AAC9C,KAAI,CAAC,MAAO,QAAO;AACnB,KAAI,OAAO,UAAU,SAAU,QAAO;AACtC,KAAI,OAAO,UAAU,SAAU,QAAO,OAAO,MAAM;AACnD,KAAI,OAAO,UAAU,YAAY,UAAU,MAAM;AAC/C,MAAI,UAAU,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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;EACF,YAAY;GACV,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EACF;GACE,MAAM;GACN,cAAc;GACd,KAAK;GACL,OAAO;GACP,aAAa;GACb,KAAK;GACL,OAAO;GACR;EAGD;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,cAAc;GACd,SAAS,CACP;IAAE,OAAO;IAAoB,OAAO;IAAa,EACjD;IAAE,OAAO;IAAsB,OAAO;IAAW,CAClD;GACD,KAAK;GACL,OAAO;GACR;EACD;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,KAAK;GACL,KAAK;GACL,MAAM;GACN,cAAc;GACd,KAAK;GACL,OAAO;GACR;EACD;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,cAAc;GACd,SAAS;IACP;KAAE,OAAO;KAAU,OAAO;KAAU;IACpC;KAAE,OAAO;KAAa,OAAO;KAAa;IAC1C;KAAE,OAAO;KAAY,OAAO;KAAY;IACzC;GACD,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,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,KAAK;GACL,KAAK;GACL,MAAM;GACN,cAAc;GACd,KAAK;GACL,OAAO;GACP,kBAAkB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,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EACF;GACE,KAAK;GACL,MAAM;GACN,OAAO;GACP,KAAK;GACL,OAAO;GACR;EACD,cAAc;GACZ,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EACF,iBAAiB;GACf,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EAGF;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,KAAK;GACL,OAAO;GACP,cAAc,CAAC,SAAS;GACxB,qBAAqB;GACtB;EACD;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,KAAK;GACL,OAAO;GACP,qBAAqB;GACtB;EACD;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,KAAK;GACL,OAAO;GACP,qBAAqB;GACtB;EACD;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,KAAK;GACL,OAAO;GACP,qBAAqB;GACtB;EACD;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,KAAK;GACL,OAAO;GACP,qBAAqB;GACtB;EACD,cAAc;GACZ,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACP,qBAAqB;GACtB,CAAC;EACF,iBAAiB;GACf,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACP,qBAAqB;GACtB,CAAC;EAGF;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,KAAK;GACL,OAAO;GACR;EACF;CACD,kBAAkB;EAChB,aAAa;EACb,QAAQ;GACN;IACE,KAAK;IACL,OAAO;IACP,MAAM;IACN,aAAa;IACd;GACD;IACE,KAAK;IACL,OAAO;IACP,MAAM;IACN,aAAa;IACb,MAAM;IACP;GACD;IACE,KAAK;IACL,OAAO;IACP,MAAM;IACN,aAAa;IACd;GACD;IACE,KAAK;IACL,OAAO;IACP,MAAM;IACN,aAAa;IACd;GACD;IACE,KAAK;IACL,OAAO;IACP,MAAM;IACN,aAAa;IACd;GACD;IACE,KAAK;IACL,OAAO;IACP,MAAM;IACN,aAAa;IACd;GACD;IACE,KAAK;IACL,OAAO;IACP,MAAM;IACN,aAAa;IACd;GACD;IACE,KAAK;IACL,OAAO;IACP,MAAM;IACN,aAAa;IACd;GACF;EACF;CACF"}