@web-noise/core 0.0.12-fix4 → 0.0.13
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 +4 -4
- package/dist/cjs/components.js.map +1 -1
- package/dist/cjs/lib.js +1 -1
- package/dist/cjs/lib.js.map +1 -1
- package/dist/esm/components.js +85 -85
- package/dist/esm/components.js.map +1 -1
- package/dist/esm/lib.js +1 -1
- package/dist/esm/lib.js.map +1 -1
- package/dist/main.js +10 -10
- package/dist/main.js.map +1 -1
- package/dist/module.js +91 -91
- package/dist/module.js.map +1 -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,
|
|
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 d}from"react";import{createPortal as s}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,Handle as x}from"reactflow";import{create as y}from"zustand";import{setAudioNodeTypes as $,createPatch as k}from"@web-noise/patch";import{reverse as C,patch as P,create as z}from"jsondiffpatch";import{injectGlobal as N}from"@emotion/css";import"reactflow/dist/style.css";import{Item as _,Menu as j}from"react-contexify";import"react-contexify/dist/ReactContexify.css";import"js-file-download";import"hotkeys-js";import"react-file-drop";import{FaFileUpload as E,FaVolumeOff as S,FaRegArrowAltCircleRight as F}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 A}from"use-debounce";import I from"rc-slider";import"rc-slider/assets/index.css";import{CanvasSpliner as R}from"CanvasSpliner";function T(e,o,t,r){Object.defineProperty(e,o,{get:t,set:r,enumerable:!0,configurable:!0})}var L,D,M={};T(M,"Modal",()=>W),T(M,"Checker",()=>ey),T(M,"RadioGroup",()=>ek),T(M,"Input",()=>ez),T(M,"DropdownInput",()=>eA),T(M,"ColorInput",()=>eT),T(M,"NumberInput",()=>eM),T(M,"Button",()=>eO),T(M,"Select",()=>eG),T(M,"Slider",()=>eW),T(M,"SplineEditor",()=>eU),T(M,"ConfigRowLabel",()=>eJ),T(M,"ConfigRowControl",()=>eK),T(M,"ConfigRowSeparator",()=>eY),T(M,"ConfigRow",()=>eX),T(M,"ConfigPanel",()=>eq),T(M,"ConfigRowInner",()=>eQ);let O=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
|
+
`,H=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
|
+
`,G=i(c)`
|
|
21
21
|
position: absolute;
|
|
22
22
|
top: 0.2rem;
|
|
23
23
|
right: 0.2rem;
|
|
24
24
|
cursor: pointer;
|
|
25
|
-
`,
|
|
25
|
+
`,W=({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]),s(t(O,{theme:l,onClick:o,children:r(H,{...i,onClick:e=>{e.stopPropagation()},theme:l,children:[e,t(G,{theme:l,onClick:o})]})}),document.body)};var B={};T(B,"DRAG_HANDLE_CLASS",()=>V),T(B,"DRAG_HANDLE_SELECTOR",()=>U),T(B,"CONTROL_PANEL_GRID_CONFIG",()=>J),T(B,"PortType",()=>D);let V="web-noise-drag-handle",U=`.${V}`,J={rowHeight:10,cols:4};(L=D||(D={})).Gate="gate",L.Number="number",L.Audio="audio",L.Any="any";let K=e=>JSON.parse(JSON.stringify(e)),Y=(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))}};y((e=(...e)=>{let[o,t]=e;return{...((e,o)=>({nodes:[],edges:[],onNodesChange:o=>{e(({nodes:e})=>({nodes:b(o,e).map(e=>({dragHandle:U,...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,d=l[a-1];if(!d)return;let s=C(d);s&&e({...P(K({nodes:t,edges:r,controlPanel:i}),s),history:{...n,pointer:a-1,skipCollect:!0}})},forward:()=>{let{nodes:t,edges:r,controlPanel:i,history:n}=o(),{buffer:l,pointer:a}=n,d=l[a];d&&e({...P(K({nodes:t,edges:r,controlPanel:i}),d),history:{...n,pointer:a+1,skipCollect:!0}})},clear:()=>{let{history:t}=o();e({history:{...t,buffer:[],pointer:0,skipCollect:!0}})}}}))(...e),...((e,o)=>({patch:k(),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:i-1})}}))(...e),setGraph:async({nodes:e,edges:o})=>{let{patch:r,createNodes:i,createEdges:n,setNodesAndEdges:l,nodes:a,edges:d}=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(),d=e.map(({id:e})=>e),s=[...e,...i.filter(({parentNode:e})=>e&&d.includes(e))];a(s),l(f(s,r)),n(s);let c=s.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}),{});$(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:d}=t(),{nodes:s,edges:c}=i;if(!s.length)return;o({nodes:a.map(e=>({...e,selected:!1}))});let h=s.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}=s.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([...d.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/J.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=z({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},d=Y(n.nodes,a.nodes),s=Y(n.edges,a.edges);n=a;let c=d.added,h=s.added,p=s.removed,g=d.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)}));var X="#292d39",q="#181c20",Q="#373c4b",Z="#007bff",ee="#14df42";N`
|
|
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: ${Q};
|
|
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: ${Z};
|
|
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 ${Z};
|
|
57
|
+
box-shadow: 0 0 0 0.5px #${Z};
|
|
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 #${Z};
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
/* .react-flow__minimap-mask {
|
|
65
|
-
fill: ${
|
|
65
|
+
fill: ${X}
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
.react-flow__minimap-node {
|
|
69
|
-
fill:${
|
|
69
|
+
fill:${Z}
|
|
70
70
|
} */
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
-
`,i(
|
|
73
|
+
`,i(_)``,i(j)`
|
|
74
74
|
background: ${({colors:e})=>e.elevation2};
|
|
75
75
|
padding: 0;
|
|
76
76
|
border-radius: 0;
|
|
@@ -83,14 +83,14 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
83
83
|
background-color: ${({colors:e})=>e.elevation1};
|
|
84
84
|
margin: 0;
|
|
85
85
|
}
|
|
86
|
-
`,
|
|
86
|
+
`,m(i.div`
|
|
87
87
|
width: 100%;
|
|
88
|
-
`),
|
|
88
|
+
`),m(i.div`
|
|
89
89
|
padding: 1rem;
|
|
90
90
|
display: flex;
|
|
91
91
|
flex-direction: column;
|
|
92
92
|
gap: 1rem;
|
|
93
|
-
`),
|
|
93
|
+
`),m(i.ul`
|
|
94
94
|
list-style: none;
|
|
95
95
|
margin: 0;
|
|
96
96
|
padding: 0;
|
|
@@ -111,18 +111,18 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
111
111
|
cursor: pointer;
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
|
-
`),
|
|
114
|
+
`),m(i.div`
|
|
115
115
|
white-space: nowrap;
|
|
116
116
|
overflow: hidden;
|
|
117
117
|
text-overflow: ellipsis;
|
|
118
|
-
`),
|
|
118
|
+
`),m(i.div`
|
|
119
119
|
color: ${({theme:e})=>e.colors.highlight2};
|
|
120
120
|
font-size: 12px;
|
|
121
|
-
`),
|
|
121
|
+
`),m(i.div`
|
|
122
122
|
display: flex;
|
|
123
123
|
gap: 0.2rem;
|
|
124
124
|
flex-wrap: wrap;
|
|
125
|
-
`);let
|
|
125
|
+
`);let eo=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};
|
|
@@ -133,11 +133,11 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
133
133
|
&:hover {
|
|
134
134
|
border-color: ${({theme:e})=>e.colors.accent2};
|
|
135
135
|
}
|
|
136
|
-
`);
|
|
136
|
+
`);m(i.div``),m(i.div`
|
|
137
137
|
font-size: 1.1rem;
|
|
138
138
|
padding: 0.25rem 0;
|
|
139
139
|
color: ${({theme:e})=>e.colors.highlight3};
|
|
140
|
-
`),
|
|
140
|
+
`),m(i.div`
|
|
141
141
|
color: ${({theme:e})=>e.colors.highlight2};
|
|
142
142
|
font-size: 12px;
|
|
143
143
|
`),i.div`
|
|
@@ -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
|
-
`,
|
|
196
|
+
`,m(i(eo)`
|
|
197
197
|
font-size: 12px;
|
|
198
198
|
padding: 0.2rem 0.4rem;
|
|
199
199
|
&:hover {
|
|
@@ -244,7 +244,7 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
244
244
|
justify-content: center;
|
|
245
245
|
height: 100%;
|
|
246
246
|
width: 100%;
|
|
247
|
-
`,i(
|
|
247
|
+
`,i(E)`
|
|
248
248
|
width: 100%;
|
|
249
249
|
height: 8rem;
|
|
250
250
|
`,i.div`
|
|
@@ -282,12 +282,12 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
282
282
|
justify-content: center;
|
|
283
283
|
height: 100%;
|
|
284
284
|
width: 100%;
|
|
285
|
-
`,i(
|
|
285
|
+
`,i(E)`
|
|
286
286
|
width: 100%;
|
|
287
287
|
height: 8rem;
|
|
288
288
|
`,i.div`
|
|
289
289
|
font-size: 2rem;
|
|
290
|
-
`;var
|
|
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
291
|
display: flex;
|
|
292
292
|
align-items: center;
|
|
293
293
|
justify-content: center;
|
|
@@ -320,7 +320,7 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
320
320
|
justify-content: center;
|
|
321
321
|
height: 100%;
|
|
322
322
|
width: 100%;
|
|
323
|
-
`,i(
|
|
323
|
+
`,i(E)`
|
|
324
324
|
width: 100%;
|
|
325
325
|
height: 8rem;
|
|
326
326
|
`,i.div`
|
|
@@ -354,7 +354,7 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
354
354
|
padding: 0.3rem;
|
|
355
355
|
border-radius: 0.2rem;
|
|
356
356
|
}
|
|
357
|
-
`,
|
|
357
|
+
`,m(i.div`
|
|
358
358
|
height: 100%;
|
|
359
359
|
width: 100%;
|
|
360
360
|
overflow: scroll;
|
|
@@ -382,13 +382,13 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
382
382
|
a {
|
|
383
383
|
color: ${({theme:e})=>e.colors.accent1};
|
|
384
384
|
}
|
|
385
|
-
`);let
|
|
385
|
+
`);let ed=i.div`
|
|
386
386
|
background-color: var(--leva-colors-elevation1);
|
|
387
|
-
`;i(
|
|
387
|
+
`;i(ed)`
|
|
388
388
|
padding: 2rem 5rem;
|
|
389
|
-
`,i(
|
|
389
|
+
`,i(ed)`
|
|
390
390
|
padding: 1rem 2rem;
|
|
391
|
-
`,i(
|
|
391
|
+
`,i(h)`
|
|
392
392
|
font-size: 1.2rem;
|
|
393
393
|
opacity: 0.4;
|
|
394
394
|
width: 1rem;
|
|
@@ -396,7 +396,7 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
396
396
|
opacity: 1;
|
|
397
397
|
cursor: pointer;
|
|
398
398
|
}
|
|
399
|
-
`,i(
|
|
399
|
+
`,i(p)`
|
|
400
400
|
font-size: 1.2rem;
|
|
401
401
|
opacity: 0.4;
|
|
402
402
|
width: 1rem;
|
|
@@ -404,12 +404,12 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
404
404
|
opacity: 1;
|
|
405
405
|
cursor: pointer;
|
|
406
406
|
}
|
|
407
|
-
`;let
|
|
407
|
+
`;let es=i.div`
|
|
408
408
|
position: relative;
|
|
409
409
|
font-family: var(--leva-fonts-mono);
|
|
410
410
|
font-size: var(--leva-fontSizes-root);
|
|
411
411
|
background-color: var(--leva-colors-elevation1);
|
|
412
|
-
`,
|
|
412
|
+
`,ec=i(es)`
|
|
413
413
|
display: flex;
|
|
414
414
|
height: var(--leva-sizes-titleBarHeight);
|
|
415
415
|
touch-action: none;
|
|
@@ -419,7 +419,7 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
419
419
|
color: var(--leva-colors-highlight1);
|
|
420
420
|
padding: 0 0.4rem;
|
|
421
421
|
gap: 0.3rem;
|
|
422
|
-
`;i(
|
|
422
|
+
`;i(es)(({theme:e})=>`
|
|
423
423
|
display: grid;
|
|
424
424
|
grid-template-areas: "inputs outputs";
|
|
425
425
|
background: ${e.colors.elevation2};
|
|
@@ -435,22 +435,22 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
435
435
|
`,i.div`
|
|
436
436
|
position: relative;
|
|
437
437
|
padding: 5px 10px;
|
|
438
|
-
`;let
|
|
439
|
-
--port-color: ${e=>{if(!e.portType)return e.theme.colors.highlight2;if(!Array.isArray(e.portType))return
|
|
438
|
+
`;let eh={[D.Audio]:"#4ade80",[D.Gate]:"#c084fc",[D.Number]:"#38bdf8",[D.Any]:"#ffffff"},ep=m(i(x,{shouldForwardProp:e=>"portType"!==e})`
|
|
439
|
+
--port-color: ${e=>{if(!e.portType)return e.theme.colors.highlight2;if(!Array.isArray(e.portType))return eh[e.portType];{let o=e.portType.map(e=>eh[e]);return`linear-gradient(0.25turn, ${o.join(", ")});`}}};
|
|
440
440
|
border-color: var(--port-color);
|
|
441
441
|
background: var(--port-color);
|
|
442
442
|
box-shadow: 0px 0px 0px 1px ${({theme:e})=>e.colors.elevation2} inset;
|
|
443
|
-
`);
|
|
443
|
+
`);m(i(ep)`
|
|
444
444
|
left: -3px;
|
|
445
|
-
`),
|
|
445
|
+
`),m(i(ep)`
|
|
446
446
|
right: -3px;
|
|
447
|
-
`);let
|
|
447
|
+
`);let eg=i.div`
|
|
448
448
|
width: 100%;
|
|
449
449
|
padding: 0.4rem 0;
|
|
450
450
|
white-space: nowrap;
|
|
451
451
|
overflow: hidden;
|
|
452
452
|
text-overflow: ellipsis;
|
|
453
|
-
`,
|
|
453
|
+
`,em=i(({className:e,...o})=>t(ec,{...o,className:[e,V].join(" ")}))`
|
|
454
454
|
display: flex;
|
|
455
455
|
gap: 0.1rem;
|
|
456
456
|
padding: 0 0.4rem;
|
|
@@ -458,13 +458,13 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
458
458
|
font-size: 0.6rem;
|
|
459
459
|
height: auto;
|
|
460
460
|
min-width: 0;
|
|
461
|
-
`,
|
|
461
|
+
`,eu=i.div`
|
|
462
462
|
display: flex;
|
|
463
463
|
align-items: center;
|
|
464
464
|
height: 70%;
|
|
465
465
|
width: auto;
|
|
466
466
|
gap: 0.4rem;
|
|
467
|
-
`,
|
|
467
|
+
`,ef=i.span`
|
|
468
468
|
width: auto;
|
|
469
469
|
height: 100%;
|
|
470
470
|
cursor: pointer;
|
|
@@ -500,17 +500,17 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
500
500
|
color: ${({theme:e})=>e.colors.highlight2};
|
|
501
501
|
cursor: pointer;
|
|
502
502
|
}
|
|
503
|
-
`,i(
|
|
503
|
+
`,i(eu)`
|
|
504
504
|
height: 80%;
|
|
505
|
-
`,i(
|
|
505
|
+
`,i(ef)`
|
|
506
506
|
font-size: 1rem;
|
|
507
507
|
display: flex;
|
|
508
508
|
align-items: center;
|
|
509
|
-
`,i(
|
|
509
|
+
`,i(em)`
|
|
510
510
|
grid-template-columns: 1fr auto;
|
|
511
511
|
border-bottom: 1px solid ${({theme:e})=>e.colors.elevation3};
|
|
512
512
|
font-size: 0.7rem;
|
|
513
|
-
`,i(
|
|
513
|
+
`,i(eg)`
|
|
514
514
|
text-align: center;
|
|
515
515
|
`,i.div`
|
|
516
516
|
height: 100%;
|
|
@@ -551,7 +551,7 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
551
551
|
border-color: ${({theme:e})=>e.colors.whitePrimary};
|
|
552
552
|
border-width: 1px;
|
|
553
553
|
}
|
|
554
|
-
`,
|
|
554
|
+
`,m(i.div`
|
|
555
555
|
font-family: var(--leva-fonts-mono);
|
|
556
556
|
font-size: 0.7rem;
|
|
557
557
|
box-sizing: border-box;
|
|
@@ -565,7 +565,7 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
565
565
|
color: ${({theme:e})=>e.colors.accent3};
|
|
566
566
|
filter: hue-rotate(180deg);
|
|
567
567
|
}
|
|
568
|
-
`),
|
|
568
|
+
`),m(i.div`
|
|
569
569
|
padding: 1rem;
|
|
570
570
|
height: 100%;
|
|
571
571
|
width: 100%;
|
|
@@ -593,15 +593,15 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
593
593
|
`,i.div`
|
|
594
594
|
font-family: var(--leva-fonts-mono);
|
|
595
595
|
font-size: 2rem;
|
|
596
|
-
`,i(
|
|
596
|
+
`,i(S)`
|
|
597
597
|
width: 7rem;
|
|
598
598
|
height: 7rem;
|
|
599
|
-
`,
|
|
599
|
+
`,m(i.div`
|
|
600
600
|
display: flex;
|
|
601
601
|
flex-direction: column;
|
|
602
602
|
height: 100%;
|
|
603
603
|
width: 100%;
|
|
604
|
-
`),
|
|
604
|
+
`),m(i.div`
|
|
605
605
|
position: fixed;
|
|
606
606
|
height: 100%;
|
|
607
607
|
width: 100%;
|
|
@@ -611,18 +611,18 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
611
611
|
justify-content: center;
|
|
612
612
|
align-items: center;
|
|
613
613
|
font-size: 2rem;
|
|
614
|
-
`),
|
|
614
|
+
`),m(i.div`
|
|
615
615
|
height: 100%;
|
|
616
616
|
width: 100%;
|
|
617
617
|
display: flex;
|
|
618
618
|
position: relative;
|
|
619
|
-
`),
|
|
619
|
+
`),m(i.div`
|
|
620
620
|
display: flex;
|
|
621
621
|
flex: 1;
|
|
622
622
|
align-items: center;
|
|
623
623
|
justify-content: center;
|
|
624
624
|
background: ${({theme:e})=>e.colors.elevation3};
|
|
625
|
-
`),
|
|
625
|
+
`),m(i.div`
|
|
626
626
|
background: ${({theme:e})=>e.colors.elevation2};
|
|
627
627
|
opacity: 0.7;
|
|
628
628
|
position: absolute;
|
|
@@ -637,12 +637,12 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
637
637
|
align-items: center;
|
|
638
638
|
justify-content: center;
|
|
639
639
|
font-size: 6rem;
|
|
640
|
-
`),
|
|
640
|
+
`),m(i.div`
|
|
641
641
|
height: 2rem;
|
|
642
642
|
display: flex;
|
|
643
643
|
align-items: center;
|
|
644
644
|
background: ${({theme:e})=>e.colors.elevation2};
|
|
645
|
-
`),
|
|
645
|
+
`),m(i.div`
|
|
646
646
|
display: flex;
|
|
647
647
|
align-items: center;
|
|
648
648
|
cursor: pointer;
|
|
@@ -659,7 +659,7 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
659
659
|
background-color: ${({theme:e})=>e.colors.elevation1};
|
|
660
660
|
}
|
|
661
661
|
}
|
|
662
|
-
`),
|
|
662
|
+
`),m(i.div`
|
|
663
663
|
display: flex;
|
|
664
664
|
align-items: center;
|
|
665
665
|
height: 100%;
|
|
@@ -670,10 +670,10 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
670
670
|
&:hover {
|
|
671
671
|
color: ${({theme:e})=>e.colors.whitePrimary};
|
|
672
672
|
}
|
|
673
|
-
`),
|
|
673
|
+
`),m(i(u)`
|
|
674
674
|
height: 40%;
|
|
675
675
|
width: auto;
|
|
676
|
-
`),
|
|
676
|
+
`),m(i(c)`
|
|
677
677
|
height: 70%;
|
|
678
678
|
width: auto;
|
|
679
679
|
cursor: pointer;
|
|
@@ -681,7 +681,7 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
681
681
|
&:hover {
|
|
682
682
|
color: ${({theme:e})=>e.colors.whitePrimary};
|
|
683
683
|
}
|
|
684
|
-
`);let
|
|
684
|
+
`);let ev=i.div`
|
|
685
685
|
display: flex;
|
|
686
686
|
align-items: center;
|
|
687
687
|
justify-content: center;
|
|
@@ -693,10 +693,10 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
693
693
|
content: "";
|
|
694
694
|
background: ${({theme:e})=>e.colors.accent1};
|
|
695
695
|
}
|
|
696
|
-
`,
|
|
696
|
+
`,eb=i.div``,ew=i.div`
|
|
697
697
|
font-size: 0.4rem;
|
|
698
698
|
color: ${({theme:e})=>e.colors.highlight1};
|
|
699
|
-
`,
|
|
699
|
+
`,ex=i.label`
|
|
700
700
|
display: flex;
|
|
701
701
|
cursor: pointer;
|
|
702
702
|
gap: 0.4rem;
|
|
@@ -714,7 +714,7 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
714
714
|
width: 70%;
|
|
715
715
|
height: 70%;
|
|
716
716
|
}
|
|
717
|
-
`,
|
|
717
|
+
`,ey=({label:e,subtitle:o,name:i,type:n="checkbox",onChange:l,checked:a=!1})=>{let d=g();return r(ex,{children:[t("input",{type:n,name:i,checked:a,onChange:({target:e})=>l?.(e.checked)}),t(ev,{className:"checker-box",theme:d}),r("div",{children:[t(eb,{children:e}),o?t(ew,{theme:d,children:o}):null]})]})},e$=i.div`
|
|
718
718
|
display: flex;
|
|
719
719
|
flex-direction: column;
|
|
720
720
|
gap: 0.5rem;
|
|
@@ -722,10 +722,10 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
722
722
|
font-size: 0.7rem;
|
|
723
723
|
color: ${({theme:e})=>e.colors.highlight2};
|
|
724
724
|
padding: 0.5rem;
|
|
725
|
-
`,
|
|
725
|
+
`,ek=({options:e,value:o,onChange:r})=>t(e$,{theme:g(),children:e.map(({value:e,label:i,subtitle:n},l)=>t(ey,{value:o,type:"radio",label:i,subtitle:n,onChange:()=>r(e),checked:e===o},l))}),eC=i.div`
|
|
726
726
|
display: flex;
|
|
727
727
|
position: relative;
|
|
728
|
-
`,
|
|
728
|
+
`,eP=m(i.input`
|
|
729
729
|
padding-right: 2rem;
|
|
730
730
|
padding-left: 0.3rem;
|
|
731
731
|
padding-top: 0;
|
|
@@ -757,7 +757,7 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
757
757
|
-webkit-appearance: none;
|
|
758
758
|
margin-right: 1rem;
|
|
759
759
|
}
|
|
760
|
-
`),
|
|
760
|
+
`),ez=({type:e,value:o,placeholder:r,onChange:i=()=>{},inputProps:n,...l})=>t(eC,{...l,children:t(eP,{type:e,value:o,placeholder:r,onKeyDownCapture:e=>{e.stopPropagation()},onChange:e=>{i(e.target.value)},...n})}),eN=m(i.button`
|
|
761
761
|
position: absolute;
|
|
762
762
|
right: 0;
|
|
763
763
|
height: 100%;
|
|
@@ -775,10 +775,10 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
775
775
|
&:active {
|
|
776
776
|
color: ${({theme:e})=>e.colors.highlight3};
|
|
777
777
|
}
|
|
778
|
-
`),
|
|
778
|
+
`),e_=i.div`
|
|
779
779
|
position: relative;
|
|
780
780
|
width: 100%;
|
|
781
|
-
`,
|
|
781
|
+
`,ej=m(i.div`
|
|
782
782
|
position: absolute;
|
|
783
783
|
top: calc(100% + 2px);
|
|
784
784
|
left: 0;
|
|
@@ -808,7 +808,7 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
808
808
|
&::-webkit-scrollbar-thumb:hover {
|
|
809
809
|
background: ${({theme:e})=>e.colors.highlight1};
|
|
810
810
|
}
|
|
811
|
-
`),
|
|
811
|
+
`),eE=m(i.div`
|
|
812
812
|
padding: 0.4rem 0.5rem;
|
|
813
813
|
cursor: pointer;
|
|
814
814
|
color: ${({theme:e})=>e.colors.highlight1};
|
|
@@ -820,21 +820,21 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
820
820
|
background-color: ${({theme:e})=>e.colors.elevation3};
|
|
821
821
|
color: ${({theme:e})=>e.colors.highlight2};
|
|
822
822
|
}
|
|
823
|
-
`),
|
|
823
|
+
`),eS=i.div`
|
|
824
824
|
font-size: 0.85em;
|
|
825
825
|
opacity: 0.7;
|
|
826
826
|
margin-top: 2px;
|
|
827
827
|
white-space: nowrap;
|
|
828
828
|
overflow: hidden;
|
|
829
829
|
text-overflow: ellipsis;
|
|
830
|
-
`,
|
|
830
|
+
`,eF=i.div`
|
|
831
831
|
font-size: 1em;
|
|
832
832
|
white-space: nowrap;
|
|
833
833
|
overflow: hidden;
|
|
834
834
|
text-overflow: ellipsis;
|
|
835
|
-
`,
|
|
835
|
+
`,eA=({value:e="",placeholder:o="",onSubmit:i=()=>{},options:s=[],...c})=>{let[h,p]=l(e),[g,m]=l(!1),[u,f]=l(-1),v=d(null),b=d(null),w=s.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(e_,{children:[r(eC,{children:[t(eP,{...c,ref:v,value:h,placeholder:o,onKeyDown:$,onChange:e=>{p(e.target.value),m(!0),f(-1)},onFocus:()=>{s.length>0&&m(!0)},onBlur:()=>{setTimeout(()=>{m(!1),f(-1)},200)},autoComplete:"off"}),t(eN,{onClick:x,children:t(F,{})})]}),s.length>0&&t(ej,{ref:b,isOpen:g&&w.length>0,children:w.map((e,o)=>r(eE,{isHighlighted:o===u,onClick:()=>y(e),onMouseEnter:()=>f(o),children:[t(eF,{children:e.label||e.value}),e.value&&t(eS,{children:e.value})]},e.value+o))})]})},eI=i(eC)`
|
|
836
836
|
gap: 0.5rem;
|
|
837
|
-
`,
|
|
837
|
+
`,eR=i(eP)`
|
|
838
838
|
padding: 0;
|
|
839
839
|
aspect-ratio: 1 / 1;
|
|
840
840
|
width: auto;
|
|
@@ -846,7 +846,7 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
846
846
|
border-radius: 0.2rem;
|
|
847
847
|
border: none;
|
|
848
848
|
}
|
|
849
|
-
`,
|
|
849
|
+
`,eT=({value:e,onChange:o=()=>{},...i})=>r(eI,{...i,children:[t(eR,{type:"color",value:e,onChange:e=>{o(e.target.value)}}),t(eP,{value:e,onChange:e=>{o(e.target.value)}})]}),eL=i.span`
|
|
850
850
|
position: relative;
|
|
851
851
|
&:after {
|
|
852
852
|
content: "↕";
|
|
@@ -859,7 +859,7 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
859
859
|
font-size: 1.2em;
|
|
860
860
|
color: var(--leva-colors-highlight1);
|
|
861
861
|
}
|
|
862
|
-
`,
|
|
862
|
+
`,eD=i.input`
|
|
863
863
|
width: 100%;
|
|
864
864
|
appearance: textfield;
|
|
865
865
|
font-size: inherit;
|
|
@@ -887,7 +887,7 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
887
887
|
-webkit-appearance: none;
|
|
888
888
|
margin-right: 1rem;
|
|
889
889
|
}
|
|
890
|
-
`,
|
|
890
|
+
`,eM=({max:e=1/0,min:o=-1/0,value:r,step:i=1,onChange:l=()=>{},placeholder:a,...s})=>{let c=d(null),h=A(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(eL,{...s,children:t(eD,{ref:c,type:"number",step:i,min:o,max:e,placeholder:a})})},eO=i.button`
|
|
891
891
|
display: flex;
|
|
892
892
|
align-items: center;
|
|
893
893
|
justify-content: center;
|
|
@@ -916,7 +916,7 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
916
916
|
${({theme:e})=>e.colors.accent3};
|
|
917
917
|
background-color: ${({theme:e})=>e.colors.accent1};
|
|
918
918
|
}
|
|
919
|
-
`,
|
|
919
|
+
`,eH=m(i.div`
|
|
920
920
|
display: flex;
|
|
921
921
|
align-items: center;
|
|
922
922
|
position: relative;
|
|
@@ -957,7 +957,7 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
957
957
|
background-color: ${({theme:e})=>e.colors.highlight3};
|
|
958
958
|
clip-path: polygon(100% 0%, 0 0%, 50% 100%);
|
|
959
959
|
}
|
|
960
|
-
`),
|
|
960
|
+
`),eG=({options:e,placeholder:o,value:i,onChange:n,...l})=>t(eH,{...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))]})}),eW=i(I)`
|
|
961
961
|
padding: 0;
|
|
962
962
|
cursor: pointer;
|
|
963
963
|
position: relative;
|
|
@@ -1083,7 +1083,7 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
1083
1083
|
.rc-slider-mark-text {
|
|
1084
1084
|
font-size: 0.4rem;
|
|
1085
1085
|
}
|
|
1086
|
-
`;class
|
|
1086
|
+
`;class eB extends R{_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 eV=i.div`
|
|
1087
1087
|
height: 100%;
|
|
1088
1088
|
width: 100%;
|
|
1089
1089
|
position: relative;
|
|
@@ -1095,13 +1095,13 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
1095
1095
|
height: 100%;
|
|
1096
1096
|
width: 100%;
|
|
1097
1097
|
}
|
|
1098
|
-
`,
|
|
1098
|
+
`,eU=({onChange:e,onMove:o,points:r,type:i="monotonic",textColor:s="red",curveColor:c=Z,gridStep:h=.25,gridColor:p=q,controlPointRadius:g=14,controlPointColor:m=ee})=>{let u=d(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(s),[f,s]),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 eB(u.current,1024,1024))},[u]),t(eV,{ref:u})},eJ=i.div``,eK=i.div`
|
|
1099
1099
|
font-family: var(--leva-fonts-mono);
|
|
1100
1100
|
font-size: 0.7rem;
|
|
1101
1101
|
color: ${({theme:e})=>e.colors.whitePrimary};
|
|
1102
|
-
`,
|
|
1102
|
+
`,eY=i.div`
|
|
1103
1103
|
border-bottom: 1px solid ${({theme:e})=>e.colors.elevation1};
|
|
1104
|
-
`,
|
|
1104
|
+
`,eX=i.div`
|
|
1105
1105
|
padding: 0.2rem 0.4rem;
|
|
1106
1106
|
font-size: 0.7rem;
|
|
1107
1107
|
color: ${({theme:e})=>e.colors.highlight2};
|
|
@@ -1112,11 +1112,11 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
1112
1112
|
grid-template-columns: ${({oneLineLabels:e})=>e?"1fr":"auto 10rem"};
|
|
1113
1113
|
row-gap: 0.1rem;
|
|
1114
1114
|
column-gap: 0.4rem;
|
|
1115
|
-
`,
|
|
1115
|
+
`,eq=i.div`
|
|
1116
1116
|
display: flex;
|
|
1117
1117
|
flex-direction: column;
|
|
1118
1118
|
gap: 0.4rem;
|
|
1119
1119
|
background: ${({theme:e})=>e.colors.elevation2};
|
|
1120
1120
|
padding: 0.4rem 0.1rem;
|
|
1121
|
-
`,
|
|
1121
|
+
`,eQ=i.div``;export{W as Modal,ey as Checker,ek as RadioGroup,ez as Input,eA as DropdownInput,eT as ColorInput,eM as NumberInput,eO as Button,eG as Select,eW as Slider,eU as SplineEditor,eJ as ConfigRowLabel,eK as ConfigRowControl,eY as ConfigRowSeparator,eX as ConfigRow,eq as ConfigPanel,eQ as ConfigRowInner};
|
|
1122
1122
|
//# sourceMappingURL=components.js.map
|