@odoo/owl 2.0.1 → 2.0.3
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/owl.cjs.js +80 -80
- package/dist/owl.es.js +80 -80
- package/dist/owl.iife.js +80 -80
- package/dist/owl.iife.min.js +1 -1
- package/dist/types/owl.d.ts +74 -81
- package/dist/types/runtime/app.d.ts +1 -1
- package/dist/types/runtime/component_node.d.ts +2 -2
- package/dist/types/runtime/index.d.ts +0 -1
- package/dist/types/runtime/reactivity.d.ts +6 -12
- package/dist/types/runtime/template_helpers.d.ts +1 -1
- package/package.json +6 -6
|
@@ -2,7 +2,7 @@ import type { App, Env } from "./app";
|
|
|
2
2
|
import { BDom, VNode } from "./blockdom";
|
|
3
3
|
import { Component, ComponentConstructor, Props } from "./component";
|
|
4
4
|
import { Fiber, MountFiber, MountOptions } from "./fibers";
|
|
5
|
-
import { getSubscriptions
|
|
5
|
+
import { getSubscriptions } from "./reactivity";
|
|
6
6
|
import { STATUS } from "./status";
|
|
7
7
|
export declare function getCurrent(): ComponentNode;
|
|
8
8
|
export declare function useComponent(): Component;
|
|
@@ -16,7 +16,7 @@ export declare function useComponent(): Component;
|
|
|
16
16
|
* relevant changes
|
|
17
17
|
* @see reactive
|
|
18
18
|
*/
|
|
19
|
-
export declare function useState<T extends object>(state: T):
|
|
19
|
+
export declare function useState<T extends object>(state: T): T;
|
|
20
20
|
declare type LifecycleHook = Function;
|
|
21
21
|
export declare class ComponentNode<P extends Props = any, E = any> implements VNode<ComponentNode<P, E>> {
|
|
22
22
|
el?: HTMLElement | Text | undefined;
|
|
@@ -1,27 +1,20 @@
|
|
|
1
1
|
import { Callback } from "./utils";
|
|
2
|
-
export declare const TARGET: unique symbol;
|
|
3
|
-
declare const SKIP: unique symbol;
|
|
4
2
|
declare type Target = object;
|
|
5
|
-
|
|
6
|
-
[TARGET]: any;
|
|
7
|
-
};
|
|
8
|
-
export declare type NonReactive<T extends Target = Target> = T & {
|
|
9
|
-
[SKIP]: any;
|
|
10
|
-
};
|
|
3
|
+
declare type Reactive<T extends Target> = T;
|
|
11
4
|
/**
|
|
12
5
|
* Mark an object or array so that it is ignored by the reactivity system
|
|
13
6
|
*
|
|
14
7
|
* @param value the value to mark
|
|
15
8
|
* @returns the object itself
|
|
16
9
|
*/
|
|
17
|
-
export declare function markRaw<T extends Target>(value: T):
|
|
10
|
+
export declare function markRaw<T extends Target>(value: T): T;
|
|
18
11
|
/**
|
|
19
12
|
* Given a reactive objet, return the raw (non reactive) underlying object
|
|
20
13
|
*
|
|
21
14
|
* @param value a reactive value
|
|
22
15
|
* @returns the underlying value
|
|
23
16
|
*/
|
|
24
|
-
export declare function toRaw<T extends
|
|
17
|
+
export declare function toRaw<T extends Target, U extends Reactive<T>>(value: U | T): T;
|
|
25
18
|
/**
|
|
26
19
|
* Clears all subscriptions of the Reactives associated with a given callback.
|
|
27
20
|
*
|
|
@@ -32,6 +25,7 @@ export declare function getSubscriptions(callback: Callback): {
|
|
|
32
25
|
target: object;
|
|
33
26
|
keys: PropertyKey[];
|
|
34
27
|
}[];
|
|
28
|
+
export declare const targets: WeakMap<object, object>;
|
|
35
29
|
/**
|
|
36
30
|
* Creates a reactive proxy for an object. Reading data on the reactive object
|
|
37
31
|
* subscribes to changes to the data. Writing data on the object will cause the
|
|
@@ -46,7 +40,7 @@ export declare function getSubscriptions(callback: Callback): {
|
|
|
46
40
|
* Subscriptions:
|
|
47
41
|
* + Reading a property on an object will subscribe you to changes in the value
|
|
48
42
|
* of that property.
|
|
49
|
-
* + Accessing an object keys (eg with Object.keys or with `for..in`) will
|
|
43
|
+
* + Accessing an object's keys (eg with Object.keys or with `for..in`) will
|
|
50
44
|
* subscribe you to the creation/deletion of keys. Checking the presence of a
|
|
51
45
|
* key on the object with 'in' has the same effect.
|
|
52
46
|
* - getOwnPropertyDescriptor does not currently subscribe you to the property.
|
|
@@ -59,5 +53,5 @@ export declare function getSubscriptions(callback: Callback): {
|
|
|
59
53
|
* reactive has changed
|
|
60
54
|
* @returns a proxy that tracks changes to it
|
|
61
55
|
*/
|
|
62
|
-
export declare function reactive<T extends Target>(target: T, callback?: Callback):
|
|
56
|
+
export declare function reactive<T extends Target>(target: T, callback?: Callback): T;
|
|
63
57
|
export {};
|
|
@@ -27,7 +27,7 @@ declare class LazyValue {
|
|
|
27
27
|
toString(): any;
|
|
28
28
|
}
|
|
29
29
|
export declare function safeOutput(value: any, defaultValue?: any): ReturnType<typeof toggler>;
|
|
30
|
-
declare function bind(
|
|
30
|
+
declare function bind(component: any, fn: Function): Function;
|
|
31
31
|
declare type RefMap = {
|
|
32
32
|
[key: string]: HTMLElement | null;
|
|
33
33
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@odoo/owl",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.3",
|
|
4
4
|
"description": "Odoo Web Library (OWL)",
|
|
5
5
|
"main": "dist/owl.cjs.js",
|
|
6
6
|
"module": "dist/owl.es.js",
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
"playground:watch": "npm-run-all --parallel playground:serve \"build:* -- --watch\"",
|
|
26
26
|
"prettier": "prettier {src/*.ts,src/**/*.ts,tests/*.ts,tests/**/*.ts,doc/*.md,doc/**/*.md} --write",
|
|
27
27
|
"check-formatting": "prettier {src/*.ts,src/**/*.ts,tests/*.ts,tests/**/*.ts,doc/*.md,doc/**/*.md} --check",
|
|
28
|
+
"lint": "eslint src/**/*.ts tests/**/*.ts",
|
|
28
29
|
"publish": "npm run build && npm publish",
|
|
29
30
|
"release": "node tools/release.js",
|
|
30
31
|
"compile_templates": "node tools/compile_xml.js"
|
|
@@ -42,26 +43,25 @@
|
|
|
42
43
|
"devDependencies": {
|
|
43
44
|
"@types/jest": "^27.0.1",
|
|
44
45
|
"@types/node": "^14.11.8",
|
|
46
|
+
"@typescript-eslint/eslint-plugin": "5.48.1",
|
|
47
|
+
"@typescript-eslint/parser": "5.48.1",
|
|
45
48
|
"chalk": "^3.0.0",
|
|
46
|
-
"cpx": "^1.5.0",
|
|
47
49
|
"current-git-branch": "^1.1.0",
|
|
50
|
+
"eslint": "8.31.0",
|
|
48
51
|
"git-rev-sync": "^1.12.0",
|
|
49
52
|
"github-api": "^3.3.0",
|
|
50
53
|
"jest": "^27.1.0",
|
|
51
54
|
"jest-diff": "^27.3.1",
|
|
52
55
|
"jest-environment-jsdom": "^27.1.0",
|
|
53
|
-
"live-server": "^1.2.1",
|
|
54
56
|
"npm-run-all": "^4.1.5",
|
|
55
57
|
"prettier": "2.4.1",
|
|
56
58
|
"rollup": "^2.56.3",
|
|
57
59
|
"rollup-plugin-dts": "^4.2.2",
|
|
58
60
|
"rollup-plugin-terser": "^7.0.2",
|
|
59
61
|
"rollup-plugin-typescript2": "^0.31.1",
|
|
60
|
-
"sass": "^1.16.1",
|
|
61
62
|
"source-map-support": "^0.5.10",
|
|
62
63
|
"ts-jest": "^27.0.5",
|
|
63
|
-
"typescript": "4.5.2"
|
|
64
|
-
"uglify-es": "^3.3.9"
|
|
64
|
+
"typescript": "4.5.2"
|
|
65
65
|
},
|
|
66
66
|
"jest": {
|
|
67
67
|
"testEnvironment": "jsdom",
|