@meonode/canvas 1.0.0-beta.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 (65) hide show
  1. package/CONTRIBUTING.md +75 -0
  2. package/LICENSE +21 -0
  3. package/Readme.md +382 -0
  4. package/dist/cjs/canvas/canvas.helper.d.ts +57 -0
  5. package/dist/cjs/canvas/canvas.helper.d.ts.map +1 -0
  6. package/dist/cjs/canvas/canvas.helper.js +239 -0
  7. package/dist/cjs/canvas/canvas.helper.js.map +1 -0
  8. package/dist/cjs/canvas/canvas.type.d.ts +657 -0
  9. package/dist/cjs/canvas/canvas.type.d.ts.map +1 -0
  10. package/dist/cjs/canvas/grid.canvas.util.d.ts +39 -0
  11. package/dist/cjs/canvas/grid.canvas.util.d.ts.map +1 -0
  12. package/dist/cjs/canvas/grid.canvas.util.js +263 -0
  13. package/dist/cjs/canvas/grid.canvas.util.js.map +1 -0
  14. package/dist/cjs/canvas/image.canvas.util.d.ts +34 -0
  15. package/dist/cjs/canvas/image.canvas.util.d.ts.map +1 -0
  16. package/dist/cjs/canvas/image.canvas.util.js +310 -0
  17. package/dist/cjs/canvas/image.canvas.util.js.map +1 -0
  18. package/dist/cjs/canvas/layout.canvas.util.d.ts +123 -0
  19. package/dist/cjs/canvas/layout.canvas.util.d.ts.map +1 -0
  20. package/dist/cjs/canvas/layout.canvas.util.js +785 -0
  21. package/dist/cjs/canvas/layout.canvas.util.js.map +1 -0
  22. package/dist/cjs/canvas/root.canvas.util.d.ts +42 -0
  23. package/dist/cjs/canvas/root.canvas.util.d.ts.map +1 -0
  24. package/dist/cjs/canvas/root.canvas.util.js +140 -0
  25. package/dist/cjs/canvas/root.canvas.util.js.map +1 -0
  26. package/dist/cjs/canvas/text.canvas.util.d.ts +148 -0
  27. package/dist/cjs/canvas/text.canvas.util.d.ts.map +1 -0
  28. package/dist/cjs/canvas/text.canvas.util.js +1112 -0
  29. package/dist/cjs/canvas/text.canvas.util.js.map +1 -0
  30. package/dist/cjs/constant/common.const.d.ts +37 -0
  31. package/dist/cjs/constant/common.const.d.ts.map +1 -0
  32. package/dist/cjs/constant/common.const.js +51 -0
  33. package/dist/cjs/constant/common.const.js.map +1 -0
  34. package/dist/cjs/index.d.ts +7 -0
  35. package/dist/cjs/index.d.ts.map +1 -0
  36. package/dist/cjs/index.js +31 -0
  37. package/dist/cjs/index.js.map +1 -0
  38. package/dist/esm/canvas/canvas.helper.d.ts +57 -0
  39. package/dist/esm/canvas/canvas.helper.d.ts.map +1 -0
  40. package/dist/esm/canvas/canvas.helper.js +214 -0
  41. package/dist/esm/canvas/canvas.type.d.ts +657 -0
  42. package/dist/esm/canvas/canvas.type.d.ts.map +1 -0
  43. package/dist/esm/canvas/grid.canvas.util.d.ts +39 -0
  44. package/dist/esm/canvas/grid.canvas.util.d.ts.map +1 -0
  45. package/dist/esm/canvas/grid.canvas.util.js +259 -0
  46. package/dist/esm/canvas/image.canvas.util.d.ts +34 -0
  47. package/dist/esm/canvas/image.canvas.util.d.ts.map +1 -0
  48. package/dist/esm/canvas/image.canvas.util.js +306 -0
  49. package/dist/esm/canvas/layout.canvas.util.d.ts +123 -0
  50. package/dist/esm/canvas/layout.canvas.util.d.ts.map +1 -0
  51. package/dist/esm/canvas/layout.canvas.util.js +777 -0
  52. package/dist/esm/canvas/root.canvas.util.d.ts +42 -0
  53. package/dist/esm/canvas/root.canvas.util.d.ts.map +1 -0
  54. package/dist/esm/canvas/root.canvas.util.js +116 -0
  55. package/dist/esm/canvas/text.canvas.util.d.ts +148 -0
  56. package/dist/esm/canvas/text.canvas.util.d.ts.map +1 -0
  57. package/dist/esm/canvas/text.canvas.util.js +1108 -0
  58. package/dist/esm/constant/common.const.d.ts +37 -0
  59. package/dist/esm/constant/common.const.d.ts.map +1 -0
  60. package/dist/esm/constant/common.const.js +23 -0
  61. package/dist/esm/index.d.ts +7 -0
  62. package/dist/esm/index.d.ts.map +1 -0
  63. package/dist/esm/index.js +7 -0
  64. package/dist/meonode-canvas-1.0.0-beta.1.tgz +0 -0
  65. package/package.json +79 -0
@@ -0,0 +1,239 @@
1
+ 'use strict';
2
+
3
+ var YogaTypes = require('yoga-layout');
4
+ var common_const = require('../constant/common.const.js');
5
+
6
+ function _interopNamespaceDefault(e) {
7
+ var n = Object.create(null);
8
+ if (e) {
9
+ Object.keys(e).forEach(function (k) {
10
+ if (k !== 'default') {
11
+ var d = Object.getOwnPropertyDescriptor(e, k);
12
+ Object.defineProperty(n, k, d.get ? d : {
13
+ enumerable: true,
14
+ get: function () { return e[k]; }
15
+ });
16
+ }
17
+ });
18
+ }
19
+ n.default = e;
20
+ return Object.freeze(n);
21
+ }
22
+
23
+ var YogaTypes__namespace = /*#__PURE__*/_interopNamespaceDefault(YogaTypes);
24
+
25
+ const drawBorders = ({ ctx, node, x, y, width, height, radii, borderColor, borderStyle, }) => {
26
+ const borderAll = node.getBorder(YogaTypes__namespace.Edge.All) || 0;
27
+ const borderTop = Math.max(0, node.getBorder(YogaTypes__namespace.Edge.Top) || borderAll);
28
+ const borderRight = Math.max(0, node.getBorder(YogaTypes__namespace.Edge.Right) || borderAll);
29
+ const borderBottom = Math.max(0, node.getBorder(YogaTypes__namespace.Edge.Bottom) || borderAll);
30
+ const borderLeft = Math.max(0, node.getBorder(YogaTypes__namespace.Edge.Left) || borderAll);
31
+ const hasBorder = borderTop > 0 || borderRight > 0 || borderBottom > 0 || borderLeft > 0;
32
+ const boxSizing = node.getBoxSizing();
33
+ if (hasBorder && borderColor) {
34
+ ctx.strokeStyle = borderColor;
35
+ ctx.lineCap = 'butt';
36
+ ctx.lineJoin = 'miter'; // Use miter for sharp corners unless rounded
37
+ const setDash = (width) => {
38
+ if (borderStyle === common_const.Style.Border.Dashed && width > 0) {
39
+ const dashLength = Math.max(2, width * 1.5);
40
+ const gapLength = Math.max(1, width);
41
+ ctx.setLineDash([dashLength, gapLength]);
42
+ }
43
+ else {
44
+ ctx.setLineDash([]); // Solid line
45
+ }
46
+ };
47
+ /**
48
+ * Draws a rounded corner arc for the border.
49
+ *
50
+ * @param cx - The x-coordinate of the visual center of the corner curve.
51
+ * @param cy - The y-coordinate of the visual center of the corner curve.
52
+ * @param radius - The visual radius of the corner curve.
53
+ * @param startAngle - The starting angle of the arc in radians.
54
+ * @param endAngle - The ending angle of the arc in radians.
55
+ * @param border1 - The border width leading into the corner.
56
+ * @param border2 - The border width leading out of the corner.
57
+ */
58
+ const drawCornerArc = (cx, cy, radius, startAngle, endAngle, border1, border2) => {
59
+ if (radius <= 0)
60
+ return;
61
+ const cornerWidth = Math.max(border1, border2);
62
+ if (cornerWidth <= 0)
63
+ return;
64
+ let centerlineArcRadius;
65
+ if (boxSizing === common_const.Style.BoxSizing.ContentBox) {
66
+ // For content-box, the border is outside the box, so the centerline radius is the visual radius plus half the border width.
67
+ centerlineArcRadius = radius + cornerWidth / 2;
68
+ }
69
+ else {
70
+ // For border-box, the border is inside the box, so the centerline radius is the visual radius minus half the border width.
71
+ // Ensure the centerline radius is not negative.
72
+ centerlineArcRadius = Math.max(0, radius - cornerWidth / 2);
73
+ if (centerlineArcRadius <= 0 && radius > 0) {
74
+ // Draw cap for border-box when border is thicker than radius allows for centerline arc
75
+ ctx.fillStyle = borderColor; // Use border color for fill
76
+ ctx.beginPath();
77
+ // Cap is centered on the visual corner center with the visual radius
78
+ ctx.arc(cx, cy, radius, 0, 2 * Math.PI);
79
+ ctx.fill();
80
+ return; // Cap drawn, skip arc stroke
81
+ }
82
+ }
83
+ // Draw the normal arc stroke using the calculated centerline radius
84
+ ctx.beginPath();
85
+ ctx.lineWidth = cornerWidth;
86
+ setDash(cornerWidth);
87
+ ctx.arc(cx, cy, centerlineArcRadius, startAngle, endAngle);
88
+ ctx.stroke();
89
+ };
90
+ /**
91
+ * Draws a straight line segment for the border.
92
+ *
93
+ * @param x1 - The x-coordinate of the starting point.
94
+ * @param y1 - The y-coordinate of the starting point.
95
+ * @param x2 - The x-coordinate of the ending point.
96
+ * @param y2 - The y-coordinate of the ending point.
97
+ * @param borderWidth - The width of the border.
98
+ */
99
+ const drawLine = (x1, y1, x2, y2, borderWidth) => {
100
+ if (borderWidth <= 0)
101
+ return;
102
+ ctx.beginPath();
103
+ ctx.lineWidth = borderWidth;
104
+ setDash(borderWidth);
105
+ ctx.moveTo(x1, y1);
106
+ ctx.lineTo(x2, y2);
107
+ ctx.stroke();
108
+ };
109
+ // Calculate half-border widths
110
+ const halfBt = borderTop / 2;
111
+ const halfBr = borderRight / 2;
112
+ const halfBb = borderBottom / 2;
113
+ const halfBl = borderLeft / 2;
114
+ // Calculate effective visual radii, clamped to half dimensions of the *layout box*
115
+ const maxRadiusX = width / 2; // This matches CSS behavior where radius is relative to the box it's applied to.
116
+ const maxRadiusY = height / 2;
117
+ const rTL = Math.max(0, Math.min(radii.TopLeft, maxRadiusX, maxRadiusY));
118
+ const rTR = Math.max(0, Math.min(radii.TopRight, maxRadiusX, maxRadiusY));
119
+ const rBR = Math.max(0, Math.min(radii.BottomRight, maxRadiusX, maxRadiusY));
120
+ const rBL = Math.max(0, Math.min(radii.BottomLeft, maxRadiusX, maxRadiusY));
121
+ // --- Draw border segments based on boxSizing ---
122
+ // For content-box, coordinates are offset *outwards* from x, y, width, height
123
+ if (boxSizing === common_const.Style.BoxSizing.ContentBox) {
124
+ // Top line segment
125
+ drawLine(x + rTL, y - halfBt, x + width - rTR, y - halfBt, borderTop);
126
+ // Right line segment
127
+ drawLine(x + width + halfBr, y + rTR, x + width + halfBr, y + height - rBR, borderRight);
128
+ // Bottom line segment
129
+ drawLine(x + width - rBR, y + height + halfBb, x + rBL, y + height + halfBb, borderBottom);
130
+ // Left line segment
131
+ drawLine(x - halfBl, y + height - rBL, x - halfBl, y + rTL, borderLeft);
132
+ drawCornerArc(x + rTL, y + rTL, rTL, Math.PI, 1.5 * Math.PI, borderLeft, borderTop);
133
+ drawCornerArc(x + width - rTR, y + rTR, rTR, 1.5 * Math.PI, 2 * Math.PI, borderTop, borderRight);
134
+ drawCornerArc(x + width - rBR, y + height - rBR, rBR, 0, 0.5 * Math.PI, borderRight, borderBottom);
135
+ drawCornerArc(x + rBL, y + height - rBL, rBL, 0.5 * Math.PI, Math.PI, borderBottom, borderLeft);
136
+ }
137
+ else {
138
+ // For border-box, coordinates are offset *inwards* from x, y, width, height
139
+ // Top line segment
140
+ drawLine(x + rTL, y + halfBt, x + width - rTR, y + halfBt, borderTop);
141
+ // Right line segment
142
+ drawLine(x + width - halfBr, y + rTR, x + width - halfBr, y + height - rBR, borderRight);
143
+ // Bottom line segment
144
+ drawLine(x + width - rBR, y + height - halfBb, x + rBL, y + height - halfBb, borderBottom);
145
+ // Left line segment
146
+ drawLine(x + halfBl, y + height - rBL, x + halfBl, y + rTL, borderLeft);
147
+ // Draw corner arcs (centers relative to layout box corners, adjusted for inward border)
148
+ // Pass visual radius (rTL, rTR etc.) to drawCornerArc
149
+ drawCornerArc(x + rTL, y + rTL, rTL, Math.PI, 1.5 * Math.PI, borderLeft, borderTop); // Top-Left
150
+ drawCornerArc(x + width - rTR, y + rTR, rTR, 1.5 * Math.PI, 2 * Math.PI, borderTop, borderRight); // Top-Right
151
+ drawCornerArc(x + width - rBR, y + height - rBR, rBR, 0, 0.5 * Math.PI, borderRight, borderBottom); // Bottom-Right
152
+ drawCornerArc(x + rBL, y + height - rBL, rBL, 0.5 * Math.PI, Math.PI, borderBottom, borderLeft); // Bottom-Left
153
+ }
154
+ }
155
+ };
156
+ /**
157
+ * Draws an optimized rounded rectangle path on the canvas context.
158
+ * Automatically clamps radius values to prevent visual artifacts based on box dimensions.
159
+ * Uses arc-based rendering for crisp corners and consistent border appearance.
160
+ *
161
+ * @param ctx - The canvas 2D rendering context to draw on
162
+ * @param x - Left position of the rectangle
163
+ * @param y - Top position of the rectangle
164
+ * @param width - Width of the rectangle
165
+ * @param height - Height of the rectangle
166
+ * @param radii - Corner radius values for each corner. Values are clamped to box constraints.
167
+ */
168
+ const drawRoundedRectPath = (ctx, x, y, width, height, radii) => {
169
+ if (width <= 0 || height <= 0) {
170
+ ctx.beginPath();
171
+ ctx.rect(x, y, width, height);
172
+ return;
173
+ }
174
+ ctx.beginPath();
175
+ // Clamp radius values to prevent visual artifacts
176
+ const maxRadius = Math.min(width / 2, height / 2);
177
+ const clampedTL = Math.max(0, Math.min(radii.TopLeft, maxRadius));
178
+ const clampedTR = Math.max(0, Math.min(radii.TopRight, maxRadius));
179
+ const clampedBR = Math.max(0, Math.min(radii.BottomRight, maxRadius));
180
+ const clampedBL = Math.max(0, Math.min(radii.BottomLeft, maxRadius));
181
+ ctx.moveTo(x + clampedTL, y);
182
+ // Draw top edge and top-right corner
183
+ ctx.lineTo(x + width - clampedTR, y);
184
+ clampedTR > 0 ? ctx.arc(x + width - clampedTR, y + clampedTR, clampedTR, 1.5 * Math.PI, 0) : ctx.lineTo(x + width, y);
185
+ // Draw right edge and bottom-right corner
186
+ ctx.lineTo(x + width, y + height - clampedBR);
187
+ clampedBR > 0
188
+ ? ctx.arc(x + width - clampedBR, y + height - clampedBR, clampedBR, 0, 0.5 * Math.PI)
189
+ : ctx.lineTo(x + width, y + height);
190
+ // Draw bottom edge and bottom-left corner
191
+ ctx.lineTo(x + clampedBL, y + height);
192
+ clampedBL > 0
193
+ ? ctx.arc(x + clampedBL, y + height - clampedBL, clampedBL, 0.5 * Math.PI, Math.PI)
194
+ : ctx.lineTo(x, y + height);
195
+ // Draw left edge and top-left corner
196
+ ctx.lineTo(x, y + clampedTL);
197
+ clampedTL > 0 ? ctx.arc(x + clampedTL, y + clampedTL, clampedTL, Math.PI, 1.5 * Math.PI) : ctx.lineTo(x, y);
198
+ ctx.closePath();
199
+ };
200
+ /**
201
+ * Calculates border radius values from props
202
+ * @param radiusProp - Border radius property value
203
+ * @returns Calculated border radii for all corners
204
+ */
205
+ const parseBorderRadius = (radiusProp) => {
206
+ const radii = { TopLeft: 0, TopRight: 0, BottomRight: 0, BottomLeft: 0 };
207
+ if (typeof radiusProp === 'number') {
208
+ radii.TopLeft = radii.TopRight = radii.BottomRight = radii.BottomLeft = Math.max(0, radiusProp);
209
+ }
210
+ else if (typeof radiusProp === 'object' && radiusProp !== null) {
211
+ radii.TopLeft = Math.max(0, radiusProp.TopLeft ?? 0);
212
+ radii.TopRight = Math.max(0, radiusProp.TopRight ?? 0);
213
+ radii.BottomRight = Math.max(0, radiusProp.BottomRight ?? 0);
214
+ radii.BottomLeft = Math.max(0, radiusProp.BottomLeft ?? 0);
215
+ }
216
+ return radii;
217
+ };
218
+ /**
219
+ * Parses a percentage value or a number, returning the calculated value based on the base.
220
+ *
221
+ * @param value - The value to parse, can be a number, a percentage string, or undefined.
222
+ * @param base - The base value to calculate the percentage from.
223
+ * @returns The parsed number, or 0 if the value is not a number or a valid percentage.
224
+ */
225
+ function parsePercentage(value, base) {
226
+ if (typeof value === 'number') {
227
+ return value;
228
+ }
229
+ if (typeof value === 'string' && value.endsWith('%')) {
230
+ return base !== 0 ? (parseFloat(value) / 100) * base : 0;
231
+ }
232
+ return 0;
233
+ }
234
+
235
+ exports.drawBorders = drawBorders;
236
+ exports.drawRoundedRectPath = drawRoundedRectPath;
237
+ exports.parseBorderRadius = parseBorderRadius;
238
+ exports.parsePercentage = parsePercentage;
239
+ //# sourceMappingURL=canvas.helper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"canvas.helper.js","sources":["../../../../src/canvas/canvas.helper.ts"],"sourcesContent":["import type { CanvasRenderingContext2D } from 'skia-canvas'\nimport * as YogaTypes from 'yoga-layout'\nimport { Style } from '@/constant/common.const.js'\nimport type { BoxProps } from '@/canvas/canvas.type.js'\n\nexport const drawBorders = ({\n ctx,\n node,\n x,\n y,\n width,\n height,\n radii,\n borderColor,\n borderStyle,\n}: {\n ctx: CanvasRenderingContext2D\n node: YogaTypes.Node\n x: number\n y: number\n width: number\n height: number\n radii: {\n TopLeft: number\n TopRight: number\n BottomLeft: number\n BottomRight: number\n }\n borderColor: BoxProps['borderColor']\n borderStyle: BoxProps['borderStyle']\n}) => {\n const borderAll = node.getBorder(YogaTypes.Edge.All) || 0\n const borderTop = Math.max(0, node.getBorder(YogaTypes.Edge.Top) || borderAll)\n const borderRight = Math.max(0, node.getBorder(YogaTypes.Edge.Right) || borderAll)\n const borderBottom = Math.max(0, node.getBorder(YogaTypes.Edge.Bottom) || borderAll)\n const borderLeft = Math.max(0, node.getBorder(YogaTypes.Edge.Left) || borderAll)\n\n const hasBorder = borderTop > 0 || borderRight > 0 || borderBottom > 0 || borderLeft > 0\n const boxSizing = node.getBoxSizing()\n\n if (hasBorder && borderColor) {\n ctx.strokeStyle = borderColor\n ctx.lineCap = 'butt'\n ctx.lineJoin = 'miter' // Use miter for sharp corners unless rounded\n\n const setDash = (width: number) => {\n if (borderStyle === Style.Border.Dashed && width > 0) {\n const dashLength = Math.max(2, width * 1.5)\n const gapLength = Math.max(1, width)\n ctx.setLineDash([dashLength, gapLength])\n } else {\n ctx.setLineDash([]) // Solid line\n }\n }\n\n /**\n * Draws a rounded corner arc for the border.\n *\n * @param cx - The x-coordinate of the visual center of the corner curve.\n * @param cy - The y-coordinate of the visual center of the corner curve.\n * @param radius - The visual radius of the corner curve.\n * @param startAngle - The starting angle of the arc in radians.\n * @param endAngle - The ending angle of the arc in radians.\n * @param border1 - The border width leading into the corner.\n * @param border2 - The border width leading out of the corner.\n */\n const drawCornerArc = (\n cx: number,\n cy: number,\n radius: number,\n startAngle: number,\n endAngle: number,\n border1: number,\n border2: number,\n ) => {\n if (radius <= 0) return\n\n const cornerWidth = Math.max(border1, border2)\n if (cornerWidth <= 0) return\n\n let centerlineArcRadius: number\n\n if (boxSizing === Style.BoxSizing.ContentBox) {\n // For content-box, the border is outside the box, so the centerline radius is the visual radius plus half the border width.\n centerlineArcRadius = radius + cornerWidth / 2\n } else {\n // For border-box, the border is inside the box, so the centerline radius is the visual radius minus half the border width.\n // Ensure the centerline radius is not negative.\n centerlineArcRadius = Math.max(0, radius - cornerWidth / 2)\n\n if (centerlineArcRadius <= 0 && radius > 0) {\n // Draw cap for border-box when border is thicker than radius allows for centerline arc\n ctx.fillStyle = borderColor! // Use border color for fill\n ctx.beginPath()\n // Cap is centered on the visual corner center with the visual radius\n ctx.arc(cx, cy, radius, 0, 2 * Math.PI)\n ctx.fill()\n return // Cap drawn, skip arc stroke\n }\n }\n // Draw the normal arc stroke using the calculated centerline radius\n ctx.beginPath()\n ctx.lineWidth = cornerWidth\n setDash(cornerWidth)\n ctx.arc(cx, cy, centerlineArcRadius, startAngle, endAngle)\n ctx.stroke()\n }\n\n /**\n * Draws a straight line segment for the border.\n *\n * @param x1 - The x-coordinate of the starting point.\n * @param y1 - The y-coordinate of the starting point.\n * @param x2 - The x-coordinate of the ending point.\n * @param y2 - The y-coordinate of the ending point.\n * @param borderWidth - The width of the border.\n */\n const drawLine = (x1: number, y1: number, x2: number, y2: number, borderWidth: number) => {\n if (borderWidth <= 0) return\n ctx.beginPath()\n ctx.lineWidth = borderWidth\n setDash(borderWidth)\n ctx.moveTo(x1, y1)\n ctx.lineTo(x2, y2)\n ctx.stroke()\n }\n\n // Calculate half-border widths\n const halfBt = borderTop / 2\n const halfBr = borderRight / 2\n const halfBb = borderBottom / 2\n const halfBl = borderLeft / 2\n\n // Calculate effective visual radii, clamped to half dimensions of the *layout box*\n const maxRadiusX = width / 2 // This matches CSS behavior where radius is relative to the box it's applied to.\n const maxRadiusY = height / 2\n const rTL = Math.max(0, Math.min(radii.TopLeft, maxRadiusX, maxRadiusY))\n const rTR = Math.max(0, Math.min(radii.TopRight, maxRadiusX, maxRadiusY))\n const rBR = Math.max(0, Math.min(radii.BottomRight, maxRadiusX, maxRadiusY))\n const rBL = Math.max(0, Math.min(radii.BottomLeft, maxRadiusX, maxRadiusY))\n\n // --- Draw border segments based on boxSizing ---\n // For content-box, coordinates are offset *outwards* from x, y, width, height\n if (boxSizing === Style.BoxSizing.ContentBox) {\n // Top line segment\n drawLine(x + rTL, y - halfBt, x + width - rTR, y - halfBt, borderTop)\n // Right line segment\n drawLine(x + width + halfBr, y + rTR, x + width + halfBr, y + height - rBR, borderRight)\n // Bottom line segment\n drawLine(x + width - rBR, y + height + halfBb, x + rBL, y + height + halfBb, borderBottom)\n // Left line segment\n drawLine(x - halfBl, y + height - rBL, x - halfBl, y + rTL, borderLeft)\n\n drawCornerArc(x + rTL, y + rTL, rTL, Math.PI, 1.5 * Math.PI, borderLeft, borderTop)\n drawCornerArc(x + width - rTR, y + rTR, rTR, 1.5 * Math.PI, 2 * Math.PI, borderTop, borderRight)\n drawCornerArc(x + width - rBR, y + height - rBR, rBR, 0, 0.5 * Math.PI, borderRight, borderBottom)\n drawCornerArc(x + rBL, y + height - rBL, rBL, 0.5 * Math.PI, Math.PI, borderBottom, borderLeft)\n } else {\n // For border-box, coordinates are offset *inwards* from x, y, width, height\n // Top line segment\n drawLine(x + rTL, y + halfBt, x + width - rTR, y + halfBt, borderTop)\n // Right line segment\n drawLine(x + width - halfBr, y + rTR, x + width - halfBr, y + height - rBR, borderRight)\n // Bottom line segment\n drawLine(x + width - rBR, y + height - halfBb, x + rBL, y + height - halfBb, borderBottom)\n // Left line segment\n drawLine(x + halfBl, y + height - rBL, x + halfBl, y + rTL, borderLeft)\n\n // Draw corner arcs (centers relative to layout box corners, adjusted for inward border)\n // Pass visual radius (rTL, rTR etc.) to drawCornerArc\n drawCornerArc(x + rTL, y + rTL, rTL, Math.PI, 1.5 * Math.PI, borderLeft, borderTop) // Top-Left\n drawCornerArc(x + width - rTR, y + rTR, rTR, 1.5 * Math.PI, 2 * Math.PI, borderTop, borderRight) // Top-Right\n drawCornerArc(x + width - rBR, y + height - rBR, rBR, 0, 0.5 * Math.PI, borderRight, borderBottom) // Bottom-Right\n drawCornerArc(x + rBL, y + height - rBL, rBL, 0.5 * Math.PI, Math.PI, borderBottom, borderLeft) // Bottom-Left\n }\n }\n}\n\n/**\n * Draws an optimized rounded rectangle path on the canvas context.\n * Automatically clamps radius values to prevent visual artifacts based on box dimensions.\n * Uses arc-based rendering for crisp corners and consistent border appearance.\n *\n * @param ctx - The canvas 2D rendering context to draw on\n * @param x - Left position of the rectangle\n * @param y - Top position of the rectangle\n * @param width - Width of the rectangle\n * @param height - Height of the rectangle\n * @param radii - Corner radius values for each corner. Values are clamped to box constraints.\n */\nexport const drawRoundedRectPath = (\n ctx: CanvasRenderingContext2D,\n x: number,\n y: number,\n width: number,\n height: number,\n radii: { TopLeft: number; TopRight: number; BottomRight: number; BottomLeft: number },\n) => {\n if (width <= 0 || height <= 0) {\n ctx.beginPath()\n ctx.rect(x, y, width, height)\n return\n }\n\n ctx.beginPath()\n\n // Clamp radius values to prevent visual artifacts\n const maxRadius = Math.min(width / 2, height / 2)\n const clampedTL = Math.max(0, Math.min(radii.TopLeft, maxRadius))\n const clampedTR = Math.max(0, Math.min(radii.TopRight, maxRadius))\n const clampedBR = Math.max(0, Math.min(radii.BottomRight, maxRadius))\n const clampedBL = Math.max(0, Math.min(radii.BottomLeft, maxRadius))\n\n ctx.moveTo(x + clampedTL, y)\n\n // Draw top edge and top-right corner\n ctx.lineTo(x + width - clampedTR, y)\n clampedTR > 0 ? ctx.arc(x + width - clampedTR, y + clampedTR, clampedTR, 1.5 * Math.PI, 0) : ctx.lineTo(x + width, y)\n\n // Draw right edge and bottom-right corner\n ctx.lineTo(x + width, y + height - clampedBR)\n clampedBR > 0\n ? ctx.arc(x + width - clampedBR, y + height - clampedBR, clampedBR, 0, 0.5 * Math.PI)\n : ctx.lineTo(x + width, y + height)\n\n // Draw bottom edge and bottom-left corner\n ctx.lineTo(x + clampedBL, y + height)\n clampedBL > 0\n ? ctx.arc(x + clampedBL, y + height - clampedBL, clampedBL, 0.5 * Math.PI, Math.PI)\n : ctx.lineTo(x, y + height)\n\n // Draw left edge and top-left corner\n ctx.lineTo(x, y + clampedTL)\n clampedTL > 0 ? ctx.arc(x + clampedTL, y + clampedTL, clampedTL, Math.PI, 1.5 * Math.PI) : ctx.lineTo(x, y)\n\n ctx.closePath()\n}\n\n/**\n * Calculates border radius values from props\n * @param radiusProp - Border radius property value\n * @returns Calculated border radii for all corners\n */\nexport const parseBorderRadius = (\n radiusProp: BoxProps['borderRadius'],\n): {\n TopLeft: number\n TopRight: number\n BottomRight: number\n BottomLeft: number\n} => {\n const radii = { TopLeft: 0, TopRight: 0, BottomRight: 0, BottomLeft: 0 }\n if (typeof radiusProp === 'number') {\n radii.TopLeft = radii.TopRight = radii.BottomRight = radii.BottomLeft = Math.max(0, radiusProp)\n } else if (typeof radiusProp === 'object' && radiusProp !== null) {\n radii.TopLeft = Math.max(0, radiusProp.TopLeft ?? 0)\n radii.TopRight = Math.max(0, radiusProp.TopRight ?? 0)\n radii.BottomRight = Math.max(0, radiusProp.BottomRight ?? 0)\n radii.BottomLeft = Math.max(0, radiusProp.BottomLeft ?? 0)\n }\n return radii\n}\n\n/**\n * Parses a percentage value or a number, returning the calculated value based on the base.\n *\n * @param value - The value to parse, can be a number, a percentage string, or undefined.\n * @param base - The base value to calculate the percentage from.\n * @returns The parsed number, or 0 if the value is not a number or a valid percentage.\n */\nexport function parsePercentage(value: number | string | undefined, base: number): number {\n if (typeof value === 'number') {\n return value\n }\n if (typeof value === 'string' && value.endsWith('%')) {\n return base !== 0 ? (parseFloat(value) / 100) * base : 0\n }\n return 0\n}\n"],"names":["YogaTypes","Style"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAKO,MAAM,WAAW,GAAG,CAAC,EAC1B,GAAG,EACH,IAAI,EACJ,CAAC,EACD,CAAC,EACD,KAAK,EACL,MAAM,EACN,KAAK,EACL,WAAW,EACX,WAAW,GAgBZ,KAAI;AACH,IAAA,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,CAACA,oBAAS,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC;IACzD,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,SAAS,CAACA,oBAAS,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,SAAS,CAAC;IAC9E,MAAM,WAAW,GAAG,IAAI,CA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