mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2025-12-11 02:12:56 +00:00
fix: some spell error
This commit is contained in:
parent
e3e5123b31
commit
f50410ae7a
@ -1069,15 +1069,15 @@ export class BuiltinSimulatorHost implements ISimulatorHost<BuiltinSimulatorProp
|
||||
return null;
|
||||
}
|
||||
|
||||
const nodeIntance = this.getClosestNodeInstance(target);
|
||||
if (!nodeIntance) {
|
||||
const nodeInstance = this.getClosestNodeInstance(target);
|
||||
if (!nodeInstance) {
|
||||
return null;
|
||||
}
|
||||
const { docId } = nodeIntance;
|
||||
const { docId } = nodeInstance;
|
||||
const doc = this.project.getDocument(docId)!;
|
||||
const node = doc.getNode(nodeIntance.nodeId);
|
||||
const node = doc.getNode(nodeInstance.nodeId);
|
||||
return {
|
||||
...nodeIntance,
|
||||
...nodeInstance,
|
||||
node,
|
||||
};
|
||||
}
|
||||
|
||||
@ -18,7 +18,7 @@ import {
|
||||
IPublicEnumTransformStage,
|
||||
IPublicModelLocateEvent,
|
||||
} from '@alilc/lowcode-types';
|
||||
import { megreAssets, IPublicTypeAssetsJson, isNodeSchema, isDragNodeObject, isDragNodeDataObject, isLocationChildrenDetail, Logger } from '@alilc/lowcode-utils';
|
||||
import { mergeAssets, IPublicTypeAssetsJson, isNodeSchema, isDragNodeObject, isDragNodeDataObject, isLocationChildrenDetail, Logger } from '@alilc/lowcode-utils';
|
||||
import { IProject, Project } from '../project';
|
||||
import { Node, DocumentModel, insertChildren, INode } from '../document';
|
||||
import { ComponentMeta, IComponentMeta } from '../component-meta';
|
||||
@ -458,7 +458,7 @@ export class Designer implements IDesigner {
|
||||
if (components) {
|
||||
// 合并 assets
|
||||
let assets = this.editor.get('assets') || {};
|
||||
let newAssets = megreAssets(assets, incrementalAssets);
|
||||
let newAssets = mergeAssets(assets, incrementalAssets);
|
||||
// 对于 assets 存在需要二次网络下载的过程,必须 await 等待结束之后,再进行事件触发
|
||||
await this.editor.set('assets', newAssets);
|
||||
}
|
||||
|
||||
@ -46,7 +46,7 @@ function easing(n: number) {
|
||||
return Math.sin((n * Math.PI) / 2);
|
||||
}
|
||||
|
||||
const SCROLL_ACCURCY = 30;
|
||||
const SCROLL_ACCURACY = 30;
|
||||
|
||||
export interface IScroller extends IPublicModelScroller {
|
||||
|
||||
@ -142,15 +142,15 @@ export class Scroller implements IScroller {
|
||||
let sy = scrollTarget.top;
|
||||
let ax = 0;
|
||||
let ay = 0;
|
||||
if (y < bounds.top + SCROLL_ACCURCY) {
|
||||
ay = -Math.min(Math.max(bounds.top + SCROLL_ACCURCY - y, 10), 50) / scale;
|
||||
} else if (y > bounds.bottom - SCROLL_ACCURCY) {
|
||||
ay = Math.min(Math.max(y + SCROLL_ACCURCY - bounds.bottom, 10), 50) / scale;
|
||||
if (y < bounds.top + SCROLL_ACCURACY) {
|
||||
ay = -Math.min(Math.max(bounds.top + SCROLL_ACCURACY - y, 10), 50) / scale;
|
||||
} else if (y > bounds.bottom - SCROLL_ACCURACY) {
|
||||
ay = Math.min(Math.max(y + SCROLL_ACCURACY - bounds.bottom, 10), 50) / scale;
|
||||
}
|
||||
if (x < bounds.left + SCROLL_ACCURCY) {
|
||||
ax = -Math.min(Math.max(bounds.top + SCROLL_ACCURCY - y, 10), 50) / scale;
|
||||
} else if (x > bounds.right - SCROLL_ACCURCY) {
|
||||
ax = Math.min(Math.max(x + SCROLL_ACCURCY - bounds.right, 10), 50) / scale;
|
||||
if (x < bounds.left + SCROLL_ACCURACY) {
|
||||
ax = -Math.min(Math.max(bounds.top + SCROLL_ACCURACY - y, 10), 50) / scale;
|
||||
} else if (x > bounds.right - SCROLL_ACCURACY) {
|
||||
ax = Math.min(Math.max(x + SCROLL_ACCURACY - bounds.right, 10), 50) / scale;
|
||||
}
|
||||
|
||||
if (!ax && !ay) {
|
||||
|
||||
@ -34,18 +34,18 @@ export class AppHelper extends EventEmitter {
|
||||
}
|
||||
}
|
||||
|
||||
batchOn(events: Array<string | symbol>, lisenter: (...args: any[]) => void) {
|
||||
batchOn(events: Array<string | symbol>, listener: (...args: any[]) => void) {
|
||||
if (!Array.isArray(events)) return;
|
||||
events.forEach((event) => this.on(event, lisenter));
|
||||
events.forEach((event) => this.on(event, listener));
|
||||
}
|
||||
|
||||
batchOnce(events: Array<string | symbol>, lisenter: (...args: any[]) => void) {
|
||||
batchOnce(events: Array<string | symbol>, listener: (...args: any[]) => void) {
|
||||
if (!Array.isArray(events)) return;
|
||||
events.forEach((event) => this.once(event, lisenter));
|
||||
events.forEach((event) => this.once(event, listener));
|
||||
}
|
||||
|
||||
batchOff(events: Array<string | symbol>, lisenter: (...args: any[]) => void) {
|
||||
batchOff(events: Array<string | symbol>, listener: (...args: any[]) => void) {
|
||||
if (!Array.isArray(events)) return;
|
||||
events.forEach((event) => this.off(event, lisenter));
|
||||
events.forEach((event) => this.off(event, listener));
|
||||
}
|
||||
}
|
||||
|
||||
@ -50,7 +50,7 @@ export function assetItem(type: AssetType, content?: string | null, level?: Asse
|
||||
};
|
||||
}
|
||||
|
||||
export function megreAssets(assets: IPublicTypeAssetsJson, incrementalAssets: IPublicTypeAssetsJson): IPublicTypeAssetsJson {
|
||||
export function mergeAssets(assets: IPublicTypeAssetsJson, incrementalAssets: IPublicTypeAssetsJson): IPublicTypeAssetsJson {
|
||||
if (incrementalAssets.packages) {
|
||||
assets.packages = [...(assets.packages || []), ...incrementalAssets.packages];
|
||||
}
|
||||
@ -59,13 +59,13 @@ export function megreAssets(assets: IPublicTypeAssetsJson, incrementalAssets: IP
|
||||
assets.components = [...(assets.components || []), ...incrementalAssets.components];
|
||||
}
|
||||
|
||||
megreAssetsComponentList(assets, incrementalAssets, 'componentList');
|
||||
megreAssetsComponentList(assets, incrementalAssets, 'bizComponentList');
|
||||
mergeAssetsComponentList(assets, incrementalAssets, 'componentList');
|
||||
mergeAssetsComponentList(assets, incrementalAssets, 'bizComponentList');
|
||||
|
||||
return assets;
|
||||
}
|
||||
|
||||
function megreAssetsComponentList(assets: IPublicTypeAssetsJson, incrementalAssets: IPublicTypeAssetsJson, listName: keyof IPublicTypeAssetsJson): void {
|
||||
function mergeAssetsComponentList(assets: IPublicTypeAssetsJson, incrementalAssets: IPublicTypeAssetsJson, listName: keyof IPublicTypeAssetsJson): void {
|
||||
if (incrementalAssets[listName]) {
|
||||
if (assets[listName]) {
|
||||
// 根据title进行合并
|
||||
|
||||
@ -65,7 +65,7 @@ const levelMarks: Record<string, string> = {
|
||||
warn: 'warn',
|
||||
error: 'error',
|
||||
};
|
||||
const outputFuntion: Record<string, any> = {
|
||||
const outputFunction: Record<string, any> = {
|
||||
debug: console.log,
|
||||
log: console.log,
|
||||
info: console.log,
|
||||
@ -88,7 +88,7 @@ const shouldOutput = (
|
||||
|
||||
const output = (logLevel: string, bizName: string) => {
|
||||
return (...args: any[]) => {
|
||||
return outputFuntion[logLevel].apply(console, getLogArgs(args, bizName, logLevel));
|
||||
return outputFunction[logLevel].apply(console, getLogArgs(args, bizName, logLevel));
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user