@meonode/canvas 1.0.0-beta.3 → 1.0.0-beta.5

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 (48) hide show
  1. package/Readme.md +1 -1
  2. package/dist/cjs/canvas/canvas.helper.d.ts +9 -11
  3. package/dist/cjs/canvas/canvas.helper.d.ts.map +1 -1
  4. package/dist/cjs/canvas/canvas.helper.js +47 -48
  5. package/dist/cjs/canvas/canvas.helper.js.map +1 -1
  6. package/dist/cjs/canvas/canvas.type.d.ts +31 -31
  7. package/dist/cjs/canvas/canvas.type.d.ts.map +1 -1
  8. package/dist/cjs/canvas/grid.canvas.util.d.ts +4 -4
  9. package/dist/cjs/canvas/grid.canvas.util.d.ts.map +1 -1
  10. package/dist/cjs/canvas/grid.canvas.util.js +21 -4
  11. package/dist/cjs/canvas/grid.canvas.util.js.map +1 -1
  12. package/dist/cjs/canvas/image.canvas.util.d.ts +0 -1
  13. package/dist/cjs/canvas/image.canvas.util.d.ts.map +1 -1
  14. package/dist/cjs/canvas/image.canvas.util.js +72 -72
  15. package/dist/cjs/canvas/image.canvas.util.js.map +1 -1
  16. package/dist/cjs/canvas/layout.canvas.util.d.ts +16 -17
  17. package/dist/cjs/canvas/layout.canvas.util.d.ts.map +1 -1
  18. package/dist/cjs/canvas/layout.canvas.util.js +17 -24
  19. package/dist/cjs/canvas/layout.canvas.util.js.map +1 -1
  20. package/dist/cjs/canvas/root.canvas.util.d.ts +4 -2
  21. package/dist/cjs/canvas/root.canvas.util.d.ts.map +1 -1
  22. package/dist/cjs/canvas/root.canvas.util.js +7 -3
  23. package/dist/cjs/canvas/root.canvas.util.js.map +1 -1
  24. package/dist/cjs/canvas/text.canvas.util.d.ts +20 -27
  25. package/dist/cjs/canvas/text.canvas.util.d.ts.map +1 -1
  26. package/dist/cjs/canvas/text.canvas.util.js +27 -45
  27. package/dist/cjs/canvas/text.canvas.util.js.map +1 -1
  28. package/dist/esm/canvas/canvas.helper.d.ts +9 -11
  29. package/dist/esm/canvas/canvas.helper.d.ts.map +1 -1
  30. package/dist/esm/canvas/canvas.helper.js +47 -48
  31. package/dist/esm/canvas/canvas.type.d.ts +31 -31
  32. package/dist/esm/canvas/canvas.type.d.ts.map +1 -1
  33. package/dist/esm/canvas/grid.canvas.util.d.ts +4 -4
  34. package/dist/esm/canvas/grid.canvas.util.d.ts.map +1 -1
  35. package/dist/esm/canvas/grid.canvas.util.js +21 -4
  36. package/dist/esm/canvas/image.canvas.util.d.ts +0 -1
  37. package/dist/esm/canvas/image.canvas.util.d.ts.map +1 -1
  38. package/dist/esm/canvas/image.canvas.util.js +72 -72
  39. package/dist/esm/canvas/layout.canvas.util.d.ts +16 -17
  40. package/dist/esm/canvas/layout.canvas.util.d.ts.map +1 -1
  41. package/dist/esm/canvas/layout.canvas.util.js +17 -24
  42. package/dist/esm/canvas/root.canvas.util.d.ts +4 -2
  43. package/dist/esm/canvas/root.canvas.util.d.ts.map +1 -1
  44. package/dist/esm/canvas/root.canvas.util.js +7 -3
  45. package/dist/esm/canvas/text.canvas.util.d.ts +20 -27
  46. package/dist/esm/canvas/text.canvas.util.d.ts.map +1 -1
  47. package/dist/esm/canvas/text.canvas.util.js +27 -45
  48. package/package.json +16 -9
package/Readme.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @meonode/canvas
2
2
 
3
- A declarative, component-based library for generating images on a canvas, inspired by the MeoNode UI library for React.
3
+ A declarative, component-based library for **server-side** generation of high-quality images on a canvas, inspired by the MeoNode UI library for React.
4
4
  It uses `skia-canvas` for drawing and `yoga-layout` for flexbox-based layouts.
5
5
 
6
6
  This library allows you to build complex image layouts using a familiar component-based approach. You can define your
@@ -21,13 +21,12 @@ export declare const drawBorders: ({ ctx, node, x, y, width, height, radii, bord
21
21
  * Draws an optimized rounded rectangle path on the canvas context.
22
22
  * Automatically clamps radius values to prevent visual artifacts based on box dimensions.
23
23
  * Uses arc-based rendering for crisp corners and consistent border appearance.
24
- *
25
- * @param ctx - The canvas 2D rendering context to draw on
26
- * @param x - Left position of the rectangle
27
- * @param y - Top position of the rectangle
28
- * @param width - Width of the rectangle
29
- * @param height - Height of the rectangle
30
- * @param radii - Corner radius values for each corner. Values are clamped to box constraints.
24
+ * @param ctx The canvas 2D rendering context to draw on
25
+ * @param x Left position of the rectangle
26
+ * @param y Top position of the rectangle
27
+ * @param width Width of the rectangle
28
+ * @param height Height of the rectangle
29
+ * @param radii Corner radius values for each corner. Values are clamped to box constraints.
31
30
  */
32
31
  export declare const drawRoundedRectPath: (ctx: CanvasRenderingContext2D, x: number, y: number, width: number, height: number, radii: {
33
32
  TopLeft: number;
@@ -37,7 +36,7 @@ export declare const drawRoundedRectPath: (ctx: CanvasRenderingContext2D, x: num
37
36
  }) => void;
38
37
  /**
39
38
  * Calculates border radius values from props
40
- * @param radiusProp - Border radius property value
39
+ * @param radiusProp Border radius property value
41
40
  * @returns Calculated border radii for all corners
42
41
  */
43
42
  export declare const parseBorderRadius: (radiusProp: BoxProps["borderRadius"]) => {
@@ -48,9 +47,8 @@ export declare const parseBorderRadius: (radiusProp: BoxProps["borderRadius"]) =
48
47
  };
49
48
  /**
50
49
  * Parses a percentage value or a number, returning the calculated value based on the base.
51
- *
52
- * @param value - The value to parse, can be a number, a percentage string, or undefined.
53
- * @param base - The base value to calculate the percentage from.
50
+ * @param value The value to parse, can be a number, a percentage string, or undefined.
51
+ * @param base The base value to calculate the percentage from.
54
52
  * @returns The parsed number, or 0 if the value is not a number or a valid percentage.
55
53
  */
56
54
  export declare function parsePercentage(value: number | string | undefined, base: number): number;
@@ -1 +1 @@
1
- {"version":3,"file":"canvas.helper.d.ts","sourceRoot":"","sources":["../../../src/canvas/canvas.helper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAA;AAC3D,OAAO,KAAK,SAAS,MAAM,aAAa,CAAA;AAExC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAA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S,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAQxF"}
@@ -35,25 +35,31 @@ const drawBorders = ({ ctx, node, x, y, width, height, radii, borderColor, borde
35
35
  ctx.lineCap = 'butt';
36
36
  ctx.lineJoin = 'miter'; // Use miter for sharp corners unless rounded
37
37
  const setDash = (width) => {
38
- if (borderStyle === common_const.Style.Border.Dashed && width > 0) {
38
+ if (borderStyle === common_const.Style.Border.Dotted && width > 0) {
39
+ // Dotted: tight spacing with round caps for circular dots
40
+ ctx.lineCap = 'round';
41
+ ctx.setLineDash([0, width * 2]); // 0-length dash with spacing creates dots with round caps
42
+ }
43
+ else if (borderStyle === common_const.Style.Border.Dashed && width > 0) {
44
+ ctx.lineCap = 'butt';
39
45
  const dashLength = Math.max(2, width * 1.5);
40
46
  const gapLength = Math.max(1, width);
41
47
  ctx.setLineDash([dashLength, gapLength]);
42
48
  }
43
49
  else {
50
+ ctx.lineCap = 'butt';
44
51
  ctx.setLineDash([]); // Solid line
45
52
  }
46
53
  };
47
54
  /**
48
55
  * 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.
56
+ * @param cx The x-coordinate of the visual center of the corner curve.
57
+ * @param cy The y-coordinate of the visual center of the corner curve.
58
+ * @param radius The visual radius of the corner curve.
59
+ * @param startAngle The starting angle of the arc in radians.
60
+ * @param endAngle The ending angle of the arc in radians.
61
+ * @param border1 The border width leading into the corner.
62
+ * @param border2 The border width leading out of the corner.
57
63
  */
58
64
  const drawCornerArc = (cx, cy, radius, startAngle, endAngle, border1, border2) => {
59
65
  if (radius <= 0)
@@ -89,12 +95,11 @@ const drawBorders = ({ ctx, node, x, y, width, height, radii, borderColor, borde
89
95
  };
90
96
  /**
91
97
  * 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
+ * @param x1 The x-coordinate of the starting point.
99
+ * @param y1 The y-coordinate of the starting point.
100
+ * @param x2 The x-coordinate of the ending point.
101
+ * @param y2 The y-coordinate of the ending point.
102
+ * @param borderWidth The width of the border.
98
103
  */
99
104
  const drawLine = (x1, y1, x2, y2, borderWidth) => {
100
105
  if (borderWidth <= 0)
@@ -122,34 +127,34 @@ const drawBorders = ({ ctx, node, x, y, width, height, radii, borderColor, borde
122
127
  // For content-box, coordinates are offset *outwards* from x, y, width, height
123
128
  if (boxSizing === common_const.Style.BoxSizing.ContentBox) {
124
129
  // Top line segment
125
- drawLine(x + rTL, y - halfBt, x + width - rTR, y - halfBt, borderTop);
130
+ void drawLine(x + rTL, y - halfBt, x + width - rTR, y - halfBt, borderTop);
126
131
  // Right line segment
127
- drawLine(x + width + halfBr, y + rTR, x + width + halfBr, y + height - rBR, borderRight);
132
+ void drawLine(x + width + halfBr, y + rTR, x + width + halfBr, y + height - rBR, borderRight);
128
133
  // Bottom line segment
129
- drawLine(x + width - rBR, y + height + halfBb, x + rBL, y + height + halfBb, borderBottom);
134
+ void drawLine(x + width - rBR, y + height + halfBb, x + rBL, y + height + halfBb, borderBottom);
130
135
  // 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
+ void drawLine(x - halfBl, y + height - rBL, x - halfBl, y + rTL, borderLeft);
137
+ void drawCornerArc(x + rTL, y + rTL, rTL, Math.PI, 1.5 * Math.PI, borderLeft, borderTop);
138
+ void drawCornerArc(x + width - rTR, y + rTR, rTR, 1.5 * Math.PI, 2 * Math.PI, borderTop, borderRight);
139
+ void drawCornerArc(x + width - rBR, y + height - rBR, rBR, 0, 0.5 * Math.PI, borderRight, borderBottom);
140
+ void drawCornerArc(x + rBL, y + height - rBL, rBL, 0.5 * Math.PI, Math.PI, borderBottom, borderLeft);
136
141
  }
137
142
  else {
138
143
  // For border-box, coordinates are offset *inwards* from x, y, width, height
139
144
  // Top line segment
140
- drawLine(x + rTL, y + halfBt, x + width - rTR, y + halfBt, borderTop);
145
+ void drawLine(x + rTL, y + halfBt, x + width - rTR, y + halfBt, borderTop);
141
146
  // Right line segment
142
- drawLine(x + width - halfBr, y + rTR, x + width - halfBr, y + height - rBR, borderRight);
147
+ void drawLine(x + width - halfBr, y + rTR, x + width - halfBr, y + height - rBR, borderRight);
143
148
  // Bottom line segment
144
- drawLine(x + width - rBR, y + height - halfBb, x + rBL, y + height - halfBb, borderBottom);
149
+ void drawLine(x + width - rBR, y + height - halfBb, x + rBL, y + height - halfBb, borderBottom);
145
150
  // Left line segment
146
- drawLine(x + halfBl, y + height - rBL, x + halfBl, y + rTL, borderLeft);
151
+ void drawLine(x + halfBl, y + height - rBL, x + halfBl, y + rTL, borderLeft);
147
152
  // Draw corner arcs (centers relative to layout box corners, adjusted for inward border)
148
153
  // 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
154
+ void drawCornerArc(x + rTL, y + rTL, rTL, Math.PI, 1.5 * Math.PI, borderLeft, borderTop); // Top-Left
155
+ void drawCornerArc(x + width - rTR, y + rTR, rTR, 1.5 * Math.PI, 2 * Math.PI, borderTop, borderRight); // Top-Right
156
+ void drawCornerArc(x + width - rBR, y + height - rBR, rBR, 0, 0.5 * Math.PI, borderRight, borderBottom); // Bottom-Right
157
+ void drawCornerArc(x + rBL, y + height - rBL, rBL, 0.5 * Math.PI, Math.PI, borderBottom, borderLeft); // Bottom-Left
153
158
  }
154
159
  }
155
160
  };
@@ -157,13 +162,12 @@ const drawBorders = ({ ctx, node, x, y, width, height, radii, borderColor, borde
157
162
  * Draws an optimized rounded rectangle path on the canvas context.
158
163
  * Automatically clamps radius values to prevent visual artifacts based on box dimensions.
159
164
  * 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.
165
+ * @param ctx The canvas 2D rendering context to draw on
166
+ * @param x Left position of the rectangle
167
+ * @param y Top position of the rectangle
168
+ * @param width Width of the rectangle
169
+ * @param height Height of the rectangle
170
+ * @param radii Corner radius values for each corner. Values are clamped to box constraints.
167
171
  */
168
172
  const drawRoundedRectPath = (ctx, x, y, width, height, radii) => {
169
173
  if (width <= 0 || height <= 0) {
@@ -184,14 +188,10 @@ const drawRoundedRectPath = (ctx, x, y, width, height, radii) => {
184
188
  clampedTR > 0 ? ctx.arc(x + width - clampedTR, y + clampedTR, clampedTR, 1.5 * Math.PI, 0) : ctx.lineTo(x + width, y);
185
189
  // Draw right edge and bottom-right corner
186
190
  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);
191
+ clampedBR > 0 ? ctx.arc(x + width - clampedBR, y + height - clampedBR, clampedBR, 0, 0.5 * Math.PI) : ctx.lineTo(x + width, y + height);
190
192
  // Draw bottom edge and bottom-left corner
191
193
  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);
194
+ clampedBL > 0 ? ctx.arc(x + clampedBL, y + height - clampedBL, clampedBL, 0.5 * Math.PI, Math.PI) : ctx.lineTo(x, y + height);
195
195
  // Draw left edge and top-left corner
196
196
  ctx.lineTo(x, y + clampedTL);
197
197
  clampedTL > 0 ? ctx.arc(x + clampedTL, y + clampedTL, clampedTL, Math.PI, 1.5 * Math.PI) : ctx.lineTo(x, y);
@@ -199,7 +199,7 @@ const drawRoundedRectPath = (ctx, x, y, width, height, radii) => {
199
199
  };
200
200
  /**
201
201
  * Calculates border radius values from props
202
- * @param radiusProp - Border radius property value
202
+ * @param radiusProp Border radius property value
203
203
  * @returns Calculated border radii for all corners
204
204
  */
205
205
  const parseBorderRadius = (radiusProp) => {
@@ -217,9 +217,8 @@ const parseBorderRadius = (radiusProp) => {
217
217
  };
218
218
  /**
219
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.
220
+ * @param value The value to parse, can be a number, a percentage string, or undefined.
221
+ * @param base The base value to calculate the percentage from.
223
222
  * @returns The parsed number, or 0 if the value is not a number or a valid percentage.
224
223
  */
225
224
  function parsePercentage(value, base) {
@@ -1 +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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AC,WAAW,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,UAAU,CAAC,WAAW,IAAI,CAAC,CAAC;AAC5D,QAAA,KAAK,CAAC,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,UAAU,CAAC,UAAU,IAAI,CAAC,CAAC;IAC5D;AACA,IAAA,OAAO,KAAK;AACd;AAEA;;;;;;AAMG;AACG,SAAU,eAAe,CAAC,KAAkC,EAAE,IAAY,EAAA;AAC9E,IAAA,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;AAC7B,QAAA,OAAO,KAAK;IACd;AACA,IAAA,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;QACpD,OAAO,IAAI,KAAK,CAAC,GAAG,CAAC,UAAU,CAAC,KAAK,CAAC,GAAG,GAAG,IAAI,IAAI,GAAG,CAAC;IAC1D;AACA,IAAA,OAAO,CAAC;AACV;;;;;;;"}
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.Dotted && width > 0) {\n // Dotted: tight spacing with round caps for circular dots\n ctx.lineCap = 'round'\n ctx.setLineDash([0, width * 2]) // 0-length dash with spacing creates dots with round caps\n } else if (borderStyle === Style.Border.Dashed && width > 0) {\n ctx.lineCap = 'butt'\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.lineCap = 'butt'\n ctx.setLineDash([]) // Solid line\n }\n }\n\n /**\n * Draws a rounded corner arc for the border.\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 = (cx: number, cy: number, radius: number, startAngle: number, endAngle: number, border1: number, border2: number) => {\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 * @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 void drawLine(x + rTL, y - halfBt, x + width - rTR, y - halfBt, borderTop)\n // Right line segment\n void drawLine(x + width + halfBr, y + rTR, x + width + halfBr, y + height - rBR, borderRight)\n // Bottom line segment\n void drawLine(x + width - rBR, y + height + halfBb, x + rBL, y + height + halfBb, borderBottom)\n // Left line segment\n void drawLine(x - halfBl, y + height - rBL, x - halfBl, y + rTL, borderLeft)\n\n void drawCornerArc(x + rTL, y + rTL, rTL, Math.PI, 1.5 * Math.PI, borderLeft, borderTop)\n void drawCornerArc(x + width - rTR, y + rTR, rTR, 1.5 * Math.PI, 2 * Math.PI, borderTop, borderRight)\n void drawCornerArc(x + width - rBR, y + height - rBR, rBR, 0, 0.5 * Math.PI, borderRight, borderBottom)\n void 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 void drawLine(x + rTL, y + halfBt, x + width - rTR, y + halfBt, borderTop)\n // Right line segment\n void drawLine(x + width - halfBr, y + rTR, x + width - halfBr, y + height - rBR, borderRight)\n // Bottom line segment\n void drawLine(x + width - rBR, y + height - halfBb, x + rBL, y + height - halfBb, borderBottom)\n // Left line segment\n void 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 void drawCornerArc(x + rTL, y + rTL, rTL, Math.PI, 1.5 * Math.PI, borderLeft, borderTop) // Top-Left\n void drawCornerArc(x + width - rTR, y + rTR, rTR, 1.5 * Math.PI, 2 * Math.PI, borderTop, borderRight) // Top-Right\n void drawCornerArc(x + width - rBR, y + height - rBR, rBR, 0, 0.5 * Math.PI, borderRight, borderBottom) // Bottom-Right\n void 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 * @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 ? ctx.arc(x + width - clampedBR, y + height - clampedBR, clampedBR, 0, 0.5 * Math.PI) : 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 ? ctx.arc(x + clampedBL, y + height - clampedBL, clampedBL, 0.5 * Math.PI, Math.PI) : 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 * @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,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,SAAS,CAACA,oB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AAQ,IAAI,CAAC,CAAC;AACtD,QAAA,KAAK,CAAC,WAAW,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,UAAU,CAAC,WAAW,IAAI,CAAC,CAAC;AAC5D,QAAA,KAAK,CAAC,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,UAAU,CAAC,UAAU,IAAI,CAAC,CAAC;IAC5D;AACA,IAAA,OAAO,KAAK;AACd;AAEA;;;;;AAKG;AACG,SAAU,eAAe,CAAC,KAAkC,EAAE,IAAY,EAAA;AAC9E,IAAA,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;AAC7B,QAAA,OAAO,KAAK;IACd;AACA,IAAA,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;QACpD,OAAO,IAAI,KAAK,CAAC,GAAG,CAAC,UAAU,CAAC,KAAK,CAAC,GAAG,GAAG,IAAI,IAAI,GAAG,CAAC;IAC1D;AACA,IAAA,OAAO,CAAC;AACV;;;;;;;"}
@@ -1,10 +1,9 @@
1
- import * as StylePropTypes from 'yoga-layout';
2
1
  import { BoxNode } from '../canvas/layout.canvas.util.js';
3
2
  import type { TextNode } from '../canvas/text.canvas.util.js';
4
3
  import type { ImageNode } from '../canvas/image.canvas.util.js';
5
4
  import type { GridNode } from '../canvas/grid.canvas.util.js';
6
5
  import type { FontVariantSetting } from 'skia-canvas';
7
- import { Style } from '../constant/common.const.js';
6
+ import * as Style from '../constant/common.const.js';
8
7
  export interface BaseProps {
9
8
  /**
10
9
  * Optional display name for debugging purposes.
@@ -156,40 +155,40 @@ export interface BoxProps extends BaseProps {
156
155
  maxHeight?: number | `${number}%`;
157
156
  /**
158
157
  * Defines the direction of the main axis for flex items within this container.
159
- * @see StylePropTypes.FlexDirection (`COLUMN`, `ROW`, `COLUMN_REVERSE`, `ROW_REVERSE`)
158
+ * @see Style.FlexDirection (`COLUMN`, `ROW`, `COLUMN_REVERSE`, `ROW_REVERSE`)
160
159
  * @default Yoga default (`COLUMN`)
161
160
  * @see https://yogalayout.dev/docs/styling/flex-direction
162
161
  */
163
- flexDirection?: StylePropTypes.FlexDirection;
162
+ flexDirection?: Style.FlexDirection;
164
163
  /**
165
164
  * Defines how flex items are distributed along the main axis of the container.
166
- * @see StylePropTypes.Justify (`FLEX_START`, `CENTER`, `FLEX_END`, `SPACE_BETWEEN`, `SPACE_AROUND`, `SPACE_EVENLY`)
165
+ * @see Style.Justify (`FLEX_START`, `CENTER`, `FLEX_END`, `SPACE_BETWEEN`, `SPACE_AROUND`, `SPACE_EVENLY`)
167
166
  * @default Yoga default (`FLEX_START`)
168
167
  * @see https://yogalayout.dev/docs/styling/justify-content
169
168
  */
170
- justifyContent?: StylePropTypes.Justify;
169
+ justifyContent?: Style.Justify;
171
170
  /**
172
171
  * Defines how flex items are aligned along the cross axis of the container.
173
- * @see StylePropTypes.Align (`AUTO`, `FLEX_START`, `CENTER`, `FLEX_END`, `STRETCH`, `BASELINE`, `SPACE_BETWEEN`, `SPACE_AROUND`)
172
+ * @see Style.Align (`AUTO`, `FLEX_START`, `CENTER`, `FLEX_END`, `STRETCH`, `BASELINE`, `SPACE_BETWEEN`, `SPACE_AROUND`)
174
173
  * @default Yoga default (`STRETCH`)
175
174
  * @see https://yogalayout.dev/docs/styling/align-items-self
176
175
  */
177
- alignItems?: StylePropTypes.Align;
176
+ alignItems?: Style.Align;
178
177
  /**
179
178
  * Allows overriding the parent's `alignItems` value for a specific flex item.
180
- * @see StylePropTypes.Align (`AUTO`, `FLEX_START`, `CENTER`, `FLEX_END`, `STRETCH`, `BASELINE`, `SPACE_BETWEEN`, `SPACE_AROUND`)
179
+ * @see Style.Align (`AUTO`, `FLEX_START`, `CENTER`, `FLEX_END`, `STRETCH`, `BASELINE`, `SPACE_BETWEEN`, `SPACE_AROUND`)
181
180
  * @default Yoga default (`AUTO`) - Inherits from `alignItems`.
182
181
  * @see https://yogalayout.dev/docs/styling/align-items-self
183
182
  */
184
- alignSelf?: StylePropTypes.Align;
183
+ alignSelf?: Style.Align;
185
184
  /**
186
185
  * Defines how lines are distributed along the cross axis when `flexWrap` is `WRAP` or `WRAP_REVERSE`.
187
186
  * Has no effect when there is only one line of flex items.
188
- * @see StylePropTypes.Align (`AUTO`, `FLEX_START`, `CENTER`, `FLEX_END`, `STRETCH`, `BASELINE`, `SPACE_BETWEEN`, `SPACE_AROUND`)
187
+ * @see Style.Align (`AUTO`, `FLEX_START`, `CENTER`, `FLEX_END`, `STRETCH`, `BASELINE`, `SPACE_BETWEEN`, `SPACE_AROUND`)
189
188
  * @default Yoga default (`FLEX_START`)
190
189
  * @see https://yogalayout.dev/docs/styling/align-content
191
190
  */
192
- alignContent?: StylePropTypes.Align;
191
+ alignContent?: Style.Align;
193
192
  /**
194
193
  * Defines the ability of a flex item to grow if necessary, relative to other items.
195
194
  * A non-negative number indicating the proportion of available space the item should take.
@@ -215,11 +214,11 @@ export interface BoxProps extends BaseProps {
215
214
  * Specifies the positioning method used for the node.
216
215
  * `RELATIVE`: Positioned according to the normal flow, then offset relative to that position.
217
216
  * `ABSOLUTE`: Positioned relative to its nearest positioned ancestor (or the root). Layout calculation ignores this node.
218
- * @see StylePropTypes.PositionType (`RELATIVE`, `ABSOLUTE`)
217
+ * @see Style.PositionType (`RELATIVE`, `ABSOLUTE`)
219
218
  * @default Yoga default (`RELATIVE`)
220
219
  * @see https://yogalayout.dev/docs/styling/position
221
220
  */
222
- positionType?: StylePropTypes.PositionType;
221
+ positionType?: Style.PositionType;
223
222
  /**
224
223
  * Specifies the offset distances for positioned elements (`positionType: 'ABSOLUTE'` or `RELATIVE`).
225
224
  * Can be a single number for all edges or an object specifying individual edges (`Top`, `Right`, `Bottom`, `Left`, `Start`, `End`).
@@ -228,7 +227,7 @@ export interface BoxProps extends BaseProps {
228
227
  * @default Yoga default (undefined for each edge)
229
228
  * @see https://yogalayout.dev/docs/styling/position
230
229
  */
231
- position?: Partial<Record<keyof typeof StylePropTypes.Edge, number | `${number}%`>> | number | `${number}%`;
230
+ position?: Partial<Record<keyof typeof Style.Edge, number | `${number}%`>> | number | `${number}%`;
232
231
  /**
233
232
  * Sets the margin space on the outside of the node's border.
234
233
  * Can be a single number for all edges or an object specifying individual edges.
@@ -236,7 +235,7 @@ export interface BoxProps extends BaseProps {
236
235
  * @default Yoga default (0 for each edge)
237
236
  * @see https://yogalayout.dev/docs/styling/margin-padding-border
238
237
  */
239
- margin?: Partial<Record<keyof typeof StylePropTypes.Edge, number | `${number}%` | 'auto'>> | number | `${number}%` | 'auto';
238
+ margin?: Partial<Record<keyof typeof Style.Edge, number | `${number}%` | 'auto'>> | number | `${number}%` | 'auto';
240
239
  /**
241
240
  * Sets the padding space on the inside of the node's border, around the content.
242
241
  * Can be a single number for all edges or an object specifying individual edges.
@@ -244,7 +243,7 @@ export interface BoxProps extends BaseProps {
244
243
  * @default Yoga default (0 for each edge)
245
244
  * @see https://yogalayout.dev/docs/styling/margin-padding-border
246
245
  */
247
- padding?: Partial<Record<keyof typeof StylePropTypes.Edge, number | `${number}%`>> | number | `${number}%`;
246
+ padding?: Partial<Record<keyof typeof Style.Edge, number | `${number}%`>> | number | `${number}%`;
248
247
  /**
249
248
  * Sets the width of the node's border.
250
249
  * Can be a single number for all edges or an object specifying individual edges.
@@ -252,7 +251,7 @@ export interface BoxProps extends BaseProps {
252
251
  * @default Yoga default (0 for each edge)
253
252
  * @see https://yogalayout.dev/docs/styling/margin-padding-border
254
253
  */
255
- border?: Partial<Record<keyof typeof StylePropTypes.Edge, number>> | number;
254
+ border?: Partial<Record<keyof typeof Style.Edge, number>> | number;
256
255
  /**
257
256
  * Sets the color of the node's border.
258
257
  * Accepts standard CSS color strings (e.g., 'red', '#FF0000', 'rgba(255,0,0,0.5)').
@@ -263,9 +262,10 @@ export interface BoxProps extends BaseProps {
263
262
  * Sets the style of the node's border.
264
263
  * @see Style.Border.Solid (0)
265
264
  * @see Style.Border.Dashed (1)
265
+ * @see Style.Border.Dotted (2)
266
266
  * @default Style.Border.Solid (set in BoxNode constructor)
267
267
  */
268
- borderStyle?: typeof Style.Border.Solid | typeof Style.Border.Dashed;
268
+ borderStyle?: typeof Style.Border.Solid | typeof Style.Border.Dashed | typeof Style.Border.Dotted;
269
269
  /**
270
270
  * Sets the radius of the node's corners, creating rounded effects.
271
271
  * Can be a single number for all corners or an object specifying individual corners (`TopLeft`, `TopRight`, `BottomLeft`, `BottomRight`).
@@ -291,51 +291,51 @@ export interface BoxProps extends BaseProps {
291
291
  * `VISIBLE`: Content is not clipped and may render outside the node's box.
292
292
  * `HIDDEN`: Content is clipped and the rest is invisible.
293
293
  * `SCROLL`: Content is clipped, but Yoga calculates layout as if it were visible (used for scrollable containers, though an actual scrolling mechanism is external).
294
- * @see StylePropTypes.Overflow (`VISIBLE`, `HIDDEN`, `SCROLL`)
294
+ * @see Style.Overflow (`VISIBLE`, `HIDDEN`, `SCROLL`)
295
295
  * @default Yoga default (`VISIBLE`)
296
296
  * @see https://yogalayout.dev/docs/styling/overflow
297
297
  */
298
- overflow?: StylePropTypes.Overflow;
298
+ overflow?: Style.Overflow;
299
299
  /**
300
300
  * Controls whether the node and its children are included in the layout calculation and rendering.
301
301
  * `FLEX`: The node participates in a flex layout.
302
302
  * `NONE`: The node and its subtree are ignored by layout and rendering.
303
- * @see StylePropTypes.Display (`FLEX`, `NONE`)
303
+ * @see Style.Display (`FLEX`, `NONE`)
304
304
  * @default Yoga default (`FLEX`)
305
305
  * @see https://yogalayout.dev/docs/styling/display
306
306
  */
307
- display?: StylePropTypes.Display;
307
+ display?: Style.Display;
308
308
  /**
309
309
  * Sets the primary text and layout direction (Left-to-Right or Right-to-Left).
310
310
  * Affects the meaning of `Start` and `End` edges for properties like `position`, `margin`, `padding`, `border`.
311
311
  * `INHERIT`: Uses the direction of the parent node.
312
- * @see StylePropTypes.Direction (`INHERIT`, `LTR`, `RTL`)
312
+ * @see Style.Direction (`INHERIT`, `LTR`, `RTL`)
313
313
  * @default `Style.DIRECTION_LTR` (set in `setLayout`)
314
314
  * @see https://yogalayout.dev/docs/styling/layout-direction
315
315
  */
316
- direction?: StylePropTypes.Direction;
316
+ direction?: Style.Direction;
317
317
  /**
318
318
  * Controls whether flex items are forced onto a single line or can wrap onto multiple lines.
319
- * @see StylePropTypes.Wrap (`NO_WRAP`, `WRAP`, `WRAP_REVERSE`)
319
+ * @see Style.Wrap (`NO_WRAP`, `WRAP`, `WRAP_REVERSE`)
320
320
  * @default Yoga default (`NO_WRAP`)
321
321
  * @see https://yogalayout.dev/docs/styling/flex-wrap
322
322
  */
323
- flexWrap?: StylePropTypes.Wrap;
323
+ flexWrap?: Style.Wrap;
324
324
  /**
325
325
  * Defines the space between flex items along the main axis.
326
326
  * @unit Pixels.
327
327
  * @default Yoga default (0)
328
328
  * @see https://yogalayout.dev/docs/styling/gap
329
329
  */
330
- gap?: Partial<Record<keyof typeof StylePropTypes.Gutter, number | `${number}%`>> | number | `${number}%`;
330
+ gap?: Partial<Record<keyof typeof Style.Gutter, number | `${number}%`>> | number | `${number}%`;
331
331
  /**
332
332
  * Defines how the `width` and `height` properties are interpreted regarding padding and border.
333
333
  * `CONTENT_BOX`: Width/height apply only to the content area. Padding and border are added outside.
334
334
  * `BORDER_BOX`: Width/height include content, padding, and border.
335
- * @see StylePropTypes.BoxSizing (`CONTENT_BOX`, `BORDER_BOX`)
335
+ * @see Style.BoxSizing (`CONTENT_BOX`, `BORDER_BOX`)
336
336
  * @default `Style.BOX_SIZING_BORDER_BOX` (set in `setLayout`)
337
337
  */
338
- boxSizing?: StylePropTypes.BoxSizing;
338
+ boxSizing?: Style.BoxSizing;
339
339
  /**
340
340
  * Sets the background color of the node. Drawn beneath the content and padding, extending to the border edge.
341
341
  * Accepts standard CSS color strings.
@@ -650,7 +650,7 @@ export interface ImageProps extends Omit<BoxProps, 'children'> {
650
650
  onLoad?: () => void;
651
651
  /**
652
652
  * Callback function that executes when the image fails to load.
653
- * @param error - The error that occurred during loading.
653
+ * @param error The error that occurred during loading.
654
654
  */
655
655
  onError?: (error: Error) => void;
656
656
  }
@@ -1 +1 @@
1
- {"version":3,"file":"canvas.type.d.ts","sourceRoot":"","sources":["../../../src/canvas/canvas.type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,cAAc,MAAM,aAAa,CAAA;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAA;AACxD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAA;AAC5D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAA;AAC9D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAA;AAC5D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AACrD,OAAO,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAA;AAElD,MAAM,WAAW,SAAS;IACxB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IACb;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAA;CACb;AAED,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,SAAS,GAAG,QAAQ,GAAG,KAAK,GAAG,SAAS,CAAA;AAEpF,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,MAAM,CAAA;IACd,KAAK,EAAE,MAAM,EAAE,CAAA;CAChB;AAED;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B;;;;;OAKG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,GAAG,MAAM,GAAG,CAAA;IAClC;;;;;OAKG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,GAAG,MAAM,GAAG,CAAA;IAClC;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IACf;;;;;OAKG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IACf;;;OAGG;IACH,MAAM,CAAC,EAAE,MAA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,CAAC,EAAE,MAAM,CAAA;IAEZ;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,IAAI,CAAA;IAEnB;;;OAGG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAA;CACjC"}
@@ -12,14 +12,14 @@ export declare class GridNode extends RowNode {
12
12
  private readonly isVertical;
13
13
  /**
14
14
  * Creates a new grid layout node
15
- * @param props - Grid configuration properties
15
+ * @param props Grid configuration properties
16
16
  */
17
17
  constructor(props: GridProps);
18
18
  /**
19
19
  * Appends a child node to this grid.
20
20
  * Overridden primarily for documentation/clarity, functionality is inherited.
21
- * @param child - Child node to append
22
- * @param index - Index at which to insert the child
21
+ * @param child Child node to append
22
+ * @param index Index at which to insert the child
23
23
  */
24
24
  protected appendChild(child: BoxNode, index: number): void;
25
25
  /**
@@ -32,7 +32,7 @@ export declare class GridNode extends RowNode {
32
32
  }
33
33
  /**
34
34
  * Factory function to create a new GridNode instance.
35
- * @param props - Grid configuration properties.
35
+ * @param props Grid configuration properties.
36
36
  * @returns A new GridNode instance.
37
37
  */
38
38
  export declare const Grid: (props: GridProps) => GridNode;
@@ -1 +1 @@
1
- {"version":3,"file":"grid.canvas.util.d.ts","sourceRoot":"","sources":["../../../src/canvas/grid.canvas.util.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACxD,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAA;AAGjE;;;;GAIG;AACH,qBAAa,QAAS,SAAQ,OAAO;IACnC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAQ;IAChC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAuB;IACtD,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAuB;IACnD,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAS;IAEpC;;;OAGG;gBACS,KAAK,EAAE,SAAS;IAsD5B;;;;;OAKG;cACgB,WAAW,C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