vasille 1.2.9 → 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.
Files changed (133) hide show
  1. package/LICENSE.md +21 -0
  2. package/README.md +195 -129
  3. package/cdn/es2015.js +3231 -0
  4. package/cdn/es5.js +3675 -0
  5. package/flow-typed/vasille.js +839 -0
  6. package/lib/binding/attribute.js +32 -0
  7. package/lib/binding/binding.js +39 -0
  8. package/lib/binding/class.js +51 -0
  9. package/lib/binding/style.js +29 -0
  10. package/lib/core/core.js +186 -0
  11. package/lib/core/destroyable.js +45 -0
  12. package/lib/core/errors.js +16 -0
  13. package/lib/core/executor.js +154 -0
  14. package/lib/core/ivalue.js +56 -0
  15. package/lib/core/signal.js +50 -0
  16. package/lib/core/slot.js +47 -0
  17. package/lib/index.js +27 -22
  18. package/lib/models/array-model.js +208 -0
  19. package/lib/models/listener.js +130 -0
  20. package/lib/models/map-model.js +66 -0
  21. package/lib/models/model.js +1 -0
  22. package/lib/models/object-model.js +78 -0
  23. package/lib/models/set-model.js +62 -0
  24. package/lib/node/app.js +39 -0
  25. package/lib/node/interceptor.js +83 -0
  26. package/lib/node/node.js +1204 -0
  27. package/lib/node/watch.js +27 -0
  28. package/lib/value/expression.js +83 -0
  29. package/lib/value/mirror.js +58 -0
  30. package/lib/value/pointer.js +26 -0
  31. package/lib/value/reference.js +55 -0
  32. package/lib/views/array-view.js +21 -0
  33. package/lib/views/base-view.js +49 -0
  34. package/lib/views/map-view.js +19 -0
  35. package/lib/views/object-view.js +19 -0
  36. package/lib/views/repeat-node.js +106 -0
  37. package/lib/views/repeater.js +63 -0
  38. package/lib/views/set-view.js +22 -0
  39. package/package.json +26 -18
  40. package/types/binding/attribute.d.ts +23 -0
  41. package/types/binding/binding.d.ts +30 -0
  42. package/types/binding/class.d.ts +23 -0
  43. package/types/binding/style.d.ts +23 -0
  44. package/types/core/core.d.ts +144 -0
  45. package/types/core/destroyable.d.ts +15 -0
  46. package/types/core/errors.d.ts +4 -0
  47. package/types/core/executor.d.ts +87 -0
  48. package/types/core/ivalue.d.ts +45 -0
  49. package/types/core/signal.d.ts +35 -0
  50. package/types/core/slot.d.ts +45 -0
  51. package/types/index.d.ts +27 -21
  52. package/types/models/array-model.d.ts +103 -0
  53. package/types/models/listener.d.ts +74 -0
  54. package/types/models/map-model.d.ts +35 -0
  55. package/types/models/model.d.ts +19 -0
  56. package/types/models/object-model.d.ts +36 -0
  57. package/types/models/set-model.d.ts +34 -0
  58. package/types/node/app.d.ts +42 -0
  59. package/types/node/interceptor.d.ts +50 -0
  60. package/types/node/node.d.ts +741 -0
  61. package/types/node/watch.d.ts +23 -0
  62. package/types/value/expression.d.ts +60 -0
  63. package/types/value/mirror.d.ts +35 -0
  64. package/types/value/pointer.d.ts +19 -0
  65. package/types/value/reference.d.ts +30 -0
  66. package/types/views/array-view.d.ts +13 -0
  67. package/types/views/base-view.d.ts +43 -0
  68. package/types/views/map-view.d.ts +11 -0
  69. package/types/views/object-view.d.ts +11 -0
  70. package/types/views/repeat-node.d.ts +35 -0
  71. package/types/views/repeater.d.ts +38 -0
  72. package/types/views/set-view.d.ts +11 -0
  73. package/CHANGELOG.md +0 -23
  74. package/img/favicon.svg +0 -441
  75. package/img/getLocus.svg +0 -18
  76. package/img/logo.png +0 -0
  77. package/img/logo.svg +0 -550
  78. package/img/scores-o-log.png +0 -0
  79. package/img/scores-o.png +0 -0
  80. package/img/scores-wo-log.png +0 -0
  81. package/img/scores-wo.png +0 -0
  82. package/img/x1-x32.png +0 -0
  83. package/lib/attribute.js +0 -71
  84. package/lib/attribute.js.map +0 -1
  85. package/lib/bind.js +0 -286
  86. package/lib/bind.js.map +0 -1
  87. package/lib/class.js +0 -97
  88. package/lib/class.js.map +0 -1
  89. package/lib/executor.js +0 -167
  90. package/lib/executor.js.map +0 -1
  91. package/lib/index.js.map +0 -1
  92. package/lib/interfaces/core.js +0 -247
  93. package/lib/interfaces/core.js.map +0 -1
  94. package/lib/interfaces/destroyable.js +0 -39
  95. package/lib/interfaces/destroyable.js.map +0 -1
  96. package/lib/interfaces/errors.js +0 -49
  97. package/lib/interfaces/errors.js.map +0 -1
  98. package/lib/interfaces/ibind.js +0 -31
  99. package/lib/interfaces/ibind.js.map +0 -1
  100. package/lib/interfaces/idefinition.js +0 -64
  101. package/lib/interfaces/idefinition.js.map +0 -1
  102. package/lib/interfaces/ivalue.js +0 -60
  103. package/lib/interfaces/ivalue.js.map +0 -1
  104. package/lib/models.js +0 -579
  105. package/lib/models.js.map +0 -1
  106. package/lib/node.js +0 -2155
  107. package/lib/node.js.map +0 -1
  108. package/lib/property.js +0 -38
  109. package/lib/property.js.map +0 -1
  110. package/lib/style.js +0 -66
  111. package/lib/style.js.map +0 -1
  112. package/lib/value.js +0 -203
  113. package/lib/value.js.map +0 -1
  114. package/lib/views.js +0 -688
  115. package/lib/views.js.map +0 -1
  116. package/types/attribute.d.ts +0 -18
  117. package/types/bind.d.ts +0 -72
  118. package/types/class.d.ts +0 -19
  119. package/types/data.d.ts +0 -11
  120. package/types/event.d.ts +0 -10
  121. package/types/executor.d.ts +0 -57
  122. package/types/interfaces/core.d.ts +0 -129
  123. package/types/interfaces/destroyable.d.ts +0 -11
  124. package/types/interfaces/errors.d.ts +0 -24
  125. package/types/interfaces/ibind.d.ts +0 -19
  126. package/types/interfaces/idefinition.d.ts +0 -29
  127. package/types/interfaces/ivalue.d.ts +0 -40
  128. package/types/models.d.ts +0 -179
  129. package/types/node.d.ts +0 -906
  130. package/types/property.d.ts +0 -9
  131. package/types/style.d.ts +0 -28
  132. package/types/value.d.ts +0 -43
  133. 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";