aptechka 0.1.20 → 0.2.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/ComponentElement-BUesLP4b.cjs +1 -0
- package/lib/ComponentElement-NMlh1Ptn.js +92 -0
- package/lib/ElementConstructor-B61ZFTEB.cjs +1 -0
- package/lib/ElementConstructor-CvNdPKJy.js +314 -0
- package/lib/abstract-elements/index.cjs +1 -1
- package/lib/abstract-elements/index.js +1 -1
- package/lib/animation/hooks/index.cjs +1 -0
- package/lib/animation/hooks/index.d.ts +8 -0
- package/lib/animation/hooks/index.js +38 -0
- package/lib/attribute/hooks/index.d.ts +2 -0
- package/lib/attribute/index.cjs +1 -1
- package/lib/attribute/index.d.ts +0 -2
- package/lib/attribute/index.js +35 -50
- package/lib/canvas/index.cjs +1 -1
- package/lib/canvas/index.js +2 -2
- package/lib/controls/hooks/index.d.ts +1 -0
- package/lib/{createStylesheet-DTOK6fTn.cjs → createStylesheet-C0OnN0Br.cjs} +1 -1
- package/lib/{createStylesheet-Zqf3lXhM.js → createStylesheet-CD11E4C8.js} +1 -1
- package/lib/element-constructor/index.cjs +1 -1
- package/lib/element-constructor/index.js +114 -113
- package/lib/element-resizer/hooks/index.cjs +1 -0
- package/lib/element-resizer/hooks/index.d.ts +4 -0
- package/lib/element-resizer/hooks/index.js +12 -0
- package/lib/en3/index.cjs +7 -7
- package/lib/en3/index.d.ts +1 -0
- package/lib/en3/index.js +639 -620
- package/lib/en3/utils/getCurrentViewport.d.ts +7 -0
- package/lib/{index-B-ZmkQyB.cjs → index--wI4MTuv.cjs} +1 -1
- package/lib/{index-Dizn7btU.js → index-Dq6GRJ9W.js} +2 -2
- package/lib/instantiate-BAz2WZtO.cjs +1 -0
- package/lib/instantiate-BDteLwW6.js +55 -0
- package/lib/intersector/hooks/index.cjs +1 -0
- package/lib/intersector/hooks/index.d.ts +4 -0
- package/lib/intersector/hooks/index.js +12 -0
- package/lib/jsx/ComponentElement.d.ts +27 -0
- package/lib/jsx/h.d.ts +3 -0
- package/lib/jsx/hooks/index.cjs +1 -0
- package/lib/jsx/hooks/index.d.ts +7 -0
- package/lib/jsx/hooks/index.js +76 -0
- package/lib/jsx/hooks/useConnect.d.ts +2 -0
- package/lib/jsx/hooks/useContext.d.ts +3 -0
- package/lib/jsx/hooks/useCreate.d.ts +2 -0
- package/lib/jsx/hooks/useDisconnect.d.ts +2 -0
- package/lib/jsx/hooks/useInternals.d.ts +1 -0
- package/lib/jsx/hooks/useShadow.d.ts +1 -0
- package/lib/jsx/hooks/useStylesheet.d.ts +2 -0
- package/lib/jsx/index.cjs +1 -0
- package/lib/jsx/index.d.ts +5 -0
- package/lib/jsx/index.js +15 -0
- package/lib/jsx/instantiate.d.ts +1 -0
- package/lib/jsx/register.d.ts +1 -0
- package/lib/jsx/render.d.ts +1 -0
- package/lib/jsx/type.d.ts +184 -0
- package/lib/layout-box/index.cjs +1 -1
- package/lib/layout-box/index.js +82 -81
- package/lib/modal/index.cjs +1 -1
- package/lib/modal/index.js +2 -2
- package/lib/router/Route.d.ts +1 -1
- package/lib/router/index.cjs +1 -1
- package/lib/router/index.js +84 -82
- package/lib/scroll/index.cjs +1 -1
- package/lib/scroll/index.js +2 -2
- package/lib/select/index.cjs +1 -1
- package/lib/select/index.js +1 -1
- package/lib/slicer/DecoderElement.d.ts +10 -0
- package/lib/slicer/Letter.d.ts +11 -0
- package/lib/slicer/SlicerElement.d.ts +21 -0
- package/lib/slicer/Word.d.ts +16 -0
- package/lib/slicer/index.cjs +11 -0
- package/lib/slicer/index.d.ts +4 -0
- package/lib/slicer/index.js +165 -0
- package/lib/store/hooks/index.cjs +1 -0
- package/lib/store/hooks/index.d.ts +6 -0
- package/lib/store/hooks/index.js +31 -0
- package/lib/studio/index.cjs +1 -1
- package/lib/studio/index.js +17 -16
- package/lib/tags-C2jg1zYB.js +485 -0
- package/lib/tags-DX-eNxbA.cjs +1 -0
- package/lib/theme/index.cjs +1 -1
- package/lib/theme/index.d.ts +1 -1
- package/lib/theme/index.js +2 -2
- package/lib/ticker/hooks/index.cjs +1 -0
- package/lib/ticker/hooks/index.d.ts +5 -0
- package/lib/ticker/hooks/index.js +23 -0
- package/lib/ticker/index.d.ts +1 -1
- package/lib/useConnect-CXdqKdRX.js +9 -0
- package/lib/useConnect-DcfeqwzW.cjs +1 -0
- package/lib/useCreate-ClGKVMeG.cjs +1 -0
- package/lib/useCreate-DQSfJu7r.js +7 -0
- package/lib/useDisconnect-D5cBD1bq.js +9 -0
- package/lib/useDisconnect-sA74z4IZ.cjs +1 -0
- package/lib/utils/dom.d.ts +1 -1
- package/lib/utils/ts-utility.d.ts +5 -0
- package/lib/window-resizer/hooks/index.cjs +1 -0
- package/lib/window-resizer/hooks/index.d.ts +2 -0
- package/lib/window-resizer/hooks/index.js +9 -0
- package/package.json +75 -7
- package/lib/component/Component.d.ts +0 -26
- package/lib/component/hooks/animation.d.ts +0 -9
- package/lib/component/hooks/attributes.d.ts +0 -2
- package/lib/component/hooks/custom-element.d.ts +0 -2
- package/lib/component/hooks/intersection.d.ts +0 -4
- package/lib/component/hooks/resize.d.ts +0 -6
- package/lib/component/hooks/stores.d.ts +0 -6
- package/lib/component/hooks/style.d.ts +0 -2
- package/lib/component/index.cjs +0 -1
- package/lib/component/index.d.ts +0 -8
- package/lib/component/index.js +0 -224
- package/lib/tags-75InVOh4.cjs +0 -1
- package/lib/tags-DgRVzazL.js +0 -795
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var k=Object.defineProperty,g=Object.defineProperties;var w=Object.getOwnPropertyDescriptors;var p=Object.getOwnPropertySymbols;var v=Object.prototype.hasOwnProperty,S=Object.prototype.propertyIsEnumerable;var b=(e,n,t)=>n in e?k(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t,C=(e,n)=>{for(var t in n||(n={}))v.call(n,t)&&b(e,t,n[t]);if(p)for(var t of p(n))S.call(n,t)&&b(e,t,n[t]);return e},m=(e,n)=>g(e,w(n));var x=(e,n,t)=>{if(!n.has(e))throw TypeError("Cannot "+t)};var c=(e,n,t)=>(x(e,n,"read from private field"),t?t.call(e):n.get(e)),r=(e,n,t)=>{if(n.has(e))throw TypeError("Cannot add the same private member more than once");n instanceof WeakSet?n.add(e):n.set(e,t)};var h=(e,n,t)=>(x(e,n,"access private method"),t);const A=require("./ElementConstructor-B61ZFTEB.cjs");exports.currentComponentElement=null;const f={value:null};var i,l,a,u,E;class M extends HTMLElement{constructor(t){super();r(this,u);r(this,i,new Set);r(this,l,new Set);r(this,a,new Map);exports.currentComponentElement=this;const o=t.tag(m(C({},t.attributes),{children:t.children}));new A.ElementConstructor(this,C({children:o},f.value)),exports.currentComponentElement=null,f.value=null}addConnectCallback(t){c(this,i).add(t)}addDisconnectCallback(t){c(this,l).add(t)}createContext(t,o){c(this,a).set(t,o)}getContext(t){return c(this,a).get(t)}findContext(t){return h(this,u,E).call(this,t)}connectedCallback(){c(this,i).forEach(t=>{const o=t(this);o&&c(this,l).add(o)})}disconnectedCallback(){c(this,l).forEach(t=>{t(this)})}}i=new WeakMap,l=new WeakMap,a=new WeakMap,u=new WeakSet,E=function(t,o=this){if(!o)return null;if(o&&"findContext"in o){const s=o.getContext(t);if(s)return s}let d=null;if(o.parentElement)d=o.parentElement;else{const s=o.getRootNode();s instanceof ShadowRoot&&(d=s.host)}return d?h(this,u,E).call(this,t,d):null};exports.ComponentElement=M;exports.nextComponentAttributes=f;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
var w = Object.defineProperty, m = Object.defineProperties;
|
|
2
|
+
var v = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var x = Object.getOwnPropertySymbols;
|
|
4
|
+
var S = Object.prototype.hasOwnProperty, M = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var E = (e, n, t) => n in e ? w(e, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[n] = t, h = (e, n) => {
|
|
6
|
+
for (var t in n || (n = {}))
|
|
7
|
+
S.call(n, t) && E(e, t, n[t]);
|
|
8
|
+
if (x)
|
|
9
|
+
for (var t of x(n))
|
|
10
|
+
M.call(n, t) && E(e, t, n[t]);
|
|
11
|
+
return e;
|
|
12
|
+
}, b = (e, n) => m(e, v(n));
|
|
13
|
+
var p = (e, n, t) => {
|
|
14
|
+
if (!n.has(e))
|
|
15
|
+
throw TypeError("Cannot " + t);
|
|
16
|
+
};
|
|
17
|
+
var s = (e, n, t) => (p(e, n, "read from private field"), t ? t.call(e) : n.get(e)), i = (e, n, t) => {
|
|
18
|
+
if (n.has(e))
|
|
19
|
+
throw TypeError("Cannot add the same private member more than once");
|
|
20
|
+
n instanceof WeakSet ? n.add(e) : n.set(e, t);
|
|
21
|
+
};
|
|
22
|
+
var C = (e, n, t) => (p(e, n, "access private method"), t);
|
|
23
|
+
import { E as R } from "./ElementConstructor-CvNdPKJy.js";
|
|
24
|
+
let k = null;
|
|
25
|
+
const g = {
|
|
26
|
+
value: null
|
|
27
|
+
};
|
|
28
|
+
var a, c, r, d, f;
|
|
29
|
+
class H extends HTMLElement {
|
|
30
|
+
constructor(t) {
|
|
31
|
+
super();
|
|
32
|
+
i(this, d);
|
|
33
|
+
i(this, a, /* @__PURE__ */ new Set());
|
|
34
|
+
i(this, c, /* @__PURE__ */ new Set());
|
|
35
|
+
i(this, r, /* @__PURE__ */ new Map());
|
|
36
|
+
k = this;
|
|
37
|
+
const o = t.tag(b(h({}, t.attributes), {
|
|
38
|
+
children: t.children
|
|
39
|
+
}));
|
|
40
|
+
new R(this, h({
|
|
41
|
+
children: o
|
|
42
|
+
}, g.value)), k = null, g.value = null;
|
|
43
|
+
}
|
|
44
|
+
addConnectCallback(t) {
|
|
45
|
+
s(this, a).add(t);
|
|
46
|
+
}
|
|
47
|
+
addDisconnectCallback(t) {
|
|
48
|
+
s(this, c).add(t);
|
|
49
|
+
}
|
|
50
|
+
createContext(t, o) {
|
|
51
|
+
s(this, r).set(t, o);
|
|
52
|
+
}
|
|
53
|
+
getContext(t) {
|
|
54
|
+
return s(this, r).get(t);
|
|
55
|
+
}
|
|
56
|
+
findContext(t) {
|
|
57
|
+
return C(this, d, f).call(this, t);
|
|
58
|
+
}
|
|
59
|
+
connectedCallback() {
|
|
60
|
+
s(this, a).forEach((t) => {
|
|
61
|
+
const o = t(this);
|
|
62
|
+
o && s(this, c).add(o);
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
disconnectedCallback() {
|
|
66
|
+
s(this, c).forEach((t) => {
|
|
67
|
+
t(this);
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
a = new WeakMap(), c = new WeakMap(), r = new WeakMap(), d = new WeakSet(), f = function(t, o = this) {
|
|
72
|
+
if (!o)
|
|
73
|
+
return null;
|
|
74
|
+
if (o && "findContext" in o) {
|
|
75
|
+
const l = o.getContext(t);
|
|
76
|
+
if (l)
|
|
77
|
+
return l;
|
|
78
|
+
}
|
|
79
|
+
let u = null;
|
|
80
|
+
if (o.parentElement)
|
|
81
|
+
u = o.parentElement;
|
|
82
|
+
else {
|
|
83
|
+
const l = o.getRootNode();
|
|
84
|
+
l instanceof ShadowRoot && (u = l.host);
|
|
85
|
+
}
|
|
86
|
+
return u ? C(this, d, f).call(this, t, u) : null;
|
|
87
|
+
};
|
|
88
|
+
export {
|
|
89
|
+
H as C,
|
|
90
|
+
k as c,
|
|
91
|
+
g as n
|
|
92
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var $=(l,e,s)=>{if(!e.has(l))throw TypeError("Cannot "+s)};var n=(l,e,s)=>($(l,e,"read from private field"),s?s.call(l):e.get(l)),f=(l,e,s)=>{if(e.has(l))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(l):e.set(l,s)},Q=(l,e,s,t)=>($(l,e,"write to private field"),t?t.call(l,s):e.set(l,s),s);var a=(l,e,s)=>($(l,e,"access private method"),s);const m=require("./Store-D0_rDIsE.cjs"),fe=require("./browser-CpzFX2xg.cjs"),X=require("./object-BZELAoVj.cjs"),R=require("./string-vBu90jhV.cjs"),re=require("./connector/index.cjs"),ce=new Set(["animate","animateMotion","animateTransform","circle","clipPath","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","foreignObject","g","image","line","linearGradient","listener","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","solidColor","stop","svg","switch","symbol","text","textPath","title","tspan","view"]);var r,h,d,N,Z,w,_,A,O,S,z,M,j,x,ee,v,te,D,se,y,J,E,V,k,ie,q,ne,b,K,g,T,p,Y,H,oe,F,ae,C,I,L,U,P,B;const G=class G{constructor(...e){f(this,N);f(this,w);f(this,A);f(this,S);f(this,M);f(this,x);f(this,v);f(this,D);f(this,y);f(this,E);f(this,k);f(this,q);f(this,b);f(this,g);f(this,p);f(this,H);f(this,F);f(this,C);f(this,L);f(this,r,void 0);f(this,h,new Set);f(this,d,new Set);f(this,P,()=>{n(this,h).forEach(e=>{e()}),n(this,h).clear()});f(this,B,e=>{n(this,d).forEach(s=>{s(e)}),n(this,d).clear()});const s=e[0],t=e[1];Q(this,r,a(this,N,Z).call(this,s,t==null?void 0:t.forceSvg)),a(this,A,O).call(this,t)}get node(){return n(this,r)}};r=new WeakMap,h=new WeakMap,d=new WeakMap,N=new WeakSet,Z=function(e,s){let t=null;if(e instanceof Node)t=e;else if(typeof e=="string")if(!e.includes("<")&&e.includes("-"))t=new(customElements.get(e));else if(e.includes("<")){const i=document.createElement("div");i.innerHTML=e,t=i.firstElementChild}else ce.has(e)||s?t=document.createElementNS("http://www.w3.org/2000/svg",e):t=document.createElement(e);else t=document.createElement("div");return t},w=new WeakSet,_=function(e){return e instanceof HTMLElement||e instanceof SVGElement},A=new WeakSet,O=function(e){if(!e)return;const s=a(this,w,_).call(this,n(this,r)),t=e.ref;delete e.ref,e!=null&&e.onConnect&&(n(this,h).add(e.onConnect),delete e.onConnect),e!=null&&e.onDisconnect&&(n(this,d).add(e.onDisconnect),delete e.onDisconnect);let i,o;for(const c in e){const u=e[c];c==="class"&&s?a(this,S,z).call(this,u):c==="style"&&s?a(this,v,te).call(this,u):c==="lightChildren"?a(this,g,T).call(this,n(this,r),u):c==="children"?a(this,g,T).call(this,n(this,r)instanceof Element?n(this,r).shadowRoot||n(this,r):n(this,r),u):c.startsWith("on")?(o||(o={}),o[c]=u):(i||(i={}),i[c]=u)}if(a(this,q,ne).call(this,i),a(this,k,ie).call(this,o),t&&(typeof t=="function"?t(n(this,r)):t.current=n(this,r)),fe.isBrowser&&(n(this,d).size||n(this,h).size)){const c=n(this,r)instanceof DocumentFragment?n(this,r).firstChild:n(this,r);re.connector.subscribe(c,{connectCallback:n(this,P),disconnectCallback:n(this,B),unsubscribeAfterDisconnect:!0,maxWaitSec:20})}},S=new WeakSet,z=function(e){const s=n(this,r);if(e){if(typeof e=="string")s.classList.add(e);else if(Array.isArray(e))e.forEach(t=>{a(this,S,z).call(this,t)});else if(typeof e=="object")if(e instanceof m.Store)a(this,M,j).call(this,e);else for(const t in e){const i=e[t];i instanceof m.Store?a(this,x,ee).call(this,t,i):i?s.classList.add(t):s.classList.remove(t)}}else return},M=new WeakSet,j=function(e){const s=n(this,r);n(this,d).add(e.subscribe(({current:t,previous:i})=>{i&&[i].flat().forEach(o=>{o&&s.classList.remove(o)}),t&&[t].flat().forEach(o=>{o&&s.classList.add(o)})}))},x=new WeakSet,ee=function(e,s){const t=n(this,r);n(this,d).add(s.subscribe(({current:i})=>{i?t.classList.add(e):t.classList.remove(e)}))},v=new WeakSet,te=function(e){if(!e)return;const s=n(this,r);s.tagName==="style"||s.tagName==="STYLE"?a(this,y,J).call(this,e):a(this,D,se).call(this,e)},D=new WeakSet,se=function(e){for(const s in e){const t=s,i=e[t];i instanceof m.Store?n(this,d).add(i.subscribe(({current:o})=>{a(this,E,V).call(this,t,o)})):a(this,E,V).call(this,t,i)}},y=new WeakSet,J=function(e){const s=n(this,r);for(const t in e){const i=e[t];if(typeof i=="object"&&!(i instanceof m.Store))s.appendChild(new Text(`${t} {`)),a(this,y,J).call(this,i),s.appendChild(new Text("}"));else if(i instanceof m.Store){const o=new Text;n(this,d).add(i.subscribe(c=>{c.current?o.nodeValue=`${R.camelToKebab(t)}: ${c.current};`:o.nodeValue=""})),s.appendChild(o)}else s.appendChild(new Text(`${R.camelToKebab(t)}: ${i};`))}},E=new WeakSet,V=function(e,s){const t=n(this,r);e.includes("--")?s?t.style.setProperty(e,s):t.style.removeProperty(e):s?t.style[e]=s:t.style[e]=""},k=new WeakSet,ie=function(e){if(!e)return;const s=n(this,r);for(const t in e){const i=t,o=R.uncapitalize(i.split("on").slice(1).join("on")),c=e[i];typeof c=="object"?s.addEventListener(o,c.callback,c.options):typeof c=="function"&&s.addEventListener(o,c)}},q=new WeakSet,ne=function(e){for(const s in e){const t=e[s];t instanceof m.Store?n(this,d).add(t.subscribe(({current:i})=>{a(this,b,K).call(this,s,i)})):a(this,b,K).call(this,s,t)}},b=new WeakSet,K=function(e,s){var i,o;const t=n(this,r);e in t&&!((o=(i=t.constructor)==null?void 0:i.observedAttributes)!=null&&o.includes(e))?s!=null&&(t[e]=s.toString()):s!=null&&t.setAttribute(e,s.toString())},g=new WeakSet,T=function(e,s){s&&(s=[s].flat(),s.forEach(t=>{if(t instanceof m.Store){const i=document.createElement("div");i.style.display="contents",e.appendChild(i),n(this,d).add(t.subscribe(({current:o})=>{a(this,F,ae).call(this,i,a(this,H,oe).call(this,o),Array.from(i.childNodes))}))}else if(t instanceof G)a(this,p,Y).call(this,e,t.node);else if(t instanceof Function)a(this,g,T).call(this,e,X.isESClass(t)?new t:t());else{const i=a(this,L,U).call(this,t);i instanceof Node&&a(this,p,Y).call(this,e,i)}}))},p=new WeakSet,Y=function(e,s){!(e instanceof ShadowRoot)&&s instanceof HTMLElement&&s.tagName==="STYLE"?(n(this,h).add(()=>{[...document.head.querySelectorAll("style")].find(i=>i.outerHTML===s.outerHTML)||document.head.appendChild(s)}),n(this,d).add(()=>{s.remove()})):e.appendChild(s)},H=new WeakSet,oe=function(e){return[e].flat().map(t=>t instanceof G?t.node:typeof t=="function"?X.isESClass(t)?new t:t():a(this,L,U).call(this,t)).flat().filter(Boolean)},F=new WeakSet,ae=function(e,s,t){t.length>s.length&&t.forEach(i=>{s.find(o=>a(this,C,I).call(this,i,o))||(e.removeChild(i),t=t.filter(o=>o!==i))}),t.forEach((i,o)=>{if(o<s.length){const c=s[o];a(this,C,I).call(this,i,c)||e.replaceChild(c,i)}else e.removeChild(i)});for(let i=t.length;i<s.length;i++)e.appendChild(s[i])},C=new WeakSet,I=function(e,s){return s?s instanceof Node?e.isEqualNode(s):e.textContent===s.toString():!1},L=new WeakSet,U=function(e){if(e instanceof Node)return e;if(e!=null){const s=String(e);if(s.trim().startsWith("<")&&s.trim().endsWith(">")){const t=document.createElement("div");return t.innerHTML=s,t.firstElementChild}else return new Text(s)}else return},P=new WeakMap,B=new WeakMap;let W=G;exports.ElementConstructor=W;
|
|
@@ -0,0 +1,314 @@
|
|
|
1
|
+
var R = (c, e, s) => {
|
|
2
|
+
if (!e.has(c))
|
|
3
|
+
throw TypeError("Cannot " + s);
|
|
4
|
+
};
|
|
5
|
+
var n = (c, e, s) => (R(c, e, "read from private field"), s ? s.call(c) : e.get(c)), f = (c, e, s) => {
|
|
6
|
+
if (e.has(c))
|
|
7
|
+
throw TypeError("Cannot add the same private member more than once");
|
|
8
|
+
e instanceof WeakSet ? e.add(c) : e.set(c, s);
|
|
9
|
+
}, K = (c, e, s, t) => (R(c, e, "write to private field"), t ? t.call(c, s) : e.set(c, s), s);
|
|
10
|
+
var a = (c, e, s) => (R(c, e, "access private method"), s);
|
|
11
|
+
import { S as m } from "./Store-JOKrNVEr.js";
|
|
12
|
+
import { i as fe } from "./browser-0zX67oeU.js";
|
|
13
|
+
import { i as U } from "./object-R34VLqhp.js";
|
|
14
|
+
import { c as Q, u as le } from "./string-3lAkpJJP.js";
|
|
15
|
+
import { connector as re } from "./connector/index.js";
|
|
16
|
+
const ce = /* @__PURE__ */ new Set([
|
|
17
|
+
// 'a', 'style', 'title', 'script',
|
|
18
|
+
"animate",
|
|
19
|
+
"animateMotion",
|
|
20
|
+
"animateTransform",
|
|
21
|
+
"circle",
|
|
22
|
+
"clipPath",
|
|
23
|
+
"defs",
|
|
24
|
+
"desc",
|
|
25
|
+
"ellipse",
|
|
26
|
+
"feBlend",
|
|
27
|
+
"feColorMatrix",
|
|
28
|
+
"feComponentTransfer",
|
|
29
|
+
"feComposite",
|
|
30
|
+
"feConvolveMatrix",
|
|
31
|
+
"feDiffuseLighting",
|
|
32
|
+
"feDisplacementMap",
|
|
33
|
+
"feDistantLight",
|
|
34
|
+
"feDropShadow",
|
|
35
|
+
"feFlood",
|
|
36
|
+
"feFuncA",
|
|
37
|
+
"feFuncB",
|
|
38
|
+
"feFuncG",
|
|
39
|
+
"feFuncR",
|
|
40
|
+
"feGaussianBlur",
|
|
41
|
+
"feImage",
|
|
42
|
+
"feMerge",
|
|
43
|
+
"feMergeNode",
|
|
44
|
+
"feMorphology",
|
|
45
|
+
"feOffset",
|
|
46
|
+
"fePointLight",
|
|
47
|
+
"feSpecularLighting",
|
|
48
|
+
"feSpotLight",
|
|
49
|
+
"feTile",
|
|
50
|
+
"feTurbulence",
|
|
51
|
+
"filter",
|
|
52
|
+
"foreignObject",
|
|
53
|
+
"g",
|
|
54
|
+
"image",
|
|
55
|
+
"line",
|
|
56
|
+
"linearGradient",
|
|
57
|
+
"listener",
|
|
58
|
+
"marker",
|
|
59
|
+
"mask",
|
|
60
|
+
"metadata",
|
|
61
|
+
"mpath",
|
|
62
|
+
"path",
|
|
63
|
+
"pattern",
|
|
64
|
+
"polygon",
|
|
65
|
+
"polyline",
|
|
66
|
+
"radialGradient",
|
|
67
|
+
"rect",
|
|
68
|
+
"set",
|
|
69
|
+
"solidColor",
|
|
70
|
+
"stop",
|
|
71
|
+
"svg",
|
|
72
|
+
"switch",
|
|
73
|
+
"symbol",
|
|
74
|
+
"text",
|
|
75
|
+
"textPath",
|
|
76
|
+
"title",
|
|
77
|
+
"tspan",
|
|
78
|
+
"view"
|
|
79
|
+
]);
|
|
80
|
+
var l, d, h, N, Z, w, _, A, O, y, W, M, j, x, ee, v, te, D, se, S, q, p, z, k, ie, H, ne, E, J, g, T, b, V, F, oe, P, ae, L, Y, C, I, B, G;
|
|
81
|
+
const $ = class $ {
|
|
82
|
+
constructor(...e) {
|
|
83
|
+
f(this, N);
|
|
84
|
+
f(this, w);
|
|
85
|
+
f(this, A);
|
|
86
|
+
f(this, y);
|
|
87
|
+
f(this, M);
|
|
88
|
+
f(this, x);
|
|
89
|
+
f(this, v);
|
|
90
|
+
f(this, D);
|
|
91
|
+
f(this, S);
|
|
92
|
+
f(this, p);
|
|
93
|
+
f(this, k);
|
|
94
|
+
f(this, H);
|
|
95
|
+
f(this, E);
|
|
96
|
+
f(this, g);
|
|
97
|
+
f(this, b);
|
|
98
|
+
f(this, F);
|
|
99
|
+
f(this, P);
|
|
100
|
+
f(this, L);
|
|
101
|
+
f(this, C);
|
|
102
|
+
f(this, l, void 0);
|
|
103
|
+
f(this, d, /* @__PURE__ */ new Set());
|
|
104
|
+
f(this, h, /* @__PURE__ */ new Set());
|
|
105
|
+
f(this, B, () => {
|
|
106
|
+
n(this, d).forEach((e) => {
|
|
107
|
+
e();
|
|
108
|
+
}), n(this, d).clear();
|
|
109
|
+
});
|
|
110
|
+
f(this, G, (e) => {
|
|
111
|
+
n(this, h).forEach((s) => {
|
|
112
|
+
s(e);
|
|
113
|
+
}), n(this, h).clear();
|
|
114
|
+
});
|
|
115
|
+
const s = e[0], t = e[1];
|
|
116
|
+
K(this, l, a(this, N, Z).call(this, s, t == null ? void 0 : t.forceSvg)), a(this, A, O).call(this, t);
|
|
117
|
+
}
|
|
118
|
+
get node() {
|
|
119
|
+
return n(this, l);
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
l = new WeakMap(), d = new WeakMap(), h = new WeakMap(), N = new WeakSet(), Z = function(e, s) {
|
|
123
|
+
let t = null;
|
|
124
|
+
if (e instanceof Node)
|
|
125
|
+
t = e;
|
|
126
|
+
else if (typeof e == "string")
|
|
127
|
+
if (!e.includes("<") && e.includes("-"))
|
|
128
|
+
t = new (customElements.get(e))();
|
|
129
|
+
else if (e.includes("<")) {
|
|
130
|
+
const i = document.createElement("div");
|
|
131
|
+
i.innerHTML = e, t = i.firstElementChild;
|
|
132
|
+
} else
|
|
133
|
+
ce.has(e) || s ? t = document.createElementNS(
|
|
134
|
+
"http://www.w3.org/2000/svg",
|
|
135
|
+
e
|
|
136
|
+
) : t = document.createElement(e);
|
|
137
|
+
else
|
|
138
|
+
t = document.createElement("div");
|
|
139
|
+
return t;
|
|
140
|
+
}, w = new WeakSet(), _ = function(e) {
|
|
141
|
+
return e instanceof HTMLElement || e instanceof SVGElement;
|
|
142
|
+
}, A = new WeakSet(), O = function(e) {
|
|
143
|
+
if (!e)
|
|
144
|
+
return;
|
|
145
|
+
const s = a(this, w, _).call(this, n(this, l)), t = e.ref;
|
|
146
|
+
delete e.ref, e != null && e.onConnect && (n(this, d).add(e.onConnect), delete e.onConnect), e != null && e.onDisconnect && (n(this, h).add(e.onDisconnect), delete e.onDisconnect);
|
|
147
|
+
let i, o;
|
|
148
|
+
for (const r in e) {
|
|
149
|
+
const u = e[r];
|
|
150
|
+
r === "class" && s ? a(this, y, W).call(this, u) : r === "style" && s ? a(this, v, te).call(this, u) : r === "lightChildren" ? a(this, g, T).call(this, n(this, l), u) : r === "children" ? a(this, g, T).call(this, n(this, l) instanceof Element ? n(this, l).shadowRoot || n(this, l) : n(this, l), u) : r.startsWith("on") ? (o || (o = {}), o[r] = u) : (i || (i = {}), i[r] = u);
|
|
151
|
+
}
|
|
152
|
+
if (a(this, H, ne).call(this, i), a(this, k, ie).call(this, o), t && (typeof t == "function" ? t(n(this, l)) : t.current = n(this, l)), fe && (n(this, h).size || n(this, d).size)) {
|
|
153
|
+
const r = n(this, l) instanceof DocumentFragment ? n(this, l).firstChild : n(this, l);
|
|
154
|
+
re.subscribe(r, {
|
|
155
|
+
connectCallback: n(this, B),
|
|
156
|
+
disconnectCallback: n(this, G),
|
|
157
|
+
unsubscribeAfterDisconnect: !0,
|
|
158
|
+
maxWaitSec: 20
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
}, y = new WeakSet(), W = function(e) {
|
|
162
|
+
const s = n(this, l);
|
|
163
|
+
if (e) {
|
|
164
|
+
if (typeof e == "string")
|
|
165
|
+
s.classList.add(e);
|
|
166
|
+
else if (Array.isArray(e))
|
|
167
|
+
e.forEach((t) => {
|
|
168
|
+
a(this, y, W).call(this, t);
|
|
169
|
+
});
|
|
170
|
+
else if (typeof e == "object")
|
|
171
|
+
if (e instanceof m)
|
|
172
|
+
a(this, M, j).call(this, e);
|
|
173
|
+
else
|
|
174
|
+
for (const t in e) {
|
|
175
|
+
const i = e[t];
|
|
176
|
+
i instanceof m ? a(this, x, ee).call(this, t, i) : i ? s.classList.add(t) : s.classList.remove(t);
|
|
177
|
+
}
|
|
178
|
+
} else
|
|
179
|
+
return;
|
|
180
|
+
}, M = new WeakSet(), j = function(e) {
|
|
181
|
+
const s = n(this, l);
|
|
182
|
+
n(this, h).add(
|
|
183
|
+
e.subscribe(({ current: t, previous: i }) => {
|
|
184
|
+
i && [i].flat().forEach((o) => {
|
|
185
|
+
o && s.classList.remove(o);
|
|
186
|
+
}), t && [t].flat().forEach((o) => {
|
|
187
|
+
o && s.classList.add(o);
|
|
188
|
+
});
|
|
189
|
+
})
|
|
190
|
+
);
|
|
191
|
+
}, x = new WeakSet(), ee = function(e, s) {
|
|
192
|
+
const t = n(this, l);
|
|
193
|
+
n(this, h).add(
|
|
194
|
+
s.subscribe(({ current: i }) => {
|
|
195
|
+
i ? t.classList.add(e) : t.classList.remove(e);
|
|
196
|
+
})
|
|
197
|
+
);
|
|
198
|
+
}, v = new WeakSet(), te = function(e) {
|
|
199
|
+
if (!e)
|
|
200
|
+
return;
|
|
201
|
+
const s = n(this, l);
|
|
202
|
+
s.tagName === "style" || s.tagName === "STYLE" ? a(this, S, q).call(this, e) : a(this, D, se).call(this, e);
|
|
203
|
+
}, D = new WeakSet(), se = function(e) {
|
|
204
|
+
for (const s in e) {
|
|
205
|
+
const t = s, i = e[t];
|
|
206
|
+
i instanceof m ? n(this, h).add(
|
|
207
|
+
i.subscribe(({ current: o }) => {
|
|
208
|
+
a(this, p, z).call(this, t, o);
|
|
209
|
+
})
|
|
210
|
+
) : a(this, p, z).call(this, t, i);
|
|
211
|
+
}
|
|
212
|
+
}, S = new WeakSet(), q = function(e) {
|
|
213
|
+
const s = n(this, l);
|
|
214
|
+
for (const t in e) {
|
|
215
|
+
const i = e[t];
|
|
216
|
+
if (typeof i == "object" && !(i instanceof m))
|
|
217
|
+
s.appendChild(new Text(`${t} {`)), a(this, S, q).call(this, i), s.appendChild(new Text("}"));
|
|
218
|
+
else if (i instanceof m) {
|
|
219
|
+
const o = new Text();
|
|
220
|
+
n(this, h).add(
|
|
221
|
+
i.subscribe((r) => {
|
|
222
|
+
r.current ? o.nodeValue = `${Q(t)}: ${r.current};` : o.nodeValue = "";
|
|
223
|
+
})
|
|
224
|
+
), s.appendChild(o);
|
|
225
|
+
} else
|
|
226
|
+
s.appendChild(new Text(`${Q(t)}: ${i};`));
|
|
227
|
+
}
|
|
228
|
+
}, p = new WeakSet(), z = function(e, s) {
|
|
229
|
+
const t = n(this, l);
|
|
230
|
+
e.includes("--") ? s ? t.style.setProperty(e, s) : t.style.removeProperty(e) : s ? t.style[e] = s : t.style[e] = "";
|
|
231
|
+
}, k = new WeakSet(), ie = function(e) {
|
|
232
|
+
if (!e)
|
|
233
|
+
return;
|
|
234
|
+
const s = n(this, l);
|
|
235
|
+
for (const t in e) {
|
|
236
|
+
const i = t, o = le(
|
|
237
|
+
i.split("on").slice(1).join("on")
|
|
238
|
+
), r = e[i];
|
|
239
|
+
typeof r == "object" ? s.addEventListener(
|
|
240
|
+
o,
|
|
241
|
+
r.callback,
|
|
242
|
+
r.options
|
|
243
|
+
) : typeof r == "function" && s.addEventListener(o, r);
|
|
244
|
+
}
|
|
245
|
+
}, H = new WeakSet(), ne = function(e) {
|
|
246
|
+
for (const s in e) {
|
|
247
|
+
const t = e[s];
|
|
248
|
+
t instanceof m ? n(this, h).add(
|
|
249
|
+
t.subscribe(({ current: i }) => {
|
|
250
|
+
a(this, E, J).call(this, s, i);
|
|
251
|
+
})
|
|
252
|
+
) : a(this, E, J).call(this, s, t);
|
|
253
|
+
}
|
|
254
|
+
}, E = new WeakSet(), J = function(e, s) {
|
|
255
|
+
var i, o;
|
|
256
|
+
const t = n(this, l);
|
|
257
|
+
e in t && !((o = (i = t.constructor) == null ? void 0 : i.observedAttributes) != null && o.includes(e)) ? s != null && (t[e] = s.toString()) : s != null && t.setAttribute(e, s.toString());
|
|
258
|
+
}, g = new WeakSet(), T = function(e, s) {
|
|
259
|
+
s && (s = [s].flat(), s.forEach((t) => {
|
|
260
|
+
if (t instanceof m) {
|
|
261
|
+
const i = document.createElement("div");
|
|
262
|
+
i.style.display = "contents", e.appendChild(i), n(this, h).add(
|
|
263
|
+
t.subscribe(({ current: o }) => {
|
|
264
|
+
a(this, P, ae).call(this, i, a(this, F, oe).call(this, o), Array.from(i.childNodes));
|
|
265
|
+
})
|
|
266
|
+
);
|
|
267
|
+
} else if (t instanceof $)
|
|
268
|
+
a(this, b, V).call(this, e, t.node);
|
|
269
|
+
else if (t instanceof Function)
|
|
270
|
+
a(this, g, T).call(this, e, U(t) ? new t() : t());
|
|
271
|
+
else {
|
|
272
|
+
const i = a(this, C, I).call(this, t);
|
|
273
|
+
i instanceof Node && a(this, b, V).call(this, e, i);
|
|
274
|
+
}
|
|
275
|
+
}));
|
|
276
|
+
}, b = new WeakSet(), V = function(e, s) {
|
|
277
|
+
!(e instanceof ShadowRoot) && s instanceof HTMLElement && s.tagName === "STYLE" ? (n(this, d).add(() => {
|
|
278
|
+
[...document.head.querySelectorAll("style")].find((i) => i.outerHTML === s.outerHTML) || document.head.appendChild(s);
|
|
279
|
+
}), n(this, h).add(() => {
|
|
280
|
+
s.remove();
|
|
281
|
+
})) : e.appendChild(s);
|
|
282
|
+
}, F = new WeakSet(), oe = function(e) {
|
|
283
|
+
return [e].flat().map((t) => t instanceof $ ? t.node : typeof t == "function" ? U(t) ? new t() : t() : a(this, C, I).call(this, t)).flat().filter(Boolean);
|
|
284
|
+
}, P = new WeakSet(), ae = function(e, s, t) {
|
|
285
|
+
t.length > s.length && t.forEach((i) => {
|
|
286
|
+
s.find((o) => a(this, L, Y).call(this, i, o)) || (e.removeChild(i), t = t.filter((o) => o !== i));
|
|
287
|
+
}), t.forEach((i, o) => {
|
|
288
|
+
if (o < s.length) {
|
|
289
|
+
const r = s[o];
|
|
290
|
+
a(this, L, Y).call(this, i, r) || e.replaceChild(r, i);
|
|
291
|
+
} else
|
|
292
|
+
e.removeChild(i);
|
|
293
|
+
});
|
|
294
|
+
for (let i = t.length; i < s.length; i++)
|
|
295
|
+
e.appendChild(s[i]);
|
|
296
|
+
}, L = new WeakSet(), Y = function(e, s) {
|
|
297
|
+
return s ? s instanceof Node ? e.isEqualNode(s) : e.textContent === s.toString() : !1;
|
|
298
|
+
}, C = new WeakSet(), I = function(e) {
|
|
299
|
+
if (e instanceof Node)
|
|
300
|
+
return e;
|
|
301
|
+
if (e != null) {
|
|
302
|
+
const s = String(e);
|
|
303
|
+
if (s.trim().startsWith("<") && s.trim().endsWith(">")) {
|
|
304
|
+
const t = document.createElement("div");
|
|
305
|
+
return t.innerHTML = s, t.firstElementChild;
|
|
306
|
+
} else
|
|
307
|
+
return new Text(s);
|
|
308
|
+
} else
|
|
309
|
+
return;
|
|
310
|
+
}, B = new WeakMap(), G = new WeakMap();
|
|
311
|
+
let X = $;
|
|
312
|
+
export {
|
|
313
|
+
X as E
|
|
314
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../custom-element/index.cjs");require("../Store-D0_rDIsE.cjs");const r=require("../browser-CpzFX2xg.cjs"),s=require("../tags-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../custom-element/index.cjs");require("../Store-D0_rDIsE.cjs");const r=require("../browser-CpzFX2xg.cjs"),s=require("../tags-DX-eNxbA.cjs");class o extends t.CustomElement{constructor(){super(),r.isBrowser&&s.element(this,{style:{cursor:"default"},tabIndex:this.getAttribute("tabindex")||"0",role:"button",onKeydown:e=>{e.code==="Space"&&this.click()},onClick:()=>{this.click()}})}}exports.AbstractButtonElement=o;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CustomElement as e } from "../custom-element/index.js";
|
|
2
2
|
import "../Store-JOKrNVEr.js";
|
|
3
3
|
import { i as o } from "../browser-0zX67oeU.js";
|
|
4
|
-
import { e as r } from "../tags-
|
|
4
|
+
import { e as r } from "../tags-C2jg1zYB.js";
|
|
5
5
|
class l extends e {
|
|
6
6
|
constructor() {
|
|
7
7
|
super(), o && r(this, {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var g=Object.defineProperty,D=Object.defineProperties;var m=Object.getOwnPropertyDescriptors;var l=Object.getOwnPropertySymbols;var q=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;var a=(e,u,r)=>u in e?g(e,u,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[u]=r,c=(e,u)=>{for(var r in u||(u={}))q.call(u,r)&&a(e,r,u[r]);if(l)for(var r of l(u))i.call(u,r)&&a(e,r,u[r]);return e},n=(e,u)=>D(e,m(u));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("../../useCreate-ClGKVMeG.cjs"),t=require("../../useDisconnect-sA74z4IZ.cjs");require("../../Store-D0_rDIsE.cjs");require("../../ticker/index.cjs");const s=require("../index.cjs"),w=require("../../Damped-mdFs8WSd.cjs");function T(e){const u=d.useCreate(r=>new s.Tweened(n(c({},e),{culling:(e==null?void 0:e.culling)===!0?r:e==null?void 0:e.culling})));return t.useDisconnect(()=>{u.close()}),u}function f(e){const u=d.useCreate(r=>new w.Damped(n(c({},e),{culling:(e==null?void 0:e.culling)===!0?r:e==null?void 0:e.culling})));return t.useDisconnect(()=>{u.close()}),u}exports.useDamped=f;exports.useTweened=T;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ElementOrSelector } from '../../utils';
|
|
2
|
+
import { Damped, DampedOptions, Tweened, TweenedOptions } from '..';
|
|
3
|
+
export declare function useTweened(options?: Omit<TweenedOptions, ''> & {
|
|
4
|
+
culling?: ElementOrSelector | boolean;
|
|
5
|
+
}): Tweened;
|
|
6
|
+
export declare function useDamped(options?: Omit<DampedOptions, ''> & {
|
|
7
|
+
culling?: ElementOrSelector | boolean;
|
|
8
|
+
}): Damped;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
var n = Object.defineProperty, d = Object.defineProperties;
|
|
2
|
+
var w = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var m = Object.getOwnPropertySymbols;
|
|
4
|
+
var D = Object.prototype.hasOwnProperty, T = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var a = (e, r, u) => r in e ? n(e, r, { enumerable: !0, configurable: !0, writable: !0, value: u }) : e[r] = u, c = (e, r) => {
|
|
6
|
+
for (var u in r || (r = {}))
|
|
7
|
+
D.call(r, u) && a(e, u, r[u]);
|
|
8
|
+
if (m)
|
|
9
|
+
for (var u of m(r))
|
|
10
|
+
T.call(r, u) && a(e, u, r[u]);
|
|
11
|
+
return e;
|
|
12
|
+
}, l = (e, r) => d(e, w(r));
|
|
13
|
+
import { u as f } from "../../useCreate-DQSfJu7r.js";
|
|
14
|
+
import { u as g } from "../../useDisconnect-D5cBD1bq.js";
|
|
15
|
+
import "../../Store-JOKrNVEr.js";
|
|
16
|
+
import "../../ticker/index.js";
|
|
17
|
+
import { Tweened as t } from "../index.js";
|
|
18
|
+
import { D as x } from "../../Damped-Fy7tHx4d.js";
|
|
19
|
+
function y(e) {
|
|
20
|
+
const r = f((u) => new t(l(c({}, e), {
|
|
21
|
+
culling: (e == null ? void 0 : e.culling) === !0 ? u : e == null ? void 0 : e.culling
|
|
22
|
+
})));
|
|
23
|
+
return g(() => {
|
|
24
|
+
r.close();
|
|
25
|
+
}), r;
|
|
26
|
+
}
|
|
27
|
+
function z(e) {
|
|
28
|
+
const r = f((u) => new x(l(c({}, e), {
|
|
29
|
+
culling: (e == null ? void 0 : e.culling) === !0 ? u : e == null ? void 0 : e.culling
|
|
30
|
+
})));
|
|
31
|
+
return g(() => {
|
|
32
|
+
r.close();
|
|
33
|
+
}), r;
|
|
34
|
+
}
|
|
35
|
+
export {
|
|
36
|
+
z as useDamped,
|
|
37
|
+
y as useTweened
|
|
38
|
+
};
|
package/lib/attribute/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var f=(e,s,t)=>{if(!s.has(e))throw TypeError("Cannot "+t)};var r=(e,s,t)=>(f(e,s,"read from private field"),t?t.call(e):s.get(e)),n=(e,s,t)=>{if(s.has(e))throw TypeError("Cannot add the same private member more than once");s instanceof WeakSet?s.add(e):s.set(e,t)},a=(e,s,t,c)=>(f(e,s,"write to private field"),c?c.call(e,t):s.set(e,t),t);var v=(e,s,t)=>(f(e,s,"access private method"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("../Store-D0_rDIsE.cjs"),A=require("../attributes-Bf2svn4j.cjs"),S=require("../browser-CpzFX2xg.cjs"),q=require("../dom-qY2LdCVL.cjs");var i,u,b,h,m;class p extends y.Store{constructor(t,c,l,o){super(l,o);n(this,h);n(this,i,null);n(this,u,void 0);n(this,b,null);a(this,u,c),S.isBrowser&&(a(this,i,q.getElement(t)),a(this,b,new MutationObserver(d=>{d.forEach(g=>{g.type==="attributes"&&g.attributeName===r(this,u)&&v(this,h,m).call(this)})})),o!=null&&o.sync&&this.subscribe(d=>{r(this,i).setAttribute(r(this,u),d.current.toString())}))}subscribe(t){const c=!this.subscribers.size,l=super.subscribe(t);return c&&(r(this,b).observe(r(this,i),{attributes:!0}),v(this,h,m).call(this)),l}unsubscribe(t){super.unsubscribe(t),this.subscribers.size||r(this,b).disconnect()}close(){super.close(),r(this,b).disconnect()}}i=new WeakMap,u=new WeakMap,b=new WeakMap,h=new WeakSet,m=function(){const t=r(this,i).getAttribute(r(this,u));t!=null&&(this.current=A.parseAttributeValue(t))};exports.Attribute=p;
|
package/lib/attribute/index.d.ts
CHANGED
|
@@ -6,8 +6,6 @@ export interface AttributeOptions<T> extends StoreOptions<T> {
|
|
|
6
6
|
export declare class Attribute<T extends string | number | boolean> extends Store<T> {
|
|
7
7
|
#private;
|
|
8
8
|
constructor(elementOrSelector: ElementOrSelector, name: string, defaultValue: T, options?: AttributeOptions<T>);
|
|
9
|
-
get current(): T;
|
|
10
|
-
set current(value: T);
|
|
11
9
|
subscribe(callback: StoreCallback<StoreEntry<T>>): () => void;
|
|
12
10
|
unsubscribe(callback: StoreCallback<StoreEntry<T>>): void;
|
|
13
11
|
close(): void;
|
package/lib/attribute/index.js
CHANGED
|
@@ -1,65 +1,50 @@
|
|
|
1
|
-
var
|
|
2
|
-
if (!
|
|
1
|
+
var l = (s, e, t) => {
|
|
2
|
+
if (!e.has(s))
|
|
3
3
|
throw TypeError("Cannot " + t);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
if (
|
|
5
|
+
var r = (s, e, t) => (l(s, e, "read from private field"), t ? t.call(s) : e.get(s)), h = (s, e, t) => {
|
|
6
|
+
if (e.has(s))
|
|
7
7
|
throw TypeError("Cannot add the same private member more than once");
|
|
8
|
-
|
|
9
|
-
},
|
|
10
|
-
var
|
|
11
|
-
import { S as
|
|
12
|
-
import { p as
|
|
13
|
-
import { i as
|
|
14
|
-
import { g as
|
|
15
|
-
var
|
|
16
|
-
class
|
|
17
|
-
constructor(t,
|
|
18
|
-
super(
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
u(this, n, !1);
|
|
27
|
-
b(this, c, p), x && (b(this, r, E(t)), d != null && d.sync && this.subscribe((g) => {
|
|
28
|
-
e(this, r).setAttribute(e(this, c), g.current.toString());
|
|
29
|
-
}), b(this, a, new MutationObserver((g) => {
|
|
30
|
-
g.forEach((O) => {
|
|
31
|
-
O.type === "attributes" && O.attributeName === e(this, c) && h(this, f, A).call(this);
|
|
8
|
+
e instanceof WeakSet ? e.add(s) : e.set(s, t);
|
|
9
|
+
}, o = (s, e, t, c) => (l(s, e, "write to private field"), c ? c.call(s, t) : e.set(s, t), t);
|
|
10
|
+
var p = (s, e, t) => (l(s, e, "access private method"), t);
|
|
11
|
+
import { S as g } from "../Store-JOKrNVEr.js";
|
|
12
|
+
import { p as A } from "../attributes-69we3byR.js";
|
|
13
|
+
import { i as y } from "../browser-0zX67oeU.js";
|
|
14
|
+
import { g as S } from "../dom-BY7JhTx5.js";
|
|
15
|
+
var i, u, b, n, v;
|
|
16
|
+
class B extends g {
|
|
17
|
+
constructor(t, c, m, a) {
|
|
18
|
+
super(m, a);
|
|
19
|
+
h(this, n);
|
|
20
|
+
h(this, i, null);
|
|
21
|
+
h(this, u, void 0);
|
|
22
|
+
h(this, b, null);
|
|
23
|
+
o(this, u, c), y && (o(this, i, S(t)), o(this, b, new MutationObserver((f) => {
|
|
24
|
+
f.forEach((d) => {
|
|
25
|
+
d.type === "attributes" && d.attributeName === r(this, u) && p(this, n, v).call(this);
|
|
32
26
|
});
|
|
33
|
-
})),
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}) : !e(this, r).isConnected && e(this, n) && h(this, l, v).call(this), b(this, n, e(this, r).isConnected);
|
|
37
|
-
})));
|
|
38
|
-
}
|
|
39
|
-
get current() {
|
|
40
|
-
return h(this, m, C).call(this), super.current;
|
|
41
|
-
}
|
|
42
|
-
set current(t) {
|
|
43
|
-
super.current = t;
|
|
27
|
+
})), a != null && a.sync && this.subscribe((f) => {
|
|
28
|
+
r(this, i).setAttribute(r(this, u), f.current.toString());
|
|
29
|
+
}));
|
|
44
30
|
}
|
|
45
31
|
subscribe(t) {
|
|
46
|
-
|
|
32
|
+
const c = !this.subscribers.size, m = super.subscribe(t);
|
|
33
|
+
return c && (r(this, b).observe(r(this, i), {
|
|
34
|
+
attributes: !0
|
|
35
|
+
}), p(this, n, v).call(this)), m;
|
|
47
36
|
}
|
|
48
37
|
unsubscribe(t) {
|
|
49
|
-
super.unsubscribe(t), this.subscribers.size ||
|
|
38
|
+
super.unsubscribe(t), this.subscribers.size || r(this, b).disconnect();
|
|
50
39
|
}
|
|
51
40
|
close() {
|
|
52
|
-
super.close(),
|
|
41
|
+
super.close(), r(this, b).disconnect();
|
|
53
42
|
}
|
|
54
43
|
}
|
|
55
|
-
|
|
56
|
-
const t =
|
|
57
|
-
t != null && (this.current =
|
|
58
|
-
}, m = new WeakSet(), C = function() {
|
|
59
|
-
e(this, n) || (h(this, f, A).call(this), e(this, o).observe(e(this, r)));
|
|
60
|
-
}, l = new WeakSet(), v = function() {
|
|
61
|
-
e(this, n) && (e(this, a).disconnect(), e(this, o).disconnect());
|
|
44
|
+
i = new WeakMap(), u = new WeakMap(), b = new WeakMap(), n = new WeakSet(), v = function() {
|
|
45
|
+
const t = r(this, i).getAttribute(r(this, u));
|
|
46
|
+
t != null && (this.current = A(t));
|
|
62
47
|
};
|
|
63
48
|
export {
|
|
64
|
-
|
|
49
|
+
B as Attribute
|
|
65
50
|
};
|
package/lib/canvas/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const W=require("../custom-element/index.cjs");require("../Store-D0_rDIsE.cjs");const S=require("../math-GDWEqu7y.cjs"),E=require("../tags-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const W=require("../custom-element/index.cjs");require("../Store-D0_rDIsE.cjs");const S=require("../math-GDWEqu7y.cjs"),E=require("../tags-DX-eNxbA.cjs"),b=require("../createStylesheet-C0OnN0Br.cjs"),k=require("../element-resizer/index.cjs"),C=require("../ticker/index.cjs");var y=Object.defineProperty,q=Object.getOwnPropertyDescriptor,P=(i,e,s,h)=>{for(var r=h>1?void 0:h?q(e,s):e,f=i.length-1,g;f>=0;f--)(g=i[f])&&(r=(h?g(e,s,r):g(r))||r);return h&&r&&y(e,s,r),r},R=(i,e,s)=>{if(!e.has(i))throw TypeError("Cannot "+s)},t=(i,e,s)=>(R(i,e,"read from private field"),s?s.call(i):e.get(i)),a=(i,e,s)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,s)},c=(i,e,s,h)=>(R(i,e,"write to private field"),h?h.call(i,s):e.set(i,s),s),M=(i,e,s)=>(R(i,e,"access private method"),s),n,p,l,o,d,u,v,_,m,w,x;const O=b.createStylesheet({":host, canvas":{display:"block",width:"100%",height:"100%"}});exports.CanvasElement=class extends W.CustomElement{constructor(){super(),a(this,w),a(this,n,null),a(this,p,null),a(this,l,0),a(this,o,0),a(this,d,1),a(this,u,0),a(this,v,1),a(this,_,e=>{c(this,d,S.clamp(devicePixelRatio,1,2)),c(this,l,e.contentRect.width),c(this,o,e.contentRect.height),t(this,n).width=t(this,l)*this.pixelRatio,t(this,n).height=t(this,o)*this.pixelRatio,this.context.scale(this.pixelRatio,this.pixelRatio),M(this,w,x).call(this)}),a(this,m,e=>{c(this,u,e.timestamp),c(this,v,e.elapsed),M(this,w,x).call(this)}),this.openShadow(O),E.element(this,{children:E.canvas({ref:e=>{c(this,n,e),c(this,p,e.getContext("2d"))}})})}get canvasElement(){return t(this,n)}get context(){return t(this,p)}get pixelRatio(){return t(this,d)}get width(){return t(this,l)}get height(){return t(this,o)}get detail(){return{width:t(this,l),height:t(this,o),element:this,canvasElement:t(this,n),pixelRatio:t(this,d),context:t(this,p),timestamp:t(this,u),elapsed:t(this,v)}}connectedCallback(){k.elementResizer.subscribe(this,t(this,_)),this.hasAttribute("static")||C.ticker.subscribe(t(this,m),{culling:this,maxFPS:this.hasAttribute("fps")?parseInt(this.getAttribute("fps")):void 0})}disconnectedCallback(){k.elementResizer.unsubscribe(t(this,_)),C.ticker.unsubscribe(t(this,m)),t(this,n).remove()}};n=new WeakMap;p=new WeakMap;l=new WeakMap;o=new WeakMap;d=new WeakMap;u=new WeakMap;v=new WeakMap;_=new WeakMap;m=new WeakMap;w=new WeakSet;x=function(){this.dispatchEvent(new CustomEvent("canvasRender",{composed:!0,detail:this.detail}))};exports.CanvasElement=P([W.define("e-canvas")],exports.CanvasElement);
|