@licium/editor 3.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (265) hide show
  1. package/README.md +176 -0
  2. package/dist/esm/i18n/__test__/integration/ui/layout.spec.d.ts +1 -0
  3. package/dist/esm/i18n/__test__/integration/ui/toolbar.spec.d.ts +1 -0
  4. package/dist/esm/i18n/__test__/integration/vdom/render.spec.d.ts +1 -0
  5. package/dist/esm/i18n/__test__/integration/widget/widgetNode.spec.d.ts +1 -0
  6. package/dist/esm/i18n/__test__/unit/convertor.spec.d.ts +1 -0
  7. package/dist/esm/i18n/__test__/unit/dom.spec.d.ts +1 -0
  8. package/dist/esm/i18n/__test__/unit/editor.spec.d.ts +1 -0
  9. package/dist/esm/i18n/__test__/unit/eventEmitter.spec.d.ts +1 -0
  10. package/dist/esm/i18n/__test__/unit/helper/common.spec.d.ts +1 -0
  11. package/dist/esm/i18n/__test__/unit/helper/image.spec.d.ts +1 -0
  12. package/dist/esm/i18n/__test__/unit/linkXss.spec.d.ts +1 -0
  13. package/dist/esm/i18n/__test__/unit/markdown/keymap.spec.d.ts +1 -0
  14. package/dist/esm/i18n/__test__/unit/markdown/mdCommand.spec.d.ts +1 -0
  15. package/dist/esm/i18n/__test__/unit/markdown/mdEditor.spec.d.ts +1 -0
  16. package/dist/esm/i18n/__test__/unit/markdown/mdPreview.spec.d.ts +1 -0
  17. package/dist/esm/i18n/__test__/unit/markdown/smartTask.spec.d.ts +1 -0
  18. package/dist/esm/i18n/__test__/unit/markdown/syntaxHighlight.spec.d.ts +1 -0
  19. package/dist/esm/i18n/__test__/unit/markdown/util.d.ts +7 -0
  20. package/dist/esm/i18n/__test__/unit/repro_3296.spec.d.ts +1 -0
  21. package/dist/esm/i18n/__test__/unit/sanitizer.spec.d.ts +1 -0
  22. package/dist/esm/i18n/__test__/unit/utils/escape.spec.d.ts +1 -0
  23. package/dist/esm/i18n/__test__/unit/utils/pollution.spec.d.ts +1 -0
  24. package/dist/esm/i18n/__test__/unit/vdom/template.spec.d.ts +1 -0
  25. package/dist/esm/i18n/__test__/unit/viewer.spec.d.ts +1 -0
  26. package/dist/esm/i18n/__test__/unit/wysiwyg/customBlock.spec.d.ts +1 -0
  27. package/dist/esm/i18n/__test__/unit/wysiwyg/helper/pasteMsoList.spec.d.ts +1 -0
  28. package/dist/esm/i18n/__test__/unit/wysiwyg/imageInsertion.spec.d.ts +1 -0
  29. package/dist/esm/i18n/__test__/unit/wysiwyg/keymap.spec.d.ts +1 -0
  30. package/dist/esm/i18n/__test__/unit/wysiwyg/wwCommand.spec.d.ts +1 -0
  31. package/dist/esm/i18n/__test__/unit/wysiwyg/wwEditor.spec.d.ts +1 -0
  32. package/dist/esm/i18n/__test__/unit/wysiwyg/wwTableCommand.spec.d.ts +1 -0
  33. package/dist/esm/i18n/__test__/unit/wysiwyg/wwToDOMAdaptor.spec.d.ts +1 -0
  34. package/dist/esm/i18n/__test__/unit/xssSanitizer.spec.d.ts +1 -0
  35. package/dist/esm/i18n/ar.d.ts +1 -0
  36. package/dist/esm/i18n/ar.js +63 -0
  37. package/dist/esm/i18n/base.d.ts +60 -0
  38. package/dist/esm/i18n/commands/commandManager.d.ts +16 -0
  39. package/dist/esm/i18n/commands/defaultCommands.d.ts +2 -0
  40. package/dist/esm/i18n/commands/wwCommands.d.ts +2 -0
  41. package/dist/esm/i18n/convertors/convertor.d.ts +19 -0
  42. package/dist/esm/i18n/convertors/toMarkdown/toMdConvertorState.d.ts +30 -0
  43. package/dist/esm/i18n/convertors/toMarkdown/toMdConvertors.d.ts +7 -0
  44. package/dist/esm/i18n/convertors/toMarkdown/toMdNodeTypeWriters.d.ts +8 -0
  45. package/dist/esm/i18n/convertors/toWysiwyg/htmlToWwConvertors.d.ts +7 -0
  46. package/dist/esm/i18n/convertors/toWysiwyg/toWwConvertorState.d.ts +23 -0
  47. package/dist/esm/i18n/convertors/toWysiwyg/toWwConvertors.d.ts +4 -0
  48. package/dist/esm/i18n/cs-cz.d.ts +1 -0
  49. package/dist/esm/i18n/cs-cz.js +63 -0
  50. package/dist/esm/i18n/de-de.d.ts +1 -0
  51. package/dist/esm/i18n/de-de.js +63 -0
  52. package/dist/esm/i18n/editor.d.ts +36 -0
  53. package/dist/esm/i18n/editorCore.d.ts +330 -0
  54. package/dist/esm/i18n/en-us.d.ts +1 -0
  55. package/dist/esm/i18n/en-us.js +63 -0
  56. package/dist/esm/i18n/es-es.d.ts +1 -0
  57. package/dist/esm/i18n/es-es.js +63 -0
  58. package/dist/esm/i18n/esm/index.d.ts +5 -0
  59. package/dist/esm/i18n/esm/indexViewer.d.ts +2 -0
  60. package/dist/esm/i18n/event/eventEmitter.d.ts +73 -0
  61. package/dist/esm/i18n/fi-fi.d.ts +1 -0
  62. package/dist/esm/i18n/fi-fi.js +63 -0
  63. package/dist/esm/i18n/fr-fr.d.ts +1 -0
  64. package/dist/esm/i18n/fr-fr.js +63 -0
  65. package/dist/esm/i18n/gl-es.d.ts +5 -0
  66. package/dist/esm/i18n/gl-es.js +63 -0
  67. package/dist/esm/i18n/helper/image.d.ts +4 -0
  68. package/dist/esm/i18n/helper/manipulation.d.ts +16 -0
  69. package/dist/esm/i18n/helper/plugin.d.ts +3 -0
  70. package/dist/esm/i18n/hr-hr.d.ts +1 -0
  71. package/dist/esm/i18n/hr-hr.js +63 -0
  72. package/dist/esm/i18n/i18n.d.ts +20 -0
  73. package/dist/esm/i18n/i18n.js +217 -0
  74. package/dist/esm/i18n/index.d.ts +10 -0
  75. package/dist/esm/i18n/indexEditorOnlyStyle.d.ts +3 -0
  76. package/dist/esm/i18n/indexViewer.d.ts +3 -0
  77. package/dist/esm/i18n/it-it.d.ts +1 -0
  78. package/dist/esm/i18n/it-it.js +63 -0
  79. package/dist/esm/i18n/ja-jp.d.ts +1 -0
  80. package/dist/esm/i18n/ja-jp.js +63 -0
  81. package/dist/esm/i18n/ko-kr.d.ts +1 -0
  82. package/dist/esm/i18n/ko-kr.js +63 -0
  83. package/dist/esm/i18n/markdown/helper/list.d.ts +55 -0
  84. package/dist/esm/i18n/markdown/helper/mdCommand.d.ts +5 -0
  85. package/dist/esm/i18n/markdown/helper/pos.d.ts +22 -0
  86. package/dist/esm/i18n/markdown/helper/query.d.ts +3 -0
  87. package/dist/esm/i18n/markdown/htmlRenderConvertors.d.ts +5 -0
  88. package/dist/esm/i18n/markdown/marks/blockQuote.d.ts +19 -0
  89. package/dist/esm/i18n/markdown/marks/code.d.ts +25 -0
  90. package/dist/esm/i18n/markdown/marks/codeBlock.d.ts +18 -0
  91. package/dist/esm/i18n/markdown/marks/customBlock.d.ts +10 -0
  92. package/dist/esm/i18n/markdown/marks/emph.d.ts +17 -0
  93. package/dist/esm/i18n/markdown/marks/heading.d.ts +23 -0
  94. package/dist/esm/i18n/markdown/marks/html.d.ts +8 -0
  95. package/dist/esm/i18n/markdown/marks/link.d.ts +29 -0
  96. package/dist/esm/i18n/markdown/marks/listItem.d.ts +42 -0
  97. package/dist/esm/i18n/markdown/marks/simpleMark.d.ts +32 -0
  98. package/dist/esm/i18n/markdown/marks/strike.d.ts +14 -0
  99. package/dist/esm/i18n/markdown/marks/strong.d.ts +18 -0
  100. package/dist/esm/i18n/markdown/marks/table.d.ts +27 -0
  101. package/dist/esm/i18n/markdown/marks/thematicBreak.d.ts +17 -0
  102. package/dist/esm/i18n/markdown/mdEditor.d.ts +48 -0
  103. package/dist/esm/i18n/markdown/mdPreview.d.ts +50 -0
  104. package/dist/esm/i18n/markdown/nodes/doc.d.ts +7 -0
  105. package/dist/esm/i18n/markdown/nodes/paragraph.d.ts +46 -0
  106. package/dist/esm/i18n/markdown/nodes/text.d.ts +7 -0
  107. package/dist/esm/i18n/markdown/plugins/helper/markInfo.d.ts +19 -0
  108. package/dist/esm/i18n/markdown/plugins/previewHighlight.d.ts +3 -0
  109. package/dist/esm/i18n/markdown/plugins/smartTask.d.ts +3 -0
  110. package/dist/esm/i18n/markdown/plugins/syntaxHighlight.d.ts +3 -0
  111. package/dist/esm/i18n/markdown/scroll/animation.d.ts +2 -0
  112. package/dist/esm/i18n/markdown/scroll/dom.d.ts +16 -0
  113. package/dist/esm/i18n/markdown/scroll/offset.d.ts +9 -0
  114. package/dist/esm/i18n/markdown/scroll/scrollSync.d.ts +30 -0
  115. package/dist/esm/i18n/nb-no.d.ts +1 -0
  116. package/dist/esm/i18n/nb-no.js +63 -0
  117. package/dist/esm/i18n/nl-nl.d.ts +1 -0
  118. package/dist/esm/i18n/nl-nl.js +63 -0
  119. package/dist/esm/i18n/pl-pl.d.ts +1 -0
  120. package/dist/esm/i18n/pl-pl.js +63 -0
  121. package/dist/esm/i18n/plugins/dropImage.d.ts +3 -0
  122. package/dist/esm/i18n/plugins/placeholder.d.ts +7 -0
  123. package/dist/esm/i18n/plugins/popupWidget.d.ts +3 -0
  124. package/dist/esm/i18n/pt-br.d.ts +1 -0
  125. package/dist/esm/i18n/pt-br.js +63 -0
  126. package/dist/esm/i18n/queries/queryManager.d.ts +2 -0
  127. package/dist/esm/i18n/ru-ru.d.ts +1 -0
  128. package/dist/esm/i18n/ru-ru.js +64 -0
  129. package/dist/esm/i18n/sanitizer/htmlSanitizer.d.ts +3 -0
  130. package/dist/esm/i18n/spec/mark.d.ts +12 -0
  131. package/dist/esm/i18n/spec/node.d.ts +12 -0
  132. package/dist/esm/i18n/spec/specManager.d.ts +16 -0
  133. package/dist/esm/i18n/sv-se.d.ts +1 -0
  134. package/dist/esm/i18n/sv-se.js +63 -0
  135. package/dist/esm/i18n/tr-tr.d.ts +1 -0
  136. package/dist/esm/i18n/tr-tr.js +63 -0
  137. package/dist/esm/i18n/ui/components/contextMenu.d.ts +21 -0
  138. package/dist/esm/i18n/ui/components/layout.d.ts +36 -0
  139. package/dist/esm/i18n/ui/components/popup.d.ts +21 -0
  140. package/dist/esm/i18n/ui/components/switch.d.ts +17 -0
  141. package/dist/esm/i18n/ui/components/tabs.d.ts +12 -0
  142. package/dist/esm/i18n/ui/components/toolbar/customPopupBody.d.ts +16 -0
  143. package/dist/esm/i18n/ui/components/toolbar/headingPopupBody.d.ts +12 -0
  144. package/dist/esm/i18n/ui/components/toolbar/imagePopupBody.d.ts +30 -0
  145. package/dist/esm/i18n/ui/components/toolbar/linkPopupBody.d.ts +18 -0
  146. package/dist/esm/i18n/ui/components/toolbar/tablePopupBody.d.ts +29 -0
  147. package/dist/esm/i18n/ui/components/toolbar/toolbar.d.ts +45 -0
  148. package/dist/esm/i18n/ui/components/toolbar/toolbarGroup.d.ts +21 -0
  149. package/dist/esm/i18n/ui/toolbarItemFactory.d.ts +13 -0
  150. package/dist/esm/i18n/ui/vdom/commit.d.ts +2 -0
  151. package/dist/esm/i18n/ui/vdom/component.d.ts +10 -0
  152. package/dist/esm/i18n/ui/vdom/dom.d.ts +6 -0
  153. package/dist/esm/i18n/ui/vdom/render.d.ts +4 -0
  154. package/dist/esm/i18n/ui/vdom/renderer.d.ts +4 -0
  155. package/dist/esm/i18n/ui/vdom/template.d.ts +3 -0
  156. package/dist/esm/i18n/ui/vdom/vnode.d.ts +30 -0
  157. package/dist/esm/i18n/uk-ua.d.ts +1 -0
  158. package/dist/esm/i18n/uk-ua.js +63 -0
  159. package/dist/esm/i18n/utils/common.d.ts +19 -0
  160. package/dist/esm/i18n/utils/constants.d.ts +8 -0
  161. package/dist/esm/i18n/utils/dom.d.ts +25 -0
  162. package/dist/esm/i18n/utils/map.d.ts +19 -0
  163. package/dist/esm/i18n/utils/markdown.d.ts +23 -0
  164. package/dist/esm/i18n/viewer.d.ts +77 -0
  165. package/dist/esm/i18n/widget/rules.d.ts +28 -0
  166. package/dist/esm/i18n/widget/widgetNode.d.ts +28 -0
  167. package/dist/esm/i18n/wysiwyg/adaptor/mdLikeNode.d.ts +5 -0
  168. package/dist/esm/i18n/wysiwyg/adaptor/wwToDOMAdaptor.d.ts +13 -0
  169. package/dist/esm/i18n/wysiwyg/clipboard/paste.d.ts +6 -0
  170. package/dist/esm/i18n/wysiwyg/clipboard/pasteMsoList.d.ts +2 -0
  171. package/dist/esm/i18n/wysiwyg/clipboard/pasteTextParser.d.ts +2 -0
  172. package/dist/esm/i18n/wysiwyg/clipboard/pasteToTable.d.ts +3 -0
  173. package/dist/esm/i18n/wysiwyg/command/list.d.ts +7 -0
  174. package/dist/esm/i18n/wysiwyg/command/table.d.ts +16 -0
  175. package/dist/esm/i18n/wysiwyg/helper/node.d.ts +37 -0
  176. package/dist/esm/i18n/wysiwyg/helper/table.d.ts +25 -0
  177. package/dist/esm/i18n/wysiwyg/helper/tableOffsetMap.d.ts +88 -0
  178. package/dist/esm/i18n/wysiwyg/markdownInputRules.d.ts +3 -0
  179. package/dist/esm/i18n/wysiwyg/marks/code.d.ts +31 -0
  180. package/dist/esm/i18n/wysiwyg/marks/emph.d.ts +34 -0
  181. package/dist/esm/i18n/wysiwyg/marks/link.d.ts +59 -0
  182. package/dist/esm/i18n/wysiwyg/marks/strike.d.ts +31 -0
  183. package/dist/esm/i18n/wysiwyg/marks/strong.d.ts +34 -0
  184. package/dist/esm/i18n/wysiwyg/nodes/blockQuote.d.ts +33 -0
  185. package/dist/esm/i18n/wysiwyg/nodes/bulletList.d.ts +43 -0
  186. package/dist/esm/i18n/wysiwyg/nodes/codeBlock.d.ts +45 -0
  187. package/dist/esm/i18n/wysiwyg/nodes/customBlock.d.ts +26 -0
  188. package/dist/esm/i18n/wysiwyg/nodes/doc.d.ts +7 -0
  189. package/dist/esm/i18n/wysiwyg/nodes/frontMatter.d.ts +21 -0
  190. package/dist/esm/i18n/wysiwyg/nodes/hardBreak.d.ts +14 -0
  191. package/dist/esm/i18n/wysiwyg/nodes/heading.d.ts +38 -0
  192. package/dist/esm/i18n/wysiwyg/nodes/html.d.ts +11 -0
  193. package/dist/esm/i18n/wysiwyg/nodes/htmlComment.d.ts +21 -0
  194. package/dist/esm/i18n/wysiwyg/nodes/image.d.ts +45 -0
  195. package/dist/esm/i18n/wysiwyg/nodes/listItem.d.ts +36 -0
  196. package/dist/esm/i18n/wysiwyg/nodes/orderedList.d.ts +39 -0
  197. package/dist/esm/i18n/wysiwyg/nodes/paragraph.d.ts +21 -0
  198. package/dist/esm/i18n/wysiwyg/nodes/table.d.ts +80 -0
  199. package/dist/esm/i18n/wysiwyg/nodes/tableBody.d.ts +26 -0
  200. package/dist/esm/i18n/wysiwyg/nodes/tableBodyCell.d.ts +36 -0
  201. package/dist/esm/i18n/wysiwyg/nodes/tableHead.d.ts +26 -0
  202. package/dist/esm/i18n/wysiwyg/nodes/tableHeadCell.d.ts +39 -0
  203. package/dist/esm/i18n/wysiwyg/nodes/tableRow.d.ts +26 -0
  204. package/dist/esm/i18n/wysiwyg/nodes/text.d.ts +14 -0
  205. package/dist/esm/i18n/wysiwyg/nodes/thematicBreak.d.ts +33 -0
  206. package/dist/esm/i18n/wysiwyg/nodeview/codeBlockView.d.ts +29 -0
  207. package/dist/esm/i18n/wysiwyg/nodeview/customBlockView.d.ts +29 -0
  208. package/dist/esm/i18n/wysiwyg/nodeview/imageView.d.ts +20 -0
  209. package/dist/esm/i18n/wysiwyg/plugins/selection/cellSelection.d.ts +14 -0
  210. package/dist/esm/i18n/wysiwyg/plugins/selection/tableSelection.d.ts +2 -0
  211. package/dist/esm/i18n/wysiwyg/plugins/selection/tableSelectionView.d.ts +19 -0
  212. package/dist/esm/i18n/wysiwyg/plugins/tableContextMenu.d.ts +3 -0
  213. package/dist/esm/i18n/wysiwyg/plugins/task.d.ts +2 -0
  214. package/dist/esm/i18n/wysiwyg/plugins/toolbarState.d.ts +3 -0
  215. package/dist/esm/i18n/wysiwyg/specCreator.d.ts +3 -0
  216. package/dist/esm/i18n/wysiwyg/wwEditor.d.ts +57 -0
  217. package/dist/esm/i18n/zh-cn.d.ts +1 -0
  218. package/dist/esm/i18n/zh-cn.js +63 -0
  219. package/dist/esm/i18n/zh-tw.d.ts +1 -0
  220. package/dist/esm/i18n/zh-tw.js +63 -0
  221. package/dist/esm/index.js +25133 -0
  222. package/dist/esm/indexViewer.js +12757 -0
  223. package/dist/i18n/ar.js +162 -0
  224. package/dist/i18n/cs-cz.js +162 -0
  225. package/dist/i18n/de-de.js +162 -0
  226. package/dist/i18n/es-es.js +162 -0
  227. package/dist/i18n/fi-fi.js +162 -0
  228. package/dist/i18n/fr-fr.js +162 -0
  229. package/dist/i18n/gl-es.js +162 -0
  230. package/dist/i18n/hr-hr.js +162 -0
  231. package/dist/i18n/it-it.js +162 -0
  232. package/dist/i18n/ja-jp.js +162 -0
  233. package/dist/i18n/ko-kr.js +162 -0
  234. package/dist/i18n/nb-no.js +162 -0
  235. package/dist/i18n/nl-nl.js +162 -0
  236. package/dist/i18n/pl-pl.js +162 -0
  237. package/dist/i18n/pt-br.js +162 -0
  238. package/dist/i18n/ru-ru.js +163 -0
  239. package/dist/i18n/sv-se.js +162 -0
  240. package/dist/i18n/tr-tr.js +162 -0
  241. package/dist/i18n/uk-ua.js +162 -0
  242. package/dist/i18n/zh-cn.js +162 -0
  243. package/dist/i18n/zh-tw.js +162 -0
  244. package/dist/theme/toastui-editor-dark.css +474 -0
  245. package/dist/toastui-editor-only.css +1068 -0
  246. package/dist/toastui-editor-viewer.css +492 -0
  247. package/dist/toastui-editor-viewer.js +14079 -0
  248. package/dist/toastui-editor.css +1606 -0
  249. package/dist/toastui-editor.js +26464 -0
  250. package/package.json +95 -0
  251. package/types/convertor.d.ts +143 -0
  252. package/types/editor.d.ts +383 -0
  253. package/types/event.d.ts +56 -0
  254. package/types/index.d.ts +70 -0
  255. package/types/map.d.ts +8 -0
  256. package/types/markdown.d.ts +60 -0
  257. package/types/plugin.d.ts +59 -0
  258. package/types/prosemirror-commands.d.ts +15 -0
  259. package/types/prosemirror-model.d.ts +15 -0
  260. package/types/prosemirror-transform.d.ts +35 -0
  261. package/types/spec.d.ts +42 -0
  262. package/types/toastmark.d.ts +357 -0
  263. package/types/toastui-editor-viewer.d.ts +39 -0
  264. package/types/ui.d.ts +165 -0
  265. package/types/wysiwyg.d.ts +36 -0
package/package.json ADDED
@@ -0,0 +1,95 @@
1
+ {
2
+ "name": "@licium/editor",
3
+ "version": "3.2.3",
4
+ "description": "GFM Markdown Wysiwyg Editor - Productive and Extensible",
5
+ "keywords": [
6
+ "nhn",
7
+ "nhn cloud",
8
+ "toast",
9
+ "toastui",
10
+ "toast-ui",
11
+ "markdown",
12
+ "wysiwyg",
13
+ "editor",
14
+ "preview",
15
+ "gfm"
16
+ ],
17
+ "main": "dist/toastui-editor.js",
18
+ "module": "dist/esm/",
19
+ "exports": {
20
+ ".": {
21
+ "import": "./dist/esm/index.js",
22
+ "require": "./dist/toastui-editor.js"
23
+ },
24
+ "./viewer": {
25
+ "import": "./dist/esm/indexViewer.js",
26
+ "require": "./dist/toastui-editor-viewer.js"
27
+ },
28
+ "./dist/i18n/*": {
29
+ "import": "./dist/esm/i18n/*.js",
30
+ "require": "./dist/i18n/*.js"
31
+ },
32
+ "./dist/toastui-editor-viewer": "./dist/toastui-editor-viewer.js",
33
+ "./dist/toastui-editor.css": "./dist/toastui-editor.css",
34
+ "./dist/toastui-editor-viewer.css": "./dist/toastui-editor-viewer.css",
35
+ "./dist/toastui-editor-only.css": "./dist/toastui-editor-only.css",
36
+ "./dist/theme/toastui-editor-dark.css": "./dist/theme/toastui-editor-dark.css",
37
+ "./toastui-editor.css": "./dist/toastui-editor.css",
38
+ "./toastui-editor-viewer.css": "./dist/toastui-editor-viewer.css",
39
+ "./toastui-editor-only.css": "./dist/toastui-editor-only.css",
40
+ "./toastui-editor-dark.css": "./dist/theme/toastui-editor-dark.css"
41
+ },
42
+ "types": "types/index.d.ts",
43
+ "files": [
44
+ "dist/*.js",
45
+ "dist/*.css",
46
+ "dist/theme",
47
+ "dist/esm",
48
+ "dist/i18n",
49
+ "types"
50
+ ],
51
+ "author": "NHN Cloud FE Development Lab <dl_javascript@nhn.com>",
52
+ "license": "MIT",
53
+ "repository": {
54
+ "type": "git",
55
+ "url": "https://github.com/nhn/tui.editor.git",
56
+ "directory": "apps/editor"
57
+ },
58
+ "bugs": {
59
+ "url": "https://github.com/nhn/tui.editor/issues"
60
+ },
61
+ "homepage": "https://ui.toast.com",
62
+ "browserslist": "last 2 versions, not ie <= 10",
63
+ "scripts": {
64
+ "lint": "eslint .",
65
+ "test:types": "tsc",
66
+ "test": "jest --watch",
67
+ "test:ci": "jest",
68
+ "serve": "snowpack dev",
69
+ "serve:ie": "webpack serve",
70
+ "build:i18n": "cross-env webpack --config scripts/webpack.config.i18n.js && webpack --config scripts/webpack.config.i18n.js --env minify",
71
+ "build:prod": "cross-env webpack build && webpack build --env minify && node tsBannerGenerator.js",
72
+ "build": "npm run build:esm && npm run build:i18n && npm run build:prod",
73
+ "build:esm": "rollup -c",
74
+ "note": "tui-note --tag=$(git describe --tags)",
75
+ "ts2js": "tsc --outDir tmpdoc --sourceMap false --target ES2015 --noEmit false",
76
+ "doc:dev": "npm run ts2js && tuidoc --serv",
77
+ "doc": "npm run ts2js && tuidoc"
78
+ },
79
+ "devDependencies": {
80
+ "@toast-ui/release-notes": "^2.0.1",
81
+ "@types/dompurify": "2.3.3",
82
+ "cross-env": "^6.0.3"
83
+ },
84
+ "dependencies": {
85
+ "dompurify": "^2.3.3",
86
+ "prosemirror-commands": "^1.1.9",
87
+ "prosemirror-history": "^1.1.3",
88
+ "prosemirror-inputrules": "^1.1.3",
89
+ "prosemirror-keymap": "^1.1.4",
90
+ "prosemirror-model": "^1.14.1",
91
+ "prosemirror-state": "^1.3.4",
92
+ "prosemirror-view": "^1.18.7"
93
+ },
94
+ "gitHead": "cbc7cab7b3f081a1aaf1d338b8138512ace132b9"
95
+ }
@@ -0,0 +1,143 @@
1
+ import { NodeType, MarkType, Schema, ProsemirrorNode, Mark } from 'prosemirror-model';
2
+ import { MdNode, MdNodeType, RendererOptions, HTMLToken, MdPos } from './toastmark';
3
+ import { WwNodeType, WwMarkType } from './wysiwyg';
4
+
5
+ export type Attrs = { [name: string]: any } | null;
6
+
7
+ export interface StackItem {
8
+ type: NodeType;
9
+ attrs: Attrs | null;
10
+ content: ProsemirrorNode[];
11
+ }
12
+
13
+ export interface ToWwConvertorState {
14
+ schema: Schema;
15
+ top(): StackItem;
16
+ push(node: ProsemirrorNode): void;
17
+ addText(text: string): void;
18
+ openMark(mark: Mark): void;
19
+ closeMark(mark: MarkType): void;
20
+ addNode(type: NodeType, attrs?: Attrs, content?: ProsemirrorNode[]): ProsemirrorNode | null;
21
+ openNode(type: NodeType, attrs?: Attrs): void;
22
+ closeNode(): ProsemirrorNode | null;
23
+ convertNode(mdNode: MdNode, infoForPosSync: InfoForPosSync): ProsemirrorNode | null;
24
+ convertByDOMParser(root: HTMLElement): void;
25
+ }
26
+
27
+ type ToWwConvertor = (
28
+ state: ToWwConvertorState,
29
+ node: MdNode,
30
+ context: {
31
+ entering: boolean;
32
+ skipChildren: () => void;
33
+ leaf: boolean;
34
+ options: Omit<RendererOptions, 'convertors'>;
35
+ getChildrenText: (mdNode: MdNode) => string;
36
+ origin?: () => HTMLToken | HTMLToken[] | null;
37
+ },
38
+ customAttrs?: { htmlAttrs?: Record<string, any>; classNames?: string[] }
39
+ ) => void;
40
+
41
+ export type ToWwConvertorMap = Partial<Record<string, ToWwConvertor>>;
42
+
43
+ export type FirstDelimFn = (index: number) => string;
44
+
45
+ export interface ToMdConvertorState {
46
+ stopNewline: boolean;
47
+ inTable: boolean;
48
+ getDelim(): string;
49
+ setDelim(delim: string): void;
50
+ flushClose(size?: number): void;
51
+ wrapBlock(delim: string, firstDelim: string | null, node: ProsemirrorNode, fn: () => void): void;
52
+ ensureNewLine(): void;
53
+ write(content?: string): void;
54
+ closeBlock(node: ProsemirrorNode): void;
55
+ text(text: string, escaped?: boolean): void;
56
+ convertBlock(node: ProsemirrorNode, parent: ProsemirrorNode, index: number): void;
57
+ convertInline(parent: ProsemirrorNode): void;
58
+ convertList(node: ProsemirrorNode, delim: string, firstDelimFn: FirstDelimFn): void;
59
+ convertTableCell(node: ProsemirrorNode): void;
60
+ convertNode(parent: ProsemirrorNode, infoForPosSync?: InfoForPosSync): string;
61
+ }
62
+
63
+ export interface ToDOMAdaptor {
64
+ getToDOMNode(type: string): ((node: ProsemirrorNode | Mark) => Node) | null;
65
+ }
66
+
67
+ type HTMLToWwConvertor = (state: ToWwConvertorState, node: MdNode, openTagName: string) => void;
68
+
69
+ export type HTMLToWwConvertorMap = Partial<Record<string, HTMLToWwConvertor>>;
70
+
71
+ export interface FlattenHTMLToWwConvertorMap {
72
+ [k: string]: HTMLToWwConvertor;
73
+ }
74
+
75
+ export interface NodeInfo {
76
+ node: ProsemirrorNode;
77
+ parent?: ProsemirrorNode;
78
+ index?: number;
79
+ }
80
+
81
+ export interface MarkInfo {
82
+ node: Mark;
83
+ parent?: ProsemirrorNode;
84
+ index?: number;
85
+ }
86
+
87
+ interface ToMdConvertorReturnValues {
88
+ delim?: string | string[];
89
+ rawHTML?: string | string[] | null;
90
+ text?: string;
91
+ attrs?: Attrs;
92
+ }
93
+
94
+ type ToMdNodeTypeWriter = (
95
+ state: ToMdConvertorState,
96
+ nodeInfo: NodeInfo,
97
+ params: ToMdConvertorReturnValues
98
+ ) => void;
99
+
100
+ export type ToMdNodeTypeWriterMap = Partial<Record<WwNodeType, ToMdNodeTypeWriter>>;
101
+
102
+ interface ToMdMarkTypeOption {
103
+ mixable?: boolean;
104
+ removedEnclosingWhitespace?: boolean;
105
+ escape?: boolean;
106
+ }
107
+
108
+ export type ToMdMarkTypeOptions = Partial<Record<WwMarkType, ToMdMarkTypeOption | null>>;
109
+
110
+ type ToMdNodeTypeConvertor = (state: ToMdConvertorState, nodeInfo: NodeInfo) => void;
111
+
112
+ export type ToMdNodeTypeConvertorMap = Partial<Record<WwNodeType, ToMdNodeTypeConvertor>>;
113
+
114
+ type ToMdMarkTypeConvertor = (
115
+ nodeInfo?: MarkInfo,
116
+ entering?: boolean
117
+ ) => ToMdConvertorReturnValues & ToMdMarkTypeOption;
118
+
119
+ export type ToMdMarkTypeConvertorMap = Partial<Record<WwMarkType, ToMdMarkTypeConvertor>>;
120
+
121
+ interface ToMdConvertorContext {
122
+ origin?: () => ReturnType<ToMdConvertor>;
123
+ entering?: boolean;
124
+ inTable?: boolean;
125
+ }
126
+
127
+ type ToMdConvertor = (
128
+ nodeInfo: NodeInfo | MarkInfo,
129
+ context: ToMdConvertorContext
130
+ ) => ToMdConvertorReturnValues;
131
+
132
+ export type ToMdConvertorMap = Partial<Record<WwNodeType | MdNodeType, ToMdConvertor>>;
133
+
134
+ export interface ToMdConvertors {
135
+ nodeTypeConvertors: ToMdNodeTypeConvertorMap;
136
+ markTypeConvertors: ToMdMarkTypeConvertorMap;
137
+ }
138
+
139
+ export interface InfoForPosSync {
140
+ node: MdNode | ProsemirrorNode | null;
141
+ setMappedPos: (pos: MdPos | number) => void;
142
+ offset?: number;
143
+ }
@@ -0,0 +1,383 @@
1
+ import { Schema, NodeSpec, MarkSpec, Fragment } from 'prosemirror-model';
2
+ import { EditorView, Decoration, DecorationSet } from 'prosemirror-view';
3
+ import { EditorState, Plugin, PluginKey, Selection, TextSelection } from 'prosemirror-state';
4
+ import { undoInputRule, InputRule, inputRules } from 'prosemirror-inputrules';
5
+ import { keymap } from 'prosemirror-keymap';
6
+ import { Editor } from '@t/index';
7
+
8
+ import {
9
+ HTMLConvertor,
10
+ MdPos,
11
+ Sourcepos,
12
+ Context as MdContext,
13
+ HTMLToken,
14
+ HTMLConvertorMap,
15
+ } from './toastmark';
16
+ import { Emitter, Handler } from './event';
17
+ import { Context, EditorAllCommandMap, EditorCommandFn, SpecManager } from './spec';
18
+ import { ToMdConvertorMap } from './convertor';
19
+ import { ToolbarItemOptions, IndexList } from './ui';
20
+ import { CommandFn, PluginInfo } from './plugin';
21
+ import { HTMLMdNode } from './markdown';
22
+
23
+ export type PreviewStyle = 'tab' | 'vertical';
24
+ export type EditorType = 'markdown' | 'wysiwyg';
25
+ export type WidgetStyle = 'top' | 'bottom';
26
+ export interface WidgetRule {
27
+ rule: RegExp;
28
+ toDOM: (text: string) => HTMLElement;
29
+ }
30
+
31
+ export type WidgetRuleMap = Record<string, WidgetRule>;
32
+
33
+ export interface EventMap {
34
+ load?: (param: Editor) => void;
35
+ change?: (editorType: EditorType) => void;
36
+ caretChange?: (editorType: EditorType) => void;
37
+ focus?: (editorType: EditorType) => void;
38
+ blur?: (editorType: EditorType) => void;
39
+ keydown?: (editorType: EditorType, ev: KeyboardEvent) => void;
40
+ keyup?: (editorType: EditorType, ev: KeyboardEvent) => void;
41
+ beforePreviewRender?: (html: string) => string;
42
+ beforeConvertWysiwygToMarkdown?: (markdownText: string) => string;
43
+ }
44
+
45
+ type HookCallback = (url: string, text?: string) => void;
46
+
47
+ export type HookMap = {
48
+ addImageBlobHook?: (blob: Blob | File, callback: HookCallback) => void;
49
+ };
50
+
51
+ export type AutolinkParser = (
52
+ content: string
53
+ ) => {
54
+ url: string;
55
+ text: string;
56
+ range: [number, number];
57
+ }[];
58
+
59
+ export type ExtendedAutolinks = boolean | AutolinkParser;
60
+
61
+ export type LinkAttributeNames = 'rel' | 'target' | 'hreflang' | 'type';
62
+
63
+ // @TODO change option and type name from singular to plural
64
+ export type LinkAttributes = Partial<Record<LinkAttributeNames, string>>;
65
+
66
+ export type Sanitizer = (content: string) => string;
67
+
68
+ export type HTMLMdNodeConvertor = (
69
+ node: HTMLMdNode,
70
+ context: MdContext,
71
+ convertors?: HTMLConvertorMap
72
+ ) => HTMLToken | HTMLToken[] | null;
73
+
74
+ export type HTMLMdNodeConvertorMap = Record<string, HTMLMdNodeConvertor>;
75
+
76
+ export type CustomHTMLRenderer = Partial<Record<string, HTMLConvertor | HTMLMdNodeConvertorMap>>;
77
+
78
+ export interface ViewerOptions {
79
+ el: HTMLElement;
80
+ initialValue?: string;
81
+ events?: EventMap;
82
+ plugins?: EditorPlugin[];
83
+ extendedAutolinks?: ExtendedAutolinks;
84
+ linkAttributes?: LinkAttributes;
85
+ customHTMLRenderer?: CustomHTMLRenderer;
86
+ referenceDefinition?: boolean;
87
+ customHTMLSanitizer?: Sanitizer;
88
+ frontMatter?: boolean;
89
+ usageStatistics?: boolean;
90
+ theme?: string;
91
+ }
92
+
93
+ export class Viewer {
94
+ static isViewer: boolean;
95
+
96
+ constructor(options: ViewerOptions);
97
+
98
+ setMarkdown(markdown: string): void;
99
+
100
+ on(type: string, handler: Handler): void;
101
+
102
+ off(type: string): void;
103
+
104
+ destroy(): void;
105
+
106
+ isViewer(): boolean;
107
+
108
+ isMarkdownMode(): boolean;
109
+
110
+ isWysiwygMode(): boolean;
111
+
112
+ addHook(type: string, handler: Handler): void;
113
+ }
114
+
115
+ export interface I18n {
116
+ setCode(code?: string): void;
117
+
118
+ setLanguage(codes: string | string[], data: Record<string, string>): void;
119
+
120
+ get(key: string, code?: string): string;
121
+ }
122
+
123
+ export interface PluginContext {
124
+ eventEmitter: Emitter;
125
+ usageStatistics?: boolean;
126
+ i18n: I18n;
127
+ instance: Editor | Viewer;
128
+ pmState: {
129
+ Plugin: typeof Plugin;
130
+ PluginKey: typeof PluginKey;
131
+ Selection: typeof Selection;
132
+ TextSelection: typeof TextSelection;
133
+ };
134
+ pmView: { Decoration: typeof Decoration; DecorationSet: typeof DecorationSet };
135
+ pmModel: { Fragment: typeof Fragment };
136
+ pmRules: {
137
+ inputRules: typeof inputRules;
138
+ InputRule: typeof InputRule;
139
+ undoInputRule: typeof undoInputRule;
140
+ };
141
+ pmKeymap: {
142
+ keymap: typeof keymap;
143
+ };
144
+ }
145
+
146
+ export type PluginFn = (context: PluginContext, options?: any) => PluginInfo | null;
147
+ export type EditorPlugin = PluginFn | [PluginFn, any];
148
+ type ContextInfo = {
149
+ eventEmitter: Emitter;
150
+ usageStatistics: boolean;
151
+ instance: Editor | Viewer;
152
+ };
153
+
154
+ export type EditorPluginInfo = ContextInfo & {
155
+ plugin: EditorPlugin;
156
+ };
157
+
158
+ export type EditorPluginsInfo = ContextInfo & {
159
+ plugins: EditorPlugin[];
160
+ };
161
+
162
+ export interface EditorOptions {
163
+ el: HTMLElement;
164
+ height?: string;
165
+ minHeight?: string;
166
+ initialValue?: string;
167
+ previewStyle?: PreviewStyle;
168
+ initialEditType?: EditorType;
169
+ events?: EventMap;
170
+ hooks?: HookMap;
171
+ language?: string;
172
+ useCommandShortcut?: boolean;
173
+ usageStatistics?: boolean;
174
+ toolbarItems?: (string | ToolbarItemOptions)[][];
175
+ hideModeSwitch?: boolean;
176
+ plugins?: EditorPlugin[];
177
+ extendedAutolinks?: ExtendedAutolinks;
178
+ placeholder?: string;
179
+ linkAttributes?: LinkAttributes;
180
+ customHTMLRenderer?: CustomHTMLRenderer;
181
+ customMarkdownRenderer?: ToMdConvertorMap;
182
+ referenceDefinition?: boolean;
183
+ customHTMLSanitizer?: Sanitizer;
184
+ previewHighlight?: boolean;
185
+ frontMatter?: boolean;
186
+ widgetRules?: WidgetRule[];
187
+ theme?: string;
188
+ autofocus?: boolean;
189
+ viewer?: boolean;
190
+ }
191
+
192
+ interface Slots {
193
+ mdEditor: HTMLElement;
194
+ mdPreview: HTMLElement;
195
+ wwEditor: HTMLElement;
196
+ }
197
+
198
+ export class EditorCore {
199
+ constructor(options: EditorOptions);
200
+
201
+ public eventEmitter: Emitter;
202
+
203
+ public static factory(options: EditorOptions): EditorCore | Viewer;
204
+
205
+ public static setLanguage(code: string, data: Record<string, string>): void;
206
+
207
+ changePreviewStyle(style: PreviewStyle): void;
208
+
209
+ exec(name: string, payload?: Record<string, any>): void;
210
+
211
+ addCommand(type: EditorType, name: string, command: CommandFn): void;
212
+
213
+ on(type: string, handler: Handler): void;
214
+
215
+ off(type: string): void;
216
+
217
+ addHook(type: string, handler: Handler): void;
218
+
219
+ removeHook(type: string): void;
220
+
221
+ focus(): void;
222
+
223
+ blur(): void;
224
+
225
+ moveCursorToEnd(focus?: boolean): void;
226
+
227
+ moveCursorToStart(focus?: boolean): void;
228
+
229
+ setMarkdown(markdown: string, cursorToEnd?: boolean): void;
230
+
231
+ setHTML(html: string, cursorToEnd?: boolean): void;
232
+
233
+ getMarkdown(): string;
234
+
235
+ getHTML(): string;
236
+
237
+ insertText(text: string): void;
238
+
239
+ setSelection(start: EditorPos, end?: EditorPos): void;
240
+
241
+ replaceSelection(text: string, start?: EditorPos, end?: EditorPos): void;
242
+
243
+ deleteSelection(start?: EditorPos, end?: EditorPos): void;
244
+
245
+ getSelectedText(start?: EditorPos, end?: EditorPos): string;
246
+
247
+ getRangeInfoOfNode(pos?: EditorPos): NodeRangeInfo;
248
+
249
+ addWidget(node: Node, style: WidgetStyle, pos?: EditorPos): void;
250
+
251
+ replaceWithWidget(start: EditorPos, end: EditorPos, text: string): void;
252
+
253
+ setHeight(height: string): void;
254
+
255
+ getHeight(): string;
256
+
257
+ setMinHeight(minHeight: string): void;
258
+
259
+ getMinHeight(): string;
260
+
261
+ isMarkdownMode(): boolean;
262
+
263
+ isWysiwygMode(): boolean;
264
+
265
+ isViewer(): boolean;
266
+
267
+ getCurrentPreviewStyle(): PreviewStyle;
268
+
269
+ changeMode(mode: EditorType, isWithoutFocus?: boolean): void;
270
+
271
+ destroy(): void;
272
+
273
+ hide(): void;
274
+
275
+ show(): void;
276
+
277
+ setScrollTop(value: number): void;
278
+
279
+ getScrollTop(): number;
280
+
281
+ reset(): void;
282
+
283
+ getSelection(): SelectionPos;
284
+
285
+ setPlaceholder(placeholder: string): void;
286
+
287
+ getEditorElements(): Slots;
288
+
289
+ convertPosToMatchEditorMode(start: EditorPos, end?: EditorPos, mode?: EditorType): EditorPos[];
290
+ }
291
+
292
+ export class Editor extends EditorCore {
293
+ insertToolbarItem({ groupIndex, itemIndex }: IndexList, item: string | ToolbarItemOptions): void;
294
+
295
+ removeToolbarItem(itemName: string): void;
296
+ }
297
+
298
+ export type SelectionPos = Sourcepos | [from: number, to: number];
299
+ export type EditorPos = MdPos | number;
300
+ export interface NodeRangeInfo {
301
+ range: SelectionPos;
302
+ type: string;
303
+ }
304
+
305
+ export interface Base {
306
+ el: HTMLElement;
307
+
308
+ editorType: EditorType;
309
+
310
+ eventEmitter: Emitter;
311
+
312
+ context: Context;
313
+
314
+ schema: Schema;
315
+
316
+ keymaps: Plugin[];
317
+
318
+ view: EditorView;
319
+
320
+ commands: EditorAllCommandMap;
321
+
322
+ specs: SpecManager;
323
+
324
+ placeholder: { text: string };
325
+
326
+ createSpecs(): SpecManager;
327
+
328
+ createContext(): Context;
329
+
330
+ createState(): EditorState;
331
+
332
+ createView(): EditorView;
333
+
334
+ createSchema(): Schema;
335
+
336
+ createKeymaps(useCommandShortcut: boolean): Plugin<any, any>[];
337
+
338
+ createCommands(): Record<string, EditorCommandFn<Record<string, any>>>;
339
+
340
+ focus(): void;
341
+
342
+ blur(): void;
343
+
344
+ destroy(): void;
345
+
346
+ moveCursorToStart(focus: boolean): void;
347
+
348
+ moveCursorToEnd(focus: boolean): void;
349
+
350
+ setScrollTop(top: number): void;
351
+
352
+ getScrollTop(): number;
353
+
354
+ setPlaceholder(text: string): void;
355
+
356
+ setHeight(height: number): void;
357
+
358
+ setMinHeight(minHeight: number): void;
359
+
360
+ getElement(): HTMLElement;
361
+
362
+ setSelection(start: EditorPos, end?: EditorPos): void;
363
+
364
+ replaceWithWidget(start: EditorPos, end: EditorPos, text: string): void;
365
+
366
+ addWidget(node: Node, style: WidgetStyle, pos?: EditorPos): void;
367
+
368
+ replaceSelection(text: string, start?: EditorPos, end?: EditorPos): void;
369
+
370
+ deleteSelection(start?: EditorPos, end?: EditorPos): void;
371
+
372
+ getSelectedText(start?: EditorPos, end?: EditorPos): string;
373
+
374
+ getSelection(): SelectionPos;
375
+
376
+ getRangeInfoOfNode(pos?: EditorPos): NodeRangeInfo;
377
+ }
378
+
379
+ export type SchemaMap = Record<string, NodeSpec | MarkSpec>;
380
+ export interface HTMLSchemaMap {
381
+ nodes: SchemaMap;
382
+ marks: SchemaMap;
383
+ }
@@ -0,0 +1,56 @@
1
+ import { Mapable } from './map';
2
+
3
+ export interface Handler {
4
+ (...args: any[]): any;
5
+ namespace?: string;
6
+ }
7
+
8
+ export interface Emitter {
9
+ listen(type: string, handler: Handler): void;
10
+ emit(type: string, ...args: any[]): any[];
11
+ emitReduce(type: string, source: any, ...args: any[]): any;
12
+ addEventType(type: string): void;
13
+ removeEventHandler(type: string, handler?: Handler): void;
14
+ getEvents(): Mapable<string, Handler[] | undefined>;
15
+ holdEventInvoke(fn: Function): void;
16
+ }
17
+
18
+ export interface EmitterConstructor {
19
+ new (): Emitter;
20
+ }
21
+
22
+ export type EventTypes =
23
+ | 'afterPreviewRender'
24
+ | 'updatePreview'
25
+ | 'changeMode'
26
+ | 'needChangeMode'
27
+ | 'command'
28
+ | 'changePreviewStyle'
29
+ | 'changePreviewTabPreview'
30
+ | 'changePreviewTabWrite'
31
+ | 'scroll'
32
+ | 'contextmenu'
33
+ | 'show'
34
+ | 'hide'
35
+ | 'changeLanguage'
36
+ | 'changeToolbarState'
37
+ | 'toggleScrollSync'
38
+ | 'mixinTableOffsetMapPrototype'
39
+ | 'setFocusedNode'
40
+ | 'removePopupWidget'
41
+ | 'query'
42
+ // provide event for user
43
+ | 'openPopup'
44
+ | 'closePopup'
45
+ | 'addImageBlobHook'
46
+ | 'beforePreviewRender'
47
+ | 'beforeConvertWysiwygToMarkdown'
48
+ | 'load'
49
+ | 'loadUI'
50
+ | 'change'
51
+ | 'caretChange'
52
+ | 'destroy'
53
+ | 'focus'
54
+ | 'blur'
55
+ | 'keydown'
56
+ | 'keyup';