@flamingo-stack/openframe-frontend-core 0.0.473-snapshot.20260724114839 → 0.0.473
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-RIPWRVA3.js → chunk-2SPAHQYE.js} +5 -5
- package/dist/{chunk-2R5NM3FC.cjs → chunk-4EU6WL5O.cjs} +40 -40
- package/dist/{chunk-2R5NM3FC.cjs.map → chunk-4EU6WL5O.cjs.map} +1 -1
- package/dist/{chunk-KXKTXAGN.cjs → chunk-4WHDDAVP.cjs} +40 -40
- package/dist/{chunk-KXKTXAGN.cjs.map → chunk-4WHDDAVP.cjs.map} +1 -1
- package/dist/{chunk-K52S6LZ5.js → chunk-4Y6LX6XR.js} +3 -3
- package/dist/{chunk-OKRUL7YV.js → chunk-4YH4WKLC.js} +4 -4
- package/dist/{chunk-LFXUFFDZ.cjs → chunk-5LTLYPIP.cjs} +73 -73
- package/dist/{chunk-LFXUFFDZ.cjs.map → chunk-5LTLYPIP.cjs.map} +1 -1
- package/dist/{chunk-YJWISFIK.cjs → chunk-6OGOPPTI.cjs} +12 -12
- package/dist/{chunk-YJWISFIK.cjs.map → chunk-6OGOPPTI.cjs.map} +1 -1
- package/dist/{chunk-KPVKZ5ML.cjs → chunk-6VEEQBVJ.cjs} +15 -15
- package/dist/{chunk-KPVKZ5ML.cjs.map → chunk-6VEEQBVJ.cjs.map} +1 -1
- package/dist/{chunk-SAH4FR36.js → chunk-6WPUUGW5.js} +5 -5
- package/dist/{chunk-6KD6KVAI.cjs → chunk-B472QGDO.cjs} +5 -5
- package/dist/{chunk-6KD6KVAI.cjs.map → chunk-B472QGDO.cjs.map} +1 -1
- package/dist/{chunk-3NNCBZEM.js → chunk-B52SBOUY.js} +6 -6
- package/dist/{chunk-5TQQ3CPE.cjs → chunk-CDBQQA7V.cjs} +29 -29
- package/dist/{chunk-5TQQ3CPE.cjs.map → chunk-CDBQQA7V.cjs.map} +1 -1
- package/dist/{chunk-7VBGYCXG.cjs → chunk-CH7MDKPI.cjs} +7 -7
- package/dist/{chunk-7VBGYCXG.cjs.map → chunk-CH7MDKPI.cjs.map} +1 -1
- package/dist/{chunk-S6IB3BZK.js → chunk-DBYUQOLS.js} +2 -2
- package/dist/{chunk-AGX565ZT.js → chunk-FPOHUGEK.js} +2 -2
- package/dist/{chunk-R4OGP4OV.js → chunk-H6FKYKEQ.js} +3 -3
- package/dist/{chunk-FM5KWLKU.cjs → chunk-HQL5GJ35.cjs} +3 -3
- package/dist/{chunk-FM5KWLKU.cjs.map → chunk-HQL5GJ35.cjs.map} +1 -1
- package/dist/{chunk-PTFSF3UP.js → chunk-I5L3KUTE.js} +6 -6
- package/dist/{chunk-GELW7JOQ.cjs → chunk-J5S5U76A.cjs} +32 -32
- package/dist/{chunk-GELW7JOQ.cjs.map → chunk-J5S5U76A.cjs.map} +1 -1
- package/dist/{chunk-464NJS2W.cjs → chunk-KP37QDNS.cjs} +73 -73
- package/dist/{chunk-464NJS2W.cjs.map → chunk-KP37QDNS.cjs.map} +1 -1
- package/dist/{chunk-PFD2VRZI.cjs → chunk-KXBXPOYM.cjs} +18 -18
- package/dist/{chunk-PFD2VRZI.cjs.map → chunk-KXBXPOYM.cjs.map} +1 -1
- package/dist/{chunk-VNDAMVMI.js → chunk-LWIVRGDN.js} +2 -2
- package/dist/{chunk-ZPUZPJDV.js → chunk-OTV4A6NA.js} +14 -80
- package/dist/chunk-OTV4A6NA.js.map +1 -0
- package/dist/{chunk-IIOHHNMI.js → chunk-QESV36I2.js} +70 -36
- package/dist/chunk-QESV36I2.js.map +1 -0
- package/dist/{chunk-FBUIZTAI.js → chunk-SWNZZVYG.js} +2 -2
- package/dist/{chunk-VCOL4C2W.cjs → chunk-TONMD7QX.cjs} +20 -86
- package/dist/chunk-TONMD7QX.cjs.map +1 -0
- package/dist/{chunk-Z4LAZ4ZZ.js → chunk-UCY6VITT.js} +3 -3
- package/dist/{chunk-BOPLMNSN.cjs → chunk-ZQRGJHNH.cjs} +151 -117
- package/dist/chunk-ZQRGJHNH.cjs.map +1 -0
- package/dist/components/case-studies/index.cjs +9 -9
- package/dist/components/case-studies/index.js +3 -3
- package/dist/components/chat/index.cjs +3 -3
- package/dist/components/chat/index.js +2 -2
- package/dist/components/contact/index.cjs +4 -4
- package/dist/components/contact/index.js +3 -3
- package/dist/components/docs/index.cjs +6 -6
- package/dist/components/docs/index.js +5 -5
- package/dist/components/embeds/index.cjs +4 -4
- package/dist/components/embeds/index.js +3 -3
- package/dist/components/faq/index.cjs +5 -5
- package/dist/components/faq/index.js +4 -4
- package/dist/components/features/index.cjs +3 -3
- package/dist/components/features/index.js +2 -2
- 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 +136 -136
- package/dist/components/index.js +11 -11
- package/dist/components/navigation/index.cjs +3 -3
- package/dist/components/navigation/index.js +2 -2
- package/dist/components/navigation/mobile-burger-menu.d.ts.map +1 -1
- 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 +5 -5
- package/dist/components/related-content/index.js +4 -4
- package/dist/components/tickets/index.cjs +6 -6
- package/dist/components/tickets/index.js +5 -5
- package/dist/components/ui/entity-image.d.ts.map +1 -1
- package/dist/components/ui/image-uploader.d.ts.map +1 -1
- package/dist/components/ui/index.cjs +3 -3
- package/dist/components/ui/index.js +2 -2
- package/dist/components/ui/simple-markdown-renderer.d.ts.map +1 -1
- package/dist/components/ui/square-avatar.d.ts.map +1 -1
- package/dist/hooks/index.cjs +2 -6
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.d.ts +0 -1
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +1 -5
- package/dist/index.cjs +3 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +2 -6
- package/dist/utils/embed-authed-fetch.d.ts +0 -15
- package/dist/utils/embed-authed-fetch.d.ts.map +1 -1
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/navigation/mobile-burger-menu.tsx +0 -1
- package/src/components/ui/entity-image.tsx +3 -5
- package/src/components/ui/image-uploader.tsx +12 -21
- package/src/components/ui/simple-markdown-renderer.tsx +58 -57
- package/src/components/ui/square-avatar.tsx +3 -5
- package/src/hooks/index.ts +0 -1
- package/src/utils/embed-authed-fetch.ts +0 -30
- package/dist/chunk-BOPLMNSN.cjs.map +0 -1
- package/dist/chunk-IIOHHNMI.js.map +0 -1
- package/dist/chunk-VCOL4C2W.cjs.map +0 -1
- package/dist/chunk-ZPUZPJDV.js.map +0 -1
- package/dist/hooks/use-authed-image-src.d.ts +0 -10
- package/dist/hooks/use-authed-image-src.d.ts.map +0 -1
- package/src/hooks/use-authed-image-src.ts +0 -93
- /package/dist/{chunk-RIPWRVA3.js.map → chunk-2SPAHQYE.js.map} +0 -0
- /package/dist/{chunk-K52S6LZ5.js.map → chunk-4Y6LX6XR.js.map} +0 -0
- /package/dist/{chunk-OKRUL7YV.js.map → chunk-4YH4WKLC.js.map} +0 -0
- /package/dist/{chunk-SAH4FR36.js.map → chunk-6WPUUGW5.js.map} +0 -0
- /package/dist/{chunk-3NNCBZEM.js.map → chunk-B52SBOUY.js.map} +0 -0
- /package/dist/{chunk-S6IB3BZK.js.map → chunk-DBYUQOLS.js.map} +0 -0
- /package/dist/{chunk-AGX565ZT.js.map → chunk-FPOHUGEK.js.map} +0 -0
- /package/dist/{chunk-R4OGP4OV.js.map → chunk-H6FKYKEQ.js.map} +0 -0
- /package/dist/{chunk-PTFSF3UP.js.map → chunk-I5L3KUTE.js.map} +0 -0
- /package/dist/{chunk-VNDAMVMI.js.map → chunk-LWIVRGDN.js.map} +0 -0
- /package/dist/{chunk-FBUIZTAI.js.map → chunk-SWNZZVYG.js.map} +0 -0
- /package/dist/{chunk-Z4LAZ4ZZ.js.map → chunk-UCY6VITT.js.map} +0 -0
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Drop every cached blob and revoke its object URL. Hosts call this at
|
|
3
|
-
* session end (logout / forced re-login) so a follow-on login as a
|
|
4
|
-
* different identity cannot be served blobs fetched under the previous
|
|
5
|
-
* one's bearer. Fetches still in flight when the clear happens are fenced
|
|
6
|
-
* by a generation counter — their results are revoked instead of cached.
|
|
7
|
-
*/
|
|
8
|
-
export declare function clearAuthedImageCache(): void;
|
|
9
|
-
export declare function useAuthedImageSrc(src?: string | null): string | undefined;
|
|
10
|
-
//# sourceMappingURL=use-authed-image-src.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use-authed-image-src.d.ts","sourceRoot":"","sources":["../../src/hooks/use-authed-image-src.ts"],"names":[],"mappings":"AAoCA;;;;;;GAMG;AACH,wBAAgB,qBAAqB,IAAI,IAAI,CAK5C;AAwBD,wBAAgB,iBAAiB,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,GAAG,SAAS,CAoBzE"}
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
|
|
3
|
-
import { useEffect, useReducer } from 'react'
|
|
4
|
-
import { embedAuthedFetch, needsBearerAssetFetch } from '../utils/embed-authed-fetch'
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Resolve an image URL for hosts whose auth rides in request headers
|
|
8
|
-
* instead of cookies (native shells — `capacitor://localhost`,
|
|
9
|
-
* `tauri://localhost` — running in bearer mode). A native `<img>` load
|
|
10
|
-
* can't carry an `Authorization` header, so a gateway image URL that
|
|
11
|
-
* works on the cookie-auth web 401s in a shell. When
|
|
12
|
-
* `needsBearerAssetFetch` says the URL's origin is bearer-authed, this
|
|
13
|
-
* hook fetches it through `embedAuthedFetch` (bearer + deduped
|
|
14
|
-
* 401-refresh-retry + the adapter's cross-origin guard) and returns a
|
|
15
|
-
* blob object-URL; every other URL is returned unchanged, so on the
|
|
16
|
-
* cookie-auth web the hook is a pass-through.
|
|
17
|
-
*
|
|
18
|
-
* Returns `undefined` while the fetch is in flight OR after it fails, so
|
|
19
|
-
* callers show their existing initials/placeholder fallback instead of a
|
|
20
|
-
* broken image; a failed fetch retries on the next mount.
|
|
21
|
-
*
|
|
22
|
-
* Cache: module-level, session-lifetime, keyed by full URL. Gateway image
|
|
23
|
-
* URLs carry a `?v=<content-hash>` cache-buster, so a changed image is a
|
|
24
|
-
* new key; entries are never revoked (avatars are a few KB — refcount
|
|
25
|
-
* churn isn't worth it).
|
|
26
|
-
*
|
|
27
|
-
* Distinct from the legacy `useAuthenticatedImage`, which ALWAYS
|
|
28
|
-
* blob-fetches with `credentials: 'include'` and its own global config.
|
|
29
|
-
* This hook is pass-through-first and keys off the single auth knob the
|
|
30
|
-
* lib already has: the registered `EmbedAuthAdapter`.
|
|
31
|
-
*/
|
|
32
|
-
|
|
33
|
-
const resolvedCache = new Map<string, string>()
|
|
34
|
-
const inFlight = new Map<string, Promise<void>>()
|
|
35
|
-
let cacheGeneration = 0
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Drop every cached blob and revoke its object URL. Hosts call this at
|
|
39
|
-
* session end (logout / forced re-login) so a follow-on login as a
|
|
40
|
-
* different identity cannot be served blobs fetched under the previous
|
|
41
|
-
* one's bearer. Fetches still in flight when the clear happens are fenced
|
|
42
|
-
* by a generation counter — their results are revoked instead of cached.
|
|
43
|
-
*/
|
|
44
|
-
export function clearAuthedImageCache(): void {
|
|
45
|
-
cacheGeneration++
|
|
46
|
-
for (const url of resolvedCache.values()) URL.revokeObjectURL(url)
|
|
47
|
-
resolvedCache.clear()
|
|
48
|
-
inFlight.clear()
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
function fetchAsBlobUrl(src: string): Promise<void> {
|
|
52
|
-
let pending = inFlight.get(src)
|
|
53
|
-
if (!pending) {
|
|
54
|
-
const startedGeneration = cacheGeneration
|
|
55
|
-
pending = embedAuthedFetch(src, { headers: { Accept: 'image/*' } })
|
|
56
|
-
.then(async response => {
|
|
57
|
-
if (!response.ok) throw new Error(`image fetch failed: ${response.status}`)
|
|
58
|
-
const blobUrl = URL.createObjectURL(await response.blob())
|
|
59
|
-
if (startedGeneration === cacheGeneration) {
|
|
60
|
-
resolvedCache.set(src, blobUrl)
|
|
61
|
-
} else {
|
|
62
|
-
URL.revokeObjectURL(blobUrl)
|
|
63
|
-
}
|
|
64
|
-
})
|
|
65
|
-
.finally(() => {
|
|
66
|
-
if (inFlight.get(src) === pending) inFlight.delete(src)
|
|
67
|
-
})
|
|
68
|
-
inFlight.set(src, pending)
|
|
69
|
-
}
|
|
70
|
-
return pending
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
export function useAuthedImageSrc(src?: string | null): string | undefined {
|
|
74
|
-
const bearerSrc = src && needsBearerAssetFetch(src) ? src : null
|
|
75
|
-
const [, rerender] = useReducer((c: number) => c + 1, 0)
|
|
76
|
-
|
|
77
|
-
useEffect(() => {
|
|
78
|
-
if (!bearerSrc || resolvedCache.has(bearerSrc)) return
|
|
79
|
-
let cancelled = false
|
|
80
|
-
fetchAsBlobUrl(bearerSrc)
|
|
81
|
-
.catch(() => {})
|
|
82
|
-
.finally(() => {
|
|
83
|
-
if (!cancelled) rerender()
|
|
84
|
-
})
|
|
85
|
-
return () => {
|
|
86
|
-
cancelled = true
|
|
87
|
-
}
|
|
88
|
-
}, [bearerSrc])
|
|
89
|
-
|
|
90
|
-
if (!src) return undefined
|
|
91
|
-
if (!bearerSrc) return src
|
|
92
|
-
return resolvedCache.get(bearerSrc)
|
|
93
|
-
}
|
|
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
|