vasille 2.3.4 → 2.3.7
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 +5 -5
- package/cdn/es2015.js +11 -2
- package/cdn/es5.js +11 -2
- package/flow-typed/vasille.js +27 -23
- package/lib/core/core.js +1 -1
- package/lib/node/node.js +4 -1
- package/lib/node/watch.js +1 -0
- package/lib/views/array-view.js +1 -0
- package/lib/views/base-view.js +1 -0
- package/lib/views/map-view.js +1 -0
- package/lib/views/object-view.js +1 -0
- package/lib/views/set-view.js +1 -0
- package/lib-node/core/core.js +1 -1
- package/lib-node/node/node.js +4 -1
- package/lib-node/node/watch.js +1 -0
- package/lib-node/views/array-view.js +1 -0
- package/lib-node/views/base-view.js +1 -0
- package/lib-node/views/map-view.js +1 -0
- package/lib-node/views/object-view.js +1 -0
- package/lib-node/views/set-view.js +1 -0
- package/package.json +3 -3
- package/types/core/core.d.ts +1 -1
- package/types/functional/options.d.ts +4 -2
- package/types/node/node.d.ts +3 -3
- package/types/node/watch.d.ts +1 -1
- package/types/spec/html.d.ts +6 -6
- package/types/spec/react.d.ts +2 -2
- package/types/spec/svg.d.ts +2 -2
- package/types/value/expression.d.ts +1 -1
- package/types/views/array-view.d.ts +1 -1
- package/types/views/base-view.d.ts +1 -1
- package/types/views/map-view.d.ts +1 -1
- package/types/views/object-view.d.ts +1 -1
- package/types/views/set-view.d.ts +1 -1
package/README.md
CHANGED
|
@@ -34,12 +34,12 @@ There are several modes to use Vasille.
|
|
|
34
34
|
### Documentation for beginners (how to create the first project step by step):
|
|
35
35
|
* [`Vasille Core Library` - the hard way - `low-level`](https://gitlab.com/vasille-js/vasille-js/-/blob/v2/pages/GetStarted.md)
|
|
36
36
|
* [`Vasille Less Library` - perfect for me - `high-level`](https://gitlab.com/vasille-js/vasille-less/-/blob/v2/pages/GetStarted.md)
|
|
37
|
-
* [`Vasille Magic` - perfect for you - `highest-level`](https://gitlab.com/vasille-js/
|
|
37
|
+
* [`Vasille Magic` - perfect for you - `highest-level`](https://gitlab.com/vasille-js/vasille-magic/-/blob/master/pages/GetStarted.md)
|
|
38
38
|
|
|
39
39
|
### Full documentation:
|
|
40
40
|
* [`Vasille Core Library API`- write anything - `low-level`](https://gitlab.com/vasille-js/vasille-js/-/blob/v2/pages/Vasille-Core-Library-API.md)
|
|
41
41
|
* [`Vasille Less Library API`- write less do more - `high-level`](https://gitlab.com/vasille-js/vasille-less/-/blob/v2/pages/Vasille-Less-Library-API.md)
|
|
42
|
-
* [`Vasille Magic API`- compiler writes for you - `highest-level`](https://gitlab.com/vasille-js/vasille-
|
|
42
|
+
* [`Vasille Magic API`- compiler writes for you - `highest-level`](https://gitlab.com/vasille-js/vasille-magic/-/blob/master/pages/Vasille-Magic-API.md)
|
|
43
43
|
|
|
44
44
|
### Getting ready be example
|
|
45
45
|
* [TypeScript Example](https://gitlab.com/vasille-js/learning/vasille-ts-example)
|
|
@@ -50,7 +50,7 @@ There are several modes to use Vasille.
|
|
|
50
50
|
|
|
51
51
|
## How SAFE is Vasille
|
|
52
52
|
|
|
53
|
-
The safe of your application is ensured by
|
|
53
|
+
The safe of your application is ensured by
|
|
54
54
|
* `100%` coverage of `vasille` code by unit tests.
|
|
55
55
|
Each function, each branch are working as designed.
|
|
56
56
|
* `strong typing` makes your javascript/typescript code safe as C++ code.
|
|
@@ -87,11 +87,11 @@ The test project was coded using the next frameworks:
|
|
|
87
87
|
[Try Initial](https://vasille-js.gitlab.io/project-x32/vasille-js/) /
|
|
88
88
|
[Try Optimized](https://vasille-js.gitlab.io/project-x32-if/vasille-js/).
|
|
89
89
|
|
|
90
|
-
The result of test are demonstrated in figures 1 & 2.
|
|
90
|
+
The result of test are demonstrated in figures 1 & 2.
|
|
91
91
|
The test result are measured in FPS (frames per second), which is calculated as `1000 / ft`,
|
|
92
92
|
where `ft` is an average frame time in ms of 20 frames. All values are absolute. Higher is better.
|
|
93
93
|
|
|
94
|
-
The initial version is updating all the page content in each frame.
|
|
94
|
+
The initial version is updating all the page content in each frame.
|
|
95
95
|
The page reactivity connections are very complex, and we get poor results in Angular, React, Vue & Svelte.
|
|
96
96
|
|
|
97
97
|
The optimized version disables the offscreen & non-actual content, which simplifies the
|
package/cdn/es2015.js
CHANGED
|
@@ -345,7 +345,7 @@ class Reactive extends Destroyable {
|
|
|
345
345
|
throw notOverwritten();
|
|
346
346
|
}
|
|
347
347
|
composeNow() {
|
|
348
|
-
this.compose(this.input);
|
|
348
|
+
return this.compose(this.input);
|
|
349
349
|
}
|
|
350
350
|
runFunctional(f, ...args) {
|
|
351
351
|
stack(this);
|
|
@@ -1393,6 +1393,7 @@ class Fragment extends Reactive {
|
|
|
1393
1393
|
}
|
|
1394
1394
|
compose(input) {
|
|
1395
1395
|
input.slot && input.slot(this);
|
|
1396
|
+
return {};
|
|
1396
1397
|
}
|
|
1397
1398
|
/** To be overloaded: ready event handler */
|
|
1398
1399
|
ready() {
|
|
@@ -1933,6 +1934,7 @@ class Tag extends INode {
|
|
|
1933
1934
|
}
|
|
1934
1935
|
compose(input) {
|
|
1935
1936
|
input.slot && input.slot(this);
|
|
1937
|
+
return {};
|
|
1936
1938
|
}
|
|
1937
1939
|
findFirstChild() {
|
|
1938
1940
|
return this.$.unmounted ? null : this.$.node;
|
|
@@ -2011,9 +2013,10 @@ class Extension extends INode {
|
|
|
2011
2013
|
*/
|
|
2012
2014
|
class Component extends Extension {
|
|
2013
2015
|
init() {
|
|
2014
|
-
super.composeNow();
|
|
2016
|
+
const ret = super.composeNow();
|
|
2015
2017
|
this.ready();
|
|
2016
2018
|
super.applyOptionsNow();
|
|
2019
|
+
return ret;
|
|
2017
2020
|
}
|
|
2018
2021
|
ready() {
|
|
2019
2022
|
super.ready();
|
|
@@ -2219,6 +2222,7 @@ class Watch extends Fragment {
|
|
|
2219
2222
|
input.slot && input.slot(this, value);
|
|
2220
2223
|
}, input.model);
|
|
2221
2224
|
input.slot(this, input.model.$);
|
|
2225
|
+
return {};
|
|
2222
2226
|
}
|
|
2223
2227
|
}
|
|
2224
2228
|
|
|
@@ -2330,6 +2334,7 @@ class BaseView extends RepeatNode {
|
|
|
2330
2334
|
input.model.listener.offAdd($.addHandler);
|
|
2331
2335
|
input.model.listener.offRemove($.removeHandler);
|
|
2332
2336
|
});
|
|
2337
|
+
return {};
|
|
2333
2338
|
}
|
|
2334
2339
|
}
|
|
2335
2340
|
|
|
@@ -2351,6 +2356,7 @@ class ArrayView extends BaseView {
|
|
|
2351
2356
|
input.model.forEach(item => {
|
|
2352
2357
|
this.createChild(input, item, item);
|
|
2353
2358
|
});
|
|
2359
|
+
return {};
|
|
2354
2360
|
}
|
|
2355
2361
|
}
|
|
2356
2362
|
|
|
@@ -2368,6 +2374,7 @@ class MapView extends BaseView {
|
|
|
2368
2374
|
input.model.forEach((value, key) => {
|
|
2369
2375
|
this.createChild(input, key, value);
|
|
2370
2376
|
});
|
|
2377
|
+
return {};
|
|
2371
2378
|
}
|
|
2372
2379
|
}
|
|
2373
2380
|
|
|
@@ -2387,6 +2394,7 @@ class ObjectView extends BaseView {
|
|
|
2387
2394
|
this.createChild(input, key, obj[key]);
|
|
2388
2395
|
}
|
|
2389
2396
|
super.ready();
|
|
2397
|
+
return {};
|
|
2390
2398
|
}
|
|
2391
2399
|
}
|
|
2392
2400
|
|
|
@@ -2405,6 +2413,7 @@ class SetView extends BaseView {
|
|
|
2405
2413
|
set.forEach(item => {
|
|
2406
2414
|
this.createChild(input, item, item);
|
|
2407
2415
|
});
|
|
2416
|
+
return {};
|
|
2408
2417
|
}
|
|
2409
2418
|
}
|
|
2410
2419
|
|
package/cdn/es5.js
CHANGED
|
@@ -640,7 +640,7 @@ var Reactive = /** @class */ (function (_super) {
|
|
|
640
640
|
throw (0, errors_1.notOverwritten)();
|
|
641
641
|
};
|
|
642
642
|
Reactive.prototype.composeNow = function () {
|
|
643
|
-
this.compose(this.input);
|
|
643
|
+
return this.compose(this.input);
|
|
644
644
|
};
|
|
645
645
|
Reactive.prototype.runFunctional = function (f) {
|
|
646
646
|
var args = [];
|
|
@@ -2064,6 +2064,7 @@ var Fragment = /** @class */ (function (_super) {
|
|
|
2064
2064
|
};
|
|
2065
2065
|
Fragment.prototype.compose = function (input) {
|
|
2066
2066
|
input.slot && input.slot(this);
|
|
2067
|
+
return {};
|
|
2067
2068
|
};
|
|
2068
2069
|
/** To be overloaded: ready event handler */
|
|
2069
2070
|
Fragment.prototype.ready = function () {
|
|
@@ -2631,6 +2632,7 @@ var Tag = /** @class */ (function (_super) {
|
|
|
2631
2632
|
};
|
|
2632
2633
|
Tag.prototype.compose = function (input) {
|
|
2633
2634
|
input.slot && input.slot(this);
|
|
2635
|
+
return {};
|
|
2634
2636
|
};
|
|
2635
2637
|
Tag.prototype.findFirstChild = function () {
|
|
2636
2638
|
return this.$.unmounted ? null : this.$.node;
|
|
@@ -2722,9 +2724,10 @@ var Component = /** @class */ (function (_super) {
|
|
|
2722
2724
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
2723
2725
|
}
|
|
2724
2726
|
Component.prototype.init = function () {
|
|
2725
|
-
_super.prototype.composeNow.call(this);
|
|
2727
|
+
var ret = _super.prototype.composeNow.call(this);
|
|
2726
2728
|
this.ready();
|
|
2727
2729
|
_super.prototype.applyOptionsNow.call(this);
|
|
2730
|
+
return ret;
|
|
2728
2731
|
};
|
|
2729
2732
|
Component.prototype.ready = function () {
|
|
2730
2733
|
_super.prototype.ready.call(this);
|
|
@@ -2960,6 +2963,7 @@ var Watch = /** @class */ (function (_super) {
|
|
|
2960
2963
|
input.slot && input.slot(_this, value);
|
|
2961
2964
|
}, input.model);
|
|
2962
2965
|
input.slot(this, input.model.$);
|
|
2966
|
+
return {};
|
|
2963
2967
|
};
|
|
2964
2968
|
return Watch;
|
|
2965
2969
|
}(node_1.Fragment));
|
|
@@ -3122,6 +3126,7 @@ var BaseView = /** @class */ (function (_super) {
|
|
|
3122
3126
|
input.model.listener.offAdd($.addHandler);
|
|
3123
3127
|
input.model.listener.offRemove($.removeHandler);
|
|
3124
3128
|
});
|
|
3129
|
+
return {};
|
|
3125
3130
|
};
|
|
3126
3131
|
return BaseView;
|
|
3127
3132
|
}(repeat_node_1.RepeatNode));
|
|
@@ -3167,6 +3172,7 @@ var ArrayView = /** @class */ (function (_super) {
|
|
|
3167
3172
|
input.model.forEach(function (item) {
|
|
3168
3173
|
_this.createChild(input, item, item);
|
|
3169
3174
|
});
|
|
3175
|
+
return {};
|
|
3170
3176
|
};
|
|
3171
3177
|
return ArrayView;
|
|
3172
3178
|
}(base_view_1.BaseView));
|
|
@@ -3209,6 +3215,7 @@ var MapView = /** @class */ (function (_super) {
|
|
|
3209
3215
|
input.model.forEach(function (value, key) {
|
|
3210
3216
|
_this.createChild(input, key, value);
|
|
3211
3217
|
});
|
|
3218
|
+
return {};
|
|
3212
3219
|
};
|
|
3213
3220
|
return MapView;
|
|
3214
3221
|
}(base_view_1.BaseView));
|
|
@@ -3252,6 +3259,7 @@ var ObjectView = /** @class */ (function (_super) {
|
|
|
3252
3259
|
this.createChild(input, key, obj[key]);
|
|
3253
3260
|
}
|
|
3254
3261
|
_super.prototype.ready.call(this);
|
|
3262
|
+
return {};
|
|
3255
3263
|
};
|
|
3256
3264
|
return ObjectView;
|
|
3257
3265
|
}(base_view_1.BaseView));
|
|
@@ -3295,6 +3303,7 @@ var SetView = /** @class */ (function (_super) {
|
|
|
3295
3303
|
set.forEach(function (item) {
|
|
3296
3304
|
_this.createChild(input, item, item);
|
|
3297
3305
|
});
|
|
3306
|
+
return {};
|
|
3298
3307
|
};
|
|
3299
3308
|
return SetView;
|
|
3300
3309
|
}(base_view_1.BaseView));
|
package/flow-typed/vasille.js
CHANGED
|
@@ -193,7 +193,7 @@ declare class Reactive<T> extends Destroyable {
|
|
|
193
193
|
applyOptions(input: T): void;
|
|
194
194
|
applyOptionsNow(): void;
|
|
195
195
|
compose(input: T): T['return'];
|
|
196
|
-
composeNow():
|
|
196
|
+
composeNow(): T['return'];
|
|
197
197
|
runFunctional<F>(f: F, ...args: Parameters<F>): ReturnType<F>;
|
|
198
198
|
runOnDestroy(func: () => void): void;
|
|
199
199
|
$destroy(): void;
|
|
@@ -231,7 +231,9 @@ declare class Reference<T> extends IValue<T> {
|
|
|
231
231
|
}
|
|
232
232
|
|
|
233
233
|
|
|
234
|
-
|
|
234
|
+
export type KindOfIValue<T extends any[]> = {
|
|
235
|
+
[K : string]: IValue<T[K]>;
|
|
236
|
+
};
|
|
235
237
|
/**
|
|
236
238
|
* Bind some values to one expression
|
|
237
239
|
* @class Expression
|
|
@@ -640,12 +642,12 @@ declare class SetModel<T> extends Set<T> implements ListenableModel<T, T> {
|
|
|
640
642
|
}
|
|
641
643
|
|
|
642
644
|
|
|
643
|
-
|
|
645
|
+
export type EventHandler<T> = (ev: T) => any;
|
|
644
646
|
declare interface Tag<Attrs, Events> {
|
|
645
647
|
attrs: Attrs;
|
|
646
648
|
events: Events;
|
|
647
649
|
}
|
|
648
|
-
|
|
650
|
+
type TagEvents = {
|
|
649
651
|
[K : string]: EventHandler<HTMLElementEventMap[K]> | undefined;
|
|
650
652
|
};
|
|
651
653
|
declare interface TagAttrs {
|
|
@@ -682,10 +684,10 @@ declare interface MediaTagAttrs extends TagAttrs {
|
|
|
682
684
|
muted: boolean;
|
|
683
685
|
controls: boolean;
|
|
684
686
|
}
|
|
685
|
-
|
|
687
|
+
type MediaEvents = {
|
|
686
688
|
[K : string]: EventHandler<HTMLMediaElementEventMap[K]> | undefined;
|
|
687
689
|
};
|
|
688
|
-
|
|
690
|
+
type VideoEvents = {
|
|
689
691
|
[K : string]: EventHandler<HTMLVideoElementEventMap[K]> | undefined;
|
|
690
692
|
};
|
|
691
693
|
declare interface BaseAttrs extends TagAttrs {
|
|
@@ -719,7 +721,7 @@ declare interface StyleAttrs extends TagAttrs {
|
|
|
719
721
|
media: string;
|
|
720
722
|
blocking: string;
|
|
721
723
|
}
|
|
722
|
-
|
|
724
|
+
type BodyEvents = {
|
|
723
725
|
[K : string]: EventHandler<HTMLBodyElementEventMap[K]> | undefined;
|
|
724
726
|
};
|
|
725
727
|
declare interface BlockQuoteAttrs extends TagAttrs {
|
|
@@ -1076,7 +1078,7 @@ declare interface HtmlTagMap {
|
|
|
1076
1078
|
"wbr": Tag<TagAttrs, TagEvents>;
|
|
1077
1079
|
[K: string]: Tag<TagAttrs, TagEvents>;
|
|
1078
1080
|
}
|
|
1079
|
-
|
|
1081
|
+
type HtmlOrSvgTag = HTMLElement | SVGElement;
|
|
1080
1082
|
declare interface HtmlAndSvgEvents {
|
|
1081
1083
|
onabort?: ((this: HtmlOrSvgTag, ev: UIEvent) => any) | null;
|
|
1082
1084
|
onanimationcancel?: ((this: HtmlOrSvgTag, ev: AnimationEvent) => any) | null;
|
|
@@ -1617,7 +1619,7 @@ declare interface TagNameMap {
|
|
|
1617
1619
|
|
|
1618
1620
|
|
|
1619
1621
|
|
|
1620
|
-
|
|
1622
|
+
type SvgEvents = {
|
|
1621
1623
|
[K : string]: EventHandler<SVGElementEventMap[K]> | undefined;
|
|
1622
1624
|
};
|
|
1623
1625
|
declare interface SvgAreaAttrs {
|
|
@@ -1857,7 +1859,7 @@ declare interface SvgTagMap {
|
|
|
1857
1859
|
"use": Tag<SvgUseAttrs, SvgEvents>;
|
|
1858
1860
|
"view": Tag<SvgViewAttrs, SvgEvents>;
|
|
1859
1861
|
}
|
|
1860
|
-
|
|
1862
|
+
type SvgTag = HtmlAndSvgEvents;
|
|
1861
1863
|
declare interface SvgATag extends SvgTag {
|
|
1862
1864
|
rel: string;
|
|
1863
1865
|
}
|
|
@@ -1932,8 +1934,8 @@ declare interface SvgTagNameMap {
|
|
|
1932
1934
|
|
|
1933
1935
|
|
|
1934
1936
|
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
+
export type AcceptedTagsMap = TagNameMap & SvgTagNameMap;
|
|
1938
|
+
export type AcceptedTagsSpec = HtmlTagMap & SvgTagMap;
|
|
1937
1939
|
|
|
1938
1940
|
|
|
1939
1941
|
/**
|
|
@@ -2114,7 +2116,7 @@ declare class Fragment<T> extends Reactive {
|
|
|
2114
2116
|
*/
|
|
2115
2117
|
preinit(app: AppNode, parent: Fragment, data?: any): void;
|
|
2116
2118
|
init(): T['return'];
|
|
2117
|
-
compose(input: T):
|
|
2119
|
+
compose(input: T): T['return'];
|
|
2118
2120
|
/** To be overloaded: ready event handler */
|
|
2119
2121
|
ready(): void;
|
|
2120
2122
|
/**
|
|
@@ -2335,7 +2337,7 @@ declare interface TagOptionsWithSlot<K> extends TagOptions<K> {
|
|
|
2335
2337
|
declare class Tag<K> extends INode<TagOptionsWithSlot<K>> {
|
|
2336
2338
|
constructor(input: TagOptionsWithSlot<K>): void;
|
|
2337
2339
|
preinit(app: AppNode, parent: Fragment, tagName?: string): void;
|
|
2338
|
-
compose(input: TagOptionsWithSlot<K>):
|
|
2340
|
+
compose(input: TagOptionsWithSlot<K>): TagOptionsWithSlot<K>['return'];
|
|
2339
2341
|
findFirstChild(): Node;
|
|
2340
2342
|
insertAdjacent(node: Node): void;
|
|
2341
2343
|
appendNode(node: Node): void;
|
|
@@ -2365,7 +2367,7 @@ declare class Extension<T> extends INode<T> {
|
|
|
2365
2367
|
* @extends Extension
|
|
2366
2368
|
*/
|
|
2367
2369
|
declare class Component<T> extends Extension<T> {
|
|
2368
|
-
init():
|
|
2370
|
+
init(): T['return'];
|
|
2369
2371
|
ready(): void;
|
|
2370
2372
|
preinit(app: AppNode, parent: Fragment): void;
|
|
2371
2373
|
}
|
|
@@ -2469,17 +2471,19 @@ declare interface WatchOptions<T> extends FragmentOptions {
|
|
|
2469
2471
|
*/
|
|
2470
2472
|
declare class Watch<T> extends Fragment<WatchOptions<T>> {
|
|
2471
2473
|
input: WatchOptions<T>;
|
|
2472
|
-
compose(input: WatchOptions<T>):
|
|
2474
|
+
compose(input: WatchOptions<T>): WatchOptions<T>['return'];
|
|
2473
2475
|
}
|
|
2474
2476
|
|
|
2475
2477
|
|
|
2476
2478
|
|
|
2477
2479
|
declare interface FragmentOptions {
|
|
2478
2480
|
"v:is"?: Record<string, IValue<any>>;
|
|
2479
|
-
return?:
|
|
2481
|
+
return?: {
|
|
2482
|
+
[key: string]: any;
|
|
2483
|
+
};
|
|
2480
2484
|
slot?: (node: Fragment, ...args: any[]) => void;
|
|
2481
2485
|
}
|
|
2482
|
-
|
|
2486
|
+
export type AttrType<T> = IValue<T | string | null> | T | string | null | undefined;
|
|
2483
2487
|
declare interface TagOptions<T> extends FragmentOptions {
|
|
2484
2488
|
"v:attr"?: {
|
|
2485
2489
|
[K : string]:? AttrType<AcceptedTagsSpec[T]['attrs'][K]>;
|
|
@@ -2561,7 +2565,7 @@ declare class BaseView<K, T,Model> extends RepeatNode<K, T, BSO<K, T, Model>> {
|
|
|
2561
2565
|
$: BaseViewPrivate<K, T>;
|
|
2562
2566
|
input: BSO<K, T, Model>;
|
|
2563
2567
|
constructor(input: BSO<K, T, Model>, $?: BaseViewPrivate<K, T>): void;
|
|
2564
|
-
compose(input: BSO<K, T, Model>):
|
|
2568
|
+
compose(input: BSO<K, T, Model>): {};
|
|
2565
2569
|
}
|
|
2566
2570
|
|
|
2567
2571
|
|
|
@@ -2572,7 +2576,7 @@ declare class BaseView<K, T,Model> extends RepeatNode<K, T, BSO<K, T, Model>> {
|
|
|
2572
2576
|
*/
|
|
2573
2577
|
declare class ArrayView<T> extends BaseView<T, T, ArrayModel<T>> {
|
|
2574
2578
|
createChild(input: BSO<T, T, ArrayModel<T>>, id: T, item: T, before?: Fragment): any;
|
|
2575
|
-
compose(input: BSO<T, T, ArrayModel<T>>):
|
|
2579
|
+
compose(input: BSO<T, T, ArrayModel<T>>): {};
|
|
2576
2580
|
}
|
|
2577
2581
|
|
|
2578
2582
|
|
|
@@ -2582,7 +2586,7 @@ declare class ArrayView<T> extends BaseView<T, T, ArrayModel<T>> {
|
|
|
2582
2586
|
* @extends BaseView
|
|
2583
2587
|
*/
|
|
2584
2588
|
declare class MapView<K, T> extends BaseView<K, T, MapModel<K, T>> {
|
|
2585
|
-
compose(input: BSO<K, T, MapModel<K, T>>):
|
|
2589
|
+
compose(input: BSO<K, T, MapModel<K, T>>): {};
|
|
2586
2590
|
}
|
|
2587
2591
|
|
|
2588
2592
|
|
|
@@ -2592,7 +2596,7 @@ declare class MapView<K, T> extends BaseView<K, T, MapModel<K, T>> {
|
|
|
2592
2596
|
* @extends BaseView
|
|
2593
2597
|
*/
|
|
2594
2598
|
declare class ObjectView<T> extends BaseView<string, T, ObjectModel<T>> {
|
|
2595
|
-
compose(input: BSO<string, T, ObjectModel<T>>):
|
|
2599
|
+
compose(input: BSO<string, T, ObjectModel<T>>): {};
|
|
2596
2600
|
}
|
|
2597
2601
|
|
|
2598
2602
|
|
|
@@ -2602,7 +2606,7 @@ declare class ObjectView<T> extends BaseView<string, T, ObjectModel<T>> {
|
|
|
2602
2606
|
* @extends BaseView
|
|
2603
2607
|
*/
|
|
2604
2608
|
declare class SetView<T> extends BaseView<T, T, SetModel<T>> {
|
|
2605
|
-
compose(input: BSO<T, T, SetModel<T>>):
|
|
2609
|
+
compose(input: BSO<T, T, SetModel<T>>): {};
|
|
2606
2610
|
}
|
|
2607
2611
|
|
|
2608
2612
|
|
package/lib/core/core.js
CHANGED
package/lib/node/node.js
CHANGED
|
@@ -76,6 +76,7 @@ export class Fragment extends Reactive {
|
|
|
76
76
|
}
|
|
77
77
|
compose(input) {
|
|
78
78
|
input.slot && input.slot(this);
|
|
79
|
+
return {};
|
|
79
80
|
}
|
|
80
81
|
/** To be overloaded: ready event handler */
|
|
81
82
|
ready() {
|
|
@@ -616,6 +617,7 @@ export class Tag extends INode {
|
|
|
616
617
|
}
|
|
617
618
|
compose(input) {
|
|
618
619
|
input.slot && input.slot(this);
|
|
620
|
+
return {};
|
|
619
621
|
}
|
|
620
622
|
findFirstChild() {
|
|
621
623
|
return this.$.unmounted ? null : this.$.node;
|
|
@@ -694,9 +696,10 @@ export class Extension extends INode {
|
|
|
694
696
|
*/
|
|
695
697
|
export class Component extends Extension {
|
|
696
698
|
init() {
|
|
697
|
-
super.composeNow();
|
|
699
|
+
const ret = super.composeNow();
|
|
698
700
|
this.ready();
|
|
699
701
|
super.applyOptionsNow();
|
|
702
|
+
return ret;
|
|
700
703
|
}
|
|
701
704
|
ready() {
|
|
702
705
|
super.ready();
|
package/lib/node/watch.js
CHANGED
package/lib/views/array-view.js
CHANGED
package/lib/views/base-view.js
CHANGED
package/lib/views/map-view.js
CHANGED
package/lib/views/object-view.js
CHANGED
package/lib/views/set-view.js
CHANGED
package/lib-node/core/core.js
CHANGED
package/lib-node/node/node.js
CHANGED
|
@@ -80,6 +80,7 @@ class Fragment extends core_1.Reactive {
|
|
|
80
80
|
}
|
|
81
81
|
compose(input) {
|
|
82
82
|
input.slot && input.slot(this);
|
|
83
|
+
return {};
|
|
83
84
|
}
|
|
84
85
|
/** To be overloaded: ready event handler */
|
|
85
86
|
ready() {
|
|
@@ -625,6 +626,7 @@ class Tag extends INode {
|
|
|
625
626
|
}
|
|
626
627
|
compose(input) {
|
|
627
628
|
input.slot && input.slot(this);
|
|
629
|
+
return {};
|
|
628
630
|
}
|
|
629
631
|
findFirstChild() {
|
|
630
632
|
return this.$.unmounted ? null : this.$.node;
|
|
@@ -705,9 +707,10 @@ exports.Extension = Extension;
|
|
|
705
707
|
*/
|
|
706
708
|
class Component extends Extension {
|
|
707
709
|
init() {
|
|
708
|
-
super.composeNow();
|
|
710
|
+
const ret = super.composeNow();
|
|
709
711
|
this.ready();
|
|
710
712
|
super.applyOptionsNow();
|
|
713
|
+
return ret;
|
|
711
714
|
}
|
|
712
715
|
ready() {
|
|
713
716
|
super.ready();
|
package/lib-node/node/watch.js
CHANGED
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "Vasille - Safe. Fast. Powerful.",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"types": "types/index.d.ts",
|
|
6
|
-
"version": "2.3.
|
|
6
|
+
"version": "2.3.7",
|
|
7
7
|
"exports": {
|
|
8
8
|
"import": "./lib/index.js",
|
|
9
9
|
"browser": "./lib/index.js",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"@types/events": "3.0.0",
|
|
47
47
|
"@types/jest": "27.4.1",
|
|
48
48
|
"@types/jsdom": "16.2.14",
|
|
49
|
-
"@types/node": "
|
|
49
|
+
"@types/node": "^18.14.6",
|
|
50
50
|
"@typescript-eslint/eslint-plugin": "5.18.0",
|
|
51
51
|
"@typescript-eslint/parser": "5.18.0",
|
|
52
52
|
"es-check": "latest",
|
|
@@ -57,6 +57,6 @@
|
|
|
57
57
|
"prettier": "2.7.1",
|
|
58
58
|
"ts-jest": "27.1.4",
|
|
59
59
|
"tslint-config-prettier": "^1.18.0",
|
|
60
|
-
"typescript": "
|
|
60
|
+
"typescript": "^4.9.5"
|
|
61
61
|
}
|
|
62
62
|
}
|
package/types/core/core.d.ts
CHANGED
|
@@ -127,7 +127,7 @@ export declare class Reactive<T extends FragmentOptions = FragmentOptions> exten
|
|
|
127
127
|
protected applyOptions(input: T): void;
|
|
128
128
|
protected applyOptionsNow(): void;
|
|
129
129
|
protected compose(input: T): T['return'];
|
|
130
|
-
protected composeNow():
|
|
130
|
+
protected composeNow(): T['return'];
|
|
131
131
|
runFunctional<F extends (...args: any) => any>(f: F, ...args: Parameters<F>): ReturnType<F>;
|
|
132
132
|
runOnDestroy(func: () => void): void;
|
|
133
133
|
$destroy(): void;
|
|
@@ -3,10 +3,12 @@ import { AcceptedTagsMap, AcceptedTagsSpec } from "../spec/react";
|
|
|
3
3
|
import type { Fragment } from "../node/node";
|
|
4
4
|
export interface FragmentOptions {
|
|
5
5
|
"v:is"?: Record<string, IValue<any>>;
|
|
6
|
-
return?:
|
|
6
|
+
return?: {
|
|
7
|
+
[key: string]: any;
|
|
8
|
+
};
|
|
7
9
|
slot?: (node: Fragment, ...args: any[]) => void;
|
|
8
10
|
}
|
|
9
|
-
export
|
|
11
|
+
export type AttrType<T> = IValue<T | string | null> | T | string | null | undefined;
|
|
10
12
|
export interface TagOptions<T extends keyof AcceptedTagsMap> extends FragmentOptions {
|
|
11
13
|
"v:attr"?: {
|
|
12
14
|
[K in keyof AcceptedTagsSpec[T]['attrs']]?: AttrType<AcceptedTagsSpec[T]['attrs'][K]>;
|
package/types/node/node.d.ts
CHANGED
|
@@ -75,7 +75,7 @@ export declare class Fragment<T extends FragmentOptions = FragmentOptions> exten
|
|
|
75
75
|
*/
|
|
76
76
|
preinit(app: AppNode, parent: Fragment, data?: unknown): void;
|
|
77
77
|
init(): T['return'];
|
|
78
|
-
protected compose(input: T):
|
|
78
|
+
protected compose(input: T): T['return'];
|
|
79
79
|
/** To be overloaded: ready event handler */
|
|
80
80
|
ready(): void;
|
|
81
81
|
/**
|
|
@@ -296,7 +296,7 @@ export interface TagOptionsWithSlot<K extends keyof AcceptedTagsMap> extends Tag
|
|
|
296
296
|
export declare class Tag<K extends keyof AcceptedTagsMap> extends INode<TagOptionsWithSlot<K>> {
|
|
297
297
|
constructor(input: TagOptionsWithSlot<K>);
|
|
298
298
|
preinit(app: AppNode, parent: Fragment, tagName?: string): void;
|
|
299
|
-
protected compose(input: TagOptionsWithSlot<K>):
|
|
299
|
+
protected compose(input: TagOptionsWithSlot<K>): TagOptionsWithSlot<K>['return'];
|
|
300
300
|
protected findFirstChild(): Node;
|
|
301
301
|
insertAdjacent(node: Node): void;
|
|
302
302
|
appendNode(node: Node): void;
|
|
@@ -326,7 +326,7 @@ export declare class Extension<T extends TagOptions<any> = TagOptions<any>> exte
|
|
|
326
326
|
* @extends Extension
|
|
327
327
|
*/
|
|
328
328
|
export declare class Component<T extends TagOptions<any>> extends Extension<T> {
|
|
329
|
-
init():
|
|
329
|
+
init(): T['return'];
|
|
330
330
|
ready(): void;
|
|
331
331
|
preinit(app: AppNode, parent: Fragment): void;
|
|
332
332
|
}
|
package/types/node/watch.d.ts
CHANGED
|
@@ -12,6 +12,6 @@ interface WatchOptions<T> extends FragmentOptions {
|
|
|
12
12
|
*/
|
|
13
13
|
export declare class Watch<T> extends Fragment<WatchOptions<T>> {
|
|
14
14
|
input: WatchOptions<T>;
|
|
15
|
-
compose(input: WatchOptions<T>):
|
|
15
|
+
compose(input: WatchOptions<T>): WatchOptions<T>['return'];
|
|
16
16
|
}
|
|
17
17
|
export {};
|
package/types/spec/html.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type EventHandler<T> = (ev: T) => any;
|
|
2
2
|
export interface Tag<Attrs, Events> {
|
|
3
3
|
attrs: Attrs;
|
|
4
4
|
events: Events;
|
|
5
5
|
}
|
|
6
|
-
|
|
6
|
+
type TagEvents = {
|
|
7
7
|
[K in keyof HTMLElementEventMap]: EventHandler<HTMLElementEventMap[K]> | undefined;
|
|
8
8
|
};
|
|
9
9
|
interface TagAttrs {
|
|
@@ -40,10 +40,10 @@ interface MediaTagAttrs extends TagAttrs {
|
|
|
40
40
|
muted: boolean;
|
|
41
41
|
controls: boolean;
|
|
42
42
|
}
|
|
43
|
-
|
|
43
|
+
type MediaEvents = {
|
|
44
44
|
[K in keyof HTMLMediaElementEventMap]: EventHandler<HTMLMediaElementEventMap[K]> | undefined;
|
|
45
45
|
};
|
|
46
|
-
|
|
46
|
+
type VideoEvents = {
|
|
47
47
|
[K in keyof HTMLVideoElementEventMap]: EventHandler<HTMLVideoElementEventMap[K]> | undefined;
|
|
48
48
|
};
|
|
49
49
|
interface BaseAttrs extends TagAttrs {
|
|
@@ -77,7 +77,7 @@ interface StyleAttrs extends TagAttrs {
|
|
|
77
77
|
media: string;
|
|
78
78
|
blocking: string;
|
|
79
79
|
}
|
|
80
|
-
|
|
80
|
+
type BodyEvents = {
|
|
81
81
|
[K in keyof HTMLBodyElementEventMap]: EventHandler<HTMLBodyElementEventMap[K]> | undefined;
|
|
82
82
|
};
|
|
83
83
|
interface BlockQuoteAttrs extends TagAttrs {
|
|
@@ -434,7 +434,7 @@ export interface HtmlTagMap {
|
|
|
434
434
|
"wbr": Tag<TagAttrs, TagEvents>;
|
|
435
435
|
[K: string]: Tag<TagAttrs, TagEvents>;
|
|
436
436
|
}
|
|
437
|
-
|
|
437
|
+
type HtmlOrSvgTag = HTMLElement | SVGElement;
|
|
438
438
|
export interface HtmlAndSvgEvents {
|
|
439
439
|
onabort?: ((this: HtmlOrSvgTag, ev: UIEvent) => any) | null;
|
|
440
440
|
onanimationcancel?: ((this: HtmlOrSvgTag, ev: AnimationEvent) => any) | null;
|
package/types/spec/react.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { SvgTagMap, SvgTagNameMap } from "./svg";
|
|
2
2
|
import { HtmlTagMap, TagNameMap } from "./html";
|
|
3
|
-
export
|
|
4
|
-
export
|
|
3
|
+
export type AcceptedTagsMap = TagNameMap & SvgTagNameMap;
|
|
4
|
+
export type AcceptedTagsSpec = HtmlTagMap & SvgTagMap;
|
package/types/spec/svg.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EventHandler, HtmlAndSvgEvents, Tag } from "./html";
|
|
2
|
-
|
|
2
|
+
type SvgEvents = {
|
|
3
3
|
[K in keyof SVGElementEventMap]: EventHandler<SVGElementEventMap[K]> | undefined;
|
|
4
4
|
};
|
|
5
5
|
interface SvgAreaAttrs {
|
|
@@ -239,7 +239,7 @@ export interface SvgTagMap {
|
|
|
239
239
|
"use": Tag<SvgUseAttrs, SvgEvents>;
|
|
240
240
|
"view": Tag<SvgViewAttrs, SvgEvents>;
|
|
241
241
|
}
|
|
242
|
-
|
|
242
|
+
type SvgTag = HtmlAndSvgEvents;
|
|
243
243
|
interface SvgATag extends SvgTag {
|
|
244
244
|
rel: string;
|
|
245
245
|
}
|
|
@@ -8,5 +8,5 @@ import { Fragment } from "../node/node";
|
|
|
8
8
|
*/
|
|
9
9
|
export declare class ArrayView<T> extends BaseView<T, T, ArrayModel<T>> {
|
|
10
10
|
createChild(input: BSO<T, T, ArrayModel<T>>, id: T, item: T, before?: Fragment): any;
|
|
11
|
-
protected compose(input: BSO<T, T, ArrayModel<T>>):
|
|
11
|
+
protected compose(input: BSO<T, T, ArrayModel<T>>): {};
|
|
12
12
|
}
|
|
@@ -31,5 +31,5 @@ export declare class BaseView<K, T, Model extends ListenableModel<K, T>> extends
|
|
|
31
31
|
protected $: BaseViewPrivate<K, T>;
|
|
32
32
|
input: BSO<K, T, Model>;
|
|
33
33
|
constructor(input: BSO<K, T, Model>, $?: BaseViewPrivate<K, T>);
|
|
34
|
-
protected compose(input: BSO<K, T, Model>):
|
|
34
|
+
protected compose(input: BSO<K, T, Model>): {};
|
|
35
35
|
}
|
|
@@ -6,5 +6,5 @@ import { MapModel } from "../models/map-model";
|
|
|
6
6
|
* @extends BaseView
|
|
7
7
|
*/
|
|
8
8
|
export declare class MapView<K, T> extends BaseView<K, T, MapModel<K, T>> {
|
|
9
|
-
protected compose(input: BSO<K, T, MapModel<K, T>>):
|
|
9
|
+
protected compose(input: BSO<K, T, MapModel<K, T>>): {};
|
|
10
10
|
}
|
|
@@ -6,5 +6,5 @@ import { ObjectModel } from "../models/object-model";
|
|
|
6
6
|
* @extends BaseView
|
|
7
7
|
*/
|
|
8
8
|
export declare class ObjectView<T> extends BaseView<string, T, ObjectModel<T>> {
|
|
9
|
-
protected compose(input: BSO<string, T, ObjectModel<T>>):
|
|
9
|
+
protected compose(input: BSO<string, T, ObjectModel<T>>): {};
|
|
10
10
|
}
|