@flamingo-stack/openframe-frontend-core 0.0.582-1967.5390.1 → 0.0.582
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/chunk-2EIGO6ZS.js +1055 -0
- package/dist/chunk-2EIGO6ZS.js.map +1 -0
- package/dist/{chunk-PDK6KVU6.js → chunk-53ZVUW2M.js} +4 -4
- package/dist/{chunk-BTXJQPGE.js → chunk-5U2FU5LM.js} +2 -2
- package/dist/{chunk-VG2SRECA.cjs → chunk-7WE6FGGK.cjs} +49 -49
- package/dist/{chunk-VG2SRECA.cjs.map → chunk-7WE6FGGK.cjs.map} +1 -1
- package/dist/{chunk-EXBNO6FB.js → chunk-CJW6KZD3.js} +2 -2
- package/dist/{chunk-UQXQCM3F.cjs → chunk-E4TK2BBD.cjs} +3 -3
- package/dist/{chunk-UQXQCM3F.cjs.map → chunk-E4TK2BBD.cjs.map} +1 -1
- package/dist/{chunk-NOO3QOJI.js → chunk-EULY3BXB.js} +2 -2
- package/dist/{chunk-ML22BIKH.js → chunk-GAL6EXUY.js} +3 -3
- package/dist/{chunk-YTZK2ORN.js → chunk-H7K76TPX.js} +4 -4
- package/dist/{chunk-RH7EY7YN.cjs → chunk-HMEEW73F.cjs} +1978 -237
- package/dist/chunk-HMEEW73F.cjs.map +1 -0
- package/dist/{chunk-KNQZZJYJ.js → chunk-IB23CRL2.js} +2 -2
- package/dist/{chunk-GHYWIVSU.cjs → chunk-IVJ6TBVW.cjs} +34 -34
- package/dist/{chunk-GHYWIVSU.cjs.map → chunk-IVJ6TBVW.cjs.map} +1 -1
- package/dist/{chunk-XJ3Y4OOF.js → chunk-IZGXIZWF.js} +2 -2
- package/dist/chunk-JMWLF2GL.cjs +1055 -0
- package/dist/chunk-JMWLF2GL.cjs.map +1 -0
- package/dist/{chunk-MCFETAH7.js → chunk-JUXCEHK2.js} +2 -2
- package/dist/{chunk-KX4F4O26.cjs → chunk-KS7NKONC.cjs} +3 -3
- package/dist/{chunk-KX4F4O26.cjs.map → chunk-KS7NKONC.cjs.map} +1 -1
- package/dist/{chunk-VYNYJVSE.cjs → chunk-LHQ6RVFE.cjs} +17 -17
- package/dist/{chunk-VYNYJVSE.cjs.map → chunk-LHQ6RVFE.cjs.map} +1 -1
- package/dist/{chunk-LGHMGCUG.cjs → chunk-M3ERSHPM.cjs} +4 -4
- package/dist/{chunk-LGHMGCUG.cjs.map → chunk-M3ERSHPM.cjs.map} +1 -1
- package/dist/{chunk-Q7X74UZF.cjs → chunk-RBMVTCRM.cjs} +3 -3
- package/dist/{chunk-Q7X74UZF.cjs.map → chunk-RBMVTCRM.cjs.map} +1 -1
- package/dist/{chunk-LYU3IZOA.cjs → chunk-RILGQ2OY.cjs} +10 -10
- package/dist/{chunk-LYU3IZOA.cjs.map → chunk-RILGQ2OY.cjs.map} +1 -1
- package/dist/{chunk-T6DRWYLM.cjs → chunk-RQMS2CF5.cjs} +17 -17
- package/dist/{chunk-T6DRWYLM.cjs.map → chunk-RQMS2CF5.cjs.map} +1 -1
- package/dist/{chunk-TC47NAJ3.cjs → chunk-S2ZXUQLR.cjs} +16 -16
- package/dist/{chunk-TC47NAJ3.cjs.map → chunk-S2ZXUQLR.cjs.map} +1 -1
- package/dist/{chunk-G3ZMLSKJ.js → chunk-SM6JAZ4C.js} +2 -2
- package/dist/{chunk-LENIASJW.js → chunk-T4DIAKIK.js} +2 -2
- package/dist/{chunk-ODOFQLSP.cjs → chunk-TMNFC24G.cjs} +13 -13
- package/dist/{chunk-ODOFQLSP.cjs.map → chunk-TMNFC24G.cjs.map} +1 -1
- package/dist/{chunk-FVF2MVIT.js → chunk-U6GFESVF.js} +2 -2
- package/dist/{chunk-2T7GXHRQ.js → chunk-XA5UPYWE.js} +2745 -1004
- package/dist/chunk-XA5UPYWE.js.map +1 -0
- package/dist/{chunk-TVLQVTZ6.cjs → chunk-XNSEZVV4.cjs} +4 -4
- package/dist/{chunk-TVLQVTZ6.cjs.map → chunk-XNSEZVV4.cjs.map} +1 -1
- package/dist/{chunk-XJJ2D64Q.cjs → chunk-YU4QZ6I6.cjs} +3 -3
- package/dist/{chunk-XJJ2D64Q.cjs.map → chunk-YU4QZ6I6.cjs.map} +1 -1
- package/dist/{chunk-LFG5JG2D.js → chunk-ZSENCE55.js} +5 -5
- package/dist/components/case-studies/index.cjs +8 -8
- package/dist/components/case-studies/index.js +2 -2
- package/dist/components/contact/index.cjs +3 -3
- package/dist/components/contact/index.js +2 -2
- package/dist/components/docs/index.cjs +6 -6
- package/dist/components/docs/index.js +5 -5
- package/dist/components/embeds/index.cjs +3 -3
- package/dist/components/embeds/index.js +2 -2
- package/dist/components/faq/index.cjs +3 -3
- package/dist/components/faq/index.js +2 -2
- package/dist/components/features/index.cjs +2 -2
- package/dist/components/features/index.js +1 -1
- package/dist/components/features/push-button-selector.d.ts +29 -1
- package/dist/components/features/push-button-selector.d.ts.map +1 -1
- package/dist/components/help-center-pages/index.cjs +22 -22
- package/dist/components/help-center-pages/index.js +13 -13
- package/dist/components/index.cjs +61 -892
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.js +244 -1075
- package/dist/components/index.js.map +1 -1
- package/dist/components/meeting-scheduler/index.cjs +18 -18
- package/dist/components/meeting-scheduler/index.js +1 -1
- package/dist/components/navigation/index.cjs +5 -5
- package/dist/components/navigation/index.js +4 -4
- package/dist/components/onboarding-guides/index.cjs +5 -5
- package/dist/components/onboarding-guides/index.js +4 -4
- package/dist/components/tickets/index.cjs +6 -6
- package/dist/components/tickets/index.js +5 -5
- package/dist/components/ui/index.cjs +2 -2
- package/dist/components/ui/index.js +1 -1
- package/dist/index.cjs +6 -6
- package/dist/index.js +5 -5
- package/dist/utils/announcement-storage.d.ts +16 -25
- package/dist/utils/announcement-storage.d.ts.map +1 -1
- package/dist/utils/dismiss-cookie.d.ts +8 -27
- package/dist/utils/dismiss-cookie.d.ts.map +1 -1
- package/dist/utils/dismissal-storage.d.ts +2 -2
- package/dist/utils/dismissal-storage.d.ts.map +1 -1
- package/dist/utils/index.cjs +53 -70
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.js +53 -70
- package/dist/utils/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/features/.push-button-selector.md +1 -1
- package/src/components/features/push-button-selector.tsx +142 -17
- package/src/utils/announcement-storage.ts +16 -25
- package/src/utils/dismiss-cookie.ts +9 -86
- package/src/utils/dismissal-storage.ts +2 -2
- package/dist/chunk-2T7GXHRQ.js.map +0 -1
- package/dist/chunk-FWNIZC6A.js +0 -1867
- package/dist/chunk-FWNIZC6A.js.map +0 -1
- package/dist/chunk-IHFTLVDF.cjs +0 -1867
- package/dist/chunk-IHFTLVDF.cjs.map +0 -1
- package/dist/chunk-RH7EY7YN.cjs.map +0 -1
- package/src/utils/__tests__/dismiss-cookie.test.ts +0 -133
- /package/dist/{chunk-PDK6KVU6.js.map → chunk-53ZVUW2M.js.map} +0 -0
- /package/dist/{chunk-BTXJQPGE.js.map → chunk-5U2FU5LM.js.map} +0 -0
- /package/dist/{chunk-EXBNO6FB.js.map → chunk-CJW6KZD3.js.map} +0 -0
- /package/dist/{chunk-NOO3QOJI.js.map → chunk-EULY3BXB.js.map} +0 -0
- /package/dist/{chunk-ML22BIKH.js.map → chunk-GAL6EXUY.js.map} +0 -0
- /package/dist/{chunk-YTZK2ORN.js.map → chunk-H7K76TPX.js.map} +0 -0
- /package/dist/{chunk-KNQZZJYJ.js.map → chunk-IB23CRL2.js.map} +0 -0
- /package/dist/{chunk-XJ3Y4OOF.js.map → chunk-IZGXIZWF.js.map} +0 -0
- /package/dist/{chunk-MCFETAH7.js.map → chunk-JUXCEHK2.js.map} +0 -0
- /package/dist/{chunk-G3ZMLSKJ.js.map → chunk-SM6JAZ4C.js.map} +0 -0
- /package/dist/{chunk-LENIASJW.js.map → chunk-T4DIAKIK.js.map} +0 -0
- /package/dist/{chunk-FVF2MVIT.js.map → chunk-U6GFESVF.js.map} +0 -0
- /package/dist/{chunk-LFG5JG2D.js.map → chunk-ZSENCE55.js.map} +0 -0
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tier selection on both sides of the cookie-averse split, plus the match rule
|
|
3
|
-
* the two tiers feed.
|
|
4
|
-
*
|
|
5
|
-
* `document.URL` is stubbed rather than the document navigated: jsdom will not
|
|
6
|
-
* take a `tauri://` document URL, and the scheme is the only input the tier
|
|
7
|
-
* choice reads — so the stub sits exactly at the seam production reads.
|
|
8
|
-
*
|
|
9
|
-
* The round-trips run against the real stores rather than spies: reading a
|
|
10
|
-
* value back is the only proof a write actually stuck, which is the whole
|
|
11
|
-
* subject of this file.
|
|
12
|
-
*/
|
|
13
|
-
import { afterEach, beforeEach, describe, expect, it } from 'vitest';
|
|
14
|
-
import { clearDismissCookie, isDismissedCookieValue, readDismissCookie, writeDismissCookie } from '../dismiss-cookie';
|
|
15
|
-
|
|
16
|
-
const KEY = 'openframe-walkthrough-video-dismissed';
|
|
17
|
-
const nativeUrlDescriptor = Object.getOwnPropertyDescriptor(Document.prototype, 'URL');
|
|
18
|
-
|
|
19
|
-
function setDocumentUrl(url: string): void {
|
|
20
|
-
Object.defineProperty(document, 'URL', { value: url, writable: true, configurable: true });
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
afterEach(() => {
|
|
24
|
-
// Restore the native accessor rather than re-stubbing a hardcoded URL, which
|
|
25
|
-
// would silently diverge from jsdom's own document URL if the vitest
|
|
26
|
-
// environment is ever given an explicit one.
|
|
27
|
-
if (nativeUrlDescriptor) Object.defineProperty(document, 'URL', nativeUrlDescriptor);
|
|
28
|
-
clearDismissCookie(KEY);
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
describe('dismissal on an http(s) origin', () => {
|
|
32
|
-
beforeEach(() => setDocumentUrl('https://openframe.ai/dashboard'));
|
|
33
|
-
|
|
34
|
-
it('round-trips through the cookie', () => {
|
|
35
|
-
writeDismissCookie(KEY, 'video-7');
|
|
36
|
-
expect(document.cookie).toContain(`${KEY}=video-7`);
|
|
37
|
-
expect(readDismissCookie(KEY)).toBe('video-7');
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
it('takes the cookie tier on plain http too', () => {
|
|
41
|
-
// Dev runs on `http://localhost`. Were only `https:` accepted, it would
|
|
42
|
-
// silently drop to the fallback tier, where SSR cannot see the dismissal.
|
|
43
|
-
setDocumentUrl('http://localhost:3000/dashboard');
|
|
44
|
-
writeDismissCookie(KEY, 'video-7');
|
|
45
|
-
expect(document.cookie).toContain(`${KEY}=video-7`);
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
it('leaves the fallback tier untouched', () => {
|
|
49
|
-
// Pins fallback-not-mirror; see `fallbackStore`.
|
|
50
|
-
writeDismissCookie(KEY, 'video-7');
|
|
51
|
-
expect(window.localStorage.getItem(KEY)).toBeNull();
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
it('fails open on a malformed cookie value', () => {
|
|
55
|
-
// `decodeURIComponent` throws `URIError` on bad percent-encoding; the other
|
|
56
|
-
// half of the guarantee `readDismissCookie` documents.
|
|
57
|
-
document.cookie = `${KEY}=%E0%A4%A; path=/`;
|
|
58
|
-
expect(readDismissCookie(KEY)).toBeUndefined();
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
it('clears the cookie tier', () => {
|
|
62
|
-
writeDismissCookie(KEY, 'video-7');
|
|
63
|
-
clearDismissCookie(KEY);
|
|
64
|
-
expect(document.cookie).not.toContain(KEY);
|
|
65
|
-
expect(readDismissCookie(KEY)).toBeUndefined();
|
|
66
|
-
});
|
|
67
|
-
});
|
|
68
|
-
|
|
69
|
-
describe('dismissal on a cookie-averse origin (tauri://, capacitor://)', () => {
|
|
70
|
-
beforeEach(() => setDocumentUrl('tauri://localhost/index.html'));
|
|
71
|
-
|
|
72
|
-
it('writes no cookie', () => {
|
|
73
|
-
writeDismissCookie(KEY, 'video-7');
|
|
74
|
-
expect(document.cookie).not.toContain(KEY);
|
|
75
|
-
});
|
|
76
|
-
|
|
77
|
-
it('persists through localStorage and keeps the id-match rule', () => {
|
|
78
|
-
writeDismissCookie(KEY, 'video-7');
|
|
79
|
-
// jsdom keys its cookie jar off the REAL document URL, not the stub above,
|
|
80
|
-
// so a cookie-only implementation's write would still land here and serve
|
|
81
|
-
// the reads below. Emptying the jar first is what makes them prove the
|
|
82
|
-
// value came from the fallback tier; the assertion confirms the wipe took,
|
|
83
|
-
// since a path or domain mismatch would leave the cookie in place and
|
|
84
|
-
// hollow out both reads.
|
|
85
|
-
document.cookie = `${KEY}=; path=/; max-age=0`;
|
|
86
|
-
expect(document.cookie).not.toContain(KEY);
|
|
87
|
-
|
|
88
|
-
// The positive half is the discriminator — asserting only the `video-8`
|
|
89
|
-
// false would also pass against a fallback tier that stored nothing.
|
|
90
|
-
expect(isDismissedCookieValue(readDismissCookie(KEY), 'video-7')).toBe(true);
|
|
91
|
-
expect(isDismissedCookieValue(readDismissCookie(KEY), 'video-8')).toBe(false);
|
|
92
|
-
});
|
|
93
|
-
|
|
94
|
-
it('fails open on a corrupted stored value', () => {
|
|
95
|
-
// Seeded through the real writer first, so this also pins the fallback key
|
|
96
|
-
// to the cookie name: read a different key and the pre-corruption value
|
|
97
|
-
// would still come back.
|
|
98
|
-
writeDismissCookie(KEY, 'video-7');
|
|
99
|
-
window.localStorage.setItem(KEY, 'not-json');
|
|
100
|
-
// Callers reveal the surface off this read, so an unreadable value must
|
|
101
|
-
// mean "not dismissed" rather than throwing and hiding it permanently.
|
|
102
|
-
expect(readDismissCookie(KEY)).toBeUndefined();
|
|
103
|
-
|
|
104
|
-
// Parses, but is not the string the tier stores — what `validate` is for.
|
|
105
|
-
window.localStorage.setItem(KEY, '123');
|
|
106
|
-
expect(readDismissCookie(KEY)).toBeUndefined();
|
|
107
|
-
});
|
|
108
|
-
});
|
|
109
|
-
|
|
110
|
-
describe('the match rule itself', () => {
|
|
111
|
-
it('treats "nothing stored, nothing active" as NOT dismissed', () => {
|
|
112
|
-
// Both sides undefined is the case the `!!id` guard exists for: a bare
|
|
113
|
-
// equality would call it dismissed and suppress a surface that has no
|
|
114
|
-
// active item to be dismissed against.
|
|
115
|
-
expect(isDismissedCookieValue(undefined, undefined)).toBe(false);
|
|
116
|
-
});
|
|
117
|
-
});
|
|
118
|
-
|
|
119
|
-
describe('clearing across the tier split', () => {
|
|
120
|
-
it('clears the tier the current scheme does NOT select', () => {
|
|
121
|
-
// Written on the fallback tier, cleared from a document on the cookie tier
|
|
122
|
-
// — the case a same-origin `blob:`/`about:blank` child produces, and the
|
|
123
|
-
// one a tier-checking clear would leave stranded.
|
|
124
|
-
setDocumentUrl('tauri://localhost/index.html');
|
|
125
|
-
writeDismissCookie(KEY, 'video-7');
|
|
126
|
-
|
|
127
|
-
setDocumentUrl('https://openframe.ai/dashboard');
|
|
128
|
-
clearDismissCookie(KEY);
|
|
129
|
-
|
|
130
|
-
setDocumentUrl('tauri://localhost/index.html');
|
|
131
|
-
expect(readDismissCookie(KEY)).toBeUndefined();
|
|
132
|
-
});
|
|
133
|
-
});
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|