p5 2.2.3 → 2.3.0-rc.0

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 (137) hide show
  1. package/dist/accessibility/color_namer.js +9 -11
  2. package/dist/accessibility/describe.js +0 -1
  3. package/dist/accessibility/gridOutput.js +0 -1
  4. package/dist/accessibility/index.js +9 -10
  5. package/dist/accessibility/outputs.js +0 -1
  6. package/dist/accessibility/textOutput.js +0 -1
  7. package/dist/app.js +11 -10
  8. package/dist/app.node.js +122 -0
  9. package/dist/color/color_conversion.js +9 -11
  10. package/dist/color/creating_reading.js +1 -1
  11. package/dist/color/index.js +2 -2
  12. package/dist/color/p5.Color.js +1 -1
  13. package/dist/color/setting.js +25 -12
  14. package/dist/{constants-BdTiYOQI.js → constants-CYF6mp5_.js} +2 -2
  15. package/dist/core/States.js +1 -1
  16. package/dist/core/constants.js +1 -1
  17. package/dist/core/environment.js +28 -29
  18. package/dist/core/filterShaders.js +1 -1
  19. package/dist/core/friendly_errors/fes_core.js +9 -8
  20. package/dist/core/friendly_errors/file_errors.js +1 -2
  21. package/dist/core/friendly_errors/index.js +1 -1
  22. package/dist/core/friendly_errors/param_validator.js +737 -640
  23. package/dist/core/friendly_errors/sketch_verifier.js +1 -1
  24. package/dist/core/friendly_errors/stacktrace.js +0 -1
  25. package/dist/core/helpers.js +3 -4
  26. package/dist/core/init.js +24 -21
  27. package/dist/core/internationalization.js +1 -1
  28. package/dist/core/legacy.js +9 -11
  29. package/dist/core/main.js +9 -10
  30. package/dist/core/p5.Graphics.js +5 -5
  31. package/dist/core/p5.Renderer.js +3 -3
  32. package/dist/core/p5.Renderer2D.js +9 -10
  33. package/dist/core/p5.Renderer3D.js +5 -5
  34. package/dist/core/rendering.js +5 -5
  35. package/dist/core/structure.js +0 -1
  36. package/dist/core/transform.js +7 -16
  37. package/dist/{creating_reading-C7hu6sg1.js → creating_reading-DLkHH80h.js} +11 -8
  38. package/dist/data/local_storage.js +0 -1
  39. package/dist/dom/dom.js +2 -3
  40. package/dist/dom/index.js +2 -2
  41. package/dist/dom/p5.Element.js +2 -2
  42. package/dist/dom/p5.MediaElement.js +2 -2
  43. package/dist/events/acceleration.js +5 -3
  44. package/dist/events/keyboard.js +0 -1
  45. package/dist/events/pointer.js +0 -2
  46. package/dist/image/const.js +1 -1
  47. package/dist/image/filterRenderer2D.js +19 -12
  48. package/dist/image/image.js +5 -5
  49. package/dist/image/index.js +5 -5
  50. package/dist/image/loading_displaying.js +5 -5
  51. package/dist/image/p5.Image.js +3 -3
  52. package/dist/image/pixels.js +0 -1
  53. package/dist/io/files.js +5 -5
  54. package/dist/io/index.js +5 -5
  55. package/dist/io/p5.Table.js +0 -1
  56. package/dist/io/p5.TableRow.js +0 -1
  57. package/dist/io/p5.XML.js +0 -1
  58. package/dist/{ir_builders-Cd6rU9Vm.js → ir_builders-C2ebb6Lu.js} +234 -1
  59. package/dist/{main-H_nu4eDs.js → main-D2MtO721.js} +107 -136
  60. package/dist/math/Matrices/Matrix.js +1 -1
  61. package/dist/math/Matrices/MatrixNumjs.js +1 -1
  62. package/dist/math/calculation.js +0 -1
  63. package/dist/math/index.js +3 -1
  64. package/dist/math/math.js +3 -17
  65. package/dist/math/noise.js +0 -1
  66. package/dist/math/p5.Matrix.js +1 -2
  67. package/dist/math/p5.Vector.js +233 -279
  68. package/dist/math/patch-vector.js +75 -0
  69. package/dist/math/random.js +0 -1
  70. package/dist/math/trigonometry.js +3 -4
  71. package/dist/{p5.Renderer-BmD2P6Wv.js → p5.Renderer-C0Kzy71d.js} +31 -24
  72. package/dist/{rendering-CC8JNTwG.js → rendering-CvNr0bB8.js} +732 -44
  73. package/dist/shape/2d_primitives.js +1 -4
  74. package/dist/shape/attributes.js +43 -8
  75. package/dist/shape/curves.js +0 -1
  76. package/dist/shape/custom_shapes.js +260 -5
  77. package/dist/shape/index.js +2 -2
  78. package/dist/shape/vertex.js +0 -2
  79. package/dist/strands/ir_builders.js +1 -1
  80. package/dist/strands/ir_types.js +5 -1
  81. package/dist/strands/p5.strands.js +286 -31
  82. package/dist/strands/strands_api.js +179 -8
  83. package/dist/strands/strands_codegen.js +26 -8
  84. package/dist/strands/strands_conditionals.js +1 -1
  85. package/dist/strands/strands_for.js +1 -1
  86. package/dist/strands/strands_node.js +1 -1
  87. package/dist/strands/strands_ternary.js +56 -0
  88. package/dist/strands/strands_transpiler.js +416 -251
  89. package/dist/strands_glslBackend-i-ReKgZo.js +423 -0
  90. package/dist/type/index.js +3 -3
  91. package/dist/type/lib/Typr.js +1 -1
  92. package/dist/type/p5.Font.js +3 -3
  93. package/dist/type/textCore.js +31 -24
  94. package/dist/utilities/conversion.js +0 -1
  95. package/dist/utilities/time_date.js +0 -1
  96. package/dist/utilities/utility_functions.js +0 -1
  97. package/dist/webgl/3d_primitives.js +5 -5
  98. package/dist/webgl/GeometryBuilder.js +1 -1
  99. package/dist/webgl/ShapeBuilder.js +26 -1
  100. package/dist/webgl/enums.js +1 -1
  101. package/dist/webgl/index.js +8 -9
  102. package/dist/webgl/interaction.js +8 -4
  103. package/dist/webgl/light.js +5 -5
  104. package/dist/webgl/loading.js +60 -21
  105. package/dist/webgl/material.js +5 -5
  106. package/dist/webgl/p5.Camera.js +5 -5
  107. package/dist/webgl/p5.Framebuffer.js +5 -5
  108. package/dist/webgl/p5.Geometry.js +3 -5
  109. package/dist/webgl/p5.Quat.js +1 -1
  110. package/dist/webgl/p5.RendererGL.js +17 -21
  111. package/dist/webgl/p5.Shader.js +129 -36
  112. package/dist/webgl/p5.Texture.js +5 -5
  113. package/dist/webgl/strands_glslBackend.js +5 -386
  114. package/dist/webgl/text.js +5 -5
  115. package/dist/webgl/utils.js +5 -5
  116. package/dist/webgl2Compatibility-DA7DLMuq.js +7 -0
  117. package/dist/webgpu/index.js +7 -3
  118. package/dist/webgpu/p5.RendererWebGPU.js +1036 -180
  119. package/dist/webgpu/shaders/color.js +1 -1
  120. package/dist/webgpu/shaders/compute.js +32 -0
  121. package/dist/webgpu/shaders/functions/randomComputeWGSL.js +31 -0
  122. package/dist/webgpu/shaders/functions/randomVertWGSL.js +30 -0
  123. package/dist/webgpu/shaders/functions/randomWGSL.js +30 -0
  124. package/dist/webgpu/shaders/line.js +1 -1
  125. package/dist/webgpu/shaders/material.js +3 -3
  126. package/dist/webgpu/strands_wgslBackend.js +137 -15
  127. package/lib/p5.esm.js +4088 -1950
  128. package/lib/p5.esm.min.js +1 -1
  129. package/lib/p5.js +4088 -1950
  130. package/lib/p5.min.js +1 -1
  131. package/lib/p5.webgpu.esm.js +1638 -306
  132. package/lib/p5.webgpu.js +1637 -305
  133. package/lib/p5.webgpu.min.js +1 -1
  134. package/package.json +6 -1
  135. package/types/global.d.ts +4137 -2396
  136. package/types/p5.d.ts +2702 -1658
  137. package/dist/noise3DGLSL-Bwrdi4gi.js +0 -9
@@ -1,6 +1,6 @@
1
1
  import { parse } from 'acorn';
2
2
  import { simple } from 'acorn-walk';
3
- import { a3 as constants } from '../../constants-BdTiYOQI.js';
3
+ import { am as constants } from '../../constants-CYF6mp5_.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,6 +1,5 @@
1
1
  /**
2
2
  * @for p5
3
- * @requires core
4
3
  */
5
4
  // Borrow from stacktracejs https://github.com/stacktracejs/stacktrace.js with
6
5
  // minor modifications. The license for the same and the code is included below
@@ -1,7 +1,6 @@
1
- import { p as CORNER, t as CORNERS, u as RADIUS, v as CENTER } from '../constants-BdTiYOQI.js';
1
+ import { n as CORNER, r as CORNERS, s as RADIUS, t as CENTER } from '../constants-CYF6mp5_.js';
2
2
 
3
3
  /**
4
- * @requires constants
5
4
  */
6
5
 
7
6
 
@@ -17,7 +16,7 @@ function modeAdjust(a, b, c, d, mode) {
17
16
  if (mode === CORNER) {
18
17
 
19
18
  // CORNER mode already corresponds to a bounding box (top-left corner, width, height).
20
- // For negative widhts or heights, the absolute value is used.
19
+ // For negative widths or heights, the absolute value is used.
21
20
  bbox = {
22
21
  x: a,
23
22
  y: b,
@@ -28,7 +27,7 @@ function modeAdjust(a, b, c, d, mode) {
28
27
  } else if (mode === CORNERS) {
29
28
 
30
29
  // CORNERS mode uses two opposite corners, in any configuration.
31
- // Make sure to get the top left corner by using the minimum of the x and y coordniates.
30
+ // Make sure to get the top left corner by using the minimum of the x and y coordinates.
32
31
  bbox = {
33
32
  x: Math.min(a, c),
34
33
  y: Math.min(b, d),
package/dist/core/init.js CHANGED
@@ -1,17 +1,18 @@
1
- import { p as p5 } from '../main-H_nu4eDs.js';
1
+ import { p as p5 } from '../main-D2MtO721.js';
2
2
  import { initialize } from './internationalization.js';
3
- import '../constants-BdTiYOQI.js';
3
+ import '../constants-CYF6mp5_.js';
4
4
  import './transform.js';
5
5
  import './structure.js';
6
6
  import './environment.js';
7
- import '../rendering-CC8JNTwG.js';
8
- import '../creating_reading-C7hu6sg1.js';
7
+ import '../rendering-CvNr0bB8.js';
8
+ import '../creating_reading-DLkHH80h.js';
9
9
  import 'colorjs.io/fn';
10
10
  import '../color/color_spaces/hsb.js';
11
+ import '../strands/ir_types.js';
11
12
  import '../dom/p5.Element.js';
12
13
  import '../dom/p5.File.js';
13
14
  import '../io/p5.XML.js';
14
- import '../p5.Renderer-BmD2P6Wv.js';
15
+ import '../p5.Renderer-C0Kzy71d.js';
15
16
  import '../image/filters.js';
16
17
  import '../math/p5.Vector.js';
17
18
  import '../shape/custom_shapes.js';
@@ -26,7 +27,6 @@ import '../shape/vertex.js';
26
27
  import '../color/setting.js';
27
28
  import 'omggif';
28
29
  import '../io/csv.js';
29
- import 'gifenc';
30
30
  import '../image/pixels.js';
31
31
  import '../webgl/GeometryBuilder.js';
32
32
  import '../math/p5.Matrix.js';
@@ -46,12 +46,11 @@ import '../webgl/enums.js';
46
46
  import '../webgl/p5.Shader.js';
47
47
  import '../math/trigonometry.js';
48
48
  import '../image/filterRenderer2D.js';
49
- import '../noise3DGLSL-Bwrdi4gi.js';
50
- import '../webgl/strands_glslBackend.js';
51
- import '../strands/ir_types.js';
49
+ import '../webgl2Compatibility-DA7DLMuq.js';
50
+ import '../strands_glslBackend-i-ReKgZo.js';
52
51
  import '../strands/ir_dag.js';
53
52
  import '../strands/strands_FES.js';
54
- import '../ir_builders-Cd6rU9Vm.js';
53
+ import '../ir_builders-C2ebb6Lu.js';
55
54
  import '../strands/ir_cfg.js';
56
55
  import '../strands/strands_builtins.js';
57
56
  import '../webgl/shaderHookUtils.js';
@@ -70,6 +69,7 @@ import 'i18next-browser-languagedetector';
70
69
  * @return {Undefined}
71
70
  */
72
71
  const _globalInit = () => {
72
+ if(typeof window === 'undefined') return;
73
73
  // Could have been any property defined within the p5 constructor.
74
74
  // If that property is already a part of the global object,
75
75
  // this code has already run before, likely due to a duplicate import
@@ -97,17 +97,20 @@ const _globalInit = () => {
97
97
  };
98
98
 
99
99
  // make a promise that resolves when the document is ready
100
- const waitForDocumentReady = () =>
101
- new Promise((resolve, reject) => {
102
- // if the page is ready, initialize p5 immediately
103
- if (document.readyState === 'complete') {
104
- resolve();
105
- // if the page is still loading, add an event listener
106
- // and initialize p5 as soon as it finishes loading
107
- } else {
108
- window.addEventListener('load', resolve, false);
109
- }
110
- });
100
+ const waitForDocumentReady = () =>{
101
+ if(typeof document !== 'undefined'){
102
+ return new Promise((resolve, reject) => {
103
+ // if the page is ready, initialize p5 immediately
104
+ if (document.readyState === 'complete') {
105
+ resolve();
106
+ // if the page is still loading, add an event listener
107
+ // and initialize p5 as soon as it finishes loading
108
+ } else {
109
+ window.addEventListener('load', resolve, false);
110
+ }
111
+ });
112
+ }
113
+ };
111
114
 
112
115
  // only load translations if we're using the full, un-minified library
113
116
  const waitingForTranslator =
@@ -1,6 +1,6 @@
1
1
  import i18next from 'i18next';
2
2
  import LanguageDetector from 'i18next-browser-languagedetector';
3
- import { az as VERSION } from '../constants-BdTiYOQI.js';
3
+ import { az as VERSION } from '../constants-CYF6mp5_.js';
4
4
 
5
5
  var fes = {
6
6
  autoplay: "The media that tried to play (with '{{src}}') wasn't allowed to by this browser, most likely due to the browser's autoplay policy.\n\n+ More info: {{url}}",
@@ -1,16 +1,17 @@
1
- import { p as p5 } from '../main-H_nu4eDs.js';
2
- import '../constants-BdTiYOQI.js';
1
+ import { p as p5 } from '../main-D2MtO721.js';
2
+ import '../constants-CYF6mp5_.js';
3
3
  import './transform.js';
4
4
  import './structure.js';
5
5
  import './environment.js';
6
- import '../rendering-CC8JNTwG.js';
7
- import '../creating_reading-C7hu6sg1.js';
6
+ import '../rendering-CvNr0bB8.js';
7
+ import '../creating_reading-DLkHH80h.js';
8
8
  import 'colorjs.io/fn';
9
9
  import '../color/color_spaces/hsb.js';
10
+ import '../strands/ir_types.js';
10
11
  import '../dom/p5.Element.js';
11
12
  import '../dom/p5.File.js';
12
13
  import '../io/p5.XML.js';
13
- import '../p5.Renderer-BmD2P6Wv.js';
14
+ import '../p5.Renderer-C0Kzy71d.js';
14
15
  import '../image/filters.js';
15
16
  import '../math/p5.Vector.js';
16
17
  import '../shape/custom_shapes.js';
@@ -25,7 +26,6 @@ import '../shape/vertex.js';
25
26
  import '../color/setting.js';
26
27
  import 'omggif';
27
28
  import '../io/csv.js';
28
- import 'gifenc';
29
29
  import '../image/pixels.js';
30
30
  import '../webgl/GeometryBuilder.js';
31
31
  import '../math/p5.Matrix.js';
@@ -45,19 +45,17 @@ import '../webgl/enums.js';
45
45
  import '../webgl/p5.Shader.js';
46
46
  import '../math/trigonometry.js';
47
47
  import '../image/filterRenderer2D.js';
48
- import '../noise3DGLSL-Bwrdi4gi.js';
49
- import '../webgl/strands_glslBackend.js';
50
- import '../strands/ir_types.js';
48
+ import '../webgl2Compatibility-DA7DLMuq.js';
49
+ import '../strands_glslBackend-i-ReKgZo.js';
51
50
  import '../strands/ir_dag.js';
52
51
  import '../strands/strands_FES.js';
53
- import '../ir_builders-Cd6rU9Vm.js';
52
+ import '../ir_builders-C2ebb6Lu.js';
54
53
  import '../strands/ir_cfg.js';
55
54
  import '../strands/strands_builtins.js';
56
55
  import '../webgl/shaderHookUtils.js';
57
56
 
58
57
  /**
59
58
  * @for p5
60
- * @requires core
61
59
  * These are functions that are part of the Processing API but are not part of
62
60
  * the p5.js API. In some cases they have a new name, in others, they are
63
61
  * removed completely. Not all unsupported Processing functions are listed here
package/dist/core/main.js CHANGED
@@ -1,13 +1,14 @@
1
- import '../constants-BdTiYOQI.js';
1
+ import '../constants-CYF6mp5_.js';
2
2
  import './transform.js';
3
3
  import './structure.js';
4
4
  import './environment.js';
5
- import '../rendering-CC8JNTwG.js';
6
- import '../p5.Renderer-BmD2P6Wv.js';
7
- export { p as default } from '../main-H_nu4eDs.js';
8
- import '../creating_reading-C7hu6sg1.js';
5
+ import '../rendering-CvNr0bB8.js';
6
+ import '../p5.Renderer-C0Kzy71d.js';
7
+ export { p as default } from '../main-D2MtO721.js';
8
+ import '../creating_reading-DLkHH80h.js';
9
9
  import 'colorjs.io/fn';
10
10
  import '../color/color_spaces/hsb.js';
11
+ import '../strands/ir_types.js';
11
12
  import '../dom/p5.Element.js';
12
13
  import '../dom/p5.File.js';
13
14
  import '../io/p5.XML.js';
@@ -21,7 +22,6 @@ import '../color/setting.js';
21
22
  import 'omggif';
22
23
  import '../io/csv.js';
23
24
  import '../io/utilities.js';
24
- import 'gifenc';
25
25
  import '../image/pixels.js';
26
26
  import '../image/filters.js';
27
27
  import '../webgl/GeometryBuilder.js';
@@ -45,12 +45,11 @@ import '../webgl/enums.js';
45
45
  import '../webgl/p5.Shader.js';
46
46
  import '../math/trigonometry.js';
47
47
  import '../image/filterRenderer2D.js';
48
- import '../noise3DGLSL-Bwrdi4gi.js';
49
- import '../webgl/strands_glslBackend.js';
50
- import '../strands/ir_types.js';
48
+ import '../webgl2Compatibility-DA7DLMuq.js';
49
+ import '../strands_glslBackend-i-ReKgZo.js';
51
50
  import '../strands/ir_dag.js';
52
51
  import '../strands/strands_FES.js';
53
- import '../ir_builders-Cd6rU9Vm.js';
52
+ import '../ir_builders-C2ebb6Lu.js';
54
53
  import '../strands/ir_cfg.js';
55
54
  import '../strands/strands_builtins.js';
56
55
  import '../webgl/shaderHookUtils.js';
@@ -1,22 +1,23 @@
1
- import '../constants-BdTiYOQI.js';
1
+ import '../constants-CYF6mp5_.js';
2
2
  import '../shape/2d_primitives.js';
3
3
  import '../shape/attributes.js';
4
4
  import '../shape/curves.js';
5
5
  import '../shape/vertex.js';
6
6
  import '../color/setting.js';
7
- export { G as Graphics, n as default } from '../rendering-CC8JNTwG.js';
7
+ export { G as Graphics, n as default } from '../rendering-CvNr0bB8.js';
8
8
  import '../image/pixels.js';
9
9
  import './transform.js';
10
- import '../creating_reading-C7hu6sg1.js';
10
+ import '../creating_reading-DLkHH80h.js';
11
11
  import '../math/trigonometry.js';
12
12
  import '../shape/custom_shapes.js';
13
13
  import './helpers.js';
14
14
  import 'colorjs.io/fn';
15
15
  import '../color/color_spaces/hsb.js';
16
+ import '../strands/ir_types.js';
16
17
  import '../dom/p5.Element.js';
17
18
  import '../dom/p5.File.js';
18
19
  import '../io/p5.XML.js';
19
- import '../p5.Renderer-BmD2P6Wv.js';
20
+ import '../p5.Renderer-C0Kzy71d.js';
20
21
  import '../image/filters.js';
21
22
  import '../math/p5.Vector.js';
22
23
  import './States.js';
@@ -24,7 +25,6 @@ import '../io/utilities.js';
24
25
  import '../dom/p5.MediaElement.js';
25
26
  import 'omggif';
26
27
  import '../io/csv.js';
27
- import 'gifenc';
28
28
  import '../webgl/GeometryBuilder.js';
29
29
  import '../math/p5.Matrix.js';
30
30
  import '../math/Matrices/Matrix.js';
@@ -1,6 +1,6 @@
1
- import '../creating_reading-C7hu6sg1.js';
2
- import '../constants-BdTiYOQI.js';
3
- export { R as Renderer, r as default } from '../p5.Renderer-BmD2P6Wv.js';
1
+ import '../creating_reading-DLkHH80h.js';
2
+ import '../constants-CYF6mp5_.js';
3
+ export { R as Renderer, r as default } from '../p5.Renderer-C0Kzy71d.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-BdTiYOQI.js';
2
- export { R as Renderer2D, r as default } from '../main-H_nu4eDs.js';
3
- import '../p5.Renderer-BmD2P6Wv.js';
4
- import '../rendering-CC8JNTwG.js';
1
+ import '../constants-CYF6mp5_.js';
2
+ export { R as Renderer2D, r as default } from '../main-D2MtO721.js';
3
+ import '../p5.Renderer-C0Kzy71d.js';
4
+ import '../rendering-CvNr0bB8.js';
5
5
  import '../dom/p5.Element.js';
6
6
  import '../dom/p5.MediaElement.js';
7
- import '../creating_reading-C7hu6sg1.js';
7
+ import '../creating_reading-DLkHH80h.js';
8
8
  import '../image/filterRenderer2D.js';
9
9
  import '../math/p5.Matrix.js';
10
10
  import '../shape/custom_shapes.js';
@@ -17,6 +17,7 @@ import '../image/filters.js';
17
17
  import '../math/p5.Vector.js';
18
18
  import './States.js';
19
19
  import '../io/utilities.js';
20
+ import '../strands/ir_types.js';
20
21
  import '../shape/2d_primitives.js';
21
22
  import './helpers.js';
22
23
  import '../shape/attributes.js';
@@ -27,7 +28,6 @@ import 'colorjs.io/fn';
27
28
  import '../color/color_spaces/hsb.js';
28
29
  import 'omggif';
29
30
  import '../io/csv.js';
30
- import 'gifenc';
31
31
  import '../image/pixels.js';
32
32
  import '../webgl/GeometryBuilder.js';
33
33
  import '../webgl/p5.Geometry.js';
@@ -45,12 +45,11 @@ import '../webgl/p5.Shader.js';
45
45
  import '../math/trigonometry.js';
46
46
  import '../dom/p5.File.js';
47
47
  import '../io/p5.XML.js';
48
- import '../noise3DGLSL-Bwrdi4gi.js';
49
- import '../webgl/strands_glslBackend.js';
50
- import '../strands/ir_types.js';
48
+ import '../webgl2Compatibility-DA7DLMuq.js';
49
+ import '../strands_glslBackend-i-ReKgZo.js';
51
50
  import '../strands/ir_dag.js';
52
51
  import '../strands/strands_FES.js';
53
- import '../ir_builders-Cd6rU9Vm.js';
52
+ import '../ir_builders-C2ebb6Lu.js';
54
53
  import '../strands/ir_cfg.js';
55
54
  import '../strands/strands_builtins.js';
56
55
  import '../webgl/shaderHookUtils.js';
@@ -1,6 +1,6 @@
1
- import '../constants-BdTiYOQI.js';
2
- export { R as Renderer3D, r as default } from '../rendering-CC8JNTwG.js';
3
- import '../p5.Renderer-BmD2P6Wv.js';
1
+ import '../constants-CYF6mp5_.js';
2
+ export { R as Renderer3D, r as default } from '../rendering-CvNr0bB8.js';
3
+ import '../p5.Renderer-C0Kzy71d.js';
4
4
  import '../webgl/GeometryBuilder.js';
5
5
  import '../math/p5.Matrix.js';
6
6
  import '../math/p5.Vector.js';
@@ -8,7 +8,7 @@ import '../webgl/ShapeBuilder.js';
8
8
  import '../webgl/GeometryBufferCache.js';
9
9
  import '../image/const.js';
10
10
  import '../shape/custom_shapes.js';
11
- import '../creating_reading-C7hu6sg1.js';
11
+ import '../creating_reading-DLkHH80h.js';
12
12
  import '../dom/p5.Element.js';
13
13
  import '../webgl/p5.DataArray.js';
14
14
  import '../type/textCore.js';
@@ -16,6 +16,7 @@ import '../webgl/p5.RenderBuffer.js';
16
16
  import './filterShaders.js';
17
17
  import '../webgl/enums.js';
18
18
  import '../math/Matrices/Matrix.js';
19
+ import '../strands/ir_types.js';
19
20
  import '../dom/p5.MediaElement.js';
20
21
  import '../dom/p5.File.js';
21
22
  import '../io/p5.XML.js';
@@ -30,7 +31,6 @@ import '../color/setting.js';
30
31
  import 'omggif';
31
32
  import '../io/csv.js';
32
33
  import '../io/utilities.js';
33
- import 'gifenc';
34
34
  import '../image/pixels.js';
35
35
  import '../image/filters.js';
36
36
  import './transform.js';
@@ -1,12 +1,13 @@
1
- import '../constants-BdTiYOQI.js';
2
- export { k as default, x as renderers } from '../rendering-CC8JNTwG.js';
3
- import '../creating_reading-C7hu6sg1.js';
1
+ import '../constants-CYF6mp5_.js';
2
+ export { k as default, x as renderers } from '../rendering-CvNr0bB8.js';
3
+ import '../creating_reading-DLkHH80h.js';
4
4
  import 'colorjs.io/fn';
5
5
  import '../color/color_spaces/hsb.js';
6
+ import '../strands/ir_types.js';
6
7
  import '../dom/p5.Element.js';
7
8
  import '../dom/p5.File.js';
8
9
  import '../io/p5.XML.js';
9
- import '../p5.Renderer-BmD2P6Wv.js';
10
+ import '../p5.Renderer-C0Kzy71d.js';
10
11
  import '../image/filters.js';
11
12
  import '../math/p5.Vector.js';
12
13
  import '../shape/custom_shapes.js';
@@ -21,7 +22,6 @@ import '../shape/vertex.js';
21
22
  import '../color/setting.js';
22
23
  import 'omggif';
23
24
  import '../io/csv.js';
24
- import 'gifenc';
25
25
  import '../image/pixels.js';
26
26
  import './transform.js';
27
27
  import '../webgl/GeometryBuilder.js';
@@ -2,7 +2,6 @@
2
2
  * @module Structure
3
3
  * @submodule Structure
4
4
  * @for p5
5
- * @requires core
6
5
  */
7
6
 
8
7
  function structure(p5, fn){
@@ -2,8 +2,6 @@
2
2
  * @module Transform
3
3
  * @submodule Transform
4
4
  * @for p5
5
- * @requires core
6
- * @requires constants
7
5
  */
8
6
 
9
7
  function transform(p5, fn){
@@ -420,8 +418,7 @@ function transform(p5, fn){
420
418
  */
421
419
  fn.rotate = function(angle, axis) {
422
420
  // p5._validateParameters('rotate', arguments);
423
- this._renderer.rotate(this._toRadians(angle), axis);
424
- return this;
421
+ return this._renderer.rotate(this._toRadians(angle), axis);
425
422
  };
426
423
 
427
424
  /**
@@ -543,8 +540,7 @@ function transform(p5, fn){
543
540
  fn.rotateX = function(angle) {
544
541
  this._assert3d('rotateX');
545
542
  // p5._validateParameters('rotateX', arguments);
546
- this._renderer.rotateX(this._toRadians(angle));
547
- return this;
543
+ return this._renderer.rotateX(this._toRadians(angle));
548
544
  };
549
545
 
550
546
  /**
@@ -666,8 +662,7 @@ function transform(p5, fn){
666
662
  fn.rotateY = function(angle) {
667
663
  this._assert3d('rotateY');
668
664
  // p5._validateParameters('rotateY', arguments);
669
- this._renderer.rotateY(this._toRadians(angle));
670
- return this;
665
+ return this._renderer.rotateY(this._toRadians(angle));
671
666
  };
672
667
 
673
668
  /**
@@ -789,8 +784,7 @@ function transform(p5, fn){
789
784
  fn.rotateZ = function(angle) {
790
785
  this._assert3d('rotateZ');
791
786
  // p5._validateParameters('rotateZ', arguments);
792
- this._renderer.rotateZ(this._toRadians(angle));
793
- return this;
787
+ return this._renderer.rotateZ(this._toRadians(angle));
794
788
  };
795
789
 
796
790
  /**
@@ -966,9 +960,7 @@ function transform(p5, fn){
966
960
  z = 1;
967
961
  }
968
962
 
969
- this._renderer.scale(x, y, z);
970
-
971
- return this;
963
+ return this._renderer.scale(x, y, z);
972
964
  };
973
965
 
974
966
  /**
@@ -1274,11 +1266,10 @@ function transform(p5, fn){
1274
1266
  fn.translate = function(x, y, z) {
1275
1267
  // p5._validateParameters('translate', arguments);
1276
1268
  if (this._renderer.isP3D) {
1277
- this._renderer.translate(x, y, z);
1269
+ return this._renderer.translate(x, y, z);
1278
1270
  } else {
1279
- this._renderer.translate(x, y);
1271
+ return this._renderer.translate(x, y);
1280
1272
  }
1281
- return this;
1282
1273
  };
1283
1274
 
1284
1275
  /**
@@ -5,8 +5,6 @@ import HSBSpace from './color/color_spaces/hsb.js';
5
5
  * @module Color
6
6
  * @submodule Creating & Reading
7
7
  * @for p5
8
- * @requires core
9
- * @requires color_conversion
10
8
  */
11
9
 
12
10
 
@@ -39,6 +37,13 @@ class Color {
39
37
  static #colorjsMaxes = {};
40
38
  static #grayscaleMap = {};
41
39
 
40
+ // This property is here where duck typing (checking if obj.isColor) needs
41
+ // to be used over more standard type checking (obj instanceof Color). This
42
+ // needs to happen where we are building multiple files, such as in p5.webgpu.js,
43
+ // where if we `import { Color }` directly, it will be a separate copy of the
44
+ // Color class from the one imported in the main p5.js bundle.
45
+ isColor = true;
46
+
42
47
  // Used to add additional color modes to p5.js
43
48
  // Uses underlying library's definition
44
49
  static addColorMode(mode, definition){
@@ -341,7 +346,7 @@ class Color {
341
346
  if (format === undefined && this._defaultStringValue !== undefined) {
342
347
  return this._defaultStringValue;
343
348
  }
344
-
349
+
345
350
  let outputFormat = format;
346
351
  if (format === '#rrggbb') {
347
352
  outputFormat = 'hex';
@@ -354,10 +359,10 @@ class Color {
354
359
  colorString = serialize(this._color, {
355
360
  format: outputFormat
356
361
  });
357
-
362
+
358
363
  if (format === '#rrggbb') {
359
364
  colorString = String(colorString);
360
- if (colorString.length === 4) {
365
+ if (colorString.length === 4) {
361
366
  const r = colorString[1];
362
367
  const g = colorString[2];
363
368
  const b = colorString[3];
@@ -701,7 +706,7 @@ class Color {
701
706
  if(!Array.isArray(v)){
702
707
  return [0, v];
703
708
  }else {
704
- return v
709
+ return v;
705
710
  }
706
711
  });
707
712
 
@@ -1090,8 +1095,6 @@ if(typeof p5 !== 'undefined'){
1090
1095
  * @module Color
1091
1096
  * @submodule Creating & Reading
1092
1097
  * @for p5
1093
- * @requires core
1094
- * @requires constants
1095
1098
  */
1096
1099
 
1097
1100
 
@@ -1,7 +1,6 @@
1
1
  /**
2
2
  * @module Data
3
3
  * @submodule LocalStorage
4
- * @requires core
5
4
  *
6
5
  * This module defines the p5 methods for working with local storage
7
6
  */
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-C7hu6sg1.js';
4
+ import '../creating_reading-DLkHH80h.js';
5
5
  import 'colorjs.io/fn';
6
6
  import '../color/color_spaces/hsb.js';
7
- import '../constants-BdTiYOQI.js';
7
+ import '../constants-CYF6mp5_.js';
8
8
  import '../io/p5.XML.js';
9
9
 
10
10
  /**
@@ -22,7 +22,6 @@ import '../io/p5.XML.js';
22
22
  * @module DOM
23
23
  * @submodule DOM
24
24
  * @for p5
25
- * @requires p5
26
25
  */
27
26
 
28
27
 
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-C7hu6sg1.js';
5
+ import '../creating_reading-DLkHH80h.js';
6
6
  import 'colorjs.io/fn';
7
7
  import '../color/color_spaces/hsb.js';
8
- import '../constants-BdTiYOQI.js';
8
+ import '../constants-CYF6mp5_.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-C7hu6sg1.js';
3
- import { a4 as AUTO } from '../constants-BdTiYOQI.js';
2
+ import { C as Color } from '../creating_reading-DLkHH80h.js';
3
+ import { a2 as AUTO } from '../constants-CYF6mp5_.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-C7hu6sg1.js';
4
+ import '../creating_reading-DLkHH80h.js';
5
5
  import 'colorjs.io/fn';
6
6
  import '../color/color_spaces/hsb.js';
7
- import '../constants-BdTiYOQI.js';
7
+ import '../constants-CYF6mp5_.js';
8
8
 
9
9
  /**
10
10
  * @module DOM
@@ -2,7 +2,6 @@
2
2
  * @module Events
3
3
  * @submodule Acceleration
4
4
  * @for p5
5
- * @requires core
6
5
  * @main Events
7
6
  */
8
7
 
@@ -19,6 +18,10 @@ function acceleration(p5, fn, lifecycles){
19
18
  signal: this._removeSignal
20
19
  });
21
20
  }
21
+
22
+ // Initialize device orientation value
23
+ this.deviceOrientation = typeof window !== 'undefined' &&
24
+ window.innerWidth / window.innerHeight > 1.0 ? 'landscape' : 'portrait';
22
25
  };
23
26
 
24
27
  /**
@@ -30,8 +33,7 @@ function acceleration(p5, fn, lifecycles){
30
33
  * @property {(LANDSCAPE|PORTRAIT)} deviceOrientation
31
34
  * @readOnly
32
35
  */
33
- fn.deviceOrientation =
34
- window.innerWidth / window.innerHeight > 1.0 ? 'landscape' : 'portrait';
36
+ fn.deviceOrientation = 'landscape';
35
37
 
36
38
  /**
37
39
  * The system variable accelerationX always contains the acceleration of the
@@ -2,7 +2,6 @@
2
2
  * @module Events
3
3
  * @submodule Keyboard
4
4
  * @for p5
5
- * @requires core
6
5
  */
7
6
  function isCode(input) {
8
7
  const leftRightKeys = [
@@ -2,8 +2,6 @@
2
2
  * @module Events
3
3
  * @submodule Pointer
4
4
  * @for p5
5
- * @requires core
6
- * @requires constants
7
5
  */
8
6
 
9
7
  function pointer(p5, fn, lifecycles){