aptechka 0.41.7 → 0.42.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/lib/Animation-CMiBKrwE.cjs +1 -0
- package/lib/{Animation-CSexZn4M.js → Animation-DPRlQfW2.js} +1 -1
- package/lib/{Damped-BMr6Toib.cjs → Damped-CHZ314Rn.cjs} +1 -1
- package/lib/{Damped-Bcngr1kp.js → Damped-DxylD27S.js} +1 -1
- package/lib/{Tweened-D-vlLZdS.cjs → Tweened-Dn6CMA-p.cjs} +1 -1
- package/lib/{Tweened-sqOQu9Gf.js → Tweened-p5hYr6lL.js} +2 -2
- package/lib/animation/Animation.d.ts +2 -2
- package/lib/animation/Damped.d.ts +1 -1
- package/lib/animation/Tweened.d.ts +1 -1
- package/lib/animation/index.cjs +1 -1
- package/lib/animation/index.js +3 -3
- package/lib/attribute/index.d.ts +1 -1
- package/lib/attribute/index.js +1 -1
- package/lib/canvas/index.cjs +1 -1
- package/lib/canvas/index.js +2 -2
- package/lib/class-linked-status/index.d.ts +1 -1
- package/lib/connector/index.cjs +1 -1
- package/lib/connector/index.js +1 -1
- package/lib/controls/AutoplayControls.d.ts +1 -1
- package/lib/controls/index.cjs +1 -1
- package/lib/controls/index.js +4 -4
- package/lib/css-property/index.cjs +1 -1
- package/lib/css-property/index.d.ts +1 -1
- package/lib/css-property/index.js +2 -2
- package/lib/custom-scrollbar/index.cjs +1 -0
- package/lib/custom-scrollbar/index.d.ts +13 -0
- package/lib/custom-scrollbar/index.js +60 -0
- package/lib/dev/index.cjs +1 -1
- package/lib/dev/index.js +1 -1
- package/lib/device/Viewport.d.ts +1 -1
- package/lib/device/index.cjs +1 -1
- package/lib/device/index.js +1 -1
- package/lib/{dom-0S_WDL4g.js → dom-CVWzyXPH.js} +2 -2
- package/lib/{easings-BEmRlrDd.js → easings-Bni3YAAW.js} +15 -15
- package/lib/element-resizer/index.cjs +1 -0
- package/lib/element-resizer/{vanilla/index.d.ts → index.d.ts} +1 -1
- package/lib/element-resizer/{vanilla/index.js → index.js} +2 -2
- package/lib/en3/index.cjs +1 -1
- package/lib/en3/index.js +3 -3
- package/lib/iframe/index.cjs +1 -0
- package/lib/iframe/index.js +38 -0
- package/lib/image/index.cjs +1 -0
- package/lib/image/index.js +20 -0
- package/lib/intersector/index.cjs +1 -0
- package/lib/intersector/{vanilla/index.d.ts → index.d.ts} +1 -1
- package/lib/intersector/{vanilla/index.js → index.js} +2 -2
- package/lib/ladder/index.d.ts +1 -1
- package/lib/layout-Ctc2p3uz.cjs +1 -0
- package/lib/layout-DpZo-I0y.js +29 -0
- package/lib/layout-box/index.cjs +1 -1
- package/lib/layout-box/index.d.ts +1 -1
- package/lib/layout-box/index.js +5 -5
- package/lib/masonry-layout/index.cjs +1 -0
- package/lib/masonry-layout/index.d.ts +11 -0
- package/lib/masonry-layout/index.js +60 -0
- package/lib/media/index.cjs +1 -1
- package/lib/media/index.d.ts +1 -1
- package/lib/media/index.js +1 -1
- package/lib/need_redo_tweaker/TweakerBooleanManagerElement.d.ts +1 -1
- package/lib/need_redo_tweaker/TweakerColorManagerElement.d.ts +1 -1
- package/lib/need_redo_tweaker/TweakerElement.d.ts +1 -1
- package/lib/need_redo_tweaker/TweakerFieldElement.d.ts +1 -1
- package/lib/need_redo_tweaker/TweakerFolderElement.d.ts +1 -1
- package/lib/need_redo_tweaker/TweakerLinkManagerElement.d.ts +1 -1
- package/lib/need_redo_tweaker/TweakerNumberManagerElement.d.ts +1 -1
- package/lib/need_redo_tweaker/TweakerSelectManagerElement.d.ts +1 -1
- package/lib/need_redo_tweaker/TweakerStoreManagerElement.d.ts +1 -1
- package/lib/need_redo_tweaker/TweakerStringManagerElement.d.ts +1 -1
- package/lib/need_redo_tweaker/element-constructor/ElementConstructor.d.ts +1 -1
- package/lib/need_redo_tweaker/index.cjs +1 -1
- package/lib/need_redo_tweaker/index.js +2 -2
- package/lib/pointer/index.cjs +1 -1
- package/lib/pointer/index.js +5 -5
- package/lib/popover/PopoverElement.d.ts +1 -1
- package/lib/popover/index.cjs +1 -1
- package/lib/popover/index.js +1 -1
- package/lib/scroll/{vanilla/ScrollElement.d.ts → ScrollElement.d.ts} +4 -4
- package/lib/scroll/{vanilla/ScrollSegmentElement.d.ts → ScrollSegmentElement.d.ts} +1 -1
- package/lib/scroll/index.cjs +1 -0
- package/lib/scroll/{vanilla/index.js → index.js} +50 -50
- package/lib/scroll-entries/index.js +1 -1
- package/lib/scroll-segment/index.cjs +1 -1
- package/lib/scroll-segment/index.d.ts +1 -1
- package/lib/scroll-segment/index.js +4 -4
- package/lib/sequence/index.cjs +1 -0
- package/lib/{media-elements/sequence → sequence}/index.d.ts +2 -3
- package/lib/sequence/index.js +158 -0
- package/lib/size-element/index.cjs +1 -0
- package/lib/size-element/index.d.ts +10 -0
- package/lib/size-element/index.js +32 -0
- package/lib/{media-elements/source/index.d.ts → source/SourceElement.d.ts} +3 -3
- package/lib/source/SourceManager.d.ts +1 -1
- package/lib/source/index.cjs +5 -1
- package/lib/source/index.d.ts +1 -0
- package/lib/source/index.js +173 -67
- package/lib/store/index.cjs +1 -0
- package/lib/store/{vanilla/index.js → index.js} +3 -3
- package/lib/ticker/index.cjs +1 -0
- package/lib/ticker/{vanilla/index.d.ts → index.d.ts} +1 -1
- package/lib/ticker/{vanilla/index.js → index.js} +2 -2
- package/lib/utils/clipboard.d.ts +1 -0
- package/lib/utils/index.cjs +1 -1
- package/lib/utils/index.d.ts +3 -1
- package/lib/utils/index.js +190 -144
- package/lib/utils/layout.d.ts +4 -3
- package/lib/utils/scroll.d.ts +6 -0
- package/lib/utils/template.d.ts +1 -0
- package/lib/video/index.cjs +1 -0
- package/lib/video/index.js +54 -0
- package/lib/window-resizer/index.cjs +1 -0
- package/lib/window-resizer/{vanilla/index.d.ts → index.d.ts} +1 -1
- package/lib/window-resizer/{vanilla/index.js → index.js} +3 -3
- package/lib/youtube/index.cjs +1 -0
- package/lib/youtube/index.js +81 -0
- package/package.json +101 -99
- package/lib/Animation-esZH7swx.cjs +0 -1
- package/lib/element-resizer/react/index.cjs +0 -1
- package/lib/element-resizer/react/index.d.ts +0 -2
- package/lib/element-resizer/react/index.js +0 -8
- package/lib/element-resizer/vanilla/index.cjs +0 -1
- package/lib/intersector/react/index.cjs +0 -1
- package/lib/intersector/react/index.d.ts +0 -4
- package/lib/intersector/react/index.js +0 -12
- package/lib/intersector/vanilla/index.cjs +0 -1
- package/lib/layout-8ryRAMGJ.cjs +0 -1
- package/lib/layout-HoBT_Da2.js +0 -12
- package/lib/media-elements/index.cjs +0 -5
- package/lib/media-elements/index.d.ts +0 -6
- package/lib/media-elements/index.js +0 -416
- package/lib/scroll/react/Scroll.d.ts +0 -13
- package/lib/scroll/react/ScrollBulletButtons.d.ts +0 -11
- package/lib/scroll/react/ScrollSegment.d.ts +0 -18
- package/lib/scroll/react/ScrollSetButton.d.ts +0 -14
- package/lib/scroll/react/ScrollStepButton.d.ts +0 -14
- package/lib/scroll/react/Scrollbar.d.ts +0 -11
- package/lib/scroll/react/index.cjs +0 -30
- package/lib/scroll/react/index.d.ts +0 -6
- package/lib/scroll/react/index.js +0 -761
- package/lib/scroll/vanilla/index.cjs +0 -1
- package/lib/store/react/index.cjs +0 -1
- package/lib/store/react/index.d.ts +0 -1
- package/lib/store/react/index.js +0 -14
- package/lib/store/react/useStore.d.ts +0 -2
- package/lib/store/vanilla/index.cjs +0 -1
- package/lib/studio/Outliner/File/index.d.ts +0 -8
- package/lib/studio/Outliner/Folder/index.d.ts +0 -9
- package/lib/studio/Outliner/index.d.ts +0 -2
- package/lib/studio/Studio/index.d.ts +0 -2
- package/lib/studio/Tweaker/index.d.ts +0 -4
- package/lib/studio/index.d.ts +0 -1
- package/lib/studio/store.d.ts +0 -2
- package/lib/ticker/react/index.cjs +0 -1
- package/lib/ticker/react/index.d.ts +0 -5
- package/lib/ticker/react/index.js +0 -19
- package/lib/ticker/vanilla/index.cjs +0 -1
- package/lib/utils/ts-react-utility.d.ts +0 -12
- package/lib/window-resizer/react/index.cjs +0 -1
- package/lib/window-resizer/react/index.d.ts +0 -2
- package/lib/window-resizer/react/index.js +0 -8
- package/lib/window-resizer/vanilla/index.cjs +0 -1
- /package/lib/{media-elements/iframe → iframe}/index.d.ts +0 -0
- /package/lib/{media-elements/image → image}/index.d.ts +0 -0
- /package/lib/scroll/{vanilla/ScrollBulletButtonsElement.d.ts → ScrollBulletButtonsElement.d.ts} +0 -0
- /package/lib/scroll/{vanilla/ScrollButtonElement.d.ts → ScrollButtonElement.d.ts} +0 -0
- /package/lib/scroll/{vanilla/ScrollSection.d.ts → ScrollSection.d.ts} +0 -0
- /package/lib/scroll/{vanilla/ScrollSetButtonElement.d.ts → ScrollSetButtonElement.d.ts} +0 -0
- /package/lib/scroll/{vanilla/ScrollStepButtonElement.d.ts → ScrollStepButtonElement.d.ts} +0 -0
- /package/lib/scroll/{vanilla/ScrollUserElement.d.ts → ScrollUserElement.d.ts} +0 -0
- /package/lib/scroll/{vanilla/ScrollbarElement.d.ts → ScrollbarElement.d.ts} +0 -0
- /package/lib/scroll/{vanilla/index.d.ts → index.d.ts} +0 -0
- /package/lib/store/{vanilla/Composed.d.ts → Composed.d.ts} +0 -0
- /package/lib/store/{vanilla/Derived.d.ts → Derived.d.ts} +0 -0
- /package/lib/store/{vanilla/DerivedArray.d.ts → DerivedArray.d.ts} +0 -0
- /package/lib/store/{vanilla/Resource.d.ts → Resource.d.ts} +0 -0
- /package/lib/store/{vanilla/Store.d.ts → Store.d.ts} +0 -0
- /package/lib/store/{vanilla/StoreRegistry.d.ts → StoreRegistry.d.ts} +0 -0
- /package/lib/store/{vanilla/index.d.ts → index.d.ts} +0 -0
- /package/lib/{media-elements/video → video}/index.d.ts +0 -0
- /package/lib/{media-elements/youtube → youtube}/index.d.ts +0 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
var m = (e) => {
|
|
2
|
+
throw TypeError(e);
|
|
3
|
+
};
|
|
4
|
+
var c = (e, s, t) => s.has(e) || m("Cannot " + t);
|
|
5
|
+
var r = (e, s, t) => (c(e, s, "read from private field"), t ? t.call(e) : s.get(e)), n = (e, s, t) => s.has(e) ? m("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(e) : s.set(e, t), l = (e, s, t, h) => (c(e, s, "write to private field"), h ? h.call(e, t) : s.set(e, t), t);
|
|
6
|
+
import { elementResizer as y } from "../element-resizer/index.js";
|
|
7
|
+
var i, o;
|
|
8
|
+
class p extends HTMLElement {
|
|
9
|
+
constructor() {
|
|
10
|
+
super(...arguments);
|
|
11
|
+
n(this, i, this);
|
|
12
|
+
n(this, o, () => {
|
|
13
|
+
r(this, i).style.removeProperty("--width"), r(this, i).style.removeProperty("--height"), setTimeout(() => {
|
|
14
|
+
const t = this.offsetWidth, h = this.offsetHeight;
|
|
15
|
+
r(this, i).style.setProperty("--width", t + "px"), r(this, i).style.setProperty("--height", h + "px");
|
|
16
|
+
}, 0);
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
connectedCallback() {
|
|
20
|
+
var h;
|
|
21
|
+
const t = (h = this.getAttribute("target")) == null ? void 0 : h.trim();
|
|
22
|
+
t && (t === "parent" ? l(this, i, this.parentElement || this) : l(this, i, document.querySelector(t) || this)), y.subscribe(this, r(this, o));
|
|
23
|
+
}
|
|
24
|
+
disconnectedCallback() {
|
|
25
|
+
y.unsubscribe(r(this, o)), r(this, i).style.removeProperty("--width"), r(this, i).style.removeProperty("--height");
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
i = new WeakMap(), o = new WeakMap();
|
|
29
|
+
customElements.get("e-size-element") || customElements.define("e-size-element", p);
|
|
30
|
+
export {
|
|
31
|
+
p as SizeElement
|
|
32
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { SourceManager } from '
|
|
2
|
-
import { ClassLinkedStatus } from '
|
|
3
|
-
import { SourceSetOptions } from '
|
|
1
|
+
import { SourceManager } from '.';
|
|
2
|
+
import { ClassLinkedStatus } from '../class-linked-status';
|
|
3
|
+
import { SourceSetOptions } from './SourceSet';
|
|
4
4
|
export interface SourceEvents {
|
|
5
5
|
sourceCapture: CustomEvent;
|
|
6
6
|
sourceRelease: CustomEvent;
|
package/lib/source/index.cjs
CHANGED
|
@@ -1 +1,5 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var W=h=>{throw TypeError(h)};var G=(h,r,e)=>r.has(h)||W("Cannot "+e);var t=(h,r,e)=>(G(h,r,"read from private field"),e?e.call(h):r.get(h)),i=(h,r,e)=>r.has(h)?W("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(h):r.set(h,e),s=(h,r,e,o)=>(G(h,r,"write to private field"),o?o.call(h,e):r.set(h,e),e),_=(h,r,e)=>(G(h,r,"access private method"),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Y=require("../class-linked-status/index.cjs"),tt=require("../browser-CpzFX2xg.cjs"),U=require("../events-KVanG9sR.cjs"),et=require("../string-DhgS_iFl.cjs"),K=require("../loading/index.cjs"),st=require("../order/index.cjs"),Z=require("../window-resizer/index.cjs"),it=require("../Store-C2J4Q87x.cjs");var T,w,$,q,u,f,M;class J{constructor(r){i(this,T);i(this,w);i(this,$);i(this,q);i(this,u);i(this,f);i(this,M);s(this,T,r);let e=r.split(".");const o=/\b\d{1,2}x\b/g,d=e.find(p=>p.match(o)&&parseInt(p));s(this,$,d?parseInt(d):1),d&&(e=e.slice(0,-1)),s(this,w,e.length>1?e.slice(0,-1).join("."):e.join("."));const l=/\d+max/g,x=/\d+min/g,B=/\d+mar/g,P=/\d+mir/g,H=e.find(p=>p.match(l)),n=e.find(p=>p.match(x)),b=e.find(p=>p.match(B)),N=e.find(p=>p.match(P));b?(s(this,u,parseInt(b)),s(this,f,"max"),s(this,q,`(max-aspect-ratio: ${t(this,u)})`)):N?(s(this,u,parseInt(N)),s(this,f,"max"),s(this,q,`(min-aspect-ratio: ${t(this,u)})`)):H?(s(this,u,parseInt(H)),s(this,f,"max"),s(this,q,`(max-width: ${t(this,u)}px)`)):n?(s(this,u,parseInt(n)),s(this,q,`(min-width: ${t(this,u)}px)`),s(this,f,"min")):(s(this,u,0),s(this,q,`(min-width: ${t(this,u)}px)`),s(this,f,"min")),s(this,w,t(this,w).replace(`.${t(this,u)}${t(this,f)}`,"")),s(this,M,e[e.length-1]===t(this,w)?"":"."+e[e.length-1]),s(this,M,t(this,M).replace(`.${t(this,u)}${t(this,f)}`,""))}get url(){return t(this,T)}get name(){return t(this,w)}get density(){return t(this,$)}get query(){return t(this,q)}get extension(){return t(this,M)}get queryType(){return t(this,f)}get queryValue(){return t(this,u)}}T=new WeakMap,w=new WeakMap,$=new WeakMap,q=new WeakMap,u=new WeakMap,f=new WeakMap,M=new WeakMap;let rt=0;var m,a,y,E,g,z,R,c,k,v,S,C,A,j,D,O,F;class nt extends HTMLElement{constructor(e){super();i(this,A);i(this,m,null);i(this,a,null);i(this,y,!1);i(this,E,!1);i(this,g,!1);i(this,z,"");i(this,R,"");i(this,c,new Y.ClassLinkedStatus(this,{loading:!1,loaded:!1,error:!1,clear:!1}));i(this,k,null);i(this,v);i(this,S,null);i(this,C);i(this,D,e=>{const o=e[0];t(this,g)&&(!t(this,E)||this.hasAttribute("reload-source"))&&o.isIntersecting&&this.triggerLazyLoad(),o.isIntersecting?U.dispatchEvent(this,"sourceCapture",{custom:!0}):(this.hasAttribute("reload-source")&&_(this,A,j).call(this,void 0),U.dispatchEvent(this,"sourceRelease",{custom:!0}))});i(this,O,()=>{t(this,c).set("loaded",!0),t(this,c).set("error",!1),t(this,c).set("loading",!1),!t(this,g)&&!t(this,y)&&K.loading.complete(t(this,R)),U.dispatchEvent(this,"sourceLoaded",{custom:!0});const e=getComputedStyle(this).getPropertyValue("--clear-duration");e?s(this,v,setTimeout(()=>{t(this,c).set("clear",!0)},parseFloat(e)*1e3)):t(this,c).set("clear",!0),s(this,y,!0)});i(this,F,e=>{t(this,c).set("loaded",!1),t(this,c).set("error",!0),t(this,c).set("loading",!1),!t(this,g)&&!t(this,y)&&K.loading.error(t(this,R)),U.dispatchEvent(this,"sourceError",{custom:!0}),s(this,y,!0)});s(this,C,e==null?void 0:e.sourceSetOptions),tt.isBrowser&&window.IntersectionObserver&&s(this,k,new IntersectionObserver(t(this,D)))}get consumerElement(){return t(this,a)}get sourceManager(){return t(this,m)}get status(){return t(this,c)}get isLazy(){return t(this,g)}get currentURL(){return t(this,S)}get isFirstLoadHappened(){return t(this,y)}triggerLazyLoad(){!t(this,E)&&t(this,m).current&&t(this,m).current!==t(this,m).previous&&(s(this,E,!0),_(this,A,j).call(this,t(this,m).current))}connectedCallback(){s(this,z,`source-consumer-${++rt}`);const e=this.getAttribute("srcset")||"",o=this.hasAttribute("notify")?this.closest(this.getAttribute("notify")):null;o&&t(this,c).addElement(o),s(this,a,this.createConsumer()),t(this,a).style.cssText=`
|
|
2
|
+
display: block;
|
|
3
|
+
width: 100%;
|
|
4
|
+
height: 100%;
|
|
5
|
+
`,t(this,a).classList.add("source-consumer"),Array.from(this.attributes).forEach(d=>{if(d.name!=="srcset"){const l=d.nodeValue||"",x=et.kebabToCamel(d.name);x in t(this,a)&&(t(this,a)[x]=l||!0)}}),this.appendChild(t(this,a)),s(this,m,new X({srcset:e,sourceSetOptions:t(this,C)})),s(this,g,this.hasAttribute("lazy")),t(this,m).subscribe(d=>{(!t(this,g)||t(this,g)&&t(this,E))&&_(this,A,j).call(this,d.current)}),t(this,m).connect(),t(this,k).observe(this)}disconnectedCallback(){var e;clearTimeout(t(this,v)),t(this,k).disconnect(),(e=t(this,m))==null||e.close(),t(this,a)&&(t(this,a).onloadeddata=null,t(this,a).onload=null,t(this,a).onerror=null,t(this,a).remove()),s(this,y,!1),s(this,E,!1),t(this,c).reset()}}m=new WeakMap,a=new WeakMap,y=new WeakMap,E=new WeakMap,g=new WeakMap,z=new WeakMap,R=new WeakMap,c=new WeakMap,k=new WeakMap,v=new WeakMap,S=new WeakMap,C=new WeakMap,A=new WeakSet,j=function(e){if(clearTimeout(t(this,v)),t(this,a).onloadeddata=null,t(this,a).onload=null,t(this,a).onerror=null,t(this,c).set("loaded",!1),t(this,c).set("error",!1),t(this,c).set("loading",!1),t(this,c).set("clear",!1),e){s(this,R,`${t(this,z)}-${e.url}`);const o=this.hasAttribute("keep-source-parameters");t(this,c).set("loading",!0),s(this,S,o?e.url:e.name+e.extension),this.consumeSource(t(this,S)),!t(this,g)&&!t(this,y)&&K.loading.add(t(this,R)),t(this,a).onloadeddata=()=>{t(this,O).call(this)},t(this,a).onload=()=>{t(this,O).call(this)},t(this,a).onerror=()=>{t(this,F).call(this,t(this,S))}}else s(this,S,null),this.consumeSource(null)},D=new WeakMap,O=new WeakMap,F=new WeakMap;var L;class Q{constructor(r,e){i(this,L);s(this,L,new Map);const o=(e==null?void 0:e.mediaBuckets)!==!1,d=typeof r=="string"?o?r.trim().split(",").map(n=>n.trim()).filter(n=>!!n):[r]:r,l=[];d.forEach(n=>{const b=new J(n);l.push([b.query,b])});const x=l.filter(n=>n[1].queryType.includes("max")).sort((n,b)=>b[1].queryValue-n[1].queryValue),B=l.filter(n=>n[1].queryType.includes("min")&&n[1].queryValue!==0).sort((n,b)=>n[1].queryValue-b[1].queryValue),P=l.filter(n=>n[0]==="(min-width: 0px)");(P?[...P,...x,...B]:[...x,...B]).forEach(n=>{t(this,L).has(n[0])||t(this,L).set(n[0],[]),t(this,L).get(n[0]).push(n[1])})}get mediaBuckets(){return t(this,L)}}L=new WeakMap;var V,I;class X extends it.Store{constructor(e){super(void 0);i(this,V);i(this,I,()=>{let e;t(this,V).mediaBuckets.forEach((l,x)=>{matchMedia(x).matches&&(e=l)});let o,d=0;e==null||e.forEach(l=>{l.density>d&&l.density<=Math.max(devicePixelRatio,1)&&(d=l.density,o=l)}),e!=null&&e.length&&!o&&(o=e[0]),this.current=o});s(this,V,new Q(e.srcset,e.sourceSetOptions))}close(){super.close(),this.disconnect()}connect(){Z.windowResizer.subscribe(t(this,I),st.RESIZE_ORDER.SOURCE_MANAGER),t(this,I).call(this)}disconnect(){Z.windowResizer.unsubscribe(t(this,I))}}V=new WeakMap,I=new WeakMap;exports.Source=J;exports.SourceElement=nt;exports.SourceManager=X;exports.SourceSet=Q;
|
package/lib/source/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export { Source } from './SourceClass';
|
|
2
|
+
export { SourceElement, type SourceElementOptions, type SourceEvents, } from './SourceElement';
|
|
2
3
|
export { SourceSet, type SourceSetMediaSources, type SourceSetMediaBucket, } from './SourceSet';
|
|
3
4
|
export { SourceManager, type SourceManagerSourceSet, type SourceManagerParameters, } from './SourceManager';
|
package/lib/source/index.js
CHANGED
|
@@ -1,107 +1,213 @@
|
|
|
1
|
-
var
|
|
2
|
-
throw TypeError(
|
|
1
|
+
var W = (n) => {
|
|
2
|
+
throw TypeError(n);
|
|
3
3
|
};
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
i(this,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
i(this,
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
4
|
+
var G = (n, r, e) => r.has(n) || W("Cannot " + e);
|
|
5
|
+
var t = (n, r, e) => (G(n, r, "read from private field"), e ? e.call(n) : r.get(n)), i = (n, r, e) => r.has(n) ? W("Cannot add the same private member more than once") : r instanceof WeakSet ? r.add(n) : r.set(n, e), s = (n, r, e, o) => (G(n, r, "write to private field"), o ? o.call(n, e) : r.set(n, e), e), U = (n, r, e) => (G(n, r, "access private method"), e);
|
|
6
|
+
import { ClassLinkedStatus as J } from "../class-linked-status/index.js";
|
|
7
|
+
import { i as Q } from "../browser-0zX67oeU.js";
|
|
8
|
+
import { d as D } from "../events-CsVF98U6.js";
|
|
9
|
+
import { k as X } from "../string-f0Dnk0L1.js";
|
|
10
|
+
import { loading as K } from "../loading/index.js";
|
|
11
|
+
import { RESIZE_ORDER as Y } from "../order/index.js";
|
|
12
|
+
import { windowResizer as Z } from "../window-resizer/index.js";
|
|
13
|
+
import { S as tt } from "../Store-Cm3LPXlx.js";
|
|
14
|
+
var T, E, C, L, u, f, k;
|
|
15
|
+
class et {
|
|
16
|
+
constructor(r) {
|
|
17
|
+
i(this, T);
|
|
18
|
+
i(this, E);
|
|
19
|
+
i(this, C);
|
|
20
|
+
i(this, L);
|
|
21
|
+
i(this, u);
|
|
22
|
+
i(this, f);
|
|
23
|
+
i(this, k);
|
|
24
|
+
s(this, T, r);
|
|
25
|
+
let e = r.split(".");
|
|
26
|
+
const o = /\b\d{1,2}x\b/g, d = e.find((g) => g.match(o) && parseInt(g));
|
|
27
|
+
s(this, C, d ? parseInt(d) : 1), d && (e = e.slice(0, -1)), s(this, E, e.length > 1 ? e.slice(0, -1).join(".") : e.join("."));
|
|
28
|
+
const c = /\d+max/g, x = /\d+min/g, B = /\d+mar/g, P = /\d+mir/g, _ = e.find((g) => g.match(c)), h = e.find((g) => g.match(x)), b = e.find((g) => g.match(B)), N = e.find((g) => g.match(P));
|
|
29
|
+
b ? (s(this, u, parseInt(b)), s(this, f, "max"), s(this, L, `(max-aspect-ratio: ${t(this, u)})`)) : N ? (s(this, u, parseInt(N)), s(this, f, "max"), s(this, L, `(min-aspect-ratio: ${t(this, u)})`)) : _ ? (s(this, u, parseInt(_)), s(this, f, "max"), s(this, L, `(max-width: ${t(this, u)}px)`)) : h ? (s(this, u, parseInt(h)), s(this, L, `(min-width: ${t(this, u)}px)`), s(this, f, "min")) : (s(this, u, 0), s(this, L, `(min-width: ${t(this, u)}px)`), s(this, f, "min")), s(this, E, t(this, E).replace(
|
|
30
|
+
`.${t(this, u)}${t(this, f)}`,
|
|
26
31
|
""
|
|
27
|
-
)),
|
|
28
|
-
`.${
|
|
32
|
+
)), s(this, k, e[e.length - 1] === t(this, E) ? "" : "." + e[e.length - 1]), s(this, k, t(this, k).replace(
|
|
33
|
+
`.${t(this, u)}${t(this, f)}`,
|
|
29
34
|
""
|
|
30
35
|
));
|
|
31
36
|
}
|
|
32
37
|
get url() {
|
|
33
|
-
return
|
|
38
|
+
return t(this, T);
|
|
34
39
|
}
|
|
35
40
|
get name() {
|
|
36
|
-
return
|
|
41
|
+
return t(this, E);
|
|
37
42
|
}
|
|
38
43
|
get density() {
|
|
39
|
-
return
|
|
44
|
+
return t(this, C);
|
|
40
45
|
}
|
|
41
46
|
get query() {
|
|
42
|
-
return
|
|
47
|
+
return t(this, L);
|
|
43
48
|
}
|
|
44
49
|
get extension() {
|
|
45
|
-
return
|
|
50
|
+
return t(this, k);
|
|
46
51
|
}
|
|
47
52
|
get queryType() {
|
|
48
|
-
return
|
|
53
|
+
return t(this, f);
|
|
49
54
|
}
|
|
50
55
|
get queryValue() {
|
|
51
|
-
return
|
|
56
|
+
return t(this, u);
|
|
52
57
|
}
|
|
53
58
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
59
|
+
T = new WeakMap(), E = new WeakMap(), C = new WeakMap(), L = new WeakMap(), u = new WeakMap(), f = new WeakMap(), k = new WeakMap();
|
|
60
|
+
let st = 0;
|
|
61
|
+
var m, a, y, w, p, O, A, l, I, M, q, V, R, F, H, z, j;
|
|
62
|
+
class ft extends HTMLElement {
|
|
63
|
+
constructor(e) {
|
|
64
|
+
super();
|
|
65
|
+
i(this, R);
|
|
66
|
+
i(this, m, null);
|
|
67
|
+
i(this, a, null);
|
|
68
|
+
i(this, y, !1);
|
|
69
|
+
i(this, w, !1);
|
|
70
|
+
i(this, p, !1);
|
|
71
|
+
i(this, O, "");
|
|
72
|
+
i(this, A, "");
|
|
73
|
+
i(this, l, new J(this, {
|
|
74
|
+
loading: !1,
|
|
75
|
+
loaded: !1,
|
|
76
|
+
error: !1,
|
|
77
|
+
clear: !1
|
|
78
|
+
}));
|
|
79
|
+
i(this, I, null);
|
|
80
|
+
i(this, M);
|
|
81
|
+
i(this, q, null);
|
|
82
|
+
i(this, V);
|
|
83
|
+
i(this, H, (e) => {
|
|
84
|
+
const o = e[0];
|
|
85
|
+
t(this, p) && (!t(this, w) || this.hasAttribute("reload-source")) && o.isIntersecting && this.triggerLazyLoad(), o.isIntersecting ? D(this, "sourceCapture", { custom: !0 }) : (this.hasAttribute("reload-source") && U(this, R, F).call(this, void 0), D(this, "sourceRelease", { custom: !0 }));
|
|
64
86
|
});
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
87
|
+
i(this, z, () => {
|
|
88
|
+
t(this, l).set("loaded", !0), t(this, l).set("error", !1), t(this, l).set("loading", !1), !t(this, p) && !t(this, y) && K.complete(t(this, A)), D(this, "sourceLoaded", { custom: !0 });
|
|
89
|
+
const e = getComputedStyle(this).getPropertyValue("--clear-duration");
|
|
90
|
+
e ? s(this, M, setTimeout(() => {
|
|
91
|
+
t(this, l).set("clear", !0);
|
|
92
|
+
}, parseFloat(e) * 1e3)) : t(this, l).set("clear", !0), s(this, y, !0);
|
|
93
|
+
});
|
|
94
|
+
i(this, j, (e) => {
|
|
95
|
+
t(this, l).set("loaded", !1), t(this, l).set("error", !0), t(this, l).set("loading", !1), !t(this, p) && !t(this, y) && K.error(t(this, A)), D(this, "sourceError", { custom: !0 }), s(this, y, !0);
|
|
96
|
+
});
|
|
97
|
+
s(this, V, e == null ? void 0 : e.sourceSetOptions), Q && window.IntersectionObserver && s(this, I, new IntersectionObserver(
|
|
98
|
+
t(this, H)
|
|
99
|
+
));
|
|
100
|
+
}
|
|
101
|
+
get consumerElement() {
|
|
102
|
+
return t(this, a);
|
|
103
|
+
}
|
|
104
|
+
get sourceManager() {
|
|
105
|
+
return t(this, m);
|
|
106
|
+
}
|
|
107
|
+
get status() {
|
|
108
|
+
return t(this, l);
|
|
109
|
+
}
|
|
110
|
+
get isLazy() {
|
|
111
|
+
return t(this, p);
|
|
112
|
+
}
|
|
113
|
+
get currentURL() {
|
|
114
|
+
return t(this, q);
|
|
115
|
+
}
|
|
116
|
+
get isFirstLoadHappened() {
|
|
117
|
+
return t(this, y);
|
|
118
|
+
}
|
|
119
|
+
triggerLazyLoad() {
|
|
120
|
+
!t(this, w) && t(this, m).current && t(this, m).current !== t(this, m).previous && (s(this, w, !0), U(this, R, F).call(this, t(this, m).current));
|
|
121
|
+
}
|
|
122
|
+
connectedCallback() {
|
|
123
|
+
s(this, O, `source-consumer-${++st}`);
|
|
124
|
+
const e = this.getAttribute("srcset") || "", o = this.hasAttribute("notify") ? this.closest(this.getAttribute("notify")) : null;
|
|
125
|
+
o && t(this, l).addElement(o), s(this, a, this.createConsumer()), t(this, a).style.cssText = `
|
|
126
|
+
display: block;
|
|
127
|
+
width: 100%;
|
|
128
|
+
height: 100%;
|
|
129
|
+
`, t(this, a).classList.add("source-consumer"), Array.from(this.attributes).forEach((d) => {
|
|
130
|
+
if (d.name !== "srcset") {
|
|
131
|
+
const c = d.nodeValue || "", x = X(d.name);
|
|
132
|
+
x in t(this, a) && (t(this, a)[x] = c || !0);
|
|
133
|
+
}
|
|
134
|
+
}), this.appendChild(t(this, a)), s(this, m, new rt({
|
|
135
|
+
srcset: e,
|
|
136
|
+
sourceSetOptions: t(this, V)
|
|
137
|
+
})), s(this, p, this.hasAttribute("lazy")), t(this, m).subscribe((d) => {
|
|
138
|
+
(!t(this, p) || t(this, p) && t(this, w)) && U(this, R, F).call(this, d.current);
|
|
139
|
+
}), t(this, m).connect(), t(this, I).observe(this);
|
|
140
|
+
}
|
|
141
|
+
disconnectedCallback() {
|
|
142
|
+
var e;
|
|
143
|
+
clearTimeout(t(this, M)), t(this, I).disconnect(), (e = t(this, m)) == null || e.close(), t(this, a) && (t(this, a).onloadeddata = null, t(this, a).onload = null, t(this, a).onerror = null, t(this, a).remove()), s(this, y, !1), s(this, w, !1), t(this, l).reset();
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
m = new WeakMap(), a = new WeakMap(), y = new WeakMap(), w = new WeakMap(), p = new WeakMap(), O = new WeakMap(), A = new WeakMap(), l = new WeakMap(), I = new WeakMap(), M = new WeakMap(), q = new WeakMap(), V = new WeakMap(), R = new WeakSet(), F = function(e) {
|
|
147
|
+
if (clearTimeout(t(this, M)), t(this, a).onloadeddata = null, t(this, a).onload = null, t(this, a).onerror = null, t(this, l).set("loaded", !1), t(this, l).set("error", !1), t(this, l).set("loading", !1), t(this, l).set("clear", !1), e) {
|
|
148
|
+
s(this, A, `${t(this, O)}-${e.url}`);
|
|
149
|
+
const o = this.hasAttribute("keep-source-parameters");
|
|
150
|
+
t(this, l).set("loading", !0), s(this, q, o ? e.url : e.name + e.extension), this.consumeSource(t(this, q)), !t(this, p) && !t(this, y) && K.add(t(this, A)), t(this, a).onloadeddata = () => {
|
|
151
|
+
t(this, z).call(this);
|
|
152
|
+
}, t(this, a).onload = () => {
|
|
153
|
+
t(this, z).call(this);
|
|
154
|
+
}, t(this, a).onerror = () => {
|
|
155
|
+
t(this, j).call(this, t(this, q));
|
|
156
|
+
};
|
|
157
|
+
} else
|
|
158
|
+
s(this, q, null), this.consumeSource(null);
|
|
159
|
+
}, H = new WeakMap(), z = new WeakMap(), j = new WeakMap();
|
|
160
|
+
var S;
|
|
161
|
+
class it {
|
|
162
|
+
constructor(r, e) {
|
|
163
|
+
i(this, S);
|
|
164
|
+
s(this, S, /* @__PURE__ */ new Map());
|
|
165
|
+
const o = (e == null ? void 0 : e.mediaBuckets) !== !1, d = typeof r == "string" ? o ? r.trim().split(",").map((h) => h.trim()).filter((h) => !!h) : [r] : r, c = [];
|
|
166
|
+
d.forEach((h) => {
|
|
167
|
+
const b = new et(h);
|
|
168
|
+
c.push([b.query, b]);
|
|
169
|
+
});
|
|
170
|
+
const x = c.filter((h) => h[1].queryType.includes("max")).sort((h, b) => b[1].queryValue - h[1].queryValue), B = c.filter((h) => h[1].queryType.includes("min") && h[1].queryValue !== 0).sort((h, b) => h[1].queryValue - b[1].queryValue), P = c.filter((h) => h[0] === "(min-width: 0px)");
|
|
171
|
+
(P ? [...P, ...x, ...B] : [...x, ...B]).forEach((h) => {
|
|
172
|
+
t(this, S).has(h[0]) || t(this, S).set(h[0], []), t(this, S).get(h[0]).push(h[1]);
|
|
68
173
|
});
|
|
69
174
|
}
|
|
70
175
|
get mediaBuckets() {
|
|
71
|
-
return
|
|
176
|
+
return t(this, S);
|
|
72
177
|
}
|
|
73
178
|
}
|
|
74
|
-
|
|
75
|
-
var
|
|
76
|
-
class
|
|
77
|
-
constructor(
|
|
179
|
+
S = new WeakMap();
|
|
180
|
+
var v, $;
|
|
181
|
+
class rt extends tt {
|
|
182
|
+
constructor(e) {
|
|
78
183
|
super(void 0);
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
let
|
|
82
|
-
|
|
83
|
-
matchMedia(
|
|
184
|
+
i(this, v);
|
|
185
|
+
i(this, $, () => {
|
|
186
|
+
let e;
|
|
187
|
+
t(this, v).mediaBuckets.forEach((c, x) => {
|
|
188
|
+
matchMedia(x).matches && (e = c);
|
|
84
189
|
});
|
|
85
|
-
let
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
}),
|
|
190
|
+
let o, d = 0;
|
|
191
|
+
e == null || e.forEach((c) => {
|
|
192
|
+
c.density > d && c.density <= Math.max(devicePixelRatio, 1) && (d = c.density, o = c);
|
|
193
|
+
}), e != null && e.length && !o && (o = e[0]), this.current = o;
|
|
89
194
|
});
|
|
90
|
-
|
|
195
|
+
s(this, v, new it(e.srcset, e.sourceSetOptions));
|
|
91
196
|
}
|
|
92
197
|
close() {
|
|
93
198
|
super.close(), this.disconnect();
|
|
94
199
|
}
|
|
95
200
|
connect() {
|
|
96
|
-
|
|
201
|
+
Z.subscribe(t(this, $), Y.SOURCE_MANAGER), t(this, $).call(this);
|
|
97
202
|
}
|
|
98
203
|
disconnect() {
|
|
99
|
-
|
|
204
|
+
Z.unsubscribe(t(this, $));
|
|
100
205
|
}
|
|
101
206
|
}
|
|
102
|
-
|
|
207
|
+
v = new WeakMap(), $ = new WeakMap();
|
|
103
208
|
export {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
209
|
+
et as Source,
|
|
210
|
+
ft as SourceElement,
|
|
211
|
+
rt as SourceManager,
|
|
212
|
+
it as SourceSet
|
|
107
213
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var g=r=>{throw TypeError(r)};var v=(r,s,e)=>s.has(r)||g("Cannot "+e);var c=(r,s,e)=>(v(r,s,"read from private field"),e?e.call(r):s.get(r)),n=(r,s,e)=>s.has(r)?g("Cannot add the same private member more than once"):s instanceof WeakSet?s.add(r):s.set(r,e),h=(r,s,e,t)=>(v(r,s,"write to private field"),t?t.call(r,e):s.set(r,e),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("../Store-C2J4Q87x.cjs"),m=require("../function-MthRj-GJ.cjs");var d;class D extends i.Store{constructor(e,t,u){super(null,u);n(this,d);h(this,d,e.subscribe(a=>{this.current=t(a.current)}))}close(){super.close(),c(this,d).call(this)}}d=new WeakMap;var b;class R extends i.Store{constructor(e,t,u){super(null,u);n(this,b);h(this,b,e.subscribe(a=>{this.current=a.current.map((p,x,y)=>t(p,x,y))}))}close(){super.close(),c(this,b).call(this)}}b=new WeakMap;var f,o,l;class C extends i.Store{constructor(e,t,u){super(e,u);n(this,f);n(this,o);n(this,l,0);h(this,o,new i.Store(!1)),h(this,f,t),u!=null&&u.manualControl||this.refetch()}get isPending(){return c(this,o)}refetch(){c(this,o).current=!0,h(this,l,c(this,l)+1);const e=c(this,l);c(this,f).call(this).then(t=>{e===c(this,l)&&(c(this,o).current=!1,this.current=t)})}}f=new WeakMap,o=new WeakMap,l=new WeakMap;var S;class P extends i.Store{constructor(e,t,u){super(null,u);n(this,S,[]);const a=m.debounce(()=>{this.current=t()},0);e.forEach(p=>{c(this,S).push(p.subscribe(()=>{a()}))})}close(){super.close(),c(this,S).forEach(e=>e())}}S=new WeakMap;exports.Store=i.Store;exports.activeStores=i.activeStores;exports.storeRegistry=i.storeRegistry;exports.Composed=P;exports.Derived=D;exports.DerivedArray=R;exports.Resource=C;
|
|
@@ -3,9 +3,9 @@ var x = (e) => {
|
|
|
3
3
|
};
|
|
4
4
|
var g = (e, r, s) => r.has(e) || x("Cannot " + s);
|
|
5
5
|
var c = (e, r, s) => (g(e, r, "read from private field"), s ? s.call(e) : r.get(e)), i = (e, r, s) => r.has(e) ? x("Cannot add the same private member more than once") : r instanceof WeakSet ? r.add(e) : r.set(e, s), h = (e, r, s, t) => (g(e, r, "write to private field"), t ? t.call(e, s) : r.set(e, s), s);
|
|
6
|
-
import { S as a } from "
|
|
7
|
-
import { a as k, s as q } from "
|
|
8
|
-
import { d as y } from "
|
|
6
|
+
import { S as a } from "../Store-Cm3LPXlx.js";
|
|
7
|
+
import { a as k, s as q } from "../Store-Cm3LPXlx.js";
|
|
8
|
+
import { d as y } from "../function-C10DGppn.js";
|
|
9
9
|
var d;
|
|
10
10
|
class I extends a {
|
|
11
11
|
constructor(s, t, u) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var L=r=>{throw TypeError(r)};var A=(r,i,s)=>i.has(r)||L("Cannot "+s);var e=(r,i,s)=>(A(r,i,"read from private field"),s?s.call(r):i.get(r)),h=(r,i,s)=>i.has(r)?L("Cannot add the same private member more than once"):i instanceof WeakSet?i.add(r):i.set(r,s),t=(r,i,s,n)=>(A(r,i,"write to private field"),n?n.call(r,s):i.set(r,s),s),S=(r,i,s)=>(A(r,i,"access private method"),s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const B=require("../browser-CpzFX2xg.cjs"),M=require("../dom-JBOkFLTh.cjs");var o,u,v,b,m,l,g,y,q;class V{constructor(i,s){h(this,o);h(this,u);h(this,v);h(this,b,0);h(this,m,0);h(this,l,0);h(this,g,!1);h(this,y,null);h(this,q,i=>{const s=i[0];t(this,g,s.isIntersecting)});if(t(this,o,i),t(this,u,s==null?void 0:s.maxFPS),t(this,v,(s==null?void 0:s.order)||0),s!=null&&s.culling&&B.isBrowser){const n=M.getElement(s.culling);n&&(t(this,y,new IntersectionObserver(e(this,q))),e(this,y).observe(n))}else t(this,g,!0)}get callback(){return e(this,o)}get order(){return e(this,v)}sync(i){t(this,b,i-e(this,l))}tick(i){if(t(this,l,Math.max(0,i-e(this,b))),e(this,m)||t(this,m,i),e(this,u))if(e(this,l)>=1e3/e(this,u))t(this,b,i-e(this,l)%e(this,u));else return;else t(this,b,i);e(this,g)&&e(this,o).call(this,{timeBetweenFrames:e(this,l),timestamp:i,subscribeTimestamp:e(this,m),timeElapsedSinceSubscription:i-e(this,m)})}destroy(){var i;(i=e(this,y))==null||i.disconnect()}}o=new WeakMap,u=new WeakMap,v=new WeakMap,b=new WeakMap,m=new WeakMap,l=new WeakMap,g=new WeakMap,y=new WeakMap,q=new WeakMap;var w,f,a,F,c,d,I,E,k,T;class x{constructor(){h(this,d);h(this,w,0);h(this,f,0);h(this,a);h(this,F,!1);h(this,c,[]);h(this,k,i=>{if(e(this,F)){t(this,F,!1),t(this,w,i-e(this,f));for(const s of e(this,c))s.sync(e(this,f))}t(this,a,requestAnimationFrame(e(this,k))),t(this,f,i-e(this,w));for(const s of e(this,c))s.tick(e(this,f))});h(this,T,()=>{document.hidden&&t(this,F,!0)});B.isBrowser&&document.addEventListener("visibilitychange",e(this,T))}subscribe(i,s){if(!e(this,c).find(n=>n.callback===i)){const n=new V(i,s);n.sync(performance.now()),e(this,c).push(n),t(this,c,e(this,c).sort((O,P)=>O.order-P.order))}return S(this,d,I).call(this),()=>this.unsubscribe(i)}unsubscribe(i){const s=e(this,c).filter(n=>n.callback===i);s.length&&(s.forEach(n=>n.destroy()),t(this,c,e(this,c).filter(n=>n.callback!==i)),e(this,c).length||S(this,d,E).call(this))}destroy(){B.isBrowser&&(S(this,d,E).call(this),document.removeEventListener("visibilitychange",e(this,T)))}}w=new WeakMap,f=new WeakMap,a=new WeakMap,F=new WeakMap,c=new WeakMap,d=new WeakSet,I=function(){e(this,c).length&&!e(this,a)&&t(this,a,requestAnimationFrame(e(this,k)))},E=function(){e(this,a)&&(cancelAnimationFrame(e(this,a)),t(this,a,void 0))},k=new WeakMap,T=new WeakMap;const j=new x;exports.Ticker=x;exports.ticker=j;
|
|
@@ -3,8 +3,8 @@ var q = (r) => {
|
|
|
3
3
|
};
|
|
4
4
|
var L = (r, i, s) => i.has(r) || q("Cannot " + s);
|
|
5
5
|
var e = (r, i, s) => (L(r, i, "read from private field"), s ? s.call(r) : i.get(r)), h = (r, i, s) => i.has(r) ? q("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(r) : i.set(r, s), t = (r, i, s, n) => (L(r, i, "write to private field"), n ? n.call(r, s) : i.set(r, s), s), A = (r, i, s) => (L(r, i, "access private method"), s);
|
|
6
|
-
import { i as S } from "
|
|
7
|
-
import { g as P } from "
|
|
6
|
+
import { i as S } from "../browser-0zX67oeU.js";
|
|
7
|
+
import { g as P } from "../dom-CVWzyXPH.js";
|
|
8
8
|
var o, u, v, m, b, l, g, F, E;
|
|
9
9
|
class V {
|
|
10
10
|
constructor(i, s) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function copyTextToClipboard(text: string): void;
|
package/lib/utils/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("../attributes-Bf2svn4j.cjs"),I=require("../browser-CpzFX2xg.cjs"),f=require("../canvas-CU5Xjahf.cjs"),h=require("../coordinates-D8Np3cPD.cjs"),u=require("../dom-JBOkFLTh.cjs"),s=require("../easings-GegIwET5.cjs"),v=require("../events-KVanG9sR.cjs"),y=require("../file-DSpfWdd9.cjs"),C=require("../function-MthRj-GJ.cjs"),w=require("../gestures-DHLrn6Q8.cjs"),T=require("../jss-GJLvaNfT.cjs"),d=require("../layout-Ctc2p3uz.cjs"),i=require("../math-GDWEqu7y.cjs"),p=require("../polyfills-BANSrI_m.cjs"),c=require("../object-CCiXnER2.cjs"),l=require("../string-DhgS_iFl.cjs"),O=require("../style-At6aDoqG.cjs"),m=require("../url-BiHPIsKq.cjs");function q(t,e,...o){return[...t.slice(0,e),...o,...t.slice(e)]}function Q(t,e){const o=t.length;e=e%o;const n=new Array(o);for(let a=0;a<o;a++){const r=(a+e)%o;n[r]=t[a]}return n}function B(t,e=2){if(!+t)return"0 Bytes";const o=1024,n=e<0?0:e,a=["Bytes","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],r=Math.floor(Math.log(t)/Math.log(o));return`${parseFloat((t/Math.pow(o,r)).toFixed(n))} ${a[r]}`}function D(t){if(navigator.clipboard)navigator.clipboard.writeText(t).then(()=>{console.log("Text copied to clipboard successfully!")}).catch(e=>{console.error("Failed to copy text to clipboard:",e)});else{const e=document.createElement("textarea");e.value=t,e.style.position="fixed",e.style.top="0",e.style.left="0",document.body.appendChild(e),e.select();try{document.execCommand("copy")?console.log("Text copied to clipboard successfully!"):console.error("Failed to copy text to clipboard.")}catch(o){console.error("Failed to copy text to clipboard:",o)}document.body.removeChild(e)}}function A(t,e){return t.x<e.x+e.width&&t.x>e.x&&t.y<e.y+e.height&&t.y>e.y}function R(t,e){return Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2)<e.radius}function S(t,e){const o=t.style.getPropertyValue(e);if(o){const n=o.toString();return n.startsWith("var")?S(t,n.slice(4,-1)):n}}function N(...t){const e={};return Array.from(document.styleSheets).forEach(o=>{Array.from(o.cssRules).forEach(n=>{n instanceof CSSStyleRule&&n.selectorText===":root"&&t.forEach(a=>{const r=S(n,a);r&&(e[a]=r)})})}),t.forEach(o=>{e[o]||console.warn(`variable named ${o} not found`)}),e}function z(t){const e=window.atob(t);return decodeURIComponent(window.escape(e))}function M(t){const e=window.unescape(encodeURIComponent(t));return window.btoa(e)}function V(t){return new Promise(e=>{setTimeout(()=>{e()},t)})}function j(t,{behaviour:e="instant",offset:o=0,center:n=!1}={}){var r;const a=u.getElement(t);if(a){const g=u.findScrollParentElement(a),E=d.getCumulativeOffsetTop(a),x=(typeof o=="number"?o:((r=u.getElement(o))==null?void 0:r.offsetHeight)||0)*-1,P=n?innerHeight/2*-1+a.offsetHeight/2:0;g==null||g.scroll({top:E+x+P,behavior:e})}}function U(t,e){if(t){const n=t.content.cloneNode(!0).firstElementChild;return n&&(e==null||e(n)),n}return null}exports.parseAttribute=b.parseAttribute;exports.parseAttributeValue=b.parseAttributeValue;exports.isBrowser=I.isBrowser;exports.contain=f.contain;exports.cover=f.cover;exports.fixPosition=f.fixPosition;exports.measureText=f.measureText;exports.getPointerPosition=h.getPointerPosition;exports.normalize=h.normalize;exports.screenToCartesian=h.screenToCartesian;exports.findParentElement=u.findParentElement;exports.findScrollParentElement=u.findScrollParentElement;exports.getAllParentElements=u.getAllParentElements;exports.getElement=u.getElement;exports.easeInCubic=s.easeInCubic;exports.easeInExpo=s.easeInExpo;exports.easeInOutCubic=s.easeInOutCubic;exports.easeInOutExpo=s.easeInOutExpo;exports.easeInOutQuad=s.easeInOutQuad;exports.easeInOutQuart=s.easeInOutQuart;exports.easeInOutQuint=s.easeInOutQuint;exports.easeInQuad=s.easeInQuad;exports.easeInQuart=s.easeInQuart;exports.easeInQuint=s.easeInQuint;exports.easeOutCubic=s.easeOutCubic;exports.easeOutExpo=s.easeOutExpo;exports.easeOutQuad=s.easeOutQuad;exports.easeOutQuart=s.easeOutQuart;exports.easeOutQuint=s.easeOutQuint;exports.linear=s.linear;exports.dispatchEvent=v.dispatchEvent;exports.createJSONAndSave=y.createJSONAndSave;exports.downloadURI=y.downloadURI;exports.debounce=C.debounce;exports.throttle=C.throttle;exports.setupDrag=w.setupDrag;exports.createStylesheet=T.createStylesheet;exports.styleToString=T.styleToString;exports.getCumulativeOffsetLeft=d.getCumulativeOffsetLeft;exports.getCumulativeOffsetTop=d.getCumulativeOffsetTop;exports.getCumulativePosition=d.getCumulativePosition;exports.getStickyOffset=d.getStickyOffset;exports.calculateDistance=i.calculateDistance;exports.calculateDistanceWithRadius=i.calculateDistanceWithRadius;exports.clamp=i.clamp;exports.damp=i.damp;exports.lerp=i.lerp;exports.mapRange=i.mapRange;exports.round=i.round;exports.smootherstep=i.smootherstep;exports.smoothstep=i.smoothstep;exports.step=i.step;exports.loopNumber=p.loopNumber;exports.nullishCoalescing=p.nullishCoalescing;exports.preciseNumber=p.preciseNumber;exports.roundNumberTo=p.roundNumberTo;exports.toStep=p.toStep;exports.cloneDeep=c.cloneDeep;exports.compareObjects=c.compareObjects;exports.isESClass=c.isESClass;exports.isNullish=c.isNullish;exports.isObject=c.isObject;exports.mergeDeep=c.mergeDeep;exports.mixin=c.mixin;exports.omit=c.omit;exports.pick=c.pick;exports.camelToKebab=l.camelToKebab;exports.capitalize=l.capitalize;exports.generateId=l.generateId;exports.isUppercase=l.isUppercase;exports.kebabToCamel=l.kebabToCamel;exports.snakeToDotted=l.snakeToDotted;exports.toPascalCase=l.toPascalCase;exports.uncapitalize=l.uncapitalize;exports.getElementTransitionDurationMS=O.getElementTransitionDurationMS;exports.getElementTransitionDurationS=O.getElementTransitionDurationS;exports.changeHistory=m.changeHistory;exports.normalizeBase=m.normalizeBase;exports.parseSearchParameters=m.parseSearchParameters;exports.splitPath=m.splitPath;exports.updateSearchParameter=m.updateSearchParameter;exports.cloneTemplateContent=U;exports.copyTextToClipboard=D;exports.decode=M;exports.dotCircleCollision=R;exports.dotRectCollision=A;exports.encode=z;exports.formatBytes=B;exports.getRootVariables=N;exports.insert=q;exports.scrollToElement=j;exports.shiftArray=Q;exports.wait=V;
|
package/lib/utils/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export * from './attributes';
|
|
|
3
3
|
export * from './browser';
|
|
4
4
|
export * from './bytes';
|
|
5
5
|
export * from './canvas';
|
|
6
|
+
export * from './clipboard';
|
|
6
7
|
export * from './collisions';
|
|
7
8
|
export * from './coordinates';
|
|
8
9
|
export * from './cssom';
|
|
@@ -20,9 +21,10 @@ export * from './number';
|
|
|
20
21
|
export * from './object';
|
|
21
22
|
export * from './polyfills';
|
|
22
23
|
export * from './promises';
|
|
24
|
+
export * from './scroll';
|
|
23
25
|
export * from './string';
|
|
24
26
|
export * from './style';
|
|
25
|
-
export * from './
|
|
27
|
+
export * from './template';
|
|
26
28
|
export * from './ts-shape';
|
|
27
29
|
export * from './ts-utility';
|
|
28
30
|
export * from './url';
|