aptechka 0.29.8 → 0.29.9

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.
@@ -1,11 +1,11 @@
1
- "use strict";var f=s=>{throw TypeError(s)};var E=(s,t,n)=>t.has(s)||f("Cannot "+n);var e=(s,t,n)=>(E(s,t,"read from private field"),n?n.call(s):t.get(s)),h=(s,t,n)=>t.has(s)?f("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(s):t.set(s,n),i=(s,t,n,d)=>(E(s,t,"write to private field"),d?d.call(s,n):t.set(s,n),n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var p,o;class L{constructor(t){h(this,p);h(this,o);i(this,p,t.index),i(this,o,document.createElement("span")),e(this,o).classList.add("letter"),t.clone?e(this,o).innerHTML=`
1
+ "use strict";var T=i=>{throw TypeError(i)};var E=(i,t,s)=>t.has(i)||T("Cannot "+s);var e=(i,t,s)=>(E(i,t,"read from private field"),s?s.call(i):t.get(i)),l=(i,t,s)=>t.has(i)?T("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(i):t.set(i,s),r=(i,t,s,n)=>(E(i,t,"write to private field"),n?n.call(i,s):t.set(i,s),s),m=(i,t,s)=>(E(i,t,"access private method"),s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("../media/index.cjs");var y,o;class w{constructor(t){l(this,y);l(this,o);r(this,y,t.index),r(this,o,document.createElement("span")),e(this,o).classList.add("letter"),t.clone?e(this,o).innerHTML=`
2
2
  <span class="original">${t.text}</span>
3
3
  <span class="clone" aria-hidden>${t.text}</span>
4
4
  `:e(this,o).innerHTML=`
5
5
  <span class="value">${t.text}</span>
6
- `}get index(){return e(this,p)}get element(){return e(this,o)}}p=new WeakMap,o=new WeakMap;var y,c,a;class T{constructor(t){h(this,y);h(this,c);h(this,a);i(this,y,t.index),i(this,c,document.createElement("span")),i(this,a,[]),t.letters&&t.lettersAcc!==void 0?(i(this,a,t.text.split("").map((n,d)=>new L({index:t.lettersAcc+d,text:n,clone:t.clone}))),e(this,c).append(...e(this,a).map(n=>n.element))):t.clone?e(this,c).innerHTML=`
6
+ `}get index(){return e(this,y)}get element(){return e(this,o)}}y=new WeakMap,o=new WeakMap;var f,c,a;class M{constructor(t){l(this,f);l(this,c);l(this,a);r(this,f,t.index),r(this,c,document.createElement("span")),r(this,a,[]),t.letters&&t.lettersAcc!==void 0?(r(this,a,t.text.split("").map((s,n)=>new w({index:t.lettersAcc+n,text:s,clone:t.clone}))),e(this,c).append(...e(this,a).map(s=>s.element))):t.clone?e(this,c).innerHTML=`
7
7
  <span class="original">${t.text}</span>
8
8
  <span class="clone" aria-hidden>${t.text}</span>
9
9
  `:e(this,c).innerHTML=`
10
10
  <span class="value">${t.text}</span>
11
- `,e(this,c).classList.add("word")}get index(){return e(this,y)}get element(){return e(this,c)}get letters(){return e(this,a)}}y=new WeakMap,c=new WeakMap,a=new WeakMap;var g,l,u;class b extends HTMLElement{constructor(){super(...arguments);h(this,g,"");h(this,l,[]);h(this,u,[])}get wordsArray(){return e(this,l)}get lettersArray(){return e(this,u)}get originalText(){return e(this,g)}connectedCallback(){var d;i(this,g,((d=this.textContent)==null?void 0:d.trim())||""),this.innerHTML="";let n=0;i(this,l,e(this,g).replace(/ +/g," ").split(" ").map((r,m)=>{const x=new T({index:m,text:r,letters:this.hasAttribute("letters"),lettersAcc:n,clone:this.hasAttribute("clone")});return n+=x.letters.length,e(this,u).push(...x.letters),x})),this.hasAttribute("index")&&(e(this,l).forEach(r=>{r.element.style.setProperty("--word-index",r.index.toString())}),e(this,u).forEach(r=>{r.element.style.setProperty("--letter-index",r.index.toString())})),e(this,l).forEach((r,m)=>{if(this.appendChild(r.element),m!==e(this,l).length-1){const x=document.createElement("span");x.innerHTML="&nbsp;",this.appendChild(x)}}),this.style.setProperty("--words-length",e(this,l).length.toString()),this.style.setProperty("--letters-length",e(this,u).length.toString())}disconnectedCallback(){i(this,l,[]),this.textContent=e(this,g),this.style.removeProperty("--words-length"),this.style.removeProperty("--letters-length")}}g=new WeakMap,l=new WeakMap,u=new WeakMap;customElements.get("e-slicer")||customElements.define("e-slicer",b);exports.Letter=L;exports.SlicerElement=b;exports.Word=T;
11
+ `,e(this,c).classList.add("word")}get index(){return e(this,f)}get element(){return e(this,c)}get letters(){return e(this,a)}}f=new WeakMap,c=new WeakMap,a=new WeakMap;var u,h,g,x,d,L,A;class S extends HTMLElement{constructor(){super(...arguments);l(this,d);l(this,u,"");l(this,h,[]);l(this,g,[]);l(this,x,null)}get wordsArray(){return e(this,h)}get lettersArray(){return e(this,g)}get originalText(){return e(this,u)}connectedCallback(){var s;r(this,u,((s=this.textContent)==null?void 0:s.trim())||""),this.hasAttribute("media")?(r(this,x,new v.Media(this.getAttribute("media"))),e(this,x).subscribe(n=>{n.current?m(this,d,L).call(this):!n.current&&n.previous&&m(this,d,A).call(this)})):m(this,d,L).call(this)}disconnectedCallback(){var s;m(this,d,A).call(this),(s=e(this,x))==null||s.close()}}u=new WeakMap,h=new WeakMap,g=new WeakMap,x=new WeakMap,d=new WeakSet,L=function(){this.innerHTML="";let s=0;r(this,h,e(this,u).replace(/ +/g," ").split(" ").map((n,b)=>{const p=new M({index:b,text:n,letters:this.hasAttribute("letters"),lettersAcc:s,clone:this.hasAttribute("clone")});return s+=p.letters.length,e(this,g).push(...p.letters),p})),this.hasAttribute("index")&&(e(this,h).forEach(n=>{n.element.style.setProperty("--word-index",n.index.toString())}),e(this,g).forEach(n=>{n.element.style.setProperty("--letter-index",n.index.toString())})),e(this,h).forEach((n,b)=>{if(this.appendChild(n.element),b!==e(this,h).length-1){const p=document.createElement("span");p.innerHTML="&nbsp;",this.appendChild(p)}}),this.style.setProperty("--words-length",e(this,h).length.toString()),this.style.setProperty("--letters-length",e(this,g).length.toString())},A=function(){r(this,h,[]),this.textContent=e(this,u),this.style.removeProperty("--words-length"),this.style.removeProperty("--letters-length")};customElements.get("e-slicer")||customElements.define("e-slicer",S);exports.Letter=w;exports.SlicerElement=S;exports.Word=M;
@@ -1,14 +1,15 @@
1
- var f = (s) => {
2
- throw TypeError(s);
1
+ var w = (i) => {
2
+ throw TypeError(i);
3
3
  };
4
- var E = (s, t, n) => t.has(s) || f("Cannot " + n);
5
- var e = (s, t, n) => (E(s, t, "read from private field"), n ? n.call(s) : t.get(s)), h = (s, t, n) => t.has(s) ? f("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(s) : t.set(s, n), i = (s, t, n, d) => (E(s, t, "write to private field"), d ? d.call(s, n) : t.set(s, n), n);
6
- var u, o;
7
- class L {
4
+ var A = (i, t, s) => t.has(i) || w("Cannot " + s);
5
+ var e = (i, t, s) => (A(i, t, "read from private field"), s ? s.call(i) : t.get(i)), l = (i, t, s) => t.has(i) ? w("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(i) : t.set(i, s), r = (i, t, s, n) => (A(i, t, "write to private field"), n ? n.call(i, s) : t.set(i, s), s), m = (i, t, s) => (A(i, t, "access private method"), s);
6
+ import { Media as T } from "../media/index.js";
7
+ var f, o;
8
+ class M {
8
9
  constructor(t) {
9
- h(this, u);
10
- h(this, o);
11
- i(this, u, t.index), i(this, o, document.createElement("span")), e(this, o).classList.add("letter"), t.clone ? e(this, o).innerHTML = `
10
+ l(this, f);
11
+ l(this, o);
12
+ r(this, f, t.index), r(this, o, document.createElement("span")), e(this, o).classList.add("letter"), t.clone ? e(this, o).innerHTML = `
12
13
  <span class="original">${t.text}</span>
13
14
  <span class="clone" aria-hidden>${t.text}</span>
14
15
  ` : e(this, o).innerHTML = `
@@ -16,24 +17,24 @@ class L {
16
17
  `;
17
18
  }
18
19
  get index() {
19
- return e(this, u);
20
+ return e(this, f);
20
21
  }
21
22
  get element() {
22
23
  return e(this, o);
23
24
  }
24
25
  }
25
- u = new WeakMap(), o = new WeakMap();
26
+ f = new WeakMap(), o = new WeakMap();
26
27
  var y, c, a;
27
- class T {
28
+ class H {
28
29
  constructor(t) {
29
- h(this, y);
30
- h(this, c);
31
- h(this, a);
32
- i(this, y, t.index), i(this, c, document.createElement("span")), i(this, a, []), t.letters && t.lettersAcc !== void 0 ? (i(this, a, t.text.split("").map((n, d) => new L({
33
- index: t.lettersAcc + d,
34
- text: n,
30
+ l(this, y);
31
+ l(this, c);
32
+ l(this, a);
33
+ r(this, y, t.index), r(this, c, document.createElement("span")), r(this, a, []), t.letters && t.lettersAcc !== void 0 ? (r(this, a, t.text.split("").map((s, n) => new M({
34
+ index: t.lettersAcc + n,
35
+ text: s,
35
36
  clone: t.clone
36
- }))), e(this, c).append(...e(this, a).map((n) => n.element))) : t.clone ? e(this, c).innerHTML = `
37
+ }))), e(this, c).append(...e(this, a).map((s) => s.element))) : t.clone ? e(this, c).innerHTML = `
37
38
  <span class="original">${t.text}</span>
38
39
  <span class="clone" aria-hidden>${t.text}</span>
39
40
  ` : e(this, c).innerHTML = `
@@ -51,58 +52,67 @@ class T {
51
52
  }
52
53
  }
53
54
  y = new WeakMap(), c = new WeakMap(), a = new WeakMap();
54
- var g, l, x;
55
- class w extends HTMLElement {
55
+ var u, h, p, x, d, E, L;
56
+ class v extends HTMLElement {
56
57
  constructor() {
57
58
  super(...arguments);
58
- h(this, g, "");
59
- h(this, l, []);
60
- h(this, x, []);
59
+ l(this, d);
60
+ l(this, u, "");
61
+ l(this, h, []);
62
+ l(this, p, []);
63
+ l(this, x, null);
61
64
  }
62
65
  get wordsArray() {
63
- return e(this, l);
66
+ return e(this, h);
64
67
  }
65
68
  get lettersArray() {
66
- return e(this, x);
69
+ return e(this, p);
67
70
  }
68
71
  get originalText() {
69
- return e(this, g);
72
+ return e(this, u);
70
73
  }
71
74
  connectedCallback() {
72
- var d;
73
- i(this, g, ((d = this.textContent) == null ? void 0 : d.trim()) || ""), this.innerHTML = "";
74
- let n = 0;
75
- i(this, l, e(this, g).replace(/ +/g, " ").split(" ").map((r, m) => {
76
- const p = new T({
77
- index: m,
78
- text: r,
79
- letters: this.hasAttribute("letters"),
80
- lettersAcc: n,
81
- clone: this.hasAttribute("clone")
82
- });
83
- return n += p.letters.length, e(this, x).push(...p.letters), p;
84
- })), this.hasAttribute("index") && (e(this, l).forEach((r) => {
85
- r.element.style.setProperty("--word-index", r.index.toString());
86
- }), e(this, x).forEach((r) => {
87
- r.element.style.setProperty(
88
- "--letter-index",
89
- r.index.toString()
90
- );
91
- })), e(this, l).forEach((r, m) => {
92
- if (this.appendChild(r.element), m !== e(this, l).length - 1) {
93
- const p = document.createElement("span");
94
- p.innerHTML = "&nbsp;", this.appendChild(p);
95
- }
96
- }), this.style.setProperty("--words-length", e(this, l).length.toString()), this.style.setProperty("--letters-length", e(this, x).length.toString());
75
+ var s;
76
+ r(this, u, ((s = this.textContent) == null ? void 0 : s.trim()) || ""), this.hasAttribute("media") ? (r(this, x, new T(this.getAttribute("media"))), e(this, x).subscribe((n) => {
77
+ n.current ? m(this, d, E).call(this) : !n.current && n.previous && m(this, d, L).call(this);
78
+ })) : m(this, d, E).call(this);
97
79
  }
98
80
  disconnectedCallback() {
99
- i(this, l, []), this.textContent = e(this, g), this.style.removeProperty("--words-length"), this.style.removeProperty("--letters-length");
81
+ var s;
82
+ m(this, d, L).call(this), (s = e(this, x)) == null || s.close();
100
83
  }
101
84
  }
102
- g = new WeakMap(), l = new WeakMap(), x = new WeakMap();
103
- customElements.get("e-slicer") || customElements.define("e-slicer", w);
85
+ u = new WeakMap(), h = new WeakMap(), p = new WeakMap(), x = new WeakMap(), d = new WeakSet(), E = function() {
86
+ this.innerHTML = "";
87
+ let s = 0;
88
+ r(this, h, e(this, u).replace(/ +/g, " ").split(" ").map((n, b) => {
89
+ const g = new H({
90
+ index: b,
91
+ text: n,
92
+ letters: this.hasAttribute("letters"),
93
+ lettersAcc: s,
94
+ clone: this.hasAttribute("clone")
95
+ });
96
+ return s += g.letters.length, e(this, p).push(...g.letters), g;
97
+ })), this.hasAttribute("index") && (e(this, h).forEach((n) => {
98
+ n.element.style.setProperty("--word-index", n.index.toString());
99
+ }), e(this, p).forEach((n) => {
100
+ n.element.style.setProperty(
101
+ "--letter-index",
102
+ n.index.toString()
103
+ );
104
+ })), e(this, h).forEach((n, b) => {
105
+ if (this.appendChild(n.element), b !== e(this, h).length - 1) {
106
+ const g = document.createElement("span");
107
+ g.innerHTML = "&nbsp;", this.appendChild(g);
108
+ }
109
+ }), this.style.setProperty("--words-length", e(this, h).length.toString()), this.style.setProperty("--letters-length", e(this, p).length.toString());
110
+ }, L = function() {
111
+ r(this, h, []), this.textContent = e(this, u), this.style.removeProperty("--words-length"), this.style.removeProperty("--letters-length");
112
+ };
113
+ customElements.get("e-slicer") || customElements.define("e-slicer", v);
104
114
  export {
105
- L as Letter,
106
- w as SlicerElement,
107
- T as Word
115
+ M as Letter,
116
+ v as SlicerElement,
117
+ H as Word
108
118
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aptechka",
3
- "version": "0.29.8",
3
+ "version": "0.29.9",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/denisavitski/aptechka.git"