Skip to content

Commit f50410a

Browse files
iChengboJackLian
authored andcommitted
fix: some spell error
1 parent e3e5123 commit f50410a

File tree

6 files changed

+28
-28
lines changed

6 files changed

+28
-28
lines changed

packages/designer/src/builtin-simulator/host.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1069,15 +1069,15 @@ export class BuiltinSimulatorHost implements ISimulatorHost<BuiltinSimulatorProp
10691069
return null;
10701070
}
10711071

1072-
const nodeIntance = this.getClosestNodeInstance(target);
1073-
if (!nodeIntance) {
1072+
const nodeInstance = this.getClosestNodeInstance(target);
1073+
if (!nodeInstance) {
10741074
return null;
10751075
}
1076-
const { docId } = nodeIntance;
1076+
const { docId } = nodeInstance;
10771077
const doc = this.project.getDocument(docId)!;
1078-
const node = doc.getNode(nodeIntance.nodeId);
1078+
const node = doc.getNode(nodeInstance.nodeId);
10791079
return {
1080-
...nodeIntance,
1080+
...nodeInstance,
10811081
node,
10821082
};
10831083
}

packages/designer/src/designer/designer.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import {
1818
IPublicEnumTransformStage,
1919
IPublicModelLocateEvent,
2020
} from '@alilc/lowcode-types';
21-
import { megreAssets, IPublicTypeAssetsJson, isNodeSchema, isDragNodeObject, isDragNodeDataObject, isLocationChildrenDetail, Logger } from '@alilc/lowcode-utils';
21+
import { mergeAssets, IPublicTypeAssetsJson, isNodeSchema, isDragNodeObject, isDragNodeDataObject, isLocationChildrenDetail, Logger } from '@alilc/lowcode-utils';
2222
import { IProject, Project } from '../project';
2323
import { Node, DocumentModel, insertChildren, INode } from '../document';
2424
import { ComponentMeta, IComponentMeta } from '../component-meta';
@@ -458,7 +458,7 @@ export class Designer implements IDesigner {
458458
if (components) {
459459
// 合并 assets
460460
let assets = this.editor.get('assets') || {};
461-
let newAssets = megreAssets(assets, incrementalAssets);
461+
let newAssets = mergeAssets(assets, incrementalAssets);
462462
// 对于 assets 存在需要二次网络下载的过程,必须 await 等待结束之后,再进行事件触发
463463
await this.editor.set('assets', newAssets);
464464
}

packages/designer/src/designer/scroller.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ function easing(n: number) {
4646
return Math.sin((n * Math.PI) / 2);
4747
}
4848

49-
const SCROLL_ACCURCY = 30;
49+
const SCROLL_ACCURACY = 30;
5050

5151
export interface IScroller extends IPublicModelScroller {
5252

@@ -142,15 +142,15 @@ export class Scroller implements IScroller {
142142
let sy = scrollTarget.top;
143143
let ax = 0;
144144
let ay = 0;
145-
if (y < bounds.top + SCROLL_ACCURCY) {
146-
ay = -Math.min(Math.max(bounds.top + SCROLL_ACCURCY - y, 10), 50) / scale;
147-
} else if (y > bounds.bottom - SCROLL_ACCURCY) {
148-
ay = Math.min(Math.max(y + SCROLL_ACCURCY - bounds.bottom, 10), 50) / scale;
145+
if (y < bounds.top + SCROLL_ACCURACY) {
146+
ay = -Math.min(Math.max(bounds.top + SCROLL_ACCURACY - y, 10), 50) / scale;
147+
} else if (y > bounds.bottom - SCROLL_ACCURACY) {
148+
ay = Math.min(Math.max(y + SCROLL_ACCURACY - bounds.bottom, 10), 50) / scale;
149149
}
150-
if (x < bounds.left + SCROLL_ACCURCY) {
151-
ax = -Math.min(Math.max(bounds.top + SCROLL_ACCURCY - y, 10), 50) / scale;
152-
} else if (x > bounds.right - SCROLL_ACCURCY) {
153-
ax = Math.min(Math.max(x + SCROLL_ACCURCY - bounds.right, 10), 50) / scale;
150+
if (x < bounds.left + SCROLL_ACCURACY) {
151+
ax = -Math.min(Math.max(bounds.top + SCROLL_ACCURACY - y, 10), 50) / scale;
152+
} else if (x > bounds.right - SCROLL_ACCURACY) {
153+
ax = Math.min(Math.max(x + SCROLL_ACCURACY - bounds.right, 10), 50) / scale;
154154
}
155155

156156
if (!ax && !ay) {

packages/utils/src/app-helper.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,18 @@ export class AppHelper extends EventEmitter {
3434
}
3535
}
3636

37-
batchOn(events: Array<string | symbol>, lisenter: (...args: any[]) => void) {
37+
batchOn(events: Array<string | symbol>, listener: (...args: any[]) => void) {
3838
if (!Array.isArray(events)) return;
39-
events.forEach((event) => this.on(event, lisenter));
39+
events.forEach((event) => this.on(event, listener));
4040
}
4141

42-
batchOnce(events: Array<string | symbol>, lisenter: (...args: any[]) => void) {
42+
batchOnce(events: Array<string | symbol>, listener: (...args: any[]) => void) {
4343
if (!Array.isArray(events)) return;
44-
events.forEach((event) => this.once(event, lisenter));
44+
events.forEach((event) => this.once(event, listener));
4545
}
4646

47-
batchOff(events: Array<string | symbol>, lisenter: (...args: any[]) => void) {
47+
batchOff(events: Array<string | symbol>, listener: (...args: any[]) => void) {
4848
if (!Array.isArray(events)) return;
49-
events.forEach((event) => this.off(event, lisenter));
49+
events.forEach((event) => this.off(event, listener));
5050
}
5151
}

packages/utils/src/asset.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export function assetItem(type: AssetType, content?: string | null, level?: Asse
5050
};
5151
}
5252

53-
export function megreAssets(assets: IPublicTypeAssetsJson, incrementalAssets: IPublicTypeAssetsJson): IPublicTypeAssetsJson {
53+
export function mergeAssets(assets: IPublicTypeAssetsJson, incrementalAssets: IPublicTypeAssetsJson): IPublicTypeAssetsJson {
5454
if (incrementalAssets.packages) {
5555
assets.packages = [...(assets.packages || []), ...incrementalAssets.packages];
5656
}
@@ -59,13 +59,13 @@ export function megreAssets(assets: IPublicTypeAssetsJson, incrementalAssets: IP
5959
assets.components = [...(assets.components || []), ...incrementalAssets.components];
6060
}
6161

62-
megreAssetsComponentList(assets, incrementalAssets, 'componentList');
63-
megreAssetsComponentList(assets, incrementalAssets, 'bizComponentList');
62+
mergeAssetsComponentList(assets, incrementalAssets, 'componentList');
63+
mergeAssetsComponentList(assets, incrementalAssets, 'bizComponentList');
6464

6565
return assets;
6666
}
6767

68-
function megreAssetsComponentList(assets: IPublicTypeAssetsJson, incrementalAssets: IPublicTypeAssetsJson, listName: keyof IPublicTypeAssetsJson): void {
68+
function mergeAssetsComponentList(assets: IPublicTypeAssetsJson, incrementalAssets: IPublicTypeAssetsJson, listName: keyof IPublicTypeAssetsJson): void {
6969
if (incrementalAssets[listName]) {
7070
if (assets[listName]) {
7171
// 根据title进行合并

packages/utils/src/logger.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ const levelMarks: Record<string, string> = {
6565
warn: 'warn',
6666
error: 'error',
6767
};
68-
const outputFuntion: Record<string, any> = {
68+
const outputFunction: Record<string, any> = {
6969
debug: console.log,
7070
log: console.log,
7171
info: console.log,
@@ -88,7 +88,7 @@ const shouldOutput = (
8888

8989
const output = (logLevel: string, bizName: string) => {
9090
return (...args: any[]) => {
91-
return outputFuntion[logLevel].apply(console, getLogArgs(args, bizName, logLevel));
91+
return outputFunction[logLevel].apply(console, getLogArgs(args, bizName, logLevel));
9292
};
9393
};
9494

0 commit comments

Comments
 (0)