aptechka 0.20.0 → 0.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/Tweened-CDYmG9hk.js +138 -0
- package/lib/Tweened-DlyMbHu_.cjs +1 -0
- package/lib/animation/index.cjs +1 -1
- package/lib/animation/index.js +53 -6
- package/lib/controls/index.cjs +1 -1
- package/lib/controls/index.js +28 -26
- package/lib/order/index.cjs +1 -1
- package/lib/order/index.d.ts +14 -18
- package/lib/order/index.js +1 -1
- package/lib/utils/index.cjs +1 -1
- package/lib/utils/index.js +189 -171
- package/package.json +1 -17
- package/lib/Animation-CuR3fbKl.js +0 -104
- package/lib/Animation-Dt4Kc5VA.cjs +0 -1
- package/lib/Damped-C236fv4v.cjs +0 -1
- package/lib/Damped-OSAezqOR.js +0 -52
- package/lib/Tweened-B7zGiekd.cjs +0 -1
- package/lib/Tweened-DfDr-AYv.js +0 -43
- package/lib/coordinates-CgdGoSYs.js +0 -24
- package/lib/coordinates-D8Np3cPD.cjs +0 -1
- package/lib/pointer/Pointer.d.ts +0 -22
- package/lib/pointer/PointerElement.d.ts +0 -13
- package/lib/pointer/index.cjs +0 -1
- package/lib/pointer/index.d.ts +0 -2
- package/lib/pointer/index.js +0 -151
- package/lib/slicer/Letter.d.ts +0 -11
- package/lib/slicer/SlicerElement.d.ts +0 -20
- package/lib/slicer/Word.d.ts +0 -16
- package/lib/slicer/index.cjs +0 -11
- package/lib/slicer/index.d.ts +0 -3
- package/lib/slicer/index.js +0 -112
package/lib/Tweened-DfDr-AYv.js
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
var F = Object.defineProperty, o = Object.defineProperties;
|
|
2
|
-
var O = Object.getOwnPropertyDescriptors;
|
|
3
|
-
var u = Object.getOwnPropertySymbols;
|
|
4
|
-
var b = Object.prototype.hasOwnProperty, x = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var c = (t) => {
|
|
6
|
-
throw TypeError(t);
|
|
7
|
-
};
|
|
8
|
-
var l = (t, i, e) => i in t ? F(t, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[i] = e, d = (t, i) => {
|
|
9
|
-
for (var e in i || (i = {}))
|
|
10
|
-
b.call(i, e) && l(t, e, i[e]);
|
|
11
|
-
if (u)
|
|
12
|
-
for (var e of u(i))
|
|
13
|
-
x.call(i, e) && l(t, e, i[e]);
|
|
14
|
-
return t;
|
|
15
|
-
}, f = (t, i) => o(t, O(i));
|
|
16
|
-
var p = (t, i, e) => i.has(t) || c("Cannot " + e);
|
|
17
|
-
var n = (t, i, e) => (p(t, i, "read from private field"), e ? e.call(t) : i.get(t)), m = (t, i, e) => i.has(t) ? c("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(t) : i.set(t, e), h = (t, i, e, a) => (p(t, i, "write to private field"), a ? a.call(t, e) : i.set(t, e), e);
|
|
18
|
-
import { l as S } from "./easings-BKi40vHz.js";
|
|
19
|
-
import { n as A, c as T, p as q } from "./polyfills-AItxku8u.js";
|
|
20
|
-
import { A as w } from "./Animation-CuR3fbKl.js";
|
|
21
|
-
var s, r;
|
|
22
|
-
class j extends w {
|
|
23
|
-
constructor(e, a) {
|
|
24
|
-
super(e || 0, a);
|
|
25
|
-
m(this, s, S);
|
|
26
|
-
m(this, r, 1e3);
|
|
27
|
-
this.updateOptions(f(d({}, a), { equalize: !0 }));
|
|
28
|
-
}
|
|
29
|
-
updateOptions(e) {
|
|
30
|
-
super.updateOptions(e), h(this, s, A(e == null ? void 0 : e.easing, n(this, s))), h(this, r, A(e == null ? void 0 : e.duration, n(this, r)));
|
|
31
|
-
}
|
|
32
|
-
handleAnimationFrame(e) {
|
|
33
|
-
const a = e.timeElapsedSinceSubscription / 1e3 / (n(this, r) / 1e3), g = n(this, s).call(this, T(a, 0, 1));
|
|
34
|
-
this.current = q(this.from + (this.target - this.from) * g, 6), a > 1 && this.unlistenAnimationFrame();
|
|
35
|
-
}
|
|
36
|
-
start() {
|
|
37
|
-
this.unlistenAnimationFrame(), this.listenAnimationFrame();
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
s = new WeakMap(), r = new WeakMap();
|
|
41
|
-
export {
|
|
42
|
-
j as T
|
|
43
|
-
};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
function s(t, h, n = !1) {
|
|
2
|
-
let i = t.x - h.width / 2, g = h.height / 2 - t.y;
|
|
3
|
-
return n && (i = i / (h.width / 2), g = g / (h.height / 2)), { x: i, y: g };
|
|
4
|
-
}
|
|
5
|
-
function x(t, h) {
|
|
6
|
-
const n = t.x / h.width, i = t.y / h.height;
|
|
7
|
-
return { x: n, y: i };
|
|
8
|
-
}
|
|
9
|
-
function e(t, h) {
|
|
10
|
-
return h = h || {
|
|
11
|
-
x: 0,
|
|
12
|
-
y: 0,
|
|
13
|
-
width: document.documentElement.offsetWidth,
|
|
14
|
-
height: innerHeight
|
|
15
|
-
}, {
|
|
16
|
-
x: (t.x - h.x) / h.width * h.width,
|
|
17
|
-
y: (t.y - h.y) / h.height * h.height
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
export {
|
|
21
|
-
e as g,
|
|
22
|
-
x as n,
|
|
23
|
-
s
|
|
24
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";function o(t,i,n=!1){let h=t.x-i.width/2,e=i.height/2-t.y;return n&&(h=h/(i.width/2),e=e/(i.height/2)),{x:h,y:e}}function s(t,i){const n=t.x/i.width,h=t.y/i.height;return{x:n,y:h}}function g(t,i){return i=i||{x:0,y:0,width:document.documentElement.offsetWidth,height:innerHeight},{x:(t.x-i.x)/i.width*i.width,y:(t.y-i.y)/i.height*i.height}}exports.getPointerPosition=g;exports.normalize=s;exports.screenToCartesian=o;
|
package/lib/pointer/Pointer.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { Damped, DampedOptions } from '../animation';
|
|
2
|
-
import { ElementOrSelector } from '../utils';
|
|
3
|
-
export interface PointerParameters {
|
|
4
|
-
element: ElementOrSelector<HTMLElement>;
|
|
5
|
-
damped?: DampedOptions;
|
|
6
|
-
cartesian?: boolean;
|
|
7
|
-
normalize?: boolean;
|
|
8
|
-
}
|
|
9
|
-
export declare class Pointer {
|
|
10
|
-
#private;
|
|
11
|
-
constructor(parameters: PointerParameters);
|
|
12
|
-
get element(): HTMLElement;
|
|
13
|
-
get x(): Damped;
|
|
14
|
-
get y(): Damped;
|
|
15
|
-
get z(): Damped;
|
|
16
|
-
get cartesian(): boolean;
|
|
17
|
-
set cartesian(value: boolean);
|
|
18
|
-
get normalize(): boolean;
|
|
19
|
-
set normalize(value: boolean);
|
|
20
|
-
connect(): void;
|
|
21
|
-
disconnect(): void;
|
|
22
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Pointer } from './Pointer';
|
|
2
|
-
export declare class PointerElement extends HTMLElement {
|
|
3
|
-
#private;
|
|
4
|
-
constructor();
|
|
5
|
-
get pointer(): Pointer;
|
|
6
|
-
protected connectedCallback(): void;
|
|
7
|
-
protected disconnectedCallback(): void;
|
|
8
|
-
}
|
|
9
|
-
declare global {
|
|
10
|
-
interface HTMLElementTagNameMap {
|
|
11
|
-
'e-pointer': PointerElement;
|
|
12
|
-
}
|
|
13
|
-
}
|
package/lib/pointer/index.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var A=Object.defineProperty;var D=Object.getOwnPropertySymbols;var F=Object.prototype.hasOwnProperty,G=Object.prototype.propertyIsEnumerable;var T=i=>{throw TypeError(i)};var M=(i,s,t)=>s in i?A(i,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[s]=t,_=(i,s)=>{for(var t in s||(s={}))F.call(s,t)&&M(i,t,s[t]);if(D)for(var t of D(s))G.call(s,t)&&M(i,t,s[t]);return i};var k=(i,s,t)=>s.has(i)||T("Cannot "+t);var e=(i,s,t)=>(k(i,s,"read from private field"),t?t.call(i):s.get(i)),n=(i,s,t)=>s.has(i)?T("Cannot add the same private member more than once"):s instanceof WeakSet?s.add(i):s.set(i,t),c=(i,s,t,l)=>(k(i,s,"write to private field"),l?l.call(i,t):s.set(i,t),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../Store-CDb6RMce.cjs");const q=require("../coordinates-D8Np3cPD.cjs"),I=require("../dom-JBOkFLTh.cjs"),H=require("../polyfills-Caa6z-Ay.cjs");require("../ticker/index.cjs");const R=require("../Damped-C236fv4v.cjs"),j=require("../element-resizer/index.cjs"),B=require("../window-resizer/index.cjs"),P=require("../css-property/index.cjs");var o,m,a,y,d,u,b,x,f,w,C,p;class O{constructor(s){n(this,o);n(this,m);n(this,a);n(this,y);n(this,d);n(this,u);n(this,b,0);n(this,x,0);n(this,f,s=>{e(this,y).set(1)});n(this,w,s=>{e(this,y).set(0)});n(this,C,s=>{const t=q.getPointerPosition(s,e(this,o).getBoundingClientRect()),l={width:e(this,b),height:e(this,x)},h={x:t.x,y:t.y};if(e(this,d)){const z=q.screenToCartesian(h,l);h.x=z.x,h.y=z.y}if(e(this,u)){const z=q.normalize(h,l);h.x=H.clamp(z.x*2,-1,1),h.y=H.clamp(z.y*2,-1,1)}e(this,m).set(h.x),e(this,a).set(h.y)});n(this,p,()=>{c(this,b,this.element.clientWidth),c(this,x,this.element.clientHeight);let s=0,t=0,l=0,h=0;e(this,d)?e(this,u)?(s=-1,t=1,l=-1,h=1):(s=e(this,b)/2*-1,t=e(this,b)/2*1,l=e(this,x)/2*-1,h=e(this,x)/2*1):e(this,u)?(s=0,t=1,l=0,h=1):(s=0,t=e(this,b),l=0,h=e(this,x)),e(this,m).min=s,e(this,m).max=t,e(this,a).min=l,e(this,a).max=h});c(this,o,I.getElement(s.element)),c(this,m,new R.Damped(0,s.damped)),c(this,a,new R.Damped(0,s.damped)),c(this,y,new R.Damped(0,_({min:0,max:1},s.damped))),c(this,d,s.cartesian||!1),c(this,u,s.normalize||!1)}get element(){return e(this,o)}get x(){return e(this,m)}get y(){return e(this,a)}get z(){return e(this,y)}get cartesian(){return e(this,d)}set cartesian(s){c(this,d,s),e(this,p).call(this)}get normalize(){return e(this,u)}set normalize(s){c(this,u,s),e(this,p).call(this)}connect(){e(this,o).addEventListener("pointerenter",e(this,f)),e(this,o).addEventListener("pointerleave",e(this,w)),e(this,o).addEventListener("pointermove",e(this,C)),j.elementResizer.subscribe(e(this,o),e(this,p)),B.windowResizer.subscribe(e(this,p))}disconnect(){e(this,o).removeEventListener("pointerenter",e(this,f)),e(this,o).removeEventListener("pointerleave",e(this,w)),e(this,o).removeEventListener("pointermove",e(this,C)),j.elementResizer.unsubscribe(e(this,p)),B.windowResizer.unsubscribe(e(this,p)),e(this,m).reset(),e(this,a).reset(),e(this,y).reset()}}o=new WeakMap,m=new WeakMap,a=new WeakMap,y=new WeakMap,d=new WeakMap,u=new WeakMap,b=new WeakMap,x=new WeakMap,f=new WeakMap,w=new WeakMap,C=new WeakMap,p=new WeakMap;var r,g,v,S,E,L;class W extends HTMLElement{constructor(){super();n(this,r);n(this,g,new P.CSSProperty(this,"--damping",20));n(this,v,new P.CSSProperty(this,"--mass",0));n(this,S,new P.CSSProperty(this,"--stiffness",0));n(this,E,new P.CSSProperty(this,"--cartesian",!1));n(this,L,new P.CSSProperty(this,"--normalize",!1));c(this,r,new O({element:this})),e(this,g).subscribe(t=>{e(this,r).x.damping=t.current,e(this,r).y.damping=t.current,e(this,r).z.damping=t.current}),e(this,E).subscribe(t=>{e(this,r).cartesian=t.current}),e(this,L).subscribe(t=>{e(this,r).normalize=t.current}),e(this,v).subscribe(t=>{e(this,r).x.mass=t.current,e(this,r).y.mass=t.current,e(this,r).z.mass=t.current}),e(this,S).subscribe(t=>{e(this,r).x.stiffness=t.current,e(this,r).y.stiffness=t.current,e(this,r).z.stiffness=t.current}),e(this,r).x.subscribe(t=>{this.style.setProperty("--x",t.current.toString())}),e(this,r).y.subscribe(t=>{this.style.setProperty("--y",t.current.toString())}),e(this,r).z.subscribe(t=>{this.style.setProperty("--z",t.current.toString())})}get pointer(){return e(this,r)}connectedCallback(){e(this,r).connect(),e(this,g).observe(),e(this,v).observe(),e(this,S).observe()}disconnectedCallback(){e(this,r).disconnect(),e(this,g).unobserve(),e(this,v).unobserve(),e(this,S).unobserve(),this.style.removeProperty("--x"),this.style.removeProperty("--y"),this.style.removeProperty("--z")}}r=new WeakMap,g=new WeakMap,v=new WeakMap,S=new WeakMap,E=new WeakMap,L=new WeakMap;customElements.get("e-pointer")||customElements.define("e-pointer",W);exports.Pointer=O;exports.PointerElement=W;
|
package/lib/pointer/index.d.ts
DELETED
package/lib/pointer/index.js
DELETED
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
var q = Object.defineProperty;
|
|
2
|
-
var k = Object.getOwnPropertySymbols;
|
|
3
|
-
var A = Object.prototype.hasOwnProperty, F = Object.prototype.propertyIsEnumerable;
|
|
4
|
-
var H = (i) => {
|
|
5
|
-
throw TypeError(i);
|
|
6
|
-
};
|
|
7
|
-
var D = (i, s, e) => s in i ? q(i, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[s] = e, M = (i, s) => {
|
|
8
|
-
for (var e in s || (s = {}))
|
|
9
|
-
A.call(s, e) && D(i, e, s[e]);
|
|
10
|
-
if (k)
|
|
11
|
-
for (var e of k(s))
|
|
12
|
-
F.call(s, e) && D(i, e, s[e]);
|
|
13
|
-
return i;
|
|
14
|
-
};
|
|
15
|
-
var T = (i, s, e) => s.has(i) || H("Cannot " + e);
|
|
16
|
-
var t = (i, s, e) => (T(i, s, "read from private field"), e ? e.call(i) : s.get(i)), n = (i, s, e) => s.has(i) ? H("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(i) : s.set(i, e), c = (i, s, e, m) => (T(i, s, "write to private field"), m ? m.call(i, e) : s.set(i, e), e);
|
|
17
|
-
import "../Store-OTdcl6SX.js";
|
|
18
|
-
import { g as G, s as I, n as J } from "../coordinates-CgdGoSYs.js";
|
|
19
|
-
import { g as K } from "../dom-0S_WDL4g.js";
|
|
20
|
-
import { c as B } from "../polyfills-AItxku8u.js";
|
|
21
|
-
import "../ticker/index.js";
|
|
22
|
-
import { D as R } from "../Damped-OSAezqOR.js";
|
|
23
|
-
import { elementResizer as W } from "../element-resizer/index.js";
|
|
24
|
-
import { windowResizer as j } from "../window-resizer/index.js";
|
|
25
|
-
import { CSSProperty as P } from "../css-property/index.js";
|
|
26
|
-
var o, a, l, y, b, u, d, f, S, w, E, p;
|
|
27
|
-
class N {
|
|
28
|
-
constructor(s) {
|
|
29
|
-
n(this, o);
|
|
30
|
-
n(this, a);
|
|
31
|
-
n(this, l);
|
|
32
|
-
n(this, y);
|
|
33
|
-
n(this, b);
|
|
34
|
-
n(this, u);
|
|
35
|
-
n(this, d, 0);
|
|
36
|
-
n(this, f, 0);
|
|
37
|
-
n(this, S, (s) => {
|
|
38
|
-
t(this, y).set(1);
|
|
39
|
-
});
|
|
40
|
-
n(this, w, (s) => {
|
|
41
|
-
t(this, y).set(0);
|
|
42
|
-
});
|
|
43
|
-
n(this, E, (s) => {
|
|
44
|
-
const e = G(s, t(this, o).getBoundingClientRect()), m = {
|
|
45
|
-
width: t(this, d),
|
|
46
|
-
height: t(this, f)
|
|
47
|
-
}, h = {
|
|
48
|
-
x: e.x,
|
|
49
|
-
y: e.y
|
|
50
|
-
};
|
|
51
|
-
if (t(this, b)) {
|
|
52
|
-
const z = I(h, m);
|
|
53
|
-
h.x = z.x, h.y = z.y;
|
|
54
|
-
}
|
|
55
|
-
if (t(this, u)) {
|
|
56
|
-
const z = J(h, m);
|
|
57
|
-
h.x = B(z.x * 2, -1, 1), h.y = B(z.y * 2, -1, 1);
|
|
58
|
-
}
|
|
59
|
-
t(this, a).set(h.x), t(this, l).set(h.y);
|
|
60
|
-
});
|
|
61
|
-
n(this, p, () => {
|
|
62
|
-
c(this, d, this.element.clientWidth), c(this, f, this.element.clientHeight);
|
|
63
|
-
let s = 0, e = 0, m = 0, h = 0;
|
|
64
|
-
t(this, b) ? t(this, u) ? (s = -1, e = 1, m = -1, h = 1) : (s = t(this, d) / 2 * -1, e = t(this, d) / 2 * 1, m = t(this, f) / 2 * -1, h = t(this, f) / 2 * 1) : t(this, u) ? (s = 0, e = 1, m = 0, h = 1) : (s = 0, e = t(this, d), m = 0, h = t(this, f)), t(this, a).min = s, t(this, a).max = e, t(this, l).min = m, t(this, l).max = h;
|
|
65
|
-
});
|
|
66
|
-
c(this, o, K(s.element)), c(this, a, new R(0, s.damped)), c(this, l, new R(0, s.damped)), c(this, y, new R(0, M({ min: 0, max: 1 }, s.damped))), c(this, b, s.cartesian || !1), c(this, u, s.normalize || !1);
|
|
67
|
-
}
|
|
68
|
-
get element() {
|
|
69
|
-
return t(this, o);
|
|
70
|
-
}
|
|
71
|
-
get x() {
|
|
72
|
-
return t(this, a);
|
|
73
|
-
}
|
|
74
|
-
get y() {
|
|
75
|
-
return t(this, l);
|
|
76
|
-
}
|
|
77
|
-
get z() {
|
|
78
|
-
return t(this, y);
|
|
79
|
-
}
|
|
80
|
-
get cartesian() {
|
|
81
|
-
return t(this, b);
|
|
82
|
-
}
|
|
83
|
-
set cartesian(s) {
|
|
84
|
-
c(this, b, s), t(this, p).call(this);
|
|
85
|
-
}
|
|
86
|
-
get normalize() {
|
|
87
|
-
return t(this, u);
|
|
88
|
-
}
|
|
89
|
-
set normalize(s) {
|
|
90
|
-
c(this, u, s), t(this, p).call(this);
|
|
91
|
-
}
|
|
92
|
-
connect() {
|
|
93
|
-
t(this, o).addEventListener("pointerenter", t(this, S)), t(this, o).addEventListener("pointerleave", t(this, w)), t(this, o).addEventListener("pointermove", t(this, E)), W.subscribe(t(this, o), t(this, p)), j.subscribe(t(this, p));
|
|
94
|
-
}
|
|
95
|
-
disconnect() {
|
|
96
|
-
t(this, o).removeEventListener(
|
|
97
|
-
"pointerenter",
|
|
98
|
-
t(this, S)
|
|
99
|
-
), t(this, o).removeEventListener(
|
|
100
|
-
"pointerleave",
|
|
101
|
-
t(this, w)
|
|
102
|
-
), t(this, o).removeEventListener("pointermove", t(this, E)), W.unsubscribe(t(this, p)), j.unsubscribe(t(this, p)), t(this, a).reset(), t(this, l).reset(), t(this, y).reset();
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
o = new WeakMap(), a = new WeakMap(), l = new WeakMap(), y = new WeakMap(), b = new WeakMap(), u = new WeakMap(), d = new WeakMap(), f = new WeakMap(), S = new WeakMap(), w = new WeakMap(), E = new WeakMap(), p = new WeakMap();
|
|
106
|
-
var r, g, v, x, L, C;
|
|
107
|
-
class O extends HTMLElement {
|
|
108
|
-
constructor() {
|
|
109
|
-
super();
|
|
110
|
-
n(this, r);
|
|
111
|
-
n(this, g, new P(this, "--damping", 20));
|
|
112
|
-
n(this, v, new P(this, "--mass", 0));
|
|
113
|
-
n(this, x, new P(this, "--stiffness", 0));
|
|
114
|
-
n(this, L, new P(this, "--cartesian", !1));
|
|
115
|
-
n(this, C, new P(this, "--normalize", !1));
|
|
116
|
-
c(this, r, new N({
|
|
117
|
-
element: this
|
|
118
|
-
})), t(this, g).subscribe((e) => {
|
|
119
|
-
t(this, r).x.damping = e.current, t(this, r).y.damping = e.current, t(this, r).z.damping = e.current;
|
|
120
|
-
}), t(this, L).subscribe((e) => {
|
|
121
|
-
t(this, r).cartesian = e.current;
|
|
122
|
-
}), t(this, C).subscribe((e) => {
|
|
123
|
-
t(this, r).normalize = e.current;
|
|
124
|
-
}), t(this, v).subscribe((e) => {
|
|
125
|
-
t(this, r).x.mass = e.current, t(this, r).y.mass = e.current, t(this, r).z.mass = e.current;
|
|
126
|
-
}), t(this, x).subscribe((e) => {
|
|
127
|
-
t(this, r).x.stiffness = e.current, t(this, r).y.stiffness = e.current, t(this, r).z.stiffness = e.current;
|
|
128
|
-
}), t(this, r).x.subscribe((e) => {
|
|
129
|
-
this.style.setProperty("--x", e.current.toString());
|
|
130
|
-
}), t(this, r).y.subscribe((e) => {
|
|
131
|
-
this.style.setProperty("--y", e.current.toString());
|
|
132
|
-
}), t(this, r).z.subscribe((e) => {
|
|
133
|
-
this.style.setProperty("--z", e.current.toString());
|
|
134
|
-
});
|
|
135
|
-
}
|
|
136
|
-
get pointer() {
|
|
137
|
-
return t(this, r);
|
|
138
|
-
}
|
|
139
|
-
connectedCallback() {
|
|
140
|
-
t(this, r).connect(), t(this, g).observe(), t(this, v).observe(), t(this, x).observe();
|
|
141
|
-
}
|
|
142
|
-
disconnectedCallback() {
|
|
143
|
-
t(this, r).disconnect(), t(this, g).unobserve(), t(this, v).unobserve(), t(this, x).unobserve(), this.style.removeProperty("--x"), this.style.removeProperty("--y"), this.style.removeProperty("--z");
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
r = new WeakMap(), g = new WeakMap(), v = new WeakMap(), x = new WeakMap(), L = new WeakMap(), C = new WeakMap();
|
|
147
|
-
customElements.get("e-pointer") || customElements.define("e-pointer", O);
|
|
148
|
-
export {
|
|
149
|
-
N as Pointer,
|
|
150
|
-
O as PointerElement
|
|
151
|
-
};
|
package/lib/slicer/Letter.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { Word } from './Word.js';
|
|
2
|
-
import { Letter } from './Letter.js';
|
|
3
|
-
export interface SlicerParameters {
|
|
4
|
-
wordConstructor?: typeof Word;
|
|
5
|
-
letterConstructor?: typeof Letter;
|
|
6
|
-
}
|
|
7
|
-
export declare class SlicerElement extends HTMLElement {
|
|
8
|
-
#private;
|
|
9
|
-
constructor(parameters?: SlicerParameters);
|
|
10
|
-
get wordsArray(): Word[];
|
|
11
|
-
get lettersArray(): Letter[];
|
|
12
|
-
get originalText(): string;
|
|
13
|
-
protected connectedCallback(): void;
|
|
14
|
-
protected disconnectedCallback(): void;
|
|
15
|
-
}
|
|
16
|
-
declare global {
|
|
17
|
-
interface HTMLElementTagNameMap {
|
|
18
|
-
'e-slicer': SlicerElement;
|
|
19
|
-
}
|
|
20
|
-
}
|
package/lib/slicer/Word.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Letter } from './Letter';
|
|
2
|
-
export interface WordParameters {
|
|
3
|
-
index: number;
|
|
4
|
-
text: string;
|
|
5
|
-
letters?: boolean;
|
|
6
|
-
lettersAcc?: number;
|
|
7
|
-
letterConstructor?: typeof Letter;
|
|
8
|
-
clone?: boolean;
|
|
9
|
-
}
|
|
10
|
-
export declare class Word {
|
|
11
|
-
#private;
|
|
12
|
-
constructor(parameters: WordParameters);
|
|
13
|
-
get index(): number;
|
|
14
|
-
get element(): HTMLSpanElement;
|
|
15
|
-
get letters(): Letter[];
|
|
16
|
-
}
|
package/lib/slicer/index.cjs
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";var L=n=>{throw TypeError(n)};var w=(n,t,s)=>t.has(n)||L("Cannot "+s);var e=(n,t,s)=>(w(n,t,"read from private field"),s?s.call(n):t.get(n)),l=(n,t,s)=>t.has(n)?L("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(n):t.set(n,s),i=(n,t,s,d)=>(w(n,t,"write to private field"),d?d.call(n,s):t.set(n,s),s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var a,h,u;class T{constructor(t){l(this,a);l(this,h);l(this,u);i(this,a,t.index),i(this,h,document.createElement("span")),i(this,u,[]),t.letters&&t.letterConstructor&&t.lettersAcc!==void 0?(i(this,u,t.text.split("").map((s,d)=>new t.letterConstructor({index:t.lettersAcc+d,text:s,clone:t.clone}))),e(this,h).append(...e(this,u).map(s=>s.element))):t.clone?e(this,h).innerHTML=`
|
|
2
|
-
<span class="original">${t.text}</span>
|
|
3
|
-
<span class="clone" aria-hidden>${t.text}</span>
|
|
4
|
-
`:e(this,h).innerHTML=`
|
|
5
|
-
<span class="value">${t.text}</span>
|
|
6
|
-
`,e(this,h).classList.add("word")}get index(){return e(this,a)}get element(){return e(this,h)}get letters(){return e(this,u)}}a=new WeakMap,h=new WeakMap,u=new WeakMap;var p,c;class b{constructor(t){l(this,p);l(this,c);i(this,p,t.index),i(this,c,document.createElement("span")),e(this,c).classList.add("letter"),t.clone?e(this,c).innerHTML=`
|
|
7
|
-
<span class="original">${t.text}</span>
|
|
8
|
-
<span class="clone" aria-hidden>${t.text}</span>
|
|
9
|
-
`:e(this,c).innerHTML=`
|
|
10
|
-
<span class="value">${t.text}</span>
|
|
11
|
-
`}get index(){return e(this,p)}get element(){return e(this,c)}}p=new WeakMap,c=new WeakMap;var g,r,x,C,f;class A extends HTMLElement{constructor(s){super();l(this,g,"");l(this,r,[]);l(this,x,[]);l(this,C);l(this,f);i(this,C,(s==null?void 0:s.wordConstructor)||T),i(this,f,(s==null?void 0:s.letterConstructor)||b)}get wordsArray(){return e(this,r)}get lettersArray(){return e(this,x)}get originalText(){return e(this,g)}connectedCallback(){var d;i(this,g,((d=this.textContent)==null?void 0:d.trim())||""),this.innerHTML="";let s=0;i(this,r,e(this,g).replace(/ +/g," ").split(" ").map((o,E)=>{const y=new(e(this,C))({index:E,text:o,letters:this.hasAttribute("letters"),lettersAcc:s,letterConstructor:e(this,f),clone:this.hasAttribute("clone")});return s+=y.letters.length,e(this,x).push(...y.letters),y})),this.hasAttribute("index")&&(e(this,r).forEach(o=>{o.element.style.setProperty("--word-index",o.index.toString())}),e(this,x).forEach(o=>{o.element.style.setProperty("--letter-index",o.index.toString())})),e(this,r).forEach((o,E)=>{if(this.appendChild(o.element),E!==e(this,r).length-1){const y=document.createElement("span");y.innerHTML=" ",this.appendChild(y)}}),this.style.setProperty("--words-length",e(this,r).length.toString()),this.style.setProperty("--letters-length",e(this,x).length.toString())}disconnectedCallback(){i(this,r,[]),this.textContent=e(this,g),this.style.removeProperty("--words-length"),this.style.removeProperty("--letters-length")}}g=new WeakMap,r=new WeakMap,x=new WeakMap,C=new WeakMap,f=new WeakMap;customElements.get("e-slicer")||customElements.define("e-slicer",A);exports.Letter=b;exports.SlicerElement=A;exports.Word=T;
|
package/lib/slicer/index.d.ts
DELETED
package/lib/slicer/index.js
DELETED
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
var E = (n) => {
|
|
2
|
-
throw TypeError(n);
|
|
3
|
-
};
|
|
4
|
-
var L = (n, t, s) => t.has(n) || E("Cannot " + s);
|
|
5
|
-
var e = (n, t, s) => (L(n, t, "read from private field"), s ? s.call(n) : t.get(n)), l = (n, t, s) => t.has(n) ? E("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(n) : t.set(n, s), i = (n, t, s, d) => (L(n, t, "write to private field"), d ? d.call(n, s) : t.set(n, s), s);
|
|
6
|
-
var y, o, u;
|
|
7
|
-
class T {
|
|
8
|
-
constructor(t) {
|
|
9
|
-
l(this, y);
|
|
10
|
-
l(this, o);
|
|
11
|
-
l(this, u);
|
|
12
|
-
i(this, y, t.index), i(this, o, document.createElement("span")), i(this, u, []), t.letters && t.letterConstructor && t.lettersAcc !== void 0 ? (i(this, u, t.text.split("").map((s, d) => new t.letterConstructor({
|
|
13
|
-
index: t.lettersAcc + d,
|
|
14
|
-
text: s,
|
|
15
|
-
clone: t.clone
|
|
16
|
-
}))), e(this, o).append(...e(this, u).map((s) => s.element))) : t.clone ? e(this, o).innerHTML = `
|
|
17
|
-
<span class="original">${t.text}</span>
|
|
18
|
-
<span class="clone" aria-hidden>${t.text}</span>
|
|
19
|
-
` : e(this, o).innerHTML = `
|
|
20
|
-
<span class="value">${t.text}</span>
|
|
21
|
-
`, e(this, o).classList.add("word");
|
|
22
|
-
}
|
|
23
|
-
get index() {
|
|
24
|
-
return e(this, y);
|
|
25
|
-
}
|
|
26
|
-
get element() {
|
|
27
|
-
return e(this, o);
|
|
28
|
-
}
|
|
29
|
-
get letters() {
|
|
30
|
-
return e(this, u);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
y = new WeakMap(), o = new WeakMap(), u = new WeakMap();
|
|
34
|
-
var a, c;
|
|
35
|
-
class A {
|
|
36
|
-
constructor(t) {
|
|
37
|
-
l(this, a);
|
|
38
|
-
l(this, c);
|
|
39
|
-
i(this, a, t.index), i(this, c, document.createElement("span")), e(this, c).classList.add("letter"), t.clone ? e(this, c).innerHTML = `
|
|
40
|
-
<span class="original">${t.text}</span>
|
|
41
|
-
<span class="clone" aria-hidden>${t.text}</span>
|
|
42
|
-
` : e(this, c).innerHTML = `
|
|
43
|
-
<span class="value">${t.text}</span>
|
|
44
|
-
`;
|
|
45
|
-
}
|
|
46
|
-
get index() {
|
|
47
|
-
return e(this, a);
|
|
48
|
-
}
|
|
49
|
-
get element() {
|
|
50
|
-
return e(this, c);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
a = new WeakMap(), c = new WeakMap();
|
|
54
|
-
var g, r, x, C, f;
|
|
55
|
-
class H extends HTMLElement {
|
|
56
|
-
constructor(s) {
|
|
57
|
-
super();
|
|
58
|
-
l(this, g, "");
|
|
59
|
-
l(this, r, []);
|
|
60
|
-
l(this, x, []);
|
|
61
|
-
l(this, C);
|
|
62
|
-
l(this, f);
|
|
63
|
-
i(this, C, (s == null ? void 0 : s.wordConstructor) || T), i(this, f, (s == null ? void 0 : s.letterConstructor) || A);
|
|
64
|
-
}
|
|
65
|
-
get wordsArray() {
|
|
66
|
-
return e(this, r);
|
|
67
|
-
}
|
|
68
|
-
get lettersArray() {
|
|
69
|
-
return e(this, x);
|
|
70
|
-
}
|
|
71
|
-
get originalText() {
|
|
72
|
-
return e(this, g);
|
|
73
|
-
}
|
|
74
|
-
connectedCallback() {
|
|
75
|
-
var d;
|
|
76
|
-
i(this, g, ((d = this.textContent) == null ? void 0 : d.trim()) || ""), this.innerHTML = "";
|
|
77
|
-
let s = 0;
|
|
78
|
-
i(this, r, e(this, g).replace(/ +/g, " ").split(" ").map((h, w) => {
|
|
79
|
-
const p = new (e(this, C))({
|
|
80
|
-
index: w,
|
|
81
|
-
text: h,
|
|
82
|
-
letters: this.hasAttribute("letters"),
|
|
83
|
-
lettersAcc: s,
|
|
84
|
-
letterConstructor: e(this, f),
|
|
85
|
-
clone: this.hasAttribute("clone")
|
|
86
|
-
});
|
|
87
|
-
return s += p.letters.length, e(this, x).push(...p.letters), p;
|
|
88
|
-
})), this.hasAttribute("index") && (e(this, r).forEach((h) => {
|
|
89
|
-
h.element.style.setProperty("--word-index", h.index.toString());
|
|
90
|
-
}), e(this, x).forEach((h) => {
|
|
91
|
-
h.element.style.setProperty(
|
|
92
|
-
"--letter-index",
|
|
93
|
-
h.index.toString()
|
|
94
|
-
);
|
|
95
|
-
})), e(this, r).forEach((h, w) => {
|
|
96
|
-
if (this.appendChild(h.element), w !== e(this, r).length - 1) {
|
|
97
|
-
const p = document.createElement("span");
|
|
98
|
-
p.innerHTML = " ", this.appendChild(p);
|
|
99
|
-
}
|
|
100
|
-
}), this.style.setProperty("--words-length", e(this, r).length.toString()), this.style.setProperty("--letters-length", e(this, x).length.toString());
|
|
101
|
-
}
|
|
102
|
-
disconnectedCallback() {
|
|
103
|
-
i(this, r, []), this.textContent = e(this, g), this.style.removeProperty("--words-length"), this.style.removeProperty("--letters-length");
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
g = new WeakMap(), r = new WeakMap(), x = new WeakMap(), C = new WeakMap(), f = new WeakMap();
|
|
107
|
-
customElements.get("e-slicer") || customElements.define("e-slicer", H);
|
|
108
|
-
export {
|
|
109
|
-
A as Letter,
|
|
110
|
-
H as SlicerElement,
|
|
111
|
-
T as Word
|
|
112
|
-
};
|