Skip to content

Commit 0e18fee

Browse files
liujupingJackLian
authored andcommitted
feat: added export of propSymbol and prop classes
1 parent a42f538 commit 0e18fee

File tree

4 files changed

+16
-6
lines changed

4 files changed

+16
-6
lines changed

packages/engine/src/modules/classes.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
SettingPropEntry,
99
SettingTopEntry,
1010
Selection,
11+
Prop,
1112
} from '@alilc/lowcode-shell';
1213
import { Node as InnerNode } from '@alilc/lowcode-designer';
1314

@@ -22,4 +23,5 @@ export default {
2223
SettingTopEntry,
2324
InnerNode,
2425
Selection,
26+
Prop,
2527
};

packages/engine/src/modules/symbols.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {
99
settingPropEntrySymbol,
1010
settingTopEntrySymbol,
1111
designerCabinSymbol,
12+
propSymbol,
1213
} from '@alilc/lowcode-shell';
1314

1415
export default {
@@ -22,4 +23,5 @@ export default {
2223
settingPropEntrySymbol,
2324
settingTopEntrySymbol,
2425
designerCabinSymbol,
26+
propSymbol,
2527
};

packages/shell/src/api/material.ts

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -170,10 +170,16 @@ export class Material implements IPublicApiMaterial {
170170
* 监听 assets 变化的事件
171171
* @param fn
172172
*/
173-
onChangeAssets(fn: () => void) {
174-
// 设置 assets,经过 setAssets 赋值
175-
this[editorSymbol].onGot('assets', fn);
176-
// 增量设置 assets,经过 loadIncrementalAssets 赋值
177-
this[editorSymbol].eventBus.on('designer.incrementalAssetsReady', fn);
173+
onChangeAssets(fn: () => void): Function {
174+
const dispose = [
175+
// 设置 assets,经过 setAssets 赋值
176+
this[editorSymbol].onGot('assets', fn),
177+
// 增量设置 assets,经过 loadIncrementalAssets 赋值
178+
this[editorSymbol].eventBus.on('designer.incrementalAssetsReady', fn),
179+
];
180+
181+
return () => {
182+
dispose.forEach(d => d && d());
183+
};
178184
}
179185
}

packages/types/src/shell/api/material.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,5 +104,5 @@ export interface IPublicApiMaterial {
104104
* add callback for assets changed event
105105
* @param fn
106106
*/
107-
onChangeAssets(fn: () => void): void;
107+
onChangeAssets(fn: () => void): Function;
108108
}

0 commit comments

Comments
 (0)