@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.
- package/README.md +4 -0
- package/build/cjs/bundle/config/action-names.d.ts +1 -1
- package/build/cjs/bundle/config/action-names.js +1 -0
- package/build/cjs/bundle/config/icons.d.ts +1 -1
- package/build/cjs/bundle/config/icons.js +3 -0
- package/build/cjs/bundle/config/wysiwyg.d.ts +1 -0
- package/build/cjs/bundle/config/wysiwyg.js +13 -1
- package/build/cjs/extensions/behavior/Clipboard/clipboard.js +4 -1
- package/build/cjs/extensions/markdown/Table/actions/innerActions.d.ts +1 -1
- package/build/cjs/extensions/yfm/GPT/ErrorScreen/ErrorScreen.css +18 -0
- package/build/cjs/extensions/yfm/GPT/ErrorScreen/ErrorScreen.d.ts +8 -0
- package/build/cjs/extensions/yfm/GPT/ErrorScreen/ErrorScreen.js +21 -0
- package/build/cjs/extensions/yfm/GPT/ErrorScreen/types.d.ts +14 -0
- package/build/cjs/extensions/yfm/GPT/ErrorScreen/types.js +2 -0
- package/build/cjs/extensions/yfm/GPT/GptDialog/GptDialog.css +75 -0
- package/build/cjs/extensions/yfm/GPT/GptDialog/GptDialog.d.ts +28 -0
- package/build/cjs/extensions/yfm/GPT/GptDialog/GptDialog.js +102 -0
- package/build/cjs/extensions/yfm/GPT/GptDialog/LoadingScreen/LoadingScreen.css +22 -0
- package/build/cjs/extensions/yfm/GPT/GptDialog/LoadingScreen/LoadingScreen.d.ts +3 -0
- package/build/cjs/extensions/yfm/GPT/GptDialog/LoadingScreen/LoadingScreen.js +21 -0
- package/build/cjs/extensions/yfm/GPT/IconRefuge/IconRefuge.classname.d.ts +1 -0
- package/build/cjs/extensions/yfm/GPT/IconRefuge/IconRefuge.classname.js +5 -0
- package/build/cjs/extensions/yfm/GPT/IconRefuge/IconRefuge.css +8 -0
- package/build/cjs/extensions/yfm/GPT/IconRefuge/IconRefuge.d.ts +14 -0
- package/build/cjs/extensions/yfm/GPT/IconRefuge/IconRefuge.js +28 -0
- package/build/cjs/extensions/yfm/GPT/IconRefuge/index.d.ts +2 -0
- package/build/cjs/extensions/yfm/GPT/IconRefuge/index.js +5 -0
- package/build/cjs/extensions/yfm/GPT/PresetList/PresetList.d.ts +9 -0
- package/build/cjs/extensions/yfm/GPT/PresetList/PresetList.js +29 -0
- package/build/cjs/extensions/yfm/GPT/PresetList/Presetlist.css +6 -0
- package/build/cjs/extensions/yfm/GPT/actions.d.ts +2 -0
- package/build/cjs/extensions/yfm/GPT/actions.js +14 -0
- package/build/cjs/extensions/yfm/GPT/commands.d.ts +2 -0
- package/build/cjs/extensions/yfm/GPT/commands.js +13 -0
- package/build/cjs/extensions/yfm/GPT/constants.d.ts +13 -0
- package/build/cjs/extensions/yfm/GPT/constants.js +15 -0
- package/build/cjs/extensions/yfm/GPT/gptExtension/gptExtension.d.ts +13 -0
- package/build/cjs/extensions/yfm/GPT/gptExtension/gptExtension.js +18 -0
- package/build/cjs/extensions/yfm/GPT/gptExtension/view.css +17 -0
- package/build/cjs/extensions/yfm/GPT/gptExtension/view.d.ts +36 -0
- package/build/cjs/extensions/yfm/GPT/gptExtension/view.js +167 -0
- package/build/cjs/extensions/yfm/GPT/hooks/useGpt.d.ts +27 -0
- package/build/cjs/extensions/yfm/GPT/hooks/useGpt.js +155 -0
- package/build/cjs/extensions/yfm/GPT/hooks/useGptHotKeys.d.ts +2 -0
- package/build/cjs/extensions/yfm/GPT/hooks/useGptHotKeys.js +8 -0
- package/build/cjs/extensions/yfm/GPT/hooks/useOverflowingHorizontalItems.d.ts +13 -0
- package/build/cjs/extensions/yfm/GPT/hooks/useOverflowingHorizontalItems.js +70 -0
- package/build/cjs/extensions/yfm/GPT/hooks/usePresetList.d.ts +14 -0
- package/build/cjs/extensions/yfm/GPT/hooks/usePresetList.js +36 -0
- package/build/cjs/extensions/yfm/GPT/index.d.ts +2 -0
- package/build/cjs/extensions/yfm/GPT/index.js +5 -0
- package/build/cjs/extensions/yfm/GPT/plugin.d.ts +13 -0
- package/build/cjs/extensions/yfm/GPT/plugin.js +47 -0
- package/build/cjs/extensions/yfm/GPT/toolbar.d.ts +3 -0
- package/build/cjs/extensions/yfm/GPT/toolbar.js +22 -0
- package/build/cjs/extensions/yfm/GPT/utils.d.ts +13 -0
- package/build/cjs/extensions/yfm/GPT/utils.js +31 -0
- package/build/cjs/extensions/yfm/YfmTable/plugins/YfmTableControls/actions.d.ts +1 -1
- package/build/cjs/extensions/yfm/YfmTable/plugins/YfmTableControls/actions.js +0 -8
- package/build/cjs/extensions/yfm/index.d.ts +1 -0
- package/build/cjs/extensions/yfm/index.js +1 -0
- package/build/cjs/i18n/gpt/dialog/en.json +16 -0
- package/build/cjs/i18n/gpt/dialog/index.d.ts +19 -0
- package/build/cjs/i18n/gpt/dialog/index.js +8 -0
- package/build/cjs/i18n/gpt/dialog/ru.json +16 -0
- package/build/cjs/i18n/gpt/errors/en.json +5 -0
- package/build/cjs/i18n/gpt/errors/index.d.ts +8 -0
- package/build/cjs/i18n/gpt/errors/index.js +8 -0
- package/build/cjs/i18n/gpt/errors/ru.json +5 -0
- package/build/cjs/i18n/gpt/extension/en.json +6 -0
- package/build/cjs/i18n/gpt/extension/index.d.ts +9 -0
- package/build/cjs/i18n/gpt/extension/index.js +8 -0
- package/build/cjs/i18n/gpt/extension/ru.json +6 -0
- package/build/cjs/i18n/gpt/loading/en.json +3 -0
- package/build/cjs/i18n/gpt/loading/index.d.ts +6 -0
- package/build/cjs/i18n/gpt/loading/index.js +8 -0
- package/build/cjs/i18n/gpt/loading/ru.json +3 -0
- package/build/cjs/i18n/menubar/en.json +1 -0
- package/build/cjs/i18n/menubar/index.d.ts +2 -1
- package/build/cjs/i18n/menubar/ru.json +1 -0
- package/build/cjs/icons/GPT.d.ts +2 -0
- package/build/cjs/icons/GPT.js +22 -0
- package/build/cjs/icons/GPTLoading.d.ts +2 -0
- package/build/cjs/icons/GPTLoading.js +12 -0
- package/build/cjs/icons/index.d.ts +3 -1
- package/build/cjs/icons/index.js +5 -1
- package/build/cjs/react-utils/useAutoFocus.d.ts +1 -1
- package/build/cjs/react-utils/useAutoFocus.js +2 -2
- package/build/cjs/react-utils/useNodeResizing.js +7 -2
- package/build/cjs/table-utils/commands/appendColumn.js +42 -33
- package/build/cjs/table-utils/commands/appendRow.js +40 -22
- package/build/cjs/table-utils/commands/removeColumn.js +18 -20
- package/build/cjs/table-utils/commands/removeRow.js +12 -9
- package/build/cjs/table-utils/table-desc.d.ts +53 -0
- package/build/cjs/table-utils/table-desc.js +149 -0
- package/build/cjs/table-utils/utils.d.ts +1 -1
- package/build/cjs/table-utils/utils.js +19 -12
- package/build/cjs/version.js +1 -1
- package/build/esm/bundle/config/action-names.d.ts +1 -1
- package/build/esm/bundle/config/action-names.js +1 -0
- package/build/esm/bundle/config/icons.d.ts +1 -1
- package/build/esm/bundle/config/icons.js +2 -0
- package/build/esm/bundle/config/wysiwyg.d.ts +1 -0
- package/build/esm/bundle/config/wysiwyg.js +12 -0
- package/build/esm/extensions/behavior/Clipboard/clipboard.js +4 -1
- package/build/esm/extensions/markdown/Table/actions/innerActions.d.ts +1 -1
- package/build/esm/extensions/yfm/GPT/ErrorScreen/ErrorScreen.css +18 -0
- package/build/esm/extensions/yfm/GPT/ErrorScreen/ErrorScreen.d.ts +9 -0
- package/build/esm/extensions/yfm/GPT/ErrorScreen/ErrorScreen.js +17 -0
- package/build/esm/extensions/yfm/GPT/ErrorScreen/types.d.ts +14 -0
- package/build/esm/extensions/yfm/GPT/ErrorScreen/types.js +1 -0
- package/build/esm/extensions/yfm/GPT/GptDialog/GptDialog.css +75 -0
- package/build/esm/extensions/yfm/GPT/GptDialog/GptDialog.d.ts +29 -0
- package/build/esm/extensions/yfm/GPT/GptDialog/GptDialog.js +98 -0
- package/build/esm/extensions/yfm/GPT/GptDialog/LoadingScreen/LoadingScreen.css +22 -0
- package/build/esm/extensions/yfm/GPT/GptDialog/LoadingScreen/LoadingScreen.d.ts +4 -0
- package/build/esm/extensions/yfm/GPT/GptDialog/LoadingScreen/LoadingScreen.js +17 -0
- package/build/esm/extensions/yfm/GPT/IconRefuge/IconRefuge.classname.d.ts +1 -0
- package/build/esm/extensions/yfm/GPT/IconRefuge/IconRefuge.classname.js +2 -0
- package/build/esm/extensions/yfm/GPT/IconRefuge/IconRefuge.css +8 -0
- package/build/esm/extensions/yfm/GPT/IconRefuge/IconRefuge.d.ts +15 -0
- package/build/esm/extensions/yfm/GPT/IconRefuge/IconRefuge.js +25 -0
- package/build/esm/extensions/yfm/GPT/IconRefuge/index.d.ts +2 -0
- package/build/esm/extensions/yfm/GPT/IconRefuge/index.js +1 -0
- package/build/esm/extensions/yfm/GPT/PresetList/PresetList.d.ts +10 -0
- package/build/esm/extensions/yfm/GPT/PresetList/PresetList.js +25 -0
- package/build/esm/extensions/yfm/GPT/PresetList/Presetlist.css +6 -0
- package/build/esm/extensions/yfm/GPT/actions.d.ts +2 -0
- package/build/esm/extensions/yfm/GPT/actions.js +10 -0
- package/build/esm/extensions/yfm/GPT/commands.d.ts +2 -0
- package/build/esm/extensions/yfm/GPT/commands.js +9 -0
- package/build/esm/extensions/yfm/GPT/constants.d.ts +13 -0
- package/build/esm/extensions/yfm/GPT/constants.js +12 -0
- package/build/esm/extensions/yfm/GPT/gptExtension/gptExtension.d.ts +13 -0
- package/build/esm/extensions/yfm/GPT/gptExtension/gptExtension.js +14 -0
- package/build/esm/extensions/yfm/GPT/gptExtension/view.css +17 -0
- package/build/esm/extensions/yfm/GPT/gptExtension/view.d.ts +37 -0
- package/build/esm/extensions/yfm/GPT/gptExtension/view.js +163 -0
- package/build/esm/extensions/yfm/GPT/hooks/useGpt.d.ts +27 -0
- package/build/esm/extensions/yfm/GPT/hooks/useGpt.js +151 -0
- package/build/esm/extensions/yfm/GPT/hooks/useGptHotKeys.d.ts +2 -0
- package/build/esm/extensions/yfm/GPT/hooks/useGptHotKeys.js +4 -0
- package/build/esm/extensions/yfm/GPT/hooks/useOverflowingHorizontalItems.d.ts +13 -0
- package/build/esm/extensions/yfm/GPT/hooks/useOverflowingHorizontalItems.js +65 -0
- package/build/esm/extensions/yfm/GPT/hooks/usePresetList.d.ts +14 -0
- package/build/esm/extensions/yfm/GPT/hooks/usePresetList.js +32 -0
- package/build/esm/extensions/yfm/GPT/index.d.ts +2 -0
- package/build/esm/extensions/yfm/GPT/index.js +2 -0
- package/build/esm/extensions/yfm/GPT/plugin.d.ts +13 -0
- package/build/esm/extensions/yfm/GPT/plugin.js +43 -0
- package/build/esm/extensions/yfm/GPT/toolbar.d.ts +3 -0
- package/build/esm/extensions/yfm/GPT/toolbar.js +18 -0
- package/build/esm/extensions/yfm/GPT/utils.d.ts +13 -0
- package/build/esm/extensions/yfm/GPT/utils.js +23 -0
- package/build/esm/extensions/yfm/YfmTable/plugins/YfmTableControls/actions.d.ts +1 -1
- package/build/esm/extensions/yfm/YfmTable/plugins/YfmTableControls/actions.js +1 -9
- package/build/esm/extensions/yfm/index.d.ts +1 -0
- package/build/esm/extensions/yfm/index.js +1 -0
- package/build/esm/i18n/gpt/dialog/en.json +16 -0
- package/build/esm/i18n/gpt/dialog/index.d.ts +19 -0
- package/build/esm/i18n/gpt/dialog/index.js +4 -0
- package/build/esm/i18n/gpt/dialog/ru.json +16 -0
- package/build/esm/i18n/gpt/errors/en.json +5 -0
- package/build/esm/i18n/gpt/errors/index.d.ts +8 -0
- package/build/esm/i18n/gpt/errors/index.js +4 -0
- package/build/esm/i18n/gpt/errors/ru.json +5 -0
- package/build/esm/i18n/gpt/extension/en.json +6 -0
- package/build/esm/i18n/gpt/extension/index.d.ts +9 -0
- package/build/esm/i18n/gpt/extension/index.js +4 -0
- package/build/esm/i18n/gpt/extension/ru.json +6 -0
- package/build/esm/i18n/gpt/loading/en.json +3 -0
- package/build/esm/i18n/gpt/loading/index.d.ts +6 -0
- package/build/esm/i18n/gpt/loading/index.js +4 -0
- package/build/esm/i18n/gpt/loading/ru.json +3 -0
- package/build/esm/i18n/menubar/en.json +1 -0
- package/build/esm/i18n/menubar/index.d.ts +2 -1
- package/build/esm/i18n/menubar/ru.json +1 -0
- package/build/esm/icons/GPT.d.ts +2 -0
- package/build/esm/icons/GPT.js +19 -0
- package/build/esm/icons/GPTLoading.d.ts +2 -0
- package/build/esm/icons/GPTLoading.js +9 -0
- package/build/esm/icons/index.d.ts +3 -1
- package/build/esm/icons/index.js +3 -1
- package/build/esm/react-utils/useAutoFocus.d.ts +1 -1
- package/build/esm/react-utils/useAutoFocus.js +2 -2
- package/build/esm/react-utils/useNodeResizing.js +7 -2
- package/build/esm/table-utils/commands/appendColumn.js +44 -35
- package/build/esm/table-utils/commands/appendRow.js +42 -24
- package/build/esm/table-utils/commands/removeColumn.js +18 -20
- package/build/esm/table-utils/commands/removeRow.js +14 -11
- package/build/esm/table-utils/table-desc.d.ts +53 -0
- package/build/esm/table-utils/table-desc.js +144 -0
- package/build/esm/table-utils/utils.d.ts +1 -1
- package/build/esm/table-utils/utils.js +18 -12
- package/build/esm/version.js +1 -1
- package/build/styles.css +146 -0
- 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,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,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,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,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];
|
|
@@ -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;
|
|
@@ -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,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';
|
package/build/esm/icons/index.js
CHANGED
|
@@ -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
|
|
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:
|
|
52
|
-
height:
|
|
56
|
+
width: shouldSetWidth ? undefined : newWidth,
|
|
57
|
+
height: shouldSetHeight ? undefined : newHeight,
|
|
53
58
|
});
|
|
54
59
|
}
|
|
55
60
|
});
|
|
@@ -1,48 +1,57 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { isTableNode
|
|
3
|
-
import {
|
|
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
|
|
11
|
-
if (!
|
|
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
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
if (!tableBody)
|
|
11
|
+
const tableNode = res.node;
|
|
12
|
+
const tableDesc = TableDesc.create(tableNode);
|
|
13
|
+
if (!tableDesc)
|
|
17
14
|
return false;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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
|
-
|
|
32
|
-
if (parentCellIndex < 0) {
|
|
40
|
+
if (!pos)
|
|
33
41
|
return false;
|
|
34
|
-
}
|
|
35
42
|
if (dispatch) {
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
for (const
|
|
39
|
-
|
|
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
|
|
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 {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
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
|
|
10
|
-
if (!
|
|
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
|
|
13
|
-
|
|
11
|
+
const tableNode = res.node;
|
|
12
|
+
const tableDesc = TableDesc.create(tableNode);
|
|
13
|
+
if (!tableDesc)
|
|
14
14
|
return false;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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
|
-
|
|
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
|
|
27
|
-
|
|
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 {
|
|
2
|
-
import {
|
|
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
|
|
15
|
-
if (!
|
|
14
|
+
const tableDesc = TableDesc.create(tableNode);
|
|
15
|
+
if (!tableDesc)
|
|
16
16
|
return false;
|
|
17
|
-
|
|
18
|
-
|
|
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
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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 {
|
|
3
|
-
import {
|
|
2
|
+
import { findParentNodeClosestToPos } from 'prosemirror-utils';
|
|
3
|
+
import { isTableNode } from '..';
|
|
4
4
|
import { trackTransactionMetrics } from '../../core';
|
|
5
|
-
import {
|
|
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
|
|
15
|
-
|
|
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 {};
|