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
@@ -1,11 +1,10 @@
1
1
  import './filters.js';
2
- export { I as Image, i as default } from '../p5.Renderer-QoFcvj3f.js';
2
+ export { I as Image, i as default } from '../p5.Renderer-D-5LdCRz.js';
3
3
  import '../io/utilities.js';
4
- import '../creating_reading-CgHCHxqN.js';
4
+ import '../creating_reading-ZXzcZEsb.js';
5
5
  import 'colorjs.io/fn';
6
6
  import '../color/color_spaces/hsb.js';
7
- import '../constants-DEJVKr9Z.js';
7
+ import '../constants-DQyACdzq.js';
8
8
  import '../math/p5.Vector.js';
9
9
  import '../shape/custom_shapes.js';
10
10
  import '../core/States.js';
11
- import 'file-saver';
@@ -44,8 +44,6 @@ function pixels(p5, fn){
44
44
  * SOFT_LIGHT, DODGE, BURN, ADD or NORMAL.
45
45
  *
46
46
  * @example
47
- * <div>
48
- * <code>
49
47
  * let img0;
50
48
  * let img1;
51
49
  *
@@ -67,11 +65,8 @@ function pixels(p5, fn){
67
65
  *
68
66
  * describe('A wall of bricks in front of a mountain landscape. The same wall of bricks appears faded on the right of the image.');
69
67
  * }
70
- * </code>
71
- * </div>
72
68
  *
73
- * <div>
74
- * <code>
69
+ * @example
75
70
  * let img0;
76
71
  * let img1;
77
72
  *
@@ -93,11 +88,8 @@ function pixels(p5, fn){
93
88
  *
94
89
  * describe('A wall of bricks in front of a mountain landscape. The same wall of bricks appears transparent on the right of the image.');
95
90
  * }
96
- * </code>
97
- * </div>
98
91
  *
99
- * <div>
100
- * <code>
92
+ * @example
101
93
  * let img0;
102
94
  * let img1;
103
95
  *
@@ -119,8 +111,6 @@ function pixels(p5, fn){
119
111
  *
120
112
  * describe('A wall of bricks in front of a mountain landscape. The same wall of bricks appears washed out on the right of the image.');
121
113
  * }
122
- * </code>
123
- * </div>
124
114
  */
125
115
  /**
126
116
  * @method blend
@@ -172,8 +162,6 @@ function pixels(p5, fn){
172
162
  * @param {Integer} dh destination image height.
173
163
  *
174
164
  * @example
175
- * <div>
176
- * <code>
177
165
  * let img;
178
166
  *
179
167
  * async function setup() {
@@ -195,8 +183,6 @@ function pixels(p5, fn){
195
183
  *
196
184
  * describe('An image of a mountain landscape. A square region is outlined in white. A larger square contains a pixelated view of the outlined region.');
197
185
  * }
198
- * </code>
199
- * </div>
200
186
  */
201
187
  /**
202
188
  * @method copy
@@ -347,8 +333,6 @@ function pixels(p5, fn){
347
333
  * filters (CPU); defaults to `true`.
348
334
  *
349
335
  * @example
350
- * <div>
351
- * <code>
352
336
  * let img;
353
337
  *
354
338
  * async function setup() {
@@ -365,11 +349,8 @@ function pixels(p5, fn){
365
349
  *
366
350
  * describe('A blue brick wall.');
367
351
  * }
368
- * </code>
369
- * </div>
370
352
  *
371
- * <div>
372
- * <code>
353
+ * @example
373
354
  * let img;
374
355
  *
375
356
  * async function setup() {
@@ -386,11 +367,8 @@ function pixels(p5, fn){
386
367
  *
387
368
  * describe('A brick wall drawn in grayscale.');
388
369
  * }
389
- * </code>
390
- * </div>
391
370
  *
392
- * <div>
393
- * <code>
371
+ * @example
394
372
  * let img;
395
373
  *
396
374
  * async function setup() {
@@ -407,11 +385,8 @@ function pixels(p5, fn){
407
385
  *
408
386
  * describe('A brick wall drawn in black and white.');
409
387
  * }
410
- * </code>
411
- * </div>
412
388
  *
413
- * <div>
414
- * <code>
389
+ * @example
415
390
  * let img;
416
391
  *
417
392
  * async function setup() {
@@ -428,11 +403,8 @@ function pixels(p5, fn){
428
403
  *
429
404
  * describe('A red brick wall.');
430
405
  * }
431
- * </code>
432
- * </div>
433
406
  *
434
- * <div>
435
- * <code>
407
+ * @example
436
408
  * let img;
437
409
  *
438
410
  * async function setup() {
@@ -449,11 +421,8 @@ function pixels(p5, fn){
449
421
  *
450
422
  * describe('An image of a red brick wall drawn with limited color palette.');
451
423
  * }
452
- * </code>
453
- * </div>
454
424
  *
455
- * <div>
456
- * <code>
425
+ * @example
457
426
  * let img;
458
427
  *
459
428
  * async function setup() {
@@ -470,11 +439,8 @@ function pixels(p5, fn){
470
439
  *
471
440
  * describe('A blurry image of a red brick wall.');
472
441
  * }
473
- * </code>
474
- * </div>
475
442
  *
476
- * <div>
477
- * <code>
443
+ * @example
478
444
  * let img;
479
445
  *
480
446
  * async function setup() {
@@ -491,11 +457,8 @@ function pixels(p5, fn){
491
457
  *
492
458
  * describe('A red brick wall with bright lines between each brick.');
493
459
  * }
494
- * </code>
495
- * </div>
496
460
  *
497
- * <div>
498
- * <code>
461
+ * @example
499
462
  * let img;
500
463
  *
501
464
  * async function setup() {
@@ -512,11 +475,8 @@ function pixels(p5, fn){
512
475
  *
513
476
  * describe('A red brick wall with faint lines between each brick.');
514
477
  * }
515
- * </code>
516
- * </div>
517
478
  *
518
- * <div>
519
- * <code>
479
+ * @example
520
480
  * let img;
521
481
  *
522
482
  * async function setup() {
@@ -534,8 +494,6 @@ function pixels(p5, fn){
534
494
  *
535
495
  * describe('A blurry image of a red brick wall.');
536
496
  * }
537
- * </code>
538
- * </div>
539
497
  */
540
498
 
541
499
  /**
@@ -661,8 +619,6 @@ function pixels(p5, fn){
661
619
  * @param {Number} h height of the subsection to be returned.
662
620
  * @return {p5.Image} subsection as a <a href="#/p5.Image">p5.Image</a> object.
663
621
  * @example
664
- * <div>
665
- * <code>
666
622
  * let img;
667
623
  *
668
624
  * async function setup() {
@@ -682,11 +638,8 @@ function pixels(p5, fn){
682
638
  *
683
639
  * describe('Two identical mountain landscapes shown side-by-side.');
684
640
  * }
685
- * </code>
686
- * </div>
687
641
  *
688
- * <div>
689
- * <code>
642
+ * @example
690
643
  * let img;
691
644
  *
692
645
  * async function setup() {
@@ -710,11 +663,8 @@ function pixels(p5, fn){
710
663
  *
711
664
  * describe('A mountain landscape with an olive green square in its center.');
712
665
  * }
713
- * </code>
714
- * </div>
715
666
  *
716
- * <div>
717
- * <code>
667
+ * @example
718
668
  * let img;
719
669
  *
720
670
  * async function setup() {
@@ -734,8 +684,6 @@ function pixels(p5, fn){
734
684
  *
735
685
  * describe('A mountain landscape drawn on top of another mountain landscape.');
736
686
  * }
737
- * </code>
738
- * </div>
739
687
  */
740
688
  /**
741
689
  * @method get
@@ -761,8 +709,6 @@ function pixels(p5, fn){
761
709
  *
762
710
  * @method loadPixels
763
711
  * @example
764
- * <div>
765
- * <code>
766
712
  * let img;
767
713
  *
768
714
  * async function setup() {
@@ -793,8 +739,6 @@ function pixels(p5, fn){
793
739
  *
794
740
  * describe('Two identical images of mountain landscapes, one on top of the other.');
795
741
  * }
796
- * </code>
797
- * </div>
798
742
  */
799
743
  fn.loadPixels = function(...args) {
800
744
  // p5._validateParameters('loadPixels', args);
@@ -824,8 +768,6 @@ function pixels(p5, fn){
824
768
  * @param {Number|Number[]|Object} c grayscale value | pixel array |
825
769
  * <a href="#/p5.Color">p5.Color</a> object | <a href="#/p5.Image">p5.Image</a> to copy.
826
770
  * @example
827
- * <div>
828
- * <code>
829
771
  * function setup() {
830
772
  * createCanvas(100, 100);
831
773
  *
@@ -842,11 +784,8 @@ function pixels(p5, fn){
842
784
  *
843
785
  * describe('Four black dots arranged in a square drawn on a gray background.');
844
786
  * }
845
- * </code>
846
- * </div>
847
787
  *
848
- * <div>
849
- * <code>
788
+ * @example
850
789
  * function setup() {
851
790
  * createCanvas(100, 100);
852
791
  *
@@ -866,11 +805,8 @@ function pixels(p5, fn){
866
805
  *
867
806
  * describe('Four black dots arranged in a square drawn on a gray background.');
868
807
  * }
869
- * </code>
870
- * </div>
871
808
  *
872
- * <div>
873
- * <code>
809
+ * @example
874
810
  * function setup() {
875
811
  * createCanvas(100, 100);
876
812
  *
@@ -892,11 +828,8 @@ function pixels(p5, fn){
892
828
  *
893
829
  * describe('A horiztonal color gradient from black to white.');
894
830
  * }
895
- * </code>
896
- * </div>
897
831
  *
898
- * <div>
899
- * <code>
832
+ * @example
900
833
  * let img;
901
834
  *
902
835
  * async function setup() {
@@ -913,8 +846,6 @@ function pixels(p5, fn){
913
846
  *
914
847
  * describe('An image of a mountain landscape.');
915
848
  * }
916
- * </code>
917
- * </div>
918
849
  */
919
850
  fn.set = function(x, y, imgOrCol) {
920
851
  this._renderer.set(x, y, imgOrCol);
@@ -937,8 +868,6 @@ function pixels(p5, fn){
937
868
  * @param {Number} [w] width of region to update.
938
869
  * @param {Number} [h] height of region to update.
939
870
  * @example
940
- * <div>
941
- * <code>
942
871
  * let img;
943
872
  *
944
873
  * async function setup() {
@@ -969,8 +898,6 @@ function pixels(p5, fn){
969
898
  *
970
899
  * describe('Two identical images of mountain landscapes, one on top of the other.');
971
900
  * }
972
- * </code>
973
- * </div>
974
901
  */
975
902
  fn.updatePixels = function(x, y, w, h) {
976
903
  // p5._validateParameters('updatePixels', arguments);
@@ -1011,8 +938,6 @@ function pixels(p5, fn){
1011
938
  * @property {Number[]} pixels
1012
939
  *
1013
940
  * @example
1014
- * <div>
1015
- * <code>
1016
941
  * function setup() {
1017
942
  * createCanvas(100, 100);
1018
943
  * background(128);
@@ -1047,11 +972,8 @@ function pixels(p5, fn){
1047
972
  *
1048
973
  * describe('A black dot in the middle of a gray rectangle.');
1049
974
  * }
1050
- * </code>
1051
- * </div>
1052
975
  *
1053
- * <div>
1054
- * <code>
976
+ * @example
1055
977
  * function setup() {
1056
978
  * createCanvas(100, 100);
1057
979
  *
@@ -1081,11 +1003,8 @@ function pixels(p5, fn){
1081
1003
  *
1082
1004
  * describe('A red rectangle drawn above a gray rectangle.');
1083
1005
  * }
1084
- * </code>
1085
- * </div>
1086
1006
  *
1087
- * <div>
1088
- * <code>
1007
+ * @example
1089
1008
  * function setup() {
1090
1009
  * createCanvas(100, 100);
1091
1010
  *
@@ -1114,8 +1033,6 @@ function pixels(p5, fn){
1114
1033
  *
1115
1034
  * describe('A pink rectangle drawn above a gray rectangle.');
1116
1035
  * }
1117
- * </code>
1118
- * </div>
1119
1036
  */
1120
1037
  }
1121
1038
 
package/dist/io/files.js CHANGED
@@ -1,11 +1,11 @@
1
- import '../p5.Renderer-QoFcvj3f.js';
2
- export { d as default, a as request } from '../rendering-CsICjEXA.js';
1
+ import '../p5.Renderer-D-5LdCRz.js';
2
+ export { d as default, a as request } from '../rendering-h9unX5K0.js';
3
3
  import './csv.js';
4
4
  import './utilities.js';
5
- import '../creating_reading-CgHCHxqN.js';
5
+ import '../creating_reading-ZXzcZEsb.js';
6
6
  import 'colorjs.io/fn';
7
7
  import '../color/color_spaces/hsb.js';
8
- import '../constants-DEJVKr9Z.js';
8
+ import '../constants-DQyACdzq.js';
9
9
  import '../image/filters.js';
10
10
  import '../math/p5.Vector.js';
11
11
  import '../shape/custom_shapes.js';
@@ -30,7 +30,6 @@ import '../math/Matrices/Matrix.js';
30
30
  import '../math/Matrices/MatrixInterface.js';
31
31
  import '../webgl/p5.Geometry.js';
32
32
  import '../webgl/p5.DataArray.js';
33
- import 'file-saver';
34
33
  import '../webgl/p5.Quat.js';
35
34
  import '../webgl/ShapeBuilder.js';
36
35
  import 'libtess';
package/dist/io/index.js CHANGED
@@ -1,20 +1,19 @@
1
- import { d as files } from '../rendering-CsICjEXA.js';
1
+ import { d as files } from '../rendering-h9unX5K0.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-DEJVKr9Z.js';
6
- import '../creating_reading-CgHCHxqN.js';
5
+ import '../constants-DQyACdzq.js';
6
+ import '../creating_reading-ZXzcZEsb.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-QoFcvj3f.js';
11
+ import '../p5.Renderer-D-5LdCRz.js';
12
12
  import '../image/filters.js';
13
13
  import '../math/p5.Vector.js';
14
14
  import '../shape/custom_shapes.js';
15
15
  import '../core/States.js';
16
16
  import './utilities.js';
17
- import 'file-saver';
18
17
  import '../dom/p5.MediaElement.js';
19
18
  import '../shape/2d_primitives.js';
20
19
  import '../core/helpers.js';