vevet 5.1.4 → 5.2.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 (357) hide show
  1. package/lib/cdn/vevet.iife.min.js +13 -9
  2. package/lib/cjs/base/Callbacks/index.js +31 -3
  3. package/lib/cjs/base/Callbacks/index.js.map +1 -1
  4. package/lib/cjs/base/Module/index.js +40 -9
  5. package/lib/cjs/base/Module/index.js.map +1 -1
  6. package/lib/cjs/base/Responsive/index.js +10 -3
  7. package/lib/cjs/base/Responsive/index.js.map +1 -1
  8. package/lib/cjs/components/Canvas/index.js +19 -4
  9. package/lib/cjs/components/Canvas/index.js.map +1 -1
  10. package/lib/cjs/components/CanvasMedia/index.js +15 -2
  11. package/lib/cjs/components/CanvasMedia/index.js.map +1 -1
  12. package/lib/cjs/components/Cursor/index.js +54 -29
  13. package/lib/cjs/components/Cursor/index.js.map +1 -1
  14. package/lib/cjs/components/Cursor/styles.js +4 -3
  15. package/lib/cjs/components/Cursor/styles.js.map +1 -1
  16. package/lib/cjs/components/InView/index.js +17 -3
  17. package/lib/cjs/components/InView/index.js.map +1 -1
  18. package/lib/cjs/components/Marquee/index.js +47 -29
  19. package/lib/cjs/components/Marquee/index.js.map +1 -1
  20. package/lib/cjs/components/Pointers/index.js +4 -4
  21. package/lib/cjs/components/Pointers/index.js.map +1 -1
  22. package/lib/cjs/components/Pointers/styles.js +2 -1
  23. package/lib/cjs/components/Pointers/styles.js.map +1 -1
  24. package/lib/cjs/components/Preloader/index.js +16 -5
  25. package/lib/cjs/components/Preloader/index.js.map +1 -1
  26. package/lib/cjs/components/ProgressPreloader/index.js +23 -14
  27. package/lib/cjs/components/ProgressPreloader/index.js.map +1 -1
  28. package/lib/cjs/components/Raf/index.js +16 -3
  29. package/lib/cjs/components/Raf/index.js.map +1 -1
  30. package/lib/cjs/components/ScrollProgress/index.js +12 -2
  31. package/lib/cjs/components/ScrollProgress/index.js.map +1 -1
  32. package/lib/cjs/components/Scrollbar/index.js +45 -25
  33. package/lib/cjs/components/Scrollbar/index.js.map +1 -1
  34. package/lib/cjs/components/Scrollbar/styles.js +3 -2
  35. package/lib/cjs/components/Scrollbar/styles.js.map +1 -1
  36. package/lib/cjs/components/Snap/Slide/index.js +18 -1
  37. package/lib/cjs/components/Snap/Slide/index.js.map +1 -1
  38. package/lib/cjs/components/Snap/SlideParallax/constants.js +101 -0
  39. package/lib/cjs/components/Snap/SlideParallax/constants.js.map +1 -0
  40. package/lib/cjs/components/Snap/SlideParallax/globals.js +5 -0
  41. package/lib/cjs/components/Snap/SlideParallax/globals.js.map +1 -0
  42. package/lib/cjs/components/Snap/SlideParallax/index.js +145 -0
  43. package/lib/cjs/components/Snap/SlideParallax/index.js.map +1 -0
  44. package/lib/cjs/components/Snap/SlideParallax/types.js +3 -0
  45. package/lib/cjs/components/Snap/SlideParallax/types.js.map +1 -0
  46. package/lib/cjs/components/Snap/Swipe/index.js +6 -4
  47. package/lib/cjs/components/Snap/Swipe/index.js.map +1 -1
  48. package/lib/cjs/components/Snap/Track/index.js +35 -6
  49. package/lib/cjs/components/Snap/Track/index.js.map +1 -1
  50. package/lib/cjs/components/Snap/Wheel/index.js +2 -1
  51. package/lib/cjs/components/Snap/Wheel/index.js.map +1 -1
  52. package/lib/cjs/components/Snap/index.js +30 -16
  53. package/lib/cjs/components/Snap/index.js.map +1 -1
  54. package/lib/cjs/components/SplitText/index.js +20 -6
  55. package/lib/cjs/components/SplitText/index.js.map +1 -1
  56. package/lib/cjs/components/SplitText/utils/isIgnored.js +2 -1
  57. package/lib/cjs/components/SplitText/utils/isIgnored.js.map +1 -1
  58. package/lib/cjs/components/SplitText/utils/saveInitialNodes.js +2 -1
  59. package/lib/cjs/components/SplitText/utils/saveInitialNodes.js.map +1 -1
  60. package/lib/cjs/components/SplitText/utils/splitBase.js +26 -8
  61. package/lib/cjs/components/SplitText/utils/splitBase.js.map +1 -1
  62. package/lib/cjs/components/SplitText/utils/wrapLetters.js +5 -3
  63. package/lib/cjs/components/SplitText/utils/wrapLetters.js.map +1 -1
  64. package/lib/cjs/components/SplitText/utils/wrapLines.js +7 -5
  65. package/lib/cjs/components/SplitText/utils/wrapLines.js.map +1 -1
  66. package/lib/cjs/components/SplitText/utils/wrapWords.js +12 -9
  67. package/lib/cjs/components/SplitText/utils/wrapWords.js.map +1 -1
  68. package/lib/cjs/components/Swipe/index.js +22 -13
  69. package/lib/cjs/components/Swipe/index.js.map +1 -1
  70. package/lib/cjs/components/Swipe/styles.js +2 -1
  71. package/lib/cjs/components/Swipe/styles.js.map +1 -1
  72. package/lib/cjs/components/Timeline/index.js +25 -11
  73. package/lib/cjs/components/Timeline/index.js.map +1 -1
  74. package/lib/cjs/core/handlers/createPageLoad/index.js +6 -5
  75. package/lib/cjs/core/handlers/createPageLoad/index.js.map +1 -1
  76. package/lib/cjs/core/handlers/createViewport/index.js +43 -20
  77. package/lib/cjs/core/handlers/createViewport/index.js.map +1 -1
  78. package/lib/cjs/core/index.js +12 -8
  79. package/lib/cjs/core/index.js.map +1 -1
  80. package/lib/cjs/global/initVevet.js +2 -1
  81. package/lib/cjs/global/initVevet.js.map +1 -1
  82. package/lib/cjs/index.js +2 -1
  83. package/lib/cjs/index.js.map +1 -1
  84. package/lib/cjs/internal/cn.js +19 -0
  85. package/lib/cjs/internal/cn.js.map +1 -0
  86. package/lib/cjs/internal/env.js +8 -0
  87. package/lib/cjs/internal/env.js.map +1 -0
  88. package/lib/cjs/internal/isNumber.js +7 -0
  89. package/lib/cjs/internal/isNumber.js.map +1 -0
  90. package/lib/cjs/internal/isString.js +7 -0
  91. package/lib/cjs/internal/isString.js.map +1 -0
  92. package/lib/cjs/internal/isUndefined.js +7 -0
  93. package/lib/cjs/internal/isUndefined.js.map +1 -0
  94. package/lib/cjs/internal/noopIfDestroyed.js +20 -0
  95. package/lib/cjs/internal/noopIfDestroyed.js.map +1 -0
  96. package/lib/cjs/internal/textDirection.js +7 -0
  97. package/lib/cjs/internal/textDirection.js.map +1 -0
  98. package/lib/cjs/manifest.json +1 -1
  99. package/lib/cjs/utils/common/toPixels.js +4 -3
  100. package/lib/cjs/utils/common/toPixels.js.map +1 -1
  101. package/lib/esm/base/Callbacks/index.js +30 -3
  102. package/lib/esm/base/Callbacks/index.js.map +1 -1
  103. package/lib/esm/base/Module/index.js +37 -9
  104. package/lib/esm/base/Module/index.js.map +1 -1
  105. package/lib/esm/base/Responsive/index.js +10 -3
  106. package/lib/esm/base/Responsive/index.js.map +1 -1
  107. package/lib/esm/components/Canvas/index.js +19 -4
  108. package/lib/esm/components/Canvas/index.js.map +1 -1
  109. package/lib/esm/components/CanvasMedia/index.js +15 -2
  110. package/lib/esm/components/CanvasMedia/index.js.map +1 -1
  111. package/lib/esm/components/Cursor/index.js +54 -29
  112. package/lib/esm/components/Cursor/index.js.map +1 -1
  113. package/lib/esm/components/Cursor/styles.js +7 -2
  114. package/lib/esm/components/Cursor/styles.js.map +1 -1
  115. package/lib/esm/components/InView/index.js +17 -3
  116. package/lib/esm/components/InView/index.js.map +1 -1
  117. package/lib/esm/components/Marquee/index.js +47 -29
  118. package/lib/esm/components/Marquee/index.js.map +1 -1
  119. package/lib/esm/components/Pointers/index.js +4 -4
  120. package/lib/esm/components/Pointers/index.js.map +1 -1
  121. package/lib/esm/components/Pointers/styles.js +2 -1
  122. package/lib/esm/components/Pointers/styles.js.map +1 -1
  123. package/lib/esm/components/Preloader/index.js +16 -5
  124. package/lib/esm/components/Preloader/index.js.map +1 -1
  125. package/lib/esm/components/ProgressPreloader/index.js +23 -14
  126. package/lib/esm/components/ProgressPreloader/index.js.map +1 -1
  127. package/lib/esm/components/Raf/index.js +16 -3
  128. package/lib/esm/components/Raf/index.js.map +1 -1
  129. package/lib/esm/components/ScrollProgress/index.js +12 -2
  130. package/lib/esm/components/ScrollProgress/index.js.map +1 -1
  131. package/lib/esm/components/Scrollbar/index.js +45 -25
  132. package/lib/esm/components/Scrollbar/index.js.map +1 -1
  133. package/lib/esm/components/Scrollbar/styles.js +3 -2
  134. package/lib/esm/components/Scrollbar/styles.js.map +1 -1
  135. package/lib/esm/components/Snap/Slide/index.js +18 -1
  136. package/lib/esm/components/Snap/Slide/index.js.map +1 -1
  137. package/lib/esm/components/Snap/SlideParallax/constants.js +95 -0
  138. package/lib/esm/components/Snap/SlideParallax/constants.js.map +1 -0
  139. package/lib/esm/components/Snap/SlideParallax/globals.js +2 -0
  140. package/lib/esm/components/Snap/SlideParallax/globals.js.map +1 -0
  141. package/lib/esm/components/Snap/SlideParallax/index.js +122 -0
  142. package/lib/esm/components/Snap/SlideParallax/index.js.map +1 -0
  143. package/lib/esm/components/Snap/SlideParallax/types.js +2 -0
  144. package/lib/esm/components/Snap/SlideParallax/types.js.map +1 -0
  145. package/lib/esm/components/Snap/Swipe/index.js +6 -4
  146. package/lib/esm/components/Snap/Swipe/index.js.map +1 -1
  147. package/lib/esm/components/Snap/Track/index.js +31 -6
  148. package/lib/esm/components/Snap/Track/index.js.map +1 -1
  149. package/lib/esm/components/Snap/Wheel/index.js +2 -1
  150. package/lib/esm/components/Snap/Wheel/index.js.map +1 -1
  151. package/lib/esm/components/Snap/index.js +30 -16
  152. package/lib/esm/components/Snap/index.js.map +1 -1
  153. package/lib/esm/components/SplitText/index.js +20 -6
  154. package/lib/esm/components/SplitText/index.js.map +1 -1
  155. package/lib/esm/components/SplitText/utils/isIgnored.js +2 -1
  156. package/lib/esm/components/SplitText/utils/isIgnored.js.map +1 -1
  157. package/lib/esm/components/SplitText/utils/saveInitialNodes.js +2 -1
  158. package/lib/esm/components/SplitText/utils/saveInitialNodes.js.map +1 -1
  159. package/lib/esm/components/SplitText/utils/splitBase.js +16 -8
  160. package/lib/esm/components/SplitText/utils/splitBase.js.map +1 -1
  161. package/lib/esm/components/SplitText/utils/wrapLetters.js +5 -3
  162. package/lib/esm/components/SplitText/utils/wrapLetters.js.map +1 -1
  163. package/lib/esm/components/SplitText/utils/wrapLines.js +7 -5
  164. package/lib/esm/components/SplitText/utils/wrapLines.js.map +1 -1
  165. package/lib/esm/components/SplitText/utils/wrapWords.js +13 -10
  166. package/lib/esm/components/SplitText/utils/wrapWords.js.map +1 -1
  167. package/lib/esm/components/Swipe/index.js +22 -13
  168. package/lib/esm/components/Swipe/index.js.map +1 -1
  169. package/lib/esm/components/Swipe/styles.js +2 -1
  170. package/lib/esm/components/Swipe/styles.js.map +1 -1
  171. package/lib/esm/components/Timeline/index.js +25 -11
  172. package/lib/esm/components/Timeline/index.js.map +1 -1
  173. package/lib/esm/core/handlers/createPageLoad/index.js +6 -5
  174. package/lib/esm/core/handlers/createPageLoad/index.js.map +1 -1
  175. package/lib/esm/core/handlers/createViewport/index.js +43 -20
  176. package/lib/esm/core/handlers/createViewport/index.js.map +1 -1
  177. package/lib/esm/core/index.js +16 -8
  178. package/lib/esm/core/index.js.map +1 -1
  179. package/lib/esm/global/initVevet.js +2 -1
  180. package/lib/esm/global/initVevet.js.map +1 -1
  181. package/lib/esm/index.js +2 -1
  182. package/lib/esm/index.js.map +1 -1
  183. package/lib/esm/internal/cn.js +13 -0
  184. package/lib/esm/internal/cn.js.map +1 -0
  185. package/lib/esm/internal/env.js +5 -0
  186. package/lib/esm/internal/env.js.map +1 -0
  187. package/lib/esm/internal/isNumber.js +4 -0
  188. package/lib/esm/internal/isNumber.js.map +1 -0
  189. package/lib/esm/internal/isString.js +4 -0
  190. package/lib/esm/internal/isString.js.map +1 -0
  191. package/lib/esm/internal/isUndefined.js +4 -0
  192. package/lib/esm/internal/isUndefined.js.map +1 -0
  193. package/lib/esm/internal/noopIfDestroyed.js +13 -0
  194. package/lib/esm/internal/noopIfDestroyed.js.map +1 -0
  195. package/lib/esm/internal/textDirection.js +4 -0
  196. package/lib/esm/internal/textDirection.js.map +1 -0
  197. package/lib/esm/manifest.json +1 -1
  198. package/lib/esm/utils/common/toPixels.js +3 -2
  199. package/lib/esm/utils/common/toPixels.js.map +1 -1
  200. package/lib/types/base/Callbacks/index.d.ts +9 -5
  201. package/lib/types/base/Callbacks/index.d.ts.map +1 -1
  202. package/lib/types/base/Callbacks/types.d.ts +9 -5
  203. package/lib/types/base/Callbacks/types.d.ts.map +1 -1
  204. package/lib/types/base/Module/index.d.ts +5 -5
  205. package/lib/types/base/Module/index.d.ts.map +1 -1
  206. package/lib/types/base/Module/types.d.ts +4 -1
  207. package/lib/types/base/Module/types.d.ts.map +1 -1
  208. package/lib/types/base/Responsive/index.d.ts.map +1 -1
  209. package/lib/types/base/Responsive/types.d.ts +2 -2
  210. package/lib/types/base/Responsive/types.d.ts.map +1 -1
  211. package/lib/types/components/Canvas/index.d.ts +5 -5
  212. package/lib/types/components/Canvas/index.d.ts.map +1 -1
  213. package/lib/types/components/CanvasMedia/index.d.ts +5 -4
  214. package/lib/types/components/CanvasMedia/index.d.ts.map +1 -1
  215. package/lib/types/components/Cursor/index.d.ts +5 -5
  216. package/lib/types/components/Cursor/index.d.ts.map +1 -1
  217. package/lib/types/components/Cursor/styles.d.ts.map +1 -1
  218. package/lib/types/components/InView/index.d.ts +5 -5
  219. package/lib/types/components/InView/index.d.ts.map +1 -1
  220. package/lib/types/components/InView/types.d.ts.map +1 -1
  221. package/lib/types/components/Marquee/index.d.ts +5 -5
  222. package/lib/types/components/Marquee/index.d.ts.map +1 -1
  223. package/lib/types/components/Pointers/index.d.ts +5 -5
  224. package/lib/types/components/Pointers/index.d.ts.map +1 -1
  225. package/lib/types/components/Pointers/styles.d.ts.map +1 -1
  226. package/lib/types/components/Preloader/index.d.ts +5 -5
  227. package/lib/types/components/Preloader/index.d.ts.map +1 -1
  228. package/lib/types/components/ProgressPreloader/index.d.ts +5 -4
  229. package/lib/types/components/ProgressPreloader/index.d.ts.map +1 -1
  230. package/lib/types/components/Raf/index.d.ts +5 -5
  231. package/lib/types/components/Raf/index.d.ts.map +1 -1
  232. package/lib/types/components/ScrollProgress/index.d.ts +5 -5
  233. package/lib/types/components/ScrollProgress/index.d.ts.map +1 -1
  234. package/lib/types/components/Scrollbar/index.d.ts +7 -5
  235. package/lib/types/components/Scrollbar/index.d.ts.map +1 -1
  236. package/lib/types/components/Scrollbar/styles.d.ts.map +1 -1
  237. package/lib/types/components/Snap/Slide/index.d.ts +5 -0
  238. package/lib/types/components/Snap/Slide/index.d.ts.map +1 -1
  239. package/lib/types/components/Snap/SlideParallax/constants.d.ts +7 -0
  240. package/lib/types/components/Snap/SlideParallax/constants.d.ts.map +1 -0
  241. package/lib/types/components/Snap/SlideParallax/globals.d.ts +2 -0
  242. package/lib/types/components/Snap/SlideParallax/globals.d.ts.map +1 -0
  243. package/lib/types/components/Snap/SlideParallax/index.d.ts +25 -0
  244. package/lib/types/components/Snap/SlideParallax/index.d.ts.map +1 -0
  245. package/lib/types/components/Snap/SlideParallax/types.d.ts +22 -0
  246. package/lib/types/components/Snap/SlideParallax/types.d.ts.map +1 -0
  247. package/lib/types/components/Snap/Swipe/index.d.ts.map +1 -1
  248. package/lib/types/components/Snap/Swipe/types.d.ts +1 -6
  249. package/lib/types/components/Snap/Swipe/types.d.ts.map +1 -1
  250. package/lib/types/components/Snap/Track/index.d.ts +10 -1
  251. package/lib/types/components/Snap/Track/index.d.ts.map +1 -1
  252. package/lib/types/components/Snap/Wheel/index.d.ts.map +1 -1
  253. package/lib/types/components/Snap/index.d.ts +5 -5
  254. package/lib/types/components/Snap/index.d.ts.map +1 -1
  255. package/lib/types/components/Snap/types.d.ts +1 -1
  256. package/lib/types/components/SplitText/index.d.ts +5 -5
  257. package/lib/types/components/SplitText/index.d.ts.map +1 -1
  258. package/lib/types/components/SplitText/types.d.ts +27 -0
  259. package/lib/types/components/SplitText/types.d.ts.map +1 -1
  260. package/lib/types/components/SplitText/utils/isIgnored.d.ts.map +1 -1
  261. package/lib/types/components/SplitText/utils/saveInitialNodes.d.ts.map +1 -1
  262. package/lib/types/components/SplitText/utils/splitBase.d.ts +3 -3
  263. package/lib/types/components/SplitText/utils/splitBase.d.ts.map +1 -1
  264. package/lib/types/components/SplitText/utils/wrapLetters.d.ts.map +1 -1
  265. package/lib/types/components/SplitText/utils/wrapLines.d.ts.map +1 -1
  266. package/lib/types/components/SplitText/utils/wrapWords.d.ts +3 -3
  267. package/lib/types/components/SplitText/utils/wrapWords.d.ts.map +1 -1
  268. package/lib/types/components/Swipe/index.d.ts +5 -5
  269. package/lib/types/components/Swipe/index.d.ts.map +1 -1
  270. package/lib/types/components/Swipe/styles.d.ts.map +1 -1
  271. package/lib/types/components/Swipe/types.d.ts +10 -0
  272. package/lib/types/components/Swipe/types.d.ts.map +1 -1
  273. package/lib/types/components/Timeline/index.d.ts +5 -5
  274. package/lib/types/components/Timeline/index.d.ts.map +1 -1
  275. package/lib/types/core/global.d.ts +4 -0
  276. package/lib/types/core/global.d.ts.map +1 -1
  277. package/lib/types/core/handlers/createPageLoad/index.d.ts.map +1 -1
  278. package/lib/types/core/handlers/createViewport/index.d.ts +2 -1
  279. package/lib/types/core/handlers/createViewport/index.d.ts.map +1 -1
  280. package/lib/types/core/index.d.ts.map +1 -1
  281. package/lib/types/global/initVevet.d.ts.map +1 -1
  282. package/lib/types/index.d.ts.map +1 -1
  283. package/lib/types/internal/cn.d.ts +5 -0
  284. package/lib/types/internal/cn.d.ts.map +1 -0
  285. package/lib/types/internal/env.d.ts +5 -0
  286. package/lib/types/internal/env.d.ts.map +1 -0
  287. package/lib/types/internal/isNumber.d.ts +2 -0
  288. package/lib/types/internal/isNumber.d.ts.map +1 -0
  289. package/lib/types/internal/isString.d.ts +2 -0
  290. package/lib/types/internal/isString.d.ts.map +1 -0
  291. package/lib/types/internal/isUndefined.d.ts +2 -0
  292. package/lib/types/internal/isUndefined.d.ts.map +1 -0
  293. package/lib/types/internal/noopIfDestroyed.d.ts +2 -0
  294. package/lib/types/internal/noopIfDestroyed.d.ts.map +1 -0
  295. package/lib/types/internal/textDirection.d.ts +2 -0
  296. package/lib/types/internal/textDirection.d.ts.map +1 -0
  297. package/lib/types/utils/common/toPixels.d.ts.map +1 -1
  298. package/package.json +2 -1
  299. package/src/base/Callbacks/index.ts +26 -7
  300. package/src/base/Callbacks/types.ts +12 -7
  301. package/src/base/Module/index.ts +44 -12
  302. package/src/base/Module/types.ts +5 -1
  303. package/src/base/Responsive/index.ts +2 -4
  304. package/src/base/Responsive/types.ts +4 -5
  305. package/src/components/Canvas/index.ts +21 -13
  306. package/src/components/CanvasMedia/index.ts +17 -10
  307. package/src/components/Cursor/index.ts +56 -38
  308. package/src/components/Cursor/styles.ts +8 -2
  309. package/src/components/InView/index.ts +19 -12
  310. package/src/components/InView/types.ts +2 -6
  311. package/src/components/Marquee/index.ts +50 -39
  312. package/src/components/Pointers/index.ts +16 -13
  313. package/src/components/Pointers/styles.ts +3 -2
  314. package/src/components/Preloader/index.ts +31 -14
  315. package/src/components/ProgressPreloader/index.ts +25 -27
  316. package/src/components/Raf/index.ts +20 -14
  317. package/src/components/ScrollProgress/index.ts +16 -13
  318. package/src/components/Scrollbar/index.ts +52 -36
  319. package/src/components/Scrollbar/styles.ts +4 -2
  320. package/src/components/Snap/Slide/index.ts +26 -0
  321. package/src/components/Snap/SlideParallax/constants.ts +100 -0
  322. package/src/components/Snap/SlideParallax/globals.ts +1 -0
  323. package/src/components/Snap/SlideParallax/index.ts +184 -0
  324. package/src/components/Snap/SlideParallax/types.ts +24 -0
  325. package/src/components/Snap/Swipe/index.ts +8 -4
  326. package/src/components/Snap/Swipe/types.ts +1 -7
  327. package/src/components/Snap/Track/index.ts +45 -6
  328. package/src/components/Snap/Wheel/index.ts +2 -1
  329. package/src/components/Snap/index.ts +31 -32
  330. package/src/components/Snap/types.ts +1 -1
  331. package/src/components/SplitText/index.ts +36 -15
  332. package/src/components/SplitText/types.ts +30 -0
  333. package/src/components/SplitText/utils/isIgnored.ts +2 -1
  334. package/src/components/SplitText/utils/saveInitialNodes.ts +3 -1
  335. package/src/components/SplitText/utils/splitBase.ts +10 -3
  336. package/src/components/SplitText/utils/wrapLetters.ts +5 -3
  337. package/src/components/SplitText/utils/wrapLines.ts +7 -5
  338. package/src/components/SplitText/utils/wrapWords.ts +29 -13
  339. package/src/components/Swipe/index.ts +35 -20
  340. package/src/components/Swipe/styles.ts +3 -2
  341. package/src/components/Swipe/types.ts +12 -0
  342. package/src/components/Timeline/index.ts +23 -22
  343. package/src/core/global.ts +5 -0
  344. package/src/core/handlers/createPageLoad/index.ts +6 -5
  345. package/src/core/handlers/createViewport/index.ts +44 -21
  346. package/src/core/index.ts +17 -11
  347. package/src/global/initVevet.ts +2 -1
  348. package/src/index.ts +2 -3
  349. package/src/internal/cn.ts +15 -0
  350. package/src/internal/env.ts +7 -0
  351. package/src/internal/isNumber.ts +3 -0
  352. package/src/internal/isString.ts +3 -0
  353. package/src/internal/isUndefined.ts +3 -0
  354. package/src/internal/noopIfDestroyed.ts +19 -0
  355. package/src/internal/textDirection.ts +3 -0
  356. package/src/manifest.json +1 -1
  357. package/src/utils/common/toPixels.ts +3 -3
@@ -5,6 +5,23 @@ import { toPixels } from '@/utils';
5
5
  export class SnapTrack {
6
6
  constructor(protected snap: Snap) {}
7
7
 
8
+ /** Interpolation influence */
9
+ protected _influence = {
10
+ current: 0,
11
+ target: 0,
12
+ };
13
+
14
+ /** Gets the interpolation influence */
15
+ get influence() {
16
+ return this._influence.current;
17
+ }
18
+
19
+ /** Sets the interpolation influence */
20
+ set influence(value: number) {
21
+ this._influence.current = value;
22
+ this._influence.target = value;
23
+ }
24
+
8
25
  /** The current track value */
9
26
  protected _current = 0;
10
27
 
@@ -28,13 +45,21 @@ export class SnapTrack {
28
45
 
29
46
  /** Sets the target track value */
30
47
  set target(value: number) {
48
+ const { domSize } = this.snap;
49
+ const diff = value - this._target;
50
+
31
51
  this._target = value;
52
+
53
+ this._influence.target += domSize ? diff / domSize : 0;
54
+ this._influence.target = clamp(this._influence.target, -0.2, 0.2);
32
55
  }
33
56
 
34
57
  /** Set a value to current & target value instantly */
35
58
  public set(value: number) {
36
59
  this.current = value;
37
60
  this.target = value;
61
+ this._influence.current = 0;
62
+ this._influence.target = 0;
38
63
  }
39
64
 
40
65
  /** If can loop */
@@ -65,10 +90,13 @@ export class SnapTrack {
65
90
  }
66
91
 
67
92
  /** Interpolate the current track value */
68
- public lerp(factor: number) {
93
+ public lerp(initialFactor: number) {
69
94
  let { target } = this;
70
95
  const { snap, min, max } = this;
71
96
 
97
+ let lerpFactor = initialFactor;
98
+ const influence = this._influence;
99
+
72
100
  // Edge space & resistance
73
101
 
74
102
  if (!snap.props.loop) {
@@ -89,20 +117,31 @@ export class SnapTrack {
89
117
  // Interpolate current value
90
118
 
91
119
  const rest = Math.abs(this.current - target);
92
- const fastThreshold = 5;
120
+ const fastThreshold = 3;
93
121
 
94
122
  if (rest < fastThreshold) {
95
123
  const fastProgress = 1 - rest / fastThreshold;
96
- const additionalFactor = (1 - factor) / 3;
97
- factor += additionalFactor * fastProgress;
124
+ const additionalFactor = (1 - lerpFactor) / 15;
125
+ lerpFactor += additionalFactor * fastProgress;
98
126
  }
99
127
 
100
- this.current = lerp(this.current, target, factor, 0.000001);
128
+ this.current = lerp(this.current, target, lerpFactor, 0.000001);
129
+
130
+ // Interpolate influence
131
+
132
+ influence.target = lerp(influence.target, 0, initialFactor, 0.000001);
133
+
134
+ influence.current = lerp(
135
+ influence.current,
136
+ influence.target,
137
+ lerpFactor,
138
+ 0.000001,
139
+ );
101
140
  }
102
141
 
103
142
  /** Whether the track is interpolated */
104
143
  get isInterpolated() {
105
- return this.current === this.target;
144
+ return this.current === this.target && this._influence.current === 0;
106
145
  }
107
146
 
108
147
  /** Get minimum track value */
@@ -1,6 +1,7 @@
1
1
  import { addEventListener, clamp, normalizeWheel } from '@/utils';
2
2
  import { Snap } from '..';
3
3
  import { initVevet } from '@/global/initVevet';
4
+ import { isNumber } from '@/internal/isNumber';
4
5
 
5
6
  const deltasCount = 6;
6
7
 
@@ -235,7 +236,7 @@ export class SnapWheel {
235
236
 
236
237
  // NUMBER
237
238
 
238
- if (typeof wheelThrottle === 'number') {
239
+ if (isNumber(wheelThrottle)) {
239
240
  return timeDiff < wheelThrottle;
240
241
  }
241
242
 
@@ -1,4 +1,4 @@
1
- import { Module } from '@/base';
1
+ import { Module, TModuleOnCallbacksProps } from '@/base';
2
2
  import { Timeline } from '../Timeline';
3
3
  import {
4
4
  ISnapCallbacksMap,
@@ -28,15 +28,15 @@ import { SnapWheel } from './Wheel';
28
28
  import { SnapSwipe } from './Swipe';
29
29
  import { SnapTrack } from './Track';
30
30
  import { SnapKeyboard } from './Keyboard';
31
+ import { noopIfDestroyed } from '@/internal/noopIfDestroyed';
32
+ import { isUndefined } from '@/internal/isUndefined';
33
+ import { isNumber } from '@/internal/isNumber';
34
+ import { isString } from '@/internal/isString';
31
35
  import { initVevet } from '@/global/initVevet';
32
36
 
33
37
  export * from './types';
34
38
  export * from './Slide';
35
39
 
36
- // todo: add examples for freemode: sticky
37
-
38
- // todo: fix freemode with negative swipeSpeed
39
-
40
40
  // todo: jsdoc
41
41
 
42
42
  /**
@@ -50,21 +50,21 @@ export * from './Slide';
50
50
  * @group Components
51
51
  */
52
52
  export class Snap<
53
- CallbacksMap extends ISnapCallbacksMap = ISnapCallbacksMap,
54
- StaticProps extends ISnapStaticProps = ISnapStaticProps,
55
- MutableProps extends ISnapMutableProps = ISnapMutableProps,
56
- > extends Module<CallbacksMap, StaticProps, MutableProps> {
53
+ C extends ISnapCallbacksMap = ISnapCallbacksMap,
54
+ S extends ISnapStaticProps = ISnapStaticProps,
55
+ M extends ISnapMutableProps = ISnapMutableProps,
56
+ > extends Module<C, S, M> {
57
57
  /** Retrieves the default static properties. */
58
- public _getStatic(): TRequiredProps<StaticProps> {
58
+ public _getStatic(): TRequiredProps<S> {
59
59
  return {
60
60
  ...super._getStatic(),
61
61
  eventsEmitter: null,
62
62
  activeIndex: 0,
63
- } as TRequiredProps<StaticProps>;
63
+ } as TRequiredProps<S>;
64
64
  }
65
65
 
66
66
  /** Retrieves the default mutable properties. */
67
- public _getMutable(): TRequiredProps<MutableProps> {
67
+ public _getMutable(): TRequiredProps<M> {
68
68
  return {
69
69
  ...super._getMutable(),
70
70
  slides: false,
@@ -72,7 +72,7 @@ export class Snap<
72
72
  centered: false,
73
73
  loop: false,
74
74
  gap: 0,
75
- lerp: 0.2,
75
+ lerp: initVevet().mobile ? 1 : 0.2,
76
76
  freemode: false,
77
77
  stickOnResize: true,
78
78
  friction: 0,
@@ -88,11 +88,10 @@ export class Snap<
88
88
  shortSwipesDuration: 300,
89
89
  shortSwipesThreshold: 30,
90
90
  swipeFriction: false,
91
- swipeLerp: initVevet().mobile ? 1 : 0.6,
92
91
  swipeThreshold: 5,
93
92
  swipeMinTime: 0,
94
93
  swipeInertiaDuration: (distance) => clamp(distance, 500, 2000),
95
- swipeInertiaRatio: 0.3,
94
+ swipeInertiaRatio: 0.5,
96
95
  wheel: false,
97
96
  wheelSpeed: 1,
98
97
  wheelAxis: 'auto',
@@ -101,7 +100,7 @@ export class Snap<
101
100
  stickOnWheelEnd: true,
102
101
  stickOnWheelEndThreshold: 30,
103
102
  slideSize: 'auto',
104
- } as TRequiredProps<MutableProps>;
103
+ } as TRequiredProps<M>;
105
104
  }
106
105
 
107
106
  /** Animation frame for smooth animations */
@@ -140,8 +139,11 @@ export class Snap<
140
139
  /** Target slide index */
141
140
  protected _targetIndex?: number;
142
141
 
143
- constructor(props?: StaticProps & MutableProps) {
144
- super(props);
142
+ constructor(
143
+ props?: S & M,
144
+ onCallbacks?: TModuleOnCallbacksProps<C, Snap<C, S, M>>,
145
+ ) {
146
+ super(props, onCallbacks as any);
145
147
 
146
148
  const { container, activeIndex } = this.props;
147
149
 
@@ -213,6 +215,7 @@ export class Snap<
213
215
  }
214
216
 
215
217
  /** Request resize (handled with debounce timeout) */
218
+ @noopIfDestroyed
216
219
  public resize(isManual = false) {
217
220
  if (isManual) {
218
221
  this._resizeHandler.resize();
@@ -342,16 +345,10 @@ export class Snap<
342
345
  return;
343
346
  }
344
347
 
345
- const { track, props, _swipe: swipe } = this;
346
-
347
- // Get lerp factor
348
- const lerpFactor =
349
- (swipe.isSwiping || swipe.hasInertia) && props.swipeLerp
350
- ? props.swipeLerp
351
- : props.lerp;
348
+ const { track, props } = this;
352
349
 
353
350
  // Interpolate track value
354
- track.lerp(this._raf.lerpFactor(lerpFactor));
351
+ track.lerp(this._raf.lerpFactor(props.lerp));
355
352
 
356
353
  // Stop raf if target reached
357
354
  if (track.isInterpolated) {
@@ -363,6 +360,7 @@ export class Snap<
363
360
  }
364
361
 
365
362
  /** Render slides */
363
+ @noopIfDestroyed
366
364
  public render(frameDuration = 0) {
367
365
  if (this.isEmpty) {
368
366
  return;
@@ -381,7 +379,7 @@ export class Snap<
381
379
  if (
382
380
  magnet &&
383
381
  magnet.slide.index !== this._activeIndex &&
384
- (typeof this._targetIndex === 'undefined' ||
382
+ (isUndefined(this._targetIndex) ||
385
383
  magnet.slide.index === this._targetIndex)
386
384
  ) {
387
385
  this._activeIndex = magnet.slide.index;
@@ -508,6 +506,7 @@ export class Snap<
508
506
  }
509
507
 
510
508
  /** Stick to the nearest magnet */
509
+ @noopIfDestroyed
511
510
  public stick() {
512
511
  const { magnet } = this;
513
512
 
@@ -520,7 +519,7 @@ export class Snap<
520
519
 
521
520
  /** Go to a definite coordinate */
522
521
  public toCoord(coordinate: number, options?: ISnapTransitionArg) {
523
- if (this.isEmpty) {
522
+ if (this.isEmpty || this.isDestroyed) {
524
523
  return false;
525
524
  }
526
525
 
@@ -534,8 +533,7 @@ export class Snap<
534
533
 
535
534
  const durationProp = options?.duration ?? props.duration;
536
535
 
537
- let duration =
538
- typeof durationProp === 'number' ? durationProp : durationProp(diff);
536
+ let duration = isNumber(durationProp) ? durationProp : durationProp(diff);
539
537
  if (diff === 0) {
540
538
  duration = 0;
541
539
  }
@@ -554,6 +552,7 @@ export class Snap<
554
552
  tm.on('update', (data) => {
555
553
  track.current = lerp(start, end, data.eased);
556
554
  track.target = track.current;
555
+ track.influence *= 1 - data.progress;
557
556
 
558
557
  if (data.progress === 1) {
559
558
  this._targetIndex = undefined;
@@ -591,7 +590,7 @@ export class Snap<
591
590
  const { isEmpty, activeIndex, slides, track, props } = this;
592
591
  const { current, max, loopCount } = track;
593
592
 
594
- if (isEmpty) {
593
+ if (isEmpty || this.isDestroyed) {
595
594
  return false;
596
595
  }
597
596
 
@@ -635,7 +634,7 @@ export class Snap<
635
634
  const targetMagnetMax = targetMagnet + max;
636
635
  const allMagnets = [targetMagnetMin, targetMagnet, targetMagnetMax];
637
636
 
638
- if (typeof direction === 'string') {
637
+ if (isString(direction)) {
639
638
  const magnets = allMagnets.filter((magnet) =>
640
639
  direction === 'next' ? magnet >= current : magnet <= current,
641
640
  );
@@ -63,7 +63,7 @@ export interface ISnapMutableProps
63
63
 
64
64
  /**
65
65
  * Linear interpolation factor for smooth coordinates updates.
66
- * @default 0.2
66
+ * @default `vevet.mobile ? 1 : 0.2`
67
67
  */
68
68
  lerp?: number;
69
69
 
@@ -9,10 +9,11 @@ import {
9
9
  ISplitTextStaticProps,
10
10
  ISplitTextWordMeta,
11
11
  } from './types';
12
- import { Module } from '@/base';
12
+ import { Module, TModuleOnCallbacksProps } from '@/base';
13
13
  import { TRequiredProps } from '@/internal/requiredProps';
14
14
  import { initVevet } from '@/global/initVevet';
15
15
  import { saveInitialNodes } from './utils/saveInitialNodes';
16
+ import { noopIfDestroyed } from '@/internal/noopIfDestroyed';
16
17
 
17
18
  export * from './types';
18
19
 
@@ -32,14 +33,14 @@ export * from './types';
32
33
  * @group Components
33
34
  */
34
35
  export class SplitText<
35
- CallbacksMap extends ISplitTextCallbacksMap = ISplitTextCallbacksMap,
36
- StaticProps extends ISplitTextStaticProps = ISplitTextStaticProps,
37
- MutableProps extends ISplitTextMutableProps = ISplitTextMutableProps,
38
- > extends Module<CallbacksMap, StaticProps, MutableProps> {
36
+ C extends ISplitTextCallbacksMap = ISplitTextCallbacksMap,
37
+ S extends ISplitTextStaticProps = ISplitTextStaticProps,
38
+ M extends ISplitTextMutableProps = ISplitTextMutableProps,
39
+ > extends Module<C, S, M> {
39
40
  /**
40
41
  * Retrieves the default static properties.
41
42
  */
42
- public _getStatic(): TRequiredProps<StaticProps> {
43
+ public _getStatic(): TRequiredProps<S> {
43
44
  return {
44
45
  ...super._getStatic(),
45
46
  letters: false,
@@ -54,14 +55,17 @@ export class SplitText<
54
55
  lineWrapperClass: this._cn('__line-wrapper'),
55
56
  resizeDebounce: 0,
56
57
  ignore: null,
57
- } as TRequiredProps<StaticProps>;
58
+ prepareText: (text) => text,
59
+ wordDelimiter: String.fromCharCode(32),
60
+ wordDelimiterOutput: null,
61
+ } as TRequiredProps<S>;
58
62
  }
59
63
 
60
64
  /**
61
65
  * Retrieves the default mutable properties.
62
66
  */
63
- public _getMutable(): TRequiredProps<MutableProps> {
64
- return { ...super._getMutable() } as TRequiredProps<MutableProps>;
67
+ public _getMutable(): TRequiredProps<M> {
68
+ return { ...super._getMutable() } as TRequiredProps<M>;
65
69
  }
66
70
 
67
71
  /**
@@ -146,13 +150,17 @@ export class SplitText<
146
150
  /**
147
151
  * Initializes the SplitText instance and saves the initial state.
148
152
  */
149
- constructor(props?: StaticProps & MutableProps) {
150
- super(props);
153
+ constructor(
154
+ props?: S & M,
155
+ onCallbacks?: TModuleOnCallbacksProps<C, SplitText<C, S, M>>,
156
+ ) {
157
+ super(props, onCallbacks as any);
151
158
 
152
159
  const { container } = this.props;
160
+ const { style } = container;
153
161
 
154
- container.style.fontKerning = 'none';
155
- container.style.display = 'block';
162
+ style.fontKerning = 'none';
163
+ style.display = 'block';
156
164
  container.setAttribute('aria-label', container.textContent || '');
157
165
 
158
166
  this._addTempClassName(container, this._cn(''));
@@ -192,6 +200,7 @@ export class SplitText<
192
200
  /**
193
201
  * Splits the text into letters, words, and optionally lines based on configuration.
194
202
  */
203
+ @noopIfDestroyed
195
204
  public split() {
196
205
  this.callbacks.emit('beforeSplit', undefined);
197
206
 
@@ -212,8 +221,17 @@ export class SplitText<
212
221
  return;
213
222
  }
214
223
 
215
- const { container, letterTag, wordTag, wordClass, letterClass, ignore } =
216
- this.props;
224
+ const {
225
+ container,
226
+ letterTag,
227
+ wordTag,
228
+ wordClass,
229
+ letterClass,
230
+ ignore,
231
+ prepareText,
232
+ wordDelimiter,
233
+ wordDelimiterOutput,
234
+ } = this.props;
217
235
 
218
236
  this._isBaseSplit = true;
219
237
 
@@ -225,6 +243,9 @@ export class SplitText<
225
243
  letterTag,
226
244
  wordTag,
227
245
  ignore,
246
+ prepareText,
247
+ wordDelimiter,
248
+ wordDelimiterOutput,
228
249
  });
229
250
 
230
251
  this._wordsMeta = wordsMeta;
@@ -82,6 +82,36 @@ export interface ISplitTextStaticProps extends IModuleStaticProps {
82
82
  * @default null
83
83
  */
84
84
  ignore?: string | HTMLElement[] | ((element: HTMLElement) => boolean) | null;
85
+
86
+ /**
87
+ * Optional callback to preprocess text before it is split into words.
88
+ * This function receives the original text and should return the modified text.
89
+ * It is useful for languages like Chinese where standard word splitting may not work correctly.
90
+ *
91
+ * @example
92
+ *
93
+ * const segmenter = new Intl.Segmenter('zh', { granularity: 'word' });
94
+ *
95
+ * const instance = new SplitText({
96
+ * container,
97
+ * prepareText: (source) => [...segmenter.segment(source)].map((s) => s.segment).join(' '),
98
+ });
99
+ */
100
+ prepareText?: (text: string) => string;
101
+
102
+ /**
103
+ * Specifies a custom delimiter used to split text into words.
104
+ * By default, splitting occurs on regular whitespace.
105
+ * @default " "
106
+ */
107
+ wordDelimiter?: string;
108
+
109
+ /**
110
+ * Provides an alternative delimiter to use when outputting the split words.
111
+ * Useful when a custom input delimiter is used but the output should differ.
112
+ * @default null
113
+ */
114
+ wordDelimiterOutput?: string | null;
85
115
  }
86
116
 
87
117
  /** Mutable properties for the SplitText module */
@@ -1,3 +1,4 @@
1
+ import { isString } from '@/internal/isString';
1
2
  import { ISplitTextStaticProps } from '../types';
2
3
 
3
4
  export function isIgnored(
@@ -8,7 +9,7 @@ export function isIgnored(
8
9
  return false;
9
10
  }
10
11
 
11
- if (typeof ignore === 'string') {
12
+ if (isString(ignore)) {
12
13
  return element.matches(ignore);
13
14
  }
14
15
 
@@ -1,3 +1,5 @@
1
+ import { doc } from '@/internal/env';
2
+
1
3
  interface IClone {
2
4
  node: Node;
3
5
  cssText: string | null;
@@ -25,7 +27,7 @@ export function saveInitialNodes(root: Node) {
25
27
  // Return a function to restore the initial nodes
26
28
  return {
27
29
  restore: () => {
28
- const fragment = document.createDocumentFragment();
30
+ const fragment = doc.createDocumentFragment();
29
31
 
30
32
  flatArray.forEach((element) => {
31
33
  const { node, cssText } = element;
@@ -1,15 +1,20 @@
1
+ import { doc } from '@/internal/env';
1
2
  import { ISplitTextLetterMeta, ISplitTextStaticProps } from '../types';
2
3
  import { wrapLetters } from './wrapLetters';
3
4
  import { wrapWords } from './wrapWords';
4
5
 
5
- interface IProps {
6
+ type TBaseProps = Pick<
7
+ ISplitTextStaticProps,
8
+ 'ignore' | 'prepareText' | 'wordDelimiter' | 'wordDelimiterOutput'
9
+ >;
10
+
11
+ interface IProps extends TBaseProps {
6
12
  container: HTMLElement;
7
13
  letterClassName: string;
8
14
  wordClassName: string;
9
15
  hasLetters: boolean;
10
16
  letterTag: keyof HTMLElementTagNameMap;
11
17
  wordTag: keyof HTMLElementTagNameMap;
12
- ignore: ISplitTextStaticProps['ignore'];
13
18
  }
14
19
 
15
20
  /**
@@ -23,15 +28,17 @@ export function splitBase({
23
28
  letterTag,
24
29
  wordTag,
25
30
  ignore,
31
+ ...props
26
32
  }: IProps) {
27
33
  // Prepare the fragment
28
- const prepareFragment = document.createDocumentFragment();
34
+ const prepareFragment = doc.createDocumentFragment();
29
35
  while (container.childNodes[0]) {
30
36
  prepareFragment.appendChild(container.childNodes[0]);
31
37
  }
32
38
 
33
39
  // Wrap the text into words
34
40
  const wordsMeta = wrapWords({
41
+ ...props,
35
42
  container: prepareFragment as any,
36
43
  classname: wordClassName,
37
44
  tagName: wordTag,
@@ -5,6 +5,8 @@ import {
5
5
  ISplitTextWordMeta,
6
6
  } from '../types';
7
7
  import { isIgnored } from './isIgnored';
8
+ import { cnAdd } from '@/internal/cn';
9
+ import { doc } from '@/internal/env';
8
10
 
9
11
  interface IProps {
10
12
  wordsMeta: ISplitTextWordMeta[];
@@ -19,9 +21,9 @@ interface IProps {
19
21
  export function wrapLetters({ wordsMeta, classname, tagName, ignore }: IProps) {
20
22
  const lettersMeta: ISplitTextLetterMeta[] = [];
21
23
 
22
- const baseElement = document.createElement(tagName);
24
+ const baseElement = doc.createElement(tagName);
23
25
  baseElement.style.display = 'inline-block';
24
- baseElement.classList.add(classname);
26
+ cnAdd(baseElement, classname);
25
27
 
26
28
  // Iterate over each word to wrap its letters
27
29
  wordsMeta.forEach((wordMeta) => {
@@ -45,7 +47,7 @@ export function wrapLetters({ wordsMeta, classname, tagName, ignore }: IProps) {
45
47
 
46
48
  splitLetters.forEach((letterContents) => {
47
49
  const element = baseElement.cloneNode(false) as HTMLElement;
48
- element.appendChild(document.createTextNode(letterContents));
50
+ element.appendChild(doc.createTextNode(letterContents));
49
51
 
50
52
  // Append the letter element to the word's container
51
53
  wordMeta.element.insertBefore(element, textNode);
@@ -1,5 +1,7 @@
1
+ import { cnAdd } from '@/internal/cn';
1
2
  import { ISplitTextLineMeta, ISplitTextWordMeta } from '../types';
2
3
  import { getTextAalignment } from './getTextAalignment';
4
+ import { doc } from '@/internal/env';
3
5
 
4
6
  interface IProps {
5
7
  container: HTMLElement;
@@ -58,10 +60,10 @@ export function wrapLines({
58
60
  let lineIndex = -1;
59
61
  let lastBounding: DOMRect | null = null;
60
62
 
61
- const baseElement = document.createElement(tagName);
63
+ const baseElement = doc.createElement(tagName);
62
64
  baseElement.style.display = 'block';
63
65
  baseElement.setAttribute('aria-hidden', 'true');
64
- baseElement.classList.add(lineClassName);
66
+ cnAdd(baseElement, lineClassName);
65
67
 
66
68
  const boundings = wordsMeta.map((wordMeta) =>
67
69
  wordMeta.element.getBoundingClientRect(),
@@ -95,9 +97,9 @@ export function wrapLines({
95
97
  let wrapper: HTMLElement | undefined;
96
98
 
97
99
  if (hasLinesWrapper) {
98
- wrapper = document.createElement(tagName);
100
+ wrapper = doc.createElement(tagName);
99
101
  wrapper.style.display = 'block';
100
- wrapper.classList.add(lineWrapperClassName);
102
+ cnAdd(wrapper, lineWrapperClassName);
101
103
  wrapper.appendChild(element);
102
104
  }
103
105
 
@@ -123,7 +125,7 @@ export function wrapLines({
123
125
  linesMeta.forEach((line) => {
124
126
  container.insertBefore(line.wrapper ?? line.element, line.nodes[0]);
125
127
 
126
- const fragment = document.createDocumentFragment();
128
+ const fragment = doc.createDocumentFragment();
127
129
  fragment.append(...line.nodes);
128
130
  line.element.append(fragment);
129
131
  });