@awesome-flow/noise 0.1.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 +4234 -0
- package/dist/abstract/index.cjs.map +1 -0
- package/dist/abstract/index.d.cts +137 -0
- package/dist/abstract/index.d.ts +137 -0
- package/dist/abstract/index.js +4271 -0
- package/dist/abstract/index.js.map +1 -0
- package/dist/handle-types-D-v5S53h.d.cts +22 -0
- package/dist/handle-types-D-v5S53h.d.ts +22 -0
- package/dist/layout/index.cjs +164 -0
- package/dist/layout/index.cjs.map +1 -0
- package/dist/layout/index.d.cts +26 -0
- package/dist/layout/index.d.ts +26 -0
- package/dist/layout/index.js +136 -0
- package/dist/layout/index.js.map +1 -0
- package/dist/modules/index.cjs +71 -0
- package/dist/modules/index.cjs.map +1 -0
- package/dist/modules/index.d.cts +18 -0
- package/dist/modules/index.d.ts +18 -0
- package/dist/modules/index.js +34 -0
- package/dist/modules/index.js.map +1 -0
- package/dist/node-props-CeZ8Oshz.d.ts +161 -0
- package/dist/node-props-hKW-_KOU.d.cts +161 -0
- package/dist/nodes/generators/index.cjs +640 -0
- package/dist/nodes/generators/index.cjs.map +1 -0
- package/dist/nodes/generators/index.d.cts +38 -0
- package/dist/nodes/generators/index.d.ts +38 -0
- package/dist/nodes/generators/index.js +592 -0
- package/dist/nodes/generators/index.js.map +1 -0
- package/dist/nodes/groups/index.cjs +104 -0
- package/dist/nodes/groups/index.cjs.map +1 -0
- package/dist/nodes/groups/index.d.cts +7 -0
- package/dist/nodes/groups/index.d.ts +7 -0
- package/dist/nodes/groups/index.js +78 -0
- package/dist/nodes/groups/index.js.map +1 -0
- package/dist/nodes/index.cjs +2830 -0
- package/dist/nodes/index.cjs.map +1 -0
- package/dist/nodes/index.d.cts +16 -0
- package/dist/nodes/index.d.ts +16 -0
- package/dist/nodes/index.js +2840 -0
- package/dist/nodes/index.js.map +1 -0
- package/dist/nodes/modifiers/index.cjs +1593 -0
- package/dist/nodes/modifiers/index.cjs.map +1 -0
- package/dist/nodes/modifiers/index.d.cts +32 -0
- package/dist/nodes/modifiers/index.d.ts +32 -0
- package/dist/nodes/modifiers/index.js +1612 -0
- package/dist/nodes/modifiers/index.js.map +1 -0
- package/dist/nodes/output/index.cjs +210 -0
- package/dist/nodes/output/index.cjs.map +1 -0
- package/dist/nodes/output/index.d.cts +13 -0
- package/dist/nodes/output/index.d.ts +13 -0
- package/dist/nodes/output/index.js +181 -0
- package/dist/nodes/output/index.js.map +1 -0
- package/dist/nodes/selectors/index.cjs +136 -0
- package/dist/nodes/selectors/index.cjs.map +1 -0
- package/dist/nodes/selectors/index.d.cts +16 -0
- package/dist/nodes/selectors/index.d.ts +16 -0
- package/dist/nodes/selectors/index.js +113 -0
- package/dist/nodes/selectors/index.js.map +1 -0
- package/dist/nodes/transformers/index.cjs +477 -0
- package/dist/nodes/transformers/index.cjs.map +1 -0
- package/dist/nodes/transformers/index.d.cts +22 -0
- package/dist/nodes/transformers/index.d.ts +22 -0
- package/dist/nodes/transformers/index.js +459 -0
- package/dist/nodes/transformers/index.js.map +1 -0
- package/dist/properties-BxwtU6i9.d.cts +9 -0
- package/dist/properties-BxwtU6i9.d.ts +9 -0
- package/dist/templates/generators/index.cjs +1714 -0
- package/dist/templates/generators/index.cjs.map +1 -0
- package/dist/templates/generators/index.d.cts +89 -0
- package/dist/templates/generators/index.d.ts +89 -0
- package/dist/templates/generators/index.js +1723 -0
- package/dist/templates/generators/index.js.map +1 -0
- package/dist/templates/groups/index.cjs +1690 -0
- package/dist/templates/groups/index.cjs.map +1 -0
- package/dist/templates/groups/index.d.cts +11 -0
- package/dist/templates/groups/index.d.ts +11 -0
- package/dist/templates/groups/index.js +1711 -0
- package/dist/templates/groups/index.js.map +1 -0
- package/dist/templates/index.cjs +1758 -0
- package/dist/templates/index.cjs.map +1 -0
- package/dist/templates/index.d.cts +15 -0
- package/dist/templates/index.d.ts +15 -0
- package/dist/templates/index.js +1745 -0
- package/dist/templates/index.js.map +1 -0
- package/dist/templates/modifiers/index.cjs +1708 -0
- package/dist/templates/modifiers/index.cjs.map +1 -0
- package/dist/templates/modifiers/index.d.cts +71 -0
- package/dist/templates/modifiers/index.d.ts +71 -0
- package/dist/templates/modifiers/index.js +1720 -0
- package/dist/templates/modifiers/index.js.map +1 -0
- package/dist/templates/output/index.cjs +1696 -0
- package/dist/templates/output/index.cjs.map +1 -0
- package/dist/templates/output/index.d.cts +29 -0
- package/dist/templates/output/index.d.ts +29 -0
- package/dist/templates/output/index.js +1714 -0
- package/dist/templates/output/index.js.map +1 -0
- package/dist/templates/selectors/index.cjs +1692 -0
- package/dist/templates/selectors/index.cjs.map +1 -0
- package/dist/templates/selectors/index.d.cts +22 -0
- package/dist/templates/selectors/index.d.ts +22 -0
- package/dist/templates/selectors/index.js +1712 -0
- package/dist/templates/selectors/index.js.map +1 -0
- package/dist/templates/transformers/index.cjs +1698 -0
- package/dist/templates/transformers/index.cjs.map +1 -0
- package/dist/templates/transformers/index.d.cts +40 -0
- package/dist/templates/transformers/index.d.ts +40 -0
- package/dist/templates/transformers/index.js +1715 -0
- package/dist/templates/transformers/index.js.map +1 -0
- package/package.json +111 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../node_modules/fast-deep-equal/index.js","../../../src/nodes/modifiers/index.ts","../../../src/nodes/modifiers/noise-abs-node.tsx","../../../src/nodes/modifiers/noise-clamp-node.tsx","../../../src/nodes/modifiers/noise-combine-node.tsx","../../../src/abstract/operations.ts","../../../src/nodes/modifiers/noise-curve-node.tsx","../../../../../node_modules/@mantine/form/src/actions/actions.ts","../../../../../node_modules/@mantine/form/src/get-input-on-change/get-input-on-change.ts","../../../../../node_modules/@mantine/form/src/hooks/use-form-errors/filter-errors/filter-errors.ts","../../../../../node_modules/@mantine/form/src/hooks/use-form-errors/use-form-errors.ts","../../../../../node_modules/@mantine/form/src/lists/clear-list-state.ts","../../../../../node_modules/@mantine/form/src/lists/change-error-indices.ts","../../../../../node_modules/@mantine/form/src/lists/reorder-errors.ts","../../../../../node_modules/klona/full/index.mjs","../../../../../node_modules/@mantine/form/src/paths/get-splitted-path.ts","../../../../../node_modules/@mantine/form/src/paths/get-path.ts","../../../../../node_modules/@mantine/form/src/paths/set-path.ts","../../../../../node_modules/@mantine/form/src/paths/reorder-path.ts","../../../../../node_modules/@mantine/form/src/paths/insert-path.ts","../../../../../node_modules/@mantine/form/src/paths/remove-path.ts","../../../../../node_modules/@mantine/form/src/hooks/use-form-list/use-form-list.ts","../../../../../node_modules/@mantine/form/src/get-status/get-status.ts","../../../../../node_modules/@mantine/form/src/hooks/use-form-status/use-form-status.ts","../../../../../node_modules/@mantine/form/src/hooks/use-form-values/use-form-values.ts","../../../../../node_modules/@mantine/form/src/hooks/use-form-watch/use-form-watch.ts","../../../../../node_modules/@mantine/form/src/validate/validate-values.ts","../../../../../node_modules/@mantine/form/src/validate/validate-field-value.ts","../../../../../node_modules/@mantine/form/src/form-index.ts","../../../../../node_modules/@mantine/form/src/validate/should-validate-on-change.ts","../../../../../node_modules/@mantine/form/src/use-form.ts","../../../src/nodes/modifiers/noise-exponent-node.tsx","../../../src/nodes/modifiers/noise-invert-node.tsx","../../../src/nodes/modifiers/noise-normalize-node.tsx","../../../src/modules/normalize-noise-module.ts","../../../src/nodes/modifiers/noise-scale-bias-node.tsx","../../../src/nodes/modifiers/noise-terrace-node.tsx","../../../src/nodes/modifiers/variable-combine-node.tsx","../../../src/layout/node-value-input.tsx","../../../src/layout/node-property-input.tsx","../../../src/layout/node-property-variables.tsx"],"sourcesContent":["'use strict';\n\n// do not edit .js files directly - edit src/index.jst\n\n\n\nmodule.exports = function equal(a, b) {\n if (a === b) return true;\n\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n if (a.constructor !== b.constructor) return false;\n\n var length, i, keys;\n if (Array.isArray(a)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (!equal(a[i], b[i])) return false;\n return true;\n }\n\n\n\n if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;\n if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();\n if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();\n\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) return false;\n\n for (i = length; i-- !== 0;)\n if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;\n\n for (i = length; i-- !== 0;) {\n var key = keys[i];\n\n if (!equal(a[key], b[key])) return false;\n }\n\n return true;\n }\n\n // true if both NaN, false otherwise\n return a!==a && b!==b;\n};\n","export { default as NoiseAbsNode } from './noise-abs-node';\nexport { default as NoiseClampNode } from './noise-clamp-node';\nexport { default as NoiseCombineNode } from './noise-combine-node';\nexport { default as NoiseCurveNode } from './noise-curve-node';\nexport { default as NoiseExponentNode } from './noise-exponent-node';\nexport { default as NoiseInvertNode } from './noise-invert-node';\nexport { default as NoiseNormalizeNode } from './noise-normalize-node';\nexport { default as NoiseScaleBiasNode } from './noise-scale-bias-node';\nexport { default as NoiseTerraceNode } from './noise-terrace-node';\nexport { default as VariableCombineNode } from './variable-combine-node';\n","import { NodeContainer, NodeTrackConnections } from '@awesome-flow/core/layout';\nimport { Node, NodeProps } from '@xyflow/react';\nimport { useEffect } from 'react';\nimport { useIncomingComputedData, useUpdateNodeComputedData } from '@awesome-flow/core/hooks';\nimport { Abs } from 'libnoise-ts/module/modifier';\nimport { BasicNodeData } from '@awesome-flow/core/abstract';\nimport { ComputedModuleData } from '../../abstract/node-props';\n\nfunction NoiseAbsNode({ id, selected, data, type }: NodeProps<Node<BasicNodeData>>) {\n const incoming = useIncomingComputedData<ComputedModuleData>(id);\n const updateComputedData = useUpdateNodeComputedData<ComputedModuleData>();\n\n useEffect(() => {\n if (incoming?.length > 0) {\n const module = new Abs(incoming[0].module);\n updateComputedData(id, { module });\n }\n }, [incoming]);\n\n return (\n <NodeContainer id={id} selected={selected} data={data} type={type}>\n <NodeTrackConnections handles={data.handles} nodeId={id} type=\"target\" />\n </NodeContainer>\n );\n}\n\nexport default NoiseAbsNode;\n","import { NodeContainer, NodeTrackConnections } from '@awesome-flow/core/layout';\nimport { Node, NodeProps } from '@xyflow/react';\nimport { useEffect, useState } from 'react';\nimport { Group, NumberInput, Stack } from '@mantine/core';\nimport {\n useIncomingComputedData,\n useUpdateNodeComputedData,\n useUpdateNodeData,\n} from '@awesome-flow/core/hooks';\nimport { Clamp } from 'libnoise-ts/module/modifier';\nimport { ComputedModuleData, NodeClampNoiseData } from '../../abstract/node-props';\n\nfunction NoiseClampNode({ id, selected, data, type }: NodeProps<Node<NodeClampNoiseData>>) {\n const [lowerBound, setLowerBound] = useState(data.lowerBound);\n const [upperBound, setUpperBound] = useState(data.upperBound);\n\n const incoming = useIncomingComputedData<ComputedModuleData>(id);\n\n const updateNodeData = useUpdateNodeData<NodeClampNoiseData>();\n const updateComputedData = useUpdateNodeComputedData<ComputedModuleData>();\n\n useEffect(() => {\n if (incoming?.length) {\n const module = new Clamp(incoming[0].module, lowerBound, upperBound);\n updateComputedData(id, { module });\n }\n\n updateNodeData(id, { lowerBound, upperBound });\n }, [incoming, lowerBound, upperBound]);\n\n return (\n <NodeContainer id={id} selected={selected} data={data} type={type}>\n <Stack>\n <Group>\n <NumberInput\n size=\"xs\"\n w={100}\n value={lowerBound}\n onChange={(e) => setLowerBound(Number(e))}\n step={0.1}\n />\n <NumberInput\n size=\"xs\"\n w={100}\n value={upperBound}\n onChange={(e) => setUpperBound(Number(e))}\n step={0.1}\n />\n </Group>\n </Stack>\n <NodeTrackConnections handles={data.handles} nodeId={id} type=\"target\" />\n </NodeContainer>\n );\n}\n\nexport default NoiseClampNode;\n","import { NodeCombobox, NodeContainer, NodeTrackConnections } from '@awesome-flow/core/layout';\nimport { Node, NodeProps } from '@xyflow/react';\nimport { ReactNode, useCallback, useEffect } from 'react';\nimport {\n useIncomingComputedData,\n useUpdateNodeComputedData,\n useUpdateNodeData,\n} from '@awesome-flow/core/hooks';\nimport {\n IconAsterisk,\n IconChevronLeft,\n IconChevronRight,\n IconChevronUp,\n IconPlus,\n} from '@tabler/icons-react';\nimport { ComputedModuleData, NodeCombineNoiseData } from '../../abstract/node-props';\nimport { NoiseCombineType, noiseCombineModuleMap } from '../../abstract/operations';\n\nconst options: Record<NoiseCombineType, ReactNode | string> = {\n add: <IconPlus />,\n min: <IconChevronLeft />,\n max: <IconChevronRight />,\n multiply: <IconAsterisk />,\n power: <IconChevronUp />,\n};\n\nfunction NoiseCombineNode({ id, selected, data, type }: NodeProps<Node<NodeCombineNoiseData>>) {\n const updateNodeData = useUpdateNodeData<NodeCombineNoiseData>();\n const updateComputedData = useUpdateNodeComputedData<ComputedModuleData>();\n\n const incoming = useIncomingComputedData<ComputedModuleData>(id);\n\n useEffect(() => {\n const ModuleFactory = noiseCombineModuleMap[data.operation];\n\n if (incoming?.length > 1) {\n const module = new ModuleFactory(incoming[0].module, incoming[1].module);\n updateComputedData(id, { module });\n }\n }, [data.operation, incoming]);\n\n const onChange = useCallback((operation: NoiseCombineType) => {\n updateNodeData(id, { operation });\n }, []);\n\n return (\n <NodeContainer id={id} selected={selected} data={data} type={type}>\n <NodeCombobox options={options} selected={data.operation} onChange={onChange} />\n <NodeTrackConnections handles={data.handles} nodeId={id} type=\"target\" />\n </NodeContainer>\n );\n}\n\nexport default NoiseCombineNode;\n","import { Add, Max, Min, Multiply, Power } from 'libnoise-ts/module/combiner';\n\nexport enum NoiseCombineType {\n add = 'add',\n max = 'max',\n min = 'min',\n multiply = 'multiply',\n power = 'power',\n}\n\nexport enum VariableCombineType {\n add = 'add',\n divide = 'divide',\n max = 'max',\n min = 'min',\n multiply = 'multiply',\n power = 'power',\n}\n\nexport const noiseCombineModuleMap = {\n [NoiseCombineType.add]: Add,\n [NoiseCombineType.max]: Max,\n [NoiseCombineType.min]: Min,\n [NoiseCombineType.multiply]: Multiply,\n [NoiseCombineType.power]: Power,\n};\n","import { NodeContainer, NodeTrackConnections } from '@awesome-flow/core/layout';\nimport { Node, NodeProps } from '@xyflow/react';\nimport { ActionIcon, Button, Group, NumberInput, Space } from '@mantine/core';\nimport {\n useIncomingComputedData,\n useUpdateNodeComputedData,\n useUpdateNodeData,\n} from '@awesome-flow/core/hooks';\nimport { FORM_INDEX, useForm } from '@mantine/form';\nimport { useCallback, useEffect, useState } from 'react';\nimport { Curve } from 'libnoise-ts/module/modifier';\nimport { Tuple } from 'libnoise-ts/util';\nimport { IconX } from '@tabler/icons-react';\nimport { randomId } from '@mantine/hooks';\nimport { NodeState } from '@awesome-flow/core/abstract';\nimport { ComputedModuleData, ControlPoint, NodeCurveNoiseData } from '../../abstract/node-props';\n\nfunction NoiseCurveNode({ id, selected, data, type }: NodeProps<Node<NodeCurveNoiseData>>) {\n const incoming = useIncomingComputedData<ComputedModuleData>(id);\n\n const updateNodeData = useUpdateNodeData<NodeCurveNoiseData>();\n const updateComputedData = useUpdateNodeComputedData<ComputedModuleData>();\n\n const [values, setValues] = useState([]);\n\n const form = useForm<{ points: (ControlPoint & { key: string })[] }>({\n mode: 'uncontrolled',\n initialValues: {\n points: [],\n },\n validateInputOnChange: [`points.${FORM_INDEX}.input`],\n clearInputErrorOnChange: true,\n validate: {\n points: {\n input: (value, values) => {\n const counts: Record<number, number> = {};\n\n values.points.forEach((x) => {\n counts[x.input] = (counts[x.input] || 0) + 1;\n });\n\n return counts[value] > 1;\n },\n },\n },\n onValuesChange: useCallback((values) => {\n if (form.isValid()) {\n const points = values.points.map((v) => ({ input: v.input, output: v.output }));\n setValues(points);\n updateNodeData(id, { points });\n }\n\n form.validate();\n }, []),\n });\n\n useEffect(() => {\n const points = data.points?.length\n ? data.points.map((v) => ({ input: v.input, output: v.output, key: randomId() }))\n : [1, 2, 3, 4].map(() => ({ input: 0, output: 0, key: randomId() }));\n\n form.initialize({ points });\n }, []);\n\n useEffect(() => {\n if (incoming?.length && values?.length >= 4) {\n const module = new Curve(\n incoming[0].module,\n values.map((p) => new Tuple(p.input, p.output))\n );\n\n updateComputedData(id, { module });\n }\n }, [values, incoming]);\n\n const fields = form.getValues().points.map((item, index) => (\n <Group mt=\"xs\" key={item.key}>\n <NumberInput\n size=\"xs\"\n w={100}\n placeholder=\"Input Value\"\n key={form.key(`points.${index}.input`)}\n {...form.getInputProps(`points.${index}.input`)}\n step={0.1}\n />\n <NumberInput\n size=\"xs\"\n w={100}\n placeholder=\"Output Value\"\n key={form.key(`points.${index}.output`)}\n {...form.getInputProps(`points.${index}.output`)}\n step={0.1}\n />\n {data.state === NodeState.edit && values.length > 4 && (\n <ActionIcon\n color=\"red\"\n variant=\"outline\"\n size=\"sm\"\n onClick={() => form.removeListItem('points', index)}\n >\n <IconX size=\"1rem\" />\n </ActionIcon>\n )}\n </Group>\n ));\n\n return (\n <NodeContainer id={id} selected={selected} type={type} data={data}>\n {fields}\n {data.state === NodeState.edit && (\n <>\n <Space h={10} />\n <Button\n variant=\"outline\"\n size=\"xs\"\n fullWidth\n onClick={() => form.insertListItem('points', { input: 0, output: 0, key: randomId() })}\n >\n Add control point\n </Button>\n </>\n )}\n <NodeTrackConnections handles={data.handles} nodeId={id} type=\"target\" />\n </NodeContainer>\n );\n}\n\nexport default NoiseCurveNode;\n","import { useEffect, useLayoutEffect } from 'react';\nimport type {\n _TransformValues,\n ClearErrors,\n ClearFieldError,\n InsertListItem,\n RemoveListItem,\n ReorderListItem,\n Reset,\n ResetDirty,\n ResetStatus,\n SetErrors,\n SetFieldError,\n SetFieldValue,\n SetFormStatus,\n SetInitialValues,\n SetValues,\n UseFormReturnType,\n ValidateField,\n} from '../types';\n\nfunction dispatchEvent(type: string, detail?: any): any {\n window.dispatchEvent(new CustomEvent(type, { detail }));\n}\n\nfunction validateFormName(name: string) {\n if (!/^[0-9a-zA-Z-]+$/.test(name)) {\n throw new Error(\n `[@mantine/use-form] Form name \"${name}\" is invalid, it should contain only letters, numbers and dashes`\n );\n }\n}\n\nexport const useIsomorphicEffect = typeof window !== 'undefined' ? useLayoutEffect : useEffect;\n\nexport function createFormActions<FormValues extends Record<string, any> = Record<string, any>>(\n name: string\n) {\n validateFormName(name);\n\n const setFieldValue: SetFieldValue<FormValues> = (path, value) =>\n dispatchEvent(`mantine-form:${name}:set-field-value`, { path, value });\n\n const setValues: SetValues<FormValues> = (values) =>\n dispatchEvent(`mantine-form:${name}:set-values`, values);\n\n const setInitialValues: SetInitialValues<FormValues> = (values) =>\n dispatchEvent(`mantine-form:${name}:set-initial-values`, values);\n\n const setErrors: SetErrors = (errors) => dispatchEvent(`mantine-form:${name}:set-errors`, errors);\n\n const setFieldError: SetFieldError<FormValues> = (path, error) =>\n dispatchEvent(`mantine-form:${name}:set-field-error`, { path, error });\n\n const clearFieldError: ClearFieldError = (path) =>\n dispatchEvent(`mantine-form:${name}:clear-field-error`, path);\n\n const clearErrors: ClearErrors = () => dispatchEvent(`mantine-form:${name}:clear-errors`);\n\n const reset: Reset = () => dispatchEvent(`mantine-form:${name}:reset`);\n\n const validate: () => void = () => dispatchEvent(`mantine-form:${name}:validate`);\n\n const validateField: ValidateField<FormValues> = (path) =>\n dispatchEvent(`mantine-form:${name}:validate-field`, path);\n\n const reorderListItem: ReorderListItem<FormValues> = (path, payload) =>\n dispatchEvent(`mantine-form:${name}:reorder-list-item`, { path, payload });\n\n const removeListItem: RemoveListItem<FormValues> = (path, index) =>\n dispatchEvent(`mantine-form:${name}:remove-list-item`, { path, index });\n\n const insertListItem: InsertListItem<FormValues> = (path, item, index) =>\n dispatchEvent(`mantine-form:${name}:insert-list-item`, { path, index, item });\n\n const setDirty: SetFormStatus = (value) => dispatchEvent(`mantine-form:${name}:set-dirty`, value);\n\n const setTouched: SetFormStatus = (value) =>\n dispatchEvent(`mantine-form:${name}:set-touched`, value);\n\n const resetDirty: ResetDirty<FormValues> = (values) =>\n dispatchEvent(`mantine-form:${name}:reset-dirty`, values);\n\n const resetTouched: ResetStatus = () => dispatchEvent(`mantine-form:${name}:reset-touched`);\n\n return {\n setFieldValue,\n setValues,\n setInitialValues,\n setErrors,\n setFieldError,\n clearFieldError,\n clearErrors,\n reset,\n validate,\n validateField,\n reorderListItem,\n removeListItem,\n insertListItem,\n setDirty,\n setTouched,\n resetDirty,\n resetTouched,\n };\n}\n\nfunction useFormEvent(eventKey: string | undefined, handler: Function) {\n useIsomorphicEffect(() => {\n if (eventKey) {\n window.addEventListener(eventKey, handler as any);\n return () => window.removeEventListener(eventKey, handler as any);\n }\n return undefined;\n }, [eventKey]);\n}\n\nexport function useFormActions<\n Values = Record<string, unknown>,\n TransformValues extends _TransformValues<Values> = (values: Values) => Values,\n>(name: string | undefined, form: UseFormReturnType<Values, TransformValues>) {\n if (name) {\n validateFormName(name);\n }\n\n useFormEvent(`mantine-form:${name}:set-field-value`, (event: CustomEvent) =>\n form.setFieldValue(event.detail.path, event.detail.value)\n );\n\n useFormEvent(`mantine-form:${name}:set-values`, (event: CustomEvent) =>\n form.setValues(event.detail)\n );\n\n useFormEvent(`mantine-form:${name}:set-initial-values`, (event: CustomEvent) =>\n form.setInitialValues(event.detail)\n );\n\n useFormEvent(`mantine-form:${name}:set-errors`, (event: CustomEvent) =>\n form.setErrors(event.detail)\n );\n\n useFormEvent(`mantine-form:${name}:set-field-error`, (event: CustomEvent) =>\n form.setFieldError(event.detail.path, event.detail.error)\n );\n\n useFormEvent(`mantine-form:${name}:clear-field-error`, (event: CustomEvent) =>\n form.clearFieldError(event.detail)\n );\n\n useFormEvent(`mantine-form:${name}:clear-errors`, form.clearErrors);\n useFormEvent(`mantine-form:${name}:reset`, form.reset);\n useFormEvent(`mantine-form:${name}:validate`, form.validate);\n\n useFormEvent(`mantine-form:${name}:validate-field`, (event: CustomEvent) =>\n form.validateField(event.detail)\n );\n\n useFormEvent(`mantine-form:${name}:reorder-list-item`, (event: CustomEvent) =>\n form.reorderListItem(event.detail.path, event.detail.payload)\n );\n\n useFormEvent(`mantine-form:${name}:remove-list-item`, (event: CustomEvent) =>\n form.removeListItem(event.detail.path, event.detail.index)\n );\n\n useFormEvent(`mantine-form:${name}:insert-list-item`, (event: CustomEvent) =>\n form.insertListItem(event.detail.path, event.detail.item, event.detail.index)\n );\n\n useFormEvent(`mantine-form:${name}:set-dirty`, (event: CustomEvent) =>\n form.setDirty(event.detail)\n );\n\n useFormEvent(`mantine-form:${name}:set-touched`, (event: CustomEvent) =>\n form.setTouched(event.detail)\n );\n\n useFormEvent(`mantine-form:${name}:reset-dirty`, (event: CustomEvent) =>\n form.resetDirty(event.detail)\n );\n\n useFormEvent(`mantine-form:${name}:reset-touched`, form.resetTouched);\n}\n","export function getInputOnChange<Value>(\n setValue: (value: Value | ((current: Value) => Value)) => void\n) {\n return (val: Value | React.ChangeEvent<unknown> | ((current: Value) => Value)) => {\n if (!val) {\n setValue(val as Value);\n } else if (typeof val === 'function') {\n setValue(val);\n } else if (typeof val === 'object' && 'nativeEvent' in val) {\n const { currentTarget } = val;\n if (currentTarget instanceof HTMLInputElement) {\n if (currentTarget.type === 'checkbox') {\n setValue(currentTarget.checked as any);\n } else {\n setValue(currentTarget.value as any);\n }\n } else if (\n currentTarget instanceof HTMLTextAreaElement ||\n currentTarget instanceof HTMLSelectElement\n ) {\n setValue(currentTarget.value as any);\n }\n } else {\n setValue(val);\n }\n };\n}\n","import type { FormErrors } from '../../../types';\n\nexport function filterErrors(errors: FormErrors): FormErrors {\n if (errors === null || typeof errors !== 'object') {\n return {};\n }\n\n return Object.keys(errors).reduce<FormErrors>((acc, key) => {\n const errorValue = errors[key];\n\n if (errorValue !== undefined && errorValue !== null && errorValue !== false) {\n acc[key] = errorValue;\n }\n\n return acc;\n }, {});\n}\n","import { useCallback, useState } from 'react';\nimport { ClearErrors, ClearFieldError, FormErrors, SetErrors, SetFieldError } from '../../types';\nimport { filterErrors } from './filter-errors/filter-errors';\n\nexport interface $FormErrors<Values extends Record<string, any>> {\n errorsState: FormErrors;\n setErrors: SetErrors;\n clearErrors: ClearErrors;\n setFieldError: SetFieldError<Values>;\n clearFieldError: ClearFieldError;\n}\n\nexport function useFormErrors<Values extends Record<string, any>>(\n initialErrors: FormErrors\n): $FormErrors<Values> {\n const [errorsState, setErrorsState] = useState(filterErrors(initialErrors));\n\n const setErrors: SetErrors = useCallback((errors) => {\n setErrorsState((current) =>\n filterErrors(typeof errors === 'function' ? errors(current) : errors)\n );\n }, []);\n\n const clearErrors: ClearErrors = useCallback(() => setErrorsState({}), []);\n\n const clearFieldError: ClearFieldError = useCallback(\n (path) => {\n if (errorsState[path as string] === undefined) {\n return;\n }\n\n setErrors((current) => {\n const errors = { ...current };\n delete errors[path as string];\n return errors;\n });\n },\n [errorsState]\n );\n\n const setFieldError: SetFieldError<Values> = useCallback(\n (path, error) => {\n if (error == null || error === false) {\n clearFieldError(path);\n } else if (errorsState[path as string] !== error) {\n setErrors((current) => ({ ...current, [path]: error }));\n }\n },\n [errorsState]\n );\n\n return {\n errorsState,\n setErrors,\n clearErrors,\n setFieldError,\n clearFieldError,\n };\n}\n","export function clearListState<T extends Record<PropertyKey, any>>(\n field: PropertyKey,\n state: T\n): T {\n if (state === null || typeof state !== 'object') {\n return {} as T;\n }\n\n const clone = { ...state };\n Object.keys(state).forEach((errorKey) => {\n if (errorKey.includes(`${String(field)}.`)) {\n delete clone[errorKey];\n }\n });\n\n return clone;\n}\n","import { clearListState } from './clear-list-state';\n\n/**\n * Gets the part of the key after the path which can be an index\n */\nfunction getIndexFromKeyAfterPath(key: string, path: string): number {\n const split = key.substring(path.length + 1).split('.')[0];\n return parseInt(split, 10);\n}\n\n/**\n * Changes the indices of every error that is after the given `index` with the given `change` at the given `path`.\n * This requires that the errors are in the format of `path.index` and that the index is a number.\n */\nexport function changeErrorIndices<T extends Record<PropertyKey, any>>(\n path: PropertyKey,\n index: number | undefined,\n errors: T,\n change: 1 | -1\n): T {\n if (index === undefined) {\n return errors;\n }\n const pathString = `${String(path)}`;\n let clearedErrors = errors;\n // Remove all errors if the corresponding item was removed\n if (change === -1) {\n clearedErrors = clearListState(`${pathString}.${index}`, clearedErrors);\n }\n\n const cloned = { ...clearedErrors };\n const changedKeys = new Set<string>();\n Object.entries(clearedErrors)\n .filter(([key]) => {\n if (!key.startsWith(`${pathString}.`)) {\n return false;\n }\n const currIndex = getIndexFromKeyAfterPath(key, pathString);\n if (Number.isNaN(currIndex)) {\n return false;\n }\n return currIndex >= index;\n })\n .forEach(([key, value]) => {\n const currIndex = getIndexFromKeyAfterPath(key, pathString);\n\n const newKey: keyof T = key.replace(\n `${pathString}.${currIndex}`,\n `${pathString}.${currIndex + change}`\n );\n cloned[newKey] = value;\n changedKeys.add(newKey);\n if (!changedKeys.has(key)) {\n delete cloned[key];\n }\n });\n\n return cloned;\n}\n","import { ReorderPayload } from '../types';\n\nexport function reorderErrors<T>(path: unknown, { from, to }: ReorderPayload, errors: T): T {\n const oldKeyStart = `${path}.${from}`;\n const newKeyStart = `${path}.${to}`;\n\n const clone: any = { ...errors };\n Object.keys(errors as any).every((key) => {\n let oldKey;\n let newKey;\n if (key.startsWith(oldKeyStart)) {\n oldKey = key;\n newKey = key.replace(oldKeyStart, newKeyStart);\n }\n if (key.startsWith(newKeyStart)) {\n oldKey = key.replace(newKeyStart, oldKeyStart);\n newKey = key;\n }\n if (oldKey && newKey) {\n const value1 = clone[oldKey];\n const value2 = clone[newKey];\n value2 === undefined ? delete clone[oldKey] : (clone[oldKey] = value2);\n value1 === undefined ? delete clone[newKey] : (clone[newKey] = value1);\n return false;\n }\n return true;\n });\n\n return clone;\n}\n","function set(obj, key, val) {\n\tif (typeof val.value === 'object') val.value = klona(val.value);\n\tif (!val.enumerable || val.get || val.set || !val.configurable || !val.writable || key === '__proto__') {\n\t\tObject.defineProperty(obj, key, val);\n\t} else obj[key] = val.value;\n}\n\nexport function klona(x) {\n\tif (typeof x !== 'object') return x;\n\n\tvar i=0, k, list, tmp, str=Object.prototype.toString.call(x);\n\n\tif (str === '[object Object]') {\n\t\ttmp = Object.create(x.__proto__ || null);\n\t} else if (str === '[object Array]') {\n\t\ttmp = Array(x.length);\n\t} else if (str === '[object Set]') {\n\t\ttmp = new Set;\n\t\tx.forEach(function (val) {\n\t\t\ttmp.add(klona(val));\n\t\t});\n\t} else if (str === '[object Map]') {\n\t\ttmp = new Map;\n\t\tx.forEach(function (val, key) {\n\t\t\ttmp.set(klona(key), klona(val));\n\t\t});\n\t} else if (str === '[object Date]') {\n\t\ttmp = new Date(+x);\n\t} else if (str === '[object RegExp]') {\n\t\ttmp = new RegExp(x.source, x.flags);\n\t} else if (str === '[object DataView]') {\n\t\ttmp = new x.constructor( klona(x.buffer) );\n\t} else if (str === '[object ArrayBuffer]') {\n\t\ttmp = x.slice(0);\n\t} else if (str.slice(-6) === 'Array]') {\n\t\t// ArrayBuffer.isView(x)\n\t\t// ~> `new` bcuz `Buffer.slice` => ref\n\t\ttmp = new x.constructor(x);\n\t}\n\n\tif (tmp) {\n\t\tfor (list=Object.getOwnPropertySymbols(x); i < list.length; i++) {\n\t\t\tset(tmp, list[i], Object.getOwnPropertyDescriptor(x, list[i]));\n\t\t}\n\n\t\tfor (i=0, list=Object.getOwnPropertyNames(x); i < list.length; i++) {\n\t\t\tif (Object.hasOwnProperty.call(tmp, k=list[i]) && tmp[k] === x[k]) continue;\n\t\t\tset(tmp, k, Object.getOwnPropertyDescriptor(x, k));\n\t\t}\n\t}\n\n\treturn tmp || x;\n}\n","export function getSplittedPath(path: unknown) {\n if (typeof path !== 'string') {\n return [];\n }\n\n return path.split('.');\n}\n","import { getSplittedPath } from './get-splitted-path';\n\nexport function getPath(path: unknown, values: unknown): unknown {\n const splittedPath = getSplittedPath(path);\n\n if (splittedPath.length === 0 || typeof values !== 'object' || values === null) {\n return undefined;\n }\n\n let value = values[splittedPath[0] as keyof typeof values];\n for (let i = 1; i < splittedPath.length; i += 1) {\n if (value === undefined) {\n break;\n }\n\n value = value[splittedPath[i]];\n }\n\n return value;\n}\n","import { klona } from 'klona/full';\nimport { getSplittedPath } from './get-splitted-path';\n\nexport function setPath<T>(path: unknown, value: unknown, values: T): T {\n const splittedPath = getSplittedPath(path);\n\n if (splittedPath.length === 0) {\n return values;\n }\n\n const cloned: any = klona(values);\n\n if (splittedPath.length === 1) {\n cloned[splittedPath[0]] = value;\n return cloned;\n }\n\n let val = cloned[splittedPath[0]];\n\n for (let i = 1; i < splittedPath.length - 1; i += 1) {\n if (val === undefined) {\n return cloned;\n }\n\n val = val[splittedPath[i]];\n }\n\n val[splittedPath[splittedPath.length - 1]] = value;\n\n return cloned;\n}\n","import { ReorderPayload } from '../types';\nimport { getPath } from './get-path';\nimport { setPath } from './set-path';\n\nexport function reorderPath<T>(path: unknown, { from, to }: ReorderPayload, values: T) {\n const currentValue = getPath(path, values);\n\n if (!Array.isArray(currentValue)) {\n return values;\n }\n\n const cloned = [...currentValue];\n const item = currentValue[from];\n cloned.splice(from, 1);\n cloned.splice(to, 0, item);\n\n return setPath(path, cloned, values);\n}\n","import { getPath } from './get-path';\nimport { setPath } from './set-path';\n\nexport function insertPath<T>(path: unknown, value: unknown, index: number | undefined, values: T) {\n const currentValue = getPath(path, values);\n\n if (!Array.isArray(currentValue)) {\n return values;\n }\n\n const cloned = [...currentValue];\n cloned.splice(typeof index === 'number' ? index : cloned.length, 0, value);\n\n return setPath(path, cloned, values);\n}\n","import { getPath } from './get-path';\nimport { setPath } from './set-path';\n\nexport function removePath<T>(path: unknown, index: number, values: T) {\n const currentValue = getPath(path, values);\n\n if (!Array.isArray(currentValue)) {\n return values;\n }\n\n return setPath(\n path,\n currentValue.filter((_, itemIndex) => itemIndex !== index),\n values\n );\n}\n","import { useCallback } from 'react';\nimport { changeErrorIndices, reorderErrors } from '../../lists';\nimport { insertPath, removePath, reorderPath } from '../../paths';\nimport { InsertListItem, RemoveListItem, ReorderListItem } from '../../types';\nimport type { $FormErrors } from '../use-form-errors/use-form-errors';\nimport type { $FormStatus } from '../use-form-status/use-form-status';\nimport type { $FormValues } from '../use-form-values/use-form-values';\n\ninterface UseFormListInput<Values extends Record<string, any>> {\n $values: $FormValues<Values>;\n $errors: $FormErrors<Values>;\n $status: $FormStatus<Values>;\n}\n\nexport function useFormList<Values extends Record<string, any>>({\n $values,\n $errors,\n $status,\n}: UseFormListInput<Values>) {\n const reorderListItem: ReorderListItem<Values> = useCallback((path, payload) => {\n $status.clearFieldDirty(path);\n $errors.setErrors((errs) => reorderErrors(path, payload, errs));\n $values.setValues({\n values: reorderPath(path, payload, $values.refValues.current),\n updateState: true,\n });\n }, []);\n\n const removeListItem: RemoveListItem<Values> = useCallback((path, index) => {\n $status.clearFieldDirty(path);\n $errors.setErrors((errs) => changeErrorIndices(path, index, errs, -1));\n $values.setValues({\n values: removePath(path, index, $values.refValues.current),\n updateState: true,\n });\n }, []);\n\n const insertListItem: InsertListItem<Values> = useCallback((path, item, index) => {\n $status.clearFieldDirty(path);\n $errors.setErrors((errs) => changeErrorIndices(path, index, errs, 1));\n $values.setValues({\n values: insertPath(path, item, index, $values.refValues.current),\n updateState: true,\n });\n }, []);\n\n return { reorderListItem, removeListItem, insertListItem };\n}\n","import { FormStatus } from '../types';\n\nexport function getStatus(status: FormStatus, path?: unknown) {\n const paths = Object.keys(status);\n\n if (typeof path === 'string') {\n const nestedPaths = paths.filter((statusPath) => statusPath.startsWith(`${path}.`));\n return status[path] || nestedPaths.some((statusPath) => status[statusPath]) || false;\n }\n\n return paths.some((statusPath) => status[statusPath]);\n}\n","import { useCallback, useRef, useState } from 'react';\nimport isEqual from 'fast-deep-equal';\nimport { getStatus } from '../../get-status';\nimport { clearListState } from '../../lists';\nimport { getPath } from '../../paths';\nimport {\n ClearFieldDirty,\n FormMode,\n FormStatus,\n GetFieldStatus,\n ResetDirty,\n ResetStatus,\n SetFieldDirty,\n SetFieldTouched,\n} from '../../types';\nimport type { $FormValues } from '../use-form-values/use-form-values';\n\nexport interface $FormStatus<Values extends Record<string, any>> {\n touchedState: FormStatus;\n dirtyState: FormStatus;\n touchedRef: React.MutableRefObject<FormStatus>;\n dirtyRef: React.MutableRefObject<FormStatus>;\n setTouched: React.Dispatch<React.SetStateAction<FormStatus>>;\n setDirty: React.Dispatch<React.SetStateAction<FormStatus>>;\n resetDirty: ResetStatus;\n resetTouched: ResetStatus;\n isTouched: GetFieldStatus<Values>;\n setFieldTouched: SetFieldTouched<Values>;\n setFieldDirty: SetFieldDirty<Values>;\n setTouchedState: React.Dispatch<React.SetStateAction<FormStatus>>;\n setDirtyState: React.Dispatch<React.SetStateAction<FormStatus>>;\n clearFieldDirty: ClearFieldDirty;\n isDirty: GetFieldStatus<Values>;\n getDirty: () => FormStatus;\n getTouched: () => FormStatus;\n}\n\ninterface UseFormStatusInput<Values extends Record<string, any>> {\n initialDirty: FormStatus;\n initialTouched: FormStatus;\n mode: FormMode;\n $values: $FormValues<Values>;\n}\n\nexport function useFormStatus<Values extends Record<string, any>>({\n initialDirty,\n initialTouched,\n mode,\n $values,\n}: UseFormStatusInput<Values>): $FormStatus<Values> {\n const [touchedState, setTouchedState] = useState(initialTouched);\n const [dirtyState, setDirtyState] = useState(initialDirty);\n\n const touchedRef = useRef(initialTouched);\n const dirtyRef = useRef(initialDirty);\n\n const setTouched = useCallback((values: FormStatus | ((current: FormStatus) => FormStatus)) => {\n const resolvedValues = typeof values === 'function' ? values(touchedRef.current) : values;\n touchedRef.current = resolvedValues;\n\n if (mode === 'controlled') {\n setTouchedState(resolvedValues);\n }\n }, []);\n\n const setDirty = useCallback((values: FormStatus | ((current: FormStatus) => FormStatus)) => {\n const resolvedValues = typeof values === 'function' ? values(dirtyRef.current) : values;\n dirtyRef.current = resolvedValues;\n\n if (mode === 'controlled') {\n setDirtyState(resolvedValues);\n }\n }, []);\n\n const resetTouched: ResetStatus = useCallback(() => setTouched({}), []);\n\n const resetDirty: ResetDirty<Values> = (values) => {\n const newSnapshot = values\n ? { ...values, ...$values.refValues.current }\n : $values.refValues.current;\n $values.setValuesSnapshot(newSnapshot);\n setDirty({});\n };\n\n const setFieldTouched: SetFieldTouched<Values> = useCallback((path, touched) => {\n setTouched((currentTouched) => {\n if (getStatus(currentTouched, path) === touched) {\n return currentTouched;\n }\n\n return { ...currentTouched, [path]: touched };\n });\n }, []);\n\n const setFieldDirty: SetFieldDirty<Values> = useCallback((path, dirty) => {\n setDirty((currentDirty) => {\n if (getStatus(currentDirty, path) === dirty) {\n return currentDirty;\n }\n\n return { ...currentDirty, [path]: dirty };\n });\n }, []);\n\n const isTouched: GetFieldStatus<Values> = useCallback(\n (path) => getStatus(touchedRef.current, path),\n []\n );\n\n const clearFieldDirty: ClearFieldDirty = useCallback(\n (path) =>\n setDirty((current) => {\n if (typeof path !== 'string') {\n return current;\n }\n\n const result = clearListState(path, current);\n delete result[path];\n\n if (isEqual(result, current)) {\n return current;\n }\n\n return result;\n }),\n []\n );\n\n const isDirty: GetFieldStatus<Values> = useCallback((path) => {\n if (path) {\n const overriddenValue = getPath(path, dirtyRef.current);\n if (typeof overriddenValue === 'boolean') {\n return overriddenValue;\n }\n\n const sliceOfValues = getPath(path, $values.refValues.current);\n const sliceOfInitialValues = getPath(path, $values.valuesSnapshot.current);\n return !isEqual(sliceOfValues, sliceOfInitialValues);\n }\n\n const isOverridden = Object.keys(dirtyRef.current).length > 0;\n if (isOverridden) {\n return getStatus(dirtyRef.current);\n }\n\n return !isEqual($values.refValues.current, $values.valuesSnapshot.current);\n }, []);\n\n const getDirty = useCallback(() => dirtyRef.current, []);\n const getTouched = useCallback(() => touchedRef.current, []);\n\n return {\n touchedState,\n dirtyState,\n touchedRef,\n dirtyRef,\n setTouched,\n setDirty,\n resetDirty,\n resetTouched,\n isTouched,\n setFieldTouched,\n setFieldDirty,\n setTouchedState,\n setDirtyState,\n clearFieldDirty,\n isDirty,\n getDirty,\n getTouched,\n };\n}\n","import { useCallback, useRef, useState } from 'react';\nimport { getPath, setPath } from '../../paths';\nimport { FormMode } from '../../types';\n\nexport interface $FormValues<Values extends Record<PropertyKey, any>> {\n initialized: React.MutableRefObject<boolean>;\n stateValues: Values;\n refValues: React.MutableRefObject<Values>;\n valuesSnapshot: React.MutableRefObject<Values>;\n setValues: (payload: SetValuesInput<Values>) => void;\n setFieldValue: (payload: SetFieldValueInput<Values>) => void;\n resetValues: () => void;\n setValuesSnapshot: (payload: Values) => void;\n initialize: (values: Values, onInitialize: () => void) => void;\n getValues: () => Values;\n}\n\nexport interface SetValuesSubscriberPayload<Values> {\n path?: PropertyKey;\n updatedValues: Values;\n previousValues: Values;\n}\n\nexport interface SetValuesInput<Values> {\n values: Partial<Values> | ((values: Values) => Partial<Values>);\n mergeWithPreviousValues?: boolean;\n updateState?: boolean;\n subscribers?: (SetFieldValueSubscriber<Values> | null | undefined)[];\n}\n\nexport type SetFieldValueSubscriber<Values> = (payload: SetValuesSubscriberPayload<Values>) => void;\n\nexport interface SetFieldValueInput<Values> {\n path: PropertyKey;\n value: any;\n updateState?: boolean;\n subscribers?: (SetFieldValueSubscriber<Values> | null | undefined)[];\n}\n\ninterface UseFormValuesInput<Values extends Record<PropertyKey, any>> {\n initialValues: Values | undefined;\n mode: FormMode;\n onValuesChange?: ((values: Values, previousValues: Values) => void) | undefined;\n}\n\nexport function useFormValues<Values extends Record<PropertyKey, any>>({\n initialValues,\n onValuesChange,\n mode,\n}: UseFormValuesInput<Values>): $FormValues<Values> {\n const initialized = useRef(false);\n const [stateValues, setStateValues] = useState<Values>(initialValues || ({} as Values));\n const refValues = useRef(stateValues);\n const valuesSnapshot = useRef(stateValues);\n\n const setValues = useCallback(\n ({\n values,\n subscribers,\n updateState = true,\n mergeWithPreviousValues = true,\n }: SetValuesInput<Values>) => {\n const previousValues = refValues.current;\n const resolvedValues = values instanceof Function ? values(refValues.current) : values;\n const updatedValues = mergeWithPreviousValues\n ? { ...previousValues, ...resolvedValues }\n : (resolvedValues as Values);\n refValues.current = updatedValues;\n updateState && setStateValues(updatedValues);\n onValuesChange?.(updatedValues, previousValues);\n subscribers\n ?.filter(Boolean)\n .forEach((subscriber) => subscriber!({ updatedValues, previousValues }));\n },\n [onValuesChange]\n );\n\n const setFieldValue = useCallback((payload: SetFieldValueInput<Values>) => {\n const currentValue = getPath(payload.path, refValues.current);\n const updatedValue =\n payload.value instanceof Function ? payload.value(currentValue) : payload.value;\n\n if (currentValue !== updatedValue) {\n const previousValues = refValues.current;\n const updatedValues = setPath(payload.path, updatedValue, refValues.current);\n setValues({ values: updatedValues, updateState: payload.updateState });\n\n payload.subscribers\n ?.filter(Boolean)\n .forEach((subscriber) =>\n subscriber!({ path: payload.path, updatedValues, previousValues })\n );\n }\n }, []);\n\n const setValuesSnapshot = useCallback((payload: Values) => {\n valuesSnapshot.current = payload;\n }, []);\n\n const initialize = useCallback((values: Values, onInitialize: () => void) => {\n if (!initialized.current) {\n initialized.current = true;\n setValues({ values, updateState: mode === 'controlled' });\n setValuesSnapshot(values);\n onInitialize();\n }\n }, []);\n\n const resetValues = useCallback(() => {\n setValues({\n values: valuesSnapshot.current,\n updateState: true,\n mergeWithPreviousValues: false,\n });\n }, []);\n\n const getValues = useCallback(() => refValues.current, []);\n\n return {\n initialized,\n stateValues,\n refValues,\n valuesSnapshot,\n setValues,\n setFieldValue,\n resetValues,\n setValuesSnapshot,\n initialize,\n getValues,\n };\n}\n","import { useCallback, useEffect, useRef } from 'react';\nimport { getPath } from '../../paths';\nimport { FormFieldSubscriber, LooseKeys, Watch } from '../../types';\nimport { $FormStatus } from '../use-form-status/use-form-status';\nimport { SetValuesSubscriberPayload } from '../use-form-values/use-form-values';\n\ninterface UseFormWatchInput<Values extends Record<string, any>> {\n $status: $FormStatus<Values>;\n}\n\nexport function useFormWatch<Values extends Record<string, any>>({\n $status,\n}: UseFormWatchInput<Values>) {\n const subscribers = useRef<Record<LooseKeys<Values>, FormFieldSubscriber<Values, any>[]>>(\n {} as any\n );\n\n const watch: Watch<Values> = useCallback((path, callback) => {\n useEffect(() => {\n subscribers.current[path] = subscribers.current[path] || [];\n subscribers.current[path].push(callback);\n\n return () => {\n subscribers.current[path] = subscribers.current[path].filter((cb) => cb !== callback);\n };\n }, [callback]);\n }, []);\n\n const getFieldSubscribers = useCallback((path: LooseKeys<Values>) => {\n if (!subscribers.current[path]) {\n return [];\n }\n\n return subscribers.current[path].map(\n (callback) => (input: SetValuesSubscriberPayload<Values>) =>\n callback({\n previousValue: getPath(path, input.previousValues) as any,\n value: getPath(path, input.updatedValues) as any,\n touched: $status.isTouched(path),\n dirty: $status.isDirty(path),\n })\n );\n }, []);\n\n return {\n subscribers,\n watch,\n getFieldSubscribers,\n };\n}\n","import { filterErrors } from '../hooks/use-form-errors/filter-errors/filter-errors';\nimport { getPath } from '../paths';\nimport { FormErrors, FormRule, FormRulesRecord, FormValidateInput } from '../types';\n\nfunction getValidationResults(errors: FormErrors) {\n const filteredErrors = filterErrors(errors);\n return { hasErrors: Object.keys(filteredErrors).length > 0, errors: filteredErrors };\n}\n\nfunction validateRulesRecord<T>(\n rules: FormRulesRecord<T> | undefined,\n values: T,\n path = '',\n errors: FormErrors = {}\n) {\n if (typeof rules !== 'object' || rules === null) {\n return errors;\n }\n\n return Object.keys(rules).reduce((acc, ruleKey) => {\n const rule: FormRule<any, any> = (rules as any)[ruleKey];\n const rulePath = `${path === '' ? '' : `${path}.`}${ruleKey}`;\n const value = getPath(rulePath, values);\n let arrayValidation = false;\n\n if (typeof rule === 'function') {\n acc[rulePath] = rule(value, values, rulePath);\n }\n\n if (typeof rule === 'object' && Array.isArray(value)) {\n arrayValidation = true;\n value.forEach((_item, index) =>\n validateRulesRecord(rule, values, `${rulePath}.${index}`, acc)\n );\n }\n\n if (typeof rule === 'object' && typeof value === 'object' && value !== null) {\n if (!arrayValidation) {\n validateRulesRecord(rule, values, rulePath, acc);\n }\n }\n\n return acc;\n }, errors);\n}\n\nexport function validateValues<T>(validate: FormValidateInput<T> | undefined, values: T) {\n if (typeof validate === 'function') {\n return getValidationResults(validate(values));\n }\n\n return getValidationResults(validateRulesRecord(validate, values));\n}\n","import { FormFieldValidationResult, FormValidateInput } from '../types';\nimport { validateValues } from './validate-values';\n\nexport function validateFieldValue<T>(\n path: unknown,\n rules: FormValidateInput<T> | undefined,\n values: T\n): FormFieldValidationResult {\n if (typeof path !== 'string') {\n return { hasError: false, error: null };\n }\n\n const results = validateValues(rules, values);\n const pathInError = Object.keys(results.errors).find((errorKey) =>\n path.split('.').every((pathPart, i) => pathPart === errorKey.split('.')[i])\n );\n return { hasError: !!pathInError, error: pathInError ? results.errors[pathInError] : null };\n}\n","export const FORM_INDEX = '__MANTINE_FORM_INDEX__';\n","import { FORM_INDEX } from '../form-index';\n\nexport function shouldValidateOnChange(path: unknown, validateInputOnChange: boolean | unknown[]) {\n if (!validateInputOnChange) {\n return false;\n }\n\n if (typeof validateInputOnChange === 'boolean') {\n return validateInputOnChange;\n }\n\n if (Array.isArray(validateInputOnChange)) {\n return validateInputOnChange.includes((path as string).replace(/[.][0-9]/g, `.${FORM_INDEX}`));\n }\n\n return false;\n}\n","import { useCallback, useState } from 'react';\nimport { useFormActions } from './actions';\nimport { getInputOnChange } from './get-input-on-change';\nimport { useFormErrors } from './hooks/use-form-errors/use-form-errors';\nimport { useFormList } from './hooks/use-form-list/use-form-list';\nimport { useFormStatus } from './hooks/use-form-status/use-form-status';\nimport { useFormValues } from './hooks/use-form-values/use-form-values';\nimport { useFormWatch } from './hooks/use-form-watch/use-form-watch';\nimport { getPath } from './paths';\nimport {\n _TransformValues,\n GetInputProps,\n GetTransformedValues,\n Initialize,\n IsValid,\n Key,\n OnReset,\n OnSubmit,\n Reset,\n SetFieldValue,\n SetValues,\n UseFormInput,\n UseFormReturnType,\n Validate,\n ValidateField,\n} from './types';\nimport { shouldValidateOnChange, validateFieldValue, validateValues } from './validate';\n\nexport function useForm<\n Values extends Record<string, any> = Record<string, any>,\n TransformValues extends _TransformValues<Values> = (values: Values) => Values,\n>({\n name,\n mode = 'controlled',\n initialValues,\n initialErrors = {},\n initialDirty = {},\n initialTouched = {},\n clearInputErrorOnChange = true,\n validateInputOnChange = false,\n validateInputOnBlur = false,\n onValuesChange,\n transformValues = ((values: Values) => values) as any,\n enhanceGetInputProps,\n validate: rules,\n}: UseFormInput<Values, TransformValues> = {}): UseFormReturnType<Values, TransformValues> {\n const $errors = useFormErrors<Values>(initialErrors);\n const $values = useFormValues<Values>({ initialValues, onValuesChange, mode });\n const $status = useFormStatus<Values>({ initialDirty, initialTouched, $values, mode });\n const $list = useFormList<Values>({ $values, $errors, $status });\n const $watch = useFormWatch<Values>({ $status });\n const [formKey, setFormKey] = useState(0);\n const [fieldKeys, setFieldKeys] = useState<Record<string, number>>({});\n\n const reset: Reset = useCallback(() => {\n $values.resetValues();\n $errors.clearErrors();\n $status.resetDirty();\n $status.resetTouched();\n mode === 'uncontrolled' && setFormKey((key) => key + 1);\n }, []);\n\n const initialize: Initialize<Values> = useCallback((values) => {\n $values.initialize(values, () => mode === 'uncontrolled' && setFormKey((key) => key + 1));\n }, []);\n\n const setFieldValue: SetFieldValue<Values> = useCallback(\n (path, value, options) => {\n const shouldValidate = shouldValidateOnChange(path, validateInputOnChange);\n\n $status.clearFieldDirty(path);\n $status.setFieldTouched(path, true);\n !shouldValidate && clearInputErrorOnChange && $errors.clearFieldError(path);\n\n $values.setFieldValue({\n path,\n value,\n updateState: mode === 'controlled',\n subscribers: [\n ...$watch.getFieldSubscribers(path),\n shouldValidate\n ? (payload) => {\n const validationResults = validateFieldValue(path, rules, payload.updatedValues);\n validationResults.hasError\n ? $errors.setFieldError(path, validationResults.error)\n : $errors.clearFieldError(path);\n }\n : null,\n options?.forceUpdate !== false && mode !== 'controlled'\n ? () =>\n setFieldKeys((keys) => ({\n ...keys,\n [path as string]: (keys[path as string] || 0) + 1,\n }))\n : null,\n ],\n });\n },\n [onValuesChange, rules]\n );\n\n const setValues: SetValues<Values> = useCallback(\n (values) => {\n const previousValues = $values.refValues.current;\n $values.setValues({ values, updateState: mode === 'controlled' });\n clearInputErrorOnChange && $errors.clearErrors();\n mode === 'uncontrolled' && setFormKey((key) => key + 1);\n\n Object.keys($watch.subscribers.current).forEach((path) => {\n const value = getPath(path, $values.refValues.current);\n const previousValue = getPath(path, previousValues);\n\n if (value !== previousValue) {\n $watch\n .getFieldSubscribers(path)\n .forEach((cb) => cb({ previousValues, updatedValues: $values.refValues.current }));\n }\n });\n },\n [onValuesChange, clearInputErrorOnChange]\n );\n\n const validate: Validate = useCallback(() => {\n const results = validateValues(rules, $values.refValues.current);\n $errors.setErrors(results.errors);\n return results;\n }, [rules]);\n\n const validateField: ValidateField<Values> = useCallback(\n (path) => {\n const results = validateFieldValue(path, rules, $values.refValues.current);\n results.hasError ? $errors.setFieldError(path, results.error) : $errors.clearFieldError(path);\n return results;\n },\n [rules]\n );\n\n const getInputProps: GetInputProps<Values> = (\n path,\n { type = 'input', withError = true, withFocus = true, ...otherOptions } = {}\n ) => {\n const onChange = getInputOnChange((value) =>\n setFieldValue(path, value as any, { forceUpdate: false })\n );\n\n const payload: any = { onChange };\n\n if (withError) {\n payload.error = $errors.errorsState[path];\n }\n\n if (type === 'checkbox') {\n payload[mode === 'controlled' ? 'checked' : 'defaultChecked'] = getPath(\n path,\n $values.refValues.current\n );\n } else {\n payload[mode === 'controlled' ? 'value' : 'defaultValue'] = getPath(\n path,\n $values.refValues.current\n );\n }\n\n if (withFocus) {\n payload.onFocus = () => $status.setFieldTouched(path, true);\n payload.onBlur = () => {\n if (shouldValidateOnChange(path, validateInputOnBlur)) {\n const validationResults = validateFieldValue(path, rules, $values.refValues.current);\n\n validationResults.hasError\n ? $errors.setFieldError(path, validationResults.error)\n : $errors.clearFieldError(path);\n }\n };\n }\n\n return Object.assign(\n payload,\n enhanceGetInputProps?.({\n inputProps: payload,\n field: path,\n options: { type, withError, withFocus, ...otherOptions },\n form,\n })\n );\n };\n\n const onSubmit: OnSubmit<Values, TransformValues> =\n (handleSubmit, handleValidationFailure) => (event) => {\n event?.preventDefault();\n const results = validate();\n\n if (results.hasErrors) {\n handleValidationFailure?.(results.errors, $values.refValues.current, event);\n } else {\n handleSubmit?.(transformValues($values.refValues.current) as any, event);\n }\n };\n\n const getTransformedValues: GetTransformedValues<Values, TransformValues> = (input) =>\n (transformValues as any)(input || $values.refValues.current);\n\n const onReset: OnReset = useCallback((event) => {\n event.preventDefault();\n reset();\n }, []);\n\n const isValid: IsValid<Values> = useCallback(\n (path) =>\n path\n ? !validateFieldValue(path, rules, $values.refValues.current).hasError\n : !validateValues(rules, $values.refValues.current).hasErrors,\n [rules]\n );\n\n const key: Key<Values> = (path) =>\n `${formKey}-${path as string}-${fieldKeys[path as string] || 0}`;\n\n const form: UseFormReturnType<Values, TransformValues> = {\n watch: $watch.watch,\n\n initialized: $values.initialized.current,\n values: $values.stateValues,\n getValues: $values.getValues,\n setInitialValues: $values.setValuesSnapshot,\n initialize,\n setValues,\n setFieldValue,\n\n errors: $errors.errorsState,\n setErrors: $errors.setErrors,\n setFieldError: $errors.setFieldError,\n clearFieldError: $errors.clearFieldError,\n clearErrors: $errors.clearErrors,\n\n resetDirty: $status.resetDirty,\n setTouched: $status.setTouched,\n setDirty: $status.setDirty,\n isTouched: $status.isTouched,\n resetTouched: $status.resetTouched,\n isDirty: $status.isDirty,\n getTouched: $status.getTouched,\n getDirty: $status.getDirty,\n\n reorderListItem: $list.reorderListItem,\n insertListItem: $list.insertListItem,\n removeListItem: $list.removeListItem,\n\n reset,\n validate,\n validateField,\n getInputProps,\n onSubmit,\n onReset,\n isValid,\n getTransformedValues,\n key,\n };\n\n useFormActions(name, form);\n\n return form;\n}\n","import { NodeContainer, NodeTrackConnections } from '@awesome-flow/core/layout';\nimport { Node, NodeProps } from '@xyflow/react';\nimport { useEffect, useState } from 'react';\nimport { Group, NumberInput, Stack } from '@mantine/core';\nimport {\n useIncomingComputedData,\n useUpdateNodeComputedData,\n useUpdateNodeData,\n} from '@awesome-flow/core/hooks';\nimport { Exponent } from 'libnoise-ts/module/modifier';\nimport { ComputedModuleData, NodeExponentNoiseData } from '../../abstract/node-props';\n\nfunction NoiseExponentNode({ id, selected, data, type }: NodeProps<Node<NodeExponentNoiseData>>) {\n const [exponent, setExponent] = useState(data.exponent);\n\n const incoming = useIncomingComputedData<ComputedModuleData>(id);\n\n const updateNodeData = useUpdateNodeData<NodeExponentNoiseData>();\n const updateComputedData = useUpdateNodeComputedData<ComputedModuleData>();\n\n useEffect(() => {\n if (incoming?.length > 0) {\n const module = new Exponent(incoming[0].module, exponent);\n updateComputedData(id, { module });\n }\n\n updateNodeData(id, { exponent });\n }, [incoming, exponent]);\n\n return (\n <NodeContainer id={id} selected={selected} data={data} type={type}>\n <Stack>\n <Group>\n Exponent:\n <NumberInput\n size=\"xs\"\n value={exponent}\n onChange={(e) => setExponent(Number(e))}\n step={0.1}\n // min={1}\n />\n </Group>\n </Stack>\n <NodeTrackConnections handles={data.handles} nodeId={id} type=\"target\" />\n </NodeContainer>\n );\n}\n\nexport default NoiseExponentNode;\n","import { NodeContainer, NodeTrackConnections } from '@awesome-flow/core/layout';\nimport { Node, NodeProps } from '@xyflow/react';\nimport { useEffect } from 'react';\nimport { useIncomingComputedData, useUpdateNodeComputedData } from '@awesome-flow/core/hooks';\nimport { Invert } from 'libnoise-ts/module/modifier';\nimport { BasicNodeData } from '@awesome-flow/core/abstract';\nimport { ComputedModuleData } from '../../abstract/node-props';\n\nfunction NoiseInvertNode({ id, selected, data, type }: NodeProps<Node<BasicNodeData>>) {\n const incoming = useIncomingComputedData<ComputedModuleData>(id);\n const updateComputedData = useUpdateNodeComputedData<ComputedModuleData>();\n\n useEffect(() => {\n if (incoming?.length > 0) {\n const module = new Invert(incoming[0].module);\n updateComputedData(id, { module });\n }\n }, [incoming]);\n\n return (\n <NodeContainer id={id} selected={selected} data={data} type={type}>\n <NodeTrackConnections handles={data.handles} nodeId={id} type=\"target\" />\n </NodeContainer>\n );\n}\n\nexport default NoiseInvertNode;\n","import { NodeContainer, NodeTrackConnections } from '@awesome-flow/core/layout';\nimport { Node, NodeProps } from '@xyflow/react';\nimport { useEffect, useState } from 'react';\nimport { Group, NumberInput, Stack } from '@mantine/core';\nimport {\n useIncomingComputedData,\n useUpdateNodeComputedData,\n useUpdateNodeData,\n} from '@awesome-flow/core/hooks';\nimport { ComputedModuleData, NodeNormalizeNoiseData } from '../../abstract/node-props';\nimport { NormalizeNoiseModule } from '../../modules/normalize-noise-module';\n\nfunction NoiseNormalizeNode({ id, selected, data, type }: NodeProps<Node<NodeNormalizeNoiseData>>) {\n const [intervalStart, setIntervalStart] = useState(data.intervalStart);\n const [intervalEnd, setIntervalEnd] = useState(data.intervalEnd);\n\n const incoming = useIncomingComputedData<ComputedModuleData>(id);\n\n const updateNodeData = useUpdateNodeData<NodeNormalizeNoiseData>();\n const updateComputedData = useUpdateNodeComputedData<ComputedModuleData>();\n\n useEffect(() => {\n if (incoming?.length) {\n const source = incoming[0].module;\n const module = new NormalizeNoiseModule(source, intervalStart, intervalEnd);\n\n updateComputedData(id, { module });\n }\n\n updateNodeData(id, { intervalStart, intervalEnd });\n }, [incoming, intervalStart, intervalEnd]);\n\n return (\n <NodeContainer id={id} selected={selected} data={data} type={type}>\n <Stack>\n <Group>\n <NumberInput\n size=\"xs\"\n w={100}\n value={intervalStart}\n onChange={(e) => setIntervalStart(Number(e))}\n />\n <NumberInput\n size=\"xs\"\n w={100}\n value={intervalEnd}\n onChange={(e) => setIntervalEnd(Number(e))}\n />\n </Group>\n </Stack>\n <NodeTrackConnections handles={data.handles} nodeId={id} type=\"target\" />\n </NodeContainer>\n );\n}\n\nexport default NoiseNormalizeNode;\n","import Module from 'libnoise-ts/module/Module';\nimport ModifierModule from 'libnoise-ts/module/modifier';\n\nexport class NormalizeNoiseModule extends ModifierModule {\n constructor(\n source: Module,\n public lowerBound: number,\n public upperBound: number\n ) {\n super(source);\n }\n\n getValue(x: number, y: number, z: number): number {\n return normalize(this.sourceModule.getValue(x, y, z), this.lowerBound, this.upperBound);\n }\n}\n\nfunction normalize(value: number, min: number, max: number) {\n return (value - min) / (max - min);\n}\n","import { NodeContainer, NodeTrackConnections } from '@awesome-flow/core/layout';\nimport { Node, NodeProps } from '@xyflow/react';\nimport { useEffect, useState } from 'react';\nimport { Group, NumberInput, Stack } from '@mantine/core';\nimport {\n useIncomingComputedData,\n useUpdateNodeComputedData,\n useUpdateNodeData,\n} from '@awesome-flow/core/hooks';\nimport { ScaleBias } from 'libnoise-ts/module/modifier';\nimport { ComputedModuleData, NodeScaleBiasNoiseData } from '../../abstract/node-props';\n\nfunction NoiseScaleBiasNode({ id, selected, data, type }: NodeProps<Node<NodeScaleBiasNoiseData>>) {\n const [scale, setScale] = useState(data.scale);\n const [bias, setBias] = useState(data.bias);\n\n const incoming = useIncomingComputedData<ComputedModuleData>(id);\n\n const updateNodeData = useUpdateNodeData<NodeScaleBiasNoiseData>();\n const updateComputedData = useUpdateNodeComputedData<ComputedModuleData>();\n\n useEffect(() => {\n if (incoming?.length > 0) {\n const module = new ScaleBias(incoming[0].module, scale, bias);\n updateComputedData(id, { module });\n }\n\n updateNodeData(id, { scale, bias });\n }, [incoming, scale, bias]);\n\n return (\n <NodeContainer id={id} selected={selected} data={data} type={type}>\n <Stack>\n <Group>\n Scale:\n <NumberInput\n size=\"xs\"\n w={100}\n value={scale}\n onChange={(e) => setScale(Number(e))}\n step={0.1}\n />\n </Group>\n <Group>\n Bias:\n <NumberInput\n size=\"xs\"\n w={100}\n value={bias}\n onChange={(e) => setBias(Number(e))}\n step={0.1}\n />\n </Group>\n </Stack>\n <NodeTrackConnections handles={data.handles} nodeId={id} type=\"target\" />\n </NodeContainer>\n );\n}\n\nexport default NoiseScaleBiasNode;\n","import { NodeContainer, NodeTrackConnections } from '@awesome-flow/core/layout';\nimport { Node, NodeProps } from '@xyflow/react';\nimport { ActionIcon, Button, Group, NumberInput, Space } from '@mantine/core';\nimport {\n useIncomingComputedData,\n useUpdateNodeComputedData,\n useUpdateNodeData,\n} from '@awesome-flow/core/hooks';\nimport { FORM_INDEX, useForm } from '@mantine/form';\nimport { useCallback, useEffect, useState } from 'react';\nimport { Terrace } from 'libnoise-ts/module/modifier';\nimport { IconX } from '@tabler/icons-react';\nimport { randomId } from '@mantine/hooks';\nimport { NodeState } from '@awesome-flow/core/abstract';\nimport { ComputedModuleData, NodeTerraceNoiseData } from '../../abstract/node-props';\n\nfunction NoiseTerraceNode({ id, selected, data, type }: NodeProps<Node<NodeTerraceNoiseData>>) {\n const incoming = useIncomingComputedData<ComputedModuleData>(id);\n\n const updateNodeData = useUpdateNodeData<NodeTerraceNoiseData>();\n const updateComputedData = useUpdateNodeComputedData<ComputedModuleData>();\n\n const [values, setValues] = useState<number[]>([]);\n\n const form = useForm<{ points: { value: number; key: string }[] }>({\n mode: 'uncontrolled',\n initialValues: {\n points: [],\n },\n validateInputOnChange: [`points.${FORM_INDEX}.input`],\n clearInputErrorOnChange: true,\n onValuesChange: useCallback((values) => {\n if (form.isValid()) {\n const points = values.points.map((v) => v.value);\n setValues(points);\n updateNodeData(id, { points });\n }\n\n form.validate();\n }, []),\n });\n\n useEffect(() => {\n const points = data.points?.length\n ? data.points.map((v) => ({ value: v, key: randomId() }))\n : [1, 2].map(() => ({ value: 0, key: randomId() }));\n\n form.initialize({ points });\n }, []);\n\n useEffect(() => {\n if (incoming?.length && values?.length >= 2) {\n const module = new Terrace(incoming[0].module, values);\n updateComputedData(id, { module });\n }\n }, [values, incoming]);\n\n const fields = form.getValues().points.map((item, index) => (\n <Group mt=\"xs\" key={item.key}>\n <NumberInput\n size=\"xs\"\n placeholder=\"Input Value\"\n key={form.key(`points.${index}.value`)}\n {...form.getInputProps(`points.${index}.value`)}\n step={0.1}\n />\n {data.state === NodeState.edit && values.length > 2 && (\n <ActionIcon\n color=\"red\"\n variant=\"outline\"\n size=\"sm\"\n onClick={() => form.removeListItem('points', index)}\n >\n <IconX size=\"1rem\" />\n </ActionIcon>\n )}\n </Group>\n ));\n\n return (\n <NodeContainer id={id} selected={selected} type={type} data={data}>\n {fields}\n {data.state === NodeState.edit && (\n <>\n <Space h={10} />\n <Button\n variant=\"outline\"\n size=\"xs\"\n fullWidth\n onClick={() => form.insertListItem('points', { value: 0, key: randomId() })}\n >\n Add control point\n </Button>\n </>\n )}\n <NodeTrackConnections handles={data.handles} nodeId={id} type=\"target\" />\n </NodeContainer>\n );\n}\n\nexport default NoiseTerraceNode;\n","import { NodeCombobox, NodeContainer, NodeTrackConnections } from '@awesome-flow/core/layout';\nimport { Node, NodeProps } from '@xyflow/react';\nimport { ReactNode, useCallback, useEffect, useState } from 'react';\nimport { useIncomingNodeData, useUpdateNodeData } from '@awesome-flow/core/hooks';\nimport {\n IconAsterisk,\n IconChevronLeft,\n IconChevronRight,\n IconChevronUp,\n IconDivide,\n IconPlus,\n} from '@tabler/icons-react';\nimport { NodeCombineVariableData, NodeVariableValueData } from '../../abstract/node-props';\nimport { VariableCombineType } from '../../abstract/operations';\nimport { ValueType } from '../../abstract/properties';\nimport { NodeValueInput } from '../../layout';\n\nconst options: Record<VariableCombineType, ReactNode | string> = {\n add: <IconPlus />,\n divide: <IconDivide />,\n min: <IconChevronLeft />,\n max: <IconChevronRight />,\n multiply: <IconAsterisk />,\n power: <IconChevronUp />,\n};\n\nfunction VariableCombineNode({\n id,\n selected,\n data,\n type,\n}: NodeProps<Node<NodeCombineVariableData>>) {\n const [operation, setOperation] = useState(data.operation);\n const [value, setValue] = useState(data.value);\n\n const updateNodeData = useUpdateNodeData<NodeCombineVariableData>();\n const incoming = useIncomingNodeData<NodeVariableValueData>(id);\n\n useEffect(() => {\n if (incoming?.length > 1) {\n const result = getOperationResult(operation, incoming[0].value, incoming[1].value);\n setValue(result);\n updateNodeData(id, { value: result });\n }\n }, [operation, incoming]);\n\n const onChange = useCallback((op: VariableCombineType) => {\n updateNodeData(id, { operation: op });\n setOperation(op);\n }, []);\n\n return (\n <NodeContainer id={id} selected={selected} data={data} type={type}>\n <NodeCombobox options={options} selected={operation} onChange={onChange} />\n <NodeValueInput value={value} onChange={() => {}} disabled />\n <NodeTrackConnections handles={data.handles} nodeId={id} type=\"target\" />\n </NodeContainer>\n );\n}\n\nfunction getOperationResult(\n operation: VariableCombineType,\n value1: ValueType,\n value2: ValueType\n): ValueType {\n switch (operation) {\n case VariableCombineType.add:\n return Number(value1) + Number(value2);\n\n case VariableCombineType.divide:\n return Number(value1) / (Number(value2) || 1);\n\n case VariableCombineType.max:\n return Number(value1) > Number(value2) ? value1 : value2;\n\n case VariableCombineType.min:\n return Number(value1) < Number(value2) ? value1 : value2;\n\n case VariableCombineType.multiply:\n return Number(value1) * Number(value2);\n\n case VariableCombineType.power:\n return Number(value1) ** Number(value2);\n }\n}\n\nexport default VariableCombineNode;\n","import { Input, NumberInput, Switch } from '@mantine/core';\nimport { ValueType } from '../abstract/properties';\n\nexport type NodeValueInputProps = {\n value: ValueType;\n disabled?: boolean;\n step?: number;\n onChange: (value: ValueType) => void;\n};\n\nfunction NodeValueInput({ value, disabled, step, onChange }: Readonly<NodeValueInputProps>) {\n if (value === undefined || value === null) {\n return <></>;\n }\n\n switch (typeof value) {\n case 'boolean': {\n return (\n <Switch\n checked={value}\n disabled={disabled}\n onChange={(e) => onChange(e.currentTarget.checked)}\n />\n );\n }\n\n case 'number': {\n return (\n <NumberInput value={value} disabled={disabled} step={step} onChange={(e) => onChange(e)} />\n );\n }\n\n case 'string': {\n return (\n <Input\n value={value}\n disabled={disabled}\n onChange={(e) => onChange(e.currentTarget.value)}\n />\n );\n }\n\n default:\n throw new Error(`Unknown input node for value of type: ${typeof value} (${value})`);\n }\n}\n\nexport default NodeValueInput;\n","import { ValueType, PropertyValue } from '../abstract/properties';\nimport NodeValueInput from './node-value-input';\n\nexport type NodePropertyInputProps = {\n property: PropertyValue;\n onChange: (name: string, value: ValueType) => void;\n};\n\nfunction NodePropertyInput({ property, onChange }: Readonly<NodePropertyInputProps>) {\n if (!property) {\n return <></>;\n }\n\n return (\n <NodeValueInput\n value={property.value}\n disabled={property.disabled}\n step={property.step}\n onChange={(value) => onChange(property.name, value)}\n />\n );\n}\n\nexport default NodePropertyInput;\n","import { useIncomingNodeData, useUpdateNodeData } from '@awesome-flow/core/hooks';\nimport { useCallback, useEffect, useMemo, useState } from 'react';\nimport { Group, Stack } from '@mantine/core';\nimport { getObjectKeys } from '@awesome-flow/core/utils';\nimport { nodeDataPropertyExcept } from '@awesome-flow/core/abstract';\nimport { NodeVariablePropertyData } from '../abstract/node-props';\nimport { PropertyValue, ValueType } from '../abstract/properties';\nimport NodePropertyInput from './node-property-input';\n\nexport type NodeTrackVariablesProps = {\n nodeId: string;\n data: Record<string, any>;\n except?: Set<string>;\n onPropertiesChange?: (properties: Record<string, PropertyValue>) => void;\n};\n\nfunction NodePropertyVariables({\n data,\n nodeId,\n onPropertiesChange,\n except = nodeDataPropertyExcept,\n}: Readonly<NodeTrackVariablesProps>) {\n const [properties, setProperties] = useState<Record<string, PropertyValue>>(() => {\n const keys = getObjectKeys(data, except);\n\n const dataProps = {};\n\n for (const key of keys) {\n dataProps[key] = {\n name: key,\n value: data[key],\n } satisfies PropertyValue;\n }\n\n return dataProps;\n });\n\n const updateNodeData = useUpdateNodeData();\n const incoming = useIncomingNodeData<NodeVariablePropertyData>(nodeId);\n\n const resetAllDisabled = useCallback(() => {\n const keys = Object.keys(properties);\n\n keys.forEach((k) => {\n properties[k].disabled = false;\n });\n\n setProperties(properties);\n }, []);\n\n const updatePropertyValue = useCallback((name: string, value: ValueType, disabled?: boolean) => {\n let property = properties[name];\n\n if (property) {\n property.value = value;\n } else {\n property = {\n name,\n value,\n };\n }\n\n property.disabled = disabled;\n\n setProperties({ ...properties, [name]: property });\n updateNodeData(nodeId, { [name]: value });\n }, []);\n\n useEffect(() => {\n resetAllDisabled();\n\n if (incoming?.length) {\n for (const connection of incoming) {\n if (connection.property && properties[connection.property.name] !== undefined) {\n updatePropertyValue(connection.property.name, connection.property.value, true);\n }\n }\n }\n }, [incoming]);\n\n useEffect(() => {\n if (onPropertiesChange) {\n onPropertiesChange(properties);\n }\n }, [onPropertiesChange, properties]);\n\n const nodes = useMemo(() => {\n return Object.keys(properties).map((key) => {\n const property = properties[key];\n\n return (\n <Group key={key}>\n {property.name}:<NodePropertyInput property={property} onChange={updatePropertyValue} />\n </Group>\n );\n });\n }, [properties, updatePropertyValue]);\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AAS,CAAC,EAAE,OAAO,SAAS,CAAC,EAAE,KAAK;AACjF,eAAS,MAAM;AACf,qBAAe,IAAI,EAAE,OAAO,OAAO,CAAC;AAAA,IACtC;AAAA,EACF,GAAG,CAAC,WAAW,QAAQ,CAAC;AAExB,QAAM,eAAW,4BAAY,CAAC,OAA4B;AACxD,mBAAe,IAAI,EAAE,WAAW,GAAG,CAAC;AACpC,iBAAa,EAAE;AAAA,EACjB,GAAG,CAAC,CAAC;AAEL,SACE,+CAAC,iCAAc,IAAQ,UAAoB,MAAY,MACrD;AAAA,kDAAC,gCAAa,SAASA,UAAS,UAAU,WAAW,UAAoB;AAAA,IACzE,8CAAC,4BAAe,OAAc,UAAU,MAAM;AAAA,IAAC,GAAG,UAAQ,MAAC;AAAA,IAC3D,8CAAC,wCAAqB,SAAS,KAAK,SAAS,QAAQ,IAAI,MAAK,UAAS;AAAA,KACzE;AAEJ;AAEA,SAAS,mBACP,WACA,QACA,QACW;AACX,UAAQ,WAAW;AAAA,IACjB;AACE,aAAO,OAAO,MAAM,IAAI,OAAO,MAAM;AAAA,IAEvC;AACE,aAAO,OAAO,MAAM,KAAK,OAAO,MAAM,KAAK;AAAA,IAE7C;AACE,aAAO,OAAO,MAAM,IAAI,OAAO,MAAM,IAAI,SAAS;AAAA,IAEpD;AACE,aAAO,OAAO,MAAM,IAAI,OAAO,MAAM,IAAI,SAAS;AAAA,IAEpD;AACE,aAAO,OAAO,MAAM,IAAI,OAAO,MAAM;AAAA,IAEvC;AACE,aAAO,OAAO,MAAM,KAAK,OAAO,MAAM;AAAA,EAC1C;AACF;AAEA,IAAO,gCAAQ;","names":["exports","module","module","import_layout","import_react","import_hooks","import_modifier","import_jsx_runtime","module","import_layout","import_react","import_hooks","import_jsx_runtime","module","import_layout","import_core","import_hooks","isEqual","options","import_react","import_modifier","import_icons_react","import_hooks","import_jsx_runtime","values","module","import_layout","import_react","import_core","import_hooks","import_modifier","import_jsx_runtime","module","import_layout","import_react","import_hooks","import_modifier","import_jsx_runtime","module","import_layout","import_react","import_core","import_hooks","import_modifier","ModifierModule","import_jsx_runtime","module","import_layout","import_react","import_core","import_hooks","import_modifier","import_jsx_runtime","module","import_layout","import_core","import_hooks","import_react","import_modifier","import_icons_react","import_hooks","import_abstract","import_jsx_runtime","values","module","import_layout","import_react","import_hooks","import_icons_react","import_core","import_jsx_runtime","import_jsx_runtime","import_hooks","import_react","import_core","import_abstract","import_jsx_runtime","import_jsx_runtime","options"]}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { NodeProps, Node } from '@xyflow/react';
|
|
3
|
+
import { BasicNodeData } from '@awesome-flow/core/abstract';
|
|
4
|
+
import { j as NodeNormalizeNoiseData, q as NodeCombineNoiseData, k as NodeClampNoiseData, s as NodeCurveNoiseData, u as NodeExponentNoiseData, v as NodeScaleBiasNoiseData, t as NodeTerraceNoiseData, r as NodeCombineVariableData } from '../../node-props-hKW-_KOU.cjs';
|
|
5
|
+
import 'libnoise-ts/module/generator';
|
|
6
|
+
import 'libnoise-ts/noisegen';
|
|
7
|
+
import 'libnoise-ts/module/Module';
|
|
8
|
+
import '../../handle-types-D-v5S53h.cjs';
|
|
9
|
+
import 'libnoise-ts/module/combiner';
|
|
10
|
+
import '../../properties-BxwtU6i9.cjs';
|
|
11
|
+
|
|
12
|
+
declare function NoiseNormalizeNode({ id, selected, data, type }: NodeProps<Node<NodeNormalizeNoiseData>>): react_jsx_runtime.JSX.Element;
|
|
13
|
+
|
|
14
|
+
declare function NoiseCombineNode({ id, selected, data, type }: NodeProps<Node<NodeCombineNoiseData>>): react_jsx_runtime.JSX.Element;
|
|
15
|
+
|
|
16
|
+
declare function NoiseClampNode({ id, selected, data, type }: NodeProps<Node<NodeClampNoiseData>>): react_jsx_runtime.JSX.Element;
|
|
17
|
+
|
|
18
|
+
declare function NoiseAbsNode({ id, selected, data, type }: NodeProps<Node<BasicNodeData>>): react_jsx_runtime.JSX.Element;
|
|
19
|
+
|
|
20
|
+
declare function NoiseCurveNode({ id, selected, data, type }: NodeProps<Node<NodeCurveNoiseData>>): react_jsx_runtime.JSX.Element;
|
|
21
|
+
|
|
22
|
+
declare function NoiseExponentNode({ id, selected, data, type }: NodeProps<Node<NodeExponentNoiseData>>): react_jsx_runtime.JSX.Element;
|
|
23
|
+
|
|
24
|
+
declare function NoiseInvertNode({ id, selected, data, type }: NodeProps<Node<BasicNodeData>>): react_jsx_runtime.JSX.Element;
|
|
25
|
+
|
|
26
|
+
declare function NoiseScaleBiasNode({ id, selected, data, type }: NodeProps<Node<NodeScaleBiasNoiseData>>): react_jsx_runtime.JSX.Element;
|
|
27
|
+
|
|
28
|
+
declare function NoiseTerraceNode({ id, selected, data, type }: NodeProps<Node<NodeTerraceNoiseData>>): react_jsx_runtime.JSX.Element;
|
|
29
|
+
|
|
30
|
+
declare function VariableCombineNode({ id, selected, data, type, }: NodeProps<Node<NodeCombineVariableData>>): react_jsx_runtime.JSX.Element;
|
|
31
|
+
|
|
32
|
+
export { NoiseAbsNode, NoiseClampNode, NoiseCombineNode, NoiseCurveNode, NoiseExponentNode, NoiseInvertNode, NoiseNormalizeNode, NoiseScaleBiasNode, NoiseTerraceNode, VariableCombineNode };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { NodeProps, Node } from '@xyflow/react';
|
|
3
|
+
import { BasicNodeData } from '@awesome-flow/core/abstract';
|
|
4
|
+
import { j as NodeNormalizeNoiseData, q as NodeCombineNoiseData, k as NodeClampNoiseData, s as NodeCurveNoiseData, u as NodeExponentNoiseData, v as NodeScaleBiasNoiseData, t as NodeTerraceNoiseData, r as NodeCombineVariableData } from '../../node-props-CeZ8Oshz.js';
|
|
5
|
+
import 'libnoise-ts/module/generator';
|
|
6
|
+
import 'libnoise-ts/noisegen';
|
|
7
|
+
import 'libnoise-ts/module/Module';
|
|
8
|
+
import '../../handle-types-D-v5S53h.js';
|
|
9
|
+
import 'libnoise-ts/module/combiner';
|
|
10
|
+
import '../../properties-BxwtU6i9.js';
|
|
11
|
+
|
|
12
|
+
declare function NoiseNormalizeNode({ id, selected, data, type }: NodeProps<Node<NodeNormalizeNoiseData>>): react_jsx_runtime.JSX.Element;
|
|
13
|
+
|
|
14
|
+
declare function NoiseCombineNode({ id, selected, data, type }: NodeProps<Node<NodeCombineNoiseData>>): react_jsx_runtime.JSX.Element;
|
|
15
|
+
|
|
16
|
+
declare function NoiseClampNode({ id, selected, data, type }: NodeProps<Node<NodeClampNoiseData>>): react_jsx_runtime.JSX.Element;
|
|
17
|
+
|
|
18
|
+
declare function NoiseAbsNode({ id, selected, data, type }: NodeProps<Node<BasicNodeData>>): react_jsx_runtime.JSX.Element;
|
|
19
|
+
|
|
20
|
+
declare function NoiseCurveNode({ id, selected, data, type }: NodeProps<Node<NodeCurveNoiseData>>): react_jsx_runtime.JSX.Element;
|
|
21
|
+
|
|
22
|
+
declare function NoiseExponentNode({ id, selected, data, type }: NodeProps<Node<NodeExponentNoiseData>>): react_jsx_runtime.JSX.Element;
|
|
23
|
+
|
|
24
|
+
declare function NoiseInvertNode({ id, selected, data, type }: NodeProps<Node<BasicNodeData>>): react_jsx_runtime.JSX.Element;
|
|
25
|
+
|
|
26
|
+
declare function NoiseScaleBiasNode({ id, selected, data, type }: NodeProps<Node<NodeScaleBiasNoiseData>>): react_jsx_runtime.JSX.Element;
|
|
27
|
+
|
|
28
|
+
declare function NoiseTerraceNode({ id, selected, data, type }: NodeProps<Node<NodeTerraceNoiseData>>): react_jsx_runtime.JSX.Element;
|
|
29
|
+
|
|
30
|
+
declare function VariableCombineNode({ id, selected, data, type, }: NodeProps<Node<NodeCombineVariableData>>): react_jsx_runtime.JSX.Element;
|
|
31
|
+
|
|
32
|
+
export { NoiseAbsNode, NoiseClampNode, NoiseCombineNode, NoiseCurveNode, NoiseExponentNode, NoiseInvertNode, NoiseNormalizeNode, NoiseScaleBiasNode, NoiseTerraceNode, VariableCombineNode };
|