@gravity-ui/markdown-editor 13.17.1 → 13.18.1

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 (197) hide show
  1. package/README.md +4 -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/Clipboard/clipboard.js +4 -1
  9. package/build/cjs/extensions/markdown/Table/actions/innerActions.d.ts +1 -1
  10. package/build/cjs/extensions/yfm/GPT/ErrorScreen/ErrorScreen.css +18 -0
  11. package/build/cjs/extensions/yfm/GPT/ErrorScreen/ErrorScreen.d.ts +8 -0
  12. package/build/cjs/extensions/yfm/GPT/ErrorScreen/ErrorScreen.js +21 -0
  13. package/build/cjs/extensions/yfm/GPT/ErrorScreen/types.d.ts +14 -0
  14. package/build/cjs/extensions/yfm/GPT/ErrorScreen/types.js +2 -0
  15. package/build/cjs/extensions/yfm/GPT/GptDialog/GptDialog.css +75 -0
  16. package/build/cjs/extensions/yfm/GPT/GptDialog/GptDialog.d.ts +28 -0
  17. package/build/cjs/extensions/yfm/GPT/GptDialog/GptDialog.js +102 -0
  18. package/build/cjs/extensions/yfm/GPT/GptDialog/LoadingScreen/LoadingScreen.css +22 -0
  19. package/build/cjs/extensions/yfm/GPT/GptDialog/LoadingScreen/LoadingScreen.d.ts +3 -0
  20. package/build/cjs/extensions/yfm/GPT/GptDialog/LoadingScreen/LoadingScreen.js +21 -0
  21. package/build/cjs/extensions/yfm/GPT/IconRefuge/IconRefuge.classname.d.ts +1 -0
  22. package/build/cjs/extensions/yfm/GPT/IconRefuge/IconRefuge.classname.js +5 -0
  23. package/build/cjs/extensions/yfm/GPT/IconRefuge/IconRefuge.css +8 -0
  24. package/build/cjs/extensions/yfm/GPT/IconRefuge/IconRefuge.d.ts +14 -0
  25. package/build/cjs/extensions/yfm/GPT/IconRefuge/IconRefuge.js +28 -0
  26. package/build/cjs/extensions/yfm/GPT/IconRefuge/index.d.ts +2 -0
  27. package/build/cjs/extensions/yfm/GPT/IconRefuge/index.js +5 -0
  28. package/build/cjs/extensions/yfm/GPT/PresetList/PresetList.d.ts +9 -0
  29. package/build/cjs/extensions/yfm/GPT/PresetList/PresetList.js +29 -0
  30. package/build/cjs/extensions/yfm/GPT/PresetList/Presetlist.css +6 -0
  31. package/build/cjs/extensions/yfm/GPT/actions.d.ts +2 -0
  32. package/build/cjs/extensions/yfm/GPT/actions.js +14 -0
  33. package/build/cjs/extensions/yfm/GPT/commands.d.ts +2 -0
  34. package/build/cjs/extensions/yfm/GPT/commands.js +13 -0
  35. package/build/cjs/extensions/yfm/GPT/constants.d.ts +13 -0
  36. package/build/cjs/extensions/yfm/GPT/constants.js +15 -0
  37. package/build/cjs/extensions/yfm/GPT/gptExtension/gptExtension.d.ts +13 -0
  38. package/build/cjs/extensions/yfm/GPT/gptExtension/gptExtension.js +18 -0
  39. package/build/cjs/extensions/yfm/GPT/gptExtension/view.css +17 -0
  40. package/build/cjs/extensions/yfm/GPT/gptExtension/view.d.ts +36 -0
  41. package/build/cjs/extensions/yfm/GPT/gptExtension/view.js +167 -0
  42. package/build/cjs/extensions/yfm/GPT/hooks/useGpt.d.ts +27 -0
  43. package/build/cjs/extensions/yfm/GPT/hooks/useGpt.js +155 -0
  44. package/build/cjs/extensions/yfm/GPT/hooks/useGptHotKeys.d.ts +2 -0
  45. package/build/cjs/extensions/yfm/GPT/hooks/useGptHotKeys.js +8 -0
  46. package/build/cjs/extensions/yfm/GPT/hooks/useOverflowingHorizontalItems.d.ts +13 -0
  47. package/build/cjs/extensions/yfm/GPT/hooks/useOverflowingHorizontalItems.js +70 -0
  48. package/build/cjs/extensions/yfm/GPT/hooks/usePresetList.d.ts +14 -0
  49. package/build/cjs/extensions/yfm/GPT/hooks/usePresetList.js +36 -0
  50. package/build/cjs/extensions/yfm/GPT/index.d.ts +2 -0
  51. package/build/cjs/extensions/yfm/GPT/index.js +5 -0
  52. package/build/cjs/extensions/yfm/GPT/plugin.d.ts +13 -0
  53. package/build/cjs/extensions/yfm/GPT/plugin.js +47 -0
  54. package/build/cjs/extensions/yfm/GPT/toolbar.d.ts +3 -0
  55. package/build/cjs/extensions/yfm/GPT/toolbar.js +22 -0
  56. package/build/cjs/extensions/yfm/GPT/utils.d.ts +13 -0
  57. package/build/cjs/extensions/yfm/GPT/utils.js +31 -0
  58. package/build/cjs/extensions/yfm/YfmTable/plugins/YfmTableControls/actions.d.ts +1 -1
  59. package/build/cjs/extensions/yfm/YfmTable/plugins/YfmTableControls/actions.js +0 -8
  60. package/build/cjs/extensions/yfm/index.d.ts +1 -0
  61. package/build/cjs/extensions/yfm/index.js +1 -0
  62. package/build/cjs/i18n/gpt/dialog/en.json +16 -0
  63. package/build/cjs/i18n/gpt/dialog/index.d.ts +19 -0
  64. package/build/cjs/i18n/gpt/dialog/index.js +8 -0
  65. package/build/cjs/i18n/gpt/dialog/ru.json +16 -0
  66. package/build/cjs/i18n/gpt/errors/en.json +5 -0
  67. package/build/cjs/i18n/gpt/errors/index.d.ts +8 -0
  68. package/build/cjs/i18n/gpt/errors/index.js +8 -0
  69. package/build/cjs/i18n/gpt/errors/ru.json +5 -0
  70. package/build/cjs/i18n/gpt/extension/en.json +6 -0
  71. package/build/cjs/i18n/gpt/extension/index.d.ts +9 -0
  72. package/build/cjs/i18n/gpt/extension/index.js +8 -0
  73. package/build/cjs/i18n/gpt/extension/ru.json +6 -0
  74. package/build/cjs/i18n/gpt/loading/en.json +3 -0
  75. package/build/cjs/i18n/gpt/loading/index.d.ts +6 -0
  76. package/build/cjs/i18n/gpt/loading/index.js +8 -0
  77. package/build/cjs/i18n/gpt/loading/ru.json +3 -0
  78. package/build/cjs/i18n/menubar/en.json +1 -0
  79. package/build/cjs/i18n/menubar/index.d.ts +2 -1
  80. package/build/cjs/i18n/menubar/ru.json +1 -0
  81. package/build/cjs/icons/GPT.d.ts +2 -0
  82. package/build/cjs/icons/GPT.js +22 -0
  83. package/build/cjs/icons/GPTLoading.d.ts +2 -0
  84. package/build/cjs/icons/GPTLoading.js +12 -0
  85. package/build/cjs/icons/index.d.ts +3 -1
  86. package/build/cjs/icons/index.js +5 -1
  87. package/build/cjs/react-utils/useAutoFocus.d.ts +1 -1
  88. package/build/cjs/react-utils/useAutoFocus.js +2 -2
  89. package/build/cjs/react-utils/useNodeResizing.js +7 -2
  90. package/build/cjs/table-utils/commands/appendColumn.js +42 -33
  91. package/build/cjs/table-utils/commands/appendRow.js +40 -22
  92. package/build/cjs/table-utils/commands/removeColumn.js +18 -20
  93. package/build/cjs/table-utils/commands/removeRow.js +12 -9
  94. package/build/cjs/table-utils/table-desc.d.ts +53 -0
  95. package/build/cjs/table-utils/table-desc.js +149 -0
  96. package/build/cjs/table-utils/utils.d.ts +1 -1
  97. package/build/cjs/table-utils/utils.js +19 -12
  98. package/build/cjs/version.js +1 -1
  99. package/build/esm/bundle/config/action-names.d.ts +1 -1
  100. package/build/esm/bundle/config/action-names.js +1 -0
  101. package/build/esm/bundle/config/icons.d.ts +1 -1
  102. package/build/esm/bundle/config/icons.js +2 -0
  103. package/build/esm/bundle/config/wysiwyg.d.ts +1 -0
  104. package/build/esm/bundle/config/wysiwyg.js +12 -0
  105. package/build/esm/extensions/behavior/Clipboard/clipboard.js +4 -1
  106. package/build/esm/extensions/markdown/Table/actions/innerActions.d.ts +1 -1
  107. package/build/esm/extensions/yfm/GPT/ErrorScreen/ErrorScreen.css +18 -0
  108. package/build/esm/extensions/yfm/GPT/ErrorScreen/ErrorScreen.d.ts +9 -0
  109. package/build/esm/extensions/yfm/GPT/ErrorScreen/ErrorScreen.js +17 -0
  110. package/build/esm/extensions/yfm/GPT/ErrorScreen/types.d.ts +14 -0
  111. package/build/esm/extensions/yfm/GPT/ErrorScreen/types.js +1 -0
  112. package/build/esm/extensions/yfm/GPT/GptDialog/GptDialog.css +75 -0
  113. package/build/esm/extensions/yfm/GPT/GptDialog/GptDialog.d.ts +29 -0
  114. package/build/esm/extensions/yfm/GPT/GptDialog/GptDialog.js +98 -0
  115. package/build/esm/extensions/yfm/GPT/GptDialog/LoadingScreen/LoadingScreen.css +22 -0
  116. package/build/esm/extensions/yfm/GPT/GptDialog/LoadingScreen/LoadingScreen.d.ts +4 -0
  117. package/build/esm/extensions/yfm/GPT/GptDialog/LoadingScreen/LoadingScreen.js +17 -0
  118. package/build/esm/extensions/yfm/GPT/IconRefuge/IconRefuge.classname.d.ts +1 -0
  119. package/build/esm/extensions/yfm/GPT/IconRefuge/IconRefuge.classname.js +2 -0
  120. package/build/esm/extensions/yfm/GPT/IconRefuge/IconRefuge.css +8 -0
  121. package/build/esm/extensions/yfm/GPT/IconRefuge/IconRefuge.d.ts +15 -0
  122. package/build/esm/extensions/yfm/GPT/IconRefuge/IconRefuge.js +25 -0
  123. package/build/esm/extensions/yfm/GPT/IconRefuge/index.d.ts +2 -0
  124. package/build/esm/extensions/yfm/GPT/IconRefuge/index.js +1 -0
  125. package/build/esm/extensions/yfm/GPT/PresetList/PresetList.d.ts +10 -0
  126. package/build/esm/extensions/yfm/GPT/PresetList/PresetList.js +25 -0
  127. package/build/esm/extensions/yfm/GPT/PresetList/Presetlist.css +6 -0
  128. package/build/esm/extensions/yfm/GPT/actions.d.ts +2 -0
  129. package/build/esm/extensions/yfm/GPT/actions.js +10 -0
  130. package/build/esm/extensions/yfm/GPT/commands.d.ts +2 -0
  131. package/build/esm/extensions/yfm/GPT/commands.js +9 -0
  132. package/build/esm/extensions/yfm/GPT/constants.d.ts +13 -0
  133. package/build/esm/extensions/yfm/GPT/constants.js +12 -0
  134. package/build/esm/extensions/yfm/GPT/gptExtension/gptExtension.d.ts +13 -0
  135. package/build/esm/extensions/yfm/GPT/gptExtension/gptExtension.js +14 -0
  136. package/build/esm/extensions/yfm/GPT/gptExtension/view.css +17 -0
  137. package/build/esm/extensions/yfm/GPT/gptExtension/view.d.ts +37 -0
  138. package/build/esm/extensions/yfm/GPT/gptExtension/view.js +163 -0
  139. package/build/esm/extensions/yfm/GPT/hooks/useGpt.d.ts +27 -0
  140. package/build/esm/extensions/yfm/GPT/hooks/useGpt.js +151 -0
  141. package/build/esm/extensions/yfm/GPT/hooks/useGptHotKeys.d.ts +2 -0
  142. package/build/esm/extensions/yfm/GPT/hooks/useGptHotKeys.js +4 -0
  143. package/build/esm/extensions/yfm/GPT/hooks/useOverflowingHorizontalItems.d.ts +13 -0
  144. package/build/esm/extensions/yfm/GPT/hooks/useOverflowingHorizontalItems.js +65 -0
  145. package/build/esm/extensions/yfm/GPT/hooks/usePresetList.d.ts +14 -0
  146. package/build/esm/extensions/yfm/GPT/hooks/usePresetList.js +32 -0
  147. package/build/esm/extensions/yfm/GPT/index.d.ts +2 -0
  148. package/build/esm/extensions/yfm/GPT/index.js +2 -0
  149. package/build/esm/extensions/yfm/GPT/plugin.d.ts +13 -0
  150. package/build/esm/extensions/yfm/GPT/plugin.js +43 -0
  151. package/build/esm/extensions/yfm/GPT/toolbar.d.ts +3 -0
  152. package/build/esm/extensions/yfm/GPT/toolbar.js +18 -0
  153. package/build/esm/extensions/yfm/GPT/utils.d.ts +13 -0
  154. package/build/esm/extensions/yfm/GPT/utils.js +23 -0
  155. package/build/esm/extensions/yfm/YfmTable/plugins/YfmTableControls/actions.d.ts +1 -1
  156. package/build/esm/extensions/yfm/YfmTable/plugins/YfmTableControls/actions.js +1 -9
  157. package/build/esm/extensions/yfm/index.d.ts +1 -0
  158. package/build/esm/extensions/yfm/index.js +1 -0
  159. package/build/esm/i18n/gpt/dialog/en.json +16 -0
  160. package/build/esm/i18n/gpt/dialog/index.d.ts +19 -0
  161. package/build/esm/i18n/gpt/dialog/index.js +4 -0
  162. package/build/esm/i18n/gpt/dialog/ru.json +16 -0
  163. package/build/esm/i18n/gpt/errors/en.json +5 -0
  164. package/build/esm/i18n/gpt/errors/index.d.ts +8 -0
  165. package/build/esm/i18n/gpt/errors/index.js +4 -0
  166. package/build/esm/i18n/gpt/errors/ru.json +5 -0
  167. package/build/esm/i18n/gpt/extension/en.json +6 -0
  168. package/build/esm/i18n/gpt/extension/index.d.ts +9 -0
  169. package/build/esm/i18n/gpt/extension/index.js +4 -0
  170. package/build/esm/i18n/gpt/extension/ru.json +6 -0
  171. package/build/esm/i18n/gpt/loading/en.json +3 -0
  172. package/build/esm/i18n/gpt/loading/index.d.ts +6 -0
  173. package/build/esm/i18n/gpt/loading/index.js +4 -0
  174. package/build/esm/i18n/gpt/loading/ru.json +3 -0
  175. package/build/esm/i18n/menubar/en.json +1 -0
  176. package/build/esm/i18n/menubar/index.d.ts +2 -1
  177. package/build/esm/i18n/menubar/ru.json +1 -0
  178. package/build/esm/icons/GPT.d.ts +2 -0
  179. package/build/esm/icons/GPT.js +19 -0
  180. package/build/esm/icons/GPTLoading.d.ts +2 -0
  181. package/build/esm/icons/GPTLoading.js +9 -0
  182. package/build/esm/icons/index.d.ts +3 -1
  183. package/build/esm/icons/index.js +3 -1
  184. package/build/esm/react-utils/useAutoFocus.d.ts +1 -1
  185. package/build/esm/react-utils/useAutoFocus.js +2 -2
  186. package/build/esm/react-utils/useNodeResizing.js +7 -2
  187. package/build/esm/table-utils/commands/appendColumn.js +44 -35
  188. package/build/esm/table-utils/commands/appendRow.js +42 -24
  189. package/build/esm/table-utils/commands/removeColumn.js +18 -20
  190. package/build/esm/table-utils/commands/removeRow.js +14 -11
  191. package/build/esm/table-utils/table-desc.d.ts +53 -0
  192. package/build/esm/table-utils/table-desc.js +144 -0
  193. package/build/esm/table-utils/utils.d.ts +1 -1
  194. package/build/esm/table-utils/utils.js +18 -12
  195. package/build/esm/version.js +1 -1
  196. package/build/styles.css +146 -0
  197. package/package.json +2 -1
@@ -0,0 +1,16 @@
1
+ {
2
+ "answer-title": "What do you want to do with the response?",
3
+ "close-button": "Close",
4
+ "dislike": "Bad response",
5
+ "error": "An error occurred",
6
+ "feedback-message": "Thanks for your feedback!",
7
+ "fresh-start-button": "Start again",
8
+ "like": "Good response",
9
+ "more": "More",
10
+ "only-presets-title": "Help with text",
11
+ "refetch": "Try again",
12
+ "replace": "Replace the selected text",
13
+ "replace-disabled": "Insert text",
14
+ "try-again": "Try again",
15
+ "alert-gpt-presets-info": "Highlight text to see Yandex GPT presets"
16
+ }
@@ -0,0 +1,19 @@
1
+ export declare const i18n: <G extends "error" | "replace" | "answer-title" | "close-button" | "dislike" | "feedback-message" | "fresh-start-button" | "like" | "more" | "only-presets-title" | "refetch" | "replace-disabled" | "try-again" | "alert-gpt-presets-info", S extends string>(key: G | (string extends S ? S : never), params?: {
2
+ [key: string]: any;
3
+ } | undefined) => S extends G ? {
4
+ "answer-title": string;
5
+ "close-button": string;
6
+ dislike: string;
7
+ error: string;
8
+ "feedback-message": string;
9
+ "fresh-start-button": string;
10
+ like: string;
11
+ more: string;
12
+ "only-presets-title": string;
13
+ refetch: string;
14
+ replace: string;
15
+ "replace-disabled": string;
16
+ "try-again": string;
17
+ "alert-gpt-presets-info": string;
18
+ }[G] : string;
19
+ export declare type I18nKey = Parameters<typeof i18n>[0];
@@ -0,0 +1,4 @@
1
+ import { registerKeyset } from '../../i18n';
2
+ import en from './en.json';
3
+ import ru from './ru.json';
4
+ export const i18n = registerKeyset('gpt-dialog', { en, ru });
@@ -0,0 +1,16 @@
1
+ {
2
+ "answer-title": "Что вы хотите сделать с ответом?",
3
+ "close-button": "Закрыть",
4
+ "dislike": "Плохой ответ",
5
+ "error": "Произошла ошибка",
6
+ "feedback-message": "Ваш голос учтён!",
7
+ "fresh-start-button": "Начать сначала",
8
+ "like": "Хороший ответ",
9
+ "more": "Ещё",
10
+ "only-presets-title": "Помощь с текстом",
11
+ "refetch": "Попробовать ещё",
12
+ "replace": "Заменить выделенный текст",
13
+ "replace-disabled": "Вставить текст",
14
+ "try-again": "Иначе",
15
+ "alert-gpt-presets-info": "Выделите текст, чтобы увидеть пресеты Yandex GPT"
16
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "error-text": "An error occurred while generating a reply, please retry the request",
3
+ "retry-button": "Try again",
4
+ "start-again-button": "To the beginning"
5
+ }
@@ -0,0 +1,8 @@
1
+ export declare const i18n: <G extends "error-text" | "retry-button" | "start-again-button", S extends string>(key: G | (string extends S ? S : never), params?: {
2
+ [key: string]: any;
3
+ } | undefined) => S extends G ? {
4
+ "error-text": string;
5
+ "retry-button": string;
6
+ "start-again-button": string;
7
+ }[G] : string;
8
+ export declare type I18nKey = Parameters<typeof i18n>[0];
@@ -0,0 +1,4 @@
1
+ import { registerKeyset } from '../../i18n';
2
+ import en from './en.json';
3
+ import ru from './ru.json';
4
+ export const i18n = registerKeyset('gpt-dialog-error-screen', { en, ru });
@@ -0,0 +1,5 @@
1
+ {
2
+ "error-text": "Ошибка при генерации ответа, попробуйте повторить запрос",
3
+ "retry-button": "Повторить",
4
+ "start-again-button": "В начало"
5
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "confirm-cancel": "Cancel",
3
+ "confirm-ok": "Close",
4
+ "confirm-title": "Do you want to close the GPT editor?",
5
+ "help-with-text": "Help with text"
6
+ }
@@ -0,0 +1,9 @@
1
+ export declare const i18n: <G extends "confirm-cancel" | "confirm-ok" | "confirm-title" | "help-with-text", S extends string>(key: G | (string extends S ? S : never), params?: {
2
+ [key: string]: any;
3
+ } | undefined) => S extends G ? {
4
+ "confirm-cancel": string;
5
+ "confirm-ok": string;
6
+ "confirm-title": string;
7
+ "help-with-text": string;
8
+ }[G] : string;
9
+ export declare type I18nKey = Parameters<typeof i18n>[0];
@@ -0,0 +1,4 @@
1
+ import { registerKeyset } from '../../i18n';
2
+ import en from './en.json';
3
+ import ru from './ru.json';
4
+ export const i18n = registerKeyset('gpt', { en, ru });
@@ -0,0 +1,6 @@
1
+ {
2
+ "confirm-cancel": "Отменить",
3
+ "confirm-ok": "Закрыть",
4
+ "confirm-title": "Хотите закрыть помощника GPT?",
5
+ "help-with-text": "Помощь с текстом"
6
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "loading-text": "GPT is generating a response..."
3
+ }
@@ -0,0 +1,6 @@
1
+ export declare const i18n: <G extends "loading-text", S extends string>(key: G | (string extends S ? S : never), params?: {
2
+ [key: string]: any;
3
+ } | undefined) => S extends G ? {
4
+ "loading-text": string;
5
+ }[G] : string;
6
+ export declare type I18nKey = Parameters<typeof i18n>[0];
@@ -0,0 +1,4 @@
1
+ import { registerKeyset } from '../../i18n';
2
+ import en from './en.json';
3
+ import ru from './ru.json';
4
+ export const i18n = registerKeyset('gpt-dialog-loading-screen', { en, ru });
@@ -0,0 +1,3 @@
1
+ {
2
+ "loading-text": "GPT генерирует ответ..."
3
+ }
@@ -19,6 +19,7 @@
19
19
  "file": "File",
20
20
  "folding-heading": "Collapsed section",
21
21
  "folding-heading_hint": "The text under the heading can be collapsed or expanded",
22
+ "gpt": "GPT widget",
22
23
  "heading": "Heading",
23
24
  "heading1": "Heading 1",
24
25
  "heading2": "Heading 2",
@@ -1,4 +1,4 @@
1
- export declare const i18n: <G extends "bold" | "code" | "link" | "italic" | "strike" | "underline" | "mark" | "quote" | "colorify" | "mono" | "text" | "html" | "cut" | "table" | "image" | "code_inline" | "heading" | "note" | "file" | "codeblock" | "checkbox" | "emoji" | "list" | "tabs" | "math" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "undo" | "redo" | "math_inline" | "math_block" | "colorify__color_blue" | "colorify__color_default" | "colorify__color_gray" | "colorify__color_green" | "colorify__color_orange" | "colorify__color_red" | "colorify__color_violet" | "colorify__color_yellow" | "colorify__group_text" | "folding-heading" | "folding-heading_hint" | "hrule" | "list__action_lift" | "list__action_sink" | "list_action_disabled" | "mermaid" | "more_action" | "olist" | "ulist", S extends string>(key: G | (string extends S ? S : never), params?: {
1
+ export declare const i18n: <G extends "bold" | "code" | "link" | "italic" | "strike" | "underline" | "mark" | "quote" | "colorify" | "mono" | "text" | "html" | "cut" | "table" | "image" | "code_inline" | "heading" | "note" | "file" | "codeblock" | "checkbox" | "emoji" | "list" | "tabs" | "math" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "gpt" | "undo" | "redo" | "math_inline" | "math_block" | "colorify__color_blue" | "colorify__color_default" | "colorify__color_gray" | "colorify__color_green" | "colorify__color_orange" | "colorify__color_red" | "colorify__color_violet" | "colorify__color_yellow" | "colorify__group_text" | "folding-heading" | "folding-heading_hint" | "hrule" | "list__action_lift" | "list__action_sink" | "list_action_disabled" | "mermaid" | "more_action" | "olist" | "ulist", S extends string>(key: G | (string extends S ? S : never), params?: {
2
2
  [key: string]: any;
3
3
  } | undefined) => S extends G ? {
4
4
  bold: string;
@@ -21,6 +21,7 @@ export declare const i18n: <G extends "bold" | "code" | "link" | "italic" | "str
21
21
  file: string;
22
22
  "folding-heading": string;
23
23
  "folding-heading_hint": string;
24
+ gpt: string;
24
25
  heading: string;
25
26
  heading1: string;
26
27
  heading2: string;
@@ -19,6 +19,7 @@
19
19
  "file": "Файл",
20
20
  "folding-heading": "Свёрнутый раздел",
21
21
  "folding-heading_hint": "Текст под заголовком можно свернуть или раскрыть",
22
+ "gpt": "GPT-виджет",
22
23
  "heading": "Заголовок",
23
24
  "heading1": "Заголовок 1",
24
25
  "heading2": "Заголовок 2",
@@ -0,0 +1,2 @@
1
+ declare const GPTIcon: () => JSX.Element;
2
+ export default GPTIcon;
@@ -0,0 +1,19 @@
1
+ import React from 'react';
2
+ import { useTheme } from '@gravity-ui/uikit';
3
+ const GPTIcon = () => {
4
+ // It may be worth taking the hook outside the icon
5
+ const theme = useTheme();
6
+ const gradient = theme === 'dark' || theme === 'dark-hc' ? (React.createElement(React.Fragment, null,
7
+ React.createElement("stop", { stopColor: "#FF7233" }),
8
+ React.createElement("stop", { offset: "1", stopColor: "#D14DFF" }))) : (React.createElement(React.Fragment, null,
9
+ React.createElement("stop", { stopColor: "#FF5001" }),
10
+ React.createElement("stop", { offset: "1", stopColor: "#BD00FF" })));
11
+ return (React.createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
12
+ React.createElement("g", { clipPath: "url(#clip0_1608_24154)" },
13
+ React.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M0 6C0 2.68629 2.68629 -4.3454e-07 6 0C9.31371 4.3454e-07 12 2.68629 12 6C12 9.31371 9.31371 12 6 12C2.68629 12 -6.0141e-07 9.31371 0 6ZM14 16C12.8954 16 12 15.1046 12 14C12 12.8954 12.8954 12 14 12C15.1046 12 16 12.8954 16 14C16 15.1046 15.1046 16 14 16Z", fill: "url(#paint0_linear_1608_24154)" })),
14
+ React.createElement("defs", null,
15
+ React.createElement("linearGradient", { id: "paint0_linear_1608_24154", x1: "17.5", y1: "-1", x2: "2.5", y2: "13.5", gradientUnits: "userSpaceOnUse" }, gradient),
16
+ React.createElement("clipPath", { id: "clip0_1608_24154" },
17
+ React.createElement("rect", { width: "16", height: "16", fill: "white" })))));
18
+ };
19
+ export default GPTIcon;
@@ -0,0 +1,2 @@
1
+ declare const GPTLoading: () => JSX.Element;
2
+ export default GPTLoading;
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ const GPTLoading = () => (React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20" },
3
+ React.createElement("circle", { cx: "8", cy: "8", r: "6", fill: "url(#paint0_linear_1608_24154)" },
4
+ React.createElement("animateMotion", { fill: "url(#paint0_linear_1608_24154)", begin: "0s", dur: "1150ms", path: "M 0 0 a 1 3 145 0 1 8 8 a 1 3 145 0 1 -8 -8", repeatCount: "indefinite" }),
5
+ React.createElement("animate", { attributeName: "r", dur: "1150ms", repeatCount: "indefinite", values: "6; 2; 6" })),
6
+ React.createElement("circle", { cx: "16", cy: "16", r: "2", fill: "url(#paint0_linear_1608_24154)" },
7
+ React.createElement("animateMotion", { fill: "url(#paint0_linear_1608_24154)", begin: "0s", dur: "1150ms", path: "M 0 0 a 1.2 2.7 157 0 1 -5 -6.7 a 1.2 2.7 157 0 1 5 6.7", repeatCount: "indefinite" }),
8
+ React.createElement("animate", { attributeName: "r", dur: "1150ms", repeatCount: "indefinite", values: "2; 6; 2" }))));
9
+ export default GPTLoading;
@@ -1,5 +1,7 @@
1
+ import GPTIcon from './GPT';
2
+ import GPTLoading from './GPTLoading';
1
3
  import MermaidIcon from './Mermaid';
2
4
  import MonoIcon from './Mono';
3
5
  import TabsIcon from './Tabs';
4
- export { MermaidIcon, MonoIcon, TabsIcon };
6
+ export { MermaidIcon, MonoIcon, TabsIcon, GPTIcon, GPTLoading };
5
7
  export { ArrowUturnCcwLeft as UndoIcon, ArrowUturnCwRight as RedoIcon, Bold as BoldIcon, Italic as ItalicIcon, Underline as UnderlineIcon, Strikethrough as StrikethroughIcon, FontCursor as MarkIcon, Text as TextIcon, Heading as HeadingIcon, Heading1 as Heading1Icon, Heading2 as Heading2Icon, Heading3 as Heading3Icon, Heading4 as Heading4Icon, Heading5 as Heading5Icon, Heading6 as Heading6Icon, ListUl as ListBlIcon, ListOl as ListOlIcon, TextOutdent as LiftIcon, TextIndent as SinkIcon, Font as TextColorIcon, Link as LinkIcon, QuoteClose as QuoteIcon, Scissors as CutIcon, Sticker as NoteIcon, Paperclip as FileIcon, Minus as HRuleIcon, LayoutList as TableIcon, ChevronsExpandHorizontal as IframeIcon, SquareCheck as CheckListIcon, Picture as ImageIcon, Person as UserIcon, FaceSmile as EmojiIcon, Code as CodeInlineIcon, FileCode as CodeBlockIcon, Function as FunctionInlineIcon, CurlyBracketsFunction as FunctionBlockIcon, Hashtag as AnchorIcon, SquareDashedText as BlockIcon, LayoutColumns3 as LayoutIcon, Pencil as DrawIoIcon, FolderCode as HtmlBlockIcon, ArrowChevronRight as FoldingHeadingIcon, } from '@gravity-ui/icons';
@@ -1,7 +1,9 @@
1
+ import GPTIcon from './GPT';
2
+ import GPTLoading from './GPTLoading';
1
3
  import MermaidIcon from './Mermaid';
2
4
  import MonoIcon from './Mono';
3
5
  import TabsIcon from './Tabs';
4
- export { MermaidIcon, MonoIcon, TabsIcon };
6
+ export { MermaidIcon, MonoIcon, TabsIcon, GPTIcon, GPTLoading };
5
7
  export { ArrowUturnCcwLeft as UndoIcon, ArrowUturnCwRight as RedoIcon,
6
8
  //
7
9
  Bold as BoldIcon, Italic as ItalicIcon, Underline as UnderlineIcon, Strikethrough as StrikethroughIcon, FontCursor as MarkIcon,
@@ -1,2 +1,2 @@
1
1
  import { RefObject } from 'react';
2
- export declare const useAutoFocus: (nodeRef: RefObject<HTMLElement>) => void;
2
+ export declare const useAutoFocus: (nodeRef: RefObject<HTMLElement>, dependencies?: unknown[]) => void;
@@ -1,5 +1,5 @@
1
1
  import { useEffect } from 'react';
2
- export const useAutoFocus = (nodeRef) => {
2
+ export const useAutoFocus = (nodeRef, dependencies = []) => {
3
3
  useEffect(() => {
4
4
  const { current: anchor } = nodeRef;
5
5
  const timeout = setTimeout(() => {
@@ -10,5 +10,5 @@ export const useAutoFocus = (nodeRef) => {
10
10
  };
11
11
  // https://github.com/facebook/react/issues/23392#issuecomment-1055610198
12
12
  // eslint-disable-next-line react-hooks/exhaustive-deps
13
- }, [nodeRef.current]);
13
+ }, [nodeRef.current, ...dependencies]);
14
14
  };
@@ -47,9 +47,14 @@ export const useNodeResizing = ({ width, height, onResize, ref, delay = RESIZE_D
47
47
  const newHeight = (startHeight / startWidth) * newWidth;
48
48
  setCurrentWidth(newWidth);
49
49
  setCurrentHeight(newHeight);
50
+ // If neither width nor height are provided, the width is set automatically.
51
+ const shouldSetWidth = !initialWidth &&
52
+ initialWidth !== 0 &&
53
+ !(initialWidth === null && initialHeight === null);
54
+ const shouldSetHeight = !initialHeight && initialHeight !== 0;
50
55
  onResize === null || onResize === void 0 ? void 0 : onResize({
51
- width: !initialWidth && initialWidth !== 0 ? undefined : newWidth,
52
- height: !initialHeight && initialHeight !== 0 ? undefined : newHeight,
56
+ width: shouldSetWidth ? undefined : newWidth,
57
+ height: shouldSetHeight ? undefined : newHeight,
53
58
  });
54
59
  }
55
60
  });
@@ -1,48 +1,57 @@
1
- import { findChildren, findParentNodeClosestToPos } from 'prosemirror-utils';
2
- import { isTableNode, isTableRowNode } from '..';
3
- import { findChildIndex } from '../helpers';
4
- import { findChildTableCells, isTableBodyNode, isTableCellNode } from '../utils';
1
+ import { findParentNodeClosestToPos } from 'prosemirror-utils';
2
+ import { isTableNode } from '..';
3
+ import { TableDesc } from '../table-desc';
5
4
  export const appendColumn = (state, dispatch, _, attrs) => {
6
- var _a;
7
5
  if (!attrs)
8
6
  return false;
9
- const { tablePos, columnNumber, direction } = attrs;
10
- const parentTable = (_a = findParentNodeClosestToPos(state.doc.resolve(tablePos + 1), isTableNode)) === null || _a === void 0 ? void 0 : _a.node;
11
- if (!parentTable)
7
+ const { tablePos, columnNumber, direction = 'after' } = attrs;
8
+ const res = findParentNodeClosestToPos(state.doc.resolve(tablePos + 1), isTableNode);
9
+ if (!res)
12
10
  return false;
13
- let parentCell;
14
- let parentRow;
15
- const tableBody = findChildren(parentTable, isTableBodyNode, false).pop();
16
- if (!tableBody)
11
+ const tableNode = res.node;
12
+ const tableDesc = TableDesc.create(tableNode);
13
+ if (!tableDesc)
17
14
  return false;
18
- if (columnNumber !== undefined) {
19
- parentCell = findChildTableCells(parentTable)[columnNumber];
20
- parentRow = findParentNodeClosestToPos(state.doc.resolve(tablePos + parentCell.pos + 1), isTableRowNode);
21
- }
22
- else {
23
- parentRow = findChildren(tableBody.node, isTableRowNode, false).pop();
24
- if (!parentRow)
15
+ const columnIndex = columnNumber !== null && columnNumber !== void 0 ? columnNumber : tableDesc.cols - 1; // if columnNumber is not defined, that means last row
16
+ const isFirstColumn = columnIndex === 0;
17
+ const isLastColumn = columnIndex === tableDesc.cols - 1;
18
+ let pos = null;
19
+ if (isFirstColumn && direction === 'before')
20
+ pos = tableDesc.getRelativePosForColumn(0).map(fromOrClosest);
21
+ if (isLastColumn && direction === 'after')
22
+ pos = tableDesc.getRelativePosForColumn(tableDesc.cols - 1).map(toOrClosest);
23
+ if (!pos) {
24
+ if (tableDesc.cols <= columnIndex)
25
25
  return false;
26
- parentCell = findChildren(parentRow.node, isTableCellNode, false).pop();
27
- }
28
- if (!parentCell || !parentRow || !parentTable) {
29
- return false;
26
+ if (tableDesc.isSafeColumn(columnIndex)) {
27
+ const columnPos = tableDesc.getRelativePosForColumn(columnIndex);
28
+ if (direction === 'before')
29
+ pos = columnPos.map(fromOrClosest);
30
+ if (direction === 'after')
31
+ pos = columnPos.map(toOrClosest);
32
+ }
33
+ else {
34
+ if (direction === 'before' && tableDesc.isSafeColumn(columnIndex - 1))
35
+ pos = tableDesc.getRelativePosForColumn(columnIndex - 1).map(toOrClosest);
36
+ if (direction === 'after' && tableDesc.isSafeColumn(columnIndex + 1))
37
+ pos = tableDesc.getRelativePosForColumn(columnIndex + 1).map(fromOrClosest);
38
+ }
30
39
  }
31
- const parentCellIndex = columnNumber || findChildIndex(parentRow.node, parentCell.node);
32
- if (parentCellIndex < 0) {
40
+ if (!pos)
33
41
  return false;
34
- }
35
42
  if (dispatch) {
36
- const allRows = findChildren(tableBody.node, isTableRowNode, false);
37
- let tr = state.tr;
38
- for (const row of allRows) {
39
- const rowCells = findChildren(row.node, isTableCellNode, false);
40
- const cell = rowCells[parentCellIndex];
41
- let position = tablePos + row.pos + cell.pos + 3;
42
- position += direction === 'before' ? 0 : cell.node.nodeSize;
43
- tr = tr.insert(tr.mapping.map(position), cell.node.type.createAndFill(cell.node.attrs));
43
+ const cellType = tableDesc.getCellNodeType();
44
+ const { tr } = state;
45
+ for (const p of pos) {
46
+ tr.insert(tr.mapping.map(res.pos + p), cellType.createAndFill());
44
47
  }
45
- dispatch(tr.scrollIntoView());
48
+ dispatch(tr);
46
49
  }
47
50
  return true;
48
51
  };
52
+ function fromOrClosest(pos) {
53
+ return pos.type === 'real' ? pos.from : pos.closestPos;
54
+ }
55
+ function toOrClosest(pos) {
56
+ return pos.type === 'real' ? pos.to : pos.closestPos;
57
+ }
@@ -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 {};