aptechka 0.2.0 → 0.2.2
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/Composed-ClTo1f0b.js +79 -0
- package/lib/Composed-Mdr4ZFbI.cjs +1 -0
- package/lib/ElementConstructor-B61ZFTEB.cjs +1 -0
- package/lib/{ElementConstructor-1bvPqYNa.js → ElementConstructor-CvNdPKJy.js} +6 -5
- 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-B5Nhxdpo.cjs → createStylesheet-C0OnN0Br.cjs} +1 -1
- package/lib/{createStylesheet-DpGvTRP3.js → createStylesheet-CD11E4C8.js} +1 -1
- package/lib/{createTheme-CLqJF9Pw.cjs → createTheme-B_W5dUY9.cjs} +1 -1
- package/lib/{createTheme-WJyOPh-q.js → createTheme-D0IoYkYN.js} +1 -1
- package/lib/element-constructor/index.cjs +1 -1
- package/lib/element-constructor/index.js +4 -4
- 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-BNZNGmrW.cjs → index--wI4MTuv.cjs} +1 -1
- package/lib/{index-DMIfOO2r.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/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/useContext.d.ts +2 -2
- package/lib/jsx/index.cjs +1 -1
- package/lib/jsx/index.d.ts +2 -9
- package/lib/jsx/index.js +11 -95
- package/lib/jsx/instantiate.d.ts +1 -0
- package/lib/jsx/register.d.ts +1 -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/object-BZELAoVj.cjs +1 -0
- package/lib/object-R34VLqhp.js +85 -0
- package/lib/router/index.cjs +1 -1
- package/lib/router/index.js +21 -21
- 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/{jsx/hooks/useStore.d.ts → store/hooks/index.d.ts} +1 -1
- package/lib/store/hooks/index.js +31 -0
- package/lib/store/index.cjs +1 -1
- package/lib/store/index.js +48 -111
- package/lib/string-3lAkpJJP.js +51 -0
- package/lib/string-vBu90jhV.cjs +1 -0
- package/lib/studio/index.cjs +1 -1
- package/lib/studio/index.js +6 -5
- package/lib/{tags-D0k7-iVY.js → tags-C2jg1zYB.js} +1 -1
- package/lib/{tags-DGIuh1Hi.cjs → tags-DX-eNxbA.cjs} +1 -1
- package/lib/theme/index.cjs +1 -1
- package/lib/theme/index.d.ts +1 -1
- package/lib/theme/index.js +3 -3
- 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/index.cjs +1 -1
- package/lib/utils/index.js +28 -27
- 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 +67 -2
- package/lib/ElementConstructor-CdUaQS-S.cjs +0 -1
- package/lib/getComponentElement-B0Qb2RbZ.js +0 -145
- package/lib/getComponentElement-BcreYwFe.cjs +0 -1
- package/lib/jsx/getComponentElement.d.ts +0 -2
- package/lib/string-Cgp_uJvP.cjs +0 -1
- package/lib/string-DCGBU6em.js +0 -134
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var I=(t,e,s)=>{if(!e.has(t))throw TypeError("Cannot "+s)};var z=(t,e,s)=>(I(t,e,"read from private field"),s?s.call(t):e.get(t)),A=(t,e,s)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,s)},H=(t,e,s,i)=>(I(t,e,"write to private field"),i?i.call(t,s):e.set(t,s),s);const E=require("./custom-element/index.cjs");require("./Store-D0_rDIsE.cjs");const M=require("./browser-CpzFX2xg.cjs"),N=require("./events-Crwi8fz6.cjs"),Y=require("./style-At6aDoqG.cjs"),a=require("./tags-
|
|
1
|
+
"use strict";var I=(t,e,s)=>{if(!e.has(t))throw TypeError("Cannot "+s)};var z=(t,e,s)=>(I(t,e,"read from private field"),s?s.call(t):e.get(t)),A=(t,e,s)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,s)},H=(t,e,s,i)=>(I(t,e,"write to private field"),i?i.call(t,s):e.set(t,s),s);const E=require("./custom-element/index.cjs");require("./Store-D0_rDIsE.cjs");const M=require("./browser-CpzFX2xg.cjs"),N=require("./events-Crwi8fz6.cjs"),Y=require("./style-At6aDoqG.cjs"),a=require("./tags-DX-eNxbA.cjs"),P=require("./createStylesheet-C0OnN0Br.cjs"),w=require("./theme/index.cjs");var Z=Object.defineProperty,J=Object.getOwnPropertyDescriptor,Q=(t,e,s,i)=>{for(var n=i>1?void 0:i?J(e,s):e,l=t.length-1,h;l>=0;l--)(h=t[l])&&(n=(i?h(e,s,n):h(n))||n);return i&&n&&Z(e,s,n),n},q=(t,e,s)=>{if(!e.has(t))throw TypeError("Cannot "+s)},r=(t,e,s)=>(q(t,e,"read from private field"),s?s.call(t):e.get(t)),c=(t,e,s)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,s)},d=(t,e,s,i)=>(q(t,e,"write to private field"),i?i.call(t,s):e.set(t,s),s),B=(t,e,s)=>(q(t,e,"access private method"),s),y,S,o,v,u,f,L,C,W;const V=P.createStylesheet({":host":{position:"relative"},".head":{width:"100%",cursor:"default",background:"none",border:"none",color:"inherit",fontFamily:"inherit",fontSize:"inherit",fontWeight:"inherit",textAlign:"start",padding:"0",margin:"0"},".body":{boxSizing:"border-box",position:"var(--position, unset)",top:"100%",left:"0",width:"100%",overflow:"hidden",transitionDuration:`var(--duration, ${w.aptechkaTheme.durationShort.var})`,transitionProperty:"height",cursor:"default"},".body-inner":{display:"grid",gap:"var(--gap, 0px)",width:"100%",paddingTop:"var(--gap, 0px)"}});exports.SelectElement=class extends E.CustomElement{constructor(){super(),c(this,C),c(this,y,null),c(this,S,""),c(this,o,null),c(this,v,!1),c(this,u,void 0),c(this,f,null),c(this,L,()=>{N.dispatchSizeChangeEvent(this)}),M.isBrowser&&(this.openShadow(V),d(this,y,this.attachInternals()),d(this,f,new ResizeObserver(r(this,L))),a.element(this,{children:[a.button({class:"head",children:a.slot({name:"head"}),onClick:()=>{this.opened?this.close():this.open()}}),a.div({class:"body",style:{height:"0px"},children:a.div({class:"body-inner",children:a.slot()}),ref:e=>{d(this,o,e)}})]}))}get value(){return r(this,S)}set value(e){d(this,S,e),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))}get internals(){return r(this,y)}get opened(){return r(this,v)}open(){clearTimeout(r(this,u)),d(this,v,!0),r(this,o).style.display="grid",this.classList.add("triggered"),setTimeout(()=>{this.classList.add("opened"),r(this,o).style.height=r(this,o).scrollHeight+"px",B(this,C,W).call(this)},0)}close(){d(this,v,!1),r(this,o).style.height="0px",this.classList.remove("opened"),B(this,C,W).call(this),d(this,u,setTimeout(()=>{this.classList.remove("triggered"),r(this,o).style.display="none"},Y.getElementTransitionDurationMS(r(this,o))))}connectedCallback(){r(this,f).observe(r(this,o))}disconnectedCallback(){clearTimeout(r(this,u)),r(this,f).disconnect()}};y=new WeakMap;S=new WeakMap;o=new WeakMap;v=new WeakMap;u=new WeakMap;f=new WeakMap;L=new WeakMap;C=new WeakSet;W=function(){this.dispatchEvent(new CustomEvent("selectToggle",{bubbles:!0,composed:!0,detail:{opened:r(this,v)}}))};exports.SelectElement.formAssociated=!0;exports.SelectElement=Q([E.define("e-select")],exports.SelectElement);var _;class D extends E.CustomElement{constructor(){super(...arguments);A(this,_,null)}get selectElement(){return z(this,_)}connectedCallback(){var i,n;const s=(n=(i=this.assignedSlot)==null?void 0:i.getRootNode())==null?void 0:n.host;s?H(this,_,s):console.log(this,"e-select not found")}}_=new WeakMap;var X=Object.defineProperty,j=Object.getOwnPropertyDescriptor,ee=(t,e,s,i)=>{for(var n=i>1?void 0:i?j(e,s):e,l=t.length-1,h;l>=0;l--)(h=t[l])&&(n=(i?h(e,s,n):h(n))||n);return i&&n&&X(e,s,n),n},U=(t,e,s)=>{if(!e.has(t))throw TypeError("Cannot "+s)},O=(t,e,s)=>(U(t,e,"read from private field"),s?s.call(t):e.get(t)),G=(t,e,s)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,s)},R=(t,e,s)=>(U(t,e,"access private method"),s),m,T,b;const te=P.createStylesheet({":host":{width:"100%",height:w.aptechkaTheme.heightInput.var,display:"inline-flex",alignItems:"center"}});exports.SelectOptionElement=class extends D{constructor(){super(),G(this,T),G(this,m,()=>{this.selectElement.value===this.value?this.style.display="none":this.style.display=""}),M.isBrowser&&(this.openShadow(te),a.element(this,{tabIndex:"0",onClick:()=>{R(this,T,b).call(this)},onKeydown:e=>{e.code==="Space"&&R(this,T,b).call(this)},children:[a.slot()]}))}get value(){return(this.hasAttribute("value")?this.getAttribute("value"):this.innerText)||""}connectedCallback(){super.connectedCallback(),this.hasAttribute("default")&&(this.selectElement.value||(this.selectElement.value=this.value)),this.selectElement.addEventListener("change",O(this,m)),setTimeout(()=>{O(this,m).call(this)})}disconnectedCallback(){this.selectElement.removeEventListener("change",O(this,m))}};m=new WeakMap;T=new WeakSet;b=function(){this.selectElement.value=this.value,this.selectElement.close()};exports.SelectOptionElement=ee([E.define("e-select-option")],exports.SelectOptionElement);const F=`<svg
|
|
2
2
|
xmlns="http://www.w3.org/2000/svg"
|
|
3
3
|
width="32"
|
|
4
4
|
height="32"
|
|
@@ -12,8 +12,8 @@ import "./Store-JOKrNVEr.js";
|
|
|
12
12
|
import { i as D } from "./browser-0zX67oeU.js";
|
|
13
13
|
import { d as V } from "./events-_C2CztxR.js";
|
|
14
14
|
import { g as X } from "./style-j2TwriJ_.js";
|
|
15
|
-
import { e as x, p as j, ax as _, D as q } from "./tags-
|
|
16
|
-
import { c as z } from "./createStylesheet-
|
|
15
|
+
import { e as x, p as j, ax as _, D as q } from "./tags-C2jg1zYB.js";
|
|
16
|
+
import { c as z } from "./createStylesheet-CD11E4C8.js";
|
|
17
17
|
import { aptechkaTheme as m } from "./theme/index.js";
|
|
18
18
|
var ee = Object.defineProperty, te = Object.getOwnPropertyDescriptor, se = (e, t, s, i) => {
|
|
19
19
|
for (var a = i > 1 ? void 0 : i ? te(t, s) : t, r = e.length - 1, l; r >= 0; r--)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var y=Object.defineProperty,A=Object.defineProperties;var h=Object.getOwnPropertyDescriptors;var i=Object.getOwnPropertySymbols;var q=Object.prototype.hasOwnProperty,w=Object.prototype.propertyIsEnumerable;var l=(e,t,n)=>t in e?y(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,f=(e,t)=>{for(var n in t||(t={}))q.call(t,n)&&l(e,n,t[n]);if(i)for(var n of i(t))w.call(t,n)&&l(e,n,t[n]);return e},a=(e,t)=>A(e,h(t));const C=require("./ElementConstructor-B61ZFTEB.cjs"),F=require("./string-vBu90jhV.cjs"),p=require("./ComponentElement-BUesLP4b.cjs");function E(e){const t=Array.isArray(e)?e:[e];let n=[];return t.forEach(r=>{if(typeof r=="function"){const o=r();n=[...n,...E(o)]}else n.push(r)}),n}function d(e,t,...n){var s;if(typeof e=="function"){if(e===m)return m(n);const u=`e-${F.camelToKebab(e.name)}`;let c=customElements.get(u);return c||(c=(s=class extends p.ComponentElement{},s.formAssociated=e.formAssociated,s),customElements.define(u,c)),()=>new c({tag:e,attributes:t,children:n})}const r=n.map(u=>E(u)).flat();let o=null;return e==="component"?(o=m(r),p.nextComponentAttributes.value=t):o=new C.ElementConstructor(e,a(f({},t),{children:r})),o.node}function m(e){return new C.ElementConstructor(document.createDocumentFragment(),{children:e})}function x(e,t=null,...n){return d(e,t,...n)()}exports.Fragment=m;exports.h=d;exports.instantiate=x;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
var C = Object.defineProperty, E = Object.defineProperties;
|
|
2
|
+
var y = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var f = Object.getOwnPropertySymbols;
|
|
4
|
+
var A = Object.prototype.hasOwnProperty, h = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var i = (e, t, n) => t in e ? C(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, a = (e, t) => {
|
|
6
|
+
for (var n in t || (t = {}))
|
|
7
|
+
A.call(t, n) && i(e, n, t[n]);
|
|
8
|
+
if (f)
|
|
9
|
+
for (var n of f(t))
|
|
10
|
+
h.call(t, n) && i(e, n, t[n]);
|
|
11
|
+
return e;
|
|
12
|
+
}, l = (e, t) => E(e, y(t));
|
|
13
|
+
import { E as p } from "./ElementConstructor-CvNdPKJy.js";
|
|
14
|
+
import { c as w } from "./string-3lAkpJJP.js";
|
|
15
|
+
import { C as x, n as F } from "./ComponentElement-NMlh1Ptn.js";
|
|
16
|
+
function d(e) {
|
|
17
|
+
const t = Array.isArray(e) ? e : [e];
|
|
18
|
+
let n = [];
|
|
19
|
+
return t.forEach((r) => {
|
|
20
|
+
if (typeof r == "function") {
|
|
21
|
+
const o = r();
|
|
22
|
+
n = [...n, ...d(o)];
|
|
23
|
+
} else
|
|
24
|
+
n.push(r);
|
|
25
|
+
}), n;
|
|
26
|
+
}
|
|
27
|
+
function b(e, t, ...n) {
|
|
28
|
+
var s;
|
|
29
|
+
if (typeof e == "function") {
|
|
30
|
+
if (e === c)
|
|
31
|
+
return c(n);
|
|
32
|
+
const m = `e-${w(e.name)}`;
|
|
33
|
+
let u = customElements.get(m);
|
|
34
|
+
return u || (u = (s = class extends x {
|
|
35
|
+
}, s.formAssociated = e.formAssociated, s), customElements.define(m, u)), () => new u({ tag: e, attributes: t, children: n });
|
|
36
|
+
}
|
|
37
|
+
const r = n.map((m) => d(m)).flat();
|
|
38
|
+
let o = null;
|
|
39
|
+
return e === "component" ? (o = c(r), F.value = t) : o = new p(e, l(a({}, t), {
|
|
40
|
+
children: r
|
|
41
|
+
})), o.node;
|
|
42
|
+
}
|
|
43
|
+
function c(e) {
|
|
44
|
+
return new p(document.createDocumentFragment(), {
|
|
45
|
+
children: e
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
function $(e, t = null, ...n) {
|
|
49
|
+
return b(e, t, ...n)();
|
|
50
|
+
}
|
|
51
|
+
export {
|
|
52
|
+
c as F,
|
|
53
|
+
b as h,
|
|
54
|
+
$ as i
|
|
55
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../../useConnect-DcfeqwzW.cjs");require("../../Store-D0_rDIsE.cjs");const o=require("../index.cjs");function u(...e){c.useConnect(t=>{const n=e.length>1?e[0]:t,r=e.length>1?e[1]:e[0];return o.intersector.subscribe(n,r)})}exports.useIntersector=u;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ElementOrSelector } from '../../utils';
|
|
2
|
+
import { IntersectorCallback } from '..';
|
|
3
|
+
export declare function useIntersector(elementOrSelector: ElementOrSelector, callback: IntersectorCallback): void;
|
|
4
|
+
export declare function useIntersector(elementOrSelector: ElementOrSelector, callback: IntersectorCallback): void;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { u as c } from "../../useConnect-CXdqKdRX.js";
|
|
2
|
+
import "../../Store-JOKrNVEr.js";
|
|
3
|
+
import { intersector as r } from "../index.js";
|
|
4
|
+
function l(...t) {
|
|
5
|
+
c((e) => {
|
|
6
|
+
const n = t.length > 1 ? t[0] : e, o = t.length > 1 ? t[1] : t[0];
|
|
7
|
+
return r.subscribe(n, o);
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
export {
|
|
11
|
+
l as useIntersector
|
|
12
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var C=Object.defineProperty;var l=Object.getOwnPropertySymbols;var y=Object.prototype.hasOwnProperty,S=Object.prototype.propertyIsEnumerable;var i=(t,e,n)=>e in t?C(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,d=(t,e)=>{for(var n in e||(e={}))y.call(e,n)&&i(t,n,e[n]);if(l)for(var n of l(e))S.call(e,n)&&i(t,n,e[n]);return t};Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("../../useConnect-DcfeqwzW.cjs"),o=require("../../useCreate-ClGKVMeG.cjs"),w=require("../../useDisconnect-sA74z4IZ.cjs");require("../../Store-D0_rDIsE.cjs");const x=require("../../tags-DX-eNxbA.cjs"),f=require("../../createStylesheet-C0OnN0Br.cjs");function R(t,e){a.useConnect(n=>{const s=n.findContext(t);if(!s){console.warn(n,`Context "${t}" not found`);return}return e(s)})}function m(t,e){o.useCreate(n=>{n.createContext(t,e)})}function T(){return o.useCreate(t=>t.attachInternals())}function p(t){return o.useCreate(e=>e.attachShadow(d({mode:"open"},t)))}function q(t){o.useCreate(e=>{e.shadowRoot&&e.shadowRoot.adoptedStyleSheets.push(f.createStylesheet(t))}),a.useConnect(e=>{if(e.shadowRoot)return;const n=e.getRootNode();if(n===document){const s=x.style(t).node;if(![...document.head.querySelectorAll("style")].find(u=>u.outerHTML===s.outerHTML))return document.head.appendChild(s),()=>{s.remove()}}else if(n instanceof ShadowRoot){const s=f.createStylesheet(t);n.adoptedStyleSheets.filter(r=>{const u=Array.from(r.cssRules);Array.from(s.cssRules).filter(c=>!u.find(h=>h.cssText===c.cssText)).forEach(c=>{r.insertRule(c.cssText)})})}})}exports.useConnect=a.useConnect;exports.useCreate=o.useCreate;exports.useDisconnect=w.useDisconnect;exports.createContext=m;exports.useContext=R;exports.useInternals=T;exports.useShadow=p;exports.useStylesheet=q;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { useConnect } from './useConnect';
|
|
2
|
+
export { useContext, createContext, type ContextCallback } from './useContext';
|
|
3
|
+
export { useCreate } from './useCreate';
|
|
4
|
+
export { useDisconnect } from './useDisconnect';
|
|
5
|
+
export { useInternals } from './useInternals';
|
|
6
|
+
export { useShadow } from './useShadow';
|
|
7
|
+
export { useStylesheet } from './useStylesheet';
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
var m = Object.defineProperty;
|
|
2
|
+
var c = Object.getOwnPropertySymbols;
|
|
3
|
+
var p = Object.prototype.hasOwnProperty, y = Object.prototype.propertyIsEnumerable;
|
|
4
|
+
var f = (t, e, o) => e in t ? m(t, e, { enumerable: !0, configurable: !0, writable: !0, value: o }) : t[e] = o, l = (t, e) => {
|
|
5
|
+
for (var o in e || (e = {}))
|
|
6
|
+
p.call(e, o) && f(t, o, e[o]);
|
|
7
|
+
if (c)
|
|
8
|
+
for (var o of c(e))
|
|
9
|
+
y.call(e, o) && f(t, o, e[o]);
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { u as i } from "../../useConnect-CXdqKdRX.js";
|
|
13
|
+
import { u as s } from "../../useCreate-DQSfJu7r.js";
|
|
14
|
+
import { u as v } from "../../useDisconnect-D5cBD1bq.js";
|
|
15
|
+
import "../../Store-JOKrNVEr.js";
|
|
16
|
+
import { aC as x } from "../../tags-C2jg1zYB.js";
|
|
17
|
+
import { c as d } from "../../createStylesheet-CD11E4C8.js";
|
|
18
|
+
function E(t, e) {
|
|
19
|
+
i((o) => {
|
|
20
|
+
const n = o.findContext(t);
|
|
21
|
+
if (!n) {
|
|
22
|
+
console.warn(o, `Context "${t}" not found`);
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
return e(n);
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
function H(t, e) {
|
|
29
|
+
s((o) => {
|
|
30
|
+
o.createContext(t, e);
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
function I() {
|
|
34
|
+
return s((t) => t.attachInternals());
|
|
35
|
+
}
|
|
36
|
+
function L(t) {
|
|
37
|
+
return s((e) => e.attachShadow(l({ mode: "open" }, t)));
|
|
38
|
+
}
|
|
39
|
+
function M(t) {
|
|
40
|
+
s((e) => {
|
|
41
|
+
e.shadowRoot && e.shadowRoot.adoptedStyleSheets.push(d(t));
|
|
42
|
+
}), i((e) => {
|
|
43
|
+
if (e.shadowRoot)
|
|
44
|
+
return;
|
|
45
|
+
const o = e.getRootNode();
|
|
46
|
+
if (o === document) {
|
|
47
|
+
const n = x(t).node;
|
|
48
|
+
if (![...document.head.querySelectorAll("style")].find((u) => u.outerHTML === n.outerHTML))
|
|
49
|
+
return document.head.appendChild(n), () => {
|
|
50
|
+
n.remove();
|
|
51
|
+
};
|
|
52
|
+
} else if (o instanceof ShadowRoot) {
|
|
53
|
+
const n = d(t);
|
|
54
|
+
o.adoptedStyleSheets.filter((r) => {
|
|
55
|
+
const u = Array.from(r.cssRules);
|
|
56
|
+
Array.from(n.cssRules).filter(
|
|
57
|
+
(a) => !u.find(
|
|
58
|
+
(h) => h.cssText === a.cssText
|
|
59
|
+
)
|
|
60
|
+
).forEach((a) => {
|
|
61
|
+
r.insertRule(a.cssText);
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
export {
|
|
68
|
+
H as createContext,
|
|
69
|
+
i as useConnect,
|
|
70
|
+
E as useContext,
|
|
71
|
+
s as useCreate,
|
|
72
|
+
v as useDisconnect,
|
|
73
|
+
I as useInternals,
|
|
74
|
+
L as useShadow,
|
|
75
|
+
M as useStylesheet
|
|
76
|
+
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
export declare function useContext<T>(name: string
|
|
1
|
+
export type ContextCallback<T> = (context: T) => void | (() => void);
|
|
2
|
+
export declare function useContext<T>(name: string, callback: ContextCallback<T>): void;
|
|
3
3
|
export declare function createContext(name: string, value: any): void;
|
package/lib/jsx/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../instantiate-BAz2WZtO.cjs");function i(e,n=null,...r){return t.h(e,n,...r)}function a(e,n=document.body){n.appendChild(t.instantiate(e))}exports.Fragment=t.Fragment;exports.h=t.h;exports.instantiate=t.instantiate;exports.register=i;exports.render=a;
|
package/lib/jsx/index.d.ts
CHANGED
|
@@ -1,12 +1,5 @@
|
|
|
1
1
|
export * from './type';
|
|
2
2
|
export { h, Fragment } from './h';
|
|
3
|
+
export { register } from './register';
|
|
3
4
|
export { render } from './render';
|
|
4
|
-
export {
|
|
5
|
-
export { useConnect } from './hooks/useConnect';
|
|
6
|
-
export { useContext, createContext } from './hooks/useContext';
|
|
7
|
-
export { useCreate } from './hooks/useCreate';
|
|
8
|
-
export { useDisconnect } from './hooks/useDisconnect';
|
|
9
|
-
export { useInternals } from './hooks/useInternals';
|
|
10
|
-
export { useShadow } from './hooks/useShadow';
|
|
11
|
-
export { useStore } from './hooks/useStore';
|
|
12
|
-
export { useStylesheet } from './hooks/useStylesheet';
|
|
5
|
+
export { instantiate } from './instantiate';
|
package/lib/jsx/index.js
CHANGED
|
@@ -1,99 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
for (var n in e || (e = {}))
|
|
6
|
-
C.call(e, n) && l(t, n, e[n]);
|
|
7
|
-
if (a)
|
|
8
|
-
for (var n of a(e))
|
|
9
|
-
y.call(e, n) && l(t, n, e[n]);
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
|
-
import { g as S, c as w } from "../getComponentElement-B0Qb2RbZ.js";
|
|
13
|
-
import { F as $, h as z } from "../getComponentElement-B0Qb2RbZ.js";
|
|
14
|
-
import { S as i } from "../Store-JOKrNVEr.js";
|
|
15
|
-
import { aC as x } from "../tags-D0k7-iVY.js";
|
|
16
|
-
import { c as f } from "../createStylesheet-DpGvTRP3.js";
|
|
17
|
-
function F(t, e = document.body) {
|
|
18
|
-
e.appendChild(S(t));
|
|
19
|
-
}
|
|
20
|
-
function r(t) {
|
|
21
|
-
return t(w);
|
|
22
|
-
}
|
|
23
|
-
function m(t) {
|
|
24
|
-
r((e) => {
|
|
25
|
-
e.addConnectCallback(t);
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
function H(t) {
|
|
29
|
-
const e = new i(null);
|
|
30
|
-
return m((n) => {
|
|
31
|
-
const o = n.findContext(t);
|
|
32
|
-
return o ? e.current = o : console.warn(n, `Context "${t}" not found`), () => {
|
|
33
|
-
e.close();
|
|
34
|
-
};
|
|
35
|
-
}), e;
|
|
36
|
-
}
|
|
37
|
-
function I(t, e) {
|
|
38
|
-
r((n) => {
|
|
39
|
-
n.createContext(t, e);
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
function R(t) {
|
|
43
|
-
r((e) => {
|
|
44
|
-
e.addDisconnectCallback(t);
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
function L() {
|
|
48
|
-
return r((t) => t.attachInternals());
|
|
49
|
-
}
|
|
50
|
-
function M(t) {
|
|
51
|
-
return r((e) => e.attachShadow(d({ mode: "open" }, t)));
|
|
52
|
-
}
|
|
53
|
-
function N(...t) {
|
|
54
|
-
const e = new i(...t);
|
|
55
|
-
return R(e.close), e;
|
|
1
|
+
import { h as e, i as o } from "../instantiate-BDteLwW6.js";
|
|
2
|
+
import { F as u } from "../instantiate-BDteLwW6.js";
|
|
3
|
+
function a(n, r = null, ...t) {
|
|
4
|
+
return e(n, r, ...t);
|
|
56
5
|
}
|
|
57
|
-
function
|
|
58
|
-
r((
|
|
59
|
-
e.shadowRoot && e.shadowRoot.adoptedStyleSheets.push(f(t));
|
|
60
|
-
}), m((e) => {
|
|
61
|
-
if (e.shadowRoot)
|
|
62
|
-
return;
|
|
63
|
-
const n = e.getRootNode();
|
|
64
|
-
if (n === document) {
|
|
65
|
-
const o = x(t).node;
|
|
66
|
-
if (![...document.head.querySelectorAll("style")].find((c) => c.outerHTML === o.outerHTML))
|
|
67
|
-
return document.head.appendChild(o), () => {
|
|
68
|
-
o.remove();
|
|
69
|
-
};
|
|
70
|
-
} else if (n instanceof ShadowRoot) {
|
|
71
|
-
const o = f(t);
|
|
72
|
-
n.adoptedStyleSheets.filter((s) => {
|
|
73
|
-
const c = Array.from(s.cssRules);
|
|
74
|
-
Array.from(o.cssRules).filter(
|
|
75
|
-
(u) => !c.find(
|
|
76
|
-
(h) => h.cssText === u.cssText
|
|
77
|
-
)
|
|
78
|
-
).forEach((u) => {
|
|
79
|
-
s.insertRule(u.cssText);
|
|
80
|
-
});
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
});
|
|
6
|
+
function d(n, r = document.body) {
|
|
7
|
+
r.appendChild(o(n));
|
|
84
8
|
}
|
|
85
9
|
export {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
m as useConnect,
|
|
92
|
-
H as useContext,
|
|
93
|
-
r as useCreate,
|
|
94
|
-
R as useDisconnect,
|
|
95
|
-
L as useInternals,
|
|
96
|
-
M as useShadow,
|
|
97
|
-
N as useStore,
|
|
98
|
-
b as useStylesheet
|
|
10
|
+
u as Fragment,
|
|
11
|
+
e as h,
|
|
12
|
+
o as instantiate,
|
|
13
|
+
a as register,
|
|
14
|
+
d as render
|
|
99
15
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function instantiate(Component: any, attributes?: JSX.AllAttributes | null, ...children: JSX.ComponentChildren): any;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function register(Component: any, attributes?: JSX.AllAttributes | null, ...children: JSX.ComponentChildren): any;
|
package/lib/layout-box/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var I=(i,e,s)=>{if(!e.has(i))throw TypeError("Cannot "+s)};var t=(i,e,s)=>(I(i,e,"read from private field"),s?s.call(i):e.get(i)),h=(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)},n=(i,e,s,o)=>(I(i,e,"write to private field"),o?o.call(i,s):e.set(i,s),s);var R=(i,e,s)=>(I(i,e,"access private method"),s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ot=require("../css-unit-parser/index.cjs"),K=require("../ladder/index.cjs"),F=require("../order/index.cjs"),at=require("../scroll-entries/index.cjs"),G=require("../ticker/index.cjs"),J=require("../browser-CpzFX2xg.cjs"),N=require("../dom-qY2LdCVL.cjs"),L=require("../layout-8ryRAMGJ.cjs"),Q=require("../element-resizer/index.cjs"),j=require("../window-resizer/index.cjs");function tt(i){const e=Math.sqrt(i.m11*i.m11+i.m12*i.m12+i.m13*i.m13),s=Math.sqrt(i.m21*i.m21+i.m22*i.m22+i.m23*i.m23),o=Math.sqrt(i.m31*i.m31+i.m32*i.m32+i.m33*i.m33),X=Math.atan2(i.m32,i.m33),Y=Math.atan2(-i.m31,Math.sqrt(i.m32*i.m32+i.m33*i.m33)),V=Math.atan2(i.m21,i.m11),u=i.m41,C=i.m42*-1,O=i.m43;return{scaleX:e,scaleY:s,scaleZ:o,rotationX:X,rotationY:Y,rotationZ:V,translationX:u,translationY:C,translationZ:O}}var a,f,p,M,H,q,x,v,Z,y,_,E,d,S,b,P,T,B,z,g,m,c,r,l,A,$,k,et,D,st,U,it,w,W;class ct{constructor(e,s){h(this,A);h(this,k);h(this,D);h(this,U);h(this,a,null);h(this,f,null);h(this,p,[]);h(this,M,"auto");h(this,H,"top");h(this,q,!1);h(this,x,!0);h(this,v,!0);h(this,Z,!0);h(this,y,0);h(this,_,0);h(this,E,0);h(this,d,0);h(this,S,0);h(this,b,0);h(this,P,0);h(this,T,0);h(this,B,0);h(this,z,{x:0,y:0,z:0});h(this,g,{x:0,y:0,z:0});h(this,m,{x:1,y:1,z:1});h(this,c,new K.Ladder({x:0,y:0,z:0}));h(this,r,new K.Ladder({x:0,y:0,z:0}));h(this,l,new K.Ladder({x:0,y:0,z:0}));h(this,w,()=>{J.isBrowser&&R(this,D,st).call(this)});h(this,W,()=>{R(this,U,it).call(this),R(this,A,$).call(this)});J.isBrowser&&(n(this,a,N.getElement(e)||document.body),n(this,f,N.getElement(s==null?void 0:s.containerElement)||document.body),n(this,M,(s==null?void 0:s.scrollAxis)||"auto"),n(this,H,(s==null?void 0:s.frontSide)||"top"),n(this,q,(s==null?void 0:s.cartesian)||!1),n(this,x,(s==null?void 0:s.sizeStep)!==void 0?s.sizeStep:!0),n(this,v,(s==null?void 0:s.positionStep)!==void 0?s.positionStep:!0),n(this,Z,(s==null?void 0:s.transformStep)!==void 0?s.transformStep:!0),t(this,l).setStep("_size","+",{x:1,y:1,z:1}),t(this,r).setStep("_position","+",{x:0,y:0,z:0}),t(this,l).setStep("_scale","*",{x:1,y:1,z:1}),t(this,r).setStep("_translation","+",{x:0,y:0,z:0}),t(this,c).setStep("_rotation","+",{x:0,y:0,z:0}),addEventListener("DOMContentLoaded",()=>{at.scrollEntries.getAll(this.element).forEach(o=>{this.setScrollStep(()=>o)})}),G.ticker.subscribe(t(this,W),{order:F.TICK_ORDER.LAYOUT_BOX,culling:s!=null&&s.culling?this.element:void 0}),Q.elementResizer.subscribe(this.element,t(this,w)),j.windowResizer.subscribe(t(this,w),F.RESIZE_ORDER.LAYOUT_BOX))}get element(){return t(this,a)}get containerElement(){return t(this,f)}get position(){return t(this,r).current}get rotation(){return t(this,c).current}get scale(){return t(this,l).current}get left(){return t(this,S)}get top(){return t(this,d)}get front(){return t(this,b)}get width(){return t(this,y)}get height(){return t(this,_)}get depth(){return t(this,E)}bindObject(e){e.position&&t(this,r).bind(e.position),e.rotation&&t(this,c).bind(e.rotation),e.scale&&t(this,l).bind(e.scale)}unbindObject(e){e.position&&t(this,r).unbind(e.position),e.rotation&&t(this,c).unbind(e.rotation),e.scale&&t(this,l).unbind(e.scale)}setScrollStep(e){return t(this,p).includes(e)||t(this,p).push(e),()=>this.deleteScrollStep(e)}deleteScrollStep(e){n(this,p,t(this,p).filter(s=>s!==e))}destroy(){G.ticker.unsubscribe(t(this,W)),Q.elementResizer.unsubscribe(t(this,w)),j.windowResizer.unsubscribe(t(this,w)),t(this,r).close(),t(this,c).close(),t(this,l).close()}setPositionStep(...e){t(this,r).setStep(...e)}getPositionStep(...e){return t(this,r).getStepValue(...e)}setRotationStep(...e){t(this,c).setStep(...e)}getRotationStep(...e){return t(this,c).getStepValue(...e)}setScaleStep(...e){t(this,l).setStep(...e)}getScaleStep(...e){return t(this,l).getStepValue(...e)}deletePositionStep(...e){t(this,r).deleteStep(...e)}deleteRotationStep(...e){t(this,c).deleteStep(...e)}deleteScaleStep(...e){t(this,l).deleteStep(...e)}}a=new WeakMap,f=new WeakMap,p=new WeakMap,M=new WeakMap,H=new WeakMap,q=new WeakMap,x=new WeakMap,v=new WeakMap,Z=new WeakMap,y=new WeakMap,_=new WeakMap,E=new WeakMap,d=new WeakMap,S=new WeakMap,b=new WeakMap,P=new WeakMap,T=new WeakMap,B=new WeakMap,z=new WeakMap,g=new WeakMap,m=new WeakMap,c=new WeakMap,r=new WeakMap,l=new WeakMap,A=new WeakSet,$=function(){t(this,l).calculate(),t(this,r).calculate(),t(this,c).calculate()},k=new WeakSet,et=function(){t(this,l).setStep("_size","+",{x:t(this,x)?t(this,y):1,y:t(this,x)?t(this,_):1,z:t(this,x)?t(this,E):1});const e=t(this,v)?t(this,P):0,s=t(this,v)?t(this,T):0,o=t(this,v)?t(this,B):0;t(this,r).setStep("_position","+",{x:e,y:s,z:o}),t(this,Z)?(t(this,l).setStep("_scale","*",{x:t(this,m).x,y:t(this,m).y,z:t(this,m).z}),t(this,r).setStep("_translation","+",{x:t(this,z).x,y:t(this,z).y,z:t(this,z).z}),t(this,c).setStep("_rotation","+",{x:t(this,g).x,y:t(this,g).y,z:t(this,g).z})):(t(this,l).setStep("_scale","*",{x:1,y:1,z:1}),t(this,r).setStep("_translation","+",{x:0,y:0,z:0}),t(this,c).setStep("_rotation","+",{x:0,y:0,z:0}))},D=new WeakSet,st=function(){const e=getComputedStyle(t(this,a));n(this,y,Math.max(t(this,a).clientWidth,1)),n(this,_,Math.max(t(this,a).clientHeight,1)),n(this,E,Math.max(ot.cssUnitParser.parse(e.getPropertyValue("--depth")||"0px"),1));const s=L.getCumulativeOffsetLeft(t(this,f)),o=L.getCumulativeOffsetTop(t(this,f)),X=t(this,f).clientWidth,Y=t(this,f).clientHeight;if(n(this,S,L.getCumulativeOffsetLeft(t(this,a))-s),n(this,d,L.getCumulativeOffsetTop(t(this,a))-o),t(this,M)==="z"){const C=t(this,S)/X,O=t(this,d)/Y;n(this,S,(C-Math.floor(C))*X),n(this,d,(O-Math.floor(O))*Y),t(this,H)==="left"?n(this,b,L.getCumulativeOffsetLeft(t(this,a))-s-t(this,S)):n(this,b,L.getCumulativeOffsetTop(t(this,a))-o-t(this,d))}if(n(this,S,t(this,S)+t(this,a).clientLeft),n(this,d,t(this,d)+t(this,a).clientTop),t(this,q)){const C=Math.round(X/2),O=Math.round(Y/2),ht=t(this,y)?Math.round(t(this,y)/2):0,nt=t(this,_)?Math.round(t(this,_)/2):0,rt=t(this,S)-C+ht,lt=(t(this,d)-O+nt)*-1;n(this,P,rt),n(this,T,lt)}else n(this,P,t(this,S)),n(this,T,t(this,d));n(this,B,t(this,b)*-1);const V=new WebKitCSSMatrix(e.transform),u=tt(V);t(this,z).x=u.translationX,t(this,z).y=u.translationY,t(this,z).z=u.translationZ,t(this,m).x=u.scaleX,t(this,m).y=u.scaleY,t(this,m).z=u.scaleZ,t(this,g).x=u.rotationX,t(this,g).y=u.rotationY,t(this,g).z=u.rotationZ,R(this,k,et).call(this),R(this,A,$).call(this)},U=new WeakSet,it=function(){for(let e=0;e<t(this,p).length;e++){const s=t(this,p)[e]();let o=s.axis;t(this,M)!=="auto"&&(o=t(this,M)),t(this,r).setStep(`_scroll_${e}`,"+",{[o]:s.value*(o==="x"?-1:t(this,q)?1:-1)})}},w=new WeakMap,W=new WeakMap;exports.LayoutBox=ct;exports.decomposeCSSMatrix=tt;
|