@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.
Files changed (63) hide show
  1. package/dist/{chunk-2T3HXLZD.cjs → chunk-2WHKEYDX.cjs} +55 -55
  2. package/dist/{chunk-K5IICQNF.cjs → chunk-2YUWBIZM.cjs} +46 -46
  3. package/dist/{chunk-MYIOOA4E.cjs → chunk-3SE34JVB.cjs} +2 -2
  4. package/dist/{chunk-2S6BUXYD.cjs → chunk-7DIWYZPQ.cjs} +3 -3
  5. package/dist/{chunk-I453QCEF.cjs → chunk-7QGK76LC.cjs} +131 -131
  6. package/dist/{chunk-WPHCVXES.cjs → chunk-BY2PLXYC.cjs} +13 -13
  7. package/dist/{chunk-2JFR6XVT.cjs → chunk-CA7X6CCJ.cjs} +32 -32
  8. package/dist/{chunk-CEXPWDT4.cjs → chunk-FTD3CZAS.cjs} +4 -4
  9. package/dist/{chunk-UDLDXVY4.cjs → chunk-GBILLSRM.cjs} +4 -4
  10. package/dist/{chunk-S2ZA4TMJ.cjs → chunk-GQHXJGA2.cjs} +11 -11
  11. package/dist/{chunk-A36XVWIQ.cjs → chunk-IS6BQSL6.cjs} +39 -39
  12. package/dist/{chunk-TDQRDQVU.cjs → chunk-LQF5F7LF.cjs} +4 -4
  13. package/dist/{chunk-IVQT5R6M.cjs → chunk-LWOXKF5P.cjs} +30 -30
  14. package/dist/{chunk-VSKR26MV.cjs → chunk-N2XHQVWX.cjs} +6 -6
  15. package/dist/{chunk-U3OICGCV.cjs → chunk-OEKVCVOS.cjs} +63 -63
  16. package/dist/{chunk-Q6QQSCUC.cjs → chunk-P2ZIQ72J.cjs} +13 -13
  17. package/dist/{chunk-IM366HS6.cjs → chunk-QCRJVO6Y.cjs} +78 -7
  18. package/dist/{chunk-7IQU54VE.cjs → chunk-QFNQSZ4H.cjs} +32 -97
  19. package/dist/{chunk-JOXJDNHN.cjs → chunk-RRLJ5PNL.cjs} +3 -3
  20. package/dist/{chunk-2W3W3ZV6.cjs → chunk-V26M75GV.cjs} +14 -14
  21. package/dist/{chunk-LUID2IB3.cjs → chunk-XEIZL3I3.cjs} +2 -2
  22. package/dist/{chunk-OTGYA5F7.cjs → chunk-YCE7A63X.cjs} +33 -33
  23. package/dist/{cloud-tenants-P5XJ5DPJ.cjs → cloud-tenants-M34P47GS.cjs} +6 -6
  24. package/dist/components/case-studies/index.cjs +20 -20
  25. package/dist/components/chat/embeddable-chat.d.ts.map +1 -1
  26. package/dist/components/chat/embeddable-chat.js +5 -6
  27. package/dist/components/chat/index.cjs +5 -5
  28. package/dist/components/chat/utils/cited-sources.d.ts +9 -0
  29. package/dist/components/chat/utils/cited-sources.d.ts.map +1 -1
  30. package/dist/components/chat/utils/cited-sources.js +5 -0
  31. package/dist/components/contact/index.cjs +7 -7
  32. package/dist/components/docs/index.cjs +10 -10
  33. package/dist/components/embeds/index.cjs +7 -7
  34. package/dist/components/faq/index.cjs +8 -8
  35. package/dist/components/features/index.cjs +6 -6
  36. package/dist/components/help-center-pages/index.cjs +80 -80
  37. package/dist/components/index.cjs +48 -48
  38. package/dist/components/meeting-scheduler/index.cjs +31 -31
  39. package/dist/components/navigation/index.cjs +9 -9
  40. package/dist/components/onboarding-guides/index.cjs +9 -9
  41. package/dist/components/product-demo/index.cjs +15 -15
  42. package/dist/components/related-content/index.cjs +4 -4
  43. package/dist/components/tickets/index.cjs +11 -11
  44. package/dist/components/ui/index.cjs +6 -6
  45. package/dist/contexts/chat-runtime-context.d.ts +4 -3
  46. package/dist/contexts/chat-runtime-context.d.ts.map +1 -1
  47. package/dist/{devices-BSIWSRZG.cjs → devices-SWFK4CPO.cjs} +7 -7
  48. package/dist/{embeddable-chat-5L2PKTW3.cjs → embeddable-chat-J6CKPKKM.cjs} +74 -71
  49. package/dist/index.cjs +17 -17
  50. package/dist/{knowledge-2F3IPK73.cjs → knowledge-N5FDIA33.cjs} +7 -7
  51. package/dist/{logs-U3OCJ2OC.cjs → logs-OEK7GMEB.cjs} +14 -14
  52. package/dist/{policies-L3KHKE2G.cjs → policies-Q7AS5AL6.cjs} +10 -10
  53. package/dist/{scripts-U4SLB5YC.cjs → scripts-3XWEDB2A.cjs} +11 -11
  54. package/dist/{software-update-QALYFCIO.cjs → software-update-6FOBLAOF.cjs} +9 -9
  55. package/dist/utils/image-proxy.d.ts +3 -2
  56. package/dist/utils/image-proxy.d.ts.map +1 -1
  57. package/dist/utils/image-proxy.js +11 -4
  58. package/dist/utils/index.cjs +68 -62
  59. package/package.json +1 -1
  60. package/src/components/chat/embeddable-chat.tsx +7 -8
  61. package/src/components/chat/utils/cited-sources.ts +10 -0
  62. package/src/contexts/chat-runtime-context.tsx +4 -3
  63. package/src/utils/image-proxy.ts +17 -6
@@ -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 as `imageUrl.includes(domain)` so subdomains
25
- * inherit. Default: `[]`.
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
- for (const domain of skipDomains) {
82
- if (imageUrl.includes(domain)) {
83
- return imageUrl;
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.