mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2025-12-12 03:01:16 +00:00
commit
b8f35c504e
@ -40,7 +40,9 @@ export class LowCodePluginManager implements ILowCodePluginManager {
|
||||
|
||||
isEngineVersionMatched(versionExp: string): boolean {
|
||||
const engineVersion = engineConfig.get('ENGINE_VERSION');
|
||||
return semverSatisfies(engineVersion, versionExp);
|
||||
// ref: https://github.com/npm/node-semver#functions
|
||||
// 1.0.1-beta should match '^1.0.0'
|
||||
return semverSatisfies(engineVersion, versionExp, { includePrerelease: true });
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -17,7 +17,7 @@ function getVersion() {
|
||||
|
||||
const [_, version, beta] = match;
|
||||
|
||||
return beta && beta.endsWith('beta') ? `${version}(beta)` : version;
|
||||
return beta && beta.endsWith('beta') ? `${version}-beta` : version;
|
||||
}
|
||||
|
||||
const releaseVersion = getVersion();
|
||||
|
||||
@ -84,6 +84,10 @@ export default class ComponentMeta {
|
||||
return this[componentMetaSymbol].prototype;
|
||||
}
|
||||
|
||||
get availableActions() {
|
||||
return this[componentMetaSymbol].availableActions;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置 npm 信息
|
||||
* @param npm
|
||||
|
||||
@ -68,6 +68,10 @@ export default class DocumentModel {
|
||||
return this[documentSymbol].id;
|
||||
}
|
||||
|
||||
set id(id) {
|
||||
this[documentSymbol].id = id;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前文档所属的 project
|
||||
* @returns
|
||||
@ -157,8 +161,8 @@ export default class DocumentModel {
|
||||
copy?: boolean | undefined,
|
||||
) {
|
||||
const node = this[documentSymbol].insertNode(
|
||||
parent[nodeSymbol] as any,
|
||||
thing?.[nodeSymbol],
|
||||
parent[nodeSymbol] ? parent[nodeSymbol] : parent,
|
||||
thing?.[nodeSymbol] ? thing[nodeSymbol] : thing,
|
||||
at,
|
||||
copy,
|
||||
);
|
||||
@ -204,7 +208,7 @@ export default class DocumentModel {
|
||||
* 当前 document 的 hover 变更事件
|
||||
*/
|
||||
onChangeDetecting(fn: (node: Node) => void) {
|
||||
this[documentSymbol].designer.detecting.onDetectingChange((node: InnerNode) => {
|
||||
return this[documentSymbol].designer.detecting.onDetectingChange((node: InnerNode) => {
|
||||
fn(Node.create(node)!);
|
||||
});
|
||||
}
|
||||
@ -213,7 +217,7 @@ export default class DocumentModel {
|
||||
* 当前 document 的选中变更事件
|
||||
*/
|
||||
onChangeSelection(fn: (ids: string[]) => void) {
|
||||
this[documentSymbol].selection.onSelectionChange((ids: string[]) => {
|
||||
return this[documentSymbol].selection.onSelectionChange((ids: string[]) => {
|
||||
fn(ids);
|
||||
});
|
||||
}
|
||||
|
||||
@ -43,6 +43,13 @@ export default class Prop {
|
||||
return Node.create(this[propSymbol].getNode());
|
||||
}
|
||||
|
||||
/**
|
||||
* return the slot node (only if the current prop represents a slot)
|
||||
*/
|
||||
get slotNode(): Node | null {
|
||||
return Node.create(this[propSymbol].slotNode);
|
||||
}
|
||||
|
||||
/**
|
||||
* judge if it is a prop or not
|
||||
*/
|
||||
|
||||
@ -3,6 +3,7 @@ import { CompositeValue, FieldConfig } from '@alilc/lowcode-types';
|
||||
import { settingPropEntrySymbol } from './symbols';
|
||||
import Node from './node';
|
||||
import SettingTopEntry from './setting-top-entry';
|
||||
import ComponentMeta from './component-meta';
|
||||
|
||||
export default class SettingPropEntry {
|
||||
private readonly [settingPropEntrySymbol]: SettingField;
|
||||
@ -89,6 +90,13 @@ export default class SettingPropEntry {
|
||||
return this[settingPropEntrySymbol].isSettingField;
|
||||
}
|
||||
|
||||
/**
|
||||
* componentMeta
|
||||
*/
|
||||
get componentMeta(): ComponentMeta | null {
|
||||
return ComponentMeta.create(this[settingPropEntrySymbol].componentMeta);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置 key 值
|
||||
* @param key
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user