render-core 1.4.31 → 1.4.32
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/index.d.ts +62 -29
- package/index.js +50 -44
- package/kernel/delivery/delivery.d.ts +4 -10
- package/kernel/delivery/delivery.js +4 -17
- package/kernel/directive/data/v-el.d.ts +1 -1
- package/kernel/directive/data/v-html.d.ts +1 -1
- package/kernel/directive/data/v-txt.d.ts +1 -1
- package/kernel/directive/justify/v-if.js +2 -2
- package/kernel/directive/slot/v-slot.d.ts +1 -1
- package/kernel/proxyer/getProxy.d.ts +1 -1
- package/kernel/renderer/initRender.d.ts +3 -3
- package/kernel/renderer/initRender.js +6 -5
- package/kernel/renderer/pageRender.d.ts +9 -0
- package/kernel/renderer/pageRender.js +53 -0
- package/kernel/renderer/postRender.d.ts +3 -3
- package/kernel/renderer/postRender.js +4 -3
- package/kernel/renderer/rawRender.d.ts +3 -3
- package/kernel/renderer/rawRender.js +4 -3
- package/kernel/renderer/updateRender.d.ts +1 -1
- package/kernel/router/router.d.ts +3 -9
- package/kernel/router/router.js +10 -30
- package/package.json +1 -1
- package/system/generic/component/ComponentGeneric.d.ts +2 -2
- package/system/generic/component/instance/AbstractComponent.d.ts +41 -0
- package/system/generic/component/instance/AbstractComponent.js +98 -0
- package/system/generic/controller/ControllerGeneric.d.ts +3 -3
- package/system/generic/controller/prototype/ContextController.d.ts +30 -0
- package/system/generic/controller/prototype/ContextController.js +17 -0
- package/system/generic/controller/prototype/HttpAction.d.ts +9 -0
- package/system/generic/controller/prototype/HttpAction.js +37 -0
- package/system/generic/data/ComputedDataGeneric.d.ts +1 -1
- package/system/generic/data/OriginalDataGeneric.d.ts +1 -1
- package/system/generic/data/WatcherDataGeneric.d.ts +1 -1
- package/system/generic/render/RenderGeneric.d.ts +2 -4
- package/system/injection/injection.d.ts +1 -1
- package/system/injection/injector.d.ts +5 -5
- package/system/lifecycle/lifeCycle.d.ts +1 -1
- package/system/lifecycle/mount.d.ts +3 -3
- package/system/lifecycle/mount.js +1 -1
- package/system/recorder/table0/system_func_0.d.ts +5 -5
- package/system/recorder/table0/system_t_0.d.ts +2 -2
- package/system/recorder/table1/system_func_1.d.ts +2 -0
- package/system/recorder/table1/system_func_1.js +6 -0
- package/system/recorder/table3/system_func_3.d.ts +1 -1
- package/system/utility/directive/cmdUtility.d.ts +3 -3
- package/system/utility/initiate/templateUtility.d.ts +2 -2
- package/system/utility/react/inputType.d.ts +1 -1
- package/system/utility/react/sectionUtility.d.ts +1 -1
- package/system/utility/style/styleUtility.d.ts +2 -2
- package/tension/SystemInitPlugin.js +1 -1
- package/tension/generic/plugin/hooks/HooksGeneric.d.ts +0 -2
- package/tension/generic/plugin/preface/PrefaceGeneric.d.ts +3 -3
- package/tension/generic/router/RouterGeneric.d.ts +6 -3
- package/tension/prototype/HooksAction.d.ts +0 -2
- package/tension/prototype/HooksAction.js +0 -4
- package/tension/prototype/PrefaceAction.d.ts +3 -3
- package/verify/directive-linter.d.ts +0 -4
- package/verify/directive-linter.js +152 -123
- package/xboot/entrance.d.ts +1 -13
- package/xboot/entrance.js +3 -49
- package/xboot/renderProcessor.d.ts +1 -1
- package/xboot/tagProcessor.d.ts +2 -2
|
@@ -1,123 +1,152 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
1
|
+
// import {Component} from "../index";
|
|
2
|
+
// import DirectiveLocation from "./generic/location";
|
|
3
|
+
// import LintError from "./generic/lintError";
|
|
4
|
+
//
|
|
5
|
+
// const BOOLEAN_CONDITION_DIRECTIVES = ["@if", "@show"];
|
|
6
|
+
// const ARRAY_ITERATION_DIRECTIVES = ["@for", "@map"];
|
|
7
|
+
// const MODEL_ELEMENT = ["INPUT", "SELECT", "TEXTAREA"];
|
|
8
|
+
//
|
|
9
|
+
// function parseTemplateForDirectives(template: string): DirectiveLocation[] {
|
|
10
|
+
// const directives: DirectiveLocation[] = [];
|
|
11
|
+
// const lines = template.split("\n");
|
|
12
|
+
//
|
|
13
|
+
// for (let lineIndex = 0; lineIndex < lines.length; lineIndex++) {
|
|
14
|
+
// const line = lines[lineIndex];
|
|
15
|
+
//
|
|
16
|
+
// const directiveRegex = /@(\w+)(?:\s*=\s*"([^"]*)"|\s*=\s*'([^']*)')?/g;
|
|
17
|
+
// let match;
|
|
18
|
+
//
|
|
19
|
+
// while ((match = directiveRegex.exec(line)) !== null) {
|
|
20
|
+
// const directiveName = match[1];
|
|
21
|
+
// const expression = match[2] || match[3] || "";
|
|
22
|
+
//
|
|
23
|
+
// const elementMatch = line.match(/<(\w+)/);
|
|
24
|
+
// const element = elementMatch ? elementMatch[1] : "unknown";
|
|
25
|
+
//
|
|
26
|
+
// directives.push({
|
|
27
|
+
// directive: `@${directiveName}`,
|
|
28
|
+
// expression: expression,
|
|
29
|
+
// element: element.toUpperCase(),
|
|
30
|
+
// line: lineIndex + 1,
|
|
31
|
+
// column: match.index + 1
|
|
32
|
+
// });
|
|
33
|
+
// }
|
|
34
|
+
// }
|
|
35
|
+
//
|
|
36
|
+
// return directives;
|
|
37
|
+
// }
|
|
38
|
+
//
|
|
39
|
+
// function inferType(value: any): string {
|
|
40
|
+
// if (value === true || value === false) return "boolean";
|
|
41
|
+
// if (Array.isArray(value)) return "array";
|
|
42
|
+
// if (typeof value === "number") return "number";
|
|
43
|
+
// if (typeof value === "string") return "string";
|
|
44
|
+
// if (typeof value === "object" && value !== null) return "object";
|
|
45
|
+
// if (value === null) return "null";
|
|
46
|
+
// return "unknown";
|
|
47
|
+
// }
|
|
48
|
+
//
|
|
49
|
+
// function getDataTypes(component: Component): Map<string, string> {
|
|
50
|
+
// const types = new Map<string, string>();
|
|
51
|
+
// const data = component.getData();
|
|
52
|
+
//
|
|
53
|
+
// if (data && typeof data === "object") {
|
|
54
|
+
// Object.keys(data).forEach(function(key: string) {
|
|
55
|
+
// types.set(key, inferType((data as any)[key]));
|
|
56
|
+
// });
|
|
57
|
+
// }
|
|
58
|
+
//
|
|
59
|
+
// return types;
|
|
60
|
+
// }
|
|
61
|
+
//
|
|
62
|
+
// function validateBooleanCondition(
|
|
63
|
+
// directive: DirectiveLocation,
|
|
64
|
+
// component: Component
|
|
65
|
+
// ): LintError | null {
|
|
66
|
+
// const dataTypes = getDataTypes(component);
|
|
67
|
+
// const actualType = dataTypes.get(directive.expression);
|
|
68
|
+
//
|
|
69
|
+
// if (actualType && actualType !== "boolean") {
|
|
70
|
+
// return {
|
|
71
|
+
// rule: "boolean-condition",
|
|
72
|
+
// message: `Directive '${directive.directive}' expects boolean but '${directive.expression}' is ${actualType}`,
|
|
73
|
+
// line: directive.line,
|
|
74
|
+
// column: directive.column
|
|
75
|
+
// };
|
|
76
|
+
// }
|
|
77
|
+
//
|
|
78
|
+
// return null;
|
|
79
|
+
// }
|
|
80
|
+
//
|
|
81
|
+
// function validateArrayIteration(
|
|
82
|
+
// directive: DirectiveLocation,
|
|
83
|
+
// component: Component
|
|
84
|
+
// ): LintError | null {
|
|
85
|
+
// const dataTypes = getDataTypes(component);
|
|
86
|
+
// const actualType = dataTypes.get(directive.expression);
|
|
87
|
+
//
|
|
88
|
+
// if (actualType && actualType !== "array") {
|
|
89
|
+
// return {
|
|
90
|
+
// rule: "array-iteration",
|
|
91
|
+
// message: `Directive '${directive.directive}' expects array but '${directive.expression}' is ${actualType}`,
|
|
92
|
+
// line: directive.line,
|
|
93
|
+
// column: directive.column
|
|
94
|
+
// };
|
|
95
|
+
// }
|
|
96
|
+
//
|
|
97
|
+
// return null;
|
|
98
|
+
// }
|
|
99
|
+
//
|
|
100
|
+
// function validateModelElement(
|
|
101
|
+
// directive: DirectiveLocation,
|
|
102
|
+
// component: Component
|
|
103
|
+
// ): LintError | null {
|
|
104
|
+
// if (MODEL_ELEMENT.indexOf(directive.element) === -1) {
|
|
105
|
+
// return {
|
|
106
|
+
// rule: "valid-model-element",
|
|
107
|
+
// message: `Directive '@model' can only be used on INPUT, SELECT, or TEXTAREA, but found '${directive.element}'`,
|
|
108
|
+
// line: directive.line,
|
|
109
|
+
// column: directive.column
|
|
110
|
+
// };
|
|
111
|
+
// }
|
|
112
|
+
//
|
|
113
|
+
// return null;
|
|
114
|
+
// }
|
|
115
|
+
//
|
|
116
|
+
// export function lintComponent(component: Component): LintError[] {
|
|
117
|
+
// const errors: LintError[] = [];
|
|
118
|
+
// const template = component.getTemplate();
|
|
119
|
+
// const directives = parseTemplateForDirectives(template);
|
|
120
|
+
//
|
|
121
|
+
// for (const directive of directives) {
|
|
122
|
+
// if (BOOLEAN_CONDITION_DIRECTIVES.indexOf(directive.directive) !== -1) {
|
|
123
|
+
// const error = validateBooleanCondition(directive, component);
|
|
124
|
+
// if (error) errors.push(error);
|
|
125
|
+
// }
|
|
126
|
+
//
|
|
127
|
+
// if (ARRAY_ITERATION_DIRECTIVES.indexOf(directive.directive) !== -1) {
|
|
128
|
+
// const error = validateArrayIteration(directive, component);
|
|
129
|
+
// if (error) errors.push(error);
|
|
130
|
+
// }
|
|
131
|
+
//
|
|
132
|
+
// if (directive.directive === "@model") {
|
|
133
|
+
// const error = validateModelElement(directive, component);
|
|
134
|
+
// if (error) errors.push(error);
|
|
135
|
+
// }
|
|
136
|
+
// }
|
|
137
|
+
//
|
|
138
|
+
// return errors;
|
|
139
|
+
// }
|
|
140
|
+
//
|
|
141
|
+
// export function lintComponents(components: Component[]): Map<string, LintError[]> {
|
|
142
|
+
// const allErrors = new Map<string, LintError[]>();
|
|
143
|
+
//
|
|
144
|
+
// for (const component of components) {
|
|
145
|
+
// const errors = lintComponent(component);
|
|
146
|
+
// if (errors.length > 0) {
|
|
147
|
+
// allErrors.set(component.getName(), errors);
|
|
148
|
+
// }
|
|
149
|
+
// }
|
|
150
|
+
//
|
|
151
|
+
// return allErrors;
|
|
152
|
+
// }
|
package/xboot/entrance.d.ts
CHANGED
|
@@ -1,16 +1,4 @@
|
|
|
1
|
-
import { Component } from "../index";
|
|
2
|
-
/**
|
|
3
|
-
* The entrance of weave
|
|
4
|
-
* @param root
|
|
5
|
-
*/
|
|
6
|
-
export declare function render_for_weave(root?: string): void;
|
|
7
1
|
/**
|
|
8
2
|
* The entrance of listen
|
|
9
3
|
*/
|
|
10
|
-
export declare function render_for_listen(): void;
|
|
11
|
-
/**
|
|
12
|
-
* The entrance of render
|
|
13
|
-
* @param component
|
|
14
|
-
* @param mounter
|
|
15
|
-
*/
|
|
16
|
-
export declare function render_for_render(component: Component, mounter: string): void;
|
|
4
|
+
export declare function render_for_listen(params: Map<string, any>, pathParams: Map<string, any>): void;
|
package/xboot/entrance.js
CHANGED
|
@@ -1,53 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { renderHtml } from "./renderProcessor";
|
|
3
|
-
import { get_context_controller, get_style_library, get_tag_library } from "../system/recorder/table0/system_func_0";
|
|
4
|
-
import { router_listener_with_router, router_listener_without_router } from "../kernel/router/router";
|
|
5
|
-
/**
|
|
6
|
-
* The entrance of weave
|
|
7
|
-
* @param root
|
|
8
|
-
*/
|
|
9
|
-
export function render_for_weave(root) {
|
|
10
|
-
get_tag_library().forEach(function (component) {
|
|
11
|
-
themeStyle(component, get_style_library());
|
|
12
|
-
});
|
|
13
|
-
if (root == null) {
|
|
14
|
-
//开始渲染
|
|
15
|
-
get_context_controller().componentAttachedRootElement = document.body;
|
|
16
|
-
renderHtml(document.children, get_context_controller());
|
|
17
|
-
}
|
|
18
|
-
else {
|
|
19
|
-
var mountPoint = document.getElementById(root);
|
|
20
|
-
if (mountPoint == null) {
|
|
21
|
-
get_context_controller().componentAttachedRootElement = document.body;
|
|
22
|
-
//开始渲染
|
|
23
|
-
console.warn("Mount point not found");
|
|
24
|
-
console.warn("Mount point was selected to body");
|
|
25
|
-
renderHtml(document.body.children, get_context_controller());
|
|
26
|
-
}
|
|
27
|
-
else {
|
|
28
|
-
//开始渲染
|
|
29
|
-
get_context_controller().componentAttachedRootElement = mountPoint;
|
|
30
|
-
renderHtml(mountPoint.children, get_context_controller());
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|
|
1
|
+
import { router_listener_with_router } from "../kernel/router/router";
|
|
34
2
|
/**
|
|
35
3
|
* The entrance of listen
|
|
36
4
|
*/
|
|
37
|
-
export function render_for_listen() {
|
|
38
|
-
|
|
39
|
-
themeStyle(component, get_style_library());
|
|
40
|
-
});
|
|
41
|
-
router_listener_with_router(document.querySelector("webview"));
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* The entrance of render
|
|
45
|
-
* @param component
|
|
46
|
-
* @param mounter
|
|
47
|
-
*/
|
|
48
|
-
export function render_for_render(component, mounter) {
|
|
49
|
-
get_tag_library().forEach(function (component) {
|
|
50
|
-
themeStyle(component, get_style_library());
|
|
51
|
-
});
|
|
52
|
-
router_listener_without_router(component, document.getElementById(mounter));
|
|
5
|
+
export function render_for_listen(params, pathParams) {
|
|
6
|
+
router_listener_with_router(document.body, params, pathParams);
|
|
53
7
|
}
|
package/xboot/tagProcessor.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AdjustComponent, ControlComponent } from "../index";
|
|
2
2
|
/**
|
|
3
3
|
* This function is used to save the prototype component proto in the window object.
|
|
4
4
|
* So, you can have a tip that we custom a property named 'tagLib' in the window object.
|
|
5
5
|
* @param component
|
|
6
6
|
*/
|
|
7
|
-
export declare function registerTagLib(component:
|
|
7
|
+
export declare function registerTagLib(component: AdjustComponent | AdjustComponent[] | ControlComponent | ControlComponent[]): void;
|