@awesome-flow/noise 0.7.1 → 0.9.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 (57) hide show
  1. package/dist/abstract/index.cjs +29 -1
  2. package/dist/abstract/index.js +29 -1
  3. package/dist/chunk-2Y22M2Y4.js +0 -0
  4. package/dist/chunk-4PQ4USYV.cjs +1 -0
  5. package/dist/chunk-5ELMFIRV.js +0 -0
  6. package/dist/chunk-ACWBUUZ7.cjs +1376 -0
  7. package/dist/chunk-BG6U3TYO.js +1376 -0
  8. package/dist/chunk-D5JM4EYQ.cjs +305 -0
  9. package/dist/chunk-DWSACR65.js +305 -0
  10. package/dist/chunk-FFQRP23R.cjs +1 -0
  11. package/dist/chunk-JACBT4MS.cjs +1 -0
  12. package/dist/chunk-KHIIB5TH.js +93 -0
  13. package/dist/chunk-M67JHEU2.cjs +93 -0
  14. package/dist/chunk-N6YNJKLS.cjs +1 -0
  15. package/dist/chunk-PS5VUND5.js +348 -0
  16. package/dist/chunk-Q5FVGKKM.cjs +1 -0
  17. package/dist/chunk-RDQ4BOOV.js +522 -0
  18. package/dist/chunk-RKTZQUWR.cjs +348 -0
  19. package/dist/chunk-RVWCBH7K.js +0 -0
  20. package/dist/chunk-SD3T3LFY.js +0 -0
  21. package/dist/chunk-SGHEOOLW.js +19 -0
  22. package/dist/chunk-TOYKGWYO.js +0 -0
  23. package/dist/chunk-TZCT2GZV.cjs +522 -0
  24. package/dist/chunk-UNMRBZ5X.cjs +19 -0
  25. package/dist/chunk-WOJTKQKO.cjs +1 -0
  26. package/dist/chunk-XZQQ6N3L.js +0 -0
  27. package/dist/modules/index.cjs +6 -1
  28. package/dist/modules/index.js +6 -1
  29. package/dist/nodes/generators/index.cjs +24 -1
  30. package/dist/nodes/generators/index.js +24 -1
  31. package/dist/nodes/groups/index.cjs +6 -1
  32. package/dist/nodes/groups/index.js +6 -1
  33. package/dist/nodes/index.cjs +75 -1
  34. package/dist/nodes/index.js +75 -1
  35. package/dist/nodes/modifiers/index.cjs +23 -1
  36. package/dist/nodes/modifiers/index.js +23 -1
  37. package/dist/nodes/output/index.cjs +17 -1
  38. package/dist/nodes/output/index.js +17 -1
  39. package/dist/nodes/selectors/index.cjs +13 -1
  40. package/dist/nodes/selectors/index.js +13 -1
  41. package/dist/nodes/transformers/index.cjs +14 -1
  42. package/dist/nodes/transformers/index.js +14 -1
  43. package/dist/templates/generators/index.cjs +30 -1
  44. package/dist/templates/generators/index.js +30 -1
  45. package/dist/templates/groups/index.cjs +12 -1
  46. package/dist/templates/groups/index.js +12 -1
  47. package/dist/templates/index.cjs +77 -1
  48. package/dist/templates/index.js +77 -1
  49. package/dist/templates/modifiers/index.cjs +28 -1
  50. package/dist/templates/modifiers/index.js +28 -1
  51. package/dist/templates/output/index.cjs +18 -1
  52. package/dist/templates/output/index.js +18 -1
  53. package/dist/templates/selectors/index.cjs +14 -1
  54. package/dist/templates/selectors/index.js +14 -1
  55. package/dist/templates/transformers/index.cjs +20 -1
  56. package/dist/templates/transformers/index.js +20 -1
  57. package/package.json +26 -18
@@ -0,0 +1,93 @@
1
+ // src/nodes/groups/module-group-node.tsx
2
+ import {
3
+ useFlowStore,
4
+ useIncomingComputedData,
5
+ useInteractiveStore,
6
+ useUpdateNodeComputedData
7
+ } from "@awesome-flow/core/hooks";
8
+ import { NodeCollapse, NodeContainer, NodeTrackConnections } from "@awesome-flow/core/layout";
9
+ import { Badge, Group } from "@mantine/core";
10
+ import { NodeResizer, useStore, useUpdateNodeInternals } from "@xyflow/react";
11
+ import { useCallback, useEffect, useMemo } from "react";
12
+ import { shallow } from "zustand/shallow";
13
+ import { jsx, jsxs } from "react/jsx-runtime";
14
+ function ModuleGroupNode({
15
+ id,
16
+ selected,
17
+ data,
18
+ type,
19
+ width,
20
+ height
21
+ }) {
22
+ const updateNodeInternals = useUpdateNodeInternals();
23
+ const triggerNodeChanges = useStore((s) => s.triggerNodeChanges);
24
+ const { groupNodes, setGroupCollapsed } = useFlowStore(
25
+ useCallback(
26
+ (state) => ({ groupNodes: state.groups[id], setGroupCollapsed: state.setGroupCollapsed }),
27
+ []
28
+ )
29
+ );
30
+ const intersectingNode = useInteractiveStore(
31
+ useCallback((state) => state.nodeIntersectionTargets[id], [id]),
32
+ shallow
33
+ );
34
+ useEffect(() => {
35
+ updateNodeInternals(id);
36
+ }, [width, height]);
37
+ useEffect(() => {
38
+ triggerNodeChanges([
39
+ {
40
+ id,
41
+ type: "select",
42
+ selected: !!intersectingNode
43
+ }
44
+ ]);
45
+ }, [intersectingNode]);
46
+ const onCollapsed = useCallback((collapsed) => {
47
+ setGroupCollapsed(id, collapsed);
48
+ }, []);
49
+ const size = useMemo(() => {
50
+ return {
51
+ width: data.initialSize?.width || 100,
52
+ height: data.initialSize?.height || 50
53
+ };
54
+ }, [data.initialSize]);
55
+ const incomingModules = useIncomingComputedData(id);
56
+ const updateComputedData = useUpdateNodeComputedData();
57
+ useEffect(() => {
58
+ if (incomingModules?.length) {
59
+ const { module } = incomingModules[0];
60
+ updateComputedData(id, { module });
61
+ }
62
+ }, [incomingModules]);
63
+ return /* @__PURE__ */ jsxs(
64
+ NodeContainer,
65
+ {
66
+ id,
67
+ selected,
68
+ data,
69
+ title: /* @__PURE__ */ jsx(Group, { justify: "space-between", children: /* @__PURE__ */ jsxs(Group, { gap: "xs", children: [
70
+ /* @__PURE__ */ jsx(Badge, { size: "xs", variant: "outline", radius: "xs", color: "gray", children: groupNodes?.length || 0 }),
71
+ /* @__PURE__ */ jsx(NodeCollapse, { nodeId: id, isCollapsed: data.isCollapsed, onCollapsed })
72
+ ] }) }),
73
+ type,
74
+ children: [
75
+ /* @__PURE__ */ jsx(
76
+ NodeResizer,
77
+ {
78
+ nodeId: id,
79
+ minWidth: size.width,
80
+ minHeight: size.height,
81
+ isVisible: selected && !data.isCollapsed
82
+ }
83
+ ),
84
+ /* @__PURE__ */ jsx(NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
85
+ ]
86
+ }
87
+ );
88
+ }
89
+ var module_group_node_default = ModuleGroupNode;
90
+
91
+ export {
92
+ module_group_node_default
93
+ };
@@ -0,0 +1,93 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }// src/nodes/groups/module-group-node.tsx
2
+
3
+
4
+
5
+
6
+
7
+ var _hooks = require('@awesome-flow/core/hooks');
8
+ var _layout = require('@awesome-flow/core/layout');
9
+ var _core = require('@mantine/core');
10
+ var _react = require('@xyflow/react');
11
+ var _react3 = require('react');
12
+ var _shallow = require('zustand/shallow');
13
+ var _jsxruntime = require('react/jsx-runtime');
14
+ function ModuleGroupNode({
15
+ id,
16
+ selected,
17
+ data,
18
+ type,
19
+ width,
20
+ height
21
+ }) {
22
+ const updateNodeInternals = _react.useUpdateNodeInternals.call(void 0, );
23
+ const triggerNodeChanges = _react.useStore.call(void 0, (s) => s.triggerNodeChanges);
24
+ const { groupNodes, setGroupCollapsed } = _hooks.useFlowStore.call(void 0,
25
+ _react3.useCallback.call(void 0,
26
+ (state) => ({ groupNodes: state.groups[id], setGroupCollapsed: state.setGroupCollapsed }),
27
+ []
28
+ )
29
+ );
30
+ const intersectingNode = _hooks.useInteractiveStore.call(void 0,
31
+ _react3.useCallback.call(void 0, (state) => state.nodeIntersectionTargets[id], [id]),
32
+ _shallow.shallow
33
+ );
34
+ _react3.useEffect.call(void 0, () => {
35
+ updateNodeInternals(id);
36
+ }, [width, height]);
37
+ _react3.useEffect.call(void 0, () => {
38
+ triggerNodeChanges([
39
+ {
40
+ id,
41
+ type: "select",
42
+ selected: !!intersectingNode
43
+ }
44
+ ]);
45
+ }, [intersectingNode]);
46
+ const onCollapsed = _react3.useCallback.call(void 0, (collapsed) => {
47
+ setGroupCollapsed(id, collapsed);
48
+ }, []);
49
+ const size = _react3.useMemo.call(void 0, () => {
50
+ return {
51
+ width: _optionalChain([data, 'access', _ => _.initialSize, 'optionalAccess', _2 => _2.width]) || 100,
52
+ height: _optionalChain([data, 'access', _3 => _3.initialSize, 'optionalAccess', _4 => _4.height]) || 50
53
+ };
54
+ }, [data.initialSize]);
55
+ const incomingModules = _hooks.useIncomingComputedData.call(void 0, id);
56
+ const updateComputedData = _hooks.useUpdateNodeComputedData.call(void 0, );
57
+ _react3.useEffect.call(void 0, () => {
58
+ if (_optionalChain([incomingModules, 'optionalAccess', _5 => _5.length])) {
59
+ const { module } = incomingModules[0];
60
+ updateComputedData(id, { module });
61
+ }
62
+ }, [incomingModules]);
63
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
64
+ _layout.NodeContainer,
65
+ {
66
+ id,
67
+ selected,
68
+ data,
69
+ title: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _core.Group, { justify: "space-between", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _core.Group, { gap: "xs", children: [
70
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _core.Badge, { size: "xs", variant: "outline", radius: "xs", color: "gray", children: _optionalChain([groupNodes, 'optionalAccess', _6 => _6.length]) || 0 }),
71
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _layout.NodeCollapse, { nodeId: id, isCollapsed: data.isCollapsed, onCollapsed })
72
+ ] }) }),
73
+ type,
74
+ children: [
75
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
76
+ _react.NodeResizer,
77
+ {
78
+ nodeId: id,
79
+ minWidth: size.width,
80
+ minHeight: size.height,
81
+ isVisible: selected && !data.isCollapsed
82
+ }
83
+ ),
84
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _layout.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
85
+ ]
86
+ }
87
+ );
88
+ }
89
+ var module_group_node_default = ModuleGroupNode;
90
+
91
+
92
+
93
+ exports.module_group_node_default = module_group_node_default;
@@ -0,0 +1 @@
1
+ "use strict";
@@ -0,0 +1,348 @@
1
+ // src/nodes/transformers/noise-displace-node.tsx
2
+ import { HandlesIncomingDataStatus } from "@awesome-flow/core/components";
3
+ import { useUpdateNodeComputedData } from "@awesome-flow/core/hooks";
4
+ import { NodeContainer, NodeTrackConnections } from "@awesome-flow/core/layout";
5
+ import { Displace } from "libnoise-simplex-ts";
6
+ import { useCallback } from "react";
7
+
8
+ // src/abstract/handle-types.ts
9
+ var NoiseHandleType = /* @__PURE__ */ ((NoiseHandleType2) => {
10
+ NoiseHandleType2["texture"] = "texture";
11
+ NoiseHandleType2["noise"] = "noise";
12
+ NoiseHandleType2["position"] = "position";
13
+ NoiseHandleType2["module"] = "module";
14
+ return NoiseHandleType2;
15
+ })(NoiseHandleType || {});
16
+ var DisplacementHandle = /* @__PURE__ */ ((DisplacementHandle2) => {
17
+ DisplacementHandle2["sourceModule"] = "source";
18
+ DisplacementHandle2["xModule"] = "x-module";
19
+ DisplacementHandle2["yModule"] = "y-module";
20
+ DisplacementHandle2["zModule"] = "z-module";
21
+ DisplacementHandle2["output"] = "output";
22
+ return DisplacementHandle2;
23
+ })(DisplacementHandle || {});
24
+ var NoiseSourceControlHandle = /* @__PURE__ */ ((NoiseSourceControlHandle2) => {
25
+ NoiseSourceControlHandle2["source"] = "source";
26
+ NoiseSourceControlHandle2["control"] = "control";
27
+ NoiseSourceControlHandle2["output"] = "output";
28
+ return NoiseSourceControlHandle2;
29
+ })(NoiseSourceControlHandle || {});
30
+
31
+ // src/nodes/transformers/noise-displace-node.tsx
32
+ import { jsx, jsxs } from "react/jsx-runtime";
33
+ function NoiseDisplaceNode({ id, selected, data, type }) {
34
+ const updateComputedData = useUpdateNodeComputedData();
35
+ const onDataUpdated = useCallback(
36
+ (handleData) => {
37
+ const sourceModule = handleData["source" /* sourceModule */];
38
+ const xModule = handleData["x-module" /* xModule */];
39
+ const yModule = handleData["y-module" /* yModule */];
40
+ const zModule = handleData["z-module" /* zModule */];
41
+ if (sourceModule && xModule && yModule && zModule) {
42
+ const module = new Displace(
43
+ sourceModule[0].module,
44
+ xModule[0].module,
45
+ yModule[0].module,
46
+ zModule[0].module
47
+ );
48
+ updateComputedData(id, { module });
49
+ }
50
+ },
51
+ []
52
+ );
53
+ return /* @__PURE__ */ jsxs(NodeContainer, { id, selected, data, type, children: [
54
+ /* @__PURE__ */ jsx(
55
+ HandlesIncomingDataStatus,
56
+ {
57
+ nodeId: id,
58
+ handles: data.handles,
59
+ handleKey: "dataId",
60
+ onDataUpdated,
61
+ type: "target",
62
+ resetComputedData: true
63
+ }
64
+ ),
65
+ /* @__PURE__ */ jsx(NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
66
+ ] });
67
+ }
68
+ var noise_displace_node_default = NoiseDisplaceNode;
69
+
70
+ // src/nodes/transformers/noise-rotate-point-node.tsx
71
+ import {
72
+ useIncomingComputedData,
73
+ useUpdateNodeComputedData as useUpdateNodeComputedData2,
74
+ useUpdateNodeData
75
+ } from "@awesome-flow/core/hooks";
76
+ import { NodeContainer as NodeContainer2, NodeTrackConnections as NodeTrackConnections2 } from "@awesome-flow/core/layout";
77
+ import { Group, NumberInput, Stack } from "@mantine/core";
78
+ import { RotatePoint } from "libnoise-simplex-ts";
79
+ import { useEffect, useState } from "react";
80
+ import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
81
+ function NoiseRotatePointNode({
82
+ id,
83
+ selected,
84
+ data,
85
+ type
86
+ }) {
87
+ const [xAngle, setXAngle] = useState(data.xAngle);
88
+ const [yAngle, setYAngle] = useState(data.yAngle);
89
+ const [zAngle, setZAngle] = useState(data.zAngle);
90
+ const incoming = useIncomingComputedData(id);
91
+ const updateNodeData = useUpdateNodeData();
92
+ const updateComputedData = useUpdateNodeComputedData2();
93
+ useEffect(() => {
94
+ if (incoming?.length) {
95
+ const module = new RotatePoint(incoming[0].module, xAngle, yAngle, zAngle);
96
+ updateComputedData(id, { module });
97
+ }
98
+ updateNodeData(id, { xAngle, yAngle, zAngle });
99
+ }, [id, updateComputedData, updateNodeData, incoming, xAngle, yAngle, zAngle]);
100
+ return /* @__PURE__ */ jsxs2(NodeContainer2, { id, selected, data, type, children: [
101
+ /* @__PURE__ */ jsxs2(Stack, { children: [
102
+ /* @__PURE__ */ jsxs2(Group, { children: [
103
+ "X Angle:",
104
+ /* @__PURE__ */ jsx2(
105
+ NumberInput,
106
+ {
107
+ size: "xs",
108
+ w: 100,
109
+ value: xAngle,
110
+ onChange: (e) => setXAngle(Number(e)),
111
+ step: 0.01
112
+ }
113
+ )
114
+ ] }),
115
+ /* @__PURE__ */ jsxs2(Group, { children: [
116
+ "Y Angle:",
117
+ /* @__PURE__ */ jsx2(
118
+ NumberInput,
119
+ {
120
+ size: "xs",
121
+ w: 100,
122
+ value: yAngle,
123
+ onChange: (e) => setYAngle(Number(e)),
124
+ step: 0.01
125
+ }
126
+ )
127
+ ] }),
128
+ /* @__PURE__ */ jsxs2(Group, { children: [
129
+ "Z Angle:",
130
+ /* @__PURE__ */ jsx2(
131
+ NumberInput,
132
+ {
133
+ size: "xs",
134
+ w: 100,
135
+ value: zAngle,
136
+ onChange: (e) => setZAngle(Number(e)),
137
+ step: 0.01
138
+ }
139
+ )
140
+ ] })
141
+ ] }),
142
+ /* @__PURE__ */ jsx2(NodeTrackConnections2, { handles: data.handles, nodeId: id, type: "target" })
143
+ ] });
144
+ }
145
+ var noise_rotate_point_node_default = NoiseRotatePointNode;
146
+
147
+ // src/nodes/transformers/noise-scale-point-node.tsx
148
+ import {
149
+ useIncomingComputedData as useIncomingComputedData2,
150
+ useUpdateNodeComputedData as useUpdateNodeComputedData3,
151
+ useUpdateNodeData as useUpdateNodeData2
152
+ } from "@awesome-flow/core/hooks";
153
+ import { NodeContainer as NodeContainer3, NodeTrackConnections as NodeTrackConnections3 } from "@awesome-flow/core/layout";
154
+ import { Group as Group2, NumberInput as NumberInput2, Stack as Stack2 } from "@mantine/core";
155
+ import { ScalePoint } from "libnoise-simplex-ts";
156
+ import { useEffect as useEffect2, useState as useState2 } from "react";
157
+ import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
158
+ function NoiseScalePointNode({
159
+ id,
160
+ selected,
161
+ data,
162
+ type
163
+ }) {
164
+ const [xScale, setXScale] = useState2(data.xScale);
165
+ const [yScale, setYScale] = useState2(data.yScale);
166
+ const [zScale, setZScale] = useState2(data.zScale);
167
+ const incoming = useIncomingComputedData2(id);
168
+ const updateNodeData = useUpdateNodeData2();
169
+ const updateComputedData = useUpdateNodeComputedData3();
170
+ useEffect2(() => {
171
+ if (incoming?.length) {
172
+ const module = new ScalePoint(incoming[0].module, xScale, yScale, zScale);
173
+ updateComputedData(id, { module });
174
+ }
175
+ updateNodeData(id, { xScale, yScale, zScale });
176
+ }, [id, incoming, updateComputedData, updateNodeData, xScale, yScale, zScale]);
177
+ return /* @__PURE__ */ jsxs3(NodeContainer3, { id, selected, data, type, children: [
178
+ /* @__PURE__ */ jsxs3(Stack2, { children: [
179
+ /* @__PURE__ */ jsxs3(Group2, { children: [
180
+ "X Scale:",
181
+ /* @__PURE__ */ jsx3(
182
+ NumberInput2,
183
+ {
184
+ size: "xs",
185
+ w: 100,
186
+ value: xScale,
187
+ onChange: (e) => setXScale(Number(e)),
188
+ step: 0.01
189
+ }
190
+ )
191
+ ] }),
192
+ /* @__PURE__ */ jsxs3(Group2, { children: [
193
+ "Y Scale:",
194
+ /* @__PURE__ */ jsx3(
195
+ NumberInput2,
196
+ {
197
+ size: "xs",
198
+ w: 100,
199
+ value: yScale,
200
+ onChange: (e) => setYScale(Number(e)),
201
+ step: 0.01
202
+ }
203
+ )
204
+ ] }),
205
+ /* @__PURE__ */ jsxs3(Group2, { children: [
206
+ "Z Scale:",
207
+ /* @__PURE__ */ jsx3(
208
+ NumberInput2,
209
+ {
210
+ size: "xs",
211
+ w: 100,
212
+ value: zScale,
213
+ onChange: (e) => setZScale(Number(e)),
214
+ step: 0.01
215
+ }
216
+ )
217
+ ] })
218
+ ] }),
219
+ /* @__PURE__ */ jsx3(NodeTrackConnections3, { handles: data.handles, nodeId: id, type: "target" })
220
+ ] });
221
+ }
222
+ var noise_scale_point_node_default = NoiseScalePointNode;
223
+
224
+ // src/nodes/transformers/noise-translate-point-node.tsx
225
+ import {
226
+ useIncomingComputedData as useIncomingComputedData3,
227
+ useUpdateNodeComputedData as useUpdateNodeComputedData4,
228
+ useUpdateNodeData as useUpdateNodeData3
229
+ } from "@awesome-flow/core/hooks";
230
+ import { NodeContainer as NodeContainer4, NodeTrackConnections as NodeTrackConnections4 } from "@awesome-flow/core/layout";
231
+ import { Group as Group3, NumberInput as NumberInput3, Stack as Stack3 } from "@mantine/core";
232
+ import { TranslatePoint } from "libnoise-simplex-ts";
233
+ import { useEffect as useEffect3, useState as useState3 } from "react";
234
+ import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
235
+ function NoiseTranslatePointNode({
236
+ id,
237
+ selected,
238
+ data,
239
+ type
240
+ }) {
241
+ const [translateX, setTranslateX] = useState3(data.translateX);
242
+ const [translateY, setTranslateY] = useState3(data.translateY);
243
+ const [translateZ, setTranslateZ] = useState3(data.translateZ);
244
+ const incoming = useIncomingComputedData3(id);
245
+ const updateNodeData = useUpdateNodeData3();
246
+ const updateComputedData = useUpdateNodeComputedData4();
247
+ useEffect3(() => {
248
+ if (incoming?.length) {
249
+ const module = new TranslatePoint(incoming[0].module, translateX, translateY, translateZ);
250
+ updateComputedData(id, { module });
251
+ }
252
+ updateNodeData(id, { translateX, translateY, translateZ });
253
+ }, [id, incoming, translateX, translateY, translateZ, updateComputedData, updateNodeData]);
254
+ return /* @__PURE__ */ jsxs4(NodeContainer4, { id, selected, data, type, children: [
255
+ /* @__PURE__ */ jsxs4(Stack3, { children: [
256
+ /* @__PURE__ */ jsxs4(Group3, { children: [
257
+ "Translate X:",
258
+ /* @__PURE__ */ jsx4(
259
+ NumberInput3,
260
+ {
261
+ size: "xs",
262
+ w: 100,
263
+ value: translateX,
264
+ onChange: (e) => setTranslateX(Number(e)),
265
+ step: 1
266
+ }
267
+ )
268
+ ] }),
269
+ /* @__PURE__ */ jsxs4(Group3, { children: [
270
+ "Translate Y:",
271
+ /* @__PURE__ */ jsx4(
272
+ NumberInput3,
273
+ {
274
+ size: "xs",
275
+ w: 100,
276
+ value: translateY,
277
+ onChange: (e) => setTranslateY(Number(e)),
278
+ step: 1
279
+ }
280
+ )
281
+ ] }),
282
+ /* @__PURE__ */ jsxs4(Group3, { children: [
283
+ "Translate Z:",
284
+ /* @__PURE__ */ jsx4(
285
+ NumberInput3,
286
+ {
287
+ size: "xs",
288
+ w: 100,
289
+ value: translateZ,
290
+ onChange: (e) => setTranslateZ(Number(e)),
291
+ step: 1
292
+ }
293
+ )
294
+ ] })
295
+ ] }),
296
+ /* @__PURE__ */ jsx4(NodeTrackConnections4, { handles: data.handles, nodeId: id, type: "target" })
297
+ ] });
298
+ }
299
+ var noise_translate_point_node_default = NoiseTranslatePointNode;
300
+
301
+ // src/nodes/transformers/noise-turbulence-node.tsx
302
+ import { NodePropertyVariables } from "@awesome-flow/core/components";
303
+ import { useIncomingComputedData as useIncomingComputedData4, useUpdateNodeComputedData as useUpdateNodeComputedData5 } from "@awesome-flow/core/hooks";
304
+ import { NodeContainer as NodeContainer5, NodeTrackConnections as NodeTrackConnections5 } from "@awesome-flow/core/layout";
305
+ import { Turbulence } from "libnoise-simplex-ts";
306
+ import { useCallback as useCallback2, useEffect as useEffect4, useState as useState4 } from "react";
307
+ import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
308
+ function NoiseTurbulenceNode({
309
+ id,
310
+ selected,
311
+ data,
312
+ type
313
+ }) {
314
+ const [properties, setProperties] = useState4(null);
315
+ const incoming = useIncomingComputedData4(id);
316
+ const updateComputedData = useUpdateNodeComputedData5();
317
+ const onPropertiesChange = useCallback2((props) => {
318
+ setProperties(props);
319
+ }, []);
320
+ useEffect4(() => {
321
+ if (incoming?.length && properties) {
322
+ const module = new Turbulence(
323
+ incoming[0].module,
324
+ properties.frequency.value,
325
+ properties.power.value,
326
+ properties.roughness.value,
327
+ properties.seed.value
328
+ );
329
+ updateComputedData(id, { module });
330
+ }
331
+ }, [id, incoming, properties]);
332
+ return /* @__PURE__ */ jsxs5(NodeContainer5, { id, selected, data, type, children: [
333
+ /* @__PURE__ */ jsx5(NodePropertyVariables, { data, nodeId: id, onPropertiesChange }),
334
+ /* @__PURE__ */ jsx5(NodeTrackConnections5, { handles: data.handles, nodeId: id, type: "target" })
335
+ ] });
336
+ }
337
+ var noise_turbulence_node_default = NoiseTurbulenceNode;
338
+
339
+ export {
340
+ NoiseHandleType,
341
+ DisplacementHandle,
342
+ NoiseSourceControlHandle,
343
+ noise_displace_node_default,
344
+ noise_rotate_point_node_default,
345
+ noise_scale_point_node_default,
346
+ noise_translate_point_node_default,
347
+ noise_turbulence_node_default
348
+ };
@@ -0,0 +1 @@
1
+ "use strict";