verstak 0.24.268 → 0.24.270

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.
@@ -0,0 +1,11 @@
1
+ import { RxNodeDecl, RxNode } from "reactronic";
2
+ import { El } from "./El.js";
3
+ import { PointerSensor } from "./sensors/PointerSensor.js";
4
+ export type DragAndDropHandler = (pointer: PointerSensor) => void;
5
+ export interface DraggableAreaModel {
6
+ dragStartedAction?: DragAndDropHandler;
7
+ draggingOverAction?: DragAndDropHandler;
8
+ droppedAction?: DragAndDropHandler;
9
+ dragFinishedAction?: DragAndDropHandler;
10
+ }
11
+ export declare function DraggableArea(draggingId: string, builder: RxNodeDecl<El<HTMLDivElement, DraggableAreaModel>>): RxNode<El<HTMLDivElement>>;
@@ -0,0 +1,37 @@
1
+ import { Mode } from "reactronic";
2
+ import { Div } from "./HtmlElements.js";
3
+ import { Handling } from "./Elements.js";
4
+ export function DraggableArea(draggingId, builder) {
5
+ return (Div(builder, {
6
+ mode: Mode.independentUpdate,
7
+ onChange: b => {
8
+ const e = b.native;
9
+ const model = b.model;
10
+ const dataForSensor = e.dataForSensor;
11
+ dataForSensor.draggable = draggingId;
12
+ dataForSensor.drag = draggingId;
13
+ Handling(() => {
14
+ var _a, _b, _c, _d;
15
+ const pointer = e.sensors.pointer;
16
+ if (pointer.dragSource === draggingId) {
17
+ if (pointer.dragStarted) {
18
+ if (pointer.draggingOver) {
19
+ (_a = model === null || model === void 0 ? void 0 : model.draggingOverAction) === null || _a === void 0 ? void 0 : _a.call(model, pointer);
20
+ if (pointer.dropped) {
21
+ (_b = model === null || model === void 0 ? void 0 : model.droppedAction) === null || _b === void 0 ? void 0 : _b.call(model, pointer);
22
+ }
23
+ }
24
+ else {
25
+ e.setAttribute("rx-dragging", "true");
26
+ (_c = model === null || model === void 0 ? void 0 : model.dragStartedAction) === null || _c === void 0 ? void 0 : _c.call(model, pointer);
27
+ }
28
+ if (pointer.dragFinished) {
29
+ (_d = model === null || model === void 0 ? void 0 : model.dragFinishedAction) === null || _d === void 0 ? void 0 : _d.call(model, pointer);
30
+ e.setAttribute("rx-dragging", "false");
31
+ }
32
+ }
33
+ }
34
+ });
35
+ },
36
+ }));
37
+ }
@@ -1,9 +1,7 @@
1
1
  import { RxNode, BaseDriver } from "reactronic";
2
- export declare class ElDriver<T extends Element, M = unknown> extends BaseDriver<El<T, M>> {
3
- allocate(node: RxNode<El<T, M>>): El<T, M>;
4
- }
5
2
  export type El<T = any, M = any> = {
6
3
  readonly node: RxNode<El<T, M>>;
4
+ readonly index: number;
7
5
  native: T;
8
6
  model: M;
9
7
  kind: ElKind;
@@ -11,11 +9,12 @@ export type El<T = any, M = any> = {
11
9
  width: Range;
12
10
  height: Range;
13
11
  alignment: Align;
14
- extraAlignment: Align;
12
+ alignmentInside: Align;
15
13
  stretchingStrengthX: number | undefined;
16
14
  stretchingStrengthY: number | undefined;
17
15
  contentWrapping: boolean;
18
16
  overlayVisible: boolean | undefined;
17
+ splitView: SplitView | undefined;
19
18
  readonly style: CSSStyleDeclaration;
20
19
  useStylingPreset(stylingPresetName: string, enabled?: boolean): void;
21
20
  };
@@ -25,8 +24,9 @@ export declare enum ElKind {
25
24
  note = 2,
26
25
  group = 3,
27
26
  part = 4,
28
- cursor = 5,
29
- native = 6
27
+ splitter = 5,
28
+ cursor = 6,
29
+ native = 7
30
30
  }
31
31
  export type ElCoords = {
32
32
  x1: number;
@@ -37,15 +37,15 @@ export type ElCoords = {
37
37
  export declare enum Align {
38
38
  default = 0,
39
39
  left = 4,
40
- centerWidth = 5,
40
+ centerX = 5,
41
41
  right = 6,
42
- stretchWidth = 7,
42
+ stretchX = 7,
43
43
  top = 32,
44
- centerHeight = 40,
44
+ centerY = 40,
45
45
  bottom = 48,
46
- stretchHeight = 56,
47
- center = 45,
48
- stretch = 63
46
+ stretchY = 56,
47
+ centerXY = 45,
48
+ stretchXY = 63
49
49
  }
50
50
  export type Range = {
51
51
  readonly min?: string;
@@ -58,6 +58,13 @@ export type ElArea = undefined | string | {
58
58
  cellsOverWidth?: number;
59
59
  cellsOverHeight?: number;
60
60
  };
61
+ export declare enum SplitView {
62
+ horizontal = 0,
63
+ vertical = 1
64
+ }
65
+ export declare class ElDriver<T extends Element, M = unknown> extends BaseDriver<El<T, M>> {
66
+ allocate(node: RxNode<El<T, M>>): El<T, M>;
67
+ }
61
68
  export declare class ElImpl<T extends Element = any, M = any> implements El<T, M> {
62
69
  readonly node: RxNode<El<T, M>>;
63
70
  maxColumnCount: number;
@@ -71,14 +78,16 @@ export declare class ElImpl<T extends Element = any, M = any> implements El<T, M
71
78
  private _width;
72
79
  private _height;
73
80
  private _alignment;
74
- private _extraAlignment;
81
+ private _alignmentInside;
75
82
  private _stretchingStrengthX;
76
83
  private _stretchingStrengthY;
77
84
  private _contentWrapping;
78
85
  private _overlayVisible;
86
+ private _splitView;
79
87
  private _hasStylingPresets;
80
88
  constructor(node: RxNode<El<T, M>>);
81
89
  prepareForUpdate(): void;
90
+ get index(): number;
82
91
  get isSection(): boolean;
83
92
  get isTable(): boolean;
84
93
  get isAuxiliary(): boolean;
@@ -88,12 +97,28 @@ export declare class ElImpl<T extends Element = any, M = any> implements El<T, M
88
97
  set area(value: ElArea);
89
98
  get width(): Range;
90
99
  set width(value: Range);
100
+ get widthPx(): {
101
+ minPx: number;
102
+ maxPx: number;
103
+ };
104
+ set widthPx(value: {
105
+ minPx: number;
106
+ maxPx: number;
107
+ });
91
108
  get height(): Range;
92
109
  set height(value: Range);
110
+ get heightPx(): {
111
+ minPx: number;
112
+ maxPx: number;
113
+ };
114
+ set heightPx(value: {
115
+ minPx: number;
116
+ maxPx: number;
117
+ });
93
118
  get alignment(): Align;
94
119
  set alignment(value: Align);
95
- get extraAlignment(): Align;
96
- set extraAlignment(value: Align);
120
+ get alignmentInside(): Align;
121
+ set alignmentInside(value: Align);
97
122
  get stretchingStrengthX(): number | undefined;
98
123
  set stretchingStrengthX(value: number | undefined);
99
124
  get stretchingStrengthY(): number | undefined;
@@ -102,24 +127,48 @@ export declare class ElImpl<T extends Element = any, M = any> implements El<T, M
102
127
  set contentWrapping(value: boolean);
103
128
  get overlayVisible(): boolean | undefined;
104
129
  set overlayVisible(value: boolean | undefined);
130
+ get splitView(): SplitView | undefined;
131
+ set splitView(value: SplitView | undefined);
105
132
  get style(): CSSStyleDeclaration;
106
133
  useStylingPreset(stylingPresetName: string, enabled?: boolean): void;
134
+ protected children(onlyAfter?: ElImpl): Generator<ElImpl>;
135
+ static childrenOf(node: RxNode<El>, onlyAfter?: El): Generator<ElImpl>;
107
136
  private rowBreak;
137
+ private static applyKind;
138
+ private static applyCoords;
139
+ private static applyWidth;
140
+ private static applyHeight;
141
+ private static applyAlignment;
142
+ private static applyStretchingStrengthX;
143
+ private static applyStretchingStrengthY;
144
+ private static applyContentWrapping;
145
+ private static applyOverlayVisible;
146
+ static applySplitView<T extends Element>(element: El<T, any>, value: SplitView | undefined): void;
147
+ private static applyStylingPreset;
108
148
  }
109
- declare class ElLayoutInfo {
149
+ export declare class ElLayoutInfo {
110
150
  x: number;
111
151
  y: number;
112
152
  runningMaxX: number;
113
153
  runningMaxY: number;
154
+ alignerX?: ElImpl;
155
+ alignerY?: ElImpl;
114
156
  flags: ElLayoutInfoFlags;
157
+ effectiveSizePx: number;
158
+ offsetXpx: number;
159
+ offsetYpx: number;
160
+ containerSizeXpx: number;
161
+ containerSizeYpx: number;
115
162
  constructor(prev: ElLayoutInfo);
116
163
  }
117
164
  declare enum ElLayoutInfoFlags {
118
165
  none = 0,
119
166
  ownCursorPosition = 1,
120
167
  usesRunningColumnCount = 2,
121
- usesRunningRowCount = 4
168
+ usesRunningRowCount = 4,
169
+ childrenRelayoutIsNeeded = 8
122
170
  }
171
+ export declare const InitialElLayoutInfo: ElLayoutInfo;
123
172
  export declare class CursorCommand {
124
173
  absolute?: string;
125
174
  columnShift?: number;
@@ -128,23 +177,10 @@ export declare class CursorCommand {
128
177
  export declare class CursorCommandDriver extends ElDriver<Element, unknown> {
129
178
  constructor();
130
179
  }
131
- export declare class Apply {
132
- static kind<T extends Element>(element: ElImpl<T, any>, value: ElKind): void;
133
- static coords<T extends Element>(element: ElImpl<T, any>, value: ElCoords | undefined): void;
134
- static minWidth<T extends Element>(element: ElImpl<T, any>, value: string): void;
135
- static maxWidth<T extends Element>(element: ElImpl<T, any>, value: string): void;
136
- static minHeight<T extends Element>(element: ElImpl<T, any>, value: string): void;
137
- static maxHeight<T extends Element>(element: ElImpl<T, any>, value: string): void;
138
- static alignment<T extends Element>(element: ElImpl<T, any>, primary: Align, extra: Align, strengthX: number | undefined, strengthY: number | undefined): void;
139
- static stretchingStrengthX<T extends Element>(element: ElImpl<T, any>, value: number): void;
140
- static stretchingStrengthY<T extends Element>(element: ElImpl<T, any>, value: number): void;
141
- static contentWrapping<T extends Element>(element: ElImpl<T, any>, value: boolean): void;
142
- static overlayVisible<T extends Element>(element: ElImpl<T, any>, value: boolean | undefined): void;
143
- static stylingPreset<T extends Element>(element: ElImpl<T, any>, secondary: boolean, styleName: string, enabled?: boolean): void;
144
- }
145
180
  export declare const Constants: {
146
181
  element: string;
147
182
  partition: string;
183
+ splitter: string;
148
184
  group: string;
149
185
  layouts: string[];
150
186
  keyAttrName: string;