@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
|
@@ -3,15 +3,10 @@
|
|
|
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
|
|
7
|
-
*
|
|
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
|
|
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
|
-
*
|
|
15
10
|
* No `"use client"` on purpose — `isDismissedCookieValue` is pure and is used by
|
|
16
11
|
* server code (the hub's root layout reads the cookie during SSR to avoid a
|
|
17
12
|
* flash); the DOM-touching helpers guard on `typeof document`.
|
|
@@ -19,28 +14,14 @@
|
|
|
19
14
|
/** THE dismissal match rule. `undefined` id (nothing active) → not dismissed. */
|
|
20
15
|
export declare function isDismissedCookieValue(cookieValue: string | undefined, id: string | undefined): boolean;
|
|
21
16
|
/**
|
|
22
|
-
* Read a dismissal. Returns `undefined` when absent OR
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
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.
|
|
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.
|
|
29
21
|
*/
|
|
30
22
|
export declare function readDismissCookie(name: string): string | undefined;
|
|
31
|
-
/** Persist a dismissal. */
|
|
23
|
+
/** Persist a dismissal (cookie only, 1 year). */
|
|
32
24
|
export declare function writeDismissCookie(name: string, id: string): void;
|
|
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
|
-
*/
|
|
25
|
+
/** Clear a dismissal (test/story helper). */
|
|
45
26
|
export declare function clearDismissCookie(name: string): void;
|
|
46
27
|
//# 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
|
|
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"}
|
|
@@ -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
|
|
19
|
-
*
|
|
18
|
+
/** Client-side dismissal check (id-match). Reads a cookie, so call it from an
|
|
19
|
+
* 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;
|
|
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"}
|
package/dist/utils/index.cjs
CHANGED
|
@@ -2569,78 +2569,13 @@ 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
|
-
|
|
2625
2572
|
// src/utils/dismiss-cookie.ts
|
|
2626
2573
|
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
|
-
}
|
|
2638
2574
|
function isDismissedCookieValue(cookieValue, id) {
|
|
2639
2575
|
return !!id && cookieValue === id;
|
|
2640
2576
|
}
|
|
2641
2577
|
function readDismissCookie(name) {
|
|
2642
2578
|
if (typeof document === "undefined") return void 0;
|
|
2643
|
-
if (!canUseCookies()) return fallbackStore(name).load() ?? void 0;
|
|
2644
2579
|
const match = document.cookie.split("; ").find((row) => row.startsWith(`${name}=`));
|
|
2645
2580
|
if (!match) return void 0;
|
|
2646
2581
|
try {
|
|
@@ -2651,15 +2586,10 @@ function readDismissCookie(name) {
|
|
|
2651
2586
|
}
|
|
2652
2587
|
function writeDismissCookie(name, id) {
|
|
2653
2588
|
if (typeof document === "undefined") return;
|
|
2654
|
-
if (!canUseCookies()) {
|
|
2655
|
-
fallbackStore(name).save(id);
|
|
2656
|
-
return;
|
|
2657
|
-
}
|
|
2658
2589
|
document.cookie = `${name}=${encodeURIComponent(id)}; path=/; max-age=${DISMISS_COOKIE_MAX_AGE_SECONDS}; SameSite=Lax`;
|
|
2659
2590
|
}
|
|
2660
2591
|
function clearDismissCookie(name) {
|
|
2661
2592
|
if (typeof document === "undefined") return;
|
|
2662
|
-
fallbackStore(name).clear();
|
|
2663
2593
|
document.cookie = `${name}=; path=/; max-age=0`;
|
|
2664
2594
|
}
|
|
2665
2595
|
|
|
@@ -2995,6 +2925,59 @@ function getAppType() {
|
|
|
2995
2925
|
}
|
|
2996
2926
|
}
|
|
2997
2927
|
|
|
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
|
+
|
|
2998
2981
|
// src/utils/embed-proxy-auth-storage.ts
|
|
2999
2982
|
function isValidPersistedAuth(value) {
|
|
3000
2983
|
if (!value || typeof value !== "object") return false;
|