chore: format all frontend files (#430)
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import {
|
||||
useEffect,
|
||||
useState,
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import {
|
||||
type PropsWithChildren,
|
||||
createContext,
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -13,5 +13,5 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
/// <reference types='@coze-arch/bot-typings' />
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import {
|
||||
type ShortMemPolicy,
|
||||
type ModelInfo,
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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';
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 = ({
|
||||
|
||||
Reference in New Issue
Block a user