verstak 0.22.412

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 (59) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +28 -0
  3. package/build/dist/source/api.d.ts +2 -0
  4. package/build/dist/source/api.js +2 -0
  5. package/build/dist/source/archive/RxDomV1.Types.d.ts +46 -0
  6. package/build/dist/source/archive/RxDomV1.Types.js +22 -0
  7. package/build/dist/source/archive/RxDomV1.d.ts +45 -0
  8. package/build/dist/source/archive/RxDomV1.js +556 -0
  9. package/build/dist/source/core/Elements.d.ts +4 -0
  10. package/build/dist/source/core/Elements.js +7 -0
  11. package/build/dist/source/core/Restyler.d.ts +7 -0
  12. package/build/dist/source/core/Restyler.js +30 -0
  13. package/build/dist/source/core/RxNode.d.ts +59 -0
  14. package/build/dist/source/core/RxNode.js +426 -0
  15. package/build/dist/source/core/Utils.d.ts +1 -0
  16. package/build/dist/source/core/Utils.js +3 -0
  17. package/build/dist/source/core/api.d.ts +4 -0
  18. package/build/dist/source/core/api.js +4 -0
  19. package/build/dist/source/html/CellRange.d.ts +11 -0
  20. package/build/dist/source/html/CellRange.js +175 -0
  21. package/build/dist/source/html/HtmlApiExt.d.ts +7 -0
  22. package/build/dist/source/html/HtmlApiExt.js +25 -0
  23. package/build/dist/source/html/HtmlElements.d.ts +349 -0
  24. package/build/dist/source/html/HtmlElements.js +529 -0
  25. package/build/dist/source/html/HtmlNodeFactory.d.ts +19 -0
  26. package/build/dist/source/html/HtmlNodeFactory.js +96 -0
  27. package/build/dist/source/html/RxFocuser.d.ts +2 -0
  28. package/build/dist/source/html/RxFocuser.js +11 -0
  29. package/build/dist/source/html/api.d.ts +18 -0
  30. package/build/dist/source/html/api.js +18 -0
  31. package/build/dist/source/html/sensors/BasePointerSensor.d.ts +18 -0
  32. package/build/dist/source/html/sensors/BasePointerSensor.js +32 -0
  33. package/build/dist/source/html/sensors/ButtonSensor.d.ts +32 -0
  34. package/build/dist/source/html/sensors/ButtonSensor.js +211 -0
  35. package/build/dist/source/html/sensors/DataForSensor.d.ts +27 -0
  36. package/build/dist/source/html/sensors/DataForSensor.js +72 -0
  37. package/build/dist/source/html/sensors/FocusSensor.d.ts +29 -0
  38. package/build/dist/source/html/sensors/FocusSensor.js +182 -0
  39. package/build/dist/source/html/sensors/HoverSensor.d.ts +10 -0
  40. package/build/dist/source/html/sensors/HoverSensor.js +80 -0
  41. package/build/dist/source/html/sensors/HtmlDragSensor.d.ts +61 -0
  42. package/build/dist/source/html/sensors/HtmlDragSensor.js +386 -0
  43. package/build/dist/source/html/sensors/HtmlElementSensor.d.ts +13 -0
  44. package/build/dist/source/html/sensors/HtmlElementSensor.js +53 -0
  45. package/build/dist/source/html/sensors/HtmlSensors.d.ts +22 -0
  46. package/build/dist/source/html/sensors/HtmlSensors.js +47 -0
  47. package/build/dist/source/html/sensors/KeyboardSensor.d.ts +33 -0
  48. package/build/dist/source/html/sensors/KeyboardSensor.js +143 -0
  49. package/build/dist/source/html/sensors/PointerSensor.d.ts +60 -0
  50. package/build/dist/source/html/sensors/PointerSensor.js +394 -0
  51. package/build/dist/source/html/sensors/ResizeSensor.d.ts +18 -0
  52. package/build/dist/source/html/sensors/ResizeSensor.js +72 -0
  53. package/build/dist/source/html/sensors/Sensor.d.ts +6 -0
  54. package/build/dist/source/html/sensors/Sensor.js +11 -0
  55. package/build/dist/source/html/sensors/WheelSensor.d.ts +13 -0
  56. package/build/dist/source/html/sensors/WheelSensor.js +86 -0
  57. package/build/dist/source/html/sensors/WindowSensor.d.ts +10 -0
  58. package/build/dist/source/html/sensors/WindowSensor.js +38 -0
  59. package/package.json +54 -0
@@ -0,0 +1,6 @@
1
+ import { ObservableObject } from 'reactronic';
2
+ export declare class Sensor extends ObservableObject {
3
+ revision: number;
4
+ elementDataList: unknown[];
5
+ get topElementData(): unknown;
6
+ }
@@ -0,0 +1,11 @@
1
+ import { ObservableObject } from 'reactronic';
2
+ export class Sensor extends ObservableObject {
3
+ constructor() {
4
+ super(...arguments);
5
+ this.revision = 0;
6
+ this.elementDataList = [];
7
+ }
8
+ get topElementData() {
9
+ return this.elementDataList.length > 0 ? this.elementDataList[0] : undefined;
10
+ }
11
+ }
@@ -0,0 +1,13 @@
1
+ import { BasePointerSensor } from './BasePointerSensor';
2
+ export declare class WheelSensor extends BasePointerSensor {
3
+ target: unknown;
4
+ deltaX: number;
5
+ deltaY: number;
6
+ constructor();
7
+ listen(element: HTMLElement | undefined, enabled?: boolean): void;
8
+ reset(): void;
9
+ protected onWheel(e: WheelEvent): void;
10
+ protected doWheel(e: WheelEvent): void;
11
+ protected doReset(): void;
12
+ protected updateSensorData(e: WheelEvent): void;
13
+ }
@@ -0,0 +1,86 @@
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 { options, Reentrance, transactional, LoggingLevel } from 'reactronic';
11
+ import { findTargetElementData, SymDataForSensor } from './DataForSensor';
12
+ import { extractModifierKeys, KeyboardModifiers } from './KeyboardSensor';
13
+ import { BasePointerSensor } from './BasePointerSensor';
14
+ export class WheelSensor extends BasePointerSensor {
15
+ constructor() {
16
+ super();
17
+ this.target = undefined;
18
+ this.target = undefined;
19
+ this.deltaX = Infinity;
20
+ this.deltaY = Infinity;
21
+ }
22
+ listen(element, enabled = true) {
23
+ const existing = this.sourceElement;
24
+ if (element !== existing) {
25
+ if (existing) {
26
+ existing.removeEventListener('wheel', this.onWheel.bind(this), { capture: true });
27
+ }
28
+ this.sourceElement = element;
29
+ if (element && enabled) {
30
+ element.addEventListener('wheel', this.onWheel.bind(this), { capture: true, passive: true });
31
+ }
32
+ }
33
+ }
34
+ reset() {
35
+ this.doReset();
36
+ }
37
+ onWheel(e) {
38
+ this.doWheel(e);
39
+ }
40
+ doWheel(e) {
41
+ this.updateSensorData(e);
42
+ }
43
+ doReset() {
44
+ this.preventDefault = false;
45
+ this.stopPropagation = false;
46
+ this.modifiers = KeyboardModifiers.None;
47
+ this.positionX = Infinity;
48
+ this.positionY = Infinity;
49
+ this.target = undefined;
50
+ this.deltaX = Infinity;
51
+ this.deltaY = Infinity;
52
+ }
53
+ updateSensorData(e) {
54
+ var _a;
55
+ this.preventDefault = false;
56
+ this.stopPropagation = false;
57
+ const targetPath = e.composedPath();
58
+ const underPointer = document.elementsFromPoint(e.clientX, e.clientY);
59
+ this.target = (_a = findTargetElementData(targetPath, underPointer, SymDataForSensor, ['wheel']).data) === null || _a === void 0 ? void 0 : _a.wheel;
60
+ this.modifiers = extractModifierKeys(e);
61
+ this.positionX = e.clientX;
62
+ this.positionY = e.clientY;
63
+ this.deltaX = e.deltaX;
64
+ this.deltaY = e.deltaY;
65
+ this.revision++;
66
+ }
67
+ }
68
+ __decorate([
69
+ transactional,
70
+ __metadata("design:type", Function),
71
+ __metadata("design:paramtypes", [Object, Boolean]),
72
+ __metadata("design:returntype", void 0)
73
+ ], WheelSensor.prototype, "listen", null);
74
+ __decorate([
75
+ transactional,
76
+ __metadata("design:type", Function),
77
+ __metadata("design:paramtypes", []),
78
+ __metadata("design:returntype", void 0)
79
+ ], WheelSensor.prototype, "reset", null);
80
+ __decorate([
81
+ transactional,
82
+ options({ reentrance: Reentrance.CancelPrevious, logging: LoggingLevel.Off }),
83
+ __metadata("design:type", Function),
84
+ __metadata("design:paramtypes", [WheelEvent]),
85
+ __metadata("design:returntype", void 0)
86
+ ], WheelSensor.prototype, "doWheel", null);
@@ -0,0 +1,10 @@
1
+ import { ToggleRef } from 'reactronic';
2
+ import { Sensor } from './Sensor';
3
+ export interface WindowModel {
4
+ popupToggle?: ToggleRef;
5
+ }
6
+ export declare class WindowSensor extends Sensor {
7
+ activeData: unknown;
8
+ previousActiveData: unknown;
9
+ setActiveWindow(window: unknown, debugHint?: string): void;
10
+ }
@@ -0,0 +1,38 @@
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 { ToggleRef, transactional } from 'reactronic';
11
+ import { objectHasMember } from '../../core/Utils';
12
+ import { Sensor } from './Sensor';
13
+ export class WindowSensor extends Sensor {
14
+ constructor() {
15
+ super(...arguments);
16
+ this.activeData = undefined;
17
+ this.previousActiveData = undefined;
18
+ }
19
+ setActiveWindow(window, debugHint = '') {
20
+ if (window !== this.activeData) {
21
+ const activeData = this.activeData;
22
+ if (activeData && objectHasMember(activeData, 'popupToggle')) {
23
+ const popupToggle = activeData.popupToggle;
24
+ if (popupToggle instanceof ToggleRef) {
25
+ popupToggle.variable = popupToggle.valueOff;
26
+ }
27
+ }
28
+ this.previousActiveData = activeData;
29
+ this.activeData = window;
30
+ }
31
+ }
32
+ }
33
+ __decorate([
34
+ transactional,
35
+ __metadata("design:type", Function),
36
+ __metadata("design:paramtypes", [Object, String]),
37
+ __metadata("design:returntype", void 0)
38
+ ], WindowSensor.prototype, "setActiveWindow", null);
package/package.json ADDED
@@ -0,0 +1,54 @@
1
+ {
2
+ "name": "verstak",
3
+ "version": "0.22.412",
4
+ "description": "Verstak - Transactional Reactive Front-End Development Framework",
5
+ "publisher": "Nezaboodka Software",
6
+ "license": "Apache-2.0",
7
+ "type": "module",
8
+ "main": "build/dist/source/api.js",
9
+ "types": "build/dist/source/api.d.ts",
10
+ "files": [
11
+ "build/dist/source/**/*.*"
12
+ ],
13
+ "repository": {
14
+ "type": "git",
15
+ "url": "https://github.com/nezaboodka/verstak.git"
16
+ },
17
+ "keywords": [
18
+ "nezaboodka",
19
+ "reactronic",
20
+ "state management",
21
+ "rendering",
22
+ "consistent",
23
+ "reactive",
24
+ "reactivity",
25
+ "transactional",
26
+ "asynchronous",
27
+ "ui"
28
+ ],
29
+ "bugs": {
30
+ "url": "https://github.com/nezaboodka/verstak/issues"
31
+ },
32
+ "homepage": "https://github.com/nezaboodka/verstak/blob/master/README.md#readme",
33
+ "dependencies": {
34
+ "reactronic": "^0.22.411"
35
+ },
36
+ "devDependencies": {
37
+ "@types/node": "18.7.18",
38
+ "@typescript-eslint/eslint-plugin": "5.37.0",
39
+ "@typescript-eslint/parser": "5.37.0",
40
+ "ava": "4.3.3",
41
+ "c8": "7.12.0",
42
+ "eslint": "8.23.1",
43
+ "ts-node": "10.9.1",
44
+ "tsconfig-paths": "4.1.0",
45
+ "typescript": "4.8.2"
46
+ },
47
+ "scripts": {
48
+ "build": "eslint source/**/*.ts test/**/*.ts && tsc",
49
+ "fix": "eslint --fix source/**/*.ts test/**/*.ts",
50
+ "pack": "eslint source/**/*.ts test/**/*.ts && tsc --sourceMap false --removeComments true",
51
+ "test": "ava",
52
+ "cover": "c8 ava && open build/coverage/index.html"
53
+ }
54
+ }