@pixerate/editor 0.250.0 → 0.252.0

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 (137) hide show
  1. package/dist/agent/index.cjs +40 -41
  2. package/dist/agent/index.js +9 -10
  3. package/dist/animation/index.cjs +6 -7
  4. package/dist/animation/index.js +5 -6
  5. package/dist/animation-editor/index.cjs +70 -70
  6. package/dist/animation-editor/index.js +12 -12
  7. package/dist/brushes/index.cjs +2087 -0
  8. package/dist/brushes/index.d.cts +17 -0
  9. package/dist/brushes/index.d.ts +17 -0
  10. package/dist/brushes/index.js +2087 -0
  11. package/dist/brushes/library.d.cts +104 -0
  12. package/dist/brushes/library.d.ts +104 -0
  13. package/dist/brushes/migrate.d.cts +17 -0
  14. package/dist/brushes/migrate.d.ts +17 -0
  15. package/dist/brushes/normalize.d.cts +15 -0
  16. package/dist/brushes/normalize.d.ts +15 -0
  17. package/dist/brushes/presets.d.cts +12 -0
  18. package/dist/brushes/presets.d.ts +12 -0
  19. package/dist/brushes/profiles.d.cts +85 -0
  20. package/dist/brushes/profiles.d.ts +85 -0
  21. package/dist/brushes/resolve.d.cts +56 -0
  22. package/dist/brushes/resolve.d.ts +56 -0
  23. package/dist/brushes/schema.d.cts +29 -0
  24. package/dist/brushes/schema.d.ts +29 -0
  25. package/dist/brushes/tools.d.cts +37 -0
  26. package/dist/brushes/tools.d.ts +37 -0
  27. package/dist/brushes/types.d.cts +323 -0
  28. package/dist/brushes/types.d.ts +323 -0
  29. package/dist/{brushstrokeRender-2FHFLSEG.js → brushstrokeRender-5PYSKZIJ.js} +8 -8
  30. package/dist/{brushstrokeRender-QGRXOKDA.cjs → brushstrokeRender-7FLLSQEC.cjs} +14 -14
  31. package/dist/canvas/index.cjs +57 -58
  32. package/dist/canvas/index.js +31 -32
  33. package/dist/chart/index.cjs +159 -160
  34. package/dist/chart/index.js +9 -10
  35. package/dist/{chunk-NOHJP5TK.js → chunk-2ZJ4DT3M.js} +1 -1
  36. package/dist/{chunk-XZNU4DUX.cjs → chunk-3NS5C7FB.cjs} +76 -76
  37. package/dist/{chunk-UTI5IITZ.cjs → chunk-4ZC5QJE2.cjs} +3 -3
  38. package/dist/{chunk-SMSGP2HQ.js → chunk-5JNA6LLY.js} +1 -1
  39. package/dist/{chunk-RD7RX52G.cjs → chunk-5UEFBM2M.cjs} +207 -18
  40. package/dist/{chunk-WA44NKPF.js → chunk-62Z5WLRA.js} +1 -1
  41. package/dist/{chunk-BVRRIW7F.js → chunk-6GRUVGKU.js} +3 -3
  42. package/dist/{chunk-QARCM66V.js → chunk-6ZZKRH7R.js} +3 -3
  43. package/dist/{chunk-BP6KSGVD.js → chunk-7272D3K2.js} +4 -6
  44. package/dist/{chunk-NTRAVM2I.js → chunk-7P6VF3FG.js} +2 -2
  45. package/dist/chunk-APX63ILU.js +173 -0
  46. package/dist/{chunk-W7L4HUT2.cjs → chunk-CJ6TBL2N.cjs} +16 -16
  47. package/dist/{chunk-7PT4RJL5.cjs → chunk-EUIDTZNQ.cjs} +111 -113
  48. package/dist/{chunk-CXXXAZ7H.js → chunk-F6R67I3A.js} +1 -1
  49. package/dist/{chunk-I7NJPHWV.cjs → chunk-FQPUF2W2.cjs} +35 -606
  50. package/dist/{chunk-D5KGAO4Z.js → chunk-GCVFEPJG.js} +2 -573
  51. package/dist/{chunk-LEQKZGQI.js → chunk-GOBOCZZI.js} +1 -1
  52. package/dist/{chunk-KDLBJ6QR.js → chunk-GYMMNCFT.js} +3 -3
  53. package/dist/{chunk-NUTMINJZ.cjs → chunk-H7ET2ISK.cjs} +52 -52
  54. package/dist/chunk-HS6QDWDF.cjs +1029 -0
  55. package/dist/{chunk-T7KQEMAE.cjs → chunk-HUAISCUX.cjs} +18 -18
  56. package/dist/{chunk-YGQVCQTG.js → chunk-ILP77UD6.js} +1 -1
  57. package/dist/{chunk-S6OT6CTS.cjs → chunk-IWEVV63O.cjs} +31 -33
  58. package/dist/{chunk-M2VKFE5L.cjs → chunk-JFHBXNR2.cjs} +88 -88
  59. package/dist/{chunk-WPUXGDH4.cjs → chunk-JPEHXIB5.cjs} +10 -10
  60. package/dist/chunk-JSDND7DF.cjs +173 -0
  61. package/dist/{chunk-36ZTV7WO.js → chunk-L6Y7TSQ4.js} +1 -1
  62. package/dist/{chunk-YW43M56C.cjs → chunk-LFMKWGFL.cjs} +1 -1
  63. package/dist/{chunk-V6DT2CDH.js → chunk-M2TPMYJE.js} +1 -1
  64. package/dist/{chunk-LJZRHVZV.cjs → chunk-M5GLQQWG.cjs} +2 -2
  65. package/dist/{chunk-JEGJP4OW.js → chunk-MHLU6GRJ.js} +196 -7
  66. package/dist/{chunk-KMPM5JM5.js → chunk-MONXNVZK.js} +4 -6
  67. package/dist/chunk-MTKY6K3Q.js +1029 -0
  68. package/dist/{chunk-MOW3JMNG.cjs → chunk-N76AMOKE.cjs} +42 -42
  69. package/dist/{chunk-75K3W4D6.cjs → chunk-NKGB64CW.cjs} +16 -16
  70. package/dist/{chunk-SGPIVHJB.js → chunk-P3K2JCJA.js} +3 -3
  71. package/dist/chunk-PXDIAYB6.cjs +594 -0
  72. package/dist/{chunk-3TWOCSCY.js → chunk-QC3OXRE4.js} +9 -9
  73. package/dist/{chunk-YM6ZBTXG.cjs → chunk-QLSGTCYT.cjs} +23 -23
  74. package/dist/{chunk-7YW7T5TJ.js → chunk-RHPSE2YR.js} +2 -2
  75. package/dist/{chunk-44BMJJVA.cjs → chunk-RUONPPMC.cjs} +8 -8
  76. package/dist/{chunk-ATK6ABN3.cjs → chunk-SABJMH6M.cjs} +145 -12
  77. package/dist/{chunk-XWOLPNBW.cjs → chunk-SOSBOS5T.cjs} +22 -22
  78. package/dist/{chunk-PPFJHTW5.cjs → chunk-TFF2GTGN.cjs} +22 -24
  79. package/dist/{chunk-X7WRL5ZZ.cjs → chunk-TLOGFIIV.cjs} +37 -37
  80. package/dist/chunk-TXFWZ5ZJ.js +594 -0
  81. package/dist/{chunk-GXAK6Q5J.js → chunk-UFEDHACQ.js} +2 -2
  82. package/dist/{chunk-GA4EU4P3.cjs → chunk-UXETV2NC.cjs} +4 -4
  83. package/dist/{chunk-N4DFDI73.js → chunk-WKMUBATU.js} +1 -1
  84. package/dist/{chunk-3R5P3DVY.cjs → chunk-WRZ6C4TU.cjs} +6 -6
  85. package/dist/{chunk-U4NUOKBT.js → chunk-WZOGDKCQ.js} +134 -1
  86. package/dist/{chunk-6ADHGQ73.js → chunk-YBAPT7NL.js} +2 -4
  87. package/dist/color/index.cjs +4 -6
  88. package/dist/color/index.js +7 -9
  89. package/dist/export/index.cjs +7 -8
  90. package/dist/export/index.js +6 -7
  91. package/dist/extensions/index.cjs +10 -11
  92. package/dist/extensions/index.js +9 -10
  93. package/dist/gradient/index.cjs +33 -34
  94. package/dist/gradient/index.js +4 -5
  95. package/dist/image-editor/index.cjs +845 -844
  96. package/dist/image-editor/index.js +39 -38
  97. package/dist/index.cjs +16 -17
  98. package/dist/index.js +10 -11
  99. package/dist/paint/index.cjs +6 -4
  100. package/dist/paint/index.js +21 -19
  101. package/dist/paint-editor/brushes.d.cts +1 -2
  102. package/dist/paint-editor/brushes.d.ts +1 -2
  103. package/dist/paint-editor/index.cjs +2193 -694
  104. package/dist/paint-editor/index.js +1575 -76
  105. package/dist/paint-editor/mark-settings.d.cts +104 -0
  106. package/dist/paint-editor/mark-settings.d.ts +104 -0
  107. package/dist/paint-editor/procedural.d.cts +2 -75
  108. package/dist/paint-editor/procedural.d.ts +2 -75
  109. package/dist/paint-editor/stickers.d.cts +1 -22
  110. package/dist/paint-editor/stickers.d.ts +1 -22
  111. package/dist/raster/index.cjs +2 -2
  112. package/dist/raster/index.js +9 -9
  113. package/dist/stickers/index.cjs +10 -10
  114. package/dist/stickers/index.js +9 -9
  115. package/dist/tokens/index.cjs +3 -4
  116. package/dist/tokens/index.js +2 -3
  117. package/dist/tools/skill-evals.d.cts +8 -1
  118. package/dist/tools/skill-evals.d.ts +8 -1
  119. package/dist/typography/index.cjs +7 -8
  120. package/dist/typography/index.js +2 -3
  121. package/dist/vector/index.cjs +974 -974
  122. package/dist/vector/index.js +12 -12
  123. package/dist/video-editor/index.cjs +6 -7
  124. package/dist/video-editor/index.js +5 -6
  125. package/package.json +11 -1
  126. package/skills/README.md +2 -0
  127. package/skills/pixerate-brushes/SKILL.md +104 -0
  128. package/skills/pixerate-brushes-design/SKILL.md +88 -0
  129. package/skills/pixerate-brushes-design/evals/canvas-chalk.json +15 -0
  130. package/skills/pixerate-brushes-design/evals/pink-highlighter.json +15 -0
  131. package/skills/pixerate-brushes-design/evals/port-to-vector.json +17 -0
  132. package/dist/chunk-4JNWA3VT.cjs +0 -302
  133. package/dist/chunk-7AHBW2CQ.cjs +0 -200
  134. package/dist/chunk-F67XMVDI.js +0 -200
  135. package/dist/chunk-GT77U7QG.cjs +0 -2637
  136. package/dist/chunk-OTEPAQJX.js +0 -2637
  137. package/dist/chunk-WKH5ZAUA.js +0 -302
@@ -1,200 +0,0 @@
1
- import {
2
- D65_XY,
3
- apply,
4
- invert,
5
- mul,
6
- rgbToXyzMatrix,
7
- xyToXyz
8
- } from "./chunk-6ONMQ6WF.js";
9
-
10
- // src/color/convert.ts
11
- function srgbToLinear(v) {
12
- const sign = Math.sign(v);
13
- const abs = Math.abs(v);
14
- return sign * (abs <= 0.04045 ? abs / 12.92 : ((abs + 0.055) / 1.055) ** 2.4);
15
- }
16
- function linearToSrgb(v) {
17
- const sign = Math.sign(v);
18
- const abs = Math.abs(v);
19
- return sign * (abs <= 31308e-7 ? 12.92 * abs : 1.055 * abs ** (1 / 2.4) - 0.055);
20
- }
21
- function rgbToHsl(rgba) {
22
- const { r, g, b, a } = rgba;
23
- const max = Math.max(r, g, b);
24
- const min = Math.min(r, g, b);
25
- const d = max - min;
26
- const l = (max + min) / 2;
27
- let h = 0;
28
- if (d > 0) {
29
- if (max === r) h = 60 * ((g - b) / d % 6);
30
- else if (max === g) h = 60 * ((b - r) / d + 2);
31
- else h = 60 * ((r - g) / d + 4);
32
- }
33
- if (h < 0) h += 360;
34
- const s = d === 0 ? 0 : d / (1 - Math.abs(2 * l - 1));
35
- return { h, s, l, alpha: a };
36
- }
37
- function hslToRgb(hsla) {
38
- const { h, s, l, alpha } = hsla;
39
- const hh = (h % 360 + 360) % 360 / 60;
40
- const c = (1 - Math.abs(2 * l - 1)) * s;
41
- const x = c * (1 - Math.abs(hh % 2 - 1));
42
- const m = l - c / 2;
43
- let r = 0;
44
- let g = 0;
45
- let b = 0;
46
- if (hh < 1) {
47
- r = c;
48
- g = x;
49
- b = 0;
50
- } else if (hh < 2) {
51
- r = x;
52
- g = c;
53
- b = 0;
54
- } else if (hh < 3) {
55
- r = 0;
56
- g = c;
57
- b = x;
58
- } else if (hh < 4) {
59
- r = 0;
60
- g = x;
61
- b = c;
62
- } else if (hh < 5) {
63
- r = x;
64
- g = 0;
65
- b = c;
66
- } else {
67
- r = c;
68
- g = 0;
69
- b = x;
70
- }
71
- return { r: r + m, g: g + m, b: b + m, a: alpha };
72
- }
73
- function rgbToHsv(rgba) {
74
- const { r, g, b, a } = rgba;
75
- const max = Math.max(r, g, b);
76
- const min = Math.min(r, g, b);
77
- const d = max - min;
78
- let h = 0;
79
- if (d > 0) {
80
- if (max === r) h = 60 * ((g - b) / d % 6);
81
- else if (max === g) h = 60 * ((b - r) / d + 2);
82
- else h = 60 * ((r - g) / d + 4);
83
- }
84
- if (h < 0) h += 360;
85
- const s = max === 0 ? 0 : d / max;
86
- return { h, s, v: max, alpha: a };
87
- }
88
- function hsvToRgb(hsva) {
89
- const { h, s, v, alpha } = hsva;
90
- const hh = (h % 360 + 360) % 360 / 60;
91
- const c = v * s;
92
- const x = c * (1 - Math.abs(hh % 2 - 1));
93
- const m = v - c;
94
- let r = 0;
95
- let g = 0;
96
- let b = 0;
97
- if (hh < 1) {
98
- r = c;
99
- g = x;
100
- b = 0;
101
- } else if (hh < 2) {
102
- r = x;
103
- g = c;
104
- b = 0;
105
- } else if (hh < 3) {
106
- r = 0;
107
- g = c;
108
- b = x;
109
- } else if (hh < 4) {
110
- r = 0;
111
- g = x;
112
- b = c;
113
- } else if (hh < 5) {
114
- r = x;
115
- g = 0;
116
- b = c;
117
- } else {
118
- r = c;
119
- g = 0;
120
- b = x;
121
- }
122
- return { r: r + m, g: g + m, b: b + m, a: alpha };
123
- }
124
- function rgbToOklab(rgba) {
125
- const lr = srgbToLinear(rgba.r);
126
- const lg = srgbToLinear(rgba.g);
127
- const lb = srgbToLinear(rgba.b);
128
- const l = Math.cbrt(0.4122214708 * lr + 0.5363325363 * lg + 0.0514459929 * lb);
129
- const m = Math.cbrt(0.2119034982 * lr + 0.6806995451 * lg + 0.1073969566 * lb);
130
- const s = Math.cbrt(0.0883024619 * lr + 0.2817188376 * lg + 0.6299787005 * lb);
131
- return {
132
- l: 0.2104542553 * l + 0.793617785 * m - 0.0040720468 * s,
133
- a: 1.9779984951 * l - 2.428592205 * m + 0.4505937099 * s,
134
- b: 0.0259040371 * l + 0.7827717662 * m - 0.808675766 * s,
135
- alpha: rgba.a
136
- };
137
- }
138
- function oklabToRgb(lab) {
139
- const l_ = lab.l + 0.3963377774 * lab.a + 0.2158037573 * lab.b;
140
- const m_ = lab.l - 0.1055613458 * lab.a - 0.0638541728 * lab.b;
141
- const s_ = lab.l - 0.0894841775 * lab.a - 1.291485548 * lab.b;
142
- const l = l_ ** 3;
143
- const m = m_ ** 3;
144
- const s = s_ ** 3;
145
- return {
146
- r: linearToSrgb(4.0767416621 * l - 3.3077115913 * m + 0.2309699292 * s),
147
- g: linearToSrgb(-1.2684380046 * l + 2.6097574011 * m - 0.3413193965 * s),
148
- b: linearToSrgb(-0.0041960863 * l - 0.7034186147 * m + 1.707614701 * s),
149
- a: lab.alpha
150
- };
151
- }
152
- function oklabToOklch(lab) {
153
- const c = Math.hypot(lab.a, lab.b);
154
- let h = 0;
155
- if (c >= 1e-6) {
156
- h = Math.atan2(lab.b, lab.a) * 180 / Math.PI;
157
- if (h < 0) h += 360;
158
- if (h >= 360) h -= 360;
159
- }
160
- return { l: lab.l, c, h, alpha: lab.alpha };
161
- }
162
- function oklchToOklab(lch) {
163
- const rad = lch.h * Math.PI / 180;
164
- return {
165
- l: lch.l,
166
- a: lch.c * Math.cos(rad),
167
- b: lch.c * Math.sin(rad),
168
- alpha: lch.alpha
169
- };
170
- }
171
- var D65_XYZ = xyToXyz(D65_XY);
172
- var SRGB_TO_XYZ = rgbToXyzMatrix([0.64, 0.33], [0.3, 0.6], [0.15, 0.06], D65_XYZ);
173
- var P3_TO_XYZ = rgbToXyzMatrix([0.68, 0.32], [0.265, 0.69], [0.15, 0.06], D65_XYZ);
174
- var XYZ_TO_SRGB = invert(SRGB_TO_XYZ);
175
- var XYZ_TO_P3 = invert(P3_TO_XYZ);
176
- var P3_TO_SRGB_MAT = mul(XYZ_TO_SRGB, P3_TO_XYZ);
177
- var SRGB_TO_P3_MAT = mul(XYZ_TO_P3, SRGB_TO_XYZ);
178
- function linearSrgbToDisplayP3(rgb) {
179
- const out = apply(SRGB_TO_P3_MAT, [rgb.r, rgb.g, rgb.b]);
180
- return { r: out[0], g: out[1], b: out[2], a: rgb.a };
181
- }
182
- function displayP3ToLinearSrgb(rgb) {
183
- const out = apply(P3_TO_SRGB_MAT, [rgb.r, rgb.g, rgb.b]);
184
- return { r: out[0], g: out[1], b: out[2], a: rgb.a };
185
- }
186
-
187
- export {
188
- srgbToLinear,
189
- linearToSrgb,
190
- rgbToHsl,
191
- hslToRgb,
192
- rgbToHsv,
193
- hsvToRgb,
194
- rgbToOklab,
195
- oklabToRgb,
196
- oklabToOklch,
197
- oklchToOklab,
198
- linearSrgbToDisplayP3,
199
- displayP3ToLinearSrgb
200
- };