quoin-editor 1.0.2 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (224) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/ai.cjs +168 -249
  3. package/dist/ai.cjs.map +1 -1
  4. package/dist/ai.js +37 -121
  5. package/dist/ai.js.map +1 -1
  6. package/dist/catalogue.cjs +28 -43
  7. package/dist/catalogue.cjs.map +1 -1
  8. package/dist/catalogue.js +20 -37
  9. package/dist/catalogue.js.map +1 -1
  10. package/dist/{chunk-DUE3HCZD.js → chunk-2EQ6FKSK.js} +19 -28
  11. package/dist/chunk-2EQ6FKSK.js.map +1 -0
  12. package/dist/{chunk-RJRX34BZ.js → chunk-3BXUGX5F.js} +4 -18
  13. package/dist/chunk-3BXUGX5F.js.map +1 -0
  14. package/dist/chunk-3QRVAI53.cjs +27 -0
  15. package/dist/chunk-3QRVAI53.cjs.map +1 -0
  16. package/dist/{chunk-U3LOLYAU.js → chunk-7FAVFJAS.js} +4 -10
  17. package/dist/chunk-7FAVFJAS.js.map +1 -0
  18. package/dist/{chunk-6V6GGBDK.cjs → chunk-7SVKLWDT.cjs} +24 -31
  19. package/dist/chunk-7SVKLWDT.cjs.map +1 -0
  20. package/dist/{chunk-EH5KXQXY.cjs → chunk-A6PGQVTR.cjs} +36 -20
  21. package/dist/chunk-A6PGQVTR.cjs.map +1 -0
  22. package/dist/{chunk-P6KYXFZC.cjs → chunk-ACSEYJJF.cjs} +426 -534
  23. package/dist/chunk-ACSEYJJF.cjs.map +1 -0
  24. package/dist/{chunk-4SLJNZSM.cjs → chunk-AIS37SL2.cjs} +201 -198
  25. package/dist/chunk-AIS37SL2.cjs.map +1 -0
  26. package/dist/{chunk-X4HDKFW5.cjs → chunk-DTQFYHDJ.cjs} +56 -105
  27. package/dist/chunk-DTQFYHDJ.cjs.map +1 -0
  28. package/dist/{chunk-O4Z2WMFF.js → chunk-HDJ653LM.js} +25 -18
  29. package/dist/chunk-HDJ653LM.js.map +1 -0
  30. package/dist/chunk-HQ43EIYO.cjs +94 -0
  31. package/dist/chunk-HQ43EIYO.cjs.map +1 -0
  32. package/dist/{chunk-6NULZPVC.js → chunk-HTLWPSMU.js} +8 -61
  33. package/dist/chunk-HTLWPSMU.js.map +1 -0
  34. package/dist/{chunk-ADSJ42DO.js → chunk-HWEK7EX5.js} +17 -69
  35. package/dist/chunk-HWEK7EX5.js.map +1 -0
  36. package/dist/{chunk-623AOJM2.js → chunk-ITXCE6KL.js} +7 -25
  37. package/dist/chunk-ITXCE6KL.js.map +1 -0
  38. package/dist/{chunk-AUOEM3SF.cjs → chunk-IXVGHH7F.cjs} +102 -155
  39. package/dist/chunk-IXVGHH7F.cjs.map +1 -0
  40. package/dist/{chunk-NEZJ7ZP5.js → chunk-JZJIWRF3.js} +4 -8
  41. package/dist/chunk-JZJIWRF3.js.map +1 -0
  42. package/dist/{chunk-C23RQVRK.js → chunk-KSF2HILJ.js} +66 -216
  43. package/dist/chunk-KSF2HILJ.js.map +1 -0
  44. package/dist/{chunk-OBMBSU2S.js → chunk-L4D23LM2.js} +5 -184
  45. package/dist/chunk-L4D23LM2.js.map +1 -0
  46. package/dist/{chunk-4XFXB37X.js → chunk-L6OW2FL3.js} +7 -90
  47. package/dist/chunk-L6OW2FL3.js.map +1 -0
  48. package/dist/chunk-LE5XMIFJ.cjs +4 -3
  49. package/dist/chunk-LE5XMIFJ.cjs.map +1 -1
  50. package/dist/{chunk-5MAYUGTE.cjs → chunk-LY2D45F2.cjs} +233 -363
  51. package/dist/chunk-LY2D45F2.cjs.map +1 -0
  52. package/dist/{chunk-VCLL5C7J.js → chunk-MGMA5PEL.js} +14 -57
  53. package/dist/chunk-MGMA5PEL.js.map +1 -0
  54. package/dist/chunk-MQUCCSWG.js +2 -3
  55. package/dist/chunk-MQUCCSWG.js.map +1 -1
  56. package/dist/chunk-NO3KTZDY.cjs +33 -0
  57. package/dist/chunk-NO3KTZDY.cjs.map +1 -0
  58. package/dist/{chunk-TLGX43P6.cjs → chunk-OM7E43ZN.cjs} +89 -86
  59. package/dist/chunk-OM7E43ZN.cjs.map +1 -0
  60. package/dist/{chunk-JHQUHFLX.js → chunk-PJCHSHM3.js} +38 -120
  61. package/dist/chunk-PJCHSHM3.js.map +1 -0
  62. package/dist/{chunk-EPARJI4V.js → chunk-QC35D2AU.js} +107 -262
  63. package/dist/chunk-QC35D2AU.js.map +1 -0
  64. package/dist/{chunk-CW3AFJBR.cjs → chunk-QEMGOL5L.cjs} +1302 -1773
  65. package/dist/chunk-QEMGOL5L.cjs.map +1 -0
  66. package/dist/chunk-QWS7KH3K.cjs +483 -0
  67. package/dist/chunk-QWS7KH3K.cjs.map +1 -0
  68. package/dist/{chunk-IQBMAE3F.js → chunk-RHQPAW4W.js} +34 -92
  69. package/dist/chunk-RHQPAW4W.js.map +1 -0
  70. package/dist/chunk-RIIXJWBR.cjs +24 -0
  71. package/dist/chunk-RIIXJWBR.cjs.map +1 -0
  72. package/dist/{chunk-VRS6WCEK.js → chunk-SAEQMDAU.js} +60 -167
  73. package/dist/chunk-SAEQMDAU.js.map +1 -0
  74. package/dist/chunk-SKZC4K5S.cjs +612 -0
  75. package/dist/chunk-SKZC4K5S.cjs.map +1 -0
  76. package/dist/{chunk-N4FGA3H4.js → chunk-TBCHYHNU.js} +38 -105
  77. package/dist/chunk-TBCHYHNU.js.map +1 -0
  78. package/dist/{chunk-OSHZQR3W.js → chunk-TNN6Z52D.js} +13 -45
  79. package/dist/chunk-TNN6Z52D.js.map +1 -0
  80. package/dist/{chunk-YBMUEEM5.js → chunk-TYZSB7JT.js} +4 -8
  81. package/dist/chunk-TYZSB7JT.js.map +1 -0
  82. package/dist/{chunk-ZKVOS57Q.cjs → chunk-VFSVN5IQ.cjs} +495 -551
  83. package/dist/chunk-VFSVN5IQ.cjs.map +1 -0
  84. package/dist/{chunk-FDRUAL3Z.cjs → chunk-WDO6DBYU.cjs} +90 -153
  85. package/dist/chunk-WDO6DBYU.cjs.map +1 -0
  86. package/dist/{chunk-WEYDDIBQ.cjs → chunk-WHV5ZSIO.cjs} +36 -64
  87. package/dist/chunk-WHV5ZSIO.cjs.map +1 -0
  88. package/dist/{chunk-T43RZTUT.js → chunk-XJDPQFPU.js} +693 -1247
  89. package/dist/chunk-XJDPQFPU.js.map +1 -0
  90. package/dist/{chunk-BQANU5BH.cjs → chunk-ZTLYHRZT.cjs} +34 -44
  91. package/dist/chunk-ZTLYHRZT.cjs.map +1 -0
  92. package/dist/chunk-ZWB7SZVI.cjs +200 -0
  93. package/dist/chunk-ZWB7SZVI.cjs.map +1 -0
  94. package/dist/comments.cjs +209 -290
  95. package/dist/comments.cjs.map +1 -1
  96. package/dist/comments.js +81 -186
  97. package/dist/comments.js.map +1 -1
  98. package/dist/diff.cjs +48 -65
  99. package/dist/diff.cjs.map +1 -1
  100. package/dist/diff.d.cts +2 -2
  101. package/dist/diff.d.ts +2 -2
  102. package/dist/diff.js +8 -32
  103. package/dist/diff.js.map +1 -1
  104. package/dist/docx.cjs +50 -63
  105. package/dist/docx.cjs.map +1 -1
  106. package/dist/docx.js +7 -22
  107. package/dist/docx.js.map +1 -1
  108. package/dist/embed.cjs +18 -12
  109. package/dist/embed.cjs.map +1 -1
  110. package/dist/embed.js +9 -16
  111. package/dist/embed.js.map +1 -1
  112. package/dist/emoji-data.cjs +7 -5
  113. package/dist/emoji-data.cjs.map +1 -1
  114. package/dist/emoji-data.js +3 -5
  115. package/dist/emoji-data.js.map +1 -1
  116. package/dist/emoji.cjs +25 -17
  117. package/dist/emoji.cjs.map +1 -1
  118. package/dist/emoji.js +8 -17
  119. package/dist/emoji.js.map +1 -1
  120. package/dist/engine.cjs +229 -118
  121. package/dist/engine.cjs.map +1 -1
  122. package/dist/engine.js +4 -118
  123. package/dist/engine.js.map +1 -1
  124. package/dist/find.cjs +29 -19
  125. package/dist/find.cjs.map +1 -1
  126. package/dist/find.js +8 -19
  127. package/dist/find.js.map +1 -1
  128. package/dist/headless.cjs +290 -151
  129. package/dist/headless.cjs.map +1 -1
  130. package/dist/headless.d.cts +5 -1
  131. package/dist/headless.d.ts +5 -1
  132. package/dist/headless.js +5 -151
  133. package/dist/headless.js.map +1 -1
  134. package/dist/index.cjs +348 -183
  135. package/dist/index.cjs.map +1 -1
  136. package/dist/index.d.cts +14 -4
  137. package/dist/index.d.ts +14 -4
  138. package/dist/index.js +7 -183
  139. package/dist/index.js.map +1 -1
  140. package/dist/math.cjs +19 -13
  141. package/dist/math.cjs.map +1 -1
  142. package/dist/math.js +10 -17
  143. package/dist/math.js.map +1 -1
  144. package/dist/mention.cjs +19 -13
  145. package/dist/mention.cjs.map +1 -1
  146. package/dist/mention.js +10 -17
  147. package/dist/mention.js.map +1 -1
  148. package/dist/presence.cjs +98 -132
  149. package/dist/presence.cjs.map +1 -1
  150. package/dist/presence.js +21 -78
  151. package/dist/presence.js.map +1 -1
  152. package/dist/{registry-CWBOSAHm.d.ts → registry-CXegaw5k.d.cts} +25 -2
  153. package/dist/{registry-CWBOSAHm.d.cts → registry-CXegaw5k.d.ts} +25 -2
  154. package/dist/stats.cjs +26 -18
  155. package/dist/stats.cjs.map +1 -1
  156. package/dist/stats.js +9 -18
  157. package/dist/stats.js.map +1 -1
  158. package/dist/styles.css +1 -1
  159. package/dist/table.cjs +89 -49
  160. package/dist/table.cjs.map +1 -1
  161. package/dist/table.js +8 -49
  162. package/dist/table.js.map +1 -1
  163. package/dist/toc.cjs +25 -17
  164. package/dist/toc.cjs.map +1 -1
  165. package/dist/toc.js +8 -17
  166. package/dist/toc.js.map +1 -1
  167. package/dist/view.cjs +13 -16
  168. package/dist/view.cjs.map +1 -1
  169. package/dist/view.d.cts +2 -2
  170. package/dist/view.d.ts +2 -2
  171. package/dist/view.js +7 -16
  172. package/dist/view.js.map +1 -1
  173. package/dist/yjs.cjs +186 -228
  174. package/dist/yjs.cjs.map +1 -1
  175. package/dist/yjs.js +12 -80
  176. package/dist/yjs.js.map +1 -1
  177. package/package.json +1 -1
  178. package/dist/chunk-4SLJNZSM.cjs.map +0 -1
  179. package/dist/chunk-4XFXB37X.js.map +0 -1
  180. package/dist/chunk-5MAYUGTE.cjs.map +0 -1
  181. package/dist/chunk-623AOJM2.js.map +0 -1
  182. package/dist/chunk-6NULZPVC.js.map +0 -1
  183. package/dist/chunk-6V6GGBDK.cjs.map +0 -1
  184. package/dist/chunk-73653CJ4.cjs +0 -34
  185. package/dist/chunk-73653CJ4.cjs.map +0 -1
  186. package/dist/chunk-ADSJ42DO.js.map +0 -1
  187. package/dist/chunk-AUOEM3SF.cjs.map +0 -1
  188. package/dist/chunk-BQANU5BH.cjs.map +0 -1
  189. package/dist/chunk-C23RQVRK.js.map +0 -1
  190. package/dist/chunk-CW3AFJBR.cjs.map +0 -1
  191. package/dist/chunk-DUE3HCZD.js.map +0 -1
  192. package/dist/chunk-EH5KXQXY.cjs.map +0 -1
  193. package/dist/chunk-EPARJI4V.js.map +0 -1
  194. package/dist/chunk-FDRUAL3Z.cjs.map +0 -1
  195. package/dist/chunk-IQBMAE3F.js.map +0 -1
  196. package/dist/chunk-JHQUHFLX.js.map +0 -1
  197. package/dist/chunk-KUYZMSMF.cjs +0 -100
  198. package/dist/chunk-KUYZMSMF.cjs.map +0 -1
  199. package/dist/chunk-LLTEGXWZ.cjs +0 -562
  200. package/dist/chunk-LLTEGXWZ.cjs.map +0 -1
  201. package/dist/chunk-N4FGA3H4.js.map +0 -1
  202. package/dist/chunk-NEZJ7ZP5.js.map +0 -1
  203. package/dist/chunk-O4Z2WMFF.js.map +0 -1
  204. package/dist/chunk-OBMBSU2S.js.map +0 -1
  205. package/dist/chunk-OSHZQR3W.js.map +0 -1
  206. package/dist/chunk-P6KYXFZC.cjs.map +0 -1
  207. package/dist/chunk-R2BLBV43.cjs +0 -239
  208. package/dist/chunk-R2BLBV43.cjs.map +0 -1
  209. package/dist/chunk-RJRX34BZ.js.map +0 -1
  210. package/dist/chunk-T43RZTUT.js.map +0 -1
  211. package/dist/chunk-TLGX43P6.cjs.map +0 -1
  212. package/dist/chunk-U3LOLYAU.js.map +0 -1
  213. package/dist/chunk-UEKXVCKC.cjs +0 -716
  214. package/dist/chunk-UEKXVCKC.cjs.map +0 -1
  215. package/dist/chunk-VCLL5C7J.js.map +0 -1
  216. package/dist/chunk-VRS6WCEK.js.map +0 -1
  217. package/dist/chunk-WEYDDIBQ.cjs.map +0 -1
  218. package/dist/chunk-X4HDKFW5.cjs.map +0 -1
  219. package/dist/chunk-X4P4TQXH.cjs +0 -30
  220. package/dist/chunk-X4P4TQXH.cjs.map +0 -1
  221. package/dist/chunk-XA3UEJIW.cjs +0 -25
  222. package/dist/chunk-XA3UEJIW.cjs.map +0 -1
  223. package/dist/chunk-YBMUEEM5.js.map +0 -1
  224. package/dist/chunk-ZKVOS57Q.cjs.map +0 -1
package/CHANGELOG.md CHANGED
@@ -2,6 +2,24 @@
2
2
 
3
3
  Every release of `quoin-editor` is listed here, newest first, in the spirit of [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). From 1.0.0 the package follows [semantic versioning](https://semver.org/): a breaking change waits for the next major version. Until then, Quoin was 0.x and a minor version could contain breaking changes; those known at release were marked "Breaking". The 0.x sections are kept as they were released, "Docs" headings included. Moving from 0.4 to 1.0 is covered step by step in [MIGRATION.md](MIGRATION.md). Review finding ids such as F-17 are those of the 0.4.0 review in [#73](https://github.com/AmineSeboui/quoin-editor/issues/73).
4
4
 
5
+ ## 1.1.0 (2026-10-29)
6
+
7
+ ### Added
8
+ - A custom block's editor receives `blockId`, `index` (the block's index in the flat `blocks` array, counting from 0 with nested blocks included, kept current as blocks move; only a block whose index changed draws again) and `onRemove`, which removes the block as one undo step and puts the caret where deleting the selected block puts it. A preview receives `onChange` on an editable canvas, written like an editor's: writes to one block that each follow the last within the history's grouping window (500 ms by default) undo together, so it can hold a control such as a checkbox, and a write made while focus is on the block leaves it selected as a whole; a read-only canvas and `QuoinView` pass none. The canvas always passes all of these, and always passes a preview its `blockId`. They are optional in `BlockEditorProps` and `BlockPreviewProps`, so an editor rendered directly with only `data` and `onChange` still compiles.
9
+ - A block definition takes an optional `parse`, which reads a block's stored `data` into the shape its `editor` and `preview` take, to fill required fields and migrate older shapes. The canvas, `QuoinView` and `QuoinDiff` hand its result to `editor` and `preview`; it runs when the block is drawn, once per stored data, and writes nothing, so the stored data changes only when the editor or preview calls `onChange`. A block inserted without `initialData` is seeded with `parse({})`, so `parse` should accept `{}`; when seeding throws, nothing is inserted and the error goes to the canvas's `onError`, or to a warning in development without one. When `parse` throws while drawing, the canvas draws the block's error fallback and reports the error to `onError`, and `QuoinView` and `QuoinDiff` draw the block without its preview and warn once per block type in development. `initialData` stays optional; the custom blocks page recommends `parse` for data with required fields and shows a versioned migration.
10
+ - An image can be marked as deliberately decorative: its data takes `decorative: true` (stored only when true, kept by lossless markdown and `quoin-editor/yjs` like `alt`), and the alt text popover has a "Decorative image" checkbox that stores it and clears the alt text, and hides the hint that calls the alt text required while checked; typing alt text unchecks it. The popover closes, storing nothing, when the alt text or the flag changes under it. An editable canvas draws a "No alt text" badge, which opens the popover, on an image with an empty alt text that is not decorative; a read-only canvas, `QuoinView` and `toHTML` draw none. Output is unchanged: both cases are written with `alt=""`. As `decorative` is now a known key of image data, a value other than `true` is no longer kept, where 1.0 kept it as an extra field. New labels `decorativeImage` and `noAltBadge`.
11
+ - The labels added in this release, `blockError`, `decorativeImage` and `noAltBadge`, are optional in `QuoinLabels` and read as English where missing, so a complete translation typed as `QuoinLabels` still compiles. `englishLabels` is typed `Required<QuoinLabels>`.
12
+
13
+ ### Changed
14
+ - The default `--quoin-warning` and `--quoin-input` reach 3:1 where they did not. Light `--quoin-warning` goes from `oklch(0.65 0.16 65)` to `oklch(0.6 0.16 65)`, the rule of a warning callout against its wash from 2.84:1 to 3.40:1 (dark stays at 7.82:1). `--quoin-input`, the border of the outline button, goes from `oklch(0.922 0 0)` (1.26:1 on the page) to `oklch(0.62 0 0)` (3.64:1) in light, and from `oklch(1 0 0 / 15%)` to the opaque `oklch(0.56 0 0)` (4.25:1 on the page, 3.85:1 on a popover) in dark. A host that sets these tokens keeps its own values.
15
+ - The coverage gate in CI now also covers the canvas and the `useQuoin` and `useLabels` hooks, with line thresholds of 95 percent on `src/view`, 97 on `src/blocks`, 98 on `src/ui`, 98 on `src/context.tsx` (`useQuoin`) and 98 on `src/i18n` (`useLabels`), next to the engine's 90.
16
+ - The build runs each output chunk through Rollup's tree shaking after esbuild, which merges a chunk's imports and drops arguments no caller passes: the main entry goes from 155,039 to 152,741 B gzip and `quoin-editor/headless` from 70,129 to 69,824 B, and the main entry with any feature entry is about 2.2 KB smaller. The `'use client'` directive is on the same files as before, and the engine, view, diff, docx and yjs entries still carry none. The sourcemaps leave out a segment that maps to the same place as the one before it on its line, which keeps the place a greatest lower bound lookup finds, the one browsers and Node's `SourceMap.findEntry` make, and keeps the tarball about 1 MB packed; a least upper bound lookup or a list of every generated position for a source place can differ. The build fails on mappings that hold a character that is not a base64 digit.
17
+
18
+ ### Fixed
19
+ - The attributes an extension's block decoration puts on its block's element are filtered to the names that start with `data-` or `aria-`: a decoration with `style`, `className`, an event handler or `dangerouslySetInnerHTML` no longer reaches the element, and can no longer make React throw.
20
+ - A renderer that throws while drawing its block no longer unmounts the whole canvas: that block draws a fallback named by the new `blockError` label (`Block could not be drawn`) in its own element, the other blocks keep working, the error goes to `onError` when one is given, and React reports it as it does any caught error, and the block is drawn again when its data changes. `EditorView` takes `blockErrorLabel` and `onBlockError` for the same.
21
+ - ArrowUp and ArrowDown pass over a text block whose renderer threw, rather than putting the caret in a block that has no text to hold it.
22
+
5
23
  ## 1.0.2 (2026-10-27)
6
24
 
7
25
  ### Fixed