@flamingo-stack/openframe-frontend-core 0.0.234 → 0.0.235-snapshot.20260609090033
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-Z46NRJWW.js → chunk-265KKBV2.js} +2 -2
- package/dist/{chunk-BOF5MSRY.js → chunk-2LEMRJ7Z.js} +3 -3
- package/dist/{chunk-EO3RG6II.cjs → chunk-7SOVT7RJ.cjs} +16 -16
- package/dist/{chunk-EO3RG6II.cjs.map → chunk-7SOVT7RJ.cjs.map} +1 -1
- package/dist/{chunk-YZDUOUMB.js → chunk-AGU44B7B.js} +2 -2
- package/dist/{chunk-DHCGJW3G.js → chunk-AZGRKZJ7.js} +10 -6
- package/dist/chunk-AZGRKZJ7.js.map +1 -0
- package/dist/{chunk-W7P7RH2X.cjs → chunk-BXMMMSIK.cjs} +1278 -1274
- package/dist/chunk-BXMMMSIK.cjs.map +1 -0
- package/dist/{chunk-IBSZ27Y7.cjs → chunk-E3VQ53IM.cjs} +7 -7
- package/dist/{chunk-IBSZ27Y7.cjs.map → chunk-E3VQ53IM.cjs.map} +1 -1
- package/dist/chunk-FIG2RKZF.cjs +169 -0
- package/dist/chunk-FIG2RKZF.cjs.map +1 -0
- package/dist/{chunk-E6B4B7GM.cjs → chunk-GRTZ23GL.cjs} +49 -49
- package/dist/{chunk-E6B4B7GM.cjs.map → chunk-GRTZ23GL.cjs.map} +1 -1
- package/dist/{chunk-F6F525T7.js → chunk-HGYOMQM3.js} +2 -2
- package/dist/{chunk-GSD52WAS.js → chunk-JNXFCV7K.js} +4 -4
- package/dist/{chunk-D3S2ODUI.js → chunk-KIGEKMBB.js} +4 -4
- package/dist/{chunk-GYRRSOTR.cjs → chunk-LPJPTBRI.cjs} +38 -38
- package/dist/{chunk-GYRRSOTR.cjs.map → chunk-LPJPTBRI.cjs.map} +1 -1
- package/dist/{chunk-UYWJM2LS.cjs → chunk-NOS6DCYY.cjs} +12 -12
- package/dist/{chunk-UYWJM2LS.cjs.map → chunk-NOS6DCYY.cjs.map} +1 -1
- package/dist/{chunk-LLTUSEHF.js → chunk-Q3GY66ST.js} +3 -3
- package/dist/chunk-XTCBRQN2.js +169 -0
- package/dist/chunk-XTCBRQN2.js.map +1 -0
- package/dist/{chunk-MWW7LKDN.cjs → chunk-Z4IBEIWD.cjs} +8 -8
- package/dist/{chunk-MWW7LKDN.cjs.map → chunk-Z4IBEIWD.cjs.map} +1 -1
- package/dist/{chunk-52PRKXK4.cjs → chunk-ZP2DKI5P.cjs} +32 -32
- package/dist/{chunk-52PRKXK4.cjs.map → chunk-ZP2DKI5P.cjs.map} +1 -1
- package/dist/components/chat/index.cjs +10 -6
- package/dist/components/chat/index.cjs.map +1 -1
- package/dist/components/chat/index.d.ts +1 -0
- package/dist/components/chat/index.d.ts.map +1 -1
- package/dist/components/chat/index.js +9 -5
- package/dist/components/contact/index.cjs +7 -7
- package/dist/components/contact/index.js +6 -6
- package/dist/components/features/index.cjs +6 -6
- package/dist/components/features/index.js +5 -5
- package/dist/components/icons/index.cjs +3 -3
- package/dist/components/icons/index.js +2 -2
- package/dist/components/index.cjs +241 -238
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.js +13 -10
- package/dist/components/index.js.map +1 -1
- package/dist/components/navigation/index.cjs +6 -6
- package/dist/components/navigation/index.js +5 -5
- package/dist/components/onboarding-guides/index.cjs +30 -30
- package/dist/components/onboarding-guides/index.js +7 -7
- package/dist/components/resizable.d.ts +1 -1
- package/dist/components/tickets/index.cjs +89 -89
- package/dist/components/tickets/index.js +8 -8
- package/dist/components/ui/file-manager/index.cjs +69 -69
- package/dist/components/ui/file-manager/index.js +2 -2
- package/dist/components/ui/index.cjs +10 -6
- package/dist/components/ui/index.cjs.map +1 -1
- package/dist/components/ui/index.js +9 -5
- package/dist/components/vendor-display-button.d.ts.map +1 -1
- package/dist/hooks/index.cjs +4 -4
- package/dist/hooks/index.js +3 -3
- package/dist/index.cjs +10 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +9 -5
- package/dist/platform-domains.cjs +149 -0
- package/dist/platform-domains.cjs.map +1 -0
- package/dist/platform-domains.d.ts +106 -0
- package/dist/platform-domains.d.ts.map +1 -0
- package/dist/platform-domains.js +134 -0
- package/dist/platform-domains.js.map +1 -0
- package/dist/types/index.cjs +87 -0
- package/dist/types/index.cjs.map +1 -1
- package/dist/types/index.js +87 -0
- package/dist/types/index.js.map +1 -1
- package/dist/utils/cn.d.ts +8 -43
- package/dist/utils/cn.d.ts.map +1 -1
- package/dist/utils/index.cjs +113 -72
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.d.ts +3 -2
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +113 -72
- package/dist/utils/index.js.map +1 -1
- package/package.json +7 -1
- package/src/__tests__/platform-domains.test.ts +189 -0
- package/src/components/chat/index.ts +1 -0
- package/src/components/vendor-display-button.tsx +4 -3
- package/src/platform-domains.ts +299 -0
- package/src/utils/cn.ts +18 -134
- package/src/utils/index.ts +7 -2
- package/dist/chunk-2TBN53KY.cjs +0 -122
- package/dist/chunk-2TBN53KY.cjs.map +0 -1
- package/dist/chunk-DHCGJW3G.js.map +0 -1
- package/dist/chunk-W7P7RH2X.cjs.map +0 -1
- package/dist/chunk-YICWWZ3Z.js +0 -122
- package/dist/chunk-YICWWZ3Z.js.map +0 -1
- /package/dist/{chunk-Z46NRJWW.js.map → chunk-265KKBV2.js.map} +0 -0
- /package/dist/{chunk-BOF5MSRY.js.map → chunk-2LEMRJ7Z.js.map} +0 -0
- /package/dist/{chunk-YZDUOUMB.js.map → chunk-AGU44B7B.js.map} +0 -0
- /package/dist/{chunk-F6F525T7.js.map → chunk-HGYOMQM3.js.map} +0 -0
- /package/dist/{chunk-GSD52WAS.js.map → chunk-JNXFCV7K.js.map} +0 -0
- /package/dist/{chunk-D3S2ODUI.js.map → chunk-KIGEKMBB.js.map} +0 -0
- /package/dist/{chunk-LLTUSEHF.js.map → chunk-Q3GY66ST.js.map} +0 -0
package/dist/utils/index.cjs
CHANGED
|
@@ -12,52 +12,92 @@ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
|
12
12
|
var React2__default = /*#__PURE__*/_interopDefault(React2);
|
|
13
13
|
|
|
14
14
|
// src/utils/cn.ts
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
|
|
15
|
+
|
|
16
|
+
// src/platform-domains.ts
|
|
17
|
+
var PLATFORM_DOMAINS = [
|
|
18
|
+
{ key: "marketing-hub", defaultUrl: "https://marketing-hub.flamingo.so", envVar: "NEXT_PUBLIC_MARKETING_HUB_URL" },
|
|
19
|
+
{ key: "company-hub", defaultUrl: "https://company-hub.flamingo.so", envVar: "NEXT_PUBLIC_COMPANY_HUB_URL" },
|
|
20
|
+
{ key: "product-hub", defaultUrl: "https://product-hub.flamingo.so", envVar: "NEXT_PUBLIC_PRODUCT_HUB_URL" },
|
|
21
|
+
{ key: "revenue-hub", defaultUrl: "https://revenue-hub.flamingo.so", envVar: "NEXT_PUBLIC_REVENUE_HUB_URL" },
|
|
22
|
+
{ key: "people-hub", defaultUrl: "https://people-hub.flamingo.so", envVar: "NEXT_PUBLIC_PEOPLE_HUB_URL" },
|
|
23
|
+
{ key: "openmsp", defaultUrl: "https://www.openmsp.ai", envVar: "NEXT_PUBLIC_OPENMSP_URL" },
|
|
24
|
+
// ORDERING INVARIANT (first-wins, load-bearing): `flamingo` MUST precede `flamingo-teaser` + `universal`.
|
|
25
|
+
// All three resolve to www.flamingo.run; the reverse index is first-wins → flamingo claims the shared host,
|
|
26
|
+
// teaser keeps only its unique flamingo.cx aliases, universal contributes no unique host.
|
|
27
|
+
// ⚠️ DO NOT REORDER — enforced by the module-load self-check at the bottom of this file.
|
|
28
|
+
{ key: "flamingo", defaultUrl: "https://www.flamingo.run", envVar: "NEXT_PUBLIC_FLAMINGO_URL" },
|
|
29
|
+
{ key: "tmcg", defaultUrl: "https://www.tmcg.miami", envVar: "NEXT_PUBLIC_TMCG_URL" },
|
|
30
|
+
{ key: "flamingo-teaser", defaultUrl: "https://www.flamingo.run", envVar: "NEXT_PUBLIC_FLAMINGO_URL", aliasHostnames: ["flamingo.cx", "www.flamingo.cx"] },
|
|
31
|
+
{ key: "openframe", defaultUrl: "https://openframe.ai", envVar: "NEXT_PUBLIC_OPENFRAME_URL", aliasHostnames: ["openframe.ai", "www.openframe.ai", "hub.openframe.ai"] },
|
|
32
|
+
{ key: "openframe-dashboard", defaultUrl: "https://openframe.ai", envVar: "NEXT_PUBLIC_OPENFRAME_DASHBOARD_URL", pseudo: true },
|
|
33
|
+
{ key: "universal", defaultUrl: "https://www.flamingo.run", envVar: "NEXT_PUBLIC_FLAMINGO_URL" }
|
|
34
|
+
];
|
|
35
|
+
var ENV_OVERRIDES = {
|
|
36
|
+
NEXT_PUBLIC_MARKETING_HUB_URL: process.env.NEXT_PUBLIC_MARKETING_HUB_URL,
|
|
37
|
+
NEXT_PUBLIC_COMPANY_HUB_URL: process.env.NEXT_PUBLIC_COMPANY_HUB_URL,
|
|
38
|
+
NEXT_PUBLIC_PRODUCT_HUB_URL: process.env.NEXT_PUBLIC_PRODUCT_HUB_URL,
|
|
39
|
+
NEXT_PUBLIC_REVENUE_HUB_URL: process.env.NEXT_PUBLIC_REVENUE_HUB_URL,
|
|
40
|
+
NEXT_PUBLIC_PEOPLE_HUB_URL: process.env.NEXT_PUBLIC_PEOPLE_HUB_URL,
|
|
41
|
+
NEXT_PUBLIC_OPENMSP_URL: process.env.NEXT_PUBLIC_OPENMSP_URL,
|
|
42
|
+
NEXT_PUBLIC_FLAMINGO_URL: process.env.NEXT_PUBLIC_FLAMINGO_URL,
|
|
43
|
+
NEXT_PUBLIC_TMCG_URL: process.env.NEXT_PUBLIC_TMCG_URL,
|
|
44
|
+
NEXT_PUBLIC_OPENFRAME_URL: process.env.NEXT_PUBLIC_OPENFRAME_URL,
|
|
45
|
+
NEXT_PUBLIC_OPENFRAME_DASHBOARD_URL: process.env.NEXT_PUBLIC_OPENFRAME_DASHBOARD_URL
|
|
46
|
+
};
|
|
47
|
+
function byKey(key) {
|
|
48
|
+
return PLATFORM_DOMAINS.find((e) => e.key === key);
|
|
49
|
+
}
|
|
50
|
+
function envOverrideFor(key) {
|
|
51
|
+
const envVar = byKey(key)?.envVar;
|
|
52
|
+
if (!envVar) return null;
|
|
53
|
+
return ENV_OVERRIDES[envVar] || null;
|
|
54
|
+
}
|
|
55
|
+
function ensureScheme(url) {
|
|
56
|
+
const trimmed = url.trim();
|
|
57
|
+
if (/^[a-z][a-z0-9+.-]*:\/\//i.test(trimmed)) return trimmed;
|
|
58
|
+
return `https://${trimmed.replace(/^\/+/, "")}`;
|
|
24
59
|
}
|
|
25
60
|
function getPlatformProductionUrl(platform) {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
61
|
+
const resolved = envOverrideFor(platform) ?? byKey(platform)?.defaultUrl ?? envOverrideFor("flamingo") ?? "https://www.flamingo.run";
|
|
62
|
+
return ensureScheme(resolved);
|
|
63
|
+
}
|
|
64
|
+
function hostOf(value) {
|
|
65
|
+
if (!value) return null;
|
|
66
|
+
try {
|
|
67
|
+
return new URL(value).hostname.toLowerCase();
|
|
68
|
+
} catch {
|
|
69
|
+
return null;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
function expandWwwApex(host) {
|
|
73
|
+
if (host.startsWith("www.")) return [host, host.slice(4)];
|
|
74
|
+
if (host.split(".").length === 2) return [host, `www.${host}`];
|
|
75
|
+
return [host];
|
|
76
|
+
}
|
|
77
|
+
function toRegistrableBaseDomain(host) {
|
|
78
|
+
const parts = host.split(".");
|
|
79
|
+
if (parts.length >= 2) return parts.slice(-2).join(".");
|
|
80
|
+
return void 0;
|
|
81
|
+
}
|
|
82
|
+
function aliasHostsOf(key) {
|
|
83
|
+
return byKey(key)?.aliasHostnames ?? [];
|
|
84
|
+
}
|
|
85
|
+
function hostsForEntry(entry, opts) {
|
|
86
|
+
const resolved = hostOf(getPlatformProductionUrl(entry.key));
|
|
87
|
+
const hosts = resolved ? expandWwwApex(resolved) : [];
|
|
88
|
+
hosts.push(...aliasHostsOf(entry.key));
|
|
89
|
+
return hosts;
|
|
90
|
+
}
|
|
91
|
+
function getPlatformByHostname(hostname) {
|
|
92
|
+
const host = hostname.toLowerCase();
|
|
93
|
+
for (const entry of PLATFORM_DOMAINS) {
|
|
94
|
+
if (entry.pseudo) continue;
|
|
95
|
+
if (hostsForEntry(entry).includes(host)) return entry.key;
|
|
60
96
|
}
|
|
97
|
+
return null;
|
|
98
|
+
}
|
|
99
|
+
function isPreviewHost(hostname) {
|
|
100
|
+
return hostname.endsWith(".vercel.app");
|
|
61
101
|
}
|
|
62
102
|
function getAllPlatformBaseDomains() {
|
|
63
103
|
if (typeof window === "undefined") return [];
|
|
@@ -65,40 +105,41 @@ function getAllPlatformBaseDomains() {
|
|
|
65
105
|
if (hostname === "localhost" || hostname === "127.0.0.1" || hostname.startsWith("127.")) {
|
|
66
106
|
return [];
|
|
67
107
|
}
|
|
68
|
-
const
|
|
69
|
-
if (
|
|
108
|
+
const previewEnv = process.env.VERCEL_ENV === "preview" || process.env.NEXT_PUBLIC_VERCEL_ENV === "preview" || isPreviewHost(hostname);
|
|
109
|
+
if (previewEnv) {
|
|
70
110
|
return [".vercel.app", "vercel.app"];
|
|
71
111
|
}
|
|
72
|
-
const platformIdentifiers = [
|
|
73
|
-
"marketing-hub",
|
|
74
|
-
"company-hub",
|
|
75
|
-
"product-hub",
|
|
76
|
-
"revenue-hub",
|
|
77
|
-
"people-hub",
|
|
78
|
-
"openmsp",
|
|
79
|
-
"flamingo",
|
|
80
|
-
"tmcg",
|
|
81
|
-
"flamingo-teaser",
|
|
82
|
-
"openframe",
|
|
83
|
-
"universal"
|
|
84
|
-
];
|
|
85
112
|
const baseDomains = /* @__PURE__ */ new Set();
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
baseDomains.add(baseDomain);
|
|
95
|
-
}
|
|
96
|
-
} catch (error) {
|
|
97
|
-
console.warn("[Platform Domains] Failed to parse URL for platform:", platform, error);
|
|
113
|
+
for (const entry of PLATFORM_DOMAINS) {
|
|
114
|
+
if (entry.pseudo) continue;
|
|
115
|
+
const host = hostOf(getPlatformProductionUrl(entry.key));
|
|
116
|
+
if (!host) continue;
|
|
117
|
+
const base = toRegistrableBaseDomain(host);
|
|
118
|
+
if (base) {
|
|
119
|
+
baseDomains.add(`.${base}`);
|
|
120
|
+
baseDomains.add(base);
|
|
98
121
|
}
|
|
99
|
-
}
|
|
122
|
+
}
|
|
100
123
|
return Array.from(baseDomains);
|
|
101
124
|
}
|
|
125
|
+
var _orderIdx = (k) => PLATFORM_DOMAINS.findIndex((e) => e.key === k);
|
|
126
|
+
if (_orderIdx("flamingo") > _orderIdx("flamingo-teaser") || _orderIdx("flamingo") > _orderIdx("universal") || getPlatformByHostname("flamingo.cx") !== "flamingo-teaser" || getPlatformByHostname("hub.openframe.ai") !== "openframe") {
|
|
127
|
+
console.error(
|
|
128
|
+
"[platform-domains] \u26A0\uFE0F PLATFORM_DOMAINS ordering invariant violated \u2014 `flamingo` must precede `flamingo-teaser`/`universal`, and the openframe/teaser aliases must be intact. Do not reorder the table."
|
|
129
|
+
);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
// src/utils/cn.ts
|
|
133
|
+
var twMerge = tailwindMerge.extendTailwindMerge({
|
|
134
|
+
extend: {
|
|
135
|
+
classGroups: {
|
|
136
|
+
"ods-typography": ["text-h1", "text-h2", "text-h3", "text-h4", "text-h5", "text-h6"]
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
function cn(...inputs) {
|
|
141
|
+
return twMerge(clsx.clsx(inputs));
|
|
142
|
+
}
|
|
102
143
|
function getBaseUrl(platform) {
|
|
103
144
|
if (process.env.NODE_ENV !== "production") {
|
|
104
145
|
return process.env.NEXT_PUBLIC_DEV_URL || "http://localhost:3000";
|
|
@@ -109,7 +150,7 @@ function getBaseUrl(platform) {
|
|
|
109
150
|
if (process.env.VERCEL_PROJECT_PRODUCTION_URL) {
|
|
110
151
|
return `https://${process.env.VERCEL_PROJECT_PRODUCTION_URL}`;
|
|
111
152
|
}
|
|
112
|
-
return
|
|
153
|
+
return getPlatformProductionUrl(process.env.NEXT_PUBLIC_APP_TYPE || "openmsp");
|
|
113
154
|
}
|
|
114
155
|
|
|
115
156
|
// src/utils/format.ts
|