@web-noise/core 0.0.18 → 0.0.20
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 +35 -16
- 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 +83 -64
- 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 +36 -17
- package/dist/main.js.map +1 -1
- package/dist/module.js +107 -88
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts +17 -13
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/cjs/constants.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
function $parcel$exportWildcard(e,c){return Object.keys(c).forEach(function(b){"default"===b||"__esModule"===b||Object.prototype.hasOwnProperty.call(e,b)||Object.defineProperty(e,b,{enumerable:!0,get:function(){return c[b]}})}),e}function $parcel$export(e,c,b,$){Object.defineProperty(e,c,{get:b,set:$,enumerable:!0,configurable:!0})}var $9cc889581bce45fb$export$b0b7b95ee465c83c,$9cc889581bce45fb$exports={};$parcel$export($9cc889581bce45fb$exports,"DRAG_HANDLE_CLASS",()=>$9cc889581bce45fb$export$956b3cf15d7c363),$parcel$export($9cc889581bce45fb$exports,"DRAG_HANDLE_SELECTOR",()=>$9cc889581bce45fb$export$21d634b1d5d9bee3),$parcel$export($9cc889581bce45fb$exports,"CONTROL_PANEL_GRID_CONFIG",()=>$9cc889581bce45fb$export$9f05d3e6ade4c09e),$parcel$export($9cc889581bce45fb$exports,"PortType",()=>$9cc889581bce45fb$export$b0b7b95ee465c83c);const $9cc889581bce45fb$export$956b3cf15d7c363="web-noise-drag-handle",$9cc889581bce45fb$export$21d634b1d5d9bee3=`.${$9cc889581bce45fb$export$956b3cf15d7c363}`,$9cc889581bce45fb$export$9f05d3e6ade4c09e={rowHeight:10,cols:4};!function(e){e.Gate="gate",e.Number="number",e.Audio="audio",e.Any="any"}($9cc889581bce45fb$export$b0b7b95ee465c83c||($9cc889581bce45fb$export$b0b7b95ee465c83c={}))
|
|
1
|
+
function $parcel$exportWildcard(e,c){return Object.keys(c).forEach(function(b){"default"===b||"__esModule"===b||Object.prototype.hasOwnProperty.call(e,b)||Object.defineProperty(e,b,{enumerable:!0,get:function(){return c[b]}})}),e}function $parcel$export(e,c,b,$){Object.defineProperty(e,c,{get:b,set:$,enumerable:!0,configurable:!0})}var $9cc889581bce45fb$export$b0b7b95ee465c83c,$9cc889581bce45fb$exports={};$parcel$export($9cc889581bce45fb$exports,"DRAG_HANDLE_CLASS",()=>$9cc889581bce45fb$export$956b3cf15d7c363),$parcel$export($9cc889581bce45fb$exports,"DRAG_HANDLE_SELECTOR",()=>$9cc889581bce45fb$export$21d634b1d5d9bee3),$parcel$export($9cc889581bce45fb$exports,"CONTROL_PANEL_GRID_CONFIG",()=>$9cc889581bce45fb$export$9f05d3e6ade4c09e),$parcel$export($9cc889581bce45fb$exports,"PortType",()=>$9cc889581bce45fb$export$b0b7b95ee465c83c),$parcel$export($9cc889581bce45fb$exports,"portColors",()=>$9cc889581bce45fb$export$dda967bb01875a20);const $9cc889581bce45fb$export$956b3cf15d7c363="web-noise-drag-handle",$9cc889581bce45fb$export$21d634b1d5d9bee3=`.${$9cc889581bce45fb$export$956b3cf15d7c363}`,$9cc889581bce45fb$export$9f05d3e6ade4c09e={rowHeight:10,cols:4};!function(e){e.Gate="gate",e.Number="number",e.Audio="audio",e.Any="any"}($9cc889581bce45fb$export$b0b7b95ee465c83c||($9cc889581bce45fb$export$b0b7b95ee465c83c={}));const $9cc889581bce45fb$export$dda967bb01875a20={[$9cc889581bce45fb$export$b0b7b95ee465c83c.Audio]:"#4ade80",[$9cc889581bce45fb$export$b0b7b95ee465c83c.Gate]:"#c084fc",[$9cc889581bce45fb$export$b0b7b95ee465c83c.Number]:"#38bdf8",[$9cc889581bce45fb$export$b0b7b95ee465c83c.Any]:"#ffffff"};$parcel$exportWildcard(module.exports,$9cc889581bce45fb$exports);
|
|
2
2
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"A,S,uB,C,C,C,E,O,O,I,C,G,O,C,S,C,E,Y,G,A,e,G,O,S,C,c,C,I,C,E,I,O,c,C,E,E,C,W,C,E,I,W,O,C,C,E,A,C,E,G,C,C,S,e,C,C,C,C,C,C,C,E,O,c,C,E,E,C,I,E,I,E,W,C,E,a,C,C,E,C,IEQY,0C,0B,C,E,e,0B,oB,I,0C,e,0B,uB,I,2C,e,0B,4B,I,2C,e,0B,W,I,2CARL,MAAM,yCAAoB,wBACpB,0CAAuB,CAAA,CAAA,EAAI,yCAAA,CAAmB,CAE9C,0CAA4B,CACvC,UAAW,GACX,KAAM,CACP,GAED,AAAA,SAAY,CAAQ,EAClB,EAAA,IAAA,CAAA,OACA,EAAA,MAAA,CAAA,SACA,EAAA,KAAA,CAAA,QACA,EAAA,GAAA,CAAA,KACF,EALY,2CAAA,CAAA,0CAAQ,CAAA,CAAA,
|
|
1
|
+
{"mappings":"A,S,uB,C,C,C,E,O,O,I,C,G,O,C,S,C,E,Y,G,A,e,G,O,S,C,c,C,I,C,E,I,O,c,C,E,E,C,W,C,E,I,W,O,C,C,E,A,C,E,G,C,C,S,e,C,C,C,C,C,C,C,E,O,c,C,E,E,C,I,E,I,E,W,C,E,a,C,C,E,C,IEQY,0C,0B,C,E,e,0B,oB,I,0C,e,0B,uB,I,2C,e,0B,4B,I,2C,e,0B,W,I,2C,e,0B,a,I,2CARL,MAAM,yCAAoB,wBACpB,0CAAuB,CAAA,CAAA,EAAI,yCAAA,CAAmB,CAE9C,0CAA4B,CACvC,UAAW,GACX,KAAM,CACP,GAED,AAAA,SAAY,CAAQ,EAClB,EAAA,IAAA,CAAA,OACA,EAAA,MAAA,CAAA,SACA,EAAA,KAAA,CAAA,QACA,EAAA,GAAA,CAAA,KACF,EALY,2CAAA,CAAA,0CAAQ,CAAA,CAAA,GAOb,MAAM,0CAAa,CACxB,CAAC,0CAAS,KAAK,CAAC,CAAE,UAClB,CAAC,0CAAS,IAAI,CAAC,CAAE,UACjB,CAAC,0CAAS,MAAM,CAAC,CAAE,UACnB,CAAC,0CAAS,GAAG,CAAC,CAAE,SACjB,E,uB,O,O,C","sources":["<anon>","packages/core/constants.ts","packages/core/src/constants.ts"],"sourcesContent":["\nfunction $parcel$exportWildcard(dest, source) {\n Object.keys(source).forEach(function(key) {\n if (key === 'default' || key === '__esModule' || Object.prototype.hasOwnProperty.call(dest, key)) {\n return;\n }\n\n Object.defineProperty(dest, key, {\n enumerable: true,\n get: function get() {\n return source[key];\n }\n });\n });\n\n return dest;\n}\n\nfunction $parcel$export(e, n, v, s) {\n Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});\n}\nvar $9cc889581bce45fb$exports = {};\n\n$parcel$export($9cc889581bce45fb$exports, \"DRAG_HANDLE_CLASS\", () => $9cc889581bce45fb$export$956b3cf15d7c363);\n$parcel$export($9cc889581bce45fb$exports, \"DRAG_HANDLE_SELECTOR\", () => $9cc889581bce45fb$export$21d634b1d5d9bee3);\n$parcel$export($9cc889581bce45fb$exports, \"CONTROL_PANEL_GRID_CONFIG\", () => $9cc889581bce45fb$export$9f05d3e6ade4c09e);\n$parcel$export($9cc889581bce45fb$exports, \"PortType\", () => $9cc889581bce45fb$export$b0b7b95ee465c83c);\n$parcel$export($9cc889581bce45fb$exports, \"portColors\", () => $9cc889581bce45fb$export$dda967bb01875a20);\nconst $9cc889581bce45fb$export$956b3cf15d7c363 = \"web-noise-drag-handle\";\nconst $9cc889581bce45fb$export$21d634b1d5d9bee3 = `.${$9cc889581bce45fb$export$956b3cf15d7c363}`;\nconst $9cc889581bce45fb$export$9f05d3e6ade4c09e = {\n rowHeight: 10,\n cols: 4\n};\nvar $9cc889581bce45fb$export$b0b7b95ee465c83c;\n(function(PortType) {\n PortType[\"Gate\"] = \"gate\";\n PortType[\"Number\"] = \"number\";\n PortType[\"Audio\"] = \"audio\";\n PortType[\"Any\"] = \"any\";\n})($9cc889581bce45fb$export$b0b7b95ee465c83c || ($9cc889581bce45fb$export$b0b7b95ee465c83c = {}));\nconst $9cc889581bce45fb$export$dda967bb01875a20 = {\n [$9cc889581bce45fb$export$b0b7b95ee465c83c.Audio]: \"#4ade80\",\n [$9cc889581bce45fb$export$b0b7b95ee465c83c.Gate]: \"#c084fc\",\n [$9cc889581bce45fb$export$b0b7b95ee465c83c.Number]: \"#38bdf8\",\n [$9cc889581bce45fb$export$b0b7b95ee465c83c.Any]: \"#ffffff\"\n};\n\n\n$parcel$exportWildcard(module.exports, $9cc889581bce45fb$exports);\n\n\n//# sourceMappingURL=constants.js.map\n","export * from './src/constants';","export const DRAG_HANDLE_CLASS = \"web-noise-drag-handle\";\nexport const DRAG_HANDLE_SELECTOR = `.${DRAG_HANDLE_CLASS}`;\n\nexport const CONTROL_PANEL_GRID_CONFIG = {\n rowHeight: 10,\n cols: 4,\n};\n\nexport enum PortType {\n Gate = \"gate\",\n Number = \"number\",\n Audio = \"audio\",\n Any = \"any\",\n}\n\nexport const portColors = {\n [PortType.Audio]: \"#4ade80\", // vibrant green\n [PortType.Gate]: \"#c084fc\", // rich purple\n [PortType.Number]: \"#38bdf8\", // bright blue\n [PortType.Any]: \"#ffffff\", // white\n};\n"],"names":["$parcel$exportWildcard","dest","source","Object","keys","forEach","key","prototype","hasOwnProperty","call","defineProperty","enumerable","get","$parcel$export","e","n","v","s","set","configurable","$9cc889581bce45fb$export$b0b7b95ee465c83c","$9cc889581bce45fb$exports","$9cc889581bce45fb$export$956b3cf15d7c363","$9cc889581bce45fb$export$21d634b1d5d9bee3","$9cc889581bce45fb$export$9f05d3e6ade4c09e","$9cc889581bce45fb$export$dda967bb01875a20","rowHeight","cols","PortType","Audio","Gate","Number","Any","module","exports"],"version":3,"file":"constants.js.map"}
|
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",()=>ew),L(O,"RadioGroup",()=>e$),L(O,"Input",()=>eP),L(O,"DropdownInput",()=>eF),L(O,"ColorInput",()=>eR),L(O,"NumberInput",()=>eD),L(O,"Button",()=>eM),L(O,"Select",()=>eG),L(O,"Slider",()=>eH),L(O,"SplineEditor",()=>eV),L(O,"ConfigRowLabel",()=>eU),L(O,"ConfigRowControl",()=>eJ),L(O,"ConfigRowSeparator",()=>eK),L(O,"ConfigRow",()=>eY),L(O,"ConfigPanel",()=>eX),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,32 +50,32 @@ 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
|
}
|
|
78
|
-
`),i(
|
|
78
|
+
`),i(E)`
|
|
79
79
|
background: ${({colors:e})=>e.elevation2};
|
|
80
80
|
padding: 0;
|
|
81
81
|
border-radius: 0;
|
|
@@ -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;
|
|
@@ -721,6 +737,9 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
721
737
|
&:hover {
|
|
722
738
|
color: ${({theme:e})=>e.colors.whitePrimary};
|
|
723
739
|
}
|
|
740
|
+
${({hide:e})=>e?`
|
|
741
|
+
display: none;
|
|
742
|
+
`:""};
|
|
724
743
|
`);let ef=i.div`
|
|
725
744
|
display: flex;
|
|
726
745
|
align-items: center;
|
|
@@ -754,7 +773,7 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
754
773
|
width: 70%;
|
|
755
774
|
height: 70%;
|
|
756
775
|
}
|
|
757
|
-
`,ew=({label:e,subtitle:o,name:i,type:n="checkbox",onChange:l,checked:a=!1})=>{let s=
|
|
776
|
+
`,ew=({label:e,subtitle:o,name:i,type:n="checkbox",onChange:l,checked:a=!1})=>{let s=H();return r(ex,{children:[t("input",{type:n,name:i,checked:a,onChange:({target:e})=>l?.(e.checked)}),t(ef,{className:"checker-box",theme:s}),r("div",{children:[t(ev,{children:e}),o?t(eb,{theme:s,children:o}):null]})]})},ey=i.div`
|
|
758
777
|
display: flex;
|
|
759
778
|
flex-direction: column;
|
|
760
779
|
gap: 0.5rem;
|
|
@@ -762,10 +781,10 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
762
781
|
font-size: 0.7rem;
|
|
763
782
|
color: ${({theme:e})=>e.colors.highlight2};
|
|
764
783
|
padding: 0.5rem;
|
|
765
|
-
`,e$=({options:e,value:o,onChange:r})=>t(ey,{theme:
|
|
784
|
+
`,e$=({options:e,value:o,onChange:r})=>t(ey,{theme:H(),children:e.map(({value:e,label:i,subtitle:n},l)=>t(ew,{value:o,type:"radio",label:i,subtitle:n,onChange:()=>r(e),checked:e===o},l))}),ek=i.div`
|
|
766
785
|
display: flex;
|
|
767
786
|
position: relative;
|
|
768
|
-
`,eC=
|
|
787
|
+
`,eC=m(i.input`
|
|
769
788
|
padding-right: 2rem;
|
|
770
789
|
padding-left: 0.3rem;
|
|
771
790
|
padding-top: 0;
|
|
@@ -797,7 +816,7 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
797
816
|
-webkit-appearance: none;
|
|
798
817
|
margin-right: 1rem;
|
|
799
818
|
}
|
|
800
|
-
`),eP=({type:e,value:o,placeholder:r,onChange:i=()=>{},inputProps:n,...l})=>t(ek,{...l,children:t(eC,{type:e,value:o,placeholder:r,onKeyDownCapture:e=>{e.stopPropagation()},onChange:e=>{i(e.target.value)},...n})}),ez=
|
|
819
|
+
`),eP=({type:e,value:o,placeholder:r,onChange:i=()=>{},inputProps:n,...l})=>t(ek,{...l,children:t(eC,{type:e,value:o,placeholder:r,onKeyDownCapture:e=>{e.stopPropagation()},onChange:e=>{i(e.target.value)},...n})}),ez=m(i.button`
|
|
801
820
|
position: absolute;
|
|
802
821
|
right: 0;
|
|
803
822
|
height: 100%;
|
|
@@ -818,7 +837,7 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
818
837
|
`),eN=i.div`
|
|
819
838
|
position: relative;
|
|
820
839
|
width: 100%;
|
|
821
|
-
`,e_=
|
|
840
|
+
`,e_=m(i.div`
|
|
822
841
|
position: absolute;
|
|
823
842
|
top: calc(100% + 2px);
|
|
824
843
|
left: 0;
|
|
@@ -848,7 +867,7 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
848
867
|
&::-webkit-scrollbar-thumb:hover {
|
|
849
868
|
background: ${({theme:e})=>e.colors.highlight1};
|
|
850
869
|
}
|
|
851
|
-
`),
|
|
870
|
+
`),ej=m(i.div`
|
|
852
871
|
padding: 0.4rem 0.5rem;
|
|
853
872
|
cursor: pointer;
|
|
854
873
|
color: ${({theme:e})=>e.colors.highlight1};
|
|
@@ -860,7 +879,7 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
860
879
|
background-color: ${({theme:e})=>e.colors.elevation3};
|
|
861
880
|
color: ${({theme:e})=>e.colors.highlight2};
|
|
862
881
|
}
|
|
863
|
-
`),
|
|
882
|
+
`),eE=i.div`
|
|
864
883
|
font-size: 0.85em;
|
|
865
884
|
opacity: 0.7;
|
|
866
885
|
margin-top: 2px;
|
|
@@ -872,7 +891,7 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
872
891
|
white-space: nowrap;
|
|
873
892
|
overflow: hidden;
|
|
874
893
|
text-overflow: ellipsis;
|
|
875
|
-
`,eF=({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(eN,{children:[r(ek,{children:[t(eC,{...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(ez,{onClick:w,children:t(A,{})})]}),d.length>0&&t(e_,{ref:b,isOpen:m&&x.length>0,children:x.map((e,o)=>r(
|
|
894
|
+
`,eF=({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(eN,{children:[r(ek,{children:[t(eC,{...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(ez,{onClick:w,children:t(A,{})})]}),d.length>0&&t(e_,{ref:b,isOpen:m&&x.length>0,children:x.map((e,o)=>r(ej,{isHighlighted:o===u,onClick:()=>y(e),onMouseEnter:()=>f(o),children:[t(eS,{children:e.label||e.value}),e.value&&t(eE,{children:e.value})]},e.value+o))})]})},eA=i(ek)`
|
|
876
895
|
gap: 0.5rem;
|
|
877
896
|
`,eI=i(eC)`
|
|
878
897
|
padding: 0;
|
|
@@ -956,7 +975,7 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
956
975
|
${({theme:e})=>e.colors.accent3};
|
|
957
976
|
background-color: ${({theme:e})=>e.colors.accent1};
|
|
958
977
|
}
|
|
959
|
-
`,eO=
|
|
978
|
+
`,eO=m(i.div`
|
|
960
979
|
display: flex;
|
|
961
980
|
align-items: center;
|
|
962
981
|
position: relative;
|
|
@@ -997,7 +1016,7 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
997
1016
|
background-color: ${({theme:e})=>e.colors.highlight3};
|
|
998
1017
|
clip-path: polygon(100% 0%, 0 0%, 50% 100%);
|
|
999
1018
|
}
|
|
1000
|
-
`),
|
|
1019
|
+
`),eG=({options:e,placeholder:o,value:i,onChange:n,...l})=>t(eO,{...l,children:r("select",{value:i||"",onChange:e=>n?.(e.target.value),children:[o&&t("option",{value:"",disabled:!0,children:o}),e.map(({value:e,label:o})=>t("option",{value:e,children:o},e+o))]})}),eH=i(R)`
|
|
1001
1020
|
padding: 0;
|
|
1002
1021
|
cursor: pointer;
|
|
1003
1022
|
position: relative;
|
|
@@ -1123,7 +1142,7 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
1123
1142
|
.rc-slider-mark-text {
|
|
1124
1143
|
font-size: 0.4rem;
|
|
1125
1144
|
}
|
|
1126
|
-
`;class
|
|
1145
|
+
`;class eB extends T{_updateMousePosition(e){let o=this._canvas?.getBoundingClientRect(),t=this._canvas.width/o.width,r=this._canvas.height/o.height;this._mouse={x:(e.clientX-o.left)*t,y:this._height-(e.clientY-o.top)*r}}getPoints(){let e=1/this._width,o=1/this._height;return this._pointCollection._points.map(({x:t,y:r})=>({x:t*e,y:r*o}))}removeAll(){let e=this._pointCollection.getNumberOfPoints();for(let o=e;o>0;o--)this._pointCollection.remove(o-1)}update(e){this.removeAll();let o=this._width,t=this._height;e.forEach(({x:e,y:r})=>{this._pointCollection.add({x:e*o,y:r*t})}),this.draw()}off(e,o){}}let eW=i.div`
|
|
1127
1146
|
height: 100%;
|
|
1128
1147
|
width: 100%;
|
|
1129
1148
|
position: relative;
|
|
@@ -1135,7 +1154,7 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
1135
1154
|
height: 100%;
|
|
1136
1155
|
width: 100%;
|
|
1137
1156
|
}
|
|
1138
|
-
`,eV=({onChange:e,onMove:o,points:r,type:i="monotonic",textColor:d="red",curveColor:c=
|
|
1157
|
+
`,eV=({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 eB(u.current,1024,1024))},[u]),t(eW,{ref:u})},eU=i.div``,eJ=i.div`
|
|
1139
1158
|
font-family: var(--leva-fonts-mono);
|
|
1140
1159
|
font-size: 0.7rem;
|
|
1141
1160
|
color: ${({theme:e})=>e.colors.whitePrimary};
|
|
@@ -1158,5 +1177,5 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
|
|
|
1158
1177
|
gap: 0.4rem;
|
|
1159
1178
|
background: ${({theme:e})=>e.colors.elevation2};
|
|
1160
1179
|
padding: 0.4rem 0.1rem;
|
|
1161
|
-
`,eq=i.div``;export{U as Modal,ew as Checker,e$ as RadioGroup,eP as Input,eF as DropdownInput,eR as ColorInput,eD as NumberInput,eM as Button,
|
|
1180
|
+
`,eq=i.div``;export{U as Modal,ew as Checker,e$ as RadioGroup,eP as Input,eF as DropdownInput,eR as ColorInput,eD as NumberInput,eM as Button,eG as Select,eH as Slider,eV as SplineEditor,eU as ConfigRowLabel,eJ as ConfigRowControl,eK as ConfigRowSeparator,eY as ConfigRow,eX as ConfigPanel,eq as ConfigRowInner};
|
|
1162
1181
|
//# sourceMappingURL=components.js.map
|