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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (588) hide show
  1. package/animation/index.es.js +54 -37
  2. package/assets/lottiejs/loading-page.es.js +14 -9
  3. package/assets/lottiejs/loading-plane.es.js +2 -2
  4. package/assets/lottiejs/loading-table.es.js +14 -9
  5. package/assets/lottiejs/no-data.es.js +14 -9
  6. package/backgroundimagecropper/index.es.js +61 -37
  7. package/badge/index.es.js +77 -67
  8. package/badgegroup/index.es.js +62 -50
  9. package/basecalendar/index.es.js +1258 -735
  10. package/basetree/index.es.js +213 -113
  11. package/breadcrumb/index.es.js +46 -38
  12. package/button/index.es.js +60 -54
  13. package/buttonbulkaction/index.es.js +168 -117
  14. package/buttoncopy/index.es.js +25 -22
  15. package/buttondownload/index.es.js +125 -76
  16. package/buttonfilter/index.es.js +21 -15
  17. package/buttonradio/index.es.js +91 -67
  18. package/buttonsearch/index.es.js +62 -46
  19. package/buttonselecttree/index.es.js +233 -172
  20. package/buttontoggle/index.es.js +8 -6
  21. package/calendar/index.es.js +113 -58
  22. package/card/index.es.js +44 -42
  23. package/checkbox/index.es.js +105 -74
  24. package/codesnippet/index.es.js +91 -71
  25. package/codesnippetadapter/index.es.js +25 -21
  26. package/columnlist/index.es.js +249 -171
  27. package/components.d.ts +0 -21
  28. package/config/defaultProps.es.js +9 -9
  29. package/config/index.es.js +11 -10
  30. package/config/locale.es.js +2 -2
  31. package/customcolumn/index.es.js +95 -78
  32. package/datatable/index.es.js +1071 -732
  33. package/dialog/index.es.js +54 -54
  34. package/dialogconfirm/index.es.js +90 -75
  35. package/dialogform/index.es.js +170 -133
  36. package/dialogselecttree/index.es.js +242 -194
  37. package/directives/focus.es.js +13 -8
  38. package/dropdown/index.es.js +250 -196
  39. package/editor/index.es.js +694 -498
  40. package/editorbutton/index.es.js +21 -19
  41. package/event-bus/index.es.js +3 -3
  42. package/event-bus/mitt.es.js +37 -20
  43. package/fieldwrapper/index.es.js +30 -25
  44. package/fileupload/index.es.js +230 -140
  45. package/filtercontainer/index.es.js +299 -222
  46. package/form/index.es.js +176 -126
  47. package/gallerypreview/index.es.js +138 -101
  48. package/icon/index.es.js +38 -36
  49. package/image/index.es.js +161 -108
  50. package/imagecompressor/index.es.js +616 -449
  51. package/imageinputinfo/index.es.js +26 -22
  52. package/inlinemessage/index.es.js +77 -65
  53. package/inputbadge/index.es.js +230 -156
  54. package/inputcurrency/index.es.js +146 -109
  55. package/inputemail/index.es.js +18 -16
  56. package/inputgroup/index.es.js +19 -16
  57. package/inputnumber/index.es.js +252 -182
  58. package/inputpassword/index.es.js +120 -94
  59. package/inputphonenumber/index.es.js +1017 -550
  60. package/inputrangenumber/index.es.js +129 -98
  61. package/inputtext/index.es.js +264 -189
  62. package/inputurl/index.es.js +31 -29
  63. package/invisiblefield/index.es.js +24 -16
  64. package/litedropdown/index.es.js +87 -81
  65. package/loading/index.es.js +21 -19
  66. package/loading-page-BXZ4fLOS.js +8 -0
  67. package/loading-page-BuLpsb_1.js +8 -0
  68. package/loading-page-CNqVBg__.js +4 -0
  69. package/loading-page-DbhhZih2.js +4 -0
  70. package/loading-page-DjfWXoOy.js +8 -0
  71. package/loading-page-S-KRY5zm.js +4 -0
  72. package/loading-plane-C1mi7Whv.js +4 -0
  73. package/loading-plane-CWq1hz_l.js +8 -0
  74. package/loading-table-B7LAXzAp.js +4 -0
  75. package/loading-table-BLmgKUsR.js +4 -0
  76. package/loading-table-CG7-cuhv.js +8 -0
  77. package/loading-table-CUPS49ta.js +4 -0
  78. package/loading-table-CuWWrTbv.js +8 -0
  79. package/loading-table-DbBzVwaZ.js +8 -0
  80. package/mentionlist/index.es.js +77 -44
  81. package/mentionsection/index.es.js +53 -43
  82. package/menu/index.es.js +65 -51
  83. package/menuitem/index.es.js +39 -37
  84. package/multirow/index.es.js +29 -28
  85. package/multiselect/index.es.js +184 -152
  86. package/no-data-B781skt3.js +4 -0
  87. package/no-data-CAksOnDl.js +4 -0
  88. package/no-data-DCsjBXQR.js +4 -0
  89. package/no-data-Dz0QOe7Q.js +8 -0
  90. package/no-data-_Huxiv9q.js +8 -0
  91. package/no-data-ybRQontJ.js +8 -0
  92. package/overlaypanel/index.es.js +49 -36
  93. package/package.json +1 -1
  94. package/paginator/index.es.js +36 -33
  95. package/plugins/WangsVue.es.js +63 -45
  96. package/plugins/formValidation.es.js +15 -11
  97. package/progressbar/index.es.js +39 -32
  98. package/quickfilter/index.es.js +94 -81
  99. package/stats.html +1 -1
  100. package/style.css +1 -1
  101. package/tabmenu/index.es.js +18 -16
  102. package/textarea/index.es.js +94 -72
  103. package/timeline/index.es.js +124 -102
  104. package/timelinecontentbytype/index.es.js +114 -92
  105. package/toast/index.es.js +67 -54
  106. package/toggleswitch/index.es.js +83 -66
  107. package/tree/index.es.js +306 -198
  108. package/treenode/index.es.js +464 -339
  109. package/treesearchinput/index.es.js +32 -26
  110. package/usergroup/index.es.js +83 -67
  111. package/username/index.es.js +99 -85
  112. package/utils/addAttachment.util.es.js +47 -21
  113. package/utils/baseToast.util.es.js +41 -33
  114. package/utils/convertJsonImage.util.es.js +24 -24
  115. package/utils/date.util.es.js +131 -106
  116. package/utils/exportToExcel.util.es.js +81 -47
  117. package/utils/filterOptions.util.es.js +8 -2
  118. package/utils/genPlaceholder.util.es.js +30 -16
  119. package/utils/getProjectPermission.util.es.js +15 -12
  120. package/utils/getSalesRole.util.es.js +4 -4
  121. package/utils/getUser.util.es.js +2 -2
  122. package/utils/getUserType.util.es.js +13 -8
  123. package/utils/isIntersect.es.js +4 -2
  124. package/utils/mergePropsWithDefaults.util.es.js +7 -6
  125. package/utils/object.util.es.js +88 -54
  126. package/utils/queryParamsStringfy.util.es.js +19 -11
  127. package/utils/role.util.es.js +5 -4
  128. package/utils/statusSeverity.util.es.js +20 -5
  129. package/utils/textFormatter.util.es.js +28 -50
  130. package/utils/toast.util.es.js +8 -5
  131. package/utils/xlsx.util.es.js +12 -6
  132. package/validatormessage/index.es.js +9 -9
  133. package/vendor/@popperjs/core/lib/createPopper.es.js +110 -83
  134. package/vendor/@popperjs/core/lib/dom-utils/contains.es.js +14 -13
  135. package/vendor/@popperjs/core/lib/dom-utils/getBoundingClientRect.es.js +33 -18
  136. package/vendor/@popperjs/core/lib/dom-utils/getClippingRect.es.js +55 -31
  137. package/vendor/@popperjs/core/lib/dom-utils/getCompositeRect.es.js +43 -22
  138. package/vendor/@popperjs/core/lib/dom-utils/getComputedStyle.es.js +4 -4
  139. package/vendor/@popperjs/core/lib/dom-utils/getDocumentElement.es.js +5 -5
  140. package/vendor/@popperjs/core/lib/dom-utils/getDocumentRect.es.js +23 -13
  141. package/vendor/@popperjs/core/lib/dom-utils/getHTMLElementScroll.es.js +4 -4
  142. package/vendor/@popperjs/core/lib/dom-utils/getLayoutRect.es.js +17 -9
  143. package/vendor/@popperjs/core/lib/dom-utils/getNodeName.es.js +3 -3
  144. package/vendor/@popperjs/core/lib/dom-utils/getNodeScroll.es.js +11 -7
  145. package/vendor/@popperjs/core/lib/dom-utils/getOffsetParent.es.js +42 -26
  146. package/vendor/@popperjs/core/lib/dom-utils/getParentNode.es.js +13 -10
  147. package/vendor/@popperjs/core/lib/dom-utils/getScrollParent.es.js +13 -7
  148. package/vendor/@popperjs/core/lib/dom-utils/getViewportRect.es.js +25 -15
  149. package/vendor/@popperjs/core/lib/dom-utils/getWindow.es.js +8 -7
  150. package/vendor/@popperjs/core/lib/dom-utils/getWindowScroll.es.js +8 -6
  151. package/vendor/@popperjs/core/lib/dom-utils/getWindowScrollBarX.es.js +6 -6
  152. package/vendor/@popperjs/core/lib/dom-utils/instanceOf.es.js +16 -15
  153. package/vendor/@popperjs/core/lib/dom-utils/isLayoutViewport.es.js +4 -4
  154. package/vendor/@popperjs/core/lib/dom-utils/isScrollParent.es.js +5 -5
  155. package/vendor/@popperjs/core/lib/dom-utils/isTableElement.es.js +4 -4
  156. package/vendor/@popperjs/core/lib/dom-utils/listScrollParents.es.js +17 -11
  157. package/vendor/@popperjs/core/lib/enums.es.js +43 -20
  158. package/vendor/@popperjs/core/lib/modifiers/applyStyles.es.js +49 -25
  159. package/vendor/@popperjs/core/lib/modifiers/arrow.es.js +61 -26
  160. package/vendor/@popperjs/core/lib/modifiers/computeStyles.es.js +101 -69
  161. package/vendor/@popperjs/core/lib/modifiers/eventListeners.es.js +30 -16
  162. package/vendor/@popperjs/core/lib/modifiers/flip.es.js +99 -60
  163. package/vendor/@popperjs/core/lib/modifiers/hide.es.js +44 -31
  164. package/vendor/@popperjs/core/lib/modifiers/offset.es.js +32 -20
  165. package/vendor/@popperjs/core/lib/modifiers/popperOffsets.es.js +11 -11
  166. package/vendor/@popperjs/core/lib/modifiers/preventOverflow.es.js +91 -40
  167. package/vendor/@popperjs/core/lib/popper.es.js +14 -13
  168. package/vendor/@popperjs/core/lib/utils/computeAutoPlacement.es.js +29 -21
  169. package/vendor/@popperjs/core/lib/utils/computeOffsets.es.js +41 -36
  170. package/vendor/@popperjs/core/lib/utils/debounce.es.js +11 -7
  171. package/vendor/@popperjs/core/lib/utils/detectOverflow.es.js +42 -28
  172. package/vendor/@popperjs/core/lib/utils/expandToHashMap.es.js +5 -4
  173. package/vendor/@popperjs/core/lib/utils/getAltAxis.es.js +3 -3
  174. package/vendor/@popperjs/core/lib/utils/getBasePlacement.es.js +3 -3
  175. package/vendor/@popperjs/core/lib/utils/getFreshSideObject.es.js +2 -2
  176. package/vendor/@popperjs/core/lib/utils/getMainAxisFromPlacement.es.js +3 -3
  177. package/vendor/@popperjs/core/lib/utils/getOppositePlacement.es.js +5 -5
  178. package/vendor/@popperjs/core/lib/utils/getOppositeVariationPlacement.es.js +5 -5
  179. package/vendor/@popperjs/core/lib/utils/getVariation.es.js +3 -3
  180. package/vendor/@popperjs/core/lib/utils/math.es.js +6 -4
  181. package/vendor/@popperjs/core/lib/utils/mergeByName.es.js +11 -10
  182. package/vendor/@popperjs/core/lib/utils/mergePaddingObject.es.js +4 -4
  183. package/vendor/@popperjs/core/lib/utils/orderModifiers.es.js +30 -22
  184. package/vendor/@popperjs/core/lib/utils/rectToClientRect.es.js +7 -7
  185. package/vendor/@popperjs/core/lib/utils/userAgent.es.js +9 -6
  186. package/vendor/@popperjs/core/lib/utils/within.es.js +8 -8
  187. package/vendor/@tiptap/core/dist/index.es.js +3494 -2000
  188. package/vendor/@tiptap/extension-bold/dist/index.es.js +29 -19
  189. package/vendor/@tiptap/extension-bubble-menu/dist/index.es.js +145 -71
  190. package/vendor/@tiptap/extension-bullet-list/dist/index.es.js +32 -19
  191. package/vendor/@tiptap/extension-code/dist/index.es.js +22 -14
  192. package/vendor/@tiptap/extension-document/dist/index.es.js +4 -4
  193. package/vendor/@tiptap/extension-floating-menu/dist/index.es.js +106 -51
  194. package/vendor/@tiptap/extension-heading/dist/index.es.js +38 -22
  195. package/vendor/@tiptap/extension-history/dist/index.es.js +11 -7
  196. package/vendor/@tiptap/extension-image/dist/index.es.js +20 -17
  197. package/vendor/@tiptap/extension-italic/dist/index.es.js +28 -18
  198. package/vendor/@tiptap/extension-link/dist/index.es.js +236 -147
  199. package/vendor/@tiptap/extension-list-item/dist/index.es.js +6 -6
  200. package/vendor/@tiptap/extension-mention/dist/index.es.js +98 -63
  201. package/vendor/@tiptap/extension-ordered-list/dist/index.es.js +38 -25
  202. package/vendor/@tiptap/extension-paragraph/dist/index.es.js +8 -6
  203. package/vendor/@tiptap/extension-placeholder/dist/index.es.js +34 -27
  204. package/vendor/@tiptap/extension-text/dist/index.es.js +3 -3
  205. package/vendor/@tiptap/extension-underline/dist/index.es.js +16 -10
  206. package/vendor/@tiptap/suggestion/dist/index.es.js +174 -90
  207. package/vendor/@tiptap/vue-3/dist/index.es.js +287 -188
  208. package/vendor/@wangs-ui/core/components/p-BU8h34na.es.js +17 -14
  209. package/vendor/@wangs-ui/core/components/p-C5lMEBcj.es.js +69 -55
  210. package/vendor/@wangs-ui/core/components/p-CKYwZoTo.es.js +26 -22
  211. package/vendor/@wangs-ui/core/components/p-CsoK-EWG.es.js +147 -102
  212. package/vendor/@wangs-ui/core/components/p-DPHEi31J.es.js +102 -77
  213. package/vendor/@wangs-ui/core/components/p-DTTCzifR.es.js +1298 -551
  214. package/vendor/@wangs-ui/core/components/p-Duri5p90.es.js +60 -49
  215. package/vendor/@wangs-ui/core/components/wangs-button.es.js +19 -15
  216. package/vendor/@wangs-ui/core/components/wangs-icon.es.js +3 -3
  217. package/vendor/@wangs-ui/core/components/wangs-input-otp.es.js +3 -3
  218. package/vendor/@wangs-ui/core/components/wangs-tab-menu.es.js +3 -3
  219. package/vendor/@wangs-ui/core/dist/esm/index-DCkh3cGv.es.js +116 -102
  220. package/vendor/@wangs-ui/vue/dist/index.es.js +77 -77
  221. package/vendor/base64toblob/base64toblob.es.js +31 -15
  222. package/vendor/highlight.js/es/core.es.js +5 -5
  223. package/vendor/highlight.js/es/languages/javascript.es.js +237 -193
  224. package/vendor/highlight.js/es/languages/json.es.js +18 -15
  225. package/vendor/highlight.js/es/languages/typescript.es.js +288 -228
  226. package/vendor/highlight.js/es/languages/vbscript-html.es.js +2 -2
  227. package/vendor/highlight.js/lib/core.es.js +1144 -666
  228. package/vendor/linkifyjs/dist/linkify.es.es.js +858 -405
  229. package/vendor/lodash/_Symbol.es.js +11 -8
  230. package/vendor/lodash/_baseGetTag.es.js +19 -12
  231. package/vendor/lodash/_baseTrim.es.js +13 -10
  232. package/vendor/lodash/_freeGlobal.es.js +10 -8
  233. package/vendor/lodash/_getRawTag.es.js +28 -15
  234. package/vendor/lodash/_objectToString.es.js +12 -9
  235. package/vendor/lodash/_root.es.js +12 -8
  236. package/vendor/lodash/_trimmedEndIndex.es.js +14 -11
  237. package/vendor/lodash/debounce.es.js +92 -54
  238. package/vendor/lodash/isObject.es.js +11 -9
  239. package/vendor/lodash/isObjectLike.es.js +10 -8
  240. package/vendor/lodash/isSymbol.es.js +14 -11
  241. package/vendor/lodash/now.es.js +12 -9
  242. package/vendor/lodash/throttle.es.js +25 -17
  243. package/vendor/lodash/toNumber.es.js +33 -23
  244. package/vendor/lodash-es/_DataView.es.js +4 -4
  245. package/vendor/lodash-es/_Hash.es.js +17 -16
  246. package/vendor/lodash-es/_ListCache.es.js +17 -16
  247. package/vendor/lodash-es/_Map.es.js +4 -4
  248. package/vendor/lodash-es/_MapCache.es.js +17 -16
  249. package/vendor/lodash-es/_Promise.es.js +4 -4
  250. package/vendor/lodash-es/_Set.es.js +4 -4
  251. package/vendor/lodash-es/_SetCache.es.js +12 -10
  252. package/vendor/lodash-es/_Stack.es.js +15 -15
  253. package/vendor/lodash-es/_Symbol.es.js +3 -3
  254. package/vendor/lodash-es/_Uint8Array.es.js +3 -3
  255. package/vendor/lodash-es/_WeakMap.es.js +4 -4
  256. package/vendor/lodash-es/_arrayEach.es.js +9 -5
  257. package/vendor/lodash-es/_arrayFilter.es.js +9 -6
  258. package/vendor/lodash-es/_arrayLikeKeys.es.js +21 -17
  259. package/vendor/lodash-es/_arrayPush.es.js +7 -5
  260. package/vendor/lodash-es/_arraySome.es.js +9 -6
  261. package/vendor/lodash-es/_assignValue.es.js +10 -7
  262. package/vendor/lodash-es/_assocIndexOf.es.js +9 -6
  263. package/vendor/lodash-es/_baseAssignValue.es.js +13 -9
  264. package/vendor/lodash-es/_baseClone.es.js +67 -49
  265. package/vendor/lodash-es/_baseCreate.es.js +15 -11
  266. package/vendor/lodash-es/_baseGetAllKeys.es.js +6 -6
  267. package/vendor/lodash-es/_baseGetTag.es.js +11 -7
  268. package/vendor/lodash-es/_baseIsArguments.es.js +6 -6
  269. package/vendor/lodash-es/_baseIsEqual.es.js +11 -5
  270. package/vendor/lodash-es/_baseIsEqualDeep.es.js +39 -26
  271. package/vendor/lodash-es/_baseIsMap.es.js +6 -6
  272. package/vendor/lodash-es/_baseIsNative.es.js +18 -12
  273. package/vendor/lodash-es/_baseIsSet.es.js +6 -6
  274. package/vendor/lodash-es/_baseIsTypedArray.es.js +11 -9
  275. package/vendor/lodash-es/_baseKeys.es.js +16 -11
  276. package/vendor/lodash-es/_baseTimes.es.js +7 -5
  277. package/vendor/lodash-es/_baseTrim.es.js +5 -5
  278. package/vendor/lodash-es/_baseUnary.es.js +4 -4
  279. package/vendor/lodash-es/_cacheHas.es.js +3 -3
  280. package/vendor/lodash-es/_cloneArrayBuffer.es.js +6 -5
  281. package/vendor/lodash-es/_cloneBuffer.es.js +11 -6
  282. package/vendor/lodash-es/_cloneDataView.es.js +5 -5
  283. package/vendor/lodash-es/_cloneRegExp.es.js +6 -5
  284. package/vendor/lodash-es/_cloneSymbol.es.js +5 -5
  285. package/vendor/lodash-es/_cloneTypedArray.es.js +5 -5
  286. package/vendor/lodash-es/_coreJsData.es.js +3 -3
  287. package/vendor/lodash-es/_defineProperty.es.js +7 -6
  288. package/vendor/lodash-es/_equalArrays.es.js +38 -28
  289. package/vendor/lodash-es/_equalByTag.es.js +55 -41
  290. package/vendor/lodash-es/_equalObjects.es.js +42 -28
  291. package/vendor/lodash-es/_freeGlobal.es.js +2 -2
  292. package/vendor/lodash-es/_getAllKeys.es.js +6 -6
  293. package/vendor/lodash-es/_getMapData.es.js +5 -5
  294. package/vendor/lodash-es/_getNative.es.js +6 -6
  295. package/vendor/lodash-es/_getPrototype.es.js +3 -3
  296. package/vendor/lodash-es/_getRawTag.es.js +20 -10
  297. package/vendor/lodash-es/_getSymbols.es.js +15 -8
  298. package/vendor/lodash-es/_getTag.es.js +31 -25
  299. package/vendor/lodash-es/_getValue.es.js +3 -3
  300. package/vendor/lodash-es/_hashClear.es.js +5 -4
  301. package/vendor/lodash-es/_hashDelete.es.js +5 -4
  302. package/vendor/lodash-es/_hashGet.es.js +11 -9
  303. package/vendor/lodash-es/_hashHas.es.js +7 -6
  304. package/vendor/lodash-es/_hashSet.es.js +8 -6
  305. package/vendor/lodash-es/_initCloneArray.es.js +10 -5
  306. package/vendor/lodash-es/_initCloneByTag.es.js +39 -38
  307. package/vendor/lodash-es/_initCloneObject.es.js +6 -6
  308. package/vendor/lodash-es/_isIndex.es.js +7 -5
  309. package/vendor/lodash-es/_isKeyable.es.js +4 -4
  310. package/vendor/lodash-es/_isMasked.es.js +7 -7
  311. package/vendor/lodash-es/_isPrototype.es.js +5 -5
  312. package/vendor/lodash-es/_listCacheClear.es.js +4 -3
  313. package/vendor/lodash-es/_listCacheDelete.es.js +17 -9
  314. package/vendor/lodash-es/_listCacheGet.es.js +5 -5
  315. package/vendor/lodash-es/_listCacheHas.es.js +4 -4
  316. package/vendor/lodash-es/_listCacheSet.es.js +11 -5
  317. package/vendor/lodash-es/_mapCacheClear.es.js +10 -9
  318. package/vendor/lodash-es/_mapCacheDelete.es.js +6 -5
  319. package/vendor/lodash-es/_mapCacheGet.es.js +4 -4
  320. package/vendor/lodash-es/_mapCacheHas.es.js +4 -4
  321. package/vendor/lodash-es/_mapCacheSet.es.js +7 -5
  322. package/vendor/lodash-es/_mapToArray.es.js +7 -6
  323. package/vendor/lodash-es/_nativeCreate.es.js +3 -3
  324. package/vendor/lodash-es/_nativeKeys.es.js +3 -3
  325. package/vendor/lodash-es/_nodeUtil.es.js +13 -6
  326. package/vendor/lodash-es/_objectToString.es.js +5 -4
  327. package/vendor/lodash-es/_overArg.es.js +4 -4
  328. package/vendor/lodash-es/_root.es.js +4 -3
  329. package/vendor/lodash-es/_setCacheAdd.es.js +5 -4
  330. package/vendor/lodash-es/_setCacheHas.es.js +3 -3
  331. package/vendor/lodash-es/_setToArray.es.js +7 -6
  332. package/vendor/lodash-es/_stackClear.es.js +5 -4
  333. package/vendor/lodash-es/_stackDelete.es.js +5 -4
  334. package/vendor/lodash-es/_stackGet.es.js +3 -3
  335. package/vendor/lodash-es/_stackHas.es.js +3 -3
  336. package/vendor/lodash-es/_stackSet.es.js +18 -13
  337. package/vendor/lodash-es/_toSource.es.js +9 -8
  338. package/vendor/lodash-es/_trimmedEndIndex.es.js +7 -6
  339. package/vendor/lodash-es/cloneDeep.es.js +5 -5
  340. package/vendor/lodash-es/debounce.es.js +84 -49
  341. package/vendor/lodash-es/eq.es.js +3 -3
  342. package/vendor/lodash-es/isArguments.es.js +9 -6
  343. package/vendor/lodash-es/isArray.es.js +2 -2
  344. package/vendor/lodash-es/isArrayLike.es.js +5 -5
  345. package/vendor/lodash-es/isBuffer.es.js +9 -4
  346. package/vendor/lodash-es/isEqual.es.js +4 -4
  347. package/vendor/lodash-es/isFunction.es.js +10 -9
  348. package/vendor/lodash-es/isLength.es.js +4 -4
  349. package/vendor/lodash-es/isMap.es.js +6 -5
  350. package/vendor/lodash-es/isObject.es.js +4 -4
  351. package/vendor/lodash-es/isObjectLike.es.js +3 -3
  352. package/vendor/lodash-es/isSet.es.js +6 -5
  353. package/vendor/lodash-es/isSymbol.es.js +6 -6
  354. package/vendor/lodash-es/isTypedArray.es.js +6 -5
  355. package/vendor/lodash-es/keys.es.js +6 -6
  356. package/vendor/lodash-es/now.es.js +4 -4
  357. package/vendor/lodash-es/stubArray.es.js +2 -2
  358. package/vendor/lodash-es/stubFalse.es.js +3 -3
  359. package/vendor/lodash-es/toNumber.es.js +25 -18
  360. package/vendor/lodash-es/toString.es.js +2 -2
  361. package/vendor/lodash-es/uniqueId.es.js +6 -6
  362. package/vendor/orderedmap/dist/index.es.js +65 -49
  363. package/vendor/primevue/api/api.esm.es.js +214 -121
  364. package/vendor/primevue/avatar/avatar.esm.es.js +44 -41
  365. package/vendor/primevue/avatar/style/avatarstyle.esm.es.js +12 -11
  366. package/vendor/primevue/avatargroup/avatargroup.esm.es.js +17 -16
  367. package/vendor/primevue/avatargroup/style/avatargroupstyle.esm.es.js +6 -5
  368. package/vendor/primevue/badge/badge.esm.es.js +21 -20
  369. package/vendor/primevue/badge/style/badgestyle.esm.es.js +19 -18
  370. package/vendor/primevue/base/style/basestyle.esm.es.js +88 -99
  371. package/vendor/primevue/basecomponent/basecomponent.esm.es.js +327 -261
  372. package/vendor/primevue/basedirective/basedirective.esm.es.js +257 -186
  373. package/vendor/primevue/baseicon/baseicon.esm.es.js +55 -49
  374. package/vendor/primevue/baseicon/style/baseiconstyle.esm.es.js +5 -35
  375. package/vendor/primevue/button/button.esm.es.js +76 -72
  376. package/vendor/primevue/button/style/buttonstyle.esm.es.js +46 -39
  377. package/vendor/primevue/card/card.esm.es.js +30 -29
  378. package/vendor/primevue/card/style/cardstyle.esm.es.js +6 -5
  379. package/vendor/primevue/checkbox/checkbox.esm.es.js +109 -101
  380. package/vendor/primevue/checkbox/style/checkboxstyle.esm.es.js +12 -11
  381. package/vendor/primevue/config/config.esm.es.js +76 -58
  382. package/vendor/primevue/dialog/dialog.esm.es.js +421 -281
  383. package/vendor/primevue/dialog/style/dialogstyle.esm.es.js +26 -22
  384. package/vendor/primevue/dropdown/dropdown.esm.es.js +956 -742
  385. package/vendor/primevue/dropdown/style/dropdownstyle.esm.es.js +33 -31
  386. package/vendor/primevue/fileupload/fileupload.esm.es.js +559 -450
  387. package/vendor/primevue/fileupload/style/fileuploadstyle.esm.es.js +14 -13
  388. package/vendor/primevue/focustrap/focustrap.esm.es.js +128 -90
  389. package/vendor/primevue/focustrap/style/focustrapstyle.esm.es.js +2 -2
  390. package/vendor/primevue/icons/angledoubleleft/index.esm.es.js +13 -11
  391. package/vendor/primevue/icons/angledoubleright/index.esm.es.js +13 -11
  392. package/vendor/primevue/icons/angledown/index.esm.es.js +13 -11
  393. package/vendor/primevue/icons/angleleft/index.esm.es.js +13 -11
  394. package/vendor/primevue/icons/angleright/index.esm.es.js +13 -11
  395. package/vendor/primevue/icons/angleup/index.esm.es.js +13 -11
  396. package/vendor/primevue/icons/blank/index.esm.es.js +13 -11
  397. package/vendor/primevue/icons/check/index.esm.es.js +13 -11
  398. package/vendor/primevue/icons/chevrondown/index.esm.es.js +13 -11
  399. package/vendor/primevue/icons/exclamationtriangle/index.esm.es.js +17 -13
  400. package/vendor/primevue/icons/eye/index.esm.es.js +13 -11
  401. package/vendor/primevue/icons/eyeslash/index.esm.es.js +13 -11
  402. package/vendor/primevue/icons/infocircle/index.esm.es.js +13 -11
  403. package/vendor/primevue/icons/plus/index.esm.es.js +13 -11
  404. package/vendor/primevue/icons/refresh/index.esm.es.js +13 -11
  405. package/vendor/primevue/icons/search/index.esm.es.js +13 -11
  406. package/vendor/primevue/icons/searchminus/index.esm.es.js +13 -11
  407. package/vendor/primevue/icons/searchplus/index.esm.es.js +13 -11
  408. package/vendor/primevue/icons/spinner/index.esm.es.js +13 -11
  409. package/vendor/primevue/icons/times/index.esm.es.js +13 -11
  410. package/vendor/primevue/icons/timescircle/index.esm.es.js +13 -11
  411. package/vendor/primevue/icons/undo/index.esm.es.js +13 -11
  412. package/vendor/primevue/icons/upload/index.esm.es.js +13 -11
  413. package/vendor/primevue/icons/windowmaximize/index.esm.es.js +13 -11
  414. package/vendor/primevue/icons/windowminimize/index.esm.es.js +13 -11
  415. package/vendor/primevue/image/image.esm.es.js +280 -235
  416. package/vendor/primevue/image/style/imagestyle.esm.es.js +18 -17
  417. package/vendor/primevue/inputgroup/inputgroup.esm.es.js +17 -16
  418. package/vendor/primevue/inputgroup/style/inputgroupstyle.esm.es.js +6 -5
  419. package/vendor/primevue/inputgroupaddon/inputgroupaddon.esm.es.js +17 -16
  420. package/vendor/primevue/inputgroupaddon/style/inputgroupaddonstyle.esm.es.js +6 -5
  421. package/vendor/primevue/inputnumber/inputnumber.esm.es.js +834 -566
  422. package/vendor/primevue/inputnumber/style/inputnumberstyle.esm.es.js +23 -22
  423. package/vendor/primevue/inputtext/inputtext.esm.es.js +32 -30
  424. package/vendor/primevue/inputtext/style/inputtextstyle.esm.es.js +13 -12
  425. package/vendor/primevue/menu/menu.esm.es.js +402 -304
  426. package/vendor/primevue/menu/style/menustyle.esm.es.js +14 -13
  427. package/vendor/primevue/message/message.esm.es.js +126 -112
  428. package/vendor/primevue/message/style/messagestyle.esm.es.js +9 -8
  429. package/vendor/primevue/multiselect/multiselect.esm.es.js +1083 -835
  430. package/vendor/primevue/multiselect/style/multiselectstyle.esm.es.js +38 -36
  431. package/vendor/primevue/overlayeventbus/overlayeventbus.esm.es.js +3 -3
  432. package/vendor/primevue/overlaypanel/overlaypanel.esm.es.js +275 -169
  433. package/vendor/primevue/overlaypanel/style/overlaypanelstyle.esm.es.js +9 -8
  434. package/vendor/primevue/paginator/paginator.esm.es.js +513 -469
  435. package/vendor/primevue/paginator/style/paginatorstyle.esm.es.js +50 -43
  436. package/vendor/primevue/password/password.esm.es.js +306 -233
  437. package/vendor/primevue/password/style/passwordstyle.esm.es.js +26 -24
  438. package/vendor/primevue/portal/portal.esm.es.js +17 -17
  439. package/vendor/primevue/progressbar/progressbar.esm.es.js +37 -35
  440. package/vendor/primevue/progressbar/style/progressbarstyle.esm.es.js +10 -9
  441. package/vendor/primevue/ripple/ripple.esm.es.js +90 -62
  442. package/vendor/primevue/ripple/style/ripplestyle.esm.es.js +6 -5
  443. package/vendor/primevue/selectbutton/selectbutton.esm.es.js +213 -167
  444. package/vendor/primevue/selectbutton/style/selectbuttonstyle.esm.es.js +14 -13
  445. package/vendor/primevue/skeleton/skeleton.esm.es.js +28 -26
  446. package/vendor/primevue/skeleton/style/skeletonstyle.esm.es.js +13 -11
  447. package/vendor/primevue/textarea/style/textareastyle.esm.es.js +12 -11
  448. package/vendor/primevue/textarea/textarea.esm.es.js +49 -33
  449. package/vendor/primevue/timeline/style/timelinestyle.esm.es.js +9 -8
  450. package/vendor/primevue/timeline/timeline.esm.es.js +53 -52
  451. package/vendor/primevue/toast/style/toaststyle.esm.es.js +54 -46
  452. package/vendor/primevue/toast/toast.esm.es.js +309 -260
  453. package/vendor/primevue/toasteventbus/toasteventbus.esm.es.js +3 -3
  454. package/vendor/primevue/toastservice/toastservice.esm.es.js +16 -15
  455. package/vendor/primevue/tooltip/style/tooltipstyle.esm.es.js +6 -5
  456. package/vendor/primevue/tooltip/tooltip.esm.es.js +383 -186
  457. package/vendor/primevue/usestyle/usestyle.esm.es.js +94 -64
  458. package/vendor/primevue/usetoast/usetoast.esm.es.js +9 -8
  459. package/vendor/primevue/utils/utils.esm.es.js +1078 -772
  460. package/vendor/primevue/virtualscroller/style/virtualscrollerstyle.esm.es.js +5 -67
  461. package/vendor/primevue/virtualscroller/virtualscroller.esm.es.js +655 -428
  462. package/vendor/prosemirror-commands/dist/index.es.js +454 -316
  463. package/vendor/prosemirror-history/dist/index.es.js +286 -178
  464. package/vendor/prosemirror-keymap/dist/index.es.js +68 -48
  465. package/vendor/prosemirror-model/dist/index.es.js +1905 -1436
  466. package/vendor/prosemirror-schema-list/dist/index.es.js +115 -73
  467. package/vendor/prosemirror-state/dist/index.es.js +467 -353
  468. package/vendor/prosemirror-transform/dist/index.es.js +1146 -829
  469. package/vendor/prosemirror-view/dist/index.es.js +4127 -2719
  470. package/vendor/rope-sequence/dist/index.es.js +165 -82
  471. package/vendor/simplebar-core/dist/index.es.js +670 -242
  472. package/vendor/simplebar-vue/dist/simplebar-vue.esm.es.js +73 -60
  473. package/vendor/single-spa/lib/es2015/esm/single-spa.min.es.js +511 -510
  474. package/vendor/tippy.js/dist/tippy.esm.es.js +971 -525
  475. package/vendor/vee-validate/dist/vee-validate.esm.es.js +1830 -1097
  476. package/vendor/vue-advanced-cropper/dist/index.esm-bundler.es.js +740 -738
  477. package/vendor/w3c-keyname/index.es.js +25 -13
  478. package/wangsvue.es.js +167 -208
  479. package/wangsvue.esm.browser.js +67705 -0
  480. package/wangsvue.system.js +67600 -234
  481. package/api/index.es.js +0 -149
  482. package/apiitem/index.es.js +0 -611
  483. package/assignmember/index.es.js +0 -434
  484. package/attachment/index.es.js +0 -118
  485. package/attachmentchangelog/index.es.js +0 -79
  486. package/attachmentitem/index.es.js +0 -231
  487. package/attachmentthumbnail/index.es.js +0 -83
  488. package/changelog/index.d.ts +0 -164
  489. package/changelog/index.es.js +0 -85
  490. package/changelogfilter/index.es.js +0 -113
  491. package/changelogpage/index.d.ts +0 -184
  492. package/changelogpage/index.es.js +0 -176
  493. package/checklist/index.es.js +0 -571
  494. package/checklistchangelog/index.es.js +0 -85
  495. package/comment/index.d.ts +0 -187
  496. package/comment/index.es.js +0 -267
  497. package/commentblock/index.es.js +0 -337
  498. package/confirmdeploy/index.es.js +0 -64
  499. package/dependencycol/index.es.js +0 -32
  500. package/description/index.es.js +0 -135
  501. package/descriptiontab/index.es.js +0 -30
  502. package/detailmember/index.d.ts +0 -77
  503. package/detailmember/index.es.js +0 -32
  504. package/detailmemberadmin/index.es.js +0 -210
  505. package/detailmemberleader/index.es.js +0 -164
  506. package/detailmemberlog/index.es.js +0 -117
  507. package/detailsprint/index.d.ts +0 -86
  508. package/detailsprint/index.es.js +0 -414
  509. package/dialogaddattachment/index.es.js +0 -273
  510. package/dialogaddchecklist/index.es.js +0 -120
  511. package/dialogaddeditapi/index.es.js +0 -87
  512. package/dialogaddpbi/index.es.js +0 -197
  513. package/dialogadjustmenttask/index.es.js +0 -484
  514. package/dialogadjustmenttaskheader/index.es.js +0 -193
  515. package/dialogapichangelog/index.es.js +0 -83
  516. package/dialogassignmember/index.es.js +0 -171
  517. package/dialogconfirmapproval/index.es.js +0 -54
  518. package/dialogconfirmchecklist/index.es.js +0 -189
  519. package/dialogconfirmdeletetask/index.es.js +0 -70
  520. package/dialogconfirmdeletetaskpermanently/index.es.js +0 -50
  521. package/dialogconfirmedit/index.es.js +0 -50
  522. package/dialogconfirmfinishtask/index.es.js +0 -50
  523. package/dialogconfirmrestoretask/index.es.js +0 -46
  524. package/dialogconfirmsprint/index.es.js +0 -42
  525. package/dialogcopyapi/index.es.js +0 -130
  526. package/dialogcustomdependency/index.es.js +0 -55
  527. package/dialogdetailchecklisttemplate/index.es.js +0 -214
  528. package/dialogdetailcomponent/index.es.js +0 -121
  529. package/dialogdetailpbi/index.es.js +0 -192
  530. package/dialogfinishreview/index.es.js +0 -126
  531. package/dialogimprovementtask/index.es.js +0 -191
  532. package/dialogmemberadmin/index.es.js +0 -93
  533. package/dialogpreparepbi/index.es.js +0 -93
  534. package/dialogpriorityvalue/index.es.js +0 -85
  535. package/dialogreportbug/index.es.js +0 -207
  536. package/dialogreviewleader/index.es.js +0 -280
  537. package/dialogsavechecklisttemplate/index.es.js +0 -127
  538. package/dialogselectproject/index.es.js +0 -69
  539. package/dialogsetduration/index.es.js +0 -109
  540. package/dialogsettasklink/index.es.js +0 -153
  541. package/dialogtestapi/index.es.js +0 -389
  542. package/eventlogtab/index.es.js +0 -50
  543. package/infotasktab/index.es.js +0 -186
  544. package/inputadditional/index.es.js +0 -62
  545. package/inputinitialname/index.d.ts +0 -118
  546. package/inputinitialname/index.es.js +0 -95
  547. package/inputrepositoryname/index.d.ts +0 -86
  548. package/inputrepositoryname/index.es.js +0 -41
  549. package/isrequiredtext/index.es.js +0 -16
  550. package/legend/index.es.js +0 -727
  551. package/legendlist/index.es.js +0 -33
  552. package/loading-page-BrQattYE.js +0 -1
  553. package/loading-page-CgfbWppy.js +0 -1
  554. package/loading-page-DbLuqCHa.js +0 -1
  555. package/loading-plane-CgfbWppy.js +0 -1
  556. package/loading-table-Bdr9ZhtP.js +0 -1
  557. package/loading-table-BzrSQlA0.js +0 -1
  558. package/loading-table-chOgXi94.js +0 -1
  559. package/no-data-Cgze_Rvp.js +0 -1
  560. package/no-data-Dep79CBh.js +0 -1
  561. package/no-data-y1X5WtcQ.js +0 -1
  562. package/notificationitem/index.d.ts +0 -107
  563. package/notificationitem/index.es.js +0 -333
  564. package/reviewitem/index.es.js +0 -65
  565. package/reviewtab/index.es.js +0 -44
  566. package/services/calendar.service.es.js +0 -32
  567. package/sonarqubesummary/index.es.js +0 -234
  568. package/sprintsummary/index.es.js +0 -73
  569. package/summaryaccordion/index.d.ts +0 -121
  570. package/summaryaccordion/index.es.js +0 -365
  571. package/taskdependency/index.es.js +0 -686
  572. package/taskdetail/index.d.ts +0 -82
  573. package/taskdetail/index.es.js +0 -491
  574. package/taskdetailpbi/index.d.ts +0 -35
  575. package/taskdetailpbi/index.es.js +0 -172
  576. package/taskdetailunassignedpbi/index.es.js +0 -261
  577. package/tasklink/index.es.js +0 -257
  578. package/tasklinkchangelog/index.es.js +0 -93
  579. package/tasklist/index.es.js +0 -92
  580. package/taskmore/index.es.js +0 -52
  581. package/taskstatusbadge/index.es.js +0 -18
  582. package/tasktable/index.d.ts +0 -87
  583. package/tasktable/index.es.js +0 -832
  584. package/ticket/index.es.js +0 -151
  585. package/tooltipspan/index.es.js +0 -30
  586. package/utils/updateSprintStatus.util.es.js +0 -17
  587. package/valueformdatainput/index.es.js +0 -70
  588. package/workcalendar/index.es.js +0 -351
@@ -1,14 +1,16 @@
1
- import { b as m, F as x, N as B, M as J } from "../../prosemirror-model/dist/index.es.js";
2
- import { R as P, b as K, T as $ } from "../../prosemirror-transform/dist/index.es.js";
3
- const M = /* @__PURE__ */ Object.create(null);
4
- class l {
1
+ import { b as Slice, F as Fragment, N as Node, M as Mark } from "../../prosemirror-model/dist/index.es.js";
2
+ import { R as ReplaceStep, b as ReplaceAroundStep, T as Transform } from "../../prosemirror-transform/dist/index.es.js";
3
+ const classesById = /* @__PURE__ */ Object.create(null);
4
+ class Selection {
5
5
  /**
6
6
  Initialize a selection with the head and anchor and ranges. If no
7
7
  ranges are given, constructs a single range across `$anchor` and
8
8
  `$head`.
9
9
  */
10
- constructor(e, t, r) {
11
- this.$anchor = e, this.$head = t, this.ranges = r || [new q(e.min(t), e.max(t))];
10
+ constructor($anchor, $head, ranges) {
11
+ this.$anchor = $anchor;
12
+ this.$head = $head;
13
+ this.ranges = ranges || [new SelectionRange($anchor.min($head), $anchor.max($head))];
12
14
  }
13
15
  /**
14
16
  The selection's anchor, as an unresolved position.
@@ -50,41 +52,51 @@ class l {
50
52
  Indicates whether the selection contains any content.
51
53
  */
52
54
  get empty() {
53
- let e = this.ranges;
54
- for (let t = 0; t < e.length; t++)
55
- if (e[t].$from.pos != e[t].$to.pos)
56
- return !1;
57
- return !0;
55
+ let ranges = this.ranges;
56
+ for (let i = 0; i < ranges.length; i++)
57
+ if (ranges[i].$from.pos != ranges[i].$to.pos)
58
+ return false;
59
+ return true;
58
60
  }
59
61
  /**
60
62
  Get the content of this selection as a slice.
61
63
  */
62
64
  content() {
63
- return this.$from.doc.slice(this.from, this.to, !0);
65
+ return this.$from.doc.slice(this.from, this.to, true);
64
66
  }
65
67
  /**
66
68
  Replace the selection with a slice or, if no slice is given,
67
69
  delete the selection. Will append to the given transaction.
68
70
  */
69
- replace(e, t = m.empty) {
70
- let r = t.content.lastChild, n = null;
71
- for (let a = 0; a < t.openEnd; a++)
72
- n = r, r = r.lastChild;
73
- let s = e.steps.length, o = this.ranges;
74
- for (let a = 0; a < o.length; a++) {
75
- let { $from: c, $to: u } = o[a], h = e.mapping.slice(s);
76
- e.replaceRange(h.map(c.pos), h.map(u.pos), a ? m.empty : t), a == 0 && I(e, s, (r ? r.isInline : n && n.isTextblock) ? -1 : 1);
71
+ replace(tr, content = Slice.empty) {
72
+ let lastNode = content.content.lastChild, lastParent = null;
73
+ for (let i = 0; i < content.openEnd; i++) {
74
+ lastParent = lastNode;
75
+ lastNode = lastNode.lastChild;
76
+ }
77
+ let mapFrom = tr.steps.length, ranges = this.ranges;
78
+ for (let i = 0; i < ranges.length; i++) {
79
+ let { $from, $to } = ranges[i], mapping = tr.mapping.slice(mapFrom);
80
+ tr.replaceRange(mapping.map($from.pos), mapping.map($to.pos), i ? Slice.empty : content);
81
+ if (i == 0)
82
+ selectionToInsertionEnd(tr, mapFrom, (lastNode ? lastNode.isInline : lastParent && lastParent.isTextblock) ? -1 : 1);
77
83
  }
78
84
  }
79
85
  /**
80
86
  Replace the selection with the given node, appending the changes
81
87
  to the given transaction.
82
88
  */
83
- replaceWith(e, t) {
84
- let r = e.steps.length, n = this.ranges;
85
- for (let s = 0; s < n.length; s++) {
86
- let { $from: o, $to: a } = n[s], c = e.mapping.slice(r), u = c.map(o.pos), h = c.map(a.pos);
87
- s ? e.deleteRange(u, h) : (e.replaceRangeWith(u, h, t), I(e, r, t.isInline ? -1 : 1));
89
+ replaceWith(tr, node) {
90
+ let mapFrom = tr.steps.length, ranges = this.ranges;
91
+ for (let i = 0; i < ranges.length; i++) {
92
+ let { $from, $to } = ranges[i], mapping = tr.mapping.slice(mapFrom);
93
+ let from = mapping.map($from.pos), to = mapping.map($to.pos);
94
+ if (i) {
95
+ tr.deleteRange(from, to);
96
+ } else {
97
+ tr.replaceRangeWith(from, to, node);
98
+ selectionToInsertionEnd(tr, mapFrom, node.isInline ? -1 : 1);
99
+ }
88
100
  }
89
101
  }
90
102
  /**
@@ -94,14 +106,14 @@ class l {
94
106
  selections. Will return null when no valid selection position is
95
107
  found.
96
108
  */
97
- static findFrom(e, t, r = !1) {
98
- let n = e.parent.inlineContent ? new f(e) : g(e.node(0), e.parent, e.pos, e.index(), t, r);
99
- if (n)
100
- return n;
101
- for (let s = e.depth - 1; s >= 0; s--) {
102
- let o = t < 0 ? g(e.node(0), e.node(s), e.before(s + 1), e.index(s), t, r) : g(e.node(0), e.node(s), e.after(s + 1), e.index(s) + 1, t, r);
103
- if (o)
104
- return o;
109
+ static findFrom($pos, dir, textOnly = false) {
110
+ let inner = $pos.parent.inlineContent ? new TextSelection($pos) : findSelectionIn($pos.node(0), $pos.parent, $pos.pos, $pos.index(), dir, textOnly);
111
+ if (inner)
112
+ return inner;
113
+ for (let depth = $pos.depth - 1; depth >= 0; depth--) {
114
+ let found = dir < 0 ? findSelectionIn($pos.node(0), $pos.node(depth), $pos.before(depth + 1), $pos.index(depth), dir, textOnly) : findSelectionIn($pos.node(0), $pos.node(depth), $pos.after(depth + 1), $pos.index(depth) + 1, dir, textOnly);
115
+ if (found)
116
+ return found;
105
117
  }
106
118
  return null;
107
119
  }
@@ -110,8 +122,8 @@ class l {
110
122
  position. Searches forward first by default, but if `bias` is
111
123
  negative, it will search backwards first.
112
124
  */
113
- static near(e, t = 1) {
114
- return this.findFrom(e, t) || this.findFrom(e, -t) || new d(e.node(0));
125
+ static near($pos, bias = 1) {
126
+ return this.findFrom($pos, bias) || this.findFrom($pos, -bias) || new AllSelection($pos.node(0));
115
127
  }
116
128
  /**
117
129
  Find the cursor or leaf node selection closest to the start of
@@ -119,27 +131,27 @@ class l {
119
131
  [`AllSelection`](https://prosemirror.net/docs/ref/#state.AllSelection) if no valid position
120
132
  exists.
121
133
  */
122
- static atStart(e) {
123
- return g(e, e, 0, 0, 1) || new d(e);
134
+ static atStart(doc) {
135
+ return findSelectionIn(doc, doc, 0, 0, 1) || new AllSelection(doc);
124
136
  }
125
137
  /**
126
138
  Find the cursor or leaf node selection closest to the end of the
127
139
  given document.
128
140
  */
129
- static atEnd(e) {
130
- return g(e, e, e.content.size, e.childCount, -1) || new d(e);
141
+ static atEnd(doc) {
142
+ return findSelectionIn(doc, doc, doc.content.size, doc.childCount, -1) || new AllSelection(doc);
131
143
  }
132
144
  /**
133
145
  Deserialize the JSON representation of a selection. Must be
134
146
  implemented for custom classes (as a static class method).
135
147
  */
136
- static fromJSON(e, t) {
137
- if (!t || !t.type)
148
+ static fromJSON(doc, json) {
149
+ if (!json || !json.type)
138
150
  throw new RangeError("Invalid input for Selection.fromJSON");
139
- let r = M[t.type];
140
- if (!r)
141
- throw new RangeError(`No selection type ${t.type} defined`);
142
- return r.fromJSON(e, t);
151
+ let cls = classesById[json.type];
152
+ if (!cls)
153
+ throw new RangeError(`No selection type ${json.type} defined`);
154
+ return cls.fromJSON(doc, json);
143
155
  }
144
156
  /**
145
157
  To be able to deserialize selections from JSON, custom selection
@@ -147,10 +159,12 @@ class l {
147
159
  can be disambiguated. Try to pick something that's unlikely to
148
160
  clash with classes from other modules.
149
161
  */
150
- static jsonID(e, t) {
151
- if (e in M)
152
- throw new RangeError("Duplicate use of selection JSON ID " + e);
153
- return M[e] = t, t.prototype.jsonID = e, t;
162
+ static jsonID(id, selectionClass) {
163
+ if (id in classesById)
164
+ throw new RangeError("Duplicate use of selection JSON ID " + id);
165
+ classesById[id] = selectionClass;
166
+ selectionClass.prototype.jsonID = id;
167
+ return selectionClass;
154
168
  }
155
169
  /**
156
170
  Get a [bookmark](https://prosemirror.net/docs/ref/#state.SelectionBookmark) for this selection,
@@ -162,28 +176,34 @@ class l {
162
176
  returns the bookmark for that.
163
177
  */
164
178
  getBookmark() {
165
- return f.between(this.$anchor, this.$head).getBookmark();
179
+ return TextSelection.between(this.$anchor, this.$head).getBookmark();
166
180
  }
167
181
  }
168
- l.prototype.visible = !0;
169
- class q {
182
+ Selection.prototype.visible = true;
183
+ class SelectionRange {
170
184
  /**
171
185
  Create a range.
172
186
  */
173
- constructor(e, t) {
174
- this.$from = e, this.$to = t;
187
+ constructor($from, $to) {
188
+ this.$from = $from;
189
+ this.$to = $to;
175
190
  }
176
191
  }
177
- let R = !1;
178
- function T(i) {
179
- !R && !i.parent.inlineContent && (R = !0, console.warn("TextSelection endpoint not pointing into a node with inline content (" + i.parent.type.name + ")"));
192
+ let warnedAboutTextSelection = false;
193
+ function checkTextSelection($pos) {
194
+ if (!warnedAboutTextSelection && !$pos.parent.inlineContent) {
195
+ warnedAboutTextSelection = true;
196
+ console["warn"]("TextSelection endpoint not pointing into a node with inline content (" + $pos.parent.type.name + ")");
197
+ }
180
198
  }
181
- class f extends l {
199
+ class TextSelection extends Selection {
182
200
  /**
183
201
  Construct a text selection between the given points.
184
202
  */
185
- constructor(e, t = e) {
186
- T(e), T(t), super(e, t);
203
+ constructor($anchor, $head = $anchor) {
204
+ checkTextSelection($anchor);
205
+ checkTextSelection($head);
206
+ super($anchor, $head);
187
207
  }
188
208
  /**
189
209
  Returns a resolved position if this is a cursor selection (an
@@ -192,24 +212,26 @@ class f extends l {
192
212
  get $cursor() {
193
213
  return this.$anchor.pos == this.$head.pos ? this.$head : null;
194
214
  }
195
- map(e, t) {
196
- let r = e.resolve(t.map(this.head));
197
- if (!r.parent.inlineContent)
198
- return l.near(r);
199
- let n = e.resolve(t.map(this.anchor));
200
- return new f(n.parent.inlineContent ? n : r, r);
201
- }
202
- replace(e, t = m.empty) {
203
- if (super.replace(e, t), t == m.empty) {
204
- let r = this.$from.marksAcross(this.$to);
205
- r && e.ensureMarks(r);
215
+ map(doc, mapping) {
216
+ let $head = doc.resolve(mapping.map(this.head));
217
+ if (!$head.parent.inlineContent)
218
+ return Selection.near($head);
219
+ let $anchor = doc.resolve(mapping.map(this.anchor));
220
+ return new TextSelection($anchor.parent.inlineContent ? $anchor : $head, $head);
221
+ }
222
+ replace(tr, content = Slice.empty) {
223
+ super.replace(tr, content);
224
+ if (content == Slice.empty) {
225
+ let marks = this.$from.marksAcross(this.$to);
226
+ if (marks)
227
+ tr.ensureMarks(marks);
206
228
  }
207
229
  }
208
- eq(e) {
209
- return e instanceof f && e.anchor == this.anchor && e.head == this.head;
230
+ eq(other) {
231
+ return other instanceof TextSelection && other.anchor == this.anchor && other.head == this.head;
210
232
  }
211
233
  getBookmark() {
212
- return new k(this.anchor, this.head);
234
+ return new TextBookmark(this.anchor, this.head);
213
235
  }
214
236
  toJSON() {
215
237
  return { type: "text", anchor: this.anchor, head: this.head };
@@ -217,17 +239,17 @@ class f extends l {
217
239
  /**
218
240
  @internal
219
241
  */
220
- static fromJSON(e, t) {
221
- if (typeof t.anchor != "number" || typeof t.head != "number")
242
+ static fromJSON(doc, json) {
243
+ if (typeof json.anchor != "number" || typeof json.head != "number")
222
244
  throw new RangeError("Invalid input for TextSelection.fromJSON");
223
- return new f(e.resolve(t.anchor), e.resolve(t.head));
245
+ return new TextSelection(doc.resolve(json.anchor), doc.resolve(json.head));
224
246
  }
225
247
  /**
226
248
  Create a text selection from non-resolved positions.
227
249
  */
228
- static create(e, t, r = t) {
229
- let n = e.resolve(t);
230
- return new this(n, r == t ? n : e.resolve(r));
250
+ static create(doc, anchor, head = anchor) {
251
+ let $anchor = doc.resolve(anchor);
252
+ return new this($anchor, head == anchor ? $anchor : doc.resolve(head));
231
253
  }
232
254
  /**
233
255
  Return a text selection that spans the given positions or, if
@@ -237,106 +259,127 @@ class f extends l {
237
259
  [`Selection.near`](https://prosemirror.net/docs/ref/#state.Selection^near) when the document
238
260
  doesn't contain a valid text position.
239
261
  */
240
- static between(e, t, r) {
241
- let n = e.pos - t.pos;
242
- if ((!r || n) && (r = n >= 0 ? 1 : -1), !t.parent.inlineContent) {
243
- let s = l.findFrom(t, r, !0) || l.findFrom(t, -r, !0);
244
- if (s)
245
- t = s.$head;
262
+ static between($anchor, $head, bias) {
263
+ let dPos = $anchor.pos - $head.pos;
264
+ if (!bias || dPos)
265
+ bias = dPos >= 0 ? 1 : -1;
266
+ if (!$head.parent.inlineContent) {
267
+ let found = Selection.findFrom($head, bias, true) || Selection.findFrom($head, -bias, true);
268
+ if (found)
269
+ $head = found.$head;
246
270
  else
247
- return l.near(t, r);
271
+ return Selection.near($head, bias);
248
272
  }
249
- return e.parent.inlineContent || (n == 0 ? e = t : (e = (l.findFrom(e, -r, !0) || l.findFrom(e, r, !0)).$anchor, e.pos < t.pos != n < 0 && (e = t))), new f(e, t);
273
+ if (!$anchor.parent.inlineContent) {
274
+ if (dPos == 0) {
275
+ $anchor = $head;
276
+ } else {
277
+ $anchor = (Selection.findFrom($anchor, -bias, true) || Selection.findFrom($anchor, bias, true)).$anchor;
278
+ if ($anchor.pos < $head.pos != dPos < 0)
279
+ $anchor = $head;
280
+ }
281
+ }
282
+ return new TextSelection($anchor, $head);
250
283
  }
251
284
  }
252
- l.jsonID("text", f);
253
- class k {
254
- constructor(e, t) {
255
- this.anchor = e, this.head = t;
285
+ Selection.jsonID("text", TextSelection);
286
+ class TextBookmark {
287
+ constructor(anchor, head) {
288
+ this.anchor = anchor;
289
+ this.head = head;
256
290
  }
257
- map(e) {
258
- return new k(e.map(this.anchor), e.map(this.head));
291
+ map(mapping) {
292
+ return new TextBookmark(mapping.map(this.anchor), mapping.map(this.head));
259
293
  }
260
- resolve(e) {
261
- return f.between(e.resolve(this.anchor), e.resolve(this.head));
294
+ resolve(doc) {
295
+ return TextSelection.between(doc.resolve(this.anchor), doc.resolve(this.head));
262
296
  }
263
297
  }
264
- class p extends l {
298
+ class NodeSelection extends Selection {
265
299
  /**
266
300
  Create a node selection. Does not verify the validity of its
267
301
  argument.
268
302
  */
269
- constructor(e) {
270
- let t = e.nodeAfter, r = e.node(0).resolve(e.pos + t.nodeSize);
271
- super(e, r), this.node = t;
303
+ constructor($pos) {
304
+ let node = $pos.nodeAfter;
305
+ let $end = $pos.node(0).resolve($pos.pos + node.nodeSize);
306
+ super($pos, $end);
307
+ this.node = node;
272
308
  }
273
- map(e, t) {
274
- let { deleted: r, pos: n } = t.mapResult(this.anchor), s = e.resolve(n);
275
- return r ? l.near(s) : new p(s);
309
+ map(doc, mapping) {
310
+ let { deleted, pos } = mapping.mapResult(this.anchor);
311
+ let $pos = doc.resolve(pos);
312
+ if (deleted)
313
+ return Selection.near($pos);
314
+ return new NodeSelection($pos);
276
315
  }
277
316
  content() {
278
- return new m(x.from(this.node), 0, 0);
317
+ return new Slice(Fragment.from(this.node), 0, 0);
279
318
  }
280
- eq(e) {
281
- return e instanceof p && e.anchor == this.anchor;
319
+ eq(other) {
320
+ return other instanceof NodeSelection && other.anchor == this.anchor;
282
321
  }
283
322
  toJSON() {
284
323
  return { type: "node", anchor: this.anchor };
285
324
  }
286
325
  getBookmark() {
287
- return new N(this.anchor);
326
+ return new NodeBookmark(this.anchor);
288
327
  }
289
328
  /**
290
329
  @internal
291
330
  */
292
- static fromJSON(e, t) {
293
- if (typeof t.anchor != "number")
331
+ static fromJSON(doc, json) {
332
+ if (typeof json.anchor != "number")
294
333
  throw new RangeError("Invalid input for NodeSelection.fromJSON");
295
- return new p(e.resolve(t.anchor));
334
+ return new NodeSelection(doc.resolve(json.anchor));
296
335
  }
297
336
  /**
298
337
  Create a node selection from non-resolved positions.
299
338
  */
300
- static create(e, t) {
301
- return new p(e.resolve(t));
339
+ static create(doc, from) {
340
+ return new NodeSelection(doc.resolve(from));
302
341
  }
303
342
  /**
304
343
  Determines whether the given node may be selected as a node
305
344
  selection.
306
345
  */
307
- static isSelectable(e) {
308
- return !e.isText && e.type.spec.selectable !== !1;
346
+ static isSelectable(node) {
347
+ return !node.isText && node.type.spec.selectable !== false;
309
348
  }
310
349
  }
311
- p.prototype.visible = !1;
312
- l.jsonID("node", p);
313
- class N {
314
- constructor(e) {
315
- this.anchor = e;
316
- }
317
- map(e) {
318
- let { deleted: t, pos: r } = e.mapResult(this.anchor);
319
- return t ? new k(r, r) : new N(r);
320
- }
321
- resolve(e) {
322
- let t = e.resolve(this.anchor), r = t.nodeAfter;
323
- return r && p.isSelectable(r) ? new p(t) : l.near(t);
350
+ NodeSelection.prototype.visible = false;
351
+ Selection.jsonID("node", NodeSelection);
352
+ class NodeBookmark {
353
+ constructor(anchor) {
354
+ this.anchor = anchor;
355
+ }
356
+ map(mapping) {
357
+ let { deleted, pos } = mapping.mapResult(this.anchor);
358
+ return deleted ? new TextBookmark(pos, pos) : new NodeBookmark(pos);
359
+ }
360
+ resolve(doc) {
361
+ let $pos = doc.resolve(this.anchor), node = $pos.nodeAfter;
362
+ if (node && NodeSelection.isSelectable(node))
363
+ return new NodeSelection($pos);
364
+ return Selection.near($pos);
324
365
  }
325
366
  }
326
- class d extends l {
367
+ class AllSelection extends Selection {
327
368
  /**
328
369
  Create an all-selection over the given document.
329
370
  */
330
- constructor(e) {
331
- super(e.resolve(0), e.resolve(e.content.size));
371
+ constructor(doc) {
372
+ super(doc.resolve(0), doc.resolve(doc.content.size));
332
373
  }
333
- replace(e, t = m.empty) {
334
- if (t == m.empty) {
335
- e.delete(0, e.doc.content.size);
336
- let r = l.atStart(e.doc);
337
- r.eq(e.selection) || e.setSelection(r);
338
- } else
339
- super.replace(e, t);
374
+ replace(tr, content = Slice.empty) {
375
+ if (content == Slice.empty) {
376
+ tr.delete(0, tr.doc.content.size);
377
+ let sel = Selection.atStart(tr.doc);
378
+ if (!sel.eq(tr.selection))
379
+ tr.setSelection(sel);
380
+ } else {
381
+ super.replace(tr, content);
382
+ }
340
383
  }
341
384
  toJSON() {
342
385
  return { type: "all" };
@@ -344,64 +387,71 @@ class d extends l {
344
387
  /**
345
388
  @internal
346
389
  */
347
- static fromJSON(e) {
348
- return new d(e);
390
+ static fromJSON(doc) {
391
+ return new AllSelection(doc);
349
392
  }
350
- map(e) {
351
- return new d(e);
393
+ map(doc) {
394
+ return new AllSelection(doc);
352
395
  }
353
- eq(e) {
354
- return e instanceof d;
396
+ eq(other) {
397
+ return other instanceof AllSelection;
355
398
  }
356
399
  getBookmark() {
357
- return z;
400
+ return AllBookmark;
358
401
  }
359
402
  }
360
- l.jsonID("all", d);
361
- const z = {
403
+ Selection.jsonID("all", AllSelection);
404
+ const AllBookmark = {
362
405
  map() {
363
406
  return this;
364
407
  },
365
- resolve(i) {
366
- return new d(i);
408
+ resolve(doc) {
409
+ return new AllSelection(doc);
367
410
  }
368
411
  };
369
- function g(i, e, t, r, n, s = !1) {
370
- if (e.inlineContent)
371
- return f.create(i, t);
372
- for (let o = r - (n > 0 ? 0 : 1); n > 0 ? o < e.childCount : o >= 0; o += n) {
373
- let a = e.child(o);
374
- if (a.isAtom) {
375
- if (!s && p.isSelectable(a))
376
- return p.create(i, t - (n < 0 ? a.nodeSize : 0));
377
- } else {
378
- let c = g(i, a, t + n, n < 0 ? a.childCount : 0, n, s);
379
- if (c)
380
- return c;
412
+ function findSelectionIn(doc, node, pos, index, dir, text = false) {
413
+ if (node.inlineContent)
414
+ return TextSelection.create(doc, pos);
415
+ for (let i = index - (dir > 0 ? 0 : 1); dir > 0 ? i < node.childCount : i >= 0; i += dir) {
416
+ let child = node.child(i);
417
+ if (!child.isAtom) {
418
+ let inner = findSelectionIn(doc, child, pos + dir, dir < 0 ? child.childCount : 0, dir, text);
419
+ if (inner)
420
+ return inner;
421
+ } else if (!text && NodeSelection.isSelectable(child)) {
422
+ return NodeSelection.create(doc, pos - (dir < 0 ? child.nodeSize : 0));
381
423
  }
382
- t += a.nodeSize * n;
424
+ pos += child.nodeSize * dir;
383
425
  }
384
426
  return null;
385
427
  }
386
- function I(i, e, t) {
387
- let r = i.steps.length - 1;
388
- if (r < e)
428
+ function selectionToInsertionEnd(tr, startLen, bias) {
429
+ let last = tr.steps.length - 1;
430
+ if (last < startLen)
389
431
  return;
390
- let n = i.steps[r];
391
- if (!(n instanceof P || n instanceof K))
432
+ let step = tr.steps[last];
433
+ if (!(step instanceof ReplaceStep || step instanceof ReplaceAroundStep))
392
434
  return;
393
- let s = i.mapping.maps[r], o;
394
- s.forEach((a, c, u, h) => {
395
- o == null && (o = h);
396
- }), i.setSelection(l.near(i.doc.resolve(o), t));
435
+ let map = tr.mapping.maps[last], end;
436
+ map.forEach((_from, _to, _newFrom, newTo) => {
437
+ if (end == null)
438
+ end = newTo;
439
+ });
440
+ tr.setSelection(Selection.near(tr.doc.resolve(end), bias));
397
441
  }
398
- const b = 1, E = 2, F = 4;
399
- class W extends $ {
442
+ const UPDATED_SEL = 1, UPDATED_MARKS = 2, UPDATED_SCROLL = 4;
443
+ class Transaction extends Transform {
400
444
  /**
401
445
  @internal
402
446
  */
403
- constructor(e) {
404
- super(e.doc), this.curSelectionFor = 0, this.updated = 0, this.meta = /* @__PURE__ */ Object.create(null), this.time = Date.now(), this.curSelection = e.selection, this.storedMarks = e.storedMarks;
447
+ constructor(state) {
448
+ super(state.doc);
449
+ this.curSelectionFor = 0;
450
+ this.updated = 0;
451
+ this.meta = /* @__PURE__ */ Object.create(null);
452
+ this.time = Date.now();
453
+ this.curSelection = state.selection;
454
+ this.storedMarks = state.storedMarks;
405
455
  }
406
456
  /**
407
457
  The transaction's current selection. This defaults to the editor
@@ -410,200 +460,240 @@ class W extends $ {
410
460
  [`setSelection`](https://prosemirror.net/docs/ref/#state.Transaction.setSelection).
411
461
  */
412
462
  get selection() {
413
- return this.curSelectionFor < this.steps.length && (this.curSelection = this.curSelection.map(this.doc, this.mapping.slice(this.curSelectionFor)), this.curSelectionFor = this.steps.length), this.curSelection;
463
+ if (this.curSelectionFor < this.steps.length) {
464
+ this.curSelection = this.curSelection.map(this.doc, this.mapping.slice(this.curSelectionFor));
465
+ this.curSelectionFor = this.steps.length;
466
+ }
467
+ return this.curSelection;
414
468
  }
415
469
  /**
416
470
  Update the transaction's current selection. Will determine the
417
471
  selection that the editor gets when the transaction is applied.
418
472
  */
419
- setSelection(e) {
420
- if (e.$from.doc != this.doc)
473
+ setSelection(selection) {
474
+ if (selection.$from.doc != this.doc)
421
475
  throw new RangeError("Selection passed to setSelection must point at the current document");
422
- return this.curSelection = e, this.curSelectionFor = this.steps.length, this.updated = (this.updated | b) & -3, this.storedMarks = null, this;
476
+ this.curSelection = selection;
477
+ this.curSelectionFor = this.steps.length;
478
+ this.updated = (this.updated | UPDATED_SEL) & -3;
479
+ this.storedMarks = null;
480
+ return this;
423
481
  }
424
482
  /**
425
483
  Whether the selection was explicitly updated by this transaction.
426
484
  */
427
485
  get selectionSet() {
428
- return (this.updated & b) > 0;
486
+ return (this.updated & UPDATED_SEL) > 0;
429
487
  }
430
488
  /**
431
489
  Set the current stored marks.
432
490
  */
433
- setStoredMarks(e) {
434
- return this.storedMarks = e, this.updated |= E, this;
491
+ setStoredMarks(marks) {
492
+ this.storedMarks = marks;
493
+ this.updated |= UPDATED_MARKS;
494
+ return this;
435
495
  }
436
496
  /**
437
497
  Make sure the current stored marks or, if that is null, the marks
438
498
  at the selection, match the given set of marks. Does nothing if
439
499
  this is already the case.
440
500
  */
441
- ensureMarks(e) {
442
- return J.sameSet(this.storedMarks || this.selection.$from.marks(), e) || this.setStoredMarks(e), this;
501
+ ensureMarks(marks) {
502
+ if (!Mark.sameSet(this.storedMarks || this.selection.$from.marks(), marks))
503
+ this.setStoredMarks(marks);
504
+ return this;
443
505
  }
444
506
  /**
445
507
  Add a mark to the set of stored marks.
446
508
  */
447
- addStoredMark(e) {
448
- return this.ensureMarks(e.addToSet(this.storedMarks || this.selection.$head.marks()));
509
+ addStoredMark(mark) {
510
+ return this.ensureMarks(mark.addToSet(this.storedMarks || this.selection.$head.marks()));
449
511
  }
450
512
  /**
451
513
  Remove a mark or mark type from the set of stored marks.
452
514
  */
453
- removeStoredMark(e) {
454
- return this.ensureMarks(e.removeFromSet(this.storedMarks || this.selection.$head.marks()));
515
+ removeStoredMark(mark) {
516
+ return this.ensureMarks(mark.removeFromSet(this.storedMarks || this.selection.$head.marks()));
455
517
  }
456
518
  /**
457
519
  Whether the stored marks were explicitly set for this transaction.
458
520
  */
459
521
  get storedMarksSet() {
460
- return (this.updated & E) > 0;
522
+ return (this.updated & UPDATED_MARKS) > 0;
461
523
  }
462
524
  /**
463
525
  @internal
464
526
  */
465
- addStep(e, t) {
466
- super.addStep(e, t), this.updated = this.updated & -3, this.storedMarks = null;
527
+ addStep(step, doc) {
528
+ super.addStep(step, doc);
529
+ this.updated = this.updated & -3;
530
+ this.storedMarks = null;
467
531
  }
468
532
  /**
469
533
  Update the timestamp for the transaction.
470
534
  */
471
- setTime(e) {
472
- return this.time = e, this;
535
+ setTime(time) {
536
+ this.time = time;
537
+ return this;
473
538
  }
474
539
  /**
475
540
  Replace the current selection with the given slice.
476
541
  */
477
- replaceSelection(e) {
478
- return this.selection.replace(this, e), this;
542
+ replaceSelection(slice) {
543
+ this.selection.replace(this, slice);
544
+ return this;
479
545
  }
480
546
  /**
481
547
  Replace the selection with the given node. When `inheritMarks` is
482
548
  true and the content is inline, it inherits the marks from the
483
549
  place where it is inserted.
484
550
  */
485
- replaceSelectionWith(e, t = !0) {
486
- let r = this.selection;
487
- return t && (e = e.mark(this.storedMarks || (r.empty ? r.$from.marks() : r.$from.marksAcross(r.$to) || J.none))), r.replaceWith(this, e), this;
551
+ replaceSelectionWith(node, inheritMarks = true) {
552
+ let selection = this.selection;
553
+ if (inheritMarks)
554
+ node = node.mark(this.storedMarks || (selection.empty ? selection.$from.marks() : selection.$from.marksAcross(selection.$to) || Mark.none));
555
+ selection.replaceWith(this, node);
556
+ return this;
488
557
  }
489
558
  /**
490
559
  Delete the selection.
491
560
  */
492
561
  deleteSelection() {
493
- return this.selection.replace(this), this;
562
+ this.selection.replace(this);
563
+ return this;
494
564
  }
495
565
  /**
496
566
  Replace the given range, or the selection if no range is given,
497
567
  with a text node containing the given string.
498
568
  */
499
- insertText(e, t, r) {
500
- let n = this.doc.type.schema;
501
- if (t == null)
502
- return e ? this.replaceSelectionWith(n.text(e), !0) : this.deleteSelection();
503
- {
504
- if (r == null && (r = t), r = r ?? t, !e)
505
- return this.deleteRange(t, r);
506
- let s = this.storedMarks;
507
- if (!s) {
508
- let o = this.doc.resolve(t);
509
- s = r == t ? o.marks() : o.marksAcross(this.doc.resolve(r));
569
+ insertText(text, from, to) {
570
+ let schema = this.doc.type.schema;
571
+ if (from == null) {
572
+ if (!text)
573
+ return this.deleteSelection();
574
+ return this.replaceSelectionWith(schema.text(text), true);
575
+ } else {
576
+ if (to == null)
577
+ to = from;
578
+ to = to == null ? from : to;
579
+ if (!text)
580
+ return this.deleteRange(from, to);
581
+ let marks = this.storedMarks;
582
+ if (!marks) {
583
+ let $from = this.doc.resolve(from);
584
+ marks = to == from ? $from.marks() : $from.marksAcross(this.doc.resolve(to));
510
585
  }
511
- return this.replaceRangeWith(t, r, n.text(e, s)), this.selection.empty || this.setSelection(l.near(this.selection.$to)), this;
586
+ this.replaceRangeWith(from, to, schema.text(text, marks));
587
+ if (!this.selection.empty)
588
+ this.setSelection(Selection.near(this.selection.$to));
589
+ return this;
512
590
  }
513
591
  }
514
592
  /**
515
593
  Store a metadata property in this transaction, keyed either by
516
594
  name or by plugin.
517
595
  */
518
- setMeta(e, t) {
519
- return this.meta[typeof e == "string" ? e : e.key] = t, this;
596
+ setMeta(key, value) {
597
+ this.meta[typeof key == "string" ? key : key.key] = value;
598
+ return this;
520
599
  }
521
600
  /**
522
601
  Retrieve a metadata property for a given name or plugin.
523
602
  */
524
- getMeta(e) {
525
- return this.meta[typeof e == "string" ? e : e.key];
603
+ getMeta(key) {
604
+ return this.meta[typeof key == "string" ? key : key.key];
526
605
  }
527
606
  /**
528
607
  Returns true if this transaction doesn't contain any metadata,
529
608
  and can thus safely be extended.
530
609
  */
531
610
  get isGeneric() {
532
- for (let e in this.meta)
533
- return !1;
534
- return !0;
611
+ for (let _ in this.meta)
612
+ return false;
613
+ return true;
535
614
  }
536
615
  /**
537
616
  Indicate that the editor should scroll the selection into view
538
617
  when updated to the state produced by this transaction.
539
618
  */
540
619
  scrollIntoView() {
541
- return this.updated |= F, this;
620
+ this.updated |= UPDATED_SCROLL;
621
+ return this;
542
622
  }
543
623
  /**
544
624
  True when this transaction has had `scrollIntoView` called on it.
545
625
  */
546
626
  get scrolledIntoView() {
547
- return (this.updated & F) > 0;
627
+ return (this.updated & UPDATED_SCROLL) > 0;
548
628
  }
549
629
  }
550
- function D(i, e) {
551
- return !e || !i ? i : i.bind(e);
630
+ function bind(f, self) {
631
+ return !self || !f ? f : f.bind(self);
552
632
  }
553
- class S {
554
- constructor(e, t, r) {
555
- this.name = e, this.init = D(t.init, r), this.apply = D(t.apply, r);
633
+ class FieldDesc {
634
+ constructor(name, desc, self) {
635
+ this.name = name;
636
+ this.init = bind(desc.init, self);
637
+ this.apply = bind(desc.apply, self);
556
638
  }
557
639
  }
558
- const L = [
559
- new S("doc", {
560
- init(i) {
561
- return i.doc || i.schema.topNodeType.createAndFill();
640
+ const baseFields = [
641
+ new FieldDesc("doc", {
642
+ init(config) {
643
+ return config.doc || config.schema.topNodeType.createAndFill();
562
644
  },
563
- apply(i) {
564
- return i.doc;
645
+ apply(tr) {
646
+ return tr.doc;
565
647
  }
566
648
  }),
567
- new S("selection", {
568
- init(i, e) {
569
- return i.selection || l.atStart(e.doc);
649
+ new FieldDesc("selection", {
650
+ init(config, instance) {
651
+ return config.selection || Selection.atStart(instance.doc);
570
652
  },
571
- apply(i) {
572
- return i.selection;
653
+ apply(tr) {
654
+ return tr.selection;
573
655
  }
574
656
  }),
575
- new S("storedMarks", {
576
- init(i) {
577
- return i.storedMarks || null;
657
+ new FieldDesc("storedMarks", {
658
+ init(config) {
659
+ return config.storedMarks || null;
578
660
  },
579
- apply(i, e, t, r) {
580
- return r.selection.$cursor ? i.storedMarks : null;
661
+ apply(tr, _marks, _old, state) {
662
+ return state.selection.$cursor ? tr.storedMarks : null;
581
663
  }
582
664
  }),
583
- new S("scrollToSelection", {
665
+ new FieldDesc("scrollToSelection", {
584
666
  init() {
585
667
  return 0;
586
668
  },
587
- apply(i, e) {
588
- return i.scrolledIntoView ? e + 1 : e;
669
+ apply(tr, prev) {
670
+ return tr.scrolledIntoView ? prev + 1 : prev;
589
671
  }
590
672
  })
591
673
  ];
592
- class O {
593
- constructor(e, t) {
594
- this.schema = e, this.plugins = [], this.pluginsByKey = /* @__PURE__ */ Object.create(null), this.fields = L.slice(), t && t.forEach((r) => {
595
- if (this.pluginsByKey[r.key])
596
- throw new RangeError("Adding different instances of a keyed plugin (" + r.key + ")");
597
- this.plugins.push(r), this.pluginsByKey[r.key] = r, r.spec.state && this.fields.push(new S(r.key, r.spec.state, r));
598
- });
674
+ class Configuration {
675
+ constructor(schema, plugins) {
676
+ this.schema = schema;
677
+ this.plugins = [];
678
+ this.pluginsByKey = /* @__PURE__ */ Object.create(null);
679
+ this.fields = baseFields.slice();
680
+ if (plugins)
681
+ plugins.forEach((plugin) => {
682
+ if (this.pluginsByKey[plugin.key])
683
+ throw new RangeError("Adding different instances of a keyed plugin (" + plugin.key + ")");
684
+ this.plugins.push(plugin);
685
+ this.pluginsByKey[plugin.key] = plugin;
686
+ if (plugin.spec.state)
687
+ this.fields.push(new FieldDesc(plugin.key, plugin.spec.state, plugin));
688
+ });
599
689
  }
600
690
  }
601
- class w {
691
+ class EditorState {
602
692
  /**
603
693
  @internal
604
694
  */
605
- constructor(e) {
606
- this.config = e;
695
+ constructor(config) {
696
+ this.config = config;
607
697
  }
608
698
  /**
609
699
  The schema of the state's document.
@@ -620,20 +710,20 @@ class w {
620
710
  /**
621
711
  Apply the given transaction to produce a new state.
622
712
  */
623
- apply(e) {
624
- return this.applyTransaction(e).state;
713
+ apply(tr) {
714
+ return this.applyTransaction(tr).state;
625
715
  }
626
716
  /**
627
717
  @internal
628
718
  */
629
- filterTransaction(e, t = -1) {
630
- for (let r = 0; r < this.config.plugins.length; r++)
631
- if (r != t) {
632
- let n = this.config.plugins[r];
633
- if (n.spec.filterTransaction && !n.spec.filterTransaction.call(n, e, this))
634
- return !1;
719
+ filterTransaction(tr, ignore = -1) {
720
+ for (let i = 0; i < this.config.plugins.length; i++)
721
+ if (i != ignore) {
722
+ let plugin = this.config.plugins[i];
723
+ if (plugin.spec.filterTransaction && !plugin.spec.filterTransaction.call(plugin, tr, this))
724
+ return false;
635
725
  }
636
- return !0;
726
+ return true;
637
727
  }
638
728
  /**
639
729
  Verbose variant of [`apply`](https://prosemirror.net/docs/ref/#state.EditorState.apply) that
@@ -642,58 +732,64 @@ class w {
642
732
  hooks](https://prosemirror.net/docs/ref/#state.PluginSpec.filterTransaction) of
643
733
  plugins) along with the new state.
644
734
  */
645
- applyTransaction(e) {
646
- if (!this.filterTransaction(e))
735
+ applyTransaction(rootTr) {
736
+ if (!this.filterTransaction(rootTr))
647
737
  return { state: this, transactions: [] };
648
- let t = [e], r = this.applyInner(e), n = null;
738
+ let trs = [rootTr], newState = this.applyInner(rootTr), seen = null;
649
739
  for (; ; ) {
650
- let s = !1;
651
- for (let o = 0; o < this.config.plugins.length; o++) {
652
- let a = this.config.plugins[o];
653
- if (a.spec.appendTransaction) {
654
- let c = n ? n[o].n : 0, u = n ? n[o].state : this, h = c < t.length && a.spec.appendTransaction.call(a, c ? t.slice(c) : t, u, r);
655
- if (h && r.filterTransaction(h, o)) {
656
- if (h.setMeta("appendedTransaction", e), !n) {
657
- n = [];
658
- for (let y = 0; y < this.config.plugins.length; y++)
659
- n.push(y < o ? { state: r, n: t.length } : { state: this, n: 0 });
740
+ let haveNew = false;
741
+ for (let i = 0; i < this.config.plugins.length; i++) {
742
+ let plugin = this.config.plugins[i];
743
+ if (plugin.spec.appendTransaction) {
744
+ let n = seen ? seen[i].n : 0, oldState = seen ? seen[i].state : this;
745
+ let tr = n < trs.length && plugin.spec.appendTransaction.call(plugin, n ? trs.slice(n) : trs, oldState, newState);
746
+ if (tr && newState.filterTransaction(tr, i)) {
747
+ tr.setMeta("appendedTransaction", rootTr);
748
+ if (!seen) {
749
+ seen = [];
750
+ for (let j = 0; j < this.config.plugins.length; j++)
751
+ seen.push(j < i ? { state: newState, n: trs.length } : { state: this, n: 0 });
660
752
  }
661
- t.push(h), r = r.applyInner(h), s = !0;
753
+ trs.push(tr);
754
+ newState = newState.applyInner(tr);
755
+ haveNew = true;
662
756
  }
663
- n && (n[o] = { state: r, n: t.length });
757
+ if (seen)
758
+ seen[i] = { state: newState, n: trs.length };
664
759
  }
665
760
  }
666
- if (!s)
667
- return { state: r, transactions: t };
761
+ if (!haveNew)
762
+ return { state: newState, transactions: trs };
668
763
  }
669
764
  }
670
765
  /**
671
766
  @internal
672
767
  */
673
- applyInner(e) {
674
- if (!e.before.eq(this.doc))
768
+ applyInner(tr) {
769
+ if (!tr.before.eq(this.doc))
675
770
  throw new RangeError("Applying a mismatched transaction");
676
- let t = new w(this.config), r = this.config.fields;
677
- for (let n = 0; n < r.length; n++) {
678
- let s = r[n];
679
- t[s.name] = s.apply(e, this[s.name], this, t);
771
+ let newInstance = new EditorState(this.config), fields = this.config.fields;
772
+ for (let i = 0; i < fields.length; i++) {
773
+ let field = fields[i];
774
+ newInstance[field.name] = field.apply(tr, this[field.name], this, newInstance);
680
775
  }
681
- return t;
776
+ return newInstance;
682
777
  }
683
778
  /**
684
779
  Start a [transaction](https://prosemirror.net/docs/ref/#state.Transaction) from this state.
685
780
  */
686
781
  get tr() {
687
- return new W(this);
782
+ return new Transaction(this);
688
783
  }
689
784
  /**
690
785
  Create a new state.
691
786
  */
692
- static create(e) {
693
- let t = new O(e.doc ? e.doc.type.schema : e.schema, e.plugins), r = new w(t);
694
- for (let n = 0; n < t.fields.length; n++)
695
- r[t.fields[n].name] = t.fields[n].init(e, r);
696
- return r;
787
+ static create(config) {
788
+ let $config = new Configuration(config.doc ? config.doc.type.schema : config.schema, config.plugins);
789
+ let instance = new EditorState($config);
790
+ for (let i = 0; i < $config.fields.length; i++)
791
+ instance[$config.fields[i].name] = $config.fields[i].init(config, instance);
792
+ return instance;
697
793
  }
698
794
  /**
699
795
  Create a new state based on this one, but with an adjusted set
@@ -703,13 +799,14 @@ class w {
703
799
  [`init`](https://prosemirror.net/docs/ref/#state.StateField.init) method, passing in the new
704
800
  configuration object..
705
801
  */
706
- reconfigure(e) {
707
- let t = new O(this.schema, e.plugins), r = t.fields, n = new w(t);
708
- for (let s = 0; s < r.length; s++) {
709
- let o = r[s].name;
710
- n[o] = this.hasOwnProperty(o) ? this[o] : r[s].init(e, n);
802
+ reconfigure(config) {
803
+ let $config = new Configuration(this.schema, config.plugins);
804
+ let fields = $config.fields, instance = new EditorState($config);
805
+ for (let i = 0; i < fields.length; i++) {
806
+ let name = fields[i].name;
807
+ instance[name] = this.hasOwnProperty(name) ? this[name] : fields[i].init(config, instance);
711
808
  }
712
- return n;
809
+ return instance;
713
810
  }
714
811
  /**
715
812
  Serialize this state to JSON. If you want to serialize the state
@@ -718,16 +815,19 @@ class w {
718
815
  a string or number, in which case it is ignored, to support the
719
816
  way `JSON.stringify` calls `toString` methods.
720
817
  */
721
- toJSON(e) {
722
- let t = { doc: this.doc.toJSON(), selection: this.selection.toJSON() };
723
- if (this.storedMarks && (t.storedMarks = this.storedMarks.map((r) => r.toJSON())), e && typeof e == "object")
724
- for (let r in e) {
725
- if (r == "doc" || r == "selection")
818
+ toJSON(pluginFields) {
819
+ let result = { doc: this.doc.toJSON(), selection: this.selection.toJSON() };
820
+ if (this.storedMarks)
821
+ result.storedMarks = this.storedMarks.map((m) => m.toJSON());
822
+ if (pluginFields && typeof pluginFields == "object")
823
+ for (let prop in pluginFields) {
824
+ if (prop == "doc" || prop == "selection")
726
825
  throw new RangeError("The JSON fields `doc` and `selection` are reserved");
727
- let n = e[r], s = n.spec.state;
728
- s && s.toJSON && (t[r] = s.toJSON.call(n, this[n.key]));
826
+ let plugin = pluginFields[prop], state = plugin.spec.state;
827
+ if (state && state.toJSON)
828
+ result[prop] = state.toJSON.call(plugin, this[plugin.key]);
729
829
  }
730
- return t;
830
+ return result;
731
831
  }
732
832
  /**
733
833
  Deserialize a JSON representation of a state. `config` should
@@ -736,85 +836,99 @@ class w {
736
836
  to deserialize the state of plugins, by associating plugin
737
837
  instances with the property names they use in the JSON object.
738
838
  */
739
- static fromJSON(e, t, r) {
740
- if (!t)
839
+ static fromJSON(config, json, pluginFields) {
840
+ if (!json)
741
841
  throw new RangeError("Invalid input for EditorState.fromJSON");
742
- if (!e.schema)
842
+ if (!config.schema)
743
843
  throw new RangeError("Required config field 'schema' missing");
744
- let n = new O(e.schema, e.plugins), s = new w(n);
745
- return n.fields.forEach((o) => {
746
- if (o.name == "doc")
747
- s.doc = B.fromJSON(e.schema, t.doc);
748
- else if (o.name == "selection")
749
- s.selection = l.fromJSON(s.doc, t.selection);
750
- else if (o.name == "storedMarks")
751
- t.storedMarks && (s.storedMarks = t.storedMarks.map(e.schema.markFromJSON));
752
- else {
753
- if (r)
754
- for (let a in r) {
755
- let c = r[a], u = c.spec.state;
756
- if (c.key == o.name && u && u.fromJSON && Object.prototype.hasOwnProperty.call(t, a)) {
757
- s[o.name] = u.fromJSON.call(c, e, t[a], s);
844
+ let $config = new Configuration(config.schema, config.plugins);
845
+ let instance = new EditorState($config);
846
+ $config.fields.forEach((field) => {
847
+ if (field.name == "doc") {
848
+ instance.doc = Node.fromJSON(config.schema, json.doc);
849
+ } else if (field.name == "selection") {
850
+ instance.selection = Selection.fromJSON(instance.doc, json.selection);
851
+ } else if (field.name == "storedMarks") {
852
+ if (json.storedMarks)
853
+ instance.storedMarks = json.storedMarks.map(config.schema.markFromJSON);
854
+ } else {
855
+ if (pluginFields)
856
+ for (let prop in pluginFields) {
857
+ let plugin = pluginFields[prop], state = plugin.spec.state;
858
+ if (plugin.key == field.name && state && state.fromJSON && Object.prototype.hasOwnProperty.call(json, prop)) {
859
+ instance[field.name] = state.fromJSON.call(plugin, config, json[prop], instance);
758
860
  return;
759
861
  }
760
862
  }
761
- s[o.name] = o.init(e, s);
863
+ instance[field.name] = field.init(config, instance);
762
864
  }
763
- }), s;
865
+ });
866
+ return instance;
764
867
  }
765
868
  }
766
- function A(i, e, t) {
767
- for (let r in i) {
768
- let n = i[r];
769
- n instanceof Function ? n = n.bind(e) : r == "handleDOMEvents" && (n = A(n, e, {})), t[r] = n;
770
- }
771
- return t;
869
+ function bindProps(obj, self, target) {
870
+ for (let prop in obj) {
871
+ let val = obj[prop];
872
+ if (val instanceof Function)
873
+ val = val.bind(self);
874
+ else if (prop == "handleDOMEvents")
875
+ val = bindProps(val, self, {});
876
+ target[prop] = val;
877
+ }
878
+ return target;
772
879
  }
773
- class G {
880
+ class Plugin {
774
881
  /**
775
882
  Create a plugin.
776
883
  */
777
- constructor(e) {
778
- this.spec = e, this.props = {}, e.props && A(e.props, this, this.props), this.key = e.key ? e.key.key : C("plugin");
884
+ constructor(spec) {
885
+ this.spec = spec;
886
+ this.props = {};
887
+ if (spec.props)
888
+ bindProps(spec.props, this, this.props);
889
+ this.key = spec.key ? spec.key.key : createKey("plugin");
779
890
  }
780
891
  /**
781
892
  Extract the plugin's state field from an editor state.
782
893
  */
783
- getState(e) {
784
- return e[this.key];
894
+ getState(state) {
895
+ return state[this.key];
785
896
  }
786
897
  }
787
- const v = /* @__PURE__ */ Object.create(null);
788
- function C(i) {
789
- return i in v ? i + "$" + ++v[i] : (v[i] = 0, i + "$");
898
+ const keys = /* @__PURE__ */ Object.create(null);
899
+ function createKey(name) {
900
+ if (name in keys)
901
+ return name + "$" + ++keys[name];
902
+ keys[name] = 0;
903
+ return name + "$";
790
904
  }
791
- class H {
905
+ class PluginKey {
792
906
  /**
793
907
  Create a plugin key.
794
908
  */
795
- constructor(e = "key") {
796
- this.key = C(e);
909
+ constructor(name = "key") {
910
+ this.key = createKey(name);
797
911
  }
798
912
  /**
799
913
  Get the active plugin with this key, if any, from an editor
800
914
  state.
801
915
  */
802
- get(e) {
803
- return e.config.pluginsByKey[this.key];
916
+ get(state) {
917
+ return state.config.pluginsByKey[this.key];
804
918
  }
805
919
  /**
806
920
  Get the plugin's state from an editor state.
807
921
  */
808
- getState(e) {
809
- return e[this.key];
922
+ getState(state) {
923
+ return state[this.key];
810
924
  }
811
925
  }
812
926
  export {
813
- d as A,
814
- w as E,
815
- p as N,
816
- G as P,
817
- l as S,
818
- f as T,
819
- H as a
927
+ AllSelection as A,
928
+ EditorState as E,
929
+ NodeSelection as N,
930
+ Plugin as P,
931
+ Selection as S,
932
+ TextSelection as T,
933
+ PluginKey as a
820
934
  };