chore: format all frontend files (#430)

This commit is contained in:
tecvan
2025-07-31 23:15:48 +08:00
committed by GitHub
parent 8b078ff013
commit 6995cec404
8787 changed files with 11975 additions and 10924 deletions

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import React from 'react';
import { describe, it, expect } from 'vitest';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import React from 'react';
import { describe, it, expect, vi } from 'vitest';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import '@testing-library/jest-dom/vitest';
vi.mock('@coze-arch/i18n', () => ({
I18n: {

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { describe, it, expect } from 'vitest';
import { isFormSchemaPropertyEmpty } from '../../src/utils/is-property-empty';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { describe, it, expect } from 'vitest';
import { stringifyFormValuesFromBacked } from '../../src/utils/stringify-form-values-from-backed';

View File

@@ -13,5 +13,5 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export { FieldItem, type FieldItemProps } from './item';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import React from 'react';
import { IconCozInfoCircle } from '@coze-arch/coze-design/icons';

View File

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

View File

@@ -13,5 +13,5 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export { GroupCollapse } from './collapse';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* basic form material
*/

View File

@@ -13,5 +13,5 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export { InputJson, type InputJsonProps } from './json';

View File

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

View File

@@ -13,5 +13,5 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export { InputNumber, type InputNumberProps } from './input-number';

View File

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

View File

@@ -13,5 +13,5 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export { InputString, type InputStringProps } from './input';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import clsx from 'clsx';
import { TextArea } from '@coze-arch/coze-design';

View File

@@ -13,5 +13,5 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export { InputTime, type InputTimeProps } from './time';

View File

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

View File

@@ -13,5 +13,5 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export { SelectBoolean } from './select';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import React, { useCallback, useMemo } from 'react';
import { clsx } from 'clsx';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { VoiceSelect } from '@coze-workflow/components';
interface SelectVoiceProps {

View File

@@ -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';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* form material
*/

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { InputNumber as BaseInputNumber } from '../../base-form-materials';
export const InputInteger = props => <BaseInputNumber int {...props} />;

View File

@@ -13,5 +13,5 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export { InputJson } from '../../base-form-materials';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { InputNumber as BaseInputNumber } from '../../base-form-materials';
export const InputNumber = props => <BaseInputNumber {...props} />;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { InputString as BaseInputString } from '../../base-form-materials';
export const InputString = BaseInputString;

View File

@@ -13,5 +13,5 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export { InputTime } from '../../base-form-materials';

View File

@@ -13,5 +13,5 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export { SelectBoolean } from '../../base-form-materials';

View File

@@ -13,5 +13,5 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export { SelectVoice } from '../../base-form-materials';

View File

@@ -13,5 +13,5 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export { TestRunForm } from './test-run-form';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { Form, type FormModel } from '@flowgram-adapter/free-layout-editor';
import {

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* Fixed internal field name
*/

View File

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

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export {
TestRunFormProvider,
useTestRunFormStore,

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import React from 'react';
import { type FormSchemaReactComponents } from '../types';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import React from 'react';
import { Field } from '@flowgram-adapter/free-layout-editor';

View File

@@ -13,5 +13,5 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export { createSchemaField } from './create-schema-field';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import React from 'react';
import { SchemaContext, type FormSchema } from '../shared';

View File

@@ -13,10 +13,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import React from 'react';
import { useCurrentField, useCurrentFieldState } from '@flowgram-adapter/free-layout-editor';
import {
useCurrentField,
useCurrentFieldState,
} from '@flowgram-adapter/free-layout-editor';
import { type FormSchemaUIState } from '../types';
import {

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { FormSchema } from '../shared';
import { ObjectField } from './object-field';
import { GeneralField } from './general-field';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import React from 'react';
import type { FormSchemaReactComponents } from '../types';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export { useCreateForm } from './use-create-form';
export { useFieldSchema } from './use-field-schema';
export { useFieldUIState } from './use-field-ui-state';

View File

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

View File

@@ -13,10 +13,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { useEffect, useMemo } from 'react';
import { createForm, ValidateTrigger } from '@flowgram-adapter/free-layout-editor';
import {
createForm,
ValidateTrigger,
} from '@flowgram-adapter/free-layout-editor';
import type { IFormSchema, IFormSchemaValidate } from '../types';
import { FormSchema } from '../shared';

View File

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

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { useObserve } from '@flowgram-adapter/common';
import { useFieldSchema } from './use-field-schema';

View File

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

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { useObserve } from '@flowgram-adapter/common';
import { useFormSchema } from './use-form-schema';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* form engine
*/

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { createContext } from 'react';
import type { FormSchemaReactComponents } from '../types';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { type ReactNode } from 'react';
import { ReactiveState } from '@flowgram-adapter/common';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export { ComponentsContext } from './components-context';
export { FormSchema } from './form-schema';
export { SchemaContext, FormSchemaContext } from './schema-context';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { createContext } from 'react';
import type { FormSchema } from './form-schema';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
type JSXComponent =
| keyof JSX.IntrinsicElements
| React.JSXElementConstructor<any>;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export type {
IFormSchema,
IFormSchemaValidate,

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import type { Validate } from '@flowgram-adapter/free-layout-editor';
export type FormSchemaTypes =

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/// <reference types='@coze-arch/bot-typings' />
declare module '*.otf' {
const content: string;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* TestRun Form
*/

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { ViewVariableType, getFileAccept } from '@coze-workflow/base';
interface GenerateFieldComponentOptions {

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import Ajv from 'ajv';
import { I18n } from '@coze-arch/i18n';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { ViewVariableType } from '@coze-workflow/base';
import { type IFormSchema } from '../form-engine';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export { generateField } from './generate-field';
export { generateFieldValidator } from './generate-field-validator';
export { isFormSchemaPropertyEmpty } from './is-property-empty';

View File

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

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { isBoolean } from 'lodash-es';
export const stringifyFormValuesFromBacked = (value: object) => {

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { defineConfig } from '@coze-arch/vitest-config';
export default defineConfig(