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
@@ -1,9 +1,9 @@
1
1
  'use strict';
2
2
 
3
- var chunkABVSP2XR_cjs = require('./chunk-ABVSP2XR.cjs');
4
- var chunkVSUGJZ7G_cjs = require('./chunk-VSUGJZ7G.cjs');
5
- var chunkM5FREXRQ_cjs = require('./chunk-M5FREXRQ.cjs');
6
- var chunk6H76FAI3_cjs = require('./chunk-6H76FAI3.cjs');
3
+ var chunk6X5A4DUQ_cjs = require('./chunk-6X5A4DUQ.cjs');
4
+ var chunkNNDLIP2C_cjs = require('./chunk-NNDLIP2C.cjs');
5
+ var chunk4F2IWBFM_cjs = require('./chunk-4F2IWBFM.cjs');
6
+ var chunkWZA5S5EJ_cjs = require('./chunk-WZA5S5EJ.cjs');
7
7
  var react = require('react');
8
8
  var jsxRuntime = require('react/jsx-runtime');
9
9
  var reactDom = require('react-dom');
@@ -12,8 +12,8 @@ var lucideReact = require('lucide-react');
12
12
  // src/engine/commands/table-shape.ts
13
13
  var CELL = /^cell:(\d+):(\d+)$/;
14
14
  var tableShape = (block) => ({
15
- rows: chunk6H76FAI3_cjs.countOf(block.attrs.rows),
16
- cols: chunk6H76FAI3_cjs.countOf(block.attrs.cols)
15
+ rows: chunkWZA5S5EJ_cjs.countOf(block.attrs.rows),
16
+ cols: chunkWZA5S5EJ_cjs.countOf(block.attrs.cols)
17
17
  });
18
18
  var ALIGNS = ["left", "center", "right"];
19
19
  var columnAligns = (block, cols) => Array.from({ length: cols }, (_, col) => {
@@ -27,7 +27,7 @@ function cellOf(region) {
27
27
  return match === null ? null : [Number(match[1]), Number(match[2])];
28
28
  }
29
29
  function tableBlock(doc, id) {
30
- const block = chunk6H76FAI3_cjs.blockById(doc, id);
30
+ const block = chunkWZA5S5EJ_cjs.blockById(doc, id);
31
31
  return block?.type === "TABLE" ? block : null;
32
32
  }
33
33
  var isIndex = (index, length) => Number.isInteger(index) && index >= 0 && index < length;
@@ -41,7 +41,7 @@ function rebuiltTable(block, plan) {
41
41
  for (let row = 0; row < plan.rows; row++) {
42
42
  for (let col = 0; col < plan.cols; col++) {
43
43
  const from = plan.source(row, col);
44
- regions[chunk6H76FAI3_cjs.cellKey(row, col)] = from === null ? [] : block.regions[chunk6H76FAI3_cjs.cellKey(...from)] ?? [];
44
+ regions[chunkWZA5S5EJ_cjs.cellKey(row, col)] = from === null ? [] : block.regions[chunkWZA5S5EJ_cjs.cellKey(...from)] ?? [];
45
45
  }
46
46
  }
47
47
  return { ...block, attrs: { ...block.attrs, ...plan.attrs, rows: plan.rows, cols: plan.cols }, regions };
@@ -50,17 +50,17 @@ function followedPos(pos, blockId, plan) {
50
50
  const cell = pos.block === blockId ? cellOf(pos.region) : null;
51
51
  if (cell === null) return pos;
52
52
  const moved = plan.target(cell);
53
- return moved === null ? { block: blockId, region: chunk6H76FAI3_cjs.cellKey(...plan.landing(cell)), offset: 0 } : { ...pos, region: chunk6H76FAI3_cjs.cellKey(...moved) };
53
+ return moved === null ? { block: blockId, region: chunkWZA5S5EJ_cjs.cellKey(...plan.landing(cell)), offset: 0 } : { ...pos, region: chunkWZA5S5EJ_cjs.cellKey(...moved) };
54
54
  }
55
55
  function followedSelection(selection, blockId, plan) {
56
56
  if (selection?.kind !== "text") return selection;
57
57
  const anchor = followedPos(selection.anchor, blockId, plan);
58
58
  const head = followedPos(selection.head, blockId, plan);
59
- return anchor === selection.anchor && head === selection.head ? selection : chunkM5FREXRQ_cjs.textSelection(anchor, head);
59
+ return anchor === selection.anchor && head === selection.head ? selection : chunk4F2IWBFM_cjs.textSelection(anchor, head);
60
60
  }
61
61
 
62
62
  // src/engine/state/cell-selection.ts
63
- var cellSelectionKey = chunkM5FREXRQ_cjs.createPluginKey("cellSelection");
63
+ var cellSelectionKey = chunk4F2IWBFM_cjs.createPluginKey("cellSelection");
64
64
  function rangeOfSelection({ doc, selection }) {
65
65
  if (selection?.kind !== "text") return null;
66
66
  const { anchor, head } = selection;
@@ -98,39 +98,39 @@ function selectCells(blockId, anchor, head) {
98
98
  const { rows, cols } = block === null ? { rows: 0, cols: 0 } : tableShape(block);
99
99
  const inside = ([row, col]) => isIndex(row, rows) && isIndex(col, cols);
100
100
  if (block === null || !inside(anchor) || !inside(head)) return false;
101
- const end2 = chunk6H76FAI3_cjs.cellKey(...head);
102
- const selection = chunkM5FREXRQ_cjs.textSelection(
103
- { block: blockId, region: chunk6H76FAI3_cjs.cellKey(...anchor), offset: 0 },
104
- { block: blockId, region: end2, offset: chunk6H76FAI3_cjs.inlineLength(block.regions[end2] ?? []) }
101
+ const end2 = chunkWZA5S5EJ_cjs.cellKey(...head);
102
+ const selection = chunk4F2IWBFM_cjs.textSelection(
103
+ { block: blockId, region: chunkWZA5S5EJ_cjs.cellKey(...anchor), offset: 0 },
104
+ { block: blockId, region: end2, offset: chunkWZA5S5EJ_cjs.inlineLength(block.regions[end2] ?? []) }
105
105
  );
106
- dispatch?.(new chunkM5FREXRQ_cjs.Transaction(state).setSelection(selection));
106
+ dispatch?.(new chunk4F2IWBFM_cjs.Transaction(state).setSelection(selection));
107
107
  return true;
108
108
  };
109
109
  }
110
110
 
111
111
  // src/engine/commands/cell-commands.ts
112
112
  function filledCells(doc, range) {
113
- const regions = chunk6H76FAI3_cjs.blockById(doc, range.block)?.regions ?? {};
113
+ const regions = chunkWZA5S5EJ_cjs.blockById(doc, range.block)?.regions ?? {};
114
114
  return cellsInRange(range).flatMap((cell) => {
115
- const region = chunk6H76FAI3_cjs.cellKey(...cell);
116
- const length = chunk6H76FAI3_cjs.inlineLength(regions[region] ?? []);
115
+ const region = chunkWZA5S5EJ_cjs.cellKey(...cell);
116
+ const length = chunkWZA5S5EJ_cjs.inlineLength(regions[region] ?? []);
117
117
  return length > 0 ? [{ region, length }] : [];
118
118
  });
119
119
  }
120
120
  function firstCell({ block, anchor, head }) {
121
- return { block, region: chunk6H76FAI3_cjs.cellKey(Math.min(anchor[0], head[0]), Math.min(anchor[1], head[1])), offset: 0 };
121
+ return { block, region: chunkWZA5S5EJ_cjs.cellKey(Math.min(anchor[0], head[0]), Math.min(anchor[1], head[1])), offset: 0 };
122
122
  }
123
123
  function emptied(state, range) {
124
- const tr = new chunkM5FREXRQ_cjs.Transaction(state);
124
+ const tr = new chunk4F2IWBFM_cjs.Transaction(state);
125
125
  for (const { region, length } of filledCells(state.doc, range)) {
126
- tr.step(chunkM5FREXRQ_cjs.replaceInlineStep(range.block, region, 0, length, []));
126
+ tr.step(chunk4F2IWBFM_cjs.replaceInlineStep(range.block, region, 0, length, []));
127
127
  }
128
128
  return tr;
129
129
  }
130
130
  var deleteCellContents = (state, dispatch) => {
131
131
  const range = cellSelection(state);
132
132
  if (range === null) return false;
133
- dispatch?.(emptied(state, range).setSelection(chunkM5FREXRQ_cjs.textSelection(firstCell(range))));
133
+ dispatch?.(emptied(state, range).setSelection(chunk4F2IWBFM_cjs.textSelection(firstCell(range))));
134
134
  return true;
135
135
  };
136
136
  function typeOverCells(text) {
@@ -138,7 +138,7 @@ function typeOverCells(text) {
138
138
  const range = cellSelection(state);
139
139
  if (range === null || text === "") return false;
140
140
  const tr = emptied(state, range);
141
- dispatch?.(tr.setSelection(chunkM5FREXRQ_cjs.textSelection(chunkM5FREXRQ_cjs.insertTextAt(tr, state.schema, firstCell(range), text))));
141
+ dispatch?.(tr.setSelection(chunk4F2IWBFM_cjs.textSelection(chunk4F2IWBFM_cjs.insertTextAt(tr, state.schema, firstCell(range), text))));
142
142
  return true;
143
143
  };
144
144
  }
@@ -146,14 +146,14 @@ function setCellsMark(type, attrs) {
146
146
  return (state, dispatch) => {
147
147
  const range = cellSelection(state);
148
148
  const cells = range === null ? [] : filledCells(state.doc, range);
149
- const regions = range === null ? void 0 : chunk6H76FAI3_cjs.blockById(state.doc, range.block)?.regions;
149
+ const regions = range === null ? void 0 : chunkWZA5S5EJ_cjs.blockById(state.doc, range.block)?.regions;
150
150
  if (range === null || regions === void 0 || cells.length === 0) return false;
151
- const carried = cells.every(({ region }) => chunkM5FREXRQ_cjs.markCoverage(regions[region], type, attrs).every);
152
- const mark = carried ? chunkM5FREXRQ_cjs.toggleMark(type, attrs) : chunkM5FREXRQ_cjs.setMark(type, attrs);
153
- const tr = new chunkM5FREXRQ_cjs.Transaction(state);
151
+ const carried = cells.every(({ region }) => chunk4F2IWBFM_cjs.markCoverage(regions[region], type, attrs).every);
152
+ const mark = carried ? chunk4F2IWBFM_cjs.toggleMark(type, attrs) : chunk4F2IWBFM_cjs.setMark(type, attrs);
153
+ const tr = new chunk4F2IWBFM_cjs.Transaction(state);
154
154
  for (const { region, length } of cells) {
155
155
  const start = { block: range.block, region, offset: 0 };
156
- const whole = chunkM5FREXRQ_cjs.textSelection(start, { ...start, offset: length });
156
+ const whole = chunk4F2IWBFM_cjs.textSelection(start, { ...start, offset: length });
157
157
  mark({ ...state, doc: tr.doc, selection: whole, storedMarks: null }, (cell) => {
158
158
  for (const step of cell.steps) tr.step(step);
159
159
  });
@@ -168,7 +168,7 @@ function setCellsMark(type, attrs) {
168
168
  var CONTROLS_SLOT = "data-quoin-table-controls";
169
169
  var controlsSlot = (controller, blockId) => controller.blockElement(blockId)?.querySelector(`[${CONTROLS_SLOT}]`) ?? null;
170
170
  var TableCell = react.memo(function TableCell2({ controller, blockId, row, col, header, align, label }) {
171
- const inRange = chunkVSUGJZ7G_cjs.useEditorState(
171
+ const inRange = chunkNNDLIP2C_cjs.useEditorState(
172
172
  controller,
173
173
  react.useCallback(
174
174
  (state) => {
@@ -187,7 +187,7 @@ var TableCell = react.memo(function TableCell2({ controller, blockId, row, col,
187
187
  "data-col": col,
188
188
  "data-in-range": inRange ? "" : void 0,
189
189
  style: align === null ? void 0 : { textAlign: align },
190
- children: /* @__PURE__ */ jsxRuntime.jsx(chunkVSUGJZ7G_cjs.EditableRegion, { block: blockId, region: chunk6H76FAI3_cjs.cellKey(row, col), label, className: "quoin-table-text" })
190
+ children: /* @__PURE__ */ jsxRuntime.jsx(chunkNNDLIP2C_cjs.EditableRegion, { block: blockId, region: chunkWZA5S5EJ_cjs.cellKey(row, col), label, className: "quoin-table-text" })
191
191
  }
192
192
  );
193
193
  });
@@ -230,7 +230,7 @@ function changeTable(blockId, change, plan) {
230
230
  const block = tableBlock(state.doc, blockId);
231
231
  const next = block && change(block);
232
232
  if (!next) return false;
233
- const tr = new chunkM5FREXRQ_cjs.Transaction(state).step(chunkM5FREXRQ_cjs.replaceBlockStep(next));
233
+ const tr = new chunk4F2IWBFM_cjs.Transaction(state).step(chunk4F2IWBFM_cjs.replaceBlockStep(next));
234
234
  dispatch?.(plan ? tr.setSelection(followedSelection(state.selection, blockId, plan)) : tr);
235
235
  return true;
236
236
  };
@@ -341,28 +341,28 @@ var setColumnWidth = (blockId, col, px, drawn) => changeTable(blockId, (block) =
341
341
  var isCount = (value) => Number.isInteger(value) && value > 0;
342
342
  function emptyCells({ rows, cols }) {
343
343
  const regions = {};
344
- for (let row = 0; row < rows; row++) for (let col = 0; col < cols; col++) regions[chunk6H76FAI3_cjs.cellKey(row, col)] = [];
344
+ for (let row = 0; row < rows; row++) for (let col = 0; col < cols; col++) regions[chunkWZA5S5EJ_cjs.cellKey(row, col)] = [];
345
345
  return regions;
346
346
  }
347
347
  function insertTable(rows, cols, options = {}) {
348
348
  return (state, dispatch) => {
349
349
  const { doc, schema } = state;
350
- const id = chunkM5FREXRQ_cjs.headBlockId(state.selection);
350
+ const id = chunk4F2IWBFM_cjs.headBlockId(state.selection);
351
351
  if (id === null || !isCount(rows) || !isCount(cols)) return false;
352
- const index = chunk6H76FAI3_cjs.requireBlockIndex(doc, id);
352
+ const index = chunkWZA5S5EJ_cjs.requireBlockIndex(doc, id);
353
353
  const current = doc.blocks[index];
354
- const fills = chunkM5FREXRQ_cjs.isParagraph(current) && chunkM5FREXRQ_cjs.regionLength(current, chunkM5FREXRQ_cjs.primaryRegion(schema, current) ?? "") === 0;
354
+ const fills = chunk4F2IWBFM_cjs.isParagraph(current) && chunk4F2IWBFM_cjs.regionLength(current, chunk4F2IWBFM_cjs.primaryRegion(schema, current) ?? "") === 0;
355
355
  const table = {
356
- id: fills ? current.id : (options.newId ?? chunk6H76FAI3_cjs.newId)(),
356
+ id: fills ? current.id : (options.newId ?? chunkWZA5S5EJ_cjs.newId)(),
357
357
  type: "TABLE",
358
358
  indent: current.indent,
359
359
  attrs: { header: true, align: Array.from({ length: cols }, () => null), rows, cols },
360
360
  regions: emptyCells({ rows, cols })
361
361
  };
362
- const tr = new chunkM5FREXRQ_cjs.Transaction(state).step(
363
- fills ? chunkM5FREXRQ_cjs.replaceBlockStep(table) : chunkM5FREXRQ_cjs.insertBlocksStep(chunkM5FREXRQ_cjs.descendantsEnd(doc, index), [table])
362
+ const tr = new chunk4F2IWBFM_cjs.Transaction(state).step(
363
+ fills ? chunk4F2IWBFM_cjs.replaceBlockStep(table) : chunk4F2IWBFM_cjs.insertBlocksStep(chunk4F2IWBFM_cjs.descendantsEnd(doc, index), [table])
364
364
  );
365
- dispatch?.(tr.setSelection(chunkM5FREXRQ_cjs.textSelection({ block: table.id, region: chunk6H76FAI3_cjs.cellKey(0, 0), offset: 0 })));
365
+ dispatch?.(tr.setSelection(chunk4F2IWBFM_cjs.textSelection({ block: table.id, region: chunkWZA5S5EJ_cjs.cellKey(0, 0), offset: 0 })));
366
366
  return true;
367
367
  };
368
368
  }
@@ -375,15 +375,15 @@ function headCell({ doc, selection }) {
375
375
  const cell = block && cellOf(head.region);
376
376
  return block && cell ? { block, cell, head, shape: tableShape(block) } : null;
377
377
  }
378
- var cellLength = (block, [row, col]) => chunk6H76FAI3_cjs.inlineLength(block.regions[chunk6H76FAI3_cjs.cellKey(row, col)] ?? []);
378
+ var cellLength = (block, [row, col]) => chunkWZA5S5EJ_cjs.inlineLength(block.regions[chunkWZA5S5EJ_cjs.cellKey(row, col)] ?? []);
379
379
  var cellPos = (block, cell, atEnd = false) => ({
380
380
  block: block.id,
381
- region: chunk6H76FAI3_cjs.cellKey(...cell),
381
+ region: chunkWZA5S5EJ_cjs.cellKey(...cell),
382
382
  offset: atEnd ? cellLength(block, cell) : 0
383
383
  });
384
- var moveTo = (state, pos) => new chunkM5FREXRQ_cjs.Transaction(state).setSelection(chunkM5FREXRQ_cjs.textSelection(pos));
384
+ var moveTo = (state, pos) => new chunk4F2IWBFM_cjs.Transaction(state).setSelection(chunk4F2IWBFM_cjs.textSelection(pos));
385
385
  var thenCaretIn = (command, blockId, at) => (state, dispatch) => {
386
- const caret = chunkM5FREXRQ_cjs.textSelection({ block: blockId, region: chunk6H76FAI3_cjs.cellKey(...at), offset: 0 });
386
+ const caret = chunk4F2IWBFM_cjs.textSelection({ block: blockId, region: chunkWZA5S5EJ_cjs.cellKey(...at), offset: 0 });
387
387
  return command(state, dispatch && ((tr) => dispatch(tr.setSelection(caret))));
388
388
  };
389
389
  var cellAtIndex = (index, { cols }) => [Math.floor(index / cols), index % cols];
@@ -416,11 +416,11 @@ var enterInCell = (state, dispatch) => {
416
416
  if (row === shape.rows - 1 && cellLength(block, cell) === 0) {
417
417
  return thenCaretIn(addRow(block.id, shape.rows), block.id, [shape.rows, col])(state, dispatch);
418
418
  }
419
- return chunkM5FREXRQ_cjs.insertHardBreak(state, dispatch);
419
+ return chunk4F2IWBFM_cjs.insertHardBreak(state, dispatch);
420
420
  };
421
421
  var stopAtCellEdge = (atEnd) => (state) => {
422
422
  const caret = headCell(state);
423
- if (caret === null || !chunkM5FREXRQ_cjs.isCollapsed(state.selection)) return false;
423
+ if (caret === null || !chunk4F2IWBFM_cjs.isCollapsed(state.selection)) return false;
424
424
  return caret.head.offset === (atEnd ? cellLength(caret.block, caret.cell) : 0);
425
425
  };
426
426
  var firstThatApplies = (...commands) => (state, dispatch) => commands.some((command) => command(state, dispatch));
@@ -453,7 +453,7 @@ function useCellPress(controller, blockId, table, editable) {
453
453
  if (!editable || element === null) return;
454
454
  const onPointerDown = (event) => {
455
455
  const cell = event.button === 0 && event.pointerType !== "touch" ? cellOf2(event.target) : null;
456
- const block = cell && chunk6H76FAI3_cjs.blockById(controller.editor.state.doc, blockId);
456
+ const block = cell && chunkWZA5S5EJ_cjs.blockById(controller.editor.state.doc, blockId);
457
457
  if (!cell || !block) return;
458
458
  event.preventDefault();
459
459
  event.stopPropagation();
@@ -464,7 +464,7 @@ function useCellPress(controller, blockId, table, editable) {
464
464
  }, [controller, blockId, table, editable]);
465
465
  }
466
466
  function useRevealCell(controller, blockId) {
467
- const region = chunkVSUGJZ7G_cjs.useEditorState(
467
+ const region = chunkNNDLIP2C_cjs.useEditorState(
468
468
  controller,
469
469
  react.useCallback(
470
470
  (state) => {
@@ -485,23 +485,23 @@ function useRevealCell(controller, blockId) {
485
485
  // src/extensions/table/vertical-cell-move.ts
486
486
  var VERTICAL = { ArrowUp: -1, ArrowDown: 1 };
487
487
  function caretAtGoal(controller, blockId, cell, direction) {
488
- const region = chunk6H76FAI3_cjs.cellKey(...cell);
488
+ const region = chunkWZA5S5EJ_cjs.cellKey(...cell);
489
489
  const host = controller.registry.get(blockId, region);
490
490
  const { goalX } = controller;
491
- const line = host && chunkVSUGJZ7G_cjs.lineEdgeRect(host, direction < 0);
491
+ const line = host && chunkNNDLIP2C_cjs.lineEdgeRect(host, direction < 0);
492
492
  if (!host || !line || goalX === null) return null;
493
493
  const box = host.getBoundingClientRect();
494
494
  const x = Math.min(Math.max(goalX, box.left), box.right - 1);
495
- const point = chunkVSUGJZ7G_cjs.caretFromPoint(host.ownerDocument, x, line.top + line.height / 2);
496
- const pos = point && chunkVSUGJZ7G_cjs.domToPos(controller.registry, point.node, point.offset);
495
+ const point = chunkNNDLIP2C_cjs.caretFromPoint(host.ownerDocument, x, line.top + line.height / 2);
496
+ const pos = point && chunkNNDLIP2C_cjs.domToPos(controller.registry, point.node, point.offset);
497
497
  return pos && pos.block === blockId && pos.region === region ? pos : null;
498
498
  }
499
499
  var plainArrow = (event) => event.altKey || event.ctrlKey || event.metaKey ? void 0 : VERTICAL[event.key];
500
500
  function caretOnEdgeLine(controller, head, direction) {
501
501
  const host = controller.registry.get(head.block, head.region);
502
- const point = chunkVSUGJZ7G_cjs.posToDom(controller.registry, head);
503
- if (!host || !point || !(direction < 0 ? chunkVSUGJZ7G_cjs.isOnFirstLine(host, point) : chunkVSUGJZ7G_cjs.isOnLastLine(host, point))) return null;
504
- return { left: chunkVSUGJZ7G_cjs.caretClientRect(point)?.left ?? null };
502
+ const point = chunkNNDLIP2C_cjs.posToDom(controller.registry, head);
503
+ if (!host || !point || !(direction < 0 ? chunkNNDLIP2C_cjs.isOnFirstLine(host, point) : chunkNNDLIP2C_cjs.isOnLastLine(host, point))) return null;
504
+ return { left: chunkNNDLIP2C_cjs.caretClientRect(point)?.left ?? null };
505
505
  }
506
506
  function columnAt(controller, blockId, row, x) {
507
507
  const cells = Array.from(controller.blockElement(blockId)?.querySelector("table")?.rows[row]?.cells ?? []);
@@ -514,7 +514,7 @@ function enterTable(controller, blockId, event) {
514
514
  const { selection } = state;
515
515
  const block = tableBlock(state.doc, blockId);
516
516
  if (direction === void 0 || event.shiftKey || block === null || selection?.kind !== "text") return false;
517
- if (!chunkM5FREXRQ_cjs.isCollapsed(selection) || chunkVSUGJZ7G_cjs.neighbourBlock(state.doc, selection.head.block, direction)?.id !== blockId) return false;
517
+ if (!chunk4F2IWBFM_cjs.isCollapsed(selection) || chunkNNDLIP2C_cjs.neighbourBlock(state.doc, selection.head.block, direction)?.id !== blockId) return false;
518
518
  const caret = caretOnEdgeLine(controller, selection.head, direction);
519
519
  if (caret === null) return false;
520
520
  controller.goalX ??= caret.left;
@@ -523,7 +523,7 @@ function enterTable(controller, blockId, event) {
523
523
  const { goalX } = controller;
524
524
  const cell = [row, goalX === null ? direction > 0 ? 0 : cols - 1 : columnAt(controller, blockId, row, goalX)];
525
525
  const pos = caretAtGoal(controller, blockId, cell, direction) ?? cellPos(block, cell, direction < 0);
526
- controller.dispatch(controller.editor.createTransaction().setSelection(chunkM5FREXRQ_cjs.textSelection(pos)));
526
+ controller.dispatch(controller.editor.createTransaction().setSelection(chunk4F2IWBFM_cjs.textSelection(pos)));
527
527
  return true;
528
528
  }
529
529
  function moveBetweenRows(controller, blockId, event) {
@@ -539,7 +539,7 @@ function moveBetweenRows(controller, blockId, event) {
539
539
  if (edge === null) return false;
540
540
  controller.goalX ??= edge.left;
541
541
  const pos = caretAtGoal(controller, blockId, target, direction) ?? cellPos(caret.block, target, direction < 0);
542
- const selection = event.shiftKey ? chunkM5FREXRQ_cjs.textSelection(state.selection.anchor, pos) : chunkM5FREXRQ_cjs.textSelection(pos);
542
+ const selection = event.shiftKey ? chunk4F2IWBFM_cjs.textSelection(state.selection.anchor, pos) : chunk4F2IWBFM_cjs.textSelection(pos);
543
543
  controller.dispatch(controller.editor.createTransaction().setSelection(selection));
544
544
  return true;
545
545
  }
@@ -554,17 +554,17 @@ function useTableKeys(controller, blockId, editable) {
554
554
  react.useEffect(() => {
555
555
  if (!editable) return;
556
556
  const intercept = (event) => {
557
- if (chunkVSUGJZ7G_cjs.isComposingKey(controller, event)) return false;
557
+ if (chunkNNDLIP2C_cjs.isComposingKey(controller, event)) return false;
558
558
  const handled = typeOver(controller, blockId, event) || moveBetweenRows(controller, blockId, event) || enterTable(controller, blockId, event);
559
559
  if (handled) event.preventDefault();
560
560
  return handled;
561
561
  };
562
- return chunkABVSP2XR_cjs.interceptKeys(controller, intercept);
562
+ return chunk6X5A4DUQ_cjs.interceptKeys(controller, intercept);
563
563
  }, [controller, blockId, editable]);
564
564
  }
565
565
  var indexes = (from, to) => Array.from({ length: Math.max(to - from, 0) }, (_, i) => from + i);
566
566
  function TableBlock({ block, controller, labels }) {
567
- const readOnly = chunkVSUGJZ7G_cjs.useReadOnly(controller);
567
+ const readOnly = chunkNNDLIP2C_cjs.useReadOnly(controller);
568
568
  const table = react.useRef(null);
569
569
  const { rows, cols } = tableShape(block);
570
570
  const header = block.attrs.header !== false && rows > 0;
@@ -588,7 +588,7 @@ function TableBlock({ block, controller, labels }) {
588
588
  col
589
589
  )) }, index);
590
590
  const scroller = readOnly ? { role: "region", "aria-label": labels.table, tabIndex: 0 } : void 0;
591
- return /* @__PURE__ */ jsxRuntime.jsx("div", { contentEditable: false, className: "quoin-table", "data-readonly": readOnly ? "" : void 0, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `quoin-table-scroll ${readOnly ? chunkABVSP2XR_cjs.FOCUS_RING : ""}`, ...scroller, children: [
591
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { contentEditable: false, className: "quoin-table", "data-readonly": readOnly ? "" : void 0, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `quoin-table-scroll ${readOnly ? chunk6X5A4DUQ_cjs.FOCUS_RING : ""}`, ...scroller, children: [
592
592
  /* @__PURE__ */ jsxRuntime.jsxs(
593
593
  "table",
594
594
  {
@@ -612,10 +612,10 @@ function lineCells(block, index, axis) {
612
612
  const { rows, cols } = tableShape(block);
613
613
  return Array.from(
614
614
  { length: axis === "row" ? cols : rows },
615
- (_, other) => axis === "row" ? block.regions[chunk6H76FAI3_cjs.cellKey(index, other)] ?? EMPTY : block.regions[chunk6H76FAI3_cjs.cellKey(other, index)] ?? EMPTY
615
+ (_, other) => axis === "row" ? block.regions[chunkWZA5S5EJ_cjs.cellKey(index, other)] ?? EMPTY : block.regions[chunkWZA5S5EJ_cjs.cellKey(other, index)] ?? EMPTY
616
616
  );
617
617
  }
618
- var sameLine = (before, after, index, axis) => chunk6H76FAI3_cjs.sameItems(lineCells(before, index, axis), lineCells(after, index, axis), chunk6H76FAI3_cjs.equalInline);
618
+ var sameLine = (before, after, index, axis) => chunkWZA5S5EJ_cjs.sameItems(lineCells(before, index, axis), lineCells(after, index, axis), chunkWZA5S5EJ_cjs.equalInline);
619
619
  function sameMenuCells(opened, current, target, axis) {
620
620
  const shape = tableShape(opened);
621
621
  const lines = axis === "row" ? shape.rows : shape.cols;
@@ -640,7 +640,7 @@ function ColumnResizer(props) {
640
640
  if (!controller.readOnly) controller.run(setColumnWidth(blockId, col, px, widths));
641
641
  };
642
642
  const onKeyDown = (event) => {
643
- if (chunkVSUGJZ7G_cjs.isComposingKey(controller, event.nativeEvent)) return;
643
+ if (chunkNNDLIP2C_cjs.isComposingKey(controller, event.nativeEvent)) return;
644
644
  const step = event.shiftKey ? LARGE_STEP : STEP;
645
645
  const tab = event.key === "Tab" && !event.altKey && !event.ctrlKey && !event.metaKey;
646
646
  if (event.key === "ArrowLeft" || event.key === "ArrowRight") {
@@ -695,7 +695,7 @@ function ColumnResizer(props) {
695
695
  "aria-valuetext": labels.columnWidth(width),
696
696
  className: "quoin-table-resizer",
697
697
  style,
698
- ...{ [chunkVSUGJZ7G_cjs.NATIVE_INTERACTION]: "" },
698
+ ...{ [chunkNNDLIP2C_cjs.NATIVE_INTERACTION]: "" },
699
699
  onKeyDown,
700
700
  onPointerDown,
701
701
  onPointerMove,
@@ -710,20 +710,20 @@ function HandleMenu({ controller, axis, label, style, items, open, onOpenChange,
710
710
  if (controller.run(item3.command)) controller.announce(item3.done);
711
711
  };
712
712
  const item2 = (entry) => /* @__PURE__ */ jsxRuntime.jsxs(
713
- chunkABVSP2XR_cjs.DropdownMenuItem,
713
+ chunk6X5A4DUQ_cjs.DropdownMenuItem,
714
714
  {
715
715
  disabled: entry.disabled,
716
716
  className: entry.destructive ? DESTRUCTIVE : void 0,
717
717
  onSelect: () => run(entry),
718
718
  children: [
719
- /* @__PURE__ */ jsxRuntime.jsx(chunkABVSP2XR_cjs.MenuIcon, { icon: entry.icon }),
719
+ /* @__PURE__ */ jsxRuntime.jsx(chunk6X5A4DUQ_cjs.MenuIcon, { icon: entry.icon }),
720
720
  entry.label
721
721
  ]
722
722
  },
723
723
  entry.id
724
724
  );
725
- return /* @__PURE__ */ jsxRuntime.jsxs(chunkABVSP2XR_cjs.DropdownMenu, { open, onOpenChange, children: [
726
- /* @__PURE__ */ jsxRuntime.jsx(chunkABVSP2XR_cjs.DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
725
+ return /* @__PURE__ */ jsxRuntime.jsxs(chunk6X5A4DUQ_cjs.DropdownMenu, { open, onOpenChange, children: [
726
+ /* @__PURE__ */ jsxRuntime.jsx(chunk6X5A4DUQ_cjs.DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
727
727
  "button",
728
728
  {
729
729
  ref: buttonRef,
@@ -737,18 +737,18 @@ function HandleMenu({ controller, axis, label, style, items, open, onOpenChange,
737
737
  }
738
738
  ) }),
739
739
  open && /* @__PURE__ */ jsxRuntime.jsxs(
740
- chunkABVSP2XR_cjs.DropdownMenuContent,
740
+ chunk6X5A4DUQ_cjs.DropdownMenuContent,
741
741
  {
742
742
  align: "start",
743
743
  "aria-label": label,
744
744
  "aria-labelledby": void 0,
745
- onCloseAutoFocus: chunkABVSP2XR_cjs.returnFocusToText(controller),
746
- ...chunkABVSP2XR_cjs.bubblePart(controller),
745
+ onCloseAutoFocus: chunk6X5A4DUQ_cjs.returnFocusToText(controller),
746
+ ...chunk6X5A4DUQ_cjs.bubblePart(controller),
747
747
  children: [
748
748
  items.filter((entry) => !entry.destructive).map(item2),
749
749
  children,
750
750
  items.filter((entry) => entry.destructive).map((entry) => /* @__PURE__ */ jsxRuntime.jsxs(react.Fragment, { children: [
751
- /* @__PURE__ */ jsxRuntime.jsx(chunkABVSP2XR_cjs.DropdownMenuSeparator, {}),
751
+ /* @__PURE__ */ jsxRuntime.jsx(chunk6X5A4DUQ_cjs.DropdownMenuSeparator, {}),
752
752
  item2(entry)
753
753
  ] }, entry.id))
754
754
  ]
@@ -807,7 +807,7 @@ function TableHandles(props) {
807
807
  const { rowEdge, colEdge } = target;
808
808
  const rowInsertAt = edgeOf(geometry.rows, rowEdge);
809
809
  const columnInsertAt = edgeOf(geometry.cols, colEdge);
810
- chunkVSUGJZ7G_cjs.useIsomorphicLayoutEffect(() => {
810
+ chunkNNDLIP2C_cjs.useIsomorphicLayoutEffect(() => {
811
811
  if (!focusRequested) return;
812
812
  (columnHandle.current ?? rowHandle.current)?.focus();
813
813
  onFocused();
@@ -818,7 +818,7 @@ function TableHandles(props) {
818
818
  const onKeyDown = (event) => {
819
819
  const handles = [rowHandle.current, columnHandle.current].filter((handle) => handle !== null);
820
820
  const index = handles.indexOf(event.target);
821
- if (index === -1 || chunkVSUGJZ7G_cjs.isComposingKey(controller, event.nativeEvent)) return;
821
+ if (index === -1 || chunkNNDLIP2C_cjs.isComposingKey(controller, event.nativeEvent)) return;
822
822
  if (event.key === "ArrowLeft" || event.key === "ArrowRight") handles[(index + 1) % handles.length].focus();
823
823
  else if (isTab(event) && !event.shiftKey && resizer.current !== null) resizer.current.focus();
824
824
  else if (isTab(event) || event.key === "Escape") controller.focus();
@@ -856,7 +856,7 @@ function TableHandles(props) {
856
856
  onOpenChange: opener("row"),
857
857
  buttonRef: rowHandle,
858
858
  children: row === 0 && /* @__PURE__ */ jsxRuntime.jsx(
859
- chunkABVSP2XR_cjs.DropdownMenuCheckboxItem,
859
+ chunk6X5A4DUQ_cjs.DropdownMenuCheckboxItem,
860
860
  {
861
861
  checked: block.attrs.header !== false,
862
862
  onCheckedChange: (on) => run(toggleHeaderRow(block.id), on ? labels.headerRowOn : labels.headerRowOff),
@@ -877,14 +877,14 @@ function TableHandles(props) {
877
877
  onOpenChange: opener("column"),
878
878
  buttonRef: columnHandle,
879
879
  children: [
880
- /* @__PURE__ */ jsxRuntime.jsx(chunkABVSP2XR_cjs.DropdownMenuSeparator, {}),
881
- /* @__PURE__ */ jsxRuntime.jsx(chunkABVSP2XR_cjs.DropdownMenuRadioGroup, { value: align ?? "", children: alignItems(labels).map(({ value, label, icon, done }) => /* @__PURE__ */ jsxRuntime.jsxs(
882
- chunkABVSP2XR_cjs.DropdownMenuRadioItem,
880
+ /* @__PURE__ */ jsxRuntime.jsx(chunk6X5A4DUQ_cjs.DropdownMenuSeparator, {}),
881
+ /* @__PURE__ */ jsxRuntime.jsx(chunk6X5A4DUQ_cjs.DropdownMenuRadioGroup, { value: align ?? "", children: alignItems(labels).map(({ value, label, icon, done }) => /* @__PURE__ */ jsxRuntime.jsxs(
882
+ chunk6X5A4DUQ_cjs.DropdownMenuRadioItem,
883
883
  {
884
884
  value,
885
885
  onSelect: () => align === value ? run(setColumnAlign(block.id, col, null), labels.alignmentCleared) : run(setColumnAlign(block.id, col, value), done),
886
886
  children: [
887
- /* @__PURE__ */ jsxRuntime.jsx(chunkABVSP2XR_cjs.MenuIcon, { icon }),
887
+ /* @__PURE__ */ jsxRuntime.jsx(chunk6X5A4DUQ_cjs.MenuIcon, { icon }),
888
888
  label
889
889
  ]
890
890
  },
@@ -903,8 +903,8 @@ function TableHandles(props) {
903
903
  "data-axis": "row",
904
904
  className: "quoin-table-insert",
905
905
  style: place(geometry.left - BESIDE, rowInsertAt),
906
- onPointerDown: chunkABVSP2XR_cjs.keepFocus,
907
- onMouseDown: chunkABVSP2XR_cjs.keepFocus,
906
+ onPointerDown: chunk6X5A4DUQ_cjs.keepFocus,
907
+ onMouseDown: chunk6X5A4DUQ_cjs.keepFocus,
908
908
  onClick: () => run(addRow(block.id, rowEdge), labels.rowInserted),
909
909
  children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Plus, { "aria-hidden": "true" })
910
910
  }
@@ -918,8 +918,8 @@ function TableHandles(props) {
918
918
  "data-axis": "column",
919
919
  className: "quoin-table-insert",
920
920
  style: place(columnInsertAt, geometry.top),
921
- onPointerDown: chunkABVSP2XR_cjs.keepFocus,
922
- onMouseDown: chunkABVSP2XR_cjs.keepFocus,
921
+ onPointerDown: chunk6X5A4DUQ_cjs.keepFocus,
922
+ onMouseDown: chunk6X5A4DUQ_cjs.keepFocus,
923
923
  onClick: () => run(addColumn(block.id, colEdge), labels.columnInserted),
924
924
  children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Plus, { "aria-hidden": "true" })
925
925
  }
@@ -962,7 +962,7 @@ function edgeNear(spans, at, reach) {
962
962
  // src/extensions/table/use-table-geometry.ts
963
963
  function useTableGeometry(controller, blockId, slot) {
964
964
  const [geometry, setGeometry] = react.useState(null);
965
- chunkVSUGJZ7G_cjs.useIsomorphicLayoutEffect(() => {
965
+ chunkNNDLIP2C_cjs.useIsomorphicLayoutEffect(() => {
966
966
  const table = controller.blockElement(blockId)?.querySelector("table");
967
967
  const view = slot.ownerDocument.defaultView;
968
968
  if (!table || !view) return;
@@ -996,7 +996,7 @@ function useCutCells(controller) {
996
996
  const onCut = (event) => {
997
997
  if (controller.readOnly || cellSelection(controller.editor.state) === null) return;
998
998
  event.stopPropagation();
999
- chunkVSUGJZ7G_cjs.handleCopy(controller, event, false);
999
+ chunkNNDLIP2C_cjs.handleCopy(controller, event, false);
1000
1000
  controller.run(deleteCellContents);
1001
1001
  };
1002
1002
  root.addEventListener("cut", onCut, true);
@@ -1040,9 +1040,9 @@ function focusOf(root) {
1040
1040
  function useTableTarget(controller, held) {
1041
1041
  const [hovered, setHovered] = react.useState(null);
1042
1042
  const [focus, setFocus] = react.useState("none");
1043
- const caret = chunkVSUGJZ7G_cjs.useEditorState(controller, caretTarget, sameTarget);
1043
+ const caret = chunkNNDLIP2C_cjs.useEditorState(controller, caretTarget, sameTarget);
1044
1044
  const hoveredBlock = hovered?.target.block ?? null;
1045
- const shape = chunkVSUGJZ7G_cjs.useEditorState(
1045
+ const shape = chunkNNDLIP2C_cjs.useEditorState(
1046
1046
  controller,
1047
1047
  react.useCallback((state) => hoveredBlock === null ? null : shapeOf(state, hoveredBlock), [hoveredBlock])
1048
1048
  );
@@ -1081,16 +1081,16 @@ function useTableTarget(controller, held) {
1081
1081
  return pointed ?? (focus === "editor" ? caret : null);
1082
1082
  }
1083
1083
  var isFocusKey = (event) => event.key === "F10" && event.altKey && !event.ctrlKey && !event.metaKey && !event.shiftKey;
1084
- var takesFocusKey = (state) => chunkM5FREXRQ_cjs.isCollapsed(state.selection) || cellSelection(state) !== null;
1084
+ var takesFocusKey = (state) => chunk4F2IWBFM_cjs.isCollapsed(state.selection) || cellSelection(state) !== null;
1085
1085
  function TableControls({ controller, labels }) {
1086
- const readOnly = chunkVSUGJZ7G_cjs.useReadOnly(controller);
1086
+ const readOnly = chunkNNDLIP2C_cjs.useReadOnly(controller);
1087
1087
  const [held, setHeld] = react.useState(null);
1088
1088
  const [focusFor, setFocusFor] = react.useState(null);
1089
1089
  const [slot, setSlot] = react.useState(null);
1090
1090
  const target = useTableTarget(controller, held?.target ?? null);
1091
1091
  useCutCells(controller);
1092
1092
  const blockId = target?.block ?? null;
1093
- const block = chunkVSUGJZ7G_cjs.useEditorState(
1093
+ const block = chunkNNDLIP2C_cjs.useEditorState(
1094
1094
  controller,
1095
1095
  react.useCallback((state) => blockId === null ? null : tableBlock(state.doc, blockId), [blockId])
1096
1096
  );
@@ -1107,13 +1107,13 @@ function TableControls({ controller, labels }) {
1107
1107
  const intercept = (event) => {
1108
1108
  const { state } = controller.editor;
1109
1109
  const caret = caretTarget(state);
1110
- if (!isFocusKey(event) || chunkVSUGJZ7G_cjs.isComposingKey(controller, event) || caret === null || !takesFocusKey(state)) return false;
1110
+ if (!isFocusKey(event) || chunkNNDLIP2C_cjs.isComposingKey(controller, event) || caret === null || !takesFocusKey(state)) return false;
1111
1111
  event.preventDefault();
1112
1112
  setHeld({ target: caret, menu: null });
1113
1113
  setFocusFor(caret.block);
1114
1114
  return true;
1115
1115
  };
1116
- return chunkABVSP2XR_cjs.interceptKeys(controller, intercept);
1116
+ return chunk6X5A4DUQ_cjs.interceptKeys(controller, intercept);
1117
1117
  }, [controller, readOnly]);
1118
1118
  const onMenu = react.useCallback(
1119
1119
  (menu) => setHeld(menu === null || target === null || block === null ? null : { target, menu, opened: block }),
@@ -1124,7 +1124,7 @@ function TableControls({ controller, labels }) {
1124
1124
  setFocusFor(null);
1125
1125
  setHeld((current) => current?.menu === null ? null : current);
1126
1126
  }, []);
1127
- chunkVSUGJZ7G_cjs.useIsomorphicLayoutEffect(() => {
1127
+ chunkNNDLIP2C_cjs.useIsomorphicLayoutEffect(() => {
1128
1128
  const drawn = block === null || readOnly ? null : controlsSlot(controller, block.id);
1129
1129
  setSlot((current) => current === drawn ? current : drawn);
1130
1130
  });
@@ -1222,7 +1222,7 @@ function tableExtension(options = {}) {
1222
1222
  blockNames: { TABLE: labels.table },
1223
1223
  overlays: [TableOverlay]
1224
1224
  };
1225
- return chunkM5FREXRQ_cjs.defineExtension({
1225
+ return chunk4F2IWBFM_cjs.defineExtension({
1226
1226
  name: "table",
1227
1227
  priority: ABOVE_CORE_KEYS,
1228
1228
  plugins: [cellSelectionPlugin],
@@ -1251,5 +1251,5 @@ exports.setColumnAlign = setColumnAlign;
1251
1251
  exports.setColumnWidth = setColumnWidth;
1252
1252
  exports.tableExtension = tableExtension;
1253
1253
  exports.toggleHeaderRow = toggleHeaderRow;
1254
- //# sourceMappingURL=chunk-XJ32XESJ.cjs.map
1255
- //# sourceMappingURL=chunk-XJ32XESJ.cjs.map
1254
+ //# sourceMappingURL=chunk-TN32PKUI.cjs.map
1255
+ //# sourceMappingURL=chunk-TN32PKUI.cjs.map