quoin-editor 0.4.2 → 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 (231) hide show
  1. package/CHANGELOG.md +205 -0
  2. package/MIGRATION.md +233 -0
  3. package/README.md +78 -716
  4. package/dist/ai.cjs +1107 -0
  5. package/dist/ai.cjs.map +1 -0
  6. package/dist/ai.d.cts +68 -0
  7. package/dist/ai.d.ts +68 -0
  8. package/dist/ai.js +1107 -0
  9. package/dist/ai.js.map +1 -0
  10. package/dist/catalogue.cjs +59 -0
  11. package/dist/catalogue.cjs.map +1 -0
  12. package/dist/catalogue.d.cts +39 -0
  13. package/dist/catalogue.d.ts +39 -0
  14. package/dist/catalogue.js +59 -0
  15. package/dist/catalogue.js.map +1 -0
  16. package/dist/chunk-2QCRZ7OL.cjs +319 -0
  17. package/dist/chunk-2QCRZ7OL.cjs.map +1 -0
  18. package/dist/chunk-2VDK27IF.cjs +6666 -0
  19. package/dist/chunk-2VDK27IF.cjs.map +1 -0
  20. package/dist/chunk-47MLKSI2.js +326 -0
  21. package/dist/chunk-47MLKSI2.js.map +1 -0
  22. package/dist/chunk-5DNCCN6X.cjs +326 -0
  23. package/dist/chunk-5DNCCN6X.cjs.map +1 -0
  24. package/dist/chunk-AEJXZBVR.cjs +1378 -0
  25. package/dist/chunk-AEJXZBVR.cjs.map +1 -0
  26. package/dist/chunk-CDELOHDY.cjs +239 -0
  27. package/dist/chunk-CDELOHDY.cjs.map +1 -0
  28. package/dist/chunk-E75EHRPA.cjs +175 -0
  29. package/dist/chunk-E75EHRPA.cjs.map +1 -0
  30. package/dist/chunk-EL2OEJQC.cjs +562 -0
  31. package/dist/chunk-EL2OEJQC.cjs.map +1 -0
  32. package/dist/chunk-GLLXHMH2.cjs +25 -0
  33. package/dist/chunk-GLLXHMH2.cjs.map +1 -0
  34. package/dist/chunk-GTTPVJSD.cjs +3286 -0
  35. package/dist/chunk-GTTPVJSD.cjs.map +1 -0
  36. package/dist/chunk-HELJTLNC.cjs +100 -0
  37. package/dist/chunk-HELJTLNC.cjs.map +1 -0
  38. package/dist/chunk-HJIQT3S5.js +4047 -0
  39. package/dist/chunk-HJIQT3S5.js.map +1 -0
  40. package/dist/chunk-HZSSEYJS.cjs +504 -0
  41. package/dist/chunk-HZSSEYJS.cjs.map +1 -0
  42. package/dist/chunk-JDPTZUBW.js +184 -0
  43. package/dist/chunk-JDPTZUBW.js.map +1 -0
  44. package/dist/chunk-JEIFJHEI.js +14 -0
  45. package/dist/chunk-JEIFJHEI.js.map +1 -0
  46. package/dist/chunk-K574XHMM.js +25 -0
  47. package/dist/chunk-K574XHMM.js.map +1 -0
  48. package/dist/chunk-KAVU6T6J.js +249 -0
  49. package/dist/chunk-KAVU6T6J.js.map +1 -0
  50. package/dist/chunk-KXOBZGQO.js +1378 -0
  51. package/dist/chunk-KXOBZGQO.js.map +1 -0
  52. package/dist/chunk-LCQSG4M6.js +3335 -0
  53. package/dist/chunk-LCQSG4M6.js.map +1 -0
  54. package/dist/chunk-MQ2XQ4MX.js +100 -0
  55. package/dist/chunk-MQ2XQ4MX.js.map +1 -0
  56. package/dist/chunk-ND5XJVK2.cjs +3335 -0
  57. package/dist/chunk-ND5XJVK2.cjs.map +1 -0
  58. package/dist/chunk-NNDYYEW5.js +504 -0
  59. package/dist/chunk-NNDYYEW5.js.map +1 -0
  60. package/dist/chunk-NOKWNK2O.js +319 -0
  61. package/dist/chunk-NOKWNK2O.js.map +1 -0
  62. package/dist/chunk-OMOBMXD5.cjs +57 -0
  63. package/dist/chunk-OMOBMXD5.cjs.map +1 -0
  64. package/dist/chunk-PMWCQSQX.js +239 -0
  65. package/dist/chunk-PMWCQSQX.js.map +1 -0
  66. package/dist/chunk-POBM7MGR.js +30 -0
  67. package/dist/chunk-POBM7MGR.js.map +1 -0
  68. package/dist/chunk-PWUEPDA3.cjs +598 -0
  69. package/dist/chunk-PWUEPDA3.cjs.map +1 -0
  70. package/dist/chunk-PZ4GT5JO.cjs +4047 -0
  71. package/dist/chunk-PZ4GT5JO.cjs.map +1 -0
  72. package/dist/chunk-QAW5NH6S.cjs +14 -0
  73. package/dist/chunk-QAW5NH6S.cjs.map +1 -0
  74. package/dist/chunk-RDG4VI6E.cjs +706 -0
  75. package/dist/chunk-RDG4VI6E.cjs.map +1 -0
  76. package/dist/chunk-RUDWMKYX.js +562 -0
  77. package/dist/chunk-RUDWMKYX.js.map +1 -0
  78. package/dist/chunk-SG37UBDO.js +706 -0
  79. package/dist/chunk-SG37UBDO.js.map +1 -0
  80. package/dist/chunk-SLVDAHHK.cjs +30 -0
  81. package/dist/chunk-SLVDAHHK.cjs.map +1 -0
  82. package/dist/chunk-T7SW6OWV.js +598 -0
  83. package/dist/chunk-T7SW6OWV.js.map +1 -0
  84. package/dist/chunk-TC4DARU2.js +175 -0
  85. package/dist/chunk-TC4DARU2.js.map +1 -0
  86. package/dist/chunk-WQHV3MRE.cjs +184 -0
  87. package/dist/chunk-WQHV3MRE.cjs.map +1 -0
  88. package/dist/chunk-WXMYDXPN.cjs +33 -0
  89. package/dist/chunk-WXMYDXPN.cjs.map +1 -0
  90. package/dist/chunk-XEBWC7ZL.js +57 -0
  91. package/dist/chunk-XEBWC7ZL.js.map +1 -0
  92. package/dist/chunk-ZC24WB7Y.cjs +249 -0
  93. package/dist/chunk-ZC24WB7Y.cjs.map +1 -0
  94. package/dist/chunk-ZGZEJCRV.js +6666 -0
  95. package/dist/chunk-ZGZEJCRV.js.map +1 -0
  96. package/dist/chunk-ZHOSSWUM.js +33 -0
  97. package/dist/chunk-ZHOSSWUM.js.map +1 -0
  98. package/dist/chunk-ZS2WA357.js +3286 -0
  99. package/dist/chunk-ZS2WA357.js.map +1 -0
  100. package/dist/comments.cjs +993 -0
  101. package/dist/comments.cjs.map +1 -0
  102. package/dist/comments.d.cts +88 -0
  103. package/dist/comments.d.ts +88 -0
  104. package/dist/comments.js +993 -0
  105. package/dist/comments.js.map +1 -0
  106. package/dist/diff.cjs +343 -0
  107. package/dist/diff.cjs.map +1 -0
  108. package/dist/diff.d.cts +67 -0
  109. package/dist/diff.d.ts +67 -0
  110. package/dist/diff.js +343 -0
  111. package/dist/diff.js.map +1 -0
  112. package/dist/docx.cjs +854 -0
  113. package/dist/docx.cjs.map +1 -0
  114. package/dist/docx.d.cts +27 -0
  115. package/dist/docx.d.ts +27 -0
  116. package/dist/docx.js +854 -0
  117. package/dist/docx.js.map +1 -0
  118. package/dist/embed-provider-jXwlRmnp.d.cts +19 -0
  119. package/dist/embed-provider-jXwlRmnp.d.ts +19 -0
  120. package/dist/embed.cjs +17 -0
  121. package/dist/embed.cjs.map +1 -0
  122. package/dist/embed.d.cts +56 -0
  123. package/dist/embed.d.ts +56 -0
  124. package/dist/embed.js +17 -0
  125. package/dist/embed.js.map +1 -0
  126. package/dist/emoji-data.cjs +1968 -0
  127. package/dist/emoji-data.cjs.map +1 -0
  128. package/dist/emoji-data.js +1968 -0
  129. package/dist/emoji-data.js.map +1 -0
  130. package/dist/emoji-extension-C12gDPm6.d.cts +46 -0
  131. package/dist/emoji-extension-DpQ43HjE.d.ts +46 -0
  132. package/dist/emoji.cjs +18 -0
  133. package/dist/emoji.cjs.map +1 -0
  134. package/dist/emoji.d.cts +31 -0
  135. package/dist/emoji.d.ts +31 -0
  136. package/dist/emoji.js +18 -0
  137. package/dist/emoji.js.map +1 -0
  138. package/dist/engine.cjs +119 -0
  139. package/dist/engine.cjs.map +1 -0
  140. package/dist/engine.d.cts +144 -0
  141. package/dist/engine.d.ts +144 -0
  142. package/dist/engine.js +119 -0
  143. package/dist/engine.js.map +1 -0
  144. package/dist/find-extension-DKqLLSuP.d.ts +41 -0
  145. package/dist/find-extension-_sbZEt3R.d.cts +41 -0
  146. package/dist/find.cjs +20 -0
  147. package/dist/find.cjs.map +1 -0
  148. package/dist/find.d.cts +44 -0
  149. package/dist/find.d.ts +44 -0
  150. package/dist/find.js +20 -0
  151. package/dist/find.js.map +1 -0
  152. package/dist/headless.cjs +151 -518
  153. package/dist/headless.cjs.map +1 -1
  154. package/dist/headless.d.cts +102 -69
  155. package/dist/headless.d.ts +102 -69
  156. package/dist/headless.js +149 -467
  157. package/dist/headless.js.map +1 -1
  158. package/dist/index-CgD72kHB.d.cts +65 -0
  159. package/dist/index-DNYbTK3w.d.ts +65 -0
  160. package/dist/index.cjs +183 -2753
  161. package/dist/index.cjs.map +1 -1
  162. package/dist/index.d.cts +345 -253
  163. package/dist/index.d.ts +345 -253
  164. package/dist/index.js +168 -2696
  165. package/dist/index.js.map +1 -1
  166. package/dist/math.cjs +18 -0
  167. package/dist/math.cjs.map +1 -0
  168. package/dist/math.d.cts +49 -0
  169. package/dist/math.d.ts +49 -0
  170. package/dist/math.js +18 -0
  171. package/dist/math.js.map +1 -0
  172. package/dist/mention.cjs +18 -0
  173. package/dist/mention.cjs.map +1 -0
  174. package/dist/mention.d.cts +50 -0
  175. package/dist/mention.d.ts +50 -0
  176. package/dist/mention.js +18 -0
  177. package/dist/mention.js.map +1 -0
  178. package/dist/presence.cjs +565 -0
  179. package/dist/presence.cjs.map +1 -0
  180. package/dist/presence.d.cts +30 -0
  181. package/dist/presence.d.ts +30 -0
  182. package/dist/presence.js +565 -0
  183. package/dist/presence.js.map +1 -0
  184. package/dist/registry-CWBOSAHm.d.cts +121 -0
  185. package/dist/registry-CWBOSAHm.d.ts +121 -0
  186. package/dist/stats-extension-Bly88uio.d.ts +40 -0
  187. package/dist/stats-extension-CJPijvUb.d.cts +40 -0
  188. package/dist/stats.cjs +19 -0
  189. package/dist/stats.cjs.map +1 -0
  190. package/dist/stats.d.cts +19 -0
  191. package/dist/stats.d.ts +19 -0
  192. package/dist/stats.js +19 -0
  193. package/dist/stats.js.map +1 -0
  194. package/dist/styles.css +1 -1
  195. package/dist/table-extension-BTLxFy2S.d.cts +57 -0
  196. package/dist/table-extension-Dzf4k6hI.d.ts +57 -0
  197. package/dist/table.cjs +50 -0
  198. package/dist/table.cjs.map +1 -0
  199. package/dist/table.d.cts +57 -0
  200. package/dist/table.d.ts +57 -0
  201. package/dist/table.js +50 -0
  202. package/dist/table.js.map +1 -0
  203. package/dist/to-html-C5t7xyaM.d.ts +21 -0
  204. package/dist/to-html-CNCITCln.d.cts +21 -0
  205. package/dist/toc-extension-B3-s6h2x.d.cts +25 -0
  206. package/dist/toc-extension-DWm5alVj.d.ts +25 -0
  207. package/dist/toc.cjs +18 -0
  208. package/dist/toc.cjs.map +1 -0
  209. package/dist/toc.d.cts +24 -0
  210. package/dist/toc.d.ts +24 -0
  211. package/dist/toc.js +18 -0
  212. package/dist/toc.js.map +1 -0
  213. package/dist/types-Cz7XJLaK.d.cts +366 -0
  214. package/dist/types-DULc8wwg.d.cts +120 -0
  215. package/dist/types-DULc8wwg.d.ts +120 -0
  216. package/dist/types-a1CRBlEh.d.ts +366 -0
  217. package/dist/view-controller-DSHw0ltQ.d.cts +118 -0
  218. package/dist/view-controller-UbpzblGl.d.ts +118 -0
  219. package/dist/view.cjs +23 -0
  220. package/dist/view.cjs.map +1 -0
  221. package/dist/view.d.cts +40 -0
  222. package/dist/view.d.ts +40 -0
  223. package/dist/view.js +23 -0
  224. package/dist/view.js.map +1 -0
  225. package/dist/yjs.cjs +1026 -0
  226. package/dist/yjs.cjs.map +1 -0
  227. package/dist/yjs.d.cts +22 -0
  228. package/dist/yjs.d.ts +22 -0
  229. package/dist/yjs.js +1026 -0
  230. package/dist/yjs.js.map +1 -0
  231. package/package.json +217 -18
@@ -0,0 +1,119 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+
4
+
5
+
6
+
7
+
8
+
9
+
10
+
11
+
12
+
13
+
14
+
15
+
16
+
17
+
18
+
19
+
20
+
21
+
22
+
23
+
24
+
25
+
26
+
27
+
28
+
29
+
30
+
31
+
32
+
33
+
34
+
35
+
36
+
37
+
38
+
39
+
40
+
41
+
42
+
43
+
44
+ var _chunkPZ4GT5JOcjs = require('./chunk-PZ4GT5JO.cjs');
45
+
46
+
47
+
48
+ var _chunk2QCRZ7OLcjs = require('./chunk-2QCRZ7OL.cjs');
49
+
50
+
51
+
52
+
53
+
54
+
55
+
56
+
57
+
58
+
59
+
60
+
61
+ var _chunkND5XJVK2cjs = require('./chunk-ND5XJVK2.cjs');
62
+
63
+
64
+
65
+
66
+
67
+
68
+
69
+
70
+
71
+
72
+
73
+
74
+
75
+
76
+
77
+
78
+
79
+
80
+
81
+
82
+
83
+
84
+
85
+
86
+
87
+
88
+
89
+
90
+
91
+
92
+
93
+
94
+
95
+
96
+
97
+
98
+
99
+
100
+
101
+
102
+
103
+
104
+
105
+
106
+
107
+
108
+
109
+
110
+
111
+
112
+
113
+
114
+
115
+
116
+
117
+
118
+ exports.PALETTE = _chunkND5XJVK2cjs.PALETTE; exports.Transaction = _chunkPZ4GT5JOcjs.Transaction; exports.addMarkStep = _chunkPZ4GT5JOcjs.addMarkStep; exports.applyTransaction = _chunkPZ4GT5JOcjs.applyTransaction; exports.atom = _chunkND5XJVK2cjs.atom; exports.blockInputRules = _chunkPZ4GT5JOcjs.blockInputRules; exports.blockRangeSelection = _chunkPZ4GT5JOcjs.blockRangeSelection; exports.coreBlockSpecs = _chunkND5XJVK2cjs.coreBlockSpecs; exports.coreExtensions = _chunkPZ4GT5JOcjs.coreExtensions; exports.countDoc = _chunkPZ4GT5JOcjs.countDoc; exports.countText = _chunkPZ4GT5JOcjs.countText; exports.createBlockCodec = _chunkND5XJVK2cjs.createBlockCodec; exports.createEditor = _chunkPZ4GT5JOcjs.createEditor; exports.createPluginKey = _chunkPZ4GT5JOcjs.createPluginKey; exports.createSchema = _chunkND5XJVK2cjs.createSchema; exports.createState = _chunkPZ4GT5JOcjs.createState; exports.defineExtension = _chunkPZ4GT5JOcjs.defineExtension; exports.diffBlocks = _chunk2QCRZ7OLcjs.diffBlocks; exports.diffInline = _chunk2QCRZ7OLcjs.diffInline; exports.fromHTML = _chunkPZ4GT5JOcjs.fromHTML; exports.fromMarkdown = _chunkND5XJVK2cjs.fromMarkdown; exports.getPluginState = _chunkPZ4GT5JOcjs.getPluginState; exports.insertBlockAfter = _chunkPZ4GT5JOcjs.insertBlockAfter; exports.insertBlocksStep = _chunkPZ4GT5JOcjs.insertBlocksStep; exports.insertText = _chunkPZ4GT5JOcjs.insertText; exports.insertTextWithRules = _chunkPZ4GT5JOcjs.insertTextWithRules; exports.joinBlocksStep = _chunkPZ4GT5JOcjs.joinBlocksStep; exports.keyName = _chunkPZ4GT5JOcjs.keyName; exports.markInputRules = _chunkPZ4GT5JOcjs.markInputRules; exports.moveBlocksStep = _chunkPZ4GT5JOcjs.moveBlocksStep; exports.nodeSelection = _chunkPZ4GT5JOcjs.nodeSelection; exports.normalizeInline = _chunkND5XJVK2cjs.normalizeInline; exports.normalizeKey = _chunkPZ4GT5JOcjs.normalizeKey; exports.parseInline = _chunkND5XJVK2cjs.parseInline; exports.redo = _chunkPZ4GT5JOcjs.redo; exports.removeBlocksStep = _chunkPZ4GT5JOcjs.removeBlocksStep; exports.removeMarkStep = _chunkPZ4GT5JOcjs.removeMarkStep; exports.replaceBlockStep = _chunkPZ4GT5JOcjs.replaceBlockStep; exports.replaceDocStep = _chunkPZ4GT5JOcjs.replaceDocStep; exports.replaceInlineStep = _chunkPZ4GT5JOcjs.replaceInlineStep; exports.sanitizeHref = _chunkND5XJVK2cjs.sanitizeHref; exports.serializeInline = _chunkND5XJVK2cjs.serializeInline; exports.setAttrsStep = _chunkPZ4GT5JOcjs.setAttrsStep; exports.setBlockType = _chunkPZ4GT5JOcjs.setBlockType; exports.setIndentStep = _chunkPZ4GT5JOcjs.setIndentStep; exports.splitBlockStep = _chunkPZ4GT5JOcjs.splitBlockStep; exports.stepFromJSON = _chunkPZ4GT5JOcjs.stepFromJSON; exports.text = _chunkND5XJVK2cjs.text; exports.textSelection = _chunkPZ4GT5JOcjs.textSelection; exports.toHTML = _chunkPZ4GT5JOcjs.toHTML; exports.toMarkdown = _chunkPZ4GT5JOcjs.toMarkdown; exports.toPlainText = _chunkPZ4GT5JOcjs.toPlainText; exports.toggleMark = _chunkPZ4GT5JOcjs.toggleMark; exports.typographyRules = _chunkPZ4GT5JOcjs.typographyRules; exports.undo = _chunkPZ4GT5JOcjs.undo;
119
+ //# sourceMappingURL=engine.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["engine.cjs"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,g+FAAC","file":"/home/runner/work/quoin-editor/quoin-editor/dist/engine.cjs"}
@@ -0,0 +1,144 @@
1
+ import { A as Attrs, M as Mark, b as AtomNode, j as InlineNode, I as Inline, T as TextNode, g as BlockSpec, k as MarkSpec, c as AtomSpec, S as Schema, Q as QuoinBlock, h as EngineBlock, E as EngineDoc, C as CodecContext, f as BlockRangeSelection, N as NodeSelection, P as Pos, o as TextSelection, m as ParseInlineOptions, n as SerializeInlineOptions } from './types-DULc8wwg.cjs';
2
+ export { B as BlockAttrs, d as BlockContent, e as BlockFlow, i as InlineCodec, l as MarkdownExportContext, a as Selection } from './types-DULc8wwg.cjs';
3
+ import { s as StepJSON, S as Step, j as CreatedBlock, b as Command, I as InputRule, u as TextStats, E as Extension } from './types-Cz7XJLaK.cjs';
4
+ export { A as Align, e as Assoc, B as BlockStructureOptions, f as BoundCommands, g as Chain, C as CommandFactories, h as CoreCommands, i as CoreExtensionOptions, k as DOMParserLike, D as Decoration, a as Editor, l as EditorOptions, c as EditorState, F as FromHTMLOptions, m as InputRuleContext, n as InputRuleRange, o as InsertTextOptions, K as KeyLike, M as MarkdownOptions, p as PasteRule, P as PluginKey, d as PluginSpec, q as PosMap, r as Slice, t as StepResult, T as Transaction, v as TransactionOrigin, w as applyTransaction, x as coreExtensions, y as createEditor, z as createPluginKey, G as createState, H as fromHTML, J as getPluginState, L as insertBlockAfter, N as insertText, O as insertTextWithRules, Q as keyName, R as normalizeKey, U as setBlockType, V as toggleMark } from './types-Cz7XJLaK.cjs';
5
+ export { E as EmbedProvider, a as EmbedUrl } from './embed-provider-jXwlRmnp.cjs';
6
+ export { H as HTMLOptions, t as toHTML } from './to-html-CNCITCln.cjs';
7
+
8
+ declare function text(value: string, marks?: readonly Mark[]): TextNode;
9
+ declare function atom(type: string, attrs: Attrs, marks?: readonly Mark[]): AtomNode;
10
+ declare function normalizeInline(nodes: readonly InlineNode[]): Inline;
11
+
12
+ type SchemaInput = {
13
+ blocks?: BlockSpec[];
14
+ marks?: MarkSpec[];
15
+ atoms?: AtomSpec[];
16
+ defaultTextBlock?: string;
17
+ };
18
+ declare function createSchema(input?: SchemaInput): Schema;
19
+
20
+ declare const coreBlockSpecs: BlockSpec[];
21
+
22
+ type BlockCodec = {
23
+ toEngineBlocks(block: QuoinBlock): EngineBlock[];
24
+ toQuoin(block: EngineBlock): QuoinBlock;
25
+ docFromBlocks(blocks: readonly QuoinBlock[]): EngineDoc;
26
+ blocksFromDoc(doc: EngineDoc): QuoinBlock[];
27
+ context: CodecContext;
28
+ };
29
+ declare function createBlockCodec(schema: Schema, options?: {
30
+ newId?: () => string;
31
+ }): BlockCodec;
32
+
33
+ declare function stepFromJSON(json: StepJSON): Step;
34
+
35
+ type AttrsPatch = Readonly<Record<string, unknown>>;
36
+ declare function setAttrsStep(block: string, patch: AttrsPatch): Step;
37
+ declare function setIndentStep(block: string, indent: number): Step;
38
+
39
+ declare function insertBlocksStep(index: number, blocks: readonly EngineBlock[]): Step;
40
+ declare function removeBlocksStep(index: number, count: number): Step;
41
+ declare function moveBlocksStep(from: number, count: number, to: number): Step;
42
+ declare function replaceBlockStep(block: EngineBlock): Step;
43
+
44
+ declare function addMarkStep(block: string, region: string, from: number, to: number, mark: Mark): Step;
45
+ declare function removeMarkStep(block: string, region: string, from: number, to: number, mark: Mark | string): Step;
46
+
47
+ declare function replaceDocStep(next: EngineDoc): Step;
48
+
49
+ declare function replaceInlineStep(block: string, region: string, from: number, to: number, slice: Inline): Step;
50
+
51
+ declare function splitBlockStep(block: string, region: string, offset: number, created: CreatedBlock): Step;
52
+ declare function joinBlocksStep(target: string, targetRegion: string, source: string, sourceRegion: string): Step;
53
+
54
+ declare function textSelection(anchor: Pos, head?: Pos): TextSelection;
55
+ declare function nodeSelection(block: string): NodeSelection;
56
+ declare function blockRangeSelection(anchor: string, head?: string): BlockRangeSelection;
57
+
58
+ declare const undo: Command;
59
+ declare const redo: Command;
60
+
61
+ declare const blockInputRules: readonly InputRule[];
62
+
63
+ declare const markInputRules: readonly InputRule[];
64
+
65
+ declare function typographyRules(options?: {
66
+ dashes?: 'em' | 'en' | 'none';
67
+ }): readonly InputRule[];
68
+
69
+ type FromMarkdownOptions = {
70
+ softBreak?: 'newline' | 'space';
71
+ newId?: () => string;
72
+ };
73
+ declare function fromMarkdown(markdown: string, options?: FromMarkdownOptions): QuoinBlock[];
74
+
75
+ type ToMarkdownOptions = {
76
+ schema?: Schema;
77
+ resolveAssetUrl?: (storageKey: string) => string;
78
+ comments?: boolean;
79
+ /**
80
+ * Write every block that markdown cannot hold in full as a quoin comment, so that fromMarkdown reads back all of its
81
+ * data. Plain export, the default, writes native markdown and drops what that form cannot carry: block-level align,
82
+ * colour, background and other extra keys, the indent no container explains, and the data of the other block types.
83
+ */
84
+ lossless?: boolean;
85
+ };
86
+ declare function toMarkdown(blocks: readonly QuoinBlock[], options?: ToMarkdownOptions): string;
87
+
88
+ declare function parseInline(markdown: string, options?: ParseInlineOptions): Inline;
89
+
90
+ declare function serializeInline(inline: Inline, options?: SerializeInlineOptions): string;
91
+
92
+ declare const PALETTE: readonly ["default", "gray", "brown", "orange", "yellow", "green", "blue", "purple", "pink", "red"];
93
+
94
+ declare function sanitizeHref(href: string): string | null;
95
+
96
+ declare function toPlainText(blocks: readonly QuoinBlock[], options?: {
97
+ schema?: Schema;
98
+ }): string;
99
+
100
+ declare function countText(blocks: readonly QuoinBlock[], options?: {
101
+ schema?: Schema;
102
+ }): TextStats;
103
+ /** Counts a document from per-block counts kept for each block object, so a keystroke recounts one block. */
104
+ declare function countDoc(doc: EngineDoc, options?: {
105
+ schema?: Schema;
106
+ }): TextStats;
107
+
108
+ type InlineChange = {
109
+ op: 'equal' | 'insert' | 'delete';
110
+ inline: Inline;
111
+ };
112
+ declare function diffInline(a: Inline, b: Inline): InlineChange[];
113
+
114
+ type BlockChange = {
115
+ op: 'change';
116
+ before: QuoinBlock;
117
+ after: QuoinBlock;
118
+ regions: Record<string, InlineChange[]>;
119
+ attrsChanged: boolean;
120
+ };
121
+
122
+ type BlockDiff = {
123
+ op: 'equal';
124
+ block: QuoinBlock;
125
+ } | {
126
+ op: 'insert';
127
+ block: QuoinBlock;
128
+ moved?: boolean;
129
+ } | {
130
+ op: 'delete';
131
+ block: QuoinBlock;
132
+ moved?: boolean;
133
+ } | BlockChange;
134
+ /**
135
+ * A 0.4 block that holds several nodes is diffed as the pieces the editor splits it into, so an edit shows in one
136
+ * piece only, and the diff then carries those pieces. Blocks that are the same on both sides are never split.
137
+ */
138
+ declare function diffBlocks(a: readonly QuoinBlock[], b: readonly QuoinBlock[], options?: {
139
+ schema?: Schema;
140
+ }): BlockDiff[];
141
+
142
+ declare function defineExtension<E extends Extension>(extension: E): E;
143
+
144
+ export { AtomNode, AtomSpec, Attrs, type AttrsPatch, type BlockChange, type BlockCodec, type BlockDiff, BlockRangeSelection, BlockSpec, CodecContext, Command, CreatedBlock, EngineBlock, EngineDoc, Extension, type FromMarkdownOptions, Inline, type InlineChange, InlineNode, InputRule, Mark, MarkSpec, NodeSelection, PALETTE, ParseInlineOptions, Pos, QuoinBlock, Schema, type SchemaInput, SerializeInlineOptions, Step, StepJSON, TextNode, TextSelection, TextStats, type ToMarkdownOptions, addMarkStep, atom, blockInputRules, blockRangeSelection, coreBlockSpecs, countDoc, countText, createBlockCodec, createSchema, defineExtension, diffBlocks, diffInline, fromMarkdown, insertBlocksStep, joinBlocksStep, markInputRules, moveBlocksStep, nodeSelection, normalizeInline, parseInline, redo, removeBlocksStep, removeMarkStep, replaceBlockStep, replaceDocStep, replaceInlineStep, sanitizeHref, serializeInline, setAttrsStep, setIndentStep, splitBlockStep, stepFromJSON, text, textSelection, toMarkdown, toPlainText, typographyRules, undo };
@@ -0,0 +1,144 @@
1
+ import { A as Attrs, M as Mark, b as AtomNode, j as InlineNode, I as Inline, T as TextNode, g as BlockSpec, k as MarkSpec, c as AtomSpec, S as Schema, Q as QuoinBlock, h as EngineBlock, E as EngineDoc, C as CodecContext, f as BlockRangeSelection, N as NodeSelection, P as Pos, o as TextSelection, m as ParseInlineOptions, n as SerializeInlineOptions } from './types-DULc8wwg.js';
2
+ export { B as BlockAttrs, d as BlockContent, e as BlockFlow, i as InlineCodec, l as MarkdownExportContext, a as Selection } from './types-DULc8wwg.js';
3
+ import { s as StepJSON, S as Step, j as CreatedBlock, b as Command, I as InputRule, u as TextStats, E as Extension } from './types-a1CRBlEh.js';
4
+ export { A as Align, e as Assoc, B as BlockStructureOptions, f as BoundCommands, g as Chain, C as CommandFactories, h as CoreCommands, i as CoreExtensionOptions, k as DOMParserLike, D as Decoration, a as Editor, l as EditorOptions, c as EditorState, F as FromHTMLOptions, m as InputRuleContext, n as InputRuleRange, o as InsertTextOptions, K as KeyLike, M as MarkdownOptions, p as PasteRule, P as PluginKey, d as PluginSpec, q as PosMap, r as Slice, t as StepResult, T as Transaction, v as TransactionOrigin, w as applyTransaction, x as coreExtensions, y as createEditor, z as createPluginKey, G as createState, H as fromHTML, J as getPluginState, L as insertBlockAfter, N as insertText, O as insertTextWithRules, Q as keyName, R as normalizeKey, U as setBlockType, V as toggleMark } from './types-a1CRBlEh.js';
5
+ export { E as EmbedProvider, a as EmbedUrl } from './embed-provider-jXwlRmnp.js';
6
+ export { H as HTMLOptions, t as toHTML } from './to-html-C5t7xyaM.js';
7
+
8
+ declare function text(value: string, marks?: readonly Mark[]): TextNode;
9
+ declare function atom(type: string, attrs: Attrs, marks?: readonly Mark[]): AtomNode;
10
+ declare function normalizeInline(nodes: readonly InlineNode[]): Inline;
11
+
12
+ type SchemaInput = {
13
+ blocks?: BlockSpec[];
14
+ marks?: MarkSpec[];
15
+ atoms?: AtomSpec[];
16
+ defaultTextBlock?: string;
17
+ };
18
+ declare function createSchema(input?: SchemaInput): Schema;
19
+
20
+ declare const coreBlockSpecs: BlockSpec[];
21
+
22
+ type BlockCodec = {
23
+ toEngineBlocks(block: QuoinBlock): EngineBlock[];
24
+ toQuoin(block: EngineBlock): QuoinBlock;
25
+ docFromBlocks(blocks: readonly QuoinBlock[]): EngineDoc;
26
+ blocksFromDoc(doc: EngineDoc): QuoinBlock[];
27
+ context: CodecContext;
28
+ };
29
+ declare function createBlockCodec(schema: Schema, options?: {
30
+ newId?: () => string;
31
+ }): BlockCodec;
32
+
33
+ declare function stepFromJSON(json: StepJSON): Step;
34
+
35
+ type AttrsPatch = Readonly<Record<string, unknown>>;
36
+ declare function setAttrsStep(block: string, patch: AttrsPatch): Step;
37
+ declare function setIndentStep(block: string, indent: number): Step;
38
+
39
+ declare function insertBlocksStep(index: number, blocks: readonly EngineBlock[]): Step;
40
+ declare function removeBlocksStep(index: number, count: number): Step;
41
+ declare function moveBlocksStep(from: number, count: number, to: number): Step;
42
+ declare function replaceBlockStep(block: EngineBlock): Step;
43
+
44
+ declare function addMarkStep(block: string, region: string, from: number, to: number, mark: Mark): Step;
45
+ declare function removeMarkStep(block: string, region: string, from: number, to: number, mark: Mark | string): Step;
46
+
47
+ declare function replaceDocStep(next: EngineDoc): Step;
48
+
49
+ declare function replaceInlineStep(block: string, region: string, from: number, to: number, slice: Inline): Step;
50
+
51
+ declare function splitBlockStep(block: string, region: string, offset: number, created: CreatedBlock): Step;
52
+ declare function joinBlocksStep(target: string, targetRegion: string, source: string, sourceRegion: string): Step;
53
+
54
+ declare function textSelection(anchor: Pos, head?: Pos): TextSelection;
55
+ declare function nodeSelection(block: string): NodeSelection;
56
+ declare function blockRangeSelection(anchor: string, head?: string): BlockRangeSelection;
57
+
58
+ declare const undo: Command;
59
+ declare const redo: Command;
60
+
61
+ declare const blockInputRules: readonly InputRule[];
62
+
63
+ declare const markInputRules: readonly InputRule[];
64
+
65
+ declare function typographyRules(options?: {
66
+ dashes?: 'em' | 'en' | 'none';
67
+ }): readonly InputRule[];
68
+
69
+ type FromMarkdownOptions = {
70
+ softBreak?: 'newline' | 'space';
71
+ newId?: () => string;
72
+ };
73
+ declare function fromMarkdown(markdown: string, options?: FromMarkdownOptions): QuoinBlock[];
74
+
75
+ type ToMarkdownOptions = {
76
+ schema?: Schema;
77
+ resolveAssetUrl?: (storageKey: string) => string;
78
+ comments?: boolean;
79
+ /**
80
+ * Write every block that markdown cannot hold in full as a quoin comment, so that fromMarkdown reads back all of its
81
+ * data. Plain export, the default, writes native markdown and drops what that form cannot carry: block-level align,
82
+ * colour, background and other extra keys, the indent no container explains, and the data of the other block types.
83
+ */
84
+ lossless?: boolean;
85
+ };
86
+ declare function toMarkdown(blocks: readonly QuoinBlock[], options?: ToMarkdownOptions): string;
87
+
88
+ declare function parseInline(markdown: string, options?: ParseInlineOptions): Inline;
89
+
90
+ declare function serializeInline(inline: Inline, options?: SerializeInlineOptions): string;
91
+
92
+ declare const PALETTE: readonly ["default", "gray", "brown", "orange", "yellow", "green", "blue", "purple", "pink", "red"];
93
+
94
+ declare function sanitizeHref(href: string): string | null;
95
+
96
+ declare function toPlainText(blocks: readonly QuoinBlock[], options?: {
97
+ schema?: Schema;
98
+ }): string;
99
+
100
+ declare function countText(blocks: readonly QuoinBlock[], options?: {
101
+ schema?: Schema;
102
+ }): TextStats;
103
+ /** Counts a document from per-block counts kept for each block object, so a keystroke recounts one block. */
104
+ declare function countDoc(doc: EngineDoc, options?: {
105
+ schema?: Schema;
106
+ }): TextStats;
107
+
108
+ type InlineChange = {
109
+ op: 'equal' | 'insert' | 'delete';
110
+ inline: Inline;
111
+ };
112
+ declare function diffInline(a: Inline, b: Inline): InlineChange[];
113
+
114
+ type BlockChange = {
115
+ op: 'change';
116
+ before: QuoinBlock;
117
+ after: QuoinBlock;
118
+ regions: Record<string, InlineChange[]>;
119
+ attrsChanged: boolean;
120
+ };
121
+
122
+ type BlockDiff = {
123
+ op: 'equal';
124
+ block: QuoinBlock;
125
+ } | {
126
+ op: 'insert';
127
+ block: QuoinBlock;
128
+ moved?: boolean;
129
+ } | {
130
+ op: 'delete';
131
+ block: QuoinBlock;
132
+ moved?: boolean;
133
+ } | BlockChange;
134
+ /**
135
+ * A 0.4 block that holds several nodes is diffed as the pieces the editor splits it into, so an edit shows in one
136
+ * piece only, and the diff then carries those pieces. Blocks that are the same on both sides are never split.
137
+ */
138
+ declare function diffBlocks(a: readonly QuoinBlock[], b: readonly QuoinBlock[], options?: {
139
+ schema?: Schema;
140
+ }): BlockDiff[];
141
+
142
+ declare function defineExtension<E extends Extension>(extension: E): E;
143
+
144
+ export { AtomNode, AtomSpec, Attrs, type AttrsPatch, type BlockChange, type BlockCodec, type BlockDiff, BlockRangeSelection, BlockSpec, CodecContext, Command, CreatedBlock, EngineBlock, EngineDoc, Extension, type FromMarkdownOptions, Inline, type InlineChange, InlineNode, InputRule, Mark, MarkSpec, NodeSelection, PALETTE, ParseInlineOptions, Pos, QuoinBlock, Schema, type SchemaInput, SerializeInlineOptions, Step, StepJSON, TextNode, TextSelection, TextStats, type ToMarkdownOptions, addMarkStep, atom, blockInputRules, blockRangeSelection, coreBlockSpecs, countDoc, countText, createBlockCodec, createSchema, defineExtension, diffBlocks, diffInline, fromMarkdown, insertBlocksStep, joinBlocksStep, markInputRules, moveBlocksStep, nodeSelection, normalizeInline, parseInline, redo, removeBlocksStep, removeMarkStep, replaceBlockStep, replaceDocStep, replaceInlineStep, sanitizeHref, serializeInline, setAttrsStep, setIndentStep, splitBlockStep, stepFromJSON, text, textSelection, toMarkdown, toPlainText, typographyRules, undo };
package/dist/engine.js ADDED
@@ -0,0 +1,119 @@
1
+ import {
2
+ Transaction,
3
+ addMarkStep,
4
+ applyTransaction,
5
+ blockInputRules,
6
+ blockRangeSelection,
7
+ coreExtensions,
8
+ countDoc,
9
+ countText,
10
+ createEditor,
11
+ createPluginKey,
12
+ createState,
13
+ defineExtension,
14
+ fromHTML,
15
+ getPluginState,
16
+ insertBlockAfter,
17
+ insertBlocksStep,
18
+ insertText,
19
+ insertTextWithRules,
20
+ joinBlocksStep,
21
+ keyName,
22
+ markInputRules,
23
+ moveBlocksStep,
24
+ nodeSelection,
25
+ normalizeKey,
26
+ redo,
27
+ removeBlocksStep,
28
+ removeMarkStep,
29
+ replaceBlockStep,
30
+ replaceDocStep,
31
+ replaceInlineStep,
32
+ setAttrsStep,
33
+ setBlockType,
34
+ setIndentStep,
35
+ splitBlockStep,
36
+ stepFromJSON,
37
+ textSelection,
38
+ toHTML,
39
+ toMarkdown,
40
+ toPlainText,
41
+ toggleMark,
42
+ typographyRules,
43
+ undo
44
+ } from "./chunk-HJIQT3S5.js";
45
+ import {
46
+ diffBlocks,
47
+ diffInline
48
+ } from "./chunk-NOKWNK2O.js";
49
+ import {
50
+ PALETTE,
51
+ atom,
52
+ coreBlockSpecs,
53
+ createBlockCodec,
54
+ createSchema,
55
+ fromMarkdown,
56
+ normalizeInline,
57
+ parseInline,
58
+ sanitizeHref,
59
+ serializeInline,
60
+ text
61
+ } from "./chunk-LCQSG4M6.js";
62
+ export {
63
+ PALETTE,
64
+ Transaction,
65
+ addMarkStep,
66
+ applyTransaction,
67
+ atom,
68
+ blockInputRules,
69
+ blockRangeSelection,
70
+ coreBlockSpecs,
71
+ coreExtensions,
72
+ countDoc,
73
+ countText,
74
+ createBlockCodec,
75
+ createEditor,
76
+ createPluginKey,
77
+ createSchema,
78
+ createState,
79
+ defineExtension,
80
+ diffBlocks,
81
+ diffInline,
82
+ fromHTML,
83
+ fromMarkdown,
84
+ getPluginState,
85
+ insertBlockAfter,
86
+ insertBlocksStep,
87
+ insertText,
88
+ insertTextWithRules,
89
+ joinBlocksStep,
90
+ keyName,
91
+ markInputRules,
92
+ moveBlocksStep,
93
+ nodeSelection,
94
+ normalizeInline,
95
+ normalizeKey,
96
+ parseInline,
97
+ redo,
98
+ removeBlocksStep,
99
+ removeMarkStep,
100
+ replaceBlockStep,
101
+ replaceDocStep,
102
+ replaceInlineStep,
103
+ sanitizeHref,
104
+ serializeInline,
105
+ setAttrsStep,
106
+ setBlockType,
107
+ setIndentStep,
108
+ splitBlockStep,
109
+ stepFromJSON,
110
+ text,
111
+ textSelection,
112
+ toHTML,
113
+ toMarkdown,
114
+ toPlainText,
115
+ toggleMark,
116
+ typographyRules,
117
+ undo
118
+ };
119
+ //# sourceMappingURL=engine.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"mappings":"","names":[]}
@@ -0,0 +1,41 @@
1
+ import { E as Extension } from './types-a1CRBlEh.js';
2
+
3
+ /** Every string the find and replace feature shows or speaks. */
4
+ type FindLabels = {
5
+ /** The name of the panel. */
6
+ findAndReplace: string;
7
+ /** The name of the field of the text to find. */
8
+ find: string;
9
+ /** The name of the field of the replacement. */
10
+ replaceWith: string;
11
+ /** The names of the option toggles. */
12
+ matchCase: string;
13
+ wholeWord: string;
14
+ regularExpression: string;
15
+ previousMatch: string;
16
+ nextMatch: string;
17
+ /** The button that replaces the current match. */
18
+ replace: string;
19
+ /** The button that replaces every match. */
20
+ replaceAll: string;
21
+ close: string;
22
+ /** What the panel shows when the query matches nothing. */
23
+ noResults: string;
24
+ /** What it shows when the query is read as a regular expression that cannot be read. */
25
+ invalidPattern: string;
26
+ /** Which match is current, counting from 1, of how many; `more` when the document holds more than `total`. */
27
+ matchCount(current: number, total: number, more: boolean): string;
28
+ };
29
+ declare const englishFindLabels: FindLabels;
30
+
31
+ type FindOptions = {
32
+ /** Every string the feature shows or speaks, English by default. A key left out stays English. */
33
+ labels?: Partial<FindLabels>;
34
+ };
35
+ /**
36
+ * Find and replace: Mod+Shift+F opens a panel that marks every match of its query in the text of the document, steps
37
+ * through them, and replaces the current one or all of them. A read-only canvas finds without replacing.
38
+ */
39
+ declare function findExtension(options?: FindOptions): Extension;
40
+
41
+ export { type FindLabels as F, type FindOptions as a, englishFindLabels as e, findExtension as f };
@@ -0,0 +1,41 @@
1
+ import { E as Extension } from './types-Cz7XJLaK.cjs';
2
+
3
+ /** Every string the find and replace feature shows or speaks. */
4
+ type FindLabels = {
5
+ /** The name of the panel. */
6
+ findAndReplace: string;
7
+ /** The name of the field of the text to find. */
8
+ find: string;
9
+ /** The name of the field of the replacement. */
10
+ replaceWith: string;
11
+ /** The names of the option toggles. */
12
+ matchCase: string;
13
+ wholeWord: string;
14
+ regularExpression: string;
15
+ previousMatch: string;
16
+ nextMatch: string;
17
+ /** The button that replaces the current match. */
18
+ replace: string;
19
+ /** The button that replaces every match. */
20
+ replaceAll: string;
21
+ close: string;
22
+ /** What the panel shows when the query matches nothing. */
23
+ noResults: string;
24
+ /** What it shows when the query is read as a regular expression that cannot be read. */
25
+ invalidPattern: string;
26
+ /** Which match is current, counting from 1, of how many; `more` when the document holds more than `total`. */
27
+ matchCount(current: number, total: number, more: boolean): string;
28
+ };
29
+ declare const englishFindLabels: FindLabels;
30
+
31
+ type FindOptions = {
32
+ /** Every string the feature shows or speaks, English by default. A key left out stays English. */
33
+ labels?: Partial<FindLabels>;
34
+ };
35
+ /**
36
+ * Find and replace: Mod+Shift+F opens a panel that marks every match of its query in the text of the document, steps
37
+ * through them, and replaces the current one or all of them. A read-only canvas finds without replacing.
38
+ */
39
+ declare function findExtension(options?: FindOptions): Extension;
40
+
41
+ export { type FindLabels as F, type FindOptions as a, englishFindLabels as e, findExtension as f };
package/dist/find.cjs ADDED
@@ -0,0 +1,20 @@
1
+ 'use client';"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
2
+
3
+
4
+
5
+
6
+
7
+ var _chunkPWUEPDA3cjs = require('./chunk-PWUEPDA3.cjs');
8
+ require('./chunk-2VDK27IF.cjs');
9
+ require('./chunk-GTTPVJSD.cjs');
10
+ require('./chunk-OMOBMXD5.cjs');
11
+ require('./chunk-PZ4GT5JO.cjs');
12
+ require('./chunk-2QCRZ7OL.cjs');
13
+ require('./chunk-ND5XJVK2.cjs');
14
+
15
+
16
+
17
+
18
+
19
+ exports.englishFindLabels = _chunkPWUEPDA3cjs.englishFindLabels; exports.findExtension = _chunkPWUEPDA3cjs.findExtension; exports.findMatches = _chunkPWUEPDA3cjs.findMatches; exports.replaceMatches = _chunkPWUEPDA3cjs.replaceMatches;
20
+ //# sourceMappingURL=find.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["find.cjs"],"names":[],"mappings":"AAAA,qFAAY;AACZ;AACE;AACA;AACA;AACA;AACF,wDAA6B;AAC7B,gCAA6B;AAC7B,gCAA6B;AAC7B,gCAA6B;AAC7B,gCAA6B;AAC7B,gCAA6B;AAC7B,gCAA6B;AAC7B;AACE;AACA;AACA;AACA;AACF,yOAAC","file":"/home/runner/work/quoin-editor/quoin-editor/dist/find.cjs"}