p5 2.2.2-rc.0 → 2.2.2-rc.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 (86) hide show
  1. package/dist/accessibility/color_namer.js +5 -5
  2. package/dist/accessibility/index.js +5 -5
  3. package/dist/app.js +5 -5
  4. package/dist/color/color_conversion.js +5 -5
  5. package/dist/color/creating_reading.js +1 -1
  6. package/dist/color/index.js +2 -2
  7. package/dist/color/p5.Color.js +1 -1
  8. package/dist/color/setting.js +2 -2
  9. package/dist/{constants-D3npMLOW.js → constants--VqmEGYW.js} +1 -1
  10. package/dist/core/constants.js +1 -1
  11. package/dist/core/environment.js +1 -1
  12. package/dist/core/filterShaders.js +1 -1
  13. package/dist/core/friendly_errors/fes_core.js +1 -1
  14. package/dist/core/friendly_errors/file_errors.js +1 -1
  15. package/dist/core/friendly_errors/index.js +1 -1
  16. package/dist/core/friendly_errors/param_validator.js +1 -1
  17. package/dist/core/friendly_errors/sketch_verifier.js +1 -1
  18. package/dist/core/helpers.js +1 -1
  19. package/dist/core/init.js +5 -5
  20. package/dist/core/internationalization.js +1 -1
  21. package/dist/core/legacy.js +5 -5
  22. package/dist/core/main.js +5 -5
  23. package/dist/core/p5.Graphics.js +4 -4
  24. package/dist/core/p5.Renderer.js +3 -3
  25. package/dist/core/p5.Renderer2D.js +5 -5
  26. package/dist/core/p5.Renderer3D.js +4 -4
  27. package/dist/core/rendering.js +4 -4
  28. package/dist/{creating_reading-ZXzcZEsb.js → creating_reading-C7hu6sg1.js} +2 -2
  29. package/dist/dom/dom.js +2 -2
  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/image/const.js +1 -1
  34. package/dist/image/filterRenderer2D.js +4 -4
  35. package/dist/image/image.js +4 -4
  36. package/dist/image/index.js +4 -4
  37. package/dist/image/loading_displaying.js +4 -4
  38. package/dist/image/p5.Image.js +3 -3
  39. package/dist/io/files.js +4 -4
  40. package/dist/io/index.js +4 -4
  41. package/dist/{main-C5AeICIY.js → main-DifEeQiX.js} +4 -4
  42. package/dist/math/Matrices/Matrix.js +1 -1
  43. package/dist/math/Matrices/MatrixNumjs.js +1 -1
  44. package/dist/math/index.js +1 -1
  45. package/dist/math/p5.Matrix.js +1 -1
  46. package/dist/math/p5.Vector.js +1 -1
  47. package/dist/math/trigonometry.js +1 -1
  48. package/dist/{p5.Renderer-xpFkUQC6.js → p5.Renderer-BuaG4snH.js} +2 -2
  49. package/dist/{rendering-B8po3Onj.js → rendering-uHkWQXtu.js} +3 -3
  50. package/dist/shape/2d_primitives.js +1 -1
  51. package/dist/shape/attributes.js +1 -1
  52. package/dist/shape/custom_shapes.js +2 -2
  53. package/dist/shape/index.js +2 -2
  54. package/dist/strands/strands_api.js +43 -14
  55. package/dist/type/index.js +3 -3
  56. package/dist/type/p5.Font.js +3 -3
  57. package/dist/type/textCore.js +3 -3
  58. package/dist/webgl/3d_primitives.js +4 -4
  59. package/dist/webgl/GeometryBuilder.js +1 -1
  60. package/dist/webgl/ShapeBuilder.js +1 -1
  61. package/dist/webgl/enums.js +1 -1
  62. package/dist/webgl/index.js +4 -4
  63. package/dist/webgl/interaction.js +1 -1
  64. package/dist/webgl/light.js +4 -4
  65. package/dist/webgl/loading.js +4 -4
  66. package/dist/webgl/material.js +4 -4
  67. package/dist/webgl/p5.Camera.js +4 -4
  68. package/dist/webgl/p5.Framebuffer.js +4 -4
  69. package/dist/webgl/p5.Geometry.js +1 -1
  70. package/dist/webgl/p5.Quat.js +1 -1
  71. package/dist/webgl/p5.RendererGL.js +4 -4
  72. package/dist/webgl/p5.Texture.js +4 -4
  73. package/dist/webgl/text.js +4 -4
  74. package/dist/webgl/utils.js +4 -4
  75. package/dist/webgpu/index.js +1 -1
  76. package/dist/webgpu/p5.RendererWebGPU.js +2 -2
  77. package/lib/p5.esm.js +47 -18
  78. package/lib/p5.esm.min.js +1 -1
  79. package/lib/p5.js +47 -18
  80. package/lib/p5.min.js +1 -1
  81. package/lib/p5.webgpu.esm.js +2 -2
  82. package/lib/p5.webgpu.js +2 -2
  83. package/lib/p5.webgpu.min.js +1 -1
  84. package/package.json +1 -1
  85. package/types/global.d.ts +4 -4
  86. package/types/p5.d.ts +2 -2
package/lib/p5.esm.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! p5.js v2.2.2-rc.0 February 18, 2026 */
1
+ /*! p5.js v2.2.2-rc.2 February 21, 2026 */
2
2
  /**
3
3
  * @module Constants
4
4
  * @submodule Constants
@@ -12,7 +12,7 @@ const _PI = Math.PI;
12
12
  * @property {String} VERSION
13
13
  * @final
14
14
  */
15
- const VERSION = '2.2.2-rc.0';
15
+ const VERSION = '2.2.2-rc.2';
16
16
 
17
17
  // GRAPHICS RENDERER
18
18
  /**
@@ -12611,11 +12611,11 @@ function creatingReading(p5, fn){
12611
12611
  * values. 0 is equal to the first color, 0.1 is very near the first color,
12612
12612
  * 0.5 is halfway between the two colors, and so on. Negative numbers are set
12613
12613
  * to 0. Numbers greater than 1 are set to 1. This differs from the behavior of
12614
- * <a href="#/lerp">lerp</a>. It's necessary because numbers outside of the
12614
+ * <a href="#/p5/lerp">lerp</a>. It's necessary because numbers outside of the
12615
12615
  * interval [0, 1] will produce strange and unexpected colors.
12616
12616
  *
12617
12617
  * The way that colors are interpolated depends on the current
12618
- * <a href="#/colorMode">colorMode()</a>.
12618
+ * <a href="#/p5/colorMode">colorMode()</a>.
12619
12619
  *
12620
12620
  * @method lerpColor
12621
12621
  * @param {p5.Color} c1 interpolate from this color.
@@ -132382,32 +132382,45 @@ function _getBuiltinGlobalsCache(strandsContext) {
132382
132382
  return strandsContext._builtinGlobals
132383
132383
  }
132384
132384
 
132385
- function getBuiltinGlobalNode(strandsContext, name) {
132386
- const spec = BUILTIN_GLOBAL_SPECS[name];
132387
- if (!spec) return null
132388
-
132385
+ function getOrCreateUniformNode(strandsContext, uniformName, typeInfo, defaultValueFn) {
132389
132386
  const cache = _getBuiltinGlobalsCache(strandsContext);
132390
- const uniformName = `_p5_global_${name}`;
132387
+
132391
132388
  const cached = cache.nodes.get(uniformName);
132392
- if (cached) return cached
132389
+ if (cached) return cached;
132393
132390
 
132394
132391
  if (!cache.uniformsAdded.has(uniformName)) {
132395
132392
  cache.uniformsAdded.add(uniformName);
132396
132393
  strandsContext.uniforms.push({
132397
132394
  name: uniformName,
132398
- typeInfo: spec.typeInfo,
132399
- defaultValue: () => {
132400
- const p5Instance = strandsContext.renderer?._pInst || strandsContext.p5?.instance;
132401
- return p5Instance ? spec.get(p5Instance) : undefined
132402
- },
132395
+ typeInfo,
132396
+ defaultValue: defaultValueFn,
132403
132397
  });
132404
132398
  }
132405
132399
 
132406
- const { id, dimension } = variableNode(strandsContext, spec.typeInfo, uniformName);
132400
+ const { id, dimension } = variableNode(strandsContext, typeInfo, uniformName);
132407
132401
  const node = createStrandsNode(id, dimension, strandsContext);
132408
- node._originalBuiltinName = name;
132409
132402
  cache.nodes.set(uniformName, node);
132410
- return node
132403
+ return node;
132404
+ }
132405
+
132406
+ function getBuiltinGlobalNode(strandsContext, name) {
132407
+ const spec = BUILTIN_GLOBAL_SPECS[name];
132408
+ if (!spec) return null;
132409
+
132410
+ const uniformName = `_p5_global_${name}`;
132411
+ const instance = strandsContext.renderer?._pInst || strandsContext.p5?.instance;
132412
+
132413
+ const node = getOrCreateUniformNode(
132414
+ strandsContext,
132415
+ uniformName,
132416
+ spec.typeInfo,
132417
+ () => {
132418
+ return instance ? spec.get(instance) : undefined;
132419
+ }
132420
+ );
132421
+
132422
+ node._originalBuiltinName = name;
132423
+ return node;
132411
132424
  }
132412
132425
 
132413
132426
  function installBuiltinGlobalAccessors(strandsContext) {
@@ -132570,6 +132583,7 @@ function initGlobalStrandsAPI(p5, fn, strandsContext) {
132570
132583
  // Add noise function with backend-agnostic implementation
132571
132584
  const originalNoise = fn.noise;
132572
132585
  const originalNoiseDetail = fn.noiseDetail;
132586
+ const originalMillis = fn.millis;
132573
132587
 
132574
132588
  strandsContext._noiseOctaves = null;
132575
132589
  strandsContext._noiseAmpFalloff = null;
@@ -132632,6 +132646,21 @@ function initGlobalStrandsAPI(p5, fn, strandsContext) {
132632
132646
  return createStrandsNode(id, dimension, strandsContext);
132633
132647
  };
132634
132648
 
132649
+ fn.millis = function (...args) {
132650
+ if (!strandsContext.active) {
132651
+ return originalMillis.apply(this, args);
132652
+ }
132653
+ const instance = strandsContext.renderer?._pInst || strandsContext.p5?.instance;
132654
+ return getOrCreateUniformNode(
132655
+ strandsContext,
132656
+ '_p5_global_millis',
132657
+ DataType.float1,
132658
+ () => {
132659
+ return instance ? instance.millis() : undefined;
132660
+ }
132661
+ );
132662
+ };
132663
+
132635
132664
  // Next is type constructors and uniform functions.
132636
132665
  // For some of them, we have aliases so that you can write either a more human-readable
132637
132666
  // variant or also one more directly translated from GLSL, or to be more compatible with