quoin-editor 1.0.1 → 1.0.2

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 (132) hide show
  1. package/CHANGELOG.md +12 -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-BTBHHBVR.cjs → chunk-4SLJNZSM.cjs} +11 -7
  7. package/dist/chunk-4SLJNZSM.cjs.map +1 -0
  8. package/dist/{chunk-62WKUAQY.js → chunk-4XFXB37X.js} +7 -3
  9. package/dist/chunk-4XFXB37X.js.map +1 -0
  10. package/dist/{chunk-56C7GCKO.cjs → chunk-5MAYUGTE.cjs} +97 -97
  11. package/dist/{chunk-56C7GCKO.cjs.map → chunk-5MAYUGTE.cjs.map} +1 -1
  12. package/dist/{chunk-QXG3HWDS.js → chunk-623AOJM2.js} +4 -4
  13. package/dist/{chunk-6YSGUAVW.js → chunk-6NULZPVC.js} +6 -8
  14. package/dist/chunk-6NULZPVC.js.map +1 -0
  15. package/dist/{chunk-XX5FTPJR.cjs → chunk-6V6GGBDK.cjs} +10 -10
  16. package/dist/{chunk-XX5FTPJR.cjs.map → chunk-6V6GGBDK.cjs.map} +1 -1
  17. package/dist/{chunk-CLTHD5GO.cjs → chunk-73653CJ4.cjs} +3 -3
  18. package/dist/{chunk-CLTHD5GO.cjs.map → chunk-73653CJ4.cjs.map} +1 -1
  19. package/dist/{chunk-UBNG5YCG.js → chunk-ADSJ42DO.js} +6 -6
  20. package/dist/{chunk-PX6LZMH4.cjs → chunk-AUOEM3SF.cjs} +44 -44
  21. package/dist/{chunk-PX6LZMH4.cjs.map → chunk-AUOEM3SF.cjs.map} +1 -1
  22. package/dist/{chunk-ESMAW4NK.cjs → chunk-BQANU5BH.cjs} +12 -12
  23. package/dist/{chunk-ESMAW4NK.cjs.map → chunk-BQANU5BH.cjs.map} +1 -1
  24. package/dist/{chunk-UCXLRRWY.js → chunk-C23RQVRK.js} +5 -5
  25. package/dist/{chunk-5R3ISX4A.cjs → chunk-CW3AFJBR.cjs} +288 -295
  26. package/dist/chunk-CW3AFJBR.cjs.map +1 -0
  27. package/dist/{chunk-26Q4LSIU.js → chunk-DUE3HCZD.js} +2 -2
  28. package/dist/{chunk-SSIRYUCK.js → chunk-EPARJI4V.js} +6 -5
  29. package/dist/chunk-EPARJI4V.js.map +1 -0
  30. package/dist/{chunk-V3KLMSRO.cjs → chunk-FDRUAL3Z.cjs} +30 -30
  31. package/dist/{chunk-V3KLMSRO.cjs.map → chunk-FDRUAL3Z.cjs.map} +1 -1
  32. package/dist/{chunk-A4IJSJKL.js → chunk-IQBMAE3F.js} +5 -5
  33. package/dist/{chunk-PIWRSX7U.js → chunk-JHQUHFLX.js} +7 -7
  34. package/dist/{chunk-6PKVJZQV.cjs → chunk-KUYZMSMF.cjs} +8 -8
  35. package/dist/{chunk-6PKVJZQV.cjs.map → chunk-KUYZMSMF.cjs.map} +1 -1
  36. package/dist/{chunk-UDAVVEFC.cjs → chunk-LLTEGXWZ.cjs} +54 -54
  37. package/dist/{chunk-UDAVVEFC.cjs.map → chunk-LLTEGXWZ.cjs.map} +1 -1
  38. package/dist/{chunk-RQW3P3GH.js → chunk-N4FGA3H4.js} +5 -5
  39. package/dist/{chunk-LV6EYPJO.js → chunk-NEZJ7ZP5.js} +2 -2
  40. package/dist/{chunk-UPSLDTLT.js → chunk-OBMBSU2S.js} +3 -3
  41. package/dist/{chunk-WMN6566P.js → chunk-OSHZQR3W.js} +5 -5
  42. package/dist/{chunk-5M4QG3ZC.cjs → chunk-P6KYXFZC.cjs} +116 -115
  43. package/dist/chunk-P6KYXFZC.cjs.map +1 -0
  44. package/dist/{chunk-75C6PX2L.cjs → chunk-R2BLBV43.cjs} +23 -23
  45. package/dist/{chunk-75C6PX2L.cjs.map → chunk-R2BLBV43.cjs.map} +1 -1
  46. package/dist/{chunk-6LMS5J3Y.js → chunk-RJRX34BZ.js} +2 -2
  47. package/dist/{chunk-LE3F7WIP.js → chunk-T43RZTUT.js} +148 -155
  48. package/dist/chunk-T43RZTUT.js.map +1 -0
  49. package/dist/{chunk-MLRAVUFG.cjs → chunk-TLGX43P6.cjs} +17 -19
  50. package/dist/chunk-TLGX43P6.cjs.map +1 -0
  51. package/dist/{chunk-LMAEPFTX.js → chunk-U3LOLYAU.js} +2 -2
  52. package/dist/{chunk-JJ3RASQS.cjs → chunk-UEKXVCKC.cjs} +101 -91
  53. package/dist/chunk-UEKXVCKC.cjs.map +1 -0
  54. package/dist/{chunk-GPIDU3GN.js → chunk-VCLL5C7J.js} +5 -5
  55. package/dist/{chunk-PGSS4IOS.js → chunk-VRS6WCEK.js} +19 -9
  56. package/dist/chunk-VRS6WCEK.js.map +1 -0
  57. package/dist/{chunk-VACTAZWS.cjs → chunk-WEYDDIBQ.cjs} +14 -14
  58. package/dist/{chunk-VACTAZWS.cjs.map → chunk-WEYDDIBQ.cjs.map} +1 -1
  59. package/dist/{chunk-F5V3IEEE.cjs → chunk-X4HDKFW5.cjs} +27 -27
  60. package/dist/{chunk-F5V3IEEE.cjs.map → chunk-X4HDKFW5.cjs.map} +1 -1
  61. package/dist/{chunk-EYFCOV3T.cjs → chunk-X4P4TQXH.cjs} +5 -5
  62. package/dist/{chunk-EYFCOV3T.cjs.map → chunk-X4P4TQXH.cjs.map} +1 -1
  63. package/dist/{chunk-UWNZG2SD.cjs → chunk-XA3UEJIW.cjs} +3 -3
  64. package/dist/{chunk-UWNZG2SD.cjs.map → chunk-XA3UEJIW.cjs.map} +1 -1
  65. package/dist/{chunk-OCCKQHCY.js → chunk-YBMUEEM5.js} +2 -2
  66. package/dist/{chunk-HOIDJEVI.cjs → chunk-ZKVOS57Q.cjs} +217 -217
  67. package/dist/{chunk-HOIDJEVI.cjs.map → chunk-ZKVOS57Q.cjs.map} +1 -1
  68. package/dist/comments.cjs +58 -58
  69. package/dist/comments.js +7 -7
  70. package/dist/diff.cjs +28 -27
  71. package/dist/diff.cjs.map +1 -1
  72. package/dist/diff.js +5 -4
  73. package/dist/diff.js.map +1 -1
  74. package/dist/docx.cjs +30 -30
  75. package/dist/docx.js +3 -3
  76. package/dist/embed.cjs +8 -8
  77. package/dist/embed.js +7 -7
  78. package/dist/emoji.cjs +7 -7
  79. package/dist/emoji.js +6 -6
  80. package/dist/engine.cjs +4 -4
  81. package/dist/engine.js +3 -3
  82. package/dist/find.cjs +7 -7
  83. package/dist/find.js +6 -6
  84. package/dist/headless.cjs +5 -5
  85. package/dist/headless.js +4 -4
  86. package/dist/index.cjs +6 -6
  87. package/dist/index.js +5 -5
  88. package/dist/math.cjs +9 -9
  89. package/dist/math.js +8 -8
  90. package/dist/mention.cjs +9 -9
  91. package/dist/mention.js +8 -8
  92. package/dist/presence.cjs +39 -42
  93. package/dist/presence.cjs.map +1 -1
  94. package/dist/presence.js +9 -12
  95. package/dist/presence.js.map +1 -1
  96. package/dist/stats.cjs +8 -8
  97. package/dist/stats.js +7 -7
  98. package/dist/table.cjs +7 -7
  99. package/dist/table.js +6 -6
  100. package/dist/toc.cjs +7 -7
  101. package/dist/toc.js +6 -6
  102. package/dist/view.cjs +4 -4
  103. package/dist/view.js +2 -2
  104. package/dist/yjs.cjs +223 -171
  105. package/dist/yjs.cjs.map +1 -1
  106. package/dist/yjs.js +104 -52
  107. package/dist/yjs.js.map +1 -1
  108. package/package.json +1 -1
  109. package/dist/chunk-5M4QG3ZC.cjs.map +0 -1
  110. package/dist/chunk-5R3ISX4A.cjs.map +0 -1
  111. package/dist/chunk-62WKUAQY.js.map +0 -1
  112. package/dist/chunk-6YSGUAVW.js.map +0 -1
  113. package/dist/chunk-BTBHHBVR.cjs.map +0 -1
  114. package/dist/chunk-JJ3RASQS.cjs.map +0 -1
  115. package/dist/chunk-LE3F7WIP.js.map +0 -1
  116. package/dist/chunk-MLRAVUFG.cjs.map +0 -1
  117. package/dist/chunk-PGSS4IOS.js.map +0 -1
  118. package/dist/chunk-SSIRYUCK.js.map +0 -1
  119. /package/dist/{chunk-QXG3HWDS.js.map → chunk-623AOJM2.js.map} +0 -0
  120. /package/dist/{chunk-UBNG5YCG.js.map → chunk-ADSJ42DO.js.map} +0 -0
  121. /package/dist/{chunk-UCXLRRWY.js.map → chunk-C23RQVRK.js.map} +0 -0
  122. /package/dist/{chunk-26Q4LSIU.js.map → chunk-DUE3HCZD.js.map} +0 -0
  123. /package/dist/{chunk-A4IJSJKL.js.map → chunk-IQBMAE3F.js.map} +0 -0
  124. /package/dist/{chunk-PIWRSX7U.js.map → chunk-JHQUHFLX.js.map} +0 -0
  125. /package/dist/{chunk-RQW3P3GH.js.map → chunk-N4FGA3H4.js.map} +0 -0
  126. /package/dist/{chunk-LV6EYPJO.js.map → chunk-NEZJ7ZP5.js.map} +0 -0
  127. /package/dist/{chunk-UPSLDTLT.js.map → chunk-OBMBSU2S.js.map} +0 -0
  128. /package/dist/{chunk-WMN6566P.js.map → chunk-OSHZQR3W.js.map} +0 -0
  129. /package/dist/{chunk-6LMS5J3Y.js.map → chunk-RJRX34BZ.js.map} +0 -0
  130. /package/dist/{chunk-LMAEPFTX.js.map → chunk-U3LOLYAU.js.map} +0 -0
  131. /package/dist/{chunk-GPIDU3GN.js.map → chunk-VCLL5C7J.js.map} +0 -0
  132. /package/dist/{chunk-OCCKQHCY.js.map → chunk-YBMUEEM5.js.map} +0 -0
@@ -13,7 +13,7 @@
13
13
 
14
14
 
15
15
 
16
- var _chunk5R3ISX4Acjs = require('./chunk-5R3ISX4A.cjs');
16
+ var _chunkCW3AFJBRcjs = require('./chunk-CW3AFJBR.cjs');
17
17
 
18
18
 
19
19
 
@@ -30,7 +30,7 @@ var _chunk5R3ISX4Acjs = require('./chunk-5R3ISX4A.cjs');
30
30
 
31
31
 
32
32
 
33
- var _chunk5M4QG3ZCcjs = require('./chunk-5M4QG3ZC.cjs');
33
+ var _chunkP6KYXFZCcjs = require('./chunk-P6KYXFZC.cjs');
34
34
 
35
35
 
36
36
 
@@ -50,7 +50,7 @@ var _chunk5M4QG3ZCcjs = require('./chunk-5M4QG3ZC.cjs');
50
50
 
51
51
 
52
52
 
53
- var _chunkHOIDJEVIcjs = require('./chunk-HOIDJEVI.cjs');
53
+ var _chunkZKVOS57Qcjs = require('./chunk-ZKVOS57Q.cjs');
54
54
 
55
55
 
56
56
 
@@ -60,13 +60,13 @@ var _chunkHOIDJEVIcjs = require('./chunk-HOIDJEVI.cjs');
60
60
 
61
61
 
62
62
 
63
- var _chunkBTBHHBVRcjs = require('./chunk-BTBHHBVR.cjs');
63
+ var _chunk4SLJNZSMcjs = require('./chunk-4SLJNZSM.cjs');
64
64
 
65
65
  // src/engine/commands/table-shape.ts
66
66
  var CELL = /^cell:(\d+):(\d+)$/;
67
67
  var tableShape = (block) => ({
68
- rows: _chunkBTBHHBVRcjs.countOf.call(void 0, block.attrs.rows),
69
- cols: _chunkBTBHHBVRcjs.countOf.call(void 0, block.attrs.cols)
68
+ rows: _chunk4SLJNZSMcjs.countOf.call(void 0, block.attrs.rows),
69
+ cols: _chunk4SLJNZSMcjs.countOf.call(void 0, block.attrs.cols)
70
70
  });
71
71
  var ALIGNS = ["left", "center", "right"];
72
72
  var columnAligns = (block, cols) => Array.from({ length: cols }, (_, col) => {
@@ -80,7 +80,7 @@ function cellOf(region) {
80
80
  return match === null ? null : [Number(match[1]), Number(match[2])];
81
81
  }
82
82
  function tableBlock(doc, id) {
83
- const block = _chunkBTBHHBVRcjs.blockById.call(void 0, doc, id);
83
+ const block = _chunk4SLJNZSMcjs.blockById.call(void 0, doc, id);
84
84
  return _optionalChain([block, 'optionalAccess', _2 => _2.type]) === "TABLE" ? block : null;
85
85
  }
86
86
  var isIndex = (index, length) => Number.isInteger(index) && index >= 0 && index < length;
@@ -94,7 +94,7 @@ function rebuiltTable(block, plan) {
94
94
  for (let row = 0; row < plan.rows; row++) {
95
95
  for (let col = 0; col < plan.cols; col++) {
96
96
  const from = plan.source(row, col);
97
- regions[_chunkBTBHHBVRcjs.cellKey.call(void 0, row, col)] = from === null ? [] : _nullishCoalesce(block.regions[_chunkBTBHHBVRcjs.cellKey.call(void 0, ...from)], () => ( []));
97
+ regions[_chunk4SLJNZSMcjs.cellKey.call(void 0, row, col)] = from === null ? [] : _nullishCoalesce(block.regions[_chunk4SLJNZSMcjs.cellKey.call(void 0, ...from)], () => ( []));
98
98
  }
99
99
  }
100
100
  return { ...block, attrs: { ...block.attrs, ...plan.attrs, rows: plan.rows, cols: plan.cols }, regions };
@@ -103,17 +103,17 @@ function followedPos(pos, blockId, plan) {
103
103
  const cell = pos.block === blockId ? cellOf(pos.region) : null;
104
104
  if (cell === null) return pos;
105
105
  const moved = plan.target(cell);
106
- return moved === null ? { block: blockId, region: _chunkBTBHHBVRcjs.cellKey.call(void 0, ...plan.landing(cell)), offset: 0 } : { ...pos, region: _chunkBTBHHBVRcjs.cellKey.call(void 0, ...moved) };
106
+ return moved === null ? { block: blockId, region: _chunk4SLJNZSMcjs.cellKey.call(void 0, ...plan.landing(cell)), offset: 0 } : { ...pos, region: _chunk4SLJNZSMcjs.cellKey.call(void 0, ...moved) };
107
107
  }
108
108
  function followedSelection(selection, blockId, plan) {
109
109
  if (_optionalChain([selection, 'optionalAccess', _3 => _3.kind]) !== "text") return selection;
110
110
  const anchor = followedPos(selection.anchor, blockId, plan);
111
111
  const head = followedPos(selection.head, blockId, plan);
112
- return anchor === selection.anchor && head === selection.head ? selection : _chunkHOIDJEVIcjs.textSelection.call(void 0, anchor, head);
112
+ return anchor === selection.anchor && head === selection.head ? selection : _chunkZKVOS57Qcjs.textSelection.call(void 0, anchor, head);
113
113
  }
114
114
 
115
115
  // src/engine/state/cell-selection.ts
116
- var cellSelectionKey = _chunkHOIDJEVIcjs.createPluginKey.call(void 0, "cellSelection");
116
+ var cellSelectionKey = _chunkZKVOS57Qcjs.createPluginKey.call(void 0, "cellSelection");
117
117
  function rangeOfSelection({ doc, selection }) {
118
118
  if (_optionalChain([selection, 'optionalAccess', _4 => _4.kind]) !== "text") return null;
119
119
  const { anchor, head } = selection;
@@ -151,39 +151,39 @@ function selectCells(blockId, anchor, head) {
151
151
  const { rows, cols } = block === null ? { rows: 0, cols: 0 } : tableShape(block);
152
152
  const inside = ([row, col]) => isIndex(row, rows) && isIndex(col, cols);
153
153
  if (block === null || !inside(anchor) || !inside(head)) return false;
154
- const end2 = _chunkBTBHHBVRcjs.cellKey.call(void 0, ...head);
155
- const selection = _chunkHOIDJEVIcjs.textSelection.call(void 0,
156
- { block: blockId, region: _chunkBTBHHBVRcjs.cellKey.call(void 0, ...anchor), offset: 0 },
157
- { block: blockId, region: end2, offset: _chunkBTBHHBVRcjs.inlineLength.call(void 0, _nullishCoalesce(block.regions[end2], () => ( []))) }
154
+ const end2 = _chunk4SLJNZSMcjs.cellKey.call(void 0, ...head);
155
+ const selection = _chunkZKVOS57Qcjs.textSelection.call(void 0,
156
+ { block: blockId, region: _chunk4SLJNZSMcjs.cellKey.call(void 0, ...anchor), offset: 0 },
157
+ { block: blockId, region: end2, offset: _chunk4SLJNZSMcjs.inlineLength.call(void 0, _nullishCoalesce(block.regions[end2], () => ( []))) }
158
158
  );
159
- _optionalChain([dispatch, 'optionalCall', _5 => _5(new (0, _chunkHOIDJEVIcjs.Transaction)(state).setSelection(selection))]);
159
+ _optionalChain([dispatch, 'optionalCall', _5 => _5(new (0, _chunkZKVOS57Qcjs.Transaction)(state).setSelection(selection))]);
160
160
  return true;
161
161
  };
162
162
  }
163
163
 
164
164
  // src/engine/commands/cell-commands.ts
165
165
  function filledCells(doc, range) {
166
- const regions = _nullishCoalesce(_optionalChain([_chunkBTBHHBVRcjs.blockById.call(void 0, doc, range.block), 'optionalAccess', _6 => _6.regions]), () => ( {}));
166
+ const regions = _nullishCoalesce(_optionalChain([_chunk4SLJNZSMcjs.blockById.call(void 0, doc, range.block), 'optionalAccess', _6 => _6.regions]), () => ( {}));
167
167
  return cellsInRange(range).flatMap((cell) => {
168
- const region = _chunkBTBHHBVRcjs.cellKey.call(void 0, ...cell);
169
- const length = _chunkBTBHHBVRcjs.inlineLength.call(void 0, _nullishCoalesce(regions[region], () => ( [])));
168
+ const region = _chunk4SLJNZSMcjs.cellKey.call(void 0, ...cell);
169
+ const length = _chunk4SLJNZSMcjs.inlineLength.call(void 0, _nullishCoalesce(regions[region], () => ( [])));
170
170
  return length > 0 ? [{ region, length }] : [];
171
171
  });
172
172
  }
173
173
  function firstCell({ block, anchor, head }) {
174
- return { block, region: _chunkBTBHHBVRcjs.cellKey.call(void 0, Math.min(anchor[0], head[0]), Math.min(anchor[1], head[1])), offset: 0 };
174
+ return { block, region: _chunk4SLJNZSMcjs.cellKey.call(void 0, Math.min(anchor[0], head[0]), Math.min(anchor[1], head[1])), offset: 0 };
175
175
  }
176
176
  function emptied(state, range) {
177
- const tr = new (0, _chunkHOIDJEVIcjs.Transaction)(state);
177
+ const tr = new (0, _chunkZKVOS57Qcjs.Transaction)(state);
178
178
  for (const { region, length } of filledCells(state.doc, range)) {
179
- tr.step(_chunkHOIDJEVIcjs.replaceInlineStep.call(void 0, range.block, region, 0, length, []));
179
+ tr.step(_chunkZKVOS57Qcjs.replaceInlineStep.call(void 0, range.block, region, 0, length, []));
180
180
  }
181
181
  return tr;
182
182
  }
183
183
  var deleteCellContents = (state, dispatch) => {
184
184
  const range = cellSelection(state);
185
185
  if (range === null) return false;
186
- _optionalChain([dispatch, 'optionalCall', _7 => _7(emptied(state, range).setSelection(_chunkHOIDJEVIcjs.textSelection.call(void 0, firstCell(range))))]);
186
+ _optionalChain([dispatch, 'optionalCall', _7 => _7(emptied(state, range).setSelection(_chunkZKVOS57Qcjs.textSelection.call(void 0, firstCell(range))))]);
187
187
  return true;
188
188
  };
189
189
  function typeOverCells(text) {
@@ -191,7 +191,7 @@ function typeOverCells(text) {
191
191
  const range = cellSelection(state);
192
192
  if (range === null || text === "") return false;
193
193
  const tr = emptied(state, range);
194
- _optionalChain([dispatch, 'optionalCall', _8 => _8(tr.setSelection(_chunkHOIDJEVIcjs.textSelection.call(void 0, _chunkHOIDJEVIcjs.insertTextAt.call(void 0, tr, state.schema, firstCell(range), text))))]);
194
+ _optionalChain([dispatch, 'optionalCall', _8 => _8(tr.setSelection(_chunkZKVOS57Qcjs.textSelection.call(void 0, _chunkZKVOS57Qcjs.insertTextAt.call(void 0, tr, state.schema, firstCell(range), text))))]);
195
195
  return true;
196
196
  };
197
197
  }
@@ -199,14 +199,14 @@ function setCellsMark(type, attrs) {
199
199
  return (state, dispatch) => {
200
200
  const range = cellSelection(state);
201
201
  const cells = range === null ? [] : filledCells(state.doc, range);
202
- const regions = range === null ? void 0 : _optionalChain([_chunkBTBHHBVRcjs.blockById.call(void 0, state.doc, range.block), 'optionalAccess', _9 => _9.regions]);
202
+ const regions = range === null ? void 0 : _optionalChain([_chunk4SLJNZSMcjs.blockById.call(void 0, state.doc, range.block), 'optionalAccess', _9 => _9.regions]);
203
203
  if (range === null || regions === void 0 || cells.length === 0) return false;
204
- const carried = cells.every(({ region }) => _chunkHOIDJEVIcjs.markCoverage.call(void 0, regions[region], type, attrs).every);
205
- const mark = carried ? _chunkHOIDJEVIcjs.toggleMark.call(void 0, type, attrs) : _chunkHOIDJEVIcjs.setMark.call(void 0, type, attrs);
206
- const tr = new (0, _chunkHOIDJEVIcjs.Transaction)(state);
204
+ const carried = cells.every(({ region }) => _chunkZKVOS57Qcjs.markCoverage.call(void 0, regions[region], type, attrs).every);
205
+ const mark = carried ? _chunkZKVOS57Qcjs.toggleMark.call(void 0, type, attrs) : _chunkZKVOS57Qcjs.setMark.call(void 0, type, attrs);
206
+ const tr = new (0, _chunkZKVOS57Qcjs.Transaction)(state);
207
207
  for (const { region, length } of cells) {
208
208
  const start = { block: range.block, region, offset: 0 };
209
- const whole = _chunkHOIDJEVIcjs.textSelection.call(void 0, start, { ...start, offset: length });
209
+ const whole = _chunkZKVOS57Qcjs.textSelection.call(void 0, start, { ...start, offset: length });
210
210
  mark({ ...state, doc: tr.doc, selection: whole, storedMarks: null }, (cell) => {
211
211
  for (const step of cell.steps) tr.step(step);
212
212
  });
@@ -228,7 +228,7 @@ var controlsSlot = (controller, blockId) => _nullishCoalesce(_optionalChain([con
228
228
 
229
229
  var _jsxruntime = require('react/jsx-runtime');
230
230
  var TableCell = _react.memo.call(void 0, function TableCell2({ controller, blockId, row, col, header, align, label }) {
231
- const inRange = _chunk5M4QG3ZCcjs.useEditorState.call(void 0,
231
+ const inRange = _chunkP6KYXFZCcjs.useEditorState.call(void 0,
232
232
  controller,
233
233
  _react.useCallback.call(void 0,
234
234
  (state) => {
@@ -247,7 +247,7 @@ var TableCell = _react.memo.call(void 0, function TableCell2({ controller, block
247
247
  "data-col": col,
248
248
  "data-in-range": inRange ? "" : void 0,
249
249
  style: align === null ? void 0 : { textAlign: align },
250
- children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5M4QG3ZCcjs.EditableRegion, { block: blockId, region: _chunkBTBHHBVRcjs.cellKey.call(void 0, row, col), label, className: "quoin-table-text" })
250
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkP6KYXFZCcjs.EditableRegion, { block: blockId, region: _chunk4SLJNZSMcjs.cellKey.call(void 0, row, col), label, className: "quoin-table-text" })
251
251
  }
252
252
  );
253
253
  });
@@ -296,7 +296,7 @@ function changeTable(blockId, change, plan) {
296
296
  const block = tableBlock(state.doc, blockId);
297
297
  const next = block && change(block);
298
298
  if (!next) return false;
299
- const tr = new (0, _chunkHOIDJEVIcjs.Transaction)(state).step(_chunkHOIDJEVIcjs.replaceBlockStep.call(void 0, next));
299
+ const tr = new (0, _chunkZKVOS57Qcjs.Transaction)(state).step(_chunkZKVOS57Qcjs.replaceBlockStep.call(void 0, next));
300
300
  _optionalChain([dispatch, 'optionalCall', _17 => _17(plan ? tr.setSelection(followedSelection(state.selection, blockId, plan)) : tr)]);
301
301
  return true;
302
302
  };
@@ -407,28 +407,28 @@ var setColumnWidth = (blockId, col, px, drawn) => changeTable(blockId, (block) =
407
407
  var isCount = (value) => Number.isInteger(value) && value > 0;
408
408
  function emptyCells({ rows, cols }) {
409
409
  const regions = {};
410
- for (let row = 0; row < rows; row++) for (let col = 0; col < cols; col++) regions[_chunkBTBHHBVRcjs.cellKey.call(void 0, row, col)] = [];
410
+ for (let row = 0; row < rows; row++) for (let col = 0; col < cols; col++) regions[_chunk4SLJNZSMcjs.cellKey.call(void 0, row, col)] = [];
411
411
  return regions;
412
412
  }
413
413
  function insertTable(rows, cols, options = {}) {
414
414
  return (state, dispatch) => {
415
415
  const { doc, schema } = state;
416
- const id = _chunkHOIDJEVIcjs.headBlockId.call(void 0, state.selection);
416
+ const id = _chunkZKVOS57Qcjs.headBlockId.call(void 0, state.selection);
417
417
  if (id === null || !isCount(rows) || !isCount(cols)) return false;
418
- const index = _chunkBTBHHBVRcjs.requireBlockIndex.call(void 0, doc, id);
418
+ const index = _chunk4SLJNZSMcjs.requireBlockIndex.call(void 0, doc, id);
419
419
  const current = doc.blocks[index];
420
- const fills = _chunkHOIDJEVIcjs.isParagraph.call(void 0, current) && _chunkHOIDJEVIcjs.regionLength.call(void 0, current, _nullishCoalesce(_chunkHOIDJEVIcjs.primaryRegion.call(void 0, schema, current), () => ( ""))) === 0;
420
+ const fills = _chunkZKVOS57Qcjs.isParagraph.call(void 0, current) && _chunkZKVOS57Qcjs.regionLength.call(void 0, current, _nullishCoalesce(_chunkZKVOS57Qcjs.primaryRegion.call(void 0, schema, current), () => ( ""))) === 0;
421
421
  const table = {
422
- id: fills ? current.id : (_nullishCoalesce(options.newId, () => ( (0, _chunkBTBHHBVRcjs.newId))))(),
422
+ id: fills ? current.id : (_nullishCoalesce(options.newId, () => ( (0, _chunk4SLJNZSMcjs.newId))))(),
423
423
  type: "TABLE",
424
424
  indent: current.indent,
425
425
  attrs: { header: true, align: Array.from({ length: cols }, () => null), rows, cols },
426
426
  regions: emptyCells({ rows, cols })
427
427
  };
428
- const tr = new (0, _chunkHOIDJEVIcjs.Transaction)(state).step(
429
- fills ? _chunkHOIDJEVIcjs.replaceBlockStep.call(void 0, table) : _chunkHOIDJEVIcjs.insertBlocksStep.call(void 0, _chunkHOIDJEVIcjs.descendantsEnd.call(void 0, doc, index), [table])
428
+ const tr = new (0, _chunkZKVOS57Qcjs.Transaction)(state).step(
429
+ fills ? _chunkZKVOS57Qcjs.replaceBlockStep.call(void 0, table) : _chunkZKVOS57Qcjs.insertBlocksStep.call(void 0, _chunkZKVOS57Qcjs.descendantsEnd.call(void 0, doc, index), [table])
430
430
  );
431
- _optionalChain([dispatch, 'optionalCall', _19 => _19(tr.setSelection(_chunkHOIDJEVIcjs.textSelection.call(void 0, { block: table.id, region: _chunkBTBHHBVRcjs.cellKey.call(void 0, 0, 0), offset: 0 })))]);
431
+ _optionalChain([dispatch, 'optionalCall', _19 => _19(tr.setSelection(_chunkZKVOS57Qcjs.textSelection.call(void 0, { block: table.id, region: _chunk4SLJNZSMcjs.cellKey.call(void 0, 0, 0), offset: 0 })))]);
432
432
  return true;
433
433
  };
434
434
  }
@@ -441,15 +441,15 @@ function headCell({ doc, selection }) {
441
441
  const cell = block && cellOf(head.region);
442
442
  return block && cell ? { block, cell, head, shape: tableShape(block) } : null;
443
443
  }
444
- var cellLength = (block, [row, col]) => _chunkBTBHHBVRcjs.inlineLength.call(void 0, _nullishCoalesce(block.regions[_chunkBTBHHBVRcjs.cellKey.call(void 0, row, col)], () => ( [])));
444
+ var cellLength = (block, [row, col]) => _chunk4SLJNZSMcjs.inlineLength.call(void 0, _nullishCoalesce(block.regions[_chunk4SLJNZSMcjs.cellKey.call(void 0, row, col)], () => ( [])));
445
445
  var cellPos = (block, cell, atEnd = false) => ({
446
446
  block: block.id,
447
- region: _chunkBTBHHBVRcjs.cellKey.call(void 0, ...cell),
447
+ region: _chunk4SLJNZSMcjs.cellKey.call(void 0, ...cell),
448
448
  offset: atEnd ? cellLength(block, cell) : 0
449
449
  });
450
- var moveTo = (state, pos) => new (0, _chunkHOIDJEVIcjs.Transaction)(state).setSelection(_chunkHOIDJEVIcjs.textSelection.call(void 0, pos));
450
+ var moveTo = (state, pos) => new (0, _chunkZKVOS57Qcjs.Transaction)(state).setSelection(_chunkZKVOS57Qcjs.textSelection.call(void 0, pos));
451
451
  var thenCaretIn = (command, blockId, at) => (state, dispatch) => {
452
- const caret = _chunkHOIDJEVIcjs.textSelection.call(void 0, { block: blockId, region: _chunkBTBHHBVRcjs.cellKey.call(void 0, ...at), offset: 0 });
452
+ const caret = _chunkZKVOS57Qcjs.textSelection.call(void 0, { block: blockId, region: _chunk4SLJNZSMcjs.cellKey.call(void 0, ...at), offset: 0 });
453
453
  return command(state, dispatch && ((tr) => dispatch(tr.setSelection(caret))));
454
454
  };
455
455
  var cellAtIndex = (index, { cols }) => [Math.floor(index / cols), index % cols];
@@ -482,11 +482,11 @@ var enterInCell = (state, dispatch) => {
482
482
  if (row === shape.rows - 1 && cellLength(block, cell) === 0) {
483
483
  return thenCaretIn(addRow(block.id, shape.rows), block.id, [shape.rows, col])(state, dispatch);
484
484
  }
485
- return _chunkHOIDJEVIcjs.insertHardBreak.call(void 0, state, dispatch);
485
+ return _chunkZKVOS57Qcjs.insertHardBreak.call(void 0, state, dispatch);
486
486
  };
487
487
  var stopAtCellEdge = (atEnd) => (state) => {
488
488
  const caret = headCell(state);
489
- if (caret === null || !_chunkHOIDJEVIcjs.isCollapsed.call(void 0, state.selection)) return false;
489
+ if (caret === null || !_chunkZKVOS57Qcjs.isCollapsed.call(void 0, state.selection)) return false;
490
490
  return caret.head.offset === (atEnd ? cellLength(caret.block, caret.cell) : 0);
491
491
  };
492
492
  var firstThatApplies = (...commands) => (state, dispatch) => commands.some((command) => command(state, dispatch));
@@ -519,7 +519,7 @@ function useCellPress(controller, blockId, table, editable) {
519
519
  if (!editable || element === null) return;
520
520
  const onPointerDown = (event) => {
521
521
  const cell = event.button === 0 && event.pointerType !== "touch" ? cellOf2(event.target) : null;
522
- const block = cell && _chunkBTBHHBVRcjs.blockById.call(void 0, controller.editor.state.doc, blockId);
522
+ const block = cell && _chunk4SLJNZSMcjs.blockById.call(void 0, controller.editor.state.doc, blockId);
523
523
  if (!cell || !block) return;
524
524
  event.preventDefault();
525
525
  event.stopPropagation();
@@ -533,7 +533,7 @@ function useCellPress(controller, blockId, table, editable) {
533
533
  // src/extensions/table/use-reveal-cell.ts
534
534
 
535
535
  function useRevealCell(controller, blockId) {
536
- const region = _chunk5M4QG3ZCcjs.useEditorState.call(void 0,
536
+ const region = _chunkP6KYXFZCcjs.useEditorState.call(void 0,
537
537
  controller,
538
538
  _react.useCallback.call(void 0,
539
539
  (state) => {
@@ -557,23 +557,23 @@ function useRevealCell(controller, blockId) {
557
557
  // src/extensions/table/vertical-cell-move.ts
558
558
  var VERTICAL = { ArrowUp: -1, ArrowDown: 1 };
559
559
  function caretAtGoal(controller, blockId, cell, direction) {
560
- const region = _chunkBTBHHBVRcjs.cellKey.call(void 0, ...cell);
560
+ const region = _chunk4SLJNZSMcjs.cellKey.call(void 0, ...cell);
561
561
  const host = controller.registry.get(blockId, region);
562
562
  const { goalX } = controller;
563
- const line = host && _chunk5M4QG3ZCcjs.lineEdgeRect.call(void 0, host, direction < 0);
563
+ const line = host && _chunkP6KYXFZCcjs.lineEdgeRect.call(void 0, host, direction < 0);
564
564
  if (!host || !line || goalX === null) return null;
565
565
  const box = host.getBoundingClientRect();
566
566
  const x = Math.min(Math.max(goalX, box.left), box.right - 1);
567
- const point = _chunk5M4QG3ZCcjs.caretFromPoint.call(void 0, host.ownerDocument, x, line.top + line.height / 2);
568
- const pos = point && _chunk5M4QG3ZCcjs.domToPos.call(void 0, controller.registry, point.node, point.offset);
567
+ const point = _chunkP6KYXFZCcjs.caretFromPoint.call(void 0, host.ownerDocument, x, line.top + line.height / 2);
568
+ const pos = point && _chunkP6KYXFZCcjs.domToPos.call(void 0, controller.registry, point.node, point.offset);
569
569
  return pos && pos.block === blockId && pos.region === region ? pos : null;
570
570
  }
571
571
  var plainArrow = (event) => event.altKey || event.ctrlKey || event.metaKey ? void 0 : VERTICAL[event.key];
572
572
  function caretOnEdgeLine(controller, head, direction) {
573
573
  const host = controller.registry.get(head.block, head.region);
574
- const point = _chunk5M4QG3ZCcjs.posToDom.call(void 0, controller.registry, head);
575
- if (!host || !point || !(direction < 0 ? _chunk5M4QG3ZCcjs.isOnFirstLine.call(void 0, host, point) : _chunk5M4QG3ZCcjs.isOnLastLine.call(void 0, host, point))) return null;
576
- return { left: _nullishCoalesce(_optionalChain([_chunk5M4QG3ZCcjs.caretClientRect.call(void 0, point), 'optionalAccess', _31 => _31.left]), () => ( null)) };
574
+ const point = _chunkP6KYXFZCcjs.posToDom.call(void 0, controller.registry, head);
575
+ if (!host || !point || !(direction < 0 ? _chunkP6KYXFZCcjs.isOnFirstLine.call(void 0, host, point) : _chunkP6KYXFZCcjs.isOnLastLine.call(void 0, host, point))) return null;
576
+ return { left: _nullishCoalesce(_optionalChain([_chunkP6KYXFZCcjs.caretClientRect.call(void 0, point), 'optionalAccess', _31 => _31.left]), () => ( null)) };
577
577
  }
578
578
  function columnAt(controller, blockId, row, x) {
579
579
  const cells = Array.from(_nullishCoalesce(_optionalChain([controller, 'access', _32 => _32.blockElement, 'call', _33 => _33(blockId), 'optionalAccess', _34 => _34.querySelector, 'call', _35 => _35("table"), 'optionalAccess', _36 => _36.rows, 'access', _37 => _37[row], 'optionalAccess', _38 => _38.cells]), () => ( [])));
@@ -586,7 +586,7 @@ function enterTable(controller, blockId, event) {
586
586
  const { selection } = state;
587
587
  const block = tableBlock(state.doc, blockId);
588
588
  if (direction === void 0 || event.shiftKey || block === null || _optionalChain([selection, 'optionalAccess', _39 => _39.kind]) !== "text") return false;
589
- if (!_chunkHOIDJEVIcjs.isCollapsed.call(void 0, selection) || _optionalChain([_chunk5M4QG3ZCcjs.neighbourBlock.call(void 0, state.doc, selection.head.block, direction), 'optionalAccess', _40 => _40.id]) !== blockId) return false;
589
+ if (!_chunkZKVOS57Qcjs.isCollapsed.call(void 0, selection) || _optionalChain([_chunkP6KYXFZCcjs.neighbourBlock.call(void 0, state.doc, selection.head.block, direction), 'optionalAccess', _40 => _40.id]) !== blockId) return false;
590
590
  const caret = caretOnEdgeLine(controller, selection.head, direction);
591
591
  if (caret === null) return false;
592
592
  controller.goalX ??= caret.left;
@@ -595,7 +595,7 @@ function enterTable(controller, blockId, event) {
595
595
  const { goalX } = controller;
596
596
  const cell = [row, goalX === null ? direction > 0 ? 0 : cols - 1 : columnAt(controller, blockId, row, goalX)];
597
597
  const pos = _nullishCoalesce(caretAtGoal(controller, blockId, cell, direction), () => ( cellPos(block, cell, direction < 0)));
598
- controller.dispatch(controller.editor.createTransaction().setSelection(_chunkHOIDJEVIcjs.textSelection.call(void 0, pos)));
598
+ controller.dispatch(controller.editor.createTransaction().setSelection(_chunkZKVOS57Qcjs.textSelection.call(void 0, pos)));
599
599
  return true;
600
600
  }
601
601
  function moveBetweenRows(controller, blockId, event) {
@@ -611,7 +611,7 @@ function moveBetweenRows(controller, blockId, event) {
611
611
  if (edge === null) return false;
612
612
  controller.goalX ??= edge.left;
613
613
  const pos = _nullishCoalesce(caretAtGoal(controller, blockId, target, direction), () => ( cellPos(caret.block, target, direction < 0)));
614
- const selection = event.shiftKey ? _chunkHOIDJEVIcjs.textSelection.call(void 0, state.selection.anchor, pos) : _chunkHOIDJEVIcjs.textSelection.call(void 0, pos);
614
+ const selection = event.shiftKey ? _chunkZKVOS57Qcjs.textSelection.call(void 0, state.selection.anchor, pos) : _chunkZKVOS57Qcjs.textSelection.call(void 0, pos);
615
615
  controller.dispatch(controller.editor.createTransaction().setSelection(selection));
616
616
  return true;
617
617
  }
@@ -626,12 +626,12 @@ function useTableKeys(controller, blockId, editable) {
626
626
  _react.useEffect.call(void 0, () => {
627
627
  if (!editable) return;
628
628
  const intercept = (event) => {
629
- if (_chunk5M4QG3ZCcjs.isComposingKey.call(void 0, controller, event)) return false;
629
+ if (_chunkP6KYXFZCcjs.isComposingKey.call(void 0, controller, event)) return false;
630
630
  const handled = typeOver(controller, blockId, event) || moveBetweenRows(controller, blockId, event) || enterTable(controller, blockId, event);
631
631
  if (handled) event.preventDefault();
632
632
  return handled;
633
633
  };
634
- return _chunk5R3ISX4Acjs.interceptKeys.call(void 0, controller, intercept);
634
+ return _chunkCW3AFJBRcjs.interceptKeys.call(void 0, controller, intercept);
635
635
  }, [controller, blockId, editable]);
636
636
  }
637
637
 
@@ -639,7 +639,7 @@ function useTableKeys(controller, blockId, editable) {
639
639
 
640
640
  var indexes = (from, to) => Array.from({ length: Math.max(to - from, 0) }, (_, i) => from + i);
641
641
  function TableBlock({ block, controller, labels }) {
642
- const readOnly = _chunk5M4QG3ZCcjs.useReadOnly.call(void 0, controller);
642
+ const readOnly = _chunkP6KYXFZCcjs.useReadOnly.call(void 0, controller);
643
643
  const table = _react.useRef.call(void 0, null);
644
644
  const { rows, cols } = tableShape(block);
645
645
  const header = block.attrs.header !== false && rows > 0;
@@ -663,7 +663,7 @@ function TableBlock({ block, controller, labels }) {
663
663
  col
664
664
  )) }, index);
665
665
  const scroller = readOnly ? { role: "region", "aria-label": labels.table, tabIndex: 0 } : void 0;
666
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { contentEditable: false, className: "quoin-table", "data-readonly": readOnly ? "" : void 0, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: `quoin-table-scroll ${readOnly ? _chunk5R3ISX4Acjs.FOCUS_RING : ""}`, ...scroller, children: [
666
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { contentEditable: false, className: "quoin-table", "data-readonly": readOnly ? "" : void 0, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: `quoin-table-scroll ${readOnly ? _chunkCW3AFJBRcjs.FOCUS_RING : ""}`, ...scroller, children: [
667
667
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
668
668
  "table",
669
669
  {
@@ -691,10 +691,10 @@ function lineCells(block, index, axis) {
691
691
  const { rows, cols } = tableShape(block);
692
692
  return Array.from(
693
693
  { length: axis === "row" ? cols : rows },
694
- (_, other) => axis === "row" ? _nullishCoalesce(block.regions[_chunkBTBHHBVRcjs.cellKey.call(void 0, index, other)], () => ( EMPTY)) : _nullishCoalesce(block.regions[_chunkBTBHHBVRcjs.cellKey.call(void 0, other, index)], () => ( EMPTY))
694
+ (_, other) => axis === "row" ? _nullishCoalesce(block.regions[_chunk4SLJNZSMcjs.cellKey.call(void 0, index, other)], () => ( EMPTY)) : _nullishCoalesce(block.regions[_chunk4SLJNZSMcjs.cellKey.call(void 0, other, index)], () => ( EMPTY))
695
695
  );
696
696
  }
697
- var sameLine = (before, after, index, axis) => _chunkBTBHHBVRcjs.sameItems.call(void 0, lineCells(before, index, axis), lineCells(after, index, axis), _chunkBTBHHBVRcjs.equalInline);
697
+ var sameLine = (before, after, index, axis) => _chunk4SLJNZSMcjs.sameItems.call(void 0, lineCells(before, index, axis), lineCells(after, index, axis), _chunk4SLJNZSMcjs.equalInline);
698
698
  function sameMenuCells(opened, current, target, axis) {
699
699
  const shape = tableShape(opened);
700
700
  const lines = axis === "row" ? shape.rows : shape.cols;
@@ -727,7 +727,7 @@ function ColumnResizer(props) {
727
727
  if (!controller.readOnly) controller.run(setColumnWidth(blockId, col, px, widths));
728
728
  };
729
729
  const onKeyDown = (event) => {
730
- if (_chunk5M4QG3ZCcjs.isComposingKey.call(void 0, controller, event.nativeEvent)) return;
730
+ if (_chunkP6KYXFZCcjs.isComposingKey.call(void 0, controller, event.nativeEvent)) return;
731
731
  const step = event.shiftKey ? LARGE_STEP : STEP;
732
732
  const tab = event.key === "Tab" && !event.altKey && !event.ctrlKey && !event.metaKey;
733
733
  if (event.key === "ArrowLeft" || event.key === "ArrowRight") {
@@ -782,7 +782,7 @@ function ColumnResizer(props) {
782
782
  "aria-valuetext": labels.columnWidth(width),
783
783
  className: "quoin-table-resizer",
784
784
  style,
785
- ...{ [_chunk5M4QG3ZCcjs.NATIVE_INTERACTION]: "" },
785
+ ...{ [_chunkP6KYXFZCcjs.NATIVE_INTERACTION]: "" },
786
786
  onKeyDown,
787
787
  onPointerDown,
788
788
  onPointerMove,
@@ -802,20 +802,20 @@ function HandleMenu({ controller, axis, label, style, items, open, onOpenChange,
802
802
  if (controller.run(item3.command)) controller.announce(item3.done);
803
803
  };
804
804
  const item2 = (entry) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
805
- _chunk5R3ISX4Acjs.DropdownMenuItem,
805
+ _chunkCW3AFJBRcjs.DropdownMenuItem,
806
806
  {
807
807
  disabled: entry.disabled,
808
808
  className: entry.destructive ? DESTRUCTIVE : void 0,
809
809
  onSelect: () => run(entry),
810
810
  children: [
811
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5R3ISX4Acjs.MenuIcon, { icon: entry.icon }),
811
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkCW3AFJBRcjs.MenuIcon, { icon: entry.icon }),
812
812
  entry.label
813
813
  ]
814
814
  },
815
815
  entry.id
816
816
  );
817
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5R3ISX4Acjs.DropdownMenu, { open, onOpenChange, children: [
818
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5R3ISX4Acjs.DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
817
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkCW3AFJBRcjs.DropdownMenu, { open, onOpenChange, children: [
818
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkCW3AFJBRcjs.DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
819
819
  "button",
820
820
  {
821
821
  ref: buttonRef,
@@ -829,18 +829,18 @@ function HandleMenu({ controller, axis, label, style, items, open, onOpenChange,
829
829
  }
830
830
  ) }),
831
831
  open && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
832
- _chunk5R3ISX4Acjs.DropdownMenuContent,
832
+ _chunkCW3AFJBRcjs.DropdownMenuContent,
833
833
  {
834
834
  align: "start",
835
835
  "aria-label": label,
836
836
  "aria-labelledby": void 0,
837
- onCloseAutoFocus: _chunk5R3ISX4Acjs.returnFocusToText.call(void 0, controller),
838
- ..._chunk5R3ISX4Acjs.bubblePart.call(void 0, controller),
837
+ onCloseAutoFocus: _chunkCW3AFJBRcjs.returnFocusToText.call(void 0, controller),
838
+ ..._chunkCW3AFJBRcjs.bubblePart.call(void 0, controller),
839
839
  children: [
840
840
  items.filter((entry) => !entry.destructive).map(item2),
841
841
  children,
842
842
  items.filter((entry) => entry.destructive).map((entry) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _react.Fragment, { children: [
843
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5R3ISX4Acjs.DropdownMenuSeparator, {}),
843
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkCW3AFJBRcjs.DropdownMenuSeparator, {}),
844
844
  item2(entry)
845
845
  ] }, entry.id))
846
846
  ]
@@ -918,7 +918,7 @@ function TableHandles(props) {
918
918
  const { rowEdge, colEdge } = target;
919
919
  const rowInsertAt = edgeOf(geometry.rows, rowEdge);
920
920
  const columnInsertAt = edgeOf(geometry.cols, colEdge);
921
- _chunk5M4QG3ZCcjs.useIsomorphicLayoutEffect.call(void 0, () => {
921
+ _chunkP6KYXFZCcjs.useIsomorphicLayoutEffect.call(void 0, () => {
922
922
  if (!focusRequested) return;
923
923
  _optionalChain([(_nullishCoalesce(columnHandle.current, () => ( rowHandle.current))), 'optionalAccess', _50 => _50.focus, 'call', _51 => _51()]);
924
924
  onFocused();
@@ -929,7 +929,7 @@ function TableHandles(props) {
929
929
  const onKeyDown = (event) => {
930
930
  const handles = [rowHandle.current, columnHandle.current].filter((handle) => handle !== null);
931
931
  const index = handles.indexOf(event.target);
932
- if (index === -1 || _chunk5M4QG3ZCcjs.isComposingKey.call(void 0, controller, event.nativeEvent)) return;
932
+ if (index === -1 || _chunkP6KYXFZCcjs.isComposingKey.call(void 0, controller, event.nativeEvent)) return;
933
933
  if (event.key === "ArrowLeft" || event.key === "ArrowRight") handles[(index + 1) % handles.length].focus();
934
934
  else if (isTab(event) && !event.shiftKey && resizer.current !== null) resizer.current.focus();
935
935
  else if (isTab(event) || event.key === "Escape") controller.focus();
@@ -967,7 +967,7 @@ function TableHandles(props) {
967
967
  onOpenChange: opener("row"),
968
968
  buttonRef: rowHandle,
969
969
  children: row === 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
970
- _chunk5R3ISX4Acjs.DropdownMenuCheckboxItem,
970
+ _chunkCW3AFJBRcjs.DropdownMenuCheckboxItem,
971
971
  {
972
972
  checked: block.attrs.header !== false,
973
973
  onCheckedChange: (on) => run(toggleHeaderRow(block.id), on ? labels.headerRowOn : labels.headerRowOff),
@@ -988,14 +988,14 @@ function TableHandles(props) {
988
988
  onOpenChange: opener("column"),
989
989
  buttonRef: columnHandle,
990
990
  children: [
991
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5R3ISX4Acjs.DropdownMenuSeparator, {}),
992
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5R3ISX4Acjs.DropdownMenuRadioGroup, { value: _nullishCoalesce(align, () => ( "")), children: alignItems(labels).map(({ value, label, icon, done }) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
993
- _chunk5R3ISX4Acjs.DropdownMenuRadioItem,
991
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkCW3AFJBRcjs.DropdownMenuSeparator, {}),
992
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkCW3AFJBRcjs.DropdownMenuRadioGroup, { value: _nullishCoalesce(align, () => ( "")), children: alignItems(labels).map(({ value, label, icon, done }) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
993
+ _chunkCW3AFJBRcjs.DropdownMenuRadioItem,
994
994
  {
995
995
  value,
996
996
  onSelect: () => align === value ? run(setColumnAlign(block.id, col, null), labels.alignmentCleared) : run(setColumnAlign(block.id, col, value), done),
997
997
  children: [
998
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5R3ISX4Acjs.MenuIcon, { icon }),
998
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkCW3AFJBRcjs.MenuIcon, { icon }),
999
999
  label
1000
1000
  ]
1001
1001
  },
@@ -1014,8 +1014,8 @@ function TableHandles(props) {
1014
1014
  "data-axis": "row",
1015
1015
  className: "quoin-table-insert",
1016
1016
  style: place(geometry.left - BESIDE, rowInsertAt),
1017
- onPointerDown: _chunk5R3ISX4Acjs.keepFocus,
1018
- onMouseDown: _chunk5R3ISX4Acjs.keepFocus,
1017
+ onPointerDown: _chunkCW3AFJBRcjs.keepFocus,
1018
+ onMouseDown: _chunkCW3AFJBRcjs.keepFocus,
1019
1019
  onClick: () => run(addRow(block.id, rowEdge), labels.rowInserted),
1020
1020
  children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Plus, { "aria-hidden": "true" })
1021
1021
  }
@@ -1029,8 +1029,8 @@ function TableHandles(props) {
1029
1029
  "data-axis": "column",
1030
1030
  className: "quoin-table-insert",
1031
1031
  style: place(columnInsertAt, geometry.top),
1032
- onPointerDown: _chunk5R3ISX4Acjs.keepFocus,
1033
- onMouseDown: _chunk5R3ISX4Acjs.keepFocus,
1032
+ onPointerDown: _chunkCW3AFJBRcjs.keepFocus,
1033
+ onMouseDown: _chunkCW3AFJBRcjs.keepFocus,
1034
1034
  onClick: () => run(addColumn(block.id, colEdge), labels.columnInserted),
1035
1035
  children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Plus, { "aria-hidden": "true" })
1036
1036
  }
@@ -1076,7 +1076,7 @@ function edgeNear(spans, at, reach) {
1076
1076
  // src/extensions/table/use-table-geometry.ts
1077
1077
  function useTableGeometry(controller, blockId, slot) {
1078
1078
  const [geometry, setGeometry] = _react.useState.call(void 0, null);
1079
- _chunk5M4QG3ZCcjs.useIsomorphicLayoutEffect.call(void 0, () => {
1079
+ _chunkP6KYXFZCcjs.useIsomorphicLayoutEffect.call(void 0, () => {
1080
1080
  const table = _optionalChain([controller, 'access', _55 => _55.blockElement, 'call', _56 => _56(blockId), 'optionalAccess', _57 => _57.querySelector, 'call', _58 => _58("table")]);
1081
1081
  const view = slot.ownerDocument.defaultView;
1082
1082
  if (!table || !view) return;
@@ -1113,7 +1113,7 @@ function useCutCells(controller) {
1113
1113
  const onCut = (event) => {
1114
1114
  if (controller.readOnly || cellSelection(controller.editor.state) === null) return;
1115
1115
  event.stopPropagation();
1116
- _chunk5M4QG3ZCcjs.handleCopy.call(void 0, controller, event, false);
1116
+ _chunkP6KYXFZCcjs.handleCopy.call(void 0, controller, event, false);
1117
1117
  controller.run(deleteCellContents);
1118
1118
  };
1119
1119
  root.addEventListener("cut", onCut, true);
@@ -1160,9 +1160,9 @@ function focusOf(root) {
1160
1160
  function useTableTarget(controller, held) {
1161
1161
  const [hovered, setHovered] = _react.useState.call(void 0, null);
1162
1162
  const [focus, setFocus] = _react.useState.call(void 0, "none");
1163
- const caret = _chunk5M4QG3ZCcjs.useEditorState.call(void 0, controller, caretTarget, sameTarget);
1163
+ const caret = _chunkP6KYXFZCcjs.useEditorState.call(void 0, controller, caretTarget, sameTarget);
1164
1164
  const hoveredBlock = _nullishCoalesce(_optionalChain([hovered, 'optionalAccess', _63 => _63.target, 'access', _64 => _64.block]), () => ( null));
1165
- const shape = _chunk5M4QG3ZCcjs.useEditorState.call(void 0,
1165
+ const shape = _chunkP6KYXFZCcjs.useEditorState.call(void 0,
1166
1166
  controller,
1167
1167
  _react.useCallback.call(void 0, (state) => hoveredBlock === null ? null : shapeOf(state, hoveredBlock), [hoveredBlock])
1168
1168
  );
@@ -1204,16 +1204,16 @@ function useTableTarget(controller, held) {
1204
1204
  // src/extensions/table/TableControls.tsx
1205
1205
 
1206
1206
  var isFocusKey = (event) => event.key === "F10" && event.altKey && !event.ctrlKey && !event.metaKey && !event.shiftKey;
1207
- var takesFocusKey = (state) => _chunkHOIDJEVIcjs.isCollapsed.call(void 0, state.selection) || cellSelection(state) !== null;
1207
+ var takesFocusKey = (state) => _chunkZKVOS57Qcjs.isCollapsed.call(void 0, state.selection) || cellSelection(state) !== null;
1208
1208
  function TableControls({ controller, labels }) {
1209
- const readOnly = _chunk5M4QG3ZCcjs.useReadOnly.call(void 0, controller);
1209
+ const readOnly = _chunkP6KYXFZCcjs.useReadOnly.call(void 0, controller);
1210
1210
  const [held, setHeld] = _react.useState.call(void 0, null);
1211
1211
  const [focusFor, setFocusFor] = _react.useState.call(void 0, null);
1212
1212
  const [slot, setSlot] = _react.useState.call(void 0, null);
1213
1213
  const target = useTableTarget(controller, _nullishCoalesce(_optionalChain([held, 'optionalAccess', _65 => _65.target]), () => ( null)));
1214
1214
  useCutCells(controller);
1215
1215
  const blockId = _nullishCoalesce(_optionalChain([target, 'optionalAccess', _66 => _66.block]), () => ( null));
1216
- const block = _chunk5M4QG3ZCcjs.useEditorState.call(void 0,
1216
+ const block = _chunkP6KYXFZCcjs.useEditorState.call(void 0,
1217
1217
  controller,
1218
1218
  _react.useCallback.call(void 0, (state) => blockId === null ? null : tableBlock(state.doc, blockId), [blockId])
1219
1219
  );
@@ -1230,13 +1230,13 @@ function TableControls({ controller, labels }) {
1230
1230
  const intercept = (event) => {
1231
1231
  const { state } = controller.editor;
1232
1232
  const caret = caretTarget(state);
1233
- if (!isFocusKey(event) || _chunk5M4QG3ZCcjs.isComposingKey.call(void 0, controller, event) || caret === null || !takesFocusKey(state)) return false;
1233
+ if (!isFocusKey(event) || _chunkP6KYXFZCcjs.isComposingKey.call(void 0, controller, event) || caret === null || !takesFocusKey(state)) return false;
1234
1234
  event.preventDefault();
1235
1235
  setHeld({ target: caret, menu: null });
1236
1236
  setFocusFor(caret.block);
1237
1237
  return true;
1238
1238
  };
1239
- return _chunk5R3ISX4Acjs.interceptKeys.call(void 0, controller, intercept);
1239
+ return _chunkCW3AFJBRcjs.interceptKeys.call(void 0, controller, intercept);
1240
1240
  }, [controller, readOnly]);
1241
1241
  const onMenu = _react.useCallback.call(void 0,
1242
1242
  (menu) => setHeld(menu === null || target === null || block === null ? null : { target, menu, opened: block }),
@@ -1247,7 +1247,7 @@ function TableControls({ controller, labels }) {
1247
1247
  setFocusFor(null);
1248
1248
  setHeld((current) => _optionalChain([current, 'optionalAccess', _68 => _68.menu]) === null ? null : current);
1249
1249
  }, []);
1250
- _chunk5M4QG3ZCcjs.useIsomorphicLayoutEffect.call(void 0, () => {
1250
+ _chunkP6KYXFZCcjs.useIsomorphicLayoutEffect.call(void 0, () => {
1251
1251
  const drawn = block === null || readOnly ? null : controlsSlot(controller, block.id);
1252
1252
  setSlot((current) => current === drawn ? current : drawn);
1253
1253
  });
@@ -1351,7 +1351,7 @@ function tableExtension(options = {}) {
1351
1351
  blockNames: { TABLE: labels.table },
1352
1352
  overlays: [TableOverlay]
1353
1353
  };
1354
- return _chunkHOIDJEVIcjs.defineExtension.call(void 0, {
1354
+ return _chunkZKVOS57Qcjs.defineExtension.call(void 0, {
1355
1355
  name: "table",
1356
1356
  priority: ABOVE_CORE_KEYS,
1357
1357
  plugins: [cellSelectionPlugin],
@@ -1382,4 +1382,4 @@ function tableExtension(options = {}) {
1382
1382
 
1383
1383
 
1384
1384
  exports.cellSelectionKey = cellSelectionKey; exports.cellSelectionPlugin = cellSelectionPlugin; exports.cellSelection = cellSelection; exports.cellsInRange = cellsInRange; exports.selectCells = selectCells; exports.deleteCellContents = deleteCellContents; exports.setCellsMark = setCellsMark; exports.addRow = addRow; exports.removeRow = removeRow; exports.moveRow = moveRow; exports.addColumn = addColumn; exports.removeColumn = removeColumn; exports.moveColumn = moveColumn; exports.toggleHeaderRow = toggleHeaderRow; exports.setColumnAlign = setColumnAlign; exports.setColumnWidth = setColumnWidth; exports.insertTable = insertTable; exports.englishTableLabels = englishTableLabels; exports.tableExtension = tableExtension;
1385
- //# sourceMappingURL=chunk-56C7GCKO.cjs.map
1385
+ //# sourceMappingURL=chunk-5MAYUGTE.cjs.map