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