verstak 0.92.25013 → 0.92.25015

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.
@@ -0,0 +1,14 @@
1
+ import { ObservableObject } from "reactronic";
2
+ export declare class RealTimeClock extends ObservableObject {
3
+ hour: number;
4
+ minute: number;
5
+ second: number;
6
+ ms: number;
7
+ interval: number;
8
+ paused: boolean;
9
+ constructor(interval?: number);
10
+ pause(value?: boolean): void;
11
+ private tick;
12
+ protected activate(): void;
13
+ private put;
14
+ }
@@ -0,0 +1,64 @@
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
+ import { ObservableObject, atomic, reactive } from "reactronic";
11
+ export class RealTimeClock extends ObservableObject {
12
+ constructor(interval = 1000) {
13
+ super();
14
+ this.hour = 0;
15
+ this.minute = 0;
16
+ this.second = 0;
17
+ this.ms = 0;
18
+ this.interval = 0;
19
+ this.paused = false;
20
+ this.interval = interval;
21
+ this.put(new Date());
22
+ }
23
+ pause(value = true) {
24
+ this.paused = value;
25
+ }
26
+ tick() {
27
+ let calibration = 0;
28
+ try {
29
+ const now = new Date();
30
+ this.put(now);
31
+ calibration = now.getTime() % this.interval;
32
+ }
33
+ finally {
34
+ setTimeout(() => this.tick(), this.interval - calibration);
35
+ }
36
+ }
37
+ activate() {
38
+ this.tick();
39
+ }
40
+ put(time) {
41
+ this.hour = time.getHours();
42
+ this.minute = time.getMinutes();
43
+ this.second = time.getSeconds();
44
+ this.ms = time.getMilliseconds();
45
+ }
46
+ }
47
+ __decorate([
48
+ atomic,
49
+ __metadata("design:type", Function),
50
+ __metadata("design:paramtypes", [Boolean]),
51
+ __metadata("design:returntype", void 0)
52
+ ], RealTimeClock.prototype, "pause", null);
53
+ __decorate([
54
+ atomic,
55
+ __metadata("design:type", Function),
56
+ __metadata("design:paramtypes", []),
57
+ __metadata("design:returntype", void 0)
58
+ ], RealTimeClock.prototype, "tick", null);
59
+ __decorate([
60
+ reactive,
61
+ __metadata("design:type", Function),
62
+ __metadata("design:paramtypes", []),
63
+ __metadata("design:returntype", void 0)
64
+ ], RealTimeClock.prototype, "activate", null);
@@ -7,3 +7,4 @@ export * from "./Toggle.v.js";
7
7
  export * from "./Markdown.v.js";
8
8
  export * from "./Theme.js";
9
9
  export { observableModel } from "./common/Utils.js";
10
+ export { RealTimeClock } from "./RealTimeClock.js";
@@ -7,3 +7,4 @@ export * from "./Toggle.v.js";
7
7
  export * from "./Markdown.v.js";
8
8
  export * from "./Theme.js";
9
9
  export { observableModel } from "./common/Utils.js";
10
+ export { RealTimeClock } from "./RealTimeClock.js";
@@ -172,9 +172,9 @@ export class PanelDriver extends HtmlDriver {
172
172
  }
173
173
  },
174
174
  });
175
- ReactiveNode.updateNestedNodesThenDo(() => {
175
+ ReactiveNode.runNestedNodeScriptsThenDo(() => {
176
176
  layoutInfo.isUpdateFinished = true;
177
- ReactiveNode.triggerUpdate(relayoutEl, { stamp: node.stamp });
177
+ ReactiveNode.triggerScriptRun(relayoutEl, { stamp: node.stamp });
178
178
  });
179
179
  }
180
180
  return result;
@@ -67,7 +67,7 @@ export class WebDriver extends ElDriver {
67
67
  element.place = undefined;
68
68
  }
69
69
  if (gBlinkingEffectMarker)
70
- blink(element.native, ReactiveNode.currentUpdatePriority, node.stamp);
70
+ blink(element.native, ReactiveNode.currentScriptPriority, node.stamp);
71
71
  }, e => {
72
72
  });
73
73
  return result;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "verstak",
3
- "version": "0.92.25013",
3
+ "version": "0.92.25015",
4
4
  "description": "Verstak - Front-End Library",
5
5
  "publisher": "Nezaboodka Software",
6
6
  "license": "Apache-2.0",
@@ -42,7 +42,7 @@
42
42
  "markdown-it": "^14.1.0",
43
43
  "markdown-it-prism": "^2.3.0",
44
44
  "prismjs": "^1.29.0",
45
- "reactronic": "^0.92.25011"
45
+ "reactronic": "^0.92.25013"
46
46
  },
47
47
  "devDependencies": {
48
48
  "@types/markdown-it": "14.1.2",