chore: replace all cn comments of fe to en version by volc api (#320)
This commit is contained in:
@@ -26,7 +26,7 @@ export interface InsertLinkPopoverProps
|
||||
}
|
||||
|
||||
/**
|
||||
* 全受控
|
||||
* fully controlled
|
||||
*/
|
||||
export const InsertLinkPopover: React.FC<
|
||||
PropsWithChildren<InsertLinkPopoverProps>
|
||||
|
||||
@@ -29,7 +29,7 @@ export const getSyncInsertText = (action: SyncAction): string => {
|
||||
}
|
||||
|
||||
/**
|
||||
* 不应该走到这里
|
||||
* Shouldn't have come here
|
||||
*/
|
||||
primitiveExhaustiveCheck(type);
|
||||
return '';
|
||||
|
||||
@@ -126,7 +126,7 @@ export const useMarkdownEditor = ({
|
||||
ref.current.focus();
|
||||
const { selectionEnd } = ref.current;
|
||||
/**
|
||||
* 选中文字时点击 action bar, 将内容插入到文字的末尾
|
||||
* When the text is selected, click the action bar to insert the content at the end of the text
|
||||
*/
|
||||
const insertTextAtPosition = getInsertTextAtPosition({
|
||||
text: value,
|
||||
|
||||
@@ -24,7 +24,7 @@ import { Toast } from '@coze-arch/bot-semi';
|
||||
import { type UploadState } from '../type';
|
||||
import { UploadController } from '../service/upload-controller';
|
||||
/**
|
||||
* 暂时没有场景,所以这里将多实例、一次行上传多文件的能力屏蔽了
|
||||
* There is no scene for the time being, so the ability to upload multiple files with multiple instances and one line is blocked here.
|
||||
*/
|
||||
export const useUpload = ({
|
||||
getUserId,
|
||||
|
||||
@@ -33,12 +33,12 @@ export interface MarkdownEditorProps {
|
||||
style?: CSSProperties;
|
||||
maxLength?: number | undefined;
|
||||
getValueLength?: (value: string) => number;
|
||||
/** 超过最大长度时截断函数 */
|
||||
/** Truncated function when maximum length is exceeded */
|
||||
getSlicedTextOnExceed?: (value: string) => string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 全受控组件
|
||||
* fully controlled component
|
||||
*/
|
||||
export const MarkdownEditor: React.FC<MarkdownEditorProps> = ({
|
||||
value,
|
||||
|
||||
@@ -13,8 +13,8 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/* eslint-disable @coze-arch/no-deep-relative-import -- 纯 ui 渲染 */
|
||||
|
||||
/* eslint-disable @coze-arch/no-deep-relative-import -- pure ui rendering */
|
||||
import { type PropsWithChildren, type ComponentProps } from 'react';
|
||||
|
||||
import { I18n } from '@coze-arch/i18n';
|
||||
|
||||
@@ -53,7 +53,7 @@ export interface OnboardingMarkdownModalProps
|
||||
prologue: string;
|
||||
onPrologueChange: (prologue: string) => void;
|
||||
/**
|
||||
* 要预览的和能编辑的可能不一样
|
||||
* What you want to preview and what you can edit may be different.
|
||||
*/
|
||||
previewSuggestions?: BotEditorOnboardingSuggestion[];
|
||||
}
|
||||
|
||||
@@ -31,11 +31,11 @@ export const matchAllTemplateRanges = (
|
||||
text: string,
|
||||
template: string,
|
||||
): { start: number; end: number }[] => {
|
||||
// 正则表达式,用于匹配双花括号内的内容
|
||||
// Regular expressions to match the contents of double curly braces
|
||||
const templateRegex = new RegExp(getFixedVariableTemplate(template), 'g');
|
||||
const matches: { start: number; end: number }[] = [];
|
||||
|
||||
// 循环查找所有匹配项
|
||||
// Loop through all matches
|
||||
while (true) {
|
||||
const match = templateRegex.exec(text);
|
||||
|
||||
|
||||
@@ -90,14 +90,14 @@ export const getShuffledSuggestions = ({
|
||||
suggestion => suggestion.id,
|
||||
);
|
||||
|
||||
// chatArea 数据中比交集多的就是要删除的
|
||||
// There are more than intersections in the chatArea data that need to be deleted.
|
||||
const toDeleteSuggestion = xorBy(
|
||||
shuffledSuggestions,
|
||||
intersectionSuggestion,
|
||||
suggestion => suggestion.id,
|
||||
);
|
||||
|
||||
// bot 调试页面数据中比交集多的就是要添加的
|
||||
// There is more than intersection in the data of the bot debugging page, which needs to be added.
|
||||
const toAddSuggestion = preVisibleSuggestion.slice(
|
||||
0,
|
||||
maxLength - intersectionSuggestion.length,
|
||||
|
||||
Reference in New Issue
Block a user