@chamn/engine 0.0.33 → 0.0.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/assetPackagesListManage.d.ts +7 -0
- package/dist/core/pluginManager.d.ts +6 -5
- package/dist/index.d.ts +6 -1
- package/dist/index.js +22 -22
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2482 -2461
- package/dist/index.mjs.map +1 -1
- package/package.json +7 -7
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { Engine } from '../index';
|
|
2
|
-
import {
|
|
2
|
+
import { CPage } from '@chamn/model';
|
|
3
3
|
import { Emitter } from 'mitt';
|
|
4
4
|
import { Workbench } from '../component/Workbench';
|
|
5
5
|
import { CustomI18n } from '../i18n';
|
|
6
|
+
import { AssetsPackageListManager } from './assetPackagesListManage';
|
|
6
7
|
export type PluginObj<C, E = any> = {
|
|
7
8
|
name: string;
|
|
8
9
|
init: (ctx: CPluginCtx<C>) => Promise<void>;
|
|
@@ -23,7 +24,7 @@ type PluginManagerOptions = {
|
|
|
23
24
|
emitter: Emitter<any>;
|
|
24
25
|
pageModel: CPage;
|
|
25
26
|
i18n: CustomI18n;
|
|
26
|
-
|
|
27
|
+
assetsPackageListManager: AssetsPackageListManager;
|
|
27
28
|
engine: Engine;
|
|
28
29
|
};
|
|
29
30
|
export type CPluginCtx<C = any> = {
|
|
@@ -47,16 +48,16 @@ export declare class PluginManager {
|
|
|
47
48
|
getWorkbench: () => Workbench;
|
|
48
49
|
pageModel: CPage;
|
|
49
50
|
i18n: CustomI18n;
|
|
50
|
-
|
|
51
|
+
assetsPackageListManager: AssetsPackageListManager;
|
|
51
52
|
engine: Engine;
|
|
52
53
|
customPluginHooks: Record<string, CustomPluginHook[]>;
|
|
53
|
-
constructor({ getWorkbench, emitter, pageModel, i18n,
|
|
54
|
+
constructor({ getWorkbench, emitter, pageModel, i18n, assetsPackageListManager, engine }: PluginManagerOptions);
|
|
54
55
|
/** 自定义插件, 可以修改插件的配置 */
|
|
55
56
|
customPlugin: <P extends PluginInstance<any, any>>(pluginName: string, customPluginHook: CustomPluginHook<P>) => void;
|
|
56
57
|
createPluginCtx: () => CPluginCtx<any>;
|
|
57
58
|
add(plugin: CPlugin): Promise<void>;
|
|
58
59
|
get<P extends PluginInstance<any, any>>(pluginName: string): Promise<P | undefined>;
|
|
59
60
|
remove(name: string): Promise<void>;
|
|
60
|
-
onPluginReadyOk(pluginName: string, cb?: (pluginHandle: PluginInstance) => void): Promise<PluginInstance<any, any
|
|
61
|
+
onPluginReadyOk(pluginName: string, cb?: (pluginHandle: PluginInstance) => void): Promise<PluginInstance<any, any>>;
|
|
61
62
|
}
|
|
62
63
|
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -3,6 +3,8 @@ import { Workbench } from './component/Workbench';
|
|
|
3
3
|
import { CPlugin, PluginManager } from './core/pluginManager';
|
|
4
4
|
import { Emitter } from 'mitt';
|
|
5
5
|
import { AssetPackage, CMaterialType, CNode, CPage, CPageDataType, CRootNode } from '@chamn/model';
|
|
6
|
+
import { ComponentsType } from '@chamn/render';
|
|
7
|
+
import { AssetsPackageListManager } from './core/assetPackagesListManage';
|
|
6
8
|
export type EnginContext = {
|
|
7
9
|
pluginManager: PluginManager;
|
|
8
10
|
engine: Engine;
|
|
@@ -33,12 +35,15 @@ export declare class Engine extends React.Component<EngineProps> {
|
|
|
33
35
|
pageModel: CPage;
|
|
34
36
|
material: CMaterialType[] | undefined;
|
|
35
37
|
emitter: Emitter<any>;
|
|
38
|
+
assetsPackageListManager: AssetsPackageListManager;
|
|
36
39
|
constructor(props: EngineProps);
|
|
37
40
|
updateCurrentSelectNode(node: CNode | CRootNode | null): void;
|
|
38
41
|
componentDidMount(): Promise<void>;
|
|
39
42
|
getActiveNode(): CNode | CRootNode | null;
|
|
40
43
|
updatePage: (page: CPageDataType) => void;
|
|
41
|
-
updateMaterials: (materials: CMaterialType[], assetPackagesList: AssetPackage[]
|
|
44
|
+
updateMaterials: (materials: CMaterialType[], assetPackagesList: AssetPackage[], options: {
|
|
45
|
+
formatComponents?: ((componentMap: ComponentsType) => ComponentsType) | undefined;
|
|
46
|
+
}) => Promise<void>;
|
|
42
47
|
refresh: () => Promise<void>;
|
|
43
48
|
getWorkbench: () => Workbench | null;
|
|
44
49
|
render(): JSX.Element;
|