@plotdb/quill 1.0.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 (287) hide show
  1. package/LICENSE +31 -0
  2. package/README.md +3 -0
  3. package/assets/base.styl +309 -0
  4. package/assets/bubble/toolbar.styl +14 -0
  5. package/assets/bubble/tooltip.styl +49 -0
  6. package/assets/bubble.styl +45 -0
  7. package/assets/core.styl +215 -0
  8. package/assets/favicon.png +0 -0
  9. package/assets/icons/align-center.svg +5 -0
  10. package/assets/icons/align-justify.svg +5 -0
  11. package/assets/icons/align-left.svg +5 -0
  12. package/assets/icons/align-right.svg +5 -0
  13. package/assets/icons/attachment.svg +3 -0
  14. package/assets/icons/audio.svg +5 -0
  15. package/assets/icons/authorship.svg +5 -0
  16. package/assets/icons/background.svg +52 -0
  17. package/assets/icons/blockquote.svg +6 -0
  18. package/assets/icons/bold.svg +4 -0
  19. package/assets/icons/clean.svg +7 -0
  20. package/assets/icons/code.svg +5 -0
  21. package/assets/icons/color.svg +5 -0
  22. package/assets/icons/comment.svg +3 -0
  23. package/assets/icons/direction-ltr.svg +7 -0
  24. package/assets/icons/direction-rtl.svg +7 -0
  25. package/assets/icons/dropdown.svg +4 -0
  26. package/assets/icons/embed.svg +3 -0
  27. package/assets/icons/emoji.svg +6 -0
  28. package/assets/icons/float-center.svg +5 -0
  29. package/assets/icons/float-full.svg +5 -0
  30. package/assets/icons/float-left.svg +7 -0
  31. package/assets/icons/float-right.svg +7 -0
  32. package/assets/icons/font.svg +5 -0
  33. package/assets/icons/formula.svg +5 -0
  34. package/assets/icons/hashtag.svg +6 -0
  35. package/assets/icons/header-2.svg +3 -0
  36. package/assets/icons/header-3.svg +3 -0
  37. package/assets/icons/header-4.svg +3 -0
  38. package/assets/icons/header-5.svg +3 -0
  39. package/assets/icons/header-6.svg +3 -0
  40. package/assets/icons/header.svg +3 -0
  41. package/assets/icons/horizontal-rule.svg +4 -0
  42. package/assets/icons/image.svg +5 -0
  43. package/assets/icons/indent.svg +6 -0
  44. package/assets/icons/italic.svg +5 -0
  45. package/assets/icons/link.svg +5 -0
  46. package/assets/icons/list-bullet.svg +8 -0
  47. package/assets/icons/list-check.svg +8 -0
  48. package/assets/icons/list-ordered.svg +9 -0
  49. package/assets/icons/map.svg +5 -0
  50. package/assets/icons/mention.svg +4 -0
  51. package/assets/icons/more.svg +3 -0
  52. package/assets/icons/outdent.svg +6 -0
  53. package/assets/icons/redo.svg +4 -0
  54. package/assets/icons/size-decrease.svg +5 -0
  55. package/assets/icons/size-increase.svg +6 -0
  56. package/assets/icons/size.svg +6 -0
  57. package/assets/icons/spacing.svg +9 -0
  58. package/assets/icons/speech.svg +6 -0
  59. package/assets/icons/strike.svg +5 -0
  60. package/assets/icons/subscript.svg +4 -0
  61. package/assets/icons/superscript.svg +4 -0
  62. package/assets/icons/table-border-all.svg +5 -0
  63. package/assets/icons/table-border-bottom.svg +28 -0
  64. package/assets/icons/table-border-left.svg +28 -0
  65. package/assets/icons/table-border-none.svg +25 -0
  66. package/assets/icons/table-border-outside.svg +35 -0
  67. package/assets/icons/table-border-right.svg +28 -0
  68. package/assets/icons/table-border-top.svg +28 -0
  69. package/assets/icons/table-delete-cells.svg +13 -0
  70. package/assets/icons/table-delete-columns.svg +8 -0
  71. package/assets/icons/table-delete-rows.svg +9 -0
  72. package/assets/icons/table-insert-cells.svg +13 -0
  73. package/assets/icons/table-insert-columns.svg +8 -0
  74. package/assets/icons/table-insert-rows.svg +9 -0
  75. package/assets/icons/table-merge-cells.svg +4 -0
  76. package/assets/icons/table-unmerge-cells.svg +7 -0
  77. package/assets/icons/table.svg +11 -0
  78. package/assets/icons/underline.svg +4 -0
  79. package/assets/icons/undo.svg +4 -0
  80. package/assets/icons/video.svg +14 -0
  81. package/assets/snow/toolbar.styl +26 -0
  82. package/assets/snow/tooltip.styl +53 -0
  83. package/assets/snow.styl +18 -0
  84. package/blots/block.d.ts +34 -0
  85. package/blots/block.js +182 -0
  86. package/blots/block.js.map +1 -0
  87. package/blots/break.d.ts +8 -0
  88. package/blots/break.js +21 -0
  89. package/blots/break.js.map +1 -0
  90. package/blots/container.d.ts +4 -0
  91. package/blots/container.js +4 -0
  92. package/blots/container.js.map +1 -0
  93. package/blots/cursor.d.ts +26 -0
  94. package/blots/cursor.js +170 -0
  95. package/blots/cursor.js.map +1 -0
  96. package/blots/embed.d.ts +18 -0
  97. package/blots/embed.js +72 -0
  98. package/blots/embed.js.map +1 -0
  99. package/blots/inline.d.ts +12 -0
  100. package/blots/inline.js +48 -0
  101. package/blots/inline.js.map +1 -0
  102. package/blots/scroll.d.ts +49 -0
  103. package/blots/scroll.js +349 -0
  104. package/blots/scroll.js.map +1 -0
  105. package/blots/text.d.ts +5 -0
  106. package/blots/text.js +16 -0
  107. package/blots/text.js.map +1 -0
  108. package/core/composition.d.ts +12 -0
  109. package/core/composition.js +44 -0
  110. package/core/composition.js.map +1 -0
  111. package/core/editor.d.ts +28 -0
  112. package/core/editor.js +404 -0
  113. package/core/editor.js.map +1 -0
  114. package/core/emitter.d.ts +33 -0
  115. package/core/emitter.js +78 -0
  116. package/core/emitter.js.map +1 -0
  117. package/core/instances.d.ts +3 -0
  118. package/core/instances.js +2 -0
  119. package/core/instances.js.map +1 -0
  120. package/core/logger.d.ts +7 -0
  121. package/core/logger.js +24 -0
  122. package/core/logger.js.map +1 -0
  123. package/core/module.d.ts +8 -0
  124. package/core/module.js +10 -0
  125. package/core/module.js.map +1 -0
  126. package/core/quill.d.ts +218 -0
  127. package/core/quill.js +630 -0
  128. package/core/quill.js.map +1 -0
  129. package/core/selection.d.ts +74 -0
  130. package/core/selection.js +374 -0
  131. package/core/selection.js.map +1 -0
  132. package/core/theme.d.ts +32 -0
  133. package/core/theme.js +28 -0
  134. package/core/theme.js.map +1 -0
  135. package/core/utils/createRegistryWithFormats.d.ts +5 -0
  136. package/core/utils/createRegistryWithFormats.js +29 -0
  137. package/core/utils/createRegistryWithFormats.js.map +1 -0
  138. package/core/utils/scrollRectIntoView.d.ts +11 -0
  139. package/core/utils/scrollRectIntoView.js +110 -0
  140. package/core/utils/scrollRectIntoView.js.map +1 -0
  141. package/core.d.ts +7 -0
  142. package/core.js +37 -0
  143. package/core.js.map +1 -0
  144. package/dist/quill.bubble.css +10 -0
  145. package/dist/quill.bubble.css.map +1 -0
  146. package/dist/quill.core.css +10 -0
  147. package/dist/quill.core.css.map +1 -0
  148. package/dist/quill.core.js +3 -0
  149. package/dist/quill.core.js.LICENSE.txt +7 -0
  150. package/dist/quill.core.js.map +1 -0
  151. package/dist/quill.js +3 -0
  152. package/dist/quill.js.LICENSE.txt +7 -0
  153. package/dist/quill.js.map +1 -0
  154. package/dist/quill.snow.css +10 -0
  155. package/dist/quill.snow.css.map +1 -0
  156. package/formats/align.d.ts +5 -0
  157. package/formats/align.js +10 -0
  158. package/formats/align.js.map +1 -0
  159. package/formats/background.d.ts +5 -0
  160. package/formats/background.js +10 -0
  161. package/formats/background.js.map +1 -0
  162. package/formats/blockquote.d.ts +6 -0
  163. package/formats/blockquote.js +7 -0
  164. package/formats/blockquote.js.map +1 -0
  165. package/formats/bold.d.ts +11 -0
  166. package/formats/bold.js +19 -0
  167. package/formats/bold.js.map +1 -0
  168. package/formats/code.d.ts +15 -0
  169. package/formats/code.js +44 -0
  170. package/formats/code.js.map +1 -0
  171. package/formats/color.d.ts +7 -0
  172. package/formats/color.js +18 -0
  173. package/formats/color.js.map +1 -0
  174. package/formats/direction.d.ts +5 -0
  175. package/formats/direction.js +10 -0
  176. package/formats/direction.js.map +1 -0
  177. package/formats/font.d.ts +7 -0
  178. package/formats/font.js +14 -0
  179. package/formats/font.js.map +1 -0
  180. package/formats/formula.d.ts +10 -0
  181. package/formats/formula.js +34 -0
  182. package/formats/formula.js.map +1 -0
  183. package/formats/header.d.ts +7 -0
  184. package/formats/header.js +10 -0
  185. package/formats/header.js.map +1 -0
  186. package/formats/image.d.ts +13 -0
  187. package/formats/image.js +44 -0
  188. package/formats/image.js.map +1 -0
  189. package/formats/indent.d.ts +8 -0
  190. package/formats/indent.js +30 -0
  191. package/formats/indent.js.map +1 -0
  192. package/formats/italic.d.ts +6 -0
  193. package/formats/italic.js +7 -0
  194. package/formats/italic.js.map +1 -0
  195. package/formats/link.d.ts +13 -0
  196. package/formats/link.js +36 -0
  197. package/formats/link.js.map +1 -0
  198. package/formats/list.d.ts +13 -0
  199. package/formats/list.js +50 -0
  200. package/formats/list.js.map +1 -0
  201. package/formats/script.d.ts +8 -0
  202. package/formats/script.js +21 -0
  203. package/formats/script.js.map +1 -0
  204. package/formats/size.d.ts +4 -0
  205. package/formats/size.js +11 -0
  206. package/formats/size.js.map +1 -0
  207. package/formats/strike.d.ts +6 -0
  208. package/formats/strike.js +7 -0
  209. package/formats/strike.js.map +1 -0
  210. package/formats/table.d.ts +45 -0
  211. package/formats/table.js +176 -0
  212. package/formats/table.js.map +1 -0
  213. package/formats/underline.d.ts +6 -0
  214. package/formats/underline.js +7 -0
  215. package/formats/underline.js.map +1 -0
  216. package/formats/video.d.ts +14 -0
  217. package/formats/video.js +49 -0
  218. package/formats/video.js.map +1 -0
  219. package/modules/clipboard.d.ts +43 -0
  220. package/modules/clipboard.js +477 -0
  221. package/modules/clipboard.js.map +1 -0
  222. package/modules/history.d.ts +36 -0
  223. package/modules/history.js +178 -0
  224. package/modules/history.js.map +1 -0
  225. package/modules/input.d.ts +10 -0
  226. package/modules/input.js +83 -0
  227. package/modules/input.js.map +1 -0
  228. package/modules/keyboard.d.ts +58 -0
  229. package/modules/keyboard.js +713 -0
  230. package/modules/keyboard.js.map +1 -0
  231. package/modules/normalizeExternalHTML/index.d.ts +2 -0
  232. package/modules/normalizeExternalHTML/index.js +12 -0
  233. package/modules/normalizeExternalHTML/index.js.map +1 -0
  234. package/modules/normalizeExternalHTML/normalizers/googleDocs.d.ts +1 -0
  235. package/modules/normalizeExternalHTML/normalizers/googleDocs.js +24 -0
  236. package/modules/normalizeExternalHTML/normalizers/googleDocs.js.map +1 -0
  237. package/modules/normalizeExternalHTML/normalizers/msWord.d.ts +1 -0
  238. package/modules/normalizeExternalHTML/normalizers/msWord.js +87 -0
  239. package/modules/normalizeExternalHTML/normalizers/msWord.js.map +1 -0
  240. package/modules/syntax.d.ts +50 -0
  241. package/modules/syntax.js +332 -0
  242. package/modules/syntax.js.map +1 -0
  243. package/modules/table.d.ts +20 -0
  244. package/modules/table.js +125 -0
  245. package/modules/table.js.map +1 -0
  246. package/modules/tableEmbed.d.ts +27 -0
  247. package/modules/tableEmbed.js +209 -0
  248. package/modules/tableEmbed.js.map +1 -0
  249. package/modules/toolbar.d.ts +24 -0
  250. package/modules/toolbar.js +265 -0
  251. package/modules/toolbar.js.map +1 -0
  252. package/modules/uiNode.d.ts +19 -0
  253. package/modules/uiNode.js +95 -0
  254. package/modules/uiNode.js.map +1 -0
  255. package/modules/uploader.d.ts +15 -0
  256. package/modules/uploader.js +69 -0
  257. package/modules/uploader.js.map +1 -0
  258. package/package.json +102 -0
  259. package/quill.d.ts +5 -0
  260. package/quill.js +82 -0
  261. package/quill.js.map +1 -0
  262. package/themes/base.d.ts +35 -0
  263. package/themes/base.js +257 -0
  264. package/themes/base.js.map +1 -0
  265. package/themes/bubble.d.ts +18 -0
  266. package/themes/bubble.js +114 -0
  267. package/themes/bubble.js.map +1 -0
  268. package/themes/snow.d.ts +9 -0
  269. package/themes/snow.js +122 -0
  270. package/themes/snow.js.map +1 -0
  271. package/types.d.js +2 -0
  272. package/types.d.js.map +1 -0
  273. package/ui/color-picker.d.ts +7 -0
  274. package/ui/color-picker.js +30 -0
  275. package/ui/color-picker.js.map +1 -0
  276. package/ui/icon-picker.d.ts +7 -0
  277. package/ui/icon-picker.js +22 -0
  278. package/ui/icon-picker.js.map +1 -0
  279. package/ui/icons.d.ts +49 -0
  280. package/ui/icons.js +82 -0
  281. package/ui/icons.js.map +1 -0
  282. package/ui/picker.d.ts +16 -0
  283. package/ui/picker.js +171 -0
  284. package/ui/picker.js.map +1 -0
  285. package/ui/tooltip.d.ts +12 -0
  286. package/ui/tooltip.js +56 -0
  287. package/ui/tooltip.js.map +1 -0
@@ -0,0 +1,28 @@
1
+ <svg viewbox="0 0 18 18">
2
+ <g class="ql-fill ql-transparent">
3
+ <rect height="2" transform="translate(-12 18) rotate(-90)" width="2" x="2" y="14"></rect>
4
+ <rect height="2" transform="translate(-9 15) rotate(-90)" width="2" x="2" y="11"></rect>
5
+ <rect height="2" transform="translate(-6 12) rotate(-90)" width="2" x="2" y="8"></rect>
6
+ <rect height="2" transform="translate(0 6) rotate(-90)" width="2" x="2" y="2"></rect>
7
+ <rect height="2" transform="translate(-3 9) rotate(-90)" width="2" x="2" y="5"></rect>
8
+ <rect height="2" transform="translate(0 30) rotate(-90)" width="2" x="14" y="14"></rect>
9
+ <rect height="2" transform="translate(3 27) rotate(-90)" width="2" x="14" y="11"></rect>
10
+ <rect height="2" transform="translate(6 24) rotate(-90)" width="2" x="14" y="8"></rect>
11
+ <rect height="2" transform="translate(12 18) rotate(-90)" width="2" x="14" y="2"></rect>
12
+ <rect height="2" transform="translate(9 21) rotate(-90)" width="2" x="14" y="5"></rect>
13
+ </g>
14
+ <line class="ql-stroke-miter" x1="16" x2="2" y1="3" y2="3"></line>
15
+ <g class="ql-fill ql-transparent">
16
+ <rect height="2" transform="translate(24 30) rotate(-180)" width="2" x="11" y="14"></rect>
17
+ <rect height="2" transform="translate(18 30) rotate(-180)" width="2" x="8" y="14"></rect>
18
+ <rect height="2" transform="translate(12 30) rotate(-180)" width="2" x="5" y="14"></rect>
19
+ <rect height="2" transform="translate(24 6) rotate(-180)" width="2" x="11" y="2"></rect>
20
+ <rect height="2" transform="translate(18 6) rotate(-180)" width="2" x="8" y="2"></rect>
21
+ <rect height="2" transform="translate(18 12) rotate(-180)" width="2" x="8" y="5"></rect>
22
+ <rect height="2" transform="translate(18 18) rotate(-180)" width="2" x="8" y="8"></rect>
23
+ <rect height="2" transform="translate(18 24) rotate(-180)" width="2" x="8" y="11"></rect>
24
+ <rect height="2" transform="translate(3 21) rotate(-90)" width="2" x="11" y="8"></rect>
25
+ <rect height="2" transform="translate(-3 15) rotate(-90)" width="2" x="5" y="8"></rect>
26
+ <rect height="2" transform="translate(12 6) rotate(-180)" width="2" x="5" y="2"></rect>
27
+ </g>
28
+ </svg>
@@ -0,0 +1,13 @@
1
+ <svg viewbox="0 0 18 18">
2
+ <path class="ql-fill" d="M15.707,7l1.146-1.146a0.5,0.5,0,1,0-.707-0.707L15,6.293,13.854,5.146a0.5,0.5,0,0,0-.707.707L14.293,7,13.146,8.146a0.5,0.5,0,1,0,.707.707L15,7.707l1.146,1.146a0.5,0.5,0,1,0,.707-0.707Z"></path>
3
+ <path class="ql-fill" d="M6,5H3A1,1,0,0,0,2,6V8A1,1,0,0,0,3,9H6V5Z"></path>
4
+ <path class="ql-fill" d="M10,5H7V9h3a1,1,0,0,0,1-1V6A1,1,0,0,0,10,5Z"></path>
5
+ <g class="ql-fill ql-transparent">
6
+ <path d="M8,11h4V9a1,1,0,0,0-1-1H8v3Z"></path>
7
+ <path d="M7,11V8H4A1,1,0,0,0,3,9v2H7Z"></path>
8
+ <path d="M7,12H3v2a1,1,0,0,0,1,1H7V12Z"></path>
9
+ <path d="M8,12v3h3a1,1,0,0,0,1-1V12H8Z"></path>
10
+ <path d="M8,6h3a1,1,0,0,0,1-1V3a1,1,0,0,0-1-1H8V6Z"></path>
11
+ <path d="M4,6H7V2H4A1,1,0,0,0,3,3V5A1,1,0,0,0,4,6Z"></path>
12
+ </g>
13
+ </svg>
@@ -0,0 +1,8 @@
1
+ <svg viewbox="0 0 18 18">
2
+ <g class="ql-fill ql-transparent">
3
+ <rect height="10" rx="1" ry="1" width="4" x="2" y="6"></rect>
4
+ <rect height="10" rx="1" ry="1" width="4" x="12" y="6"></rect>
5
+ </g>
6
+ <rect class="ql-fill" height="8" rx="1" ry="1" width="4" x="7" y="2"></rect>
7
+ <path class="ql-fill" d="M9.707,13l1.146-1.146a0.5,0.5,0,0,0-.707-0.707L9,12.293,7.854,11.146a0.5,0.5,0,0,0-.707.707L8.293,13,7.146,14.146a0.5,0.5,0,1,0,.707.707L9,13.707l1.146,1.146a0.5,0.5,0,0,0,.707-0.707Z"></path>
8
+ </svg>
@@ -0,0 +1,9 @@
1
+ <svg viewbox="0 0 18 18">
2
+ <g class="ql-fill ql-stroke ql-thin ql-transparent">
3
+ <rect height="3" rx="0.5" ry="0.5" width="7" x="4.5" y="2.5"></rect>
4
+ <rect height="3" rx="0.5" ry="0.5" width="7" x="4.5" y="12.5"></rect>
5
+ </g>
6
+ <rect class="ql-fill ql-stroke ql-thin" height="3" rx="0.5" ry="0.5" width="7" x="8.5" y="7.5"></rect>
7
+ <line class="ql-stroke ql-thin" x1="6.5" x2="3.5" y1="7.5" y2="10.5"></line>
8
+ <line class="ql-stroke ql-thin" x1="3.5" x2="6.5" y1="7.5" y2="10.5"></line>
9
+ </svg>
@@ -0,0 +1,13 @@
1
+ <svg viewbox="0 0 18 18">
2
+ <g class="ql-fill ql-transparent">
3
+ <path d="M11,11h4V9a1,1,0,0,0-1-1H11v3Z"></path>
4
+ <path d="M10,11V8H7A1,1,0,0,0,6,9v2h4Z"></path>
5
+ <path d="M10,12H6v2a1,1,0,0,0,1,1h3V12Z"></path>
6
+ <path d="M11,12v3h3a1,1,0,0,0,1-1V12H11Z"></path>
7
+ <path d="M11,6h3a1,1,0,0,0,1-1V3a1,1,0,0,0-1-1H11V6Z"></path>
8
+ <path d="M7,6h3V2H7A1,1,0,0,0,6,3V5A1,1,0,0,0,7,6Z"></path>
9
+ </g>
10
+ <path class="ql-fill" d="M5,6H4V5a0.5,0.5,0,0,0-.854-0.354l-2,2a0.5,0.5,0,0,0,0,.707l2,2A0.5,0.5,0,0,0,3.5,9.5a0.494,0.494,0,0,0,.191-0.038A0.5,0.5,0,0,0,4,9V8H5A1,1,0,0,0,5,6Z"></path>
11
+ <path class="ql-fill" d="M15,5H12V9h3a1,1,0,0,0,1-1V6A1,1,0,0,0,15,5Z"></path>
12
+ <path class="ql-fill" d="M11,5H8A1,1,0,0,0,7,6V8A1,1,0,0,0,8,9h3V5Z"></path>
13
+ </svg>
@@ -0,0 +1,8 @@
1
+ <svg viewbox="0 0 18 18">
2
+ <g class="ql-fill ql-transparent">
3
+ <rect height="10" rx="1" ry="1" width="4" x="12" y="2"></rect>
4
+ <rect height="10" rx="1" ry="1" width="4" x="2" y="2"></rect>
5
+ </g>
6
+ <path class="ql-fill" d="M11.354,4.146l-2-2a0.5,0.5,0,0,0-.707,0l-2,2A0.5,0.5,0,0,0,7,5H8V6a1,1,0,0,0,2,0V5h1A0.5,0.5,0,0,0,11.354,4.146Z"></path>
7
+ <rect class="ql-fill" height="8" rx="1" ry="1" width="4" x="7" y="8"></rect>
8
+ </svg>
@@ -0,0 +1,9 @@
1
+ <svg viewbox="0 0 18 18">
2
+ <g class="ql-fill ql-stroke ql-thin ql-transparent">
3
+ <rect height="3" rx="0.5" ry="0.5" width="7" x="4.5" y="2.5"></rect>
4
+ <rect height="3" rx="0.5" ry="0.5" width="7" x="4.5" y="12.5"></rect>
5
+ </g>
6
+ <rect class="ql-fill ql-stroke ql-thin" height="3" rx="0.5" ry="0.5" width="7" x="8.5" y="7.5"></rect>
7
+ <polygon class="ql-fill ql-stroke ql-thin" points="4.5 11 2.5 9 4.5 7 4.5 11"></polygon>
8
+ <line class="ql-stroke" x1="6" x2="4" y1="9" y2="9"></line>
9
+ </svg>
@@ -0,0 +1,4 @@
1
+ <svg viewbox="0 0 18 18">
2
+ <rect class="ql-stroke" height="4" width="12" x="3" y="7"></rect>
3
+ <path class="ql-fill ql-transparent" d="M2,2V16H16V2H2ZM14,14H10V11H8v3H4V4H8V7h2V4h4V14Z"></path>
4
+ </svg>
@@ -0,0 +1,7 @@
1
+ <svg viewbox="0 0 18 18">
2
+ <rect class="ql-stroke" height="4" width="12" x="3" y="7"></rect>
3
+ <path class="ql-fill ql-transparent" d="M2,2V16H16V2H2ZM14,14H10V11H8v3H4V4H8V7h2V4h4V14Z"></path>
4
+ <line class="ql-stroke" x1="12" x2="12" y1="11" y2="7"></line>
5
+ <line class="ql-stroke" x1="9" x2="9" y1="11" y2="7"></line>
6
+ <line class="ql-stroke" x1="6" x2="6" y1="11" y2="7"></line>
7
+ </svg>
@@ -0,0 +1,11 @@
1
+ <svg viewbox="0 0 18 18">
2
+ <rect class="ql-stroke" height="12" width="12" x="3" y="3"></rect>
3
+ <rect class="ql-fill" height="2" width="3" x="5" y="5"></rect>
4
+ <rect class="ql-fill" height="2" width="4" x="9" y="5"></rect>
5
+ <g class="ql-fill ql-transparent">
6
+ <rect height="2" width="3" x="5" y="8"></rect>
7
+ <rect height="2" width="4" x="9" y="8"></rect>
8
+ <rect height="2" width="3" x="5" y="11"></rect>
9
+ <rect height="2" width="4" x="9" y="11"></rect>
10
+ </g>
11
+ </svg>
@@ -0,0 +1,4 @@
1
+ <svg viewbox="0 0 18 18">
2
+ <path class="ql-stroke" d="M5,3V9a4.012,4.012,0,0,0,4,4H9a4.012,4.012,0,0,0,4-4V3"></path>
3
+ <rect class="ql-fill" height="1" rx="0.5" ry="0.5" width="12" x="3" y="15"></rect>
4
+ </svg>
@@ -0,0 +1,4 @@
1
+ <svg viewbox="0 0 18 18">
2
+ <polygon class="ql-fill ql-stroke" points="6 10 4 12 2 10 6 10"></polygon>
3
+ <path class="ql-stroke" d="M8.09,13.91A4.6,4.6,0,0,0,9,14,5,5,0,1,0,4,9"></path>
4
+ </svg>
@@ -0,0 +1,14 @@
1
+ <svg viewbox="0 0 18 18">
2
+ <rect class="ql-stroke" height="12" width="12" x="3" y="3"></rect>
3
+ <rect class="ql-fill" height="12" width="1" x="5" y="3"></rect>
4
+ <rect class="ql-fill" height="12" width="1" x="12" y="3"></rect>
5
+ <rect class="ql-fill" height="2" width="8" x="5" y="8"></rect>
6
+ <rect class="ql-fill" height="1" width="3" x="3" y="5"></rect>
7
+ <rect class="ql-fill" height="1" width="3" x="3" y="7"></rect>
8
+ <rect class="ql-fill" height="1" width="3" x="3" y="10"></rect>
9
+ <rect class="ql-fill" height="1" width="3" x="3" y="12"></rect>
10
+ <rect class="ql-fill" height="1" width="3" x="12" y="5"></rect>
11
+ <rect class="ql-fill" height="1" width="3" x="12" y="7"></rect>
12
+ <rect class="ql-fill" height="1" width="3" x="12" y="10"></rect>
13
+ <rect class="ql-fill" height="1" width="3" x="12" y="12"></rect>
14
+ </svg>
@@ -0,0 +1,26 @@
1
+ .ql-toolbar.ql-snow
2
+ border: 1px solid borderColor
3
+ box-sizing: border-box
4
+ font-family: 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif
5
+ padding: 8px
6
+
7
+ .ql-formats
8
+ margin-right: 15px
9
+
10
+ .ql-picker-label
11
+ border: 1px solid transparent
12
+ .ql-picker-options
13
+ border: 1px solid transparent
14
+ box-shadow: rgba(0,0,0,0.2) 0 2px 8px
15
+ .ql-picker.ql-expanded
16
+ .ql-picker-label
17
+ border-color: borderColor
18
+ .ql-picker-options
19
+ border-color: borderColor
20
+
21
+ .ql-color-picker
22
+ .ql-picker-item.ql-selected, .ql-picker-item:hover
23
+ border-color: #000
24
+
25
+ .ql-toolbar.ql-snow + .ql-container.ql-snow
26
+ border-top: 0px;
@@ -0,0 +1,53 @@
1
+ tooltipMargin = 8px
2
+
3
+ .ql-snow
4
+ .ql-tooltip
5
+ background-color: #fff
6
+ border: 1px solid borderColor
7
+ box-shadow: 0px 0px 5px shadowColor
8
+ color: textColor
9
+ padding: 5px 12px
10
+ white-space: nowrap
11
+ &::before
12
+ content: "Visit URL:"
13
+ line-height: 26px
14
+ margin-right: tooltipMargin
15
+ input[type=text]
16
+ display: none
17
+ border: 1px solid borderColor
18
+ font-size: 13px
19
+ height: 26px
20
+ margin: 0px
21
+ padding: 3px 5px
22
+ width: 170px
23
+ a.ql-preview
24
+ display: inline-block
25
+ max-width: 200px
26
+ overflow-x: hidden
27
+ text-overflow: ellipsis
28
+ vertical-align: top
29
+ a.ql-action::after
30
+ border-right: 1px solid borderColor
31
+ content: 'Edit'
32
+ margin-left: tooltipMargin*2
33
+ padding-right: tooltipMargin
34
+ a.ql-remove::before
35
+ content: 'Remove'
36
+ margin-left: tooltipMargin
37
+ a
38
+ line-height: 26px
39
+ .ql-tooltip.ql-editing
40
+ a.ql-preview, a.ql-remove
41
+ display: none
42
+ input[type=text]
43
+ display: inline-block
44
+ a.ql-action::after
45
+ border-right: 0px
46
+ content: 'Save'
47
+ padding-right: 0px
48
+ .ql-tooltip[data-mode=link]::before
49
+ content: "Enter link:"
50
+ .ql-tooltip[data-mode=formula]::before
51
+ content: "Enter formula:"
52
+ .ql-tooltip[data-mode=video]::before
53
+ content: "Enter video:"
@@ -0,0 +1,18 @@
1
+ themeName = 'snow'
2
+ activeColor = #06c
3
+ borderColor = #ccc
4
+ backgroundColor = #fff
5
+ inactiveColor = #444
6
+ shadowColor = #ddd
7
+ textColor = #444
8
+
9
+ @import './core'
10
+ @import './base'
11
+ @import './snow/*'
12
+
13
+ .ql-snow
14
+ a
15
+ color: activeColor
16
+
17
+ .ql-container.ql-snow
18
+ border: 1px solid borderColor
@@ -0,0 +1,34 @@
1
+ import { AttributorStore, BlockBlot, EmbedBlot } from 'parchment';
2
+ import type { Blot, Parent } from 'parchment';
3
+ import Delta from 'quill-delta';
4
+ declare class Block extends BlockBlot {
5
+ cache: {
6
+ delta?: Delta | null;
7
+ length?: number;
8
+ };
9
+ delta(): Delta;
10
+ deleteAt(index: number, length: number): void;
11
+ formatAt(index: number, length: number, name: string, value: unknown): void;
12
+ insertAt(index: number, value: string, def?: unknown): void;
13
+ insertBefore(blot: Blot, ref?: Blot | null): void;
14
+ length(): number;
15
+ moveChildren(target: Parent, ref?: Blot | null): void;
16
+ optimize(context: {
17
+ [key: string]: any;
18
+ }): void;
19
+ path(index: number): [Blot, number][];
20
+ removeChild(child: Blot): void;
21
+ split(index: number, force?: boolean | undefined): Blot | null;
22
+ }
23
+ declare class BlockEmbed extends EmbedBlot {
24
+ attributes: AttributorStore;
25
+ domNode: HTMLElement;
26
+ attach(): void;
27
+ delta(): Delta;
28
+ format(name: string, value: unknown): void;
29
+ formatAt(index: number, length: number, name: string, value: unknown): void;
30
+ insertAt(index: number, value: string, def?: unknown): void;
31
+ }
32
+ declare function blockDelta(blot: BlockBlot, filter?: boolean): Delta;
33
+ declare function bubbleFormats(blot: Blot | null, formats?: Record<string, unknown>, filter?: boolean): Record<string, unknown>;
34
+ export { blockDelta, bubbleFormats, BlockEmbed, Block as default };
package/blots/block.js ADDED
@@ -0,0 +1,182 @@
1
+ import { AttributorStore, BlockBlot, EmbedBlot, LeafBlot, Scope } from 'parchment';
2
+ import Delta from 'quill-delta';
3
+ import Break from './break.js';
4
+ import Inline from './inline.js';
5
+ import TextBlot from './text.js';
6
+ const NEWLINE_LENGTH = 1;
7
+ class Block extends BlockBlot {
8
+ cache = {};
9
+ delta() {
10
+ if (this.cache.delta == null) {
11
+ this.cache.delta = blockDelta(this);
12
+ }
13
+ return this.cache.delta;
14
+ }
15
+ deleteAt(index, length) {
16
+ super.deleteAt(index, length);
17
+ this.cache = {};
18
+ }
19
+ formatAt(index, length, name, value) {
20
+ if (length <= 0) return;
21
+ if (this.scroll.query(name, Scope.BLOCK)) {
22
+ if (index + length === this.length()) {
23
+ this.format(name, value);
24
+ }
25
+ } else {
26
+ super.formatAt(index, Math.min(length, this.length() - index - 1), name, value);
27
+ }
28
+ this.cache = {};
29
+ }
30
+ insertAt(index, value, def) {
31
+ if (def != null) {
32
+ super.insertAt(index, value, def);
33
+ this.cache = {};
34
+ return;
35
+ }
36
+ if (value.length === 0) return;
37
+ const lines = value.split('\n');
38
+ const text = lines.shift();
39
+ if (text.length > 0) {
40
+ if (index < this.length() - 1 || this.children.tail == null) {
41
+ super.insertAt(Math.min(index, this.length() - 1), text);
42
+ } else {
43
+ this.children.tail.insertAt(this.children.tail.length(), text);
44
+ }
45
+ this.cache = {};
46
+ }
47
+ // TODO: Fix this next time the file is edited.
48
+ // eslint-disable-next-line @typescript-eslint/no-this-alias
49
+ let block = this;
50
+ lines.reduce((lineIndex, line) => {
51
+ // @ts-expect-error Fix me later
52
+ block = block.split(lineIndex, true);
53
+ block.insertAt(0, line);
54
+ return line.length;
55
+ }, index + text.length);
56
+ }
57
+ insertBefore(blot, ref) {
58
+ const {
59
+ head
60
+ } = this.children;
61
+ super.insertBefore(blot, ref);
62
+ if (head instanceof Break) {
63
+ head.remove();
64
+ }
65
+ this.cache = {};
66
+ }
67
+ length() {
68
+ if (this.cache.length == null) {
69
+ this.cache.length = super.length() + NEWLINE_LENGTH;
70
+ }
71
+ return this.cache.length;
72
+ }
73
+ moveChildren(target, ref) {
74
+ super.moveChildren(target, ref);
75
+ this.cache = {};
76
+ }
77
+ optimize(context) {
78
+ super.optimize(context);
79
+ this.cache = {};
80
+ }
81
+ path(index) {
82
+ return super.path(index, true);
83
+ }
84
+ removeChild(child) {
85
+ super.removeChild(child);
86
+ this.cache = {};
87
+ }
88
+ split(index) {
89
+ let force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
90
+ if (force && (index === 0 || index >= this.length() - NEWLINE_LENGTH)) {
91
+ const clone = this.clone();
92
+ if (index === 0) {
93
+ this.parent.insertBefore(clone, this);
94
+ return this;
95
+ }
96
+ this.parent.insertBefore(clone, this.next);
97
+ return clone;
98
+ }
99
+ const next = super.split(index, force);
100
+ this.cache = {};
101
+ return next;
102
+ }
103
+ }
104
+ Block.blotName = 'block';
105
+ Block.tagName = 'P';
106
+ Block.defaultChild = Break;
107
+ Block.allowedChildren = [Break, Inline, EmbedBlot, TextBlot];
108
+ class BlockEmbed extends EmbedBlot {
109
+ attach() {
110
+ super.attach();
111
+ this.attributes = new AttributorStore(this.domNode);
112
+ }
113
+ delta() {
114
+ return new Delta().insert(this.value(), {
115
+ ...this.formats(),
116
+ ...this.attributes.values()
117
+ });
118
+ }
119
+ format(name, value) {
120
+ const attribute = this.scroll.query(name, Scope.BLOCK_ATTRIBUTE);
121
+ if (attribute != null) {
122
+ // @ts-expect-error TODO: Scroll#query() should return Attributor when scope is attribute
123
+ this.attributes.attribute(attribute, value);
124
+ }
125
+ }
126
+ formatAt(index, length, name, value) {
127
+ this.format(name, value);
128
+ }
129
+ insertAt(index, value, def) {
130
+ if (def != null) {
131
+ super.insertAt(index, value, def);
132
+ return;
133
+ }
134
+ const lines = value.split('\n');
135
+ const text = lines.pop();
136
+ const blocks = lines.map(line => {
137
+ const block = this.scroll.create(Block.blotName);
138
+ block.insertAt(0, line);
139
+ return block;
140
+ });
141
+ const ref = this.split(index);
142
+ blocks.forEach(block => {
143
+ this.parent.insertBefore(block, ref);
144
+ });
145
+ if (text) {
146
+ this.parent.insertBefore(this.scroll.create('text', text), ref);
147
+ }
148
+ }
149
+ }
150
+ BlockEmbed.scope = Scope.BLOCK_BLOT;
151
+ // It is important for cursor behavior BlockEmbeds use tags that are block level elements
152
+
153
+ function blockDelta(blot) {
154
+ let filter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
155
+ return blot.descendants(LeafBlot).reduce((delta, leaf) => {
156
+ if (leaf.length() === 0) {
157
+ return delta;
158
+ }
159
+ return delta.insert(leaf.value(), bubbleFormats(leaf, {}, filter));
160
+ }, new Delta()).insert('\n', bubbleFormats(blot));
161
+ }
162
+ function bubbleFormats(blot) {
163
+ let formats = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
164
+ let filter = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
165
+ if (blot == null) return formats;
166
+ if ('formats' in blot && typeof blot.formats === 'function') {
167
+ formats = {
168
+ ...formats,
169
+ ...blot.formats()
170
+ };
171
+ if (filter) {
172
+ // exclude syntax highlighting from deltas and getFormat()
173
+ delete formats['code-token'];
174
+ }
175
+ }
176
+ if (blot.parent == null || blot.parent.statics.blotName === 'scroll' || blot.parent.statics.scope !== blot.statics.scope) {
177
+ return formats;
178
+ }
179
+ return bubbleFormats(blot.parent, formats, filter);
180
+ }
181
+ export { blockDelta, bubbleFormats, BlockEmbed, Block as default };
182
+ //# sourceMappingURL=block.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"block.js","names":["AttributorStore","BlockBlot","EmbedBlot","LeafBlot","Scope","Delta","Break","Inline","TextBlot","NEWLINE_LENGTH","Block","cache","delta","blockDelta","deleteAt","index","length","formatAt","name","value","scroll","query","BLOCK","format","Math","min","insertAt","def","lines","split","text","shift","children","tail","block","reduce","lineIndex","line","insertBefore","blot","ref","head","remove","moveChildren","target","optimize","context","path","removeChild","child","force","arguments","undefined","clone","parent","next","blotName","tagName","defaultChild","allowedChildren","BlockEmbed","attach","attributes","domNode","insert","formats","values","attribute","BLOCK_ATTRIBUTE","pop","blocks","map","create","forEach","scope","BLOCK_BLOT","filter","descendants","leaf","bubbleFormats","statics","default"],"sources":["../../src/blots/block.ts"],"sourcesContent":["import {\n AttributorStore,\n BlockBlot,\n EmbedBlot,\n LeafBlot,\n Scope,\n} from 'parchment';\nimport type { Blot, Parent } from 'parchment';\nimport Delta from 'quill-delta';\nimport Break from './break.js';\nimport Inline from './inline.js';\nimport TextBlot from './text.js';\n\nconst NEWLINE_LENGTH = 1;\n\nclass Block extends BlockBlot {\n cache: { delta?: Delta | null; length?: number } = {};\n\n delta(): Delta {\n if (this.cache.delta == null) {\n this.cache.delta = blockDelta(this);\n }\n return this.cache.delta;\n }\n\n deleteAt(index: number, length: number) {\n super.deleteAt(index, length);\n this.cache = {};\n }\n\n formatAt(index: number, length: number, name: string, value: unknown) {\n if (length <= 0) return;\n if (this.scroll.query(name, Scope.BLOCK)) {\n if (index + length === this.length()) {\n this.format(name, value);\n }\n } else {\n super.formatAt(\n index,\n Math.min(length, this.length() - index - 1),\n name,\n value,\n );\n }\n this.cache = {};\n }\n\n insertAt(index: number, value: string, def?: unknown) {\n if (def != null) {\n super.insertAt(index, value, def);\n this.cache = {};\n return;\n }\n if (value.length === 0) return;\n const lines = value.split('\\n');\n const text = lines.shift() as string;\n if (text.length > 0) {\n if (index < this.length() - 1 || this.children.tail == null) {\n super.insertAt(Math.min(index, this.length() - 1), text);\n } else {\n this.children.tail.insertAt(this.children.tail.length(), text);\n }\n this.cache = {};\n }\n // TODO: Fix this next time the file is edited.\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n let block: Blot | this = this;\n lines.reduce((lineIndex, line) => {\n // @ts-expect-error Fix me later\n block = block.split(lineIndex, true);\n block.insertAt(0, line);\n return line.length;\n }, index + text.length);\n }\n\n insertBefore(blot: Blot, ref?: Blot | null) {\n const { head } = this.children;\n super.insertBefore(blot, ref);\n if (head instanceof Break) {\n head.remove();\n }\n this.cache = {};\n }\n\n length() {\n if (this.cache.length == null) {\n this.cache.length = super.length() + NEWLINE_LENGTH;\n }\n return this.cache.length;\n }\n\n moveChildren(target: Parent, ref?: Blot | null) {\n super.moveChildren(target, ref);\n this.cache = {};\n }\n\n optimize(context: { [key: string]: any }) {\n super.optimize(context);\n this.cache = {};\n }\n\n path(index: number) {\n return super.path(index, true);\n }\n\n removeChild(child: Blot) {\n super.removeChild(child);\n this.cache = {};\n }\n\n split(index: number, force: boolean | undefined = false): Blot | null {\n if (force && (index === 0 || index >= this.length() - NEWLINE_LENGTH)) {\n const clone = this.clone();\n if (index === 0) {\n this.parent.insertBefore(clone, this);\n return this;\n }\n this.parent.insertBefore(clone, this.next);\n return clone;\n }\n const next = super.split(index, force);\n this.cache = {};\n return next;\n }\n}\nBlock.blotName = 'block';\nBlock.tagName = 'P';\nBlock.defaultChild = Break;\nBlock.allowedChildren = [Break, Inline, EmbedBlot, TextBlot];\n\nclass BlockEmbed extends EmbedBlot {\n attributes: AttributorStore;\n domNode: HTMLElement;\n\n attach() {\n super.attach();\n this.attributes = new AttributorStore(this.domNode);\n }\n\n delta() {\n return new Delta().insert(this.value(), {\n ...this.formats(),\n ...this.attributes.values(),\n });\n }\n\n format(name: string, value: unknown) {\n const attribute = this.scroll.query(name, Scope.BLOCK_ATTRIBUTE);\n if (attribute != null) {\n // @ts-expect-error TODO: Scroll#query() should return Attributor when scope is attribute\n this.attributes.attribute(attribute, value);\n }\n }\n\n formatAt(index: number, length: number, name: string, value: unknown) {\n this.format(name, value);\n }\n\n insertAt(index: number, value: string, def?: unknown) {\n if (def != null) {\n super.insertAt(index, value, def);\n return;\n }\n const lines = value.split('\\n');\n const text = lines.pop();\n const blocks = lines.map((line) => {\n const block = this.scroll.create(Block.blotName);\n block.insertAt(0, line);\n return block;\n });\n const ref = this.split(index);\n blocks.forEach((block) => {\n this.parent.insertBefore(block, ref);\n });\n if (text) {\n this.parent.insertBefore(this.scroll.create('text', text), ref);\n }\n }\n}\nBlockEmbed.scope = Scope.BLOCK_BLOT;\n// It is important for cursor behavior BlockEmbeds use tags that are block level elements\n\nfunction blockDelta(blot: BlockBlot, filter = true) {\n return blot\n .descendants(LeafBlot)\n .reduce((delta, leaf) => {\n if (leaf.length() === 0) {\n return delta;\n }\n return delta.insert(leaf.value(), bubbleFormats(leaf, {}, filter));\n }, new Delta())\n .insert('\\n', bubbleFormats(blot));\n}\n\nfunction bubbleFormats(\n blot: Blot | null,\n formats: Record<string, unknown> = {},\n filter = true,\n): Record<string, unknown> {\n if (blot == null) return formats;\n if ('formats' in blot && typeof blot.formats === 'function') {\n formats = {\n ...formats,\n ...blot.formats(),\n };\n if (filter) {\n // exclude syntax highlighting from deltas and getFormat()\n delete formats['code-token'];\n }\n }\n if (\n blot.parent == null ||\n blot.parent.statics.blotName === 'scroll' ||\n blot.parent.statics.scope !== blot.statics.scope\n ) {\n return formats;\n }\n return bubbleFormats(blot.parent, formats, filter);\n}\n\nexport { blockDelta, bubbleFormats, BlockEmbed, Block as default };\n"],"mappings":"AAAA,SACEA,eAAe,EACfC,SAAS,EACTC,SAAS,EACTC,QAAQ,EACRC,KAAK,QACA,WAAW;AAElB,OAAOC,KAAK,MAAM,aAAa;AAC/B,OAAOC,KAAK,MAAM,YAAY;AAC9B,OAAOC,MAAM,MAAM,aAAa;AAChC,OAAOC,QAAQ,MAAM,WAAW;AAEhC,MAAMC,cAAc,GAAG,CAAC;AAExB,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EACA,OAAOc,aAAa,CAACxC,IAAI,CAACe,MAAM,EAAEW,OAAO,EAAEW,MAAM,CAAC;AACpD;AAEA,SAAS/D,UAAU,EAAEkE,aAAa,EAAEnB,UAAU,EAAElD,KAAK,IAAIuE,OAAO","ignoreList":[]}
@@ -0,0 +1,8 @@
1
+ import { EmbedBlot } from 'parchment';
2
+ declare class Break extends EmbedBlot {
3
+ static value(): undefined;
4
+ optimize(): void;
5
+ length(): number;
6
+ value(): string;
7
+ }
8
+ export default Break;
package/blots/break.js ADDED
@@ -0,0 +1,21 @@
1
+ import { EmbedBlot } from 'parchment';
2
+ class Break extends EmbedBlot {
3
+ static value() {
4
+ return undefined;
5
+ }
6
+ optimize() {
7
+ if (this.prev || this.next) {
8
+ this.remove();
9
+ }
10
+ }
11
+ length() {
12
+ return 0;
13
+ }
14
+ value() {
15
+ return '';
16
+ }
17
+ }
18
+ Break.blotName = 'break';
19
+ Break.tagName = 'BR';
20
+ export default Break;
21
+ //# sourceMappingURL=break.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"break.js","names":["EmbedBlot","Break","value","undefined","optimize","prev","next","remove","length","blotName","tagName"],"sources":["../../src/blots/break.ts"],"sourcesContent":["import { EmbedBlot } from 'parchment';\n\nclass Break extends EmbedBlot {\n static value() {\n return undefined;\n }\n\n optimize() {\n if (this.prev || this.next) {\n this.remove();\n }\n }\n\n length() {\n return 0;\n }\n\n value() {\n return '';\n }\n}\nBreak.blotName = 'break';\nBreak.tagName = 'BR';\n\nexport default Break;\n"],"mappings":"AAAA,SAASA,SAAS,QAAQ,WAAW;AAErC,MAAMC,KAAK,SAASD,SAAS,CAAC;EAC5B,OAAOE,KAAKA,CAAA,EAAG;IACb,OAAOC,SAAS;EAClB;EAEAC,QAAQA,CAAA,EAAG;IACT,IAAI,IAAI,CAACC,IAAI,IAAI,IAAI,CAACC,IAAI,EAAE;MAC1B,IAAI,CAACC,MAAM,CAAC,CAAC;IACf;EACF;EAEAC,MAAMA,CAAA,EAAG;IACP,OAAO,CAAC;EACV;EAEAN,KAAKA,CAAA,EAAG;IACN,OAAO,EAAE;EACX;AACF;AACAD,KAAK,CAACQ,QAAQ,GAAG,OAAO;AACxBR,KAAK,CAACS,OAAO,GAAG,IAAI;AAEpB,eAAeT,KAAK","ignoreList":[]}
@@ -0,0 +1,4 @@
1
+ import { ContainerBlot } from 'parchment';
2
+ declare class Container extends ContainerBlot {
3
+ }
4
+ export default Container;
@@ -0,0 +1,4 @@
1
+ import { ContainerBlot } from 'parchment';
2
+ class Container extends ContainerBlot {}
3
+ export default Container;
4
+ //# sourceMappingURL=container.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"container.js","names":["ContainerBlot","Container"],"sources":["../../src/blots/container.ts"],"sourcesContent":["import { ContainerBlot } from 'parchment';\n\nclass Container extends ContainerBlot {}\n\nexport default Container;\n"],"mappings":"AAAA,SAASA,aAAa,QAAQ,WAAW;AAEzC,MAAMC,SAAS,SAASD,aAAa,CAAC;AAEtC,eAAeC,SAAS","ignoreList":[]}
@@ -0,0 +1,26 @@
1
+ import { EmbedBlot } from 'parchment';
2
+ import type { ScrollBlot } from 'parchment';
3
+ import type Selection from '../core/selection.js';
4
+ import type { EmbedContextRange } from './embed.js';
5
+ declare class Cursor extends EmbedBlot {
6
+ static blotName: string;
7
+ static className: string;
8
+ static tagName: string;
9
+ static CONTENTS: string;
10
+ static value(): undefined;
11
+ selection: Selection;
12
+ textNode: Text;
13
+ savedLength: number;
14
+ constructor(scroll: ScrollBlot, domNode: HTMLElement, selection: Selection);
15
+ detach(): void;
16
+ format(name: string, value: unknown): void;
17
+ index(node: Node, offset: number): number;
18
+ length(): number;
19
+ position(): [Text, number];
20
+ remove(): void;
21
+ restore(): EmbedContextRange | null;
22
+ update(mutations: MutationRecord[], context: Record<string, unknown>): void;
23
+ optimize(context?: unknown): void;
24
+ value(): string;
25
+ }
26
+ export default Cursor;