Browse Source

Format

typed-command-runs
Artur Arseniev 5 months ago
parent
commit
2fa81c2bf7
  1. 16
      packages/core/src/commands/registry.ts
  2. 5
      packages/core/src/commands/registryHelpers.ts
  3. 5
      packages/core/src/commands/view/MoveComponent.ts
  4. 5
      packages/core/src/commands/view/SelectComponent.ts

16
packages/core/src/commands/registry.ts

@ -1,11 +1,7 @@
import type { ObjectAny } from '../common';
import type { CommandPublicOptions } from './registryHelpers';
import type CommandAbstract from './view/CommandAbstract';
import type {
CommandConstructor,
CommandFunction,
CommandObject,
} from './view/CommandAbstract';
import type { CommandConstructor, CommandFunction, CommandObject } from './view/CommandAbstract';
import type { FullscreenCommandRegistryRun, FullscreenCommandRegistryStop } from './view/Fullscreen';
import type { PreviewCommandRegistryRun, PreviewCommandRegistryStop } from './view/Preview';
import type { ResizeCommandRegistryRun, ResizeCommandRegistryStop } from './view/Resize';
@ -28,14 +24,8 @@ import type { MoveComponentCommandRegistryRun, MoveComponentCommandRegistryStop
import type { SelectComponentCommandRegistryRun, SelectComponentCommandRegistryStop } from './view/SelectComponent';
import type { ShowOffsetCommandRegistryRun, ShowOffsetCommandRegistryStop } from './view/ShowOffset';
import type { SwitchVisibilityCommandRegistryRun, SwitchVisibilityCommandRegistryStop } from './view/SwitchVisibility';
import type {
OpenStyleManagerCommandRegistryRun,
OpenStyleManagerCommandRegistryStop,
} from './view/OpenStyleManager';
import type {
OpenTraitManagerCommandRegistryRun,
OpenTraitManagerCommandRegistryStop,
} from './view/OpenTraitManager';
import type { OpenStyleManagerCommandRegistryRun, OpenStyleManagerCommandRegistryStop } from './view/OpenStyleManager';
import type { OpenTraitManagerCommandRegistryRun, OpenTraitManagerCommandRegistryStop } from './view/OpenTraitManager';
type CommandRegistryHandler = (...args: any[]) => any;
type CommandRegistryEntry<TRegistry, TId extends string> = TId extends keyof TRegistry

5
packages/core/src/commands/registryHelpers.ts

@ -4,6 +4,5 @@ export type CommandPublicFnFromHandler<T> = T extends (editor: any, sender: any,
? (...args: P) => R
: never;
export type CommandPublicOptions<T extends CommandPublicHandler> = Parameters<T> extends []
? undefined
: Parameters<T>[0];
export type CommandPublicOptions<T extends CommandPublicHandler> =
Parameters<T> extends [] ? undefined : Parameters<T>[0];

5
packages/core/src/commands/view/MoveComponent.ts

@ -178,10 +178,7 @@ export default class CommandMoveComponent extends CommandAbstract {
}
}
[
SelectPositionProto as Record<string, unknown>,
SelectComponentProto as Record<string, unknown>,
].forEach((source) => {
[SelectPositionProto as Record<string, unknown>, SelectComponentProto as Record<string, unknown>].forEach((source) => {
Object.getOwnPropertyNames(source).forEach((key) => {
if (key === 'constructor') return;
if (!(key in CommandMoveComponent.prototype)) {

5
packages/core/src/commands/view/SelectComponent.ts

@ -303,10 +303,7 @@ export default class CommandSelectComponent extends CommandAbstract {
}
if (cmp) {
if (
em.isEditing() &&
((!cmp.get('textable') && cmp.isChildOf('text')) || em.getEditing() !== cmp)
) {
if (em.isEditing() && ((!cmp.get('textable') && cmp.isChildOf('text')) || em.getEditing() !== cmp)) {
return;
}

Loading…
Cancel
Save