@fluid-app/portal-widgets 0.1.21 → 0.1.22

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 (94) hide show
  1. package/dist/{CalendarWidget-DW7q6Q7_.cjs → CalendarWidget-BfBvIACH.cjs} +5 -6
  2. package/dist/CalendarWidget-BfBvIACH.cjs.map +1 -0
  3. package/dist/{CalendarWidget-DAHnT9Wn.mjs → CalendarWidget-zAxc3BTd.mjs} +5 -6
  4. package/dist/CalendarWidget-zAxc3BTd.mjs.map +1 -0
  5. package/dist/{CarouselWidget-PEm6vktC.cjs → CarouselWidget-D51Kz6r8.cjs} +3 -3
  6. package/dist/{CarouselWidget-PEm6vktC.cjs.map → CarouselWidget-D51Kz6r8.cjs.map} +1 -1
  7. package/dist/{CarouselWidget-MOGejQHD.mjs → CarouselWidget-DFmVlZlT.mjs} +3 -3
  8. package/dist/{CarouselWidget-MOGejQHD.mjs.map → CarouselWidget-DFmVlZlT.mjs.map} +1 -1
  9. package/dist/{CatchUpWidget-vEP5scfy.mjs → CatchUpWidget-CAmpqiDr.mjs} +4 -12
  10. package/dist/CatchUpWidget-CAmpqiDr.mjs.map +1 -0
  11. package/dist/{CatchUpWidget-CZMptzf8.cjs → CatchUpWidget-eAe6e6SA.cjs} +4 -12
  12. package/dist/CatchUpWidget-eAe6e6SA.cjs.map +1 -0
  13. package/dist/{EmbedWidget-RuCm5uOj.mjs → EmbedWidget-CZanYM7p.mjs} +4 -11
  14. package/dist/EmbedWidget-CZanYM7p.mjs.map +1 -0
  15. package/dist/{EmbedWidget-BENxbwxX.cjs → EmbedWidget-I-vrAy02.cjs} +4 -11
  16. package/dist/EmbedWidget-I-vrAy02.cjs.map +1 -0
  17. package/dist/{ImageWidget--owpCpb0.mjs → ImageWidget-CJzO7yV9.mjs} +2 -2
  18. package/dist/{ImageWidget--owpCpb0.mjs.map → ImageWidget-CJzO7yV9.mjs.map} +1 -1
  19. package/dist/{ImageWidget-B2stGyqB.cjs → ImageWidget-CR-dZIET.cjs} +2 -2
  20. package/dist/{ImageWidget-B2stGyqB.cjs.map → ImageWidget-CR-dZIET.cjs.map} +1 -1
  21. package/dist/{ListWidget-C0RDtImi.cjs → ListWidget-B0W-5BLL.cjs} +1 -1
  22. package/dist/{ListWidget-DdvuIQXy.mjs → ListWidget-Bld9LfFO.mjs} +3 -3
  23. package/dist/{ListWidget-DdvuIQXy.mjs.map → ListWidget-Bld9LfFO.mjs.map} +1 -1
  24. package/dist/{ListWidget-DPVLRWoB.cjs → ListWidget-dib-Tl8j.cjs} +3 -3
  25. package/dist/{ListWidget-DPVLRWoB.cjs.map → ListWidget-dib-Tl8j.cjs.map} +1 -1
  26. package/dist/{MediaRenderer-CcJvyOJ1.cjs → MediaRenderer-Crlzjyvh.cjs} +3 -7
  27. package/dist/MediaRenderer-Crlzjyvh.cjs.map +1 -0
  28. package/dist/{MediaRenderer-Uq90PZcY.mjs → MediaRenderer-CrvEIBKa.mjs} +3 -7
  29. package/dist/MediaRenderer-CrvEIBKa.mjs.map +1 -0
  30. package/dist/{NestedWidget-DoevHJKG.mjs → NestedWidget-CC2iiuYe.mjs} +3 -3
  31. package/dist/{NestedWidget-DoevHJKG.mjs.map → NestedWidget-CC2iiuYe.mjs.map} +1 -1
  32. package/dist/{NestedWidget-DjZYPLc7.cjs → NestedWidget-CM6a_uhX.cjs} +1 -1
  33. package/dist/{NestedWidget-DszMmpt7.cjs → NestedWidget-Dbomg7kK.cjs} +3 -3
  34. package/dist/{NestedWidget-DszMmpt7.cjs.map → NestedWidget-Dbomg7kK.cjs.map} +1 -1
  35. package/dist/{QuickShareWidget-CdvP1eRx.mjs → QuickShareWidget-2UgfRO1A.mjs} +5 -15
  36. package/dist/QuickShareWidget-2UgfRO1A.mjs.map +1 -0
  37. package/dist/{QuickShareWidget-Dg2OcMYg.cjs → QuickShareWidget-D61LGZSP.cjs} +5 -15
  38. package/dist/QuickShareWidget-D61LGZSP.cjs.map +1 -0
  39. package/dist/{RecentActivityWidget-_3h0KmQP.cjs → RecentActivityWidget-DgduzsLQ.cjs} +27 -34
  40. package/dist/RecentActivityWidget-DgduzsLQ.cjs.map +1 -0
  41. package/dist/{RecentActivityWidget-YD-2z7oN.mjs → RecentActivityWidget-ie7NPVyP.mjs} +27 -34
  42. package/dist/RecentActivityWidget-ie7NPVyP.mjs.map +1 -0
  43. package/dist/{SpacerWidget-DxR5K3hp.mjs → SpacerWidget-C3bosaHh.mjs} +3 -4
  44. package/dist/SpacerWidget-C3bosaHh.mjs.map +1 -0
  45. package/dist/{SpacerWidget-BdVf_Yqm.cjs → SpacerWidget-DyPRcRp7.cjs} +3 -4
  46. package/dist/SpacerWidget-DyPRcRp7.cjs.map +1 -0
  47. package/dist/{TableWidget-amUotAZN.cjs → TableWidget-BfYbPHK6.cjs} +1 -1
  48. package/dist/{TableWidget-bpvdvJHI.mjs → TableWidget-CGgzjcyK.mjs} +2 -2
  49. package/dist/{TableWidget-bpvdvJHI.mjs.map → TableWidget-CGgzjcyK.mjs.map} +1 -1
  50. package/dist/{TableWidget-BQNVZUkg.cjs → TableWidget-De_y_YBQ.cjs} +2 -2
  51. package/dist/{TableWidget-BQNVZUkg.cjs.map → TableWidget-De_y_YBQ.cjs.map} +1 -1
  52. package/dist/{ToDoWidget-D5BFKUrZ.cjs → ToDoWidget-B68qKav6.cjs} +4 -11
  53. package/dist/ToDoWidget-B68qKav6.cjs.map +1 -0
  54. package/dist/{ToDoWidget-4EZIWq_Z.mjs → ToDoWidget-Dp8UNmip.mjs} +4 -11
  55. package/dist/ToDoWidget-Dp8UNmip.mjs.map +1 -0
  56. package/dist/{VideoWidget-CqRHfFnI.cjs → VideoWidget-CU5OK-Ju.cjs} +2 -2
  57. package/dist/{VideoWidget-CqRHfFnI.cjs.map → VideoWidget-CU5OK-Ju.cjs.map} +1 -1
  58. package/dist/{VideoWidget-CYSOjVec.mjs → VideoWidget-DGR1U6CQ.mjs} +2 -2
  59. package/dist/{VideoWidget-CYSOjVec.mjs.map → VideoWidget-DGR1U6CQ.mjs.map} +1 -1
  60. package/dist/core/index.cjs +1 -1
  61. package/dist/core/index.d.cts.map +1 -1
  62. package/dist/core/index.d.mts.map +1 -1
  63. package/dist/core/index.mjs +1 -1
  64. package/dist/{scroll-arrows-BZIlsE_x.cjs → scroll-arrows-4aTDqcAw.cjs} +4 -11
  65. package/dist/scroll-arrows-4aTDqcAw.cjs.map +1 -0
  66. package/dist/{scroll-arrows-BevCYRNT.mjs → scroll-arrows-CTQrIV6z.mjs} +4 -11
  67. package/dist/scroll-arrows-CTQrIV6z.mjs.map +1 -0
  68. package/dist/ui/index.cjs +1 -1
  69. package/dist/ui/index.d.cts.map +1 -1
  70. package/dist/ui/index.d.mts.map +1 -1
  71. package/dist/ui/index.mjs +1 -1
  72. package/dist/widgets/index.cjs +26 -26
  73. package/dist/widgets/index.d.cts.map +1 -1
  74. package/dist/widgets/index.d.mts.map +1 -1
  75. package/dist/widgets/index.mjs +26 -26
  76. package/package.json +4 -6
  77. package/dist/CalendarWidget-DAHnT9Wn.mjs.map +0 -1
  78. package/dist/CalendarWidget-DW7q6Q7_.cjs.map +0 -1
  79. package/dist/CatchUpWidget-CZMptzf8.cjs.map +0 -1
  80. package/dist/CatchUpWidget-vEP5scfy.mjs.map +0 -1
  81. package/dist/EmbedWidget-BENxbwxX.cjs.map +0 -1
  82. package/dist/EmbedWidget-RuCm5uOj.mjs.map +0 -1
  83. package/dist/MediaRenderer-CcJvyOJ1.cjs.map +0 -1
  84. package/dist/MediaRenderer-Uq90PZcY.mjs.map +0 -1
  85. package/dist/QuickShareWidget-CdvP1eRx.mjs.map +0 -1
  86. package/dist/QuickShareWidget-Dg2OcMYg.cjs.map +0 -1
  87. package/dist/RecentActivityWidget-YD-2z7oN.mjs.map +0 -1
  88. package/dist/RecentActivityWidget-_3h0KmQP.cjs.map +0 -1
  89. package/dist/SpacerWidget-BdVf_Yqm.cjs.map +0 -1
  90. package/dist/SpacerWidget-DxR5K3hp.mjs.map +0 -1
  91. package/dist/ToDoWidget-4EZIWq_Z.mjs.map +0 -1
  92. package/dist/ToDoWidget-D5BFKUrZ.cjs.map +0 -1
  93. package/dist/scroll-arrows-BZIlsE_x.cjs.map +0 -1
  94. package/dist/scroll-arrows-BevCYRNT.mjs.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CatchUpWidget-CAmpqiDr.mjs","names":[],"sources":["../src/hooks/use-catchups.preview.ts","../src/hooks/use-catchups.ts","../src/widgets/CatchUpWidget.tsx"],"sourcesContent":["import type { CatchUp } from \"./use-catchups.types\";\n\nexport const PREVIEW_DATA: CatchUp[] = [\n { id: 1, suggestion_title: \"Check in with Sarah about her recent order\" },\n { id: 2, suggestion_title: \"Follow up with Mike on product samples\" },\n { id: 3, suggestion_title: \"Reconnect with Lisa — last contact 30 days ago\" },\n { id: 4, suggestion_title: \"Thank Alex for their referral last week\" },\n { id: 5, suggestion_title: \"Share new catalog with Jordan\" },\n];\n","import { useQuery, type UseQueryResult } from \"@tanstack/react-query\";\nimport { useDataSourceConfig } from \"@fluid-app/portal-core/data-sources/context\";\nimport { useWidgetPreviewContext } from \"@fluid-app/portal-core/data-sources/preview-context\";\nimport { PREVIEW_DATA } from \"./use-catchups.preview\";\n\nimport type { CatchUp } from \"./use-catchups.types\";\n\nexport type { CatchUp } from \"./use-catchups.types\";\n\nexport function useCatchUps(): UseQueryResult<CatchUp[], Error> {\n const { baseUrl, getApiHeaders } = useDataSourceConfig();\n const { isPreview } = useWidgetPreviewContext();\n\n return useQuery({\n queryKey: [\n \"portal-widget-use\",\n \"catchups\",\n isPreview ? \"preview\" : baseUrl,\n ] as const,\n queryFn: async ({ signal }): Promise<CatchUp[]> => {\n const url = baseUrl\n ? `${baseUrl}/affiliate_catch_up_actions.json`\n : \"/affiliate_catch_up_actions.json\";\n const response = await fetch(url, {\n headers: {\n \"content-type\": \"application/json\",\n ...getApiHeaders?.(),\n },\n signal,\n });\n\n if (!response.ok) {\n throw new Error(`Failed to fetch catch ups: ${response.status}`);\n }\n\n return response.json();\n },\n enabled: !isPreview,\n ...(isPreview && { placeholderData: PREVIEW_DATA }),\n });\n}\n","import type { ComponentProps } from \"react\";\nimport type React from \"react\";\nimport type {\n BackgroundValue,\n BorderRadiusOptions,\n ColorOptions,\n FontSizeOptions,\n PaddingOptions,\n} from \"@fluid-app/portal-core/types\";\nimport type { WidgetPropertySchema } from \"@fluid-app/portal-core/registries\";\nimport {\n getBorderRadiusField,\n getColorField,\n getFontSizeField,\n getPaddingField,\n} from \"../core/fields\";\nimport { useCatchUps } from \"../hooks/use-catchups\";\nimport { Loader2, Sparkles } from \"lucide-react\";\nimport { ErrorState } from \"../components/error-state\";\n\n// Font size mapping for title\nconst fontSizeClasses: Record<FontSizeOptions, string> = {\n \"2xl\": \"text-2xl\",\n xl: \"text-xl\",\n lg: \"text-lg\",\n md: \"text-base\",\n sm: \"text-sm\",\n xs: \"text-xs\",\n};\n\ntype CatchUpWidgetProps = ComponentProps<\"div\"> & {\n // Title settings\n titleEnabled?: boolean;\n titleText?: string;\n titleFontSize?: FontSizeOptions;\n titleColor?: ColorOptions;\n // Design settings\n background?: BackgroundValue;\n textColor?: ColorOptions;\n accentColor?: ColorOptions;\n padding?: PaddingOptions;\n borderRadius?: BorderRadiusOptions;\n // Display settings\n maxItems?: number;\n};\n\nexport function CatchUpWidget({\n // Title settings with defaults\n titleEnabled = true,\n titleText = \"Catch Ups\",\n titleFontSize = \"xl\",\n titleColor = \"foreground\",\n // Design settings with defaults\n background = {\n type: \"solid\",\n color: \"background\",\n },\n textColor = \"foreground\",\n accentColor = \"primary\",\n padding = 4,\n borderRadius = \"md\",\n // Display settings with defaults\n maxItems = 5,\n className,\n ...props\n}: CatchUpWidgetProps): React.JSX.Element {\n const backgroundColor = background.color || \"background\";\n const backgroundImage =\n (background.resource?.image_url || background.resource?.imageUrl) &&\n background.type === \"image\"\n ? `url(${background.resource.image_url || background.resource.imageUrl})`\n : \"none\";\n const { data = [], isLoading, isError } = useCatchUps();\n\n const catchUpsToShow = data.slice(0, maxItems);\n const moreCatchUps = data.length - catchUpsToShow.length;\n\n return (\n <div\n className={`flex flex-col rounded-${borderRadius} bg-${backgroundColor} p-${padding} text-${textColor} ${className || \"\"}`}\n style={{ backgroundImage }}\n {...props}\n >\n {/* Header */}\n <div className=\"flex items-center justify-between\">\n {titleEnabled && (\n <h3\n className={`${fontSizeClasses[titleFontSize]} font-semibold text-${titleColor}`}\n >\n {titleText}\n </h3>\n )}\n {!isLoading && !isError && data.length > 0 && (\n <span className={`text-3xl font-bold text-${accentColor}`}>\n {data.length}\n </span>\n )}\n </div>\n\n {/* Loading state */}\n {isLoading ? (\n <div className=\"flex min-h-[150px] flex-1 items-center justify-center\">\n <Loader2 className={`h-8 w-8 animate-spin text-${accentColor}`} />\n </div>\n ) : isError ? (\n /* Error state */\n <ErrorState />\n ) : data.length === 0 ? (\n /* Empty state */\n <div className=\"flex min-h-[150px] flex-1 flex-col items-center justify-center gap-2\">\n <Sparkles className={`h-8 w-8 text-${accentColor}`} />\n <p className=\"text-center font-semibold\">\n You&apos;re all caught up.\n </p>\n <p className=\"text-sm opacity-60\">See you next time!</p>\n </div>\n ) : (\n /* Default state with catch ups */\n <>\n <div className=\"mt-3 flex-1\">\n {catchUpsToShow.map((catchUp, index: number) => (\n <div\n key={catchUp.id || index}\n className={`py-2 ${index !== catchUpsToShow.length - 1 ? \"border-b border-current/10\" : \"\"}`}\n >\n <p className=\"line-clamp-1 text-sm\">\n {catchUp.suggestion_title}\n </p>\n </div>\n ))}\n </div>\n\n {/* More indicator */}\n {moreCatchUps > 0 && (\n <p className=\"mt-2 text-sm opacity-60\">\n {moreCatchUps} more catch up{moreCatchUps > 1 ? \"s\" : \"\"}\n </p>\n )}\n </>\n )}\n </div>\n );\n}\n\n// Property schema for the widget editor\nexport const catchUpWidgetPropertySchema: WidgetPropertySchema = {\n widgetType: \"CatchUpWidget\",\n displayName: \"Catch Up Widget\",\n tabsConfig: [{ id: \"styling\", label: \"Styling\" }],\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 catch ups\",\n defaultValue: true,\n tab: \"styling\",\n group: \"Title\",\n },\n {\n key: \"titleText\",\n label: \"Title\",\n type: \"text\",\n description: \"Title text displayed above the catch ups\",\n defaultValue: \"Catch Ups\",\n tab: \"styling\",\n group: \"Title\",\n requiresKeyToBeTrue: \"titleEnabled\",\n },\n getFontSizeField({\n key: \"titleFontSize\",\n label: \"Title Font Size\",\n description: \"Font size for the widget title\",\n defaultValue: \"xl\",\n tab: \"styling\",\n group: \"Title\",\n requiresKeyToBeTrue: \"titleEnabled\",\n }),\n getColorField({\n key: \"titleColor\",\n label: \"Title Color\",\n description: \"Color for the widget title\",\n defaultValue: \"foreground\",\n tab: \"styling\",\n group: \"Title\",\n requiresKeyToBeTrue: \"titleEnabled\",\n }),\n\n // Styling Tab - Design Group\n {\n type: \"background\",\n key: \"background\",\n label: \"Background\",\n description: \"Background for the container\",\n defaultValue: \"background\",\n tab: \"styling\",\n group: \"Design\",\n },\n getColorField({\n key: \"textColor\",\n label: \"Text Color\",\n description: \"Default text color for catch up items\",\n defaultValue: \"foreground\",\n tab: \"styling\",\n group: \"Design\",\n }),\n getColorField({\n key: \"accentColor\",\n label: \"Accent Color\",\n description: \"Color used for count display and icons\",\n defaultValue: \"primary\",\n tab: \"styling\",\n group: \"Design\",\n }),\n {\n key: \"separator\",\n type: \"separator\",\n label: \"Separator\",\n tab: \"styling\",\n group: \"Design\",\n },\n {\n key: \"maxItems\",\n label: \"Max Items\",\n type: \"number\",\n description: \"Maximum number of catch ups to display\",\n defaultValue: 5,\n min: 1,\n max: 10,\n tab: \"styling\",\n group: \"Design\",\n },\n getPaddingField({\n key: \"padding\",\n label: \"Padding\",\n description: \"Padding around the container\",\n defaultValue: 4,\n tab: \"styling\",\n group: \"Design\",\n }),\n getBorderRadiusField({\n key: \"borderRadius\",\n label: \"Border Radius\",\n description: \"Border radius for the container\",\n defaultValue: \"md\",\n tab: \"styling\",\n group: \"Design\",\n }),\n ],\n} as const satisfies WidgetPropertySchema;\n"],"mappings":";;;;;;;;;AAEA,MAAa,eAA0B;CACrC;EAAE,IAAI;EAAG,kBAAkB;EAA8C;CACzE;EAAE,IAAI;EAAG,kBAAkB;EAA0C;CACrE;EAAE,IAAI;EAAG,kBAAkB;EAAkD;CAC7E;EAAE,IAAI;EAAG,kBAAkB;EAA2C;CACtE;EAAE,IAAI;EAAG,kBAAkB;EAAiC;CAC7D;;;ACCD,SAAgB,cAAgD;CAC9D,MAAM,EAAE,SAAS,kBAAkB,qBAAqB;CACxD,MAAM,EAAE,cAAc,yBAAyB;AAE/C,QAAO,SAAS;EACd,UAAU;GACR;GACA;GACA,YAAY,YAAY;GACzB;EACD,SAAS,OAAO,EAAE,aAAiC;GACjD,MAAM,MAAM,UACR,GAAG,QAAQ,oCACX;GACJ,MAAM,WAAW,MAAM,MAAM,KAAK;IAChC,SAAS;KACP,gBAAgB;KAChB,GAAG,iBAAiB;KACrB;IACD;IACD,CAAC;AAEF,OAAI,CAAC,SAAS,GACZ,OAAM,IAAI,MAAM,8BAA8B,SAAS,SAAS;AAGlE,UAAO,SAAS,MAAM;;EAExB,SAAS,CAAC;EACV,GAAI,aAAa,EAAE,iBAAiB,cAAc;EACnD,CAAC;;;;;;;;AClBJ,MAAM,kBAAmD;CACvD,OAAO;CACP,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACL;AAkBD,SAAgB,cAAc,EAE5B,eAAe,MACf,YAAY,aACZ,gBAAgB,MAChB,aAAa,cAEb,aAAa;CACX,MAAM;CACN,OAAO;CACR,EACD,YAAY,cACZ,cAAc,WACd,UAAU,GACV,eAAe,MAEf,WAAW,GACX,WACA,GAAG,SACqC;CACxC,MAAM,kBAAkB,WAAW,SAAS;CAC5C,MAAM,mBACH,WAAW,UAAU,aAAa,WAAW,UAAU,aAC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;aAAb;IACG;IAAa;IAAe,eAAe,IAAI,MAAM;IACpD;KAEL,EAAA,CAAA,CAED;;;AAKV,MAAa,8BAAoD;CAC/D,YAAY;CACZ,aAAa;CACb,YAAY,CAAC;EAAE,IAAI;EAAW,OAAO;EAAW,CAAC;CACjD,QAAQ;EAEN;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;GACP,qBAAqB;GACtB;EACD,iBAAiB;GACf,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACP,qBAAqB;GACtB,CAAC;EACF,cAAc;GACZ,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACP,qBAAqB;GACtB,CAAC;EAGF;GACE,MAAM;GACN,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR;EACD,cAAc;GACZ,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EACF,cAAc;GACZ,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EACF;GACE,KAAK;GACL,MAAM;GACN,OAAO;GACP,KAAK;GACL,OAAO;GACR;EACD;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,cAAc;GACd,KAAK;GACL,KAAK;GACL,KAAK;GACL,OAAO;GACR;EACD,gBAAgB;GACd,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EACF,qBAAqB;GACnB,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EACH;CACF"}
@@ -4,8 +4,7 @@ let react_jsx_runtime = require("react/jsx-runtime");
4
4
  let _tanstack_react_query = require("@tanstack/react-query");
5
5
  let _fluid_app_portal_core_data_sources_context = require("@fluid-app/portal-core/data-sources/context");
6
6
  let _fluid_app_portal_core_data_sources_preview_context = require("@fluid-app/portal-core/data-sources/preview-context");
7
- let _fortawesome_react_fontawesome = require("@fortawesome/react-fontawesome");
8
- let _fortawesome_pro_regular_svg_icons = require("@fortawesome/pro-regular-svg-icons");
7
+ let lucide_react = require("lucide-react");
9
8
  let _fluid_app_portal_core_registries = require("@fluid-app/portal-core/registries");
10
9
  //#region src/hooks/use-catchups.preview.ts
11
10
  const PREVIEW_DATA = [
@@ -95,18 +94,11 @@ function CatchUpWidget({ titleEnabled = true, titleText = "Catch Ups", titleFont
95
94
  })]
96
95
  }), isLoading ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
97
96
  className: "flex min-h-[150px] flex-1 items-center justify-center",
98
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_fortawesome_react_fontawesome.FontAwesomeIcon, {
99
- icon: _fortawesome_pro_regular_svg_icons.faSpinnerThird,
100
- spin: true,
101
- className: `h-8 w-8 text-${accentColor}`
102
- })
97
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Loader2, { className: `h-8 w-8 animate-spin text-${accentColor}` })
103
98
  }) : isError ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_error_state.ErrorState, {}) : data.length === 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
104
99
  className: "flex min-h-[150px] flex-1 flex-col items-center justify-center gap-2",
105
100
  children: [
106
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_fortawesome_react_fontawesome.FontAwesomeIcon, {
107
- icon: _fortawesome_pro_regular_svg_icons.faSparkles,
108
- className: `h-8 w-8 text-${accentColor}`
109
- }),
101
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Sparkles, { className: `h-8 w-8 text-${accentColor}` }),
110
102
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
111
103
  className: "text-center font-semibold",
112
104
  children: "You're all caught up."
@@ -261,4 +253,4 @@ Object.defineProperty(exports, "catchUpWidgetPropertySchema", {
261
253
  }
262
254
  });
263
255
 
264
- //# sourceMappingURL=CatchUpWidget-CZMptzf8.cjs.map
256
+ //# sourceMappingURL=CatchUpWidget-eAe6e6SA.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CatchUpWidget-eAe6e6SA.cjs","names":["Loader2","ErrorState","Sparkles"],"sources":["../src/hooks/use-catchups.preview.ts","../src/hooks/use-catchups.ts","../src/widgets/CatchUpWidget.tsx"],"sourcesContent":["import type { CatchUp } from \"./use-catchups.types\";\n\nexport const PREVIEW_DATA: CatchUp[] = [\n { id: 1, suggestion_title: \"Check in with Sarah about her recent order\" },\n { id: 2, suggestion_title: \"Follow up with Mike on product samples\" },\n { id: 3, suggestion_title: \"Reconnect with Lisa — last contact 30 days ago\" },\n { id: 4, suggestion_title: \"Thank Alex for their referral last week\" },\n { id: 5, suggestion_title: \"Share new catalog with Jordan\" },\n];\n","import { useQuery, type UseQueryResult } from \"@tanstack/react-query\";\nimport { useDataSourceConfig } from \"@fluid-app/portal-core/data-sources/context\";\nimport { useWidgetPreviewContext } from \"@fluid-app/portal-core/data-sources/preview-context\";\nimport { PREVIEW_DATA } from \"./use-catchups.preview\";\n\nimport type { CatchUp } from \"./use-catchups.types\";\n\nexport type { CatchUp } from \"./use-catchups.types\";\n\nexport function useCatchUps(): UseQueryResult<CatchUp[], Error> {\n const { baseUrl, getApiHeaders } = useDataSourceConfig();\n const { isPreview } = useWidgetPreviewContext();\n\n return useQuery({\n queryKey: [\n \"portal-widget-use\",\n \"catchups\",\n isPreview ? \"preview\" : baseUrl,\n ] as const,\n queryFn: async ({ signal }): Promise<CatchUp[]> => {\n const url = baseUrl\n ? `${baseUrl}/affiliate_catch_up_actions.json`\n : \"/affiliate_catch_up_actions.json\";\n const response = await fetch(url, {\n headers: {\n \"content-type\": \"application/json\",\n ...getApiHeaders?.(),\n },\n signal,\n });\n\n if (!response.ok) {\n throw new Error(`Failed to fetch catch ups: ${response.status}`);\n }\n\n return response.json();\n },\n enabled: !isPreview,\n ...(isPreview && { placeholderData: PREVIEW_DATA }),\n });\n}\n","import type { ComponentProps } from \"react\";\nimport type React from \"react\";\nimport type {\n BackgroundValue,\n BorderRadiusOptions,\n ColorOptions,\n FontSizeOptions,\n PaddingOptions,\n} from \"@fluid-app/portal-core/types\";\nimport type { WidgetPropertySchema } from \"@fluid-app/portal-core/registries\";\nimport {\n getBorderRadiusField,\n getColorField,\n getFontSizeField,\n getPaddingField,\n} from \"../core/fields\";\nimport { useCatchUps } from \"../hooks/use-catchups\";\nimport { Loader2, Sparkles } from \"lucide-react\";\nimport { ErrorState } from \"../components/error-state\";\n\n// Font size mapping for title\nconst fontSizeClasses: Record<FontSizeOptions, string> = {\n \"2xl\": \"text-2xl\",\n xl: \"text-xl\",\n lg: \"text-lg\",\n md: \"text-base\",\n sm: \"text-sm\",\n xs: \"text-xs\",\n};\n\ntype CatchUpWidgetProps = ComponentProps<\"div\"> & {\n // Title settings\n titleEnabled?: boolean;\n titleText?: string;\n titleFontSize?: FontSizeOptions;\n titleColor?: ColorOptions;\n // Design settings\n background?: BackgroundValue;\n textColor?: ColorOptions;\n accentColor?: ColorOptions;\n padding?: PaddingOptions;\n borderRadius?: BorderRadiusOptions;\n // Display settings\n maxItems?: number;\n};\n\nexport function CatchUpWidget({\n // Title settings with defaults\n titleEnabled = true,\n titleText = \"Catch Ups\",\n titleFontSize = \"xl\",\n titleColor = \"foreground\",\n // Design settings with defaults\n background = {\n type: \"solid\",\n color: \"background\",\n },\n textColor = \"foreground\",\n accentColor = \"primary\",\n padding = 4,\n borderRadius = \"md\",\n // Display settings with defaults\n maxItems = 5,\n className,\n ...props\n}: CatchUpWidgetProps): React.JSX.Element {\n const backgroundColor = background.color || \"background\";\n const backgroundImage =\n (background.resource?.image_url || background.resource?.imageUrl) &&\n background.type === \"image\"\n ? `url(${background.resource.image_url || background.resource.imageUrl})`\n : \"none\";\n const { data = [], isLoading, isError } = useCatchUps();\n\n const catchUpsToShow = data.slice(0, maxItems);\n const moreCatchUps = data.length - catchUpsToShow.length;\n\n return (\n <div\n className={`flex flex-col rounded-${borderRadius} bg-${backgroundColor} p-${padding} text-${textColor} ${className || \"\"}`}\n style={{ backgroundImage }}\n {...props}\n >\n {/* Header */}\n <div className=\"flex items-center justify-between\">\n {titleEnabled && (\n <h3\n className={`${fontSizeClasses[titleFontSize]} font-semibold text-${titleColor}`}\n >\n {titleText}\n </h3>\n )}\n {!isLoading && !isError && data.length > 0 && (\n <span className={`text-3xl font-bold text-${accentColor}`}>\n {data.length}\n </span>\n )}\n </div>\n\n {/* Loading state */}\n {isLoading ? (\n <div className=\"flex min-h-[150px] flex-1 items-center justify-center\">\n <Loader2 className={`h-8 w-8 animate-spin text-${accentColor}`} />\n </div>\n ) : isError ? (\n /* Error state */\n <ErrorState />\n ) : data.length === 0 ? (\n /* Empty state */\n <div className=\"flex min-h-[150px] flex-1 flex-col items-center justify-center gap-2\">\n <Sparkles className={`h-8 w-8 text-${accentColor}`} />\n <p className=\"text-center font-semibold\">\n You&apos;re all caught up.\n </p>\n <p className=\"text-sm opacity-60\">See you next time!</p>\n </div>\n ) : (\n /* Default state with catch ups */\n <>\n <div className=\"mt-3 flex-1\">\n {catchUpsToShow.map((catchUp, index: number) => (\n <div\n key={catchUp.id || index}\n className={`py-2 ${index !== catchUpsToShow.length - 1 ? \"border-b border-current/10\" : \"\"}`}\n >\n <p className=\"line-clamp-1 text-sm\">\n {catchUp.suggestion_title}\n </p>\n </div>\n ))}\n </div>\n\n {/* More indicator */}\n {moreCatchUps > 0 && (\n <p className=\"mt-2 text-sm opacity-60\">\n {moreCatchUps} more catch up{moreCatchUps > 1 ? \"s\" : \"\"}\n </p>\n )}\n </>\n )}\n </div>\n );\n}\n\n// Property schema for the widget editor\nexport const catchUpWidgetPropertySchema: WidgetPropertySchema = {\n widgetType: \"CatchUpWidget\",\n displayName: \"Catch Up Widget\",\n tabsConfig: [{ id: \"styling\", label: \"Styling\" }],\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 catch ups\",\n defaultValue: true,\n tab: \"styling\",\n group: \"Title\",\n },\n {\n key: \"titleText\",\n label: \"Title\",\n type: \"text\",\n description: \"Title text displayed above the catch ups\",\n defaultValue: \"Catch Ups\",\n tab: \"styling\",\n group: \"Title\",\n requiresKeyToBeTrue: \"titleEnabled\",\n },\n getFontSizeField({\n key: \"titleFontSize\",\n label: \"Title Font Size\",\n description: \"Font size for the widget title\",\n defaultValue: \"xl\",\n tab: \"styling\",\n group: \"Title\",\n requiresKeyToBeTrue: \"titleEnabled\",\n }),\n getColorField({\n key: \"titleColor\",\n label: \"Title Color\",\n description: \"Color for the widget title\",\n defaultValue: \"foreground\",\n tab: \"styling\",\n group: \"Title\",\n requiresKeyToBeTrue: \"titleEnabled\",\n }),\n\n // Styling Tab - Design Group\n {\n type: \"background\",\n key: \"background\",\n label: \"Background\",\n description: \"Background for the container\",\n defaultValue: \"background\",\n tab: \"styling\",\n group: \"Design\",\n },\n getColorField({\n key: \"textColor\",\n label: \"Text Color\",\n description: \"Default text color for catch up items\",\n defaultValue: \"foreground\",\n tab: \"styling\",\n group: \"Design\",\n }),\n getColorField({\n key: \"accentColor\",\n label: \"Accent Color\",\n description: \"Color used for count display and icons\",\n defaultValue: \"primary\",\n tab: \"styling\",\n group: \"Design\",\n }),\n {\n key: \"separator\",\n type: \"separator\",\n label: \"Separator\",\n tab: \"styling\",\n group: \"Design\",\n },\n {\n key: \"maxItems\",\n label: \"Max Items\",\n type: \"number\",\n description: \"Maximum number of catch ups to display\",\n defaultValue: 5,\n min: 1,\n max: 10,\n tab: \"styling\",\n group: \"Design\",\n },\n getPaddingField({\n key: \"padding\",\n label: \"Padding\",\n description: \"Padding around the container\",\n defaultValue: 4,\n tab: \"styling\",\n group: \"Design\",\n }),\n getBorderRadiusField({\n key: \"borderRadius\",\n label: \"Border Radius\",\n description: \"Border radius for the container\",\n defaultValue: \"md\",\n tab: \"styling\",\n group: \"Design\",\n }),\n ],\n} as const satisfies WidgetPropertySchema;\n"],"mappings":";;;;;;;;;AAEA,MAAa,eAA0B;CACrC;EAAE,IAAI;EAAG,kBAAkB;EAA8C;CACzE;EAAE,IAAI;EAAG,kBAAkB;EAA0C;CACrE;EAAE,IAAI;EAAG,kBAAkB;EAAkD;CAC7E;EAAE,IAAI;EAAG,kBAAkB;EAA2C;CACtE;EAAE,IAAI;EAAG,kBAAkB;EAAiC;CAC7D;;;ACCD,SAAgB,cAAgD;CAC9D,MAAM,EAAE,SAAS,mBAAA,GAAA,4CAAA,sBAAuC;CACxD,MAAM,EAAE,eAAA,GAAA,oDAAA,0BAAuC;AAE/C,SAAA,GAAA,sBAAA,UAAgB;EACd,UAAU;GACR;GACA;GACA,YAAY,YAAY;GACzB;EACD,SAAS,OAAO,EAAE,aAAiC;GACjD,MAAM,MAAM,UACR,GAAG,QAAQ,oCACX;GACJ,MAAM,WAAW,MAAM,MAAM,KAAK;IAChC,SAAS;KACP,gBAAgB;KAChB,GAAG,iBAAiB;KACrB;IACD;IACD,CAAC;AAEF,OAAI,CAAC,SAAS,GACZ,OAAM,IAAI,MAAM,8BAA8B,SAAS,SAAS;AAGlE,UAAO,SAAS,MAAM;;EAExB,SAAS,CAAC;EACV,GAAI,aAAa,EAAE,iBAAiB,cAAc;EACnD,CAAC;;;;;;;;AClBJ,MAAM,kBAAmD;CACvD,OAAO;CACP,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACL;AAkBD,SAAgB,cAAc,EAE5B,eAAe,MACf,YAAY,aACZ,gBAAgB,MAChB,aAAa,cAEb,aAAa;CACX,MAAM;CACN,OAAO;CACR,EACD,YAAY,cACZ,cAAc,WACd,UAAU,GACV,eAA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a;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EACF;GACE,KAAK;GACL,MAAM;GACN,OAAO;GACP,KAAK;GACL,OAAO;GACR;EACD;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,cAAc;GACd,KAAK;GACL,KAAK;GACL,KAAK;GACL,OAAO;GACR;yDACe;GACd,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;8DACmB;GACnB,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EACH;CACF"}
@@ -1,8 +1,7 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-wcPFST8Q.mjs";
2
2
  import { getBorderRadiusField, getHeightField } from "@fluid-app/portal-core/registries";
3
3
  import { jsx, jsxs } from "react/jsx-runtime";
4
- import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
5
- import { faGlobe } from "@fortawesome/pro-regular-svg-icons";
4
+ import { Globe } from "lucide-react";
6
5
  //#region src/widgets/EmbedWidget.tsx
7
6
  var EmbedWidget_exports = /* @__PURE__ */ __exportAll({
8
7
  EmbedWidget: () => EmbedWidget,
@@ -17,10 +16,7 @@ function EmbedWidget({ url = "", title = "Embedded Content", height = "400px", f
17
16
  children: /* @__PURE__ */ jsxs("div", {
18
17
  className: "flex flex-col items-center gap-2 p-6 text-center",
19
18
  children: [
20
- /* @__PURE__ */ jsx(FontAwesomeIcon, {
21
- icon: faGlobe,
22
- className: "h-12 w-12 opacity-50"
23
- }),
19
+ /* @__PURE__ */ jsx(Globe, { className: "h-12 w-12 opacity-50" }),
24
20
  /* @__PURE__ */ jsx("p", {
25
21
  className: "text-sm font-medium",
26
22
  children: "Enter a URL to embed external content"
@@ -45,10 +41,7 @@ function EmbedWidget({ url = "", title = "Embedded Content", height = "400px", f
45
41
  children: /* @__PURE__ */ jsxs("div", {
46
42
  className: "flex flex-col items-center gap-2 p-6 text-center",
47
43
  children: [
48
- /* @__PURE__ */ jsx(FontAwesomeIcon, {
49
- icon: faGlobe,
50
- className: "h-12 w-12 opacity-50"
51
- }),
44
+ /* @__PURE__ */ jsx(Globe, { className: "h-12 w-12 opacity-50" }),
52
45
  /* @__PURE__ */ jsx("p", {
53
46
  className: "text-sm font-medium",
54
47
  children: "Enter a URL to embed external content"
@@ -150,4 +143,4 @@ const embedWidgetPropertySchema = {
150
143
  //#endregion
151
144
  export { EmbedWidget_exports as n, embedWidgetPropertySchema as r, EmbedWidget as t };
152
145
 
153
- //# sourceMappingURL=EmbedWidget-RuCm5uOj.mjs.map
146
+ //# sourceMappingURL=EmbedWidget-CZanYM7p.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EmbedWidget-CZanYM7p.mjs","names":[],"sources":["../src/widgets/EmbedWidget.tsx"],"sourcesContent":["import { Globe } from \"lucide-react\";\nimport 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 { BorderRadiusOptions } from \"@fluid-app/portal-core/types\";\n\ntype EmbedWidgetProps = ComponentProps<\"div\"> & {\n url?: string;\n title?: string;\n height?: string;\n fullScreen?: boolean;\n allowFullscreen?: boolean;\n loading?: \"eager\" | \"lazy\";\n borderRadius?: BorderRadiusOptions;\n editMode?: boolean;\n isSelected?: boolean;\n};\n\nexport function EmbedWidget({\n url = \"\",\n title = \"Embedded Content\",\n height = \"400px\",\n fullScreen = false,\n allowFullscreen = true,\n loading = \"lazy\",\n borderRadius = \"md\",\n editMode = false,\n isSelected = false,\n className,\n ...props\n}: EmbedWidgetProps): React.JSX.Element {\n const isFullScreen = fullScreen;\n\n // Show placeholder if no URL is provided\n if (!url) {\n return (\n <div\n className={`flex items-center justify-center rounded-${borderRadius} border-border bg-muted text-muted-foreground border-2 border-dashed ${isFullScreen ? \"h-full\" : \"\"} ${className}`}\n style={isFullScreen ? undefined : { height }}\n {...props}\n >\n <div className=\"flex flex-col items-center gap-2 p-6 text-center\">\n <Globe className=\"h-12 w-12 opacity-50\" />\n <p className=\"text-sm font-medium\">\n Enter a URL to embed external content\n </p>\n <p className=\"text-xs opacity-75\">\n Configure the URL in the properties panel\n </p>\n </div>\n </div>\n );\n }\n\n const normalizedUrl =\n url.startsWith(\"http://\") || url.startsWith(\"https://\")\n ? url\n : `https://${url}`;\n\n let isValidUrl = false;\n try {\n const parsed = new URL(normalizedUrl);\n isValidUrl =\n (parsed.protocol === \"http:\" || parsed.protocol === \"https:\") &&\n (parsed.hostname.includes(\".\") || parsed.hostname === \"localhost\");\n } catch {\n // invalid URL\n }\n\n if (!isValidUrl) {\n return (\n <div\n className={`flex items-center justify-center rounded-${borderRadius} border-border bg-muted text-muted-foreground border-2 border-dashed ${isFullScreen ? \"h-full\" : \"\"} ${className}`}\n style={isFullScreen ? undefined : { height }}\n {...props}\n >\n <div className=\"flex flex-col items-center gap-2 p-6 text-center\">\n <Globe className=\"h-12 w-12 opacity-50\" />\n <p className=\"text-sm font-medium\">\n Enter a URL to embed external content\n </p>\n <p className=\"text-xs opacity-75\">\n Configure the URL in the properties panel\n </p>\n </div>\n </div>\n );\n }\n\n return (\n <div\n className={`relative w-full ${isFullScreen ? \"h-full\" : \"\"} ${className}`}\n {...props}\n >\n <iframe\n src={normalizedUrl}\n title={title}\n width=\"100%\"\n style={isFullScreen ? { height: \"100%\" } : { height }}\n loading={loading}\n allowFullScreen={allowFullscreen}\n className={`rounded-${borderRadius} border-border border`}\n sandbox=\"allow-scripts allow-same-origin allow-forms allow-popups allow-popups-to-escape-sandbox\"\n />\n {editMode && !isSelected && <div className=\"absolute inset-0 z-10\" />}\n </div>\n );\n}\n\nexport const embedWidgetPropertySchema: WidgetPropertySchema = {\n widgetType: \"EmbedWidget\",\n displayName: \"Embed\",\n fields: [\n // Content\n {\n key: \"url\",\n label: \"URL\",\n type: \"text\",\n description: \"The URL of the external site to embed\",\n placeholder: \"https://example.com\",\n defaultValue: \"\",\n group: \"Content\",\n },\n {\n key: \"title\",\n label: \"Title\",\n type: \"text\",\n description: \"Accessibility title for the embedded content\",\n defaultValue: \"Embedded Content\",\n group: \"Content\",\n },\n\n // Design\n getBorderRadiusField({\n key: \"borderRadius\",\n label: \"Border Radius\",\n description: \"Border radius for the embed container\",\n defaultValue: \"md\",\n group: \"Design\",\n }),\n {\n key: \"fullScreen\",\n label: \"Full Screen\",\n type: \"boolean\",\n description: \"When enabled, the embed fills the available space\",\n defaultValue: false,\n group: \"Design\",\n },\n getHeightField({\n key: \"height\",\n label: \"Height\",\n description: \"Height of the embedded iframe\",\n defaultValue: \"400px\",\n group: \"Design\",\n requiresKeyValue: {\n key: \"fullScreen\",\n value: false,\n },\n }),\n\n // Settings\n {\n key: \"allowFullscreen\",\n label: \"Allow Fullscreen\",\n type: \"boolean\",\n description: \"Allow the embedded content to use fullscreen mode\",\n defaultValue: true,\n group: \"Settings\",\n },\n {\n key: \"loading\",\n label: \"Loading\",\n type: \"select\",\n description: \"When to load the embedded content\",\n options: [\n { label: \"Lazy (on scroll)\", value: \"lazy\" },\n { label: \"Eager (immediately)\", value: \"eager\" },\n ],\n defaultValue: \"lazy\",\n group: \"Settings\",\n },\n ],\n};\n"],"mappings":";;;;;;;;;AAsBA,SAAgB,YAAY,EAC1B,MAAM,IACN,QAAQ,oBACR,SAAS,SACT,aAAa,OACb,kBAAkB,MAClB,UAAU,QACV,eAAe,MACf,WAAW,OACX,aAAa,OACb,WACA,GAAG,SACmC;CACtC,MAAM,eAAe;AAGrB,KAAI,CAAC,IACH,QACE,oBAAC,OAAD;EACE,WAAW,4CAA4C,aAAa,uEAAuE,eAAe,WAAW,GAAG,GAAG;EAC3K,OAAO,eAAe,KAAA,IAAY,EAAE,QAAQ;EAC5C,GAAI;YAEJ,qBAAC,OAAD;GAAK,WAAU;aAAf;IACE,oBAAC,OAAD,EAAO,WAAU,wBAAyB,CAAA;IAC1C,oBAAC,KAAD;KAAG,WAA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AO;GACR;EAGD,qBAAqB;GACnB,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;EACD,eAAe;GACb,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,OAAO;GACP,kBAAkB;IAChB,KAAK;IACL,OAAO;IACR;GACF,CAAC;EAGF;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,cAAc;GACd,OAAO;GACR;EACD;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,SAAS,CACP;IAAE,OAAO;IAAoB,OAAO;IAAQ,EAC5C;IAAE,OAAO;IAAuB,OAAO;IAAS,CACjD;GACD,cAAc;GACd,OAAO;GACR;EACF;CACF"}
@@ -1,8 +1,7 @@
1
1
  const require_chunk = require("./chunk-CZWwpsFl.cjs");
2
2
  let _fluid_app_portal_core_registries = require("@fluid-app/portal-core/registries");
3
3
  let react_jsx_runtime = require("react/jsx-runtime");
4
- let _fortawesome_react_fontawesome = require("@fortawesome/react-fontawesome");
5
- let _fortawesome_pro_regular_svg_icons = require("@fortawesome/pro-regular-svg-icons");
4
+ let lucide_react = require("lucide-react");
6
5
  //#region src/widgets/EmbedWidget.tsx
7
6
  var EmbedWidget_exports = /* @__PURE__ */ require_chunk.__exportAll({
8
7
  EmbedWidget: () => EmbedWidget,
@@ -17,10 +16,7 @@ function EmbedWidget({ url = "", title = "Embedded Content", height = "400px", f
17
16
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
18
17
  className: "flex flex-col items-center gap-2 p-6 text-center",
19
18
  children: [
20
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_fortawesome_react_fontawesome.FontAwesomeIcon, {
21
- icon: _fortawesome_pro_regular_svg_icons.faGlobe,
22
- className: "h-12 w-12 opacity-50"
23
- }),
19
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Globe, { className: "h-12 w-12 opacity-50" }),
24
20
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
25
21
  className: "text-sm font-medium",
26
22
  children: "Enter a URL to embed external content"
@@ -45,10 +41,7 @@ function EmbedWidget({ url = "", title = "Embedded Content", height = "400px", f
45
41
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
46
42
  className: "flex flex-col items-center gap-2 p-6 text-center",
47
43
  children: [
48
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_fortawesome_react_fontawesome.FontAwesomeIcon, {
49
- icon: _fortawesome_pro_regular_svg_icons.faGlobe,
50
- className: "h-12 w-12 opacity-50"
51
- }),
44
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Globe, { className: "h-12 w-12 opacity-50" }),
52
45
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
53
46
  className: "text-sm font-medium",
54
47
  children: "Enter a URL to embed external content"
@@ -167,4 +160,4 @@ Object.defineProperty(exports, "embedWidgetPropertySchema", {
167
160
  }
168
161
  });
169
162
 
170
- //# sourceMappingURL=EmbedWidget-BENxbwxX.cjs.map
163
+ //# sourceMappingURL=EmbedWidget-I-vrAy02.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EmbedWidget-I-vrAy02.cjs","names":["Globe"],"sources":["../src/widgets/EmbedWidget.tsx"],"sourcesContent":["import { Globe } from \"lucide-react\";\nimport 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 { BorderRadiusOptions } from \"@fluid-app/portal-core/types\";\n\ntype EmbedWidgetProps = ComponentProps<\"div\"> & {\n url?: string;\n title?: string;\n height?: string;\n fullScreen?: boolean;\n allowFullscreen?: boolean;\n loading?: \"eager\" | \"lazy\";\n borderRadius?: BorderRadiusOptions;\n editMode?: boolean;\n isSelected?: boolean;\n};\n\nexport function EmbedWidget({\n url = \"\",\n title = \"Embedded Content\",\n height = \"400px\",\n fullScreen = false,\n allowFullscreen = true,\n loading = \"lazy\",\n borderRadius = \"md\",\n editMode = false,\n isSelected = false,\n className,\n ...props\n}: EmbedWidgetProps): React.JSX.Element {\n const isFullScreen = fullScreen;\n\n // Show placeholder if no URL is provided\n if (!url) {\n return (\n <div\n className={`flex items-center justify-center rounded-${borderRadius} border-border bg-muted text-muted-foreground border-2 border-dashed ${isFullScreen ? \"h-full\" : \"\"} ${className}`}\n style={isFullScreen ? undefined : { height }}\n {...props}\n >\n <div className=\"flex flex-col items-center gap-2 p-6 text-center\">\n <Globe className=\"h-12 w-12 opacity-50\" />\n <p className=\"text-sm font-medium\">\n Enter a URL to embed external content\n </p>\n <p className=\"text-xs opacity-75\">\n Configure the URL in the properties panel\n </p>\n </div>\n </div>\n );\n }\n\n const normalizedUrl =\n url.startsWith(\"http://\") || url.startsWith(\"https://\")\n ? url\n : `https://${url}`;\n\n let isValidUrl = false;\n try {\n const parsed = new URL(normalizedUrl);\n isValidUrl =\n (parsed.protocol === \"http:\" || parsed.protocol === \"https:\") &&\n (parsed.hostname.includes(\".\") || parsed.hostname === \"localhost\");\n } catch {\n // invalid URL\n }\n\n if (!isValidUrl) {\n return (\n <div\n className={`flex items-center justify-center rounded-${borderRadius} border-border bg-muted text-muted-foreground border-2 border-dashed ${isFullScreen ? \"h-full\" : \"\"} ${className}`}\n style={isFullScreen ? undefined : { height }}\n {...props}\n >\n <div className=\"flex flex-col items-center gap-2 p-6 text-center\">\n <Globe className=\"h-12 w-12 opacity-50\" />\n <p className=\"text-sm font-medium\">\n Enter a URL to embed external content\n </p>\n <p className=\"text-xs opacity-75\">\n Configure the URL in the properties panel\n </p>\n </div>\n </div>\n );\n }\n\n return (\n <div\n className={`relative w-full ${isFullScreen ? \"h-full\" : \"\"} ${className}`}\n {...props}\n >\n <iframe\n src={normalizedUrl}\n title={title}\n width=\"100%\"\n style={isFullScreen ? { height: \"100%\" } : { height }}\n loading={loading}\n allowFullScreen={allowFullscreen}\n className={`rounded-${borderRadius} border-border border`}\n sandbox=\"allow-scripts allow-same-origin allow-forms allow-popups allow-popups-to-escape-sandbox\"\n />\n {editMode && !isSelected && <div className=\"absolute inset-0 z-10\" />}\n </div>\n );\n}\n\nexport const embedWidgetPropertySchema: WidgetPropertySchema = {\n widgetType: \"EmbedWidget\",\n displayName: \"Embed\",\n fields: [\n // Content\n {\n key: \"url\",\n label: \"URL\",\n type: \"text\",\n description: \"The URL of the external site to embed\",\n placeholder: \"https://example.com\",\n defaultValue: \"\",\n group: \"Content\",\n },\n {\n key: \"title\",\n label: \"Title\",\n type: \"text\",\n description: \"Accessibility title for the embedded content\",\n defaultValue: \"Embedded Content\",\n group: \"Content\",\n },\n\n // Design\n getBorderRadiusField({\n key: \"borderRadius\",\n label: \"Border Radius\",\n description: \"Border radius for the embed container\",\n defaultValue: \"md\",\n group: \"Design\",\n }),\n {\n key: \"fullScreen\",\n label: \"Full Screen\",\n type: \"boolean\",\n description: \"When enabled, the embed fills the available space\",\n defaultValue: false,\n group: \"Design\",\n },\n getHeightField({\n key: \"height\",\n label: \"Height\",\n description: \"Height of the embedded iframe\",\n defaultValue: \"400px\",\n group: \"Design\",\n requiresKeyValue: {\n key: \"fullScreen\",\n value: false,\n },\n }),\n\n // Settings\n {\n key: \"allowFullscreen\",\n label: \"Allow Fullscreen\",\n type: \"boolean\",\n description: \"Allow the embedded content to use fullscreen mode\",\n defaultValue: true,\n group: \"Settings\",\n },\n {\n key: \"loading\",\n label: \"Loading\",\n type: \"select\",\n description: \"When to load the embedded content\",\n options: [\n { label: \"Lazy (on scroll)\", value: \"lazy\" },\n { label: \"Eager (immediately)\", value: \"eager\" },\n ],\n defaultValue: \"lazy\",\n group: \"Settings\",\n },\n ],\n};\n"],"mappings":";;;;;;;;;AAsBA,SAAgB,YAAY,EAC1B,MAAM,IACN,QAAQ,oBACR,SAAS,SACT,aAAa,OACb,kBAAkB,MA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AA;IACA;;EACF,CAAA;AAIV,QACE,iBAAA,GAAA,kBAAA,MAAC,OAAD;EACE,WAAW,mBAAmB,eAAe,WAAW,GAAG,GAAG;EAC9D,GAAI;YAFN,CAIE,iBAAA,GAAA,kBAAA,KAAC,UAAD;GACE,KAAK;GACE;GACP,OAAM;GACN,OAAO,eAAe,EAAE,QAAQ,QAAQ,GAAG,EAAE,QAAQ;GAC5C;GACT,iBAAiB;GACjB,WAAW,WAAW,aAAa;GACnC,SAAQ;GACR,CAAA,EACD,YAAY,CAAC,cAAc,iBAAA,GAAA,kBAAA,KAAC,OAAD,EAAK,WAAU,yBAA0B,CAAA,CACjE;;;AAIV,MAAa,4BAAkD;CAC7D,YAAY;CACZ,aAAa;CACb,QAAQ;EAEN;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,aAAa;GACb,cAAc;GACd,OAAO;GACR;EACD;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,cAAc;GACd,OAAO;GACR;8DAGoB;GACnB,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;wDACc;GACb,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,OAAO;GACP,kBAAkB;IAChB,KAAK;IACL,OAAO;IACR;GACF,CAAC;EAGF;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,cAAc;GACd,OAAO;GACR;EACD;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,SAAS,CACP;IAAE,OAAO;IAAoB,OAAO;IAAQ,EAC5C;IAAE,OAAO;IAAuB,OAAO;IAAS,CACjD;GACD,cAAc;GACd,OAAO;GACR;EACF;CACF"}
@@ -1,5 +1,5 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-wcPFST8Q.mjs";
2
- import { t as MediaRenderer } from "./MediaRenderer-Uq90PZcY.mjs";
2
+ import { t as MediaRenderer } from "./MediaRenderer-CrvEIBKa.mjs";
3
3
  import { getBorderRadiusField, getHeightField } from "@fluid-app/portal-core/registries";
4
4
  import { jsx } from "react/jsx-runtime";
5
5
  //#region src/widgets/ImageWidget.tsx
@@ -144,4 +144,4 @@ const imageWidgetPropertySchema = {
144
144
  //#endregion
145
145
  export { ImageWidget_exports as n, imageWidgetPropertySchema as r, ImageWidget as t };
146
146
 
147
- //# sourceMappingURL=ImageWidget--owpCpb0.mjs.map
147
+ //# sourceMappingURL=ImageWidget-CJzO7yV9.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"ImageWidget--owpCpb0.mjs","names":[],"sources":["../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 ShareableItem,\n} from \"@fluid-app/portal-core/types\";\nimport { MediaRenderer } from \"../components/MediaRenderer\";\n\ntype ImageWidgetProps = ComponentProps<\"div\"> & {\n src?: string;\n alt?: string;\n borderRadius?: BorderRadiusOptions;\n verticalSizing?: \"auto\" | \"fixed\";\n fixedHeight?: string;\n displayFit?: \"cover\" | \"contain\";\n focusPoint?: string;\n linkUrl?: string;\n resource?: ShareableItem;\n useCustomUrl?: boolean;\n};\n\nexport function ImageWidget({\n src = \"\",\n alt = \"\",\n borderRadius = \"md\",\n verticalSizing = \"auto\",\n fixedHeight = \"200px\",\n displayFit = \"cover\",\n focusPoint,\n linkUrl,\n resource,\n useCustomUrl,\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} 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) {\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 {\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":";;;;;;;;;AA0BA,SAAgB,YAAY,EAC1B,MAAM,IACN,MAAM,IACN,eAAe,MACf,iBAAiB,QACjB,cAAc,SACd,aAAa,SACb,YACA,SACA,UACA,gBACsC;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;EAC1C,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,QACF,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;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-CJzO7yV9.mjs","names":[],"sources":["../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 ShareableItem,\n} from \"@fluid-app/portal-core/types\";\nimport { MediaRenderer } from \"../components/MediaRenderer\";\n\ntype ImageWidgetProps = ComponentProps<\"div\"> & {\n src?: string;\n alt?: string;\n borderRadius?: BorderRadiusOptions;\n verticalSizing?: \"auto\" | \"fixed\";\n fixedHeight?: string;\n displayFit?: \"cover\" | \"contain\";\n focusPoint?: string;\n linkUrl?: string;\n resource?: ShareableItem;\n useCustomUrl?: boolean;\n};\n\nexport function ImageWidget({\n src = \"\",\n alt = \"\",\n borderRadius = \"md\",\n verticalSizing = \"auto\",\n fixedHeight = \"200px\",\n displayFit = \"cover\",\n focusPoint,\n linkUrl,\n resource,\n useCustomUrl,\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} 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) {\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 {\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":";;;;;;;;;AA0BA,SAAgB,YAAY,EAC1B,MAAM,IACN,MAAM,IACN,eAAe,MACf,iBAAiB,QACjB,cAAc,SACd,aAAa,SACb,YACA,SACA,UACA,gBACsC;CACtC,MAAM,eAAe,eAAe,MAAO,UAAU,YAAY;CACjE,MAAM,eAAe,UAAU,SAAS;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W,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,5 +1,5 @@
1
1
  const require_chunk = require("./chunk-CZWwpsFl.cjs");
2
- const require_MediaRenderer = require("./MediaRenderer-CcJvyOJ1.cjs");
2
+ const require_MediaRenderer = require("./MediaRenderer-Crlzjyvh.cjs");
3
3
  let _fluid_app_portal_core_registries = require("@fluid-app/portal-core/registries");
4
4
  let react_jsx_runtime = require("react/jsx-runtime");
5
5
  //#region src/widgets/ImageWidget.tsx
@@ -161,4 +161,4 @@ Object.defineProperty(exports, "imageWidgetPropertySchema", {
161
161
  }
162
162
  });
163
163
 
164
- //# sourceMappingURL=ImageWidget-B2stGyqB.cjs.map
164
+ //# sourceMappingURL=ImageWidget-CR-dZIET.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"ImageWidget-B2stGyqB.cjs","names":["MediaRenderer"],"sources":["../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 ShareableItem,\n} from \"@fluid-app/portal-core/types\";\nimport { MediaRenderer } from \"../components/MediaRenderer\";\n\ntype ImageWidgetProps = ComponentProps<\"div\"> & {\n src?: string;\n alt?: string;\n borderRadius?: BorderRadiusOptions;\n verticalSizing?: \"auto\" | \"fixed\";\n fixedHeight?: string;\n displayFit?: \"cover\" | \"contain\";\n focusPoint?: string;\n linkUrl?: string;\n resource?: ShareableItem;\n useCustomUrl?: boolean;\n};\n\nexport function ImageWidget({\n src = \"\",\n alt = \"\",\n borderRadius = \"md\",\n verticalSizing = \"auto\",\n fixedHeight = \"200px\",\n displayFit = \"cover\",\n focusPoint,\n linkUrl,\n resource,\n useCustomUrl,\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} 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) {\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 {\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":";;;;;;;;;AA0BA,SAAgB,YAAY,EAC1B,MAAM,IACN,MAAM,IACN,eAAe,MACf,iBAAiB,QACjB,cAAc,SACd,aAAa,SACb,YACA,SACA,UACA,gBACsC;CACtC,MAAM,eAAe,eAAe,MAAO,UAAU,YAAY;CACjE,MAAM,eAAe,UAAU,SAAS;CAExC,MAAM,UAAU,mBAAmB;CAEnC,MAAM,UACJ,iBAAA,GAAA,kBAAA,KAAC,OAAD;EACE,WAAW,kBAAkB,aAAa;EAC1C,OAAO,UAAU,EAAE,QAAQ,aAAa,GAAG,KAAA;YAE3C,iBAAA,GAAA,kBAAA,KAACA,sBAAAA,eAAD;GACE,WA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ACd,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-CR-dZIET.cjs","names":["MediaRenderer"],"sources":["../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 ShareableItem,\n} from \"@fluid-app/portal-core/types\";\nimport { MediaRenderer } from \"../components/MediaRenderer\";\n\ntype ImageWidgetProps = ComponentProps<\"div\"> & {\n src?: string;\n alt?: string;\n borderRadius?: BorderRadiusOptions;\n verticalSizing?: \"auto\" | \"fixed\";\n fixedHeight?: string;\n displayFit?: \"cover\" | \"contain\";\n focusPoint?: string;\n linkUrl?: string;\n resource?: ShareableItem;\n useCustomUrl?: boolean;\n};\n\nexport function ImageWidget({\n src = \"\",\n alt = \"\",\n borderRadius = \"md\",\n verticalSizing = \"auto\",\n fixedHeight = \"200px\",\n displayFit = \"cover\",\n focusPoint,\n linkUrl,\n resource,\n useCustomUrl,\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} 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) {\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 {\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":";;;;;;;;;AA0BA,SAAgB,YAAY,EAC1B,MAAM,IACN,MAAM,IACN,eAAe,MACf,iBAAiB,QACjB,cAAc,SACd,aAAa,SACb,YACA,SACA,UACA,gBACsC;CACtC,MAAM,eAAe,eAAe,MAAO,UAAU,YAAY;CACjE,MAAM,eAAe,UAAU,SAAS;CAExC,MAAM,UAAU,mBAAmB;CAEnC,MAAM,UACJ,iBAAA,GAAA,kBAAA,KAAC,OAAD;EACE,WAAW,kBAAkB,aAAa;EAC1C,OAAO,UAAU,EAAE,QAAQ,aAAa,GAAG,KAAA;YAE3C,iBAAA,GAAA,kBAAA,KAACA,sBAAAA,eAAD;GACE,WAAU;GACV,KAAK;GACL,KAAK;GACL,WAAW,UAAU,aAAa;GAClC,YAAY,UAAU,aAAa,KAAA;GACnC,CAAA;EACE,CAAA;AAGR,KAAI,QACF,QACE,iBAAA,GAAA,kBAAA,KAAC,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;8DAGoB;GACnB,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;wDACc;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,2 +1,2 @@
1
- const require_ListWidget = require("./ListWidget-DPVLRWoB.cjs");
1
+ const require_ListWidget = require("./ListWidget-dib-Tl8j.cjs");
2
2
  exports.listWidgetPropertySchema = require_ListWidget.listWidgetPropertySchema;
@@ -1,7 +1,7 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-wcPFST8Q.mjs";
2
2
  import { a as getFontSizeField, c as getPaddingField, i as getColorField, n as getBorderRadiusField, o as getGapField, t as gapValues } from "./fields-wPOk-SmZ.mjs";
3
- import { t as ScrollArrows } from "./scroll-arrows-BevCYRNT.mjs";
4
- import { t as MediaRenderer } from "./MediaRenderer-Uq90PZcY.mjs";
3
+ import { t as ScrollArrows } from "./scroll-arrows-CTQrIV6z.mjs";
4
+ import { t as MediaRenderer } from "./MediaRenderer-CrvEIBKa.mjs";
5
5
  import { n as useWidgetInteraction } from "./WidgetInteractionContext-awLrJeAK.mjs";
6
6
  import { jsx, jsxs } from "react/jsx-runtime";
7
7
  import { useRef } from "react";
@@ -896,4 +896,4 @@ const listWidgetPropertySchema = {
896
896
  //#endregion
897
897
  export { ListWidget_exports as n, listWidgetPropertySchema as r, ListWidget as t };
898
898
 
899
- //# sourceMappingURL=ListWidget-DdvuIQXy.mjs.map
899
+ //# sourceMappingURL=ListWidget-Bld9LfFO.mjs.map