chore: format all frontend files (#430)
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import { WorkflowMode } from '@coze-workflow/base/api';
|
||||
|
||||
export const ICON_URIS = {
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
/* eslint-disable @coze-arch/use-error-in-catch */
|
||||
import { get } from 'lodash-es';
|
||||
import { inject, injectable } from 'inversify';
|
||||
|
||||
@@ -13,6 +13,6 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
export * from './types';
|
||||
export * from './encapsulate-api-service';
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import {
|
||||
type ValidateErrorData,
|
||||
type WorkflowMode,
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import {
|
||||
definePluginCreator,
|
||||
type PluginCreator,
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import { inject, injectable } from 'inversify';
|
||||
import { type StandardNodeType } from '@coze-workflow/base/types';
|
||||
import { WorkflowMode } from '@coze-workflow/base/api';
|
||||
|
||||
@@ -13,5 +13,5 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
export const ENCAPSULATE_START_END_PAD = 60;
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import { groupBy, uniq } from 'lodash-es';
|
||||
import { inject, injectable } from 'inversify';
|
||||
import { type WorkflowJSON } from '@coze-workflow/base';
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import { injectable } from 'inversify';
|
||||
import { DisposableCollection } from '@flowgram-adapter/common';
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
/* eslint-disable max-params */
|
||||
/* eslint-disable @typescript-eslint/no-magic-numbers */
|
||||
import { get, set } from 'lodash-es';
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import { injectable, inject } from 'inversify';
|
||||
import { WorkflowMode } from '@coze-workflow/base/api';
|
||||
import {
|
||||
@@ -105,7 +105,9 @@ export class EncapsulateServiceImpl implements EncapsulateService {
|
||||
return this.encapsulateError('encapsulating');
|
||||
}
|
||||
|
||||
const name = `${this.encapsulateContext.flowName || ''}_sub_${randomNameSuffix()}`;
|
||||
const name = `${
|
||||
this.encapsulateContext.flowName || ''
|
||||
}_sub_${randomNameSuffix()}`;
|
||||
const { selectedNodes } = this.workflowSelectService;
|
||||
|
||||
if (selectedNodes.length < 2) {
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
/* eslint-disable max-len */
|
||||
import { get, set, uniq } from 'lodash-es';
|
||||
import { inject, injectable } from 'inversify';
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
export * from './encapsulate-service';
|
||||
export * from './types';
|
||||
export * from './encapsulate-manager';
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import {
|
||||
type WorkflowPortEntity,
|
||||
type WorkflowNodeEntity,
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import { uniqBy } from 'lodash-es';
|
||||
import { injectable, inject } from 'inversify';
|
||||
import { StandardNodeType } from '@coze-workflow/base/types';
|
||||
@@ -207,7 +207,9 @@ export class EncapsulateGenerateServiceImpl
|
||||
}
|
||||
|
||||
private getCompareEdgeId(edge) {
|
||||
return `${edge.sourceNodeID || ''}:${edge.sourcePortID || ''}-${edge.targetNodeID || ''}:${edge.targetPortID || ''}`;
|
||||
return `${edge.sourceNodeID || ''}:${edge.sourcePortID || ''}-${
|
||||
edge.targetNodeID || ''
|
||||
}:${edge.targetPortID || ''}`;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -13,6 +13,6 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
export * from './types';
|
||||
export * from './encapsulate-generate-service';
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import {
|
||||
type WorkflowNodeEntity,
|
||||
type WorkflowJSON,
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
export { createWorkflowEncapsulatePlugin } from './create-workflow-encapsulate-plugin';
|
||||
export { EncapsulateService } from './encapsulate';
|
||||
export { EncapsulatePanel } from './render';
|
||||
|
||||
@@ -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 { type MouseEvent, useRef, type MouseEventHandler } 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 { useEffect, useState, 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 { ContainerModule } from 'inversify';
|
||||
import { bindContributions } from '@flowgram-adapter/free-layout-editor';
|
||||
import { WorkflowShortcutsContribution } from '@coze-workflow/render';
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import { injectable } from 'inversify';
|
||||
import { Emitter } from '@flowgram-adapter/common';
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import { inject, injectable } from 'inversify';
|
||||
import { PlaygroundConfigEntity } from '@flowgram-adapter/free-layout-editor';
|
||||
import {
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import { 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 {
|
||||
useEffect,
|
||||
useState,
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import { useEffect, useState } from 'react';
|
||||
|
||||
import { useService } from '@flowgram-adapter/free-layout-editor';
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import { useEffect, useState } from 'react';
|
||||
|
||||
import { useService } from '@flowgram-adapter/free-layout-editor';
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import { useState, useRef } from 'react';
|
||||
|
||||
import { useDebounceEffect } from 'ahooks';
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import { useEffect, useState } from 'react';
|
||||
|
||||
import { FlowNodeVariableData } from '@coze-workflow/variable';
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
export * from './types';
|
||||
export * from './encapsulate-render-container-module';
|
||||
export { EncapsulatePanel } from './encapsulate-panel';
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Encapsulate/unencapsulate commands
|
||||
*/
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import { type StandardNodeType } from '@coze-workflow/base/types';
|
||||
import { type WorkflowMode } from '@coze-workflow/base/api';
|
||||
import { type PluginContext } from '@flowgram-adapter/free-layout-editor';
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
declare module '*.less' {
|
||||
const resource: { [key: string]: string };
|
||||
export = resource;
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import { getFlags } from '@coze-arch/bot-flags';
|
||||
/**
|
||||
* Verify whether it can be encapsulated
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import { StandardNodeType } from '@coze-workflow/base';
|
||||
import { type WorkflowNodeEntity } from '@flowgram-adapter/free-layout-editor';
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import { PositionData } from '@flowgram-adapter/free-layout-editor';
|
||||
import {
|
||||
type WorkflowNodeJSON,
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import { type FlowNodeEntity } from '@flowgram-adapter/free-layout-editor';
|
||||
|
||||
/**
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import { uniq } from 'lodash-es';
|
||||
import {
|
||||
type WorkflowNodeRegistry,
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import { FlowNodeFormData } from '@flowgram-adapter/free-layout-editor';
|
||||
import { type WorkflowNodeEntity } from '@flowgram-adapter/free-layout-editor';
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import {
|
||||
type WorkflowNodeRegistry,
|
||||
type WorkflowNodeJSON,
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
export * from './check-encapsulate-gray';
|
||||
export * from './get-sub-workflow-info';
|
||||
export * from './get-node-point';
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import { customAlphabet } from 'nanoid';
|
||||
|
||||
const RANDOM_NUM = 6;
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import { type WorkflowNodeJSON } from '@flowgram-adapter/free-layout-editor';
|
||||
import { type IPoint } from '@flowgram-adapter/common';
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import {
|
||||
FlowNodeBaseType,
|
||||
type FlowNodeEntity,
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import { isObject, get, has, isArray } from 'lodash-es';
|
||||
import { type WorkflowVariable } from '@coze-workflow/variable';
|
||||
import { type DTODefine } from '@coze-workflow/base';
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import { injectable, multiInject, optional } from 'inversify';
|
||||
import { type StandardNodeType } from '@coze-workflow/base/types';
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import { injectable } from 'inversify';
|
||||
|
||||
import {
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import { inject, injectable } from 'inversify';
|
||||
import { type StandardNodeType } from '@coze-workflow/base/types';
|
||||
import {
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
export * from './encapsulate-validate-manager';
|
||||
export * from './types';
|
||||
export * from './encapsulate-validate-service';
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import { type StandardNodeType } from '@coze-workflow/base/types';
|
||||
import {
|
||||
type WorkflowJSON,
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import { inject, injectable } from 'inversify';
|
||||
import { WorkflowNode } from '@coze-workflow/base';
|
||||
import {
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import { inject, injectable } from 'inversify';
|
||||
import { ValidationService } from '@coze-workflow/base/services';
|
||||
import { StandardNodeType } from '@coze-workflow/base';
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import { inject, injectable } from 'inversify';
|
||||
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 { inject, injectable } from 'inversify';
|
||||
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 { injectable } from 'inversify';
|
||||
import { StandardNodeType } from '@coze-workflow/base';
|
||||
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 { inject, injectable } from 'inversify';
|
||||
import { type WorkflowJSON } from '@flowgram-adapter/free-layout-editor';
|
||||
|
||||
@@ -35,8 +35,9 @@ export class EncapsulateSchemaValidator
|
||||
private encapsulateApiService: EncapsulateApiService;
|
||||
|
||||
async validate(workflow: WorkflowJSON, result: EncapsulateValidateResult) {
|
||||
const validateResult =
|
||||
await this.encapsulateApiService.validateWorkflow(workflow);
|
||||
const validateResult = await this.encapsulateApiService.validateWorkflow(
|
||||
workflow,
|
||||
);
|
||||
|
||||
if (!validateResult?.length) {
|
||||
return;
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import { ContainerModule } from 'inversify';
|
||||
import { bindContributions } from '@flowgram-adapter/free-layout-editor';
|
||||
|
||||
|
||||
@@ -13,6 +13,6 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
export * from './encapsulate-validators-container-module';
|
||||
export { EncapsulateBaseValidator } from './encapsulate-base-validator';
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import { injectable } from 'inversify';
|
||||
import { StandardNodeType } from '@coze-workflow/base/types';
|
||||
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 { injectable } from 'inversify';
|
||||
import { StandardNodeType } from '@coze-workflow/base/types';
|
||||
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 { injectable } from 'inversify';
|
||||
import { I18n } from '@coze-arch/i18n';
|
||||
import { type WorkflowNodeEntity } from '@flowgram-adapter/free-layout-editor';
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import { ContainerModule } from 'inversify';
|
||||
|
||||
import {
|
||||
|
||||
Reference in New Issue
Block a user