@vkzstudio/muza-ui 1.0.47 → 1.1.0

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 (778) hide show
  1. package/README.md +173 -171
  2. package/dist/Muza_BP_logo.svg +26 -26
  3. package/dist/components/Accordion/Accordion.d.ts +112 -18
  4. package/dist/components/Accordion/Accordion.d.ts.map +1 -1
  5. package/dist/components/Accordion/Accordion.js +208 -110
  6. package/dist/components/Accordion/Accordion.stories.d.ts +3 -0
  7. package/dist/components/Accordion/Accordion.stories.d.ts.map +1 -1
  8. package/dist/components/Alert/Alert.d.ts +3 -1
  9. package/dist/components/Alert/Alert.d.ts.map +1 -1
  10. package/dist/components/Alert/Alert.js +28 -24
  11. package/dist/components/Button/Button.stories.d.ts.map +1 -1
  12. package/dist/components/ButtonArrow/ButtonArrow.stories.d.ts.map +1 -1
  13. package/dist/components/Calendar/Calendar.js +10 -11
  14. package/dist/components/Card/Card.stories.d.ts.map +1 -1
  15. package/dist/components/CardCheckboxAmount/CardCheckboxAmount.d.ts +111 -0
  16. package/dist/components/CardCheckboxAmount/CardCheckboxAmount.d.ts.map +1 -0
  17. package/dist/components/CardCheckboxAmount/CardCheckboxAmount.js +115 -0
  18. package/dist/components/CardCheckboxAmount/CardCheckboxAmount.stories.d.ts +13 -0
  19. package/dist/components/CardCheckboxAmount/CardCheckboxAmount.stories.d.ts.map +1 -0
  20. package/dist/components/CardCheckboxAmount/index.d.ts +2 -0
  21. package/dist/components/CardCheckboxAmount/index.d.ts.map +1 -0
  22. package/dist/components/Carousel/Carousel.d.ts +30 -3
  23. package/dist/components/Carousel/Carousel.d.ts.map +1 -1
  24. package/dist/components/Carousel/Carousel.js +112 -92
  25. package/dist/components/Carousel/Carousel.stories.d.ts.map +1 -1
  26. package/dist/components/Chip/Chip.d.ts.map +1 -1
  27. package/dist/components/Chip/Chip.js +6 -2
  28. package/dist/components/Chip/Chip.stories.d.ts.map +1 -1
  29. package/dist/components/DataTable/DataTable.stories.d.ts.map +1 -1
  30. package/dist/components/DatePicker/DatePicker.d.ts.map +1 -1
  31. package/dist/components/DatePicker/DatePicker.js +10 -2
  32. package/dist/components/DatePicker/DatePicker.stories.d.ts +1 -0
  33. package/dist/components/DatePicker/DatePicker.stories.d.ts.map +1 -1
  34. package/dist/components/DatePickerButton/DatePickerButton.d.ts +97 -0
  35. package/dist/components/DatePickerButton/DatePickerButton.d.ts.map +1 -0
  36. package/dist/components/DatePickerButton/DatePickerButton.js +329 -0
  37. package/dist/components/DatePickerButton/DatePickerButton.stories.d.ts +15 -0
  38. package/dist/components/DatePickerButton/DatePickerButton.stories.d.ts.map +1 -0
  39. package/dist/components/DatePickerButton/index.d.ts +2 -0
  40. package/dist/components/DatePickerButton/index.d.ts.map +1 -0
  41. package/dist/components/Dialog/Dialog.js +1 -1
  42. package/dist/components/Dialog/Dialog.stories.d.ts +1 -0
  43. package/dist/components/Dialog/Dialog.stories.d.ts.map +1 -1
  44. package/dist/components/DropdownMenu/DropdownMenu.stories.d.ts +1 -0
  45. package/dist/components/DropdownMenu/DropdownMenu.stories.d.ts.map +1 -1
  46. package/dist/components/Icons/CustomBadges.d.ts +5 -0
  47. package/dist/components/Icons/CustomBadges.d.ts.map +1 -1
  48. package/dist/components/Icons/CustomBadges.js +216 -13
  49. package/dist/components/Icons/CustomLogos.d.ts +18 -2
  50. package/dist/components/Icons/CustomLogos.d.ts.map +1 -1
  51. package/dist/components/Icons/CustomLogos.js +103 -97
  52. package/dist/components/Icons/LogosAndBadges.stories.d.ts +1 -0
  53. package/dist/components/Icons/LogosAndBadges.stories.d.ts.map +1 -1
  54. package/dist/components/Input/Input.js +22 -32
  55. package/dist/components/LanguageSwitcher/LanguageSwitcher.d.ts +26 -1
  56. package/dist/components/LanguageSwitcher/LanguageSwitcher.d.ts.map +1 -1
  57. package/dist/components/LanguageSwitcher/LanguageSwitcher.js +86 -44
  58. package/dist/components/LanguageSwitcher/LanguageSwitcher.stories.d.ts +2 -0
  59. package/dist/components/LanguageSwitcher/LanguageSwitcher.stories.d.ts.map +1 -1
  60. package/dist/components/Lightbox/Lightbox.d.ts.map +1 -1
  61. package/dist/components/Lightbox/Lightbox.js +70 -54
  62. package/dist/components/Lightbox/Lightbox.stories.d.ts +1 -0
  63. package/dist/components/Lightbox/Lightbox.stories.d.ts.map +1 -1
  64. package/dist/components/Lightbox/LightboxOverrides.css +5 -5
  65. package/dist/components/LoginScreen/LoginScreen.js +8 -8
  66. package/dist/components/LoginScreen/LoginScreen.stories.d.ts.map +1 -1
  67. package/dist/components/LoginScreen/LoginScreen3D/LoginScreen3DModel.js +10 -9
  68. package/dist/components/LoginScreen/LoginScreen3D/LoginScreen3DScene.js +21 -22
  69. package/dist/components/LoginScreen/LoginScreenItem.js +1 -1
  70. package/dist/components/MultiSelect/MultiSelect.stories.d.ts +1 -0
  71. package/dist/components/MultiSelect/MultiSelect.stories.d.ts.map +1 -1
  72. package/dist/components/Pagination/Pagination.stories.d.ts.map +1 -1
  73. package/dist/components/Popover/Popover.d.ts +8 -1
  74. package/dist/components/Popover/Popover.d.ts.map +1 -1
  75. package/dist/components/Popover/Popover.js +7 -6
  76. package/dist/components/Popover/Popover.stories.d.ts +1 -0
  77. package/dist/components/Popover/Popover.stories.d.ts.map +1 -1
  78. package/dist/components/Reorderable/Reorderable.js +74 -78
  79. package/dist/components/Reorderable/Reorderable.stories.d.ts.map +1 -1
  80. package/dist/components/ReorderableTable/ReorderableTable.js +1 -1
  81. package/dist/components/SegmentedControl/SegmentedControl.stories.d.ts.map +1 -1
  82. package/dist/components/SegmentedIconControl/SegmentedIconControl.stories.d.ts.map +1 -1
  83. package/dist/components/Select/Select.stories.d.ts +1 -0
  84. package/dist/components/Select/Select.stories.d.ts.map +1 -1
  85. package/dist/components/Sheet/Sheet.stories.d.ts +1 -0
  86. package/dist/components/Sheet/Sheet.stories.d.ts.map +1 -1
  87. package/dist/components/SwipeButton/SwipeButton.js +37 -42
  88. package/dist/components/Tag/Tag.js +1 -1
  89. package/dist/components/TextEditor/LinkBubbleMenu.js +2 -2
  90. package/dist/components/TextEditor/TextEditor.d.ts.map +1 -1
  91. package/dist/components/TextEditor/TextEditor.js +17 -14
  92. package/dist/components/TextEditor/TextEditor.stories.d.ts.map +1 -1
  93. package/dist/components/Toast/Toast.stories.d.ts +1 -0
  94. package/dist/components/Toast/Toast.stories.d.ts.map +1 -1
  95. package/dist/components/Toggle/Toggle.stories.d.ts.map +1 -1
  96. package/dist/components/ToggleCheckButton/ToggleCheckButton.stories.d.ts.map +1 -1
  97. package/dist/components/ToggleGroup/ToggleGroup.stories.d.ts.map +1 -1
  98. package/dist/components/Tooltip/Tooltip.stories.d.ts +1 -0
  99. package/dist/components/Tooltip/Tooltip.stories.d.ts.map +1 -1
  100. package/dist/components/Typography/Typography.d.ts +10 -1
  101. package/dist/components/Typography/Typography.d.ts.map +1 -1
  102. package/dist/components/Typography/Typography.js +82 -67
  103. package/dist/components/Typography/Typography.stories.d.ts +1 -0
  104. package/dist/components/Typography/Typography.stories.d.ts.map +1 -1
  105. package/dist/components/TypographyLink/TypographyLink.d.ts +72 -0
  106. package/dist/components/TypographyLink/TypographyLink.d.ts.map +1 -0
  107. package/dist/components/TypographyLink/TypographyLink.js +103 -0
  108. package/dist/components/TypographyLink/TypographyLink.stories.d.ts +12 -0
  109. package/dist/components/TypographyLink/TypographyLink.stories.d.ts.map +1 -0
  110. package/dist/components/TypographyLink/index.d.ts +2 -0
  111. package/dist/components/TypographyLink/index.d.ts.map +1 -0
  112. package/dist/components/UniversalFooter/UniversalFooter.d.ts +198 -0
  113. package/dist/components/UniversalFooter/UniversalFooter.d.ts.map +1 -0
  114. package/dist/components/UniversalFooter/UniversalFooter.js +401 -0
  115. package/dist/components/UniversalFooter/UniversalFooter.stories.d.ts +19 -0
  116. package/dist/components/UniversalFooter/UniversalFooter.stories.d.ts.map +1 -0
  117. package/dist/components/UniversalFooter/index.d.ts +2 -0
  118. package/dist/components/UniversalFooter/index.d.ts.map +1 -0
  119. package/dist/components/index.d.ts +4 -0
  120. package/dist/components/index.d.ts.map +1 -1
  121. package/dist/fonts/Objectivity/OFL.txt +92 -92
  122. package/dist/globals.css +12 -12
  123. package/dist/index.js +354 -322
  124. package/dist/muza-ui.css +1 -1
  125. package/dist/styles/3rd-parties.css +5 -5
  126. package/dist/styles/animations.css +21 -21
  127. package/dist/styles/breakpoints.css +4 -4
  128. package/dist/styles/primitives.css +163 -161
  129. package/dist/styles/token-colors.css +1445 -1437
  130. package/dist/styles/token-sizes.css +1553 -1513
  131. package/dist/styles/typography.css +113 -113
  132. package/dist/styles/utilities.css +66 -66
  133. package/dist/styles/white-label.css +26 -26
  134. package/dist/translations/TranslationContext.js +22 -24
  135. package/dist/translations/index.d.ts +1 -1
  136. package/dist/translations/index.d.ts.map +1 -1
  137. package/dist/translations/locales/cs.d.ts.map +1 -1
  138. package/dist/translations/locales/cs.js +9 -1
  139. package/dist/translations/locales/en.d.ts.map +1 -1
  140. package/dist/translations/locales/en.js +9 -1
  141. package/dist/translations/locales/sk.d.ts.map +1 -1
  142. package/dist/translations/locales/sk.js +9 -1
  143. package/dist/translations/types.d.ts +20 -0
  144. package/dist/translations/types.d.ts.map +1 -1
  145. package/llms-full.md +584 -584
  146. package/llms.txt +37 -37
  147. package/package.json +20 -24
  148. package/dist/_virtual/_commonjsHelpers.js +0 -6
  149. package/dist/_virtual/constants.js +0 -5
  150. package/dist/_virtual/constants2.js +0 -4
  151. package/dist/_virtual/index.js +0 -7
  152. package/dist/_virtual/index2.js +0 -4
  153. package/dist/_virtual/index3.js +0 -4
  154. package/dist/_virtual/index4.js +0 -7
  155. package/dist/_virtual/index5.js +0 -5
  156. package/dist/_virtual/index6.js +0 -4
  157. package/dist/_virtual/index7.js +0 -4
  158. package/dist/_virtual/react-dom-server-legacy.browser.development.js +0 -4
  159. package/dist/_virtual/react-dom-server-legacy.browser.production.min.js +0 -4
  160. package/dist/_virtual/react-dom-server.browser.development.js +0 -4
  161. package/dist/_virtual/react-dom-server.browser.production.min.js +0 -4
  162. package/dist/_virtual/react-is.development.js +0 -4
  163. package/dist/_virtual/react-is.production.min.js +0 -4
  164. package/dist/_virtual/react-reconciler-constants.development.js +0 -4
  165. package/dist/_virtual/react-reconciler-constants.production.min.js +0 -4
  166. package/dist/_virtual/react-reconciler.development.js +0 -4
  167. package/dist/_virtual/scheduler.development.js +0 -4
  168. package/dist/_virtual/scheduler.production.min.js +0 -4
  169. package/dist/_virtual/server.browser.js +0 -5
  170. package/dist/_virtual/server.browser2.js +0 -4
  171. package/dist/node_modules/@date-fns/tz/date/index.js +0 -61
  172. package/dist/node_modules/@date-fns/tz/date/mini.js +0 -69
  173. package/dist/node_modules/@date-fns/tz/tzName/index.js +0 -11
  174. package/dist/node_modules/@date-fns/tz/tzOffset/index.js +0 -22
  175. package/dist/node_modules/@popperjs/core/lib/createPopper.js +0 -122
  176. package/dist/node_modules/@popperjs/core/lib/dom-utils/contains.js +0 -18
  177. package/dist/node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js +0 -23
  178. package/dist/node_modules/@popperjs/core/lib/dom-utils/getClippingRect.js +0 -37
  179. package/dist/node_modules/@popperjs/core/lib/dom-utils/getCompositeRect.js +0 -32
  180. package/dist/node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js +0 -7
  181. package/dist/node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js +0 -10
  182. package/dist/node_modules/@popperjs/core/lib/dom-utils/getDocumentRect.js +0 -17
  183. package/dist/node_modules/@popperjs/core/lib/dom-utils/getHTMLElementScroll.js +0 -9
  184. package/dist/node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.js +0 -13
  185. package/dist/node_modules/@popperjs/core/lib/dom-utils/getNodeName.js +0 -6
  186. package/dist/node_modules/@popperjs/core/lib/dom-utils/getNodeScroll.js +0 -10
  187. package/dist/node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js +0 -35
  188. package/dist/node_modules/@popperjs/core/lib/dom-utils/getParentNode.js +0 -18
  189. package/dist/node_modules/@popperjs/core/lib/dom-utils/getScrollParent.js +0 -10
  190. package/dist/node_modules/@popperjs/core/lib/dom-utils/getViewportRect.js +0 -21
  191. package/dist/node_modules/@popperjs/core/lib/dom-utils/getWindow.js +0 -12
  192. package/dist/node_modules/@popperjs/core/lib/dom-utils/getWindowScroll.js +0 -11
  193. package/dist/node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.js +0 -9
  194. package/dist/node_modules/@popperjs/core/lib/dom-utils/instanceOf.js +0 -20
  195. package/dist/node_modules/@popperjs/core/lib/dom-utils/isLayoutViewport.js +0 -7
  196. package/dist/node_modules/@popperjs/core/lib/dom-utils/isScrollParent.js +0 -8
  197. package/dist/node_modules/@popperjs/core/lib/dom-utils/isTableElement.js +0 -7
  198. package/dist/node_modules/@popperjs/core/lib/dom-utils/listScrollParents.js +0 -16
  199. package/dist/node_modules/@popperjs/core/lib/enums.js +0 -31
  200. package/dist/node_modules/@popperjs/core/lib/modifiers/applyStyles.js +0 -47
  201. package/dist/node_modules/@popperjs/core/lib/modifiers/arrow.js +0 -37
  202. package/dist/node_modules/@popperjs/core/lib/modifiers/computeStyles.js +0 -99
  203. package/dist/node_modules/@popperjs/core/lib/modifiers/eventListeners.js +0 -26
  204. package/dist/node_modules/@popperjs/core/lib/modifiers/flip.js +0 -74
  205. package/dist/node_modules/@popperjs/core/lib/modifiers/hide.js +0 -44
  206. package/dist/node_modules/@popperjs/core/lib/modifiers/offset.js +0 -31
  207. package/dist/node_modules/@popperjs/core/lib/modifiers/popperOffsets.js +0 -19
  208. package/dist/node_modules/@popperjs/core/lib/modifiers/preventOverflow.js +0 -54
  209. package/dist/node_modules/@popperjs/core/lib/popper.js +0 -27
  210. package/dist/node_modules/@popperjs/core/lib/utils/computeAutoPlacement.js +0 -27
  211. package/dist/node_modules/@popperjs/core/lib/utils/computeOffsets.js +0 -54
  212. package/dist/node_modules/@popperjs/core/lib/utils/debounce.js +0 -13
  213. package/dist/node_modules/@popperjs/core/lib/utils/detectOverflow.js +0 -33
  214. package/dist/node_modules/@popperjs/core/lib/utils/expandToHashMap.js +0 -8
  215. package/dist/node_modules/@popperjs/core/lib/utils/getAltAxis.js +0 -6
  216. package/dist/node_modules/@popperjs/core/lib/utils/getBasePlacement.js +0 -6
  217. package/dist/node_modules/@popperjs/core/lib/utils/getFreshSideObject.js +0 -11
  218. package/dist/node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.js +0 -6
  219. package/dist/node_modules/@popperjs/core/lib/utils/getOppositePlacement.js +0 -14
  220. package/dist/node_modules/@popperjs/core/lib/utils/getOppositeVariationPlacement.js +0 -12
  221. package/dist/node_modules/@popperjs/core/lib/utils/getVariation.js +0 -6
  222. package/dist/node_modules/@popperjs/core/lib/utils/math.js +0 -6
  223. package/dist/node_modules/@popperjs/core/lib/utils/mergeByName.js +0 -15
  224. package/dist/node_modules/@popperjs/core/lib/utils/mergePaddingObject.js +0 -7
  225. package/dist/node_modules/@popperjs/core/lib/utils/orderModifiers.js +0 -31
  226. package/dist/node_modules/@popperjs/core/lib/utils/rectToClientRect.js +0 -11
  227. package/dist/node_modules/@popperjs/core/lib/utils/userAgent.js +0 -9
  228. package/dist/node_modules/@popperjs/core/lib/utils/within.js +0 -12
  229. package/dist/node_modules/@react-three/drei/core/useAnimations.js +0 -34
  230. package/dist/node_modules/@react-three/drei/core/useGLTF.js +0 -18
  231. package/dist/node_modules/@react-three/fiber/dist/events-776716bd.esm.js +0 -1311
  232. package/dist/node_modules/@react-three/fiber/dist/react-three-fiber.esm.js +0 -145
  233. package/dist/node_modules/@react-three/fiber/node_modules/suspend-react/index.js +0 -47
  234. package/dist/node_modules/@tiptap/core/dist/index.js +0 -2857
  235. package/dist/node_modules/@tiptap/extension-blockquote/dist/index.js +0 -45
  236. package/dist/node_modules/@tiptap/extension-bold/dist/index.js +0 -76
  237. package/dist/node_modules/@tiptap/extension-bubble-menu/dist/index.js +0 -129
  238. package/dist/node_modules/@tiptap/extension-bullet-list/dist/index.js +0 -55
  239. package/dist/node_modules/@tiptap/extension-character-count/dist/index.js +0 -73
  240. package/dist/node_modules/@tiptap/extension-code/dist/index.js +0 -54
  241. package/dist/node_modules/@tiptap/extension-code-block/dist/index.js +0 -136
  242. package/dist/node_modules/@tiptap/extension-document/dist/index.js +0 -10
  243. package/dist/node_modules/@tiptap/extension-dropcursor/dist/index.js +0 -21
  244. package/dist/node_modules/@tiptap/extension-gapcursor/dist/index.js +0 -25
  245. package/dist/node_modules/@tiptap/extension-hard-break/dist/index.js +0 -56
  246. package/dist/node_modules/@tiptap/extension-heading/dist/index.js +0 -55
  247. package/dist/node_modules/@tiptap/extension-history/dist/index.js +0 -36
  248. package/dist/node_modules/@tiptap/extension-horizontal-rule/dist/index.js +0 -59
  249. package/dist/node_modules/@tiptap/extension-italic/dist/index.js +0 -75
  250. package/dist/node_modules/@tiptap/extension-link/dist/index.js +0 -272
  251. package/dist/node_modules/@tiptap/extension-list-item/dist/index.js +0 -34
  252. package/dist/node_modules/@tiptap/extension-ordered-list/dist/index.js +0 -73
  253. package/dist/node_modules/@tiptap/extension-paragraph/dist/index.js +0 -34
  254. package/dist/node_modules/@tiptap/extension-placeholder/dist/index.js +0 -53
  255. package/dist/node_modules/@tiptap/extension-strike/dist/index.js +0 -64
  256. package/dist/node_modules/@tiptap/extension-text/dist/index.js +0 -9
  257. package/dist/node_modules/@tiptap/react/dist/index.js +0 -709
  258. package/dist/node_modules/@tiptap/starter-kit/dist/index.js +0 -30
  259. package/dist/node_modules/color/index.js +0 -262
  260. package/dist/node_modules/color/node_modules/color-convert/conversions.js +0 -421
  261. package/dist/node_modules/color/node_modules/color-convert/index.js +0 -35
  262. package/dist/node_modules/color/node_modules/color-convert/route.js +0 -46
  263. package/dist/node_modules/color/node_modules/color-name/index.js +0 -153
  264. package/dist/node_modules/color-string/index.js +0 -105
  265. package/dist/node_modules/color-string/node_modules/color-name/index.js +0 -153
  266. package/dist/node_modules/date-fns/_lib/defaultOptions.js +0 -7
  267. package/dist/node_modules/date-fns/_lib/normalizeDates.js +0 -11
  268. package/dist/node_modules/date-fns/constants.js +0 -4
  269. package/dist/node_modules/date-fns/constructFrom.js +0 -8
  270. package/dist/node_modules/date-fns/isSameWeek.js +0 -14
  271. package/dist/node_modules/date-fns/locale/_lib/buildFormatLongFn.js +0 -9
  272. package/dist/node_modules/date-fns/locale/_lib/buildLocalizeFn.js +0 -18
  273. package/dist/node_modules/date-fns/locale/_lib/buildMatchFn.js +0 -31
  274. package/dist/node_modules/date-fns/locale/_lib/buildMatchPatternFn.js +0 -15
  275. package/dist/node_modules/date-fns/locale/cs/_lib/formatDistance.js +0 -275
  276. package/dist/node_modules/date-fns/locale/cs/_lib/formatLong.js +0 -33
  277. package/dist/node_modules/date-fns/locale/cs/_lib/formatRelative.js +0 -25
  278. package/dist/node_modules/date-fns/locale/cs/_lib/localize.js +0 -167
  279. package/dist/node_modules/date-fns/locale/cs/_lib/match.js +0 -109
  280. package/dist/node_modules/date-fns/locale/cs.js +0 -21
  281. package/dist/node_modules/date-fns/locale/en-US/_lib/formatDistance.js +0 -70
  282. package/dist/node_modules/date-fns/locale/en-US/_lib/formatLong.js +0 -33
  283. package/dist/node_modules/date-fns/locale/en-US/_lib/formatRelative.js +0 -11
  284. package/dist/node_modules/date-fns/locale/en-US/_lib/localize.js +0 -155
  285. package/dist/node_modules/date-fns/locale/en-US/_lib/match.js +0 -110
  286. package/dist/node_modules/date-fns/locale/en-US.js +0 -21
  287. package/dist/node_modules/date-fns/locale/sk/_lib/formatDistance.js +0 -158
  288. package/dist/node_modules/date-fns/locale/sk/_lib/formatLong.js +0 -33
  289. package/dist/node_modules/date-fns/locale/sk/_lib/formatRelative.js +0 -60
  290. package/dist/node_modules/date-fns/locale/sk/_lib/localize.js +0 -175
  291. package/dist/node_modules/date-fns/locale/sk/_lib/match.js +0 -111
  292. package/dist/node_modules/date-fns/locale/sk.js +0 -21
  293. package/dist/node_modules/date-fns/startOfWeek.js +0 -11
  294. package/dist/node_modules/date-fns/toDate.js +0 -8
  295. package/dist/node_modules/framer-motion/dist/es/animation/animate/index.js +0 -25
  296. package/dist/node_modules/framer-motion/dist/es/animation/animate/resolve-subjects.js +0 -8
  297. package/dist/node_modules/framer-motion/dist/es/animation/animate/sequence.js +0 -12
  298. package/dist/node_modules/framer-motion/dist/es/animation/animate/subject.js +0 -32
  299. package/dist/node_modules/framer-motion/dist/es/animation/sequence/create.js +0 -128
  300. package/dist/node_modules/framer-motion/dist/es/animation/sequence/utils/calc-repeat-duration.js +0 -6
  301. package/dist/node_modules/framer-motion/dist/es/animation/sequence/utils/calc-time.js +0 -6
  302. package/dist/node_modules/framer-motion/dist/es/animation/sequence/utils/edit.js +0 -22
  303. package/dist/node_modules/framer-motion/dist/es/animation/sequence/utils/normalize-times.js +0 -7
  304. package/dist/node_modules/framer-motion/dist/es/animation/sequence/utils/sort.js +0 -6
  305. package/dist/node_modules/framer-motion/dist/es/animation/utils/create-visual-element.js +0 -40
  306. package/dist/node_modules/framer-motion/dist/es/animation/utils/is-dom-keyframes.js +0 -6
  307. package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/PopChild.js +0 -59
  308. package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/PresenceChild.js +0 -34
  309. package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/index.js +0 -47
  310. package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence.js +0 -17
  311. package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/utils.js +0 -12
  312. package/dist/node_modules/framer-motion/dist/es/components/Reorder/Group.js +0 -46
  313. package/dist/node_modules/framer-motion/dist/es/components/Reorder/Item.js +0 -34
  314. package/dist/node_modules/framer-motion/dist/es/components/Reorder/utils/auto-scroll.js +0 -64
  315. package/dist/node_modules/framer-motion/dist/es/components/Reorder/utils/check-reorder.js +0 -17
  316. package/dist/node_modules/framer-motion/dist/es/context/LayoutGroupContext.js +0 -5
  317. package/dist/node_modules/framer-motion/dist/es/context/LazyContext.js +0 -5
  318. package/dist/node_modules/framer-motion/dist/es/context/MotionConfigContext.js +0 -9
  319. package/dist/node_modules/framer-motion/dist/es/context/MotionContext/create.js +0 -13
  320. package/dist/node_modules/framer-motion/dist/es/context/MotionContext/index.js +0 -5
  321. package/dist/node_modules/framer-motion/dist/es/context/MotionContext/utils.js +0 -15
  322. package/dist/node_modules/framer-motion/dist/es/context/PresenceContext.js +0 -5
  323. package/dist/node_modules/framer-motion/dist/es/context/ReorderContext.js +0 -5
  324. package/dist/node_modules/framer-motion/dist/es/context/SwitchLayoutGroupContext.js +0 -5
  325. package/dist/node_modules/framer-motion/dist/es/events/add-pointer-event.js +0 -8
  326. package/dist/node_modules/framer-motion/dist/es/events/event-info.js +0 -14
  327. package/dist/node_modules/framer-motion/dist/es/gestures/drag/VisualElementDragControls.js +0 -277
  328. package/dist/node_modules/framer-motion/dist/es/gestures/drag/index.js +0 -22
  329. package/dist/node_modules/framer-motion/dist/es/gestures/drag/use-drag-controls.js +0 -70
  330. package/dist/node_modules/framer-motion/dist/es/gestures/drag/utils/constraints.js +0 -67
  331. package/dist/node_modules/framer-motion/dist/es/gestures/focus.js +0 -28
  332. package/dist/node_modules/framer-motion/dist/es/gestures/hover.js +0 -21
  333. package/dist/node_modules/framer-motion/dist/es/gestures/pan/PanSession.js +0 -131
  334. package/dist/node_modules/framer-motion/dist/es/gestures/pan/index.js +0 -43
  335. package/dist/node_modules/framer-motion/dist/es/gestures/press.js +0 -23
  336. package/dist/node_modules/framer-motion/dist/es/motion/features/animation/exit.js +0 -27
  337. package/dist/node_modules/framer-motion/dist/es/motion/features/animation/index.js +0 -34
  338. package/dist/node_modules/framer-motion/dist/es/motion/features/animations.js +0 -13
  339. package/dist/node_modules/framer-motion/dist/es/motion/features/definitions.js +0 -39
  340. package/dist/node_modules/framer-motion/dist/es/motion/features/drag.js +0 -17
  341. package/dist/node_modules/framer-motion/dist/es/motion/features/gestures.js +0 -21
  342. package/dist/node_modules/framer-motion/dist/es/motion/features/layout/MeasureLayout.js +0 -60
  343. package/dist/node_modules/framer-motion/dist/es/motion/features/layout.js +0 -11
  344. package/dist/node_modules/framer-motion/dist/es/motion/features/load-features.js +0 -14
  345. package/dist/node_modules/framer-motion/dist/es/motion/features/viewport/index.js +0 -44
  346. package/dist/node_modules/framer-motion/dist/es/motion/features/viewport/observers.js +0 -21
  347. package/dist/node_modules/framer-motion/dist/es/motion/index.js +0 -63
  348. package/dist/node_modules/framer-motion/dist/es/motion/utils/symbol.js +0 -4
  349. package/dist/node_modules/framer-motion/dist/es/motion/utils/use-motion-ref.js +0 -22
  350. package/dist/node_modules/framer-motion/dist/es/motion/utils/use-visual-element.js +0 -65
  351. package/dist/node_modules/framer-motion/dist/es/motion/utils/use-visual-state.js +0 -52
  352. package/dist/node_modules/framer-motion/dist/es/motion/utils/valid-prop.js +0 -38
  353. package/dist/node_modules/framer-motion/dist/es/render/components/create-proxy.js +0 -18
  354. package/dist/node_modules/framer-motion/dist/es/render/components/motion/feature-bundle.js +0 -13
  355. package/dist/node_modules/framer-motion/dist/es/render/components/motion/proxy.js +0 -7
  356. package/dist/node_modules/framer-motion/dist/es/render/dom/create-visual-element.js +0 -10
  357. package/dist/node_modules/framer-motion/dist/es/render/dom/use-render.js +0 -16
  358. package/dist/node_modules/framer-motion/dist/es/render/dom/utils/filter-props.js +0 -20
  359. package/dist/node_modules/framer-motion/dist/es/render/dom/utils/is-svg-component.js +0 -24
  360. package/dist/node_modules/framer-motion/dist/es/render/html/use-html-visual-state.js +0 -10
  361. package/dist/node_modules/framer-motion/dist/es/render/html/use-props.js +0 -27
  362. package/dist/node_modules/framer-motion/dist/es/render/html/utils/create-render-state.js +0 -9
  363. package/dist/node_modules/framer-motion/dist/es/render/svg/lowercase-elements.js +0 -30
  364. package/dist/node_modules/framer-motion/dist/es/render/svg/use-props.js +0 -22
  365. package/dist/node_modules/framer-motion/dist/es/render/svg/use-svg-visual-state.js +0 -10
  366. package/dist/node_modules/framer-motion/dist/es/render/svg/utils/create-render-state.js +0 -8
  367. package/dist/node_modules/framer-motion/dist/es/utils/distance.js +0 -9
  368. package/dist/node_modules/framer-motion/dist/es/utils/get-context-window.js +0 -4
  369. package/dist/node_modules/framer-motion/dist/es/utils/is-browser.js +0 -4
  370. package/dist/node_modules/framer-motion/dist/es/utils/is-ref-object.js +0 -6
  371. package/dist/node_modules/framer-motion/dist/es/utils/use-composed-ref.js +0 -28
  372. package/dist/node_modules/framer-motion/dist/es/utils/use-constant.js +0 -8
  373. package/dist/node_modules/framer-motion/dist/es/utils/use-isomorphic-effect.js +0 -6
  374. package/dist/node_modules/framer-motion/dist/es/utils/use-motion-value-event.js +0 -7
  375. package/dist/node_modules/framer-motion/dist/es/value/use-combine-values.js +0 -15
  376. package/dist/node_modules/framer-motion/dist/es/value/use-computed.js +0 -10
  377. package/dist/node_modules/framer-motion/dist/es/value/use-motion-value.js +0 -15
  378. package/dist/node_modules/framer-motion/dist/es/value/use-transform.js +0 -31
  379. package/dist/node_modules/imask/esm/controls/html-contenteditable-mask-element.js +0 -34
  380. package/dist/node_modules/imask/esm/controls/html-input-mask-element.js +0 -31
  381. package/dist/node_modules/imask/esm/controls/html-mask-element.js +0 -48
  382. package/dist/node_modules/imask/esm/controls/input-history.js +0 -30
  383. package/dist/node_modules/imask/esm/controls/input.js +0 -222
  384. package/dist/node_modules/imask/esm/controls/mask-element.js +0 -43
  385. package/dist/node_modules/imask/esm/core/action-details.js +0 -51
  386. package/dist/node_modules/imask/esm/core/change-details.js +0 -36
  387. package/dist/node_modules/imask/esm/core/continuous-tail-details.js +0 -42
  388. package/dist/node_modules/imask/esm/core/holder.js +0 -6
  389. package/dist/node_modules/imask/esm/core/utils.js +0 -67
  390. package/dist/node_modules/imask/esm/index.js +0 -50
  391. package/dist/node_modules/imask/esm/masked/base.js +0 -252
  392. package/dist/node_modules/imask/esm/masked/date.js +0 -117
  393. package/dist/node_modules/imask/esm/masked/dynamic.js +0 -222
  394. package/dist/node_modules/imask/esm/masked/enum.js +0 -69
  395. package/dist/node_modules/imask/esm/masked/factory.js +0 -46
  396. package/dist/node_modules/imask/esm/masked/function.js +0 -23
  397. package/dist/node_modules/imask/esm/masked/number.js +0 -212
  398. package/dist/node_modules/imask/esm/masked/pattern/chunk-tail-details.js +0 -103
  399. package/dist/node_modules/imask/esm/masked/pattern/cursor.js +0 -100
  400. package/dist/node_modules/imask/esm/masked/pattern/fixed-definition.js +0 -102
  401. package/dist/node_modules/imask/esm/masked/pattern/input-definition.js +0 -133
  402. package/dist/node_modules/imask/esm/masked/pattern.js +0 -322
  403. package/dist/node_modules/imask/esm/masked/pipe.js +0 -23
  404. package/dist/node_modules/imask/esm/masked/range.js +0 -78
  405. package/dist/node_modules/imask/esm/masked/regexp.js +0 -21
  406. package/dist/node_modules/imask/esm/masked/repeat.js +0 -104
  407. package/dist/node_modules/its-fine/dist/index.js +0 -116
  408. package/dist/node_modules/linkifyjs/dist/linkify.js +0 -707
  409. package/dist/node_modules/motion-dom/dist/es/animation/AsyncMotionValueAnimation.js +0 -106
  410. package/dist/node_modules/motion-dom/dist/es/animation/GroupAnimation.js +0 -76
  411. package/dist/node_modules/motion-dom/dist/es/animation/GroupAnimationWithThen.js +0 -10
  412. package/dist/node_modules/motion-dom/dist/es/animation/JSAnimation.js +0 -133
  413. package/dist/node_modules/motion-dom/dist/es/animation/NativeAnimation.js +0 -108
  414. package/dist/node_modules/motion-dom/dist/es/animation/NativeAnimationExtended.js +0 -37
  415. package/dist/node_modules/motion-dom/dist/es/animation/animate/single-value.js +0 -10
  416. package/dist/node_modules/motion-dom/dist/es/animation/drivers/frame.js +0 -17
  417. package/dist/node_modules/motion-dom/dist/es/animation/generators/inertia.js +0 -37
  418. package/dist/node_modules/motion-dom/dist/es/animation/generators/keyframes.js +0 -30
  419. package/dist/node_modules/motion-dom/dist/es/animation/generators/spring/defaults.js +0 -32
  420. package/dist/node_modules/motion-dom/dist/es/animation/generators/spring/find.js +0 -52
  421. package/dist/node_modules/motion-dom/dist/es/animation/generators/spring/index.js +0 -98
  422. package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/calc-duration.js +0 -13
  423. package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/create-generator-easing.js +0 -13
  424. package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/is-generator.js +0 -6
  425. package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/velocity.js +0 -9
  426. package/dist/node_modules/motion-dom/dist/es/animation/interfaces/motion-value.js +0 -46
  427. package/dist/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-target.js +0 -46
  428. package/dist/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-variant.js +0 -30
  429. package/dist/node_modules/motion-dom/dist/es/animation/interfaces/visual-element.js +0 -22
  430. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/DOMKeyframesResolver.js +0 -69
  431. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/KeyframesResolver.js +0 -75
  432. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/get-final.js +0 -8
  433. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/offsets/default.js +0 -8
  434. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/offsets/fill.js +0 -12
  435. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/offsets/time.js +0 -6
  436. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/utils/fill-wildcards.js +0 -7
  437. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/utils/is-none.js +0 -7
  438. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/utils/make-none-animatable.js +0 -16
  439. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/utils/unit-conversion.js +0 -31
  440. package/dist/node_modules/motion-dom/dist/es/animation/optimized-appear/data-id.js +0 -6
  441. package/dist/node_modules/motion-dom/dist/es/animation/optimized-appear/get-appear-id.js +0 -7
  442. package/dist/node_modules/motion-dom/dist/es/animation/utils/WithPromise.js +0 -27
  443. package/dist/node_modules/motion-dom/dist/es/animation/utils/calc-child-stagger.js +0 -7
  444. package/dist/node_modules/motion-dom/dist/es/animation/utils/can-animate.js +0 -23
  445. package/dist/node_modules/motion-dom/dist/es/animation/utils/css-variables-conversion.js +0 -31
  446. package/dist/node_modules/motion-dom/dist/es/animation/utils/default-transitions.js +0 -22
  447. package/dist/node_modules/motion-dom/dist/es/animation/utils/get-final-keyframe.js +0 -8
  448. package/dist/node_modules/motion-dom/dist/es/animation/utils/get-value-transition.js +0 -6
  449. package/dist/node_modules/motion-dom/dist/es/animation/utils/is-animatable.js +0 -7
  450. package/dist/node_modules/motion-dom/dist/es/animation/utils/is-css-variable.js +0 -9
  451. package/dist/node_modules/motion-dom/dist/es/animation/utils/is-transition-defined.js +0 -6
  452. package/dist/node_modules/motion-dom/dist/es/animation/utils/make-animation-instant.js +0 -6
  453. package/dist/node_modules/motion-dom/dist/es/animation/utils/replace-transition-type.js +0 -16
  454. package/dist/node_modules/motion-dom/dist/es/animation/waapi/easing/cubic-bezier.js +0 -4
  455. package/dist/node_modules/motion-dom/dist/es/animation/waapi/easing/map-easing.js +0 -12
  456. package/dist/node_modules/motion-dom/dist/es/animation/waapi/easing/supported.js +0 -15
  457. package/dist/node_modules/motion-dom/dist/es/animation/waapi/start-waapi-animation.js +0 -21
  458. package/dist/node_modules/motion-dom/dist/es/animation/waapi/supports/waapi.js +0 -24
  459. package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/apply-generator.js +0 -8
  460. package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/linear.js +0 -10
  461. package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/unsupported-easing.js +0 -17
  462. package/dist/node_modules/motion-dom/dist/es/events/add-dom-event.js +0 -6
  463. package/dist/node_modules/motion-dom/dist/es/frameloop/batcher.js +0 -27
  464. package/dist/node_modules/motion-dom/dist/es/frameloop/frame.js +0 -9
  465. package/dist/node_modules/motion-dom/dist/es/frameloop/microtask.js +0 -5
  466. package/dist/node_modules/motion-dom/dist/es/frameloop/order.js +0 -21
  467. package/dist/node_modules/motion-dom/dist/es/frameloop/render-step.js +0 -41
  468. package/dist/node_modules/motion-dom/dist/es/frameloop/sync-time.js +0 -15
  469. package/dist/node_modules/motion-dom/dist/es/gestures/drag/state/is-active.js +0 -11
  470. package/dist/node_modules/motion-dom/dist/es/gestures/drag/state/set-active.js +0 -11
  471. package/dist/node_modules/motion-dom/dist/es/gestures/hover.js +0 -24
  472. package/dist/node_modules/motion-dom/dist/es/gestures/press/index.js +0 -33
  473. package/dist/node_modules/motion-dom/dist/es/gestures/press/utils/is-keyboard-accessible.js +0 -13
  474. package/dist/node_modules/motion-dom/dist/es/gestures/press/utils/keyboard.js +0 -27
  475. package/dist/node_modules/motion-dom/dist/es/gestures/press/utils/state.js +0 -4
  476. package/dist/node_modules/motion-dom/dist/es/gestures/utils/is-node-or-child.js +0 -4
  477. package/dist/node_modules/motion-dom/dist/es/gestures/utils/is-primary-pointer.js +0 -4
  478. package/dist/node_modules/motion-dom/dist/es/gestures/utils/setup.js +0 -12
  479. package/dist/node_modules/motion-dom/dist/es/projection/animation/mix-values.js +0 -27
  480. package/dist/node_modules/motion-dom/dist/es/projection/geometry/conversion.js +0 -25
  481. package/dist/node_modules/motion-dom/dist/es/projection/geometry/copy.js +0 -14
  482. package/dist/node_modules/motion-dom/dist/es/projection/geometry/delta-apply.js +0 -52
  483. package/dist/node_modules/motion-dom/dist/es/projection/geometry/delta-calc.js +0 -36
  484. package/dist/node_modules/motion-dom/dist/es/projection/geometry/delta-remove.js +0 -25
  485. package/dist/node_modules/motion-dom/dist/es/projection/geometry/models.js +0 -18
  486. package/dist/node_modules/motion-dom/dist/es/projection/geometry/utils.js +0 -34
  487. package/dist/node_modules/motion-dom/dist/es/projection/node/DocumentProjectionNode.js +0 -16
  488. package/dist/node_modules/motion-dom/dist/es/projection/node/HTMLProjectionNode.js +0 -25
  489. package/dist/node_modules/motion-dom/dist/es/projection/node/create-projection-node.js +0 -623
  490. package/dist/node_modules/motion-dom/dist/es/projection/node/state.js +0 -15
  491. package/dist/node_modules/motion-dom/dist/es/projection/shared/stack.js +0 -60
  492. package/dist/node_modules/motion-dom/dist/es/projection/styles/scale-border-radius.js +0 -21
  493. package/dist/node_modules/motion-dom/dist/es/projection/styles/scale-box-shadow.js +0 -16
  494. package/dist/node_modules/motion-dom/dist/es/projection/styles/scale-correction.js +0 -21
  495. package/dist/node_modules/motion-dom/dist/es/projection/styles/transform.js +0 -13
  496. package/dist/node_modules/motion-dom/dist/es/projection/utils/compare-by-depth.js +0 -4
  497. package/dist/node_modules/motion-dom/dist/es/projection/utils/each-axis.js +0 -6
  498. package/dist/node_modules/motion-dom/dist/es/projection/utils/flat-tree.js +0 -19
  499. package/dist/node_modules/motion-dom/dist/es/projection/utils/has-transform.js +0 -20
  500. package/dist/node_modules/motion-dom/dist/es/projection/utils/measure.js +0 -13
  501. package/dist/node_modules/motion-dom/dist/es/render/Feature.js +0 -10
  502. package/dist/node_modules/motion-dom/dist/es/render/VisualElement.js +0 -247
  503. package/dist/node_modules/motion-dom/dist/es/render/dom/DOMVisualElement.js +0 -28
  504. package/dist/node_modules/motion-dom/dist/es/render/dom/is-css-var.js +0 -4
  505. package/dist/node_modules/motion-dom/dist/es/render/dom/parse-transform.js +0 -65
  506. package/dist/node_modules/motion-dom/dist/es/render/dom/style-set.js +0 -7
  507. package/dist/node_modules/motion-dom/dist/es/render/dom/utils/camel-to-dash.js +0 -6
  508. package/dist/node_modules/motion-dom/dist/es/render/html/HTMLVisualElement.js +0 -38
  509. package/dist/node_modules/motion-dom/dist/es/render/html/utils/build-styles.js +0 -29
  510. package/dist/node_modules/motion-dom/dist/es/render/html/utils/build-transform.js +0 -37
  511. package/dist/node_modules/motion-dom/dist/es/render/html/utils/render.js +0 -12
  512. package/dist/node_modules/motion-dom/dist/es/render/html/utils/scrape-motion-values.js +0 -14
  513. package/dist/node_modules/motion-dom/dist/es/render/object/ObjectVisualElement.js +0 -37
  514. package/dist/node_modules/motion-dom/dist/es/render/store.js +0 -4
  515. package/dist/node_modules/motion-dom/dist/es/render/svg/SVGVisualElement.js +0 -40
  516. package/dist/node_modules/motion-dom/dist/es/render/svg/utils/build-attrs.js +0 -32
  517. package/dist/node_modules/motion-dom/dist/es/render/svg/utils/camel-case-attrs.js +0 -28
  518. package/dist/node_modules/motion-dom/dist/es/render/svg/utils/is-svg-tag.js +0 -4
  519. package/dist/node_modules/motion-dom/dist/es/render/svg/utils/path.js +0 -15
  520. package/dist/node_modules/motion-dom/dist/es/render/svg/utils/render.js +0 -11
  521. package/dist/node_modules/motion-dom/dist/es/render/svg/utils/scrape-motion-values.js +0 -15
  522. package/dist/node_modules/motion-dom/dist/es/render/utils/animation-state.js +0 -141
  523. package/dist/node_modules/motion-dom/dist/es/render/utils/get-variant-context.js +0 -20
  524. package/dist/node_modules/motion-dom/dist/es/render/utils/is-animation-controls.js +0 -6
  525. package/dist/node_modules/motion-dom/dist/es/render/utils/is-controlling-variants.js +0 -13
  526. package/dist/node_modules/motion-dom/dist/es/render/utils/is-forced-motion-value.js +0 -9
  527. package/dist/node_modules/motion-dom/dist/es/render/utils/is-keyframes-target.js +0 -4
  528. package/dist/node_modules/motion-dom/dist/es/render/utils/is-variant-label.js +0 -6
  529. package/dist/node_modules/motion-dom/dist/es/render/utils/keys-position.js +0 -13
  530. package/dist/node_modules/motion-dom/dist/es/render/utils/keys-transform.js +0 -23
  531. package/dist/node_modules/motion-dom/dist/es/render/utils/motion-values.js +0 -25
  532. package/dist/node_modules/motion-dom/dist/es/render/utils/reduced-motion/index.js +0 -15
  533. package/dist/node_modules/motion-dom/dist/es/render/utils/reduced-motion/state.js +0 -5
  534. package/dist/node_modules/motion-dom/dist/es/render/utils/resolve-dynamic-variants.js +0 -8
  535. package/dist/node_modules/motion-dom/dist/es/render/utils/resolve-variants.js +0 -20
  536. package/dist/node_modules/motion-dom/dist/es/render/utils/setters.js +0 -21
  537. package/dist/node_modules/motion-dom/dist/es/render/utils/shallow-compare.js +0 -14
  538. package/dist/node_modules/motion-dom/dist/es/render/utils/variant-props.js +0 -13
  539. package/dist/node_modules/motion-dom/dist/es/utils/delay.js +0 -12
  540. package/dist/node_modules/motion-dom/dist/es/utils/interpolate.js +0 -42
  541. package/dist/node_modules/motion-dom/dist/es/utils/is-html-element.js +0 -7
  542. package/dist/node_modules/motion-dom/dist/es/utils/is-svg-element.js +0 -7
  543. package/dist/node_modules/motion-dom/dist/es/utils/is-svg-svg-element.js +0 -7
  544. package/dist/node_modules/motion-dom/dist/es/utils/mix/color.js +0 -29
  545. package/dist/node_modules/motion-dom/dist/es/utils/mix/complex.js +0 -51
  546. package/dist/node_modules/motion-dom/dist/es/utils/mix/immediate.js +0 -6
  547. package/dist/node_modules/motion-dom/dist/es/utils/mix/index.js +0 -8
  548. package/dist/node_modules/motion-dom/dist/es/utils/mix/number.js +0 -4
  549. package/dist/node_modules/motion-dom/dist/es/utils/mix/visibility.js +0 -8
  550. package/dist/node_modules/motion-dom/dist/es/utils/resolve-elements.js +0 -15
  551. package/dist/node_modules/motion-dom/dist/es/utils/supports/flags.js +0 -4
  552. package/dist/node_modules/motion-dom/dist/es/utils/supports/linear-easing.js +0 -12
  553. package/dist/node_modules/motion-dom/dist/es/utils/supports/memo.js +0 -9
  554. package/dist/node_modules/motion-dom/dist/es/utils/supports/scroll-timeline.js +0 -5
  555. package/dist/node_modules/motion-dom/dist/es/utils/transform.js +0 -8
  556. package/dist/node_modules/motion-dom/dist/es/value/index.js +0 -218
  557. package/dist/node_modules/motion-dom/dist/es/value/types/auto.js +0 -7
  558. package/dist/node_modules/motion-dom/dist/es/value/types/color/hex.js +0 -19
  559. package/dist/node_modules/motion-dom/dist/es/value/types/color/hsla-to-rgba.js +0 -22
  560. package/dist/node_modules/motion-dom/dist/es/value/types/color/hsla.js +0 -12
  561. package/dist/node_modules/motion-dom/dist/es/value/types/color/index.js +0 -15
  562. package/dist/node_modules/motion-dom/dist/es/value/types/color/rgba.js +0 -16
  563. package/dist/node_modules/motion-dom/dist/es/value/types/color/utils.js +0 -18
  564. package/dist/node_modules/motion-dom/dist/es/value/types/complex/filter.js +0 -24
  565. package/dist/node_modules/motion-dom/dist/es/value/types/complex/index.js +0 -49
  566. package/dist/node_modules/motion-dom/dist/es/value/types/dimensions.js +0 -9
  567. package/dist/node_modules/motion-dom/dist/es/value/types/int.js +0 -8
  568. package/dist/node_modules/motion-dom/dist/es/value/types/maps/defaults.js +0 -24
  569. package/dist/node_modules/motion-dom/dist/es/value/types/maps/number.js +0 -70
  570. package/dist/node_modules/motion-dom/dist/es/value/types/maps/transform.js +0 -31
  571. package/dist/node_modules/motion-dom/dist/es/value/types/numbers/index.js +0 -17
  572. package/dist/node_modules/motion-dom/dist/es/value/types/numbers/units.js +0 -17
  573. package/dist/node_modules/motion-dom/dist/es/value/types/test.js +0 -4
  574. package/dist/node_modules/motion-dom/dist/es/value/types/utils/animatable-none.js +0 -10
  575. package/dist/node_modules/motion-dom/dist/es/value/types/utils/color-regex.js +0 -4
  576. package/dist/node_modules/motion-dom/dist/es/value/types/utils/find.js +0 -8
  577. package/dist/node_modules/motion-dom/dist/es/value/types/utils/float-regex.js +0 -4
  578. package/dist/node_modules/motion-dom/dist/es/value/types/utils/get-as-type.js +0 -4
  579. package/dist/node_modules/motion-dom/dist/es/value/types/utils/is-nullish.js +0 -6
  580. package/dist/node_modules/motion-dom/dist/es/value/types/utils/sanitize.js +0 -4
  581. package/dist/node_modules/motion-dom/dist/es/value/types/utils/single-color-regex.js +0 -4
  582. package/dist/node_modules/motion-dom/dist/es/value/utils/is-motion-value.js +0 -4
  583. package/dist/node_modules/motion-dom/dist/es/value/utils/resolve-motion-value.js +0 -7
  584. package/dist/node_modules/motion-dom/dist/es/value/will-change/add-will-change.js +0 -14
  585. package/dist/node_modules/motion-dom/dist/es/value/will-change/is.js +0 -7
  586. package/dist/node_modules/motion-utils/dist/es/array.js +0 -20
  587. package/dist/node_modules/motion-utils/dist/es/clamp.js +0 -4
  588. package/dist/node_modules/motion-utils/dist/es/easing/anticipate.js +0 -5
  589. package/dist/node_modules/motion-utils/dist/es/easing/back.js +0 -9
  590. package/dist/node_modules/motion-utils/dist/es/easing/circ.js +0 -8
  591. package/dist/node_modules/motion-utils/dist/es/easing/cubic-bezier.js +0 -18
  592. package/dist/node_modules/motion-utils/dist/es/easing/ease.js +0 -7
  593. package/dist/node_modules/motion-utils/dist/es/easing/modifiers/mirror.js +0 -4
  594. package/dist/node_modules/motion-utils/dist/es/easing/modifiers/reverse.js +0 -4
  595. package/dist/node_modules/motion-utils/dist/es/easing/utils/get-easing-for-segment.js +0 -8
  596. package/dist/node_modules/motion-utils/dist/es/easing/utils/is-bezier-definition.js +0 -4
  597. package/dist/node_modules/motion-utils/dist/es/easing/utils/is-easing-array.js +0 -4
  598. package/dist/node_modules/motion-utils/dist/es/easing/utils/map.js +0 -32
  599. package/dist/node_modules/motion-utils/dist/es/errors.js +0 -15
  600. package/dist/node_modules/motion-utils/dist/es/format-error-message.js +0 -6
  601. package/dist/node_modules/motion-utils/dist/es/global-config.js +0 -4
  602. package/dist/node_modules/motion-utils/dist/es/is-numerical-string.js +0 -4
  603. package/dist/node_modules/motion-utils/dist/es/is-object.js +0 -6
  604. package/dist/node_modules/motion-utils/dist/es/is-zero-value-string.js +0 -4
  605. package/dist/node_modules/motion-utils/dist/es/memo.js +0 -8
  606. package/dist/node_modules/motion-utils/dist/es/noop.js +0 -4
  607. package/dist/node_modules/motion-utils/dist/es/pipe.js +0 -4
  608. package/dist/node_modules/motion-utils/dist/es/progress.js +0 -7
  609. package/dist/node_modules/motion-utils/dist/es/subscription-manager.js +0 -29
  610. package/dist/node_modules/motion-utils/dist/es/time-conversion.js +0 -5
  611. package/dist/node_modules/motion-utils/dist/es/velocity-per-second.js +0 -6
  612. package/dist/node_modules/motion-utils/dist/es/warn-once.js +0 -8
  613. package/dist/node_modules/motion-utils/dist/es/wrap.js +0 -7
  614. package/dist/node_modules/object-assign/index.js +0 -54
  615. package/dist/node_modules/orderedmap/dist/index.js +0 -103
  616. package/dist/node_modules/photoswipe/dist/photoswipe.esm.js +0 -2956
  617. package/dist/node_modules/prop-types/checkPropTypes.js +0 -54
  618. package/dist/node_modules/prop-types/factoryWithThrowingShims.js +0 -52
  619. package/dist/node_modules/prop-types/factoryWithTypeCheckers.js +0 -329
  620. package/dist/node_modules/prop-types/index.js +0 -17
  621. package/dist/node_modules/prop-types/lib/ReactPropTypesSecret.js +0 -10
  622. package/dist/node_modules/prop-types/lib/has.js +0 -7
  623. package/dist/node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js +0 -95
  624. package/dist/node_modules/prop-types/node_modules/react-is/cjs/react-is.production.min.js +0 -78
  625. package/dist/node_modules/prop-types/node_modules/react-is/index.js +0 -10
  626. package/dist/node_modules/prosemirror-commands/dist/index.js +0 -388
  627. package/dist/node_modules/prosemirror-dropcursor/dist/index.js +0 -86
  628. package/dist/node_modules/prosemirror-gapcursor/dist/index.js +0 -204
  629. package/dist/node_modules/prosemirror-history/dist/index.js +0 -248
  630. package/dist/node_modules/prosemirror-keymap/dist/index.js +0 -62
  631. package/dist/node_modules/prosemirror-model/dist/index.js +0 -2733
  632. package/dist/node_modules/prosemirror-schema-list/dist/index.js +0 -88
  633. package/dist/node_modules/prosemirror-state/dist/index.js +0 -822
  634. package/dist/node_modules/prosemirror-transform/dist/index.js +0 -1520
  635. package/dist/node_modules/prosemirror-view/dist/index.js +0 -3794
  636. package/dist/node_modules/react-day-picker/dist/esm/DayPicker.js +0 -229
  637. package/dist/node_modules/react-day-picker/dist/esm/UI.js +0 -22
  638. package/dist/node_modules/react-day-picker/dist/esm/classes/CalendarDay.js +0 -19
  639. package/dist/node_modules/react-day-picker/dist/esm/classes/CalendarMonth.js +0 -8
  640. package/dist/node_modules/react-day-picker/dist/esm/classes/CalendarWeek.js +0 -8
  641. package/dist/node_modules/react-day-picker/dist/esm/classes/DateLib.js +0 -222
  642. package/dist/node_modules/react-day-picker/dist/esm/components/Button.js +0 -7
  643. package/dist/node_modules/react-day-picker/dist/esm/components/CaptionLabel.js +0 -7
  644. package/dist/node_modules/react-day-picker/dist/esm/components/Chevron.js +0 -18
  645. package/dist/node_modules/react-day-picker/dist/esm/components/Day.js +0 -8
  646. package/dist/node_modules/react-day-picker/dist/esm/components/DayButton.js +0 -11
  647. package/dist/node_modules/react-day-picker/dist/esm/components/Dropdown.js +0 -19
  648. package/dist/node_modules/react-day-picker/dist/esm/components/DropdownNav.js +0 -7
  649. package/dist/node_modules/react-day-picker/dist/esm/components/Footer.js +0 -7
  650. package/dist/node_modules/react-day-picker/dist/esm/components/Month.js +0 -8
  651. package/dist/node_modules/react-day-picker/dist/esm/components/MonthCaption.js +0 -8
  652. package/dist/node_modules/react-day-picker/dist/esm/components/MonthGrid.js +0 -7
  653. package/dist/node_modules/react-day-picker/dist/esm/components/Months.js +0 -7
  654. package/dist/node_modules/react-day-picker/dist/esm/components/MonthsDropdown.js +0 -9
  655. package/dist/node_modules/react-day-picker/dist/esm/components/Nav.js +0 -27
  656. package/dist/node_modules/react-day-picker/dist/esm/components/NextMonthButton.js +0 -9
  657. package/dist/node_modules/react-day-picker/dist/esm/components/Option.js +0 -7
  658. package/dist/node_modules/react-day-picker/dist/esm/components/PreviousMonthButton.js +0 -9
  659. package/dist/node_modules/react-day-picker/dist/esm/components/Root.js +0 -8
  660. package/dist/node_modules/react-day-picker/dist/esm/components/Select.js +0 -7
  661. package/dist/node_modules/react-day-picker/dist/esm/components/Week.js +0 -8
  662. package/dist/node_modules/react-day-picker/dist/esm/components/WeekNumber.js +0 -8
  663. package/dist/node_modules/react-day-picker/dist/esm/components/WeekNumberHeader.js +0 -7
  664. package/dist/node_modules/react-day-picker/dist/esm/components/Weekday.js +0 -7
  665. package/dist/node_modules/react-day-picker/dist/esm/components/Weekdays.js +0 -11
  666. package/dist/node_modules/react-day-picker/dist/esm/components/Weeks.js +0 -7
  667. package/dist/node_modules/react-day-picker/dist/esm/components/YearsDropdown.js +0 -9
  668. package/dist/node_modules/react-day-picker/dist/esm/components/custom-components.js +0 -54
  669. package/dist/node_modules/react-day-picker/dist/esm/formatters/formatCaption.js +0 -9
  670. package/dist/node_modules/react-day-picker/dist/esm/formatters/formatDay.js +0 -7
  671. package/dist/node_modules/react-day-picker/dist/esm/formatters/formatMonthDropdown.js +0 -7
  672. package/dist/node_modules/react-day-picker/dist/esm/formatters/formatWeekNumber.js +0 -7
  673. package/dist/node_modules/react-day-picker/dist/esm/formatters/formatWeekNumberHeader.js +0 -6
  674. package/dist/node_modules/react-day-picker/dist/esm/formatters/formatWeekdayName.js +0 -7
  675. package/dist/node_modules/react-day-picker/dist/esm/formatters/formatYearDropdown.js +0 -9
  676. package/dist/node_modules/react-day-picker/dist/esm/formatters/index.js +0 -18
  677. package/dist/node_modules/react-day-picker/dist/esm/helpers/calculateFocusTarget.js +0 -19
  678. package/dist/node_modules/react-day-picker/dist/esm/helpers/createGetModifiers.js +0 -42
  679. package/dist/node_modules/react-day-picker/dist/esm/helpers/endOfBroadcastWeek.js +0 -9
  680. package/dist/node_modules/react-day-picker/dist/esm/helpers/getBroadcastWeeksInMonth.js +0 -7
  681. package/dist/node_modules/react-day-picker/dist/esm/helpers/getClassNamesForModifiers.js +0 -7
  682. package/dist/node_modules/react-day-picker/dist/esm/helpers/getComponents.js +0 -10
  683. package/dist/node_modules/react-day-picker/dist/esm/helpers/getDataAttributes.js +0 -16
  684. package/dist/node_modules/react-day-picker/dist/esm/helpers/getDates.js +0 -21
  685. package/dist/node_modules/react-day-picker/dist/esm/helpers/getDays.js +0 -10
  686. package/dist/node_modules/react-day-picker/dist/esm/helpers/getDefaultClassNames.js +0 -16
  687. package/dist/node_modules/react-day-picker/dist/esm/helpers/getDisplayMonths.js +0 -13
  688. package/dist/node_modules/react-day-picker/dist/esm/helpers/getFocusableDate.js +0 -15
  689. package/dist/node_modules/react-day-picker/dist/esm/helpers/getFormatters.js +0 -10
  690. package/dist/node_modules/react-day-picker/dist/esm/helpers/getInitialMonth.js +0 -13
  691. package/dist/node_modules/react-day-picker/dist/esm/helpers/getMonthOptions.js +0 -13
  692. package/dist/node_modules/react-day-picker/dist/esm/helpers/getMonths.js +0 -24
  693. package/dist/node_modules/react-day-picker/dist/esm/helpers/getNavMonth.js +0 -13
  694. package/dist/node_modules/react-day-picker/dist/esm/helpers/getNextFocus.js +0 -12
  695. package/dist/node_modules/react-day-picker/dist/esm/helpers/getNextMonth.js +0 -12
  696. package/dist/node_modules/react-day-picker/dist/esm/helpers/getPreviousMonth.js +0 -12
  697. package/dist/node_modules/react-day-picker/dist/esm/helpers/getStyleForModifiers.js +0 -13
  698. package/dist/node_modules/react-day-picker/dist/esm/helpers/getWeekdays.js +0 -11
  699. package/dist/node_modules/react-day-picker/dist/esm/helpers/getWeeks.js +0 -7
  700. package/dist/node_modules/react-day-picker/dist/esm/helpers/getYearOptions.js +0 -16
  701. package/dist/node_modules/react-day-picker/dist/esm/helpers/startOfBroadcastWeek.js +0 -7
  702. package/dist/node_modules/react-day-picker/dist/esm/helpers/useControlledValue.js +0 -8
  703. package/dist/node_modules/react-day-picker/dist/esm/labels/index.js +0 -26
  704. package/dist/node_modules/react-day-picker/dist/esm/labels/labelDayButton.js +0 -10
  705. package/dist/node_modules/react-day-picker/dist/esm/labels/labelGrid.js +0 -9
  706. package/dist/node_modules/react-day-picker/dist/esm/labels/labelGridcell.js +0 -8
  707. package/dist/node_modules/react-day-picker/dist/esm/labels/labelMonthDropdown.js +0 -6
  708. package/dist/node_modules/react-day-picker/dist/esm/labels/labelNav.js +0 -6
  709. package/dist/node_modules/react-day-picker/dist/esm/labels/labelNext.js +0 -6
  710. package/dist/node_modules/react-day-picker/dist/esm/labels/labelPrevious.js +0 -6
  711. package/dist/node_modules/react-day-picker/dist/esm/labels/labelWeekNumber.js +0 -6
  712. package/dist/node_modules/react-day-picker/dist/esm/labels/labelWeekNumberHeader.js +0 -6
  713. package/dist/node_modules/react-day-picker/dist/esm/labels/labelWeekday.js +0 -7
  714. package/dist/node_modules/react-day-picker/dist/esm/labels/labelYearDropdown.js +0 -6
  715. package/dist/node_modules/react-day-picker/dist/esm/selection/useMulti.js +0 -21
  716. package/dist/node_modules/react-day-picker/dist/esm/selection/useRange.js +0 -18
  717. package/dist/node_modules/react-day-picker/dist/esm/selection/useSingle.js +0 -15
  718. package/dist/node_modules/react-day-picker/dist/esm/useAnimation.js +0 -56
  719. package/dist/node_modules/react-day-picker/dist/esm/useCalendar.js +0 -44
  720. package/dist/node_modules/react-day-picker/dist/esm/useDayPicker.js +0 -12
  721. package/dist/node_modules/react-day-picker/dist/esm/useFocus.js +0 -23
  722. package/dist/node_modules/react-day-picker/dist/esm/useSelection.js +0 -19
  723. package/dist/node_modules/react-day-picker/dist/esm/utils/addToRange.js +0 -32
  724. package/dist/node_modules/react-day-picker/dist/esm/utils/dateMatchModifiers.js +0 -26
  725. package/dist/node_modules/react-day-picker/dist/esm/utils/rangeContainsDayOfWeek.js +0 -15
  726. package/dist/node_modules/react-day-picker/dist/esm/utils/rangeContainsModifiers.js +0 -28
  727. package/dist/node_modules/react-day-picker/dist/esm/utils/rangeIncludesDate.js +0 -9
  728. package/dist/node_modules/react-day-picker/dist/esm/utils/rangeOverlaps.js +0 -8
  729. package/dist/node_modules/react-day-picker/dist/esm/utils/typeguards.js +0 -26
  730. package/dist/node_modules/react-dom/cjs/react-dom-server-legacy.browser.development.js +0 -3621
  731. package/dist/node_modules/react-dom/cjs/react-dom-server-legacy.browser.production.min.js +0 -1234
  732. package/dist/node_modules/react-dom/cjs/react-dom-server.browser.development.js +0 -3600
  733. package/dist/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js +0 -1255
  734. package/dist/node_modules/react-dom/server.browser.js +0 -15
  735. package/dist/node_modules/react-imask/esm/hook.js +0 -75
  736. package/dist/node_modules/react-imask/esm/input.js +0 -23
  737. package/dist/node_modules/react-imask/esm/mixin.js +0 -131
  738. package/dist/node_modules/react-photoswipe-gallery/dist/context.js +0 -17
  739. package/dist/node_modules/react-photoswipe-gallery/dist/gallery.js +0 -216
  740. package/dist/node_modules/react-photoswipe-gallery/dist/helpers/ensure-ref-passed.js +0 -10
  741. package/dist/node_modules/react-photoswipe-gallery/dist/helpers/entry-item-ref-is-element.js +0 -4
  742. package/dist/node_modules/react-photoswipe-gallery/dist/helpers/get-base-url.js +0 -6
  743. package/dist/node_modules/react-photoswipe-gallery/dist/helpers/get-hash-value.js +0 -6
  744. package/dist/node_modules/react-photoswipe-gallery/dist/helpers/get-hash-without-gid-and-pid.js +0 -9
  745. package/dist/node_modules/react-photoswipe-gallery/dist/helpers/get-initial-active-slide-index.js +0 -6
  746. package/dist/node_modules/react-photoswipe-gallery/dist/helpers/get-slides-and-index-from-data-source.js +0 -39
  747. package/dist/node_modules/react-photoswipe-gallery/dist/helpers/get-slides-and-index-from-items-refs.js +0 -31
  748. package/dist/node_modules/react-photoswipe-gallery/dist/helpers/hash-includes-navigation-query-params.js +0 -8
  749. package/dist/node_modules/react-photoswipe-gallery/dist/helpers/hash-to-object.js +0 -9
  750. package/dist/node_modules/react-photoswipe-gallery/dist/helpers/item-to-slide.js +0 -37
  751. package/dist/node_modules/react-photoswipe-gallery/dist/helpers/object-to-hash.js +0 -6
  752. package/dist/node_modules/react-photoswipe-gallery/dist/helpers/sort-nodes.js +0 -6
  753. package/dist/node_modules/react-photoswipe-gallery/dist/hooks.js +0 -22
  754. package/dist/node_modules/react-photoswipe-gallery/dist/item.js +0 -54
  755. package/dist/node_modules/react-photoswipe-gallery/dist/lightbox-stub.js +0 -8
  756. package/dist/node_modules/react-photoswipe-gallery/dist/no-ref-error.js +0 -14
  757. package/dist/node_modules/react-photoswipe-gallery/dist/no-source-id-error.js +0 -18
  758. package/dist/node_modules/react-reconciler/cjs/react-reconciler-constants.development.js +0 -32
  759. package/dist/node_modules/react-reconciler/cjs/react-reconciler-constants.production.min.js +0 -17
  760. package/dist/node_modules/react-reconciler/cjs/react-reconciler.development.js +0 -9139
  761. package/dist/node_modules/react-reconciler/cjs/react-reconciler.production.min.js +0 -3778
  762. package/dist/node_modules/react-reconciler/constants.js +0 -10
  763. package/dist/node_modules/react-reconciler/index.js +0 -10
  764. package/dist/node_modules/react-use-measure/dist/index.js +0 -60
  765. package/dist/node_modules/rope-sequence/dist/index.js +0 -100
  766. package/dist/node_modules/scheduler/cjs/scheduler.development.js +0 -277
  767. package/dist/node_modules/scheduler/cjs/scheduler.production.min.js +0 -213
  768. package/dist/node_modules/scheduler/index.js +0 -10
  769. package/dist/node_modules/three/build/three.module.js +0 -20599
  770. package/dist/node_modules/three-stdlib/_polyfill/LoaderUtils.js +0 -15
  771. package/dist/node_modules/three-stdlib/_polyfill/constants.js +0 -5
  772. package/dist/node_modules/three-stdlib/libs/MeshoptDecoder.js +0 -201
  773. package/dist/node_modules/three-stdlib/loaders/DRACOLoader.js +0 -246
  774. package/dist/node_modules/three-stdlib/loaders/GLTFLoader.js +0 -1670
  775. package/dist/node_modules/three-stdlib/utils/BufferGeometryUtils.js +0 -34
  776. package/dist/node_modules/tippy.js/dist/tippy.esm.js +0 -813
  777. package/dist/node_modules/w3c-keyname/index.js +0 -93
  778. package/dist/node_modules/zustand/esm/index.js +0 -61
@@ -1,2857 +0,0 @@
1
- import { EditorState as Lt, NodeSelection as J, Plugin as I, PluginKey as j, Selection as F, TextSelection as P, AllSelection as zt } from "../../../prosemirror-state/dist/index.js";
2
- import { EditorView as Ht } from "../../../prosemirror-view/dist/index.js";
3
- import { keymap as _t } from "../../../prosemirror-keymap/dist/index.js";
4
- import { DOMSerializer as Wt, Schema as xt, Fragment as $, Node as Vt, DOMParser as nt, Slice as Kt } from "../../../prosemirror-model/dist/index.js";
5
- import { findWrapping as Ut, canJoin as dt, Transform as qt, canSplit as V, joinPoint as Ct, liftTarget as Gt, ReplaceStep as Jt, ReplaceAroundStep as Yt } from "../../../prosemirror-transform/dist/index.js";
6
- import { wrapIn as Qt, setBlockType as gt, selectTextblockStart as Xt, selectTextblockEnd as Zt, selectParentNode as te, selectNodeForward as ee, selectNodeBackward as ne, newlineInCode as re, liftEmptyBlock as oe, lift as se, joinUp as ie, joinTextblockForward as ae, joinTextblockBackward as ce, joinForward as le, joinDown as de, joinBackward as ue, exitCode as fe, deleteSelection as pe, createParagraphNear as he } from "../../../prosemirror-commands/dist/index.js";
7
- import { wrapInList as me, sinkListItem as ge, liftListItem as ye } from "../../../prosemirror-schema-list/dist/index.js";
8
- function Y(n) {
9
- const { state: t, transaction: e } = n;
10
- let { selection: r } = e, { doc: o } = e, { storedMarks: s } = e;
11
- return {
12
- ...t,
13
- apply: t.apply.bind(t),
14
- applyTransaction: t.applyTransaction.bind(t),
15
- plugins: t.plugins,
16
- schema: t.schema,
17
- reconfigure: t.reconfigure.bind(t),
18
- toJSON: t.toJSON.bind(t),
19
- get storedMarks() {
20
- return s;
21
- },
22
- get selection() {
23
- return r;
24
- },
25
- get doc() {
26
- return o;
27
- },
28
- get tr() {
29
- return r = e.selection, o = e.doc, s = e.storedMarks, e;
30
- }
31
- };
32
- }
33
- class Q {
34
- constructor(t) {
35
- this.editor = t.editor, this.rawCommands = this.editor.extensionManager.commands, this.customState = t.state;
36
- }
37
- get hasCustomState() {
38
- return !!this.customState;
39
- }
40
- get state() {
41
- return this.customState || this.editor.state;
42
- }
43
- get commands() {
44
- const { rawCommands: t, editor: e, state: r } = this, { view: o } = e, { tr: s } = r, i = this.buildProps(s);
45
- return Object.fromEntries(Object.entries(t).map(([c, a]) => [c, (...u) => {
46
- const d = a(...u)(i);
47
- return !s.getMeta("preventDispatch") && !this.hasCustomState && o.dispatch(s), d;
48
- }]));
49
- }
50
- get chain() {
51
- return () => this.createChain();
52
- }
53
- get can() {
54
- return () => this.createCan();
55
- }
56
- createChain(t, e = !0) {
57
- const { rawCommands: r, editor: o, state: s } = this, { view: i } = o, c = [], a = !!t, l = t || s.tr, u = () => (!a && e && !l.getMeta("preventDispatch") && !this.hasCustomState && i.dispatch(l), c.every((f) => f === !0)), d = {
58
- ...Object.fromEntries(Object.entries(r).map(([f, p]) => [f, (...h) => {
59
- const g = this.buildProps(l, e), y = p(...h)(g);
60
- return c.push(y), d;
61
- }])),
62
- run: u
63
- };
64
- return d;
65
- }
66
- createCan(t) {
67
- const { rawCommands: e, state: r } = this, o = !1, s = t || r.tr, i = this.buildProps(s, o);
68
- return {
69
- ...Object.fromEntries(Object.entries(e).map(([a, l]) => [a, (...u) => l(...u)({ ...i, dispatch: void 0 })])),
70
- chain: () => this.createChain(s, o)
71
- };
72
- }
73
- buildProps(t, e = !0) {
74
- const { rawCommands: r, editor: o, state: s } = this, { view: i } = o, c = {
75
- tr: t,
76
- editor: o,
77
- view: i,
78
- state: Y({
79
- state: s,
80
- transaction: t
81
- }),
82
- dispatch: e ? () => {
83
- } : void 0,
84
- chain: () => this.createChain(t, e),
85
- can: () => this.createCan(t),
86
- get commands() {
87
- return Object.fromEntries(Object.entries(r).map(([a, l]) => [a, (...u) => l(...u)(c)]));
88
- }
89
- };
90
- return c;
91
- }
92
- }
93
- class ke {
94
- constructor() {
95
- this.callbacks = {};
96
- }
97
- on(t, e) {
98
- return this.callbacks[t] || (this.callbacks[t] = []), this.callbacks[t].push(e), this;
99
- }
100
- emit(t, ...e) {
101
- const r = this.callbacks[t];
102
- return r && r.forEach((o) => o.apply(this, e)), this;
103
- }
104
- off(t, e) {
105
- const r = this.callbacks[t];
106
- return r && (e ? this.callbacks[t] = r.filter((o) => o !== e) : delete this.callbacks[t]), this;
107
- }
108
- once(t, e) {
109
- const r = (...o) => {
110
- this.off(t, r), e.apply(this, o);
111
- };
112
- return this.on(t, r);
113
- }
114
- removeAllListeners() {
115
- this.callbacks = {};
116
- }
117
- }
118
- function k(n, t, e) {
119
- return n.config[t] === void 0 && n.parent ? k(n.parent, t, e) : typeof n.config[t] == "function" ? n.config[t].bind({
120
- ...e,
121
- parent: n.parent ? k(n.parent, t, e) : null
122
- }) : n.config[t];
123
- }
124
- function X(n) {
125
- const t = n.filter((o) => o.type === "extension"), e = n.filter((o) => o.type === "node"), r = n.filter((o) => o.type === "mark");
126
- return {
127
- baseExtensions: t,
128
- nodeExtensions: e,
129
- markExtensions: r
130
- };
131
- }
132
- function Tt(n) {
133
- const t = [], { nodeExtensions: e, markExtensions: r } = X(n), o = [...e, ...r], s = {
134
- default: null,
135
- rendered: !0,
136
- renderHTML: null,
137
- parseHTML: null,
138
- keepOnSplit: !0,
139
- isRequired: !1
140
- };
141
- return n.forEach((i) => {
142
- const c = {
143
- name: i.name,
144
- options: i.options,
145
- storage: i.storage,
146
- extensions: o
147
- }, a = k(i, "addGlobalAttributes", c);
148
- if (!a)
149
- return;
150
- a().forEach((u) => {
151
- u.types.forEach((d) => {
152
- Object.entries(u.attributes).forEach(([f, p]) => {
153
- t.push({
154
- type: d,
155
- name: f,
156
- attribute: {
157
- ...s,
158
- ...p
159
- }
160
- });
161
- });
162
- });
163
- });
164
- }), o.forEach((i) => {
165
- const c = {
166
- name: i.name,
167
- options: i.options,
168
- storage: i.storage
169
- }, a = k(i, "addAttributes", c);
170
- if (!a)
171
- return;
172
- const l = a();
173
- Object.entries(l).forEach(([u, d]) => {
174
- const f = {
175
- ...s,
176
- ...d
177
- };
178
- typeof (f == null ? void 0 : f.default) == "function" && (f.default = f.default()), f != null && f.isRequired && (f == null ? void 0 : f.default) === void 0 && delete f.default, t.push({
179
- type: i.name,
180
- name: u,
181
- attribute: f
182
- });
183
- });
184
- }), t;
185
- }
186
- function S(n, t) {
187
- if (typeof n == "string") {
188
- if (!t.nodes[n])
189
- throw Error(`There is no node type named '${n}'. Maybe you forgot to add the extension?`);
190
- return t.nodes[n];
191
- }
192
- return n;
193
- }
194
- function be(...n) {
195
- return n.filter((t) => !!t).reduce((t, e) => {
196
- const r = { ...t };
197
- return Object.entries(e).forEach(([o, s]) => {
198
- if (!r[o]) {
199
- r[o] = s;
200
- return;
201
- }
202
- if (o === "class") {
203
- const c = s ? String(s).split(" ") : [], a = r[o] ? r[o].split(" ") : [], l = c.filter((u) => !a.includes(u));
204
- r[o] = [...a, ...l].join(" ");
205
- } else if (o === "style") {
206
- const c = s ? s.split(";").map((u) => u.trim()).filter(Boolean) : [], a = r[o] ? r[o].split(";").map((u) => u.trim()).filter(Boolean) : [], l = /* @__PURE__ */ new Map();
207
- a.forEach((u) => {
208
- const [d, f] = u.split(":").map((p) => p.trim());
209
- l.set(d, f);
210
- }), c.forEach((u) => {
211
- const [d, f] = u.split(":").map((p) => p.trim());
212
- l.set(d, f);
213
- }), r[o] = Array.from(l.entries()).map(([u, d]) => `${u}: ${d}`).join("; ");
214
- } else
215
- r[o] = s;
216
- }), r;
217
- }, {});
218
- }
219
- function it(n, t) {
220
- return t.filter((e) => e.type === n.type.name).filter((e) => e.attribute.rendered).map((e) => e.attribute.renderHTML ? e.attribute.renderHTML(n.attrs) || {} : {
221
- [e.name]: n.attrs[e.name]
222
- }).reduce((e, r) => be(e, r), {});
223
- }
224
- function At(n) {
225
- return typeof n == "function";
226
- }
227
- function b(n, t = void 0, ...e) {
228
- return At(n) ? t ? n.bind(t)(...e) : n(...e) : n;
229
- }
230
- function ve(n = {}) {
231
- return Object.keys(n).length === 0 && n.constructor === Object;
232
- }
233
- function we(n) {
234
- return typeof n != "string" ? n : n.match(/^[+-]?(?:\d*\.)?\d+$/) ? Number(n) : n === "true" ? !0 : n === "false" ? !1 : n;
235
- }
236
- function yt(n, t) {
237
- return "style" in n ? n : {
238
- ...n,
239
- getAttrs: (e) => {
240
- const r = n.getAttrs ? n.getAttrs(e) : n.attrs;
241
- if (r === !1)
242
- return !1;
243
- const o = t.reduce((s, i) => {
244
- const c = i.attribute.parseHTML ? i.attribute.parseHTML(e) : we(e.getAttribute(i.name));
245
- return c == null ? s : {
246
- ...s,
247
- [i.name]: c
248
- };
249
- }, {});
250
- return { ...r, ...o };
251
- }
252
- };
253
- }
254
- function kt(n) {
255
- return Object.fromEntries(
256
- // @ts-ignore
257
- Object.entries(n).filter(([t, e]) => t === "attrs" && ve(e) ? !1 : e != null)
258
- );
259
- }
260
- function Me(n, t) {
261
- var e;
262
- const r = Tt(n), { nodeExtensions: o, markExtensions: s } = X(n), i = (e = o.find((l) => k(l, "topNode"))) === null || e === void 0 ? void 0 : e.name, c = Object.fromEntries(o.map((l) => {
263
- const u = r.filter((y) => y.type === l.name), d = {
264
- name: l.name,
265
- options: l.options,
266
- storage: l.storage,
267
- editor: t
268
- }, f = n.reduce((y, v) => {
269
- const w = k(v, "extendNodeSchema", d);
270
- return {
271
- ...y,
272
- ...w ? w(l) : {}
273
- };
274
- }, {}), p = kt({
275
- ...f,
276
- content: b(k(l, "content", d)),
277
- marks: b(k(l, "marks", d)),
278
- group: b(k(l, "group", d)),
279
- inline: b(k(l, "inline", d)),
280
- atom: b(k(l, "atom", d)),
281
- selectable: b(k(l, "selectable", d)),
282
- draggable: b(k(l, "draggable", d)),
283
- code: b(k(l, "code", d)),
284
- whitespace: b(k(l, "whitespace", d)),
285
- linebreakReplacement: b(k(l, "linebreakReplacement", d)),
286
- defining: b(k(l, "defining", d)),
287
- isolating: b(k(l, "isolating", d)),
288
- attrs: Object.fromEntries(u.map((y) => {
289
- var v;
290
- return [y.name, { default: (v = y == null ? void 0 : y.attribute) === null || v === void 0 ? void 0 : v.default }];
291
- }))
292
- }), m = b(k(l, "parseHTML", d));
293
- m && (p.parseDOM = m.map((y) => yt(y, u)));
294
- const h = k(l, "renderHTML", d);
295
- h && (p.toDOM = (y) => h({
296
- node: y,
297
- HTMLAttributes: it(y, u)
298
- }));
299
- const g = k(l, "renderText", d);
300
- return g && (p.toText = g), [l.name, p];
301
- })), a = Object.fromEntries(s.map((l) => {
302
- const u = r.filter((g) => g.type === l.name), d = {
303
- name: l.name,
304
- options: l.options,
305
- storage: l.storage,
306
- editor: t
307
- }, f = n.reduce((g, y) => {
308
- const v = k(y, "extendMarkSchema", d);
309
- return {
310
- ...g,
311
- ...v ? v(l) : {}
312
- };
313
- }, {}), p = kt({
314
- ...f,
315
- inclusive: b(k(l, "inclusive", d)),
316
- excludes: b(k(l, "excludes", d)),
317
- group: b(k(l, "group", d)),
318
- spanning: b(k(l, "spanning", d)),
319
- code: b(k(l, "code", d)),
320
- attrs: Object.fromEntries(u.map((g) => {
321
- var y;
322
- return [g.name, { default: (y = g == null ? void 0 : g.attribute) === null || y === void 0 ? void 0 : y.default }];
323
- }))
324
- }), m = b(k(l, "parseHTML", d));
325
- m && (p.parseDOM = m.map((g) => yt(g, u)));
326
- const h = k(l, "renderHTML", d);
327
- return h && (p.toDOM = (g) => h({
328
- mark: g,
329
- HTMLAttributes: it(g, u)
330
- })), [l.name, p];
331
- }));
332
- return new xt({
333
- topNode: i,
334
- nodes: c,
335
- marks: a
336
- });
337
- }
338
- function rt(n, t) {
339
- return t.nodes[n] || t.marks[n] || null;
340
- }
341
- function bt(n, t) {
342
- return Array.isArray(t) ? t.some((e) => (typeof e == "string" ? e : e.name) === n.name) : t;
343
- }
344
- function ut(n, t) {
345
- const e = Wt.fromSchema(t).serializeFragment(n), o = document.implementation.createHTMLDocument().createElement("div");
346
- return o.appendChild(e), o.innerHTML;
347
- }
348
- const Se = (n, t = 500) => {
349
- let e = "";
350
- const r = n.parentOffset;
351
- return n.parent.nodesBetween(Math.max(0, r - t), r, (o, s, i, c) => {
352
- var a, l;
353
- const u = ((l = (a = o.type.spec).toText) === null || l === void 0 ? void 0 : l.call(a, {
354
- node: o,
355
- pos: s,
356
- parent: i,
357
- index: c
358
- })) || o.textContent || "%leaf%";
359
- e += o.isAtom && !o.isText ? u : u.slice(0, Math.max(0, r - s));
360
- }), e;
361
- };
362
- function ft(n) {
363
- return Object.prototype.toString.call(n) === "[object RegExp]";
364
- }
365
- class Z {
366
- constructor(t) {
367
- this.find = t.find, this.handler = t.handler;
368
- }
369
- }
370
- const Ee = (n, t) => {
371
- if (ft(t))
372
- return t.exec(n);
373
- const e = t(n);
374
- if (!e)
375
- return null;
376
- const r = [e.text];
377
- return r.index = e.index, r.input = n, r.data = e.data, e.replaceWith && (e.text.includes(e.replaceWith) || console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'), r.push(e.replaceWith)), r;
378
- };
379
- function z(n) {
380
- var t;
381
- const { editor: e, from: r, to: o, text: s, rules: i, plugin: c } = n, { view: a } = e;
382
- if (a.composing)
383
- return !1;
384
- const l = a.state.doc.resolve(r);
385
- if (
386
- // check for code node
387
- l.parent.type.spec.code || !((t = l.nodeBefore || l.nodeAfter) === null || t === void 0) && t.marks.find((f) => f.type.spec.code)
388
- )
389
- return !1;
390
- let u = !1;
391
- const d = Se(l) + s;
392
- return i.forEach((f) => {
393
- if (u)
394
- return;
395
- const p = Ee(d, f.find);
396
- if (!p)
397
- return;
398
- const m = a.state.tr, h = Y({
399
- state: a.state,
400
- transaction: m
401
- }), g = {
402
- from: r - (p[0].length - s.length),
403
- to: o
404
- }, { commands: y, chain: v, can: w } = new Q({
405
- editor: e,
406
- state: h
407
- });
408
- f.handler({
409
- state: h,
410
- range: g,
411
- match: p,
412
- commands: y,
413
- chain: v,
414
- can: w
415
- }) === null || !m.steps.length || (m.setMeta(c, {
416
- transform: m,
417
- from: r,
418
- to: o,
419
- text: s
420
- }), a.dispatch(m), u = !0);
421
- }), u;
422
- }
423
- function xe(n) {
424
- const { editor: t, rules: e } = n, r = new I({
425
- state: {
426
- init() {
427
- return null;
428
- },
429
- apply(o, s, i) {
430
- const c = o.getMeta(r);
431
- if (c)
432
- return c;
433
- const a = o.getMeta("applyInputRules");
434
- return !!a && setTimeout(() => {
435
- let { text: u } = a;
436
- typeof u == "string" ? u = u : u = ut($.from(u), i.schema);
437
- const { from: d } = a, f = d + u.length;
438
- z({
439
- editor: t,
440
- from: d,
441
- to: f,
442
- text: u,
443
- rules: e,
444
- plugin: r
445
- });
446
- }), o.selectionSet || o.docChanged ? null : s;
447
- }
448
- },
449
- props: {
450
- handleTextInput(o, s, i, c) {
451
- return z({
452
- editor: t,
453
- from: s,
454
- to: i,
455
- text: c,
456
- rules: e,
457
- plugin: r
458
- });
459
- },
460
- handleDOMEvents: {
461
- compositionend: (o) => (setTimeout(() => {
462
- const { $cursor: s } = o.state.selection;
463
- s && z({
464
- editor: t,
465
- from: s.pos,
466
- to: s.pos,
467
- text: "",
468
- rules: e,
469
- plugin: r
470
- });
471
- }), !1)
472
- },
473
- // add support for input rules to trigger on enter
474
- // this is useful for example for code blocks
475
- handleKeyDown(o, s) {
476
- if (s.key !== "Enter")
477
- return !1;
478
- const { $cursor: i } = o.state.selection;
479
- return i ? z({
480
- editor: t,
481
- from: i.pos,
482
- to: i.pos,
483
- text: `
484
- `,
485
- rules: e,
486
- plugin: r
487
- }) : !1;
488
- }
489
- },
490
- // @ts-ignore
491
- isInputRules: !0
492
- });
493
- return r;
494
- }
495
- function Ce(n) {
496
- return Object.prototype.toString.call(n).slice(8, -1);
497
- }
498
- function H(n) {
499
- return Ce(n) !== "Object" ? !1 : n.constructor === Object && Object.getPrototypeOf(n) === Object.prototype;
500
- }
501
- function tt(n, t) {
502
- const e = { ...n };
503
- return H(n) && H(t) && Object.keys(t).forEach((r) => {
504
- H(t[r]) && H(n[r]) ? e[r] = tt(n[r], t[r]) : e[r] = t[r];
505
- }), e;
506
- }
507
- class U {
508
- constructor(t = {}) {
509
- this.type = "mark", this.name = "mark", this.parent = null, this.child = null, this.config = {
510
- name: this.name,
511
- defaultOptions: {}
512
- }, this.config = {
513
- ...this.config,
514
- ...t
515
- }, this.name = this.config.name, t.defaultOptions && Object.keys(t.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`), this.options = this.config.defaultOptions, this.config.addOptions && (this.options = b(k(this, "addOptions", {
516
- name: this.name
517
- }))), this.storage = b(k(this, "addStorage", {
518
- name: this.name,
519
- options: this.options
520
- })) || {};
521
- }
522
- static create(t = {}) {
523
- return new U(t);
524
- }
525
- configure(t = {}) {
526
- const e = this.extend({
527
- ...this.config,
528
- addOptions: () => tt(this.options, t)
529
- });
530
- return e.name = this.name, e.parent = this.parent, e;
531
- }
532
- extend(t = {}) {
533
- const e = new U(t);
534
- return e.parent = this, this.child = e, e.name = t.name ? t.name : e.parent.name, t.defaultOptions && Object.keys(t.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${e.name}".`), e.options = b(k(e, "addOptions", {
535
- name: e.name
536
- })), e.storage = b(k(e, "addStorage", {
537
- name: e.name,
538
- options: e.options
539
- })), e;
540
- }
541
- static handleExit({ editor: t, mark: e }) {
542
- const { tr: r } = t.state, o = t.state.selection.$from;
543
- if (o.pos === o.end()) {
544
- const i = o.marks();
545
- if (!!!i.find((l) => (l == null ? void 0 : l.type.name) === e.name))
546
- return !1;
547
- const a = i.find((l) => (l == null ? void 0 : l.type.name) === e.name);
548
- return a && r.removeStoredMark(a), r.insertText(" ", o.pos), t.view.dispatch(r), !0;
549
- }
550
- return !1;
551
- }
552
- }
553
- function Te(n) {
554
- return typeof n == "number";
555
- }
556
- class Ae {
557
- constructor(t) {
558
- this.find = t.find, this.handler = t.handler;
559
- }
560
- }
561
- const Pe = (n, t, e) => {
562
- if (ft(t))
563
- return [...n.matchAll(t)];
564
- const r = t(n, e);
565
- return r ? r.map((o) => {
566
- const s = [o.text];
567
- return s.index = o.index, s.input = n, s.data = o.data, o.replaceWith && (o.text.includes(o.replaceWith) || console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'), s.push(o.replaceWith)), s;
568
- }) : [];
569
- };
570
- function Oe(n) {
571
- const { editor: t, state: e, from: r, to: o, rule: s, pasteEvent: i, dropEvent: c } = n, { commands: a, chain: l, can: u } = new Q({
572
- editor: t,
573
- state: e
574
- }), d = [];
575
- return e.doc.nodesBetween(r, o, (p, m) => {
576
- if (!p.isTextblock || p.type.spec.code)
577
- return;
578
- const h = Math.max(r, m), g = Math.min(o, m + p.content.size), y = p.textBetween(h - m, g - m, void 0, "");
579
- Pe(y, s.find, i).forEach((w) => {
580
- if (w.index === void 0)
581
- return;
582
- const E = h + w.index + 1, M = E + w[0].length, x = {
583
- from: e.tr.mapping.map(E),
584
- to: e.tr.mapping.map(M)
585
- }, T = s.handler({
586
- state: e,
587
- range: x,
588
- match: w,
589
- commands: a,
590
- chain: l,
591
- can: u,
592
- pasteEvent: i,
593
- dropEvent: c
594
- });
595
- d.push(T);
596
- });
597
- }), d.every((p) => p !== null);
598
- }
599
- let _ = null;
600
- const Ie = (n) => {
601
- var t;
602
- const e = new ClipboardEvent("paste", {
603
- clipboardData: new DataTransfer()
604
- });
605
- return (t = e.clipboardData) === null || t === void 0 || t.setData("text/html", n), e;
606
- };
607
- function $e(n) {
608
- const { editor: t, rules: e } = n;
609
- let r = null, o = !1, s = !1, i = typeof ClipboardEvent < "u" ? new ClipboardEvent("paste") : null, c;
610
- try {
611
- c = typeof DragEvent < "u" ? new DragEvent("drop") : null;
612
- } catch {
613
- c = null;
614
- }
615
- const a = ({ state: u, from: d, to: f, rule: p, pasteEvt: m }) => {
616
- const h = u.tr, g = Y({
617
- state: u,
618
- transaction: h
619
- });
620
- if (!(!Oe({
621
- editor: t,
622
- state: g,
623
- from: Math.max(d - 1, 0),
624
- to: f.b - 1,
625
- rule: p,
626
- pasteEvent: m,
627
- dropEvent: c
628
- }) || !h.steps.length)) {
629
- try {
630
- c = typeof DragEvent < "u" ? new DragEvent("drop") : null;
631
- } catch {
632
- c = null;
633
- }
634
- return i = typeof ClipboardEvent < "u" ? new ClipboardEvent("paste") : null, h;
635
- }
636
- };
637
- return e.map((u) => new I({
638
- // we register a global drag handler to track the current drag source element
639
- view(d) {
640
- const f = (m) => {
641
- var h;
642
- r = !((h = d.dom.parentElement) === null || h === void 0) && h.contains(m.target) ? d.dom.parentElement : null, r && (_ = t);
643
- }, p = () => {
644
- _ && (_ = null);
645
- };
646
- return window.addEventListener("dragstart", f), window.addEventListener("dragend", p), {
647
- destroy() {
648
- window.removeEventListener("dragstart", f), window.removeEventListener("dragend", p);
649
- }
650
- };
651
- },
652
- props: {
653
- handleDOMEvents: {
654
- drop: (d, f) => {
655
- if (s = r === d.dom.parentElement, c = f, !s) {
656
- const p = _;
657
- p != null && p.isEditable && setTimeout(() => {
658
- const m = p.state.selection;
659
- m && p.commands.deleteRange({ from: m.from, to: m.to });
660
- }, 10);
661
- }
662
- return !1;
663
- },
664
- paste: (d, f) => {
665
- var p;
666
- const m = (p = f.clipboardData) === null || p === void 0 ? void 0 : p.getData("text/html");
667
- return i = f, o = !!(m != null && m.includes("data-pm-slice")), !1;
668
- }
669
- }
670
- },
671
- appendTransaction: (d, f, p) => {
672
- const m = d[0], h = m.getMeta("uiEvent") === "paste" && !o, g = m.getMeta("uiEvent") === "drop" && !s, y = m.getMeta("applyPasteRules"), v = !!y;
673
- if (!h && !g && !v)
674
- return;
675
- if (v) {
676
- let { text: M } = y;
677
- typeof M == "string" ? M = M : M = ut($.from(M), p.schema);
678
- const { from: x } = y, T = x + M.length, A = Ie(M);
679
- return a({
680
- rule: u,
681
- state: p,
682
- from: x,
683
- to: { b: T },
684
- pasteEvt: A
685
- });
686
- }
687
- const w = f.doc.content.findDiffStart(p.doc.content), E = f.doc.content.findDiffEnd(p.doc.content);
688
- if (!(!Te(w) || !E || w === E.b))
689
- return a({
690
- rule: u,
691
- state: p,
692
- from: w,
693
- to: E,
694
- pasteEvt: i
695
- });
696
- }
697
- }));
698
- }
699
- function Be(n) {
700
- const t = n.filter((e, r) => n.indexOf(e) !== r);
701
- return Array.from(new Set(t));
702
- }
703
- class R {
704
- constructor(t, e) {
705
- this.splittableMarks = [], this.editor = e, this.extensions = R.resolve(t), this.schema = Me(this.extensions, e), this.setupExtensions();
706
- }
707
- /**
708
- * Returns a flattened and sorted extension list while
709
- * also checking for duplicated extensions and warns the user.
710
- * @param extensions An array of Tiptap extensions
711
- * @returns An flattened and sorted array of Tiptap extensions
712
- */
713
- static resolve(t) {
714
- const e = R.sort(R.flatten(t)), r = Be(e.map((o) => o.name));
715
- return r.length && console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map((o) => `'${o}'`).join(", ")}]. This can lead to issues.`), e;
716
- }
717
- /**
718
- * Create a flattened array of extensions by traversing the `addExtensions` field.
719
- * @param extensions An array of Tiptap extensions
720
- * @returns A flattened array of Tiptap extensions
721
- */
722
- static flatten(t) {
723
- return t.map((e) => {
724
- const r = {
725
- name: e.name,
726
- options: e.options,
727
- storage: e.storage
728
- }, o = k(e, "addExtensions", r);
729
- return o ? [e, ...this.flatten(o())] : e;
730
- }).flat(10);
731
- }
732
- /**
733
- * Sort extensions by priority.
734
- * @param extensions An array of Tiptap extensions
735
- * @returns A sorted array of Tiptap extensions by priority
736
- */
737
- static sort(t) {
738
- return t.sort((r, o) => {
739
- const s = k(r, "priority") || 100, i = k(o, "priority") || 100;
740
- return s > i ? -1 : s < i ? 1 : 0;
741
- });
742
- }
743
- /**
744
- * Get all commands from the extensions.
745
- * @returns An object with all commands where the key is the command name and the value is the command function
746
- */
747
- get commands() {
748
- return this.extensions.reduce((t, e) => {
749
- const r = {
750
- name: e.name,
751
- options: e.options,
752
- storage: e.storage,
753
- editor: this.editor,
754
- type: rt(e.name, this.schema)
755
- }, o = k(e, "addCommands", r);
756
- return o ? {
757
- ...t,
758
- ...o()
759
- } : t;
760
- }, {});
761
- }
762
- /**
763
- * Get all registered Prosemirror plugins from the extensions.
764
- * @returns An array of Prosemirror plugins
765
- */
766
- get plugins() {
767
- const { editor: t } = this, e = R.sort([...this.extensions].reverse()), r = [], o = [], s = e.map((i) => {
768
- const c = {
769
- name: i.name,
770
- options: i.options,
771
- storage: i.storage,
772
- editor: t,
773
- type: rt(i.name, this.schema)
774
- }, a = [], l = k(i, "addKeyboardShortcuts", c);
775
- let u = {};
776
- if (i.type === "mark" && k(i, "exitable", c) && (u.ArrowRight = () => U.handleExit({ editor: t, mark: i })), l) {
777
- const h = Object.fromEntries(Object.entries(l()).map(([g, y]) => [g, () => y({ editor: t })]));
778
- u = { ...u, ...h };
779
- }
780
- const d = _t(u);
781
- a.push(d);
782
- const f = k(i, "addInputRules", c);
783
- bt(i, t.options.enableInputRules) && f && r.push(...f());
784
- const p = k(i, "addPasteRules", c);
785
- bt(i, t.options.enablePasteRules) && p && o.push(...p());
786
- const m = k(i, "addProseMirrorPlugins", c);
787
- if (m) {
788
- const h = m();
789
- a.push(...h);
790
- }
791
- return a;
792
- }).flat();
793
- return [
794
- xe({
795
- editor: t,
796
- rules: r
797
- }),
798
- ...$e({
799
- editor: t,
800
- rules: o
801
- }),
802
- ...s
803
- ];
804
- }
805
- /**
806
- * Get all attributes from the extensions.
807
- * @returns An array of attributes
808
- */
809
- get attributes() {
810
- return Tt(this.extensions);
811
- }
812
- /**
813
- * Get all node views from the extensions.
814
- * @returns An object with all node views where the key is the node name and the value is the node view function
815
- */
816
- get nodeViews() {
817
- const { editor: t } = this, { nodeExtensions: e } = X(this.extensions);
818
- return Object.fromEntries(e.filter((r) => !!k(r, "addNodeView")).map((r) => {
819
- const o = this.attributes.filter((a) => a.type === r.name), s = {
820
- name: r.name,
821
- options: r.options,
822
- storage: r.storage,
823
- editor: t,
824
- type: S(r.name, this.schema)
825
- }, i = k(r, "addNodeView", s);
826
- if (!i)
827
- return [];
828
- const c = (a, l, u, d, f) => {
829
- const p = it(a, o);
830
- return i()({
831
- // pass-through
832
- node: a,
833
- view: l,
834
- getPos: u,
835
- decorations: d,
836
- innerDecorations: f,
837
- // tiptap-specific
838
- editor: t,
839
- extension: r,
840
- HTMLAttributes: p
841
- });
842
- };
843
- return [r.name, c];
844
- }));
845
- }
846
- /**
847
- * Go through all extensions, create extension storages & setup marks
848
- * & bind editor event listener.
849
- */
850
- setupExtensions() {
851
- this.extensions.forEach((t) => {
852
- var e;
853
- this.editor.extensionStorage[t.name] = t.storage;
854
- const r = {
855
- name: t.name,
856
- options: t.options,
857
- storage: t.storage,
858
- editor: this.editor,
859
- type: rt(t.name, this.schema)
860
- };
861
- t.type === "mark" && (!((e = b(k(t, "keepOnSplit", r))) !== null && e !== void 0) || e) && this.splittableMarks.push(t.name);
862
- const o = k(t, "onBeforeCreate", r), s = k(t, "onCreate", r), i = k(t, "onUpdate", r), c = k(t, "onSelectionUpdate", r), a = k(t, "onTransaction", r), l = k(t, "onFocus", r), u = k(t, "onBlur", r), d = k(t, "onDestroy", r);
863
- o && this.editor.on("beforeCreate", o), s && this.editor.on("create", s), i && this.editor.on("update", i), c && this.editor.on("selectionUpdate", c), a && this.editor.on("transaction", a), l && this.editor.on("focus", l), u && this.editor.on("blur", u), d && this.editor.on("destroy", d);
864
- });
865
- }
866
- }
867
- class C {
868
- constructor(t = {}) {
869
- this.type = "extension", this.name = "extension", this.parent = null, this.child = null, this.config = {
870
- name: this.name,
871
- defaultOptions: {}
872
- }, this.config = {
873
- ...this.config,
874
- ...t
875
- }, this.name = this.config.name, t.defaultOptions && Object.keys(t.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`), this.options = this.config.defaultOptions, this.config.addOptions && (this.options = b(k(this, "addOptions", {
876
- name: this.name
877
- }))), this.storage = b(k(this, "addStorage", {
878
- name: this.name,
879
- options: this.options
880
- })) || {};
881
- }
882
- static create(t = {}) {
883
- return new C(t);
884
- }
885
- configure(t = {}) {
886
- const e = this.extend({
887
- ...this.config,
888
- addOptions: () => tt(this.options, t)
889
- });
890
- return e.name = this.name, e.parent = this.parent, e;
891
- }
892
- extend(t = {}) {
893
- const e = new C({ ...this.config, ...t });
894
- return e.parent = this, this.child = e, e.name = t.name ? t.name : e.parent.name, t.defaultOptions && Object.keys(t.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${e.name}".`), e.options = b(k(e, "addOptions", {
895
- name: e.name
896
- })), e.storage = b(k(e, "addStorage", {
897
- name: e.name,
898
- options: e.options
899
- })), e;
900
- }
901
- }
902
- function Pt(n, t, e) {
903
- const { from: r, to: o } = t, { blockSeparator: s = `
904
-
905
- `, textSerializers: i = {} } = e || {};
906
- let c = "";
907
- return n.nodesBetween(r, o, (a, l, u, d) => {
908
- var f;
909
- a.isBlock && l > r && (c += s);
910
- const p = i == null ? void 0 : i[a.type.name];
911
- if (p)
912
- return u && (c += p({
913
- node: a,
914
- pos: l,
915
- parent: u,
916
- index: d,
917
- range: t
918
- })), !1;
919
- a.isText && (c += (f = a == null ? void 0 : a.text) === null || f === void 0 ? void 0 : f.slice(Math.max(r, l) - l, o - l));
920
- }), c;
921
- }
922
- function Ot(n) {
923
- return Object.fromEntries(Object.entries(n.nodes).filter(([, t]) => t.spec.toText).map(([t, e]) => [t, e.spec.toText]));
924
- }
925
- const Ne = C.create({
926
- name: "clipboardTextSerializer",
927
- addOptions() {
928
- return {
929
- blockSeparator: void 0
930
- };
931
- },
932
- addProseMirrorPlugins() {
933
- return [
934
- new I({
935
- key: new j("clipboardTextSerializer"),
936
- props: {
937
- clipboardTextSerializer: () => {
938
- const { editor: n } = this, { state: t, schema: e } = n, { doc: r, selection: o } = t, { ranges: s } = o, i = Math.min(...s.map((u) => u.$from.pos)), c = Math.max(...s.map((u) => u.$to.pos)), a = Ot(e);
939
- return Pt(r, { from: i, to: c }, {
940
- ...this.options.blockSeparator !== void 0 ? { blockSeparator: this.options.blockSeparator } : {},
941
- textSerializers: a
942
- });
943
- }
944
- }
945
- })
946
- ];
947
- }
948
- }), je = () => ({ editor: n, view: t }) => (requestAnimationFrame(() => {
949
- var e;
950
- n.isDestroyed || (t.dom.blur(), (e = window == null ? void 0 : window.getSelection()) === null || e === void 0 || e.removeAllRanges());
951
- }), !0), Re = (n = !1) => ({ commands: t }) => t.setContent("", n), Fe = () => ({ state: n, tr: t, dispatch: e }) => {
952
- const { selection: r } = t, { ranges: o } = r;
953
- return e && o.forEach(({ $from: s, $to: i }) => {
954
- n.doc.nodesBetween(s.pos, i.pos, (c, a) => {
955
- if (c.type.isText)
956
- return;
957
- const { doc: l, mapping: u } = t, d = l.resolve(u.map(a)), f = l.resolve(u.map(a + c.nodeSize)), p = d.blockRange(f);
958
- if (!p)
959
- return;
960
- const m = Gt(p);
961
- if (c.type.isTextblock) {
962
- const { defaultType: h } = d.parent.contentMatchAt(d.index());
963
- t.setNodeMarkup(p.start, h);
964
- }
965
- (m || m === 0) && t.lift(p, m);
966
- });
967
- }), !0;
968
- }, De = (n) => (t) => n(t), Le = () => ({ state: n, dispatch: t }) => he(n, t), ze = (n, t) => ({ editor: e, tr: r }) => {
969
- const { state: o } = e, s = o.doc.slice(n.from, n.to);
970
- r.deleteRange(n.from, n.to);
971
- const i = r.mapping.map(t);
972
- return r.insert(i, s.content), r.setSelection(new P(r.doc.resolve(Math.max(i - 1, 0)))), !0;
973
- }, He = () => ({ tr: n, dispatch: t }) => {
974
- const { selection: e } = n, r = e.$anchor.node();
975
- if (r.content.size > 0)
976
- return !1;
977
- const o = n.selection.$anchor;
978
- for (let s = o.depth; s > 0; s -= 1)
979
- if (o.node(s).type === r.type) {
980
- if (t) {
981
- const c = o.before(s), a = o.after(s);
982
- n.delete(c, a).scrollIntoView();
983
- }
984
- return !0;
985
- }
986
- return !1;
987
- }, _e = (n) => ({ tr: t, state: e, dispatch: r }) => {
988
- const o = S(n, e.schema), s = t.selection.$anchor;
989
- for (let i = s.depth; i > 0; i -= 1)
990
- if (s.node(i).type === o) {
991
- if (r) {
992
- const a = s.before(i), l = s.after(i);
993
- t.delete(a, l).scrollIntoView();
994
- }
995
- return !0;
996
- }
997
- return !1;
998
- }, We = (n) => ({ tr: t, dispatch: e }) => {
999
- const { from: r, to: o } = n;
1000
- return e && t.delete(r, o), !0;
1001
- }, Ve = () => ({ state: n, dispatch: t }) => pe(n, t), Ke = () => ({ commands: n }) => n.keyboardShortcut("Enter"), Ue = () => ({ state: n, dispatch: t }) => fe(n, t);
1002
- function q(n, t, e = { strict: !0 }) {
1003
- const r = Object.keys(t);
1004
- return r.length ? r.every((o) => e.strict ? t[o] === n[o] : ft(t[o]) ? t[o].test(n[o]) : t[o] === n[o]) : !0;
1005
- }
1006
- function It(n, t, e = {}) {
1007
- return n.find((r) => r.type === t && q(
1008
- // Only check equality for the attributes that are provided
1009
- Object.fromEntries(Object.keys(e).map((o) => [o, r.attrs[o]])),
1010
- e
1011
- ));
1012
- }
1013
- function vt(n, t, e = {}) {
1014
- return !!It(n, t, e);
1015
- }
1016
- function pt(n, t, e) {
1017
- var r;
1018
- if (!n || !t)
1019
- return;
1020
- let o = n.parent.childAfter(n.parentOffset);
1021
- if ((!o.node || !o.node.marks.some((u) => u.type === t)) && (o = n.parent.childBefore(n.parentOffset)), !o.node || !o.node.marks.some((u) => u.type === t) || (e = e || ((r = o.node.marks[0]) === null || r === void 0 ? void 0 : r.attrs), !It([...o.node.marks], t, e)))
1022
- return;
1023
- let i = o.index, c = n.start() + o.offset, a = i + 1, l = c + o.node.nodeSize;
1024
- for (; i > 0 && vt([...n.parent.child(i - 1).marks], t, e); )
1025
- i -= 1, c -= n.parent.child(i).nodeSize;
1026
- for (; a < n.parent.childCount && vt([...n.parent.child(a).marks], t, e); )
1027
- l += n.parent.child(a).nodeSize, a += 1;
1028
- return {
1029
- from: c,
1030
- to: l
1031
- };
1032
- }
1033
- function B(n, t) {
1034
- if (typeof n == "string") {
1035
- if (!t.marks[n])
1036
- throw Error(`There is no mark type named '${n}'. Maybe you forgot to add the extension?`);
1037
- return t.marks[n];
1038
- }
1039
- return n;
1040
- }
1041
- const qe = (n, t = {}) => ({ tr: e, state: r, dispatch: o }) => {
1042
- const s = B(n, r.schema), { doc: i, selection: c } = e, { $from: a, from: l, to: u } = c;
1043
- if (o) {
1044
- const d = pt(a, s, t);
1045
- if (d && d.from <= l && d.to >= u) {
1046
- const f = P.create(i, d.from, d.to);
1047
- e.setSelection(f);
1048
- }
1049
- }
1050
- return !0;
1051
- }, Ge = (n) => (t) => {
1052
- const e = typeof n == "function" ? n(t) : n;
1053
- for (let r = 0; r < e.length; r += 1)
1054
- if (e[r](t))
1055
- return !0;
1056
- return !1;
1057
- };
1058
- function $t(n) {
1059
- return n instanceof P;
1060
- }
1061
- function O(n = 0, t = 0, e = 0) {
1062
- return Math.min(Math.max(n, t), e);
1063
- }
1064
- function Bt(n, t = null) {
1065
- if (!t)
1066
- return null;
1067
- const e = F.atStart(n), r = F.atEnd(n);
1068
- if (t === "start" || t === !0)
1069
- return e;
1070
- if (t === "end")
1071
- return r;
1072
- const o = e.from, s = r.to;
1073
- return t === "all" ? P.create(n, O(0, o, s), O(n.content.size, o, s)) : P.create(n, O(t, o, s), O(t, o, s));
1074
- }
1075
- function wt() {
1076
- return navigator.platform === "Android" || /android/i.test(navigator.userAgent);
1077
- }
1078
- function G() {
1079
- return [
1080
- "iPad Simulator",
1081
- "iPhone Simulator",
1082
- "iPod Simulator",
1083
- "iPad",
1084
- "iPhone",
1085
- "iPod"
1086
- ].includes(navigator.platform) || navigator.userAgent.includes("Mac") && "ontouchend" in document;
1087
- }
1088
- function Je() {
1089
- return typeof navigator < "u" ? /^((?!chrome|android).)*safari/i.test(navigator.userAgent) : !1;
1090
- }
1091
- const Ye = (n = null, t = {}) => ({ editor: e, view: r, tr: o, dispatch: s }) => {
1092
- t = {
1093
- scrollIntoView: !0,
1094
- ...t
1095
- };
1096
- const i = () => {
1097
- (G() || wt()) && r.dom.focus(), requestAnimationFrame(() => {
1098
- e.isDestroyed || (r.focus(), Je() && !G() && !wt() && r.dom.focus({ preventScroll: !0 }));
1099
- });
1100
- };
1101
- if (r.hasFocus() && n === null || n === !1)
1102
- return !0;
1103
- if (s && n === null && !$t(e.state.selection))
1104
- return i(), !0;
1105
- const c = Bt(o.doc, n) || e.state.selection, a = e.state.selection.eq(c);
1106
- return s && (a || o.setSelection(c), a && o.storedMarks && o.setStoredMarks(o.storedMarks), i()), !0;
1107
- }, Qe = (n, t) => (e) => n.every((r, o) => t(r, { ...e, index: o })), Xe = (n, t) => ({ tr: e, commands: r }) => r.insertContentAt({ from: e.selection.from, to: e.selection.to }, n, t), Nt = (n) => {
1108
- const t = n.childNodes;
1109
- for (let e = t.length - 1; e >= 0; e -= 1) {
1110
- const r = t[e];
1111
- r.nodeType === 3 && r.nodeValue && /^(\n\s\s|\n)$/.test(r.nodeValue) ? n.removeChild(r) : r.nodeType === 1 && Nt(r);
1112
- }
1113
- return n;
1114
- };
1115
- function W(n) {
1116
- const t = `<body>${n}</body>`, e = new window.DOMParser().parseFromString(t, "text/html").body;
1117
- return Nt(e);
1118
- }
1119
- function D(n, t, e) {
1120
- if (n instanceof Vt || n instanceof $)
1121
- return n;
1122
- e = {
1123
- slice: !0,
1124
- parseOptions: {},
1125
- ...e
1126
- };
1127
- const r = typeof n == "object" && n !== null, o = typeof n == "string";
1128
- if (r)
1129
- try {
1130
- if (Array.isArray(n) && n.length > 0)
1131
- return $.fromArray(n.map((c) => t.nodeFromJSON(c)));
1132
- const i = t.nodeFromJSON(n);
1133
- return e.errorOnInvalidContent && i.check(), i;
1134
- } catch (s) {
1135
- if (e.errorOnInvalidContent)
1136
- throw new Error("[tiptap error]: Invalid JSON content", { cause: s });
1137
- return console.warn("[tiptap warn]: Invalid content.", "Passed value:", n, "Error:", s), D("", t, e);
1138
- }
1139
- if (o) {
1140
- if (e.errorOnInvalidContent) {
1141
- let i = !1, c = "";
1142
- const a = new xt({
1143
- topNode: t.spec.topNode,
1144
- marks: t.spec.marks,
1145
- // Prosemirror's schemas are executed such that: the last to execute, matches last
1146
- // 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
1147
- nodes: t.spec.nodes.append({
1148
- __tiptap__private__unknown__catch__all__node: {
1149
- content: "inline*",
1150
- group: "block",
1151
- parseDOM: [
1152
- {
1153
- tag: "*",
1154
- getAttrs: (l) => (i = !0, c = typeof l == "string" ? l : l.outerHTML, null)
1155
- }
1156
- ]
1157
- }
1158
- })
1159
- });
1160
- if (e.slice ? nt.fromSchema(a).parseSlice(W(n), e.parseOptions) : nt.fromSchema(a).parse(W(n), e.parseOptions), e.errorOnInvalidContent && i)
1161
- throw new Error("[tiptap error]: Invalid HTML content", { cause: new Error(`Invalid element found: ${c}`) });
1162
- }
1163
- const s = nt.fromSchema(t);
1164
- return e.slice ? s.parseSlice(W(n), e.parseOptions).content : s.parse(W(n), e.parseOptions);
1165
- }
1166
- return D("", t, e);
1167
- }
1168
- function Ze(n, t, e) {
1169
- const r = n.steps.length - 1;
1170
- if (r < t)
1171
- return;
1172
- const o = n.steps[r];
1173
- if (!(o instanceof Jt || o instanceof Yt))
1174
- return;
1175
- const s = n.mapping.maps[r];
1176
- let i = 0;
1177
- s.forEach((c, a, l, u) => {
1178
- i === 0 && (i = u);
1179
- }), n.setSelection(F.near(n.doc.resolve(i), e));
1180
- }
1181
- const tn = (n) => !("type" in n), en = (n, t, e) => ({ tr: r, dispatch: o, editor: s }) => {
1182
- var i;
1183
- if (o) {
1184
- e = {
1185
- parseOptions: s.options.parseOptions,
1186
- updateSelection: !0,
1187
- applyInputRules: !1,
1188
- applyPasteRules: !1,
1189
- ...e
1190
- };
1191
- let c;
1192
- const a = (g) => {
1193
- s.emit("contentError", {
1194
- editor: s,
1195
- error: g,
1196
- disableCollaboration: () => {
1197
- s.storage.collaboration && (s.storage.collaboration.isDisabled = !0);
1198
- }
1199
- });
1200
- }, l = {
1201
- preserveWhitespace: "full",
1202
- ...e.parseOptions
1203
- };
1204
- if (!e.errorOnInvalidContent && !s.options.enableContentCheck && s.options.emitContentError)
1205
- try {
1206
- D(t, s.schema, {
1207
- parseOptions: l,
1208
- errorOnInvalidContent: !0
1209
- });
1210
- } catch (g) {
1211
- a(g);
1212
- }
1213
- try {
1214
- c = D(t, s.schema, {
1215
- parseOptions: l,
1216
- errorOnInvalidContent: (i = e.errorOnInvalidContent) !== null && i !== void 0 ? i : s.options.enableContentCheck
1217
- });
1218
- } catch (g) {
1219
- return a(g), !1;
1220
- }
1221
- let { from: u, to: d } = typeof n == "number" ? { from: n, to: n } : { from: n.from, to: n.to }, f = !0, p = !0;
1222
- if ((tn(c) ? c : [c]).forEach((g) => {
1223
- g.check(), f = f ? g.isText && g.marks.length === 0 : !1, p = p ? g.isBlock : !1;
1224
- }), u === d && p) {
1225
- const { parent: g } = r.doc.resolve(u);
1226
- g.isTextblock && !g.type.spec.code && !g.childCount && (u -= 1, d += 1);
1227
- }
1228
- let h;
1229
- if (f) {
1230
- if (Array.isArray(t))
1231
- h = t.map((g) => g.text || "").join("");
1232
- else if (t instanceof $) {
1233
- let g = "";
1234
- t.forEach((y) => {
1235
- y.text && (g += y.text);
1236
- }), h = g;
1237
- } else typeof t == "object" && t && t.text ? h = t.text : h = t;
1238
- r.insertText(h, u, d);
1239
- } else
1240
- h = c, r.replaceWith(u, d, h);
1241
- e.updateSelection && Ze(r, r.steps.length - 1, -1), e.applyInputRules && r.setMeta("applyInputRules", { from: u, text: h }), e.applyPasteRules && r.setMeta("applyPasteRules", { from: u, text: h });
1242
- }
1243
- return !0;
1244
- }, nn = () => ({ state: n, dispatch: t }) => ie(n, t), rn = () => ({ state: n, dispatch: t }) => de(n, t), on = () => ({ state: n, dispatch: t }) => ue(n, t), sn = () => ({ state: n, dispatch: t }) => le(n, t), an = () => ({ state: n, dispatch: t, tr: e }) => {
1245
- try {
1246
- const r = Ct(n.doc, n.selection.$from.pos, -1);
1247
- return r == null ? !1 : (e.join(r, 2), t && t(e), !0);
1248
- } catch {
1249
- return !1;
1250
- }
1251
- }, cn = () => ({ state: n, dispatch: t, tr: e }) => {
1252
- try {
1253
- const r = Ct(n.doc, n.selection.$from.pos, 1);
1254
- return r == null ? !1 : (e.join(r, 2), t && t(e), !0);
1255
- } catch {
1256
- return !1;
1257
- }
1258
- }, ln = () => ({ state: n, dispatch: t }) => ce(n, t), dn = () => ({ state: n, dispatch: t }) => ae(n, t);
1259
- function jt() {
1260
- return typeof navigator < "u" ? /Mac/.test(navigator.platform) : !1;
1261
- }
1262
- function un(n) {
1263
- const t = n.split(/-(?!$)/);
1264
- let e = t[t.length - 1];
1265
- e === "Space" && (e = " ");
1266
- let r, o, s, i;
1267
- for (let c = 0; c < t.length - 1; c += 1) {
1268
- const a = t[c];
1269
- if (/^(cmd|meta|m)$/i.test(a))
1270
- i = !0;
1271
- else if (/^a(lt)?$/i.test(a))
1272
- r = !0;
1273
- else if (/^(c|ctrl|control)$/i.test(a))
1274
- o = !0;
1275
- else if (/^s(hift)?$/i.test(a))
1276
- s = !0;
1277
- else if (/^mod$/i.test(a))
1278
- G() || jt() ? i = !0 : o = !0;
1279
- else
1280
- throw new Error(`Unrecognized modifier name: ${a}`);
1281
- }
1282
- return r && (e = `Alt-${e}`), o && (e = `Ctrl-${e}`), i && (e = `Meta-${e}`), s && (e = `Shift-${e}`), e;
1283
- }
1284
- const fn = (n) => ({ editor: t, view: e, tr: r, dispatch: o }) => {
1285
- const s = un(n).split(/-(?!$)/), i = s.find((l) => !["Alt", "Ctrl", "Meta", "Shift"].includes(l)), c = new KeyboardEvent("keydown", {
1286
- key: i === "Space" ? " " : i,
1287
- altKey: s.includes("Alt"),
1288
- ctrlKey: s.includes("Ctrl"),
1289
- metaKey: s.includes("Meta"),
1290
- shiftKey: s.includes("Shift"),
1291
- bubbles: !0,
1292
- cancelable: !0
1293
- }), a = t.captureTransaction(() => {
1294
- e.someProp("handleKeyDown", (l) => l(e, c));
1295
- });
1296
- return a == null || a.steps.forEach((l) => {
1297
- const u = l.map(r.mapping);
1298
- u && o && r.maybeStep(u);
1299
- }), !0;
1300
- };
1301
- function L(n, t, e = {}) {
1302
- const { from: r, to: o, empty: s } = n.selection, i = t ? S(t, n.schema) : null, c = [];
1303
- n.doc.nodesBetween(r, o, (d, f) => {
1304
- if (d.isText)
1305
- return;
1306
- const p = Math.max(r, f), m = Math.min(o, f + d.nodeSize);
1307
- c.push({
1308
- node: d,
1309
- from: p,
1310
- to: m
1311
- });
1312
- });
1313
- const a = o - r, l = c.filter((d) => i ? i.name === d.node.type.name : !0).filter((d) => q(d.node.attrs, e, { strict: !1 }));
1314
- return s ? !!l.length : l.reduce((d, f) => d + f.to - f.from, 0) >= a;
1315
- }
1316
- const pn = (n, t = {}) => ({ state: e, dispatch: r }) => {
1317
- const o = S(n, e.schema);
1318
- return L(e, o, t) ? se(e, r) : !1;
1319
- }, hn = () => ({ state: n, dispatch: t }) => oe(n, t), mn = (n) => ({ state: t, dispatch: e }) => {
1320
- const r = S(n, t.schema);
1321
- return ye(r)(t, e);
1322
- }, gn = () => ({ state: n, dispatch: t }) => re(n, t);
1323
- function et(n, t) {
1324
- return t.nodes[n] ? "node" : t.marks[n] ? "mark" : null;
1325
- }
1326
- function Mt(n, t) {
1327
- const e = typeof t == "string" ? [t] : t;
1328
- return Object.keys(n).reduce((r, o) => (e.includes(o) || (r[o] = n[o]), r), {});
1329
- }
1330
- const yn = (n, t) => ({ tr: e, state: r, dispatch: o }) => {
1331
- let s = null, i = null;
1332
- const c = et(typeof n == "string" ? n : n.name, r.schema);
1333
- return c ? (c === "node" && (s = S(n, r.schema)), c === "mark" && (i = B(n, r.schema)), o && e.selection.ranges.forEach((a) => {
1334
- r.doc.nodesBetween(a.$from.pos, a.$to.pos, (l, u) => {
1335
- s && s === l.type && e.setNodeMarkup(u, void 0, Mt(l.attrs, t)), i && l.marks.length && l.marks.forEach((d) => {
1336
- i === d.type && e.addMark(u, u + l.nodeSize, i.create(Mt(d.attrs, t)));
1337
- });
1338
- });
1339
- }), !0) : !1;
1340
- }, kn = () => ({ tr: n, dispatch: t }) => (t && n.scrollIntoView(), !0), bn = () => ({ tr: n, dispatch: t }) => {
1341
- if (t) {
1342
- const e = new zt(n.doc);
1343
- n.setSelection(e);
1344
- }
1345
- return !0;
1346
- }, vn = () => ({ state: n, dispatch: t }) => ne(n, t), wn = () => ({ state: n, dispatch: t }) => ee(n, t), Mn = () => ({ state: n, dispatch: t }) => te(n, t), Sn = () => ({ state: n, dispatch: t }) => Zt(n, t), En = () => ({ state: n, dispatch: t }) => Xt(n, t);
1347
- function at(n, t, e = {}, r = {}) {
1348
- return D(n, t, {
1349
- slice: !1,
1350
- parseOptions: e,
1351
- errorOnInvalidContent: r.errorOnInvalidContent
1352
- });
1353
- }
1354
- const xn = (n, t = !1, e = {}, r = {}) => ({ editor: o, tr: s, dispatch: i, commands: c }) => {
1355
- var a, l;
1356
- const { doc: u } = s;
1357
- if (e.preserveWhitespace !== "full") {
1358
- const d = at(n, o.schema, e, {
1359
- errorOnInvalidContent: (a = r.errorOnInvalidContent) !== null && a !== void 0 ? a : o.options.enableContentCheck
1360
- });
1361
- return i && s.replaceWith(0, u.content.size, d).setMeta("preventUpdate", !t), !0;
1362
- }
1363
- return i && s.setMeta("preventUpdate", !t), c.insertContentAt({ from: 0, to: u.content.size }, n, {
1364
- parseOptions: e,
1365
- errorOnInvalidContent: (l = r.errorOnInvalidContent) !== null && l !== void 0 ? l : o.options.enableContentCheck
1366
- });
1367
- };
1368
- function Rt(n, t) {
1369
- const e = B(t, n.schema), { from: r, to: o, empty: s } = n.selection, i = [];
1370
- s ? (n.storedMarks && i.push(...n.storedMarks), i.push(...n.selection.$head.marks())) : n.doc.nodesBetween(r, o, (a) => {
1371
- i.push(...a.marks);
1372
- });
1373
- const c = i.find((a) => a.type.name === e.name);
1374
- return c ? { ...c.attrs } : {};
1375
- }
1376
- function yr(n, t) {
1377
- const e = new qt(n);
1378
- return t.forEach((r) => {
1379
- r.steps.forEach((o) => {
1380
- e.step(o);
1381
- });
1382
- }), e;
1383
- }
1384
- function Cn(n) {
1385
- for (let t = 0; t < n.edgeCount; t += 1) {
1386
- const { type: e } = n.edge(t);
1387
- if (e.isTextblock && !e.hasRequiredAttrs())
1388
- return e;
1389
- }
1390
- return null;
1391
- }
1392
- function kr(n, t, e) {
1393
- const r = [];
1394
- return n.nodesBetween(t.from, t.to, (o, s) => {
1395
- e(o) && r.push({
1396
- node: o,
1397
- pos: s
1398
- });
1399
- }), r;
1400
- }
1401
- function Tn(n, t) {
1402
- for (let e = n.depth; e > 0; e -= 1) {
1403
- const r = n.node(e);
1404
- if (t(r))
1405
- return {
1406
- pos: e > 0 ? n.before(e) : 0,
1407
- start: n.start(e),
1408
- depth: e,
1409
- node: r
1410
- };
1411
- }
1412
- }
1413
- function ht(n) {
1414
- return (t) => Tn(t.$from, n);
1415
- }
1416
- function An(n, t) {
1417
- const e = {
1418
- from: 0,
1419
- to: n.content.size
1420
- };
1421
- return Pt(n, e, t);
1422
- }
1423
- function Pn(n, t) {
1424
- const e = S(t, n.schema), { from: r, to: o } = n.selection, s = [];
1425
- n.doc.nodesBetween(r, o, (c) => {
1426
- s.push(c);
1427
- });
1428
- const i = s.reverse().find((c) => c.type.name === e.name);
1429
- return i ? { ...i.attrs } : {};
1430
- }
1431
- function On(n, t) {
1432
- const e = et(typeof t == "string" ? t : t.name, n.schema);
1433
- return e === "node" ? Pn(n, t) : e === "mark" ? Rt(n, t) : {};
1434
- }
1435
- function In(n, t = JSON.stringify) {
1436
- const e = {};
1437
- return n.filter((r) => {
1438
- const o = t(r);
1439
- return Object.prototype.hasOwnProperty.call(e, o) ? !1 : e[o] = !0;
1440
- });
1441
- }
1442
- function $n(n) {
1443
- const t = In(n);
1444
- return t.length === 1 ? t : t.filter((e, r) => !t.filter((s, i) => i !== r).some((s) => e.oldRange.from >= s.oldRange.from && e.oldRange.to <= s.oldRange.to && e.newRange.from >= s.newRange.from && e.newRange.to <= s.newRange.to));
1445
- }
1446
- function br(n) {
1447
- const { mapping: t, steps: e } = n, r = [];
1448
- return t.maps.forEach((o, s) => {
1449
- const i = [];
1450
- if (o.ranges.length)
1451
- o.forEach((c, a) => {
1452
- i.push({ from: c, to: a });
1453
- });
1454
- else {
1455
- const { from: c, to: a } = e[s];
1456
- if (c === void 0 || a === void 0)
1457
- return;
1458
- i.push({ from: c, to: a });
1459
- }
1460
- i.forEach(({ from: c, to: a }) => {
1461
- const l = t.slice(s).map(c, -1), u = t.slice(s).map(a), d = t.invert().map(l, -1), f = t.invert().map(u);
1462
- r.push({
1463
- oldRange: {
1464
- from: d,
1465
- to: f
1466
- },
1467
- newRange: {
1468
- from: l,
1469
- to: u
1470
- }
1471
- });
1472
- });
1473
- }), $n(r);
1474
- }
1475
- function Ft(n, t, e) {
1476
- const r = [];
1477
- return n === t ? e.resolve(n).marks().forEach((o) => {
1478
- const s = e.resolve(n), i = pt(s, o.type);
1479
- i && r.push({
1480
- mark: o,
1481
- ...i
1482
- });
1483
- }) : e.nodesBetween(n, t, (o, s) => {
1484
- !o || (o == null ? void 0 : o.nodeSize) === void 0 || r.push(...o.marks.map((i) => ({
1485
- from: s,
1486
- to: s + o.nodeSize,
1487
- mark: i
1488
- })));
1489
- }), r;
1490
- }
1491
- function K(n, t, e) {
1492
- return Object.fromEntries(Object.entries(e).filter(([r]) => {
1493
- const o = n.find((s) => s.type === t && s.name === r);
1494
- return o ? o.attribute.keepOnSplit : !1;
1495
- }));
1496
- }
1497
- function ct(n, t, e = {}) {
1498
- const { empty: r, ranges: o } = n.selection, s = t ? B(t, n.schema) : null;
1499
- if (r)
1500
- return !!(n.storedMarks || n.selection.$from.marks()).filter((d) => s ? s.name === d.type.name : !0).find((d) => q(d.attrs, e, { strict: !1 }));
1501
- let i = 0;
1502
- const c = [];
1503
- if (o.forEach(({ $from: d, $to: f }) => {
1504
- const p = d.pos, m = f.pos;
1505
- n.doc.nodesBetween(p, m, (h, g) => {
1506
- if (!h.isText && !h.marks.length)
1507
- return;
1508
- const y = Math.max(p, g), v = Math.min(m, g + h.nodeSize), w = v - y;
1509
- i += w, c.push(...h.marks.map((E) => ({
1510
- mark: E,
1511
- from: y,
1512
- to: v
1513
- })));
1514
- });
1515
- }), i === 0)
1516
- return !1;
1517
- const a = c.filter((d) => s ? s.name === d.mark.type.name : !0).filter((d) => q(d.mark.attrs, e, { strict: !1 })).reduce((d, f) => d + f.to - f.from, 0), l = c.filter((d) => s ? d.mark.type !== s && d.mark.type.excludes(s) : !0).reduce((d, f) => d + f.to - f.from, 0);
1518
- return (a > 0 ? a + l : a) >= i;
1519
- }
1520
- function Bn(n, t, e = {}) {
1521
- if (!t)
1522
- return L(n, null, e) || ct(n, null, e);
1523
- const r = et(t, n.schema);
1524
- return r === "node" ? L(n, t, e) : r === "mark" ? ct(n, t, e) : !1;
1525
- }
1526
- function St(n, t) {
1527
- const { nodeExtensions: e } = X(t), r = e.find((i) => i.name === n);
1528
- if (!r)
1529
- return !1;
1530
- const o = {
1531
- name: r.name,
1532
- options: r.options,
1533
- storage: r.storage
1534
- }, s = b(k(r, "group", o));
1535
- return typeof s != "string" ? !1 : s.split(" ").includes("list");
1536
- }
1537
- function mt(n, { checkChildren: t = !0, ignoreWhitespace: e = !1 } = {}) {
1538
- var r;
1539
- if (e) {
1540
- if (n.type.name === "hardBreak")
1541
- return !0;
1542
- if (n.isText)
1543
- return /^\s*$/m.test((r = n.text) !== null && r !== void 0 ? r : "");
1544
- }
1545
- if (n.isText)
1546
- return !n.text;
1547
- if (n.isAtom || n.isLeaf)
1548
- return !1;
1549
- if (n.content.childCount === 0)
1550
- return !0;
1551
- if (t) {
1552
- let o = !0;
1553
- return n.content.forEach((s) => {
1554
- o !== !1 && (mt(s, { ignoreWhitespace: e, checkChildren: t }) || (o = !1));
1555
- }), o;
1556
- }
1557
- return !1;
1558
- }
1559
- function vr(n) {
1560
- return n instanceof J;
1561
- }
1562
- function wr(n, t, e) {
1563
- const o = n.state.doc.content.size, s = O(t, 0, o), i = O(e, 0, o), c = n.coordsAtPos(s), a = n.coordsAtPos(i, -1), l = Math.min(c.top, a.top), u = Math.max(c.bottom, a.bottom), d = Math.min(c.left, a.left), f = Math.max(c.right, a.right), p = f - d, m = u - l, y = {
1564
- top: l,
1565
- bottom: u,
1566
- left: d,
1567
- right: f,
1568
- width: p,
1569
- height: m,
1570
- x: d,
1571
- y: l
1572
- };
1573
- return {
1574
- ...y,
1575
- toJSON: () => y
1576
- };
1577
- }
1578
- function Nn(n, t, e) {
1579
- var r;
1580
- const { selection: o } = t;
1581
- let s = null;
1582
- if ($t(o) && (s = o.$cursor), s) {
1583
- const c = (r = n.storedMarks) !== null && r !== void 0 ? r : s.marks();
1584
- return !!e.isInSet(c) || !c.some((a) => a.type.excludes(e));
1585
- }
1586
- const { ranges: i } = o;
1587
- return i.some(({ $from: c, $to: a }) => {
1588
- let l = c.depth === 0 ? n.doc.inlineContent && n.doc.type.allowsMarkType(e) : !1;
1589
- return n.doc.nodesBetween(c.pos, a.pos, (u, d, f) => {
1590
- if (l)
1591
- return !1;
1592
- if (u.isInline) {
1593
- const p = !f || f.type.allowsMarkType(e), m = !!e.isInSet(u.marks) || !u.marks.some((h) => h.type.excludes(e));
1594
- l = p && m;
1595
- }
1596
- return !l;
1597
- }), l;
1598
- });
1599
- }
1600
- const jn = (n, t = {}) => ({ tr: e, state: r, dispatch: o }) => {
1601
- const { selection: s } = e, { empty: i, ranges: c } = s, a = B(n, r.schema);
1602
- if (o)
1603
- if (i) {
1604
- const l = Rt(r, a);
1605
- e.addStoredMark(a.create({
1606
- ...l,
1607
- ...t
1608
- }));
1609
- } else
1610
- c.forEach((l) => {
1611
- const u = l.$from.pos, d = l.$to.pos;
1612
- r.doc.nodesBetween(u, d, (f, p) => {
1613
- const m = Math.max(p, u), h = Math.min(p + f.nodeSize, d);
1614
- f.marks.find((y) => y.type === a) ? f.marks.forEach((y) => {
1615
- a === y.type && e.addMark(m, h, a.create({
1616
- ...y.attrs,
1617
- ...t
1618
- }));
1619
- }) : e.addMark(m, h, a.create(t));
1620
- });
1621
- });
1622
- return Nn(r, e, a);
1623
- }, Rn = (n, t) => ({ tr: e }) => (e.setMeta(n, t), !0), Fn = (n, t = {}) => ({ state: e, dispatch: r, chain: o }) => {
1624
- const s = S(n, e.schema);
1625
- let i;
1626
- return e.selection.$anchor.sameParent(e.selection.$head) && (i = e.selection.$anchor.parent.attrs), s.isTextblock ? o().command(({ commands: c }) => gt(s, { ...i, ...t })(e) ? !0 : c.clearNodes()).command(({ state: c }) => gt(s, { ...i, ...t })(c, r)).run() : (console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'), !1);
1627
- }, Dn = (n) => ({ tr: t, dispatch: e }) => {
1628
- if (e) {
1629
- const { doc: r } = t, o = O(n, 0, r.content.size), s = J.create(r, o);
1630
- t.setSelection(s);
1631
- }
1632
- return !0;
1633
- }, Ln = (n) => ({ tr: t, dispatch: e }) => {
1634
- if (e) {
1635
- const { doc: r } = t, { from: o, to: s } = typeof n == "number" ? { from: n, to: n } : n, i = P.atStart(r).from, c = P.atEnd(r).to, a = O(o, i, c), l = O(s, i, c), u = P.create(r, a, l);
1636
- t.setSelection(u);
1637
- }
1638
- return !0;
1639
- }, zn = (n) => ({ state: t, dispatch: e }) => {
1640
- const r = S(n, t.schema);
1641
- return ge(r)(t, e);
1642
- };
1643
- function Et(n, t) {
1644
- const e = n.storedMarks || n.selection.$to.parentOffset && n.selection.$from.marks();
1645
- if (e) {
1646
- const r = e.filter((o) => t == null ? void 0 : t.includes(o.type.name));
1647
- n.tr.ensureMarks(r);
1648
- }
1649
- }
1650
- const Hn = ({ keepMarks: n = !0 } = {}) => ({ tr: t, state: e, dispatch: r, editor: o }) => {
1651
- const { selection: s, doc: i } = t, { $from: c, $to: a } = s, l = o.extensionManager.attributes, u = K(l, c.node().type.name, c.node().attrs);
1652
- if (s instanceof J && s.node.isBlock)
1653
- return !c.parentOffset || !V(i, c.pos) ? !1 : (r && (n && Et(e, o.extensionManager.splittableMarks), t.split(c.pos).scrollIntoView()), !0);
1654
- if (!c.parent.isBlock)
1655
- return !1;
1656
- const d = a.parentOffset === a.parent.content.size, f = c.depth === 0 ? void 0 : Cn(c.node(-1).contentMatchAt(c.indexAfter(-1)));
1657
- let p = d && f ? [
1658
- {
1659
- type: f,
1660
- attrs: u
1661
- }
1662
- ] : void 0, m = V(t.doc, t.mapping.map(c.pos), 1, p);
1663
- if (!p && !m && V(t.doc, t.mapping.map(c.pos), 1, f ? [{ type: f }] : void 0) && (m = !0, p = f ? [
1664
- {
1665
- type: f,
1666
- attrs: u
1667
- }
1668
- ] : void 0), r) {
1669
- if (m && (s instanceof P && t.deleteSelection(), t.split(t.mapping.map(c.pos), 1, p), f && !d && !c.parentOffset && c.parent.type !== f)) {
1670
- const h = t.mapping.map(c.before()), g = t.doc.resolve(h);
1671
- c.node(-1).canReplaceWith(g.index(), g.index() + 1, f) && t.setNodeMarkup(t.mapping.map(c.before()), f);
1672
- }
1673
- n && Et(e, o.extensionManager.splittableMarks), t.scrollIntoView();
1674
- }
1675
- return m;
1676
- }, _n = (n, t = {}) => ({ tr: e, state: r, dispatch: o, editor: s }) => {
1677
- var i;
1678
- const c = S(n, r.schema), { $from: a, $to: l } = r.selection, u = r.selection.node;
1679
- if (u && u.isBlock || a.depth < 2 || !a.sameParent(l))
1680
- return !1;
1681
- const d = a.node(-1);
1682
- if (d.type !== c)
1683
- return !1;
1684
- const f = s.extensionManager.attributes;
1685
- if (a.parent.content.size === 0 && a.node(-1).childCount === a.indexAfter(-1)) {
1686
- if (a.depth === 2 || a.node(-3).type !== c || a.index(-2) !== a.node(-2).childCount - 1)
1687
- return !1;
1688
- if (o) {
1689
- let y = $.empty;
1690
- const v = a.index(-1) ? 1 : a.index(-2) ? 2 : 3;
1691
- for (let A = a.depth - v; A >= a.depth - 3; A -= 1)
1692
- y = $.from(a.node(A).copy(y));
1693
- const w = a.indexAfter(-1) < a.node(-2).childCount ? 1 : a.indexAfter(-2) < a.node(-3).childCount ? 2 : 3, E = {
1694
- ...K(f, a.node().type.name, a.node().attrs),
1695
- ...t
1696
- }, M = ((i = c.contentMatch.defaultType) === null || i === void 0 ? void 0 : i.createAndFill(E)) || void 0;
1697
- y = y.append($.from(c.createAndFill(null, M) || void 0));
1698
- const x = a.before(a.depth - (v - 1));
1699
- e.replace(x, a.after(-w), new Kt(y, 4 - v, 0));
1700
- let T = -1;
1701
- e.doc.nodesBetween(x, e.doc.content.size, (A, Dt) => {
1702
- if (T > -1)
1703
- return !1;
1704
- A.isTextblock && A.content.size === 0 && (T = Dt + 1);
1705
- }), T > -1 && e.setSelection(P.near(e.doc.resolve(T))), e.scrollIntoView();
1706
- }
1707
- return !0;
1708
- }
1709
- const p = l.pos === a.end() ? d.contentMatchAt(0).defaultType : null, m = {
1710
- ...K(f, d.type.name, d.attrs),
1711
- ...t
1712
- }, h = {
1713
- ...K(f, a.node().type.name, a.node().attrs),
1714
- ...t
1715
- };
1716
- e.delete(a.pos, l.pos);
1717
- const g = p ? [
1718
- { type: c, attrs: m },
1719
- { type: p, attrs: h }
1720
- ] : [{ type: c, attrs: m }];
1721
- if (!V(e.doc, a.pos, 2))
1722
- return !1;
1723
- if (o) {
1724
- const { selection: y, storedMarks: v } = r, { splittableMarks: w } = s.extensionManager, E = v || y.$to.parentOffset && y.$from.marks();
1725
- if (e.split(a.pos, 2, g).scrollIntoView(), !E || !o)
1726
- return !0;
1727
- const M = E.filter((x) => w.includes(x.type.name));
1728
- e.ensureMarks(M);
1729
- }
1730
- return !0;
1731
- }, ot = (n, t) => {
1732
- const e = ht((i) => i.type === t)(n.selection);
1733
- if (!e)
1734
- return !0;
1735
- const r = n.doc.resolve(Math.max(0, e.pos - 1)).before(e.depth);
1736
- if (r === void 0)
1737
- return !0;
1738
- const o = n.doc.nodeAt(r);
1739
- return e.node.type === (o == null ? void 0 : o.type) && dt(n.doc, e.pos) && n.join(e.pos), !0;
1740
- }, st = (n, t) => {
1741
- const e = ht((i) => i.type === t)(n.selection);
1742
- if (!e)
1743
- return !0;
1744
- const r = n.doc.resolve(e.start).after(e.depth);
1745
- if (r === void 0)
1746
- return !0;
1747
- const o = n.doc.nodeAt(r);
1748
- return e.node.type === (o == null ? void 0 : o.type) && dt(n.doc, r) && n.join(r), !0;
1749
- }, Wn = (n, t, e, r = {}) => ({ editor: o, tr: s, state: i, dispatch: c, chain: a, commands: l, can: u }) => {
1750
- const { extensions: d, splittableMarks: f } = o.extensionManager, p = S(n, i.schema), m = S(t, i.schema), { selection: h, storedMarks: g } = i, { $from: y, $to: v } = h, w = y.blockRange(v), E = g || h.$to.parentOffset && h.$from.marks();
1751
- if (!w)
1752
- return !1;
1753
- const M = ht((x) => St(x.type.name, d))(h);
1754
- if (w.depth >= 1 && M && w.depth - M.depth <= 1) {
1755
- if (M.node.type === p)
1756
- return l.liftListItem(m);
1757
- if (St(M.node.type.name, d) && p.validContent(M.node.content) && c)
1758
- return a().command(() => (s.setNodeMarkup(M.pos, p), !0)).command(() => ot(s, p)).command(() => st(s, p)).run();
1759
- }
1760
- return !e || !E || !c ? a().command(() => u().wrapInList(p, r) ? !0 : l.clearNodes()).wrapInList(p, r).command(() => ot(s, p)).command(() => st(s, p)).run() : a().command(() => {
1761
- const x = u().wrapInList(p, r), T = E.filter((A) => f.includes(A.type.name));
1762
- return s.ensureMarks(T), x ? !0 : l.clearNodes();
1763
- }).wrapInList(p, r).command(() => ot(s, p)).command(() => st(s, p)).run();
1764
- }, Vn = (n, t = {}, e = {}) => ({ state: r, commands: o }) => {
1765
- const { extendEmptyMarkRange: s = !1 } = e, i = B(n, r.schema);
1766
- return ct(r, i, t) ? o.unsetMark(i, { extendEmptyMarkRange: s }) : o.setMark(i, t);
1767
- }, Kn = (n, t, e = {}) => ({ state: r, commands: o }) => {
1768
- const s = S(n, r.schema), i = S(t, r.schema), c = L(r, s, e);
1769
- let a;
1770
- return r.selection.$anchor.sameParent(r.selection.$head) && (a = r.selection.$anchor.parent.attrs), c ? o.setNode(i, a) : o.setNode(s, { ...a, ...e });
1771
- }, Un = (n, t = {}) => ({ state: e, commands: r }) => {
1772
- const o = S(n, e.schema);
1773
- return L(e, o, t) ? r.lift(o) : r.wrapIn(o, t);
1774
- }, qn = () => ({ state: n, dispatch: t }) => {
1775
- const e = n.plugins;
1776
- for (let r = 0; r < e.length; r += 1) {
1777
- const o = e[r];
1778
- let s;
1779
- if (o.spec.isInputRules && (s = o.getState(n))) {
1780
- if (t) {
1781
- const i = n.tr, c = s.transform;
1782
- for (let a = c.steps.length - 1; a >= 0; a -= 1)
1783
- i.step(c.steps[a].invert(c.docs[a]));
1784
- if (s.text) {
1785
- const a = i.doc.resolve(s.from).marks();
1786
- i.replaceWith(s.from, s.to, n.schema.text(s.text, a));
1787
- } else
1788
- i.delete(s.from, s.to);
1789
- }
1790
- return !0;
1791
- }
1792
- }
1793
- return !1;
1794
- }, Gn = () => ({ tr: n, dispatch: t }) => {
1795
- const { selection: e } = n, { empty: r, ranges: o } = e;
1796
- return r || t && o.forEach((s) => {
1797
- n.removeMark(s.$from.pos, s.$to.pos);
1798
- }), !0;
1799
- }, Jn = (n, t = {}) => ({ tr: e, state: r, dispatch: o }) => {
1800
- var s;
1801
- const { extendEmptyMarkRange: i = !1 } = t, { selection: c } = e, a = B(n, r.schema), { $from: l, empty: u, ranges: d } = c;
1802
- if (!o)
1803
- return !0;
1804
- if (u && i) {
1805
- let { from: f, to: p } = c;
1806
- const m = (s = l.marks().find((g) => g.type === a)) === null || s === void 0 ? void 0 : s.attrs, h = pt(l, a, m);
1807
- h && (f = h.from, p = h.to), e.removeMark(f, p, a);
1808
- } else
1809
- d.forEach((f) => {
1810
- e.removeMark(f.$from.pos, f.$to.pos, a);
1811
- });
1812
- return e.removeStoredMark(a), !0;
1813
- }, Yn = (n, t = {}) => ({ tr: e, state: r, dispatch: o }) => {
1814
- let s = null, i = null;
1815
- const c = et(typeof n == "string" ? n : n.name, r.schema);
1816
- return c ? (c === "node" && (s = S(n, r.schema)), c === "mark" && (i = B(n, r.schema)), o && e.selection.ranges.forEach((a) => {
1817
- const l = a.$from.pos, u = a.$to.pos;
1818
- let d, f, p, m;
1819
- e.selection.empty ? r.doc.nodesBetween(l, u, (h, g) => {
1820
- s && s === h.type && (p = Math.max(g, l), m = Math.min(g + h.nodeSize, u), d = g, f = h);
1821
- }) : r.doc.nodesBetween(l, u, (h, g) => {
1822
- g < l && s && s === h.type && (p = Math.max(g, l), m = Math.min(g + h.nodeSize, u), d = g, f = h), g >= l && g <= u && (s && s === h.type && e.setNodeMarkup(g, void 0, {
1823
- ...h.attrs,
1824
- ...t
1825
- }), i && h.marks.length && h.marks.forEach((y) => {
1826
- if (i === y.type) {
1827
- const v = Math.max(g, l), w = Math.min(g + h.nodeSize, u);
1828
- e.addMark(v, w, i.create({
1829
- ...y.attrs,
1830
- ...t
1831
- }));
1832
- }
1833
- }));
1834
- }), f && (d !== void 0 && e.setNodeMarkup(d, void 0, {
1835
- ...f.attrs,
1836
- ...t
1837
- }), i && f.marks.length && f.marks.forEach((h) => {
1838
- i === h.type && e.addMark(p, m, i.create({
1839
- ...h.attrs,
1840
- ...t
1841
- }));
1842
- }));
1843
- }), !0) : !1;
1844
- }, Qn = (n, t = {}) => ({ state: e, dispatch: r }) => {
1845
- const o = S(n, e.schema);
1846
- return Qt(o, t)(e, r);
1847
- }, Xn = (n, t = {}) => ({ state: e, dispatch: r }) => {
1848
- const o = S(n, e.schema);
1849
- return me(o, t)(e, r);
1850
- };
1851
- var Zn = /* @__PURE__ */ Object.freeze({
1852
- __proto__: null,
1853
- blur: je,
1854
- clearContent: Re,
1855
- clearNodes: Fe,
1856
- command: De,
1857
- createParagraphNear: Le,
1858
- cut: ze,
1859
- deleteCurrentNode: He,
1860
- deleteNode: _e,
1861
- deleteRange: We,
1862
- deleteSelection: Ve,
1863
- enter: Ke,
1864
- exitCode: Ue,
1865
- extendMarkRange: qe,
1866
- first: Ge,
1867
- focus: Ye,
1868
- forEach: Qe,
1869
- insertContent: Xe,
1870
- insertContentAt: en,
1871
- joinBackward: on,
1872
- joinDown: rn,
1873
- joinForward: sn,
1874
- joinItemBackward: an,
1875
- joinItemForward: cn,
1876
- joinTextblockBackward: ln,
1877
- joinTextblockForward: dn,
1878
- joinUp: nn,
1879
- keyboardShortcut: fn,
1880
- lift: pn,
1881
- liftEmptyBlock: hn,
1882
- liftListItem: mn,
1883
- newlineInCode: gn,
1884
- resetAttributes: yn,
1885
- scrollIntoView: kn,
1886
- selectAll: bn,
1887
- selectNodeBackward: vn,
1888
- selectNodeForward: wn,
1889
- selectParentNode: Mn,
1890
- selectTextblockEnd: Sn,
1891
- selectTextblockStart: En,
1892
- setContent: xn,
1893
- setMark: jn,
1894
- setMeta: Rn,
1895
- setNode: Fn,
1896
- setNodeSelection: Dn,
1897
- setTextSelection: Ln,
1898
- sinkListItem: zn,
1899
- splitBlock: Hn,
1900
- splitListItem: _n,
1901
- toggleList: Wn,
1902
- toggleMark: Vn,
1903
- toggleNode: Kn,
1904
- toggleWrap: Un,
1905
- undoInputRule: qn,
1906
- unsetAllMarks: Gn,
1907
- unsetMark: Jn,
1908
- updateAttributes: Yn,
1909
- wrapIn: Qn,
1910
- wrapInList: Xn
1911
- });
1912
- const tr = C.create({
1913
- name: "commands",
1914
- addCommands() {
1915
- return {
1916
- ...Zn
1917
- };
1918
- }
1919
- }), er = C.create({
1920
- name: "drop",
1921
- addProseMirrorPlugins() {
1922
- return [
1923
- new I({
1924
- key: new j("tiptapDrop"),
1925
- props: {
1926
- handleDrop: (n, t, e, r) => {
1927
- this.editor.emit("drop", {
1928
- editor: this.editor,
1929
- event: t,
1930
- slice: e,
1931
- moved: r
1932
- });
1933
- }
1934
- }
1935
- })
1936
- ];
1937
- }
1938
- }), nr = C.create({
1939
- name: "editable",
1940
- addProseMirrorPlugins() {
1941
- return [
1942
- new I({
1943
- key: new j("editable"),
1944
- props: {
1945
- editable: () => this.editor.options.editable
1946
- }
1947
- })
1948
- ];
1949
- }
1950
- }), rr = new j("focusEvents"), or = C.create({
1951
- name: "focusEvents",
1952
- addProseMirrorPlugins() {
1953
- const { editor: n } = this;
1954
- return [
1955
- new I({
1956
- key: rr,
1957
- props: {
1958
- handleDOMEvents: {
1959
- focus: (t, e) => {
1960
- n.isFocused = !0;
1961
- const r = n.state.tr.setMeta("focus", { event: e }).setMeta("addToHistory", !1);
1962
- return t.dispatch(r), !1;
1963
- },
1964
- blur: (t, e) => {
1965
- n.isFocused = !1;
1966
- const r = n.state.tr.setMeta("blur", { event: e }).setMeta("addToHistory", !1);
1967
- return t.dispatch(r), !1;
1968
- }
1969
- }
1970
- }
1971
- })
1972
- ];
1973
- }
1974
- }), sr = C.create({
1975
- name: "keymap",
1976
- addKeyboardShortcuts() {
1977
- const n = () => this.editor.commands.first(({ commands: i }) => [
1978
- () => i.undoInputRule(),
1979
- // maybe convert first text block node to default node
1980
- () => i.command(({ tr: c }) => {
1981
- const { selection: a, doc: l } = c, { empty: u, $anchor: d } = a, { pos: f, parent: p } = d, m = d.parent.isTextblock && f > 0 ? c.doc.resolve(f - 1) : d, h = m.parent.type.spec.isolating, g = d.pos - d.parentOffset, y = h && m.parent.childCount === 1 ? g === d.pos : F.atStart(l).from === f;
1982
- return !u || !p.type.isTextblock || p.textContent.length || !y || y && d.parent.type.name === "paragraph" ? !1 : i.clearNodes();
1983
- }),
1984
- () => i.deleteSelection(),
1985
- () => i.joinBackward(),
1986
- () => i.selectNodeBackward()
1987
- ]), t = () => this.editor.commands.first(({ commands: i }) => [
1988
- () => i.deleteSelection(),
1989
- () => i.deleteCurrentNode(),
1990
- () => i.joinForward(),
1991
- () => i.selectNodeForward()
1992
- ]), r = {
1993
- Enter: () => this.editor.commands.first(({ commands: i }) => [
1994
- () => i.newlineInCode(),
1995
- () => i.createParagraphNear(),
1996
- () => i.liftEmptyBlock(),
1997
- () => i.splitBlock()
1998
- ]),
1999
- "Mod-Enter": () => this.editor.commands.exitCode(),
2000
- Backspace: n,
2001
- "Mod-Backspace": n,
2002
- "Shift-Backspace": n,
2003
- Delete: t,
2004
- "Mod-Delete": t,
2005
- "Mod-a": () => this.editor.commands.selectAll()
2006
- }, o = {
2007
- ...r
2008
- }, s = {
2009
- ...r,
2010
- "Ctrl-h": n,
2011
- "Alt-Backspace": n,
2012
- "Ctrl-d": t,
2013
- "Ctrl-Alt-Backspace": t,
2014
- "Alt-Delete": t,
2015
- "Alt-d": t,
2016
- "Ctrl-a": () => this.editor.commands.selectTextblockStart(),
2017
- "Ctrl-e": () => this.editor.commands.selectTextblockEnd()
2018
- };
2019
- return G() || jt() ? s : o;
2020
- },
2021
- addProseMirrorPlugins() {
2022
- return [
2023
- // With this plugin we check if the whole document was selected and deleted.
2024
- // In this case we will additionally call `clearNodes()` to convert e.g. a heading
2025
- // to a paragraph if necessary.
2026
- // This is an alternative to ProseMirror's `AllSelection`, which doesn’t work well
2027
- // with many other commands.
2028
- new I({
2029
- key: new j("clearDocument"),
2030
- appendTransaction: (n, t, e) => {
2031
- if (n.some((h) => h.getMeta("composition")))
2032
- return;
2033
- const r = n.some((h) => h.docChanged) && !t.doc.eq(e.doc), o = n.some((h) => h.getMeta("preventClearDocument"));
2034
- if (!r || o)
2035
- return;
2036
- const { empty: s, from: i, to: c } = t.selection, a = F.atStart(t.doc).from, l = F.atEnd(t.doc).to;
2037
- if (s || !(i === a && c === l) || !mt(e.doc))
2038
- return;
2039
- const f = e.tr, p = Y({
2040
- state: e,
2041
- transaction: f
2042
- }), { commands: m } = new Q({
2043
- editor: this.editor,
2044
- state: p
2045
- });
2046
- if (m.clearNodes(), !!f.steps.length)
2047
- return f;
2048
- }
2049
- })
2050
- ];
2051
- }
2052
- }), ir = C.create({
2053
- name: "paste",
2054
- addProseMirrorPlugins() {
2055
- return [
2056
- new I({
2057
- key: new j("tiptapPaste"),
2058
- props: {
2059
- handlePaste: (n, t, e) => {
2060
- this.editor.emit("paste", {
2061
- editor: this.editor,
2062
- event: t,
2063
- slice: e
2064
- });
2065
- }
2066
- }
2067
- })
2068
- ];
2069
- }
2070
- }), ar = C.create({
2071
- name: "tabindex",
2072
- addProseMirrorPlugins() {
2073
- return [
2074
- new I({
2075
- key: new j("tabindex"),
2076
- props: {
2077
- attributes: () => this.editor.isEditable ? { tabindex: "0" } : {}
2078
- }
2079
- })
2080
- ];
2081
- }
2082
- });
2083
- class N {
2084
- get name() {
2085
- return this.node.type.name;
2086
- }
2087
- constructor(t, e, r = !1, o = null) {
2088
- this.currentNode = null, this.actualDepth = null, this.isBlock = r, this.resolvedPos = t, this.editor = e, this.currentNode = o;
2089
- }
2090
- get node() {
2091
- return this.currentNode || this.resolvedPos.node();
2092
- }
2093
- get element() {
2094
- return this.editor.view.domAtPos(this.pos).node;
2095
- }
2096
- get depth() {
2097
- var t;
2098
- return (t = this.actualDepth) !== null && t !== void 0 ? t : this.resolvedPos.depth;
2099
- }
2100
- get pos() {
2101
- return this.resolvedPos.pos;
2102
- }
2103
- get content() {
2104
- return this.node.content;
2105
- }
2106
- set content(t) {
2107
- let e = this.from, r = this.to;
2108
- if (this.isBlock) {
2109
- if (this.content.size === 0) {
2110
- console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);
2111
- return;
2112
- }
2113
- e = this.from + 1, r = this.to - 1;
2114
- }
2115
- this.editor.commands.insertContentAt({ from: e, to: r }, t);
2116
- }
2117
- get attributes() {
2118
- return this.node.attrs;
2119
- }
2120
- get textContent() {
2121
- return this.node.textContent;
2122
- }
2123
- get size() {
2124
- return this.node.nodeSize;
2125
- }
2126
- get from() {
2127
- return this.isBlock ? this.pos : this.resolvedPos.start(this.resolvedPos.depth);
2128
- }
2129
- get range() {
2130
- return {
2131
- from: this.from,
2132
- to: this.to
2133
- };
2134
- }
2135
- get to() {
2136
- return this.isBlock ? this.pos + this.size : this.resolvedPos.end(this.resolvedPos.depth) + (this.node.isText ? 0 : 1);
2137
- }
2138
- get parent() {
2139
- if (this.depth === 0)
2140
- return null;
2141
- const t = this.resolvedPos.start(this.resolvedPos.depth - 1), e = this.resolvedPos.doc.resolve(t);
2142
- return new N(e, this.editor);
2143
- }
2144
- get before() {
2145
- let t = this.resolvedPos.doc.resolve(this.from - (this.isBlock ? 1 : 2));
2146
- return t.depth !== this.depth && (t = this.resolvedPos.doc.resolve(this.from - 3)), new N(t, this.editor);
2147
- }
2148
- get after() {
2149
- let t = this.resolvedPos.doc.resolve(this.to + (this.isBlock ? 2 : 1));
2150
- return t.depth !== this.depth && (t = this.resolvedPos.doc.resolve(this.to + 3)), new N(t, this.editor);
2151
- }
2152
- get children() {
2153
- const t = [];
2154
- return this.node.content.forEach((e, r) => {
2155
- const o = e.isBlock && !e.isTextblock, s = e.isAtom && !e.isText, i = this.pos + r + (s ? 0 : 1);
2156
- if (i < 0 || i > this.resolvedPos.doc.nodeSize - 2)
2157
- return;
2158
- const c = this.resolvedPos.doc.resolve(i);
2159
- if (!o && c.depth <= this.depth)
2160
- return;
2161
- const a = new N(c, this.editor, o, o ? e : null);
2162
- o && (a.actualDepth = this.depth + 1), t.push(new N(c, this.editor, o, o ? e : null));
2163
- }), t;
2164
- }
2165
- get firstChild() {
2166
- return this.children[0] || null;
2167
- }
2168
- get lastChild() {
2169
- const t = this.children;
2170
- return t[t.length - 1] || null;
2171
- }
2172
- closest(t, e = {}) {
2173
- let r = null, o = this.parent;
2174
- for (; o && !r; ) {
2175
- if (o.node.type.name === t)
2176
- if (Object.keys(e).length > 0) {
2177
- const s = o.node.attrs, i = Object.keys(e);
2178
- for (let c = 0; c < i.length; c += 1) {
2179
- const a = i[c];
2180
- if (s[a] !== e[a])
2181
- break;
2182
- }
2183
- } else
2184
- r = o;
2185
- o = o.parent;
2186
- }
2187
- return r;
2188
- }
2189
- querySelector(t, e = {}) {
2190
- return this.querySelectorAll(t, e, !0)[0] || null;
2191
- }
2192
- querySelectorAll(t, e = {}, r = !1) {
2193
- let o = [];
2194
- if (!this.children || this.children.length === 0)
2195
- return o;
2196
- const s = Object.keys(e);
2197
- return this.children.forEach((i) => {
2198
- r && o.length > 0 || (i.node.type.name === t && s.every((a) => e[a] === i.node.attrs[a]) && o.push(i), !(r && o.length > 0) && (o = o.concat(i.querySelectorAll(t, e, r))));
2199
- }), o;
2200
- }
2201
- setAttribute(t) {
2202
- const { tr: e } = this.editor.state;
2203
- e.setNodeMarkup(this.from, void 0, {
2204
- ...this.node.attrs,
2205
- ...t
2206
- }), this.editor.view.dispatch(e);
2207
- }
2208
- }
2209
- const cr = `.ProseMirror {
2210
- position: relative;
2211
- }
2212
-
2213
- .ProseMirror {
2214
- word-wrap: break-word;
2215
- white-space: pre-wrap;
2216
- white-space: break-spaces;
2217
- -webkit-font-variant-ligatures: none;
2218
- font-variant-ligatures: none;
2219
- font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
2220
- }
2221
-
2222
- .ProseMirror [contenteditable="false"] {
2223
- white-space: normal;
2224
- }
2225
-
2226
- .ProseMirror [contenteditable="false"] [contenteditable="true"] {
2227
- white-space: pre-wrap;
2228
- }
2229
-
2230
- .ProseMirror pre {
2231
- white-space: pre-wrap;
2232
- }
2233
-
2234
- img.ProseMirror-separator {
2235
- display: inline !important;
2236
- border: none !important;
2237
- margin: 0 !important;
2238
- width: 0 !important;
2239
- height: 0 !important;
2240
- }
2241
-
2242
- .ProseMirror-gapcursor {
2243
- display: none;
2244
- pointer-events: none;
2245
- position: absolute;
2246
- margin: 0;
2247
- }
2248
-
2249
- .ProseMirror-gapcursor:after {
2250
- content: "";
2251
- display: block;
2252
- position: absolute;
2253
- top: -2px;
2254
- width: 20px;
2255
- border-top: 1px solid black;
2256
- animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
2257
- }
2258
-
2259
- @keyframes ProseMirror-cursor-blink {
2260
- to {
2261
- visibility: hidden;
2262
- }
2263
- }
2264
-
2265
- .ProseMirror-hideselection *::selection {
2266
- background: transparent;
2267
- }
2268
-
2269
- .ProseMirror-hideselection *::-moz-selection {
2270
- background: transparent;
2271
- }
2272
-
2273
- .ProseMirror-hideselection * {
2274
- caret-color: transparent;
2275
- }
2276
-
2277
- .ProseMirror-focused .ProseMirror-gapcursor {
2278
- display: block;
2279
- }
2280
-
2281
- .tippy-box[data-animation=fade][data-state=hidden] {
2282
- opacity: 0
2283
- }`;
2284
- function lr(n, t, e) {
2285
- const r = document.querySelector("style[data-tiptap-style]");
2286
- if (r !== null)
2287
- return r;
2288
- const o = document.createElement("style");
2289
- return t && o.setAttribute("nonce", t), o.setAttribute("data-tiptap-style", ""), o.innerHTML = n, document.getElementsByTagName("head")[0].appendChild(o), o;
2290
- }
2291
- class Mr extends ke {
2292
- constructor(t = {}) {
2293
- super(), this.isFocused = !1, this.isInitialized = !1, this.extensionStorage = {}, this.options = {
2294
- element: document.createElement("div"),
2295
- content: "",
2296
- injectCSS: !0,
2297
- injectNonce: void 0,
2298
- extensions: [],
2299
- autofocus: !1,
2300
- editable: !0,
2301
- editorProps: {},
2302
- parseOptions: {},
2303
- coreExtensionOptions: {},
2304
- enableInputRules: !0,
2305
- enablePasteRules: !0,
2306
- enableCoreExtensions: !0,
2307
- enableContentCheck: !1,
2308
- emitContentError: !1,
2309
- onBeforeCreate: () => null,
2310
- onCreate: () => null,
2311
- onUpdate: () => null,
2312
- onSelectionUpdate: () => null,
2313
- onTransaction: () => null,
2314
- onFocus: () => null,
2315
- onBlur: () => null,
2316
- onDestroy: () => null,
2317
- onContentError: ({ error: e }) => {
2318
- throw e;
2319
- },
2320
- onPaste: () => null,
2321
- onDrop: () => null
2322
- }, this.isCapturingTransaction = !1, this.capturedTransaction = null, this.setOptions(t), this.createExtensionManager(), this.createCommandManager(), this.createSchema(), this.on("beforeCreate", this.options.onBeforeCreate), this.emit("beforeCreate", { editor: this }), this.on("contentError", this.options.onContentError), this.createView(), this.injectCSS(), this.on("create", this.options.onCreate), this.on("update", this.options.onUpdate), this.on("selectionUpdate", this.options.onSelectionUpdate), this.on("transaction", this.options.onTransaction), this.on("focus", this.options.onFocus), this.on("blur", this.options.onBlur), this.on("destroy", this.options.onDestroy), this.on("drop", ({ event: e, slice: r, moved: o }) => this.options.onDrop(e, r, o)), this.on("paste", ({ event: e, slice: r }) => this.options.onPaste(e, r)), window.setTimeout(() => {
2323
- this.isDestroyed || (this.commands.focus(this.options.autofocus), this.emit("create", { editor: this }), this.isInitialized = !0);
2324
- }, 0);
2325
- }
2326
- /**
2327
- * Returns the editor storage.
2328
- */
2329
- get storage() {
2330
- return this.extensionStorage;
2331
- }
2332
- /**
2333
- * An object of all registered commands.
2334
- */
2335
- get commands() {
2336
- return this.commandManager.commands;
2337
- }
2338
- /**
2339
- * Create a command chain to call multiple commands at once.
2340
- */
2341
- chain() {
2342
- return this.commandManager.chain();
2343
- }
2344
- /**
2345
- * Check if a command or a command chain can be executed. Without executing it.
2346
- */
2347
- can() {
2348
- return this.commandManager.can();
2349
- }
2350
- /**
2351
- * Inject CSS styles.
2352
- */
2353
- injectCSS() {
2354
- this.options.injectCSS && document && (this.css = lr(cr, this.options.injectNonce));
2355
- }
2356
- /**
2357
- * Update editor options.
2358
- *
2359
- * @param options A list of options
2360
- */
2361
- setOptions(t = {}) {
2362
- this.options = {
2363
- ...this.options,
2364
- ...t
2365
- }, !(!this.view || !this.state || this.isDestroyed) && (this.options.editorProps && this.view.setProps(this.options.editorProps), this.view.updateState(this.state));
2366
- }
2367
- /**
2368
- * Update editable state of the editor.
2369
- */
2370
- setEditable(t, e = !0) {
2371
- this.setOptions({ editable: t }), e && this.emit("update", { editor: this, transaction: this.state.tr });
2372
- }
2373
- /**
2374
- * Returns whether the editor is editable.
2375
- */
2376
- get isEditable() {
2377
- return this.options.editable && this.view && this.view.editable;
2378
- }
2379
- /**
2380
- * Returns the editor state.
2381
- */
2382
- get state() {
2383
- return this.view.state;
2384
- }
2385
- /**
2386
- * Register a ProseMirror plugin.
2387
- *
2388
- * @param plugin A ProseMirror plugin
2389
- * @param handlePlugins Control how to merge the plugin into the existing plugins.
2390
- * @returns The new editor state
2391
- */
2392
- registerPlugin(t, e) {
2393
- const r = At(e) ? e(t, [...this.state.plugins]) : [...this.state.plugins, t], o = this.state.reconfigure({ plugins: r });
2394
- return this.view.updateState(o), o;
2395
- }
2396
- /**
2397
- * Unregister a ProseMirror plugin.
2398
- *
2399
- * @param nameOrPluginKeyToRemove The plugins name
2400
- * @returns The new editor state or undefined if the editor is destroyed
2401
- */
2402
- unregisterPlugin(t) {
2403
- if (this.isDestroyed)
2404
- return;
2405
- const e = this.state.plugins;
2406
- let r = e;
2407
- if ([].concat(t).forEach((s) => {
2408
- const i = typeof s == "string" ? `${s}$` : s.key;
2409
- r = r.filter((c) => !c.key.startsWith(i));
2410
- }), e.length === r.length)
2411
- return;
2412
- const o = this.state.reconfigure({
2413
- plugins: r
2414
- });
2415
- return this.view.updateState(o), o;
2416
- }
2417
- /**
2418
- * Creates an extension manager.
2419
- */
2420
- createExtensionManager() {
2421
- var t, e;
2422
- const o = [...this.options.enableCoreExtensions ? [
2423
- nr,
2424
- Ne.configure({
2425
- blockSeparator: (e = (t = this.options.coreExtensionOptions) === null || t === void 0 ? void 0 : t.clipboardTextSerializer) === null || e === void 0 ? void 0 : e.blockSeparator
2426
- }),
2427
- tr,
2428
- or,
2429
- sr,
2430
- ar,
2431
- er,
2432
- ir
2433
- ].filter((s) => typeof this.options.enableCoreExtensions == "object" ? this.options.enableCoreExtensions[s.name] !== !1 : !0) : [], ...this.options.extensions].filter((s) => ["extension", "node", "mark"].includes(s == null ? void 0 : s.type));
2434
- this.extensionManager = new R(o, this);
2435
- }
2436
- /**
2437
- * Creates an command manager.
2438
- */
2439
- createCommandManager() {
2440
- this.commandManager = new Q({
2441
- editor: this
2442
- });
2443
- }
2444
- /**
2445
- * Creates a ProseMirror schema.
2446
- */
2447
- createSchema() {
2448
- this.schema = this.extensionManager.schema;
2449
- }
2450
- /**
2451
- * Creates a ProseMirror view.
2452
- */
2453
- createView() {
2454
- var t;
2455
- let e;
2456
- try {
2457
- e = at(this.options.content, this.schema, this.options.parseOptions, { errorOnInvalidContent: this.options.enableContentCheck });
2458
- } catch (i) {
2459
- if (!(i instanceof Error) || !["[tiptap error]: Invalid JSON content", "[tiptap error]: Invalid HTML content"].includes(i.message))
2460
- throw i;
2461
- this.emit("contentError", {
2462
- editor: this,
2463
- error: i,
2464
- disableCollaboration: () => {
2465
- this.storage.collaboration && (this.storage.collaboration.isDisabled = !0), this.options.extensions = this.options.extensions.filter((c) => c.name !== "collaboration"), this.createExtensionManager();
2466
- }
2467
- }), e = at(this.options.content, this.schema, this.options.parseOptions, { errorOnInvalidContent: !1 });
2468
- }
2469
- const r = Bt(e, this.options.autofocus);
2470
- this.view = new Ht(this.options.element, {
2471
- ...this.options.editorProps,
2472
- attributes: {
2473
- // add `role="textbox"` to the editor element
2474
- role: "textbox",
2475
- ...(t = this.options.editorProps) === null || t === void 0 ? void 0 : t.attributes
2476
- },
2477
- dispatchTransaction: this.dispatchTransaction.bind(this),
2478
- state: Lt.create({
2479
- doc: e,
2480
- selection: r || void 0
2481
- })
2482
- });
2483
- const o = this.state.reconfigure({
2484
- plugins: this.extensionManager.plugins
2485
- });
2486
- this.view.updateState(o), this.createNodeViews(), this.prependClass();
2487
- const s = this.view.dom;
2488
- s.editor = this;
2489
- }
2490
- /**
2491
- * Creates all node views.
2492
- */
2493
- createNodeViews() {
2494
- this.view.isDestroyed || this.view.setProps({
2495
- nodeViews: this.extensionManager.nodeViews
2496
- });
2497
- }
2498
- /**
2499
- * Prepend class name to element.
2500
- */
2501
- prependClass() {
2502
- this.view.dom.className = `tiptap ${this.view.dom.className}`;
2503
- }
2504
- captureTransaction(t) {
2505
- this.isCapturingTransaction = !0, t(), this.isCapturingTransaction = !1;
2506
- const e = this.capturedTransaction;
2507
- return this.capturedTransaction = null, e;
2508
- }
2509
- /**
2510
- * The callback over which to send transactions (state updates) produced by the view.
2511
- *
2512
- * @param transaction An editor state transaction
2513
- */
2514
- dispatchTransaction(t) {
2515
- if (this.view.isDestroyed)
2516
- return;
2517
- if (this.isCapturingTransaction) {
2518
- if (!this.capturedTransaction) {
2519
- this.capturedTransaction = t;
2520
- return;
2521
- }
2522
- t.steps.forEach((i) => {
2523
- var c;
2524
- return (c = this.capturedTransaction) === null || c === void 0 ? void 0 : c.step(i);
2525
- });
2526
- return;
2527
- }
2528
- const e = this.state.apply(t), r = !this.state.selection.eq(e.selection);
2529
- this.emit("beforeTransaction", {
2530
- editor: this,
2531
- transaction: t,
2532
- nextState: e
2533
- }), this.view.updateState(e), this.emit("transaction", {
2534
- editor: this,
2535
- transaction: t
2536
- }), r && this.emit("selectionUpdate", {
2537
- editor: this,
2538
- transaction: t
2539
- });
2540
- const o = t.getMeta("focus"), s = t.getMeta("blur");
2541
- o && this.emit("focus", {
2542
- editor: this,
2543
- event: o.event,
2544
- transaction: t
2545
- }), s && this.emit("blur", {
2546
- editor: this,
2547
- event: s.event,
2548
- transaction: t
2549
- }), !(!t.docChanged || t.getMeta("preventUpdate")) && this.emit("update", {
2550
- editor: this,
2551
- transaction: t
2552
- });
2553
- }
2554
- /**
2555
- * Get attributes of the currently selected node or mark.
2556
- */
2557
- getAttributes(t) {
2558
- return On(this.state, t);
2559
- }
2560
- isActive(t, e) {
2561
- const r = typeof t == "string" ? t : null, o = typeof t == "string" ? e : t;
2562
- return Bn(this.state, r, o);
2563
- }
2564
- /**
2565
- * Get the document as JSON.
2566
- */
2567
- getJSON() {
2568
- return this.state.doc.toJSON();
2569
- }
2570
- /**
2571
- * Get the document as HTML.
2572
- */
2573
- getHTML() {
2574
- return ut(this.state.doc.content, this.schema);
2575
- }
2576
- /**
2577
- * Get the document as text.
2578
- */
2579
- getText(t) {
2580
- const { blockSeparator: e = `
2581
-
2582
- `, textSerializers: r = {} } = t || {};
2583
- return An(this.state.doc, {
2584
- blockSeparator: e,
2585
- textSerializers: {
2586
- ...Ot(this.schema),
2587
- ...r
2588
- }
2589
- });
2590
- }
2591
- /**
2592
- * Check if there is no content.
2593
- */
2594
- get isEmpty() {
2595
- return mt(this.state.doc);
2596
- }
2597
- /**
2598
- * Get the number of characters for the current document.
2599
- *
2600
- * @deprecated
2601
- */
2602
- getCharacterCount() {
2603
- return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'), this.state.doc.content.size - 2;
2604
- }
2605
- /**
2606
- * Destroy the editor.
2607
- */
2608
- destroy() {
2609
- if (this.emit("destroy"), this.view) {
2610
- const t = this.view.dom;
2611
- t && t.editor && delete t.editor, this.view.destroy();
2612
- }
2613
- this.removeAllListeners();
2614
- }
2615
- /**
2616
- * Check if the editor is already destroyed.
2617
- */
2618
- get isDestroyed() {
2619
- var t;
2620
- return !(!((t = this.view) === null || t === void 0) && t.docView);
2621
- }
2622
- $node(t, e) {
2623
- var r;
2624
- return ((r = this.$doc) === null || r === void 0 ? void 0 : r.querySelector(t, e)) || null;
2625
- }
2626
- $nodes(t, e) {
2627
- var r;
2628
- return ((r = this.$doc) === null || r === void 0 ? void 0 : r.querySelectorAll(t, e)) || null;
2629
- }
2630
- $pos(t) {
2631
- const e = this.state.doc.resolve(t);
2632
- return new N(e, this);
2633
- }
2634
- get $doc() {
2635
- return this.$pos(0);
2636
- }
2637
- }
2638
- function Sr(n) {
2639
- return new Z({
2640
- find: n.find,
2641
- handler: ({ state: t, range: e, match: r }) => {
2642
- const o = b(n.getAttributes, void 0, r);
2643
- if (o === !1 || o === null)
2644
- return null;
2645
- const { tr: s } = t, i = r[r.length - 1], c = r[0];
2646
- if (i) {
2647
- const a = c.search(/\S/), l = e.from + c.indexOf(i), u = l + i.length;
2648
- if (Ft(e.from, e.to, t.doc).filter((p) => p.mark.type.excluded.find((h) => h === n.type && h !== p.mark.type)).filter((p) => p.to > l).length)
2649
- return null;
2650
- u < e.to && s.delete(u, e.to), l > e.from && s.delete(e.from + a, l);
2651
- const f = e.from + a + i.length;
2652
- s.addMark(e.from + a, f, n.type.create(o || {})), s.removeStoredMark(n.type);
2653
- }
2654
- }
2655
- });
2656
- }
2657
- function Er(n) {
2658
- return new Z({
2659
- find: n.find,
2660
- handler: ({ state: t, range: e, match: r }) => {
2661
- const o = b(n.getAttributes, void 0, r) || {}, { tr: s } = t, i = e.from;
2662
- let c = e.to;
2663
- const a = n.type.create(o);
2664
- if (r[1]) {
2665
- const l = r[0].lastIndexOf(r[1]);
2666
- let u = i + l;
2667
- u > c ? u = c : c = u + r[1].length;
2668
- const d = r[0][r[0].length - 1];
2669
- s.insertText(d, i + r[0].length - 1), s.replaceWith(u, c, a);
2670
- } else if (r[0]) {
2671
- const l = n.type.isInline ? i : i - 1;
2672
- s.insert(l, n.type.create(o)).delete(s.mapping.map(i), s.mapping.map(c));
2673
- }
2674
- s.scrollIntoView();
2675
- }
2676
- });
2677
- }
2678
- function xr(n) {
2679
- return new Z({
2680
- find: n.find,
2681
- handler: ({ state: t, range: e, match: r }) => {
2682
- const o = t.doc.resolve(e.from), s = b(n.getAttributes, void 0, r) || {};
2683
- if (!o.node(-1).canReplaceWith(o.index(-1), o.indexAfter(-1), n.type))
2684
- return null;
2685
- t.tr.delete(e.from, e.to).setBlockType(e.from, e.from, n.type, s);
2686
- }
2687
- });
2688
- }
2689
- function Cr(n) {
2690
- return new Z({
2691
- find: n.find,
2692
- handler: ({ state: t, range: e, match: r, chain: o }) => {
2693
- const s = b(n.getAttributes, void 0, r) || {}, i = t.tr.delete(e.from, e.to), a = i.doc.resolve(e.from).blockRange(), l = a && Ut(a, n.type, s);
2694
- if (!l)
2695
- return null;
2696
- if (i.wrap(a, l), n.keepMarks && n.editor) {
2697
- const { selection: d, storedMarks: f } = t, { splittableMarks: p } = n.editor.extensionManager, m = f || d.$to.parentOffset && d.$from.marks();
2698
- if (m) {
2699
- const h = m.filter((g) => p.includes(g.type.name));
2700
- i.ensureMarks(h);
2701
- }
2702
- }
2703
- if (n.keepAttributes) {
2704
- const d = n.type.name === "bulletList" || n.type.name === "orderedList" ? "listItem" : "taskList";
2705
- o().updateAttributes(d, s).run();
2706
- }
2707
- const u = i.doc.resolve(e.from - 1).nodeBefore;
2708
- u && u.type === n.type && dt(i.doc, e.from - 1) && (!n.joinPredicate || n.joinPredicate(r, u)) && i.join(e.from - 1);
2709
- }
2710
- });
2711
- }
2712
- class lt {
2713
- constructor(t = {}) {
2714
- this.type = "node", this.name = "node", this.parent = null, this.child = null, this.config = {
2715
- name: this.name,
2716
- defaultOptions: {}
2717
- }, this.config = {
2718
- ...this.config,
2719
- ...t
2720
- }, this.name = this.config.name, t.defaultOptions && Object.keys(t.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`), this.options = this.config.defaultOptions, this.config.addOptions && (this.options = b(k(this, "addOptions", {
2721
- name: this.name
2722
- }))), this.storage = b(k(this, "addStorage", {
2723
- name: this.name,
2724
- options: this.options
2725
- })) || {};
2726
- }
2727
- static create(t = {}) {
2728
- return new lt(t);
2729
- }
2730
- configure(t = {}) {
2731
- const e = this.extend({
2732
- ...this.config,
2733
- addOptions: () => tt(this.options, t)
2734
- });
2735
- return e.name = this.name, e.parent = this.parent, e;
2736
- }
2737
- extend(t = {}) {
2738
- const e = new lt(t);
2739
- return e.parent = this, this.child = e, e.name = t.name ? t.name : e.parent.name, t.defaultOptions && Object.keys(t.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${e.name}".`), e.options = b(k(e, "addOptions", {
2740
- name: e.name
2741
- })), e.storage = b(k(e, "addStorage", {
2742
- name: e.name,
2743
- options: e.options
2744
- })), e;
2745
- }
2746
- }
2747
- function Tr(n) {
2748
- return new Ae({
2749
- find: n.find,
2750
- handler: ({ state: t, range: e, match: r, pasteEvent: o }) => {
2751
- const s = b(n.getAttributes, void 0, r, o);
2752
- if (s === !1 || s === null)
2753
- return null;
2754
- const { tr: i } = t, c = r[r.length - 1], a = r[0];
2755
- let l = e.to;
2756
- if (c) {
2757
- const u = a.search(/\S/), d = e.from + a.indexOf(c), f = d + c.length;
2758
- if (Ft(e.from, e.to, t.doc).filter((m) => m.mark.type.excluded.find((g) => g === n.type && g !== m.mark.type)).filter((m) => m.to > d).length)
2759
- return null;
2760
- f < e.to && i.delete(f, e.to), d > e.from && i.delete(e.from + u, d), l = e.from + u + c.length, i.addMark(e.from + u, l, n.type.create(s || {})), i.removeStoredMark(n.type);
2761
- }
2762
- }
2763
- });
2764
- }
2765
- function Ar(n, t) {
2766
- const { selection: e } = n, { $from: r } = e;
2767
- if (e instanceof J) {
2768
- const s = r.index();
2769
- return r.parent.canReplaceWith(s, s + 1, t);
2770
- }
2771
- let o = r.depth;
2772
- for (; o >= 0; ) {
2773
- const s = r.index(o);
2774
- if (r.node(o).contentMatchAt(s).matchType(t))
2775
- return !0;
2776
- o -= 1;
2777
- }
2778
- return !1;
2779
- }
2780
- export {
2781
- Q as CommandManager,
2782
- Mr as Editor,
2783
- C as Extension,
2784
- Z as InputRule,
2785
- U as Mark,
2786
- lt as Node,
2787
- N as NodePos,
2788
- Ae as PasteRule,
2789
- b as callOrReturn,
2790
- Ar as canInsertNode,
2791
- yr as combineTransactionSteps,
2792
- Y as createChainableState,
2793
- at as createDocument,
2794
- D as createNodeFromContent,
2795
- lr as createStyleTag,
2796
- Cn as defaultBlockAt,
2797
- Mt as deleteProps,
2798
- W as elementFromString,
2799
- kr as findChildrenInRange,
2800
- Be as findDuplicates,
2801
- ht as findParentNode,
2802
- Tn as findParentNodeClosestToPos,
2803
- we as fromString,
2804
- On as getAttributes,
2805
- Tt as getAttributesFromExtensions,
2806
- br as getChangedRanges,
2807
- k as getExtensionField,
2808
- ut as getHTMLFromFragment,
2809
- Rt as getMarkAttributes,
2810
- pt as getMarkRange,
2811
- B as getMarkType,
2812
- Ft as getMarksBetween,
2813
- Pn as getNodeAttributes,
2814
- S as getNodeType,
2815
- it as getRenderedAttributes,
2816
- Me as getSchemaByResolvedExtensions,
2817
- rt as getSchemaTypeByName,
2818
- et as getSchemaTypeNameByName,
2819
- K as getSplittedAttributes,
2820
- An as getText,
2821
- Pt as getTextBetween,
2822
- Se as getTextContentFromNodes,
2823
- Ot as getTextSerializersFromSchema,
2824
- yt as injectExtensionAttributesToParseRule,
2825
- xe as inputRulesPlugin,
2826
- Bn as isActive,
2827
- ve as isEmptyObject,
2828
- bt as isExtensionRulesEnabled,
2829
- At as isFunction,
2830
- St as isList,
2831
- jt as isMacOS,
2832
- ct as isMarkActive,
2833
- L as isNodeActive,
2834
- mt as isNodeEmpty,
2835
- vr as isNodeSelection,
2836
- Te as isNumber,
2837
- H as isPlainObject,
2838
- ft as isRegExp,
2839
- Je as isSafari,
2840
- $t as isTextSelection,
2841
- G as isiOS,
2842
- Sr as markInputRule,
2843
- Tr as markPasteRule,
2844
- be as mergeAttributes,
2845
- tt as mergeDeep,
2846
- O as minMax,
2847
- Er as nodeInputRule,
2848
- q as objectIncludes,
2849
- $e as pasteRulesPlugin,
2850
- wr as posToDOMRect,
2851
- In as removeDuplicates,
2852
- Bt as resolveFocusPosition,
2853
- Ze as selectionToInsertionEnd,
2854
- X as splitExtensions,
2855
- xr as textblockTypeInputRule,
2856
- Cr as wrappingInputRule
2857
- };