chore: format all frontend files (#430)
This commit is contained in:
@@ -13,38 +13,38 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { render } from '@testing-library/react'
|
||||
import { Popover } from '../popover'
|
||||
|
||||
import { render } from '@testing-library/react';
|
||||
import { Popover } from '../popover';
|
||||
|
||||
vi.mock('../popover/hooks/use-tree', () => {
|
||||
return {
|
||||
useTreeRefresh() {},
|
||||
useTreeSearch() {},
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
vi.mock('@coze-arch/bot-semi', async () => {
|
||||
const { forwardRef } = await vi.importActual('react') as any;
|
||||
const { forwardRef } = (await vi.importActual('react')) as any;
|
||||
return {
|
||||
Popover({ content }) {
|
||||
return <div>{content}</div>
|
||||
return <div>{content}</div>;
|
||||
},
|
||||
Tree: forwardRef((_, ref) => {
|
||||
return <div ref={ref}></div>
|
||||
})
|
||||
}
|
||||
})
|
||||
return <div ref={ref}></div>;
|
||||
}),
|
||||
};
|
||||
});
|
||||
|
||||
vi.mock('@coze-editor/editor', () => {
|
||||
return {
|
||||
mixLanguages() {},
|
||||
astDecorator: {
|
||||
whole: {
|
||||
of() {}
|
||||
of() {},
|
||||
},
|
||||
fromCursor: {
|
||||
of() {}
|
||||
of() {},
|
||||
},
|
||||
},
|
||||
};
|
||||
@@ -73,11 +73,11 @@ vi.mock('@coze-editor/editor/react', () => {
|
||||
from: 0,
|
||||
to: 0,
|
||||
anchor: 0,
|
||||
head: 0
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
head: 0,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
},
|
||||
};
|
||||
@@ -85,7 +85,7 @@ vi.mock('@coze-editor/editor/react', () => {
|
||||
|
||||
vi.mock('@coze-editor/editor/preset-expression', () => {
|
||||
return {
|
||||
default: []
|
||||
default: [],
|
||||
};
|
||||
});
|
||||
|
||||
@@ -97,9 +97,9 @@ describe('popover', () => {
|
||||
});
|
||||
|
||||
it('Should render props.className correctly', () => {
|
||||
const { container } = render(<Popover variableTree={[]} className='foo' />)
|
||||
const { container } = render(<Popover variableTree={[]} className="foo" />);
|
||||
|
||||
const elements = container.querySelectorAll('.foo')
|
||||
expect(elements.length).toBe(1)
|
||||
})
|
||||
})
|
||||
const elements = container.querySelectorAll('.foo');
|
||||
expect(elements.length).toBe(1);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import { useEffect } from 'react';
|
||||
import { render } from '@testing-library/react';
|
||||
import { Renderer } from '../renderer';
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import { EditorProvider } from '@coze-editor/editor/react';
|
||||
|
||||
import { Renderer } from './renderer';
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
export { useInterpolationContent } from './use-interpolation-content';
|
||||
export { useEmptyContent } from './use-empty-content';
|
||||
export { usePrunedVariableTree } from './use-pruned-variable-tree';
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
interface InterpolationContent {
|
||||
from: number;
|
||||
to: number;
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import { useMemo } from 'react';
|
||||
|
||||
import { I18n } from '@coze-arch/i18n';
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import { useMemo } from 'react';
|
||||
|
||||
import { type ExpressionEditorTreeNode } from '@/expression-editor';
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import { useState, useEffect } from 'react';
|
||||
|
||||
function useFocused(editor) {
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import { useMemo } from 'react';
|
||||
|
||||
import { type EditorAPI as ExpressionEditorAPI } from '@coze-editor/editor/preset-expression';
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import { useEffect } from 'react';
|
||||
|
||||
import { useLatest } from '../../shared';
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import { useMemo } from 'react';
|
||||
|
||||
import { type EditorAPI as ExpressionEditorAPI } from '@coze-editor/editor/preset-expression';
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import { useMemo } from 'react';
|
||||
|
||||
import { type EditorAPI as ExpressionEditorAPI } from '@coze-editor/editor/preset-expression';
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import { useMemo } from 'react';
|
||||
|
||||
import { ExpressionEditorParserBuiltin } from '@/expression-editor/parser';
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import { useState, useEffect } from 'react';
|
||||
|
||||
import { type EditorAPI as ExpressionEditorAPI } from '@coze-editor/editor/preset-expression';
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import { useState, useEffect, type MutableRefObject } from 'react';
|
||||
|
||||
import { type Tree } from '@coze-arch/bot-semi';
|
||||
|
||||
@@ -13,5 +13,5 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
export { Popover } from './popover';
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import React, {
|
||||
type ReactNode,
|
||||
forwardRef,
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import { type EditorAPI as ExpressionEditorAPI } from '@coze-editor/editor/preset-expression';
|
||||
|
||||
import { ExpressionEditorParserBuiltin } from '@/expression-editor/parser';
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import { type MutableRefObject, useMemo } from 'react';
|
||||
|
||||
import { type EditorAPI } from '@coze-editor/editor/preset-expression';
|
||||
|
||||
@@ -13,5 +13,5 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
export { Renderer } from './renderer';
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import { useCallback, useEffect, useMemo, useRef } from 'react';
|
||||
|
||||
import { Renderer as SDKRenderer } from '@coze-editor/editor/react';
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import { ExpressionEditorParserBuiltin } from '@/expression-editor/parser';
|
||||
import {
|
||||
ExpressionEditorSegmentType,
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import {
|
||||
type MutableRefObject,
|
||||
useRef,
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import { useMemo, type FC } from 'react';
|
||||
|
||||
import classNames from 'classnames';
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
export { ExpressionEditorCounter } from './counter';
|
||||
export { ExpressionEditorLeaf } from './leaf';
|
||||
export { ExpressionEditorRender } from './render';
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import React, { type CSSProperties } from 'react';
|
||||
|
||||
import type { RenderLeafProps } from 'slate-react';
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import React, { type CompositionEventHandler } from 'react';
|
||||
|
||||
import { Slate, Editable } from 'slate-react';
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-namespace */
|
||||
/* eslint-disable @typescript-eslint/no-magic-numbers */
|
||||
/* eslint-disable max-lines */
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import { type FC, useRef, type RefObject } from 'react';
|
||||
|
||||
import classNames from 'classnames';
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
/* eslint-disable complexity */
|
||||
import { useReducer } from 'react';
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import type { Dispatch, RefObject } from 'react';
|
||||
|
||||
import type { Tree } from '@coze-arch/bot-semi';
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
export enum ExpressionEditorEvent {
|
||||
Change = 'change',
|
||||
Select = 'select',
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
export {
|
||||
ExpressionEditorEvent,
|
||||
ExpressionEditorToken,
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import type { CompositionEventHandler, KeyboardEventHandler } from 'react';
|
||||
|
||||
import { type ReactEditor, withReact } from 'slate-react';
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import 'reflect-metadata';
|
||||
import { type ExpressionEditorParseData } from '../type';
|
||||
import { ExpressionEditorSegmentType } from '../constant';
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-namespace */
|
||||
import { Node } from 'slate';
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
/* eslint-disable @typescript-eslint/consistent-type-assertions */
|
||||
|
||||
import 'reflect-metadata';
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-namespace */
|
||||
/* eslint-disable @typescript-eslint/no-magic-numbers */
|
||||
import { ViewVariableType } from '@coze-workflow/base/types';
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import type { CompositionEventHandler } from 'react';
|
||||
|
||||
import type { BaseElement, BaseRange } from 'slate';
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
/* eslint-disable @typescript-eslint/consistent-type-assertions */
|
||||
import 'reflect-metadata';
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-namespace */
|
||||
/* eslint-disable no-cond-assign */
|
||||
import { Node } from 'slate';
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
const isMacOS = /(Macintosh|MacIntel|MacPPC|Mac68K|iPad)/.test(
|
||||
navigator.userAgent,
|
||||
);
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import React, { type ReactNode } from 'react';
|
||||
|
||||
import { I18n } from '@coze-arch/i18n';
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import type { DynamicParams } from '@coze-arch/bot-typings/teamspace';
|
||||
import { useParams } from 'react-router-dom';
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
/* eslint-disable max-lines-per-function */
|
||||
/* eslint-disable @coze-arch/max-line-per-function */
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import { type ReactNode } from 'react';
|
||||
|
||||
import { useBoolean } from 'ahooks';
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import { useWorkflowResourceMenuActions } from './use-workflow-resource-menu-actions';
|
||||
import { useWorkflowResourceClick } from './use-workflow-resource-click';
|
||||
import { useCreateWorkflowModal } from './use-create-workflow-modal';
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import { type ReactNode } from 'react';
|
||||
|
||||
import {
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import { workflowApi } from '@coze-workflow/base';
|
||||
import { I18n } from '@coze-arch/i18n';
|
||||
import { Toast } from '@coze-arch/coze-design';
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import { workflowApi } from '@coze-workflow/base';
|
||||
import { I18n } from '@coze-arch/i18n';
|
||||
import { Toast } from '@coze-arch/coze-design';
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import { useMemo, useState } from 'react';
|
||||
|
||||
import { useBoolean } from 'ahooks';
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import React, { useState } from 'react';
|
||||
|
||||
import { DeleteAction, DeleteType, workflowApi } from '@coze-workflow/base';
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import { useState } from 'react';
|
||||
|
||||
import { WorkflowMode } from '@coze-workflow/base';
|
||||
|
||||
@@ -13,5 +13,5 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
export { useWorkflowPublishEntry } from '@coze-workflow/resources-adapter';
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import type { ResourceInfo } from '@coze-arch/bot-api/plugin_develop';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import {
|
||||
ProductDraftStatus,
|
||||
SchemaType,
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import { workflowApi } from '@coze-workflow/base/api';
|
||||
import { REPORT_EVENTS } from '@coze-arch/report-events';
|
||||
import { I18n } from '@coze-arch/i18n';
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
/* eslint-disable @coze-arch/max-line-per-function */
|
||||
import {
|
||||
type CSSProperties,
|
||||
@@ -34,13 +34,7 @@ import {
|
||||
IconCozImageBroken,
|
||||
} from '@coze-arch/coze-design/icons';
|
||||
import { type SelectProps } from '@coze-arch/bot-semi/Select';
|
||||
import {
|
||||
Image,
|
||||
ImagePreview,
|
||||
Popover,
|
||||
Space,
|
||||
Spin,
|
||||
} from '@coze-arch/bot-semi';
|
||||
import { Image, ImagePreview, Popover, Space, Spin } from '@coze-arch/bot-semi';
|
||||
|
||||
import useImageUploader from './use-image-uploader';
|
||||
import { type ImageRule, ImgUploadErrNo } from './image-uploader';
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
/* eslint-disable @coze-arch/no-batch-import-or-export */
|
||||
export { CreateWorkflowModal } from './workflow-edit';
|
||||
export { FlowShortcutsHelp } from './flow-shortcuts-help';
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import { useEffect, useState, type FC } from 'react';
|
||||
|
||||
import { I18n } from '@coze-arch/i18n';
|
||||
@@ -121,7 +121,9 @@ export const SizeSelect: FC<SizeSelectProps> = props => {
|
||||
onChange(wh);
|
||||
}}
|
||||
disabled={readonly}
|
||||
className={`${selectClassName} ${layoutStyle === 'horizontal' ? '' : 'w-full'}`}
|
||||
className={`${selectClassName} ${
|
||||
layoutStyle === 'horizontal' ? '' : 'w-full'
|
||||
}`}
|
||||
value={sizeValue}
|
||||
optionList={sizeOptionList}
|
||||
size="small"
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
/** Text component, beyond automatic... and show tooltip */
|
||||
import { type FC } from 'react';
|
||||
|
||||
|
||||
@@ -13,6 +13,6 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
// eslint-disable-next-line @coze-arch/no-batch-import-or-export
|
||||
export * from './workflow-list';
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import {
|
||||
type ResourceActionAuth,
|
||||
type Workflow,
|
||||
|
||||
@@ -13,5 +13,5 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
/// <reference types='@coze-arch/bot-typings' />
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import cronstrue from 'cronstrue/i18n';
|
||||
import { I18n } from '@coze-arch/i18n';
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
/* eslint-disable @coze-arch/no-batch-import-or-export */
|
||||
export * from './utils';
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import dayjs from 'dayjs';
|
||||
|
||||
let getIsIPadCache: boolean | undefined;
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import React, { useEffect, useState } from 'react';
|
||||
|
||||
import { useRequest } from 'ahooks';
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
/* eslint-disable @coze-arch/max-line-per-function */
|
||||
import { useMemo, type FC } from 'react';
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
/* eslint-disable @coze-arch/max-line-per-function */
|
||||
|
||||
import { useEffect, type FC, useRef } from 'react';
|
||||
@@ -27,12 +27,7 @@ import {
|
||||
} from '@coze-workflow/base';
|
||||
import { I18n } from '@coze-arch/i18n';
|
||||
import { IconCozFocus } from '@coze-arch/coze-design/icons';
|
||||
import {
|
||||
EmptyState,
|
||||
Spin,
|
||||
Timeline,
|
||||
Typography,
|
||||
} from '@coze-arch/coze-design';
|
||||
import { EmptyState, Spin, Timeline, Typography } from '@coze-arch/coze-design';
|
||||
|
||||
import { useVersionHistory } from './use-version-history';
|
||||
import { type WorkflowCommitListProps } from './type';
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import {
|
||||
type VersionMetaInfo,
|
||||
type OperateType,
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import { useCallback, useMemo, useState } from 'react';
|
||||
|
||||
import {
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
/* eslint-disable @coze-arch/max-line-per-function */
|
||||
/* eslint-disable max-lines-per-function -- refactor later */
|
||||
|
||||
@@ -266,8 +266,8 @@ export function CreateWorkflowModal({
|
||||
flowMode === WorkflowMode.Imageflow
|
||||
? I18n.t('imageflow_create_toast_success')
|
||||
: flowMode === WorkflowMode.ChatFlow
|
||||
? I18n.t('wf_chatflow_95')
|
||||
: I18n.t('workflow_list_create_success');
|
||||
? I18n.t('wf_chatflow_95')
|
||||
: I18n.t('workflow_list_create_success');
|
||||
Toast.success({
|
||||
content,
|
||||
showClose: false,
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import { OrderBy, WorkFlowListStatus } from '@coze-workflow/base/api';
|
||||
import { I18n } from '@coze-arch/i18n';
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import React, { type FC } from 'react';
|
||||
|
||||
import classNames from 'classnames';
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import React, { type FC, useContext, useMemo, useState } from 'react';
|
||||
|
||||
import classNames from 'classnames';
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import { useState, type MouseEvent } from 'react';
|
||||
|
||||
import { logger } from '@coze-arch/logger';
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
/* eslint-disable @coze-arch/max-line-per-function */
|
||||
import React, { type FC, useContext } from 'react';
|
||||
|
||||
@@ -186,12 +186,12 @@ export const WorkflowCard: FC<WorkflowCardProps> = props => {
|
||||
data.create_time,
|
||||
)}`
|
||||
: status === WorkFlowListStatus.HadPublished
|
||||
? `${I18n.t('workflow_add_list_publised')} ${formatTime(
|
||||
data.update_time,
|
||||
)}`
|
||||
: `${I18n.t('workflow_add_list_updated')} ${formatTime(
|
||||
data.update_time,
|
||||
)}`;
|
||||
? `${I18n.t('workflow_add_list_publised')} ${formatTime(
|
||||
data.update_time,
|
||||
)}`
|
||||
: `${I18n.t('workflow_add_list_updated')} ${formatTime(
|
||||
data.update_time,
|
||||
)}`;
|
||||
return (
|
||||
<div className={styles.info}>
|
||||
{showCreator ? (
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import React from 'react';
|
||||
|
||||
import { I18n } from '@coze-arch/i18n';
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import React, { useContext, type FC } from 'react';
|
||||
|
||||
import classNames from 'classnames';
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
/* eslint-disable complexity */
|
||||
/* eslint-disable @coze-arch/max-line-per-function */
|
||||
import { type FC, useContext, useEffect, useMemo, useRef } from 'react';
|
||||
@@ -372,7 +372,7 @@ const WorkflowModalContent: FC<WorkFlowModalModeProps> = props => {
|
||||
}
|
||||
workflowNodes={
|
||||
isTypeWorkflow(item)
|
||||
? (workflowNodesMap[item.workflow_id || ''] ?? [])
|
||||
? workflowNodesMap[item.workflow_id || ''] ?? []
|
||||
: []
|
||||
}
|
||||
handleDeleteWorkflow={handleDelete}
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import { type FC, useContext } from 'react';
|
||||
|
||||
import { I18n, type I18nKeysNoOptionsType } from '@coze-arch/i18n';
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import { type FC, useContext, useMemo } from 'react';
|
||||
|
||||
import { I18n } from '@coze-arch/i18n';
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import { useContext } from 'react';
|
||||
|
||||
import { SortType } from '@coze-arch/idl/product_api';
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import { useContext, type ReactNode } from 'react';
|
||||
|
||||
import { WorkflowMode } from '@coze-workflow/base/api';
|
||||
|
||||
@@ -224,7 +224,7 @@ export function useWorkflowAction({
|
||||
flow_mode:
|
||||
target?.plugin_type === PluginType.IMAGEFLOW
|
||||
? WorkflowMode.Imageflow
|
||||
: (config.flowMode ?? WorkflowMode.Workflow),
|
||||
: config.flowMode ?? WorkflowMode.Workflow,
|
||||
};
|
||||
|
||||
return newWorkflow;
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import { useCallback, useRef, useState } from 'react';
|
||||
|
||||
import { useMount } from 'ahooks';
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import { useMemo, useState } from 'react';
|
||||
|
||||
import {
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import React, { useContext } from 'react';
|
||||
|
||||
import { useDebounceFn } from 'ahooks';
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import React, { type FC } from 'react';
|
||||
|
||||
import classNames from 'classnames';
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import React, { forwardRef, useContext } from 'react';
|
||||
|
||||
import { UICompositionModalSider } from '@coze-arch/bot-semi';
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import {
|
||||
type BindBizType,
|
||||
type WorkFlowListStatus,
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import { type WorkflowModalState, WorkflowCategory } from './type';
|
||||
|
||||
/**
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import React from 'react';
|
||||
|
||||
import {
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import { DemoComponent } from '../src';
|
||||
|
||||
export default {
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import type { Config } from 'tailwindcss';
|
||||
|
||||
export default {
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import { defineConfig } from '@coze-arch/vitest-config';
|
||||
|
||||
export default defineConfig({
|
||||
|
||||
Reference in New Issue
Block a user