verstak 0.22.412 → 0.22.503

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/README.md +3 -2
  2. package/build/dist/source/api.d.ts +2 -2
  3. package/build/dist/source/api.js +2 -2
  4. package/build/dist/source/archive/RxDomV1.d.ts +1 -1
  5. package/build/dist/source/archive/RxDomV1.js +13 -13
  6. package/build/dist/source/core/Allocator.d.ts +64 -0
  7. package/build/dist/source/core/Allocator.js +141 -0
  8. package/build/dist/source/core/CellRange.d.ts +8 -0
  9. package/build/dist/source/core/CellRange.js +173 -0
  10. package/build/dist/source/core/Kernel.d.ts +77 -0
  11. package/build/dist/source/core/Kernel.js +504 -0
  12. package/build/dist/source/core/Restyler.d.ts +2 -2
  13. package/build/dist/source/core/Restyler.js +4 -4
  14. package/build/dist/source/core/api.d.ts +5 -4
  15. package/build/dist/source/core/api.js +5 -4
  16. package/build/dist/source/html/Blocks.d.ts +14 -0
  17. package/build/dist/source/html/Blocks.js +124 -0
  18. package/build/dist/source/html/HtmlApiExt.d.ts +1 -1
  19. package/build/dist/source/html/HtmlApiExt.js +3 -3
  20. package/build/dist/source/html/HtmlBlocks.d.ts +175 -0
  21. package/build/dist/source/html/HtmlBlocks.js +356 -0
  22. package/build/dist/source/html/HtmlDriver.d.ts +20 -0
  23. package/build/dist/source/html/{HtmlNodeFactory.js → HtmlDriver.js} +36 -34
  24. package/build/dist/source/html/ReactingFocuser.d.ts +2 -0
  25. package/build/dist/source/html/ReactingFocuser.js +16 -0
  26. package/build/dist/source/html/api.d.ts +18 -18
  27. package/build/dist/source/html/api.js +18 -18
  28. package/build/dist/source/html/sensors/BasePointerSensor.d.ts +4 -4
  29. package/build/dist/source/html/sensors/BasePointerSensor.js +2 -2
  30. package/build/dist/source/html/sensors/ButtonSensor.d.ts +3 -3
  31. package/build/dist/source/html/sensors/ButtonSensor.js +17 -17
  32. package/build/dist/source/html/sensors/DataForSensor.js +6 -6
  33. package/build/dist/source/html/sensors/FocusSensor.d.ts +3 -3
  34. package/build/dist/source/html/sensors/FocusSensor.js +27 -27
  35. package/build/dist/source/html/sensors/HoverSensor.d.ts +1 -1
  36. package/build/dist/source/html/sensors/HoverSensor.js +9 -9
  37. package/build/dist/source/html/sensors/HtmlDragSensor.d.ts +6 -6
  38. package/build/dist/source/html/sensors/HtmlDragSensor.js +28 -28
  39. package/build/dist/source/html/sensors/HtmlElementSensor.d.ts +3 -3
  40. package/build/dist/source/html/sensors/HtmlElementSensor.js +4 -4
  41. package/build/dist/source/html/sensors/HtmlSensors.d.ts +9 -9
  42. package/build/dist/source/html/sensors/HtmlSensors.js +10 -10
  43. package/build/dist/source/html/sensors/KeyboardSensor.d.ts +1 -1
  44. package/build/dist/source/html/sensors/KeyboardSensor.js +18 -18
  45. package/build/dist/source/html/sensors/PointerSensor.d.ts +4 -4
  46. package/build/dist/source/html/sensors/PointerSensor.js +20 -20
  47. package/build/dist/source/html/sensors/ResizeSensor.d.ts +3 -3
  48. package/build/dist/source/html/sensors/ResizeSensor.js +5 -5
  49. package/build/dist/source/html/sensors/Sensor.d.ts +1 -1
  50. package/build/dist/source/html/sensors/Sensor.js +1 -1
  51. package/build/dist/source/html/sensors/WheelSensor.d.ts +1 -1
  52. package/build/dist/source/html/sensors/WheelSensor.js +7 -7
  53. package/build/dist/source/html/sensors/WindowSensor.d.ts +2 -2
  54. package/build/dist/source/html/sensors/WindowSensor.js +5 -5
  55. package/package.json +8 -8
  56. package/build/dist/source/core/Elements.d.ts +0 -4
  57. package/build/dist/source/core/Elements.js +0 -7
  58. package/build/dist/source/core/RxNode.d.ts +0 -59
  59. package/build/dist/source/core/RxNode.js +0 -426
  60. package/build/dist/source/html/CellRange.d.ts +0 -11
  61. package/build/dist/source/html/CellRange.js +0 -175
  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
@@ -0,0 +1,504 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ var __metadata = (this && this.__metadata) || function (k, v) {
8
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
+ };
10
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
11
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
12
+ return new (P || (P = Promise))(function (resolve, reject) {
13
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
14
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
15
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
16
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
17
+ });
18
+ };
19
+ import { reactive, nonreactive, Transaction, options, Reentrance, Rx, Collection } from "reactronic";
20
+ import { Allocator, To } from "./Allocator";
21
+ export var Priority;
22
+ (function (Priority) {
23
+ Priority[Priority["SyncP0"] = 0] = "SyncP0";
24
+ Priority[Priority["AsyncP1"] = 1] = "AsyncP1";
25
+ Priority[Priority["AsyncP2"] = 2] = "AsyncP2";
26
+ })(Priority || (Priority = {}));
27
+ export class VBlock {
28
+ baseRender() {
29
+ return callRenderFunctions(this);
30
+ }
31
+ get isInitialRendering() {
32
+ return this.stamp === 2;
33
+ }
34
+ static root(render) {
35
+ gSysRoot.instance.args.render = render;
36
+ prepareAndRunRender(gSysRoot, false, false);
37
+ }
38
+ static get current() {
39
+ return gContext.instance;
40
+ }
41
+ static renderNestedTreesThenDo(action) {
42
+ runRenderNestedTreesThenDo(undefined, action);
43
+ }
44
+ static runForAllBlocks(action) {
45
+ forEachChildRecursively(gSysRoot, action);
46
+ }
47
+ static claim(name, args, driver) {
48
+ var _a, _b;
49
+ let result;
50
+ const owner = gContext.instance;
51
+ const children = owner.children;
52
+ let existing = undefined;
53
+ driver !== null && driver !== void 0 ? driver : (driver = AbstractDriver.group);
54
+ name || (name = `${++owner.numerator}`);
55
+ if (driver.isLine) {
56
+ const last = children.lastClaimedItem();
57
+ if (((_a = last === null || last === void 0 ? void 0 : last.instance) === null || _a === void 0 ? void 0 : _a.driver) === driver)
58
+ existing = last;
59
+ }
60
+ existing !== null && existing !== void 0 ? existing : (existing = children.claim(name));
61
+ if (existing) {
62
+ result = existing.instance;
63
+ if (result.driver !== driver && driver !== undefined)
64
+ throw new Error(`changing block driver is not yet supported: "${result.driver.name}" -> "${driver === null || driver === void 0 ? void 0 : driver.name}"`);
65
+ const exTriggers = (_b = result.args) === null || _b === void 0 ? void 0 : _b.triggers;
66
+ if (triggersAreEqual(args.triggers, exTriggers))
67
+ args.triggers = exTriggers;
68
+ result.args = args;
69
+ }
70
+ else {
71
+ result = new VBlockImpl(name, driver, owner, args);
72
+ result.item = children.add(result);
73
+ VBlockImpl.grandCount++;
74
+ if (args.reacting)
75
+ VBlockImpl.disposableCount++;
76
+ }
77
+ return result;
78
+ }
79
+ static getDefaultLoggingOptions() {
80
+ return VBlockImpl.logging;
81
+ }
82
+ static setDefaultLoggingOptions(logging) {
83
+ VBlockImpl.logging = logging;
84
+ }
85
+ }
86
+ VBlock.shortFrameDuration = 16;
87
+ VBlock.longFrameDuration = 300;
88
+ VBlock.currentRenderingPriority = Priority.SyncP0;
89
+ VBlock.frameDuration = VBlock.longFrameDuration;
90
+ export var LayoutKind;
91
+ (function (LayoutKind) {
92
+ LayoutKind[LayoutKind["Block"] = 0] = "Block";
93
+ LayoutKind[LayoutKind["Grid"] = 1] = "Grid";
94
+ LayoutKind[LayoutKind["Line"] = 2] = "Line";
95
+ LayoutKind[LayoutKind["Group"] = 3] = "Group";
96
+ LayoutKind[LayoutKind["Text"] = 4] = "Text";
97
+ })(LayoutKind || (LayoutKind = {}));
98
+ const createDefaultAllocator = () => new Allocator();
99
+ export class AbstractDriver {
100
+ constructor(name, layout, createAllocator) {
101
+ this.name = name;
102
+ this.layout = layout;
103
+ this.createAllocator = createAllocator !== null && createAllocator !== void 0 ? createAllocator : createDefaultAllocator;
104
+ }
105
+ get isSequential() { return (this.layout & 1) === 0; }
106
+ get isAuxiliary() { return (this.layout & 2) === 2; }
107
+ get isBlock() { return this.layout === LayoutKind.Block; }
108
+ get isGrid() { return this.layout === LayoutKind.Grid; }
109
+ get isLine() { return this.layout === LayoutKind.Line; }
110
+ initialize(block, native) {
111
+ const b = block;
112
+ b.native = native;
113
+ }
114
+ finalize(block, isLeader) {
115
+ const b = block;
116
+ b.native = undefined;
117
+ return isLeader;
118
+ }
119
+ deploy(block, sequential) {
120
+ }
121
+ arrange(block, place, heightGrab) {
122
+ var _a, _b, _c;
123
+ const b = block;
124
+ if (heightGrab === undefined) {
125
+ b.place = place;
126
+ const host = b.host;
127
+ if (host.driver.isLine) {
128
+ const grab = (_a = place === null || place === void 0 ? void 0 : place.heightGrab) !== null && _a !== void 0 ? _a : 0;
129
+ if (grab > 0 && ((_c = (_b = host.place) === null || _b === void 0 ? void 0 : _b.heightGrab) !== null && _c !== void 0 ? _c : 0) < grab)
130
+ host.driver.arrange(host, undefined, grab);
131
+ }
132
+ }
133
+ else if (heightGrab > 0) {
134
+ if (b.place === undefined)
135
+ b.place = {
136
+ exact: undefined,
137
+ widthMin: "", widthMax: "", widthGrab: 0,
138
+ heightMin: "", heightMax: "", heightGrab,
139
+ align: To.Default,
140
+ dock: To.Default,
141
+ };
142
+ else
143
+ b.place.heightGrab = heightGrab;
144
+ }
145
+ }
146
+ render(block) {
147
+ var _a;
148
+ let result;
149
+ const wrapper = (_a = block.args) === null || _a === void 0 ? void 0 : _a.wrapper;
150
+ if (wrapper)
151
+ result = wrapper(block.native, block);
152
+ else
153
+ result = callRenderFunctions(block);
154
+ return result;
155
+ }
156
+ }
157
+ AbstractDriver.group = new AbstractDriver("group", LayoutKind.Group);
158
+ function callRenderFunctions(block) {
159
+ var _a;
160
+ const uses = (_a = block.args) === null || _a === void 0 ? void 0 : _a.mixins;
161
+ if (uses)
162
+ for (const use of uses)
163
+ use(block.native, block);
164
+ return block.args.render(block.native, block);
165
+ }
166
+ export class StaticDriver extends AbstractDriver {
167
+ constructor(element, name, layout, createAllocator) {
168
+ super(name, layout, createAllocator);
169
+ this.element = element;
170
+ }
171
+ initialize(block, element) {
172
+ super.initialize(block, this.element);
173
+ }
174
+ }
175
+ function getBlockName(block) {
176
+ return block.stamp >= 0 ? block.name : undefined;
177
+ }
178
+ class VBlockImpl extends VBlock {
179
+ constructor(name, driver, owner, options) {
180
+ super();
181
+ this.name = name;
182
+ this.driver = driver;
183
+ this.args = options;
184
+ this.model = undefined;
185
+ this.level = owner.level + 1;
186
+ this.host = owner;
187
+ this.children = new Collection(driver.isSequential, getBlockName);
188
+ this.numerator = 0;
189
+ this.item = undefined;
190
+ this.stamp = 0;
191
+ this.native = undefined;
192
+ this.place = undefined;
193
+ this.allocator = driver.createAllocator();
194
+ }
195
+ rerender(_triggers) {
196
+ runRender(this.item);
197
+ }
198
+ }
199
+ VBlockImpl.grandCount = 0;
200
+ VBlockImpl.disposableCount = 0;
201
+ VBlockImpl.logging = undefined;
202
+ __decorate([
203
+ reactive,
204
+ options({
205
+ reentrance: Reentrance.CancelPrevious,
206
+ triggeringArgs: true,
207
+ noSideEffects: false,
208
+ }),
209
+ __metadata("design:type", Function),
210
+ __metadata("design:paramtypes", [Object]),
211
+ __metadata("design:returntype", void 0)
212
+ ], VBlockImpl.prototype, "rerender", null);
213
+ function runRenderNestedTreesThenDo(error, action) {
214
+ var _a;
215
+ const context = gContext;
216
+ const owner = context.instance;
217
+ const children = owner.children;
218
+ if (children.isMergeInProgress) {
219
+ let promised = undefined;
220
+ try {
221
+ children.endMerge(error);
222
+ for (const item of children.removedItems(true))
223
+ runFinalize(item, true);
224
+ if (!error) {
225
+ const isBlockOwner = owner.driver.isBlock;
226
+ const sequential = children.strict;
227
+ const allocator = owner.allocator;
228
+ allocator.reset();
229
+ let p1 = undefined;
230
+ let p2 = undefined;
231
+ let redeploy = false;
232
+ let lineHost = owner;
233
+ for (const item of children.items()) {
234
+ if (Transaction.isCanceled)
235
+ break;
236
+ const block = item.instance;
237
+ const driver = block.driver;
238
+ const opt = block.args;
239
+ if (!driver.isLine) {
240
+ const place = allocator.allocate(opt);
241
+ driver.arrange(block, place, undefined);
242
+ }
243
+ else
244
+ allocator.lineFeed();
245
+ const host = driver.isLine ? owner : lineHost;
246
+ redeploy = markToRedeployIfNecessary(redeploy, host, item, children, sequential);
247
+ const priority = (_a = opt === null || opt === void 0 ? void 0 : opt.priority) !== null && _a !== void 0 ? _a : Priority.SyncP0;
248
+ if (priority === Priority.SyncP0)
249
+ prepareAndRunRender(item, children.isMoved(item), sequential);
250
+ else if (priority === Priority.AsyncP1)
251
+ p1 = push(item, p1);
252
+ else
253
+ p2 = push(item, p2);
254
+ if (isBlockOwner && driver.isLine)
255
+ lineHost = block;
256
+ }
257
+ if (!Transaction.isCanceled && (p1 !== undefined || p2 !== undefined))
258
+ promised = startIncrementalRendering(context, children, p1, p2).then(() => action(error), e => action(e));
259
+ }
260
+ }
261
+ finally {
262
+ if (!promised)
263
+ action(error);
264
+ }
265
+ }
266
+ }
267
+ function markToRedeployIfNecessary(redeploy, host, item, children, sequential) {
268
+ const block = item.instance;
269
+ if (block.native) {
270
+ if (redeploy || block.host !== host) {
271
+ children.markAsMoved(item);
272
+ redeploy = false;
273
+ }
274
+ }
275
+ else if (sequential && children.isMoved(item))
276
+ redeploy = true;
277
+ block.host = host;
278
+ return redeploy;
279
+ }
280
+ function startIncrementalRendering(owner, allChildren, priority1, priority2) {
281
+ return __awaiter(this, void 0, void 0, function* () {
282
+ const stamp = owner.instance.stamp;
283
+ if (priority1)
284
+ yield renderIncrementally(owner, stamp, allChildren, priority1, Priority.AsyncP1);
285
+ if (priority2)
286
+ yield renderIncrementally(owner, stamp, allChildren, priority2, Priority.AsyncP2);
287
+ });
288
+ }
289
+ function renderIncrementally(owner, stamp, allChildren, items, priority) {
290
+ var _a;
291
+ return __awaiter(this, void 0, void 0, function* () {
292
+ yield Transaction.requestNextFrame();
293
+ const block = owner.instance;
294
+ if (!Transaction.isCanceled || !Transaction.isFrameOver(1, VBlock.shortFrameDuration / 3)) {
295
+ let outerPriority = VBlock.currentRenderingPriority;
296
+ VBlock.currentRenderingPriority = priority;
297
+ try {
298
+ const sequential = block.children.strict;
299
+ if ((_a = block.args) === null || _a === void 0 ? void 0 : _a.shuffle)
300
+ shuffle(items);
301
+ const frameDurationLimit = priority === Priority.AsyncP2 ? VBlock.shortFrameDuration : Infinity;
302
+ let frameDuration = Math.min(frameDurationLimit, Math.max(VBlock.frameDuration / 4, VBlock.shortFrameDuration));
303
+ for (const child of items) {
304
+ prepareAndRunRender(child, allChildren.isMoved(child), sequential);
305
+ if (Transaction.isFrameOver(1, frameDuration)) {
306
+ VBlock.currentRenderingPriority = outerPriority;
307
+ yield Transaction.requestNextFrame(0);
308
+ outerPriority = VBlock.currentRenderingPriority;
309
+ VBlock.currentRenderingPriority = priority;
310
+ frameDuration = Math.min(4 * frameDuration, Math.min(frameDurationLimit, VBlock.frameDuration));
311
+ }
312
+ if (Transaction.isCanceled && Transaction.isFrameOver(1, VBlock.shortFrameDuration / 3))
313
+ break;
314
+ }
315
+ }
316
+ finally {
317
+ VBlock.currentRenderingPriority = outerPriority;
318
+ }
319
+ }
320
+ });
321
+ }
322
+ function prepareAndRunRender(item, redeploy, sequential) {
323
+ var _a, _b;
324
+ const block = item.instance;
325
+ if (block.stamp >= 0) {
326
+ prepareRender(item, redeploy, sequential);
327
+ if ((_a = block.args) === null || _a === void 0 ? void 0 : _a.reacting)
328
+ nonreactive(block.rerender, (_b = block.args) === null || _b === void 0 ? void 0 : _b.triggers);
329
+ else
330
+ runRender(item);
331
+ }
332
+ }
333
+ function prepareRender(item, redeploy, sequential) {
334
+ var _a;
335
+ const block = item.instance;
336
+ const driver = block.driver;
337
+ if (block.stamp === 0) {
338
+ block.stamp = 1;
339
+ if ((_a = block.args) === null || _a === void 0 ? void 0 : _a.reacting) {
340
+ Transaction.outside(() => {
341
+ var _a, _b, _c;
342
+ if (Rx.isLogging)
343
+ Rx.setLoggingHint(block, block.name);
344
+ Rx.getController(block.rerender).configure({
345
+ order: block.level,
346
+ monitor: (_a = block.args) === null || _a === void 0 ? void 0 : _a.monitor,
347
+ throttling: (_b = block.args) === null || _b === void 0 ? void 0 : _b.throttling,
348
+ logging: (_c = block.args) === null || _c === void 0 ? void 0 : _c.logging,
349
+ });
350
+ });
351
+ }
352
+ driver.initialize(block, undefined);
353
+ driver.deploy(block, sequential);
354
+ driver.arrange(block, block.place, undefined);
355
+ }
356
+ else if (redeploy)
357
+ driver.deploy(block, sequential);
358
+ }
359
+ function runRender(item) {
360
+ const block = item.instance;
361
+ if (block.stamp >= 0) {
362
+ runUnder(item, () => {
363
+ let result = undefined;
364
+ try {
365
+ block.stamp++;
366
+ block.numerator = 0;
367
+ block.children.beginMerge();
368
+ result = block.driver.render(block);
369
+ if (result instanceof Promise)
370
+ result.then(v => { runRenderNestedTreesThenDo(undefined, NOP); return v; }, e => { console.log(e); runRenderNestedTreesThenDo(e !== null && e !== void 0 ? e : new Error("unknown error"), NOP); });
371
+ else
372
+ runRenderNestedTreesThenDo(undefined, NOP);
373
+ }
374
+ catch (e) {
375
+ runRenderNestedTreesThenDo(e, NOP);
376
+ console.log(`Rendering failed: ${block.name}`);
377
+ console.log(`${e}`);
378
+ }
379
+ });
380
+ }
381
+ }
382
+ function runFinalize(item, isLeader) {
383
+ var _a;
384
+ const block = item.instance;
385
+ if (block.stamp >= 0) {
386
+ block.stamp = ~block.stamp;
387
+ const childrenAreLeaders = block.driver.finalize(block, isLeader);
388
+ if ((_a = block.args) === null || _a === void 0 ? void 0 : _a.reacting) {
389
+ item.aux = undefined;
390
+ const last = gLastToDispose;
391
+ if (last)
392
+ gLastToDispose = last.aux = item;
393
+ else
394
+ gFirstToDispose = gLastToDispose = item;
395
+ if (gFirstToDispose === item)
396
+ Transaction.run({ separation: "disposal", hint: `runDisposalLoop(initiator=${item.instance.name})` }, () => {
397
+ void runDisposalLoop().then(NOP, error => console.log(error));
398
+ });
399
+ }
400
+ for (const item of block.children.items())
401
+ runFinalize(item, childrenAreLeaders);
402
+ VBlockImpl.grandCount--;
403
+ }
404
+ }
405
+ function runDisposalLoop() {
406
+ return __awaiter(this, void 0, void 0, function* () {
407
+ yield Transaction.requestNextFrame();
408
+ let item = gFirstToDispose;
409
+ while (item !== undefined) {
410
+ if (Transaction.isFrameOver(500, 5))
411
+ yield Transaction.requestNextFrame();
412
+ Rx.dispose(item.instance);
413
+ item = item.aux;
414
+ VBlockImpl.disposableCount--;
415
+ }
416
+ gFirstToDispose = gLastToDispose = undefined;
417
+ });
418
+ }
419
+ function forEachChildRecursively(item, action) {
420
+ const block = item.instance;
421
+ const native = block.native;
422
+ native && action(native);
423
+ for (const item of block.children.items())
424
+ forEachChildRecursively(item, action);
425
+ }
426
+ function wrap(func) {
427
+ const ctx = gContext;
428
+ const wrappedRunUnder = (...args) => {
429
+ return runUnder(ctx, func, ...args);
430
+ };
431
+ return wrappedRunUnder;
432
+ }
433
+ function runUnder(item, func, ...args) {
434
+ const outer = gContext;
435
+ try {
436
+ gContext = item;
437
+ return func(...args);
438
+ }
439
+ finally {
440
+ gContext = outer;
441
+ }
442
+ }
443
+ function triggersAreEqual(a1, a2) {
444
+ let result = a1 === a2;
445
+ if (!result) {
446
+ if (Array.isArray(a1)) {
447
+ result = Array.isArray(a2) &&
448
+ a1.length === a2.length &&
449
+ a1.every((t, i) => t === a2[i]);
450
+ }
451
+ else if (a1 === Object(a1) && a2 === Object(a2)) {
452
+ for (const p in a1) {
453
+ result = a1[p] === a2[p];
454
+ if (!result)
455
+ break;
456
+ }
457
+ }
458
+ }
459
+ return result;
460
+ }
461
+ function push(item, array) {
462
+ if (array == undefined)
463
+ array = new Array();
464
+ array.push(item);
465
+ return array;
466
+ }
467
+ function shuffle(array) {
468
+ const n = array.length - 1;
469
+ let i = n;
470
+ while (i >= 0) {
471
+ const j = Math.floor(Math.random() * n);
472
+ const t = array[i];
473
+ array[i] = array[j];
474
+ array[j] = t;
475
+ i--;
476
+ }
477
+ return array;
478
+ }
479
+ const ORIGINAL_PROMISE_THEN = Promise.prototype.then;
480
+ function reactronicDomHookedThen(resolve, reject) {
481
+ resolve = resolve ? wrap(resolve) : defaultResolve;
482
+ reject = reject ? wrap(reject) : defaultReject;
483
+ return ORIGINAL_PROMISE_THEN.call(this, resolve, reject);
484
+ }
485
+ function defaultResolve(value) {
486
+ return value;
487
+ }
488
+ function defaultReject(error) {
489
+ throw error;
490
+ }
491
+ Promise.prototype.then = reactronicDomHookedThen;
492
+ const NOP = () => { };
493
+ const gSysDriver = new StaticDriver(null, "SYSTEM", LayoutKind.Group);
494
+ const gSysRoot = Collection.createItem(new VBlockImpl("SYSTEM", gSysDriver, { level: 0 }, { reacting: true, render: NOP }));
495
+ gSysRoot.instance.item = gSysRoot;
496
+ Object.defineProperty(gSysRoot.instance, "host", {
497
+ value: gSysRoot.instance,
498
+ writable: false,
499
+ configurable: false,
500
+ enumerable: true,
501
+ });
502
+ let gContext = gSysRoot;
503
+ let gFirstToDispose = undefined;
504
+ let gLastToDispose = undefined;
@@ -1,5 +1,5 @@
1
- export declare function restyler<T>(restyle: () => T): RxStyler<T>;
2
- export declare class RxStyler<T> {
1
+ export declare function restyler<T>(restyle: () => T): ObservablesStyles<T>;
2
+ export declare class ObservablesStyles<T> {
3
3
  private readonly restyle;
4
4
  constructor(restyle: () => T);
5
5
  protected cache(): T;
@@ -7,11 +7,11 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
7
7
  var __metadata = (this && this.__metadata) || function (k, v) {
8
8
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
9
  };
10
- import { cached, Transaction } from 'reactronic';
10
+ import { cached, Transaction } from "reactronic";
11
11
  export function restyler(restyle) {
12
- return Transaction.run(null, () => new RxStyler(restyle));
12
+ return Transaction.run(null, () => new ObservablesStyles(restyle));
13
13
  }
14
- export class RxStyler {
14
+ export class ObservablesStyles {
15
15
  constructor(restyle) {
16
16
  this.restyle = restyle;
17
17
  }
@@ -27,4 +27,4 @@ __decorate([
27
27
  __metadata("design:type", Function),
28
28
  __metadata("design:paramtypes", []),
29
29
  __metadata("design:returntype", Object)
30
- ], RxStyler.prototype, "cache", null);
30
+ ], ObservablesStyles.prototype, "cache", null);
@@ -1,4 +1,5 @@
1
- export * from './RxNode';
2
- export * from './Elements';
3
- export * from './Restyler';
4
- export * from './Utils';
1
+ export * from "./Utils";
2
+ export * from "./CellRange";
3
+ export * from "./Allocator";
4
+ export * from "./Kernel";
5
+ export * from "./Restyler";
@@ -1,4 +1,5 @@
1
- export * from './RxNode';
2
- export * from './Elements';
3
- export * from './Restyler';
4
- export * from './Utils';
1
+ export * from "./Utils";
2
+ export * from "./CellRange";
3
+ export * from "./Allocator";
4
+ export * from "./Kernel";
5
+ export * from "./Restyler";
@@ -0,0 +1,14 @@
1
+ import { VBlock, Place, BlockArgs } from "../core/api";
2
+ import { HtmlDriver } from "./HtmlDriver";
3
+ export declare function Block<M = unknown, R = void>(name: string, args: BlockArgs<HTMLElement, M, R>): VBlock<HTMLElement, M, R>;
4
+ export declare function PlainText(content: string): VBlock<HTMLElement, void, void>;
5
+ export declare function MdText(content: string): VBlock<HTMLElement, void, void>;
6
+ export declare function HtmlText(content: string): VBlock<HTMLElement, void, void>;
7
+ export declare function Grid<M = unknown, R = void>(name: string, args: BlockArgs<HTMLElement, M, R>): VBlock<HTMLElement, M, R>;
8
+ export declare function Line<T = void>(claim: (x: void) => T): VBlock<HTMLElement>;
9
+ export declare function lineFeed(args?: BlockArgs<HTMLElement, void, void>, noCoalescing?: boolean): VBlock<HTMLElement>;
10
+ export declare function Group<M = unknown, R = void>(name: string, args: BlockArgs<HTMLElement, M, R>): VBlock<HTMLElement, M, R>;
11
+ export declare class VerstakDriver<T extends HTMLElement> extends HtmlDriver<T> {
12
+ arrange(block: VBlock<T>, place: Place | undefined, heightGrab: number | undefined): void;
13
+ render(block: VBlock<T>): void | Promise<void>;
14
+ }