verstak 0.95.25046 → 0.95.25048
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.
- package/build/dist/source/components/Button.v.js +11 -11
- package/build/dist/source/components/Icon.v.js +4 -4
- package/build/dist/source/components/Image.v.js +8 -8
- package/build/dist/source/components/Input.v.js +23 -23
- package/build/dist/source/components/Markdown.v.js +2 -2
- package/build/dist/source/components/RealTimeClock.d.ts +2 -2
- package/build/dist/source/components/RealTimeClock.js +2 -2
- package/build/dist/source/components/Spinner.v.js +6 -6
- package/build/dist/source/components/Toggle.v.js +13 -13
- package/build/dist/source/components/api.d.ts +1 -1
- package/build/dist/source/components/api.js +1 -1
- package/build/dist/source/components/common/Utils.d.ts +1 -1
- package/build/dist/source/components/common/Utils.js +4 -4
- package/build/dist/source/components/theme/Styling.d.ts +2 -2
- package/build/dist/source/components/theme/Styling.js +2 -2
- package/build/dist/source/core/ElDriver.js +2 -2
- package/build/dist/source/core/Elements.js +27 -25
- package/build/dist/source/core/Restyler.d.ts +2 -2
- package/build/dist/source/core/Restyler.js +3 -3
- package/build/dist/source/core/sensors/Handlers.js +21 -19
- package/build/dist/source/core/sensors/Sensor.d.ts +2 -2
- package/build/dist/source/core/sensors/Sensor.js +2 -2
- package/build/dist/source/html/DraggableArea.view.js +3 -3
- package/package.json +2 -2
|
@@ -1,39 +1,39 @@
|
|
|
1
1
|
import { ReactiveTreeNode, Mode, derivative } from "reactronic";
|
|
2
2
|
import { Block, JustText, OnClick } from "verstak";
|
|
3
|
-
import {
|
|
3
|
+
import { rxModel } from "./common/Utils.js";
|
|
4
4
|
import { Theme } from "./Theme.js";
|
|
5
5
|
import { Icon } from "./Icon.v.js";
|
|
6
6
|
export function Button(declaration) {
|
|
7
7
|
return (Block(derivative(declaration, {
|
|
8
8
|
mode: Mode.autonomous,
|
|
9
|
-
preparation
|
|
9
|
+
preparation() {
|
|
10
10
|
var _a;
|
|
11
|
-
(_a =
|
|
11
|
+
(_a = this.model) !== null && _a !== void 0 ? _a : (this.model = rxModel({
|
|
12
12
|
icon: "fa-solid fa-square",
|
|
13
13
|
label: ReactiveTreeNode.current.key,
|
|
14
14
|
}));
|
|
15
15
|
},
|
|
16
|
-
script
|
|
17
|
-
const m =
|
|
16
|
+
script() {
|
|
17
|
+
const m = this.model;
|
|
18
18
|
const theme = Theme.current.button;
|
|
19
|
-
|
|
19
|
+
this.useStylingPreset(theme.main);
|
|
20
20
|
if (m.icon) {
|
|
21
21
|
Icon(m.icon, {
|
|
22
|
-
script
|
|
22
|
+
script(el, base) {
|
|
23
23
|
base();
|
|
24
|
-
|
|
24
|
+
this.useStylingPreset(theme.icon);
|
|
25
25
|
},
|
|
26
26
|
});
|
|
27
27
|
}
|
|
28
28
|
if (m.label) {
|
|
29
29
|
JustText(m.label, false, {
|
|
30
|
-
script
|
|
30
|
+
script(el, base) {
|
|
31
31
|
base();
|
|
32
|
-
|
|
32
|
+
this.useStylingPreset(theme.label);
|
|
33
33
|
},
|
|
34
34
|
});
|
|
35
35
|
}
|
|
36
|
-
OnClick(
|
|
36
|
+
OnClick(this.native, m.action);
|
|
37
37
|
},
|
|
38
38
|
})));
|
|
39
39
|
}
|
|
@@ -4,11 +4,11 @@ import { Theme } from "./Theme.js";
|
|
|
4
4
|
export function Icon(name, declaration) {
|
|
5
5
|
return (Block(derivative(declaration, {
|
|
6
6
|
mode: Mode.autonomous,
|
|
7
|
-
|
|
8
|
-
script
|
|
7
|
+
signalArgs: { name },
|
|
8
|
+
script() {
|
|
9
9
|
const theme = Theme.current.icon;
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
this.useStylingPreset(name);
|
|
11
|
+
this.useStylingPreset(theme.main);
|
|
12
12
|
},
|
|
13
13
|
})));
|
|
14
14
|
}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { Mode, derivative } from "reactronic";
|
|
2
2
|
import { Block } from "verstak";
|
|
3
|
-
import {
|
|
3
|
+
import { rxModel } from "./common/Utils.js";
|
|
4
4
|
export function Image(declaration) {
|
|
5
5
|
return (Block(derivative(declaration, {
|
|
6
6
|
mode: Mode.autonomous,
|
|
7
|
-
preparation
|
|
7
|
+
preparation() {
|
|
8
8
|
var _a;
|
|
9
|
-
(_a =
|
|
9
|
+
(_a = this.model) !== null && _a !== void 0 ? _a : (this.model = rxModel({ source: undefined }));
|
|
10
10
|
},
|
|
11
|
-
script
|
|
12
|
-
const m =
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
script() {
|
|
12
|
+
const m = this.model;
|
|
13
|
+
this.style.backgroundImage = `url(${m.source})`;
|
|
14
|
+
this.style.backgroundSize = "contain";
|
|
15
|
+
this.style.backgroundRepeat = "no-repeat";
|
|
16
16
|
},
|
|
17
17
|
})));
|
|
18
18
|
}
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import { Mode, derivative } from "reactronic";
|
|
2
2
|
import { Block, JustText, OnFocus, rowBreak, Fragment, KeyboardModifiers, Horizontal, Vertical } from "verstak";
|
|
3
|
-
import {
|
|
3
|
+
import { rxModel } from "./common/Utils.js";
|
|
4
4
|
import { Theme } from "./Theme.js";
|
|
5
5
|
import { Icon } from "./Icon.v.js";
|
|
6
6
|
export function Input(declaration) {
|
|
7
7
|
return (Block(derivative(declaration, {
|
|
8
8
|
mode: Mode.autonomous,
|
|
9
|
-
preparation
|
|
9
|
+
preparation() {
|
|
10
10
|
var _a;
|
|
11
|
-
(_a =
|
|
12
|
-
|
|
11
|
+
(_a = this.model) !== null && _a !== void 0 ? _a : (this.model = composeInputModel());
|
|
12
|
+
this.native.dataForSensor.focus = this.model;
|
|
13
13
|
},
|
|
14
|
-
script
|
|
15
|
-
const m =
|
|
14
|
+
script() {
|
|
15
|
+
const m = this.model;
|
|
16
16
|
const theme = Theme.current.input;
|
|
17
|
-
|
|
17
|
+
this.useStylingPreset(theme.main);
|
|
18
18
|
if (m.icon)
|
|
19
19
|
Icon(m.icon, {
|
|
20
|
-
script
|
|
20
|
+
script(el, base) {
|
|
21
21
|
base();
|
|
22
|
-
|
|
22
|
+
this.useStylingPreset(theme.icon);
|
|
23
23
|
},
|
|
24
24
|
});
|
|
25
25
|
InputField(m, theme);
|
|
@@ -29,7 +29,7 @@ export function Input(declaration) {
|
|
|
29
29
|
}
|
|
30
30
|
export function composeInputModel(props) {
|
|
31
31
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
32
|
-
return
|
|
32
|
+
return rxModel({
|
|
33
33
|
icon: props === null || props === void 0 ? void 0 : props.icon,
|
|
34
34
|
text: (_a = props === null || props === void 0 ? void 0 : props.text) !== null && _a !== void 0 ? _a : "",
|
|
35
35
|
options: (_b = props === null || props === void 0 ? void 0 : props.options) !== null && _b !== void 0 ? _b : [],
|
|
@@ -45,18 +45,18 @@ export function composeInputModel(props) {
|
|
|
45
45
|
function InputField(model, styling) {
|
|
46
46
|
return (JustText(model.text, false, {
|
|
47
47
|
key: InputField.name,
|
|
48
|
-
preparation
|
|
49
|
-
const e =
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
48
|
+
preparation(el, base) {
|
|
49
|
+
const e = this.native;
|
|
50
|
+
this.useStylingPreset(styling.field);
|
|
51
|
+
this.horizontally = Horizontal.stretch;
|
|
52
|
+
this.vertically = Vertical.stretch;
|
|
53
53
|
e.tabIndex = 0;
|
|
54
54
|
e.contentEditable = "true";
|
|
55
55
|
e.dataForSensor.focus = model;
|
|
56
56
|
base();
|
|
57
57
|
},
|
|
58
|
-
script
|
|
59
|
-
const e =
|
|
58
|
+
script() {
|
|
59
|
+
const e = this.native;
|
|
60
60
|
if (!model.isEditMode)
|
|
61
61
|
e.innerText = model.text;
|
|
62
62
|
Fragment(() => {
|
|
@@ -81,10 +81,10 @@ function InputField(model, styling) {
|
|
|
81
81
|
function InputPopup(model, styling) {
|
|
82
82
|
return (Block({
|
|
83
83
|
key: InputPopup.name,
|
|
84
|
-
script
|
|
85
|
-
|
|
86
|
-
Fragment(() => model.position =
|
|
87
|
-
const visible =
|
|
84
|
+
script() {
|
|
85
|
+
this.useStylingPreset(styling.popup);
|
|
86
|
+
Fragment(() => model.position = this.native.sensors.scroll.y);
|
|
87
|
+
const visible = this.overlayVisible = model.isEditMode;
|
|
88
88
|
if (visible) {
|
|
89
89
|
const options = model.options;
|
|
90
90
|
if (options.length > 0) {
|
|
@@ -92,8 +92,8 @@ function InputPopup(model, styling) {
|
|
|
92
92
|
rowBreak();
|
|
93
93
|
JustText(x, false, {
|
|
94
94
|
key: x,
|
|
95
|
-
preparation
|
|
96
|
-
|
|
95
|
+
preparation() {
|
|
96
|
+
this.contentWrapping = false;
|
|
97
97
|
},
|
|
98
98
|
});
|
|
99
99
|
}
|
|
@@ -3,8 +3,8 @@ import Md from "markdown-it";
|
|
|
3
3
|
import * as prism from "prismjs";
|
|
4
4
|
export function Markdown(content) {
|
|
5
5
|
return (JustText(md.render(content), true, {
|
|
6
|
-
preparation
|
|
7
|
-
|
|
6
|
+
preparation(el, base) {
|
|
7
|
+
this.contentWrapping = true;
|
|
8
8
|
base();
|
|
9
9
|
},
|
|
10
10
|
}));
|
|
@@ -7,8 +7,8 @@ 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 {
|
|
11
|
-
export class RealTimeClock extends
|
|
10
|
+
import { RxObject, transaction, reaction } from "reactronic";
|
|
11
|
+
export class RealTimeClock extends RxObject {
|
|
12
12
|
constructor(interval = 1000) {
|
|
13
13
|
super();
|
|
14
14
|
this.hour = 0;
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { Mode, derivative } from "reactronic";
|
|
2
2
|
import { Block, JustText } from "verstak";
|
|
3
|
-
import {
|
|
3
|
+
import { rxModel } from "./common/Utils.js";
|
|
4
4
|
export function Spinner(declaration) {
|
|
5
5
|
return (Block(derivative(declaration, {
|
|
6
6
|
mode: Mode.autonomous,
|
|
7
|
-
preparation
|
|
7
|
+
preparation() {
|
|
8
8
|
var _a;
|
|
9
|
-
(_a =
|
|
9
|
+
(_a = this.model) !== null && _a !== void 0 ? _a : (this.model = composeSpinnerModel());
|
|
10
10
|
},
|
|
11
|
-
script
|
|
12
|
-
const m =
|
|
11
|
+
script() {
|
|
12
|
+
const m = this.model;
|
|
13
13
|
m.active && JustText("loading...");
|
|
14
14
|
},
|
|
15
15
|
})));
|
|
16
16
|
}
|
|
17
17
|
export function composeSpinnerModel(props) {
|
|
18
18
|
var _a, _b;
|
|
19
|
-
return
|
|
19
|
+
return rxModel({
|
|
20
20
|
active: (_a = props === null || props === void 0 ? void 0 : props.active) !== null && _a !== void 0 ? _a : false,
|
|
21
21
|
color: (_b = props === null || props === void 0 ? void 0 : props.color) !== null && _b !== void 0 ? _b : "",
|
|
22
22
|
});
|
|
@@ -1,42 +1,42 @@
|
|
|
1
1
|
import { ReactiveTreeNode, Mode, derivative } from "reactronic";
|
|
2
2
|
import { Block, JustText, OnClick } from "verstak";
|
|
3
|
-
import {
|
|
3
|
+
import { rxModel } from "./common/Utils.js";
|
|
4
4
|
import { Theme } from "./Theme.js";
|
|
5
5
|
import { Icon } from "./Icon.v.js";
|
|
6
6
|
export function Toggle(declaration) {
|
|
7
7
|
return (Block(derivative(declaration, {
|
|
8
8
|
mode: Mode.autonomous,
|
|
9
|
-
preparation
|
|
9
|
+
preparation() {
|
|
10
10
|
var _a;
|
|
11
|
-
(_a =
|
|
11
|
+
(_a = this.model) !== null && _a !== void 0 ? _a : (this.model = rxModel({
|
|
12
12
|
label: ReactiveTreeNode.current.key,
|
|
13
13
|
checked: true,
|
|
14
14
|
color: "green"
|
|
15
15
|
}));
|
|
16
16
|
},
|
|
17
|
-
script
|
|
18
|
-
const m =
|
|
17
|
+
script() {
|
|
18
|
+
const m = this.model;
|
|
19
19
|
const theme = Theme.current;
|
|
20
20
|
const toggleTheme = theme.toggle;
|
|
21
|
-
|
|
21
|
+
this.useStylingPreset(toggleTheme.main);
|
|
22
22
|
Icon(`fa-solid fa-toggle-${m.checked ? "on" : "off"}`, {
|
|
23
|
-
script
|
|
23
|
+
script(el, base) {
|
|
24
24
|
var _a;
|
|
25
25
|
base();
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
this.useStylingPreset(toggleTheme.icon);
|
|
27
|
+
this.style.color = m.checked ? ((_a = theme.positiveColor) !== null && _a !== void 0 ? _a : "") : "";
|
|
28
28
|
},
|
|
29
29
|
});
|
|
30
30
|
if (m.label) {
|
|
31
31
|
JustText(m.label, false, {
|
|
32
|
-
script
|
|
32
|
+
script(el, base) {
|
|
33
33
|
base();
|
|
34
|
-
|
|
34
|
+
this.useStylingPreset(toggleTheme.label);
|
|
35
35
|
},
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
|
-
OnClick(
|
|
39
|
-
|
|
38
|
+
OnClick(this.native, () => {
|
|
39
|
+
this.model.checked = !this.model.checked;
|
|
40
40
|
});
|
|
41
41
|
},
|
|
42
42
|
})));
|
|
@@ -6,5 +6,5 @@ export * from "./Spinner.v.js";
|
|
|
6
6
|
export * from "./Toggle.v.js";
|
|
7
7
|
export * from "./Markdown.v.js";
|
|
8
8
|
export * from "./Theme.js";
|
|
9
|
-
export {
|
|
9
|
+
export { rxModel } from "./common/Utils.js";
|
|
10
10
|
export { RealTimeClock } from "./RealTimeClock.js";
|
|
@@ -6,5 +6,5 @@ export * from "./Spinner.v.js";
|
|
|
6
6
|
export * from "./Toggle.v.js";
|
|
7
7
|
export * from "./Markdown.v.js";
|
|
8
8
|
export * from "./Theme.js";
|
|
9
|
-
export {
|
|
9
|
+
export { rxModel } from "./common/Utils.js";
|
|
10
10
|
export { RealTimeClock } from "./RealTimeClock.js";
|
|
@@ -2,4 +2,4 @@ import { Ref } from "reactronic";
|
|
|
2
2
|
export type ValuesOrRefs<T> = {
|
|
3
3
|
[K in keyof T]: T[K] | Ref<T[K]>;
|
|
4
4
|
};
|
|
5
|
-
export declare function
|
|
5
|
+
export declare function rxModel<T extends Object>(modelProps: ValuesOrRefs<T>): T;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export function
|
|
3
|
-
return runTransactional({ isolation: Isolation.disjoinFromOuterTransaction }, () => new
|
|
1
|
+
import { RxObject, Ref, runTransactional, Isolation } from "reactronic";
|
|
2
|
+
export function rxModel(modelProps) {
|
|
3
|
+
return runTransactional({ isolation: Isolation.disjoinFromOuterTransaction }, () => new RxComposition(modelProps));
|
|
4
4
|
}
|
|
5
|
-
class
|
|
5
|
+
class RxComposition extends RxObject {
|
|
6
6
|
constructor(composition) {
|
|
7
7
|
super();
|
|
8
8
|
convertValuesToFieldsAndRefsToGetSet(this, composition);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { RxObject } from "reactronic";
|
|
2
2
|
export type BasicAbstractTheme = {
|
|
3
3
|
fillColor: string;
|
|
4
4
|
textColor: string;
|
|
@@ -10,7 +10,7 @@ export type BasicAbstractTheme = {
|
|
|
10
10
|
outlinePadding: string;
|
|
11
11
|
shadow: string;
|
|
12
12
|
};
|
|
13
|
-
export declare class Styling extends
|
|
13
|
+
export declare class Styling extends RxObject {
|
|
14
14
|
protected readonly $: BasicAbstractTheme;
|
|
15
15
|
constructor($: BasicAbstractTheme);
|
|
16
16
|
}
|
|
@@ -7,8 +7,8 @@ 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 {
|
|
11
|
-
export class Styling extends
|
|
10
|
+
import { RxObject, signal } from "reactronic";
|
|
11
|
+
export class Styling extends RxObject {
|
|
12
12
|
constructor($) {
|
|
13
13
|
super();
|
|
14
14
|
this.$ = $;
|
|
@@ -7,7 +7,7 @@ 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 { ReactiveTreeNode, BaseDriver, Transaction, signal,
|
|
10
|
+
import { ReactiveTreeNode, BaseDriver, Transaction, signal, RxObject } from "reactronic";
|
|
11
11
|
import { ElKind, Horizontal, Vertical, Direction } from "./El.js";
|
|
12
12
|
import { equalElCoords, parseElCoords } from "./ElUtils.js";
|
|
13
13
|
export class ElDriver extends BaseDriver {
|
|
@@ -535,7 +535,7 @@ export class ElImpl {
|
|
|
535
535
|
native.className = enabled ? styleName : "";
|
|
536
536
|
}
|
|
537
537
|
}
|
|
538
|
-
class Size extends
|
|
538
|
+
class Size extends RxObject {
|
|
539
539
|
constructor() {
|
|
540
540
|
super();
|
|
541
541
|
this.raw = { min: "", max: "" };
|
|
@@ -30,10 +30,12 @@ export function declareSplitter(index, splitViewNode) {
|
|
|
30
30
|
return (Splitter({
|
|
31
31
|
key,
|
|
32
32
|
mode: Mode.autonomous,
|
|
33
|
-
preparation
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
preparation() {
|
|
34
|
+
this.native.className = `splitter ${key}`;
|
|
35
|
+
},
|
|
36
|
+
script() {
|
|
37
|
+
const e = this.native;
|
|
38
|
+
const model = this.model;
|
|
37
39
|
const dataForSensor = e.dataForSensor;
|
|
38
40
|
dataForSensor.draggable = key;
|
|
39
41
|
dataForSensor.drag = key;
|
|
@@ -80,18 +82,18 @@ export function declareSplitter(index, splitViewNode) {
|
|
|
80
82
|
}
|
|
81
83
|
export function cursor(place) {
|
|
82
84
|
declare(Drivers.cursor, {
|
|
83
|
-
script
|
|
84
|
-
|
|
85
|
+
script() {
|
|
86
|
+
this.place = place;
|
|
85
87
|
},
|
|
86
88
|
});
|
|
87
89
|
}
|
|
88
90
|
export function JustText(content, formatted, declaration) {
|
|
89
91
|
return declare(Drivers.text, derivative(declaration, {
|
|
90
|
-
script
|
|
92
|
+
script() {
|
|
91
93
|
if (formatted)
|
|
92
|
-
|
|
94
|
+
this.native.innerHTML = content;
|
|
93
95
|
else
|
|
94
|
-
|
|
96
|
+
this.native.innerText = content;
|
|
95
97
|
},
|
|
96
98
|
}));
|
|
97
99
|
}
|
|
@@ -128,7 +130,7 @@ export class BlockDriver extends HtmlDriver {
|
|
|
128
130
|
});
|
|
129
131
|
const relayoutEl = PseudoElement({
|
|
130
132
|
mode: Mode.autonomous,
|
|
131
|
-
script
|
|
133
|
+
script() {
|
|
132
134
|
const native = el.native;
|
|
133
135
|
const isHorizontal = el.splitView === Direction.horizontal;
|
|
134
136
|
if (layoutInfo.isUpdateFinished) {
|
|
@@ -192,9 +194,9 @@ export class BlockDriver extends HtmlDriver {
|
|
|
192
194
|
}
|
|
193
195
|
const isHorizontal = el.splitView === Direction.horizontal;
|
|
194
196
|
if (childDeclaration !== undefined) {
|
|
195
|
-
if (childDeclaration.
|
|
196
|
-
childDeclaration.
|
|
197
|
-
Object.defineProperty(childDeclaration.
|
|
197
|
+
if (childDeclaration.signalArgs === undefined)
|
|
198
|
+
childDeclaration.signalArgs = {};
|
|
199
|
+
Object.defineProperty(childDeclaration.signalArgs, "index", { value: partCount });
|
|
198
200
|
overrideMethod(childDeclaration, "script", el => {
|
|
199
201
|
if (isHorizontal)
|
|
200
202
|
el.style.gridColumn = `${partCount + 1}`;
|
|
@@ -232,26 +234,26 @@ export class PartitionDriver extends HtmlDriver {
|
|
|
232
234
|
if (ownerEl.sealed !== undefined) {
|
|
233
235
|
node.element.style.flexGrow = "1";
|
|
234
236
|
declare(Drivers.wrapper, {
|
|
235
|
-
script
|
|
236
|
-
const ownerEl =
|
|
237
|
+
script() {
|
|
238
|
+
const ownerEl = this.node.owner.owner.element;
|
|
237
239
|
if (ownerEl.splitView !== undefined) {
|
|
238
|
-
|
|
239
|
-
|
|
240
|
+
this.style.display = "grid";
|
|
241
|
+
this.style.flexDirection = "";
|
|
240
242
|
}
|
|
241
243
|
else {
|
|
242
244
|
if (ownerEl.isTable) {
|
|
243
|
-
|
|
244
|
-
|
|
245
|
+
this.style.display = "contents";
|
|
246
|
+
this.style.flexDirection = "";
|
|
245
247
|
}
|
|
246
248
|
else {
|
|
247
|
-
|
|
248
|
-
|
|
249
|
+
this.style.display = "flex";
|
|
250
|
+
this.style.flexDirection = "row";
|
|
249
251
|
}
|
|
250
252
|
}
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
253
|
+
this.style.position = "absolute";
|
|
254
|
+
this.style.inset = "0";
|
|
255
|
+
this.style.overflow = "auto";
|
|
256
|
+
this.style.gap = "inherit";
|
|
255
257
|
},
|
|
256
258
|
});
|
|
257
259
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export declare function restyler<T>(restyle: () => T):
|
|
2
|
-
export declare class
|
|
1
|
+
export declare function restyler<T>(restyle: () => T): RxStyles<T>;
|
|
2
|
+
export declare class RxStyles<T> {
|
|
3
3
|
private readonly restyle;
|
|
4
4
|
constructor(restyle: () => T);
|
|
5
5
|
protected cache(): T;
|
|
@@ -9,9 +9,9 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
9
9
|
};
|
|
10
10
|
import { cache, runTransactional } from "reactronic";
|
|
11
11
|
export function restyler(restyle) {
|
|
12
|
-
return runTransactional(() => new
|
|
12
|
+
return runTransactional(() => new RxStyles(restyle));
|
|
13
13
|
}
|
|
14
|
-
export class
|
|
14
|
+
export class RxStyles {
|
|
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
|
-
],
|
|
30
|
+
], RxStyles.prototype, "cache", null);
|
|
@@ -14,8 +14,8 @@ export function OnClick(target, action, key) {
|
|
|
14
14
|
PseudoElement({
|
|
15
15
|
key,
|
|
16
16
|
mode: Mode.autonomous,
|
|
17
|
-
|
|
18
|
-
script
|
|
17
|
+
signalArgs: { target },
|
|
18
|
+
script() {
|
|
19
19
|
const pointer = target.sensors.pointer;
|
|
20
20
|
if (target.dataForSensor.click !== undefined && pointer.clicked === target.dataForSensor.click || target.dataForSensor.click === undefined && pointer.clicked) {
|
|
21
21
|
if (action instanceof Function) {
|
|
@@ -34,18 +34,20 @@ export function OnClickAsync(target, action, key) {
|
|
|
34
34
|
PseudoElement({
|
|
35
35
|
key,
|
|
36
36
|
mode: Mode.autonomous,
|
|
37
|
-
|
|
38
|
-
scriptAsync
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
if (
|
|
42
|
-
|
|
37
|
+
signalArgs: { target },
|
|
38
|
+
scriptAsync() {
|
|
39
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
40
|
+
const pointer = target.sensors.pointer;
|
|
41
|
+
if (target.dataForSensor.click !== undefined && pointer.clicked === target.dataForSensor.click || target.dataForSensor.click === undefined && pointer.clicked) {
|
|
42
|
+
if (action instanceof Function) {
|
|
43
|
+
yield runNonReactive(() => action(pointer));
|
|
44
|
+
}
|
|
45
|
+
else if (action instanceof ToggleRef) {
|
|
46
|
+
runNonReactive(() => action.toggle());
|
|
47
|
+
}
|
|
43
48
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}),
|
|
49
|
+
});
|
|
50
|
+
},
|
|
49
51
|
});
|
|
50
52
|
}
|
|
51
53
|
}
|
|
@@ -54,8 +56,8 @@ export function OnResize(target, action, key) {
|
|
|
54
56
|
PseudoElement({
|
|
55
57
|
key,
|
|
56
58
|
mode: Mode.autonomous,
|
|
57
|
-
|
|
58
|
-
script
|
|
59
|
+
signalArgs: { target },
|
|
60
|
+
script() {
|
|
59
61
|
const resize = target.sensors.resize;
|
|
60
62
|
resize.resizedElements.forEach(x => {
|
|
61
63
|
action(x);
|
|
@@ -68,11 +70,11 @@ export function OnFocus(target, model, switchEditMode = undefined, key) {
|
|
|
68
70
|
PseudoElement({
|
|
69
71
|
key,
|
|
70
72
|
mode: Mode.autonomous,
|
|
71
|
-
|
|
72
|
-
preparation
|
|
73
|
-
|
|
73
|
+
signalArgs: { target, model },
|
|
74
|
+
preparation() {
|
|
75
|
+
this.node.configureReactivity({ throttling: 0 });
|
|
74
76
|
},
|
|
75
|
-
script
|
|
77
|
+
script() {
|
|
76
78
|
if (switchEditMode === undefined && !(target instanceof HTMLInputElement || target.hasAttribute("tabindex")))
|
|
77
79
|
console.warn(`"${key !== null && key !== void 0 ? key : "noname"}" element must have "tabindex" attribute set in order to be focusable`);
|
|
78
80
|
if (switchEditMode !== undefined) {
|
|
@@ -4,9 +4,9 @@ import { Fragment } from "../core/Elements.js";
|
|
|
4
4
|
export function DraggableArea(draggingId, builder) {
|
|
5
5
|
return (Div(derivative(builder, {
|
|
6
6
|
mode: Mode.autonomous,
|
|
7
|
-
script
|
|
8
|
-
const e =
|
|
9
|
-
const model =
|
|
7
|
+
script() {
|
|
8
|
+
const e = this.native;
|
|
9
|
+
const model = this.model;
|
|
10
10
|
const dataForSensor = e.dataForSensor;
|
|
11
11
|
dataForSensor.draggable = draggingId;
|
|
12
12
|
dataForSensor.drag = draggingId;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "verstak",
|
|
3
|
-
"version": "0.95.
|
|
3
|
+
"version": "0.95.25048",
|
|
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.30.0",
|
|
45
|
-
"reactronic": "^0.95.
|
|
45
|
+
"reactronic": "^0.95.25048"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@types/markdown-it": "14.1.2",
|