@odoo/owl 3.0.0-alpha.26 → 3.0.0-alpha.29
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/README.md +4 -37
- package/dist/owl.cjs.js +6698 -6657
- package/dist/owl.es.js +6664 -6602
- package/dist/owl.iife.js +6874 -6835
- package/dist/owl.iife.min.js +27 -1
- package/dist/types/owl.d.ts +682 -624
- package/package.json +11 -95
- package/dist/compile_templates.mjs +0 -2474
- package/dist/owl-devtools.zip +0 -0
- package/dist/types/common/owl_error.d.ts +0 -3
- package/dist/types/common/utils.d.ts +0 -8
- package/dist/types/compiler/code_generator.d.ts +0 -134
- package/dist/types/compiler/index.d.ts +0 -13
- package/dist/types/compiler/inline_expressions.d.ts +0 -35
- package/dist/types/compiler/parser.d.ts +0 -170
- package/dist/types/compiler/standalone/index.d.ts +0 -2
- package/dist/types/compiler/standalone/setup_jsdom.d.ts +0 -1
- package/dist/types/index.d.ts +0 -1
- package/dist/types/runtime/app.d.ts +0 -53
- package/dist/types/runtime/blockdom/attributes.d.ts +0 -8
- package/dist/types/runtime/blockdom/block_compiler.d.ts +0 -20
- package/dist/types/runtime/blockdom/config.d.ts +0 -8
- package/dist/types/runtime/blockdom/event_catcher.d.ts +0 -7
- package/dist/types/runtime/blockdom/events.d.ts +0 -8
- package/dist/types/runtime/blockdom/html.d.ts +0 -17
- package/dist/types/runtime/blockdom/index.d.ts +0 -26
- package/dist/types/runtime/blockdom/list.d.ts +0 -18
- package/dist/types/runtime/blockdom/multi.d.ts +0 -17
- package/dist/types/runtime/blockdom/text.d.ts +0 -26
- package/dist/types/runtime/blockdom/toggler.d.ts +0 -17
- package/dist/types/runtime/component.d.ts +0 -17
- package/dist/types/runtime/component_node.d.ts +0 -57
- package/dist/types/runtime/context.d.ts +0 -36
- package/dist/types/runtime/event_handling.d.ts +0 -1
- package/dist/types/runtime/hooks.d.ts +0 -32
- package/dist/types/runtime/index.d.ts +0 -46
- package/dist/types/runtime/lifecycle_hooks.d.ts +0 -10
- package/dist/types/runtime/plugin_hooks.d.ts +0 -6
- package/dist/types/runtime/plugin_manager.d.ts +0 -36
- package/dist/types/runtime/props.d.ts +0 -21
- package/dist/types/runtime/reactivity/computations.d.ts +0 -34
- package/dist/types/runtime/reactivity/computed.d.ts +0 -6
- package/dist/types/runtime/reactivity/effect.d.ts +0 -1
- package/dist/types/runtime/reactivity/proxy.d.ts +0 -47
- package/dist/types/runtime/reactivity/signal.d.ts +0 -31
- package/dist/types/runtime/registry.d.ts +0 -24
- package/dist/types/runtime/rendering/error_handling.d.ts +0 -13
- package/dist/types/runtime/rendering/fibers.d.ts +0 -36
- package/dist/types/runtime/rendering/scheduler.d.ts +0 -20
- package/dist/types/runtime/rendering/template_helpers.d.ts +0 -51
- package/dist/types/runtime/resource.d.ts +0 -18
- package/dist/types/runtime/status.d.ts +0 -11
- package/dist/types/runtime/template_set.d.ts +0 -36
- package/dist/types/runtime/types.d.ts +0 -77
- package/dist/types/runtime/utils.d.ts +0 -25
- package/dist/types/runtime/validation.d.ts +0 -19
- package/dist/types/version.d.ts +0 -1
- package/tools/compile_owl_templates.mjs +0 -31
package/dist/owl-devtools.zip
DELETED
|
Binary file
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Parses an XML string into an XML document, throwing errors on parser errors
|
|
3
|
-
* instead of returning an XML document containing the parseerror.
|
|
4
|
-
*
|
|
5
|
-
* @param xml the string to parse
|
|
6
|
-
* @returns an XML document corresponding to the content of the string
|
|
7
|
-
*/
|
|
8
|
-
export declare function parseXML(xml: string): XMLDocument;
|
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
import { AST, ASTComment, ASTComponent, ASTDebug, ASTDomNode, ASTLog, ASTMulti, ASTTCall, ASTTCallBlock, ASTTCallSlot, ASTText, ASTTForEach, ASTTif, ASTTKey, ASTTOut, ASTTranslation, ASTTranslationContext, ASTTSet, EventHandlers } from "./parser";
|
|
2
|
-
type BlockType = "block" | "text" | "multi" | "list" | "html" | "comment";
|
|
3
|
-
export interface Config {
|
|
4
|
-
translateFn?: (s: string, translationCtx: string) => string;
|
|
5
|
-
translatableAttributes?: string[];
|
|
6
|
-
dev?: boolean;
|
|
7
|
-
}
|
|
8
|
-
interface CodeGenOptions extends Config {
|
|
9
|
-
name?: string;
|
|
10
|
-
hasGlobalValues: boolean;
|
|
11
|
-
}
|
|
12
|
-
declare class BlockDescription {
|
|
13
|
-
static nextBlockId: number;
|
|
14
|
-
varName: string;
|
|
15
|
-
blockName: string;
|
|
16
|
-
dynamicTagName: string | null;
|
|
17
|
-
isRoot: boolean;
|
|
18
|
-
hasDynamicChildren: boolean;
|
|
19
|
-
children: BlockDescription[];
|
|
20
|
-
data: string[];
|
|
21
|
-
dom?: Node;
|
|
22
|
-
currentDom?: Element;
|
|
23
|
-
childNumber: number;
|
|
24
|
-
target: CodeTarget;
|
|
25
|
-
type: BlockType;
|
|
26
|
-
parentVar: string;
|
|
27
|
-
id: number;
|
|
28
|
-
constructor(target: CodeTarget, type: BlockType);
|
|
29
|
-
insertData(str: string, prefix?: string): number;
|
|
30
|
-
insert(dom: Node): void;
|
|
31
|
-
generateExpr(expr: string): string;
|
|
32
|
-
asXmlString(): string;
|
|
33
|
-
}
|
|
34
|
-
interface Context {
|
|
35
|
-
block: BlockDescription | null;
|
|
36
|
-
index: number | string;
|
|
37
|
-
forceNewBlock: boolean;
|
|
38
|
-
translate: boolean;
|
|
39
|
-
translationCtx: string;
|
|
40
|
-
tKeyExpr: string | null;
|
|
41
|
-
nameSpace?: string;
|
|
42
|
-
tModelSelectedExpr?: string;
|
|
43
|
-
inPreTag?: boolean;
|
|
44
|
-
}
|
|
45
|
-
declare class CodeTarget {
|
|
46
|
-
name: string;
|
|
47
|
-
indentLevel: number;
|
|
48
|
-
loopLevel: number;
|
|
49
|
-
loopCtxVars: string[];
|
|
50
|
-
tSetVars: Map<string, number>;
|
|
51
|
-
code: string[];
|
|
52
|
-
hasRoot: boolean;
|
|
53
|
-
deferReturn: boolean;
|
|
54
|
-
needsScopeProtection: boolean;
|
|
55
|
-
on: EventHandlers | null;
|
|
56
|
-
constructor(name: string, on?: EventHandlers | null);
|
|
57
|
-
addLine(line: string, idx?: number): void;
|
|
58
|
-
generateCode(): string;
|
|
59
|
-
currentKey(ctx: Context): string;
|
|
60
|
-
}
|
|
61
|
-
export declare class CodeGenerator {
|
|
62
|
-
blocks: BlockDescription[];
|
|
63
|
-
nextBlockId: number;
|
|
64
|
-
isDebug: boolean;
|
|
65
|
-
targets: CodeTarget[];
|
|
66
|
-
target: CodeTarget;
|
|
67
|
-
templateName?: string;
|
|
68
|
-
dev: boolean;
|
|
69
|
-
translateFn: (s: string, translationCtx: string) => string;
|
|
70
|
-
translatableAttributes: string[];
|
|
71
|
-
ast: AST;
|
|
72
|
-
staticDefs: {
|
|
73
|
-
id: string;
|
|
74
|
-
expr: string;
|
|
75
|
-
}[];
|
|
76
|
-
slotNames: Set<String | Symbol>;
|
|
77
|
-
helpers: Set<string>;
|
|
78
|
-
constructor(ast: AST, options: CodeGenOptions);
|
|
79
|
-
generateCode(): string;
|
|
80
|
-
compileInNewTarget(prefix: string, ast: AST, ctx: Context, on?: EventHandlers | null): string;
|
|
81
|
-
addLine(line: string, idx?: number): void;
|
|
82
|
-
define(varName: string, expr: string): void;
|
|
83
|
-
insertAnchor(block: BlockDescription, index?: number): void;
|
|
84
|
-
createBlock(parentBlock: BlockDescription | null, type: BlockType, ctx: Context): BlockDescription;
|
|
85
|
-
insertBlock(expression: string, block: BlockDescription, ctx: Context): void;
|
|
86
|
-
translate(str: string, translationCtx: string): string;
|
|
87
|
-
/**
|
|
88
|
-
* @returns the newly created block name, if any
|
|
89
|
-
*/
|
|
90
|
-
compileAST(ast: AST, ctx: Context): string | null;
|
|
91
|
-
compileDebug(ast: ASTDebug, ctx: Context): string | null;
|
|
92
|
-
compileLog(ast: ASTLog, ctx: Context): string | null;
|
|
93
|
-
compileComment(ast: ASTComment, ctx: Context): string;
|
|
94
|
-
compileText(ast: ASTText, ctx: Context): string;
|
|
95
|
-
generateHandlerCode(rawEvent: string, handler: string): string;
|
|
96
|
-
compileTDomNode(ast: ASTDomNode, ctx: Context): string;
|
|
97
|
-
compileZero(): string;
|
|
98
|
-
compileTOut(ast: ASTTOut, ctx: Context): string;
|
|
99
|
-
compileTIfBranch(content: AST, block: BlockDescription, ctx: Context): void;
|
|
100
|
-
compileTIf(ast: ASTTif, ctx: Context, nextNode?: ASTDomNode): string;
|
|
101
|
-
compileTForeach(ast: ASTTForEach, ctx: Context): string;
|
|
102
|
-
compileTKey(ast: ASTTKey, ctx: Context): string | null;
|
|
103
|
-
compileMulti(ast: ASTMulti, ctx: Context): string | null;
|
|
104
|
-
compileTCall(ast: ASTTCall, ctx: Context): string;
|
|
105
|
-
compileTCallBlock(ast: ASTTCallBlock, ctx: Context): string;
|
|
106
|
-
compileTSet(ast: ASTTSet, ctx: Context): null;
|
|
107
|
-
generateComponentKey(currentKey?: string): string;
|
|
108
|
-
/**
|
|
109
|
-
* Formats a prop name and value into a string suitable to be inserted in the
|
|
110
|
-
* generated code. For example:
|
|
111
|
-
*
|
|
112
|
-
* Name Value Result
|
|
113
|
-
* ---------------------------------------------------------
|
|
114
|
-
* "number" "state" "number: ctx['state']"
|
|
115
|
-
* "something" "" "something: undefined"
|
|
116
|
-
* "some-prop" "state" "'some-prop': ctx['state']"
|
|
117
|
-
* "onClick.bind" "onClick" "onClick: bind(ctx, ctx['onClick'])"
|
|
118
|
-
*/
|
|
119
|
-
formatProp(name: string, value: string, attrsTranslationCtx: {
|
|
120
|
-
[name: string]: string;
|
|
121
|
-
} | null, translationCtx: string): string;
|
|
122
|
-
formatPropObject(obj: {
|
|
123
|
-
[prop: string]: any;
|
|
124
|
-
}, attrsTranslationCtx: {
|
|
125
|
-
[name: string]: string;
|
|
126
|
-
} | null, translationCtx: string): string[];
|
|
127
|
-
getPropString(props: string[], dynProps: string | null): string;
|
|
128
|
-
compileComponent(ast: ASTComponent, ctx: Context): string;
|
|
129
|
-
wrapWithEventCatcher(expr: string, on: EventHandlers): string;
|
|
130
|
-
compileTCallSlot(ast: ASTTCallSlot, ctx: Context): string;
|
|
131
|
-
compileTTranslation(ast: ASTTranslation, ctx: Context): string | null;
|
|
132
|
-
compileTTranslationContext(ast: ASTTranslationContext, ctx: Context): string | null;
|
|
133
|
-
}
|
|
134
|
-
export {};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { BDom } from "../runtime/blockdom";
|
|
2
|
-
import type { TemplateSet } from "../runtime/template_set";
|
|
3
|
-
import { Config } from "./code_generator";
|
|
4
|
-
export type CustomDirectives = Record<string, (node: Element, value: string, modifier: string[]) => void>;
|
|
5
|
-
export type Template = (context: any, vnode: any, key?: string) => BDom;
|
|
6
|
-
export type TemplateFunction = (app: TemplateSet, bdom: any, helpers: any) => Template;
|
|
7
|
-
interface CompileOptions extends Config {
|
|
8
|
-
name?: string;
|
|
9
|
-
customDirectives?: CustomDirectives;
|
|
10
|
-
hasGlobalValues: boolean;
|
|
11
|
-
}
|
|
12
|
-
export declare function compile(template: string | Element, options?: CompileOptions): TemplateFunction;
|
|
13
|
-
export {};
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
type TKind = "LEFT_BRACE" | "RIGHT_BRACE" | "LEFT_BRACKET" | "RIGHT_BRACKET" | "LEFT_PAREN" | "RIGHT_PAREN" | "COMMA" | "VALUE" | "TEMPLATE_STRING" | "SYMBOL" | "OPERATOR" | "COLON";
|
|
2
|
-
interface Token {
|
|
3
|
-
type: TKind;
|
|
4
|
-
value: string;
|
|
5
|
-
originalValue?: string;
|
|
6
|
-
size?: number;
|
|
7
|
-
varName?: string;
|
|
8
|
-
replace?: Function;
|
|
9
|
-
isLocal?: boolean;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* Convert a javascript expression (as a string) into a list of tokens. For
|
|
13
|
-
* example: `tokenize("1 + b")` will return:
|
|
14
|
-
* ```js
|
|
15
|
-
* [
|
|
16
|
-
* {type: "VALUE", value: "1"},
|
|
17
|
-
* {type: "OPERATOR", value: "+"},
|
|
18
|
-
* {type: "SYMBOL", value: "b"}
|
|
19
|
-
* ]
|
|
20
|
-
* ```
|
|
21
|
-
*/
|
|
22
|
-
export declare function tokenize(expr: string): Token[];
|
|
23
|
-
interface ProcessedExpr {
|
|
24
|
-
expr: string;
|
|
25
|
-
freeVariables: string[] | null;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Processes a javascript expression: compiles variable lookups and detects
|
|
29
|
-
* top-level arrow functions with their free variables, all in a single pass.
|
|
30
|
-
*/
|
|
31
|
-
export declare function processExpr(expr: string): ProcessedExpr;
|
|
32
|
-
export declare function compileExpr(expr: string): string;
|
|
33
|
-
export declare const INTERP_REGEXP: RegExp;
|
|
34
|
-
export declare function interpolate(s: string): string;
|
|
35
|
-
export {};
|
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
import { CustomDirectives } from ".";
|
|
2
|
-
export type EventHandlers = {
|
|
3
|
-
[eventName: string]: string;
|
|
4
|
-
};
|
|
5
|
-
export type Attrs = {
|
|
6
|
-
[attrs: string]: string;
|
|
7
|
-
};
|
|
8
|
-
export declare const enum ASTType {
|
|
9
|
-
Text = 0,
|
|
10
|
-
Comment = 1,
|
|
11
|
-
DomNode = 2,
|
|
12
|
-
Multi = 3,
|
|
13
|
-
TIf = 4,
|
|
14
|
-
TSet = 5,
|
|
15
|
-
TCall = 6,
|
|
16
|
-
TOut = 7,
|
|
17
|
-
TForEach = 8,
|
|
18
|
-
TKey = 9,
|
|
19
|
-
TComponent = 10,
|
|
20
|
-
TDebug = 11,
|
|
21
|
-
TLog = 12,
|
|
22
|
-
TCallSlot = 13,
|
|
23
|
-
TCallBlock = 14,
|
|
24
|
-
TTranslation = 15,
|
|
25
|
-
TTranslationContext = 16
|
|
26
|
-
}
|
|
27
|
-
interface BaseAST {
|
|
28
|
-
type: ASTType;
|
|
29
|
-
hasNoRepresentation?: true;
|
|
30
|
-
}
|
|
31
|
-
export interface ASTText extends BaseAST {
|
|
32
|
-
type: ASTType.Text;
|
|
33
|
-
value: string;
|
|
34
|
-
}
|
|
35
|
-
export interface ASTComment extends BaseAST {
|
|
36
|
-
type: ASTType.Comment;
|
|
37
|
-
value: string;
|
|
38
|
-
}
|
|
39
|
-
interface TModelInfo {
|
|
40
|
-
expr: string;
|
|
41
|
-
targetAttr: string;
|
|
42
|
-
eventType: "change" | "click" | "input";
|
|
43
|
-
shouldTrim: boolean;
|
|
44
|
-
shouldNumberize: boolean;
|
|
45
|
-
hasDynamicChildren: boolean;
|
|
46
|
-
specialInitTargetAttr: string | null;
|
|
47
|
-
isProxy: boolean;
|
|
48
|
-
}
|
|
49
|
-
export interface ASTDomNode extends BaseAST {
|
|
50
|
-
type: ASTType.DomNode;
|
|
51
|
-
tag: string;
|
|
52
|
-
content: AST[];
|
|
53
|
-
attrs: Attrs | null;
|
|
54
|
-
attrsTranslationCtx: Attrs | null;
|
|
55
|
-
ref: string | null;
|
|
56
|
-
on: EventHandlers | null;
|
|
57
|
-
model: TModelInfo | null;
|
|
58
|
-
dynamicTag: string | null;
|
|
59
|
-
ns: string | null;
|
|
60
|
-
}
|
|
61
|
-
export interface ASTMulti extends BaseAST {
|
|
62
|
-
type: ASTType.Multi;
|
|
63
|
-
content: AST[];
|
|
64
|
-
}
|
|
65
|
-
export interface ASTTOut extends BaseAST {
|
|
66
|
-
type: ASTType.TOut;
|
|
67
|
-
expr: string;
|
|
68
|
-
body: AST[] | null;
|
|
69
|
-
}
|
|
70
|
-
export interface ASTTif extends BaseAST {
|
|
71
|
-
type: ASTType.TIf;
|
|
72
|
-
condition: string;
|
|
73
|
-
content: AST;
|
|
74
|
-
tElif: {
|
|
75
|
-
condition: string;
|
|
76
|
-
content: AST;
|
|
77
|
-
}[] | null;
|
|
78
|
-
tElse: AST | null;
|
|
79
|
-
}
|
|
80
|
-
export interface ASTTSet extends BaseAST {
|
|
81
|
-
type: ASTType.TSet;
|
|
82
|
-
name: string;
|
|
83
|
-
value: string | null;
|
|
84
|
-
defaultValue: string | null;
|
|
85
|
-
body: AST[] | null;
|
|
86
|
-
hasNoRepresentation: true;
|
|
87
|
-
}
|
|
88
|
-
export declare const enum ForEachNoFlag {
|
|
89
|
-
First = 1,
|
|
90
|
-
Last = 2,
|
|
91
|
-
Index = 4,
|
|
92
|
-
Value = 8
|
|
93
|
-
}
|
|
94
|
-
export interface ASTTForEach extends BaseAST {
|
|
95
|
-
type: ASTType.TForEach;
|
|
96
|
-
collection: string;
|
|
97
|
-
elem: string;
|
|
98
|
-
body: AST;
|
|
99
|
-
noFlags: number;
|
|
100
|
-
key: string | null;
|
|
101
|
-
}
|
|
102
|
-
export interface ASTTKey extends BaseAST {
|
|
103
|
-
type: ASTType.TKey;
|
|
104
|
-
expr: string;
|
|
105
|
-
content: AST;
|
|
106
|
-
}
|
|
107
|
-
export interface ASTTCall extends BaseAST {
|
|
108
|
-
type: ASTType.TCall;
|
|
109
|
-
name: string;
|
|
110
|
-
attrs: Attrs | null;
|
|
111
|
-
attrsTranslationCtx: Attrs | null;
|
|
112
|
-
body: AST | null;
|
|
113
|
-
context: string | null;
|
|
114
|
-
}
|
|
115
|
-
interface SlotDefinition {
|
|
116
|
-
content: AST | null;
|
|
117
|
-
scope: string | null;
|
|
118
|
-
on: EventHandlers | null;
|
|
119
|
-
attrs: Attrs | null;
|
|
120
|
-
attrsTranslationCtx: Attrs | null;
|
|
121
|
-
}
|
|
122
|
-
export interface ASTComponent extends BaseAST {
|
|
123
|
-
type: ASTType.TComponent;
|
|
124
|
-
name: string;
|
|
125
|
-
isDynamic: boolean;
|
|
126
|
-
dynamicProps: string | null;
|
|
127
|
-
on: EventHandlers | null;
|
|
128
|
-
props: {
|
|
129
|
-
[name: string]: string;
|
|
130
|
-
} | null;
|
|
131
|
-
propsTranslationCtx: {
|
|
132
|
-
[name: string]: string;
|
|
133
|
-
} | null;
|
|
134
|
-
slots: {
|
|
135
|
-
[name: string]: SlotDefinition;
|
|
136
|
-
} | null;
|
|
137
|
-
}
|
|
138
|
-
export interface ASTTCallSlot extends BaseAST {
|
|
139
|
-
type: ASTType.TCallSlot;
|
|
140
|
-
name: string;
|
|
141
|
-
attrs: Attrs | null;
|
|
142
|
-
attrsTranslationCtx: Attrs | null;
|
|
143
|
-
on: EventHandlers | null;
|
|
144
|
-
defaultContent: AST | null;
|
|
145
|
-
}
|
|
146
|
-
export interface ASTTCallBlock extends BaseAST {
|
|
147
|
-
type: ASTType.TCallBlock;
|
|
148
|
-
name: string;
|
|
149
|
-
}
|
|
150
|
-
export interface ASTDebug extends BaseAST {
|
|
151
|
-
type: ASTType.TDebug;
|
|
152
|
-
content: AST | null;
|
|
153
|
-
}
|
|
154
|
-
export interface ASTLog extends BaseAST {
|
|
155
|
-
type: ASTType.TLog;
|
|
156
|
-
expr: string;
|
|
157
|
-
content: AST | null;
|
|
158
|
-
}
|
|
159
|
-
export interface ASTTranslation extends BaseAST {
|
|
160
|
-
type: ASTType.TTranslation;
|
|
161
|
-
content: AST | null;
|
|
162
|
-
}
|
|
163
|
-
export interface ASTTranslationContext extends BaseAST {
|
|
164
|
-
type: ASTType.TTranslationContext;
|
|
165
|
-
content: AST | null;
|
|
166
|
-
translationCtx: string;
|
|
167
|
-
}
|
|
168
|
-
export type AST = ASTText | ASTComment | ASTDomNode | ASTMulti | ASTTif | ASTTSet | ASTTCall | ASTTOut | ASTTForEach | ASTTKey | ASTComponent | ASTTCallSlot | ASTTCallBlock | ASTLog | ASTDebug | ASTTranslation | ASTTranslationContext;
|
|
169
|
-
export declare function parse(xml: string | Element, customDir?: CustomDirectives): AST;
|
|
170
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/types/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./runtime";
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { ComponentConstructor } from "./component";
|
|
2
|
-
import { ComponentNode } from "./component_node";
|
|
3
|
-
import { PluginConstructor, PluginManager } from "./plugin_manager";
|
|
4
|
-
import { GetProps } from "./props";
|
|
5
|
-
import { proxy, toRaw } from "./reactivity/proxy";
|
|
6
|
-
import { Fiber, MountOptions, RootFiber } from "./rendering/fibers";
|
|
7
|
-
import { Scheduler } from "./rendering/scheduler";
|
|
8
|
-
import { Resource } from "./resource";
|
|
9
|
-
import { TemplateSet, TemplateSetConfig } from "./template_set";
|
|
10
|
-
import { validateTarget } from "./utils";
|
|
11
|
-
type ComponentInstance<C extends ComponentConstructor> = C extends new (...args: any) => infer T ? T : never;
|
|
12
|
-
interface RootConfig<P> {
|
|
13
|
-
props?: P;
|
|
14
|
-
}
|
|
15
|
-
export interface AppConfig extends TemplateSetConfig {
|
|
16
|
-
name?: string;
|
|
17
|
-
plugins?: PluginConstructor[] | Resource<PluginConstructor>;
|
|
18
|
-
config?: Record<string, any>;
|
|
19
|
-
test?: boolean;
|
|
20
|
-
}
|
|
21
|
-
declare global {
|
|
22
|
-
interface Window {
|
|
23
|
-
__OWL_DEVTOOLS__: {
|
|
24
|
-
apps: Set<App>;
|
|
25
|
-
Fiber: typeof Fiber;
|
|
26
|
-
RootFiber: typeof RootFiber;
|
|
27
|
-
toRaw: typeof toRaw;
|
|
28
|
-
proxy: typeof proxy;
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
import type { MountTarget } from "./blockdom";
|
|
33
|
-
interface Root<T extends ComponentConstructor> {
|
|
34
|
-
node: ComponentNode;
|
|
35
|
-
promise: Promise<ComponentInstance<T>>;
|
|
36
|
-
mount(target: MountTarget, options?: MountOptions): Promise<ComponentInstance<T>>;
|
|
37
|
-
destroy(): void;
|
|
38
|
-
}
|
|
39
|
-
export declare class App extends TemplateSet {
|
|
40
|
-
static validateTarget: typeof validateTarget;
|
|
41
|
-
static apps: Set<App>;
|
|
42
|
-
static version: string;
|
|
43
|
-
name: string;
|
|
44
|
-
scheduler: Scheduler;
|
|
45
|
-
roots: Set<Root<any>>;
|
|
46
|
-
pluginManager: PluginManager;
|
|
47
|
-
constructor(config?: AppConfig);
|
|
48
|
-
createRoot<T extends ComponentConstructor>(Root: T, config?: RootConfig<GetProps<ComponentInstance<T>>>): Root<T>;
|
|
49
|
-
destroy(): void;
|
|
50
|
-
_handleError(error: any): void;
|
|
51
|
-
}
|
|
52
|
-
export declare function mount<T extends ComponentConstructor>(C: T, target: MountTarget, config?: AppConfig & RootConfig<GetProps<ComponentInstance<T>>> & MountOptions): Promise<ComponentInstance<T>>;
|
|
53
|
-
export {};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { Setter } from "./block_compiler";
|
|
2
|
-
export declare function createAttrUpdater(attr: string): Setter<HTMLElement>;
|
|
3
|
-
export declare function attrsSetter(this: HTMLElement, attrs: any): void;
|
|
4
|
-
export declare function attrsUpdater(this: HTMLElement, attrs: any, oldAttrs: any): void;
|
|
5
|
-
export declare function setClass(this: HTMLElement, val: any): void;
|
|
6
|
-
export declare function updateClass(this: HTMLElement, val: any, oldVal: any): void;
|
|
7
|
-
export declare function setStyle(this: HTMLElement, val: any): void;
|
|
8
|
-
export declare function updateStyle(this: HTMLElement, val: any, oldVal: any): void;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { VNode } from "./index";
|
|
2
|
-
type BlockType = (data?: any[], children?: VNode[]) => VNode;
|
|
3
|
-
/**
|
|
4
|
-
* Compiling blocks is a multi-step process:
|
|
5
|
-
*
|
|
6
|
-
* 1. build an IntermediateTree from the HTML element. This intermediate tree
|
|
7
|
-
* is a binary tree structure that encode dynamic info sub nodes, and the
|
|
8
|
-
* path required to reach them
|
|
9
|
-
* 2. process the tree to build a block context, which is an object that aggregate
|
|
10
|
-
* all dynamic info in a list, and also, all ref indexes.
|
|
11
|
-
* 3. process the context to build appropriate builder/setter functions
|
|
12
|
-
* 4. make a dynamic block class, which will efficiently collect references and
|
|
13
|
-
* create/update dynamic locations/children
|
|
14
|
-
*
|
|
15
|
-
* @param str
|
|
16
|
-
* @returns a new block type, that can build concrete blocks
|
|
17
|
-
*/
|
|
18
|
-
export declare function createBlock(str: string): BlockType;
|
|
19
|
-
export type Setter<T = any> = (this: T, value: any) => void;
|
|
20
|
-
export {};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export declare function filterOutModifiersFromData(dataList: any[]): {
|
|
2
|
-
modifiers: string[];
|
|
3
|
-
data: any[];
|
|
4
|
-
};
|
|
5
|
-
export declare const config: {
|
|
6
|
-
shouldNormalizeDom: boolean;
|
|
7
|
-
mainEventHandler: (data: any, ev: Event, currentTarget?: EventTarget | null) => boolean;
|
|
8
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
type EventHandlerSetter = (this: HTMLElement, data: any) => void;
|
|
2
|
-
interface EventHandlerCreator {
|
|
3
|
-
setup: EventHandlerSetter;
|
|
4
|
-
update: EventHandlerSetter;
|
|
5
|
-
remove: (this: HTMLElement) => void;
|
|
6
|
-
}
|
|
7
|
-
export declare function createEventHandler(rawEvent: string): EventHandlerCreator;
|
|
8
|
-
export {};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { VNode } from "./index";
|
|
2
|
-
declare class VHtml {
|
|
3
|
-
html: string;
|
|
4
|
-
parentEl?: HTMLElement | undefined;
|
|
5
|
-
content: ChildNode[];
|
|
6
|
-
constructor(html: string);
|
|
7
|
-
mount(parent: HTMLElement, afterNode: Node | null): void;
|
|
8
|
-
moveBeforeDOMNode(node: Node | null, parent?: HTMLElement | undefined): void;
|
|
9
|
-
moveBeforeVNode(other: VHtml | null, afterNode: Node | null): void;
|
|
10
|
-
patch(other: VHtml): void;
|
|
11
|
-
beforeRemove(): void;
|
|
12
|
-
remove(): void;
|
|
13
|
-
firstNode(): Node;
|
|
14
|
-
toString(): string;
|
|
15
|
-
}
|
|
16
|
-
export declare function html(str: string): VNode<VHtml>;
|
|
17
|
-
export {};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
export { config } from "./config";
|
|
2
|
-
export { toggler } from "./toggler";
|
|
3
|
-
export { createBlock } from "./block_compiler";
|
|
4
|
-
export { list } from "./list";
|
|
5
|
-
export { multi } from "./multi";
|
|
6
|
-
export { text, comment } from "./text";
|
|
7
|
-
export { html } from "./html";
|
|
8
|
-
export { createCatcher } from "./event_catcher";
|
|
9
|
-
export type MountTarget = HTMLElement | ShadowRoot;
|
|
10
|
-
export interface VNode<T = any> {
|
|
11
|
-
mount(parent: MountTarget, afterNode: Node | null): void;
|
|
12
|
-
moveBeforeDOMNode(node: Node | null, parent?: MountTarget): void;
|
|
13
|
-
moveBeforeVNode(other: T | null, afterNode: Node | null): void;
|
|
14
|
-
patch(other: T, withBeforeRemove: boolean): void;
|
|
15
|
-
beforeRemove(): void;
|
|
16
|
-
remove(): void;
|
|
17
|
-
firstNode(): Node | undefined;
|
|
18
|
-
el?: undefined | HTMLElement | Text;
|
|
19
|
-
parentEl?: undefined | HTMLElement;
|
|
20
|
-
isOnlyChild?: boolean | undefined;
|
|
21
|
-
key?: any;
|
|
22
|
-
}
|
|
23
|
-
export type BDom = VNode<any>;
|
|
24
|
-
export declare function mount(vnode: VNode, fixture: MountTarget, afterNode?: Node | null): void;
|
|
25
|
-
export declare function patch(vnode1: VNode, vnode2: VNode, withBeforeRemove?: boolean): void;
|
|
26
|
-
export declare function remove(vnode: VNode, withBeforeRemove?: boolean): void;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { VNode } from "./index";
|
|
2
|
-
declare class VList {
|
|
3
|
-
children: VNode[];
|
|
4
|
-
anchor: Node | undefined;
|
|
5
|
-
parentEl?: HTMLElement | undefined;
|
|
6
|
-
isOnlyChild?: boolean | undefined;
|
|
7
|
-
constructor(children: VNode[]);
|
|
8
|
-
mount(parent: HTMLElement, afterNode: Node | null): void;
|
|
9
|
-
moveBeforeDOMNode(node: Node | null, parent?: HTMLElement | undefined): void;
|
|
10
|
-
moveBeforeVNode(other: VList | null, afterNode: Node | null): void;
|
|
11
|
-
patch(other: VList, withBeforeRemove: boolean): void;
|
|
12
|
-
beforeRemove(): void;
|
|
13
|
-
remove(): void;
|
|
14
|
-
firstNode(): Node | undefined;
|
|
15
|
-
toString(): string;
|
|
16
|
-
}
|
|
17
|
-
export declare function list(children: VNode[]): VNode<VList>;
|
|
18
|
-
export {};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { VNode } from "./index";
|
|
2
|
-
export declare class VMulti {
|
|
3
|
-
children: (VNode | undefined)[];
|
|
4
|
-
anchors?: Node[] | undefined;
|
|
5
|
-
parentEl?: HTMLElement | undefined;
|
|
6
|
-
isOnlyChild?: boolean | undefined;
|
|
7
|
-
constructor(children: (VNode | undefined)[]);
|
|
8
|
-
mount(parent: HTMLElement, afterNode: Node | null): void;
|
|
9
|
-
moveBeforeDOMNode(node: Node | null, parent?: HTMLElement | undefined): void;
|
|
10
|
-
moveBeforeVNode(other: VMulti | null, afterNode: Node | null): void;
|
|
11
|
-
patch(other: VMulti, withBeforeRemove: boolean): void;
|
|
12
|
-
beforeRemove(): void;
|
|
13
|
-
remove(): void;
|
|
14
|
-
firstNode(): Node | undefined;
|
|
15
|
-
toString(): string;
|
|
16
|
-
}
|
|
17
|
-
export declare function multi(children: (VNode | undefined)[]): VNode<VMulti>;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type { VNode } from "./index";
|
|
2
|
-
declare abstract class VSimpleNode {
|
|
3
|
-
text: string | String;
|
|
4
|
-
parentEl?: HTMLElement | undefined;
|
|
5
|
-
el?: any;
|
|
6
|
-
constructor(text: string | String);
|
|
7
|
-
mountNode(node: Node, parent: HTMLElement, afterNode: Node | null): void;
|
|
8
|
-
moveBeforeDOMNode(node: Node | null, parent?: HTMLElement | undefined): void;
|
|
9
|
-
moveBeforeVNode(other: VText | null, afterNode: Node | null): void;
|
|
10
|
-
beforeRemove(): void;
|
|
11
|
-
remove(): void;
|
|
12
|
-
firstNode(): Node;
|
|
13
|
-
toString(): string | String;
|
|
14
|
-
}
|
|
15
|
-
declare class VText extends VSimpleNode {
|
|
16
|
-
mount(parent: HTMLElement, afterNode: Node | null): void;
|
|
17
|
-
patch(other: VText): void;
|
|
18
|
-
}
|
|
19
|
-
declare class VComment extends VSimpleNode {
|
|
20
|
-
mount(parent: HTMLElement, afterNode: Node | null): void;
|
|
21
|
-
patch(): void;
|
|
22
|
-
}
|
|
23
|
-
export declare function text(str: string | String): VNode<VText>;
|
|
24
|
-
export declare function comment(str: string): VNode<VComment>;
|
|
25
|
-
export declare function toText(value: any): string;
|
|
26
|
-
export {};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { VNode } from "./index";
|
|
2
|
-
declare class VToggler {
|
|
3
|
-
key: string;
|
|
4
|
-
child: VNode;
|
|
5
|
-
parentEl?: HTMLElement | undefined;
|
|
6
|
-
constructor(key: string, child: VNode);
|
|
7
|
-
mount(parent: HTMLElement, afterNode: Node | null): void;
|
|
8
|
-
moveBeforeDOMNode(node: Node | null, parent?: HTMLElement): void;
|
|
9
|
-
moveBeforeVNode(other: VToggler | null, afterNode: Node | null): void;
|
|
10
|
-
patch(other: VToggler, withBeforeRemove: boolean): void;
|
|
11
|
-
beforeRemove(): void;
|
|
12
|
-
remove(): void;
|
|
13
|
-
firstNode(): Node | undefined;
|
|
14
|
-
toString(): string;
|
|
15
|
-
}
|
|
16
|
-
export declare function toggler(key: string, child: VNode): VNode<VToggler>;
|
|
17
|
-
export {};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { ComponentNode } from "./component_node";
|
|
2
|
-
interface StaticComponentProperties {
|
|
3
|
-
template: string;
|
|
4
|
-
components?: {
|
|
5
|
-
[componentName: string]: ComponentConstructor;
|
|
6
|
-
};
|
|
7
|
-
}
|
|
8
|
-
export interface ComponentConstructor extends StaticComponentProperties {
|
|
9
|
-
new (node: ComponentNode): Component;
|
|
10
|
-
}
|
|
11
|
-
export declare class Component {
|
|
12
|
-
static template: string;
|
|
13
|
-
__owl__: ComponentNode;
|
|
14
|
-
constructor(node: ComponentNode);
|
|
15
|
-
setup(): void;
|
|
16
|
-
}
|
|
17
|
-
export {};
|