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 { convertModelParamsToSchema } from '../src/utils/model/convert-model-params-to-schema';
import {
ModelFormComponent,

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { getFixedSingleAgentSchema } from '../src/utils/model/get-fixed-single-agent-schema';
import {
ModelFormComponent,

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { getModelClassSortList } from '../src/utils/model/get-model-class-sort-list';
vi.mock('@coze-studio/bot-detail-store', () => ({}));

View File

@@ -51,7 +51,7 @@ const getToolGroupText = (key: ToolGroupKey): string =>
[ToolGroupKey.DIALOG]: I18n.t('bot_edit_type_dialog'),
[ToolGroupKey.CHARACTER]: I18n.t('bot_edit_type_character'),
[ToolGroupKey.HOOKS]: 'Hooks',
})[key];
}[key]);
const getToolText = (toolKey: ToolKey) =>
({
@@ -75,7 +75,7 @@ const getToolText = (toolKey: ToolKey) =>
[ToolKey.SHORTCUT]: I18n.t('bot_ide_shortcut'),
[ToolKey.DEV_HOOKS]: 'Hooks',
[ToolKey.USER_INPUT]: I18n.t('chat_setting_user_input_default_mode'),
})[toolKey];
}[toolKey]);
const AlertGroups: FC<{ items: AlertItem[] }> = ({ items }) => {
const grouped = groupBy(items, 'groupTitle');
@@ -296,7 +296,7 @@ const getGroupTittleByConfigType = (type: ModelFuncConfigType): string =>
'agentflow_transfer_ conversation_settings_title',
),
[ModelFuncConfigType.HookInfo]: 'Hooks',
})[type];
}[type]);
const getTitleByConfigType = (type: ModelFuncConfigType): string =>
// @ts-expect-error fix me late
@@ -325,7 +325,7 @@ const getTitleByConfigType = (type: ModelFuncConfigType): string =>
'agentflow_transfer_ conversation_settings_mode_node_title',
),
[ModelFuncConfigType.HookInfo]: 'Hooks',
})[type];
}[type]);
export const mapConfigTypeToAlertItem = (
type: ModelFuncConfigType,

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { type ReactNode, useState } from 'react';
import { useRegisteredToolKeyConfigList } from '@coze-agent-ide/tool';

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 { useField } from '@formily/react';

View File

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

View File

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

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import React, { type CSSProperties } 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 React, { useState, type CSSProperties } from 'react';
import { groupBy } from 'lodash-es';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { type CSSProperties } 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 JSXComponent } from '@formily/react';
import { InputSlider, type InputSliderProps } from '@coze-studio/components';
import {

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export { ModelOption, ModelOptionProps } from './model-option';
export { ModelOptionGroup, ModelOptionGroupProps } from './model-option-group';
export { ModelOptionThumb } from './model-option-thumb';

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 cls from 'classnames';

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 { Avatar, Tag } from '@coze-arch/coze-design';
import { type Model } from '@coze-arch/bot-api/developer_api';

View File

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

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { useState } from 'react';
import { useShallow } from 'zustand/react/shallow';
@@ -69,8 +69,8 @@ export function ModelSelect({
const canSelectSuperiorModel = isBoolean(canSelectSuperiorModelProps)
? canSelectSuperiorModelProps
: IS_OVERSEA
? !isFree
: isBenefitAvailable;
? !isFree
: isBenefitAvailable;
const [upgradeModalState, setUpgradeModalState] = useState<{
type?: 'new' | 'advance';
visible: boolean;

View File

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

View File

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

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { useMemo, useState } 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 { type FC, useMemo, useState } 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.
*/
export enum ModelFormComponent {
SliderInputNumber = 'SliderInputNumber',
Input = 'Input',

View File

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

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 { FormilyContext } from './context';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* eslint-disable @coze-arch/no-batch-import-or-export */
import type * as FormilyReact from '@formily/react';
import type * as FomilyCore from '@formily/core';

View File

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

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 { ModelFromContext, ModelFormProvider } from './context';

View File

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

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 { nanoid } from 'nanoid';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { useBotEditor } from '@coze-agent-ide/bot-editor-context-store';
import { getFixedSingleAgentSchema } from '../../utils/model/get-fixed-single-agent-schema';

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 { useModelStore as useBotDetailModelStore } from '@coze-studio/bot-detail-store/model';
import {

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export { ModelForm, ModelFormProps } from './components/model-form';
export { convertFormValueToModelInfo } from './utils/model/convert-form-value-to-model-info';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export enum ReportEventNames {
ImportFormilyModuleError = 'import_formily_module_error',
GetTypeListError = 'get_type_list_error',

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,6 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export const primitiveExhaustiveCheck = (_: never) => 0;
export const recordExhaustiveCheck = (_: Record<string, never>) => 0;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import type { DataField, Form, GeneralField } from '@formily/core';
import { I18n, type I18nKeysNoOptionsType } from '@coze-arch/i18n';
import {

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export type NestedObject = Record<string, never>;
export function flattenObject(obj: NestedObject): NestedObject {

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { type Agent } from '@coze-studio/bot-detail-store';
import { type Dataset, FormatType } from '@coze-arch/bot-api/knowledge';
import {

View File

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

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { type ModelInfo } from '@coze-arch/bot-api/developer_api';
import { type NestedObject, flattenObject } from '../flatten-object';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { groupBy, merge, uniqBy } from 'lodash-es';
import { type SchemaTypes, type ISchema } from '@formily/react';
import {

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { ModelStyle } from '@coze-arch/bot-api/developer_api';
import { type ModelPresetValues } from '@coze-agent-ide/bot-editor-context-store';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { cloneDeep } from 'lodash-es';
import {
ModelParamType,

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { cloneDeep, isObject } from 'lodash-es';
import { type ISchema } from '@formily/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 { uniq } from 'lodash-es';
/**
* Sort in the order in which the class id first appears

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { type Model } from '@coze-arch/bot-api/developer_api';
export const getModelOptionList = ({

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(