p5 2.0.1 → 2.0.3

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-BRcElHU3.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 +46 -93
  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 +11 -6
  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-BKN5yFoS.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-R23xoC7s.js} +5 -5
  54. package/dist/{rendering--aAe5aq3.js → rendering-CvUVN-Vb.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 +5 -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 +289 -247
  79. package/lib/p5.js +289 -247
  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 +5999 -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 +501 -0
  115. package/types/events/pointer.d.ts +782 -0
  116. package/types/global.d.ts +5544 -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 +6666 -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 +482 -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,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-BKN5yFoS.js';
2
+ import '../constants-BRcElHU3.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-CvUVN-Vb.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-R23xoC7s.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-BRcElHU3.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-CvUVN-Vb.js';
6
+ import '../p5.Renderer-R23xoC7s.js';
7
+ export { p as default } from '../main-BKN5yFoS.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';
@@ -1,11 +1,11 @@
1
- import '../constants-C-g_eAdC.js';
2
- import '../creating_reading-D4AAKRbx.js';
1
+ import '../constants-BRcElHU3.js';
2
+ import '../creating_reading-Cr8L2Jnm.js';
3
3
  import '../shape/2d_primitives.js';
4
4
  import '../shape/attributes.js';
5
5
  import '../shape/curves.js';
6
6
  import '../shape/vertex.js';
7
7
  import '../color/setting.js';
8
- export { G as Graphics, z as default } from '../rendering--aAe5aq3.js';
8
+ export { G as Graphics, z as default } from '../rendering-CvUVN-Vb.js';
9
9
  import '../image/pixels.js';
10
10
  import './transform.js';
11
11
  import '../math/trigonometry.js';
@@ -16,7 +16,7 @@ import './helpers.js';
16
16
  import '../dom/p5.Element.js';
17
17
  import '../dom/p5.File.js';
18
18
  import '../io/p5.XML.js';
19
- import '../p5.Renderer-CwAYZOC2.js';
19
+ import '../p5.Renderer-R23xoC7s.js';
20
20
  import '../image/filters.js';
21
21
  import '../math/p5.Vector.js';
22
22
  import './States.js';
@@ -1,6 +1,6 @@
1
- import '../creating_reading-D4AAKRbx.js';
2
- import '../constants-C-g_eAdC.js';
3
- export { R as Renderer, r as default } from '../p5.Renderer-CwAYZOC2.js';
1
+ import '../creating_reading-Cr8L2Jnm.js';
2
+ import '../constants-BRcElHU3.js';
3
+ export { R as Renderer, r as default } from '../p5.Renderer-R23xoC7s.js';
4
4
  import '../math/p5.Vector.js';
5
5
  import '../shape/custom_shapes.js';
6
6
  import './States.js';
@@ -1,10 +1,10 @@
1
- import '../constants-C-g_eAdC.js';
2
- export { R as Renderer2D, r as default } from '../main-s72KWcUy.js';
3
- import '../p5.Renderer-CwAYZOC2.js';
4
- import '../rendering--aAe5aq3.js';
1
+ import '../constants-BRcElHU3.js';
2
+ export { R as Renderer2D, r as default } from '../main-BKN5yFoS.js';
3
+ import '../p5.Renderer-R23xoC7s.js';
4
+ import '../rendering-CvUVN-Vb.js';
5
5
  import '../dom/p5.Element.js';
6
6
  import '../dom/p5.MediaElement.js';
7
- import '../creating_reading-D4AAKRbx.js';
7
+ import '../creating_reading-Cr8L2Jnm.js';
8
8
  import '../image/filterRenderer2D.js';
9
9
  import '../math/p5.Matrix.js';
10
10
  import '../shape/custom_shapes.js';
@@ -1,12 +1,12 @@
1
- import '../constants-C-g_eAdC.js';
2
- export { y as default, I as renderers } from '../rendering--aAe5aq3.js';
3
- import '../creating_reading-D4AAKRbx.js';
1
+ import '../constants-BRcElHU3.js';
2
+ export { y as default, I as renderers } from '../rendering-CvUVN-Vb.js';
3
+ import '../creating_reading-Cr8L2Jnm.js';
4
4
  import 'colorjs.io/fn';
5
5
  import '../color/color_spaces/hsb.js';
6
6
  import '../dom/p5.Element.js';
7
7
  import '../dom/p5.File.js';
8
8
  import '../io/p5.XML.js';
9
- import '../p5.Renderer-CwAYZOC2.js';
9
+ import '../p5.Renderer-R23xoC7s.js';
10
10
  import '../image/filters.js';
11
11
  import '../math/p5.Vector.js';
12
12
  import '../shape/custom_shapes.js';
@@ -361,7 +361,7 @@ class Color {
361
361
  * }
362
362
  * </code>
363
363
  * </div>
364
- **/
364
+ */
365
365
  setGreen(new_green, max=[0, 1]) {
366
366
  if(!Array.isArray(max)){
367
367
  max = [0, max];
@@ -472,7 +472,7 @@ class Color {
472
472
  * }
473
473
  * </code>
474
474
  * </div>
475
- **/
475
+ */
476
476
  setAlpha(new_alpha, max=[0, 1]) {
477
477
  if(!Array.isArray(max)){
478
478
  max = [0, max];
package/dist/dom/dom.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import { Element } from './p5.Element.js';
2
2
  import { MediaElement } from './p5.MediaElement.js';
3
3
  import { File } from './p5.File.js';
4
- import '../creating_reading-D4AAKRbx.js';
4
+ import '../creating_reading-Cr8L2Jnm.js';
5
5
  import 'colorjs.io/fn';
6
6
  import '../color/color_spaces/hsb.js';
7
- import '../constants-C-g_eAdC.js';
7
+ import '../constants-BRcElHU3.js';
8
8
  import '../io/p5.XML.js';
9
9
 
10
10
  /**
@@ -358,7 +358,7 @@ function dom(p5, fn){
358
358
  * let slider;
359
359
  *
360
360
  * function setup() {
361
- * createCanvas(100, 100);
361
+ * createCanvas(200, 200);
362
362
  *
363
363
  * // Create a paragraph element and place
364
364
  * // it at the top of the canvas.
@@ -599,10 +599,10 @@ function dom(p5, fn){
599
599
  * background(200);
600
600
  *
601
601
  * let img = createImg(
602
- * 'https://p5js.org/assets/img/asterisk-01.png',
603
- * 'The p5.js magenta asterisk.'
602
+ * '/assets/cat.jpg',
603
+ * 'image of a cat'
604
604
  * );
605
- * img.position(0, -10);
605
+ * img.position(0, 10);
606
606
  *
607
607
  * describe('A gray square with a magenta asterisk in its center.');
608
608
  * }
@@ -951,7 +951,7 @@ function dom(p5, fn){
951
951
  *
952
952
  * // Create a checkbox and place it beneath the canvas.
953
953
  * checkbox = createCheckbox();
954
- * checkbox.position(0, 100);
954
+ * checkbox.position(0, 70);
955
955
  *
956
956
  * describe('A black square with a checkbox beneath it. The square turns white when the box is checked.');
957
957
  * }
@@ -977,7 +977,7 @@ function dom(p5, fn){
977
977
  * // Create a checkbox and place it beneath the canvas.
978
978
  * // Label the checkbox "white".
979
979
  * checkbox = createCheckbox(' white');
980
- * checkbox.position(0, 100);
980
+ * checkbox.position(0, 70);
981
981
  *
982
982
  * describe('A black square with a checkbox labeled "white" beneath it. The square turns white when the box is checked.');
983
983
  * }
@@ -1003,7 +1003,7 @@ function dom(p5, fn){
1003
1003
  * // Create a checkbox and place it beneath the canvas.
1004
1004
  * // Label the checkbox "white" and set its value to true.
1005
1005
  * checkbox = createCheckbox(' white', true);
1006
- * checkbox.position(0, 100);
1006
+ * checkbox.position(0, 70);
1007
1007
  *
1008
1008
  * describe('A white square with a checkbox labeled "white" beneath it. The square turns black when the box is unchecked.');
1009
1009
  * }
@@ -1882,7 +1882,7 @@ function dom(p5, fn){
1882
1882
  * let img;
1883
1883
  *
1884
1884
  * function setup() {
1885
- * createCanvas(100, 100);
1885
+ * createCanvas(200, 200);
1886
1886
  *
1887
1887
  * // Create a file input and place it beneath
1888
1888
  * // the canvas.
package/dist/dom/index.js CHANGED
@@ -2,10 +2,10 @@ import dom$1 from './dom.js';
2
2
  import element from './p5.Element.js';
3
3
  import media from './p5.MediaElement.js';
4
4
  import file from './p5.File.js';
5
- import '../creating_reading-D4AAKRbx.js';
5
+ import '../creating_reading-Cr8L2Jnm.js';
6
6
  import 'colorjs.io/fn';
7
7
  import '../color/color_spaces/hsb.js';
8
- import '../constants-C-g_eAdC.js';
8
+ import '../constants-BRcElHU3.js';
9
9
  import '../io/p5.XML.js';
10
10
 
11
11
  function dom(p5){
@@ -1,6 +1,6 @@
1
1
  import { File } from './p5.File.js';
2
- import { C as Color } from '../creating_reading-D4AAKRbx.js';
3
- import { w as AUTO } from '../constants-C-g_eAdC.js';
2
+ import { C as Color } from '../creating_reading-Cr8L2Jnm.js';
3
+ import { w as AUTO } from '../constants-BRcElHU3.js';
4
4
  import '../io/p5.XML.js';
5
5
  import 'colorjs.io/fn';
6
6
  import '../color/color_spaces/hsb.js';
@@ -1,10 +1,10 @@
1
1
  import { Element } from './p5.Element.js';
2
2
  import './p5.File.js';
3
3
  import '../io/p5.XML.js';
4
- import '../creating_reading-D4AAKRbx.js';
4
+ import '../creating_reading-Cr8L2Jnm.js';
5
5
  import 'colorjs.io/fn';
6
6
  import '../color/color_spaces/hsb.js';
7
- import '../constants-C-g_eAdC.js';
7
+ import '../constants-BRcElHU3.js';
8
8
 
9
9
  /**
10
10
  * @module DOM
@@ -142,18 +142,18 @@ function acceleration(p5, fn){
142
142
  * @example
143
143
  * <div>
144
144
  * <code>
145
+ * let rotationX = 0; // Angle in degrees
146
+ *
145
147
  * function setup() {
146
- * createCanvas(100, 100, WEBGL);
148
+ * createCanvas(200, 200, WEBGL); // Create 3D canvas
147
149
  * }
148
150
  *
149
151
  * function draw() {
150
- * background(200);
151
- * //rotateZ(radians(rotationZ));
152
- * rotateX(radians(rotationX));
153
- * //rotateY(radians(rotationY));
154
- * box(200, 200, 200);
155
- * describe(`red horizontal line right, green vertical line bottom.
156
- * black background.`);
152
+ * background(220); // Set light gray background
153
+ * rotateX(radians(rotationX)); // Rotate around X-axis
154
+ * normalMaterial(); // Apply simple shaded material
155
+ * box(60); // Draw 3D cube (60 units wide)
156
+ * rotationX = (rotationX + 2) % 360; // Increment rotation (2° per frame)
157
157
  * }
158
158
  * </code>
159
159
  * </div>
@@ -175,18 +175,18 @@ function acceleration(p5, fn){
175
175
  * @example
176
176
  * <div>
177
177
  * <code>
178
+ * let rotationY = 0; // Angle in degrees
179
+ *
178
180
  * function setup() {
179
- * createCanvas(100, 100, WEBGL);
181
+ * createCanvas(200, 200, WEBGL); // Create 3D canvas
180
182
  * }
181
183
  *
182
184
  * function draw() {
183
- * background(200);
184
- * //rotateZ(radians(rotationZ));
185
- * //rotateX(radians(rotationX));
186
- * rotateY(radians(rotationY));
187
- * box(200, 200, 200);
188
- * describe(`red horizontal line right, green vertical line bottom.
189
- * black background.`);
185
+ * background(220); // Set light gray background
186
+ * rotateY(radians(rotationY)); // Rotate around Y-axis (vertical)
187
+ * normalMaterial(); // Apply simple shaded material
188
+ * box(60); // Draw 3D cube (60 units wide)
189
+ * rotationY = (rotationY + 2) % 360; // Increment rotation (2° per frame)
190
190
  * }
191
191
  * </code>
192
192
  * </div>
@@ -209,18 +209,18 @@ function acceleration(p5, fn){
209
209
  * @example
210
210
  * <div>
211
211
  * <code>
212
+ * let rotationZ = 0; // Angle in degrees
213
+ *
212
214
  * function setup() {
213
- * createCanvas(100, 100, WEBGL);
215
+ * createCanvas(200, 200, WEBGL); // Create 3D canvas
214
216
  * }
215
217
  *
216
218
  * function draw() {
217
- * background(200);
218
- * rotateZ(radians(rotationZ));
219
- * //rotateX(radians(rotationX));
220
- * //rotateY(radians(rotationY));
221
- * box(200, 200, 200);
222
- * describe(`red horizontal line right, green vertical line bottom.
223
- * black background.`);
219
+ * background(220);
220
+ * rotateZ(radians(rotationZ)); // Rotate around Z-axis
221
+ * normalMaterial(); // Apply simple shaded material
222
+ * box(60); // Draw 3D cube
223
+ * rotationZ = (rotationZ + 2) % 360; // Increment rotation angle
224
224
  * }
225
225
  * </code>
226
226
  * </div>
@@ -663,7 +663,6 @@ function keyboard(p5, fn){
663
663
 
664
664
  };
665
665
 
666
-
667
666
  /**
668
667
  * A function that's called once when keys with printable characters are pressed.
669
668
  *
@@ -795,7 +794,7 @@ function keyboard(p5, fn){
795
794
  * </div>
796
795
  */
797
796
  fn._onkeypress = function(e) {
798
- if (e.which === this._lastKeyCodeTyped) {
797
+ if (e.which === this._lastKeyCodeTyped && e.repeat) {
799
798
  // prevent multiple firings
800
799
  return;
801
800
  }
@@ -833,10 +832,16 @@ function keyboard(p5, fn){
833
832
  * }
834
833
  * ```
835
834
  *
836
- * `keyIsDown()` can check for key presses using
837
- * <a href="#/p5/keyCode">keyCode</a> values, as in `keyIsDown(37)` or
838
- * `keyIsDown(LEFT_ARROW)`. Key codes can be found on websites such as
839
- * <a href="https://keycode.info" target="_blank">keycode.info</a>.
835
+ * `keyIsDown()` can check for key presses using strings based on
836
+ * <a href="https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key" target="_blank">KeyboardEvent.key</a>
837
+ * or <a href="https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code" target="_blank">KeyboardEvent.code</a> values,
838
+ * such as `keyIsDown('x')` or `keyIsDown('ArrowLeft')`.
839
+ *
840
+ * Note: In p5.js 2.0 and newer, numeric keycodes (such as 88 for 'X') are no longer supported.
841
+ * This is a breaking change from previous versions.
842
+ *
843
+ * You can still use the p5 constants like `LEFT_ARROW` which now map to string values
844
+ * internally rather than numeric codes.
840
845
  *
841
846
  * @method keyIsDown
842
847
  * @param {Number|String} code key to check.
@@ -1,4 +1,4 @@
1
- import { Z as THRESHOLD, U as POSTERIZE, $ as BLUR } from '../constants-C-g_eAdC.js';
1
+ import { Z as THRESHOLD, U as POSTERIZE, $ as BLUR } from '../constants-BRcElHU3.js';
2
2
 
3
3
  const filterParamDefaults = {
4
4
  [BLUR]: 3,
@@ -1,8 +1,8 @@
1
- import { T as Texture, e as filterOpaqueFrag, g as filterPosterizeFrag, h as filterDilateFrag, j as filterGrayFrag, k as filterErodeFrag, n as filterThresholdFrag, o as filterInvertFrag, q as filterBlurFrag, S as Shader, w as webgl2CompatibilityShader, u as filterBaseVert, v as filterBaseFrag, x as filterShaderVert } from '../rendering--aAe5aq3.js';
2
- import { I as Image } from '../p5.Renderer-CwAYZOC2.js';
3
- import { z as WEBGL2, K as OPAQUE, U as POSTERIZE, V as DILATE, X as GRAY, Y as ERODE, Z as THRESHOLD, _ as INVERT, $ as BLUR, e as CORNER, u as BLEND, a0 as WEBGL } from '../constants-C-g_eAdC.js';
1
+ import { T as Texture, e as filterOpaqueFrag, g as filterPosterizeFrag, h as filterDilateFrag, j as filterGrayFrag, k as filterErodeFrag, n as filterThresholdFrag, o as filterInvertFrag, q as filterBlurFrag, S as Shader, w as webgl2CompatibilityShader, u as filterBaseVert, v as filterBaseFrag, x as filterShaderVert } from '../rendering-CvUVN-Vb.js';
2
+ import { I as Image } from '../p5.Renderer-R23xoC7s.js';
3
+ import { z as WEBGL2, K as OPAQUE, U as POSTERIZE, V as DILATE, X as GRAY, Y as ERODE, Z as THRESHOLD, _ as INVERT, $ as BLUR, e as CORNER, u as BLEND, a0 as WEBGL } from '../constants-BRcElHU3.js';
4
4
  import { filterParamDefaults } from './const.js';
5
- import '../creating_reading-D4AAKRbx.js';
5
+ import '../creating_reading-Cr8L2Jnm.js';
6
6
  import 'colorjs.io/fn';
7
7
  import '../color/color_spaces/hsb.js';
8
8
  import '../dom/p5.Element.js';
@@ -1,13 +1,13 @@
1
1
  import 'omggif';
2
2
  import '../dom/p5.Element.js';
3
- export { i as default } from '../rendering--aAe5aq3.js';
3
+ export { i as default } from '../rendering-CvUVN-Vb.js';
4
4
  import '../dom/p5.File.js';
5
5
  import '../io/p5.XML.js';
6
- import '../creating_reading-D4AAKRbx.js';
6
+ import '../creating_reading-Cr8L2Jnm.js';
7
7
  import 'colorjs.io/fn';
8
8
  import '../color/color_spaces/hsb.js';
9
- import '../constants-C-g_eAdC.js';
10
- import '../p5.Renderer-CwAYZOC2.js';
9
+ import '../constants-BRcElHU3.js';
10
+ import '../p5.Renderer-R23xoC7s.js';
11
11
  import './filters.js';
12
12
  import '../math/p5.Vector.js';
13
13
  import '../shape/custom_shapes.js';
@@ -1,8 +1,8 @@
1
- import { i as image$1, b as loadingDisplaying, s as shader, t as texture } from '../rendering--aAe5aq3.js';
2
- import { i as image$2 } from '../p5.Renderer-CwAYZOC2.js';
1
+ import { i as image$1, b as loadingDisplaying, s as shader, t as texture } from '../rendering-CvUVN-Vb.js';
2
+ import { i as image$2 } from '../p5.Renderer-R23xoC7s.js';
3
3
  import pixels from './pixels.js';
4
- import '../constants-C-g_eAdC.js';
5
- import '../creating_reading-D4AAKRbx.js';
4
+ import '../constants-BRcElHU3.js';
5
+ import '../creating_reading-Cr8L2Jnm.js';
6
6
  import 'colorjs.io/fn';
7
7
  import '../color/color_spaces/hsb.js';
8
8
  import '../dom/p5.Element.js';
@@ -1,15 +1,15 @@
1
1
  import '../core/helpers.js';
2
- import '../constants-C-g_eAdC.js';
3
- export { b as default } from '../rendering--aAe5aq3.js';
2
+ import '../constants-BRcElHU3.js';
3
+ export { b as default } from '../rendering-CvUVN-Vb.js';
4
4
  import 'omggif';
5
5
  import 'gifenc';
6
- import '../creating_reading-D4AAKRbx.js';
6
+ import '../creating_reading-Cr8L2Jnm.js';
7
7
  import 'colorjs.io/fn';
8
8
  import '../color/color_spaces/hsb.js';
9
9
  import '../dom/p5.Element.js';
10
10
  import '../dom/p5.File.js';
11
11
  import '../io/p5.XML.js';
12
- import '../p5.Renderer-CwAYZOC2.js';
12
+ import '../p5.Renderer-R23xoC7s.js';
13
13
  import './filters.js';
14
14
  import '../math/p5.Vector.js';
15
15
  import '../shape/custom_shapes.js';
@@ -1,10 +1,10 @@
1
1
  import './filters.js';
2
- export { I as Image, i as default } from '../p5.Renderer-CwAYZOC2.js';
2
+ export { I as Image, i as default } from '../p5.Renderer-R23xoC7s.js';
3
3
  import '../io/utilities.js';
4
- import '../creating_reading-D4AAKRbx.js';
4
+ import '../creating_reading-Cr8L2Jnm.js';
5
5
  import 'colorjs.io/fn';
6
6
  import '../color/color_spaces/hsb.js';
7
- import '../constants-C-g_eAdC.js';
7
+ import '../constants-BRcElHU3.js';
8
8
  import '../math/p5.Vector.js';
9
9
  import '../shape/custom_shapes.js';
10
10
  import '../core/States.js';
@@ -42,6 +42,7 @@ function pixels(p5, fn){
42
42
  * <code>
43
43
  * function setup() {
44
44
  * createCanvas(100, 100);
45
+ * background(128);
45
46
  *
46
47
  * // Load the pixels array.
47
48
  * loadPixels();
package/dist/io/files.js CHANGED
@@ -1,11 +1,11 @@
1
- import '../p5.Renderer-CwAYZOC2.js';
2
- export { d as default, a as request } from '../rendering--aAe5aq3.js';
1
+ import '../p5.Renderer-R23xoC7s.js';
2
+ export { d as default, a as request } from '../rendering-CvUVN-Vb.js';
3
3
  import './csv.js';
4
4
  import './utilities.js';
5
- import '../creating_reading-D4AAKRbx.js';
5
+ import '../creating_reading-Cr8L2Jnm.js';
6
6
  import 'colorjs.io/fn';
7
7
  import '../color/color_spaces/hsb.js';
8
- import '../constants-C-g_eAdC.js';
8
+ import '../constants-BRcElHU3.js';
9
9
  import '../image/filters.js';
10
10
  import '../math/p5.Vector.js';
11
11
  import '../shape/custom_shapes.js';
package/dist/io/index.js CHANGED
@@ -1,14 +1,14 @@
1
- import { d as files } from '../rendering--aAe5aq3.js';
1
+ import { d as files } from '../rendering-CvUVN-Vb.js';
2
2
  import table from './p5.Table.js';
3
3
  import tableRow from './p5.TableRow.js';
4
4
  import xml from './p5.XML.js';
5
- import '../constants-C-g_eAdC.js';
6
- import '../creating_reading-D4AAKRbx.js';
5
+ import '../constants-BRcElHU3.js';
6
+ import '../creating_reading-Cr8L2Jnm.js';
7
7
  import 'colorjs.io/fn';
8
8
  import '../color/color_spaces/hsb.js';
9
9
  import '../dom/p5.Element.js';
10
10
  import '../dom/p5.File.js';
11
- import '../p5.Renderer-CwAYZOC2.js';
11
+ import '../p5.Renderer-R23xoC7s.js';
12
12
  import '../image/filters.js';
13
13
  import '../math/p5.Vector.js';
14
14
  import '../shape/custom_shapes.js';
@@ -255,8 +255,8 @@ class TableRow {
255
255
  * let table;
256
256
  *
257
257
  * async function setup() {
258
- * // Create a 200x100 canvas and set a white background
259
- * createCanvas(200, 100);
258
+ * // Create a 300x100 canvas and set a white background
259
+ * createCanvas(300, 100);
260
260
  * background(255);
261
261
  *
262
262
  * // Load the CSV file with a header row
@@ -1,12 +1,12 @@
1
- import { P as P2D, a0 as WEBGL, u as BLEND, a2 as _DEFAULT_FILL, a3 as _DEFAULT_STROKE, j as ROUND, a4 as REMOVE, a5 as SUBTRACT, a6 as DARKEST, a7 as LIGHTEST, a8 as DIFFERENCE, a9 as MULTIPLY, aa as EXCLUSION, ab as SCREEN, ac as REPLACE, ad as OVERLAY, ae as HARD_LIGHT, af as SOFT_LIGHT, ag as DODGE, ah as BURN, ai as ADD, aj as PIE, ak as CHORD, f as TWO_PI, S as SQUARE, k as PROJECT, B as BEVEL, l as MITER, O as OPEN, v as constants, al as VERSION } from './constants-C-g_eAdC.js';
1
+ import { P as P2D, a0 as WEBGL, u as BLEND, a2 as _DEFAULT_FILL, a3 as _DEFAULT_STROKE, j as ROUND, a4 as REMOVE, a5 as SUBTRACT, a6 as DARKEST, a7 as LIGHTEST, a8 as DIFFERENCE, a9 as MULTIPLY, aa as EXCLUSION, ab as SCREEN, ac as REPLACE, ad as OVERLAY, ae as HARD_LIGHT, af as SOFT_LIGHT, ag as DODGE, ah as BURN, ai as ADD, aj as PIE, ak as CHORD, f as TWO_PI, S as SQUARE, k as PROJECT, B as BEVEL, l as MITER, O as OPEN, v as constants, al as VERSION } from './constants-BRcElHU3.js';
2
2
  import transform from './core/transform.js';
3
3
  import structure from './core/structure.js';
4
4
  import environment from './core/environment.js';
5
- import { G as Graphics, y as rendering, z as graphics } from './rendering--aAe5aq3.js';
6
- import { R as Renderer, I as Image, r as renderer } from './p5.Renderer-CwAYZOC2.js';
5
+ import { G as Graphics, y as rendering, z as graphics } from './rendering-CvUVN-Vb.js';
6
+ import { R as Renderer, I as Image, r as renderer } from './p5.Renderer-R23xoC7s.js';
7
7
  import { Element } from './dom/p5.Element.js';
8
8
  import { MediaElement } from './dom/p5.MediaElement.js';
9
- import { b as RGBHDR } from './creating_reading-D4AAKRbx.js';
9
+ import { b as RGBHDR } from './creating_reading-Cr8L2Jnm.js';
10
10
  import FilterRenderer2D from './image/filterRenderer2D.js';
11
11
  import './math/p5.Matrix.js';
12
12
  import { PrimitiveToPath2DConverter } from './shape/custom_shapes.js';
@@ -1521,10 +1521,14 @@ for (const k in constants) {
1521
1521
  * ```
1522
1522
  *
1523
1523
  * Code placed in `setup()` will run once before code placed in
1524
- * <a href="#/p5/draw">draw()</a> begins looping. If the
1525
- * <a href="#/p5/preload">preload()</a> is declared, then `setup()` will
1526
- * run immediately after <a href="#/p5/preload">preload()</a> finishes
1527
- *
1524
+ * <a href="#/p5/draw">draw()</a> begins looping.
1525
+ * If `setup()` is declared `async` (e.g. `async function setup()`),
1526
+ * execution pauses at each `await` until its promise resolves.
1527
+ * For example, `font = await loadFont(...)` waits for the font asset
1528
+ * to load because `loadFont()` function returns a promise, and the await
1529
+ * keyword means the program will wait for the promise to resolve.
1530
+ * This ensures that all assets are fully loaded before the sketch continues.
1531
+
1528
1532
  *
1529
1533
  * loading assets.
1530
1534
  *
@@ -1596,7 +1600,6 @@ for (const k in constants) {
1596
1600
  * </code>
1597
1601
  * </div>
1598
1602
  */
1599
-
1600
1603
  /**
1601
1604
  * A function that's called repeatedly while the sketch runs.
1602
1605
  *
@@ -1,6 +1,6 @@
1
1
  import { Vector } from '../p5.Vector.js';
2
2
  import { MatrixInterface } from './MatrixInterface.js';
3
- import '../../constants-C-g_eAdC.js';
3
+ import '../../constants-BRcElHU3.js';
4
4
 
5
5
  /**
6
6
  * @module Math
@@ -1,7 +1,7 @@
1
1
  import nj from '@d4c/numjs/build/module/numjs.min.js';
2
2
  import { Vector } from '../p5.Vector.js';
3
3
  import { MatrixInterface } from './MatrixInterface.js';
4
- import '../../constants-C-g_eAdC.js';
4
+ import '../../constants-BRcElHU3.js';
5
5
 
6
6
  let isMatrixArray = (x) => Array.isArray(x);
7
7
  if (typeof Float32Array !== "undefined") {
@@ -4,7 +4,7 @@ import random from './random.js';
4
4
  import trigonometry from './trigonometry.js';
5
5
  import math$1 from './math.js';
6
6
  import vector from './p5.Vector.js';
7
- import '../constants-C-g_eAdC.js';
7
+ import '../constants-BRcElHU3.js';
8
8
 
9
9
  function math(p5){
10
10
  p5.registerAddon(calculation);
package/dist/math/math.js CHANGED
@@ -34,7 +34,7 @@ function math(p5, fn) {
34
34
  * <a href="#/p5.Vector">p5.Vector</a> class.
35
35
  *
36
36
  * @method createVector
37
- * @param {...Number} components Components of the vector.
37
+ * @param {...Number} x Zero or more numbers, representing each component of the vector.
38
38
  * @return {p5.Vector} new <a href="#/p5.Vector">p5.Vector</a> object.
39
39
  *
40
40
  * @example
@@ -1,6 +1,6 @@
1
1
  import { Matrix } from './Matrices/Matrix.js';
2
2
  import './p5.Vector.js';
3
- import '../constants-C-g_eAdC.js';
3
+ import '../constants-BRcElHU3.js';
4
4
  import './Matrices/MatrixInterface.js';
5
5
 
6
6
  /**
@@ -1,4 +1,4 @@
1
- import { f as TWO_PI } from '../constants-C-g_eAdC.js';
1
+ import { f as TWO_PI } from '../constants-BRcElHU3.js';
2
2
 
3
3
  /**
4
4
  * @module Math
@@ -1,4 +1,4 @@
1
- import { x as RAD_TO_DEG, D as DEG_TO_RAD } from '../constants-C-g_eAdC.js';
1
+ import { x as RAD_TO_DEG, D as DEG_TO_RAD } from '../constants-BRcElHU3.js';
2
2
 
3
3
  /**
4
4
  * @module Math