@chamn/render 0.6.0 → 0.8.0

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.
@@ -0,0 +1,102 @@
1
+ export declare const testPageData: {
2
+ version: string;
3
+ name: string;
4
+ componentsMeta: {
5
+ componentName: string;
6
+ name: string;
7
+ package: string;
8
+ version: string;
9
+ }[];
10
+ componentsTree: {
11
+ componentName: string;
12
+ children: ({
13
+ componentName: string;
14
+ id: string;
15
+ children: {
16
+ props: {
17
+ x: number;
18
+ y: number;
19
+ w: number;
20
+ h: number;
21
+ };
22
+ componentName: string;
23
+ id: string;
24
+ configure: {
25
+ propsSetter: {};
26
+ advanceSetter: {};
27
+ };
28
+ }[];
29
+ configure: {
30
+ propsSetter: {};
31
+ advanceSetter: {};
32
+ };
33
+ css?: undefined;
34
+ } | {
35
+ css: {
36
+ value: {
37
+ state: string;
38
+ media: never[];
39
+ text: string;
40
+ }[];
41
+ };
42
+ componentName: string;
43
+ id: string;
44
+ configure: {
45
+ propsSetter: {};
46
+ advanceSetter: {};
47
+ };
48
+ children?: undefined;
49
+ } | {
50
+ css: {
51
+ value: {
52
+ state: string;
53
+ media: never[];
54
+ text: string;
55
+ }[];
56
+ };
57
+ componentName: string;
58
+ id: string;
59
+ children: {
60
+ css: {
61
+ value: {
62
+ state: string;
63
+ media: never[];
64
+ text: string;
65
+ }[];
66
+ };
67
+ componentName: string;
68
+ id: string;
69
+ configure: {
70
+ propsSetter: {};
71
+ advanceSetter: {};
72
+ };
73
+ eventListener: {
74
+ name: string;
75
+ func: {
76
+ type: string;
77
+ handler: {
78
+ id: string;
79
+ type: string;
80
+ name: string;
81
+ value: string;
82
+ __DEV_CONFIG__: {};
83
+ }[];
84
+ params: never[];
85
+ };
86
+ }[];
87
+ }[];
88
+ configure: {
89
+ propsSetter: {};
90
+ advanceSetter: {};
91
+ };
92
+ })[];
93
+ configure: {
94
+ propsSetter: {};
95
+ advanceSetter: {};
96
+ };
97
+ state: {
98
+ a: number;
99
+ };
100
+ };
101
+ assets: never[];
102
+ };
@@ -15,8 +15,9 @@ export declare const convertModelToComponent: (originalComponent: any, nodeModel
15
15
  _NODE_ID: string;
16
16
  UNIQUE_ID: string;
17
17
  targetComponentRef: React.MutableRefObject<any>;
18
- listenerHandle: (() => void)[];
18
+ listenerHandler: (() => void)[];
19
19
  storeState: StoreApi<any>;
20
+ /** 存储清理 store 的监听函数 */
20
21
  storeListenDisposeList: (() => void)[];
21
22
  /** save dom and media css */
22
23
  domHeader: HTMLHeadElement | undefined;
@@ -28,6 +29,8 @@ export declare const convertModelToComponent: (originalComponent: any, nodeModel
28
29
  };
29
30
  nodeName: any;
30
31
  updateState: (newState: any) => void;
32
+ /** 如果值和当前 state 一样了就不触发更新 */
33
+ setStateIfChanged(updater: any): void;
31
34
  connectStore(): void;
32
35
  getStyleDomById: (id: string) => HTMLStyleElement;
33
36
  addMediaCSS: () => void;
@@ -1,4 +1,4 @@
1
- import { TActionLogicItem } from '@chamn/model';
1
+ import { CNode, TActionLogicItem } from '@chamn/model';
2
2
  import { ContextType } from '../../adapter';
3
3
  import { StoreManager } from '../../storeManager';
4
4
  type CommonOption = {
@@ -7,6 +7,7 @@ type CommonOption = {
7
7
  $$response?: any;
8
8
  /** 当前 action 上下文的变量空间 */
9
9
  actionVariableSpace: Record<string, string>;
10
+ nodeModel: CNode;
10
11
  };
11
12
  export declare const transformActionNode: (propVal: TActionLogicItem, options: CommonOption) => (...args: any[]) => Promise<void>;
12
13
  export {};
@@ -1,5 +1,7 @@
1
+ import { CNode } from '@chamn/model';
1
2
  import { ContextType } from '../../adapter';
2
3
  import { TRenderBaseOption } from '../type';
3
4
  export declare const transformProps: (originalProps: Record<string, any> | undefined, option: {
4
5
  $$context: ContextType;
6
+ nodeModel: CNode;
5
7
  } & TRenderBaseOption) => Record<string, any>;
@@ -21,7 +21,7 @@ export interface IDynamicComponent {
21
21
  _NODE_ID: string;
22
22
  UNIQUE_ID: string;
23
23
  targetComponentRef: React.MutableRefObject<any>;
24
- listenerHandle: (() => void)[];
24
+ listenerHandler: (() => void)[];
25
25
  storeState: StoreApi<any>;
26
26
  storeListenDisposeList: (() => void)[];
27
27
  domHeader?: HTMLHeadElement;
@@ -33,12 +33,16 @@ export type ContextType = {
33
33
  state?: Record<any, any>;
34
34
  updateState?: (newState: any) => void;
35
35
  };
36
+ /** 获取当前节点 props 值 */
37
+ getProps: () => void;
36
38
  /** 用于访访问和管理页面被注册为全局的局部 state 快照,在闭包中使用会存在值不是最新的情况 */
37
39
  stateManager?: Record<string, any>;
38
40
  /** 循环数据 */
39
41
  loopData?: Record<any, any>;
40
42
  /** 组件节点的 Ref */
41
43
  nodeRefs?: RefManager;
44
+ /** 模拟调用节点上的事件方法 */
45
+ callEventMethod: (eventName: string, event: any) => void;
42
46
  storeManager?: StoreManager;
43
47
  /** 第三方辅助库 */
44
48
  thirdLibs?: Record<string, any>;