@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.
- package/dist/abstract/index.cjs +1405 -2078
- package/dist/abstract/index.cjs.map +1 -1
- package/dist/abstract/index.d.cts +23 -25
- package/dist/abstract/index.d.ts +23 -25
- package/dist/abstract/index.js +1315 -1996
- package/dist/abstract/index.js.map +1 -1
- package/dist/index-BungWYrh.d.cts +49 -0
- package/dist/index-DsQSjZC5.d.ts +49 -0
- package/dist/{node-props-CeZ8Oshz.d.ts → node-props-BbqbXDXn.d.cts} +2 -22
- package/dist/{node-props-hKW-_KOU.d.cts → node-props-BbqbXDXn.d.ts} +2 -22
- package/dist/nodes/generators/index.cjs +130 -380
- package/dist/nodes/generators/index.cjs.map +1 -1
- package/dist/nodes/generators/index.d.cts +2 -8
- package/dist/nodes/generators/index.d.ts +2 -8
- package/dist/nodes/generators/index.js +112 -360
- package/dist/nodes/generators/index.js.map +1 -1
- package/dist/nodes/groups/index.cjs +25 -13
- package/dist/nodes/groups/index.cjs.map +1 -1
- package/dist/nodes/groups/index.js +26 -14
- package/dist/nodes/groups/index.js.map +1 -1
- package/dist/nodes/index.cjs +1654 -988
- package/dist/nodes/index.cjs.map +1 -1
- package/dist/nodes/index.d.cts +3 -5
- package/dist/nodes/index.d.ts +3 -5
- package/dist/nodes/index.js +1622 -960
- package/dist/nodes/index.js.map +1 -1
- package/dist/nodes/modifiers/index.cjs +17 -119
- package/dist/nodes/modifiers/index.cjs.map +1 -1
- package/dist/nodes/modifiers/index.d.cts +2 -6
- package/dist/nodes/modifiers/index.d.ts +2 -6
- package/dist/nodes/modifiers/index.js +16 -124
- package/dist/nodes/modifiers/index.js.map +1 -1
- package/dist/nodes/output/index.cjs +1271 -89
- package/dist/nodes/output/index.cjs.map +1 -1
- package/dist/nodes/output/index.js +1314 -92
- package/dist/nodes/output/index.js.map +1 -1
- package/dist/nodes/selectors/index.cjs +1296 -58
- package/dist/nodes/selectors/index.cjs.map +1 -1
- package/dist/nodes/selectors/index.d.cts +1 -3
- package/dist/nodes/selectors/index.d.ts +1 -3
- package/dist/nodes/selectors/index.js +1339 -65
- package/dist/nodes/selectors/index.js.map +1 -1
- package/dist/nodes/transformers/index.cjs +67 -206
- package/dist/nodes/transformers/index.cjs.map +1 -1
- package/dist/nodes/transformers/index.d.cts +3 -5
- package/dist/nodes/transformers/index.d.ts +3 -5
- package/dist/nodes/transformers/index.js +54 -193
- package/dist/nodes/transformers/index.js.map +1 -1
- package/dist/templates/generators/index.cjs +839 -1278
- package/dist/templates/generators/index.cjs.map +1 -1
- package/dist/templates/generators/index.d.cts +13 -50
- package/dist/templates/generators/index.d.ts +13 -50
- package/dist/templates/generators/index.js +836 -1280
- package/dist/templates/generators/index.js.map +1 -1
- package/dist/templates/groups/index.cjs +837 -1272
- package/dist/templates/groups/index.cjs.map +1 -1
- package/dist/templates/groups/index.d.cts +1 -5
- package/dist/templates/groups/index.d.ts +1 -5
- package/dist/templates/groups/index.js +835 -1277
- package/dist/templates/groups/index.js.map +1 -1
- package/dist/templates/index.cjs +839 -1280
- package/dist/templates/index.cjs.map +1 -1
- package/dist/templates/index.d.cts +4 -7
- package/dist/templates/index.d.ts +4 -7
- package/dist/templates/index.js +836 -1281
- package/dist/templates/index.js.map +1 -1
- package/dist/templates/modifiers/index.cjs +841 -1278
- package/dist/templates/modifiers/index.cjs.map +1 -1
- package/dist/templates/modifiers/index.d.cts +11 -38
- package/dist/templates/modifiers/index.d.ts +11 -38
- package/dist/templates/modifiers/index.js +838 -1281
- package/dist/templates/modifiers/index.js.map +1 -1
- package/dist/templates/output/index.cjs +839 -1274
- package/dist/templates/output/index.cjs.map +1 -1
- package/dist/templates/output/index.d.cts +4 -14
- package/dist/templates/output/index.d.ts +4 -14
- package/dist/templates/output/index.js +837 -1279
- package/dist/templates/output/index.js.map +1 -1
- package/dist/templates/selectors/index.cjs +839 -1274
- package/dist/templates/selectors/index.cjs.map +1 -1
- package/dist/templates/selectors/index.d.cts +3 -9
- package/dist/templates/selectors/index.d.ts +3 -9
- package/dist/templates/selectors/index.js +837 -1279
- package/dist/templates/selectors/index.js.map +1 -1
- package/dist/templates/transformers/index.cjs +839 -1274
- package/dist/templates/transformers/index.cjs.map +1 -1
- package/dist/templates/transformers/index.d.cts +3 -36
- package/dist/templates/transformers/index.d.ts +3 -36
- package/dist/templates/transformers/index.js +837 -1279
- package/dist/templates/transformers/index.js.map +1 -1
- package/package.json +3 -3
- package/dist/handle-types-D-v5S53h.d.cts +0 -22
- package/dist/handle-types-D-v5S53h.d.ts +0 -22
- package/dist/layout/index.cjs +0 -164
- package/dist/layout/index.cjs.map +0 -1
- package/dist/layout/index.d.cts +0 -26
- package/dist/layout/index.d.ts +0 -26
- package/dist/layout/index.js +0 -136
- package/dist/layout/index.js.map +0 -1
- package/dist/properties-BxwtU6i9.d.cts +0 -9
- package/dist/properties-BxwtU6i9.d.ts +0 -9
|
@@ -85,8 +85,7 @@ __export(modifiers_exports, {
|
|
|
85
85
|
NoiseInvertNode: () => noise_invert_node_default,
|
|
86
86
|
NoiseNormalizeNode: () => noise_normalize_node_default,
|
|
87
87
|
NoiseScaleBiasNode: () => noise_scale_bias_node_default,
|
|
88
|
-
NoiseTerraceNode: () => noise_terrace_node_default
|
|
89
|
-
VariableCombineNode: () => variable_combine_node_default
|
|
88
|
+
NoiseTerraceNode: () => noise_terrace_node_default
|
|
90
89
|
});
|
|
91
90
|
module.exports = __toCommonJS(modifiers_exports);
|
|
92
91
|
|
|
@@ -197,7 +196,7 @@ function NoiseCombineNode({ id, selected, data, type }) {
|
|
|
197
196
|
updateNodeData(id, { operation });
|
|
198
197
|
}, []);
|
|
199
198
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_layout3.NodeContainer, { id, selected, data, type, children: [
|
|
200
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_layout3.NodeCombobox, { options, selected: data.operation, onChange }),
|
|
199
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_layout3.NodeCombobox, { options, selected: data.operation, onChange, width: 150 }),
|
|
201
200
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_layout3.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
202
201
|
] });
|
|
203
202
|
}
|
|
@@ -854,6 +853,11 @@ function useFormWatch({
|
|
|
854
853
|
};
|
|
855
854
|
}
|
|
856
855
|
|
|
856
|
+
// ../../node_modules/@mantine/form/esm/paths/get-data-path.mjs
|
|
857
|
+
function getDataPath(formName, fieldPath) {
|
|
858
|
+
return formName ? `${formName}-${fieldPath.toString()}` : fieldPath.toString();
|
|
859
|
+
}
|
|
860
|
+
|
|
857
861
|
// ../../node_modules/@mantine/form/esm/validate/validate-values.mjs
|
|
858
862
|
function getValidationResults(errors) {
|
|
859
863
|
const filteredErrors = filterErrors(errors);
|
|
@@ -955,7 +959,7 @@ function useForm({
|
|
|
955
959
|
$values.initialize(values, () => mode === "uncontrolled" && setFormKey((key2) => key2 + 1));
|
|
956
960
|
}, []);
|
|
957
961
|
const setFieldValue = (0, import_react10.useCallback)(
|
|
958
|
-
(path, value,
|
|
962
|
+
(path, value, options2) => {
|
|
959
963
|
const shouldValidate = shouldValidateOnChange(path, validateInputOnChange);
|
|
960
964
|
$status.clearFieldDirty(path);
|
|
961
965
|
$status.setFieldTouched(path, true);
|
|
@@ -970,7 +974,7 @@ function useForm({
|
|
|
970
974
|
const validationResults = validateFieldValue(path, rules, payload.updatedValues);
|
|
971
975
|
validationResults.hasError ? $errors.setFieldError(path, validationResults.error) : $errors.clearFieldError(path);
|
|
972
976
|
} : null,
|
|
973
|
-
|
|
977
|
+
options2?.forceUpdate !== false && mode !== "controlled" ? () => setFieldKeys((keys) => ({
|
|
974
978
|
...keys,
|
|
975
979
|
[path]: (keys[path] || 0) + 1
|
|
976
980
|
})) : null
|
|
@@ -1012,7 +1016,7 @@ function useForm({
|
|
|
1012
1016
|
const onChange = getInputOnChange(
|
|
1013
1017
|
(value) => setFieldValue(path, value, { forceUpdate: false })
|
|
1014
1018
|
);
|
|
1015
|
-
const payload = { onChange };
|
|
1019
|
+
const payload = { onChange, "data-path": getDataPath(name, path) };
|
|
1016
1020
|
if (withError) {
|
|
1017
1021
|
payload.error = $errors.errorsState[path];
|
|
1018
1022
|
}
|
|
@@ -1065,6 +1069,10 @@ function useForm({
|
|
|
1065
1069
|
[rules]
|
|
1066
1070
|
);
|
|
1067
1071
|
const key = (path) => `${formKey}-${path}-${fieldKeys[path] || 0}`;
|
|
1072
|
+
const getInputNode = (0, import_react10.useCallback)(
|
|
1073
|
+
(path) => document.querySelector(`[data-path="${getDataPath(name, path)}"]`),
|
|
1074
|
+
[]
|
|
1075
|
+
);
|
|
1068
1076
|
const form = {
|
|
1069
1077
|
watch: $watch.watch,
|
|
1070
1078
|
initialized: $values.initialized.current,
|
|
@@ -1098,7 +1106,8 @@ function useForm({
|
|
|
1098
1106
|
onReset,
|
|
1099
1107
|
isValid,
|
|
1100
1108
|
getTransformedValues,
|
|
1101
|
-
key
|
|
1109
|
+
key,
|
|
1110
|
+
getInputNode
|
|
1102
1111
|
};
|
|
1103
1112
|
useFormActions(name, form);
|
|
1104
1113
|
return form;
|
|
@@ -1467,116 +1476,6 @@ function NoiseTerraceNode({ id, selected, data, type }) {
|
|
|
1467
1476
|
] });
|
|
1468
1477
|
}
|
|
1469
1478
|
var noise_terrace_node_default = NoiseTerraceNode;
|
|
1470
|
-
|
|
1471
|
-
// src/nodes/modifiers/variable-combine-node.tsx
|
|
1472
|
-
var import_layout10 = require("@awesome-flow/core/layout");
|
|
1473
|
-
var import_react18 = require("react");
|
|
1474
|
-
var import_hooks13 = require("@awesome-flow/core/hooks");
|
|
1475
|
-
var import_icons_react4 = require("@tabler/icons-react");
|
|
1476
|
-
|
|
1477
|
-
// src/layout/node-value-input.tsx
|
|
1478
|
-
var import_core7 = require("@mantine/core");
|
|
1479
|
-
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
1480
|
-
function NodeValueInput({ value, disabled, step, onChange }) {
|
|
1481
|
-
if (value === void 0 || value === null) {
|
|
1482
|
-
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_jsx_runtime10.Fragment, {});
|
|
1483
|
-
}
|
|
1484
|
-
switch (typeof value) {
|
|
1485
|
-
case "boolean": {
|
|
1486
|
-
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1487
|
-
import_core7.Switch,
|
|
1488
|
-
{
|
|
1489
|
-
checked: value,
|
|
1490
|
-
disabled,
|
|
1491
|
-
onChange: (e) => onChange(e.currentTarget.checked)
|
|
1492
|
-
}
|
|
1493
|
-
);
|
|
1494
|
-
}
|
|
1495
|
-
case "number": {
|
|
1496
|
-
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_core7.NumberInput, { value, disabled, step, onChange: (e) => onChange(e) });
|
|
1497
|
-
}
|
|
1498
|
-
case "string": {
|
|
1499
|
-
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1500
|
-
import_core7.Input,
|
|
1501
|
-
{
|
|
1502
|
-
value,
|
|
1503
|
-
disabled,
|
|
1504
|
-
onChange: (e) => onChange(e.currentTarget.value)
|
|
1505
|
-
}
|
|
1506
|
-
);
|
|
1507
|
-
}
|
|
1508
|
-
default:
|
|
1509
|
-
throw new Error(`Unknown input node for value of type: ${typeof value} (${value})`);
|
|
1510
|
-
}
|
|
1511
|
-
}
|
|
1512
|
-
var node_value_input_default = NodeValueInput;
|
|
1513
|
-
|
|
1514
|
-
// src/layout/node-property-input.tsx
|
|
1515
|
-
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
1516
|
-
|
|
1517
|
-
// src/layout/node-property-variables.tsx
|
|
1518
|
-
var import_hooks12 = require("@awesome-flow/core/hooks");
|
|
1519
|
-
var import_react17 = require("react");
|
|
1520
|
-
var import_core8 = require("@mantine/core");
|
|
1521
|
-
var import_utils = require("@awesome-flow/core/utils");
|
|
1522
|
-
var import_abstract3 = require("@awesome-flow/core/abstract");
|
|
1523
|
-
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1524
|
-
|
|
1525
|
-
// src/nodes/modifiers/variable-combine-node.tsx
|
|
1526
|
-
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1527
|
-
var options2 = {
|
|
1528
|
-
add: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_icons_react4.IconPlus, {}),
|
|
1529
|
-
divide: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_icons_react4.IconDivide, {}),
|
|
1530
|
-
min: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_icons_react4.IconChevronLeft, {}),
|
|
1531
|
-
max: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_icons_react4.IconChevronRight, {}),
|
|
1532
|
-
multiply: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_icons_react4.IconAsterisk, {}),
|
|
1533
|
-
power: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_icons_react4.IconChevronUp, {})
|
|
1534
|
-
};
|
|
1535
|
-
function VariableCombineNode({
|
|
1536
|
-
id,
|
|
1537
|
-
selected,
|
|
1538
|
-
data,
|
|
1539
|
-
type
|
|
1540
|
-
}) {
|
|
1541
|
-
const [operation, setOperation] = (0, import_react18.useState)(data.operation);
|
|
1542
|
-
const [value, setValue] = (0, import_react18.useState)(data.value);
|
|
1543
|
-
const updateNodeData = (0, import_hooks13.useUpdateNodeData)();
|
|
1544
|
-
const incoming = (0, import_hooks13.useIncomingNodeData)(id);
|
|
1545
|
-
(0, import_react18.useEffect)(() => {
|
|
1546
|
-
if (incoming?.length > 1) {
|
|
1547
|
-
const result = getOperationResult(operation, incoming[0].value, incoming[1].value);
|
|
1548
|
-
setValue(result);
|
|
1549
|
-
updateNodeData(id, { value: result });
|
|
1550
|
-
}
|
|
1551
|
-
}, [operation, incoming]);
|
|
1552
|
-
const onChange = (0, import_react18.useCallback)((op) => {
|
|
1553
|
-
updateNodeData(id, { operation: op });
|
|
1554
|
-
setOperation(op);
|
|
1555
|
-
}, []);
|
|
1556
|
-
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_layout10.NodeContainer, { id, selected, data, type, children: [
|
|
1557
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_layout10.NodeCombobox, { options: options2, selected: operation, onChange }),
|
|
1558
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(node_value_input_default, { value, onChange: () => {
|
|
1559
|
-
}, disabled: true }),
|
|
1560
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_layout10.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
1561
|
-
] });
|
|
1562
|
-
}
|
|
1563
|
-
function getOperationResult(operation, value1, value2) {
|
|
1564
|
-
switch (operation) {
|
|
1565
|
-
case "add" /* add */:
|
|
1566
|
-
return Number(value1) + Number(value2);
|
|
1567
|
-
case "divide" /* divide */:
|
|
1568
|
-
return Number(value1) / (Number(value2) || 1);
|
|
1569
|
-
case "max" /* max */:
|
|
1570
|
-
return Number(value1) > Number(value2) ? value1 : value2;
|
|
1571
|
-
case "min" /* min */:
|
|
1572
|
-
return Number(value1) < Number(value2) ? value1 : value2;
|
|
1573
|
-
case "multiply" /* multiply */:
|
|
1574
|
-
return Number(value1) * Number(value2);
|
|
1575
|
-
case "power" /* power */:
|
|
1576
|
-
return Number(value1) ** Number(value2);
|
|
1577
|
-
}
|
|
1578
|
-
}
|
|
1579
|
-
var variable_combine_node_default = VariableCombineNode;
|
|
1580
1479
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1581
1480
|
0 && (module.exports = {
|
|
1582
1481
|
NoiseAbsNode,
|
|
@@ -1587,7 +1486,6 @@ var variable_combine_node_default = VariableCombineNode;
|
|
|
1587
1486
|
NoiseInvertNode,
|
|
1588
1487
|
NoiseNormalizeNode,
|
|
1589
1488
|
NoiseScaleBiasNode,
|
|
1590
|
-
NoiseTerraceNode
|
|
1591
|
-
VariableCombineNode
|
|
1489
|
+
NoiseTerraceNode
|
|
1592
1490
|
});
|
|
1593
1491
|
//# sourceMappingURL=index.cjs.map
|