p5 2.0.1 → 2.0.2

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 (160) hide show
  1. package/dist/accessibility/color_namer.js +5 -5
  2. package/dist/accessibility/describe.js +10 -0
  3. package/dist/accessibility/index.js +5 -5
  4. package/dist/accessibility/outputs.js +21 -0
  5. package/dist/app.js +5 -5
  6. package/dist/color/color_conversion.js +5 -5
  7. package/dist/color/creating_reading.js +1 -1
  8. package/dist/color/index.js +2 -2
  9. package/dist/color/p5.Color.js +1 -1
  10. package/dist/color/setting.js +2 -2
  11. package/dist/{constants-C-g_eAdC.js → constants-tYr0tCl8.js} +19 -3
  12. package/dist/core/constants.js +1 -1
  13. package/dist/core/environment.js +6 -5
  14. package/dist/core/friendly_errors/fes_core.js +1 -1
  15. package/dist/core/friendly_errors/index.js +1 -1
  16. package/dist/core/friendly_errors/param_validator.js +41 -75
  17. package/dist/core/friendly_errors/sketch_reader.js +5 -5
  18. package/dist/core/friendly_errors/sketch_verifier.js +1 -1
  19. package/dist/core/friendly_errors/validate_params.js +5 -5
  20. package/dist/core/helpers.js +1 -1
  21. package/dist/core/init.js +5 -5
  22. package/dist/core/legacy.js +5 -5
  23. package/dist/core/main.js +5 -5
  24. package/dist/core/p5.Graphics.js +4 -4
  25. package/dist/core/p5.Renderer.js +3 -3
  26. package/dist/core/p5.Renderer2D.js +5 -5
  27. package/dist/core/rendering.js +4 -4
  28. package/dist/{creating_reading-D4AAKRbx.js → creating_reading-Cr8L2Jnm.js} +2 -2
  29. package/dist/dom/dom.js +10 -10
  30. package/dist/dom/index.js +2 -2
  31. package/dist/dom/p5.Element.js +2 -2
  32. package/dist/dom/p5.MediaElement.js +2 -2
  33. package/dist/events/acceleration.js +24 -24
  34. package/dist/events/keyboard.js +1 -2
  35. package/dist/image/const.js +1 -1
  36. package/dist/image/filterRenderer2D.js +4 -4
  37. package/dist/image/image.js +4 -4
  38. package/dist/image/index.js +4 -4
  39. package/dist/image/loading_displaying.js +4 -4
  40. package/dist/image/p5.Image.js +3 -3
  41. package/dist/image/pixels.js +1 -0
  42. package/dist/io/files.js +4 -4
  43. package/dist/io/index.js +4 -4
  44. package/dist/io/p5.TableRow.js +2 -2
  45. package/dist/{main-s72KWcUy.js → main-CAxvgiOV.js} +12 -9
  46. package/dist/math/Matrices/Matrix.js +1 -1
  47. package/dist/math/Matrices/MatrixNumjs.js +1 -1
  48. package/dist/math/index.js +1 -1
  49. package/dist/math/math.js +1 -1
  50. package/dist/math/p5.Matrix.js +1 -1
  51. package/dist/math/p5.Vector.js +1 -1
  52. package/dist/math/trigonometry.js +1 -1
  53. package/dist/{p5.Renderer-CwAYZOC2.js → p5.Renderer-Swjl9HQO.js} +5 -5
  54. package/dist/{rendering--aAe5aq3.js → rendering-B5TRR7aY.js} +101 -66
  55. package/dist/shape/2d_primitives.js +1 -1
  56. package/dist/shape/attributes.js +1 -1
  57. package/dist/shape/custom_shapes.js +2 -2
  58. package/dist/shape/index.js +2 -2
  59. package/dist/type/index.js +3 -3
  60. package/dist/type/p5.Font.js +3 -5
  61. package/dist/type/textCore.js +4 -4
  62. package/dist/webgl/3d_primitives.js +4 -4
  63. package/dist/webgl/GeometryBuilder.js +1 -1
  64. package/dist/webgl/ShapeBuilder.js +1 -1
  65. package/dist/webgl/index.js +4 -4
  66. package/dist/webgl/interaction.js +1 -1
  67. package/dist/webgl/light.js +4 -4
  68. package/dist/webgl/loading.js +4 -4
  69. package/dist/webgl/material.js +4 -4
  70. package/dist/webgl/p5.Camera.js +4 -4
  71. package/dist/webgl/p5.Framebuffer.js +4 -4
  72. package/dist/webgl/p5.Geometry.js +1 -1
  73. package/dist/webgl/p5.Quat.js +1 -1
  74. package/dist/webgl/p5.RendererGL.js +4 -4
  75. package/dist/webgl/p5.Shader.js +4 -4
  76. package/dist/webgl/p5.Texture.js +4 -4
  77. package/dist/webgl/text.js +32 -34
  78. package/lib/p5.esm.js +273 -225
  79. package/lib/p5.js +273 -225
  80. package/lib/p5.min.js +1 -1
  81. package/package.json +1 -2
  82. package/types/accessibility/color_namer.d.ts +8 -0
  83. package/types/accessibility/describe.d.ts +184 -0
  84. package/types/accessibility/gridOutput.d.ts +8 -0
  85. package/types/accessibility/outputs.d.ts +235 -0
  86. package/types/accessibility/textOutput.d.ts +8 -0
  87. package/types/color/color_conversion.d.ts +47 -0
  88. package/types/color/creating_reading.d.ts +1348 -0
  89. package/types/color/p5.Color.d.ts +1070 -0
  90. package/types/color/setting.d.ts +2085 -0
  91. package/types/core/constants.d.ts +341 -0
  92. package/types/core/environment.d.ts +668 -0
  93. package/types/core/friendly_errors/fes_core.d.ts +8 -0
  94. package/types/core/friendly_errors/file_errors.d.ts +8 -0
  95. package/types/core/friendly_errors/param_validator.d.ts +30 -0
  96. package/types/core/friendly_errors/sketch_reader.d.ts +8 -0
  97. package/types/core/friendly_errors/stacktrace.d.ts +11 -0
  98. package/types/core/friendly_errors/validate_params.d.ts +8 -0
  99. package/types/core/helpers.d.ts +8 -0
  100. package/types/core/legacy.d.ts +8 -0
  101. package/types/core/main.d.ts +5996 -0
  102. package/types/core/p5.Graphics.d.ts +484 -0
  103. package/types/core/p5.Renderer.d.ts +14 -0
  104. package/types/core/reference.d.ts +8 -0
  105. package/types/core/rendering.d.ts +481 -0
  106. package/types/core/structure.d.ts +492 -0
  107. package/types/core/transform.d.ts +1638 -0
  108. package/types/data/local_storage.d.ts +323 -0
  109. package/types/dom/dom.d.ts +1295 -0
  110. package/types/dom/p5.Element.d.ts +2011 -0
  111. package/types/dom/p5.File.d.ts +13 -0
  112. package/types/dom/p5.MediaElement.d.ts +1249 -0
  113. package/types/events/acceleration.d.ts +193 -0
  114. package/types/events/keyboard.d.ts +499 -0
  115. package/types/events/pointer.d.ts +782 -0
  116. package/types/global.d.ts +5542 -0
  117. package/types/image/filterRenderer2D.d.ts +54 -0
  118. package/types/image/image.d.ts +326 -0
  119. package/types/image/loading_displaying.d.ts +580 -0
  120. package/types/image/p5.Image.d.ts +5882 -0
  121. package/types/image/pixels.d.ts +832 -0
  122. package/types/io/files.d.ts +1447 -0
  123. package/types/io/p5.Table.d.ts +1247 -0
  124. package/types/io/p5.TableRow.d.ts +343 -0
  125. package/types/io/p5.XML.d.ts +1188 -0
  126. package/types/math/Matrices/Matrix.d.ts +1029 -0
  127. package/types/math/Matrices/MatrixNumjs.d.ts +8 -0
  128. package/types/math/calculation.d.ts +923 -0
  129. package/types/math/math.d.ts +90 -0
  130. package/types/math/noise.d.ts +311 -0
  131. package/types/math/p5.Matrix.d.ts +8 -0
  132. package/types/math/p5.Vector.d.ts +3416 -0
  133. package/types/math/random.d.ts +267 -0
  134. package/types/math/trigonometry.d.ts +663 -0
  135. package/types/p5.d.ts +6663 -0
  136. package/types/shape/2d_primitives.d.ts +1033 -0
  137. package/types/shape/attributes.d.ts +466 -0
  138. package/types/shape/curves.d.ts +740 -0
  139. package/types/shape/custom_shapes.d.ts +888 -0
  140. package/types/shape/vertex.d.ts +1141 -0
  141. package/types/type/p5.Font.d.ts +575 -0
  142. package/types/type/textCore.d.ts +1198 -0
  143. package/types/utilities/conversion.d.ts +894 -0
  144. package/types/utilities/time_date.d.ts +295 -0
  145. package/types/utilities/utility_functions.d.ts +587 -0
  146. package/types/webgl/3d_primitives.d.ts +1432 -0
  147. package/types/webgl/ShaderGenerator.d.ts +8 -0
  148. package/types/webgl/interaction.d.ts +371 -0
  149. package/types/webgl/light.d.ts +1184 -0
  150. package/types/webgl/loading.d.ts +481 -0
  151. package/types/webgl/material.d.ts +2656 -0
  152. package/types/webgl/p5.Camera.d.ts +3023 -0
  153. package/types/webgl/p5.DataArray.d.ts +61 -0
  154. package/types/webgl/p5.Framebuffer.d.ts +760 -0
  155. package/types/webgl/p5.Geometry.d.ts +1191 -0
  156. package/types/webgl/p5.Quat.d.ts +45 -0
  157. package/types/webgl/p5.RendererGL.d.ts +234 -0
  158. package/types/webgl/p5.Shader.d.ts +660 -0
  159. package/types/webgl/p5.Texture.d.ts +61 -0
  160. package/types/webgl/text.d.ts +74 -0
@@ -1,18 +1,18 @@
1
1
  import color_conversion from '../color/color_conversion.js';
2
- import '../main-s72KWcUy.js';
3
- import '../constants-C-g_eAdC.js';
2
+ import '../main-CAxvgiOV.js';
3
+ import '../constants-tYr0tCl8.js';
4
4
  import '../core/transform.js';
5
5
  import '../core/structure.js';
6
6
  import '../core/environment.js';
7
7
  import '../math/p5.Vector.js';
8
- import '../rendering--aAe5aq3.js';
9
- import '../creating_reading-D4AAKRbx.js';
8
+ import '../rendering-B5TRR7aY.js';
9
+ import '../creating_reading-Cr8L2Jnm.js';
10
10
  import 'colorjs.io/fn';
11
11
  import '../color/color_spaces/hsb.js';
12
12
  import '../dom/p5.Element.js';
13
13
  import '../dom/p5.File.js';
14
14
  import '../io/p5.XML.js';
15
- import '../p5.Renderer-CwAYZOC2.js';
15
+ import '../p5.Renderer-Swjl9HQO.js';
16
16
  import '../image/filters.js';
17
17
  import '../shape/custom_shapes.js';
18
18
  import '../core/States.js';
@@ -75,6 +75,11 @@ function describe(p5, fn){
75
75
  *
76
76
  * <div>
77
77
  * <code>
78
+ *
79
+ * function setup(){
80
+ * createCanvas(100, 100);
81
+ * };
82
+ *
78
83
  * function draw() {
79
84
  * background(200);
80
85
  *
@@ -96,6 +101,11 @@ function describe(p5, fn){
96
101
  *
97
102
  * <div>
98
103
  * <code>
104
+ *
105
+ * function setup(){
106
+ * createCanvas(100, 100);
107
+ * }
108
+ *
99
109
  * function draw() {
100
110
  * background(200);
101
111
  *
@@ -4,20 +4,20 @@ import textOutput from './textOutput.js';
4
4
  import outputs from './outputs.js';
5
5
  import colorNamer from './color_namer.js';
6
6
  import '../color/color_conversion.js';
7
- import '../main-s72KWcUy.js';
8
- import '../constants-C-g_eAdC.js';
7
+ import '../main-CAxvgiOV.js';
8
+ import '../constants-tYr0tCl8.js';
9
9
  import '../core/transform.js';
10
10
  import '../core/structure.js';
11
11
  import '../core/environment.js';
12
12
  import '../math/p5.Vector.js';
13
- import '../rendering--aAe5aq3.js';
14
- import '../creating_reading-D4AAKRbx.js';
13
+ import '../rendering-B5TRR7aY.js';
14
+ import '../creating_reading-Cr8L2Jnm.js';
15
15
  import 'colorjs.io/fn';
16
16
  import '../color/color_spaces/hsb.js';
17
17
  import '../dom/p5.Element.js';
18
18
  import '../dom/p5.File.js';
19
19
  import '../io/p5.XML.js';
20
- import '../p5.Renderer-CwAYZOC2.js';
20
+ import '../p5.Renderer-Swjl9HQO.js';
21
21
  import '../image/filters.js';
22
22
  import '../shape/custom_shapes.js';
23
23
  import '../core/States.js';
@@ -81,6 +81,11 @@ function outputs(p5, fn){
81
81
  *
82
82
  * <div>
83
83
  * <code>
84
+ *
85
+ * function setup(){
86
+ * createCanvas(100, 100);
87
+ * }
88
+ *
84
89
  * function draw() {
85
90
  * // Add the text description.
86
91
  * textOutput();
@@ -101,6 +106,11 @@ function outputs(p5, fn){
101
106
  *
102
107
  * <div>
103
108
  * <code>
109
+ *
110
+ * function setup(){
111
+ * createCanvas(100, 100);
112
+ * }
113
+ *
104
114
  * function draw() {
105
115
  * // Add the text description and
106
116
  * // display it for debugging.
@@ -215,6 +225,11 @@ function outputs(p5, fn){
215
225
  *
216
226
  * <div>
217
227
  * <code>
228
+ *
229
+ * function setup() {
230
+ * createCanvas(100, 100);
231
+ * }
232
+ *
218
233
  * function draw() {
219
234
  * // Add the grid description.
220
235
  * gridOutput();
@@ -235,6 +250,11 @@ function outputs(p5, fn){
235
250
  *
236
251
  * <div>
237
252
  * <code>
253
+ *
254
+ * function setup(){
255
+ * createCanvas(100, 100);
256
+ * }
257
+ *
238
258
  * function draw() {
239
259
  * // Add the grid description and
240
260
  * // display it for debugging.
@@ -255,6 +275,7 @@ function outputs(p5, fn){
255
275
  * </div>
256
276
  */
257
277
 
278
+
258
279
  fn.gridOutput = function(display) {
259
280
  // p5._validateParameters('gridOutput', arguments);
260
281
  //if gridOutput is already true
package/dist/app.js CHANGED
@@ -1,4 +1,4 @@
1
- import { p as p5 } from './main-s72KWcUy.js';
1
+ import { p as p5 } from './main-CAxvgiOV.js';
2
2
  import shape from './shape/index.js';
3
3
  import accessibility from './accessibility/index.js';
4
4
  import color from './color/index.js';
@@ -13,19 +13,19 @@ import utilities from './utilities/index.js';
13
13
  import webgl from './webgl/index.js';
14
14
  import type from './type/index.js';
15
15
  import { waitForDocumentReady, waitingForTranslator, _globalInit } from './core/init.js';
16
- import './constants-C-g_eAdC.js';
16
+ import './constants-tYr0tCl8.js';
17
17
  import './core/transform.js';
18
18
  import './core/structure.js';
19
19
  import './core/environment.js';
20
20
  import './math/p5.Vector.js';
21
- import './rendering--aAe5aq3.js';
22
- import './creating_reading-D4AAKRbx.js';
21
+ import './rendering-B5TRR7aY.js';
22
+ import './creating_reading-Cr8L2Jnm.js';
23
23
  import 'colorjs.io/fn';
24
24
  import './color/color_spaces/hsb.js';
25
25
  import './dom/p5.Element.js';
26
26
  import './dom/p5.File.js';
27
27
  import './io/p5.XML.js';
28
- import './p5.Renderer-CwAYZOC2.js';
28
+ import './p5.Renderer-Swjl9HQO.js';
29
29
  import './image/filters.js';
30
30
  import './shape/custom_shapes.js';
31
31
  import './core/States.js';
@@ -1,17 +1,17 @@
1
- import { p as p5 } from '../main-s72KWcUy.js';
2
- import '../constants-C-g_eAdC.js';
1
+ import { p as p5 } from '../main-CAxvgiOV.js';
2
+ import '../constants-tYr0tCl8.js';
3
3
  import '../core/transform.js';
4
4
  import '../core/structure.js';
5
5
  import '../core/environment.js';
6
6
  import '../math/p5.Vector.js';
7
- import '../rendering--aAe5aq3.js';
8
- import '../creating_reading-D4AAKRbx.js';
7
+ import '../rendering-B5TRR7aY.js';
8
+ import '../creating_reading-Cr8L2Jnm.js';
9
9
  import 'colorjs.io/fn';
10
10
  import './color_spaces/hsb.js';
11
11
  import '../dom/p5.Element.js';
12
12
  import '../dom/p5.File.js';
13
13
  import '../io/p5.XML.js';
14
- import '../p5.Renderer-CwAYZOC2.js';
14
+ import '../p5.Renderer-Swjl9HQO.js';
15
15
  import '../image/filters.js';
16
16
  import '../shape/custom_shapes.js';
17
17
  import '../core/States.js';
@@ -1,3 +1,3 @@
1
- export { H as HSB, d as HSL, e as HWB, L as LAB, f as LCH, O as OKLAB, g as OKLCH, R as RGB, h as RGBA, b as RGBHDR, c as default } from '../creating_reading-D4AAKRbx.js';
1
+ export { H as HSB, d as HSL, e as HWB, L as LAB, f as LCH, O as OKLAB, g as OKLCH, R as RGB, h as RGBA, b as RGBHDR, c as default } from '../creating_reading-Cr8L2Jnm.js';
2
2
  import 'colorjs.io/fn';
3
3
  import './color_spaces/hsb.js';
@@ -1,8 +1,8 @@
1
- import { c as creatingReading, a as color$1 } from '../creating_reading-D4AAKRbx.js';
1
+ import { c as creatingReading, a as color$1 } from '../creating_reading-Cr8L2Jnm.js';
2
2
  import setting from './setting.js';
3
3
  import 'colorjs.io/fn';
4
4
  import './color_spaces/hsb.js';
5
- import '../constants-C-g_eAdC.js';
5
+ import '../constants-tYr0tCl8.js';
6
6
 
7
7
  function color(p5){
8
8
  p5.registerAddon(creatingReading);
@@ -1,3 +1,3 @@
1
- export { C as Color, a as default } from '../creating_reading-D4AAKRbx.js';
1
+ export { C as Color, a as default } from '../creating_reading-Cr8L2Jnm.js';
2
2
  import 'colorjs.io/fn';
3
3
  import './color_spaces/hsb.js';
@@ -1,5 +1,5 @@
1
- import { N as NORMAL, u as BLEND } from '../constants-C-g_eAdC.js';
2
- import { R as RGB, b as RGBHDR, H as HSB, d as HSL, e as HWB, L as LAB, f as LCH, O as OKLAB, g as OKLCH } from '../creating_reading-D4AAKRbx.js';
1
+ import { N as NORMAL, u as BLEND } from '../constants-tYr0tCl8.js';
2
+ import { R as RGB, b as RGBHDR, H as HSB, d as HSL, e as HWB, L as LAB, f as LCH, O as OKLAB, g as OKLCH } from '../creating_reading-Cr8L2Jnm.js';
3
3
  import 'colorjs.io/fn';
4
4
  import './color_spaces/hsb.js';
5
5
 
@@ -11,17 +11,33 @@ const _PI = Math.PI;
11
11
  * @property {String} VERSION
12
12
  * @final
13
13
  */
14
- const VERSION = '2.0.1';
14
+ const VERSION = '2.0.2';
15
15
 
16
16
  // GRAPHICS RENDERER
17
17
  /**
18
- * The default, two-dimensional renderer.
19
- * @typedef {unique symbol} P2D
18
+ * The default, two-dimensional renderer in p5.js.
19
+ *
20
+ * Use this when calling <a href="#/p5/createCanvas"> (for example,
21
+ * `createCanvas(400, 400, P2D)`) to specify a 2D context.
22
+ *
23
+ * @typedef {'p2d'} P2D
20
24
  * @property {P2D} P2D
21
25
  * @final
22
26
  */
23
27
  const P2D = 'p2d';
24
28
 
29
+ /**
30
+ * A high-dynamic-range (HDR) variant of the default, two-dimensional renderer.
31
+ *
32
+ * When available, this mode can allow for extended color ranges and more
33
+ * dynamic color representation. Use it similarly to `P2D`:
34
+ * `createCanvas(400, 400, P2DHDR)`.
35
+ *
36
+ * @typedef {'p2d-hdr'} P2DHDR
37
+ * @property {P2DHDR} P2DHDR
38
+ * @final
39
+ */
40
+
25
41
  const P2DHDR = 'p2d-hdr';
26
42
 
27
43
  /**
@@ -1 +1 @@
1
- export { ai as ADD, aL as ALT, b as ARROW, w as AUTO, A as AXES, aM as BACKSPACE, an as BASELINE, B as BEVEL, b5 as BEZIER, u as BLEND, $ as BLUR, a_ as BOLD, a$ as BOLDITALIC, ar as BOTTOM, ah as BURN, C as CENTER, b0 as CHAR, ak as CHORD, at as CLAMP, n as CLOSE, aq as CONTAIN, aN as CONTROL, e as CORNER, i as CORNERS, ap as COVER, c as CROSS, b6 as CURVE, a6 as DARKEST, D as DEG_TO_RAD, aO as DELETE, a8 as DIFFERENCE, V as DILATE, ag as DODGE, aP as DOWN_ARROW, E as EMPTY_PATH, aQ as ENTER, Y as ERODE, aR as ESCAPE, t as EXCLUDE, aa as EXCLUSION, bc as FALLBACK, as as FILL, F as FLAT, aB as FLOAT, ax as FULL, X as GRAY, G as GRID, aD as HALF_FLOAT, g as HALF_PI, H as HAND, ae as HARD_LIGHT, a1 as IMAGE, b8 as IMMEDIATE, I as INCLUDE, _ as INVERT, aZ as ITALIC, J as JOIN, bb as LABEL, b9 as LANDSCAPE, ao as LEFT, aS as LEFT_ARROW, a7 as LIGHTEST, aC as LINEAR, L as LINES, aJ as LINE_LOOP, aI as LINE_STRIP, aA as MIRROR, l as MITER, M as MOVE, a9 as MULTIPLY, ay as NEAREST, N as NORMAL, K as OPAQUE, O as OPEN, aT as OPTION, ad as OVERLAY, P as P2D, aE as P2DHDR, m as PATH, h as PI, aj as PIE, o as POINTS, ba as PORTRAIT, U as POSTERIZE, k as PROJECT, b4 as QUADRATIC, Q as QUADS, s as QUAD_STRIP, aF as QUARTER_PI, a as RADIUS, x as RAD_TO_DEG, a4 as REMOVE, az as REPEAT, ac as REPLACE, aU as RETURN, R as RIGHT, aV as RIGHT_ARROW, j as ROUND, ab as SCREEN, aW as SHIFT, aw as SIMPLE, y as SMOOTH, af as SOFT_LIGHT, S as SQUARE, b7 as STROKE, a5 as SUBTRACT, aX as TAB, aG as TAU, aK as TESS, d as TEXT, T as TEXTURE, Z as THRESHOLD, aH as TOP, p as TRIANGLES, q as TRIANGLE_FAN, r as TRIANGLE_STRIP, f as TWO_PI, av as UNSIGNED_BYTE, au as UNSIGNED_INT, aY as UP_ARROW, al as VERSION, W as WAIT, a0 as WEBGL, z as WEBGL2, am as WORD, b3 as _CTX_MIDDLE, a2 as _DEFAULT_FILL, b2 as _DEFAULT_LEADMULT, a3 as _DEFAULT_STROKE, b1 as _DEFAULT_TEXT_FILL } from '../constants-C-g_eAdC.js';
1
+ export { ai as ADD, aL as ALT, b as ARROW, w as AUTO, A as AXES, aM as BACKSPACE, an as BASELINE, B as BEVEL, b5 as BEZIER, u as BLEND, $ as BLUR, a_ as BOLD, a$ as BOLDITALIC, ar as BOTTOM, ah as BURN, C as CENTER, b0 as CHAR, ak as CHORD, at as CLAMP, n as CLOSE, aq as CONTAIN, aN as CONTROL, e as CORNER, i as CORNERS, ap as COVER, c as CROSS, b6 as CURVE, a6 as DARKEST, D as DEG_TO_RAD, aO as DELETE, a8 as DIFFERENCE, V as DILATE, ag as DODGE, aP as DOWN_ARROW, E as EMPTY_PATH, aQ as ENTER, Y as ERODE, aR as ESCAPE, t as EXCLUDE, aa as EXCLUSION, bc as FALLBACK, as as FILL, F as FLAT, aB as FLOAT, ax as FULL, X as GRAY, G as GRID, aD as HALF_FLOAT, g as HALF_PI, H as HAND, ae as HARD_LIGHT, a1 as IMAGE, b8 as IMMEDIATE, I as INCLUDE, _ as INVERT, aZ as ITALIC, J as JOIN, bb as LABEL, b9 as LANDSCAPE, ao as LEFT, aS as LEFT_ARROW, a7 as LIGHTEST, aC as LINEAR, L as LINES, aJ as LINE_LOOP, aI as LINE_STRIP, aA as MIRROR, l as MITER, M as MOVE, a9 as MULTIPLY, ay as NEAREST, N as NORMAL, K as OPAQUE, O as OPEN, aT as OPTION, ad as OVERLAY, P as P2D, aE as P2DHDR, m as PATH, h as PI, aj as PIE, o as POINTS, ba as PORTRAIT, U as POSTERIZE, k as PROJECT, b4 as QUADRATIC, Q as QUADS, s as QUAD_STRIP, aF as QUARTER_PI, a as RADIUS, x as RAD_TO_DEG, a4 as REMOVE, az as REPEAT, ac as REPLACE, aU as RETURN, R as RIGHT, aV as RIGHT_ARROW, j as ROUND, ab as SCREEN, aW as SHIFT, aw as SIMPLE, y as SMOOTH, af as SOFT_LIGHT, S as SQUARE, b7 as STROKE, a5 as SUBTRACT, aX as TAB, aG as TAU, aK as TESS, d as TEXT, T as TEXTURE, Z as THRESHOLD, aH as TOP, p as TRIANGLES, q as TRIANGLE_FAN, r as TRIANGLE_STRIP, f as TWO_PI, av as UNSIGNED_BYTE, au as UNSIGNED_INT, aY as UP_ARROW, al as VERSION, W as WAIT, a0 as WEBGL, z as WEBGL2, am as WORD, b3 as _CTX_MIDDLE, a2 as _DEFAULT_FILL, b2 as _DEFAULT_LEADMULT, a3 as _DEFAULT_STROKE, b1 as _DEFAULT_TEXT_FILL } from '../constants-tYr0tCl8.js';
@@ -1,4 +1,4 @@
1
- import { b as ARROW, c as CROSS, H as HAND, M as MOVE, d as TEXT, W as WAIT, P as P2D } from '../constants-C-g_eAdC.js';
1
+ import { b as ARROW, c as CROSS, H as HAND, M as MOVE, d as TEXT, W as WAIT, P as P2D } from '../constants-tYr0tCl8.js';
2
2
  import '../math/p5.Vector.js';
3
3
 
4
4
  /**
@@ -32,8 +32,8 @@ function environment(p5, fn){
32
32
  * @method print
33
33
  * @param {Any} contents content to print to the console.
34
34
  * @example
35
- * <div>
36
- * <code class="norender">
35
+ * <div class="norender">
36
+ * <code>
37
37
  * function setup() {
38
38
  * // Prints "hello, world" to the console.
39
39
  * print('hello, world');
@@ -41,8 +41,8 @@ function environment(p5, fn){
41
41
  * </code>
42
42
  * </div>
43
43
  *
44
- * <div>
45
- * <code class="norender">
44
+ * <div class="norender">
45
+ * <code>
46
46
  * function setup() {
47
47
  * let name = 'ada';
48
48
  * // Prints "hello, ada" to the console.
@@ -515,6 +515,7 @@ function environment(p5, fn){
515
515
  * - `WEBGL2` whose value is `'webgl2'`,
516
516
  * - `WEBGL` whose value is `'webgl'`, or
517
517
  * - `P2D` whose value is `'p2d'`. This is the default for 2D sketches.
518
+ * - `P2DHDR` whose value is `'p2d-hdr'` (used for HDR 2D sketches, if available).
518
519
  *
519
520
  * See <a href="#/p5/setAttributes">setAttributes()</a> for ways to set the
520
521
  * WebGL version.
@@ -1,6 +1,6 @@
1
1
  import { translator } from '../internationalization.js';
2
2
  import strings from './browser_errors.js';
3
- import { v as constants } from '../../constants-C-g_eAdC.js';
3
+ import { v as constants } from '../../constants-tYr0tCl8.js';
4
4
  import 'i18next';
5
5
  import 'i18next-browser-languagedetector';
6
6
 
@@ -7,7 +7,7 @@ import '../internationalization.js';
7
7
  import 'i18next';
8
8
  import 'i18next-browser-languagedetector';
9
9
  import './browser_errors.js';
10
- import '../../constants-C-g_eAdC.js';
10
+ import '../../constants-tYr0tCl8.js';
11
11
  import 'zod';
12
12
  import 'acorn';
13
13
  import 'acorn-walk';
@@ -1,4 +1,4 @@
1
- import { v as constants } from '../../constants-C-g_eAdC.js';
1
+ import { v as constants } from '../../constants-tYr0tCl8.js';
2
2
  import * as z from 'zod';
3
3
 
4
4
  var p5$1 = {
@@ -967,7 +967,7 @@ var p5$1 = {
967
967
  image: {
968
968
  overloads: [
969
969
  [
970
- "p5.Image|p5.Element|p5.Texture|p5.Framebuffer|p5.FramebufferTexture",
970
+ "p5.Image|p5.Element|p5.Texture|p5.Framebuffer|p5.FramebufferTexture|p5.Renderer|p5.Graphics",
971
971
  "Number",
972
972
  "Number",
973
973
  "Number?",
@@ -1465,14 +1465,7 @@ var p5$1 = {
1465
1465
  createVector: {
1466
1466
  overloads: [
1467
1467
  [
1468
- null
1469
- ]
1470
- ]
1471
- },
1472
- createMatrix: {
1473
- overloads: [
1474
- [
1475
- "Number[]"
1468
+ "...Number[]"
1476
1469
  ]
1477
1470
  ]
1478
1471
  },
@@ -1898,14 +1891,23 @@ var p5$1 = {
1898
1891
  bezierOrder: {
1899
1892
  overloads: [
1900
1893
  [
1894
+ "Number"
1901
1895
  ],
1902
1896
  [
1903
- "Number"
1904
1897
  ]
1905
1898
  ]
1906
1899
  },
1907
1900
  splineVertex: {
1908
1901
  overloads: [
1902
+ [
1903
+ "Number",
1904
+ "Number"
1905
+ ],
1906
+ [
1907
+ "Number",
1908
+ "Number",
1909
+ "Number?"
1910
+ ],
1909
1911
  [
1910
1912
  "Number",
1911
1913
  "Number",
@@ -1923,21 +1925,21 @@ var p5$1 = {
1923
1925
  },
1924
1926
  splineProperty: {
1925
1927
  overloads: [
1926
- [
1927
- "String"
1928
- ],
1929
1928
  [
1930
1929
  "String",
1931
1930
  null
1931
+ ],
1932
+ [
1933
+ "String"
1932
1934
  ]
1933
1935
  ]
1934
1936
  },
1935
1937
  splineProperties: {
1936
1938
  overloads: [
1937
1939
  [
1940
+ "Object"
1938
1941
  ],
1939
1942
  [
1940
- "Object"
1941
1943
  ]
1942
1944
  ]
1943
1945
  },
@@ -1999,19 +2001,6 @@ var p5$1 = {
1999
2001
  ]
2000
2002
  ]
2001
2003
  },
2002
- curveVertex: {
2003
- overloads: [
2004
- [
2005
- "Number",
2006
- "Number"
2007
- ],
2008
- [
2009
- "Number",
2010
- "Number",
2011
- "Number?"
2012
- ]
2013
- ]
2014
- },
2015
2004
  endShape: {
2016
2005
  overloads: [
2017
2006
  [
@@ -2818,42 +2807,6 @@ var p5$1 = {
2818
2807
  ]
2819
2808
  ]
2820
2809
  },
2821
- parseObj: {
2822
- overloads: [
2823
- [
2824
- ]
2825
- ]
2826
- },
2827
- parseSTL: {
2828
- overloads: [
2829
- [
2830
- ]
2831
- ]
2832
- },
2833
- isBinary: {
2834
- overloads: [
2835
- [
2836
- ]
2837
- ]
2838
- },
2839
- matchDataViewAt: {
2840
- overloads: [
2841
- [
2842
- ]
2843
- ]
2844
- },
2845
- parseBinarySTL: {
2846
- overloads: [
2847
- [
2848
- ]
2849
- ]
2850
- },
2851
- parseASCIISTL: {
2852
- overloads: [
2853
- [
2854
- ]
2855
- ]
2856
- },
2857
2810
  model: {
2858
2811
  overloads: [
2859
2812
  [
@@ -5120,9 +5073,14 @@ function validateParams(p5, fn, lifecycles) {
5120
5073
  const isOptional = param?.endsWith('?');
5121
5074
  param = param?.replace(/\?$/, '');
5122
5075
 
5123
- let schema = generateTypeSchema(param);
5076
+ const isRest = param?.startsWith('...') && param?.endsWith('[]');
5077
+ param = param?.replace(/^\.\.\.(.+)\[\]$/, '$1');
5124
5078
 
5125
- return isOptional ? schema.optional() : schema;
5079
+ let schema = generateTypeSchema(param);
5080
+ if (isOptional) {
5081
+ schema = schema.optional();
5082
+ }
5083
+ return { schema, rest: isRest };
5126
5084
  };
5127
5085
 
5128
5086
  // Note that in Zod, `optional()` only checks for undefined, not the absence
@@ -5156,14 +5114,22 @@ function validateParams(p5, fn, lifecycles) {
5156
5114
  const overloadSchemas = overloads.flatMap(overload => {
5157
5115
  const combinations = generateOverloadCombinations(overload);
5158
5116
 
5159
- return combinations.map(combo =>
5160
- z.tuple(
5161
- combo
5162
- .map(p => generateParamSchema(p))
5163
- // For now, ignore schemas that cannot be mapped to a defined type
5164
- .filter(schema => schema !== undefined)
5165
- )
5166
- );
5117
+ return combinations.map(combo => {
5118
+ const params = combo
5119
+ .map(p => generateParamSchema(p))
5120
+ .filter(s => s.schema !== undefined);
5121
+
5122
+ let rest;
5123
+ if (params.at(-1)?.rest) {
5124
+ rest = params.pop();
5125
+ }
5126
+
5127
+ let combined = z.tuple(params.map(s => s.schema));
5128
+ if (rest) {
5129
+ combined = combined.rest(rest.schema);
5130
+ }
5131
+ return combined;
5132
+ });
5167
5133
  });
5168
5134
 
5169
5135
  return overloadSchemas.length === 1
@@ -5398,7 +5364,7 @@ function validateParams(p5, fn, lifecycles) {
5398
5364
  // theoretically allowed to stay undefined and valid, it is likely that the
5399
5365
  // user intended to call the function with non-undefined arguments. Skip
5400
5366
  // regular workflow and return a friendly error message right away.
5401
- if (Array.isArray(args) && args.every(arg => arg === undefined)) {
5367
+ if (Array.isArray(args) && args.length > 0 && args.every(arg => arg === undefined)) {
5402
5368
  const undefinedErrorMessage = `🌸 p5.js says: All arguments for ${func}() are undefined. There is likely an error in the code.`;
5403
5369
 
5404
5370
  return {
@@ -1,18 +1,18 @@
1
- import { p as p5 } from '../../main-s72KWcUy.js';
1
+ import { p as p5 } from '../../main-CAxvgiOV.js';
2
2
  import { translator } from '../internationalization.js';
3
- import { v as constants } from '../../constants-C-g_eAdC.js';
3
+ import { v as constants } from '../../constants-tYr0tCl8.js';
4
4
  import '../transform.js';
5
5
  import '../structure.js';
6
6
  import '../environment.js';
7
7
  import '../../math/p5.Vector.js';
8
- import '../../rendering--aAe5aq3.js';
9
- import '../../creating_reading-D4AAKRbx.js';
8
+ import '../../rendering-B5TRR7aY.js';
9
+ import '../../creating_reading-Cr8L2Jnm.js';
10
10
  import 'colorjs.io/fn';
11
11
  import '../../color/color_spaces/hsb.js';
12
12
  import '../../dom/p5.Element.js';
13
13
  import '../../dom/p5.File.js';
14
14
  import '../../io/p5.XML.js';
15
- import '../../p5.Renderer-CwAYZOC2.js';
15
+ import '../../p5.Renderer-Swjl9HQO.js';
16
16
  import '../../image/filters.js';
17
17
  import '../../shape/custom_shapes.js';
18
18
  import '../States.js';
@@ -1,6 +1,6 @@
1
1
  import { parse } from 'acorn';
2
2
  import { simple } from 'acorn-walk';
3
- import { v as constants } from '../../constants-C-g_eAdC.js';
3
+ import { v as constants } from '../../constants-tYr0tCl8.js';
4
4
 
5
5
  // List of functions to ignore as they either are meant to be re-defined or
6
6
  // generate false positive outputs.
@@ -1,18 +1,18 @@
1
- import { p as p5 } from '../../main-s72KWcUy.js';
1
+ import { p as p5 } from '../../main-CAxvgiOV.js';
2
2
  import { translator } from '../internationalization.js';
3
- import '../../constants-C-g_eAdC.js';
3
+ import '../../constants-tYr0tCl8.js';
4
4
  import '../transform.js';
5
5
  import '../structure.js';
6
6
  import '../environment.js';
7
7
  import '../../math/p5.Vector.js';
8
- import '../../rendering--aAe5aq3.js';
9
- import '../../creating_reading-D4AAKRbx.js';
8
+ import '../../rendering-B5TRR7aY.js';
9
+ import '../../creating_reading-Cr8L2Jnm.js';
10
10
  import 'colorjs.io/fn';
11
11
  import '../../color/color_spaces/hsb.js';
12
12
  import '../../dom/p5.Element.js';
13
13
  import '../../dom/p5.File.js';
14
14
  import '../../io/p5.XML.js';
15
- import '../../p5.Renderer-CwAYZOC2.js';
15
+ import '../../p5.Renderer-Swjl9HQO.js';
16
16
  import '../../image/filters.js';
17
17
  import '../../shape/custom_shapes.js';
18
18
  import '../States.js';
@@ -1,4 +1,4 @@
1
- import { e as CORNER, i as CORNERS, a as RADIUS, C as CENTER } from '../constants-C-g_eAdC.js';
1
+ import { e as CORNER, i as CORNERS, a as RADIUS, C as CENTER } from '../constants-tYr0tCl8.js';
2
2
 
3
3
  /**
4
4
  * @requires constants
package/dist/core/init.js CHANGED
@@ -1,18 +1,18 @@
1
- import { p as p5 } from '../main-s72KWcUy.js';
1
+ import { p as p5 } from '../main-CAxvgiOV.js';
2
2
  import { initialize } from './internationalization.js';
3
- import '../constants-C-g_eAdC.js';
3
+ import '../constants-tYr0tCl8.js';
4
4
  import './transform.js';
5
5
  import './structure.js';
6
6
  import './environment.js';
7
7
  import '../math/p5.Vector.js';
8
- import '../rendering--aAe5aq3.js';
9
- import '../creating_reading-D4AAKRbx.js';
8
+ import '../rendering-B5TRR7aY.js';
9
+ import '../creating_reading-Cr8L2Jnm.js';
10
10
  import 'colorjs.io/fn';
11
11
  import '../color/color_spaces/hsb.js';
12
12
  import '../dom/p5.Element.js';
13
13
  import '../dom/p5.File.js';
14
14
  import '../io/p5.XML.js';
15
- import '../p5.Renderer-CwAYZOC2.js';
15
+ import '../p5.Renderer-Swjl9HQO.js';
16
16
  import '../image/filters.js';
17
17
  import '../shape/custom_shapes.js';
18
18
  import './States.js';
@@ -1,17 +1,17 @@
1
- import { p as p5 } from '../main-s72KWcUy.js';
2
- import '../constants-C-g_eAdC.js';
1
+ import { p as p5 } from '../main-CAxvgiOV.js';
2
+ import '../constants-tYr0tCl8.js';
3
3
  import './transform.js';
4
4
  import './structure.js';
5
5
  import './environment.js';
6
6
  import '../math/p5.Vector.js';
7
- import '../rendering--aAe5aq3.js';
8
- import '../creating_reading-D4AAKRbx.js';
7
+ import '../rendering-B5TRR7aY.js';
8
+ import '../creating_reading-Cr8L2Jnm.js';
9
9
  import 'colorjs.io/fn';
10
10
  import '../color/color_spaces/hsb.js';
11
11
  import '../dom/p5.Element.js';
12
12
  import '../dom/p5.File.js';
13
13
  import '../io/p5.XML.js';
14
- import '../p5.Renderer-CwAYZOC2.js';
14
+ import '../p5.Renderer-Swjl9HQO.js';
15
15
  import '../image/filters.js';
16
16
  import '../shape/custom_shapes.js';
17
17
  import './States.js';
package/dist/core/main.js CHANGED
@@ -1,12 +1,12 @@
1
- import '../constants-C-g_eAdC.js';
1
+ import '../constants-tYr0tCl8.js';
2
2
  import './transform.js';
3
3
  import './structure.js';
4
4
  import './environment.js';
5
- import '../rendering--aAe5aq3.js';
6
- import '../p5.Renderer-CwAYZOC2.js';
7
- export { p as default } from '../main-s72KWcUy.js';
5
+ import '../rendering-B5TRR7aY.js';
6
+ import '../p5.Renderer-Swjl9HQO.js';
7
+ export { p as default } from '../main-CAxvgiOV.js';
8
8
  import '../math/p5.Vector.js';
9
- import '../creating_reading-D4AAKRbx.js';
9
+ import '../creating_reading-Cr8L2Jnm.js';
10
10
  import 'colorjs.io/fn';
11
11
  import '../color/color_spaces/hsb.js';
12
12
  import '../dom/p5.Element.js';