@web-noise/core 0.0.14 → 0.0.15-alpha.2
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 +119 -84
- package/dist/cjs/components.js.map +1 -1
- package/dist/esm/components.js +172 -137
- package/dist/esm/components.js.map +1 -1
- package/dist/main.js +123 -88
- package/dist/main.js.map +1 -1
- package/dist/module.js +191 -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,18 @@ 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
|
+
`,V=i(c)`
|
|
21
21
|
position: absolute;
|
|
22
22
|
top: 0.2rem;
|
|
23
23
|
right: 0.2rem;
|
|
24
24
|
cursor: pointer;
|
|
25
|
-
`,
|
|
25
|
+
`,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
26
|
.react-flow {
|
|
27
27
|
.react-flow__pane {
|
|
28
28
|
/* background: rgb(106 106 106); */
|
|
29
29
|
/* background: "white"; */
|
|
30
30
|
// background: #292d39;
|
|
31
|
-
background: ${
|
|
31
|
+
background: ${H.colors.elevation3};
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
.react-flow__background {
|
|
@@ -49,28 +49,28 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
.react-flow__edge-path {
|
|
52
|
-
stroke: ${
|
|
52
|
+
stroke: ${H.colors.accent2};
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
.react-flow__node.selected {
|
|
56
|
-
border: 1px solid ${
|
|
57
|
-
box-shadow: 0 0 0 0.5px #${
|
|
56
|
+
border: 1px solid ${H.colors.accent2};
|
|
57
|
+
box-shadow: 0 0 0 0.5px #${H.colors.accent2};
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
.react-flow__node-default.selected, .react-flow__node-default.selected:hover {
|
|
61
|
-
box-shadow: 0 0 0 0.5px #${
|
|
61
|
+
box-shadow: 0 0 0 0.5px #${H.colors.accent2};
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
/* .react-flow__minimap-mask {
|
|
65
|
-
fill: ${
|
|
65
|
+
fill: ${H.colors.elevation1}
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
.react-flow__minimap-node {
|
|
69
|
-
fill:${
|
|
69
|
+
fill:${H.colors.accent2}
|
|
70
70
|
} */
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
-
`,i(
|
|
73
|
+
`,i(E)``,i(j)`
|
|
74
74
|
background: ${({colors:e})=>e.elevation2};
|
|
75
75
|
padding: 0;
|
|
76
76
|
border-radius: 0;
|
|
@@ -122,7 +122,7 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
122
122
|
display: flex;
|
|
123
123
|
gap: 0.2rem;
|
|
124
124
|
flex-wrap: wrap;
|
|
125
|
-
`);let
|
|
125
|
+
`);let Z=m(i.span`
|
|
126
126
|
cursor: pointer;
|
|
127
127
|
font-size: 10px;
|
|
128
128
|
background: ${({theme:e,isActive:o})=>o?e.colors.highlight1:e.colors.elevation3};
|
|
@@ -193,7 +193,7 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
193
193
|
color: ${({theme:e})=>e.colors.accent3};
|
|
194
194
|
cursor: pointer;
|
|
195
195
|
}
|
|
196
|
-
`,m(i(
|
|
196
|
+
`,m(i(Z)`
|
|
197
197
|
font-size: 12px;
|
|
198
198
|
padding: 0.2rem 0.4rem;
|
|
199
199
|
&:hover {
|
|
@@ -211,83 +211,7 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
211
211
|
flex-grow: 1;
|
|
212
212
|
height: 100%;
|
|
213
213
|
overflow-y: scroll;
|
|
214
|
-
|
|
215
|
-
display: flex;
|
|
216
|
-
align-items: center;
|
|
217
|
-
justify-content: center;
|
|
218
|
-
height: 100%;
|
|
219
|
-
width: 100%;
|
|
220
|
-
|
|
221
|
-
.drop-zone-wrapper {
|
|
222
|
-
width: 80%;
|
|
223
|
-
height: 80%;
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
.drop-zone {
|
|
227
|
-
height: 100%;
|
|
228
|
-
width: 100%;
|
|
229
|
-
border-style: dashed;
|
|
230
|
-
border-width: 2px;
|
|
231
|
-
border-color: ${({theme:e})=>e.colors.highlight2};
|
|
232
|
-
opacity: 0.5;
|
|
233
|
-
cursor: pointer;
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
.drop-zone:hover,
|
|
237
|
-
.drop-zone-drag-over {
|
|
238
|
-
opacity: 1;
|
|
239
|
-
}
|
|
240
|
-
`,i.div`
|
|
241
|
-
display: flex;
|
|
242
|
-
flex-wrap: wrap;
|
|
243
|
-
align-items: center;
|
|
244
|
-
justify-content: center;
|
|
245
|
-
height: 100%;
|
|
246
|
-
width: 100%;
|
|
247
|
-
`,i(E)`
|
|
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`
|
|
214
|
+
`;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`
|
|
291
215
|
display: flex;
|
|
292
216
|
align-items: center;
|
|
293
217
|
justify-content: center;
|
|
@@ -320,7 +244,7 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
320
244
|
justify-content: center;
|
|
321
245
|
height: 100%;
|
|
322
246
|
width: 100%;
|
|
323
|
-
`,i(
|
|
247
|
+
`,i(S)`
|
|
324
248
|
width: 100%;
|
|
325
249
|
height: 8rem;
|
|
326
250
|
`,i.div`
|
|
@@ -382,11 +306,62 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
382
306
|
a {
|
|
383
307
|
color: ${({theme:e})=>e.colors.accent1};
|
|
384
308
|
}
|
|
385
|
-
|
|
309
|
+
|
|
310
|
+
h1,
|
|
311
|
+
h2,
|
|
312
|
+
h3,
|
|
313
|
+
h4,
|
|
314
|
+
h5,
|
|
315
|
+
h6 {
|
|
316
|
+
display: block;
|
|
317
|
+
margin-block-start: 1em;
|
|
318
|
+
margin-block-end: 1em;
|
|
319
|
+
margin-inline-start: 0px;
|
|
320
|
+
margin-inline-end: 0px;
|
|
321
|
+
font-weight: bold;
|
|
322
|
+
unicode-bidi: isolate;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
h1 {
|
|
326
|
+
font-size: 2em;
|
|
327
|
+
margin-block-start: 0.67em;
|
|
328
|
+
margin-block-end: 0.67em;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
h2 {
|
|
332
|
+
font-size: 1.5em;
|
|
333
|
+
margin-block-start: 0.83em;
|
|
334
|
+
margin-block-end: 0.83em;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
h3 {
|
|
338
|
+
font-size: 1.17em;
|
|
339
|
+
margin-block-start: 1em;
|
|
340
|
+
margin-block-end: 1em;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
ul {
|
|
344
|
+
display: block;
|
|
345
|
+
list-style-type: disc;
|
|
346
|
+
margin-block-start: 1em;
|
|
347
|
+
margin-block-end: 1em;
|
|
348
|
+
padding-inline-start: 40px;
|
|
349
|
+
unicode-bidi: isolate;
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
p {
|
|
353
|
+
display: block;
|
|
354
|
+
margin-block-start: 1em;
|
|
355
|
+
margin-block-end: 1em;
|
|
356
|
+
margin-inline-start: 0px;
|
|
357
|
+
margin-inline-end: 0px;
|
|
358
|
+
unicode-bidi: isolate;
|
|
359
|
+
}
|
|
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%;
|
|
@@ -565,6 +540,57 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
565
540
|
color: ${({theme:e})=>e.colors.accent3};
|
|
566
541
|
filter: hue-rotate(180deg);
|
|
567
542
|
}
|
|
543
|
+
|
|
544
|
+
h1,
|
|
545
|
+
h2,
|
|
546
|
+
h3,
|
|
547
|
+
h4,
|
|
548
|
+
h5,
|
|
549
|
+
h6 {
|
|
550
|
+
display: block;
|
|
551
|
+
margin-block-start: 1em;
|
|
552
|
+
margin-block-end: 1em;
|
|
553
|
+
margin-inline-start: 0px;
|
|
554
|
+
margin-inline-end: 0px;
|
|
555
|
+
font-weight: bold;
|
|
556
|
+
unicode-bidi: isolate;
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
h1 {
|
|
560
|
+
font-size: 2em;
|
|
561
|
+
margin-block-start: 0.67em;
|
|
562
|
+
margin-block-end: 0.67em;
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
h2 {
|
|
566
|
+
font-size: 1.5em;
|
|
567
|
+
margin-block-start: 0.83em;
|
|
568
|
+
margin-block-end: 0.83em;
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
h3 {
|
|
572
|
+
font-size: 1.17em;
|
|
573
|
+
margin-block-start: 1em;
|
|
574
|
+
margin-block-end: 1em;
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
ul {
|
|
578
|
+
display: block;
|
|
579
|
+
list-style-type: disc;
|
|
580
|
+
margin-block-start: 1em;
|
|
581
|
+
margin-block-end: 1em;
|
|
582
|
+
padding-inline-start: 40px;
|
|
583
|
+
unicode-bidi: isolate;
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
p {
|
|
587
|
+
display: block;
|
|
588
|
+
margin-block-start: 1em;
|
|
589
|
+
margin-block-end: 1em;
|
|
590
|
+
margin-inline-start: 0px;
|
|
591
|
+
margin-inline-end: 0px;
|
|
592
|
+
unicode-bidi: isolate;
|
|
593
|
+
}
|
|
568
594
|
`),m(i.div`
|
|
569
595
|
padding: 1rem;
|
|
570
596
|
height: 100%;
|
|
@@ -593,10 +619,19 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
593
619
|
`,i.div`
|
|
594
620
|
font-family: var(--leva-fonts-mono);
|
|
595
621
|
font-size: 2rem;
|
|
596
|
-
`,i(
|
|
622
|
+
`,i(F)`
|
|
597
623
|
width: 7rem;
|
|
598
624
|
height: 7rem;
|
|
599
|
-
`,m(i
|
|
625
|
+
`,m(i(x)`
|
|
626
|
+
&.bottom {
|
|
627
|
+
right: 1rem;
|
|
628
|
+
bottom: 40%;
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
svg {
|
|
632
|
+
color: ${({theme:e})=>e.colors.elevation2};
|
|
633
|
+
}
|
|
634
|
+
`),m(i.div`
|
|
600
635
|
display: flex;
|
|
601
636
|
flex-direction: column;
|
|
602
637
|
height: 100%;
|
|
@@ -681,7 +716,7 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
681
716
|
&:hover {
|
|
682
717
|
color: ${({theme:e})=>e.colors.whitePrimary};
|
|
683
718
|
}
|
|
684
|
-
`);let
|
|
719
|
+
`);let eu=i.div`
|
|
685
720
|
display: flex;
|
|
686
721
|
align-items: center;
|
|
687
722
|
justify-content: center;
|
|
@@ -693,10 +728,10 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
693
728
|
content: "";
|
|
694
729
|
background: ${({theme:e})=>e.colors.accent1};
|
|
695
730
|
}
|
|
696
|
-
`,
|
|
731
|
+
`,ef=i.div``,ev=i.div`
|
|
697
732
|
font-size: 0.4rem;
|
|
698
733
|
color: ${({theme:e})=>e.colors.highlight1};
|
|
699
|
-
`,
|
|
734
|
+
`,eb=i.label`
|
|
700
735
|
display: flex;
|
|
701
736
|
cursor: pointer;
|
|
702
737
|
gap: 0.4rem;
|
|
@@ -714,7 +749,7 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
714
749
|
width: 70%;
|
|
715
750
|
height: 70%;
|
|
716
751
|
}
|
|
717
|
-
`,
|
|
752
|
+
`,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
753
|
display: flex;
|
|
719
754
|
flex-direction: column;
|
|
720
755
|
gap: 0.5rem;
|
|
@@ -722,10 +757,10 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
722
757
|
font-size: 0.7rem;
|
|
723
758
|
color: ${({theme:e})=>e.colors.highlight2};
|
|
724
759
|
padding: 0.5rem;
|
|
725
|
-
`,
|
|
760
|
+
`,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
761
|
display: flex;
|
|
727
762
|
position: relative;
|
|
728
|
-
`,
|
|
763
|
+
`,ek=m(i.input`
|
|
729
764
|
padding-right: 2rem;
|
|
730
765
|
padding-left: 0.3rem;
|
|
731
766
|
padding-top: 0;
|
|
@@ -757,7 +792,7 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
757
792
|
-webkit-appearance: none;
|
|
758
793
|
margin-right: 1rem;
|
|
759
794
|
}
|
|
760
|
-
`),
|
|
795
|
+
`),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
796
|
position: absolute;
|
|
762
797
|
right: 0;
|
|
763
798
|
height: 100%;
|
|
@@ -775,10 +810,10 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
775
810
|
&:active {
|
|
776
811
|
color: ${({theme:e})=>e.colors.highlight3};
|
|
777
812
|
}
|
|
778
|
-
`),
|
|
813
|
+
`),ez=i.div`
|
|
779
814
|
position: relative;
|
|
780
815
|
width: 100%;
|
|
781
|
-
`,
|
|
816
|
+
`,eN=m(i.div`
|
|
782
817
|
position: absolute;
|
|
783
818
|
top: calc(100% + 2px);
|
|
784
819
|
left: 0;
|
|
@@ -808,7 +843,7 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
808
843
|
&::-webkit-scrollbar-thumb:hover {
|
|
809
844
|
background: ${({theme:e})=>e.colors.highlight1};
|
|
810
845
|
}
|
|
811
|
-
`),
|
|
846
|
+
`),e_=m(i.div`
|
|
812
847
|
padding: 0.4rem 0.5rem;
|
|
813
848
|
cursor: pointer;
|
|
814
849
|
color: ${({theme:e})=>e.colors.highlight1};
|
|
@@ -820,21 +855,21 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
820
855
|
background-color: ${({theme:e})=>e.colors.elevation3};
|
|
821
856
|
color: ${({theme:e})=>e.colors.highlight2};
|
|
822
857
|
}
|
|
823
|
-
`),
|
|
858
|
+
`),eE=i.div`
|
|
824
859
|
font-size: 0.85em;
|
|
825
860
|
opacity: 0.7;
|
|
826
861
|
margin-top: 2px;
|
|
827
862
|
white-space: nowrap;
|
|
828
863
|
overflow: hidden;
|
|
829
864
|
text-overflow: ellipsis;
|
|
830
|
-
`,
|
|
865
|
+
`,ej=i.div`
|
|
831
866
|
font-size: 1em;
|
|
832
867
|
white-space: nowrap;
|
|
833
868
|
overflow: hidden;
|
|
834
869
|
text-overflow: ellipsis;
|
|
835
|
-
`,
|
|
870
|
+
`,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
871
|
gap: 0.5rem;
|
|
837
|
-
`,
|
|
872
|
+
`,eA=i(ek)`
|
|
838
873
|
padding: 0;
|
|
839
874
|
aspect-ratio: 1 / 1;
|
|
840
875
|
width: auto;
|
|
@@ -846,7 +881,7 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
846
881
|
border-radius: 0.2rem;
|
|
847
882
|
border: none;
|
|
848
883
|
}
|
|
849
|
-
`,
|
|
884
|
+
`,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
885
|
position: relative;
|
|
851
886
|
&:after {
|
|
852
887
|
content: "↕";
|
|
@@ -859,7 +894,7 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
859
894
|
font-size: 1.2em;
|
|
860
895
|
color: var(--leva-colors-highlight1);
|
|
861
896
|
}
|
|
862
|
-
`,
|
|
897
|
+
`,eT=i.input`
|
|
863
898
|
width: 100%;
|
|
864
899
|
appearance: textfield;
|
|
865
900
|
font-size: inherit;
|
|
@@ -887,7 +922,7 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
887
922
|
-webkit-appearance: none;
|
|
888
923
|
margin-right: 1rem;
|
|
889
924
|
}
|
|
890
|
-
`,
|
|
925
|
+
`,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
926
|
display: flex;
|
|
892
927
|
align-items: center;
|
|
893
928
|
justify-content: center;
|
|
@@ -916,7 +951,7 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
916
951
|
${({theme:e})=>e.colors.accent3};
|
|
917
952
|
background-color: ${({theme:e})=>e.colors.accent1};
|
|
918
953
|
}
|
|
919
|
-
`,
|
|
954
|
+
`,eM=m(i.div`
|
|
920
955
|
display: flex;
|
|
921
956
|
align-items: center;
|
|
922
957
|
position: relative;
|
|
@@ -957,7 +992,7 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
957
992
|
background-color: ${({theme:e})=>e.colors.highlight3};
|
|
958
993
|
clip-path: polygon(100% 0%, 0 0%, 50% 100%);
|
|
959
994
|
}
|
|
960
|
-
`),
|
|
995
|
+
`),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
996
|
padding: 0;
|
|
962
997
|
cursor: pointer;
|
|
963
998
|
position: relative;
|
|
@@ -1083,7 +1118,7 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
1083
1118
|
.rc-slider-mark-text {
|
|
1084
1119
|
font-size: 0.4rem;
|
|
1085
1120
|
}
|
|
1086
|
-
`;class
|
|
1121
|
+
`;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
1122
|
height: 100%;
|
|
1088
1123
|
width: 100%;
|
|
1089
1124
|
position: relative;
|
|
@@ -1095,13 +1130,13 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
1095
1130
|
height: 100%;
|
|
1096
1131
|
width: 100%;
|
|
1097
1132
|
}
|
|
1098
|
-
`,
|
|
1133
|
+
`,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
1134
|
font-family: var(--leva-fonts-mono);
|
|
1100
1135
|
font-size: 0.7rem;
|
|
1101
1136
|
color: ${({theme:e})=>e.colors.whitePrimary};
|
|
1102
|
-
`,
|
|
1137
|
+
`,eJ=i.div`
|
|
1103
1138
|
border-bottom: 1px solid ${({theme:e})=>e.colors.elevation1};
|
|
1104
|
-
`,
|
|
1139
|
+
`,eK=i.div`
|
|
1105
1140
|
padding: 0.2rem 0.4rem;
|
|
1106
1141
|
font-size: 0.7rem;
|
|
1107
1142
|
color: ${({theme:e})=>e.colors.highlight2};
|
|
@@ -1112,11 +1147,11 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
1112
1147
|
grid-template-columns: ${({oneLineLabels:e})=>e?"1fr":"auto 10rem"};
|
|
1113
1148
|
row-gap: 0.1rem;
|
|
1114
1149
|
column-gap: 0.4rem;
|
|
1115
|
-
`,
|
|
1150
|
+
`,eY=i.div`
|
|
1116
1151
|
display: flex;
|
|
1117
1152
|
flex-direction: column;
|
|
1118
1153
|
gap: 0.4rem;
|
|
1119
1154
|
background: ${({theme:e})=>e.colors.elevation2};
|
|
1120
1155
|
padding: 0.4rem 0.1rem;
|
|
1121
|
-
`,
|
|
1156
|
+
`,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
1157
|
//# sourceMappingURL=components.js.map
|