@flamingo-stack/openframe-frontend-core 0.0.234 → 0.0.235
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-DHCGJW3G.js → chunk-2MHQE5ET.js} +8 -6
- package/dist/chunk-2MHQE5ET.js.map +1 -0
- package/dist/{chunk-E6B4B7GM.cjs → chunk-4Y7427BF.cjs} +49 -49
- package/dist/{chunk-E6B4B7GM.cjs.map → chunk-4Y7427BF.cjs.map} +1 -1
- package/dist/chunk-76NMNINV.js +162 -0
- package/dist/chunk-76NMNINV.js.map +1 -0
- package/dist/{chunk-Z46NRJWW.js → chunk-ABSGXVGP.js} +2 -2
- package/dist/chunk-CG6AZ2MC.cjs +162 -0
- package/dist/chunk-CG6AZ2MC.cjs.map +1 -0
- package/dist/{chunk-GSD52WAS.js → chunk-EI36Q3EC.js} +4 -4
- package/dist/{chunk-UYWJM2LS.cjs → chunk-ETFVD7QU.cjs} +12 -12
- package/dist/{chunk-UYWJM2LS.cjs.map → chunk-ETFVD7QU.cjs.map} +1 -1
- package/dist/{chunk-YZDUOUMB.js → chunk-FWYMYXL7.js} +2 -2
- package/dist/{chunk-F6F525T7.js → chunk-GW6J7IPD.js} +2 -2
- package/dist/{chunk-52PRKXK4.cjs → chunk-HJRWBA7M.cjs} +32 -32
- package/dist/{chunk-52PRKXK4.cjs.map → chunk-HJRWBA7M.cjs.map} +1 -1
- package/dist/{chunk-IBSZ27Y7.cjs → chunk-M4CWPAIB.cjs} +7 -7
- package/dist/{chunk-IBSZ27Y7.cjs.map → chunk-M4CWPAIB.cjs.map} +1 -1
- package/dist/{chunk-EO3RG6II.cjs → chunk-MDWFPCHN.cjs} +16 -16
- package/dist/{chunk-EO3RG6II.cjs.map → chunk-MDWFPCHN.cjs.map} +1 -1
- package/dist/{chunk-BOF5MSRY.js → chunk-VO3K4EEG.js} +3 -3
- package/dist/{chunk-MWW7LKDN.cjs → chunk-W4NBBPQL.cjs} +8 -8
- package/dist/{chunk-MWW7LKDN.cjs.map → chunk-W4NBBPQL.cjs.map} +1 -1
- package/dist/{chunk-W7P7RH2X.cjs → chunk-X4SQ2S7Z.cjs} +1275 -1273
- package/dist/chunk-X4SQ2S7Z.cjs.map +1 -0
- package/dist/{chunk-GYRRSOTR.cjs → chunk-X6WUWOL5.cjs} +38 -38
- package/dist/{chunk-GYRRSOTR.cjs.map → chunk-X6WUWOL5.cjs.map} +1 -1
- package/dist/{chunk-LLTUSEHF.js → chunk-Z6FT2JDQ.js} +3 -3
- package/dist/{chunk-D3S2ODUI.js → chunk-ZLQT3T4F.js} +4 -4
- package/dist/components/chat/index.cjs +6 -6
- package/dist/components/chat/index.js +5 -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 +236 -236
- package/dist/components/index.js +8 -8
- 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 +6 -6
- package/dist/components/ui/index.js +5 -5
- package/dist/hooks/index.cjs +4 -4
- package/dist/hooks/index.js +3 -3
- package/dist/index.cjs +6 -6
- package/dist/index.js +5 -5
- package/dist/platform-domains.cjs +127 -0
- package/dist/platform-domains.cjs.map +1 -0
- package/dist/platform-domains.d.ts +75 -0
- package/dist/platform-domains.d.ts.map +1 -0
- package/dist/platform-domains.js +115 -0
- package/dist/platform-domains.js.map +1 -0
- package/dist/types/index.cjs +80 -0
- package/dist/types/index.cjs.map +1 -1
- package/dist/types/index.js +80 -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 +106 -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 +106 -72
- package/dist/utils/index.js.map +1 -1
- package/package.json +7 -1
- package/src/__tests__/platform-domains.test.ts +137 -0
- package/src/platform-domains.ts +238 -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-ABSGXVGP.js.map} +0 -0
- /package/dist/{chunk-GSD52WAS.js.map → chunk-EI36Q3EC.js.map} +0 -0
- /package/dist/{chunk-YZDUOUMB.js.map → chunk-FWYMYXL7.js.map} +0 -0
- /package/dist/{chunk-F6F525T7.js.map → chunk-GW6J7IPD.js.map} +0 -0
- /package/dist/{chunk-BOF5MSRY.js.map → chunk-VO3K4EEG.js.map} +0 -0
- /package/dist/{chunk-LLTUSEHF.js.map → chunk-Z6FT2JDQ.js.map} +0 -0
- /package/dist/{chunk-D3S2ODUI.js.map → chunk-ZLQT3T4F.js.map} +0 -0
package/dist/utils/index.cjs
CHANGED
|
@@ -12,52 +12,86 @@ 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;
|
|
24
54
|
}
|
|
25
55
|
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
|
-
|
|
56
|
+
return envOverrideFor(platform) ?? byKey(platform)?.defaultUrl ?? envOverrideFor("flamingo") ?? "https://www.flamingo.run";
|
|
57
|
+
}
|
|
58
|
+
function hostOf(value) {
|
|
59
|
+
if (!value) return null;
|
|
60
|
+
try {
|
|
61
|
+
return new URL(value).hostname.toLowerCase();
|
|
62
|
+
} catch {
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
function expandWwwApex(host) {
|
|
67
|
+
if (host.startsWith("www.")) return [host, host.slice(4)];
|
|
68
|
+
if (host.split(".").length === 2) return [host, `www.${host}`];
|
|
69
|
+
return [host];
|
|
70
|
+
}
|
|
71
|
+
function toRegistrableBaseDomain(host) {
|
|
72
|
+
const parts = host.split(".");
|
|
73
|
+
if (parts.length >= 2) return parts.slice(-2).join(".");
|
|
74
|
+
return void 0;
|
|
75
|
+
}
|
|
76
|
+
function aliasHostsOf(key) {
|
|
77
|
+
return byKey(key)?.aliasHostnames ?? [];
|
|
78
|
+
}
|
|
79
|
+
function hostsForEntry(entry, opts) {
|
|
80
|
+
const resolved = hostOf(getPlatformProductionUrl(entry.key));
|
|
81
|
+
const hosts = resolved ? expandWwwApex(resolved) : [];
|
|
82
|
+
hosts.push(...aliasHostsOf(entry.key));
|
|
83
|
+
return hosts;
|
|
84
|
+
}
|
|
85
|
+
function getPlatformByHostname(hostname) {
|
|
86
|
+
const host = hostname.toLowerCase();
|
|
87
|
+
for (const entry of PLATFORM_DOMAINS) {
|
|
88
|
+
if (entry.pseudo) continue;
|
|
89
|
+
if (hostsForEntry(entry).includes(host)) return entry.key;
|
|
60
90
|
}
|
|
91
|
+
return null;
|
|
92
|
+
}
|
|
93
|
+
function isPreviewHost(hostname) {
|
|
94
|
+
return hostname.endsWith(".vercel.app");
|
|
61
95
|
}
|
|
62
96
|
function getAllPlatformBaseDomains() {
|
|
63
97
|
if (typeof window === "undefined") return [];
|
|
@@ -65,40 +99,40 @@ function getAllPlatformBaseDomains() {
|
|
|
65
99
|
if (hostname === "localhost" || hostname === "127.0.0.1" || hostname.startsWith("127.")) {
|
|
66
100
|
return [];
|
|
67
101
|
}
|
|
68
|
-
const
|
|
69
|
-
if (
|
|
102
|
+
const previewEnv = process.env.VERCEL_ENV === "preview" || process.env.NEXT_PUBLIC_VERCEL_ENV === "preview" || isPreviewHost(hostname);
|
|
103
|
+
if (previewEnv) {
|
|
70
104
|
return [".vercel.app", "vercel.app"];
|
|
71
105
|
}
|
|
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
106
|
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);
|
|
107
|
+
for (const entry of PLATFORM_DOMAINS) {
|
|
108
|
+
if (entry.pseudo) continue;
|
|
109
|
+
const host = hostOf(getPlatformProductionUrl(entry.key));
|
|
110
|
+
if (!host) continue;
|
|
111
|
+
const base = toRegistrableBaseDomain(host);
|
|
112
|
+
if (base) {
|
|
113
|
+
baseDomains.add(`.${base}`);
|
|
114
|
+
baseDomains.add(base);
|
|
98
115
|
}
|
|
99
|
-
}
|
|
116
|
+
}
|
|
100
117
|
return Array.from(baseDomains);
|
|
101
118
|
}
|
|
119
|
+
if (getPlatformByHostname("www.flamingo.run") !== "flamingo" || getPlatformByHostname("flamingo.cx") !== "flamingo-teaser" || getPlatformByHostname("hub.openframe.ai") !== "openframe") {
|
|
120
|
+
console.error(
|
|
121
|
+
"[platform-domains] \u26A0\uFE0F PLATFORM_DOMAINS ordering invariant violated \u2014 `flamingo` must precede `flamingo-teaser`/`universal`, and the openframe aliases must be intact. Do not reorder the table."
|
|
122
|
+
);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// src/utils/cn.ts
|
|
126
|
+
var twMerge = tailwindMerge.extendTailwindMerge({
|
|
127
|
+
extend: {
|
|
128
|
+
classGroups: {
|
|
129
|
+
"ods-typography": ["text-h1", "text-h2", "text-h3", "text-h4", "text-h5", "text-h6"]
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
function cn(...inputs) {
|
|
134
|
+
return twMerge(clsx.clsx(inputs));
|
|
135
|
+
}
|
|
102
136
|
function getBaseUrl(platform) {
|
|
103
137
|
if (process.env.NODE_ENV !== "production") {
|
|
104
138
|
return process.env.NEXT_PUBLIC_DEV_URL || "http://localhost:3000";
|
|
@@ -109,7 +143,7 @@ function getBaseUrl(platform) {
|
|
|
109
143
|
if (process.env.VERCEL_PROJECT_PRODUCTION_URL) {
|
|
110
144
|
return `https://${process.env.VERCEL_PROJECT_PRODUCTION_URL}`;
|
|
111
145
|
}
|
|
112
|
-
return
|
|
146
|
+
return getPlatformProductionUrl(process.env.NEXT_PUBLIC_APP_TYPE || "openmsp");
|
|
113
147
|
}
|
|
114
148
|
|
|
115
149
|
// src/utils/format.ts
|