verstak 0.24.269 → 0.24.271

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,7 +1,4 @@
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>>;
7
4
  readonly index: number;
@@ -11,12 +8,24 @@ export type El<T = any, M = any> = {
11
8
  area: ElArea;
12
9
  width: Range;
13
10
  height: Range;
14
- alignment: Align;
15
- extraAlignment: Align;
11
+ alignment: Alignment | undefined;
12
+ alignmentInside: Alignment | undefined;
13
+ verticalAlignment: VerticalAlignment | undefined;
14
+ verticalAlignmentInside: VerticalAlignment | undefined;
16
15
  stretchingStrengthX: number | undefined;
17
16
  stretchingStrengthY: number | undefined;
18
17
  contentWrapping: boolean;
19
18
  overlayVisible: boolean | undefined;
19
+ splitView: SplitView | undefined;
20
+ widthPx: {
21
+ minPx: number;
22
+ maxPx: number;
23
+ };
24
+ heightPx: {
25
+ minPx: number;
26
+ maxPx: number;
27
+ };
28
+ partitionSizeInSplitViewPx: number;
20
29
  readonly style: CSSStyleDeclaration;
21
30
  useStylingPreset(stylingPresetName: string, enabled?: boolean): void;
22
31
  };
@@ -26,8 +35,9 @@ export declare enum ElKind {
26
35
  note = 2,
27
36
  group = 3,
28
37
  part = 4,
29
- cursor = 5,
30
- native = 6
38
+ splitter = 5,
39
+ cursor = 6,
40
+ native = 7
31
41
  }
32
42
  export type ElCoords = {
33
43
  x1: number;
@@ -35,22 +45,22 @@ export type ElCoords = {
35
45
  x2: number;
36
46
  y2: number;
37
47
  };
38
- export declare enum Align {
39
- default = 0,
40
- left = 4,
41
- centerX = 5,
42
- right = 6,
43
- stretchX = 7,
44
- top = 32,
45
- centerY = 40,
46
- bottom = 48,
47
- stretchY = 56,
48
- centerXY = 45,
49
- stretchXY = 63
48
+ export declare enum Alignment {
49
+ left = 0,
50
+ center = 1,
51
+ right = 2,
52
+ stretch = 3
53
+ }
54
+ export declare enum VerticalAlignment {
55
+ top = 0,
56
+ center = 1,
57
+ bottom = 2,
58
+ stretch = 3
50
59
  }
51
60
  export type Range = {
52
61
  readonly min?: string;
53
62
  readonly max?: string;
63
+ readonly preferred?: string;
54
64
  };
55
65
  export type MarkedRange = Range & {
56
66
  readonly marker?: string;
@@ -59,6 +69,13 @@ export type ElArea = undefined | string | {
59
69
  cellsOverWidth?: number;
60
70
  cellsOverHeight?: number;
61
71
  };
72
+ export declare enum SplitView {
73
+ horizontal = 0,
74
+ vertical = 1
75
+ }
76
+ export declare class ElDriver<T extends Element, M = unknown> extends BaseDriver<El<T, M>> {
77
+ allocate(node: RxNode<El<T, M>>): El<T, M>;
78
+ }
62
79
  export declare class ElImpl<T extends Element = any, M = any> implements El<T, M> {
63
80
  readonly node: RxNode<El<T, M>>;
64
81
  maxColumnCount: number;
@@ -72,11 +89,14 @@ export declare class ElImpl<T extends Element = any, M = any> implements El<T, M
72
89
  private _width;
73
90
  private _height;
74
91
  private _alignment;
75
- private _extraAlignment;
92
+ private _verticalAlignment;
93
+ private _alignmentInside;
94
+ private _verticalAlignmentInside;
76
95
  private _stretchingStrengthX;
77
96
  private _stretchingStrengthY;
78
97
  private _contentWrapping;
79
98
  private _overlayVisible;
99
+ private _splitView;
80
100
  private _hasStylingPresets;
81
101
  constructor(node: RxNode<El<T, M>>);
82
102
  prepareForUpdate(): void;
@@ -90,12 +110,36 @@ export declare class ElImpl<T extends Element = any, M = any> implements El<T, M
90
110
  set area(value: ElArea);
91
111
  get width(): Range;
92
112
  set width(value: Range);
113
+ get widthPx(): {
114
+ minPx: number;
115
+ maxPx: number;
116
+ };
117
+ set widthPx(value: {
118
+ minPx: number;
119
+ maxPx: number;
120
+ });
121
+ get preferredWidthUsed(): boolean;
122
+ set preferredWidthUsed(value: boolean);
93
123
  get height(): Range;
94
124
  set height(value: Range);
95
- get alignment(): Align;
96
- set alignment(value: Align);
97
- get extraAlignment(): Align;
98
- set extraAlignment(value: Align);
125
+ get heightPx(): {
126
+ minPx: number;
127
+ maxPx: number;
128
+ };
129
+ set heightPx(value: {
130
+ minPx: number;
131
+ maxPx: number;
132
+ });
133
+ get preferredHeightUsed(): boolean;
134
+ set preferredHeightUsed(value: boolean);
135
+ get alignment(): Alignment | undefined;
136
+ set alignment(value: Alignment | undefined);
137
+ get verticalAlignment(): VerticalAlignment | undefined;
138
+ set verticalAlignment(value: VerticalAlignment | undefined);
139
+ get alignmentInside(): Alignment | undefined;
140
+ set alignmentInside(value: Alignment | undefined);
141
+ get verticalAlignmentInside(): VerticalAlignment | undefined;
142
+ set verticalAlignmentInside(value: VerticalAlignment | undefined);
99
143
  get stretchingStrengthX(): number | undefined;
100
144
  set stretchingStrengthX(value: number | undefined);
101
145
  get stretchingStrengthY(): number | undefined;
@@ -104,24 +148,28 @@ export declare class ElImpl<T extends Element = any, M = any> implements El<T, M
104
148
  set contentWrapping(value: boolean);
105
149
  get overlayVisible(): boolean | undefined;
106
150
  set overlayVisible(value: boolean | undefined);
151
+ get splitView(): SplitView | undefined;
152
+ set splitView(value: SplitView | undefined);
153
+ get partitionSizeInSplitViewPx(): number;
107
154
  get style(): CSSStyleDeclaration;
108
155
  useStylingPreset(stylingPresetName: string, enabled?: boolean): void;
109
156
  protected children(onlyAfter?: ElImpl): Generator<ElImpl>;
157
+ static childrenOf(node: RxNode<El>, onlyAfter?: El): Generator<ElImpl>;
110
158
  private rowBreak;
111
159
  private static applyKind;
112
160
  private static applyCoords;
113
- private static applyMinWidth;
114
- private static applyMaxWidth;
115
- private static applyMinHeight;
116
- private static applyMaxHeight;
161
+ private static applyWidth;
162
+ private static applyHeight;
117
163
  private static applyAlignment;
164
+ private static applyVerticalAlignment;
118
165
  private static applyStretchingStrengthX;
119
166
  private static applyStretchingStrengthY;
120
167
  private static applyContentWrapping;
121
168
  private static applyOverlayVisible;
169
+ static applySplitView<T extends Element>(element: El<T, any>, value: SplitView | undefined): void;
122
170
  private static applyStylingPreset;
123
171
  }
124
- declare class ElLayoutInfo {
172
+ export declare class ElLayoutInfo {
125
173
  x: number;
126
174
  y: number;
127
175
  runningMaxX: number;
@@ -129,14 +177,24 @@ declare class ElLayoutInfo {
129
177
  alignerX?: ElImpl;
130
178
  alignerY?: ElImpl;
131
179
  flags: ElLayoutInfoFlags;
180
+ effectiveSizePx: number;
181
+ offsetXpx: number;
182
+ offsetYpx: number;
183
+ contentSizeXpx: number;
184
+ contentSizeYpx: number;
185
+ borderSizeYpx: number;
186
+ borderSizeXpx: number;
187
+ isConstrained: boolean;
132
188
  constructor(prev: ElLayoutInfo);
133
189
  }
134
190
  declare enum ElLayoutInfoFlags {
135
191
  none = 0,
136
192
  ownCursorPosition = 1,
137
193
  usesRunningColumnCount = 2,
138
- usesRunningRowCount = 4
194
+ usesRunningRowCount = 4,
195
+ childrenRelayoutIsNeeded = 8
139
196
  }
197
+ export declare const InitialElLayoutInfo: ElLayoutInfo;
140
198
  export declare class CursorCommand {
141
199
  absolute?: string;
142
200
  columnShift?: number;
@@ -148,6 +206,7 @@ export declare class CursorCommandDriver extends ElDriver<Element, unknown> {
148
206
  export declare const Constants: {
149
207
  element: string;
150
208
  partition: string;
209
+ splitter: string;
151
210
  group: string;
152
211
  layouts: string[];
153
212
  keyAttrName: string;