verstak 0.96.26021 → 0.96.26023

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.
@@ -1,10 +1,10 @@
1
- import { ReactiveTreeNode, derivative } from "reactronic";
1
+ import { ReactiveTreeNode, setBasis } from "reactronic";
2
2
  import { Block, OnClick } from "verstak";
3
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
- return (Block(derivative(declaration, {
7
+ return (Block(setBasis(declaration, {
8
8
  preparation() {
9
9
  var _a;
10
10
  (_a = this.model) !== null && _a !== void 0 ? _a : (this.model = rxModel({
@@ -1,8 +1,8 @@
1
- import { derivative } from "reactronic";
1
+ import { setBasis } from "reactronic";
2
2
  import { Block } from "verstak";
3
3
  import { Theme } from "./Theme.js";
4
4
  export function Icon(name, declaration) {
5
- return (Block(derivative(declaration, {
5
+ return (Block(setBasis(declaration, {
6
6
  signalArgs: { name },
7
7
  body() {
8
8
  const theme = Theme.current.icon;
@@ -1,8 +1,8 @@
1
- import { derivative } from "reactronic";
1
+ import { setBasis } from "reactronic";
2
2
  import { Block } from "verstak";
3
3
  import { rxModel } from "./common/Utils.js";
4
4
  export function Image(declaration) {
5
- return (Block(derivative(declaration, {
5
+ return (Block(setBasis(declaration, {
6
6
  preparation() {
7
7
  var _a;
8
8
  (_a = this.model) !== null && _a !== void 0 ? _a : (this.model = rxModel({ source: undefined }));
@@ -1,10 +1,10 @@
1
- import { Mode, derivative } from "reactronic";
1
+ import { Mode, setBasis } from "reactronic";
2
2
  import { Block, OnFocus, rowBreak, Fragment, KeyboardModifiers, Horizontal, Vertical } from "verstak";
3
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
- return (Block(derivative(declaration, {
7
+ return (Block(setBasis(declaration, {
8
8
  preparation() {
9
9
  var _a;
10
10
  (_a = this.model) !== null && _a !== void 0 ? _a : (this.model = composeInputModel());
@@ -1,8 +1,8 @@
1
- import { Mode, derivative } from "reactronic";
1
+ import { Mode, setBasis } from "reactronic";
2
2
  import { Block } from "verstak";
3
3
  import { rxModel } from "./common/Utils.js";
4
4
  export function Spinner(declaration) {
5
- return (Block(derivative(declaration, {
5
+ return (Block(setBasis(declaration, {
6
6
  preparation() {
7
7
  var _a;
8
8
  (_a = this.model) !== null && _a !== void 0 ? _a : (this.model = composeSpinnerModel());
@@ -1,10 +1,10 @@
1
- import { ReactiveTreeNode, Mode, derivative } from "reactronic";
1
+ import { ReactiveTreeNode, Mode, setBasis } from "reactronic";
2
2
  import { Block, OnClick } from "verstak";
3
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
- return (Block(derivative(declaration, {
7
+ return (Block(setBasis(declaration, {
8
8
  preparation() {
9
9
  var _a;
10
10
  (_a = this.model) !== null && _a !== void 0 ? _a : (this.model = rxModel({
@@ -95,8 +95,8 @@ export declare class ElImpl<T extends Element = any, M = any> implements El<T, M
95
95
  private static applyCoords;
96
96
  private static applyWidth;
97
97
  private static applyHeight;
98
- private static applyHorizontal;
99
- private static applyVertical;
98
+ private static applyHorizontally;
99
+ private static applyVertically;
100
100
  private static applyStretchingStrengthH;
101
101
  private static applyStretchingStrengthV;
102
102
  private static applyContentWrapping;
@@ -118,7 +118,7 @@ export class ElImpl {
118
118
  set horizontally(value) {
119
119
  const existing = this._horizontal;
120
120
  if (value !== existing) {
121
- ElImpl.applyHorizontal(this, existing, value, this._contentHorizontal, this._contentHorizontal, this._stretchingStrengthHorizontally);
121
+ ElImpl.applyHorizontally(this, existing, value, this._contentHorizontal, this._contentHorizontal, this._stretchingStrengthHorizontally);
122
122
  this._horizontal = value;
123
123
  }
124
124
  }
@@ -126,7 +126,7 @@ export class ElImpl {
126
126
  set vertically(value) {
127
127
  const existing = this._vertical;
128
128
  if (value !== existing) {
129
- ElImpl.applyVertical(this, existing, value, this._contentVertical, this._contentVertical, this._stretchingStrengthVertically);
129
+ ElImpl.applyVertically(this, existing, value, this._contentVertical, this._contentVertical, this._stretchingStrengthVertically);
130
130
  this._vertical = value;
131
131
  }
132
132
  }
@@ -134,7 +134,7 @@ export class ElImpl {
134
134
  set contentHorizontally(value) {
135
135
  const existing = this._contentHorizontal;
136
136
  if (value !== existing) {
137
- ElImpl.applyHorizontal(this, this._horizontal, this._horizontal, existing, value, this._stretchingStrengthHorizontally);
137
+ ElImpl.applyHorizontally(this, this._horizontal, this._horizontal, existing, value, this._stretchingStrengthHorizontally);
138
138
  this._contentHorizontal = value;
139
139
  }
140
140
  }
@@ -142,7 +142,7 @@ export class ElImpl {
142
142
  set contentVertically(value) {
143
143
  const existing = this._contentVertical;
144
144
  if (value !== existing) {
145
- ElImpl.applyVertical(this, this._vertical, this._vertical, existing, value, this._stretchingStrengthVertically);
145
+ ElImpl.applyVertically(this, this._vertical, this._vertical, existing, value, this._stretchingStrengthVertically);
146
146
  this._contentVertical = value;
147
147
  }
148
148
  }
@@ -282,7 +282,7 @@ export class ElImpl {
282
282
  s.maxHeight = (_b = value.max) !== null && _b !== void 0 ? _b : "";
283
283
  }
284
284
  }
285
- static applyHorizontal(element, oldPrimary, newPrimary, oldInside, newInside, strength) {
285
+ static applyHorizontally(element, oldPrimary, newPrimary, oldInside, newInside, strength) {
286
286
  var _a, _b;
287
287
  oldPrimary !== null && oldPrimary !== void 0 ? oldPrimary : (oldPrimary = Horizontal.left);
288
288
  newPrimary !== null && newPrimary !== void 0 ? newPrimary : (newPrimary = Horizontal.left);
@@ -375,7 +375,7 @@ export class ElImpl {
375
375
  if (newPrimary >= Horizontal.stretch && strength === undefined)
376
376
  ElImpl.applyStretchingStrengthH(element, 0, 1);
377
377
  }
378
- static applyVertical(element, oldPrimary, newPrimary, oldInside, newInside, strength) {
378
+ static applyVertically(element, oldPrimary, newPrimary, oldInside, newInside, strength) {
379
379
  oldPrimary !== null && oldPrimary !== void 0 ? oldPrimary : (oldPrimary = Vertical.top);
380
380
  newPrimary !== null && newPrimary !== void 0 ? newPrimary : (newPrimary = Vertical.top);
381
381
  oldInside !== null && oldInside !== void 0 ? oldInside : (oldInside = oldPrimary);
@@ -1,9 +1,9 @@
1
- import { ReactiveTreeNode, ReactiveTreeNodeDecl, ReactiveTreeNodeDriver, Script, Mode, LinkedItem, ScriptAsync } from "reactronic";
1
+ import { ReactiveTreeNode, ReactiveTreeNodeDecl, ReactiveTreeNodeDriver, Script, Mode, LinkedItem, ScriptAsync, Handler } from "reactronic";
2
2
  import { El, ElPlace } from "./El.js";
3
3
  import { CursorCommandDriver } from "./ElDriver.js";
4
4
  import { HtmlDriver } from "./WebDriver.js";
5
- export declare function Window(body?: Script<El<HTMLBodyElement>>, bodyTask?: ScriptAsync<El<HTMLBodyElement>>, key?: string, mode?: Mode, unmounted?: boolean, preparation?: Script<El<HTMLBodyElement>>, preparationTask?: ScriptAsync<El<HTMLBodyElement>>, mounting?: Script<El<HTMLBodyElement>>, finalization?: Script<El<HTMLBodyElement>>, signalArgs?: unknown, basis?: ReactiveTreeNodeDecl<El<HTMLBodyElement>>): ReactiveTreeNode<El<HTMLBodyElement>>;
6
- export declare function Window(declaration?: ReactiveTreeNodeDecl<El<HTMLBodyElement>>): ReactiveTreeNode<El<HTMLBodyElement>>;
5
+ export declare function Window(body?: Script<El<HTMLElement>>, bodyTask?: ScriptAsync<El<HTMLElement>>, key?: string, mode?: Mode, unmounted?: boolean, preparation?: Script<El<HTMLElement>>, preparationTask?: ScriptAsync<El<HTMLElement>>, mounting?: Script<El<HTMLElement>>, finalization?: Script<El<HTMLElement>>, signalArgs?: unknown, basis?: ReactiveTreeNodeDecl<El<HTMLElement>>): ReactiveTreeNode<El<HTMLElement>>;
6
+ export declare function Window(declaration?: ReactiveTreeNodeDecl<El<HTMLElement>>): ReactiveTreeNode<El<HTMLElement>>;
7
7
  export declare function Block<M = unknown>(body?: Script<El<HTMLElement, M>>, bodyTask?: ScriptAsync<El<HTMLElement, M>>, key?: string, mode?: Mode, unmounted?: boolean, preparation?: Script<El<HTMLElement, M>>, preparationTask?: ScriptAsync<El<HTMLElement, M>>, mounting?: Script<El<HTMLElement>>, finalization?: Script<El<HTMLElement, M>>, signalArgs?: unknown, basis?: ReactiveTreeNodeDecl<El<HTMLElement, M>>): ReactiveTreeNode<El<HTMLElement, M>>;
8
8
  export declare function Block<M = unknown>(declaration?: ReactiveTreeNodeDecl<El<HTMLElement, M>>): ReactiveTreeNode<El<HTMLElement, M>>;
9
9
  export declare function Table<M = unknown>(body?: Script<El<HTMLElement, M>>, bodyTask?: ScriptAsync<El<HTMLElement, M>>, key?: string, mode?: Mode, unmounted?: boolean, preparation?: Script<El<HTMLElement, M>>, preparationTask?: ScriptAsync<El<HTMLElement, M>>, mounting?: Script<El<HTMLElement>>, finalization?: Script<El<HTMLElement, M>>, signalArgs?: unknown, basis?: ReactiveTreeNodeDecl<El<HTMLElement, M>>): ReactiveTreeNode<El<HTMLElement, M>>;
@@ -23,6 +23,11 @@ export declare class BlockDriver<T extends HTMLElement> extends HtmlDriver<T> {
23
23
  declareChild(ownerNode: ReactiveTreeNode<El<T, any>>, childDriver: ReactiveTreeNodeDriver<any>, childDeclaration?: ReactiveTreeNodeDecl<any> | undefined, childBasis?: ReactiveTreeNodeDecl<any> | undefined): LinkedItem<ReactiveTreeNode> | undefined;
24
24
  }
25
25
  export declare function isSplitViewPartition(childDriver: ReactiveTreeNodeDriver): boolean;
26
+ export declare class StaticBlockDriver<T extends HTMLElement> extends BlockDriver<T> {
27
+ readonly native: T;
28
+ constructor(native: T, name: string, isPartition: boolean, initialize?: Handler<El<T>>);
29
+ assignNativeElement(node: ReactiveTreeNode<El<T>>): void;
30
+ }
26
31
  export declare class PartitionDriver<T extends HTMLElement> extends HtmlDriver<T> {
27
32
  rebuildBody(node: ReactiveTreeNode<El<T>>): void | Promise<void>;
28
33
  provideHost(node: ReactiveTreeNode<El<T, any>>): ReactiveTreeNode<El<T, any>>;
@@ -4,9 +4,9 @@ import { clamp } from "./ElUtils.js";
4
4
  import { Constants, CursorCommandDriver, ElDriver, ElLayoutInfo, InitialElLayoutInfo } from "./ElDriver.js";
5
5
  import { getPrioritiesForEmptySpaceDistribution, getPrioritiesForSizeChanging, relayout, relayoutUsingSplitter } from "./SplitViewMath.js";
6
6
  import { Axis, BodyFontSize, Dimension, toPx } from "./Sizes.js";
7
- import { HtmlDriver, StaticDriver } from "./WebDriver.js";
7
+ import { HtmlDriver } from "./WebDriver.js";
8
8
  export function Window(bodyOrDeclaration, bodyTask, key, mode, unmounted, preparation, preparationTask, mounting, finalization, signalArgs, basis) {
9
- const driver = new StaticDriver(global.document.body, "Page", false, el => el.kind = ElKind.block);
9
+ const driver = new StaticBlockDriver(global.document.body, "Page", false, el => el.kind = ElKind.block);
10
10
  return declare(driver, bodyOrDeclaration, bodyTask, key, mode, unmounted, preparation, preparationTask, mounting, finalization, signalArgs, basis);
11
11
  }
12
12
  export function Block(bodyOrDeclaration, bodyTask, key, mode, unmounted, preparation, preparationTask, mounting, finalization, signalArgs, basis) {
@@ -211,6 +211,15 @@ function overrideMethod(declaration, method, func) {
211
211
  ? (el, base) => { baseScript.call(el, el, base); func.call(el, el); }
212
212
  : (el, base) => { base(); func.call(el, el); };
213
213
  }
214
+ export class StaticBlockDriver extends BlockDriver {
215
+ constructor(native, name, isPartition, initialize) {
216
+ super(name, isPartition, initialize);
217
+ this.native = native;
218
+ }
219
+ assignNativeElement(node) {
220
+ node.element.native = this.native;
221
+ }
222
+ }
214
223
  export class PartitionDriver extends HtmlDriver {
215
224
  rebuildBody(node) {
216
225
  const result = super.rebuildBody(node);
@@ -17,7 +17,7 @@ export declare class WebDriver<T extends Element, M = unknown> extends ElDriver<
17
17
  }
18
18
  export declare class StaticDriver<T extends HTMLElement> extends WebDriver<T> {
19
19
  readonly native: T;
20
- constructor(native: T, name: string, isRow: boolean, initialize?: Handler<El<T>>);
20
+ constructor(native: T, name: string, isPartition: boolean, initialize?: Handler<El<T>>);
21
21
  assignNativeElement(node: ReactiveTreeNode<El<T>>): void;
22
22
  }
23
23
  export declare class HtmlDriver<T extends HTMLElement, M = any> extends WebDriver<T, M> {
@@ -105,8 +105,8 @@ export class WebDriver extends ElDriver {
105
105
  }
106
106
  }
107
107
  export class StaticDriver extends WebDriver {
108
- constructor(native, name, isRow, initialize) {
109
- super(name, isRow, initialize);
108
+ constructor(native, name, isPartition, initialize) {
109
+ super(name, isPartition, initialize);
110
110
  this.native = native;
111
111
  }
112
112
  assignNativeElement(node) {
@@ -1,8 +1,8 @@
1
- import { derivative } from "reactronic";
1
+ import { setBasis } from "reactronic";
2
2
  import { Div } from "./HtmlElements.js";
3
3
  import { Fragment } from "../core/Elements.js";
4
4
  export function DraggableArea(draggingId, builder) {
5
- return (Div(derivative(builder, {
5
+ return (Div(setBasis(builder, {
6
6
  body() {
7
7
  const e = this.native;
8
8
  const model = this.model;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "verstak",
3
- "version": "0.96.26021",
3
+ "version": "0.96.26023",
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.96.26021"
45
+ "reactronic": "^0.96.26023"
46
46
  },
47
47
  "devDependencies": {
48
48
  "@types/markdown-it": "14.1.2",