@flamingo-stack/openframe-frontend-core 0.0.643 → 0.0.644-2208.6318.1
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/chat-protocol/index.cjs +10 -3
- package/dist/chat-protocol/index.cjs.map +1 -1
- package/dist/chat-protocol/index.js +10 -3
- package/dist/chat-protocol/index.js.map +1 -1
- package/dist/chat-protocol/source-metadata.d.ts +7 -1
- package/dist/chat-protocol/source-metadata.d.ts.map +1 -1
- package/dist/{chunk-42NXGOTG.cjs → chunk-2G47VKPD.cjs} +3 -3
- package/dist/{chunk-42NXGOTG.cjs.map → chunk-2G47VKPD.cjs.map} +1 -1
- package/dist/{chunk-HA2U7WHU.js → chunk-3AUBCCTI.js} +3 -3
- package/dist/{chunk-5E6Y6766.cjs → chunk-3ENJITQA.cjs} +29 -29
- package/dist/{chunk-5E6Y6766.cjs.map → chunk-3ENJITQA.cjs.map} +1 -1
- package/dist/{chunk-64KDKDYC.js → chunk-3ENOAHWR.js} +6 -6
- package/dist/{chunk-3IPL6G7S.js → chunk-3W563UVF.js} +40 -10
- package/dist/chunk-3W563UVF.js.map +1 -0
- package/dist/{chunk-IU3IYXMM.js → chunk-4WIS7COJ.js} +7 -7
- package/dist/{chunk-4TE53O6U.js → chunk-53RGBCL7.js} +4 -4
- package/dist/{chunk-FVIT23I5.js → chunk-5GAWR7RX.js} +3 -3
- package/dist/{chunk-B42INNRA.cjs → chunk-5QRNCWHS.cjs} +199 -199
- package/dist/{chunk-B42INNRA.cjs.map → chunk-5QRNCWHS.cjs.map} +1 -1
- package/dist/{chunk-IIZX3K2R.js → chunk-6O2XNGUE.js} +2 -2
- package/dist/{chunk-ZU2JBBOE.cjs → chunk-7FI2YKEU.cjs} +59 -59
- package/dist/{chunk-ZU2JBBOE.cjs.map → chunk-7FI2YKEU.cjs.map} +1 -1
- package/dist/{chunk-7T673MHJ.cjs → chunk-CTGCWBU3.cjs} +22 -22
- package/dist/{chunk-7T673MHJ.cjs.map → chunk-CTGCWBU3.cjs.map} +1 -1
- package/dist/{chunk-NCHLLTAR.js → chunk-DSKO3GPD.js} +3 -3
- package/dist/{chunk-EWQI5MV6.cjs → chunk-DYJQPJBW.cjs} +20 -20
- package/dist/{chunk-EWQI5MV6.cjs.map → chunk-DYJQPJBW.cjs.map} +1 -1
- package/dist/{chunk-YT6RGA3X.js → chunk-GLGERQO7.js} +3 -3
- package/dist/{chunk-2NRLRRMR.cjs → chunk-GSC2NB5C.cjs} +108 -78
- package/dist/chunk-GSC2NB5C.cjs.map +1 -0
- package/dist/{chunk-TQ7KTANJ.js → chunk-JWRMSVNZ.js} +3 -3
- package/dist/{chunk-2DJH6KHA.cjs → chunk-K6KKARAF.cjs} +155 -148
- package/dist/{chunk-2DJH6KHA.cjs.map → chunk-K6KKARAF.cjs.map} +1 -1
- package/dist/{chunk-FO7SD2IQ.cjs → chunk-KCO7MZ34.cjs} +6 -6
- package/dist/{chunk-FO7SD2IQ.cjs.map → chunk-KCO7MZ34.cjs.map} +1 -1
- package/dist/{chunk-YG7KLZE7.js → chunk-KCS64Q7P.js} +4 -4
- package/dist/{chunk-XJLWGYL4.cjs → chunk-KSSBW5W7.cjs} +81 -81
- package/dist/{chunk-XJLWGYL4.cjs.map → chunk-KSSBW5W7.cjs.map} +1 -1
- package/dist/{chunk-M3W5Y5DK.cjs → chunk-LJ5VSU2Q.cjs} +11 -11
- package/dist/{chunk-M3W5Y5DK.cjs.map → chunk-LJ5VSU2Q.cjs.map} +1 -1
- package/dist/{chunk-R2IU2Y2O.cjs → chunk-M7NQPYQB.cjs} +33 -33
- package/dist/{chunk-R2IU2Y2O.cjs.map → chunk-M7NQPYQB.cjs.map} +1 -1
- package/dist/{chunk-D6TWJEFW.cjs → chunk-ODZ4JBFQ.cjs} +15 -15
- package/dist/{chunk-D6TWJEFW.cjs.map → chunk-ODZ4JBFQ.cjs.map} +1 -1
- package/dist/{chunk-3LXJEXPH.js → chunk-QH6KJ4OZ.js} +2 -2
- package/dist/{chunk-O7JMF5OT.js → chunk-QX3K5SXC.js} +3 -3
- package/dist/{chunk-N7UYD57Q.js → chunk-REAWHAOH.js} +3 -3
- package/dist/{chunk-CWHLVXUW.cjs → chunk-S7UGTAIP.cjs} +10 -10
- package/dist/{chunk-CWHLVXUW.cjs.map → chunk-S7UGTAIP.cjs.map} +1 -1
- package/dist/{chunk-2NODQ7FO.js → chunk-TN46CQSO.js} +12 -5
- package/dist/{chunk-2NODQ7FO.js.map → chunk-TN46CQSO.js.map} +1 -1
- package/dist/{chunk-77EO26XV.cjs → chunk-V37CP6CT.cjs} +5 -5
- package/dist/{chunk-77EO26XV.cjs.map → chunk-V37CP6CT.cjs.map} +1 -1
- package/dist/{chunk-SE6YRE3R.cjs → chunk-W7VZHI37.cjs} +32 -32
- package/dist/{chunk-SE6YRE3R.cjs.map → chunk-W7VZHI37.cjs.map} +1 -1
- package/dist/{chunk-TIOHTWDA.js → chunk-WTUX4SNF.js} +6 -6
- package/dist/{chunk-KX2FT7AS.cjs → chunk-YCO7DTCF.cjs} +28 -28
- package/dist/{chunk-KX2FT7AS.cjs.map → chunk-YCO7DTCF.cjs.map} +1 -1
- package/dist/{chunk-7HL2PNQ3.js → chunk-YRGIQZSU.js} +5 -5
- package/dist/{chunk-6MQBLFUM.js → chunk-YRWXGZLV.js} +5 -5
- package/dist/{chunk-26D6FM6L.cjs → chunk-ZAQ6CKTU.cjs} +6 -6
- package/dist/{chunk-26D6FM6L.cjs.map → chunk-ZAQ6CKTU.cjs.map} +1 -1
- package/dist/components/case-studies/index.cjs +16 -16
- package/dist/components/case-studies/index.js +4 -4
- package/dist/components/chat/entity-cards/program-card.d.ts.map +1 -1
- package/dist/components/chat/index.cjs +3 -3
- package/dist/components/chat/index.js +2 -2
- package/dist/components/contact/index.cjs +5 -5
- package/dist/components/contact/index.js +4 -4
- package/dist/components/docs/index.cjs +8 -8
- package/dist/components/docs/index.js +7 -7
- package/dist/components/embeds/index.cjs +5 -5
- package/dist/components/embeds/index.js +4 -4
- package/dist/components/faq/index.cjs +5 -5
- package/dist/components/faq/index.js +4 -4
- package/dist/components/features/index.cjs +4 -4
- package/dist/components/features/index.js +3 -3
- package/dist/components/help-center-pages/index.cjs +24 -24
- package/dist/components/help-center-pages/index.js +15 -15
- package/dist/components/index.cjs +53 -53
- package/dist/components/index.js +15 -15
- package/dist/components/meeting-scheduler/index.cjs +34 -34
- package/dist/components/meeting-scheduler/index.js +3 -3
- package/dist/components/navigation/index.cjs +7 -7
- package/dist/components/navigation/index.js +6 -6
- package/dist/components/onboarding-guides/index.cjs +7 -7
- package/dist/components/onboarding-guides/index.js +6 -6
- package/dist/components/related-content/index.cjs +3 -3
- package/dist/components/related-content/index.js +2 -2
- package/dist/components/tickets/index.cjs +8 -8
- package/dist/components/tickets/index.js +7 -7
- package/dist/components/ui/index.cjs +4 -4
- package/dist/components/ui/index.js +3 -3
- package/dist/index.cjs +10 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +9 -7
- package/dist/index.js.map +1 -1
- package/dist/utils/format.d.ts +39 -4
- package/dist/utils/format.d.ts.map +1 -1
- package/dist/utils/index.cjs +25 -2
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +25 -3
- package/dist/utils/index.js.map +1 -1
- package/package.json +1 -1
- package/src/chat-protocol/__tests__/source-metadata.test.ts +49 -0
- package/src/chat-protocol/source-metadata.ts +46 -6
- package/src/components/chat/entity-cards/program-card.tsx +46 -8
- package/src/utils/__tests__/format-program-dates.test.ts +91 -0
- package/src/utils/format.ts +79 -7
- package/src/utils/index.ts +2 -0
- package/dist/chunk-2NRLRRMR.cjs.map +0 -1
- package/dist/chunk-3IPL6G7S.js.map +0 -1
- /package/dist/{chunk-HA2U7WHU.js.map → chunk-3AUBCCTI.js.map} +0 -0
- /package/dist/{chunk-64KDKDYC.js.map → chunk-3ENOAHWR.js.map} +0 -0
- /package/dist/{chunk-IU3IYXMM.js.map → chunk-4WIS7COJ.js.map} +0 -0
- /package/dist/{chunk-4TE53O6U.js.map → chunk-53RGBCL7.js.map} +0 -0
- /package/dist/{chunk-FVIT23I5.js.map → chunk-5GAWR7RX.js.map} +0 -0
- /package/dist/{chunk-IIZX3K2R.js.map → chunk-6O2XNGUE.js.map} +0 -0
- /package/dist/{chunk-NCHLLTAR.js.map → chunk-DSKO3GPD.js.map} +0 -0
- /package/dist/{chunk-YT6RGA3X.js.map → chunk-GLGERQO7.js.map} +0 -0
- /package/dist/{chunk-TQ7KTANJ.js.map → chunk-JWRMSVNZ.js.map} +0 -0
- /package/dist/{chunk-YG7KLZE7.js.map → chunk-KCS64Q7P.js.map} +0 -0
- /package/dist/{chunk-3LXJEXPH.js.map → chunk-QH6KJ4OZ.js.map} +0 -0
- /package/dist/{chunk-O7JMF5OT.js.map → chunk-QX3K5SXC.js.map} +0 -0
- /package/dist/{chunk-N7UYD57Q.js.map → chunk-REAWHAOH.js.map} +0 -0
- /package/dist/{chunk-TIOHTWDA.js.map → chunk-WTUX4SNF.js.map} +0 -0
- /package/dist/{chunk-7HL2PNQ3.js.map → chunk-YRGIQZSU.js.map} +0 -0
- /package/dist/{chunk-6MQBLFUM.js.map → chunk-YRWXGZLV.js.map} +0 -0
package/dist/utils/format.d.ts
CHANGED
|
@@ -128,16 +128,51 @@ export declare function formatDurationCompact(seconds: number | null | undefined
|
|
|
128
128
|
* fixing the React #418 hydration mismatch — AND shows the true event time
|
|
129
129
|
* (4:00 PM EDT, not the 8:00 PM UTC a plain UTC pin would show, nor the
|
|
130
130
|
* viewer-local time the old unpinned call produced). Falls back to UTC when no
|
|
131
|
-
* zone is given, and tolerates
|
|
132
|
-
* The zone LABEL is rendered separately by callers
|
|
131
|
+
* zone is given, and tolerates an unresolvable label (legacy data) without throwing.
|
|
132
|
+
* The zone LABEL is rendered separately by callers that have room for their own
|
|
133
|
+
* styled span; pass `withZoneLabel` where the output is a plain joined string
|
|
134
|
+
* (the compact card densities) and the short name is appended inline — an
|
|
135
|
+
* unlabelled wall clock beside a date is readable but still ambiguous about
|
|
136
|
+
* WHICH zone it is stating.
|
|
133
137
|
*
|
|
134
|
-
* Returns: "4:00 PM"
|
|
138
|
+
* Returns: "4:00 PM", or "4:00 PM EDT" with `withZoneLabel`.
|
|
135
139
|
*/
|
|
136
|
-
export declare function formatTimeWithTimezone(date: Date | string | null | undefined, timezone?: string | null
|
|
140
|
+
export declare function formatTimeWithTimezone(date: Date | string | null | undefined, timezone?: string | null, options?: {
|
|
141
|
+
withZoneLabel?: boolean;
|
|
142
|
+
}): string;
|
|
143
|
+
/**
|
|
144
|
+
* Format a webinar/event DATE as the calendar day in its OWN timezone — the
|
|
145
|
+
* sibling of `formatTimeWithTimezone`, and the reason it exists.
|
|
146
|
+
*
|
|
147
|
+
* A card that prints the date in UTC and the time beside it in the event's zone
|
|
148
|
+
* can name a moment that never existed: a webinar at `2026-03-20T01:18Z` in
|
|
149
|
+
* `America/New_York` read "Mar 20, 2026 · 9:18 PM" — 9:18 PM on the 20th is not
|
|
150
|
+
* when it happens, 9:18 PM on the 19th is. Both halves of one timestamp must be
|
|
151
|
+
* rendered in ONE zone. Same UTC fallback and same non-IANA tolerance as the
|
|
152
|
+
* time formatter, so the pair can never disagree about which zone it used.
|
|
153
|
+
*
|
|
154
|
+
* `style` picks the two shapes the program cards actually render:
|
|
155
|
+
* `'medium'` → "Mar 19, 2026" (compact densities), `'weekday'` →
|
|
156
|
+
* "Thursday 19 March" (default density).
|
|
157
|
+
*
|
|
158
|
+
* Returns: "Mar 19, 2026"
|
|
159
|
+
*/
|
|
160
|
+
export type ZonedDateStyle = 'medium' | 'weekday';
|
|
161
|
+
export declare function formatDateWithTimezone(date: Date | string | null | undefined, timezone?: string | null, style?: ZonedDateStyle): string;
|
|
137
162
|
/**
|
|
138
163
|
* Calculate and format duration between two timestamps
|
|
139
164
|
* Used for webinar durations
|
|
140
165
|
* Returns: "1h 30m" or "45m"
|
|
166
|
+
*
|
|
167
|
+
* Returns `''` — the same "nothing to show" this function already returns for a
|
|
168
|
+
* missing endpoint — when the range is not a positive, real duration. An event
|
|
169
|
+
* whose `end_at` precedes its `start_at` is corrupt data, and the unguarded
|
|
170
|
+
* subtraction printed it literally: a live webinar row rendered "-45m" on the
|
|
171
|
+
* card. An unparseable timestamp printed "NaNm" the same way. A renderer shows
|
|
172
|
+
* nothing rather than an impossible value; the write path is what must reject
|
|
173
|
+
* the row. (Note the negative case never even reached the `>= 60` branch, so
|
|
174
|
+
* -90 minutes rendered as "-90m" rather than "-1h 30m" — the output was not
|
|
175
|
+
* just wrong, it was inconsistently wrong.)
|
|
141
176
|
*/
|
|
142
177
|
export declare function formatDurationFromRange(startAt: string | Date | null | undefined, endAt: string | Date | null | undefined): string;
|
|
143
178
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../src/utils/format.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;;GAKG;AACH,wBAAgB,UAAU,CACxB,IAAI,EAAE,IAAI,GAAG,MAAM,EACnB,OAAO,GAAE,IAAI,CAAC,qBAIb,GACA,MAAM,CAaR;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEhD;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,SAAQ,GAAG,MAAM,CAKnE;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,SAAI,GAAG,MAAM,CAU/D;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAMtD;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAMpD;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,GA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;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,CAaxG;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAa3D;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,CAK1E;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAStD;AAMD;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,GAAE,MAAY,GAAG,MAAM,CAK/E;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEzD;AAED;;;;;;;GAOG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CA8B9C;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,cAAc,EAAE,MAAM,GAAG,MAAM,CAKnE;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAM/D;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,QAAQ,GAAE,MAAW,GAAG,MAAM,CAiBjG"}
|
package/dist/utils/index.cjs
CHANGED
|
@@ -282,14 +282,16 @@ function formatDurationCompact(seconds) {
|
|
|
282
282
|
}
|
|
283
283
|
return `${minutes} min`;
|
|
284
284
|
}
|
|
285
|
-
function formatTimeWithTimezone(date, timezone) {
|
|
285
|
+
function formatTimeWithTimezone(date, timezone, options) {
|
|
286
286
|
if (!date) return "";
|
|
287
287
|
const dateObj = typeof date === "string" ? new Date(date) : date;
|
|
288
|
+
if (Number.isNaN(dateObj.getTime())) return "";
|
|
288
289
|
const opts = {
|
|
289
290
|
hour: "numeric",
|
|
290
291
|
minute: "2-digit",
|
|
291
292
|
hour12: true,
|
|
292
|
-
timeZone: timezone || "UTC"
|
|
293
|
+
timeZone: timezone || "UTC",
|
|
294
|
+
...options?.withZoneLabel ? { timeZoneName: "short" } : {}
|
|
293
295
|
};
|
|
294
296
|
try {
|
|
295
297
|
return dateObj.toLocaleTimeString("en-US", opts);
|
|
@@ -297,12 +299,32 @@ function formatTimeWithTimezone(date, timezone) {
|
|
|
297
299
|
return dateObj.toLocaleTimeString("en-US", { ...opts, timeZone: "UTC" });
|
|
298
300
|
}
|
|
299
301
|
}
|
|
302
|
+
var ZONED_DATE_STYLES = {
|
|
303
|
+
medium: { year: "numeric", month: "short", day: "numeric" },
|
|
304
|
+
weekday: { weekday: "long", day: "numeric", month: "long" }
|
|
305
|
+
};
|
|
306
|
+
function formatDateWithTimezone(date, timezone, style = "medium") {
|
|
307
|
+
if (!date) return "";
|
|
308
|
+
const dateObj = typeof date === "string" ? new Date(date) : date;
|
|
309
|
+
if (Number.isNaN(dateObj.getTime())) return "";
|
|
310
|
+
const opts = {
|
|
311
|
+
...ZONED_DATE_STYLES[style],
|
|
312
|
+
timeZone: timezone || "UTC"
|
|
313
|
+
};
|
|
314
|
+
try {
|
|
315
|
+
return dateObj.toLocaleDateString("en-US", opts);
|
|
316
|
+
} catch {
|
|
317
|
+
return dateObj.toLocaleDateString("en-US", { ...opts, timeZone: "UTC" });
|
|
318
|
+
}
|
|
319
|
+
}
|
|
300
320
|
function formatDurationFromRange(startAt, endAt) {
|
|
301
321
|
if (!startAt || !endAt) return "";
|
|
302
322
|
const start = typeof startAt === "string" ? new Date(startAt) : startAt;
|
|
303
323
|
const end = typeof endAt === "string" ? new Date(endAt) : endAt;
|
|
304
324
|
const durationMs = end.getTime() - start.getTime();
|
|
325
|
+
if (!Number.isFinite(durationMs) || durationMs <= 0) return "";
|
|
305
326
|
const minutes = Math.round(durationMs / 6e4);
|
|
327
|
+
if (minutes <= 0) return "";
|
|
306
328
|
if (minutes >= 60) {
|
|
307
329
|
const hours = Math.floor(minutes / 60);
|
|
308
330
|
const mins = minutes % 60;
|
|
@@ -5614,6 +5636,7 @@ exports.formatDateSlashUTC = formatDateSlashUTC;
|
|
|
5614
5636
|
exports.formatDateTime = formatDateTime;
|
|
5615
5637
|
exports.formatDateTimeAt = formatDateTimeAt;
|
|
5616
5638
|
exports.formatDateUTC = formatDateUTC;
|
|
5639
|
+
exports.formatDateWithTimezone = formatDateWithTimezone;
|
|
5617
5640
|
exports.formatDocName = formatDocName;
|
|
5618
5641
|
exports.formatDuration = formatDuration;
|
|
5619
5642
|
exports.formatDurationCompact = formatDurationCompact;
|