p5 2.2.1-rc.0 → 2.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (117) hide show
  1. package/dist/accessibility/color_namer.js +5 -6
  2. package/dist/accessibility/describe.js +4 -26
  3. package/dist/accessibility/index.js +5 -6
  4. package/dist/accessibility/outputs.js +6 -38
  5. package/dist/app.js +5 -6
  6. package/dist/color/color_conversion.js +5 -6
  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 +59 -357
  11. package/dist/{constants-DEJVKr9Z.js → constants-DQyACdzq.js} +11 -61
  12. package/dist/core/constants.js +1 -1
  13. package/dist/core/environment.js +26 -158
  14. package/dist/core/filterShaders.js +1 -1
  15. package/dist/core/friendly_errors/fes_core.js +1 -1
  16. package/dist/core/friendly_errors/file_errors.js +1 -1
  17. package/dist/core/friendly_errors/index.js +1 -1
  18. package/dist/core/friendly_errors/param_validator.js +1 -1
  19. package/dist/core/friendly_errors/sketch_verifier.js +1 -1
  20. package/dist/core/helpers.js +1 -1
  21. package/dist/core/init.js +5 -6
  22. package/dist/core/internationalization.js +1 -1
  23. package/dist/core/legacy.js +5 -6
  24. package/dist/core/main.js +5 -6
  25. package/dist/core/p5.Graphics.js +4 -5
  26. package/dist/core/p5.Renderer.js +3 -4
  27. package/dist/core/p5.Renderer2D.js +5 -6
  28. package/dist/core/p5.Renderer3D.js +4 -5
  29. package/dist/core/rendering.js +4 -5
  30. package/dist/core/structure.js +13 -52
  31. package/dist/core/transform.js +32 -176
  32. package/dist/{creating_reading-CgHCHxqN.js → creating_reading-ZXzcZEsb.js} +3 -196
  33. package/dist/data/local_storage.js +4 -30
  34. package/dist/dom/dom.js +24 -159
  35. package/dist/dom/index.js +2 -2
  36. package/dist/dom/p5.Element.js +31 -208
  37. package/dist/dom/p5.File.js +1 -32
  38. package/dist/dom/p5.MediaElement.js +10 -113
  39. package/dist/events/acceleration.js +11 -64
  40. package/dist/events/keyboard.js +13 -81
  41. package/dist/events/pointer.js +18 -160
  42. package/dist/image/const.js +1 -1
  43. package/dist/image/filterRenderer2D.js +4 -5
  44. package/dist/image/image.js +4 -5
  45. package/dist/image/index.js +4 -5
  46. package/dist/image/loading_displaying.js +4 -5
  47. package/dist/image/p5.Image.js +3 -4
  48. package/dist/image/pixels.js +17 -100
  49. package/dist/io/files.js +4 -5
  50. package/dist/io/index.js +4 -5
  51. package/dist/io/p5.Table.js +66 -158
  52. package/dist/io/p5.TableRow.js +48 -71
  53. package/dist/io/p5.XML.js +6 -99
  54. package/dist/io/utilities.js +8 -3
  55. package/dist/{main-_RXV5Lx8.js → main-DvN69W3f.js} +13 -42
  56. package/dist/math/Matrices/Matrix.js +87 -126
  57. package/dist/math/Matrices/MatrixNumjs.js +1 -5
  58. package/dist/math/calculation.js +10 -112
  59. package/dist/math/index.js +1 -1
  60. package/dist/math/math.js +2 -12
  61. package/dist/math/noise.js +5 -32
  62. package/dist/math/p5.Matrix.js +3 -3
  63. package/dist/math/p5.Vector.js +104 -345
  64. package/dist/math/random.js +5 -32
  65. package/dist/math/trigonometry.js +15 -105
  66. package/dist/{p5.Renderer-QoFcvj3f.js → p5.Renderer-D-5LdCRz.js} +25 -178
  67. package/dist/{rendering-CsICjEXA.js → rendering-h9unX5K0.js} +254 -1156
  68. package/dist/shape/2d_primitives.js +33 -194
  69. package/dist/shape/attributes.js +12 -73
  70. package/dist/shape/curves.js +30 -95
  71. package/dist/shape/custom_shapes.js +63 -144
  72. package/dist/shape/index.js +2 -2
  73. package/dist/shape/vertex.js +21 -106
  74. package/dist/strands/p5.strands.js +248 -46
  75. package/dist/type/index.js +3 -4
  76. package/dist/type/p5.Font.js +4 -49
  77. package/dist/type/textCore.js +5 -158
  78. package/dist/utilities/conversion.js +17 -104
  79. package/dist/utilities/time_date.js +3 -40
  80. package/dist/utilities/utility_functions.js +6 -48
  81. package/dist/webgl/3d_primitives.js +4 -5
  82. package/dist/webgl/GeometryBuilder.js +1 -2
  83. package/dist/webgl/ShapeBuilder.js +22 -2
  84. package/dist/webgl/enums.js +1 -1
  85. package/dist/webgl/index.js +4 -5
  86. package/dist/webgl/interaction.js +6 -33
  87. package/dist/webgl/light.js +4 -5
  88. package/dist/webgl/loading.js +12 -46
  89. package/dist/webgl/material.js +4 -5
  90. package/dist/webgl/p5.Camera.js +4 -5
  91. package/dist/webgl/p5.DataArray.js +0 -4
  92. package/dist/webgl/p5.Framebuffer.js +4 -5
  93. package/dist/webgl/p5.Geometry.js +12 -106
  94. package/dist/webgl/p5.Quat.js +1 -1
  95. package/dist/webgl/p5.RendererGL.js +7 -18
  96. package/dist/webgl/p5.Shader.js +12 -36
  97. package/dist/webgl/p5.Texture.js +4 -5
  98. package/dist/webgl/text.js +4 -5
  99. package/dist/webgl/utils.js +4 -5
  100. package/dist/webgpu/index.js +1 -1
  101. package/dist/webgpu/p5.RendererWebGPU.js +529 -208
  102. package/dist/webgpu/shaders/color.js +32 -17
  103. package/dist/webgpu/shaders/filters/base.js +18 -7
  104. package/dist/webgpu/shaders/font.js +52 -40
  105. package/dist/webgpu/shaders/line.js +50 -36
  106. package/dist/webgpu/shaders/material.js +90 -83
  107. package/dist/webgpu/strands_wgslBackend.js +5 -2
  108. package/lib/p5.esm.js +5576 -7811
  109. package/lib/p5.esm.min.js +1 -1
  110. package/lib/p5.js +5576 -7811
  111. package/lib/p5.min.js +1 -1
  112. package/lib/p5.webgpu.esm.js +786 -453
  113. package/lib/p5.webgpu.js +786 -453
  114. package/lib/p5.webgpu.min.js +1 -1
  115. package/package.json +13 -13
  116. package/types/global.d.ts +16905 -16783
  117. package/types/p5.d.ts +11142 -11081
@@ -11,7 +11,7 @@ const _PI = Math.PI;
11
11
  * @property {String} VERSION
12
12
  * @final
13
13
  */
14
- const VERSION = '2.2.1-rc.0';
14
+ const VERSION = '2.2.1';
15
15
 
16
16
  // GRAPHICS RENDERER
17
17
  /**
@@ -146,8 +146,6 @@ const WAIT = 'wait';
146
146
  * @final
147
147
  *
148
148
  * @example
149
- * <div>
150
- * <code>
151
149
  * function setup() {
152
150
  * createCanvas(100, 100);
153
151
  *
@@ -158,11 +156,8 @@ const WAIT = 'wait';
158
156
  *
159
157
  * describe('The bottom-right quarter of a circle drawn in white on a gray background.');
160
158
  * }
161
- * </code>
162
- * </div>
163
159
  *
164
- * <div>
165
- * <code>
160
+ * @example
166
161
  * function setup() {
167
162
  * createCanvas(100, 100);
168
163
  *
@@ -182,11 +177,8 @@ const WAIT = 'wait';
182
177
  *
183
178
  * describe('Two black lines on a gray background. One line extends from the center to the right. The other line extends from the center to the bottom.');
184
179
  * }
185
- * </code>
186
- * </div>
187
180
  *
188
- * <div>
189
- * <code>
181
+ * @example
190
182
  * function setup() {
191
183
  * createCanvas(100, 100);
192
184
  *
@@ -216,8 +208,6 @@ const WAIT = 'wait';
216
208
  * fill(0, 0, 255);
217
209
  * circle(x2, 0, 20);
218
210
  * }
219
- * </code>
220
- * </div>
221
211
  */
222
212
  const HALF_PI = _PI / 2;
223
213
 
@@ -235,8 +225,6 @@ const HALF_PI = _PI / 2;
235
225
  * @final
236
226
  *
237
227
  * @example
238
- * <div>
239
- * <code>
240
228
  * function setup() {
241
229
  * createCanvas(100, 100);
242
230
  *
@@ -247,11 +235,8 @@ const HALF_PI = _PI / 2;
247
235
  *
248
236
  * describe('The bottom half of a circle drawn in white on a gray background.');
249
237
  * }
250
- * </code>
251
- * </div>
252
238
  *
253
- * <div>
254
- * <code>
239
+ * @example
255
240
  * function setup() {
256
241
  * createCanvas(100, 100);
257
242
  *
@@ -271,11 +256,8 @@ const HALF_PI = _PI / 2;
271
256
  *
272
257
  * describe('A horizontal black line on a gray background.');
273
258
  * }
274
- * </code>
275
- * </div>
276
259
  *
277
- * <div>
278
- * <code>
260
+ * @example
279
261
  * function setup() {
280
262
  * createCanvas(100, 100);
281
263
  *
@@ -305,8 +287,6 @@ const HALF_PI = _PI / 2;
305
287
  * fill(0, 0, 255);
306
288
  * circle(x2, 0, 20);
307
289
  * }
308
- * </code>
309
- * </div>
310
290
  */
311
291
  const PI = _PI;
312
292
 
@@ -325,8 +305,6 @@ const PI = _PI;
325
305
  * @final
326
306
  *
327
307
  * @example
328
- * <div>
329
- * <code>
330
308
  * function setup() {
331
309
  * createCanvas(100, 100);
332
310
  *
@@ -337,11 +315,8 @@ const PI = _PI;
337
315
  *
338
316
  * describe('A one-eighth slice of a circle drawn in white on a gray background.');
339
317
  * }
340
- * </code>
341
- * </div>
342
318
  *
343
- * <div>
344
- * <code>
319
+ * @example
345
320
  * function setup() {
346
321
  * createCanvas(100, 100);
347
322
  *
@@ -361,11 +336,8 @@ const PI = _PI;
361
336
  *
362
337
  * describe('Two black lines that form a "V" opening towards the bottom-right corner of a gray square.');
363
338
  * }
364
- * </code>
365
- * </div>
366
339
  *
367
- * <div>
368
- * <code>
340
+ * @example
369
341
  * function setup() {
370
342
  * createCanvas(100, 100);
371
343
  *
@@ -395,8 +367,6 @@ const PI = _PI;
395
367
  * fill(0, 0, 255);
396
368
  * circle(x2, 0, 20);
397
369
  * }
398
- * </code>
399
- * </div>
400
370
  */
401
371
  const QUARTER_PI = _PI / 4;
402
372
 
@@ -415,8 +385,6 @@ const QUARTER_PI = _PI / 4;
415
385
  * @final
416
386
  *
417
387
  * @example
418
- * <div>
419
- * <code>
420
388
  * function setup() {
421
389
  * createCanvas(100, 100);
422
390
  *
@@ -427,11 +395,8 @@ const QUARTER_PI = _PI / 4;
427
395
  *
428
396
  * describe('A white circle drawn on a gray background.');
429
397
  * }
430
- * </code>
431
- * </div>
432
398
  *
433
- * <div>
434
- * <code>
399
+ * @example
435
400
  * function setup() {
436
401
  * createCanvas(100, 100);
437
402
  *
@@ -456,11 +421,8 @@ const QUARTER_PI = _PI / 4;
456
421
  * 'Two horizontal black lines on a gray background. A thick line extends from the center toward the right. A thin line extends from the end of the thick line.'
457
422
  * );
458
423
  * }
459
- * </code>
460
- * </div>
461
424
  *
462
- * <div>
463
- * <code>
425
+ * @example
464
426
  * function setup() {
465
427
  * createCanvas(100, 100);
466
428
  *
@@ -490,8 +452,6 @@ const QUARTER_PI = _PI / 4;
490
452
  * fill(0, 0, 255);
491
453
  * circle(x2, 0, 10);
492
454
  * }
493
- * </code>
494
- * </div>
495
455
  */
496
456
  const TAU = _PI * 2;
497
457
 
@@ -510,8 +470,6 @@ const TAU = _PI * 2;
510
470
  * @final
511
471
  *
512
472
  * @example
513
- * <div>
514
- * <code>
515
473
  * function setup() {
516
474
  * createCanvas(100, 100);
517
475
  *
@@ -522,11 +480,8 @@ const TAU = _PI * 2;
522
480
  *
523
481
  * describe('A white circle drawn on a gray background.');
524
482
  * }
525
- * </code>
526
- * </div>
527
483
  *
528
- * <div>
529
- * <code>
484
+ * @example
530
485
  * function setup() {
531
486
  * createCanvas(100, 100);
532
487
  *
@@ -551,11 +506,8 @@ const TAU = _PI * 2;
551
506
  * 'Two horizontal black lines on a gray background. A thick line extends from the center toward the right. A thin line extends from the end of the thick line.'
552
507
  * );
553
508
  * }
554
- * </code>
555
- * </div>
556
509
  *
557
- * <div>
558
- * <code>
510
+ * @example
559
511
  * function setup() {
560
512
  * createCanvas(100, 100);
561
513
  *
@@ -585,8 +537,6 @@ const TAU = _PI * 2;
585
537
  * fill(0, 0, 255);
586
538
  * circle(x2, 0, 10);
587
539
  * }
588
- * </code>
589
- * </div>
590
540
  */
591
541
  const TWO_PI = _PI * 2;
592
542
 
@@ -1 +1 @@
1
- export { A as ADD, aN as ALT, j as ARROW, a4 as AUTO, i as AXES, aO as BACKSPACE, ax as BASELINE, z as BEVEL, b7 as BEZIER, B as BLEND, ab as BLUR, b0 as BOLD, b1 as BOLDITALIC, aw as BOTTOM, as as BURN, v as CENTER, b2 as CHAR, au as CHORD, C as CLAMP, V as CLOSE, aC as CONTAIN, aP as CONTROL, p as CORNER, t as CORNERS, aB as COVER, k as CROSS, b8 as CURVE, D as DARKEST, a6 as DEG_TO_RAD, aQ as DELETE, an as DIFFERENCE, ah as DILATE, ar as DODGE, aR as DOWN_ARROW, O as EMPTY_PATH, aS as ENTER, ai as ERODE, aT as ESCAPE, a0 as EXCLUDE, E as EXCLUSION, be as FALLBACK, aD as FILL, a7 as FLAT, F as FLOAT, aF as FULL, ak as GRAY, G as GRID, H as HALF_FLOAT, r as HALF_PI, l as HAND, ap as HARD_LIGHT, ad as IMAGE, ba as IMMEDIATE, J as INCLUDE, aj as INVERT, a$ as ITALIC, a1 as JOIN, bd as LABEL, bb as LANDSCAPE, av as LEFT, aU as LEFT_ARROW, L as LIGHTEST, g as LINEAR, aG as LINEAR_MIPMAP, Y as LINES, aL as LINE_LOOP, aK as LINE_STRIP, e as MIRROR, I as MITER, m as MOVE, M as MULTIPLY, N as NEAREST, a2 as NORMAL, ag as OPAQUE, Q as OPEN, aV as OPTION, ao as OVERLAY, P as P2D, aH as P2DHDR, K as PATH, s as PI, at as PIE, X as POINTS, bc as PORTRAIT, af as POSTERIZE, y as PROJECT, b6 as QUADRATIC, Z as QUADS, $ as QUAD_STRIP, aI as QUARTER_PI, u as RADIUS, a5 as RAD_TO_DEG, b as REMOVE, f as REPEAT, R as REPLACE, aW as RETURN, a9 as RIGHT, aX as RIGHT_ARROW, w as ROUND, a as SCREEN, aY as SHIFT, aE as SIMPLE, a8 as SMOOTH, aq as SOFT_LIGHT, x as SQUARE, b9 as STROKE, S as SUBTRACT, aZ as TAB, aJ as TAU, aM as TESS, n as TEXT, h as TEXTURE, ae as THRESHOLD, ay as TOP, c as TRIANGLES, _ as TRIANGLE_FAN, T as TRIANGLE_STRIP, q as TWO_PI, U as UNSIGNED_BYTE, d as UNSIGNED_INT, a_ as UP_ARROW, az as VERSION, o as WAIT, ac as WEBGL, aa as WEBGL2, W as WEBGPU, aA as WORD, b5 as _CTX_MIDDLE, al as _DEFAULT_FILL, b4 as _DEFAULT_LEADMULT, am as _DEFAULT_STROKE, b3 as _DEFAULT_TEXT_FILL } from '../constants-DEJVKr9Z.js';
1
+ export { A as ADD, aN as ALT, j as ARROW, a4 as AUTO, i as AXES, aO as BACKSPACE, ax as BASELINE, z as BEVEL, b7 as BEZIER, B as BLEND, ab as BLUR, b0 as BOLD, b1 as BOLDITALIC, aw as BOTTOM, as as BURN, v as CENTER, b2 as CHAR, au as CHORD, C as CLAMP, V as CLOSE, aC as CONTAIN, aP as CONTROL, p as CORNER, t as CORNERS, aB as COVER, k as CROSS, b8 as CURVE, D as DARKEST, a6 as DEG_TO_RAD, aQ as DELETE, an as DIFFERENCE, ah as DILATE, ar as DODGE, aR as DOWN_ARROW, O as EMPTY_PATH, aS as ENTER, ai as ERODE, aT as ESCAPE, a0 as EXCLUDE, E as EXCLUSION, be as FALLBACK, aD as FILL, a7 as FLAT, F as FLOAT, aF as FULL, ak as GRAY, G as GRID, H as HALF_FLOAT, r as HALF_PI, l as HAND, ap as HARD_LIGHT, ad as IMAGE, ba as IMMEDIATE, J as INCLUDE, aj as INVERT, a$ as ITALIC, a1 as JOIN, bd as LABEL, bb as LANDSCAPE, av as LEFT, aU as LEFT_ARROW, L as LIGHTEST, g as LINEAR, aG as LINEAR_MIPMAP, Y as LINES, aL as LINE_LOOP, aK as LINE_STRIP, e as MIRROR, I as MITER, m as MOVE, M as MULTIPLY, N as NEAREST, a2 as NORMAL, ag as OPAQUE, Q as OPEN, aV as OPTION, ao as OVERLAY, P as P2D, aH as P2DHDR, K as PATH, s as PI, at as PIE, X as POINTS, bc as PORTRAIT, af as POSTERIZE, y as PROJECT, b6 as QUADRATIC, Z as QUADS, $ as QUAD_STRIP, aI as QUARTER_PI, u as RADIUS, a5 as RAD_TO_DEG, b as REMOVE, f as REPEAT, R as REPLACE, aW as RETURN, a9 as RIGHT, aX as RIGHT_ARROW, w as ROUND, a as SCREEN, aY as SHIFT, aE as SIMPLE, a8 as SMOOTH, aq as SOFT_LIGHT, x as SQUARE, b9 as STROKE, S as SUBTRACT, aZ as TAB, aJ as TAU, aM as TESS, n as TEXT, h as TEXTURE, ae as THRESHOLD, ay as TOP, c as TRIANGLES, _ as TRIANGLE_FAN, T as TRIANGLE_STRIP, q as TWO_PI, U as UNSIGNED_BYTE, d as UNSIGNED_INT, a_ as UP_ARROW, az as VERSION, o as WAIT, ac as WEBGL, aa as WEBGL2, W as WEBGPU, aA as WORD, b5 as _CTX_MIDDLE, al as _DEFAULT_FILL, b4 as _DEFAULT_LEADMULT, am as _DEFAULT_STROKE, b3 as _DEFAULT_TEXT_FILL } from '../constants-DQyACdzq.js';