@flamingo-stack/openframe-frontend-core 0.0.626 → 0.0.627-2168.6177.1

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 (191) hide show
  1. package/dist/{chunk-63F2UQDW.cjs → chunk-2RWADKBR.cjs} +18 -18
  2. package/dist/{chunk-63F2UQDW.cjs.map → chunk-2RWADKBR.cjs.map} +1 -1
  3. package/dist/{chunk-X3LC6R37.js → chunk-32P6KUZP.js} +2 -2
  4. package/dist/{chunk-RVK3CL5S.js → chunk-3D45OAWL.js} +12 -12
  5. package/dist/{chunk-EHAYNUOL.cjs → chunk-4E7XCEV3.cjs} +77 -2
  6. package/dist/chunk-4E7XCEV3.cjs.map +1 -0
  7. package/dist/{chunk-L54LFB6V.cjs → chunk-5P3V6VFN.cjs} +15 -15
  8. package/dist/{chunk-L54LFB6V.cjs.map → chunk-5P3V6VFN.cjs.map} +1 -1
  9. package/dist/{chunk-2CCIF5QV.js → chunk-5YT6NGPV.js} +10 -8
  10. package/dist/{chunk-2CCIF5QV.js.map → chunk-5YT6NGPV.js.map} +1 -1
  11. package/dist/{chunk-U7TTQV4N.cjs → chunk-6I3KNDBF.cjs} +3 -3
  12. package/dist/{chunk-U7TTQV4N.cjs.map → chunk-6I3KNDBF.cjs.map} +1 -1
  13. package/dist/{chunk-S6WBBSII.js → chunk-76HB456V.js} +5 -5
  14. package/dist/{chunk-VOBOO7EF.cjs → chunk-76SF25HQ.cjs} +83 -83
  15. package/dist/{chunk-VOBOO7EF.cjs.map → chunk-76SF25HQ.cjs.map} +1 -1
  16. package/dist/{chunk-DLZFFGQ7.js → chunk-AGYKSJSE.js} +4 -4
  17. package/dist/{chunk-34GEH24Y.cjs → chunk-AONK75QT.cjs} +22 -20
  18. package/dist/chunk-AONK75QT.cjs.map +1 -0
  19. package/dist/{chunk-IJYP2DMW.js → chunk-B2DCZVUN.js} +8 -354
  20. package/dist/chunk-B2DCZVUN.js.map +1 -0
  21. package/dist/{chunk-QR2FJE2C.js → chunk-C6TNAYHO.js} +12 -12
  22. package/dist/{chunk-YQCA4ZEJ.js → chunk-CMUNJZWN.js} +2 -2
  23. package/dist/{chunk-F4TAUCHQ.js → chunk-CSP4GOQ2.js} +3 -3
  24. package/dist/{chunk-3LKJ6JWZ.cjs → chunk-DCBDNYYW.cjs} +34 -34
  25. package/dist/{chunk-3LKJ6JWZ.cjs.map → chunk-DCBDNYYW.cjs.map} +1 -1
  26. package/dist/{chunk-Z42VU7HF.cjs → chunk-DGYDHQWL.cjs} +49 -47
  27. package/dist/chunk-DGYDHQWL.cjs.map +1 -0
  28. package/dist/{chunk-QPQCQWAW.cjs → chunk-EAPER4P2.cjs} +28 -26
  29. package/dist/chunk-EAPER4P2.cjs.map +1 -0
  30. package/dist/{chunk-HTIDXF43.cjs → chunk-EH5BWSOS.cjs} +7 -7
  31. package/dist/{chunk-HTIDXF43.cjs.map → chunk-EH5BWSOS.cjs.map} +1 -1
  32. package/dist/{chunk-H7KQM3VI.js → chunk-FNT5JQDQ.js} +8 -8
  33. package/dist/{chunk-KK7YEVTQ.js → chunk-FRDSHK7F.js} +4 -4
  34. package/dist/{chunk-Q5XGBLT5.cjs → chunk-GESNG4HT.cjs} +509 -87
  35. package/dist/chunk-GESNG4HT.cjs.map +1 -0
  36. package/dist/{chunk-IZG3VYDV.js → chunk-GKCQIJE7.js} +4 -4
  37. package/dist/{chunk-E7YNDGRN.cjs → chunk-GNASINHO.cjs} +105 -105
  38. package/dist/{chunk-E7YNDGRN.cjs.map → chunk-GNASINHO.cjs.map} +1 -1
  39. package/dist/{chunk-5LIDR7HL.js → chunk-JRYS4VMV.js} +4 -79
  40. package/dist/{chunk-5LIDR7HL.js.map → chunk-JRYS4VMV.js.map} +1 -1
  41. package/dist/{chunk-QJ6BCSFQ.cjs → chunk-LAYQ3VUW.cjs} +5 -5
  42. package/dist/{chunk-QJ6BCSFQ.cjs.map → chunk-LAYQ3VUW.cjs.map} +1 -1
  43. package/dist/{chunk-ESSHEVZQ.cjs → chunk-MFHGLBCL.cjs} +38 -38
  44. package/dist/chunk-MFHGLBCL.cjs.map +1 -0
  45. package/dist/{chunk-S43SLJIN.cjs → chunk-MVPPH4EZ.cjs} +25 -25
  46. package/dist/{chunk-S43SLJIN.cjs.map → chunk-MVPPH4EZ.cjs.map} +1 -1
  47. package/dist/{chunk-WEDSYUSR.js → chunk-ONTFCKVK.js} +6 -6
  48. package/dist/{chunk-3POP5WWC.cjs → chunk-P32VEWOW.cjs} +6 -6
  49. package/dist/{chunk-3POP5WWC.cjs.map → chunk-P32VEWOW.cjs.map} +1 -1
  50. package/dist/{chunk-3IXDZI3R.cjs → chunk-P7UT2YSC.cjs} +3 -3
  51. package/dist/{chunk-3IXDZI3R.cjs.map → chunk-P7UT2YSC.cjs.map} +1 -1
  52. package/dist/{chunk-RGMUA4XB.js → chunk-PDFHLSPP.js} +7 -7
  53. package/dist/{chunk-MZWSJPDZ.js → chunk-QBX4BI5E.js} +16 -28
  54. package/dist/{chunk-MZWSJPDZ.js.map → chunk-QBX4BI5E.js.map} +1 -1
  55. package/dist/{chunk-JJUV7Z4L.cjs → chunk-QIVX7F3N.cjs} +27 -27
  56. package/dist/{chunk-JJUV7Z4L.cjs.map → chunk-QIVX7F3N.cjs.map} +1 -1
  57. package/dist/{chunk-P7KIFYZI.js → chunk-QPHOTZDX.js} +10 -8
  58. package/dist/{chunk-P7KIFYZI.js.map → chunk-QPHOTZDX.js.map} +1 -1
  59. package/dist/{chunk-2MMEPNSX.cjs → chunk-RAPPN6MN.cjs} +3 -3
  60. package/dist/{chunk-2MMEPNSX.cjs.map → chunk-RAPPN6MN.cjs.map} +1 -1
  61. package/dist/{chunk-BVCWBA2U.js → chunk-RD627HGV.js} +817 -395
  62. package/dist/chunk-RD627HGV.js.map +1 -0
  63. package/dist/{chunk-NLVBO3IR.js → chunk-RFM6NMF7.js} +10 -8
  64. package/dist/{chunk-NLVBO3IR.js.map → chunk-RFM6NMF7.js.map} +1 -1
  65. package/dist/{chunk-NZJNXGU2.cjs → chunk-S3WX4GNN.cjs} +280 -292
  66. package/dist/chunk-S3WX4GNN.cjs.map +1 -0
  67. package/dist/{chunk-RQQAPCOU.js → chunk-STRI4K3F.js} +3 -3
  68. package/dist/{chunk-LJ7KMQRM.cjs → chunk-T3HJAG5Y.cjs} +42 -42
  69. package/dist/{chunk-LJ7KMQRM.cjs.map → chunk-T3HJAG5Y.cjs.map} +1 -1
  70. package/dist/{chunk-DZ7CEES3.js → chunk-TIPGW4JM.js} +5 -5
  71. package/dist/{chunk-DZ7CEES3.js.map → chunk-TIPGW4JM.js.map} +1 -1
  72. package/dist/{chunk-FKBM6U43.js → chunk-USIRWQJ3.js} +76 -1
  73. package/dist/{chunk-FKBM6U43.js.map → chunk-USIRWQJ3.js.map} +1 -1
  74. package/dist/{chunk-CCWI3622.cjs → chunk-VOZZQ6HQ.cjs} +4 -4
  75. package/dist/{chunk-CCWI3622.cjs.map → chunk-VOZZQ6HQ.cjs.map} +1 -1
  76. package/dist/{chunk-MSVEZB5D.cjs → chunk-W54VLUS5.cjs} +279 -625
  77. package/dist/chunk-W54VLUS5.cjs.map +1 -0
  78. package/dist/{chunk-F2KBCLUG.js → chunk-X5NN4NJM.js} +2 -2
  79. package/dist/{chunk-CPO5KPW6.cjs → chunk-XDZIHPF2.cjs} +9 -9
  80. package/dist/{chunk-CPO5KPW6.cjs.map → chunk-XDZIHPF2.cjs.map} +1 -1
  81. package/dist/{chunk-ZIEYC6ZB.js → chunk-YDZ5S3Z2.js} +4 -4
  82. package/dist/{chunk-YXWGSDK4.cjs → chunk-ZI27ALYX.cjs} +5 -80
  83. package/dist/chunk-ZI27ALYX.cjs.map +1 -0
  84. package/dist/{chunk-BVQEU5JB.js → chunk-ZOMGXH7C.js} +2 -2
  85. package/dist/components/case-studies/index.cjs +14 -14
  86. package/dist/components/case-studies/index.js +8 -8
  87. package/dist/components/chat/entity-cards/ai-prompt-card.d.ts +2 -1
  88. package/dist/components/chat/entity-cards/ai-prompt-card.d.ts.map +1 -1
  89. package/dist/components/chat/entity-cards/employee-entry-card.d.ts +3 -3
  90. package/dist/components/chat/entity-cards/employee-entry-card.d.ts.map +1 -1
  91. package/dist/components/chat/entity-cards/entity-author-card.d.ts +8 -6
  92. package/dist/components/chat/entity-cards/entity-author-card.d.ts.map +1 -1
  93. package/dist/components/chat/index.cjs +5 -5
  94. package/dist/components/chat/index.js +4 -4
  95. package/dist/components/contact/index.cjs +9 -9
  96. package/dist/components/contact/index.js +8 -8
  97. package/dist/components/docs/index.cjs +12 -12
  98. package/dist/components/docs/index.js +11 -11
  99. package/dist/components/embeds/index.cjs +9 -9
  100. package/dist/components/embeds/index.js +8 -8
  101. package/dist/components/faq/index.cjs +10 -10
  102. package/dist/components/faq/index.js +9 -9
  103. package/dist/components/features/index.cjs +8 -8
  104. package/dist/components/features/index.js +7 -7
  105. package/dist/components/help-center-pages/index.cjs +31 -31
  106. package/dist/components/help-center-pages/index.js +22 -22
  107. package/dist/components/index.cjs +75 -69
  108. package/dist/components/index.cjs.map +1 -1
  109. package/dist/components/index.js +30 -24
  110. package/dist/components/index.js.map +1 -1
  111. package/dist/components/meeting-scheduler/index.cjs +49 -49
  112. package/dist/components/meeting-scheduler/index.js +9 -9
  113. package/dist/components/navigation/index.cjs +11 -11
  114. package/dist/components/navigation/index.js +10 -10
  115. package/dist/components/onboarding-guides/index.cjs +12 -12
  116. package/dist/components/onboarding-guides/index.js +11 -11
  117. package/dist/components/related-content/card-registry.d.ts.map +1 -1
  118. package/dist/components/related-content/index.cjs +6 -6
  119. package/dist/components/related-content/index.js +5 -5
  120. package/dist/components/tickets/index.cjs +13 -13
  121. package/dist/components/tickets/index.js +12 -12
  122. package/dist/components/ui/color-preset-select.d.ts +4 -5
  123. package/dist/components/ui/color-preset-select.d.ts.map +1 -1
  124. package/dist/components/ui/department-badge.d.ts +21 -0
  125. package/dist/components/ui/department-badge.d.ts.map +1 -0
  126. package/dist/components/ui/index.cjs +14 -8
  127. package/dist/components/ui/index.cjs.map +1 -1
  128. package/dist/components/ui/index.d.ts +2 -0
  129. package/dist/components/ui/index.d.ts.map +1 -1
  130. package/dist/components/ui/index.js +13 -7
  131. package/dist/components/ui/palette-badge.d.ts +18 -0
  132. package/dist/components/ui/palette-badge.d.ts.map +1 -0
  133. package/dist/hooks/index.cjs +5 -5
  134. package/dist/hooks/index.js +4 -4
  135. package/dist/index.cjs +28 -18
  136. package/dist/index.cjs.map +1 -1
  137. package/dist/index.js +50 -40
  138. package/dist/index.js.map +1 -1
  139. package/dist/types/department.d.ts +4 -0
  140. package/dist/types/department.d.ts.map +1 -1
  141. package/dist/utils/color-presets.d.ts +24 -0
  142. package/dist/utils/color-presets.d.ts.map +1 -0
  143. package/dist/utils/index.cjs +32 -0
  144. package/dist/utils/index.cjs.map +1 -1
  145. package/dist/utils/index.d.ts +1 -0
  146. package/dist/utils/index.d.ts.map +1 -1
  147. package/dist/utils/index.js +30 -1
  148. package/dist/utils/index.js.map +1 -1
  149. package/package.json +1 -1
  150. package/src/components/chat/entity-cards/ai-prompt-card.tsx +7 -4
  151. package/src/components/chat/entity-cards/employee-entry-card.tsx +21 -24
  152. package/src/components/chat/entity-cards/entity-author-card.tsx +10 -4
  153. package/src/components/related-content/card-registry.tsx +3 -1
  154. package/src/components/ui/.department-badge.md +2 -0
  155. package/src/components/ui/.palette-badge.md +2 -0
  156. package/src/components/ui/__tests__/department-badge.test.tsx +40 -0
  157. package/src/components/ui/color-preset-select.tsx +5 -21
  158. package/src/components/ui/department-badge.tsx +35 -0
  159. package/src/components/ui/index.ts +2 -0
  160. package/src/components/ui/palette-badge.tsx +35 -0
  161. package/src/types/department.ts +4 -0
  162. package/src/utils/.color-presets.md +2 -0
  163. package/src/utils/color-presets.ts +48 -0
  164. package/src/utils/index.ts +1 -0
  165. package/dist/chunk-34GEH24Y.cjs.map +0 -1
  166. package/dist/chunk-BVCWBA2U.js.map +0 -1
  167. package/dist/chunk-EHAYNUOL.cjs.map +0 -1
  168. package/dist/chunk-ESSHEVZQ.cjs.map +0 -1
  169. package/dist/chunk-IJYP2DMW.js.map +0 -1
  170. package/dist/chunk-MSVEZB5D.cjs.map +0 -1
  171. package/dist/chunk-NZJNXGU2.cjs.map +0 -1
  172. package/dist/chunk-Q5XGBLT5.cjs.map +0 -1
  173. package/dist/chunk-QPQCQWAW.cjs.map +0 -1
  174. package/dist/chunk-YXWGSDK4.cjs.map +0 -1
  175. package/dist/chunk-Z42VU7HF.cjs.map +0 -1
  176. /package/dist/{chunk-X3LC6R37.js.map → chunk-32P6KUZP.js.map} +0 -0
  177. /package/dist/{chunk-RVK3CL5S.js.map → chunk-3D45OAWL.js.map} +0 -0
  178. /package/dist/{chunk-S6WBBSII.js.map → chunk-76HB456V.js.map} +0 -0
  179. /package/dist/{chunk-DLZFFGQ7.js.map → chunk-AGYKSJSE.js.map} +0 -0
  180. /package/dist/{chunk-QR2FJE2C.js.map → chunk-C6TNAYHO.js.map} +0 -0
  181. /package/dist/{chunk-YQCA4ZEJ.js.map → chunk-CMUNJZWN.js.map} +0 -0
  182. /package/dist/{chunk-F4TAUCHQ.js.map → chunk-CSP4GOQ2.js.map} +0 -0
  183. /package/dist/{chunk-H7KQM3VI.js.map → chunk-FNT5JQDQ.js.map} +0 -0
  184. /package/dist/{chunk-KK7YEVTQ.js.map → chunk-FRDSHK7F.js.map} +0 -0
  185. /package/dist/{chunk-IZG3VYDV.js.map → chunk-GKCQIJE7.js.map} +0 -0
  186. /package/dist/{chunk-WEDSYUSR.js.map → chunk-ONTFCKVK.js.map} +0 -0
  187. /package/dist/{chunk-RGMUA4XB.js.map → chunk-PDFHLSPP.js.map} +0 -0
  188. /package/dist/{chunk-RQQAPCOU.js.map → chunk-STRI4K3F.js.map} +0 -0
  189. /package/dist/{chunk-F2KBCLUG.js.map → chunk-X5NN4NJM.js.map} +0 -0
  190. /package/dist/{chunk-ZIEYC6ZB.js.map → chunk-YDZ5S3Z2.js.map} +0 -0
  191. /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-5LIDR7HL.js";
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-BVCWBA2U.js";
177
+ } from "./chunk-RD627HGV.js";
176
178
  import {
177
179
  next_image_default
178
180
  } from "./chunk-MDKCTSDS.js";
179
181
  import {
180
- PLATFORM_THEME,
182
+ clamp,
181
183
  createLocalStorageAdapter,
182
184
  embedAuthedFetch,
183
185
  getEmbedProxyAuth,
184
- getPlatformAccentColor,
185
- getPlatformDisplayName,
186
186
  useAuthedAssetSrc,
187
187
  useAuthedImageSrc
188
- } from "./chunk-FKBM6U43.js";
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-IJYP2DMW.js.map
25604
+ //# sourceMappingURL=chunk-B2DCZVUN.js.map