@fluid-app/portal-sdk 0.1.239 → 0.1.241
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{CalendarWidget-BXxNxHDV.mjs → CalendarWidget-C03VcDLQ.mjs} +2 -2
- package/dist/{CalendarWidget-BXxNxHDV.mjs.map → CalendarWidget-C03VcDLQ.mjs.map} +1 -1
- package/dist/{CalendarWidget-VjQXZW8B.cjs → CalendarWidget-C4Dv_TUk.cjs} +2 -2
- package/dist/{CalendarWidget-VjQXZW8B.cjs.map → CalendarWidget-C4Dv_TUk.cjs.map} +1 -1
- package/dist/{CardWidget-BNkMlxQ3.mjs → CardWidget-2wcjCf2M.mjs} +2 -2
- package/dist/{CardWidget-BNkMlxQ3.mjs.map → CardWidget-2wcjCf2M.mjs.map} +1 -1
- package/dist/{CardWidget-CraWMttj.cjs → CardWidget-BQl-8Xrt.cjs} +3 -3
- package/dist/{CardWidget-C3I9OwgS.cjs → CardWidget-D-KEikO_.cjs} +2 -2
- package/dist/{CardWidget-C3I9OwgS.cjs.map → CardWidget-D-KEikO_.cjs.map} +1 -1
- package/dist/{CarouselWidget-p8Z6L-G5.mjs → CarouselWidget-Cn5P4FVN.mjs} +92 -83
- package/dist/CarouselWidget-Cn5P4FVN.mjs.map +1 -0
- package/dist/{CarouselWidget-CiKlooUF.cjs → CarouselWidget-Cu1b3ERq.cjs} +92 -83
- package/dist/CarouselWidget-Cu1b3ERq.cjs.map +1 -0
- package/dist/{CatchUpWidget-B9DQlzd_.mjs → CatchUpWidget-B9CI7lq0.mjs} +2 -2
- package/dist/{CatchUpWidget-B9DQlzd_.mjs.map → CatchUpWidget-B9CI7lq0.mjs.map} +1 -1
- package/dist/{CatchUpWidget-SY7hOHk6.cjs → CatchUpWidget-BzgybvuC.cjs} +2 -2
- package/dist/{CatchUpWidget-SY7hOHk6.cjs.map → CatchUpWidget-BzgybvuC.cjs.map} +1 -1
- package/dist/ContainerWidget-CDbB8c0E.cjs +8 -0
- package/dist/{ContainerWidget-CpwvcxFm.mjs → ContainerWidget-DNenbORS.mjs} +2 -2
- package/dist/{ContainerWidget-CpwvcxFm.mjs.map → ContainerWidget-DNenbORS.mjs.map} +1 -1
- package/dist/{ContainerWidget-BXpdj06u.cjs → ContainerWidget-DbAhQKbY.cjs} +2 -2
- package/dist/{ContainerWidget-BXpdj06u.cjs.map → ContainerWidget-DbAhQKbY.cjs.map} +1 -1
- package/dist/{FluidProvider-DL5rChtj.mjs → FluidProvider-BwMwMCxW.mjs} +23 -23
- package/dist/{FluidProvider-DL5rChtj.mjs.map → FluidProvider-BwMwMCxW.mjs.map} +1 -1
- package/dist/{FluidProvider-D_PHVlUU.cjs → FluidProvider-eT4gA6Io.cjs} +23 -23
- package/dist/{FluidProvider-D_PHVlUU.cjs.map → FluidProvider-eT4gA6Io.cjs.map} +1 -1
- package/dist/{LayoutWidget-BIfNHlVE.cjs → LayoutWidget-Bt2I2XMy.cjs} +2 -2
- package/dist/{LayoutWidget-BIfNHlVE.cjs.map → LayoutWidget-Bt2I2XMy.cjs.map} +1 -1
- package/dist/{LayoutWidget-LdF_cKrB.cjs → LayoutWidget-DKqZgCMu.cjs} +3 -3
- package/dist/{LayoutWidget-CC3oK78H.mjs → LayoutWidget-UI5fbsx4.mjs} +2 -2
- package/dist/{LayoutWidget-CC3oK78H.mjs.map → LayoutWidget-UI5fbsx4.mjs.map} +1 -1
- package/dist/{MessagingScreen-Dxy2VQbO.cjs → MessagingScreen-BHYX1Kc6.cjs} +14 -14
- package/dist/{MessagingScreen-mt1u3Bs1.mjs → MessagingScreen-CZddjqma.mjs} +2 -2
- package/dist/{MessagingScreen-mt1u3Bs1.mjs.map → MessagingScreen-CZddjqma.mjs.map} +1 -1
- package/dist/{MessagingScreen-Dkh3Dsp7.cjs → MessagingScreen-D3S230Ba.cjs} +2 -2
- package/dist/{MessagingScreen-Dkh3Dsp7.cjs.map → MessagingScreen-D3S230Ba.cjs.map} +1 -1
- package/dist/{MySiteWidget-BnjPrQxE.mjs → MySiteWidget-CQNASVaF.mjs} +2 -2
- package/dist/{MySiteWidget-BnjPrQxE.mjs.map → MySiteWidget-CQNASVaF.mjs.map} +1 -1
- package/dist/{MySiteWidget-C8eFWHOT.cjs → MySiteWidget-CYiH2lmX.cjs} +2 -2
- package/dist/{MySiteWidget-C8eFWHOT.cjs.map → MySiteWidget-CYiH2lmX.cjs.map} +1 -1
- package/dist/{PointsWidget-C2KB4k48.mjs → PointsWidget-BwA6aGVZ.mjs} +5 -8
- package/dist/PointsWidget-BwA6aGVZ.mjs.map +1 -0
- package/dist/{PointsWidget-DLp-PYus.cjs → PointsWidget-D1FV8l1h.cjs} +5 -8
- package/dist/PointsWidget-D1FV8l1h.cjs.map +1 -0
- package/dist/{ProfileScreen-ChCZZ91o.cjs → ProfileScreen-BYJj4D1W.cjs} +14 -14
- package/dist/{ProfileScreen-BMe-dQi7.cjs → ProfileScreen-DAujb81k.cjs} +2 -2
- package/dist/{ProfileScreen-BMe-dQi7.cjs.map → ProfileScreen-DAujb81k.cjs.map} +1 -1
- package/dist/{ProfileScreen-_1GlBr7z.mjs → ProfileScreen-DlMEqXXg.mjs} +2 -2
- package/dist/{ProfileScreen-_1GlBr7z.mjs.map → ProfileScreen-DlMEqXXg.mjs.map} +1 -1
- package/dist/{RecentActivityWidget-DelPdiwR.mjs → RecentActivityWidget-D1AlZgfV.mjs} +2 -2
- package/dist/{RecentActivityWidget-DelPdiwR.mjs.map → RecentActivityWidget-D1AlZgfV.mjs.map} +1 -1
- package/dist/{RecentActivityWidget-BNW9aFT4.cjs → RecentActivityWidget-DNyhUZNs.cjs} +2 -2
- package/dist/{RecentActivityWidget-BNW9aFT4.cjs.map → RecentActivityWidget-DNyhUZNs.cjs.map} +1 -1
- package/dist/{ScreenRenderer-ClYgfQf_.mjs → ScreenRenderer-Cl2aAJ7D.mjs} +2 -2
- package/dist/{ScreenRenderer-ClYgfQf_.mjs.map → ScreenRenderer-Cl2aAJ7D.mjs.map} +1 -1
- package/dist/{ScreenRenderer-Ct1w4PNu.cjs → ScreenRenderer-xH01YkEQ.cjs} +2 -2
- package/dist/{ScreenRenderer-Ct1w4PNu.cjs.map → ScreenRenderer-xH01YkEQ.cjs.map} +1 -1
- package/dist/{ShopScreen-DWLGH2gt.cjs → ShopScreen-1yvcCk7l.cjs} +6 -2
- package/dist/ShopScreen-1yvcCk7l.cjs.map +1 -0
- package/dist/{ShopScreen-CZ_290EP.cjs → ShopScreen-6nEKrNjK.cjs} +14 -14
- package/dist/{ShopScreen-BBfOte5o.mjs → ShopScreen-U7G6Jf67.mjs} +6 -2
- package/dist/ShopScreen-U7G6Jf67.mjs.map +1 -0
- package/dist/{ToDoWidget-CYDsZA0Z.mjs → ToDoWidget-BciI_D70.mjs} +2 -2
- package/dist/{ToDoWidget-CYDsZA0Z.mjs.map → ToDoWidget-BciI_D70.mjs.map} +1 -1
- package/dist/{ToDoWidget-Bjoan2Rm.cjs → ToDoWidget-OxT9z59F.cjs} +2 -2
- package/dist/{ToDoWidget-Bjoan2Rm.cjs.map → ToDoWidget-OxT9z59F.cjs.map} +1 -1
- package/dist/{ToDoWidget-C_CvWdLi.cjs → ToDoWidget-mSGQgnu3.cjs} +2 -2
- package/dist/index.cjs +22 -22
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +22 -22
- package/dist/{registry-context-BahYMRqn.mjs → registry-context-CTHUCfEc.mjs} +6 -5
- package/dist/{registry-context-bf52ZIJX.cjs.map → registry-context-CTHUCfEc.mjs.map} +1 -1
- package/dist/{registry-context-bf52ZIJX.cjs → registry-context-CcZYS15Q.cjs} +6 -5
- package/dist/{registry-context-BahYMRqn.mjs.map → registry-context-CcZYS15Q.cjs.map} +1 -1
- package/package.json +10 -10
- package/dist/CarouselWidget-CiKlooUF.cjs.map +0 -1
- package/dist/CarouselWidget-p8Z6L-G5.mjs.map +0 -1
- package/dist/ContainerWidget-CyfPYEAv.cjs +0 -8
- package/dist/PointsWidget-C2KB4k48.mjs.map +0 -1
- package/dist/PointsWidget-DLp-PYus.cjs.map +0 -1
- package/dist/ShopScreen-BBfOte5o.mjs.map +0 -1
- package/dist/ShopScreen-DWLGH2gt.cjs.map +0 -1
|
@@ -9,6 +9,7 @@ var CarouselWidget_exports = /* @__PURE__ */ require_chunk.__exportAll({
|
|
|
9
9
|
CarouselWidget: () => CarouselWidget,
|
|
10
10
|
carouselWidgetPropertySchema: () => carouselWidgetPropertySchema
|
|
11
11
|
});
|
|
12
|
+
const VIDEO_CONTROLS_HEIGHT = 44;
|
|
12
13
|
const HEADER_SIZE_MAP = {
|
|
13
14
|
xs: "text-base sm:text-lg",
|
|
14
15
|
sm: "text-lg sm:text-xl",
|
|
@@ -86,6 +87,7 @@ function CarouselWidget({ slides = [], autoScrollInterval = 6500, enableAutoScro
|
|
|
86
87
|
const horizontalClass = align.horizontal === "center" ? "justify-center text-center mx-auto" : align.horizontal === "right" ? "justify-end ml-auto text-right" : "justify-start text-left";
|
|
87
88
|
const frameShadowStyle = editorialFrame ? { boxShadow: `0 1px 2px color-mix(in oklch, var(--color-foreground) 4%, transparent), 0 30px 60px -30px color-mix(in oklch, var(--color-foreground) 40%, transparent)` } : void 0;
|
|
88
89
|
const frameBg = editorialFrame ? `bg-${frameColor}` : "";
|
|
90
|
+
const isActiveSlideVideo = slides[currentIndex]?.content.type === "VideoWidget";
|
|
89
91
|
if (!hasSlides) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
90
92
|
className: `relative w-full overflow-hidden rounded-${borderRadius} ${require_registries.borderWidthClasses[borderWidth]} ${borderWidth !== "none" ? require_registries.borderColorClasses[borderColor] : ""} ${frameBg} ${className ?? ""}`,
|
|
91
93
|
style: {
|
|
@@ -134,6 +136,7 @@ function CarouselWidget({ slides = [], autoScrollInterval = 6500, enableAutoScro
|
|
|
134
136
|
},
|
|
135
137
|
children: [slides.map((slide, index) => {
|
|
136
138
|
const isActive = index === currentIndex;
|
|
139
|
+
const isVideoSlide = slide.content.type === "VideoWidget";
|
|
137
140
|
const parsedOverlayIntensity = Number(String(overlayIntensity).replace("%", ""));
|
|
138
141
|
const overlayOpacity = (Number.isFinite(parsedOverlayIntensity) ? Math.min(100, Math.max(0, parsedOverlayIntensity)) : 70) / 100;
|
|
139
142
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
@@ -143,7 +146,10 @@ function CarouselWidget({ slides = [], autoScrollInterval = 6500, enableAutoScro
|
|
|
143
146
|
pointerEvents: isActive ? "auto" : "none"
|
|
144
147
|
},
|
|
145
148
|
"aria-hidden": !isActive,
|
|
146
|
-
children: [
|
|
149
|
+
children: [isVideoSlide ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
150
|
+
className: "absolute inset-0 h-full w-full",
|
|
151
|
+
children: isActive && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_MediaRenderer.MediaRenderer, { ...require_MediaRenderer.getMediaPropsFromWidgetSchema(slide.content) })
|
|
152
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
147
153
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
148
154
|
className: "absolute inset-0 h-full w-full",
|
|
149
155
|
style: {
|
|
@@ -162,89 +168,88 @@ function CarouselWidget({ slides = [], autoScrollInterval = 6500, enableAutoScro
|
|
|
162
168
|
overlayEnabled && !editorialFrame && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
163
169
|
className: `pointer-events-none absolute inset-0 ${overlayType === "gradient" ? "bg-gradient-to-t from-black to-transparent" : "bg-black"}`,
|
|
164
170
|
style: { opacity: overlayOpacity }
|
|
165
|
-
})
|
|
166
|
-
|
|
167
|
-
|
|
171
|
+
})
|
|
172
|
+
] }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
173
|
+
className: `pointer-events-none absolute inset-0 flex px-6 sm:px-10 ${verticalClass} ${align.horizontal === "center" ? "justify-center" : align.horizontal === "right" ? "justify-end" : "justify-start"}`,
|
|
174
|
+
style: {
|
|
175
|
+
paddingTop: padding * 4,
|
|
176
|
+
paddingBottom: padding * 4 + (totalSlides > 1 ? 24 + (isVideoSlide ? VIDEO_CONTROLS_HEIGHT : 0) : 0)
|
|
177
|
+
},
|
|
178
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
179
|
+
className: `${isVideoSlide ? "pointer-events-none" : "pointer-events-auto"} flex w-full flex-col gap-3 ${horizontalClass}`,
|
|
168
180
|
style: {
|
|
169
|
-
|
|
170
|
-
|
|
181
|
+
maxWidth: textWidth,
|
|
182
|
+
animation: isActive ? "fluidCarouselTextRise 450ms ease-out both" : void 0,
|
|
183
|
+
animationDelay: isActive ? "120ms" : void 0
|
|
171
184
|
},
|
|
172
|
-
children:
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
slide.
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
href: slide.buttonLink,
|
|
227
|
-
className: `inline-flex items-center gap-1.5 rounded-full bg-${buttonColor} text-${buttonColor}-foreground px-5 py-2.5 text-[13px] font-bold transition-transform hover:scale-[1.02] ${buttonSizeClass(buttonSize)}`,
|
|
228
|
-
style: { boxShadow: `0 8px 22px -8px color-mix(in oklch, var(--color-foreground) 35%, transparent)` },
|
|
229
|
-
children: [slide.buttonText, /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
230
|
-
"aria-hidden": "true",
|
|
231
|
-
className: "text-[14px]",
|
|
232
|
-
children: "→"
|
|
233
|
-
})]
|
|
234
|
-
}), showSecondary && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("a", {
|
|
235
|
-
href: slide.secondaryButtonLink,
|
|
236
|
-
className: `inline-flex items-center gap-1 text-${headerColor}/80 hover:text-${headerColor} text-[12px] font-bold transition-colors`,
|
|
237
|
-
children: [slide.secondaryButtonText, /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
238
|
-
"aria-hidden": "true",
|
|
239
|
-
children: "→"
|
|
240
|
-
})]
|
|
185
|
+
children: [
|
|
186
|
+
(slide.eyebrow || slide.tag || slide.meta) && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
187
|
+
className: `flex flex-wrap items-center gap-2 ${align.horizontal === "center" ? "justify-center" : align.horizontal === "right" ? "justify-end" : "justify-start"}`,
|
|
188
|
+
children: [
|
|
189
|
+
slide.tag && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
190
|
+
className: `rounded-full bg-${slide.tagColor ?? "background"} text-${slide.tagColor ?? "background"}-foreground px-2.5 py-1 text-[10px] font-bold tracking-[0.14em] uppercase`,
|
|
191
|
+
style: slide.tagColor === "background" || slide.tagColor === "foreground" || !slide.tagColor ? tagFallbackStyle(slide.tagColor, frameColor) : void 0,
|
|
192
|
+
children: slide.tag
|
|
193
|
+
}),
|
|
194
|
+
slide.eyebrow && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
195
|
+
className: `text-${headerColor}/70 text-[10px] font-bold tracking-[0.16em] uppercase`,
|
|
196
|
+
children: slide.eyebrow
|
|
197
|
+
}),
|
|
198
|
+
slide.meta && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
199
|
+
className: `text-${headerColor}/60 text-[10px] font-bold tracking-[0.16em] uppercase`,
|
|
200
|
+
children: slide.meta
|
|
201
|
+
})
|
|
202
|
+
]
|
|
203
|
+
}),
|
|
204
|
+
slide.title && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("h2", {
|
|
205
|
+
className: `text-${headerColor} font-bold ${HEADER_SIZE_MAP[headerSize]} leading-[1.12] tracking-[-0.018em]`,
|
|
206
|
+
children: slide.title
|
|
207
|
+
}),
|
|
208
|
+
slide.description && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
209
|
+
className: `text-${textColor}/70 ${BODY_SIZE_MAP[textSize]} leading-[1.55]`,
|
|
210
|
+
dangerouslySetInnerHTML: { __html: require_purify_es.purify.sanitize(slide.description, {
|
|
211
|
+
ALLOWED_TAGS: [
|
|
212
|
+
"br",
|
|
213
|
+
"strong",
|
|
214
|
+
"em",
|
|
215
|
+
"b",
|
|
216
|
+
"i",
|
|
217
|
+
"ul",
|
|
218
|
+
"ol",
|
|
219
|
+
"li",
|
|
220
|
+
"p"
|
|
221
|
+
],
|
|
222
|
+
ALLOWED_ATTR: []
|
|
223
|
+
}) }
|
|
224
|
+
}),
|
|
225
|
+
(() => {
|
|
226
|
+
const showPrimary = slide.buttonEnabled && showButton && Boolean(slide.buttonText) && Boolean(slide.buttonLink);
|
|
227
|
+
const showSecondary = Boolean(slide.secondaryButtonText) && Boolean(slide.secondaryButtonLink);
|
|
228
|
+
if (!showPrimary && !showSecondary) return null;
|
|
229
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
230
|
+
className: `mt-3 flex flex-wrap items-center gap-3 ${align.horizontal === "center" ? "justify-center" : align.horizontal === "right" ? "justify-end" : "justify-start"}`,
|
|
231
|
+
children: [showPrimary && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("a", {
|
|
232
|
+
href: slide.buttonLink,
|
|
233
|
+
className: `inline-flex items-center gap-1.5 rounded-full bg-${buttonColor} text-${buttonColor}-foreground px-5 py-2.5 text-[13px] font-bold transition-transform hover:scale-[1.02] ${buttonSizeClass(buttonSize)}`,
|
|
234
|
+
style: { boxShadow: `0 8px 22px -8px color-mix(in oklch, var(--color-foreground) 35%, transparent)` },
|
|
235
|
+
children: [slide.buttonText, /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
236
|
+
"aria-hidden": "true",
|
|
237
|
+
className: "text-[14px]",
|
|
238
|
+
children: "→"
|
|
241
239
|
})]
|
|
242
|
-
})
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
240
|
+
}), showSecondary && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("a", {
|
|
241
|
+
href: slide.secondaryButtonLink,
|
|
242
|
+
className: `inline-flex items-center gap-1 text-${headerColor}/80 hover:text-${headerColor} text-[12px] font-bold transition-colors`,
|
|
243
|
+
children: [slide.secondaryButtonText, /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
244
|
+
"aria-hidden": "true",
|
|
245
|
+
children: "→"
|
|
246
|
+
})]
|
|
247
|
+
})]
|
|
248
|
+
});
|
|
249
|
+
})()
|
|
250
|
+
]
|
|
251
|
+
}, `content-${currentIndex}`)
|
|
252
|
+
})]
|
|
248
253
|
}, slide.id);
|
|
249
254
|
}), totalSlides > 1 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
250
255
|
className: "pointer-events-none absolute inset-0 z-20",
|
|
@@ -268,7 +273,11 @@ function CarouselWidget({ slides = [], autoScrollInterval = 6500, enableAutoScro
|
|
|
268
273
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ChevronRightIcon, {})
|
|
269
274
|
})]
|
|
270
275
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
271
|
-
className:
|
|
276
|
+
className: `pointer-events-auto absolute inset-x-0 flex items-center gap-1 px-6 pb-2 sm:px-10`,
|
|
277
|
+
style: {
|
|
278
|
+
bottom: isActiveSlideVideo ? VIDEO_CONTROLS_HEIGHT : 0,
|
|
279
|
+
transition: "bottom 200ms ease-out"
|
|
280
|
+
},
|
|
272
281
|
children: slides.map((_, i) => {
|
|
273
282
|
const state = i < currentIndex ? "done" : i === currentIndex ? "active" : "upcoming";
|
|
274
283
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
@@ -717,4 +726,4 @@ Object.defineProperty(exports, "carouselWidgetPropertySchema", {
|
|
|
717
726
|
}
|
|
718
727
|
});
|
|
719
728
|
|
|
720
|
-
//# sourceMappingURL=CarouselWidget-
|
|
729
|
+
//# sourceMappingURL=CarouselWidget-Cu1b3ERq.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CarouselWidget-Cu1b3ERq.cjs","names":["borderWidthClasses","borderColorClasses","MediaRenderer","getMediaPropsFromWidgetSchema","DOMPurify","getColorField","getFontSizeField","getHeightField","getBorderRadiusField","getBorderWidthField","getBorderColorField","getPaddingField","getButtonSizeField"],"sources":["../../widgets/src/widgets/CarouselWidget.tsx"],"sourcesContent":["import type { ComponentProps, CSSProperties } from \"react\";\nimport type React from \"react\";\nimport { useEffect, useState, useCallback } from \"react\";\nimport DOMPurify from \"dompurify\";\nimport {\n MediaRenderer,\n getMediaPropsFromWidgetSchema,\n} from \"../components/MediaRenderer\";\nimport type {\n WidgetSchema,\n BorderRadiusOptions,\n BorderWidthOptions,\n ColorOptions,\n AlignOptions,\n FontSizeOptions,\n PaddingOptions,\n ButtonSizeOptions,\n} from \"@fluid-app/portal-core/types\";\nimport type { WidgetPropertySchema } from \"@fluid-app/portal-core/registries\";\nimport {\n borderColorClasses,\n borderWidthClasses,\n getBorderColorField,\n getBorderRadiusField,\n getBorderWidthField,\n getButtonSizeField,\n getColorField,\n getFontSizeField,\n getHeightField,\n getPaddingField,\n} from \"../core/fields\";\n\ntype CarouselSlide = {\n id: string;\n content: WidgetSchema;\n title?: string;\n description?: string;\n // Editorial additions (all optional — existing configs keep working)\n eyebrow?: string;\n meta?: string;\n tag?: string;\n tagColor?: ColorOptions;\n buttonEnabled?: boolean;\n buttonText?: string;\n buttonVariant?:\n | \"default\"\n | \"secondary\"\n | \"outline\"\n | \"destructive\"\n | \"ghost\"\n | \"link\";\n buttonLink?: string;\n secondaryButtonText?: string;\n secondaryButtonLink?: string;\n};\n\ntype CarouselWidgetProps = ComponentProps<\"div\"> & {\n slides?: CarouselSlide[];\n autoScrollInterval?: number;\n enableAutoScroll?: boolean;\n\n // Layout\n align?: AlignOptions;\n // CSS-unit string (\"400px\", \"30rem\", \"50%\") — kept as string so saved\n // configs from the previous schema continue to render. The schema field\n // is `cssUnit` (via getHeightField), which produces a string with the\n // unit baked in.\n carouselHeight?: string;\n borderRadius?: BorderRadiusOptions;\n borderWidth?: BorderWidthOptions;\n borderColor?: ColorOptions;\n padding?: PaddingOptions;\n\n // Text Styling\n headerSize?: FontSizeOptions;\n headerColor?: ColorOptions;\n textSize?: FontSizeOptions;\n textColor?: ColorOptions;\n textWidth?: string;\n\n // Button\n showButton?: boolean;\n buttonColor?: ColorOptions;\n buttonSize?: ButtonSizeOptions;\n\n // Overlay\n overlayEnabled?: boolean;\n overlayType?: \"solid\" | \"gradient\";\n overlayIntensity?: number;\n\n // Editorial frame (new — opt-out via `editorialFrame={false}`)\n editorialFrame?: boolean;\n frameColor?: ColorOptions;\n};\n\nconst VIDEO_CONTROLS_HEIGHT = 44;\n\nconst HEADER_SIZE_MAP: Record<FontSizeOptions, string> = {\n xs: \"text-base sm:text-lg\",\n sm: \"text-lg sm:text-xl\",\n md: \"text-xl sm:text-2xl\",\n lg: \"text-2xl sm:text-3xl\",\n xl: \"text-3xl sm:text-[32px]\",\n \"2xl\": \"text-[32px] sm:text-[40px]\",\n};\n\nconst BODY_SIZE_MAP: Record<FontSizeOptions, string> = {\n xs: \"text-[12px]\",\n sm: \"text-[13px]\",\n md: \"text-[14px]\",\n lg: \"text-[15px]\",\n xl: \"text-[16px]\",\n \"2xl\": \"text-[18px]\",\n};\n\nfunction useCarouselController({\n slideCount,\n enableAutoScroll,\n autoScrollInterval,\n}: {\n slideCount: number;\n enableAutoScroll: boolean;\n autoScrollInterval: number;\n}) {\n const [currentIndex, setCurrentIndex] = useState(0);\n // Track hover and keyboard focus separately — combining them in one boolean\n // would let `onMouseLeave` clear the paused state even while a child button\n // still has focus.\n const [isHovered, setIsHovered] = useState(false);\n const [isFocused, setIsFocused] = useState(false);\n const hasSlides = slideCount > 0;\n const isPaused = isHovered || isFocused;\n\n const goToNext = useCallback(() => {\n if (!hasSlides) return;\n setCurrentIndex((prev) => (prev === slideCount - 1 ? 0 : prev + 1));\n }, [hasSlides, slideCount]);\n\n const goToPrevious = useCallback(() => {\n if (!hasSlides) return;\n setCurrentIndex((prev) => (prev === 0 ? slideCount - 1 : prev - 1));\n }, [hasSlides, slideCount]);\n\n const goToSlide = useCallback(\n (index: number) => {\n if (!hasSlides) return;\n if (index >= 0 && index < slideCount) {\n setCurrentIndex(index);\n }\n },\n [hasSlides, slideCount],\n );\n\n useEffect(() => {\n if (!enableAutoScroll || !hasSlides || isPaused) return;\n const intervalId = setInterval(goToNext, autoScrollInterval);\n return () => clearInterval(intervalId);\n }, [enableAutoScroll, autoScrollInterval, hasSlides, isPaused, goToNext]);\n\n useEffect(() => {\n if (currentIndex >= slideCount && slideCount > 0) {\n setCurrentIndex(0);\n }\n }, [slideCount, currentIndex]);\n\n const handleMouseEnter = useCallback(() => setIsHovered(true), []);\n const handleMouseLeave = useCallback(() => setIsHovered(false), []);\n const handleFocus = useCallback(() => setIsFocused(true), []);\n const handleBlur = useCallback((e: React.FocusEvent<HTMLElement>) => {\n // Only flip to unfocused when focus actually leaves the carousel.\n // When focus moves between two children (e.g. tabbing from prev to next\n // button), `relatedTarget` is the new focus target and is still contained.\n if (!e.currentTarget.contains(e.relatedTarget as Node | null)) {\n setIsFocused(false);\n }\n }, []);\n\n return {\n currentIndex,\n hasSlides,\n isPaused,\n goToNext,\n goToPrevious,\n goToSlide,\n handleMouseEnter,\n handleMouseLeave,\n handleFocus,\n handleBlur,\n };\n}\n\nexport function CarouselWidget({\n slides = [],\n autoScrollInterval = 6500,\n enableAutoScroll = false,\n carouselHeight = \"400px\",\n align = { vertical: \"bottom\", horizontal: \"left\" },\n overlayIntensity = 70,\n borderRadius = \"xl\",\n borderWidth = \"none\",\n borderColor = \"muted\",\n padding = 8,\n textWidth = \"620px\",\n headerSize = \"xl\",\n headerColor = \"background\",\n textSize = \"md\",\n textColor = \"background\",\n showButton = true,\n buttonColor = \"background\",\n buttonSize = \"default\",\n overlayEnabled = true,\n overlayType = \"gradient\",\n editorialFrame = true,\n frameColor = \"foreground\",\n className,\n ...props\n}: CarouselWidgetProps): React.JSX.Element {\n const totalSlides = slides.length;\n const {\n currentIndex,\n hasSlides,\n isPaused,\n goToNext,\n goToPrevious,\n goToSlide,\n handleMouseEnter,\n handleMouseLeave,\n handleFocus,\n handleBlur,\n } = useCarouselController({\n slideCount: totalSlides,\n enableAutoScroll,\n autoScrollInterval,\n });\n const verticalClass =\n align.vertical === \"top\"\n ? \"items-start\"\n : align.vertical === \"center\"\n ? \"items-center\"\n : \"items-end\";\n\n const horizontalClass =\n align.horizontal === \"center\"\n ? \"justify-center text-center mx-auto\"\n : align.horizontal === \"right\"\n ? \"justify-end ml-auto text-right\"\n : \"justify-start text-left\";\n\n // Themed dual-shadow (crisp + soft ambient) on the editorial frame —\n // derived from the foreground token so the lift reads in both light\n // and dark themes.\n const frameShadowStyle: CSSProperties | undefined = editorialFrame\n ? {\n boxShadow: `0 1px 2px color-mix(in oklch, var(--color-foreground) 4%, transparent), 0 30px 60px -30px color-mix(in oklch, var(--color-foreground) 40%, transparent)`,\n }\n : undefined;\n\n const frameBg = editorialFrame ? `bg-${frameColor}` : \"\";\n const isActiveSlideVideo =\n slides[currentIndex]?.content.type === \"VideoWidget\";\n\n if (!hasSlides) {\n return (\n <div\n className={`relative w-full overflow-hidden rounded-${borderRadius} ${borderWidthClasses[borderWidth]} ${borderWidth !== \"none\" ? borderColorClasses[borderColor] : \"\"} ${frameBg} ${className ?? \"\"}`}\n style={{ minHeight: carouselHeight, ...frameShadowStyle }}\n {...props}\n >\n <div\n className=\"bg-muted/20 flex h-full w-full items-center justify-center\"\n style={{ minHeight: carouselHeight }}\n >\n <div className=\"text-muted-foreground flex flex-col items-center gap-2\">\n <div className=\"text-4xl\">🎠</div>\n <p className=\"text-sm\">No slides added</p>\n <p className=\"text-muted-foreground/70 text-xs\">\n Add slides to create a carousel\n </p>\n </div>\n </div>\n </div>\n );\n }\n\n return (\n <div\n className={`relative isolate w-full overflow-hidden rounded-${borderRadius} ${borderWidthClasses[borderWidth]} ${borderWidth !== \"none\" ? borderColorClasses[borderColor] : \"\"} ${frameBg} ${className ?? \"\"}`}\n style={{ minHeight: carouselHeight, ...frameShadowStyle }}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n onFocus={handleFocus}\n onBlur={handleBlur}\n {...props}\n >\n <div\n className=\"relative w-full\"\n style={{\n minHeight: carouselHeight,\n height: carouselHeight,\n }}\n >\n {slides.map((slide, index) => {\n const isActive = index === currentIndex;\n const isVideoSlide = slide.content.type === \"VideoWidget\";\n // Strip the optional \"%\" suffix, then parse. Use Number.isFinite +\n // clamp so an explicit 0 isn't silently replaced by the 70 fallback\n // (the previous `|| 70` treated 0 as falsy).\n const parsedOverlayIntensity = Number(\n String(overlayIntensity).replace(\"%\", \"\"),\n );\n const overlayOpacity =\n (Number.isFinite(parsedOverlayIntensity)\n ? Math.min(100, Math.max(0, parsedOverlayIntensity))\n : 70) / 100;\n\n return (\n <div\n key={slide.id}\n className=\"absolute inset-0 transition-opacity duration-700 ease-out\"\n style={{\n opacity: isActive ? 1 : 0,\n pointerEvents: isActive ? \"auto\" : \"none\",\n }}\n aria-hidden={!isActive}\n >\n {isVideoSlide ? (\n <div className=\"absolute inset-0 h-full w-full\">\n {isActive && (\n <MediaRenderer\n {...getMediaPropsFromWidgetSchema(slide.content)}\n />\n )}\n </div>\n ) : (\n <>\n <div\n className=\"absolute inset-0 h-full w-full\"\n style={{\n transform: isActive ? \"scale(1)\" : \"scale(1.04)\",\n animation: isActive\n ? \"fluidCarouselKenBurns 900ms ease-out both\"\n : undefined,\n }}\n >\n <MediaRenderer\n {...getMediaPropsFromWidgetSchema(slide.content)}\n />\n </div>\n\n {overlayEnabled && editorialFrame && (\n <>\n <div\n className={`pointer-events-none absolute inset-0 bg-gradient-to-t from-${frameColor} via-${frameColor}/65 to-${frameColor}/10`}\n style={{ opacity: overlayOpacity }}\n />\n <div\n className={`pointer-events-none absolute inset-0 bg-gradient-to-r from-${frameColor}/80 via-transparent to-transparent`}\n style={{ opacity: Math.min(1, overlayOpacity + 0.1) }}\n />\n </>\n )}\n\n {overlayEnabled && !editorialFrame && (\n <div\n className={`pointer-events-none absolute inset-0 ${\n overlayType === \"gradient\"\n ? \"bg-gradient-to-t from-black to-transparent\"\n : \"bg-black\"\n }`}\n style={{ opacity: overlayOpacity }}\n />\n )}\n </>\n )}\n\n <div\n className={`pointer-events-none absolute inset-0 flex px-6 sm:px-10 ${verticalClass} ${\n align.horizontal === \"center\"\n ? \"justify-center\"\n : align.horizontal === \"right\"\n ? \"justify-end\"\n : \"justify-start\"\n }`}\n style={{\n paddingTop: padding * 4,\n paddingBottom:\n padding * 4 +\n (totalSlides > 1\n ? 24 + (isVideoSlide ? VIDEO_CONTROLS_HEIGHT : 0)\n : 0),\n }}\n >\n <div\n key={`content-${currentIndex}`}\n className={`${isVideoSlide ? \"pointer-events-none\" : \"pointer-events-auto\"} flex w-full flex-col gap-3 ${horizontalClass}`}\n style={{\n maxWidth: textWidth,\n animation: isActive\n ? \"fluidCarouselTextRise 450ms ease-out both\"\n : undefined,\n animationDelay: isActive ? \"120ms\" : undefined,\n }}\n >\n {(slide.eyebrow || slide.tag || slide.meta) && (\n <div\n className={`flex flex-wrap items-center gap-2 ${\n align.horizontal === \"center\"\n ? \"justify-center\"\n : align.horizontal === \"right\"\n ? \"justify-end\"\n : \"justify-start\"\n }`}\n >\n {slide.tag && (\n <span\n className={`rounded-full bg-${slide.tagColor ?? \"background\"} text-${slide.tagColor ?? \"background\"}-foreground px-2.5 py-1 text-[10px] font-bold tracking-[0.14em] uppercase`}\n style={\n slide.tagColor === \"background\" ||\n slide.tagColor === \"foreground\" ||\n !slide.tagColor\n ? tagFallbackStyle(slide.tagColor, frameColor)\n : undefined\n }\n >\n {slide.tag}\n </span>\n )}\n {slide.eyebrow && (\n <span\n className={`text-${headerColor}/70 text-[10px] font-bold tracking-[0.16em] uppercase`}\n >\n {slide.eyebrow}\n </span>\n )}\n {slide.meta && (\n <span\n className={`text-${headerColor}/60 text-[10px] font-bold tracking-[0.16em] uppercase`}\n >\n {slide.meta}\n </span>\n )}\n </div>\n )}\n\n {slide.title && (\n <h2\n className={`text-${headerColor} font-bold ${HEADER_SIZE_MAP[headerSize]} leading-[1.12] tracking-[-0.018em]`}\n >\n {slide.title}\n </h2>\n )}\n\n {slide.description && (\n // Description supports inline HTML for emphasis / line\n // breaks / lists. Sanitized via DOMPurify with the same\n // allowlist as the previous implementation so saved\n // slides containing <strong>, <em>, <br>, <ul>, etc.\n // continue rendering as authored. Element is a <div>\n // (not <p>) to permit block-level allowed tags.\n <div\n className={`text-${textColor}/70 ${BODY_SIZE_MAP[textSize]} leading-[1.55]`}\n dangerouslySetInnerHTML={{\n __html: DOMPurify.sanitize(slide.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\n {(() => {\n const showPrimary =\n slide.buttonEnabled &&\n showButton &&\n Boolean(slide.buttonText) &&\n Boolean(slide.buttonLink);\n const showSecondary =\n Boolean(slide.secondaryButtonText) &&\n Boolean(slide.secondaryButtonLink);\n if (!showPrimary && !showSecondary) return null;\n\n return (\n <div\n className={`mt-3 flex flex-wrap items-center gap-3 ${\n align.horizontal === \"center\"\n ? \"justify-center\"\n : align.horizontal === \"right\"\n ? \"justify-end\"\n : \"justify-start\"\n }`}\n >\n {showPrimary && (\n <a\n href={slide.buttonLink}\n className={`inline-flex items-center gap-1.5 rounded-full bg-${buttonColor} text-${buttonColor}-foreground px-5 py-2.5 text-[13px] font-bold transition-transform hover:scale-[1.02] ${buttonSizeClass(buttonSize)}`}\n style={{\n boxShadow: `0 8px 22px -8px color-mix(in oklch, var(--color-foreground) 35%, transparent)`,\n }}\n >\n {slide.buttonText}\n <span aria-hidden=\"true\" className=\"text-[14px]\">\n →\n </span>\n </a>\n )}\n {showSecondary && (\n <a\n href={slide.secondaryButtonLink}\n className={`inline-flex items-center gap-1 text-${headerColor}/80 hover:text-${headerColor} text-[12px] font-bold transition-colors`}\n >\n {slide.secondaryButtonText}\n <span aria-hidden=\"true\">→</span>\n </a>\n )}\n </div>\n );\n })()}\n </div>\n </div>\n </div>\n );\n })}\n\n {totalSlides > 1 && (\n <div className=\"pointer-events-none absolute inset-0 z-20\">\n <div className=\"pointer-events-auto absolute top-6 right-6 flex items-center gap-1.5\">\n <button\n type=\"button\"\n onClick={goToPrevious}\n aria-label=\"Previous slide\"\n className={`flex size-10 items-center justify-center rounded-full bg-${headerColor}/10 text-${headerColor} ring-1 ring-${headerColor}/15 backdrop-blur-sm transition-colors hover:bg-${headerColor}/20`}\n >\n <ChevronLeftIcon />\n </button>\n <button\n type=\"button\"\n onClick={goToNext}\n aria-label=\"Next slide\"\n className={`flex size-10 items-center justify-center rounded-full bg-${headerColor} text-${headerColor}-foreground transition-transform hover:scale-[1.04]`}\n style={{\n // Themed lift shadow (was hardcoded white) so the active\n // nav button reads on both light and dark frames.\n boxShadow: `0 4px 14px -4px color-mix(in oklch, var(--color-${headerColor}) 45%, transparent)`,\n ...nextButtonFallbackStyle(headerColor, frameColor),\n }}\n >\n <ChevronRightIcon />\n </button>\n </div>\n\n <div\n className={`pointer-events-auto absolute inset-x-0 flex items-center gap-1 px-6 pb-2 sm:px-10`}\n style={{\n bottom: isActiveSlideVideo ? VIDEO_CONTROLS_HEIGHT : 0,\n transition: \"bottom 200ms ease-out\",\n }}\n >\n {slides.map((_, i) => {\n const state =\n i < currentIndex\n ? \"done\"\n : i === currentIndex\n ? \"active\"\n : \"upcoming\";\n return (\n <button\n key={`progress-${i}`}\n type=\"button\"\n onClick={() => goToSlide(i)}\n aria-label={`Go to slide ${i + 1}`}\n aria-current={state === \"active\" ? \"true\" : \"false\"}\n className=\"group flex-1 py-2\"\n >\n <span\n className={`block h-[2px] w-full overflow-hidden rounded-full bg-${headerColor}/20`}\n >\n <span\n key={`fill-${i}-${currentIndex}`}\n className={`block h-full rounded-full bg-${headerColor}`}\n style={progressFillStyle(\n state,\n enableAutoScroll,\n autoScrollInterval,\n isPaused,\n )}\n />\n </span>\n </button>\n );\n })}\n </div>\n </div>\n )}\n </div>\n </div>\n );\n}\n\nfunction progressFillStyle(\n state: \"done\" | \"active\" | \"upcoming\",\n autoScroll: boolean,\n duration: number,\n paused: boolean,\n): CSSProperties {\n if (state === \"done\") return { width: \"100%\" };\n if (state === \"upcoming\") return { width: \"0%\" };\n if (autoScroll) {\n return {\n width: \"0%\",\n animation: `fluidCarouselProgressFill ${duration}ms linear forwards`,\n animationPlayState: paused ? \"paused\" : \"running\",\n };\n }\n return { width: \"100%\" };\n}\n\nfunction tagFallbackStyle(\n tagColor: ColorOptions | undefined,\n frameColor: ColorOptions,\n): CSSProperties | undefined {\n // bg-background/foreground don't emit -foreground utilities by default;\n // fall back to contrast-safe inline colors so tag chips always read.\n if (!tagColor || tagColor === \"background\") {\n return { color: `var(--color-${frameColor})` };\n }\n if (tagColor === \"foreground\") {\n return { color: `var(--color-background)` };\n }\n return undefined;\n}\n\nfunction nextButtonFallbackStyle(\n headerColor: ColorOptions,\n frameColor: ColorOptions,\n): CSSProperties | undefined {\n // Same contrast fix as tags — ensure icon color reads on the active button.\n if (headerColor === \"background\") {\n return { color: `var(--color-${frameColor})` };\n }\n if (headerColor === \"foreground\") {\n return { color: `var(--color-background)` };\n }\n return undefined;\n}\n\nfunction buttonSizeClass(size: ButtonSizeOptions): string {\n if (size === \"sm\") return \"px-4 py-1.5 text-[12px]\";\n if (size === \"lg\") return \"px-6 py-3 text-[14px]\";\n if (size === \"xl\") return \"px-7 py-3.5 text-[15px]\";\n return \"\";\n}\n\nfunction ChevronLeftIcon() {\n return (\n <svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"M15 18l-6-6 6-6\" />\n </svg>\n );\n}\n\nfunction ChevronRightIcon() {\n return (\n <svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"M9 18l6-6-6-6\" />\n </svg>\n );\n}\n\nexport const carouselWidgetPropertySchema: WidgetPropertySchema = {\n widgetType: \"CarouselWidget\",\n displayName: \"Carousel\",\n tabsConfig: [\n { id: \"styling\", label: \"Styling\" },\n { id: \"behavior\", label: \"Behavior\" },\n { id: \"data\", label: \"Data\" },\n ],\n dataSourceTargetProps: [\"slides\"],\n fields: [\n // Styling tab — Frame group (new)\n {\n key: \"editorialFrame\",\n label: \"Editorial Frame\",\n type: \"boolean\",\n description:\n \"Premium dark canvas with layered shadow and gradient stack. Turn off for a classic transparent carousel.\",\n defaultValue: true,\n tab: \"styling\",\n group: \"Frame\",\n },\n getColorField({\n defaultValue: \"foreground\",\n key: \"frameColor\",\n label: \"Frame Color\",\n description:\n \"Surface color of the carousel canvas. Drives the frame and gradient overlay.\",\n tab: \"styling\",\n group: \"Frame\",\n requiresKeyToBeTrue: \"editorialFrame\",\n }),\n\n // Text Styling group\n getFontSizeField({\n defaultValue: \"xl\",\n key: \"headerSize\",\n label: \"Header Font Size\",\n description: \"Font size for the slide header\",\n tab: \"styling\",\n group: \"Text Styling\",\n }),\n getColorField({\n defaultValue: \"background\",\n key: \"headerColor\",\n label: \"Header Color\",\n description:\n \"Headline color. Also drives eyebrow, controls and progress bar.\",\n tab: \"styling\",\n group: \"Text Styling\",\n }),\n {\n key: \"separator\",\n type: \"separator\",\n label: \"Separator\",\n tab: \"styling\",\n group: \"Text Styling\",\n },\n getFontSizeField({\n defaultValue: \"md\",\n key: \"textSize\",\n label: \"Text Font Size\",\n description: \"Font size for the slide text\",\n tab: \"styling\",\n group: \"Text Styling\",\n }),\n getColorField({\n defaultValue: \"background\",\n key: \"textColor\",\n label: \"Text Color\",\n description: \"Color variant for the slide text\",\n tab: \"styling\",\n group: \"Text Styling\",\n }),\n\n // Layout group\n {\n key: \"align\",\n label: \"Alignment\",\n type: \"alignment\",\n description: \"Alignment of the carousel content\",\n defaultValue: { vertical: \"bottom\", horizontal: \"left\" },\n options: {\n verticalEnabled: true,\n horizontalEnabled: true,\n },\n tab: \"styling\",\n group: \"Layout\",\n },\n {\n key: \"textWidth\",\n label: \"Content Width\",\n type: \"cssUnit\",\n description: \"Maximum width for slide content\",\n defaultValue: \"620px\",\n allowedUnits: [\"px\", \"rem\", \"%\"],\n defaultUnit: \"px\",\n minByUnit: { px: 50, rem: 3, \"%\": 10 },\n maxByUnit: { px: 1200, rem: 75, \"%\": 100 },\n stepByUnit: { px: 10, rem: 1, \"%\": 1 },\n tab: \"styling\",\n group: \"Layout\",\n },\n\n // Design group\n getHeightField({\n key: \"carouselHeight\",\n label: \"Carousel Height\",\n description: \"Height of the carousel\",\n defaultValue: \"400px\",\n tab: \"styling\",\n group: \"Design\",\n }),\n {\n key: \"separator2\",\n type: \"separator\",\n label: \"Separator\",\n tab: \"styling\",\n group: \"Design\",\n },\n getBorderRadiusField({\n defaultValue: \"xl\",\n key: \"borderRadius\",\n label: \"Border Radius\",\n description: \"Rounded corners for the carousel\",\n tab: \"styling\",\n group: \"Design\",\n }),\n getBorderWidthField({\n key: \"borderWidth\",\n label: \"Border Width\",\n description: \"Border width for the carousel container\",\n defaultValue: \"none\",\n tab: \"styling\",\n group: \"Design\",\n }),\n getBorderColorField({\n key: \"borderColor\",\n label: \"Border Color\",\n description: \"Border color for the carousel container\",\n defaultValue: \"muted\",\n tab: \"styling\",\n group: \"Design\",\n }),\n getPaddingField({\n defaultValue: 8,\n key: \"padding\",\n label: \"Padding\",\n description: \"Inner padding around slide content\",\n tab: \"styling\",\n group: \"Design\",\n }),\n {\n key: \"overlayEnabled\",\n label: \"Enable Overlay\",\n type: \"boolean\",\n description: \"Add background overlay to slide content\",\n defaultValue: true,\n tab: \"styling\",\n group: \"Design\",\n },\n {\n key: \"overlayType\",\n label: \"Overlay Type\",\n type: \"buttonGroup\",\n description: \"Overlay style (only applies when editorial frame is off)\",\n defaultValue: \"gradient\",\n options: [\n { label: \"Solid\", value: \"solid\" },\n { label: \"Gradient\", value: \"gradient\" },\n ],\n tab: \"styling\",\n group: \"Design\",\n requiresKeyToBeTrue: \"overlayEnabled\",\n },\n {\n key: \"overlayIntensity\",\n label: \"Overlay Intensity\",\n type: \"slider\",\n description: \"Opacity of the overlay (0-100)\",\n min: 0,\n max: 100,\n step: 5,\n defaultValue: 70,\n unit: \"%\",\n tab: \"styling\",\n group: \"Design\",\n requiresKeyToBeTrue: \"overlayEnabled\",\n },\n {\n key: \"showButton\",\n label: \"Show Primary Button\",\n type: \"boolean\",\n description: \"Display the primary CTA in slide content\",\n defaultValue: true,\n tab: \"styling\",\n group: \"Design\",\n },\n getColorField({\n defaultValue: \"background\",\n key: \"buttonColor\",\n label: \"Button Color\",\n description: \"Color variant for the slide button\",\n tab: \"styling\",\n group: \"Design\",\n requiresKeyToBeTrue: \"showButton\",\n }),\n getButtonSizeField({\n defaultValue: \"default\",\n key: \"buttonSize\",\n label: \"Button Size\",\n description: \"Size of the slide button\",\n tab: \"styling\",\n group: \"Design\",\n requiresKeyToBeTrue: \"showButton\",\n }),\n\n // Behavior tab\n {\n key: \"enableAutoScroll\",\n label: \"Enable Auto-Scroll\",\n type: \"boolean\",\n description:\n \"Automatically advance to the next slide. Progress bar fills at this rate and pauses on hover.\",\n defaultValue: false,\n tab: \"behavior\",\n group: \"Auto-Scroll\",\n },\n {\n key: \"autoScrollInterval\",\n label: \"Auto-Scroll Interval (ms)\",\n type: \"number\",\n description: \"Time between automatic slide transitions\",\n min: 1000,\n max: 15000,\n step: 500,\n defaultValue: 6500,\n tab: \"behavior\",\n group: \"Auto-Scroll\",\n requiresKeyToBeTrue: \"enableAutoScroll\",\n },\n\n // Data tab\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 slide\",\n fields: [\n {\n key: \"eyebrow\",\n label: \"Eyebrow\",\n type: \"text\",\n description:\n \"Short label above the title (e.g. 'From Fluid · Newsroom')\",\n },\n {\n key: \"tag\",\n label: \"Tag / Category\",\n type: \"text\",\n description: \"Short pill label (e.g. 'Policy', 'New release')\",\n },\n {\n key: \"tagColor\",\n label: \"Tag Color\",\n type: \"colorSelect\",\n description: \"Background color of the tag pill\",\n defaultValue: \"background\",\n },\n {\n key: \"meta\",\n label: \"Meta\",\n type: \"text\",\n description: \"Meta line (e.g. 'Apr 12 · 4 min read')\",\n },\n {\n key: \"separator_slide_1\",\n type: \"separator\",\n label: \"Separator\",\n },\n {\n key: \"title\",\n label: \"Title\",\n type: \"text\",\n description: \"Override the item's title for this slide\",\n },\n {\n key: \"description\",\n label: \"Description\",\n type: \"textarea\",\n description: \"Override the item's description for this slide\",\n rows: 3,\n },\n {\n key: \"separator_slide_2\",\n type: \"separator\",\n label: \"Separator\",\n },\n {\n key: \"buttonEnabled\",\n label: \"Show Primary Button\",\n type: \"boolean\",\n description: \"Show the primary CTA on this slide\",\n defaultValue: false,\n },\n {\n key: \"buttonText\",\n label: \"Button Text\",\n type: \"text\",\n description: \"Text for the primary button\",\n requiresKeyToBeTrue: \"buttonEnabled\",\n },\n {\n key: \"buttonLink\",\n label: \"Button Link\",\n type: \"text\",\n description: \"URL for the primary button\",\n requiresKeyToBeTrue: \"buttonEnabled\",\n },\n {\n key: \"secondaryButtonText\",\n label: \"Secondary Link Text\",\n type: \"text\",\n description:\n \"Optional text-only secondary link (renders with an arrow)\",\n },\n {\n key: \"secondaryButtonLink\",\n label: \"Secondary Link URL\",\n type: \"text\",\n description: \"URL for the secondary link\",\n },\n ],\n },\n} as const satisfies WidgetPropertySchema;\n"],"mappings":";;;;;;;;;;;AA+FA,MAAM,wBAAwB;AAE9B,MAAM,kBAAmD;CACvD,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,OAAO;CACR;AAED,MAAM,gBAAiD;CACrD,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,OAAO;CACR;AAED,SAAS,sBAAsB,EAC7B,YACA,kBACA,sBAKC;CACD,MAAM,CAAC,cAAc,oBAAA,GAAA,MAAA,UAA4B,EAAE;CAInD,MAAM,CAAC,WAAW,iBAAA,GAAA,MAAA,UAAyB,MAAM;CACjD,MAAM,CAAC,WAAW,iBAAA,GAAA,MAAA,UAAyB,MAAM;CACjD,MAAM,YAAY,aAAa;CAC/B,MAAM,WAAW,aAAa;CAE9B,MAAM,YAAA,GAAA,MAAA,mBAA6B;AACjC,MAAI,CAAC,UAAW;AAChB,mBAAiB,SAAU,SAAS,aAAa,IAAI,IAAI,OAAO,EAAG;IAClE,CAAC,WAAW,WAAW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b,cAAc;GACd,KAAK;GACL,OAAO;GACR;EACDN,mBAAAA,cAAc;GACZ,cAAc;GACd,KAAK;GACL,OAAO;GACP,aAAa;GACb,KAAK;GACL,OAAO;GACP,qBAAqB;GACtB,CAAC;EACFO,mBAAAA,mBAAmB;GACjB,cAAc;GACd,KAAK;GACL,OAAO;GACP,aAAa;GACb,KAAK;GACL,OAAO;GACP,qBAAqB;GACtB,CAAC;EAGF;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aACE;GACF,cAAc;GACd,KAAK;GACL,OAAO;GACR;EACD;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,KAAK;GACL,KAAK;GACL,MAAM;GACN,cAAc;GACd,KAAK;GACL,OAAO;GACP,qBAAqB;GACtB;EAGD;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,aACE;IACH;GACD;IACE,KAAK;IACL,OAAO;IACP,MAAM;IACN,aAAa;IACd;GACD;IACE,KAAK;IACL,OAAO;IACP,MAAM;IACN,aAAa;IACb,cAAc;IACf;GACD;IACE,KAAK;IACL,OAAO;IACP,MAAM;IACN,aAAa;IACd;GACD;IACE,KAAK;IACL,MAAM;IACN,OAAO;IACR;GACD;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,MAAM;IACN,OAAO;IACR;GACD;IACE,KAAK;IACL,OAAO;IACP,MAAM;IACN,aAAa;IACb,cAAc;IACf;GACD;IACE,KAAK;IACL,OAAO;IACP,MAAM;IACN,aAAa;IACb,qBAAqB;IACtB;GACD;IACE,KAAK;IACL,OAAO;IACP,MAAM;IACN,aAAa;IACb,qBAAqB;IACtB;GACD;IACE,KAAK;IACL,OAAO;IACP,MAAM;IACN,aACE;IACH;GACD;IACE,KAAK;IACL,OAAO;IACP,MAAM;IACN,aAAa;IACd;GACF;EACF;CACF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as __exportAll } from "./es-BXxGlAp6.mjs";
|
|
2
|
-
import { n as useDataSourceRegistryConfig } from "./registry-context-
|
|
2
|
+
import { n as useDataSourceRegistryConfig } from "./registry-context-CTHUCfEc.mjs";
|
|
3
3
|
import { i as useWidgetsApi, n as useWidgetPreviewContext, t as ErrorState } from "./error-state-DYzHx8tt.mjs";
|
|
4
4
|
import { i as getBorderColorField, l as getColorField, m as getPaddingField, n as borderWidthClasses, o as getBorderRadiusField, s as getBorderWidthField, t as borderColorClasses, u as getFontSizeField } from "./registries-Ct8o2YRe.mjs";
|
|
5
5
|
import { useQuery } from "@tanstack/react-query";
|
|
@@ -241,4 +241,4 @@ const catchUpWidgetPropertySchema = {
|
|
|
241
241
|
//#endregion
|
|
242
242
|
export { CatchUpWidget_exports as n, catchUpWidgetPropertySchema as r, CatchUpWidget as t };
|
|
243
243
|
|
|
244
|
-
//# sourceMappingURL=CatchUpWidget-
|
|
244
|
+
//# sourceMappingURL=CatchUpWidget-B9CI7lq0.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CatchUpWidget-B9DQlzd_.mjs","names":[],"sources":["../../widgets/src/hooks/use-catchups.preview.ts","../../widgets/src/hooks/use-catchups.ts","../../widgets/src/widgets/CatchUpWidget.tsx"],"sourcesContent":["import type { CatchUp } from \"@fluid-app/portal-core/widgets-api-types\";\n\nexport const PREVIEW_DATA: CatchUp[] = [\n { id: 1, suggestionTitle: \"Check in with Sarah about her recent order\" },\n { id: 2, suggestionTitle: \"Follow up with Mike on product samples\" },\n { id: 3, suggestionTitle: \"Reconnect with Lisa — last contact 30 days ago\" },\n { id: 4, suggestionTitle: \"Thank Alex for their referral last week\" },\n { id: 5, suggestionTitle: \"Share new catalog with Jordan\" },\n];\n","import { useQuery, type UseQueryResult } from \"@tanstack/react-query\";\nimport { useWidgetsApi } from \"@fluid-app/portal-core/widgets-api-context\";\nimport { useWidgetPreviewContext } from \"@fluid-app/portal-react/data-sources/preview-context\";\nimport { useDataSourceRegistryConfig } from \"@fluid-app/portal-react/data-sources/registry-context\";\nimport { PREVIEW_DATA } from \"./use-catchups.preview\";\nimport type { CatchUp } from \"@fluid-app/portal-core/widgets-api-types\";\n\nexport type { CatchUp } from \"@fluid-app/portal-core/widgets-api-types\";\n\nexport function useCatchUps(): UseQueryResult<CatchUp[], Error> {\n const widgetsApi = useWidgetsApi();\n const { isPreview } = useWidgetPreviewContext();\n const { baseUrl } = useDataSourceRegistryConfig();\n\n return useQuery({\n queryKey: [\n \"portal-widget-use\",\n \"catchups\",\n isPreview ? \"preview\" : baseUrl,\n ] as const,\n queryFn: ({ signal }) => widgetsApi.fetchCatchUps(signal),\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 BorderWidthOptions,\n ColorOptions,\n FontSizeOptions,\n PaddingOptions,\n} from \"@fluid-app/portal-core/types\";\nimport type { WidgetPropertySchema } from \"@fluid-app/portal-core/registries\";\nimport {\n getBorderRadiusField,\n getBorderWidthField,\n getBorderColorField,\n getColorField,\n getFontSizeField,\n getPaddingField,\n borderWidthClasses,\n borderColorClasses,\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 borderWidth?: BorderWidthOptions;\n borderColor?: ColorOptions;\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 borderWidth = \"none\",\n borderColor = \"muted\",\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} ${borderWidthClasses[borderWidth]} ${borderWidth !== \"none\" ? borderColorClasses[borderColor] : \"\"} 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-header 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'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.suggestionTitle}\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 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 ],\n} as const satisfies WidgetPropertySchema;\n"],"mappings":";;;;;;;;AAEA,MAAa,eAA0B;CACrC;EAAE,IAAI;EAAG,iBAAiB;EAA8C;CACxE;EAAE,IAAI;EAAG,iBAAiB;EAA0C;CACpE;EAAE,IAAI;EAAG,iBAAiB;EAAkD;CAC5E;EAAE,IAAI;EAAG,iBAA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c;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;EACF,oBAAoB;GAClB,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EACF,oBAAoB;GAClB,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EACH;CACF"}
|
|
1
|
+
{"version":3,"file":"CatchUpWidget-B9CI7lq0.mjs","names":[],"sources":["../../widgets/src/hooks/use-catchups.preview.ts","../../widgets/src/hooks/use-catchups.ts","../../widgets/src/widgets/CatchUpWidget.tsx"],"sourcesContent":["import type { CatchUp } from \"@fluid-app/portal-core/widgets-api-types\";\n\nexport const PREVIEW_DATA: CatchUp[] = [\n { id: 1, suggestionTitle: \"Check in with Sarah about her recent order\" },\n { id: 2, suggestionTitle: \"Follow up with Mike on product samples\" },\n { id: 3, suggestionTitle: \"Reconnect with Lisa — last contact 30 days ago\" },\n { id: 4, suggestionTitle: \"Thank Alex for their referral last week\" },\n { id: 5, suggestionTitle: \"Share new catalog with Jordan\" },\n];\n","import { useQuery, type UseQueryResult } from \"@tanstack/react-query\";\nimport { useWidgetsApi } from \"@fluid-app/portal-core/widgets-api-context\";\nimport { useWidgetPreviewContext } from \"@fluid-app/portal-react/data-sources/preview-context\";\nimport { useDataSourceRegistryConfig } from \"@fluid-app/portal-react/data-sources/registry-context\";\nimport { PREVIEW_DATA } from \"./use-catchups.preview\";\nimport type { CatchUp } from \"@fluid-app/portal-core/widgets-api-types\";\n\nexport type { CatchUp } from \"@fluid-app/portal-core/widgets-api-types\";\n\nexport function useCatchUps(): UseQueryResult<CatchUp[], Error> {\n const widgetsApi = useWidgetsApi();\n const { isPreview } = useWidgetPreviewContext();\n const { baseUrl } = useDataSourceRegistryConfig();\n\n return useQuery({\n queryKey: [\n \"portal-widget-use\",\n \"catchups\",\n isPreview ? \"preview\" : baseUrl,\n ] as const,\n queryFn: ({ signal }) => widgetsApi.fetchCatchUps(signal),\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 BorderWidthOptions,\n ColorOptions,\n FontSizeOptions,\n PaddingOptions,\n} from \"@fluid-app/portal-core/types\";\nimport type { WidgetPropertySchema } from \"@fluid-app/portal-core/registries\";\nimport {\n getBorderRadiusField,\n getBorderWidthField,\n getBorderColorField,\n getColorField,\n getFontSizeField,\n getPaddingField,\n borderWidthClasses,\n borderColorClasses,\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 borderWidth?: BorderWidthOptions;\n borderColor?: ColorOptions;\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 borderWidth = \"none\",\n borderColor = \"muted\",\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} ${borderWidthClasses[borderWidth]} ${borderWidth !== \"none\" ? borderColorClasses[borderColor] : \"\"} 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-header 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'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.suggestionTitle}\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 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 ],\n} as const satisfies WidgetPropertySchema;\n"],"mappings":";;;;;;;;AAEA,M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O;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;EACF,oBAAoB;GAClB,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EACF,oBAAoB;GAClB,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EACH;CACF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_chunk = require("./chunk-9hOWP6kD.cjs");
|
|
2
|
-
const require_registry_context = require("./registry-context-
|
|
2
|
+
const require_registry_context = require("./registry-context-CcZYS15Q.cjs");
|
|
3
3
|
const require_error_state = require("./error-state-BDhSltIa.cjs");
|
|
4
4
|
const require_registries = require("./registries-DBb6VjAX.cjs");
|
|
5
5
|
let _tanstack_react_query = require("@tanstack/react-query");
|
|
@@ -258,4 +258,4 @@ Object.defineProperty(exports, "catchUpWidgetPropertySchema", {
|
|
|
258
258
|
}
|
|
259
259
|
});
|
|
260
260
|
|
|
261
|
-
//# sourceMappingURL=CatchUpWidget-
|
|
261
|
+
//# sourceMappingURL=CatchUpWidget-BzgybvuC.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CatchUpWidget-SY7hOHk6.cjs","names":["useWidgetsApi","useWidgetPreviewContext","useDataSourceRegistryConfig","borderWidthClasses","borderColorClasses","Loader2","ErrorState","Sparkles","getFontSizeField","getColorField","getPaddingField","getBorderRadiusField","getBorderWidthField","getBorderColorField"],"sources":["../../widgets/src/hooks/use-catchups.preview.ts","../../widgets/src/hooks/use-catchups.ts","../../widgets/src/widgets/CatchUpWidget.tsx"],"sourcesContent":["import type { CatchUp } from \"@fluid-app/portal-core/widgets-api-types\";\n\nexport const PREVIEW_DATA: CatchUp[] = [\n { id: 1, suggestionTitle: \"Check in with Sarah about her recent order\" },\n { id: 2, suggestionTitle: \"Follow up with Mike on product samples\" },\n { id: 3, suggestionTitle: \"Reconnect with Lisa — last contact 30 days ago\" },\n { id: 4, suggestionTitle: \"Thank Alex for their referral last week\" },\n { id: 5, suggestionTitle: \"Share new catalog with Jordan\" },\n];\n","import { useQuery, type UseQueryResult } from \"@tanstack/react-query\";\nimport { useWidgetsApi } from \"@fluid-app/portal-core/widgets-api-context\";\nimport { useWidgetPreviewContext } from \"@fluid-app/portal-react/data-sources/preview-context\";\nimport { useDataSourceRegistryConfig } from \"@fluid-app/portal-react/data-sources/registry-context\";\nimport { PREVIEW_DATA } from \"./use-catchups.preview\";\nimport type { CatchUp } from \"@fluid-app/portal-core/widgets-api-types\";\n\nexport type { CatchUp } from \"@fluid-app/portal-core/widgets-api-types\";\n\nexport function useCatchUps(): UseQueryResult<CatchUp[], Error> {\n const widgetsApi = useWidgetsApi();\n const { isPreview } = useWidgetPreviewContext();\n const { baseUrl } = useDataSourceRegistryConfig();\n\n return useQuery({\n queryKey: [\n \"portal-widget-use\",\n \"catchups\",\n isPreview ? \"preview\" : baseUrl,\n ] as const,\n queryFn: ({ signal }) => widgetsApi.fetchCatchUps(signal),\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 BorderWidthOptions,\n ColorOptions,\n FontSizeOptions,\n PaddingOptions,\n} from \"@fluid-app/portal-core/types\";\nimport type { WidgetPropertySchema } from \"@fluid-app/portal-core/registries\";\nimport {\n getBorderRadiusField,\n getBorderWidthField,\n getBorderColorField,\n getColorField,\n getFontSizeField,\n getPaddingField,\n borderWidthClasses,\n borderColorClasses,\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 borderWidth?: BorderWidthOptions;\n borderColor?: ColorOptions;\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 borderWidth = \"none\",\n borderColor = \"muted\",\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} ${borderWidthClasses[borderWidth]} ${borderWidth !== \"none\" ? borderColorClasses[borderColor] : \"\"} 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-header 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'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.suggestionTitle}\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 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 ],\n} as const satisfies WidgetPropertySchema;\n"],"mappings":";;;;;;;;AAEA,MAAa,eAA0B;CACrC;EAAE,IAAI;EAAG,iBAAiB;EAA8C;CACxE;EAAE,IAAI;EAAG,iBAAiB;EAA0C;CACpE;EAAE,IAAI;EAAG,iBAAiB;EAAkD;CAC5E;EAAE,IAAI;EAAG,iBAAiB;EAA2C;CACrE;EAAE,IAAI;EAAG,iBAAiB;EAAiC;CAC5D;;;ACCD,SAAgB,cAAgD;CAC9D,MAAM,aAAaA,oBAAAA,eAAe;CAClC,MAAM,EAAE,cAAcC,oBAAAA,yBAAyB;CAC/C,MAAM,EAAE,YAAYC,yBAAAA,6BAA6B;AAEjD,SAAA,GAAA,sBAAA,UAAgB;EACd,UAAU;GACR;GACA;GACA,YAAY,YAAY;G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ACP,MAAM;GACN,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACP,qBAAqB;GACtB;EACDC,mBAAAA,iBAAiB;GACf,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACP,qBAAqB;GACtB,CAAC;EACFC,mBAAAA,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;EACDA,mBAAAA,cAAc;GACZ,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EACFA,mBAAAA,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;EACDC,mBAAAA,gBAAgB;GACd,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EACFC,mBAAAA,qBAAqB;GACnB,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EACFC,mBAAAA,oBAAoB;GAClB,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EACFC,mBAAAA,oBAAoB;GAClB,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EACH;CACF"}
|
|
1
|
+
{"version":3,"file":"CatchUpWidget-BzgybvuC.cjs","names":["useWidgetsApi","useWidgetPreviewContext","useDataSourceRegistryConfig","borderWidthClasses","borderColorClasses","Loader2","ErrorState","Sparkles","getFontSizeField","getColorField","getPaddingField","getBorderRadiusField","getBorderWidthField","getBorderColorField"],"sources":["../../widgets/src/hooks/use-catchups.preview.ts","../../widgets/src/hooks/use-catchups.ts","../../widgets/src/widgets/CatchUpWidget.tsx"],"sourcesContent":["import type { CatchUp } from \"@fluid-app/portal-core/widgets-api-types\";\n\nexport const PREVIEW_DATA: CatchUp[] = [\n { id: 1, suggestionTitle: \"Check in with Sarah about her recent order\" },\n { id: 2, suggestionTitle: \"Follow up with Mike on product samples\" },\n { id: 3, suggestionTitle: \"Reconnect with Lisa — last contact 30 days ago\" },\n { id: 4, suggestionTitle: \"Thank Alex for their referral last week\" },\n { id: 5, suggestionTitle: \"Share new catalog with Jordan\" },\n];\n","import { useQuery, type UseQueryResult } from \"@tanstack/react-query\";\nimport { useWidgetsApi } from \"@fluid-app/portal-core/widgets-api-context\";\nimport { useWidgetPreviewContext } from \"@fluid-app/portal-react/data-sources/preview-context\";\nimport { useDataSourceRegistryConfig } from \"@fluid-app/portal-react/data-sources/registry-context\";\nimport { PREVIEW_DATA } from \"./use-catchups.preview\";\nimport type { CatchUp } from \"@fluid-app/portal-core/widgets-api-types\";\n\nexport type { CatchUp } from \"@fluid-app/portal-core/widgets-api-types\";\n\nexport function useCatchUps(): UseQueryResult<CatchUp[], Error> {\n const widgetsApi = useWidgetsApi();\n const { isPreview } = useWidgetPreviewContext();\n const { baseUrl } = useDataSourceRegistryConfig();\n\n return useQuery({\n queryKey: [\n \"portal-widget-use\",\n \"catchups\",\n isPreview ? \"preview\" : baseUrl,\n ] as const,\n queryFn: ({ signal }) => widgetsApi.fetchCatchUps(signal),\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 BorderWidthOptions,\n ColorOptions,\n FontSizeOptions,\n PaddingOptions,\n} from \"@fluid-app/portal-core/types\";\nimport type { WidgetPropertySchema } from \"@fluid-app/portal-core/registries\";\nimport {\n getBorderRadiusField,\n getBorderWidthField,\n getBorderColorField,\n getColorField,\n getFontSizeField,\n getPaddingField,\n borderWidthClasses,\n borderColorClasses,\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 borderWidth?: BorderWidthOptions;\n borderColor?: ColorOptions;\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 borderWidth = \"none\",\n borderColor = \"muted\",\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} ${borderWidthClasses[borderWidth]} ${borderWidth !== \"none\" ? borderColorClasses[borderColor] : \"\"} 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-header 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'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.suggestionTitle}\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 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 ],\n} as const satisfies WidgetPropertySchema;\n"],"mappings":";;;;;;;;AAEA,MAAa,eAA0B;CACrC;EAAE,IAAI;EAAG,iBAAiB;EAA8C;CACxE;EAAE,IAAI;EAAG,iBAAiB;EAA0C;CACpE;EAAE,IAAI;EAAG,iBAAiB;EAAkD;CAC5E;EAAE,IAAI;EAAG,iBAAiB;EAA2C;CACrE;EAAE,IAAI;EAAG,iBAAiB;EAAiC;CAC5D;;;ACCD,SAAgB,cAAgD;CAC9D,MAAM,aAAaA,oBAAAA,eAAe;CAClC,MAAM,EAAE,cAAcC,oBAAAA,yBAAyB;CAC/C,MAAM,EAAE,YAAYC,yBAAAA,6BAA6B;AAEjD,SAAA,GAAA,sBAAA,UAAgB;EACd,UAAU;GACR;GACA;GACA,YAAY,YAAY;GACzB;EACD,UAAU,EAAE,aAAa,WAAW,cAAc,OAAO;EACzD,SAAS,CAAC;EACV,GAAI,aAAa,EAAE,iBAAiB,cAAc;EACnD,CAAC;;;;;;;;ACGJ,MAAM,kBAAmD;CACvD,OAAO;CACP,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACL;AAoBD,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,MACf,cAAc,QACd,cAAc,SAEd,WAAW,GACX,WACA,GAAG,SACqC;CACxC,MAAM,kBAAkB,WAAW,S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AK;GACL,OAAO;GACR,CAAC;EACFA,mBAAAA,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;EACDC,mBAAAA,gBAAgB;GACd,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EACFC,mBAAAA,qBAAqB;GACnB,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EACFC,mBAAAA,oBAAoB;GAClB,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EACFC,mBAAAA,oBAAoB;GAClB,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EACH;CACF"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
require("./chunk-9hOWP6kD.cjs");
|
|
2
|
+
require("./ScreenRenderer-xH01YkEQ.cjs");
|
|
3
|
+
require("./registry-context-CcZYS15Q.cjs");
|
|
4
|
+
require("./LayoutWidget-Bt2I2XMy.cjs");
|
|
5
|
+
require("./registries-DBb6VjAX.cjs");
|
|
6
|
+
require("./fields-COJ84ouS.cjs");
|
|
7
|
+
const require_ContainerWidget = require("./ContainerWidget-DbAhQKbY.cjs");
|
|
8
|
+
exports.containerWidgetPropertySchema = require_ContainerWidget.containerWidgetPropertySchema;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as __exportAll } from "./es-BXxGlAp6.mjs";
|
|
2
|
-
import { t as LayoutWidget } from "./LayoutWidget-
|
|
2
|
+
import { t as LayoutWidget } from "./LayoutWidget-UI5fbsx4.mjs";
|
|
3
3
|
import { f as getGapField, m as getPaddingField } from "./registries-Ct8o2YRe.mjs";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
//#region ../widgets/src/widgets/ContainerWidget.tsx
|
|
@@ -41,4 +41,4 @@ const containerWidgetPropertySchema = {
|
|
|
41
41
|
//#endregion
|
|
42
42
|
export { ContainerWidget_exports as n, containerWidgetPropertySchema as r, ContainerWidget as t };
|
|
43
43
|
|
|
44
|
-
//# sourceMappingURL=ContainerWidget-
|
|
44
|
+
//# sourceMappingURL=ContainerWidget-DNenbORS.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContainerWidget-
|
|
1
|
+
{"version":3,"file":"ContainerWidget-DNenbORS.mjs","names":[],"sources":["../../widgets/src/widgets/ContainerWidget.tsx"],"sourcesContent":["import type { ComponentProps } from \"react\";\nimport type React from \"react\";\nimport { LayoutWidget } from \"./LayoutWidget\";\nimport type { WidgetPropertySchema } from \"@fluid-app/portal-core/registries\";\nimport { getGapField, getPaddingField } from \"../core/fields\";\n\n/**\n * ContainerWidget - Root container widget for screens\n *\n * This widget wraps LayoutWidget and serves as the foundational container\n * for every screen. It cannot be added, deleted, moved, or copied by users.\n *\n * Only exposes limited settings: gap, padding, and backgroundColor\n */\n\ntype ContainerWidgetProps = ComponentProps<typeof LayoutWidget>;\n\nexport function ContainerWidget(\n props: ContainerWidgetProps,\n): React.JSX.Element {\n // Pass all props through to LayoutWidget\n return <LayoutWidget {...props} />;\n}\n\nexport const containerWidgetPropertySchema: WidgetPropertySchema = {\n widgetType: \"ContainerWidget\",\n displayName: \"Canvas Settings\",\n fields: [\n getGapField({\n key: \"gapSize\",\n label: \"Gap\",\n description: \"Gap between widgets\",\n defaultValue: \"md\",\n group: \"Design\",\n }),\n getPaddingField({\n key: \"padding\",\n label: \"Padding\",\n description: \"Padding for the container\",\n defaultValue: 4,\n group: \"Design\",\n }),\n {\n type: \"background\",\n key: \"background\",\n label: \"Background\",\n description: \"Background for the container\",\n defaultValue: \"background\",\n group: \"Design\",\n },\n ],\n};\n"],"mappings":";;;;;;;;;AAiBA,SAAgB,gBACd,OACmB;AAEnB,QAAO,oBAAC,cAAD,EAAc,GAAI,OAAS,CAAA;;AAGpC,MAAa,gCAAsD;CACjE,YAAY;CACZ,aAAa;CACb,QAAQ;EACN,YAAY;GACV,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,OAAO;GACR,CAAC;EACF,gBAAgB;GACd,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;EACF;CACF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
require("./chunk-9hOWP6kD.cjs");
|
|
2
|
-
const require_LayoutWidget = require("./LayoutWidget-
|
|
2
|
+
const require_LayoutWidget = require("./LayoutWidget-Bt2I2XMy.cjs");
|
|
3
3
|
const require_registries = require("./registries-DBb6VjAX.cjs");
|
|
4
4
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
5
5
|
//#region ../widgets/src/widgets/ContainerWidget.tsx
|
|
@@ -48,4 +48,4 @@ Object.defineProperty(exports, "containerWidgetPropertySchema", {
|
|
|
48
48
|
}
|
|
49
49
|
});
|
|
50
50
|
|
|
51
|
-
//# sourceMappingURL=ContainerWidget-
|
|
51
|
+
//# sourceMappingURL=ContainerWidget-DbAhQKbY.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContainerWidget-
|
|
1
|
+
{"version":3,"file":"ContainerWidget-DbAhQKbY.cjs","names":["LayoutWidget","getGapField","getPaddingField"],"sources":["../../widgets/src/widgets/ContainerWidget.tsx"],"sourcesContent":["import type { ComponentProps } from \"react\";\nimport type React from \"react\";\nimport { LayoutWidget } from \"./LayoutWidget\";\nimport type { WidgetPropertySchema } from \"@fluid-app/portal-core/registries\";\nimport { getGapField, getPaddingField } from \"../core/fields\";\n\n/**\n * ContainerWidget - Root container widget for screens\n *\n * This widget wraps LayoutWidget and serves as the foundational container\n * for every screen. It cannot be added, deleted, moved, or copied by users.\n *\n * Only exposes limited settings: gap, padding, and backgroundColor\n */\n\ntype ContainerWidgetProps = ComponentProps<typeof LayoutWidget>;\n\nexport function ContainerWidget(\n props: ContainerWidgetProps,\n): React.JSX.Element {\n // Pass all props through to LayoutWidget\n return <LayoutWidget {...props} />;\n}\n\nexport const containerWidgetPropertySchema: WidgetPropertySchema = {\n widgetType: \"ContainerWidget\",\n displayName: \"Canvas Settings\",\n fields: [\n getGapField({\n key: \"gapSize\",\n label: \"Gap\",\n description: \"Gap between widgets\",\n defaultValue: \"md\",\n group: \"Design\",\n }),\n getPaddingField({\n key: \"padding\",\n label: \"Padding\",\n description: \"Padding for the container\",\n defaultValue: 4,\n group: \"Design\",\n }),\n {\n type: \"background\",\n key: \"background\",\n label: \"Background\",\n description: \"Background for the container\",\n defaultValue: \"background\",\n group: \"Design\",\n },\n ],\n};\n"],"mappings":";;;;;AAiBA,SAAgB,gBACd,OACmB;AAEnB,QAAO,iBAAA,GAAA,kBAAA,KAACA,qBAAAA,cAAD,EAAc,GAAI,OAAS,CAAA;;AAGpC,MAAa,gCAAsD;CACjE,YAAY;CACZ,aAAa;CACb,QAAQ;EACNC,mBAAAA,YAAY;GACV,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,OAAO;GACR,CAAC;EACFC,mBAAAA,gBAAgB;GACd,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;EACF;CACF"}
|