@awesome-flow/noise 0.3.0 → 0.4.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 (101) hide show
  1. package/dist/abstract/index.cjs +1405 -2078
  2. package/dist/abstract/index.cjs.map +1 -1
  3. package/dist/abstract/index.d.cts +23 -25
  4. package/dist/abstract/index.d.ts +23 -25
  5. package/dist/abstract/index.js +1315 -1996
  6. package/dist/abstract/index.js.map +1 -1
  7. package/dist/index-BungWYrh.d.cts +49 -0
  8. package/dist/index-DsQSjZC5.d.ts +49 -0
  9. package/dist/{node-props-CeZ8Oshz.d.ts → node-props-BbqbXDXn.d.cts} +2 -22
  10. package/dist/{node-props-hKW-_KOU.d.cts → node-props-BbqbXDXn.d.ts} +2 -22
  11. package/dist/nodes/generators/index.cjs +130 -380
  12. package/dist/nodes/generators/index.cjs.map +1 -1
  13. package/dist/nodes/generators/index.d.cts +2 -8
  14. package/dist/nodes/generators/index.d.ts +2 -8
  15. package/dist/nodes/generators/index.js +112 -360
  16. package/dist/nodes/generators/index.js.map +1 -1
  17. package/dist/nodes/groups/index.cjs +25 -13
  18. package/dist/nodes/groups/index.cjs.map +1 -1
  19. package/dist/nodes/groups/index.js +26 -14
  20. package/dist/nodes/groups/index.js.map +1 -1
  21. package/dist/nodes/index.cjs +1654 -988
  22. package/dist/nodes/index.cjs.map +1 -1
  23. package/dist/nodes/index.d.cts +3 -5
  24. package/dist/nodes/index.d.ts +3 -5
  25. package/dist/nodes/index.js +1622 -960
  26. package/dist/nodes/index.js.map +1 -1
  27. package/dist/nodes/modifiers/index.cjs +17 -119
  28. package/dist/nodes/modifiers/index.cjs.map +1 -1
  29. package/dist/nodes/modifiers/index.d.cts +2 -6
  30. package/dist/nodes/modifiers/index.d.ts +2 -6
  31. package/dist/nodes/modifiers/index.js +16 -124
  32. package/dist/nodes/modifiers/index.js.map +1 -1
  33. package/dist/nodes/output/index.cjs +1271 -89
  34. package/dist/nodes/output/index.cjs.map +1 -1
  35. package/dist/nodes/output/index.js +1314 -92
  36. package/dist/nodes/output/index.js.map +1 -1
  37. package/dist/nodes/selectors/index.cjs +1296 -58
  38. package/dist/nodes/selectors/index.cjs.map +1 -1
  39. package/dist/nodes/selectors/index.d.cts +1 -3
  40. package/dist/nodes/selectors/index.d.ts +1 -3
  41. package/dist/nodes/selectors/index.js +1339 -65
  42. package/dist/nodes/selectors/index.js.map +1 -1
  43. package/dist/nodes/transformers/index.cjs +67 -206
  44. package/dist/nodes/transformers/index.cjs.map +1 -1
  45. package/dist/nodes/transformers/index.d.cts +3 -5
  46. package/dist/nodes/transformers/index.d.ts +3 -5
  47. package/dist/nodes/transformers/index.js +54 -193
  48. package/dist/nodes/transformers/index.js.map +1 -1
  49. package/dist/templates/generators/index.cjs +839 -1278
  50. package/dist/templates/generators/index.cjs.map +1 -1
  51. package/dist/templates/generators/index.d.cts +13 -50
  52. package/dist/templates/generators/index.d.ts +13 -50
  53. package/dist/templates/generators/index.js +836 -1280
  54. package/dist/templates/generators/index.js.map +1 -1
  55. package/dist/templates/groups/index.cjs +837 -1272
  56. package/dist/templates/groups/index.cjs.map +1 -1
  57. package/dist/templates/groups/index.d.cts +1 -5
  58. package/dist/templates/groups/index.d.ts +1 -5
  59. package/dist/templates/groups/index.js +835 -1277
  60. package/dist/templates/groups/index.js.map +1 -1
  61. package/dist/templates/index.cjs +839 -1280
  62. package/dist/templates/index.cjs.map +1 -1
  63. package/dist/templates/index.d.cts +4 -7
  64. package/dist/templates/index.d.ts +4 -7
  65. package/dist/templates/index.js +836 -1281
  66. package/dist/templates/index.js.map +1 -1
  67. package/dist/templates/modifiers/index.cjs +841 -1278
  68. package/dist/templates/modifiers/index.cjs.map +1 -1
  69. package/dist/templates/modifiers/index.d.cts +11 -38
  70. package/dist/templates/modifiers/index.d.ts +11 -38
  71. package/dist/templates/modifiers/index.js +838 -1281
  72. package/dist/templates/modifiers/index.js.map +1 -1
  73. package/dist/templates/output/index.cjs +839 -1274
  74. package/dist/templates/output/index.cjs.map +1 -1
  75. package/dist/templates/output/index.d.cts +4 -14
  76. package/dist/templates/output/index.d.ts +4 -14
  77. package/dist/templates/output/index.js +837 -1279
  78. package/dist/templates/output/index.js.map +1 -1
  79. package/dist/templates/selectors/index.cjs +839 -1274
  80. package/dist/templates/selectors/index.cjs.map +1 -1
  81. package/dist/templates/selectors/index.d.cts +3 -9
  82. package/dist/templates/selectors/index.d.ts +3 -9
  83. package/dist/templates/selectors/index.js +837 -1279
  84. package/dist/templates/selectors/index.js.map +1 -1
  85. package/dist/templates/transformers/index.cjs +839 -1274
  86. package/dist/templates/transformers/index.cjs.map +1 -1
  87. package/dist/templates/transformers/index.d.cts +3 -36
  88. package/dist/templates/transformers/index.d.ts +3 -36
  89. package/dist/templates/transformers/index.js +837 -1279
  90. package/dist/templates/transformers/index.js.map +1 -1
  91. package/package.json +3 -3
  92. package/dist/handle-types-D-v5S53h.d.cts +0 -22
  93. package/dist/handle-types-D-v5S53h.d.ts +0 -22
  94. package/dist/layout/index.cjs +0 -164
  95. package/dist/layout/index.cjs.map +0 -1
  96. package/dist/layout/index.d.cts +0 -26
  97. package/dist/layout/index.d.ts +0 -26
  98. package/dist/layout/index.js +0 -136
  99. package/dist/layout/index.js.map +0 -1
  100. package/dist/properties-BxwtU6i9.d.cts +0 -9
  101. package/dist/properties-BxwtU6i9.d.ts +0 -9
@@ -28,86 +28,83 @@ function NoiseLoggerNode({ id, selected, data, type }) {
28
28
  var noise_logger_node_default = NoiseLoggerNode;
29
29
 
30
30
  // src/nodes/output/noise-output-node.tsx
31
- import { NodeContainer as NodeContainer2, NodeTrackConnections as NodeTrackConnections2 } from "@awesome-flow/core/layout";
32
- import { useIncomingComputedData as useIncomingComputedData2, useUpdateNodeComputedData } from "@awesome-flow/core/hooks";
33
- import { Box, Group, LoadingOverlay, Stack as Stack2 } from "@mantine/core";
34
- import { useEffect, useState } from "react";
35
- import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
36
- function NoiseOutputNode({ id, selected, data, type }) {
37
- const [generating, setGenerating] = useState(false);
38
- const updateComputedData = useUpdateNodeComputedData();
39
- const incomingModules = useIncomingComputedData2(id, 8 /* module */);
40
- const incomingPositions = useIncomingComputedData2(
41
- id,
42
- 4 /* position */
43
- );
44
- useEffect(() => {
45
- if (incomingPositions?.length && incomingModules?.length) {
46
- const { module } = incomingModules[0];
47
- if (module) {
48
- setGenerating(true);
49
- }
50
- }
51
- }, [incomingModules, incomingPositions]);
52
- useEffect(() => {
53
- if (incomingPositions?.length && incomingModules?.length) {
54
- const { module } = incomingModules[0];
55
- if (module && generating) {
56
- const noise = [];
57
- for (const input of incomingPositions) {
58
- for (const position of input.positions) {
59
- const value = module.getValue(position.x, position.y, position.z);
60
- noise.push({
61
- position,
62
- value
63
- });
64
- }
65
- }
66
- console.log("SET COMPUTED DATA");
67
- updateComputedData(id, { noise, module });
68
- setGenerating(false);
69
- }
70
- }
71
- }, [generating]);
72
- return /* @__PURE__ */ jsxs2(NodeContainer2, { id, selected, data, type, children: [
73
- /* @__PURE__ */ jsxs2(Box, { pos: "relative", children: [
74
- /* @__PURE__ */ jsx2(
75
- LoadingOverlay,
76
- {
77
- visible: generating,
78
- zIndex: 1e3,
79
- overlayProps: { radius: "sm", blur: 2 }
80
- }
81
- ),
82
- /* @__PURE__ */ jsxs2(Stack2, { children: [
83
- /* @__PURE__ */ jsxs2(Group, { children: [
84
- "Position Inputs: ",
85
- incomingPositions?.length
86
- ] }),
87
- /* @__PURE__ */ jsxs2(Group, { children: [
88
- "Module Inputs: ",
89
- incomingModules?.length
90
- ] })
91
- ] })
92
- ] }),
93
- /* @__PURE__ */ jsx2(NodeTrackConnections2, { handles: data.handles, nodeId: id, type: "target" })
94
- ] });
95
- }
96
- var noise_output_node_default = NoiseOutputNode;
31
+ import { NodeContainer as NodeContainer32, NodeTrackConnections as NodeTrackConnections27 } from "@awesome-flow/core/layout";
32
+ import { useCallback as useCallback15, useState as useState16 } from "react";
33
+ import { useUpdateNodeComputedData as useUpdateNodeComputedData30 } from "@awesome-flow/core/hooks";
34
+ import { HandlesIncomingDataStatus as HandlesIncomingDataStatus4 } from "@awesome-flow/core/components";
35
+ import { Text as Text3 } from "@mantine/core";
36
+
37
+ // src/nodes/generators/noise-simplex-node.tsx
38
+ import { NodeContainer as NodeContainer2 } from "@awesome-flow/core/layout";
39
+ import { useEffect, useMemo as useMemo2 } from "react";
40
+ import { useUpdateNodeComputedData } from "@awesome-flow/core/hooks";
41
+
42
+ // src/modules/simplex-module.ts
43
+ import Module from "libnoise-ts/module/Module";
44
+ import { createNoise3D } from "simplex-noise";
45
+
46
+ // src/nodes/generators/noise-simplex-node.tsx
47
+ import { jsx as jsx2 } from "react/jsx-runtime";
48
+
49
+ // src/nodes/generators/position-const-node.tsx
50
+ import { NodeContainer as NodeContainer3 } from "@awesome-flow/core/layout";
51
+ import { useEffect as useEffect2, useState } from "react";
52
+ import { Group, NumberInput, Stack as Stack2 } from "@mantine/core";
53
+ import { useUpdateNodeComputedData as useUpdateNodeComputedData2, useUpdateNodeData } from "@awesome-flow/core/hooks";
54
+ import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
55
+
56
+ // src/nodes/generators/position-grid-node.tsx
57
+ import { NodeContainer as NodeContainer4 } from "@awesome-flow/core/layout";
58
+ import { useEffect as useEffect3, useState as useState2 } from "react";
59
+ import { Group as Group2, NumberInput as NumberInput2, Stack as Stack3 } from "@mantine/core";
60
+ import { useUpdateNodeComputedData as useUpdateNodeComputedData3, useUpdateNodeData as useUpdateNodeData2 } from "@awesome-flow/core/hooks";
61
+ import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
62
+
63
+ // src/nodes/modifiers/noise-normalize-node.tsx
64
+ import { NodeContainer as NodeContainer5, NodeTrackConnections as NodeTrackConnections2 } from "@awesome-flow/core/layout";
65
+ import { useEffect as useEffect4, useState as useState3 } from "react";
66
+ import { Group as Group3, NumberInput as NumberInput3, Stack as Stack4 } from "@mantine/core";
67
+ import {
68
+ useIncomingComputedData as useIncomingComputedData2,
69
+ useUpdateNodeComputedData as useUpdateNodeComputedData4,
70
+ useUpdateNodeData as useUpdateNodeData3
71
+ } from "@awesome-flow/core/hooks";
72
+
73
+ // src/modules/normalize-noise-module.ts
74
+ import ModifierModule from "libnoise-ts/module/modifier";
75
+
76
+ // src/nodes/modifiers/noise-normalize-node.tsx
77
+ import { jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
78
+
79
+ // src/nodes/generators/noise-const-node.tsx
80
+ import { NodeContainer as NodeContainer6 } from "@awesome-flow/core/layout";
81
+ import { useEffect as useEffect5, useMemo as useMemo3, useState as useState4 } from "react";
82
+ import { Group as Group4, NumberInput as NumberInput4, Stack as Stack5 } from "@mantine/core";
83
+ import { useUpdateNodeComputedData as useUpdateNodeComputedData5, useUpdateNodeData as useUpdateNodeData4 } from "@awesome-flow/core/hooks";
84
+ import { Const } from "libnoise-ts/module/generator";
85
+ import { jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
86
+
87
+ // src/nodes/generators/noise-billow-node.tsx
88
+ import { NodeContainer as NodeContainer7, NodeTrackConnections as NodeTrackConnections3 } from "@awesome-flow/core/layout";
89
+ import { useCallback, useMemo as useMemo4 } from "react";
90
+ import { Billow } from "libnoise-ts/module/generator";
91
+ import { useUpdateNodeComputedData as useUpdateNodeComputedData6 } from "@awesome-flow/core/hooks";
92
+ import { NodePropertyVariables } from "@awesome-flow/core/components";
93
+ import { jsx as jsx7, jsxs as jsxs6 } from "react/jsx-runtime";
97
94
 
98
95
  // src/nodes/output/noise-raw-texture-node.tsx
99
- import { NodeContainer as NodeContainer3, NodeTrackConnections as NodeTrackConnections3 } from "@awesome-flow/core/layout";
100
- import { useEffect as useEffect2, useMemo as useMemo2, useState as useState2 } from "react";
101
- import { useIncomingComputedData as useIncomingComputedData3, useUpdateNodeComputedData as useUpdateNodeComputedData2 } from "@awesome-flow/core/hooks";
102
- import { Group as Group2, Stack as Stack3 } from "@mantine/core";
103
- import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
96
+ import { NodeContainer as NodeContainer8, NodeTrackConnections as NodeTrackConnections4 } from "@awesome-flow/core/layout";
97
+ import { useEffect as useEffect6, useMemo as useMemo5, useState as useState5 } from "react";
98
+ import { useIncomingComputedData as useIncomingComputedData3, useUpdateNodeComputedData as useUpdateNodeComputedData7 } from "@awesome-flow/core/hooks";
99
+ import { Group as Group5, Stack as Stack6 } from "@mantine/core";
100
+ import { jsx as jsx8, jsxs as jsxs7 } from "react/jsx-runtime";
104
101
  function NoiseRawTextureNode({ id, selected, data, type }) {
105
- const updateComputedData = useUpdateNodeComputedData2();
106
- const [dataLength, setDataLength] = useState2(0);
107
- const [resolution, setResolution] = useState2(0);
102
+ const updateComputedData = useUpdateNodeComputedData7();
103
+ const [dataLength, setDataLength] = useState5(0);
104
+ const [resolution, setResolution] = useState5(0);
108
105
  const incoming = useIncomingComputedData3(id);
109
- const noise = useMemo2(() => incoming?.map((p) => p.noise).flat(), [incoming]);
110
- useEffect2(() => {
106
+ const noise = useMemo5(() => incoming?.map((p) => p.noise).flat(), [incoming]);
107
+ useEffect6(() => {
111
108
  if (noise?.length) {
112
109
  const size = Math.ceil(Math.sqrt(noise.length));
113
110
  const colors = noise.map((n) => [n.value * 255, n.value * 255, n.value * 255, 255]).flat();
@@ -118,19 +115,19 @@ function NoiseRawTextureNode({ id, selected, data, type }) {
118
115
  updateComputedData(id, { textureData: dataArray, textureResolution: size });
119
116
  }
120
117
  }, [noise]);
121
- return /* @__PURE__ */ jsxs3(NodeContainer3, { id, selected, data, type, children: [
122
- /* @__PURE__ */ jsxs3(Stack3, { children: [
123
- /* @__PURE__ */ jsxs3(Group2, { children: [
118
+ return /* @__PURE__ */ jsxs7(NodeContainer8, { id, selected, data, type, children: [
119
+ /* @__PURE__ */ jsxs7(Stack6, { children: [
120
+ /* @__PURE__ */ jsxs7(Group5, { children: [
124
121
  "Resolution: ",
125
122
  resolution,
126
123
  "x",
127
124
  resolution
128
125
  ] }),
129
- /* @__PURE__ */ jsxs3(Group2, { children: [
126
+ /* @__PURE__ */ jsxs7(Group5, { children: [
130
127
  "Input Length: ",
131
128
  noise?.length || 0
132
129
  ] }),
133
- /* @__PURE__ */ jsxs3(Group2, { children: [
130
+ /* @__PURE__ */ jsxs7(Group5, { children: [
134
131
  "Output Length (",
135
132
  resolution,
136
133
  "*",
@@ -139,39 +136,1264 @@ function NoiseRawTextureNode({ id, selected, data, type }) {
139
136
  dataLength
140
137
  ] })
141
138
  ] }),
142
- /* @__PURE__ */ jsx3(NodeTrackConnections3, { handles: data.handles, nodeId: id, type: "target" })
139
+ /* @__PURE__ */ jsx8(NodeTrackConnections4, { handles: data.handles, nodeId: id, type: "target" })
143
140
  ] });
144
141
  }
145
142
  var noise_raw_texture_node_default = NoiseRawTextureNode;
146
143
 
144
+ // src/nodes/generators/noise-checkerboard-node.tsx
145
+ import { NodeContainer as NodeContainer9 } from "@awesome-flow/core/layout";
146
+ import { useEffect as useEffect7, useMemo as useMemo6 } from "react";
147
+ import { Checkerboard } from "libnoise-ts/module/generator";
148
+ import { useUpdateNodeComputedData as useUpdateNodeComputedData8 } from "@awesome-flow/core/hooks";
149
+ import { jsx as jsx9 } from "react/jsx-runtime";
150
+
147
151
  // src/nodes/output/positions-logger-node.tsx
148
- import { NodeContainer as NodeContainer4, NodeTrackConnections as NodeTrackConnections4 } from "@awesome-flow/core/layout";
149
- import { useMemo as useMemo3 } from "react";
150
- import { Divider as Divider2, Stack as Stack4, Text as Text2 } from "@mantine/core";
152
+ import { NodeContainer as NodeContainer10, NodeTrackConnections as NodeTrackConnections5 } from "@awesome-flow/core/layout";
153
+ import { useMemo as useMemo7 } from "react";
154
+ import { Divider as Divider2, Stack as Stack7, Text as Text2 } from "@mantine/core";
151
155
  import { useIncomingComputedData as useIncomingComputedData4 } from "@awesome-flow/core/hooks";
152
- import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
156
+ import { jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
153
157
  function PositionsLoggerNode({ id, selected, data, type }) {
154
158
  const incoming = useIncomingComputedData4(id);
155
- const positions = useMemo3(() => {
159
+ const positions = useMemo7(() => {
156
160
  return incoming?.map((p) => p.positions).flat();
157
161
  }, [incoming]);
158
- return /* @__PURE__ */ jsxs4(NodeContainer4, { id, selected, data, type, children: [
159
- /* @__PURE__ */ jsxs4(Text2, { children: [
162
+ return /* @__PURE__ */ jsxs8(NodeContainer10, { id, selected, data, type, children: [
163
+ /* @__PURE__ */ jsxs8(Text2, { children: [
160
164
  "Size: ",
161
165
  positions?.length || 0
162
166
  ] }),
163
- /* @__PURE__ */ jsx4(Divider2, { h: 5 }),
164
- /* @__PURE__ */ jsx4(Stack4, { children: positions?.map((v, i) => /* @__PURE__ */ jsxs4(Text2, { children: [
167
+ /* @__PURE__ */ jsx10(Divider2, { h: 5 }),
168
+ /* @__PURE__ */ jsx10(Stack7, { children: positions?.map((v, i) => /* @__PURE__ */ jsxs8(Text2, { children: [
165
169
  v.x,
166
170
  ":",
167
171
  v.y,
168
172
  ":",
169
173
  v.z
170
174
  ] }, i)) }),
171
- /* @__PURE__ */ jsx4(NodeTrackConnections4, { handles: data.handles, nodeId: id, type: "target" })
175
+ /* @__PURE__ */ jsx10(NodeTrackConnections5, { handles: data.handles, nodeId: id, type: "target" })
172
176
  ] });
173
177
  }
174
178
  var positions_logger_node_default = PositionsLoggerNode;
179
+
180
+ // src/nodes/generators/noise-cylinders-node.tsx
181
+ import { NodeContainer as NodeContainer11, NodeTrackConnections as NodeTrackConnections6 } from "@awesome-flow/core/layout";
182
+ import { useCallback as useCallback2, useMemo as useMemo8 } from "react";
183
+ import { Cylinders } from "libnoise-ts/module/generator";
184
+ import { useUpdateNodeComputedData as useUpdateNodeComputedData9 } from "@awesome-flow/core/hooks";
185
+ import { NodePropertyVariables as NodePropertyVariables2 } from "@awesome-flow/core/components";
186
+ import { jsx as jsx11, jsxs as jsxs9 } from "react/jsx-runtime";
187
+
188
+ // src/nodes/generators/noise-perlin-node.tsx
189
+ import { NodeContainer as NodeContainer12, NodeTrackConnections as NodeTrackConnections7 } from "@awesome-flow/core/layout";
190
+ import { useCallback as useCallback3, useMemo as useMemo9 } from "react";
191
+ import { Perlin } from "libnoise-ts/module/generator";
192
+ import { useUpdateNodeComputedData as useUpdateNodeComputedData10 } from "@awesome-flow/core/hooks";
193
+ import { NodePropertyVariables as NodePropertyVariables3 } from "@awesome-flow/core/components";
194
+ import { jsx as jsx12, jsxs as jsxs10 } from "react/jsx-runtime";
195
+
196
+ // src/nodes/generators/noise-ridgedmulti-node.tsx
197
+ import { NodeContainer as NodeContainer13, NodeTrackConnections as NodeTrackConnections8 } from "@awesome-flow/core/layout";
198
+ import { useCallback as useCallback4, useMemo as useMemo10 } from "react";
199
+ import { RidgedMulti } from "libnoise-ts/module/generator";
200
+ import { useUpdateNodeComputedData as useUpdateNodeComputedData11 } from "@awesome-flow/core/hooks";
201
+ import { NodePropertyVariables as NodePropertyVariables4 } from "@awesome-flow/core/components";
202
+ import { jsx as jsx13, jsxs as jsxs11 } from "react/jsx-runtime";
203
+
204
+ // src/nodes/generators/noise-spheres-node.tsx
205
+ import { NodeContainer as NodeContainer14, NodeTrackConnections as NodeTrackConnections9 } from "@awesome-flow/core/layout";
206
+ import { useCallback as useCallback5, useMemo as useMemo11 } from "react";
207
+ import { Spheres } from "libnoise-ts/module/generator";
208
+ import { useUpdateNodeComputedData as useUpdateNodeComputedData12 } from "@awesome-flow/core/hooks";
209
+ import { NodePropertyVariables as NodePropertyVariables5 } from "@awesome-flow/core/components";
210
+ import { jsx as jsx14, jsxs as jsxs12 } from "react/jsx-runtime";
211
+
212
+ // src/nodes/generators/noise-voronoi-node.tsx
213
+ import { NodeContainer as NodeContainer15, NodeTrackConnections as NodeTrackConnections10 } from "@awesome-flow/core/layout";
214
+ import { useCallback as useCallback6 } from "react";
215
+ import { Voronoi } from "libnoise-ts/module/generator";
216
+ import { useUpdateNodeComputedData as useUpdateNodeComputedData13 } from "@awesome-flow/core/hooks";
217
+ import { NodePropertyVariables as NodePropertyVariables6 } from "@awesome-flow/core/components";
218
+ import { jsx as jsx15, jsxs as jsxs13 } from "react/jsx-runtime";
219
+
220
+ // src/nodes/modifiers/noise-combine-node.tsx
221
+ import { NodeCombobox, NodeContainer as NodeContainer16, NodeTrackConnections as NodeTrackConnections11 } from "@awesome-flow/core/layout";
222
+ import { useCallback as useCallback7, useEffect as useEffect8 } from "react";
223
+ import {
224
+ useIncomingComputedData as useIncomingComputedData5,
225
+ useUpdateNodeComputedData as useUpdateNodeComputedData14,
226
+ useUpdateNodeData as useUpdateNodeData5
227
+ } from "@awesome-flow/core/hooks";
228
+ import {
229
+ IconAsterisk,
230
+ IconChevronLeft,
231
+ IconChevronRight,
232
+ IconChevronUp,
233
+ IconPlus
234
+ } from "@tabler/icons-react";
235
+
236
+ // src/abstract/operations.ts
237
+ import { Add, Max, Min, Multiply, Power } from "libnoise-ts/module/combiner";
238
+
239
+ // src/nodes/modifiers/noise-combine-node.tsx
240
+ import { jsx as jsx16, jsxs as jsxs14 } from "react/jsx-runtime";
241
+
242
+ // src/nodes/modifiers/noise-clamp-node.tsx
243
+ import { NodeContainer as NodeContainer17, NodeTrackConnections as NodeTrackConnections12 } from "@awesome-flow/core/layout";
244
+ import { useEffect as useEffect9, useState as useState6 } from "react";
245
+ import { Group as Group6, NumberInput as NumberInput5, Stack as Stack8 } from "@mantine/core";
246
+ import {
247
+ useIncomingComputedData as useIncomingComputedData6,
248
+ useUpdateNodeComputedData as useUpdateNodeComputedData15,
249
+ useUpdateNodeData as useUpdateNodeData6
250
+ } from "@awesome-flow/core/hooks";
251
+ import { Clamp } from "libnoise-ts/module/modifier";
252
+ import { jsx as jsx17, jsxs as jsxs15 } from "react/jsx-runtime";
253
+
254
+ // src/nodes/modifiers/noise-abs-node.tsx
255
+ import { NodeContainer as NodeContainer18, NodeTrackConnections as NodeTrackConnections13 } from "@awesome-flow/core/layout";
256
+ import { useEffect as useEffect10 } from "react";
257
+ import { useIncomingComputedData as useIncomingComputedData7, useUpdateNodeComputedData as useUpdateNodeComputedData16 } from "@awesome-flow/core/hooks";
258
+ import { Abs } from "libnoise-ts/module/modifier";
259
+ import { jsx as jsx18 } from "react/jsx-runtime";
260
+
261
+ // src/nodes/modifiers/noise-curve-node.tsx
262
+ import { NodeContainer as NodeContainer19, NodeTrackConnections as NodeTrackConnections14 } from "@awesome-flow/core/layout";
263
+ import { ActionIcon, Button, Group as Group7, NumberInput as NumberInput6, Space } from "@mantine/core";
264
+ import {
265
+ useIncomingComputedData as useIncomingComputedData8,
266
+ useUpdateNodeComputedData as useUpdateNodeComputedData17,
267
+ useUpdateNodeData as useUpdateNodeData7
268
+ } from "@awesome-flow/core/hooks";
269
+ import { useCallback as useCallback8, useEffect as useEffect11, useState as useState7 } from "react";
270
+ import { Curve } from "libnoise-ts/module/modifier";
271
+ import { Tuple } from "libnoise-ts/util";
272
+ import { IconX } from "@tabler/icons-react";
273
+ import { randomId } from "@mantine/hooks";
274
+ import { NodeState } from "@awesome-flow/core/abstract";
275
+ import { Fragment, jsx as jsx19, jsxs as jsxs16 } from "react/jsx-runtime";
276
+
277
+ // src/nodes/modifiers/noise-exponent-node.tsx
278
+ import { NodeContainer as NodeContainer20, NodeTrackConnections as NodeTrackConnections15 } from "@awesome-flow/core/layout";
279
+ import { useEffect as useEffect12, useState as useState8 } from "react";
280
+ import { Group as Group8, NumberInput as NumberInput7, Stack as Stack9 } from "@mantine/core";
281
+ import {
282
+ useIncomingComputedData as useIncomingComputedData9,
283
+ useUpdateNodeComputedData as useUpdateNodeComputedData18,
284
+ useUpdateNodeData as useUpdateNodeData8
285
+ } from "@awesome-flow/core/hooks";
286
+ import { Exponent } from "libnoise-ts/module/modifier";
287
+ import { jsx as jsx20, jsxs as jsxs17 } from "react/jsx-runtime";
288
+
289
+ // src/nodes/modifiers/noise-invert-node.tsx
290
+ import { NodeContainer as NodeContainer21, NodeTrackConnections as NodeTrackConnections16 } from "@awesome-flow/core/layout";
291
+ import { useEffect as useEffect13 } from "react";
292
+ import { useIncomingComputedData as useIncomingComputedData10, useUpdateNodeComputedData as useUpdateNodeComputedData19 } from "@awesome-flow/core/hooks";
293
+ import { Invert } from "libnoise-ts/module/modifier";
294
+ import { jsx as jsx21 } from "react/jsx-runtime";
295
+
296
+ // src/nodes/modifiers/noise-scale-bias-node.tsx
297
+ import { NodeContainer as NodeContainer22, NodeTrackConnections as NodeTrackConnections17 } from "@awesome-flow/core/layout";
298
+ import { useEffect as useEffect14, useState as useState9 } from "react";
299
+ import { Group as Group9, NumberInput as NumberInput8, Stack as Stack10 } from "@mantine/core";
300
+ import {
301
+ useIncomingComputedData as useIncomingComputedData11,
302
+ useUpdateNodeComputedData as useUpdateNodeComputedData20,
303
+ useUpdateNodeData as useUpdateNodeData9
304
+ } from "@awesome-flow/core/hooks";
305
+ import { ScaleBias } from "libnoise-ts/module/modifier";
306
+ import { jsx as jsx22, jsxs as jsxs18 } from "react/jsx-runtime";
307
+
308
+ // src/nodes/modifiers/noise-terrace-node.tsx
309
+ import { NodeContainer as NodeContainer23, NodeTrackConnections as NodeTrackConnections18 } from "@awesome-flow/core/layout";
310
+ import { ActionIcon as ActionIcon2, Button as Button2, Group as Group10, NumberInput as NumberInput9, Space as Space2 } from "@mantine/core";
311
+ import {
312
+ useIncomingComputedData as useIncomingComputedData12,
313
+ useUpdateNodeComputedData as useUpdateNodeComputedData21,
314
+ useUpdateNodeData as useUpdateNodeData10
315
+ } from "@awesome-flow/core/hooks";
316
+ import { useCallback as useCallback9, useEffect as useEffect15, useState as useState10 } from "react";
317
+ import { Terrace } from "libnoise-ts/module/modifier";
318
+ import { IconX as IconX2 } from "@tabler/icons-react";
319
+ import { randomId as randomId2 } from "@mantine/hooks";
320
+ import { NodeState as NodeState2 } from "@awesome-flow/core/abstract";
321
+ import { Fragment as Fragment2, jsx as jsx23, jsxs as jsxs19 } from "react/jsx-runtime";
322
+
323
+ // src/nodes/selectors/noise-blend-node.tsx
324
+ import { NodeContainer as NodeContainer24, NodeTrackConnections as NodeTrackConnections19 } from "@awesome-flow/core/layout";
325
+ import { useCallback as useCallback10 } from "react";
326
+ import { useUpdateNodeComputedData as useUpdateNodeComputedData22 } from "@awesome-flow/core/hooks";
327
+ import { Blend } from "libnoise-ts/module/selector";
328
+ import { HandlesIncomingDataStatus } from "@awesome-flow/core/components";
329
+ import { jsx as jsx24, jsxs as jsxs20 } from "react/jsx-runtime";
330
+
331
+ // src/nodes/selectors/noise-select-node.tsx
332
+ import { NodeContainer as NodeContainer25, NodeTrackConnections as NodeTrackConnections20 } from "@awesome-flow/core/layout";
333
+ import { useCallback as useCallback11, useEffect as useEffect16, useState as useState11 } from "react";
334
+ import { useUpdateNodeComputedData as useUpdateNodeComputedData23, useUpdateNodeData as useUpdateNodeData11 } from "@awesome-flow/core/hooks";
335
+ import { Select } from "libnoise-ts/module/selector";
336
+ import { Group as Group11, NumberInput as NumberInput10, Stack as Stack11 } from "@mantine/core";
337
+ import { HandlesIncomingDataStatus as HandlesIncomingDataStatus2 } from "@awesome-flow/core/components";
338
+ import { jsx as jsx25, jsxs as jsxs21 } from "react/jsx-runtime";
339
+
340
+ // src/nodes/transformers/noise-displace-node.tsx
341
+ import { NodeContainer as NodeContainer26, NodeTrackConnections as NodeTrackConnections21 } from "@awesome-flow/core/layout";
342
+ import { useCallback as useCallback12 } from "react";
343
+ import { useUpdateNodeComputedData as useUpdateNodeComputedData24 } from "@awesome-flow/core/hooks";
344
+ import { Displace } from "libnoise-ts/module/transformer";
345
+ import { HandlesIncomingDataStatus as HandlesIncomingDataStatus3 } from "@awesome-flow/core/components";
346
+ import { jsx as jsx26, jsxs as jsxs22 } from "react/jsx-runtime";
347
+
348
+ // src/nodes/transformers/noise-rotate-point-node.tsx
349
+ import { NodeContainer as NodeContainer27, NodeTrackConnections as NodeTrackConnections22 } from "@awesome-flow/core/layout";
350
+ import { useEffect as useEffect17, useState as useState12 } from "react";
351
+ import {
352
+ useIncomingComputedData as useIncomingComputedData13,
353
+ useUpdateNodeComputedData as useUpdateNodeComputedData25,
354
+ useUpdateNodeData as useUpdateNodeData12
355
+ } from "@awesome-flow/core/hooks";
356
+ import { Group as Group12, NumberInput as NumberInput11, Stack as Stack12 } from "@mantine/core";
357
+ import { RotatePoint } from "libnoise-ts/module/transformer";
358
+ import { jsx as jsx27, jsxs as jsxs23 } from "react/jsx-runtime";
359
+
360
+ // src/nodes/transformers/noise-scale-point-node.tsx
361
+ import { NodeContainer as NodeContainer28, NodeTrackConnections as NodeTrackConnections23 } from "@awesome-flow/core/layout";
362
+ import { useEffect as useEffect18, useState as useState13 } from "react";
363
+ import {
364
+ useIncomingComputedData as useIncomingComputedData14,
365
+ useUpdateNodeComputedData as useUpdateNodeComputedData26,
366
+ useUpdateNodeData as useUpdateNodeData13
367
+ } from "@awesome-flow/core/hooks";
368
+ import { Group as Group13, NumberInput as NumberInput12, Stack as Stack13 } from "@mantine/core";
369
+ import { ScalePoint } from "libnoise-ts/module/transformer";
370
+ import { jsx as jsx28, jsxs as jsxs24 } from "react/jsx-runtime";
371
+
372
+ // src/nodes/transformers/noise-translate-point-node.tsx
373
+ import { NodeContainer as NodeContainer29, NodeTrackConnections as NodeTrackConnections24 } from "@awesome-flow/core/layout";
374
+ import { useEffect as useEffect19, useState as useState14 } from "react";
375
+ import {
376
+ useIncomingComputedData as useIncomingComputedData15,
377
+ useUpdateNodeComputedData as useUpdateNodeComputedData27,
378
+ useUpdateNodeData as useUpdateNodeData14
379
+ } from "@awesome-flow/core/hooks";
380
+ import { Group as Group14, NumberInput as NumberInput13, Stack as Stack14 } from "@mantine/core";
381
+ import { TranslatePoint } from "libnoise-ts/module/transformer";
382
+ import { jsx as jsx29, jsxs as jsxs25 } from "react/jsx-runtime";
383
+
384
+ // src/nodes/transformers/noise-turbulence-node .tsx
385
+ import { NodeContainer as NodeContainer30, NodeTrackConnections as NodeTrackConnections25 } from "@awesome-flow/core/layout";
386
+ import { useCallback as useCallback13, useEffect as useEffect20, useState as useState15 } from "react";
387
+ import { useIncomingComputedData as useIncomingComputedData16, useUpdateNodeComputedData as useUpdateNodeComputedData28 } from "@awesome-flow/core/hooks";
388
+ import { Turbulence } from "libnoise-ts/module/transformer";
389
+ import { NodePropertyVariables as NodePropertyVariables7 } from "@awesome-flow/core/components";
390
+ import { jsx as jsx30, jsxs as jsxs26 } from "react/jsx-runtime";
391
+
392
+ // src/templates/generators/noise-checkerboard-template.ts
393
+ import { Position } from "@xyflow/system";
394
+ var NoiseCheckerboardNodeTemplateFactory = class {
395
+ template = {
396
+ type: "noise-checkerboard" /* noiseCheckerboard */,
397
+ group: "Noise Generators" /* noiseGenerators */,
398
+ data: {
399
+ title: "Checkerboard Noise"
400
+ },
401
+ handles: [
402
+ {
403
+ position: Position.Right,
404
+ dataType: "module" /* module */,
405
+ connection: "source"
406
+ }
407
+ ]
408
+ };
409
+ };
410
+
411
+ // src/templates/generators/noise-const-template.ts
412
+ import { Position as Position2 } from "@xyflow/system";
413
+ var NoiseConstNodeTemplateFactory = class {
414
+ template = {
415
+ type: "noise-constant" /* noiseConst */,
416
+ group: "Noise Generators" /* noiseGenerators */,
417
+ data: {
418
+ title: "Const Value Noise",
419
+ noise: 0,
420
+ min: -1,
421
+ max: 1
422
+ },
423
+ handles: [
424
+ {
425
+ position: Position2.Right,
426
+ dataType: "module" /* module */,
427
+ connection: "source"
428
+ }
429
+ ]
430
+ };
431
+ };
432
+
433
+ // src/templates/generators/noise-cylinders-template.ts
434
+ import { CoreHandleType } from "@awesome-flow/core/abstract";
435
+ import { Position as Position3 } from "@xyflow/system";
436
+ var NoiseCylindersNodeTemplateFactory = class {
437
+ template = {
438
+ type: "noise-cylinders" /* noiseCylinders */,
439
+ group: "Noise Generators" /* noiseGenerators */,
440
+ data: {
441
+ title: "Cylinders Noise",
442
+ frequency: 0.1
443
+ },
444
+ handles: [
445
+ {
446
+ position: Position3.Left,
447
+ dataType: CoreHandleType.variableProperty,
448
+ connection: "target"
449
+ },
450
+ {
451
+ position: Position3.Right,
452
+ dataType: "module" /* module */,
453
+ connection: "source"
454
+ }
455
+ ]
456
+ };
457
+ };
458
+
459
+ // src/templates/generators/noise-perlin-template.ts
460
+ import { CoreHandleType as CoreHandleType2 } from "@awesome-flow/core/abstract";
461
+ import { Position as Position4 } from "@xyflow/system";
462
+ var NoisePerlinNodeTemplateFactory = class {
463
+ template = {
464
+ type: "noise-perlin" /* noisePerlin */,
465
+ group: "Noise Generators" /* noiseGenerators */,
466
+ data: {
467
+ title: "Perlin Noise",
468
+ frequency: 0.1,
469
+ lacunarity: 2,
470
+ octaves: 5,
471
+ persistence: 0.5,
472
+ seed: 0
473
+ },
474
+ handles: [
475
+ {
476
+ position: Position4.Left,
477
+ dataType: CoreHandleType2.variableProperty,
478
+ connection: "target"
479
+ },
480
+ {
481
+ position: Position4.Right,
482
+ dataType: "module" /* module */,
483
+ connection: "source"
484
+ }
485
+ ]
486
+ };
487
+ };
488
+
489
+ // src/templates/generators/noise-ridgedmulti-template.ts
490
+ import { CoreHandleType as CoreHandleType3 } from "@awesome-flow/core/abstract";
491
+ import { Position as Position5 } from "@xyflow/system";
492
+ var NoiseRidgedMultiNodeTemplateFactory = class {
493
+ template = {
494
+ type: "noise-ridged-multi" /* noiseRidgedMulti */,
495
+ group: "Noise Generators" /* noiseGenerators */,
496
+ data: {
497
+ title: "Ridged Multi Noise",
498
+ frequency: 0.1,
499
+ lacunarity: 2,
500
+ octaves: 6,
501
+ offset: 1,
502
+ gain: 2,
503
+ seed: 0
504
+ },
505
+ handles: [
506
+ {
507
+ position: Position5.Left,
508
+ dataType: CoreHandleType3.variableProperty,
509
+ connection: "target"
510
+ },
511
+ {
512
+ position: Position5.Right,
513
+ dataType: "module" /* module */,
514
+ connection: "source"
515
+ }
516
+ ]
517
+ };
518
+ };
519
+
520
+ // src/templates/generators/noise-simplex-template.ts
521
+ import {
522
+ CoreHandleType as CoreHandleType4
523
+ } from "@awesome-flow/core/abstract";
524
+ import { Position as Position6 } from "@xyflow/system";
525
+ var NoiseSimplexNodeTemplateFactory = class {
526
+ template = {
527
+ type: "noise-simplex" /* noiseSimplex */,
528
+ group: "Noise Generators" /* noiseGenerators */,
529
+ data: {
530
+ title: "Simplex Noise"
531
+ },
532
+ handles: [
533
+ {
534
+ position: Position6.Left,
535
+ dataType: CoreHandleType4.variableProperty,
536
+ connection: "target"
537
+ },
538
+ {
539
+ position: Position6.Right,
540
+ dataType: "module" /* module */,
541
+ connection: "source"
542
+ }
543
+ ]
544
+ };
545
+ };
546
+
547
+ // src/templates/generators/noise-spheres-template.ts
548
+ import { CoreHandleType as CoreHandleType5 } from "@awesome-flow/core/abstract";
549
+ import { Position as Position7 } from "@xyflow/system";
550
+ var NoiseSpheresNodeTemplateFactory = class {
551
+ template = {
552
+ type: "noise-spheres" /* noiseSpheres */,
553
+ group: "Noise Generators" /* noiseGenerators */,
554
+ data: {
555
+ title: "Spheres Noise",
556
+ frequency: 0.1
557
+ },
558
+ handles: [
559
+ {
560
+ position: Position7.Left,
561
+ dataType: CoreHandleType5.variableProperty,
562
+ connection: "target"
563
+ },
564
+ {
565
+ position: Position7.Right,
566
+ dataType: "module" /* module */,
567
+ connection: "source"
568
+ }
569
+ ]
570
+ };
571
+ };
572
+
573
+ // src/templates/generators/noise-voronoi-template.ts
574
+ import { CoreHandleType as CoreHandleType6 } from "@awesome-flow/core/abstract";
575
+ import { Position as Position8 } from "@xyflow/system";
576
+ var NoiseVoronoiNodeTemplateFactory = class {
577
+ template = {
578
+ type: "noise-voronoi" /* noiseVoronoi */,
579
+ group: "Noise Generators" /* noiseGenerators */,
580
+ data: {
581
+ title: "Voronoi Noise",
582
+ frequency: 0.1,
583
+ displacement: 1,
584
+ distance: true,
585
+ seed: 0
586
+ },
587
+ handles: [
588
+ {
589
+ position: Position8.Left,
590
+ dataType: CoreHandleType6.variableProperty,
591
+ connection: "target"
592
+ },
593
+ {
594
+ position: Position8.Right,
595
+ dataType: "module" /* module */,
596
+ connection: "source"
597
+ }
598
+ ]
599
+ };
600
+ };
601
+
602
+ // src/templates/generators/position-const-template.ts
603
+ import { Position as Position9 } from "@xyflow/system";
604
+ var PositionConstNodeTemplateFactory = class {
605
+ template = {
606
+ type: "position" /* position */,
607
+ group: "Positions" /* positions */,
608
+ data: {
609
+ title: "Position Output",
610
+ position: { x: 0, y: 0, z: 0 }
611
+ },
612
+ handles: [
613
+ {
614
+ position: Position9.Right,
615
+ dataType: "position" /* position */,
616
+ connection: "source"
617
+ }
618
+ ]
619
+ };
620
+ };
621
+
622
+ // src/templates/generators/position-grid-template.ts
623
+ import { Position as Position10 } from "@xyflow/system";
624
+ var PositionGridNodeTemplateFactory = class {
625
+ template = {
626
+ type: "grid" /* grid */,
627
+ group: "Positions" /* positions */,
628
+ data: {
629
+ title: "Grid Output",
630
+ center: { x: 0, y: 0, z: 0 },
631
+ radius: 1
632
+ },
633
+ handles: [
634
+ {
635
+ position: Position10.Right,
636
+ dataType: "position" /* position */,
637
+ connection: "source"
638
+ }
639
+ ]
640
+ };
641
+ };
642
+
643
+ // src/templates/modifiers/noise-normalize-template.ts
644
+ import { IDGenerator } from "@awesome-flow/core/utils";
645
+ import { Position as Position11 } from "@xyflow/system";
646
+ var NoiseNormalizeNodeTemplateFactory = class {
647
+ template = {
648
+ id: IDGenerator.template(),
649
+ type: "noise-normalize" /* noiseNormalize */,
650
+ group: "Noise Modifiers" /* noiseModifiers */,
651
+ data: {
652
+ title: "Normalize Noise",
653
+ intervalStart: -1,
654
+ intervalEnd: 1
655
+ },
656
+ handles: [
657
+ {
658
+ position: Position11.Left,
659
+ dataType: "module" /* module */,
660
+ connection: "target",
661
+ maxConnections: 1
662
+ },
663
+ {
664
+ position: Position11.Right,
665
+ dataType: "module" /* module */,
666
+ connection: "source"
667
+ }
668
+ ]
669
+ };
670
+ };
671
+
672
+ // src/templates/output/noise-logger-template.ts
673
+ import { Position as Position12 } from "@xyflow/system";
674
+ var NoiseLoggerNodeTemplateFactory = class {
675
+ template = {
676
+ type: "noise-logger" /* noiseLogger */,
677
+ group: "Output" /* output */,
678
+ data: {
679
+ title: "Noise Logger"
680
+ },
681
+ handles: [
682
+ {
683
+ position: Position12.Left,
684
+ dataType: "noise" /* noise */,
685
+ connection: "target"
686
+ }
687
+ ]
688
+ };
689
+ };
690
+
691
+ // src/templates/output/noise-raw-texture-template.ts
692
+ import { Position as Position13 } from "@xyflow/system";
693
+ var NoiseRawTextureTemplateFactory = class {
694
+ template = {
695
+ type: "texture-data" /* textureData */,
696
+ group: "Output" /* output */,
697
+ data: {
698
+ title: "Texture Data"
699
+ },
700
+ handles: [
701
+ {
702
+ position: Position13.Left,
703
+ dataType: "noise" /* noise */,
704
+ connection: "target",
705
+ maxConnections: 1
706
+ },
707
+ {
708
+ position: Position13.Right,
709
+ dataType: "texture" /* texture */,
710
+ connection: "source"
711
+ }
712
+ ]
713
+ };
714
+ };
715
+
716
+ // src/templates/output/position-logger-template.ts
717
+ import { Position as Position14 } from "@xyflow/system";
718
+ var PositionLoggerNodeTemplateFactory = class {
719
+ template = {
720
+ type: "position-logger" /* positionLogger */,
721
+ group: "Positions" /* positions */,
722
+ data: {
723
+ title: "Position Logger"
724
+ },
725
+ handles: [
726
+ {
727
+ position: Position14.Left,
728
+ dataType: "position" /* position */,
729
+ connection: "target"
730
+ }
731
+ ]
732
+ };
733
+ };
734
+
735
+ // src/templates/modifiers/noise-combine-template.ts
736
+ import { Position as Position15 } from "@xyflow/system";
737
+ var NoiseCombineNodeTemplateFactory = class {
738
+ template = {
739
+ type: "noise-combiner" /* noiseCombine */,
740
+ group: "Noise Modifiers" /* noiseModifiers */,
741
+ data: {
742
+ title: "Combine Noise",
743
+ operation: "add" /* add */
744
+ },
745
+ handles: [
746
+ {
747
+ position: Position15.Left,
748
+ dataType: "module" /* module */,
749
+ connection: "target",
750
+ maxConnections: 2
751
+ },
752
+ {
753
+ position: Position15.Right,
754
+ dataType: "module" /* module */,
755
+ connection: "source"
756
+ }
757
+ ]
758
+ };
759
+ };
760
+
761
+ // src/templates/modifiers/noise-clamp-template.ts
762
+ import { Position as Position16 } from "@xyflow/system";
763
+ var NoiseClampNodeTemplateFactory = class {
764
+ template = {
765
+ type: "noise-clamp" /* noiseClamp */,
766
+ group: "Noise Modifiers" /* noiseModifiers */,
767
+ data: {
768
+ title: "Clamp Noise",
769
+ lowerBound: -1,
770
+ upperBound: 1
771
+ },
772
+ handles: [
773
+ {
774
+ position: Position16.Left,
775
+ dataType: "module" /* module */,
776
+ connection: "target",
777
+ maxConnections: 1
778
+ },
779
+ {
780
+ position: Position16.Right,
781
+ dataType: "module" /* module */,
782
+ connection: "source"
783
+ }
784
+ ]
785
+ };
786
+ };
787
+
788
+ // src/templates/modifiers/noise-abs-template.ts
789
+ import { Position as Position17 } from "@xyflow/system";
790
+ var NoiseAbsNodeTemplateFactory = class {
791
+ template = {
792
+ type: "noise-abs" /* noiseAbs */,
793
+ group: "Noise Modifiers" /* noiseModifiers */,
794
+ data: {
795
+ title: "Abs Noise"
796
+ },
797
+ handles: [
798
+ {
799
+ position: Position17.Left,
800
+ dataType: "module" /* module */,
801
+ connection: "target",
802
+ maxConnections: 1
803
+ },
804
+ {
805
+ position: Position17.Right,
806
+ dataType: "module" /* module */,
807
+ connection: "source"
808
+ }
809
+ ]
810
+ };
811
+ };
812
+
813
+ // src/templates/output/noise-output-template.ts
814
+ import { Position as Position18 } from "@xyflow/system";
815
+ var NoiseOutputNodeTemplateFactory = class {
816
+ template = {
817
+ type: "noise-output" /* noiseOutput */,
818
+ group: "Output" /* output */,
819
+ data: {
820
+ title: "Noise Output"
821
+ },
822
+ handles: [
823
+ {
824
+ position: Position18.Left,
825
+ dataType: "position" /* position */,
826
+ connection: "target"
827
+ },
828
+ {
829
+ position: Position18.Left,
830
+ dataType: "module" /* module */,
831
+ connection: "target",
832
+ maxConnections: 1
833
+ },
834
+ {
835
+ position: Position18.Right,
836
+ dataType: "noise" /* noise */,
837
+ connection: "source"
838
+ }
839
+ ]
840
+ };
841
+ };
842
+
843
+ // src/templates/modifiers/noise-curve-template.ts
844
+ import { CoreHandleType as CoreHandleType7 } from "@awesome-flow/core/abstract";
845
+ import { Position as Position19 } from "@xyflow/system";
846
+ var NoiseCurveNodeTemplateFactory = class {
847
+ template = {
848
+ type: "noise-curve" /* noiseCurve */,
849
+ group: "Noise Modifiers" /* noiseModifiers */,
850
+ data: {
851
+ title: "Noise Curve",
852
+ points: []
853
+ },
854
+ handles: [
855
+ {
856
+ position: Position19.Left,
857
+ dataType: "module" /* module */,
858
+ connection: "target",
859
+ maxConnections: 1
860
+ },
861
+ {
862
+ position: Position19.Left,
863
+ dataType: CoreHandleType7.variableProperty,
864
+ connection: "target"
865
+ },
866
+ {
867
+ position: Position19.Right,
868
+ dataType: "module" /* module */,
869
+ connection: "source"
870
+ }
871
+ ]
872
+ };
873
+ };
874
+
875
+ // src/templates/modifiers/noise-exponent-template.ts
876
+ import { Position as Position20 } from "@xyflow/system";
877
+ var NoiseExponentNodeTemplateFactory = class {
878
+ template = {
879
+ type: "noise-exponent" /* noiseExponent */,
880
+ group: "Noise Modifiers" /* noiseModifiers */,
881
+ data: {
882
+ title: "Noise Exponent",
883
+ exponent: 1
884
+ },
885
+ handles: [
886
+ {
887
+ position: Position20.Left,
888
+ dataType: "module" /* module */,
889
+ connection: "target",
890
+ maxConnections: 1
891
+ },
892
+ {
893
+ position: Position20.Right,
894
+ dataType: "module" /* module */,
895
+ connection: "source"
896
+ }
897
+ ]
898
+ };
899
+ };
900
+
901
+ // src/templates/modifiers/noise-invert-template.ts
902
+ import { Position as Position21 } from "@xyflow/system";
903
+ var NoiseInvertNodeTemplateFactory = class {
904
+ template = {
905
+ type: "noise-invert" /* noiseInvert */,
906
+ group: "Noise Modifiers" /* noiseModifiers */,
907
+ data: {
908
+ title: "Invert Noise"
909
+ },
910
+ handles: [
911
+ {
912
+ position: Position21.Left,
913
+ dataType: "module" /* module */,
914
+ connection: "target",
915
+ maxConnections: 1
916
+ },
917
+ {
918
+ position: Position21.Right,
919
+ dataType: "module" /* module */,
920
+ connection: "source"
921
+ }
922
+ ]
923
+ };
924
+ };
925
+
926
+ // src/templates/modifiers/noise-scalebias-template.ts
927
+ import { Position as Position22 } from "@xyflow/system";
928
+ var NoiseScaleBiasNodeTemplateFactory = class {
929
+ template = {
930
+ type: "noise-scale-bias" /* noiseScaleBias */,
931
+ group: "Noise Modifiers" /* noiseModifiers */,
932
+ data: {
933
+ title: "Scale/Bias Noise",
934
+ scale: 1,
935
+ bias: 0
936
+ },
937
+ handles: [
938
+ {
939
+ position: Position22.Left,
940
+ dataType: "module" /* module */,
941
+ connection: "target",
942
+ maxConnections: 1
943
+ },
944
+ {
945
+ position: Position22.Right,
946
+ dataType: "module" /* module */,
947
+ connection: "source"
948
+ }
949
+ ]
950
+ };
951
+ };
952
+
953
+ // src/templates/modifiers/noise-terrace-template.ts
954
+ import { Position as Position23 } from "@xyflow/system";
955
+ var NoiseTerraceNodeTemplateFactory = class {
956
+ template = {
957
+ type: "noise-terrace" /* noiseTerrace */,
958
+ group: "Noise Modifiers" /* noiseModifiers */,
959
+ data: {
960
+ title: "Noise Terrace",
961
+ points: []
962
+ },
963
+ handles: [
964
+ {
965
+ position: Position23.Left,
966
+ dataType: "module" /* module */,
967
+ connection: "target",
968
+ maxConnections: 1
969
+ },
970
+ {
971
+ position: Position23.Right,
972
+ dataType: "module" /* module */,
973
+ connection: "source"
974
+ }
975
+ ]
976
+ };
977
+ };
978
+
979
+ // src/templates/selectors/noise-blend-template.ts
980
+ import { Position as Position24 } from "@xyflow/system";
981
+ var NoiseBlendNodeTemplateFactory = class {
982
+ template = {
983
+ type: "noise-blend" /* noiseBlend */,
984
+ group: "Noise Selectors" /* noiseSelectors */,
985
+ data: {
986
+ title: "Noise Blend"
987
+ },
988
+ handles: [
989
+ {
990
+ position: Position24.Left,
991
+ dataType: "module" /* module */,
992
+ connection: "target",
993
+ label: "Source Modules",
994
+ dataId: "source" /* source */,
995
+ maxConnections: 2,
996
+ minConnections: 2
997
+ },
998
+ {
999
+ position: Position24.Left,
1000
+ dataType: "module" /* module */,
1001
+ dataId: "control" /* control */,
1002
+ connection: "target",
1003
+ label: "Control Module",
1004
+ maxConnections: 1
1005
+ },
1006
+ {
1007
+ position: Position24.Right,
1008
+ dataType: "module" /* module */,
1009
+ dataId: "output" /* output */,
1010
+ connection: "source"
1011
+ }
1012
+ ]
1013
+ };
1014
+ };
1015
+
1016
+ // src/templates/selectors/noise-select-template.ts
1017
+ import { Position as Position25 } from "@xyflow/system";
1018
+ var NoiseSelectNodeTemplateFactory = class {
1019
+ template = {
1020
+ type: "noise-select" /* noiseSelect */,
1021
+ group: "Noise Selectors" /* noiseSelectors */,
1022
+ data: {
1023
+ title: "Noise Select",
1024
+ edgeFalloff: 0,
1025
+ lowerBound: -1,
1026
+ upperBound: 1
1027
+ },
1028
+ handles: [
1029
+ {
1030
+ position: Position25.Left,
1031
+ dataType: "module" /* module */,
1032
+ dataId: "source" /* source */,
1033
+ connection: "target",
1034
+ label: "Source Modules",
1035
+ maxConnections: 2,
1036
+ minConnections: 2
1037
+ },
1038
+ {
1039
+ position: Position25.Left,
1040
+ dataType: "module" /* module */,
1041
+ dataId: "control" /* control */,
1042
+ connection: "target",
1043
+ label: "Control Module",
1044
+ maxConnections: 1
1045
+ },
1046
+ {
1047
+ position: Position25.Right,
1048
+ dataType: "module" /* module */,
1049
+ dataId: "output" /* output */,
1050
+ connection: "source"
1051
+ }
1052
+ ]
1053
+ };
1054
+ };
1055
+
1056
+ // src/templates/transformers/noise-displace-template.ts
1057
+ import { Position as Position26 } from "@xyflow/system";
1058
+ var NoiseDisplaceNodeTemplateFactory = class {
1059
+ template = {
1060
+ type: "noise-displace" /* noiseDisplace */,
1061
+ group: "Noise Transformers" /* noiseTransformers */,
1062
+ data: {
1063
+ title: "Noise Displace"
1064
+ },
1065
+ handles: [
1066
+ {
1067
+ position: Position26.Left,
1068
+ connection: "target",
1069
+ label: "Source Module",
1070
+ dataType: "module" /* module */,
1071
+ dataId: "source" /* sourceModule */,
1072
+ maxConnections: 1
1073
+ },
1074
+ {
1075
+ position: Position26.Left,
1076
+ connection: "target",
1077
+ label: "X Module",
1078
+ dataType: "module" /* module */,
1079
+ dataId: "x-module" /* xModule */,
1080
+ maxConnections: 1
1081
+ },
1082
+ {
1083
+ position: Position26.Left,
1084
+ connection: "target",
1085
+ label: "Y Module",
1086
+ dataType: "module" /* module */,
1087
+ dataId: "y-module" /* yModule */,
1088
+ maxConnections: 1
1089
+ },
1090
+ {
1091
+ position: Position26.Left,
1092
+ connection: "target",
1093
+ label: "Z Module",
1094
+ dataType: "module" /* module */,
1095
+ dataId: "z-module" /* zModule */,
1096
+ maxConnections: 1
1097
+ },
1098
+ {
1099
+ position: Position26.Right,
1100
+ dataType: "module" /* module */,
1101
+ dataId: "output" /* output */,
1102
+ connection: "source"
1103
+ }
1104
+ ]
1105
+ };
1106
+ };
1107
+
1108
+ // src/templates/transformers/noise-rotate-point-template.ts
1109
+ import { Position as Position27 } from "@xyflow/system";
1110
+ var NoiseRotatePointNodeTemplateFactory = class {
1111
+ template = {
1112
+ type: "noise-rotate-point" /* noiseRotatePoint */,
1113
+ group: "Noise Transformers" /* noiseTransformers */,
1114
+ data: {
1115
+ title: "Noise Rotate Point",
1116
+ xAngle: 0,
1117
+ yAngle: 0,
1118
+ zAngle: 0
1119
+ },
1120
+ handles: [
1121
+ {
1122
+ position: Position27.Left,
1123
+ dataType: "module" /* module */,
1124
+ connection: "target",
1125
+ label: "Source Module",
1126
+ maxConnections: 1
1127
+ },
1128
+ {
1129
+ position: Position27.Right,
1130
+ dataType: "module" /* module */,
1131
+ connection: "source"
1132
+ }
1133
+ ]
1134
+ };
1135
+ };
1136
+
1137
+ // src/templates/transformers/noise-scale-point-template.ts
1138
+ import { Position as Position28 } from "@xyflow/system";
1139
+ var NoiseScalePointNodeTemplateFactory = class {
1140
+ template = {
1141
+ type: "noise-scale-point" /* noiseScalePoint */,
1142
+ group: "Noise Transformers" /* noiseTransformers */,
1143
+ data: {
1144
+ title: "Noise Scale Point",
1145
+ xScale: 1,
1146
+ yScale: 1,
1147
+ zScale: 1
1148
+ },
1149
+ handles: [
1150
+ {
1151
+ position: Position28.Left,
1152
+ dataType: "module" /* module */,
1153
+ connection: "target",
1154
+ label: "Source Module",
1155
+ maxConnections: 1
1156
+ },
1157
+ {
1158
+ position: Position28.Right,
1159
+ dataType: "module" /* module */,
1160
+ connection: "source"
1161
+ }
1162
+ ]
1163
+ };
1164
+ };
1165
+
1166
+ // src/templates/transformers/noise-translate-point-template.ts
1167
+ import { Position as Position29 } from "@xyflow/system";
1168
+ var NoiseTranslatePointNodeTemplateFactory = class {
1169
+ template = {
1170
+ type: "noise-translate-point" /* noiseTranslatePoint */,
1171
+ group: "Noise Transformers" /* noiseTransformers */,
1172
+ data: {
1173
+ title: "Noise Translate Point",
1174
+ translateX: 0,
1175
+ translateY: 0,
1176
+ translateZ: 0
1177
+ },
1178
+ handles: [
1179
+ {
1180
+ position: Position29.Left,
1181
+ dataType: "module" /* module */,
1182
+ connection: "target",
1183
+ label: "Source Module",
1184
+ maxConnections: 1
1185
+ },
1186
+ {
1187
+ position: Position29.Right,
1188
+ dataType: "module" /* module */,
1189
+ connection: "source"
1190
+ }
1191
+ ]
1192
+ };
1193
+ };
1194
+
1195
+ // src/templates/transformers/noise-turbulence-template.ts
1196
+ import { CoreHandleType as CoreHandleType8 } from "@awesome-flow/core/abstract";
1197
+ import { Position as Position30 } from "@xyflow/system";
1198
+ var NoiseTurbulenceNodeTemplateFactory = class {
1199
+ template = {
1200
+ type: "noise-turbulence" /* noiseTurbulence */,
1201
+ group: "Noise Transformers" /* noiseTransformers */,
1202
+ data: {
1203
+ title: "Noise Turbulence",
1204
+ frequency: 1,
1205
+ power: 1,
1206
+ roughness: 1,
1207
+ seed: 0
1208
+ },
1209
+ handles: [
1210
+ {
1211
+ position: Position30.Left,
1212
+ dataType: "module" /* module */,
1213
+ connection: "target",
1214
+ label: "Source Module",
1215
+ maxConnections: 1
1216
+ },
1217
+ {
1218
+ position: Position30.Left,
1219
+ dataType: CoreHandleType8.variableProperty,
1220
+ label: "Variable Properties",
1221
+ connection: "target"
1222
+ },
1223
+ {
1224
+ position: Position30.Right,
1225
+ dataType: "module" /* module */,
1226
+ connection: "source"
1227
+ }
1228
+ ]
1229
+ };
1230
+ };
1231
+
1232
+ // src/templates/generators/noise-billow-template.ts
1233
+ import { CoreHandleType as CoreHandleType9 } from "@awesome-flow/core/abstract";
1234
+ import { IDGenerator as IDGenerator2 } from "@awesome-flow/core/utils";
1235
+ import { Position as Position31 } from "@xyflow/system";
1236
+ var NoiseBillowNodeTemplateFactory = class {
1237
+ template = {
1238
+ id: IDGenerator2.template(),
1239
+ type: "noise-billow" /* noiseBillow */,
1240
+ group: "Noise Generators" /* noiseGenerators */,
1241
+ data: {
1242
+ title: "Billow Noise",
1243
+ frequency: 0.1,
1244
+ lacunarity: 2,
1245
+ octaves: 5,
1246
+ persistence: 0.5,
1247
+ seed: 0
1248
+ },
1249
+ handles: [
1250
+ {
1251
+ position: Position31.Left,
1252
+ dataType: CoreHandleType9.variableProperty,
1253
+ connection: "target"
1254
+ },
1255
+ {
1256
+ position: Position31.Right,
1257
+ dataType: "module" /* module */,
1258
+ connection: "source"
1259
+ }
1260
+ ]
1261
+ };
1262
+ };
1263
+
1264
+ // src/templates/groups/module-group-template.ts
1265
+ import {
1266
+ CoreTemplateGroup
1267
+ } from "@awesome-flow/core/abstract";
1268
+ import { IDGenerator as IDGenerator3 } from "@awesome-flow/core/utils";
1269
+ import { Position as Position32 } from "@xyflow/system";
1270
+ var ModuleGroupNodeTemplateFactory = class {
1271
+ template = {
1272
+ id: IDGenerator3.template(),
1273
+ type: "group-module" /* groupModule */,
1274
+ group: CoreTemplateGroup.groups,
1275
+ data: {
1276
+ title: "Modules Group",
1277
+ isGroup: true,
1278
+ initialSize: {
1279
+ width: 300,
1280
+ height: 200
1281
+ },
1282
+ collapsedSize: {
1283
+ width: 300,
1284
+ height: 80
1285
+ }
1286
+ },
1287
+ handles: [
1288
+ {
1289
+ position: Position32.Bottom,
1290
+ dataType: "module" /* module */,
1291
+ connection: "target",
1292
+ maxConnections: 1,
1293
+ hideOnCollapse: true
1294
+ },
1295
+ {
1296
+ position: Position32.Right,
1297
+ dataType: "module" /* module */,
1298
+ connection: "source"
1299
+ }
1300
+ ]
1301
+ };
1302
+ };
1303
+
1304
+ // src/nodes/groups/module-group-node.tsx
1305
+ import { NodeContainer as NodeContainer31, NodeCollapse, NodeTrackConnections as NodeTrackConnections26 } from "@awesome-flow/core/layout";
1306
+ import { NodeResizer, useStore, useUpdateNodeInternals } from "@xyflow/react";
1307
+ import { FlowContext } from "@awesome-flow/core/abstract";
1308
+ import { useCallback as useCallback14, useContext, useEffect as useEffect21, useMemo as useMemo12 } from "react";
1309
+ import { shallow } from "zustand/shallow";
1310
+ import { Badge, Group as Group15 } from "@mantine/core";
1311
+ import { useIncomingComputedData as useIncomingComputedData17, useUpdateNodeComputedData as useUpdateNodeComputedData29 } from "@awesome-flow/core/hooks";
1312
+ import { jsx as jsx31, jsxs as jsxs27 } from "react/jsx-runtime";
1313
+
1314
+ // src/abstract/node-types.ts
1315
+ var noiseNodeTemplates = {
1316
+ ["noise-output" /* noiseOutput */]: new NoiseOutputNodeTemplateFactory(),
1317
+ ["noise-simplex" /* noiseSimplex */]: new NoiseSimplexNodeTemplateFactory(),
1318
+ ["noise-billow" /* noiseBillow */]: new NoiseBillowNodeTemplateFactory(),
1319
+ ["noise-checkerboard" /* noiseCheckerboard */]: new NoiseCheckerboardNodeTemplateFactory(),
1320
+ ["noise-normalize" /* noiseNormalize */]: new NoiseNormalizeNodeTemplateFactory(),
1321
+ ["noise-logger" /* noiseLogger */]: new NoiseLoggerNodeTemplateFactory(),
1322
+ ["noise-constant" /* noiseConst */]: new NoiseConstNodeTemplateFactory(),
1323
+ ["position" /* position */]: new PositionConstNodeTemplateFactory(),
1324
+ ["position-logger" /* positionLogger */]: new PositionLoggerNodeTemplateFactory(),
1325
+ ["grid" /* grid */]: new PositionGridNodeTemplateFactory(),
1326
+ ["texture-data" /* textureData */]: new NoiseRawTextureTemplateFactory(),
1327
+ ["noise-cylinders" /* noiseCylinders */]: new NoiseCylindersNodeTemplateFactory(),
1328
+ ["noise-perlin" /* noisePerlin */]: new NoisePerlinNodeTemplateFactory(),
1329
+ ["noise-ridged-multi" /* noiseRidgedMulti */]: new NoiseRidgedMultiNodeTemplateFactory(),
1330
+ ["noise-spheres" /* noiseSpheres */]: new NoiseSpheresNodeTemplateFactory(),
1331
+ ["noise-voronoi" /* noiseVoronoi */]: new NoiseVoronoiNodeTemplateFactory(),
1332
+ ["noise-combiner" /* noiseCombine */]: new NoiseCombineNodeTemplateFactory(),
1333
+ ["noise-clamp" /* noiseClamp */]: new NoiseClampNodeTemplateFactory(),
1334
+ ["noise-abs" /* noiseAbs */]: new NoiseAbsNodeTemplateFactory(),
1335
+ ["noise-curve" /* noiseCurve */]: new NoiseCurveNodeTemplateFactory(),
1336
+ ["noise-exponent" /* noiseExponent */]: new NoiseExponentNodeTemplateFactory(),
1337
+ ["noise-invert" /* noiseInvert */]: new NoiseInvertNodeTemplateFactory(),
1338
+ ["noise-scale-bias" /* noiseScaleBias */]: new NoiseScaleBiasNodeTemplateFactory(),
1339
+ ["noise-terrace" /* noiseTerrace */]: new NoiseTerraceNodeTemplateFactory(),
1340
+ ["noise-blend" /* noiseBlend */]: new NoiseBlendNodeTemplateFactory(),
1341
+ ["noise-select" /* noiseSelect */]: new NoiseSelectNodeTemplateFactory(),
1342
+ ["noise-displace" /* noiseDisplace */]: new NoiseDisplaceNodeTemplateFactory(),
1343
+ ["noise-rotate-point" /* noiseRotatePoint */]: new NoiseRotatePointNodeTemplateFactory(),
1344
+ ["noise-scale-point" /* noiseScalePoint */]: new NoiseScalePointNodeTemplateFactory(),
1345
+ ["noise-translate-point" /* noiseTranslatePoint */]: new NoiseTranslatePointNodeTemplateFactory(),
1346
+ ["noise-turbulence" /* noiseTurbulence */]: new NoiseTurbulenceNodeTemplateFactory(),
1347
+ ["group-module" /* groupModule */]: new ModuleGroupNodeTemplateFactory()
1348
+ };
1349
+
1350
+ // src/nodes/output/noise-output-node.tsx
1351
+ import { jsx as jsx32, jsxs as jsxs28 } from "react/jsx-runtime";
1352
+ function NoiseOutputNode({ id, selected, data, type }) {
1353
+ const [size, setSize] = useState16(0);
1354
+ const updateComputedData = useUpdateNodeComputedData30();
1355
+ const onDataUpdated = useCallback15(
1356
+ (handleData) => {
1357
+ const incomingPositions = handleData["position" /* position */];
1358
+ const incomingModule = handleData["module" /* module */];
1359
+ if (incomingPositions?.length && incomingModule?.length && incomingModule[0]?.module) {
1360
+ const { module } = incomingModule[0];
1361
+ const noise = [];
1362
+ for (const input of incomingPositions) {
1363
+ for (const position of input.positions) {
1364
+ const value = module.getValue(position.x, position.y, position.z);
1365
+ noise.push({
1366
+ position,
1367
+ value
1368
+ });
1369
+ }
1370
+ }
1371
+ updateComputedData(id, { noise, module });
1372
+ setSize(noise.length);
1373
+ }
1374
+ },
1375
+ []
1376
+ );
1377
+ return /* @__PURE__ */ jsxs28(NodeContainer32, { id, selected, data, type, children: [
1378
+ /* @__PURE__ */ jsx32(
1379
+ HandlesIncomingDataStatus4,
1380
+ {
1381
+ nodeId: id,
1382
+ handles: data.handles,
1383
+ handleKey: "dataType",
1384
+ onDataUpdated,
1385
+ type: "target",
1386
+ resetComputedData: true
1387
+ }
1388
+ ),
1389
+ /* @__PURE__ */ jsxs28(Text3, { mt: 5, children: [
1390
+ "Noise points: ",
1391
+ size
1392
+ ] }),
1393
+ /* @__PURE__ */ jsx32(NodeTrackConnections27, { handles: data.handles, nodeId: id, type: "target" })
1394
+ ] });
1395
+ }
1396
+ var noise_output_node_default = NoiseOutputNode;
175
1397
  export {
176
1398
  noise_logger_node_default as NoiseLoggerNode,
177
1399
  noise_output_node_default as NoiseOutputNode,