@flamingo-stack/openframe-frontend-core 0.0.627 → 0.0.628-snapshot.20260914045040
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-RAPPN6MN.cjs → chunk-2MMEPNSX.cjs} +3 -3
- package/dist/{chunk-RAPPN6MN.cjs.map → chunk-2MMEPNSX.cjs.map} +1 -1
- package/dist/{chunk-HIZAMJPT.js → chunk-2MXKO5BN.js} +12 -12
- package/dist/{chunk-QCSWM3VU.cjs → chunk-2ZSGDKZI.cjs} +9 -9
- package/dist/{chunk-QCSWM3VU.cjs.map → chunk-2ZSGDKZI.cjs.map} +1 -1
- package/dist/{chunk-P7UT2YSC.cjs → chunk-3IXDZI3R.cjs} +3 -3
- package/dist/{chunk-P7UT2YSC.cjs.map → chunk-3IXDZI3R.cjs.map} +1 -1
- package/dist/{chunk-VUAEDAUN.cjs → chunk-3ZY4CE7N.cjs} +6 -6
- package/dist/{chunk-VUAEDAUN.cjs.map → chunk-3ZY4CE7N.cjs.map} +1 -1
- package/dist/{chunk-PKSH6PAK.js → chunk-4NMVDTHA.js} +8 -10
- package/dist/{chunk-PKSH6PAK.js.map → chunk-4NMVDTHA.js.map} +1 -1
- package/dist/{chunk-CAQ5MNLJ.js → chunk-4VPCIREO.js} +3 -3
- package/dist/{chunk-4E3UZZ2J.cjs → chunk-5JAB5LVO.cjs} +34 -34
- package/dist/{chunk-4E3UZZ2J.cjs.map → chunk-5JAB5LVO.cjs.map} +1 -1
- package/dist/{chunk-JRYS4VMV.js → chunk-5LIDR7HL.js} +79 -4
- package/dist/{chunk-JRYS4VMV.js.map → chunk-5LIDR7HL.js.map} +1 -1
- package/dist/{chunk-G46NJNTL.cjs → chunk-5OMBSMRI.cjs} +26 -28
- package/dist/chunk-5OMBSMRI.cjs.map +1 -0
- package/dist/{chunk-SLT5C3PQ.cjs → chunk-7P6M5G3W.cjs} +25 -25
- package/dist/{chunk-SLT5C3PQ.cjs.map → chunk-7P6M5G3W.cjs.map} +1 -1
- package/dist/{chunk-ZOMGXH7C.js → chunk-BVQEU5JB.js} +2 -2
- package/dist/{chunk-VOZZQ6HQ.cjs → chunk-CCWI3622.cjs} +4 -4
- package/dist/{chunk-VOZZQ6HQ.cjs.map → chunk-CCWI3622.cjs.map} +1 -1
- package/dist/{chunk-BJGAFPG5.cjs → chunk-CKMJQ46H.cjs} +42 -42
- package/dist/{chunk-BJGAFPG5.cjs.map → chunk-CKMJQ46H.cjs.map} +1 -1
- package/dist/{chunk-OAXASIVG.cjs → chunk-CV2SESZT.cjs} +7 -7
- package/dist/{chunk-OAXASIVG.cjs.map → chunk-CV2SESZT.cjs.map} +1 -1
- package/dist/{chunk-Y3MIFC5M.js → chunk-D5CKXMMC.js} +4 -4
- package/dist/{chunk-ZGZ7YAJH.js → chunk-DGY4NVIB.js} +8 -10
- package/dist/{chunk-ZGZ7YAJH.js.map → chunk-DGY4NVIB.js.map} +1 -1
- package/dist/{chunk-4SXZT7JP.cjs → chunk-DLHGJYYA.cjs} +83 -83
- package/dist/{chunk-4SXZT7JP.cjs.map → chunk-DLHGJYYA.cjs.map} +1 -1
- package/dist/{chunk-4E7XCEV3.cjs → chunk-EHAYNUOL.cjs} +2 -77
- package/dist/chunk-EHAYNUOL.cjs.map +1 -0
- package/dist/{chunk-X5NN4NJM.js → chunk-F2KBCLUG.js} +2 -2
- package/dist/{chunk-USIRWQJ3.js → chunk-FKBM6U43.js} +1 -76
- package/dist/{chunk-USIRWQJ3.js.map → chunk-FKBM6U43.js.map} +1 -1
- package/dist/{chunk-CK2CPZXB.js → chunk-GR3WOOM7.js} +12 -12
- package/dist/{chunk-GQ7267OV.cjs → chunk-HVWNOPDV.cjs} +5 -5
- package/dist/{chunk-GQ7267OV.cjs.map → chunk-HVWNOPDV.cjs.map} +1 -1
- package/dist/{chunk-QIVX7F3N.cjs → chunk-JJUV7Z4L.cjs} +27 -27
- package/dist/{chunk-QIVX7F3N.cjs.map → chunk-JJUV7Z4L.cjs.map} +1 -1
- package/dist/{chunk-53ARMJHM.cjs → chunk-JONR3BDJ.cjs} +37 -37
- package/dist/{chunk-53ARMJHM.cjs.map → chunk-JONR3BDJ.cjs.map} +1 -1
- package/dist/{chunk-ZCQVUIPH.cjs → chunk-K7EJ7HYJ.cjs} +18 -18
- package/dist/{chunk-ZCQVUIPH.cjs.map → chunk-K7EJ7HYJ.cjs.map} +1 -1
- package/dist/{chunk-VZQ3VVFH.cjs → chunk-KO52PXL4.cjs} +20 -22
- package/dist/chunk-KO52PXL4.cjs.map +1 -0
- package/dist/{chunk-BC726XIQ.cjs → chunk-LHYRLL64.cjs} +47 -49
- package/dist/chunk-LHYRLL64.cjs.map +1 -0
- package/dist/{chunk-4PIHIFJM.js → chunk-LQLL4S4V.js} +4 -4
- package/dist/{chunk-KXDYBRRR.js → chunk-MOB5AA3X.js} +7 -7
- package/dist/{chunk-DH3YH3TV.js → chunk-MTLDYBXK.js} +8 -8
- package/dist/{chunk-L5FEAOGJ.js → chunk-ON7663OW.js} +354 -8
- package/dist/chunk-ON7663OW.js.map +1 -0
- package/dist/{chunk-55X46LKR.cjs → chunk-OQHFHKUG.cjs} +100 -450
- package/dist/chunk-OQHFHKUG.cjs.map +1 -0
- package/dist/{chunk-WZ6CUZMM.js → chunk-OXTV63QO.js} +4 -4
- package/dist/{chunk-NLADJ4IX.js → chunk-PFBMVQ5R.js} +6 -6
- package/dist/{chunk-5E55S5SI.js → chunk-PJZYJDR7.js} +4 -4
- package/dist/{chunk-PTP5LSYM.js → chunk-QGWBMPQY.js} +61 -22
- package/dist/chunk-QGWBMPQY.js.map +1 -0
- package/dist/{chunk-2J7EFH4V.js → chunk-QS2QCXBH.js} +30 -380
- package/dist/chunk-QS2QCXBH.js.map +1 -0
- package/dist/{chunk-76HB456V.js → chunk-S6WBBSII.js} +5 -5
- package/dist/{chunk-G47XRVZA.js → chunk-SCPJ53CM.js} +3 -3
- package/dist/{chunk-25UWKNII.js → chunk-T46STYS2.js} +8 -10
- package/dist/{chunk-25UWKNII.js.map → chunk-T46STYS2.js.map} +1 -1
- package/dist/{chunk-6I3KNDBF.cjs → chunk-U7TTQV4N.cjs} +3 -3
- package/dist/{chunk-6I3KNDBF.cjs.map → chunk-U7TTQV4N.cjs.map} +1 -1
- package/dist/{chunk-ZYDNPUSH.cjs → chunk-UNI3POHU.cjs} +625 -279
- package/dist/chunk-UNI3POHU.cjs.map +1 -0
- package/dist/{chunk-N6XNJX25.cjs → chunk-W523NIJ6.cjs} +15 -15
- package/dist/{chunk-N6XNJX25.cjs.map → chunk-W523NIJ6.cjs.map} +1 -1
- package/dist/{chunk-J6ATJUEE.js → chunk-WBZ4HP7D.js} +4 -4
- package/dist/{chunk-R3SJ6PMI.cjs → chunk-WR67VM2J.cjs} +463 -424
- package/dist/chunk-WR67VM2J.cjs.map +1 -0
- package/dist/{chunk-32P6KUZP.js → chunk-X3LC6R37.js} +2 -2
- package/dist/{chunk-FR6EDA3P.cjs → chunk-XNC37UQP.cjs} +105 -105
- package/dist/{chunk-FR6EDA3P.cjs.map → chunk-XNC37UQP.cjs.map} +1 -1
- package/dist/{chunk-CMUNJZWN.js → chunk-YQCA4ZEJ.js} +2 -2
- package/dist/{chunk-ZI27ALYX.cjs → chunk-YXWGSDK4.cjs} +80 -5
- package/dist/chunk-YXWGSDK4.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/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/changelog-manager.d.ts +17 -1
- package/dist/components/features/changelog-manager.d.ts.map +1 -1
- 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 +69 -71
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.js +24 -26
- 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/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 +5 -4
- package/dist/components/ui/color-preset-select.d.ts.map +1 -1
- package/dist/components/ui/department-badge.d.ts +3 -3
- package/dist/components/ui/index.cjs +8 -10
- package/dist/components/ui/index.cjs.map +1 -1
- package/dist/components/ui/index.js +7 -9
- package/dist/components/ui/palette-badge.d.ts +6 -8
- package/dist/components/ui/palette-badge.d.ts.map +1 -1
- package/dist/components/ui/status-badge.d.ts +1 -1
- package/dist/components/ui/status-badge.d.ts.map +1 -1
- package/dist/hooks/index.cjs +5 -5
- package/dist/hooks/index.js +4 -4
- package/dist/index.cjs +18 -18
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +46 -46
- package/dist/types/department.d.ts +1 -1
- package/dist/types/department.d.ts.map +1 -1
- package/dist/types/index.cjs.map +1 -1
- package/dist/types/index.js.map +1 -1
- package/dist/types/product-release.d.ts +5 -0
- package/dist/types/product-release.d.ts.map +1 -1
- package/dist/utils/badge-palette.d.ts +18 -0
- package/dist/utils/badge-palette.d.ts.map +1 -0
- package/dist/utils/index.cjs +21 -24
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +19 -22
- package/dist/utils/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/features/__tests__/changelog-manager-tags.test.tsx +57 -0
- package/src/components/features/changelog-manager.tsx +69 -5
- package/src/components/ui/.department-badge.md +2 -2
- package/src/components/ui/.palette-badge.md +2 -2
- package/src/components/ui/.status-badge.md +2 -2
- package/src/components/ui/__tests__/department-badge.test.tsx +23 -21
- package/src/components/ui/color-preset-select.tsx +21 -5
- package/src/components/ui/department-badge.tsx +3 -3
- package/src/components/ui/palette-badge.tsx +8 -13
- package/src/components/ui/status-badge.tsx +5 -0
- package/src/types/department.ts +1 -1
- package/src/types/product-release.ts +5 -0
- package/src/utils/.badge-palette.md +2 -0
- package/src/utils/badge-palette.ts +38 -0
- package/src/utils/index.ts +2 -1
- package/dist/chunk-2J7EFH4V.js.map +0 -1
- package/dist/chunk-4E7XCEV3.cjs.map +0 -1
- package/dist/chunk-55X46LKR.cjs.map +0 -1
- package/dist/chunk-BC726XIQ.cjs.map +0 -1
- package/dist/chunk-G46NJNTL.cjs.map +0 -1
- package/dist/chunk-L5FEAOGJ.js.map +0 -1
- package/dist/chunk-PTP5LSYM.js.map +0 -1
- package/dist/chunk-R3SJ6PMI.cjs.map +0 -1
- package/dist/chunk-VZQ3VVFH.cjs.map +0 -1
- package/dist/chunk-ZI27ALYX.cjs.map +0 -1
- package/dist/chunk-ZYDNPUSH.cjs.map +0 -1
- package/dist/utils/color-presets.d.ts +0 -24
- package/dist/utils/color-presets.d.ts.map +0 -1
- package/src/utils/.color-presets.md +0 -2
- package/src/utils/color-presets.ts +0 -48
- /package/dist/{chunk-HIZAMJPT.js.map → chunk-2MXKO5BN.js.map} +0 -0
- /package/dist/{chunk-CAQ5MNLJ.js.map → chunk-4VPCIREO.js.map} +0 -0
- /package/dist/{chunk-ZOMGXH7C.js.map → chunk-BVQEU5JB.js.map} +0 -0
- /package/dist/{chunk-Y3MIFC5M.js.map → chunk-D5CKXMMC.js.map} +0 -0
- /package/dist/{chunk-X5NN4NJM.js.map → chunk-F2KBCLUG.js.map} +0 -0
- /package/dist/{chunk-CK2CPZXB.js.map → chunk-GR3WOOM7.js.map} +0 -0
- /package/dist/{chunk-4PIHIFJM.js.map → chunk-LQLL4S4V.js.map} +0 -0
- /package/dist/{chunk-KXDYBRRR.js.map → chunk-MOB5AA3X.js.map} +0 -0
- /package/dist/{chunk-DH3YH3TV.js.map → chunk-MTLDYBXK.js.map} +0 -0
- /package/dist/{chunk-WZ6CUZMM.js.map → chunk-OXTV63QO.js.map} +0 -0
- /package/dist/{chunk-NLADJ4IX.js.map → chunk-PFBMVQ5R.js.map} +0 -0
- /package/dist/{chunk-5E55S5SI.js.map → chunk-PJZYJDR7.js.map} +0 -0
- /package/dist/{chunk-76HB456V.js.map → chunk-S6WBBSII.js.map} +0 -0
- /package/dist/{chunk-G47XRVZA.js.map → chunk-SCPJ53CM.js.map} +0 -0
- /package/dist/{chunk-J6ATJUEE.js.map → chunk-WBZ4HP7D.js.map} +0 -0
- /package/dist/{chunk-32P6KUZP.js.map → chunk-X3LC6R37.js.map} +0 -0
- /package/dist/{chunk-CMUNJZWN.js.map → chunk-YQCA4ZEJ.js.map} +0 -0
|
@@ -3,15 +3,11 @@ import {
|
|
|
3
3
|
next_image_default
|
|
4
4
|
} from "./chunk-MDKCTSDS.js";
|
|
5
5
|
import {
|
|
6
|
-
PLATFORM_THEME,
|
|
7
|
-
clamp,
|
|
8
|
-
getPlatformAccentColor,
|
|
9
6
|
getPlatformBrandClasses,
|
|
10
|
-
getPlatformDisplayName,
|
|
11
7
|
useAuthedImageSrc,
|
|
12
8
|
useImageEdgeColor,
|
|
13
9
|
useOgPlaceholderUrl
|
|
14
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-FKBM6U43.js";
|
|
15
11
|
import {
|
|
16
12
|
FigmaIcon,
|
|
17
13
|
ImageIcon,
|
|
@@ -511,332 +507,6 @@ var SquareAvatar = memo(
|
|
|
511
507
|
);
|
|
512
508
|
SquareAvatar.displayName = "SquareAvatar";
|
|
513
509
|
|
|
514
|
-
// src/utils/color-analysis.ts
|
|
515
|
-
var DESIGN_PALETTE = [
|
|
516
|
-
{ name: "yellow", hex: "#FFC008", rgb: [255, 192, 8] },
|
|
517
|
-
{ name: "black", hex: "#161616", rgb: [22, 22, 22] },
|
|
518
|
-
{ name: "gray", hex: "#888888", rgb: [136, 136, 136] }
|
|
519
|
-
];
|
|
520
|
-
function hexToRgb(hex) {
|
|
521
|
-
const normalized = hex.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i, (_, r, g, b) => `${r}${r}${g}${g}${b}${b}`);
|
|
522
|
-
const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(normalized);
|
|
523
|
-
return result ? [parseInt(result[1], 16), parseInt(result[2], 16), parseInt(result[3], 16)] : [0, 0, 0];
|
|
524
|
-
}
|
|
525
|
-
function getLuminance(rgb) {
|
|
526
|
-
const [r, g, b] = rgb.map((channel) => {
|
|
527
|
-
const c = channel / 255;
|
|
528
|
-
return c <= 0.03928 ? c / 12.92 : Math.pow((c + 0.055) / 1.055, 2.4);
|
|
529
|
-
});
|
|
530
|
-
return 0.2126 * r + 0.7152 * g + 0.0722 * b;
|
|
531
|
-
}
|
|
532
|
-
function getContrastRatio(color1, color2) {
|
|
533
|
-
const lum1 = getLuminance(color1);
|
|
534
|
-
const lum2 = getLuminance(color2);
|
|
535
|
-
const brightest = Math.max(lum1, lum2);
|
|
536
|
-
const darkest = Math.min(lum1, lum2);
|
|
537
|
-
return (brightest + 0.05) / (darkest + 0.05);
|
|
538
|
-
}
|
|
539
|
-
function pickReadableTextColor(bgHex) {
|
|
540
|
-
const bg = hexToRgb(bgHex);
|
|
541
|
-
const darkContrast = getContrastRatio(bg, [26, 26, 26]);
|
|
542
|
-
const lightContrast = getContrastRatio(bg, [250, 250, 250]);
|
|
543
|
-
return darkContrast >= lightContrast ? "dark" : "light";
|
|
544
|
-
}
|
|
545
|
-
function extractDominantColor(canvas) {
|
|
546
|
-
const ctx = canvas.getContext("2d");
|
|
547
|
-
if (!ctx) return [128, 128, 128];
|
|
548
|
-
const imageData = ctx.getImageData(0, 0, canvas.width, canvas.height);
|
|
549
|
-
const data = imageData.data;
|
|
550
|
-
const sampleSize = Math.max(1, Math.floor(data.length / (4 * 1e3)));
|
|
551
|
-
const colorCounts = {};
|
|
552
|
-
for (let i = 0; i < data.length; i += 4 * sampleSize) {
|
|
553
|
-
const r = data[i];
|
|
554
|
-
const g = data[i + 1];
|
|
555
|
-
const b = data[i + 2];
|
|
556
|
-
const alpha = data[i + 3];
|
|
557
|
-
if (alpha < 128) continue;
|
|
558
|
-
const bucketR = Math.round(r / 32) * 32;
|
|
559
|
-
const bucketG = Math.round(g / 32) * 32;
|
|
560
|
-
const bucketB = Math.round(b / 32) * 32;
|
|
561
|
-
const key = `${bucketR},${bucketG},${bucketB}`;
|
|
562
|
-
colorCounts[key] = (colorCounts[key] || 0) + 1;
|
|
563
|
-
}
|
|
564
|
-
let maxCount = 0;
|
|
565
|
-
let dominantColor = [128, 128, 128];
|
|
566
|
-
for (const [colorKey, count] of Object.entries(colorCounts)) {
|
|
567
|
-
if (count > maxCount) {
|
|
568
|
-
maxCount = count;
|
|
569
|
-
const [r, g, b] = colorKey.split(",").map(Number);
|
|
570
|
-
dominantColor = [r, g, b];
|
|
571
|
-
}
|
|
572
|
-
}
|
|
573
|
-
return dominantColor;
|
|
574
|
-
}
|
|
575
|
-
function getBestContrastColor(imageColor) {
|
|
576
|
-
let bestColor = DESIGN_PALETTE[0];
|
|
577
|
-
let bestContrast = 0;
|
|
578
|
-
for (const color of DESIGN_PALETTE) {
|
|
579
|
-
const contrast = getContrastRatio(imageColor, color.rgb);
|
|
580
|
-
if (contrast > bestContrast) {
|
|
581
|
-
bestContrast = contrast;
|
|
582
|
-
bestColor = color;
|
|
583
|
-
}
|
|
584
|
-
}
|
|
585
|
-
return bestContrast >= 3 ? bestColor : DESIGN_PALETTE.find((c) => c.name === "black") || bestColor;
|
|
586
|
-
}
|
|
587
|
-
function analyzeImageColor(imageSrc) {
|
|
588
|
-
return new Promise((resolve, reject) => {
|
|
589
|
-
const img = new Image();
|
|
590
|
-
img.crossOrigin = "anonymous";
|
|
591
|
-
img.onload = () => {
|
|
592
|
-
try {
|
|
593
|
-
const canvas = document.createElement("canvas");
|
|
594
|
-
const ctx = canvas.getContext("2d");
|
|
595
|
-
if (!ctx) {
|
|
596
|
-
reject(new Error("Could not get canvas context"));
|
|
597
|
-
return;
|
|
598
|
-
}
|
|
599
|
-
const maxSize = 100;
|
|
600
|
-
const scale = Math.min(maxSize / img.width, maxSize / img.height);
|
|
601
|
-
canvas.width = img.width * scale;
|
|
602
|
-
canvas.height = img.height * scale;
|
|
603
|
-
ctx.drawImage(img, 0, 0, canvas.width, canvas.height);
|
|
604
|
-
const dominantColor = extractDominantColor(canvas);
|
|
605
|
-
const bestContrastColor = getBestContrastColor(dominantColor);
|
|
606
|
-
resolve(bestContrastColor);
|
|
607
|
-
} catch (error) {
|
|
608
|
-
reject(error);
|
|
609
|
-
}
|
|
610
|
-
};
|
|
611
|
-
img.onerror = () => reject(new Error("Failed to load image"));
|
|
612
|
-
img.src = imageSrc;
|
|
613
|
-
});
|
|
614
|
-
}
|
|
615
|
-
async function extractImageEdgeColorAsync(imageUrl) {
|
|
616
|
-
return new Promise((resolve) => {
|
|
617
|
-
if (typeof window === "undefined") {
|
|
618
|
-
resolve("#000000");
|
|
619
|
-
return;
|
|
620
|
-
}
|
|
621
|
-
const img = new Image();
|
|
622
|
-
img.crossOrigin = "anonymous";
|
|
623
|
-
img.onload = () => {
|
|
624
|
-
try {
|
|
625
|
-
const canvas = document.createElement("canvas");
|
|
626
|
-
const ctx = canvas.getContext("2d");
|
|
627
|
-
if (!ctx) {
|
|
628
|
-
resolve("#000000");
|
|
629
|
-
return;
|
|
630
|
-
}
|
|
631
|
-
const maxSize = 50;
|
|
632
|
-
const scale = Math.min(maxSize / img.naturalWidth, maxSize / img.naturalHeight);
|
|
633
|
-
const w = Math.round(img.naturalWidth * scale);
|
|
634
|
-
const h = Math.round(img.naturalHeight * scale);
|
|
635
|
-
canvas.width = w;
|
|
636
|
-
canvas.height = h;
|
|
637
|
-
ctx.drawImage(img, 0, 0, w, h);
|
|
638
|
-
const data = ctx.getImageData(0, 0, w, h).data;
|
|
639
|
-
const edgeW = Math.max(2, Math.round(w * 0.15));
|
|
640
|
-
const edgeH = Math.max(2, Math.round(h * 0.15));
|
|
641
|
-
const bucketSize = 32;
|
|
642
|
-
const buckets = /* @__PURE__ */ new Map();
|
|
643
|
-
for (let y = 0; y < h; y++) {
|
|
644
|
-
for (let x = 0; x < w; x++) {
|
|
645
|
-
if (!(x < edgeW || x >= w - edgeW || y < edgeH || y >= h - edgeH)) continue;
|
|
646
|
-
const i = (y * w + x) * 4;
|
|
647
|
-
if (data[i + 3] < 128) continue;
|
|
648
|
-
const br = Math.floor(data[i] / bucketSize) * bucketSize;
|
|
649
|
-
const bg = Math.floor(data[i + 1] / bucketSize) * bucketSize;
|
|
650
|
-
const bb = Math.floor(data[i + 2] / bucketSize) * bucketSize;
|
|
651
|
-
const key = `${br},${bg},${bb}`;
|
|
652
|
-
const existing = buckets.get(key);
|
|
653
|
-
if (existing) {
|
|
654
|
-
existing.r += data[i];
|
|
655
|
-
existing.g += data[i + 1];
|
|
656
|
-
existing.b += data[i + 2];
|
|
657
|
-
existing.count++;
|
|
658
|
-
} else {
|
|
659
|
-
buckets.set(key, { r: data[i], g: data[i + 1], b: data[i + 2], count: 1 });
|
|
660
|
-
}
|
|
661
|
-
}
|
|
662
|
-
}
|
|
663
|
-
let best = { r: 0, g: 0, b: 0, count: 0 };
|
|
664
|
-
for (const b2 of buckets.values()) {
|
|
665
|
-
if (b2.count > best.count) best = b2;
|
|
666
|
-
}
|
|
667
|
-
if (best.count === 0) {
|
|
668
|
-
resolve("#000000");
|
|
669
|
-
return;
|
|
670
|
-
}
|
|
671
|
-
const r = Math.round(best.r / best.count), g = Math.round(best.g / best.count), b = Math.round(best.b / best.count);
|
|
672
|
-
resolve(
|
|
673
|
-
`#${r.toString(16).padStart(2, "0")}${g.toString(16).padStart(2, "0")}${b.toString(16).padStart(2, "0")}`
|
|
674
|
-
);
|
|
675
|
-
} catch {
|
|
676
|
-
resolve("#000000");
|
|
677
|
-
}
|
|
678
|
-
};
|
|
679
|
-
img.onerror = () => resolve("#000000");
|
|
680
|
-
img.src = imageUrl;
|
|
681
|
-
});
|
|
682
|
-
}
|
|
683
|
-
|
|
684
|
-
// src/utils/ods-color-tokens-stub.ts
|
|
685
|
-
var colorTokens = {
|
|
686
|
-
primary: "#FFC008",
|
|
687
|
-
secondary: "#161616",
|
|
688
|
-
background: "#FAFAFA",
|
|
689
|
-
surface: "#FFFFFF",
|
|
690
|
-
text: {
|
|
691
|
-
primary: "#161616",
|
|
692
|
-
secondary: "#666666",
|
|
693
|
-
inverse: "#FFFFFF"
|
|
694
|
-
},
|
|
695
|
-
border: "#E5E5E5"
|
|
696
|
-
};
|
|
697
|
-
|
|
698
|
-
// src/utils/ods-color-utils.ts
|
|
699
|
-
var TOKEN_MAP = colorTokens;
|
|
700
|
-
function lookupToken(tokenKey) {
|
|
701
|
-
const value = TOKEN_MAP[tokenKey];
|
|
702
|
-
return typeof value === "string" ? value : void 0;
|
|
703
|
-
}
|
|
704
|
-
function getODSToken(category, color, variant = "base") {
|
|
705
|
-
const tokenKey = `${category}-${color}-${variant}`;
|
|
706
|
-
return lookupToken(tokenKey);
|
|
707
|
-
}
|
|
708
|
-
function getCurrentPlatform() {
|
|
709
|
-
if (typeof window === "undefined") {
|
|
710
|
-
return process.env.NEXT_PUBLIC_APP_TYPE || "openmsp";
|
|
711
|
-
}
|
|
712
|
-
const domPlatform = document.documentElement.getAttribute("data-app-type");
|
|
713
|
-
if (domPlatform) {
|
|
714
|
-
return domPlatform;
|
|
715
|
-
}
|
|
716
|
-
return process.env.NEXT_PUBLIC_APP_TYPE || "openmsp";
|
|
717
|
-
}
|
|
718
|
-
function switchPlatformTheme(platform) {
|
|
719
|
-
if (typeof window === "undefined") return;
|
|
720
|
-
const root = document.documentElement;
|
|
721
|
-
root.setAttribute("data-app-type", platform);
|
|
722
|
-
window.dispatchEvent(
|
|
723
|
-
new CustomEvent("platformThemeChanged", {
|
|
724
|
-
detail: { platform }
|
|
725
|
-
})
|
|
726
|
-
);
|
|
727
|
-
}
|
|
728
|
-
function getSemanticColor(semanticName, platform) {
|
|
729
|
-
if (typeof window === "undefined") return void 0;
|
|
730
|
-
const currentPlatform = platform || getCurrentPlatform();
|
|
731
|
-
const originalPlatform = getCurrentPlatform();
|
|
732
|
-
if (currentPlatform !== originalPlatform) {
|
|
733
|
-
switchPlatformTheme(currentPlatform);
|
|
734
|
-
}
|
|
735
|
-
const testElement = document.createElement("div");
|
|
736
|
-
document.body.appendChild(testElement);
|
|
737
|
-
const computedStyle = getComputedStyle(testElement);
|
|
738
|
-
const colorValue = computedStyle.getPropertyValue(`--color-${semanticName}`);
|
|
739
|
-
document.body.removeChild(testElement);
|
|
740
|
-
if (currentPlatform !== originalPlatform) {
|
|
741
|
-
switchPlatformTheme(originalPlatform);
|
|
742
|
-
}
|
|
743
|
-
return colorValue.trim() || void 0;
|
|
744
|
-
}
|
|
745
|
-
function getPlatformConfig(platform) {
|
|
746
|
-
const currentPlatform = platform || getCurrentPlatform();
|
|
747
|
-
const isDarkTheme = PLATFORM_THEME === "dark";
|
|
748
|
-
return {
|
|
749
|
-
platform: currentPlatform,
|
|
750
|
-
accentColor: getPlatformAccentColor(currentPlatform),
|
|
751
|
-
isDarkTheme,
|
|
752
|
-
isLightTheme: !isDarkTheme,
|
|
753
|
-
brandName: getPlatformDisplayName(currentPlatform)
|
|
754
|
-
};
|
|
755
|
-
}
|
|
756
|
-
function usePlatformColors(platform) {
|
|
757
|
-
const currentPlatform = platform || getCurrentPlatform();
|
|
758
|
-
const config = getPlatformConfig(currentPlatform);
|
|
759
|
-
return {
|
|
760
|
-
platform: currentPlatform,
|
|
761
|
-
accentColor: config.accentColor,
|
|
762
|
-
isDarkTheme: config.isDarkTheme,
|
|
763
|
-
isLightTheme: config.isLightTheme,
|
|
764
|
-
brandName: config.brandName,
|
|
765
|
-
getToken: (category, color, variant) => getODSToken(category, color, variant),
|
|
766
|
-
switchTheme: (newPlatform) => switchPlatformTheme(newPlatform),
|
|
767
|
-
getSemanticColor: (semanticName) => getSemanticColor(semanticName, currentPlatform)
|
|
768
|
-
};
|
|
769
|
-
}
|
|
770
|
-
function getReadableTextColor(hex) {
|
|
771
|
-
return pickReadableTextColor(hex) === "dark" ? "#212121" : "#fafafa";
|
|
772
|
-
}
|
|
773
|
-
var HEX_PATTERN = /^#[0-9a-fA-F]{6}$/;
|
|
774
|
-
function hexToRgb2(hex) {
|
|
775
|
-
if (!HEX_PATTERN.test(hex)) return null;
|
|
776
|
-
const n = Number.parseInt(hex.slice(1), 16);
|
|
777
|
-
return { r: n >> 16 & 255, g: n >> 8 & 255, b: n & 255 };
|
|
778
|
-
}
|
|
779
|
-
function rgbToHex(r, g, b) {
|
|
780
|
-
const to = (n) => clamp(Math.round(n), 0, 255).toString(16).padStart(2, "0");
|
|
781
|
-
return `#${to(r)}${to(g)}${to(b)}`;
|
|
782
|
-
}
|
|
783
|
-
var HOVER_DARKEN_STEP = 10;
|
|
784
|
-
var ACTIVE_DARKEN_STEP = 20;
|
|
785
|
-
function darkenByStep(hex, step) {
|
|
786
|
-
const rgb = hexToRgb2(hex);
|
|
787
|
-
if (!rgb) return hex;
|
|
788
|
-
return rgbToHex(rgb.r - step, rgb.g - step, rgb.b - step);
|
|
789
|
-
}
|
|
790
|
-
function deriveHoverColor(hex) {
|
|
791
|
-
return darkenByStep(hex, HOVER_DARKEN_STEP);
|
|
792
|
-
}
|
|
793
|
-
function deriveActiveColor(hex) {
|
|
794
|
-
return darkenByStep(hex, ACTIVE_DARKEN_STEP);
|
|
795
|
-
}
|
|
796
|
-
function rgbToHsl(r, g, b) {
|
|
797
|
-
const rn = r / 255;
|
|
798
|
-
const gn = g / 255;
|
|
799
|
-
const bn = b / 255;
|
|
800
|
-
const max = Math.max(rn, gn, bn);
|
|
801
|
-
const min = Math.min(rn, gn, bn);
|
|
802
|
-
const l = (max + min) / 2;
|
|
803
|
-
if (max === min) return { h: 0, s: 0, l: Math.round(l * 100) };
|
|
804
|
-
const d = max - min;
|
|
805
|
-
const s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
|
|
806
|
-
let h;
|
|
807
|
-
if (max === rn) h = (gn - bn) / d + (gn < bn ? 6 : 0);
|
|
808
|
-
else if (max === gn) h = (bn - rn) / d + 2;
|
|
809
|
-
else h = (rn - gn) / d + 4;
|
|
810
|
-
h *= 60;
|
|
811
|
-
return { h: Math.round(h), s: Math.round(s * 100), l: Math.round(l * 100) };
|
|
812
|
-
}
|
|
813
|
-
function hslToRgb(h, s, l) {
|
|
814
|
-
const sn = clamp(s, 0, 100) / 100;
|
|
815
|
-
const ln = clamp(l, 0, 100) / 100;
|
|
816
|
-
const hn = (h % 360 + 360) % 360;
|
|
817
|
-
if (sn === 0) {
|
|
818
|
-
const v = Math.round(ln * 255);
|
|
819
|
-
return { r: v, g: v, b: v };
|
|
820
|
-
}
|
|
821
|
-
const q = ln < 0.5 ? ln * (1 + sn) : ln + sn - ln * sn;
|
|
822
|
-
const p = 2 * ln - q;
|
|
823
|
-
const hue2rgb = (t) => {
|
|
824
|
-
let tn = t;
|
|
825
|
-
if (tn < 0) tn += 1;
|
|
826
|
-
if (tn > 1) tn -= 1;
|
|
827
|
-
if (tn < 1 / 6) return p + (q - p) * 6 * tn;
|
|
828
|
-
if (tn < 1 / 2) return q;
|
|
829
|
-
if (tn < 2 / 3) return p + (q - p) * (2 / 3 - tn) * 6;
|
|
830
|
-
return p;
|
|
831
|
-
};
|
|
832
|
-
const hk = hn / 360;
|
|
833
|
-
return {
|
|
834
|
-
r: Math.round(hue2rgb(hk + 1 / 3) * 255),
|
|
835
|
-
g: Math.round(hue2rgb(hk) * 255),
|
|
836
|
-
b: Math.round(hue2rgb(hk - 1 / 3) * 255)
|
|
837
|
-
};
|
|
838
|
-
}
|
|
839
|
-
|
|
840
510
|
// src/components/ui/interactive-card.tsx
|
|
841
511
|
import React from "react";
|
|
842
512
|
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
@@ -1087,6 +757,11 @@ var statusBadgeVariants = cva("inline-flex items-center justify-center rounded",
|
|
|
1087
757
|
yellow: "border border-ods-border bg-ods-accent text-ods-text-on-accent",
|
|
1088
758
|
green: "bg-ods-success text-ods-text-on-accent",
|
|
1089
759
|
purple: "bg-ods-flamingo-pink text-ods-text-on-accent",
|
|
760
|
+
// Solid and soft ODS palette fills (`BADGE_PALETTE`): tokens only, no hex.
|
|
761
|
+
cyanSoft: "bg-ods-flamingo-cyan-secondary text-ods-flamingo-cyan",
|
|
762
|
+
pinkSoft: "bg-ods-flamingo-pink-secondary text-ods-flamingo-pink",
|
|
763
|
+
openYellow: "bg-ods-open-yellow text-ods-text-on-accent",
|
|
764
|
+
red: "bg-ods-error text-ods-text-on-accent",
|
|
1090
765
|
success: "bg-ods-success-secondary text-ods-success",
|
|
1091
766
|
error: "bg-ods-error-secondary text-ods-error",
|
|
1092
767
|
warning: "bg-ods-warning-secondary text-ods-warning",
|
|
@@ -1137,48 +812,43 @@ function StatusBadge({ text, variant, colorScheme, className, singleLine, gen, s
|
|
|
1137
812
|
);
|
|
1138
813
|
}
|
|
1139
814
|
|
|
1140
|
-
// src/utils/
|
|
1141
|
-
var
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
{ key: "pink", label: "Pink", color: "#e988a8" },
|
|
1153
|
-
{ key: "neutral", label: "Neutral", color: "#b0b0b0" }
|
|
815
|
+
// src/utils/badge-palette.ts
|
|
816
|
+
var BADGE_PALETTE = [
|
|
817
|
+
"cyan",
|
|
818
|
+
"cyanSoft",
|
|
819
|
+
"pink",
|
|
820
|
+
"pinkSoft",
|
|
821
|
+
"openYellow",
|
|
822
|
+
"warning",
|
|
823
|
+
"green",
|
|
824
|
+
"success",
|
|
825
|
+
"red",
|
|
826
|
+
"error"
|
|
1154
827
|
];
|
|
1155
|
-
function
|
|
1156
|
-
return
|
|
828
|
+
function isBadgePaletteKey(value) {
|
|
829
|
+
return typeof value === "string" && BADGE_PALETTE.includes(value);
|
|
1157
830
|
}
|
|
1158
|
-
function
|
|
831
|
+
function pickBadgePaletteColor({
|
|
1159
832
|
avoid = [],
|
|
1160
833
|
random = Math.random
|
|
1161
834
|
} = {}) {
|
|
1162
|
-
const colours = COLOR_PRESETS.filter((preset) => preset.key !== "neutral");
|
|
1163
835
|
const used = new Set(avoid);
|
|
1164
|
-
const free =
|
|
1165
|
-
const pool = free.length > 0 ? free :
|
|
1166
|
-
return pool[Math.floor(random() * pool.length) % pool.length]
|
|
836
|
+
const free = BADGE_PALETTE.filter((key) => !used.has(key));
|
|
837
|
+
const pool = free.length > 0 ? free : BADGE_PALETTE;
|
|
838
|
+
return pool[Math.floor(random() * pool.length) % pool.length];
|
|
1167
839
|
}
|
|
1168
840
|
|
|
1169
841
|
// src/components/ui/palette-badge.tsx
|
|
1170
842
|
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
1171
843
|
function PaletteBadge({ text, color, className, variant = "button" }) {
|
|
1172
|
-
const fill = colorPreset(color)?.color ?? (color && HEX_PATTERN.test(color) ? color : null);
|
|
1173
844
|
return /* @__PURE__ */ jsx7(
|
|
1174
845
|
StatusBadge,
|
|
1175
846
|
{
|
|
1176
847
|
text,
|
|
1177
|
-
colorScheme: "default",
|
|
848
|
+
colorScheme: isBadgePaletteKey(color) ? color : "default",
|
|
1178
849
|
variant,
|
|
1179
850
|
singleLine: true,
|
|
1180
|
-
className
|
|
1181
|
-
style: fill ? { backgroundColor: fill, color: getReadableTextColor(fill) } : void 0
|
|
851
|
+
className
|
|
1182
852
|
}
|
|
1183
853
|
);
|
|
1184
854
|
}
|
|
@@ -4428,26 +4098,6 @@ export {
|
|
|
4428
4098
|
formatPricingModel,
|
|
4429
4099
|
formatBioText,
|
|
4430
4100
|
SquareAvatar,
|
|
4431
|
-
DESIGN_PALETTE,
|
|
4432
|
-
getContrastRatio,
|
|
4433
|
-
pickReadableTextColor,
|
|
4434
|
-
extractDominantColor,
|
|
4435
|
-
getBestContrastColor,
|
|
4436
|
-
analyzeImageColor,
|
|
4437
|
-
extractImageEdgeColorAsync,
|
|
4438
|
-
getCurrentPlatform,
|
|
4439
|
-
switchPlatformTheme,
|
|
4440
|
-
getSemanticColor,
|
|
4441
|
-
getPlatformConfig,
|
|
4442
|
-
usePlatformColors,
|
|
4443
|
-
getReadableTextColor,
|
|
4444
|
-
HEX_PATTERN,
|
|
4445
|
-
hexToRgb2 as hexToRgb,
|
|
4446
|
-
rgbToHex,
|
|
4447
|
-
deriveHoverColor,
|
|
4448
|
-
deriveActiveColor,
|
|
4449
|
-
rgbToHsl,
|
|
4450
|
-
hslToRgb,
|
|
4451
4101
|
InteractiveCard,
|
|
4452
4102
|
Modal,
|
|
4453
4103
|
ModalContent,
|
|
@@ -4459,9 +4109,9 @@ export {
|
|
|
4459
4109
|
genBadgeBgOpacity,
|
|
4460
4110
|
generationTierFromLabel,
|
|
4461
4111
|
StatusBadge,
|
|
4462
|
-
|
|
4463
|
-
|
|
4464
|
-
|
|
4112
|
+
BADGE_PALETTE,
|
|
4113
|
+
isBadgePaletteKey,
|
|
4114
|
+
pickBadgePaletteColor,
|
|
4465
4115
|
PaletteBadge,
|
|
4466
4116
|
DepartmentBadge,
|
|
4467
4117
|
getProxiedImageUrl,
|
|
@@ -4559,4 +4209,4 @@ export {
|
|
|
4559
4209
|
canonicalContentRefType,
|
|
4560
4210
|
buildListUrl
|
|
4561
4211
|
};
|
|
4562
|
-
//# sourceMappingURL=chunk-
|
|
4212
|
+
//# sourceMappingURL=chunk-QS2QCXBH.js.map
|