@flamingo-stack/openframe-frontend-core 0.0.642 → 0.0.643-snapshot.20260916153353
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 +6 -3
- package/dist/chat-protocol/index.cjs.map +1 -1
- package/dist/chat-protocol/index.js +6 -3
- package/dist/chat-protocol/index.js.map +1 -1
- package/dist/chat-protocol/source-metadata.d.ts +16 -1
- package/dist/chat-protocol/source-metadata.d.ts.map +1 -1
- package/dist/{chunk-YM6L3WM5.js → chunk-27RD5XTP.js} +3 -3
- package/dist/{chunk-POPL3W2S.js → chunk-3DGRXC74.js} +3 -3
- package/dist/{chunk-2Z5FPHOL.cjs → chunk-3UBT2OIX.cjs} +20 -20
- package/dist/{chunk-2Z5FPHOL.cjs.map → chunk-3UBT2OIX.cjs.map} +1 -1
- package/dist/{chunk-6GY6DFIH.js → chunk-4WVWRFGP.js} +6 -6
- package/dist/{chunk-OYI3K5R6.cjs → chunk-65EVGKFV.cjs} +8 -14
- package/dist/chunk-65EVGKFV.cjs.map +1 -0
- package/dist/{chunk-6NHLZORM.js → chunk-7Q5XXPCB.js} +6 -6
- package/dist/{chunk-2NRLRRMR.cjs → chunk-7R2DIGG4.cjs} +319 -293
- package/dist/chunk-7R2DIGG4.cjs.map +1 -0
- package/dist/{chunk-3LXJEXPH.js → chunk-B3Z3RJRW.js} +2 -2
- package/dist/{chunk-N5C5P2LM.cjs → chunk-B5IFXCRF.cjs} +22 -22
- package/dist/{chunk-N5C5P2LM.cjs.map → chunk-B5IFXCRF.cjs.map} +1 -1
- package/dist/{chunk-YRSRP4U3.cjs → chunk-C5Y5T6GC.cjs} +15 -15
- package/dist/{chunk-YRSRP4U3.cjs.map → chunk-C5Y5T6GC.cjs.map} +1 -1
- package/dist/{chunk-VHB3I6F3.cjs → chunk-CBXZSTAG.cjs} +419 -445
- package/dist/chunk-CBXZSTAG.cjs.map +1 -0
- package/dist/{chunk-VKPTN5MT.cjs → chunk-DCCY54LU.cjs} +6 -6
- package/dist/{chunk-VKPTN5MT.cjs.map → chunk-DCCY54LU.cjs.map} +1 -1
- package/dist/{chunk-WL3PNUNY.cjs → chunk-FAD5WURS.cjs} +81 -81
- package/dist/{chunk-WL3PNUNY.cjs.map → chunk-FAD5WURS.cjs.map} +1 -1
- package/dist/{chunk-3IPL6G7S.js → chunk-FOSIR4QF.js} +260 -234
- package/dist/chunk-FOSIR4QF.js.map +1 -0
- package/dist/{chunk-MJ424FEC.js → chunk-HOGOQA2X.js} +2 -2
- package/dist/{chunk-SDGMLXIP.js → chunk-HPWLIYRL.js} +12 -25
- package/dist/chunk-HPWLIYRL.js.map +1 -0
- package/dist/{chunk-3I6XHQUD.js → chunk-I57XLISO.js} +54 -80
- package/dist/chunk-I57XLISO.js.map +1 -0
- package/dist/{chunk-FRCUUK5X.cjs → chunk-IIXB5REN.cjs} +3 -3
- package/dist/{chunk-FRCUUK5X.cjs.map → chunk-IIXB5REN.cjs.map} +1 -1
- package/dist/{chunk-HW7BLVQH.js → chunk-IXD6SHQ6.js} +4 -4
- package/dist/{chunk-XFLJC2WR.cjs → chunk-LZYPSDFE.cjs} +59 -59
- package/dist/{chunk-XFLJC2WR.cjs.map → chunk-LZYPSDFE.cjs.map} +1 -1
- package/dist/{chunk-QY25ZP2V.cjs → chunk-MCQAOIUK.cjs} +28 -28
- package/dist/{chunk-QY25ZP2V.cjs.map → chunk-MCQAOIUK.cjs.map} +1 -1
- package/dist/{chunk-S254VEDE.js → chunk-MRIOYSXH.js} +3 -3
- package/dist/{chunk-OOOOC5O5.cjs → chunk-OMSUWB6A.cjs} +29 -29
- package/dist/{chunk-OOOOC5O5.cjs.map → chunk-OMSUWB6A.cjs.map} +1 -1
- package/dist/{chunk-GEIHTN6J.cjs → chunk-OVXYX47B.cjs} +10 -10
- package/dist/{chunk-GEIHTN6J.cjs.map → chunk-OVXYX47B.cjs.map} +1 -1
- package/dist/{chunk-XWGHLSAL.js → chunk-PFV4DAX5.js} +4 -4
- package/dist/{chunk-O4LL7RQV.cjs → chunk-RB6L5EGM.cjs} +208 -221
- package/dist/chunk-RB6L5EGM.cjs.map +1 -0
- package/dist/{chunk-M4PJVFBF.cjs → chunk-RFFF2EYD.cjs} +11 -11
- package/dist/{chunk-M4PJVFBF.cjs.map → chunk-RFFF2EYD.cjs.map} +1 -1
- package/dist/{chunk-UFBWNVZZ.js → chunk-RNMGKAS6.js} +7 -7
- package/dist/{chunk-SE6YRE3R.cjs → chunk-RWURXICE.cjs} +32 -32
- package/dist/{chunk-SE6YRE3R.cjs.map → chunk-RWURXICE.cjs.map} +1 -1
- package/dist/{chunk-ZAIYD3MZ.js → chunk-S2KMNFFN.js} +3 -3
- package/dist/{chunk-ZGPJ3NVF.js → chunk-SKABQX44.js} +3 -3
- package/dist/{chunk-YE3TFNW6.cjs → chunk-TGUA3C4U.cjs} +5 -5
- package/dist/{chunk-YE3TFNW6.cjs.map → chunk-TGUA3C4U.cjs.map} +1 -1
- package/dist/{chunk-ORFJVMAL.js → chunk-TTVOBWAH.js} +5 -11
- package/dist/chunk-TTVOBWAH.js.map +1 -0
- package/dist/{chunk-M7QROULE.js → chunk-UEXIMEVU.js} +5 -5
- package/dist/{chunk-EW3MSJOE.cjs → chunk-UKV52KAP.cjs} +33 -33
- package/dist/{chunk-EW3MSJOE.cjs.map → chunk-UKV52KAP.cjs.map} +1 -1
- package/dist/{chunk-J4RZVLLQ.js → chunk-VE52MSYC.js} +5 -5
- package/dist/components/case-studies/index.cjs +16 -16
- package/dist/components/case-studies/index.js +4 -4
- package/dist/components/chat/chat-sidebar.d.ts.map +1 -1
- package/dist/components/chat/entity-cards/blog-card.d.ts.map +1 -1
- package/dist/components/chat/entity-cards/dispatch.d.ts.map +1 -1
- package/dist/components/chat/entity-cards/program-card.d.ts.map +1 -1
- package/dist/components/chat/index.cjs +3 -9
- package/dist/components/chat/index.cjs.map +1 -1
- package/dist/components/chat/index.js +2 -8
- package/dist/components/chat/types/entities/investor-update.d.ts.map +1 -1
- package/dist/components/chat/types/entities/program-types.d.ts +8 -18
- package/dist/components/chat/types/entities/program-types.d.ts.map +1 -1
- package/dist/components/chat/utils/compact-card-classes.d.ts.map +1 -1
- 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 -59
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.js +15 -21
- package/dist/components/index.js.map +1 -1
- package/dist/components/logs-list.d.ts.map +1 -1
- package/dist/components/meeting-scheduler/confirmation.d.ts.map +1 -1
- package/dist/components/meeting-scheduler/directory.d.ts.map +1 -1
- package/dist/components/meeting-scheduler/index.cjs +47 -72
- package/dist/components/meeting-scheduler/index.cjs.map +1 -1
- package/dist/components/meeting-scheduler/index.d.ts.map +1 -1
- package/dist/components/meeting-scheduler/index.js +16 -41
- package/dist/components/meeting-scheduler/index.js.map +1 -1
- package/dist/components/meeting-scheduler/slot-picker.d.ts.map +1 -1
- 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/shared/article-author-byline.d.ts.map +1 -1
- package/dist/components/tickets/index.cjs +8 -8
- package/dist/components/tickets/index.js +7 -7
- package/dist/components/ui/date-picker.d.ts.map +1 -1
- package/dist/components/ui/device-card.d.ts.map +1 -1
- package/dist/components/ui/drawer.d.ts +19 -5
- package/dist/components/ui/drawer.d.ts.map +1 -1
- package/dist/components/ui/index.cjs +4 -10
- package/dist/components/ui/index.cjs.map +1 -1
- package/dist/components/ui/index.js +3 -9
- package/dist/components/ui/table/table-timestamp-cell.d.ts.map +1 -1
- package/dist/index.cjs +29 -17
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +35 -23
- package/dist/index.js.map +1 -1
- package/dist/utils/date-formatters.d.ts +7 -2
- package/dist/utils/date-formatters.d.ts.map +1 -1
- package/dist/utils/date-utils.d.ts +4 -1
- package/dist/utils/date-utils.d.ts.map +1 -1
- package/dist/utils/format-date.d.ts.map +1 -1
- package/dist/utils/format.d.ts +155 -11
- package/dist/utils/format.d.ts.map +1 -1
- package/dist/utils/index.cjs +223 -109
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.d.ts +4 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +211 -110
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/program-instant.d.ts +145 -0
- package/dist/utils/program-instant.d.ts.map +1 -0
- package/dist/utils/program-meta-renderers.d.ts +3 -0
- package/dist/utils/program-meta-renderers.d.ts.map +1 -0
- package/dist/utils/url-safety.d.ts +33 -0
- package/dist/utils/url-safety.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/chat-protocol/__tests__/source-metadata.test.ts +70 -3
- package/src/chat-protocol/source-metadata.ts +22 -6
- package/src/components/chat/chat-sidebar.tsx +4 -11
- package/src/components/chat/entity-cards/.program-card.md +1 -1
- package/src/components/chat/entity-cards/blog-card.tsx +4 -24
- package/src/components/chat/entity-cards/dispatch.tsx +9 -27
- package/src/components/chat/entity-cards/program-card.tsx +42 -81
- package/src/components/chat/types/entities/investor-update.ts +4 -6
- package/src/components/chat/types/entities/program-types.ts +8 -89
- package/src/components/chat/utils/.compact-card-classes.md +1 -1
- package/src/components/chat/utils/compact-card-classes.ts +5 -3
- package/src/components/logs-list.tsx +4 -13
- package/src/components/meeting-scheduler/confirmation.tsx +6 -10
- package/src/components/meeting-scheduler/directory.tsx +2 -12
- package/src/components/meeting-scheduler/index.tsx +3 -11
- package/src/components/meeting-scheduler/slot-picker.tsx +4 -7
- package/src/components/shared/article-author-byline.tsx +4 -13
- package/src/components/ui/.drawer.md +1 -0
- package/src/components/ui/__tests__/drawer-size.test.tsx +38 -0
- package/src/components/ui/date-picker.tsx +6 -13
- package/src/components/ui/device-card.tsx +4 -10
- package/src/components/ui/drawer.tsx +44 -9
- package/src/components/ui/table/table-timestamp-cell.tsx +8 -2
- package/src/utils/.format.md +5 -2
- package/src/utils/__tests__/date-rendering.test.ts +118 -0
- package/src/utils/__tests__/format-program-dates.test.ts +148 -0
- package/src/utils/__tests__/program-instant.test.ts +125 -0
- package/src/utils/__tests__/url-safety.test.ts +44 -0
- package/src/utils/date-formatters.ts +18 -29
- package/src/utils/date-utils.ts +27 -40
- package/src/utils/format-date.ts +14 -16
- package/src/utils/format.ts +367 -66
- package/src/utils/index.ts +24 -0
- package/src/utils/program-instant.ts +180 -0
- package/src/utils/program-meta-renderers.ts +18 -0
- package/src/utils/url-safety.ts +43 -0
- package/dist/chunk-2NRLRRMR.cjs.map +0 -1
- package/dist/chunk-3I6XHQUD.js.map +0 -1
- package/dist/chunk-3IPL6G7S.js.map +0 -1
- package/dist/chunk-O4LL7RQV.cjs.map +0 -1
- package/dist/chunk-ORFJVMAL.js.map +0 -1
- package/dist/chunk-OYI3K5R6.cjs.map +0 -1
- package/dist/chunk-SDGMLXIP.js.map +0 -1
- package/dist/chunk-VHB3I6F3.cjs.map +0 -1
- /package/dist/{chunk-YM6L3WM5.js.map → chunk-27RD5XTP.js.map} +0 -0
- /package/dist/{chunk-POPL3W2S.js.map → chunk-3DGRXC74.js.map} +0 -0
- /package/dist/{chunk-6GY6DFIH.js.map → chunk-4WVWRFGP.js.map} +0 -0
- /package/dist/{chunk-6NHLZORM.js.map → chunk-7Q5XXPCB.js.map} +0 -0
- /package/dist/{chunk-3LXJEXPH.js.map → chunk-B3Z3RJRW.js.map} +0 -0
- /package/dist/{chunk-MJ424FEC.js.map → chunk-HOGOQA2X.js.map} +0 -0
- /package/dist/{chunk-HW7BLVQH.js.map → chunk-IXD6SHQ6.js.map} +0 -0
- /package/dist/{chunk-S254VEDE.js.map → chunk-MRIOYSXH.js.map} +0 -0
- /package/dist/{chunk-XWGHLSAL.js.map → chunk-PFV4DAX5.js.map} +0 -0
- /package/dist/{chunk-UFBWNVZZ.js.map → chunk-RNMGKAS6.js.map} +0 -0
- /package/dist/{chunk-ZAIYD3MZ.js.map → chunk-S2KMNFFN.js.map} +0 -0
- /package/dist/{chunk-ZGPJ3NVF.js.map → chunk-SKABQX44.js.map} +0 -0
- /package/dist/{chunk-M7QROULE.js.map → chunk-UEXIMEVU.js.map} +0 -0
- /package/dist/{chunk-J4RZVLLQ.js.map → chunk-VE52MSYC.js.map} +0 -0
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* "Which instant does a program render, in which zone, and does it have a clock
|
|
3
|
+
* at all" — ONE owner, shared by every surface that shows a webinar, event or
|
|
4
|
+
* podcast, in this package AND in the hub.
|
|
5
|
+
*
|
|
6
|
+
* WHY THIS EXISTS. A card must render every part of ONE timestamp in ONE zone.
|
|
7
|
+
* The date used to come from `item.date` while the time beside it came from
|
|
8
|
+
* `start_at` in the event's own IANA zone, so a webinar at
|
|
9
|
+
* `2026-03-20T01:18Z` / `America/New_York` read "Mar 20, 2026 · 9:18 PM" — a
|
|
10
|
+
* date and a time that never coexisted. That was fixed on the public card and
|
|
11
|
+
* then, because the chat card is a SEPARATE component that merely mirrors it in
|
|
12
|
+
* a comment, the chat card kept the bug — and rendered the date in the
|
|
13
|
+
* VIEWER's zone besides, which is also a React #418 hydration mismatch.
|
|
14
|
+
*
|
|
15
|
+
* Two components describing the same rule in prose is how that happens. They
|
|
16
|
+
* now call this. It lives in `utils/` rather than beside the chat cards
|
|
17
|
+
* because it is not chat-specific and because the hub's own program surfaces
|
|
18
|
+
* must be able to import it — while it sat unexported next to the cards, the
|
|
19
|
+
* hub re-derived it by hand and the copies drifted again, which is the third
|
|
20
|
+
* time this one rule has been re-stated.
|
|
21
|
+
*
|
|
22
|
+
* THE RULE:
|
|
23
|
+
*
|
|
24
|
+
* - `item.date` IS the instant to render. The host resolves it once and hands
|
|
25
|
+
* the same value to the card, the model's context and the API wire.
|
|
26
|
+
* Preferring `start_at` looks like it buys intra-card coherence — it does, by
|
|
27
|
+
* disagreeing with everything else.
|
|
28
|
+
* - `start_at` / `end_at` remain the source for DURATION, which is elapsed time
|
|
29
|
+
* rather than a display date.
|
|
30
|
+
*
|
|
31
|
+
* `timezone` here is "the zone this value renders in and may be labelled with".
|
|
32
|
+
* A row that declares none keeps the UTC pin (the React #418 fix).
|
|
33
|
+
*
|
|
34
|
+
*/
|
|
35
|
+
/** Read a string field off an item type that does not declare it. */
|
|
36
|
+
export declare const programStr: (value: unknown) => string | null;
|
|
37
|
+
export interface ProgramInstant {
|
|
38
|
+
/** The instant both the date and the time render from, or null to fall back
|
|
39
|
+
* to `utcDate`. */
|
|
40
|
+
instant: string | null;
|
|
41
|
+
/** The zone this value RENDERS IN and may be LABELLED with. Null when the row
|
|
42
|
+
* declares none. */
|
|
43
|
+
timezone: string | null;
|
|
44
|
+
/** The row's canonical date string, used when there is no zone to render in.
|
|
45
|
+
* Kept on the resolved value so the UTC fallback is not re-derived (and
|
|
46
|
+
* re-formatted differently) at each call site. */
|
|
47
|
+
utcDate: string | null;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* The columns this rule reads. Declared structurally rather than as a
|
|
51
|
+
* `Record<string, unknown>` so a caller holding a real `BaseProgramItem` can
|
|
52
|
+
* pass it straight in: while the parameter was a bare record, every one of the
|
|
53
|
+
* four call sites wrote `as unknown as Record<string, unknown>`.
|
|
54
|
+
*/
|
|
55
|
+
export interface ProgramDateFields {
|
|
56
|
+
date?: unknown;
|
|
57
|
+
start_at?: unknown;
|
|
58
|
+
end_at?: unknown;
|
|
59
|
+
timezone?: unknown;
|
|
60
|
+
}
|
|
61
|
+
/** Resolve what a program item should render. */
|
|
62
|
+
export declare function programDateInstant(item: ProgramDateFields): ProgramInstant;
|
|
63
|
+
/**
|
|
64
|
+
* The scheduling columns the DURATION is measured from — the pair that rides
|
|
65
|
+
* beside a resolved instant.
|
|
66
|
+
*
|
|
67
|
+
* Here rather than at each surface because five call sites projected these two
|
|
68
|
+
* columns in four different shapes (`programStr`, raw reads, `?? null`, and an
|
|
69
|
+
* `in`-guarded cast), which is the same defect one field-pair down from the one
|
|
70
|
+
* this module exists to fix. They are read off the row, never off the resolved
|
|
71
|
+
* instant, because elapsed time is not a display date.
|
|
72
|
+
*/
|
|
73
|
+
export declare function webinarTiming(item: ProgramDateFields): {
|
|
74
|
+
startAt: string | null;
|
|
75
|
+
endAt: string | null;
|
|
76
|
+
};
|
|
77
|
+
/**
|
|
78
|
+
* THE compact meta line a program renders under its title:
|
|
79
|
+
* `"<day> · <type-specific>"` — podcast duration, event location, or webinar
|
|
80
|
+
* time + duration.
|
|
81
|
+
*
|
|
82
|
+
* The public card and the chat card built this separately, under a comment
|
|
83
|
+
* saying the second "mirrors" the first. That is the arrangement this module
|
|
84
|
+
* exists to end: the mirror drifted twice (the chat card rendered the day in
|
|
85
|
+
* the VIEWER's zone, and the two disagreed about labelling the zone on a
|
|
86
|
+
* zoneless row), each time only on the copy nobody was looking at.
|
|
87
|
+
*
|
|
88
|
+
* `kind` rather than the caller's config object, because the two callers key
|
|
89
|
+
* off differently-shaped configs for the same three types.
|
|
90
|
+
*/
|
|
91
|
+
export declare function programMetaLine(item: ProgramDateFields & {
|
|
92
|
+
status?: unknown;
|
|
93
|
+
duration_seconds?: unknown;
|
|
94
|
+
location_name?: unknown;
|
|
95
|
+
}, kind: 'podcast' | 'event' | 'webinar' | (string & {}), fmt: {
|
|
96
|
+
date: (at: ProgramInstant) => string;
|
|
97
|
+
duration: (seconds: number) => string;
|
|
98
|
+
webinarMeta: (at: ProgramInstant, opts: {
|
|
99
|
+
startAt: string | null;
|
|
100
|
+
endAt: string | null;
|
|
101
|
+
}) => string;
|
|
102
|
+
}): {
|
|
103
|
+
at: ProgramInstant;
|
|
104
|
+
typeMeta: string | null;
|
|
105
|
+
line: string;
|
|
106
|
+
};
|
|
107
|
+
/** The shape `programMetaFormatters` adapts — the three renderers a program
|
|
108
|
+
* meta line is built from, supplied by the caller so this leaf stays free of
|
|
109
|
+
* `./format`. */
|
|
110
|
+
export interface ProgramMetaRenderers {
|
|
111
|
+
date: (at: ProgramInstant, style: 'medium' | 'weekday') => string;
|
|
112
|
+
duration: (seconds: number | null) => string;
|
|
113
|
+
webinarMeta: (at: ProgramInstant, opts: {
|
|
114
|
+
startAt: string | null;
|
|
115
|
+
endAt: string | null;
|
|
116
|
+
withZoneLabel?: boolean;
|
|
117
|
+
}) => string;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* The formatter set `programMetaLine` needs, built once.
|
|
121
|
+
*
|
|
122
|
+
* `programMetaLine` unified the DISPATCH; the three formatters passed into it
|
|
123
|
+
* were then mirrored byte-for-byte across the two components the function
|
|
124
|
+
* exists to keep in sync, plus a second `withZoneLabel: false` variant in two
|
|
125
|
+
* more. A mirrored block in exactly those files is the arrangement this module
|
|
126
|
+
* documents as the cause of the original drift.
|
|
127
|
+
*
|
|
128
|
+
* `withZoneLabel` is the only axis: a compact density joins plain strings so
|
|
129
|
+
* the zone rides inline, while the default density renders it as its own styled
|
|
130
|
+
* span and asks for the value without it.
|
|
131
|
+
*
|
|
132
|
+
* Takes its formatters as arguments rather than importing them, so this leaf
|
|
133
|
+
* stays free of `./format` and the two can be tree-shaken apart.
|
|
134
|
+
*/
|
|
135
|
+
export declare function programMetaFormatters(fmt: ProgramMetaRenderers, opts?: {
|
|
136
|
+
withZoneLabel?: boolean;
|
|
137
|
+
}): {
|
|
138
|
+
date: (at: ProgramInstant) => string;
|
|
139
|
+
duration: (seconds: number | null) => string;
|
|
140
|
+
webinarMeta: (at: ProgramInstant, o: {
|
|
141
|
+
startAt: string | null;
|
|
142
|
+
endAt: string | null;
|
|
143
|
+
}) => string;
|
|
144
|
+
};
|
|
145
|
+
//# sourceMappingURL=program-instant.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"program-instant.d.ts","sourceRoot":"","sources":["../../src/utils/program-instant.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,qEAAqE;AACrE,eAAO,MAAM,UAAU,GAAI,OAAO,OAAO,KAAG,MAAM,GAAG,IAA2D,CAAC;AAEjH,MAAM,WAAW,cAAc;IAC7B;wBACoB;IACpB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB;yBACqB;IACrB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB;;uDAEmD;IACnD,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB;AAED;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB;IAChC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,iDAAiD;AACjD,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,iBAAiB,GAAG,cAAc,CAY1E;AAED;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,iBAAiB,GAAG;IACtD,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB,CAIA;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,eAAe,CAC7B,IAAI,EAAE,iBAAiB,GAAG;IACxB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,EACD,IAAI,EAAE,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,EACrD,GAAG,EAAE;IACH,IAAI,EAAE,CAAC,EAAE,EAAE,cAAc,KAAK,MAAM,CAAC;IACrC,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,MAAM,CAAC;IACtC,WAAW,EAAE,CAAC,EAAE,EAAE,cAAc,EAAE,IAAI,EAAE;QAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,KAAK,MAAM,CAAC;CACrG,GACA;IAAE,EAAE,EAAE,cAAc,CAAC;IAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAc/D;AAED;;kBAEkB;AAClB,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,CAAC,EAAE,EAAE,cAAc,EAAE,KAAK,EAAE,QAAQ,GAAG,SAAS,KAAK,MAAM,CAAC;IAClE,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,KAAK,MAAM,CAAC;IAC7C,WAAW,EAAE,CACX,EAAE,EAAE,cAAc,EAClB,IAAI,EAAE;QAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,aAAa,CAAC,EAAE,OAAO,CAAA;KAAE,KAC5E,MAAM,CAAC;CACb;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,oBAAoB,EAAE,IAAI,GAAE;IAAE,aAAa,CAAC,EAAE,OAAO,CAAA;CAAO;eAMxF,cAAc;wBA7BP,MAAM,GAAG,IAAI,KAAK,MAAM;sBA+BxB,cAAc,KAAK;QAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE;EAGxF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"program-meta-renderers.d.ts","sourceRoot":"","sources":["../../src/utils/program-meta-renderers.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAE9D,eAAO,MAAM,sBAAsB,EAAE,oBAIpC,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* URL-safety primitives for the wire DECODER and the render-time guard.
|
|
3
|
+
*
|
|
4
|
+
* `UNSAFE_URL_CHARS` is shared by both: "does this string carry characters that
|
|
5
|
+
* have no business in an href" had two copies once, and a security predicate
|
|
6
|
+
* kept in sync by a comment drifts.
|
|
7
|
+
*
|
|
8
|
+
* `isSameOriginPath` answers "does this path stay on our origin" for the
|
|
9
|
+
* render-time `safeHref` — the ONE gate every chat href passes. The wire decoder
|
|
10
|
+
* does not judge links at all: it carries them, because resolving a link is a
|
|
11
|
+
* client decision (only the rendering page knows where it is embedded), and a
|
|
12
|
+
* second, stricter gate there only dropped links it could not resolve itself.
|
|
13
|
+
*
|
|
14
|
+
* Pure and dependency-free, so the server-safe `chat-protocol` leaf and the
|
|
15
|
+
* client-side card utils can both import it directly.
|
|
16
|
+
*/
|
|
17
|
+
/** Control, zero-width and line-separator characters. Never legitimate in a URL
|
|
18
|
+
* we are about to render, and the classic way a payload smuggles one href past
|
|
19
|
+
* a reader's eye. */
|
|
20
|
+
export declare const UNSAFE_URL_CHARS: RegExp;
|
|
21
|
+
/**
|
|
22
|
+
* Does this candidate stay on the CURRENT origin?
|
|
23
|
+
*
|
|
24
|
+
* Decided by RESOLVING it, never by inspecting the prefix. A prefix test is
|
|
25
|
+
* what a reader reaches for — `startsWith('//')` — and it is not sufficient:
|
|
26
|
+
* the URL parser treats a backslash as a slash in the authority position, so a
|
|
27
|
+
* single-slash path can still resolve to a third-party host while passing every
|
|
28
|
+
* "starts with exactly one slash" check. Any future parser quirk falls to the
|
|
29
|
+
* same class. Asking the parser cannot disagree with what the browser will
|
|
30
|
+
* actually do with the href.
|
|
31
|
+
*/
|
|
32
|
+
export declare function isSameOriginPath(candidate: string): boolean;
|
|
33
|
+
//# sourceMappingURL=url-safety.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"url-safety.d.ts","sourceRoot":"","sources":["../../src/utils/url-safety.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH;;sBAEsB;AACtB,eAAO,MAAM,gBAAgB,QAAyD,CAAC;AAKvF;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAM3D"}
|
package/package.json
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import { describe, expect, it } from 'vitest';
|
|
10
|
+
import { safeHref } from '../../components/chat/utils/compact-card-classes';
|
|
10
11
|
import { decodeNatsChunk } from '../nats-decoder';
|
|
11
12
|
import { mergeSourceMetadata, sourceMetadataEvent, youtubeVideoId } from '../source-metadata';
|
|
12
13
|
|
|
@@ -110,11 +111,49 @@ describe('sourceMetadataEvent', () => {
|
|
|
110
111
|
expect(event?.sources?.[0].name).toBe('First');
|
|
111
112
|
});
|
|
112
113
|
|
|
113
|
-
|
|
114
|
+
// Links are CARRIED, not judged here: resolving a link is a client decision
|
|
115
|
+
// (only the rendering page knows where it is embedded), and safety is enforced
|
|
116
|
+
// once, at render, by `safeHref`. This decoder used to drop what it could not
|
|
117
|
+
// resolve on its own, which is what left chips with a name and no destination.
|
|
118
|
+
it('carries a root-relative external URL for the client to resolve', () => {
|
|
114
119
|
const event = sourceMetadataEvent({
|
|
115
|
-
sources: [
|
|
120
|
+
sources: [
|
|
121
|
+
{
|
|
122
|
+
index: 1,
|
|
123
|
+
name: 'Guide',
|
|
124
|
+
path: 'onboarding-guides/x',
|
|
125
|
+
documentType: 'onboarding_guide',
|
|
126
|
+
externalUrl: '/onboarding-guides/x',
|
|
127
|
+
targetPlatform: 'openframe',
|
|
128
|
+
},
|
|
129
|
+
],
|
|
116
130
|
});
|
|
117
|
-
expect(event?.sources?.[0]).
|
|
131
|
+
expect(event?.sources?.[0].externalUrl).toBe('/onboarding-guides/x');
|
|
132
|
+
expect(event?.sources?.[0].targetPlatform).toBe('openframe');
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
it('carries a root-relative external URL on a grouped item', () => {
|
|
136
|
+
const event = sourceMetadataEvent({
|
|
137
|
+
sources: [
|
|
138
|
+
{
|
|
139
|
+
index: 1,
|
|
140
|
+
name: 'Guides',
|
|
141
|
+
items: [{ id: 'a', documentType: 'onboarding_guide', name: 'A', externalUrl: '/onboarding-guides/a' }],
|
|
142
|
+
},
|
|
143
|
+
],
|
|
144
|
+
});
|
|
145
|
+
expect(event?.sources?.[0].items?.[0].externalUrl).toBe('/onboarding-guides/a');
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
it('carries absolute http and https links alike', () => {
|
|
149
|
+
const event = sourceMetadataEvent({
|
|
150
|
+
sources: [
|
|
151
|
+
{ index: 1, name: 'A', externalUrl: 'https://hub.example/x' },
|
|
152
|
+
{ index: 2, name: 'B', externalUrl: 'http://legacy.example/y' },
|
|
153
|
+
],
|
|
154
|
+
});
|
|
155
|
+
expect(event?.sources?.[0].externalUrl).toBe('https://hub.example/x');
|
|
156
|
+
expect(event?.sources?.[1].externalUrl).toBe('http://legacy.example/y');
|
|
118
157
|
});
|
|
119
158
|
|
|
120
159
|
it('preserves an explicit null targetPlatform, which means "no destination"', () => {
|
|
@@ -241,3 +280,31 @@ describe('mergeSourceMetadata', () => {
|
|
|
241
280
|
expect(mergeSourceMetadata(null, { type: 'sources' })).toEqual({});
|
|
242
281
|
});
|
|
243
282
|
});
|
|
283
|
+
|
|
284
|
+
/**
|
|
285
|
+
* Hostile hrefs. The decoder carries them like any other string; the safety
|
|
286
|
+
* decision is made once, at render, where `safeHref` resolves the candidate and
|
|
287
|
+
* rejects anything that is not a same-origin path or an allowed scheme. Pinned
|
|
288
|
+
* here end to end so removing the decoder's second gate cannot quietly let one
|
|
289
|
+
* reach an anchor.
|
|
290
|
+
*/
|
|
291
|
+
describe('hostile hrefs are neutralised at the render gate', () => {
|
|
292
|
+
const hostile = [
|
|
293
|
+
'/\\evil.test/x',
|
|
294
|
+
'/\\\\evil.test/x',
|
|
295
|
+
'//evil.test/x',
|
|
296
|
+
'/\\/evil.test/x',
|
|
297
|
+
'javascript:alert(1)',
|
|
298
|
+
'data:text/html,<script>alert(1)</script>',
|
|
299
|
+
'/docs/\u200bx',
|
|
300
|
+
];
|
|
301
|
+
it.each(hostile)('%j never becomes an href', href => {
|
|
302
|
+
const event = sourceMetadataEvent({ sources: [{ index: 1, name: 'Doc', externalUrl: href }] });
|
|
303
|
+
expect(safeHref(event?.sources?.[0].externalUrl ?? null)).toBeNull();
|
|
304
|
+
});
|
|
305
|
+
|
|
306
|
+
it('a genuine relative link survives the gate for the client to resolve', () => {
|
|
307
|
+
const event = sourceMetadataEvent({ sources: [{ index: 1, name: 'Doc', externalUrl: '/onboarding-guides/x' }] });
|
|
308
|
+
expect(safeHref(event?.sources?.[0].externalUrl ?? null)).toBe('/onboarding-guides/x');
|
|
309
|
+
});
|
|
310
|
+
});
|
|
@@ -10,13 +10,29 @@
|
|
|
10
10
|
* Everything is validated, and anything that fails is DROPPED rather than
|
|
11
11
|
* repaired: this payload is assembled from a remote MCP server's tool output,
|
|
12
12
|
* so a malformed row means an upstream contract slip, and rendering a chip with
|
|
13
|
-
* a blank title or
|
|
13
|
+
* a blank title or an unsafe href is worse than rendering nothing.
|
|
14
|
+
*
|
|
15
|
+
* LINKS are carried, not judged. A source's `externalUrl` is passed through as
|
|
16
|
+
* the producer sent it — a root-relative path included — because resolving a
|
|
17
|
+
* link is a CLIENT decision: only the page rendering the chip knows where it is
|
|
18
|
+
* embedded. The chat runtime resolves a relative href against the embedder's
|
|
19
|
+
* `defaultContentOrigin` in embed mode and keeps it relative in host mode
|
|
20
|
+
* (`resolveHrefForRuntime`), and every chip href passes the ONE safety gate,
|
|
21
|
+
* `safeHref`, at render (`buildSourceRowCta`). This decoder used to be a second,
|
|
22
|
+
* STRICTER gate that dropped what it could not resolve on its own — every
|
|
23
|
+
* relative link, and any `http:` one — leaving chips with a name and no
|
|
24
|
+
* destination. That is how broken links were made; it is not how they were
|
|
25
|
+
* prevented.
|
|
26
|
+
*
|
|
27
|
+
* MEDIA urls (`<video src>`, posters) are still required to be absolute https:
|
|
28
|
+
* they have no render-time gate and no navigation runtime to resolve them.
|
|
14
29
|
*
|
|
15
30
|
* Server-safe: no React, no browser APIs beyond `URL`.
|
|
16
31
|
*/
|
|
17
32
|
|
|
18
33
|
import type { ChatRef } from '../components/chat/chat-ref.types';
|
|
19
34
|
import type { ChatSource } from '../components/chat/types/message.types';
|
|
35
|
+
import { UNSAFE_URL_CHARS } from '../utils/url-safety';
|
|
20
36
|
import { CARD_REFERENCE } from './card-marker';
|
|
21
37
|
import type { SourcesEvent } from './events';
|
|
22
38
|
import { isRecord } from './wire-narrow';
|
|
@@ -44,11 +60,11 @@ function nullableText(value: unknown): string | null | undefined {
|
|
|
44
60
|
return value === null ? null : text(value);
|
|
45
61
|
}
|
|
46
62
|
|
|
47
|
-
/** An https URL, or nothing
|
|
48
|
-
*
|
|
63
|
+
/** An absolute https URL, or nothing — for MEDIA sources only (see the module
|
|
64
|
+
* note). Links are carried as text and judged once, at render. */
|
|
49
65
|
function httpsUrl(value: unknown): string | undefined {
|
|
50
66
|
const candidate = text(value);
|
|
51
|
-
if (!candidate) return undefined;
|
|
67
|
+
if (!candidate || UNSAFE_URL_CHARS.test(candidate)) return undefined;
|
|
52
68
|
try {
|
|
53
69
|
return new URL(candidate).protocol === 'https:' ? candidate : undefined;
|
|
54
70
|
} catch {
|
|
@@ -89,7 +105,7 @@ function sourceItems(value: unknown): NonNullable<ChatSource['items']> | undefin
|
|
|
89
105
|
// A grouped row without these three has nothing to render OR navigate with.
|
|
90
106
|
if (!id || !documentType || !name) return [];
|
|
91
107
|
|
|
92
|
-
const externalUrl =
|
|
108
|
+
const externalUrl = text(item.externalUrl);
|
|
93
109
|
const targetPlatform = nullableText(item.targetPlatform);
|
|
94
110
|
const path = nullableText(item.path);
|
|
95
111
|
return [
|
|
@@ -133,7 +149,7 @@ function sources(value: unknown): ChatSource[] {
|
|
|
133
149
|
|
|
134
150
|
const path = text(candidate.path);
|
|
135
151
|
const documentType = text(candidate.documentType);
|
|
136
|
-
const externalUrl =
|
|
152
|
+
const externalUrl = text(candidate.externalUrl);
|
|
137
153
|
const targetPlatform = nullableText(candidate.targetPlatform);
|
|
138
154
|
const id = text(candidate.id);
|
|
139
155
|
const sourceRepo = text(candidate.sourceRepo);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { forwardRef, useRef, useEffect } from 'react';
|
|
2
2
|
import type { MouseEvent } from 'react';
|
|
3
3
|
import { cn } from '../../utils/cn';
|
|
4
|
+
import { formatDateWithTimezone, VIEWER_TIMEZONE } from '../../utils/format';
|
|
4
5
|
import { ChatPlusIcon, ChatsIcon, Chevron02RightIcon } from '../icons-v2-generated';
|
|
5
6
|
import { Button } from '../ui/button';
|
|
6
7
|
import { ChatSidebarSkeleton, DialogListItemSkeleton } from './chat-sidebar-skeleton';
|
|
@@ -14,17 +15,9 @@ const DialogListItem = forwardRef<HTMLDivElement, DialogListItemProps>(
|
|
|
14
15
|
};
|
|
15
16
|
|
|
16
17
|
const formatTimestamp = (timestamp?: Date | string) => {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
return (
|
|
20
|
-
date.toLocaleDateString('en-US', {
|
|
21
|
-
year: 'numeric',
|
|
22
|
-
month: '2-digit',
|
|
23
|
-
day: '2-digit',
|
|
24
|
-
}) +
|
|
25
|
-
', ' +
|
|
26
|
-
date.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit', hour12: false })
|
|
27
|
-
);
|
|
18
|
+
// "Your" last-active time in the app shell — the viewer's zone, stated
|
|
19
|
+
// explicitly, with the date and time rendered together by one renderer.
|
|
20
|
+
return formatDateWithTimezone(timestamp, VIEWER_TIMEZONE, 'numericDateTime24h');
|
|
28
21
|
};
|
|
29
22
|
|
|
30
23
|
return (
|
|
@@ -11,7 +11,7 @@ Presentation-only card component for programs (podcasts, webinars, events) suppo
|
|
|
11
11
|
|
|
12
12
|
### Internal Utilities
|
|
13
13
|
|
|
14
|
-
-
|
|
14
|
+
- **Dates** — resolved by `programDateInstant` and rendered by `formatProgramDate` / `formatWebinarTimeMeta` (`../../../utils`), shared with the public page header. A local `formatUtc` twin used to live here; the UTC pin that prevents React #418 is already inside `formatDateWithTimezone` when it is given no zone.
|
|
15
15
|
- **`getHosts(hosts)`** — Normalizes `ProgramHost[]` or raw JSON string into `{ name, avatar }[]`
|
|
16
16
|
- **`MediaGallery`** — Horizontally scrollable thumbnail strip with `ImageGalleryModal` lightbox on click
|
|
17
17
|
|
|
@@ -22,6 +22,7 @@ import { Eye } from 'lucide-react';
|
|
|
22
22
|
import Image from '../../../embed-shims/next-image';
|
|
23
23
|
import type { BlogPostSummary } from '../../../types/blog';
|
|
24
24
|
import { cn } from '../../../utils/cn';
|
|
25
|
+
import { formatDateWithTimezone } from '../../../utils/format';
|
|
25
26
|
import { StatusBadge } from '../../ui/status-badge';
|
|
26
27
|
import {
|
|
27
28
|
COMPACT_CARD_IMAGE_SLOT,
|
|
@@ -133,14 +134,7 @@ export function BlogCard({
|
|
|
133
134
|
const { src: displayImage, onError: onImageError } = useCoverImageFallback(post.featured_image, placeholderUrl);
|
|
134
135
|
|
|
135
136
|
if (size === 'sm') {
|
|
136
|
-
const dateStr = post.published_at
|
|
137
|
-
? new Date(post.published_at).toLocaleDateString('en-US', {
|
|
138
|
-
year: 'numeric',
|
|
139
|
-
month: 'short',
|
|
140
|
-
day: 'numeric',
|
|
141
|
-
timeZone: 'UTC',
|
|
142
|
-
})
|
|
143
|
-
: '';
|
|
137
|
+
const dateStr = post.published_at ? formatDateWithTimezone(post.published_at, null, 'medium') : '';
|
|
144
138
|
const firstCategory = post.categories?.find(c => c && c.name)?.name;
|
|
145
139
|
return (
|
|
146
140
|
<a
|
|
@@ -189,14 +183,7 @@ export function BlogCard({
|
|
|
189
183
|
// Rail/strip density — shared <EntityPortraitCard> shell. Raw cover +
|
|
190
184
|
// placeholder go in separately; the shell runs the SAME shared
|
|
191
185
|
// useCoverImageFallback chain internally (so its error recovery works).
|
|
192
|
-
const dateStr = post.published_at
|
|
193
|
-
? new Date(post.published_at).toLocaleDateString('en-US', {
|
|
194
|
-
year: 'numeric',
|
|
195
|
-
month: 'short',
|
|
196
|
-
day: 'numeric',
|
|
197
|
-
timeZone: 'UTC',
|
|
198
|
-
})
|
|
199
|
-
: '';
|
|
186
|
+
const dateStr = post.published_at ? formatDateWithTimezone(post.published_at, null, 'medium') : '';
|
|
200
187
|
return (
|
|
201
188
|
<EntityPortraitCard
|
|
202
189
|
href={href}
|
|
@@ -218,14 +205,7 @@ export function BlogCard({
|
|
|
218
205
|
}
|
|
219
206
|
|
|
220
207
|
// Default: full vertical card.
|
|
221
|
-
const dateStr = post.published_at
|
|
222
|
-
? new Date(post.published_at).toLocaleDateString('en-US', {
|
|
223
|
-
year: 'numeric',
|
|
224
|
-
month: 'short',
|
|
225
|
-
day: 'numeric',
|
|
226
|
-
timeZone: 'UTC',
|
|
227
|
-
})
|
|
228
|
-
: '';
|
|
208
|
+
const dateStr = post.published_at ? formatDateWithTimezone(post.published_at, null, 'medium') : '';
|
|
229
209
|
return (
|
|
230
210
|
<article
|
|
231
211
|
className={cn(
|
|
@@ -35,12 +35,9 @@ import Image from '../../../embed-shims/next-image';
|
|
|
35
35
|
import { useRouter } from '../../../embed-shims/next-navigation';
|
|
36
36
|
import { formatDateShort } from '../../../utils/date-formatters';
|
|
37
37
|
import { faqItemAnchor } from '../../../utils/faq-anchor';
|
|
38
|
-
import {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
formatTimeWithTimezone,
|
|
42
|
-
formatDurationFromRange,
|
|
43
|
-
} from '../../../utils/format';
|
|
38
|
+
import { formatDateUTC as formatDate } from '../../../utils/format';
|
|
39
|
+
import { programMetaFormatters, programMetaLine } from '../../../utils/program-instant';
|
|
40
|
+
import { PROGRAM_META_RENDERERS } from '../../../utils/program-meta-renderers';
|
|
44
41
|
import { MingoIcon } from '../../icons';
|
|
45
42
|
import { ArrowRightUpIcon } from '../../icons-v2-generated/arrows/arrow-right-up-icon';
|
|
46
43
|
import { ClickupLogoIcon } from '../../icons-v2-generated/brand-logos/clickup-logo-icon';
|
|
@@ -1105,27 +1102,12 @@ function ProgramChatCard({
|
|
|
1105
1102
|
<MicrophoneIcon size={24} />
|
|
1106
1103
|
);
|
|
1107
1104
|
|
|
1108
|
-
//
|
|
1109
|
-
//
|
|
1110
|
-
//
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
configKey === 'podcast' &&
|
|
1115
|
-
typeof item?.duration_seconds === 'number' &&
|
|
1116
|
-
item.duration_seconds > 0 &&
|
|
1117
|
-
!isScheduled
|
|
1118
|
-
) {
|
|
1119
|
-
typeMeta = formatDurationCompact(item.duration_seconds);
|
|
1120
|
-
} else if (configKey === 'event' && typeof item?.location_name === 'string' && item.location_name.trim().length > 0) {
|
|
1121
|
-
typeMeta = item.location_name;
|
|
1122
|
-
} else if (configKey === 'webinar' && item?.start_at) {
|
|
1123
|
-
const time = formatTimeWithTimezone(item.start_at, item.timezone ?? null);
|
|
1124
|
-
const dur = formatDurationFromRange(item.start_at, item.end_at);
|
|
1125
|
-
typeMeta = dur ? `${time} · ${dur}` : time;
|
|
1126
|
-
}
|
|
1127
|
-
const itemDate = formatDate(item?.date ?? null, { fallback: '', timezone: 'local' });
|
|
1128
|
-
const meta = [itemDate, typeMeta].filter(Boolean).join(' · ');
|
|
1105
|
+
// The compact meta line, built by the SAME function the public card uses.
|
|
1106
|
+
// This block used to mirror that one in prose — and drifted twice: it rendered
|
|
1107
|
+
// the DATE in the VIEWER's zone (`timezone: 'local'`) beside a time in the
|
|
1108
|
+
// EVENT's zone, and it labelled the zone on a different condition. The type
|
|
1109
|
+
// label itself lives in the status pill, so it is omitted here.
|
|
1110
|
+
const { line: meta } = programMetaLine(item ?? {}, configKey, programMetaFormatters(PROGRAM_META_RENDERERS));
|
|
1129
1111
|
|
|
1130
1112
|
return (
|
|
1131
1113
|
<EntityMingoCard
|