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 { injectable, inject, named } from 'inversify';
import { ContributionProvider, Emitter } from '@flowgram-adapter/common';

View File

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

View File

@@ -13,6 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export { Application } from './application';
export { IDEContainerModule } from './container-module';

View File

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

View File

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

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { type interfaces } from 'inversify';
export const ContainerFactory = Symbol('ContainerFactory');

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { injectable } from 'inversify';
export enum ContextKey {

View File

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

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* eslint-disable @typescript-eslint/method-signature-style */
import { type MaybePromise } from '@flowgram-adapter/common';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { named, injectable, inject } from 'inversify';
import {
ContributionProvider,

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* eslint-disable @typescript-eslint/prefer-as-const */
export class Path {
static separator: '/' = '/';

View File

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

View File

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

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { type MaybeArray, type MaybePromise } from '@flowgram-adapter/common';
export interface Priority<T> {

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { injectable, postConstruct } from 'inversify';
export const StorageService = Symbol('StorageService');

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 { URI } from './uri';

View File

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

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { definePluginCreator } from '../common';
import { EventContainerModule } from './event-container-module';

View File

@@ -13,9 +13,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { ContainerModule } from 'inversify';
import { bindContributionProvider, bindContributions } from '@flowgram-adapter/common';
import {
bindContributionProvider,
bindContributions,
} from '@flowgram-adapter/common';
import { LifecycleContribution } from '../common';
import { EventRegistry } from './event-registry';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { type Disposable } from '@flowgram-adapter/common';
export const EventService = Symbol('EventService');

View File

@@ -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 { Disposable, DisposableCollection } from '@flowgram-adapter/common';

View File

@@ -13,6 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export { createEventPlugin } from './create-event-plugin';
export { EventContribution, EventService } from './event-contribution';

View File

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

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {
bindContributionProvider,
bindContributions,

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export { type LabelChangeEvent, LabelHandler } from './label-handler';
export { LabelService } from './label-service';
export {

View File

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

View File

@@ -13,11 +13,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { type ReactNode } from 'react';
import { injectable, inject, named } from 'inversify';
import { Emitter, type Event, ContributionProvider } from '@flowgram-adapter/common';
import {
Emitter,
type Event,
ContributionProvider,
} from '@flowgram-adapter/common';
import {
type URI,

View File

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

View File

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

View File

@@ -13,8 +13,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { Disposable, DisposableCollection, Emitter } from '@flowgram-adapter/common';
import {
Disposable,
DisposableCollection,
Emitter,
} from '@flowgram-adapter/common';
import { type URI } from '../common';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { bindContributions } from '@flowgram-adapter/common';
import { ShortcutsContribution } from '../shortcut/shortcuts-service';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export { NavigationService } from './navigation-service';
export { NavigationHistory } from './navigation-history';
export {

View File

@@ -13,9 +13,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { inject, injectable } from 'inversify';
import { DisposableCollection, addEventListener } from '@flowgram-adapter/common';
import {
DisposableCollection,
addEventListener,
} from '@flowgram-adapter/common';
import {
type ShortcutsContribution,

View File

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

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { inject, injectable } from 'inversify';
import { DisposableCollection } from '@flowgram-adapter/common';

View File

@@ -13,8 +13,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { bindContributions, bindContributionProvider } from '@flowgram-adapter/common';
import {
bindContributions,
bindContributionProvider,
} from '@flowgram-adapter/common';
import { definePluginCreator, LifecycleContribution } from '../common';
import { PreferencesManager } from './preferences-manager';

View File

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

View File

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

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { inject, injectable, named } from 'inversify';
import { ContributionProvider } from '@flowgram-adapter/common';

View File

@@ -13,9 +13,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { injectable } from 'inversify';
import { isObject, type SchemaDecoration, Emitter } from '@flowgram-adapter/common';
import {
isObject,
type SchemaDecoration,
Emitter,
} from '@flowgram-adapter/common';
import { type PreferenceSchema } from './preference-contribution';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import React from 'react';
export const IDEContainerContext = React.createContext<any>({});

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import React, {
useMemo,
useEffect,

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 { useIDEContainer } from './use-ide-container';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export { useIDEService } from './use-ide-service';
export { useRefresh } from './use-refresh';
export { useIDEContainer } from './use-ide-container';

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 interfaces } from 'inversify';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { type interfaces } from 'inversify';
import { useIDEContainer } from './use-ide-container';

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { injectable, inject } from 'inversify';
import {
type CancellationToken,
@@ -38,10 +38,9 @@ export interface AutoSaveResourceOptions {
*/
@injectable()
export abstract class AutoSaveResource<
CHANGE_SET = string,
INFO extends ResourceInfo = ResourceInfo,
>
implements Disposable, Resource<CHANGE_SET, INFO>
CHANGE_SET = string,
INFO extends ResourceInfo = ResourceInfo,
> implements Disposable, Resource<CHANGE_SET, INFO>
{
readonly autoSave: 'on' | 'off' = 'on';

View File

@@ -13,8 +13,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { type AsClass, bindContributionProvider } from '@flowgram-adapter/common';
import {
type AsClass,
bindContributionProvider,
} from '@flowgram-adapter/common';
// import { LabelHandler } from '../label';
import { definePluginCreator } from '../common';

View File

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

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { injectable, inject, named } from 'inversify';
import { ContributionProvider, Emitter } from '@flowgram-adapter/common';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { injectable, inject } from 'inversify';
import { type URI } from '../common';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {
type Disposable,
type MaybePromise,

View File

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

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { definePluginCreator } from '../common';
import { type ShortcutsHandler, ShortcutsService } from './shortcuts-service';
import { ShortcutsContainerModule } from './shortcuts-container-module';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export { ShortcutsContainerModule } from './shortcuts-container-module';
export {
createShortcutsPlugin,

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export { Keybinding } from './keybinding';
export {
KeybindingContribution,

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { inject, injectable } from 'inversify';
import { ContextMatcher, type LifecycleContribution } from '../../common';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { getKeyLabel, isKeyStringMatch } from '../utils';
export interface Keybinding {

View File

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

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 {

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import React from 'react';
const isMacOS = /(Macintosh|MacIntel|MacPPC|Mac68K|iPad)/.test(

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export const isAppleDevice = /(mac|iphone|ipod|ipad)/i.test(
typeof navigator !== 'undefined' ? navigator?.platform : '',
);

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export const domEditable = (dom: HTMLElement) => {
const editableContent = dom.closest('div[contentEditable=true]');
if (editableContent) {

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export { isKeyStringMatch } from './key-match';
export { getKeyLabel } from './key-label';
export { domEditable } from './dom';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { isAppleDevice } from './device';
const BaseKey: Record<string, string> = {

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { isAppleDevice } from './device';
// Keyboard Event keyCode Alias

View File

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

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { inject, injectable, named } from 'inversify';
import {
Disposable,

View File

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

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { viewColors } from './view-colors';
import * as baseColors from './base-colors';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { baseBg0 } from './base-colors';
const viewColors = [

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export { ColorService } from './color-service';
export { ColorContribution } from './color-contribution';
export { colors } from './colors';

View File

@@ -13,8 +13,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { bindContributions, bindContributionProvider } from '@flowgram-adapter/common';
import {
bindContributions,
bindContributionProvider,
} from '@flowgram-adapter/common';
import { definePluginCreator, LifecycleContribution } from '../common';
import { ThemeService } from './theme';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export { createStylesPlugin } from './create-styles-plugin';
export {
StylingContribution,

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { inject, injectable } from 'inversify';
import { Deferred, logger } 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 { StylingService } from './styling-service';
export {
StylingContribution,

View File

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

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { injectable, inject, named } from 'inversify';
import {
ContributionProvider,

View File

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

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { inject, injectable } from 'inversify';
import { Emitter, type Event, Disposable } from '@flowgram-adapter/common';

View File

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

View File

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

View File

@@ -13,5 +13,5 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import 'reflect-metadata';