@gravity-ui/markdown-editor 13.17.0 → 13.18.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 (227) hide show
  1. package/README.md +2 -0
  2. package/build/cjs/bundle/config/action-names.d.ts +1 -1
  3. package/build/cjs/bundle/config/action-names.js +1 -0
  4. package/build/cjs/bundle/config/icons.d.ts +1 -1
  5. package/build/cjs/bundle/config/icons.js +3 -0
  6. package/build/cjs/bundle/config/wysiwyg.d.ts +1 -0
  7. package/build/cjs/bundle/config/wysiwyg.js +13 -1
  8. package/build/cjs/extensions/behavior/Resizable/Resizable.css +38 -0
  9. package/build/cjs/extensions/behavior/Resizable/Resizable.d.ts +9 -0
  10. package/build/cjs/extensions/behavior/Resizable/Resizable.js +14 -0
  11. package/build/cjs/extensions/markdown/Table/actions/innerActions.d.ts +1 -1
  12. package/build/cjs/extensions/markdown/Table/plugins/TableCellContextPlugin/index.js +19 -9
  13. package/build/cjs/extensions/yfm/GPT/ErrorScreen/ErrorScreen.css +18 -0
  14. package/build/cjs/extensions/yfm/GPT/ErrorScreen/ErrorScreen.d.ts +8 -0
  15. package/build/cjs/extensions/yfm/GPT/ErrorScreen/ErrorScreen.js +21 -0
  16. package/build/cjs/extensions/yfm/GPT/ErrorScreen/types.d.ts +14 -0
  17. package/build/cjs/extensions/yfm/GPT/ErrorScreen/types.js +2 -0
  18. package/build/cjs/extensions/yfm/GPT/GptDialog/GptDialog.css +75 -0
  19. package/build/cjs/extensions/yfm/GPT/GptDialog/GptDialog.d.ts +28 -0
  20. package/build/cjs/extensions/yfm/GPT/GptDialog/GptDialog.js +102 -0
  21. package/build/cjs/extensions/yfm/GPT/GptDialog/LoadingScreen/LoadingScreen.css +22 -0
  22. package/build/cjs/extensions/yfm/GPT/GptDialog/LoadingScreen/LoadingScreen.d.ts +3 -0
  23. package/build/cjs/extensions/yfm/GPT/GptDialog/LoadingScreen/LoadingScreen.js +21 -0
  24. package/build/cjs/extensions/yfm/GPT/IconRefuge/IconRefuge.classname.d.ts +1 -0
  25. package/build/cjs/extensions/yfm/GPT/IconRefuge/IconRefuge.classname.js +5 -0
  26. package/build/cjs/extensions/yfm/GPT/IconRefuge/IconRefuge.css +8 -0
  27. package/build/cjs/extensions/yfm/GPT/IconRefuge/IconRefuge.d.ts +14 -0
  28. package/build/cjs/extensions/yfm/GPT/IconRefuge/IconRefuge.js +28 -0
  29. package/build/cjs/extensions/yfm/GPT/IconRefuge/index.d.ts +2 -0
  30. package/build/cjs/extensions/yfm/GPT/IconRefuge/index.js +5 -0
  31. package/build/cjs/extensions/yfm/GPT/PresetList/PresetList.d.ts +9 -0
  32. package/build/cjs/extensions/yfm/GPT/PresetList/PresetList.js +29 -0
  33. package/build/cjs/extensions/yfm/GPT/PresetList/Presetlist.css +6 -0
  34. package/build/cjs/extensions/yfm/GPT/actions.d.ts +2 -0
  35. package/build/cjs/extensions/yfm/GPT/actions.js +14 -0
  36. package/build/cjs/extensions/yfm/GPT/commands.d.ts +2 -0
  37. package/build/cjs/extensions/yfm/GPT/commands.js +13 -0
  38. package/build/cjs/extensions/yfm/GPT/constants.d.ts +13 -0
  39. package/build/cjs/extensions/yfm/GPT/constants.js +15 -0
  40. package/build/cjs/extensions/yfm/GPT/gptExtension/gptExtension.d.ts +13 -0
  41. package/build/cjs/extensions/yfm/GPT/gptExtension/gptExtension.js +18 -0
  42. package/build/cjs/extensions/yfm/GPT/gptExtension/view.css +17 -0
  43. package/build/cjs/extensions/yfm/GPT/gptExtension/view.d.ts +36 -0
  44. package/build/cjs/extensions/yfm/GPT/gptExtension/view.js +171 -0
  45. package/build/cjs/extensions/yfm/GPT/hooks/useGpt.d.ts +27 -0
  46. package/build/cjs/extensions/yfm/GPT/hooks/useGpt.js +148 -0
  47. package/build/cjs/extensions/yfm/GPT/hooks/useGptHotKeys.d.ts +2 -0
  48. package/build/cjs/extensions/yfm/GPT/hooks/useGptHotKeys.js +8 -0
  49. package/build/cjs/extensions/yfm/GPT/hooks/useOverflowingHorizontalItems.d.ts +13 -0
  50. package/build/cjs/extensions/yfm/GPT/hooks/useOverflowingHorizontalItems.js +70 -0
  51. package/build/cjs/extensions/yfm/GPT/hooks/usePresetList.d.ts +14 -0
  52. package/build/cjs/extensions/yfm/GPT/hooks/usePresetList.js +36 -0
  53. package/build/cjs/extensions/yfm/GPT/index.d.ts +2 -0
  54. package/build/cjs/extensions/yfm/GPT/index.js +5 -0
  55. package/build/cjs/extensions/yfm/GPT/plugin.d.ts +13 -0
  56. package/build/cjs/extensions/yfm/GPT/plugin.js +47 -0
  57. package/build/cjs/extensions/yfm/GPT/toolbar.d.ts +3 -0
  58. package/build/cjs/extensions/yfm/GPT/toolbar.js +22 -0
  59. package/build/cjs/extensions/yfm/GPT/utils.d.ts +13 -0
  60. package/build/cjs/extensions/yfm/GPT/utils.js +31 -0
  61. package/build/cjs/extensions/yfm/ImgSize/plugins/ImgSizeNodeView/ImgSettingsButton.css +6 -0
  62. package/build/cjs/extensions/yfm/ImgSize/plugins/ImgSizeNodeView/ImgSettingsButton.d.ts +6 -1
  63. package/build/cjs/extensions/yfm/ImgSize/plugins/ImgSizeNodeView/ImgSettingsButton.js +21 -37
  64. package/build/cjs/extensions/yfm/ImgSize/plugins/ImgSizeNodeView/NodeView.d.ts +1 -1
  65. package/build/cjs/extensions/yfm/ImgSize/plugins/ImgSizeNodeView/NodeView.js +62 -4
  66. package/build/cjs/extensions/yfm/Mermaid/MermaidNodeView/MermaidView.js +8 -7
  67. package/build/cjs/extensions/yfm/YfmTable/plugins/YfmTableControls/actions.d.ts +1 -1
  68. package/build/cjs/extensions/yfm/YfmTable/plugins/YfmTableControls/actions.js +0 -8
  69. package/build/cjs/extensions/yfm/index.d.ts +1 -0
  70. package/build/cjs/extensions/yfm/index.js +1 -0
  71. package/build/cjs/i18n/gpt/dialog/en.json +16 -0
  72. package/build/cjs/i18n/gpt/dialog/index.d.ts +19 -0
  73. package/build/cjs/i18n/gpt/dialog/index.js +8 -0
  74. package/build/cjs/i18n/gpt/dialog/ru.json +16 -0
  75. package/build/cjs/i18n/gpt/errors/en.json +5 -0
  76. package/build/cjs/i18n/gpt/errors/index.d.ts +8 -0
  77. package/build/cjs/i18n/gpt/errors/index.js +8 -0
  78. package/build/cjs/i18n/gpt/errors/ru.json +5 -0
  79. package/build/cjs/i18n/gpt/extension/en.json +6 -0
  80. package/build/cjs/i18n/gpt/extension/index.d.ts +9 -0
  81. package/build/cjs/i18n/gpt/extension/index.js +8 -0
  82. package/build/cjs/i18n/gpt/extension/ru.json +6 -0
  83. package/build/cjs/i18n/gpt/loading/en.json +3 -0
  84. package/build/cjs/i18n/gpt/loading/index.d.ts +6 -0
  85. package/build/cjs/i18n/gpt/loading/index.js +8 -0
  86. package/build/cjs/i18n/gpt/loading/ru.json +3 -0
  87. package/build/cjs/i18n/menubar/en.json +1 -0
  88. package/build/cjs/i18n/menubar/index.d.ts +2 -1
  89. package/build/cjs/i18n/menubar/ru.json +1 -0
  90. package/build/cjs/i18n/yfm-table/en.json +10 -1
  91. package/build/cjs/i18n/yfm-table/index.d.ts +10 -1
  92. package/build/cjs/i18n/yfm-table/ru.json +10 -1
  93. package/build/cjs/icons/GPT.d.ts +2 -0
  94. package/build/cjs/icons/GPT.js +22 -0
  95. package/build/cjs/icons/GPTLoading.d.ts +2 -0
  96. package/build/cjs/icons/GPTLoading.js +12 -0
  97. package/build/cjs/icons/index.d.ts +3 -1
  98. package/build/cjs/icons/index.js +5 -1
  99. package/build/cjs/react-utils/useAutoFocus.d.ts +1 -1
  100. package/build/cjs/react-utils/useAutoFocus.js +2 -2
  101. package/build/cjs/react-utils/useNodeEditing.d.ts +3 -2
  102. package/build/cjs/react-utils/useNodeEditing.js +1 -1
  103. package/build/cjs/react-utils/useNodeResizing.d.ts +22 -0
  104. package/build/cjs/react-utils/useNodeResizing.js +82 -0
  105. package/build/cjs/table-utils/commands/appendColumn.js +42 -33
  106. package/build/cjs/table-utils/commands/appendRow.js +40 -22
  107. package/build/cjs/table-utils/commands/removeColumn.js +18 -20
  108. package/build/cjs/table-utils/commands/removeRow.js +12 -9
  109. package/build/cjs/table-utils/table-desc.d.ts +53 -0
  110. package/build/cjs/table-utils/table-desc.js +149 -0
  111. package/build/cjs/table-utils/utils.d.ts +1 -1
  112. package/build/cjs/table-utils/utils.js +19 -12
  113. package/build/cjs/version.js +1 -1
  114. package/build/esm/bundle/config/action-names.d.ts +1 -1
  115. package/build/esm/bundle/config/action-names.js +1 -0
  116. package/build/esm/bundle/config/icons.d.ts +1 -1
  117. package/build/esm/bundle/config/icons.js +2 -0
  118. package/build/esm/bundle/config/wysiwyg.d.ts +1 -0
  119. package/build/esm/bundle/config/wysiwyg.js +12 -0
  120. package/build/esm/extensions/behavior/Resizable/Resizable.css +38 -0
  121. package/build/esm/extensions/behavior/Resizable/Resizable.d.ts +10 -0
  122. package/build/esm/extensions/behavior/Resizable/Resizable.js +10 -0
  123. package/build/esm/extensions/markdown/Table/actions/innerActions.d.ts +1 -1
  124. package/build/esm/extensions/markdown/Table/plugins/TableCellContextPlugin/index.js +19 -9
  125. package/build/esm/extensions/yfm/GPT/ErrorScreen/ErrorScreen.css +18 -0
  126. package/build/esm/extensions/yfm/GPT/ErrorScreen/ErrorScreen.d.ts +9 -0
  127. package/build/esm/extensions/yfm/GPT/ErrorScreen/ErrorScreen.js +17 -0
  128. package/build/esm/extensions/yfm/GPT/ErrorScreen/types.d.ts +14 -0
  129. package/build/esm/extensions/yfm/GPT/ErrorScreen/types.js +1 -0
  130. package/build/esm/extensions/yfm/GPT/GptDialog/GptDialog.css +75 -0
  131. package/build/esm/extensions/yfm/GPT/GptDialog/GptDialog.d.ts +29 -0
  132. package/build/esm/extensions/yfm/GPT/GptDialog/GptDialog.js +98 -0
  133. package/build/esm/extensions/yfm/GPT/GptDialog/LoadingScreen/LoadingScreen.css +22 -0
  134. package/build/esm/extensions/yfm/GPT/GptDialog/LoadingScreen/LoadingScreen.d.ts +4 -0
  135. package/build/esm/extensions/yfm/GPT/GptDialog/LoadingScreen/LoadingScreen.js +17 -0
  136. package/build/esm/extensions/yfm/GPT/IconRefuge/IconRefuge.classname.d.ts +1 -0
  137. package/build/esm/extensions/yfm/GPT/IconRefuge/IconRefuge.classname.js +2 -0
  138. package/build/esm/extensions/yfm/GPT/IconRefuge/IconRefuge.css +8 -0
  139. package/build/esm/extensions/yfm/GPT/IconRefuge/IconRefuge.d.ts +15 -0
  140. package/build/esm/extensions/yfm/GPT/IconRefuge/IconRefuge.js +25 -0
  141. package/build/esm/extensions/yfm/GPT/IconRefuge/index.d.ts +2 -0
  142. package/build/esm/extensions/yfm/GPT/IconRefuge/index.js +1 -0
  143. package/build/esm/extensions/yfm/GPT/PresetList/PresetList.d.ts +10 -0
  144. package/build/esm/extensions/yfm/GPT/PresetList/PresetList.js +25 -0
  145. package/build/esm/extensions/yfm/GPT/PresetList/Presetlist.css +6 -0
  146. package/build/esm/extensions/yfm/GPT/actions.d.ts +2 -0
  147. package/build/esm/extensions/yfm/GPT/actions.js +10 -0
  148. package/build/esm/extensions/yfm/GPT/commands.d.ts +2 -0
  149. package/build/esm/extensions/yfm/GPT/commands.js +9 -0
  150. package/build/esm/extensions/yfm/GPT/constants.d.ts +13 -0
  151. package/build/esm/extensions/yfm/GPT/constants.js +12 -0
  152. package/build/esm/extensions/yfm/GPT/gptExtension/gptExtension.d.ts +13 -0
  153. package/build/esm/extensions/yfm/GPT/gptExtension/gptExtension.js +14 -0
  154. package/build/esm/extensions/yfm/GPT/gptExtension/view.css +17 -0
  155. package/build/esm/extensions/yfm/GPT/gptExtension/view.d.ts +37 -0
  156. package/build/esm/extensions/yfm/GPT/gptExtension/view.js +167 -0
  157. package/build/esm/extensions/yfm/GPT/hooks/useGpt.d.ts +27 -0
  158. package/build/esm/extensions/yfm/GPT/hooks/useGpt.js +144 -0
  159. package/build/esm/extensions/yfm/GPT/hooks/useGptHotKeys.d.ts +2 -0
  160. package/build/esm/extensions/yfm/GPT/hooks/useGptHotKeys.js +4 -0
  161. package/build/esm/extensions/yfm/GPT/hooks/useOverflowingHorizontalItems.d.ts +13 -0
  162. package/build/esm/extensions/yfm/GPT/hooks/useOverflowingHorizontalItems.js +65 -0
  163. package/build/esm/extensions/yfm/GPT/hooks/usePresetList.d.ts +14 -0
  164. package/build/esm/extensions/yfm/GPT/hooks/usePresetList.js +32 -0
  165. package/build/esm/extensions/yfm/GPT/index.d.ts +2 -0
  166. package/build/esm/extensions/yfm/GPT/index.js +2 -0
  167. package/build/esm/extensions/yfm/GPT/plugin.d.ts +13 -0
  168. package/build/esm/extensions/yfm/GPT/plugin.js +43 -0
  169. package/build/esm/extensions/yfm/GPT/toolbar.d.ts +3 -0
  170. package/build/esm/extensions/yfm/GPT/toolbar.js +18 -0
  171. package/build/esm/extensions/yfm/GPT/utils.d.ts +13 -0
  172. package/build/esm/extensions/yfm/GPT/utils.js +23 -0
  173. package/build/esm/extensions/yfm/ImgSize/plugins/ImgSizeNodeView/ImgSettingsButton.css +6 -0
  174. package/build/esm/extensions/yfm/ImgSize/plugins/ImgSizeNodeView/ImgSettingsButton.d.ts +7 -1
  175. package/build/esm/extensions/yfm/ImgSize/plugins/ImgSizeNodeView/ImgSettingsButton.js +23 -38
  176. package/build/esm/extensions/yfm/ImgSize/plugins/ImgSizeNodeView/NodeView.d.ts +1 -1
  177. package/build/esm/extensions/yfm/ImgSize/plugins/ImgSizeNodeView/NodeView.js +63 -5
  178. package/build/esm/extensions/yfm/Mermaid/MermaidNodeView/MermaidView.js +5 -4
  179. package/build/esm/extensions/yfm/YfmTable/plugins/YfmTableControls/actions.d.ts +1 -1
  180. package/build/esm/extensions/yfm/YfmTable/plugins/YfmTableControls/actions.js +1 -9
  181. package/build/esm/extensions/yfm/index.d.ts +1 -0
  182. package/build/esm/extensions/yfm/index.js +1 -0
  183. package/build/esm/i18n/gpt/dialog/en.json +16 -0
  184. package/build/esm/i18n/gpt/dialog/index.d.ts +19 -0
  185. package/build/esm/i18n/gpt/dialog/index.js +4 -0
  186. package/build/esm/i18n/gpt/dialog/ru.json +16 -0
  187. package/build/esm/i18n/gpt/errors/en.json +5 -0
  188. package/build/esm/i18n/gpt/errors/index.d.ts +8 -0
  189. package/build/esm/i18n/gpt/errors/index.js +4 -0
  190. package/build/esm/i18n/gpt/errors/ru.json +5 -0
  191. package/build/esm/i18n/gpt/extension/en.json +6 -0
  192. package/build/esm/i18n/gpt/extension/index.d.ts +9 -0
  193. package/build/esm/i18n/gpt/extension/index.js +4 -0
  194. package/build/esm/i18n/gpt/extension/ru.json +6 -0
  195. package/build/esm/i18n/gpt/loading/en.json +3 -0
  196. package/build/esm/i18n/gpt/loading/index.d.ts +6 -0
  197. package/build/esm/i18n/gpt/loading/index.js +4 -0
  198. package/build/esm/i18n/gpt/loading/ru.json +3 -0
  199. package/build/esm/i18n/menubar/en.json +1 -0
  200. package/build/esm/i18n/menubar/index.d.ts +2 -1
  201. package/build/esm/i18n/menubar/ru.json +1 -0
  202. package/build/esm/i18n/yfm-table/en.json +10 -1
  203. package/build/esm/i18n/yfm-table/index.d.ts +10 -1
  204. package/build/esm/i18n/yfm-table/ru.json +10 -1
  205. package/build/esm/icons/GPT.d.ts +2 -0
  206. package/build/esm/icons/GPT.js +19 -0
  207. package/build/esm/icons/GPTLoading.d.ts +2 -0
  208. package/build/esm/icons/GPTLoading.js +9 -0
  209. package/build/esm/icons/index.d.ts +3 -1
  210. package/build/esm/icons/index.js +3 -1
  211. package/build/esm/react-utils/useAutoFocus.d.ts +1 -1
  212. package/build/esm/react-utils/useAutoFocus.js +2 -2
  213. package/build/esm/react-utils/useNodeEditing.d.ts +3 -2
  214. package/build/esm/react-utils/useNodeEditing.js +1 -1
  215. package/build/esm/react-utils/useNodeResizing.d.ts +22 -0
  216. package/build/esm/react-utils/useNodeResizing.js +77 -0
  217. package/build/esm/table-utils/commands/appendColumn.js +44 -35
  218. package/build/esm/table-utils/commands/appendRow.js +42 -24
  219. package/build/esm/table-utils/commands/removeColumn.js +18 -20
  220. package/build/esm/table-utils/commands/removeRow.js +14 -11
  221. package/build/esm/table-utils/table-desc.d.ts +53 -0
  222. package/build/esm/table-utils/table-desc.js +144 -0
  223. package/build/esm/table-utils/utils.d.ts +1 -1
  224. package/build/esm/table-utils/utils.js +18 -12
  225. package/build/esm/version.js +1 -1
  226. package/build/styles.css +190 -0
  227. package/package.json +3 -2
@@ -1,35 +1,53 @@
1
- import { Fragment } from 'prosemirror-model';
2
- import { findChildren, findParentNodeClosestToPos } from 'prosemirror-utils';
3
- import { findChildTableRows, isTableBodyNode, isTableNode, isTableRowNode } from '..';
1
+ import { findParentNodeClosestToPos } from 'prosemirror-utils';
2
+ import { isTableNode } from '..';
3
+ import { TableDesc } from '../table-desc';
4
4
  export const appendRow = (state, dispatch, _, attrs) => {
5
- var _a;
6
5
  if (!attrs)
7
6
  return false;
8
- const { tablePos, rowNumber, direction } = attrs;
9
- const tableNode = (_a = findParentNodeClosestToPos(state.doc.resolve(tablePos + 1), isTableNode)) === null || _a === void 0 ? void 0 : _a.node;
10
- if (!tableNode)
7
+ const { tablePos, rowNumber, direction = 'after' } = attrs;
8
+ const res = findParentNodeClosestToPos(state.doc.resolve(tablePos + 1), isTableNode);
9
+ if (!res)
11
10
  return false;
12
- const parentBody = findChildren(tableNode, isTableBodyNode, false).pop();
13
- if (!parentBody)
11
+ const tableNode = res.node;
12
+ const tableDesc = TableDesc.create(tableNode);
13
+ if (!tableDesc)
14
14
  return false;
15
- let parentRow;
16
- if (rowNumber !== undefined) {
17
- parentRow = findChildTableRows(tableNode)[rowNumber];
15
+ const rowIndex = rowNumber !== null && rowNumber !== void 0 ? rowNumber : tableDesc.rows - 1; // if rowNumber is not defined, that means last row
16
+ const isFirstRow = rowIndex === 0;
17
+ const isLastRow = rowIndex === tableDesc.rows - 1;
18
+ let pos = -1;
19
+ if (isFirstRow && direction === 'before')
20
+ pos = tableDesc.getRelativePosForRow(0).from;
21
+ if (isLastRow && direction === 'after')
22
+ pos = tableDesc.getRelativePosForRow(tableDesc.rows - 1).to;
23
+ if (pos === -1) {
24
+ if (tableDesc.rows <= rowIndex)
25
+ return false;
26
+ if (tableDesc.isSafeRow(rowIndex)) {
27
+ const rowPos = tableDesc.getRelativePosForRow(rowIndex);
28
+ if (direction === 'before')
29
+ pos = rowPos.from;
30
+ if (direction === 'after')
31
+ pos = rowPos.to;
32
+ }
33
+ else {
34
+ if (direction === 'before' && tableDesc.isSafeRow(rowIndex - 1))
35
+ pos = tableDesc.getRelativePosForRow(rowIndex - 1).to;
36
+ if (direction === 'after' && tableDesc.isSafeRow(rowIndex + 1))
37
+ pos = tableDesc.getRelativePosForRow(rowIndex + 1).from;
38
+ }
18
39
  }
19
- else {
20
- parentRow = findChildren(parentBody.node, isTableRowNode, false).pop();
21
- }
22
- if (!parentRow) {
40
+ if (pos === -1)
23
41
  return false;
24
- }
25
42
  if (dispatch) {
26
- const newCellNodes = [];
27
- parentRow.node.forEach((node) => {
28
- newCellNodes.push(node.type.createAndFill(node.attrs));
29
- });
30
- let position = tablePos + parentRow.pos;
31
- position += direction === 'before' ? 1 : parentRow.node.nodeSize + 1;
32
- dispatch(state.tr.insert(position, parentRow.node.copy(Fragment.from(newCellNodes))));
43
+ const cells = getNodes(tableDesc.getCellNodeType(), tableDesc.cols);
44
+ dispatch(state.tr.insert(res.pos + pos, tableDesc.getRowNodeType().create(null, cells)));
33
45
  }
34
46
  return true;
35
47
  };
48
+ function getNodes(type, count) {
49
+ const nodes = [];
50
+ for (let i = 0; i < count; i++)
51
+ nodes.push(type.createAndFill());
52
+ return nodes;
53
+ }
@@ -1,5 +1,5 @@
1
- import { isTableNode } from '..';
2
- import { isTableBodyNode, isTableCellNode, isTableRowNode } from '../utils';
1
+ import { TableDesc } from '../table-desc';
2
+ import { isTableNode } from '../utils';
3
3
  export const removeColumn = (state, dispatch, _, attrs = {}) => {
4
4
  const { tablePos, columnNumber } = attrs;
5
5
  if (typeof tablePos !== 'number' || typeof columnNumber !== 'number')
@@ -11,28 +11,26 @@ export const removeColumn = (state, dispatch, _, attrs = {}) => {
11
11
  const tableNode = state.doc.nodeAt(tablePos);
12
12
  if (!tableNode || tableNode.nodeSize <= 2 || !isTableNode(tableNode))
13
13
  return false;
14
- const tableBodyNode = tableNode.firstChild;
15
- if (!tableBodyNode || tableBodyNode.nodeSize <= 2 || !isTableBodyNode(tableBodyNode))
14
+ const tableDesc = TableDesc.create(tableNode);
15
+ if (!tableDesc)
16
16
  return false;
17
- // there is one column left
18
- if (tableBodyNode.firstChild && tableBodyNode.firstChild.childCount < 2)
17
+ if (!tableDesc ||
18
+ // there is one column left
19
+ tableDesc.cols < 2 ||
20
+ tableDesc.cols <= columnNumber ||
21
+ !tableDesc.isSafeColumn(columnNumber))
19
22
  return false;
20
23
  if (dispatch) {
21
24
  const { tr } = state;
22
- tableBodyNode.forEach((rowNode, rowOffset) => {
23
- if (!isTableRowNode(rowNode))
24
- return;
25
- rowNode.forEach((cellNode, cellOffset, cellIndex) => {
26
- if (!isTableCellNode(cellNode))
27
- return;
28
- if (cellIndex === columnNumber) {
29
- // table -> tbody -> tr -> td
30
- const from = tablePos + 2 + rowOffset + 1 + cellOffset;
31
- const to = from + cellNode.nodeSize;
32
- tr.delete(tr.mapping.map(from), tr.mapping.map(to));
33
- }
34
- });
35
- });
25
+ const pos = tableDesc.getRelativePosForColumn(columnNumber);
26
+ for (const item of pos) {
27
+ if (item.type === 'real') {
28
+ let { from, to } = item;
29
+ from += tablePos;
30
+ to += tablePos;
31
+ tr.delete(tr.mapping.map(from), tr.mapping.map(to));
32
+ }
33
+ }
36
34
  dispatch(tr);
37
35
  }
38
36
  return true;
@@ -1,8 +1,8 @@
1
1
  import { Fragment } from 'prosemirror-model';
2
- import { findChildren, findParentNodeClosestToPos } from 'prosemirror-utils';
3
- import { findChildTableBody, isTableNode, isTableRowNode } from '..';
2
+ import { findParentNodeClosestToPos } from 'prosemirror-utils';
3
+ import { isTableNode } from '..';
4
4
  import { trackTransactionMetrics } from '../../core';
5
- import { findChildTableRows } from '../utils';
5
+ import { TableDesc } from '../table-desc';
6
6
  export const removeRow = (state, dispatch, _, attrs = {}) => {
7
7
  var _a;
8
8
  const { tablePos, rowNumber } = attrs;
@@ -11,16 +11,19 @@ export const removeRow = (state, dispatch, _, attrs = {}) => {
11
11
  const tableNode = (_a = findParentNodeClosestToPos(state.doc.resolve(tablePos + 1), isTableNode)) === null || _a === void 0 ? void 0 : _a.node;
12
12
  if (!tableNode)
13
13
  return false;
14
- const parentRows = findChildren(tableNode, isTableRowNode);
15
- const parentBody = findChildTableBody(tableNode)[0];
16
- const parentRow = parentRows[rowNumber];
17
- if (!parentRows.length || !parentBody) {
14
+ const tableDesc = TableDesc.create(tableNode);
15
+ if (!tableDesc || rowNumber >= tableDesc.rows)
18
16
  return false;
19
- }
20
- if (findChildTableRows(parentBody.node).length < 2) {
21
- // there is one row left
17
+ if (!tableDesc.isSafeRow(rowNumber))
22
18
  return false;
19
+ if (dispatch) {
20
+ let { from, to } = tableDesc.getRelativePosForRow(rowNumber);
21
+ from += tablePos;
22
+ to += tablePos;
23
+ dispatch(trackTransactionMetrics(state.tr.replaceWith(from, to, Fragment.empty), 'removeRow', {
24
+ rows: tableDesc.rows,
25
+ cols: tableDesc.cols,
26
+ }));
23
27
  }
24
- dispatch === null || dispatch === void 0 ? void 0 : dispatch(trackTransactionMetrics(state.tr.replaceWith(tablePos + parentRow.pos, tablePos + parentRow.pos + parentRow.node.nodeSize + 1, Fragment.empty), 'removeRow', { rows: parentRows.length, cols: parentRow.node.childCount }));
25
28
  return true;
26
29
  };
@@ -0,0 +1,53 @@
1
+ import type { Node } from 'prosemirror-model';
2
+ declare type TableCellRealDesc = {
3
+ type: 'real';
4
+ offset: number;
5
+ node: Node;
6
+ colspan?: number;
7
+ rowspan?: number;
8
+ };
9
+ declare type TableCellVirtualDesc = {
10
+ type: 'virtual';
11
+ /** Index of real cell, that prodeced this virtual cell */
12
+ colspan?: [number, number];
13
+ /** Index of real cell, that prodeced this virtual cell */
14
+ rowspan?: [number, number];
15
+ };
16
+ declare type Pos = {
17
+ from: number;
18
+ to: number;
19
+ };
20
+ export declare type CellPos = ({
21
+ type: 'real';
22
+ } & Pos) | {
23
+ type: 'virtual';
24
+ closestPos: number;
25
+ };
26
+ declare type TableCellDesc = TableCellRealDesc | TableCellVirtualDesc;
27
+ declare type TableRowDesc = {
28
+ node: Node;
29
+ cells: TableCellDesc[];
30
+ offset: number;
31
+ colspan?: boolean;
32
+ rowspan?: boolean;
33
+ };
34
+ export declare class TableDesc {
35
+ readonly rows: number;
36
+ readonly cols: number;
37
+ readonly rowsDesc: readonly TableRowDesc[];
38
+ readonly baseOffset: number;
39
+ private static __cache;
40
+ static create(table: Node): TableDesc | null;
41
+ private constructor();
42
+ rowHasVirtualCells(rowIndex: number): boolean;
43
+ columnHasVirtualCells(columnIndex: number): boolean;
44
+ isSafeColumn(columnIndex: number): boolean;
45
+ isSafeRow(rowIndex: number): boolean;
46
+ getOffsetForRow(rowIndex: number): number;
47
+ getRelativePosForRow(rowIndex: number): Pos;
48
+ getRelativePosForCell(rowIndex: number, columnIndex: number): CellPos;
49
+ getRelativePosForColumn(columnIndex: number): CellPos[];
50
+ getCellNodeType(): import("prosemirror-model").NodeType;
51
+ getRowNodeType(): import("prosemirror-model").NodeType;
52
+ }
53
+ export {};
@@ -0,0 +1,144 @@
1
+ import isNumber from 'is-number';
2
+ import { isTableBodyNode, isTableNode } from './utils';
3
+ export class TableDesc {
4
+ constructor(
5
+ /* eslint-disable @typescript-eslint/parameter-properties */
6
+ rows, cols, rowsDesc, baseOffset) {
7
+ this.rows = rows;
8
+ this.cols = cols;
9
+ this.rowsDesc = rowsDesc;
10
+ this.baseOffset = baseOffset;
11
+ }
12
+ static create(table) {
13
+ if (this.__cache.has(table))
14
+ return this.__cache.get(table);
15
+ if (!isTableNode(table))
16
+ return null;
17
+ const tbody = table.lastChild;
18
+ if (!tbody || !isTableBodyNode(tbody))
19
+ return null;
20
+ // table –> tbody -> ...
21
+ const baseOffset = 2;
22
+ const rows = [];
23
+ tbody.forEach((trow, offset) => {
24
+ rows.push({ node: trow, offset, cells: [] });
25
+ });
26
+ tbody.forEach((trow, _1, trowIndex) => {
27
+ trow.forEach((tcell, offset, tcellRealIndex) => {
28
+ var _a;
29
+ const rowDesc = rows[trowIndex];
30
+ let tcellIndex = tcellRealIndex;
31
+ while (rowDesc.cells[tcellIndex]) {
32
+ tcellIndex++;
33
+ }
34
+ const cellDesc = (rowDesc.cells[tcellIndex] = {
35
+ type: 'real',
36
+ node: tcell,
37
+ offset,
38
+ });
39
+ const map = [trowIndex, tcellIndex];
40
+ if (isNumber(tcell.attrs['colspan'])) {
41
+ rowDesc.colspan = true;
42
+ const colspan = (cellDesc.colspan = parseInt(tcell.attrs['colspan'], 10));
43
+ for (let i = 1; i < colspan; i++) {
44
+ rowDesc.cells[tcellIndex + i] = {
45
+ type: 'virtual',
46
+ colspan: map,
47
+ };
48
+ }
49
+ }
50
+ if (isNumber(tcell.attrs['rowspan'])) {
51
+ rowDesc.rowspan = true;
52
+ const rowspan = (cellDesc.rowspan = parseInt(tcell.attrs['rowspan'], 10));
53
+ for (let i = 1; i < rowspan; i++) {
54
+ const colspan = (_a = cellDesc.colspan) !== null && _a !== void 0 ? _a : 1;
55
+ for (let j = 0; j < colspan; j++)
56
+ rows[trowIndex + i].cells[tcellIndex + j] = {
57
+ type: 'virtual',
58
+ rowspan: map,
59
+ };
60
+ }
61
+ }
62
+ });
63
+ });
64
+ const desc = new this(rows.length, rows[0].cells.length, rows, baseOffset);
65
+ this.__cache.set(table, desc);
66
+ return desc;
67
+ }
68
+ rowHasVirtualCells(rowIndex) {
69
+ var _a;
70
+ return (_a = this.rowsDesc[rowIndex]) === null || _a === void 0 ? void 0 : _a.cells.some((cell) => cell.type === 'virtual');
71
+ }
72
+ columnHasVirtualCells(columnIndex) {
73
+ return this.rowsDesc.some((row) => { var _a; return ((_a = row.cells[columnIndex]) === null || _a === void 0 ? void 0 : _a.type) === 'virtual'; });
74
+ }
75
+ isSafeColumn(columnIndex) {
76
+ return this.rowsDesc.every((row) => {
77
+ var _a;
78
+ const cell = row.cells[columnIndex];
79
+ if (cell.type === 'real' && (!cell.colspan || cell.colspan === 1))
80
+ return true;
81
+ if (cell.type === 'virtual' && ((_a = cell.rowspan) === null || _a === void 0 ? void 0 : _a[1]) === columnIndex)
82
+ return true;
83
+ return false;
84
+ });
85
+ }
86
+ isSafeRow(rowIndex) {
87
+ var _a;
88
+ return (_a = this.rowsDesc[rowIndex]) === null || _a === void 0 ? void 0 : _a.cells.every((cell) => {
89
+ var _a;
90
+ if (cell.type === 'real' && (!cell.rowspan || cell.rowspan === 1))
91
+ return true;
92
+ if (cell.type === 'virtual' && ((_a = cell.colspan) === null || _a === void 0 ? void 0 : _a[0]) === rowIndex)
93
+ return true;
94
+ return false;
95
+ });
96
+ }
97
+ getOffsetForRow(rowIndex) {
98
+ var _a;
99
+ return this.baseOffset + ((_a = this.rowsDesc[rowIndex]) === null || _a === void 0 ? void 0 : _a.offset);
100
+ }
101
+ getRelativePosForRow(rowIndex) {
102
+ const from = this.getOffsetForRow(rowIndex);
103
+ const to = from + this.rowsDesc[rowIndex].node.nodeSize;
104
+ return { from, to };
105
+ }
106
+ getRelativePosForCell(rowIndex, columnIndex) {
107
+ var _a;
108
+ const cell = (_a = this.rowsDesc[rowIndex]) === null || _a === void 0 ? void 0 : _a.cells[columnIndex];
109
+ const rowOffset = this.getOffsetForRow(rowIndex);
110
+ if ((cell === null || cell === void 0 ? void 0 : cell.type) === 'real') {
111
+ // 1 – open boundary for row node
112
+ const from = rowOffset + 1 + cell.offset;
113
+ const to = from + cell.node.nodeSize;
114
+ return { type: 'real', from, to };
115
+ }
116
+ if ((cell === null || cell === void 0 ? void 0 : cell.type) === 'virtual') {
117
+ let index = columnIndex;
118
+ while (--index >= 0) {
119
+ const cell = this.rowsDesc[rowIndex].cells[index];
120
+ if (cell.type === 'real') {
121
+ const closest = rowOffset + 1 + cell.offset + cell.node.nodeSize;
122
+ return { type: 'virtual', closestPos: closest };
123
+ }
124
+ }
125
+ return { type: 'virtual', closestPos: rowOffset + 1 };
126
+ }
127
+ throw new Error(`Impossible to calculate offset for cell with position [${rowIndex},${columnIndex}]`);
128
+ }
129
+ getRelativePosForColumn(columnIndex) {
130
+ const ranges = [];
131
+ for (let i = 0; i < this.rows; i++) {
132
+ ranges.push(this.getRelativePosForCell(i, columnIndex));
133
+ }
134
+ return ranges;
135
+ }
136
+ getCellNodeType() {
137
+ const isRealCell = (cell) => cell.type === 'real';
138
+ return this.rowsDesc[0].cells.find(isRealCell).node.type;
139
+ }
140
+ getRowNodeType() {
141
+ return this.rowsDesc[0].node.type;
142
+ }
143
+ }
144
+ TableDesc.__cache = new WeakMap();
@@ -25,7 +25,7 @@ export declare const findChildTableBody: (node: PmNode) => {
25
25
  node: PmNode;
26
26
  pos: number;
27
27
  }[];
28
- export declare const getTableDimensions: (node: PmNode | Node) => {
28
+ export declare const getTableDimensions: (node: PmNode) => {
29
29
  rows: number;
30
30
  cols: number;
31
31
  };
@@ -1,4 +1,4 @@
1
- import { Node as PmNode } from 'prosemirror-model';
1
+ import isNumber from 'is-number';
2
2
  import { findChildren, findParentNode, findParentNodeClosestToPos, } from 'prosemirror-utils';
3
3
  import { isTextSelection } from '../utils/selection';
4
4
  import { TableRole } from './const';
@@ -18,17 +18,23 @@ export const findChildTableRows = (node) => findChildren(node, isTableRowNode);
18
18
  export const findChildTableCells = (node) => findChildren(node, isTableCellNode);
19
19
  export const findChildTableBody = (node) => findChildren(node, isTableBodyNode);
20
20
  export const getTableDimensions = (node) => {
21
- var _a, _b, _c, _d, _e, _f;
22
- let rows, cols;
23
- if (node instanceof PmNode) {
24
- rows = (_a = node.firstChild) === null || _a === void 0 ? void 0 : _a.childCount;
25
- cols = (_c = (_b = node.firstChild) === null || _b === void 0 ? void 0 : _b.firstChild) === null || _c === void 0 ? void 0 : _c.childCount;
26
- }
27
- else {
28
- rows = (_d = node.firstChild) === null || _d === void 0 ? void 0 : _d.childNodes.length;
29
- cols = (_f = (_e = node.firstChild) === null || _e === void 0 ? void 0 : _e.firstChild) === null || _f === void 0 ? void 0 : _f.childNodes.length;
30
- }
31
- return { rows: rows || 1, cols: cols || 1 };
21
+ let rows = 0, cols = 0;
22
+ const tbody = node.firstChild;
23
+ tbody === null || tbody === void 0 ? void 0 : tbody.forEach((trow, _1, trowIndex) => {
24
+ rows++;
25
+ if (trowIndex === 0) {
26
+ trow.forEach((tcell, _2) => {
27
+ const cellAttrs = tcell.attrs;
28
+ if (isNumber(cellAttrs['colspan'])) {
29
+ cols += parseInt(cellAttrs['colspan'], 10);
30
+ }
31
+ else {
32
+ cols++;
33
+ }
34
+ });
35
+ }
36
+ });
37
+ return { rows, cols };
32
38
  };
33
39
  export function atEndOfCell(view, dir) {
34
40
  if (!isTextSelection(view.state.selection))
@@ -1,2 +1,2 @@
1
1
  /** During build process, the current version will be injected here */
2
- export const VERSION = typeof '13.17.0' !== 'undefined' ? '13.17.0' : 'unknown';
2
+ export const VERSION = typeof '13.18.0' !== 'undefined' ? '13.18.0' : 'unknown';
package/build/styles.css CHANGED
@@ -823,6 +823,44 @@ img.ProseMirror-separator {
823
823
  animation: placeholder_blink 1s;
824
824
  animation-iteration-count: infinite;
825
825
  }
826
+ body :has(.g-md-resizable_resizing) {
827
+ cursor: col-resize;
828
+ }
829
+
830
+ .g-md-resizable {
831
+ position: relative;
832
+ }
833
+ .g-md-resizable_resizing .g-md-resizable__resizer-wrapper, .g-md-resizable_hover .g-md-resizable__resizer-wrapper {
834
+ position: absolute;
835
+ z-index: 1;
836
+ top: 0;
837
+ display: flex;
838
+ justify-content: center;
839
+ align-items: center;
840
+ width: 20px;
841
+ height: 100%;
842
+ cursor: col-resize;
843
+ pointer-events: auto;
844
+ }
845
+ .g-md-resizable_resizing .g-md-resizable__resizer-wrapper_left, .g-md-resizable_hover .g-md-resizable__resizer-wrapper_left {
846
+ left: 0;
847
+ }
848
+ .g-md-resizable_resizing .g-md-resizable__resizer-wrapper_right, .g-md-resizable_hover .g-md-resizable__resizer-wrapper_right {
849
+ right: 0;
850
+ }
851
+ .g-md-resizable__resizer {
852
+ opacity: 0;
853
+ }
854
+ .g-md-resizable_resizing .g-md-resizable__resizer, .g-md-resizable_hover .g-md-resizable__resizer {
855
+ box-sizing: content-box;
856
+ width: 4px;
857
+ height: 50px;
858
+ max-height: 50%;
859
+ opacity: 1;
860
+ border-radius: 6px;
861
+ background: rgba(127, 127, 127, 0.8);
862
+ transition: opacity 300ms ease-in 0s;
863
+ }
826
864
  .g-md-editor.ProseMirror-focused .pm-node-selected {
827
865
  box-shadow: var(--g-color-text-info) 0 0 0 1px;
828
866
  }
@@ -1204,6 +1242,130 @@ img.ProseMirror-separator {
1204
1242
  line-height: var(--g-text-body-1-line-height);
1205
1243
  font-weight: var(--g-text-body-font-weight);
1206
1244
  }
1245
+ .g-md-gpt-dialog-error-screen__content {
1246
+ display: flex;
1247
+ align-items: center;
1248
+ margin-bottom: var(--g-spacing-2);
1249
+ }
1250
+ .g-md-gpt-dialog-error-screen__icon {
1251
+ color: var(--g-color-base-danger-heavy);
1252
+ }
1253
+ .g-md-gpt-dialog-error-screen__text {
1254
+ flex: auto;
1255
+ font-size: var(--g-text-body-2-font-size);
1256
+ font-weight: 500;
1257
+ }
1258
+ .g-md-gpt-dialog-error-screen__buttons {
1259
+ display: flex;
1260
+ align-items: center;
1261
+ gap: var(--g-spacing-2);
1262
+ }
1263
+ .g-md-gpt-dialog__header-top {
1264
+ display: flex;
1265
+ align-items: center;
1266
+ }
1267
+ .g-md-gpt-dialog__custom-prompt-input {
1268
+ margin-right: var(--g-spacing-2);
1269
+ }
1270
+ .g-md-gpt-dialog__custom-prompt-input .g-text-input__control {
1271
+ font-size: var(--g-text-body-2-font-size);
1272
+ }
1273
+ .g-md-gpt-dialog__header-bottom {
1274
+ margin-top: var(--g-spacing-2);
1275
+ }
1276
+ .g-md-gpt-dialog__custom-prompt {
1277
+ display: flex;
1278
+ flex: auto;
1279
+ align-items: center;
1280
+ }
1281
+ .g-md-gpt-dialog__alone-presets-text {
1282
+ margin-right: var(--g-spacing-8);
1283
+ }
1284
+ .g-md-gpt-dialog__alone-presets {
1285
+ display: flex;
1286
+ flex: auto;
1287
+ align-items: center;
1288
+ width: 100%;
1289
+ font-size: var(--g-text-body-2-font-size);
1290
+ font-weight: 500;
1291
+ }
1292
+ .g-md-gpt-dialog__alone-presets .g-md-gpt-dialog-preset-list {
1293
+ flex: auto;
1294
+ }
1295
+ .g-md-gpt-dialog__answer-title {
1296
+ font-size: var(--g-text-body-2-font-size);
1297
+ font-weight: 500;
1298
+ }
1299
+ .g-md-gpt-dialog__gpt-icon {
1300
+ margin-right: var(--g-spacing-1);
1301
+ }
1302
+ .g-md-gpt-dialog__try-again-button {
1303
+ margin-right: var(--g-spacing-2);
1304
+ }
1305
+ .g-md-gpt-dialog__body {
1306
+ margin: var(--g-spacing-2) calc(-1 * var(--g-spacing-3));
1307
+ padding: var(--g-spacing-4) var(--g-spacing-3);
1308
+ border-top: 1px solid var(--g-color-line-generic);
1309
+ }
1310
+ .g-md-gpt-dialog__answer {
1311
+ overflow: auto;
1312
+ max-height: 300px;
1313
+ }
1314
+ .g-md-gpt-dialog__answer-actions {
1315
+ display: flex;
1316
+ align-items: center;
1317
+ }
1318
+ .g-md-gpt-dialog__feedback-message {
1319
+ margin-left: var(--g-spacing-2);
1320
+ }
1321
+ .g-md-gpt-dialog__like-button {
1322
+ margin-right: var(--g-spacing-2);
1323
+ }
1324
+ .g-md-gpt-dialog__close-button {
1325
+ margin-right: var(--g-spacing-2);
1326
+ margin-left: auto;
1327
+ }
1328
+ .g-md-gpt-dialog__footer {
1329
+ display: flex;
1330
+ align-items: center;
1331
+ margin-top: var(--g-spacing-2);
1332
+ }
1333
+ .g-md-gpt-dialog__description-alert {
1334
+ min-height: 34px;
1335
+ margin-top: var(--g-spacing-3);
1336
+ padding: var(--g-spacing-1) var(--g-spacing-2);
1337
+ }
1338
+ .icon-refuge {
1339
+ display: inline-flex;
1340
+ justify-content: center;
1341
+ align-items: center;
1342
+ }
1343
+ .icon-refuge_inline {
1344
+ display: inline-flex;
1345
+ }
1346
+ .g-md-gpt-dialog-preset-list__preset + .g-md-gpt-dialog-preset-list__preset {
1347
+ margin-left: var(--g-spacing-2);
1348
+ }
1349
+ .g-md-gpt-dialog-preset-list__more-button-wrapper {
1350
+ margin-left: var(--g-spacing-2);
1351
+ }
1352
+ .g-md-gpt-widget-deco {
1353
+ background-color: var(--g-color-base-info-light-hover);
1354
+ }
1355
+
1356
+ .g-md-gpt-popup {
1357
+ --layer-navigation-bar: 900;
1358
+ pointer-events: initial;
1359
+ }
1360
+ .g-md-gpt-popup[class] {
1361
+ border-radius: var(--g-spacing-2);
1362
+ }
1363
+ .g-md-gpt-popup__content {
1364
+ width: 720px;
1365
+ padding: var(--g-spacing-3);
1366
+ pointer-events: all;
1367
+ box-shadow: -8px 2px 16px -4px var(--g-color-private-purple-150), 8px 2px 16px -4px var(--g-color-private-blue-150);
1368
+ }
1207
1369
  .g-md-image-skeleton {
1208
1370
  vertical-align: middle;
1209
1371
  }
@@ -1387,10 +1549,38 @@ img.ProseMirror-separator {
1387
1549
  .table-cell-floating-icon {
1388
1550
  transform: rotate(90deg);
1389
1551
  }
1552
+ .g-md-gpt-dialog-loading-screen__header {
1553
+ display: flex;
1554
+ align-items: center;
1555
+ margin-bottom: 8px;
1556
+ }
1557
+ .g-md-gpt-dialog-loading-screen__icon {
1558
+ margin-right: 4px;
1559
+ }
1560
+ .g-md-gpt-dialog-loading-screen__text {
1561
+ margin-right: 8px;
1562
+ font-size: var(--g-text-body-2-font-size);
1563
+ font-weight: 500;
1564
+ }
1565
+ .g-md-gpt-dialog-loading-screen__skeleton-small-button {
1566
+ width: 90px;
1567
+ height: 28px;
1568
+ margin-right: 8px;
1569
+ }
1570
+ .g-md-gpt-dialog-loading-screen__skeleton-medium-button {
1571
+ width: 120px;
1572
+ height: 28px;
1573
+ }
1390
1574
  .g-md-img-size-node-view__wrapper {
1391
1575
  position: relative;
1392
1576
  display: inline-block;
1393
1577
  }
1578
+ .g-md-img-settings-button {
1579
+ position: absolute;
1580
+ z-index: 2;
1581
+ top: 3px;
1582
+ right: 3px;
1583
+ }
1394
1584
  .yfm .yfm-note {
1395
1585
  max-width: 1296px;
1396
1586
  margin: 20px 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravity-ui/markdown-editor",
3
- "version": "13.17.0",
3
+ "version": "13.18.0",
4
4
  "description": "Markdown wysiwyg and markup editor",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -195,6 +195,7 @@
195
195
  "prosemirror-utils": "1.2.0",
196
196
  "prosemirror-view": "1.33.6",
197
197
  "react-error-boundary": "^3.1.4",
198
+ "react-hotkeys-hook": "4.5.0",
198
199
  "react-use": "^17.3.2",
199
200
  "tslib": "^2.3.1"
200
201
  },
@@ -278,7 +279,7 @@
278
279
  "@diplodoc/html-extension": "2.1.0",
279
280
  "@diplodoc/latex-extension": "^1.0.3",
280
281
  "@diplodoc/mermaid-extension": "^1.0.0",
281
- "@diplodoc/transform": "^4.5.0",
282
+ "@diplodoc/transform": ">=4.5.0 <4.19.0",
282
283
  "@gravity-ui/components": "^3.0.0",
283
284
  "@gravity-ui/uikit": "^6.11.0",
284
285
  "highlight.js": "^11.8.0",