@fewangsit/wangsvue 1.5.219-alpha.2 → 1.5.219-alpha.3

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 (1051) hide show
  1. package/changelog/index.d.ts +164 -0
  2. package/changelogpage/index.d.ts +184 -0
  3. package/comment/index.d.ts +187 -0
  4. package/components.d.ts +21 -0
  5. package/detailmember/index.d.ts +77 -0
  6. package/detailsprint/index.d.ts +86 -0
  7. package/inputinitialname/index.d.ts +118 -0
  8. package/inputrepositoryname/index.d.ts +86 -0
  9. package/loading-page-BrQattYE.js +1 -0
  10. package/loading-page-CgfbWppy.js +1 -0
  11. package/loading-page-CoC9UhfC.js +4 -0
  12. package/loading-page-CoXtqoc9.js +4 -0
  13. package/loading-page-DbLuqCHa.js +1 -0
  14. package/loading-page-f8D03l3G.js +4 -0
  15. package/loading-plane-CgfbWppy.js +1 -0
  16. package/loading-plane-CoXtqoc9.js +4 -0
  17. package/loading-table-Bdr9ZhtP.js +1 -0
  18. package/loading-table-ByUoWqUo.js +4 -0
  19. package/loading-table-BygEMzFM.js +4 -0
  20. package/loading-table-BzrSQlA0.js +1 -0
  21. package/loading-table-D9bw9OcI.js +4 -0
  22. package/loading-table-chOgXi94.js +1 -0
  23. package/no-data-CTKux8RI.js +4 -0
  24. package/no-data-Cgze_Rvp.js +1 -0
  25. package/no-data-DLHO1L_u.js +4 -0
  26. package/no-data-Dep79CBh.js +1 -0
  27. package/no-data-g0dJCy2p.js +4 -0
  28. package/no-data-y1X5WtcQ.js +1 -0
  29. package/notificationitem/index.d.ts +107 -0
  30. package/package.json +1 -1
  31. package/stats.html +1 -1
  32. package/style.css +2 -2
  33. package/summaryaccordion/index.d.ts +121 -0
  34. package/taskdetail/index.d.ts +82 -0
  35. package/taskdetailpbi/index.d.ts +35 -0
  36. package/tasktable/index.d.ts +87 -0
  37. package/wangsvue.es.js +66312 -170
  38. package/wangsvue.system.js +234 -67600
  39. package/animation/index.es.js +0 -69
  40. package/assets/lottiejs/loading-page.es.js +0 -20
  41. package/assets/lottiejs/loading-plane.es.js +0 -4
  42. package/assets/lottiejs/loading-table.es.js +0 -20
  43. package/assets/lottiejs/no-data.es.js +0 -20
  44. package/backgroundimagecropper/index.es.js +0 -76
  45. package/badge/index.es.js +0 -121
  46. package/badgegroup/index.es.js +0 -80
  47. package/basecalendar/index.es.js +0 -1399
  48. package/basetree/index.es.js +0 -269
  49. package/breadcrumb/index.es.js +0 -54
  50. package/button/index.es.js +0 -126
  51. package/buttonbulkaction/index.es.js +0 -237
  52. package/buttoncopy/index.es.js +0 -34
  53. package/buttondownload/index.es.js +0 -162
  54. package/buttonfilter/index.es.js +0 -37
  55. package/buttonradio/index.es.js +0 -117
  56. package/buttonsearch/index.es.js +0 -86
  57. package/buttonselecttree/index.es.js +0 -281
  58. package/buttontoggle/index.es.js +0 -13
  59. package/calendar/index.es.js +0 -172
  60. package/card/index.es.js +0 -49
  61. package/checkbox/index.es.js +0 -166
  62. package/codesnippet/index.es.js +0 -138
  63. package/codesnippetadapter/index.es.js +0 -30
  64. package/columnlist/index.es.js +0 -282
  65. package/config/defaultProps.es.js +0 -24
  66. package/config/index.es.js +0 -13
  67. package/config/locale.es.js +0 -41
  68. package/customcolumn/index.es.js +0 -155
  69. package/datatable/index.es.js +0 -1328
  70. package/dialog/index.es.js +0 -121
  71. package/dialogconfirm/index.es.js +0 -155
  72. package/dialogform/index.es.js +0 -260
  73. package/dialogselecttree/index.es.js +0 -317
  74. package/directives/focus.es.js +0 -18
  75. package/directives/index.es.js +0 -2
  76. package/directives/tooltip.es.js +0 -1
  77. package/dropdown/index.es.js +0 -297
  78. package/editor/index.es.js +0 -1160
  79. package/editorbutton/index.es.js +0 -30
  80. package/event-bus/index.es.js +0 -5
  81. package/event-bus/mitt.es.js +0 -70
  82. package/fieldwrapper/index.es.js +0 -45
  83. package/fileupload/index.es.js +0 -266
  84. package/filtercontainer/index.es.js +0 -347
  85. package/form/index.es.js +0 -238
  86. package/gallerypreview/index.es.js +0 -157
  87. package/icon/index.es.js +0 -84
  88. package/image/index.es.js +0 -224
  89. package/imagecompressor/index.es.js +0 -701
  90. package/imageinputinfo/index.es.js +0 -50
  91. package/inlinemessage/index.es.js +0 -106
  92. package/inputbadge/index.es.js +0 -261
  93. package/inputcurrency/index.es.js +0 -186
  94. package/inputemail/index.es.js +0 -51
  95. package/inputgroup/index.es.js +0 -34
  96. package/inputnumber/index.es.js +0 -310
  97. package/inputpassword/index.es.js +0 -147
  98. package/inputphonenumber/index.es.js +0 -1060
  99. package/inputrangenumber/index.es.js +0 -165
  100. package/inputtext/index.es.js +0 -317
  101. package/inputurl/index.es.js +0 -63
  102. package/invisiblefield/index.es.js +0 -35
  103. package/litedropdown/index.es.js +0 -108
  104. package/loading/index.es.js +0 -26
  105. package/loading-page-BXZ4fLOS.js +0 -8
  106. package/loading-page-BuLpsb_1.js +0 -8
  107. package/loading-page-CNqVBg__.js +0 -4
  108. package/loading-page-DbhhZih2.js +0 -4
  109. package/loading-page-DjfWXoOy.js +0 -8
  110. package/loading-page-S-KRY5zm.js +0 -4
  111. package/loading-plane-C1mi7Whv.js +0 -4
  112. package/loading-plane-CWq1hz_l.js +0 -8
  113. package/loading-table-B7LAXzAp.js +0 -4
  114. package/loading-table-BLmgKUsR.js +0 -4
  115. package/loading-table-CG7-cuhv.js +0 -8
  116. package/loading-table-CUPS49ta.js +0 -4
  117. package/loading-table-CuWWrTbv.js +0 -8
  118. package/loading-table-DbBzVwaZ.js +0 -8
  119. package/mentionlist/index.es.js +0 -91
  120. package/mentionsection/index.es.js +0 -62
  121. package/menu/index.es.js +0 -87
  122. package/menuitem/index.es.js +0 -67
  123. package/multirow/index.es.js +0 -53
  124. package/multiselect/index.es.js +0 -221
  125. package/no-data-B781skt3.js +0 -4
  126. package/no-data-CAksOnDl.js +0 -4
  127. package/no-data-DCsjBXQR.js +0 -4
  128. package/no-data-Dz0QOe7Q.js +0 -8
  129. package/no-data-_Huxiv9q.js +0 -8
  130. package/no-data-ybRQontJ.js +0 -8
  131. package/overlaypanel/index.es.js +0 -62
  132. package/paginator/index.es.js +0 -53
  133. package/plugins/WangsVue.es.js +0 -363
  134. package/plugins/formValidation.es.js +0 -19
  135. package/progressbar/index.es.js +0 -50
  136. package/quickfilter/index.es.js +0 -153
  137. package/tabmenu/index.es.js +0 -31
  138. package/textarea/index.es.js +0 -130
  139. package/timeline/index.es.js +0 -149
  140. package/timelinecontentbytype/index.es.js +0 -133
  141. package/toast/index.es.js +0 -87
  142. package/toggleswitch/index.es.js +0 -107
  143. package/tree/index.es.js +0 -379
  144. package/treenode/index.es.js +0 -631
  145. package/treesearchinput/index.es.js +0 -62
  146. package/usergroup/index.es.js +0 -101
  147. package/username/index.es.js +0 -160
  148. package/utils/addAttachment.util.es.js +0 -50
  149. package/utils/baseToast.util.es.js +0 -52
  150. package/utils/convertJsonImage.util.es.js +0 -28
  151. package/utils/date.util.es.js +0 -253
  152. package/utils/exportToExcel.util.es.js +0 -89
  153. package/utils/filterOptions.util.es.js +0 -10
  154. package/utils/genPlaceholder.util.es.js +0 -51
  155. package/utils/getProjectPermission.util.es.js +0 -20
  156. package/utils/getSalesRole.util.es.js +0 -7
  157. package/utils/getUser.util.es.js +0 -4
  158. package/utils/getUserType.util.es.js +0 -18
  159. package/utils/index.es.js +0 -3
  160. package/utils/isIntersect.es.js +0 -6
  161. package/utils/mergePropsWithDefaults.util.es.js +0 -10
  162. package/utils/object.util.es.js +0 -95
  163. package/utils/queryParamsStringfy.util.es.js +0 -23
  164. package/utils/role.util.es.js +0 -8
  165. package/utils/statusSeverity.util.es.js +0 -36
  166. package/utils/textFormatter.util.es.js +0 -32
  167. package/utils/toast.util.es.js +0 -20
  168. package/utils/xlsx.util.es.js +0 -15
  169. package/validatormessage/index.es.js +0 -19
  170. package/vendor/@popperjs/core/lib/createPopper.es.js +0 -149
  171. package/vendor/@popperjs/core/lib/dom-utils/contains.es.js +0 -19
  172. package/vendor/@popperjs/core/lib/dom-utils/getBoundingClientRect.es.js +0 -38
  173. package/vendor/@popperjs/core/lib/dom-utils/getClippingRect.es.js +0 -61
  174. package/vendor/@popperjs/core/lib/dom-utils/getCompositeRect.es.js +0 -53
  175. package/vendor/@popperjs/core/lib/dom-utils/getComputedStyle.es.js +0 -7
  176. package/vendor/@popperjs/core/lib/dom-utils/getDocumentElement.es.js +0 -10
  177. package/vendor/@popperjs/core/lib/dom-utils/getDocumentRect.es.js +0 -27
  178. package/vendor/@popperjs/core/lib/dom-utils/getHTMLElementScroll.es.js +0 -9
  179. package/vendor/@popperjs/core/lib/dom-utils/getLayoutRect.es.js +0 -21
  180. package/vendor/@popperjs/core/lib/dom-utils/getNodeName.es.js +0 -6
  181. package/vendor/@popperjs/core/lib/dom-utils/getNodeScroll.es.js +0 -14
  182. package/vendor/@popperjs/core/lib/dom-utils/getOffsetParent.es.js +0 -51
  183. package/vendor/@popperjs/core/lib/dom-utils/getParentNode.es.js +0 -21
  184. package/vendor/@popperjs/core/lib/dom-utils/getScrollParent.es.js +0 -16
  185. package/vendor/@popperjs/core/lib/dom-utils/getViewportRect.es.js +0 -31
  186. package/vendor/@popperjs/core/lib/dom-utils/getWindow.es.js +0 -13
  187. package/vendor/@popperjs/core/lib/dom-utils/getWindowScroll.es.js +0 -13
  188. package/vendor/@popperjs/core/lib/dom-utils/getWindowScrollBarX.es.js +0 -9
  189. package/vendor/@popperjs/core/lib/dom-utils/instanceOf.es.js +0 -21
  190. package/vendor/@popperjs/core/lib/dom-utils/isLayoutViewport.es.js +0 -7
  191. package/vendor/@popperjs/core/lib/dom-utils/isScrollParent.es.js +0 -8
  192. package/vendor/@popperjs/core/lib/dom-utils/isTableElement.es.js +0 -7
  193. package/vendor/@popperjs/core/lib/dom-utils/listScrollParents.es.js +0 -22
  194. package/vendor/@popperjs/core/lib/enums.es.js +0 -45
  195. package/vendor/@popperjs/core/lib/index.es.js +0 -1
  196. package/vendor/@popperjs/core/lib/modifiers/applyStyles.es.js +0 -71
  197. package/vendor/@popperjs/core/lib/modifiers/arrow.es.js +0 -72
  198. package/vendor/@popperjs/core/lib/modifiers/computeStyles.es.js +0 -130
  199. package/vendor/@popperjs/core/lib/modifiers/eventListeners.es.js +0 -40
  200. package/vendor/@popperjs/core/lib/modifiers/flip.es.js +0 -113
  201. package/vendor/@popperjs/core/lib/modifiers/hide.es.js +0 -57
  202. package/vendor/@popperjs/core/lib/modifiers/index.es.js +0 -1
  203. package/vendor/@popperjs/core/lib/modifiers/offset.es.js +0 -42
  204. package/vendor/@popperjs/core/lib/modifiers/popperOffsets.es.js +0 -19
  205. package/vendor/@popperjs/core/lib/modifiers/preventOverflow.es.js +0 -105
  206. package/vendor/@popperjs/core/lib/popper-lite.es.js +0 -1
  207. package/vendor/@popperjs/core/lib/popper.es.js +0 -17
  208. package/vendor/@popperjs/core/lib/utils/computeAutoPlacement.es.js +0 -35
  209. package/vendor/@popperjs/core/lib/utils/computeOffsets.es.js +0 -59
  210. package/vendor/@popperjs/core/lib/utils/debounce.es.js +0 -17
  211. package/vendor/@popperjs/core/lib/utils/detectOverflow.es.js +0 -47
  212. package/vendor/@popperjs/core/lib/utils/expandToHashMap.es.js +0 -9
  213. package/vendor/@popperjs/core/lib/utils/getAltAxis.es.js +0 -6
  214. package/vendor/@popperjs/core/lib/utils/getBasePlacement.es.js +0 -6
  215. package/vendor/@popperjs/core/lib/utils/getFreshSideObject.es.js +0 -11
  216. package/vendor/@popperjs/core/lib/utils/getMainAxisFromPlacement.es.js +0 -6
  217. package/vendor/@popperjs/core/lib/utils/getOppositePlacement.es.js +0 -14
  218. package/vendor/@popperjs/core/lib/utils/getOppositeVariationPlacement.es.js +0 -12
  219. package/vendor/@popperjs/core/lib/utils/getVariation.es.js +0 -6
  220. package/vendor/@popperjs/core/lib/utils/math.es.js +0 -8
  221. package/vendor/@popperjs/core/lib/utils/mergeByName.es.js +0 -16
  222. package/vendor/@popperjs/core/lib/utils/mergePaddingObject.es.js +0 -7
  223. package/vendor/@popperjs/core/lib/utils/orderModifiers.es.js +0 -39
  224. package/vendor/@popperjs/core/lib/utils/rectToClientRect.es.js +0 -11
  225. package/vendor/@popperjs/core/lib/utils/userAgent.es.js +0 -12
  226. package/vendor/@popperjs/core/lib/utils/within.es.js +0 -12
  227. package/vendor/@tiptap/core/dist/index.es.js +0 -4362
  228. package/vendor/@tiptap/extension-bold/dist/index.es.js +0 -81
  229. package/vendor/@tiptap/extension-bubble-menu/dist/index.es.js +0 -202
  230. package/vendor/@tiptap/extension-bullet-list/dist/index.es.js +0 -66
  231. package/vendor/@tiptap/extension-code/dist/index.es.js +0 -59
  232. package/vendor/@tiptap/extension-document/dist/index.es.js +0 -9
  233. package/vendor/@tiptap/extension-floating-menu/dist/index.es.js +0 -154
  234. package/vendor/@tiptap/extension-heading/dist/index.es.js +0 -70
  235. package/vendor/@tiptap/extension-history/dist/index.es.js +0 -39
  236. package/vendor/@tiptap/extension-image/dist/index.es.js +0 -67
  237. package/vendor/@tiptap/extension-italic/dist/index.es.js +0 -80
  238. package/vendor/@tiptap/extension-link/dist/index.es.js +0 -351
  239. package/vendor/@tiptap/extension-list-item/dist/index.es.js +0 -33
  240. package/vendor/@tiptap/extension-mention/dist/index.es.js +0 -165
  241. package/vendor/@tiptap/extension-ordered-list/dist/index.es.js +0 -84
  242. package/vendor/@tiptap/extension-paragraph/dist/index.es.js +0 -35
  243. package/vendor/@tiptap/extension-placeholder/dist/index.es.js +0 -59
  244. package/vendor/@tiptap/extension-text/dist/index.es.js +0 -8
  245. package/vendor/@tiptap/extension-underline/dist/index.es.js +0 -46
  246. package/vendor/@tiptap/pm/commands/dist/index.es.js +0 -1
  247. package/vendor/@tiptap/pm/history/dist/index.es.js +0 -1
  248. package/vendor/@tiptap/pm/keymap/dist/index.es.js +0 -1
  249. package/vendor/@tiptap/pm/model/dist/index.es.js +0 -1
  250. package/vendor/@tiptap/pm/schema-list/dist/index.es.js +0 -1
  251. package/vendor/@tiptap/pm/state/dist/index.es.js +0 -1
  252. package/vendor/@tiptap/pm/transform/dist/index.es.js +0 -1
  253. package/vendor/@tiptap/pm/view/dist/index.es.js +0 -1
  254. package/vendor/@tiptap/suggestion/dist/index.es.js +0 -215
  255. package/vendor/@tiptap/vue-3/dist/index.es.js +0 -535
  256. package/vendor/@wangs-ui/core/components/p-BU8h34na.es.js +0 -22
  257. package/vendor/@wangs-ui/core/components/p-C5lMEBcj.es.js +0 -163
  258. package/vendor/@wangs-ui/core/components/p-CKYwZoTo.es.js +0 -61
  259. package/vendor/@wangs-ui/core/components/p-CsoK-EWG.es.js +0 -203
  260. package/vendor/@wangs-ui/core/components/p-DPHEi31J.es.js +0 -160
  261. package/vendor/@wangs-ui/core/components/p-DTTCzifR.es.js +0 -1447
  262. package/vendor/@wangs-ui/core/components/p-Duri5p90.es.js +0 -184
  263. package/vendor/@wangs-ui/core/components/wangs-button.es.js +0 -38
  264. package/vendor/@wangs-ui/core/components/wangs-icon.es.js +0 -5
  265. package/vendor/@wangs-ui/core/components/wangs-input-otp.es.js +0 -5
  266. package/vendor/@wangs-ui/core/components/wangs-tab-menu.es.js +0 -5
  267. package/vendor/@wangs-ui/core/dist/esm/index-DCkh3cGv.es.js +0 -340
  268. package/vendor/@wangs-ui/core/dist/esm/index.es.js +0 -1
  269. package/vendor/@wangs-ui/core/dist/index.es.js +0 -1
  270. package/vendor/@wangs-ui/vue/dist/index.es.js +0 -98
  271. package/vendor/base64toblob/base64toblob.es.js +0 -37
  272. package/vendor/highlight.js/es/core.es.js +0 -7
  273. package/vendor/highlight.js/es/languages/javascript.es.js +0 -700
  274. package/vendor/highlight.js/es/languages/json.es.js +0 -41
  275. package/vendor/highlight.js/es/languages/typescript.es.js +0 -803
  276. package/vendor/highlight.js/es/languages/vbscript-html.es.js +0 -16
  277. package/vendor/highlight.js/lib/core.es.js +0 -1541
  278. package/vendor/linkifyjs/dist/linkify.es.es.js +0 -1158
  279. package/vendor/lodash/_Symbol.es.js +0 -14
  280. package/vendor/lodash/_baseGetTag.es.js +0 -23
  281. package/vendor/lodash/_baseTrim.es.js +0 -17
  282. package/vendor/lodash/_freeGlobal.es.js +0 -13
  283. package/vendor/lodash/_getRawTag.es.js +0 -34
  284. package/vendor/lodash/_objectToString.es.js +0 -16
  285. package/vendor/lodash/_root.es.js +0 -15
  286. package/vendor/lodash/_trimmedEndIndex.es.js +0 -18
  287. package/vendor/lodash/debounce.es.js +0 -98
  288. package/vendor/lodash/isObject.es.js +0 -15
  289. package/vendor/lodash/isObjectLike.es.js +0 -14
  290. package/vendor/lodash/isSymbol.es.js +0 -18
  291. package/vendor/lodash/now.es.js +0 -16
  292. package/vendor/lodash/throttle.es.js +0 -30
  293. package/vendor/lodash/toNumber.es.js +0 -38
  294. package/vendor/lodash-es/_DataView.es.js +0 -6
  295. package/vendor/lodash-es/_Hash.es.js +0 -21
  296. package/vendor/lodash-es/_LazyWrapper.es.js +0 -1
  297. package/vendor/lodash-es/_ListCache.es.js +0 -21
  298. package/vendor/lodash-es/_LodashWrapper.es.js +0 -1
  299. package/vendor/lodash-es/_Map.es.js +0 -6
  300. package/vendor/lodash-es/_MapCache.es.js +0 -21
  301. package/vendor/lodash-es/_Promise.es.js +0 -6
  302. package/vendor/lodash-es/_Set.es.js +0 -6
  303. package/vendor/lodash-es/_SetCache.es.js +0 -15
  304. package/vendor/lodash-es/_Stack.es.js +0 -18
  305. package/vendor/lodash-es/_Symbol.es.js +0 -5
  306. package/vendor/lodash-es/_Uint8Array.es.js +0 -5
  307. package/vendor/lodash-es/_WeakMap.es.js +0 -6
  308. package/vendor/lodash-es/_apply.es.js +0 -1
  309. package/vendor/lodash-es/_arrayAggregator.es.js +0 -1
  310. package/vendor/lodash-es/_arrayEach.es.js +0 -12
  311. package/vendor/lodash-es/_arrayEachRight.es.js +0 -1
  312. package/vendor/lodash-es/_arrayEvery.es.js +0 -1
  313. package/vendor/lodash-es/_arrayFilter.es.js +0 -13
  314. package/vendor/lodash-es/_arrayIncludes.es.js +0 -1
  315. package/vendor/lodash-es/_arrayIncludesWith.es.js +0 -1
  316. package/vendor/lodash-es/_arrayLikeKeys.es.js +0 -24
  317. package/vendor/lodash-es/_arrayMap.es.js +0 -1
  318. package/vendor/lodash-es/_arrayPush.es.js +0 -10
  319. package/vendor/lodash-es/_arrayReduce.es.js +0 -1
  320. package/vendor/lodash-es/_arrayReduceRight.es.js +0 -1
  321. package/vendor/lodash-es/_arraySample.es.js +0 -1
  322. package/vendor/lodash-es/_arraySampleSize.es.js +0 -1
  323. package/vendor/lodash-es/_arrayShuffle.es.js +0 -1
  324. package/vendor/lodash-es/_arraySome.es.js +0 -12
  325. package/vendor/lodash-es/_asciiSize.es.js +0 -1
  326. package/vendor/lodash-es/_asciiToArray.es.js +0 -1
  327. package/vendor/lodash-es/_asciiWords.es.js +0 -1
  328. package/vendor/lodash-es/_assignMergeValue.es.js +0 -1
  329. package/vendor/lodash-es/_assignValue.es.js +0 -13
  330. package/vendor/lodash-es/_assocIndexOf.es.js +0 -13
  331. package/vendor/lodash-es/_baseAggregator.es.js +0 -1
  332. package/vendor/lodash-es/_baseAssign.es.js +0 -1
  333. package/vendor/lodash-es/_baseAssignIn.es.js +0 -1
  334. package/vendor/lodash-es/_baseAssignValue.es.js +0 -16
  335. package/vendor/lodash-es/_baseAt.es.js +0 -1
  336. package/vendor/lodash-es/_baseClamp.es.js +0 -1
  337. package/vendor/lodash-es/_baseClone.es.js +0 -73
  338. package/vendor/lodash-es/_baseConforms.es.js +0 -1
  339. package/vendor/lodash-es/_baseConformsTo.es.js +0 -1
  340. package/vendor/lodash-es/_baseCreate.es.js +0 -21
  341. package/vendor/lodash-es/_baseDelay.es.js +0 -1
  342. package/vendor/lodash-es/_baseDifference.es.js +0 -1
  343. package/vendor/lodash-es/_baseEach.es.js +0 -1
  344. package/vendor/lodash-es/_baseEachRight.es.js +0 -1
  345. package/vendor/lodash-es/_baseEvery.es.js +0 -1
  346. package/vendor/lodash-es/_baseExtremum.es.js +0 -1
  347. package/vendor/lodash-es/_baseFill.es.js +0 -1
  348. package/vendor/lodash-es/_baseFilter.es.js +0 -1
  349. package/vendor/lodash-es/_baseFindIndex.es.js +0 -1
  350. package/vendor/lodash-es/_baseFindKey.es.js +0 -1
  351. package/vendor/lodash-es/_baseFlatten.es.js +0 -1
  352. package/vendor/lodash-es/_baseFor.es.js +0 -1
  353. package/vendor/lodash-es/_baseForOwn.es.js +0 -1
  354. package/vendor/lodash-es/_baseForOwnRight.es.js +0 -1
  355. package/vendor/lodash-es/_baseForRight.es.js +0 -1
  356. package/vendor/lodash-es/_baseFunctions.es.js +0 -1
  357. package/vendor/lodash-es/_baseGet.es.js +0 -1
  358. package/vendor/lodash-es/_baseGetAllKeys.es.js +0 -9
  359. package/vendor/lodash-es/_baseGetTag.es.js +0 -14
  360. package/vendor/lodash-es/_baseGt.es.js +0 -1
  361. package/vendor/lodash-es/_baseHas.es.js +0 -1
  362. package/vendor/lodash-es/_baseHasIn.es.js +0 -1
  363. package/vendor/lodash-es/_baseInRange.es.js +0 -1
  364. package/vendor/lodash-es/_baseIndexOf.es.js +0 -1
  365. package/vendor/lodash-es/_baseIndexOfWith.es.js +0 -1
  366. package/vendor/lodash-es/_baseIntersection.es.js +0 -1
  367. package/vendor/lodash-es/_baseInverter.es.js +0 -1
  368. package/vendor/lodash-es/_baseInvoke.es.js +0 -1
  369. package/vendor/lodash-es/_baseIsArguments.es.js +0 -9
  370. package/vendor/lodash-es/_baseIsArrayBuffer.es.js +0 -1
  371. package/vendor/lodash-es/_baseIsDate.es.js +0 -1
  372. package/vendor/lodash-es/_baseIsEqual.es.js +0 -14
  373. package/vendor/lodash-es/_baseIsEqualDeep.es.js +0 -45
  374. package/vendor/lodash-es/_baseIsMap.es.js +0 -9
  375. package/vendor/lodash-es/_baseIsMatch.es.js +0 -1
  376. package/vendor/lodash-es/_baseIsNaN.es.js +0 -1
  377. package/vendor/lodash-es/_baseIsNative.es.js +0 -22
  378. package/vendor/lodash-es/_baseIsRegExp.es.js +0 -1
  379. package/vendor/lodash-es/_baseIsSet.es.js +0 -9
  380. package/vendor/lodash-es/_baseIsTypedArray.es.js +0 -14
  381. package/vendor/lodash-es/_baseIteratee.es.js +0 -1
  382. package/vendor/lodash-es/_baseKeys.es.js +0 -19
  383. package/vendor/lodash-es/_baseKeysIn.es.js +0 -1
  384. package/vendor/lodash-es/_baseLodash.es.js +0 -1
  385. package/vendor/lodash-es/_baseLt.es.js +0 -1
  386. package/vendor/lodash-es/_baseMap.es.js +0 -1
  387. package/vendor/lodash-es/_baseMatches.es.js +0 -1
  388. package/vendor/lodash-es/_baseMatchesProperty.es.js +0 -1
  389. package/vendor/lodash-es/_baseMean.es.js +0 -1
  390. package/vendor/lodash-es/_baseMerge.es.js +0 -1
  391. package/vendor/lodash-es/_baseMergeDeep.es.js +0 -1
  392. package/vendor/lodash-es/_baseNth.es.js +0 -1
  393. package/vendor/lodash-es/_baseOrderBy.es.js +0 -1
  394. package/vendor/lodash-es/_basePick.es.js +0 -1
  395. package/vendor/lodash-es/_basePickBy.es.js +0 -1
  396. package/vendor/lodash-es/_baseProperty.es.js +0 -1
  397. package/vendor/lodash-es/_basePropertyDeep.es.js +0 -1
  398. package/vendor/lodash-es/_basePropertyOf.es.js +0 -1
  399. package/vendor/lodash-es/_basePullAll.es.js +0 -1
  400. package/vendor/lodash-es/_basePullAt.es.js +0 -1
  401. package/vendor/lodash-es/_baseRandom.es.js +0 -1
  402. package/vendor/lodash-es/_baseRange.es.js +0 -1
  403. package/vendor/lodash-es/_baseReduce.es.js +0 -1
  404. package/vendor/lodash-es/_baseRepeat.es.js +0 -1
  405. package/vendor/lodash-es/_baseRest.es.js +0 -1
  406. package/vendor/lodash-es/_baseSample.es.js +0 -1
  407. package/vendor/lodash-es/_baseSampleSize.es.js +0 -1
  408. package/vendor/lodash-es/_baseSet.es.js +0 -1
  409. package/vendor/lodash-es/_baseSetData.es.js +0 -1
  410. package/vendor/lodash-es/_baseSetToString.es.js +0 -1
  411. package/vendor/lodash-es/_baseShuffle.es.js +0 -1
  412. package/vendor/lodash-es/_baseSlice.es.js +0 -1
  413. package/vendor/lodash-es/_baseSome.es.js +0 -1
  414. package/vendor/lodash-es/_baseSortBy.es.js +0 -1
  415. package/vendor/lodash-es/_baseSortedIndex.es.js +0 -1
  416. package/vendor/lodash-es/_baseSortedIndexBy.es.js +0 -1
  417. package/vendor/lodash-es/_baseSortedUniq.es.js +0 -1
  418. package/vendor/lodash-es/_baseSum.es.js +0 -1
  419. package/vendor/lodash-es/_baseTimes.es.js +0 -10
  420. package/vendor/lodash-es/_baseToNumber.es.js +0 -1
  421. package/vendor/lodash-es/_baseToPairs.es.js +0 -1
  422. package/vendor/lodash-es/_baseToString.es.js +0 -1
  423. package/vendor/lodash-es/_baseTrim.es.js +0 -8
  424. package/vendor/lodash-es/_baseUnary.es.js +0 -8
  425. package/vendor/lodash-es/_baseUniq.es.js +0 -1
  426. package/vendor/lodash-es/_baseUnset.es.js +0 -1
  427. package/vendor/lodash-es/_baseUpdate.es.js +0 -1
  428. package/vendor/lodash-es/_baseValues.es.js +0 -1
  429. package/vendor/lodash-es/_baseWhile.es.js +0 -1
  430. package/vendor/lodash-es/_baseWrapperValue.es.js +0 -1
  431. package/vendor/lodash-es/_baseXor.es.js +0 -1
  432. package/vendor/lodash-es/_baseZipObject.es.js +0 -1
  433. package/vendor/lodash-es/_cacheHas.es.js +0 -6
  434. package/vendor/lodash-es/_castArrayLikeObject.es.js +0 -1
  435. package/vendor/lodash-es/_castFunction.es.js +0 -1
  436. package/vendor/lodash-es/_castPath.es.js +0 -1
  437. package/vendor/lodash-es/_castRest.es.js +0 -1
  438. package/vendor/lodash-es/_castSlice.es.js +0 -1
  439. package/vendor/lodash-es/_charsEndIndex.es.js +0 -1
  440. package/vendor/lodash-es/_charsStartIndex.es.js +0 -1
  441. package/vendor/lodash-es/_cloneArrayBuffer.es.js +0 -9
  442. package/vendor/lodash-es/_cloneBuffer.es.js +0 -14
  443. package/vendor/lodash-es/_cloneDataView.es.js +0 -8
  444. package/vendor/lodash-es/_cloneRegExp.es.js +0 -9
  445. package/vendor/lodash-es/_cloneSymbol.es.js +0 -8
  446. package/vendor/lodash-es/_cloneTypedArray.es.js +0 -8
  447. package/vendor/lodash-es/_compareAscending.es.js +0 -1
  448. package/vendor/lodash-es/_compareMultiple.es.js +0 -1
  449. package/vendor/lodash-es/_composeArgs.es.js +0 -1
  450. package/vendor/lodash-es/_composeArgsRight.es.js +0 -1
  451. package/vendor/lodash-es/_copyArray.es.js +0 -1
  452. package/vendor/lodash-es/_copyObject.es.js +0 -1
  453. package/vendor/lodash-es/_copySymbols.es.js +0 -1
  454. package/vendor/lodash-es/_copySymbolsIn.es.js +0 -1
  455. package/vendor/lodash-es/_coreJsData.es.js +0 -5
  456. package/vendor/lodash-es/_countHolders.es.js +0 -1
  457. package/vendor/lodash-es/_createAggregator.es.js +0 -1
  458. package/vendor/lodash-es/_createAssigner.es.js +0 -1
  459. package/vendor/lodash-es/_createBaseEach.es.js +0 -1
  460. package/vendor/lodash-es/_createBaseFor.es.js +0 -1
  461. package/vendor/lodash-es/_createBind.es.js +0 -1
  462. package/vendor/lodash-es/_createCaseFirst.es.js +0 -1
  463. package/vendor/lodash-es/_createCompounder.es.js +0 -1
  464. package/vendor/lodash-es/_createCtor.es.js +0 -1
  465. package/vendor/lodash-es/_createCurry.es.js +0 -1
  466. package/vendor/lodash-es/_createFind.es.js +0 -1
  467. package/vendor/lodash-es/_createFlow.es.js +0 -1
  468. package/vendor/lodash-es/_createHybrid.es.js +0 -1
  469. package/vendor/lodash-es/_createInverter.es.js +0 -1
  470. package/vendor/lodash-es/_createMathOperation.es.js +0 -1
  471. package/vendor/lodash-es/_createOver.es.js +0 -1
  472. package/vendor/lodash-es/_createPadding.es.js +0 -1
  473. package/vendor/lodash-es/_createPartial.es.js +0 -1
  474. package/vendor/lodash-es/_createRange.es.js +0 -1
  475. package/vendor/lodash-es/_createRecurry.es.js +0 -1
  476. package/vendor/lodash-es/_createRelationalOperation.es.js +0 -1
  477. package/vendor/lodash-es/_createRound.es.js +0 -1
  478. package/vendor/lodash-es/_createSet.es.js +0 -1
  479. package/vendor/lodash-es/_createToPairs.es.js +0 -1
  480. package/vendor/lodash-es/_createWrap.es.js +0 -1
  481. package/vendor/lodash-es/_customDefaultsAssignIn.es.js +0 -1
  482. package/vendor/lodash-es/_customDefaultsMerge.es.js +0 -1
  483. package/vendor/lodash-es/_customOmitClone.es.js +0 -1
  484. package/vendor/lodash-es/_deburrLetter.es.js +0 -1
  485. package/vendor/lodash-es/_defineProperty.es.js +0 -12
  486. package/vendor/lodash-es/_equalArrays.es.js +0 -50
  487. package/vendor/lodash-es/_equalByTag.es.js +0 -59
  488. package/vendor/lodash-es/_equalObjects.es.js +0 -50
  489. package/vendor/lodash-es/_escapeHtmlChar.es.js +0 -1
  490. package/vendor/lodash-es/_escapeStringChar.es.js +0 -1
  491. package/vendor/lodash-es/_flatRest.es.js +0 -1
  492. package/vendor/lodash-es/_freeGlobal.es.js +0 -4
  493. package/vendor/lodash-es/_getAllKeys.es.js +0 -9
  494. package/vendor/lodash-es/_getAllKeysIn.es.js +0 -1
  495. package/vendor/lodash-es/_getData.es.js +0 -1
  496. package/vendor/lodash-es/_getFuncName.es.js +0 -1
  497. package/vendor/lodash-es/_getHolder.es.js +0 -1
  498. package/vendor/lodash-es/_getMapData.es.js +0 -8
  499. package/vendor/lodash-es/_getMatchData.es.js +0 -1
  500. package/vendor/lodash-es/_getNative.es.js +0 -9
  501. package/vendor/lodash-es/_getPrototype.es.js +0 -5
  502. package/vendor/lodash-es/_getRawTag.es.js +0 -25
  503. package/vendor/lodash-es/_getSymbols.es.js +0 -17
  504. package/vendor/lodash-es/_getSymbolsIn.es.js +0 -1
  505. package/vendor/lodash-es/_getTag.es.js +0 -34
  506. package/vendor/lodash-es/_getValue.es.js +0 -6
  507. package/vendor/lodash-es/_getView.es.js +0 -1
  508. package/vendor/lodash-es/_getWrapDetails.es.js +0 -1
  509. package/vendor/lodash-es/_hasPath.es.js +0 -1
  510. package/vendor/lodash-es/_hasUnicode.es.js +0 -1
  511. package/vendor/lodash-es/_hasUnicodeWord.es.js +0 -1
  512. package/vendor/lodash-es/_hashClear.es.js +0 -8
  513. package/vendor/lodash-es/_hashDelete.es.js +0 -8
  514. package/vendor/lodash-es/_hashGet.es.js +0 -15
  515. package/vendor/lodash-es/_hashHas.es.js +0 -10
  516. package/vendor/lodash-es/_hashSet.es.js +0 -11
  517. package/vendor/lodash-es/_initCloneArray.es.js +0 -13
  518. package/vendor/lodash-es/_initCloneByTag.es.js +0 -43
  519. package/vendor/lodash-es/_initCloneObject.es.js +0 -9
  520. package/vendor/lodash-es/_insertWrapDetails.es.js +0 -1
  521. package/vendor/lodash-es/_isFlattenable.es.js +0 -1
  522. package/vendor/lodash-es/_isIndex.es.js +0 -10
  523. package/vendor/lodash-es/_isIterateeCall.es.js +0 -1
  524. package/vendor/lodash-es/_isKey.es.js +0 -1
  525. package/vendor/lodash-es/_isKeyable.es.js +0 -7
  526. package/vendor/lodash-es/_isLaziable.es.js +0 -1
  527. package/vendor/lodash-es/_isMaskable.es.js +0 -1
  528. package/vendor/lodash-es/_isMasked.es.js +0 -11
  529. package/vendor/lodash-es/_isPrototype.es.js +0 -8
  530. package/vendor/lodash-es/_isStrictComparable.es.js +0 -1
  531. package/vendor/lodash-es/_iteratorToArray.es.js +0 -1
  532. package/vendor/lodash-es/_lazyClone.es.js +0 -1
  533. package/vendor/lodash-es/_lazyReverse.es.js +0 -1
  534. package/vendor/lodash-es/_lazyValue.es.js +0 -1
  535. package/vendor/lodash-es/_listCacheClear.es.js +0 -7
  536. package/vendor/lodash-es/_listCacheDelete.es.js +0 -20
  537. package/vendor/lodash-es/_listCacheGet.es.js +0 -8
  538. package/vendor/lodash-es/_listCacheHas.es.js +0 -7
  539. package/vendor/lodash-es/_listCacheSet.es.js +0 -14
  540. package/vendor/lodash-es/_mapCacheClear.es.js +0 -14
  541. package/vendor/lodash-es/_mapCacheDelete.es.js +0 -9
  542. package/vendor/lodash-es/_mapCacheGet.es.js +0 -7
  543. package/vendor/lodash-es/_mapCacheHas.es.js +0 -7
  544. package/vendor/lodash-es/_mapCacheSet.es.js +0 -10
  545. package/vendor/lodash-es/_mapToArray.es.js +0 -10
  546. package/vendor/lodash-es/_matchesStrictComparable.es.js +0 -1
  547. package/vendor/lodash-es/_memoizeCapped.es.js +0 -1
  548. package/vendor/lodash-es/_mergeData.es.js +0 -1
  549. package/vendor/lodash-es/_metaMap.es.js +0 -1
  550. package/vendor/lodash-es/_nativeCreate.es.js +0 -5
  551. package/vendor/lodash-es/_nativeKeys.es.js +0 -5
  552. package/vendor/lodash-es/_nativeKeysIn.es.js +0 -1
  553. package/vendor/lodash-es/_nodeUtil.es.js +0 -18
  554. package/vendor/lodash-es/_objectToString.es.js +0 -8
  555. package/vendor/lodash-es/_overArg.es.js +0 -8
  556. package/vendor/lodash-es/_overRest.es.js +0 -1
  557. package/vendor/lodash-es/_parent.es.js +0 -1
  558. package/vendor/lodash-es/_reEscape.es.js +0 -1
  559. package/vendor/lodash-es/_reEvaluate.es.js +0 -1
  560. package/vendor/lodash-es/_reInterpolate.es.js +0 -1
  561. package/vendor/lodash-es/_realNames.es.js +0 -1
  562. package/vendor/lodash-es/_reorder.es.js +0 -1
  563. package/vendor/lodash-es/_replaceHolders.es.js +0 -1
  564. package/vendor/lodash-es/_root.es.js +0 -6
  565. package/vendor/lodash-es/_safeGet.es.js +0 -1
  566. package/vendor/lodash-es/_setCacheAdd.es.js +0 -8
  567. package/vendor/lodash-es/_setCacheHas.es.js +0 -6
  568. package/vendor/lodash-es/_setData.es.js +0 -1
  569. package/vendor/lodash-es/_setToArray.es.js +0 -10
  570. package/vendor/lodash-es/_setToPairs.es.js +0 -1
  571. package/vendor/lodash-es/_setToString.es.js +0 -1
  572. package/vendor/lodash-es/_setWrapToString.es.js +0 -1
  573. package/vendor/lodash-es/_shortOut.es.js +0 -1
  574. package/vendor/lodash-es/_shuffleSelf.es.js +0 -1
  575. package/vendor/lodash-es/_stackClear.es.js +0 -8
  576. package/vendor/lodash-es/_stackDelete.es.js +0 -8
  577. package/vendor/lodash-es/_stackGet.es.js +0 -6
  578. package/vendor/lodash-es/_stackHas.es.js +0 -6
  579. package/vendor/lodash-es/_stackSet.es.js +0 -22
  580. package/vendor/lodash-es/_strictIndexOf.es.js +0 -1
  581. package/vendor/lodash-es/_strictLastIndexOf.es.js +0 -1
  582. package/vendor/lodash-es/_stringSize.es.js +0 -1
  583. package/vendor/lodash-es/_stringToArray.es.js +0 -1
  584. package/vendor/lodash-es/_stringToPath.es.js +0 -1
  585. package/vendor/lodash-es/_toKey.es.js +0 -1
  586. package/vendor/lodash-es/_toSource.es.js +0 -18
  587. package/vendor/lodash-es/_trimmedEndIndex.es.js +0 -10
  588. package/vendor/lodash-es/_unescapeHtmlChar.es.js +0 -1
  589. package/vendor/lodash-es/_unicodeSize.es.js +0 -1
  590. package/vendor/lodash-es/_unicodeToArray.es.js +0 -1
  591. package/vendor/lodash-es/_unicodeWords.es.js +0 -1
  592. package/vendor/lodash-es/_updateWrapDetails.es.js +0 -1
  593. package/vendor/lodash-es/_wrapperClone.es.js +0 -1
  594. package/vendor/lodash-es/add.es.js +0 -1
  595. package/vendor/lodash-es/after.es.js +0 -1
  596. package/vendor/lodash-es/array.default.es.js +0 -1
  597. package/vendor/lodash-es/array.es.js +0 -1
  598. package/vendor/lodash-es/ary.es.js +0 -1
  599. package/vendor/lodash-es/assign.es.js +0 -1
  600. package/vendor/lodash-es/assignIn.es.js +0 -1
  601. package/vendor/lodash-es/assignInWith.es.js +0 -1
  602. package/vendor/lodash-es/assignWith.es.js +0 -1
  603. package/vendor/lodash-es/at.es.js +0 -1
  604. package/vendor/lodash-es/attempt.es.js +0 -1
  605. package/vendor/lodash-es/before.es.js +0 -1
  606. package/vendor/lodash-es/bind.es.js +0 -1
  607. package/vendor/lodash-es/bindAll.es.js +0 -1
  608. package/vendor/lodash-es/bindKey.es.js +0 -1
  609. package/vendor/lodash-es/camelCase.es.js +0 -1
  610. package/vendor/lodash-es/capitalize.es.js +0 -1
  611. package/vendor/lodash-es/castArray.es.js +0 -1
  612. package/vendor/lodash-es/ceil.es.js +0 -1
  613. package/vendor/lodash-es/chain.es.js +0 -1
  614. package/vendor/lodash-es/chunk.es.js +0 -1
  615. package/vendor/lodash-es/clamp.es.js +0 -1
  616. package/vendor/lodash-es/clone.es.js +0 -1
  617. package/vendor/lodash-es/cloneDeep.es.js +0 -8
  618. package/vendor/lodash-es/cloneDeepWith.es.js +0 -1
  619. package/vendor/lodash-es/cloneWith.es.js +0 -1
  620. package/vendor/lodash-es/collection.default.es.js +0 -1
  621. package/vendor/lodash-es/collection.es.js +0 -1
  622. package/vendor/lodash-es/commit.es.js +0 -1
  623. package/vendor/lodash-es/compact.es.js +0 -1
  624. package/vendor/lodash-es/concat.es.js +0 -1
  625. package/vendor/lodash-es/cond.es.js +0 -1
  626. package/vendor/lodash-es/conforms.es.js +0 -1
  627. package/vendor/lodash-es/conformsTo.es.js +0 -1
  628. package/vendor/lodash-es/constant.es.js +0 -1
  629. package/vendor/lodash-es/countBy.es.js +0 -1
  630. package/vendor/lodash-es/create.es.js +0 -1
  631. package/vendor/lodash-es/curry.es.js +0 -1
  632. package/vendor/lodash-es/curryRight.es.js +0 -1
  633. package/vendor/lodash-es/date.default.es.js +0 -1
  634. package/vendor/lodash-es/date.es.js +0 -1
  635. package/vendor/lodash-es/debounce.es.js +0 -89
  636. package/vendor/lodash-es/deburr.es.js +0 -1
  637. package/vendor/lodash-es/defaultTo.es.js +0 -1
  638. package/vendor/lodash-es/defaults.es.js +0 -1
  639. package/vendor/lodash-es/defaultsDeep.es.js +0 -1
  640. package/vendor/lodash-es/defer.es.js +0 -1
  641. package/vendor/lodash-es/delay.es.js +0 -1
  642. package/vendor/lodash-es/difference.es.js +0 -1
  643. package/vendor/lodash-es/differenceBy.es.js +0 -1
  644. package/vendor/lodash-es/differenceWith.es.js +0 -1
  645. package/vendor/lodash-es/divide.es.js +0 -1
  646. package/vendor/lodash-es/drop.es.js +0 -1
  647. package/vendor/lodash-es/dropRight.es.js +0 -1
  648. package/vendor/lodash-es/dropRightWhile.es.js +0 -1
  649. package/vendor/lodash-es/dropWhile.es.js +0 -1
  650. package/vendor/lodash-es/each.es.js +0 -1
  651. package/vendor/lodash-es/eachRight.es.js +0 -1
  652. package/vendor/lodash-es/endsWith.es.js +0 -1
  653. package/vendor/lodash-es/entries.es.js +0 -1
  654. package/vendor/lodash-es/entriesIn.es.js +0 -1
  655. package/vendor/lodash-es/eq.es.js +0 -6
  656. package/vendor/lodash-es/escape.es.js +0 -1
  657. package/vendor/lodash-es/escapeRegExp.es.js +0 -1
  658. package/vendor/lodash-es/every.es.js +0 -1
  659. package/vendor/lodash-es/extend.es.js +0 -1
  660. package/vendor/lodash-es/extendWith.es.js +0 -1
  661. package/vendor/lodash-es/fill.es.js +0 -1
  662. package/vendor/lodash-es/filter.es.js +0 -1
  663. package/vendor/lodash-es/find.es.js +0 -1
  664. package/vendor/lodash-es/findIndex.es.js +0 -1
  665. package/vendor/lodash-es/findKey.es.js +0 -1
  666. package/vendor/lodash-es/findLast.es.js +0 -1
  667. package/vendor/lodash-es/findLastIndex.es.js +0 -1
  668. package/vendor/lodash-es/findLastKey.es.js +0 -1
  669. package/vendor/lodash-es/first.es.js +0 -1
  670. package/vendor/lodash-es/flatMap.es.js +0 -1
  671. package/vendor/lodash-es/flatMapDeep.es.js +0 -1
  672. package/vendor/lodash-es/flatMapDepth.es.js +0 -1
  673. package/vendor/lodash-es/flatten.es.js +0 -1
  674. package/vendor/lodash-es/flattenDeep.es.js +0 -1
  675. package/vendor/lodash-es/flattenDepth.es.js +0 -1
  676. package/vendor/lodash-es/flip.es.js +0 -1
  677. package/vendor/lodash-es/floor.es.js +0 -1
  678. package/vendor/lodash-es/flow.es.js +0 -1
  679. package/vendor/lodash-es/flowRight.es.js +0 -1
  680. package/vendor/lodash-es/forEach.es.js +0 -1
  681. package/vendor/lodash-es/forEachRight.es.js +0 -1
  682. package/vendor/lodash-es/forIn.es.js +0 -1
  683. package/vendor/lodash-es/forInRight.es.js +0 -1
  684. package/vendor/lodash-es/forOwn.es.js +0 -1
  685. package/vendor/lodash-es/forOwnRight.es.js +0 -1
  686. package/vendor/lodash-es/fromPairs.es.js +0 -1
  687. package/vendor/lodash-es/function.default.es.js +0 -1
  688. package/vendor/lodash-es/function.es.js +0 -1
  689. package/vendor/lodash-es/functions.es.js +0 -1
  690. package/vendor/lodash-es/functionsIn.es.js +0 -1
  691. package/vendor/lodash-es/get.es.js +0 -1
  692. package/vendor/lodash-es/groupBy.es.js +0 -1
  693. package/vendor/lodash-es/gt.es.js +0 -1
  694. package/vendor/lodash-es/gte.es.js +0 -1
  695. package/vendor/lodash-es/has.es.js +0 -1
  696. package/vendor/lodash-es/hasIn.es.js +0 -1
  697. package/vendor/lodash-es/head.es.js +0 -1
  698. package/vendor/lodash-es/identity.es.js +0 -1
  699. package/vendor/lodash-es/inRange.es.js +0 -1
  700. package/vendor/lodash-es/includes.es.js +0 -1
  701. package/vendor/lodash-es/indexOf.es.js +0 -1
  702. package/vendor/lodash-es/initial.es.js +0 -1
  703. package/vendor/lodash-es/intersection.es.js +0 -1
  704. package/vendor/lodash-es/intersectionBy.es.js +0 -1
  705. package/vendor/lodash-es/intersectionWith.es.js +0 -1
  706. package/vendor/lodash-es/invert.es.js +0 -1
  707. package/vendor/lodash-es/invertBy.es.js +0 -1
  708. package/vendor/lodash-es/invoke.es.js +0 -1
  709. package/vendor/lodash-es/invokeMap.es.js +0 -1
  710. package/vendor/lodash-es/isArguments.es.js +0 -13
  711. package/vendor/lodash-es/isArray.es.js +0 -4
  712. package/vendor/lodash-es/isArrayBuffer.es.js +0 -1
  713. package/vendor/lodash-es/isArrayLike.es.js +0 -8
  714. package/vendor/lodash-es/isArrayLikeObject.es.js +0 -1
  715. package/vendor/lodash-es/isBoolean.es.js +0 -1
  716. package/vendor/lodash-es/isBuffer.es.js +0 -11
  717. package/vendor/lodash-es/isDate.es.js +0 -1
  718. package/vendor/lodash-es/isElement.es.js +0 -1
  719. package/vendor/lodash-es/isEmpty.es.js +0 -1
  720. package/vendor/lodash-es/isEqual.es.js +0 -7
  721. package/vendor/lodash-es/isEqualWith.es.js +0 -1
  722. package/vendor/lodash-es/isError.es.js +0 -1
  723. package/vendor/lodash-es/isFinite.es.js +0 -1
  724. package/vendor/lodash-es/isFunction.es.js +0 -13
  725. package/vendor/lodash-es/isInteger.es.js +0 -1
  726. package/vendor/lodash-es/isLength.es.js +0 -7
  727. package/vendor/lodash-es/isMap.es.js +0 -8
  728. package/vendor/lodash-es/isMatch.es.js +0 -1
  729. package/vendor/lodash-es/isMatchWith.es.js +0 -1
  730. package/vendor/lodash-es/isNaN.es.js +0 -1
  731. package/vendor/lodash-es/isNative.es.js +0 -1
  732. package/vendor/lodash-es/isNil.es.js +0 -1
  733. package/vendor/lodash-es/isNull.es.js +0 -1
  734. package/vendor/lodash-es/isNumber.es.js +0 -1
  735. package/vendor/lodash-es/isObject.es.js +0 -7
  736. package/vendor/lodash-es/isObjectLike.es.js +0 -6
  737. package/vendor/lodash-es/isPlainObject.es.js +0 -1
  738. package/vendor/lodash-es/isRegExp.es.js +0 -1
  739. package/vendor/lodash-es/isSafeInteger.es.js +0 -1
  740. package/vendor/lodash-es/isSet.es.js +0 -8
  741. package/vendor/lodash-es/isString.es.js +0 -1
  742. package/vendor/lodash-es/isSymbol.es.js +0 -9
  743. package/vendor/lodash-es/isTypedArray.es.js +0 -8
  744. package/vendor/lodash-es/isUndefined.es.js +0 -1
  745. package/vendor/lodash-es/isWeakMap.es.js +0 -1
  746. package/vendor/lodash-es/isWeakSet.es.js +0 -1
  747. package/vendor/lodash-es/iteratee.es.js +0 -1
  748. package/vendor/lodash-es/join.es.js +0 -1
  749. package/vendor/lodash-es/kebabCase.es.js +0 -1
  750. package/vendor/lodash-es/keyBy.es.js +0 -1
  751. package/vendor/lodash-es/keys.es.js +0 -9
  752. package/vendor/lodash-es/keysIn.es.js +0 -1
  753. package/vendor/lodash-es/lang.default.es.js +0 -1
  754. package/vendor/lodash-es/lang.es.js +0 -1
  755. package/vendor/lodash-es/last.es.js +0 -1
  756. package/vendor/lodash-es/lastIndexOf.es.js +0 -1
  757. package/vendor/lodash-es/lodash.default.es.js +0 -1
  758. package/vendor/lodash-es/lodash.es.js +0 -1
  759. package/vendor/lodash-es/lowerCase.es.js +0 -1
  760. package/vendor/lodash-es/lowerFirst.es.js +0 -1
  761. package/vendor/lodash-es/lt.es.js +0 -1
  762. package/vendor/lodash-es/lte.es.js +0 -1
  763. package/vendor/lodash-es/map.es.js +0 -1
  764. package/vendor/lodash-es/mapKeys.es.js +0 -1
  765. package/vendor/lodash-es/mapValues.es.js +0 -1
  766. package/vendor/lodash-es/matches.es.js +0 -1
  767. package/vendor/lodash-es/matchesProperty.es.js +0 -1
  768. package/vendor/lodash-es/math.default.es.js +0 -1
  769. package/vendor/lodash-es/math.es.js +0 -1
  770. package/vendor/lodash-es/max.es.js +0 -1
  771. package/vendor/lodash-es/maxBy.es.js +0 -1
  772. package/vendor/lodash-es/mean.es.js +0 -1
  773. package/vendor/lodash-es/meanBy.es.js +0 -1
  774. package/vendor/lodash-es/memoize.es.js +0 -1
  775. package/vendor/lodash-es/merge.es.js +0 -1
  776. package/vendor/lodash-es/mergeWith.es.js +0 -1
  777. package/vendor/lodash-es/method.es.js +0 -1
  778. package/vendor/lodash-es/methodOf.es.js +0 -1
  779. package/vendor/lodash-es/min.es.js +0 -1
  780. package/vendor/lodash-es/minBy.es.js +0 -1
  781. package/vendor/lodash-es/mixin.es.js +0 -1
  782. package/vendor/lodash-es/multiply.es.js +0 -1
  783. package/vendor/lodash-es/negate.es.js +0 -1
  784. package/vendor/lodash-es/next.es.js +0 -1
  785. package/vendor/lodash-es/noop.es.js +0 -1
  786. package/vendor/lodash-es/now.es.js +0 -7
  787. package/vendor/lodash-es/nth.es.js +0 -1
  788. package/vendor/lodash-es/nthArg.es.js +0 -1
  789. package/vendor/lodash-es/number.default.es.js +0 -1
  790. package/vendor/lodash-es/number.es.js +0 -1
  791. package/vendor/lodash-es/object.default.es.js +0 -1
  792. package/vendor/lodash-es/object.es.js +0 -1
  793. package/vendor/lodash-es/omit.es.js +0 -1
  794. package/vendor/lodash-es/omitBy.es.js +0 -1
  795. package/vendor/lodash-es/once.es.js +0 -1
  796. package/vendor/lodash-es/orderBy.es.js +0 -1
  797. package/vendor/lodash-es/over.es.js +0 -1
  798. package/vendor/lodash-es/overArgs.es.js +0 -1
  799. package/vendor/lodash-es/overEvery.es.js +0 -1
  800. package/vendor/lodash-es/overSome.es.js +0 -1
  801. package/vendor/lodash-es/pad.es.js +0 -1
  802. package/vendor/lodash-es/padEnd.es.js +0 -1
  803. package/vendor/lodash-es/padStart.es.js +0 -1
  804. package/vendor/lodash-es/parseInt.es.js +0 -1
  805. package/vendor/lodash-es/partial.es.js +0 -1
  806. package/vendor/lodash-es/partialRight.es.js +0 -1
  807. package/vendor/lodash-es/partition.es.js +0 -1
  808. package/vendor/lodash-es/pick.es.js +0 -1
  809. package/vendor/lodash-es/pickBy.es.js +0 -1
  810. package/vendor/lodash-es/plant.es.js +0 -1
  811. package/vendor/lodash-es/property.es.js +0 -1
  812. package/vendor/lodash-es/propertyOf.es.js +0 -1
  813. package/vendor/lodash-es/pull.es.js +0 -1
  814. package/vendor/lodash-es/pullAll.es.js +0 -1
  815. package/vendor/lodash-es/pullAllBy.es.js +0 -1
  816. package/vendor/lodash-es/pullAllWith.es.js +0 -1
  817. package/vendor/lodash-es/pullAt.es.js +0 -1
  818. package/vendor/lodash-es/random.es.js +0 -1
  819. package/vendor/lodash-es/range.es.js +0 -1
  820. package/vendor/lodash-es/rangeRight.es.js +0 -1
  821. package/vendor/lodash-es/rearg.es.js +0 -1
  822. package/vendor/lodash-es/reduce.es.js +0 -1
  823. package/vendor/lodash-es/reduceRight.es.js +0 -1
  824. package/vendor/lodash-es/reject.es.js +0 -1
  825. package/vendor/lodash-es/remove.es.js +0 -1
  826. package/vendor/lodash-es/repeat.es.js +0 -1
  827. package/vendor/lodash-es/replace.es.js +0 -1
  828. package/vendor/lodash-es/rest.es.js +0 -1
  829. package/vendor/lodash-es/result.es.js +0 -1
  830. package/vendor/lodash-es/reverse.es.js +0 -1
  831. package/vendor/lodash-es/round.es.js +0 -1
  832. package/vendor/lodash-es/sample.es.js +0 -1
  833. package/vendor/lodash-es/sampleSize.es.js +0 -1
  834. package/vendor/lodash-es/seq.default.es.js +0 -1
  835. package/vendor/lodash-es/seq.es.js +0 -1
  836. package/vendor/lodash-es/set.es.js +0 -1
  837. package/vendor/lodash-es/setWith.es.js +0 -1
  838. package/vendor/lodash-es/shuffle.es.js +0 -1
  839. package/vendor/lodash-es/size.es.js +0 -1
  840. package/vendor/lodash-es/slice.es.js +0 -1
  841. package/vendor/lodash-es/snakeCase.es.js +0 -1
  842. package/vendor/lodash-es/some.es.js +0 -1
  843. package/vendor/lodash-es/sortBy.es.js +0 -1
  844. package/vendor/lodash-es/sortedIndex.es.js +0 -1
  845. package/vendor/lodash-es/sortedIndexBy.es.js +0 -1
  846. package/vendor/lodash-es/sortedIndexOf.es.js +0 -1
  847. package/vendor/lodash-es/sortedLastIndex.es.js +0 -1
  848. package/vendor/lodash-es/sortedLastIndexBy.es.js +0 -1
  849. package/vendor/lodash-es/sortedLastIndexOf.es.js +0 -1
  850. package/vendor/lodash-es/sortedUniq.es.js +0 -1
  851. package/vendor/lodash-es/sortedUniqBy.es.js +0 -1
  852. package/vendor/lodash-es/split.es.js +0 -1
  853. package/vendor/lodash-es/spread.es.js +0 -1
  854. package/vendor/lodash-es/startCase.es.js +0 -1
  855. package/vendor/lodash-es/startsWith.es.js +0 -1
  856. package/vendor/lodash-es/string.default.es.js +0 -1
  857. package/vendor/lodash-es/string.es.js +0 -1
  858. package/vendor/lodash-es/stubArray.es.js +0 -6
  859. package/vendor/lodash-es/stubFalse.es.js +0 -6
  860. package/vendor/lodash-es/stubObject.es.js +0 -1
  861. package/vendor/lodash-es/stubString.es.js +0 -1
  862. package/vendor/lodash-es/stubTrue.es.js +0 -1
  863. package/vendor/lodash-es/subtract.es.js +0 -1
  864. package/vendor/lodash-es/sum.es.js +0 -1
  865. package/vendor/lodash-es/sumBy.es.js +0 -1
  866. package/vendor/lodash-es/tail.es.js +0 -1
  867. package/vendor/lodash-es/take.es.js +0 -1
  868. package/vendor/lodash-es/takeRight.es.js +0 -1
  869. package/vendor/lodash-es/takeRightWhile.es.js +0 -1
  870. package/vendor/lodash-es/takeWhile.es.js +0 -1
  871. package/vendor/lodash-es/tap.es.js +0 -1
  872. package/vendor/lodash-es/template.es.js +0 -1
  873. package/vendor/lodash-es/templateSettings.es.js +0 -1
  874. package/vendor/lodash-es/throttle.es.js +0 -1
  875. package/vendor/lodash-es/thru.es.js +0 -1
  876. package/vendor/lodash-es/times.es.js +0 -1
  877. package/vendor/lodash-es/toArray.es.js +0 -1
  878. package/vendor/lodash-es/toFinite.es.js +0 -1
  879. package/vendor/lodash-es/toInteger.es.js +0 -1
  880. package/vendor/lodash-es/toIterator.es.js +0 -1
  881. package/vendor/lodash-es/toJSON.es.js +0 -1
  882. package/vendor/lodash-es/toLength.es.js +0 -1
  883. package/vendor/lodash-es/toLower.es.js +0 -1
  884. package/vendor/lodash-es/toNumber.es.js +0 -29
  885. package/vendor/lodash-es/toPairs.es.js +0 -1
  886. package/vendor/lodash-es/toPairsIn.es.js +0 -1
  887. package/vendor/lodash-es/toPath.es.js +0 -1
  888. package/vendor/lodash-es/toPlainObject.es.js +0 -1
  889. package/vendor/lodash-es/toSafeInteger.es.js +0 -1
  890. package/vendor/lodash-es/toString.es.js +0 -6
  891. package/vendor/lodash-es/toUpper.es.js +0 -1
  892. package/vendor/lodash-es/transform.es.js +0 -1
  893. package/vendor/lodash-es/trim.es.js +0 -1
  894. package/vendor/lodash-es/trimEnd.es.js +0 -1
  895. package/vendor/lodash-es/trimStart.es.js +0 -1
  896. package/vendor/lodash-es/truncate.es.js +0 -1
  897. package/vendor/lodash-es/unary.es.js +0 -1
  898. package/vendor/lodash-es/unescape.es.js +0 -1
  899. package/vendor/lodash-es/union.es.js +0 -1
  900. package/vendor/lodash-es/unionBy.es.js +0 -1
  901. package/vendor/lodash-es/unionWith.es.js +0 -1
  902. package/vendor/lodash-es/uniq.es.js +0 -1
  903. package/vendor/lodash-es/uniqBy.es.js +0 -1
  904. package/vendor/lodash-es/uniqWith.es.js +0 -1
  905. package/vendor/lodash-es/uniqueId.es.js +0 -9
  906. package/vendor/lodash-es/unset.es.js +0 -1
  907. package/vendor/lodash-es/unzip.es.js +0 -1
  908. package/vendor/lodash-es/unzipWith.es.js +0 -1
  909. package/vendor/lodash-es/update.es.js +0 -1
  910. package/vendor/lodash-es/updateWith.es.js +0 -1
  911. package/vendor/lodash-es/upperCase.es.js +0 -1
  912. package/vendor/lodash-es/upperFirst.es.js +0 -1
  913. package/vendor/lodash-es/util.default.es.js +0 -1
  914. package/vendor/lodash-es/util.es.js +0 -1
  915. package/vendor/lodash-es/value.es.js +0 -1
  916. package/vendor/lodash-es/valueOf.es.js +0 -1
  917. package/vendor/lodash-es/values.es.js +0 -1
  918. package/vendor/lodash-es/valuesIn.es.js +0 -1
  919. package/vendor/lodash-es/without.es.js +0 -1
  920. package/vendor/lodash-es/words.es.js +0 -1
  921. package/vendor/lodash-es/wrap.es.js +0 -1
  922. package/vendor/lodash-es/wrapperAt.es.js +0 -1
  923. package/vendor/lodash-es/wrapperChain.es.js +0 -1
  924. package/vendor/lodash-es/wrapperLodash.es.js +0 -1
  925. package/vendor/lodash-es/wrapperReverse.es.js +0 -1
  926. package/vendor/lodash-es/wrapperValue.es.js +0 -1
  927. package/vendor/lodash-es/xor.es.js +0 -1
  928. package/vendor/lodash-es/xorBy.es.js +0 -1
  929. package/vendor/lodash-es/xorWith.es.js +0 -1
  930. package/vendor/lodash-es/zip.es.js +0 -1
  931. package/vendor/lodash-es/zipObject.es.js +0 -1
  932. package/vendor/lodash-es/zipObjectDeep.es.js +0 -1
  933. package/vendor/lodash-es/zipWith.es.js +0 -1
  934. package/vendor/orderedmap/dist/index.es.js +0 -119
  935. package/vendor/primevue/api/api.esm.es.js +0 -276
  936. package/vendor/primevue/avatar/avatar.esm.es.js +0 -85
  937. package/vendor/primevue/avatar/style/avatarstyle.esm.es.js +0 -21
  938. package/vendor/primevue/avatargroup/avatargroup.esm.es.js +0 -27
  939. package/vendor/primevue/avatargroup/style/avatargroupstyle.esm.es.js +0 -11
  940. package/vendor/primevue/badge/badge.esm.es.js +0 -43
  941. package/vendor/primevue/badge/style/badgestyle.esm.es.js +0 -26
  942. package/vendor/primevue/base/style/basestyle.esm.es.js +0 -129
  943. package/vendor/primevue/basecomponent/basecomponent.esm.es.js +0 -475
  944. package/vendor/primevue/basedirective/basedirective.esm.es.js +0 -326
  945. package/vendor/primevue/baseicon/baseicon.esm.es.js +0 -87
  946. package/vendor/primevue/baseicon/style/baseiconstyle.esm.es.js +0 -9
  947. package/vendor/primevue/button/button.esm.es.js +0 -167
  948. package/vendor/primevue/button/style/buttonstyle.esm.es.js +0 -63
  949. package/vendor/primevue/card/card.esm.es.js +0 -41
  950. package/vendor/primevue/card/style/cardstyle.esm.es.js +0 -18
  951. package/vendor/primevue/checkbox/checkbox.esm.es.js +0 -197
  952. package/vendor/primevue/checkbox/style/checkboxstyle.esm.es.js +0 -22
  953. package/vendor/primevue/config/config.esm.es.js +0 -230
  954. package/vendor/primevue/dialog/dialog.esm.es.js +0 -641
  955. package/vendor/primevue/dialog/style/dialogstyle.esm.es.js +0 -59
  956. package/vendor/primevue/dropdown/dropdown.esm.es.js +0 -1443
  957. package/vendor/primevue/dropdown/style/dropdownstyle.esm.es.js +0 -67
  958. package/vendor/primevue/fileupload/fileupload.esm.es.js +0 -870
  959. package/vendor/primevue/fileupload/style/fileuploadstyle.esm.es.js +0 -37
  960. package/vendor/primevue/focustrap/focustrap.esm.es.js +0 -167
  961. package/vendor/primevue/focustrap/style/focustrapstyle.esm.es.js +0 -4
  962. package/vendor/primevue/icons/angledoubleleft/index.esm.es.js +0 -26
  963. package/vendor/primevue/icons/angledoubleright/index.esm.es.js +0 -26
  964. package/vendor/primevue/icons/angledown/index.esm.es.js +0 -24
  965. package/vendor/primevue/icons/angleleft/index.esm.es.js +0 -24
  966. package/vendor/primevue/icons/angleright/index.esm.es.js +0 -24
  967. package/vendor/primevue/icons/angleup/index.esm.es.js +0 -24
  968. package/vendor/primevue/icons/blank/index.esm.es.js +0 -26
  969. package/vendor/primevue/icons/check/index.esm.es.js +0 -24
  970. package/vendor/primevue/icons/chevrondown/index.esm.es.js +0 -24
  971. package/vendor/primevue/icons/exclamationtriangle/index.esm.es.js +0 -32
  972. package/vendor/primevue/icons/eye/index.esm.es.js +0 -26
  973. package/vendor/primevue/icons/eyeslash/index.esm.es.js +0 -26
  974. package/vendor/primevue/icons/infocircle/index.esm.es.js +0 -26
  975. package/vendor/primevue/icons/plus/index.esm.es.js +0 -24
  976. package/vendor/primevue/icons/refresh/index.esm.es.js +0 -26
  977. package/vendor/primevue/icons/search/index.esm.es.js +0 -26
  978. package/vendor/primevue/icons/searchminus/index.esm.es.js +0 -26
  979. package/vendor/primevue/icons/searchplus/index.esm.es.js +0 -26
  980. package/vendor/primevue/icons/spinner/index.esm.es.js +0 -24
  981. package/vendor/primevue/icons/times/index.esm.es.js +0 -24
  982. package/vendor/primevue/icons/timescircle/index.esm.es.js +0 -26
  983. package/vendor/primevue/icons/undo/index.esm.es.js +0 -26
  984. package/vendor/primevue/icons/upload/index.esm.es.js +0 -26
  985. package/vendor/primevue/icons/windowmaximize/index.esm.es.js +0 -26
  986. package/vendor/primevue/icons/windowminimize/index.esm.es.js +0 -26
  987. package/vendor/primevue/image/image.esm.es.js +0 -426
  988. package/vendor/primevue/image/style/imagestyle.esm.es.js +0 -40
  989. package/vendor/primevue/inputgroup/inputgroup.esm.es.js +0 -27
  990. package/vendor/primevue/inputgroup/style/inputgroupstyle.esm.es.js +0 -11
  991. package/vendor/primevue/inputgroupaddon/inputgroupaddon.esm.es.js +0 -27
  992. package/vendor/primevue/inputgroupaddon/style/inputgroupaddonstyle.esm.es.js +0 -11
  993. package/vendor/primevue/inputnumber/inputnumber.esm.es.js +0 -1205
  994. package/vendor/primevue/inputnumber/style/inputnumberstyle.esm.es.js +0 -40
  995. package/vendor/primevue/inputtext/inputtext.esm.es.js +0 -68
  996. package/vendor/primevue/inputtext/style/inputtextstyle.esm.es.js +0 -20
  997. package/vendor/primevue/menu/menu.esm.es.js +0 -606
  998. package/vendor/primevue/menu/style/menustyle.esm.es.js +0 -33
  999. package/vendor/primevue/message/message.esm.es.js +0 -215
  1000. package/vendor/primevue/message/style/messagestyle.esm.es.js +0 -19
  1001. package/vendor/primevue/multiselect/multiselect.esm.es.js +0 -1631
  1002. package/vendor/primevue/multiselect/style/multiselectstyle.esm.es.js +0 -76
  1003. package/vendor/primevue/overlayeventbus/overlayeventbus.esm.es.js +0 -5
  1004. package/vendor/primevue/overlaypanel/overlaypanel.esm.es.js +0 -400
  1005. package/vendor/primevue/overlaypanel/style/overlaypanelstyle.esm.es.js +0 -19
  1006. package/vendor/primevue/paginator/paginator.esm.es.js +0 -882
  1007. package/vendor/primevue/paginator/style/paginatorstyle.esm.es.js +0 -88
  1008. package/vendor/primevue/password/password.esm.es.js +0 -516
  1009. package/vendor/primevue/password/style/passwordstyle.esm.es.js +0 -47
  1010. package/vendor/primevue/portal/portal.esm.es.js +0 -40
  1011. package/vendor/primevue/progressbar/progressbar.esm.es.js +0 -74
  1012. package/vendor/primevue/progressbar/style/progressbarstyle.esm.es.js +0 -20
  1013. package/vendor/primevue/ripple/ripple.esm.es.js +0 -118
  1014. package/vendor/primevue/ripple/style/ripplestyle.esm.es.js +0 -11
  1015. package/vendor/primevue/selectbutton/selectbutton.esm.es.js +0 -324
  1016. package/vendor/primevue/selectbutton/style/selectbuttonstyle.esm.es.js +0 -25
  1017. package/vendor/primevue/skeleton/skeleton.esm.es.js +0 -69
  1018. package/vendor/primevue/skeleton/style/skeletonstyle.esm.es.js +0 -23
  1019. package/vendor/primevue/textarea/style/textareastyle.esm.es.js +0 -19
  1020. package/vendor/primevue/textarea/textarea.esm.es.js +0 -86
  1021. package/vendor/primevue/timeline/style/timelinestyle.esm.es.js +0 -20
  1022. package/vendor/primevue/timeline/timeline.esm.es.js +0 -87
  1023. package/vendor/primevue/toast/style/toaststyle.esm.es.js +0 -81
  1024. package/vendor/primevue/toast/toast.esm.es.js +0 -500
  1025. package/vendor/primevue/toasteventbus/toasteventbus.esm.es.js +0 -5
  1026. package/vendor/primevue/toastservice/toastservice.esm.es.js +0 -25
  1027. package/vendor/primevue/tooltip/style/tooltipstyle.esm.es.js +0 -13
  1028. package/vendor/primevue/tooltip/tooltip.esm.es.js +0 -453
  1029. package/vendor/primevue/usestyle/usestyle.esm.es.js +0 -115
  1030. package/vendor/primevue/usetoast/usetoast.esm.es.js +0 -13
  1031. package/vendor/primevue/utils/utils.esm.es.js +0 -1386
  1032. package/vendor/primevue/virtualscroller/style/virtualscrollerstyle.esm.es.js +0 -9
  1033. package/vendor/primevue/virtualscroller/virtualscroller.esm.es.js +0 -931
  1034. package/vendor/prosemirror-commands/dist/index.es.js +0 -521
  1035. package/vendor/prosemirror-history/dist/index.es.js +0 -356
  1036. package/vendor/prosemirror-keymap/dist/index.es.js +0 -80
  1037. package/vendor/prosemirror-model/dist/index.es.js +0 -3205
  1038. package/vendor/prosemirror-schema-list/dist/index.es.js +0 -129
  1039. package/vendor/prosemirror-state/dist/index.es.js +0 -934
  1040. package/vendor/prosemirror-transform/dist/index.es.js +0 -1824
  1041. package/vendor/prosemirror-view/dist/index.es.js +0 -5150
  1042. package/vendor/rope-sequence/dist/index.es.js +0 -183
  1043. package/vendor/simplebar-core/dist/index.es.js +0 -767
  1044. package/vendor/simplebar-vue/dist/simplebar-vue.esm.es.js +0 -189
  1045. package/vendor/single-spa/lib/es2015/esm/single-spa.min.es.js +0 -669
  1046. package/vendor/tippy.js/dist/tippy.esm.es.js +0 -1168
  1047. package/vendor/vee-validate/dist/vee-validate.esm.es.js +0 -2042
  1048. package/vendor/vue-advanced-cropper/dist/index.esm-bundler.es.js +0 -1382
  1049. package/vendor/vue-demi/lib/index.es.js +0 -1
  1050. package/vendor/w3c-keyname/index.es.js +0 -104
  1051. package/wangsvue.esm.browser.js +0 -67705
@@ -1,4362 +0,0 @@
1
- import { N as NodeSelection, E as EditorState, P as Plugin, a as PluginKey, S as Selection, T as TextSelection, A as AllSelection } from "../../../prosemirror-state/dist/index.es.js";
2
- import { E as EditorView } from "../../../prosemirror-view/dist/index.es.js";
3
- import { k as keymap } from "../../../prosemirror-keymap/dist/index.es.js";
4
- import { D as DOMSerializer, S as Schema, F as Fragment, N as Node$1, a as DOMParser, b as Slice } from "../../../prosemirror-model/dist/index.es.js";
5
- import { f as findWrapping, c as canJoin, T as Transform, a as canSplit, j as joinPoint, l as liftTarget, R as ReplaceStep, b as ReplaceAroundStep } from "../../../prosemirror-transform/dist/index.es.js";
6
- import { w as wrapIn$1, s as setBlockType, a as selectTextblockStart$1, b as selectTextblockEnd$1, c as selectParentNode$1, d as selectNodeForward$1, e as selectNodeBackward$1, n as newlineInCode$1, l as liftEmptyBlock$1, f as lift$1, j as joinUp$1, g as joinTextblockForward$1, h as joinTextblockBackward$1, i as joinForward$1, k as joinDown$1, m as joinBackward$1, o as exitCode$1, p as deleteSelection$1, q as createParagraphNear$1 } from "../../../prosemirror-commands/dist/index.es.js";
7
- import { w as wrapInList$1, s as sinkListItem$1, l as liftListItem$1 } from "../../../prosemirror-schema-list/dist/index.es.js";
8
- function createChainableState(config) {
9
- const { state, transaction } = config;
10
- let { selection } = transaction;
11
- let { doc } = transaction;
12
- let { storedMarks } = transaction;
13
- return {
14
- ...state,
15
- apply: state.apply.bind(state),
16
- applyTransaction: state.applyTransaction.bind(state),
17
- plugins: state.plugins,
18
- schema: state.schema,
19
- reconfigure: state.reconfigure.bind(state),
20
- toJSON: state.toJSON.bind(state),
21
- get storedMarks() {
22
- return storedMarks;
23
- },
24
- get selection() {
25
- return selection;
26
- },
27
- get doc() {
28
- return doc;
29
- },
30
- get tr() {
31
- selection = transaction.selection;
32
- doc = transaction.doc;
33
- storedMarks = transaction.storedMarks;
34
- return transaction;
35
- }
36
- };
37
- }
38
- class CommandManager {
39
- constructor(props) {
40
- this.editor = props.editor;
41
- this.rawCommands = this.editor.extensionManager.commands;
42
- this.customState = props.state;
43
- }
44
- get hasCustomState() {
45
- return !!this.customState;
46
- }
47
- get state() {
48
- return this.customState || this.editor.state;
49
- }
50
- get commands() {
51
- const { rawCommands, editor, state } = this;
52
- const { view } = editor;
53
- const { tr } = state;
54
- const props = this.buildProps(tr);
55
- return Object.fromEntries(Object.entries(rawCommands).map(([name, command2]) => {
56
- const method = (...args) => {
57
- const callback = command2(...args)(props);
58
- if (!tr.getMeta("preventDispatch") && !this.hasCustomState) {
59
- view.dispatch(tr);
60
- }
61
- return callback;
62
- };
63
- return [name, method];
64
- }));
65
- }
66
- get chain() {
67
- return () => this.createChain();
68
- }
69
- get can() {
70
- return () => this.createCan();
71
- }
72
- createChain(startTr, shouldDispatch = true) {
73
- const { rawCommands, editor, state } = this;
74
- const { view } = editor;
75
- const callbacks = [];
76
- const hasStartTransaction = !!startTr;
77
- const tr = startTr || state.tr;
78
- const run2 = () => {
79
- if (!hasStartTransaction && shouldDispatch && !tr.getMeta("preventDispatch") && !this.hasCustomState) {
80
- view.dispatch(tr);
81
- }
82
- return callbacks.every((callback) => callback === true);
83
- };
84
- const chain = {
85
- ...Object.fromEntries(Object.entries(rawCommands).map(([name, command2]) => {
86
- const chainedCommand = (...args) => {
87
- const props = this.buildProps(tr, shouldDispatch);
88
- const callback = command2(...args)(props);
89
- callbacks.push(callback);
90
- return chain;
91
- };
92
- return [name, chainedCommand];
93
- })),
94
- run: run2
95
- };
96
- return chain;
97
- }
98
- createCan(startTr) {
99
- const { rawCommands, state } = this;
100
- const dispatch = false;
101
- const tr = startTr || state.tr;
102
- const props = this.buildProps(tr, dispatch);
103
- const formattedCommands = Object.fromEntries(Object.entries(rawCommands).map(([name, command2]) => {
104
- return [name, (...args) => command2(...args)({ ...props, dispatch: void 0 })];
105
- }));
106
- return {
107
- ...formattedCommands,
108
- chain: () => this.createChain(tr, dispatch)
109
- };
110
- }
111
- buildProps(tr, shouldDispatch = true) {
112
- const { rawCommands, editor, state } = this;
113
- const { view } = editor;
114
- const props = {
115
- tr,
116
- editor,
117
- view,
118
- state: createChainableState({
119
- state,
120
- transaction: tr
121
- }),
122
- dispatch: shouldDispatch ? () => void 0 : void 0,
123
- chain: () => this.createChain(tr, shouldDispatch),
124
- can: () => this.createCan(tr),
125
- get commands() {
126
- return Object.fromEntries(Object.entries(rawCommands).map(([name, command2]) => {
127
- return [name, (...args) => command2(...args)(props)];
128
- }));
129
- }
130
- };
131
- return props;
132
- }
133
- }
134
- class EventEmitter {
135
- constructor() {
136
- this.callbacks = {};
137
- }
138
- on(event, fn) {
139
- if (!this.callbacks[event]) {
140
- this.callbacks[event] = [];
141
- }
142
- this.callbacks[event].push(fn);
143
- return this;
144
- }
145
- emit(event, ...args) {
146
- const callbacks = this.callbacks[event];
147
- if (callbacks) {
148
- callbacks.forEach((callback) => callback.apply(this, args));
149
- }
150
- return this;
151
- }
152
- off(event, fn) {
153
- const callbacks = this.callbacks[event];
154
- if (callbacks) {
155
- if (fn) {
156
- this.callbacks[event] = callbacks.filter((callback) => callback !== fn);
157
- } else {
158
- delete this.callbacks[event];
159
- }
160
- }
161
- return this;
162
- }
163
- once(event, fn) {
164
- const onceFn = (...args) => {
165
- this.off(event, onceFn);
166
- fn.apply(this, args);
167
- };
168
- return this.on(event, onceFn);
169
- }
170
- removeAllListeners() {
171
- this.callbacks = {};
172
- }
173
- }
174
- function getExtensionField(extension, field, context) {
175
- if (extension.config[field] === void 0 && extension.parent) {
176
- return getExtensionField(extension.parent, field, context);
177
- }
178
- if (typeof extension.config[field] === "function") {
179
- const value = extension.config[field].bind({
180
- ...context,
181
- parent: extension.parent ? getExtensionField(extension.parent, field, context) : null
182
- });
183
- return value;
184
- }
185
- return extension.config[field];
186
- }
187
- function splitExtensions(extensions) {
188
- const baseExtensions = extensions.filter((extension) => extension.type === "extension");
189
- const nodeExtensions = extensions.filter((extension) => extension.type === "node");
190
- const markExtensions = extensions.filter((extension) => extension.type === "mark");
191
- return {
192
- baseExtensions,
193
- nodeExtensions,
194
- markExtensions
195
- };
196
- }
197
- function getAttributesFromExtensions(extensions) {
198
- const extensionAttributes = [];
199
- const { nodeExtensions, markExtensions } = splitExtensions(extensions);
200
- const nodeAndMarkExtensions = [...nodeExtensions, ...markExtensions];
201
- const defaultAttribute = {
202
- default: null,
203
- rendered: true,
204
- renderHTML: null,
205
- parseHTML: null,
206
- keepOnSplit: true,
207
- isRequired: false
208
- };
209
- extensions.forEach((extension) => {
210
- const context = {
211
- name: extension.name,
212
- options: extension.options,
213
- storage: extension.storage,
214
- extensions: nodeAndMarkExtensions
215
- };
216
- const addGlobalAttributes = getExtensionField(extension, "addGlobalAttributes", context);
217
- if (!addGlobalAttributes) {
218
- return;
219
- }
220
- const globalAttributes = addGlobalAttributes();
221
- globalAttributes.forEach((globalAttribute) => {
222
- globalAttribute.types.forEach((type) => {
223
- Object.entries(globalAttribute.attributes).forEach(([name, attribute]) => {
224
- extensionAttributes.push({
225
- type,
226
- name,
227
- attribute: {
228
- ...defaultAttribute,
229
- ...attribute
230
- }
231
- });
232
- });
233
- });
234
- });
235
- });
236
- nodeAndMarkExtensions.forEach((extension) => {
237
- const context = {
238
- name: extension.name,
239
- options: extension.options,
240
- storage: extension.storage
241
- };
242
- const addAttributes = getExtensionField(extension, "addAttributes", context);
243
- if (!addAttributes) {
244
- return;
245
- }
246
- const attributes = addAttributes();
247
- Object.entries(attributes).forEach(([name, attribute]) => {
248
- const mergedAttr = {
249
- ...defaultAttribute,
250
- ...attribute
251
- };
252
- if (typeof (mergedAttr === null || mergedAttr === void 0 ? void 0 : mergedAttr.default) === "function") {
253
- mergedAttr.default = mergedAttr.default();
254
- }
255
- if ((mergedAttr === null || mergedAttr === void 0 ? void 0 : mergedAttr.isRequired) && (mergedAttr === null || mergedAttr === void 0 ? void 0 : mergedAttr.default) === void 0) {
256
- delete mergedAttr.default;
257
- }
258
- extensionAttributes.push({
259
- type: extension.name,
260
- name,
261
- attribute: mergedAttr
262
- });
263
- });
264
- });
265
- return extensionAttributes;
266
- }
267
- function getNodeType(nameOrType, schema) {
268
- if (typeof nameOrType === "string") {
269
- if (!schema.nodes[nameOrType]) {
270
- throw Error(`There is no node type named '${nameOrType}'. Maybe you forgot to add the extension?`);
271
- }
272
- return schema.nodes[nameOrType];
273
- }
274
- return nameOrType;
275
- }
276
- function mergeAttributes(...objects) {
277
- return objects.filter((item) => !!item).reduce((items, item) => {
278
- const mergedAttributes = { ...items };
279
- Object.entries(item).forEach(([key, value]) => {
280
- const exists = mergedAttributes[key];
281
- if (!exists) {
282
- mergedAttributes[key] = value;
283
- return;
284
- }
285
- if (key === "class") {
286
- const valueClasses = value ? String(value).split(" ") : [];
287
- const existingClasses = mergedAttributes[key] ? mergedAttributes[key].split(" ") : [];
288
- const insertClasses = valueClasses.filter((valueClass) => !existingClasses.includes(valueClass));
289
- mergedAttributes[key] = [...existingClasses, ...insertClasses].join(" ");
290
- } else if (key === "style") {
291
- const newStyles = value ? value.split(";").map((style2) => style2.trim()).filter(Boolean) : [];
292
- const existingStyles = mergedAttributes[key] ? mergedAttributes[key].split(";").map((style2) => style2.trim()).filter(Boolean) : [];
293
- const styleMap = /* @__PURE__ */ new Map();
294
- existingStyles.forEach((style2) => {
295
- const [property, val] = style2.split(":").map((part) => part.trim());
296
- styleMap.set(property, val);
297
- });
298
- newStyles.forEach((style2) => {
299
- const [property, val] = style2.split(":").map((part) => part.trim());
300
- styleMap.set(property, val);
301
- });
302
- mergedAttributes[key] = Array.from(styleMap.entries()).map(([property, val]) => `${property}: ${val}`).join("; ");
303
- } else {
304
- mergedAttributes[key] = value;
305
- }
306
- });
307
- return mergedAttributes;
308
- }, {});
309
- }
310
- function getRenderedAttributes(nodeOrMark, extensionAttributes) {
311
- return extensionAttributes.filter((attribute) => attribute.type === nodeOrMark.type.name).filter((item) => item.attribute.rendered).map((item) => {
312
- if (!item.attribute.renderHTML) {
313
- return {
314
- [item.name]: nodeOrMark.attrs[item.name]
315
- };
316
- }
317
- return item.attribute.renderHTML(nodeOrMark.attrs) || {};
318
- }).reduce((attributes, attribute) => mergeAttributes(attributes, attribute), {});
319
- }
320
- function isFunction(value) {
321
- return typeof value === "function";
322
- }
323
- function callOrReturn(value, context = void 0, ...props) {
324
- if (isFunction(value)) {
325
- if (context) {
326
- return value.bind(context)(...props);
327
- }
328
- return value(...props);
329
- }
330
- return value;
331
- }
332
- function isEmptyObject(value = {}) {
333
- return Object.keys(value).length === 0 && value.constructor === Object;
334
- }
335
- function fromString(value) {
336
- if (typeof value !== "string") {
337
- return value;
338
- }
339
- if (value.match(/^[+-]?(?:\d*\.)?\d+$/)) {
340
- return Number(value);
341
- }
342
- if (value === "true") {
343
- return true;
344
- }
345
- if (value === "false") {
346
- return false;
347
- }
348
- return value;
349
- }
350
- function injectExtensionAttributesToParseRule(parseRule, extensionAttributes) {
351
- if ("style" in parseRule) {
352
- return parseRule;
353
- }
354
- return {
355
- ...parseRule,
356
- getAttrs: (node) => {
357
- const oldAttributes = parseRule.getAttrs ? parseRule.getAttrs(node) : parseRule.attrs;
358
- if (oldAttributes === false) {
359
- return false;
360
- }
361
- const newAttributes = extensionAttributes.reduce((items, item) => {
362
- const value = item.attribute.parseHTML ? item.attribute.parseHTML(node) : fromString(node.getAttribute(item.name));
363
- if (value === null || value === void 0) {
364
- return items;
365
- }
366
- return {
367
- ...items,
368
- [item.name]: value
369
- };
370
- }, {});
371
- return { ...oldAttributes, ...newAttributes };
372
- }
373
- };
374
- }
375
- function cleanUpSchemaItem(data) {
376
- return Object.fromEntries(
377
- // @ts-ignore
378
- Object.entries(data).filter(([key, value]) => {
379
- if (key === "attrs" && isEmptyObject(value)) {
380
- return false;
381
- }
382
- return value !== null && value !== void 0;
383
- })
384
- );
385
- }
386
- function getSchemaByResolvedExtensions(extensions, editor) {
387
- var _a;
388
- const allAttributes = getAttributesFromExtensions(extensions);
389
- const { nodeExtensions, markExtensions } = splitExtensions(extensions);
390
- const topNode = (_a = nodeExtensions.find((extension) => getExtensionField(extension, "topNode"))) === null || _a === void 0 ? void 0 : _a.name;
391
- const nodes = Object.fromEntries(nodeExtensions.map((extension) => {
392
- const extensionAttributes = allAttributes.filter((attribute) => attribute.type === extension.name);
393
- const context = {
394
- name: extension.name,
395
- options: extension.options,
396
- storage: extension.storage,
397
- editor
398
- };
399
- const extraNodeFields = extensions.reduce((fields, e) => {
400
- const extendNodeSchema = getExtensionField(e, "extendNodeSchema", context);
401
- return {
402
- ...fields,
403
- ...extendNodeSchema ? extendNodeSchema(extension) : {}
404
- };
405
- }, {});
406
- const schema = cleanUpSchemaItem({
407
- ...extraNodeFields,
408
- content: callOrReturn(getExtensionField(extension, "content", context)),
409
- marks: callOrReturn(getExtensionField(extension, "marks", context)),
410
- group: callOrReturn(getExtensionField(extension, "group", context)),
411
- inline: callOrReturn(getExtensionField(extension, "inline", context)),
412
- atom: callOrReturn(getExtensionField(extension, "atom", context)),
413
- selectable: callOrReturn(getExtensionField(extension, "selectable", context)),
414
- draggable: callOrReturn(getExtensionField(extension, "draggable", context)),
415
- code: callOrReturn(getExtensionField(extension, "code", context)),
416
- whitespace: callOrReturn(getExtensionField(extension, "whitespace", context)),
417
- linebreakReplacement: callOrReturn(getExtensionField(extension, "linebreakReplacement", context)),
418
- defining: callOrReturn(getExtensionField(extension, "defining", context)),
419
- isolating: callOrReturn(getExtensionField(extension, "isolating", context)),
420
- attrs: Object.fromEntries(extensionAttributes.map((extensionAttribute) => {
421
- var _a2;
422
- return [extensionAttribute.name, { default: (_a2 = extensionAttribute === null || extensionAttribute === void 0 ? void 0 : extensionAttribute.attribute) === null || _a2 === void 0 ? void 0 : _a2.default }];
423
- }))
424
- });
425
- const parseHTML = callOrReturn(getExtensionField(extension, "parseHTML", context));
426
- if (parseHTML) {
427
- schema.parseDOM = parseHTML.map((parseRule) => injectExtensionAttributesToParseRule(parseRule, extensionAttributes));
428
- }
429
- const renderHTML = getExtensionField(extension, "renderHTML", context);
430
- if (renderHTML) {
431
- schema.toDOM = (node) => renderHTML({
432
- node,
433
- HTMLAttributes: getRenderedAttributes(node, extensionAttributes)
434
- });
435
- }
436
- const renderText = getExtensionField(extension, "renderText", context);
437
- if (renderText) {
438
- schema.toText = renderText;
439
- }
440
- return [extension.name, schema];
441
- }));
442
- const marks = Object.fromEntries(markExtensions.map((extension) => {
443
- const extensionAttributes = allAttributes.filter((attribute) => attribute.type === extension.name);
444
- const context = {
445
- name: extension.name,
446
- options: extension.options,
447
- storage: extension.storage,
448
- editor
449
- };
450
- const extraMarkFields = extensions.reduce((fields, e) => {
451
- const extendMarkSchema = getExtensionField(e, "extendMarkSchema", context);
452
- return {
453
- ...fields,
454
- ...extendMarkSchema ? extendMarkSchema(extension) : {}
455
- };
456
- }, {});
457
- const schema = cleanUpSchemaItem({
458
- ...extraMarkFields,
459
- inclusive: callOrReturn(getExtensionField(extension, "inclusive", context)),
460
- excludes: callOrReturn(getExtensionField(extension, "excludes", context)),
461
- group: callOrReturn(getExtensionField(extension, "group", context)),
462
- spanning: callOrReturn(getExtensionField(extension, "spanning", context)),
463
- code: callOrReturn(getExtensionField(extension, "code", context)),
464
- attrs: Object.fromEntries(extensionAttributes.map((extensionAttribute) => {
465
- var _a2;
466
- return [extensionAttribute.name, { default: (_a2 = extensionAttribute === null || extensionAttribute === void 0 ? void 0 : extensionAttribute.attribute) === null || _a2 === void 0 ? void 0 : _a2.default }];
467
- }))
468
- });
469
- const parseHTML = callOrReturn(getExtensionField(extension, "parseHTML", context));
470
- if (parseHTML) {
471
- schema.parseDOM = parseHTML.map((parseRule) => injectExtensionAttributesToParseRule(parseRule, extensionAttributes));
472
- }
473
- const renderHTML = getExtensionField(extension, "renderHTML", context);
474
- if (renderHTML) {
475
- schema.toDOM = (mark) => renderHTML({
476
- mark,
477
- HTMLAttributes: getRenderedAttributes(mark, extensionAttributes)
478
- });
479
- }
480
- return [extension.name, schema];
481
- }));
482
- return new Schema({
483
- topNode,
484
- nodes,
485
- marks
486
- });
487
- }
488
- function getSchemaTypeByName(name, schema) {
489
- return schema.nodes[name] || schema.marks[name] || null;
490
- }
491
- function isExtensionRulesEnabled(extension, enabled) {
492
- if (Array.isArray(enabled)) {
493
- return enabled.some((enabledExtension) => {
494
- const name = typeof enabledExtension === "string" ? enabledExtension : enabledExtension.name;
495
- return name === extension.name;
496
- });
497
- }
498
- return enabled;
499
- }
500
- function getHTMLFromFragment(fragment, schema) {
501
- const documentFragment = DOMSerializer.fromSchema(schema).serializeFragment(fragment);
502
- const temporaryDocument = document.implementation.createHTMLDocument();
503
- const container = temporaryDocument.createElement("div");
504
- container.appendChild(documentFragment);
505
- return container.innerHTML;
506
- }
507
- const getTextContentFromNodes = ($from, maxMatch = 500) => {
508
- let textBefore = "";
509
- const sliceEndPos = $from.parentOffset;
510
- $from.parent.nodesBetween(Math.max(0, sliceEndPos - maxMatch), sliceEndPos, (node, pos, parent, index) => {
511
- var _a, _b;
512
- const chunk = ((_b = (_a = node.type.spec).toText) === null || _b === void 0 ? void 0 : _b.call(_a, {
513
- node,
514
- pos,
515
- parent,
516
- index
517
- })) || node.textContent || "%leaf%";
518
- textBefore += node.isAtom && !node.isText ? chunk : chunk.slice(0, Math.max(0, sliceEndPos - pos));
519
- });
520
- return textBefore;
521
- };
522
- function isRegExp(value) {
523
- return Object.prototype.toString.call(value) === "[object RegExp]";
524
- }
525
- class InputRule {
526
- constructor(config) {
527
- this.find = config.find;
528
- this.handler = config.handler;
529
- }
530
- }
531
- const inputRuleMatcherHandler = (text, find) => {
532
- if (isRegExp(find)) {
533
- return find.exec(text);
534
- }
535
- const inputRuleMatch = find(text);
536
- if (!inputRuleMatch) {
537
- return null;
538
- }
539
- const result = [inputRuleMatch.text];
540
- result.index = inputRuleMatch.index;
541
- result.input = text;
542
- result.data = inputRuleMatch.data;
543
- if (inputRuleMatch.replaceWith) {
544
- if (!inputRuleMatch.text.includes(inputRuleMatch.replaceWith)) {
545
- console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".');
546
- }
547
- result.push(inputRuleMatch.replaceWith);
548
- }
549
- return result;
550
- };
551
- function run$1(config) {
552
- var _a;
553
- const { editor, from, to, text, rules, plugin } = config;
554
- const { view } = editor;
555
- if (view.composing) {
556
- return false;
557
- }
558
- const $from = view.state.doc.resolve(from);
559
- if (
560
- // check for code node
561
- $from.parent.type.spec.code || !!((_a = $from.nodeBefore || $from.nodeAfter) === null || _a === void 0 ? void 0 : _a.marks.find((mark) => mark.type.spec.code))
562
- ) {
563
- return false;
564
- }
565
- let matched = false;
566
- const textBefore = getTextContentFromNodes($from) + text;
567
- rules.forEach((rule) => {
568
- if (matched) {
569
- return;
570
- }
571
- const match = inputRuleMatcherHandler(textBefore, rule.find);
572
- if (!match) {
573
- return;
574
- }
575
- const tr = view.state.tr;
576
- const state = createChainableState({
577
- state: view.state,
578
- transaction: tr
579
- });
580
- const range = {
581
- from: from - (match[0].length - text.length),
582
- to
583
- };
584
- const { commands: commands2, chain, can } = new CommandManager({
585
- editor,
586
- state
587
- });
588
- const handler = rule.handler({
589
- state,
590
- range,
591
- match,
592
- commands: commands2,
593
- chain,
594
- can
595
- });
596
- if (handler === null || !tr.steps.length) {
597
- return;
598
- }
599
- tr.setMeta(plugin, {
600
- transform: tr,
601
- from,
602
- to,
603
- text
604
- });
605
- view.dispatch(tr);
606
- matched = true;
607
- });
608
- return matched;
609
- }
610
- function inputRulesPlugin(props) {
611
- const { editor, rules } = props;
612
- const plugin = new Plugin({
613
- state: {
614
- init() {
615
- return null;
616
- },
617
- apply(tr, prev, state) {
618
- const stored = tr.getMeta(plugin);
619
- if (stored) {
620
- return stored;
621
- }
622
- const simulatedInputMeta = tr.getMeta("applyInputRules");
623
- const isSimulatedInput = !!simulatedInputMeta;
624
- if (isSimulatedInput) {
625
- setTimeout(() => {
626
- let { text } = simulatedInputMeta;
627
- if (typeof text === "string") {
628
- text = text;
629
- } else {
630
- text = getHTMLFromFragment(Fragment.from(text), state.schema);
631
- }
632
- const { from } = simulatedInputMeta;
633
- const to = from + text.length;
634
- run$1({
635
- editor,
636
- from,
637
- to,
638
- text,
639
- rules,
640
- plugin
641
- });
642
- });
643
- }
644
- return tr.selectionSet || tr.docChanged ? null : prev;
645
- }
646
- },
647
- props: {
648
- handleTextInput(view, from, to, text) {
649
- return run$1({
650
- editor,
651
- from,
652
- to,
653
- text,
654
- rules,
655
- plugin
656
- });
657
- },
658
- handleDOMEvents: {
659
- compositionend: (view) => {
660
- setTimeout(() => {
661
- const { $cursor } = view.state.selection;
662
- if ($cursor) {
663
- run$1({
664
- editor,
665
- from: $cursor.pos,
666
- to: $cursor.pos,
667
- text: "",
668
- rules,
669
- plugin
670
- });
671
- }
672
- });
673
- return false;
674
- }
675
- },
676
- // add support for input rules to trigger on enter
677
- // this is useful for example for code blocks
678
- handleKeyDown(view, event) {
679
- if (event.key !== "Enter") {
680
- return false;
681
- }
682
- const { $cursor } = view.state.selection;
683
- if ($cursor) {
684
- return run$1({
685
- editor,
686
- from: $cursor.pos,
687
- to: $cursor.pos,
688
- text: "\n",
689
- rules,
690
- plugin
691
- });
692
- }
693
- return false;
694
- }
695
- },
696
- // @ts-ignore
697
- isInputRules: true
698
- });
699
- return plugin;
700
- }
701
- function getType(value) {
702
- return Object.prototype.toString.call(value).slice(8, -1);
703
- }
704
- function isPlainObject(value) {
705
- if (getType(value) !== "Object") {
706
- return false;
707
- }
708
- return value.constructor === Object && Object.getPrototypeOf(value) === Object.prototype;
709
- }
710
- function mergeDeep(target, source) {
711
- const output = { ...target };
712
- if (isPlainObject(target) && isPlainObject(source)) {
713
- Object.keys(source).forEach((key) => {
714
- if (isPlainObject(source[key]) && isPlainObject(target[key])) {
715
- output[key] = mergeDeep(target[key], source[key]);
716
- } else {
717
- output[key] = source[key];
718
- }
719
- });
720
- }
721
- return output;
722
- }
723
- class Mark {
724
- constructor(config = {}) {
725
- this.type = "mark";
726
- this.name = "mark";
727
- this.parent = null;
728
- this.child = null;
729
- this.config = {
730
- name: this.name,
731
- defaultOptions: {}
732
- };
733
- this.config = {
734
- ...this.config,
735
- ...config
736
- };
737
- this.name = this.config.name;
738
- if (config.defaultOptions && Object.keys(config.defaultOptions).length > 0) {
739
- console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`);
740
- }
741
- this.options = this.config.defaultOptions;
742
- if (this.config.addOptions) {
743
- this.options = callOrReturn(getExtensionField(this, "addOptions", {
744
- name: this.name
745
- }));
746
- }
747
- this.storage = callOrReturn(getExtensionField(this, "addStorage", {
748
- name: this.name,
749
- options: this.options
750
- })) || {};
751
- }
752
- static create(config = {}) {
753
- return new Mark(config);
754
- }
755
- configure(options = {}) {
756
- const extension = this.extend({
757
- ...this.config,
758
- addOptions: () => {
759
- return mergeDeep(this.options, options);
760
- }
761
- });
762
- extension.name = this.name;
763
- extension.parent = this.parent;
764
- return extension;
765
- }
766
- extend(extendedConfig = {}) {
767
- const extension = new Mark(extendedConfig);
768
- extension.parent = this;
769
- this.child = extension;
770
- extension.name = extendedConfig.name ? extendedConfig.name : extension.parent.name;
771
- if (extendedConfig.defaultOptions && Object.keys(extendedConfig.defaultOptions).length > 0) {
772
- console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${extension.name}".`);
773
- }
774
- extension.options = callOrReturn(getExtensionField(extension, "addOptions", {
775
- name: extension.name
776
- }));
777
- extension.storage = callOrReturn(getExtensionField(extension, "addStorage", {
778
- name: extension.name,
779
- options: extension.options
780
- }));
781
- return extension;
782
- }
783
- static handleExit({ editor, mark }) {
784
- const { tr } = editor.state;
785
- const currentPos = editor.state.selection.$from;
786
- const isAtEnd = currentPos.pos === currentPos.end();
787
- if (isAtEnd) {
788
- const currentMarks = currentPos.marks();
789
- const isInMark = !!currentMarks.find((m) => (m === null || m === void 0 ? void 0 : m.type.name) === mark.name);
790
- if (!isInMark) {
791
- return false;
792
- }
793
- const removeMark = currentMarks.find((m) => (m === null || m === void 0 ? void 0 : m.type.name) === mark.name);
794
- if (removeMark) {
795
- tr.removeStoredMark(removeMark);
796
- }
797
- tr.insertText(" ", currentPos.pos);
798
- editor.view.dispatch(tr);
799
- return true;
800
- }
801
- return false;
802
- }
803
- }
804
- function isNumber(value) {
805
- return typeof value === "number";
806
- }
807
- class PasteRule {
808
- constructor(config) {
809
- this.find = config.find;
810
- this.handler = config.handler;
811
- }
812
- }
813
- const pasteRuleMatcherHandler = (text, find, event) => {
814
- if (isRegExp(find)) {
815
- return [...text.matchAll(find)];
816
- }
817
- const matches = find(text, event);
818
- if (!matches) {
819
- return [];
820
- }
821
- return matches.map((pasteRuleMatch) => {
822
- const result = [pasteRuleMatch.text];
823
- result.index = pasteRuleMatch.index;
824
- result.input = text;
825
- result.data = pasteRuleMatch.data;
826
- if (pasteRuleMatch.replaceWith) {
827
- if (!pasteRuleMatch.text.includes(pasteRuleMatch.replaceWith)) {
828
- console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".');
829
- }
830
- result.push(pasteRuleMatch.replaceWith);
831
- }
832
- return result;
833
- });
834
- };
835
- function run(config) {
836
- const { editor, state, from, to, rule, pasteEvent, dropEvent } = config;
837
- const { commands: commands2, chain, can } = new CommandManager({
838
- editor,
839
- state
840
- });
841
- const handlers = [];
842
- state.doc.nodesBetween(from, to, (node, pos) => {
843
- if (!node.isTextblock || node.type.spec.code) {
844
- return;
845
- }
846
- const resolvedFrom = Math.max(from, pos);
847
- const resolvedTo = Math.min(to, pos + node.content.size);
848
- const textToMatch = node.textBetween(resolvedFrom - pos, resolvedTo - pos, void 0, "");
849
- const matches = pasteRuleMatcherHandler(textToMatch, rule.find, pasteEvent);
850
- matches.forEach((match) => {
851
- if (match.index === void 0) {
852
- return;
853
- }
854
- const start = resolvedFrom + match.index + 1;
855
- const end = start + match[0].length;
856
- const range = {
857
- from: state.tr.mapping.map(start),
858
- to: state.tr.mapping.map(end)
859
- };
860
- const handler = rule.handler({
861
- state,
862
- range,
863
- match,
864
- commands: commands2,
865
- chain,
866
- can,
867
- pasteEvent,
868
- dropEvent
869
- });
870
- handlers.push(handler);
871
- });
872
- });
873
- const success = handlers.every((handler) => handler !== null);
874
- return success;
875
- }
876
- let tiptapDragFromOtherEditor = null;
877
- const createClipboardPasteEvent = (text) => {
878
- var _a;
879
- const event = new ClipboardEvent("paste", {
880
- clipboardData: new DataTransfer()
881
- });
882
- (_a = event.clipboardData) === null || _a === void 0 ? void 0 : _a.setData("text/html", text);
883
- return event;
884
- };
885
- function pasteRulesPlugin(props) {
886
- const { editor, rules } = props;
887
- let dragSourceElement = null;
888
- let isPastedFromProseMirror = false;
889
- let isDroppedFromProseMirror = false;
890
- let pasteEvent = typeof ClipboardEvent !== "undefined" ? new ClipboardEvent("paste") : null;
891
- let dropEvent;
892
- try {
893
- dropEvent = typeof DragEvent !== "undefined" ? new DragEvent("drop") : null;
894
- } catch {
895
- dropEvent = null;
896
- }
897
- const processEvent = ({ state, from, to, rule, pasteEvt }) => {
898
- const tr = state.tr;
899
- const chainableState = createChainableState({
900
- state,
901
- transaction: tr
902
- });
903
- const handler = run({
904
- editor,
905
- state: chainableState,
906
- from: Math.max(from - 1, 0),
907
- to: to.b - 1,
908
- rule,
909
- pasteEvent: pasteEvt,
910
- dropEvent
911
- });
912
- if (!handler || !tr.steps.length) {
913
- return;
914
- }
915
- try {
916
- dropEvent = typeof DragEvent !== "undefined" ? new DragEvent("drop") : null;
917
- } catch {
918
- dropEvent = null;
919
- }
920
- pasteEvent = typeof ClipboardEvent !== "undefined" ? new ClipboardEvent("paste") : null;
921
- return tr;
922
- };
923
- const plugins = rules.map((rule) => {
924
- return new Plugin({
925
- // we register a global drag handler to track the current drag source element
926
- view(view) {
927
- const handleDragstart = (event) => {
928
- var _a;
929
- dragSourceElement = ((_a = view.dom.parentElement) === null || _a === void 0 ? void 0 : _a.contains(event.target)) ? view.dom.parentElement : null;
930
- if (dragSourceElement) {
931
- tiptapDragFromOtherEditor = editor;
932
- }
933
- };
934
- const handleDragend = () => {
935
- if (tiptapDragFromOtherEditor) {
936
- tiptapDragFromOtherEditor = null;
937
- }
938
- };
939
- window.addEventListener("dragstart", handleDragstart);
940
- window.addEventListener("dragend", handleDragend);
941
- return {
942
- destroy() {
943
- window.removeEventListener("dragstart", handleDragstart);
944
- window.removeEventListener("dragend", handleDragend);
945
- }
946
- };
947
- },
948
- props: {
949
- handleDOMEvents: {
950
- drop: (view, event) => {
951
- isDroppedFromProseMirror = dragSourceElement === view.dom.parentElement;
952
- dropEvent = event;
953
- if (!isDroppedFromProseMirror) {
954
- const dragFromOtherEditor = tiptapDragFromOtherEditor;
955
- if (dragFromOtherEditor) {
956
- setTimeout(() => {
957
- const selection = dragFromOtherEditor.state.selection;
958
- if (selection) {
959
- dragFromOtherEditor.commands.deleteRange({ from: selection.from, to: selection.to });
960
- }
961
- }, 10);
962
- }
963
- }
964
- return false;
965
- },
966
- paste: (_view, event) => {
967
- var _a;
968
- const html = (_a = event.clipboardData) === null || _a === void 0 ? void 0 : _a.getData("text/html");
969
- pasteEvent = event;
970
- isPastedFromProseMirror = !!(html === null || html === void 0 ? void 0 : html.includes("data-pm-slice"));
971
- return false;
972
- }
973
- }
974
- },
975
- appendTransaction: (transactions, oldState, state) => {
976
- const transaction = transactions[0];
977
- const isPaste = transaction.getMeta("uiEvent") === "paste" && !isPastedFromProseMirror;
978
- const isDrop = transaction.getMeta("uiEvent") === "drop" && !isDroppedFromProseMirror;
979
- const simulatedPasteMeta = transaction.getMeta("applyPasteRules");
980
- const isSimulatedPaste = !!simulatedPasteMeta;
981
- if (!isPaste && !isDrop && !isSimulatedPaste) {
982
- return;
983
- }
984
- if (isSimulatedPaste) {
985
- let { text } = simulatedPasteMeta;
986
- if (typeof text === "string") {
987
- text = text;
988
- } else {
989
- text = getHTMLFromFragment(Fragment.from(text), state.schema);
990
- }
991
- const { from: from2 } = simulatedPasteMeta;
992
- const to2 = from2 + text.length;
993
- const pasteEvt = createClipboardPasteEvent(text);
994
- return processEvent({
995
- rule,
996
- state,
997
- from: from2,
998
- to: { b: to2 },
999
- pasteEvt
1000
- });
1001
- }
1002
- const from = oldState.doc.content.findDiffStart(state.doc.content);
1003
- const to = oldState.doc.content.findDiffEnd(state.doc.content);
1004
- if (!isNumber(from) || !to || from === to.b) {
1005
- return;
1006
- }
1007
- return processEvent({
1008
- rule,
1009
- state,
1010
- from,
1011
- to,
1012
- pasteEvt: pasteEvent
1013
- });
1014
- }
1015
- });
1016
- });
1017
- return plugins;
1018
- }
1019
- function findDuplicates(items) {
1020
- const filtered = items.filter((el, index) => items.indexOf(el) !== index);
1021
- return Array.from(new Set(filtered));
1022
- }
1023
- class ExtensionManager {
1024
- constructor(extensions, editor) {
1025
- this.splittableMarks = [];
1026
- this.editor = editor;
1027
- this.extensions = ExtensionManager.resolve(extensions);
1028
- this.schema = getSchemaByResolvedExtensions(this.extensions, editor);
1029
- this.setupExtensions();
1030
- }
1031
- /**
1032
- * Returns a flattened and sorted extension list while
1033
- * also checking for duplicated extensions and warns the user.
1034
- * @param extensions An array of Tiptap extensions
1035
- * @returns An flattened and sorted array of Tiptap extensions
1036
- */
1037
- static resolve(extensions) {
1038
- const resolvedExtensions = ExtensionManager.sort(ExtensionManager.flatten(extensions));
1039
- const duplicatedNames = findDuplicates(resolvedExtensions.map((extension) => extension.name));
1040
- if (duplicatedNames.length) {
1041
- console.warn(`[tiptap warn]: Duplicate extension names found: [${duplicatedNames.map((item) => `'${item}'`).join(", ")}]. This can lead to issues.`);
1042
- }
1043
- return resolvedExtensions;
1044
- }
1045
- /**
1046
- * Create a flattened array of extensions by traversing the `addExtensions` field.
1047
- * @param extensions An array of Tiptap extensions
1048
- * @returns A flattened array of Tiptap extensions
1049
- */
1050
- static flatten(extensions) {
1051
- return extensions.map((extension) => {
1052
- const context = {
1053
- name: extension.name,
1054
- options: extension.options,
1055
- storage: extension.storage
1056
- };
1057
- const addExtensions = getExtensionField(extension, "addExtensions", context);
1058
- if (addExtensions) {
1059
- return [extension, ...this.flatten(addExtensions())];
1060
- }
1061
- return extension;
1062
- }).flat(10);
1063
- }
1064
- /**
1065
- * Sort extensions by priority.
1066
- * @param extensions An array of Tiptap extensions
1067
- * @returns A sorted array of Tiptap extensions by priority
1068
- */
1069
- static sort(extensions) {
1070
- const defaultPriority = 100;
1071
- return extensions.sort((a, b) => {
1072
- const priorityA = getExtensionField(a, "priority") || defaultPriority;
1073
- const priorityB = getExtensionField(b, "priority") || defaultPriority;
1074
- if (priorityA > priorityB) {
1075
- return -1;
1076
- }
1077
- if (priorityA < priorityB) {
1078
- return 1;
1079
- }
1080
- return 0;
1081
- });
1082
- }
1083
- /**
1084
- * Get all commands from the extensions.
1085
- * @returns An object with all commands where the key is the command name and the value is the command function
1086
- */
1087
- get commands() {
1088
- return this.extensions.reduce((commands2, extension) => {
1089
- const context = {
1090
- name: extension.name,
1091
- options: extension.options,
1092
- storage: extension.storage,
1093
- editor: this.editor,
1094
- type: getSchemaTypeByName(extension.name, this.schema)
1095
- };
1096
- const addCommands = getExtensionField(extension, "addCommands", context);
1097
- if (!addCommands) {
1098
- return commands2;
1099
- }
1100
- return {
1101
- ...commands2,
1102
- ...addCommands()
1103
- };
1104
- }, {});
1105
- }
1106
- /**
1107
- * Get all registered Prosemirror plugins from the extensions.
1108
- * @returns An array of Prosemirror plugins
1109
- */
1110
- get plugins() {
1111
- const { editor } = this;
1112
- const extensions = ExtensionManager.sort([...this.extensions].reverse());
1113
- const inputRules = [];
1114
- const pasteRules = [];
1115
- const allPlugins = extensions.map((extension) => {
1116
- const context = {
1117
- name: extension.name,
1118
- options: extension.options,
1119
- storage: extension.storage,
1120
- editor,
1121
- type: getSchemaTypeByName(extension.name, this.schema)
1122
- };
1123
- const plugins = [];
1124
- const addKeyboardShortcuts = getExtensionField(extension, "addKeyboardShortcuts", context);
1125
- let defaultBindings = {};
1126
- if (extension.type === "mark" && getExtensionField(extension, "exitable", context)) {
1127
- defaultBindings.ArrowRight = () => Mark.handleExit({ editor, mark: extension });
1128
- }
1129
- if (addKeyboardShortcuts) {
1130
- const bindings = Object.fromEntries(Object.entries(addKeyboardShortcuts()).map(([shortcut, method]) => {
1131
- return [shortcut, () => method({ editor })];
1132
- }));
1133
- defaultBindings = { ...defaultBindings, ...bindings };
1134
- }
1135
- const keyMapPlugin = keymap(defaultBindings);
1136
- plugins.push(keyMapPlugin);
1137
- const addInputRules = getExtensionField(extension, "addInputRules", context);
1138
- if (isExtensionRulesEnabled(extension, editor.options.enableInputRules) && addInputRules) {
1139
- inputRules.push(...addInputRules());
1140
- }
1141
- const addPasteRules = getExtensionField(extension, "addPasteRules", context);
1142
- if (isExtensionRulesEnabled(extension, editor.options.enablePasteRules) && addPasteRules) {
1143
- pasteRules.push(...addPasteRules());
1144
- }
1145
- const addProseMirrorPlugins = getExtensionField(extension, "addProseMirrorPlugins", context);
1146
- if (addProseMirrorPlugins) {
1147
- const proseMirrorPlugins = addProseMirrorPlugins();
1148
- plugins.push(...proseMirrorPlugins);
1149
- }
1150
- return plugins;
1151
- }).flat();
1152
- return [
1153
- inputRulesPlugin({
1154
- editor,
1155
- rules: inputRules
1156
- }),
1157
- ...pasteRulesPlugin({
1158
- editor,
1159
- rules: pasteRules
1160
- }),
1161
- ...allPlugins
1162
- ];
1163
- }
1164
- /**
1165
- * Get all attributes from the extensions.
1166
- * @returns An array of attributes
1167
- */
1168
- get attributes() {
1169
- return getAttributesFromExtensions(this.extensions);
1170
- }
1171
- /**
1172
- * Get all node views from the extensions.
1173
- * @returns An object with all node views where the key is the node name and the value is the node view function
1174
- */
1175
- get nodeViews() {
1176
- const { editor } = this;
1177
- const { nodeExtensions } = splitExtensions(this.extensions);
1178
- return Object.fromEntries(nodeExtensions.filter((extension) => !!getExtensionField(extension, "addNodeView")).map((extension) => {
1179
- const extensionAttributes = this.attributes.filter((attribute) => attribute.type === extension.name);
1180
- const context = {
1181
- name: extension.name,
1182
- options: extension.options,
1183
- storage: extension.storage,
1184
- editor,
1185
- type: getNodeType(extension.name, this.schema)
1186
- };
1187
- const addNodeView = getExtensionField(extension, "addNodeView", context);
1188
- if (!addNodeView) {
1189
- return [];
1190
- }
1191
- const nodeview = (node, view, getPos, decorations, innerDecorations) => {
1192
- const HTMLAttributes = getRenderedAttributes(node, extensionAttributes);
1193
- return addNodeView()({
1194
- // pass-through
1195
- node,
1196
- view,
1197
- getPos,
1198
- decorations,
1199
- innerDecorations,
1200
- // tiptap-specific
1201
- editor,
1202
- extension,
1203
- HTMLAttributes
1204
- });
1205
- };
1206
- return [extension.name, nodeview];
1207
- }));
1208
- }
1209
- /**
1210
- * Go through all extensions, create extension storages & setup marks
1211
- * & bind editor event listener.
1212
- */
1213
- setupExtensions() {
1214
- this.extensions.forEach((extension) => {
1215
- var _a;
1216
- this.editor.extensionStorage[extension.name] = extension.storage;
1217
- const context = {
1218
- name: extension.name,
1219
- options: extension.options,
1220
- storage: extension.storage,
1221
- editor: this.editor,
1222
- type: getSchemaTypeByName(extension.name, this.schema)
1223
- };
1224
- if (extension.type === "mark") {
1225
- const keepOnSplit = (_a = callOrReturn(getExtensionField(extension, "keepOnSplit", context))) !== null && _a !== void 0 ? _a : true;
1226
- if (keepOnSplit) {
1227
- this.splittableMarks.push(extension.name);
1228
- }
1229
- }
1230
- const onBeforeCreate = getExtensionField(extension, "onBeforeCreate", context);
1231
- const onCreate = getExtensionField(extension, "onCreate", context);
1232
- const onUpdate = getExtensionField(extension, "onUpdate", context);
1233
- const onSelectionUpdate = getExtensionField(extension, "onSelectionUpdate", context);
1234
- const onTransaction = getExtensionField(extension, "onTransaction", context);
1235
- const onFocus = getExtensionField(extension, "onFocus", context);
1236
- const onBlur = getExtensionField(extension, "onBlur", context);
1237
- const onDestroy = getExtensionField(extension, "onDestroy", context);
1238
- if (onBeforeCreate) {
1239
- this.editor.on("beforeCreate", onBeforeCreate);
1240
- }
1241
- if (onCreate) {
1242
- this.editor.on("create", onCreate);
1243
- }
1244
- if (onUpdate) {
1245
- this.editor.on("update", onUpdate);
1246
- }
1247
- if (onSelectionUpdate) {
1248
- this.editor.on("selectionUpdate", onSelectionUpdate);
1249
- }
1250
- if (onTransaction) {
1251
- this.editor.on("transaction", onTransaction);
1252
- }
1253
- if (onFocus) {
1254
- this.editor.on("focus", onFocus);
1255
- }
1256
- if (onBlur) {
1257
- this.editor.on("blur", onBlur);
1258
- }
1259
- if (onDestroy) {
1260
- this.editor.on("destroy", onDestroy);
1261
- }
1262
- });
1263
- }
1264
- }
1265
- class Extension {
1266
- constructor(config = {}) {
1267
- this.type = "extension";
1268
- this.name = "extension";
1269
- this.parent = null;
1270
- this.child = null;
1271
- this.config = {
1272
- name: this.name,
1273
- defaultOptions: {}
1274
- };
1275
- this.config = {
1276
- ...this.config,
1277
- ...config
1278
- };
1279
- this.name = this.config.name;
1280
- if (config.defaultOptions && Object.keys(config.defaultOptions).length > 0) {
1281
- console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`);
1282
- }
1283
- this.options = this.config.defaultOptions;
1284
- if (this.config.addOptions) {
1285
- this.options = callOrReturn(getExtensionField(this, "addOptions", {
1286
- name: this.name
1287
- }));
1288
- }
1289
- this.storage = callOrReturn(getExtensionField(this, "addStorage", {
1290
- name: this.name,
1291
- options: this.options
1292
- })) || {};
1293
- }
1294
- static create(config = {}) {
1295
- return new Extension(config);
1296
- }
1297
- configure(options = {}) {
1298
- const extension = this.extend({
1299
- ...this.config,
1300
- addOptions: () => {
1301
- return mergeDeep(this.options, options);
1302
- }
1303
- });
1304
- extension.name = this.name;
1305
- extension.parent = this.parent;
1306
- return extension;
1307
- }
1308
- extend(extendedConfig = {}) {
1309
- const extension = new Extension({ ...this.config, ...extendedConfig });
1310
- extension.parent = this;
1311
- this.child = extension;
1312
- extension.name = extendedConfig.name ? extendedConfig.name : extension.parent.name;
1313
- if (extendedConfig.defaultOptions && Object.keys(extendedConfig.defaultOptions).length > 0) {
1314
- console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${extension.name}".`);
1315
- }
1316
- extension.options = callOrReturn(getExtensionField(extension, "addOptions", {
1317
- name: extension.name
1318
- }));
1319
- extension.storage = callOrReturn(getExtensionField(extension, "addStorage", {
1320
- name: extension.name,
1321
- options: extension.options
1322
- }));
1323
- return extension;
1324
- }
1325
- }
1326
- function getTextBetween(startNode, range, options) {
1327
- const { from, to } = range;
1328
- const { blockSeparator = "\n\n", textSerializers = {} } = options || {};
1329
- let text = "";
1330
- startNode.nodesBetween(from, to, (node, pos, parent, index) => {
1331
- var _a;
1332
- if (node.isBlock && pos > from) {
1333
- text += blockSeparator;
1334
- }
1335
- const textSerializer = textSerializers === null || textSerializers === void 0 ? void 0 : textSerializers[node.type.name];
1336
- if (textSerializer) {
1337
- if (parent) {
1338
- text += textSerializer({
1339
- node,
1340
- pos,
1341
- parent,
1342
- index,
1343
- range
1344
- });
1345
- }
1346
- return false;
1347
- }
1348
- if (node.isText) {
1349
- text += (_a = node === null || node === void 0 ? void 0 : node.text) === null || _a === void 0 ? void 0 : _a.slice(Math.max(from, pos) - pos, to - pos);
1350
- }
1351
- });
1352
- return text;
1353
- }
1354
- function getTextSerializersFromSchema(schema) {
1355
- return Object.fromEntries(Object.entries(schema.nodes).filter(([, node]) => node.spec.toText).map(([name, node]) => [name, node.spec.toText]));
1356
- }
1357
- const ClipboardTextSerializer = Extension.create({
1358
- name: "clipboardTextSerializer",
1359
- addOptions() {
1360
- return {
1361
- blockSeparator: void 0
1362
- };
1363
- },
1364
- addProseMirrorPlugins() {
1365
- return [
1366
- new Plugin({
1367
- key: new PluginKey("clipboardTextSerializer"),
1368
- props: {
1369
- clipboardTextSerializer: () => {
1370
- const { editor } = this;
1371
- const { state, schema } = editor;
1372
- const { doc, selection } = state;
1373
- const { ranges } = selection;
1374
- const from = Math.min(...ranges.map((range2) => range2.$from.pos));
1375
- const to = Math.max(...ranges.map((range2) => range2.$to.pos));
1376
- const textSerializers = getTextSerializersFromSchema(schema);
1377
- const range = { from, to };
1378
- return getTextBetween(doc, range, {
1379
- ...this.options.blockSeparator !== void 0 ? { blockSeparator: this.options.blockSeparator } : {},
1380
- textSerializers
1381
- });
1382
- }
1383
- }
1384
- })
1385
- ];
1386
- }
1387
- });
1388
- const blur = () => ({ editor, view }) => {
1389
- requestAnimationFrame(() => {
1390
- var _a;
1391
- if (!editor.isDestroyed) {
1392
- view.dom.blur();
1393
- (_a = window === null || window === void 0 ? void 0 : window.getSelection()) === null || _a === void 0 ? void 0 : _a.removeAllRanges();
1394
- }
1395
- });
1396
- return true;
1397
- };
1398
- const clearContent = (emitUpdate = false) => ({ commands: commands2 }) => {
1399
- return commands2.setContent("", emitUpdate);
1400
- };
1401
- const clearNodes = () => ({ state, tr, dispatch }) => {
1402
- const { selection } = tr;
1403
- const { ranges } = selection;
1404
- if (!dispatch) {
1405
- return true;
1406
- }
1407
- ranges.forEach(({ $from, $to }) => {
1408
- state.doc.nodesBetween($from.pos, $to.pos, (node, pos) => {
1409
- if (node.type.isText) {
1410
- return;
1411
- }
1412
- const { doc, mapping } = tr;
1413
- const $mappedFrom = doc.resolve(mapping.map(pos));
1414
- const $mappedTo = doc.resolve(mapping.map(pos + node.nodeSize));
1415
- const nodeRange = $mappedFrom.blockRange($mappedTo);
1416
- if (!nodeRange) {
1417
- return;
1418
- }
1419
- const targetLiftDepth = liftTarget(nodeRange);
1420
- if (node.type.isTextblock) {
1421
- const { defaultType } = $mappedFrom.parent.contentMatchAt($mappedFrom.index());
1422
- tr.setNodeMarkup(nodeRange.start, defaultType);
1423
- }
1424
- if (targetLiftDepth || targetLiftDepth === 0) {
1425
- tr.lift(nodeRange, targetLiftDepth);
1426
- }
1427
- });
1428
- });
1429
- return true;
1430
- };
1431
- const command = (fn) => (props) => {
1432
- return fn(props);
1433
- };
1434
- const createParagraphNear = () => ({ state, dispatch }) => {
1435
- return createParagraphNear$1(state, dispatch);
1436
- };
1437
- const cut = (originRange, targetPos) => ({ editor, tr }) => {
1438
- const { state } = editor;
1439
- const contentSlice = state.doc.slice(originRange.from, originRange.to);
1440
- tr.deleteRange(originRange.from, originRange.to);
1441
- const newPos = tr.mapping.map(targetPos);
1442
- tr.insert(newPos, contentSlice.content);
1443
- tr.setSelection(new TextSelection(tr.doc.resolve(newPos - 1)));
1444
- return true;
1445
- };
1446
- const deleteCurrentNode = () => ({ tr, dispatch }) => {
1447
- const { selection } = tr;
1448
- const currentNode = selection.$anchor.node();
1449
- if (currentNode.content.size > 0) {
1450
- return false;
1451
- }
1452
- const $pos = tr.selection.$anchor;
1453
- for (let depth = $pos.depth; depth > 0; depth -= 1) {
1454
- const node = $pos.node(depth);
1455
- if (node.type === currentNode.type) {
1456
- if (dispatch) {
1457
- const from = $pos.before(depth);
1458
- const to = $pos.after(depth);
1459
- tr.delete(from, to).scrollIntoView();
1460
- }
1461
- return true;
1462
- }
1463
- }
1464
- return false;
1465
- };
1466
- const deleteNode = (typeOrName) => ({ tr, state, dispatch }) => {
1467
- const type = getNodeType(typeOrName, state.schema);
1468
- const $pos = tr.selection.$anchor;
1469
- for (let depth = $pos.depth; depth > 0; depth -= 1) {
1470
- const node = $pos.node(depth);
1471
- if (node.type === type) {
1472
- if (dispatch) {
1473
- const from = $pos.before(depth);
1474
- const to = $pos.after(depth);
1475
- tr.delete(from, to).scrollIntoView();
1476
- }
1477
- return true;
1478
- }
1479
- }
1480
- return false;
1481
- };
1482
- const deleteRange = (range) => ({ tr, dispatch }) => {
1483
- const { from, to } = range;
1484
- if (dispatch) {
1485
- tr.delete(from, to);
1486
- }
1487
- return true;
1488
- };
1489
- const deleteSelection = () => ({ state, dispatch }) => {
1490
- return deleteSelection$1(state, dispatch);
1491
- };
1492
- const enter = () => ({ commands: commands2 }) => {
1493
- return commands2.keyboardShortcut("Enter");
1494
- };
1495
- const exitCode = () => ({ state, dispatch }) => {
1496
- return exitCode$1(state, dispatch);
1497
- };
1498
- function objectIncludes(object1, object2, options = { strict: true }) {
1499
- const keys = Object.keys(object2);
1500
- if (!keys.length) {
1501
- return true;
1502
- }
1503
- return keys.every((key) => {
1504
- if (options.strict) {
1505
- return object2[key] === object1[key];
1506
- }
1507
- if (isRegExp(object2[key])) {
1508
- return object2[key].test(object1[key]);
1509
- }
1510
- return object2[key] === object1[key];
1511
- });
1512
- }
1513
- function findMarkInSet(marks, type, attributes = {}) {
1514
- return marks.find((item) => {
1515
- return item.type === type && objectIncludes(
1516
- // Only check equality for the attributes that are provided
1517
- Object.fromEntries(Object.keys(attributes).map((k) => [k, item.attrs[k]])),
1518
- attributes
1519
- );
1520
- });
1521
- }
1522
- function isMarkInSet(marks, type, attributes = {}) {
1523
- return !!findMarkInSet(marks, type, attributes);
1524
- }
1525
- function getMarkRange($pos, type, attributes) {
1526
- var _a;
1527
- if (!$pos || !type) {
1528
- return;
1529
- }
1530
- let start = $pos.parent.childAfter($pos.parentOffset);
1531
- if (!start.node || !start.node.marks.some((mark2) => mark2.type === type)) {
1532
- start = $pos.parent.childBefore($pos.parentOffset);
1533
- }
1534
- if (!start.node || !start.node.marks.some((mark2) => mark2.type === type)) {
1535
- return;
1536
- }
1537
- attributes = attributes || ((_a = start.node.marks[0]) === null || _a === void 0 ? void 0 : _a.attrs);
1538
- const mark = findMarkInSet([...start.node.marks], type, attributes);
1539
- if (!mark) {
1540
- return;
1541
- }
1542
- let startIndex = start.index;
1543
- let startPos = $pos.start() + start.offset;
1544
- let endIndex = startIndex + 1;
1545
- let endPos = startPos + start.node.nodeSize;
1546
- while (startIndex > 0 && isMarkInSet([...$pos.parent.child(startIndex - 1).marks], type, attributes)) {
1547
- startIndex -= 1;
1548
- startPos -= $pos.parent.child(startIndex).nodeSize;
1549
- }
1550
- while (endIndex < $pos.parent.childCount && isMarkInSet([...$pos.parent.child(endIndex).marks], type, attributes)) {
1551
- endPos += $pos.parent.child(endIndex).nodeSize;
1552
- endIndex += 1;
1553
- }
1554
- return {
1555
- from: startPos,
1556
- to: endPos
1557
- };
1558
- }
1559
- function getMarkType(nameOrType, schema) {
1560
- if (typeof nameOrType === "string") {
1561
- if (!schema.marks[nameOrType]) {
1562
- throw Error(`There is no mark type named '${nameOrType}'. Maybe you forgot to add the extension?`);
1563
- }
1564
- return schema.marks[nameOrType];
1565
- }
1566
- return nameOrType;
1567
- }
1568
- const extendMarkRange = (typeOrName, attributes = {}) => ({ tr, state, dispatch }) => {
1569
- const type = getMarkType(typeOrName, state.schema);
1570
- const { doc, selection } = tr;
1571
- const { $from, from, to } = selection;
1572
- if (dispatch) {
1573
- const range = getMarkRange($from, type, attributes);
1574
- if (range && range.from <= from && range.to >= to) {
1575
- const newSelection = TextSelection.create(doc, range.from, range.to);
1576
- tr.setSelection(newSelection);
1577
- }
1578
- }
1579
- return true;
1580
- };
1581
- const first = (commands2) => (props) => {
1582
- const items = typeof commands2 === "function" ? commands2(props) : commands2;
1583
- for (let i = 0; i < items.length; i += 1) {
1584
- if (items[i](props)) {
1585
- return true;
1586
- }
1587
- }
1588
- return false;
1589
- };
1590
- function isTextSelection(value) {
1591
- return value instanceof TextSelection;
1592
- }
1593
- function minMax(value = 0, min = 0, max = 0) {
1594
- return Math.min(Math.max(value, min), max);
1595
- }
1596
- function resolveFocusPosition(doc, position = null) {
1597
- if (!position) {
1598
- return null;
1599
- }
1600
- const selectionAtStart = Selection.atStart(doc);
1601
- const selectionAtEnd = Selection.atEnd(doc);
1602
- if (position === "start" || position === true) {
1603
- return selectionAtStart;
1604
- }
1605
- if (position === "end") {
1606
- return selectionAtEnd;
1607
- }
1608
- const minPos = selectionAtStart.from;
1609
- const maxPos = selectionAtEnd.to;
1610
- if (position === "all") {
1611
- return TextSelection.create(doc, minMax(0, minPos, maxPos), minMax(doc.content.size, minPos, maxPos));
1612
- }
1613
- return TextSelection.create(doc, minMax(position, minPos, maxPos), minMax(position, minPos, maxPos));
1614
- }
1615
- function isAndroid() {
1616
- return navigator.platform === "Android" || /android/i.test(navigator.userAgent);
1617
- }
1618
- function isiOS() {
1619
- return [
1620
- "iPad Simulator",
1621
- "iPhone Simulator",
1622
- "iPod Simulator",
1623
- "iPad",
1624
- "iPhone",
1625
- "iPod"
1626
- ].includes(navigator.platform) || navigator.userAgent.includes("Mac") && "ontouchend" in document;
1627
- }
1628
- const focus = (position = null, options = {}) => ({ editor, view, tr, dispatch }) => {
1629
- options = {
1630
- scrollIntoView: true,
1631
- ...options
1632
- };
1633
- const delayedFocus = () => {
1634
- if (isiOS() || isAndroid()) {
1635
- view.dom.focus();
1636
- }
1637
- requestAnimationFrame(() => {
1638
- if (!editor.isDestroyed) {
1639
- view.focus();
1640
- if (options === null || options === void 0 ? void 0 : options.scrollIntoView) {
1641
- editor.commands.scrollIntoView();
1642
- }
1643
- }
1644
- });
1645
- };
1646
- if (view.hasFocus() && position === null || position === false) {
1647
- return true;
1648
- }
1649
- if (dispatch && position === null && !isTextSelection(editor.state.selection)) {
1650
- delayedFocus();
1651
- return true;
1652
- }
1653
- const selection = resolveFocusPosition(tr.doc, position) || editor.state.selection;
1654
- const isSameSelection = editor.state.selection.eq(selection);
1655
- if (dispatch) {
1656
- if (!isSameSelection) {
1657
- tr.setSelection(selection);
1658
- }
1659
- if (isSameSelection && tr.storedMarks) {
1660
- tr.setStoredMarks(tr.storedMarks);
1661
- }
1662
- delayedFocus();
1663
- }
1664
- return true;
1665
- };
1666
- const forEach = (items, fn) => (props) => {
1667
- return items.every((item, index) => fn(item, { ...props, index }));
1668
- };
1669
- const insertContent = (value, options) => ({ tr, commands: commands2 }) => {
1670
- return commands2.insertContentAt({ from: tr.selection.from, to: tr.selection.to }, value, options);
1671
- };
1672
- const removeWhitespaces = (node) => {
1673
- const children = node.childNodes;
1674
- for (let i = children.length - 1; i >= 0; i -= 1) {
1675
- const child = children[i];
1676
- if (child.nodeType === 3 && child.nodeValue && /^(\n\s\s|\n)$/.test(child.nodeValue)) {
1677
- node.removeChild(child);
1678
- } else if (child.nodeType === 1) {
1679
- removeWhitespaces(child);
1680
- }
1681
- }
1682
- return node;
1683
- };
1684
- function elementFromString(value) {
1685
- const wrappedValue = `<body>${value}</body>`;
1686
- const html = new window.DOMParser().parseFromString(wrappedValue, "text/html").body;
1687
- return removeWhitespaces(html);
1688
- }
1689
- function createNodeFromContent(content, schema, options) {
1690
- if (content instanceof Node$1 || content instanceof Fragment) {
1691
- return content;
1692
- }
1693
- options = {
1694
- slice: true,
1695
- parseOptions: {},
1696
- ...options
1697
- };
1698
- const isJSONContent = typeof content === "object" && content !== null;
1699
- const isTextContent = typeof content === "string";
1700
- if (isJSONContent) {
1701
- try {
1702
- const isArrayContent = Array.isArray(content) && content.length > 0;
1703
- if (isArrayContent) {
1704
- return Fragment.fromArray(content.map((item) => schema.nodeFromJSON(item)));
1705
- }
1706
- const node = schema.nodeFromJSON(content);
1707
- if (options.errorOnInvalidContent) {
1708
- node.check();
1709
- }
1710
- return node;
1711
- } catch (error) {
1712
- if (options.errorOnInvalidContent) {
1713
- throw new Error("[tiptap error]: Invalid JSON content", { cause: error });
1714
- }
1715
- console.warn("[tiptap warn]: Invalid content.", "Passed value:", content, "Error:", error);
1716
- return createNodeFromContent("", schema, options);
1717
- }
1718
- }
1719
- if (isTextContent) {
1720
- if (options.errorOnInvalidContent) {
1721
- let hasInvalidContent = false;
1722
- let invalidContent = "";
1723
- const contentCheckSchema = new Schema({
1724
- topNode: schema.spec.topNode,
1725
- marks: schema.spec.marks,
1726
- // Prosemirror's schemas are executed such that: the last to execute, matches last
1727
- // This means that we can add a catch-all node at the end of the schema to catch any content that we don't know how to handle
1728
- nodes: schema.spec.nodes.append({
1729
- __tiptap__private__unknown__catch__all__node: {
1730
- content: "inline*",
1731
- group: "block",
1732
- parseDOM: [
1733
- {
1734
- tag: "*",
1735
- getAttrs: (e) => {
1736
- hasInvalidContent = true;
1737
- invalidContent = typeof e === "string" ? e : e.outerHTML;
1738
- return null;
1739
- }
1740
- }
1741
- ]
1742
- }
1743
- })
1744
- });
1745
- if (options.slice) {
1746
- DOMParser.fromSchema(contentCheckSchema).parseSlice(elementFromString(content), options.parseOptions);
1747
- } else {
1748
- DOMParser.fromSchema(contentCheckSchema).parse(elementFromString(content), options.parseOptions);
1749
- }
1750
- if (options.errorOnInvalidContent && hasInvalidContent) {
1751
- throw new Error("[tiptap error]: Invalid HTML content", { cause: new Error(`Invalid element found: ${invalidContent}`) });
1752
- }
1753
- }
1754
- const parser = DOMParser.fromSchema(schema);
1755
- if (options.slice) {
1756
- return parser.parseSlice(elementFromString(content), options.parseOptions).content;
1757
- }
1758
- return parser.parse(elementFromString(content), options.parseOptions);
1759
- }
1760
- return createNodeFromContent("", schema, options);
1761
- }
1762
- function selectionToInsertionEnd(tr, startLen, bias) {
1763
- const last = tr.steps.length - 1;
1764
- if (last < startLen) {
1765
- return;
1766
- }
1767
- const step = tr.steps[last];
1768
- if (!(step instanceof ReplaceStep || step instanceof ReplaceAroundStep)) {
1769
- return;
1770
- }
1771
- const map = tr.mapping.maps[last];
1772
- let end = 0;
1773
- map.forEach((_from, _to, _newFrom, newTo) => {
1774
- if (end === 0) {
1775
- end = newTo;
1776
- }
1777
- });
1778
- tr.setSelection(Selection.near(tr.doc.resolve(end), bias));
1779
- }
1780
- const isFragment = (nodeOrFragment) => {
1781
- return !("type" in nodeOrFragment);
1782
- };
1783
- const insertContentAt = (position, value, options) => ({ tr, dispatch, editor }) => {
1784
- var _a;
1785
- if (dispatch) {
1786
- options = {
1787
- parseOptions: editor.options.parseOptions,
1788
- updateSelection: true,
1789
- applyInputRules: false,
1790
- applyPasteRules: false,
1791
- ...options
1792
- };
1793
- let content;
1794
- try {
1795
- content = createNodeFromContent(value, editor.schema, {
1796
- parseOptions: {
1797
- preserveWhitespace: "full",
1798
- ...options.parseOptions
1799
- },
1800
- errorOnInvalidContent: (_a = options.errorOnInvalidContent) !== null && _a !== void 0 ? _a : editor.options.enableContentCheck
1801
- });
1802
- } catch (e) {
1803
- editor.emit("contentError", {
1804
- editor,
1805
- error: e,
1806
- disableCollaboration: () => {
1807
- if (editor.storage.collaboration) {
1808
- editor.storage.collaboration.isDisabled = true;
1809
- }
1810
- }
1811
- });
1812
- return false;
1813
- }
1814
- let { from, to } = typeof position === "number" ? { from: position, to: position } : { from: position.from, to: position.to };
1815
- let isOnlyTextContent = true;
1816
- let isOnlyBlockContent = true;
1817
- const nodes = isFragment(content) ? content : [content];
1818
- nodes.forEach((node) => {
1819
- node.check();
1820
- isOnlyTextContent = isOnlyTextContent ? node.isText && node.marks.length === 0 : false;
1821
- isOnlyBlockContent = isOnlyBlockContent ? node.isBlock : false;
1822
- });
1823
- if (from === to && isOnlyBlockContent) {
1824
- const { parent } = tr.doc.resolve(from);
1825
- const isEmptyTextBlock = parent.isTextblock && !parent.type.spec.code && !parent.childCount;
1826
- if (isEmptyTextBlock) {
1827
- from -= 1;
1828
- to += 1;
1829
- }
1830
- }
1831
- let newContent;
1832
- if (isOnlyTextContent) {
1833
- if (Array.isArray(value)) {
1834
- newContent = value.map((v) => v.text || "").join("");
1835
- } else if (value instanceof Fragment) {
1836
- let text = "";
1837
- value.forEach((node) => {
1838
- if (node.text) {
1839
- text += node.text;
1840
- }
1841
- });
1842
- newContent = text;
1843
- } else if (typeof value === "object" && !!value && !!value.text) {
1844
- newContent = value.text;
1845
- } else {
1846
- newContent = value;
1847
- }
1848
- tr.insertText(newContent, from, to);
1849
- } else {
1850
- newContent = content;
1851
- tr.replaceWith(from, to, newContent);
1852
- }
1853
- if (options.updateSelection) {
1854
- selectionToInsertionEnd(tr, tr.steps.length - 1, -1);
1855
- }
1856
- if (options.applyInputRules) {
1857
- tr.setMeta("applyInputRules", { from, text: newContent });
1858
- }
1859
- if (options.applyPasteRules) {
1860
- tr.setMeta("applyPasteRules", { from, text: newContent });
1861
- }
1862
- }
1863
- return true;
1864
- };
1865
- const joinUp = () => ({ state, dispatch }) => {
1866
- return joinUp$1(state, dispatch);
1867
- };
1868
- const joinDown = () => ({ state, dispatch }) => {
1869
- return joinDown$1(state, dispatch);
1870
- };
1871
- const joinBackward = () => ({ state, dispatch }) => {
1872
- return joinBackward$1(state, dispatch);
1873
- };
1874
- const joinForward = () => ({ state, dispatch }) => {
1875
- return joinForward$1(state, dispatch);
1876
- };
1877
- const joinItemBackward = () => ({ state, dispatch, tr }) => {
1878
- try {
1879
- const point = joinPoint(state.doc, state.selection.$from.pos, -1);
1880
- if (point === null || point === void 0) {
1881
- return false;
1882
- }
1883
- tr.join(point, 2);
1884
- if (dispatch) {
1885
- dispatch(tr);
1886
- }
1887
- return true;
1888
- } catch {
1889
- return false;
1890
- }
1891
- };
1892
- const joinItemForward = () => ({ state, dispatch, tr }) => {
1893
- try {
1894
- const point = joinPoint(state.doc, state.selection.$from.pos, 1);
1895
- if (point === null || point === void 0) {
1896
- return false;
1897
- }
1898
- tr.join(point, 2);
1899
- if (dispatch) {
1900
- dispatch(tr);
1901
- }
1902
- return true;
1903
- } catch {
1904
- return false;
1905
- }
1906
- };
1907
- const joinTextblockBackward = () => ({ state, dispatch }) => {
1908
- return joinTextblockBackward$1(state, dispatch);
1909
- };
1910
- const joinTextblockForward = () => ({ state, dispatch }) => {
1911
- return joinTextblockForward$1(state, dispatch);
1912
- };
1913
- function isMacOS() {
1914
- return typeof navigator !== "undefined" ? /Mac/.test(navigator.platform) : false;
1915
- }
1916
- function normalizeKeyName(name) {
1917
- const parts = name.split(/-(?!$)/);
1918
- let result = parts[parts.length - 1];
1919
- if (result === "Space") {
1920
- result = " ";
1921
- }
1922
- let alt;
1923
- let ctrl;
1924
- let shift;
1925
- let meta;
1926
- for (let i = 0; i < parts.length - 1; i += 1) {
1927
- const mod = parts[i];
1928
- if (/^(cmd|meta|m)$/i.test(mod)) {
1929
- meta = true;
1930
- } else if (/^a(lt)?$/i.test(mod)) {
1931
- alt = true;
1932
- } else if (/^(c|ctrl|control)$/i.test(mod)) {
1933
- ctrl = true;
1934
- } else if (/^s(hift)?$/i.test(mod)) {
1935
- shift = true;
1936
- } else if (/^mod$/i.test(mod)) {
1937
- if (isiOS() || isMacOS()) {
1938
- meta = true;
1939
- } else {
1940
- ctrl = true;
1941
- }
1942
- } else {
1943
- throw new Error(`Unrecognized modifier name: ${mod}`);
1944
- }
1945
- }
1946
- if (alt) {
1947
- result = `Alt-${result}`;
1948
- }
1949
- if (ctrl) {
1950
- result = `Ctrl-${result}`;
1951
- }
1952
- if (meta) {
1953
- result = `Meta-${result}`;
1954
- }
1955
- if (shift) {
1956
- result = `Shift-${result}`;
1957
- }
1958
- return result;
1959
- }
1960
- const keyboardShortcut = (name) => ({ editor, view, tr, dispatch }) => {
1961
- const keys = normalizeKeyName(name).split(/-(?!$)/);
1962
- const key = keys.find((item) => !["Alt", "Ctrl", "Meta", "Shift"].includes(item));
1963
- const event = new KeyboardEvent("keydown", {
1964
- key: key === "Space" ? " " : key,
1965
- altKey: keys.includes("Alt"),
1966
- ctrlKey: keys.includes("Ctrl"),
1967
- metaKey: keys.includes("Meta"),
1968
- shiftKey: keys.includes("Shift"),
1969
- bubbles: true,
1970
- cancelable: true
1971
- });
1972
- const capturedTransaction = editor.captureTransaction(() => {
1973
- view.someProp("handleKeyDown", (f) => f(view, event));
1974
- });
1975
- capturedTransaction === null || capturedTransaction === void 0 ? void 0 : capturedTransaction.steps.forEach((step) => {
1976
- const newStep = step.map(tr.mapping);
1977
- if (newStep && dispatch) {
1978
- tr.maybeStep(newStep);
1979
- }
1980
- });
1981
- return true;
1982
- };
1983
- function isNodeActive(state, typeOrName, attributes = {}) {
1984
- const { from, to, empty } = state.selection;
1985
- const type = typeOrName ? getNodeType(typeOrName, state.schema) : null;
1986
- const nodeRanges = [];
1987
- state.doc.nodesBetween(from, to, (node, pos) => {
1988
- if (node.isText) {
1989
- return;
1990
- }
1991
- const relativeFrom = Math.max(from, pos);
1992
- const relativeTo = Math.min(to, pos + node.nodeSize);
1993
- nodeRanges.push({
1994
- node,
1995
- from: relativeFrom,
1996
- to: relativeTo
1997
- });
1998
- });
1999
- const selectionRange = to - from;
2000
- const matchedNodeRanges = nodeRanges.filter((nodeRange) => {
2001
- if (!type) {
2002
- return true;
2003
- }
2004
- return type.name === nodeRange.node.type.name;
2005
- }).filter((nodeRange) => objectIncludes(nodeRange.node.attrs, attributes, { strict: false }));
2006
- if (empty) {
2007
- return !!matchedNodeRanges.length;
2008
- }
2009
- const range = matchedNodeRanges.reduce((sum, nodeRange) => sum + nodeRange.to - nodeRange.from, 0);
2010
- return range >= selectionRange;
2011
- }
2012
- const lift = (typeOrName, attributes = {}) => ({ state, dispatch }) => {
2013
- const type = getNodeType(typeOrName, state.schema);
2014
- const isActive2 = isNodeActive(state, type, attributes);
2015
- if (!isActive2) {
2016
- return false;
2017
- }
2018
- return lift$1(state, dispatch);
2019
- };
2020
- const liftEmptyBlock = () => ({ state, dispatch }) => {
2021
- return liftEmptyBlock$1(state, dispatch);
2022
- };
2023
- const liftListItem = (typeOrName) => ({ state, dispatch }) => {
2024
- const type = getNodeType(typeOrName, state.schema);
2025
- return liftListItem$1(type)(state, dispatch);
2026
- };
2027
- const newlineInCode = () => ({ state, dispatch }) => {
2028
- return newlineInCode$1(state, dispatch);
2029
- };
2030
- function getSchemaTypeNameByName(name, schema) {
2031
- if (schema.nodes[name]) {
2032
- return "node";
2033
- }
2034
- if (schema.marks[name]) {
2035
- return "mark";
2036
- }
2037
- return null;
2038
- }
2039
- function deleteProps(obj, propOrProps) {
2040
- const props = typeof propOrProps === "string" ? [propOrProps] : propOrProps;
2041
- return Object.keys(obj).reduce((newObj, prop) => {
2042
- if (!props.includes(prop)) {
2043
- newObj[prop] = obj[prop];
2044
- }
2045
- return newObj;
2046
- }, {});
2047
- }
2048
- const resetAttributes = (typeOrName, attributes) => ({ tr, state, dispatch }) => {
2049
- let nodeType = null;
2050
- let markType = null;
2051
- const schemaType = getSchemaTypeNameByName(typeof typeOrName === "string" ? typeOrName : typeOrName.name, state.schema);
2052
- if (!schemaType) {
2053
- return false;
2054
- }
2055
- if (schemaType === "node") {
2056
- nodeType = getNodeType(typeOrName, state.schema);
2057
- }
2058
- if (schemaType === "mark") {
2059
- markType = getMarkType(typeOrName, state.schema);
2060
- }
2061
- if (dispatch) {
2062
- tr.selection.ranges.forEach((range) => {
2063
- state.doc.nodesBetween(range.$from.pos, range.$to.pos, (node, pos) => {
2064
- if (nodeType && nodeType === node.type) {
2065
- tr.setNodeMarkup(pos, void 0, deleteProps(node.attrs, attributes));
2066
- }
2067
- if (markType && node.marks.length) {
2068
- node.marks.forEach((mark) => {
2069
- if (markType === mark.type) {
2070
- tr.addMark(pos, pos + node.nodeSize, markType.create(deleteProps(mark.attrs, attributes)));
2071
- }
2072
- });
2073
- }
2074
- });
2075
- });
2076
- }
2077
- return true;
2078
- };
2079
- const scrollIntoView = () => ({ tr, dispatch }) => {
2080
- if (dispatch) {
2081
- tr.scrollIntoView();
2082
- }
2083
- return true;
2084
- };
2085
- const selectAll = () => ({ tr, dispatch }) => {
2086
- if (dispatch) {
2087
- const selection = new AllSelection(tr.doc);
2088
- tr.setSelection(selection);
2089
- }
2090
- return true;
2091
- };
2092
- const selectNodeBackward = () => ({ state, dispatch }) => {
2093
- return selectNodeBackward$1(state, dispatch);
2094
- };
2095
- const selectNodeForward = () => ({ state, dispatch }) => {
2096
- return selectNodeForward$1(state, dispatch);
2097
- };
2098
- const selectParentNode = () => ({ state, dispatch }) => {
2099
- return selectParentNode$1(state, dispatch);
2100
- };
2101
- const selectTextblockEnd = () => ({ state, dispatch }) => {
2102
- return selectTextblockEnd$1(state, dispatch);
2103
- };
2104
- const selectTextblockStart = () => ({ state, dispatch }) => {
2105
- return selectTextblockStart$1(state, dispatch);
2106
- };
2107
- function createDocument(content, schema, parseOptions = {}, options = {}) {
2108
- return createNodeFromContent(content, schema, {
2109
- slice: false,
2110
- parseOptions,
2111
- errorOnInvalidContent: options.errorOnInvalidContent
2112
- });
2113
- }
2114
- const setContent = (content, emitUpdate = false, parseOptions = {}, options = {}) => ({ editor, tr, dispatch, commands: commands2 }) => {
2115
- var _a, _b;
2116
- const { doc } = tr;
2117
- if (parseOptions.preserveWhitespace !== "full") {
2118
- const document2 = createDocument(content, editor.schema, parseOptions, {
2119
- errorOnInvalidContent: (_a = options.errorOnInvalidContent) !== null && _a !== void 0 ? _a : editor.options.enableContentCheck
2120
- });
2121
- if (dispatch) {
2122
- tr.replaceWith(0, doc.content.size, document2).setMeta("preventUpdate", !emitUpdate);
2123
- }
2124
- return true;
2125
- }
2126
- if (dispatch) {
2127
- tr.setMeta("preventUpdate", !emitUpdate);
2128
- }
2129
- return commands2.insertContentAt({ from: 0, to: doc.content.size }, content, {
2130
- parseOptions,
2131
- errorOnInvalidContent: (_b = options.errorOnInvalidContent) !== null && _b !== void 0 ? _b : editor.options.enableContentCheck
2132
- });
2133
- };
2134
- function getMarkAttributes(state, typeOrName) {
2135
- const type = getMarkType(typeOrName, state.schema);
2136
- const { from, to, empty } = state.selection;
2137
- const marks = [];
2138
- if (empty) {
2139
- if (state.storedMarks) {
2140
- marks.push(...state.storedMarks);
2141
- }
2142
- marks.push(...state.selection.$head.marks());
2143
- } else {
2144
- state.doc.nodesBetween(from, to, (node) => {
2145
- marks.push(...node.marks);
2146
- });
2147
- }
2148
- const mark = marks.find((markItem) => markItem.type.name === type.name);
2149
- if (!mark) {
2150
- return {};
2151
- }
2152
- return { ...mark.attrs };
2153
- }
2154
- function combineTransactionSteps(oldDoc, transactions) {
2155
- const transform = new Transform(oldDoc);
2156
- transactions.forEach((transaction) => {
2157
- transaction.steps.forEach((step) => {
2158
- transform.step(step);
2159
- });
2160
- });
2161
- return transform;
2162
- }
2163
- function defaultBlockAt(match) {
2164
- for (let i = 0; i < match.edgeCount; i += 1) {
2165
- const { type } = match.edge(i);
2166
- if (type.isTextblock && !type.hasRequiredAttrs()) {
2167
- return type;
2168
- }
2169
- }
2170
- return null;
2171
- }
2172
- function findChildrenInRange(node, range, predicate) {
2173
- const nodesWithPos = [];
2174
- node.nodesBetween(range.from, range.to, (child, pos) => {
2175
- if (predicate(child)) {
2176
- nodesWithPos.push({
2177
- node: child,
2178
- pos
2179
- });
2180
- }
2181
- });
2182
- return nodesWithPos;
2183
- }
2184
- function findParentNodeClosestToPos($pos, predicate) {
2185
- for (let i = $pos.depth; i > 0; i -= 1) {
2186
- const node = $pos.node(i);
2187
- if (predicate(node)) {
2188
- return {
2189
- pos: i > 0 ? $pos.before(i) : 0,
2190
- start: $pos.start(i),
2191
- depth: i,
2192
- node
2193
- };
2194
- }
2195
- }
2196
- }
2197
- function findParentNode(predicate) {
2198
- return (selection) => findParentNodeClosestToPos(selection.$from, predicate);
2199
- }
2200
- function getText(node, options) {
2201
- const range = {
2202
- from: 0,
2203
- to: node.content.size
2204
- };
2205
- return getTextBetween(node, range, options);
2206
- }
2207
- function getNodeAttributes(state, typeOrName) {
2208
- const type = getNodeType(typeOrName, state.schema);
2209
- const { from, to } = state.selection;
2210
- const nodes = [];
2211
- state.doc.nodesBetween(from, to, (node2) => {
2212
- nodes.push(node2);
2213
- });
2214
- const node = nodes.reverse().find((nodeItem) => nodeItem.type.name === type.name);
2215
- if (!node) {
2216
- return {};
2217
- }
2218
- return { ...node.attrs };
2219
- }
2220
- function getAttributes(state, typeOrName) {
2221
- const schemaType = getSchemaTypeNameByName(typeof typeOrName === "string" ? typeOrName : typeOrName.name, state.schema);
2222
- if (schemaType === "node") {
2223
- return getNodeAttributes(state, typeOrName);
2224
- }
2225
- if (schemaType === "mark") {
2226
- return getMarkAttributes(state, typeOrName);
2227
- }
2228
- return {};
2229
- }
2230
- function removeDuplicates(array, by = JSON.stringify) {
2231
- const seen = {};
2232
- return array.filter((item) => {
2233
- const key = by(item);
2234
- return Object.prototype.hasOwnProperty.call(seen, key) ? false : seen[key] = true;
2235
- });
2236
- }
2237
- function simplifyChangedRanges(changes) {
2238
- const uniqueChanges = removeDuplicates(changes);
2239
- return uniqueChanges.length === 1 ? uniqueChanges : uniqueChanges.filter((change, index) => {
2240
- const rest = uniqueChanges.filter((_, i) => i !== index);
2241
- return !rest.some((otherChange) => {
2242
- return change.oldRange.from >= otherChange.oldRange.from && change.oldRange.to <= otherChange.oldRange.to && change.newRange.from >= otherChange.newRange.from && change.newRange.to <= otherChange.newRange.to;
2243
- });
2244
- });
2245
- }
2246
- function getChangedRanges(transform) {
2247
- const { mapping, steps } = transform;
2248
- const changes = [];
2249
- mapping.maps.forEach((stepMap, index) => {
2250
- const ranges = [];
2251
- if (!stepMap.ranges.length) {
2252
- const { from, to } = steps[index];
2253
- if (from === void 0 || to === void 0) {
2254
- return;
2255
- }
2256
- ranges.push({ from, to });
2257
- } else {
2258
- stepMap.forEach((from, to) => {
2259
- ranges.push({ from, to });
2260
- });
2261
- }
2262
- ranges.forEach(({ from, to }) => {
2263
- const newStart = mapping.slice(index).map(from, -1);
2264
- const newEnd = mapping.slice(index).map(to);
2265
- const oldStart = mapping.invert().map(newStart, -1);
2266
- const oldEnd = mapping.invert().map(newEnd);
2267
- changes.push({
2268
- oldRange: {
2269
- from: oldStart,
2270
- to: oldEnd
2271
- },
2272
- newRange: {
2273
- from: newStart,
2274
- to: newEnd
2275
- }
2276
- });
2277
- });
2278
- });
2279
- return simplifyChangedRanges(changes);
2280
- }
2281
- function getMarksBetween(from, to, doc) {
2282
- const marks = [];
2283
- if (from === to) {
2284
- doc.resolve(from).marks().forEach((mark) => {
2285
- const $pos = doc.resolve(from);
2286
- const range = getMarkRange($pos, mark.type);
2287
- if (!range) {
2288
- return;
2289
- }
2290
- marks.push({
2291
- mark,
2292
- ...range
2293
- });
2294
- });
2295
- } else {
2296
- doc.nodesBetween(from, to, (node, pos) => {
2297
- if (!node || (node === null || node === void 0 ? void 0 : node.nodeSize) === void 0) {
2298
- return;
2299
- }
2300
- marks.push(...node.marks.map((mark) => ({
2301
- from: pos,
2302
- to: pos + node.nodeSize,
2303
- mark
2304
- })));
2305
- });
2306
- }
2307
- return marks;
2308
- }
2309
- function getSplittedAttributes(extensionAttributes, typeName, attributes) {
2310
- return Object.fromEntries(Object.entries(attributes).filter(([name]) => {
2311
- const extensionAttribute = extensionAttributes.find((item) => {
2312
- return item.type === typeName && item.name === name;
2313
- });
2314
- if (!extensionAttribute) {
2315
- return false;
2316
- }
2317
- return extensionAttribute.attribute.keepOnSplit;
2318
- }));
2319
- }
2320
- function isMarkActive(state, typeOrName, attributes = {}) {
2321
- const { empty, ranges } = state.selection;
2322
- const type = typeOrName ? getMarkType(typeOrName, state.schema) : null;
2323
- if (empty) {
2324
- return !!(state.storedMarks || state.selection.$from.marks()).filter((mark) => {
2325
- if (!type) {
2326
- return true;
2327
- }
2328
- return type.name === mark.type.name;
2329
- }).find((mark) => objectIncludes(mark.attrs, attributes, { strict: false }));
2330
- }
2331
- let selectionRange = 0;
2332
- const markRanges = [];
2333
- ranges.forEach(({ $from, $to }) => {
2334
- const from = $from.pos;
2335
- const to = $to.pos;
2336
- state.doc.nodesBetween(from, to, (node, pos) => {
2337
- if (!node.isText && !node.marks.length) {
2338
- return;
2339
- }
2340
- const relativeFrom = Math.max(from, pos);
2341
- const relativeTo = Math.min(to, pos + node.nodeSize);
2342
- const range2 = relativeTo - relativeFrom;
2343
- selectionRange += range2;
2344
- markRanges.push(...node.marks.map((mark) => ({
2345
- mark,
2346
- from: relativeFrom,
2347
- to: relativeTo
2348
- })));
2349
- });
2350
- });
2351
- if (selectionRange === 0) {
2352
- return false;
2353
- }
2354
- const matchedRange = markRanges.filter((markRange) => {
2355
- if (!type) {
2356
- return true;
2357
- }
2358
- return type.name === markRange.mark.type.name;
2359
- }).filter((markRange) => objectIncludes(markRange.mark.attrs, attributes, { strict: false })).reduce((sum, markRange) => sum + markRange.to - markRange.from, 0);
2360
- const excludedRange = markRanges.filter((markRange) => {
2361
- if (!type) {
2362
- return true;
2363
- }
2364
- return markRange.mark.type !== type && markRange.mark.type.excludes(type);
2365
- }).reduce((sum, markRange) => sum + markRange.to - markRange.from, 0);
2366
- const range = matchedRange > 0 ? matchedRange + excludedRange : matchedRange;
2367
- return range >= selectionRange;
2368
- }
2369
- function isActive(state, name, attributes = {}) {
2370
- if (!name) {
2371
- return isNodeActive(state, null, attributes) || isMarkActive(state, null, attributes);
2372
- }
2373
- const schemaType = getSchemaTypeNameByName(name, state.schema);
2374
- if (schemaType === "node") {
2375
- return isNodeActive(state, name, attributes);
2376
- }
2377
- if (schemaType === "mark") {
2378
- return isMarkActive(state, name, attributes);
2379
- }
2380
- return false;
2381
- }
2382
- function isList(name, extensions) {
2383
- const { nodeExtensions } = splitExtensions(extensions);
2384
- const extension = nodeExtensions.find((item) => item.name === name);
2385
- if (!extension) {
2386
- return false;
2387
- }
2388
- const context = {
2389
- name: extension.name,
2390
- options: extension.options,
2391
- storage: extension.storage
2392
- };
2393
- const group = callOrReturn(getExtensionField(extension, "group", context));
2394
- if (typeof group !== "string") {
2395
- return false;
2396
- }
2397
- return group.split(" ").includes("list");
2398
- }
2399
- function isNodeEmpty(node, { checkChildren = true, ignoreWhitespace = false } = {}) {
2400
- var _a;
2401
- if (ignoreWhitespace) {
2402
- if (node.type.name === "hardBreak") {
2403
- return true;
2404
- }
2405
- if (node.isText) {
2406
- return /^\s*$/m.test((_a = node.text) !== null && _a !== void 0 ? _a : "");
2407
- }
2408
- }
2409
- if (node.isText) {
2410
- return !node.text;
2411
- }
2412
- if (node.isAtom || node.isLeaf) {
2413
- return false;
2414
- }
2415
- if (node.content.childCount === 0) {
2416
- return true;
2417
- }
2418
- if (checkChildren) {
2419
- let isContentEmpty = true;
2420
- node.content.forEach((childNode) => {
2421
- if (isContentEmpty === false) {
2422
- return;
2423
- }
2424
- if (!isNodeEmpty(childNode, { ignoreWhitespace, checkChildren })) {
2425
- isContentEmpty = false;
2426
- }
2427
- });
2428
- return isContentEmpty;
2429
- }
2430
- return false;
2431
- }
2432
- function isNodeSelection(value) {
2433
- return value instanceof NodeSelection;
2434
- }
2435
- function posToDOMRect(view, from, to) {
2436
- const minPos = 0;
2437
- const maxPos = view.state.doc.content.size;
2438
- const resolvedFrom = minMax(from, minPos, maxPos);
2439
- const resolvedEnd = minMax(to, minPos, maxPos);
2440
- const start = view.coordsAtPos(resolvedFrom);
2441
- const end = view.coordsAtPos(resolvedEnd, -1);
2442
- const top = Math.min(start.top, end.top);
2443
- const bottom = Math.max(start.bottom, end.bottom);
2444
- const left = Math.min(start.left, end.left);
2445
- const right = Math.max(start.right, end.right);
2446
- const width = right - left;
2447
- const height = bottom - top;
2448
- const x = left;
2449
- const y = top;
2450
- const data = {
2451
- top,
2452
- bottom,
2453
- left,
2454
- right,
2455
- width,
2456
- height,
2457
- x,
2458
- y
2459
- };
2460
- return {
2461
- ...data,
2462
- toJSON: () => data
2463
- };
2464
- }
2465
- function canSetMark(state, tr, newMarkType) {
2466
- var _a;
2467
- const { selection } = tr;
2468
- let cursor = null;
2469
- if (isTextSelection(selection)) {
2470
- cursor = selection.$cursor;
2471
- }
2472
- if (cursor) {
2473
- const currentMarks = (_a = state.storedMarks) !== null && _a !== void 0 ? _a : cursor.marks();
2474
- return !!newMarkType.isInSet(currentMarks) || !currentMarks.some((mark) => mark.type.excludes(newMarkType));
2475
- }
2476
- const { ranges } = selection;
2477
- return ranges.some(({ $from, $to }) => {
2478
- let someNodeSupportsMark = $from.depth === 0 ? state.doc.inlineContent && state.doc.type.allowsMarkType(newMarkType) : false;
2479
- state.doc.nodesBetween($from.pos, $to.pos, (node, _pos, parent) => {
2480
- if (someNodeSupportsMark) {
2481
- return false;
2482
- }
2483
- if (node.isInline) {
2484
- const parentAllowsMarkType = !parent || parent.type.allowsMarkType(newMarkType);
2485
- const currentMarksAllowMarkType = !!newMarkType.isInSet(node.marks) || !node.marks.some((otherMark) => otherMark.type.excludes(newMarkType));
2486
- someNodeSupportsMark = parentAllowsMarkType && currentMarksAllowMarkType;
2487
- }
2488
- return !someNodeSupportsMark;
2489
- });
2490
- return someNodeSupportsMark;
2491
- });
2492
- }
2493
- const setMark = (typeOrName, attributes = {}) => ({ tr, state, dispatch }) => {
2494
- const { selection } = tr;
2495
- const { empty, ranges } = selection;
2496
- const type = getMarkType(typeOrName, state.schema);
2497
- if (dispatch) {
2498
- if (empty) {
2499
- const oldAttributes = getMarkAttributes(state, type);
2500
- tr.addStoredMark(type.create({
2501
- ...oldAttributes,
2502
- ...attributes
2503
- }));
2504
- } else {
2505
- ranges.forEach((range) => {
2506
- const from = range.$from.pos;
2507
- const to = range.$to.pos;
2508
- state.doc.nodesBetween(from, to, (node, pos) => {
2509
- const trimmedFrom = Math.max(pos, from);
2510
- const trimmedTo = Math.min(pos + node.nodeSize, to);
2511
- const someHasMark = node.marks.find((mark) => mark.type === type);
2512
- if (someHasMark) {
2513
- node.marks.forEach((mark) => {
2514
- if (type === mark.type) {
2515
- tr.addMark(trimmedFrom, trimmedTo, type.create({
2516
- ...mark.attrs,
2517
- ...attributes
2518
- }));
2519
- }
2520
- });
2521
- } else {
2522
- tr.addMark(trimmedFrom, trimmedTo, type.create(attributes));
2523
- }
2524
- });
2525
- });
2526
- }
2527
- }
2528
- return canSetMark(state, tr, type);
2529
- };
2530
- const setMeta = (key, value) => ({ tr }) => {
2531
- tr.setMeta(key, value);
2532
- return true;
2533
- };
2534
- const setNode = (typeOrName, attributes = {}) => ({ state, dispatch, chain }) => {
2535
- const type = getNodeType(typeOrName, state.schema);
2536
- let attributesToCopy;
2537
- if (state.selection.$anchor.sameParent(state.selection.$head)) {
2538
- attributesToCopy = state.selection.$anchor.parent.attrs;
2539
- }
2540
- if (!type.isTextblock) {
2541
- console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.');
2542
- return false;
2543
- }
2544
- return chain().command(({ commands: commands2 }) => {
2545
- const canSetBlock = setBlockType(type, { ...attributesToCopy, ...attributes })(state);
2546
- if (canSetBlock) {
2547
- return true;
2548
- }
2549
- return commands2.clearNodes();
2550
- }).command(({ state: updatedState }) => {
2551
- return setBlockType(type, { ...attributesToCopy, ...attributes })(updatedState, dispatch);
2552
- }).run();
2553
- };
2554
- const setNodeSelection = (position) => ({ tr, dispatch }) => {
2555
- if (dispatch) {
2556
- const { doc } = tr;
2557
- const from = minMax(position, 0, doc.content.size);
2558
- const selection = NodeSelection.create(doc, from);
2559
- tr.setSelection(selection);
2560
- }
2561
- return true;
2562
- };
2563
- const setTextSelection = (position) => ({ tr, dispatch }) => {
2564
- if (dispatch) {
2565
- const { doc } = tr;
2566
- const { from, to } = typeof position === "number" ? { from: position, to: position } : position;
2567
- const minPos = TextSelection.atStart(doc).from;
2568
- const maxPos = TextSelection.atEnd(doc).to;
2569
- const resolvedFrom = minMax(from, minPos, maxPos);
2570
- const resolvedEnd = minMax(to, minPos, maxPos);
2571
- const selection = TextSelection.create(doc, resolvedFrom, resolvedEnd);
2572
- tr.setSelection(selection);
2573
- }
2574
- return true;
2575
- };
2576
- const sinkListItem = (typeOrName) => ({ state, dispatch }) => {
2577
- const type = getNodeType(typeOrName, state.schema);
2578
- return sinkListItem$1(type)(state, dispatch);
2579
- };
2580
- function ensureMarks(state, splittableMarks) {
2581
- const marks = state.storedMarks || state.selection.$to.parentOffset && state.selection.$from.marks();
2582
- if (marks) {
2583
- const filteredMarks = marks.filter((mark) => splittableMarks === null || splittableMarks === void 0 ? void 0 : splittableMarks.includes(mark.type.name));
2584
- state.tr.ensureMarks(filteredMarks);
2585
- }
2586
- }
2587
- const splitBlock = ({ keepMarks = true } = {}) => ({ tr, state, dispatch, editor }) => {
2588
- const { selection, doc } = tr;
2589
- const { $from, $to } = selection;
2590
- const extensionAttributes = editor.extensionManager.attributes;
2591
- const newAttributes = getSplittedAttributes(extensionAttributes, $from.node().type.name, $from.node().attrs);
2592
- if (selection instanceof NodeSelection && selection.node.isBlock) {
2593
- if (!$from.parentOffset || !canSplit(doc, $from.pos)) {
2594
- return false;
2595
- }
2596
- if (dispatch) {
2597
- if (keepMarks) {
2598
- ensureMarks(state, editor.extensionManager.splittableMarks);
2599
- }
2600
- tr.split($from.pos).scrollIntoView();
2601
- }
2602
- return true;
2603
- }
2604
- if (!$from.parent.isBlock) {
2605
- return false;
2606
- }
2607
- const atEnd = $to.parentOffset === $to.parent.content.size;
2608
- const deflt = $from.depth === 0 ? void 0 : defaultBlockAt($from.node(-1).contentMatchAt($from.indexAfter(-1)));
2609
- let types = atEnd && deflt ? [
2610
- {
2611
- type: deflt,
2612
- attrs: newAttributes
2613
- }
2614
- ] : void 0;
2615
- let can = canSplit(tr.doc, tr.mapping.map($from.pos), 1, types);
2616
- if (!types && !can && canSplit(tr.doc, tr.mapping.map($from.pos), 1, deflt ? [{ type: deflt }] : void 0)) {
2617
- can = true;
2618
- types = deflt ? [
2619
- {
2620
- type: deflt,
2621
- attrs: newAttributes
2622
- }
2623
- ] : void 0;
2624
- }
2625
- if (dispatch) {
2626
- if (can) {
2627
- if (selection instanceof TextSelection) {
2628
- tr.deleteSelection();
2629
- }
2630
- tr.split(tr.mapping.map($from.pos), 1, types);
2631
- if (deflt && !atEnd && !$from.parentOffset && $from.parent.type !== deflt) {
2632
- const first2 = tr.mapping.map($from.before());
2633
- const $first = tr.doc.resolve(first2);
2634
- if ($from.node(-1).canReplaceWith($first.index(), $first.index() + 1, deflt)) {
2635
- tr.setNodeMarkup(tr.mapping.map($from.before()), deflt);
2636
- }
2637
- }
2638
- }
2639
- if (keepMarks) {
2640
- ensureMarks(state, editor.extensionManager.splittableMarks);
2641
- }
2642
- tr.scrollIntoView();
2643
- }
2644
- return can;
2645
- };
2646
- const splitListItem = (typeOrName, overrideAttrs = {}) => ({ tr, state, dispatch, editor }) => {
2647
- var _a;
2648
- const type = getNodeType(typeOrName, state.schema);
2649
- const { $from, $to } = state.selection;
2650
- const node = state.selection.node;
2651
- if (node && node.isBlock || $from.depth < 2 || !$from.sameParent($to)) {
2652
- return false;
2653
- }
2654
- const grandParent = $from.node(-1);
2655
- if (grandParent.type !== type) {
2656
- return false;
2657
- }
2658
- const extensionAttributes = editor.extensionManager.attributes;
2659
- if ($from.parent.content.size === 0 && $from.node(-1).childCount === $from.indexAfter(-1)) {
2660
- if ($from.depth === 2 || $from.node(-3).type !== type || $from.index(-2) !== $from.node(-2).childCount - 1) {
2661
- return false;
2662
- }
2663
- if (dispatch) {
2664
- let wrap = Fragment.empty;
2665
- const depthBefore = $from.index(-1) ? 1 : $from.index(-2) ? 2 : 3;
2666
- for (let d = $from.depth - depthBefore; d >= $from.depth - 3; d -= 1) {
2667
- wrap = Fragment.from($from.node(d).copy(wrap));
2668
- }
2669
- const depthAfter = $from.indexAfter(-1) < $from.node(-2).childCount ? 1 : $from.indexAfter(-2) < $from.node(-3).childCount ? 2 : 3;
2670
- const newNextTypeAttributes2 = {
2671
- ...getSplittedAttributes(extensionAttributes, $from.node().type.name, $from.node().attrs),
2672
- ...overrideAttrs
2673
- };
2674
- const nextType2 = ((_a = type.contentMatch.defaultType) === null || _a === void 0 ? void 0 : _a.createAndFill(newNextTypeAttributes2)) || void 0;
2675
- wrap = wrap.append(Fragment.from(type.createAndFill(null, nextType2) || void 0));
2676
- const start = $from.before($from.depth - (depthBefore - 1));
2677
- tr.replace(start, $from.after(-depthAfter), new Slice(wrap, 4 - depthBefore, 0));
2678
- let sel = -1;
2679
- tr.doc.nodesBetween(start, tr.doc.content.size, (n, pos) => {
2680
- if (sel > -1) {
2681
- return false;
2682
- }
2683
- if (n.isTextblock && n.content.size === 0) {
2684
- sel = pos + 1;
2685
- }
2686
- });
2687
- if (sel > -1) {
2688
- tr.setSelection(TextSelection.near(tr.doc.resolve(sel)));
2689
- }
2690
- tr.scrollIntoView();
2691
- }
2692
- return true;
2693
- }
2694
- const nextType = $to.pos === $from.end() ? grandParent.contentMatchAt(0).defaultType : null;
2695
- const newTypeAttributes = {
2696
- ...getSplittedAttributes(extensionAttributes, grandParent.type.name, grandParent.attrs),
2697
- ...overrideAttrs
2698
- };
2699
- const newNextTypeAttributes = {
2700
- ...getSplittedAttributes(extensionAttributes, $from.node().type.name, $from.node().attrs),
2701
- ...overrideAttrs
2702
- };
2703
- tr.delete($from.pos, $to.pos);
2704
- const types = nextType ? [
2705
- { type, attrs: newTypeAttributes },
2706
- { type: nextType, attrs: newNextTypeAttributes }
2707
- ] : [{ type, attrs: newTypeAttributes }];
2708
- if (!canSplit(tr.doc, $from.pos, 2)) {
2709
- return false;
2710
- }
2711
- if (dispatch) {
2712
- const { selection, storedMarks } = state;
2713
- const { splittableMarks } = editor.extensionManager;
2714
- const marks = storedMarks || selection.$to.parentOffset && selection.$from.marks();
2715
- tr.split($from.pos, 2, types).scrollIntoView();
2716
- if (!marks || !dispatch) {
2717
- return true;
2718
- }
2719
- const filteredMarks = marks.filter((mark) => splittableMarks.includes(mark.type.name));
2720
- tr.ensureMarks(filteredMarks);
2721
- }
2722
- return true;
2723
- };
2724
- const joinListBackwards = (tr, listType) => {
2725
- const list = findParentNode((node) => node.type === listType)(tr.selection);
2726
- if (!list) {
2727
- return true;
2728
- }
2729
- const before = tr.doc.resolve(Math.max(0, list.pos - 1)).before(list.depth);
2730
- if (before === void 0) {
2731
- return true;
2732
- }
2733
- const nodeBefore = tr.doc.nodeAt(before);
2734
- const canJoinBackwards = list.node.type === (nodeBefore === null || nodeBefore === void 0 ? void 0 : nodeBefore.type) && canJoin(tr.doc, list.pos);
2735
- if (!canJoinBackwards) {
2736
- return true;
2737
- }
2738
- tr.join(list.pos);
2739
- return true;
2740
- };
2741
- const joinListForwards = (tr, listType) => {
2742
- const list = findParentNode((node) => node.type === listType)(tr.selection);
2743
- if (!list) {
2744
- return true;
2745
- }
2746
- const after = tr.doc.resolve(list.start).after(list.depth);
2747
- if (after === void 0) {
2748
- return true;
2749
- }
2750
- const nodeAfter = tr.doc.nodeAt(after);
2751
- const canJoinForwards = list.node.type === (nodeAfter === null || nodeAfter === void 0 ? void 0 : nodeAfter.type) && canJoin(tr.doc, after);
2752
- if (!canJoinForwards) {
2753
- return true;
2754
- }
2755
- tr.join(after);
2756
- return true;
2757
- };
2758
- const toggleList = (listTypeOrName, itemTypeOrName, keepMarks, attributes = {}) => ({ editor, tr, state, dispatch, chain, commands: commands2, can }) => {
2759
- const { extensions, splittableMarks } = editor.extensionManager;
2760
- const listType = getNodeType(listTypeOrName, state.schema);
2761
- const itemType = getNodeType(itemTypeOrName, state.schema);
2762
- const { selection, storedMarks } = state;
2763
- const { $from, $to } = selection;
2764
- const range = $from.blockRange($to);
2765
- const marks = storedMarks || selection.$to.parentOffset && selection.$from.marks();
2766
- if (!range) {
2767
- return false;
2768
- }
2769
- const parentList = findParentNode((node) => isList(node.type.name, extensions))(selection);
2770
- if (range.depth >= 1 && parentList && range.depth - parentList.depth <= 1) {
2771
- if (parentList.node.type === listType) {
2772
- return commands2.liftListItem(itemType);
2773
- }
2774
- if (isList(parentList.node.type.name, extensions) && listType.validContent(parentList.node.content) && dispatch) {
2775
- return chain().command(() => {
2776
- tr.setNodeMarkup(parentList.pos, listType);
2777
- return true;
2778
- }).command(() => joinListBackwards(tr, listType)).command(() => joinListForwards(tr, listType)).run();
2779
- }
2780
- }
2781
- if (!keepMarks || !marks || !dispatch) {
2782
- return chain().command(() => {
2783
- const canWrapInList = can().wrapInList(listType, attributes);
2784
- if (canWrapInList) {
2785
- return true;
2786
- }
2787
- return commands2.clearNodes();
2788
- }).wrapInList(listType, attributes).command(() => joinListBackwards(tr, listType)).command(() => joinListForwards(tr, listType)).run();
2789
- }
2790
- return chain().command(() => {
2791
- const canWrapInList = can().wrapInList(listType, attributes);
2792
- const filteredMarks = marks.filter((mark) => splittableMarks.includes(mark.type.name));
2793
- tr.ensureMarks(filteredMarks);
2794
- if (canWrapInList) {
2795
- return true;
2796
- }
2797
- return commands2.clearNodes();
2798
- }).wrapInList(listType, attributes).command(() => joinListBackwards(tr, listType)).command(() => joinListForwards(tr, listType)).run();
2799
- };
2800
- const toggleMark = (typeOrName, attributes = {}, options = {}) => ({ state, commands: commands2 }) => {
2801
- const { extendEmptyMarkRange = false } = options;
2802
- const type = getMarkType(typeOrName, state.schema);
2803
- const isActive2 = isMarkActive(state, type, attributes);
2804
- if (isActive2) {
2805
- return commands2.unsetMark(type, { extendEmptyMarkRange });
2806
- }
2807
- return commands2.setMark(type, attributes);
2808
- };
2809
- const toggleNode = (typeOrName, toggleTypeOrName, attributes = {}) => ({ state, commands: commands2 }) => {
2810
- const type = getNodeType(typeOrName, state.schema);
2811
- const toggleType = getNodeType(toggleTypeOrName, state.schema);
2812
- const isActive2 = isNodeActive(state, type, attributes);
2813
- let attributesToCopy;
2814
- if (state.selection.$anchor.sameParent(state.selection.$head)) {
2815
- attributesToCopy = state.selection.$anchor.parent.attrs;
2816
- }
2817
- if (isActive2) {
2818
- return commands2.setNode(toggleType, attributesToCopy);
2819
- }
2820
- return commands2.setNode(type, { ...attributesToCopy, ...attributes });
2821
- };
2822
- const toggleWrap = (typeOrName, attributes = {}) => ({ state, commands: commands2 }) => {
2823
- const type = getNodeType(typeOrName, state.schema);
2824
- const isActive2 = isNodeActive(state, type, attributes);
2825
- if (isActive2) {
2826
- return commands2.lift(type);
2827
- }
2828
- return commands2.wrapIn(type, attributes);
2829
- };
2830
- const undoInputRule = () => ({ state, dispatch }) => {
2831
- const plugins = state.plugins;
2832
- for (let i = 0; i < plugins.length; i += 1) {
2833
- const plugin = plugins[i];
2834
- let undoable;
2835
- if (plugin.spec.isInputRules && (undoable = plugin.getState(state))) {
2836
- if (dispatch) {
2837
- const tr = state.tr;
2838
- const toUndo = undoable.transform;
2839
- for (let j = toUndo.steps.length - 1; j >= 0; j -= 1) {
2840
- tr.step(toUndo.steps[j].invert(toUndo.docs[j]));
2841
- }
2842
- if (undoable.text) {
2843
- const marks = tr.doc.resolve(undoable.from).marks();
2844
- tr.replaceWith(undoable.from, undoable.to, state.schema.text(undoable.text, marks));
2845
- } else {
2846
- tr.delete(undoable.from, undoable.to);
2847
- }
2848
- }
2849
- return true;
2850
- }
2851
- }
2852
- return false;
2853
- };
2854
- const unsetAllMarks = () => ({ tr, dispatch }) => {
2855
- const { selection } = tr;
2856
- const { empty, ranges } = selection;
2857
- if (empty) {
2858
- return true;
2859
- }
2860
- if (dispatch) {
2861
- ranges.forEach((range) => {
2862
- tr.removeMark(range.$from.pos, range.$to.pos);
2863
- });
2864
- }
2865
- return true;
2866
- };
2867
- const unsetMark = (typeOrName, options = {}) => ({ tr, state, dispatch }) => {
2868
- var _a;
2869
- const { extendEmptyMarkRange = false } = options;
2870
- const { selection } = tr;
2871
- const type = getMarkType(typeOrName, state.schema);
2872
- const { $from, empty, ranges } = selection;
2873
- if (!dispatch) {
2874
- return true;
2875
- }
2876
- if (empty && extendEmptyMarkRange) {
2877
- let { from, to } = selection;
2878
- const attrs = (_a = $from.marks().find((mark) => mark.type === type)) === null || _a === void 0 ? void 0 : _a.attrs;
2879
- const range = getMarkRange($from, type, attrs);
2880
- if (range) {
2881
- from = range.from;
2882
- to = range.to;
2883
- }
2884
- tr.removeMark(from, to, type);
2885
- } else {
2886
- ranges.forEach((range) => {
2887
- tr.removeMark(range.$from.pos, range.$to.pos, type);
2888
- });
2889
- }
2890
- tr.removeStoredMark(type);
2891
- return true;
2892
- };
2893
- const updateAttributes = (typeOrName, attributes = {}) => ({ tr, state, dispatch }) => {
2894
- let nodeType = null;
2895
- let markType = null;
2896
- const schemaType = getSchemaTypeNameByName(typeof typeOrName === "string" ? typeOrName : typeOrName.name, state.schema);
2897
- if (!schemaType) {
2898
- return false;
2899
- }
2900
- if (schemaType === "node") {
2901
- nodeType = getNodeType(typeOrName, state.schema);
2902
- }
2903
- if (schemaType === "mark") {
2904
- markType = getMarkType(typeOrName, state.schema);
2905
- }
2906
- if (dispatch) {
2907
- tr.selection.ranges.forEach((range) => {
2908
- const from = range.$from.pos;
2909
- const to = range.$to.pos;
2910
- let lastPos;
2911
- let lastNode;
2912
- let trimmedFrom;
2913
- let trimmedTo;
2914
- if (tr.selection.empty) {
2915
- state.doc.nodesBetween(from, to, (node, pos) => {
2916
- if (nodeType && nodeType === node.type) {
2917
- trimmedFrom = Math.max(pos, from);
2918
- trimmedTo = Math.min(pos + node.nodeSize, to);
2919
- lastPos = pos;
2920
- lastNode = node;
2921
- }
2922
- });
2923
- } else {
2924
- state.doc.nodesBetween(from, to, (node, pos) => {
2925
- if (pos < from && nodeType && nodeType === node.type) {
2926
- trimmedFrom = Math.max(pos, from);
2927
- trimmedTo = Math.min(pos + node.nodeSize, to);
2928
- lastPos = pos;
2929
- lastNode = node;
2930
- }
2931
- if (pos >= from && pos <= to) {
2932
- if (nodeType && nodeType === node.type) {
2933
- tr.setNodeMarkup(pos, void 0, {
2934
- ...node.attrs,
2935
- ...attributes
2936
- });
2937
- }
2938
- if (markType && node.marks.length) {
2939
- node.marks.forEach((mark) => {
2940
- if (markType === mark.type) {
2941
- const trimmedFrom2 = Math.max(pos, from);
2942
- const trimmedTo2 = Math.min(pos + node.nodeSize, to);
2943
- tr.addMark(trimmedFrom2, trimmedTo2, markType.create({
2944
- ...mark.attrs,
2945
- ...attributes
2946
- }));
2947
- }
2948
- });
2949
- }
2950
- }
2951
- });
2952
- }
2953
- if (lastNode) {
2954
- if (lastPos !== void 0) {
2955
- tr.setNodeMarkup(lastPos, void 0, {
2956
- ...lastNode.attrs,
2957
- ...attributes
2958
- });
2959
- }
2960
- if (markType && lastNode.marks.length) {
2961
- lastNode.marks.forEach((mark) => {
2962
- if (markType === mark.type) {
2963
- tr.addMark(trimmedFrom, trimmedTo, markType.create({
2964
- ...mark.attrs,
2965
- ...attributes
2966
- }));
2967
- }
2968
- });
2969
- }
2970
- }
2971
- });
2972
- }
2973
- return true;
2974
- };
2975
- const wrapIn = (typeOrName, attributes = {}) => ({ state, dispatch }) => {
2976
- const type = getNodeType(typeOrName, state.schema);
2977
- return wrapIn$1(type, attributes)(state, dispatch);
2978
- };
2979
- const wrapInList = (typeOrName, attributes = {}) => ({ state, dispatch }) => {
2980
- const type = getNodeType(typeOrName, state.schema);
2981
- return wrapInList$1(type, attributes)(state, dispatch);
2982
- };
2983
- var commands = /* @__PURE__ */ Object.freeze({
2984
- __proto__: null,
2985
- blur,
2986
- clearContent,
2987
- clearNodes,
2988
- command,
2989
- createParagraphNear,
2990
- cut,
2991
- deleteCurrentNode,
2992
- deleteNode,
2993
- deleteRange,
2994
- deleteSelection,
2995
- enter,
2996
- exitCode,
2997
- extendMarkRange,
2998
- first,
2999
- focus,
3000
- forEach,
3001
- insertContent,
3002
- insertContentAt,
3003
- joinBackward,
3004
- joinDown,
3005
- joinForward,
3006
- joinItemBackward,
3007
- joinItemForward,
3008
- joinTextblockBackward,
3009
- joinTextblockForward,
3010
- joinUp,
3011
- keyboardShortcut,
3012
- lift,
3013
- liftEmptyBlock,
3014
- liftListItem,
3015
- newlineInCode,
3016
- resetAttributes,
3017
- scrollIntoView,
3018
- selectAll,
3019
- selectNodeBackward,
3020
- selectNodeForward,
3021
- selectParentNode,
3022
- selectTextblockEnd,
3023
- selectTextblockStart,
3024
- setContent,
3025
- setMark,
3026
- setMeta,
3027
- setNode,
3028
- setNodeSelection,
3029
- setTextSelection,
3030
- sinkListItem,
3031
- splitBlock,
3032
- splitListItem,
3033
- toggleList,
3034
- toggleMark,
3035
- toggleNode,
3036
- toggleWrap,
3037
- undoInputRule,
3038
- unsetAllMarks,
3039
- unsetMark,
3040
- updateAttributes,
3041
- wrapIn,
3042
- wrapInList
3043
- });
3044
- const Commands = Extension.create({
3045
- name: "commands",
3046
- addCommands() {
3047
- return {
3048
- ...commands
3049
- };
3050
- }
3051
- });
3052
- const Drop = Extension.create({
3053
- name: "drop",
3054
- addProseMirrorPlugins() {
3055
- return [
3056
- new Plugin({
3057
- key: new PluginKey("tiptapDrop"),
3058
- props: {
3059
- handleDrop: (_, e, slice, moved) => {
3060
- this.editor.emit("drop", {
3061
- editor: this.editor,
3062
- event: e,
3063
- slice,
3064
- moved
3065
- });
3066
- }
3067
- }
3068
- })
3069
- ];
3070
- }
3071
- });
3072
- const Editable = Extension.create({
3073
- name: "editable",
3074
- addProseMirrorPlugins() {
3075
- return [
3076
- new Plugin({
3077
- key: new PluginKey("editable"),
3078
- props: {
3079
- editable: () => this.editor.options.editable
3080
- }
3081
- })
3082
- ];
3083
- }
3084
- });
3085
- const focusEventsPluginKey = new PluginKey("focusEvents");
3086
- const FocusEvents = Extension.create({
3087
- name: "focusEvents",
3088
- addProseMirrorPlugins() {
3089
- const { editor } = this;
3090
- return [
3091
- new Plugin({
3092
- key: focusEventsPluginKey,
3093
- props: {
3094
- handleDOMEvents: {
3095
- focus: (view, event) => {
3096
- editor.isFocused = true;
3097
- const transaction = editor.state.tr.setMeta("focus", { event }).setMeta("addToHistory", false);
3098
- view.dispatch(transaction);
3099
- return false;
3100
- },
3101
- blur: (view, event) => {
3102
- editor.isFocused = false;
3103
- const transaction = editor.state.tr.setMeta("blur", { event }).setMeta("addToHistory", false);
3104
- view.dispatch(transaction);
3105
- return false;
3106
- }
3107
- }
3108
- }
3109
- })
3110
- ];
3111
- }
3112
- });
3113
- const Keymap = Extension.create({
3114
- name: "keymap",
3115
- addKeyboardShortcuts() {
3116
- const handleBackspace = () => this.editor.commands.first(({ commands: commands2 }) => [
3117
- () => commands2.undoInputRule(),
3118
- // maybe convert first text block node to default node
3119
- () => commands2.command(({ tr }) => {
3120
- const { selection, doc } = tr;
3121
- const { empty, $anchor } = selection;
3122
- const { pos, parent } = $anchor;
3123
- const $parentPos = $anchor.parent.isTextblock && pos > 0 ? tr.doc.resolve(pos - 1) : $anchor;
3124
- const parentIsIsolating = $parentPos.parent.type.spec.isolating;
3125
- const parentPos = $anchor.pos - $anchor.parentOffset;
3126
- const isAtStart = parentIsIsolating && $parentPos.parent.childCount === 1 ? parentPos === $anchor.pos : Selection.atStart(doc).from === pos;
3127
- if (!empty || !parent.type.isTextblock || parent.textContent.length || !isAtStart || isAtStart && $anchor.parent.type.name === "paragraph") {
3128
- return false;
3129
- }
3130
- return commands2.clearNodes();
3131
- }),
3132
- () => commands2.deleteSelection(),
3133
- () => commands2.joinBackward(),
3134
- () => commands2.selectNodeBackward()
3135
- ]);
3136
- const handleDelete = () => this.editor.commands.first(({ commands: commands2 }) => [
3137
- () => commands2.deleteSelection(),
3138
- () => commands2.deleteCurrentNode(),
3139
- () => commands2.joinForward(),
3140
- () => commands2.selectNodeForward()
3141
- ]);
3142
- const handleEnter = () => this.editor.commands.first(({ commands: commands2 }) => [
3143
- () => commands2.newlineInCode(),
3144
- () => commands2.createParagraphNear(),
3145
- () => commands2.liftEmptyBlock(),
3146
- () => commands2.splitBlock()
3147
- ]);
3148
- const baseKeymap = {
3149
- Enter: handleEnter,
3150
- "Mod-Enter": () => this.editor.commands.exitCode(),
3151
- Backspace: handleBackspace,
3152
- "Mod-Backspace": handleBackspace,
3153
- "Shift-Backspace": handleBackspace,
3154
- Delete: handleDelete,
3155
- "Mod-Delete": handleDelete,
3156
- "Mod-a": () => this.editor.commands.selectAll()
3157
- };
3158
- const pcKeymap = {
3159
- ...baseKeymap
3160
- };
3161
- const macKeymap = {
3162
- ...baseKeymap,
3163
- "Ctrl-h": handleBackspace,
3164
- "Alt-Backspace": handleBackspace,
3165
- "Ctrl-d": handleDelete,
3166
- "Ctrl-Alt-Backspace": handleDelete,
3167
- "Alt-Delete": handleDelete,
3168
- "Alt-d": handleDelete,
3169
- "Ctrl-a": () => this.editor.commands.selectTextblockStart(),
3170
- "Ctrl-e": () => this.editor.commands.selectTextblockEnd()
3171
- };
3172
- if (isiOS() || isMacOS()) {
3173
- return macKeymap;
3174
- }
3175
- return pcKeymap;
3176
- },
3177
- addProseMirrorPlugins() {
3178
- return [
3179
- // With this plugin we check if the whole document was selected and deleted.
3180
- // In this case we will additionally call `clearNodes()` to convert e.g. a heading
3181
- // to a paragraph if necessary.
3182
- // This is an alternative to ProseMirror's `AllSelection`, which doesn’t work well
3183
- // with many other commands.
3184
- new Plugin({
3185
- key: new PluginKey("clearDocument"),
3186
- appendTransaction: (transactions, oldState, newState) => {
3187
- if (transactions.some((tr2) => tr2.getMeta("composition"))) {
3188
- return;
3189
- }
3190
- const docChanges = transactions.some((transaction) => transaction.docChanged) && !oldState.doc.eq(newState.doc);
3191
- const ignoreTr = transactions.some((transaction) => transaction.getMeta("preventClearDocument"));
3192
- if (!docChanges || ignoreTr) {
3193
- return;
3194
- }
3195
- const { empty, from, to } = oldState.selection;
3196
- const allFrom = Selection.atStart(oldState.doc).from;
3197
- const allEnd = Selection.atEnd(oldState.doc).to;
3198
- const allWasSelected = from === allFrom && to === allEnd;
3199
- if (empty || !allWasSelected) {
3200
- return;
3201
- }
3202
- const isEmpty = isNodeEmpty(newState.doc);
3203
- if (!isEmpty) {
3204
- return;
3205
- }
3206
- const tr = newState.tr;
3207
- const state = createChainableState({
3208
- state: newState,
3209
- transaction: tr
3210
- });
3211
- const { commands: commands2 } = new CommandManager({
3212
- editor: this.editor,
3213
- state
3214
- });
3215
- commands2.clearNodes();
3216
- if (!tr.steps.length) {
3217
- return;
3218
- }
3219
- return tr;
3220
- }
3221
- })
3222
- ];
3223
- }
3224
- });
3225
- const Paste = Extension.create({
3226
- name: "paste",
3227
- addProseMirrorPlugins() {
3228
- return [
3229
- new Plugin({
3230
- key: new PluginKey("tiptapPaste"),
3231
- props: {
3232
- handlePaste: (_view, e, slice) => {
3233
- this.editor.emit("paste", {
3234
- editor: this.editor,
3235
- event: e,
3236
- slice
3237
- });
3238
- }
3239
- }
3240
- })
3241
- ];
3242
- }
3243
- });
3244
- const Tabindex = Extension.create({
3245
- name: "tabindex",
3246
- addProseMirrorPlugins() {
3247
- return [
3248
- new Plugin({
3249
- key: new PluginKey("tabindex"),
3250
- props: {
3251
- attributes: () => this.editor.isEditable ? { tabindex: "0" } : {}
3252
- }
3253
- })
3254
- ];
3255
- }
3256
- });
3257
- class NodePos {
3258
- get name() {
3259
- return this.node.type.name;
3260
- }
3261
- constructor(pos, editor, isBlock = false, node = null) {
3262
- this.currentNode = null;
3263
- this.actualDepth = null;
3264
- this.isBlock = isBlock;
3265
- this.resolvedPos = pos;
3266
- this.editor = editor;
3267
- this.currentNode = node;
3268
- }
3269
- get node() {
3270
- return this.currentNode || this.resolvedPos.node();
3271
- }
3272
- get element() {
3273
- return this.editor.view.domAtPos(this.pos).node;
3274
- }
3275
- get depth() {
3276
- var _a;
3277
- return (_a = this.actualDepth) !== null && _a !== void 0 ? _a : this.resolvedPos.depth;
3278
- }
3279
- get pos() {
3280
- return this.resolvedPos.pos;
3281
- }
3282
- get content() {
3283
- return this.node.content;
3284
- }
3285
- set content(content) {
3286
- let from = this.from;
3287
- let to = this.to;
3288
- if (this.isBlock) {
3289
- if (this.content.size === 0) {
3290
- console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);
3291
- return;
3292
- }
3293
- from = this.from + 1;
3294
- to = this.to - 1;
3295
- }
3296
- this.editor.commands.insertContentAt({ from, to }, content);
3297
- }
3298
- get attributes() {
3299
- return this.node.attrs;
3300
- }
3301
- get textContent() {
3302
- return this.node.textContent;
3303
- }
3304
- get size() {
3305
- return this.node.nodeSize;
3306
- }
3307
- get from() {
3308
- if (this.isBlock) {
3309
- return this.pos;
3310
- }
3311
- return this.resolvedPos.start(this.resolvedPos.depth);
3312
- }
3313
- get range() {
3314
- return {
3315
- from: this.from,
3316
- to: this.to
3317
- };
3318
- }
3319
- get to() {
3320
- if (this.isBlock) {
3321
- return this.pos + this.size;
3322
- }
3323
- return this.resolvedPos.end(this.resolvedPos.depth) + (this.node.isText ? 0 : 1);
3324
- }
3325
- get parent() {
3326
- if (this.depth === 0) {
3327
- return null;
3328
- }
3329
- const parentPos = this.resolvedPos.start(this.resolvedPos.depth - 1);
3330
- const $pos = this.resolvedPos.doc.resolve(parentPos);
3331
- return new NodePos($pos, this.editor);
3332
- }
3333
- get before() {
3334
- let $pos = this.resolvedPos.doc.resolve(this.from - (this.isBlock ? 1 : 2));
3335
- if ($pos.depth !== this.depth) {
3336
- $pos = this.resolvedPos.doc.resolve(this.from - 3);
3337
- }
3338
- return new NodePos($pos, this.editor);
3339
- }
3340
- get after() {
3341
- let $pos = this.resolvedPos.doc.resolve(this.to + (this.isBlock ? 2 : 1));
3342
- if ($pos.depth !== this.depth) {
3343
- $pos = this.resolvedPos.doc.resolve(this.to + 3);
3344
- }
3345
- return new NodePos($pos, this.editor);
3346
- }
3347
- get children() {
3348
- const children = [];
3349
- this.node.content.forEach((node, offset) => {
3350
- const isBlock = node.isBlock && !node.isTextblock;
3351
- const isNonTextAtom = node.isAtom && !node.isText;
3352
- const targetPos = this.pos + offset + (isNonTextAtom ? 0 : 1);
3353
- const $pos = this.resolvedPos.doc.resolve(targetPos);
3354
- if (!isBlock && $pos.depth <= this.depth) {
3355
- return;
3356
- }
3357
- const childNodePos = new NodePos($pos, this.editor, isBlock, isBlock ? node : null);
3358
- if (isBlock) {
3359
- childNodePos.actualDepth = this.depth + 1;
3360
- }
3361
- children.push(new NodePos($pos, this.editor, isBlock, isBlock ? node : null));
3362
- });
3363
- return children;
3364
- }
3365
- get firstChild() {
3366
- return this.children[0] || null;
3367
- }
3368
- get lastChild() {
3369
- const children = this.children;
3370
- return children[children.length - 1] || null;
3371
- }
3372
- closest(selector, attributes = {}) {
3373
- let node = null;
3374
- let currentNode = this.parent;
3375
- while (currentNode && !node) {
3376
- if (currentNode.node.type.name === selector) {
3377
- if (Object.keys(attributes).length > 0) {
3378
- const nodeAttributes = currentNode.node.attrs;
3379
- const attrKeys = Object.keys(attributes);
3380
- for (let index = 0; index < attrKeys.length; index += 1) {
3381
- const key = attrKeys[index];
3382
- if (nodeAttributes[key] !== attributes[key]) {
3383
- break;
3384
- }
3385
- }
3386
- } else {
3387
- node = currentNode;
3388
- }
3389
- }
3390
- currentNode = currentNode.parent;
3391
- }
3392
- return node;
3393
- }
3394
- querySelector(selector, attributes = {}) {
3395
- return this.querySelectorAll(selector, attributes, true)[0] || null;
3396
- }
3397
- querySelectorAll(selector, attributes = {}, firstItemOnly = false) {
3398
- let nodes = [];
3399
- if (!this.children || this.children.length === 0) {
3400
- return nodes;
3401
- }
3402
- const attrKeys = Object.keys(attributes);
3403
- this.children.forEach((childPos) => {
3404
- if (firstItemOnly && nodes.length > 0) {
3405
- return;
3406
- }
3407
- if (childPos.node.type.name === selector) {
3408
- const doesAllAttributesMatch = attrKeys.every((key) => attributes[key] === childPos.node.attrs[key]);
3409
- if (doesAllAttributesMatch) {
3410
- nodes.push(childPos);
3411
- }
3412
- }
3413
- if (firstItemOnly && nodes.length > 0) {
3414
- return;
3415
- }
3416
- nodes = nodes.concat(childPos.querySelectorAll(selector, attributes, firstItemOnly));
3417
- });
3418
- return nodes;
3419
- }
3420
- setAttribute(attributes) {
3421
- const { tr } = this.editor.state;
3422
- tr.setNodeMarkup(this.from, void 0, {
3423
- ...this.node.attrs,
3424
- ...attributes
3425
- });
3426
- this.editor.view.dispatch(tr);
3427
- }
3428
- }
3429
- const style = `.ProseMirror {
3430
- position: relative;
3431
- }
3432
-
3433
- .ProseMirror {
3434
- word-wrap: break-word;
3435
- white-space: pre-wrap;
3436
- white-space: break-spaces;
3437
- -webkit-font-variant-ligatures: none;
3438
- font-variant-ligatures: none;
3439
- font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
3440
- }
3441
-
3442
- .ProseMirror [contenteditable="false"] {
3443
- white-space: normal;
3444
- }
3445
-
3446
- .ProseMirror [contenteditable="false"] [contenteditable="true"] {
3447
- white-space: pre-wrap;
3448
- }
3449
-
3450
- .ProseMirror pre {
3451
- white-space: pre-wrap;
3452
- }
3453
-
3454
- img.ProseMirror-separator {
3455
- display: inline !important;
3456
- border: none !important;
3457
- margin: 0 !important;
3458
- width: 0 !important;
3459
- height: 0 !important;
3460
- }
3461
-
3462
- .ProseMirror-gapcursor {
3463
- display: none;
3464
- pointer-events: none;
3465
- position: absolute;
3466
- margin: 0;
3467
- }
3468
-
3469
- .ProseMirror-gapcursor:after {
3470
- content: "";
3471
- display: block;
3472
- position: absolute;
3473
- top: -2px;
3474
- width: 20px;
3475
- border-top: 1px solid black;
3476
- animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
3477
- }
3478
-
3479
- @keyframes ProseMirror-cursor-blink {
3480
- to {
3481
- visibility: hidden;
3482
- }
3483
- }
3484
-
3485
- .ProseMirror-hideselection *::selection {
3486
- background: transparent;
3487
- }
3488
-
3489
- .ProseMirror-hideselection *::-moz-selection {
3490
- background: transparent;
3491
- }
3492
-
3493
- .ProseMirror-hideselection * {
3494
- caret-color: transparent;
3495
- }
3496
-
3497
- .ProseMirror-focused .ProseMirror-gapcursor {
3498
- display: block;
3499
- }
3500
-
3501
- .tippy-box[data-animation=fade][data-state=hidden] {
3502
- opacity: 0
3503
- }`;
3504
- function createStyleTag(style2, nonce, suffix) {
3505
- const tiptapStyleTag = document.querySelector(`style[data-tiptap-style${""}]`);
3506
- if (tiptapStyleTag !== null) {
3507
- return tiptapStyleTag;
3508
- }
3509
- const styleNode = document.createElement("style");
3510
- if (nonce) {
3511
- styleNode.setAttribute("nonce", nonce);
3512
- }
3513
- styleNode.setAttribute(`data-tiptap-style${""}`, "");
3514
- styleNode.innerHTML = style2;
3515
- document.getElementsByTagName("head")[0].appendChild(styleNode);
3516
- return styleNode;
3517
- }
3518
- let Editor$1 = class Editor extends EventEmitter {
3519
- constructor(options = {}) {
3520
- super();
3521
- this.isFocused = false;
3522
- this.isInitialized = false;
3523
- this.extensionStorage = {};
3524
- this.options = {
3525
- element: document.createElement("div"),
3526
- content: "",
3527
- injectCSS: true,
3528
- injectNonce: void 0,
3529
- extensions: [],
3530
- autofocus: false,
3531
- editable: true,
3532
- editorProps: {},
3533
- parseOptions: {},
3534
- coreExtensionOptions: {},
3535
- enableInputRules: true,
3536
- enablePasteRules: true,
3537
- enableCoreExtensions: true,
3538
- enableContentCheck: false,
3539
- onBeforeCreate: () => null,
3540
- onCreate: () => null,
3541
- onUpdate: () => null,
3542
- onSelectionUpdate: () => null,
3543
- onTransaction: () => null,
3544
- onFocus: () => null,
3545
- onBlur: () => null,
3546
- onDestroy: () => null,
3547
- onContentError: ({ error }) => {
3548
- throw error;
3549
- },
3550
- onPaste: () => null,
3551
- onDrop: () => null
3552
- };
3553
- this.isCapturingTransaction = false;
3554
- this.capturedTransaction = null;
3555
- this.setOptions(options);
3556
- this.createExtensionManager();
3557
- this.createCommandManager();
3558
- this.createSchema();
3559
- this.on("beforeCreate", this.options.onBeforeCreate);
3560
- this.emit("beforeCreate", { editor: this });
3561
- this.on("contentError", this.options.onContentError);
3562
- this.createView();
3563
- this.injectCSS();
3564
- this.on("create", this.options.onCreate);
3565
- this.on("update", this.options.onUpdate);
3566
- this.on("selectionUpdate", this.options.onSelectionUpdate);
3567
- this.on("transaction", this.options.onTransaction);
3568
- this.on("focus", this.options.onFocus);
3569
- this.on("blur", this.options.onBlur);
3570
- this.on("destroy", this.options.onDestroy);
3571
- this.on("drop", ({ event, slice, moved }) => this.options.onDrop(event, slice, moved));
3572
- this.on("paste", ({ event, slice }) => this.options.onPaste(event, slice));
3573
- window.setTimeout(() => {
3574
- if (this.isDestroyed) {
3575
- return;
3576
- }
3577
- this.commands.focus(this.options.autofocus);
3578
- this.emit("create", { editor: this });
3579
- this.isInitialized = true;
3580
- }, 0);
3581
- }
3582
- /**
3583
- * Returns the editor storage.
3584
- */
3585
- get storage() {
3586
- return this.extensionStorage;
3587
- }
3588
- /**
3589
- * An object of all registered commands.
3590
- */
3591
- get commands() {
3592
- return this.commandManager.commands;
3593
- }
3594
- /**
3595
- * Create a command chain to call multiple commands at once.
3596
- */
3597
- chain() {
3598
- return this.commandManager.chain();
3599
- }
3600
- /**
3601
- * Check if a command or a command chain can be executed. Without executing it.
3602
- */
3603
- can() {
3604
- return this.commandManager.can();
3605
- }
3606
- /**
3607
- * Inject CSS styles.
3608
- */
3609
- injectCSS() {
3610
- if (this.options.injectCSS && document) {
3611
- this.css = createStyleTag(style, this.options.injectNonce);
3612
- }
3613
- }
3614
- /**
3615
- * Update editor options.
3616
- *
3617
- * @param options A list of options
3618
- */
3619
- setOptions(options = {}) {
3620
- this.options = {
3621
- ...this.options,
3622
- ...options
3623
- };
3624
- if (!this.view || !this.state || this.isDestroyed) {
3625
- return;
3626
- }
3627
- if (this.options.editorProps) {
3628
- this.view.setProps(this.options.editorProps);
3629
- }
3630
- this.view.updateState(this.state);
3631
- }
3632
- /**
3633
- * Update editable state of the editor.
3634
- */
3635
- setEditable(editable, emitUpdate = true) {
3636
- this.setOptions({ editable });
3637
- if (emitUpdate) {
3638
- this.emit("update", { editor: this, transaction: this.state.tr });
3639
- }
3640
- }
3641
- /**
3642
- * Returns whether the editor is editable.
3643
- */
3644
- get isEditable() {
3645
- return this.options.editable && this.view && this.view.editable;
3646
- }
3647
- /**
3648
- * Returns the editor state.
3649
- */
3650
- get state() {
3651
- return this.view.state;
3652
- }
3653
- /**
3654
- * Register a ProseMirror plugin.
3655
- *
3656
- * @param plugin A ProseMirror plugin
3657
- * @param handlePlugins Control how to merge the plugin into the existing plugins.
3658
- * @returns The new editor state
3659
- */
3660
- registerPlugin(plugin, handlePlugins) {
3661
- const plugins = isFunction(handlePlugins) ? handlePlugins(plugin, [...this.state.plugins]) : [...this.state.plugins, plugin];
3662
- const state = this.state.reconfigure({ plugins });
3663
- this.view.updateState(state);
3664
- return state;
3665
- }
3666
- /**
3667
- * Unregister a ProseMirror plugin.
3668
- *
3669
- * @param nameOrPluginKeyToRemove The plugins name
3670
- * @returns The new editor state or undefined if the editor is destroyed
3671
- */
3672
- unregisterPlugin(nameOrPluginKeyToRemove) {
3673
- if (this.isDestroyed) {
3674
- return void 0;
3675
- }
3676
- const prevPlugins = this.state.plugins;
3677
- let plugins = prevPlugins;
3678
- [].concat(nameOrPluginKeyToRemove).forEach((nameOrPluginKey) => {
3679
- const name = typeof nameOrPluginKey === "string" ? `${nameOrPluginKey}$` : nameOrPluginKey.key;
3680
- plugins = plugins.filter((plugin) => !plugin.key.startsWith(name));
3681
- });
3682
- if (prevPlugins.length === plugins.length) {
3683
- return void 0;
3684
- }
3685
- const state = this.state.reconfigure({
3686
- plugins
3687
- });
3688
- this.view.updateState(state);
3689
- return state;
3690
- }
3691
- /**
3692
- * Creates an extension manager.
3693
- */
3694
- createExtensionManager() {
3695
- var _a, _b;
3696
- const coreExtensions = this.options.enableCoreExtensions ? [
3697
- Editable,
3698
- ClipboardTextSerializer.configure({
3699
- blockSeparator: (_b = (_a = this.options.coreExtensionOptions) === null || _a === void 0 ? void 0 : _a.clipboardTextSerializer) === null || _b === void 0 ? void 0 : _b.blockSeparator
3700
- }),
3701
- Commands,
3702
- FocusEvents,
3703
- Keymap,
3704
- Tabindex,
3705
- Drop,
3706
- Paste
3707
- ].filter((ext) => {
3708
- if (typeof this.options.enableCoreExtensions === "object") {
3709
- return this.options.enableCoreExtensions[ext.name] !== false;
3710
- }
3711
- return true;
3712
- }) : [];
3713
- const allExtensions = [...coreExtensions, ...this.options.extensions].filter((extension) => {
3714
- return ["extension", "node", "mark"].includes(extension === null || extension === void 0 ? void 0 : extension.type);
3715
- });
3716
- this.extensionManager = new ExtensionManager(allExtensions, this);
3717
- }
3718
- /**
3719
- * Creates an command manager.
3720
- */
3721
- createCommandManager() {
3722
- this.commandManager = new CommandManager({
3723
- editor: this
3724
- });
3725
- }
3726
- /**
3727
- * Creates a ProseMirror schema.
3728
- */
3729
- createSchema() {
3730
- this.schema = this.extensionManager.schema;
3731
- }
3732
- /**
3733
- * Creates a ProseMirror view.
3734
- */
3735
- createView() {
3736
- var _a;
3737
- let doc;
3738
- try {
3739
- doc = createDocument(this.options.content, this.schema, this.options.parseOptions, { errorOnInvalidContent: this.options.enableContentCheck });
3740
- } catch (e) {
3741
- if (!(e instanceof Error) || !["[tiptap error]: Invalid JSON content", "[tiptap error]: Invalid HTML content"].includes(e.message)) {
3742
- throw e;
3743
- }
3744
- this.emit("contentError", {
3745
- editor: this,
3746
- error: e,
3747
- disableCollaboration: () => {
3748
- if (this.storage.collaboration) {
3749
- this.storage.collaboration.isDisabled = true;
3750
- }
3751
- this.options.extensions = this.options.extensions.filter((extension) => extension.name !== "collaboration");
3752
- this.createExtensionManager();
3753
- }
3754
- });
3755
- doc = createDocument(this.options.content, this.schema, this.options.parseOptions, { errorOnInvalidContent: false });
3756
- }
3757
- const selection = resolveFocusPosition(doc, this.options.autofocus);
3758
- this.view = new EditorView(this.options.element, {
3759
- ...this.options.editorProps,
3760
- attributes: {
3761
- // add `role="textbox"` to the editor element
3762
- role: "textbox",
3763
- ...(_a = this.options.editorProps) === null || _a === void 0 ? void 0 : _a.attributes
3764
- },
3765
- dispatchTransaction: this.dispatchTransaction.bind(this),
3766
- state: EditorState.create({
3767
- doc,
3768
- selection: selection || void 0
3769
- })
3770
- });
3771
- const newState = this.state.reconfigure({
3772
- plugins: this.extensionManager.plugins
3773
- });
3774
- this.view.updateState(newState);
3775
- this.createNodeViews();
3776
- this.prependClass();
3777
- const dom = this.view.dom;
3778
- dom.editor = this;
3779
- }
3780
- /**
3781
- * Creates all node views.
3782
- */
3783
- createNodeViews() {
3784
- if (this.view.isDestroyed) {
3785
- return;
3786
- }
3787
- this.view.setProps({
3788
- nodeViews: this.extensionManager.nodeViews
3789
- });
3790
- }
3791
- /**
3792
- * Prepend class name to element.
3793
- */
3794
- prependClass() {
3795
- this.view.dom.className = `tiptap ${this.view.dom.className}`;
3796
- }
3797
- captureTransaction(fn) {
3798
- this.isCapturingTransaction = true;
3799
- fn();
3800
- this.isCapturingTransaction = false;
3801
- const tr = this.capturedTransaction;
3802
- this.capturedTransaction = null;
3803
- return tr;
3804
- }
3805
- /**
3806
- * The callback over which to send transactions (state updates) produced by the view.
3807
- *
3808
- * @param transaction An editor state transaction
3809
- */
3810
- dispatchTransaction(transaction) {
3811
- if (this.view.isDestroyed) {
3812
- return;
3813
- }
3814
- if (this.isCapturingTransaction) {
3815
- if (!this.capturedTransaction) {
3816
- this.capturedTransaction = transaction;
3817
- return;
3818
- }
3819
- transaction.steps.forEach((step) => {
3820
- var _a;
3821
- return (_a = this.capturedTransaction) === null || _a === void 0 ? void 0 : _a.step(step);
3822
- });
3823
- return;
3824
- }
3825
- const state = this.state.apply(transaction);
3826
- const selectionHasChanged = !this.state.selection.eq(state.selection);
3827
- this.emit("beforeTransaction", {
3828
- editor: this,
3829
- transaction,
3830
- nextState: state
3831
- });
3832
- this.view.updateState(state);
3833
- this.emit("transaction", {
3834
- editor: this,
3835
- transaction
3836
- });
3837
- if (selectionHasChanged) {
3838
- this.emit("selectionUpdate", {
3839
- editor: this,
3840
- transaction
3841
- });
3842
- }
3843
- const focus2 = transaction.getMeta("focus");
3844
- const blur2 = transaction.getMeta("blur");
3845
- if (focus2) {
3846
- this.emit("focus", {
3847
- editor: this,
3848
- event: focus2.event,
3849
- transaction
3850
- });
3851
- }
3852
- if (blur2) {
3853
- this.emit("blur", {
3854
- editor: this,
3855
- event: blur2.event,
3856
- transaction
3857
- });
3858
- }
3859
- if (!transaction.docChanged || transaction.getMeta("preventUpdate")) {
3860
- return;
3861
- }
3862
- this.emit("update", {
3863
- editor: this,
3864
- transaction
3865
- });
3866
- }
3867
- /**
3868
- * Get attributes of the currently selected node or mark.
3869
- */
3870
- getAttributes(nameOrType) {
3871
- return getAttributes(this.state, nameOrType);
3872
- }
3873
- isActive(nameOrAttributes, attributesOrUndefined) {
3874
- const name = typeof nameOrAttributes === "string" ? nameOrAttributes : null;
3875
- const attributes = typeof nameOrAttributes === "string" ? attributesOrUndefined : nameOrAttributes;
3876
- return isActive(this.state, name, attributes);
3877
- }
3878
- /**
3879
- * Get the document as JSON.
3880
- */
3881
- getJSON() {
3882
- return this.state.doc.toJSON();
3883
- }
3884
- /**
3885
- * Get the document as HTML.
3886
- */
3887
- getHTML() {
3888
- return getHTMLFromFragment(this.state.doc.content, this.schema);
3889
- }
3890
- /**
3891
- * Get the document as text.
3892
- */
3893
- getText(options) {
3894
- const { blockSeparator = "\n\n", textSerializers = {} } = options || {};
3895
- return getText(this.state.doc, {
3896
- blockSeparator,
3897
- textSerializers: {
3898
- ...getTextSerializersFromSchema(this.schema),
3899
- ...textSerializers
3900
- }
3901
- });
3902
- }
3903
- /**
3904
- * Check if there is no content.
3905
- */
3906
- get isEmpty() {
3907
- return isNodeEmpty(this.state.doc);
3908
- }
3909
- /**
3910
- * Get the number of characters for the current document.
3911
- *
3912
- * @deprecated
3913
- */
3914
- getCharacterCount() {
3915
- console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.');
3916
- return this.state.doc.content.size - 2;
3917
- }
3918
- /**
3919
- * Destroy the editor.
3920
- */
3921
- destroy() {
3922
- this.emit("destroy");
3923
- if (this.view) {
3924
- const dom = this.view.dom;
3925
- if (dom && dom.editor) {
3926
- delete dom.editor;
3927
- }
3928
- this.view.destroy();
3929
- }
3930
- this.removeAllListeners();
3931
- }
3932
- /**
3933
- * Check if the editor is already destroyed.
3934
- */
3935
- get isDestroyed() {
3936
- var _a;
3937
- return !((_a = this.view) === null || _a === void 0 ? void 0 : _a.docView);
3938
- }
3939
- $node(selector, attributes) {
3940
- var _a;
3941
- return ((_a = this.$doc) === null || _a === void 0 ? void 0 : _a.querySelector(selector, attributes)) || null;
3942
- }
3943
- $nodes(selector, attributes) {
3944
- var _a;
3945
- return ((_a = this.$doc) === null || _a === void 0 ? void 0 : _a.querySelectorAll(selector, attributes)) || null;
3946
- }
3947
- $pos(pos) {
3948
- const $pos = this.state.doc.resolve(pos);
3949
- return new NodePos($pos, this);
3950
- }
3951
- get $doc() {
3952
- return this.$pos(0);
3953
- }
3954
- };
3955
- function markInputRule(config) {
3956
- return new InputRule({
3957
- find: config.find,
3958
- handler: ({ state, range, match }) => {
3959
- const attributes = callOrReturn(config.getAttributes, void 0, match);
3960
- if (attributes === false || attributes === null) {
3961
- return null;
3962
- }
3963
- const { tr } = state;
3964
- const captureGroup = match[match.length - 1];
3965
- const fullMatch = match[0];
3966
- if (captureGroup) {
3967
- const startSpaces = fullMatch.search(/\S/);
3968
- const textStart = range.from + fullMatch.indexOf(captureGroup);
3969
- const textEnd = textStart + captureGroup.length;
3970
- const excludedMarks = getMarksBetween(range.from, range.to, state.doc).filter((item) => {
3971
- const excluded = item.mark.type.excluded;
3972
- return excluded.find((type) => type === config.type && type !== item.mark.type);
3973
- }).filter((item) => item.to > textStart);
3974
- if (excludedMarks.length) {
3975
- return null;
3976
- }
3977
- if (textEnd < range.to) {
3978
- tr.delete(textEnd, range.to);
3979
- }
3980
- if (textStart > range.from) {
3981
- tr.delete(range.from + startSpaces, textStart);
3982
- }
3983
- const markEnd = range.from + startSpaces + captureGroup.length;
3984
- tr.addMark(range.from + startSpaces, markEnd, config.type.create(attributes || {}));
3985
- tr.removeStoredMark(config.type);
3986
- }
3987
- }
3988
- });
3989
- }
3990
- function nodeInputRule(config) {
3991
- return new InputRule({
3992
- find: config.find,
3993
- handler: ({ state, range, match }) => {
3994
- const attributes = callOrReturn(config.getAttributes, void 0, match) || {};
3995
- const { tr } = state;
3996
- const start = range.from;
3997
- let end = range.to;
3998
- const newNode = config.type.create(attributes);
3999
- if (match[1]) {
4000
- const offset = match[0].lastIndexOf(match[1]);
4001
- let matchStart = start + offset;
4002
- if (matchStart > end) {
4003
- matchStart = end;
4004
- } else {
4005
- end = matchStart + match[1].length;
4006
- }
4007
- const lastChar = match[0][match[0].length - 1];
4008
- tr.insertText(lastChar, start + match[0].length - 1);
4009
- tr.replaceWith(matchStart, end, newNode);
4010
- } else if (match[0]) {
4011
- const insertionStart = config.type.isInline ? start : start - 1;
4012
- tr.insert(insertionStart, config.type.create(attributes)).delete(tr.mapping.map(start), tr.mapping.map(end));
4013
- }
4014
- tr.scrollIntoView();
4015
- }
4016
- });
4017
- }
4018
- function textblockTypeInputRule(config) {
4019
- return new InputRule({
4020
- find: config.find,
4021
- handler: ({ state, range, match }) => {
4022
- const $start = state.doc.resolve(range.from);
4023
- const attributes = callOrReturn(config.getAttributes, void 0, match) || {};
4024
- if (!$start.node(-1).canReplaceWith($start.index(-1), $start.indexAfter(-1), config.type)) {
4025
- return null;
4026
- }
4027
- state.tr.delete(range.from, range.to).setBlockType(range.from, range.from, config.type, attributes);
4028
- }
4029
- });
4030
- }
4031
- function wrappingInputRule(config) {
4032
- return new InputRule({
4033
- find: config.find,
4034
- handler: ({ state, range, match, chain }) => {
4035
- const attributes = callOrReturn(config.getAttributes, void 0, match) || {};
4036
- const tr = state.tr.delete(range.from, range.to);
4037
- const $start = tr.doc.resolve(range.from);
4038
- const blockRange = $start.blockRange();
4039
- const wrapping = blockRange && findWrapping(blockRange, config.type, attributes);
4040
- if (!wrapping) {
4041
- return null;
4042
- }
4043
- tr.wrap(blockRange, wrapping);
4044
- if (config.keepMarks && config.editor) {
4045
- const { selection, storedMarks } = state;
4046
- const { splittableMarks } = config.editor.extensionManager;
4047
- const marks = storedMarks || selection.$to.parentOffset && selection.$from.marks();
4048
- if (marks) {
4049
- const filteredMarks = marks.filter((mark) => splittableMarks.includes(mark.type.name));
4050
- tr.ensureMarks(filteredMarks);
4051
- }
4052
- }
4053
- if (config.keepAttributes) {
4054
- const nodeType = config.type.name === "bulletList" || config.type.name === "orderedList" ? "listItem" : "taskList";
4055
- chain().updateAttributes(nodeType, attributes).run();
4056
- }
4057
- const before = tr.doc.resolve(range.from - 1).nodeBefore;
4058
- if (before && before.type === config.type && canJoin(tr.doc, range.from - 1) && (!config.joinPredicate || config.joinPredicate(match, before))) {
4059
- tr.join(range.from - 1);
4060
- }
4061
- }
4062
- });
4063
- }
4064
- class Node {
4065
- constructor(config = {}) {
4066
- this.type = "node";
4067
- this.name = "node";
4068
- this.parent = null;
4069
- this.child = null;
4070
- this.config = {
4071
- name: this.name,
4072
- defaultOptions: {}
4073
- };
4074
- this.config = {
4075
- ...this.config,
4076
- ...config
4077
- };
4078
- this.name = this.config.name;
4079
- if (config.defaultOptions && Object.keys(config.defaultOptions).length > 0) {
4080
- console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`);
4081
- }
4082
- this.options = this.config.defaultOptions;
4083
- if (this.config.addOptions) {
4084
- this.options = callOrReturn(getExtensionField(this, "addOptions", {
4085
- name: this.name
4086
- }));
4087
- }
4088
- this.storage = callOrReturn(getExtensionField(this, "addStorage", {
4089
- name: this.name,
4090
- options: this.options
4091
- })) || {};
4092
- }
4093
- static create(config = {}) {
4094
- return new Node(config);
4095
- }
4096
- configure(options = {}) {
4097
- const extension = this.extend({
4098
- ...this.config,
4099
- addOptions: () => {
4100
- return mergeDeep(this.options, options);
4101
- }
4102
- });
4103
- extension.name = this.name;
4104
- extension.parent = this.parent;
4105
- return extension;
4106
- }
4107
- extend(extendedConfig = {}) {
4108
- const extension = new Node(extendedConfig);
4109
- extension.parent = this;
4110
- this.child = extension;
4111
- extension.name = extendedConfig.name ? extendedConfig.name : extension.parent.name;
4112
- if (extendedConfig.defaultOptions && Object.keys(extendedConfig.defaultOptions).length > 0) {
4113
- console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${extension.name}".`);
4114
- }
4115
- extension.options = callOrReturn(getExtensionField(extension, "addOptions", {
4116
- name: extension.name
4117
- }));
4118
- extension.storage = callOrReturn(getExtensionField(extension, "addStorage", {
4119
- name: extension.name,
4120
- options: extension.options
4121
- }));
4122
- return extension;
4123
- }
4124
- }
4125
- class NodeView {
4126
- constructor(component, props, options) {
4127
- this.isDragging = false;
4128
- this.component = component;
4129
- this.editor = props.editor;
4130
- this.options = {
4131
- stopEvent: null,
4132
- ignoreMutation: null,
4133
- ...options
4134
- };
4135
- this.extension = props.extension;
4136
- this.node = props.node;
4137
- this.decorations = props.decorations;
4138
- this.innerDecorations = props.innerDecorations;
4139
- this.view = props.view;
4140
- this.HTMLAttributes = props.HTMLAttributes;
4141
- this.getPos = props.getPos;
4142
- this.mount();
4143
- }
4144
- mount() {
4145
- return;
4146
- }
4147
- get dom() {
4148
- return this.editor.view.dom;
4149
- }
4150
- get contentDOM() {
4151
- return null;
4152
- }
4153
- onDragStart(event) {
4154
- var _a, _b, _c, _d, _e, _f, _g;
4155
- const { view } = this.editor;
4156
- const target = event.target;
4157
- const dragHandle = target.nodeType === 3 ? (_a = target.parentElement) === null || _a === void 0 ? void 0 : _a.closest("[data-drag-handle]") : target.closest("[data-drag-handle]");
4158
- if (!this.dom || ((_b = this.contentDOM) === null || _b === void 0 ? void 0 : _b.contains(target)) || !dragHandle) {
4159
- return;
4160
- }
4161
- let x = 0;
4162
- let y = 0;
4163
- if (this.dom !== dragHandle) {
4164
- const domBox = this.dom.getBoundingClientRect();
4165
- const handleBox = dragHandle.getBoundingClientRect();
4166
- const offsetX = (_c = event.offsetX) !== null && _c !== void 0 ? _c : (_d = event.nativeEvent) === null || _d === void 0 ? void 0 : _d.offsetX;
4167
- const offsetY = (_e = event.offsetY) !== null && _e !== void 0 ? _e : (_f = event.nativeEvent) === null || _f === void 0 ? void 0 : _f.offsetY;
4168
- x = handleBox.x - domBox.x + offsetX;
4169
- y = handleBox.y - domBox.y + offsetY;
4170
- }
4171
- const clonedNode = this.dom.cloneNode(true);
4172
- (_g = event.dataTransfer) === null || _g === void 0 ? void 0 : _g.setDragImage(clonedNode, x, y);
4173
- const pos = this.getPos();
4174
- if (typeof pos !== "number") {
4175
- return;
4176
- }
4177
- const selection = NodeSelection.create(view.state.doc, pos);
4178
- const transaction = view.state.tr.setSelection(selection);
4179
- view.dispatch(transaction);
4180
- }
4181
- stopEvent(event) {
4182
- var _a;
4183
- if (!this.dom) {
4184
- return false;
4185
- }
4186
- if (typeof this.options.stopEvent === "function") {
4187
- return this.options.stopEvent({ event });
4188
- }
4189
- const target = event.target;
4190
- const isInElement = this.dom.contains(target) && !((_a = this.contentDOM) === null || _a === void 0 ? void 0 : _a.contains(target));
4191
- if (!isInElement) {
4192
- return false;
4193
- }
4194
- const isDragEvent = event.type.startsWith("drag");
4195
- const isDropEvent = event.type === "drop";
4196
- const isInput = ["INPUT", "BUTTON", "SELECT", "TEXTAREA"].includes(target.tagName) || target.isContentEditable;
4197
- if (isInput && !isDropEvent && !isDragEvent) {
4198
- return true;
4199
- }
4200
- const { isEditable } = this.editor;
4201
- const { isDragging } = this;
4202
- const isDraggable = !!this.node.type.spec.draggable;
4203
- const isSelectable = NodeSelection.isSelectable(this.node);
4204
- const isCopyEvent = event.type === "copy";
4205
- const isPasteEvent = event.type === "paste";
4206
- const isCutEvent = event.type === "cut";
4207
- const isClickEvent = event.type === "mousedown";
4208
- if (!isDraggable && isSelectable && isDragEvent && event.target === this.dom) {
4209
- event.preventDefault();
4210
- }
4211
- if (isDraggable && isDragEvent && !isDragging && event.target === this.dom) {
4212
- event.preventDefault();
4213
- return false;
4214
- }
4215
- if (isDraggable && isEditable && !isDragging && isClickEvent) {
4216
- const dragHandle = target.closest("[data-drag-handle]");
4217
- const isValidDragHandle = dragHandle && (this.dom === dragHandle || this.dom.contains(dragHandle));
4218
- if (isValidDragHandle) {
4219
- this.isDragging = true;
4220
- document.addEventListener("dragend", () => {
4221
- this.isDragging = false;
4222
- }, { once: true });
4223
- document.addEventListener("drop", () => {
4224
- this.isDragging = false;
4225
- }, { once: true });
4226
- document.addEventListener("mouseup", () => {
4227
- this.isDragging = false;
4228
- }, { once: true });
4229
- }
4230
- }
4231
- if (isDragging || isDropEvent || isCopyEvent || isPasteEvent || isCutEvent || isClickEvent && isSelectable) {
4232
- return false;
4233
- }
4234
- return true;
4235
- }
4236
- /**
4237
- * Called when a DOM [mutation](https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver) or a selection change happens within the view.
4238
- * @return `false` if the editor should re-read the selection or re-parse the range around the mutation
4239
- * @return `true` if it can safely be ignored.
4240
- */
4241
- ignoreMutation(mutation) {
4242
- if (!this.dom || !this.contentDOM) {
4243
- return true;
4244
- }
4245
- if (typeof this.options.ignoreMutation === "function") {
4246
- return this.options.ignoreMutation({ mutation });
4247
- }
4248
- if (this.node.isLeaf || this.node.isAtom) {
4249
- return true;
4250
- }
4251
- if (mutation.type === "selection") {
4252
- return false;
4253
- }
4254
- if (this.dom.contains(mutation.target) && mutation.type === "childList" && (isiOS() || isAndroid()) && this.editor.isFocused) {
4255
- const changedNodes = [
4256
- ...Array.from(mutation.addedNodes),
4257
- ...Array.from(mutation.removedNodes)
4258
- ];
4259
- if (changedNodes.every((node) => node.isContentEditable)) {
4260
- return false;
4261
- }
4262
- }
4263
- if (this.contentDOM === mutation.target && mutation.type === "attributes") {
4264
- return true;
4265
- }
4266
- if (this.contentDOM.contains(mutation.target)) {
4267
- return false;
4268
- }
4269
- return true;
4270
- }
4271
- /**
4272
- * Update the attributes of the prosemirror node.
4273
- */
4274
- updateAttributes(attributes) {
4275
- this.editor.commands.command(({ tr }) => {
4276
- const pos = this.getPos();
4277
- if (typeof pos !== "number") {
4278
- return false;
4279
- }
4280
- tr.setNodeMarkup(pos, void 0, {
4281
- ...this.node.attrs,
4282
- ...attributes
4283
- });
4284
- return true;
4285
- });
4286
- }
4287
- /**
4288
- * Delete the node.
4289
- */
4290
- deleteNode() {
4291
- const from = this.getPos();
4292
- if (typeof from !== "number") {
4293
- return;
4294
- }
4295
- const to = from + this.node.nodeSize;
4296
- this.editor.commands.deleteRange({ from, to });
4297
- }
4298
- }
4299
- function markPasteRule(config) {
4300
- return new PasteRule({
4301
- find: config.find,
4302
- handler: ({ state, range, match, pasteEvent }) => {
4303
- const attributes = callOrReturn(config.getAttributes, void 0, match, pasteEvent);
4304
- if (attributes === false || attributes === null) {
4305
- return null;
4306
- }
4307
- const { tr } = state;
4308
- const captureGroup = match[match.length - 1];
4309
- const fullMatch = match[0];
4310
- let markEnd = range.to;
4311
- if (captureGroup) {
4312
- const startSpaces = fullMatch.search(/\S/);
4313
- const textStart = range.from + fullMatch.indexOf(captureGroup);
4314
- const textEnd = textStart + captureGroup.length;
4315
- const excludedMarks = getMarksBetween(range.from, range.to, state.doc).filter((item) => {
4316
- const excluded = item.mark.type.excluded;
4317
- return excluded.find((type) => type === config.type && type !== item.mark.type);
4318
- }).filter((item) => item.to > textStart);
4319
- if (excludedMarks.length) {
4320
- return null;
4321
- }
4322
- if (textEnd < range.to) {
4323
- tr.delete(textEnd, range.to);
4324
- }
4325
- if (textStart > range.from) {
4326
- tr.delete(range.from + startSpaces, textStart);
4327
- }
4328
- markEnd = range.from + startSpaces + captureGroup.length;
4329
- tr.addMark(range.from + startSpaces, markEnd, config.type.create(attributes || {}));
4330
- tr.removeStoredMark(config.type);
4331
- }
4332
- }
4333
- });
4334
- }
4335
- function escapeForRegEx(string) {
4336
- return string.replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&");
4337
- }
4338
- export {
4339
- Extension as E,
4340
- Mark as M,
4341
- Node as N,
4342
- markPasteRule as a,
4343
- markInputRule as b,
4344
- isNodeSelection as c,
4345
- getTextSerializersFromSchema as d,
4346
- combineTransactionSteps as e,
4347
- getChangedRanges as f,
4348
- getText as g,
4349
- findChildrenInRange as h,
4350
- isTextSelection as i,
4351
- getMarksBetween as j,
4352
- getAttributes as k,
4353
- isNodeEmpty as l,
4354
- mergeAttributes as m,
4355
- nodeInputRule as n,
4356
- escapeForRegEx as o,
4357
- posToDOMRect as p,
4358
- NodeView as q,
4359
- Editor$1 as r,
4360
- textblockTypeInputRule as t,
4361
- wrappingInputRule as w
4362
- };