@web-noise/core 0.0.20 → 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.
@@ -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 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`
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%;
@@ -740,7 +740,56 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
740
740
  ${({hide:e})=>e?`
741
741
  display: none;
742
742
  `:""};
743
- `);let ef=i.div`
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`
744
793
  display: flex;
745
794
  align-items: center;
746
795
  justify-content: center;
@@ -752,10 +801,10 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
752
801
  content: "";
753
802
  background: ${({theme:e})=>e.colors.accent1};
754
803
  }
755
- `,ev=i.div``,eb=i.div`
804
+ `,eb=i.div``,ex=i.div`
756
805
  font-size: 0.4rem;
757
806
  color: ${({theme:e})=>e.colors.highlight1};
758
- `,ex=i.label`
807
+ `,ew=i.label`
759
808
  display: flex;
760
809
  cursor: pointer;
761
810
  gap: 0.4rem;
@@ -773,7 +822,7 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
773
822
  width: 70%;
774
823
  height: 70%;
775
824
  }
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`
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`
777
826
  display: flex;
778
827
  flex-direction: column;
779
828
  gap: 0.5rem;
@@ -781,10 +830,10 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
781
830
  font-size: 0.7rem;
782
831
  color: ${({theme:e})=>e.colors.highlight2};
783
832
  padding: 0.5rem;
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`
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`
785
834
  display: flex;
786
835
  position: relative;
787
- `,eC=m(i.input`
836
+ `,eP=m(i.input`
788
837
  padding-right: 2rem;
789
838
  padding-left: 0.3rem;
790
839
  padding-top: 0;
@@ -816,7 +865,7 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
816
865
  -webkit-appearance: none;
817
866
  margin-right: 1rem;
818
867
  }
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`
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`
820
869
  position: absolute;
821
870
  right: 0;
822
871
  height: 100%;
@@ -834,10 +883,10 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
834
883
  &:active {
835
884
  color: ${({theme:e})=>e.colors.highlight3};
836
885
  }
837
- `),eN=i.div`
886
+ `),e_=i.div`
838
887
  position: relative;
839
888
  width: 100%;
840
- `,e_=m(i.div`
889
+ `,ej=m(i.div`
841
890
  position: absolute;
842
891
  top: calc(100% + 2px);
843
892
  left: 0;
@@ -867,7 +916,7 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
867
916
  &::-webkit-scrollbar-thumb:hover {
868
917
  background: ${({theme:e})=>e.colors.highlight1};
869
918
  }
870
- `),ej=m(i.div`
919
+ `),eE=m(i.div`
871
920
  padding: 0.4rem 0.5rem;
872
921
  cursor: pointer;
873
922
  color: ${({theme:e})=>e.colors.highlight1};
@@ -879,21 +928,21 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
879
928
  background-color: ${({theme:e})=>e.colors.elevation3};
880
929
  color: ${({theme:e})=>e.colors.highlight2};
881
930
  }
882
- `),eE=i.div`
931
+ `),eS=i.div`
883
932
  font-size: 0.85em;
884
933
  opacity: 0.7;
885
934
  margin-top: 2px;
886
935
  white-space: nowrap;
887
936
  overflow: hidden;
888
937
  text-overflow: ellipsis;
889
- `,eS=i.div`
938
+ `,eF=i.div`
890
939
  font-size: 1em;
891
940
  white-space: nowrap;
892
941
  overflow: hidden;
893
942
  text-overflow: ellipsis;
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)`
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)`
895
944
  gap: 0.5rem;
896
- `,eI=i(eC)`
945
+ `,eR=i(eP)`
897
946
  padding: 0;
898
947
  aspect-ratio: 1 / 1;
899
948
  width: auto;
@@ -905,7 +954,7 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
905
954
  border-radius: 0.2rem;
906
955
  border: none;
907
956
  }
908
- `,eR=({value:e,onChange:o=()=>{},...i})=>r(eA,{...i,children:[t(eI,{type:"color",value:e,onChange:e=>{o(e.target.value)}}),t(eC,{value:e,onChange:e=>{o(e.target.value)}})]}),eT=i.span`
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`
909
958
  position: relative;
910
959
  &:after {
911
960
  content: "↕";
@@ -918,7 +967,7 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
918
967
  font-size: 1.2em;
919
968
  color: var(--leva-colors-highlight1);
920
969
  }
921
- `,eL=i.input`
970
+ `,eD=i.input`
922
971
  width: 100%;
923
972
  appearance: textfield;
924
973
  font-size: inherit;
@@ -946,7 +995,7 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
946
995
  -webkit-appearance: none;
947
996
  margin-right: 1rem;
948
997
  }
949
- `,eD=({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(eT,{...d,children:t(eL,{ref:c,type:"number",step:i,min:o,max:e,placeholder:a})})},eM=i.button`
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`
950
999
  display: flex;
951
1000
  align-items: center;
952
1001
  justify-content: center;
@@ -975,7 +1024,7 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
975
1024
  ${({theme:e})=>e.colors.accent3};
976
1025
  background-color: ${({theme:e})=>e.colors.accent1};
977
1026
  }
978
- `,eO=m(i.div`
1027
+ `,eG=m(i.div`
979
1028
  display: flex;
980
1029
  align-items: center;
981
1030
  position: relative;
@@ -1016,7 +1065,7 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
1016
1065
  background-color: ${({theme:e})=>e.colors.highlight3};
1017
1066
  clip-path: polygon(100% 0%, 0 0%, 50% 100%);
1018
1067
  }
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)`
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)`
1020
1069
  padding: 0;
1021
1070
  cursor: pointer;
1022
1071
  position: relative;
@@ -1142,7 +1191,7 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
1142
1191
  .rc-slider-mark-text {
1143
1192
  font-size: 0.4rem;
1144
1193
  }
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`
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`
1146
1195
  height: 100%;
1147
1196
  width: 100%;
1148
1197
  position: relative;
@@ -1154,13 +1203,13 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
1154
1203
  height: 100%;
1155
1204
  width: 100%;
1156
1205
  }
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`
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`
1158
1207
  font-family: var(--leva-fonts-mono);
1159
1208
  font-size: 0.7rem;
1160
1209
  color: ${({theme:e})=>e.colors.whitePrimary};
1161
- `,eK=i.div`
1162
- border-bottom: 1px solid ${({theme:e})=>e.colors.elevation1};
1163
1210
  `,eY=i.div`
1211
+ border-bottom: 1px solid ${({theme:e})=>e.colors.elevation1};
1212
+ `,eX=i.div`
1164
1213
  padding: 0.2rem 0.4rem;
1165
1214
  font-size: 0.7rem;
1166
1215
  color: ${({theme:e})=>e.colors.highlight2};
@@ -1171,11 +1220,11 @@ let e,o;import{jsx as t,jsxs as r}from"react/jsx-runtime";import i from"@emotion
1171
1220
  grid-template-columns: ${({oneLineLabels:e})=>e?"1fr":"auto 10rem"};
1172
1221
  row-gap: 0.1rem;
1173
1222
  column-gap: 0.4rem;
1174
- `,eX=i.div`
1223
+ `,eq=i.div`
1175
1224
  display: flex;
1176
1225
  flex-direction: column;
1177
1226
  gap: 0.4rem;
1178
1227
  background: ${({theme:e})=>e.colors.elevation2};
1179
1228
  padding: 0.4rem 0.1rem;
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};
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};
1181
1230
  //# sourceMappingURL=components.js.map