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
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8787 changed files with 11975 additions and 10924 deletions

View File

@ -1,4 +1,20 @@
#!/bin/bash
#
# Copyright 2025 coze-dev Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Set default value
TARGET_BRANCH=${targetBranch}
@ -67,14 +83,13 @@ if [ -n "$large_files_info" ]; then
\"name\": \"文件体积\",
\"conclusion\": \"failed\",
\"output\": {
\"summary\": \"<h1>错误: 文件体积过大</h1> <br /> 以下文件体积超过限制 (${size_limit}KB): \\n \\n $large_files_info \\n \\n <br /> 你可以将资源上传到CDN并通过URL使用。详情请参考此[文档](https://bytedance.larkoffice.com/wiki/MjoIwfyGyiVCBFkBgnXc8LFTniX)。<br /> 如遇紧急情况,可以联系 [@fanwenjie.fe](https://code.byted.org/fanwenjie.fe) 跳过此错误。\"
\"summary\": \"<h1>错误: 文件体积过大</h1> <br /> 以下文件体积超过限制 (${size_limit}KB): \\n \\n $large_files_info \\n \\n <br /> \"
}
}"
output_conclusion "$CONCLUSION"
else
echo "错误: 以下文件体积超过限制 (${size_limit}KB):"
echo -e "$large_files_info"
echo "请将大文件上传到CDN并通过URL使用。详情请参考: https://bytedance.larkoffice.com/wiki/MjoIwfyGyiVCBFkBgnXc8LFTniX"
exit 1
fi
else

View File

@ -19,7 +19,9 @@ import path from 'path';
import { defineConfig } from '@coze-arch/rsbuild-config';
import { GLOBAL_ENVS } from '@coze-arch/bot-env';
const API_PROXY_TARGET = `http://localhost:${process.env.WEB_SERVER_PORT || 8888}/`;
const API_PROXY_TARGET = `http://localhost:${
process.env.WEB_SERVER_PORT || 8888
}/`;
const mergedConfig = defineConfig({
server: {

View File

@ -74,3 +74,4 @@
"typescript": "~5.8.2"
}
}

View File

@ -25,3 +25,4 @@
"@types/node": "^18"
}
}

View File

@ -48,7 +48,9 @@ export const overrideBrowserslist = [
const generateCdnPrefix = () => {
if (process.env.CDN_INNER_CN) {
return `https://${process.env.CDN_INNER_CN}/${process.env.CDN_PATH_PREFIX ? `${process.env.CDN_PATH_PREFIX}/` : ''}`;
return `https://${process.env.CDN_INNER_CN}/${
process.env.CDN_PATH_PREFIX ? `${process.env.CDN_PATH_PREFIX}/` : ''
}`;
}
return '/';
};

View File

@ -25,3 +25,4 @@
"sucrase": "^3.32.0"
}
}

View File

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

View File

@ -20,3 +20,4 @@
"typescript": "~5.8.2"
}
}

View File

@ -23,3 +23,4 @@
"vitest": "~3.0.5"
}
}

View File

@ -27,8 +27,8 @@
"devDependencies": {
"@babel/eslint-parser": "~7.25.8",
"@babel/eslint-plugin": "~7.25.7",
"@eslint/js": "~9.12.0",
"@coze-arch/ts-config": "workspace:*",
"@eslint/js": "~9.12.0",
"@types/eslint": "~9.6.1",
"@types/estree": "^1.0.1",
"@types/node": "^18",
@ -47,3 +47,4 @@
"vitest": "~3.0.5"
}
}

View File

@ -37,8 +37,14 @@ export const noNewErrorRule: Rule.RuleModule = {
node,
messageId: 'no-new-error',
fix(fixer) {
const args = node.arguments.map(arg => context.sourceCode.getText(arg)).join(',') || '\'custom error\'';
return fixer.replaceText(node, `new CustomError('normal_error', ${args})`);
const args =
node.arguments
.map(arg => context.sourceCode.getText(arg))
.join(',') || "'custom error'";
return fixer.replaceText(
node,
`new CustomError('normal_error', ${args})`,
);
},
});
}

View File

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

View File

@ -20,7 +20,6 @@ import { RuleTester } from 'eslint';
import parser from '@typescript-eslint/parser';
import { tsxNoLeakedRender } from '.';
const ruleTester = new RuleTester({
languageOptions: {
parser,

View File

@ -182,7 +182,7 @@ const document = t.parse(
'index.proto': indexContent,
'base.proto': baseContent,
'extra.proto': extraContent,
}
},
);
const statement = document.statements[0] as t.InterfaceWithFields;
console.log(statement);

View File

@ -155,7 +155,9 @@ function reviseFieldComments(struct: InterfaceWithFields) {
const { fields } = struct;
/* istanbul ignore next */
if (fields.length < 2) {return;}
if (fields.length < 2) {
return;
}
for (let i = fields.length - 1; i > 0; i--) {
const currentField = fields[i];
@ -183,7 +185,9 @@ function reviseEnumMemberComments(enm: EnumDefinition) {
const { members } = enm;
/* istanbul ignore next */
if (members.length < 2) {return;}
if (members.length < 2) {
return;
}
for (let i = 0; i < members.length - 1; i++) {
const currentMember = members[i];
@ -203,7 +207,9 @@ function reviseEnumMemberComments(enm: EnumDefinition) {
function reviseFunctionComments(service: ServiceDefinition) {
const { functions } = service;
if (functions.length < 2) {return;}
if (functions.length < 2) {
return;
}
for (let i = 0; i < functions.length - 1; i++) {
const currentFunction = functions[i];

View File

@ -317,13 +317,15 @@ function createAddNamespaceReferValue(
const identifierValue = (fieldType as Identifier).value;
if (!identifierValue.includes('.')) {
(fieldType as Identifier).namespaceValue =
`${namespace}.${identifierValue}`;
(
fieldType as Identifier
).namespaceValue = `${namespace}.${identifierValue}`;
} else {
const parts = identifierValue.split('.');
if (parts.length === 2 && enumNames.includes(parts[0])) {
(fieldType as Identifier).namespaceValue =
`${namespace}.${identifierValue}`;
(
fieldType as Identifier
).namespaceValue = `${namespace}.${identifierValue}`;
} else {
for (const regExp of regExpNamespaceMap.keys()) {
if (regExp.test(identifierValue)) {

View File

@ -14,7 +14,12 @@
* limitations under the License.
*/
import { SyntaxType, type ContainerType, type MapType, type FieldType } from './type';
import {
SyntaxType,
type ContainerType,
type MapType,
type FieldType,
} from './type';
export function convertIntToString(fType: FieldType): FieldType {
const fieldType = { ...fType };

View File

@ -27,7 +27,9 @@ export function mergeObject(
...sources: { [key: string]: any }[]
): { [key: string]: any } {
const newObj = { ...target };
if (!sources) {return newObj;}
if (!sources) {
return newObj;
}
for (const source of sources) {
for (const key of Object.keys(source)) {

View File

@ -36,3 +36,4 @@
"vitest": "~3.0.5"
}
}

View File

@ -45,3 +45,4 @@
"vitest": "~3.0.5"
}
}

View File

@ -196,7 +196,9 @@ export class MockTransformerPlugin implements IPlugin {
const { name, returnType, fields } = f;
const reqType = fields[0].fieldType as any;
const resType = this.processReqResPramsType(returnType, ctx.ast);
return `${name.value}:{req:${parseId(reqType.value)},res:${parseId(resType)}}`;
return `${name.value}:{req:${parseId(reqType.value)},res:${parseId(
resType,
)}}`;
})}}`,
) as t.ExpressionStatement;
return variableDeclaration;

View File

@ -33,3 +33,4 @@
"vitest": "~3.0.5"
}
}

View File

@ -30,7 +30,9 @@ export const configCenter = new ConfigCenter();
export function registerConfig(service: string, config: IdlConfig): void {
if (configCenter.getConfig(service)) {
console.warn(`${service} api config has already been set,make sure they are the same`);
console.warn(
`${service} api config has already been set,make sure they are the same`,
);
}
configCenter.register(service, config);
}

View File

@ -40,7 +40,12 @@ export interface CancelAbleApi<T, K, O = unknown, B extends boolean = false>
* @returns
*/
// eslint-disable-next-line max-params
export function createAPI<T extends {}, K, O = unknown, B extends boolean = false>(
export function createAPI<
T extends {},
K,
O = unknown,
B extends boolean = false,
>(
meta: IMeta,
cancelable?: B,
useCustom = false,

View File

@ -19,3 +19,4 @@
"vitest": "~3.0.5"
}
}

View File

@ -1,3 +1,19 @@
/*
* Copyright 2025 coze-dev Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import OriginPkgRootWebpackPlugin from '@coze-arch/pkg-root-webpack-plugin-origin';
type PkgRootWebpackPluginOptions = Record<string, unknown>;
declare class PkgRootWebpackPlugin extends OriginPkgRootWebpackPlugin {

View File

@ -36,7 +36,10 @@ import {
getPublishResult,
} from '@coze-agent-ide/space-bot';
import { I18n } from '@coze-arch/i18n';
import { IconCozEmpty, IconCozInfoCircleFill } from '@coze-arch/coze-design/icons';
import {
IconCozEmpty,
IconCozInfoCircleFill,
} from '@coze-arch/coze-design/icons';
import { Tooltip } from '@coze-arch/coze-design';
import { type DynamicParams } from '@coze-arch/bot-typings/teamspace';
import { EVENT_NAMES, sendTeaEvent } from '@coze-arch/bot-tea';

View File

@ -26,7 +26,10 @@ import {
} from '@coze-agent-ide/space-bot';
import { MonetizePublishInfo } from '@coze-studio/components/monetize';
import { I18n } from '@coze-arch/i18n';
import { IconCozArrowRight, IconCozDiamondFill } from '@coze-arch/coze-design/icons';
import {
IconCozArrowRight,
IconCozDiamondFill,
} from '@coze-arch/coze-design/icons';
import { Tooltip } from '@coze-arch/coze-design';
import { type ColumnProps } from '@coze-arch/bot-semi/Table';
import { Avatar, Space, Typography, UITable } from '@coze-arch/bot-semi';

View File

@ -13,12 +13,12 @@
"test:cov": "npm run test -- --coverage"
},
"dependencies": {
"@coze-studio/bot-audit-base": "workspace:*",
"@coze-studio/bot-detail-store": "workspace:*",
"@coze-arch/bot-api": "workspace:*",
"@coze-arch/bot-flags": "workspace:*",
"@coze-arch/bot-space-api": "workspace:*",
"@coze-arch/i18n": "workspace:*"
"@coze-arch/i18n": "workspace:*",
"@coze-studio/bot-audit-base": "workspace:*",
"@coze-studio/bot-detail-store": "workspace:*"
},
"devDependencies": {
"@coze-arch/bot-typings": "workspace:*",

View File

@ -69,7 +69,7 @@ export const QueryCollect: FC = () => {
const {
data: { check_not_pass_msg, check_not_pass },
} = await updateQueryCollect(queryCollectConf);
privacyErrMsg.current = check_not_pass ? (check_not_pass_msg ?? '') : '';
privacyErrMsg.current = check_not_pass ? check_not_pass_msg ?? '' : '';
await formApi.current?.validate();
setQueryCollect(queryCollectConf);
setVisible(false);

View File

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

View File

@ -31,4 +31,3 @@ export const POLLING_INTERVAL = 10000;
export const DELAY_TIME = 2000;
export const CONNECTOR_ID = '10000010';

View File

@ -26,13 +26,7 @@ import React, {
import { set as ObjectSet, get as ObjectGet, cloneDeep } from 'lodash-es';
import { I18n } from '@coze-arch/i18n';
import { Tag } from '@coze-arch/coze-design';
import {
UIButton,
Table,
Typography,
UITag,
Space,
} from '@coze-arch/bot-semi';
import { UIButton, Table, Typography, UITag, Space } from '@coze-arch/bot-semi';
import { IconAddChildOutlined } from '@coze-arch/bot-icons';
import {
type APIParameter,

View File

@ -16,12 +16,7 @@
import { I18n } from '@coze-arch/i18n';
import { type OptionProps } from '@coze-arch/bot-semi/Select';
import {
UIInput,
UISelect,
InputGroup,
Typography,
} from '@coze-arch/bot-semi';
import { UIInput, UISelect, InputGroup, Typography } from '@coze-arch/bot-semi';
import {
DefaultParamSource,
type APIParameter,

View File

@ -33,7 +33,10 @@ import {
ConnectorDynamicStatus,
type ConnectorInfo,
} from '@coze-arch/bot-api/developer_api';
import { IconCozArrowRightFill, IconCozMore } from '@coze-arch/coze-design/icons';
import {
IconCozArrowRightFill,
IconCozMore,
} from '@coze-arch/coze-design/icons';
import { Dropdown, IconButton, Tooltip } from '@coze-arch/coze-design';
import { LinkDropItem } from './link-drop-item';

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

@ -32,10 +32,7 @@ import {
UIButton,
UITag,
} from '@coze-arch/bot-semi';
import {
ProductStatus,
type public_api,
} from '@coze-arch/bot-api/product_api';
import { ProductStatus, type public_api } from '@coze-arch/bot-api/product_api';
import { type PluginApi } from '@coze-arch/bot-api/plugin_develop';
import { useViewExample } from '@coze-agent-ide/bot-plugin-tools/useViewExample';
import { Popconfirm } from '@coze-arch/coze-design';

View File

@ -22,10 +22,7 @@ import {
type SortType,
} from '@coze-arch/bot-api/product_api';
import { type PluginInfoForPlayground } from '@coze-arch/bot-api/plugin_develop';
import {
type OrderBy,
type PluginApi,
} from '@coze-arch/bot-api/developer_api';
import { type OrderBy, type PluginApi } from '@coze-arch/bot-api/developer_api';
import { type MineActiveEnum } from '../constants/plugin-modal-constants';

View File

@ -28,10 +28,7 @@ import { nanoid } from 'nanoid';
import { cloneDeep, omit } from 'lodash-es';
import { useRequest } from 'ahooks';
import { I18n } from '@coze-arch/i18n';
import {
IconCozCross,
IconCozLongArrowUp,
} from '@coze-arch/coze-design/icons';
import { IconCozCross, IconCozLongArrowUp } from '@coze-arch/coze-design/icons';
import {
Button,
IconButton,

View File

@ -55,7 +55,9 @@ export const ConnectorError = ({ errorMessage }: ConnectorErrorProps) => {
<Typography.Text
className={styles['error-link-underline']}
link={{
href: `/space/${res.bind_space_id}/${res.bind_agent_type === 1 ? 'project-ide' : 'bot'}/${res.bind_bot_id}`,
href: `/space/${res.bind_space_id}/${
res.bind_agent_type === 1 ? 'project-ide' : 'bot'
}/${res.bind_bot_id}`,
}}
ellipsis={{
showTooltip: {

View File

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

View File

@ -191,7 +191,9 @@ export const DataSetAreaItem: FC<IDataSetAreaProps> = ({
};
navigate(
`/space/${params.space_id}/knowledge/${datasetID}?${new URLSearchParams(queryParams).toString()}`,
`/space/${params.space_id}/knowledge/${datasetID}?${new URLSearchParams(
queryParams,
).toString()}`,
);
};
const jumpToAdd = (datasetID: string, type: UnitType) => {
@ -203,7 +205,11 @@ export const DataSetAreaItem: FC<IDataSetAreaProps> = ({
page_mode: 'modal',
};
navigate(
`/space/${params.space_id}/knowledge/${datasetID}/upload?${new URLSearchParams(queryParams).toString()}`,
`/space/${
params.space_id
}/knowledge/${datasetID}/upload?${new URLSearchParams(
queryParams,
).toString()}`,
);
};
const { node: addModal, open: openAddModal } = useKnowledgeListModal({

View File

@ -27,10 +27,7 @@ import {
updateHeaderStatus,
useBotDetailIsReadonly,
} from '@coze-studio/bot-detail-store';
import {
AgentVersionCompat,
BotMode,
} from '@coze-arch/bot-api/playground_api';
import { AgentVersionCompat, BotMode } from '@coze-arch/bot-api/playground_api';
import { useBotPageStore } from '../../store/bot-page/store';
import { ModeChangeView, type ModeChangeViewProps } from './mode-change-view';

View File

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

View File

@ -62,7 +62,8 @@ export const SuggestionList: FC<SuggestionListProps> = props => {
const itemRender = useMemo<TItemRender<SuggestQuestionMessage>>(
() =>
({ data, connect, isDragging, isHovered }) => (
({ data, connect, isDragging, isHovered }) =>
(
<SuggestQuestionItemContent
key={data.id}
message={data}
@ -75,7 +76,9 @@ export const SuggestionList: FC<SuggestionListProps> = props => {
onMessageChange={value => {
onChange?.(prev => {
const _suggestions = [...prev.suggested_questions];
const index = _suggestions.findIndex(item => item.id === data.id);
const index = _suggestions.findIndex(
item => item.id === data.id,
);
_suggestions.splice(index, 1, value);
return {
...prev,

View File

@ -16,12 +16,7 @@
import { I18n } from '@coze-arch/i18n';
import { IconCozCopy } from '@coze-arch/coze-design/icons';
import {
IconButton,
Space,
Tooltip,
Typography,
} from '@coze-arch/coze-design';
import { IconButton, Space, Tooltip, Typography } from '@coze-arch/coze-design';
const doRenderTooltip = (content, children) => (
<Tooltip content={content}>{children}</Tooltip>

View File

@ -149,7 +149,7 @@ export const useWorkflowPublishedModel = ({
flow_mode:
plugin.plugin_type === PluginType.IMAGEFLOW
? WorkflowMode.Imageflow
: (jumpResponse?.flowMode ?? WorkflowMode.Workflow),
: jumpResponse?.flowMode ?? WorkflowMode.Workflow,
};
const onOkResult = onOk(workflow);
const res = await Promise.resolve(onOkResult);

View File

@ -144,7 +144,7 @@ export const AgentInfoForm = forwardRef<
initValue={
hideOperation
? spacesList?.[0]?.id
: (currentSpaceId ?? spacesList?.[0]?.id)
: currentSpaceId ?? spacesList?.[0]?.id
}
placeholder={I18n.t('select_team')}
noErrorMessage

View File

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

View File

@ -15,32 +15,32 @@
*/
export interface TrafficEnv {
Open: boolean,
Env: string,
Open: boolean;
Env: string;
}
export interface Base {
LogID: string,
Caller: string,
Addr: string,
Client: string,
TrafficEnv?: TrafficEnv,
LogID: string;
Caller: string;
Addr: string;
Client: string;
TrafficEnv?: TrafficEnv;
Extra?: {
[key: string | number]: string
},
[key: string | number]: string;
};
}
export interface BaseResp {
StatusMessage: string,
StatusCode: number,
StatusMessage: string;
StatusCode: number;
Extra?: {
[key: string | number]: string
},
[key: string | number]: string;
};
}
export interface EmptyReq {}
export interface EmptyData {}
export interface EmptyResp {
code: number,
msg: string,
data: EmptyData,
code: number;
msg: string;
data: EmptyData;
}
export interface EmptyRpcReq {}
export interface EmptyRpcResp {}

View File

@ -74,7 +74,7 @@ export enum ProductPaidType {
Paid = 1,
}
export interface CommercialSetting {
commercial_type: ProductPaidType
commercial_type: ProductPaidType;
}
export enum ProductStatus {
/** 从未上架 */
@ -84,23 +84,23 @@ export enum ProductStatus {
Banned = 3,
}
export interface UserLabel {
label_id: string,
label_name: string,
icon_uri: string,
icon_url: string,
jump_link: string,
label_id: string;
label_name: string;
icon_uri: string;
icon_url: string;
jump_link: string;
}
export interface UserInfo {
user_id: string,
user_name: string,
name: string,
avatar_url: string,
user_label?: UserLabel,
follow_type?: marketplace_common.FollowType,
user_id: string;
user_name: string;
name: string;
avatar_url: string;
user_label?: UserLabel;
follow_type?: marketplace_common.FollowType;
}
export interface ImageInfo {
uri: string,
url: string,
uri: string;
url: string;
}
export enum ProductDraftStatus {
/** 默认 */
@ -117,7 +117,7 @@ export enum ProductDraftStatus {
export type AuditStatus = ProductDraftStatus;
export interface OpeningDialog {
/** Bot开场白 */
content: string
content: string;
}
export enum InputType {
String = 1,
@ -169,45 +169,45 @@ export enum UIPreviewType {
Client = 2,
}
export interface ChargeSKUExtra {
quantity: string,
is_self_define: boolean,
quantity: string;
is_self_define: boolean;
}
export enum FavoriteListSource {
/** 用户自己创建的 */
CreatedByMe = 1,
}
export interface FavoriteEntity {
entity_id: string,
entity_type: ProductEntityType,
name: string,
icon_url: string,
description: string,
entity_id: string;
entity_type: ProductEntityType;
name: string;
icon_url: string;
description: string;
/** 废弃使用UserInfo */
seller: SellerInfo,
seller: SellerInfo;
/** 用于跳转到Bot编辑页 */
space_id: string,
space_id: string;
/** 用户是否有该实体所在Space的权限 */
has_space_permission: boolean,
has_space_permission: boolean;
/** 收藏时间 */
favorite_at: string,
product_extra?: FavoriteProductExtra,
user_info: UserInfo,
plugin_extra?: FavoritePluginExtra,
favorite_at: string;
product_extra?: FavoriteProductExtra;
user_info: UserInfo;
plugin_extra?: FavoritePluginExtra;
}
export interface SellerInfo {
user_id: string,
user_name: string,
avatar_url: string,
user_id: string;
user_name: string;
avatar_url: string;
}
export interface FavoriteProductExtra {
product_id: string,
product_status: ProductStatus,
product_id: string;
product_status: ProductStatus;
}
export interface FavoritePluginExtra {
tools: PluginTool[]
tools: PluginTool[];
}
export interface PluginTool {
id: string,
name: string,
description: string,
id: string;
name: string;
description: string;
}

View File

@ -18,11 +18,11 @@ import * as base from './../../base';
export { base };
export interface Price {
/** 金额 */
amount: string,
amount: string;
/** 币种如USD、CNY */
currency: string,
currency: string;
/** 小数位数 */
decimal_num: number,
decimal_num: number;
}
export enum FollowType {
/** 无关系 */

View File

@ -16,165 +16,186 @@
import { createAPI } from './../../api/config';
export interface AppUserInfo {
user_unique_name: string
user_unique_name: string;
}
export interface User {
/** 与原接口字段名对齐 */
user_id_str: string,
name: string,
user_unique_name: string,
email: string,
description: string,
avatar_url: string,
screen_name?: string,
app_user_info?: AppUserInfo,
locale?: string,
user_id_str: string;
name: string;
user_unique_name: string;
email: string;
description: string;
avatar_url: string;
screen_name?: string;
app_user_info?: AppUserInfo;
locale?: string;
/** unix timestamp in seconds */
user_create_time: number,
user_create_time: number;
}
export interface PassportWebEmailRegisterV2PostRequest {
password: string,
email: string,
password: string;
email: string;
}
export interface PassportWebEmailRegisterV2PostResponse {
data: User,
code: number,
msg: string,
data: User;
code: number;
msg: string;
}
export interface PassportWebLogoutGetRequest {}
export interface PassportWebLogoutGetResponse {
redirect_url: string,
code: number,
msg: string,
redirect_url: string;
code: number;
msg: string;
}
export interface PassportWebEmailLoginPostRequest {
email: string,
password: string,
email: string;
password: string;
}
export interface PassportWebEmailLoginPostResponse {
data: User,
code: number,
msg: string,
data: User;
code: number;
msg: string;
}
export interface PassportWebEmailPasswordResetGetRequest {
password: string,
code: string,
email: string,
password: string;
code: string;
email: string;
}
export interface PassportWebEmailPasswordResetGetResponse {
code: number,
msg: string,
code: number;
msg: string;
}
export interface PassportAccountInfoV2Request {}
export interface PassportAccountInfoV2Response {
data: User,
code: number,
msg: string,
data: User;
code: number;
msg: string;
}
export interface UserUpdateAvatarRequest {
avatar: Blob
avatar: Blob;
}
export interface UserUpdateAvatarResponseData {
web_uri: string
web_uri: string;
}
export interface UserUpdateAvatarResponse {
data: UserUpdateAvatarResponseData,
code: number,
msg: string,
data: UserUpdateAvatarResponseData;
code: number;
msg: string;
}
export interface UserUpdateProfileRequest {
name?: string,
user_unique_name?: string,
description?: string,
locale?: string,
name?: string;
user_unique_name?: string;
description?: string;
locale?: string;
}
export interface UserUpdateProfileResponse {
code: number,
msg: string,
code: number;
msg: string;
}
/** 邮箱密码注册 */
export const PassportWebEmailRegisterV2Post = /*#__PURE__*/createAPI<PassportWebEmailRegisterV2PostRequest, PassportWebEmailRegisterV2PostResponse>({
"url": "/api/passport/web/email/register/v2/",
"method": "POST",
"name": "PassportWebEmailRegisterV2Post",
"reqType": "PassportWebEmailRegisterV2PostRequest",
"reqMapping": {
"body": ["password", "email"]
export const PassportWebEmailRegisterV2Post = /*#__PURE__*/ createAPI<
PassportWebEmailRegisterV2PostRequest,
PassportWebEmailRegisterV2PostResponse
>({
url: '/api/passport/web/email/register/v2/',
method: 'POST',
name: 'PassportWebEmailRegisterV2Post',
reqType: 'PassportWebEmailRegisterV2PostRequest',
reqMapping: {
body: ['password', 'email'],
},
"resType": "PassportWebEmailRegisterV2PostResponse",
"schemaRoot": "api://schemas/idl_passport_passport",
"service": "passport"
resType: 'PassportWebEmailRegisterV2PostResponse',
schemaRoot: 'api://schemas/idl_passport_passport',
service: 'passport',
});
/** 退出登录 */
export const PassportWebLogoutGet = /*#__PURE__*/createAPI<PassportWebLogoutGetRequest, PassportWebLogoutGetResponse>({
"url": "/api/passport/web/logout/",
"method": "GET",
"name": "PassportWebLogoutGet",
"reqType": "PassportWebLogoutGetRequest",
"reqMapping": {},
"resType": "PassportWebLogoutGetResponse",
"schemaRoot": "api://schemas/idl_passport_passport",
"service": "passport"
export const PassportWebLogoutGet = /*#__PURE__*/ createAPI<
PassportWebLogoutGetRequest,
PassportWebLogoutGetResponse
>({
url: '/api/passport/web/logout/',
method: 'GET',
name: 'PassportWebLogoutGet',
reqType: 'PassportWebLogoutGetRequest',
reqMapping: {},
resType: 'PassportWebLogoutGetResponse',
schemaRoot: 'api://schemas/idl_passport_passport',
service: 'passport',
});
/** 邮箱帐密登录 */
export const PassportWebEmailLoginPost = /*#__PURE__*/createAPI<PassportWebEmailLoginPostRequest, PassportWebEmailLoginPostResponse>({
"url": "/api/passport/web/email/login/",
"method": "POST",
"name": "PassportWebEmailLoginPost",
"reqType": "PassportWebEmailLoginPostRequest",
"reqMapping": {
"body": ["email", "password"]
export const PassportWebEmailLoginPost = /*#__PURE__*/ createAPI<
PassportWebEmailLoginPostRequest,
PassportWebEmailLoginPostResponse
>({
url: '/api/passport/web/email/login/',
method: 'POST',
name: 'PassportWebEmailLoginPost',
reqType: 'PassportWebEmailLoginPostRequest',
reqMapping: {
body: ['email', 'password'],
},
"resType": "PassportWebEmailLoginPostResponse",
"schemaRoot": "api://schemas/idl_passport_passport",
"service": "passport"
resType: 'PassportWebEmailLoginPostResponse',
schemaRoot: 'api://schemas/idl_passport_passport',
service: 'passport',
});
/** 通过邮箱重置密码 */
export const PassportWebEmailPasswordResetGet = /*#__PURE__*/createAPI<PassportWebEmailPasswordResetGetRequest, PassportWebEmailPasswordResetGetResponse>({
"url": "/api/passport/web/email/password/reset/",
"method": "GET",
"name": "PassportWebEmailPasswordResetGet",
"reqType": "PassportWebEmailPasswordResetGetRequest",
"reqMapping": {
"query": ["password", "code", "email"]
export const PassportWebEmailPasswordResetGet = /*#__PURE__*/ createAPI<
PassportWebEmailPasswordResetGetRequest,
PassportWebEmailPasswordResetGetResponse
>({
url: '/api/passport/web/email/password/reset/',
method: 'GET',
name: 'PassportWebEmailPasswordResetGet',
reqType: 'PassportWebEmailPasswordResetGetRequest',
reqMapping: {
query: ['password', 'code', 'email'],
},
"resType": "PassportWebEmailPasswordResetGetResponse",
"schemaRoot": "api://schemas/idl_passport_passport",
"service": "passport"
resType: 'PassportWebEmailPasswordResetGetResponse',
schemaRoot: 'api://schemas/idl_passport_passport',
service: 'passport',
});
/** 账号信息 */
export const PassportAccountInfoV2 = /*#__PURE__*/createAPI<PassportAccountInfoV2Request, PassportAccountInfoV2Response>({
"url": "/api/passport/account/info/v2/",
"method": "POST",
"name": "PassportAccountInfoV2",
"reqType": "PassportAccountInfoV2Request",
"reqMapping": {},
"resType": "PassportAccountInfoV2Response",
"schemaRoot": "api://schemas/idl_passport_passport",
"service": "passport"
export const PassportAccountInfoV2 = /*#__PURE__*/ createAPI<
PassportAccountInfoV2Request,
PassportAccountInfoV2Response
>({
url: '/api/passport/account/info/v2/',
method: 'POST',
name: 'PassportAccountInfoV2',
reqType: 'PassportAccountInfoV2Request',
reqMapping: {},
resType: 'PassportAccountInfoV2Response',
schemaRoot: 'api://schemas/idl_passport_passport',
service: 'passport',
});
export const UserUpdateAvatar = /*#__PURE__*/createAPI<UserUpdateAvatarRequest, UserUpdateAvatarResponse>({
"url": "/api/web/user/update/upload_avatar/",
"method": "POST",
"name": "UserUpdateAvatar",
"reqType": "UserUpdateAvatarRequest",
"reqMapping": {
"body": ["avatar"]
export const UserUpdateAvatar = /*#__PURE__*/ createAPI<
UserUpdateAvatarRequest,
UserUpdateAvatarResponse
>({
url: '/api/web/user/update/upload_avatar/',
method: 'POST',
name: 'UserUpdateAvatar',
reqType: 'UserUpdateAvatarRequest',
reqMapping: {
body: ['avatar'],
},
"resType": "UserUpdateAvatarResponse",
"schemaRoot": "api://schemas/idl_passport_passport",
"service": "passport",
"serializer": "form"
resType: 'UserUpdateAvatarResponse',
schemaRoot: 'api://schemas/idl_passport_passport',
service: 'passport',
serializer: 'form',
});
export const UserUpdateProfile = /*#__PURE__*/createAPI<UserUpdateProfileRequest, UserUpdateProfileResponse>({
"url": "/api/user/update_profile",
"method": "POST",
"name": "UserUpdateProfile",
"reqType": "UserUpdateProfileRequest",
"reqMapping": {
"body": ["name", "user_unique_name", "description", "locale"]
export const UserUpdateProfile = /*#__PURE__*/ createAPI<
UserUpdateProfileRequest,
UserUpdateProfileResponse
>({
url: '/api/user/update_profile',
method: 'POST',
name: 'UserUpdateProfile',
reqType: 'UserUpdateProfileRequest',
reqMapping: {
body: ['name', 'user_unique_name', 'description', 'locale'],
},
"resType": "UserUpdateProfileResponse",
"schemaRoot": "api://schemas/idl_passport_passport",
"service": "passport"
resType: 'UserUpdateProfileResponse',
schemaRoot: 'api://schemas/idl_passport_passport',
service: 'passport',
});

View File

@ -42,11 +42,9 @@ vi.mock('@coze-arch/bot-http', () => {
},
},
isApiError: vi.fn(),
ApiError: vi.fn().mockImplementation(function (
this: any,
code: string,
msg: string,
) {
ApiError: vi
.fn()
.mockImplementation(function (this: any, code: string, msg: string) {
this.code = code;
this.msg = msg;
this.config = {};

View File

@ -82,7 +82,10 @@ const updateDTS = ({
*/
/* eslint-disable */
/* prettier-ignore */
// Automatically generated based on ${path.relative(baseDir, inputFileName)}, do not modify manually `,
// Automatically generated based on ${path.relative(
baseDir,
inputFileName,
)}, do not modify manually `,
{
overwrite: true,
},

View File

@ -24,7 +24,15 @@ declare const AWEME_PLATFORM_ID: number;
declare const BOT_BRAND_NAME: string;
declare const BUILD_BRANCH: string;
declare const BUILD_TYPE: 'local' | 'online' | 'offline' | 'test';
declare const BYTE_UPLOADER_REGION: 'cn-north-1' | 'us-east-1' | 'ap-singapore-1' | 'us-east-red' | 'boe' | 'boei18n' | 'US-TTP' | 'gcp';
declare const BYTE_UPLOADER_REGION:
| 'cn-north-1'
| 'us-east-1'
| 'ap-singapore-1'
| 'us-east-red'
| 'boe'
| 'boei18n'
| 'US-TTP'
| 'gcp';
declare const CARD_BUILDER_ENV_STR: string;
declare const CDN: string | undefined;
declare const CDN_PATH_PREFIX: string;
@ -108,4 +116,3 @@ declare const VOLCANO_PLATFORM_APP_KEY: string | null;
declare const VOLCANO_PLATFORM_ID: number | null;
declare const VOLC_PRIVATE_POLICY: string;
declare const VOLC_TERMS_OF_SERVICE: string;

View File

@ -431,7 +431,9 @@ export const SCENE_RESPONSE_MAP = {
botID: params.botID,
}),
[SceneType.KNOWLEDGE__BACK__BOT]: params => ({
url: `/space/${params.spaceID}/${params.mode === 'bot' ? 'bot' : 'douyin-bot'}/${params.botID}`,
url: `/space/${params.spaceID}/${
params.mode === 'bot' ? 'bot' : 'douyin-bot'
}/${params.botID}`,
}),
[SceneType.KNOWLEDGE__ADD_TO__BOT]: params => ({
url: `/space/${params.spaceID}/bot/${params.botID}`,

View File

@ -14,4 +14,5 @@
* limitations under the License.
*/
export const dynamicImportMdBoxStyle = () => import('@bytedance/calypso/styles.css');
export const dynamicImportMdBoxStyle = () =>
import('@bytedance/calypso/styles.css');

View File

@ -13,8 +13,8 @@
"test:cov": "npm run test -- --coverage"
},
"dependencies": {
"@coze-arch/bot-error": "workspace:*",
"@coze-arch/bot-api": "workspace:*",
"@coze-arch/bot-error": "workspace:*",
"@coze-arch/bot-flags": "workspace:*",
"@coze-arch/bot-studio-store": "workspace:*",
"@coze-arch/report-events": "workspace:*",

View File

@ -13,12 +13,12 @@
"test:cov": "npm run test -- --coverage"
},
"dependencies": {
"@coze-arch/bot-error": "workspace:*",
"@coze-foundation/space-store": "workspace:*",
"@coze-arch/bot-api": "workspace:*",
"@coze-arch/bot-error": "workspace:*",
"@coze-arch/bot-flags": "workspace:*",
"@coze-arch/logger": "workspace:*",
"@coze-arch/report-events": "workspace:*",
"@coze-foundation/space-store": "workspace:*",
"immer": "^10.0.3",
"localforage": "^1.9.0",
"lodash-es": "^4.17.21",

View File

@ -38,3 +38,4 @@
"vitest": "~3.0.5"
}
}

View File

@ -90,4 +90,3 @@ export const sendTeaEvent = <TEventName extends EVENT_NAMES>(
});
TeaNew.sendEvent(event, params);
};

View File

@ -37,10 +37,8 @@
},
"dependencies": {
"@coze-agent-ide/tool-config": "workspace:*",
"@coze-arch/bot-error": "workspace:*",
"@coze-studio/uploader-adapter": "workspace:*",
"@coze-studio/user-store": "workspace:*",
"@coze-arch/bot-api": "workspace:*",
"@coze-arch/bot-error": "workspace:*",
"@coze-arch/bot-flags": "workspace:*",
"@coze-arch/bot-studio-store": "workspace:*",
"@coze-arch/i18n": "workspace:*",
@ -48,6 +46,8 @@
"@coze-arch/report-events": "workspace:*",
"@coze-arch/tea": "workspace:*",
"@coze-arch/web-context": "workspace:*",
"@coze-studio/uploader-adapter": "workspace:*",
"@coze-studio/user-store": "workspace:*",
"bowser": "2.11.0",
"dayjs": "^1.11.7",
"eventemitter3": "^5.0.1",
@ -56,11 +56,11 @@
"query-string": "^8.1.0"
},
"devDependencies": {
"@coze-common/chat-core": "workspace:*",
"@coze-arch/bot-typings": "workspace:*",
"@coze-arch/eslint-config": "workspace:*",
"@coze-arch/ts-config": "workspace:*",
"@coze-arch/vitest-config": "workspace:*",
"@coze-common/chat-core": "workspace:*",
"@types/lodash-es": "^4.17.10",
"@types/md5": "^2.3.2",
"@types/node": "^18",

View File

@ -19,8 +19,8 @@ import type React from 'react';
import { useState, useCallback, useRef, useLayoutEffect } from 'react';
interface Options {
onEnter?: () => void
onLeave?: () => void
onEnter?: () => void;
onLeave?: () => void;
}
const useHover = <T extends HTMLElement = any>(
@ -28,25 +28,31 @@ const useHover = <T extends HTMLElement = any>(
options: Options = {},
deps: DependencyList = [],
): [React.MutableRefObject<T>, boolean] => {
const { onEnter, onLeave } = options
const { onEnter, onLeave } = options;
const ref = useRef<T>();
const [isHovered, setIsHovered] = useState(false);
const handleMouseEnter = useCallback(() => {
if (onEnter) {onEnter()}
setIsHovered(true)
if (onEnter) {
onEnter();
}
setIsHovered(true);
}, [typeof onEnter === 'function']);
const handleMouseLeave = useCallback(() => {
if (onLeave) {onLeave()}
setIsHovered(false)
if (onLeave) {
onLeave();
}
setIsHovered(false);
}, [typeof onLeave === 'function']);
useLayoutEffect(() => {
let target = ref.current
let target = ref.current;
if (el) {
target = typeof el === 'function' ? el() : el;
}
if (!target) {return}
if (!target) {
return;
}
target.addEventListener('mouseenter', handleMouseEnter);
target.addEventListener('mouseleave', handleMouseLeave);
return () => {

View File

@ -14,7 +14,11 @@
* limitations under the License.
*/
import { act, renderHook, type RenderHookResult } from '@testing-library/react-hooks';
import {
act,
renderHook,
type RenderHookResult,
} from '@testing-library/react-hooks';
import { useState } from 'react';
import usePersistCallback from '..';

View File

@ -14,23 +14,42 @@
* limitations under the License.
*/
import { useState, useRef, type Dispatch, type SetStateAction, useCallback } from 'react';
import {
useState,
useRef,
type Dispatch,
type SetStateAction,
useCallback,
} from 'react';
const isFunction = (val: any): val is Function => typeof val === 'function';
// Get a new state value, compatible with passing values and functions
function getStateVal<T>(preState: T, initVal?: SetStateAction<T>): T | undefined {
function getStateVal<T>(
preState: T,
initVal?: SetStateAction<T>,
): T | undefined {
if (isFunction(initVal)) {
return initVal(preState);
}
return initVal;
}
function useStateRealtime<T>(initialState: T | (() => T)): [T, Dispatch<SetStateAction<T>>, () => T]
function useStateRealtime<T = undefined>(): [T | undefined, Dispatch<SetStateAction<T | undefined>>, () => T | undefined]
function useStateRealtime<T>(
initialState: T | (() => T),
): [T, Dispatch<SetStateAction<T>>, () => T];
function useStateRealtime<T = undefined>(): [
T | undefined,
Dispatch<SetStateAction<T | undefined>>,
() => T | undefined,
];
function useStateRealtime<T>(
initVal?: T | (() => T),
): [T | undefined, Dispatch<SetStateAction<T | undefined>>, () => T | undefined] {
): [
T | undefined,
Dispatch<SetStateAction<T | undefined>>,
() => T | undefined,
] {
const initState = getStateVal(undefined, initVal);
const [val, setVal] = useState(initState);
const valRef = useRef(initState);
@ -38,8 +57,8 @@ function useStateRealtime<T>(
const newState = getStateVal(valRef.current, newVal);
valRef.current = newState;
setVal(newState);
}, [])
const getRealState = useCallback(() => valRef.current, [])
}, []);
const getRealState = useCallback(() => valRef.current, []);
return [val, setState, getRealState];
}

View File

@ -14,49 +14,51 @@
* limitations under the License.
*/
import { useState, useMemo } from 'react'
import { useState, useMemo } from 'react';
type State = any
type State = any;
export interface ReturnValue<T = State> {
state: T;
toggle: (value?: T) => void;
}
function useToggle<T = boolean>(): ReturnValue<T>
function useToggle<T = boolean>(): ReturnValue<T>;
function useToggle<T = State>(defaultValue: T): ReturnValue<T>
function useToggle<T = State>(defaultValue: T): ReturnValue<T>;
function useToggle<T = State, U = State>(
defaultValue: T,
reverseValue: U,
): ReturnValue<T | U>
): ReturnValue<T | U>;
function useToggle<D extends State = State, R extends State = State>(
defaultValue: D = false as D,
reverseValue?: R,
) {
const [state, setState] = useState<D | R>(defaultValue)
const [state, setState] = useState<D | R>(defaultValue);
const actions = useMemo(() => {
const reverseValueOrigin = (reverseValue === undefined ? !defaultValue : reverseValue) as D | R
const reverseValueOrigin = (
reverseValue === undefined ? !defaultValue : reverseValue
) as D | R;
const toggle = (value?: D | R) => {
if (value !== undefined) {
setState(value)
return
}
setState((s) => (s === defaultValue ? reverseValueOrigin : defaultValue))
setState(value);
return;
}
setState(s => (s === defaultValue ? reverseValueOrigin : defaultValue));
};
return {
toggle,
}
}, [defaultValue, reverseValue])
};
}, [defaultValue, reverseValue]);
return {
state,
...actions,
}
};
}
export default useToggle
export default useToggle;

View File

@ -46,17 +46,26 @@ export enum IntlModuleType {
languageDetector = 'languageDetector',
postProcessor = 'postProcessor',
i18nFormat = 'i18nFormat',
'3rdParty' = '3rdParty'
'3rdParty' = '3rdParty',
}
export interface IntlModule<T extends keyof typeof IntlModuleType = keyof typeof IntlModuleType> {
type: T
name?: string
init?: (i18n: any) => void | Promise<any>
export interface IntlModule<
T extends keyof typeof IntlModuleType = keyof typeof IntlModuleType,
> {
type: T;
name?: string;
init?: (i18n: any) => void | Promise<any>;
}
export type TFunctionKeys = string | TemplateStringsArray;
export type TFunctionResult = string | object | Array<string | object> | undefined | null;
export type TFunctionResult =
| string
| object
| Array<string | object>
| undefined
| null;
export interface StringMap { [key: string]: any }
export interface StringMap {
[key: string]: any;
}

View File

@ -18,10 +18,7 @@ import { vi } from 'vitest';
// Define a simulated Worker class
class MockWorker {
constructor(
public scriptURL: string,
public options: any,
) {}
constructor(public scriptURL: string, public options: any) {}
// Methods required to add a Worker interface
terminate(): void {
@ -43,10 +40,7 @@ global.URL = {
} as any;
global.Blob = class MockBlob {
constructor(
public array: any[],
public options: any,
) {}
constructor(public array: any[], public options: any) {}
} as any;
global.location = {

View File

@ -10,9 +10,9 @@
"test:cov": "npm run test -- --coverage"
},
"dependencies": {
"@coze-studio/slardar-interface": "workspace:*",
"@coze-arch/bot-env": "workspace:*",
"@coze-arch/bot-typings": "workspace:*",
"@coze-studio/slardar-interface": "workspace:*",
"lodash-es": "^4.17.21",
"react": "~18.2.0",
"react-error-boundary": "^4.0.9"

View File

@ -27,7 +27,7 @@ export const shouldCloseConsole = () => {
isOpenDebug && sessionStorage.setItem(DEBUG_TAG, 'true');
}
// Except for the official normal environment, the console is allowed to open
const isProduction = !!(IS_RELEASE_VERSION );
const isProduction = !!IS_RELEASE_VERSION;
console.log('IS_RELEASE_VERSION', IS_RELEASE_VERSION, isProduction);
return !isOpenDebug && isProduction;
};

View File

@ -185,5 +185,4 @@ export class Logger extends BaseLogger {
action: [LogAction.CONSOLE, LogAction.PERSIST],
},
});
}

View File

@ -20,9 +20,14 @@ import localeEn from './locales/en.json';
import localeZhCN from './locales/zh-CN.json';
const defaultConfig = {
en: { 'i18n': localeEn },
'zh-CN': { 'i18n': localeZhCN },
} as { en: { 'i18n': typeof localeEn }; 'zh-CN': { 'i18n': typeof localeZhCN }};
en: { i18n: localeEn },
'zh-CN': { i18n: localeZhCN },
} as { en: { i18n: typeof localeEn }; 'zh-CN': { i18n: typeof localeZhCN } };
export { localeEn, localeZhCN, defaultConfig };
export type { I18nOptionsMap, I18nKeysHasOptionsType, I18nKeysNoOptionsType, LocaleData } from './locale-data';
export type {
I18nOptionsMap,
I18nKeysHasOptionsType,
I18nKeysNoOptionsType,
LocaleData,
} from './locale-data';

File diff suppressed because it is too large Load Diff

View File

@ -186,7 +186,9 @@ describe('useMediaQuery', () => {
);
expect(window.matchMedia).toHaveBeenCalledWith(
`(min-width: ${SCREENS_TOKENS[ScreenRange.MD]}) and (max-width: ${SCREENS_TOKENS[ScreenRange.LG]})`,
`(min-width: ${SCREENS_TOKENS[ScreenRange.MD]}) and (max-width: ${
SCREENS_TOKENS[ScreenRange.LG]
})`,
);
});

View File

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

View File

@ -50,8 +50,9 @@ export default function Coachmark({
const [stepIndex, setStepIndex] = useState(itemIndex);
const initVisible = async (cid: string) => {
const coachMarkStorage =
await localStorageService.getValueSync(COACHMARK_KEY);
const coachMarkStorage = await localStorageService.getValueSync(
COACHMARK_KEY,
);
// readStep represents the read step index
const readStep = (
typeSafeJSONParse(coachMarkStorage) as Record<string, number> | undefined

View File

@ -29,13 +29,7 @@ import {
IconCozCheckMark,
IconCozCrossCircle,
} from '@coze-arch/coze-design/icons';
import {
Tooltip,
Toast,
Image,
AIButton,
Space,
} from '@coze-arch/coze-design';
import { Tooltip, Toast, Image, AIButton, Space } from '@coze-arch/coze-design';
import { loadImage } from '@coze-arch/bot-utils';
import { DeveloperApi } from '@coze-arch/bot-api';

View File

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

View File

@ -32,10 +32,7 @@ export interface LocateUnreadMessageParam {
}
export class OnInitialLoadEffect extends LoadAsyncEffect {
constructor(
envTools: LoadCommandEnvTools,
private data: MixInitResponse,
) {
constructor(envTools: LoadCommandEnvTools, private data: MixInitResponse) {
super(envTools);
}
/**

View File

@ -37,13 +37,13 @@
"test:cov": "npm run test -- --coverage"
},
"dependencies": {
"@coze-arch/bot-flags": "workspace:*",
"@coze-arch/fetch-stream": "workspace:*",
"@coze-arch/logger": "workspace:*",
"@coze-common/chat-area-utils": "workspace:*",
"@coze-studio/file-kit": "workspace:*",
"@coze-studio/slardar-adapter": "workspace:*",
"@coze-studio/uploader-adapter": "workspace:*",
"@coze-arch/bot-flags": "workspace:*",
"@coze-arch/fetch-stream": "workspace:*",
"@coze-arch/logger": "workspace:*",
"@mattiasbuelens/web-streams-adapter": "~0.1.0",
"axios": "^1.4.0",
"eventemitter3": "^5.0.1",

View File

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

View File

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

View File

@ -27,10 +27,7 @@ import {
} from '@coze-common/chat-uikit';
import { FILE_TYPE_CONFIG, FileTypeEnum } from '@coze-common/chat-core';
import { I18n } from '@coze-arch/i18n';
import {
InputType,
shortcut_command,
} from '@coze-arch/bot-api/playground_api';
import { InputType, shortcut_command } from '@coze-arch/bot-api/playground_api';
export type UploadItemType =
| InputType.UploadImage

View File

@ -148,9 +148,9 @@ function useCharacterTriggerContext(disableUpdateTrigger?: boolean) {
{
from: tr.changes.from,
to: tr.changes.to,
insert: `${
hasExtraLeftBrace ? '' : '{'
}${tr.changes.insert}}}`,
insert: `${hasExtraLeftBrace ? '' : '{'}${
tr.changes.insert
}}}`,
},
],
selection: EditorSelection.cursor(

View File

@ -21,12 +21,7 @@ import { useEditor } from '@coze-editor/editor/react';
import { type EditorAPI } from '@coze-editor/editor/preset-prompt';
import { I18n } from '@coze-arch/i18n';
import { IconCozPlus } from '@coze-arch/coze-design/icons';
import {
Modal,
type ModalProps,
Search,
Button,
} from '@coze-arch/coze-design';
import { Modal, type ModalProps, Search, Button } from '@coze-arch/coze-design';
import { EVENT_NAMES, sendTeaEvent } from '@coze-arch/bot-tea';
import { PlaygroundApi } from '@coze-arch/bot-api';
import { LibraryBlockWidget } from '@coze-common/editor-plugins/library-insert';

View File

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

View File

@ -63,7 +63,9 @@ export const TemplateCard: FC<TemplateCardProps> = props => {
<DuplicateModal
productId={props.meta_info.id}
entityType={props.meta_info.entity_type}
defaultTitle={`${props.meta_info?.name}(${I18n.t('duplicate_rename_copy')})`}
defaultTitle={`${props.meta_info?.name}(${I18n.t(
'duplicate_rename_copy',
)})`}
hide={() => setVisible(false)}
/>
) : null}

View File

@ -16,10 +16,7 @@
import React from 'react';
import {
IconMobileCollect,
IconMobileCollectFill,
} from '@coze-arch/bot-icons';
import { IconMobileCollect, IconMobileCollectFill } from '@coze-arch/bot-icons';
export const FavoriteIconMobile = (props: { isFavorite?: boolean }) => {
const { isFavorite } = props;

View File

@ -160,7 +160,7 @@ function useScroll<T>(props: ScrollProps<T>) {
const reloadData = useMemoizedFn(() => {
mutate({
list: resetDataIfReload ? [] : (dataInfo?.list ?? []),
list: resetDataIfReload ? [] : dataInfo?.list ?? [],
hasMore: undefined,
nextPage: 1,
});

View File

@ -284,10 +284,10 @@
},
"dependencies": {
"@coze-arch/bot-icons": "workspace:*",
"@coze-arch/i18n": "workspace:*",
"@douyinfe/semi-icons": "^2.36.0",
"@douyinfe/semi-illustrations": "^2.36.0",
"@douyinfe/semi-ui": "~2.72.3",
"@coze-arch/i18n": "workspace:*",
"ahooks": "^3.7.8",
"classnames": "^2.3.2",
"lodash-es": "^4.17.21",

View File

@ -92,9 +92,9 @@ export const LineSVG = (props: {
/>
<polygon
className={LINE_CLASS_NAME}
points={`${toPos.x},${toPos.y} ${toPos.x - 4.5},${toPos.y - ARROW_HEIGHT} ${
toPos.x + 4.5
},${toPos.y - ARROW_HEIGHT}`}
points={`${toPos.x},${toPos.y} ${toPos.x - 4.5},${
toPos.y - ARROW_HEIGHT
} ${toPos.x + 4.5},${toPos.y - ARROW_HEIGHT}`}
fill={activated || hovered ? activateColor : defaultColor}
/>
</>

View File

@ -42,7 +42,7 @@ export const FixedLayoutEditorProvider = forwardRef<
get document(): FlowDocument {
return container.get<FlowDocument>(FlowDocument);
},
}) as FixedLayoutPluginContext,
} as FixedLayoutPluginContext),
[],
);
return (

View File

@ -57,7 +57,11 @@ export interface FeatureTypeInternalThisType<Type> {
export type Disposer = () => void;
export class FeatureRegistry<Type, Module, Context = undefined> extends ExternalStore<{
export class FeatureRegistry<
Type,
Module,
Context = undefined,
> extends ExternalStore<{
featureMap: Map<string, FeatureConfig<Type, Module>>;
}> {
protected name: string;

View File

@ -14,11 +14,7 @@
* limitations under the License.
*/
import {
reporter,
type CustomEvent,
type ErrorEvent,
} from '@coze-arch/logger';
import { reporter, type CustomEvent, type ErrorEvent } from '@coze-arch/logger';
import { type DataNamespace } from '../constants';
export const reporterFun = <EventEnum extends string>(

View File

@ -17,10 +17,7 @@
import React, { useEffect, useImperativeHandle, useRef, useState } from 'react';
import { Tree } from '@coze-arch/coze-design';
import type {
TreeProps,
RenderFullLabelProps,
} from '@coze-arch/bot-semi/Tree';
import type { TreeProps, RenderFullLabelProps } from '@coze-arch/bot-semi/Tree';
import { CommonE2e } from '@coze-data/e2e';
import { distinctFileNodes, levelMapTreeNodesToMap } from '../utils';

View File

@ -14,9 +14,7 @@
* limitations under the License.
*/
import {
ImageLocalModule,
} from '@coze-data/knowledge-ide-base/features/import-knowledge-sources/menu/image-local';
import { ImageLocalModule } from '@coze-data/knowledge-ide-base/features/import-knowledge-sources/menu/image-local';
import {
createImportKnowledgeMenuSourceFeatureRegistry,
type ImportKnowledgeMenuSourceRegistry,

View File

@ -20,7 +20,10 @@ import { useNavigate } from 'react-router-dom';
import { useMemo } from 'react';
import classNames from 'classnames';
import { useKnowledgeParams, useKnowledgeStore } from '@coze-data/knowledge-stores';
import {
useKnowledgeParams,
useKnowledgeStore,
} from '@coze-data/knowledge-stores';
import { UnitType } from '@coze-data/knowledge-resource-processor-core';
import { useEditKnowledgeModal } from '@coze-data/knowledge-modal-adapter';
import { KnowledgeE2e } from '@coze-data/e2e';

View File

@ -15,7 +15,10 @@
*/
import { useShallow } from 'zustand/react/shallow';
import { useKnowledgeParams, useKnowledgeStore } from '@coze-data/knowledge-stores';
import {
useKnowledgeParams,
useKnowledgeStore,
} from '@coze-data/knowledge-stores';
import { type UnitType } from '@coze-data/knowledge-resource-processor-core';
import { useKnowledgeNavigate } from '@coze-data/knowledge-common-hooks/use-case';
import { useSpaceStore } from '@coze-arch/bot-studio-store';

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