@flamingo-stack/openframe-frontend-core 0.0.626 → 0.0.627
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-2CCIF5QV.js → chunk-25UWKNII.js} +10 -8
- package/dist/{chunk-2CCIF5QV.js.map → chunk-25UWKNII.js.map} +1 -1
- package/dist/{chunk-BVCWBA2U.js → chunk-2J7EFH4V.js} +817 -395
- package/dist/chunk-2J7EFH4V.js.map +1 -0
- package/dist/{chunk-X3LC6R37.js → chunk-32P6KUZP.js} +2 -2
- package/dist/{chunk-3LKJ6JWZ.cjs → chunk-4E3UZZ2J.cjs} +34 -34
- package/dist/{chunk-3LKJ6JWZ.cjs.map → chunk-4E3UZZ2J.cjs.map} +1 -1
- package/dist/{chunk-EHAYNUOL.cjs → chunk-4E7XCEV3.cjs} +77 -2
- package/dist/chunk-4E7XCEV3.cjs.map +1 -0
- package/dist/{chunk-KK7YEVTQ.js → chunk-4PIHIFJM.js} +4 -4
- package/dist/{chunk-VOBOO7EF.cjs → chunk-4SXZT7JP.cjs} +83 -83
- package/dist/{chunk-VOBOO7EF.cjs.map → chunk-4SXZT7JP.cjs.map} +1 -1
- package/dist/{chunk-ESSHEVZQ.cjs → chunk-53ARMJHM.cjs} +38 -38
- package/dist/chunk-53ARMJHM.cjs.map +1 -0
- package/dist/{chunk-Q5XGBLT5.cjs → chunk-55X46LKR.cjs} +509 -87
- package/dist/chunk-55X46LKR.cjs.map +1 -0
- package/dist/{chunk-DLZFFGQ7.js → chunk-5E55S5SI.js} +4 -4
- package/dist/{chunk-U7TTQV4N.cjs → chunk-6I3KNDBF.cjs} +3 -3
- package/dist/{chunk-U7TTQV4N.cjs.map → chunk-6I3KNDBF.cjs.map} +1 -1
- package/dist/{chunk-S6WBBSII.js → chunk-76HB456V.js} +5 -5
- package/dist/{chunk-Z42VU7HF.cjs → chunk-BC726XIQ.cjs} +49 -47
- package/dist/chunk-BC726XIQ.cjs.map +1 -0
- package/dist/{chunk-LJ7KMQRM.cjs → chunk-BJGAFPG5.cjs} +42 -42
- package/dist/{chunk-LJ7KMQRM.cjs.map → chunk-BJGAFPG5.cjs.map} +1 -1
- package/dist/{chunk-F4TAUCHQ.js → chunk-CAQ5MNLJ.js} +3 -3
- package/dist/{chunk-QR2FJE2C.js → chunk-CK2CPZXB.js} +12 -12
- package/dist/{chunk-YQCA4ZEJ.js → chunk-CMUNJZWN.js} +2 -2
- package/dist/{chunk-H7KQM3VI.js → chunk-DH3YH3TV.js} +8 -8
- package/dist/{chunk-E7YNDGRN.cjs → chunk-FR6EDA3P.cjs} +105 -105
- package/dist/{chunk-E7YNDGRN.cjs.map → chunk-FR6EDA3P.cjs.map} +1 -1
- package/dist/{chunk-QPQCQWAW.cjs → chunk-G46NJNTL.cjs} +28 -26
- package/dist/chunk-G46NJNTL.cjs.map +1 -0
- package/dist/{chunk-RQQAPCOU.js → chunk-G47XRVZA.js} +3 -3
- package/dist/{chunk-QJ6BCSFQ.cjs → chunk-GQ7267OV.cjs} +5 -5
- package/dist/{chunk-QJ6BCSFQ.cjs.map → chunk-GQ7267OV.cjs.map} +1 -1
- package/dist/{chunk-RVK3CL5S.js → chunk-HIZAMJPT.js} +12 -12
- package/dist/{chunk-DZ7CEES3.js → chunk-J6ATJUEE.js} +5 -5
- package/dist/{chunk-DZ7CEES3.js.map → chunk-J6ATJUEE.js.map} +1 -1
- package/dist/{chunk-5LIDR7HL.js → chunk-JRYS4VMV.js} +4 -79
- package/dist/{chunk-5LIDR7HL.js.map → chunk-JRYS4VMV.js.map} +1 -1
- package/dist/{chunk-RGMUA4XB.js → chunk-KXDYBRRR.js} +7 -7
- package/dist/{chunk-IJYP2DMW.js → chunk-L5FEAOGJ.js} +8 -354
- package/dist/chunk-L5FEAOGJ.js.map +1 -0
- package/dist/{chunk-L54LFB6V.cjs → chunk-N6XNJX25.cjs} +15 -15
- package/dist/{chunk-L54LFB6V.cjs.map → chunk-N6XNJX25.cjs.map} +1 -1
- package/dist/{chunk-WEDSYUSR.js → chunk-NLADJ4IX.js} +6 -6
- package/dist/{chunk-HTIDXF43.cjs → chunk-OAXASIVG.cjs} +7 -7
- package/dist/{chunk-HTIDXF43.cjs.map → chunk-OAXASIVG.cjs.map} +1 -1
- package/dist/{chunk-3IXDZI3R.cjs → chunk-P7UT2YSC.cjs} +3 -3
- package/dist/{chunk-3IXDZI3R.cjs.map → chunk-P7UT2YSC.cjs.map} +1 -1
- package/dist/{chunk-P7KIFYZI.js → chunk-PKSH6PAK.js} +10 -8
- package/dist/{chunk-P7KIFYZI.js.map → chunk-PKSH6PAK.js.map} +1 -1
- package/dist/{chunk-MZWSJPDZ.js → chunk-PTP5LSYM.js} +16 -28
- package/dist/{chunk-MZWSJPDZ.js.map → chunk-PTP5LSYM.js.map} +1 -1
- package/dist/{chunk-CPO5KPW6.cjs → chunk-QCSWM3VU.cjs} +9 -9
- package/dist/{chunk-CPO5KPW6.cjs.map → chunk-QCSWM3VU.cjs.map} +1 -1
- package/dist/{chunk-JJUV7Z4L.cjs → chunk-QIVX7F3N.cjs} +27 -27
- package/dist/{chunk-JJUV7Z4L.cjs.map → chunk-QIVX7F3N.cjs.map} +1 -1
- package/dist/{chunk-NZJNXGU2.cjs → chunk-R3SJ6PMI.cjs} +280 -292
- package/dist/chunk-R3SJ6PMI.cjs.map +1 -0
- package/dist/{chunk-2MMEPNSX.cjs → chunk-RAPPN6MN.cjs} +3 -3
- package/dist/{chunk-2MMEPNSX.cjs.map → chunk-RAPPN6MN.cjs.map} +1 -1
- package/dist/{chunk-S43SLJIN.cjs → chunk-SLT5C3PQ.cjs} +25 -25
- package/dist/{chunk-S43SLJIN.cjs.map → chunk-SLT5C3PQ.cjs.map} +1 -1
- package/dist/{chunk-FKBM6U43.js → chunk-USIRWQJ3.js} +76 -1
- package/dist/{chunk-FKBM6U43.js.map → chunk-USIRWQJ3.js.map} +1 -1
- package/dist/{chunk-CCWI3622.cjs → chunk-VOZZQ6HQ.cjs} +4 -4
- package/dist/{chunk-CCWI3622.cjs.map → chunk-VOZZQ6HQ.cjs.map} +1 -1
- package/dist/{chunk-3POP5WWC.cjs → chunk-VUAEDAUN.cjs} +6 -6
- package/dist/{chunk-3POP5WWC.cjs.map → chunk-VUAEDAUN.cjs.map} +1 -1
- package/dist/{chunk-34GEH24Y.cjs → chunk-VZQ3VVFH.cjs} +22 -20
- package/dist/chunk-VZQ3VVFH.cjs.map +1 -0
- package/dist/{chunk-ZIEYC6ZB.js → chunk-WZ6CUZMM.js} +4 -4
- package/dist/{chunk-F2KBCLUG.js → chunk-X5NN4NJM.js} +2 -2
- package/dist/{chunk-IZG3VYDV.js → chunk-Y3MIFC5M.js} +4 -4
- package/dist/{chunk-63F2UQDW.cjs → chunk-ZCQVUIPH.cjs} +18 -18
- package/dist/{chunk-63F2UQDW.cjs.map → chunk-ZCQVUIPH.cjs.map} +1 -1
- package/dist/{chunk-NLVBO3IR.js → chunk-ZGZ7YAJH.js} +10 -8
- package/dist/{chunk-NLVBO3IR.js.map → chunk-ZGZ7YAJH.js.map} +1 -1
- package/dist/{chunk-YXWGSDK4.cjs → chunk-ZI27ALYX.cjs} +5 -80
- package/dist/chunk-ZI27ALYX.cjs.map +1 -0
- package/dist/{chunk-BVQEU5JB.js → chunk-ZOMGXH7C.js} +2 -2
- package/dist/{chunk-MSVEZB5D.cjs → chunk-ZYDNPUSH.cjs} +279 -625
- package/dist/chunk-ZYDNPUSH.cjs.map +1 -0
- package/dist/components/case-studies/index.cjs +14 -14
- package/dist/components/case-studies/index.js +8 -8
- package/dist/components/chat/entity-cards/ai-prompt-card.d.ts +2 -1
- package/dist/components/chat/entity-cards/ai-prompt-card.d.ts.map +1 -1
- package/dist/components/chat/entity-cards/employee-entry-card.d.ts +3 -3
- package/dist/components/chat/entity-cards/employee-entry-card.d.ts.map +1 -1
- package/dist/components/chat/entity-cards/entity-author-card.d.ts +8 -6
- package/dist/components/chat/entity-cards/entity-author-card.d.ts.map +1 -1
- package/dist/components/chat/index.cjs +5 -5
- package/dist/components/chat/index.js +4 -4
- package/dist/components/contact/index.cjs +9 -9
- package/dist/components/contact/index.js +8 -8
- package/dist/components/docs/index.cjs +12 -12
- package/dist/components/docs/index.js +11 -11
- package/dist/components/embeds/index.cjs +9 -9
- package/dist/components/embeds/index.js +8 -8
- package/dist/components/faq/index.cjs +10 -10
- package/dist/components/faq/index.js +9 -9
- package/dist/components/features/index.cjs +8 -8
- package/dist/components/features/index.js +7 -7
- package/dist/components/help-center-pages/index.cjs +31 -31
- package/dist/components/help-center-pages/index.js +22 -22
- package/dist/components/index.cjs +75 -69
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.js +30 -24
- package/dist/components/index.js.map +1 -1
- package/dist/components/meeting-scheduler/index.cjs +49 -49
- package/dist/components/meeting-scheduler/index.js +9 -9
- package/dist/components/navigation/index.cjs +11 -11
- package/dist/components/navigation/index.js +10 -10
- package/dist/components/onboarding-guides/index.cjs +12 -12
- package/dist/components/onboarding-guides/index.js +11 -11
- package/dist/components/related-content/card-registry.d.ts.map +1 -1
- package/dist/components/related-content/index.cjs +6 -6
- package/dist/components/related-content/index.js +5 -5
- package/dist/components/tickets/index.cjs +13 -13
- package/dist/components/tickets/index.js +12 -12
- package/dist/components/ui/color-preset-select.d.ts +4 -5
- package/dist/components/ui/color-preset-select.d.ts.map +1 -1
- package/dist/components/ui/department-badge.d.ts +21 -0
- package/dist/components/ui/department-badge.d.ts.map +1 -0
- package/dist/components/ui/index.cjs +14 -8
- package/dist/components/ui/index.cjs.map +1 -1
- package/dist/components/ui/index.d.ts +2 -0
- package/dist/components/ui/index.d.ts.map +1 -1
- package/dist/components/ui/index.js +13 -7
- package/dist/components/ui/palette-badge.d.ts +22 -0
- package/dist/components/ui/palette-badge.d.ts.map +1 -0
- package/dist/hooks/index.cjs +5 -5
- package/dist/hooks/index.js +4 -4
- package/dist/index.cjs +28 -18
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +50 -40
- package/dist/index.js.map +1 -1
- package/dist/types/department.d.ts +4 -0
- package/dist/types/department.d.ts.map +1 -1
- package/dist/utils/color-presets.d.ts +24 -0
- package/dist/utils/color-presets.d.ts.map +1 -0
- package/dist/utils/index.cjs +32 -0
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +30 -1
- package/dist/utils/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/chat/entity-cards/ai-prompt-card.tsx +7 -4
- package/src/components/chat/entity-cards/employee-entry-card.tsx +21 -24
- package/src/components/chat/entity-cards/entity-author-card.tsx +10 -4
- package/src/components/related-content/card-registry.tsx +3 -1
- package/src/components/ui/.department-badge.md +2 -0
- package/src/components/ui/.palette-badge.md +2 -0
- package/src/components/ui/__tests__/department-badge.test.tsx +47 -0
- package/src/components/ui/color-preset-select.tsx +5 -21
- package/src/components/ui/department-badge.tsx +35 -0
- package/src/components/ui/index.ts +2 -0
- package/src/components/ui/palette-badge.tsx +39 -0
- package/src/types/department.ts +4 -0
- package/src/utils/.color-presets.md +2 -0
- package/src/utils/color-presets.ts +48 -0
- package/src/utils/index.ts +1 -0
- package/dist/chunk-34GEH24Y.cjs.map +0 -1
- package/dist/chunk-BVCWBA2U.js.map +0 -1
- package/dist/chunk-EHAYNUOL.cjs.map +0 -1
- package/dist/chunk-ESSHEVZQ.cjs.map +0 -1
- package/dist/chunk-IJYP2DMW.js.map +0 -1
- package/dist/chunk-MSVEZB5D.cjs.map +0 -1
- package/dist/chunk-NZJNXGU2.cjs.map +0 -1
- package/dist/chunk-Q5XGBLT5.cjs.map +0 -1
- package/dist/chunk-QPQCQWAW.cjs.map +0 -1
- package/dist/chunk-YXWGSDK4.cjs.map +0 -1
- package/dist/chunk-Z42VU7HF.cjs.map +0 -1
- /package/dist/{chunk-X3LC6R37.js.map → chunk-32P6KUZP.js.map} +0 -0
- /package/dist/{chunk-KK7YEVTQ.js.map → chunk-4PIHIFJM.js.map} +0 -0
- /package/dist/{chunk-DLZFFGQ7.js.map → chunk-5E55S5SI.js.map} +0 -0
- /package/dist/{chunk-S6WBBSII.js.map → chunk-76HB456V.js.map} +0 -0
- /package/dist/{chunk-F4TAUCHQ.js.map → chunk-CAQ5MNLJ.js.map} +0 -0
- /package/dist/{chunk-QR2FJE2C.js.map → chunk-CK2CPZXB.js.map} +0 -0
- /package/dist/{chunk-YQCA4ZEJ.js.map → chunk-CMUNJZWN.js.map} +0 -0
- /package/dist/{chunk-H7KQM3VI.js.map → chunk-DH3YH3TV.js.map} +0 -0
- /package/dist/{chunk-RQQAPCOU.js.map → chunk-G47XRVZA.js.map} +0 -0
- /package/dist/{chunk-RVK3CL5S.js.map → chunk-HIZAMJPT.js.map} +0 -0
- /package/dist/{chunk-RGMUA4XB.js.map → chunk-KXDYBRRR.js.map} +0 -0
- /package/dist/{chunk-WEDSYUSR.js.map → chunk-NLADJ4IX.js.map} +0 -0
- /package/dist/{chunk-ZIEYC6ZB.js.map → chunk-WZ6CUZMM.js.map} +0 -0
- /package/dist/{chunk-F2KBCLUG.js.map → chunk-X5NN4NJM.js.map} +0 -0
- /package/dist/{chunk-IZG3VYDV.js.map → chunk-Y3MIFC5M.js.map} +0 -0
- /package/dist/{chunk-BVQEU5JB.js.map → chunk-ZOMGXH7C.js.map} +0 -0
|
@@ -4,7 +4,6 @@ import {
|
|
|
4
4
|
NEAR_VIEWPORT_ROOT_MARGIN,
|
|
5
5
|
STICKY_HEADER_OFFSET_PX,
|
|
6
6
|
ToolIcon,
|
|
7
|
-
clamp,
|
|
8
7
|
createFenceTracker,
|
|
9
8
|
createHeadingIdDeduper,
|
|
10
9
|
getHashTargetElement,
|
|
@@ -22,7 +21,7 @@ import {
|
|
|
22
21
|
useNearViewport,
|
|
23
22
|
useResetOnPageHidden,
|
|
24
23
|
useSuppressCloneFocus
|
|
25
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-JRYS4VMV.js";
|
|
26
25
|
import {
|
|
27
26
|
useRouter
|
|
28
27
|
} from "./chunk-XXMHLZ3Y.js";
|
|
@@ -155,6 +154,8 @@ import {
|
|
|
155
154
|
canonicalContentRefType,
|
|
156
155
|
computeIsNewTab,
|
|
157
156
|
defaultBuildProductReleaseCardProps,
|
|
157
|
+
deriveActiveColor,
|
|
158
|
+
deriveHoverColor,
|
|
158
159
|
extractItemId,
|
|
159
160
|
extractItems,
|
|
160
161
|
formatDateShort,
|
|
@@ -165,6 +166,7 @@ import {
|
|
|
165
166
|
formatInvestorUpdatePeriod,
|
|
166
167
|
formatTimeWithTimezone,
|
|
167
168
|
getProxiedImageUrl,
|
|
169
|
+
getReadableTextColor,
|
|
168
170
|
getStatusColorScheme,
|
|
169
171
|
isSameOriginAbsoluteHref,
|
|
170
172
|
newTabAnchorAttrs,
|
|
@@ -172,20 +174,18 @@ import {
|
|
|
172
174
|
safeHref,
|
|
173
175
|
sortBitesByCreatedAtDesc,
|
|
174
176
|
useCoverImageFallback
|
|
175
|
-
} from "./chunk-
|
|
177
|
+
} from "./chunk-2J7EFH4V.js";
|
|
176
178
|
import {
|
|
177
179
|
next_image_default
|
|
178
180
|
} from "./chunk-MDKCTSDS.js";
|
|
179
181
|
import {
|
|
180
|
-
|
|
182
|
+
clamp,
|
|
181
183
|
createLocalStorageAdapter,
|
|
182
184
|
embedAuthedFetch,
|
|
183
185
|
getEmbedProxyAuth,
|
|
184
|
-
getPlatformAccentColor,
|
|
185
|
-
getPlatformDisplayName,
|
|
186
186
|
useAuthedAssetSrc,
|
|
187
187
|
useAuthedImageSrc
|
|
188
|
-
} from "./chunk-
|
|
188
|
+
} from "./chunk-USIRWQJ3.js";
|
|
189
189
|
import {
|
|
190
190
|
OpenFrameLogo
|
|
191
191
|
} from "./chunk-OTX6XNSA.js";
|
|
@@ -3878,332 +3878,6 @@ function PlusCircleIcon2({ className, whiteOverlay = false, iconSize = 24, ...pr
|
|
|
3878
3878
|
);
|
|
3879
3879
|
}
|
|
3880
3880
|
|
|
3881
|
-
// src/utils/color-analysis.ts
|
|
3882
|
-
var DESIGN_PALETTE = [
|
|
3883
|
-
{ name: "yellow", hex: "#FFC008", rgb: [255, 192, 8] },
|
|
3884
|
-
{ name: "black", hex: "#161616", rgb: [22, 22, 22] },
|
|
3885
|
-
{ name: "gray", hex: "#888888", rgb: [136, 136, 136] }
|
|
3886
|
-
];
|
|
3887
|
-
function hexToRgb(hex) {
|
|
3888
|
-
const normalized = hex.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i, (_, r, g, b) => `${r}${r}${g}${g}${b}${b}`);
|
|
3889
|
-
const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(normalized);
|
|
3890
|
-
return result ? [parseInt(result[1], 16), parseInt(result[2], 16), parseInt(result[3], 16)] : [0, 0, 0];
|
|
3891
|
-
}
|
|
3892
|
-
function getLuminance(rgb) {
|
|
3893
|
-
const [r, g, b] = rgb.map((channel) => {
|
|
3894
|
-
const c = channel / 255;
|
|
3895
|
-
return c <= 0.03928 ? c / 12.92 : Math.pow((c + 0.055) / 1.055, 2.4);
|
|
3896
|
-
});
|
|
3897
|
-
return 0.2126 * r + 0.7152 * g + 0.0722 * b;
|
|
3898
|
-
}
|
|
3899
|
-
function getContrastRatio(color1, color2) {
|
|
3900
|
-
const lum1 = getLuminance(color1);
|
|
3901
|
-
const lum2 = getLuminance(color2);
|
|
3902
|
-
const brightest = Math.max(lum1, lum2);
|
|
3903
|
-
const darkest = Math.min(lum1, lum2);
|
|
3904
|
-
return (brightest + 0.05) / (darkest + 0.05);
|
|
3905
|
-
}
|
|
3906
|
-
function pickReadableTextColor(bgHex) {
|
|
3907
|
-
const bg = hexToRgb(bgHex);
|
|
3908
|
-
const darkContrast = getContrastRatio(bg, [26, 26, 26]);
|
|
3909
|
-
const lightContrast = getContrastRatio(bg, [250, 250, 250]);
|
|
3910
|
-
return darkContrast >= lightContrast ? "dark" : "light";
|
|
3911
|
-
}
|
|
3912
|
-
function extractDominantColor(canvas) {
|
|
3913
|
-
const ctx = canvas.getContext("2d");
|
|
3914
|
-
if (!ctx) return [128, 128, 128];
|
|
3915
|
-
const imageData = ctx.getImageData(0, 0, canvas.width, canvas.height);
|
|
3916
|
-
const data = imageData.data;
|
|
3917
|
-
const sampleSize = Math.max(1, Math.floor(data.length / (4 * 1e3)));
|
|
3918
|
-
const colorCounts = {};
|
|
3919
|
-
for (let i = 0; i < data.length; i += 4 * sampleSize) {
|
|
3920
|
-
const r = data[i];
|
|
3921
|
-
const g = data[i + 1];
|
|
3922
|
-
const b = data[i + 2];
|
|
3923
|
-
const alpha = data[i + 3];
|
|
3924
|
-
if (alpha < 128) continue;
|
|
3925
|
-
const bucketR = Math.round(r / 32) * 32;
|
|
3926
|
-
const bucketG = Math.round(g / 32) * 32;
|
|
3927
|
-
const bucketB = Math.round(b / 32) * 32;
|
|
3928
|
-
const key = `${bucketR},${bucketG},${bucketB}`;
|
|
3929
|
-
colorCounts[key] = (colorCounts[key] || 0) + 1;
|
|
3930
|
-
}
|
|
3931
|
-
let maxCount = 0;
|
|
3932
|
-
let dominantColor = [128, 128, 128];
|
|
3933
|
-
for (const [colorKey, count] of Object.entries(colorCounts)) {
|
|
3934
|
-
if (count > maxCount) {
|
|
3935
|
-
maxCount = count;
|
|
3936
|
-
const [r, g, b] = colorKey.split(",").map(Number);
|
|
3937
|
-
dominantColor = [r, g, b];
|
|
3938
|
-
}
|
|
3939
|
-
}
|
|
3940
|
-
return dominantColor;
|
|
3941
|
-
}
|
|
3942
|
-
function getBestContrastColor(imageColor) {
|
|
3943
|
-
let bestColor = DESIGN_PALETTE[0];
|
|
3944
|
-
let bestContrast = 0;
|
|
3945
|
-
for (const color of DESIGN_PALETTE) {
|
|
3946
|
-
const contrast = getContrastRatio(imageColor, color.rgb);
|
|
3947
|
-
if (contrast > bestContrast) {
|
|
3948
|
-
bestContrast = contrast;
|
|
3949
|
-
bestColor = color;
|
|
3950
|
-
}
|
|
3951
|
-
}
|
|
3952
|
-
return bestContrast >= 3 ? bestColor : DESIGN_PALETTE.find((c) => c.name === "black") || bestColor;
|
|
3953
|
-
}
|
|
3954
|
-
function analyzeImageColor(imageSrc) {
|
|
3955
|
-
return new Promise((resolve, reject) => {
|
|
3956
|
-
const img = new Image();
|
|
3957
|
-
img.crossOrigin = "anonymous";
|
|
3958
|
-
img.onload = () => {
|
|
3959
|
-
try {
|
|
3960
|
-
const canvas = document.createElement("canvas");
|
|
3961
|
-
const ctx = canvas.getContext("2d");
|
|
3962
|
-
if (!ctx) {
|
|
3963
|
-
reject(new Error("Could not get canvas context"));
|
|
3964
|
-
return;
|
|
3965
|
-
}
|
|
3966
|
-
const maxSize = 100;
|
|
3967
|
-
const scale = Math.min(maxSize / img.width, maxSize / img.height);
|
|
3968
|
-
canvas.width = img.width * scale;
|
|
3969
|
-
canvas.height = img.height * scale;
|
|
3970
|
-
ctx.drawImage(img, 0, 0, canvas.width, canvas.height);
|
|
3971
|
-
const dominantColor = extractDominantColor(canvas);
|
|
3972
|
-
const bestContrastColor = getBestContrastColor(dominantColor);
|
|
3973
|
-
resolve(bestContrastColor);
|
|
3974
|
-
} catch (error) {
|
|
3975
|
-
reject(error);
|
|
3976
|
-
}
|
|
3977
|
-
};
|
|
3978
|
-
img.onerror = () => reject(new Error("Failed to load image"));
|
|
3979
|
-
img.src = imageSrc;
|
|
3980
|
-
});
|
|
3981
|
-
}
|
|
3982
|
-
async function extractImageEdgeColorAsync(imageUrl) {
|
|
3983
|
-
return new Promise((resolve) => {
|
|
3984
|
-
if (typeof window === "undefined") {
|
|
3985
|
-
resolve("#000000");
|
|
3986
|
-
return;
|
|
3987
|
-
}
|
|
3988
|
-
const img = new Image();
|
|
3989
|
-
img.crossOrigin = "anonymous";
|
|
3990
|
-
img.onload = () => {
|
|
3991
|
-
try {
|
|
3992
|
-
const canvas = document.createElement("canvas");
|
|
3993
|
-
const ctx = canvas.getContext("2d");
|
|
3994
|
-
if (!ctx) {
|
|
3995
|
-
resolve("#000000");
|
|
3996
|
-
return;
|
|
3997
|
-
}
|
|
3998
|
-
const maxSize = 50;
|
|
3999
|
-
const scale = Math.min(maxSize / img.naturalWidth, maxSize / img.naturalHeight);
|
|
4000
|
-
const w = Math.round(img.naturalWidth * scale);
|
|
4001
|
-
const h = Math.round(img.naturalHeight * scale);
|
|
4002
|
-
canvas.width = w;
|
|
4003
|
-
canvas.height = h;
|
|
4004
|
-
ctx.drawImage(img, 0, 0, w, h);
|
|
4005
|
-
const data = ctx.getImageData(0, 0, w, h).data;
|
|
4006
|
-
const edgeW = Math.max(2, Math.round(w * 0.15));
|
|
4007
|
-
const edgeH = Math.max(2, Math.round(h * 0.15));
|
|
4008
|
-
const bucketSize = 32;
|
|
4009
|
-
const buckets = /* @__PURE__ */ new Map();
|
|
4010
|
-
for (let y = 0; y < h; y++) {
|
|
4011
|
-
for (let x = 0; x < w; x++) {
|
|
4012
|
-
if (!(x < edgeW || x >= w - edgeW || y < edgeH || y >= h - edgeH)) continue;
|
|
4013
|
-
const i = (y * w + x) * 4;
|
|
4014
|
-
if (data[i + 3] < 128) continue;
|
|
4015
|
-
const br = Math.floor(data[i] / bucketSize) * bucketSize;
|
|
4016
|
-
const bg = Math.floor(data[i + 1] / bucketSize) * bucketSize;
|
|
4017
|
-
const bb = Math.floor(data[i + 2] / bucketSize) * bucketSize;
|
|
4018
|
-
const key = `${br},${bg},${bb}`;
|
|
4019
|
-
const existing = buckets.get(key);
|
|
4020
|
-
if (existing) {
|
|
4021
|
-
existing.r += data[i];
|
|
4022
|
-
existing.g += data[i + 1];
|
|
4023
|
-
existing.b += data[i + 2];
|
|
4024
|
-
existing.count++;
|
|
4025
|
-
} else {
|
|
4026
|
-
buckets.set(key, { r: data[i], g: data[i + 1], b: data[i + 2], count: 1 });
|
|
4027
|
-
}
|
|
4028
|
-
}
|
|
4029
|
-
}
|
|
4030
|
-
let best = { r: 0, g: 0, b: 0, count: 0 };
|
|
4031
|
-
for (const b2 of buckets.values()) {
|
|
4032
|
-
if (b2.count > best.count) best = b2;
|
|
4033
|
-
}
|
|
4034
|
-
if (best.count === 0) {
|
|
4035
|
-
resolve("#000000");
|
|
4036
|
-
return;
|
|
4037
|
-
}
|
|
4038
|
-
const r = Math.round(best.r / best.count), g = Math.round(best.g / best.count), b = Math.round(best.b / best.count);
|
|
4039
|
-
resolve(
|
|
4040
|
-
`#${r.toString(16).padStart(2, "0")}${g.toString(16).padStart(2, "0")}${b.toString(16).padStart(2, "0")}`
|
|
4041
|
-
);
|
|
4042
|
-
} catch {
|
|
4043
|
-
resolve("#000000");
|
|
4044
|
-
}
|
|
4045
|
-
};
|
|
4046
|
-
img.onerror = () => resolve("#000000");
|
|
4047
|
-
img.src = imageUrl;
|
|
4048
|
-
});
|
|
4049
|
-
}
|
|
4050
|
-
|
|
4051
|
-
// src/utils/ods-color-tokens-stub.ts
|
|
4052
|
-
var colorTokens = {
|
|
4053
|
-
primary: "#FFC008",
|
|
4054
|
-
secondary: "#161616",
|
|
4055
|
-
background: "#FAFAFA",
|
|
4056
|
-
surface: "#FFFFFF",
|
|
4057
|
-
text: {
|
|
4058
|
-
primary: "#161616",
|
|
4059
|
-
secondary: "#666666",
|
|
4060
|
-
inverse: "#FFFFFF"
|
|
4061
|
-
},
|
|
4062
|
-
border: "#E5E5E5"
|
|
4063
|
-
};
|
|
4064
|
-
|
|
4065
|
-
// src/utils/ods-color-utils.ts
|
|
4066
|
-
var TOKEN_MAP = colorTokens;
|
|
4067
|
-
function lookupToken(tokenKey) {
|
|
4068
|
-
const value = TOKEN_MAP[tokenKey];
|
|
4069
|
-
return typeof value === "string" ? value : void 0;
|
|
4070
|
-
}
|
|
4071
|
-
function getODSToken(category, color, variant = "base") {
|
|
4072
|
-
const tokenKey = `${category}-${color}-${variant}`;
|
|
4073
|
-
return lookupToken(tokenKey);
|
|
4074
|
-
}
|
|
4075
|
-
function getCurrentPlatform() {
|
|
4076
|
-
if (typeof window === "undefined") {
|
|
4077
|
-
return process.env.NEXT_PUBLIC_APP_TYPE || "openmsp";
|
|
4078
|
-
}
|
|
4079
|
-
const domPlatform = document.documentElement.getAttribute("data-app-type");
|
|
4080
|
-
if (domPlatform) {
|
|
4081
|
-
return domPlatform;
|
|
4082
|
-
}
|
|
4083
|
-
return process.env.NEXT_PUBLIC_APP_TYPE || "openmsp";
|
|
4084
|
-
}
|
|
4085
|
-
function switchPlatformTheme(platform) {
|
|
4086
|
-
if (typeof window === "undefined") return;
|
|
4087
|
-
const root = document.documentElement;
|
|
4088
|
-
root.setAttribute("data-app-type", platform);
|
|
4089
|
-
window.dispatchEvent(
|
|
4090
|
-
new CustomEvent("platformThemeChanged", {
|
|
4091
|
-
detail: { platform }
|
|
4092
|
-
})
|
|
4093
|
-
);
|
|
4094
|
-
}
|
|
4095
|
-
function getSemanticColor(semanticName, platform) {
|
|
4096
|
-
if (typeof window === "undefined") return void 0;
|
|
4097
|
-
const currentPlatform = platform || getCurrentPlatform();
|
|
4098
|
-
const originalPlatform = getCurrentPlatform();
|
|
4099
|
-
if (currentPlatform !== originalPlatform) {
|
|
4100
|
-
switchPlatformTheme(currentPlatform);
|
|
4101
|
-
}
|
|
4102
|
-
const testElement = document.createElement("div");
|
|
4103
|
-
document.body.appendChild(testElement);
|
|
4104
|
-
const computedStyle = getComputedStyle(testElement);
|
|
4105
|
-
const colorValue = computedStyle.getPropertyValue(`--color-${semanticName}`);
|
|
4106
|
-
document.body.removeChild(testElement);
|
|
4107
|
-
if (currentPlatform !== originalPlatform) {
|
|
4108
|
-
switchPlatformTheme(originalPlatform);
|
|
4109
|
-
}
|
|
4110
|
-
return colorValue.trim() || void 0;
|
|
4111
|
-
}
|
|
4112
|
-
function getPlatformConfig(platform) {
|
|
4113
|
-
const currentPlatform = platform || getCurrentPlatform();
|
|
4114
|
-
const isDarkTheme = PLATFORM_THEME === "dark";
|
|
4115
|
-
return {
|
|
4116
|
-
platform: currentPlatform,
|
|
4117
|
-
accentColor: getPlatformAccentColor(currentPlatform),
|
|
4118
|
-
isDarkTheme,
|
|
4119
|
-
isLightTheme: !isDarkTheme,
|
|
4120
|
-
brandName: getPlatformDisplayName(currentPlatform)
|
|
4121
|
-
};
|
|
4122
|
-
}
|
|
4123
|
-
function usePlatformColors(platform) {
|
|
4124
|
-
const currentPlatform = platform || getCurrentPlatform();
|
|
4125
|
-
const config = getPlatformConfig(currentPlatform);
|
|
4126
|
-
return {
|
|
4127
|
-
platform: currentPlatform,
|
|
4128
|
-
accentColor: config.accentColor,
|
|
4129
|
-
isDarkTheme: config.isDarkTheme,
|
|
4130
|
-
isLightTheme: config.isLightTheme,
|
|
4131
|
-
brandName: config.brandName,
|
|
4132
|
-
getToken: (category, color, variant) => getODSToken(category, color, variant),
|
|
4133
|
-
switchTheme: (newPlatform) => switchPlatformTheme(newPlatform),
|
|
4134
|
-
getSemanticColor: (semanticName) => getSemanticColor(semanticName, currentPlatform)
|
|
4135
|
-
};
|
|
4136
|
-
}
|
|
4137
|
-
function getReadableTextColor(hex) {
|
|
4138
|
-
return pickReadableTextColor(hex) === "dark" ? "#212121" : "#fafafa";
|
|
4139
|
-
}
|
|
4140
|
-
var HEX_PATTERN = /^#[0-9a-fA-F]{6}$/;
|
|
4141
|
-
function hexToRgb2(hex) {
|
|
4142
|
-
if (!HEX_PATTERN.test(hex)) return null;
|
|
4143
|
-
const n = Number.parseInt(hex.slice(1), 16);
|
|
4144
|
-
return { r: n >> 16 & 255, g: n >> 8 & 255, b: n & 255 };
|
|
4145
|
-
}
|
|
4146
|
-
function rgbToHex(r, g, b) {
|
|
4147
|
-
const to = (n) => clamp(Math.round(n), 0, 255).toString(16).padStart(2, "0");
|
|
4148
|
-
return `#${to(r)}${to(g)}${to(b)}`;
|
|
4149
|
-
}
|
|
4150
|
-
var HOVER_DARKEN_STEP = 10;
|
|
4151
|
-
var ACTIVE_DARKEN_STEP = 20;
|
|
4152
|
-
function darkenByStep(hex, step) {
|
|
4153
|
-
const rgb = hexToRgb2(hex);
|
|
4154
|
-
if (!rgb) return hex;
|
|
4155
|
-
return rgbToHex(rgb.r - step, rgb.g - step, rgb.b - step);
|
|
4156
|
-
}
|
|
4157
|
-
function deriveHoverColor(hex) {
|
|
4158
|
-
return darkenByStep(hex, HOVER_DARKEN_STEP);
|
|
4159
|
-
}
|
|
4160
|
-
function deriveActiveColor(hex) {
|
|
4161
|
-
return darkenByStep(hex, ACTIVE_DARKEN_STEP);
|
|
4162
|
-
}
|
|
4163
|
-
function rgbToHsl(r, g, b) {
|
|
4164
|
-
const rn = r / 255;
|
|
4165
|
-
const gn = g / 255;
|
|
4166
|
-
const bn = b / 255;
|
|
4167
|
-
const max = Math.max(rn, gn, bn);
|
|
4168
|
-
const min = Math.min(rn, gn, bn);
|
|
4169
|
-
const l = (max + min) / 2;
|
|
4170
|
-
if (max === min) return { h: 0, s: 0, l: Math.round(l * 100) };
|
|
4171
|
-
const d = max - min;
|
|
4172
|
-
const s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
|
|
4173
|
-
let h;
|
|
4174
|
-
if (max === rn) h = (gn - bn) / d + (gn < bn ? 6 : 0);
|
|
4175
|
-
else if (max === gn) h = (bn - rn) / d + 2;
|
|
4176
|
-
else h = (rn - gn) / d + 4;
|
|
4177
|
-
h *= 60;
|
|
4178
|
-
return { h: Math.round(h), s: Math.round(s * 100), l: Math.round(l * 100) };
|
|
4179
|
-
}
|
|
4180
|
-
function hslToRgb(h, s, l) {
|
|
4181
|
-
const sn = clamp(s, 0, 100) / 100;
|
|
4182
|
-
const ln = clamp(l, 0, 100) / 100;
|
|
4183
|
-
const hn = (h % 360 + 360) % 360;
|
|
4184
|
-
if (sn === 0) {
|
|
4185
|
-
const v = Math.round(ln * 255);
|
|
4186
|
-
return { r: v, g: v, b: v };
|
|
4187
|
-
}
|
|
4188
|
-
const q = ln < 0.5 ? ln * (1 + sn) : ln + sn - ln * sn;
|
|
4189
|
-
const p = 2 * ln - q;
|
|
4190
|
-
const hue2rgb = (t) => {
|
|
4191
|
-
let tn = t;
|
|
4192
|
-
if (tn < 0) tn += 1;
|
|
4193
|
-
if (tn > 1) tn -= 1;
|
|
4194
|
-
if (tn < 1 / 6) return p + (q - p) * 6 * tn;
|
|
4195
|
-
if (tn < 1 / 2) return q;
|
|
4196
|
-
if (tn < 2 / 3) return p + (q - p) * (2 / 3 - tn) * 6;
|
|
4197
|
-
return p;
|
|
4198
|
-
};
|
|
4199
|
-
const hk = hn / 360;
|
|
4200
|
-
return {
|
|
4201
|
-
r: Math.round(hue2rgb(hk + 1 / 3) * 255),
|
|
4202
|
-
g: Math.round(hue2rgb(hk) * 255),
|
|
4203
|
-
b: Math.round(hue2rgb(hk - 1 / 3) * 255)
|
|
4204
|
-
};
|
|
4205
|
-
}
|
|
4206
|
-
|
|
4207
3881
|
// src/components/ui/actions-menu.tsx
|
|
4208
3882
|
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
|
4209
3883
|
import { useControllableState } from "@radix-ui/react-use-controllable-state";
|
|
@@ -25582,26 +25256,6 @@ export {
|
|
|
25582
25256
|
isToday,
|
|
25583
25257
|
isWithinMinutes,
|
|
25584
25258
|
createUTCTimestamp,
|
|
25585
|
-
DESIGN_PALETTE,
|
|
25586
|
-
getContrastRatio,
|
|
25587
|
-
pickReadableTextColor,
|
|
25588
|
-
extractDominantColor,
|
|
25589
|
-
getBestContrastColor,
|
|
25590
|
-
analyzeImageColor,
|
|
25591
|
-
extractImageEdgeColorAsync,
|
|
25592
|
-
getCurrentPlatform,
|
|
25593
|
-
switchPlatformTheme,
|
|
25594
|
-
getSemanticColor,
|
|
25595
|
-
getPlatformConfig,
|
|
25596
|
-
usePlatformColors,
|
|
25597
|
-
getReadableTextColor,
|
|
25598
|
-
HEX_PATTERN,
|
|
25599
|
-
hexToRgb2 as hexToRgb,
|
|
25600
|
-
rgbToHex,
|
|
25601
|
-
deriveHoverColor,
|
|
25602
|
-
deriveActiveColor,
|
|
25603
|
-
rgbToHsl,
|
|
25604
|
-
hslToRgb,
|
|
25605
25259
|
ActionsMenu,
|
|
25606
25260
|
ActionsMenuDropdown,
|
|
25607
25261
|
ColorSwatch,
|
|
@@ -25947,4 +25601,4 @@ export {
|
|
|
25947
25601
|
buildStreamFrames,
|
|
25948
25602
|
EmbeddableChat
|
|
25949
25603
|
};
|
|
25950
|
-
//# sourceMappingURL=chunk-
|
|
25604
|
+
//# sourceMappingURL=chunk-L5FEAOGJ.js.map
|