quoin-editor 1.1.2 → 1.2.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 (128) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/ai.cjs +78 -78
  3. package/dist/ai.js +6 -6
  4. package/dist/catalogue.cjs +24 -24
  5. package/dist/catalogue.js +16 -16
  6. package/dist/{chunk-JEFQNZO4.js → chunk-3BCP6ZUM.js} +5 -5
  7. package/dist/{chunk-JEFQNZO4.js.map → chunk-3BCP6ZUM.js.map} +1 -1
  8. package/dist/{chunk-IVWFPFUG.js → chunk-4EU4BTLZ.js} +82 -34
  9. package/dist/chunk-4EU4BTLZ.js.map +1 -0
  10. package/dist/{chunk-M5FREXRQ.cjs → chunk-4F2IWBFM.cjs} +294 -244
  11. package/dist/chunk-4F2IWBFM.cjs.map +1 -0
  12. package/dist/{chunk-K5HWMBWH.cjs → chunk-4T4TJ2QS.cjs} +9 -9
  13. package/dist/{chunk-K5HWMBWH.cjs.map → chunk-4T4TJ2QS.cjs.map} +1 -1
  14. package/dist/{chunk-ABVSP2XR.cjs → chunk-6X5A4DUQ.cjs} +290 -290
  15. package/dist/{chunk-ABVSP2XR.cjs.map → chunk-6X5A4DUQ.cjs.map} +1 -1
  16. package/dist/{chunk-JYO2T4MC.js → chunk-AD3NY7NA.js} +3 -3
  17. package/dist/{chunk-JYO2T4MC.js.map → chunk-AD3NY7NA.js.map} +1 -1
  18. package/dist/{chunk-QLDXQOHQ.js → chunk-BJTOLCRR.js} +7 -4
  19. package/dist/{chunk-QLDXQOHQ.js.map → chunk-BJTOLCRR.js.map} +1 -1
  20. package/dist/{chunk-OIQAO7QU.js → chunk-BKEHG4QV.js} +4 -4
  21. package/dist/{chunk-OIQAO7QU.js.map → chunk-BKEHG4QV.js.map} +1 -1
  22. package/dist/{chunk-OAAYF2EI.cjs → chunk-BM2GRZNM.cjs} +47 -30
  23. package/dist/chunk-BM2GRZNM.cjs.map +1 -0
  24. package/dist/{chunk-5LWJDRWD.js → chunk-BXSWZEA5.js} +3 -3
  25. package/dist/{chunk-5LWJDRWD.js.map → chunk-BXSWZEA5.js.map} +1 -1
  26. package/dist/{chunk-3G4ZWUUY.js → chunk-CSKKSXCE.js} +38 -19
  27. package/dist/chunk-CSKKSXCE.js.map +1 -0
  28. package/dist/{chunk-BMEEEI43.cjs → chunk-EQKFQK3C.cjs} +13 -13
  29. package/dist/{chunk-BMEEEI43.cjs.map → chunk-EQKFQK3C.cjs.map} +1 -1
  30. package/dist/{chunk-RUC5OZXO.js → chunk-GHNQKJMD.js} +3 -3
  31. package/dist/{chunk-RUC5OZXO.js.map → chunk-GHNQKJMD.js.map} +1 -1
  32. package/dist/{chunk-E52VO5JT.cjs → chunk-H3C3MJW5.cjs} +4 -4
  33. package/dist/{chunk-E52VO5JT.cjs.map → chunk-H3C3MJW5.cjs.map} +1 -1
  34. package/dist/{chunk-JHA23OOK.js → chunk-I4CSCA3O.js} +6 -6
  35. package/dist/{chunk-JHA23OOK.js.map → chunk-I4CSCA3O.js.map} +1 -1
  36. package/dist/{chunk-J37ORWSG.js → chunk-I4NEX6SZ.js} +7 -7
  37. package/dist/{chunk-J37ORWSG.js.map → chunk-I4NEX6SZ.js.map} +1 -1
  38. package/dist/{chunk-ZPGA5UIY.js → chunk-IHTHOAUY.js} +7 -7
  39. package/dist/{chunk-ZPGA5UIY.js.map → chunk-IHTHOAUY.js.map} +1 -1
  40. package/dist/{chunk-6QLA3JOU.cjs → chunk-IQ2DE3Y3.cjs} +90 -90
  41. package/dist/{chunk-6QLA3JOU.cjs.map → chunk-IQ2DE3Y3.cjs.map} +1 -1
  42. package/dist/{chunk-KKRQDVBJ.cjs → chunk-K7E2DR5W.cjs} +24 -24
  43. package/dist/{chunk-KKRQDVBJ.cjs.map → chunk-K7E2DR5W.cjs.map} +1 -1
  44. package/dist/{chunk-ZEQXMRJW.js → chunk-KIU5MPZ4.js} +3 -3
  45. package/dist/{chunk-ZEQXMRJW.js.map → chunk-KIU5MPZ4.js.map} +1 -1
  46. package/dist/{chunk-AQNVYFEU.js → chunk-MEXDDWJF.js} +6 -6
  47. package/dist/{chunk-AQNVYFEU.js.map → chunk-MEXDDWJF.js.map} +1 -1
  48. package/dist/{chunk-VSUGJZ7G.cjs → chunk-NNDLIP2C.cjs} +161 -136
  49. package/dist/chunk-NNDLIP2C.cjs.map +1 -0
  50. package/dist/{chunk-36OSSZDK.js → chunk-OWX3Y5UU.js} +6 -6
  51. package/dist/{chunk-36OSSZDK.js.map → chunk-OWX3Y5UU.js.map} +1 -1
  52. package/dist/{chunk-5QNNF5ZJ.js → chunk-PMJ3VCSR.js} +5 -5
  53. package/dist/{chunk-5QNNF5ZJ.js.map → chunk-PMJ3VCSR.js.map} +1 -1
  54. package/dist/{chunk-G7HK4OHE.js → chunk-PVCXTSUO.js} +49 -24
  55. package/dist/chunk-PVCXTSUO.js.map +1 -0
  56. package/dist/{chunk-EABO523V.cjs → chunk-R45RJQRD.cjs} +31 -31
  57. package/dist/{chunk-EABO523V.cjs.map → chunk-R45RJQRD.cjs.map} +1 -1
  58. package/dist/{chunk-5DEPLPDS.cjs → chunk-RENKFSFD.cjs} +28 -28
  59. package/dist/{chunk-5DEPLPDS.cjs.map → chunk-RENKFSFD.cjs.map} +1 -1
  60. package/dist/{chunk-V2ZBA5VC.js → chunk-TG5T7BEJ.js} +8 -8
  61. package/dist/{chunk-V2ZBA5VC.js.map → chunk-TG5T7BEJ.js.map} +1 -1
  62. package/dist/{chunk-UGAOEZ3O.cjs → chunk-TLMO46OV.cjs} +15 -15
  63. package/dist/{chunk-UGAOEZ3O.cjs.map → chunk-TLMO46OV.cjs.map} +1 -1
  64. package/dist/{chunk-XJ32XESJ.cjs → chunk-TN32PKUI.cjs} +98 -98
  65. package/dist/{chunk-XJ32XESJ.cjs.map → chunk-TN32PKUI.cjs.map} +1 -1
  66. package/dist/{chunk-QAI3CM7V.cjs → chunk-TWFMNDOC.cjs} +55 -55
  67. package/dist/{chunk-QAI3CM7V.cjs.map → chunk-TWFMNDOC.cjs.map} +1 -1
  68. package/dist/{chunk-ES2QYHXL.cjs → chunk-UHAAYYMX.cjs} +45 -45
  69. package/dist/{chunk-ES2QYHXL.cjs.map → chunk-UHAAYYMX.cjs.map} +1 -1
  70. package/dist/{chunk-PNMBRBAT.cjs → chunk-UMTKQVOX.cjs} +4 -4
  71. package/dist/{chunk-PNMBRBAT.cjs.map → chunk-UMTKQVOX.cjs.map} +1 -1
  72. package/dist/{chunk-KFIE4OJE.cjs → chunk-VNRBCUBV.cjs} +15 -15
  73. package/dist/{chunk-KFIE4OJE.cjs.map → chunk-VNRBCUBV.cjs.map} +1 -1
  74. package/dist/{chunk-PRXIYHSX.js → chunk-WCAUPASG.js} +6 -6
  75. package/dist/{chunk-PRXIYHSX.js.map → chunk-WCAUPASG.js.map} +1 -1
  76. package/dist/{chunk-6H76FAI3.cjs → chunk-WZA5S5EJ.cjs} +7 -4
  77. package/dist/{chunk-6H76FAI3.cjs.map → chunk-WZA5S5EJ.cjs.map} +1 -1
  78. package/dist/{chunk-EDKQQKQR.js → chunk-X4FDLUXJ.js} +6 -6
  79. package/dist/{chunk-EDKQQKQR.js.map → chunk-X4FDLUXJ.js.map} +1 -1
  80. package/dist/{chunk-P3T5XBYW.cjs → chunk-XZ4NC3Q7.cjs} +6 -6
  81. package/dist/{chunk-P3T5XBYW.cjs.map → chunk-XZ4NC3Q7.cjs.map} +1 -1
  82. package/dist/comments.cjs +58 -58
  83. package/dist/comments.js +7 -7
  84. package/dist/diff.cjs +29 -32
  85. package/dist/diff.cjs.map +1 -1
  86. package/dist/diff.js +8 -11
  87. package/dist/diff.js.map +1 -1
  88. package/dist/docx.cjs +30 -30
  89. package/dist/docx.js +3 -3
  90. package/dist/embed.cjs +9 -9
  91. package/dist/embed.js +7 -7
  92. package/dist/emoji.cjs +9 -9
  93. package/dist/emoji.js +6 -6
  94. package/dist/engine.cjs +58 -58
  95. package/dist/engine.d.cts +4 -1
  96. package/dist/engine.d.ts +4 -1
  97. package/dist/engine.js +3 -3
  98. package/dist/find.cjs +10 -10
  99. package/dist/find.js +6 -6
  100. package/dist/headless.cjs +74 -74
  101. package/dist/headless.js +4 -4
  102. package/dist/index.cjs +86 -86
  103. package/dist/index.js +5 -5
  104. package/dist/math.cjs +10 -10
  105. package/dist/math.js +8 -8
  106. package/dist/mention.cjs +10 -10
  107. package/dist/mention.js +8 -8
  108. package/dist/presence.cjs +38 -38
  109. package/dist/presence.js +7 -7
  110. package/dist/stats.cjs +10 -10
  111. package/dist/stats.js +7 -7
  112. package/dist/table.cjs +25 -25
  113. package/dist/table.js +6 -6
  114. package/dist/toc.cjs +9 -9
  115. package/dist/toc.js +6 -6
  116. package/dist/view.cjs +4 -4
  117. package/dist/view.js +2 -2
  118. package/dist/yjs.cjs +125 -120
  119. package/dist/yjs.cjs.map +1 -1
  120. package/dist/yjs.js +11 -6
  121. package/dist/yjs.js.map +1 -1
  122. package/package.json +1 -1
  123. package/dist/chunk-3G4ZWUUY.js.map +0 -1
  124. package/dist/chunk-G7HK4OHE.js.map +0 -1
  125. package/dist/chunk-IVWFPFUG.js.map +0 -1
  126. package/dist/chunk-M5FREXRQ.cjs.map +0 -1
  127. package/dist/chunk-OAAYF2EI.cjs.map +0 -1
  128. package/dist/chunk-VSUGJZ7G.cjs.map +0 -1
package/CHANGELOG.md CHANGED
@@ -2,6 +2,25 @@
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.2.0 (2026-10-31)
6
+
7
+ ### Fixed
8
+ - An extension's `priority` means one thing for blocks, marks, atoms, keys and commands: the higher wins. A block, mark or atom spec from an extension at a lower priority than another extension, core included, no longer replaces it, where the lower priority won for schema entries and the higher for keys and commands. Extensions at the default priority resolve as before. `priority` is now described in the extensions docs.
9
+ - Undo separates edits made in two places: typing at the start of a block and then at its end within the grouping delay is two undo steps, as it is in a collaboration, and a caret that lands where the last edit ended still groups. Undoing a formatting change no longer collapses positions inside the range, so collaborators' carets, highlights and comment ranges stay where they were.
10
+ - Undoing formatting is now a step of a new kind, `restoreMarks`, in step JSON; a host that relays steps between clients of different versions needs the same version on both ends, as older versions cannot read it. This is the one change to the step wire format.
11
+ - A legacy block beside a real block named like one of its derived ids, such as `a` beside `a-2`, is diffed under the same ids the editor gives its pieces, so the diff no longer reports a deletion, a change and an insertion for an unchanged document.
12
+ - A codec that has loaded a document with such a real block gives the same ids to a later document without it as a new codec does.
13
+ - Typing right after a local change that is not recorded and moves no text, such as opening a toggle or an upload result filling an image, is its own undo step instead of joining the step before it. A remote or reconciled change of that kind leaves the step open.
14
+ - `diffBlocks` reports the word changes of a block that moved and was edited: its `insert` now holds a `change`, as an edited block in place is reported. `QuoinDiff` showed them already and is unchanged.
15
+ - A change inside Chinese, Japanese or Thai text, written without spaces, marks only the changed words where the runtime has `Intl.Segmenter`, where it marked the whole run.
16
+ - Diffing two versions that differ in more than 2,000 blocks, or two texts in more than 2,000 words, reports the older version as deleted and the newer as inserted, whole and with no block marked as moved, so the time and memory stay bounded: two documents of 5,000 blocks with nothing in common diff in a fraction of a second, where it took seconds and hundreds of megabytes.
17
+ - On a read-only canvas whose text a page translator or another script rewrote, a drag across blocks no longer throws on every pointer move.
18
+ - Text a script or a browser extension rewrites in one block while a composition runs in another reaches the document when the composition ends, where the document kept the old text while the page showed the new one.
19
+ - Command with Up or Down on a Mac, and Control with Home or End elsewhere, go to the start or the end of the document, where they stopped at the edge of the block. These keys also leave a selected divider, image or other block for that edge, where on a Mac Command with Up or Down did nothing. Shift with Control+Home or Control+End extends the selection there; on a Mac, Command with Shift and Up or Down moves the block where it can, and extends the selection to the edge where it cannot, such as in the first block. Shift with Up or Down across blocks keeps the caret's horizontal position, where it kept the character offset and drifted sideways between a heading and a paragraph.
20
+
21
+ ### Added
22
+ - `BlockCodec.toEngineBlocks(block, taken?)` takes the ids of the other blocks of the document, so the ids it gives the pieces of a legacy block avoid theirs.
23
+
5
24
  ## 1.1.2 (2026-10-30)
6
25
 
7
26
  ### Fixed
package/dist/ai.cjs CHANGED
@@ -2,13 +2,13 @@
2
2
  'use strict';
3
3
 
4
4
  var chunkLE5XMIFJ_cjs = require('./chunk-LE5XMIFJ.cjs');
5
- var chunkPNMBRBAT_cjs = require('./chunk-PNMBRBAT.cjs');
6
- var chunkABVSP2XR_cjs = require('./chunk-ABVSP2XR.cjs');
7
- var chunkVSUGJZ7G_cjs = require('./chunk-VSUGJZ7G.cjs');
5
+ var chunkUMTKQVOX_cjs = require('./chunk-UMTKQVOX.cjs');
6
+ var chunk6X5A4DUQ_cjs = require('./chunk-6X5A4DUQ.cjs');
7
+ var chunkNNDLIP2C_cjs = require('./chunk-NNDLIP2C.cjs');
8
8
  require('./chunk-A6PGQVTR.cjs');
9
- var chunkM5FREXRQ_cjs = require('./chunk-M5FREXRQ.cjs');
10
- require('./chunk-OAAYF2EI.cjs');
11
- var chunk6H76FAI3_cjs = require('./chunk-6H76FAI3.cjs');
9
+ var chunk4F2IWBFM_cjs = require('./chunk-4F2IWBFM.cjs');
10
+ require('./chunk-BM2GRZNM.cjs');
11
+ var chunkWZA5S5EJ_cjs = require('./chunk-WZA5S5EJ.cjs');
12
12
  var lucideReact = require('lucide-react');
13
13
  var react = require('react');
14
14
  var jsxRuntime = require('react/jsx-runtime');
@@ -110,30 +110,30 @@ function closeStreaming(markdown) {
110
110
  // src/extensions/ai/ai-target.ts
111
111
  function targetOfBlocks(state, ids) {
112
112
  const { doc, schema } = state;
113
- const first = chunk6H76FAI3_cjs.blockById(doc, ids[0]);
114
- const last = chunk6H76FAI3_cjs.blockById(doc, ids[ids.length - 1]);
113
+ const first = chunkWZA5S5EJ_cjs.blockById(doc, ids[0]);
114
+ const last = chunkWZA5S5EJ_cjs.blockById(doc, ids[ids.length - 1]);
115
115
  if (first === void 0 || last === void 0) return null;
116
- const start = chunkM5FREXRQ_cjs.primaryRegion(schema, first);
117
- const end = chunkM5FREXRQ_cjs.primaryRegion(schema, last);
116
+ const start = chunk4F2IWBFM_cjs.primaryRegion(schema, first);
117
+ const end = chunk4F2IWBFM_cjs.primaryRegion(schema, last);
118
118
  if (start === null || end === null) return null;
119
119
  const from = { block: first.id, region: start, offset: 0 };
120
- return { from, to: { block: last.id, region: end, offset: chunkM5FREXRQ_cjs.regionLength(last, end) }, selected: ids.length > 1 };
120
+ return { from, to: { block: last.id, region: end, offset: chunk4F2IWBFM_cjs.regionLength(last, end) }, selected: ids.length > 1 };
121
121
  }
122
122
  function targetOfSelection(state) {
123
123
  const { doc, selection } = state;
124
124
  if (selection === null) return null;
125
- if (selection.kind !== "text") return targetOfBlocks(state, chunkM5FREXRQ_cjs.selectedBlockIds(doc, selection));
126
- const { from, to } = chunkM5FREXRQ_cjs.orderedRange(doc, selection.anchor, selection.head);
127
- if (chunkM5FREXRQ_cjs.comparePos(doc, from, to) !== 0) return { from, to, selected: true };
125
+ if (selection.kind !== "text") return targetOfBlocks(state, chunk4F2IWBFM_cjs.selectedBlockIds(doc, selection));
126
+ const { from, to } = chunk4F2IWBFM_cjs.orderedRange(doc, selection.anchor, selection.head);
127
+ if (chunk4F2IWBFM_cjs.comparePos(doc, from, to) !== 0) return { from, to, selected: true };
128
128
  const block = doc.blocks[doc.index.get(from.block)];
129
129
  const whole = { block: from.block, region: from.region };
130
- return { from: { ...whole, offset: 0 }, to: { ...whole, offset: chunkM5FREXRQ_cjs.regionLength(block, from.region) }, selected: false };
130
+ return { from: { ...whole, offset: 0 }, to: { ...whole, offset: chunk4F2IWBFM_cjs.regionLength(block, from.region) }, selected: false };
131
131
  }
132
132
  function nearestKept(tr, target) {
133
133
  const { doc } = tr.before;
134
134
  const first = doc.index.get(target.from.block) ?? 0;
135
135
  const last = doc.index.get(target.to.block) ?? first;
136
- const kept = (block) => block && chunk6H76FAI3_cjs.blockById(tr.doc, block.id);
136
+ const kept = (block) => block && chunkWZA5S5EJ_cjs.blockById(tr.doc, block.id);
137
137
  for (let step = 1; first - step >= 0 || last + step < doc.blocks.length; step++) {
138
138
  const found = kept(doc.blocks[first - step]) ?? kept(doc.blocks[last + step]);
139
139
  if (found) return found;
@@ -142,10 +142,10 @@ function nearestKept(tr, target) {
142
142
  }
143
143
  function edgeOf(tr, target) {
144
144
  const point = tr.mapPos(target.from, -1);
145
- const block = chunk6H76FAI3_cjs.blockById(tr.doc, point.block) ?? nearestKept(tr, target);
145
+ const block = chunkWZA5S5EJ_cjs.blockById(tr.doc, point.block) ?? nearestKept(tr, target);
146
146
  if (block === void 0) return null;
147
- const region = chunkM5FREXRQ_cjs.primaryRegion(tr.before.schema, block) ?? "";
148
- const length = region === "" ? 0 : chunkM5FREXRQ_cjs.regionLength(block, region);
147
+ const region = chunk4F2IWBFM_cjs.primaryRegion(tr.before.schema, block) ?? "";
148
+ const length = region === "" ? 0 : chunk4F2IWBFM_cjs.regionLength(block, region);
149
149
  const offset = block.id === point.block ? Math.min(point.offset, length) : length;
150
150
  const after = offset > 0 || length === 0;
151
151
  const at = { block: block.id, region, offset: after ? length : 0 };
@@ -157,29 +157,29 @@ function mapTarget(tr, target) {
157
157
  const from = tr.mapPos(target.from, inside);
158
158
  const mapped2 = tr.mapPos(target.to, -inside);
159
159
  if (!tr.doc.index.has(from.block) || !tr.doc.index.has(mapped2.block)) return edgeOf(tr, target);
160
- const to = chunkM5FREXRQ_cjs.comparePos(tr.doc, from, mapped2) > 0 ? from : mapped2;
160
+ const to = chunk4F2IWBFM_cjs.comparePos(tr.doc, from, mapped2) > 0 ? from : mapped2;
161
161
  return from === target.from && to === target.to ? target : { ...target, from, to };
162
162
  }
163
- var targetGone = (doc, target) => target.lost !== void 0 || target.selected && chunkM5FREXRQ_cjs.comparePos(doc, target.from, target.to) === 0;
163
+ var targetGone = (doc, target) => target.lost !== void 0 || target.selected && chunk4F2IWBFM_cjs.comparePos(doc, target.from, target.to) === 0;
164
164
  function targetRanges(state, { from, to }) {
165
165
  const { doc, schema } = state;
166
166
  const start = doc.index.get(from.block);
167
167
  const end = doc.index.get(to.block);
168
168
  return doc.blocks.slice(start, end + 1).flatMap((block, i) => {
169
- const region = i === 0 ? from.region : block.id === to.block ? to.region : chunkM5FREXRQ_cjs.primaryRegion(schema, block);
169
+ const region = i === 0 ? from.region : block.id === to.block ? to.region : chunk4F2IWBFM_cjs.primaryRegion(schema, block);
170
170
  if (region === null || !Object.hasOwn(block.regions, region)) return [];
171
171
  const left = i === 0 ? from.offset : 0;
172
- const right = block.id === to.block ? to.offset : chunkM5FREXRQ_cjs.regionLength(block, region);
172
+ const right = block.id === to.block ? to.offset : chunk4F2IWBFM_cjs.regionLength(block, region);
173
173
  return right > left ? [{ block: block.id, region, from: left, to: right }] : [];
174
174
  });
175
175
  }
176
176
 
177
177
  // src/extensions/ai/ai-plugin.ts
178
- var aiKey = chunkM5FREXRQ_cjs.createPluginKey("ai");
178
+ var aiKey = chunk4F2IWBFM_cjs.createPluginKey("ai");
179
179
  var AI = "ai";
180
180
  var IDLE = { target: null, menu: null, ghost: null, held: [] };
181
- var aiState = (state) => chunkM5FREXRQ_cjs.getPluginState(state, aiKey);
182
- var aiTransaction = (state, act2) => new chunkM5FREXRQ_cjs.Transaction(state).setMeta(AI, act2).setMeta("addToHistory", false);
181
+ var aiState = (state) => chunk4F2IWBFM_cjs.getPluginState(state, aiKey);
182
+ var aiTransaction = (state, act2) => new chunk4F2IWBFM_cjs.Transaction(state).setMeta(AI, act2).setMeta("addToHistory", false);
183
183
  function written(ghost, key, phase, output) {
184
184
  return ghost.key !== key ? ghost : { ...ghost, phase, output, shown: closeStreaming(output) };
185
185
  }
@@ -211,8 +211,8 @@ function caretBlock(state) {
211
211
  return selection?.kind === "text" ? selection.head.block : null;
212
212
  }
213
213
  function hasText(state, id) {
214
- const block = chunk6H76FAI3_cjs.blockById(state.doc, id);
215
- return block !== void 0 && Object.keys(block.regions).some((region) => chunkM5FREXRQ_cjs.regionLength(block, region) > 0);
214
+ const block = chunkWZA5S5EJ_cjs.blockById(state.doc, id);
215
+ return block !== void 0 && Object.keys(block.regions).some((region) => chunk4F2IWBFM_cjs.regionLength(block, region) > 0);
216
216
  }
217
217
  function heldText(tr, value, before, after) {
218
218
  if (!tr.docChanged) return value.held;
@@ -310,13 +310,13 @@ function aroundSelection(text, start, end, limit = CONTEXT_LIMIT) {
310
310
  }
311
311
  var WHITESPACE_ENTITY = /(?<!\\)&#(32|9);/g;
312
312
  var plain = (markdown) => markdown.replace(WHITESPACE_ENTITY, (_, code) => code === "32" ? " " : " ");
313
- var markdownOf = (state, blocks) => chunkM5FREXRQ_cjs.toMarkdown(blocks, { schema: state.schema, comments: false });
313
+ var markdownOf = (state, blocks) => chunk4F2IWBFM_cjs.toMarkdown(blocks, { schema: state.schema, comments: false });
314
314
  function rangeMarkdown(state, from, to) {
315
- const slice = chunkM5FREXRQ_cjs.sliceFromSelection({ ...state, selection: chunkM5FREXRQ_cjs.textSelection(from, to) }, chunk6H76FAI3_cjs.createBlockCodec(state.schema));
315
+ const slice = chunk4F2IWBFM_cjs.sliceFromSelection({ ...state, selection: chunk4F2IWBFM_cjs.textSelection(from, to) }, chunkWZA5S5EJ_cjs.createBlockCodec(state.schema));
316
316
  return slice === null ? "" : markdownOf(state, slice.blocks).replace(/\n$/, "");
317
317
  }
318
318
  function documentContext(state, target, selection) {
319
- const blocks = chunk6H76FAI3_cjs.createBlockCodec(state.schema).blocksFromDoc(state.doc);
319
+ const blocks = chunkWZA5S5EJ_cjs.createBlockCodec(state.schema).blocksFromDoc(state.doc);
320
320
  const full = plain(markdownOf(state, blocks));
321
321
  if (full.length <= CONTEXT_LIMIT) return full;
322
322
  const index = state.doc.index.get(target.from.block) ?? 0;
@@ -377,7 +377,7 @@ async function read(editor, link, run, stream, request) {
377
377
  } catch (error) {
378
378
  if (!live()) return;
379
379
  end("error");
380
- link.report(chunkABVSP2XR_cjs.toError(error));
380
+ link.report(chunk6X5A4DUQ_cjs.toError(error));
381
381
  }
382
382
  }
383
383
  function startStream(editor, link, stream, request, replace) {
@@ -552,25 +552,25 @@ function resolveAiLabels(overrides) {
552
552
  var openOnSpace = (state, dispatch) => {
553
553
  const { selection, doc } = state;
554
554
  const ai = aiState(state);
555
- if (selection?.kind !== "text" || !chunkM5FREXRQ_cjs.isCollapsed(selection) || ai.menu !== null || ai.ghost !== null) return false;
555
+ if (selection?.kind !== "text" || !chunk4F2IWBFM_cjs.isCollapsed(selection) || ai.menu !== null || ai.ghost !== null) return false;
556
556
  const { head } = selection;
557
557
  const block = doc.blocks[doc.index.get(head.block)];
558
558
  const paragraph = block.type === "MARKDOWN" && block.attrs.kind === "paragraph";
559
- if (!paragraph || chunkM5FREXRQ_cjs.regionLength(block, head.region) > 0 || ai.held.includes(block.id)) return false;
559
+ if (!paragraph || chunk4F2IWBFM_cjs.regionLength(block, head.region) > 0 || ai.held.includes(block.id)) return false;
560
560
  dispatch?.(aiTransaction(state, { type: "open", target: { from: head, to: head, selected: false }, fromSpace: true }));
561
561
  return true;
562
562
  };
563
563
 
564
564
  // src/extensions/ai/ai-accept.ts
565
- var isParagraph = (block) => block?.type === "MARKDOWN" && chunk6H76FAI3_cjs.parseLine(String(block.data.markdown ?? "")).kind === "paragraph";
565
+ var isParagraph = (block) => block?.type === "MARKDOWN" && chunkWZA5S5EJ_cjs.parseLine(String(block.data.markdown ?? "")).kind === "paragraph";
566
566
  var DISCARD = { type: "discard" };
567
567
  function insertBeside(tr, schema, target, pieces, makeId) {
568
568
  const index = tr.doc.index.get(target.to.block);
569
- const at = target.lost?.after ? chunkM5FREXRQ_cjs.descendantsEnd(tr.doc, index) : index;
570
- const fresh = chunkM5FREXRQ_cjs.freshBlocks(pieces, tr.doc.blocks[index].indent, makeId);
571
- tr.step(chunkM5FREXRQ_cjs.insertBlocksStep(at, fresh));
572
- chunkM5FREXRQ_cjs.capIndents(tr, at, at + fresh.length);
573
- tr.setSelection(chunkM5FREXRQ_cjs.endOf(tr.doc, schema, fresh[fresh.length - 1].id));
569
+ const at = target.lost?.after ? chunk4F2IWBFM_cjs.descendantsEnd(tr.doc, index) : index;
570
+ const fresh = chunk4F2IWBFM_cjs.freshBlocks(pieces, tr.doc.blocks[index].indent, makeId);
571
+ tr.step(chunk4F2IWBFM_cjs.insertBlocksStep(at, fresh));
572
+ chunk4F2IWBFM_cjs.capIndents(tr, at, at + fresh.length);
573
+ tr.setSelection(chunk4F2IWBFM_cjs.endOf(tr.doc, schema, fresh[fresh.length - 1].id));
574
574
  }
575
575
  function acceptAnswer(editor) {
576
576
  const { state } = editor;
@@ -578,7 +578,7 @@ function acceptAnswer(editor) {
578
578
  if (target === null || ghost === null || ghost.phase === "streaming" || ghost.phase === "error") return null;
579
579
  const { codec } = editor;
580
580
  const makeId = codec.context.newId;
581
- const blocks = chunk6H76FAI3_cjs.fromMarkdown(ghost.output, { newId: makeId });
581
+ const blocks = chunkWZA5S5EJ_cjs.fromMarkdown(ghost.output, { newId: makeId });
582
582
  const pieces = blocks.flatMap((block) => codec.toEngineBlocks(block));
583
583
  const tr = editor.createTransaction().setOrigin("ai").setMeta(AI, DISCARD);
584
584
  const gone = targetGone(state.doc, target);
@@ -588,12 +588,12 @@ function acceptAnswer(editor) {
588
588
  const { schema } = state;
589
589
  const open = { openStart: isParagraph(blocks[0]), openEnd: isParagraph(blocks[blocks.length - 1]) };
590
590
  if (ghost.replace || gone) {
591
- const caret = ghost.replace && !gone ? chunkM5FREXRQ_cjs.deleteRange(tr, schema, target.from, target.to, makeId) : target.to;
592
- chunkM5FREXRQ_cjs.pasteAtCaret(tr, schema, caret, open, pieces, makeId);
591
+ const caret = ghost.replace && !gone ? chunk4F2IWBFM_cjs.deleteRange(tr, schema, target.from, target.to, makeId) : target.to;
592
+ chunk4F2IWBFM_cjs.pasteAtCaret(tr, schema, caret, open, pieces, makeId);
593
593
  } else {
594
594
  const block = tr.doc.blocks[tr.doc.index.get(target.to.block)];
595
- const end = { ...target.to, offset: chunkM5FREXRQ_cjs.regionLength(block, target.to.region) };
596
- chunkM5FREXRQ_cjs.pasteAtCaret(tr, schema, end, { openStart: false, openEnd: false }, pieces, makeId);
595
+ const end = { ...target.to, offset: chunk4F2IWBFM_cjs.regionLength(block, target.to.region) };
596
+ chunk4F2IWBFM_cjs.pasteAtCaret(tr, schema, end, { openStart: false, openEnd: false }, pieces, makeId);
597
597
  }
598
598
  }
599
599
  editor.dispatch(tr);
@@ -608,12 +608,12 @@ function AiBar({ env, ghost, gone, barId }) {
608
608
  const [next, setNext] = react.useState("");
609
609
  const { phase } = ghost;
610
610
  const focusPrimary = () => content.current?.querySelector(`[${PRIMARY}]`)?.focus();
611
- chunkVSUGJZ7G_cjs.useIsomorphicLayoutEffect(() => {
611
+ chunkNNDLIP2C_cjs.useIsomorphicLayoutEffect(() => {
612
612
  const active = content.current?.ownerDocument.activeElement;
613
613
  inside.current = active == null || active === active.ownerDocument.body;
614
614
  if (inside.current) focusPrimary();
615
615
  }, []);
616
- chunkVSUGJZ7G_cjs.useIsomorphicLayoutEffect(() => {
616
+ chunkNNDLIP2C_cjs.useIsomorphicLayoutEffect(() => {
617
617
  const active = content.current?.ownerDocument.activeElement;
618
618
  if (inside.current && !content.current?.contains(active ?? null)) focusPrimary();
619
619
  }, [phase, ghost.key]);
@@ -661,21 +661,21 @@ function AiBar({ env, ghost, gone, barId }) {
661
661
  children: [
662
662
  phase === "streaming" && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
663
663
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-muted-foreground", children: labels.writing }),
664
- /* @__PURE__ */ jsxRuntime.jsx(chunkABVSP2XR_cjs.Button, { ...primary, size: "sm", variant: "outline", onClick: () => stop(editor), children: labels.stop })
664
+ /* @__PURE__ */ jsxRuntime.jsx(chunk6X5A4DUQ_cjs.Button, { ...primary, size: "sm", variant: "outline", onClick: () => stop(editor), children: labels.stop })
665
665
  ] }),
666
666
  phase === "error" && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
667
667
  /* @__PURE__ */ jsxRuntime.jsx("p", { role: "alert", className: "text-sm text-destructive", children: labels.failed }),
668
- /* @__PURE__ */ jsxRuntime.jsx(chunkABVSP2XR_cjs.Button, { ...primary, size: "sm", onClick: () => retry(editor, stream), children: labels.retry }),
669
- /* @__PURE__ */ jsxRuntime.jsx(chunkABVSP2XR_cjs.Button, { size: "sm", variant: "ghost", onClick: onDiscard, children: labels.discard })
668
+ /* @__PURE__ */ jsxRuntime.jsx(chunk6X5A4DUQ_cjs.Button, { ...primary, size: "sm", onClick: () => retry(editor, stream), children: labels.retry }),
669
+ /* @__PURE__ */ jsxRuntime.jsx(chunk6X5A4DUQ_cjs.Button, { size: "sm", variant: "ghost", onClick: onDiscard, children: labels.discard })
670
670
  ] }),
671
671
  (phase === "done" || phase === "stopped") && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
672
672
  phase === "stopped" && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-muted-foreground", children: labels.stopped }),
673
673
  gone && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "w-full text-xs text-muted-foreground", children: labels.targetGone }),
674
- /* @__PURE__ */ jsxRuntime.jsx(chunkABVSP2XR_cjs.Button, { ...primary, size: "sm", onClick: onAccept, children: labels.accept }),
675
- /* @__PURE__ */ jsxRuntime.jsx(chunkABVSP2XR_cjs.Button, { size: "sm", variant: "ghost", onClick: onDiscard, children: labels.discard }),
676
- /* @__PURE__ */ jsxRuntime.jsx(chunkABVSP2XR_cjs.Button, { size: "sm", variant: "ghost", onClick: () => retry(editor, stream), children: labels.retry }),
674
+ /* @__PURE__ */ jsxRuntime.jsx(chunk6X5A4DUQ_cjs.Button, { ...primary, size: "sm", onClick: onAccept, children: labels.accept }),
675
+ /* @__PURE__ */ jsxRuntime.jsx(chunk6X5A4DUQ_cjs.Button, { size: "sm", variant: "ghost", onClick: onDiscard, children: labels.discard }),
676
+ /* @__PURE__ */ jsxRuntime.jsx(chunk6X5A4DUQ_cjs.Button, { size: "sm", variant: "ghost", onClick: () => retry(editor, stream), children: labels.retry }),
677
677
  /* @__PURE__ */ jsxRuntime.jsx("form", { className: "w-full", onSubmit: onFollowUp, children: /* @__PURE__ */ jsxRuntime.jsx(
678
- chunkABVSP2XR_cjs.Input,
678
+ chunk6X5A4DUQ_cjs.Input,
679
679
  {
680
680
  "aria-label": labels.followUp,
681
681
  placeholder: labels.followUp,
@@ -696,8 +696,8 @@ function AiBar({ env, ghost, gone, barId }) {
696
696
  var reader = null;
697
697
  function readerOf() {
698
698
  if (reader === null) {
699
- const schema = chunk6H76FAI3_cjs.createSchema();
700
- reader = { schema, codec: chunk6H76FAI3_cjs.createBlockCodec(schema) };
699
+ const schema = chunkWZA5S5EJ_cjs.createSchema();
700
+ reader = { schema, codec: chunkWZA5S5EJ_cjs.createBlockCodec(schema) };
701
701
  }
702
702
  return reader;
703
703
  }
@@ -705,16 +705,16 @@ function fillGhost(ghost, markdown) {
705
705
  const doc = ghost.ownerDocument;
706
706
  const { schema, codec } = readerOf();
707
707
  const drawn2 = [];
708
- for (const block of chunk6H76FAI3_cjs.fromMarkdown(markdown)) {
708
+ for (const block of chunkWZA5S5EJ_cjs.fromMarkdown(markdown)) {
709
709
  for (const piece of codec.toEngineBlocks(block)) {
710
710
  const element = doc.createElement("div");
711
711
  element.className = "quoin-ai-ghost-block";
712
712
  element.dataset.kind = String(piece.attrs.kind ?? piece.type.toLowerCase());
713
713
  if (piece.attrs.level !== void 0) element.dataset.level = String(piece.attrs.level);
714
714
  if (piece.indent > 0) element.style.setProperty("--quoin-ai-indent", String(piece.indent));
715
- const region = chunkM5FREXRQ_cjs.primaryRegion(schema, piece);
716
- if (region === null) element.textContent = chunkM5FREXRQ_cjs.toPlainText([codec.toQuoin(piece)], { schema });
717
- else chunkVSUGJZ7G_cjs.renderInline(element, piece.regions[region], []);
715
+ const region = chunk4F2IWBFM_cjs.primaryRegion(schema, piece);
716
+ if (region === null) element.textContent = chunk4F2IWBFM_cjs.toPlainText([codec.toQuoin(piece)], { schema });
717
+ else chunkNNDLIP2C_cjs.renderInline(element, piece.regions[region], []);
718
718
  drawn2.push(element);
719
719
  }
720
720
  }
@@ -791,7 +791,7 @@ function clipAside(layer, text, areas, scale) {
791
791
  function useGhostPlace(controller, layer, block, region) {
792
792
  const placeNow = react.useRef(() => {
793
793
  });
794
- chunkVSUGJZ7G_cjs.useIsomorphicLayoutEffect(() => {
794
+ chunkNNDLIP2C_cjs.useIsomorphicLayoutEffect(() => {
795
795
  const root = controller.root;
796
796
  const element = layer.current;
797
797
  const view = root?.ownerDocument.defaultView;
@@ -830,7 +830,7 @@ function AiGhost({ env, ghost, target, gone, barId }) {
830
830
  const layer = react.useRef(null);
831
831
  const drawn2 = react.useRef(null);
832
832
  const place2 = useGhostPlace(env.controller, layer, target.to.block, target.to.region);
833
- chunkVSUGJZ7G_cjs.useIsomorphicLayoutEffect(() => {
833
+ chunkNNDLIP2C_cjs.useIsomorphicLayoutEffect(() => {
834
834
  const element = drawn2.current;
835
835
  if (element === null) return;
836
836
  element.setAttribute("inert", "");
@@ -844,7 +844,7 @@ function AiGhost({ env, ghost, target, gone, barId }) {
844
844
  }
845
845
  function useTargetAnchor(controller, target) {
846
846
  const latest = react.useRef(target);
847
- chunkVSUGJZ7G_cjs.useIsomorphicLayoutEffect(() => {
847
+ chunkNNDLIP2C_cjs.useIsomorphicLayoutEffect(() => {
848
848
  latest.current = target;
849
849
  });
850
850
  return react.useMemo(() => {
@@ -853,8 +853,8 @@ function useTargetAnchor(controller, target) {
853
853
  return { block: to.block, region: to.region, from: to.offset, to: to.offset };
854
854
  };
855
855
  return {
856
- current: chunkABVSP2XR_cjs.virtualAnchor(
857
- () => chunkABVSP2XR_cjs.rangeRect(controller, end()),
856
+ current: chunk6X5A4DUQ_cjs.virtualAnchor(
857
+ () => chunk6X5A4DUQ_cjs.rangeRect(controller, end()),
858
858
  () => controller.registry.get(end().block, end().region)
859
859
  )
860
860
  };
@@ -908,7 +908,7 @@ function AiMenu({ env, target, fromSpace }) {
908
908
  };
909
909
  const fieldLabel = asking === "tone" ? labels.tonePrompt : asking === "translate" ? labels.translatePrompt : labels.prompt;
910
910
  return /* @__PURE__ */ jsxRuntime.jsxs(
911
- chunkABVSP2XR_cjs.Popover,
911
+ chunk6X5A4DUQ_cjs.Popover,
912
912
  {
913
913
  open: true,
914
914
  modal: false,
@@ -916,9 +916,9 @@ function AiMenu({ env, target, fromSpace }) {
916
916
  if (!next) closeMenu(controller.editor);
917
917
  },
918
918
  children: [
919
- /* @__PURE__ */ jsxRuntime.jsx(chunkABVSP2XR_cjs.PopoverAnchor, { virtualRef: anchor }),
919
+ /* @__PURE__ */ jsxRuntime.jsx(chunk6X5A4DUQ_cjs.PopoverAnchor, { virtualRef: anchor }),
920
920
  /* @__PURE__ */ jsxRuntime.jsxs(
921
- chunkABVSP2XR_cjs.PopoverContent,
921
+ chunk6X5A4DUQ_cjs.PopoverContent,
922
922
  {
923
923
  "aria-label": labels.askAi,
924
924
  side: "bottom",
@@ -935,7 +935,7 @@ function AiMenu({ env, target, fromSpace }) {
935
935
  },
936
936
  children: [
937
937
  /* @__PURE__ */ jsxRuntime.jsx(
938
- chunkABVSP2XR_cjs.Input,
938
+ chunk6X5A4DUQ_cjs.Input,
939
939
  {
940
940
  ref: field,
941
941
  role: "combobox",
@@ -959,7 +959,7 @@ function AiMenu({ env, target, fromSpace }) {
959
959
  id: optionId(index),
960
960
  role: "option",
961
961
  "aria-selected": index === current,
962
- className: chunkABVSP2XR_cjs.cn(chunkABVSP2XR_cjs.MENU_ITEM, index === current && "bg-accent text-accent-foreground"),
962
+ className: chunk6X5A4DUQ_cjs.cn(chunk6X5A4DUQ_cjs.MENU_ITEM, index === current && "bg-accent text-accent-foreground"),
963
963
  onMouseDown: (event) => event.preventDefault(),
964
964
  onClick: () => choose(choice),
965
965
  children: choice.label
@@ -977,17 +977,17 @@ var goneOf = (state) => {
977
977
  const { target, ghost } = aiState(state);
978
978
  return target !== null && ghost !== null && targetGone(state.doc, target);
979
979
  };
980
- var plainText = (markdown) => chunkM5FREXRQ_cjs.toPlainText(chunk6H76FAI3_cjs.fromMarkdown(markdown));
980
+ var plainText = (markdown) => chunk4F2IWBFM_cjs.toPlainText(chunkWZA5S5EJ_cjs.fromMarkdown(markdown));
981
981
  function AiOverlay({ controller, stream, labels }) {
982
- const { onError } = chunkABVSP2XR_cjs.useQuoin();
982
+ const { onError } = chunk6X5A4DUQ_cjs.useQuoin();
983
983
  const link = linkOf(controller.editor);
984
- chunkVSUGJZ7G_cjs.useIsomorphicLayoutEffect(() => {
984
+ chunkNNDLIP2C_cjs.useIsomorphicLayoutEffect(() => {
985
985
  link.report = onError;
986
986
  link.ended = (phase, output) => controller.announce((phase === "done" ? labels.written : labels.halted)(plainText(output)));
987
987
  }, [link, onError, controller, labels]);
988
- const value = chunkVSUGJZ7G_cjs.useEditorState(controller, aiState);
989
- const gone = chunkVSUGJZ7G_cjs.useEditorState(controller, goneOf);
990
- const readOnly = chunkVSUGJZ7G_cjs.useReadOnly(controller);
988
+ const value = chunkNNDLIP2C_cjs.useEditorState(controller, aiState);
989
+ const gone = chunkNNDLIP2C_cjs.useEditorState(controller, goneOf);
990
+ const readOnly = chunkNNDLIP2C_cjs.useReadOnly(controller);
991
991
  const env = react.useMemo(() => ({ controller, stream, labels }), [controller, stream, labels]);
992
992
  const barId = react.useId();
993
993
  const showing = value.ghost !== null;
@@ -1006,7 +1006,7 @@ function AiOverlay({ controller, stream, labels }) {
1006
1006
  const root = controller.root;
1007
1007
  if (!root) return;
1008
1008
  let away = true;
1009
- return chunkPNMBRBAT_cjs.watchCanvasFocus(controller, root.ownerDocument, (inside, node) => {
1009
+ return chunkUMTKQVOX_cjs.watchCanvasFocus(controller, root.ownerDocument, (inside, node) => {
1010
1010
  if (!inside) away = true;
1011
1011
  else if (root.contains(node)) {
1012
1012
  if (away) noteFocus(controller.editor);
@@ -1042,7 +1042,7 @@ function aiExtension(options) {
1042
1042
  blockMenuItems: [aiBlockMenuItem(labels)],
1043
1043
  overlays: [Overlay]
1044
1044
  };
1045
- return chunkM5FREXRQ_cjs.defineExtension({
1045
+ return chunk4F2IWBFM_cjs.defineExtension({
1046
1046
  name: "ai",
1047
1047
  plugins: [aiPlugin],
1048
1048
  decorations: aiDecorations,
package/dist/ai.js CHANGED
@@ -1,12 +1,12 @@
1
1
  'use client';
2
2
  import { clipBoxes } from './chunk-MQUCCSWG.js';
3
- import { watchCanvasFocus } from './chunk-ZEQXMRJW.js';
4
- import { useQuoin, Popover, PopoverAnchor, PopoverContent, Input, cn, MENU_ITEM, virtualAnchor, rangeRect, Button, toError } from './chunk-JEFQNZO4.js';
5
- import { useIsomorphicLayoutEffect, useEditorState, useReadOnly, renderInline } from './chunk-G7HK4OHE.js';
3
+ import { watchCanvasFocus } from './chunk-KIU5MPZ4.js';
4
+ import { useQuoin, Popover, PopoverAnchor, PopoverContent, Input, cn, MENU_ITEM, virtualAnchor, rangeRect, Button, toError } from './chunk-3BCP6ZUM.js';
5
+ import { useIsomorphicLayoutEffect, useEditorState, useReadOnly, renderInline } from './chunk-PVCXTSUO.js';
6
6
  import './chunk-HDJ653LM.js';
7
- import { createPluginKey, defineExtension, isCollapsed, regionLength, primaryRegion, getPluginState, Transaction, toPlainText, selectedBlockIds, orderedRange, comparePos, sliceFromSelection, textSelection, deleteRange, pasteAtCaret, toMarkdown, descendantsEnd, freshBlocks, insertBlocksStep, capIndents, endOf } from './chunk-IVWFPFUG.js';
8
- import './chunk-3G4ZWUUY.js';
9
- import { blockById, fromMarkdown, createSchema, createBlockCodec, parseLine } from './chunk-QLDXQOHQ.js';
7
+ import { createPluginKey, defineExtension, isCollapsed, regionLength, primaryRegion, getPluginState, Transaction, toPlainText, selectedBlockIds, orderedRange, comparePos, sliceFromSelection, textSelection, deleteRange, pasteAtCaret, toMarkdown, descendantsEnd, freshBlocks, insertBlocksStep, capIndents, endOf } from './chunk-4EU4BTLZ.js';
8
+ import './chunk-CSKKSXCE.js';
9
+ import { blockById, fromMarkdown, createSchema, createBlockCodec, parseLine } from './chunk-BJTOLCRR.js';
10
10
  import { Sparkles, PenLine } from 'lucide-react';
11
11
  import { useMemo, useId, useEffect, useState, useRef, useCallback } from 'react';
12
12
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
@@ -1,23 +1,23 @@
1
1
  'use client';
2
2
  'use strict';
3
3
 
4
- var chunkES2QYHXL_cjs = require('./chunk-ES2QYHXL.cjs');
5
- var chunkUGAOEZ3O_cjs = require('./chunk-UGAOEZ3O.cjs');
6
- var chunkXJ32XESJ_cjs = require('./chunk-XJ32XESJ.cjs');
7
- var chunk6QLA3JOU_cjs = require('./chunk-6QLA3JOU.cjs');
8
- var chunkQAI3CM7V_cjs = require('./chunk-QAI3CM7V.cjs');
9
- require('./chunk-P3T5XBYW.cjs');
10
- var chunkKKRQDVBJ_cjs = require('./chunk-KKRQDVBJ.cjs');
11
- var chunk5DEPLPDS_cjs = require('./chunk-5DEPLPDS.cjs');
12
- require('./chunk-E52VO5JT.cjs');
13
- require('./chunk-BMEEEI43.cjs');
14
- var chunkEABO523V_cjs = require('./chunk-EABO523V.cjs');
15
- require('./chunk-ABVSP2XR.cjs');
16
- require('./chunk-VSUGJZ7G.cjs');
4
+ var chunkUHAAYYMX_cjs = require('./chunk-UHAAYYMX.cjs');
5
+ var chunkTLMO46OV_cjs = require('./chunk-TLMO46OV.cjs');
6
+ var chunkTN32PKUI_cjs = require('./chunk-TN32PKUI.cjs');
7
+ var chunkIQ2DE3Y3_cjs = require('./chunk-IQ2DE3Y3.cjs');
8
+ var chunkTWFMNDOC_cjs = require('./chunk-TWFMNDOC.cjs');
9
+ require('./chunk-XZ4NC3Q7.cjs');
10
+ var chunkK7E2DR5W_cjs = require('./chunk-K7E2DR5W.cjs');
11
+ var chunkRENKFSFD_cjs = require('./chunk-RENKFSFD.cjs');
12
+ require('./chunk-H3C3MJW5.cjs');
13
+ require('./chunk-EQKFQK3C.cjs');
14
+ var chunkR45RJQRD_cjs = require('./chunk-R45RJQRD.cjs');
15
+ require('./chunk-6X5A4DUQ.cjs');
16
+ require('./chunk-NNDLIP2C.cjs');
17
17
  require('./chunk-A6PGQVTR.cjs');
18
- require('./chunk-M5FREXRQ.cjs');
19
- require('./chunk-OAAYF2EI.cjs');
20
- require('./chunk-6H76FAI3.cjs');
18
+ require('./chunk-4F2IWBFM.cjs');
19
+ require('./chunk-BM2GRZNM.cjs');
20
+ require('./chunk-WZA5S5EJ.cjs');
21
21
 
22
22
  // src/extensions/create-catalogue.ts
23
23
  function createCatalogue(features2) {
@@ -29,14 +29,14 @@ function createCatalogue(features2) {
29
29
 
30
30
  // src/catalogue.ts
31
31
  var features = {
32
- table: chunkXJ32XESJ_cjs.tableExtension,
33
- embed: chunk6QLA3JOU_cjs.embedExtension,
34
- math: chunkQAI3CM7V_cjs.mathExtension,
35
- toc: chunkKKRQDVBJ_cjs.tocExtension,
36
- mention: chunk5DEPLPDS_cjs.mentionExtension,
37
- emoji: chunkEABO523V_cjs.emojiExtension,
38
- find: chunkES2QYHXL_cjs.findExtension,
39
- stats: chunkUGAOEZ3O_cjs.statsExtension
32
+ table: chunkTN32PKUI_cjs.tableExtension,
33
+ embed: chunkIQ2DE3Y3_cjs.embedExtension,
34
+ math: chunkTWFMNDOC_cjs.mathExtension,
35
+ toc: chunkK7E2DR5W_cjs.tocExtension,
36
+ mention: chunkRENKFSFD_cjs.mentionExtension,
37
+ emoji: chunkR45RJQRD_cjs.emojiExtension,
38
+ find: chunkUHAAYYMX_cjs.findExtension,
39
+ stats: chunkTLMO46OV_cjs.statsExtension
40
40
  };
41
41
  var catalogue = createCatalogue(features);
42
42
 
package/dist/catalogue.js CHANGED
@@ -1,21 +1,21 @@
1
1
  'use client';
2
- import { findExtension } from './chunk-36OSSZDK.js';
3
- import { statsExtension } from './chunk-JHA23OOK.js';
4
- import { tableExtension } from './chunk-AQNVYFEU.js';
5
- import { embedExtension } from './chunk-J37ORWSG.js';
6
- import { mathExtension } from './chunk-V2ZBA5VC.js';
7
- import './chunk-JYO2T4MC.js';
8
- import { tocExtension } from './chunk-PRXIYHSX.js';
9
- import { mentionExtension } from './chunk-ZPGA5UIY.js';
10
- import './chunk-RUC5OZXO.js';
11
- import './chunk-5QNNF5ZJ.js';
12
- import { emojiExtension } from './chunk-EDKQQKQR.js';
13
- import './chunk-JEFQNZO4.js';
14
- import './chunk-G7HK4OHE.js';
2
+ import { findExtension } from './chunk-OWX3Y5UU.js';
3
+ import { statsExtension } from './chunk-I4CSCA3O.js';
4
+ import { tableExtension } from './chunk-MEXDDWJF.js';
5
+ import { embedExtension } from './chunk-I4NEX6SZ.js';
6
+ import { mathExtension } from './chunk-TG5T7BEJ.js';
7
+ import './chunk-AD3NY7NA.js';
8
+ import { tocExtension } from './chunk-WCAUPASG.js';
9
+ import { mentionExtension } from './chunk-IHTHOAUY.js';
10
+ import './chunk-GHNQKJMD.js';
11
+ import './chunk-PMJ3VCSR.js';
12
+ import { emojiExtension } from './chunk-X4FDLUXJ.js';
13
+ import './chunk-3BCP6ZUM.js';
14
+ import './chunk-PVCXTSUO.js';
15
15
  import './chunk-HDJ653LM.js';
16
- import './chunk-IVWFPFUG.js';
17
- import './chunk-3G4ZWUUY.js';
18
- import './chunk-QLDXQOHQ.js';
16
+ import './chunk-4EU4BTLZ.js';
17
+ import './chunk-CSKKSXCE.js';
18
+ import './chunk-BJTOLCRR.js';
19
19
 
20
20
  // src/extensions/create-catalogue.ts
21
21
  function createCatalogue(features2) {
@@ -1,7 +1,7 @@
1
- import { useQuoinEditor, EditorView, useIsomorphicLayoutEffect, useReadOnly, useEditorState, listen, wholeState, NODE_ENTRY, useBlockDomId, useToggleOpen, ToggleChevron, EditableRegion, drawnBlockCount, isComposingKey, NATIVE_INTERACTION, useRegionDomId, TaskCheckbox, useOrderedNumber, createAutoScroll, domMapOf, dispatchSelection, regionInline, onBlock, hostKey, BlockErrorContext, textDiff, moveToNeighbour, visibleBlockIndexes } from './chunk-G7HK4OHE.js';
1
+ import { useQuoinEditor, EditorView, useIsomorphicLayoutEffect, useReadOnly, useEditorState, listen, wholeState, NODE_ENTRY, useBlockDomId, useToggleOpen, ToggleChevron, EditableRegion, drawnBlockCount, isComposingKey, NATIVE_INTERACTION, useRegionDomId, TaskCheckbox, useOrderedNumber, createAutoScroll, domMapOf, dispatchSelection, regionInline, onBlock, hostKey, BlockErrorContext, textDiff, moveToNeighbour, visibleBlockIndexes } from './chunk-PVCXTSUO.js';
2
2
  import { defineBlock, devWarn, highlightedLines, blockByType, paletteBlocks, tokenColour, seedData, parsedData } from './chunk-HDJ653LM.js';
3
- import { createPluginKey, coreExtensions, defineExtension, duplicateBlocks, primaryRegion, regionLength, headBlockId, sameSelection, Transaction, insertBlocksStep, startOf, replaceBlockStep, descendantsEnd, LINE_JOIN, detectMac, selectedBlockIds, blockRangeSelection, runCommands, setSelection, selectedBlockRange, toMarkdown, isCollapsed, createBlock, isParagraph, nodeSelection, setAttrsStep, LINE_SPLIT, validateSelection, endOf, insertBlockAfter, insertText, isTextFlow, markRanges, setTextAlign, orderedRange, unsetLink, textSelection, toggleMark, isActive, setBlockType, getPluginState, rangeContent, unsetMark, setMark, markExtent, setLink, deleteBlocks, setAttrs, HISTORY_GROUP, setBlockColor, removeMarkStep, caretMarks, replaceInlineStep, keyName, normalizeKey, movedBlockIds, moveBlocksUp, moveBlocksDown, selectAll, redo, undo, moveBlocksTo, indent, outdent } from './chunk-IVWFPFUG.js';
4
- import { str, blockPlainText, sanitizeHref, inlineText, parseInline, newId, createDoc, sameItems, headingLevel, sanitizeAssetUrl, blockById, sliceInline, specFor, createBlockCodec, hasMark, alignOrUndefined, optionalNumber, requireBlockIndex, SCHEME, inlineLength, paletteOrUndefined, PALETTE, addMark, text, sameValue } from './chunk-QLDXQOHQ.js';
3
+ import { createPluginKey, coreExtensions, defineExtension, duplicateBlocks, primaryRegion, regionLength, headBlockId, sameSelection, Transaction, insertBlocksStep, startOf, replaceBlockStep, descendantsEnd, LINE_JOIN, detectMac, selectedBlockIds, blockRangeSelection, runCommands, setSelection, selectedBlockRange, toMarkdown, isCollapsed, createBlock, isParagraph, nodeSelection, setAttrsStep, LINE_SPLIT, validateSelection, endOf, insertBlockAfter, insertText, isTextFlow, markRanges, setTextAlign, orderedRange, unsetLink, textSelection, toggleMark, isActive, setBlockType, getPluginState, rangeContent, unsetMark, setMark, markExtent, setLink, deleteBlocks, setAttrs, HISTORY_GROUP, setBlockColor, removeMarkStep, caretMarks, replaceInlineStep, keyName, normalizeKey, movedBlockIds, moveBlocksUp, moveBlocksDown, selectAll, redo, undo, moveBlocksTo, indent, outdent } from './chunk-4EU4BTLZ.js';
4
+ import { str, blockPlainText, sanitizeHref, inlineText, parseInline, newId, createDoc, sameItems, headingLevel, sanitizeAssetUrl, blockById, sliceInline, specFor, createBlockCodec, hasMark, alignOrUndefined, optionalNumber, requireBlockIndex, SCHEME, inlineLength, paletteOrUndefined, PALETTE, addMark, text, sameValue } from './chunk-BJTOLCRR.js';
5
5
  import * as React7 from 'react';
6
6
  import { createContext, forwardRef, useRef, useImperativeHandle, useState, useMemo, useEffect, Fragment as Fragment$1, useContext, useSyncExternalStore, useCallback, useId, createElement } from 'react';
7
7
  import { FileText, MessageSquare, Code, Image, Paperclip, CopyPlus, Copy, Link, ArrowUp, ArrowDown, Trash, Keyboard, Plus, GripVertical, Minus, Check, ExternalLink, Unlink, ChevronRightIcon, CircleIcon, ChevronDown, ListCollapse, Heading1, Heading2, Heading3, Baseline, AlignLeft, AlignJustify, AlignRight, AlignCenter, CheckIcon, Pencil, XIcon, Upload, Download, Repeat2, Palette, Droplet, Sticker, FileIcon, FileImage, FileMusic, FilePlay, FileArchive, Subscript, Superscript, Bold, Italic, Underline, Strikethrough, Type, List, ListOrdered, ListTodo, TextQuote, ListIndentIncrease, ListIndentDecrease, Undo2, Redo2 } from 'lucide-react';
@@ -6108,5 +6108,5 @@ function useAutosave({
6108
6108
  }
6109
6109
 
6110
6110
  export { BlockCanvas, Button, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuTrigger, FLOATING_TOOLBAR, FOCUS_RING, FilePickerButton, Input, MENU_ITEM, MenuIcon, Popover, PopoverAnchor, PopoverContent, QuoinProvider, SuggestionMenu, UploadField, blockFragment, bubblePart, cn, coreBlocks, dismissSuggestion, englishLabels, focusNode, formatShortcut, inlineDirection, insertBlockToWrite, insertBlocks, interceptKeys, keepFocus, linkAddress, linkedBlockId, noChange, preventDefault, rangeRect, replaceTrigger, resolveLabels, returnFocusToText, runOnBlocks, selectHandlers, selectNode, styleTargets, suggestionPlugin, toError, useAutosave, useFocusKey, useLabels, useNodeKeys, useOutsidePress, usePartAnchor, useQuoin, useRangeAnchor, useRovingFocus, virtualAnchor };
6111
- //# sourceMappingURL=chunk-JEFQNZO4.js.map
6112
- //# sourceMappingURL=chunk-JEFQNZO4.js.map
6111
+ //# sourceMappingURL=chunk-3BCP6ZUM.js.map
6112
+ //# sourceMappingURL=chunk-3BCP6ZUM.js.map