@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,75 @@
|
|
|
1
|
+
.g-md-gpt-dialog__header-top {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
}
|
|
5
|
+
.g-md-gpt-dialog__custom-prompt-input {
|
|
6
|
+
margin-right: var(--g-spacing-2);
|
|
7
|
+
}
|
|
8
|
+
.g-md-gpt-dialog__custom-prompt-input .g-text-input__control {
|
|
9
|
+
font-size: var(--g-text-body-2-font-size);
|
|
10
|
+
}
|
|
11
|
+
.g-md-gpt-dialog__header-bottom {
|
|
12
|
+
margin-top: var(--g-spacing-2);
|
|
13
|
+
}
|
|
14
|
+
.g-md-gpt-dialog__custom-prompt {
|
|
15
|
+
display: flex;
|
|
16
|
+
flex: auto;
|
|
17
|
+
align-items: center;
|
|
18
|
+
}
|
|
19
|
+
.g-md-gpt-dialog__alone-presets-text {
|
|
20
|
+
margin-right: var(--g-spacing-8);
|
|
21
|
+
}
|
|
22
|
+
.g-md-gpt-dialog__alone-presets {
|
|
23
|
+
display: flex;
|
|
24
|
+
flex: auto;
|
|
25
|
+
align-items: center;
|
|
26
|
+
width: 100%;
|
|
27
|
+
font-size: var(--g-text-body-2-font-size);
|
|
28
|
+
font-weight: 500;
|
|
29
|
+
}
|
|
30
|
+
.g-md-gpt-dialog__alone-presets .g-md-gpt-dialog-preset-list {
|
|
31
|
+
flex: auto;
|
|
32
|
+
}
|
|
33
|
+
.g-md-gpt-dialog__answer-title {
|
|
34
|
+
font-size: var(--g-text-body-2-font-size);
|
|
35
|
+
font-weight: 500;
|
|
36
|
+
}
|
|
37
|
+
.g-md-gpt-dialog__gpt-icon {
|
|
38
|
+
margin-right: var(--g-spacing-1);
|
|
39
|
+
}
|
|
40
|
+
.g-md-gpt-dialog__try-again-button {
|
|
41
|
+
margin-right: var(--g-spacing-2);
|
|
42
|
+
}
|
|
43
|
+
.g-md-gpt-dialog__body {
|
|
44
|
+
margin: var(--g-spacing-2) calc(-1 * var(--g-spacing-3));
|
|
45
|
+
padding: var(--g-spacing-4) var(--g-spacing-3);
|
|
46
|
+
border-top: 1px solid var(--g-color-line-generic);
|
|
47
|
+
}
|
|
48
|
+
.g-md-gpt-dialog__answer {
|
|
49
|
+
overflow: auto;
|
|
50
|
+
max-height: 300px;
|
|
51
|
+
}
|
|
52
|
+
.g-md-gpt-dialog__answer-actions {
|
|
53
|
+
display: flex;
|
|
54
|
+
align-items: center;
|
|
55
|
+
}
|
|
56
|
+
.g-md-gpt-dialog__feedback-message {
|
|
57
|
+
margin-left: var(--g-spacing-2);
|
|
58
|
+
}
|
|
59
|
+
.g-md-gpt-dialog__like-button {
|
|
60
|
+
margin-right: var(--g-spacing-2);
|
|
61
|
+
}
|
|
62
|
+
.g-md-gpt-dialog__close-button {
|
|
63
|
+
margin-right: var(--g-spacing-2);
|
|
64
|
+
margin-left: auto;
|
|
65
|
+
}
|
|
66
|
+
.g-md-gpt-dialog__footer {
|
|
67
|
+
display: flex;
|
|
68
|
+
align-items: center;
|
|
69
|
+
margin-top: var(--g-spacing-2);
|
|
70
|
+
}
|
|
71
|
+
.g-md-gpt-dialog__description-alert {
|
|
72
|
+
min-height: 34px;
|
|
73
|
+
margin-top: var(--g-spacing-3);
|
|
74
|
+
padding: var(--g-spacing-1) var(--g-spacing-2);
|
|
75
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { FC } from 'react';
|
|
2
|
+
import { AlertProps } from '@gravity-ui/uikit';
|
|
3
|
+
import type { CommonAnswer, GptRequestData, PromptPreset } from '../ErrorScreen/types';
|
|
4
|
+
import './GptDialog.css';
|
|
5
|
+
export declare type GptDialogProps<AnswerData extends CommonAnswer = CommonAnswer, PromptData extends unknown = unknown> = {
|
|
6
|
+
markup: string;
|
|
7
|
+
answerRender: (data: AnswerData) => JSX.Element;
|
|
8
|
+
onApplyResult: (markup: string) => void;
|
|
9
|
+
promptPresets?: PromptPreset<PromptData>[];
|
|
10
|
+
disablePromptPresets?: boolean;
|
|
11
|
+
customPromptPlaceholder?: string;
|
|
12
|
+
disabledPromptPlaceholder?: string;
|
|
13
|
+
onCustomPromptApply?: (data: GptRequestData<PromptData>) => Promise<AnswerData | undefined>;
|
|
14
|
+
onPromptPresetClick?: (data: GptRequestData<PromptData>) => Promise<AnswerData | undefined>;
|
|
15
|
+
onTryAgain?: (data: GptRequestData<PromptData>) => Promise<AnswerData | undefined>;
|
|
16
|
+
onLike?: (data: GptRequestData<PromptData>) => Promise<void>;
|
|
17
|
+
onDislike?: (data: GptRequestData<PromptData>) => Promise<void>;
|
|
18
|
+
onClose?: () => void;
|
|
19
|
+
onUpdate?: (value: AnswerData | undefined) => void;
|
|
20
|
+
gptAlertProps?: {
|
|
21
|
+
showedGptAlert: boolean;
|
|
22
|
+
onCloseGptAlert?: () => void;
|
|
23
|
+
message?: string;
|
|
24
|
+
theme?: AlertProps['theme'];
|
|
25
|
+
className?: string;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
export declare const cnGptDialog: import("@bem-react/classname").ClassNameFormatter;
|
|
29
|
+
export declare const GptDialog: FC<GptDialogProps>;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import React, { useCallback, useRef, useState } from 'react';
|
|
2
|
+
import { ArrowRight, ArrowRotateLeft, ThumbsDown, ThumbsUp } from '@gravity-ui/icons';
|
|
3
|
+
import { ActionTooltip, Alert, Button, Icon, TextInput } from '@gravity-ui/uikit';
|
|
4
|
+
import { cn } from '../../../../classname';
|
|
5
|
+
import { i18n } from '../../../../i18n/gpt/dialog';
|
|
6
|
+
import gptIcon from '../../../../icons/GPT';
|
|
7
|
+
import { useAutoFocus } from '../../../../react-utils/useAutoFocus';
|
|
8
|
+
import { ErrorScreen } from '../ErrorScreen/ErrorScreen';
|
|
9
|
+
import { IconRefuge } from '../IconRefuge/IconRefuge';
|
|
10
|
+
import { PresetList } from '../PresetList/PresetList';
|
|
11
|
+
import { gptHotKeys } from '../constants';
|
|
12
|
+
import { useGpt } from '../hooks/useGpt';
|
|
13
|
+
import { useGptHotKeys } from '../hooks/useGptHotKeys';
|
|
14
|
+
import { getAlertGptInfo, getDisableReplaceButtonText, getInputPlaceHolder } from '../utils';
|
|
15
|
+
import { LoadingScreen } from './LoadingScreen/LoadingScreen';
|
|
16
|
+
import './GptDialog.css';
|
|
17
|
+
export const cnGptDialog = cn('gpt-dialog');
|
|
18
|
+
export const GptDialog = ({ markup, answerRender, promptPresets, disablePromptPresets, customPromptPlaceholder, disabledPromptPlaceholder, onCustomPromptApply, onPromptPresetClick, onTryAgain, onApplyResult, onClose, onLike, onDislike, onUpdate, gptAlertProps, }) => {
|
|
19
|
+
const { answer, customPrompt, loading, mode, feedbackType, feedbackTypeLoading, handleLike, handleDislike, handleCustomPromptUpdate, handleCustomPromptKeyPress, handleCustomPromptApply, handlePresetClick, handleTryAgain, handleFreshStart, handleApplyResult, showAnswer, showError, showAnswerActions, showTryAgainButton, } = useGpt({
|
|
20
|
+
markup,
|
|
21
|
+
promptPresets,
|
|
22
|
+
onLike,
|
|
23
|
+
onDislike,
|
|
24
|
+
onCustomPromptApply,
|
|
25
|
+
onPromptPresetClick,
|
|
26
|
+
onTryAgain,
|
|
27
|
+
onApplyResult,
|
|
28
|
+
onUpdate,
|
|
29
|
+
});
|
|
30
|
+
const gptAlert = gptAlertProps;
|
|
31
|
+
const customPromptContainerRef = useRef(null);
|
|
32
|
+
const [showedGptAlert, setShowedGptAlert] = useState(gptAlert === null || gptAlert === void 0 ? void 0 : gptAlert.showedGptAlert);
|
|
33
|
+
const { alertMessage, alertTheme, alertClassName } = getAlertGptInfo(gptAlert);
|
|
34
|
+
const onCloseAlert = useCallback(() => {
|
|
35
|
+
var _a;
|
|
36
|
+
if (gptAlert) {
|
|
37
|
+
gptAlert.showedGptAlert = false;
|
|
38
|
+
}
|
|
39
|
+
(_a = gptAlert === null || gptAlert === void 0 ? void 0 : gptAlert.onCloseGptAlert) === null || _a === void 0 ? void 0 : _a.call(gptAlert);
|
|
40
|
+
setShowedGptAlert(false);
|
|
41
|
+
}, [gptAlert]);
|
|
42
|
+
useAutoFocus(customPromptContainerRef, [showAnswer]);
|
|
43
|
+
useGptHotKeys(gptHotKeys.tryAgainGpt, handleTryAgain);
|
|
44
|
+
useGptHotKeys(gptHotKeys.freshStartGpt, handleFreshStart);
|
|
45
|
+
useGptHotKeys(gptHotKeys.applyResultGpt, handleApplyResult);
|
|
46
|
+
const replaceButtonText = getDisableReplaceButtonText(disablePromptPresets);
|
|
47
|
+
const inputPlaceholderText = getInputPlaceHolder(disablePromptPresets, disabledPromptPlaceholder, customPromptPlaceholder);
|
|
48
|
+
const tryAgainButton = (React.createElement(ActionTooltip, { hotkey: gptHotKeys.tryAgainGpt, title: i18n('try-again') },
|
|
49
|
+
React.createElement(Button, { className: cnGptDialog('try-again-button'), view: "normal", size: "m", onClick: handleTryAgain },
|
|
50
|
+
React.createElement(Icon, { data: ArrowRotateLeft, size: 16 }),
|
|
51
|
+
i18n('try-again'))));
|
|
52
|
+
let content = null;
|
|
53
|
+
if (loading) {
|
|
54
|
+
content = React.createElement(LoadingScreen, null);
|
|
55
|
+
}
|
|
56
|
+
else if (showError) {
|
|
57
|
+
content = React.createElement(ErrorScreen, { onRetry: handleTryAgain, onStartAgain: handleFreshStart });
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
content = (React.createElement(React.Fragment, null,
|
|
61
|
+
React.createElement("div", { className: cnGptDialog('header') },
|
|
62
|
+
React.createElement("div", { className: cnGptDialog('header-top') },
|
|
63
|
+
React.createElement(IconRefuge, { containerClassName: cnGptDialog('gpt-icon'), data: gptIcon, refugeSize: 28, size: 16 }),
|
|
64
|
+
(mode === 'only-custom' || mode === 'custom-and-presets') &&
|
|
65
|
+
(showAnswer ? (React.createElement("span", { className: cnGptDialog('answer-title') }, i18n('answer-title'))) : (React.createElement("div", { className: cnGptDialog('custom-prompt') },
|
|
66
|
+
React.createElement(TextInput, { controlRef: customPromptContainerRef, view: "clear", size: "m", className: cnGptDialog('custom-prompt-input'), placeholder: inputPlaceholderText, onKeyPress: handleCustomPromptKeyPress, onUpdate: handleCustomPromptUpdate }),
|
|
67
|
+
React.createElement(Button, { className: cnGptDialog('custom-prompt-ask-button'), view: "normal", size: "s", disabled: !customPrompt, onClick: handleCustomPromptApply },
|
|
68
|
+
React.createElement(Icon, { data: ArrowRight, size: 16 }))))),
|
|
69
|
+
mode === 'only-presets' && (React.createElement("div", { className: cnGptDialog('alone-presets') },
|
|
70
|
+
React.createElement("span", { className: cnGptDialog('alone-presets-text') }, i18n('only-presets-title'))))),
|
|
71
|
+
(mode === 'custom-and-presets' || mode === 'only-presets') &&
|
|
72
|
+
((showTryAgainButton && (React.createElement("div", { className: cnGptDialog('header-bottom') },
|
|
73
|
+
tryAgainButton,
|
|
74
|
+
React.createElement(ActionTooltip, { title: i18n('fresh-start-button'), hotkey: gptHotKeys.freshStartGpt },
|
|
75
|
+
React.createElement(Button, { className: cnGptDialog('back-to-start'), view: "normal", size: "m", onClick: handleFreshStart }, i18n('fresh-start-button')))))) ||
|
|
76
|
+
(!disablePromptPresets && (React.createElement("div", { className: cnGptDialog('header-bottom') },
|
|
77
|
+
React.createElement(PresetList, { disablePromptPresets: disablePromptPresets, promptPresets: promptPresets, onPresetClick: handlePresetClick })))) ||
|
|
78
|
+
(disablePromptPresets && showedGptAlert && (React.createElement(Alert, { theme: alertTheme, message: alertMessage, align: "center", className: cnGptDialog('description-alert', alertClassName), onClose: onCloseAlert }))))),
|
|
79
|
+
showAnswer && (React.createElement(React.Fragment, null,
|
|
80
|
+
React.createElement("div", { className: cnGptDialog('body') },
|
|
81
|
+
React.createElement("div", { className: cnGptDialog('answer') }, answerRender(answer))),
|
|
82
|
+
React.createElement("div", { className: cnGptDialog('footer') },
|
|
83
|
+
showAnswerActions && (React.createElement("div", { className: cnGptDialog('answer-actions') },
|
|
84
|
+
React.createElement(Button, { className: cnGptDialog('like-button'), view: "normal", size: "m", onClick: handleLike, selected: feedbackType === 'like', loading: feedbackTypeLoading === 'like' },
|
|
85
|
+
React.createElement(Icon, { data: ThumbsUp, size: 16 })),
|
|
86
|
+
React.createElement(Button, { className: cnGptDialog('dislike-button'), view: "normal", size: "m", onClick: handleDislike, selected: feedbackType === 'dislike', loading: feedbackTypeLoading === 'dislike' },
|
|
87
|
+
React.createElement(Icon, { data: ThumbsDown, size: 16 })),
|
|
88
|
+
feedbackType && (React.createElement("span", { className: cnGptDialog('feedback-message') }, i18n('feedback-message'))))),
|
|
89
|
+
React.createElement(ActionTooltip, { title: i18n('close-button'), hotkey: gptHotKeys.closeGpt },
|
|
90
|
+
React.createElement(Button, { className: cnGptDialog('close-button'), view: "flat", size: "m", onClick: onClose }, i18n('close-button'))),
|
|
91
|
+
React.createElement(ActionTooltip, { title: replaceButtonText, hotkey: gptHotKeys.applyResultGpt },
|
|
92
|
+
React.createElement(Button, { className: cnGptDialog('apply-button'), view: "action", size: "m", onClick: handleApplyResult }, replaceButtonText)))))));
|
|
93
|
+
}
|
|
94
|
+
return React.createElement("div", { className: cnGptDialog() },
|
|
95
|
+
" ",
|
|
96
|
+
content,
|
|
97
|
+
" ");
|
|
98
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
.g-md-gpt-dialog-loading-screen__header {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
margin-bottom: 8px;
|
|
5
|
+
}
|
|
6
|
+
.g-md-gpt-dialog-loading-screen__icon {
|
|
7
|
+
margin-right: 4px;
|
|
8
|
+
}
|
|
9
|
+
.g-md-gpt-dialog-loading-screen__text {
|
|
10
|
+
margin-right: 8px;
|
|
11
|
+
font-size: var(--g-text-body-2-font-size);
|
|
12
|
+
font-weight: 500;
|
|
13
|
+
}
|
|
14
|
+
.g-md-gpt-dialog-loading-screen__skeleton-small-button {
|
|
15
|
+
width: 90px;
|
|
16
|
+
height: 28px;
|
|
17
|
+
margin-right: 8px;
|
|
18
|
+
}
|
|
19
|
+
.g-md-gpt-dialog-loading-screen__skeleton-medium-button {
|
|
20
|
+
width: 120px;
|
|
21
|
+
height: 28px;
|
|
22
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Skeleton } from '@gravity-ui/uikit';
|
|
3
|
+
import { cn } from '../../../../../classname';
|
|
4
|
+
import { i18n } from '../../../../../i18n/gpt/loading';
|
|
5
|
+
import GPTLoading from '../../../../../icons/GPTLoading';
|
|
6
|
+
import { IconRefuge } from '../../IconRefuge/IconRefuge';
|
|
7
|
+
import './LoadingScreen.css';
|
|
8
|
+
export const cnGptDialogLoadingScreen = cn('gpt-dialog-loading-screen');
|
|
9
|
+
export const LoadingScreen = () => {
|
|
10
|
+
return (React.createElement("div", { className: cnGptDialogLoadingScreen() },
|
|
11
|
+
React.createElement("div", { className: cnGptDialogLoadingScreen('header') },
|
|
12
|
+
React.createElement(IconRefuge, { containerClassName: cnGptDialogLoadingScreen('icon'), data: GPTLoading, refugeSize: 28, size: 20 }),
|
|
13
|
+
React.createElement("span", { className: cnGptDialogLoadingScreen('text') }, i18n('loading-text'))),
|
|
14
|
+
React.createElement("div", { className: cnGptDialogLoadingScreen('skeleton') },
|
|
15
|
+
React.createElement(Skeleton, { className: cnGptDialogLoadingScreen('skeleton-small-button') }),
|
|
16
|
+
React.createElement(Skeleton, { className: cnGptDialogLoadingScreen('skeleton-medium-button') }))));
|
|
17
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const cnIconRefuge: import("@bem-react/classname").ClassNameFormatter;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { FC } from 'react';
|
|
2
|
+
import type { IconRefugeProps } from './IconRefuge.types';
|
|
3
|
+
import './IconRefuge.css';
|
|
4
|
+
/**
|
|
5
|
+
* Creates a div wrapper above the icon, which sets the min-width and min-height
|
|
6
|
+
* equal to its refugeSize prop, puts the original icon in the middle and
|
|
7
|
+
* proxies the rest of the propses to it.
|
|
8
|
+
*
|
|
9
|
+
* The component is made in order to add margins to icons that have
|
|
10
|
+
* margins are indented, but their svg exactly wrap around the edges of the image
|
|
11
|
+
*
|
|
12
|
+
* It seems that all icons will be square, if not, then you can simply add
|
|
13
|
+
* refugeWidth and refugeHeight
|
|
14
|
+
*/
|
|
15
|
+
export declare const IconRefuge: FC<IconRefugeProps>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { __rest } from "tslib";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Icon } from '@gravity-ui/uikit';
|
|
4
|
+
import { cnIconRefuge } from './IconRefuge.classname';
|
|
5
|
+
import './IconRefuge.css';
|
|
6
|
+
/**
|
|
7
|
+
* Creates a div wrapper above the icon, which sets the min-width and min-height
|
|
8
|
+
* equal to its refugeSize prop, puts the original icon in the middle and
|
|
9
|
+
* proxies the rest of the propses to it.
|
|
10
|
+
*
|
|
11
|
+
* The component is made in order to add margins to icons that have
|
|
12
|
+
* margins are indented, but their svg exactly wrap around the edges of the image
|
|
13
|
+
*
|
|
14
|
+
* It seems that all icons will be square, if not, then you can simply add
|
|
15
|
+
* refugeWidth and refugeHeight
|
|
16
|
+
*/
|
|
17
|
+
export const IconRefuge = (_a) => {
|
|
18
|
+
var { refugeSize, containerClassName, containerStyle, widthOnly, inlineIcon, title, 'aria-label': ariaLabel } = _a, props = __rest(_a, ["refugeSize", "containerClassName", "containerStyle", "widthOnly", "inlineIcon", "title", 'aria-label']);
|
|
19
|
+
if (props.size === refugeSize && !title && !ariaLabel && !containerStyle) {
|
|
20
|
+
return React.createElement(Icon, Object.assign({}, props));
|
|
21
|
+
}
|
|
22
|
+
return (React.createElement("div", { className: cnIconRefuge({ inline: inlineIcon }, containerClassName), title: title, "aria-label": ariaLabel, style: Object.assign({ minWidth: refugeSize, minHeight: widthOnly ? undefined : refugeSize }, containerStyle) },
|
|
23
|
+
React.createElement(Icon, Object.assign({ size: refugeSize }, props))));
|
|
24
|
+
};
|
|
25
|
+
IconRefuge.displayName = 'Icon';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { IconRefuge } from './IconRefuge';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { FC } from 'react';
|
|
2
|
+
import type { GptDialogProps } from '../GptDialog/GptDialog';
|
|
3
|
+
import './Presetlist.css';
|
|
4
|
+
export declare type PresetListProps<PromptData extends unknown = unknown> = {
|
|
5
|
+
disablePromptPresets: GptDialogProps['disablePromptPresets'];
|
|
6
|
+
promptPresets: GptDialogProps['promptPresets'];
|
|
7
|
+
onPresetClick: (data: PromptData) => void;
|
|
8
|
+
};
|
|
9
|
+
export declare const cnGptDialogPresetList: import("@bem-react/classname").ClassNameFormatter;
|
|
10
|
+
export declare const PresetList: FC<PresetListProps>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ActionTooltip, Button, DropdownMenu } from '@gravity-ui/uikit';
|
|
3
|
+
import { cn } from '../../../../classname';
|
|
4
|
+
import { i18n } from '../../../../i18n/gpt/dialog';
|
|
5
|
+
import { gptHotKeys } from '../constants';
|
|
6
|
+
import { useGptHotKeys } from '../hooks/useGptHotKeys';
|
|
7
|
+
import { usePresetList } from '../hooks/usePresetList';
|
|
8
|
+
import './Presetlist.css';
|
|
9
|
+
export const cnGptDialogPresetList = cn('gpt-dialog-preset-list');
|
|
10
|
+
const PresetItem = ({ preset, onPresetClick, disablePromptPresets, hotKey }) => {
|
|
11
|
+
useGptHotKeys(hotKey, () => {
|
|
12
|
+
onPresetClick(preset.data);
|
|
13
|
+
}, { enableOnFormTags: true, enableOnContentEditable: true });
|
|
14
|
+
return (React.createElement(ActionTooltip, { title: preset.display, hotkey: hotKey },
|
|
15
|
+
React.createElement(Button, { className: cnGptDialogPresetList('preset'), view: "normal", size: "m", disabled: disablePromptPresets, onClick: () => onPresetClick(preset.data) }, preset.display)));
|
|
16
|
+
};
|
|
17
|
+
export const PresetList = ({ disablePromptPresets, promptPresets, onPresetClick, }) => {
|
|
18
|
+
const { presetsContainerRef, visiblePresets, hiddenPresets, showMoreButton, measured } = usePresetList({
|
|
19
|
+
promptPresets,
|
|
20
|
+
onPresetClick,
|
|
21
|
+
});
|
|
22
|
+
return (React.createElement("div", { className: cnGptDialogPresetList({ measured }), ref: presetsContainerRef },
|
|
23
|
+
visiblePresets.map((preset, index) => (React.createElement(PresetItem, { preset: preset, key: preset.display, hotKey: preset.hotKey || gptHotKeys.presetsKey(String(index + 1)), disablePromptPresets: disablePromptPresets, onPresetClick: onPresetClick }))),
|
|
24
|
+
showMoreButton && (React.createElement(DropdownMenu, { switcherWrapperClassName: cnGptDialogPresetList('more-button-wrapper'), switcher: React.createElement(Button, { className: cnGptDialogPresetList('more-button'), view: "normal", size: "m" }, i18n('more')), items: hiddenPresets }))));
|
|
25
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { TextSelection } from 'prosemirror-state';
|
|
2
|
+
import { pluginKey } from './plugin';
|
|
3
|
+
export const runGpt = (state, dispatch) => {
|
|
4
|
+
const { selection: sel } = state;
|
|
5
|
+
const meta = { action: 'show', from: sel.from, to: sel.to };
|
|
6
|
+
const tr = state.tr.setMeta(pluginKey, meta);
|
|
7
|
+
dispatch === null || dispatch === void 0 ? void 0 : dispatch(tr.setSelection(TextSelection.create(tr.doc, sel.to)));
|
|
8
|
+
return true;
|
|
9
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { PopupProps } from '@gravity-ui/uikit/build/esm/components/Popup/Popup';
|
|
2
|
+
export declare const WIDGET_DECO_CLASS_NAME = "g-md-gpt-widget-deco";
|
|
3
|
+
export declare const WIDGET_DECO_SPEC_FLAG = "gpt_widget_deco";
|
|
4
|
+
export declare const gptPopupPlacement: PopupProps['placement'];
|
|
5
|
+
export declare const gptHotKeys: {
|
|
6
|
+
openGptKey: string;
|
|
7
|
+
openGptKeyTooltip: string;
|
|
8
|
+
presetsKey: (key: string) => string;
|
|
9
|
+
tryAgainGpt: string;
|
|
10
|
+
freshStartGpt: string;
|
|
11
|
+
applyResultGpt: string;
|
|
12
|
+
closeGpt: string;
|
|
13
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export const WIDGET_DECO_CLASS_NAME = 'g-md-gpt-widget-deco';
|
|
2
|
+
export const WIDGET_DECO_SPEC_FLAG = 'gpt_widget_deco';
|
|
3
|
+
export const gptPopupPlacement = ['bottom-start', 'top-start'];
|
|
4
|
+
export const gptHotKeys = {
|
|
5
|
+
openGptKey: 'Mod-h',
|
|
6
|
+
openGptKeyTooltip: 'Mod+h',
|
|
7
|
+
presetsKey: (key) => `Control+${key}`,
|
|
8
|
+
tryAgainGpt: 'Control+t',
|
|
9
|
+
freshStartGpt: 'Control+r',
|
|
10
|
+
applyResultGpt: 'Enter',
|
|
11
|
+
closeGpt: 'Escape',
|
|
12
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Action, ExtensionWithOptions } from 'src/core';
|
|
2
|
+
import type { CommonAnswer } from '../ErrorScreen/types';
|
|
3
|
+
import type { GptWidgetDecoViewParams } from './view';
|
|
4
|
+
export declare const gptActionName = "addGptWidget";
|
|
5
|
+
export declare type GptWidgetOptions<AnswerData extends CommonAnswer = CommonAnswer, PromptData extends unknown = unknown> = Pick<GptWidgetDecoViewParams<AnswerData, PromptData>, 'gptPopupContainer' | 'answerRender' | 'onApplyResult' | 'promptPresets' | 'customPromptPlaceholder' | 'disabledPromptPlaceholder' | 'onCustomPromptApply' | 'onPromptPresetClick' | 'onTryAgain' | 'onLike' | 'onDislike' | 'onClose' | 'onUpdate' | 'gptAlertProps'>;
|
|
6
|
+
export declare const gptExtension: ExtensionWithOptions<GptWidgetOptions>;
|
|
7
|
+
declare global {
|
|
8
|
+
namespace WysiwygEditor {
|
|
9
|
+
interface Actions {
|
|
10
|
+
[gptActionName]: Action<{}>;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { showGptWidget } from '../actions';
|
|
2
|
+
import { runGpt } from '../commands';
|
|
3
|
+
import { gptHotKeys } from '../constants';
|
|
4
|
+
import { gptWidgetPlugin } from '../plugin';
|
|
5
|
+
export const gptActionName = 'addGptWidget';
|
|
6
|
+
export const gptExtension = (builder, options) => {
|
|
7
|
+
builder.addAction(gptActionName, showGptWidget);
|
|
8
|
+
builder.addPlugin(({ serializer, markupParser }) => {
|
|
9
|
+
return gptWidgetPlugin(Object.assign(Object.assign({}, options), { serializer, parser: markupParser }));
|
|
10
|
+
});
|
|
11
|
+
builder.addKeymap(() => ({
|
|
12
|
+
[gptHotKeys.openGptKey]: runGpt,
|
|
13
|
+
}), builder.Priority.VeryLow);
|
|
14
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
.g-md-gpt-widget-deco {
|
|
2
|
+
background-color: var(--g-color-base-info-light-hover);
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.g-md-gpt-popup {
|
|
6
|
+
--layer-navigation-bar: 900;
|
|
7
|
+
pointer-events: initial;
|
|
8
|
+
}
|
|
9
|
+
.g-md-gpt-popup[class] {
|
|
10
|
+
border-radius: var(--g-spacing-2);
|
|
11
|
+
}
|
|
12
|
+
.g-md-gpt-popup__content {
|
|
13
|
+
width: 720px;
|
|
14
|
+
padding: var(--g-spacing-3);
|
|
15
|
+
pointer-events: all;
|
|
16
|
+
box-shadow: -8px 2px 16px -4px var(--g-color-private-purple-150), 8px 2px 16px -4px var(--g-color-private-blue-150);
|
|
17
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { PopupProps } from '@gravity-ui/uikit';
|
|
2
|
+
import type { EditorState, PluginView } from 'prosemirror-state';
|
|
3
|
+
import { EditorView } from 'prosemirror-view';
|
|
4
|
+
import { Parser, Serializer } from 'src/core';
|
|
5
|
+
import type { CommonAnswer } from '../ErrorScreen/types';
|
|
6
|
+
import type { GptDialogProps } from '../GptDialog/GptDialog';
|
|
7
|
+
import './view.css';
|
|
8
|
+
export declare const cnGptPopup: import("@bem-react/classname").ClassNameFormatter;
|
|
9
|
+
export declare type GptWidgetDecoViewParams<AnswerData extends CommonAnswer = CommonAnswer, PromptData extends unknown = unknown> = Omit<GptDialogProps<AnswerData, PromptData>, 'markup' | 'onApplyResult'> & {
|
|
10
|
+
serializer: Serializer;
|
|
11
|
+
parser: Parser;
|
|
12
|
+
} & {
|
|
13
|
+
onApplyResult?: GptDialogProps['onApplyResult'];
|
|
14
|
+
gptPopupContainer?: PopupProps['container'];
|
|
15
|
+
};
|
|
16
|
+
export declare class GptWidgetDecoView implements Required<PluginView> {
|
|
17
|
+
private readonly _view;
|
|
18
|
+
private readonly _renderer;
|
|
19
|
+
private _decoElem;
|
|
20
|
+
private _params;
|
|
21
|
+
private _serializer;
|
|
22
|
+
private _parser;
|
|
23
|
+
private _confirmOpen;
|
|
24
|
+
constructor(view: EditorView, params: GptWidgetDecoViewParams);
|
|
25
|
+
update(view: EditorView, prevState: EditorState): void;
|
|
26
|
+
destroy(): void;
|
|
27
|
+
private _resetState;
|
|
28
|
+
private _onConfirmCancel;
|
|
29
|
+
private _onConfirmOk;
|
|
30
|
+
private _render;
|
|
31
|
+
private _onGptAnswerUpdate;
|
|
32
|
+
private _onSubmit;
|
|
33
|
+
private _onClose;
|
|
34
|
+
private _getContentOfDecoration;
|
|
35
|
+
private _getCurrentDecoration;
|
|
36
|
+
private _getPluginState;
|
|
37
|
+
}
|