vasille 1.2.6 → 2.0.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.
Files changed (122) hide show
  1. package/LICENSE.md +21 -0
  2. package/flow-typed/vasille.js +836 -0
  3. package/img/favicon.svg +17 -204
  4. package/lib/binding/attribute.js +32 -0
  5. package/lib/binding/binding.js +39 -0
  6. package/lib/binding/class.js +51 -0
  7. package/lib/binding/style.js +29 -0
  8. package/lib/core/core.js +178 -0
  9. package/lib/core/destroyable.js +45 -0
  10. package/lib/core/errors.js +16 -0
  11. package/lib/core/executor.js +154 -0
  12. package/lib/core/ivalue.js +56 -0
  13. package/lib/core/signal.js +50 -0
  14. package/lib/core/slot.js +47 -0
  15. package/lib/index.js +27 -22
  16. package/lib/models/array-model.js +208 -0
  17. package/lib/models/listener.js +130 -0
  18. package/lib/models/map-model.js +66 -0
  19. package/lib/models/model.js +1 -0
  20. package/lib/models/object-model.js +78 -0
  21. package/lib/models/set-model.js +62 -0
  22. package/lib/node/app.js +38 -0
  23. package/lib/node/interceptor.js +83 -0
  24. package/lib/node/node.js +1185 -0
  25. package/lib/node/watch.js +27 -0
  26. package/lib/value/expression.js +83 -0
  27. package/lib/value/mirror.js +58 -0
  28. package/lib/value/pointer.js +26 -0
  29. package/lib/value/reference.js +55 -0
  30. package/lib/views/array-view.js +24 -0
  31. package/lib/views/base-view.js +49 -0
  32. package/lib/views/map-view.js +20 -0
  33. package/lib/views/object-view.js +20 -0
  34. package/lib/views/repeat-node.js +106 -0
  35. package/lib/views/repeater.js +63 -0
  36. package/lib/views/set-view.js +23 -0
  37. package/package.json +16 -15
  38. package/types/binding/attribute.d.ts +23 -0
  39. package/types/binding/binding.d.ts +30 -0
  40. package/types/binding/class.d.ts +23 -0
  41. package/types/binding/style.d.ts +23 -0
  42. package/types/core/core.d.ts +140 -0
  43. package/types/core/destroyable.d.ts +15 -0
  44. package/types/core/errors.d.ts +4 -0
  45. package/types/core/executor.d.ts +87 -0
  46. package/types/core/ivalue.d.ts +45 -0
  47. package/types/core/signal.d.ts +35 -0
  48. package/types/core/slot.d.ts +45 -0
  49. package/types/index.d.ts +27 -21
  50. package/types/models/array-model.d.ts +103 -0
  51. package/types/models/listener.d.ts +74 -0
  52. package/types/models/map-model.d.ts +35 -0
  53. package/types/models/model.d.ts +19 -0
  54. package/types/models/object-model.d.ts +36 -0
  55. package/types/models/set-model.d.ts +34 -0
  56. package/types/node/app.d.ts +37 -0
  57. package/types/node/interceptor.d.ts +50 -0
  58. package/types/node/node.d.ts +739 -0
  59. package/types/node/watch.d.ts +23 -0
  60. package/types/value/expression.d.ts +60 -0
  61. package/types/value/mirror.d.ts +35 -0
  62. package/types/value/pointer.d.ts +19 -0
  63. package/types/value/reference.d.ts +30 -0
  64. package/types/views/array-view.d.ts +13 -0
  65. package/types/views/base-view.d.ts +44 -0
  66. package/types/views/map-view.d.ts +11 -0
  67. package/types/views/object-view.d.ts +11 -0
  68. package/types/views/repeat-node.d.ts +35 -0
  69. package/types/views/repeater.d.ts +38 -0
  70. package/types/views/set-view.d.ts +11 -0
  71. package/CHANGELOG.md +0 -23
  72. package/lib/attribute.js +0 -71
  73. package/lib/attribute.js.map +0 -1
  74. package/lib/bind.js +0 -286
  75. package/lib/bind.js.map +0 -1
  76. package/lib/class.js +0 -97
  77. package/lib/class.js.map +0 -1
  78. package/lib/executor.js +0 -167
  79. package/lib/executor.js.map +0 -1
  80. package/lib/index.js.map +0 -1
  81. package/lib/interfaces/core.js +0 -247
  82. package/lib/interfaces/core.js.map +0 -1
  83. package/lib/interfaces/destroyable.js +0 -39
  84. package/lib/interfaces/destroyable.js.map +0 -1
  85. package/lib/interfaces/errors.js +0 -49
  86. package/lib/interfaces/errors.js.map +0 -1
  87. package/lib/interfaces/ibind.js +0 -31
  88. package/lib/interfaces/ibind.js.map +0 -1
  89. package/lib/interfaces/idefinition.js +0 -64
  90. package/lib/interfaces/idefinition.js.map +0 -1
  91. package/lib/interfaces/ivalue.js +0 -60
  92. package/lib/interfaces/ivalue.js.map +0 -1
  93. package/lib/models.js +0 -579
  94. package/lib/models.js.map +0 -1
  95. package/lib/node.js +0 -2155
  96. package/lib/node.js.map +0 -1
  97. package/lib/property.js +0 -38
  98. package/lib/property.js.map +0 -1
  99. package/lib/style.js +0 -66
  100. package/lib/style.js.map +0 -1
  101. package/lib/value.js +0 -203
  102. package/lib/value.js.map +0 -1
  103. package/lib/views.js +0 -688
  104. package/lib/views.js.map +0 -1
  105. package/types/attribute.d.ts +0 -18
  106. package/types/bind.d.ts +0 -72
  107. package/types/class.d.ts +0 -19
  108. package/types/data.d.ts +0 -11
  109. package/types/event.d.ts +0 -10
  110. package/types/executor.d.ts +0 -57
  111. package/types/interfaces/core.d.ts +0 -129
  112. package/types/interfaces/destroyable.d.ts +0 -11
  113. package/types/interfaces/errors.d.ts +0 -24
  114. package/types/interfaces/ibind.d.ts +0 -19
  115. package/types/interfaces/idefinition.d.ts +0 -29
  116. package/types/interfaces/ivalue.d.ts +0 -40
  117. package/types/models.d.ts +0 -179
  118. package/types/node.d.ts +0 -906
  119. package/types/property.d.ts +0 -9
  120. package/types/style.d.ts +0 -28
  121. package/types/value.d.ts +0 -43
  122. package/types/views.d.ts +0 -135
@@ -1,9 +0,0 @@
1
- /**
2
- * Constructs a property field value
3
- * @param value {?any} is the initial value of field
4
- * @param func {?Callable} is the function to calc filed value
5
- * @return {IValue} Given value or new generated
6
- */
7
- export function propertify(value?: any | null, func?: Callable | null): IValue;
8
- import { Callable } from "./interfaces/idefinition.js";
9
- import { IValue } from "./interfaces/ivalue.js";
package/types/style.d.ts DELETED
@@ -1,28 +0,0 @@
1
- /**
2
- * Constructs a style attribute value
3
- * @param rt {INode} The root node
4
- * @param ts {INode} The this node
5
- * @param name {String} The style attribute name
6
- * @param value {String | IValue | null} A value for attribute
7
- * @param func {?Callable} A getter of attribute value
8
- * @return {StyleBinding} A ready style binding
9
- */
10
- export function stylify(rt: any, ts: any, name: string, value?: string | IValue | null, func?: Callable | null): StyleBinding;
11
- /**
12
- * Describes a style attribute binding
13
- * @extends Binding
14
- */
15
- export class StyleBinding extends Binding {
16
- /**
17
- * Constructs a style binding attribute
18
- * @param rt {INode} is root component
19
- * @param ts {INode} is this component
20
- * @param name {string} is the name of style property
21
- * @param func {function} is the function to calc style value
22
- * @param values is the value to be synced
23
- */
24
- constructor(rt: any, ts: any, name: string, func: Function, ...values: any[]);
25
- }
26
- import { IValue } from "./interfaces/ivalue.js";
27
- import { Callable } from "./interfaces/idefinition.js";
28
- import { Binding } from "./bind.js";
package/types/value.d.ts DELETED
@@ -1,43 +0,0 @@
1
- /**
2
- * Declares a notifiable value
3
- * @implements IValue
4
- */
5
- export class Reference extends IValue implements IValue {
6
- /**
7
- * Constructs a notifiable value
8
- * @param value {any} is initial value
9
- */
10
- constructor(value: any);
11
- /**
12
- * The encapsulated value
13
- * @type {*}
14
- */
15
- value: any;
16
- /**
17
- * Array of handlers
18
- * @type {Set<Function>}
19
- */
20
- onchange: Set<Function>;
21
- }
22
- /**
23
- * Declares a notifiable bind to a value
24
- * @extends IValue
25
- */
26
- export class Pointer extends IValue {
27
- /**
28
- * Constructs a notifiable bind to a value
29
- * @param value {IValue} is initial value
30
- */
31
- constructor(value: IValue);
32
- /**
33
- * value of pointer
34
- * @type {IValue<*>}
35
- */
36
- value: any;
37
- /**
38
- * Collection of handlers
39
- * @type {Set<Function>}
40
- */
41
- onchange: Set<Function>;
42
- }
43
- import { IValue } from "./interfaces/ivalue.js";
package/types/views.d.ts DELETED
@@ -1,135 +0,0 @@
1
- export class RepeatNodePrivate extends BaseNodePrivate {
2
- /**
3
- * Children node hash
4
- * @type {Map<*, Extension>}
5
- */
6
- nodes: Map<any, Extension>;
7
- /**
8
- * Call-back function to create a children pack
9
- * @type {function(RepeatNodeItem, ?*) : void}
10
- */
11
- cb: (arg0: RepeatNodeItem, arg1: any | null) => void;
12
- }
13
- /**
14
- * Repeat node repeats its children
15
- */
16
- export class RepeatNode extends Extension {
17
- /**
18
- * Sets call-back function
19
- * @param cb {function(RepeatNodeItem, ?*) : void}
20
- */
21
- setCallback(cb: (arg0: RepeatNodeItem, arg1: any | null) => void): void;
22
- /**
23
- * Create a children pack
24
- * @param id {*} id of child pack
25
- * @param item {IValue<*>} value for children pack
26
- * @param before {VasilleNode} Node to insert before it
27
- */
28
- createChild(id: any, item: any, before: VasilleNode): void;
29
- /**
30
- * Destroy a old child
31
- * @param id {*} id of children pack
32
- * @param item {IValue<*>} value of children pack
33
- */
34
- destroyChild(id: any, item: any): void;
35
- }
36
- /**
37
- * Private part of repeater
38
- */
39
- export class RepeaterPrivate extends RepeatNodePrivate {
40
- /**
41
- * Handler to catch count updates
42
- * @type {Function}
43
- */
44
- updateHandler: Function;
45
- /**
46
- * Current count of child nodes
47
- * @type {number}
48
- */
49
- currentCount: number;
50
- /**
51
- * Order number is used like children pack value
52
- * @type {Array<IValue<number>>}
53
- */
54
- orderNumber: Array<IValue<number>>;
55
- }
56
- /**
57
- * The simplest repeat $node interpretation, repeat children pack a several times
58
- */
59
- export class Repeater extends RepeatNode {
60
- /**
61
- * The count of children
62
- * @type {IValue<number>}
63
- */
64
- count: any;
65
- /**
66
- * Changes the children count
67
- * @param number {number} The new children count
68
- */
69
- changeCount(number: number): void;
70
- }
71
- /**
72
- * Private part of BaseView
73
- */
74
- export class BaseViewPrivate extends RepeatNodePrivate {
75
- /**
76
- * Handler to catch values addition
77
- * @type {Function}
78
- */
79
- addHandler: Function;
80
- /**
81
- * Handler to catch values removes
82
- * @type {Function}
83
- */
84
- removeHandler: Function;
85
- }
86
- /**
87
- * Base class of default views
88
- */
89
- export class BaseView extends RepeatNode {
90
- /**
91
- * Property which will contain a model
92
- * @type {IValue<*>}
93
- */
94
- model: any;
95
- }
96
- /**
97
- * Private part of array view
98
- */
99
- export class ArrayViewPrivate extends BaseViewPrivate {
100
- /**
101
- * Contains handlers of each child
102
- * @type {Map<IValue<*>, Function>}
103
- */
104
- handlers: Map<IValue<any>, Function>;
105
- /**
106
- * Contains buffered children
107
- * @type {Array<string>}
108
- */
109
- buffer: Array<string>;
110
- }
111
- /**
112
- * Represents a view of a array model
113
- */
114
- export class ArrayView extends BaseView {
115
- }
116
- /**
117
- * Create a children pack for each object field
118
- */
119
- export class ObjectView extends BaseView {
120
- }
121
- /**
122
- * Create a children pack for each map value
123
- */
124
- export class MapView extends BaseView {
125
- }
126
- /**
127
- * Create a children pack for each set value
128
- */
129
- export class SetView extends BaseView {
130
- }
131
- import { BaseNodePrivate } from "./node.js";
132
- import { Extension } from "./node.js";
133
- import { RepeatNodeItem } from "./node.js";
134
- import { VasilleNode } from "./interfaces/core";
135
- import { IValue } from "./interfaces/ivalue.js";