aptechka 0.1.1 → 0.1.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.
Files changed (296) hide show
  1. package/lib/Damped-1hlKSFaB.cjs +1 -0
  2. package/lib/Damped-523xgzT3.js +152 -0
  3. package/lib/SourceManager-3c3kr7oj.cjs +1 -0
  4. package/lib/SourceManager-F94MRde6.js +108 -0
  5. package/lib/Store-2hWEUGTj.js +135 -0
  6. package/lib/Store-WXFmsaEI.cjs +1 -0
  7. package/lib/WheelControls-F-xg5-oq.js +102 -0
  8. package/lib/WheelControls-Hp5NWRZY.cjs +1 -0
  9. package/lib/animation/Animated.d.ts +41 -0
  10. package/lib/animation/Damped.d.ts +11 -0
  11. package/lib/animation/Tweened.d.ts +16 -0
  12. package/lib/animation/index.cjs +1 -0
  13. package/lib/animation/index.d.ts +3 -0
  14. package/lib/animation/index.js +56 -0
  15. package/lib/attribute/index.cjs +1 -0
  16. package/lib/attribute/index.d.ts +8 -0
  17. package/lib/attribute/index.js +47 -0
  18. package/lib/attributes-_2U65GDl.cjs +1 -0
  19. package/lib/attributes-w0u-KiIb.js +10 -0
  20. package/lib/browser-QbF6EW-w.cjs +1 -0
  21. package/lib/browser-S4eq8AeN.js +4 -0
  22. package/lib/canvas-2d/index.cjs +5 -0
  23. package/lib/canvas-2d/index.d.ts +30 -0
  24. package/lib/canvas-2d/index.js +90 -0
  25. package/lib/controls/Controls.d.ts +9 -0
  26. package/lib/controls/KeyboardControls.d.ts +10 -0
  27. package/lib/controls/LinearControls.d.ts +11 -0
  28. package/lib/controls/User.d.ts +7 -0
  29. package/lib/controls/WheelControls.d.ts +17 -0
  30. package/lib/controls/index.cjs +1 -0
  31. package/lib/controls/index.d.ts +5 -0
  32. package/lib/controls/index.js +43 -0
  33. package/lib/css-unit-parser/index.cjs +8 -0
  34. package/lib/css-unit-parser/index.d.ts +6 -0
  35. package/lib/css-unit-parser/index.js +36 -0
  36. package/lib/custom-element/index.cjs +1 -0
  37. package/lib/custom-element/index.d.ts +8 -0
  38. package/lib/custom-element/index.js +16 -0
  39. package/lib/device/Device.d.ts +17 -0
  40. package/lib/device/Viewport.d.ts +27 -0
  41. package/lib/device/index.cjs +1 -0
  42. package/lib/device/index.d.ts +2 -0
  43. package/lib/device/index.js +123 -0
  44. package/lib/dom-QhWsdQS2.cjs +1 -0
  45. package/lib/dom-bHEwc_xV.js +24 -0
  46. package/lib/easings-_wFs9ZWc.cjs +1 -0
  47. package/lib/easings-uF-tgahf.js +19 -0
  48. package/lib/element-constructor/ElementConstructor.d.ts +76 -0
  49. package/lib/element-constructor/htmlTags.d.ts +113 -0
  50. package/lib/element-constructor/index.cjs +1 -0
  51. package/lib/element-constructor/index.d.ts +4 -0
  52. package/lib/element-constructor/index.js +1389 -0
  53. package/lib/element-constructor/specialObjects.d.ts +2 -0
  54. package/lib/element-constructor/svgTags.d.ts +64 -0
  55. package/lib/en3/attachments/En3SourceManager.d.ts +30 -0
  56. package/lib/en3/core/en3.d.ts +55 -0
  57. package/lib/en3/index.cjs +28 -0
  58. package/lib/en3/index.d.ts +18 -0
  59. package/lib/en3/index.js +3249 -0
  60. package/lib/en3/instances/en3LazyLoader.d.ts +7 -0
  61. package/lib/en3/libs/MeshoptDecoder.d.ts +1 -0
  62. package/lib/en3/loaders/en3GLTFLoader.d.ts +16 -0
  63. package/lib/en3/loaders/en3TextureLoader.d.ts +2 -0
  64. package/lib/en3/objects/En3Clip.d.ts +10 -0
  65. package/lib/en3/objects/En3ClipHelpers.d.ts +5 -0
  66. package/lib/en3/objects/En3GLTF.d.ts +9 -0
  67. package/lib/en3/objects/En3Image.d.ts +7 -0
  68. package/lib/en3/objects/En3ImageLike.d.ts +22 -0
  69. package/{src/packages/en3/objects/En3SourceConsumer.ts → lib/en3/objects/En3SourceConsumer.d.ts} +2 -3
  70. package/lib/en3/objects/En3Video.d.ts +12 -0
  71. package/lib/en3/test/En3HTML.d.ts +9 -0
  72. package/lib/en3/test/En3ModifiedMaterial.d.ts +32 -0
  73. package/lib/en3/test/En3Raycaster.d.ts +19 -0
  74. package/lib/en3/utils/coverTexture.d.ts +6 -0
  75. package/lib/en3/utils/dispose.d.ts +2 -0
  76. package/lib/en3/utils/traverseMaterials.d.ts +2 -0
  77. package/lib/en3/utils/traverseMeshes.d.ts +2 -0
  78. package/lib/function-QP7IreXR.cjs +1 -0
  79. package/lib/function-zwSFehNd.js +17 -0
  80. package/lib/image/index.cjs +1 -0
  81. package/lib/image/index.d.ts +10 -0
  82. package/lib/image/index.js +30 -0
  83. package/lib/intersector/index.cjs +1 -0
  84. package/lib/intersector/index.d.ts +8 -0
  85. package/lib/intersector/index.js +55 -0
  86. package/lib/ladder/index.cjs +1 -0
  87. package/lib/ladder/index.d.ts +21 -0
  88. package/lib/ladder/index.js +97 -0
  89. package/lib/layout-5SJlcXTY.js +12 -0
  90. package/lib/layout-box/index.cjs +1 -0
  91. package/lib/layout-box/index.d.ts +78 -0
  92. package/lib/layout-box/index.js +235 -0
  93. package/lib/layout-rZzbsLPd.cjs +1 -0
  94. package/lib/loading/index.cjs +1 -0
  95. package/lib/loading/index.d.ts +38 -0
  96. package/lib/loading/index.js +99 -0
  97. package/lib/math-FNUBmQPK.cjs +1 -0
  98. package/lib/math-_a3IpKOc.js +45 -0
  99. package/lib/measurer/CumulativeOffsetLeft.d.ts +4 -0
  100. package/lib/measurer/CumulativeOffsetTop.d.ts +4 -0
  101. package/lib/measurer/Meaurer.d.ts +8 -0
  102. package/lib/measurer/index.cjs +1 -0
  103. package/lib/measurer/index.d.ts +3 -0
  104. package/lib/measurer/index.js +48 -0
  105. package/lib/media/index.cjs +1 -0
  106. package/lib/media/index.d.ts +11 -0
  107. package/lib/media/index.js +33 -0
  108. package/lib/morph/Link.d.ts +6 -0
  109. package/lib/morph/Morph.d.ts +26 -0
  110. package/lib/morph/index.cjs +1 -0
  111. package/lib/morph/index.d.ts +1 -0
  112. package/lib/morph/index.js +182 -0
  113. package/lib/notifier/index.cjs +1 -0
  114. package/lib/notifier/index.d.ts +8 -0
  115. package/lib/notifier/index.js +38 -0
  116. package/lib/number-2bR0KBcX.cjs +1 -0
  117. package/lib/number-bCHB2GAD.js +31 -0
  118. package/lib/order/index.cjs +1 -0
  119. package/lib/order/index.d.ts +13 -0
  120. package/lib/order/index.js +5 -0
  121. package/lib/resizer/index.cjs +1 -0
  122. package/lib/resizer/index.d.ts +10 -0
  123. package/lib/resizer/index.js +45 -0
  124. package/lib/router/Link.d.ts +6 -0
  125. package/lib/router/Route.d.ts +15 -0
  126. package/lib/router/RouteElement.d.ts +14 -0
  127. package/lib/router/Router.d.ts +33 -0
  128. package/lib/router/index.cjs +1 -0
  129. package/lib/router/index.d.ts +3 -0
  130. package/lib/router/index.js +266 -0
  131. package/lib/scroll/ScrollElement.d.ts +40 -0
  132. package/lib/scroll/ScrollUserElement.d.ts +7 -0
  133. package/lib/scroll/ScrollbarElement.d.ts +13 -0
  134. package/lib/scroll/index.cjs +71 -0
  135. package/lib/scroll/index.d.ts +2 -0
  136. package/lib/scroll/index.js +444 -0
  137. package/lib/scroll-entries/index.cjs +1 -0
  138. package/lib/scroll-entries/index.d.ts +17 -0
  139. package/lib/scroll-entries/index.js +56 -0
  140. package/lib/source/SourceClass.d.ts +11 -0
  141. package/lib/source/SourceElement.d.ts +16 -0
  142. package/lib/source/SourceManager.d.ts +13 -0
  143. package/lib/source/SourceSet.d.ts +8 -0
  144. package/lib/source/index.cjs +5 -0
  145. package/lib/source/index.d.ts +4 -0
  146. package/lib/source/index.js +95 -0
  147. package/lib/store/Composed.d.ts +7 -0
  148. package/lib/store/Derived.d.ts +7 -0
  149. package/lib/store/DerivedArray.d.ts +7 -0
  150. package/lib/store/Resource.d.ts +11 -0
  151. package/lib/store/Store.d.ts +32 -0
  152. package/lib/store/StoreRegistry.d.ts +22 -0
  153. package/lib/store/index.cjs +1 -0
  154. package/lib/store/index.d.ts +6 -0
  155. package/lib/store/index.js +96 -0
  156. package/lib/string-GmxZA5Nq.js +31 -0
  157. package/lib/string-WmNOGq16.cjs +1 -0
  158. package/lib/ticker/index.cjs +1 -0
  159. package/lib/ticker/index.d.ts +19 -0
  160. package/lib/ticker/index.js +107 -0
  161. package/lib/utils/array.d.ts +1 -0
  162. package/lib/utils/attributes.d.ts +2 -0
  163. package/lib/utils/browser.d.ts +1 -0
  164. package/lib/utils/canvas.d.ts +6 -0
  165. package/lib/utils/collisions.d.ts +3 -0
  166. package/lib/utils/coordinates.d.ts +13 -0
  167. package/lib/utils/decoding.d.ts +2 -0
  168. package/lib/utils/dev.d.ts +3 -0
  169. package/lib/utils/dom.d.ts +4 -0
  170. package/lib/utils/easings.d.ts +17 -0
  171. package/lib/utils/file.d.ts +1 -0
  172. package/lib/utils/function.d.ts +2 -0
  173. package/lib/utils/index.cjs +1 -0
  174. package/lib/utils/index.d.ts +19 -0
  175. package/lib/utils/index.js +203 -0
  176. package/lib/utils/layout.d.ts +3 -0
  177. package/lib/utils/math.d.ts +11 -0
  178. package/lib/utils/number.d.ts +3 -0
  179. package/lib/utils/object.d.ts +7 -0
  180. package/lib/utils/string.d.ts +5 -0
  181. package/lib/utils/ts-shape.d.ts +19 -0
  182. package/lib/utils/ts-utility.d.ts +19 -0
  183. package/lib/video/index.cjs +1 -0
  184. package/lib/video/index.d.ts +11 -0
  185. package/lib/video/index.js +37 -0
  186. package/package.json +6 -5
  187. package/.github/workflows/publish.yml +0 -20
  188. package/.prettierignore +0 -16
  189. package/.prettierrc +0 -9
  190. package/index.html +0 -32
  191. package/public/vite.svg +0 -1
  192. package/src/packages/animation/Animated.ts +0 -189
  193. package/src/packages/animation/Damped.ts +0 -39
  194. package/src/packages/animation/Tweened.ts +0 -51
  195. package/src/packages/animation/index.ts +0 -10
  196. package/src/packages/attribute/index.ts +0 -59
  197. package/src/packages/canvas-2d/index.ts +0 -137
  198. package/src/packages/controls/Controls.ts +0 -15
  199. package/src/packages/controls/KeyboardControls.ts +0 -63
  200. package/src/packages/controls/LinearControls.ts +0 -27
  201. package/src/packages/controls/User.ts +0 -20
  202. package/src/packages/controls/WheelControls.ts +0 -92
  203. package/src/packages/controls/index.ts +0 -5
  204. package/src/packages/css-unit-parser/index.ts +0 -32
  205. package/src/packages/custom-element/index.ts +0 -19
  206. package/src/packages/device/Device.ts +0 -113
  207. package/src/packages/device/Viewport.ts +0 -67
  208. package/src/packages/device/index.ts +0 -2
  209. package/src/packages/element-constructor/ElementConstructor.ts +0 -577
  210. package/src/packages/element-constructor/htmlTags.ts +0 -679
  211. package/src/packages/element-constructor/index.ts +0 -4
  212. package/src/packages/element-constructor/specialObjects.ts +0 -8
  213. package/src/packages/element-constructor/svgTags.ts +0 -588
  214. package/src/packages/en3/attachments/En3SourceManager.ts +0 -116
  215. package/src/packages/en3/core/en3.ts +0 -306
  216. package/src/packages/en3/index.ts +0 -52
  217. package/src/packages/en3/instances/en3LazyLoader.ts +0 -22
  218. package/src/packages/en3/libs/MeshoptDecoder.js +0 -138
  219. package/src/packages/en3/loaders/en3GLTFLoader.ts +0 -54
  220. package/src/packages/en3/loaders/en3TextureLoader.ts +0 -3
  221. package/src/packages/en3/objects/En3Clip.ts +0 -53
  222. package/src/packages/en3/objects/En3ClipHelpers.ts +0 -12
  223. package/src/packages/en3/objects/En3GLTF.ts +0 -35
  224. package/src/packages/en3/objects/En3Image.ts +0 -18
  225. package/src/packages/en3/objects/En3ImageLike.ts +0 -101
  226. package/src/packages/en3/objects/En3Video.ts +0 -88
  227. package/src/packages/en3/test/En3HTML.ts +0 -55
  228. package/src/packages/en3/test/En3ModifiedMaterial.ts +0 -221
  229. package/src/packages/en3/test/En3Raycaster.ts +0 -187
  230. package/src/packages/en3/utils/coverTexture.ts +0 -29
  231. package/src/packages/en3/utils/dispose.ts +0 -27
  232. package/src/packages/en3/utils/traverseMaterials.ts +0 -10
  233. package/src/packages/en3/utils/traverseMeshes.ts +0 -9
  234. package/src/packages/image/index.ts +0 -19
  235. package/src/packages/intersector/index.ts +0 -83
  236. package/src/packages/ladder/index.ts +0 -112
  237. package/src/packages/layout-box/index.ts +0 -417
  238. package/src/packages/loading/index.ts +0 -131
  239. package/src/packages/measurer/CumulativeOffsetLeft.ts +0 -8
  240. package/src/packages/measurer/CumulativeOffsetTop.ts +0 -8
  241. package/src/packages/measurer/Meaurer.ts +0 -38
  242. package/src/packages/measurer/index.ts +0 -3
  243. package/src/packages/media/index.ts +0 -38
  244. package/src/packages/morph/Link.ts +0 -32
  245. package/src/packages/morph/Morph.ts +0 -246
  246. package/src/packages/morph/index.ts +0 -10
  247. package/src/packages/notifier/index.ts +0 -41
  248. package/src/packages/order/index.ts +0 -14
  249. package/src/packages/resizer/index.ts +0 -55
  250. package/src/packages/router/Link.ts +0 -33
  251. package/src/packages/router/Route.ts +0 -152
  252. package/src/packages/router/RouteElement.ts +0 -34
  253. package/src/packages/router/Router.ts +0 -190
  254. package/src/packages/router/index.ts +0 -13
  255. package/src/packages/scroll/ScrollElement.ts +0 -618
  256. package/src/packages/scroll/ScrollUserElement.ts +0 -21
  257. package/src/packages/scroll/ScrollbarElement.ts +0 -170
  258. package/src/packages/scroll/index.ts +0 -2
  259. package/src/packages/scroll-entries/index.ts +0 -74
  260. package/src/packages/source/SourceClass.ts +0 -77
  261. package/src/packages/source/SourceElement.ts +0 -177
  262. package/src/packages/source/SourceManager.ts +0 -61
  263. package/src/packages/source/SourceSet.ts +0 -52
  264. package/src/packages/source/index.ts +0 -8
  265. package/src/packages/store/Composed.ts +0 -33
  266. package/src/packages/store/Derived.ts +0 -24
  267. package/src/packages/store/DerivedArray.ts +0 -36
  268. package/src/packages/store/Resource.ts +0 -38
  269. package/src/packages/store/Store.ts +0 -144
  270. package/src/packages/store/StoreRegistry.ts +0 -105
  271. package/src/packages/store/index.ts +0 -23
  272. package/src/packages/ticker/index.ts +0 -173
  273. package/src/packages/utils/array.ts +0 -3
  274. package/src/packages/utils/attributes.ts +0 -19
  275. package/src/packages/utils/browser.ts +0 -2
  276. package/src/packages/utils/canvas.ts +0 -46
  277. package/src/packages/utils/collisions.ts +0 -12
  278. package/src/packages/utils/coordinates.ts +0 -40
  279. package/src/packages/utils/decoding.ts +0 -11
  280. package/src/packages/utils/dev.ts +0 -5
  281. package/src/packages/utils/dom.ts +0 -48
  282. package/src/packages/utils/easings.ts +0 -69
  283. package/src/packages/utils/file.ts +0 -17
  284. package/src/packages/utils/function.ts +0 -29
  285. package/src/packages/utils/index.ts +0 -61
  286. package/src/packages/utils/layout.ts +0 -22
  287. package/src/packages/utils/math.ts +0 -74
  288. package/src/packages/utils/number.ts +0 -26
  289. package/src/packages/utils/object.ts +0 -108
  290. package/src/packages/utils/string.ts +0 -49
  291. package/src/packages/utils/ts-shape.ts +0 -25
  292. package/src/packages/utils/ts-utility.ts +0 -47
  293. package/src/packages/video/index.ts +0 -39
  294. package/src/playground/index.ts +0 -0
  295. package/tsconfig.json +0 -31
  296. package/vite.config.ts +0 -78
@@ -0,0 +1,203 @@
1
+ import { a as B, p as T } from "../attributes-w0u-KiIb.js";
2
+ import { i as U } from "../browser-S4eq8AeN.js";
3
+ import { f as M, a as J, g as q } from "../dom-bHEwc_xV.js";
4
+ import { c as V, n as W, f as G, p as L, b as X, i as Y, m as Z, e as _, g as $, j as F, d as H, o as b, a as j, h as ee, k as te, l as ne } from "../easings-uF-tgahf.js";
5
+ import { d as ae, t as ie } from "../function-zwSFehNd.js";
6
+ import { g as oe, a as ue, b as ce } from "../layout-5SJlcXTY.js";
7
+ import { e as fe, f as de, c as pe, d as ye, l as me, m as he, r as xe, b as we, a as ge, s as Oe } from "../math-_a3IpKOc.js";
8
+ import { f as Ce, g as ke, r as Ae } from "../number-bCHB2GAD.js";
9
+ import { c as ve, a as Pe, k as Qe, s as Re, t as De } from "../string-GmxZA5Nq.js";
10
+ function m(e, t, ...n) {
11
+ return [...e.slice(0, t), ...n, ...e.slice(t)];
12
+ }
13
+ function h(e, t) {
14
+ const n = e.measureText(t), s = n.actualBoundingBoxAscent + n.actualBoundingBoxDescent, a = n.width;
15
+ return {
16
+ height: s,
17
+ width: a
18
+ };
19
+ }
20
+ function x(e) {
21
+ return Math.floor(e) + 0.5;
22
+ }
23
+ function w(e, t, n, s, a, i) {
24
+ let u = e / t, l = n / s, r = 0, o = 0;
25
+ return a = typeof a == "undefined" ? 0.5 : a, i = typeof i == "undefined" ? 0.5 : i, u > l ? (r = s, o = s * u) : (o = n, r = n / u), [
26
+ (n - o) * a,
27
+ (s - r) * i,
28
+ o,
29
+ r
30
+ ];
31
+ }
32
+ function g(e, t) {
33
+ return e.x < t.x + t.width && e.x > t.x && e.y < t.y + t.height && e.y > t.y;
34
+ }
35
+ function O(e, t) {
36
+ return Math.sqrt((e.x - t.x) ** 2 + (e.y - t.y) ** 2) < t.radius;
37
+ }
38
+ function I(e, t, n = !1) {
39
+ let s = e.x - t.width / 2, a = t.height / 2 - e.y;
40
+ return n && (s = s / (t.width / 2), a = a / (t.height / 2)), { x: s, y: a };
41
+ }
42
+ function C(e, t) {
43
+ const n = e.x / t.x, s = e.y / t.y;
44
+ return { x: n, y: s };
45
+ }
46
+ function k(e, t) {
47
+ return t = t || {
48
+ x: 0,
49
+ y: 0,
50
+ width: document.documentElement.offsetWidth,
51
+ height: innerHeight
52
+ }, {
53
+ x: (e.x - t.x) / t.width * t.width,
54
+ y: (e.y - t.y) / t.height * t.height
55
+ };
56
+ }
57
+ function A(e) {
58
+ const t = window.atob(e);
59
+ return decodeURIComponent(window.escape(t));
60
+ }
61
+ function E(e) {
62
+ const t = window.unescape(encodeURIComponent(e));
63
+ return window.btoa(t);
64
+ }
65
+ function v({ ms: e = 200 } = {}) {
66
+ setInterval(() => {
67
+ window.dispatchEvent(new Event("resize"));
68
+ }, e);
69
+ }
70
+ function P(e, t) {
71
+ const n = new Blob([JSON.stringify(t)], { type: "application/json" }), s = document.createElement("a");
72
+ s.download = e + ".json", s.href = window.URL.createObjectURL(n), s.dataset.downloadurl = ["application/json", s.download, s.href].join(":");
73
+ const a = new MouseEvent("click", {
74
+ view: window,
75
+ bubbles: !0,
76
+ cancelable: !0
77
+ });
78
+ s.dispatchEvent(a), s.remove();
79
+ }
80
+ function f(e) {
81
+ return typeof e == "object" && e !== null && !Array.isArray(e);
82
+ }
83
+ function d(e) {
84
+ if (e === null || typeof e != "object")
85
+ return e;
86
+ if (e instanceof Date)
87
+ return new Date(e.getTime());
88
+ if (e instanceof Node)
89
+ return e;
90
+ const t = Array.isArray(e) ? [] : {};
91
+ for (const n in e)
92
+ e.hasOwnProperty(n) && (t[n] = d(e[n]));
93
+ return t;
94
+ }
95
+ function p(e, t, n = f) {
96
+ for (const s in t)
97
+ n(t[s]) ? (e[s] || Object.assign(e, { [s]: {} }), p(e[s], t[s], n)) : Object.assign(e, { [s]: t[s] });
98
+ return e;
99
+ }
100
+ function y(e) {
101
+ return e === null || typeof e == "undefined";
102
+ }
103
+ function c(e, t) {
104
+ if (typeof e != typeof t)
105
+ return !1;
106
+ if ([e, t].some((n) => y(n)))
107
+ return e === t;
108
+ if (Array.isArray(e)) {
109
+ const n = e.length > t.length ? e : t, s = e.length > t.length ? t : e;
110
+ return n.every((a, i) => c(a, s[i]));
111
+ }
112
+ if (typeof e != "object" || e instanceof Node || typeof e == "object" && e.constructor.toString().startsWith("class"))
113
+ return e === t;
114
+ for (const n in e) {
115
+ if (!t.hasOwnProperty(n))
116
+ return !1;
117
+ if (typeof e[n] == "object" && typeof t[n] == "object") {
118
+ if (!c(e[n], t[n]))
119
+ return !1;
120
+ } else if (e[n] !== t[n])
121
+ return !1;
122
+ }
123
+ return !0;
124
+ }
125
+ function Q(e, t) {
126
+ const n = {};
127
+ for (const s in e)
128
+ t.includes(s) && (n[s] = e[s]);
129
+ return n;
130
+ }
131
+ function R(e, t) {
132
+ const n = {};
133
+ for (const s in e)
134
+ t.includes(s) || (n[s] = e[s]);
135
+ return n;
136
+ }
137
+ export {
138
+ fe as calculateDistance,
139
+ de as calculateDistanceWithRadius,
140
+ ve as camelToKebab,
141
+ Pe as capitalize,
142
+ pe as clamp,
143
+ d as cloneDeep,
144
+ c as compareObjects,
145
+ w as cover,
146
+ P as createJSONAndSave,
147
+ ye as damp,
148
+ ae as debounce,
149
+ E as decode,
150
+ O as dotCircleCollision,
151
+ g as dotRectCollision,
152
+ V as easeInCubic,
153
+ W as easeInExpo,
154
+ G as easeInOutCubic,
155
+ L as easeInOutExpo,
156
+ X as easeInOutQuad,
157
+ Y as easeInOutQuart,
158
+ Z as easeInOutQuint,
159
+ _ as easeInQuad,
160
+ $ as easeInQuart,
161
+ F as easeInQuint,
162
+ H as easeOutCubic,
163
+ b as easeOutExpo,
164
+ j as easeOutQuad,
165
+ ee as easeOutQuart,
166
+ te as easeOutQuint,
167
+ A as encode,
168
+ M as findParentElement,
169
+ J as findScrollParentElement,
170
+ Ce as fix,
171
+ x as fixPosition,
172
+ ke as generateId,
173
+ oe as getCumulativeOffsetLeft,
174
+ ue as getCumulativeOffsetTop,
175
+ ce as getCumulativePosition,
176
+ q as getElement,
177
+ k as getPointerPosition,
178
+ m as insert,
179
+ U as isBrowser,
180
+ y as isNullish,
181
+ f as isObject,
182
+ Qe as kebabToCamel,
183
+ me as lerp,
184
+ ne as linear,
185
+ he as mapRange,
186
+ h as measureText,
187
+ p as mergeDeep,
188
+ C as normalize,
189
+ R as omit,
190
+ B as parseAttribute,
191
+ T as parseAttributeValue,
192
+ Q as pick,
193
+ v as resizeInterval,
194
+ xe as round,
195
+ Ae as roundTo,
196
+ I as screenToCartesian,
197
+ we as smootherstep,
198
+ ge as smoothstep,
199
+ Re as snakeToDotted,
200
+ Oe as step,
201
+ ie as throttle,
202
+ De as toPascalCase
203
+ };
@@ -0,0 +1,3 @@
1
+ export declare const getCumulativePosition: (target: HTMLElement, from?: 'offsetLeft' | 'offsetTop', stopElement?: HTMLElement) => number;
2
+ export declare const getCumulativeOffsetLeft: (target: HTMLElement, stopElement?: HTMLElement) => number;
3
+ export declare const getCumulativeOffsetTop: (target: HTMLElement, stopElement?: HTMLElement) => number;
@@ -0,0 +1,11 @@
1
+ import { Dot2D } from './ts-shape.js';
2
+ export declare function lerp(a: number, b: number, c: number): number;
3
+ export declare function damp(a: number, b: number, c: number, dt: number): number;
4
+ export declare function step(edge: number, value: number, x?: number, y?: number): number;
5
+ export declare function round(number: number, precision?: number): number;
6
+ export declare function clamp(number: number, min?: number, max?: number): number;
7
+ export declare function mapRange(value: number, rangeA: [number, number], rangeB: [number, number]): number;
8
+ export declare function smoothstep(x: number, min: number, max: number): number;
9
+ export declare function smootherstep(x: number, min: number, max: number): number;
10
+ export declare function calculateDistance(d1: Dot2D, d2: Dot2D): number;
11
+ export declare function calculateDistanceWithRadius(x1: number, y1: number, r1: number, x2: number, y2: number, r2: number): number;
@@ -0,0 +1,3 @@
1
+ export declare function fix(number: number, n?: number): number;
2
+ export declare function roundTo(number: number, to: number): number;
3
+ export declare function generateId(length: number, characters?: string): string;
@@ -0,0 +1,7 @@
1
+ export declare function isObject(value: any): value is object;
2
+ export declare function cloneDeep<T>(obj: T): T;
3
+ export declare function mergeDeep(target: object, source: object, isObjectFunction?: typeof isObject): object;
4
+ export declare function isNullish(value: any): boolean;
5
+ export declare function compareObjects(obj1: any, obj2: any): boolean;
6
+ export declare function pick<T extends object, R extends keyof T>(object: T, keys: Array<R>): Pick<T, R>;
7
+ export declare function omit<T extends object, R extends keyof T>(object: T, keys: Array<R>): Omit<T, R>;
@@ -0,0 +1,5 @@
1
+ export declare function kebabToCamel(kebab: string, capitalize?: boolean): string;
2
+ export declare function camelToKebab(camelCaseString: string): string;
3
+ export declare function snakeToDotted(snake: string): string;
4
+ export declare function toPascalCase(str: string): string;
5
+ export declare function capitalize(string: string, everyWord?: boolean): string;
@@ -0,0 +1,19 @@
1
+ export type Axes2D = 'x' | 'y';
2
+ export type Axes3D = Axes2D | 'z';
3
+ export type Dot2D = {
4
+ x: number;
5
+ y: number;
6
+ };
7
+ export type Rect2D = Dot2D & {
8
+ width: number;
9
+ height: number;
10
+ };
11
+ export type Circle = Dot2D & {
12
+ radius: number;
13
+ };
14
+ export type Dot3D = Dot2D & {
15
+ z: number;
16
+ };
17
+ export type Rect3D = Rect2D & {
18
+ depth: number;
19
+ };
@@ -0,0 +1,19 @@
1
+ export type NestedKeys<T> = T extends Node ? '' : T extends object ? {
2
+ [K in keyof T]: T[K] extends infer U ? `${Extract<K, string>}${NestedKeys<U> extends '' ? '' : '.'}${NestedKeys<U>}` : never;
3
+ }[keyof T] : '';
4
+ export type NestedValueOf<Obj, Key extends string> = Obj extends object ? Key extends `${infer Parent}.${infer Leaf}` ? Parent extends keyof Obj ? NestedValueOf<Obj[Parent], Leaf> : never : Key extends keyof Obj ? Obj[Key] : never : never;
5
+ type Tail<T extends any[]> = ((...t: T) => void) extends (h: any, ...r: infer R) => void ? R : never;
6
+ export type DeepOmit<T, Path extends string[]> = T extends object ? Path['length'] extends 1 ? Omit<T, Path[0]> : {
7
+ [K in keyof T]: K extends Path[0] ? DeepOmit<T[K], Tail<Path>> : T[K];
8
+ } : T;
9
+ export type DeepPartial<T> = {
10
+ [K in keyof T]?: T[K] extends object ? DeepPartial<T[K]> : T[K];
11
+ };
12
+ export type Requiredish<T> = {
13
+ [K in keyof Required<T>]: T[K];
14
+ };
15
+ export type WithRequired<T, K extends keyof T> = T & {
16
+ [P in K]-?: T[P];
17
+ };
18
+ export type Split<S extends string, D extends string> = string extends S ? string[] : S extends '' ? [] : S extends `${infer T}${D}${infer U}` ? [T, ...Split<U, D>] : [S];
19
+ export {};
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../custom-element/index.cjs");require("../resizer/index.cjs");require("../Store-WXFmsaEI.cjs");const o=require("../source/index.cjs");require("../browser-QbF6EW-w.cjs");require("../notifier/index.cjs");require("../function-QP7IreXR.cjs");require("../SourceManager-3c3kr7oj.cjs");require("../order/index.cjs");require("../intersector/index.cjs");require("../loading/index.cjs");var l=Object.defineProperty,a=Object.getOwnPropertyDescriptor,m=(i,r,s,t)=>{for(var e=t>1?void 0:t?a(r,s):r,u=i.length-1,n;u>=0;u--)(n=i[u])&&(e=(t?n(r,s,e):n(e))||e);return t&&e&&l(r,s,e),e};exports.VideoElement=class extends o.SourceElement{connectedCallback(){super.connectedCallback(),this.captureEvent.subscribe(()=>{this.hasAttribute("e-autoplay")&&this.consumerElement.play()}),this.releaseEvent.subscribe(()=>{this.hasAttribute("e-autoplay")&&(this.consumerElement.pause(),this.hasAttribute("replay")&&(this.consumerElement.currentTime=0))})}createConsumer(){return document.createElement("video")}consumeSource(r){this.consumerElement.src=r||""}};exports.VideoElement=m([c.define("e-video")],exports.VideoElement);
@@ -0,0 +1,11 @@
1
+ import { SourceElement } from '../source';
2
+ export declare class VideoElement extends SourceElement<HTMLVideoElement> {
3
+ protected connectedCallback(): void;
4
+ protected createConsumer(): HTMLVideoElement;
5
+ protected consumeSource(url: string | null): void;
6
+ }
7
+ declare global {
8
+ interface HTMLElementTagNameMap {
9
+ 'e-video': VideoElement;
10
+ }
11
+ }
@@ -0,0 +1,37 @@
1
+ import { define as c } from "../custom-element/index.js";
2
+ import "../resizer/index.js";
3
+ import "../Store-2hWEUGTj.js";
4
+ import { SourceElement as p } from "../source/index.js";
5
+ import "../browser-S4eq8AeN.js";
6
+ import "../notifier/index.js";
7
+ import "../function-zwSFehNd.js";
8
+ import "../SourceManager-F94MRde6.js";
9
+ import "../order/index.js";
10
+ import "../intersector/index.js";
11
+ import "../loading/index.js";
12
+ var u = Object.defineProperty, l = Object.getOwnPropertyDescriptor, a = (t, r, s, i) => {
13
+ for (var e = i > 1 ? void 0 : i ? l(r, s) : r, o = t.length - 1, m; o >= 0; o--)
14
+ (m = t[o]) && (e = (i ? m(r, s, e) : m(e)) || e);
15
+ return i && e && u(r, s, e), e;
16
+ };
17
+ let n = class extends p {
18
+ connectedCallback() {
19
+ super.connectedCallback(), this.captureEvent.subscribe(() => {
20
+ this.hasAttribute("e-autoplay") && this.consumerElement.play();
21
+ }), this.releaseEvent.subscribe(() => {
22
+ this.hasAttribute("e-autoplay") && (this.consumerElement.pause(), this.hasAttribute("replay") && (this.consumerElement.currentTime = 0));
23
+ });
24
+ }
25
+ createConsumer() {
26
+ return document.createElement("video");
27
+ }
28
+ consumeSource(t) {
29
+ this.consumerElement.src = t || "";
30
+ }
31
+ };
32
+ n = a([
33
+ c("e-video")
34
+ ], n);
35
+ export {
36
+ n as VideoElement
37
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aptechka",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/denisavitski/aptechka.git"
@@ -13,8 +13,8 @@
13
13
  "access": "public"
14
14
  },
15
15
  "license": "ISC",
16
- "images": [
17
- "lib/"
16
+ "files": [
17
+ "lib"
18
18
  ],
19
19
  "type": "module",
20
20
  "exports": {
@@ -248,7 +248,7 @@
248
248
  }
249
249
  },
250
250
  "scripts": {
251
- "dev": "vite --mode lib",
251
+ "dev": "vite --mode site",
252
252
  "build:lib": "tsc && vite build --mode lib",
253
253
  "build:site": "tsc && vite build --mode site",
254
254
  "preview": "vite preview",
@@ -258,7 +258,8 @@
258
258
  "@types/node": "^20.11.5",
259
259
  "@types/three": "^0.160.0",
260
260
  "vite": "^5.0.12",
261
- "vite-plugin-dts": "^3.7.2"
261
+ "vite-plugin-dts": "^3.7.2",
262
+ "vite-plugin-html-components": "^0.1.2"
262
263
  },
263
264
  "dependencies": {
264
265
  "detect-gpu": "^5.0.37",
@@ -1,20 +0,0 @@
1
- name: 'publish npm'
2
-
3
- on: push
4
-
5
- jobs:
6
- publish:
7
- runs-on: ubuntu-latest
8
- steps:
9
- - name: checkout
10
- uses: actions/checkout@v2
11
- - name: node
12
- uses: actions/setup-node@v2
13
- with:
14
- node-version: 18
15
- registry-url: https://registry.npmjs.org
16
- - name: publish
17
- run: npm publish --access public
18
- working-directory: ./
19
- env:
20
- NODE_AUTH_TOKEN: ${{secrets.NPM_AUTH_TOKEN}}
package/.prettierignore DELETED
@@ -1,16 +0,0 @@
1
- .gitignore
2
- .vscode
3
- .prettierignore
4
- .prettierrc
5
- node_modules
6
- package-lock.json
7
- dist
8
- dist/
9
- .DS_Store
10
- node_modules
11
- /build
12
- /.svelte-kit
13
- /package
14
- .env
15
- .env.*
16
- !.env.example
package/.prettierrc DELETED
@@ -1,9 +0,0 @@
1
- {
2
- "singleQuote": true,
3
- "tabWidth": 2,
4
- "semi": false,
5
- "printWidth": 100,
6
- "arrowParens": "always",
7
- "bracketSpacing": true,
8
- "singleAttributePerLine": true
9
- }
package/index.html DELETED
@@ -1,32 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="UTF-8" />
5
- <meta
6
- name="viewport"
7
- content="width=device-width, initial-scale=1.0"
8
- />
9
- <title>🍓</title>
10
-
11
- <style>
12
- * {
13
- margin: 0;
14
- padding: 0;
15
- box-sizing: border-box;
16
- }
17
-
18
- html,
19
- body {
20
- width: 100%;
21
- height: 100%;
22
- overflow: hidden;
23
- }
24
- </style>
25
- </head>
26
- <body>
27
- <script
28
- type="module"
29
- src="/src/playground/index.ts"
30
- ></script>
31
- </body>
32
- </html>
package/public/vite.svg DELETED
@@ -1 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
@@ -1,189 +0,0 @@
1
- import { StoreOptions, StoreEntry, Store, StoreCallback } from '$packages/store'
2
- import { ticker, TickerCallbackEntry, TickerCallback, TickerAddOptions } from '$packages/ticker'
3
- import { ElementOrSelector, clamp, fix } from '$packages/utils'
4
-
5
- export interface AnimatedOptions extends StoreOptions<number>, TickerAddOptions {
6
- min?: number | AnimatedEdgeFunction
7
- max?: number | AnimatedEdgeFunction
8
- }
9
-
10
- export type AnimatedEdgeFunction = () => number
11
-
12
- export interface AnimatedEntry extends StoreEntry<number> {
13
- min: number
14
- max: number
15
- delta: number
16
- progress: number
17
- direction: number
18
- speed: number
19
- }
20
-
21
- export abstract class Animated<Entry extends AnimatedEntry = AnimatedEntry> extends Store<
22
- number,
23
- Entry
24
- > {
25
- #maxFPS: number | undefined
26
- #order: number | undefined
27
- #culling: ElementOrSelector | undefined
28
- #target: number
29
- #min: AnimatedEdgeFunction
30
- #max: AnimatedEdgeFunction
31
- #setter: Animated | undefined
32
- #isRunning = new Store(false)
33
- #direction = 0
34
- #speed = 0
35
-
36
- constructor(options?: AnimatedOptions) {
37
- super(0, options)
38
-
39
- this.#order = options?.order
40
- this.#maxFPS = options?.maxFPS
41
- this.#culling = options?.culling
42
- this.#min = this.#getEdgeFunction(options?.min)
43
- this.#max = this.#getEdgeFunction(options?.max)
44
- this.#target = this.current = 0
45
- }
46
-
47
- public get target() {
48
- return this.#target
49
- }
50
-
51
- public get isRunning() {
52
- return this.#isRunning
53
- }
54
-
55
- public get direction() {
56
- return this.#direction
57
- }
58
-
59
- public get maxFPS() {
60
- return this.#maxFPS
61
- }
62
-
63
- public get speed() {
64
- return this.#speed
65
- }
66
-
67
- public get min(): number {
68
- return this.#min()
69
- }
70
-
71
- public set min(value: number | AnimatedEdgeFunction | undefined) {
72
- this.#min = this.#getEdgeFunction(value)
73
- this.set(this.#target)
74
- this.current = this.#target
75
- }
76
-
77
- public get max(): number {
78
- return this.#max()
79
- }
80
-
81
- public set max(value: number | AnimatedEdgeFunction | undefined) {
82
- this.#max = this.#getEdgeFunction(value)
83
- this.set(this.#target)
84
- this.current = this.#target
85
- }
86
-
87
- public get delta() {
88
- return this.max - this.min
89
- }
90
-
91
- public get progress() {
92
- return this.delta ? fix((this.current - this.min) / this.delta, 6) : 0
93
- }
94
-
95
- public get setter() {
96
- return this.#setter
97
- }
98
-
99
- public override get entry(): Entry {
100
- return {
101
- ...super.entry,
102
- min: this.min,
103
- max: this.max,
104
- delta: this.delta,
105
- direction: this.direction,
106
- progress: this.progress,
107
- speed: this.speed,
108
- }
109
- }
110
-
111
- public set setter(animated: Animated | undefined) {
112
- this.#setter?.unsubscribe(this.#setterListener)
113
- this.#setter = animated
114
- this.#setter?.subscribe(this.#setterListener)
115
- }
116
-
117
- public set(value: number, equalize = false) {
118
- const previous = this.#target
119
-
120
- this.#target = clamp(value, this.min, this.max)
121
-
122
- if (equalize) {
123
- this.current = this.#target
124
- }
125
-
126
- if (this.#target !== previous) {
127
- this.#speed = 0
128
- this.#direction = Math.sign(value - this.#target) || 1
129
- this.update()
130
- }
131
- }
132
-
133
- public shift(value: number, equalize = false) {
134
- this.set(this.#target + value, equalize)
135
- }
136
-
137
- public override close() {
138
- super.close()
139
-
140
- this.unlistenAnimationFrame()
141
-
142
- this.#setter?.unsubscribe(this.#setterListener)
143
- this.#setter = undefined
144
- }
145
-
146
- public override reset() {
147
- this.set(this.initial, true)
148
- super.reset()
149
- this.unlistenAnimationFrame()
150
- }
151
-
152
- public listenAnimationFrame() {
153
- this.#isRunning.current = true
154
- ticker.subscribe(this.#animationFrameListener, {
155
- maxFPS: this.#maxFPS,
156
- order: this.#order,
157
- culling: this.#culling,
158
- })
159
- }
160
-
161
- public unlistenAnimationFrame() {
162
- this.#speed = 0
163
- this.#isRunning.current = false
164
- ticker.unsubscribe(this.#animationFrameListener)
165
- }
166
-
167
- protected abstract update(): void
168
-
169
- protected abstract handleAnimationFrame(e: TickerCallbackEntry): void
170
-
171
- #setterListener: StoreCallback<AnimatedEntry> = (e) => {
172
- this.set(e.current)
173
- }
174
-
175
- #animationFrameListener: TickerCallback = (e) => {
176
- const current = this.current
177
-
178
- this.handleAnimationFrame(e)
179
-
180
- const delta = Math.abs(current - this.target)
181
-
182
- this.#speed = delta / e.elapsed
183
- }
184
-
185
- #getEdgeFunction(value: number | AnimatedEdgeFunction | undefined) {
186
- const v = value || 0
187
- return typeof v === 'function' ? v : () => v
188
- }
189
- }