@flamingo-stack/openframe-frontend-core 0.0.644-2208.6338.1 → 0.0.644
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 +2 -2
- package/dist/chat-protocol/index.cjs.map +1 -1
- package/dist/chat-protocol/index.js +2 -2
- package/dist/chat-protocol/index.js.map +1 -1
- package/dist/chat-protocol/source-metadata.d.ts +14 -7
- package/dist/chat-protocol/source-metadata.d.ts.map +1 -1
- package/dist/{chunk-NUM4HHBK.js → chunk-27RD5XTP.js} +3 -3
- package/dist/{chunk-EHL24T5A.js → chunk-3DGRXC74.js} +3 -3
- package/dist/{chunk-HGLTNB3J.cjs → chunk-3UBT2OIX.cjs} +20 -20
- package/dist/{chunk-HGLTNB3J.cjs.map → chunk-3UBT2OIX.cjs.map} +1 -1
- package/dist/{chunk-7NVFN4ZL.js → chunk-4WVWRFGP.js} +6 -6
- package/dist/{chunk-S3DZK5TT.cjs → chunk-65EVGKFV.cjs} +7 -7
- package/dist/{chunk-S3DZK5TT.cjs.map → chunk-65EVGKFV.cjs.map} +1 -1
- package/dist/{chunk-LT4SBH5F.js → chunk-7Q5XXPCB.js} +6 -6
- package/dist/{chunk-I5X3AEXW.cjs → chunk-7R2DIGG4.cjs} +2 -6
- package/dist/chunk-7R2DIGG4.cjs.map +1 -0
- package/dist/{chunk-3IIO432P.js → chunk-B3Z3RJRW.js} +2 -2
- package/dist/{chunk-X5NEQSGO.cjs → chunk-B5IFXCRF.cjs} +22 -22
- package/dist/{chunk-X5NEQSGO.cjs.map → chunk-B5IFXCRF.cjs.map} +1 -1
- package/dist/{chunk-AEOKRT2V.cjs → chunk-C5Y5T6GC.cjs} +15 -15
- package/dist/{chunk-AEOKRT2V.cjs.map → chunk-C5Y5T6GC.cjs.map} +1 -1
- package/dist/{chunk-U3VUTYJO.cjs → chunk-CBXZSTAG.cjs} +152 -152
- package/dist/{chunk-U3VUTYJO.cjs.map → chunk-CBXZSTAG.cjs.map} +1 -1
- package/dist/{chunk-ZJQMZMZD.cjs → chunk-DCCY54LU.cjs} +6 -6
- package/dist/{chunk-ZJQMZMZD.cjs.map → chunk-DCCY54LU.cjs.map} +1 -1
- package/dist/{chunk-IR2WBWIH.cjs → chunk-FAD5WURS.cjs} +81 -81
- package/dist/{chunk-IR2WBWIH.cjs.map → chunk-FAD5WURS.cjs.map} +1 -1
- package/dist/{chunk-NHQBAAKW.js → chunk-FOSIR4QF.js} +2 -6
- package/dist/chunk-FOSIR4QF.js.map +1 -0
- package/dist/{chunk-OT2ZEKLJ.js → chunk-HOGOQA2X.js} +2 -2
- package/dist/{chunk-P22QC266.js → chunk-HPWLIYRL.js} +3 -3
- package/dist/{chunk-X7OGQRZR.js → chunk-I57XLISO.js} +4 -4
- package/dist/{chunk-X7OGQRZR.js.map → chunk-I57XLISO.js.map} +1 -1
- package/dist/{chunk-SHSD7KJ4.cjs → chunk-IIXB5REN.cjs} +3 -3
- package/dist/{chunk-SHSD7KJ4.cjs.map → chunk-IIXB5REN.cjs.map} +1 -1
- package/dist/{chunk-OTZB66SU.js → chunk-IXD6SHQ6.js} +4 -4
- package/dist/{chunk-J227IYWA.cjs → chunk-LZYPSDFE.cjs} +59 -59
- package/dist/{chunk-J227IYWA.cjs.map → chunk-LZYPSDFE.cjs.map} +1 -1
- package/dist/{chunk-5NY3FAOW.cjs → chunk-MCQAOIUK.cjs} +28 -28
- package/dist/{chunk-5NY3FAOW.cjs.map → chunk-MCQAOIUK.cjs.map} +1 -1
- package/dist/{chunk-ISUFPQ6K.js → chunk-MRIOYSXH.js} +3 -3
- package/dist/{chunk-4PASSDJ6.cjs → chunk-OMSUWB6A.cjs} +29 -29
- package/dist/{chunk-4PASSDJ6.cjs.map → chunk-OMSUWB6A.cjs.map} +1 -1
- package/dist/{chunk-VADHSV6U.cjs → chunk-OVXYX47B.cjs} +10 -10
- package/dist/{chunk-VADHSV6U.cjs.map → chunk-OVXYX47B.cjs.map} +1 -1
- package/dist/{chunk-VXPPAEVX.js → chunk-PFV4DAX5.js} +4 -4
- package/dist/{chunk-JIV55LTZ.cjs → chunk-RB6L5EGM.cjs} +203 -203
- package/dist/{chunk-JIV55LTZ.cjs.map → chunk-RB6L5EGM.cjs.map} +1 -1
- package/dist/{chunk-EUI2MDXC.cjs → chunk-RFFF2EYD.cjs} +11 -11
- package/dist/{chunk-EUI2MDXC.cjs.map → chunk-RFFF2EYD.cjs.map} +1 -1
- package/dist/{chunk-SKTE6T47.js → chunk-RNMGKAS6.js} +7 -7
- package/dist/{chunk-NTN4ZLAV.cjs → chunk-RWURXICE.cjs} +32 -32
- package/dist/{chunk-NTN4ZLAV.cjs.map → chunk-RWURXICE.cjs.map} +1 -1
- package/dist/{chunk-PB3X3AAY.js → chunk-S2KMNFFN.js} +3 -3
- package/dist/{chunk-YNVZ5VJJ.js → chunk-SKABQX44.js} +3 -3
- package/dist/{chunk-5K67KZH7.cjs → chunk-TGUA3C4U.cjs} +5 -5
- package/dist/{chunk-5K67KZH7.cjs.map → chunk-TGUA3C4U.cjs.map} +1 -1
- package/dist/{chunk-52Y2AHM6.js → chunk-TTVOBWAH.js} +3 -3
- package/dist/{chunk-7ZMKUISO.js → chunk-UEXIMEVU.js} +5 -5
- package/dist/{chunk-MLIVKPZI.cjs → chunk-UKV52KAP.cjs} +33 -33
- package/dist/{chunk-MLIVKPZI.cjs.map → chunk-UKV52KAP.cjs.map} +1 -1
- package/dist/{chunk-HMNGAQJ6.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/index.cjs +3 -3
- package/dist/components/chat/index.js +2 -2
- package/dist/components/chat/types/entities/program-types.d.ts +2 -23
- package/dist/components/chat/types/entities/program-types.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 -53
- package/dist/components/index.js +15 -15
- package/dist/components/meeting-scheduler/index.cjs +40 -40
- 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 +9 -9
- package/dist/index.js +7 -7
- package/dist/utils/format.d.ts +10 -17
- package/dist/utils/format.d.ts.map +1 -1
- package/dist/utils/index.cjs +1 -5
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.js +1 -5
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/program-instant.d.ts +9 -35
- package/dist/utils/program-instant.d.ts.map +1 -1
- package/dist/utils/url-safety.d.ts +5 -6
- package/dist/utils/url-safety.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/chat-protocol/__tests__/source-metadata.test.ts +34 -48
- package/src/chat-protocol/source-metadata.ts +18 -12
- package/src/components/chat/types/entities/program-types.ts +2 -23
- package/src/utils/__tests__/format-program-dates.test.ts +2 -34
- package/src/utils/__tests__/program-instant.test.ts +1 -46
- package/src/utils/format.ts +12 -23
- package/src/utils/program-instant.ts +13 -44
- package/src/utils/url-safety.ts +5 -6
- package/dist/chunk-I5X3AEXW.cjs.map +0 -1
- package/dist/chunk-NHQBAAKW.js.map +0 -1
- /package/dist/{chunk-NUM4HHBK.js.map → chunk-27RD5XTP.js.map} +0 -0
- /package/dist/{chunk-EHL24T5A.js.map → chunk-3DGRXC74.js.map} +0 -0
- /package/dist/{chunk-7NVFN4ZL.js.map → chunk-4WVWRFGP.js.map} +0 -0
- /package/dist/{chunk-LT4SBH5F.js.map → chunk-7Q5XXPCB.js.map} +0 -0
- /package/dist/{chunk-3IIO432P.js.map → chunk-B3Z3RJRW.js.map} +0 -0
- /package/dist/{chunk-OT2ZEKLJ.js.map → chunk-HOGOQA2X.js.map} +0 -0
- /package/dist/{chunk-P22QC266.js.map → chunk-HPWLIYRL.js.map} +0 -0
- /package/dist/{chunk-OTZB66SU.js.map → chunk-IXD6SHQ6.js.map} +0 -0
- /package/dist/{chunk-ISUFPQ6K.js.map → chunk-MRIOYSXH.js.map} +0 -0
- /package/dist/{chunk-VXPPAEVX.js.map → chunk-PFV4DAX5.js.map} +0 -0
- /package/dist/{chunk-SKTE6T47.js.map → chunk-RNMGKAS6.js.map} +0 -0
- /package/dist/{chunk-PB3X3AAY.js.map → chunk-S2KMNFFN.js.map} +0 -0
- /package/dist/{chunk-YNVZ5VJJ.js.map → chunk-SKABQX44.js.map} +0 -0
- /package/dist/{chunk-52Y2AHM6.js.map → chunk-TTVOBWAH.js.map} +0 -0
- /package/dist/{chunk-7ZMKUISO.js.map → chunk-UEXIMEVU.js.map} +0 -0
- /package/dist/{chunk-HMNGAQJ6.js.map → chunk-VE52MSYC.js.map} +0 -0
|
@@ -21,34 +21,16 @@
|
|
|
21
21
|
*
|
|
22
22
|
* THE RULE:
|
|
23
23
|
*
|
|
24
|
-
* - `item.date` IS the instant to render. The host resolves it once
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
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
28
|
* - `start_at` / `end_at` remain the source for DURATION, which is elapsed time
|
|
29
29
|
* rather than a display date.
|
|
30
|
-
* - A DISPLAY OVERRIDE is a chosen date, not a moment. An admin backdating in a
|
|
31
|
-
* `datetime-local` control gets `00:00`, so "show this as March 19" is stored
|
|
32
|
-
* at UTC midnight; rendering that in a west-of-UTC zone shows March 18 at
|
|
33
|
-
* 8 PM — a day early, at a time nobody chose. Such a value renders UTC-pinned
|
|
34
|
-
* with no clock and WITHOUT A ZONE LABEL.
|
|
35
30
|
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
* through `toISOString()`, so it is always a full instant — an earlier
|
|
39
|
-
* attempt keyed on precision and could therefore never fire.
|
|
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).
|
|
40
33
|
*
|
|
41
|
-
* THE ZONE IS NULLED RATHER THAN FLAGGED, deliberately. `timezone` here is "the
|
|
42
|
-
* zone this value renders in and may be labelled with", so a day-valued row
|
|
43
|
-
* carries none and a consumer CANNOT print `America/New_York` under a clock the
|
|
44
|
-
* rule just suppressed. Three surfaces had to remember that gate; two forgot,
|
|
45
|
-
* and one of them rendered a bare IANA string under an empty heading. A rule
|
|
46
|
-
* enforced by the shape of the data cannot be forgotten by the next call site.
|
|
47
|
-
*
|
|
48
|
-
* There is deliberately NO escape hatch back to the un-nulled zone. One was
|
|
49
|
-
* added ("for the rare consumer that needs it as data") and no consumer ever
|
|
50
|
-
* wanted it — an un-nulled copy hanging off the resolved value is just the
|
|
51
|
-
* mistake again, one property away.
|
|
52
34
|
*/
|
|
53
35
|
|
|
54
36
|
/** Read a string field off an item type that does not declare it. */
|
|
@@ -59,12 +41,8 @@ export interface ProgramInstant {
|
|
|
59
41
|
* to `utcDate`. */
|
|
60
42
|
instant: string | null;
|
|
61
43
|
/** The zone this value RENDERS IN and may be LABELLED with. Null when the row
|
|
62
|
-
* declares none
|
|
63
|
-
* on why this is nulled rather than flagged. */
|
|
44
|
+
* declares none. */
|
|
64
45
|
timezone: string | null;
|
|
65
|
-
/** True when an admin display override supplied the value: render the day
|
|
66
|
-
* UTC-pinned, with no clock. */
|
|
67
|
-
dateOnly: boolean;
|
|
68
46
|
/** The row's canonical date string, used when there is no zone to render in.
|
|
69
47
|
* Kept on the resolved value so the UTC fallback is not re-derived (and
|
|
70
48
|
* re-formatted differently) at each call site. */
|
|
@@ -75,33 +53,26 @@ export interface ProgramInstant {
|
|
|
75
53
|
* The columns this rule reads. Declared structurally rather than as a
|
|
76
54
|
* `Record<string, unknown>` so a caller holding a real `BaseProgramItem` can
|
|
77
55
|
* pass it straight in: while the parameter was a bare record, every one of the
|
|
78
|
-
* four call sites wrote `as unknown as Record<string, unknown
|
|
79
|
-
* every call site is how a producer that forgets to set the flag goes
|
|
80
|
-
* unnoticed by the compiler.
|
|
56
|
+
* four call sites wrote `as unknown as Record<string, unknown>`.
|
|
81
57
|
*/
|
|
82
58
|
export interface ProgramDateFields {
|
|
83
59
|
date?: unknown;
|
|
84
60
|
start_at?: unknown;
|
|
85
61
|
end_at?: unknown;
|
|
86
62
|
timezone?: unknown;
|
|
87
|
-
date_is_display_override?: unknown;
|
|
88
63
|
}
|
|
89
64
|
|
|
90
65
|
/** Resolve what a program item should render. */
|
|
91
66
|
export function programDateInstant(item: ProgramDateFields): ProgramInstant {
|
|
92
|
-
const
|
|
93
|
-
const dateOnly = item.date_is_display_override === true;
|
|
67
|
+
const timezone = programStr(item.timezone);
|
|
94
68
|
const date = programStr(item.date);
|
|
95
69
|
const startAt = programStr(item.start_at);
|
|
96
70
|
|
|
97
|
-
// A
|
|
98
|
-
//
|
|
99
|
-
// "fixed" into a viewer-local render.
|
|
100
|
-
const timezone = dateOnly ? null : declaredZone;
|
|
71
|
+
// A row that declares no zone keeps the caller's UTC pin — which is the
|
|
72
|
+
// React #418 fix and must not be "fixed" into a viewer-local render.
|
|
101
73
|
return {
|
|
102
74
|
instant: timezone ? (date ?? startAt) : null,
|
|
103
75
|
timezone,
|
|
104
|
-
dateOnly,
|
|
105
76
|
utcDate: date ?? startAt,
|
|
106
77
|
};
|
|
107
78
|
}
|
|
@@ -114,16 +85,14 @@ export function programDateInstant(item: ProgramDateFields): ProgramInstant {
|
|
|
114
85
|
* columns in four different shapes (`programStr`, raw reads, `?? null`, and an
|
|
115
86
|
* `in`-guarded cast), which is the same defect one field-pair down from the one
|
|
116
87
|
* this module exists to fix. They are read off the row, never off the resolved
|
|
117
|
-
* instant, because elapsed time is not a display date
|
|
118
|
-
* day shown, and a webinar still runs for 45 minutes.
|
|
88
|
+
* instant, because elapsed time is not a display date.
|
|
119
89
|
*/
|
|
120
90
|
export function webinarTiming(item: ProgramDateFields): {
|
|
121
91
|
startAt: string | null;
|
|
122
92
|
endAt: string | null;
|
|
123
93
|
} {
|
|
124
94
|
// No `timezone` here on purpose: it would be a second derivation of what
|
|
125
|
-
// `programDateInstant` already resolved
|
|
126
|
-
// site could reintroduce a zone the day-valued rule just dropped).
|
|
95
|
+
// `programDateInstant` already resolved.
|
|
127
96
|
return { startAt: programStr(item.start_at), endAt: programStr(item.end_at) };
|
|
128
97
|
}
|
|
129
98
|
|
package/src/utils/url-safety.ts
CHANGED
|
@@ -5,12 +5,11 @@
|
|
|
5
5
|
* have no business in an href" had two copies once, and a security predicate
|
|
6
6
|
* kept in sync by a comment drifts.
|
|
7
7
|
*
|
|
8
|
-
* `isSameOriginPath`
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* decoder accepts absolute https only.
|
|
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.
|
|
14
13
|
*
|
|
15
14
|
* Pure and dependency-free, so the server-safe `chat-protocol` leaf and the
|
|
16
15
|
* client-side card utils can both import it directly.
|