@flamingo-stack/openframe-frontend-core 0.0.645-2219.6362.1 → 0.0.645

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 (108) hide show
  1. package/dist/{chunk-KHHFMHYE.cjs → chunk-3J7YNAYI.cjs} +3 -3
  2. package/dist/chunk-3J7YNAYI.cjs.map +1 -0
  3. package/dist/{chunk-HQBC7YRF.js → chunk-3PGYHT67.js} +2 -2
  4. package/dist/{chunk-O2SLSYJC.cjs → chunk-46G4WFA7.cjs} +4 -4
  5. package/dist/{chunk-O2SLSYJC.cjs.map → chunk-46G4WFA7.cjs.map} +1 -1
  6. package/dist/{chunk-K72YMLCU.cjs → chunk-4A4DQSTI.cjs} +25 -25
  7. package/dist/{chunk-K72YMLCU.cjs.map → chunk-4A4DQSTI.cjs.map} +1 -1
  8. package/dist/{chunk-3WLHNR2G.cjs → chunk-56FDKQ7R.cjs} +33 -33
  9. package/dist/{chunk-3WLHNR2G.cjs.map → chunk-56FDKQ7R.cjs.map} +1 -1
  10. package/dist/{chunk-OBBAT4AU.js → chunk-6PMUA6JW.js} +3 -3
  11. package/dist/{chunk-WWPANZTL.js → chunk-EI3SLIWL.js} +3 -3
  12. package/dist/{chunk-O3YNMOIS.cjs → chunk-GPZ6Q2NP.cjs} +15 -15
  13. package/dist/{chunk-O3YNMOIS.cjs.map → chunk-GPZ6Q2NP.cjs.map} +1 -1
  14. package/dist/{chunk-N7IAE3DN.js → chunk-GSNX2GDA.js} +4 -4
  15. package/dist/{chunk-EDNZ2HN3.js → chunk-HDCIDJSP.js} +6 -6
  16. package/dist/{chunk-UF5VXOVZ.js → chunk-HHE7UNGR.js} +5 -5
  17. package/dist/{chunk-CYXV5HPV.js → chunk-JZVSQT2V.js} +3 -3
  18. package/dist/{chunk-EBDCDHOT.js → chunk-KYIOOOQY.js} +2 -2
  19. package/dist/{chunk-ZC7BVCDJ.cjs → chunk-M2MTAES4.cjs} +45 -45
  20. package/dist/{chunk-ZC7BVCDJ.cjs.map → chunk-M2MTAES4.cjs.map} +1 -1
  21. package/dist/{chunk-EADBLRNF.js → chunk-MTC6DWVH.js} +2 -2
  22. package/dist/{chunk-TIYVK2BE.cjs → chunk-N4Q5GKBN.cjs} +10 -10
  23. package/dist/{chunk-TIYVK2BE.cjs.map → chunk-N4Q5GKBN.cjs.map} +1 -1
  24. package/dist/{chunk-4GZZYHG5.cjs → chunk-OGBM3JPR.cjs} +71 -71
  25. package/dist/{chunk-4GZZYHG5.cjs.map → chunk-OGBM3JPR.cjs.map} +1 -1
  26. package/dist/{chunk-BWGV4TI5.cjs → chunk-Q7XUKTBB.cjs} +5 -5
  27. package/dist/{chunk-BWGV4TI5.cjs.map → chunk-Q7XUKTBB.cjs.map} +1 -1
  28. package/dist/{chunk-5F5WKIDW.cjs → chunk-QXML4X4W.cjs} +9 -9
  29. package/dist/{chunk-5F5WKIDW.cjs.map → chunk-QXML4X4W.cjs.map} +1 -1
  30. package/dist/{chunk-O7LA444D.js → chunk-R3CH2ASE.js} +2 -2
  31. package/dist/{chunk-QP7Z4EN7.js → chunk-RUC2V3VH.js} +3 -3
  32. package/dist/{chunk-BH34E2RJ.cjs → chunk-SID5YPKF.cjs} +22 -22
  33. package/dist/{chunk-BH34E2RJ.cjs.map → chunk-SID5YPKF.cjs.map} +1 -1
  34. package/dist/{chunk-REDPQ7F6.js → chunk-T36DLNMO.js} +2 -2
  35. package/dist/{chunk-OPNEE5XD.cjs → chunk-UF7AUQ3M.cjs} +22 -22
  36. package/dist/{chunk-OPNEE5XD.cjs.map → chunk-UF7AUQ3M.cjs.map} +1 -1
  37. package/dist/{chunk-2SNL36JV.js → chunk-ULJNU46H.js} +3 -3
  38. package/dist/{chunk-AHC2CQDD.cjs → chunk-WIYSHSNU.cjs} +10 -10
  39. package/dist/{chunk-AHC2CQDD.cjs.map → chunk-WIYSHSNU.cjs.map} +1 -1
  40. package/dist/{chunk-DEIYPXGD.js → chunk-WSRGTWQL.js} +5 -5
  41. package/dist/{chunk-CLVJC6SI.js → chunk-X7LGHPH5.js} +3 -3
  42. package/dist/{chunk-CLVJC6SI.js.map → chunk-X7LGHPH5.js.map} +1 -1
  43. package/dist/{chunk-WDFDZSAK.cjs → chunk-XILTWY3L.cjs} +163 -163
  44. package/dist/{chunk-WDFDZSAK.cjs.map → chunk-XILTWY3L.cjs.map} +1 -1
  45. package/dist/{chunk-KL3Z26IS.cjs → chunk-YEXV52L5.cjs} +3 -3
  46. package/dist/{chunk-KL3Z26IS.cjs.map → chunk-YEXV52L5.cjs.map} +1 -1
  47. package/dist/{chunk-UOOA73XL.cjs → chunk-YQZXCJQL.cjs} +3 -3
  48. package/dist/{chunk-UOOA73XL.cjs.map → chunk-YQZXCJQL.cjs.map} +1 -1
  49. package/dist/{chunk-IERXOVIS.js → chunk-Z7UIO5RQ.js} +5 -5
  50. package/dist/components/case-studies/index.cjs +14 -14
  51. package/dist/components/case-studies/index.js +3 -3
  52. package/dist/components/chat/index.cjs +2 -2
  53. package/dist/components/chat/index.js +1 -1
  54. package/dist/components/contact/index.cjs +4 -4
  55. package/dist/components/contact/index.js +3 -3
  56. package/dist/components/docs/index.cjs +7 -7
  57. package/dist/components/docs/index.js +6 -6
  58. package/dist/components/embeds/index.cjs +4 -4
  59. package/dist/components/embeds/index.js +3 -3
  60. package/dist/components/faq/index.cjs +4 -4
  61. package/dist/components/faq/index.js +3 -3
  62. package/dist/components/features/index.cjs +3 -3
  63. package/dist/components/features/index.js +2 -2
  64. package/dist/components/help-center-pages/index.cjs +23 -23
  65. package/dist/components/help-center-pages/index.js +14 -14
  66. package/dist/components/index.cjs +39 -39
  67. package/dist/components/index.js +13 -13
  68. package/dist/components/meeting-scheduler/index.cjs +24 -24
  69. package/dist/components/meeting-scheduler/index.js +2 -2
  70. package/dist/components/navigation/index.cjs +6 -6
  71. package/dist/components/navigation/index.js +5 -5
  72. package/dist/components/onboarding-guides/index.cjs +6 -6
  73. package/dist/components/onboarding-guides/index.js +5 -5
  74. package/dist/components/tickets/index.cjs +7 -7
  75. package/dist/components/tickets/index.js +6 -6
  76. package/dist/components/ui/index.cjs +3 -3
  77. package/dist/components/ui/index.js +2 -2
  78. package/dist/index.cjs +7 -7
  79. package/dist/index.js +6 -6
  80. package/dist/platform-domains.cjs +2 -2
  81. package/dist/platform-domains.cjs.map +1 -1
  82. package/dist/platform-domains.d.ts +5 -2
  83. package/dist/platform-domains.d.ts.map +1 -1
  84. package/dist/platform-domains.js +2 -2
  85. package/dist/platform-domains.js.map +1 -1
  86. package/dist/utils/index.cjs +2 -2
  87. package/dist/utils/index.cjs.map +1 -1
  88. package/dist/utils/index.js +2 -2
  89. package/dist/utils/index.js.map +1 -1
  90. package/package.json +1 -1
  91. package/src/__tests__/platform-domains.test.ts +17 -9
  92. package/src/platform-domains.ts +6 -3
  93. package/dist/chunk-KHHFMHYE.cjs.map +0 -1
  94. /package/dist/{chunk-HQBC7YRF.js.map → chunk-3PGYHT67.js.map} +0 -0
  95. /package/dist/{chunk-OBBAT4AU.js.map → chunk-6PMUA6JW.js.map} +0 -0
  96. /package/dist/{chunk-WWPANZTL.js.map → chunk-EI3SLIWL.js.map} +0 -0
  97. /package/dist/{chunk-N7IAE3DN.js.map → chunk-GSNX2GDA.js.map} +0 -0
  98. /package/dist/{chunk-EDNZ2HN3.js.map → chunk-HDCIDJSP.js.map} +0 -0
  99. /package/dist/{chunk-UF5VXOVZ.js.map → chunk-HHE7UNGR.js.map} +0 -0
  100. /package/dist/{chunk-CYXV5HPV.js.map → chunk-JZVSQT2V.js.map} +0 -0
  101. /package/dist/{chunk-EBDCDHOT.js.map → chunk-KYIOOOQY.js.map} +0 -0
  102. /package/dist/{chunk-EADBLRNF.js.map → chunk-MTC6DWVH.js.map} +0 -0
  103. /package/dist/{chunk-O7LA444D.js.map → chunk-R3CH2ASE.js.map} +0 -0
  104. /package/dist/{chunk-QP7Z4EN7.js.map → chunk-RUC2V3VH.js.map} +0 -0
  105. /package/dist/{chunk-REDPQ7F6.js.map → chunk-T36DLNMO.js.map} +0 -0
  106. /package/dist/{chunk-2SNL36JV.js.map → chunk-ULJNU46H.js.map} +0 -0
  107. /package/dist/{chunk-DEIYPXGD.js.map → chunk-WSRGTWQL.js.map} +0 -0
  108. /package/dist/{chunk-IERXOVIS.js.map → chunk-Z7UIO5RQ.js.map} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flamingo-stack/openframe-frontend-core",
3
- "version": "0.0.645-2219.6362.1",
3
+ "version": "0.0.645",
4
4
  "description": "Shared design system and components for all Flamingo platforms",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -233,17 +233,25 @@ describe('getDeploymentUrl — the one app-origin resolver', () => {
233
233
  describe('getRequestOrigin / isLocalUrl / resolveRedirectTarget', () => {
234
234
  const headers = (values: Record<string, string>) => ({ get: (name: string) => values[name] ?? null });
235
235
 
236
- it('reads the host the request arrived on, https unless local, ignoring x-forwarded-host', () => {
237
- expect(getRequestOrigin(headers({ host: 'www.flamingo.run' }))).toBe('https://www.flamingo.run');
238
- expect(getRequestOrigin(headers({ host: 'localhost:3000' }))).toBe('http://localhost:3000');
239
- expect(getRequestOrigin(headers({ host: '[::1]:3000' }))).toBe('http://[::1]:3000');
240
- expect(getRequestOrigin(headers({ host: 'x.vercel.app', 'x-forwarded-proto': 'https' }))).toBe(
241
- 'https://x.vercel.app',
242
- );
243
- expect(getRequestOrigin(headers({ host: 'www.flamingo.run', 'x-forwarded-host': 'evil.example' }))).toBe(
236
+ it('reads the host the request arrived on, https unless local, ignoring x-forwarded-host, else the app origin', () => {
237
+ expect(getRequestOrigin(headers({ host: 'www.flamingo.run' }), { platform: 'flamingo' })).toBe(
244
238
  'https://www.flamingo.run',
245
239
  );
246
- expect(getRequestOrigin(headers({}))).toBeNull();
240
+ expect(getRequestOrigin(headers({ host: 'localhost:3000' }), { platform: 'flamingo' })).toBe(
241
+ 'http://localhost:3000',
242
+ );
243
+ expect(getRequestOrigin(headers({ host: '[::1]:3000' }), { platform: 'flamingo' })).toBe('http://[::1]:3000');
244
+ expect(
245
+ getRequestOrigin(headers({ host: 'x.vercel.app', 'x-forwarded-proto': 'https' }), { platform: 'flamingo' }),
246
+ ).toBe('https://x.vercel.app');
247
+ expect(
248
+ getRequestOrigin(headers({ host: 'www.flamingo.run', 'x-forwarded-host': 'evil.example' }), {
249
+ platform: 'flamingo',
250
+ }),
251
+ ).toBe('https://www.flamingo.run');
252
+ vi.stubGlobal('window', undefined);
253
+ vi.stubEnv('NEXT_PUBLIC_DEV_URL', 'http://localhost:4000');
254
+ expect(getRequestOrigin(headers({}), { platform: 'flamingo' })).toBe('http://localhost:4000');
247
255
  });
248
256
 
249
257
  it.each([
@@ -209,11 +209,14 @@ export function isLocalUrl(url: string): boolean {
209
209
  * The origin a server request arrived on, from its `host` header only (what the edge set
210
210
  * for this request — a client-writable `x-forwarded-host` never chooses where a flow
211
211
  * returns). `http` for a local host unless the proxy says otherwise, else `https`.
212
- * `null` when there is no Host header; the caller decides the fallback.
212
+ * With no Host header, the app's own origin (`getDeploymentUrl` for `platform`).
213
213
  */
214
- export function getRequestOrigin(headers: { get(name: string): string | null }): string | null {
214
+ export function getRequestOrigin(
215
+ headers: { get(name: string): string | null },
216
+ options: { platform: string; configuredUrl?: string | null },
217
+ ): string {
215
218
  const host = headers.get('host');
216
- if (!host) return null;
219
+ if (!host) return getDeploymentUrl(options);
217
220
  const local = LOCAL_HOSTNAME.test(host.replace(/:\d+$/, ''));
218
221
  const proto = headers.get('x-forwarded-proto')?.split(',')[0].trim() || (local ? 'http' : 'https');
219
222
  return `${proto}://${host}`;