@yoopta/editor 4.9.9 → 6.0.0-beta.1

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 (347) hide show
  1. package/README.md +12 -3
  2. package/dist/components/Block/Block.d.ts +3 -4
  3. package/dist/components/Block/Block.d.ts.map +1 -1
  4. package/dist/components/Block/hooks.d.ts +3 -1706
  5. package/dist/components/Block/hooks.d.ts.map +1 -1
  6. package/dist/components/Editor/render-blocks.d.ts +11 -0
  7. package/dist/components/Editor/render-blocks.d.ts.map +1 -0
  8. package/dist/components/Editor/{Editor.d.ts → render-editor.d.ts} +3 -3
  9. package/dist/components/Editor/render-editor.d.ts.map +1 -0
  10. package/dist/components/Editor/selection.d.ts +1 -1
  11. package/dist/components/Editor/selection.d.ts.map +1 -1
  12. package/dist/components/Editor/utils.d.ts +1 -1
  13. package/dist/components/Editor/utils.d.ts.map +1 -1
  14. package/dist/components/SelectionBox/SelectionBox.d.ts +1 -1
  15. package/dist/components/SelectionBox/SelectionBox.d.ts.map +1 -1
  16. package/dist/components/SelectionBox/hooks.d.ts +2 -2
  17. package/dist/components/SelectionBox/hooks.d.ts.map +1 -1
  18. package/dist/components/{TextLeaf/TextLeaf.d.ts → text-leaf/text-leaf.d.ts} +2 -2
  19. package/dist/components/text-leaf/text-leaf.d.ts.map +1 -0
  20. package/dist/contexts/YooptaContext/YooptaContext.d.ts +3 -3
  21. package/dist/contexts/YooptaContext/YooptaContext.d.ts.map +1 -1
  22. package/dist/editor/blocks/buildBlockData.d.ts +1 -1
  23. package/dist/editor/blocks/buildBlockData.d.ts.map +1 -1
  24. package/dist/editor/blocks/decreaseBlockDepth.d.ts +2 -2
  25. package/dist/editor/blocks/decreaseBlockDepth.d.ts.map +1 -1
  26. package/dist/editor/blocks/deleteBlock.d.ts +46 -15
  27. package/dist/editor/blocks/deleteBlock.d.ts.map +1 -1
  28. package/dist/editor/blocks/deleteBlock.test.d.ts +2 -0
  29. package/dist/editor/blocks/deleteBlock.test.d.ts.map +1 -0
  30. package/dist/editor/blocks/duplicateBlock.d.ts +45 -10
  31. package/dist/editor/blocks/duplicateBlock.d.ts.map +1 -1
  32. package/dist/editor/blocks/duplicateBlock.test.d.ts +2 -0
  33. package/dist/editor/blocks/duplicateBlock.test.d.ts.map +1 -0
  34. package/dist/editor/blocks/focusBlock.d.ts +1 -1
  35. package/dist/editor/blocks/focusBlock.d.ts.map +1 -1
  36. package/dist/editor/blocks/getBlock.d.ts +2 -2
  37. package/dist/editor/blocks/getBlock.d.ts.map +1 -1
  38. package/dist/editor/blocks/getBlockSlate.d.ts +2 -2
  39. package/dist/editor/blocks/getBlockSlate.d.ts.map +1 -1
  40. package/dist/editor/blocks/increaseBlockDepth.d.ts +1 -1
  41. package/dist/editor/blocks/increaseBlockDepth.d.ts.map +1 -1
  42. package/dist/editor/blocks/index.d.ts +9 -9
  43. package/dist/editor/blocks/index.d.ts.map +1 -1
  44. package/dist/editor/blocks/insertBlock.d.ts +28 -1
  45. package/dist/editor/blocks/insertBlock.d.ts.map +1 -1
  46. package/dist/editor/blocks/mergeBlock.d.ts +48 -2
  47. package/dist/editor/blocks/mergeBlock.d.ts.map +1 -1
  48. package/dist/editor/blocks/mergeBlock.test.d.ts +2 -0
  49. package/dist/editor/blocks/mergeBlock.test.d.ts.map +1 -0
  50. package/dist/editor/blocks/moveBlock.d.ts +1 -1
  51. package/dist/editor/blocks/moveBlock.d.ts.map +1 -1
  52. package/dist/editor/blocks/splitBlock.d.ts +51 -3
  53. package/dist/editor/blocks/splitBlock.d.ts.map +1 -1
  54. package/dist/editor/blocks/splitBlock.test.d.ts +2 -0
  55. package/dist/editor/blocks/splitBlock.test.d.ts.map +1 -0
  56. package/dist/editor/blocks/toggleBlock.d.ts +51 -5
  57. package/dist/editor/blocks/toggleBlock.d.ts.map +1 -1
  58. package/dist/editor/blocks/toggleBlock.test.d.ts +2 -0
  59. package/dist/editor/blocks/toggleBlock.test.d.ts.map +1 -0
  60. package/dist/editor/blocks/updateBlock.d.ts +1 -1
  61. package/dist/editor/blocks/updateBlock.d.ts.map +1 -1
  62. package/dist/editor/core/applyTransforms.d.ts +2 -2
  63. package/dist/editor/core/applyTransforms.d.ts.map +1 -1
  64. package/dist/editor/core/batchOperations.d.ts +1 -1
  65. package/dist/editor/core/batchOperations.d.ts.map +1 -1
  66. package/dist/editor/core/blur.d.ts +1 -1
  67. package/dist/editor/core/blur.d.ts.map +1 -1
  68. package/dist/editor/core/focus.d.ts +1 -1
  69. package/dist/editor/core/focus.d.ts.map +1 -1
  70. package/dist/editor/core/getEditorValue.d.ts +1 -1
  71. package/dist/editor/core/getEditorValue.d.ts.map +1 -1
  72. package/dist/editor/core/history.d.ts +4 -4
  73. package/dist/editor/core/history.d.ts.map +1 -1
  74. package/dist/editor/core/isEmpty.d.ts +1 -1
  75. package/dist/editor/core/isEmpty.d.ts.map +1 -1
  76. package/dist/editor/core/isFocused.d.ts +1 -1
  77. package/dist/editor/core/isFocused.d.ts.map +1 -1
  78. package/dist/editor/core/setEditorValue.d.ts +1 -1
  79. package/dist/editor/core/setEditorValue.d.ts.map +1 -1
  80. package/dist/editor/elements/create-element-structure.d.ts +150 -0
  81. package/dist/editor/elements/create-element-structure.d.ts.map +1 -0
  82. package/dist/editor/elements/create-element-structure.test.d.ts +2 -0
  83. package/dist/editor/elements/create-element-structure.test.d.ts.map +1 -0
  84. package/dist/editor/elements/deleteElement.d.ts +78 -7
  85. package/dist/editor/elements/deleteElement.d.ts.map +1 -1
  86. package/dist/editor/elements/getElement.d.ts +26 -4
  87. package/dist/editor/elements/getElement.d.ts.map +1 -1
  88. package/dist/editor/elements/getElement.test.d.ts +2 -0
  89. package/dist/editor/elements/getElement.test.d.ts.map +1 -0
  90. package/dist/editor/elements/getElementChildren.d.ts +20 -4
  91. package/dist/editor/elements/getElementChildren.d.ts.map +1 -1
  92. package/dist/editor/elements/getElementChildren.test.d.ts +2 -0
  93. package/dist/editor/elements/getElementChildren.test.d.ts.map +1 -0
  94. package/dist/editor/elements/getElementEntry.d.ts +26 -7
  95. package/dist/editor/elements/getElementEntry.d.ts.map +1 -1
  96. package/dist/editor/elements/getElementEntry.test.d.ts +2 -0
  97. package/dist/editor/elements/getElementEntry.test.d.ts.map +1 -0
  98. package/dist/editor/elements/getElementPath.d.ts +20 -3
  99. package/dist/editor/elements/getElementPath.d.ts.map +1 -1
  100. package/dist/editor/elements/getElementPath.test.d.ts +2 -0
  101. package/dist/editor/elements/getElementPath.test.d.ts.map +1 -0
  102. package/dist/editor/elements/getElements.d.ts +26 -0
  103. package/dist/editor/elements/getElements.d.ts.map +1 -0
  104. package/dist/editor/elements/getElements.test.d.ts +2 -0
  105. package/dist/editor/elements/getElements.test.d.ts.map +1 -0
  106. package/dist/editor/elements/getParentElementPath.d.ts +20 -3
  107. package/dist/editor/elements/getParentElementPath.d.ts.map +1 -1
  108. package/dist/editor/elements/getParentElementPath.test.d.ts +2 -0
  109. package/dist/editor/elements/getParentElementPath.test.d.ts.map +1 -0
  110. package/dist/editor/elements/htmlElToSlateNode.d.ts +4 -0
  111. package/dist/editor/elements/htmlElToSlateNode.d.ts.map +1 -0
  112. package/dist/editor/elements/index.d.ts +10 -9
  113. package/dist/editor/elements/index.d.ts.map +1 -1
  114. package/dist/editor/elements/insertElement.d.ts +22 -0
  115. package/dist/editor/elements/insertElement.d.ts.map +1 -0
  116. package/dist/editor/elements/insertElement.test.d.ts +2 -0
  117. package/dist/editor/elements/insertElement.test.d.ts.map +1 -0
  118. package/dist/editor/elements/isElementEmpty.d.ts +20 -7
  119. package/dist/editor/elements/isElementEmpty.d.ts.map +1 -1
  120. package/dist/editor/elements/isElementEmpty.test.d.ts +2 -0
  121. package/dist/editor/elements/isElementEmpty.test.d.ts.map +1 -0
  122. package/dist/editor/elements/types.d.ts +73 -0
  123. package/dist/editor/elements/types.d.ts.map +1 -0
  124. package/dist/editor/elements/updateElement.d.ts +69 -7
  125. package/dist/editor/elements/updateElement.d.ts.map +1 -1
  126. package/dist/editor/index.d.ts +1 -2
  127. package/dist/editor/index.d.ts.map +1 -1
  128. package/dist/editor/paths/getBlockOrder.d.ts +3 -0
  129. package/dist/editor/paths/getBlockOrder.d.ts.map +1 -0
  130. package/dist/editor/paths/getNextBlockOrder.d.ts +3 -0
  131. package/dist/editor/paths/getNextBlockOrder.d.ts.map +1 -0
  132. package/dist/editor/paths/getPreviousBlockOrder.d.ts +3 -0
  133. package/dist/editor/paths/getPreviousBlockOrder.d.ts.map +1 -0
  134. package/dist/editor/paths/getSelectedPaths.d.ts +1 -1
  135. package/dist/editor/paths/getSelectedPaths.d.ts.map +1 -1
  136. package/dist/editor/paths/index.d.ts +10 -8
  137. package/dist/editor/paths/index.d.ts.map +1 -1
  138. package/dist/editor/paths/isBlockSelected.d.ts +1 -1
  139. package/dist/editor/paths/isBlockSelected.d.ts.map +1 -1
  140. package/dist/editor/paths/isPathEmpty.d.ts +1 -1
  141. package/dist/editor/paths/isPathEmpty.d.ts.map +1 -1
  142. package/dist/editor/paths/setPath.d.ts +1 -1
  143. package/dist/editor/paths/setPath.d.ts.map +1 -1
  144. package/dist/editor/selection/getAnchor.d.ts +20 -0
  145. package/dist/editor/selection/getAnchor.d.ts.map +1 -0
  146. package/dist/editor/selection/getCurrent.d.ts +20 -0
  147. package/dist/editor/selection/getCurrent.d.ts.map +1 -0
  148. package/dist/editor/selection/getEnd.d.ts +20 -0
  149. package/dist/editor/selection/getEnd.d.ts.map +1 -0
  150. package/dist/editor/selection/getFirstPoint.d.ts +23 -0
  151. package/dist/editor/selection/getFirstPoint.d.ts.map +1 -0
  152. package/dist/editor/selection/getFocus.d.ts +20 -0
  153. package/dist/editor/selection/getFocus.d.ts.map +1 -0
  154. package/dist/editor/selection/getLastPoint.d.ts +23 -0
  155. package/dist/editor/selection/getLastPoint.d.ts.map +1 -0
  156. package/dist/editor/selection/getNext.d.ts +20 -0
  157. package/dist/editor/selection/getNext.d.ts.map +1 -0
  158. package/dist/editor/selection/getPrevious.d.ts +20 -0
  159. package/dist/editor/selection/getPrevious.d.ts.map +1 -0
  160. package/dist/editor/selection/getRange.d.ts +21 -0
  161. package/dist/editor/selection/getRange.d.ts.map +1 -0
  162. package/dist/editor/selection/getSelected.d.ts +20 -0
  163. package/dist/editor/selection/getSelected.d.ts.map +1 -0
  164. package/dist/editor/selection/getSlateSelection.d.ts +23 -0
  165. package/dist/editor/selection/getSlateSelection.d.ts.map +1 -0
  166. package/dist/editor/selection/getStart.d.ts +20 -0
  167. package/dist/editor/selection/getStart.d.ts.map +1 -0
  168. package/dist/editor/selection/index.d.ts +43 -0
  169. package/dist/editor/selection/index.d.ts.map +1 -0
  170. package/dist/editor/selection/isBlockSelected.d.ts +23 -0
  171. package/dist/editor/selection/isBlockSelected.d.ts.map +1 -0
  172. package/dist/editor/selection/isCollapsed.d.ts +20 -0
  173. package/dist/editor/selection/isCollapsed.d.ts.map +1 -0
  174. package/dist/editor/selection/isEmpty.d.ts +14 -0
  175. package/dist/editor/selection/isEmpty.d.ts.map +1 -0
  176. package/dist/editor/selection/isExpanded.d.ts +20 -0
  177. package/dist/editor/selection/isExpanded.d.ts.map +1 -0
  178. package/dist/editor/selection/setCurrent.d.ts +22 -0
  179. package/dist/editor/selection/setCurrent.d.ts.map +1 -0
  180. package/dist/editor/selection/setSelected.d.ts +25 -0
  181. package/dist/editor/selection/setSelected.d.ts.map +1 -0
  182. package/dist/editor/selection/setSlateSelection.d.ts +24 -0
  183. package/dist/editor/selection/setSlateSelection.d.ts.map +1 -0
  184. package/dist/editor/selection/types.d.ts +128 -0
  185. package/dist/editor/selection/types.d.ts.map +1 -0
  186. package/dist/editor/textFormats/addMark.d.ts +33 -0
  187. package/dist/editor/textFormats/addMark.d.ts.map +1 -0
  188. package/dist/editor/textFormats/clearMarks.d.ts +27 -0
  189. package/dist/editor/textFormats/clearMarks.d.ts.map +1 -0
  190. package/dist/editor/textFormats/getMarks.d.ts +20 -0
  191. package/dist/editor/textFormats/getMarks.d.ts.map +1 -0
  192. package/dist/editor/textFormats/getValue.d.ts +22 -2
  193. package/dist/editor/textFormats/getValue.d.ts.map +1 -1
  194. package/dist/editor/textFormats/index.d.ts +21 -0
  195. package/dist/editor/textFormats/index.d.ts.map +1 -0
  196. package/dist/editor/textFormats/isActive.d.ts +22 -2
  197. package/dist/editor/textFormats/isActive.d.ts.map +1 -1
  198. package/dist/editor/textFormats/removeMark.d.ts +28 -0
  199. package/dist/editor/textFormats/removeMark.d.ts.map +1 -0
  200. package/dist/editor/textFormats/toggle.d.ts +33 -2
  201. package/dist/editor/textFormats/toggle.d.ts.map +1 -1
  202. package/dist/editor/textFormats/types.d.ts +177 -0
  203. package/dist/editor/textFormats/types.d.ts.map +1 -0
  204. package/dist/editor/textFormats/update.d.ts +32 -2
  205. package/dist/editor/textFormats/update.d.ts.map +1 -1
  206. package/dist/editor/types.d.ts +54 -30
  207. package/dist/editor/types.d.ts.map +1 -1
  208. package/dist/extensions/shortcuts.d.ts +6 -2
  209. package/dist/extensions/shortcuts.d.ts.map +1 -1
  210. package/dist/handlers/index.d.ts +1 -1
  211. package/dist/handlers/index.d.ts.map +1 -1
  212. package/dist/handlers/onKeyDown.d.ts +1 -2
  213. package/dist/handlers/onKeyDown.d.ts.map +1 -1
  214. package/dist/index.d.ts +14 -10
  215. package/dist/index.d.ts.map +1 -1
  216. package/dist/index.js +1 -6
  217. package/dist/marks/index.d.ts +1 -1
  218. package/dist/marks/index.d.ts.map +1 -1
  219. package/dist/parsers/deserializeHTML.d.ts +1 -1
  220. package/dist/parsers/deserializeHTML.d.ts.map +1 -1
  221. package/dist/parsers/deserializeTextNodes.d.ts +2 -2
  222. package/dist/parsers/deserializeTextNodes.d.ts.map +1 -1
  223. package/dist/parsers/getEmail.d.ts +2 -4
  224. package/dist/parsers/getEmail.d.ts.map +1 -1
  225. package/dist/parsers/getHTML.d.ts +1 -1
  226. package/dist/parsers/getHTML.d.ts.map +1 -1
  227. package/dist/parsers/getMarkdown.d.ts +1 -1
  228. package/dist/parsers/getMarkdown.d.ts.map +1 -1
  229. package/dist/parsers/getPlainText.d.ts +1 -1
  230. package/dist/parsers/getPlainText.d.ts.map +1 -1
  231. package/dist/plugins/build-plugin-elements.d.ts +13 -0
  232. package/dist/plugins/build-plugin-elements.d.ts.map +1 -0
  233. package/dist/plugins/build-plugin-elements.test.d.ts +2 -0
  234. package/dist/plugins/build-plugin-elements.test.d.ts.map +1 -0
  235. package/dist/plugins/create-yoopta-plugin.d.ts +32 -0
  236. package/dist/plugins/create-yoopta-plugin.d.ts.map +1 -0
  237. package/dist/plugins/create-yoopta-plugin.test.d.ts +2 -0
  238. package/dist/plugins/create-yoopta-plugin.test.d.ts.map +1 -0
  239. package/dist/plugins/extenstions/{withInlines.d.ts → with-inlines.d.ts} +2 -2
  240. package/dist/plugins/extenstions/with-inlines.d.ts.map +1 -0
  241. package/dist/plugins/hooks.d.ts +4 -4
  242. package/dist/plugins/hooks.d.ts.map +1 -1
  243. package/dist/plugins/index.d.ts +1 -1
  244. package/dist/plugins/index.d.ts.map +1 -1
  245. package/dist/plugins/slate-editor-component.d.ts +12 -0
  246. package/dist/plugins/slate-editor-component.d.ts.map +1 -0
  247. package/dist/plugins/types.d.ts +32 -21
  248. package/dist/plugins/types.d.ts.map +1 -1
  249. package/dist/utils/{blockElements.d.ts → block-elements.d.ts} +16 -7
  250. package/dist/utils/block-elements.d.ts.map +1 -0
  251. package/dist/utils/build-slate.d.ts +4 -0
  252. package/dist/utils/build-slate.d.ts.map +1 -0
  253. package/dist/utils/{editorBuilders.d.ts → editor-builders.d.ts} +4 -6
  254. package/dist/utils/editor-builders.d.ts.map +1 -0
  255. package/dist/utils/editor-builders.test.d.ts +2 -0
  256. package/dist/utils/editor-builders.test.d.ts.map +1 -0
  257. package/dist/utils/enter-action.d.ts +40 -0
  258. package/dist/utils/enter-action.d.ts.map +1 -0
  259. package/dist/utils/enter-action.test.d.ts +2 -0
  260. package/dist/utils/enter-action.test.d.ts.map +1 -0
  261. package/dist/utils/execute-backspace-action.d.ts +29 -0
  262. package/dist/utils/execute-backspace-action.d.ts.map +1 -0
  263. package/dist/utils/execute-backspace-action.test.d.ts +2 -0
  264. package/dist/utils/execute-backspace-action.test.d.ts.map +1 -0
  265. package/dist/utils/findSlateBySelectionPath.d.ts +1 -1
  266. package/dist/utils/findSlateBySelectionPath.d.ts.map +1 -1
  267. package/dist/utils/generateId.d.ts.map +1 -1
  268. package/dist/utils/get-block-plugins.d.ts +4 -0
  269. package/dist/utils/get-block-plugins.d.ts.map +1 -0
  270. package/dist/utils/get-block-plugins.test.d.ts +2 -0
  271. package/dist/utils/get-block-plugins.test.d.ts.map +1 -0
  272. package/dist/utils/get-next-hierarchical-selection.d.ts +20 -0
  273. package/dist/utils/get-next-hierarchical-selection.d.ts.map +1 -0
  274. package/dist/utils/get-next-hierarchical-selection.test.d.ts +2 -0
  275. package/dist/utils/get-next-hierarchical-selection.test.d.ts.map +1 -0
  276. package/dist/utils/get-node-points.d.ts +5 -0
  277. package/dist/utils/get-node-points.d.ts.map +1 -0
  278. package/dist/utils/get-node-points.test.d.ts +2 -0
  279. package/dist/utils/get-node-points.test.d.ts.map +1 -0
  280. package/dist/utils/getMaxOffsetInElement.d.ts.map +1 -1
  281. package/dist/utils/invariant.d.ts +2 -0
  282. package/dist/utils/invariant.d.ts.map +1 -0
  283. package/dist/utils/types.d.ts.map +1 -1
  284. package/dist/utils/validations.d.ts +3 -0
  285. package/dist/utils/validations.d.ts.map +1 -0
  286. package/dist/utils/weakMaps.d.ts +1 -2
  287. package/dist/utils/weakMaps.d.ts.map +1 -1
  288. package/dist/yoopta-editor.d.ts +28 -0
  289. package/dist/yoopta-editor.d.ts.map +1 -0
  290. package/package.json +11 -11
  291. package/dist/UI/BlockOptions/BlockOptions.d.ts +0 -25
  292. package/dist/UI/BlockOptions/BlockOptions.d.ts.map +0 -1
  293. package/dist/UI/BlockOptions/utils.d.ts +0 -33
  294. package/dist/UI/BlockOptions/utils.d.ts.map +0 -1
  295. package/dist/UI/ExtendedBlockActions/ExtendedBlockActions.d.ts +0 -11
  296. package/dist/UI/ExtendedBlockActions/ExtendedBlockActions.d.ts.map +0 -1
  297. package/dist/UI/Overlay/Overlay.d.ts +0 -12
  298. package/dist/UI/Overlay/Overlay.d.ts.map +0 -1
  299. package/dist/UI/Portal/Portal.d.ts +0 -8
  300. package/dist/UI/Portal/Portal.d.ts.map +0 -1
  301. package/dist/UI/index.d.ts +0 -38
  302. package/dist/UI/index.d.ts.map +0 -1
  303. package/dist/YooptaEditor.d.ts +0 -30
  304. package/dist/YooptaEditor.d.ts.map +0 -1
  305. package/dist/components/Block/FloatingBlockActions.d.ts +0 -14
  306. package/dist/components/Block/FloatingBlockActions.d.ts.map +0 -1
  307. package/dist/components/Editor/Editor.d.ts.map +0 -1
  308. package/dist/components/Editor/RenderBlocks.d.ts +0 -10
  309. package/dist/components/Editor/RenderBlocks.d.ts.map +0 -1
  310. package/dist/components/Editor/dnd.d.ts +0 -10
  311. package/dist/components/Editor/dnd.d.ts.map +0 -1
  312. package/dist/components/TextLeaf/TextLeaf.d.ts.map +0 -1
  313. package/dist/contexts/YooptaContext/ToolsContext.d.ts +0 -23
  314. package/dist/contexts/YooptaContext/ToolsContext.d.ts.map +0 -1
  315. package/dist/editor/elements/createElement.d.ts +0 -13
  316. package/dist/editor/elements/createElement.d.ts.map +0 -1
  317. package/dist/editor/elements/insertElementText.d.ts +0 -7
  318. package/dist/editor/elements/insertElementText.d.ts.map +0 -1
  319. package/dist/editor/paths/getNextPath.d.ts +0 -3
  320. package/dist/editor/paths/getNextPath.d.ts.map +0 -1
  321. package/dist/editor/paths/getPath.d.ts +0 -3
  322. package/dist/editor/paths/getPath.d.ts.map +0 -1
  323. package/dist/editor/paths/getPreviousPath.d.ts +0 -3
  324. package/dist/editor/paths/getPreviousPath.d.ts.map +0 -1
  325. package/dist/marks/FakeSelectionMark.d.ts +0 -5
  326. package/dist/marks/FakeSelectionMark.d.ts.map +0 -1
  327. package/dist/plugins/SlateEditorComponent.d.ts +0 -13
  328. package/dist/plugins/SlateEditorComponent.d.ts.map +0 -1
  329. package/dist/plugins/createYooptaPlugin.d.ts +0 -25
  330. package/dist/plugins/createYooptaPlugin.d.ts.map +0 -1
  331. package/dist/plugins/extenstions/withInlines.d.ts.map +0 -1
  332. package/dist/utils/blockElements.d.ts.map +0 -1
  333. package/dist/utils/buildSlate.d.ts +0 -3
  334. package/dist/utils/buildSlate.d.ts.map +0 -1
  335. package/dist/utils/deepClone.d.ts +0 -2
  336. package/dist/utils/deepClone.d.ts.map +0 -1
  337. package/dist/utils/editorBuilders.d.ts.map +0 -1
  338. package/dist/utils/findPluginBlockByPath.d.ts +0 -5
  339. package/dist/utils/findPluginBlockByPath.d.ts.map +0 -1
  340. package/dist/utils/getLastNodePoint.d.ts +0 -9
  341. package/dist/utils/getLastNodePoint.d.ts.map +0 -1
  342. package/dist/utils/throttle.d.ts +0 -8
  343. package/dist/utils/throttle.d.ts.map +0 -1
  344. package/dist/utils/validateYooptaValue.d.ts +0 -2
  345. package/dist/utils/validateYooptaValue.d.ts.map +0 -1
  346. package/dist/utils/validators.d.ts +0 -2
  347. package/dist/utils/validators.d.ts.map +0 -1
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=splitBlock.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"splitBlock.test.d.ts","sourceRoot":"","sources":["../../../src/editor/blocks/splitBlock.test.ts"],"names":[],"mappings":""}
@@ -1,10 +1,56 @@
1
- import { YooEditor, SlateEditor, FocusAt, YooptaPathIndex } from '../types';
1
+ import type { SlateElement, YooEditor, YooptaPathIndex } from '../types';
2
2
  export type ToggleBlockOptions = {
3
+ /**
4
+ * Position of the block to toggle
5
+ * @default editor.path.current
6
+ */
3
7
  at?: YooptaPathIndex;
4
- deleteText?: boolean;
5
- slate?: SlateEditor;
8
+ /**
9
+ * Scope of the toggle operation:
10
+ * - 'auto': automatically determine from context (default)
11
+ * - 'block': transform the entire block (Paragraph → Heading)
12
+ * - 'element': insert element in current leaf with injectElementsFromPlugins
13
+ *
14
+ * @default 'auto'
15
+ */
16
+ scope?: 'auto' | 'block' | 'element';
17
+ /**
18
+ * Whether to preserve existing content
19
+ * - true: keep text and transfer to new block/element
20
+ * - false: start with empty content
21
+ * @default true
22
+ */
23
+ preserveContent?: boolean;
24
+ /**
25
+ * Focus after toggle
26
+ * @default false
27
+ */
6
28
  focus?: boolean;
7
- focusAt?: FocusAt;
29
+ /**
30
+ * Custom element structure created with editor.y()
31
+ * If provided, this will be used instead of default structure
32
+ */
33
+ elements?: SlateElement;
8
34
  };
9
- export declare function toggleBlock(editor: YooEditor, toBlockTypeArg: string, options?: ToggleBlockOptions): string;
35
+ /**
36
+ * Toggle block type or insert element in leaf with injectElementsFromPlugins
37
+ *
38
+ * Behavior depends on scope:
39
+ * - scope: 'block' → transforms the block (Paragraph → Heading)
40
+ * - scope: 'element' → inserts element in current leaf with injectElementsFromPlugins
41
+ * - scope: 'auto' → automatically determines based on context
42
+ *
43
+ * @example
44
+ * // Transform block
45
+ * editor.toggleBlock('Heading', { preserveContent: true });
46
+ *
47
+ * // Insert element in leaf
48
+ * editor.toggleBlock('Paragraph', { scope: 'element', preserveContent: false });
49
+ *
50
+ * // With custom structure
51
+ * editor.toggleBlock('Accordion', {
52
+ * elements: editor.y('accordion-list', { ... })
53
+ * });
54
+ */
55
+ export declare function toggleBlock(editor: YooEditor, type: string, options?: ToggleBlockOptions): string;
10
56
  //# sourceMappingURL=toggleBlock.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"toggleBlock.d.ts","sourceRoot":"","sources":["../../../src/editor/blocks/toggleBlock.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,SAAS,EAAmB,WAAW,EAAE,OAAO,EAAgB,eAAe,EAAE,MAAM,UAAU,CAAC;AAE3G,MAAM,MAAM,kBAAkB,GAAG;IAC/B,EAAE,CAAC,EAAE,eAAe,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAoCF,wBAAgB,WAAW,CAAC,MAAM,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,EAAE,OAAO,GAAE,kBAAuB,UAkDtG"}
1
+ {"version":3,"file":"toggleBlock.d.ts","sourceRoot":"","sources":["../../../src/editor/blocks/toggleBlock.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAEV,YAAY,EACZ,SAAS,EAET,eAAe,EAChB,MAAM,UAAU,CAAC;AAIlB,MAAM,MAAM,kBAAkB,GAAG;IAC/B;;;OAGG;IACH,EAAE,CAAC,EAAE,eAAe,CAAC;IAErB;;;;;;;OAOG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;IAErC;;;;;OAKG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAE1B;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB;;;OAGG;IACH,QAAQ,CAAC,EAAE,YAAY,CAAC;CACzB,CAAC;AAsOF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,WAAW,CACzB,MAAM,EAAE,SAAS,EACjB,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,kBAAuB,GAC/B,MAAM,CAkBR"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=toggleBlock.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toggleBlock.test.d.ts","sourceRoot":"","sources":["../../../src/editor/blocks/toggleBlock.test.ts"],"names":[],"mappings":""}
@@ -1,3 +1,3 @@
1
- import { YooEditor, YooptaBlockData } from '../types';
1
+ import type { YooEditor, YooptaBlockData } from '../types';
2
2
  export declare function updateBlock(editor: YooEditor, blockId: string, newData: Omit<Partial<YooptaBlockData>, 'id' | 'type'>): void;
3
3
  //# sourceMappingURL=updateBlock.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"updateBlock.d.ts","sourceRoot":"","sources":["../../../src/editor/blocks/updateBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,SAAS,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAIpE,wBAAgB,WAAW,CACzB,MAAM,EAAE,SAAS,EACjB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC,GACrD,IAAI,CA2CN"}
1
+ {"version":3,"file":"updateBlock.d.ts","sourceRoot":"","sources":["../../../src/editor/blocks/updateBlock.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAgB,SAAS,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAGzE,wBAAgB,WAAW,CACzB,MAAM,EAAE,SAAS,EACjB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC,GACrD,IAAI,CA2CN"}
@@ -1,5 +1,5 @@
1
- import { SlateEditor, SlateElement, YooEditor, YooptaBlockData, YooptaContentValue, YooptaPath } from '../types';
2
- import { Operation, Range } from 'slate';
1
+ import type { Operation, Range } from 'slate';
2
+ import type { SlateEditor, SlateElement, YooEditor, YooptaBlockData, YooptaContentValue, YooptaPath } from '../types';
3
3
  export type ChangeSource = 'api' | 'user' | 'history';
4
4
  export type SetSlateOperation = {
5
5
  type: 'set_slate';
@@ -1 +1 @@
1
- {"version":3,"file":"applyTransforms.d.ts","sourceRoot":"","sources":["../../../src/editor/core/applyTransforms.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,SAAS,EAAE,eAAe,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACjH,OAAO,EAAU,SAAS,EAAE,KAAK,EAAc,MAAM,OAAO,CAAC;AAG7D,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AM,MAAM,uBAAuB,GAAG;IACpC,IAAI,EAAE,kBAAkB,CAAC;IACzB,UAAU,EAAE;QACV,KAAK,EAAE,kBAAkB,CAAC;KAC3B,CAAC;IACF,cAAc,EAAE;QACd,KAAK,EAAE,kBAAkB,CAAC;KAC3B,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,eAAe,GACvB,oBAAoB,GACpB,oBAAoB,GACpB,4BAA4B,GAC5B,0BAA0B,GAC1B,mBAAmB,GACnB,sBAAsB,GACtB,qBAAqB,GACrB,mBAAmB,GACnB,oBAAoB,GACpB,kBAAkB,GAClB,iBAAiB,GACjB,uBAAuB,CAAC;AA4P5B,MAAM,MAAM,sBAAsB,GAAG;IACnC,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,MAAM,CAAC,EAAE,YAAY,CAAC;CACvB,CAAC;AAIF,wBAAgB,eAAe,CAAC,MAAM,EAAE,SAAS,EAAE,GAAG,EAAE,eAAe,EAAE,EAAE,OAAO,CAAC,EAAE,sBAAsB,GAAG,IAAI,CAgEjH"}
1
+ {"version":3,"file":"applyTransforms.d.ts","sourceRoot":"","sources":["../../../src/editor/core/applyTransforms.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAK9C,OAAO,KAAK,EACV,WAAW,EACX,YAAY,EACZ,SAAS,EACT,eAAe,EACf,kBAAkB,EAClB,UAAU,EACX,MAAM,UAAU,CAAC;AAElB,MAAM,MAAM,YAAY,GAAG,KAAK,GAAG,MAAM,GAAG,SAAS,CAAC;AAEtD,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,WAAW,CAAC;IAClB,KAAK,EAAE,WAAW,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE;QACV,QAAQ,EAAE,SAAS,EAAE,CAAC;QACtB,eAAe,EAAE,KAAK,GAAG,IAAI,CAAC;KAC/B,CAAC;CACH,CAAC;AAEF,MAAM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B,GACrB,mBAAmB,GACnB,oBAAoB,GACpB,kBAAkB,GAClB,iBAAiB,GACjB,uBAAuB,CAAC;AA6Q5B,MAAM,MAAM,sBAAsB,GAAG;IACnC,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,MAAM,CAAC,EAAE,YAAY,CAAC;CACvB,CAAC;AAgBF,wBAAgB,eAAe,CAC7B,MAAM,EAAE,SAAS,EACjB,GAAG,EAAE,eAAe,EAAE,EACtB,OAAO,CAAC,EAAE,sBAAsB,GAC/B,IAAI,CAmEN"}
@@ -1,3 +1,3 @@
1
- import { YooEditor } from '../types';
1
+ import type { YooEditor } from '../types';
2
2
  export declare function batchOperations(editor: YooEditor, callback: () => void): void;
3
3
  //# sourceMappingURL=batchOperations.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"batchOperations.d.ts","sourceRoot":"","sources":["../../../src/editor/core/batchOperations.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAErC,wBAAgB,eAAe,CAAC,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,IAAI,QAiBtE"}
1
+ {"version":3,"file":"batchOperations.d.ts","sourceRoot":"","sources":["../../../src/editor/core/batchOperations.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAE1C,wBAAgB,eAAe,CAAC,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,IAAI,QAiBtE"}
@@ -1,4 +1,4 @@
1
- import { SlateEditor, YooEditor } from '../types';
1
+ import type { SlateEditor, YooEditor } from '../types';
2
2
  export type EditorBlurOptions = {
3
3
  waitExecution?: boolean;
4
4
  waitExecutionMs?: number;
@@ -1 +1 @@
1
- {"version":3,"file":"blur.d.ts","sourceRoot":"","sources":["../../../src/editor/core/blur.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAElD,MAAM,MAAM,iBAAiB,GAAG;IAC9B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,KAAK,CAAC,EAAE,WAAW,CAAC;CACrB,CAAC;AAYF,wBAAgB,IAAI,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,GAAE,iBAAsB,QAetE"}
1
+ {"version":3,"file":"blur.d.ts","sourceRoot":"","sources":["../../../src/editor/core/blur.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAEvD,MAAM,MAAM,iBAAiB,GAAG;IAC9B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,KAAK,CAAC,EAAE,WAAW,CAAC;CACrB,CAAC;AAYF,wBAAgB,IAAI,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,GAAE,iBAAsB,QAetE"}
@@ -1,3 +1,3 @@
1
- import { YooEditor } from '../types';
1
+ import type { YooEditor } from '../types';
2
2
  export declare function focus(editor: YooEditor): void;
3
3
  //# sourceMappingURL=focus.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"focus.d.ts","sourceRoot":"","sources":["../../../src/editor/core/focus.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAErC,wBAAgB,KAAK,CAAC,MAAM,EAAE,SAAS,QAUtC"}
1
+ {"version":3,"file":"focus.d.ts","sourceRoot":"","sources":["../../../src/editor/core/focus.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAE1C,wBAAgB,KAAK,CAAC,MAAM,EAAE,SAAS,QAUtC"}
@@ -1,3 +1,3 @@
1
- import { YooEditor } from '../types';
1
+ import type { YooEditor } from '../types';
2
2
  export declare function getEditorValue(editor: YooEditor): import("../types").YooptaContentValue;
3
3
  //# sourceMappingURL=getEditorValue.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"getEditorValue.d.ts","sourceRoot":"","sources":["../../../src/editor/core/getEditorValue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAErC,wBAAgB,cAAc,CAAC,MAAM,EAAE,SAAS,yCAE/C"}
1
+ {"version":3,"file":"getEditorValue.d.ts","sourceRoot":"","sources":["../../../src/editor/core/getEditorValue.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAE1C,wBAAgB,cAAc,CAAC,MAAM,EAAE,SAAS,yCAE/C"}
@@ -1,5 +1,5 @@
1
- import { YooEditor, YooptaPath } from '../types';
2
- import { YooptaOperation } from './applyTransforms';
1
+ import type { YooptaOperation } from './applyTransforms';
2
+ import type { YooEditor, YooptaPath } from '../types';
3
3
  export type HistoryStack = {
4
4
  operations: YooptaOperation[];
5
5
  path: YooptaPath;
@@ -9,8 +9,8 @@ export declare function inverseEditorOperation(editor: YooEditor, op: YooptaOper
9
9
  export type UndoRedoOptions = {
10
10
  scroll?: boolean;
11
11
  };
12
- export declare const SAVING: WeakMap<YooEditor, boolean | undefined>;
13
- export declare const MERGING: WeakMap<YooEditor, boolean | undefined>;
12
+ export declare const SAVING: WeakMap<import("../types").BaseYooEditor, boolean | undefined>;
13
+ export declare const MERGING: WeakMap<import("../types").BaseYooEditor, boolean | undefined>;
14
14
  export declare const YooptaHistory: {
15
15
  isMergingHistory(editor: YooEditor): boolean | undefined;
16
16
  isSavingHistory(editor: YooEditor): boolean | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"history.d.ts","sourceRoot":"","sources":["../../../src/editor/core/history.ts"],"names":[],"mappings":"AACA,OAAO,EAAgB,SAAS,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAGpD,MAAM,MAAM,YAAY,GAAG;IACzB,U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AM,eAAe,GAAG;IAC5B,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,eAAO,MAAM,MAAM,gEAAgD,CAAC;AACpE,eAAO,MAAM,OAAO,gEAAgD,CAAC;AAErE,eAAO,MAAM,aAAa;6BACC,SAAS,GAAG,OAAO,GAAG,SAAS;4BAIhC,SAAS,GAAG,OAAO,GAAG,SAAS;+BAI5B,SAAS,MAAM,MAAM,IAAI,GAAG,IAAI;8BAOjC,SAAS,MAAM,MAAM,IAAI,GAAG,IAAI;kCAO5B,SAAS,MAAM,MAAM,IAAI,GAAG,IAAI;iCAOjC,SAAS,MAAM,MAAM,IAAI,GAAG,IAAI;mBAO9C,SAAS,YAAY,eAAe;mBA0BpC,SAAS,YAAY,eAAe;CA8BpD,CAAC"}
@@ -1,3 +1,3 @@
1
- import { YooEditor } from '../types';
1
+ import type { YooEditor } from '../types';
2
2
  export declare function isEmpty(editor: YooEditor): boolean;
3
3
  //# sourceMappingURL=isEmpty.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"isEmpty.d.ts","sourceRoot":"","sources":["../../../src/editor/core/isEmpty.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAErC,wBAAgB,OAAO,CAAC,MAAM,EAAE,SAAS,GAAG,OAAO,CAoBlD"}
1
+ {"version":3,"file":"isEmpty.d.ts","sourceRoot":"","sources":["../../../src/editor/core/isEmpty.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAE1C,wBAAgB,OAAO,CAAC,MAAM,EAAE,SAAS,GAAG,OAAO,CAoBlD"}
@@ -1,3 +1,3 @@
1
- import { YooEditor } from '../types';
1
+ import type { YooEditor } from '../types';
2
2
  export declare function isFocused(editor: YooEditor): boolean;
3
3
  //# sourceMappingURL=isFocused.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"isFocused.d.ts","sourceRoot":"","sources":["../../../src/editor/core/isFocused.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAErC,wBAAgB,SAAS,CAAC,MAAM,EAAE,SAAS,WAE1C"}
1
+ {"version":3,"file":"isFocused.d.ts","sourceRoot":"","sources":["../../../src/editor/core/isFocused.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAE1C,wBAAgB,SAAS,CAAC,MAAM,EAAE,SAAS,WAE1C"}
@@ -1,3 +1,3 @@
1
- import { YooEditor, YooptaContentValue } from '../types';
1
+ import type { YooEditor, YooptaContentValue } from '../types';
2
2
  export declare function setEditorValue(editor: YooEditor, value: YooptaContentValue | null): void;
3
3
  //# sourceMappingURL=setEditorValue.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"setEditorValue.d.ts","sourceRoot":"","sources":["../../../src/editor/core/setEditorValue.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAGzD,wBAAgB,cAAc,CAAC,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,kBAAkB,GAAG,IAAI,QAqBjF"}
1
+ {"version":3,"file":"setEditorValue.d.ts","sourceRoot":"","sources":["../../../src/editor/core/setEditorValue.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAE9D,wBAAgB,cAAc,CAAC,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,kBAAkB,GAAG,IAAI,QAqBjF"}
@@ -0,0 +1,150 @@
1
+ import type { Descendant } from 'slate';
2
+ import type { SlateElement, SlateElementTextNode, YooEditor } from '../types';
3
+ export type ElementStructureOptions = {
4
+ id?: string;
5
+ props?: Record<string, unknown>;
6
+ children?: Descendant[];
7
+ };
8
+ export type TextNodeOptions = {
9
+ bold?: boolean;
10
+ italic?: boolean;
11
+ underline?: boolean;
12
+ code?: boolean;
13
+ strike?: boolean;
14
+ highlight?: {
15
+ color?: string;
16
+ backgroundColor?: string;
17
+ };
18
+ };
19
+ /**
20
+ * Creates a text node with optional marks (bold, italic, etc.)
21
+ *
22
+ * @param text - Text content
23
+ * @param marks - Optional marks (bold, italic, underline, code, strike, highlight)
24
+ *
25
+ * @example
26
+ * ```typescript
27
+ * // Plain text
28
+ * editor.y.text('Hello world')
29
+ *
30
+ * // Text with marks
31
+ * editor.y.text('Bold text', { bold: true })
32
+ * editor.y.text('Italic text', { italic: true })
33
+ * editor.y.text('Bold and italic', { bold: true, italic: true })
34
+ * ```
35
+ */
36
+ export declare function yText(text: string, marks?: TextNodeOptions): SlateElementTextNode;
37
+ /**
38
+ * Creates an inline element (e.g., link, mention)
39
+ * Inline elements are embedded within text and can contain text nodes
40
+ *
41
+ * @param editor - YooEditor instance
42
+ * @param type - Inline element type (e.g., 'link', 'mention')
43
+ * @param options - Optional props and children (text nodes)
44
+ *
45
+ * @example
46
+ * ```typescript
47
+ * // Simple link
48
+ * editor.y.inline('link', {
49
+ * props: { url: 'https://example.com', target: '_blank' },
50
+ * children: [editor.y.text('Click me')]
51
+ * })
52
+ *
53
+ * // Link with formatted text
54
+ * editor.y.inline('link', {
55
+ * props: { url: 'https://example.com' },
56
+ * children: [
57
+ * editor.y.text('Bold ', { bold: true }),
58
+ * editor.y.text('link')
59
+ * ]
60
+ * })
61
+ *
62
+ * // Inline element in paragraph
63
+ * editor.y('paragraph', {
64
+ * children: [
65
+ * editor.y.text('Visit '),
66
+ * editor.y.inline('link', {
67
+ * props: { url: 'https://example.com' },
68
+ * children: [editor.y.text('example.com')]
69
+ * }),
70
+ * editor.y.text(' for more info')
71
+ * ]
72
+ * })
73
+ * ```
74
+ */
75
+ export declare function yInline(editor: YooEditor, type: string, options?: ElementStructureOptions): SlateElement;
76
+ /**
77
+ * Creates a SlateElement structure for use in insertBlock or other operations
78
+ *
79
+ * @param editor - YooEditor instance
80
+ * @param type - Element type (e.g., 'accordion-list', 'paragraph', etc.)
81
+ * @param options - Optional props and children
82
+ *
83
+ * @example
84
+ * ```typescript
85
+ * // Simple element
86
+ * editor.y('paragraph')
87
+ *
88
+ * // Element with custom props
89
+ * editor.y('accordion-list-item', { props: { isExpanded: false } })
90
+ *
91
+ * // Nested structure
92
+ * editor.y('accordion-list', {
93
+ * children: [
94
+ * editor.y('accordion-list-item', {
95
+ * props: { isExpanded: false },
96
+ * children: [
97
+ * editor.y('accordion-list-item-heading'),
98
+ * editor.y('accordion-list-item-content')
99
+ * ]
100
+ * })
101
+ * ]
102
+ * })
103
+ *
104
+ * // Element with text and marks
105
+ * editor.y('paragraph', {
106
+ * children: [
107
+ * editor.y.text('Hello '),
108
+ * editor.y.text('world', { bold: true }),
109
+ * editor.y.text('!', { italic: true })
110
+ * ]
111
+ * })
112
+ *
113
+ * // Mixed: elements and text
114
+ * editor.y('step-list-item-content', {
115
+ * children: [
116
+ * editor.y.text('Step 1: '),
117
+ * editor.y('callout', { props: { theme: 'info' } }),
118
+ * editor.y.text(' - completed', { strike: true })
119
+ * ]
120
+ * })
121
+ * ```
122
+ */
123
+ export declare function y(editor: YooEditor, type: string, options?: ElementStructureOptions): SlateElement;
124
+ /**
125
+ * Creates a JSX-compatible function bound to the editor
126
+ * Use this for JSX pragma
127
+ *
128
+ * @example
129
+ * ```typescript
130
+ * import { createJSXFactory } from '@yoopta/editor';
131
+ *
132
+ * const y = createJSXFactory(editor);
133
+ *
134
+ * // Now you can use JSX:
135
+ * // @jsx y
136
+ * const structure = (
137
+ * <accordion-list>
138
+ * <accordion-list-item props={{ isExpanded: false }}>
139
+ * <accordion-list-item-heading />
140
+ * </accordion-list-item>
141
+ * </accordion-list>
142
+ * );
143
+ *
144
+ * editor.insertBlock('Accordion', {
145
+ * blockData: { value: [structure] }
146
+ * });
147
+ * ```
148
+ */
149
+ export declare function createJSXFactory(editor: YooEditor): (type: string, props: Record<string, unknown> | null, ...children: unknown[]) => SlateElement;
150
+ //# sourceMappingURL=create-element-structure.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-element-structure.d.ts","sourceRoot":"","sources":["../../../src/editor/elements/create-element-structure.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAIxC,OAAO,KAAK,EAAE,YAAY,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAE9E,MAAM,MAAM,uBAAuB,GAAG;IACpC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,QAAQ,CAAC,EAAE,UAAU,EAAE,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE;QACV,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,eAAe,CAAC,EAAE,MAAM,CAAC;KAC1B,CAAC;CACH,CAAC;AA8BF;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,GAAE,eAAoB,GAAG,oBAAoB,CAKrF;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,wBAAgB,OAAO,CACrB,MAAM,EAAE,SAAS,EACjB,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,uBAA4B,GACpC,YAAY,CAqCd;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,wBAAgB,CAAC,CACf,MAAM,EAAE,SAAS,EACjB,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,uBAA4B,GACpC,YAAY,CAgDd;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,SAAS,UAExC,MAAM,SACL,OAAO,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,eACxB,OAAO,EAAE,KACrB,YAAY,CAwBhB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=create-element-structure.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-element-structure.test.d.ts","sourceRoot":"","sources":["../../../src/editor/elements/create-element-structure.test.ts"],"names":[],"mappings":""}
@@ -1,8 +1,79 @@
1
- import { Path } from 'slate';
2
- import { YooEditor } from '../types';
3
- export type DeleteBlockElement = {
4
- type: string;
5
- path: Path;
6
- };
7
- export declare function deleteElement(editor: YooEditor, blockId: string, element: DeleteBlockElement): void;
1
+ import type { YooEditor } from '../types';
2
+ import type { DeleteElementOptions } from './types';
3
+ /**
4
+ * Delete element from a block
5
+ *
6
+ * @param editor - YooEditor instance
7
+ * @param options - Delete options
8
+ *
9
+ * @example Delete block element by path
10
+ * ```typescript
11
+ * editor.deleteElement({
12
+ * blockId: 'accordion-1',
13
+ * type: 'accordion-list-item',
14
+ * path: [0, 1]
15
+ * });
16
+ * ```
17
+ *
18
+ * @example Delete block element by type
19
+ * ```typescript
20
+ * // Deletes first accordion-list-item found in selection
21
+ * editor.deleteElement({
22
+ * blockId: 'accordion-1',
23
+ * type: 'accordion-list-item'
24
+ * });
25
+ * ```
26
+ *
27
+ * @example Delete inline element (remove link wrapper, keep text)
28
+ * ```typescript
29
+ * // Before: "Hello <link>world</link>!"
30
+ * editor.deleteElement({
31
+ * blockId: 'paragraph-1',
32
+ * type: 'link',
33
+ * mode: 'unwrap' // Keep "world", remove link
34
+ * });
35
+ * // After: "Hello world!"
36
+ * ```
37
+ *
38
+ * @example Delete inline element (remove entirely)
39
+ * ```typescript
40
+ * // Before: "Hello <mention>@John</mention>!"
41
+ * editor.deleteElement({
42
+ * blockId: 'paragraph-1',
43
+ * type: 'mention',
44
+ * mode: 'remove' // Remove mention entirely
45
+ * });
46
+ * // After: "Hello !"
47
+ * ```
48
+ *
49
+ * @example Delete with custom matcher
50
+ * ```typescript
51
+ * editor.deleteElement({
52
+ * blockId: 'accordion-1',
53
+ * type: 'accordion-list-item',
54
+ * match: (element) => element.props?.id === 'item-5'
55
+ * });
56
+ * ```
57
+ *
58
+ * @example Delete link at current selection
59
+ * ```typescript
60
+ * // User has cursor inside link, wants to remove link
61
+ * editor.deleteElement({
62
+ * blockId: 'paragraph-1',
63
+ * type: 'link',
64
+ * mode: 'unwrap'
65
+ * });
66
+ * ```
67
+ *
68
+ * @example Delete all links in selection with matcher
69
+ * ```typescript
70
+ * editor.deleteElement({
71
+ * blockId: 'paragraph-1',
72
+ * type: 'link',
73
+ * match: (element) => element.props?.url.includes('old-domain.com'),
74
+ * mode: 'unwrap'
75
+ * });
76
+ * ```
77
+ */
78
+ export declare function deleteElement(editor: YooEditor, options: DeleteElementOptions): void;
8
79
  //# sourceMappingURL=deleteElement.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"deleteElement.d.ts","sourceRoot":"","sources":["../../../src/editor/elements/deleteElement.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,IAAI,EAAc,MAAM,OAAO,CAAC;AAE1D,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAErC,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,IAAI,CAAC;CACZ,CAAC;AAEF,wBAAgB,aAAa,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,kBAAkB,QAsB5F"}
1
+ {"version":3,"file":"deleteElement.d.ts","sourceRoot":"","sources":["../../../src/editor/elements/deleteElement.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAe,SAAS,EAAE,MAAM,UAAU,CAAC;AACvD,OAAO,KAAK,EAAE,oBAAoB,EAAkB,MAAM,SAAS,CAAC;AA6FpE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0EG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,oBAAoB,GAAG,IAAI,CAsEpF"}
@@ -1,5 +1,27 @@
1
- import { SlateElement, YooEditor } from '../types';
2
- import { GetBlockElementEntryOptions } from './getElementEntry';
3
- export type GetBlockElementOptions = GetBlockElementEntryOptions;
4
- export declare function getElement<TElementKeys extends string>(editor: YooEditor, blockId: string, options?: GetBlockElementOptions): SlateElement<TElementKeys> | undefined;
1
+ import type { SlateElement, YooEditor } from '../types';
2
+ import type { GetElementOptions } from './types';
3
+ /**
4
+ * Get single element from a block
5
+ *
6
+ * @param editor - YooEditor instance
7
+ * @param options - Get options
8
+ * @returns Element or null if not found
9
+ *
10
+ * @example
11
+ * ```typescript
12
+ * // Get element by type and path
13
+ * const element = editor.getElement({
14
+ * blockId: 'accordion-1',
15
+ * type: 'accordion-list-item',
16
+ * path: [0, 1]
17
+ * });
18
+ *
19
+ * // Get element with custom matcher
20
+ * const activeItem = editor.getElement({
21
+ * blockId: 'accordion-1',
22
+ * match: (el) => el.type === 'accordion-list-item' && el.props?.isExpanded
23
+ * });
24
+ * ```
25
+ */
26
+ export declare function getElement(editor: YooEditor, options: GetElementOptions): SlateElement | null;
5
27
  //# sourceMappingURL=getElement.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"getElement.d.ts","sourceRoot":"","sources":["../../../src/editor/elements/getElement.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACnD,OAAO,EAAmB,2BAA2B,EAAE,MAAM,mBAAmB,CAAC;AAEjF,MAAM,MAAM,sBAAsB,GAAG,2BAA2B,CAAC;AAEjE,wBAAgB,UAAU,CAAC,YAAY,SAAS,MAAM,EACpD,MAAM,EAAE,SAAS,EACjB,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,sBAAsB,GAC/B,YAAY,CAAC,YAAY,CAAC,GAAG,SAAS,CAQxC"}
1
+ {"version":3,"file":"getElement.d.ts","sourceRoot":"","sources":["../../../src/editor/elements/getElement.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAe,YAAY,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrE,OAAO,KAAK,EAAe,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAgD9D;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,iBAAiB,GAAG,YAAY,GAAG,IAAI,CAsC7F"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=getElement.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getElement.test.d.ts","sourceRoot":"","sources":["../../../src/editor/elements/getElement.test.ts"],"names":[],"mappings":""}
@@ -1,5 +1,21 @@
1
- import { SlateElement, YooEditor } from '../types';
2
- import { GetBlockElementEntryOptions } from './getElementEntry';
3
- export type GetElementChildrenOptions = GetBlockElementEntryOptions;
4
- export declare function getElementChildren<TElementKeys extends string>(editor: YooEditor, blockId: string, options?: GetElementChildrenOptions): SlateElement<TElementKeys>['children'] | undefined;
1
+ import type { SlateElement, YooEditor } from '../types';
2
+ import type { GetElementChildrenOptions } from './types';
3
+ /**
4
+ * Get children of an element
5
+ *
6
+ * @param editor - YooEditor instance
7
+ * @param options - Get options
8
+ * @returns Element children or null if element not found
9
+ *
10
+ * @example
11
+ * ```typescript
12
+ * // Get children of accordion item
13
+ * const children = editor.getElementChildren({
14
+ * blockId: 'accordion-1',
15
+ * type: 'accordion-list-item',
16
+ * path: [0, 1]
17
+ * });
18
+ * ```
19
+ */
20
+ export declare function getElementChildren(editor: YooEditor, options: GetElementChildrenOptions): SlateElement['children'] | null;
5
21
  //# sourceMappingURL=getElementChildren.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"getElementChildren.d.ts","sourceRoot":"","sources":["../../../src/editor/elements/getElementChildren.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAEnD,OAAO,EAAE,2BAA2B,EAAE,MAAM,mBAAmB,CAAC;AAEhE,MAAM,MAAM,yBAAyB,GAAG,2BAA2B,CAAC;AAEpE,wBAAgB,kBAAkB,CAAC,YAAY,SAAS,MAAM,EAC5D,MAAM,EAAE,SAAS,EACjB,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,yBAAyB,GAClC,YAAY,CAAC,YAAY,CAAC,CAAC,UAAU,CAAC,GAAG,SAAS,CAKpD"}
1
+ {"version":3,"file":"getElementChildren.d.ts","sourceRoot":"","sources":["../../../src/editor/elements/getElementChildren.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACxD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAC;AAEzD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,SAAS,EACjB,OAAO,EAAE,yBAAyB,GACjC,YAAY,CAAC,UAAU,CAAC,GAAG,IAAI,CAOjC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=getElementChildren.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getElementChildren.test.d.ts","sourceRoot":"","sources":["../../../src/editor/elements/getElementChildren.test.ts"],"names":[],"mappings":""}
@@ -1,8 +1,27 @@
1
- import { Location, NodeEntry, Span } from 'slate';
2
- import { SlateElement, YooEditor } from '../types';
3
- export type GetBlockElementEntryOptions = {
4
- path?: Location | Span | undefined;
5
- type?: string;
6
- };
7
- export declare function getElementEntry<TElementKeys extends string>(editor: YooEditor, blockId: string, options?: GetBlockElementEntryOptions): NodeEntry<SlateElement<TElementKeys>> | undefined;
1
+ import type { NodeEntry } from 'slate';
2
+ import type { SlateElement, YooEditor } from '../types';
3
+ import type { GetElementEntryOptions } from './types';
4
+ /**
5
+ * Get element entry [element, path] from a block
6
+ *
7
+ * @param editor - YooEditor instance
8
+ * @param options - Get options
9
+ * @returns Element entry or null if not found
10
+ *
11
+ * @example
12
+ * ```typescript
13
+ * // Get entry by type and path
14
+ * const entry = editor.getElementEntry({
15
+ * blockId: 'accordion-1',
16
+ * type: 'accordion-list-item',
17
+ * path: [0, 1]
18
+ * });
19
+ *
20
+ * if (entry) {
21
+ * const [element, path] = entry;
22
+ * console.log('Element at path:', path);
23
+ * }
24
+ * ```
25
+ */
26
+ export declare function getElementEntry(editor: YooEditor, options: GetElementEntryOptions): NodeEntry<SlateElement> | null;
8
27
  //# sourceMappingURL=getElementEntry.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"getElementEntry.d.ts","sourceRoot":"","sources":["../../../src/editor/elements/getElementEntry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,QAAQ,EAAE,SAAS,EAAE,IAAI,EAAa,MAAM,OAAO,CAAC;AAE9E,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAEnD,MAAM,MAAM,2BAA2B,GAAG;IACxC,IAAI,CAAC,EAAE,QAAQ,GAAG,IAAI,GAAG,SAAS,CAAC;IACnC,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,wBAAgB,eAAe,CAAC,YAAY,SAAS,MAAM,EACzD,MAAM,EAAE,SAAS,EACjB,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,2BAA2B,GACpC,SAAS,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC,GAAG,SAAS,CA8BnD"}
1
+ {"version":3,"file":"getElementEntry.d.ts","sourceRoot":"","sources":["../../../src/editor/elements/getElementEntry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAY,SAAS,EAAQ,MAAM,OAAO,CAAC;AAIvD,OAAO,KAAK,EAAe,YAAY,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrE,OAAO,KAAK,EAAe,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAgDnE;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,SAAS,EACjB,OAAO,EAAE,sBAAsB,GAC9B,SAAS,CAAC,YAAY,CAAC,GAAG,IAAI,CAgChC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=getElementEntry.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getElementEntry.test.d.ts","sourceRoot":"","sources":["../../../src/editor/elements/getElementEntry.test.ts"],"names":[],"mappings":""}