@web-noise/core 0.0.14 → 0.0.15-alpha
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/cjs/components.js +68 -84
- package/dist/cjs/components.js.map +1 -1
- package/dist/esm/components.js +121 -137
- package/dist/esm/components.js.map +1 -1
- package/dist/main.js +72 -88
- package/dist/main.js.map +1 -1
- package/dist/module.js +140 -156
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts +21 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/esm/components.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion/styled";import{useEffect as n,useState as l,useCallback as a,useRef as
|
|
1
|
+
let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion/styled";import{useEffect as n,useState as l,useCallback as a,useRef as s}from"react";import{createPortal as d}from"react-dom";import{MdClose as c,MdSettings as h,MdInfoOutline as p}from"react-icons/md";import{useTheme as g,withTheme as m}from"@emotion/react";import"nanoid";import{FaPlus as u}from"react-icons/fa6";import"@web-noise/fetch";import{getConnectedEdges as f,addEdge as v,applyNodeChanges as b,applyEdgeChanges as w,Controls as x,Handle as y}from"reactflow";import{create as $}from"zustand";import{setAudioNodeTypes as k,createPatch as C}from"@web-noise/patch";import{reverse as P,patch as z,create as N}from"jsondiffpatch";import{injectGlobal as _}from"@emotion/css";import"reactflow/dist/style.css";import{Item as E,Menu as j}from"react-contexify";import"react-contexify/dist/ReactContexify.css";import"hotkeys-js";import"react-file-drop";import{FaFileUpload as S,FaVolumeOff as F,FaRegArrowAltCircleRight as A}from"react-icons/fa";import"re-resizable";import"react-grid-layout";import"react-grid-layout/css/styles.css";import"react-icons/ai";import"react-icons/rx";import"react-modern-drawer";import"react-modern-drawer/dist/index.css";import"marked";import{useThrottledCallback as I}from"use-debounce";import R from"rc-slider";import"rc-slider/assets/index.css";import{CanvasSpliner as T}from"CanvasSpliner";function L(e,o,t,r){Object.defineProperty(e,o,{get:t,set:r,enumerable:!0,configurable:!0})}var D,M,O={};L(O,"Modal",()=>U),L(O,"Checker",()=>ew),L(O,"RadioGroup",()=>ey),L(O,"Input",()=>eC),L(O,"DropdownInput",()=>eS),L(O,"ColorInput",()=>eI),L(O,"NumberInput",()=>eL),L(O,"Button",()=>eD),L(O,"Select",()=>eO),L(O,"Slider",()=>eH),L(O,"SplineEditor",()=>eB),L(O,"ConfigRowLabel",()=>eV),L(O,"ConfigRowControl",()=>eU),L(O,"ConfigRowSeparator",()=>eJ),L(O,"ConfigRow",()=>eK),L(O,"ConfigPanel",()=>eY),L(O,"ConfigRowInner",()=>eX);var H={colors:{elevation1:"#292d39",elevation2:"#181c20",elevation3:"#373c4b",accent1:"#0066dc",accent2:"#007bff",accent3:"#3c93ff",highlight1:"#535760",highlight2:"#8c92a4",highlight3:"#fefefe",vivid1:"#14df42",whitePrimary:"#ffffff",error:"#db5353"},zIndex:{modal:9998,controlPanel:9999,resumeContextLayout:10003}},G=()=>{let e=g();return{...H,...e}};let W=i.div`
|
|
2
2
|
position: fixed;
|
|
3
3
|
z-index: ${({theme:e})=>e.zIndex.modal};
|
|
4
4
|
width: 100%;
|
|
@@ -9,7 +9,7 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
9
9
|
display: flex;
|
|
10
10
|
align-items: center;
|
|
11
11
|
justify-content: center;
|
|
12
|
-
`,
|
|
12
|
+
`,B=i.div`
|
|
13
13
|
background: ${({theme:e})=>e.colors.elevation2};
|
|
14
14
|
box-shadow: 1px 1px 1px 1px ${({theme:e})=>e.colors.elevation1};
|
|
15
15
|
color: white;
|
|
@@ -17,18 +17,69 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
17
17
|
height: 80%;
|
|
18
18
|
overflow-y: scroll;
|
|
19
19
|
position: relative;
|
|
20
|
-
|
|
20
|
+
|
|
21
|
+
h1,
|
|
22
|
+
h2,
|
|
23
|
+
h3,
|
|
24
|
+
h4,
|
|
25
|
+
h5,
|
|
26
|
+
h6 {
|
|
27
|
+
display: block;
|
|
28
|
+
margin-block-start: 1em;
|
|
29
|
+
margin-block-end: 1em;
|
|
30
|
+
margin-inline-start: 0px;
|
|
31
|
+
margin-inline-end: 0px;
|
|
32
|
+
font-weight: bold;
|
|
33
|
+
unicode-bidi: isolate;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
h1 {
|
|
37
|
+
font-size: 2em;
|
|
38
|
+
margin-block-start: 0.67em;
|
|
39
|
+
margin-block-end: 0.67em;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
h2 {
|
|
43
|
+
font-size: 1.5em;
|
|
44
|
+
margin-block-start: 0.83em;
|
|
45
|
+
margin-block-end: 0.83em;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
h3 {
|
|
49
|
+
font-size: 1.17em;
|
|
50
|
+
margin-block-start: 1em;
|
|
51
|
+
margin-block-end: 1em;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
ul {
|
|
55
|
+
display: block;
|
|
56
|
+
list-style-type: disc;
|
|
57
|
+
margin-block-start: 1em;
|
|
58
|
+
margin-block-end: 1em;
|
|
59
|
+
padding-inline-start: 40px;
|
|
60
|
+
unicode-bidi: isolate;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
p {
|
|
64
|
+
display: block;
|
|
65
|
+
margin-block-start: 1em;
|
|
66
|
+
margin-block-end: 1em;
|
|
67
|
+
margin-inline-start: 0px;
|
|
68
|
+
margin-inline-end: 0px;
|
|
69
|
+
unicode-bidi: isolate;
|
|
70
|
+
}
|
|
71
|
+
`,V=i(c)`
|
|
21
72
|
position: absolute;
|
|
22
73
|
top: 0.2rem;
|
|
23
74
|
right: 0.2rem;
|
|
24
75
|
cursor: pointer;
|
|
25
|
-
`,
|
|
76
|
+
`,U=({children:e,onClose:o,...i})=>{let l=G();return n(()=>{let e=e=>{"Escape"===e.key&&o?.()};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[o]),d(t(W,{theme:l,onClick:o,children:r(B,{...i,onClick:e=>{e.stopPropagation()},theme:l,children:[e,t(V,{theme:l,onClick:o})]})}),document.body)};var J={};L(J,"DRAG_HANDLE_CLASS",()=>K),L(J,"DRAG_HANDLE_SELECTOR",()=>Y),L(J,"CONTROL_PANEL_GRID_CONFIG",()=>X),L(J,"PortType",()=>M);let K="web-noise-drag-handle",Y=`.${K}`,X={rowHeight:10,cols:4};(D=M||(M={})).Gate="gate",D.Number="number",D.Audio="audio",D.Any="any";let q=e=>JSON.parse(JSON.stringify(e)),Q=(e,o)=>{let t=new Set(e.map(e=>e.id)),r=new Set(o.map(e=>e.id));return{added:o.filter(e=>!t.has(e.id)),removed:e.filter(e=>!r.has(e.id))}};$((e=(...e)=>{let[o,t]=e;return{...((e,o)=>({nodes:[],edges:[],onNodesChange:o=>{e(({nodes:e})=>({nodes:b(o,e).map(e=>({dragHandle:Y,...e}))}))},onEdgesChange:o=>{e(({edges:e})=>({edges:w(o,e)}))},onConnect:o=>{e(({edges:e})=>({edges:v(o,e)}))},addNode:o=>{e(({nodes:e})=>({nodes:e.concat(o)}))},setNodes:o=>{e({nodes:o})},setEdges:o=>{e({edges:o})},setNodesAndEdges:({nodes:o,edges:t})=>{e({nodes:o,edges:t})},getNodesAndEdges:()=>{let{nodes:e,edges:t}=o();return{nodes:e,edges:t}},clearElements:()=>{e({nodes:[],edges:[]})},getNode:e=>{let{nodes:t}=o();return t.find(o=>o.id===e)||null},updateNodeData:(o,t)=>{e(({nodes:e})=>({nodes:e.map(e=>e.id===o?{...e,data:{...e.data,...t}}:e)}))},nodeTypes:{},setNodeTypes:o=>e({nodeTypes:o})}))(...e),...((e,o)=>({history:{maxHistoryLength:5,buffer:[],pointer:0,skipCollect:!1,push:t=>{let{history:r}=o(),{maxHistoryLength:i,skipCollect:n}=r;n?e({history:{...r,skipCollect:!1}}):e(({history:e})=>{if(!e)return{};let{buffer:o,pointer:r}=e,n=o.slice(Math.max(r-i+1,0),r);return{history:{...e,buffer:[...n,t],pointer:Math.min(r+1,i)}}})},back:()=>{let{nodes:t,edges:r,controlPanel:i,history:n}=o(),{buffer:l,pointer:a}=n,s=l[a-1];if(!s)return;let d=P(s);d&&e({...z(q({nodes:t,edges:r,controlPanel:i}),d),history:{...n,pointer:a-1,skipCollect:!0}})},forward:()=>{let{nodes:t,edges:r,controlPanel:i,history:n}=o(),{buffer:l,pointer:a}=n,s=l[a];s&&e({...z(q({nodes:t,edges:r,controlPanel:i}),s),history:{...n,pointer:a+1,skipCollect:!0}})},clear:()=>{let{history:t}=o();e({history:{...t,buffer:[],pointer:0,skipCollect:!0}})}}}))(...e),...((e,o)=>({patch:C(),nodesState:{}}))(...e),...((e,o)=>({project:{files:[]},setProject(o){e({project:o,currentFileIndex:0})},getProject:()=>o().project,pullEditorChanges(){let{getEditorState:e,currentFileIndex:t,updateFileContent:r,project:i}=o(),n=i.files[t];"audio"!==n.type&&r(t,{...n,file:e()})},syncEditorWithCurrentFile:()=>{let{currentFileIndex:e,setEditorState:t,project:r}=o(),i=r.files[e];"audio"===i.type?console.log("audio file. skipping"):t(i.file)},currentFileIndex:0,setCurrentFileIndex(t){let{currentFileIndex:r}=o();t!==r&&e({currentFileIndex:t})},updateFileContent(t,r){let{project:i}=o();e({project:{...i,files:i.files.map((e,o)=>o===t?{...e,...r}:e)}})},updateFileName(t,r){let{project:i}=o();e({project:{...i,files:i.files.map((e,o)=>o===t?{...e,name:r}:e)}})},addFile(t){let{project:r}=o(),i=[...r.files,t];e({project:{...r,files:i}})},deleteFile:t=>{let{project:r,currentFileIndex:i}=o();e({project:{...r,files:r.files.filter((e,o)=>t!==o)}}),t<=i&&e({currentFileIndex:Math.max(0,i-1)})}}))(...e),setGraph:async({nodes:e,edges:o})=>{let{patch:r,createNodes:i,createEdges:n,setNodesAndEdges:l,nodes:a,edges:s}=t();l({nodes:[],edges:[]}),await i(e),n(o)},clearGraph:()=>{let{setGraph:e}=t();e({nodes:[],edges:[]})},createNodes:async e=>{let{createNode:o}=t();await Promise.all(e.map(e=>o(e)))},createNode:e=>{let{addNode:o,nodesConfiguration:r}=t(),{type:i,id:n,data:l}=e;if(void 0===i)throw Error(`node type is not defined for node: ${n}`);o({...e,data:{...l,config:{...r[i]?.defaultConfig,...l?.config}}})},removeNode:e=>t().removeNodes([e]),removeNodes:e=>{let{edges:r,nodes:i,onNodesDelete:n,removeEdges:l,removeNodesFromControlPanel:a}=t(),s=e.map(({id:e})=>e),d=[...e,...i.filter(({parentNode:e})=>e&&s.includes(e))];a(d),l(f(d,r)),n(d);let c=d.map(({id:e})=>e);o({nodes:i.filter(({id:e})=>!c.includes(e))})},removeEdges:e=>{let{edges:r,onEdgesDelete:i}=t(),n=e.map(({id:e})=>e);i(e),o({edges:r.filter(({id:e})=>!n.includes(e))})},createEdges:e=>{let{patch:o,edges:r,setEdges:i}=t();i(e)},onConnect:async e=>{let{edges:o,createEdges:r}=t();r(v(e,o))},onEdgesDelete:e=>{let{patch:o}=t()},onNodesDelete:async e=>{let{removeNodesFromControlPanel:o,patch:r}=t();o(e)},plugins:[],setPlugins:async e=>{let{setNodeTypes:r}=t();o({plugins:e});let i=e.reduce((e,o)=>({...e,...o.components.reduce((e,o)=>({...e,[o.type]:o}),{})}),{}),n=Object.keys(i).reduce((e,o)=>({...e,[o]:i[o].node}),{});k(Object.keys(i).reduce((e,o)=>({...e,[o]:i[o].audioNode}),{})),r(n),o(({nodesConfiguration:e})=>({nodesConfiguration:{...e,...i}}))},nodesConfiguration:{},config:{showMinimap:!1},setConfig:e=>{o(({config:o})=>({config:{...o,...e}}))},getEditorState:()=>{let{getNodesAndEdges:e,controlPanel:o,viewport:r}=t();return{...e(),controlPanel:o,viewport:r}},setEditorState:async({nodes:e,edges:r,controlPanel:i,viewport:n})=>{let{setGraph:l}=t();await l({nodes:e,edges:r}),await new Promise(e=>setTimeout(e,1e3)),o({controlPanel:i,viewport:n})},isHelpShown:!1,toggleHelp:()=>{let{isHelpShown:e}=t();o({isHelpShown:!e})},copyBuffer:{nodes:[],edges:[]},copy:e=>{o({copyBuffer:e})},copySelectedItems:()=>{let{nodes:e,edges:o,copy:r}=t(),i=e.filter(({selected:e})=>e),n=o.filter(({selected:e})=>e);i.length&&r({nodes:i,edges:n})},pasteBuffer:(e=0,r=0)=>{let{copyBuffer:i,createNodes:n,setEdges:l,nodes:a,edges:s}=t(),{nodes:d,edges:c}=i;if(!d.length)return;o({nodes:a.map(e=>({...e,selected:!1}))});let h=d.reduce((e,o)=>!e||o.position.x<e.position.x&&o.position.y<e.position.y?o:e),p=h.position.x-e,g=h.position.y-r,{nodes:m,mapping:u}=d.reduce((e,o)=>{let t,r=(t=+new Date+Math.floor(1e3*Math.random()),o?.type?`${o.type}-${t}`:t.toString());return{nodes:[...e.nodes,{...o,id:r,position:{x:o.position.x-p,y:o.position.y-g},selected:!0}],mapping:{...e.mapping,[o.id]:r}}},{nodes:[],mapping:{}});n(m);let f=c.map(e=>{let o=u[e.source]||e.source,t=u[e.target]||e.target;return{...e,id:e.id.replace(e.source,o).replace(e.target,t),source:o,target:t,selected:!0}});l([...s.map(e=>({...e,selected:!1})),...f])},getControlPanelNode:e=>{let{nodesConfiguration:o}=t(),{type:r}=e;if(!r)return null;let i=o[r]?.controlPanelNode;return i||(console.error(`could not find node for type ${r}`),null)},controlPanel:{show:!0,nodes:[],size:{width:200,height:100}},showControlPanel:()=>o(({controlPanel:e})=>({controlPanel:{...e,show:!0}})),hideControlPanel:()=>o(({controlPanel:e})=>({controlPanel:{...e,show:!1}})),addNodeToControlPanel:e=>{let{nodesConfiguration:r}=t(),i=e.type?r[e.type]?.defaultConfig:{},{height:n}=i?.size||{},l={id:e.id,...n?{height:n/X.rowHeight}:{}};o(({controlPanel:e})=>({controlPanel:{...e,nodes:[...e.nodes,l]}}))},removeNodeFromControlPanel:e=>t().removeNodesFromControlPanel([e]),removeNodesFromControlPanel:e=>{let t=e.map(({id:e})=>e);o(({controlPanel:e})=>{let o=e.nodes.filter(({id:e})=>!t.includes(e));return{controlPanel:{...e,nodes:o}}})},setControlPanelNodes:e=>{o(({controlPanel:o})=>({controlPanel:{...o,nodes:e}}))},setControlPanelSize:e=>{o(({controlPanel:o})=>({controlPanel:{...o,size:e}}))},viewport:{x:0,y:0,zoom:1},setViewport:e=>o({viewport:e})}},o=(o,t,r)=>{let i,n,l,a=(n=N({propertyFilter:(e,o)=>!!(o.parent?.parent?.childName==="controlPanel"||["data","position","controlPanel"].includes(o.parent?.childName))||["controlPanel","size","edges","nodes","data","label","config","values","position","x","y"].includes(e)}),l=t(),(e,o)=>{e.currentFileIndex!==o.currentFileIndex&&t().history.clear(),clearTimeout(i),l||(l=o),i=setTimeout(()=>{let o=n.diff(l,e);l=null,o&&t().history.push(o)},500)});return r.subscribe(a),e((...e)=>o(...e),t,r)},(e,t,r)=>{r.subscribe(async(e,o)=>{});let i=new Set,n={...t(),nodes:[],edges:[]};return o(async(...o)=>{let r=t(),[l]=o,a={...n,..."function"==typeof l?l({...n}):l},s=Q(n.nodes,a.nodes),d=Q(n.edges,a.edges);n=a;let c=s.added,h=d.added,p=d.removed,g=s.removed,{patch:m}=r;if(c.length){let e=m.registerAudioNodes(c);i.add(e),await e,i.delete(e)}if(!(h.length||p.length||g.length))return void e(...o);if(i.size)try{await Promise.all([...i.values()])}catch(e){console.log("some error",e)}h.length&&m.registerAudioConnections(h),p.length&&m.unregisterAudioConnections(p),g.length&&m.unregisterAudioNodes(g),e(...o)},t,r)})),_`
|
|
26
77
|
.react-flow {
|
|
27
78
|
.react-flow__pane {
|
|
28
79
|
/* background: rgb(106 106 106); */
|
|
29
80
|
/* background: "white"; */
|
|
30
81
|
// background: #292d39;
|
|
31
|
-
background: ${
|
|
82
|
+
background: ${H.colors.elevation3};
|
|
32
83
|
}
|
|
33
84
|
|
|
34
85
|
.react-flow__background {
|
|
@@ -49,28 +100,28 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
49
100
|
}
|
|
50
101
|
|
|
51
102
|
.react-flow__edge-path {
|
|
52
|
-
stroke: ${
|
|
103
|
+
stroke: ${H.colors.accent2};
|
|
53
104
|
}
|
|
54
105
|
|
|
55
106
|
.react-flow__node.selected {
|
|
56
|
-
border: 1px solid ${
|
|
57
|
-
box-shadow: 0 0 0 0.5px #${
|
|
107
|
+
border: 1px solid ${H.colors.accent2};
|
|
108
|
+
box-shadow: 0 0 0 0.5px #${H.colors.accent2};
|
|
58
109
|
}
|
|
59
110
|
|
|
60
111
|
.react-flow__node-default.selected, .react-flow__node-default.selected:hover {
|
|
61
|
-
box-shadow: 0 0 0 0.5px #${
|
|
112
|
+
box-shadow: 0 0 0 0.5px #${H.colors.accent2};
|
|
62
113
|
}
|
|
63
114
|
|
|
64
115
|
/* .react-flow__minimap-mask {
|
|
65
|
-
fill: ${
|
|
116
|
+
fill: ${H.colors.elevation1}
|
|
66
117
|
}
|
|
67
118
|
|
|
68
119
|
.react-flow__minimap-node {
|
|
69
|
-
fill:${
|
|
120
|
+
fill:${H.colors.accent2}
|
|
70
121
|
} */
|
|
71
122
|
}
|
|
72
123
|
|
|
73
|
-
`,i(
|
|
124
|
+
`,i(E)``,i(j)`
|
|
74
125
|
background: ${({colors:e})=>e.elevation2};
|
|
75
126
|
padding: 0;
|
|
76
127
|
border-radius: 0;
|
|
@@ -122,7 +173,7 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
122
173
|
display: flex;
|
|
123
174
|
gap: 0.2rem;
|
|
124
175
|
flex-wrap: wrap;
|
|
125
|
-
`);let
|
|
176
|
+
`);let Z=m(i.span`
|
|
126
177
|
cursor: pointer;
|
|
127
178
|
font-size: 10px;
|
|
128
179
|
background: ${({theme:e,isActive:o})=>o?e.colors.highlight1:e.colors.elevation3};
|
|
@@ -193,7 +244,7 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
193
244
|
color: ${({theme:e})=>e.colors.accent3};
|
|
194
245
|
cursor: pointer;
|
|
195
246
|
}
|
|
196
|
-
`,m(i(
|
|
247
|
+
`,m(i(Z)`
|
|
197
248
|
font-size: 12px;
|
|
198
249
|
padding: 0.2rem 0.4rem;
|
|
199
250
|
&:hover {
|
|
@@ -211,7 +262,7 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
211
262
|
flex-grow: 1;
|
|
212
263
|
height: 100%;
|
|
213
264
|
overflow-y: scroll;
|
|
214
|
-
|
|
265
|
+
`;var ee={};L(ee,"useWorker",()=>eo),L(ee,"useMessageChannel",()=>et);let eo=e=>{let[o,t]=l(null);return n(()=>{let o=new Worker(e);return t(o),()=>{o?.terminate(),t(null)}},[]),o},et=()=>{let[e,o]=l(null);return n(()=>{let e=new MessageChannel;return e.port2.start(),o(e),()=>{o(null),e.port2.close()}},[]),e};var er={};L(er,"setParameterValue",()=>ei),L(er,"fileToBase64",()=>en);let ei=(e,o,t)=>{void 0!==o&&e.setValueAtTime(o,t.currentTime)},en=e=>new Promise((o,t)=>{let r=new FileReader;r.readAsDataURL(e),r.onload=()=>o(r.result?.toString()||""),r.onerror=e=>t(e)});Object.keys(er).forEach(function(e){"default"===e||"__esModule"===e||Object.prototype.hasOwnProperty.call(ee,e)||Object.defineProperty(ee,e,{enumerable:!0,get:function(){return er[e]}})}),i.div`
|
|
215
266
|
display: flex;
|
|
216
267
|
align-items: center;
|
|
217
268
|
justify-content: center;
|
|
@@ -244,83 +295,7 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
244
295
|
justify-content: center;
|
|
245
296
|
height: 100%;
|
|
246
297
|
width: 100%;
|
|
247
|
-
`,i(
|
|
248
|
-
width: 100%;
|
|
249
|
-
height: 8rem;
|
|
250
|
-
`,i.div`
|
|
251
|
-
font-size: 2rem;
|
|
252
|
-
`,i.div`
|
|
253
|
-
display: flex;
|
|
254
|
-
align-items: center;
|
|
255
|
-
justify-content: center;
|
|
256
|
-
height: 100%;
|
|
257
|
-
width: 100%;
|
|
258
|
-
|
|
259
|
-
.drop-zone-wrapper {
|
|
260
|
-
width: 80%;
|
|
261
|
-
height: 80%;
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
.drop-zone {
|
|
265
|
-
height: 100%;
|
|
266
|
-
width: 100%;
|
|
267
|
-
border-style: dashed;
|
|
268
|
-
border-width: 2px;
|
|
269
|
-
border-color: ${({theme:e})=>e.colors.highlight2};
|
|
270
|
-
opacity: 0.5;
|
|
271
|
-
cursor: pointer;
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
.drop-zone:hover,
|
|
275
|
-
.drop-zone-drag-over {
|
|
276
|
-
opacity: 1;
|
|
277
|
-
}
|
|
278
|
-
`,i.div`
|
|
279
|
-
display: flex;
|
|
280
|
-
flex-wrap: wrap;
|
|
281
|
-
align-items: center;
|
|
282
|
-
justify-content: center;
|
|
283
|
-
height: 100%;
|
|
284
|
-
width: 100%;
|
|
285
|
-
`,i(E)`
|
|
286
|
-
width: 100%;
|
|
287
|
-
height: 8rem;
|
|
288
|
-
`,i.div`
|
|
289
|
-
font-size: 2rem;
|
|
290
|
-
`;var et={};T(et,"useWorker",()=>er),T(et,"useMessageChannel",()=>ei);let er=e=>{let[o,t]=l(null);return n(()=>{let o=new Worker(e);return t(o),()=>{o?.terminate(),t(null)}},[]),o},ei=()=>{let[e,o]=l(null);return n(()=>{let e=new MessageChannel;return e.port2.start(),o(e),()=>{o(null),e.port2.close()}},[]),e};var en={};T(en,"setParameterValue",()=>el),T(en,"fileToBase64",()=>ea);let el=(e,o,t)=>{void 0!==o&&e.setValueAtTime(o,t.currentTime)},ea=e=>new Promise((o,t)=>{let r=new FileReader;r.readAsDataURL(e),r.onload=()=>o(r.result?.toString()||""),r.onerror=e=>t(e)});Object.keys(en).forEach(function(e){"default"===e||"__esModule"===e||Object.prototype.hasOwnProperty.call(et,e)||Object.defineProperty(et,e,{enumerable:!0,get:function(){return en[e]}})}),i.div`
|
|
291
|
-
display: flex;
|
|
292
|
-
align-items: center;
|
|
293
|
-
justify-content: center;
|
|
294
|
-
height: 100%;
|
|
295
|
-
width: 100%;
|
|
296
|
-
|
|
297
|
-
.drop-zone-wrapper {
|
|
298
|
-
width: 80%;
|
|
299
|
-
height: 80%;
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
.drop-zone {
|
|
303
|
-
height: 100%;
|
|
304
|
-
width: 100%;
|
|
305
|
-
border-style: dashed;
|
|
306
|
-
border-width: 2px;
|
|
307
|
-
border-color: ${({theme:e})=>e.colors.highlight2};
|
|
308
|
-
opacity: 0.5;
|
|
309
|
-
cursor: pointer;
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
.drop-zone:hover,
|
|
313
|
-
.drop-zone-drag-over {
|
|
314
|
-
opacity: 1;
|
|
315
|
-
}
|
|
316
|
-
`,i.div`
|
|
317
|
-
display: flex;
|
|
318
|
-
flex-wrap: wrap;
|
|
319
|
-
align-items: center;
|
|
320
|
-
justify-content: center;
|
|
321
|
-
height: 100%;
|
|
322
|
-
width: 100%;
|
|
323
|
-
`,i(E)`
|
|
298
|
+
`,i(S)`
|
|
324
299
|
width: 100%;
|
|
325
300
|
height: 8rem;
|
|
326
301
|
`,i.div`
|
|
@@ -382,11 +357,11 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
382
357
|
a {
|
|
383
358
|
color: ${({theme:e})=>e.colors.accent1};
|
|
384
359
|
}
|
|
385
|
-
`);let
|
|
360
|
+
`);let el=i.div`
|
|
386
361
|
background-color: var(--leva-colors-elevation1);
|
|
387
|
-
`;i(
|
|
362
|
+
`;i(el)`
|
|
388
363
|
padding: 2rem 5rem;
|
|
389
|
-
`,i(
|
|
364
|
+
`,i(el)`
|
|
390
365
|
padding: 1rem 2rem;
|
|
391
366
|
`,i(h)`
|
|
392
367
|
font-size: 1.2rem;
|
|
@@ -404,12 +379,12 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
404
379
|
opacity: 1;
|
|
405
380
|
cursor: pointer;
|
|
406
381
|
}
|
|
407
|
-
`;let
|
|
382
|
+
`;let ea=i.div`
|
|
408
383
|
position: relative;
|
|
409
384
|
font-family: var(--leva-fonts-mono);
|
|
410
385
|
font-size: var(--leva-fontSizes-root);
|
|
411
386
|
background-color: var(--leva-colors-elevation1);
|
|
412
|
-
`,
|
|
387
|
+
`,es=i(ea)`
|
|
413
388
|
display: flex;
|
|
414
389
|
height: var(--leva-sizes-titleBarHeight);
|
|
415
390
|
touch-action: none;
|
|
@@ -419,7 +394,7 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
419
394
|
color: var(--leva-colors-highlight1);
|
|
420
395
|
padding: 0 0.4rem;
|
|
421
396
|
gap: 0.3rem;
|
|
422
|
-
`;i(
|
|
397
|
+
`;i(ea)(({theme:e})=>`
|
|
423
398
|
display: grid;
|
|
424
399
|
grid-template-areas: "inputs outputs";
|
|
425
400
|
background: ${e.colors.elevation2};
|
|
@@ -435,22 +410,22 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
435
410
|
`,i.div`
|
|
436
411
|
position: relative;
|
|
437
412
|
padding: 5px 10px;
|
|
438
|
-
`;let
|
|
439
|
-
--port-color: ${e=>{if(!e.portType)return e.theme.colors.highlight2;if(!Array.isArray(e.portType))return
|
|
413
|
+
`;let ed={[M.Audio]:"#4ade80",[M.Gate]:"#c084fc",[M.Number]:"#38bdf8",[M.Any]:"#ffffff"},ec=m(i(y,{shouldForwardProp:e=>"portType"!==e})`
|
|
414
|
+
--port-color: ${e=>{if(!e.portType)return e.theme.colors.highlight2;if(!Array.isArray(e.portType))return ed[e.portType];{let o=e.portType.map(e=>ed[e]);return`linear-gradient(0.25turn, ${o.join(", ")});`}}};
|
|
440
415
|
border-color: var(--port-color);
|
|
441
416
|
background: var(--port-color);
|
|
442
417
|
box-shadow: 0px 0px 0px 1px ${({theme:e})=>e.colors.elevation2} inset;
|
|
443
|
-
`);m(i(
|
|
418
|
+
`);m(i(ec)`
|
|
444
419
|
left: -3px;
|
|
445
|
-
`),m(i(
|
|
420
|
+
`),m(i(ec)`
|
|
446
421
|
right: -3px;
|
|
447
|
-
`);let
|
|
422
|
+
`);let eh=i.div`
|
|
448
423
|
width: 100%;
|
|
449
424
|
padding: 0.4rem 0;
|
|
450
425
|
white-space: nowrap;
|
|
451
426
|
overflow: hidden;
|
|
452
427
|
text-overflow: ellipsis;
|
|
453
|
-
`,
|
|
428
|
+
`,ep=i(({className:e,...o})=>t(es,{...o,className:[e,K].join(" ")}))`
|
|
454
429
|
display: flex;
|
|
455
430
|
gap: 0.1rem;
|
|
456
431
|
padding: 0 0.4rem;
|
|
@@ -458,13 +433,13 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
458
433
|
font-size: 0.6rem;
|
|
459
434
|
height: auto;
|
|
460
435
|
min-width: 0;
|
|
461
|
-
`,
|
|
436
|
+
`,eg=i.div`
|
|
462
437
|
display: flex;
|
|
463
438
|
align-items: center;
|
|
464
439
|
height: 70%;
|
|
465
440
|
width: auto;
|
|
466
441
|
gap: 0.4rem;
|
|
467
|
-
`,
|
|
442
|
+
`,em=i.span`
|
|
468
443
|
width: auto;
|
|
469
444
|
height: 100%;
|
|
470
445
|
cursor: pointer;
|
|
@@ -500,17 +475,17 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
500
475
|
color: ${({theme:e})=>e.colors.highlight2};
|
|
501
476
|
cursor: pointer;
|
|
502
477
|
}
|
|
503
|
-
`,i(
|
|
478
|
+
`,i(eg)`
|
|
504
479
|
height: 80%;
|
|
505
|
-
`,i(
|
|
480
|
+
`,i(em)`
|
|
506
481
|
font-size: 1rem;
|
|
507
482
|
display: flex;
|
|
508
483
|
align-items: center;
|
|
509
|
-
`,i(
|
|
484
|
+
`,i(ep)`
|
|
510
485
|
grid-template-columns: 1fr auto;
|
|
511
486
|
border-bottom: 1px solid ${({theme:e})=>e.colors.elevation3};
|
|
512
487
|
font-size: 0.7rem;
|
|
513
|
-
`,i(
|
|
488
|
+
`,i(eh)`
|
|
514
489
|
text-align: center;
|
|
515
490
|
`,i.div`
|
|
516
491
|
height: 100%;
|
|
@@ -593,10 +568,19 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
593
568
|
`,i.div`
|
|
594
569
|
font-family: var(--leva-fonts-mono);
|
|
595
570
|
font-size: 2rem;
|
|
596
|
-
`,i(
|
|
571
|
+
`,i(F)`
|
|
597
572
|
width: 7rem;
|
|
598
573
|
height: 7rem;
|
|
599
|
-
`,m(i
|
|
574
|
+
`,m(i(x)`
|
|
575
|
+
&.bottom {
|
|
576
|
+
right: 1rem;
|
|
577
|
+
bottom: 40%;
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
svg {
|
|
581
|
+
color: ${({theme:e})=>e.colors.elevation2};
|
|
582
|
+
}
|
|
583
|
+
`),m(i.div`
|
|
600
584
|
display: flex;
|
|
601
585
|
flex-direction: column;
|
|
602
586
|
height: 100%;
|
|
@@ -681,7 +665,7 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
681
665
|
&:hover {
|
|
682
666
|
color: ${({theme:e})=>e.colors.whitePrimary};
|
|
683
667
|
}
|
|
684
|
-
`);let
|
|
668
|
+
`);let eu=i.div`
|
|
685
669
|
display: flex;
|
|
686
670
|
align-items: center;
|
|
687
671
|
justify-content: center;
|
|
@@ -693,10 +677,10 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
693
677
|
content: "";
|
|
694
678
|
background: ${({theme:e})=>e.colors.accent1};
|
|
695
679
|
}
|
|
696
|
-
`,
|
|
680
|
+
`,ef=i.div``,ev=i.div`
|
|
697
681
|
font-size: 0.4rem;
|
|
698
682
|
color: ${({theme:e})=>e.colors.highlight1};
|
|
699
|
-
`,
|
|
683
|
+
`,eb=i.label`
|
|
700
684
|
display: flex;
|
|
701
685
|
cursor: pointer;
|
|
702
686
|
gap: 0.4rem;
|
|
@@ -714,7 +698,7 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
714
698
|
width: 70%;
|
|
715
699
|
height: 70%;
|
|
716
700
|
}
|
|
717
|
-
`,
|
|
701
|
+
`,ew=({label:e,subtitle:o,name:i,type:n="checkbox",onChange:l,checked:a=!1})=>{let s=G();return r(eb,{children:[t("input",{type:n,name:i,checked:a,onChange:({target:e})=>l?.(e.checked)}),t(eu,{className:"checker-box",theme:s}),r("div",{children:[t(ef,{children:e}),o?t(ev,{theme:s,children:o}):null]})]})},ex=i.div`
|
|
718
702
|
display: flex;
|
|
719
703
|
flex-direction: column;
|
|
720
704
|
gap: 0.5rem;
|
|
@@ -722,10 +706,10 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
722
706
|
font-size: 0.7rem;
|
|
723
707
|
color: ${({theme:e})=>e.colors.highlight2};
|
|
724
708
|
padding: 0.5rem;
|
|
725
|
-
`,
|
|
709
|
+
`,ey=({options:e,value:o,onChange:r})=>t(ex,{theme:G(),children:e.map(({value:e,label:i,subtitle:n},l)=>t(ew,{value:o,type:"radio",label:i,subtitle:n,onChange:()=>r(e),checked:e===o},l))}),e$=i.div`
|
|
726
710
|
display: flex;
|
|
727
711
|
position: relative;
|
|
728
|
-
`,
|
|
712
|
+
`,ek=m(i.input`
|
|
729
713
|
padding-right: 2rem;
|
|
730
714
|
padding-left: 0.3rem;
|
|
731
715
|
padding-top: 0;
|
|
@@ -757,7 +741,7 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
757
741
|
-webkit-appearance: none;
|
|
758
742
|
margin-right: 1rem;
|
|
759
743
|
}
|
|
760
|
-
`),
|
|
744
|
+
`),eC=({type:e,value:o,placeholder:r,onChange:i=()=>{},inputProps:n,...l})=>t(e$,{...l,children:t(ek,{type:e,value:o,placeholder:r,onKeyDownCapture:e=>{e.stopPropagation()},onChange:e=>{i(e.target.value)},...n})}),eP=m(i.button`
|
|
761
745
|
position: absolute;
|
|
762
746
|
right: 0;
|
|
763
747
|
height: 100%;
|
|
@@ -775,10 +759,10 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
775
759
|
&:active {
|
|
776
760
|
color: ${({theme:e})=>e.colors.highlight3};
|
|
777
761
|
}
|
|
778
|
-
`),
|
|
762
|
+
`),ez=i.div`
|
|
779
763
|
position: relative;
|
|
780
764
|
width: 100%;
|
|
781
|
-
`,
|
|
765
|
+
`,eN=m(i.div`
|
|
782
766
|
position: absolute;
|
|
783
767
|
top: calc(100% + 2px);
|
|
784
768
|
left: 0;
|
|
@@ -808,7 +792,7 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
808
792
|
&::-webkit-scrollbar-thumb:hover {
|
|
809
793
|
background: ${({theme:e})=>e.colors.highlight1};
|
|
810
794
|
}
|
|
811
|
-
`),
|
|
795
|
+
`),e_=m(i.div`
|
|
812
796
|
padding: 0.4rem 0.5rem;
|
|
813
797
|
cursor: pointer;
|
|
814
798
|
color: ${({theme:e})=>e.colors.highlight1};
|
|
@@ -820,21 +804,21 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
820
804
|
background-color: ${({theme:e})=>e.colors.elevation3};
|
|
821
805
|
color: ${({theme:e})=>e.colors.highlight2};
|
|
822
806
|
}
|
|
823
|
-
`),
|
|
807
|
+
`),eE=i.div`
|
|
824
808
|
font-size: 0.85em;
|
|
825
809
|
opacity: 0.7;
|
|
826
810
|
margin-top: 2px;
|
|
827
811
|
white-space: nowrap;
|
|
828
812
|
overflow: hidden;
|
|
829
813
|
text-overflow: ellipsis;
|
|
830
|
-
`,
|
|
814
|
+
`,ej=i.div`
|
|
831
815
|
font-size: 1em;
|
|
832
816
|
white-space: nowrap;
|
|
833
817
|
overflow: hidden;
|
|
834
818
|
text-overflow: ellipsis;
|
|
835
|
-
`,
|
|
819
|
+
`,eS=({value:e="",placeholder:o="",onSubmit:i=()=>{},options:d=[],...c})=>{let[h,p]=l(e),[g,m]=l(!1),[u,f]=l(-1),v=s(null),b=s(null),w=d.filter(e=>""===h||e.value.toLowerCase().includes(h.toLowerCase())||e.label?.toLowerCase().includes(h.toLowerCase())),x=a(()=>{i(h),m(!1),f(-1)},[h,i]),y=a(e=>{p(e.value),i(e.value),m(!1),f(-1)},[i]),$=a(e=>{switch(e.key){case"Escape":m(!1),f(-1);break;case"Enter":g&&u>=0&&w[u]?(e.preventDefault(),y(w[u])):x();break;case"ArrowDown":e.preventDefault(),g?f(e=>e<w.length-1?e+1:e):(m(!0),f(0));break;case"ArrowUp":e.preventDefault(),g&&f(e=>e>0?e-1:e)}},[x,g,u,w,y]);return n(()=>{let e=e=>{b.current&&!b.current.contains(e.target)&&v.current&&!v.current.contains(e.target)&&(m(!1),f(-1))};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[]),n(()=>{if(u>=0&&b.current){let e=b.current.children[u];e&&e.scrollIntoView({block:"nearest",behavior:"smooth"})}},[u]),r(ez,{children:[r(e$,{children:[t(ek,{...c,ref:v,value:h,placeholder:o,onKeyDown:$,onChange:e=>{p(e.target.value),m(!0),f(-1)},onFocus:()=>{d.length>0&&m(!0)},onBlur:()=>{setTimeout(()=>{m(!1),f(-1)},200)},autoComplete:"off"}),t(eP,{onClick:x,children:t(A,{})})]}),d.length>0&&t(eN,{ref:b,isOpen:g&&w.length>0,children:w.map((e,o)=>r(e_,{isHighlighted:o===u,onClick:()=>y(e),onMouseEnter:()=>f(o),children:[t(ej,{children:e.label||e.value}),e.value&&t(eE,{children:e.value})]},e.value+o))})]})},eF=i(e$)`
|
|
836
820
|
gap: 0.5rem;
|
|
837
|
-
`,
|
|
821
|
+
`,eA=i(ek)`
|
|
838
822
|
padding: 0;
|
|
839
823
|
aspect-ratio: 1 / 1;
|
|
840
824
|
width: auto;
|
|
@@ -846,7 +830,7 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
846
830
|
border-radius: 0.2rem;
|
|
847
831
|
border: none;
|
|
848
832
|
}
|
|
849
|
-
`,
|
|
833
|
+
`,eI=({value:e,onChange:o=()=>{},...i})=>r(eF,{...i,children:[t(eA,{type:"color",value:e,onChange:e=>{o(e.target.value)}}),t(ek,{value:e,onChange:e=>{o(e.target.value)}})]}),eR=i.span`
|
|
850
834
|
position: relative;
|
|
851
835
|
&:after {
|
|
852
836
|
content: "↕";
|
|
@@ -859,7 +843,7 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
859
843
|
font-size: 1.2em;
|
|
860
844
|
color: var(--leva-colors-highlight1);
|
|
861
845
|
}
|
|
862
|
-
`,
|
|
846
|
+
`,eT=i.input`
|
|
863
847
|
width: 100%;
|
|
864
848
|
appearance: textfield;
|
|
865
849
|
font-size: inherit;
|
|
@@ -887,7 +871,7 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
887
871
|
-webkit-appearance: none;
|
|
888
872
|
margin-right: 1rem;
|
|
889
873
|
}
|
|
890
|
-
`,
|
|
874
|
+
`,eL=({max:e=1/0,min:o=-1/0,value:r,step:i=1,onChange:l=()=>{},placeholder:a,...d})=>{let c=s(null),h=I(t=>{if(void 0===r)return;let n=e<10?5:e/100,a=+(r+Math.round(t.deltaY/n)*i).toFixed(2);a<o||a>e||l(a)},100);return n(()=>{c.current&&(c.current.addEventListener("wheel",e=>{e.preventDefault(),e.stopPropagation(),h(e)}),c.current.onchange=e=>{l(+e.target.value)})},[c.current,l]),n(()=>{void 0!==r&&c.current&&(c.current.value=r.toString())},[c.current,r]),t(eR,{...d,children:t(eT,{ref:c,type:"number",step:i,min:o,max:e,placeholder:a})})},eD=i.button`
|
|
891
875
|
display: flex;
|
|
892
876
|
align-items: center;
|
|
893
877
|
justify-content: center;
|
|
@@ -916,7 +900,7 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
916
900
|
${({theme:e})=>e.colors.accent3};
|
|
917
901
|
background-color: ${({theme:e})=>e.colors.accent1};
|
|
918
902
|
}
|
|
919
|
-
`,
|
|
903
|
+
`,eM=m(i.div`
|
|
920
904
|
display: flex;
|
|
921
905
|
align-items: center;
|
|
922
906
|
position: relative;
|
|
@@ -957,7 +941,7 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
957
941
|
background-color: ${({theme:e})=>e.colors.highlight3};
|
|
958
942
|
clip-path: polygon(100% 0%, 0 0%, 50% 100%);
|
|
959
943
|
}
|
|
960
|
-
`),
|
|
944
|
+
`),eO=({options:e,placeholder:o,value:i,onChange:n,...l})=>t(eM,{...l,children:r("select",{value:i||"",onChange:e=>n?.(e.target.value),children:[o&&t("option",{value:"",disabled:!0,children:o}),e.map(({value:e,label:o})=>t("option",{value:e,children:o},e+o))]})}),eH=i(R)`
|
|
961
945
|
padding: 0;
|
|
962
946
|
cursor: pointer;
|
|
963
947
|
position: relative;
|
|
@@ -1083,7 +1067,7 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
1083
1067
|
.rc-slider-mark-text {
|
|
1084
1068
|
font-size: 0.4rem;
|
|
1085
1069
|
}
|
|
1086
|
-
`;class
|
|
1070
|
+
`;class eG extends T{_updateMousePosition(e){let o=this._canvas?.getBoundingClientRect(),t=this._canvas.width/o.width,r=this._canvas.height/o.height;this._mouse={x:(e.clientX-o.left)*t,y:this._height-(e.clientY-o.top)*r}}getPoints(){let e=1/this._width,o=1/this._height;return this._pointCollection._points.map(({x:t,y:r})=>({x:t*e,y:r*o}))}removeAll(){let e=this._pointCollection.getNumberOfPoints();for(let o=e;o>0;o--)this._pointCollection.remove(o-1)}update(e){this.removeAll();let o=this._width,t=this._height;e.forEach(({x:e,y:r})=>{this._pointCollection.add({x:e*o,y:r*t})}),this.draw()}off(e,o){}}let eW=i.div`
|
|
1087
1071
|
height: 100%;
|
|
1088
1072
|
width: 100%;
|
|
1089
1073
|
position: relative;
|
|
@@ -1095,13 +1079,13 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
1095
1079
|
height: 100%;
|
|
1096
1080
|
width: 100%;
|
|
1097
1081
|
}
|
|
1098
|
-
`,
|
|
1082
|
+
`,eB=({onChange:e,onMove:o,points:r,type:i="monotonic",textColor:d="red",curveColor:c=H.colors.accent2,gridStep:h=.25,gridColor:p=H.colors.elevation2,controlPointRadius:g=14,controlPointColor:m=H.colors.vivid1})=>{let u=s(null),[f,v]=l(),b=a(o=>{let t=o.getPoints();e?.(t)},[e]),w=a(e=>{let t=e.getPoints();o?.(t)},[o]);return n(()=>f?.update(r),[f,r]),n(()=>f?.setSplineType(i),[f,i]),n(()=>f?.setGridStep(h),[f,h]),n(()=>f?.setGridColor(p),[f,p]),n(()=>f?.setControlPointRadius(g),[f,g]),n(()=>f?.setTextColor(d),[f,d]),n(()=>{f?.setCurveColor("idle",c)},[f,c]),n(()=>{f?.setControlPointColor("idle",m)},[f,m]),n(()=>{if(f)return f.setCurveThickness(4),f.on("movePoint",w),f.on("releasePoint",b),f.on("pointAdded",b),f.on("pointRemoved",b),f.draw(),()=>{f.off("movePoint",w),f.off("releasePoint",b),f.off("pointAdded",b),f.off("pointRemoved",b)}},[f,b,w]),n(()=>{u.current&&v(new eG(u.current,1024,1024))},[u]),t(eW,{ref:u})},eV=i.div``,eU=i.div`
|
|
1099
1083
|
font-family: var(--leva-fonts-mono);
|
|
1100
1084
|
font-size: 0.7rem;
|
|
1101
1085
|
color: ${({theme:e})=>e.colors.whitePrimary};
|
|
1102
|
-
`,
|
|
1086
|
+
`,eJ=i.div`
|
|
1103
1087
|
border-bottom: 1px solid ${({theme:e})=>e.colors.elevation1};
|
|
1104
|
-
`,
|
|
1088
|
+
`,eK=i.div`
|
|
1105
1089
|
padding: 0.2rem 0.4rem;
|
|
1106
1090
|
font-size: 0.7rem;
|
|
1107
1091
|
color: ${({theme:e})=>e.colors.highlight2};
|
|
@@ -1112,11 +1096,11 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
1112
1096
|
grid-template-columns: ${({oneLineLabels:e})=>e?"1fr":"auto 10rem"};
|
|
1113
1097
|
row-gap: 0.1rem;
|
|
1114
1098
|
column-gap: 0.4rem;
|
|
1115
|
-
`,
|
|
1099
|
+
`,eY=i.div`
|
|
1116
1100
|
display: flex;
|
|
1117
1101
|
flex-direction: column;
|
|
1118
1102
|
gap: 0.4rem;
|
|
1119
1103
|
background: ${({theme:e})=>e.colors.elevation2};
|
|
1120
1104
|
padding: 0.4rem 0.1rem;
|
|
1121
|
-
`,
|
|
1105
|
+
`,eX=i.div``;export{U as Modal,ew as Checker,ey as RadioGroup,eC as Input,eS as DropdownInput,eI as ColorInput,eL as NumberInput,eD as Button,eO as Select,eH as Slider,eB as SplineEditor,eV as ConfigRowLabel,eU as ConfigRowControl,eJ as ConfigRowSeparator,eK as ConfigRow,eY as ConfigPanel,eX as ConfigRowInner};
|
|
1122
1106
|
//# sourceMappingURL=components.js.map
|