verstak 0.24.269 → 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,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;
@@ -12,11 +9,12 @@ export type El<T = any, M = any> = {
12
9
  width: Range;
13
10
  height: Range;
14
11
  alignment: Align;
15
- extraAlignment: Align;
12
+ alignmentInside: Align;
16
13
  stretchingStrengthX: number | undefined;
17
14
  stretchingStrengthY: number | undefined;
18
15
  contentWrapping: boolean;
19
16
  overlayVisible: boolean | undefined;
17
+ splitView: SplitView | undefined;
20
18
  readonly style: CSSStyleDeclaration;
21
19
  useStylingPreset(stylingPresetName: string, enabled?: boolean): void;
22
20
  };
@@ -26,8 +24,9 @@ export declare enum ElKind {
26
24
  note = 2,
27
25
  group = 3,
28
26
  part = 4,
29
- cursor = 5,
30
- native = 6
27
+ splitter = 5,
28
+ cursor = 6,
29
+ native = 7
31
30
  }
32
31
  export type ElCoords = {
33
32
  x1: number;
@@ -59,6 +58,13 @@ export type ElArea = undefined | string | {
59
58
  cellsOverWidth?: number;
60
59
  cellsOverHeight?: number;
61
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
+ }
62
68
  export declare class ElImpl<T extends Element = any, M = any> implements El<T, M> {
63
69
  readonly node: RxNode<El<T, M>>;
64
70
  maxColumnCount: number;
@@ -72,11 +78,12 @@ export declare class ElImpl<T extends Element = any, M = any> implements El<T, M
72
78
  private _width;
73
79
  private _height;
74
80
  private _alignment;
75
- private _extraAlignment;
81
+ private _alignmentInside;
76
82
  private _stretchingStrengthX;
77
83
  private _stretchingStrengthY;
78
84
  private _contentWrapping;
79
85
  private _overlayVisible;
86
+ private _splitView;
80
87
  private _hasStylingPresets;
81
88
  constructor(node: RxNode<El<T, M>>);
82
89
  prepareForUpdate(): void;
@@ -90,12 +97,28 @@ export declare class ElImpl<T extends Element = any, M = any> implements El<T, M
90
97
  set area(value: ElArea);
91
98
  get width(): Range;
92
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
+ });
93
108
  get height(): Range;
94
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
+ });
95
118
  get alignment(): Align;
96
119
  set alignment(value: Align);
97
- get extraAlignment(): Align;
98
- set extraAlignment(value: Align);
120
+ get alignmentInside(): Align;
121
+ set alignmentInside(value: Align);
99
122
  get stretchingStrengthX(): number | undefined;
100
123
  set stretchingStrengthX(value: number | undefined);
101
124
  get stretchingStrengthY(): number | undefined;
@@ -104,24 +127,26 @@ export declare class ElImpl<T extends Element = any, M = any> implements El<T, M
104
127
  set contentWrapping(value: boolean);
105
128
  get overlayVisible(): boolean | undefined;
106
129
  set overlayVisible(value: boolean | undefined);
130
+ get splitView(): SplitView | undefined;
131
+ set splitView(value: SplitView | undefined);
107
132
  get style(): CSSStyleDeclaration;
108
133
  useStylingPreset(stylingPresetName: string, enabled?: boolean): void;
109
134
  protected children(onlyAfter?: ElImpl): Generator<ElImpl>;
135
+ static childrenOf(node: RxNode<El>, onlyAfter?: El): Generator<ElImpl>;
110
136
  private rowBreak;
111
137
  private static applyKind;
112
138
  private static applyCoords;
113
- private static applyMinWidth;
114
- private static applyMaxWidth;
115
- private static applyMinHeight;
116
- private static applyMaxHeight;
139
+ private static applyWidth;
140
+ private static applyHeight;
117
141
  private static applyAlignment;
118
142
  private static applyStretchingStrengthX;
119
143
  private static applyStretchingStrengthY;
120
144
  private static applyContentWrapping;
121
145
  private static applyOverlayVisible;
146
+ static applySplitView<T extends Element>(element: El<T, any>, value: SplitView | undefined): void;
122
147
  private static applyStylingPreset;
123
148
  }
124
- declare class ElLayoutInfo {
149
+ export declare class ElLayoutInfo {
125
150
  x: number;
126
151
  y: number;
127
152
  runningMaxX: number;
@@ -129,14 +154,21 @@ declare class ElLayoutInfo {
129
154
  alignerX?: ElImpl;
130
155
  alignerY?: ElImpl;
131
156
  flags: ElLayoutInfoFlags;
157
+ effectiveSizePx: number;
158
+ offsetXpx: number;
159
+ offsetYpx: number;
160
+ containerSizeXpx: number;
161
+ containerSizeYpx: number;
132
162
  constructor(prev: ElLayoutInfo);
133
163
  }
134
164
  declare enum ElLayoutInfoFlags {
135
165
  none = 0,
136
166
  ownCursorPosition = 1,
137
167
  usesRunningColumnCount = 2,
138
- usesRunningRowCount = 4
168
+ usesRunningRowCount = 4,
169
+ childrenRelayoutIsNeeded = 8
139
170
  }
171
+ export declare const InitialElLayoutInfo: ElLayoutInfo;
140
172
  export declare class CursorCommand {
141
173
  absolute?: string;
142
174
  columnShift?: number;
@@ -148,6 +180,7 @@ export declare class CursorCommandDriver extends ElDriver<Element, unknown> {
148
180
  export declare const Constants: {
149
181
  element: string;
150
182
  partition: string;
183
+ splitter: string;
151
184
  group: string;
152
185
  layouts: string[];
153
186
  keyAttrName: string;