chore: format all frontend files (#430)
This commit is contained in:
parent
8b078ff013
commit
6995cec404
|
|
@ -1,4 +1,20 @@
|
||||||
#!/bin/bash
|
#!/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
|
# Set default value
|
||||||
TARGET_BRANCH=${targetBranch}
|
TARGET_BRANCH=${targetBranch}
|
||||||
|
|
@ -67,14 +83,13 @@ if [ -n "$large_files_info" ]; then
|
||||||
\"name\": \"文件体积\",
|
\"name\": \"文件体积\",
|
||||||
\"conclusion\": \"failed\",
|
\"conclusion\": \"failed\",
|
||||||
\"output\": {
|
\"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"
|
output_conclusion "$CONCLUSION"
|
||||||
else
|
else
|
||||||
echo "错误: 以下文件体积超过限制 (${size_limit}KB):"
|
echo "错误: 以下文件体积超过限制 (${size_limit}KB):"
|
||||||
echo -e "$large_files_info"
|
echo -e "$large_files_info"
|
||||||
echo "请将大文件上传到CDN并通过URL使用。详情请参考: https://bytedance.larkoffice.com/wiki/MjoIwfyGyiVCBFkBgnXc8LFTniX"
|
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,9 @@ import path from 'path';
|
||||||
import { defineConfig } from '@coze-arch/rsbuild-config';
|
import { defineConfig } from '@coze-arch/rsbuild-config';
|
||||||
import { GLOBAL_ENVS } from '@coze-arch/bot-env';
|
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({
|
const mergedConfig = defineConfig({
|
||||||
server: {
|
server: {
|
||||||
|
|
|
||||||
|
|
@ -74,3 +74,4 @@
|
||||||
"typescript": "~5.8.2"
|
"typescript": "~5.8.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,3 +25,4 @@
|
||||||
"@types/node": "^18"
|
"@types/node": "^18"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,9 @@ export const overrideBrowserslist = [
|
||||||
|
|
||||||
const generateCdnPrefix = () => {
|
const generateCdnPrefix = () => {
|
||||||
if (process.env.CDN_INNER_CN) {
|
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 '/';
|
return '/';
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -25,3 +25,4 @@
|
||||||
"sucrase": "^3.32.0"
|
"sucrase": "^3.32.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,4 +13,3 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,3 +20,4 @@
|
||||||
"typescript": "~5.8.2"
|
"typescript": "~5.8.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,3 +23,4 @@
|
||||||
"vitest": "~3.0.5"
|
"vitest": "~3.0.5"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -27,8 +27,8 @@
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/eslint-parser": "~7.25.8",
|
"@babel/eslint-parser": "~7.25.8",
|
||||||
"@babel/eslint-plugin": "~7.25.7",
|
"@babel/eslint-plugin": "~7.25.7",
|
||||||
"@eslint/js": "~9.12.0",
|
|
||||||
"@coze-arch/ts-config": "workspace:*",
|
"@coze-arch/ts-config": "workspace:*",
|
||||||
|
"@eslint/js": "~9.12.0",
|
||||||
"@types/eslint": "~9.6.1",
|
"@types/eslint": "~9.6.1",
|
||||||
"@types/estree": "^1.0.1",
|
"@types/estree": "^1.0.1",
|
||||||
"@types/node": "^18",
|
"@types/node": "^18",
|
||||||
|
|
@ -47,3 +47,4 @@
|
||||||
"vitest": "~3.0.5"
|
"vitest": "~3.0.5"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -37,8 +37,14 @@ export const noNewErrorRule: Rule.RuleModule = {
|
||||||
node,
|
node,
|
||||||
messageId: 'no-new-error',
|
messageId: 'no-new-error',
|
||||||
fix(fixer) {
|
fix(fixer) {
|
||||||
const args = node.arguments.map(arg => context.sourceCode.getText(arg)).join(',') || '\'custom error\'';
|
const args =
|
||||||
return fixer.replaceText(node, `new CustomError('normal_error', ${args})`);
|
node.arguments
|
||||||
|
.map(arg => context.sourceCode.getText(arg))
|
||||||
|
.join(',') || "'custom error'";
|
||||||
|
return fixer.replaceText(
|
||||||
|
node,
|
||||||
|
`new CustomError('normal_error', ${args})`,
|
||||||
|
);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -13,4 +13,3 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,6 @@ import { RuleTester } from 'eslint';
|
||||||
import parser from '@typescript-eslint/parser';
|
import parser from '@typescript-eslint/parser';
|
||||||
import { tsxNoLeakedRender } from '.';
|
import { tsxNoLeakedRender } from '.';
|
||||||
|
|
||||||
|
|
||||||
const ruleTester = new RuleTester({
|
const ruleTester = new RuleTester({
|
||||||
languageOptions: {
|
languageOptions: {
|
||||||
parser,
|
parser,
|
||||||
|
|
|
||||||
|
|
@ -182,7 +182,7 @@ const document = t.parse(
|
||||||
'index.proto': indexContent,
|
'index.proto': indexContent,
|
||||||
'base.proto': baseContent,
|
'base.proto': baseContent,
|
||||||
'extra.proto': extraContent,
|
'extra.proto': extraContent,
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
const statement = document.statements[0] as t.InterfaceWithFields;
|
const statement = document.statements[0] as t.InterfaceWithFields;
|
||||||
console.log(statement);
|
console.log(statement);
|
||||||
|
|
|
||||||
|
|
@ -155,7 +155,9 @@ function reviseFieldComments(struct: InterfaceWithFields) {
|
||||||
const { fields } = struct;
|
const { fields } = struct;
|
||||||
|
|
||||||
/* istanbul ignore next */
|
/* istanbul ignore next */
|
||||||
if (fields.length < 2) {return;}
|
if (fields.length < 2) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
for (let i = fields.length - 1; i > 0; i--) {
|
for (let i = fields.length - 1; i > 0; i--) {
|
||||||
const currentField = fields[i];
|
const currentField = fields[i];
|
||||||
|
|
@ -183,7 +185,9 @@ function reviseEnumMemberComments(enm: EnumDefinition) {
|
||||||
const { members } = enm;
|
const { members } = enm;
|
||||||
|
|
||||||
/* istanbul ignore next */
|
/* istanbul ignore next */
|
||||||
if (members.length < 2) {return;}
|
if (members.length < 2) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
for (let i = 0; i < members.length - 1; i++) {
|
for (let i = 0; i < members.length - 1; i++) {
|
||||||
const currentMember = members[i];
|
const currentMember = members[i];
|
||||||
|
|
@ -203,7 +207,9 @@ function reviseEnumMemberComments(enm: EnumDefinition) {
|
||||||
|
|
||||||
function reviseFunctionComments(service: ServiceDefinition) {
|
function reviseFunctionComments(service: ServiceDefinition) {
|
||||||
const { functions } = service;
|
const { functions } = service;
|
||||||
if (functions.length < 2) {return;}
|
if (functions.length < 2) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
for (let i = 0; i < functions.length - 1; i++) {
|
for (let i = 0; i < functions.length - 1; i++) {
|
||||||
const currentFunction = functions[i];
|
const currentFunction = functions[i];
|
||||||
|
|
|
||||||
|
|
@ -317,13 +317,15 @@ function createAddNamespaceReferValue(
|
||||||
const identifierValue = (fieldType as Identifier).value;
|
const identifierValue = (fieldType as Identifier).value;
|
||||||
|
|
||||||
if (!identifierValue.includes('.')) {
|
if (!identifierValue.includes('.')) {
|
||||||
(fieldType as Identifier).namespaceValue =
|
(
|
||||||
`${namespace}.${identifierValue}`;
|
fieldType as Identifier
|
||||||
|
).namespaceValue = `${namespace}.${identifierValue}`;
|
||||||
} else {
|
} else {
|
||||||
const parts = identifierValue.split('.');
|
const parts = identifierValue.split('.');
|
||||||
if (parts.length === 2 && enumNames.includes(parts[0])) {
|
if (parts.length === 2 && enumNames.includes(parts[0])) {
|
||||||
(fieldType as Identifier).namespaceValue =
|
(
|
||||||
`${namespace}.${identifierValue}`;
|
fieldType as Identifier
|
||||||
|
).namespaceValue = `${namespace}.${identifierValue}`;
|
||||||
} else {
|
} else {
|
||||||
for (const regExp of regExpNamespaceMap.keys()) {
|
for (const regExp of regExpNamespaceMap.keys()) {
|
||||||
if (regExp.test(identifierValue)) {
|
if (regExp.test(identifierValue)) {
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,12 @@
|
||||||
* limitations under the License.
|
* 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 {
|
export function convertIntToString(fType: FieldType): FieldType {
|
||||||
const fieldType = { ...fType };
|
const fieldType = { ...fType };
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,9 @@ export function mergeObject(
|
||||||
...sources: { [key: string]: any }[]
|
...sources: { [key: string]: any }[]
|
||||||
): { [key: string]: any } {
|
): { [key: string]: any } {
|
||||||
const newObj = { ...target };
|
const newObj = { ...target };
|
||||||
if (!sources) {return newObj;}
|
if (!sources) {
|
||||||
|
return newObj;
|
||||||
|
}
|
||||||
|
|
||||||
for (const source of sources) {
|
for (const source of sources) {
|
||||||
for (const key of Object.keys(source)) {
|
for (const key of Object.keys(source)) {
|
||||||
|
|
|
||||||
|
|
@ -36,3 +36,4 @@
|
||||||
"vitest": "~3.0.5"
|
"vitest": "~3.0.5"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -45,3 +45,4 @@
|
||||||
"vitest": "~3.0.5"
|
"vitest": "~3.0.5"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -196,7 +196,9 @@ export class MockTransformerPlugin implements IPlugin {
|
||||||
const { name, returnType, fields } = f;
|
const { name, returnType, fields } = f;
|
||||||
const reqType = fields[0].fieldType as any;
|
const reqType = fields[0].fieldType as any;
|
||||||
const resType = this.processReqResPramsType(returnType, ctx.ast);
|
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;
|
) as t.ExpressionStatement;
|
||||||
return variableDeclaration;
|
return variableDeclaration;
|
||||||
|
|
|
||||||
|
|
@ -33,3 +33,4 @@
|
||||||
"vitest": "~3.0.5"
|
"vitest": "~3.0.5"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,9 @@ export const configCenter = new ConfigCenter();
|
||||||
|
|
||||||
export function registerConfig(service: string, config: IdlConfig): void {
|
export function registerConfig(service: string, config: IdlConfig): void {
|
||||||
if (configCenter.getConfig(service)) {
|
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);
|
configCenter.register(service, config);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,12 @@ export interface CancelAbleApi<T, K, O = unknown, B extends boolean = false>
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
// eslint-disable-next-line max-params
|
// 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,
|
meta: IMeta,
|
||||||
cancelable?: B,
|
cancelable?: B,
|
||||||
useCustom = false,
|
useCustom = false,
|
||||||
|
|
|
||||||
|
|
@ -19,3 +19,4 @@
|
||||||
"vitest": "~3.0.5"
|
"vitest": "~3.0.5"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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';
|
import OriginPkgRootWebpackPlugin from '@coze-arch/pkg-root-webpack-plugin-origin';
|
||||||
type PkgRootWebpackPluginOptions = Record<string, unknown>;
|
type PkgRootWebpackPluginOptions = Record<string, unknown>;
|
||||||
declare class PkgRootWebpackPlugin extends OriginPkgRootWebpackPlugin {
|
declare class PkgRootWebpackPlugin extends OriginPkgRootWebpackPlugin {
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,10 @@ import {
|
||||||
getPublishResult,
|
getPublishResult,
|
||||||
} from '@coze-agent-ide/space-bot';
|
} from '@coze-agent-ide/space-bot';
|
||||||
import { I18n } from '@coze-arch/i18n';
|
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 { Tooltip } from '@coze-arch/coze-design';
|
||||||
import { type DynamicParams } from '@coze-arch/bot-typings/teamspace';
|
import { type DynamicParams } from '@coze-arch/bot-typings/teamspace';
|
||||||
import { EVENT_NAMES, sendTeaEvent } from '@coze-arch/bot-tea';
|
import { EVENT_NAMES, sendTeaEvent } from '@coze-arch/bot-tea';
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,10 @@ import {
|
||||||
} from '@coze-agent-ide/space-bot';
|
} from '@coze-agent-ide/space-bot';
|
||||||
import { MonetizePublishInfo } from '@coze-studio/components/monetize';
|
import { MonetizePublishInfo } from '@coze-studio/components/monetize';
|
||||||
import { I18n } from '@coze-arch/i18n';
|
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 { Tooltip } from '@coze-arch/coze-design';
|
||||||
import { type ColumnProps } from '@coze-arch/bot-semi/Table';
|
import { type ColumnProps } from '@coze-arch/bot-semi/Table';
|
||||||
import { Avatar, Space, Typography, UITable } from '@coze-arch/bot-semi';
|
import { Avatar, Space, Typography, UITable } from '@coze-arch/bot-semi';
|
||||||
|
|
|
||||||
|
|
@ -13,12 +13,12 @@
|
||||||
"test:cov": "npm run test -- --coverage"
|
"test:cov": "npm run test -- --coverage"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@coze-studio/bot-audit-base": "workspace:*",
|
|
||||||
"@coze-studio/bot-detail-store": "workspace:*",
|
|
||||||
"@coze-arch/bot-api": "workspace:*",
|
"@coze-arch/bot-api": "workspace:*",
|
||||||
"@coze-arch/bot-flags": "workspace:*",
|
"@coze-arch/bot-flags": "workspace:*",
|
||||||
"@coze-arch/bot-space-api": "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": {
|
"devDependencies": {
|
||||||
"@coze-arch/bot-typings": "workspace:*",
|
"@coze-arch/bot-typings": "workspace:*",
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,7 @@ export const QueryCollect: FC = () => {
|
||||||
const {
|
const {
|
||||||
data: { check_not_pass_msg, check_not_pass },
|
data: { check_not_pass_msg, check_not_pass },
|
||||||
} = await updateQueryCollect(queryCollectConf);
|
} = 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();
|
await formApi.current?.validate();
|
||||||
setQueryCollect(queryCollectConf);
|
setQueryCollect(queryCollectConf);
|
||||||
setVisible(false);
|
setVisible(false);
|
||||||
|
|
|
||||||
|
|
@ -13,4 +13,3 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -31,4 +31,3 @@ export const POLLING_INTERVAL = 10000;
|
||||||
export const DELAY_TIME = 2000;
|
export const DELAY_TIME = 2000;
|
||||||
|
|
||||||
export const CONNECTOR_ID = '10000010';
|
export const CONNECTOR_ID = '10000010';
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -26,13 +26,7 @@ import React, {
|
||||||
import { set as ObjectSet, get as ObjectGet, cloneDeep } from 'lodash-es';
|
import { set as ObjectSet, get as ObjectGet, cloneDeep } from 'lodash-es';
|
||||||
import { I18n } from '@coze-arch/i18n';
|
import { I18n } from '@coze-arch/i18n';
|
||||||
import { Tag } from '@coze-arch/coze-design';
|
import { Tag } from '@coze-arch/coze-design';
|
||||||
import {
|
import { UIButton, Table, Typography, UITag, Space } from '@coze-arch/bot-semi';
|
||||||
UIButton,
|
|
||||||
Table,
|
|
||||||
Typography,
|
|
||||||
UITag,
|
|
||||||
Space,
|
|
||||||
} from '@coze-arch/bot-semi';
|
|
||||||
import { IconAddChildOutlined } from '@coze-arch/bot-icons';
|
import { IconAddChildOutlined } from '@coze-arch/bot-icons';
|
||||||
import {
|
import {
|
||||||
type APIParameter,
|
type APIParameter,
|
||||||
|
|
|
||||||
|
|
@ -16,12 +16,7 @@
|
||||||
|
|
||||||
import { I18n } from '@coze-arch/i18n';
|
import { I18n } from '@coze-arch/i18n';
|
||||||
import { type OptionProps } from '@coze-arch/bot-semi/Select';
|
import { type OptionProps } from '@coze-arch/bot-semi/Select';
|
||||||
import {
|
import { UIInput, UISelect, InputGroup, Typography } from '@coze-arch/bot-semi';
|
||||||
UIInput,
|
|
||||||
UISelect,
|
|
||||||
InputGroup,
|
|
||||||
Typography,
|
|
||||||
} from '@coze-arch/bot-semi';
|
|
||||||
import {
|
import {
|
||||||
DefaultParamSource,
|
DefaultParamSource,
|
||||||
type APIParameter,
|
type APIParameter,
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,10 @@ import {
|
||||||
ConnectorDynamicStatus,
|
ConnectorDynamicStatus,
|
||||||
type ConnectorInfo,
|
type ConnectorInfo,
|
||||||
} from '@coze-arch/bot-api/developer_api';
|
} 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 { Dropdown, IconButton, Tooltip } from '@coze-arch/coze-design';
|
||||||
|
|
||||||
import { LinkDropItem } from './link-drop-item';
|
import { LinkDropItem } from './link-drop-item';
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ const getToolGroupText = (key: ToolGroupKey): string =>
|
||||||
[ToolGroupKey.DIALOG]: I18n.t('bot_edit_type_dialog'),
|
[ToolGroupKey.DIALOG]: I18n.t('bot_edit_type_dialog'),
|
||||||
[ToolGroupKey.CHARACTER]: I18n.t('bot_edit_type_character'),
|
[ToolGroupKey.CHARACTER]: I18n.t('bot_edit_type_character'),
|
||||||
[ToolGroupKey.HOOKS]: 'Hooks',
|
[ToolGroupKey.HOOKS]: 'Hooks',
|
||||||
})[key];
|
}[key]);
|
||||||
|
|
||||||
const getToolText = (toolKey: ToolKey) =>
|
const getToolText = (toolKey: ToolKey) =>
|
||||||
({
|
({
|
||||||
|
|
@ -75,7 +75,7 @@ const getToolText = (toolKey: ToolKey) =>
|
||||||
[ToolKey.SHORTCUT]: I18n.t('bot_ide_shortcut'),
|
[ToolKey.SHORTCUT]: I18n.t('bot_ide_shortcut'),
|
||||||
[ToolKey.DEV_HOOKS]: 'Hooks',
|
[ToolKey.DEV_HOOKS]: 'Hooks',
|
||||||
[ToolKey.USER_INPUT]: I18n.t('chat_setting_user_input_default_mode'),
|
[ToolKey.USER_INPUT]: I18n.t('chat_setting_user_input_default_mode'),
|
||||||
})[toolKey];
|
}[toolKey]);
|
||||||
|
|
||||||
const AlertGroups: FC<{ items: AlertItem[] }> = ({ items }) => {
|
const AlertGroups: FC<{ items: AlertItem[] }> = ({ items }) => {
|
||||||
const grouped = groupBy(items, 'groupTitle');
|
const grouped = groupBy(items, 'groupTitle');
|
||||||
|
|
@ -296,7 +296,7 @@ const getGroupTittleByConfigType = (type: ModelFuncConfigType): string =>
|
||||||
'agentflow_transfer_ conversation_settings_title',
|
'agentflow_transfer_ conversation_settings_title',
|
||||||
),
|
),
|
||||||
[ModelFuncConfigType.HookInfo]: 'Hooks',
|
[ModelFuncConfigType.HookInfo]: 'Hooks',
|
||||||
})[type];
|
}[type]);
|
||||||
|
|
||||||
const getTitleByConfigType = (type: ModelFuncConfigType): string =>
|
const getTitleByConfigType = (type: ModelFuncConfigType): string =>
|
||||||
// @ts-expect-error fix me late
|
// @ts-expect-error fix me late
|
||||||
|
|
@ -325,7 +325,7 @@ const getTitleByConfigType = (type: ModelFuncConfigType): string =>
|
||||||
'agentflow_transfer_ conversation_settings_mode_node_title',
|
'agentflow_transfer_ conversation_settings_mode_node_title',
|
||||||
),
|
),
|
||||||
[ModelFuncConfigType.HookInfo]: 'Hooks',
|
[ModelFuncConfigType.HookInfo]: 'Hooks',
|
||||||
})[type];
|
}[type]);
|
||||||
|
|
||||||
export const mapConfigTypeToAlertItem = (
|
export const mapConfigTypeToAlertItem = (
|
||||||
type: ModelFuncConfigType,
|
type: ModelFuncConfigType,
|
||||||
|
|
|
||||||
|
|
@ -32,10 +32,7 @@ import {
|
||||||
UIButton,
|
UIButton,
|
||||||
UITag,
|
UITag,
|
||||||
} from '@coze-arch/bot-semi';
|
} from '@coze-arch/bot-semi';
|
||||||
import {
|
import { ProductStatus, type public_api } from '@coze-arch/bot-api/product_api';
|
||||||
ProductStatus,
|
|
||||||
type public_api,
|
|
||||||
} from '@coze-arch/bot-api/product_api';
|
|
||||||
import { type PluginApi } from '@coze-arch/bot-api/plugin_develop';
|
import { type PluginApi } from '@coze-arch/bot-api/plugin_develop';
|
||||||
import { useViewExample } from '@coze-agent-ide/bot-plugin-tools/useViewExample';
|
import { useViewExample } from '@coze-agent-ide/bot-plugin-tools/useViewExample';
|
||||||
import { Popconfirm } from '@coze-arch/coze-design';
|
import { Popconfirm } from '@coze-arch/coze-design';
|
||||||
|
|
|
||||||
|
|
@ -22,10 +22,7 @@ import {
|
||||||
type SortType,
|
type SortType,
|
||||||
} from '@coze-arch/bot-api/product_api';
|
} from '@coze-arch/bot-api/product_api';
|
||||||
import { type PluginInfoForPlayground } from '@coze-arch/bot-api/plugin_develop';
|
import { type PluginInfoForPlayground } from '@coze-arch/bot-api/plugin_develop';
|
||||||
import {
|
import { type OrderBy, type PluginApi } from '@coze-arch/bot-api/developer_api';
|
||||||
type OrderBy,
|
|
||||||
type PluginApi,
|
|
||||||
} from '@coze-arch/bot-api/developer_api';
|
|
||||||
|
|
||||||
import { type MineActiveEnum } from '../constants/plugin-modal-constants';
|
import { type MineActiveEnum } from '../constants/plugin-modal-constants';
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -28,10 +28,7 @@ import { nanoid } from 'nanoid';
|
||||||
import { cloneDeep, omit } from 'lodash-es';
|
import { cloneDeep, omit } from 'lodash-es';
|
||||||
import { useRequest } from 'ahooks';
|
import { useRequest } from 'ahooks';
|
||||||
import { I18n } from '@coze-arch/i18n';
|
import { I18n } from '@coze-arch/i18n';
|
||||||
import {
|
import { IconCozCross, IconCozLongArrowUp } from '@coze-arch/coze-design/icons';
|
||||||
IconCozCross,
|
|
||||||
IconCozLongArrowUp,
|
|
||||||
} from '@coze-arch/coze-design/icons';
|
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
IconButton,
|
IconButton,
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,9 @@ export const ConnectorError = ({ errorMessage }: ConnectorErrorProps) => {
|
||||||
<Typography.Text
|
<Typography.Text
|
||||||
className={styles['error-link-underline']}
|
className={styles['error-link-underline']}
|
||||||
link={{
|
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={{
|
ellipsis={{
|
||||||
showTooltip: {
|
showTooltip: {
|
||||||
|
|
|
||||||
|
|
@ -13,4 +13,3 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -191,7 +191,9 @@ export const DataSetAreaItem: FC<IDataSetAreaProps> = ({
|
||||||
};
|
};
|
||||||
|
|
||||||
navigate(
|
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) => {
|
const jumpToAdd = (datasetID: string, type: UnitType) => {
|
||||||
|
|
@ -203,7 +205,11 @@ export const DataSetAreaItem: FC<IDataSetAreaProps> = ({
|
||||||
page_mode: 'modal',
|
page_mode: 'modal',
|
||||||
};
|
};
|
||||||
navigate(
|
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({
|
const { node: addModal, open: openAddModal } = useKnowledgeListModal({
|
||||||
|
|
|
||||||
|
|
@ -27,10 +27,7 @@ import {
|
||||||
updateHeaderStatus,
|
updateHeaderStatus,
|
||||||
useBotDetailIsReadonly,
|
useBotDetailIsReadonly,
|
||||||
} from '@coze-studio/bot-detail-store';
|
} from '@coze-studio/bot-detail-store';
|
||||||
import {
|
import { AgentVersionCompat, BotMode } from '@coze-arch/bot-api/playground_api';
|
||||||
AgentVersionCompat,
|
|
||||||
BotMode,
|
|
||||||
} from '@coze-arch/bot-api/playground_api';
|
|
||||||
|
|
||||||
import { useBotPageStore } from '../../store/bot-page/store';
|
import { useBotPageStore } from '../../store/bot-page/store';
|
||||||
import { ModeChangeView, type ModeChangeViewProps } from './mode-change-view';
|
import { ModeChangeView, type ModeChangeViewProps } from './mode-change-view';
|
||||||
|
|
|
||||||
|
|
@ -13,4 +13,3 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -62,7 +62,8 @@ export const SuggestionList: FC<SuggestionListProps> = props => {
|
||||||
|
|
||||||
const itemRender = useMemo<TItemRender<SuggestQuestionMessage>>(
|
const itemRender = useMemo<TItemRender<SuggestQuestionMessage>>(
|
||||||
() =>
|
() =>
|
||||||
({ data, connect, isDragging, isHovered }) => (
|
({ data, connect, isDragging, isHovered }) =>
|
||||||
|
(
|
||||||
<SuggestQuestionItemContent
|
<SuggestQuestionItemContent
|
||||||
key={data.id}
|
key={data.id}
|
||||||
message={data}
|
message={data}
|
||||||
|
|
@ -75,7 +76,9 @@ export const SuggestionList: FC<SuggestionListProps> = props => {
|
||||||
onMessageChange={value => {
|
onMessageChange={value => {
|
||||||
onChange?.(prev => {
|
onChange?.(prev => {
|
||||||
const _suggestions = [...prev.suggested_questions];
|
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);
|
_suggestions.splice(index, 1, value);
|
||||||
return {
|
return {
|
||||||
...prev,
|
...prev,
|
||||||
|
|
|
||||||
|
|
@ -16,12 +16,7 @@
|
||||||
|
|
||||||
import { I18n } from '@coze-arch/i18n';
|
import { I18n } from '@coze-arch/i18n';
|
||||||
import { IconCozCopy } from '@coze-arch/coze-design/icons';
|
import { IconCozCopy } from '@coze-arch/coze-design/icons';
|
||||||
import {
|
import { IconButton, Space, Tooltip, Typography } from '@coze-arch/coze-design';
|
||||||
IconButton,
|
|
||||||
Space,
|
|
||||||
Tooltip,
|
|
||||||
Typography,
|
|
||||||
} from '@coze-arch/coze-design';
|
|
||||||
|
|
||||||
const doRenderTooltip = (content, children) => (
|
const doRenderTooltip = (content, children) => (
|
||||||
<Tooltip content={content}>{children}</Tooltip>
|
<Tooltip content={content}>{children}</Tooltip>
|
||||||
|
|
|
||||||
|
|
@ -149,7 +149,7 @@ export const useWorkflowPublishedModel = ({
|
||||||
flow_mode:
|
flow_mode:
|
||||||
plugin.plugin_type === PluginType.IMAGEFLOW
|
plugin.plugin_type === PluginType.IMAGEFLOW
|
||||||
? WorkflowMode.Imageflow
|
? WorkflowMode.Imageflow
|
||||||
: (jumpResponse?.flowMode ?? WorkflowMode.Workflow),
|
: jumpResponse?.flowMode ?? WorkflowMode.Workflow,
|
||||||
};
|
};
|
||||||
const onOkResult = onOk(workflow);
|
const onOkResult = onOk(workflow);
|
||||||
const res = await Promise.resolve(onOkResult);
|
const res = await Promise.resolve(onOkResult);
|
||||||
|
|
|
||||||
|
|
@ -144,7 +144,7 @@ export const AgentInfoForm = forwardRef<
|
||||||
initValue={
|
initValue={
|
||||||
hideOperation
|
hideOperation
|
||||||
? spacesList?.[0]?.id
|
? spacesList?.[0]?.id
|
||||||
: (currentSpaceId ?? spacesList?.[0]?.id)
|
: currentSpaceId ?? spacesList?.[0]?.id
|
||||||
}
|
}
|
||||||
placeholder={I18n.t('select_team')}
|
placeholder={I18n.t('select_team')}
|
||||||
noErrorMessage
|
noErrorMessage
|
||||||
|
|
|
||||||
|
|
@ -13,4 +13,3 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,32 +15,32 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export interface TrafficEnv {
|
export interface TrafficEnv {
|
||||||
Open: boolean,
|
Open: boolean;
|
||||||
Env: string,
|
Env: string;
|
||||||
}
|
}
|
||||||
export interface Base {
|
export interface Base {
|
||||||
LogID: string,
|
LogID: string;
|
||||||
Caller: string,
|
Caller: string;
|
||||||
Addr: string,
|
Addr: string;
|
||||||
Client: string,
|
Client: string;
|
||||||
TrafficEnv?: TrafficEnv,
|
TrafficEnv?: TrafficEnv;
|
||||||
Extra?: {
|
Extra?: {
|
||||||
[key: string | number]: string
|
[key: string | number]: string;
|
||||||
},
|
};
|
||||||
}
|
}
|
||||||
export interface BaseResp {
|
export interface BaseResp {
|
||||||
StatusMessage: string,
|
StatusMessage: string;
|
||||||
StatusCode: number,
|
StatusCode: number;
|
||||||
Extra?: {
|
Extra?: {
|
||||||
[key: string | number]: string
|
[key: string | number]: string;
|
||||||
},
|
};
|
||||||
}
|
}
|
||||||
export interface EmptyReq {}
|
export interface EmptyReq {}
|
||||||
export interface EmptyData {}
|
export interface EmptyData {}
|
||||||
export interface EmptyResp {
|
export interface EmptyResp {
|
||||||
code: number,
|
code: number;
|
||||||
msg: string,
|
msg: string;
|
||||||
data: EmptyData,
|
data: EmptyData;
|
||||||
}
|
}
|
||||||
export interface EmptyRpcReq {}
|
export interface EmptyRpcReq {}
|
||||||
export interface EmptyRpcResp {}
|
export interface EmptyRpcResp {}
|
||||||
|
|
@ -74,7 +74,7 @@ export enum ProductPaidType {
|
||||||
Paid = 1,
|
Paid = 1,
|
||||||
}
|
}
|
||||||
export interface CommercialSetting {
|
export interface CommercialSetting {
|
||||||
commercial_type: ProductPaidType
|
commercial_type: ProductPaidType;
|
||||||
}
|
}
|
||||||
export enum ProductStatus {
|
export enum ProductStatus {
|
||||||
/** 从未上架 */
|
/** 从未上架 */
|
||||||
|
|
@ -84,23 +84,23 @@ export enum ProductStatus {
|
||||||
Banned = 3,
|
Banned = 3,
|
||||||
}
|
}
|
||||||
export interface UserLabel {
|
export interface UserLabel {
|
||||||
label_id: string,
|
label_id: string;
|
||||||
label_name: string,
|
label_name: string;
|
||||||
icon_uri: string,
|
icon_uri: string;
|
||||||
icon_url: string,
|
icon_url: string;
|
||||||
jump_link: string,
|
jump_link: string;
|
||||||
}
|
}
|
||||||
export interface UserInfo {
|
export interface UserInfo {
|
||||||
user_id: string,
|
user_id: string;
|
||||||
user_name: string,
|
user_name: string;
|
||||||
name: string,
|
name: string;
|
||||||
avatar_url: string,
|
avatar_url: string;
|
||||||
user_label?: UserLabel,
|
user_label?: UserLabel;
|
||||||
follow_type?: marketplace_common.FollowType,
|
follow_type?: marketplace_common.FollowType;
|
||||||
}
|
}
|
||||||
export interface ImageInfo {
|
export interface ImageInfo {
|
||||||
uri: string,
|
uri: string;
|
||||||
url: string,
|
url: string;
|
||||||
}
|
}
|
||||||
export enum ProductDraftStatus {
|
export enum ProductDraftStatus {
|
||||||
/** 默认 */
|
/** 默认 */
|
||||||
|
|
@ -117,7 +117,7 @@ export enum ProductDraftStatus {
|
||||||
export type AuditStatus = ProductDraftStatus;
|
export type AuditStatus = ProductDraftStatus;
|
||||||
export interface OpeningDialog {
|
export interface OpeningDialog {
|
||||||
/** Bot开场白 */
|
/** Bot开场白 */
|
||||||
content: string
|
content: string;
|
||||||
}
|
}
|
||||||
export enum InputType {
|
export enum InputType {
|
||||||
String = 1,
|
String = 1,
|
||||||
|
|
@ -169,45 +169,45 @@ export enum UIPreviewType {
|
||||||
Client = 2,
|
Client = 2,
|
||||||
}
|
}
|
||||||
export interface ChargeSKUExtra {
|
export interface ChargeSKUExtra {
|
||||||
quantity: string,
|
quantity: string;
|
||||||
is_self_define: boolean,
|
is_self_define: boolean;
|
||||||
}
|
}
|
||||||
export enum FavoriteListSource {
|
export enum FavoriteListSource {
|
||||||
/** 用户自己创建的 */
|
/** 用户自己创建的 */
|
||||||
CreatedByMe = 1,
|
CreatedByMe = 1,
|
||||||
}
|
}
|
||||||
export interface FavoriteEntity {
|
export interface FavoriteEntity {
|
||||||
entity_id: string,
|
entity_id: string;
|
||||||
entity_type: ProductEntityType,
|
entity_type: ProductEntityType;
|
||||||
name: string,
|
name: string;
|
||||||
icon_url: string,
|
icon_url: string;
|
||||||
description: string,
|
description: string;
|
||||||
/** 废弃,使用UserInfo */
|
/** 废弃,使用UserInfo */
|
||||||
seller: SellerInfo,
|
seller: SellerInfo;
|
||||||
/** 用于跳转到Bot编辑页 */
|
/** 用于跳转到Bot编辑页 */
|
||||||
space_id: string,
|
space_id: string;
|
||||||
/** 用户是否有该实体所在Space的权限 */
|
/** 用户是否有该实体所在Space的权限 */
|
||||||
has_space_permission: boolean,
|
has_space_permission: boolean;
|
||||||
/** 收藏时间 */
|
/** 收藏时间 */
|
||||||
favorite_at: string,
|
favorite_at: string;
|
||||||
product_extra?: FavoriteProductExtra,
|
product_extra?: FavoriteProductExtra;
|
||||||
user_info: UserInfo,
|
user_info: UserInfo;
|
||||||
plugin_extra?: FavoritePluginExtra,
|
plugin_extra?: FavoritePluginExtra;
|
||||||
}
|
}
|
||||||
export interface SellerInfo {
|
export interface SellerInfo {
|
||||||
user_id: string,
|
user_id: string;
|
||||||
user_name: string,
|
user_name: string;
|
||||||
avatar_url: string,
|
avatar_url: string;
|
||||||
}
|
}
|
||||||
export interface FavoriteProductExtra {
|
export interface FavoriteProductExtra {
|
||||||
product_id: string,
|
product_id: string;
|
||||||
product_status: ProductStatus,
|
product_status: ProductStatus;
|
||||||
}
|
}
|
||||||
export interface FavoritePluginExtra {
|
export interface FavoritePluginExtra {
|
||||||
tools: PluginTool[]
|
tools: PluginTool[];
|
||||||
}
|
}
|
||||||
export interface PluginTool {
|
export interface PluginTool {
|
||||||
id: string,
|
id: string;
|
||||||
name: string,
|
name: string;
|
||||||
description: string,
|
description: string;
|
||||||
}
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -18,11 +18,11 @@ import * as base from './../../base';
|
||||||
export { base };
|
export { base };
|
||||||
export interface Price {
|
export interface Price {
|
||||||
/** 金额 */
|
/** 金额 */
|
||||||
amount: string,
|
amount: string;
|
||||||
/** 币种,如USD、CNY */
|
/** 币种,如USD、CNY */
|
||||||
currency: string,
|
currency: string;
|
||||||
/** 小数位数 */
|
/** 小数位数 */
|
||||||
decimal_num: number,
|
decimal_num: number;
|
||||||
}
|
}
|
||||||
export enum FollowType {
|
export enum FollowType {
|
||||||
/** 无关系 */
|
/** 无关系 */
|
||||||
|
|
|
||||||
|
|
@ -16,165 +16,186 @@
|
||||||
|
|
||||||
import { createAPI } from './../../api/config';
|
import { createAPI } from './../../api/config';
|
||||||
export interface AppUserInfo {
|
export interface AppUserInfo {
|
||||||
user_unique_name: string
|
user_unique_name: string;
|
||||||
}
|
}
|
||||||
export interface User {
|
export interface User {
|
||||||
/** 与原接口字段名对齐 */
|
/** 与原接口字段名对齐 */
|
||||||
user_id_str: string,
|
user_id_str: string;
|
||||||
name: string,
|
name: string;
|
||||||
user_unique_name: string,
|
user_unique_name: string;
|
||||||
email: string,
|
email: string;
|
||||||
description: string,
|
description: string;
|
||||||
avatar_url: string,
|
avatar_url: string;
|
||||||
screen_name?: string,
|
screen_name?: string;
|
||||||
app_user_info?: AppUserInfo,
|
app_user_info?: AppUserInfo;
|
||||||
locale?: string,
|
locale?: string;
|
||||||
/** unix timestamp in seconds */
|
/** unix timestamp in seconds */
|
||||||
user_create_time: number,
|
user_create_time: number;
|
||||||
}
|
}
|
||||||
export interface PassportWebEmailRegisterV2PostRequest {
|
export interface PassportWebEmailRegisterV2PostRequest {
|
||||||
password: string,
|
password: string;
|
||||||
email: string,
|
email: string;
|
||||||
}
|
}
|
||||||
export interface PassportWebEmailRegisterV2PostResponse {
|
export interface PassportWebEmailRegisterV2PostResponse {
|
||||||
data: User,
|
data: User;
|
||||||
code: number,
|
code: number;
|
||||||
msg: string,
|
msg: string;
|
||||||
}
|
}
|
||||||
export interface PassportWebLogoutGetRequest {}
|
export interface PassportWebLogoutGetRequest {}
|
||||||
export interface PassportWebLogoutGetResponse {
|
export interface PassportWebLogoutGetResponse {
|
||||||
redirect_url: string,
|
redirect_url: string;
|
||||||
code: number,
|
code: number;
|
||||||
msg: string,
|
msg: string;
|
||||||
}
|
}
|
||||||
export interface PassportWebEmailLoginPostRequest {
|
export interface PassportWebEmailLoginPostRequest {
|
||||||
email: string,
|
email: string;
|
||||||
password: string,
|
password: string;
|
||||||
}
|
}
|
||||||
export interface PassportWebEmailLoginPostResponse {
|
export interface PassportWebEmailLoginPostResponse {
|
||||||
data: User,
|
data: User;
|
||||||
code: number,
|
code: number;
|
||||||
msg: string,
|
msg: string;
|
||||||
}
|
}
|
||||||
export interface PassportWebEmailPasswordResetGetRequest {
|
export interface PassportWebEmailPasswordResetGetRequest {
|
||||||
password: string,
|
password: string;
|
||||||
code: string,
|
code: string;
|
||||||
email: string,
|
email: string;
|
||||||
}
|
}
|
||||||
export interface PassportWebEmailPasswordResetGetResponse {
|
export interface PassportWebEmailPasswordResetGetResponse {
|
||||||
code: number,
|
code: number;
|
||||||
msg: string,
|
msg: string;
|
||||||
}
|
}
|
||||||
export interface PassportAccountInfoV2Request {}
|
export interface PassportAccountInfoV2Request {}
|
||||||
export interface PassportAccountInfoV2Response {
|
export interface PassportAccountInfoV2Response {
|
||||||
data: User,
|
data: User;
|
||||||
code: number,
|
code: number;
|
||||||
msg: string,
|
msg: string;
|
||||||
}
|
}
|
||||||
export interface UserUpdateAvatarRequest {
|
export interface UserUpdateAvatarRequest {
|
||||||
avatar: Blob
|
avatar: Blob;
|
||||||
}
|
}
|
||||||
export interface UserUpdateAvatarResponseData {
|
export interface UserUpdateAvatarResponseData {
|
||||||
web_uri: string
|
web_uri: string;
|
||||||
}
|
}
|
||||||
export interface UserUpdateAvatarResponse {
|
export interface UserUpdateAvatarResponse {
|
||||||
data: UserUpdateAvatarResponseData,
|
data: UserUpdateAvatarResponseData;
|
||||||
code: number,
|
code: number;
|
||||||
msg: string,
|
msg: string;
|
||||||
}
|
}
|
||||||
export interface UserUpdateProfileRequest {
|
export interface UserUpdateProfileRequest {
|
||||||
name?: string,
|
name?: string;
|
||||||
user_unique_name?: string,
|
user_unique_name?: string;
|
||||||
description?: string,
|
description?: string;
|
||||||
locale?: string,
|
locale?: string;
|
||||||
}
|
}
|
||||||
export interface UserUpdateProfileResponse {
|
export interface UserUpdateProfileResponse {
|
||||||
code: number,
|
code: number;
|
||||||
msg: string,
|
msg: string;
|
||||||
}
|
}
|
||||||
/** 邮箱密码注册 */
|
/** 邮箱密码注册 */
|
||||||
export const PassportWebEmailRegisterV2Post = /*#__PURE__*/createAPI<PassportWebEmailRegisterV2PostRequest, PassportWebEmailRegisterV2PostResponse>({
|
export const PassportWebEmailRegisterV2Post = /*#__PURE__*/ createAPI<
|
||||||
"url": "/api/passport/web/email/register/v2/",
|
PassportWebEmailRegisterV2PostRequest,
|
||||||
"method": "POST",
|
PassportWebEmailRegisterV2PostResponse
|
||||||
"name": "PassportWebEmailRegisterV2Post",
|
>({
|
||||||
"reqType": "PassportWebEmailRegisterV2PostRequest",
|
url: '/api/passport/web/email/register/v2/',
|
||||||
"reqMapping": {
|
method: 'POST',
|
||||||
"body": ["password", "email"]
|
name: 'PassportWebEmailRegisterV2Post',
|
||||||
|
reqType: 'PassportWebEmailRegisterV2PostRequest',
|
||||||
|
reqMapping: {
|
||||||
|
body: ['password', 'email'],
|
||||||
},
|
},
|
||||||
"resType": "PassportWebEmailRegisterV2PostResponse",
|
resType: 'PassportWebEmailRegisterV2PostResponse',
|
||||||
"schemaRoot": "api://schemas/idl_passport_passport",
|
schemaRoot: 'api://schemas/idl_passport_passport',
|
||||||
"service": "passport"
|
service: 'passport',
|
||||||
});
|
});
|
||||||
/** 退出登录 */
|
/** 退出登录 */
|
||||||
export const PassportWebLogoutGet = /*#__PURE__*/createAPI<PassportWebLogoutGetRequest, PassportWebLogoutGetResponse>({
|
export const PassportWebLogoutGet = /*#__PURE__*/ createAPI<
|
||||||
"url": "/api/passport/web/logout/",
|
PassportWebLogoutGetRequest,
|
||||||
"method": "GET",
|
PassportWebLogoutGetResponse
|
||||||
"name": "PassportWebLogoutGet",
|
>({
|
||||||
"reqType": "PassportWebLogoutGetRequest",
|
url: '/api/passport/web/logout/',
|
||||||
"reqMapping": {},
|
method: 'GET',
|
||||||
"resType": "PassportWebLogoutGetResponse",
|
name: 'PassportWebLogoutGet',
|
||||||
"schemaRoot": "api://schemas/idl_passport_passport",
|
reqType: 'PassportWebLogoutGetRequest',
|
||||||
"service": "passport"
|
reqMapping: {},
|
||||||
|
resType: 'PassportWebLogoutGetResponse',
|
||||||
|
schemaRoot: 'api://schemas/idl_passport_passport',
|
||||||
|
service: 'passport',
|
||||||
});
|
});
|
||||||
/** 邮箱帐密登录 */
|
/** 邮箱帐密登录 */
|
||||||
export const PassportWebEmailLoginPost = /*#__PURE__*/createAPI<PassportWebEmailLoginPostRequest, PassportWebEmailLoginPostResponse>({
|
export const PassportWebEmailLoginPost = /*#__PURE__*/ createAPI<
|
||||||
"url": "/api/passport/web/email/login/",
|
PassportWebEmailLoginPostRequest,
|
||||||
"method": "POST",
|
PassportWebEmailLoginPostResponse
|
||||||
"name": "PassportWebEmailLoginPost",
|
>({
|
||||||
"reqType": "PassportWebEmailLoginPostRequest",
|
url: '/api/passport/web/email/login/',
|
||||||
"reqMapping": {
|
method: 'POST',
|
||||||
"body": ["email", "password"]
|
name: 'PassportWebEmailLoginPost',
|
||||||
|
reqType: 'PassportWebEmailLoginPostRequest',
|
||||||
|
reqMapping: {
|
||||||
|
body: ['email', 'password'],
|
||||||
},
|
},
|
||||||
"resType": "PassportWebEmailLoginPostResponse",
|
resType: 'PassportWebEmailLoginPostResponse',
|
||||||
"schemaRoot": "api://schemas/idl_passport_passport",
|
schemaRoot: 'api://schemas/idl_passport_passport',
|
||||||
"service": "passport"
|
service: 'passport',
|
||||||
});
|
});
|
||||||
/** 通过邮箱重置密码 */
|
/** 通过邮箱重置密码 */
|
||||||
export const PassportWebEmailPasswordResetGet = /*#__PURE__*/createAPI<PassportWebEmailPasswordResetGetRequest, PassportWebEmailPasswordResetGetResponse>({
|
export const PassportWebEmailPasswordResetGet = /*#__PURE__*/ createAPI<
|
||||||
"url": "/api/passport/web/email/password/reset/",
|
PassportWebEmailPasswordResetGetRequest,
|
||||||
"method": "GET",
|
PassportWebEmailPasswordResetGetResponse
|
||||||
"name": "PassportWebEmailPasswordResetGet",
|
>({
|
||||||
"reqType": "PassportWebEmailPasswordResetGetRequest",
|
url: '/api/passport/web/email/password/reset/',
|
||||||
"reqMapping": {
|
method: 'GET',
|
||||||
"query": ["password", "code", "email"]
|
name: 'PassportWebEmailPasswordResetGet',
|
||||||
|
reqType: 'PassportWebEmailPasswordResetGetRequest',
|
||||||
|
reqMapping: {
|
||||||
|
query: ['password', 'code', 'email'],
|
||||||
},
|
},
|
||||||
"resType": "PassportWebEmailPasswordResetGetResponse",
|
resType: 'PassportWebEmailPasswordResetGetResponse',
|
||||||
"schemaRoot": "api://schemas/idl_passport_passport",
|
schemaRoot: 'api://schemas/idl_passport_passport',
|
||||||
"service": "passport"
|
service: 'passport',
|
||||||
});
|
});
|
||||||
/** 账号信息 */
|
/** 账号信息 */
|
||||||
export const PassportAccountInfoV2 = /*#__PURE__*/createAPI<PassportAccountInfoV2Request, PassportAccountInfoV2Response>({
|
export const PassportAccountInfoV2 = /*#__PURE__*/ createAPI<
|
||||||
"url": "/api/passport/account/info/v2/",
|
PassportAccountInfoV2Request,
|
||||||
"method": "POST",
|
PassportAccountInfoV2Response
|
||||||
"name": "PassportAccountInfoV2",
|
>({
|
||||||
"reqType": "PassportAccountInfoV2Request",
|
url: '/api/passport/account/info/v2/',
|
||||||
"reqMapping": {},
|
method: 'POST',
|
||||||
"resType": "PassportAccountInfoV2Response",
|
name: 'PassportAccountInfoV2',
|
||||||
"schemaRoot": "api://schemas/idl_passport_passport",
|
reqType: 'PassportAccountInfoV2Request',
|
||||||
"service": "passport"
|
reqMapping: {},
|
||||||
|
resType: 'PassportAccountInfoV2Response',
|
||||||
|
schemaRoot: 'api://schemas/idl_passport_passport',
|
||||||
|
service: 'passport',
|
||||||
});
|
});
|
||||||
export const UserUpdateAvatar = /*#__PURE__*/createAPI<UserUpdateAvatarRequest, UserUpdateAvatarResponse>({
|
export const UserUpdateAvatar = /*#__PURE__*/ createAPI<
|
||||||
"url": "/api/web/user/update/upload_avatar/",
|
UserUpdateAvatarRequest,
|
||||||
"method": "POST",
|
UserUpdateAvatarResponse
|
||||||
"name": "UserUpdateAvatar",
|
>({
|
||||||
"reqType": "UserUpdateAvatarRequest",
|
url: '/api/web/user/update/upload_avatar/',
|
||||||
"reqMapping": {
|
method: 'POST',
|
||||||
"body": ["avatar"]
|
name: 'UserUpdateAvatar',
|
||||||
|
reqType: 'UserUpdateAvatarRequest',
|
||||||
|
reqMapping: {
|
||||||
|
body: ['avatar'],
|
||||||
},
|
},
|
||||||
"resType": "UserUpdateAvatarResponse",
|
resType: 'UserUpdateAvatarResponse',
|
||||||
"schemaRoot": "api://schemas/idl_passport_passport",
|
schemaRoot: 'api://schemas/idl_passport_passport',
|
||||||
"service": "passport",
|
service: 'passport',
|
||||||
"serializer": "form"
|
serializer: 'form',
|
||||||
});
|
});
|
||||||
export const UserUpdateProfile = /*#__PURE__*/createAPI<UserUpdateProfileRequest, UserUpdateProfileResponse>({
|
export const UserUpdateProfile = /*#__PURE__*/ createAPI<
|
||||||
"url": "/api/user/update_profile",
|
UserUpdateProfileRequest,
|
||||||
"method": "POST",
|
UserUpdateProfileResponse
|
||||||
"name": "UserUpdateProfile",
|
>({
|
||||||
"reqType": "UserUpdateProfileRequest",
|
url: '/api/user/update_profile',
|
||||||
"reqMapping": {
|
method: 'POST',
|
||||||
"body": ["name", "user_unique_name", "description", "locale"]
|
name: 'UserUpdateProfile',
|
||||||
|
reqType: 'UserUpdateProfileRequest',
|
||||||
|
reqMapping: {
|
||||||
|
body: ['name', 'user_unique_name', 'description', 'locale'],
|
||||||
},
|
},
|
||||||
"resType": "UserUpdateProfileResponse",
|
resType: 'UserUpdateProfileResponse',
|
||||||
"schemaRoot": "api://schemas/idl_passport_passport",
|
schemaRoot: 'api://schemas/idl_passport_passport',
|
||||||
"service": "passport"
|
service: 'passport',
|
||||||
});
|
});
|
||||||
|
|
@ -42,11 +42,9 @@ vi.mock('@coze-arch/bot-http', () => {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
isApiError: vi.fn(),
|
isApiError: vi.fn(),
|
||||||
ApiError: vi.fn().mockImplementation(function (
|
ApiError: vi
|
||||||
this: any,
|
.fn()
|
||||||
code: string,
|
.mockImplementation(function (this: any, code: string, msg: string) {
|
||||||
msg: string,
|
|
||||||
) {
|
|
||||||
this.code = code;
|
this.code = code;
|
||||||
this.msg = msg;
|
this.msg = msg;
|
||||||
this.config = {};
|
this.config = {};
|
||||||
|
|
|
||||||
|
|
@ -82,7 +82,10 @@ const updateDTS = ({
|
||||||
*/
|
*/
|
||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
/* prettier-ignore */
|
/* 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,
|
overwrite: true,
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,15 @@ declare const AWEME_PLATFORM_ID: number;
|
||||||
declare const BOT_BRAND_NAME: string;
|
declare const BOT_BRAND_NAME: string;
|
||||||
declare const BUILD_BRANCH: string;
|
declare const BUILD_BRANCH: string;
|
||||||
declare const BUILD_TYPE: 'local' | 'online' | 'offline' | 'test';
|
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 CARD_BUILDER_ENV_STR: string;
|
||||||
declare const CDN: string | undefined;
|
declare const CDN: string | undefined;
|
||||||
declare const CDN_PATH_PREFIX: string;
|
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 VOLCANO_PLATFORM_ID: number | null;
|
||||||
declare const VOLC_PRIVATE_POLICY: string;
|
declare const VOLC_PRIVATE_POLICY: string;
|
||||||
declare const VOLC_TERMS_OF_SERVICE: string;
|
declare const VOLC_TERMS_OF_SERVICE: string;
|
||||||
|
|
||||||
|
|
@ -431,7 +431,9 @@ export const SCENE_RESPONSE_MAP = {
|
||||||
botID: params.botID,
|
botID: params.botID,
|
||||||
}),
|
}),
|
||||||
[SceneType.KNOWLEDGE__BACK__BOT]: params => ({
|
[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 => ({
|
[SceneType.KNOWLEDGE__ADD_TO__BOT]: params => ({
|
||||||
url: `/space/${params.spaceID}/bot/${params.botID}`,
|
url: `/space/${params.spaceID}/bot/${params.botID}`,
|
||||||
|
|
|
||||||
|
|
@ -14,4 +14,5 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export const dynamicImportMdBoxStyle = () => import('@bytedance/calypso/styles.css');
|
export const dynamicImportMdBoxStyle = () =>
|
||||||
|
import('@bytedance/calypso/styles.css');
|
||||||
|
|
|
||||||
|
|
@ -13,8 +13,8 @@
|
||||||
"test:cov": "npm run test -- --coverage"
|
"test:cov": "npm run test -- --coverage"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@coze-arch/bot-error": "workspace:*",
|
|
||||||
"@coze-arch/bot-api": "workspace:*",
|
"@coze-arch/bot-api": "workspace:*",
|
||||||
|
"@coze-arch/bot-error": "workspace:*",
|
||||||
"@coze-arch/bot-flags": "workspace:*",
|
"@coze-arch/bot-flags": "workspace:*",
|
||||||
"@coze-arch/bot-studio-store": "workspace:*",
|
"@coze-arch/bot-studio-store": "workspace:*",
|
||||||
"@coze-arch/report-events": "workspace:*",
|
"@coze-arch/report-events": "workspace:*",
|
||||||
|
|
|
||||||
|
|
@ -13,12 +13,12 @@
|
||||||
"test:cov": "npm run test -- --coverage"
|
"test:cov": "npm run test -- --coverage"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@coze-arch/bot-error": "workspace:*",
|
|
||||||
"@coze-foundation/space-store": "workspace:*",
|
|
||||||
"@coze-arch/bot-api": "workspace:*",
|
"@coze-arch/bot-api": "workspace:*",
|
||||||
|
"@coze-arch/bot-error": "workspace:*",
|
||||||
"@coze-arch/bot-flags": "workspace:*",
|
"@coze-arch/bot-flags": "workspace:*",
|
||||||
"@coze-arch/logger": "workspace:*",
|
"@coze-arch/logger": "workspace:*",
|
||||||
"@coze-arch/report-events": "workspace:*",
|
"@coze-arch/report-events": "workspace:*",
|
||||||
|
"@coze-foundation/space-store": "workspace:*",
|
||||||
"immer": "^10.0.3",
|
"immer": "^10.0.3",
|
||||||
"localforage": "^1.9.0",
|
"localforage": "^1.9.0",
|
||||||
"lodash-es": "^4.17.21",
|
"lodash-es": "^4.17.21",
|
||||||
|
|
|
||||||
|
|
@ -38,3 +38,4 @@
|
||||||
"vitest": "~3.0.5"
|
"vitest": "~3.0.5"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -90,4 +90,3 @@ export const sendTeaEvent = <TEventName extends EVENT_NAMES>(
|
||||||
});
|
});
|
||||||
TeaNew.sendEvent(event, params);
|
TeaNew.sendEvent(event, params);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -37,10 +37,8 @@
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@coze-agent-ide/tool-config": "workspace:*",
|
"@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-api": "workspace:*",
|
||||||
|
"@coze-arch/bot-error": "workspace:*",
|
||||||
"@coze-arch/bot-flags": "workspace:*",
|
"@coze-arch/bot-flags": "workspace:*",
|
||||||
"@coze-arch/bot-studio-store": "workspace:*",
|
"@coze-arch/bot-studio-store": "workspace:*",
|
||||||
"@coze-arch/i18n": "workspace:*",
|
"@coze-arch/i18n": "workspace:*",
|
||||||
|
|
@ -48,6 +46,8 @@
|
||||||
"@coze-arch/report-events": "workspace:*",
|
"@coze-arch/report-events": "workspace:*",
|
||||||
"@coze-arch/tea": "workspace:*",
|
"@coze-arch/tea": "workspace:*",
|
||||||
"@coze-arch/web-context": "workspace:*",
|
"@coze-arch/web-context": "workspace:*",
|
||||||
|
"@coze-studio/uploader-adapter": "workspace:*",
|
||||||
|
"@coze-studio/user-store": "workspace:*",
|
||||||
"bowser": "2.11.0",
|
"bowser": "2.11.0",
|
||||||
"dayjs": "^1.11.7",
|
"dayjs": "^1.11.7",
|
||||||
"eventemitter3": "^5.0.1",
|
"eventemitter3": "^5.0.1",
|
||||||
|
|
@ -56,11 +56,11 @@
|
||||||
"query-string": "^8.1.0"
|
"query-string": "^8.1.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@coze-common/chat-core": "workspace:*",
|
|
||||||
"@coze-arch/bot-typings": "workspace:*",
|
"@coze-arch/bot-typings": "workspace:*",
|
||||||
"@coze-arch/eslint-config": "workspace:*",
|
"@coze-arch/eslint-config": "workspace:*",
|
||||||
"@coze-arch/ts-config": "workspace:*",
|
"@coze-arch/ts-config": "workspace:*",
|
||||||
"@coze-arch/vitest-config": "workspace:*",
|
"@coze-arch/vitest-config": "workspace:*",
|
||||||
|
"@coze-common/chat-core": "workspace:*",
|
||||||
"@types/lodash-es": "^4.17.10",
|
"@types/lodash-es": "^4.17.10",
|
||||||
"@types/md5": "^2.3.2",
|
"@types/md5": "^2.3.2",
|
||||||
"@types/node": "^18",
|
"@types/node": "^18",
|
||||||
|
|
|
||||||
|
|
@ -19,8 +19,8 @@ import type React from 'react';
|
||||||
import { useState, useCallback, useRef, useLayoutEffect } from 'react';
|
import { useState, useCallback, useRef, useLayoutEffect } from 'react';
|
||||||
|
|
||||||
interface Options {
|
interface Options {
|
||||||
onEnter?: () => void
|
onEnter?: () => void;
|
||||||
onLeave?: () => void
|
onLeave?: () => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
const useHover = <T extends HTMLElement = any>(
|
const useHover = <T extends HTMLElement = any>(
|
||||||
|
|
@ -28,25 +28,31 @@ const useHover = <T extends HTMLElement = any>(
|
||||||
options: Options = {},
|
options: Options = {},
|
||||||
deps: DependencyList = [],
|
deps: DependencyList = [],
|
||||||
): [React.MutableRefObject<T>, boolean] => {
|
): [React.MutableRefObject<T>, boolean] => {
|
||||||
const { onEnter, onLeave } = options
|
const { onEnter, onLeave } = options;
|
||||||
const ref = useRef<T>();
|
const ref = useRef<T>();
|
||||||
const [isHovered, setIsHovered] = useState(false);
|
const [isHovered, setIsHovered] = useState(false);
|
||||||
|
|
||||||
const handleMouseEnter = useCallback(() => {
|
const handleMouseEnter = useCallback(() => {
|
||||||
if (onEnter) {onEnter()}
|
if (onEnter) {
|
||||||
setIsHovered(true)
|
onEnter();
|
||||||
|
}
|
||||||
|
setIsHovered(true);
|
||||||
}, [typeof onEnter === 'function']);
|
}, [typeof onEnter === 'function']);
|
||||||
const handleMouseLeave = useCallback(() => {
|
const handleMouseLeave = useCallback(() => {
|
||||||
if (onLeave) {onLeave()}
|
if (onLeave) {
|
||||||
setIsHovered(false)
|
onLeave();
|
||||||
|
}
|
||||||
|
setIsHovered(false);
|
||||||
}, [typeof onLeave === 'function']);
|
}, [typeof onLeave === 'function']);
|
||||||
|
|
||||||
useLayoutEffect(() => {
|
useLayoutEffect(() => {
|
||||||
let target = ref.current
|
let target = ref.current;
|
||||||
if (el) {
|
if (el) {
|
||||||
target = typeof el === 'function' ? el() : el;
|
target = typeof el === 'function' ? el() : el;
|
||||||
}
|
}
|
||||||
if (!target) {return}
|
if (!target) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
target.addEventListener('mouseenter', handleMouseEnter);
|
target.addEventListener('mouseenter', handleMouseEnter);
|
||||||
target.addEventListener('mouseleave', handleMouseLeave);
|
target.addEventListener('mouseleave', handleMouseLeave);
|
||||||
return () => {
|
return () => {
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,11 @@
|
||||||
* limitations under the License.
|
* 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 { useState } from 'react';
|
||||||
import usePersistCallback from '..';
|
import usePersistCallback from '..';
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,23 +14,42 @@
|
||||||
* limitations under the License.
|
* 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';
|
const isFunction = (val: any): val is Function => typeof val === 'function';
|
||||||
|
|
||||||
// Get a new state value, compatible with passing values and functions
|
// 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)) {
|
if (isFunction(initVal)) {
|
||||||
return initVal(preState);
|
return initVal(preState);
|
||||||
}
|
}
|
||||||
return initVal;
|
return initVal;
|
||||||
}
|
}
|
||||||
|
|
||||||
function useStateRealtime<T>(initialState: T | (() => T)): [T, Dispatch<SetStateAction<T>>, () => T]
|
function useStateRealtime<T>(
|
||||||
function useStateRealtime<T = undefined>(): [T | undefined, Dispatch<SetStateAction<T | undefined>>, () => T | undefined]
|
initialState: T | (() => T),
|
||||||
|
): [T, Dispatch<SetStateAction<T>>, () => T];
|
||||||
|
function useStateRealtime<T = undefined>(): [
|
||||||
|
T | undefined,
|
||||||
|
Dispatch<SetStateAction<T | undefined>>,
|
||||||
|
() => T | undefined,
|
||||||
|
];
|
||||||
function useStateRealtime<T>(
|
function useStateRealtime<T>(
|
||||||
initVal?: T | (() => 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 initState = getStateVal(undefined, initVal);
|
||||||
const [val, setVal] = useState(initState);
|
const [val, setVal] = useState(initState);
|
||||||
const valRef = useRef(initState);
|
const valRef = useRef(initState);
|
||||||
|
|
@ -38,8 +57,8 @@ function useStateRealtime<T>(
|
||||||
const newState = getStateVal(valRef.current, newVal);
|
const newState = getStateVal(valRef.current, newVal);
|
||||||
valRef.current = newState;
|
valRef.current = newState;
|
||||||
setVal(newState);
|
setVal(newState);
|
||||||
}, [])
|
}, []);
|
||||||
const getRealState = useCallback(() => valRef.current, [])
|
const getRealState = useCallback(() => valRef.current, []);
|
||||||
return [val, setState, getRealState];
|
return [val, setState, getRealState];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,49 +14,51 @@
|
||||||
* limitations under the License.
|
* 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> {
|
export interface ReturnValue<T = State> {
|
||||||
state: T;
|
state: T;
|
||||||
toggle: (value?: T) => void;
|
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>(
|
function useToggle<T = State, U = State>(
|
||||||
defaultValue: T,
|
defaultValue: T,
|
||||||
reverseValue: U,
|
reverseValue: U,
|
||||||
): ReturnValue<T | U>
|
): ReturnValue<T | U>;
|
||||||
|
|
||||||
function useToggle<D extends State = State, R extends State = State>(
|
function useToggle<D extends State = State, R extends State = State>(
|
||||||
defaultValue: D = false as D,
|
defaultValue: D = false as D,
|
||||||
reverseValue?: R,
|
reverseValue?: R,
|
||||||
) {
|
) {
|
||||||
const [state, setState] = useState<D | R>(defaultValue)
|
const [state, setState] = useState<D | R>(defaultValue);
|
||||||
|
|
||||||
const actions = useMemo(() => {
|
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) => {
|
const toggle = (value?: D | R) => {
|
||||||
if (value !== undefined) {
|
if (value !== undefined) {
|
||||||
setState(value)
|
setState(value);
|
||||||
return
|
return;
|
||||||
}
|
|
||||||
setState((s) => (s === defaultValue ? reverseValueOrigin : defaultValue))
|
|
||||||
}
|
}
|
||||||
|
setState(s => (s === defaultValue ? reverseValueOrigin : defaultValue));
|
||||||
|
};
|
||||||
return {
|
return {
|
||||||
toggle,
|
toggle,
|
||||||
}
|
};
|
||||||
}, [defaultValue, reverseValue])
|
}, [defaultValue, reverseValue]);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
state,
|
state,
|
||||||
...actions,
|
...actions,
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export default useToggle
|
export default useToggle;
|
||||||
|
|
|
||||||
|
|
@ -46,17 +46,26 @@ export enum IntlModuleType {
|
||||||
languageDetector = 'languageDetector',
|
languageDetector = 'languageDetector',
|
||||||
postProcessor = 'postProcessor',
|
postProcessor = 'postProcessor',
|
||||||
i18nFormat = 'i18nFormat',
|
i18nFormat = 'i18nFormat',
|
||||||
'3rdParty' = '3rdParty'
|
'3rdParty' = '3rdParty',
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IntlModule<T extends keyof typeof IntlModuleType = keyof typeof IntlModuleType> {
|
export interface IntlModule<
|
||||||
type: T
|
T extends keyof typeof IntlModuleType = keyof typeof IntlModuleType,
|
||||||
name?: string
|
> {
|
||||||
init?: (i18n: any) => void | Promise<any>
|
type: T;
|
||||||
|
name?: string;
|
||||||
|
init?: (i18n: any) => void | Promise<any>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type TFunctionKeys = string | TemplateStringsArray;
|
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;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,10 +18,7 @@ import { vi } from 'vitest';
|
||||||
|
|
||||||
// Define a simulated Worker class
|
// Define a simulated Worker class
|
||||||
class MockWorker {
|
class MockWorker {
|
||||||
constructor(
|
constructor(public scriptURL: string, public options: any) {}
|
||||||
public scriptURL: string,
|
|
||||||
public options: any,
|
|
||||||
) {}
|
|
||||||
|
|
||||||
// Methods required to add a Worker interface
|
// Methods required to add a Worker interface
|
||||||
terminate(): void {
|
terminate(): void {
|
||||||
|
|
@ -43,10 +40,7 @@ global.URL = {
|
||||||
} as any;
|
} as any;
|
||||||
|
|
||||||
global.Blob = class MockBlob {
|
global.Blob = class MockBlob {
|
||||||
constructor(
|
constructor(public array: any[], public options: any) {}
|
||||||
public array: any[],
|
|
||||||
public options: any,
|
|
||||||
) {}
|
|
||||||
} as any;
|
} as any;
|
||||||
|
|
||||||
global.location = {
|
global.location = {
|
||||||
|
|
|
||||||
|
|
@ -10,9 +10,9 @@
|
||||||
"test:cov": "npm run test -- --coverage"
|
"test:cov": "npm run test -- --coverage"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@coze-studio/slardar-interface": "workspace:*",
|
|
||||||
"@coze-arch/bot-env": "workspace:*",
|
"@coze-arch/bot-env": "workspace:*",
|
||||||
"@coze-arch/bot-typings": "workspace:*",
|
"@coze-arch/bot-typings": "workspace:*",
|
||||||
|
"@coze-studio/slardar-interface": "workspace:*",
|
||||||
"lodash-es": "^4.17.21",
|
"lodash-es": "^4.17.21",
|
||||||
"react": "~18.2.0",
|
"react": "~18.2.0",
|
||||||
"react-error-boundary": "^4.0.9"
|
"react-error-boundary": "^4.0.9"
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ export const shouldCloseConsole = () => {
|
||||||
isOpenDebug && sessionStorage.setItem(DEBUG_TAG, 'true');
|
isOpenDebug && sessionStorage.setItem(DEBUG_TAG, 'true');
|
||||||
}
|
}
|
||||||
// Except for the official normal environment, the console is allowed to open
|
// 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);
|
console.log('IS_RELEASE_VERSION', IS_RELEASE_VERSION, isProduction);
|
||||||
return !isOpenDebug && isProduction;
|
return !isOpenDebug && isProduction;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -185,5 +185,4 @@ export class Logger extends BaseLogger {
|
||||||
action: [LogAction.CONSOLE, LogAction.PERSIST],
|
action: [LogAction.CONSOLE, LogAction.PERSIST],
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -20,9 +20,14 @@ import localeEn from './locales/en.json';
|
||||||
import localeZhCN from './locales/zh-CN.json';
|
import localeZhCN from './locales/zh-CN.json';
|
||||||
|
|
||||||
const defaultConfig = {
|
const defaultConfig = {
|
||||||
en: { 'i18n': localeEn },
|
en: { i18n: localeEn },
|
||||||
'zh-CN': { 'i18n': localeZhCN },
|
'zh-CN': { i18n: localeZhCN },
|
||||||
} as { en: { 'i18n': typeof localeEn }; 'zh-CN': { 'i18n': typeof localeZhCN }};
|
} as { en: { i18n: typeof localeEn }; 'zh-CN': { i18n: typeof localeZhCN } };
|
||||||
|
|
||||||
export { localeEn, localeZhCN, defaultConfig };
|
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
|
|
@ -186,7 +186,9 @@ describe('useMediaQuery', () => {
|
||||||
);
|
);
|
||||||
|
|
||||||
expect(window.matchMedia).toHaveBeenCalledWith(
|
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]
|
||||||
|
})`,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,4 +13,3 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -50,8 +50,9 @@ export default function Coachmark({
|
||||||
const [stepIndex, setStepIndex] = useState(itemIndex);
|
const [stepIndex, setStepIndex] = useState(itemIndex);
|
||||||
|
|
||||||
const initVisible = async (cid: string) => {
|
const initVisible = async (cid: string) => {
|
||||||
const coachMarkStorage =
|
const coachMarkStorage = await localStorageService.getValueSync(
|
||||||
await localStorageService.getValueSync(COACHMARK_KEY);
|
COACHMARK_KEY,
|
||||||
|
);
|
||||||
// readStep represents the read step index
|
// readStep represents the read step index
|
||||||
const readStep = (
|
const readStep = (
|
||||||
typeSafeJSONParse(coachMarkStorage) as Record<string, number> | undefined
|
typeSafeJSONParse(coachMarkStorage) as Record<string, number> | undefined
|
||||||
|
|
|
||||||
|
|
@ -29,13 +29,7 @@ import {
|
||||||
IconCozCheckMark,
|
IconCozCheckMark,
|
||||||
IconCozCrossCircle,
|
IconCozCrossCircle,
|
||||||
} from '@coze-arch/coze-design/icons';
|
} from '@coze-arch/coze-design/icons';
|
||||||
import {
|
import { Tooltip, Toast, Image, AIButton, Space } from '@coze-arch/coze-design';
|
||||||
Tooltip,
|
|
||||||
Toast,
|
|
||||||
Image,
|
|
||||||
AIButton,
|
|
||||||
Space,
|
|
||||||
} from '@coze-arch/coze-design';
|
|
||||||
import { loadImage } from '@coze-arch/bot-utils';
|
import { loadImage } from '@coze-arch/bot-utils';
|
||||||
import { DeveloperApi } from '@coze-arch/bot-api';
|
import { DeveloperApi } from '@coze-arch/bot-api';
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,4 +13,3 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -32,10 +32,7 @@ export interface LocateUnreadMessageParam {
|
||||||
}
|
}
|
||||||
|
|
||||||
export class OnInitialLoadEffect extends LoadAsyncEffect {
|
export class OnInitialLoadEffect extends LoadAsyncEffect {
|
||||||
constructor(
|
constructor(envTools: LoadCommandEnvTools, private data: MixInitResponse) {
|
||||||
envTools: LoadCommandEnvTools,
|
|
||||||
private data: MixInitResponse,
|
|
||||||
) {
|
|
||||||
super(envTools);
|
super(envTools);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -37,13 +37,13 @@
|
||||||
"test:cov": "npm run test -- --coverage"
|
"test:cov": "npm run test -- --coverage"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@coze-arch/bot-flags": "workspace:*",
|
||||||
|
"@coze-arch/fetch-stream": "workspace:*",
|
||||||
|
"@coze-arch/logger": "workspace:*",
|
||||||
"@coze-common/chat-area-utils": "workspace:*",
|
"@coze-common/chat-area-utils": "workspace:*",
|
||||||
"@coze-studio/file-kit": "workspace:*",
|
"@coze-studio/file-kit": "workspace:*",
|
||||||
"@coze-studio/slardar-adapter": "workspace:*",
|
"@coze-studio/slardar-adapter": "workspace:*",
|
||||||
"@coze-studio/uploader-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",
|
"@mattiasbuelens/web-streams-adapter": "~0.1.0",
|
||||||
"axios": "^1.4.0",
|
"axios": "^1.4.0",
|
||||||
"eventemitter3": "^5.0.1",
|
"eventemitter3": "^5.0.1",
|
||||||
|
|
|
||||||
|
|
@ -13,4 +13,3 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,4 +13,3 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -27,10 +27,7 @@ import {
|
||||||
} from '@coze-common/chat-uikit';
|
} from '@coze-common/chat-uikit';
|
||||||
import { FILE_TYPE_CONFIG, FileTypeEnum } from '@coze-common/chat-core';
|
import { FILE_TYPE_CONFIG, FileTypeEnum } from '@coze-common/chat-core';
|
||||||
import { I18n } from '@coze-arch/i18n';
|
import { I18n } from '@coze-arch/i18n';
|
||||||
import {
|
import { InputType, shortcut_command } from '@coze-arch/bot-api/playground_api';
|
||||||
InputType,
|
|
||||||
shortcut_command,
|
|
||||||
} from '@coze-arch/bot-api/playground_api';
|
|
||||||
|
|
||||||
export type UploadItemType =
|
export type UploadItemType =
|
||||||
| InputType.UploadImage
|
| InputType.UploadImage
|
||||||
|
|
|
||||||
|
|
@ -148,9 +148,9 @@ function useCharacterTriggerContext(disableUpdateTrigger?: boolean) {
|
||||||
{
|
{
|
||||||
from: tr.changes.from,
|
from: tr.changes.from,
|
||||||
to: tr.changes.to,
|
to: tr.changes.to,
|
||||||
insert: `${
|
insert: `${hasExtraLeftBrace ? '' : '{'}${
|
||||||
hasExtraLeftBrace ? '' : '{'
|
tr.changes.insert
|
||||||
}${tr.changes.insert}}}`,
|
}}}`,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
selection: EditorSelection.cursor(
|
selection: EditorSelection.cursor(
|
||||||
|
|
|
||||||
|
|
@ -21,12 +21,7 @@ import { useEditor } from '@coze-editor/editor/react';
|
||||||
import { type EditorAPI } from '@coze-editor/editor/preset-prompt';
|
import { type EditorAPI } from '@coze-editor/editor/preset-prompt';
|
||||||
import { I18n } from '@coze-arch/i18n';
|
import { I18n } from '@coze-arch/i18n';
|
||||||
import { IconCozPlus } from '@coze-arch/coze-design/icons';
|
import { IconCozPlus } from '@coze-arch/coze-design/icons';
|
||||||
import {
|
import { Modal, type ModalProps, Search, Button } from '@coze-arch/coze-design';
|
||||||
Modal,
|
|
||||||
type ModalProps,
|
|
||||||
Search,
|
|
||||||
Button,
|
|
||||||
} from '@coze-arch/coze-design';
|
|
||||||
import { EVENT_NAMES, sendTeaEvent } from '@coze-arch/bot-tea';
|
import { EVENT_NAMES, sendTeaEvent } from '@coze-arch/bot-tea';
|
||||||
import { PlaygroundApi } from '@coze-arch/bot-api';
|
import { PlaygroundApi } from '@coze-arch/bot-api';
|
||||||
import { LibraryBlockWidget } from '@coze-common/editor-plugins/library-insert';
|
import { LibraryBlockWidget } from '@coze-common/editor-plugins/library-insert';
|
||||||
|
|
|
||||||
|
|
@ -13,4 +13,3 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,9 @@ export const TemplateCard: FC<TemplateCardProps> = props => {
|
||||||
<DuplicateModal
|
<DuplicateModal
|
||||||
productId={props.meta_info.id}
|
productId={props.meta_info.id}
|
||||||
entityType={props.meta_info.entity_type}
|
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)}
|
hide={() => setVisible(false)}
|
||||||
/>
|
/>
|
||||||
) : null}
|
) : null}
|
||||||
|
|
|
||||||
|
|
@ -16,10 +16,7 @@
|
||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
import {
|
import { IconMobileCollect, IconMobileCollectFill } from '@coze-arch/bot-icons';
|
||||||
IconMobileCollect,
|
|
||||||
IconMobileCollectFill,
|
|
||||||
} from '@coze-arch/bot-icons';
|
|
||||||
|
|
||||||
export const FavoriteIconMobile = (props: { isFavorite?: boolean }) => {
|
export const FavoriteIconMobile = (props: { isFavorite?: boolean }) => {
|
||||||
const { isFavorite } = props;
|
const { isFavorite } = props;
|
||||||
|
|
|
||||||
|
|
@ -160,7 +160,7 @@ function useScroll<T>(props: ScrollProps<T>) {
|
||||||
|
|
||||||
const reloadData = useMemoizedFn(() => {
|
const reloadData = useMemoizedFn(() => {
|
||||||
mutate({
|
mutate({
|
||||||
list: resetDataIfReload ? [] : (dataInfo?.list ?? []),
|
list: resetDataIfReload ? [] : dataInfo?.list ?? [],
|
||||||
hasMore: undefined,
|
hasMore: undefined,
|
||||||
nextPage: 1,
|
nextPage: 1,
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -284,10 +284,10 @@
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@coze-arch/bot-icons": "workspace:*",
|
"@coze-arch/bot-icons": "workspace:*",
|
||||||
|
"@coze-arch/i18n": "workspace:*",
|
||||||
"@douyinfe/semi-icons": "^2.36.0",
|
"@douyinfe/semi-icons": "^2.36.0",
|
||||||
"@douyinfe/semi-illustrations": "^2.36.0",
|
"@douyinfe/semi-illustrations": "^2.36.0",
|
||||||
"@douyinfe/semi-ui": "~2.72.3",
|
"@douyinfe/semi-ui": "~2.72.3",
|
||||||
"@coze-arch/i18n": "workspace:*",
|
|
||||||
"ahooks": "^3.7.8",
|
"ahooks": "^3.7.8",
|
||||||
"classnames": "^2.3.2",
|
"classnames": "^2.3.2",
|
||||||
"lodash-es": "^4.17.21",
|
"lodash-es": "^4.17.21",
|
||||||
|
|
|
||||||
|
|
@ -92,9 +92,9 @@ export const LineSVG = (props: {
|
||||||
/>
|
/>
|
||||||
<polygon
|
<polygon
|
||||||
className={LINE_CLASS_NAME}
|
className={LINE_CLASS_NAME}
|
||||||
points={`${toPos.x},${toPos.y} ${toPos.x - 4.5},${toPos.y - ARROW_HEIGHT} ${
|
points={`${toPos.x},${toPos.y} ${toPos.x - 4.5},${
|
||||||
toPos.x + 4.5
|
toPos.y - ARROW_HEIGHT
|
||||||
},${toPos.y - ARROW_HEIGHT}`}
|
} ${toPos.x + 4.5},${toPos.y - ARROW_HEIGHT}`}
|
||||||
fill={activated || hovered ? activateColor : defaultColor}
|
fill={activated || hovered ? activateColor : defaultColor}
|
||||||
/>
|
/>
|
||||||
</>
|
</>
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ export const FixedLayoutEditorProvider = forwardRef<
|
||||||
get document(): FlowDocument {
|
get document(): FlowDocument {
|
||||||
return container.get<FlowDocument>(FlowDocument);
|
return container.get<FlowDocument>(FlowDocument);
|
||||||
},
|
},
|
||||||
}) as FixedLayoutPluginContext,
|
} as FixedLayoutPluginContext),
|
||||||
[],
|
[],
|
||||||
);
|
);
|
||||||
return (
|
return (
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,11 @@ export interface FeatureTypeInternalThisType<Type> {
|
||||||
|
|
||||||
export type Disposer = () => void;
|
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>>;
|
featureMap: Map<string, FeatureConfig<Type, Module>>;
|
||||||
}> {
|
}> {
|
||||||
protected name: string;
|
protected name: string;
|
||||||
|
|
|
||||||
|
|
@ -14,11 +14,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import {
|
import { reporter, type CustomEvent, type ErrorEvent } from '@coze-arch/logger';
|
||||||
reporter,
|
|
||||||
type CustomEvent,
|
|
||||||
type ErrorEvent,
|
|
||||||
} from '@coze-arch/logger';
|
|
||||||
|
|
||||||
import { type DataNamespace } from '../constants';
|
import { type DataNamespace } from '../constants';
|
||||||
export const reporterFun = <EventEnum extends string>(
|
export const reporterFun = <EventEnum extends string>(
|
||||||
|
|
|
||||||
|
|
@ -17,10 +17,7 @@
|
||||||
import React, { useEffect, useImperativeHandle, useRef, useState } from 'react';
|
import React, { useEffect, useImperativeHandle, useRef, useState } from 'react';
|
||||||
|
|
||||||
import { Tree } from '@coze-arch/coze-design';
|
import { Tree } from '@coze-arch/coze-design';
|
||||||
import type {
|
import type { TreeProps, RenderFullLabelProps } from '@coze-arch/bot-semi/Tree';
|
||||||
TreeProps,
|
|
||||||
RenderFullLabelProps,
|
|
||||||
} from '@coze-arch/bot-semi/Tree';
|
|
||||||
import { CommonE2e } from '@coze-data/e2e';
|
import { CommonE2e } from '@coze-data/e2e';
|
||||||
|
|
||||||
import { distinctFileNodes, levelMapTreeNodesToMap } from '../utils';
|
import { distinctFileNodes, levelMapTreeNodesToMap } from '../utils';
|
||||||
|
|
|
||||||
|
|
@ -14,9 +14,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import {
|
import { ImageLocalModule } from '@coze-data/knowledge-ide-base/features/import-knowledge-sources/menu/image-local';
|
||||||
ImageLocalModule,
|
|
||||||
} from '@coze-data/knowledge-ide-base/features/import-knowledge-sources/menu/image-local';
|
|
||||||
import {
|
import {
|
||||||
createImportKnowledgeMenuSourceFeatureRegistry,
|
createImportKnowledgeMenuSourceFeatureRegistry,
|
||||||
type ImportKnowledgeMenuSourceRegistry,
|
type ImportKnowledgeMenuSourceRegistry,
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,10 @@ import { useNavigate } from 'react-router-dom';
|
||||||
import { useMemo } from 'react';
|
import { useMemo } from 'react';
|
||||||
|
|
||||||
import classNames from 'classnames';
|
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 { UnitType } from '@coze-data/knowledge-resource-processor-core';
|
||||||
import { useEditKnowledgeModal } from '@coze-data/knowledge-modal-adapter';
|
import { useEditKnowledgeModal } from '@coze-data/knowledge-modal-adapter';
|
||||||
import { KnowledgeE2e } from '@coze-data/e2e';
|
import { KnowledgeE2e } from '@coze-data/e2e';
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,10 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { useShallow } from 'zustand/react/shallow';
|
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 { type UnitType } from '@coze-data/knowledge-resource-processor-core';
|
||||||
import { useKnowledgeNavigate } from '@coze-data/knowledge-common-hooks/use-case';
|
import { useKnowledgeNavigate } from '@coze-data/knowledge-common-hooks/use-case';
|
||||||
import { useSpaceStore } from '@coze-arch/bot-studio-store';
|
import { useSpaceStore } from '@coze-arch/bot-studio-store';
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue