@web-noise/core 0.0.11 → 0.0.12-fix2
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 +28 -28
- package/dist/cjs/components.js.map +1 -1
- package/dist/cjs/constants.js +1 -1
- package/dist/cjs/constants.js.map +1 -1
- package/dist/cjs/lib.js +1 -1
- package/dist/cjs/lib.js.map +1 -1
- package/dist/esm/components.js +54 -54
- 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 +19 -19
- 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,useCallback as a,useRef as d}from"react";import{createPortal 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 d,version as s}from"react";import{createPortal as c}from"react-dom";import{MdClose as h,MdSettings as p,MdInfoOutline as g}from"react-icons/md";import{useTheme as m,withTheme as f}from"@emotion/react";import"nanoid";import{FaPlus as u}from"react-icons/fa6";import"@web-noise/fetch";import{getConnectedEdges as v,addEdge as b,applyNodeChanges as w,applyEdgeChanges 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 z,patch as P,create as N}from"jsondiffpatch";import{injectGlobal as j}from"@emotion/css";import"reactflow/dist/style.css";import{Item as _,Menu as E}from"react-contexify";import"react-contexify/dist/ReactContexify.css";import"js-file-download";import"hotkeys-js";import"react-file-drop";import{FaFileUpload as S,FaVolumeOff as F,FaRegArrowAltCircleRight as I}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 R from"rc-slider";import"rc-slider/assets/index.css";import{CanvasSpliner as T}from"CanvasSpliner";function M(e,o,t,r){Object.defineProperty(e,o,{get:t,set:r,enumerable:!0,configurable:!0})}var L,D,H={};M(H,"Modal",()=>B),M(H,"Checker",()=>em),M(H,"RadioGroup",()=>eu),M(H,"Input",()=>ew),M(H,"DropdownInput",()=>eP),M(H,"ColorInput",()=>e_),M(H,"NumberInput",()=>eF),M(H,"Button",()=>eI),M(H,"Select",()=>eR),M(H,"Slider",()=>eT),M(H,"SplineEditor",()=>eD),M(H,"ConfigRowLabel",()=>eH),M(H,"ConfigRowControl",()=>eG),M(H,"ConfigRowSeparator",()=>eO),M(H,"ConfigRow",()=>eW),M(H,"ConfigPanel",()=>eB),M(H,"ConfigRowInner",()=>eV);let G=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
|
+
`,O=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,12 +17,12 @@ 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
|
-
`,W=i(
|
|
20
|
+
`,W=i(h)`
|
|
21
21
|
position: absolute;
|
|
22
22
|
top: 0.2rem;
|
|
23
23
|
right: 0.2rem;
|
|
24
24
|
cursor: pointer;
|
|
25
|
-
|
|
25
|
+
`,B=({children:e,onClose:o,...i})=>{let l=m();return n(()=>{let e=e=>{"Escape"===e.key&&o?.()};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[o]),c(t(G,{theme:l,onClick:o,children:r(O,{...i,onClick:e=>{e.stopPropagation()},theme:l,children:[e,t(W,{theme:l,onClick:o})]})}),document.body)},V="web-noise-drag-handle",J=`.${V}`;(L=D||(D={})).Gate="gate",L.Number="number",L.Audio="audio",L.Any="any";let K=e=>JSON.parse(JSON.stringify(e)),U=(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:w(o,e).map(e=>({dragHandle:J,...e}))}))},onEdgesChange:o=>{e(({edges:e})=>({edges:x(o,e)}))},onConnect:o=>{e(({edges:e})=>({edges:b(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=z(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: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: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(v(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(b(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: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:f}=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 u=c.map(e=>{let o=f[e.source]||e.source,t=f[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})),...u])},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/10}:{}};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},d=U(n.nodes,a.nodes),s=U(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 Y="#292d39",X="#181c20",q="#373c4b",Q="#007bff",Z="#14df42";j`
|
|
26
26
|
.react-flow {
|
|
27
27
|
.react-flow__pane {
|
|
28
28
|
/* background: rgb(106 106 106); */
|
|
@@ -70,7 +70,7 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
70
70
|
} */
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
-
`,i(
|
|
73
|
+
`,i(_)``,i(E)`
|
|
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
|
+
`,f(i.div`
|
|
87
87
|
width: 100%;
|
|
88
|
-
`),
|
|
88
|
+
`),f(i.div`
|
|
89
89
|
padding: 1rem;
|
|
90
90
|
display: flex;
|
|
91
91
|
flex-direction: column;
|
|
92
92
|
gap: 1rem;
|
|
93
|
-
`),
|
|
93
|
+
`),f(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
|
+
`),f(i.div`
|
|
115
115
|
white-space: nowrap;
|
|
116
116
|
overflow: hidden;
|
|
117
117
|
text-overflow: ellipsis;
|
|
118
|
-
`),
|
|
118
|
+
`),f(i.div`
|
|
119
119
|
color: ${({theme:e})=>e.colors.highlight2};
|
|
120
120
|
font-size: 12px;
|
|
121
|
-
`),
|
|
121
|
+
`),f(i.div`
|
|
122
122
|
display: flex;
|
|
123
123
|
gap: 0.2rem;
|
|
124
124
|
flex-wrap: wrap;
|
|
125
|
-
`);let ee=
|
|
125
|
+
`);let ee=f(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
|
+
`);f(i.div``),f(i.div`
|
|
137
137
|
font-size: 1.1rem;
|
|
138
138
|
padding: 0.25rem 0;
|
|
139
139
|
color: ${({theme:e})=>e.colors.highlight3};
|
|
140
|
-
`),
|
|
140
|
+
`),f(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
|
+
`,f(i(ee)`
|
|
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(S)`
|
|
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(S)`
|
|
286
286
|
width: 100%;
|
|
287
287
|
height: 8rem;
|
|
288
288
|
`,i.div`
|
|
289
289
|
font-size: 2rem;
|
|
290
|
-
`,i.div`
|
|
290
|
+
`,console.log(888888,`React version: ${s}`),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(S)`
|
|
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
|
+
`,f(i.div`
|
|
358
358
|
height: 100%;
|
|
359
359
|
width: 100%;
|
|
360
360
|
overflow: scroll;
|
|
@@ -388,7 +388,7 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
388
388
|
padding: 2rem 5rem;
|
|
389
389
|
`,i(eo)`
|
|
390
390
|
padding: 1rem 2rem;
|
|
391
|
-
`,i(
|
|
391
|
+
`,i(p)`
|
|
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(g)`
|
|
400
400
|
font-size: 1.2rem;
|
|
401
401
|
opacity: 0.4;
|
|
402
402
|
width: 1rem;
|
|
@@ -435,14 +435,14 @@ 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 ei={[
|
|
438
|
+
`;let ei={[D.Audio]:"#4ade80",[D.Gate]:"#c084fc",[D.Number]:"#38bdf8",[D.Any]:"#ffffff"},en=f(i(y,{shouldForwardProp:e=>"portType"!==e})`
|
|
439
439
|
--port-color: ${e=>{if(!e.portType)return e.theme.colors.highlight2;if(!Array.isArray(e.portType))return ei[e.portType];{let o=e.portType.map(e=>ei[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
|
+
`);f(i(en)`
|
|
444
444
|
left: -3px;
|
|
445
|
-
`),
|
|
445
|
+
`),f(i(en)`
|
|
446
446
|
right: -3px;
|
|
447
447
|
`);let el=i.div`
|
|
448
448
|
width: 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
|
+
`,f(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
|
+
`),f(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(F)`
|
|
597
597
|
width: 7rem;
|
|
598
598
|
height: 7rem;
|
|
599
|
-
`,
|
|
599
|
+
`,f(i.div`
|
|
600
600
|
display: flex;
|
|
601
601
|
flex-direction: column;
|
|
602
602
|
height: 100%;
|
|
603
603
|
width: 100%;
|
|
604
|
-
`),
|
|
604
|
+
`),f(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
|
+
`),f(i.div`
|
|
615
615
|
height: 100%;
|
|
616
616
|
width: 100%;
|
|
617
617
|
display: flex;
|
|
618
618
|
position: relative;
|
|
619
|
-
`),
|
|
619
|
+
`),f(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
|
+
`),f(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
|
+
`),f(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
|
+
`),f(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
|
+
`),f(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
|
+
`),f(i(u)`
|
|
674
674
|
height: 40%;
|
|
675
675
|
width: auto;
|
|
676
|
-
`),
|
|
676
|
+
`),f(i(h)`
|
|
677
677
|
height: 70%;
|
|
678
678
|
width: auto;
|
|
679
679
|
cursor: pointer;
|
|
@@ -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
|
+
`,em=({label:e,subtitle:o,name:i,type:n="checkbox",onChange:l,checked:a=!1})=>{let d=m();return r(eg,{children:[t("input",{type:n,name:i,checked:a,onChange:({target:e})=>l?.(e.checked)}),t(ec,{className:"checker-box",theme:d}),r("div",{children:[t(eh,{children:e}),o?t(ep,{theme:d,children:o}):null]})]})},ef=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
|
+
`,eu=({options:e,value:o,onChange:r})=>t(ef,{theme:m(),children:e.map(({value:e,label:i,subtitle:n},l)=>t(em,{value:o,type:"radio",label:i,subtitle:n,onChange:()=>r(e),checked:e===o},l))}),ev=i.div`
|
|
726
726
|
display: flex;
|
|
727
727
|
position: relative;
|
|
728
|
-
`,eb=
|
|
728
|
+
`,eb=f(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
|
+
`),ew=({type:e,value:o,placeholder:r,onChange:i=()=>{},inputProps:n,...l})=>t(ev,{...l,children:t(eb,{type:e,value:o,placeholder:r,onKeyDownCapture:e=>{e.stopPropagation()},onChange:e=>{i(e.target.value)},...n})}),ex=f(i.button`
|
|
761
761
|
position: absolute;
|
|
762
762
|
right: 0;
|
|
763
763
|
height: 100%;
|
|
@@ -778,7 +778,7 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
778
778
|
`),ey=i.div`
|
|
779
779
|
position: relative;
|
|
780
780
|
width: 100%;
|
|
781
|
-
`,e$=
|
|
781
|
+
`,e$=f(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
|
-
`),ek=
|
|
811
|
+
`),ek=f(i.div`
|
|
812
812
|
padding: 0.4rem 0.5rem;
|
|
813
813
|
cursor: pointer;
|
|
814
814
|
color: ${({theme:e})=>e.colors.highlight1};
|
|
@@ -832,7 +832,7 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
832
832
|
white-space: nowrap;
|
|
833
833
|
overflow: hidden;
|
|
834
834
|
text-overflow: ellipsis;
|
|
835
|
-
|
|
835
|
+
`,eP=({value:e="",placeholder:o="",onSubmit:i=()=>{},options:s=[],...c})=>{let[h,p]=l(e),[g,m]=l(!1),[f,u]=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),u(-1)},[h,i]),y=a(e=>{p(e.value),i(e.value),m(!1),u(-1)},[i]),$=a(e=>{switch(e.key){case"Escape":m(!1),u(-1);break;case"Enter":g&&f>=0&&w[f]?(e.preventDefault(),y(w[f])):x();break;case"ArrowDown":e.preventDefault(),g?u(e=>e<w.length-1?e+1:e):(m(!0),u(0));break;case"ArrowUp":e.preventDefault(),g&&u(e=>e>0?e-1:e)}},[x,g,f,w,y]);return n(()=>{let e=e=>{b.current&&!b.current.contains(e.target)&&v.current&&!v.current.contains(e.target)&&(m(!1),u(-1))};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[]),n(()=>{if(f>=0&&b.current){let e=b.current.children[f];e&&e.scrollIntoView({block:"nearest",behavior:"smooth"})}},[f]),r(ey,{children:[r(ev,{children:[t(eb,{...c,ref:v,value:h,placeholder:o,onKeyDown:$,onChange:e=>{p(e.target.value),m(!0),u(-1)},onFocus:()=>{s.length>0&&m(!0)},onBlur:()=>{setTimeout(()=>{m(!1),u(-1)},200)},autoComplete:"off"}),t(ex,{onClick:x,children:t(I,{})})]}),s.length>0&&t(e$,{ref:b,isOpen:g&&w.length>0,children:w.map((e,o)=>r(ek,{isHighlighted:o===f,onClick:()=>y(e),onMouseEnter:()=>u(o),children:[t(ez,{children:e.label||e.value}),e.value&&t(eC,{children:e.value})]},e.value+o))})]})},eN=i(ev)`
|
|
836
836
|
gap: 0.5rem;
|
|
837
837
|
`,ej=i(eb)`
|
|
838
838
|
padding: 0;
|
|
@@ -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
|
+
`,e_=({value:e,onChange:o=()=>{},...i})=>r(eN,{...i,children:[t(ej,{type:"color",value:e,onChange:e=>{o(e.target.value)}}),t(eb,{value:e,onChange:e=>{o(e.target.value)}})]}),eE=i.span`
|
|
850
850
|
position: relative;
|
|
851
851
|
&:after {
|
|
852
852
|
content: "↕";
|
|
@@ -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
|
+
`,eF=({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(eE,{...s,children:t(eS,{ref:c,type:"number",step:i,min:o,max:e,placeholder:a})})},eI=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
|
+
`,eA=f(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
|
+
`),eR=({options:e,placeholder:o,value:i,onChange:n,...l})=>t(eA,{...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))]})}),eT=i(R)`
|
|
961
961
|
padding: 0;
|
|
962
962
|
cursor: pointer;
|
|
963
963
|
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
|
+
`,eD=({onChange:e,onMove:o,points:r,type:i="monotonic",textColor:s="red",curveColor:c=Q,gridStep:h=.25,gridColor:p=X,controlPointRadius:g=14,controlPointColor:m=Z})=>{let f=d(null),[u,v]=l(),b=a(o=>{let t=o.getPoints();e?.(t)},[e]),w=a(e=>{let t=e.getPoints();o?.(t)},[o]);return n(()=>u?.update(r),[u,r]),n(()=>u?.setSplineType(i),[u,i]),n(()=>u?.setGridStep(h),[u,h]),n(()=>u?.setGridColor(p),[u,p]),n(()=>u?.setControlPointRadius(g),[u,g]),n(()=>u?.setTextColor(s),[u,s]),n(()=>{u?.setCurveColor("idle",c)},[u,c]),n(()=>{u?.setControlPointColor("idle",m)},[u,m]),n(()=>{if(u)return u.setCurveThickness(4),u.on("movePoint",w),u.on("releasePoint",b),u.on("pointAdded",b),u.on("pointRemoved",b),u.draw(),()=>{u.off("movePoint",w),u.off("releasePoint",b),u.off("pointAdded",b),u.off("pointRemoved",b)}},[u,b,w]),n(()=>{f.current&&v(new eM(f.current,1024,1024))},[f]),t(eL,{ref:f})},eH=i.div``,eG=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
|
+
`,eO=i.div`
|
|
1103
1103
|
border-bottom: 1px solid ${({theme:e})=>e.colors.elevation1};
|
|
1104
|
-
`,
|
|
1104
|
+
`,eW=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
|
+
`,eB=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
|
+
`,eV=i.div``;export{B as Modal,em as Checker,eu as RadioGroup,ew as Input,eP as DropdownInput,e_ as ColorInput,eF as NumberInput,eI as Button,eR as Select,eT as Slider,eD as SplineEditor,eH as ConfigRowLabel,eG as ConfigRowControl,eO as ConfigRowSeparator,eW as ConfigRow,eB as ConfigPanel,eV as ConfigRowInner};
|
|
1122
1122
|
//# sourceMappingURL=components.js.map
|