@web-noise/core 0.0.19 → 0.0.21
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 +85 -20
- 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/esm/components.js +140 -75
- package/dist/esm/components.js.map +1 -1
- package/dist/esm/constants.js +1 -1
- package/dist/esm/constants.js.map +1 -1
- package/dist/main.js +89 -24
- package/dist/main.js.map +1 -1
- package/dist/module.js +153 -88
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts +21 -12
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/esm/components.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
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{
|
|
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{withTheme as m,useTheme as g}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 x,Controls as w,Handle as y}from"@xyflow/react";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"@xyflow/react/dist/style.css";import{Item as j,Menu as E}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",()=>ey),L(O,"RadioGroup",()=>ek),L(O,"Input",()=>ez),L(O,"DropdownInput",()=>eA),L(O,"ColorInput",()=>eT),L(O,"NumberInput",()=>eM),L(O,"Button",()=>eO),L(O,"Select",()=>eH),L(O,"Slider",()=>eB),L(O,"SplineEditor",()=>eU),L(O,"ConfigRowLabel",()=>eJ),L(O,"ConfigRowControl",()=>eK),L(O,"ConfigRowSeparator",()=>eY),L(O,"ConfigRow",()=>eX),L(O,"ConfigPanel",()=>eq),L(O,"ConfigRowInner",()=>eQ);var G={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}},H=()=>{let e=g();return{...G,...e}};let B=m(i.div`
|
|
2
2
|
position: fixed;
|
|
3
3
|
z-index: ${({theme:e})=>e.zIndex.modal};
|
|
4
4
|
width: 100%;
|
|
5
5
|
height: 100%;
|
|
6
6
|
top: 0;
|
|
7
7
|
left: 0;
|
|
8
|
-
background: ${({theme:e})=>e.colors.elevation3}
|
|
8
|
+
background: ${({theme:e,outerBackground:o})=>o||e.colors.elevation3+"cc"};
|
|
9
9
|
display: flex;
|
|
10
10
|
align-items: center;
|
|
11
11
|
justify-content: center;
|
|
12
|
-
|
|
12
|
+
`),W=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;
|
|
@@ -22,13 +22,13 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
22
22
|
top: 0.2rem;
|
|
23
23
|
right: 0.2rem;
|
|
24
24
|
cursor: pointer;
|
|
25
|
-
`,U=({children:e,onClose:o,...
|
|
25
|
+
`,U=({children:e,onClose:o,outerBackground:i,...l})=>{let a=H();return n(()=>{let e=e=>{"Escape"===e.key&&o?.()};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[o]),d(t(B,{outerBackground:i,onClick:o,children:r(W,{...l,onClick:e=>{e.stopPropagation()},theme:a,children:[e,t(V,{theme:a,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),L(J,"portColors",()=>q);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={[M.Audio]:"#4ade80",[M.Gate]:"#c084fc",[M.Number]:"#38bdf8",[M.Any]:"#ffffff"},Q=e=>JSON.parse(JSON.stringify(e)),Z=(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,data:{label:"unknown",...e.data}}))}))},onEdgesChange:o=>{e(({edges:e})=>({edges:x(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)}))},updateNode:(o,t)=>{e(({nodes:e})=>({nodes:e.map(e=>e.id===o?{...e,...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:[],currentFileIndex:0},setProject(o){e({project:o})},getProject:()=>o().project,pullEditorChanges(){let{getEditorState:e,updateFileContent:t,project:r}=o(),i=r.currentFileIndex||0,n=r.files[i];"audio"!==n.type&&t(i,{...n,file:e()})},syncEditorWithCurrentFile:()=>{let{setEditorState:e,project:t}=o(),r=t.currentFileIndex||0,i=t.files[r];i?"audio"===i.type?console.log("audio file. skipping"):e(i.file):console.warn("No current file to sync with editor")},setCurrentFileIndex(t){let{project:r,getProject:i}=o();t!==(r.currentFileIndex??0)&&e({project:{...r,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(e){let{project:t,setProject:r}=o(),i=[...t.files,e];r({...t,files:i,currentFileIndex:i.length-1})},deleteFile:t=>{let{project:r}=o(),i=r.currentFileIndex??0,n=i===r.files.length-1?Math.max(0,i-1):i,l=r.files.filter((e,o)=>t!==o);e({project:{...r,files:l,currentFileIndex:n}})}}))(...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(({parentId: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,m=h.position.y-r,{nodes:g,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-m},selected:!0}],mapping:{...e.mapping,[o.id]:r}}},{nodes:[],mapping:{}});n(g);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]?.minSize:{height:void 0},n=i?.height,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.project.currentFileIndex!==o.project.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={...t(),nodes:[],edges:[]},n=Promise.resolve();return o((...o)=>{n=n.then(async()=>{let r=t(),[n]=o,l={...i,..."function"==typeof n?n({...i}):n},a=Z(i.nodes,l.nodes),s=Z(i.edges,l.edges);i=l;let d=a.added,c=s.added,h=s.removed,p=a.removed,{patch:m}=r;d.length&&await m.registerAudioNodes(d),c.length&&m.registerAudioConnections(c),h.length&&m.unregisterAudioConnections(h),p.length&&m.unregisterAudioNodes(p),e(...o)}).catch(e=>{console.error("audioPatch middleware error:",e)})},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: ${G.colors.elevation3};
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
.react-flow__background {
|
|
@@ -50,28 +50,28 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
.react-flow__edge-path {
|
|
53
|
-
stroke: ${
|
|
53
|
+
stroke: ${G.colors.accent2};
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
.react-flow__node.selected {
|
|
57
|
-
border: 1px solid ${
|
|
58
|
-
box-shadow: 0 0 0 0.5px #${
|
|
57
|
+
border: 1px solid ${G.colors.accent2};
|
|
58
|
+
box-shadow: 0 0 0 0.5px #${G.colors.accent2};
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
.react-flow__node-default.selected, .react-flow__node-default.selected:hover {
|
|
62
|
-
box-shadow: 0 0 0 0.5px #${
|
|
62
|
+
box-shadow: 0 0 0 0.5px #${G.colors.accent2};
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
/* .react-flow__minimap-mask {
|
|
66
|
-
fill: ${
|
|
66
|
+
fill: ${G.colors.elevation1}
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
.react-flow__minimap-node {
|
|
70
|
-
fill:${
|
|
70
|
+
fill:${G.colors.accent2}
|
|
71
71
|
} */
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
-
`;let
|
|
74
|
+
`;let ee=i(j)``;m(i(ee)`
|
|
75
75
|
.react-contexify__item__content {
|
|
76
76
|
color: ${({theme:e})=>e.colors.error};
|
|
77
77
|
}
|
|
@@ -88,14 +88,14 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
88
88
|
background-color: ${({colors:e})=>e.elevation1};
|
|
89
89
|
margin: 0;
|
|
90
90
|
}
|
|
91
|
-
`,
|
|
91
|
+
`,m(i.div`
|
|
92
92
|
width: 100%;
|
|
93
|
-
`),
|
|
93
|
+
`),m(i.div`
|
|
94
94
|
padding: 1rem;
|
|
95
95
|
display: flex;
|
|
96
96
|
flex-direction: column;
|
|
97
97
|
gap: 1rem;
|
|
98
|
-
`),
|
|
98
|
+
`),m(i.ul`
|
|
99
99
|
list-style: none;
|
|
100
100
|
margin: 0;
|
|
101
101
|
padding: 0;
|
|
@@ -116,18 +116,18 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
116
116
|
cursor: pointer;
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
|
-
`),
|
|
119
|
+
`),m(i.div`
|
|
120
120
|
white-space: nowrap;
|
|
121
121
|
overflow: hidden;
|
|
122
122
|
text-overflow: ellipsis;
|
|
123
|
-
`),
|
|
123
|
+
`),m(i.div`
|
|
124
124
|
color: ${({theme:e})=>e.colors.highlight2};
|
|
125
125
|
font-size: 12px;
|
|
126
|
-
`),
|
|
126
|
+
`),m(i.div`
|
|
127
127
|
display: flex;
|
|
128
128
|
gap: 0.2rem;
|
|
129
129
|
flex-wrap: wrap;
|
|
130
|
-
`);let
|
|
130
|
+
`);let eo=m(i.span`
|
|
131
131
|
cursor: pointer;
|
|
132
132
|
font-size: 10px;
|
|
133
133
|
background: ${({theme:e,isActive:o})=>o?e.colors.highlight1:e.colors.elevation3};
|
|
@@ -138,11 +138,11 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
138
138
|
&:hover {
|
|
139
139
|
border-color: ${({theme:e})=>e.colors.accent2};
|
|
140
140
|
}
|
|
141
|
-
`);
|
|
141
|
+
`);m(i.div``),m(i.div`
|
|
142
142
|
font-size: 1.1rem;
|
|
143
143
|
padding: 0.25rem 0;
|
|
144
144
|
color: ${({theme:e})=>e.colors.highlight3};
|
|
145
|
-
`),
|
|
145
|
+
`),m(i.div`
|
|
146
146
|
color: ${({theme:e})=>e.colors.highlight2};
|
|
147
147
|
font-size: 12px;
|
|
148
148
|
`),i.div`
|
|
@@ -198,7 +198,7 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
198
198
|
color: ${({theme:e})=>e.colors.accent3};
|
|
199
199
|
cursor: pointer;
|
|
200
200
|
}
|
|
201
|
-
`,
|
|
201
|
+
`,m(i(eo)`
|
|
202
202
|
font-size: 12px;
|
|
203
203
|
padding: 0.2rem 0.4rem;
|
|
204
204
|
&:hover {
|
|
@@ -216,7 +216,7 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
216
216
|
flex-grow: 1;
|
|
217
217
|
height: 100%;
|
|
218
218
|
overflow-y: scroll;
|
|
219
|
-
`;var
|
|
219
|
+
`;var et={};L(et,"useWorker",()=>er),L(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={};L(en,"setParameterValue",()=>el),L(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`
|
|
220
220
|
display: flex;
|
|
221
221
|
align-items: center;
|
|
222
222
|
justify-content: center;
|
|
@@ -283,7 +283,7 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
283
283
|
padding: 0.3rem;
|
|
284
284
|
border-radius: 0.2rem;
|
|
285
285
|
}
|
|
286
|
-
`,
|
|
286
|
+
`,m(i.div`
|
|
287
287
|
height: 100%;
|
|
288
288
|
width: 100%;
|
|
289
289
|
overflow: scroll;
|
|
@@ -362,11 +362,15 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
362
362
|
margin-inline-end: 0px;
|
|
363
363
|
unicode-bidi: isolate;
|
|
364
364
|
}
|
|
365
|
-
`);let
|
|
366
|
-
background-color:
|
|
367
|
-
|
|
365
|
+
`);let es=m(i.div`
|
|
366
|
+
background-color: ${({theme:e})=>e.colors.elevation1};
|
|
367
|
+
height: 100%;
|
|
368
|
+
width: 100%;
|
|
369
|
+
display: flex;
|
|
370
|
+
flex-direction: column;
|
|
371
|
+
`);i(es)`
|
|
368
372
|
padding: 2rem 5rem;
|
|
369
|
-
`,i(
|
|
373
|
+
`,i(es)`
|
|
370
374
|
padding: 1rem 2rem;
|
|
371
375
|
`,i(h)`
|
|
372
376
|
font-size: 1.2rem;
|
|
@@ -384,14 +388,16 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
384
388
|
opacity: 1;
|
|
385
389
|
cursor: pointer;
|
|
386
390
|
}
|
|
387
|
-
`;let
|
|
391
|
+
`;let ed=i.div`
|
|
388
392
|
position: relative;
|
|
389
393
|
font-family: var(--leva-fonts-mono);
|
|
390
394
|
font-size: var(--leva-fontSizes-root);
|
|
391
395
|
background-color: var(--leva-colors-elevation1);
|
|
392
|
-
`,
|
|
396
|
+
`,ec=i(ed)`
|
|
393
397
|
display: flex;
|
|
394
|
-
height:
|
|
398
|
+
height: 2rem;
|
|
399
|
+
max-height: 2rem;
|
|
400
|
+
min-height: 2rem;
|
|
395
401
|
touch-action: none;
|
|
396
402
|
align-items: center;
|
|
397
403
|
justify-content: center;
|
|
@@ -399,7 +405,7 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
399
405
|
color: var(--leva-colors-highlight1);
|
|
400
406
|
padding: 0 0.4rem;
|
|
401
407
|
gap: 0.3rem;
|
|
402
|
-
`;i(
|
|
408
|
+
`;i(ed)(({theme:e})=>`
|
|
403
409
|
display: grid;
|
|
404
410
|
grid-template-areas: "inputs outputs";
|
|
405
411
|
background: ${e.colors.elevation2};
|
|
@@ -415,14 +421,24 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
415
421
|
`,i.div`
|
|
416
422
|
position: relative;
|
|
417
423
|
padding: 5px 10px;
|
|
418
|
-
|
|
419
|
-
|
|
424
|
+
`,i.div`
|
|
425
|
+
width: 100%;
|
|
426
|
+
height: 100%;
|
|
427
|
+
display: flex;
|
|
428
|
+
flex-direction: column;
|
|
429
|
+
`,i(U)`
|
|
430
|
+
padding: 1rem;
|
|
431
|
+
max-width: 20rem;
|
|
432
|
+
height: auto;
|
|
433
|
+
max-height: 90%;
|
|
434
|
+
`;let eh=m(i(y,{shouldForwardProp:e=>"portType"!==e})`
|
|
435
|
+
--port-color: ${e=>{if(!e.portType)return e.theme.colors.highlight2;if(!Array.isArray(e.portType))return q[e.portType];{let o=e.portType.map(e=>q[e]);return`linear-gradient(0.25turn, ${o.join(", ")});`}}};
|
|
420
436
|
border-color: var(--port-color);
|
|
421
437
|
background: var(--port-color);
|
|
422
438
|
box-shadow: 0px 0px 0px 1px ${({theme:e})=>e.colors.elevation2} inset;
|
|
423
|
-
`);
|
|
439
|
+
`);m(i(eh)`
|
|
424
440
|
left: 0;
|
|
425
|
-
`),
|
|
441
|
+
`),m(i(eh)`
|
|
426
442
|
right: 0;
|
|
427
443
|
`);let ep=i.div`
|
|
428
444
|
width: 100%;
|
|
@@ -430,7 +446,7 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
430
446
|
white-space: nowrap;
|
|
431
447
|
overflow: hidden;
|
|
432
448
|
text-overflow: ellipsis;
|
|
433
|
-
`,em=i(({className:e,...o})=>t(
|
|
449
|
+
`,em=i(({className:e,...o})=>t(ec,{...o,className:[e,K].join(" ")}))`
|
|
434
450
|
display: flex;
|
|
435
451
|
gap: 0.1rem;
|
|
436
452
|
padding: 0 0.4rem;
|
|
@@ -531,7 +547,7 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
531
547
|
border-color: ${({theme:e})=>e.colors.whitePrimary};
|
|
532
548
|
border-width: 1px;
|
|
533
549
|
}
|
|
534
|
-
`,
|
|
550
|
+
`,m(i.div`
|
|
535
551
|
font-family: var(--leva-fonts-mono);
|
|
536
552
|
font-size: 0.7rem;
|
|
537
553
|
box-sizing: border-box;
|
|
@@ -596,7 +612,7 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
596
612
|
margin-inline-end: 0px;
|
|
597
613
|
unicode-bidi: isolate;
|
|
598
614
|
}
|
|
599
|
-
`),
|
|
615
|
+
`),m(i.div`
|
|
600
616
|
padding: 1rem;
|
|
601
617
|
height: 100%;
|
|
602
618
|
width: 100%;
|
|
@@ -627,7 +643,7 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
627
643
|
`,i(F)`
|
|
628
644
|
width: 7rem;
|
|
629
645
|
height: 7rem;
|
|
630
|
-
`,
|
|
646
|
+
`,m(i(w)`
|
|
631
647
|
&.bottom {
|
|
632
648
|
right: 1rem;
|
|
633
649
|
bottom: 40%;
|
|
@@ -636,12 +652,12 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
636
652
|
svg {
|
|
637
653
|
color: ${({theme:e})=>e.colors.elevation2};
|
|
638
654
|
}
|
|
639
|
-
`),
|
|
655
|
+
`),m(i.div`
|
|
640
656
|
display: flex;
|
|
641
657
|
flex-direction: column;
|
|
642
658
|
height: 100%;
|
|
643
659
|
width: 100%;
|
|
644
|
-
`),
|
|
660
|
+
`),m(i.div`
|
|
645
661
|
position: fixed;
|
|
646
662
|
height: 100%;
|
|
647
663
|
width: 100%;
|
|
@@ -651,18 +667,18 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
651
667
|
justify-content: center;
|
|
652
668
|
align-items: center;
|
|
653
669
|
font-size: 2rem;
|
|
654
|
-
`),
|
|
670
|
+
`),m(i.div`
|
|
655
671
|
height: 100%;
|
|
656
672
|
width: 100%;
|
|
657
673
|
display: flex;
|
|
658
674
|
position: relative;
|
|
659
|
-
`),
|
|
675
|
+
`),m(i.div`
|
|
660
676
|
display: flex;
|
|
661
677
|
flex: 1;
|
|
662
678
|
align-items: center;
|
|
663
679
|
justify-content: center;
|
|
664
680
|
background: ${({theme:e})=>e.colors.elevation3};
|
|
665
|
-
`),
|
|
681
|
+
`),m(i.div`
|
|
666
682
|
background: ${({theme:e})=>e.colors.elevation2};
|
|
667
683
|
opacity: 0.7;
|
|
668
684
|
position: absolute;
|
|
@@ -677,12 +693,12 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
677
693
|
align-items: center;
|
|
678
694
|
justify-content: center;
|
|
679
695
|
font-size: 6rem;
|
|
680
|
-
`),
|
|
696
|
+
`),m(i.div`
|
|
681
697
|
height: 2rem;
|
|
682
698
|
display: flex;
|
|
683
699
|
align-items: center;
|
|
684
700
|
background: ${({theme:e})=>e.colors.elevation2};
|
|
685
|
-
`),
|
|
701
|
+
`),m(i.div`
|
|
686
702
|
display: flex;
|
|
687
703
|
align-items: center;
|
|
688
704
|
cursor: pointer;
|
|
@@ -699,7 +715,7 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
699
715
|
background-color: ${({theme:e})=>e.colors.elevation1};
|
|
700
716
|
}
|
|
701
717
|
}
|
|
702
|
-
`),
|
|
718
|
+
`),m(i.div`
|
|
703
719
|
display: flex;
|
|
704
720
|
align-items: center;
|
|
705
721
|
height: 100%;
|
|
@@ -710,10 +726,10 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
710
726
|
&:hover {
|
|
711
727
|
color: ${({theme:e})=>e.colors.whitePrimary};
|
|
712
728
|
}
|
|
713
|
-
`),
|
|
729
|
+
`),m(i(u)`
|
|
714
730
|
height: 40%;
|
|
715
731
|
width: auto;
|
|
716
|
-
`),
|
|
732
|
+
`),m(i(c)`
|
|
717
733
|
height: 70%;
|
|
718
734
|
width: auto;
|
|
719
735
|
cursor: pointer;
|
|
@@ -724,7 +740,56 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
724
740
|
${({hide:e})=>e?`
|
|
725
741
|
display: none;
|
|
726
742
|
`:""};
|
|
727
|
-
`)
|
|
743
|
+
`),m(i.div`
|
|
744
|
+
height: 100%;
|
|
745
|
+
width: 100%;
|
|
746
|
+
display: flex;
|
|
747
|
+
flex-direction: column;
|
|
748
|
+
overflow: hidden;
|
|
749
|
+
`),i(h)`
|
|
750
|
+
font-size: 1.2rem;
|
|
751
|
+
opacity: 0.4;
|
|
752
|
+
width: 1rem;
|
|
753
|
+
&:hover {
|
|
754
|
+
opacity: 1;
|
|
755
|
+
cursor: pointer;
|
|
756
|
+
}
|
|
757
|
+
`,i(p)`
|
|
758
|
+
font-size: 1.2rem;
|
|
759
|
+
opacity: 0.4;
|
|
760
|
+
width: 1rem;
|
|
761
|
+
&:hover {
|
|
762
|
+
opacity: 1;
|
|
763
|
+
cursor: pointer;
|
|
764
|
+
}
|
|
765
|
+
`;let ef=i.div`
|
|
766
|
+
position: relative;
|
|
767
|
+
font-family: var(--leva-fonts-mono);
|
|
768
|
+
font-size: var(--leva-fontSizes-root);
|
|
769
|
+
background-color: var(--leva-colors-elevation1);
|
|
770
|
+
`;i(ef)`
|
|
771
|
+
display: flex;
|
|
772
|
+
height: 2rem;
|
|
773
|
+
max-height: 2rem;
|
|
774
|
+
min-height: 2rem;
|
|
775
|
+
touch-action: none;
|
|
776
|
+
align-items: center;
|
|
777
|
+
justify-content: space-between;
|
|
778
|
+
flex: 1 1 0%;
|
|
779
|
+
color: var(--leva-colors-highlight1);
|
|
780
|
+
padding: 0 0.4rem;
|
|
781
|
+
gap: 0.3rem;
|
|
782
|
+
`,i.div`
|
|
783
|
+
width: 100%;
|
|
784
|
+
height: 100%;
|
|
785
|
+
display: flex;
|
|
786
|
+
flex-direction: column;
|
|
787
|
+
`,i(U)`
|
|
788
|
+
padding: 1rem;
|
|
789
|
+
max-width: 20rem;
|
|
790
|
+
height: auto;
|
|
791
|
+
max-height: 90%;
|
|
792
|
+
`;let ev=i.div`
|
|
728
793
|
display: flex;
|
|
729
794
|
align-items: center;
|
|
730
795
|
justify-content: center;
|
|
@@ -736,10 +801,10 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
736
801
|
content: "";
|
|
737
802
|
background: ${({theme:e})=>e.colors.accent1};
|
|
738
803
|
}
|
|
739
|
-
`,
|
|
804
|
+
`,eb=i.div``,ex=i.div`
|
|
740
805
|
font-size: 0.4rem;
|
|
741
806
|
color: ${({theme:e})=>e.colors.highlight1};
|
|
742
|
-
`,
|
|
807
|
+
`,ew=i.label`
|
|
743
808
|
display: flex;
|
|
744
809
|
cursor: pointer;
|
|
745
810
|
gap: 0.4rem;
|
|
@@ -757,7 +822,7 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
757
822
|
width: 70%;
|
|
758
823
|
height: 70%;
|
|
759
824
|
}
|
|
760
|
-
`,
|
|
825
|
+
`,ey=({label:e,subtitle:o,name:i,type:n="checkbox",onChange:l,checked:a=!1})=>{let s=H();return r(ew,{children:[t("input",{type:n,name:i,checked:a,onChange:({target:e})=>l?.(e.checked)}),t(ev,{className:"checker-box",theme:s}),r("div",{children:[t(eb,{children:e}),o?t(ex,{theme:s,children:o}):null]})]})},e$=i.div`
|
|
761
826
|
display: flex;
|
|
762
827
|
flex-direction: column;
|
|
763
828
|
gap: 0.5rem;
|
|
@@ -765,10 +830,10 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
765
830
|
font-size: 0.7rem;
|
|
766
831
|
color: ${({theme:e})=>e.colors.highlight2};
|
|
767
832
|
padding: 0.5rem;
|
|
768
|
-
`,
|
|
833
|
+
`,ek=({options:e,value:o,onChange:r})=>t(e$,{theme:H(),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`
|
|
769
834
|
display: flex;
|
|
770
835
|
position: relative;
|
|
771
|
-
`,
|
|
836
|
+
`,eP=m(i.input`
|
|
772
837
|
padding-right: 2rem;
|
|
773
838
|
padding-left: 0.3rem;
|
|
774
839
|
padding-top: 0;
|
|
@@ -800,7 +865,7 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
800
865
|
-webkit-appearance: none;
|
|
801
866
|
margin-right: 1rem;
|
|
802
867
|
}
|
|
803
|
-
`),
|
|
868
|
+
`),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`
|
|
804
869
|
position: absolute;
|
|
805
870
|
right: 0;
|
|
806
871
|
height: 100%;
|
|
@@ -818,10 +883,10 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
818
883
|
&:active {
|
|
819
884
|
color: ${({theme:e})=>e.colors.highlight3};
|
|
820
885
|
}
|
|
821
|
-
`),
|
|
886
|
+
`),e_=i.div`
|
|
822
887
|
position: relative;
|
|
823
888
|
width: 100%;
|
|
824
|
-
`,
|
|
889
|
+
`,ej=m(i.div`
|
|
825
890
|
position: absolute;
|
|
826
891
|
top: calc(100% + 2px);
|
|
827
892
|
left: 0;
|
|
@@ -851,7 +916,7 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
851
916
|
&::-webkit-scrollbar-thumb:hover {
|
|
852
917
|
background: ${({theme:e})=>e.colors.highlight1};
|
|
853
918
|
}
|
|
854
|
-
`),
|
|
919
|
+
`),eE=m(i.div`
|
|
855
920
|
padding: 0.4rem 0.5rem;
|
|
856
921
|
cursor: pointer;
|
|
857
922
|
color: ${({theme:e})=>e.colors.highlight1};
|
|
@@ -863,21 +928,21 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
863
928
|
background-color: ${({theme:e})=>e.colors.elevation3};
|
|
864
929
|
color: ${({theme:e})=>e.colors.highlight2};
|
|
865
930
|
}
|
|
866
|
-
`),
|
|
931
|
+
`),eS=i.div`
|
|
867
932
|
font-size: 0.85em;
|
|
868
933
|
opacity: 0.7;
|
|
869
934
|
margin-top: 2px;
|
|
870
935
|
white-space: nowrap;
|
|
871
936
|
overflow: hidden;
|
|
872
937
|
text-overflow: ellipsis;
|
|
873
|
-
`,
|
|
938
|
+
`,eF=i.div`
|
|
874
939
|
font-size: 1em;
|
|
875
940
|
white-space: nowrap;
|
|
876
941
|
overflow: hidden;
|
|
877
942
|
text-overflow: ellipsis;
|
|
878
|
-
`,
|
|
943
|
+
`,eA=({value:e="",placeholder:o="",onSubmit:i=()=>{},options:d=[],...c})=>{let[h,p]=l(e),[m,g]=l(!1),[u,f]=l(-1),v=s(null),b=s(null),x=d.filter(e=>""===h||e.value.toLowerCase().includes(h.toLowerCase())||e.label?.toLowerCase().includes(h.toLowerCase())),w=a(()=>{i(h),g(!1),f(-1)},[h,i]),y=a(e=>{p(e.value),i(e.value),g(!1),f(-1)},[i]),$=a(e=>{switch(e.key){case"Escape":g(!1),f(-1);break;case"Enter":m&&u>=0&&x[u]?(e.preventDefault(),y(x[u])):w();break;case"ArrowDown":e.preventDefault(),m?f(e=>e<x.length-1?e+1:e):(g(!0),f(0));break;case"ArrowUp":e.preventDefault(),m&&f(e=>e>0?e-1:e)}},[w,m,u,x,y]);return n(()=>{let e=e=>{b.current&&!b.current.contains(e.target)&&v.current&&!v.current.contains(e.target)&&(g(!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),g(!0),f(-1)},onFocus:()=>{d.length>0&&g(!0)},onBlur:()=>{setTimeout(()=>{g(!1),f(-1)},200)},autoComplete:"off"}),t(eN,{onClick:w,children:t(A,{})})]}),d.length>0&&t(ej,{ref:b,isOpen:m&&x.length>0,children:x.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)`
|
|
879
944
|
gap: 0.5rem;
|
|
880
|
-
`,
|
|
945
|
+
`,eR=i(eP)`
|
|
881
946
|
padding: 0;
|
|
882
947
|
aspect-ratio: 1 / 1;
|
|
883
948
|
width: auto;
|
|
@@ -889,7 +954,7 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
889
954
|
border-radius: 0.2rem;
|
|
890
955
|
border: none;
|
|
891
956
|
}
|
|
892
|
-
`,
|
|
957
|
+
`,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`
|
|
893
958
|
position: relative;
|
|
894
959
|
&:after {
|
|
895
960
|
content: "↕";
|
|
@@ -902,7 +967,7 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
902
967
|
font-size: 1.2em;
|
|
903
968
|
color: var(--leva-colors-highlight1);
|
|
904
969
|
}
|
|
905
|
-
`,
|
|
970
|
+
`,eD=i.input`
|
|
906
971
|
width: 100%;
|
|
907
972
|
appearance: textfield;
|
|
908
973
|
font-size: inherit;
|
|
@@ -930,7 +995,7 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
930
995
|
-webkit-appearance: none;
|
|
931
996
|
margin-right: 1rem;
|
|
932
997
|
}
|
|
933
|
-
`,
|
|
998
|
+
`,eM=({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(eL,{...d,children:t(eD,{ref:c,type:"number",step:i,min:o,max:e,placeholder:a})})},eO=i.button`
|
|
934
999
|
display: flex;
|
|
935
1000
|
align-items: center;
|
|
936
1001
|
justify-content: center;
|
|
@@ -959,7 +1024,7 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
959
1024
|
${({theme:e})=>e.colors.accent3};
|
|
960
1025
|
background-color: ${({theme:e})=>e.colors.accent1};
|
|
961
1026
|
}
|
|
962
|
-
`,
|
|
1027
|
+
`,eG=m(i.div`
|
|
963
1028
|
display: flex;
|
|
964
1029
|
align-items: center;
|
|
965
1030
|
position: relative;
|
|
@@ -1000,7 +1065,7 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
1000
1065
|
background-color: ${({theme:e})=>e.colors.highlight3};
|
|
1001
1066
|
clip-path: polygon(100% 0%, 0 0%, 50% 100%);
|
|
1002
1067
|
}
|
|
1003
|
-
`),eH=({options:e,placeholder:o,value:i,onChange:n,...l})=>t(
|
|
1068
|
+
`),eH=({options:e,placeholder:o,value:i,onChange:n,...l})=>t(eG,{...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))]})}),eB=i(R)`
|
|
1004
1069
|
padding: 0;
|
|
1005
1070
|
cursor: pointer;
|
|
1006
1071
|
position: relative;
|
|
@@ -1126,7 +1191,7 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
1126
1191
|
.rc-slider-mark-text {
|
|
1127
1192
|
font-size: 0.4rem;
|
|
1128
1193
|
}
|
|
1129
|
-
`;class eW 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
|
|
1194
|
+
`;class eW 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 eV=i.div`
|
|
1130
1195
|
height: 100%;
|
|
1131
1196
|
width: 100%;
|
|
1132
1197
|
position: relative;
|
|
@@ -1138,13 +1203,13 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
1138
1203
|
height: 100%;
|
|
1139
1204
|
width: 100%;
|
|
1140
1205
|
}
|
|
1141
|
-
`,
|
|
1206
|
+
`,eU=({onChange:e,onMove:o,points:r,type:i="monotonic",textColor:d="red",curveColor:c=G.colors.accent2,gridStep:h=.25,gridColor:p=G.colors.elevation2,controlPointRadius:m=14,controlPointColor:g=G.colors.vivid1})=>{let u=s(null),[f,v]=l(),b=a(o=>{let t=o.getPoints();e?.(t)},[e]),x=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(m),[f,m]),n(()=>f?.setTextColor(d),[f,d]),n(()=>{f?.setCurveColor("idle",c)},[f,c]),n(()=>{f?.setControlPointColor("idle",g)},[f,g]),n(()=>{if(f)return f.setCurveThickness(4),f.on("movePoint",x),f.on("releasePoint",b),f.on("pointAdded",b),f.on("pointRemoved",b),f.draw(),()=>{f.off("movePoint",x),f.off("releasePoint",b),f.off("pointAdded",b),f.off("pointRemoved",b)}},[f,b,x]),n(()=>{u.current&&v(new eW(u.current,1024,1024))},[u]),t(eV,{ref:u})},eJ=i.div``,eK=i.div`
|
|
1142
1207
|
font-family: var(--leva-fonts-mono);
|
|
1143
1208
|
font-size: 0.7rem;
|
|
1144
1209
|
color: ${({theme:e})=>e.colors.whitePrimary};
|
|
1145
|
-
`,eK=i.div`
|
|
1146
|
-
border-bottom: 1px solid ${({theme:e})=>e.colors.elevation1};
|
|
1147
1210
|
`,eY=i.div`
|
|
1211
|
+
border-bottom: 1px solid ${({theme:e})=>e.colors.elevation1};
|
|
1212
|
+
`,eX=i.div`
|
|
1148
1213
|
padding: 0.2rem 0.4rem;
|
|
1149
1214
|
font-size: 0.7rem;
|
|
1150
1215
|
color: ${({theme:e})=>e.colors.highlight2};
|
|
@@ -1155,11 +1220,11 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
1155
1220
|
grid-template-columns: ${({oneLineLabels:e})=>e?"1fr":"auto 10rem"};
|
|
1156
1221
|
row-gap: 0.1rem;
|
|
1157
1222
|
column-gap: 0.4rem;
|
|
1158
|
-
`,
|
|
1223
|
+
`,eq=i.div`
|
|
1159
1224
|
display: flex;
|
|
1160
1225
|
flex-direction: column;
|
|
1161
1226
|
gap: 0.4rem;
|
|
1162
1227
|
background: ${({theme:e})=>e.colors.elevation2};
|
|
1163
1228
|
padding: 0.4rem 0.1rem;
|
|
1164
|
-
`,
|
|
1229
|
+
`,eQ=i.div``;export{U as Modal,ey as Checker,ek as RadioGroup,ez as Input,eA as DropdownInput,eT as ColorInput,eM as NumberInput,eO as Button,eH as Select,eB as Slider,eU as SplineEditor,eJ as ConfigRowLabel,eK as ConfigRowControl,eY as ConfigRowSeparator,eX as ConfigRow,eq as ConfigPanel,eQ as ConfigRowInner};
|
|
1165
1230
|
//# sourceMappingURL=components.js.map
|