@flamingo-stack/openframe-frontend-core 0.0.819 → 0.0.821
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-2T3HXLZD.cjs → chunk-2WHKEYDX.cjs} +55 -55
- package/dist/{chunk-K5IICQNF.cjs → chunk-2YUWBIZM.cjs} +46 -46
- package/dist/{chunk-MYIOOA4E.cjs → chunk-3SE34JVB.cjs} +2 -2
- package/dist/{chunk-2S6BUXYD.cjs → chunk-7DIWYZPQ.cjs} +3 -3
- package/dist/{chunk-I453QCEF.cjs → chunk-7QGK76LC.cjs} +131 -131
- package/dist/{chunk-WPHCVXES.cjs → chunk-BY2PLXYC.cjs} +13 -13
- package/dist/{chunk-2JFR6XVT.cjs → chunk-CA7X6CCJ.cjs} +32 -32
- package/dist/{chunk-CEXPWDT4.cjs → chunk-FTD3CZAS.cjs} +4 -4
- package/dist/{chunk-UDLDXVY4.cjs → chunk-GBILLSRM.cjs} +4 -4
- package/dist/{chunk-S2ZA4TMJ.cjs → chunk-GQHXJGA2.cjs} +11 -11
- package/dist/{chunk-A36XVWIQ.cjs → chunk-IS6BQSL6.cjs} +39 -39
- package/dist/{chunk-TDQRDQVU.cjs → chunk-LQF5F7LF.cjs} +4 -4
- package/dist/{chunk-IVQT5R6M.cjs → chunk-LWOXKF5P.cjs} +30 -30
- package/dist/{chunk-VSKR26MV.cjs → chunk-N2XHQVWX.cjs} +6 -6
- package/dist/{chunk-U3OICGCV.cjs → chunk-OEKVCVOS.cjs} +63 -63
- package/dist/{chunk-Q6QQSCUC.cjs → chunk-P2ZIQ72J.cjs} +13 -13
- package/dist/{chunk-IM366HS6.cjs → chunk-QCRJVO6Y.cjs} +78 -7
- package/dist/{chunk-7IQU54VE.cjs → chunk-QFNQSZ4H.cjs} +32 -97
- package/dist/{chunk-JOXJDNHN.cjs → chunk-RRLJ5PNL.cjs} +3 -3
- package/dist/{chunk-2W3W3ZV6.cjs → chunk-V26M75GV.cjs} +14 -14
- package/dist/{chunk-LUID2IB3.cjs → chunk-XEIZL3I3.cjs} +2 -2
- package/dist/{chunk-OTGYA5F7.cjs → chunk-YCE7A63X.cjs} +33 -33
- package/dist/{cloud-tenants-P5XJ5DPJ.cjs → cloud-tenants-M34P47GS.cjs} +6 -6
- package/dist/components/case-studies/index.cjs +20 -20
- package/dist/components/chat/embeddable-chat.d.ts.map +1 -1
- package/dist/components/chat/embeddable-chat.js +5 -6
- package/dist/components/chat/index.cjs +5 -5
- package/dist/components/chat/utils/cited-sources.d.ts +9 -0
- package/dist/components/chat/utils/cited-sources.d.ts.map +1 -1
- package/dist/components/chat/utils/cited-sources.js +5 -0
- package/dist/components/contact/index.cjs +7 -7
- package/dist/components/docs/index.cjs +10 -10
- package/dist/components/embeds/index.cjs +7 -7
- package/dist/components/faq/index.cjs +8 -8
- package/dist/components/features/index.cjs +6 -6
- package/dist/components/help-center-pages/index.cjs +80 -80
- package/dist/components/index.cjs +48 -48
- package/dist/components/meeting-scheduler/index.cjs +31 -31
- package/dist/components/navigation/index.cjs +9 -9
- package/dist/components/onboarding-guides/index.cjs +9 -9
- package/dist/components/product-demo/index.cjs +15 -15
- package/dist/components/related-content/index.cjs +4 -4
- package/dist/components/tickets/index.cjs +11 -11
- package/dist/components/ui/index.cjs +6 -6
- package/dist/contexts/chat-runtime-context.d.ts +4 -3
- package/dist/contexts/chat-runtime-context.d.ts.map +1 -1
- package/dist/{devices-BSIWSRZG.cjs → devices-SWFK4CPO.cjs} +7 -7
- package/dist/{embeddable-chat-5L2PKTW3.cjs → embeddable-chat-J6CKPKKM.cjs} +74 -71
- package/dist/index.cjs +17 -17
- package/dist/{knowledge-2F3IPK73.cjs → knowledge-N5FDIA33.cjs} +7 -7
- package/dist/{logs-U3OCJ2OC.cjs → logs-OEK7GMEB.cjs} +14 -14
- package/dist/{policies-L3KHKE2G.cjs → policies-Q7AS5AL6.cjs} +10 -10
- package/dist/{scripts-U4SLB5YC.cjs → scripts-3XWEDB2A.cjs} +11 -11
- package/dist/{software-update-QALYFCIO.cjs → software-update-6FOBLAOF.cjs} +9 -9
- package/dist/utils/image-proxy.d.ts +3 -2
- package/dist/utils/image-proxy.d.ts.map +1 -1
- package/dist/utils/image-proxy.js +11 -4
- package/dist/utils/index.cjs +68 -62
- package/package.json +1 -1
- package/src/components/chat/embeddable-chat.tsx +7 -8
- package/src/components/chat/utils/cited-sources.ts +10 -0
- package/src/contexts/chat-runtime-context.tsx +4 -3
- package/src/utils/image-proxy.ts +17 -6
package/src/utils/image-proxy.ts
CHANGED
|
@@ -11,6 +11,8 @@
|
|
|
11
11
|
* proxy config through (typically from `ChatRuntime.endpoints.imageProxyUrlPrefix`).
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
|
+
import { hostMatches } from './social-platforms';
|
|
15
|
+
|
|
14
16
|
export type GetProxiedImageUrlOptions = {
|
|
15
17
|
/**
|
|
16
18
|
* URL prefix for the image proxy (`<prefix>?url=<encoded>`). When unset,
|
|
@@ -21,8 +23,9 @@ export type GetProxiedImageUrlOptions = {
|
|
|
21
23
|
/**
|
|
22
24
|
* Domains that should bypass the proxy (e.g. own-CDN hosts whose
|
|
23
25
|
* `Content-Type` is reliable and that already serve CORS-permitting
|
|
24
|
-
* headers). Matched
|
|
25
|
-
*
|
|
26
|
+
* headers). Matched against the URL's host, exact or a subdomain of it
|
|
27
|
+
* (`hostMatches`), so a domain named anywhere else in the URL does not
|
|
28
|
+
* count. A `host:port` entry matches that port. Default: `[]`.
|
|
26
29
|
*/
|
|
27
30
|
skipDomains?: string[];
|
|
28
31
|
/**
|
|
@@ -34,6 +37,15 @@ export type GetProxiedImageUrlOptions = {
|
|
|
34
37
|
directHttps?: boolean;
|
|
35
38
|
};
|
|
36
39
|
|
|
40
|
+
/** The URL's `host` (with a non-default port, unlike `hostOf`), null when it does not parse. */
|
|
41
|
+
function urlHost(url: string): string | null {
|
|
42
|
+
try {
|
|
43
|
+
return new URL(url).host;
|
|
44
|
+
} catch {
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
37
49
|
/**
|
|
38
50
|
* Resolve an external image URL through (or around) the image proxy.
|
|
39
51
|
*
|
|
@@ -78,10 +90,9 @@ export function getProxiedImageUrl(imageUrl: string | null, options?: GetProxied
|
|
|
78
90
|
}
|
|
79
91
|
|
|
80
92
|
// (5) Skip-list match.
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
}
|
|
93
|
+
const host = urlHost(imageUrl);
|
|
94
|
+
if (skipDomains.some(domain => hostMatches(host, domain))) {
|
|
95
|
+
return imageUrl;
|
|
85
96
|
}
|
|
86
97
|
|
|
87
98
|
// (6) Proxy.
|