verstak 0.22.516 → 0.23.100

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,8 +1,8 @@
1
- export declare type Render<E = unknown, O = void> = (element: E, options: O) => void | Promise<void>;
2
- export declare type SuperRender<E = unknown, O = void> = ((render: (options: O) => void, element: E) => void);
3
- export declare type AsyncSuperRender<O = unknown, E = void> = ((render: (options: O) => Promise<void>, element: E) => Promise<void>);
4
- export declare type Customize<E = unknown, O = void> = (element: E, options: O) => void;
5
- export declare type AsyncCustomize<E = unknown, O = void> = (element: E, options: O) => Promise<void>;
1
+ export type Render<E = unknown, O = void> = (element: E, options: O) => void | Promise<void>;
2
+ export type SuperRender<E = unknown, O = void> = ((render: (options: O) => void, element: E) => void);
3
+ export type AsyncSuperRender<O = unknown, E = void> = ((render: (options: O) => Promise<void>, element: E) => Promise<void>);
4
+ export type Customize<E = unknown, O = void> = (element: E, options: O) => void;
5
+ export type AsyncCustomize<E = unknown, O = void> = (element: E, options: O) => Promise<void>;
6
6
  export interface RxNodeType<E = unknown, O = void> {
7
7
  readonly name: string;
8
8
  readonly sequential: boolean;
@@ -1,4 +1,9 @@
1
1
  export class RxNode {
2
+ get parent() { return this.host; }
3
+ get revision() { var _a, _b; return (_b = (_a = this.instance) === null || _a === void 0 ? void 0 : _a.revision) !== null && _b !== void 0 ? _b : ~0; }
4
+ get native() { var _a; return (_a = this.instance) === null || _a === void 0 ? void 0 : _a.native; }
5
+ set native(e) { this.instance.native = e; }
6
+ get resizeObserver() { var _a; return (_a = this.instance) === null || _a === void 0 ? void 0 : _a.resizeObserver; }
2
7
  constructor(id, args, render, superRender, priority, childrenShuffling, type, inline, creator, host, instance) {
3
8
  this.id = id;
4
9
  this.args = args;
@@ -14,9 +19,4 @@ export class RxNode {
14
19
  this.old = undefined;
15
20
  this.prevSibling = undefined;
16
21
  }
17
- get parent() { return this.host; }
18
- get revision() { var _a, _b; return (_b = (_a = this.instance) === null || _a === void 0 ? void 0 : _a.revision) !== null && _b !== void 0 ? _b : ~0; }
19
- get native() { var _a; return (_a = this.instance) === null || _a === void 0 ? void 0 : _a.native; }
20
- set native(e) { this.instance.native = e; }
21
- get resizeObserver() { var _a; return (_a = this.instance) === null || _a === void 0 ? void 0 : _a.resizeObserver; }
22
22
  }
@@ -18,7 +18,7 @@ export interface ElasticSize {
18
18
  export interface TrackSize extends ElasticSize {
19
19
  track?: string | number;
20
20
  }
21
- export declare type Cells = undefined | string | number | {
21
+ export type Cells = undefined | string | number | {
22
22
  right?: number;
23
23
  horizontalOverlap?: boolean;
24
24
  down?: number;
@@ -11,7 +11,7 @@ export function getCallerInfo(prefix) {
11
11
  i = i >= 0 ? i + 2 : 5;
12
12
  let caller = extractFunctionAndLocation(lines[i]);
13
13
  let location = caller;
14
- if (caller.func === "VerstakDriver.render" || caller.func === "render") {
14
+ if (caller.func.endsWith(".render")) {
15
15
  i = i - 1;
16
16
  caller = extractFunctionAndLocation(lines[i]);
17
17
  location = extractFunctionAndLocation(lines[i + 1]);
@@ -23,7 +23,7 @@ export function getCallerInfo(prefix) {
23
23
  }
24
24
  location = extractFunctionAndLocation(lines[i + 1]);
25
25
  }
26
- const result = `${prefix}:${caller.func}@${location.file}`;
26
+ const result = `${prefix}·${caller.func}@${location.file}`;
27
27
  return result;
28
28
  }
29
29
  function extractFunctionAndLocation(s) {
@@ -1,28 +1,29 @@
1
1
  import { LoggingOptions, Item, CollectionReader, MemberOptions } from "reactronic";
2
2
  import { CellRange } from "./CellRange";
3
3
  import { Cursor, Align, Cells } from "./Cursor";
4
- export declare type Callback<T = unknown> = (native: T) => void;
5
- export declare type Render<T = unknown, M = unknown, R = void> = (block: VBlock<T, M, R>, base: () => R) => R;
6
- export declare type AsyncRender<T = unknown, M = unknown> = (block: VBlock<T, M, Promise<void>>) => Promise<void>;
4
+ export type Callback<T = unknown> = (native: T) => void;
5
+ export type Operation<T = unknown, M = unknown, R = void> = (block: VBlock<T, M, R>) => R;
6
+ export type VirtualOperation<T = unknown, M = unknown, R = void> = (block: VBlock<T, M, R>, base: () => R) => R;
7
+ export type AsyncOperation<T = unknown, M = unknown> = (block: VBlock<T, M, Promise<void>>) => Promise<void>;
8
+ export type BlockBody<T = unknown, M = unknown, R = void> = Operation<T, M, R> | BlockVmt<T, M, R>;
7
9
  export declare const enum Priority {
8
- SyncP0 = 0,
9
- AsyncP1 = 1,
10
- AsyncP2 = 2
10
+ Realtime = 0,
11
+ Normal = 1,
12
+ Background = 2
11
13
  }
12
- export declare type Type<T> = new (...args: any[]) => T;
13
- export declare type BlockBody<T = unknown, M = unknown, R = void> = Render<T, M, R> | BlockVmt<T, M, R>;
14
14
  export interface BlockVmt<T = unknown, M = unknown, R = void> {
15
+ base?: BlockVmt<T, M, R>;
15
16
  key?: string;
16
- reacting?: boolean;
17
+ autonomous?: boolean;
17
18
  triggers?: unknown;
18
- initialize?: Render<T, M, R>;
19
- override?: Render<T, M, R>;
20
- render?: Render<T, M, R>;
21
- finalize?: Render<T, M, R>;
19
+ initialize?: Operation<T, M, R>;
20
+ render?: Operation<T, M, R>;
21
+ finalize?: Operation<T, M, R>;
22
+ redefinedInitialize?: VirtualOperation<T, M, R>;
23
+ redefinedRender?: VirtualOperation<T, M, R>;
24
+ redefinedFinalize?: VirtualOperation<T, M, R>;
22
25
  }
23
- export declare function asBaseFor<T, M, R>(outer: BlockBody<T, M, R> | undefined, base: BlockBody<T, M, R>): BlockVmt<T, M, R>;
24
- export declare function nestedContext<T extends Object>(type: Type<T>, context: T): void;
25
- export declare function useContext<T extends Object>(type: Type<T>): T;
26
+ export declare function vmt<T, M, R>(body: BlockBody<T, M, R> | undefined): BlockVmt<T, M, R> | undefined;
26
27
  export declare abstract class VBlock<T = unknown, M = unknown, R = void> {
27
28
  static readonly shortFrameDuration = 16;
28
29
  static readonly longFrameDuration = 300;
@@ -42,9 +43,10 @@ export declare abstract class VBlock<T = unknown, M = unknown, R = void> {
42
43
  abstract contentAlignment: Align;
43
44
  abstract frameAlignment: Align;
44
45
  abstract contentWrapping: boolean;
45
- abstract floating: boolean;
46
+ abstract overlayVisible: boolean | undefined;
46
47
  abstract childrenShuffling: boolean;
47
48
  abstract renderingPriority?: Priority;
49
+ abstract style(styleName: string, enabled?: boolean): void;
48
50
  abstract readonly level: number;
49
51
  abstract readonly host: VBlock;
50
52
  abstract readonly children: CollectionReader<VBlock>;
@@ -81,8 +83,9 @@ export declare class AbstractDriver<T> {
81
83
  get isLine(): boolean;
82
84
  constructor(name: string, layout: LayoutKind, createCursor?: () => Cursor);
83
85
  initialize(block: VBlock<T>, native: T): void;
86
+ deploy(block: VBlock<T>): void;
87
+ render(block: VBlock<T>): void | Promise<void>;
84
88
  finalize(block: VBlock<T>, isLeader: boolean): boolean;
85
- deploy(block: VBlock<T>, sequential: boolean): void;
86
89
  applyCellRange(block: VBlock<T, any, any>, cellRange: CellRange | undefined): void;
87
90
  applyWidthGrowth(block: VBlock<T, any, any>, widthGrowth: number): void;
88
91
  applyMinWidth(block: VBlock<T, any, any>, minWidth: string): void;
@@ -93,11 +96,18 @@ export declare class AbstractDriver<T> {
93
96
  applyContentAlignment(block: VBlock<T, any, any>, contentAlignment: Align): void;
94
97
  applyFrameAlignment(block: VBlock<T, any, any>, frameAlignment: Align): void;
95
98
  applyContentWrapping(block: VBlock<T, any, any>, contentWrapping: boolean): void;
96
- applyFloating(block: VBlock<T, any, any>, floating: boolean): void;
97
- render(block: VBlock<T>): void | Promise<void>;
99
+ applyOverlayVisible(block: VBlock<T, any, any>, overlayVisible: boolean | undefined): void;
100
+ applyStyling(block: VBlock<T, any, any>, secondary: boolean, styleName: string, enabled?: boolean): void;
98
101
  }
99
102
  export declare class StaticDriver<T> extends AbstractDriver<T> {
100
103
  readonly element: T;
101
104
  constructor(element: T, name: string, layout: LayoutKind, createCursor?: () => Cursor);
102
105
  initialize(block: VBlock<T>, element: T): void;
103
106
  }
107
+ export declare class ContextVariable<T extends Object = Object> {
108
+ readonly defaultValue: T | undefined;
109
+ constructor(defaultValue?: T);
110
+ set value(value: T);
111
+ get value(): T;
112
+ get valueOrUndefined(): T | undefined;
113
+ }