@thednp/shorty 1.0.3 → 2.0.0-alpha10

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 (353) hide show
  1. package/.eslintrc.cjs +224 -0
  2. package/.lgtm.yml +9 -0
  3. package/.prettierrc.json +15 -0
  4. package/README.md +195 -198
  5. package/cypress/e2e/att.cy.ts +46 -0
  6. package/cypress/e2e/boolean.cy.ts +44 -0
  7. package/cypress/e2e/class.cy.ts +28 -0
  8. package/cypress/e2e/event.cy.ts +51 -0
  9. package/cypress/e2e/get.cy.ts +168 -0
  10. package/cypress/e2e/is.cy.ts +233 -0
  11. package/cypress/e2e/misc.cy.ts +331 -0
  12. package/cypress/e2e/selectors.cy.ts +85 -0
  13. package/cypress/fixtures/custom-elem.js +18 -0
  14. package/cypress/plugins/esbuild-istanbul.ts +50 -0
  15. package/cypress/plugins/tsCompile.ts +34 -0
  16. package/cypress/support/commands.ts +37 -0
  17. package/cypress/support/e2e.ts +21 -0
  18. package/cypress/support/index.js +22 -0
  19. package/cypress/test.html +63 -0
  20. package/cypress.config.ts +30 -0
  21. package/dist/shorty.cjs +2 -0
  22. package/dist/shorty.cjs.map +1 -0
  23. package/dist/shorty.d.ts +1502 -0
  24. package/dist/shorty.js +2 -2628
  25. package/dist/shorty.js.map +1 -0
  26. package/dist/shorty.mjs +552 -0
  27. package/dist/shorty.mjs.map +1 -0
  28. package/dts.config.ts +22 -0
  29. package/package.json +33 -38
  30. package/src/attr/getAttribute.ts +11 -0
  31. package/src/attr/getAttributeNS.ts +12 -0
  32. package/src/attr/hasAttribute.ts +10 -0
  33. package/src/attr/hasAttributeNS.ts +12 -0
  34. package/src/attr/removeAttribute.ts +9 -0
  35. package/src/attr/removeAttributeNS.ts +11 -0
  36. package/src/attr/setAttribute.ts +11 -0
  37. package/src/attr/setAttributeNS.ts +12 -0
  38. package/src/blocks/{documentBody.js → documentBody.ts} +0 -0
  39. package/src/blocks/{documentElement.js → documentElement.ts} +0 -0
  40. package/src/blocks/{documentHead.js → documentHead.ts} +0 -0
  41. package/src/boolean/isApple.ts +14 -0
  42. package/src/boolean/{isFirefox.js → isFirefox.ts} +2 -3
  43. package/src/boolean/{isMobile.js → isMobile.ts} +1 -2
  44. package/src/boolean/support3DTransform.ts +8 -0
  45. package/src/boolean/supportAnimation.ts +8 -0
  46. package/src/boolean/{supportPassive.js → supportPassive.ts} +3 -3
  47. package/src/boolean/supportTouch.ts +7 -0
  48. package/src/boolean/supportTransform.ts +8 -0
  49. package/src/boolean/supportTransition.ts +8 -0
  50. package/src/class/addClass.ts +11 -0
  51. package/src/class/hasClass.ts +11 -0
  52. package/src/class/removeClass.ts +11 -0
  53. package/src/event/off.ts +14 -0
  54. package/src/event/on.ts +14 -0
  55. package/src/event/one.ts +25 -0
  56. package/src/get/{getBoundingClientRect.js → getBoundingClientRect.ts} +14 -12
  57. package/src/get/{getDocument.js → getDocument.ts} +11 -7
  58. package/src/get/getDocumentBody.ts +13 -0
  59. package/src/get/getDocumentElement.ts +13 -0
  60. package/src/get/getDocumentHead.ts +12 -0
  61. package/src/get/{getElementAnimationDelay.js → getElementAnimationDelay.ts} +10 -9
  62. package/src/get/{getElementAnimationDuration.js → getElementAnimationDuration.ts} +10 -8
  63. package/src/get/getElementStyle.ts +25 -0
  64. package/src/get/{getElementTransitionDelay.js → getElementTransitionDelay.ts} +12 -8
  65. package/src/get/{getElementTransitionDuration.js → getElementTransitionDuration.ts} +12 -8
  66. package/src/get/{getNodeScroll.js → getNodeScroll.ts} +9 -5
  67. package/src/get/{getParentNode.js → getParentNode.ts} +11 -6
  68. package/src/get/{getRectRelativeToOffsetParent.js → getRectRelativeToOffsetParent.ts} +15 -7
  69. package/src/get/getUID.ts +42 -0
  70. package/src/get/{getWindow.js → getWindow.ts} +9 -6
  71. package/src/{index.js → index.ts} +37 -43
  72. package/src/interface/boundingClientRect.d.ts +10 -0
  73. package/src/interface/css4Declaration.d.ts +4 -0
  74. package/src/interface/customElement.d.ts +8 -0
  75. package/src/interface/navigatorUA.d.ts +15 -0
  76. package/src/interface/offsetRect.d.ts +6 -0
  77. package/src/interface/originalEvent.d.ts +4 -0
  78. package/src/is/isArray.ts +9 -0
  79. package/src/is/isCanvas.ts +13 -0
  80. package/src/is/isCustomElement.ts +13 -0
  81. package/src/is/isDocument.ts +13 -0
  82. package/src/is/{isElement.js → isElement.ts} +10 -5
  83. package/src/is/{isElementInScrollRange.js → isElementInScrollRange.ts} +4 -4
  84. package/src/is/{isElementInViewport.js → isElementInViewport.ts} +6 -12
  85. package/src/is/isElementsArray.ts +13 -0
  86. package/src/is/isFunction.ts +10 -0
  87. package/src/is/isHTMLCollection.ts +12 -0
  88. package/src/is/isHTMLElement.ts +13 -0
  89. package/src/is/isHTMLImageElement.ts +12 -0
  90. package/src/is/isJSON.ts +20 -0
  91. package/src/is/isMap.ts +11 -0
  92. package/src/is/isMedia.ts +20 -0
  93. package/src/is/isNode.ts +17 -0
  94. package/src/is/isNodeList.ts +13 -0
  95. package/src/is/isNumber.ts +9 -0
  96. package/src/is/isObject.ts +10 -0
  97. package/src/is/isRTL.ts +11 -0
  98. package/src/is/isSVGElement.ts +13 -0
  99. package/src/is/{isScaledElement.js → isScaledElement.ts} +9 -7
  100. package/src/is/isShadowRoot.ts +12 -0
  101. package/src/is/isString.ts +9 -0
  102. package/src/is/isTableElement.ts +14 -0
  103. package/src/is/isWeakMap.ts +11 -0
  104. package/src/is/isWindow.ts +13 -0
  105. package/src/misc/ArrayFrom.ts +11 -0
  106. package/src/misc/Float32ArrayFrom.ts +10 -0
  107. package/src/misc/Float64ArrayFrom.ts +10 -0
  108. package/src/misc/ObjectAssign.ts +43 -0
  109. package/src/misc/ObjectEntries.ts +11 -0
  110. package/src/misc/ObjectHasOwn.ts +17 -0
  111. package/src/misc/ObjectKeys.ts +10 -0
  112. package/src/misc/ObjectValues.ts +11 -0
  113. package/src/misc/createCustomEvent.ts +28 -0
  114. package/src/misc/createElement.ts +40 -0
  115. package/src/misc/createElementNS.ts +45 -0
  116. package/src/misc/data.ts +82 -0
  117. package/src/misc/dispatchEvent.ts +9 -0
  118. package/src/misc/distinct.ts +18 -0
  119. package/src/misc/{emulateAnimationEnd.js → emulateAnimationEnd.ts} +8 -9
  120. package/src/misc/{emulateTransitionEnd.js → emulateTransitionEnd.ts} +8 -9
  121. package/src/misc/focus.ts +9 -0
  122. package/src/misc/getInstance.ts +9 -0
  123. package/src/misc/{noop.js → noop.ts} +4 -1
  124. package/src/misc/normalizeOptions.ts +55 -0
  125. package/src/misc/normalizeValue.ts +30 -0
  126. package/src/misc/{passiveHandler.js → passiveHandler.ts} +1 -2
  127. package/src/misc/reflow.ts +9 -0
  128. package/src/misc/setElementStyle.ts +23 -0
  129. package/src/misc/timer.ts +84 -0
  130. package/src/misc/toLowerCase.ts +9 -0
  131. package/src/misc/toUpperCase.ts +9 -0
  132. package/src/selectors/closest.ts +20 -0
  133. package/src/selectors/{getCustomElements.js → getCustomElements.ts} +8 -4
  134. package/src/selectors/getElementById.ts +16 -0
  135. package/src/selectors/getElementsByClassName.ts +22 -0
  136. package/src/selectors/getElementsByTagName.ts +20 -0
  137. package/src/selectors/matches.ts +10 -0
  138. package/src/selectors/querySelector.ts +22 -0
  139. package/src/selectors/{querySelectorAll.js → querySelectorAll.ts} +7 -5
  140. package/src/strings/{DOMContentLoadedEvent.js → DOMContentLoadedEvent.ts} +0 -1
  141. package/src/strings/{DOMMouseScrollEvent.js → DOMMouseScrollEvent.ts} +0 -1
  142. package/src/strings/{abortEvent.js → abortEvent.ts} +0 -1
  143. package/src/strings/{addEventListener.js → addEventListener.ts} +0 -1
  144. package/src/strings/{animationDelay.js → animationDelay.ts} +0 -1
  145. package/src/strings/{animationDuration.js → animationDuration.ts} +0 -1
  146. package/src/strings/{animationEndEvent.js → animationEndEvent.ts} +0 -1
  147. package/src/strings/{animationName.js → animationName.ts} +0 -1
  148. package/src/strings/{ariaChecked.js → ariaChecked.ts} +0 -1
  149. package/src/strings/{ariaDescribedBy.js → ariaDescribedBy.ts} +0 -1
  150. package/src/strings/{ariaDescription.js → ariaDescription.ts} +0 -1
  151. package/src/strings/{ariaExpanded.js → ariaExpanded.ts} +0 -1
  152. package/src/strings/{ariaHasPopup.js → ariaHasPopup.ts} +0 -1
  153. package/src/strings/{ariaHidden.js → ariaHidden.ts} +0 -1
  154. package/src/strings/{ariaLabel.js → ariaLabel.ts} +0 -1
  155. package/src/strings/{ariaLabelledBy.js → ariaLabelledBy.ts} +0 -1
  156. package/src/strings/{ariaModal.js → ariaModal.ts} +0 -1
  157. package/src/strings/{ariaPressed.js → ariaPressed.ts} +0 -1
  158. package/src/strings/{ariaSelected.js → ariaSelected.ts} +0 -1
  159. package/src/strings/{ariaValueMax.js → ariaValueMax.ts} +0 -1
  160. package/src/strings/{ariaValueMin.js → ariaValueMin.ts} +0 -1
  161. package/src/strings/{ariaValueNow.js → ariaValueNow.ts} +0 -1
  162. package/src/strings/{ariaValueText.js → ariaValueText.ts} +0 -1
  163. package/src/strings/{beforeunloadEvent.js → beforeunloadEvent.ts} +0 -1
  164. package/src/strings/{bezierEasings.js → bezierEasings.ts} +0 -1
  165. package/src/strings/{blurEvent.js → blurEvent.ts} +0 -1
  166. package/src/strings/{changeEvent.js → changeEvent.ts} +0 -1
  167. package/src/strings/{contextmenuEvent.js → contextmenuEvent.ts} +0 -1
  168. package/src/strings/dragEvent.ts +5 -0
  169. package/src/strings/dragendEvent.ts +5 -0
  170. package/src/strings/dragenterEvent.ts +5 -0
  171. package/src/strings/dragleaveEvent.ts +5 -0
  172. package/src/strings/dragoverEvent.ts +5 -0
  173. package/src/strings/dragstartEvent.ts +5 -0
  174. package/src/strings/{errorEvent.js → errorEvent.ts} +0 -1
  175. package/src/strings/{focusEvent.js → focusEvent.ts} +0 -1
  176. package/src/strings/{focusEvents.js → focusEvents.ts} +0 -1
  177. package/src/strings/{focusinEvent.js → focusinEvent.ts} +0 -1
  178. package/src/strings/{focusoutEvent.js → focusoutEvent.ts} +0 -1
  179. package/src/strings/{gesturechangeEvent.js → gesturechangeEvent.ts} +0 -1
  180. package/src/strings/{gestureendEvent.js → gestureendEvent.ts} +0 -1
  181. package/src/strings/{gesturestartEvent.js → gesturestartEvent.ts} +0 -1
  182. package/src/strings/{keyAlt.js → keyAlt.ts} +1 -1
  183. package/src/strings/{keyArrowDown.js → keyArrowDown.ts} +1 -1
  184. package/src/strings/{keyArrowLeft.js → keyArrowLeft.ts} +1 -1
  185. package/src/strings/{keyArrowRight.js → keyArrowRight.ts} +1 -1
  186. package/src/strings/{keyArrowUp.js → keyArrowUp.ts} +1 -1
  187. package/src/strings/{keyBackspace.js → keyBackspace.ts} +1 -1
  188. package/src/strings/{keyCapsLock.js → keyCapsLock.ts} +1 -1
  189. package/src/strings/{keyControl.js → keyControl.ts} +1 -1
  190. package/src/strings/{keyDelete.js → keyDelete.ts} +1 -1
  191. package/src/strings/{keyEnter.js → keyEnter.ts} +1 -1
  192. package/src/strings/{keyEscape.js → keyEscape.ts} +1 -1
  193. package/src/strings/{keyInsert.js → keyInsert.ts} +1 -1
  194. package/src/strings/{keyMeta.js → keyMeta.ts} +1 -1
  195. package/src/strings/{keyPause.js → keyPause.ts} +1 -1
  196. package/src/strings/{keyScrollLock.js → keyScrollLock.ts} +1 -1
  197. package/src/strings/{keyShift.js → keyShift.ts} +1 -1
  198. package/src/strings/{keySpace.js → keySpace.ts} +1 -1
  199. package/src/strings/{keyTab.js → keyTab.ts} +1 -1
  200. package/src/strings/{keyboardEventKeys.js → keyboardEventKeys.ts} +0 -1
  201. package/src/strings/{keydownEvent.js → keydownEvent.ts} +0 -1
  202. package/src/strings/{keypressEvent.js → keypressEvent.ts} +0 -1
  203. package/src/strings/{keyupEvent.js → keyupEvent.ts} +0 -1
  204. package/src/strings/{loadEvent.js → loadEvent.ts} +0 -1
  205. package/src/strings/{loadstartEvent.js → loadstartEvent.ts} +0 -1
  206. package/src/strings/{mouseClickEvents.js → mouseClickEvents.ts} +0 -1
  207. package/src/strings/mouseHoverEvents.ts +8 -0
  208. package/src/strings/{mouseSwipeEvents.js → mouseSwipeEvents.ts} +4 -2
  209. package/src/strings/{mouseclickEvent.js → mouseclickEvent.ts} +0 -1
  210. package/src/strings/{mousedblclickEvent.js → mousedblclickEvent.ts} +0 -1
  211. package/src/strings/{mousedownEvent.js → mousedownEvent.ts} +0 -1
  212. package/src/strings/{mouseenterEvent.js → mouseenterEvent.ts} +0 -1
  213. package/src/strings/{mousehoverEvent.js → mousehoverEvent.ts} +0 -1
  214. package/src/strings/{mouseinEvent.js → mouseinEvent.ts} +0 -1
  215. package/src/strings/{mouseleaveEvent.js → mouseleaveEvent.ts} +0 -1
  216. package/src/strings/{mousemoveEvent.js → mousemoveEvent.ts} +0 -1
  217. package/src/strings/{mouseoutEvent.js → mouseoutEvent.ts} +0 -1
  218. package/src/strings/{mouseoverEvent.js → mouseoverEvent.ts} +0 -1
  219. package/src/strings/{mouseupEvent.js → mouseupEvent.ts} +0 -1
  220. package/src/strings/{mousewheelEvent.js → mousewheelEvent.ts} +0 -1
  221. package/src/strings/{moveEvent.js → moveEvent.ts} +0 -1
  222. package/src/strings/{nativeEvents.js → nativeEvents.ts} +0 -0
  223. package/src/strings/{offsetHeight.js → offsetHeight.ts} +0 -1
  224. package/src/strings/{offsetWidth.js → offsetWidth.ts} +0 -1
  225. package/src/strings/{orientationchangeEvent.js → orientationchangeEvent.ts} +0 -1
  226. package/src/strings/{pointercancelEvent.js → pointercancelEvent.ts} +0 -1
  227. package/src/strings/{pointerdownEvent.js → pointerdownEvent.ts} +0 -1
  228. package/src/strings/{pointerleaveEvent.js → pointerleaveEvent.ts} +0 -1
  229. package/src/strings/{pointermoveEvent.js → pointermoveEvent.ts} +0 -1
  230. package/src/strings/{pointerupEvent.js → pointerupEvent.ts} +0 -1
  231. package/src/strings/{readystatechangeEvent.js → readystatechangeEvent.ts} +0 -1
  232. package/src/strings/{removeEventListener.js → removeEventListener.ts} +0 -1
  233. package/src/strings/{resetEvent.js → resetEvent.ts} +0 -1
  234. package/src/strings/{resizeEvent.js → resizeEvent.ts} +0 -1
  235. package/src/strings/{scrollEvent.js → scrollEvent.ts} +0 -1
  236. package/src/strings/{scrollHeight.js → scrollHeight.ts} +0 -1
  237. package/src/strings/{scrollWidth.js → scrollWidth.ts} +0 -1
  238. package/src/strings/{selectEvent.js → selectEvent.ts} +0 -1
  239. package/src/strings/{selectendEvent.js → selectendEvent.ts} +0 -1
  240. package/src/strings/{selectstartEvent.js → selectstartEvent.ts} +0 -1
  241. package/src/strings/{submitEvent.js → submitEvent.ts} +0 -1
  242. package/src/strings/tabindex.ts +5 -0
  243. package/src/strings/touchEvents.ts +10 -0
  244. package/src/strings/{touchcancelEvent.js → touchcancelEvent.ts} +0 -1
  245. package/src/strings/{touchendEvent.js → touchendEvent.ts} +0 -1
  246. package/src/strings/{touchmoveEvent.js → touchmoveEvent.ts} +0 -1
  247. package/src/strings/{touchstartEvent.js → touchstartEvent.ts} +0 -1
  248. package/src/strings/{transitionDelay.js → transitionDelay.ts} +0 -1
  249. package/src/strings/{transitionDuration.js → transitionDuration.ts} +0 -1
  250. package/src/strings/{transitionEndEvent.js → transitionEndEvent.ts} +0 -1
  251. package/src/strings/{transitionProperty.js → transitionProperty.ts} +0 -2
  252. package/src/strings/{unloadEvent.js → unloadEvent.ts} +0 -1
  253. package/src/strings/{userAgent.js → userAgent.ts} +0 -0
  254. package/src/strings/userAgentData.ts +9 -0
  255. package/tsconfig.json +30 -0
  256. package/vite.config.ts +30 -0
  257. package/dist/shorty.esm.js +0 -2599
  258. package/dist/shorty.esm.min.js +0 -2
  259. package/dist/shorty.min.js +0 -2
  260. package/src/attr/getAttribute.js +0 -9
  261. package/src/attr/getAttributeNS.js +0 -10
  262. package/src/attr/hasAttribute.js +0 -9
  263. package/src/attr/hasAttributeNS.js +0 -10
  264. package/src/attr/removeAttribute.js +0 -9
  265. package/src/attr/removeAttributeNS.js +0 -10
  266. package/src/attr/setAttribute.js +0 -10
  267. package/src/attr/setAttributeNS.js +0 -11
  268. package/src/boolean/isApple.js +0 -13
  269. package/src/boolean/support3DTransform.js +0 -9
  270. package/src/boolean/supportAnimation.js +0 -9
  271. package/src/boolean/supportTouch.js +0 -7
  272. package/src/boolean/supportTransform.js +0 -9
  273. package/src/boolean/supportTransition.js +0 -9
  274. package/src/class/addClass.js +0 -10
  275. package/src/class/hasClass.js +0 -10
  276. package/src/class/removeClass.js +0 -10
  277. package/src/event/off.js +0 -9
  278. package/src/event/on.js +0 -9
  279. package/src/event/one.js +0 -23
  280. package/src/get/getDocumentBody.js +0 -10
  281. package/src/get/getDocumentElement.js +0 -11
  282. package/src/get/getDocumentHead.js +0 -10
  283. package/src/get/getElementAnimationDelayLegacy.js +0 -21
  284. package/src/get/getElementAnimationDurationLegacy.js +0 -21
  285. package/src/get/getElementStyle.js +0 -20
  286. package/src/get/getElementTransitionDelayLegacy.js +0 -21
  287. package/src/get/getElementTransitionDurationLegacy.js +0 -21
  288. package/src/get/getUID.js +0 -34
  289. package/src/is/isArray.js +0 -8
  290. package/src/is/isCustomElement.js +0 -8
  291. package/src/is/isDocument.js +0 -10
  292. package/src/is/isElementsArray.js +0 -12
  293. package/src/is/isFunction.js +0 -8
  294. package/src/is/isHTMLCollection.js +0 -8
  295. package/src/is/isHTMLElement.js +0 -9
  296. package/src/is/isHTMLImageElement.js +0 -8
  297. package/src/is/isMedia.js +0 -14
  298. package/src/is/isNode.js +0 -9
  299. package/src/is/isNodeList.js +0 -9
  300. package/src/is/isNumber.js +0 -8
  301. package/src/is/isObject.js +0 -8
  302. package/src/is/isRTL.js +0 -9
  303. package/src/is/isSVGElement.js +0 -11
  304. package/src/is/isShadowRoot.js +0 -9
  305. package/src/is/isString.js +0 -8
  306. package/src/is/isTableElement.js +0 -11
  307. package/src/is/isWindow.js +0 -9
  308. package/src/misc/ArrayFrom.js +0 -8
  309. package/src/misc/Float32ArrayFrom.js +0 -7
  310. package/src/misc/Float64ArrayFrom.js +0 -7
  311. package/src/misc/ObjectAssign.js +0 -7
  312. package/src/misc/ObjectEntries.js +0 -7
  313. package/src/misc/ObjectKeys.js +0 -7
  314. package/src/misc/ObjectValues.js +0 -7
  315. package/src/misc/OriginalEvent.js +0 -20
  316. package/src/misc/createElement.js +0 -27
  317. package/src/misc/createElementNS.js +0 -30
  318. package/src/misc/data.js +0 -78
  319. package/src/misc/dispatchEvent.js +0 -8
  320. package/src/misc/distinct.js +0 -10
  321. package/src/misc/emulateAnimationEndLegacy.js +0 -41
  322. package/src/misc/emulateTransitionEndLegacy.js +0 -41
  323. package/src/misc/focus.js +0 -7
  324. package/src/misc/normalizeOptions.js +0 -49
  325. package/src/misc/normalizeValue.js +0 -34
  326. package/src/misc/passiveHandlerLegacy.js +0 -10
  327. package/src/misc/reflow.js +0 -8
  328. package/src/misc/setElementStyle.js +0 -19
  329. package/src/misc/timer.js +0 -75
  330. package/src/misc/toLowerCase.js +0 -8
  331. package/src/misc/toUpperCase.js +0 -8
  332. package/src/misc/version.js +0 -8
  333. package/src/selectors/closest.js +0 -16
  334. package/src/selectors/getElementById.js +0 -14
  335. package/src/selectors/getElementsByClassName.js +0 -15
  336. package/src/selectors/getElementsByTagName.js +0 -15
  337. package/src/selectors/matches.js +0 -10
  338. package/src/selectors/matchesLegacy.js +0 -23
  339. package/src/selectors/querySelector.js +0 -19
  340. package/src/strings/animationDelayLegacy.js +0 -9
  341. package/src/strings/animationDurationLegacy.js +0 -9
  342. package/src/strings/animationEndEventLegacy.js +0 -9
  343. package/src/strings/animationNameLegacy.js +0 -9
  344. package/src/strings/mouseHoverEvents.js +0 -7
  345. package/src/strings/touchEvents.js +0 -8
  346. package/src/strings/transitionDelayLegacy.js +0 -9
  347. package/src/strings/transitionDurationLegacy.js +0 -9
  348. package/src/strings/transitionEndEventLegacy.js +0 -9
  349. package/src/strings/transitionPropertyLegacy.js +0 -12
  350. package/src/strings/userAgentData.js +0 -7
  351. package/types/index.d.ts +0 -257
  352. package/types/module/shorty.ts +0 -248
  353. package/types/shorty.d.ts +0 -2316
@@ -0,0 +1,331 @@
1
+ /// <reference types="cypress" />
2
+ // @ts-nocheck
3
+
4
+ // import SHORTY from '../../src/index';
5
+ import * as SHORTY from '../../src/index';
6
+
7
+ describe('Shorty Library Tests', () => {
8
+ beforeEach(() => {
9
+ cy.visit('cypress/test.html');
10
+ });
11
+
12
+ it('Test misc folder - emulateTransitionEnd - no transition', () => {
13
+ const {
14
+ dispatchEvent,
15
+ emulateTransitionEnd,
16
+ createCustomEvent,
17
+ reflow,
18
+ querySelector,
19
+ setElementStyle,
20
+ getElementStyle,
21
+ removeClass,
22
+ addClass,
23
+ one,
24
+ } = SHORTY;
25
+
26
+ cy
27
+ .window()
28
+ .then(win => {
29
+ const el = querySelector('.alert', win.document) as HTMLElement;
30
+ const btn = querySelector('.btn-close', el);
31
+ const alertHideEvent = createCustomEvent('hide-alert', { relatedTarget: null });
32
+
33
+ setElementStyle(el, {
34
+ transition: 'none',
35
+ transitionProperty: 'none',
36
+ transitionDuration: '0s',
37
+ 'transition-delay': '0s',
38
+ '--transition-prop': 'none',
39
+ });
40
+
41
+ expect(getElementStyle(el, 'transitionProperty')).to.equal('none');
42
+ expect(getElementStyle(el, 'transition-duration')).to.equal('0s');
43
+ expect(getElementStyle(el, 'transitionDelay')).to.equal('0s');
44
+ expect(getElementStyle(el, '--transition-prop')).to.equal('none');
45
+
46
+ cy.log('emulateTransitionEnd').then(() => {
47
+ one(el, 'hide-alert', function hideHandler(e) {
48
+ cy.log('hide-alert triggered');
49
+ expect(e.target).to.equal(el);
50
+ expect(e.relatedTarget).to.equal(btn);
51
+ });
52
+
53
+ one(btn, 'click', function handleBtn(e) {
54
+ cy.log('clicked btn');
55
+ expect(e.target).to.equal(btn);
56
+ removeClass(el, 'show');
57
+ reflow(el);
58
+ alertHideEvent.relatedTarget = btn;
59
+ dispatchEvent(el, alertHideEvent);
60
+ emulateTransitionEnd(el, function () {
61
+ addClass(el, 'show');
62
+ cy.log('transitionend triggered');
63
+ });
64
+ });
65
+
66
+ btn.click();
67
+ cy.wait(100);
68
+ });
69
+ });
70
+ });
71
+
72
+ it('Test misc folder - emulateTransitionEnd - default', () => {
73
+ const {
74
+ dispatchEvent,
75
+ emulateTransitionEnd,
76
+ createCustomEvent,
77
+ reflow,
78
+ querySelector,
79
+ removeClass,
80
+ addClass,
81
+ one,
82
+ focus,
83
+ } = SHORTY;
84
+
85
+ cy
86
+ // .wait('@pageload')
87
+ .window()
88
+ .then(win => {
89
+ const el = querySelector('.alert', win.document);
90
+ const btn = querySelector('.btn-close', el);
91
+ const alertHideEvent = createCustomEvent('hide-alert', { relatedTarget: null });
92
+
93
+ cy.log('begin **emulateTransitionEnd**').then(() => {
94
+ one(el, 'hide-alert', function hideHandler(e) {
95
+ cy.log('hide-alert triggered');
96
+ expect(e.target).to.equal(el);
97
+ expect(e.relatedTarget).to.equal(btn);
98
+ });
99
+
100
+ one(btn, 'click', function handleBtn(e) {
101
+ cy.log('clicked btn');
102
+ expect(e.target).to.equal(btn);
103
+ removeClass(el, 'show');
104
+ reflow(el);
105
+ alertHideEvent.relatedTarget = btn;
106
+ dispatchEvent(el, alertHideEvent);
107
+ emulateTransitionEnd(el, function () {
108
+ addClass(el, 'show');
109
+ focus(btn);
110
+ console.log('transitionend triggered');
111
+ });
112
+ });
113
+
114
+ btn.click();
115
+ cy.wait(300);
116
+ });
117
+ });
118
+ });
119
+
120
+ it('Test misc folder - emulateAnimationEnd - default', () => {
121
+ const { emulateAnimationEnd, getElementStyle, querySelector, addClass } = SHORTY;
122
+ cy
123
+ // .wait('@pageload')
124
+ .window()
125
+ .then(win => {
126
+ const el = querySelector('.alert', win.document);
127
+
128
+ cy.log('begin **emulateAnimationEnd**').then(() => {
129
+ addClass(el, 'animate-test');
130
+ emulateAnimationEnd(el, () => {
131
+ console.log('animationend fired');
132
+ expect(getElementStyle(el, 'animationName'), 'animationName').to.equal('animate-test');
133
+ expect(getElementStyle(el, 'animationDuration'), 'animationDuration').to.equal('0.3s');
134
+ expect(getElementStyle(el, 'animationDelay'), 'animationDelay').to.equal('0s');
135
+ });
136
+
137
+ cy.wait(350);
138
+ });
139
+ });
140
+ });
141
+
142
+ it('Test misc folder - emulateAnimationEnd - no duration', () => {
143
+ const { emulateAnimationEnd, setElementStyle, getElementStyle, querySelector, addClass } =
144
+ SHORTY;
145
+ cy
146
+ // .wait('@pageload')
147
+ .window()
148
+ .then(win => {
149
+ const el = querySelector('.alert', win.document);
150
+ setElementStyle(el, { animationDuration: '0s' });
151
+
152
+ cy.log('begin **emulateAnimationEnd**').then(() => {
153
+ addClass(el, 'animate-test');
154
+ emulateAnimationEnd(el, () => {
155
+ console.log('animationend fired');
156
+ expect(getElementStyle(el, 'animationName'), 'animationName').to.equal('animate-test');
157
+ expect(getElementStyle(el, 'animationDuration'), 'animationDuration').to.equal('0s');
158
+ expect(getElementStyle(el, 'animationDelay'), 'animationDelay').to.equal('0s');
159
+ });
160
+
161
+ cy.wait(100);
162
+ });
163
+ });
164
+ });
165
+
166
+ it('Test misc folder - everything else', () => {
167
+ const {
168
+ ArrayFrom,
169
+ Float32ArrayFrom,
170
+ Float64ArrayFrom,
171
+ distinct,
172
+ noop,
173
+ ObjectHasOwn,
174
+ ObjectEntries,
175
+ ObjectAssign,
176
+ ObjectKeys,
177
+ ObjectValues,
178
+ createElement,
179
+ createElementNS,
180
+ Data,
181
+ getInstance,
182
+ normalizeOptions,
183
+ Timer,
184
+ toLowerCase,
185
+ toUpperCase,
186
+ querySelector,
187
+ getElementsByClassName,
188
+ } = SHORTY;
189
+ cy
190
+ // .wait('@pageload')
191
+ .window()
192
+ .then(win => {
193
+ const el = querySelector('.alert', win.document);
194
+ const table = querySelector('.table', win.document);
195
+
196
+ const defaults = { op1: true, op2: true, op3: 5, title: null };
197
+ const jsOps = { op1: false, op2: false, op3: 8, title: 'something' };
198
+ expect(ObjectHasOwn(jsOps,'op3')).to.be.true;
199
+ expect(ObjectHasOwn(jsOps,'momo')).to.be.false;
200
+ expect(ObjectHasOwn(null,'momo')).to.be.false;
201
+ expect(normalizeOptions(el, defaults, {}, 'bs'), 'normalizeOptions(data)').to.deep.equal({
202
+ op1: false,
203
+ op2: true,
204
+ op3: 10,
205
+ title: null,
206
+ });
207
+ expect(normalizeOptions(el, defaults, jsOps, 'bs'), 'normalizeOptions(js)').to.deep.equal({
208
+ op1: false,
209
+ op2: false,
210
+ op3: 8,
211
+ title: 'something',
212
+ });
213
+ expect(noop()).to.be.undefined;
214
+
215
+ Timer.set('el', noop, 150);
216
+ Timer.set(el, () => console.log(el.tagName + ' has timer of 150'), 150, 'alert');
217
+ expect(Timer.get('el', 'alert')).to.be.null;
218
+ expect(Timer.get(el, 'alert')).to.not.be.undefined;
219
+ Timer.clear('el', 'alert');
220
+ Timer.clear(el, 'alert');
221
+ expect(Timer.get(el, 'alert')).to.be.null;
222
+
223
+ Timer.set(el, () => console.log(el.tagName + ' has timer of 250'), 250);
224
+ expect(Timer.get(el)).to.not.be.null;
225
+ Timer.clear(el);
226
+ expect(Timer.get(el)).to.be.null;
227
+
228
+ expect([0, 1, 1, 2, 3, 3].filter(distinct), 'filter(DISTINCT)').to.deep.equal([0, 1, 2, 3]);
229
+
230
+ expect(toLowerCase('textSample'), 'toLowerCase(string)').to.equal('textsample');
231
+ expect(toUpperCase('textSample'), 'toUpperCase(string)').to.equal('TEXTSAMPLE');
232
+
233
+ expect(
234
+ ObjectAssign({ c: 3 }, { a: 1, b: 2 }),
235
+ 'ObjectAssign(object1, object2)',
236
+ ).to.deep.equal({ a: 1, b: 2, c: 3 });
237
+ expect(ObjectEntries({ a: 1, b: 2 }), 'ObjectEntries(object)').to.deep.equal([
238
+ ['a', 1],
239
+ ['b', 2],
240
+ ]);
241
+ expect(ObjectKeys({ a: 1, b: 2 }), 'ObjectKeys(object)').to.deep.equal(['a', 'b']);
242
+ expect(ObjectValues({ a: 1, b: 2 }), 'ObjectValues(object)').to.deep.equal([1, 2]);
243
+
244
+ expect(Float32ArrayFrom([0, 1, 2, 3]), 'Float32ArrayFrom(array)').to.be.instanceOf(
245
+ Float32Array,
246
+ );
247
+ expect(Float64ArrayFrom([0, 1, 2, 3]), 'Float64ArrayFrom(array)').to.be.instanceOf(
248
+ Float64Array,
249
+ );
250
+ expect(Float64ArrayFrom([0, 1, 2, 3]).length, 'Float64ArrayFrom(array)').to.eq(4);
251
+
252
+ expect(
253
+ ArrayFrom(new Float32Array([0, 1, 2, 3])),
254
+ 'ArrayFrom(Float32Array)',
255
+ ).to.be.instanceOf(Array);
256
+ expect(ArrayFrom(new Float64Array([0, 1, 2, 3])), 'Array(Float64Array)').to.be.instanceOf(
257
+ Array,
258
+ );
259
+ expect(
260
+ ArrayFrom(getElementsByClassName('table', win.document)),
261
+ 'ArrayFrom(HTMLCollection)',
262
+ ).to.deep.equal([table]);
263
+
264
+ expect(createElement(), 'createElement()').to.be.undefined;
265
+ expect(createElement('input'), 'createElement(string)').to.be.instanceOf(HTMLInputElement);
266
+ expect(
267
+ createElement({
268
+ tagName: 'p',
269
+ className: 'lead',
270
+ innerText: 'This is a newly created paragraph.',
271
+ }),
272
+ 'createElement(object)',
273
+ ).to.be.instanceOf(HTMLParagraphElement);
274
+ expect(
275
+ createElement({
276
+ className: 'lead',
277
+ innerText: 'This is a newly created paragraph.',
278
+ }),
279
+ 'createElement(incompleteObject)',
280
+ ).to.be.undefined;
281
+
282
+ expect(createElementNS(), 'createElementNS()').to.be.undefined;
283
+ expect(
284
+ createElementNS('http://www.w3.org/2000/svg', 'svg'),
285
+ 'createElementNS(ns, string)',
286
+ ).to.be.instanceOf(SVGElement);
287
+ expect(
288
+ createElementNS('http://www.w3.org/1999/xhtml', {
289
+ tagName: 'button',
290
+ className: 'btn',
291
+ innerText: 'New Item',
292
+ }),
293
+ 'createElementNS(ns, object)',
294
+ ).to.be.instanceOf(HTMLButtonElement);
295
+ expect(
296
+ createElementNS('http://www.w3.org/2000/svg', {
297
+ tagName: 'path',
298
+ className: 'icon',
299
+ d: 'M98,158l157,156L411,158l27,27L255,368L71,185L98,158z',
300
+ }),
301
+ 'createElementNS(ns, object)',
302
+ ).to.be.instanceOf(SVGPathElement);
303
+ expect(
304
+ createElementNS('http://www.w3.org/2000/svg', {
305
+ tagName: '',
306
+ className: 'icon',
307
+ d: 'M98,158l157,156L411,158l27,27L255,368L71,185L98,158z',
308
+ }),
309
+ 'createElementNS(ns, object)',
310
+ ).to.be.undefined;
311
+
312
+ Data.set(el);
313
+ expect(Data.get(el), 'not enough params - Data.get(node)').to.be.null;
314
+
315
+ Data.set('str', 'strKey', 'data');
316
+ expect(Data.get('str', 'strKey'), 'not HTMLElement - Data.get(string, string, string)').to
317
+ .be.null;
318
+
319
+ Data.set(el, 'Alert', { element: el });
320
+ expect(Data.get(el, 'Alert'), 'Data.get(node, key)').to.deep.equal({ element: el });
321
+ expect(getInstance(el, 'Alert'), 'getInstance(node, key)').to.deep.equal({ element: el });
322
+ expect(Data.getAllFor('Alert').size, 'Data.getAllFor(string).size').to.equal(1);
323
+
324
+ Data.remove(el, 'Alert');
325
+ expect(Data.get(el, 'Alert'), 'removed - Data.get(node, string)').to.be.null;
326
+ expect(getInstance(el, 'Alert'), 'removed - getInstance(node, string)').to.be.null;
327
+ expect(Data.getAllFor('Alert'), 'removed - Data.getAllFor(string)').to.be.null;
328
+ Data.remove(el, 'Alert');
329
+ });
330
+ });
331
+ });
@@ -0,0 +1,85 @@
1
+ /// <reference types="cypress" />
2
+ // @ts-nocheck
3
+
4
+ // import SHORTY from '../../src/index';
5
+ import * as SHORTY from '../../src/index';
6
+
7
+ import CustomElem from '../fixtures/custom-elem';
8
+
9
+ describe('Shorty Library Tests', () => {
10
+ before(() => {
11
+ cy.visit('cypress/test.html')
12
+ .wait(100);
13
+ });
14
+
15
+ it('Test selectors folder', () => {
16
+ const {
17
+ closest,
18
+ getCustomElements,
19
+ getElementById,
20
+ getElementsByClassName,
21
+ getElementsByTagName,
22
+ matches,
23
+ querySelector,
24
+ querySelectorAll,
25
+ } = SHORTY;
26
+
27
+ cy
28
+ .get('.alert')
29
+ .then($alert => {
30
+ const [el] = $alert;
31
+ const win = el.ownerDocument.defaultView;
32
+
33
+ const CE = new CustomElem();
34
+ win.document.body.append(CE);
35
+
36
+ expect(querySelectorAll('div'), 'querySelectorAll(div)').to.have.length(0);
37
+ expect(querySelectorAll('div', win.document), 'querySelectorAll(div, parent)').to.have.length(1);
38
+
39
+ expect(querySelector(), 'querySelector()').to.be.null;
40
+ expect(querySelector(el), 'querySelector(node)').to.equal(el);
41
+ expect(querySelector('.alert'), 'querySelector(selector)').to.be.null;
42
+ expect(querySelector('.alert', win.document), 'querySelector(selector, parent)').to.eq(el);
43
+
44
+ expect(closest(el), 'closest()').to.be.null;
45
+ expect(closest(el, 'wombat'), 'closest(invalid)').to.be.null;
46
+ expect(closest(el, 'body'), 'closest(body)').to.eq(win.document.body);
47
+
48
+ expect(getCustomElements(), 'getCustomElements()').to.deep.equal([]);
49
+ expect(getCustomElements(win.document), 'getCustomElements(expected)').to.deep.equal([CE]);
50
+
51
+ expect(getElementById(), 'getElementById()').to.be.null;
52
+ expect(getElementById('alertDemo'), 'getElementById(id)').to.be.null;
53
+ expect(
54
+ getElementById('alertDemo', win.document),
55
+ 'getElementById(id, parent)',
56
+ ).to.be.instanceOf(win.HTMLDivElement);
57
+
58
+ expect(getElementsByClassName(), 'getElementsByClassName()').to.be.instanceOf(
59
+ HTMLCollection,
60
+ );
61
+ expect(
62
+ getElementsByClassName('alert'),
63
+ 'getElementsByClassName(selector)',
64
+ ).to.be.instanceOf(HTMLCollection);
65
+ expect(
66
+ getElementsByClassName('alert', win.document),
67
+ 'getElementsByClassName(selector, parent)',
68
+ ).to.be.instanceOf(win.HTMLCollection);
69
+
70
+ expect(getElementsByTagName(), 'getElementsByTagName()').to.be.instanceOf(HTMLCollection);
71
+ expect(getElementsByTagName('div'), 'getElementsByTagName(selector)').to.be.instanceOf(
72
+ HTMLCollection,
73
+ );
74
+ expect(
75
+ getElementsByTagName('div', win.document),
76
+ 'getElementsByTagName(selector, parent)',
77
+ ).to.be.instanceOf(win.HTMLCollection);
78
+
79
+ expect(
80
+ [...getElementsByClassName('alert', win.document)].filter(x => matches(x, 'div')),
81
+ 'matches(node, selector)',
82
+ ).to.deep.equal([el]);
83
+ });
84
+ });
85
+ });
@@ -0,0 +1,18 @@
1
+ const CEP = document.createElement('p');
2
+ CEP.innerText = 'Sample Custom Element';
3
+
4
+ export default class CustomElem extends HTMLElement {
5
+ constructor() {
6
+ super();
7
+
8
+ this.attachShadow({ mode: 'open' });
9
+ }
10
+ connectedCallback() {
11
+ this.shadowRoot.append(CEP);
12
+ }
13
+ disconnectedCallback() {
14
+ this.shadowRoot.innerHTML = '';
15
+ }
16
+ }
17
+
18
+ customElements.define('custom-elem', CustomElem);
@@ -0,0 +1,50 @@
1
+ // sources
2
+ // * https://github.com/enketo/enketo-express/blob/master/tools/esbuild-plugin-istanbul.js
3
+ 'use strict';
4
+ import esbuild from 'esbuild';
5
+ import { promises } from 'fs';
6
+ import { createInstrumenter } from 'istanbul-lib-instrument';
7
+ import { extname, sep } from 'path';
8
+ import tsCompile from './tsCompile';
9
+
10
+ // import Cypress settings
11
+ const sourceFolder = 'src';
12
+ const [name] = process.cwd().split(sep).slice(-1);
13
+
14
+ const sourceFilter = `${name}${sep}${sourceFolder}`;
15
+ const instrumenter = createInstrumenter({
16
+ compact: false,
17
+ esModules: true,
18
+ preserveComments: true,
19
+ autoWrap: true,
20
+ });
21
+
22
+ const createEsbuildIstanbulPlugin = (): esbuild.Plugin => {
23
+ return {
24
+ name: 'istanbul',
25
+ setup(build: esbuild.PluginBuild) {
26
+ build.onLoad(
27
+ { filter: /\.(ts|tsx)$/ },
28
+ async ({ path }: esbuild.OnLoadArgs): Promise<{ contents: string } & Record<string, any>> => {
29
+
30
+ if (!path.includes(sourceFilter)) {
31
+ // console.log("> compiling typescript %s for output build", path);
32
+ const contents = await promises.readFile(path, 'utf8');
33
+ return {
34
+ contents: ['.ts', '.tsx'].includes(extname(path)) ? tsCompile(path).outputText : contents,
35
+ };
36
+ }
37
+
38
+ // console.log("🧡 instrumenting %s for output coverage", path);
39
+ const { outputText, sourceMap } = tsCompile(path);
40
+
41
+ return {
42
+ contents: instrumenter.instrumentSync(outputText, path, sourceMap),
43
+ };
44
+ },
45
+ );
46
+ },
47
+ };
48
+ };
49
+
50
+ export default createEsbuildIstanbulPlugin;
@@ -0,0 +1,34 @@
1
+ // compile.ts
2
+ import TypeScript from 'typescript';
3
+ import { basename } from 'path';
4
+ import { RawSourceMap } from 'source-map';
5
+ import { readFileSync } from 'fs';
6
+
7
+ export default function tsCompile(
8
+ path: string,
9
+ ops?: Partial<TypeScript.TranspileOptions>,
10
+ ): TypeScript.TranspileOutput & { sourceMap: RawSourceMap } {
11
+ // Default options -- you could also perform a merge, or use the project tsconfig.json
12
+ const options: TypeScript.TranspileOptions = Object.assign(
13
+ {
14
+ compilerOptions: {
15
+ allowJs: true,
16
+ esModuleInterop: true,
17
+ removeComments: false,
18
+ target: 99, // ESNext
19
+ allowSyntheticDefaultImports: true,
20
+ isolatedModules: true,
21
+ noEmitHelpers: true,
22
+ sourceMap: true,
23
+ } as Partial<TypeScript.CompilerOptions>,
24
+ },
25
+ ops,
26
+ );
27
+ const contents = readFileSync(path, { encoding: 'utf8' });
28
+ const { outputText, sourceMapText } = TypeScript.transpileModule(contents, options);
29
+ const sourceMap: RawSourceMap = JSON.parse(sourceMapText || '');
30
+ sourceMap.file = basename(path);
31
+ sourceMap.sources = [basename(path)];
32
+
33
+ return { outputText, sourceMap, sourceMapText };
34
+ }
@@ -0,0 +1,37 @@
1
+ /// <reference types="cypress" />
2
+ // ***********************************************
3
+ // This example commands.ts shows you how to
4
+ // create various custom commands and overwrite
5
+ // existing commands.
6
+ //
7
+ // For more comprehensive examples of custom
8
+ // commands please read more here:
9
+ // https://on.cypress.io/custom-commands
10
+ // ***********************************************
11
+ //
12
+ //
13
+ // -- This is a parent command --
14
+ // Cypress.Commands.add('login', (email, password) => { ... })
15
+ //
16
+ //
17
+ // -- This is a child command --
18
+ // Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... })
19
+ //
20
+ //
21
+ // -- This is a dual command --
22
+ // Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... })
23
+ //
24
+ //
25
+ // -- This will overwrite an existing command --
26
+ // Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })
27
+ //
28
+ // declare global {
29
+ // namespace Cypress {
30
+ // interface Chainable {
31
+ // login(email: string, password: string): Chainable<void>
32
+ // drag(subject: string, options?: Partial<TypeOptions>): Chainable<Element>
33
+ // dismiss(subject: string, options?: Partial<TypeOptions>): Chainable<Element>
34
+ // visit(originalFn: CommandOriginalFn, url: string, options: Partial<VisitOptions>): Chainable<Element>
35
+ // }
36
+ // }
37
+ // }
@@ -0,0 +1,21 @@
1
+ // ***********************************************************
2
+ // This example support/e2e.ts is processed and
3
+ // loaded automatically before your test files.
4
+ //
5
+ // This is a great place to put global configuration and
6
+ // behavior that modifies Cypress.
7
+ //
8
+ // You can change the location of this file or turn off
9
+ // automatically serving support files with the
10
+ // 'supportFile' configuration option.
11
+ //
12
+ // You can read more here:
13
+ // https://on.cypress.io/configuration
14
+ // ***********************************************************
15
+
16
+ // Import commands.js using ES2015 syntax:
17
+ import "./commands";
18
+
19
+ // Alternatively you can use CommonJS syntax:
20
+ // require('./commands')
21
+ import "@cypress/code-coverage/support";
@@ -0,0 +1,22 @@
1
+ // ***********************************************************
2
+ // This example support/index.js is processed and
3
+ // loaded automatically before your test files.
4
+ //
5
+ // This is a great place to put global configuration and
6
+ // behavior that modifies Cypress.
7
+ //
8
+ // You can change the location of this file or turn off
9
+ // automatically serving support files with the
10
+ // 'supportFile' configuration option.
11
+ //
12
+ // You can read more here:
13
+ // https://on.cypress.io/configuration
14
+ // ***********************************************************
15
+
16
+ // Import commands.js using ES2015 syntax:
17
+ import './commands'
18
+
19
+ // Alternatively you can use CommonJS syntax:
20
+ // require('./commands')
21
+
22
+ import '@cypress/code-coverage/support'
@@ -0,0 +1,63 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <title>BSN Testing Page</title>
6
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css">
7
+ <style>
8
+ @keyframes animate-me {
9
+ 0% { opacity: 1; }
10
+ 50% { opacity: 0; }
11
+ 100% { opacity: 1; }
12
+ }
13
+ @keyframes animate-test {
14
+ from { left: 0px; }
15
+ to { left: 150px; }
16
+ }
17
+ .animate-test {
18
+ animation-name: animate-test;
19
+ animation-duration: 0.3s;
20
+ animation-timing-function: ease-out;
21
+ animation-delay: 0s;
22
+ }
23
+ </style>
24
+ </head>
25
+ <body class="container p-5">
26
+ <h3>Shorty Examples</h3>
27
+ <div id="alertDemo" class="alert alert-warning alert-dismissible fade show" data-cy="alert" data-bs-op1="false" data-bs-op2="true" data-bs-op3="10" data-bs-title="" role="alert">
28
+ <button type="button" class="btn-close bg-none" data-bs-target="alertDemo" data-bs-dismiss="alert" aria-label="Close">
29
+ <svg viewBox="0 0 16 16" class="align-top"><path name="x" d="M4.646 4.646a0.5 0.5 0 0 1 0.708 0L8 7.293l2.646 -2.647a0.5 0.5 0 0 1 0.708 0.708L8.707 8l2.647 2.646a0.5 0.5 0 0 1 -0.708 0.708L8 8.707l-2.646 2.647A0.5 0.5 0 0 1 4.646 10.646L7.293 8L4.646 5.354a0.5 0.5 0 0 1 0 -0.708z"></path></svg>
30
+ </button>
31
+ <p><b>Holy guacamole!</b> Best check yo self, you're not looking too good.</p>
32
+ <img src="data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgODAgNDMiIHdpZHRoPSI4MCIgaGVpZ2h0PSI0MyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4NCiAgICAgICAgICAgICAgICAgIDxyZWN0IGZpbGw9IndoaXRlIiBzdHJva2U9IiNjY2MiIHN0cm9rZS13aWR0aD0iMSIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgcng9IjUiPjwvcmVjdD4NCiAgICAgICAgICAgICAgICAgIDx0ZXh0IGRpcmVjdGlvbj0ibHRyIiBmaWxsPSIjMzMzIiB4PSIyNSIgeT0iMjUiIGZvbnQtc2l6ZT0iMTQiPklNRzwvdGV4dD4NCiAgICAgICAgICAgICAgICA8L3N2Zz4=" alt="Image">
33
+ </div>
34
+ <table class="table">
35
+ <thead>
36
+ <tr>
37
+ <th>Event Type</th>
38
+ <th>Description</th>
39
+ </tr>
40
+ </thead>
41
+ <tbody>
42
+ <tr>
43
+ <td><code>show.bs.tooltip</code></td>
44
+ <td>This event fires immediately when the <code>show</code> instance method is called.<br>
45
+ <b>This event can be default prevented.</b></td>
46
+ </tr>
47
+ <tr>
48
+ <td><code>shown.bs.tooltip</code></td>
49
+ <td>This event is fired when the tooltip has been made visible to the user.</td>
50
+ </tr>
51
+ <tr>
52
+ <td><code>hide.bs.tooltip</code></td>
53
+ <td>This event is fired immediately when the <code>hide</code> instance method has been called.<br>
54
+ <b>This event can be default prevented.</b></td>
55
+ </tr>
56
+ <tr>
57
+ <td><code>hidden.bs.tooltip</code></td>
58
+ <td>This event is fired when the tooltip has finished being hidden from the user.</td>
59
+ </tr>
60
+ </tbody>
61
+ </table>
62
+ </body>
63
+ </html>