aptechka 0.83.1 → 0.84.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (285) hide show
  1. package/lib/Animation-BAiM6_n1.js +111 -0
  2. package/lib/Animation-DMWabSR0.cjs +1 -0
  3. package/lib/Composed-B0fvCtZz.cjs +1 -0
  4. package/lib/Composed-CgA9lLWA.js +75 -0
  5. package/lib/Damped-BLo-OAVb.cjs +1 -0
  6. package/lib/Damped-Dcz5UdMH.js +57 -0
  7. package/lib/DerivedArray-DFhxap_z.js +63 -0
  8. package/lib/DerivedArray-DYtWMW0n.cjs +1 -0
  9. package/lib/DragControls-BPHsDeH6.cjs +1 -0
  10. package/lib/DragControls-D2a1Cifp.js +234 -0
  11. package/lib/LocalLinks-BWFJYhGX.cjs +1 -0
  12. package/lib/LocalLinks-Dwgf3No6.js +65 -0
  13. package/lib/PageAnnouncerElement-DPMlVJZG.cjs +1 -0
  14. package/lib/PageAnnouncerElement-DV9pm_od.js +28 -0
  15. package/lib/PageScroll-BAatKJx6.cjs +1 -0
  16. package/lib/PageScroll-m3TsHnzR.js +65 -0
  17. package/lib/SourceElement-941MrYpq.js +265 -0
  18. package/lib/SourceElement-DBLZ7b5k.cjs +5 -0
  19. package/lib/Store-BCW70G3Z.cjs +1 -0
  20. package/lib/Store-uLDYY9ed.js +158 -0
  21. package/lib/Tweened-BvtjLCa3.js +48 -0
  22. package/lib/Tweened-DdXm1dbF.cjs +1 -0
  23. package/lib/Viewport-BiDoiU8M.js +113 -0
  24. package/lib/Viewport-CXGKUyDy.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 +62 -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 +25 -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 +192 -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-BpO2RJ__.cjs +1 -0
  90. package/lib/index-DpKsHe97.js +68 -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 +171 -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 +221 -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 -834
  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 -122
  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-DLcWVnuH.js +355 -0
  155. package/lib/render-DdomypCo.cjs +1 -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 -877
  160. package/lib/scroll-BvIWh1xB.js +41 -0
  161. package/lib/scroll-CT0lpyRZ.cjs +1 -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 +214 -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-CHvuef16.js +28 -0
  184. package/lib/stylesheet-CQdBaIAA.cjs +1 -0
  185. package/lib/ticker/index.cjs +1 -1
  186. package/lib/ticker/index.js +96 -92
  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 +245 -226
  193. package/lib/utils/polyfills.d.ts +1 -1
  194. package/lib/video/index.cjs +1 -1
  195. package/lib/video/index.js +36 -33
  196. package/lib/window-resizer/index.cjs +1 -1
  197. package/lib/window-resizer/index.js +27 -24
  198. package/lib/youtube/index.cjs +1 -1
  199. package/lib/youtube/index.js +56 -54
  200. package/package.json +11 -24
  201. package/lib/Animation-BzTjZIE-.js +0 -108
  202. package/lib/Animation-C39Ah-LM.cjs +0 -1
  203. package/lib/Composed-C-TV9te3.cjs +0 -1
  204. package/lib/Composed-DyAWjEXE.js +0 -121
  205. package/lib/Damped-CRusiRIV.js +0 -56
  206. package/lib/Damped-Prr0iKu1.cjs +0 -1
  207. package/lib/DragControls-8rNZwQrs.cjs +0 -1
  208. package/lib/DragControls-DBNdMBA4.js +0 -228
  209. package/lib/LocalLinks-BxhSFv_Q.cjs +0 -1
  210. package/lib/LocalLinks-DFZFpbjs.js +0 -62
  211. package/lib/PageAnnouncerElement-0LxZjtVH.js +0 -24
  212. package/lib/PageAnnouncerElement-AQ0Ja6HM.cjs +0 -1
  213. package/lib/PageScroll-0LxFblry.js +0 -62
  214. package/lib/PageScroll-BXJUQwG7.cjs +0 -1
  215. package/lib/SourceElement-BHqPFbna.cjs +0 -5
  216. package/lib/SourceElement-DjbHjynf.js +0 -260
  217. package/lib/Store-Blf4msDz.cjs +0 -1
  218. package/lib/Store-ZThXYBQd.js +0 -152
  219. package/lib/Tweened-Bw1Cn1PJ.js +0 -47
  220. package/lib/Tweened-DWtk9E-O.cjs +0 -1
  221. package/lib/Viewport-BxCr0GlB.cjs +0 -1
  222. package/lib/Viewport-Dt-d9DPi.js +0 -109
  223. package/lib/attributes-69we3byR.js +0 -10
  224. package/lib/attributes-Bf2svn4j.cjs +0 -1
  225. package/lib/canvas-CU5Xjahf.cjs +0 -1
  226. package/lib/canvas-DeZ0SLUJ.js +0 -34
  227. package/lib/coordinates-CgdGoSYs.js +0 -24
  228. package/lib/coordinates-D8Np3cPD.cjs +0 -1
  229. package/lib/custom-elements-DBnCK7Zx.js +0 -24
  230. package/lib/custom-elements-Dh4TWRDJ.cjs +0 -1
  231. package/lib/dom-BETkVSSZ.js +0 -82
  232. package/lib/dom-CBLlqORw.cjs +0 -1
  233. package/lib/easings-BEmRlrDd.js +0 -38
  234. package/lib/easings-GegIwET5.cjs +0 -1
  235. package/lib/element-CGVl1jA-.js +0 -7
  236. package/lib/element-yhcBhsho.cjs +0 -1
  237. package/lib/events-CsVF98U6.js +0 -6
  238. package/lib/events-KVanG9sR.cjs +0 -1
  239. package/lib/file-DSpfWdd9.cjs +0 -1
  240. package/lib/file-GHShUlue.js +0 -24
  241. package/lib/function-C10DGppn.js +0 -17
  242. package/lib/function-MthRj-GJ.cjs +0 -1
  243. package/lib/gestures-C7gbKx11.cjs +0 -1
  244. package/lib/gestures-CcXV6fCp.js +0 -11
  245. package/lib/index-OE2INULi.cjs +0 -1
  246. package/lib/index-e9eDuagL.js +0 -65
  247. package/lib/jsx/hydrate.d.ts +0 -1
  248. package/lib/jsx/integrations/astro/client.cjs +0 -1
  249. package/lib/jsx/integrations/astro/client.d.ts +0 -2
  250. package/lib/jsx/integrations/astro/client.js +0 -50
  251. package/lib/jsx/integrations/astro/index.cjs +0 -1
  252. package/lib/jsx/integrations/astro/index.d.ts +0 -2
  253. package/lib/jsx/integrations/astro/index.js +0 -54
  254. package/lib/jsx/integrations/astro/server.cjs +0 -1
  255. package/lib/jsx/integrations/astro/server.d.ts +0 -3
  256. package/lib/jsx/integrations/astro/server.js +0 -35
  257. package/lib/jsx/plugins/vite.d.ts +0 -21
  258. package/lib/layout-BSMtwCga.js +0 -29
  259. package/lib/layout-Ctc2p3uz.cjs +0 -1
  260. package/lib/math-BOBiC4TN.js +0 -45
  261. package/lib/math-GDWEqu7y.cjs +0 -1
  262. package/lib/metadata-BcYZ5w3T.cjs +0 -1
  263. package/lib/metadata-jfowcCyz.js +0 -12
  264. package/lib/morph-B6sGhLCi.cjs +0 -1
  265. package/lib/morph-BQErz7qP.js +0 -242
  266. package/lib/number-ChAm68cm.cjs +0 -1
  267. package/lib/number-CumqY64S.js +0 -40
  268. package/lib/object-CcMK4y_r.js +0 -87
  269. package/lib/object-baN9pgbU.cjs +0 -1
  270. package/lib/polyfills-DJrTJQky.js +0 -24
  271. package/lib/polyfills-Df4r-ETT.cjs +0 -1
  272. package/lib/render-DQs7rIoN.cjs +0 -1
  273. package/lib/render-D_0FCWEu.js +0 -18
  274. package/lib/scroll-BA2WnUrb.cjs +0 -1
  275. package/lib/scroll-DY5senkF.js +0 -37
  276. package/lib/string-BlMQbe8b.js +0 -70
  277. package/lib/string-DUXXtU8v.cjs +0 -1
  278. package/lib/style-At6aDoqG.cjs +0 -1
  279. package/lib/style-j2TwriJ_.js +0 -10
  280. package/lib/stylesheet-5_o7PFzM.cjs +0 -1
  281. package/lib/stylesheet-DdBzowZY.js +0 -24
  282. package/lib/url-CHgcNwJ1.cjs +0 -1
  283. package/lib/url-CYgo5vrG.js +0 -113
  284. package/lib/vite-C-i3hVDL.js +0 -75
  285. package/lib/vite-DzanPumM.cjs +0 -44
@@ -1,113 +0,0 @@
1
- var R = Object.defineProperty, U = Object.defineProperties;
2
- var $ = Object.getOwnPropertyDescriptors;
3
- var p = Object.getOwnPropertySymbols;
4
- var P = Object.prototype.hasOwnProperty, W = Object.prototype.propertyIsEnumerable;
5
- var S = (t, e, n) => e in t ? R(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, g = (t, e) => {
6
- for (var n in e || (e = {}))
7
- P.call(e, n) && S(t, n, e[n]);
8
- if (p)
9
- for (var n of p(e))
10
- W.call(e, n) && S(t, n, e[n]);
11
- return t;
12
- }, d = (t, e) => U(t, $(e));
13
- function k(t, {
14
- base: e = "",
15
- trailingSlash: n = !1,
16
- mergeParams: s,
17
- removeParams: r
18
- } = {}) {
19
- e = e.endsWith("/") ? e.slice(0, -1) : e, t = t.replace(e, ""), t.startsWith("/") && (t = t.slice(1));
20
- const i = t.split("#"), f = i[0].split("?");
21
- let a = f[0].startsWith("/") ? f[0] : "/" + f[0];
22
- n ? a = !a.endsWith("/") && a !== "/" ? a + "/" : a : a = a.endsWith("/") && a !== "/" ? a.slice(0, -1) : a;
23
- let o = f[1] || "";
24
- if (s) {
25
- const c = new URLSearchParams(o), w = new URLSearchParams(s);
26
- for (const [h, L] of w)
27
- c.has(h) || c.set(h, L);
28
- r == null || r.split(",").forEach((h) => {
29
- c.has(h) && c.delete(h);
30
- }), o = c.toString();
31
- }
32
- const u = e + a, l = i[1], y = `${u}${o ? "?" + o : ""}${l ? "#" + l : ""}`;
33
- return {
34
- leaf: a,
35
- pathname: u,
36
- parameters: o,
37
- hash: l,
38
- path: y
39
- };
40
- }
41
- function O(t = "/") {
42
- return t.endsWith("/") || (t += "/"), t.startsWith("/") || (t += "/"), t;
43
- }
44
- function z(t) {
45
- if (t.action === "none")
46
- return;
47
- const e = t == null ? void 0 : t.searchParameters, n = t.hash ? t.hash.startsWith("#") ? t.hash : "#" + t.hash : "", s = e ? e.startsWith("?") ? e : "?" + e : "", r = `${t.pathname}${s}${n}`, i = d(g({}, t.state), { path: r });
48
- t.action === "push" ? history.pushState(i, "", r) : t.action === "replace" && history.replaceState(i, "", r);
49
- }
50
- function E(t) {
51
- const e = new URLSearchParams(t), n = {};
52
- for (const [s, r] of e)
53
- n[s] = r;
54
- return n;
55
- }
56
- function q(t, e) {
57
- const n = new URL(location.href), s = (e == null ? void 0 : e.toString()) || "";
58
- n.searchParams.set(t, s), history.replaceState(history.state, "", n.href);
59
- }
60
- function m(t, e, n) {
61
- t.setAttribute(e, new URL(t.getAttribute(e), n).pathname);
62
- }
63
- function x(t, e) {
64
- t.querySelectorAll('[href^="./"], [href^="../"]').forEach(
65
- (n) => m(n, "href", e)
66
- ), t.querySelectorAll('[src^="./"], [src^="../"]').forEach(
67
- (n) => m(n, "src", e)
68
- );
69
- }
70
- function T(t, {
71
- base: e = "",
72
- trailingSlash: n = !1
73
- } = {}) {
74
- e = e.replace(/^\/|\/$/g, "");
75
- const s = typeof t == "string" ? t.replace(/^\/|\/$/g, "") : t.pathname.replace(/^\/|\/$/g, "");
76
- let r = "";
77
- return s.includes(e) ? r = `/${s}` : r = `${e}/${s}`, n && !r.endsWith("/") && (r += "/"), new URL(r, location.origin);
78
- }
79
- function B(t) {
80
- try {
81
- const e = new URL(t);
82
- if (window.location.origin === e.origin)
83
- return e.pathname === window.location.pathname ? !e.hash : !0;
84
- } catch (e) {
85
- }
86
- return !1;
87
- }
88
- function H(t) {
89
- if (!t)
90
- return "";
91
- const e = new URLSearchParams();
92
- for (const [n, s] of Object.entries(t))
93
- s != null && s !== !1 && s !== "" && e.append(n, String(s));
94
- return e.toString();
95
- }
96
- function C(t) {
97
- const e = {};
98
- for (const [n, s] of t.entries())
99
- s != null && (e[n] = s);
100
- return e;
101
- }
102
- export {
103
- O as a,
104
- x as b,
105
- z as c,
106
- k as d,
107
- C as e,
108
- B as i,
109
- T as n,
110
- E as p,
111
- H as s,
112
- q as u
113
- };
@@ -1,75 +0,0 @@
1
- function r(t) {
2
- const n = t != null && t.__dev ? "@packages" : "aptechka";
3
- return {
4
- name: "jsx-hmr-plugin",
5
- apply: "serve",
6
- transform(o, e) {
7
- if ((e.endsWith(".jsx") || e.endsWith(".tsx")) && !e.endsWith("render.tsx")) {
8
- let l = o;
9
- return l += `
10
-
11
- if (import.meta.hot) {
12
- import.meta.hot.accept(async (Module) => {
13
- const { render } = await import('${n}/jsx')
14
- const { camelToKebab } = await import('${n}/utils')
15
- for (const key in Module) {
16
- if (Object.prototype.hasOwnProperty.call(Module, key)) {
17
- if (typeof Module[key] === 'function') {
18
- const tag = \`e-\${camelToKebab(Module[key].name)}\`
19
- const foundedElements = [...document.querySelectorAll(tag)]
20
-
21
- foundedElements.forEach((el) => {
22
- const nestElements = el.querySelectorAll('[data-nest]')
23
-
24
- const container = document.createElement('div')
25
-
26
- render(container, Module[key], el.__props__)
27
- const componentElement = container.firstElementChild
28
-
29
- if (componentElement) {
30
- el.dispatchEvent(new CustomEvent('__hmrInstanceReplace', {
31
- 'detail': {
32
- element: componentElement
33
- }
34
- }))
35
-
36
- el.replaceWith(componentElement)
37
-
38
- componentElement
39
- .querySelectorAll('[data-nest]')
40
- .forEach((el, i) => {
41
- if (nestElements[i]) {
42
- el.replaceWith(nestElements[i])
43
- }
44
- })
45
- }
46
- })
47
- }
48
- }
49
- }
50
- })
51
- }
52
- `, {
53
- code: l,
54
- map: null
55
- };
56
- }
57
- return null;
58
- },
59
- config(o, e) {
60
- return {
61
- esbuild: {
62
- jsxFactory: "h",
63
- jsxFragment: "Fragment",
64
- jsxInject: `import { h, Fragment } from '${n}/jsx'`
65
- },
66
- define: {
67
- __JSX_HMR_DEV__: e.command === "serve"
68
- }
69
- };
70
- }
71
- };
72
- }
73
- export {
74
- r as a
75
- };
@@ -1,44 +0,0 @@
1
- "use strict";function r(t){const n=t!=null&&t.__dev?"@packages":"aptechka";return{name:"jsx-hmr-plugin",apply:"serve",transform(o,e){if((e.endsWith(".jsx")||e.endsWith(".tsx"))&&!e.endsWith("render.tsx")){let l=o;return l+=`
2
-
3
- if (import.meta.hot) {
4
- import.meta.hot.accept(async (Module) => {
5
- const { render } = await import('${n}/jsx')
6
- const { camelToKebab } = await import('${n}/utils')
7
- for (const key in Module) {
8
- if (Object.prototype.hasOwnProperty.call(Module, key)) {
9
- if (typeof Module[key] === 'function') {
10
- const tag = \`e-\${camelToKebab(Module[key].name)}\`
11
- const foundedElements = [...document.querySelectorAll(tag)]
12
-
13
- foundedElements.forEach((el) => {
14
- const nestElements = el.querySelectorAll('[data-nest]')
15
-
16
- const container = document.createElement('div')
17
-
18
- render(container, Module[key], el.__props__)
19
- const componentElement = container.firstElementChild
20
-
21
- if (componentElement) {
22
- el.dispatchEvent(new CustomEvent('__hmrInstanceReplace', {
23
- 'detail': {
24
- element: componentElement
25
- }
26
- }))
27
-
28
- el.replaceWith(componentElement)
29
-
30
- componentElement
31
- .querySelectorAll('[data-nest]')
32
- .forEach((el, i) => {
33
- if (nestElements[i]) {
34
- el.replaceWith(nestElements[i])
35
- }
36
- })
37
- }
38
- })
39
- }
40
- }
41
- }
42
- })
43
- }
44
- `,{code:l,map:null}}return null},config(o,e){return{esbuild:{jsxFactory:"h",jsxFragment:"Fragment",jsxInject:`import { h, Fragment } from '${n}/jsx'`},define:{__JSX_HMR_DEV__:e.command==="serve"}}}}}exports.aptechkaVite=r;