aptechka 0.83.1 → 0.84.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.
Files changed (286) hide show
  1. package/lib/Animation-BUD5w3AB.js +110 -0
  2. package/lib/Animation-BtUdarQ7.cjs +1 -0
  3. package/lib/Composed-BI5oe4Ij.cjs +1 -0
  4. package/lib/Composed-BaevH-MP.js +75 -0
  5. package/lib/Damped-BHm2IuyN.cjs +1 -0
  6. package/lib/Damped-Ds17AUU-.js +57 -0
  7. package/lib/DerivedArray-BePrxcLC.js +63 -0
  8. package/lib/DerivedArray-xYBpcTp8.cjs +1 -0
  9. package/lib/DragControls-BgTBgiue.js +233 -0
  10. package/lib/DragControls-FmiuZDKq.cjs +1 -0
  11. package/lib/LocalLinks-BdqYzt1b.js +65 -0
  12. package/lib/LocalLinks-D1mYcA-B.cjs +1 -0
  13. package/lib/PageAnnouncerElement-CJ-MfwJ8.cjs +1 -0
  14. package/lib/PageAnnouncerElement-HcphPbXZ.js +28 -0
  15. package/lib/PageScroll-CrfCwDA4.js +65 -0
  16. package/lib/PageScroll-IlOCUUte.cjs +1 -0
  17. package/lib/SourceElement-DC726HMy.js +265 -0
  18. package/lib/SourceElement-DNyrQby1.cjs +5 -0
  19. package/lib/Store-BRTHeZmO.js +158 -0
  20. package/lib/Store-DZnOrofs.cjs +1 -0
  21. package/lib/Tweened-3UYSwrvs.cjs +1 -0
  22. package/lib/Tweened-DabaFaHX.js +48 -0
  23. package/lib/Viewport-0n1C_IoN.js +113 -0
  24. package/lib/Viewport-D26fEJOk.cjs +1 -0
  25. package/lib/accordion/index.cjs +1 -1
  26. package/lib/accordion/index.js +97 -93
  27. package/lib/animation/index.cjs +1 -1
  28. package/lib/animation/index.js +6 -6
  29. package/lib/api-fetcher/index.cjs +1 -1
  30. package/lib/api-fetcher/index.js +67 -66
  31. package/lib/attribute/index.cjs +1 -1
  32. package/lib/attribute/index.js +37 -34
  33. package/lib/attributes-BADnRZpK.cjs +1 -0
  34. package/lib/attributes-FObgMNCf.js +36 -0
  35. package/lib/billboard/index.cjs +1 -1
  36. package/lib/billboard/index.js +240 -232
  37. package/lib/cache/index.cjs +1 -1
  38. package/lib/cache/index.js +26 -23
  39. package/lib/canvas/index.cjs +1 -1
  40. package/lib/canvas/index.js +61 -59
  41. package/lib/canvas-BP1ceie3.cjs +1 -0
  42. package/lib/canvas-DsglKco1.js +40 -0
  43. package/lib/connector/index.cjs +1 -1
  44. package/lib/connector/index.js +44 -41
  45. package/lib/controls/index.cjs +1 -1
  46. package/lib/controls/index.js +6 -6
  47. package/lib/coordinates--JG1U6kQ.js +29 -0
  48. package/lib/coordinates-DQ9XV9M1.cjs +1 -0
  49. package/lib/css-property/index.cjs +1 -1
  50. package/lib/css-property/index.d.ts +1 -1
  51. package/lib/css-property/index.js +40 -37
  52. package/lib/css-unit-parser/index.cjs +2 -2
  53. package/lib/css-unit-parser/index.js +22 -19
  54. package/lib/css-value-parser/index.cjs +1 -1
  55. package/lib/css-value-parser/index.js +13 -11
  56. package/lib/custom-elements-BfZCJde6.cjs +1 -0
  57. package/lib/custom-elements-HEMuF7yH.js +27 -0
  58. package/lib/dev/index.cjs +2 -1
  59. package/lib/dev/index.d.ts +1 -0
  60. package/lib/dev/index.js +24 -10
  61. package/lib/device/index.cjs +1 -1
  62. package/lib/device/index.js +5 -5
  63. package/lib/dom-B40i6NXw.cjs +1 -0
  64. package/lib/dom-D8D-_9ty.js +108 -0
  65. package/lib/easings-BSGJFMAo.js +40 -0
  66. package/lib/easings-BWq0pPLq.cjs +1 -0
  67. package/lib/element-CqD0jqBJ.cjs +1 -0
  68. package/lib/element-DKw5H-Tu.js +10 -0
  69. package/lib/element-linked-store/index.cjs +1 -1
  70. package/lib/element-linked-store/index.js +53 -52
  71. package/lib/element-resizer/index.cjs +1 -1
  72. package/lib/element-resizer/index.js +47 -44
  73. package/lib/en3/index.cjs +4 -4
  74. package/lib/en3/index.js +191 -185
  75. package/lib/events-Ds-TuvYW.js +9 -0
  76. package/lib/events-UlGk63iC.cjs +1 -0
  77. package/lib/file-DwQs6bB6.js +28 -0
  78. package/lib/file-RHfA3OS-.cjs +1 -0
  79. package/lib/function-H4b_gTg6.cjs +1 -0
  80. package/lib/function-UmbPrOHm.js +19 -0
  81. package/lib/gestures-DmKKNnh4.js +14 -0
  82. package/lib/gestures-DtYbQr49.cjs +1 -0
  83. package/lib/history/index.cjs +1 -1
  84. package/lib/history/index.js +24 -21
  85. package/lib/iframe/index.cjs +1 -1
  86. package/lib/iframe/index.js +27 -24
  87. package/lib/image/index.cjs +1 -1
  88. package/lib/image/index.js +17 -13
  89. package/lib/index-ClTMVKJp.js +183 -0
  90. package/lib/index-DZ44osDT.cjs +1 -0
  91. package/lib/intersector/index.cjs +1 -1
  92. package/lib/intersector/index.js +3 -3
  93. package/lib/jsx/ComponentElement.d.ts +4 -0
  94. package/lib/jsx/h.d.ts +7 -16
  95. package/lib/jsx/hooks/component/useStylesheet.d.ts +1 -1
  96. package/lib/jsx/hooks/cssProperty.d.ts +6 -0
  97. package/lib/jsx/hooks/resize.d.ts +4 -0
  98. package/lib/jsx/hooks/store.d.ts +1 -2
  99. package/lib/jsx/hooks/ticker.d.ts +5 -0
  100. package/lib/jsx/index.cjs +1 -1
  101. package/lib/jsx/index.d.ts +4 -4
  102. package/lib/jsx/index.js +170 -349
  103. package/lib/jsx/plugins/vite/index.cjs +49 -0
  104. package/lib/jsx/plugins/vite/index.d.ts +38 -0
  105. package/lib/jsx/plugins/vite/index.js +104 -0
  106. package/lib/jsx/render.d.ts +2 -0
  107. package/lib/jsx/type.d.ts +228 -190
  108. package/lib/ladder/index.cjs +1 -1
  109. package/lib/ladder/index.js +86 -84
  110. package/lib/layout-C26zkY7D.js +35 -0
  111. package/lib/layout-CnGLl7oe.cjs +1 -0
  112. package/lib/layout-box/index.cjs +1 -1
  113. package/lib/layout-box/index.js +220 -217
  114. package/lib/loading/index.cjs +1 -1
  115. package/lib/loading/index.js +48 -45
  116. package/lib/local-links/index.cjs +1 -1
  117. package/lib/local-links/index.js +2 -2
  118. package/lib/masonry-layout/index.cjs +1 -1
  119. package/lib/masonry-layout/index.js +48 -45
  120. package/lib/math-C-knY2TL.cjs +1 -0
  121. package/lib/math-r8V23YFe.js +57 -0
  122. package/lib/media/index.cjs +1 -1
  123. package/lib/media/index.js +28 -25
  124. package/lib/metadata-BNdkmeeD.js +15 -0
  125. package/lib/metadata-BrHUfpV9.cjs +1 -0
  126. package/lib/morph/index.cjs +1 -1
  127. package/lib/morph/index.js +561 -556
  128. package/lib/morph-BtgB1YQP.js +256 -0
  129. package/lib/morph-Buhxq-X0.cjs +1 -0
  130. package/lib/need_redo_tweaker/index.cjs +4 -4
  131. package/lib/need_redo_tweaker/index.js +862 -835
  132. package/lib/notifier/index.cjs +1 -1
  133. package/lib/notifier/index.js +29 -26
  134. package/lib/number-Bu4sGvW7.cjs +1 -0
  135. package/lib/number-DiVt2xnh.js +47 -0
  136. package/lib/object-CiIdEmJx.js +98 -0
  137. package/lib/object-DTY_W6xG.cjs +1 -0
  138. package/lib/order/index.cjs +1 -1
  139. package/lib/order/index.js +3 -3
  140. package/lib/page-announcer/index.cjs +1 -1
  141. package/lib/page-announcer/index.js +2 -2
  142. package/lib/page-scroll/index.cjs +1 -1
  143. package/lib/page-scroll/index.js +2 -2
  144. package/lib/pixel-perfect/index.cjs +4 -4
  145. package/lib/pixel-perfect/index.js +43 -40
  146. package/lib/pointer/index.cjs +1 -1
  147. package/lib/pointer/index.js +125 -123
  148. package/lib/polyfills-CG1XJNia.js +28 -0
  149. package/lib/polyfills-DZCuDBkA.cjs +1 -0
  150. package/lib/popover/index.cjs +1 -1
  151. package/lib/popover/index.js +249 -245
  152. package/lib/radio/index.cjs +1 -1
  153. package/lib/radio/index.js +58 -55
  154. package/lib/render-H9BjFLZ3.cjs +1 -0
  155. package/lib/render-LpimRXgl.js +354 -0
  156. package/lib/router/index.cjs +1 -1
  157. package/lib/router/index.js +196 -194
  158. package/lib/scroll/index.cjs +1 -1
  159. package/lib/scroll/index.js +890 -878
  160. package/lib/scroll-D2tOpCnP.cjs +1 -0
  161. package/lib/scroll-DoNeuIgT.js +41 -0
  162. package/lib/scroll-entries/index.cjs +1 -1
  163. package/lib/scroll-entries/index.js +37 -34
  164. package/lib/scroll-kit/index.cjs +1 -1
  165. package/lib/scroll-kit/index.js +213 -209
  166. package/lib/sequence/index.cjs +1 -1
  167. package/lib/sequence/index.js +102 -98
  168. package/lib/size-element/index.cjs +1 -1
  169. package/lib/size-element/index.js +29 -26
  170. package/lib/slicer/index.cjs +1 -1
  171. package/lib/slicer/index.js +118 -113
  172. package/lib/source/index.cjs +1 -1
  173. package/lib/source/index.js +5 -5
  174. package/lib/spa/index.cjs +1 -1
  175. package/lib/spa/index.js +94 -94
  176. package/lib/store/index.cjs +1 -1
  177. package/lib/store/index.d.ts +2 -2
  178. package/lib/store/index.js +10 -8
  179. package/lib/string-B3lm2b7v.js +84 -0
  180. package/lib/string-CbRNzmd9.cjs +1 -0
  181. package/lib/style-DBoQWK0d.js +14 -0
  182. package/lib/style-IDJ6db6n.cjs +1 -0
  183. package/lib/stylesheet-CBTuup4f.js +28 -0
  184. package/lib/stylesheet-xM7sMeuo.cjs +1 -0
  185. package/lib/ticker/index.cjs +1 -1
  186. package/lib/ticker/index.js +4 -120
  187. package/lib/url-CPCO10Sy.cjs +1 -0
  188. package/lib/url-CWCY_qe_.js +124 -0
  189. package/lib/utils/attributes.d.ts +2 -0
  190. package/lib/utils/dom.d.ts +1 -0
  191. package/lib/utils/index.cjs +1 -1
  192. package/lib/utils/index.js +260 -226
  193. package/lib/utils/polyfills.d.ts +1 -1
  194. package/lib/utils/timeouts.d.ts +6 -1
  195. package/lib/video/index.cjs +1 -1
  196. package/lib/video/index.js +35 -33
  197. package/lib/window-resizer/index.cjs +1 -1
  198. package/lib/window-resizer/index.js +27 -24
  199. package/lib/youtube/index.cjs +1 -1
  200. package/lib/youtube/index.js +56 -54
  201. package/package.json +11 -24
  202. package/lib/Animation-BzTjZIE-.js +0 -108
  203. package/lib/Animation-C39Ah-LM.cjs +0 -1
  204. package/lib/Composed-C-TV9te3.cjs +0 -1
  205. package/lib/Composed-DyAWjEXE.js +0 -121
  206. package/lib/Damped-CRusiRIV.js +0 -56
  207. package/lib/Damped-Prr0iKu1.cjs +0 -1
  208. package/lib/DragControls-8rNZwQrs.cjs +0 -1
  209. package/lib/DragControls-DBNdMBA4.js +0 -228
  210. package/lib/LocalLinks-BxhSFv_Q.cjs +0 -1
  211. package/lib/LocalLinks-DFZFpbjs.js +0 -62
  212. package/lib/PageAnnouncerElement-0LxZjtVH.js +0 -24
  213. package/lib/PageAnnouncerElement-AQ0Ja6HM.cjs +0 -1
  214. package/lib/PageScroll-0LxFblry.js +0 -62
  215. package/lib/PageScroll-BXJUQwG7.cjs +0 -1
  216. package/lib/SourceElement-BHqPFbna.cjs +0 -5
  217. package/lib/SourceElement-DjbHjynf.js +0 -260
  218. package/lib/Store-Blf4msDz.cjs +0 -1
  219. package/lib/Store-ZThXYBQd.js +0 -152
  220. package/lib/Tweened-Bw1Cn1PJ.js +0 -47
  221. package/lib/Tweened-DWtk9E-O.cjs +0 -1
  222. package/lib/Viewport-BxCr0GlB.cjs +0 -1
  223. package/lib/Viewport-Dt-d9DPi.js +0 -109
  224. package/lib/attributes-69we3byR.js +0 -10
  225. package/lib/attributes-Bf2svn4j.cjs +0 -1
  226. package/lib/canvas-CU5Xjahf.cjs +0 -1
  227. package/lib/canvas-DeZ0SLUJ.js +0 -34
  228. package/lib/coordinates-CgdGoSYs.js +0 -24
  229. package/lib/coordinates-D8Np3cPD.cjs +0 -1
  230. package/lib/custom-elements-DBnCK7Zx.js +0 -24
  231. package/lib/custom-elements-Dh4TWRDJ.cjs +0 -1
  232. package/lib/dom-BETkVSSZ.js +0 -82
  233. package/lib/dom-CBLlqORw.cjs +0 -1
  234. package/lib/easings-BEmRlrDd.js +0 -38
  235. package/lib/easings-GegIwET5.cjs +0 -1
  236. package/lib/element-CGVl1jA-.js +0 -7
  237. package/lib/element-yhcBhsho.cjs +0 -1
  238. package/lib/events-CsVF98U6.js +0 -6
  239. package/lib/events-KVanG9sR.cjs +0 -1
  240. package/lib/file-DSpfWdd9.cjs +0 -1
  241. package/lib/file-GHShUlue.js +0 -24
  242. package/lib/function-C10DGppn.js +0 -17
  243. package/lib/function-MthRj-GJ.cjs +0 -1
  244. package/lib/gestures-C7gbKx11.cjs +0 -1
  245. package/lib/gestures-CcXV6fCp.js +0 -11
  246. package/lib/index-OE2INULi.cjs +0 -1
  247. package/lib/index-e9eDuagL.js +0 -65
  248. package/lib/jsx/hydrate.d.ts +0 -1
  249. package/lib/jsx/integrations/astro/client.cjs +0 -1
  250. package/lib/jsx/integrations/astro/client.d.ts +0 -2
  251. package/lib/jsx/integrations/astro/client.js +0 -50
  252. package/lib/jsx/integrations/astro/index.cjs +0 -1
  253. package/lib/jsx/integrations/astro/index.d.ts +0 -2
  254. package/lib/jsx/integrations/astro/index.js +0 -54
  255. package/lib/jsx/integrations/astro/server.cjs +0 -1
  256. package/lib/jsx/integrations/astro/server.d.ts +0 -3
  257. package/lib/jsx/integrations/astro/server.js +0 -35
  258. package/lib/jsx/plugins/vite.d.ts +0 -21
  259. package/lib/layout-BSMtwCga.js +0 -29
  260. package/lib/layout-Ctc2p3uz.cjs +0 -1
  261. package/lib/math-BOBiC4TN.js +0 -45
  262. package/lib/math-GDWEqu7y.cjs +0 -1
  263. package/lib/metadata-BcYZ5w3T.cjs +0 -1
  264. package/lib/metadata-jfowcCyz.js +0 -12
  265. package/lib/morph-B6sGhLCi.cjs +0 -1
  266. package/lib/morph-BQErz7qP.js +0 -242
  267. package/lib/number-ChAm68cm.cjs +0 -1
  268. package/lib/number-CumqY64S.js +0 -40
  269. package/lib/object-CcMK4y_r.js +0 -87
  270. package/lib/object-baN9pgbU.cjs +0 -1
  271. package/lib/polyfills-DJrTJQky.js +0 -24
  272. package/lib/polyfills-Df4r-ETT.cjs +0 -1
  273. package/lib/render-DQs7rIoN.cjs +0 -1
  274. package/lib/render-D_0FCWEu.js +0 -18
  275. package/lib/scroll-BA2WnUrb.cjs +0 -1
  276. package/lib/scroll-DY5senkF.js +0 -37
  277. package/lib/string-BlMQbe8b.js +0 -70
  278. package/lib/string-DUXXtU8v.cjs +0 -1
  279. package/lib/style-At6aDoqG.cjs +0 -1
  280. package/lib/style-j2TwriJ_.js +0 -10
  281. package/lib/stylesheet-5_o7PFzM.cjs +0 -1
  282. package/lib/stylesheet-DdBzowZY.js +0 -24
  283. package/lib/url-CHgcNwJ1.cjs +0 -1
  284. package/lib/url-CYgo5vrG.js +0 -113
  285. package/lib/vite-C-i3hVDL.js +0 -75
  286. package/lib/vite-DzanPumM.cjs +0 -44
package/lib/jsx/index.js CHANGED
@@ -1,365 +1,186 @@
1
- var X = Object.defineProperty, z = Object.defineProperties;
2
- var J = Object.getOwnPropertyDescriptors;
3
- var _ = Object.getOwnPropertySymbols;
4
- var Q = Object.prototype.hasOwnProperty, U = Object.prototype.propertyIsEnumerable;
5
- var $ = (t) => {
6
- throw TypeError(t);
7
- };
8
- var L = (t, e, n) => e in t ? X(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, m = (t, e) => {
9
- for (var n in e || (e = {}))
10
- Q.call(e, n) && L(t, n, e[n]);
11
- if (_)
12
- for (var n of _(e))
13
- U.call(e, n) && L(t, n, e[n]);
14
- return t;
15
- }, H = (t, e) => z(t, J(e));
16
- var O = (t, e, n) => e.has(t) || $("Cannot " + n);
17
- var y = (t, e, n) => (O(t, e, "read from private field"), n ? n.call(t) : e.get(t)), x = (t, e, n) => e.has(t) ? $("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), D = (t, e, n, r) => (O(t, e, "write to private field"), r ? r.call(t, n) : e.set(t, n), n);
18
- import { S } from "../Store-ZThXYBQd.js";
19
- import { c as M } from "../string-BlMQbe8b.js";
20
- import { k as Y, p as Z } from "../morph-BQErz7qP.js";
1
+ var __defProp = Object.defineProperty, __defProps = Object.defineProperties;
2
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
3
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty, __propIsEnum = Object.prototype.propertyIsEnumerable;
5
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: !0, configurable: !0, writable: !0, value }) : obj[key] = value, __spreadValues = (a, b2) => {
6
+ for (var prop in b2 || (b2 = {}))
7
+ __hasOwnProp.call(b2, prop) && __defNormalProp(a, prop, b2[prop]);
8
+ if (__getOwnPropSymbols)
9
+ for (var prop of __getOwnPropSymbols(b2))
10
+ __propIsEnum.call(b2, prop) && __defNormalProp(a, prop, b2[prop]);
11
+ return a;
12
+ }, __spreadProps = (a, b2) => __defProps(a, __getOwnPropDescs(b2)), __name = (target, value) => __defProp(target, "name", { value, configurable: !0 });
13
+ import { a as activeComponent } from "../render-LpimRXgl.js";
14
+ import { F, h, b, i, r } from "../render-LpimRXgl.js";
15
+ import { CSSProperty } from "../css-property/index.js";
16
+ import { c as camelToKebab } from "../string-B3lm2b7v.js";
21
17
  import "construct-style-sheets-polyfill";
22
- import "../index-e9eDuagL.js";
23
- import { connector as k } from "../connector/index.js";
24
- import { b as P, C as v, a as j, D as V, R as G } from "../Composed-DyAWjEXE.js";
25
- import { r as Tt } from "../render-D_0FCWEu.js";
26
- import { a as Mt } from "../vite-C-i3hVDL.js";
27
- const f = { current: null };
28
- var b, p;
29
- class tt extends HTMLElement {
30
- constructor() {
31
- super();
32
- x(this, b, []);
33
- x(this, p, []);
34
- f.current = this;
35
- }
36
- addConnectCallback(n) {
37
- y(this, b).push(n);
38
- }
39
- addDisconnectCallback(n) {
40
- y(this, p).push(n);
41
- }
42
- connectedCallback() {
43
- y(this, b).forEach((n) => {
44
- const r = n(this);
45
- r && y(this, p).push(r);
46
- });
47
- }
48
- disconnectedCallback() {
49
- y(this, p).forEach((n) => {
50
- n(this);
51
- }), D(this, b, []), D(this, p, []);
52
- }
53
- }
54
- b = new WeakMap(), p = new WeakMap();
55
- function C(t, e, n) {
56
- const r = e.subscribe((c) => {
57
- n(c);
58
- });
59
- k.subscribe(t, {
60
- disconnectCallback: () => {
61
- r();
62
- },
63
- maxWaitSec: 20,
64
- unsubscribeAfterDisconnect: !0
65
- });
66
- }
67
- function W(t, e) {
68
- e && (e instanceof S ? C(t, e, (n) => {
69
- n.previous && t.classList.remove(n.previous.toString()), n.current && t.classList.add(n.current.toString());
70
- }) : typeof e == "object" && !Array.isArray(e) ? Object.entries(e).forEach(([n, r]) => {
71
- r instanceof S ? C(t, r, (c) => {
72
- t.classList.toggle(n, !!c.current);
73
- }) : r && t.classList.add(n);
74
- }) : Array.isArray(e) ? e.forEach((n) => {
75
- typeof n == "string" ? t.classList.add(n) : W(t, n);
76
- }) : e.toString().split(" ").map((n) => t.classList.add(n.trim())));
77
- }
78
- function et(t, e) {
79
- e && (typeof e == "object" ? Object.entries(e).forEach(([n, r]) => {
80
- r instanceof S ? C(t, r, (c) => {
81
- var o;
82
- t.style[n] = (o = c.current) == null ? void 0 : o.toString();
83
- }) : (typeof r == "number" || typeof r == "string" || typeof r == "boolean") && (t.style[n] = r.toString());
84
- }) : typeof e == "string" && (t.style = e));
85
- }
86
- function w(t, e, n) {
87
- e === "ref" && n ? Array.isArray(n) ? n.forEach((r) => {
88
- typeof r == "object" && "value" in r && (r.value = t);
89
- }) : typeof n == "object" && "value" in n && (n.value = t) : e === "className" || e === "class" ? W(t, n) : e === "style" ? et(t, n) : e === "setHtml" ? t.innerHTML = n : typeof n == "number" ? e === "tabIndex" ? t.setAttribute("tabindex", n.toString()) : w(t, e, n.toString()) : typeof n == "string" ? e === "htmlFor" ? t.setAttribute("for", n) : t.setAttribute(e, n) : typeof n == "boolean" ? n ? t.setAttribute(e, "") : t.removeAttribute(e) : n instanceof S && C(t, n, (r) => {
90
- e in t ? t[e] = r.current : w(t, e, r.current);
91
- });
92
- }
93
- function nt(t, e) {
94
- for (const [n, r] of Object.entries(e != null ? e : {}))
95
- typeof r == "function" && n.startsWith("on") ? t.addEventListener(
96
- n.replace("on", "").toLowerCase(),
97
- r
98
- ) : w(t, n, r);
99
- }
100
- function I(t, e) {
101
- return t === "svg" ? document.createElementNS("http://www.w3.org/2000/svg", "svg") : e ? document.createElementNS("http://www.w3.org/2000/svg", t) : document.createElement(t);
102
- }
103
- function B(t) {
104
- const e = [];
105
- return (Array.isArray(t) ? t : [t]).forEach((r) => {
106
- r != null && (typeof r == "number" ? e.push(r.toString()) : Array.isArray(r) ? r.forEach((c) => {
107
- e.push(...B(c));
108
- }) : e.push(r));
109
- }), e;
110
- }
111
- function rt(t, e, n) {
112
- const r = t.childNodes[n];
113
- r && r.nodeType === Node.TEXT_NODE ? r.textContent !== String(e) && (console.warn(
114
- `Hydration text mismatch: expected "${e}", got "${r.textContent}"`
115
- ), r.textContent = String(e)) : e != null && e !== "" && t.insertBefore(
116
- document.createTextNode(String(e)),
117
- t.childNodes[n] || null
118
- );
119
- }
120
- function ot(t, e) {
121
- const n = [...t.childNodes].filter((i) => i.__storeId === e.id), r = e.current, c = Array.isArray(r) ? r : [r], o = [];
122
- if (c.forEach((i) => {
123
- let s = null;
124
- typeof i == "boolean" || typeof i == "number" || typeof i == "string" ? s = document.createTextNode(i.toString()) : i instanceof Node && (s = i), s && (s.__storeId = e.id, o.push(s));
125
- }), e instanceof P) {
126
- const i = [];
127
- o.forEach((s, a) => {
128
- const d = n.find(
129
- (u) => u.__key === s.__key
130
- );
131
- d ? d.isEqualNode(s) ? i.push(d) : (d.replaceWith(s), i.push(s)) : (i.push(s), t.appendChild(s));
132
- }), n.forEach((s) => {
133
- i.includes(s) || s.remove();
134
- });
135
- } else
136
- o.forEach((i, s) => {
137
- var d;
138
- const a = n[s];
139
- if (a)
140
- a.isEqualNode(i) || (a.replaceWith(i), n[s] = i);
141
- else {
142
- const u = n[n.length - 1];
143
- u ? (d = u.parentNode) == null || d.insertBefore(
144
- i,
145
- u.nextSibling
146
- ) : t.appendChild(i);
147
- }
148
- }), n.slice(o.length).forEach((i) => {
149
- i.remove();
150
- });
151
- }
152
- class N {
153
- constructor(e, n, r) {
154
- this.tag = e, this.attributes = n, this.children = r;
155
- }
156
- }
157
- class g extends N {
158
- }
159
- class R extends N {
160
- }
161
- class F extends N {
162
- }
163
- let E = !1;
164
- function st() {
165
- E = !0;
166
- }
167
- function it() {
168
- E = !1;
169
- }
170
- function l(t, e, n, r = !1) {
171
- const c = B(n);
172
- nt(t, e), c.forEach((o, i) => {
173
- if (o instanceof S)
174
- C(t, o, () => {
175
- ot(t, o);
176
- });
177
- else if (o instanceof g)
178
- o.tag === "shadow" && t.shadowRoot ? l(
179
- t.shadowRoot,
180
- o.attributes,
181
- o.children
182
- ) : l(t, o.attributes, o.children);
183
- else if (o instanceof R) {
184
- let s = null;
185
- if (E) {
186
- const a = t.children[i];
187
- a && a.nodeName.toLowerCase() === o.tag ? (s = a, l(s, o.attributes, o.children, r)) : (s = I(o.tag, r), l(s, o.attributes, o.children, r), t.append(s));
188
- } else
189
- s = I(o.tag, r), l(s, o.attributes, o.children, r), t.append(s);
190
- } else if (o instanceof F) {
191
- const s = document.createElement(o.tag);
192
- l(s, o.attributes, o.children);
193
- const a = Y(document.head, s);
194
- Z(document.head, a);
195
- } else
196
- E ? rt(t, o, i) : t.append(o);
197
- });
198
- }
199
- const T = /* @__PURE__ */ new Map();
200
- function Ct(t, e, ...n) {
201
- var r;
202
- if (typeof t == "string")
203
- return t === "component" ? new g(t, e, n) : t === "shadow" ? new g(t, e, n) : t === "head" ? new F(t, e, n) : new R(t, e, n);
204
- {
205
- if (t === q)
206
- return q(n);
207
- if (t.template)
208
- return t(m({}, e));
209
- const c = `e-${M(t.name)}`;
210
- let o = customElements.get(c);
211
- o || (o = (r = class extends tt {
212
- constructor() {
213
- super();
214
- }
215
- }, r.formAssociated = t.formAssociated, r), customElements.define(c, o));
216
- const i = (T.get(c) || 0) + 1;
217
- T.set(c, i);
218
- const s = `${c}-${i}`;
219
- let a;
220
- if (E) {
221
- const A = document.querySelector(
222
- `${c}[data-hydrate-id="${s}"]`
223
- );
224
- A && A instanceof o ? a = A : (a = new o(), a.setAttribute("data-hydrate-id", s));
225
- } else
226
- a = new o(), a.setAttribute("data-hydrate-id", s);
227
- const d = H(m({}, e), {
228
- children: n
229
- }), u = t(d);
230
- return a.__props__ = d, (u instanceof g || u instanceof R) && (u != null && u.children || u.attributes) && l(a, u.attributes, u.children), a;
231
- }
232
- }
233
- function q(t) {
234
- const e = document.createDocumentFragment();
235
- return l(e, void 0, t), e;
236
- }
237
- function Et() {
18
+ import { t as ticker } from "../index-ClTMVKJp.js";
19
+ import { S as Store } from "../Store-BRTHeZmO.js";
20
+ import { D as Derived, R as Resource, C as Composed } from "../Composed-BaevH-MP.js";
21
+ import { D as DerivedArray, a as DerivedKeyedArray } from "../DerivedArray-BePrxcLC.js";
22
+ import { elementResizer } from "../element-resizer/index.js";
23
+ import { windowResizer } from "../window-resizer/index.js";
24
+ function useRef() {
238
25
  return { value: null };
239
26
  }
240
- function ct(t) {
241
- f.current.addConnectCallback(t);
242
- }
243
- function At(t) {
244
- f.current.addDisconnectCallback(t);
27
+ __name(useRef, "useRef");
28
+ function useConnect(callback) {
29
+ activeComponent.current.addConnectCallback(callback);
30
+ }
31
+ __name(useConnect, "useConnect");
32
+ function useDisconnect(callback) {
33
+ activeComponent.current.addDisconnectCallback(callback);
34
+ }
35
+ __name(useDisconnect, "useDisconnect");
36
+ function useCSSProperty(property, defaultValue, options) {
37
+ if (activeComponent.current) {
38
+ const cssProperty = new CSSProperty(
39
+ activeComponent.current,
40
+ property,
41
+ defaultValue,
42
+ options
43
+ );
44
+ return useConnect(() => (options != null && options.callback && cssProperty.subscribe(options.callback), cssProperty.observe(), () => {
45
+ cssProperty.close();
46
+ })), cssProperty;
47
+ }
245
48
  }
246
- function gt(t) {
247
- const e = f.current.attachInternals();
248
- return t == null || t(e), e;
49
+ __name(useCSSProperty, "useCSSProperty");
50
+ function useInternals(callback) {
51
+ const internals = activeComponent.current.attachInternals();
52
+ return callback == null || callback(internals), internals;
249
53
  }
250
- function wt(t, e) {
251
- const n = f.current.attachShadow(m({
54
+ __name(useInternals, "useInternals");
55
+ function useShadow(init, callback) {
56
+ const shadowRoot = activeComponent.current.attachShadow(__spreadValues({
252
57
  mode: "open"
253
- }, t));
254
- return e == null || e(n), n;
255
- }
256
- function K(t) {
257
- const e = new CSSStyleSheet();
258
- return e.replaceSync(t), e;
259
- }
260
- function ft(t) {
261
- let e = "";
262
- const n = (r, c) => {
263
- c && (e += `${c} {`);
264
- for (const [o, i] of Object.entries(r))
265
- typeof i == "object" && i !== null ? n(i, o) : e += `${M(o)}: ${i};`;
266
- c && (e += "}");
267
- };
268
- return n(t), e;
269
- }
270
- function at(t, e) {
271
- const n = K(e), r = [];
272
- for (const c of t.adoptedStyleSheets)
273
- Array.from(n.cssRules).filter((i) => !Array.from(c.cssRules).some(
274
- (s) => s.cssText === i.cssText
275
- )).forEach((i) => {
276
- const s = c.insertRule(i.cssText);
277
- r.push(() => c.deleteRule(s));
58
+ }, init));
59
+ return callback == null || callback(shadowRoot), shadowRoot;
60
+ }
61
+ __name(useShadow, "useShadow");
62
+ function createStylesheet(cssText) {
63
+ const styleSheet = new CSSStyleSheet();
64
+ return styleSheet.replaceSync(cssText), styleSheet;
65
+ }
66
+ __name(createStylesheet, "createStylesheet");
67
+ function generateCSS(source) {
68
+ let cssText = "";
69
+ const processObject = /* @__PURE__ */ __name((obj, selector) => {
70
+ selector && (cssText += `${selector} {`);
71
+ for (const [key, value] of Object.entries(obj))
72
+ typeof value == "object" && value !== null ? processObject(value, key) : cssText += `${camelToKebab(key)}: ${value};`;
73
+ selector && (cssText += "}");
74
+ }, "processObject");
75
+ return processObject(source), cssText;
76
+ }
77
+ __name(generateCSS, "generateCSS");
78
+ function addStylesToShadowRoot(shadowRoot, cssText) {
79
+ const newStylesheet = createStylesheet(cssText), destroyCallbacks = [];
80
+ for (const currentStylesheet of shadowRoot.adoptedStyleSheets)
81
+ Array.from(newStylesheet.cssRules).filter((newRule) => !Array.from(currentStylesheet.cssRules).some(
82
+ (currentRule) => currentRule.cssText === newRule.cssText
83
+ )).forEach((newRule) => {
84
+ const index = currentStylesheet.insertRule(newRule.cssText);
85
+ destroyCallbacks.push(() => currentStylesheet.deleteRule(index));
278
86
  });
279
- return () => r.forEach((c) => c());
280
- }
281
- function ut(t) {
282
- const e = document.createElement("style");
283
- return e.textContent = t, document.head.appendChild(e), () => e.remove();
284
- }
285
- function xt(t) {
286
- const e = ft(t);
287
- if (f.current.shadowRoot) {
288
- f.current.shadowRoot.adoptedStyleSheets = [
289
- ...f.current.shadowRoot.adoptedStyleSheets,
290
- K(e)
87
+ return () => destroyCallbacks.forEach((callback) => callback());
88
+ }
89
+ __name(addStylesToShadowRoot, "addStylesToShadowRoot");
90
+ function addStylesToDocument(cssText) {
91
+ const styleElement = document.createElement("style");
92
+ return styleElement.textContent = cssText, document.head.appendChild(styleElement), () => styleElement.remove();
93
+ }
94
+ __name(addStylesToDocument, "addStylesToDocument");
95
+ function useStylesheet(source) {
96
+ const cssText = generateCSS(source);
97
+ if (activeComponent.current.shadowRoot) {
98
+ activeComponent.current.shadowRoot.adoptedStyleSheets = [
99
+ ...activeComponent.current.shadowRoot.adoptedStyleSheets,
100
+ createStylesheet(cssText)
291
101
  ];
292
102
  return;
293
103
  }
294
- ct((n) => {
295
- const r = n.getRootNode();
296
- if (r === document) {
104
+ useConnect((element) => {
105
+ const rootNode = element.getRootNode();
106
+ if (rootNode === document) {
297
107
  if (!Array.from(
298
108
  document.head.querySelectorAll("style")
299
- ).find((o) => o.textContent === e))
300
- return ut(e);
301
- } else if (r instanceof ShadowRoot)
302
- return at(r, e);
109
+ ).find((style) => style.textContent === cssText))
110
+ return addStylesToDocument(cssText);
111
+ } else if (rootNode instanceof ShadowRoot)
112
+ return addStylesToShadowRoot(rootNode, cssText);
303
113
  });
304
114
  }
305
- function Dt(...t) {
306
- const e = new S(...t);
307
- return f.current && f.current.addDisconnectCallback(() => {
308
- e.close();
309
- }), e;
310
- }
311
- function Rt(...t) {
312
- const e = new V(...t);
313
- return f.current && f.current.addDisconnectCallback(() => {
314
- e.close();
315
- }), e;
316
- }
317
- function Nt(...t) {
318
- const e = new j(...t);
319
- return f.current && f.current.addDisconnectCallback(() => {
320
- e.close();
321
- }), e;
322
- }
323
- function _t(...t) {
324
- const e = new P(...t);
325
- return f.current && f.current.addDisconnectCallback(() => {
326
- e.close();
327
- }), e;
328
- }
329
- function Lt(...t) {
330
- const e = new G(...t);
331
- return f.current && f.current.addDisconnectCallback(() => {
332
- e.close();
333
- }), e;
334
- }
335
- function $t(...t) {
336
- const e = new v(...t);
337
- return f.current && f.current.addDisconnectCallback(() => {
338
- e.close();
339
- }), e;
340
- }
341
- function Ht(t, e, n) {
342
- st();
343
- const r = /* @__PURE__ */ h(t, m({}, e), n);
344
- return it(), r;
345
- }
115
+ __name(useStylesheet, "useStylesheet");
116
+ function subscribe(create) {
117
+ const store = create();
118
+ return activeComponent.current && activeComponent.current.addDisconnectCallback(() => {
119
+ store.close();
120
+ }), store;
121
+ }
122
+ __name(subscribe, "subscribe");
123
+ function useStore(...parameters) {
124
+ return subscribe(() => new Store(...parameters));
125
+ }
126
+ __name(useStore, "useStore");
127
+ function useDerivedStore(...parameters) {
128
+ return subscribe(() => new Derived(...parameters));
129
+ }
130
+ __name(useDerivedStore, "useDerivedStore");
131
+ function useDerivedArrayStore(...parameters) {
132
+ return subscribe(() => new DerivedArray(...parameters));
133
+ }
134
+ __name(useDerivedArrayStore, "useDerivedArrayStore");
135
+ function useDerivedKeyedArrayStore(...parameters) {
136
+ return subscribe(() => new DerivedKeyedArray(...parameters));
137
+ }
138
+ __name(useDerivedKeyedArrayStore, "useDerivedKeyedArrayStore");
139
+ function useResourceStore(...parameters) {
140
+ return subscribe(() => new Resource(...parameters));
141
+ }
142
+ __name(useResourceStore, "useResourceStore");
143
+ function useComposedStore(...parameters) {
144
+ return subscribe(() => new Composed(...parameters));
145
+ }
146
+ __name(useComposedStore, "useComposedStore");
147
+ function useWindowResize(...parameters) {
148
+ activeComponent.current ? useConnect(() => windowResizer.subscribe(...parameters)) : windowResizer.subscribe(...parameters);
149
+ }
150
+ __name(useWindowResize, "useWindowResize");
151
+ function useElementResize(callback) {
152
+ useConnect((element) => elementResizer.subscribe(element, callback));
153
+ }
154
+ __name(useElementResize, "useElementResize");
155
+ function useTicker(callback, options) {
156
+ if (activeComponent.current)
157
+ useConnect(() => ticker.subscribe(callback, __spreadProps(__spreadValues({}, options), {
158
+ culling: options != null && options.componentCulling ? activeComponent.current : options == null ? void 0 : options.culling
159
+ })));
160
+ else
161
+ return ticker.subscribe(callback, options);
162
+ }
163
+ __name(useTicker, "useTicker");
346
164
  export {
347
- q as Fragment,
348
- Mt as aptechkaVite,
349
- Ct as h,
350
- Ht as hydrate,
351
- T as indexMap,
352
- Tt as render,
353
- $t as useComposedStore,
354
- ct as useConnect,
355
- Nt as useDerivedArrayStore,
356
- _t as useDerivedKeyedArrayStore,
357
- Rt as useDerivedStore,
358
- At as useDisconnect,
359
- gt as useInternals,
360
- Et as useRef,
361
- Lt as useResourceStore,
362
- wt as useShadow,
363
- Dt as useStore,
364
- xt as useStylesheet
165
+ F as Fragment,
166
+ h,
167
+ b as hydrate,
168
+ i as indexMap,
169
+ r as render,
170
+ useCSSProperty,
171
+ useComposedStore,
172
+ useConnect,
173
+ useDerivedArrayStore,
174
+ useDerivedKeyedArrayStore,
175
+ useDerivedStore,
176
+ useDisconnect,
177
+ useElementResize,
178
+ useInternals,
179
+ useRef,
180
+ useResourceStore,
181
+ useShadow,
182
+ useStore,
183
+ useStylesheet,
184
+ useTicker,
185
+ useWindowResize
365
186
  };
@@ -0,0 +1,49 @@
1
+ "use strict";var __defProp=Object.defineProperty;var __name=(target,value)=>__defProp(target,"name",{value,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function aptechkaJSXVitePlugin(options){const moduleBase=options!=null&&options.__dev?"@packages":"aptechka";return[{name:"aptechka-jsx-vite-dev",apply:"serve",transform(code,id){if((id.endsWith(".jsx")||id.endsWith(".tsx"))&&!id.endsWith("render.tsx")){let transformed=code;return transformed+=`
2
+
3
+ if (import.meta.hot) {
4
+ import.meta.hot.on('vite:beforeUpdate', () => {
5
+ })
6
+
7
+ import.meta.hot.accept(async (Module) => {
8
+ const { render } = await import('${moduleBase}/jsx')
9
+ const { camelToKebab, deepQuerySelectorAll } = await import('${moduleBase}/utils')
10
+ const { getCreationSource } = await import('${moduleBase}/dev')
11
+
12
+ for (const key in Module) {
13
+ if (Object.prototype.hasOwnProperty.call(Module, key)) {
14
+ if (typeof Module[key] === 'function') {
15
+ const tag = \`e-\${camelToKebab(Module[key].name)}\`
16
+ const foundedElements = [...deepQuerySelectorAll(tag)]
17
+
18
+ foundedElements.forEach((el) => {
19
+ const nestElements = el.querySelectorAll('[data-nest]')
20
+
21
+ const container = document.createElement('div')
22
+
23
+ render(container, Module[key], {...el.__props__, setHtml: el.__innerHTML__})
24
+ const componentElement = container.firstElementChild
25
+
26
+ if (componentElement) {
27
+ el.dispatchEvent(new CustomEvent('__hmrInstanceReplace', {
28
+ 'detail': {
29
+ element: componentElement
30
+ }
31
+ }))
32
+
33
+ el.replaceWith(componentElement)
34
+
35
+ componentElement
36
+ .querySelectorAll('[data-nest]')
37
+ .forEach((el, i) => {
38
+ if (nestElements[i]) {
39
+ el.replaceWith(nestElements[i])
40
+ }
41
+ })
42
+ }
43
+ })
44
+ }
45
+ }
46
+ }
47
+ })
48
+ }
49
+ `,{code:transformed,map:null}}return null},config(_config,opt){return{esbuild:{jsxFactory:"h",jsxFragment:"Fragment",jsxInject:`import { h, Fragment } from '${moduleBase}/jsx'`,keepNames:!0},define:{__JSX_HMR_DEV__:opt.command==="serve"}}}},{name:"aptechka-jsx-vite-build",apply:"build",config(_config){return{esbuild:{jsxFactory:"h",jsxFragment:"Fragment",jsxInject:`import { h, Fragment } from '${moduleBase}/jsx'`,keepNames:!0,minifyIdentifiers:!1},define:{__JSX_HMR_DEV__:!1}}}}]}__name(aptechkaJSXVitePlugin,"aptechkaJSXVitePlugin");exports.aptechkaJSXVitePlugin=aptechkaJSXVitePlugin;
@@ -0,0 +1,38 @@
1
+ export interface PluginOptions {
2
+ __dev?: boolean;
3
+ }
4
+ export declare function aptechkaJSXVitePlugin(options?: PluginOptions): ({
5
+ name: string;
6
+ apply: "serve";
7
+ transform(code: string, id: string): {
8
+ code: string;
9
+ map: null;
10
+ } | null;
11
+ config(_config: any, opt: any): {
12
+ esbuild: {
13
+ jsxFactory: string;
14
+ jsxFragment: string;
15
+ jsxInject: string;
16
+ keepNames: boolean;
17
+ };
18
+ define: {
19
+ __JSX_HMR_DEV__: boolean;
20
+ };
21
+ };
22
+ } | {
23
+ name: string;
24
+ apply: "build";
25
+ config(_config: any): {
26
+ esbuild: {
27
+ jsxFactory: string;
28
+ jsxFragment: string;
29
+ jsxInject: string;
30
+ keepNames: boolean;
31
+ minifyIdentifiers: boolean;
32
+ };
33
+ define: {
34
+ __JSX_HMR_DEV__: boolean;
35
+ };
36
+ };
37
+ transform?: undefined;
38
+ })[];