aptechka 0.13.1 → 0.15.0
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/lib/{Animation-De9aUv3b.cjs → Animation-DI864E0i.cjs} +1 -1
- package/lib/{Animation-NAGXiFv5.js → Animation-w6BLTCum.js} +1 -1
- package/lib/{Damped-DbJKrUIf.js → Damped-DEHDEq-b.js} +1 -1
- package/lib/{Damped-DYJ6Z0xo.cjs → Damped-ipnDc0iX.cjs} +1 -1
- package/lib/Store-CDb6RMce.cjs +1 -0
- package/lib/Store-OTdcl6SX.js +134 -0
- package/lib/{Tweened-BkkD9s4n.cjs → Tweened-B1TfANfR.cjs} +1 -1
- package/lib/{Tweened-DOSHLCZa.js → Tweened-C52xXDLY.js} +1 -1
- package/lib/{Viewport-Cv4TRGiv.cjs → Viewport-BDPsnAF4.cjs} +1 -1
- package/lib/{Viewport-B55BvLsV.js → Viewport-taEXS8Uv.js} +1 -1
- package/lib/animation/index.cjs +1 -1
- package/lib/animation/index.js +3 -3
- package/lib/attribute/index.cjs +1 -1
- package/lib/attribute/index.js +13 -13
- package/lib/canvas/index.cjs +1 -1
- package/lib/canvas/index.js +36 -39
- package/lib/class-linked-status/index.cjs +1 -1
- package/lib/class-linked-status/index.js +1 -1
- package/lib/controls/index.cjs +1 -1
- package/lib/controls/index.js +3 -3
- package/lib/css-property/index.cjs +1 -1
- package/lib/css-property/index.js +4 -4
- package/lib/dev/index.cjs +1 -1
- package/lib/dev/index.js +1 -1
- package/lib/device/index.cjs +1 -1
- package/lib/device/index.js +1 -1
- package/lib/{dom-P5QbAASX.js → dom-0S_WDL4g.js} +2 -2
- package/lib/element-constructor/index.cjs +1 -1
- package/lib/element-constructor/index.js +848 -122
- package/lib/element-resizer/index.js +8 -8
- package/lib/en3/index.cjs +8 -1
- package/lib/en3/index.js +372 -4
- package/lib/file-BEr-o55N.js +31 -0
- package/lib/file-C9BbxzVU.cjs +1 -0
- package/lib/image/index.cjs +1 -1
- package/lib/image/index.js +1 -1
- package/lib/intersector/index.js +7 -7
- package/lib/jss-CjccJC-K.js +21 -0
- package/lib/jss-GJLvaNfT.cjs +1 -0
- package/lib/ladder/index.cjs +1 -1
- package/lib/ladder/index.js +1 -1
- package/lib/layout-box/index.js +14 -14
- package/lib/media/index.cjs +1 -1
- package/lib/media/index.js +1 -1
- package/lib/need_redo_tweaker/index.cjs +18 -0
- package/lib/need_redo_tweaker/index.js +1337 -0
- package/lib/pointer/index.cjs +1 -1
- package/lib/pointer/index.js +3 -3
- package/lib/popover/index.cjs +1 -1
- package/lib/popover/index.js +68 -76
- package/lib/scroll/index.cjs +1 -1
- package/lib/scroll/index.js +577 -610
- package/lib/scroll-entries/index.js +15 -15
- package/lib/sequence/index.cjs +1 -1
- package/lib/sequence/index.js +1 -1
- package/lib/slicer/index.cjs +5 -5
- package/lib/slicer/index.js +55 -86
- package/lib/source/index.cjs +2 -2
- package/lib/source/index.js +154 -62
- package/lib/store/index.cjs +1 -1
- package/lib/store/index.js +71 -37
- package/lib/ticker/index.js +1 -1
- package/lib/utils/index.cjs +1 -1
- package/lib/utils/index.js +67 -65
- package/lib/video/index.cjs +1 -1
- package/lib/video/index.js +1 -1
- package/package.json +7 -72
- package/lib/Composed-C_4slJQ6.cjs +0 -1
- package/lib/Composed-CfWa-69I.js +0 -31
- package/lib/Derived-BIBU-y7Z.cjs +0 -1
- package/lib/Derived-Vo_RsJfi.js +0 -23
- package/lib/SourceManager-B6wZpXUZ.js +0 -104
- package/lib/SourceManager-CfHcGLUa.cjs +0 -1
- package/lib/Store-C46i0nvr.js +0 -137
- package/lib/Store-npaZHvX4.cjs +0 -1
- package/lib/accordion/index.cjs +0 -1
- package/lib/accordion/index.js +0 -167
- package/lib/checkbox/index.cjs +0 -1
- package/lib/checkbox/index.js +0 -112
- package/lib/createStylesheet-COAZH1Mw.js +0 -8
- package/lib/createStylesheet-Csfmh-MH.cjs +0 -1
- package/lib/createTheme-CHnsCgAr.js +0 -15
- package/lib/createTheme-Cfaw9UmV.cjs +0 -1
- package/lib/en3/helpers/index.cjs +0 -1
- package/lib/en3/helpers/index.js +0 -1870
- package/lib/en3/libs/index.cjs +0 -1
- package/lib/en3/libs/index.js +0 -200
- package/lib/en3/loaders/index.cjs +0 -1
- package/lib/en3/loaders/index.js +0 -1742
- package/lib/en3/misc/index.cjs +0 -10
- package/lib/en3/misc/index.js +0 -110
- package/lib/en3/utils/index.cjs +0 -1
- package/lib/en3/utils/index.js +0 -20
- package/lib/en3-C1fLmsjs.cjs +0 -8
- package/lib/en3-x-Ki30MY.js +0 -344
- package/lib/events-BGwqaxVW.cjs +0 -1
- package/lib/events-CJTUMSLU.js +0 -20
- package/lib/file-EevnUtRj.cjs +0 -1
- package/lib/file-lxi_oXJf.js +0 -13
- package/lib/index-BuAuBz2_.cjs +0 -9
- package/lib/index-CenF0JbH.js +0 -261
- package/lib/modal/index.cjs +0 -1
- package/lib/modal/index.js +0 -133
- package/lib/select/index.cjs +0 -1
- package/lib/select/index.js +0 -7
- package/lib/tags-6_ETuR75.cjs +0 -1
- package/lib/tags-BL3kQp9o.js +0 -833
- package/lib/theme/index.cjs +0 -1
- package/lib/theme/index.js +0 -25
- package/lib/traverseMaterials-CD_3_56D.cjs +0 -1
- package/lib/traverseMaterials-mGC2_FkG.js +0 -29
- package/lib/tweaker/index.cjs +0 -10
- package/lib/tweaker/index.js +0 -989
package/lib/theme/index.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../Store-npaZHvX4.cjs");const t=require("../browser-CpzFX2xg.cjs");require("../ticker/index.cjs");const o=require("../tags-6_ETuR75.cjs"),a=require("../createTheme-Cfaw9UmV.cjs"),r=a.createTheme({colorMain:"#1c1c1c",colorMainAux:"#282828",colorFont:"#ffffff",colorActive:"#00E5B0",borderRadius:"12px",borderRadiusSmall:"4px"},{prefix:"aptechka-"});if(t.isBrowser){const e=o.style({":root":r.style}).node;e.setAttribute("data-permanent",""),document.head.appendChild(e)}exports.aptechkaTheme=r;
|
package/lib/theme/index.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import "../Store-C46i0nvr.js";
|
|
2
|
-
import { i as e } from "../browser-0zX67oeU.js";
|
|
3
|
-
import "../ticker/index.js";
|
|
4
|
-
import { aD as r } from "../tags-BL3kQp9o.js";
|
|
5
|
-
import { c as t } from "../createTheme-CHnsCgAr.js";
|
|
6
|
-
const a = t(
|
|
7
|
-
{
|
|
8
|
-
colorMain: "#1c1c1c",
|
|
9
|
-
colorMainAux: "#282828",
|
|
10
|
-
colorFont: "#ffffff",
|
|
11
|
-
colorActive: "#00E5B0",
|
|
12
|
-
borderRadius: "12px",
|
|
13
|
-
borderRadiusSmall: "4px"
|
|
14
|
-
},
|
|
15
|
-
{ prefix: "aptechka-" }
|
|
16
|
-
);
|
|
17
|
-
if (e) {
|
|
18
|
-
const o = r({
|
|
19
|
-
":root": a.style
|
|
20
|
-
}).node;
|
|
21
|
-
o.setAttribute("data-permanent", ""), document.head.appendChild(o);
|
|
22
|
-
}
|
|
23
|
-
export {
|
|
24
|
-
a as aptechkaTheme
|
|
25
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const a=require("three"),f=require("./en3-C1fLmsjs.cjs"),s=new a.Vector3,u=new a.Vector3;function w(e,i="default"){const t=f.en3.getView(i),{width:r,height:o}=f.en3,n=r/o;e instanceof a.Vector3?s.copy(e):s.set(...e);const c=t.camera.getWorldPosition(u).distanceTo(s);if(t.camera instanceof a.OrthographicCamera)return{width:r/t.camera.zoom,height:o/t.camera.zoom,factor:1,distance:c,aspect:n};{const l=t.camera.fov*Math.PI/180,h=2*Math.tan(l/2)*c,m=h*(r/o);return{width:m,height:h,factor:r/m,distance:c,aspect:n}}}function g(e,i){e.traverse(t=>{t instanceof a.Mesh&&t.material&&(Array.isArray(t.material)?t.material:[t.material]).forEach(i)})}exports.getCurrentViewport=w;exports.traverseMaterials=g;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { Vector3 as c, OrthographicCamera as p, Mesh as w } from "three";
|
|
2
|
-
import { e as h } from "./en3-x-Ki30MY.js";
|
|
3
|
-
const s = new c(), g = new c();
|
|
4
|
-
function M(a, r = "default") {
|
|
5
|
-
const t = h.getView(r), { width: e, height: o } = h, n = e / o;
|
|
6
|
-
a instanceof c ? s.copy(a) : s.set(...a);
|
|
7
|
-
const i = t.camera.getWorldPosition(g).distanceTo(s);
|
|
8
|
-
if (t.camera instanceof p)
|
|
9
|
-
return {
|
|
10
|
-
width: e / t.camera.zoom,
|
|
11
|
-
height: o / t.camera.zoom,
|
|
12
|
-
factor: 1,
|
|
13
|
-
distance: i,
|
|
14
|
-
aspect: n
|
|
15
|
-
};
|
|
16
|
-
{
|
|
17
|
-
const l = t.camera.fov * Math.PI / 180, m = 2 * Math.tan(l / 2) * i, f = m * (e / o);
|
|
18
|
-
return { width: f, height: m, factor: e / f, distance: i, aspect: n };
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
function d(a, r) {
|
|
22
|
-
a.traverse((t) => {
|
|
23
|
-
t instanceof w && t.material && (Array.isArray(t.material) ? t.material : [t.material]).forEach(r);
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
export {
|
|
27
|
-
M as g,
|
|
28
|
-
d as t
|
|
29
|
-
};
|
package/lib/tweaker/index.cjs
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";var ve=h=>{throw TypeError(h)};var ue=(h,i,e)=>i.has(h)||ve("Cannot "+e);var t=(h,i,e)=>(ue(h,i,"read from private field"),e?e.call(h):i.get(h)),a=(h,i,e)=>i.has(h)?ve("Cannot add the same private member more than once"):i instanceof WeakSet?i.add(h):i.set(h,e),o=(h,i,e,s)=>(ue(h,i,"write to private field"),s?s.call(h,e):i.set(h,e),e),f=(h,i,e)=>(ue(h,i,"access private method"),e);const Ne=require("../browser-CpzFX2xg.cjs"),g=require("../Store-npaZHvX4.cjs"),De=require("../file-EevnUtRj.cjs"),He=require("../function-MthRj-GJ.cjs"),ye=require("../gestures-DHLrn6Q8.cjs");require("../ticker/index.cjs");const n=require("../tags-6_ETuR75.cjs"),C=require("../createStylesheet-Csfmh-MH.cjs"),Ke=require("../Viewport-Cv4TRGiv.cjs"),c=require("../theme/index.cjs"),Oe=require("../index-BuAuBz2_.cjs"),Ze=require("../events-BGwqaxVW.cjs");require("../checkbox/index.cjs");const Je=require("../math-GDWEqu7y.cjs"),pe=require("../polyfills-CM4SCDTt.cjs"),ke=require("../element-resizer/index.cjs"),Se='<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M20.536 3.464C19.07 2 16.714 2 12 2C7.286 2 4.929 2 3.464 3.464C2 4.93 2 7.286 2 12c0 4.714 0 7.071 1.464 8.535C4.93 22 7.286 22 12 22c4.714 0 7.071 0 8.535-1.465C22 19.072 22 16.714 22 12s0-7.071-1.465-8.536M16.75 12a.75.75 0 0 1-.75.75H9.81l1.72 1.72a.75.75 0 1 1-1.06 1.06l-3-3a.75.75 0 0 1 0-1.06l3-3a.75.75 0 1 1 1.06 1.06l-1.72 1.72H16a.75.75 0 0 1 .75.75" clip-rule="evenodd"/></svg>',xe='<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><path d="M15.24 2h-3.894c-1.764 0-3.162 0-4.255.148c-1.126.152-2.037.472-2.755 1.193c-.719.721-1.038 1.636-1.189 2.766C3 7.205 3 8.608 3 10.379v5.838c0 1.508.92 2.8 2.227 3.342c-.067-.91-.067-2.185-.067-3.247v-5.01c0-1.281 0-2.386.118-3.27c.127-.948.413-1.856 1.147-2.593c.734-.737 1.639-1.024 2.583-1.152c.88-.118 1.98-.118 3.257-.118h3.07c1.276 0 2.374 0 3.255.118A3.601 3.601 0 0 0 15.24 2Z"/><path d="M6.6 11.397c0-2.726 0-4.089.844-4.936c.843-.847 2.2-.847 4.916-.847h2.88c2.715 0 4.073 0 4.917.847c.843.847.843 2.21.843 4.936v4.82c0 2.726 0 4.089-.843 4.936c-.844.847-2.202.847-4.917.847h-2.88c-2.715 0-4.073 0-4.916-.847c-.844-.847-.844-2.21-.844-4.936v-4.82Z"/></svg>',We='<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M2 12c0-4.714 0-7.071 1.464-8.536C4.93 2 7.286 2 12 2c4.714 0 7.071 0 8.535 1.464C22 4.93 22 7.286 22 12c0 4.714 0 7.071-1.465 8.535C19.072 22 16.714 22 12 22s-7.071 0-8.536-1.465C2 19.072 2 16.714 2 12Zm10-5.75a.75.75 0 0 1 .75.75v5.19l1.72-1.72a.75.75 0 1 1 1.06 1.06l-3 3a.75.75 0 0 1-1.06 0l-3-3a.75.75 0 1 1 1.06-1.06l1.72 1.72V7a.75.75 0 0 1 .75-.75Zm-4 10a.75.75 0 0 0 0 1.5h8a.75.75 0 0 0 0-1.5H8Z" clip-rule="evenodd"/></svg>',_e='<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M2 12c0-4.714 0-7.071 1.464-8.536C4.93 2 7.286 2 12 2c4.714 0 7.071 0 8.535 1.464C22 4.93 22 7.286 22 12c0 4.714 0 7.071-1.465 8.535C19.072 22 16.714 22 12 22s-7.071 0-8.536-1.465C2 19.072 2 16.714 2 12Zm10 5.75a.75.75 0 0 0 .75-.75v-5.19l1.72 1.72a.75.75 0 1 0 1.06-1.06l-3-3a.75.75 0 0 0-1.06 0l-3 3a.75.75 0 1 0 1.06 1.06l1.72-1.72V17c0 .414.336.75.75.75Zm-4-10a.75.75 0 0 1 0-1.5h8a.75.75 0 0 1 0 1.5H8Z" clip-rule="evenodd"/></svg>';var L,b,x;class je{constructor(){a(this,L);a(this,b);a(this,x);this.scrollValue=0,o(this,L,""),o(this,b,[]),o(this,x,{}),o(this,L,g.storeRegistry.name+"-tweaker")}openPanel(i){t(this,b).includes(i)||t(this,b).push(i)}closePanel(i){o(this,b,t(this,b).filter(e=>e!==i))}isPanelOpened(i){return t(this,b).includes(i)}changedSizes(i){return t(this,x)[i]}changeSize(i,e){e?t(this,x)[i]=e:delete t(this,x)[i]}save(){const i={openedPanels:t(this,b),changedSizes:t(this,x),scrollValue:this.scrollValue};localStorage.setItem(t(this,L),JSON.stringify(i)),g.storeRegistry.saveState()}load(){g.storeRegistry.loadState();const i=localStorage.getItem(t(this,L));if(i)try{const e=JSON.parse(i);e.openedPanels&&o(this,b,e.openedPanels),e.changedSizes&&o(this,x,e.changedSizes),e.scrollValue&&(this.scrollValue=e.scrollValue)}catch(e){console.error(e)}}}L=new WeakMap,b=new WeakMap,x=new WeakMap;const w=new je;var R;class K extends HTMLElement{constructor(...e){super();a(this,R);o(this,R,e)}addStore(e){t(this,R).push(e)}get firstStore(){return t(this,R)[0]}get stores(){return t(this,R)}updateStores(e){t(this,R).forEach(s=>{s.current=e})}}R=new WeakMap;const Be=C.createStylesheet({":host":{width:"100%",display:"inline-flex",height:"max-content"},"e-checkbox":{"--size":"calc(var(--height-input) * 0.8)",width:"var(--size)",height:"var(--size)",borderRadius:c.aptechkaTheme.borderRadiusSmall.var}});class Ee extends K{constructor(...i){super(...i),this.attachShadow({mode:"open"}).adoptedStyleSheets.push(Be),n.element(this,{children:[n.element("e-checkbox",{onChange:s=>{this.updateStores(s.currentTarget.checked)},ref:s=>{this.firstStore.subscribe(r=>{s.checked=r.current})}})]})}}customElements.get("e-tweaker-boolean-manager")||customElements.define("e-tweaker-boolean-manager",Ee);const Xe=C.createStylesheet({":host":{width:"100%",display:"inline-flex",height:"max-content"},input:{width:"100%",height:"var(--height-input)",padding:"0",background:"none",borderRadius:c.aptechkaTheme.borderRadius.var,border:"none",blockSize:"unset"},"input::-webkit-color-swatch, input::-webkit-color-swatch-wrapper":{boxSizing:"border-box",padding:"0px",border:"none",borderRadius:c.aptechkaTheme.borderRadius.var,height:"calc(var(--height-input) * 0.93)"}});class Ce extends K{constructor(...i){super(...i),this.attachShadow({mode:"open"}).adoptedStyleSheets.push(Xe),n.element(this,{children:[n.input({type:"color",value:this.firstStore,onInput:s=>{this.updateStores(s.currentTarget.value)}})]})}}customElements.get("e-tweaker-color-manager")||customElements.define("e-tweaker-color-manager",Ce);const Ye=C.createStylesheet({a:{color:"inherit",fontSize:"var(--font-size-small)"}});class ze extends K{constructor(...i){var s,r;super(...i),this.attachShadow({mode:"open"}).adoptedStyleSheets.push(Ye),console.log(this.firstStore),n.element(this,{children:[n.a({href:this.firstStore,target:(r=(s=this.firstStore.passport)==null?void 0:s.manager)!=null&&r.sameWindow?"_self":"_blank",children:this.firstStore})]})}}customElements.get("e-tweaker-link-manager")||customElements.define("e-tweaker-link-manager",ze);const Ge=C.createStylesheet({":host":{width:"100%",display:"flex",alignItems:"center",gap:"var(--gap-small)"},".inputs-wrapper":{display:"grid",gap:"var(--gap-small)",width:"100%"},input:{boxSizing:"border-box",outline:"none",fontVariantNumeric:"tabular-nums",fontFamily:"inherit",color:"inherit",border:"none",fontSize:"var(--font-size-small)",width:"100%",height:"var(--height-input)",margin:"0",padding:"0 var(--gap-small)",backgroundColor:"rgba(255, 255, 255, 0.1)",borderRadius:c.aptechkaTheme.borderRadius.var},".drag":{position:"relative",width:"100%",height:"calc(var(--height-input) * 0.2)",display:"flex",alignItems:"center"},".drag::before":{content:'""',position:"absolute",left:"0",width:"100%",zIndex:"-1",height:"1px",borderBottom:`1px solid ${c.aptechkaTheme.colorFont.var}`,transform:"translateY(-50%)",opacity:"0.3"},":host(.infinite) .drag::before":{borderBottom:`1px dashed ${c.aptechkaTheme.colorFont.var}`},".drag-knob":{"--size":"calc(var(--height-input) * 0.4)",width:"var(--size)",height:"var(--size)"},".drag-knob-inner":{width:"100%",height:"100%",backgroundColor:c.aptechkaTheme.colorFont.var,borderRadius:c.aptechkaTheme.borderRadiusSmall.var,transition:"opacity var(--duration-short)"},":host(.infinite) .grabbing .drag-knob-inner":{opacity:.3}});var P,q,$,E,F,Z,J,S,I,W,_,u,V,ge,me,ne,j;class Te extends K{constructor(...e){var r,l,d,p,y,M,O,we;super(...e);a(this,u);a(this,P,[]);a(this,q,[]);a(this,$);a(this,E);a(this,F);a(this,Z);a(this,J);a(this,S);a(this,I,!1);a(this,W,e=>{const s=f(this,u,V).call(this,e);return s.map((r,l)=>{const d=typeof r=="string"?parseFloat(r)||t(this,E):r,p=Je.clamp(d,t(this,E),t(this,F)),y=pe.toStep(p,t(this,$));s[l]=y}),t(this,J)==="number"?s[0]:s});a(this,_,()=>{f(this,u,V).call(this).map((e,s)=>{const r=t(this,P)[s];r&&(r.value=(e||0).toString())}),f(this,u,ge).call(this)});a(this,j,()=>{f(this,u,ge).call(this)});this.attachShadow({mode:"open"}).adoptedStyleSheets.push(Ge),o(this,E,pe.nullishCoalescing((l=(r=this.firstStore.passport)==null?void 0:r.manager)==null?void 0:l.min,-1/0)),o(this,F,pe.nullishCoalescing((p=(d=this.firstStore.passport)==null?void 0:d.manager)==null?void 0:p.max,1/0)),o(this,$,((M=(y=this.firstStore.passport)==null?void 0:y.manager)==null?void 0:M.step)||.01),o(this,Z,((we=(O=this.firstStore.passport)==null?void 0:O.manager)==null?void 0:we.ease)||1),o(this,J,Array.isArray(this.firstStore.current)?"array":"number"),o(this,S,isFinite(t(this,F))&&isFinite(t(this,E))),n.element(this,{class:t(this,S)?"":"infinite",children:f(this,u,V).call(this).map((Le,ie)=>n.div({class:"inputs-wrapper",children:[n.input({type:"number",step:t(this,$),min:t(this,E),max:t(this,F),ref:z=>t(this,P).push(z),value:Le,onChange:()=>{this.updateStores(t(this,P).map(z=>parseFloat(z.value)))}}),n.div({class:"drag",children:[n.div({class:"drag-knob",ref:z=>t(this,q).push(z),onPointerdown:z=>{z.preventDefault(),o(this,I,!0);const he=f(this,u,V).call(this),Pe=he[ie],T=t(this,q)[ie],Ie=t(this,P)[ie];if(T&&Ie){const ce=T.parentElement,Ve=f(this,u,me).call(this);ce.classList.add("grabbing"),ye.setupDrag(de=>{const be=de.x-z.x,qe=t(this,S)?ce.offsetWidth/(Ve||1):1,$e=Pe+be/qe*t(this,Z);if(he[ie]=$e,!t(this,S)){const Ae=f(this,u,ne).call(this,T,0);T.style.transform=`translateX(${Ae+be}px)`}this.updateStores([...he])},()=>{if(o(this,I,!1),!t(this,S)){const de=f(this,u,ne).call(this,T,0);T.style.transition="transform 0.1s",T.style.transform=`translateX(${de}px)`,ce.classList.remove("grabbing"),setTimeout(()=>{T.style.transition=""},100)}})}},children:n.div({class:"drag-knob-inner"})})]})]}))})}connectedCallback(){this.firstStore.addMiddleware(t(this,W)),this.firstStore.subscribe(t(this,_)),ke.elementResizer.subscribe(this,t(this,j))}disconnectedCallback(){this.firstStore.removeMiddleware(t(this,W)),this.firstStore.unsubscribe(t(this,_)),ke.elementResizer.unsubscribe(t(this,j))}}P=new WeakMap,q=new WeakMap,$=new WeakMap,E=new WeakMap,F=new WeakMap,Z=new WeakMap,J=new WeakMap,S=new WeakMap,I=new WeakMap,W=new WeakMap,_=new WeakMap,u=new WeakSet,V=function(e=this.firstStore.current){return Array.isArray(e)?e:[e]},ge=function(){f(this,u,V).call(this).map((e,s)=>{const r=t(this,q)[s];if(r&&(!t(this,I)||t(this,I)&&t(this,S))){const l=f(this,u,ne).call(this,r,e);r.style.transform=`translateX(${l}px)`}})},me=function(){return t(this,S)?t(this,F)-t(this,E):0},ne=function(e,s){const r=e.parentElement,l=f(this,u,me).call(this),d=l?s/l:.5;return(r.offsetWidth-e.offsetWidth)*d},j=new WeakMap;customElements.get("e-tweaker-number-manager")||customElements.define("e-tweaker-number-manager",Te);const Qe=C.createStylesheet({"e-select":{display:"block",width:"100%","--arrow-color":c.aptechkaTheme.colorFont.var},"e-select-head":{width:"100%",height:"var(--height-input)",display:"flex",alignItems:"center",justifyContent:"space-between",fontSize:"var(--font-size-small)"},"e-select-option":{height:"var(--height-input)",transitionDuration:"var(--duration-short)",transitionProperty:"color",fontSize:"var(--font-size-small)"},"e-select-option:hover":{color:c.aptechkaTheme.colorActive.var},svg:{width:"16px",height:"16px",fill:c.aptechkaTheme.colorFont.var,transitionProperty:"transform",transitionDuration:"var(--duration-short)"},".opened svg":{transform:"scaleY(-1)"}});class Re extends K{constructor(...i){var r,l;super(...i),this.attachShadow({mode:"open"}).adoptedStyleSheets.push(Qe);const s=((l=(r=this.firstStore.passport)==null?void 0:r.manager)==null?void 0:l.variants)||[];n.element(this,{children:n.element("e-select",{value:this.firstStore,onChange:d=>{this.updateStores(d.currentTarget.value)},lightChildren:[n.element("e-select-head",{lightChildren:[n.span({"data-value-holder":""})]}),...s.map((d,p)=>n.element("e-select-option",{lightChildren:d,default:p===0?!0:null}))]})})}}customElements.get("e-tweaker-select-manager")||customElements.define("e-tweaker-select-manager",Re);const Ue=C.createStylesheet({":host":{width:"100%",display:"flex",alignItems:"center"},input:{boxSizing:"border-box",outline:"none",fontVariantNumeric:"tabular-nums",fontFamily:"inherit",color:"inherit",border:"none",fontSize:"var(--font-size-small)",height:"var(--height-input)",width:"100%",margin:"0",padding:"0 var(--gap-small)",backgroundColor:"rgba(255, 255, 255, 0.1)",borderRadius:c.aptechkaTheme.borderRadius.var}});class Fe extends K{constructor(...i){super(...i),this.attachShadow({mode:"open"}).adoptedStyleSheets.push(Ue),n.element(this,{children:[n.input({class:"text-input",type:"string",value:this.firstStore,onChange:s=>{this.updateStores(s.currentTarget.value)}})]})}}customElements.get("e-tweaker-string-manager")||customElements.define("e-tweaker-string-manager",Fe);const et={boolean:Ee,color:Ce,link:ze,number:Te,select:Re,string:Fe},tt=C.createStylesheet({":host":{display:"grid",gridAutoFlow:"column",gridTemplateColumns:"0.5fr 1fr",alignItems:"center",color:c.aptechkaTheme.colorFont.var,gap:"var(--gap-medium)"},":host(.disabled)":{pointerEvents:"none",opacity:.5},".head":{fontSize:"var(--font-size-medium)",display:"flex",alignItems:"center",gap:"var(--gap-extra-small)"},".head-buttons":{display:"flex"},".head-button":{width:"14px",height:"14px",padding:"0",margin:"0",border:"none",background:"none",fill:c.aptechkaTheme.colorFont.var,transitionDuration:"var(--duration-short)",transitionProperty:"fill, opacity",opacity:"0"},":host(:hover) .head-button":{opacity:"1"},".head-button:hover":{fill:c.aptechkaTheme.colorActive.var},".head-button svg":{width:"100%",height:"100%"}});var v,A,N,D,H,B,X;class fe extends HTMLElement{constructor(e){var l,d,p,y;super();a(this,v,[]);a(this,A);a(this,N);a(this,D,!1);a(this,H);a(this,B,()=>{g.activeStores.current.find(e=>t(this,v).includes(e))||this.remove()});a(this,X,e=>{t(this,D)&&((e.metaKey||e.ctrlKey)&&e.code==="KeyC"?navigator.clipboard.writeText(t(this,v)[0].current):(e.metaKey||e.ctrlKey)&&e.code==="KeyR"&&(t(this,v).forEach(s=>{s.reset()}),e.preventDefault()))});o(this,v,[e.store]),o(this,A,e.store.passport.name),o(this,N,t(this,A).split(".").slice(-1).toString());const s=((d=(l=e.store.passport)==null?void 0:l.manager)==null?void 0:d.type)||"string";o(this,H,new et[s](t(this,v)[0])),this.attachShadow({mode:"open"}).adoptedStyleSheets.push(tt),n.element(this,{class:{disabled:((y=(p=e.store.passport)==null?void 0:p.manager)==null?void 0:y.disabled)||!1},onPointerleave:()=>{o(this,D,!1)},onPointerenter:()=>{o(this,D,!0)},children:[n.div({class:"head",children:[n.div({class:"name",children:t(this,N)+":"}),n.div({class:"head-buttons",children:[n.button({class:"head-button",children:xe,onClick:()=>{navigator.clipboard.writeText(t(this,v)[0].current)}}),n.button({class:"head-button",children:Se,onClick:()=>{t(this,v).forEach(M=>{M.reset()})}})]})]}),t(this,H)]})}get key(){return t(this,A)}get name(){return t(this,N)}get stores(){return t(this,v)}addStore(e){t(this,H).addStore(e)}connectedCallback(){g.activeStores.subscribe(t(this,B)),addEventListener("keydown",t(this,X)),Ze.dispatchSizeChangeEvent(this)}disconnectedCallback(){g.activeStores.unsubscribe(t(this,B)),removeEventListener("keydown",t(this,X))}}v=new WeakMap,A=new WeakMap,N=new WeakMap,D=new WeakMap,H=new WeakMap,B=new WeakMap,X=new WeakMap;customElements.get("e-tweaker-field")||customElements.define("e-tweaker-field",fe);const st=C.createStylesheet({".wrapper":{boxSizing:"border-box",backgroundColor:"rgba(255, 255, 255, 0.1)",borderRadius:c.aptechkaTheme.borderRadius.var},".head":{boxSizing:"border-box",width:"100%",height:"var(--tweaker-folder-height)",paddingLeft:"var(--gap-medium)",paddingRight:"var(--gap-medium)",display:"flex",alignItems:"center",justifyContent:"space-between",backgroundColor:c.aptechkaTheme.colorMainAux.var,borderRadius:c.aptechkaTheme.borderRadius.var},".name":{fontSize:"var(--font-size-large)",color:c.aptechkaTheme.colorFont.var},".body":{display:"none",overflow:"hidden","@supports (height: calc-size(auto))":{height:"0"}},":host(.transition-allowed) .body":{transition:"height var(--duration-short), display var(--duration-short) allow-discrete"},":host(.opened) .body":{height:"calc-size(auto)",display:"block","@starting-style":{height:"0"}},".body-content":{boxSizing:"border-box",padding:"var(--gap-large)",display:"grid",gap:"var(--gap-medium)"},".arrow":{width:"20px",height:"20px",fill:c.aptechkaTheme.colorFont.var,transition:"transform var(--duration-short)"},".opened .arrow":{transform:"scaleY(-1)"}});var k,Y,m,G,Q,U,ee,oe;const le=class le extends HTMLElement{constructor(e){super();a(this,k);a(this,Y,new g.Store(null));a(this,m,new g.Store([]));a(this,G);a(this,Q,null);a(this,U,null);a(this,ee,null);a(this,oe,e=>{let s=[],r=[];e.forEach(l=>{s=[...s,...l.removedNodes],r=[...r,...l.addedNodes]}),t(this,m).current=t(this,m).current.filter(l=>!s.includes(l)),t(this,k)&&!t(this,m).current.length&&!r.length&&this.remove()});this.attachShadow({mode:"open"}).adoptedStyleSheets.push(st),o(this,k,e.key),o(this,G,new MutationObserver(t(this,oe))),n.element(this,{children:[n.div({class:"wrapper",children:[n.div({class:"head",onClick:r=>{this.classList.toggle("opened"),this.classList.contains("opened")?w.openPanel(t(this,k)):w.closePanel(t(this,k))},children:[t(this,k)?n.div({class:"name",children:[t(this,k).split(".").slice(-1).toString()]}):null,t(this,Y),n.element(Oe.arrowIcon,{class:"arrow"})]}),n.div({class:"body",ref:r=>{o(this,Q,r)},children:n.div({class:"body-content",children:t(this,m),ref:r=>{o(this,U,r),o(this,ee,r.firstElementChild)}})})]})]}),e!=null&&e.storeBox&&this.handleStore(e.storeBox)}get key(){return t(this,k)}get head(){return t(this,Y)}get content(){return t(this,m)}get bodyElement(){return t(this,Q)}get contentElement(){return t(this,U)}connectedCallback(){w.isPanelOpened(t(this,k))&&this.classList.add("opened"),setTimeout(()=>{this.classList.add("transition-allowed")}),t(this,G).observe(t(this,ee),{childList:!0})}handleStore(e){if(e.remainingFolders.length){const r=e.store.passport.name.split("."),l=r.slice(0,r.length-e.remainingFolders.length).join("."),d=t(this,m).current.find(p=>p.key===l);d instanceof le?d.handleStore({store:e.store,remainingFolders:e.remainingFolders.slice(1)}):t(this,m).current=[...t(this,m).current,new le({key:l,storeBox:{store:e.store,remainingFolders:e.remainingFolders.slice(1)}})]}else{const s=t(this,m).current.find(r=>r.key===e.store.passport.name);s instanceof fe?s.addStore(e.store):t(this,m).current=[...t(this,m).current,new fe({store:e.store})]}}};k=new WeakMap,Y=new WeakMap,m=new WeakMap,G=new WeakMap,Q=new WeakMap,U=new WeakMap,ee=new WeakMap,oe=new WeakMap;let ae=le;customElements.get("e-tweaker-folder")||customElements.define("e-tweaker-folder",ae);const rt=C.createStylesheet({":host":{"--tweaker-width":"550px","--tweaker-offset":"20px","--tweaker-folder-height":"35px","--height-input":"25px","--gap-large":"12px","--gap-medium":"10px","--gap-small":"8px","--gap-extra-small":"4px","--font-size-large":"16px","--font-size-medium":"14px","--font-size-small":"12px","--duration-short":"0.2s",fontFamily:"sans-serif",position:"absolute",top:"var(--tweaker-offset)",right:"var(--tweaker-offset)",width:"var(--tweaker-width)",backgroundColor:c.aptechkaTheme.colorMain.var,borderRadius:c.aptechkaTheme.borderRadius.var,transition:"opacity 0.1s",zIndex:"100",opacity:"0.1"},":host(:hover)":{opacity:"1 !important"},".resize":{position:"absolute",left:"0",top:"0",width:"calc(var(--tweaker-width) * 0.025)",height:"100%",zIndex:"1",cursor:"ew-resize"},".tweaker-buttons":{display:"flex",alignItems:"center",gap:"var(--gap-extra-small)"},".tweaker-button":{width:"18px",height:"18px",padding:"0",margin:"0",background:"none",border:"none",fill:c.aptechkaTheme.colorFont.var,transitionProperty:"fill",transitionDuration:"var(--duration-short)"},".tweaker-button:hover":{fill:c.aptechkaTheme.colorActive.var},".tweaker-button svg":{width:"100%",height:"100%"},":host .body-content":{maxHeight:`calc(
|
|
2
|
-
100dvh -
|
|
3
|
-
(
|
|
4
|
-
var(--tweaker-offset) * 2 +
|
|
5
|
-
var(--tweaker-folder-height)
|
|
6
|
-
)
|
|
7
|
-
)`,overflow:"hidden auto","-ms-overflow-style":"none","scrollbar-width":"none"},":host .body-content::-webkit-scrollbar":{display:"none"},[`@media ${Ke.ViewportMediaRules["<=mobile"]}`]:{":host":{position:"absolute",top:"0",right:"0",width:"100% !important",borderTopLeftRadius:"0",borderTopRightRadius:"0"},":host .body-content":{maxHeight:`calc(
|
|
8
|
-
100dvh -
|
|
9
|
-
var(--tweaker-folder-height)
|
|
10
|
-
)`}}});var te,se,re;class Me extends ae{constructor(){super({key:""});a(this,te,!1);a(this,se,()=>{w.save()});a(this,re,He.debounce(()=>{g.activeStores.current.forEach(e=>{var s;if(e.passport&&!((s=e.passport.manager)!=null&&s.invisible)){const r=e.passport.name.split(".");this.handleStore({store:e,remainingFolders:r.length>1?r.slice(0,-1):[]})}}),t(this,te)||(o(this,te,!0),this.contentElement.scroll({top:w.scrollValue}),this.contentElement.addEventListener("scroll",()=>{w.scrollValue=this.contentElement.scrollTop}))},10));w.load(),this.shadowRoot.adoptedStyleSheets.push(rt),this.head.current=[n.div({class:"tweaker-buttons",onClick:e=>{e.stopPropagation()},children:[n.button({class:"tweaker-button",children:Se,onClick:()=>{g.storeRegistry.resetState()}}),n.button({class:["tweaker-button"],children:[xe],onClick:()=>{navigator.clipboard.writeText(JSON.stringify(g.storeRegistry.getState()))}}),n.button({class:"tweaker-button",children:We,onClick:()=>{De.createJSONAndSave(g.storeRegistry.name,g.storeRegistry.getState())}}),n.label({class:"tweaker-button",children:[_e,n.input({type:"file",style:{display:"none"},onChange:e=>{var l;const r=(l=e.currentTarget.files)==null?void 0:l[0];if(r){const d=new FileReader;d.onload=p=>{var M,O;const y=(O=(M=p.target)==null?void 0:M.result)==null?void 0:O.toString();y&&g.storeRegistry.loadState(y)},d.readAsText(r)}}})]})]})],n.element(this.bodyElement,{children:[n.div({class:"resize",onPointerdown:e=>{e.preventDefault();const s=this.getBoundingClientRect(),r=this.contentElement.scrollTop;ye.setupDrag(l=>{const d=e.x-l.x,p=Math.max(400,s.width+d);this.style.width=p+"px",w.changeSize("tweaker",p)},()=>{setTimeout(()=>{this.contentElement.scroll({top:r})},10)})},onDblclick:()=>{this.style.width="",w.changeSize("tweaker",null)}})]})}connectedCallback(){super.connectedCallback(),window.addEventListener("beforeunload",t(this,se)),g.activeStores.subscribe(t(this,re)),w.changedSizes("tweaker")&&(this.style.width=w.changedSizes("tweaker")+"px")}disconnectedCallback(){window.removeEventListener("beforeunload",t(this,se)),w.save(),g.activeStores.unsubscribe(t(this,re))}}te=new WeakMap,se=new WeakMap,re=new WeakMap;customElements.get("e-tweaker")||customElements.define("e-tweaker",Me);Ne.isBrowser&&document.body.appendChild(new Me);
|