verstak 0.22.500 → 0.22.504

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 (66) hide show
  1. package/build/dist/source/api.d.ts +2 -2
  2. package/build/dist/source/api.js +2 -2
  3. package/build/dist/source/archive/RxDomV1.d.ts +1 -1
  4. package/build/dist/source/archive/RxDomV1.js +13 -13
  5. package/build/dist/source/core/Allocator.d.ts +64 -0
  6. package/build/dist/source/core/Allocator.js +141 -0
  7. package/build/dist/source/core/CellRange.d.ts +8 -0
  8. package/build/dist/source/core/CellRange.js +173 -0
  9. package/build/dist/source/core/Kernel.d.ts +82 -0
  10. package/build/dist/source/core/Kernel.js +559 -0
  11. package/build/dist/source/core/Restyler.js +1 -1
  12. package/build/dist/source/core/api.d.ts +5 -5
  13. package/build/dist/source/core/api.js +5 -5
  14. package/build/dist/source/html/Blocks.d.ts +13 -0
  15. package/build/dist/source/html/Blocks.js +121 -0
  16. package/build/dist/source/html/HtmlApiExt.d.ts +1 -1
  17. package/build/dist/source/html/HtmlApiExt.js +3 -3
  18. package/build/dist/source/html/HtmlBlocks.d.ts +175 -0
  19. package/build/dist/source/html/HtmlBlocks.js +356 -0
  20. package/build/dist/source/html/HtmlDriver.d.ts +20 -0
  21. package/build/dist/source/html/{HtmlNodeFactory.js → HtmlDriver.js} +25 -23
  22. package/build/dist/source/html/ReactingFocuser.d.ts +2 -0
  23. package/build/dist/source/html/ReactingFocuser.js +16 -0
  24. package/build/dist/source/html/api.d.ts +18 -17
  25. package/build/dist/source/html/api.js +18 -17
  26. package/build/dist/source/html/sensors/BasePointerSensor.d.ts +4 -4
  27. package/build/dist/source/html/sensors/BasePointerSensor.js +2 -2
  28. package/build/dist/source/html/sensors/ButtonSensor.d.ts +3 -3
  29. package/build/dist/source/html/sensors/ButtonSensor.js +17 -17
  30. package/build/dist/source/html/sensors/DataForSensor.js +6 -6
  31. package/build/dist/source/html/sensors/FocusSensor.d.ts +3 -3
  32. package/build/dist/source/html/sensors/FocusSensor.js +27 -27
  33. package/build/dist/source/html/sensors/HoverSensor.d.ts +1 -1
  34. package/build/dist/source/html/sensors/HoverSensor.js +9 -9
  35. package/build/dist/source/html/sensors/HtmlDragSensor.d.ts +6 -6
  36. package/build/dist/source/html/sensors/HtmlDragSensor.js +28 -28
  37. package/build/dist/source/html/sensors/HtmlElementSensor.d.ts +3 -3
  38. package/build/dist/source/html/sensors/HtmlElementSensor.js +4 -4
  39. package/build/dist/source/html/sensors/HtmlSensors.d.ts +9 -9
  40. package/build/dist/source/html/sensors/HtmlSensors.js +10 -10
  41. package/build/dist/source/html/sensors/KeyboardSensor.d.ts +1 -1
  42. package/build/dist/source/html/sensors/KeyboardSensor.js +18 -18
  43. package/build/dist/source/html/sensors/PointerSensor.d.ts +4 -4
  44. package/build/dist/source/html/sensors/PointerSensor.js +20 -20
  45. package/build/dist/source/html/sensors/ResizeSensor.d.ts +3 -3
  46. package/build/dist/source/html/sensors/ResizeSensor.js +13 -13
  47. package/build/dist/source/html/sensors/Sensor.d.ts +1 -1
  48. package/build/dist/source/html/sensors/Sensor.js +1 -1
  49. package/build/dist/source/html/sensors/WheelSensor.d.ts +1 -1
  50. package/build/dist/source/html/sensors/WheelSensor.js +7 -7
  51. package/build/dist/source/html/sensors/WindowSensor.d.ts +2 -2
  52. package/build/dist/source/html/sensors/WindowSensor.js +5 -5
  53. package/package.json +7 -7
  54. package/build/dist/source/core/Block.d.ts +0 -62
  55. package/build/dist/source/core/Block.js +0 -431
  56. package/build/dist/source/core/Elements.d.ts +0 -3
  57. package/build/dist/source/core/Elements.js +0 -7
  58. package/build/dist/source/core/Layout.d.ts +0 -27
  59. package/build/dist/source/core/Layout.js +0 -259
  60. package/build/dist/source/html/Cluster.d.ts +0 -11
  61. package/build/dist/source/html/Cluster.js +0 -14
  62. package/build/dist/source/html/HtmlElements.d.ts +0 -349
  63. package/build/dist/source/html/HtmlElements.js +0 -529
  64. package/build/dist/source/html/HtmlNodeFactory.d.ts +0 -19
  65. package/build/dist/source/html/RxFocuser.d.ts +0 -2
  66. package/build/dist/source/html/RxFocuser.js +0 -11
@@ -1,259 +0,0 @@
1
- export class Layout {
2
- constructor() {
3
- this.maxColumnCount = 0;
4
- this.maxRowCount = 0;
5
- this.actualColumnCount = 0;
6
- this.actualRowCount = 0;
7
- this.columnCursor = 0;
8
- this.rowCursor = 0;
9
- this.newRowCursor = 0;
10
- }
11
- reset(maxColumnCount, maxRowCount) {
12
- this.maxColumnCount = maxColumnCount;
13
- this.maxRowCount = maxRowCount;
14
- this.actualColumnCount = 0;
15
- this.actualRowCount = 0;
16
- this.columnCursor = 0;
17
- this.rowCursor = 0;
18
- this.newRowCursor = 0;
19
- }
20
- claim(p, result) {
21
- var _a, _b;
22
- const maxColumnCount = this.maxColumnCount !== 0 ? this.maxColumnCount : this.actualColumnCount;
23
- const maxRowCount = this.maxRowCount !== 0 ? this.maxRowCount : this.actualRowCount;
24
- if (p.area) {
25
- Layout.parseCellRange(p.area, result);
26
- absolutizeCellRange(result, this.columnCursor + 1, this.rowCursor + 1, maxColumnCount, maxRowCount, result);
27
- }
28
- else {
29
- if (p.lineBegin) {
30
- this.columnCursor = 0;
31
- this.rowCursor = this.newRowCursor;
32
- }
33
- let w = (_a = p.columns) !== null && _a !== void 0 ? _a : 1;
34
- if (w === 0)
35
- w = maxColumnCount;
36
- if (w >= 0) {
37
- result.x1 = this.columnCursor + 1;
38
- result.x2 = absolutizePosition(result.x1 + w, 0, maxColumnCount);
39
- if (p.cursorRight !== false)
40
- this.columnCursor = result.x2;
41
- }
42
- else {
43
- result.x1 = Math.max(this.columnCursor + w, 1);
44
- result.x2 = this.columnCursor;
45
- }
46
- let h = (_b = p.rows) !== null && _b !== void 0 ? _b : 1;
47
- if (h === 0)
48
- h = maxRowCount;
49
- if (h >= 0) {
50
- result.y1 = this.rowCursor + 1;
51
- result.y2 = absolutizePosition(result.y1 + h, 0, maxRowCount);
52
- if (p.cursorDown !== false && result.y2 > this.newRowCursor)
53
- this.newRowCursor = result.y2;
54
- }
55
- else {
56
- result.y1 = Math.max(this.rowCursor + h, 1);
57
- result.y2 = this.rowCursor;
58
- }
59
- }
60
- return result;
61
- }
62
- static parseCellRange(text, result) {
63
- let i = 0;
64
- let value = 0;
65
- let sign = 1;
66
- let component = 0;
67
- while (i < text.length) {
68
- const charCode = text.charCodeAt(i);
69
- if (isCapitalLetter(charCode)) {
70
- if (component % 2 === 0)
71
- value = value * 26 + charCode - 64;
72
- else
73
- console.error(`Digit is expected, but letter ('${text[i]}') was read`);
74
- }
75
- else if (isLowercaseLetter(charCode)) {
76
- if (component % 2 === 0) {
77
- value = value * 26 + charCode - 96;
78
- }
79
- else {
80
- console.error(`Digit is expected, but letter ('${text[i]}') was read`);
81
- }
82
- }
83
- else if (isDigit(charCode)) {
84
- if (component % 2 === 0) {
85
- if (value !== 0) {
86
- if (component === 0)
87
- result.x1 = value * sign;
88
- else
89
- result.x2 = value * sign;
90
- value = 0;
91
- }
92
- component++;
93
- }
94
- value = value * 10 + charCode - 48;
95
- }
96
- else if (charCode === 40) {
97
- if (component === 0)
98
- result.x1 = value * sign;
99
- else if (component === 2)
100
- result.x2 = value * sign;
101
- if (sign > 0) {
102
- sign = -1;
103
- component &= ~1;
104
- value = 0;
105
- }
106
- else {
107
- console.error('Sign must not be negative');
108
- }
109
- }
110
- else if (charCode === 41) {
111
- if (sign > 0) {
112
- console.error('Sign must be negative');
113
- }
114
- switch (component) {
115
- case 0:
116
- result.x1 = value * sign;
117
- break;
118
- case 1:
119
- result.y1 = value * sign;
120
- break;
121
- case 2:
122
- result.x2 = value * sign;
123
- break;
124
- case 3:
125
- result.y2 = value * sign;
126
- break;
127
- }
128
- sign = 1;
129
- value = 0;
130
- component++;
131
- }
132
- else if (charCode === 58) {
133
- if (sign < 0)
134
- console.error(`area '${text}': e1`);
135
- if (component === 1)
136
- result.y1 = value * sign;
137
- else if (component !== 2)
138
- console.error(`area '${text}': [e2] component = ${component}`);
139
- component = 2;
140
- value = 0;
141
- }
142
- else if (isWhitespace(charCode)) {
143
- }
144
- else {
145
- console.error(`Unknown symbol '${text[i]}' in '${text}'`);
146
- }
147
- i++;
148
- }
149
- if (value !== 0) {
150
- switch (component) {
151
- case 0: {
152
- result.x1 = value * sign;
153
- if (sign < 0 && result.y1 === 0)
154
- result.y1 = sign;
155
- break;
156
- }
157
- case 1: {
158
- if (sign < 0 && result.x1 === 0)
159
- result.x1 = sign;
160
- result.y1 = value * sign;
161
- break;
162
- }
163
- case 2: {
164
- result.x2 = value * sign;
165
- if (sign < 0 && result.y2 === 0)
166
- result.y2 = sign;
167
- break;
168
- }
169
- case 3: {
170
- if (sign < 0 && result.x2 === 0)
171
- result.x2 = sign;
172
- result.y2 = value * sign;
173
- break;
174
- }
175
- }
176
- }
177
- else if (sign < 0) {
178
- if (component === 0) {
179
- if (result.x1 === 0)
180
- result.x1 = sign;
181
- if (result.y1 === 0)
182
- result.y1 = sign;
183
- }
184
- else {
185
- if (result.x2 === 0)
186
- result.x2 = sign;
187
- if (result.y2 === 0)
188
- result.y2 = sign;
189
- }
190
- }
191
- return result;
192
- }
193
- static emitCellRange(value) {
194
- const p1 = emitCellPosition(value.x1, value.y1);
195
- const p2 = emitCellPosition(value.x2, value.y2);
196
- return `${p1}${p2 !== '' ? `:${p2}` : ''}`;
197
- }
198
- }
199
- function isWhitespace(char) {
200
- return char === 32 || (char >= 9 && char <= 13) || char === 133 || char === 160;
201
- }
202
- function isDigit(input, index) {
203
- return 48 <= input && input <= 57;
204
- }
205
- function isCapitalLetter(ch) {
206
- return 65 <= ch && ch <= 90;
207
- }
208
- function isLowercaseLetter(ch) {
209
- return 97 <= ch && ch <= 122;
210
- }
211
- function emitLetters(n) {
212
- if (n < 0)
213
- throw new Error(`emitLetters: argument (${n}) should not be negative or zero`);
214
- let result = '';
215
- while (n >= 0) {
216
- const r = n % 26;
217
- n = Math.floor(n / 26) - 1;
218
- result = String.fromCharCode(65 + r) + result;
219
- }
220
- return result;
221
- }
222
- function emitCellPosition(x, y) {
223
- let result = '';
224
- if (x > 0 && y > 0)
225
- result = `${emitLetters(x - 1)}${y}`;
226
- else if (x > 0 && y < 0)
227
- result = `${emitLetters(x - 1)}(${-y})`;
228
- else if (x < 0 && y > 0)
229
- result = `(${emitLetters(-x - 1)})${y}`;
230
- else if (x < 0 && y < 0)
231
- result = `(${emitLetters(-x - 1)}${-y})`;
232
- else
233
- result = '';
234
- return result;
235
- }
236
- function absolutizeCellRange(area, cursorX, cursorY, maxWidth, maxHeight, result) {
237
- const x1 = absolutizePosition(area.x1, cursorX, maxWidth);
238
- const x2 = absolutizePosition(area.x2, cursorX, maxWidth);
239
- if (x1 <= x2)
240
- result.x1 = x1, result.x2 = x2;
241
- else
242
- result.x1 = x2, result.x2 = x1;
243
- const y1 = absolutizePosition(area.y1, cursorY, maxHeight);
244
- const y2 = absolutizePosition(area.y2, cursorY, maxHeight);
245
- if (y1 <= y2)
246
- result.y1 = y1, result.y2 = y2;
247
- else
248
- result.y1 = y2, result.y2 = y1;
249
- return result;
250
- }
251
- function absolutizePosition(pos, cursor, max) {
252
- if (pos === 0)
253
- pos = cursor;
254
- else if (pos < 0)
255
- pos = Math.max(max + pos, 1);
256
- else
257
- pos = Math.min(pos, max);
258
- return pos;
259
- }
@@ -1,11 +0,0 @@
1
- import { Block, Render, Place, BlockOptions } from '../core/api';
2
- export interface ElasticSize {
3
- line: string | number;
4
- min?: string;
5
- max?: string;
6
- growth?: number;
7
- }
8
- export declare function InlBlock<M = unknown, R = void>(name: string, options: BlockOptions<Place> | undefined, renderer: Render<HTMLDivElement, M, Place, R>): Block<HTMLDivElement, M, Place, R>;
9
- export declare function RxBlock<M = unknown, R = void>(name: string, options: BlockOptions<Place> | undefined, renderer: Render<HTMLDivElement, M, Place, R>): Block<HTMLDivElement, M, Place, R>;
10
- export declare function InlCluster<M = unknown, R = void>(name: string, options: BlockOptions | undefined, renderer: Render<HTMLDivElement, M, void, R>): Block<HTMLDivElement, M, void, R>;
11
- export declare function RxCluster<M = unknown, R = void>(name: string, options: BlockOptions | undefined, renderer: Render<HTMLDivElement, M, void, R>): Block<HTMLDivElement, M, void, R>;
@@ -1,14 +0,0 @@
1
- import { Reaction, Inline } from '../core/api';
2
- import { Div, RxDiv } from './HtmlElements';
3
- export function InlBlock(name, options, renderer) {
4
- return Div(name, options, renderer);
5
- }
6
- export function RxBlock(name, options, renderer) {
7
- return RxDiv(name, options, renderer);
8
- }
9
- export function InlCluster(name, options, renderer) {
10
- return Inline(name, options, renderer);
11
- }
12
- export function RxCluster(name, options, renderer) {
13
- return Reaction(name, options, renderer);
14
- }