verstak 0.24.502 → 0.24.508

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 (91) hide show
  1. package/build/dist/source/api.d.ts +1 -1
  2. package/build/dist/source/api.js +1 -1
  3. package/build/dist/source/core/El.d.ts +78 -0
  4. package/build/dist/source/core/El.js +32 -0
  5. package/build/dist/source/{html/El.d.ts → core/ElDriver.d.ts} +1 -77
  6. package/build/dist/source/{html/El.js → core/ElDriver.js} +9 -40
  7. package/build/dist/source/{html → core}/Elements.d.ts +5 -2
  8. package/build/dist/source/{html → core}/Elements.js +8 -3
  9. package/build/dist/source/{html → core}/SplitViewMath.d.ts +1 -1
  10. package/build/dist/source/{html/HtmlDriver.d.ts → core/WebDriver.d.ts} +2 -1
  11. package/build/dist/source/{html/HtmlDriver.js → core/WebDriver.js} +1 -1
  12. package/build/dist/source/core/api.d.ts +7 -0
  13. package/build/dist/source/core/api.js +7 -0
  14. package/build/dist/source/express/Button.v.d.ts +8 -0
  15. package/build/dist/source/express/Button.v.js +39 -0
  16. package/build/dist/source/express/Field.v.d.ts +16 -0
  17. package/build/dist/source/express/Field.v.js +118 -0
  18. package/build/dist/source/express/Icon.v.d.ts +3 -0
  19. package/build/dist/source/express/Icon.v.js +14 -0
  20. package/build/dist/source/express/Image.v.d.ts +6 -0
  21. package/build/dist/source/express/Image.v.js +18 -0
  22. package/build/dist/source/express/Markdown.v.d.ts +1 -0
  23. package/build/dist/source/express/Markdown.v.js +18 -0
  24. package/build/dist/source/express/Spinner.v.d.ts +9 -0
  25. package/build/dist/source/express/Spinner.v.js +23 -0
  26. package/build/dist/source/express/Theme.d.ts +34 -0
  27. package/build/dist/source/express/Theme.js +30 -0
  28. package/build/dist/source/express/Toggle.v.d.ts +8 -0
  29. package/build/dist/source/express/Toggle.v.js +40 -0
  30. package/build/dist/source/express/api.d.ts +9 -0
  31. package/build/dist/source/express/api.js +9 -0
  32. package/build/dist/source/express/common/Utils.d.ts +5 -0
  33. package/build/dist/source/express/common/Utils.js +26 -0
  34. package/build/dist/source/express/theme/Button.s.d.ts +11 -0
  35. package/build/dist/source/express/theme/Button.s.js +49 -0
  36. package/build/dist/source/express/theme/Field.s.d.ts +13 -0
  37. package/build/dist/source/express/theme/Field.s.js +68 -0
  38. package/build/dist/source/express/theme/Icon.s.d.ts +7 -0
  39. package/build/dist/source/express/theme/Icon.s.js +26 -0
  40. package/build/dist/source/express/theme/Styling.d.ts +16 -0
  41. package/build/dist/source/express/theme/Styling.js +20 -0
  42. package/build/dist/source/express/theme/Toggle.s.d.ts +11 -0
  43. package/build/dist/source/express/theme/Toggle.s.js +48 -0
  44. package/build/dist/source/html/DraggableArea.view.d.ts +2 -2
  45. package/build/dist/source/html/DraggableArea.view.js +1 -1
  46. package/build/dist/source/html/HtmlApiExt.d.ts +2 -2
  47. package/build/dist/source/html/HtmlApiExt.js +2 -2
  48. package/build/dist/source/html/HtmlElements.d.ts +2 -4
  49. package/build/dist/source/html/HtmlElements.js +2 -6
  50. package/build/dist/source/html/api.d.ts +0 -19
  51. package/build/dist/source/html/api.js +0 -19
  52. package/build/dist/source/{html/sensors → sensors}/FocusSensor.js +1 -1
  53. package/build/dist/source/{html → sensors}/Handlers.d.ts +3 -3
  54. package/build/dist/source/{html → sensors}/Handlers.js +1 -1
  55. package/build/dist/source/{html/sensors → sensors}/ResizeSensor.d.ts +1 -1
  56. package/build/dist/source/{html/sensors → sensors}/WindowSensor.js +1 -1
  57. package/build/dist/source/sensors/api.d.ts +13 -0
  58. package/build/dist/source/sensors/api.js +13 -0
  59. package/package.json +15 -3
  60. package/build/dist/source/{html → core}/ElUtils.d.ts +0 -0
  61. package/build/dist/source/{html → core}/ElUtils.js +0 -0
  62. package/build/dist/source/{html → core}/Sizes.d.ts +0 -0
  63. package/build/dist/source/{html → core}/Sizes.js +0 -0
  64. package/build/dist/source/{html → core}/SplitViewMath.js +1 -1
  65. /package/build/dist/source/{html/sensors → sensors}/BasePointerSensor.d.ts +0 -0
  66. /package/build/dist/source/{html/sensors → sensors}/BasePointerSensor.js +0 -0
  67. /package/build/dist/source/{html/sensors → sensors}/ButtonSensor.d.ts +0 -0
  68. /package/build/dist/source/{html/sensors → sensors}/ButtonSensor.js +0 -0
  69. /package/build/dist/source/{html/sensors → sensors}/DataForSensor.d.ts +0 -0
  70. /package/build/dist/source/{html/sensors → sensors}/DataForSensor.js +0 -0
  71. /package/build/dist/source/{html/sensors → sensors}/FocusSensor.d.ts +0 -0
  72. /package/build/dist/source/{html/sensors → sensors}/HoverSensor.d.ts +0 -0
  73. /package/build/dist/source/{html/sensors → sensors}/HoverSensor.js +0 -0
  74. /package/build/dist/source/{html/sensors → sensors}/HtmlDragSensor.d.ts +0 -0
  75. /package/build/dist/source/{html/sensors → sensors}/HtmlDragSensor.js +0 -0
  76. /package/build/dist/source/{html/sensors → sensors}/HtmlElementSensor.d.ts +0 -0
  77. /package/build/dist/source/{html/sensors → sensors}/HtmlElementSensor.js +0 -0
  78. /package/build/dist/source/{html/sensors → sensors}/HtmlSensors.d.ts +0 -0
  79. /package/build/dist/source/{html/sensors → sensors}/HtmlSensors.js +0 -0
  80. /package/build/dist/source/{html/sensors → sensors}/KeyboardSensor.d.ts +0 -0
  81. /package/build/dist/source/{html/sensors → sensors}/KeyboardSensor.js +0 -0
  82. /package/build/dist/source/{html/sensors → sensors}/PointerSensor.d.ts +0 -0
  83. /package/build/dist/source/{html/sensors → sensors}/PointerSensor.js +0 -0
  84. /package/build/dist/source/{html/sensors → sensors}/ResizeSensor.js +0 -0
  85. /package/build/dist/source/{html/sensors → sensors}/ScrollSensor.d.ts +0 -0
  86. /package/build/dist/source/{html/sensors → sensors}/ScrollSensor.js +0 -0
  87. /package/build/dist/source/{html/sensors → sensors}/Sensor.d.ts +0 -0
  88. /package/build/dist/source/{html/sensors → sensors}/Sensor.js +0 -0
  89. /package/build/dist/source/{html/sensors → sensors}/WheelSensor.d.ts +0 -0
  90. /package/build/dist/source/{html/sensors → sensors}/WheelSensor.js +0 -0
  91. /package/build/dist/source/{html/sensors → sensors}/WindowSensor.d.ts +0 -0
@@ -0,0 +1,34 @@
1
+ import { AbstractTheme } from "./theme/Styling.js";
2
+ import { ButtonStyling, DefaultButtonStyling } from "./theme/Button.s.js";
3
+ import { FieldStyling, DefaultFieldStyling } from "./theme/Field.s.js";
4
+ import { IconStyling, DefaultIconStyling } from "./theme/Icon.s.js";
5
+ import { ToggleStyling, DefaultToggleStyling } from "./theme/Toggle.s.js";
6
+ export { type ButtonStyling, type DefaultButtonStyling } from "./theme/Button.s.js";
7
+ export { type FieldStyling, type DefaultFieldStyling } from "./theme/Field.s.js";
8
+ export { type IconStyling, type DefaultIconStyling } from "./theme/Icon.s.js";
9
+ export { type ToggleStyling, type DefaultToggleStyling } from "./theme/Toggle.s.js";
10
+ export type VerstakExpressTheme = AbstractTheme & {
11
+ readonly button: ButtonStyling;
12
+ readonly field: FieldStyling;
13
+ readonly icon: IconStyling;
14
+ readonly toggle: ToggleStyling;
15
+ };
16
+ export declare class Theme implements VerstakExpressTheme {
17
+ private static readonly gCurrent;
18
+ static get current(): VerstakExpressTheme;
19
+ static set current(value: VerstakExpressTheme);
20
+ name: string;
21
+ fillColor: string;
22
+ textColor: string;
23
+ positiveColor: string;
24
+ negativeColor: string;
25
+ borderRadius: string;
26
+ outlineWidth: string;
27
+ outlineColor: string;
28
+ outlinePadding: string;
29
+ shadow: string;
30
+ button: DefaultButtonStyling;
31
+ field: DefaultFieldStyling;
32
+ icon: DefaultIconStyling;
33
+ toggle: DefaultToggleStyling;
34
+ }
@@ -0,0 +1,30 @@
1
+ import { Transaction, ReactiveNodeVariable, Isolation } from "reactronic";
2
+ import { DefaultButtonStyling } from "./theme/Button.s.js";
3
+ import { DefaultFieldStyling } from "./theme/Field.s.js";
4
+ import { DefaultIconStyling } from "./theme/Icon.s.js";
5
+ import { DefaultToggleStyling } from "./theme/Toggle.s.js";
6
+ export class Theme {
7
+ constructor() {
8
+ this.name = "Default Gost Theme";
9
+ this.fillColor = "white";
10
+ this.textColor = "black";
11
+ this.positiveColor = "green";
12
+ this.negativeColor = "red";
13
+ this.borderRadius = "0.35rem";
14
+ this.outlineWidth = "1px";
15
+ this.outlineColor = "rgba(127, 127, 127, 0.5)";
16
+ this.outlinePadding = "0.25em";
17
+ this.shadow = "0.1rem 0.1rem 0.5rem 0 rgba(127, 127, 127, 0.5)";
18
+ this.button = new DefaultButtonStyling(this);
19
+ this.field = new DefaultFieldStyling(this);
20
+ this.icon = new DefaultIconStyling(this);
21
+ this.toggle = new DefaultToggleStyling(this);
22
+ }
23
+ static get current() {
24
+ return Theme.gCurrent.value;
25
+ }
26
+ static set current(value) {
27
+ Theme.gCurrent.value = value;
28
+ }
29
+ }
30
+ Theme.gCurrent = new ReactiveNodeVariable(Transaction.run({ isolation: Isolation.disjoinFromOuterTransaction }, () => new Theme()));
@@ -0,0 +1,8 @@
1
+ import { ReactiveNodeDecl, ReactiveNode } from "reactronic";
2
+ import { El } from "verstak";
3
+ export type ToggleModel = {
4
+ label?: string;
5
+ checked?: boolean;
6
+ color?: string;
7
+ };
8
+ export declare function Toggle(declaration?: ReactiveNodeDecl<El<HTMLElement, ToggleModel>>): ReactiveNode<El<HTMLElement, ToggleModel>>;
@@ -0,0 +1,40 @@
1
+ import { Transaction, Mode, ReactiveNode } from "reactronic";
2
+ import { Panel, Note } from "verstak";
3
+ import { observableModel } from "./common/Utils.js";
4
+ import { Theme } from "./Theme.js";
5
+ import { Icon } from "./Icon.v.js";
6
+ export function Toggle(declaration) {
7
+ return (Panel(ReactiveNode.withBasis(declaration, {
8
+ mode: Mode.autonomous,
9
+ preparation: el => {
10
+ var _a;
11
+ (_a = el.model) !== null && _a !== void 0 ? _a : (el.model = observableModel({
12
+ label: ReactiveNode.key,
13
+ checked: true,
14
+ color: "green"
15
+ }));
16
+ el.native.onclick = () => Transaction.run(null, () => el.model.checked = !el.model.checked);
17
+ },
18
+ content: el => {
19
+ const m = el.model;
20
+ const theme = Theme.current;
21
+ const toggleTheme = theme.toggle;
22
+ el.useStylingPreset(toggleTheme.main);
23
+ Icon(`fa-solid fa-toggle-${m.checked ? "on" : "off"}`, {
24
+ content: (el, base) => {
25
+ var _a;
26
+ base();
27
+ el.useStylingPreset(toggleTheme.icon);
28
+ el.style.color = m.checked ? ((_a = theme.positiveColor) !== null && _a !== void 0 ? _a : "") : "";
29
+ },
30
+ });
31
+ if (m.label)
32
+ Note(m.label, false, {
33
+ content: (el, base) => {
34
+ base();
35
+ el.useStylingPreset(toggleTheme.label);
36
+ },
37
+ });
38
+ },
39
+ })));
40
+ }
@@ -0,0 +1,9 @@
1
+ export * from "./Button.v.js";
2
+ export * from "./Field.v.js";
3
+ export * from "./Icon.v.js";
4
+ export * from "./Image.v.js";
5
+ export * from "./Spinner.v.js";
6
+ export * from "./Toggle.v.js";
7
+ export * from "./Markdown.v.js";
8
+ export * from "./Theme.js";
9
+ export { observableModel } from "./common/Utils.js";
@@ -0,0 +1,9 @@
1
+ export * from "./Button.v.js";
2
+ export * from "./Field.v.js";
3
+ export * from "./Icon.v.js";
4
+ export * from "./Image.v.js";
5
+ export * from "./Spinner.v.js";
6
+ export * from "./Toggle.v.js";
7
+ export * from "./Markdown.v.js";
8
+ export * from "./Theme.js";
9
+ export { observableModel } from "./common/Utils.js";
@@ -0,0 +1,5 @@
1
+ import { Ref } from "reactronic";
2
+ export type ValuesOrRefs<T> = {
3
+ [K in keyof T]: T[K] | Ref<T[K]>;
4
+ };
5
+ export declare function observableModel<T extends Object>(modelProps: ValuesOrRefs<T>): T;
@@ -0,0 +1,26 @@
1
+ import { ObservableObject, Ref, Transaction, Isolation } from "reactronic";
2
+ export function observableModel(modelProps) {
3
+ return Transaction.run({ isolation: Isolation.disjoinFromOuterTransaction }, () => new ObservableComposition(modelProps));
4
+ }
5
+ class ObservableComposition extends ObservableObject {
6
+ constructor(composition) {
7
+ super();
8
+ convertValuesToFieldsAndRefsToGetSet(this, composition);
9
+ }
10
+ }
11
+ function convertValuesToFieldsAndRefsToGetSet(target, composition) {
12
+ for (const key in composition) {
13
+ const x = composition[key];
14
+ if (x instanceof Ref) {
15
+ Object.defineProperty(target, key, {
16
+ get() { return x.variable; },
17
+ set(v) { x.variable = v; return true; },
18
+ enumerable: true,
19
+ });
20
+ }
21
+ else {
22
+ const t = target;
23
+ t[key] = x;
24
+ }
25
+ }
26
+ }
@@ -0,0 +1,11 @@
1
+ import { Styling } from "./Styling.js";
2
+ export type ButtonStyling = {
3
+ main: string;
4
+ icon: string;
5
+ label: string;
6
+ };
7
+ export declare class DefaultButtonStyling extends Styling implements ButtonStyling {
8
+ get main(): string;
9
+ get icon(): string;
10
+ get label(): string;
11
+ }
@@ -0,0 +1,49 @@
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 { cached } from "reactronic";
11
+ import { css } from "@emotion/css";
12
+ import { Styling } from "./Styling.js";
13
+ export class DefaultButtonStyling extends Styling {
14
+ get main() {
15
+ return css `
16
+ cursor: pointer;
17
+ border-radius: ${this.$.borderRadius};
18
+ user-select: none;
19
+ `;
20
+ }
21
+ get icon() {
22
+ return css `
23
+ min-width: auto;
24
+ margin-left: ${this.$.outlinePadding};
25
+ margin-right: ${this.$.outlinePadding};
26
+ `;
27
+ }
28
+ get label() {
29
+ return css `
30
+ margin-left: ${this.$.outlinePadding};
31
+ margin-right: ${this.$.outlinePadding};
32
+ `;
33
+ }
34
+ }
35
+ __decorate([
36
+ cached,
37
+ __metadata("design:type", String),
38
+ __metadata("design:paramtypes", [])
39
+ ], DefaultButtonStyling.prototype, "main", null);
40
+ __decorate([
41
+ cached,
42
+ __metadata("design:type", String),
43
+ __metadata("design:paramtypes", [])
44
+ ], DefaultButtonStyling.prototype, "icon", null);
45
+ __decorate([
46
+ cached,
47
+ __metadata("design:type", String),
48
+ __metadata("design:paramtypes", [])
49
+ ], DefaultButtonStyling.prototype, "label", null);
@@ -0,0 +1,13 @@
1
+ import { Styling } from "./Styling.js";
2
+ export type FieldStyling = {
3
+ main: string;
4
+ icon: string;
5
+ input: string;
6
+ popup: string;
7
+ };
8
+ export declare class DefaultFieldStyling extends Styling implements FieldStyling {
9
+ get main(): string;
10
+ get icon(): string;
11
+ get input(): string;
12
+ get popup(): string;
13
+ }
@@ -0,0 +1,68 @@
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 { cached } from "reactronic";
11
+ import { css } from "@emotion/css";
12
+ import { Styling } from "./Styling.js";
13
+ export class DefaultFieldStyling extends Styling {
14
+ get main() {
15
+ return css `
16
+ border-radius: ${this.$.borderRadius};
17
+ outline: ${this.$.outlineWidth} solid ${this.$.outlineColor};
18
+ outline-offset: -${this.$.outlineWidth};
19
+ `;
20
+ }
21
+ get icon() {
22
+ return css `
23
+ margin-left: ${this.$.outlinePadding};
24
+ min-width: 1.25em;
25
+ text-align: center;
26
+ color: ${this.$.outlineColor};
27
+ `;
28
+ }
29
+ get input() {
30
+ return css `
31
+ padding: ${this.$.outlinePadding};
32
+ `;
33
+ }
34
+ get popup() {
35
+ return css `
36
+ border-radius: ${this.$.borderRadius};
37
+ outline: ${this.$.outlineWidth} solid ${this.$.outlineColor};
38
+ outline-offset: -${this.$.outlineWidth};
39
+ padding: ${this.$.outlinePadding};
40
+ background-color: ${this.$.fillColor};
41
+ margin-top: -${this.$.outlineWidth};
42
+ margin-bottom: -${this.$.outlineWidth};
43
+ box-shadow: ${this.$.shadow};
44
+ overflow: scroll;
45
+ height: 4rem;
46
+ `;
47
+ }
48
+ }
49
+ __decorate([
50
+ cached,
51
+ __metadata("design:type", String),
52
+ __metadata("design:paramtypes", [])
53
+ ], DefaultFieldStyling.prototype, "main", null);
54
+ __decorate([
55
+ cached,
56
+ __metadata("design:type", String),
57
+ __metadata("design:paramtypes", [])
58
+ ], DefaultFieldStyling.prototype, "icon", null);
59
+ __decorate([
60
+ cached,
61
+ __metadata("design:type", String),
62
+ __metadata("design:paramtypes", [])
63
+ ], DefaultFieldStyling.prototype, "input", null);
64
+ __decorate([
65
+ cached,
66
+ __metadata("design:type", String),
67
+ __metadata("design:paramtypes", [])
68
+ ], DefaultFieldStyling.prototype, "popup", null);
@@ -0,0 +1,7 @@
1
+ import { Styling } from "./Styling.js";
2
+ export type IconStyling = {
3
+ main: string;
4
+ };
5
+ export declare class DefaultIconStyling extends Styling implements IconStyling {
6
+ get main(): string;
7
+ }
@@ -0,0 +1,26 @@
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 { cached } from "reactronic";
11
+ import { css } from "@emotion/css";
12
+ import { Styling } from "./Styling.js";
13
+ export class DefaultIconStyling extends Styling {
14
+ get main() {
15
+ return css `
16
+ min-width: 1.25em;
17
+ min-height: auto;
18
+ text-align: center;
19
+ `;
20
+ }
21
+ }
22
+ __decorate([
23
+ cached,
24
+ __metadata("design:type", String),
25
+ __metadata("design:paramtypes", [])
26
+ ], DefaultIconStyling.prototype, "main", null);
@@ -0,0 +1,16 @@
1
+ import { ObservableObject } from "reactronic";
2
+ export type AbstractTheme = {
3
+ fillColor: string;
4
+ textColor: string;
5
+ positiveColor: string;
6
+ negativeColor: string;
7
+ borderRadius: string;
8
+ outlineWidth: string;
9
+ outlineColor: string;
10
+ outlinePadding: string;
11
+ shadow: string;
12
+ };
13
+ export declare class Styling extends ObservableObject {
14
+ protected readonly $: AbstractTheme;
15
+ constructor($: AbstractTheme);
16
+ }
@@ -0,0 +1,20 @@
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, raw } from "reactronic";
11
+ export class Styling extends ObservableObject {
12
+ constructor($) {
13
+ super();
14
+ this.$ = $;
15
+ }
16
+ }
17
+ __decorate([
18
+ raw,
19
+ __metadata("design:type", Object)
20
+ ], Styling.prototype, "$", void 0);
@@ -0,0 +1,11 @@
1
+ import { Styling } from "./Styling.js";
2
+ export type ToggleStyling = {
3
+ main: string;
4
+ icon: string;
5
+ label: string;
6
+ };
7
+ export declare class DefaultToggleStyling extends Styling implements ToggleStyling {
8
+ get main(): string;
9
+ get icon(): string;
10
+ get label(): string;
11
+ }
@@ -0,0 +1,48 @@
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 { cached } from "reactronic";
11
+ import { css } from "@emotion/css";
12
+ import { Styling } from "./Styling.js";
13
+ export class DefaultToggleStyling extends Styling {
14
+ get main() {
15
+ return css `
16
+ cursor: pointer;
17
+ user-select: none;
18
+ `;
19
+ }
20
+ get icon() {
21
+ return css `
22
+ min-width: auto;
23
+ margin-left: ${this.$.outlinePadding};
24
+ margin-right: ${this.$.outlinePadding};
25
+ `;
26
+ }
27
+ get label() {
28
+ return css `
29
+ margin-left: ${this.$.outlinePadding};
30
+ margin-right: ${this.$.outlinePadding};
31
+ `;
32
+ }
33
+ }
34
+ __decorate([
35
+ cached,
36
+ __metadata("design:type", String),
37
+ __metadata("design:paramtypes", [])
38
+ ], DefaultToggleStyling.prototype, "main", null);
39
+ __decorate([
40
+ cached,
41
+ __metadata("design:type", String),
42
+ __metadata("design:paramtypes", [])
43
+ ], DefaultToggleStyling.prototype, "icon", null);
44
+ __decorate([
45
+ cached,
46
+ __metadata("design:type", String),
47
+ __metadata("design:paramtypes", [])
48
+ ], DefaultToggleStyling.prototype, "label", null);
@@ -1,6 +1,6 @@
1
1
  import { ReactiveNodeDecl, ReactiveNode } from "reactronic";
2
- import { El } from "./El.js";
3
- import { PointerSensor } from "./sensors/PointerSensor.js";
2
+ import { El } from "../core/El.js";
3
+ import { PointerSensor } from "../sensors/PointerSensor.js";
4
4
  export type DragAndDropHandler = (pointer: PointerSensor) => void;
5
5
  export interface DraggableAreaModel {
6
6
  dragStartedAction?: DragAndDropHandler;
@@ -1,6 +1,6 @@
1
1
  import { Mode, ReactiveNode } from "reactronic";
2
2
  import { Div } from "./HtmlElements.js";
3
- import { Handling } from "./Elements.js";
3
+ import { Handling } from "../core/Elements.js";
4
4
  export function DraggableArea(draggingId, builder) {
5
5
  return (Div(ReactiveNode.withBasis(builder, {
6
6
  mode: Mode.autonomous,
@@ -1,5 +1,5 @@
1
- import { DataForSensor } from "./sensors/DataForSensor.js";
2
- import { HtmlSensors } from "./sensors/HtmlSensors.js";
1
+ import { DataForSensor } from "../sensors/DataForSensor.js";
2
+ import { HtmlSensors } from "../sensors/HtmlSensors.js";
3
3
  declare global {
4
4
  interface Element {
5
5
  sensors: HtmlSensors;
@@ -1,5 +1,5 @@
1
- import { SymDataForSensor, SymHtmlSensors, SymResizeObserver } from "./sensors/DataForSensor.js";
2
- import { HtmlSensors } from "./sensors/HtmlSensors.js";
1
+ import { SymDataForSensor, SymHtmlSensors, SymResizeObserver } from "../sensors/DataForSensor.js";
2
+ import { HtmlSensors } from "../sensors/HtmlSensors.js";
3
3
  const ElementType = global.Element;
4
4
  if (ElementType !== undefined) {
5
5
  Object.defineProperty(ElementType.prototype, "sensors", {
@@ -1,7 +1,5 @@
1
- import { ReactiveNode, ReactiveNodeDecl, Script as Scr, ScriptAsync as ScrAsync, Mode } from "reactronic";
2
- import { El } from "./El.js";
3
- export declare function Window(content?: Scr<El<HTMLBodyElement>>, contentAsync?: ScrAsync<El<HTMLBodyElement>>, key?: string, mode?: Mode, preparation?: Scr<El<HTMLBodyElement>>, preparationAsync?: ScrAsync<El<HTMLBodyElement>>, finalization?: Scr<El<HTMLBodyElement>>, triggers?: unknown, basis?: ReactiveNodeDecl<El<HTMLBodyElement>>): ReactiveNode<El<HTMLBodyElement>>;
4
- export declare function Window(declaration?: ReactiveNodeDecl<El<HTMLBodyElement>>): ReactiveNode<El<HTMLBodyElement>>;
1
+ import { ReactiveNode, ReactiveNodeDecl } from "reactronic";
2
+ import { El } from "../core/El.js";
5
3
  export declare function A<M = unknown>(declaration?: ReactiveNodeDecl<El<HTMLAnchorElement, M>>): ReactiveNode<El<HTMLAnchorElement, M>>;
6
4
  export declare function Abbr<M = unknown>(declaration?: ReactiveNodeDecl<El<HTMLElement, M>>): ReactiveNode<El<HTMLElement, M>>;
7
5
  export declare function Address<M = unknown>(declaration?: ReactiveNodeDecl<El<HTMLElement, M>>): ReactiveNode<El<HTMLElement, M>>;
@@ -1,10 +1,6 @@
1
1
  import { ReactiveNode } from "reactronic";
2
- import { ElKind } from "./El.js";
3
- import { StaticDriver, HtmlDriver, SvgDriver } from "./HtmlDriver.js";
4
- export function Window(contentOrDeclaration, contentAsync, key, mode, preparation, preparationAsync, finalization, triggers, basis) {
5
- const driver = new StaticDriver(global.document.body, "Page", false, el => el.kind = ElKind.panel);
6
- return ReactiveNode.declare(driver, contentOrDeclaration, contentAsync, key, mode, preparation, preparationAsync, finalization, triggers, basis);
7
- }
2
+ import { ElKind } from "../core/El.js";
3
+ import { HtmlDriver, SvgDriver } from "../core/WebDriver.js";
8
4
  export function A(declaration) { return ReactiveNode.declare(HtmlTags.a, declaration); }
9
5
  export function Abbr(declaration) { return ReactiveNode.declare(HtmlTags.abbr, declaration); }
10
6
  export function Address(declaration) { return ReactiveNode.declare(HtmlTags.address, declaration); }
@@ -1,22 +1,3 @@
1
- export * from "./ElUtils.js";
2
- export * from "./El.js";
3
- export * from "./HtmlDriver.js";
4
1
  export * from "./HtmlElements.js";
5
2
  export * from "./HtmlApiExt.js";
6
- export * from "./Elements.js";
7
- export * from "./Handlers.js";
8
- export * from "./Sizes.js";
9
- export * from "./SplitViewMath.js";
10
- export * from "./sensors/Sensor.js";
11
- export * from "./sensors/PointerSensor.js";
12
- export * from "./sensors/BasePointerSensor.js";
13
- export * from "./sensors/FocusSensor.js";
14
- export * from "./sensors/ButtonSensor.js";
15
- export * from "./sensors/HoverSensor.js";
16
- export * from "./sensors/WheelSensor.js";
17
- export * from "./sensors/KeyboardSensor.js";
18
- export * from "./sensors/ResizeSensor.js";
19
- export * from "./sensors/HtmlDragSensor.js";
20
- export * from "./sensors/HtmlSensors.js";
21
- export * from "./sensors/WindowSensor.js";
22
3
  import "./HtmlApiExt.js";
@@ -1,22 +1,3 @@
1
- export * from "./ElUtils.js";
2
- export * from "./El.js";
3
- export * from "./HtmlDriver.js";
4
1
  export * from "./HtmlElements.js";
5
2
  export * from "./HtmlApiExt.js";
6
- export * from "./Elements.js";
7
- export * from "./Handlers.js";
8
- export * from "./Sizes.js";
9
- export * from "./SplitViewMath.js";
10
- export * from "./sensors/Sensor.js";
11
- export * from "./sensors/PointerSensor.js";
12
- export * from "./sensors/BasePointerSensor.js";
13
- export * from "./sensors/FocusSensor.js";
14
- export * from "./sensors/ButtonSensor.js";
15
- export * from "./sensors/HoverSensor.js";
16
- export * from "./sensors/WheelSensor.js";
17
- export * from "./sensors/KeyboardSensor.js";
18
- export * from "./sensors/ResizeSensor.js";
19
- export * from "./sensors/HtmlDragSensor.js";
20
- export * from "./sensors/HtmlSensors.js";
21
- export * from "./sensors/WindowSensor.js";
22
3
  import "./HtmlApiExt.js";
@@ -8,7 +8,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
10
  import { options, transactional, LoggingLevel, Transaction } from "reactronic";
11
- import { objectHasMember } from "../ElUtils.js";
11
+ import { objectHasMember } from "../core/ElUtils.js";
12
12
  import { grabElementDataList, SymDataForSensor } from "./DataForSensor.js";
13
13
  import { HtmlElementSensor } from "./HtmlElementSensor.js";
14
14
  export class FocusSensor extends HtmlElementSensor {
@@ -1,7 +1,7 @@
1
1
  import { ToggleRef } from "reactronic";
2
- import { FocusModel } from "./sensors/FocusSensor.js";
3
- import { ResizedElement } from "./sensors/ResizeSensor.js";
4
- import { PointerSensor } from "./sensors/PointerSensor.js";
2
+ import { FocusModel } from "./FocusSensor.js";
3
+ import { ResizedElement } from "./ResizeSensor.js";
4
+ import { PointerSensor } from "./PointerSensor.js";
5
5
  export declare function OnClick(target: HTMLElement, action: ((pointer: PointerSensor) => void) | ToggleRef | undefined, key?: string): void;
6
6
  export declare function OnClickAsync(target: HTMLElement, action: ((pointer: PointerSensor) => Promise<void>) | ToggleRef | undefined, key?: string): void;
7
7
  export declare function OnResize(target: HTMLElement, action: ((element: ResizedElement) => void) | undefined, key?: string): void;
@@ -8,7 +8,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  });
9
9
  };
10
10
  import { Mode, ToggleRef, unobs } from "reactronic";
11
- import { SyntheticElement } from "./Elements.js";
11
+ import { SyntheticElement } from "../core/Elements.js";
12
12
  export function OnClick(target, action, key) {
13
13
  if (action !== undefined) {
14
14
  SyntheticElement({
@@ -1,4 +1,4 @@
1
- import { El } from "../El.js";
1
+ import { El } from "../core/El.js";
2
2
  import { Sensor } from "./Sensor.js";
3
3
  export type ResizedElement = {
4
4
  readonly borderBoxSize: ReadonlyArray<ResizeObserverSize>;
@@ -8,7 +8,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
10
  import { ToggleRef, transactional } from "reactronic";
11
- import { objectHasMember } from "../ElUtils.js";
11
+ import { objectHasMember } from "../core/ElUtils.js";
12
12
  import { Sensor } from "./Sensor.js";
13
13
  export class WindowSensor extends Sensor {
14
14
  constructor() {
@@ -0,0 +1,13 @@
1
+ export * from "./Sensor.js";
2
+ export * from "./PointerSensor.js";
3
+ export * from "./BasePointerSensor.js";
4
+ export * from "./FocusSensor.js";
5
+ export * from "./ButtonSensor.js";
6
+ export * from "./HoverSensor.js";
7
+ export * from "./WheelSensor.js";
8
+ export * from "./KeyboardSensor.js";
9
+ export * from "./ResizeSensor.js";
10
+ export * from "./HtmlDragSensor.js";
11
+ export * from "./HtmlSensors.js";
12
+ export * from "./WindowSensor.js";
13
+ export * from "./Handlers.js";
@@ -0,0 +1,13 @@
1
+ export * from "./Sensor.js";
2
+ export * from "./PointerSensor.js";
3
+ export * from "./BasePointerSensor.js";
4
+ export * from "./FocusSensor.js";
5
+ export * from "./ButtonSensor.js";
6
+ export * from "./HoverSensor.js";
7
+ export * from "./WheelSensor.js";
8
+ export * from "./KeyboardSensor.js";
9
+ export * from "./ResizeSensor.js";
10
+ export * from "./HtmlDragSensor.js";
11
+ export * from "./HtmlSensors.js";
12
+ export * from "./WindowSensor.js";
13
+ export * from "./Handlers.js";