@tresjs/leches 0.3.0 → 0.3.1
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/style.css +2 -2
- package/dist/tresleches.js +144 -140
- package/dist/tresleches.umd.cjs +3 -3
- package/package.json +20 -20
package/dist/style.css
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* name: @tresjs/leches
|
|
3
|
-
* version: v0.3.
|
|
3
|
+
* version: v0.3.1
|
|
4
4
|
* (c) 2023
|
|
5
5
|
* description: Tasty GUI for Vue controls 🍰
|
|
6
6
|
* author: Alvaro Saburido <hola@alvarosaburido.dev> (https://github.com/alvarosabu/)
|
|
7
7
|
*/
|
|
8
|
-
html,body{margin:0;padding:0;height:100%;width:100%}#app{height:100%;width:100%}*,:before,:after{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 rgba(0,0,0,0);--un-ring-shadow:0 0 rgba(0,0,0,0);--un-shadow-inset: ;--un-shadow:0 0 rgba(0,0,0,0);--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgba(147,197,253,.5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }::backdrop{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 rgba(0,0,0,0);--un-ring-shadow:0 0 rgba(0,0,0,0);--un-shadow-inset: ;--un-shadow:0 0 rgba(0,0,0,0);--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgba(147,197,253,.5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }@font-face{font-family:DM Mono;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/dmmono/v11/aFTU7PB1QTsUX8KYthSQBLyM.woff2) format("woff2");unicode-range:U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20CF,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:DM Mono;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/dmmono/v11/aFTU7PB1QTsUX8KYthqQBA.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:DM Sans;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/dmsans/v11/rP2Hp2ywxg089UriCZ2IHSeH.woff2) format("woff2");unicode-range:U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20CF,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:DM Sans;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/dmsans/v11/rP2Hp2ywxg089UriCZOIHQ.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:"DM Serif Display";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/dmserifdisplay/v12/-nFnOHM81r4j6k0gjAW3mujVU2B2G_5x0ujy.woff2) format("woff2");unicode-range:U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20CF,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:"DM Serif Display";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/dmserifdisplay/v12/-nFnOHM81r4j6k0gjAW3mujVU2B2G_Bx0g.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Sacramento;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/sacramento/v13/buEzpo6gcdjy0EiZMBUG4CMf_exL.woff2) format("woff2");unicode-range:U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20CF,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Sacramento;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/sacramento/v13/buEzpo6gcdjy0EiZMBUG4C0f_Q.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}.i-ic-baseline-drag-indicator{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' display='inline-block' vertical-align='middle' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M11 18c0 1.1-.9 2-2 2s-2-.9-2-2s.9-2 2-2s2 .9 2 2zm-2-8c-1.1 0-2 .9-2 2s.9 2 2 2s2-.9 2-2s-.9-2-2-2zm0-6c-1.1 0-2 .9-2 2s.9 2 2 2s2-.9 2-2s-.9-2-2-2zm6 4c1.1 0 2-.9 2-2s-.9-2-2-2s-2 .9-2 2s.9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2s2-.9 2-2s-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2s2-.9 2-2s-.9-2-2-2z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;display:inline-block;vertical-align:middle;width:1.2em;height:1.2em}.i-ic\:baseline-check{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' display='inline-block' vertical-align='middle' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M9 16.17L4.83 12l-1.42 1.41L9 19L21 7l-1.41-1.41z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;display:inline-block;vertical-align:middle;width:1.2em;height:1.2em}.i-ic\:baseline-keyboard-arrow-down{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' display='inline-block' vertical-align='middle' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6l-6-6l1.41-1.41z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;display:inline-block;vertical-align:middle;width:1.2em;height:1.2em}.i-ic\:baseline-keyboard-arrow-up{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' display='inline-block' vertical-align='middle' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6l-6 6z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;display:inline-block;vertical-align:middle;width:1.2em;height:1.2em}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.bottom-0\.5{bottom:.125rem}.right-0\.5{right:.125rem}.z-24{z-index:24}.-mt-0\.5{margin-top:-.125rem}.mb-2{margin-bottom:.5rem}.mb-4{margin-bottom:1rem}.mr-2{margin-right:.5rem}.box-border{box-sizing:border-box}.hidden{display:none}.h-0\.75{height:.1875rem}.h-30px{height:30px}.h-4{height:1rem}.min-h-32px{min-height:32px}.w-1\/2{width:50%}.w-1\/3{width:33.3333333333%}.w-1\/4{width:25%}.w-2\/3{width:66.6666666667%}.w-280px{width:280px}.w-3{width:.75rem}.w-30px{width:30px}.w-4{width:1rem}.w-full{width:100%}.flex{display:flex}.inline-flex{display:inline-flex}@keyframes fade-in{0%{opacity:0}to{opacity:1}}@keyframes fade-out{0%{opacity:1}to{opacity:0}}.animate-fade-in{animation:fade-in 1s linear 1}.animate-fade-out{animation:fade-out 1s linear 1}.animate-duration-200{animation-duration:.2s}.animate-ease-in-out{animation-timing-function:cubic-bezier(.4,0,.2,1)}.cursor-pointer{cursor:pointer}.cursor-grabbing{cursor:grabbing}.cursor-ew-resize{cursor:ew-resize}.select-none{-webkit-user-select:none;user-select:none}.appearance-none{-webkit-appearance:none;appearance:none}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{grid-gap:.25rem;gap:.25rem}.gap-2{grid-gap:.5rem;gap:.5rem}.gap-4{grid-gap:1rem;gap:1rem}.border{border-width:1px}.border-2{border-width:2px}.border-4{border-width:4px}.border-black{--un-border-opacity:1;border-color:rgba(0,0,0,var(--un-border-opacity))}.border-gray-300{--un-border-opacity:1;border-color:rgba(209,213,219,var(--un-border-opacity))}.focus\:border-gray-200:focus{--un-border-opacity:1;border-color:rgba(229,231,235,var(--un-border-opacity))}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-sm{border-radius:.125rem}.rounded-b{border-bottom-left-radius:.25rem;border-bottom-right-radius:.25rem}.border-none{border-style:none}.border-solid{border-style:solid}.bg-dark-200{--un-bg-opacity:1;background-color:rgba(50,50,50,var(--un-bg-opacity))}.bg-dark-500{--un-bg-opacity:1;background-color:rgba(31,31,31,var(--un-bg-opacity))}.bg-gray-100{--un-bg-opacity:1;background-color:rgba(243,244,246,var(--un-bg-opacity))}.bg-gray-200{--un-bg-opacity:1;background-color:rgba(229,231,235,var(--un-bg-opacity))}.bg-transparent{background-color:transparent}.bg-white{--un-bg-opacity:1;background-color:rgba(255,255,255,var(--un-bg-opacity))}.p-0{padding:0}.p-1{padding:.25rem}.p-1\.5{padding:.375rem}.p-2{padding:.5rem}.p-4{padding:1rem}.px-0\.5{padding-left:.125rem;padding-right:.125rem}.px-4{padding-left:1rem;padding-right:1rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.pl-0{padding-left:0}.pt-4{padding-top:1rem}.text-right{text-align:right}.font-sans{font-family:DM Sans,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji"}.text-0\.65rem{font-size:.65rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.line-height-0{line-height:0}.text-gray-200{--un-text-opacity:1;color:rgba(229,231,235,var(--un-text-opacity))}.text-gray-300{--un-text-opacity:1;color:rgba(209,213,219,var(--un-text-opacity))}.text-gray-400{--un-text-opacity:1;color:rgba(156,163,175,var(--un-text-opacity))}.text-gray-500{--un-text-opacity:1;color:rgba(107,114,128,var(--un-text-opacity))}.text-light{--un-text-opacity:1;color:rgba(246,246,246,var(--un-text-opacity))}.shadow-lg{--un-shadow:var(--un-shadow-inset) 0 10px 15px -3px var(--un-shadow-color, rgba(0,0,0,.1)),var(--un-shadow-inset) 0 4px 6px -4px var(--un-shadow-color, rgba(0,0,0,.1));box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow)}.shadow-xl{--un-shadow:var(--un-shadow-inset) 0 20px 25px -5px var(--un-shadow-color, rgba(0,0,0,.1)),var(--un-shadow-inset) 0 8px 10px -6px var(--un-shadow-color, rgba(0,0,0,.1));box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow)}.outline{outline-style:solid}.outline-none{outline:2px solid transparent;outline-offset:2px}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-200{transition-duration:.2s}input[type=range][data-v-743fd350]{outline:none;appearance:none;-webkit-appearance:none;-moz-appearance:none}input[type=range][data-v-743fd350]::-webkit-slider-thumb{height:1rem;width:.75rem;cursor:pointer;-webkit-appearance:none;appearance:none;border-width:2px;border-radius:.125rem;--un-bg-opacity:1;background-color:rgba(50,50,50,var(--un-bg-opacity));--un-shadow:var(--un-shadow-inset) 0 10px 15px -3px var(--un-shadow-color, rgba(0,0,0,.1)),var(--un-shadow-inset) 0 4px 6px -4px var(--un-shadow-color, rgba(0,0,0,.1));box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow)}input[type=range][data-v-743fd350]::-moz-range-thumb{height:1rem;width:.75rem;cursor:pointer;-webkit-appearance:none;appearance:none;border-width:2px;border-radius:.125rem;--un-bg-opacity:1;background-color:rgba(50,50,50,var(--un-bg-opacity));--un-shadow:var(--un-shadow-inset) 0 10px 15px -3px var(--un-shadow-color, rgba(0,0,0,.1)),var(--un-shadow-inset) 0 4px 6px -4px var(--un-shadow-color, rgba(0,0,0,.1));box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow)}input[type=color]{box-sizing:border-box;-webkit-appearance:none;appearance:none;border-radius:.125rem;border-style:none;background-color:transparent;padding:0;outline:2px solid transparent;outline-offset:2px;cursor:pointer}input[type=color]::-webkit-color-swatch-wrapper{border-style:none;padding:0}input[type=color]::-webkit-color-swatch{margin-top:-.125rem;height:30px;width:30px;border-radius:.125rem;border-style:none;padding:0}
|
|
8
|
+
html,body{margin:0;padding:0;height:100%;width:100%}#app{height:100%;width:100%}*,:before,:after{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 rgba(0,0,0,0);--un-ring-shadow:0 0 rgba(0,0,0,0);--un-shadow-inset: ;--un-shadow:0 0 rgba(0,0,0,0);--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgba(147,197,253,.5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }::backdrop{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 rgba(0,0,0,0);--un-ring-shadow:0 0 rgba(0,0,0,0);--un-shadow-inset: ;--un-shadow:0 0 rgba(0,0,0,0);--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgba(147,197,253,.5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }@font-face{font-family:Roboto Mono;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/robotomono/v22/L0xuDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vq_SeW4Ep0.woff2) format("woff2");unicode-range:U+0460-052F,U+1C80-1C88,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:Roboto Mono;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/robotomono/v22/L0xuDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vq_QOW4Ep0.woff2) format("woff2");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:Roboto Mono;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/robotomono/v22/L0xuDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vq_R-W4Ep0.woff2) format("woff2");unicode-range:U+0370-03FF}@font-face{font-family:Roboto Mono;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/robotomono/v22/L0xuDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vq_S-W4Ep0.woff2) format("woff2");unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB}@font-face{font-family:Roboto Mono;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/robotomono/v22/L0xuDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vq_SuW4Ep0.woff2) format("woff2");unicode-range:U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20CF,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Roboto Mono;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/robotomono/v22/L0xuDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vq_ROW4.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}.i-ic-baseline-drag-indicator{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' display='inline-block' vertical-align='middle' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M11 18c0 1.1-.9 2-2 2s-2-.9-2-2s.9-2 2-2s2 .9 2 2zm-2-8c-1.1 0-2 .9-2 2s.9 2 2 2s2-.9 2-2s-.9-2-2-2zm0-6c-1.1 0-2 .9-2 2s.9 2 2 2s2-.9 2-2s-.9-2-2-2zm6 4c1.1 0 2-.9 2-2s-.9-2-2-2s-2 .9-2 2s.9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2s2-.9 2-2s-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2s2-.9 2-2s-.9-2-2-2z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;display:inline-block;vertical-align:middle;width:1.2em;height:1.2em}.i-ic\:baseline-check{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' display='inline-block' vertical-align='middle' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M9 16.17L4.83 12l-1.42 1.41L9 19L21 7l-1.41-1.41z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;display:inline-block;vertical-align:middle;width:1.2em;height:1.2em}.i-ic\:baseline-keyboard-arrow-down{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' display='inline-block' vertical-align='middle' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6l-6-6l1.41-1.41z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;display:inline-block;vertical-align:middle;width:1.2em;height:1.2em}.i-ic\:baseline-keyboard-arrow-up{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' display='inline-block' vertical-align='middle' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6l-6 6z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;display:inline-block;vertical-align:middle;width:1.2em;height:1.2em}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.bottom-0\.5{bottom:.125rem}.right-0\.5{right:.125rem}.z-24{z-index:24}.-mt-0\.5{margin-top:-.125rem}.mb-2{margin-bottom:.5rem}.mb-4{margin-bottom:1rem}.mr-2{margin-right:.5rem}.box-border{box-sizing:border-box}.hidden{display:none}.h-0\.75{height:.1875rem}.h-30px{height:30px}.h-4{height:1rem}.min-h-32px{min-height:32px}.w-1\/2{width:50%}.w-1\/3{width:33.3333333333%}.w-1\/4{width:25%}.w-2\/3{width:66.6666666667%}.w-280px{width:280px}.w-3{width:.75rem}.w-30px{width:30px}.w-4{width:1rem}.w-full{width:100%}.flex{display:flex}.inline-flex{display:inline-flex}@keyframes fade-in{0%{opacity:0}to{opacity:1}}@keyframes fade-out{0%{opacity:1}to{opacity:0}}.animate-fade-in{animation:fade-in 1s linear 1}.animate-fade-out{animation:fade-out 1s linear 1}.animate-duration-200{animation-duration:.2s}.animate-ease-in-out{animation-timing-function:cubic-bezier(.4,0,.2,1)}.cursor-pointer{cursor:pointer}.cursor-grabbing{cursor:grabbing}.cursor-ew-resize{cursor:ew-resize}.select-none{-webkit-user-select:none;user-select:none}.appearance-none{-webkit-appearance:none;appearance:none}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{grid-gap:.25rem;gap:.25rem}.gap-2{grid-gap:.5rem;gap:.5rem}.gap-4{grid-gap:1rem;gap:1rem}.border{border-width:1px}.border-2{border-width:2px}.border-4{border-width:4px}.border-black{--un-border-opacity:1;border-color:rgba(0,0,0,var(--un-border-opacity))}.border-gray-300{--un-border-opacity:1;border-color:rgba(209,213,219,var(--un-border-opacity))}.focus\:border-gray-200:focus{--un-border-opacity:1;border-color:rgba(229,231,235,var(--un-border-opacity))}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-sm{border-radius:.125rem}.rounded-b{border-bottom-left-radius:.25rem;border-bottom-right-radius:.25rem}.border-none{border-style:none}.border-solid{border-style:solid}.bg-dark-200{--un-bg-opacity:1;background-color:rgba(50,50,50,var(--un-bg-opacity))}.bg-dark-500{--un-bg-opacity:1;background-color:rgba(31,31,31,var(--un-bg-opacity))}.bg-gray-100{--un-bg-opacity:1;background-color:rgba(243,244,246,var(--un-bg-opacity))}.bg-gray-200{--un-bg-opacity:1;background-color:rgba(229,231,235,var(--un-bg-opacity))}.bg-transparent{background-color:transparent}.bg-white{--un-bg-opacity:1;background-color:rgba(255,255,255,var(--un-bg-opacity))}.p-0{padding:0}.p-1{padding:.25rem}.p-1\.5{padding:.375rem}.p-2{padding:.5rem}.p-4{padding:1rem}.px-0\.5{padding-left:.125rem;padding-right:.125rem}.px-4{padding-left:1rem;padding-right:1rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.pl-0{padding-left:0}.pt-4{padding-top:1rem}.text-right{text-align:right}.font-sans{font-family:Roboto Mono,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji"}.text-0\.65rem{font-size:.65rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.line-height-0{line-height:0}.text-gray-200{--un-text-opacity:1;color:rgba(229,231,235,var(--un-text-opacity))}.text-gray-300{--un-text-opacity:1;color:rgba(209,213,219,var(--un-text-opacity))}.text-gray-400{--un-text-opacity:1;color:rgba(156,163,175,var(--un-text-opacity))}.text-gray-500{--un-text-opacity:1;color:rgba(107,114,128,var(--un-text-opacity))}.text-light{--un-text-opacity:1;color:rgba(246,246,246,var(--un-text-opacity))}.shadow-lg{--un-shadow:var(--un-shadow-inset) 0 10px 15px -3px var(--un-shadow-color, rgba(0,0,0,.1)),var(--un-shadow-inset) 0 4px 6px -4px var(--un-shadow-color, rgba(0,0,0,.1));box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow)}.shadow-xl{--un-shadow:var(--un-shadow-inset) 0 20px 25px -5px var(--un-shadow-color, rgba(0,0,0,.1)),var(--un-shadow-inset) 0 8px 10px -6px var(--un-shadow-color, rgba(0,0,0,.1));box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow)}.outline{outline-style:solid}.outline-none{outline:2px solid transparent;outline-offset:2px}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-200{transition-duration:.2s}input[type=range][data-v-743fd350]{outline:none;appearance:none;-webkit-appearance:none;-moz-appearance:none}input[type=range][data-v-743fd350]::-webkit-slider-thumb{height:1rem;width:.75rem;cursor:pointer;-webkit-appearance:none;appearance:none;border-width:2px;border-radius:.125rem;--un-bg-opacity:1;background-color:rgba(50,50,50,var(--un-bg-opacity));--un-shadow:var(--un-shadow-inset) 0 10px 15px -3px var(--un-shadow-color, rgba(0,0,0,.1)),var(--un-shadow-inset) 0 4px 6px -4px var(--un-shadow-color, rgba(0,0,0,.1));box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow)}input[type=range][data-v-743fd350]::-moz-range-thumb{height:1rem;width:.75rem;cursor:pointer;-webkit-appearance:none;appearance:none;border-width:2px;border-radius:.125rem;--un-bg-opacity:1;background-color:rgba(50,50,50,var(--un-bg-opacity));--un-shadow:var(--un-shadow-inset) 0 10px 15px -3px var(--un-shadow-color, rgba(0,0,0,.1)),var(--un-shadow-inset) 0 4px 6px -4px var(--un-shadow-color, rgba(0,0,0,.1));box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow)}input[type=color]{box-sizing:border-box;-webkit-appearance:none;appearance:none;border-radius:.125rem;border-style:none;background-color:transparent;padding:0;outline:2px solid transparent;outline-offset:2px;cursor:pointer}input[type=color]::-webkit-color-swatch-wrapper{border-style:none;padding:0}input[type=color]::-webkit-color-swatch{margin-top:-.125rem;height:30px;width:30px;border-radius:.125rem;border-style:none;padding:0}
|
package/dist/tresleches.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* name: @tresjs/leches
|
|
3
|
-
* version: v0.3.
|
|
3
|
+
* version: v0.3.1
|
|
4
4
|
* (c) 2023
|
|
5
5
|
* description: Tasty GUI for Vue controls 🍰
|
|
6
6
|
* author: Alvaro Saburido <hola@alvarosaburido.dev> (https://github.com/alvarosabu/)
|
|
7
7
|
*/
|
|
8
|
-
import { unref as T, getCurrentScope as ct, onScopeDispose as yt, toRef as _t, readonly as xt, customRef as pt, ref as g, defineComponent as v, computed as
|
|
9
|
-
import { useStorage as vt, isClient as Ct, useDraggable as St, useMouse as Y, useFps as kt, useRafFn as $t, useWindowSize as
|
|
8
|
+
import { unref as T, getCurrentScope as ct, onScopeDispose as yt, toRef as _t, readonly as xt, customRef as pt, ref as g, defineComponent as v, computed as E, reactive as tt, h as dt, watch as I, isReactive as ft, toRefs as gt, onUnmounted as mt, isRef as V, openBlock as d, createElementBlock as b, createElementVNode as p, toDisplayString as C, normalizeClass as k, withDirectives as et, vShow as st, createTextVNode as bt, normalizeStyle as zt, Fragment as D, renderList as R, createCommentVNode as nt, createVNode as Mt, Transition as wt, withCtx as it, createBlock as w } from "vue";
|
|
9
|
+
import { useStorage as vt, isClient as Ct, useDraggable as St, useMouse as Y, useFps as kt, useRafFn as $t, useWindowSize as Et } from "@vueuse/core";
|
|
10
10
|
function rt(r) {
|
|
11
11
|
return ct() ? (yt(r), !0) : !1;
|
|
12
12
|
}
|
|
@@ -14,12 +14,12 @@ function q(r) {
|
|
|
14
14
|
return typeof r == "function" ? r() : T(r);
|
|
15
15
|
}
|
|
16
16
|
const ot = typeof window < "u", ht = () => {
|
|
17
|
-
}, Z = /* @__PURE__ */
|
|
18
|
-
function
|
|
17
|
+
}, Z = /* @__PURE__ */ It();
|
|
18
|
+
function It() {
|
|
19
19
|
var r;
|
|
20
20
|
return ot && ((r = window == null ? void 0 : window.navigator) == null ? void 0 : r.userAgent) && /* @__PURE__ */ /iP(ad|hone|od)/.test(window.navigator.userAgent);
|
|
21
21
|
}
|
|
22
|
-
function
|
|
22
|
+
function At(...r) {
|
|
23
23
|
if (r.length !== 1)
|
|
24
24
|
return _t(...r);
|
|
25
25
|
const t = r[0];
|
|
@@ -36,18 +36,18 @@ function qt(...r) {
|
|
|
36
36
|
if (typeof r[0] == "string" || Array.isArray(r[0]) ? ([e, s, n] = r, t = jt) : [t, e, s, n] = r, !t)
|
|
37
37
|
return ht;
|
|
38
38
|
Array.isArray(e) || (e = [e]), Array.isArray(s) || (s = [s]);
|
|
39
|
-
const i = [],
|
|
40
|
-
i.forEach((
|
|
41
|
-
}, l = (
|
|
39
|
+
const i = [], a = () => {
|
|
40
|
+
i.forEach((h) => h()), i.length = 0;
|
|
41
|
+
}, l = (h, o, _, u) => (h.addEventListener(o, _, u), () => h.removeEventListener(o, _, u)), y = I(
|
|
42
42
|
() => [Tt(t), q(n)],
|
|
43
|
-
([
|
|
44
|
-
|
|
45
|
-
...e.flatMap((
|
|
43
|
+
([h, o]) => {
|
|
44
|
+
a(), h && i.push(
|
|
45
|
+
...e.flatMap((_) => s.map((u) => l(h, _, u, o)))
|
|
46
46
|
);
|
|
47
47
|
},
|
|
48
48
|
{ immediate: !0, flush: "post" }
|
|
49
49
|
), c = () => {
|
|
50
|
-
|
|
50
|
+
y(), a();
|
|
51
51
|
};
|
|
52
52
|
return rt(c), c;
|
|
53
53
|
}
|
|
@@ -71,22 +71,26 @@ const Yt = /* @__PURE__ */ v({
|
|
|
71
71
|
"pointerTypes",
|
|
72
72
|
"as",
|
|
73
73
|
"handle",
|
|
74
|
-
"axis"
|
|
74
|
+
"axis",
|
|
75
|
+
"onStart",
|
|
76
|
+
"onMove",
|
|
77
|
+
"onEnd"
|
|
75
78
|
],
|
|
76
79
|
setup(r, { slots: t }) {
|
|
77
|
-
const e = g(), s =
|
|
78
|
-
var
|
|
79
|
-
return (
|
|
80
|
+
const e = g(), s = E(() => {
|
|
81
|
+
var y;
|
|
82
|
+
return (y = r.handle) != null ? y : e.value;
|
|
80
83
|
}), n = r.storageKey && vt(
|
|
81
84
|
r.storageKey,
|
|
82
85
|
q(r.initialValue) || { x: 0, y: 0 },
|
|
83
86
|
Ct ? r.storageType === "session" ? sessionStorage : localStorage : void 0
|
|
84
|
-
), i = n || r.initialValue || { x: 0, y: 0 },
|
|
85
|
-
|
|
87
|
+
), i = n || r.initialValue || { x: 0, y: 0 }, a = (y, c) => {
|
|
88
|
+
var h;
|
|
89
|
+
(h = r.onEnd) == null || h.call(r, y, c), n && (n.value.x = y.x, n.value.y = y.y);
|
|
86
90
|
}, l = tt(St(e, Rt(Ft({}, r), {
|
|
87
91
|
handle: s,
|
|
88
92
|
initialValue: i,
|
|
89
|
-
onEnd:
|
|
93
|
+
onEnd: a
|
|
90
94
|
})));
|
|
91
95
|
return () => {
|
|
92
96
|
if (t.default)
|
|
@@ -96,7 +100,7 @@ const Yt = /* @__PURE__ */ v({
|
|
|
96
100
|
});
|
|
97
101
|
function at(r) {
|
|
98
102
|
const t = window.getComputedStyle(r);
|
|
99
|
-
if (t.overflowX === "scroll" || t.overflowY === "scroll" || t.overflowX === "auto" && r.
|
|
103
|
+
if (t.overflowX === "scroll" || t.overflowY === "scroll" || t.overflowX === "auto" && r.clientWidth < r.scrollWidth || t.overflowY === "auto" && r.clientHeight < r.scrollHeight)
|
|
100
104
|
return !0;
|
|
101
105
|
{
|
|
102
106
|
const e = r.parentNode;
|
|
@@ -110,10 +114,10 @@ function Nt(r) {
|
|
|
110
114
|
function Ht(r, t = !1) {
|
|
111
115
|
const e = g(t);
|
|
112
116
|
let s = null, n;
|
|
113
|
-
|
|
117
|
+
I(At(r), (l) => {
|
|
114
118
|
if (l) {
|
|
115
|
-
const
|
|
116
|
-
n =
|
|
119
|
+
const y = l;
|
|
120
|
+
n = y.style.overflow, e.value && (y.style.overflow = "hidden");
|
|
117
121
|
}
|
|
118
122
|
}, {
|
|
119
123
|
immediate: !0
|
|
@@ -123,21 +127,21 @@ function Ht(r, t = !1) {
|
|
|
123
127
|
!l || e.value || (Z && (s = qt(
|
|
124
128
|
l,
|
|
125
129
|
"touchmove",
|
|
126
|
-
(
|
|
127
|
-
Nt(
|
|
130
|
+
(y) => {
|
|
131
|
+
Nt(y);
|
|
128
132
|
},
|
|
129
133
|
{ passive: !1 }
|
|
130
134
|
)), l.style.overflow = "hidden", e.value = !0);
|
|
131
|
-
},
|
|
135
|
+
}, a = () => {
|
|
132
136
|
const l = q(r);
|
|
133
137
|
!l || !e.value || (Z && (s == null || s()), l.style.overflow = n, e.value = !1);
|
|
134
138
|
};
|
|
135
|
-
return rt(
|
|
139
|
+
return rt(a), E({
|
|
136
140
|
get() {
|
|
137
141
|
return e.value;
|
|
138
142
|
},
|
|
139
143
|
set(l) {
|
|
140
|
-
l ? i() :
|
|
144
|
+
l ? i() : a();
|
|
141
145
|
}
|
|
142
146
|
});
|
|
143
147
|
}
|
|
@@ -149,7 +153,7 @@ function Qt() {
|
|
|
149
153
|
return;
|
|
150
154
|
r = !0;
|
|
151
155
|
const n = Ht(e, s.value);
|
|
152
|
-
|
|
156
|
+
I(t, (i) => n.value = i);
|
|
153
157
|
};
|
|
154
158
|
}
|
|
155
159
|
Qt();
|
|
@@ -158,7 +162,7 @@ Qt();
|
|
|
158
162
|
* Copyright 2010-2023 Three.js Authors
|
|
159
163
|
* SPDX-License-Identifier: MIT
|
|
160
164
|
*/
|
|
161
|
-
const lt = "
|
|
165
|
+
const lt = "153";
|
|
162
166
|
function N(r, t, e) {
|
|
163
167
|
return Math.max(t, Math.min(e, r));
|
|
164
168
|
}
|
|
@@ -347,8 +351,8 @@ class H {
|
|
|
347
351
|
return this.x = t.getX(e), this.y = t.getY(e), this;
|
|
348
352
|
}
|
|
349
353
|
rotateAround(t, e) {
|
|
350
|
-
const s = Math.cos(e), n = Math.sin(e), i = this.x - t.x,
|
|
351
|
-
return this.x = i * s -
|
|
354
|
+
const s = Math.cos(e), n = Math.sin(e), i = this.x - t.x, a = this.y - t.y;
|
|
355
|
+
return this.x = i * s - a * n + t.x, this.y = i * n + a * s + t.y, this;
|
|
352
356
|
}
|
|
353
357
|
random() {
|
|
354
358
|
return this.x = Math.random(), this.y = Math.random(), this;
|
|
@@ -361,35 +365,35 @@ class Wt {
|
|
|
361
365
|
constructor(t = 0, e = 0, s = 0, n = 1) {
|
|
362
366
|
this.isQuaternion = !0, this._x = t, this._y = e, this._z = s, this._w = n;
|
|
363
367
|
}
|
|
364
|
-
static slerpFlat(t, e, s, n, i,
|
|
365
|
-
let
|
|
366
|
-
const
|
|
368
|
+
static slerpFlat(t, e, s, n, i, a, l) {
|
|
369
|
+
let y = s[n + 0], c = s[n + 1], h = s[n + 2], o = s[n + 3];
|
|
370
|
+
const _ = i[a + 0], u = i[a + 1], x = i[a + 2], m = i[a + 3];
|
|
367
371
|
if (l === 0) {
|
|
368
|
-
t[e + 0] =
|
|
372
|
+
t[e + 0] = y, t[e + 1] = c, t[e + 2] = h, t[e + 3] = o;
|
|
369
373
|
return;
|
|
370
374
|
}
|
|
371
375
|
if (l === 1) {
|
|
372
|
-
t[e + 0] =
|
|
376
|
+
t[e + 0] = _, t[e + 1] = u, t[e + 2] = x, t[e + 3] = m;
|
|
373
377
|
return;
|
|
374
378
|
}
|
|
375
|
-
if (o !== m ||
|
|
379
|
+
if (o !== m || y !== _ || c !== u || h !== x) {
|
|
376
380
|
let z = 1 - l;
|
|
377
|
-
const f =
|
|
381
|
+
const f = y * _ + c * u + h * x + o * m, M = f >= 0 ? 1 : -1, Q = 1 - f * f;
|
|
378
382
|
if (Q > Number.EPSILON) {
|
|
379
383
|
const S = Math.sqrt(Q), W = Math.atan2(S, f * M);
|
|
380
384
|
z = Math.sin(z * W) / S, l = Math.sin(l * W) / S;
|
|
381
385
|
}
|
|
382
386
|
const P = l * M;
|
|
383
|
-
if (
|
|
384
|
-
const S = 1 / Math.sqrt(
|
|
385
|
-
|
|
387
|
+
if (y = y * z + _ * P, c = c * z + u * P, h = h * z + x * P, o = o * z + m * P, z === 1 - l) {
|
|
388
|
+
const S = 1 / Math.sqrt(y * y + c * c + h * h + o * o);
|
|
389
|
+
y *= S, c *= S, h *= S, o *= S;
|
|
386
390
|
}
|
|
387
391
|
}
|
|
388
|
-
t[e] =
|
|
392
|
+
t[e] = y, t[e + 1] = c, t[e + 2] = h, t[e + 3] = o;
|
|
389
393
|
}
|
|
390
|
-
static multiplyQuaternionsFlat(t, e, s, n, i,
|
|
391
|
-
const l = s[n],
|
|
392
|
-
return t[e] = l * x +
|
|
394
|
+
static multiplyQuaternionsFlat(t, e, s, n, i, a) {
|
|
395
|
+
const l = s[n], y = s[n + 1], c = s[n + 2], h = s[n + 3], o = i[a], _ = i[a + 1], u = i[a + 2], x = i[a + 3];
|
|
396
|
+
return t[e] = l * x + h * o + y * u - c * _, t[e + 1] = y * x + h * _ + c * o - l * u, t[e + 2] = c * x + h * u + l * _ - y * o, t[e + 3] = h * x - l * o - y * _ - c * u, t;
|
|
393
397
|
}
|
|
394
398
|
get x() {
|
|
395
399
|
return this._x;
|
|
@@ -425,28 +429,28 @@ class Wt {
|
|
|
425
429
|
return this._x = t.x, this._y = t.y, this._z = t.z, this._w = t.w, this._onChangeCallback(), this;
|
|
426
430
|
}
|
|
427
431
|
setFromEuler(t, e) {
|
|
428
|
-
const s = t._x, n = t._y, i = t._z,
|
|
429
|
-
switch (
|
|
432
|
+
const s = t._x, n = t._y, i = t._z, a = t._order, l = Math.cos, y = Math.sin, c = l(s / 2), h = l(n / 2), o = l(i / 2), _ = y(s / 2), u = y(n / 2), x = y(i / 2);
|
|
433
|
+
switch (a) {
|
|
430
434
|
case "XYZ":
|
|
431
|
-
this._x =
|
|
435
|
+
this._x = _ * h * o + c * u * x, this._y = c * u * o - _ * h * x, this._z = c * h * x + _ * u * o, this._w = c * h * o - _ * u * x;
|
|
432
436
|
break;
|
|
433
437
|
case "YXZ":
|
|
434
|
-
this._x =
|
|
438
|
+
this._x = _ * h * o + c * u * x, this._y = c * u * o - _ * h * x, this._z = c * h * x - _ * u * o, this._w = c * h * o + _ * u * x;
|
|
435
439
|
break;
|
|
436
440
|
case "ZXY":
|
|
437
|
-
this._x =
|
|
441
|
+
this._x = _ * h * o - c * u * x, this._y = c * u * o + _ * h * x, this._z = c * h * x + _ * u * o, this._w = c * h * o - _ * u * x;
|
|
438
442
|
break;
|
|
439
443
|
case "ZYX":
|
|
440
|
-
this._x =
|
|
444
|
+
this._x = _ * h * o - c * u * x, this._y = c * u * o + _ * h * x, this._z = c * h * x - _ * u * o, this._w = c * h * o + _ * u * x;
|
|
441
445
|
break;
|
|
442
446
|
case "YZX":
|
|
443
|
-
this._x =
|
|
447
|
+
this._x = _ * h * o + c * u * x, this._y = c * u * o + _ * h * x, this._z = c * h * x - _ * u * o, this._w = c * h * o - _ * u * x;
|
|
444
448
|
break;
|
|
445
449
|
case "XZY":
|
|
446
|
-
this._x =
|
|
450
|
+
this._x = _ * h * o - c * u * x, this._y = c * u * o - _ * h * x, this._z = c * h * x + _ * u * o, this._w = c * h * o + _ * u * x;
|
|
447
451
|
break;
|
|
448
452
|
default:
|
|
449
|
-
console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: " +
|
|
453
|
+
console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: " + a);
|
|
450
454
|
}
|
|
451
455
|
return e !== !1 && this._onChangeCallback(), this;
|
|
452
456
|
}
|
|
@@ -455,19 +459,19 @@ class Wt {
|
|
|
455
459
|
return this._x = t.x * n, this._y = t.y * n, this._z = t.z * n, this._w = Math.cos(s), this._onChangeCallback(), this;
|
|
456
460
|
}
|
|
457
461
|
setFromRotationMatrix(t) {
|
|
458
|
-
const e = t.elements, s = e[0], n = e[4], i = e[8],
|
|
459
|
-
if (
|
|
460
|
-
const u = 0.5 / Math.sqrt(
|
|
461
|
-
this._w = 0.25 / u, this._x = (
|
|
462
|
+
const e = t.elements, s = e[0], n = e[4], i = e[8], a = e[1], l = e[5], y = e[9], c = e[2], h = e[6], o = e[10], _ = s + l + o;
|
|
463
|
+
if (_ > 0) {
|
|
464
|
+
const u = 0.5 / Math.sqrt(_ + 1);
|
|
465
|
+
this._w = 0.25 / u, this._x = (h - y) * u, this._y = (i - c) * u, this._z = (a - n) * u;
|
|
462
466
|
} else if (s > l && s > o) {
|
|
463
467
|
const u = 2 * Math.sqrt(1 + s - l - o);
|
|
464
|
-
this._w = (
|
|
468
|
+
this._w = (h - y) / u, this._x = 0.25 * u, this._y = (n + a) / u, this._z = (i + c) / u;
|
|
465
469
|
} else if (l > o) {
|
|
466
470
|
const u = 2 * Math.sqrt(1 + l - s - o);
|
|
467
|
-
this._w = (i - c) / u, this._x = (n +
|
|
471
|
+
this._w = (i - c) / u, this._x = (n + a) / u, this._y = 0.25 * u, this._z = (y + h) / u;
|
|
468
472
|
} else {
|
|
469
473
|
const u = 2 * Math.sqrt(1 + o - s - l);
|
|
470
|
-
this._w = (
|
|
474
|
+
this._w = (a - n) / u, this._x = (i + c) / u, this._y = (y + h) / u, this._z = 0.25 * u;
|
|
471
475
|
}
|
|
472
476
|
return this._onChangeCallback(), this;
|
|
473
477
|
}
|
|
@@ -514,25 +518,25 @@ class Wt {
|
|
|
514
518
|
return this.multiplyQuaternions(t, this);
|
|
515
519
|
}
|
|
516
520
|
multiplyQuaternions(t, e) {
|
|
517
|
-
const s = t._x, n = t._y, i = t._z,
|
|
518
|
-
return this._x = s *
|
|
521
|
+
const s = t._x, n = t._y, i = t._z, a = t._w, l = e._x, y = e._y, c = e._z, h = e._w;
|
|
522
|
+
return this._x = s * h + a * l + n * c - i * y, this._y = n * h + a * y + i * l - s * c, this._z = i * h + a * c + s * y - n * l, this._w = a * h - s * l - n * y - i * c, this._onChangeCallback(), this;
|
|
519
523
|
}
|
|
520
524
|
slerp(t, e) {
|
|
521
525
|
if (e === 0)
|
|
522
526
|
return this;
|
|
523
527
|
if (e === 1)
|
|
524
528
|
return this.copy(t);
|
|
525
|
-
const s = this._x, n = this._y, i = this._z,
|
|
526
|
-
let l =
|
|
529
|
+
const s = this._x, n = this._y, i = this._z, a = this._w;
|
|
530
|
+
let l = a * t._w + s * t._x + n * t._y + i * t._z;
|
|
527
531
|
if (l < 0 ? (this._w = -t._w, this._x = -t._x, this._y = -t._y, this._z = -t._z, l = -l) : this.copy(t), l >= 1)
|
|
528
|
-
return this._w =
|
|
529
|
-
const
|
|
530
|
-
if (
|
|
532
|
+
return this._w = a, this._x = s, this._y = n, this._z = i, this;
|
|
533
|
+
const y = 1 - l * l;
|
|
534
|
+
if (y <= Number.EPSILON) {
|
|
531
535
|
const u = 1 - e;
|
|
532
|
-
return this._w = u *
|
|
536
|
+
return this._w = u * a + e * this._w, this._x = u * s + e * this._x, this._y = u * n + e * this._y, this._z = u * i + e * this._z, this.normalize(), this._onChangeCallback(), this;
|
|
533
537
|
}
|
|
534
|
-
const c = Math.sqrt(
|
|
535
|
-
return this._w =
|
|
538
|
+
const c = Math.sqrt(y), h = Math.atan2(c, l), o = Math.sin((1 - e) * h) / c, _ = Math.sin(e * h) / c;
|
|
539
|
+
return this._w = a * o + this._w * _, this._x = s * o + this._x * _, this._y = n * o + this._y * _, this._z = i * o + this._z * _, this._onChangeCallback(), this;
|
|
536
540
|
}
|
|
537
541
|
slerpQuaternions(t, e, s) {
|
|
538
542
|
return this.copy(t).slerp(e, s);
|
|
@@ -667,12 +671,12 @@ class $ {
|
|
|
667
671
|
return this.applyMatrix3(t).normalize();
|
|
668
672
|
}
|
|
669
673
|
applyMatrix4(t) {
|
|
670
|
-
const e = this.x, s = this.y, n = this.z, i = t.elements,
|
|
671
|
-
return this.x = (i[0] * e + i[4] * s + i[8] * n + i[12]) *
|
|
674
|
+
const e = this.x, s = this.y, n = this.z, i = t.elements, a = 1 / (i[3] * e + i[7] * s + i[11] * n + i[15]);
|
|
675
|
+
return this.x = (i[0] * e + i[4] * s + i[8] * n + i[12]) * a, this.y = (i[1] * e + i[5] * s + i[9] * n + i[13]) * a, this.z = (i[2] * e + i[6] * s + i[10] * n + i[14]) * a, this;
|
|
672
676
|
}
|
|
673
677
|
applyQuaternion(t) {
|
|
674
|
-
const e = this.x, s = this.y, n = this.z, i = t.x,
|
|
675
|
-
return this.x = c *
|
|
678
|
+
const e = this.x, s = this.y, n = this.z, i = t.x, a = t.y, l = t.z, y = t.w, c = y * e + a * n - l * s, h = y * s + l * e - i * n, o = y * n + i * s - a * e, _ = -i * e - a * s - l * n;
|
|
679
|
+
return this.x = c * y + _ * -i + h * -l - o * -a, this.y = h * y + _ * -a + o * -i - c * -l, this.z = o * y + _ * -l + c * -a - h * -i, this;
|
|
676
680
|
}
|
|
677
681
|
project(t) {
|
|
678
682
|
return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix);
|
|
@@ -750,8 +754,8 @@ class $ {
|
|
|
750
754
|
return this.crossVectors(this, t);
|
|
751
755
|
}
|
|
752
756
|
crossVectors(t, e) {
|
|
753
|
-
const s = t.x, n = t.y, i = t.z,
|
|
754
|
-
return this.x = n *
|
|
757
|
+
const s = t.x, n = t.y, i = t.z, a = e.x, l = e.y, y = e.z;
|
|
758
|
+
return this.x = n * y - i * l, this.y = i * a - s * y, this.z = s * l - n * a, this;
|
|
755
759
|
}
|
|
756
760
|
projectOnVector(t) {
|
|
757
761
|
const e = t.lengthSq();
|
|
@@ -909,32 +913,32 @@ const Ut = { class: "flex px-4 justify-between gap-4 items-center mb-2" }, Kt =
|
|
|
909
913
|
emits: ["change"],
|
|
910
914
|
setup(r, { emit: t }) {
|
|
911
915
|
const e = r;
|
|
912
|
-
function s(
|
|
913
|
-
const { target: o } =
|
|
916
|
+
function s(h) {
|
|
917
|
+
const { target: o } = h;
|
|
914
918
|
t("change", o.valueAsNumber);
|
|
915
919
|
}
|
|
916
|
-
const n = Y(), i = g(0),
|
|
917
|
-
i.value =
|
|
918
|
-
},
|
|
919
|
-
|
|
920
|
-
}, c = (
|
|
921
|
-
return
|
|
922
|
-
if (
|
|
923
|
-
const o =
|
|
924
|
-
o > 0 ? t("change", e.control.value + 1 +
|
|
920
|
+
const n = Y(), i = g(0), a = g(!1), l = (h) => {
|
|
921
|
+
i.value = h.clientX, a.value = !0;
|
|
922
|
+
}, y = () => {
|
|
923
|
+
a.value = !1;
|
|
924
|
+
}, c = (h) => Math.floor(Math.abs(h) / 10);
|
|
925
|
+
return I(n.x, (h) => {
|
|
926
|
+
if (a.value) {
|
|
927
|
+
const o = h - i.value, _ = c(o);
|
|
928
|
+
o > 0 ? t("change", e.control.value + 1 + _) : o < 0 && t("change", e.control.value - 1 + _), e.control.min !== void 0 && e.control.value < e.control.min && t("change", e.control.min), e.control.max !== void 0 && e.control.value > e.control.max && t("change", e.control.max), i.value = h;
|
|
925
929
|
}
|
|
926
|
-
}), (
|
|
927
|
-
p("label", Kt, C(
|
|
930
|
+
}), (h, o) => (d(), b("div", Ut, [
|
|
931
|
+
p("label", Kt, C(h.label), 1),
|
|
928
932
|
p("input", {
|
|
929
|
-
value:
|
|
930
|
-
class: k(["p-2 w-1/3 rounded text-right text-xs text-gray-400 bg-gray-100 focus:border-gray-200 outline-none border-none font-sans", { "cursor-ew-resize":
|
|
933
|
+
value: h.control.value,
|
|
934
|
+
class: k(["p-2 w-1/3 rounded text-right text-xs text-gray-400 bg-gray-100 focus:border-gray-200 outline-none border-none font-sans", { "cursor-ew-resize": a.value }]),
|
|
931
935
|
type: "number",
|
|
932
|
-
min:
|
|
933
|
-
max:
|
|
934
|
-
step:
|
|
936
|
+
min: h.control.min,
|
|
937
|
+
max: h.control.max,
|
|
938
|
+
step: h.control.step,
|
|
935
939
|
onInput: s,
|
|
936
940
|
onMousedown: l,
|
|
937
|
-
onMouseup:
|
|
941
|
+
onMouseup: y
|
|
938
942
|
}, null, 42, Gt)
|
|
939
943
|
]));
|
|
940
944
|
}
|
|
@@ -1004,22 +1008,22 @@ const Ut = { class: "flex px-4 justify-between gap-4 items-center mb-2" }, Kt =
|
|
|
1004
1008
|
setup(r, { emit: t }) {
|
|
1005
1009
|
const e = r;
|
|
1006
1010
|
function s(o) {
|
|
1007
|
-
const { target:
|
|
1008
|
-
t("change",
|
|
1011
|
+
const { target: _ } = o;
|
|
1012
|
+
t("change", _.valueAsNumber);
|
|
1009
1013
|
}
|
|
1010
|
-
const n =
|
|
1014
|
+
const n = E(() => ({
|
|
1011
1015
|
backgroundImage: `linear-gradient(to right, #333 0% ${100 * (e.control.value - (e.control.min || 0)) / ((e.control.max || 100) - (e.control.min || 0))}%, #e2e2e2 0%)`
|
|
1012
|
-
})), i = Y(),
|
|
1013
|
-
|
|
1016
|
+
})), i = Y(), a = g(0), l = g(!1), y = (o) => {
|
|
1017
|
+
a.value = o.clientX, l.value = !0;
|
|
1014
1018
|
}, c = () => {
|
|
1015
1019
|
l.value = !1;
|
|
1016
|
-
},
|
|
1017
|
-
return
|
|
1020
|
+
}, h = (o) => Math.floor(Math.abs(o) / 10);
|
|
1021
|
+
return I(i.x, (o) => {
|
|
1018
1022
|
if (l.value) {
|
|
1019
|
-
const
|
|
1020
|
-
|
|
1023
|
+
const _ = o - a.value, u = h(_);
|
|
1024
|
+
_ > 0 ? t("change", e.control.value + 1 + u) : _ < 0 && t("change", e.control.value - 1 + u), e.control.min !== void 0 && e.control.value < e.control.min && t("change", e.control.min), e.control.max !== void 0 && e.control.value > e.control.max && t("change", e.control.max), a.value = o;
|
|
1021
1025
|
}
|
|
1022
|
-
}), (o,
|
|
1026
|
+
}), (o, _) => (d(), b("div", le, [
|
|
1023
1027
|
p("label", {
|
|
1024
1028
|
class: k(["text-gray-500 w-1/3", { "flex justify-between items-center": o.control.icon }])
|
|
1025
1029
|
}, [
|
|
@@ -1046,7 +1050,7 @@ const Ut = { class: "flex px-4 justify-between gap-4 items-center mb-2" }, Kt =
|
|
|
1046
1050
|
max: o.control.max,
|
|
1047
1051
|
step: o.control.step,
|
|
1048
1052
|
onInput: s,
|
|
1049
|
-
onMousedown:
|
|
1053
|
+
onMousedown: y,
|
|
1050
1054
|
onMouseup: c
|
|
1051
1055
|
}, null, 42, ce)
|
|
1052
1056
|
]));
|
|
@@ -1099,41 +1103,41 @@ const ze = { class: "flex px-4 justify-between gap-2 items-center mb-2" }, Me =
|
|
|
1099
1103
|
},
|
|
1100
1104
|
emits: ["change"],
|
|
1101
1105
|
setup(r, { emit: t }) {
|
|
1102
|
-
const e = r, s = Y(), n = g(0), i = g(!1),
|
|
1103
|
-
|
|
1104
|
-
},
|
|
1105
|
-
|
|
1106
|
-
}, c = (x) => Math.floor(Math.abs(x) / 10),
|
|
1106
|
+
const e = r, s = Y(), n = g(0), i = g(!1), a = g(0), l = (x, m) => {
|
|
1107
|
+
a.value = m, n.value = x.clientX, i.value = !0;
|
|
1108
|
+
}, y = (x, m) => {
|
|
1109
|
+
a.value = m, i.value = !1;
|
|
1110
|
+
}, c = (x) => Math.floor(Math.abs(x) / 10), h = E(() => be(e.control.value)), o = E(() => Object.keys(e.control.value)), _ = E(() => e.control.value instanceof H || e.control.value instanceof $);
|
|
1107
1111
|
function u(x, m) {
|
|
1108
1112
|
const { value: z } = e.control, { target: f } = x;
|
|
1109
|
-
|
|
1113
|
+
a.value = m, z[_.value ? o.value[a.value] : a.value] = parseInt(f.value, 10), t("change", z);
|
|
1110
1114
|
}
|
|
1111
|
-
return
|
|
1115
|
+
return I(s.x, (x) => {
|
|
1112
1116
|
if (i.value) {
|
|
1113
|
-
const m = x - n.value, z = c(m), { value: f } = e.control, M =
|
|
1117
|
+
const m = x - n.value, z = c(m), { value: f } = e.control, M = _.value ? o.value[a.value] : a.value;
|
|
1114
1118
|
m > 0 ? f[M] += 1 + z : m < 0 && (f[M] -= 1 + z), e.control.min !== void 0 && f < e.control.min && (f[M] = e.control.min), e.control.max !== void 0 && f > e.control.max && (f[M] = e.control.max), t("change", f), n.value = x;
|
|
1115
1119
|
}
|
|
1116
1120
|
}), (x, m) => (d(), b("div", ze, [
|
|
1117
1121
|
p("label", Me, C(x.label), 1),
|
|
1118
1122
|
p("div", we, [
|
|
1119
|
-
(d(!0), b(D, null, R(
|
|
1123
|
+
(d(!0), b(D, null, R(h.value, (z, f) => (d(), b("div", {
|
|
1120
1124
|
key: x.label + f,
|
|
1121
1125
|
class: "flex items-center w-1/3 bg-gray-100 rounded"
|
|
1122
1126
|
}, [
|
|
1123
|
-
o.value[f] &&
|
|
1127
|
+
o.value[f] && _.value ? (d(), b("span", ve, C(o.value[f]), 1)) : nt("", !0),
|
|
1124
1128
|
p("input", {
|
|
1125
1129
|
type: "text",
|
|
1126
1130
|
class: k(["w-full pl-0 p-1 text-right text-0.65rem text-gray-400 bg-transparent focus:border-gray-200 outline-none border-none font-sans", { "cursor-ew-resize": i.value }]),
|
|
1127
|
-
value:
|
|
1131
|
+
value: h.value[f].toFixed(2),
|
|
1128
1132
|
onInput: (M) => u(M, f),
|
|
1129
1133
|
onMousedown: (M) => l(M, f),
|
|
1130
|
-
onMouseup: (M) =>
|
|
1134
|
+
onMouseup: (M) => y(M, f)
|
|
1131
1135
|
}, null, 42, Ce)
|
|
1132
1136
|
]))), 128))
|
|
1133
1137
|
])
|
|
1134
1138
|
]));
|
|
1135
1139
|
}
|
|
1136
|
-
}), ke = { class: "mb-4" }, $e = { class: "bg-white rounded-b pt-4" },
|
|
1140
|
+
}), ke = { class: "mb-4" }, $e = { class: "bg-white rounded-b pt-4" }, Ee = /* @__PURE__ */ v({
|
|
1137
1141
|
__name: "Folder",
|
|
1138
1142
|
props: {
|
|
1139
1143
|
control: {}
|
|
@@ -1162,10 +1166,10 @@ const ze = { class: "flex px-4 justify-between gap-2 items-center mb-2" }, Me =
|
|
|
1162
1166
|
}, {
|
|
1163
1167
|
default: it(() => [
|
|
1164
1168
|
et(p("div", $e, [
|
|
1165
|
-
(d(!0), b(D, null, R(n.control.controls, (
|
|
1166
|
-
key:
|
|
1167
|
-
control:
|
|
1168
|
-
onChange: (l) => t(l,
|
|
1169
|
+
(d(!0), b(D, null, R(n.control.controls, (a) => (d(), w(ut, {
|
|
1170
|
+
key: a.label,
|
|
1171
|
+
control: a,
|
|
1172
|
+
onChange: (l) => t(l, a)
|
|
1169
1173
|
}, null, 8, ["control", "onChange"]))), 128))
|
|
1170
1174
|
], 512), [
|
|
1171
1175
|
[st, e.value]
|
|
@@ -1175,21 +1179,21 @@ const ze = { class: "flex px-4 justify-between gap-2 items-center mb-2" }, Me =
|
|
|
1175
1179
|
})
|
|
1176
1180
|
]));
|
|
1177
1181
|
}
|
|
1178
|
-
}),
|
|
1182
|
+
}), Ie = { class: "flex px-4 justify-between gap-4 items-center mb-2" }, Ae = { class: "text-gray-500 w-1/3" }, Te = { class: "relative w-2/3 p-1 rounded text-right text-xs text-gray-400 bg-gray-100 focus:border-gray-200 outline-none border-none font-sans" }, je = { class: "absolute bottom-0.5 right-0.5 font-sans text-xs" }, qe = ["points"], G = 160, F = 40, A = 2, J = 100, O = 20, Pe = /* @__PURE__ */ v({
|
|
1179
1183
|
__name: "FPSGraph",
|
|
1180
1184
|
props: {
|
|
1181
1185
|
label: {},
|
|
1182
1186
|
control: {}
|
|
1183
1187
|
},
|
|
1184
1188
|
setup(r) {
|
|
1185
|
-
const t = kt({ every: J }), e = g(""), s = g([]), n = g(G /
|
|
1189
|
+
const t = kt({ every: J }), e = g(""), s = g([]), n = g(G / A);
|
|
1186
1190
|
let i = performance.now();
|
|
1187
|
-
return $t(({ timestamp:
|
|
1188
|
-
|
|
1189
|
-
(l,
|
|
1191
|
+
return $t(({ timestamp: a }) => {
|
|
1192
|
+
a - i >= J && (i = a, s.value.push(t.value), s.value.length > n.value && s.value.shift(), e.value = s.value.map(
|
|
1193
|
+
(l, y) => `${y * A},${F + O - A / 2 - l * (F + O - A) / 120}`
|
|
1190
1194
|
).join(" "));
|
|
1191
|
-
}), (
|
|
1192
|
-
p("label",
|
|
1195
|
+
}), (a, l) => (d(), b("div", Ie, [
|
|
1196
|
+
p("label", Ae, C(a.label), 1),
|
|
1193
1197
|
p("div", Te, [
|
|
1194
1198
|
p("div", je, C(Math.round(T(t))) + " FPS", 1),
|
|
1195
1199
|
(d(), b("svg", {
|
|
@@ -1202,7 +1206,7 @@ const ze = { class: "flex px-4 justify-between gap-2 items-center mb-2" }, Me =
|
|
|
1202
1206
|
points: e.value,
|
|
1203
1207
|
fill: "none",
|
|
1204
1208
|
stroke: "lightgray",
|
|
1205
|
-
"stroke-width":
|
|
1209
|
+
"stroke-width": A,
|
|
1206
1210
|
"stroke-linecap": "round",
|
|
1207
1211
|
"stroke-linejoin": "round"
|
|
1208
1212
|
}, null, 8, qe)
|
|
@@ -1240,7 +1244,7 @@ const ze = { class: "flex px-4 justify-between gap-2 items-center mb-2" }, Me =
|
|
|
1240
1244
|
key: 3,
|
|
1241
1245
|
label: s.control.label,
|
|
1242
1246
|
control: s.control
|
|
1243
|
-
}, null, 8, ["label", "control"])) : s.control.type === "folder" ? (d(), w(
|
|
1247
|
+
}, null, 8, ["label", "control"])) : s.control.type === "folder" ? (d(), w(Ee, {
|
|
1244
1248
|
key: 4,
|
|
1245
1249
|
label: s.control.label,
|
|
1246
1250
|
control: s.control
|
|
@@ -1273,11 +1277,11 @@ const ze = { class: "flex px-4 justify-between gap-2 items-center mb-2" }, Me =
|
|
|
1273
1277
|
], Re = 280, Qe = /* @__PURE__ */ v({
|
|
1274
1278
|
__name: "TresLeches",
|
|
1275
1279
|
setup(r) {
|
|
1276
|
-
const { width: t } =
|
|
1277
|
-
function n(i,
|
|
1278
|
-
|
|
1280
|
+
const { width: t } = Et(), e = g(null), s = Zt();
|
|
1281
|
+
function n(i, a) {
|
|
1282
|
+
a.ref && (a.ref[a.label] = i), a.value = i;
|
|
1279
1283
|
}
|
|
1280
|
-
return (i,
|
|
1284
|
+
return (i, a) => (d(), w(T(Yt), {
|
|
1281
1285
|
"initial-value": { x: T(t) - Re - 20, y: 10 },
|
|
1282
1286
|
class: "fixed select-none z-24 w-280px font-sans text-xs",
|
|
1283
1287
|
handle: e.value
|
|
@@ -1292,7 +1296,7 @@ const ze = { class: "flex px-4 justify-between gap-2 items-center mb-2" }, Me =
|
|
|
1292
1296
|
(d(!0), b(D, null, R(T(s).controls, (l) => (d(), w(ut, {
|
|
1293
1297
|
key: l.label,
|
|
1294
1298
|
control: l,
|
|
1295
|
-
onChange: (
|
|
1299
|
+
onChange: (y) => n(y, l)
|
|
1296
1300
|
}, null, 8, ["control", "onChange"]))), 128))
|
|
1297
1301
|
])
|
|
1298
1302
|
]),
|
package/dist/tresleches.umd.cjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* name: @tresjs/leches
|
|
3
|
-
* version: v0.3.
|
|
3
|
+
* version: v0.3.1
|
|
4
4
|
* (c) 2023
|
|
5
5
|
* description: Tasty GUI for Vue controls 🍰
|
|
6
6
|
* author: Alvaro Saburido <hola@alvarosaburido.dev> (https://github.com/alvarosabu/)
|
|
7
7
|
*/
|
|
8
|
-
(function(b,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("vue"),require("@vueuse/core")):typeof define=="function"&&define.amd?define(["exports","vue","@vueuse/core"],n):(b=typeof globalThis<"u"?globalThis:b||self,n(b.tresleches={},b.Vue,b.VueUseCore))})(this,function(b,n,z){"use strict";const ie="",oe="";function A(r){return n.getCurrentScope()?(n.onScopeDispose(r),!0):!1}function k(r){return typeof r=="function"?r():n.unref(r)}const T=typeof window<"u",D=()=>{},j=U();function U(){var r;return T&&((r=window==null?void 0:window.navigator)==null?void 0:r.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent)}function K(...r){if(r.length!==1)return n.toRef(...r);const t=r[0];return typeof t=="function"?n.readonly(n.customRef(()=>({get:t,set:D}))):n.ref(t)}function G(r){var t;const e=k(r);return(t=e==null?void 0:e.$el)!=null?t:e}const J=T?window:void 0;function O(...r){let t,e,s,i;if(typeof r[0]=="string"||Array.isArray(r[0])?([e,s,i]=r,t=J):[t,e,s,i]=r,!t)return D;Array.isArray(e)||(e=[e]),Array.isArray(s)||(s=[s]);const o=[],
|
|
8
|
+
(function(b,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("vue"),require("@vueuse/core")):typeof define=="function"&&define.amd?define(["exports","vue","@vueuse/core"],n):(b=typeof globalThis<"u"?globalThis:b||self,n(b.tresleches={},b.Vue,b.VueUseCore))})(this,function(b,n,z){"use strict";const ie="",oe="";function A(r){return n.getCurrentScope()?(n.onScopeDispose(r),!0):!1}function k(r){return typeof r=="function"?r():n.unref(r)}const T=typeof window<"u",D=()=>{},j=U();function U(){var r;return T&&((r=window==null?void 0:window.navigator)==null?void 0:r.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent)}function K(...r){if(r.length!==1)return n.toRef(...r);const t=r[0];return typeof t=="function"?n.readonly(n.customRef(()=>({get:t,set:D}))):n.ref(t)}function G(r){var t;const e=k(r);return(t=e==null?void 0:e.$el)!=null?t:e}const J=T?window:void 0;function O(...r){let t,e,s,i;if(typeof r[0]=="string"||Array.isArray(r[0])?([e,s,i]=r,t=J):[t,e,s,i]=r,!t)return D;Array.isArray(e)||(e=[e]),Array.isArray(s)||(s=[s]);const o=[],h=()=>{o.forEach(l=>l()),o.length=0},c=(l,a,_,u)=>(l.addEventListener(a,_,u),()=>l.removeEventListener(a,_,u)),d=n.watch(()=>[G(t),k(i)],([l,a])=>{h(),l&&o.push(...e.flatMap(_=>s.map(u=>c(l,_,u,a))))},{immediate:!0,flush:"post"}),y=()=>{d(),h()};return A(y),y}var v=Object.defineProperty,tt=Object.defineProperties,et=Object.getOwnPropertyDescriptors,q=Object.getOwnPropertySymbols,st=Object.prototype.hasOwnProperty,nt=Object.prototype.propertyIsEnumerable,P=(r,t,e)=>t in r?v(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,it=(r,t)=>{for(var e in t||(t={}))st.call(t,e)&&P(r,e,t[e]);if(q)for(var e of q(t))nt.call(t,e)&&P(r,e,t[e]);return r},ot=(r,t)=>tt(r,et(t));const rt=n.defineComponent({name:"UseDraggable",props:["storageKey","storageType","initialValue","exact","preventDefault","stopPropagation","pointerTypes","as","handle","axis","onStart","onMove","onEnd"],setup(r,{slots:t}){const e=n.ref(),s=n.computed(()=>{var d;return(d=r.handle)!=null?d:e.value}),i=r.storageKey&&z.useStorage(r.storageKey,k(r.initialValue)||{x:0,y:0},z.isClient?r.storageType==="session"?sessionStorage:localStorage:void 0),o=i||r.initialValue||{x:0,y:0},h=(d,y)=>{var l;(l=r.onEnd)==null||l.call(r,d,y),i&&(i.value.x=d.x,i.value.y=d.y)},c=n.reactive(z.useDraggable(e,ot(it({},r),{handle:s,initialValue:o,onEnd:h})));return()=>{if(t.default)return n.h(r.as||"div",{ref:e,style:`touch-action:none;${c.style}`},t.default(c))}}});function L(r){const t=window.getComputedStyle(r);if(t.overflowX==="scroll"||t.overflowY==="scroll"||t.overflowX==="auto"&&r.clientWidth<r.scrollWidth||t.overflowY==="auto"&&r.clientHeight<r.scrollHeight)return!0;{const e=r.parentNode;return!e||e.tagName==="BODY"?!1:L(e)}}function at(r){const t=r||window.event,e=t.target;return L(e)?!1:t.touches.length>1?!0:(t.preventDefault&&t.preventDefault(),!1)}function lt(r,t=!1){const e=n.ref(t);let s=null,i;n.watch(K(r),c=>{if(c){const d=c;i=d.style.overflow,e.value&&(d.style.overflow="hidden")}},{immediate:!0});const o=()=>{const c=k(r);!c||e.value||(j&&(s=O(c,"touchmove",d=>{at(d)},{passive:!1})),c.style.overflow="hidden",e.value=!0)},h=()=>{const c=k(r);!c||!e.value||(j&&(s==null||s()),c.style.overflow=i,e.value=!1)};return A(h),n.computed({get(){return e.value},set(c){c?o():h()}})}function ht(){let r=!1;const t=n.ref(!1);return(e,s)=>{if(t.value=s.value,r)return;r=!0;const i=lt(e,s.value);n.watch(t,o=>i.value=o)}}ht();/**
|
|
9
9
|
* @license
|
|
10
10
|
* Copyright 2010-2023 Three.js Authors
|
|
11
11
|
* SPDX-License-Identifier: MIT
|
|
12
|
-
*/const F="152";function V(r,t,e){return Math.max(t,Math.min(e,r))}class B{constructor(t=0,e=0){B.prototype.isVector2=!0,this.x=t,this.y=e}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,e){return this.x=t,this.y=e,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){const e=this.x,s=this.y,i=t.elements;return this.x=i[0]*e+i[3]*s+i[6],this.y=i[1]*e+i[4]*s+i[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this}clampLength(t,e){const s=this.length();return this.divideScalar(s||1).multiplyScalar(Math.max(t,Math.min(e,s)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;const s=this.dot(t)/e;return Math.acos(V(s,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,s=this.y-t.y;return e*e+s*s}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,s){return this.x=t.x+(e.x-t.x)*s,this.y=t.y+(e.y-t.y)*s,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this}rotateAround(t,e){const s=Math.cos(e),i=Math.sin(e),o=this.x-t.x,l=this.y-t.y;return this.x=o*s-l*i+t.x,this.y=o*i+l*s+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class ct{constructor(t=0,e=0,s=0,i=1){this.isQuaternion=!0,this._x=t,this._y=e,this._z=s,this._w=i}static slerpFlat(t,e,s,i,o,l,c){let d=s[i+0],y=s[i+1],h=s[i+2],a=s[i+3];const p=o[l+0],u=o[l+1],_=o[l+2],m=o[l+3];if(c===0){t[e+0]=d,t[e+1]=y,t[e+2]=h,t[e+3]=a;return}if(c===1){t[e+0]=p,t[e+1]=u,t[e+2]=_,t[e+3]=m;return}if(a!==m||d!==p||y!==u||h!==_){let f=1-c;const x=d*p+y*u+h*_+a*m,g=x>=0?1:-1,W=1-x*x;if(W>Number.EPSILON){const w=Math.sqrt(W),Z=Math.atan2(w,x*g);f=Math.sin(f*Z)/w,c=Math.sin(c*Z)/w}const E=c*g;if(d=d*f+p*E,y=y*f+u*E,h=h*f+_*E,a=a*f+m*E,f===1-c){const w=1/Math.sqrt(d*d+y*y+h*h+a*a);d*=w,y*=w,h*=w,a*=w}}t[e]=d,t[e+1]=y,t[e+2]=h,t[e+3]=a}static multiplyQuaternionsFlat(t,e,s,i,o,l){const c=s[i],d=s[i+1],y=s[i+2],h=s[i+3],a=o[l],p=o[l+1],u=o[l+2],_=o[l+3];return t[e]=c*_+h*a+d*u-y*p,t[e+1]=d*_+h*p+y*a-c*u,t[e+2]=y*_+h*u+c*p-d*a,t[e+3]=h*_-c*a-d*p-y*u,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,e,s,i){return this._x=t,this._y=e,this._z=s,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,e){const s=t._x,i=t._y,o=t._z,l=t._order,c=Math.cos,d=Math.sin,y=c(s/2),h=c(i/2),a=c(o/2),p=d(s/2),u=d(i/2),_=d(o/2);switch(l){case"XYZ":this._x=p*h*a+y*u*_,this._y=y*u*a-p*h*_,this._z=y*h*_+p*u*a,this._w=y*h*a-p*u*_;break;case"YXZ":this._x=p*h*a+y*u*_,this._y=y*u*a-p*h*_,this._z=y*h*_-p*u*a,this._w=y*h*a+p*u*_;break;case"ZXY":this._x=p*h*a-y*u*_,this._y=y*u*a+p*h*_,this._z=y*h*_+p*u*a,this._w=y*h*a-p*u*_;break;case"ZYX":this._x=p*h*a-y*u*_,this._y=y*u*a+p*h*_,this._z=y*h*_-p*u*a,this._w=y*h*a+p*u*_;break;case"YZX":this._x=p*h*a+y*u*_,this._y=y*u*a+p*h*_,this._z=y*h*_-p*u*a,this._w=y*h*a-p*u*_;break;case"XZY":this._x=p*h*a-y*u*_,this._y=y*u*a-p*h*_,this._z=y*h*_+p*u*a,this._w=y*h*a+p*u*_;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+l)}return e!==!1&&this._onChangeCallback(),this}setFromAxisAngle(t,e){const s=e/2,i=Math.sin(s);return this._x=t.x*i,this._y=t.y*i,this._z=t.z*i,this._w=Math.cos(s),this._onChangeCallback(),this}setFromRotationMatrix(t){const e=t.elements,s=e[0],i=e[4],o=e[8],l=e[1],c=e[5],d=e[9],y=e[2],h=e[6],a=e[10],p=s+c+a;if(p>0){const u=.5/Math.sqrt(p+1);this._w=.25/u,this._x=(h-d)*u,this._y=(o-y)*u,this._z=(l-i)*u}else if(s>c&&s>a){const u=2*Math.sqrt(1+s-c-a);this._w=(h-d)/u,this._x=.25*u,this._y=(i+l)/u,this._z=(o+y)/u}else if(c>a){const u=2*Math.sqrt(1+c-s-a);this._w=(o-y)/u,this._x=(i+l)/u,this._y=.25*u,this._z=(d+h)/u}else{const u=2*Math.sqrt(1+a-s-c);this._w=(l-i)/u,this._x=(o+y)/u,this._y=(d+h)/u,this._z=.25*u}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let s=t.dot(e)+1;return s<Number.EPSILON?(s=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=s):(this._x=0,this._y=-t.z,this._z=t.y,this._w=s)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=s),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(V(this.dot(t),-1,1)))}rotateTowards(t,e){const s=this.angleTo(t);if(s===0)return this;const i=Math.min(1,e/s);return this.slerp(t,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let t=this.length();return t===0?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,e){const s=t._x,i=t._y,o=t._z,l=t._w,c=e._x,d=e._y,y=e._z,h=e._w;return this._x=s*h+l*c+i*y-o*d,this._y=i*h+l*d+o*c-s*y,this._z=o*h+l*y+s*d-i*c,this._w=l*h-s*c-i*d-o*y,this._onChangeCallback(),this}slerp(t,e){if(e===0)return this;if(e===1)return this.copy(t);const s=this._x,i=this._y,o=this._z,l=this._w;let c=l*t._w+s*t._x+i*t._y+o*t._z;if(c<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,c=-c):this.copy(t),c>=1)return this._w=l,this._x=s,this._y=i,this._z=o,this;const d=1-c*c;if(d<=Number.EPSILON){const u=1-e;return this._w=u*l+e*this._w,this._x=u*s+e*this._x,this._y=u*i+e*this._y,this._z=u*o+e*this._z,this.normalize(),this._onChangeCallback(),this}const y=Math.sqrt(d),h=Math.atan2(y,c),a=Math.sin((1-e)*h)/y,p=Math.sin(e*h)/y;return this._w=l*a+this._w*p,this._x=s*a+this._x*p,this._y=i*a+this._y*p,this._z=o*a+this._z*p,this._onChangeCallback(),this}slerpQuaternions(t,e,s){return this.copy(t).slerp(e,s)}random(){const t=Math.random(),e=Math.sqrt(1-t),s=Math.sqrt(t),i=2*Math.PI*Math.random(),o=2*Math.PI*Math.random();return this.set(e*Math.cos(i),s*Math.sin(o),s*Math.cos(o),e*Math.sin(i))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,e=0){return this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t}fromBufferAttribute(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this}toJSON(){return this.toArray()}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class M{constructor(t=0,e=0,s=0){M.prototype.isVector3=!0,this.x=t,this.y=e,this.z=s}set(t,e,s){return s===void 0&&(s=this.z),this.x=t,this.y=e,this.z=s,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}applyEuler(t){return this.applyQuaternion(R.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(R.setFromAxisAngle(t,e))}applyMatrix3(t){const e=this.x,s=this.y,i=this.z,o=t.elements;return this.x=o[0]*e+o[3]*s+o[6]*i,this.y=o[1]*e+o[4]*s+o[7]*i,this.z=o[2]*e+o[5]*s+o[8]*i,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const e=this.x,s=this.y,i=this.z,o=t.elements,l=1/(o[3]*e+o[7]*s+o[11]*i+o[15]);return this.x=(o[0]*e+o[4]*s+o[8]*i+o[12])*l,this.y=(o[1]*e+o[5]*s+o[9]*i+o[13])*l,this.z=(o[2]*e+o[6]*s+o[10]*i+o[14])*l,this}applyQuaternion(t){const e=this.x,s=this.y,i=this.z,o=t.x,l=t.y,c=t.z,d=t.w,y=d*e+l*i-c*s,h=d*s+c*e-o*i,a=d*i+o*s-l*e,p=-o*e-l*s-c*i;return this.x=y*d+p*-o+h*-c-a*-l,this.y=h*d+p*-l+a*-o-y*-c,this.z=a*d+p*-c+y*-l-h*-o,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){const e=this.x,s=this.y,i=this.z,o=t.elements;return this.x=o[0]*e+o[4]*s+o[8]*i,this.y=o[1]*e+o[5]*s+o[9]*i,this.z=o[2]*e+o[6]*s+o[10]*i,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this}clampLength(t,e){const s=this.length();return this.divideScalar(s||1).multiplyScalar(Math.max(t,Math.min(e,s)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this}lerpVectors(t,e,s){return this.x=t.x+(e.x-t.x)*s,this.y=t.y+(e.y-t.y)*s,this.z=t.z+(e.z-t.z)*s,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,e){const s=t.x,i=t.y,o=t.z,l=e.x,c=e.y,d=e.z;return this.x=i*d-o*c,this.y=o*l-s*d,this.z=s*c-i*l,this}projectOnVector(t){const e=t.lengthSq();if(e===0)return this.set(0,0,0);const s=t.dot(this)/e;return this.copy(t).multiplyScalar(s)}projectOnPlane(t){return $.copy(this).projectOnVector(t),this.sub($)}reflect(t){return this.sub($.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;const s=this.dot(t)/e;return Math.acos(V(s,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,s=this.y-t.y,i=this.z-t.z;return e*e+s*s+i*i}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,e,s){const i=Math.sin(e)*t;return this.x=i*Math.sin(s),this.y=Math.cos(e)*t,this.z=i*Math.cos(s),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,e,s){return this.x=t*Math.sin(e),this.y=s,this.z=t*Math.cos(e),this}setFromMatrixPosition(t){const e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(t){const e=this.setFromMatrixColumn(t,0).length(),s=this.setFromMatrixColumn(t,1).length(),i=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=s,this.z=i,this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,e*4)}setFromMatrix3Column(t,e){return this.fromArray(t.elements,e*3)}setFromEuler(t){return this.x=t._x,this.y=t._y,this.z=t._z,this}setFromColor(t){return this.x=t.r,this.y=t.g,this.z=t.b,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const t=(Math.random()-.5)*2,e=Math.random()*Math.PI*2,s=Math.sqrt(1-t**2);return this.x=s*Math.cos(e),this.y=s*Math.sin(e),this.z=t,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const $=new M,R=new ct;typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:F}})),typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=F);const C=n.reactive({controls:[]});function ut(){return C}function N(r){return Object.entries(r).map(([t,e])=>{let s="string",i;const o=/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$|^0x([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/;return!n.isRef(e)&&e.value||n.isRef(e)?(s=typeof e.value,i=e.value):(s=typeof e,i=e),s==="number"&&(e.step||e.max||e.min)&&(s="range"),s==="string"&&o.test(i)&&(s="color"),(i instanceof M||i instanceof M||i instanceof Array)&&(s="vector"),!n.isRef(e)&&e.value?{...e,label:e.label||t,value:e.value,type:s,visible:!0}:{label:e.label||t,value:e,type:s,visible:!0}})}function yt(){C.controls=[]}function pt(r,t,e){let s=[];if(typeof r=="string")r==="fpsgraph"?s.push({label:"fpsgraph",visible:!0,type:"fpsgraph"}):s.push({label:r,visible:!0,type:"folder",controls:N(t)});else if(typeof r=="object"&&typeof t=="string")s.push({...e,label:t,visible:!0,value:r[t],type:typeof r[t],ref:r});else if(n.isReactive(r)){const i=n.toRefs(r);s=N(i)}else s=N(r);return C.controls=[...C.controls,...s],n.onUnmounted(yt),{state:C,controls:s}}const dt={class:"flex px-4 justify-between gap-4 items-center mb-2"},_t={class:"text-gray-500 w-1/3"},xt=["value","min","max","step"],mt=n.defineComponent({__name:"NumberControl",props:{label:{},control:{}},emits:["change"],setup(r,{emit:t}){const e=r;function s(h){const{target:a}=h;t("change",a.valueAsNumber)}const i=z.useMouse(),o=n.ref(0),l=n.ref(!1),c=h=>{o.value=h.clientX,l.value=!0},d=()=>{l.value=!1},y=h=>Math.floor(Math.abs(h)/10);return n.watch(i.x,h=>{if(l.value){const a=h-o.value,p=y(a);a>0?t("change",e.control.value+1+p):a<0&&t("change",e.control.value-1+p),e.control.min!==void 0&&e.control.value<e.control.min&&t("change",e.control.min),e.control.max!==void 0&&e.control.value>e.control.max&&t("change",e.control.max),o.value=h}}),(h,a)=>(n.openBlock(),n.createElementBlock("div",dt,[n.createElementVNode("label",_t,n.toDisplayString(h.label),1),n.createElementVNode("input",{value:h.control.value,class:n.normalizeClass(["p-2 w-1/3 rounded text-right text-xs text-gray-400 bg-gray-100 focus:border-gray-200 outline-none border-none font-sans",{"cursor-ew-resize":l.value}]),type:"number",min:h.control.min,max:h.control.max,step:h.control.step,onInput:s,onMousedown:c,onMouseup:d},null,42,xt)]))}}),ft={class:"flex px-4 justify-between gap-4 items-center mb-2 min-h-32px"},gt={class:"text-gray-500 w-1/3"},bt=["value"],zt=n.defineComponent({__name:"TextControl",props:{label:{},control:{}},emits:["change"],setup(r,{emit:t}){function e(s){t("change",s)}return(s,i)=>(n.openBlock(),n.createElementBlock("div",ft,[n.createElementVNode("label",gt,n.toDisplayString(s.label),1),n.createElementVNode("input",{value:s.control.value,type:"string",class:"p-2 w-2/3 rounded text-right text-xs text-gray-400 bg-gray-100 focus:border-gray-200 outline-none border-none font-sans",onChange:e},null,40,bt)]))}}),wt={class:"flex px-4 justify-start gap-2 items-center mb-2 min-h-32px"},Mt={class:"text-gray-500 w-1/3"},kt=["id","checked"],Ct=["for"],St={class:"i-ic:baseline-check text-light"},Et=n.defineComponent({__name:"BooleanControl",props:{label:{},control:{}},emits:["change"],setup(r,{emit:t}){function e(s){const{target:i}=s;t("change",i.checked)}return(s,i)=>(n.openBlock(),n.createElementBlock("div",wt,[n.createElementVNode("label",Mt,n.toDisplayString(s.label),1),n.createElementVNode("input",{id:s.control.label,checked:s.control.value,class:"hidden",type:"checkbox",onInput:e},null,40,kt),n.createElementVNode("label",{for:s.control.label,class:"inline-flex items-center cursor-pointer"},[n.createElementVNode("span",{class:n.normalizeClass([{"bg-dark-500":s.control.value,"bg-gray-200":!s.control.value},"w-4 h-4 flex justify-center items-center rounded border border-gray-300 mr-2 transition-colors duration-200"])},[n.withDirectives(n.createElementVNode("i",St,null,512),[[n.vShow,s.control.value]])],2)],8,Ct)]))}}),Vt={class:"px-4 relative flex justify-between gap-4 items-center mb-2"},Bt=["value","min","max","step"],$t=["value","min","max","step"],Nt=n.defineComponent({__name:"SliderControl",props:{label:{},control:{}},emits:["change"],setup(r,{emit:t}){const e=r;function s(a){const{target:p}=a;t("change",p.valueAsNumber)}const i=n.computed(()=>({backgroundImage:`linear-gradient(to right, #333 0% ${100*(e.control.value-(e.control.min||0))/((e.control.max||100)-(e.control.min||0))}%, #e2e2e2 0%)`})),o=z.useMouse(),l=n.ref(0),c=n.ref(!1),d=a=>{l.value=a.clientX,c.value=!0},y=()=>{c.value=!1},h=a=>Math.floor(Math.abs(a)/10);return n.watch(o.x,a=>{if(c.value){const p=a-l.value,u=h(p);p>0?t("change",e.control.value+1+u):p<0&&t("change",e.control.value-1+u),e.control.min!==void 0&&e.control.value<e.control.min&&t("change",e.control.min),e.control.max!==void 0&&e.control.value>e.control.max&&t("change",e.control.max),l.value=a}}),(a,p)=>(n.openBlock(),n.createElementBlock("div",Vt,[n.createElementVNode("label",{class:n.normalizeClass(["text-gray-500 w-1/3",{"flex justify-between items-center":a.control.icon}])},[n.createTextVNode(n.toDisplayString(a.label)+" ",1),n.createElementVNode("i",{class:n.normalizeClass(`i-${a.control.icon}`)},null,2)],2),n.createElementVNode("input",{value:a.control.value,class:"w-1/2 h-0.75 bg-dark-200 rounded-full appearance-none",style:n.normalizeStyle(i.value),type:"range",min:a.control.min,max:a.control.max,step:a.control.step,onInput:s},null,44,Bt),n.createElementVNode("input",{value:a.control.value,class:n.normalizeClass(["p-2 w-1/4 rounded text-right text-xs text-gray-400 bg-gray-100 focus:border-gray-200 outline-none border-none font-sans",{"cursor-ew-resize":c.value}]),type:"number",min:a.control.min,max:a.control.max,step:a.control.step,onInput:s,onMousedown:d,onMouseup:y},null,42,$t)]))}}),re="",It=((r,t)=>{const e=r.__vccOpts||r;for(const[s,i]of t)e[s]=i;return e})(Nt,[["__scopeId","data-v-743fd350"]]),At={class:"flex px-4 justify-between gap-4 items-center mb-2"},Tt={class:"text-gray-500 w-1/3"},Dt=["value"],jt=["value"],qt=n.defineComponent({__name:"ColorControl",props:{label:{},control:{}},emits:["change"],setup(r,{emit:t}){function e(s){const{target:i}=s;t("change",i.value)}return(s,i)=>(n.openBlock(),n.createElementBlock("div",At,[n.createElementVNode("label",Tt,n.toDisplayString(s.label),1),n.createElementVNode("input",{value:s.control.value,type:"color",onInput:e},null,40,Dt),n.createElementVNode("input",{value:s.control.value,class:"p-2 w-2/3 rounded text-right text-xs text-gray-400 bg-gray-100 focus:border-gray-200 outline-none border-none font-sans",type:"text",onInput:e},null,40,jt)]))}}),le="";function Pt(r){return typeof r=="number"?[r,r,r]:r instanceof M?[r.x,r.y,r.z]:r}const Lt={class:"flex px-4 justify-between gap-2 items-center mb-2"},Ft={class:"text-gray-500 w-1/3"},Rt={class:"w-2/3 flex justify-between gap-1"},Xt={key:0,class:"font-bold px-0.5 py-1 text-0.65rem text-gray-300"},Yt=["value","onInput","onMousedown","onMouseup"],Ht=n.defineComponent({__name:"VectorControl",props:{label:{},control:{}},emits:["change"],setup(r,{emit:t}){const e=r,s=z.useMouse(),i=n.ref(0),o=n.ref(!1),l=n.ref(0),c=(_,m)=>{l.value=m,i.value=_.clientX,o.value=!0},d=(_,m)=>{l.value=m,o.value=!1},y=_=>Math.floor(Math.abs(_)/10),h=n.computed(()=>Pt(e.control.value)),a=n.computed(()=>Object.keys(e.control.value)),p=n.computed(()=>e.control.value instanceof B||e.control.value instanceof M);function u(_,m){const{value:f}=e.control,{target:x}=_;l.value=m,f[p.value?a.value[l.value]:l.value]=parseInt(x.value,10),t("change",f)}return n.watch(s.x,_=>{if(o.value){const m=_-i.value,f=y(m),{value:x}=e.control,g=p.value?a.value[l.value]:l.value;m>0?x[g]+=1+f:m<0&&(x[g]-=1+f),e.control.min!==void 0&&x<e.control.min&&(x[g]=e.control.min),e.control.max!==void 0&&x>e.control.max&&(x[g]=e.control.max),t("change",x),i.value=_}}),(_,m)=>(n.openBlock(),n.createElementBlock("div",Lt,[n.createElementVNode("label",Ft,n.toDisplayString(_.label),1),n.createElementVNode("div",Rt,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(h.value,(f,x)=>(n.openBlock(),n.createElementBlock("div",{key:_.label+x,class:"flex items-center w-1/3 bg-gray-100 rounded"},[a.value[x]&&p.value?(n.openBlock(),n.createElementBlock("span",Xt,n.toDisplayString(a.value[x]),1)):n.createCommentVNode("",!0),n.createElementVNode("input",{type:"text",class:n.normalizeClass(["w-full pl-0 p-1 text-right text-0.65rem text-gray-400 bg-transparent focus:border-gray-200 outline-none border-none font-sans",{"cursor-ew-resize":o.value}]),value:h.value[x].toFixed(2),onInput:g=>u(g,x),onMousedown:g=>c(g,x),onMouseup:g=>d(g,x)},null,42,Yt)]))),128))])]))}}),Qt={class:"mb-4"},Wt={class:"bg-white rounded-b pt-4"},Zt=n.defineComponent({__name:"Folder",props:{control:{}},setup(r){function t(i,o){o.value=i}const e=n.ref(!1),s=()=>{e.value=!e.value};return(i,o)=>(n.openBlock(),n.createElementBlock("div",Qt,[n.createElementVNode("button",{class:"flex items-center justify-between w-full p-4 bg-gray-100 border-none text-gray-400 font-bold text-xs focus:outline-none font-sans cursor-pointer",onClick:s},[n.createElementVNode("span",null,n.toDisplayString(i.control.label),1),n.createElementVNode("i",{class:n.normalizeClass(e.value?"i-ic:baseline-keyboard-arrow-up":"i-ic:baseline-keyboard-arrow-down")},null,2)]),n.createVNode(n.Transition,{name:"slide","enter-active-class":" animate-fade-in animate-duration-200 animate-ease-in-out","leave-active-class":" animate-fade-out animate-duration-200 animate-ease-in-out"},{default:n.withCtx(()=>[n.withDirectives(n.createElementVNode("div",Wt,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(i.control.controls,l=>(n.openBlock(),n.createBlock(Q,{key:l.label,control:l,onChange:c=>t(c,l)},null,8,["control","onChange"]))),128))],512),[[n.vShow,e.value]])]),_:1})]))}}),Ut={class:"flex px-4 justify-between gap-4 items-center mb-2"},Kt={class:"text-gray-500 w-1/3"},Gt={class:"relative w-2/3 p-1 rounded text-right text-xs text-gray-400 bg-gray-100 focus:border-gray-200 outline-none border-none font-sans"},Jt={class:"absolute bottom-0.5 right-0.5 font-sans text-xs"},Ot=["points"],X=160,I=40,S=2,Y=100,H=20,vt=n.defineComponent({__name:"FPSGraph",props:{label:{},control:{}},setup(r){const t=z.useFps({every:Y}),e=n.ref(""),s=n.ref([]),i=n.ref(X/S);let o=performance.now();return z.useRafFn(({timestamp:l})=>{l-o>=Y&&(o=l,s.value.push(t.value),s.value.length>i.value&&s.value.shift(),e.value=s.value.map((c,d)=>`${d*S},${I+H-S/2-c*(I+H-S)/120}`).join(" "))}),(l,c)=>(n.openBlock(),n.createElementBlock("div",Ut,[n.createElementVNode("label",Kt,n.toDisplayString(l.label),1),n.createElementVNode("div",Gt,[n.createElementVNode("div",Jt,n.toDisplayString(Math.round(n.unref(t)))+" FPS",1),(n.openBlock(),n.createElementBlock("svg",{width:X,height:I,xmlns:"http://www.w3.org/2000/svg",class:"bg-gray-100"},[n.createElementVNode("polyline",{points:e.value,fill:"none",stroke:"lightgray","stroke-width":S,"stroke-linecap":"round","stroke-linejoin":"round"},null,8,Ot)]))])]))}}),Q=n.defineComponent({__name:"ControlInput",props:{control:{}},emits:["change"],setup(r,{emit:t}){function e(s){t("change",s)}return(s,i)=>s.control.visible?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[s.control.type==="color"?(n.openBlock(),n.createBlock(qt,{key:0,label:s.control.label,control:s.control,onChange:e},null,8,["label","control"])):s.control.type==="vector"?(n.openBlock(),n.createBlock(Ht,{key:1,label:s.control.label,control:s.control,onChange:e},null,8,["label","control"])):s.control.type==="boolean"?(n.openBlock(),n.createBlock(Et,{key:2,label:s.control.label,control:s.control,onChange:e},null,8,["label","control"])):s.control.type==="fpsgraph"?(n.openBlock(),n.createBlock(vt,{key:3,label:s.control.label,control:s.control},null,8,["label","control"])):s.control.type==="folder"?(n.openBlock(),n.createBlock(Zt,{key:4,label:s.control.label,control:s.control},null,8,["label","control"])):s.control.type==="number"?(n.openBlock(),n.createBlock(mt,{key:5,label:s.control.label,control:s.control,onChange:e},null,8,["label","control"])):s.control.type==="range"?(n.openBlock(),n.createBlock(It,{key:6,label:s.control.label,control:s.control,onChange:e},null,8,["label","control"])):(n.openBlock(),n.createBlock(zt,{key:7,label:s.control.label,control:s.control,onChange:e},null,8,["label","control"]))],64)):n.createCommentVNode("",!0)}}),te={class:"bg-white shadow-xl rounded border-4 border-solid border-black"},ee=[n.createElementVNode("i",{class:"h-4 w-4 p-1.5 flex items-center line-height-0 rounded-full bg-gray-100 text-xs"},"🍰",-1),n.createElementVNode("div",null,[n.createElementVNode("i",{class:"i-ic-baseline-drag-indicator"}),n.createElementVNode("i",{class:"i-ic-baseline-drag-indicator"}),n.createElementVNode("i",{class:"i-ic-baseline-drag-indicator"})],-1),n.createElementVNode("div",null,null,-1)],se=280,ne=n.defineComponent({__name:"TresLeches",setup(r){const{width:t}=z.useWindowSize(),e=n.ref(null),s=ut();function i(o,l){l.ref&&(l.ref[l.label]=o),l.value=o}return(o,l)=>(n.openBlock(),n.createBlock(n.unref(rt),{"initial-value":{x:n.unref(t)-se-20,y:10},class:"fixed select-none z-24 w-280px font-sans text-xs",handle:e.value},{default:n.withCtx(()=>[n.createElementVNode("div",te,[n.createElementVNode("header",{ref_key:"handle",ref:e,class:"relative cursor-grabbing p-4 flex justify-between text-gray-200 relative"},ee,512),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(s).controls,c=>(n.openBlock(),n.createBlock(Q,{key:c.label,control:c,onChange:d=>i(d,c)},null,8,["control","onChange"]))),128))])]),_:1},8,["initial-value","handle"]))}});b.TresLeches=ne,b.useControls=pt,Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})});
|
|
12
|
+
*/const F="153";function V(r,t,e){return Math.max(t,Math.min(e,r))}class B{constructor(t=0,e=0){B.prototype.isVector2=!0,this.x=t,this.y=e}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,e){return this.x=t,this.y=e,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){const e=this.x,s=this.y,i=t.elements;return this.x=i[0]*e+i[3]*s+i[6],this.y=i[1]*e+i[4]*s+i[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this}clampLength(t,e){const s=this.length();return this.divideScalar(s||1).multiplyScalar(Math.max(t,Math.min(e,s)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;const s=this.dot(t)/e;return Math.acos(V(s,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,s=this.y-t.y;return e*e+s*s}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,s){return this.x=t.x+(e.x-t.x)*s,this.y=t.y+(e.y-t.y)*s,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this}rotateAround(t,e){const s=Math.cos(e),i=Math.sin(e),o=this.x-t.x,h=this.y-t.y;return this.x=o*s-h*i+t.x,this.y=o*i+h*s+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class ct{constructor(t=0,e=0,s=0,i=1){this.isQuaternion=!0,this._x=t,this._y=e,this._z=s,this._w=i}static slerpFlat(t,e,s,i,o,h,c){let d=s[i+0],y=s[i+1],l=s[i+2],a=s[i+3];const _=o[h+0],u=o[h+1],p=o[h+2],m=o[h+3];if(c===0){t[e+0]=d,t[e+1]=y,t[e+2]=l,t[e+3]=a;return}if(c===1){t[e+0]=_,t[e+1]=u,t[e+2]=p,t[e+3]=m;return}if(a!==m||d!==_||y!==u||l!==p){let f=1-c;const x=d*_+y*u+l*p+a*m,g=x>=0?1:-1,W=1-x*x;if(W>Number.EPSILON){const w=Math.sqrt(W),Z=Math.atan2(w,x*g);f=Math.sin(f*Z)/w,c=Math.sin(c*Z)/w}const E=c*g;if(d=d*f+_*E,y=y*f+u*E,l=l*f+p*E,a=a*f+m*E,f===1-c){const w=1/Math.sqrt(d*d+y*y+l*l+a*a);d*=w,y*=w,l*=w,a*=w}}t[e]=d,t[e+1]=y,t[e+2]=l,t[e+3]=a}static multiplyQuaternionsFlat(t,e,s,i,o,h){const c=s[i],d=s[i+1],y=s[i+2],l=s[i+3],a=o[h],_=o[h+1],u=o[h+2],p=o[h+3];return t[e]=c*p+l*a+d*u-y*_,t[e+1]=d*p+l*_+y*a-c*u,t[e+2]=y*p+l*u+c*_-d*a,t[e+3]=l*p-c*a-d*_-y*u,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,e,s,i){return this._x=t,this._y=e,this._z=s,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,e){const s=t._x,i=t._y,o=t._z,h=t._order,c=Math.cos,d=Math.sin,y=c(s/2),l=c(i/2),a=c(o/2),_=d(s/2),u=d(i/2),p=d(o/2);switch(h){case"XYZ":this._x=_*l*a+y*u*p,this._y=y*u*a-_*l*p,this._z=y*l*p+_*u*a,this._w=y*l*a-_*u*p;break;case"YXZ":this._x=_*l*a+y*u*p,this._y=y*u*a-_*l*p,this._z=y*l*p-_*u*a,this._w=y*l*a+_*u*p;break;case"ZXY":this._x=_*l*a-y*u*p,this._y=y*u*a+_*l*p,this._z=y*l*p+_*u*a,this._w=y*l*a-_*u*p;break;case"ZYX":this._x=_*l*a-y*u*p,this._y=y*u*a+_*l*p,this._z=y*l*p-_*u*a,this._w=y*l*a+_*u*p;break;case"YZX":this._x=_*l*a+y*u*p,this._y=y*u*a+_*l*p,this._z=y*l*p-_*u*a,this._w=y*l*a-_*u*p;break;case"XZY":this._x=_*l*a-y*u*p,this._y=y*u*a-_*l*p,this._z=y*l*p+_*u*a,this._w=y*l*a+_*u*p;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+h)}return e!==!1&&this._onChangeCallback(),this}setFromAxisAngle(t,e){const s=e/2,i=Math.sin(s);return this._x=t.x*i,this._y=t.y*i,this._z=t.z*i,this._w=Math.cos(s),this._onChangeCallback(),this}setFromRotationMatrix(t){const e=t.elements,s=e[0],i=e[4],o=e[8],h=e[1],c=e[5],d=e[9],y=e[2],l=e[6],a=e[10],_=s+c+a;if(_>0){const u=.5/Math.sqrt(_+1);this._w=.25/u,this._x=(l-d)*u,this._y=(o-y)*u,this._z=(h-i)*u}else if(s>c&&s>a){const u=2*Math.sqrt(1+s-c-a);this._w=(l-d)/u,this._x=.25*u,this._y=(i+h)/u,this._z=(o+y)/u}else if(c>a){const u=2*Math.sqrt(1+c-s-a);this._w=(o-y)/u,this._x=(i+h)/u,this._y=.25*u,this._z=(d+l)/u}else{const u=2*Math.sqrt(1+a-s-c);this._w=(h-i)/u,this._x=(o+y)/u,this._y=(d+l)/u,this._z=.25*u}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let s=t.dot(e)+1;return s<Number.EPSILON?(s=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=s):(this._x=0,this._y=-t.z,this._z=t.y,this._w=s)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=s),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(V(this.dot(t),-1,1)))}rotateTowards(t,e){const s=this.angleTo(t);if(s===0)return this;const i=Math.min(1,e/s);return this.slerp(t,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let t=this.length();return t===0?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,e){const s=t._x,i=t._y,o=t._z,h=t._w,c=e._x,d=e._y,y=e._z,l=e._w;return this._x=s*l+h*c+i*y-o*d,this._y=i*l+h*d+o*c-s*y,this._z=o*l+h*y+s*d-i*c,this._w=h*l-s*c-i*d-o*y,this._onChangeCallback(),this}slerp(t,e){if(e===0)return this;if(e===1)return this.copy(t);const s=this._x,i=this._y,o=this._z,h=this._w;let c=h*t._w+s*t._x+i*t._y+o*t._z;if(c<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,c=-c):this.copy(t),c>=1)return this._w=h,this._x=s,this._y=i,this._z=o,this;const d=1-c*c;if(d<=Number.EPSILON){const u=1-e;return this._w=u*h+e*this._w,this._x=u*s+e*this._x,this._y=u*i+e*this._y,this._z=u*o+e*this._z,this.normalize(),this._onChangeCallback(),this}const y=Math.sqrt(d),l=Math.atan2(y,c),a=Math.sin((1-e)*l)/y,_=Math.sin(e*l)/y;return this._w=h*a+this._w*_,this._x=s*a+this._x*_,this._y=i*a+this._y*_,this._z=o*a+this._z*_,this._onChangeCallback(),this}slerpQuaternions(t,e,s){return this.copy(t).slerp(e,s)}random(){const t=Math.random(),e=Math.sqrt(1-t),s=Math.sqrt(t),i=2*Math.PI*Math.random(),o=2*Math.PI*Math.random();return this.set(e*Math.cos(i),s*Math.sin(o),s*Math.cos(o),e*Math.sin(i))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,e=0){return this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t}fromBufferAttribute(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this}toJSON(){return this.toArray()}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class M{constructor(t=0,e=0,s=0){M.prototype.isVector3=!0,this.x=t,this.y=e,this.z=s}set(t,e,s){return s===void 0&&(s=this.z),this.x=t,this.y=e,this.z=s,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}applyEuler(t){return this.applyQuaternion(R.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(R.setFromAxisAngle(t,e))}applyMatrix3(t){const e=this.x,s=this.y,i=this.z,o=t.elements;return this.x=o[0]*e+o[3]*s+o[6]*i,this.y=o[1]*e+o[4]*s+o[7]*i,this.z=o[2]*e+o[5]*s+o[8]*i,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const e=this.x,s=this.y,i=this.z,o=t.elements,h=1/(o[3]*e+o[7]*s+o[11]*i+o[15]);return this.x=(o[0]*e+o[4]*s+o[8]*i+o[12])*h,this.y=(o[1]*e+o[5]*s+o[9]*i+o[13])*h,this.z=(o[2]*e+o[6]*s+o[10]*i+o[14])*h,this}applyQuaternion(t){const e=this.x,s=this.y,i=this.z,o=t.x,h=t.y,c=t.z,d=t.w,y=d*e+h*i-c*s,l=d*s+c*e-o*i,a=d*i+o*s-h*e,_=-o*e-h*s-c*i;return this.x=y*d+_*-o+l*-c-a*-h,this.y=l*d+_*-h+a*-o-y*-c,this.z=a*d+_*-c+y*-h-l*-o,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){const e=this.x,s=this.y,i=this.z,o=t.elements;return this.x=o[0]*e+o[4]*s+o[8]*i,this.y=o[1]*e+o[5]*s+o[9]*i,this.z=o[2]*e+o[6]*s+o[10]*i,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this}clampLength(t,e){const s=this.length();return this.divideScalar(s||1).multiplyScalar(Math.max(t,Math.min(e,s)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this}lerpVectors(t,e,s){return this.x=t.x+(e.x-t.x)*s,this.y=t.y+(e.y-t.y)*s,this.z=t.z+(e.z-t.z)*s,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,e){const s=t.x,i=t.y,o=t.z,h=e.x,c=e.y,d=e.z;return this.x=i*d-o*c,this.y=o*h-s*d,this.z=s*c-i*h,this}projectOnVector(t){const e=t.lengthSq();if(e===0)return this.set(0,0,0);const s=t.dot(this)/e;return this.copy(t).multiplyScalar(s)}projectOnPlane(t){return $.copy(this).projectOnVector(t),this.sub($)}reflect(t){return this.sub($.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;const s=this.dot(t)/e;return Math.acos(V(s,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,s=this.y-t.y,i=this.z-t.z;return e*e+s*s+i*i}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,e,s){const i=Math.sin(e)*t;return this.x=i*Math.sin(s),this.y=Math.cos(e)*t,this.z=i*Math.cos(s),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,e,s){return this.x=t*Math.sin(e),this.y=s,this.z=t*Math.cos(e),this}setFromMatrixPosition(t){const e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(t){const e=this.setFromMatrixColumn(t,0).length(),s=this.setFromMatrixColumn(t,1).length(),i=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=s,this.z=i,this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,e*4)}setFromMatrix3Column(t,e){return this.fromArray(t.elements,e*3)}setFromEuler(t){return this.x=t._x,this.y=t._y,this.z=t._z,this}setFromColor(t){return this.x=t.r,this.y=t.g,this.z=t.b,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const t=(Math.random()-.5)*2,e=Math.random()*Math.PI*2,s=Math.sqrt(1-t**2);return this.x=s*Math.cos(e),this.y=s*Math.sin(e),this.z=t,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const $=new M,R=new ct;typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:F}})),typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=F);const C=n.reactive({controls:[]});function ut(){return C}function N(r){return Object.entries(r).map(([t,e])=>{let s="string",i;const o=/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$|^0x([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/;return!n.isRef(e)&&e.value||n.isRef(e)?(s=typeof e.value,i=e.value):(s=typeof e,i=e),s==="number"&&(e.step||e.max||e.min)&&(s="range"),s==="string"&&o.test(i)&&(s="color"),(i instanceof M||i instanceof M||i instanceof Array)&&(s="vector"),!n.isRef(e)&&e.value?{...e,label:e.label||t,value:e.value,type:s,visible:!0}:{label:e.label||t,value:e,type:s,visible:!0}})}function yt(){C.controls=[]}function dt(r,t,e){let s=[];if(typeof r=="string")r==="fpsgraph"?s.push({label:"fpsgraph",visible:!0,type:"fpsgraph"}):s.push({label:r,visible:!0,type:"folder",controls:N(t)});else if(typeof r=="object"&&typeof t=="string")s.push({...e,label:t,visible:!0,value:r[t],type:typeof r[t],ref:r});else if(n.isReactive(r)){const i=n.toRefs(r);s=N(i)}else s=N(r);return C.controls=[...C.controls,...s],n.onUnmounted(yt),{state:C,controls:s}}const _t={class:"flex px-4 justify-between gap-4 items-center mb-2"},pt={class:"text-gray-500 w-1/3"},xt=["value","min","max","step"],mt=n.defineComponent({__name:"NumberControl",props:{label:{},control:{}},emits:["change"],setup(r,{emit:t}){const e=r;function s(l){const{target:a}=l;t("change",a.valueAsNumber)}const i=z.useMouse(),o=n.ref(0),h=n.ref(!1),c=l=>{o.value=l.clientX,h.value=!0},d=()=>{h.value=!1},y=l=>Math.floor(Math.abs(l)/10);return n.watch(i.x,l=>{if(h.value){const a=l-o.value,_=y(a);a>0?t("change",e.control.value+1+_):a<0&&t("change",e.control.value-1+_),e.control.min!==void 0&&e.control.value<e.control.min&&t("change",e.control.min),e.control.max!==void 0&&e.control.value>e.control.max&&t("change",e.control.max),o.value=l}}),(l,a)=>(n.openBlock(),n.createElementBlock("div",_t,[n.createElementVNode("label",pt,n.toDisplayString(l.label),1),n.createElementVNode("input",{value:l.control.value,class:n.normalizeClass(["p-2 w-1/3 rounded text-right text-xs text-gray-400 bg-gray-100 focus:border-gray-200 outline-none border-none font-sans",{"cursor-ew-resize":h.value}]),type:"number",min:l.control.min,max:l.control.max,step:l.control.step,onInput:s,onMousedown:c,onMouseup:d},null,42,xt)]))}}),ft={class:"flex px-4 justify-between gap-4 items-center mb-2 min-h-32px"},gt={class:"text-gray-500 w-1/3"},bt=["value"],zt=n.defineComponent({__name:"TextControl",props:{label:{},control:{}},emits:["change"],setup(r,{emit:t}){function e(s){t("change",s)}return(s,i)=>(n.openBlock(),n.createElementBlock("div",ft,[n.createElementVNode("label",gt,n.toDisplayString(s.label),1),n.createElementVNode("input",{value:s.control.value,type:"string",class:"p-2 w-2/3 rounded text-right text-xs text-gray-400 bg-gray-100 focus:border-gray-200 outline-none border-none font-sans",onChange:e},null,40,bt)]))}}),wt={class:"flex px-4 justify-start gap-2 items-center mb-2 min-h-32px"},Mt={class:"text-gray-500 w-1/3"},kt=["id","checked"],Ct=["for"],St={class:"i-ic:baseline-check text-light"},Et=n.defineComponent({__name:"BooleanControl",props:{label:{},control:{}},emits:["change"],setup(r,{emit:t}){function e(s){const{target:i}=s;t("change",i.checked)}return(s,i)=>(n.openBlock(),n.createElementBlock("div",wt,[n.createElementVNode("label",Mt,n.toDisplayString(s.label),1),n.createElementVNode("input",{id:s.control.label,checked:s.control.value,class:"hidden",type:"checkbox",onInput:e},null,40,kt),n.createElementVNode("label",{for:s.control.label,class:"inline-flex items-center cursor-pointer"},[n.createElementVNode("span",{class:n.normalizeClass([{"bg-dark-500":s.control.value,"bg-gray-200":!s.control.value},"w-4 h-4 flex justify-center items-center rounded border border-gray-300 mr-2 transition-colors duration-200"])},[n.withDirectives(n.createElementVNode("i",St,null,512),[[n.vShow,s.control.value]])],2)],8,Ct)]))}}),Vt={class:"px-4 relative flex justify-between gap-4 items-center mb-2"},Bt=["value","min","max","step"],$t=["value","min","max","step"],Nt=n.defineComponent({__name:"SliderControl",props:{label:{},control:{}},emits:["change"],setup(r,{emit:t}){const e=r;function s(a){const{target:_}=a;t("change",_.valueAsNumber)}const i=n.computed(()=>({backgroundImage:`linear-gradient(to right, #333 0% ${100*(e.control.value-(e.control.min||0))/((e.control.max||100)-(e.control.min||0))}%, #e2e2e2 0%)`})),o=z.useMouse(),h=n.ref(0),c=n.ref(!1),d=a=>{h.value=a.clientX,c.value=!0},y=()=>{c.value=!1},l=a=>Math.floor(Math.abs(a)/10);return n.watch(o.x,a=>{if(c.value){const _=a-h.value,u=l(_);_>0?t("change",e.control.value+1+u):_<0&&t("change",e.control.value-1+u),e.control.min!==void 0&&e.control.value<e.control.min&&t("change",e.control.min),e.control.max!==void 0&&e.control.value>e.control.max&&t("change",e.control.max),h.value=a}}),(a,_)=>(n.openBlock(),n.createElementBlock("div",Vt,[n.createElementVNode("label",{class:n.normalizeClass(["text-gray-500 w-1/3",{"flex justify-between items-center":a.control.icon}])},[n.createTextVNode(n.toDisplayString(a.label)+" ",1),n.createElementVNode("i",{class:n.normalizeClass(`i-${a.control.icon}`)},null,2)],2),n.createElementVNode("input",{value:a.control.value,class:"w-1/2 h-0.75 bg-dark-200 rounded-full appearance-none",style:n.normalizeStyle(i.value),type:"range",min:a.control.min,max:a.control.max,step:a.control.step,onInput:s},null,44,Bt),n.createElementVNode("input",{value:a.control.value,class:n.normalizeClass(["p-2 w-1/4 rounded text-right text-xs text-gray-400 bg-gray-100 focus:border-gray-200 outline-none border-none font-sans",{"cursor-ew-resize":c.value}]),type:"number",min:a.control.min,max:a.control.max,step:a.control.step,onInput:s,onMousedown:d,onMouseup:y},null,42,$t)]))}}),re="",It=((r,t)=>{const e=r.__vccOpts||r;for(const[s,i]of t)e[s]=i;return e})(Nt,[["__scopeId","data-v-743fd350"]]),At={class:"flex px-4 justify-between gap-4 items-center mb-2"},Tt={class:"text-gray-500 w-1/3"},Dt=["value"],jt=["value"],qt=n.defineComponent({__name:"ColorControl",props:{label:{},control:{}},emits:["change"],setup(r,{emit:t}){function e(s){const{target:i}=s;t("change",i.value)}return(s,i)=>(n.openBlock(),n.createElementBlock("div",At,[n.createElementVNode("label",Tt,n.toDisplayString(s.label),1),n.createElementVNode("input",{value:s.control.value,type:"color",onInput:e},null,40,Dt),n.createElementVNode("input",{value:s.control.value,class:"p-2 w-2/3 rounded text-right text-xs text-gray-400 bg-gray-100 focus:border-gray-200 outline-none border-none font-sans",type:"text",onInput:e},null,40,jt)]))}}),le="";function Pt(r){return typeof r=="number"?[r,r,r]:r instanceof M?[r.x,r.y,r.z]:r}const Lt={class:"flex px-4 justify-between gap-2 items-center mb-2"},Ft={class:"text-gray-500 w-1/3"},Rt={class:"w-2/3 flex justify-between gap-1"},Xt={key:0,class:"font-bold px-0.5 py-1 text-0.65rem text-gray-300"},Yt=["value","onInput","onMousedown","onMouseup"],Ht=n.defineComponent({__name:"VectorControl",props:{label:{},control:{}},emits:["change"],setup(r,{emit:t}){const e=r,s=z.useMouse(),i=n.ref(0),o=n.ref(!1),h=n.ref(0),c=(p,m)=>{h.value=m,i.value=p.clientX,o.value=!0},d=(p,m)=>{h.value=m,o.value=!1},y=p=>Math.floor(Math.abs(p)/10),l=n.computed(()=>Pt(e.control.value)),a=n.computed(()=>Object.keys(e.control.value)),_=n.computed(()=>e.control.value instanceof B||e.control.value instanceof M);function u(p,m){const{value:f}=e.control,{target:x}=p;h.value=m,f[_.value?a.value[h.value]:h.value]=parseInt(x.value,10),t("change",f)}return n.watch(s.x,p=>{if(o.value){const m=p-i.value,f=y(m),{value:x}=e.control,g=_.value?a.value[h.value]:h.value;m>0?x[g]+=1+f:m<0&&(x[g]-=1+f),e.control.min!==void 0&&x<e.control.min&&(x[g]=e.control.min),e.control.max!==void 0&&x>e.control.max&&(x[g]=e.control.max),t("change",x),i.value=p}}),(p,m)=>(n.openBlock(),n.createElementBlock("div",Lt,[n.createElementVNode("label",Ft,n.toDisplayString(p.label),1),n.createElementVNode("div",Rt,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(l.value,(f,x)=>(n.openBlock(),n.createElementBlock("div",{key:p.label+x,class:"flex items-center w-1/3 bg-gray-100 rounded"},[a.value[x]&&_.value?(n.openBlock(),n.createElementBlock("span",Xt,n.toDisplayString(a.value[x]),1)):n.createCommentVNode("",!0),n.createElementVNode("input",{type:"text",class:n.normalizeClass(["w-full pl-0 p-1 text-right text-0.65rem text-gray-400 bg-transparent focus:border-gray-200 outline-none border-none font-sans",{"cursor-ew-resize":o.value}]),value:l.value[x].toFixed(2),onInput:g=>u(g,x),onMousedown:g=>c(g,x),onMouseup:g=>d(g,x)},null,42,Yt)]))),128))])]))}}),Qt={class:"mb-4"},Wt={class:"bg-white rounded-b pt-4"},Zt=n.defineComponent({__name:"Folder",props:{control:{}},setup(r){function t(i,o){o.value=i}const e=n.ref(!1),s=()=>{e.value=!e.value};return(i,o)=>(n.openBlock(),n.createElementBlock("div",Qt,[n.createElementVNode("button",{class:"flex items-center justify-between w-full p-4 bg-gray-100 border-none text-gray-400 font-bold text-xs focus:outline-none font-sans cursor-pointer",onClick:s},[n.createElementVNode("span",null,n.toDisplayString(i.control.label),1),n.createElementVNode("i",{class:n.normalizeClass(e.value?"i-ic:baseline-keyboard-arrow-up":"i-ic:baseline-keyboard-arrow-down")},null,2)]),n.createVNode(n.Transition,{name:"slide","enter-active-class":" animate-fade-in animate-duration-200 animate-ease-in-out","leave-active-class":" animate-fade-out animate-duration-200 animate-ease-in-out"},{default:n.withCtx(()=>[n.withDirectives(n.createElementVNode("div",Wt,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(i.control.controls,h=>(n.openBlock(),n.createBlock(Q,{key:h.label,control:h,onChange:c=>t(c,h)},null,8,["control","onChange"]))),128))],512),[[n.vShow,e.value]])]),_:1})]))}}),Ut={class:"flex px-4 justify-between gap-4 items-center mb-2"},Kt={class:"text-gray-500 w-1/3"},Gt={class:"relative w-2/3 p-1 rounded text-right text-xs text-gray-400 bg-gray-100 focus:border-gray-200 outline-none border-none font-sans"},Jt={class:"absolute bottom-0.5 right-0.5 font-sans text-xs"},Ot=["points"],X=160,I=40,S=2,Y=100,H=20,vt=n.defineComponent({__name:"FPSGraph",props:{label:{},control:{}},setup(r){const t=z.useFps({every:Y}),e=n.ref(""),s=n.ref([]),i=n.ref(X/S);let o=performance.now();return z.useRafFn(({timestamp:h})=>{h-o>=Y&&(o=h,s.value.push(t.value),s.value.length>i.value&&s.value.shift(),e.value=s.value.map((c,d)=>`${d*S},${I+H-S/2-c*(I+H-S)/120}`).join(" "))}),(h,c)=>(n.openBlock(),n.createElementBlock("div",Ut,[n.createElementVNode("label",Kt,n.toDisplayString(h.label),1),n.createElementVNode("div",Gt,[n.createElementVNode("div",Jt,n.toDisplayString(Math.round(n.unref(t)))+" FPS",1),(n.openBlock(),n.createElementBlock("svg",{width:X,height:I,xmlns:"http://www.w3.org/2000/svg",class:"bg-gray-100"},[n.createElementVNode("polyline",{points:e.value,fill:"none",stroke:"lightgray","stroke-width":S,"stroke-linecap":"round","stroke-linejoin":"round"},null,8,Ot)]))])]))}}),Q=n.defineComponent({__name:"ControlInput",props:{control:{}},emits:["change"],setup(r,{emit:t}){function e(s){t("change",s)}return(s,i)=>s.control.visible?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[s.control.type==="color"?(n.openBlock(),n.createBlock(qt,{key:0,label:s.control.label,control:s.control,onChange:e},null,8,["label","control"])):s.control.type==="vector"?(n.openBlock(),n.createBlock(Ht,{key:1,label:s.control.label,control:s.control,onChange:e},null,8,["label","control"])):s.control.type==="boolean"?(n.openBlock(),n.createBlock(Et,{key:2,label:s.control.label,control:s.control,onChange:e},null,8,["label","control"])):s.control.type==="fpsgraph"?(n.openBlock(),n.createBlock(vt,{key:3,label:s.control.label,control:s.control},null,8,["label","control"])):s.control.type==="folder"?(n.openBlock(),n.createBlock(Zt,{key:4,label:s.control.label,control:s.control},null,8,["label","control"])):s.control.type==="number"?(n.openBlock(),n.createBlock(mt,{key:5,label:s.control.label,control:s.control,onChange:e},null,8,["label","control"])):s.control.type==="range"?(n.openBlock(),n.createBlock(It,{key:6,label:s.control.label,control:s.control,onChange:e},null,8,["label","control"])):(n.openBlock(),n.createBlock(zt,{key:7,label:s.control.label,control:s.control,onChange:e},null,8,["label","control"]))],64)):n.createCommentVNode("",!0)}}),te={class:"bg-white shadow-xl rounded border-4 border-solid border-black"},ee=[n.createElementVNode("i",{class:"h-4 w-4 p-1.5 flex items-center line-height-0 rounded-full bg-gray-100 text-xs"},"🍰",-1),n.createElementVNode("div",null,[n.createElementVNode("i",{class:"i-ic-baseline-drag-indicator"}),n.createElementVNode("i",{class:"i-ic-baseline-drag-indicator"}),n.createElementVNode("i",{class:"i-ic-baseline-drag-indicator"})],-1),n.createElementVNode("div",null,null,-1)],se=280,ne=n.defineComponent({__name:"TresLeches",setup(r){const{width:t}=z.useWindowSize(),e=n.ref(null),s=ut();function i(o,h){h.ref&&(h.ref[h.label]=o),h.value=o}return(o,h)=>(n.openBlock(),n.createBlock(n.unref(rt),{"initial-value":{x:n.unref(t)-se-20,y:10},class:"fixed select-none z-24 w-280px font-sans text-xs",handle:e.value},{default:n.withCtx(()=>[n.createElementVNode("div",te,[n.createElementVNode("header",{ref_key:"handle",ref:e,class:"relative cursor-grabbing p-4 flex justify-between text-gray-200 relative"},ee,512),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(s).controls,c=>(n.openBlock(),n.createBlock(Q,{key:c.label,control:c,onChange:d=>i(d,c)},null,8,["control","onChange"]))),128))])]),_:1},8,["initial-value","handle"]))}});b.TresLeches=ne,b.useControls=dt,Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tresjs/leches",
|
|
3
3
|
"description": "Tasty GUI for Vue controls 🍰",
|
|
4
|
-
"version": "0.3.
|
|
4
|
+
"version": "0.3.1",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"packageManager": "pnpm@8.3.1",
|
|
7
7
|
"author": "Alvaro Saburido <hola@alvarosaburido.dev> (https://github.com/alvarosabu/)",
|
|
@@ -48,37 +48,37 @@
|
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"@types/three": "^0.152.1",
|
|
51
|
-
"@vueuse/components": "^10.
|
|
52
|
-
"
|
|
51
|
+
"@vueuse/components": "^10.2.0",
|
|
52
|
+
"three": "^0.153.0",
|
|
53
|
+
"vue": "^3.3.4"
|
|
54
|
+
},
|
|
55
|
+
"devDependencies": {
|
|
56
|
+
"@vueuse/shared": "^10.2.0",
|
|
53
57
|
"kolorist": "^1.8.0",
|
|
54
|
-
"pathe": "^1.1.
|
|
58
|
+
"pathe": "^1.1.1",
|
|
55
59
|
"rollup-plugin-analyzer": "^4.0.0",
|
|
56
|
-
"rollup-plugin-visualizer": "^5.9.
|
|
57
|
-
"three": "^0.152.2",
|
|
60
|
+
"rollup-plugin-visualizer": "^5.9.2",
|
|
58
61
|
"vite-plugin-banner": "^0.7.0",
|
|
59
62
|
"vite-plugin-dts": "^2.3.0",
|
|
60
|
-
"vue": "^3.3.4"
|
|
61
|
-
},
|
|
62
|
-
"devDependencies": {
|
|
63
63
|
"@alvarosabu/prettier-config": "^1.3.0",
|
|
64
64
|
"@histoire/plugin-vue": "^0.16.1",
|
|
65
65
|
"@iconify-json/ic": "^1.1.13",
|
|
66
66
|
"@release-it/conventional-changelog": "^5.1.1",
|
|
67
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
67
|
+
"@typescript-eslint/eslint-plugin": "^5.60.0",
|
|
68
68
|
"@vitejs/plugin-vue": "^4.2.3",
|
|
69
|
-
"@vitest/ui": "^0.
|
|
70
|
-
"@vueuse/core": "^10.
|
|
71
|
-
"eslint": "^8.
|
|
69
|
+
"@vitest/ui": "^0.32.2",
|
|
70
|
+
"@vueuse/core": "^10.2.0",
|
|
71
|
+
"eslint": "^8.43.0",
|
|
72
72
|
"eslint-config-prettier": "^8.8.0",
|
|
73
73
|
"eslint-plugin-vitest-globals": "^1.3.1",
|
|
74
|
-
"eslint-plugin-vue": "^9.
|
|
75
|
-
"histoire": "^0.16.
|
|
74
|
+
"eslint-plugin-vue": "^9.15.0",
|
|
75
|
+
"histoire": "^0.16.2",
|
|
76
76
|
"prettier": "^2.8.8",
|
|
77
|
-
"release-it": "^15.
|
|
78
|
-
"typescript": "^5.
|
|
79
|
-
"unocss": "^0.
|
|
77
|
+
"release-it": "^15.11.0",
|
|
78
|
+
"typescript": "^5.1.3",
|
|
79
|
+
"unocss": "^0.53.1",
|
|
80
80
|
"vite": "^4.3.9",
|
|
81
|
-
"vitest": "^0.
|
|
82
|
-
"vue-tsc": "^1.
|
|
81
|
+
"vitest": "^0.32.2",
|
|
82
|
+
"vue-tsc": "^1.8.1"
|
|
83
83
|
}
|
|
84
84
|
}
|