@webqit/webflo 0.20.2-next.0 → 0.20.2-next.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (262) hide show
  1. package/README.md +8 -5
  2. package/package.json +1 -1
  3. package/site/.vitepress/cache/deps/_metadata.json +14 -14
  4. package/site/.vitepress/config.ts +8 -2
  5. package/site/.vitepress/dist/-/_.html +56 -0
  6. package/site/.vitepress/dist/-/docs.old.html +679 -0
  7. package/site/.vitepress/dist/404.html +23 -0
  8. package/site/.vitepress/dist/api/webflo-fetch/FormData.html +55 -0
  9. package/site/.vitepress/dist/api/webflo-fetch/Headers.html +55 -0
  10. package/site/.vitepress/dist/api/webflo-fetch/LiveResponse.html +55 -0
  11. package/site/.vitepress/dist/api/webflo-fetch/Request.html +55 -0
  12. package/site/.vitepress/dist/api/webflo-fetch/Response.html +55 -0
  13. package/site/.vitepress/dist/api/webflo-fetch/fetch.html +55 -0
  14. package/site/.vitepress/dist/api/webflo-routing/HttpCookies.html +55 -0
  15. package/site/.vitepress/dist/api/webflo-routing/HttpEvent/respondWith.html +55 -0
  16. package/site/.vitepress/dist/api/webflo-routing/HttpEvent/waitUntil.html +55 -0
  17. package/site/.vitepress/dist/api/webflo-routing/HttpEvent/waitUntilNavigate.html +55 -0
  18. package/site/.vitepress/dist/api/webflo-routing/HttpEvent.html +55 -0
  19. package/site/.vitepress/dist/api/webflo-routing/HttpSession.html +55 -0
  20. package/site/.vitepress/dist/api/webflo-routing/HttpState.html +55 -0
  21. package/site/.vitepress/dist/api/webflo-routing/HttpUser.html +55 -0
  22. package/site/.vitepress/dist/api/webflo-routing/handler/fetch.html +59 -0
  23. package/site/.vitepress/dist/api/webflo-routing/handler/next.html +61 -0
  24. package/site/.vitepress/dist/api/webflo-routing/handler.html +65 -0
  25. package/site/.vitepress/dist/api.html +55 -0
  26. package/site/.vitepress/dist/assets/-__.md.wD5kDRhS.js +1 -0
  27. package/site/.vitepress/dist/assets/-__.md.wD5kDRhS.lean.js +1 -0
  28. package/site/.vitepress/dist/assets/-_docs.old.md.CiqucE_1.js +625 -0
  29. package/site/.vitepress/dist/assets/-_docs.old.md.CiqucE_1.lean.js +1 -0
  30. package/site/.vitepress/dist/assets/api.md.C9KRNLi_.js +1 -0
  31. package/site/.vitepress/dist/assets/api.md.C9KRNLi_.lean.js +1 -0
  32. package/site/.vitepress/dist/assets/api_webflo-fetch_FormData.md.CDuexUTz.js +1 -0
  33. package/site/.vitepress/dist/assets/api_webflo-fetch_FormData.md.CDuexUTz.lean.js +1 -0
  34. package/site/.vitepress/dist/assets/api_webflo-fetch_Headers.md.Cl_4-FUP.js +1 -0
  35. package/site/.vitepress/dist/assets/api_webflo-fetch_Headers.md.Cl_4-FUP.lean.js +1 -0
  36. package/site/.vitepress/dist/assets/api_webflo-fetch_LiveResponse.md.BMidKMB1.js +1 -0
  37. package/site/.vitepress/dist/assets/api_webflo-fetch_LiveResponse.md.BMidKMB1.lean.js +1 -0
  38. package/site/.vitepress/dist/assets/api_webflo-fetch_Request.md.DPwZCPmi.js +1 -0
  39. package/site/.vitepress/dist/assets/api_webflo-fetch_Request.md.DPwZCPmi.lean.js +1 -0
  40. package/site/.vitepress/dist/assets/api_webflo-fetch_Response.md.BaSyoOLE.js +1 -0
  41. package/site/.vitepress/dist/assets/api_webflo-fetch_Response.md.BaSyoOLE.lean.js +1 -0
  42. package/site/.vitepress/dist/assets/api_webflo-fetch_fetch.md.Bc9r3Q9I.js +1 -0
  43. package/site/.vitepress/dist/assets/api_webflo-fetch_fetch.md.Bc9r3Q9I.lean.js +1 -0
  44. package/site/.vitepress/dist/assets/api_webflo-routing_HttpCookies.md.B5ok3jrM.js +1 -0
  45. package/site/.vitepress/dist/assets/api_webflo-routing_HttpCookies.md.B5ok3jrM.lean.js +1 -0
  46. package/site/.vitepress/dist/assets/api_webflo-routing_HttpEvent.md.DBkSQRTa.js +1 -0
  47. package/site/.vitepress/dist/assets/api_webflo-routing_HttpEvent.md.DBkSQRTa.lean.js +1 -0
  48. package/site/.vitepress/dist/assets/api_webflo-routing_HttpEvent_respondWith.md.aAxq-5Ie.js +1 -0
  49. package/site/.vitepress/dist/assets/api_webflo-routing_HttpEvent_respondWith.md.aAxq-5Ie.lean.js +1 -0
  50. package/site/.vitepress/dist/assets/api_webflo-routing_HttpEvent_waitUntil.md.DyQZLhPR.js +1 -0
  51. package/site/.vitepress/dist/assets/api_webflo-routing_HttpEvent_waitUntil.md.DyQZLhPR.lean.js +1 -0
  52. package/site/.vitepress/dist/assets/api_webflo-routing_HttpEvent_waitUntilNavigate.md.DKLylwhl.js +1 -0
  53. package/site/.vitepress/dist/assets/api_webflo-routing_HttpEvent_waitUntilNavigate.md.DKLylwhl.lean.js +1 -0
  54. package/site/.vitepress/dist/assets/api_webflo-routing_HttpSession.md.bkeCy7_Q.js +1 -0
  55. package/site/.vitepress/dist/assets/api_webflo-routing_HttpSession.md.bkeCy7_Q.lean.js +1 -0
  56. package/site/.vitepress/dist/assets/api_webflo-routing_HttpState.md.DO53IAM1.js +1 -0
  57. package/site/.vitepress/dist/assets/api_webflo-routing_HttpState.md.DO53IAM1.lean.js +1 -0
  58. package/site/.vitepress/dist/assets/api_webflo-routing_HttpUser.md.CfsaBFdl.js +1 -0
  59. package/site/.vitepress/dist/assets/api_webflo-routing_HttpUser.md.CfsaBFdl.lean.js +1 -0
  60. package/site/.vitepress/dist/assets/api_webflo-routing_handler.md.B0eVFluL.js +11 -0
  61. package/site/.vitepress/dist/assets/api_webflo-routing_handler.md.B0eVFluL.lean.js +1 -0
  62. package/site/.vitepress/dist/assets/api_webflo-routing_handler_fetch.md.CpwUMFMz.js +1 -0
  63. package/site/.vitepress/dist/assets/api_webflo-routing_handler_fetch.md.CpwUMFMz.lean.js +1 -0
  64. package/site/.vitepress/dist/assets/api_webflo-routing_handler_next.md.CA4tDXtV.js +7 -0
  65. package/site/.vitepress/dist/assets/api_webflo-routing_handler_next.md.CA4tDXtV.lean.js +1 -0
  66. package/site/.vitepress/dist/assets/app.B989j-Lw.js +256 -0
  67. package/site/.vitepress/dist/assets/chunks/@localSearchIndexroot.IcaIAE_s.js +1 -0
  68. package/site/.vitepress/dist/assets/chunks/VPLocalSearchBox.CxstEVOs.js +8 -0
  69. package/site/.vitepress/dist/assets/chunks/arc.CNNknwAo.js +1 -0
  70. package/site/.vitepress/dist/assets/chunks/architectureDiagram-VXUJARFQ.DCLYhNHD.js +36 -0
  71. package/site/.vitepress/dist/assets/chunks/basePickBy.Cxi84nlK.js +1 -0
  72. package/site/.vitepress/dist/assets/chunks/baseUniq.DDTOgUAc.js +1 -0
  73. package/site/.vitepress/dist/assets/chunks/blockDiagram-VD42YOAC.BcpiarhA.js +122 -0
  74. package/site/.vitepress/dist/assets/chunks/c4Diagram-YG6GDRKO.BI_5dKaW.js +10 -0
  75. package/site/.vitepress/dist/assets/chunks/channel.CxIJmpCu.js +1 -0
  76. package/site/.vitepress/dist/assets/chunks/chunk-4BX2VUAB.C6goADHj.js +1 -0
  77. package/site/.vitepress/dist/assets/chunks/chunk-55IACEB6.BLGj4Pud.js +1 -0
  78. package/site/.vitepress/dist/assets/chunks/chunk-B4BG7PRW.DsAzxoJ_.js +165 -0
  79. package/site/.vitepress/dist/assets/chunks/chunk-DI55MBZ5.BnE2NeEC.js +220 -0
  80. package/site/.vitepress/dist/assets/chunks/chunk-FMBD7UC4.DGeT8zu4.js +15 -0
  81. package/site/.vitepress/dist/assets/chunks/chunk-QN33PNHL.Bc78W0xn.js +1 -0
  82. package/site/.vitepress/dist/assets/chunks/chunk-QZHKN3VN.BFSSbGEs.js +1 -0
  83. package/site/.vitepress/dist/assets/chunks/chunk-TZMSLE5B.DyZR9PPb.js +1 -0
  84. package/site/.vitepress/dist/assets/chunks/classDiagram-2ON5EDUG._0fUH5ha.js +1 -0
  85. package/site/.vitepress/dist/assets/chunks/classDiagram-v2-WZHVMYZB._0fUH5ha.js +1 -0
  86. package/site/.vitepress/dist/assets/chunks/clone.BYyOtvOD.js +1 -0
  87. package/site/.vitepress/dist/assets/chunks/cose-bilkent-S5V4N54A.TlhUFBAR.js +1 -0
  88. package/site/.vitepress/dist/assets/chunks/cytoscape.esm.CyJtwmzi.js +331 -0
  89. package/site/.vitepress/dist/assets/chunks/dagre-6UL2VRFP.D__9IqfC.js +4 -0
  90. package/site/.vitepress/dist/assets/chunks/defaultLocale.C4B-KCzX.js +1 -0
  91. package/site/.vitepress/dist/assets/chunks/diagram-PSM6KHXK.DYSDWndU.js +24 -0
  92. package/site/.vitepress/dist/assets/chunks/diagram-QEK2KX5R.FZi2c8WB.js +43 -0
  93. package/site/.vitepress/dist/assets/chunks/diagram-S2PKOQOG.D-Xxss9Z.js +24 -0
  94. package/site/.vitepress/dist/assets/chunks/erDiagram-Q2GNP2WA.CNdrcxqE.js +60 -0
  95. package/site/.vitepress/dist/assets/chunks/flowDiagram-NV44I4VS.C_6PWuGm.js +162 -0
  96. package/site/.vitepress/dist/assets/chunks/framework.9Uv4PgnO.js +18 -0
  97. package/site/.vitepress/dist/assets/chunks/ganttDiagram-LVOFAZNH._TBJejxF.js +267 -0
  98. package/site/.vitepress/dist/assets/chunks/gitGraphDiagram-NY62KEGX.BmQODSWS.js +65 -0
  99. package/site/.vitepress/dist/assets/chunks/graph.BHWe3GDJ.js +1 -0
  100. package/site/.vitepress/dist/assets/chunks/infoDiagram-ER5ION4S.CbdOaGtv.js +2 -0
  101. package/site/.vitepress/dist/assets/chunks/init.Gi6I4Gst.js +1 -0
  102. package/site/.vitepress/dist/assets/chunks/journeyDiagram-XKPGCS4Q.B-PjYmDZ.js +139 -0
  103. package/site/.vitepress/dist/assets/chunks/kanban-definition-3W4ZIXB7.Bc_8e9KR.js +89 -0
  104. package/site/.vitepress/dist/assets/chunks/katex.BbEIqZs1.js +261 -0
  105. package/site/.vitepress/dist/assets/chunks/layout.hswMW8l0.js +1 -0
  106. package/site/.vitepress/dist/assets/chunks/linear.CUHYPplj.js +1 -0
  107. package/site/.vitepress/dist/assets/chunks/mindmap-definition-VGOIOE7T.CvIaZI8e.js +68 -0
  108. package/site/.vitepress/dist/assets/chunks/ordinal.BYWQX77i.js +1 -0
  109. package/site/.vitepress/dist/assets/chunks/pieDiagram-ADFJNKIX.BSTQM2Ms.js +30 -0
  110. package/site/.vitepress/dist/assets/chunks/quadrantDiagram-AYHSOK5B.CkEJjNYC.js +7 -0
  111. package/site/.vitepress/dist/assets/chunks/requirementDiagram-UZGBJVZJ.QsTahBza.js +64 -0
  112. package/site/.vitepress/dist/assets/chunks/sankeyDiagram-TZEHDZUN.NRsUNMzF.js +10 -0
  113. package/site/.vitepress/dist/assets/chunks/sequenceDiagram-WL72ISMW.rq-YLOb-.js +145 -0
  114. package/site/.vitepress/dist/assets/chunks/stateDiagram-FKZM4ZOC.BseVQjcW.js +1 -0
  115. package/site/.vitepress/dist/assets/chunks/stateDiagram-v2-4FDKWEC3.CH4mdaj_.js +1 -0
  116. package/site/.vitepress/dist/assets/chunks/theme.Jp0RA4YE.js +2 -0
  117. package/site/.vitepress/dist/assets/chunks/timeline-definition-IT6M3QCI.N8DNMk16.js +61 -0
  118. package/site/.vitepress/dist/assets/chunks/treemap-KMMF4GRG.CAwkr_aP.js +128 -0
  119. package/site/.vitepress/dist/assets/chunks/virtual_mermaid-config.DDnGl6nM.js +1 -0
  120. package/site/.vitepress/dist/assets/chunks/xychartDiagram-PRI3JC2R.CF4KVQhG.js +7 -0
  121. package/site/.vitepress/dist/assets/contributing.md.gqIMCtVI.js +1 -0
  122. package/site/.vitepress/dist/assets/contributing.md.gqIMCtVI.lean.js +1 -0
  123. package/site/.vitepress/dist/assets/docs.md.hvbqYbFY.js +1 -0
  124. package/site/.vitepress/dist/assets/docs.md.hvbqYbFY.lean.js +1 -0
  125. package/site/.vitepress/dist/assets/docs_advanced.md.D048cxnq.js +1 -0
  126. package/site/.vitepress/dist/assets/docs_advanced.md.D048cxnq.lean.js +1 -0
  127. package/site/.vitepress/dist/assets/docs_advanced_lifecycles.md.BICPL-da.js +1 -0
  128. package/site/.vitepress/dist/assets/docs_advanced_lifecycles.md.BICPL-da.lean.js +1 -0
  129. package/site/.vitepress/dist/assets/docs_advanced_redirects.md.BMha6D3W.js +1 -0
  130. package/site/.vitepress/dist/assets/docs_advanced_redirects.md.BMha6D3W.lean.js +1 -0
  131. package/site/.vitepress/dist/assets/docs_advanced_routing.md.Cv63UDJF.js +1 -0
  132. package/site/.vitepress/dist/assets/docs_advanced_routing.md.Cv63UDJF.lean.js +1 -0
  133. package/site/.vitepress/dist/assets/docs_concepts.md.Clwx81Hz.js +3 -0
  134. package/site/.vitepress/dist/assets/docs_concepts.md.Clwx81Hz.lean.js +1 -0
  135. package/site/.vitepress/dist/assets/docs_concepts_realtime.md.CBrMq5Ln.js +218 -0
  136. package/site/.vitepress/dist/assets/docs_concepts_realtime.md.CBrMq5Ln.lean.js +1 -0
  137. package/site/.vitepress/dist/assets/docs_concepts_rendering.md.BWr5Lxgn.js +24 -0
  138. package/site/.vitepress/dist/assets/docs_concepts_rendering.md.BWr5Lxgn.lean.js +1 -0
  139. package/site/.vitepress/dist/assets/docs_concepts_request-response.md.DhplzNqt.js +4 -0
  140. package/site/.vitepress/dist/assets/docs_concepts_request-response.md.DhplzNqt.lean.js +1 -0
  141. package/site/.vitepress/dist/assets/docs_concepts_routing.md.C2KO1eAu.js +228 -0
  142. package/site/.vitepress/dist/assets/docs_concepts_routing.md.C2KO1eAu.lean.js +1 -0
  143. package/site/.vitepress/dist/assets/docs_concepts_state.md.CtbMVS_K.js +10 -0
  144. package/site/.vitepress/dist/assets/docs_concepts_state.md.CtbMVS_K.lean.js +1 -0
  145. package/site/.vitepress/dist/assets/docs_concepts_templates.md.4i6jQcYw.js +15 -0
  146. package/site/.vitepress/dist/assets/docs_concepts_templates.md.4i6jQcYw.lean.js +1 -0
  147. package/site/.vitepress/dist/assets/docs_getting-started.md.CNGtwB_L.js +75 -0
  148. package/site/.vitepress/dist/assets/docs_getting-started.md.CNGtwB_L.lean.js +1 -0
  149. package/site/.vitepress/dist/assets/docs_tech-stack.md.xiWGQstL.js +1 -0
  150. package/site/.vitepress/dist/assets/docs_tech-stack.md.xiWGQstL.lean.js +1 -0
  151. package/site/.vitepress/dist/assets/examples.md.BqDfJd4G.js +1 -0
  152. package/site/.vitepress/dist/assets/examples.md.BqDfJd4G.lean.js +1 -0
  153. package/site/.vitepress/dist/assets/examples_pwa.md.DREN7J2F.js +1 -0
  154. package/site/.vitepress/dist/assets/examples_pwa.md.DREN7J2F.lean.js +1 -0
  155. package/site/.vitepress/dist/assets/examples_web.md.DUhZ0IQL.js +1 -0
  156. package/site/.vitepress/dist/assets/examples_web.md.DUhZ0IQL.lean.js +1 -0
  157. package/site/.vitepress/dist/assets/faq.md.DtfXaXUI.js +1 -0
  158. package/site/.vitepress/dist/assets/faq.md.DtfXaXUI.lean.js +1 -0
  159. package/site/.vitepress/dist/assets/guides.md.BVdQyeU-.js +1 -0
  160. package/site/.vitepress/dist/assets/guides.md.BVdQyeU-.lean.js +1 -0
  161. package/site/.vitepress/dist/assets/guides_guide-auth.md.DNFuRudp.js +1 -0
  162. package/site/.vitepress/dist/assets/guides_guide-auth.md.DNFuRudp.lean.js +1 -0
  163. package/site/.vitepress/dist/assets/guides_guide-file-upload.md.DRbRLk7h.js +1 -0
  164. package/site/.vitepress/dist/assets/guides_guide-file-upload.md.DRbRLk7h.lean.js +1 -0
  165. package/site/.vitepress/dist/assets/guides_guide-service-worker.md.B0wEVcQw.js +1 -0
  166. package/site/.vitepress/dist/assets/guides_guide-service-worker.md.B0wEVcQw.lean.js +1 -0
  167. package/site/.vitepress/dist/assets/guides_tutorial-1-todo.md.D9ket3Re.js +3 -0
  168. package/site/.vitepress/dist/assets/guides_tutorial-1-todo.md.D9ket3Re.lean.js +1 -0
  169. package/site/.vitepress/dist/assets/index.md.DB-CsGEX.js +1 -0
  170. package/site/.vitepress/dist/assets/index.md.DB-CsGEX.lean.js +1 -0
  171. package/site/.vitepress/dist/assets/inter-italic-cyrillic-ext.r48I6akx.woff2 +0 -0
  172. package/site/.vitepress/dist/assets/inter-italic-cyrillic.By2_1cv3.woff2 +0 -0
  173. package/site/.vitepress/dist/assets/inter-italic-greek-ext.1u6EdAuj.woff2 +0 -0
  174. package/site/.vitepress/dist/assets/inter-italic-greek.DJ8dCoTZ.woff2 +0 -0
  175. package/site/.vitepress/dist/assets/inter-italic-latin-ext.CN1xVJS-.woff2 +0 -0
  176. package/site/.vitepress/dist/assets/inter-italic-latin.C2AdPX0b.woff2 +0 -0
  177. package/site/.vitepress/dist/assets/inter-italic-vietnamese.BSbpV94h.woff2 +0 -0
  178. package/site/.vitepress/dist/assets/inter-roman-cyrillic-ext.BBPuwvHQ.woff2 +0 -0
  179. package/site/.vitepress/dist/assets/inter-roman-cyrillic.C5lxZ8CY.woff2 +0 -0
  180. package/site/.vitepress/dist/assets/inter-roman-greek-ext.CqjqNYQ-.woff2 +0 -0
  181. package/site/.vitepress/dist/assets/inter-roman-greek.BBVDIX6e.woff2 +0 -0
  182. package/site/.vitepress/dist/assets/inter-roman-latin-ext.4ZJIpNVo.woff2 +0 -0
  183. package/site/.vitepress/dist/assets/inter-roman-latin.Di8DUHzh.woff2 +0 -0
  184. package/site/.vitepress/dist/assets/inter-roman-vietnamese.BjW4sHH5.woff2 +0 -0
  185. package/site/.vitepress/dist/assets/recipes_realtime.md.CX1Vs2FD.js +1 -0
  186. package/site/.vitepress/dist/assets/recipes_realtime.md.CX1Vs2FD.lean.js +1 -0
  187. package/site/.vitepress/dist/assets/recipes_streaming.md.C7GFShgF.js +5 -0
  188. package/site/.vitepress/dist/assets/recipes_streaming.md.C7GFShgF.lean.js +1 -0
  189. package/site/.vitepress/dist/assets/reference_cli.md.DERqaQJm.js +1 -0
  190. package/site/.vitepress/dist/assets/reference_cli.md.DERqaQJm.lean.js +1 -0
  191. package/site/.vitepress/dist/assets/reference_config.md.DI_yG-7N.js +1 -0
  192. package/site/.vitepress/dist/assets/reference_config.md.DI_yG-7N.lean.js +1 -0
  193. package/site/.vitepress/dist/assets/reference_tools.md.DZxjdVFX.js +1 -0
  194. package/site/.vitepress/dist/assets/reference_tools.md.DZxjdVFX.lean.js +1 -0
  195. package/site/.vitepress/dist/assets/style.BD0LzINo.css +1 -0
  196. package/site/.vitepress/dist/contributing.html +55 -0
  197. package/site/.vitepress/dist/docs/advanced/lifecycles.html +55 -0
  198. package/site/.vitepress/dist/docs/advanced/redirects.html +55 -0
  199. package/site/.vitepress/dist/docs/advanced/routing.html +55 -0
  200. package/site/.vitepress/dist/docs/advanced.html +55 -0
  201. package/site/.vitepress/dist/docs/concepts/realtime.html +272 -0
  202. package/site/.vitepress/dist/docs/concepts/rendering.html +78 -0
  203. package/site/.vitepress/dist/docs/concepts/request-response.html +58 -0
  204. package/site/.vitepress/dist/docs/concepts/routing.html +282 -0
  205. package/site/.vitepress/dist/docs/concepts/state.html +64 -0
  206. package/site/.vitepress/dist/docs/concepts/templates.html +69 -0
  207. package/site/.vitepress/dist/docs/concepts.html +57 -0
  208. package/site/.vitepress/dist/docs/getting-started.html +129 -0
  209. package/site/.vitepress/dist/docs/tech-stack.html +55 -0
  210. package/site/.vitepress/dist/docs.html +55 -0
  211. package/site/.vitepress/dist/examples/pwa.html +55 -0
  212. package/site/.vitepress/dist/examples/web.html +55 -0
  213. package/site/.vitepress/dist/examples.html +55 -0
  214. package/site/.vitepress/dist/faq.html +55 -0
  215. package/site/.vitepress/dist/guides/guide-auth.html +55 -0
  216. package/site/.vitepress/dist/guides/guide-file-upload.html +55 -0
  217. package/site/.vitepress/dist/guides/guide-service-worker.html +55 -0
  218. package/site/.vitepress/dist/guides/tutorial-1-todo.html +57 -0
  219. package/site/.vitepress/dist/guides.html +55 -0
  220. package/site/.vitepress/dist/hashmap.json +1 -0
  221. package/site/.vitepress/dist/img/brand/logo-670x670.png +0 -0
  222. package/site/.vitepress/dist/index.html +55 -0
  223. package/site/.vitepress/dist/recipes/realtime.html +55 -0
  224. package/site/.vitepress/dist/recipes/streaming.html +59 -0
  225. package/site/.vitepress/dist/reference/cli.html +55 -0
  226. package/site/.vitepress/dist/reference/config.html +55 -0
  227. package/site/.vitepress/dist/reference/tools.html +55 -0
  228. package/site/.vitepress/dist/vp-icons.css +1 -0
  229. package/site/docs/getting-started.md +12 -0
  230. package/site/docs.md +4 -99
  231. package/site/index.md +4 -1
  232. package/site/overview.md +101 -0
  233. package/site/.vitepress/cache/deps/@braintree_sanitize-url 2.js +0 -93
  234. package/site/.vitepress/cache/deps/@braintree_sanitize-url.js 2.map +0 -7
  235. package/site/.vitepress/cache/deps/_metadata 2.json +0 -85
  236. package/site/.vitepress/cache/deps/chunk-BUSYA2B4 2.js +0 -9
  237. package/site/.vitepress/cache/deps/chunk-BUSYA2B4.js 2.map +0 -7
  238. package/site/.vitepress/cache/deps/chunk-Q2AYPHVK 2.js +0 -9719
  239. package/site/.vitepress/cache/deps/chunk-Q2AYPHVK.js 2.map +0 -7
  240. package/site/.vitepress/cache/deps/chunk-QAXAIFA7 2.js +0 -12705
  241. package/site/.vitepress/cache/deps/chunk-QAXAIFA7.js 2.map +0 -7
  242. package/site/.vitepress/cache/deps/cytoscape 2.js +0 -30278
  243. package/site/.vitepress/cache/deps/cytoscape-cose-bilkent 2.js +0 -4710
  244. package/site/.vitepress/cache/deps/cytoscape-cose-bilkent.js 2.map +0 -7
  245. package/site/.vitepress/cache/deps/cytoscape.js 2.map +0 -7
  246. package/site/.vitepress/cache/deps/dayjs 2.js +0 -285
  247. package/site/.vitepress/cache/deps/dayjs.js 2.map +0 -7
  248. package/site/.vitepress/cache/deps/debug 2.js +0 -453
  249. package/site/.vitepress/cache/deps/debug.js 2.map +0 -7
  250. package/site/.vitepress/cache/deps/package 2.json +0 -3
  251. package/site/.vitepress/cache/deps/vitepress___@vue_devtools-api 2.js +0 -4507
  252. package/site/.vitepress/cache/deps/vitepress___@vue_devtools-api.js 2.map +0 -7
  253. package/site/.vitepress/cache/deps/vitepress___@vueuse_core 2.js +0 -584
  254. package/site/.vitepress/cache/deps/vitepress___@vueuse_core.js 2.map +0 -7
  255. package/site/.vitepress/cache/deps/vitepress___@vueuse_integrations_useFocusTrap 2.js +0 -1166
  256. package/site/.vitepress/cache/deps/vitepress___@vueuse_integrations_useFocusTrap.js 2.map +0 -7
  257. package/site/.vitepress/cache/deps/vitepress___mark__js_src_vanilla__js 2.js +0 -1667
  258. package/site/.vitepress/cache/deps/vitepress___mark__js_src_vanilla__js.js 2.map +0 -7
  259. package/site/.vitepress/cache/deps/vitepress___minisearch 2.js +0 -1815
  260. package/site/.vitepress/cache/deps/vitepress___minisearch.js 2.map +0 -7
  261. package/site/.vitepress/cache/deps/vue 2.js +0 -344
  262. package/site/.vitepress/cache/deps/vue.js 2.map +0 -7
@@ -1,1667 +0,0 @@
1
- import "./chunk-BUSYA2B4.js";
2
-
3
- // node_modules/mark.js/src/lib/domiterator.js
4
- var DOMIterator = class _DOMIterator {
5
- /**
6
- * @param {HTMLElement|HTMLElement[]|NodeList|string} ctx - The context DOM
7
- * element, an array of DOM elements, a NodeList or a selector
8
- * @param {boolean} [iframes=true] - A boolean indicating if iframes should
9
- * be handled
10
- * @param {string[]} [exclude=[]] - An array containing exclusion selectors
11
- * for iframes
12
- * @param {number} [iframesTimeout=5000] - A number indicating the ms to
13
- * wait before an iframe should be skipped, in case the load event isn't
14
- * fired. This also applies if the user is offline and the resource of the
15
- * iframe is online (either by the browsers "offline" mode or because
16
- * there's no internet connection)
17
- */
18
- constructor(ctx, iframes = true, exclude = [], iframesTimeout = 5e3) {
19
- this.ctx = ctx;
20
- this.iframes = iframes;
21
- this.exclude = exclude;
22
- this.iframesTimeout = iframesTimeout;
23
- }
24
- /**
25
- * Checks if the specified DOM element matches the selector
26
- * @param {HTMLElement} element - The DOM element
27
- * @param {string|string[]} selector - The selector or an array with
28
- * selectors
29
- * @return {boolean}
30
- * @access public
31
- */
32
- static matches(element, selector) {
33
- const selectors = typeof selector === "string" ? [selector] : selector, fn = element.matches || element.matchesSelector || element.msMatchesSelector || element.mozMatchesSelector || element.oMatchesSelector || element.webkitMatchesSelector;
34
- if (fn) {
35
- let match = false;
36
- selectors.every((sel) => {
37
- if (fn.call(element, sel)) {
38
- match = true;
39
- return false;
40
- }
41
- return true;
42
- });
43
- return match;
44
- } else {
45
- return false;
46
- }
47
- }
48
- /**
49
- * Returns all contexts filtered by duplicates (even nested)
50
- * @return {HTMLElement[]} - An array containing DOM contexts
51
- * @access protected
52
- */
53
- getContexts() {
54
- let ctx, filteredCtx = [];
55
- if (typeof this.ctx === "undefined" || !this.ctx) {
56
- ctx = [];
57
- } else if (NodeList.prototype.isPrototypeOf(this.ctx)) {
58
- ctx = Array.prototype.slice.call(this.ctx);
59
- } else if (Array.isArray(this.ctx)) {
60
- ctx = this.ctx;
61
- } else if (typeof this.ctx === "string") {
62
- ctx = Array.prototype.slice.call(
63
- document.querySelectorAll(this.ctx)
64
- );
65
- } else {
66
- ctx = [this.ctx];
67
- }
68
- ctx.forEach((ctx2) => {
69
- const isDescendant = filteredCtx.filter((contexts) => {
70
- return contexts.contains(ctx2);
71
- }).length > 0;
72
- if (filteredCtx.indexOf(ctx2) === -1 && !isDescendant) {
73
- filteredCtx.push(ctx2);
74
- }
75
- });
76
- return filteredCtx;
77
- }
78
- /**
79
- * @callback DOMIterator~getIframeContentsSuccessCallback
80
- * @param {HTMLDocument} contents - The contentDocument of the iframe
81
- */
82
- /**
83
- * Calls the success callback function with the iframe document. If it can't
84
- * be accessed it calls the error callback function
85
- * @param {HTMLElement} ifr - The iframe DOM element
86
- * @param {DOMIterator~getIframeContentsSuccessCallback} successFn
87
- * @param {function} [errorFn]
88
- * @access protected
89
- */
90
- getIframeContents(ifr, successFn, errorFn = () => {
91
- }) {
92
- let doc;
93
- try {
94
- const ifrWin = ifr.contentWindow;
95
- doc = ifrWin.document;
96
- if (!ifrWin || !doc) {
97
- throw new Error("iframe inaccessible");
98
- }
99
- } catch (e) {
100
- errorFn();
101
- }
102
- if (doc) {
103
- successFn(doc);
104
- }
105
- }
106
- /**
107
- * Checks if an iframe is empty (if about:blank is the shown page)
108
- * @param {HTMLElement} ifr - The iframe DOM element
109
- * @return {boolean}
110
- * @access protected
111
- */
112
- isIframeBlank(ifr) {
113
- const bl = "about:blank", src = ifr.getAttribute("src").trim(), href = ifr.contentWindow.location.href;
114
- return href === bl && src !== bl && src;
115
- }
116
- /**
117
- * Observes the onload event of an iframe and calls the success callback or
118
- * the error callback if the iframe is inaccessible. If the event isn't
119
- * fired within the specified {@link DOMIterator#iframesTimeout}, then it'll
120
- * call the error callback too
121
- * @param {HTMLElement} ifr - The iframe DOM element
122
- * @param {DOMIterator~getIframeContentsSuccessCallback} successFn
123
- * @param {function} errorFn
124
- * @access protected
125
- */
126
- observeIframeLoad(ifr, successFn, errorFn) {
127
- let called = false, tout = null;
128
- const listener = () => {
129
- if (called) {
130
- return;
131
- }
132
- called = true;
133
- clearTimeout(tout);
134
- try {
135
- if (!this.isIframeBlank(ifr)) {
136
- ifr.removeEventListener("load", listener);
137
- this.getIframeContents(ifr, successFn, errorFn);
138
- }
139
- } catch (e) {
140
- errorFn();
141
- }
142
- };
143
- ifr.addEventListener("load", listener);
144
- tout = setTimeout(listener, this.iframesTimeout);
145
- }
146
- /**
147
- * Callback when the iframe is ready
148
- * @callback DOMIterator~onIframeReadySuccessCallback
149
- * @param {HTMLDocument} contents - The contentDocument of the iframe
150
- */
151
- /**
152
- * Callback if the iframe can't be accessed
153
- * @callback DOMIterator~onIframeReadyErrorCallback
154
- */
155
- /**
156
- * Calls the callback if the specified iframe is ready for DOM access
157
- * @param {HTMLElement} ifr - The iframe DOM element
158
- * @param {DOMIterator~onIframeReadySuccessCallback} successFn - Success
159
- * callback
160
- * @param {DOMIterator~onIframeReadyErrorCallback} errorFn - Error callback
161
- * @see {@link http://stackoverflow.com/a/36155560/3894981} for
162
- * background information
163
- * @access protected
164
- */
165
- onIframeReady(ifr, successFn, errorFn) {
166
- try {
167
- if (ifr.contentWindow.document.readyState === "complete") {
168
- if (this.isIframeBlank(ifr)) {
169
- this.observeIframeLoad(ifr, successFn, errorFn);
170
- } else {
171
- this.getIframeContents(ifr, successFn, errorFn);
172
- }
173
- } else {
174
- this.observeIframeLoad(ifr, successFn, errorFn);
175
- }
176
- } catch (e) {
177
- errorFn();
178
- }
179
- }
180
- /**
181
- * Callback when all iframes are ready for DOM access
182
- * @callback DOMIterator~waitForIframesDoneCallback
183
- */
184
- /**
185
- * Iterates over all iframes and calls the done callback when all of them
186
- * are ready for DOM access (including nested ones)
187
- * @param {HTMLElement} ctx - The context DOM element
188
- * @param {DOMIterator~waitForIframesDoneCallback} done - Done callback
189
- */
190
- waitForIframes(ctx, done) {
191
- let eachCalled = 0;
192
- this.forEachIframe(ctx, () => true, (ifr) => {
193
- eachCalled++;
194
- this.waitForIframes(ifr.querySelector("html"), () => {
195
- if (!--eachCalled) {
196
- done();
197
- }
198
- });
199
- }, (handled) => {
200
- if (!handled) {
201
- done();
202
- }
203
- });
204
- }
205
- /**
206
- * Callback allowing to filter an iframe. Must return true when the element
207
- * should remain, otherwise false
208
- * @callback DOMIterator~forEachIframeFilterCallback
209
- * @param {HTMLElement} iframe - The iframe DOM element
210
- */
211
- /**
212
- * Callback for each iframe content
213
- * @callback DOMIterator~forEachIframeEachCallback
214
- * @param {HTMLElement} content - The iframe document
215
- */
216
- /**
217
- * Callback if all iframes inside the context were handled
218
- * @callback DOMIterator~forEachIframeEndCallback
219
- * @param {number} handled - The number of handled iframes (those who
220
- * wheren't filtered)
221
- */
222
- /**
223
- * Iterates over all iframes inside the specified context and calls the
224
- * callbacks when they're ready. Filters iframes based on the instance
225
- * exclusion selectors
226
- * @param {HTMLElement} ctx - The context DOM element
227
- * @param {DOMIterator~forEachIframeFilterCallback} filter - Filter callback
228
- * @param {DOMIterator~forEachIframeEachCallback} each - Each callback
229
- * @param {DOMIterator~forEachIframeEndCallback} [end] - End callback
230
- * @access protected
231
- */
232
- forEachIframe(ctx, filter, each, end = () => {
233
- }) {
234
- let ifr = ctx.querySelectorAll("iframe"), open = ifr.length, handled = 0;
235
- ifr = Array.prototype.slice.call(ifr);
236
- const checkEnd = () => {
237
- if (--open <= 0) {
238
- end(handled);
239
- }
240
- };
241
- if (!open) {
242
- checkEnd();
243
- }
244
- ifr.forEach((ifr2) => {
245
- if (_DOMIterator.matches(ifr2, this.exclude)) {
246
- checkEnd();
247
- } else {
248
- this.onIframeReady(ifr2, (con) => {
249
- if (filter(ifr2)) {
250
- handled++;
251
- each(con);
252
- }
253
- checkEnd();
254
- }, checkEnd);
255
- }
256
- });
257
- }
258
- /**
259
- * Creates a NodeIterator on the specified context
260
- * @see {@link https://developer.mozilla.org/en/docs/Web/API/NodeIterator}
261
- * @param {HTMLElement} ctx - The context DOM element
262
- * @param {DOMIterator~whatToShow} whatToShow
263
- * @param {DOMIterator~filterCb} filter
264
- * @return {NodeIterator}
265
- * @access protected
266
- */
267
- createIterator(ctx, whatToShow, filter) {
268
- return document.createNodeIterator(ctx, whatToShow, filter, false);
269
- }
270
- /**
271
- * Creates an instance of DOMIterator in an iframe
272
- * @param {HTMLDocument} contents - Iframe document
273
- * @return {DOMIterator}
274
- * @access protected
275
- */
276
- createInstanceOnIframe(contents) {
277
- return new _DOMIterator(contents.querySelector("html"), this.iframes);
278
- }
279
- /**
280
- * Checks if an iframe occurs between two nodes, more specifically if an
281
- * iframe occurs before the specified node and after the specified prevNode
282
- * @param {HTMLElement} node - The node that should occur after the iframe
283
- * @param {HTMLElement} prevNode - The node that should occur before the
284
- * iframe
285
- * @param {HTMLElement} ifr - The iframe to check against
286
- * @return {boolean}
287
- * @access protected
288
- */
289
- compareNodeIframe(node, prevNode, ifr) {
290
- const compCurr = node.compareDocumentPosition(ifr), prev = Node.DOCUMENT_POSITION_PRECEDING;
291
- if (compCurr & prev) {
292
- if (prevNode !== null) {
293
- const compPrev = prevNode.compareDocumentPosition(ifr), after = Node.DOCUMENT_POSITION_FOLLOWING;
294
- if (compPrev & after) {
295
- return true;
296
- }
297
- } else {
298
- return true;
299
- }
300
- }
301
- return false;
302
- }
303
- /**
304
- * @typedef {DOMIterator~getIteratorNodeReturn}
305
- * @type {object.<string>}
306
- * @property {HTMLElement} prevNode - The previous node or null if there is
307
- * no
308
- * @property {HTMLElement} node - The current node
309
- */
310
- /**
311
- * Returns the previous and current node of the specified iterator
312
- * @param {NodeIterator} itr - The iterator
313
- * @return {DOMIterator~getIteratorNodeReturn}
314
- * @access protected
315
- */
316
- getIteratorNode(itr) {
317
- const prevNode = itr.previousNode();
318
- let node;
319
- if (prevNode === null) {
320
- node = itr.nextNode();
321
- } else {
322
- node = itr.nextNode() && itr.nextNode();
323
- }
324
- return {
325
- prevNode,
326
- node
327
- };
328
- }
329
- /**
330
- * An array containing objects. The object key "val" contains an iframe
331
- * DOM element. The object key "handled" contains a boolean indicating if
332
- * the iframe was handled already.
333
- * It wouldn't be enough to save all open or all already handled iframes.
334
- * The information of open iframes is necessary because they may occur after
335
- * all other text nodes (and compareNodeIframe would never be true). The
336
- * information of already handled iframes is necessary as otherwise they may
337
- * be handled multiple times
338
- * @typedef DOMIterator~checkIframeFilterIfr
339
- * @type {object[]}
340
- */
341
- /**
342
- * Checks if an iframe wasn't handled already and if so, calls
343
- * {@link DOMIterator#compareNodeIframe} to check if it should be handled.
344
- * Information wheter an iframe was or wasn't handled is given within the
345
- * <code>ifr</code> dictionary
346
- * @param {HTMLElement} node - The node that should occur after the iframe
347
- * @param {HTMLElement} prevNode - The node that should occur before the
348
- * iframe
349
- * @param {HTMLElement} currIfr - The iframe to check
350
- * @param {DOMIterator~checkIframeFilterIfr} ifr - The iframe dictionary.
351
- * Will be manipulated (by reference)
352
- * @return {boolean} Returns true when it should be handled, otherwise false
353
- * @access protected
354
- */
355
- checkIframeFilter(node, prevNode, currIfr, ifr) {
356
- let key = false, handled = false;
357
- ifr.forEach((ifrDict, i) => {
358
- if (ifrDict.val === currIfr) {
359
- key = i;
360
- handled = ifrDict.handled;
361
- }
362
- });
363
- if (this.compareNodeIframe(node, prevNode, currIfr)) {
364
- if (key === false && !handled) {
365
- ifr.push({
366
- val: currIfr,
367
- handled: true
368
- });
369
- } else if (key !== false && !handled) {
370
- ifr[key].handled = true;
371
- }
372
- return true;
373
- }
374
- if (key === false) {
375
- ifr.push({
376
- val: currIfr,
377
- handled: false
378
- });
379
- }
380
- return false;
381
- }
382
- /**
383
- * Creates an iterator on all open iframes in the specified array and calls
384
- * the end callback when finished
385
- * @param {DOMIterator~checkIframeFilterIfr} ifr
386
- * @param {DOMIterator~whatToShow} whatToShow
387
- * @param {DOMIterator~forEachNodeCallback} eCb - Each callback
388
- * @param {DOMIterator~filterCb} fCb
389
- * @access protected
390
- */
391
- handleOpenIframes(ifr, whatToShow, eCb, fCb) {
392
- ifr.forEach((ifrDict) => {
393
- if (!ifrDict.handled) {
394
- this.getIframeContents(ifrDict.val, (con) => {
395
- this.createInstanceOnIframe(con).forEachNode(
396
- whatToShow,
397
- eCb,
398
- fCb
399
- );
400
- });
401
- }
402
- });
403
- }
404
- /**
405
- * Iterates through all nodes in the specified context and handles iframe
406
- * nodes at the correct position
407
- * @param {DOMIterator~whatToShow} whatToShow
408
- * @param {HTMLElement} ctx - The context
409
- * @param {DOMIterator~forEachNodeCallback} eachCb - Each callback
410
- * @param {DOMIterator~filterCb} filterCb - Filter callback
411
- * @param {DOMIterator~forEachNodeEndCallback} doneCb - End callback
412
- * @access protected
413
- */
414
- iterateThroughNodes(whatToShow, ctx, eachCb, filterCb, doneCb) {
415
- const itr = this.createIterator(ctx, whatToShow, filterCb);
416
- let ifr = [], elements = [], node, prevNode, retrieveNodes = () => {
417
- ({
418
- prevNode,
419
- node
420
- } = this.getIteratorNode(itr));
421
- return node;
422
- };
423
- while (retrieveNodes()) {
424
- if (this.iframes) {
425
- this.forEachIframe(ctx, (currIfr) => {
426
- return this.checkIframeFilter(node, prevNode, currIfr, ifr);
427
- }, (con) => {
428
- this.createInstanceOnIframe(con).forEachNode(
429
- whatToShow,
430
- (ifrNode) => elements.push(ifrNode),
431
- filterCb
432
- );
433
- });
434
- }
435
- elements.push(node);
436
- }
437
- elements.forEach((node2) => {
438
- eachCb(node2);
439
- });
440
- if (this.iframes) {
441
- this.handleOpenIframes(ifr, whatToShow, eachCb, filterCb);
442
- }
443
- doneCb();
444
- }
445
- /**
446
- * Callback for each node
447
- * @callback DOMIterator~forEachNodeCallback
448
- * @param {HTMLElement} node - The DOM text node element
449
- */
450
- /**
451
- * Callback if all contexts were handled
452
- * @callback DOMIterator~forEachNodeEndCallback
453
- */
454
- /**
455
- * Iterates over all contexts and initializes
456
- * {@link DOMIterator#iterateThroughNodes iterateThroughNodes} on them
457
- * @param {DOMIterator~whatToShow} whatToShow
458
- * @param {DOMIterator~forEachNodeCallback} each - Each callback
459
- * @param {DOMIterator~filterCb} filter - Filter callback
460
- * @param {DOMIterator~forEachNodeEndCallback} done - End callback
461
- * @access public
462
- */
463
- forEachNode(whatToShow, each, filter, done = () => {
464
- }) {
465
- const contexts = this.getContexts();
466
- let open = contexts.length;
467
- if (!open) {
468
- done();
469
- }
470
- contexts.forEach((ctx) => {
471
- const ready = () => {
472
- this.iterateThroughNodes(whatToShow, ctx, each, filter, () => {
473
- if (--open <= 0) {
474
- done();
475
- }
476
- });
477
- };
478
- if (this.iframes) {
479
- this.waitForIframes(ctx, ready);
480
- } else {
481
- ready();
482
- }
483
- });
484
- }
485
- /**
486
- * Callback to filter nodes. Can return e.g. NodeFilter.FILTER_ACCEPT or
487
- * NodeFilter.FILTER_REJECT
488
- * @see {@link http://tinyurl.com/zdczmm2}
489
- * @callback DOMIterator~filterCb
490
- * @param {HTMLElement} node - The node to filter
491
- */
492
- /**
493
- * @typedef DOMIterator~whatToShow
494
- * @see {@link http://tinyurl.com/zfqqkx2}
495
- * @type {number}
496
- */
497
- };
498
-
499
- // node_modules/mark.js/src/lib/mark.js
500
- var Mark = class {
501
- // eslint-disable-line no-unused-vars
502
- /**
503
- * @param {HTMLElement|HTMLElement[]|NodeList|string} ctx - The context DOM
504
- * element, an array of DOM elements, a NodeList or a selector
505
- */
506
- constructor(ctx) {
507
- this.ctx = ctx;
508
- this.ie = false;
509
- const ua = window.navigator.userAgent;
510
- if (ua.indexOf("MSIE") > -1 || ua.indexOf("Trident") > -1) {
511
- this.ie = true;
512
- }
513
- }
514
- /**
515
- * Options defined by the user. They will be initialized from one of the
516
- * public methods. See {@link Mark#mark}, {@link Mark#markRegExp},
517
- * {@link Mark#markRanges} and {@link Mark#unmark} for option properties.
518
- * @type {object}
519
- * @param {object} [val] - An object that will be merged with defaults
520
- * @access protected
521
- */
522
- set opt(val) {
523
- this._opt = Object.assign({}, {
524
- "element": "",
525
- "className": "",
526
- "exclude": [],
527
- "iframes": false,
528
- "iframesTimeout": 5e3,
529
- "separateWordSearch": true,
530
- "diacritics": true,
531
- "synonyms": {},
532
- "accuracy": "partially",
533
- "acrossElements": false,
534
- "caseSensitive": false,
535
- "ignoreJoiners": false,
536
- "ignoreGroups": 0,
537
- "ignorePunctuation": [],
538
- "wildcards": "disabled",
539
- "each": () => {
540
- },
541
- "noMatch": () => {
542
- },
543
- "filter": () => true,
544
- "done": () => {
545
- },
546
- "debug": false,
547
- "log": window.console
548
- }, val);
549
- }
550
- get opt() {
551
- return this._opt;
552
- }
553
- /**
554
- * An instance of DOMIterator
555
- * @type {DOMIterator}
556
- * @access protected
557
- */
558
- get iterator() {
559
- return new DOMIterator(
560
- this.ctx,
561
- this.opt.iframes,
562
- this.opt.exclude,
563
- this.opt.iframesTimeout
564
- );
565
- }
566
- /**
567
- * Logs a message if log is enabled
568
- * @param {string} msg - The message to log
569
- * @param {string} [level="debug"] - The log level, e.g. <code>warn</code>
570
- * <code>error</code>, <code>debug</code>
571
- * @access protected
572
- */
573
- log(msg, level = "debug") {
574
- const log = this.opt.log;
575
- if (!this.opt.debug) {
576
- return;
577
- }
578
- if (typeof log === "object" && typeof log[level] === "function") {
579
- log[level](`mark.js: ${msg}`);
580
- }
581
- }
582
- /**
583
- * Escapes a string for usage within a regular expression
584
- * @param {string} str - The string to escape
585
- * @return {string}
586
- * @access protected
587
- */
588
- escapeStr(str) {
589
- return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
590
- }
591
- /**
592
- * Creates a regular expression string to match the specified search
593
- * term including synonyms, diacritics and accuracy if defined
594
- * @param {string} str - The search term to be used
595
- * @return {string}
596
- * @access protected
597
- */
598
- createRegExp(str) {
599
- if (this.opt.wildcards !== "disabled") {
600
- str = this.setupWildcardsRegExp(str);
601
- }
602
- str = this.escapeStr(str);
603
- if (Object.keys(this.opt.synonyms).length) {
604
- str = this.createSynonymsRegExp(str);
605
- }
606
- if (this.opt.ignoreJoiners || this.opt.ignorePunctuation.length) {
607
- str = this.setupIgnoreJoinersRegExp(str);
608
- }
609
- if (this.opt.diacritics) {
610
- str = this.createDiacriticsRegExp(str);
611
- }
612
- str = this.createMergedBlanksRegExp(str);
613
- if (this.opt.ignoreJoiners || this.opt.ignorePunctuation.length) {
614
- str = this.createJoinersRegExp(str);
615
- }
616
- if (this.opt.wildcards !== "disabled") {
617
- str = this.createWildcardsRegExp(str);
618
- }
619
- str = this.createAccuracyRegExp(str);
620
- return str;
621
- }
622
- /**
623
- * Creates a regular expression string to match the defined synonyms
624
- * @param {string} str - The search term to be used
625
- * @return {string}
626
- * @access protected
627
- */
628
- createSynonymsRegExp(str) {
629
- const syn = this.opt.synonyms, sens = this.opt.caseSensitive ? "" : "i", joinerPlaceholder = this.opt.ignoreJoiners || this.opt.ignorePunctuation.length ? "\0" : "";
630
- for (let index in syn) {
631
- if (syn.hasOwnProperty(index)) {
632
- const value = syn[index], k1 = this.opt.wildcards !== "disabled" ? this.setupWildcardsRegExp(index) : this.escapeStr(index), k2 = this.opt.wildcards !== "disabled" ? this.setupWildcardsRegExp(value) : this.escapeStr(value);
633
- if (k1 !== "" && k2 !== "") {
634
- str = str.replace(
635
- new RegExp(
636
- `(${this.escapeStr(k1)}|${this.escapeStr(k2)})`,
637
- `gm${sens}`
638
- ),
639
- joinerPlaceholder + `(${this.processSynomyms(k1)}|${this.processSynomyms(k2)})` + joinerPlaceholder
640
- );
641
- }
642
- }
643
- }
644
- return str;
645
- }
646
- /**
647
- * Setup synonyms to work with ignoreJoiners and or ignorePunctuation
648
- * @param {string} str - synonym key or value to process
649
- * @return {string} - processed synonym string
650
- */
651
- processSynomyms(str) {
652
- if (this.opt.ignoreJoiners || this.opt.ignorePunctuation.length) {
653
- str = this.setupIgnoreJoinersRegExp(str);
654
- }
655
- return str;
656
- }
657
- /**
658
- * Sets up the regular expression string to allow later insertion of
659
- * wildcard regular expression matches
660
- * @param {string} str - The search term to be used
661
- * @return {string}
662
- * @access protected
663
- */
664
- setupWildcardsRegExp(str) {
665
- str = str.replace(/(?:\\)*\?/g, (val) => {
666
- return val.charAt(0) === "\\" ? "?" : "";
667
- });
668
- return str.replace(/(?:\\)*\*/g, (val) => {
669
- return val.charAt(0) === "\\" ? "*" : "";
670
- });
671
- }
672
- /**
673
- * Sets up the regular expression string to allow later insertion of
674
- * wildcard regular expression matches
675
- * @param {string} str - The search term to be used
676
- * @return {string}
677
- * @access protected
678
- */
679
- createWildcardsRegExp(str) {
680
- let spaces = this.opt.wildcards === "withSpaces";
681
- return str.replace(/\u0001/g, spaces ? "[\\S\\s]?" : "\\S?").replace(/\u0002/g, spaces ? "[\\S\\s]*?" : "\\S*");
682
- }
683
- /**
684
- * Sets up the regular expression string to allow later insertion of
685
- * designated characters (soft hyphens & zero width characters)
686
- * @param {string} str - The search term to be used
687
- * @return {string}
688
- * @access protected
689
- */
690
- setupIgnoreJoinersRegExp(str) {
691
- return str.replace(/[^(|)\\]/g, (val, indx, original) => {
692
- let nextChar = original.charAt(indx + 1);
693
- if (/[(|)\\]/.test(nextChar) || nextChar === "") {
694
- return val;
695
- } else {
696
- return val + "\0";
697
- }
698
- });
699
- }
700
- /**
701
- * Creates a regular expression string to allow ignoring of designated
702
- * characters (soft hyphens, zero width characters & punctuation) based on
703
- * the specified option values of <code>ignorePunctuation</code> and
704
- * <code>ignoreJoiners</code>
705
- * @param {string} str - The search term to be used
706
- * @return {string}
707
- * @access protected
708
- */
709
- createJoinersRegExp(str) {
710
- let joiner = [];
711
- const ignorePunctuation = this.opt.ignorePunctuation;
712
- if (Array.isArray(ignorePunctuation) && ignorePunctuation.length) {
713
- joiner.push(this.escapeStr(ignorePunctuation.join("")));
714
- }
715
- if (this.opt.ignoreJoiners) {
716
- joiner.push("\\u00ad\\u200b\\u200c\\u200d");
717
- }
718
- return joiner.length ? str.split(/\u0000+/).join(`[${joiner.join("")}]*`) : str;
719
- }
720
- /**
721
- * Creates a regular expression string to match diacritics
722
- * @param {string} str - The search term to be used
723
- * @return {string}
724
- * @access protected
725
- */
726
- createDiacriticsRegExp(str) {
727
- const sens = this.opt.caseSensitive ? "" : "i", dct = this.opt.caseSensitive ? [
728
- "aàáảãạăằắẳẵặâầấẩẫậäåāą",
729
- "AÀÁẢÃẠĂẰẮẲẴẶÂẦẤẨẪẬÄÅĀĄ",
730
- "cçćč",
731
- "CÇĆČ",
732
- "dđď",
733
- "DĐĎ",
734
- "eèéẻẽẹêềếểễệëěēę",
735
- "EÈÉẺẼẸÊỀẾỂỄỆËĚĒĘ",
736
- "iìíỉĩịîïī",
737
- "IÌÍỈĨỊÎÏĪ",
738
- "lł",
739
- "LŁ",
740
- "nñňń",
741
- "NÑŇŃ",
742
- "oòóỏõọôồốổỗộơởỡớờợöøō",
743
- "OÒÓỎÕỌÔỒỐỔỖỘƠỞỠỚỜỢÖØŌ",
744
- "rř",
745
- "RŘ",
746
- "sšśșş",
747
- "SŠŚȘŞ",
748
- "tťțţ",
749
- "TŤȚŢ",
750
- "uùúủũụưừứửữựûüůū",
751
- "UÙÚỦŨỤƯỪỨỬỮỰÛÜŮŪ",
752
- "yýỳỷỹỵÿ",
753
- "YÝỲỶỸỴŸ",
754
- "zžżź",
755
- "ZŽŻŹ"
756
- ] : [
757
- "aàáảãạăằắẳẵặâầấẩẫậäåāąAÀÁẢÃẠĂẰẮẲẴẶÂẦẤẨẪẬÄÅĀĄ",
758
- "cçćčCÇĆČ",
759
- "dđďDĐĎ",
760
- "eèéẻẽẹêềếểễệëěēęEÈÉẺẼẸÊỀẾỂỄỆËĚĒĘ",
761
- "iìíỉĩịîïīIÌÍỈĨỊÎÏĪ",
762
- "lłLŁ",
763
- "nñňńNÑŇŃ",
764
- "oòóỏõọôồốổỗộơởỡớờợöøōOÒÓỎÕỌÔỒỐỔỖỘƠỞỠỚỜỢÖØŌ",
765
- "rřRŘ",
766
- "sšśșşSŠŚȘŞ",
767
- "tťțţTŤȚŢ",
768
- "uùúủũụưừứửữựûüůūUÙÚỦŨỤƯỪỨỬỮỰÛÜŮŪ",
769
- "yýỳỷỹỵÿYÝỲỶỸỴŸ",
770
- "zžżźZŽŻŹ"
771
- ];
772
- let handled = [];
773
- str.split("").forEach((ch) => {
774
- dct.every((dct2) => {
775
- if (dct2.indexOf(ch) !== -1) {
776
- if (handled.indexOf(dct2) > -1) {
777
- return false;
778
- }
779
- str = str.replace(
780
- new RegExp(`[${dct2}]`, `gm${sens}`),
781
- `[${dct2}]`
782
- );
783
- handled.push(dct2);
784
- }
785
- return true;
786
- });
787
- });
788
- return str;
789
- }
790
- /**
791
- * Creates a regular expression string that merges whitespace characters
792
- * including subsequent ones into a single pattern, one or multiple
793
- * whitespaces
794
- * @param {string} str - The search term to be used
795
- * @return {string}
796
- * @access protected
797
- */
798
- createMergedBlanksRegExp(str) {
799
- return str.replace(/[\s]+/gmi, "[\\s]+");
800
- }
801
- /**
802
- * Creates a regular expression string to match the specified string with
803
- * the defined accuracy. As in the regular expression of "exactly" can be
804
- * a group containing a blank at the beginning, all regular expressions will
805
- * be created with two groups. The first group can be ignored (may contain
806
- * the said blank), the second contains the actual match
807
- * @param {string} str - The searm term to be used
808
- * @return {str}
809
- * @access protected
810
- */
811
- createAccuracyRegExp(str) {
812
- const chars = "!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~¡¿";
813
- let acc = this.opt.accuracy, val = typeof acc === "string" ? acc : acc.value, ls = typeof acc === "string" ? [] : acc.limiters, lsJoin = "";
814
- ls.forEach((limiter) => {
815
- lsJoin += `|${this.escapeStr(limiter)}`;
816
- });
817
- switch (val) {
818
- case "partially":
819
- default:
820
- return `()(${str})`;
821
- case "complementary":
822
- lsJoin = "\\s" + (lsJoin ? lsJoin : this.escapeStr(chars));
823
- return `()([^${lsJoin}]*${str}[^${lsJoin}]*)`;
824
- case "exactly":
825
- return `(^|\\s${lsJoin})(${str})(?=$|\\s${lsJoin})`;
826
- }
827
- }
828
- /**
829
- * @typedef Mark~separatedKeywords
830
- * @type {object.<string>}
831
- * @property {array.<string>} keywords - The list of keywords
832
- * @property {number} length - The length
833
- */
834
- /**
835
- * Returns a list of keywords dependent on whether separate word search
836
- * was defined. Also it filters empty keywords
837
- * @param {array} sv - The array of keywords
838
- * @return {Mark~separatedKeywords}
839
- * @access protected
840
- */
841
- getSeparatedKeywords(sv) {
842
- let stack = [];
843
- sv.forEach((kw) => {
844
- if (!this.opt.separateWordSearch) {
845
- if (kw.trim() && stack.indexOf(kw) === -1) {
846
- stack.push(kw);
847
- }
848
- } else {
849
- kw.split(" ").forEach((kwSplitted) => {
850
- if (kwSplitted.trim() && stack.indexOf(kwSplitted) === -1) {
851
- stack.push(kwSplitted);
852
- }
853
- });
854
- }
855
- });
856
- return {
857
- // sort because of https://git.io/v6USg
858
- "keywords": stack.sort((a, b) => {
859
- return b.length - a.length;
860
- }),
861
- "length": stack.length
862
- };
863
- }
864
- /**
865
- * Check if a value is a number
866
- * @param {number|string} value - the value to check;
867
- * numeric strings allowed
868
- * @return {boolean}
869
- * @access protected
870
- */
871
- isNumeric(value) {
872
- return Number(parseFloat(value)) == value;
873
- }
874
- /**
875
- * @typedef Mark~rangeObject
876
- * @type {object}
877
- * @property {number} start - The start position within the composite value
878
- * @property {number} length - The length of the string to mark within the
879
- * composite value.
880
- */
881
- /**
882
- * @typedef Mark~setOfRanges
883
- * @type {object[]}
884
- * @property {Mark~rangeObject}
885
- */
886
- /**
887
- * Returns a processed list of integer offset indexes that do not overlap
888
- * each other, and remove any string values or additional elements
889
- * @param {Mark~setOfRanges} array - unprocessed raw array
890
- * @return {Mark~setOfRanges} - processed array with any invalid entries
891
- * removed
892
- * @throws Will throw an error if an array of objects is not passed
893
- * @access protected
894
- */
895
- checkRanges(array) {
896
- if (!Array.isArray(array) || Object.prototype.toString.call(array[0]) !== "[object Object]") {
897
- this.log("markRanges() will only accept an array of objects");
898
- this.opt.noMatch(array);
899
- return [];
900
- }
901
- const stack = [];
902
- let last = 0;
903
- array.sort((a, b) => {
904
- return a.start - b.start;
905
- }).forEach((item) => {
906
- let { start, end, valid } = this.callNoMatchOnInvalidRanges(item, last);
907
- if (valid) {
908
- item.start = start;
909
- item.length = end - start;
910
- stack.push(item);
911
- last = end;
912
- }
913
- });
914
- return stack;
915
- }
916
- /**
917
- * @typedef Mark~validObject
918
- * @type {object}
919
- * @property {number} start - The start position within the composite value
920
- * @property {number} end - The calculated end position within the composite
921
- * value.
922
- * @property {boolean} valid - boolean value indicating that the start and
923
- * calculated end range is valid
924
- */
925
- /**
926
- * Initial validation of ranges for markRanges. Preliminary checks are done
927
- * to ensure the start and length values exist and are not zero or non-
928
- * numeric
929
- * @param {Mark~rangeObject} range - the current range object
930
- * @param {number} last - last index of range
931
- * @return {Mark~validObject}
932
- * @access protected
933
- */
934
- callNoMatchOnInvalidRanges(range, last) {
935
- let start, end, valid = false;
936
- if (range && typeof range.start !== "undefined") {
937
- start = parseInt(range.start, 10);
938
- end = start + parseInt(range.length, 10);
939
- if (this.isNumeric(range.start) && this.isNumeric(range.length) && end - last > 0 && end - start > 0) {
940
- valid = true;
941
- } else {
942
- this.log(
943
- `Ignoring invalid or overlapping range: ${JSON.stringify(range)}`
944
- );
945
- this.opt.noMatch(range);
946
- }
947
- } else {
948
- this.log(`Ignoring invalid range: ${JSON.stringify(range)}`);
949
- this.opt.noMatch(range);
950
- }
951
- return {
952
- start,
953
- end,
954
- valid
955
- };
956
- }
957
- /**
958
- * Check valid range for markRanges. Check ranges with access to the context
959
- * string. Range values are double checked, lengths that extend the mark
960
- * beyond the string length are limitied and ranges containing only
961
- * whitespace are ignored
962
- * @param {Mark~rangeObject} range - the current range object
963
- * @param {number} originalLength - original length of the context string
964
- * @param {string} string - current content string
965
- * @return {Mark~validObject}
966
- * @access protected
967
- */
968
- checkWhitespaceRanges(range, originalLength, string) {
969
- let end, valid = true, max = string.length, offset = originalLength - max, start = parseInt(range.start, 10) - offset;
970
- start = start > max ? max : start;
971
- end = start + parseInt(range.length, 10);
972
- if (end > max) {
973
- end = max;
974
- this.log(`End range automatically set to the max value of ${max}`);
975
- }
976
- if (start < 0 || end - start < 0 || start > max || end > max) {
977
- valid = false;
978
- this.log(`Invalid range: ${JSON.stringify(range)}`);
979
- this.opt.noMatch(range);
980
- } else if (string.substring(start, end).replace(/\s+/g, "") === "") {
981
- valid = false;
982
- this.log("Skipping whitespace only range: " + JSON.stringify(range));
983
- this.opt.noMatch(range);
984
- }
985
- return {
986
- start,
987
- end,
988
- valid
989
- };
990
- }
991
- /**
992
- * @typedef Mark~getTextNodesDict
993
- * @type {object.<string>}
994
- * @property {string} value - The composite value of all text nodes
995
- * @property {object[]} nodes - An array of objects
996
- * @property {number} nodes.start - The start position within the composite
997
- * value
998
- * @property {number} nodes.end - The end position within the composite
999
- * value
1000
- * @property {HTMLElement} nodes.node - The DOM text node element
1001
- */
1002
- /**
1003
- * Callback
1004
- * @callback Mark~getTextNodesCallback
1005
- * @param {Mark~getTextNodesDict}
1006
- */
1007
- /**
1008
- * Calls the callback with an object containing all text nodes (including
1009
- * iframe text nodes) with start and end positions and the composite value
1010
- * of them (string)
1011
- * @param {Mark~getTextNodesCallback} cb - Callback
1012
- * @access protected
1013
- */
1014
- getTextNodes(cb) {
1015
- let val = "", nodes = [];
1016
- this.iterator.forEachNode(NodeFilter.SHOW_TEXT, (node) => {
1017
- nodes.push({
1018
- start: val.length,
1019
- end: (val += node.textContent).length,
1020
- node
1021
- });
1022
- }, (node) => {
1023
- if (this.matchesExclude(node.parentNode)) {
1024
- return NodeFilter.FILTER_REJECT;
1025
- } else {
1026
- return NodeFilter.FILTER_ACCEPT;
1027
- }
1028
- }, () => {
1029
- cb({
1030
- value: val,
1031
- nodes
1032
- });
1033
- });
1034
- }
1035
- /**
1036
- * Checks if an element matches any of the specified exclude selectors. Also
1037
- * it checks for elements in which no marks should be performed (e.g.
1038
- * script and style tags) and optionally already marked elements
1039
- * @param {HTMLElement} el - The element to check
1040
- * @return {boolean}
1041
- * @access protected
1042
- */
1043
- matchesExclude(el) {
1044
- return DOMIterator.matches(el, this.opt.exclude.concat([
1045
- // ignores the elements itself, not their childrens (selector *)
1046
- "script",
1047
- "style",
1048
- "title",
1049
- "head",
1050
- "html"
1051
- ]));
1052
- }
1053
- /**
1054
- * Wraps the instance element and class around matches that fit the start
1055
- * and end positions within the node
1056
- * @param {HTMLElement} node - The DOM text node
1057
- * @param {number} start - The position where to start wrapping
1058
- * @param {number} end - The position where to end wrapping
1059
- * @return {HTMLElement} Returns the splitted text node that will appear
1060
- * after the wrapped text node
1061
- * @access protected
1062
- */
1063
- wrapRangeInTextNode(node, start, end) {
1064
- const hEl = !this.opt.element ? "mark" : this.opt.element, startNode = node.splitText(start), ret = startNode.splitText(end - start);
1065
- let repl = document.createElement(hEl);
1066
- repl.setAttribute("data-markjs", "true");
1067
- if (this.opt.className) {
1068
- repl.setAttribute("class", this.opt.className);
1069
- }
1070
- repl.textContent = startNode.textContent;
1071
- startNode.parentNode.replaceChild(repl, startNode);
1072
- return ret;
1073
- }
1074
- /**
1075
- * @typedef Mark~wrapRangeInMappedTextNodeDict
1076
- * @type {object.<string>}
1077
- * @property {string} value - The composite value of all text nodes
1078
- * @property {object[]} nodes - An array of objects
1079
- * @property {number} nodes.start - The start position within the composite
1080
- * value
1081
- * @property {number} nodes.end - The end position within the composite
1082
- * value
1083
- * @property {HTMLElement} nodes.node - The DOM text node element
1084
- */
1085
- /**
1086
- * Each callback
1087
- * @callback Mark~wrapMatchesEachCallback
1088
- * @param {HTMLElement} node - The wrapped DOM element
1089
- * @param {number} lastIndex - The last matching position within the
1090
- * composite value of text nodes
1091
- */
1092
- /**
1093
- * Filter callback
1094
- * @callback Mark~wrapMatchesFilterCallback
1095
- * @param {HTMLElement} node - The matching text node DOM element
1096
- */
1097
- /**
1098
- * Determines matches by start and end positions using the text node
1099
- * dictionary even across text nodes and calls
1100
- * {@link Mark#wrapRangeInTextNode} to wrap them
1101
- * @param {Mark~wrapRangeInMappedTextNodeDict} dict - The dictionary
1102
- * @param {number} start - The start position of the match
1103
- * @param {number} end - The end position of the match
1104
- * @param {Mark~wrapMatchesFilterCallback} filterCb - Filter callback
1105
- * @param {Mark~wrapMatchesEachCallback} eachCb - Each callback
1106
- * @access protected
1107
- */
1108
- wrapRangeInMappedTextNode(dict, start, end, filterCb, eachCb) {
1109
- dict.nodes.every((n, i) => {
1110
- const sibl = dict.nodes[i + 1];
1111
- if (typeof sibl === "undefined" || sibl.start > start) {
1112
- if (!filterCb(n.node)) {
1113
- return false;
1114
- }
1115
- const s = start - n.start, e = (end > n.end ? n.end : end) - n.start, startStr = dict.value.substr(0, n.start), endStr = dict.value.substr(e + n.start);
1116
- n.node = this.wrapRangeInTextNode(n.node, s, e);
1117
- dict.value = startStr + endStr;
1118
- dict.nodes.forEach((k, j) => {
1119
- if (j >= i) {
1120
- if (dict.nodes[j].start > 0 && j !== i) {
1121
- dict.nodes[j].start -= e;
1122
- }
1123
- dict.nodes[j].end -= e;
1124
- }
1125
- });
1126
- end -= e;
1127
- eachCb(n.node.previousSibling, n.start);
1128
- if (end > n.end) {
1129
- start = n.end;
1130
- } else {
1131
- return false;
1132
- }
1133
- }
1134
- return true;
1135
- });
1136
- }
1137
- /**
1138
- * Filter callback before each wrapping
1139
- * @callback Mark~wrapMatchesFilterCallback
1140
- * @param {string} match - The matching string
1141
- * @param {HTMLElement} node - The text node where the match occurs
1142
- */
1143
- /**
1144
- * Callback for each wrapped element
1145
- * @callback Mark~wrapMatchesEachCallback
1146
- * @param {HTMLElement} element - The marked DOM element
1147
- */
1148
- /**
1149
- * Callback on end
1150
- * @callback Mark~wrapMatchesEndCallback
1151
- */
1152
- /**
1153
- * Wraps the instance element and class around matches within single HTML
1154
- * elements in all contexts
1155
- * @param {RegExp} regex - The regular expression to be searched for
1156
- * @param {number} ignoreGroups - A number indicating the amount of RegExp
1157
- * matching groups to ignore
1158
- * @param {Mark~wrapMatchesFilterCallback} filterCb
1159
- * @param {Mark~wrapMatchesEachCallback} eachCb
1160
- * @param {Mark~wrapMatchesEndCallback} endCb
1161
- * @access protected
1162
- */
1163
- wrapMatches(regex, ignoreGroups, filterCb, eachCb, endCb) {
1164
- const matchIdx = ignoreGroups === 0 ? 0 : ignoreGroups + 1;
1165
- this.getTextNodes((dict) => {
1166
- dict.nodes.forEach((node) => {
1167
- node = node.node;
1168
- let match;
1169
- while ((match = regex.exec(node.textContent)) !== null && match[matchIdx] !== "") {
1170
- if (!filterCb(match[matchIdx], node)) {
1171
- continue;
1172
- }
1173
- let pos = match.index;
1174
- if (matchIdx !== 0) {
1175
- for (let i = 1; i < matchIdx; i++) {
1176
- pos += match[i].length;
1177
- }
1178
- }
1179
- node = this.wrapRangeInTextNode(
1180
- node,
1181
- pos,
1182
- pos + match[matchIdx].length
1183
- );
1184
- eachCb(node.previousSibling);
1185
- regex.lastIndex = 0;
1186
- }
1187
- });
1188
- endCb();
1189
- });
1190
- }
1191
- /**
1192
- * Callback for each wrapped element
1193
- * @callback Mark~wrapMatchesAcrossElementsEachCallback
1194
- * @param {HTMLElement} element - The marked DOM element
1195
- */
1196
- /**
1197
- * Filter callback before each wrapping
1198
- * @callback Mark~wrapMatchesAcrossElementsFilterCallback
1199
- * @param {string} match - The matching string
1200
- * @param {HTMLElement} node - The text node where the match occurs
1201
- */
1202
- /**
1203
- * Callback on end
1204
- * @callback Mark~wrapMatchesAcrossElementsEndCallback
1205
- */
1206
- /**
1207
- * Wraps the instance element and class around matches across all HTML
1208
- * elements in all contexts
1209
- * @param {RegExp} regex - The regular expression to be searched for
1210
- * @param {number} ignoreGroups - A number indicating the amount of RegExp
1211
- * matching groups to ignore
1212
- * @param {Mark~wrapMatchesAcrossElementsFilterCallback} filterCb
1213
- * @param {Mark~wrapMatchesAcrossElementsEachCallback} eachCb
1214
- * @param {Mark~wrapMatchesAcrossElementsEndCallback} endCb
1215
- * @access protected
1216
- */
1217
- wrapMatchesAcrossElements(regex, ignoreGroups, filterCb, eachCb, endCb) {
1218
- const matchIdx = ignoreGroups === 0 ? 0 : ignoreGroups + 1;
1219
- this.getTextNodes((dict) => {
1220
- let match;
1221
- while ((match = regex.exec(dict.value)) !== null && match[matchIdx] !== "") {
1222
- let start = match.index;
1223
- if (matchIdx !== 0) {
1224
- for (let i = 1; i < matchIdx; i++) {
1225
- start += match[i].length;
1226
- }
1227
- }
1228
- const end = start + match[matchIdx].length;
1229
- this.wrapRangeInMappedTextNode(dict, start, end, (node) => {
1230
- return filterCb(match[matchIdx], node);
1231
- }, (node, lastIndex) => {
1232
- regex.lastIndex = lastIndex;
1233
- eachCb(node);
1234
- });
1235
- }
1236
- endCb();
1237
- });
1238
- }
1239
- /**
1240
- * Callback for each wrapped element
1241
- * @callback Mark~wrapRangeFromIndexEachCallback
1242
- * @param {HTMLElement} element - The marked DOM element
1243
- * @param {Mark~rangeObject} range - the current range object; provided
1244
- * start and length values will be numeric integers modified from the
1245
- * provided original ranges.
1246
- */
1247
- /**
1248
- * Filter callback before each wrapping
1249
- * @callback Mark~wrapRangeFromIndexFilterCallback
1250
- * @param {HTMLElement} node - The text node which includes the range
1251
- * @param {Mark~rangeObject} range - the current range object
1252
- * @param {string} match - string extracted from the matching range
1253
- * @param {number} counter - A counter indicating the number of all marks
1254
- */
1255
- /**
1256
- * Callback on end
1257
- * @callback Mark~wrapRangeFromIndexEndCallback
1258
- */
1259
- /**
1260
- * Wraps the indicated ranges across all HTML elements in all contexts
1261
- * @param {Mark~setOfRanges} ranges
1262
- * @param {Mark~wrapRangeFromIndexFilterCallback} filterCb
1263
- * @param {Mark~wrapRangeFromIndexEachCallback} eachCb
1264
- * @param {Mark~wrapRangeFromIndexEndCallback} endCb
1265
- * @access protected
1266
- */
1267
- wrapRangeFromIndex(ranges, filterCb, eachCb, endCb) {
1268
- this.getTextNodes((dict) => {
1269
- const originalLength = dict.value.length;
1270
- ranges.forEach((range, counter) => {
1271
- let { start, end, valid } = this.checkWhitespaceRanges(
1272
- range,
1273
- originalLength,
1274
- dict.value
1275
- );
1276
- if (valid) {
1277
- this.wrapRangeInMappedTextNode(dict, start, end, (node) => {
1278
- return filterCb(
1279
- node,
1280
- range,
1281
- dict.value.substring(start, end),
1282
- counter
1283
- );
1284
- }, (node) => {
1285
- eachCb(node, range);
1286
- });
1287
- }
1288
- });
1289
- endCb();
1290
- });
1291
- }
1292
- /**
1293
- * Unwraps the specified DOM node with its content (text nodes or HTML)
1294
- * without destroying possibly present events (using innerHTML) and
1295
- * normalizes the parent at the end (merge splitted text nodes)
1296
- * @param {HTMLElement} node - The DOM node to unwrap
1297
- * @access protected
1298
- */
1299
- unwrapMatches(node) {
1300
- const parent = node.parentNode;
1301
- let docFrag = document.createDocumentFragment();
1302
- while (node.firstChild) {
1303
- docFrag.appendChild(node.removeChild(node.firstChild));
1304
- }
1305
- parent.replaceChild(docFrag, node);
1306
- if (!this.ie) {
1307
- parent.normalize();
1308
- } else {
1309
- this.normalizeTextNode(parent);
1310
- }
1311
- }
1312
- /**
1313
- * Normalizes text nodes. It's a workaround for the native normalize method
1314
- * that has a bug in IE (see attached link). Should only be used in IE
1315
- * browsers as it's slower than the native method.
1316
- * @see {@link http://tinyurl.com/z5asa8c}
1317
- * @param {HTMLElement} node - The DOM node to normalize
1318
- * @access protected
1319
- */
1320
- normalizeTextNode(node) {
1321
- if (!node) {
1322
- return;
1323
- }
1324
- if (node.nodeType === 3) {
1325
- while (node.nextSibling && node.nextSibling.nodeType === 3) {
1326
- node.nodeValue += node.nextSibling.nodeValue;
1327
- node.parentNode.removeChild(node.nextSibling);
1328
- }
1329
- } else {
1330
- this.normalizeTextNode(node.firstChild);
1331
- }
1332
- this.normalizeTextNode(node.nextSibling);
1333
- }
1334
- /**
1335
- * Callback when finished
1336
- * @callback Mark~commonDoneCallback
1337
- * @param {number} totalMatches - The number of marked elements
1338
- */
1339
- /**
1340
- * @typedef Mark~commonOptions
1341
- * @type {object.<string>}
1342
- * @property {string} [element="mark"] - HTML element tag name
1343
- * @property {string} [className] - An optional class name
1344
- * @property {string[]} [exclude] - An array with exclusion selectors.
1345
- * Elements matching those selectors will be ignored
1346
- * @property {boolean} [iframes=false] - Whether to search inside iframes
1347
- * @property {Mark~commonDoneCallback} [done]
1348
- * @property {boolean} [debug=false] - Wheter to log messages
1349
- * @property {object} [log=window.console] - Where to log messages (only if
1350
- * debug is true)
1351
- */
1352
- /**
1353
- * Callback for each marked element
1354
- * @callback Mark~markRegExpEachCallback
1355
- * @param {HTMLElement} element - The marked DOM element
1356
- */
1357
- /**
1358
- * Callback if there were no matches
1359
- * @callback Mark~markRegExpNoMatchCallback
1360
- * @param {RegExp} regexp - The regular expression
1361
- */
1362
- /**
1363
- * Callback to filter matches
1364
- * @callback Mark~markRegExpFilterCallback
1365
- * @param {HTMLElement} textNode - The text node which includes the match
1366
- * @param {string} match - The matching string for the RegExp
1367
- * @param {number} counter - A counter indicating the number of all marks
1368
- */
1369
- /**
1370
- * These options also include the common options from
1371
- * {@link Mark~commonOptions}
1372
- * @typedef Mark~markRegExpOptions
1373
- * @type {object.<string>}
1374
- * @property {Mark~markRegExpEachCallback} [each]
1375
- * @property {Mark~markRegExpNoMatchCallback} [noMatch]
1376
- * @property {Mark~markRegExpFilterCallback} [filter]
1377
- */
1378
- /**
1379
- * Marks a custom regular expression
1380
- * @param {RegExp} regexp - The regular expression
1381
- * @param {Mark~markRegExpOptions} [opt] - Optional options object
1382
- * @access public
1383
- */
1384
- markRegExp(regexp, opt) {
1385
- this.opt = opt;
1386
- this.log(`Searching with expression "${regexp}"`);
1387
- let totalMatches = 0, fn = "wrapMatches";
1388
- const eachCb = (element) => {
1389
- totalMatches++;
1390
- this.opt.each(element);
1391
- };
1392
- if (this.opt.acrossElements) {
1393
- fn = "wrapMatchesAcrossElements";
1394
- }
1395
- this[fn](regexp, this.opt.ignoreGroups, (match, node) => {
1396
- return this.opt.filter(node, match, totalMatches);
1397
- }, eachCb, () => {
1398
- if (totalMatches === 0) {
1399
- this.opt.noMatch(regexp);
1400
- }
1401
- this.opt.done(totalMatches);
1402
- });
1403
- }
1404
- /**
1405
- * Callback for each marked element
1406
- * @callback Mark~markEachCallback
1407
- * @param {HTMLElement} element - The marked DOM element
1408
- */
1409
- /**
1410
- * Callback if there were no matches
1411
- * @callback Mark~markNoMatchCallback
1412
- * @param {RegExp} term - The search term that was not found
1413
- */
1414
- /**
1415
- * Callback to filter matches
1416
- * @callback Mark~markFilterCallback
1417
- * @param {HTMLElement} textNode - The text node which includes the match
1418
- * @param {string} match - The matching term
1419
- * @param {number} totalCounter - A counter indicating the number of all
1420
- * marks
1421
- * @param {number} termCounter - A counter indicating the number of marks
1422
- * for the specific match
1423
- */
1424
- /**
1425
- * @typedef Mark~markAccuracyObject
1426
- * @type {object.<string>}
1427
- * @property {string} value - A accuracy string value
1428
- * @property {string[]} limiters - A custom array of limiters. For example
1429
- * <code>["-", ","]</code>
1430
- */
1431
- /**
1432
- * @typedef Mark~markAccuracySetting
1433
- * @type {string}
1434
- * @property {"partially"|"complementary"|"exactly"|Mark~markAccuracyObject}
1435
- * [accuracy="partially"] - Either one of the following string values:
1436
- * <ul>
1437
- * <li><i>partially</i>: When searching for "lor" only "lor" inside
1438
- * "lorem" will be marked</li>
1439
- * <li><i>complementary</i>: When searching for "lor" the whole word
1440
- * "lorem" will be marked</li>
1441
- * <li><i>exactly</i>: When searching for "lor" only those exact words
1442
- * will be marked. In this example nothing inside "lorem". This value
1443
- * is equivalent to the previous option <i>wordBoundary</i></li>
1444
- * </ul>
1445
- * Or an object containing two properties:
1446
- * <ul>
1447
- * <li><i>value</i>: One of the above named string values</li>
1448
- * <li><i>limiters</i>: A custom array of string limiters for accuracy
1449
- * "exactly" or "complementary"</li>
1450
- * </ul>
1451
- */
1452
- /**
1453
- * @typedef Mark~markWildcardsSetting
1454
- * @type {string}
1455
- * @property {"disabled"|"enabled"|"withSpaces"}
1456
- * [wildcards="disabled"] - Set to any of the following string values:
1457
- * <ul>
1458
- * <li><i>disabled</i>: Disable wildcard usage</li>
1459
- * <li><i>enabled</i>: When searching for "lor?m", the "?" will match zero
1460
- * or one non-space character (e.g. "lorm", "loram", "lor3m", etc). When
1461
- * searching for "lor*m", the "*" will match zero or more non-space
1462
- * characters (e.g. "lorm", "loram", "lor123m", etc).</li>
1463
- * <li><i>withSpaces</i>: When searching for "lor?m", the "?" will
1464
- * match zero or one space or non-space character (e.g. "lor m", "loram",
1465
- * etc). When searching for "lor*m", the "*" will match zero or more space
1466
- * or non-space characters (e.g. "lorm", "lore et dolor ipsum", "lor: m",
1467
- * etc).</li>
1468
- * </ul>
1469
- */
1470
- /**
1471
- * @typedef Mark~markIgnorePunctuationSetting
1472
- * @type {string[]}
1473
- * @property {string} The strings in this setting will contain punctuation
1474
- * marks that will be ignored:
1475
- * <ul>
1476
- * <li>These punctuation marks can be between any characters, e.g. setting
1477
- * this option to <code>["'"]</code> would match "Worlds", "World's" and
1478
- * "Wo'rlds"</li>
1479
- * <li>One or more apostrophes between the letters would still produce a
1480
- * match (e.g. "W'o''r'l'd's").</li>
1481
- * <li>A typical setting for this option could be as follows:
1482
- * <pre>ignorePunctuation: ":;.,-–—‒_(){}[]!'\"+=".split(""),</pre> This
1483
- * setting includes common punctuation as well as a minus, en-dash,
1484
- * em-dash and figure-dash
1485
- * ({@link https://en.wikipedia.org/wiki/Dash#Figure_dash ref}), as well
1486
- * as an underscore.</li>
1487
- * </ul>
1488
- */
1489
- /**
1490
- * These options also include the common options from
1491
- * {@link Mark~commonOptions}
1492
- * @typedef Mark~markOptions
1493
- * @type {object.<string>}
1494
- * @property {boolean} [separateWordSearch=true] - Whether to search for
1495
- * each word separated by a blank instead of the complete term
1496
- * @property {boolean} [diacritics=true] - If diacritic characters should be
1497
- * matched. ({@link https://en.wikipedia.org/wiki/Diacritic Diacritics})
1498
- * @property {object} [synonyms] - An object with synonyms. The key will be
1499
- * a synonym for the value and the value for the key
1500
- * @property {Mark~markAccuracySetting} [accuracy]
1501
- * @property {Mark~markWildcardsSetting} [wildcards]
1502
- * @property {boolean} [acrossElements=false] - Whether to find matches
1503
- * across HTML elements. By default, only matches within single HTML
1504
- * elements will be found
1505
- * @property {boolean} [ignoreJoiners=false] - Whether to ignore word
1506
- * joiners inside of key words. These include soft-hyphens, zero-width
1507
- * space, zero-width non-joiners and zero-width joiners.
1508
- * @property {Mark~markIgnorePunctuationSetting} [ignorePunctuation]
1509
- * @property {Mark~markEachCallback} [each]
1510
- * @property {Mark~markNoMatchCallback} [noMatch]
1511
- * @property {Mark~markFilterCallback} [filter]
1512
- */
1513
- /**
1514
- * Marks the specified search terms
1515
- * @param {string|string[]} [sv] - Search value, either a search string or
1516
- * an array containing multiple search strings
1517
- * @param {Mark~markOptions} [opt] - Optional options object
1518
- * @access public
1519
- */
1520
- mark(sv, opt) {
1521
- this.opt = opt;
1522
- let totalMatches = 0, fn = "wrapMatches";
1523
- const {
1524
- keywords: kwArr,
1525
- length: kwArrLen
1526
- } = this.getSeparatedKeywords(typeof sv === "string" ? [sv] : sv), sens = this.opt.caseSensitive ? "" : "i", handler = (kw) => {
1527
- let regex = new RegExp(this.createRegExp(kw), `gm${sens}`), matches = 0;
1528
- this.log(`Searching with expression "${regex}"`);
1529
- this[fn](regex, 1, (term, node) => {
1530
- return this.opt.filter(node, kw, totalMatches, matches);
1531
- }, (element) => {
1532
- matches++;
1533
- totalMatches++;
1534
- this.opt.each(element);
1535
- }, () => {
1536
- if (matches === 0) {
1537
- this.opt.noMatch(kw);
1538
- }
1539
- if (kwArr[kwArrLen - 1] === kw) {
1540
- this.opt.done(totalMatches);
1541
- } else {
1542
- handler(kwArr[kwArr.indexOf(kw) + 1]);
1543
- }
1544
- });
1545
- };
1546
- if (this.opt.acrossElements) {
1547
- fn = "wrapMatchesAcrossElements";
1548
- }
1549
- if (kwArrLen === 0) {
1550
- this.opt.done(totalMatches);
1551
- } else {
1552
- handler(kwArr[0]);
1553
- }
1554
- }
1555
- /**
1556
- * Callback for each marked element
1557
- * @callback Mark~markRangesEachCallback
1558
- * @param {HTMLElement} element - The marked DOM element
1559
- * @param {array} range - array of range start and end points
1560
- */
1561
- /**
1562
- * Callback if a processed range is invalid, out-of-bounds, overlaps another
1563
- * range, or only matches whitespace
1564
- * @callback Mark~markRangesNoMatchCallback
1565
- * @param {Mark~rangeObject} range - a range object
1566
- */
1567
- /**
1568
- * Callback to filter matches
1569
- * @callback Mark~markRangesFilterCallback
1570
- * @param {HTMLElement} node - The text node which includes the range
1571
- * @param {array} range - array of range start and end points
1572
- * @param {string} match - string extracted from the matching range
1573
- * @param {number} counter - A counter indicating the number of all marks
1574
- */
1575
- /**
1576
- * These options also include the common options from
1577
- * {@link Mark~commonOptions}
1578
- * @typedef Mark~markRangesOptions
1579
- * @type {object.<string>}
1580
- * @property {Mark~markRangesEachCallback} [each]
1581
- * @property {Mark~markRangesNoMatchCallback} [noMatch]
1582
- * @property {Mark~markRangesFilterCallback} [filter]
1583
- */
1584
- /**
1585
- * Marks an array of objects containing a start with an end or length of the
1586
- * string to mark
1587
- * @param {Mark~setOfRanges} rawRanges - The original (preprocessed)
1588
- * array of objects
1589
- * @param {Mark~markRangesOptions} [opt] - Optional options object
1590
- * @access public
1591
- */
1592
- markRanges(rawRanges, opt) {
1593
- this.opt = opt;
1594
- let totalMatches = 0, ranges = this.checkRanges(rawRanges);
1595
- if (ranges && ranges.length) {
1596
- this.log(
1597
- "Starting to mark with the following ranges: " + JSON.stringify(ranges)
1598
- );
1599
- this.wrapRangeFromIndex(
1600
- ranges,
1601
- (node, range, match, counter) => {
1602
- return this.opt.filter(node, range, match, counter);
1603
- },
1604
- (element, range) => {
1605
- totalMatches++;
1606
- this.opt.each(element, range);
1607
- },
1608
- () => {
1609
- this.opt.done(totalMatches);
1610
- }
1611
- );
1612
- } else {
1613
- this.opt.done(totalMatches);
1614
- }
1615
- }
1616
- /**
1617
- * Removes all marked elements inside the context with their HTML and
1618
- * normalizes the parent at the end
1619
- * @param {Mark~commonOptions} [opt] - Optional options object
1620
- * @access public
1621
- */
1622
- unmark(opt) {
1623
- this.opt = opt;
1624
- let sel = this.opt.element ? this.opt.element : "*";
1625
- sel += "[data-markjs]";
1626
- if (this.opt.className) {
1627
- sel += `.${this.opt.className}`;
1628
- }
1629
- this.log(`Removal selector "${sel}"`);
1630
- this.iterator.forEachNode(NodeFilter.SHOW_ELEMENT, (node) => {
1631
- this.unwrapMatches(node);
1632
- }, (node) => {
1633
- const matchesSel = DOMIterator.matches(node, sel), matchesExclude = this.matchesExclude(node);
1634
- if (!matchesSel || matchesExclude) {
1635
- return NodeFilter.FILTER_REJECT;
1636
- } else {
1637
- return NodeFilter.FILTER_ACCEPT;
1638
- }
1639
- }, this.opt.done);
1640
- }
1641
- };
1642
-
1643
- // node_modules/mark.js/src/vanilla.js
1644
- function Mark2(ctx) {
1645
- const instance = new Mark(ctx);
1646
- this.mark = (sv, opt) => {
1647
- instance.mark(sv, opt);
1648
- return this;
1649
- };
1650
- this.markRegExp = (sv, opt) => {
1651
- instance.markRegExp(sv, opt);
1652
- return this;
1653
- };
1654
- this.markRanges = (sv, opt) => {
1655
- instance.markRanges(sv, opt);
1656
- return this;
1657
- };
1658
- this.unmark = (opt) => {
1659
- instance.unmark(opt);
1660
- return this;
1661
- };
1662
- return this;
1663
- }
1664
- export {
1665
- Mark2 as default
1666
- };
1667
- //# sourceMappingURL=vitepress___mark__js_src_vanilla__js.js.map