aptechka 0.47.0 → 0.47.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/device/Device.d.ts +0 -2
- package/lib/device/index.cjs +1 -1
- package/lib/device/index.js +52 -60
- package/package.json +8 -8
package/lib/device/Device.d.ts
CHANGED
package/lib/device/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var v=t=>{throw TypeError(t)};var E=(t,i,n)=>i.has(t)||v("Cannot "+n);var s=(t,i,n)=>(E(t,i,"read from private field"),n?n.call(t):i.get(t)),o=(t,i,n)=>i.has(t)?v("Cannot add the same private member more than once"):i instanceof WeakSet?i.add(t):i.set(t,n),e=(t,i,n,b)=>(E(t,i,"write to private field"),b?b.call(t,n):i.set(t,n),n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const P=require("../order/index.cjs"),S=require("../window-resizer/index.cjs"),W=require("../index-Cqw2NKev.cjs"),R=require("../Store-DRp_K37w.cjs");var r,d,a,l,m,c;class D{constructor(){o(this,r);o(this,d);o(this,a);o(this,l);o(this,m);o(this,c);var i,n;if(e(this,r,"unknown"),e(this,d,!1),e(this,a,!1),e(this,l,!1),e(this,m,!1),e(this,c,!1),this.resize=()=>{e(this,d,/Mobi|Android/i.test(navigator.userAgent)),e(this,a,"ontouchstart"in window||navigator.maxTouchPoints>0),setTimeout(()=>{e(this,a,"ontouchstart"in window||navigator.maxTouchPoints>0)},0)},W.isBrowser){this.resize(),S.windowResizer.subscribe(this.resize,P.RESIZE_ORDER.DEVICE);{const g=document.createElement("canvas"),f=g.getContext("webgl")||g.getContext("experimental-webgl");e(this,l,f&&f instanceof WebGLRenderingContext||!1)}{const g=document.createElement("canvas");g.getContext("2d")&&e(this,m,g.toDataURL("image/webp").indexOf("data:image/webp")==0)}const b=window.navigator.userAgent,p=((n=(i=window.navigator)==null?void 0:i.userAgentData)==null?void 0:n.platform)||window.navigator.platform,O=["Macintosh","MacIntel","MacPPC","Mac68K","macOS"],k=["Win32","Win64","Windows","WinCE"],C=["iPhone","iPad","iPod"];O.includes(p)?(e(this,r,"macOS"),e(this,c,!0)):C.includes(p)?(e(this,r,"iOS"),e(this,c,!0)):k.includes(p)?e(this,r,"Windows"):/Android/.test(b)?e(this,r,"Android"):/Linux/.test(p)?e(this,r,"Linux"):e(this,r,"unknown")}}get OS(){return s(this,r)}get isMobile(){return s(this,d)}get isTouch(){return s(this,a)}get isWebgl(){return s(this,l)}get isWebp(){return s(this,m)}get isApple(){return s(this,c)}}r=new WeakMap,d=new WeakMap,a=new WeakMap,l=new WeakMap,m=new WeakMap,c=new WeakMap;const M=new D;var z=(t=>(t.mobile="600px",t.tablet="1024px",t.notebook="1280px",t.desktop="1281px",t))(z||{}),A=(t=>(t["<=mobile"]="(max-width: 600px)",t[">=mobile"]="(min-width: 601px)",t["<=tablet"]="(max-width: 1024px)",t[">=tablet"]="(min-width: 1025px)",t["<=notebook"]="(max-width: 1280px)",t[">=notebook"]="(min-width: 1281px)",t["<=desktop"]="(max-width: 1280px)",t[">=desktop"]="(min-width: 1281px)",t))(A||{}),u,w,x,h;class T{constructor(){o(this,u);o(this,w);o(this,x);o(this,h);e(this,u,0),e(this,w,0),e(this,x,0),e(this,h,new R.Store(void 0)),this.resize=()=>{e(this,u,document.documentElement.clientWidth),e(this,w,innerHeight),e(this,x,devicePixelRatio),matchMedia("(max-width: 600px)").matches?s(this,h).current="mobile":matchMedia("(max-width: 1024px)").matches?s(this,h).current="tablet":matchMedia("(max-width: 1280px)").matches?s(this,h).current="notebook":matchMedia("(min-width: 1281px)").matches&&(s(this,h).current="desktop")},W.isBrowser&&(this.resize(),S.windowResizer.subscribe(this.resize,P.RESIZE_ORDER.DEVICE))}get width(){return s(this,u)}get height(){return s(this,w)}get type(){return s(this,h)}get pixelRatio(){return s(this,x)}}u=new WeakMap,w=new WeakMap,x=new WeakMap,h=new WeakMap;const I=new T;exports.ViewportBreakpoints=z;exports.ViewportMediaRules=A;exports.device=M;exports.viewport=I;
|
package/lib/device/index.js
CHANGED
|
@@ -1,116 +1,108 @@
|
|
|
1
|
-
var
|
|
1
|
+
var v = (t) => {
|
|
2
2
|
throw TypeError(t);
|
|
3
3
|
};
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
import { RESIZE_ORDER as
|
|
7
|
-
import { windowResizer as
|
|
8
|
-
import { i as
|
|
9
|
-
import { S as
|
|
10
|
-
var h,
|
|
11
|
-
class
|
|
4
|
+
var E = (t, e, n) => e.has(t) || v("Cannot " + n);
|
|
5
|
+
var s = (t, e, n) => (E(t, e, "read from private field"), n ? n.call(t) : e.get(t)), o = (t, e, n) => e.has(t) ? v("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), i = (t, e, n, f) => (E(t, e, "write to private field"), f ? f.call(t, n) : e.set(t, n), n);
|
|
6
|
+
import { RESIZE_ORDER as P } from "../order/index.js";
|
|
7
|
+
import { windowResizer as W } from "../window-resizer/index.js";
|
|
8
|
+
import { i as A } from "../index-euf5anj6.js";
|
|
9
|
+
import { S as z } from "../Store-D2xCXENW.js";
|
|
10
|
+
var h, m, r, d, l, c;
|
|
11
|
+
class O {
|
|
12
12
|
constructor() {
|
|
13
13
|
o(this, h);
|
|
14
|
-
o(this, w);
|
|
15
|
-
o(this, f);
|
|
16
14
|
o(this, m);
|
|
17
|
-
o(this,
|
|
15
|
+
o(this, r);
|
|
18
16
|
o(this, d);
|
|
19
17
|
o(this, l);
|
|
20
18
|
o(this, c);
|
|
21
|
-
var
|
|
22
|
-
if (i(this, h, "unknown"), i(this,
|
|
23
|
-
i(this, m, /Mobi|Android/i.test(navigator.userAgent)), i(this,
|
|
24
|
-
i(this,
|
|
19
|
+
var e, n;
|
|
20
|
+
if (i(this, h, "unknown"), i(this, m, !1), i(this, r, !1), i(this, d, !1), i(this, l, !1), i(this, c, !1), this.resize = () => {
|
|
21
|
+
i(this, m, /Mobi|Android/i.test(navigator.userAgent)), i(this, r, "ontouchstart" in window || navigator.maxTouchPoints > 0), setTimeout(() => {
|
|
22
|
+
i(this, r, "ontouchstart" in window || navigator.maxTouchPoints > 0);
|
|
25
23
|
}, 0);
|
|
26
|
-
},
|
|
27
|
-
this.resize(),
|
|
24
|
+
}, A) {
|
|
25
|
+
this.resize(), W.subscribe(this.resize, P.DEVICE);
|
|
28
26
|
{
|
|
29
|
-
const
|
|
30
|
-
i(this, d,
|
|
27
|
+
const w = document.createElement("canvas"), b = w.getContext("webgl") || w.getContext("experimental-webgl");
|
|
28
|
+
i(this, d, b && b instanceof WebGLRenderingContext || !1);
|
|
31
29
|
}
|
|
32
30
|
{
|
|
33
|
-
const
|
|
34
|
-
|
|
31
|
+
const w = document.createElement("canvas");
|
|
32
|
+
w.getContext("2d") && i(this, l, w.toDataURL("image/webp").indexOf("data:image/webp") == 0);
|
|
35
33
|
}
|
|
36
|
-
const
|
|
34
|
+
const f = window.navigator.userAgent, p = ((n = (e = window.navigator) == null ? void 0 : e.userAgentData) == null ? void 0 : n.platform) || window.navigator.platform, C = [
|
|
37
35
|
"Macintosh",
|
|
38
36
|
"MacIntel",
|
|
39
37
|
"MacPPC",
|
|
40
38
|
"Mac68K",
|
|
41
39
|
"macOS"
|
|
42
|
-
],
|
|
43
|
-
|
|
40
|
+
], S = ["Win32", "Win64", "Windows", "WinCE"], k = ["iPhone", "iPad", "iPod"];
|
|
41
|
+
C.includes(p) ? (i(this, h, "macOS"), i(this, c, !0)) : k.includes(p) ? (i(this, h, "iOS"), i(this, c, !0)) : S.includes(p) ? i(this, h, "Windows") : /Android/.test(f) ? i(this, h, "Android") : /Linux/.test(p) ? i(this, h, "Linux") : i(this, h, "unknown");
|
|
44
42
|
}
|
|
45
43
|
}
|
|
46
44
|
get OS() {
|
|
47
|
-
return
|
|
48
|
-
}
|
|
49
|
-
get gpu() {
|
|
50
|
-
return e(this, w);
|
|
51
|
-
}
|
|
52
|
-
get gpuTier() {
|
|
53
|
-
return e(this, f);
|
|
45
|
+
return s(this, h);
|
|
54
46
|
}
|
|
55
47
|
get isMobile() {
|
|
56
|
-
return
|
|
48
|
+
return s(this, m);
|
|
57
49
|
}
|
|
58
50
|
get isTouch() {
|
|
59
|
-
return
|
|
51
|
+
return s(this, r);
|
|
60
52
|
}
|
|
61
53
|
get isWebgl() {
|
|
62
|
-
return
|
|
54
|
+
return s(this, d);
|
|
63
55
|
}
|
|
64
56
|
get isWebp() {
|
|
65
|
-
return
|
|
57
|
+
return s(this, l);
|
|
66
58
|
}
|
|
67
59
|
get isApple() {
|
|
68
|
-
return
|
|
60
|
+
return s(this, c);
|
|
69
61
|
}
|
|
70
62
|
}
|
|
71
|
-
h = new WeakMap(),
|
|
72
|
-
const
|
|
73
|
-
var
|
|
74
|
-
class
|
|
63
|
+
h = new WeakMap(), m = new WeakMap(), r = new WeakMap(), d = new WeakMap(), l = new WeakMap(), c = new WeakMap();
|
|
64
|
+
const H = new O();
|
|
65
|
+
var D = /* @__PURE__ */ ((t) => (t.mobile = "600px", t.tablet = "1024px", t.notebook = "1280px", t.desktop = "1281px", t))(D || {}), T = /* @__PURE__ */ ((t) => (t["<=mobile"] = "(max-width: 600px)", t[">=mobile"] = "(min-width: 601px)", t["<=tablet"] = "(max-width: 1024px)", t[">=tablet"] = "(min-width: 1025px)", t["<=notebook"] = "(max-width: 1280px)", t[">=notebook"] = "(min-width: 1281px)", t["<=desktop"] = "(max-width: 1280px)", t[">=desktop"] = "(min-width: 1281px)", t))(T || {}), u, x, g, a;
|
|
66
|
+
class I {
|
|
75
67
|
constructor() {
|
|
76
68
|
o(this, u);
|
|
77
|
-
o(this, g);
|
|
78
69
|
o(this, x);
|
|
79
|
-
o(this,
|
|
80
|
-
|
|
81
|
-
|
|
70
|
+
o(this, g);
|
|
71
|
+
o(this, a);
|
|
72
|
+
i(this, u, 0), i(this, x, 0), i(this, g, 0), i(this, a, new z(void 0)), this.resize = () => {
|
|
73
|
+
i(this, u, document.documentElement.clientWidth), i(this, x, innerHeight), i(this, g, devicePixelRatio), matchMedia(
|
|
82
74
|
"(max-width: 600px)"
|
|
83
75
|
/* <=mobile */
|
|
84
|
-
).matches ?
|
|
76
|
+
).matches ? s(this, a).current = "mobile" : matchMedia(
|
|
85
77
|
"(max-width: 1024px)"
|
|
86
78
|
/* <=tablet */
|
|
87
|
-
).matches ?
|
|
79
|
+
).matches ? s(this, a).current = "tablet" : matchMedia(
|
|
88
80
|
"(max-width: 1280px)"
|
|
89
81
|
/* <=notebook */
|
|
90
|
-
).matches ?
|
|
82
|
+
).matches ? s(this, a).current = "notebook" : matchMedia(
|
|
91
83
|
"(min-width: 1281px)"
|
|
92
84
|
/* >=desktop */
|
|
93
|
-
).matches && (
|
|
94
|
-
},
|
|
85
|
+
).matches && (s(this, a).current = "desktop");
|
|
86
|
+
}, A && (this.resize(), W.subscribe(this.resize, P.DEVICE));
|
|
95
87
|
}
|
|
96
88
|
get width() {
|
|
97
|
-
return
|
|
89
|
+
return s(this, u);
|
|
98
90
|
}
|
|
99
91
|
get height() {
|
|
100
|
-
return
|
|
92
|
+
return s(this, x);
|
|
101
93
|
}
|
|
102
94
|
get type() {
|
|
103
|
-
return
|
|
95
|
+
return s(this, a);
|
|
104
96
|
}
|
|
105
97
|
get pixelRatio() {
|
|
106
|
-
return
|
|
98
|
+
return s(this, g);
|
|
107
99
|
}
|
|
108
100
|
}
|
|
109
|
-
u = new WeakMap(),
|
|
110
|
-
const
|
|
101
|
+
u = new WeakMap(), x = new WeakMap(), g = new WeakMap(), a = new WeakMap();
|
|
102
|
+
const K = new I();
|
|
111
103
|
export {
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
104
|
+
D as ViewportBreakpoints,
|
|
105
|
+
T as ViewportMediaRules,
|
|
106
|
+
H as device,
|
|
107
|
+
K as viewport
|
|
116
108
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aptechka",
|
|
3
|
-
"version": "0.47.
|
|
3
|
+
"version": "0.47.1",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/denisavitski/aptechka.git"
|
|
@@ -385,19 +385,19 @@
|
|
|
385
385
|
"dev": "vite --host --mode site"
|
|
386
386
|
},
|
|
387
387
|
"devDependencies": {
|
|
388
|
-
"@types/node": "^22.
|
|
389
|
-
"@types/three": "^0.
|
|
390
|
-
"tsx": "^4.19.
|
|
391
|
-
"vite": "^
|
|
392
|
-
"vite-plugin-dts": "^4.
|
|
388
|
+
"@types/node": "^22.10.1",
|
|
389
|
+
"@types/three": "^0.170.0",
|
|
390
|
+
"tsx": "^4.19.2",
|
|
391
|
+
"vite": "^6.0.1",
|
|
392
|
+
"vite-plugin-dts": "^4.3.0",
|
|
393
393
|
"vite-plugin-htmc": "0.1.15"
|
|
394
394
|
},
|
|
395
395
|
"dependencies": {
|
|
396
|
-
"three": "^0.
|
|
396
|
+
"three": "^0.170.0",
|
|
397
397
|
"urlpattern-polyfill": "^10.0.0"
|
|
398
398
|
},
|
|
399
399
|
"peerDependencies": {
|
|
400
|
-
"three": "^0.
|
|
400
|
+
"three": "^0.170.0",
|
|
401
401
|
"urlpattern-polyfill": "^10.0.0"
|
|
402
402
|
}
|
|
403
403
|
}
|