chore: format all frontend files (#430)

This commit is contained in:
tecvan
2025-07-31 23:15:48 +08:00
committed by GitHub
parent 8b078ff013
commit 6995cec404
8787 changed files with 11975 additions and 10924 deletions

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { getIsLastGroup } from '../src/utils/get-is-last-group';
it('getIsLastGroupCorrectly', () => {

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { getIsPushedMessage } from '../src/utils/get-is-pushed-message';
vi.mock('@coze-common/chat-area', () => ({

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { getShowFeedback } from '../src/utils/get-show-feedback';
vi.mock('@coze-common/chat-area', () => ({

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { getShowRegenerate } from '../src/utils/get-show-regenerate';
vi.mock('@coze-common/chat-area', () => ({

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { type PropsWithChildren } from 'react';
import s from './index.module.less';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { type PropsWithChildren } from 'react';
import classNames from 'classnames';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { type ReactNode } from 'react';
import classNames from 'classnames';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { type ComponentProps, useState, type PropsWithChildren } from 'react';
import copy from 'copy-to-clipboard';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { type ComponentProps, type PropsWithChildren } from 'react';
import classNames from 'classnames';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import classNames from 'classnames';
export interface AnswerActionDividerProps {

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import React, {
type CSSProperties,
useRef,

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import classNames from 'classnames';
import {
useDeleteMessageGroup,

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { type ComponentProps, type PropsWithChildren } from 'react';
import classNames from 'classnames';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { type ComponentProps, type PropsWithChildren } from 'react';
import classNames from 'classnames';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { useRef } from 'react';
import { useHover } from 'ahooks';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {
getIsNotificationMessage,
useLatestSectionId,

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { type PropsWithChildren } from 'react';
import { AnswerActionStoreContext } from '../store/context';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { createContext } from 'react';
import { type ChatAnswerActionPreference } from './type';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { useContext } from 'react';
import { AnswerActionPreferenceContext } from './context';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export interface ChatAnswerActionPreference {
enableBotTriggerControl: boolean;
}

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { createContext, type PropsWithChildren } from 'react';
import { useRequest } from 'ahooks';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { useContext } from 'react';
import { ReportMessageFeedbackFnContext } from './context';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { type ChatCore } from '@coze-common/chat-core';
export type ReportMessageFeedbackFn = ChatCore['reportMessage'];

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { createContext } from 'react';
import { type StoreSet } from './type';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { useContext } from 'react';
import { AnswerActionStoreContext } from './context';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { type FavoriteBotTriggerConfigStore } from '../../store/favorite-bot-trigger-config';
export interface StoreSet {

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { type RefObject, useEffect } from 'react';
/**

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { useRequest } from 'ahooks';
import { type GetBotParticipantInfoByBotIdsResponse } from '@coze-arch/bot-api/developer_api';
import { DeveloperApi } from '@coze-arch/bot-api';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { useCreation } from 'ahooks';
import { createFavoriteBotTriggerConfigStore } from '../store/favorite-bot-trigger-config';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { type GrabPluginBizContext } from '@coze-common/chat-area-plugin-message-grab';
import { PluginName, useWriteablePlugin } from '@coze-common/chat-area';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { useToggle } from 'ahooks';
import {
ReportMessageAction,

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { useChatAreaLayout } from '@coze-common/chat-area/hooks/public/common';
import { Layout } from '@coze-common/chat-uikit-shared';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { useRequest } from 'ahooks';
import { TriggerEnabled } from '@coze-arch/bot-api/developer_api';
import { DeveloperApi } from '@coze-arch/bot-api';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export { ActionBarContainer } from './components/action-bar-container';
export { ActionBarHoverContainer } from './components/action-bar-hover-container';
export {

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export enum ReportEventNames {
/** Original name: chat_area_tts_voice_ws */
TtsVoiceWs = 'chat_answer_action_start_TTS',

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { devtools } from 'zustand/middleware';
import { create } from 'zustand';
import { produce } from 'immer';

View File

@@ -13,5 +13,5 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/// <reference types='@coze-arch/bot-typings' />

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { type MessageMeta } from '@coze-common/chat-area';
export const getIsLastGroup = ({

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {
type Message,
getIsNotificationMessage,

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { messageSource, taskType } from '@coze-common/chat-core';
import { type Message, type MessageMeta } from '@coze-common/chat-area';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { type Message, type MessageMeta } from '@coze-common/chat-area';
import { getIsPushedMessage } from './get-is-pushed-message';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { type Message, type MessageMeta } from '@coze-common/chat-area';
import { getIsPushedMessage } from './get-is-pushed-message';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { defineConfig } from '@coze-arch/vitest-config';
export default defineConfig({

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { memo, useEffect, useRef, useState, type FC } from 'react';
import { type Message, type ContentType } from '@coze-common/chat-core';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { type PluginRegistryEntry } from '@coze-common/chat-area';
import { type PluginBizContext } from './types/biz-context';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {
PluginMode,
PluginName,

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { type ReadonlyAppLifeCycleServiceGenerator } from '@coze-common/chat-area';
import { type PluginBizContext } from '../../types/biz-context';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { type ReadonlyCommandLifeCycleServiceGenerator } from '@coze-common/chat-area';
import { type PluginBizContext } from '../../types/biz-context';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { type ReadonlyLifeCycleServiceGenerator } from '@coze-common/chat-area';
import { type PluginBizContext } from '../../types/biz-context';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { type ReadonlyMessageLifeCycleServiceGenerator } from '@coze-common/chat-area';
import { type PluginBizContext } from '../../types/biz-context';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { type ReadonlyRenderLifeCycleServiceGenerator } from '@coze-common/chat-area';
import { type PluginBizContext } from '../../types/biz-context';

View File

@@ -13,5 +13,5 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export type PluginBizContext = Record<string, unknown>;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { defineConfig } from '@coze-arch/vitest-config';
export default defineConfig({

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { getReceiveMessageBoxTheme } from '../../src/utils/components/get-receive-message-box-theme';
// eslint-disable-next-line @typescript-eslint/naming-convention

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { getThinkingPlaceholderTheme } from '../../src/utils/components/get-thinking-placeholder-theme';
describe('test get thinking placeholder theme', () => {

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import React from 'react';
import { renderHook, act } from '@testing-library/react-hooks';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* eslint-disable -- test */
vi.mock(
'../../chat-area-utils/src/parse-markdown/parse-markdown-to-text.ts',

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { describe, expect, it } from 'vitest';
import { LoadDirection } from '@coze-common/chat-core';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { describe, expect, it } from 'vitest';
import { type MessageIndexRange } from '../../../src/store/messages';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { computedStyleToNumber } from '../../../src/utils/dom/computed-style-to-number';
describe('computedStyleToNumber', () => {

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { findRespondRecord, type Responding } from '../../src/store/waiting';
vi.mock('@coze-common/chat-core', () => ({

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { getIsGroupChatActive } from '../../src/utils/message-group/get-is-group-chat-active';
import { WaitingPhase } from '../../src/store/waiting';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { ContentType, type Message } from '@coze-common/chat-core';
import { getResponse } from '../../src/store/waiting';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { isFileCountExceedsLimit } from '../../src/utils/is-file-count-exceeds-limit';
describe('is-file-count-exceeds-limit', () => {

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { isFallbackErrorMessage } from '../../src/utils/message';
vi.mock('@coze-common/chat-core', () => ({

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {
type RefObject,
forwardRef,

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { useShallow } from 'zustand/react/shallow';
import classNames from 'classnames';
import { useCountDown } from 'ahooks';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { useRef } from 'react';
import classNames from 'classnames';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import s from './index.module.less';
export const ProgressMask: React.FC<{ percent: number }> = ({ percent }) => (

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { IconCloseNoCycle } from '@coze-arch/bot-icons';
import { useDeleteFile } from '../../../hooks/file/use-delete-file';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { memo } from 'react';
import { useShallow } from 'zustand/react/shallow';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { useMemo, useRef, useState } from 'react';
import classNames from 'classnames';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { type PropsWithChildren } from 'react';
import { IconRefresh } from '@coze-arch/bot-icons';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { useEffect, useRef, useState } from 'react';
import { useShallow } from 'zustand/react/shallow';

View File

@@ -13,4 +13,3 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { ToNewestTip } from '../to-newest-tip';
import { AbsoluteRow } from '../absolute-row';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import React, { useRef, type FC, type PropsWithChildren } from 'react';
import cls from 'classnames';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { createPortal } from 'react-dom';
import React, {
forwardRef,

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export {
ChatInputIntegration,
type ChatInputIntegrationSlots,

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import React, { type FC, type PropsWithChildren } from 'react';
import classNames from 'classnames';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* eslint-disable @coze-arch/max-line-per-function -- ChatInput */
import {
forwardRef,

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { type FC } from 'react';
import { ContentBox as UIKitContentBox } from '@coze-common/chat-uikit';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { useState, type FC } from 'react';
import { useShallow } from 'zustand/react/shallow';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import classNames from 'classnames';
import { useShowBackGround } from '../../hooks/public/use-show-bgackground';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import classNames from 'classnames';
import { IllustrationNoContent } from '@douyinfe/semi-illustrations';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { Tag } from '@coze-arch/coze-design';
export interface APITagProps {

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { type ReactNode } from 'react';
import classNames from 'classnames';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* eslint-disable @coze-arch/max-line-per-function */
import {
type CSSProperties,

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { type PropsWithChildren, type ReactNode } from 'react';
import { object as zObject, string as zString, type TypeOf } from 'zod';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* eslint-disable @coze-arch/max-line-per-function */
import { type RefObject, useRef, useState } from 'react';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { I18n } from '@coze-arch/i18n';
import { RecallSlices } from '@coze-data/llmPlugins';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { type PropsWithChildren } from 'react';
import classNames from 'classnames';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { useShallow } from 'zustand/react/shallow';
import classNames from 'classnames';
import { MessageBox as UIKitMessageBox } from '@coze-common/chat-uikit';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { useEffect, type FC } from 'react';
import {

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {
type PropsWithChildren,
useDeferredValue,

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { type FC } from 'react';
import { I18n } from '@coze-arch/i18n';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import type { CSSProperties, ReactNode } from 'react';
import copy from 'copy-to-clipboard';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { IconSpin } from '@douyinfe/semi-icons';
import { type FunctionCallMessage } from '../../../store/types';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { memo } from 'react';
import { shallow } from 'zustand/vanilla/shallow';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { useEffect, useRef } from 'react';
import { useInViewport } from 'ahooks';

Some files were not shown because too many files have changed in this diff Show More