@flamingo-stack/openframe-frontend-core 0.0.583 → 0.0.584-1967.5424.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.
Files changed (105) hide show
  1. package/dist/{chunk-BTBW4L2W.cjs → chunk-33DHEEMP.cjs} +33 -33
  2. package/dist/{chunk-BTBW4L2W.cjs.map → chunk-33DHEEMP.cjs.map} +1 -1
  3. package/dist/{chunk-XZ3MKTJZ.js → chunk-3ELW4VML.js} +2 -2
  4. package/dist/{chunk-WTC6QQNX.cjs → chunk-3ZA2OYRE.cjs} +3 -3
  5. package/dist/{chunk-WTC6QQNX.cjs.map → chunk-3ZA2OYRE.cjs.map} +1 -1
  6. package/dist/{chunk-J3EEL6YC.js → chunk-4T5KOD3G.js} +4 -4
  7. package/dist/{chunk-HIHPWVKP.js → chunk-5CJKZHWO.js} +5 -5
  8. package/dist/{chunk-VWHEXQ64.js → chunk-6BJYPG2V.js} +2 -2
  9. package/dist/{chunk-WBTKXNKZ.cjs → chunk-7X5TCK4R.cjs} +4 -4
  10. package/dist/{chunk-WBTKXNKZ.cjs.map → chunk-7X5TCK4R.cjs.map} +1 -1
  11. package/dist/{chunk-IOP7BCRQ.js → chunk-EJKEDCTH.js} +5 -5
  12. package/dist/{chunk-OCXFFGFA.cjs → chunk-HCKEDTKJ.cjs} +10 -10
  13. package/dist/{chunk-OCXFFGFA.cjs.map → chunk-HCKEDTKJ.cjs.map} +1 -1
  14. package/dist/{chunk-EATPU5EF.cjs → chunk-IIT5HWLY.cjs} +3 -3
  15. package/dist/{chunk-EATPU5EF.cjs.map → chunk-IIT5HWLY.cjs.map} +1 -1
  16. package/dist/{chunk-RBDVHLT5.cjs → chunk-JAJQ5P2Q.cjs} +17 -17
  17. package/dist/{chunk-RBDVHLT5.cjs.map → chunk-JAJQ5P2Q.cjs.map} +1 -1
  18. package/dist/{chunk-YNLIXABT.cjs → chunk-JFKK3ZOA.cjs} +34 -34
  19. package/dist/{chunk-YNLIXABT.cjs.map → chunk-JFKK3ZOA.cjs.map} +1 -1
  20. package/dist/{chunk-PFKWJ6PJ.js → chunk-JVWRMLQZ.js} +18 -1
  21. package/dist/chunk-JVWRMLQZ.js.map +1 -0
  22. package/dist/{chunk-WMRXB6RS.js → chunk-KP6VJP36.js} +2 -2
  23. package/dist/{chunk-FCLM2RXI.js → chunk-LNKULR4V.js} +2 -2
  24. package/dist/{chunk-3TNM6SDP.cjs → chunk-MEJFHD5N.cjs} +13 -13
  25. package/dist/{chunk-3TNM6SDP.cjs.map → chunk-MEJFHD5N.cjs.map} +1 -1
  26. package/dist/{chunk-EZ5VU5WS.js → chunk-MYEG5ZDT.js} +2 -2
  27. package/dist/{chunk-KDWNMFX4.cjs → chunk-NVY2ZP7Z.cjs} +17 -17
  28. package/dist/{chunk-KDWNMFX4.cjs.map → chunk-NVY2ZP7Z.cjs.map} +1 -1
  29. package/dist/{chunk-TRD2YICZ.cjs → chunk-P2VRLSAP.cjs} +16 -16
  30. package/dist/{chunk-TRD2YICZ.cjs.map → chunk-P2VRLSAP.cjs.map} +1 -1
  31. package/dist/{chunk-6BI3AYBY.cjs → chunk-Q66AMADB.cjs} +4 -4
  32. package/dist/{chunk-6BI3AYBY.cjs.map → chunk-Q66AMADB.cjs.map} +1 -1
  33. package/dist/{chunk-M6ZUEBDK.cjs → chunk-QJR32JM2.cjs} +18 -1
  34. package/dist/chunk-QJR32JM2.cjs.map +1 -0
  35. package/dist/{chunk-PMA7DVQR.js → chunk-RHPCSFJH.js} +3 -3
  36. package/dist/{chunk-R5A3MGMY.js → chunk-RURZ6QLN.js} +2 -2
  37. package/dist/{chunk-L26MD32B.js → chunk-TLKHLGAB.js} +2 -2
  38. package/dist/{chunk-3RR67XC2.cjs → chunk-UCNEQKIT.cjs} +3 -3
  39. package/dist/{chunk-3RR67XC2.cjs.map → chunk-UCNEQKIT.cjs.map} +1 -1
  40. package/dist/{chunk-IJVWKLJK.cjs → chunk-VOAZU46B.cjs} +49 -49
  41. package/dist/{chunk-IJVWKLJK.cjs.map → chunk-VOAZU46B.cjs.map} +1 -1
  42. package/dist/{chunk-DROXHJVZ.js → chunk-VZSTL5VG.js} +2 -2
  43. package/dist/{chunk-AJLF6MBD.js → chunk-XPJKQ63S.js} +2 -2
  44. package/dist/{chunk-WHNC7C76.js → chunk-YFZDIEVC.js} +4 -4
  45. package/dist/{chunk-IFPGXSMZ.cjs → chunk-ZHUBNWEX.cjs} +3 -3
  46. package/dist/{chunk-IFPGXSMZ.cjs.map → chunk-ZHUBNWEX.cjs.map} +1 -1
  47. package/dist/components/case-studies/index.cjs +8 -8
  48. package/dist/components/case-studies/index.js +2 -2
  49. package/dist/components/contact/index.cjs +3 -3
  50. package/dist/components/contact/index.js +2 -2
  51. package/dist/components/docs/index.cjs +6 -6
  52. package/dist/components/docs/index.js +5 -5
  53. package/dist/components/embeds/index.cjs +3 -3
  54. package/dist/components/embeds/index.js +2 -2
  55. package/dist/components/faq/index.cjs +3 -3
  56. package/dist/components/faq/index.js +2 -2
  57. package/dist/components/features/index.cjs +2 -2
  58. package/dist/components/features/index.js +1 -1
  59. package/dist/components/help-center-pages/index.cjs +22 -22
  60. package/dist/components/help-center-pages/index.js +13 -13
  61. package/dist/components/index.cjs +29 -29
  62. package/dist/components/index.js +12 -12
  63. package/dist/components/meeting-scheduler/index.cjs +18 -18
  64. package/dist/components/meeting-scheduler/index.js +1 -1
  65. package/dist/components/navigation/index.cjs +5 -5
  66. package/dist/components/navigation/index.js +4 -4
  67. package/dist/components/onboarding-guides/index.cjs +5 -5
  68. package/dist/components/onboarding-guides/index.js +4 -4
  69. package/dist/components/tickets/index.cjs +6 -6
  70. package/dist/components/tickets/index.js +5 -5
  71. package/dist/components/ui/index.cjs +2 -2
  72. package/dist/components/ui/index.js +1 -1
  73. package/dist/index.cjs +6 -6
  74. package/dist/index.js +5 -5
  75. package/dist/utils/announcement-storage.d.ts +25 -16
  76. package/dist/utils/announcement-storage.d.ts.map +1 -1
  77. package/dist/utils/dismiss-cookie.d.ts +27 -8
  78. package/dist/utils/dismiss-cookie.d.ts.map +1 -1
  79. package/dist/utils/dismissal-storage.d.ts +2 -2
  80. package/dist/utils/dismissal-storage.d.ts.map +1 -1
  81. package/dist/utils/index.cjs +70 -53
  82. package/dist/utils/index.cjs.map +1 -1
  83. package/dist/utils/index.js +70 -53
  84. package/dist/utils/index.js.map +1 -1
  85. package/package.json +1 -1
  86. package/src/utils/__tests__/dismiss-cookie.test.ts +133 -0
  87. package/src/utils/announcement-storage.ts +25 -16
  88. package/src/utils/dismiss-cookie.ts +86 -9
  89. package/src/utils/dismissal-storage.ts +2 -2
  90. package/dist/chunk-M6ZUEBDK.cjs.map +0 -1
  91. package/dist/chunk-PFKWJ6PJ.js.map +0 -1
  92. /package/dist/{chunk-XZ3MKTJZ.js.map → chunk-3ELW4VML.js.map} +0 -0
  93. /package/dist/{chunk-J3EEL6YC.js.map → chunk-4T5KOD3G.js.map} +0 -0
  94. /package/dist/{chunk-HIHPWVKP.js.map → chunk-5CJKZHWO.js.map} +0 -0
  95. /package/dist/{chunk-VWHEXQ64.js.map → chunk-6BJYPG2V.js.map} +0 -0
  96. /package/dist/{chunk-IOP7BCRQ.js.map → chunk-EJKEDCTH.js.map} +0 -0
  97. /package/dist/{chunk-WMRXB6RS.js.map → chunk-KP6VJP36.js.map} +0 -0
  98. /package/dist/{chunk-FCLM2RXI.js.map → chunk-LNKULR4V.js.map} +0 -0
  99. /package/dist/{chunk-EZ5VU5WS.js.map → chunk-MYEG5ZDT.js.map} +0 -0
  100. /package/dist/{chunk-PMA7DVQR.js.map → chunk-RHPCSFJH.js.map} +0 -0
  101. /package/dist/{chunk-R5A3MGMY.js.map → chunk-RURZ6QLN.js.map} +0 -0
  102. /package/dist/{chunk-L26MD32B.js.map → chunk-TLKHLGAB.js.map} +0 -0
  103. /package/dist/{chunk-DROXHJVZ.js.map → chunk-VZSTL5VG.js.map} +0 -0
  104. /package/dist/{chunk-AJLF6MBD.js.map → chunk-XPJKQ63S.js.map} +0 -0
  105. /package/dist/{chunk-WHNC7C76.js.map → chunk-YFZDIEVC.js.map} +0 -0
@@ -3,10 +3,15 @@
3
3
  * dismissed", shared by every dismissible surface (announcement bar, floating
4
4
  * walkthrough video, and anything added later).
5
5
  *
6
- * The dismissal rule is an ID MATCH, never mere cookie presence: the cookie
7
- * stores the id of the LAST dismissed item, so publishing a NEW item re-shows
6
+ * The dismissal rule is an ID MATCH, never mere cookie presence: the store
7
+ * holds the id of the LAST dismissed item, so publishing a NEW item re-shows
8
8
  * the surface while the old dismissal still suppresses the old item.
9
9
  *
10
+ * TWO TIERS. The cookie is primary wherever cookies work; on a cookie-averse
11
+ * document `localStorage` takes over under the same key. See `canUseCookies`
12
+ * for when that is, and `fallbackStore` for why it is a fallback and not a
13
+ * mirror.
14
+ *
10
15
  * No `"use client"` on purpose — `isDismissedCookieValue` is pure and is used by
11
16
  * server code (the hub's root layout reads the cookie during SSR to avoid a
12
17
  * flash); the DOM-touching helpers guard on `typeof document`.
@@ -14,14 +19,28 @@
14
19
  /** THE dismissal match rule. `undefined` id (nothing active) → not dismissed. */
15
20
  export declare function isDismissedCookieValue(cookieValue: string | undefined, id: string | undefined): boolean;
16
21
  /**
17
- * Read a dismissal cookie. Returns `undefined` when absent OR malformed:
18
- * `decodeURIComponent` throws `URIError` on bad percent-encoding, and callers
19
- * run this inside reveal paths where an uncaught throw would hide the surface
20
- * permanently. Failing open (treated as not-dismissed) is always the safe side.
22
+ * Read a dismissal. Returns `undefined` when absent OR unreadable — one
23
+ * guarantee with two causes: a cookie with bad percent-encoding, where
24
+ * `decodeURIComponent` throws `URIError`, and a fallback value that is not the
25
+ * JSON string it should be, where the adapter swallows the parse failure.
26
+ * Callers run this inside reveal paths where an uncaught throw would hide the
27
+ * surface permanently, so failing open — treated as not-dismissed — is always
28
+ * the safe side.
21
29
  */
22
30
  export declare function readDismissCookie(name: string): string | undefined;
23
- /** Persist a dismissal (cookie only, 1 year). */
31
+ /** Persist a dismissal. */
24
32
  export declare function writeDismissCookie(name: string, id: string): void;
25
- /** Clear a dismissal (test/story helper). */
33
+ /**
34
+ * Clear a dismissal (test/story helper).
35
+ *
36
+ * BOTH tiers, unconditionally — the tier check governs writes, not removal.
37
+ * Clearing writes nothing and cannot resurrect a dismissal, so it carries none
38
+ * of the reasons the write path commits to one tier, and a clear that leaves
39
+ * the other tier holding a value is a lie.
40
+ *
41
+ * NOT for a shell that changes the scheme it serves under: that is an origin
42
+ * change, so the old tier moves to a storage bucket no code in the new origin
43
+ * can reach — `clear` included.
44
+ */
26
45
  export declare function clearDismissCookie(name: string): void;
27
46
  //# sourceMappingURL=dismiss-cookie.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"dismiss-cookie.d.ts","sourceRoot":"","sources":["../../src/utils/dismiss-cookie.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAKH,iFAAiF;AACjF,wBAAgB,sBAAsB,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,EAAE,EAAE,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAEvG;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CASlE;AAED,iDAAiD;AACjD,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,IAAI,CAGjE;AAED,6CAA6C;AAC7C,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAGrD"}
1
+ {"version":3,"file":"dismiss-cookie.d.ts","sourceRoot":"","sources":["../../src/utils/dismiss-cookie.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAyDH,iFAAiF;AACjF,wBAAgB,sBAAsB,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,EAAE,EAAE,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAEvG;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAUlE;AAED,2BAA2B;AAC3B,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,IAAI,CAOjE;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAIrD"}
@@ -15,8 +15,8 @@ export declare const WALKTHROUGH_VIDEO_DISMISS_KEY = "walkthrough-video-dismisse
15
15
  * it once more. Deliberate and one-time: the alternative is reading both names
16
16
  * forever to save a single re-dismissal. */
17
17
  export declare function walkthroughDismissCookieName(platform: string): string;
18
- /** Client-side dismissal check (id-match). Reads a cookie, so call it from an
19
- * effect, never during render. */
18
+ /** Client-side dismissal check (id-match). Reads browser storage, so call it
19
+ * from an effect, never during render. */
20
20
  export declare function isWalkthroughDismissed(key: string, id: string | undefined): boolean;
21
21
  /** Persist a dismissal for this video id. */
22
22
  export declare function dismissWalkthrough(key: string, id: string): void;
@@ -1 +1 @@
1
- {"version":3,"file":"dismissal-storage.d.ts","sourceRoot":"","sources":["../../src/utils/dismissal-storage.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,wBAAwB;AACxB,eAAO,MAAM,6BAA6B,gCAAgC,CAAC;AAE3E;;;;;;;;6CAQ6C;AAC7C,wBAAgB,4BAA4B,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAErE;AAED;mCACmC;AACnC,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAEnF;AAED,6CAA6C;AAC7C,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,IAAI,CAEhE;AAED,4DAA4D;AAC5D,wBAAgB,yBAAyB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAE3D"}
1
+ {"version":3,"file":"dismissal-storage.d.ts","sourceRoot":"","sources":["../../src/utils/dismissal-storage.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,wBAAwB;AACxB,eAAO,MAAM,6BAA6B,gCAAgC,CAAC;AAE3E;;;;;;;;6CAQ6C;AAC7C,wBAAgB,4BAA4B,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAErE;AAED;2CAC2C;AAC3C,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAEnF;AAED,6CAA6C;AAC7C,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,IAAI,CAEhE;AAED,4DAA4D;AAC5D,wBAAgB,yBAAyB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAE3D"}
@@ -2569,13 +2569,78 @@ function isGenericWebsiteDomain(website) {
2569
2569
  return isGenericDomain(normalizeDomain(website));
2570
2570
  }
2571
2571
 
2572
+ // src/utils/local-storage-adapter.ts
2573
+ function getStorage(backend) {
2574
+ if (typeof window === "undefined") return null;
2575
+ try {
2576
+ return backend === "session" ? window.sessionStorage : window.localStorage;
2577
+ } catch {
2578
+ return null;
2579
+ }
2580
+ }
2581
+ function createLocalStorageAdapter(options) {
2582
+ const tag = options.logTag ?? "[local-storage]";
2583
+ const backend = options.backend ?? "local";
2584
+ const resolveKey = () => {
2585
+ const ns = options.namespace?.();
2586
+ return ns ? `${ns}.${options.key}` : options.key;
2587
+ };
2588
+ return {
2589
+ resolveKey,
2590
+ load() {
2591
+ const storage = getStorage(backend);
2592
+ if (!storage) return null;
2593
+ try {
2594
+ const raw = storage.getItem(resolveKey());
2595
+ if (!raw) return null;
2596
+ const parsed = JSON.parse(raw);
2597
+ if (options.validate && !options.validate(parsed)) return null;
2598
+ return parsed;
2599
+ } catch (err) {
2600
+ console.warn(`${tag} parse failed for key ${resolveKey()}:`, err);
2601
+ return null;
2602
+ }
2603
+ },
2604
+ save(value) {
2605
+ const storage = getStorage(backend);
2606
+ if (!storage) return;
2607
+ try {
2608
+ storage.setItem(resolveKey(), JSON.stringify(value));
2609
+ } catch (err) {
2610
+ console.warn(`${tag} write failed for key ${resolveKey()}:`, err);
2611
+ }
2612
+ },
2613
+ clear() {
2614
+ const storage = getStorage(backend);
2615
+ if (!storage) return;
2616
+ try {
2617
+ storage.removeItem(resolveKey());
2618
+ } catch (err) {
2619
+ console.warn(`${tag} clear failed for key ${resolveKey()}:`, err);
2620
+ }
2621
+ }
2622
+ };
2623
+ }
2624
+
2572
2625
  // src/utils/dismiss-cookie.ts
2573
2626
  var DISMISS_COOKIE_MAX_AGE_SECONDS = 31536e3;
2627
+ function canUseCookies() {
2628
+ if (typeof document === "undefined") return false;
2629
+ return document.URL.startsWith("http:") || document.URL.startsWith("https:");
2630
+ }
2631
+ function fallbackStore(name) {
2632
+ return createLocalStorageAdapter({
2633
+ key: name,
2634
+ logTag: "[dismiss-cookie]",
2635
+ validate: (parsed) => typeof parsed === "string"
2636
+ });
2637
+ }
2574
2638
  function isDismissedCookieValue(cookieValue, id) {
2575
2639
  return !!id && cookieValue === id;
2576
2640
  }
2577
2641
  function readDismissCookie(name) {
2578
2642
  if (typeof document === "undefined") return void 0;
2643
+ if (!canUseCookies()) return fallbackStore(name).load() ?? void 0;
2579
2644
  const match = document.cookie.split("; ").find((row) => row.startsWith(`${name}=`));
2580
2645
  if (!match) return void 0;
2581
2646
  try {
@@ -2586,10 +2651,15 @@ function readDismissCookie(name) {
2586
2651
  }
2587
2652
  function writeDismissCookie(name, id) {
2588
2653
  if (typeof document === "undefined") return;
2654
+ if (!canUseCookies()) {
2655
+ fallbackStore(name).save(id);
2656
+ return;
2657
+ }
2589
2658
  document.cookie = `${name}=${encodeURIComponent(id)}; path=/; max-age=${DISMISS_COOKIE_MAX_AGE_SECONDS}; SameSite=Lax`;
2590
2659
  }
2591
2660
  function clearDismissCookie(name) {
2592
2661
  if (typeof document === "undefined") return;
2662
+ fallbackStore(name).clear();
2593
2663
  document.cookie = `${name}=; path=/; max-age=0`;
2594
2664
  }
2595
2665
 
@@ -2925,59 +2995,6 @@ function getAppType() {
2925
2995
  }
2926
2996
  }
2927
2997
 
2928
- // src/utils/local-storage-adapter.ts
2929
- function getStorage(backend) {
2930
- if (typeof window === "undefined") return null;
2931
- try {
2932
- return backend === "session" ? window.sessionStorage : window.localStorage;
2933
- } catch {
2934
- return null;
2935
- }
2936
- }
2937
- function createLocalStorageAdapter(options) {
2938
- const tag = options.logTag ?? "[local-storage]";
2939
- const backend = options.backend ?? "local";
2940
- const resolveKey = () => {
2941
- const ns = options.namespace?.();
2942
- return ns ? `${ns}.${options.key}` : options.key;
2943
- };
2944
- return {
2945
- resolveKey,
2946
- load() {
2947
- const storage = getStorage(backend);
2948
- if (!storage) return null;
2949
- try {
2950
- const raw = storage.getItem(resolveKey());
2951
- if (!raw) return null;
2952
- const parsed = JSON.parse(raw);
2953
- if (options.validate && !options.validate(parsed)) return null;
2954
- return parsed;
2955
- } catch (err) {
2956
- console.warn(`${tag} parse failed for key ${resolveKey()}:`, err);
2957
- return null;
2958
- }
2959
- },
2960
- save(value) {
2961
- const storage = getStorage(backend);
2962
- if (!storage) return;
2963
- try {
2964
- storage.setItem(resolveKey(), JSON.stringify(value));
2965
- } catch (err) {
2966
- console.warn(`${tag} write failed for key ${resolveKey()}:`, err);
2967
- }
2968
- },
2969
- clear() {
2970
- const storage = getStorage(backend);
2971
- if (!storage) return;
2972
- try {
2973
- storage.removeItem(resolveKey());
2974
- } catch (err) {
2975
- console.warn(`${tag} clear failed for key ${resolveKey()}:`, err);
2976
- }
2977
- }
2978
- };
2979
- }
2980
-
2981
2998
  // src/utils/embed-proxy-auth-storage.ts
2982
2999
  function isValidPersistedAuth(value) {
2983
3000
  if (!value || typeof value !== "object") return false;