verstak 0.24.311 → 0.24.400
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/html/DraggableArea.view.js +2 -2
- package/build/dist/source/html/Elements.d.ts +6 -6
- package/build/dist/source/html/Elements.js +20 -20
- package/build/dist/source/html/Handlers.js +8 -8
- package/build/dist/source/html/HtmlElements.d.ts +1 -1
- package/build/dist/source/html/HtmlElements.js +2 -2
- package/package.json +8 -8
|
@@ -3,8 +3,8 @@ import { Div } from "./HtmlElements.js";
|
|
|
3
3
|
import { Handling } from "./Elements.js";
|
|
4
4
|
export function DraggableArea(draggingId, builder) {
|
|
5
5
|
return (Div(ReactiveNode.withBasis(builder, {
|
|
6
|
-
mode: Mode.
|
|
7
|
-
|
|
6
|
+
mode: Mode.autonomous,
|
|
7
|
+
content: b => {
|
|
8
8
|
const e = b.native;
|
|
9
9
|
const model = b.model;
|
|
10
10
|
const dataForSensor = e.dataForSensor;
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { ReactiveNodeDecl, ReactiveNodeDriver, ReactiveNode, Script, Mode, MergedItem, ScriptAsync } from "reactronic";
|
|
2
2
|
import { CursorCommandDriver, El, ElPlace } from "./El.js";
|
|
3
3
|
import { HtmlDriver } from "./HtmlDriver.js";
|
|
4
|
-
export declare function Panel<M = unknown>(
|
|
4
|
+
export declare function Panel<M = unknown>(content?: Script<El<HTMLElement, M>>, contentAsync?: ScriptAsync<El<HTMLElement, M>>, key?: string, mode?: Mode, creation?: Script<El<HTMLElement, M>>, creationAsync?: ScriptAsync<El<HTMLElement, M>>, destruction?: Script<El<HTMLElement, M>>, triggers?: unknown, basis?: ReactiveNodeDecl<El<HTMLElement, M>>): ReactiveNode<El<HTMLElement, M>>;
|
|
5
5
|
export declare function Panel<M = unknown>(declaration?: ReactiveNodeDecl<El<HTMLElement, M>>): ReactiveNode<El<HTMLElement, M>>;
|
|
6
|
-
export declare function Table<M = unknown>(
|
|
6
|
+
export declare function Table<M = unknown>(content?: Script<El<HTMLElement, M>>, contentAsync?: ScriptAsync<El<HTMLElement, M>>, key?: string, mode?: Mode, creation?: Script<El<HTMLElement, M>>, creationAsync?: ScriptAsync<El<HTMLElement, M>>, destruction?: Script<El<HTMLElement, M>>, triggers?: unknown, basis?: ReactiveNodeDecl<El<HTMLElement, M>>): ReactiveNode<El<HTMLElement, M>>;
|
|
7
7
|
export declare function Table<M = unknown>(declaration?: ReactiveNodeDecl<El<HTMLElement, M>>): ReactiveNode<El<HTMLElement, M>>;
|
|
8
8
|
export declare function row<T = void>(builder?: (element: void) => T, shiftCursorDown?: number): void;
|
|
9
|
-
export declare function Splitter<M = unknown>(
|
|
9
|
+
export declare function Splitter<M = unknown>(content?: Script<El<HTMLElement, M>>, contentAsync?: ScriptAsync<El<HTMLElement, M>>, key?: string, mode?: Mode, creation?: Script<El<HTMLElement, M>>, creationAsync?: ScriptAsync<El<HTMLElement, M>>, destruction?: Script<El<HTMLElement, M>>, triggers?: unknown, basis?: ReactiveNodeDecl<El<HTMLElement, M>>): ReactiveNode<El<HTMLElement, M>>;
|
|
10
10
|
export declare function Splitter<M = unknown>(declaration?: ReactiveNodeDecl<El<HTMLElement, M>>): ReactiveNode<El<HTMLElement, M>>;
|
|
11
11
|
export declare function rowBreak(shiftCursorDown?: number): void;
|
|
12
12
|
export declare function declareSplitter<T>(index: number, splitViewNode: ReactiveNode<El<T>>): ReactiveNode<El<HTMLElement>>;
|
|
13
13
|
export declare function cursor(areaParams: ElPlace): void;
|
|
14
14
|
export declare function Note(content: string, formatted?: boolean, declaration?: ReactiveNodeDecl<El<HTMLElement, void>>): ReactiveNode<El<HTMLElement, void>>;
|
|
15
|
-
export declare function Group<M = unknown>(
|
|
15
|
+
export declare function Group<M = unknown>(content?: Script<El<HTMLElement, M>>, contentAsync?: ScriptAsync<El<HTMLElement, M>>, key?: string, mode?: Mode, creation?: Script<El<HTMLElement, M>>, creationAsync?: ScriptAsync<El<HTMLElement, M>>, destruction?: Script<El<HTMLElement, M>>, triggers?: unknown, basis?: ReactiveNodeDecl<El<HTMLElement, M>>): ReactiveNode<El<HTMLElement, M>>;
|
|
16
16
|
export declare function Group<M = unknown>(declaration?: ReactiveNodeDecl<El<HTMLElement, M>>): ReactiveNode<El<HTMLElement, M>>;
|
|
17
|
-
export declare function Handling<M = unknown>(
|
|
18
|
-
export declare function SyntheticElement<M = unknown>(
|
|
17
|
+
export declare function Handling<M = unknown>(content: Script<El<void, M>>): ReactiveNode<El<void, M>>;
|
|
18
|
+
export declare function SyntheticElement<M = unknown>(content?: Script<El<void, M>>, contentAsync?: ScriptAsync<El<void, M>>, key?: string, mode?: Mode, creation?: Script<El<void, M>>, creationAsync?: ScriptAsync<El<void, M>>, destruction?: Script<El<void, M>>, triggers?: unknown, basis?: ReactiveNodeDecl<El<void, M>>): ReactiveNode<El<void, M>>;
|
|
19
19
|
export declare function SyntheticElement<M = unknown>(declaration?: ReactiveNodeDecl<El<void, M>>): ReactiveNode<El<void, M>>;
|
|
20
20
|
export declare class PanelDriver<T extends HTMLElement> extends HtmlDriver<T> {
|
|
21
21
|
update(node: ReactiveNode<El<T>>): void | Promise<void>;
|
|
@@ -4,18 +4,18 @@ import { getPrioritiesForEmptySpaceDistribution, getPrioritiesForSizeChanging, r
|
|
|
4
4
|
import { Axis, BodyFontSize, Dimension, toPx } from "./Sizes.js";
|
|
5
5
|
import { HtmlDriver } from "./HtmlDriver.js";
|
|
6
6
|
import { clamp } from "./ElUtils.js";
|
|
7
|
-
export function Panel(
|
|
8
|
-
return ReactiveNode.declare(Drivers.panel,
|
|
7
|
+
export function Panel(contentOrDeclaration, contentAsync, key, mode, creation, creationAsync, destruction, triggers, basis) {
|
|
8
|
+
return ReactiveNode.declare(Drivers.panel, contentOrDeclaration, contentAsync, key, mode, creation, creationAsync, destruction, triggers, basis);
|
|
9
9
|
}
|
|
10
|
-
export function Table(
|
|
11
|
-
return ReactiveNode.declare(Drivers.table,
|
|
10
|
+
export function Table(contentOrDeclaration, contentAsync, key, mode, creation, creationAsync, destruction, triggers, basis) {
|
|
11
|
+
return ReactiveNode.declare(Drivers.table, contentOrDeclaration, contentAsync, key, mode, creation, creationAsync, destruction, triggers, basis);
|
|
12
12
|
}
|
|
13
13
|
export function row(builder, shiftCursorDown) {
|
|
14
14
|
rowBreak(shiftCursorDown);
|
|
15
15
|
builder === null || builder === void 0 ? void 0 : builder();
|
|
16
16
|
}
|
|
17
|
-
export function Splitter(
|
|
18
|
-
return ReactiveNode.declare(Drivers.splitter,
|
|
17
|
+
export function Splitter(contentOrDeclaration, contentAsync, key, mode, creation, creationAsync, destruction, triggers, basis) {
|
|
18
|
+
return ReactiveNode.declare(Drivers.splitter, contentOrDeclaration, contentAsync, key, mode, creation, creationAsync, destruction, triggers, basis);
|
|
19
19
|
}
|
|
20
20
|
export function rowBreak(shiftCursorDown) {
|
|
21
21
|
ReactiveNode.declare(Drivers.partition);
|
|
@@ -24,9 +24,9 @@ export function declareSplitter(index, splitViewNode) {
|
|
|
24
24
|
const key = `splitter-${index}`;
|
|
25
25
|
return (Splitter({
|
|
26
26
|
key,
|
|
27
|
-
mode: Mode.
|
|
27
|
+
mode: Mode.autonomous,
|
|
28
28
|
creation: el => el.native.className = `splitter ${key}`,
|
|
29
|
-
|
|
29
|
+
content: b => {
|
|
30
30
|
const e = b.native;
|
|
31
31
|
const model = b.model;
|
|
32
32
|
const dataForSensor = e.dataForSensor;
|
|
@@ -75,14 +75,14 @@ export function declareSplitter(index, splitViewNode) {
|
|
|
75
75
|
}
|
|
76
76
|
export function cursor(areaParams) {
|
|
77
77
|
ReactiveNode.declare(Drivers.cursor, {
|
|
78
|
-
|
|
78
|
+
content: el => {
|
|
79
79
|
el.place = areaParams;
|
|
80
80
|
},
|
|
81
81
|
});
|
|
82
82
|
}
|
|
83
83
|
export function Note(content, formatted, declaration) {
|
|
84
84
|
return ReactiveNode.declare(Drivers.note, ReactiveNode.withBasis(declaration, {
|
|
85
|
-
|
|
85
|
+
content: el => {
|
|
86
86
|
if (formatted)
|
|
87
87
|
el.native.innerHTML = content;
|
|
88
88
|
else
|
|
@@ -90,14 +90,14 @@ export function Note(content, formatted, declaration) {
|
|
|
90
90
|
},
|
|
91
91
|
}));
|
|
92
92
|
}
|
|
93
|
-
export function Group(
|
|
94
|
-
return ReactiveNode.declare(Drivers.group,
|
|
93
|
+
export function Group(contentOrDeclaration, contentAsync, key, mode, creation, creationAsync, destruction, triggers, basis) {
|
|
94
|
+
return ReactiveNode.declare(Drivers.group, contentOrDeclaration, contentAsync, key, mode, creation, creationAsync, destruction, triggers, basis);
|
|
95
95
|
}
|
|
96
|
-
export function Handling(
|
|
97
|
-
return SyntheticElement({ mode: Mode.
|
|
96
|
+
export function Handling(content) {
|
|
97
|
+
return SyntheticElement({ mode: Mode.autonomous, content });
|
|
98
98
|
}
|
|
99
|
-
export function SyntheticElement(
|
|
100
|
-
return ReactiveNode.declare(Drivers.synthetic,
|
|
99
|
+
export function SyntheticElement(contentOrDeclaration, contentAsync, key, mode, creation, creationAsync, destruction, triggers, basis) {
|
|
100
|
+
return ReactiveNode.declare(Drivers.synthetic, contentOrDeclaration, contentAsync, key, mode, creation, creationAsync, destruction, triggers, basis);
|
|
101
101
|
}
|
|
102
102
|
export class PanelDriver extends HtmlDriver {
|
|
103
103
|
update(node) {
|
|
@@ -122,8 +122,8 @@ export class PanelDriver extends HtmlDriver {
|
|
|
122
122
|
}
|
|
123
123
|
});
|
|
124
124
|
const relayoutEl = SyntheticElement({
|
|
125
|
-
mode: Mode.
|
|
126
|
-
|
|
125
|
+
mode: Mode.autonomous,
|
|
126
|
+
content: () => {
|
|
127
127
|
const native = el.native;
|
|
128
128
|
const isHorizontal = el.splitView === Direction.horizontal;
|
|
129
129
|
if (layoutInfo.isUpdateFinished) {
|
|
@@ -190,7 +190,7 @@ export class PanelDriver extends HtmlDriver {
|
|
|
190
190
|
if (childDeclaration.triggers === undefined)
|
|
191
191
|
childDeclaration.triggers = {};
|
|
192
192
|
Object.defineProperty(childDeclaration.triggers, "index", { value: partCount });
|
|
193
|
-
overrideMethod(childDeclaration, "
|
|
193
|
+
overrideMethod(childDeclaration, "content", el => {
|
|
194
194
|
if (isHorizontal)
|
|
195
195
|
el.style.gridColumn = `${partCount + 1}`;
|
|
196
196
|
else
|
|
@@ -227,7 +227,7 @@ export class PartitionDriver extends HtmlDriver {
|
|
|
227
227
|
if (ownerEl.sealed !== undefined) {
|
|
228
228
|
node.element.style.flexGrow = "1";
|
|
229
229
|
ReactiveNode.declare(Drivers.wrapper, {
|
|
230
|
-
|
|
230
|
+
content: el => {
|
|
231
231
|
const ownerEl = el.node.owner.owner.element;
|
|
232
232
|
if (ownerEl.splitView !== undefined) {
|
|
233
233
|
el.style.display = "grid";
|
|
@@ -13,9 +13,9 @@ export function OnClick(target, action, key) {
|
|
|
13
13
|
if (action !== undefined) {
|
|
14
14
|
SyntheticElement({
|
|
15
15
|
key,
|
|
16
|
-
mode: Mode.
|
|
16
|
+
mode: Mode.autonomous,
|
|
17
17
|
triggers: { target },
|
|
18
|
-
|
|
18
|
+
content: el => {
|
|
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) {
|
|
@@ -33,9 +33,9 @@ export function OnClickAsync(target, action, key) {
|
|
|
33
33
|
if (action !== undefined) {
|
|
34
34
|
SyntheticElement({
|
|
35
35
|
key,
|
|
36
|
-
mode: Mode.
|
|
36
|
+
mode: Mode.autonomous,
|
|
37
37
|
triggers: { target },
|
|
38
|
-
|
|
38
|
+
contentAsync: (el) => __awaiter(this, void 0, void 0, function* () {
|
|
39
39
|
const pointer = target.sensors.pointer;
|
|
40
40
|
if (target.dataForSensor.click !== undefined && pointer.clicked === target.dataForSensor.click || target.dataForSensor.click === undefined && pointer.clicked) {
|
|
41
41
|
if (action instanceof Function) {
|
|
@@ -53,9 +53,9 @@ export function OnResize(target, action, key) {
|
|
|
53
53
|
if (action) {
|
|
54
54
|
SyntheticElement({
|
|
55
55
|
key,
|
|
56
|
-
mode: Mode.
|
|
56
|
+
mode: Mode.autonomous,
|
|
57
57
|
triggers: { target },
|
|
58
|
-
|
|
58
|
+
content: el => {
|
|
59
59
|
const resize = target.sensors.resize;
|
|
60
60
|
resize.resizedElements.forEach(x => {
|
|
61
61
|
action(x);
|
|
@@ -67,12 +67,12 @@ export function OnResize(target, action, key) {
|
|
|
67
67
|
export function OnFocus(target, model, switchEditMode = undefined, key) {
|
|
68
68
|
SyntheticElement({
|
|
69
69
|
key,
|
|
70
|
-
mode: Mode.
|
|
70
|
+
mode: Mode.autonomous,
|
|
71
71
|
triggers: { target, model },
|
|
72
72
|
creation: el => {
|
|
73
73
|
el.node.configureReactronic({ throttling: 0 });
|
|
74
74
|
},
|
|
75
|
-
|
|
75
|
+
content: el => {
|
|
76
76
|
if (switchEditMode === undefined && !(target instanceof HTMLInputElement || target.hasAttribute("tabindex")))
|
|
77
77
|
console.warn(`"${key !== null && key !== void 0 ? key : "noname"}" element must have "tabindex" attribute set in order to be focusable`);
|
|
78
78
|
if (switchEditMode !== undefined) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ReactiveNode, ReactiveNodeDecl, Script as Scr, ScriptAsync as ScrAsync, Mode } from "reactronic";
|
|
2
2
|
import { El } from "./El.js";
|
|
3
|
-
export declare function Page(
|
|
3
|
+
export declare function Page(content?: Scr<El<HTMLBodyElement>>, contentAsync?: ScrAsync<El<HTMLBodyElement>>, key?: string, mode?: Mode, creation?: Scr<El<HTMLBodyElement>>, creationAsync?: ScrAsync<El<HTMLBodyElement>>, destruction?: Scr<El<HTMLBodyElement>>, triggers?: unknown, basis?: ReactiveNodeDecl<El<HTMLBodyElement>>): ReactiveNode<El<HTMLBodyElement>>;
|
|
4
4
|
export declare function Page(declaration?: ReactiveNodeDecl<El<HTMLBodyElement>>): ReactiveNode<El<HTMLBodyElement>>;
|
|
5
5
|
export declare function A<M = unknown>(declaration?: ReactiveNodeDecl<El<HTMLAnchorElement, M>>): ReactiveNode<El<HTMLAnchorElement, M>>;
|
|
6
6
|
export declare function Abbr<M = unknown>(declaration?: ReactiveNodeDecl<El<HTMLElement, M>>): ReactiveNode<El<HTMLElement, M>>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ReactiveNode } from "reactronic";
|
|
2
2
|
import { ElKind } from "./El.js";
|
|
3
3
|
import { StaticDriver, HtmlDriver, SvgDriver } from "./HtmlDriver.js";
|
|
4
|
-
export function Page(
|
|
4
|
+
export function Page(contentOrDeclaration, contentAsync, key, mode, creation, creationAsync, destruction, triggers, basis) {
|
|
5
5
|
const driver = new StaticDriver(global.document.body, "Page", false, el => el.kind = ElKind.panel);
|
|
6
|
-
return ReactiveNode.declare(driver,
|
|
6
|
+
return ReactiveNode.declare(driver, contentOrDeclaration, contentAsync, key, mode, creation, creationAsync, destruction, triggers, basis);
|
|
7
7
|
}
|
|
8
8
|
export function A(declaration) { return ReactiveNode.declare(HtmlTags.a, declaration); }
|
|
9
9
|
export function Abbr(declaration) { return ReactiveNode.declare(HtmlTags.abbr, declaration); }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "verstak",
|
|
3
|
-
"version": "0.24.
|
|
3
|
+
"version": "0.24.400",
|
|
4
4
|
"description": "Verstak - Front-End Library",
|
|
5
5
|
"publisher": "Nezaboodka Software",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -31,15 +31,15 @@
|
|
|
31
31
|
},
|
|
32
32
|
"homepage": "https://github.com/nezaboodka/verstak/blob/master/README.md#readme",
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"reactronic": "^0.24.
|
|
34
|
+
"reactronic": "^0.24.400"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@types/node": "
|
|
38
|
-
"@typescript-eslint/eslint-plugin": "
|
|
39
|
-
"@typescript-eslint/parser": "
|
|
40
|
-
"ava": "6.
|
|
41
|
-
"c8": "
|
|
42
|
-
"eslint": "
|
|
37
|
+
"@types/node": "22.8.5",
|
|
38
|
+
"@typescript-eslint/eslint-plugin": "8.12.2",
|
|
39
|
+
"@typescript-eslint/parser": "8.12.2",
|
|
40
|
+
"ava": "6.2.0",
|
|
41
|
+
"c8": "10.1.2",
|
|
42
|
+
"eslint": "9.13.0",
|
|
43
43
|
"ts-node": "10.9.2",
|
|
44
44
|
"tsconfig-paths": "4.2.0",
|
|
45
45
|
"typescript": "5.5.4"
|