@solidtv/solid 1.7.3 → 1.8.0-0
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.
- package/MIGRATION-1.8.md +270 -0
- package/dist/src/core/dom-renderer/dashedBorderStyle.d.ts +20 -0
- package/dist/src/core/dom-renderer/dashedBorderStyle.js +104 -0
- package/dist/src/core/dom-renderer/dashedBorderStyle.js.map +1 -0
- package/dist/src/core/dom-renderer/domRenderer.d.ts +14 -0
- package/dist/src/core/dom-renderer/domRenderer.js +194 -12
- package/dist/src/core/dom-renderer/domRenderer.js.map +1 -1
- package/dist/src/core/dom-renderer/domRendererTypes.d.ts +12 -2
- package/dist/src/core/elementNode.d.ts +176 -9
- package/dist/src/core/elementNode.js +1906 -411
- package/dist/src/core/elementNode.js.map +1 -1
- package/dist/src/core/flexLayout.d.ts +6 -0
- package/dist/src/core/flexLayout.js +535 -218
- package/dist/src/core/flexLayout.js.map +1 -1
- package/dist/src/core/focusManager.js +70 -23
- package/dist/src/core/focusManager.js.map +1 -1
- package/dist/src/core/fontLoaded.d.ts +10 -0
- package/dist/src/core/fontLoaded.js +26 -0
- package/dist/src/core/fontLoaded.js.map +1 -0
- package/dist/src/core/intrinsicTypes.d.ts +2 -1
- package/dist/src/core/lightningInit.js +8 -1
- package/dist/src/core/lightningInit.js.map +1 -1
- package/dist/src/core/shaders.d.ts +5 -2
- package/dist/src/core/shaders.js +6 -0
- package/dist/src/core/shaders.js.map +1 -1
- package/dist/src/core/states.d.ts +2 -0
- package/dist/src/core/states.js +26 -7
- package/dist/src/core/states.js.map +1 -1
- package/dist/src/core/stylePlan.d.ts +39 -0
- package/dist/src/core/stylePlan.js +159 -0
- package/dist/src/core/stylePlan.js.map +1 -0
- package/dist/src/core/utils.js +2 -2
- package/dist/src/primitives/Grid.d.ts +7 -1
- package/dist/src/primitives/Grid.jsx +48 -4
- package/dist/src/primitives/Grid.jsx.map +1 -1
- package/dist/src/primitives/Virtual.jsx +16 -6
- package/dist/src/primitives/Virtual.jsx.map +1 -1
- package/dist/src/primitives/useMouse.d.ts +10 -5
- package/dist/src/primitives/useMouse.js +42 -10
- package/dist/src/primitives/useMouse.js.map +1 -1
- package/dist/src/primitives/utils/handleNavigation.js +29 -6
- package/dist/src/primitives/utils/handleNavigation.js.map +1 -1
- package/dist/src/primitives/utils/withScrolling.js +2 -1
- package/dist/src/primitives/utils/withScrolling.js.map +1 -1
- package/dist/src/solidOpts.js +22 -8
- package/dist/src/solidOpts.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/docs/AI_CODING_GUIDELINES.md +7 -6
- package/docs/AI_UPGRADE_1.8.md +290 -0
- package/package.json +5 -3
- package/src/core/dom-renderer/dashedBorderStyle.ts +128 -0
- package/src/core/dom-renderer/domRenderer.ts +201 -10
- package/src/core/dom-renderer/domRendererTypes.ts +12 -0
- package/src/core/elementNode.ts +2124 -459
- package/src/core/flexLayout.ts +583 -231
- package/src/core/focusManager.ts +86 -27
- package/src/core/fontLoaded.ts +29 -0
- package/src/core/intrinsicTypes.ts +2 -0
- package/src/core/lightningInit.ts +8 -1
- package/src/core/shaders.ts +12 -0
- package/src/core/states.ts +29 -9
- package/src/core/stylePlan.ts +195 -0
- package/src/core/utils.ts +2 -2
- package/src/primitives/Grid.tsx +66 -14
- package/src/primitives/Virtual.tsx +20 -6
- package/src/primitives/useMouse.ts +73 -6
- package/src/primitives/utils/handleNavigation.ts +40 -6
- package/src/primitives/utils/withScrolling.ts +3 -2
- package/src/solidOpts.ts +23 -8
- package/dist/src/core/flex.d.ts +0 -2
- package/dist/src/core/flex.js +0 -285
- package/dist/src/core/flex.js.map +0 -1
- package/src/core/flex.ts +0 -332
package/dist/src/core/flex.js
DELETED
|
@@ -1,285 +0,0 @@
|
|
|
1
|
-
import { isTextNode, isElementText } from './utils.js';
|
|
2
|
-
import { isDev } from './env.js';
|
|
3
|
-
export default function (node) {
|
|
4
|
-
const direction = node.flexDirection || 'row';
|
|
5
|
-
const isRow = direction === 'row' || direction === 'row-reverse';
|
|
6
|
-
const isReverse = direction === 'row-reverse' || direction === 'column-reverse';
|
|
7
|
-
const dimension = isRow ? 'width' : 'height';
|
|
8
|
-
const crossDimension = isRow ? 'height' : 'width';
|
|
9
|
-
const marginOne = isRow ? 'marginLeft' : 'marginTop';
|
|
10
|
-
const crossMarginOne = isRow ? 'marginTop' : 'marginLeft';
|
|
11
|
-
const marginTwo = isRow ? 'marginRight' : 'marginBottom';
|
|
12
|
-
const crossMarginTwo = isRow ? 'marginBottom' : 'marginRight';
|
|
13
|
-
const minDimension = isRow ? 'minWidth' : 'minHeight';
|
|
14
|
-
const crossMinDimension = isRow ? 'minHeight' : 'minWidth';
|
|
15
|
-
const children = node.children;
|
|
16
|
-
const numChildren = children.length;
|
|
17
|
-
if (numChildren === 0) {
|
|
18
|
-
return false;
|
|
19
|
-
}
|
|
20
|
-
const processableChildrenIndices = [];
|
|
21
|
-
let hasOrder = false;
|
|
22
|
-
let totalFlexGrow = 0;
|
|
23
|
-
for (let i = 0; i < numChildren; i++) {
|
|
24
|
-
const c = children[i];
|
|
25
|
-
if (isElementText(c) && c.text && !(c.width || c.height)) {
|
|
26
|
-
return false;
|
|
27
|
-
}
|
|
28
|
-
if (isTextNode(c) || c.flexItem === false) {
|
|
29
|
-
continue;
|
|
30
|
-
}
|
|
31
|
-
if (c.flexOrder !== undefined) {
|
|
32
|
-
hasOrder = true;
|
|
33
|
-
}
|
|
34
|
-
const flexGrow = c.flexGrow;
|
|
35
|
-
if (flexGrow !== undefined && flexGrow >= 0) {
|
|
36
|
-
totalFlexGrow += flexGrow;
|
|
37
|
-
}
|
|
38
|
-
if (c[minDimension] && (c[dimension] || 0) < c[minDimension]) {
|
|
39
|
-
c[dimension] = c[minDimension];
|
|
40
|
-
}
|
|
41
|
-
if (c[crossMinDimension] &&
|
|
42
|
-
(c[crossDimension] || 0) < c[crossMinDimension]) {
|
|
43
|
-
c[crossDimension] = c[crossMinDimension];
|
|
44
|
-
}
|
|
45
|
-
processableChildrenIndices.push(i);
|
|
46
|
-
}
|
|
47
|
-
if (hasOrder) {
|
|
48
|
-
processableChildrenIndices.sort((aIdx, bIdx) => {
|
|
49
|
-
const a = children[aIdx];
|
|
50
|
-
const b = children[bIdx];
|
|
51
|
-
return (a.flexOrder || 0) - (b.flexOrder || 0);
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
if (isReverse || node.direction === 'rtl') {
|
|
55
|
-
processableChildrenIndices.reverse();
|
|
56
|
-
}
|
|
57
|
-
const numProcessedChildren = processableChildrenIndices.length;
|
|
58
|
-
if (numProcessedChildren === 0) {
|
|
59
|
-
return false; // No layout changes if no processable children
|
|
60
|
-
}
|
|
61
|
-
const prop = isRow ? 'x' : 'y';
|
|
62
|
-
const crossProp = isRow ? 'y' : 'x';
|
|
63
|
-
const containerSize = Math.max(node[dimension] || 0, node[minDimension] || 0, 0);
|
|
64
|
-
let containerCrossSize = Math.max(node[crossDimension] || 0, node[crossMinDimension] || 0, 0);
|
|
65
|
-
const isWrapReverse = node.flexWrap === 'wrap-reverse';
|
|
66
|
-
const gap = node.gap || 0;
|
|
67
|
-
const justify = node.justifyContent || 'flexStart';
|
|
68
|
-
const nodePadding = node.padding || 0;
|
|
69
|
-
let containerUpdated = false;
|
|
70
|
-
const childMainSizes = new Float32Array(numProcessedChildren);
|
|
71
|
-
const childMarginStarts = new Float32Array(numProcessedChildren);
|
|
72
|
-
const childMarginEnds = new Float32Array(numProcessedChildren);
|
|
73
|
-
const childTotalMainSizes = new Float32Array(numProcessedChildren);
|
|
74
|
-
const childCrossSizes = new Float32Array(numProcessedChildren);
|
|
75
|
-
const childMarginCrossStarts = new Float32Array(numProcessedChildren);
|
|
76
|
-
const childMarginCrossEnds = new Float32Array(numProcessedChildren);
|
|
77
|
-
let sumOfFlexBaseSizesWithMargins = 0;
|
|
78
|
-
for (let idx = 0; idx < numProcessedChildren; idx++) {
|
|
79
|
-
const c = children[processableChildrenIndices[idx]];
|
|
80
|
-
const baseMainSize = c[dimension] || 0;
|
|
81
|
-
const marginStart = c[marginOne] || 0;
|
|
82
|
-
const marginEnd = c[marginTwo] || 0;
|
|
83
|
-
childMainSizes[idx] = baseMainSize;
|
|
84
|
-
childMarginStarts[idx] = marginStart;
|
|
85
|
-
childMarginEnds[idx] = marginEnd;
|
|
86
|
-
childTotalMainSizes[idx] = baseMainSize + marginStart + marginEnd;
|
|
87
|
-
childCrossSizes[idx] = c[crossDimension] || 0;
|
|
88
|
-
childMarginCrossStarts[idx] = c[crossMarginOne] || 0;
|
|
89
|
-
childMarginCrossEnds[idx] = c[crossMarginTwo] || 0;
|
|
90
|
-
sumOfFlexBaseSizesWithMargins += childTotalMainSizes[idx];
|
|
91
|
-
}
|
|
92
|
-
if (totalFlexGrow > 0 && numProcessedChildren > 1) {
|
|
93
|
-
// When flex-grow is used, the container's size is considered fixed for this calculation pass,
|
|
94
|
-
// unless flexBoundary is explicitly set to allow container resizing based on content.
|
|
95
|
-
node.flexBoundary = node.flexBoundary || 'fixed';
|
|
96
|
-
// Calculate the total space occupied by gaps between items.
|
|
97
|
-
const totalGapSpace = numProcessedChildren > 0 ? gap * (numProcessedChildren - 1) : 0;
|
|
98
|
-
// Calculate the available space for flex items to grow into.
|
|
99
|
-
const availableSpace = containerSize - sumOfFlexBaseSizesWithMargins - totalGapSpace;
|
|
100
|
-
if (availableSpace > 0) {
|
|
101
|
-
for (let idx = 0; idx < numProcessedChildren; idx++) {
|
|
102
|
-
const c = children[processableChildrenIndices[idx]];
|
|
103
|
-
const flexGrowValue = c.flexGrow;
|
|
104
|
-
if (flexGrowValue !== undefined && flexGrowValue > 0) {
|
|
105
|
-
const shareOfSpace = (flexGrowValue / totalFlexGrow) * availableSpace;
|
|
106
|
-
const newMainSize = childMainSizes[idx] + shareOfSpace;
|
|
107
|
-
c[dimension] = newMainSize;
|
|
108
|
-
childMainSizes[idx] = newMainSize;
|
|
109
|
-
childTotalMainSizes[idx] =
|
|
110
|
-
newMainSize + childMarginStarts[idx] + childMarginEnds[idx];
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
// prevent infinite loops by only doing this once
|
|
114
|
-
node._containsFlexGrow = node._containsFlexGrow ? null : true;
|
|
115
|
-
}
|
|
116
|
-
else if (node._containsFlexGrow) {
|
|
117
|
-
node._containsFlexGrow = null;
|
|
118
|
-
}
|
|
119
|
-
else if (isDev) {
|
|
120
|
-
// No positive space available for items to grow, or items overflow.
|
|
121
|
-
// flex-grow has no effect in this case.
|
|
122
|
-
console.warn('No available space for flex-grow items to expand, or items overflow.');
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
let totalItemSize = 0;
|
|
126
|
-
if (justify === 'center' ||
|
|
127
|
-
justify === 'spaceBetween' ||
|
|
128
|
-
justify === 'spaceEvenly' ||
|
|
129
|
-
justify === 'spaceAround') {
|
|
130
|
-
for (let idx = 0; idx < numProcessedChildren; idx++) {
|
|
131
|
-
totalItemSize += childTotalMainSizes[idx];
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
const align = node.alignItems || (node.flexWrap ? 'flexStart' : undefined);
|
|
135
|
-
const doCrossAlign = containerCrossSize
|
|
136
|
-
? (c, idx, crossCurrentPos = 0) => {
|
|
137
|
-
const alignSelf = c.alignSelf || align;
|
|
138
|
-
if (!alignSelf) {
|
|
139
|
-
return;
|
|
140
|
-
}
|
|
141
|
-
if (alignSelf === 'flexStart') {
|
|
142
|
-
c[crossProp] = crossCurrentPos + childMarginCrossStarts[idx];
|
|
143
|
-
}
|
|
144
|
-
else if (alignSelf === 'center') {
|
|
145
|
-
c[crossProp] =
|
|
146
|
-
crossCurrentPos +
|
|
147
|
-
(containerCrossSize - childCrossSizes[idx]) / 2 +
|
|
148
|
-
childMarginCrossStarts[idx];
|
|
149
|
-
}
|
|
150
|
-
else if (alignSelf === 'flexEnd') {
|
|
151
|
-
c[crossProp] =
|
|
152
|
-
crossCurrentPos +
|
|
153
|
-
containerCrossSize -
|
|
154
|
-
childCrossSizes[idx] -
|
|
155
|
-
childMarginCrossEnds[idx];
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
: (_c, _idx, _crossCurrentPos = 0) => {
|
|
159
|
-
/* no-op */
|
|
160
|
-
};
|
|
161
|
-
if (isRow && node._calcHeight && !node.flexCrossBoundary) {
|
|
162
|
-
let maxHeight = 0;
|
|
163
|
-
for (let idx = 0; idx < numProcessedChildren; idx++) {
|
|
164
|
-
if (childCrossSizes[idx] > maxHeight)
|
|
165
|
-
maxHeight = childCrossSizes[idx];
|
|
166
|
-
}
|
|
167
|
-
const newHeight = maxHeight || node.height;
|
|
168
|
-
if (newHeight !== node.height) {
|
|
169
|
-
containerUpdated = true;
|
|
170
|
-
node.height = containerCrossSize = newHeight;
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
let currentPos = nodePadding;
|
|
174
|
-
if (justify === 'flexStart') {
|
|
175
|
-
if (node.flexWrap === 'wrap' || isWrapReverse) {
|
|
176
|
-
const childCrossSizeVar = numProcessedChildren > 0 ? childCrossSizes[0] : containerCrossSize;
|
|
177
|
-
let crossCurrentPos = isWrapReverse
|
|
178
|
-
? containerCrossSize - childCrossSizeVar
|
|
179
|
-
: 0;
|
|
180
|
-
const crossGap = isRow ? (node.columnGap ?? gap) : (node.rowGap ?? gap);
|
|
181
|
-
for (let idx = 0; idx < numProcessedChildren; idx++) {
|
|
182
|
-
const c = children[processableChildrenIndices[idx]];
|
|
183
|
-
if (currentPos + childTotalMainSizes[idx] > containerSize &&
|
|
184
|
-
currentPos > nodePadding) {
|
|
185
|
-
currentPos = nodePadding;
|
|
186
|
-
crossCurrentPos += isWrapReverse
|
|
187
|
-
? -(childCrossSizeVar + crossGap)
|
|
188
|
-
: childCrossSizeVar + crossGap;
|
|
189
|
-
}
|
|
190
|
-
c[prop] = currentPos + childMarginStarts[idx];
|
|
191
|
-
currentPos += childTotalMainSizes[idx] + gap;
|
|
192
|
-
doCrossAlign(c, idx, crossCurrentPos);
|
|
193
|
-
}
|
|
194
|
-
const finalCrossSize = isWrapReverse
|
|
195
|
-
? containerCrossSize - crossCurrentPos
|
|
196
|
-
: crossCurrentPos + childCrossSizeVar;
|
|
197
|
-
if (node[crossDimension] !== finalCrossSize) {
|
|
198
|
-
node[`preFlex${crossDimension}`] = node[crossDimension];
|
|
199
|
-
node[crossDimension] = finalCrossSize;
|
|
200
|
-
containerUpdated = true;
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
else {
|
|
204
|
-
for (let idx = 0; idx < numProcessedChildren; idx++) {
|
|
205
|
-
const c = children[processableChildrenIndices[idx]];
|
|
206
|
-
c[prop] = currentPos + childMarginStarts[idx];
|
|
207
|
-
currentPos += childTotalMainSizes[idx] + gap;
|
|
208
|
-
doCrossAlign(c, idx);
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
// Update container size
|
|
212
|
-
if (node.flexBoundary !== 'fixed' && node.flexWrap !== 'wrap') {
|
|
213
|
-
let calculatedSize = currentPos - gap + nodePadding;
|
|
214
|
-
const minSize = node[minDimension] || 0;
|
|
215
|
-
if (calculatedSize < minSize) {
|
|
216
|
-
calculatedSize = minSize;
|
|
217
|
-
}
|
|
218
|
-
if (calculatedSize !== (node[dimension] || 0)) {
|
|
219
|
-
// store the original size for Row & Column
|
|
220
|
-
node[`preFlex${dimension}`] = containerSize;
|
|
221
|
-
node[dimension] = calculatedSize;
|
|
222
|
-
return true;
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
else if (justify === 'flexEnd') {
|
|
227
|
-
currentPos = containerSize - nodePadding;
|
|
228
|
-
for (let idx = numProcessedChildren - 1; idx >= 0; idx--) {
|
|
229
|
-
const c = children[processableChildrenIndices[idx]];
|
|
230
|
-
c[prop] = currentPos - childMainSizes[idx] - childMarginEnds[idx];
|
|
231
|
-
currentPos -= childTotalMainSizes[idx] + gap;
|
|
232
|
-
doCrossAlign(c, idx);
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
else if (justify === 'center') {
|
|
236
|
-
currentPos =
|
|
237
|
-
(containerSize - (totalItemSize + gap * (numProcessedChildren - 1))) / 2 +
|
|
238
|
-
nodePadding;
|
|
239
|
-
for (let idx = 0; idx < numProcessedChildren; idx++) {
|
|
240
|
-
const c = children[processableChildrenIndices[idx]];
|
|
241
|
-
c[prop] = currentPos + childMarginStarts[idx];
|
|
242
|
-
currentPos += childTotalMainSizes[idx] + gap;
|
|
243
|
-
doCrossAlign(c, idx);
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
else if (justify === 'spaceBetween') {
|
|
247
|
-
const spaceBetween = numProcessedChildren > 1
|
|
248
|
-
? (containerSize - totalItemSize - nodePadding * 2) /
|
|
249
|
-
(numProcessedChildren - 1)
|
|
250
|
-
: 0;
|
|
251
|
-
currentPos = nodePadding;
|
|
252
|
-
for (let idx = 0; idx < numProcessedChildren; idx++) {
|
|
253
|
-
const c = children[processableChildrenIndices[idx]];
|
|
254
|
-
c[prop] = currentPos + childMarginStarts[idx];
|
|
255
|
-
currentPos += childTotalMainSizes[idx] + spaceBetween;
|
|
256
|
-
doCrossAlign(c, idx);
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
else if (justify === 'spaceAround') {
|
|
260
|
-
const spaceAround = numProcessedChildren > 0
|
|
261
|
-
? (containerSize - totalItemSize - nodePadding * 2) /
|
|
262
|
-
numProcessedChildren
|
|
263
|
-
: 0;
|
|
264
|
-
currentPos = nodePadding + spaceAround / 2;
|
|
265
|
-
for (let idx = 0; idx < numProcessedChildren; idx++) {
|
|
266
|
-
const c = children[processableChildrenIndices[idx]];
|
|
267
|
-
c[prop] = currentPos + childMarginStarts[idx];
|
|
268
|
-
currentPos += childTotalMainSizes[idx] + spaceAround;
|
|
269
|
-
doCrossAlign(c, idx);
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
else if (justify === 'spaceEvenly') {
|
|
273
|
-
const spaceEvenly = (containerSize - totalItemSize - nodePadding * 2) /
|
|
274
|
-
(numProcessedChildren + 1);
|
|
275
|
-
currentPos = spaceEvenly + nodePadding;
|
|
276
|
-
for (let idx = 0; idx < numProcessedChildren; idx++) {
|
|
277
|
-
const c = children[processableChildrenIndices[idx]];
|
|
278
|
-
c[prop] = currentPos + childMarginStarts[idx];
|
|
279
|
-
currentPos += childTotalMainSizes[idx] + spaceEvenly;
|
|
280
|
-
doCrossAlign(c, idx);
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
return containerUpdated;
|
|
284
|
-
}
|
|
285
|
-
//# sourceMappingURL=flex.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"flex.js","sourceRoot":"","sources":["../../../src/core/flex.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEjC,MAAM,CAAC,OAAO,WAAW,IAAiB;IACxC,MAAM,SAAS,GAAG,IAAI,CAAC,aAAa,IAAI,KAAK,CAAC;IAC9C,MAAM,KAAK,GAAG,SAAS,KAAK,KAAK,IAAI,SAAS,KAAK,aAAa,CAAC;IACjE,MAAM,SAAS,GACb,SAAS,KAAK,aAAa,IAAI,SAAS,KAAK,gBAAgB,CAAC;IAChE,MAAM,SAAS,GAAG,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC;IAC7C,MAAM,cAAc,GAAG,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC;IAClD,MAAM,SAAS,GAAG,KAAK,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,WAAW,CAAC;IACrD,MAAM,cAAc,GAAG,KAAK,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,YAAY,CAAC;IAC1D,MAAM,SAAS,GAAG,KAAK,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAA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B,CAAC,CAAC,CAAC,CAAC;QACR,UAAU,GAAG,WAAW,GAAG,WAAW,GAAG,CAAC,CAAC;QAC3C,KAAK,IAAI,GAAG,GAAG,CAAC,EAAE,GAAG,GAAG,oBAAoB,EAAE,GAAG,EAAE,EAAE,CAAC;YACpD,MAAM,CAAC,GAAG,QAAQ,CAAC,0BAA0B,CAAC,GAAG,CAAE,CAAgB,CAAC;YACpE,CAAC,CAAC,IAAI,CAAC,GAAG,UAAU,GAAG,iBAAiB,CAAC,GAAG,CAAE,CAAC;YAC/C,UAAU,IAAI,mBAAmB,CAAC,GAAG,CAAE,GAAG,WAAW,CAAC;YACtD,YAAY,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;QACvB,CAAC;IACH,CAAC;SAAM,IAAI,OAAO,KAAK,aAAa,EAAE,CAAC;QACrC,MAAM,WAAW,GACf,CAAC,aAAa,GAAG,aAAa,GAAG,WAAW,GAAG,CAAC,CAAC;YACjD,CAAC,oBAAoB,GAAG,CAAC,CAAC,CAAC;QAC7B,UAAU,GAAG,WAAW,GAAG,WAAW,CAAC;QACvC,KAAK,IAAI,GAAG,GAAG,CAAC,EAAE,GAAG,GAAG,oBAAoB,EAAE,GAAG,EAAE,EAAE,CAAC;YACpD,MAAM,CAAC,GAAG,QAAQ,CAAC,0BAA0B,CAAC,GAAG,CAAE,CAAgB,CAAC;YACpE,CAAC,CAAC,IAAI,CAAC,GAAG,UAAU,GAAG,iBAAiB,CAAC,GAAG,CAAE,CAAC;YAC/C,UAAU,IAAI,mBAAmB,CAAC,GAAG,CAAE,GAAG,WAAW,CAAC;YACtD,YAAY,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;QACvB,CAAC;IACH,CAAC;IAED,OAAO,gBAAgB,CAAC;AAC1B,CAAC"}
|
package/src/core/flex.ts
DELETED
|
@@ -1,332 +0,0 @@
|
|
|
1
|
-
import { type ElementNode } from './elementNode.js';
|
|
2
|
-
import { isTextNode, isElementText } from './utils.js';
|
|
3
|
-
import { isDev } from './env.js';
|
|
4
|
-
|
|
5
|
-
export default function (node: ElementNode): boolean {
|
|
6
|
-
const direction = node.flexDirection || 'row';
|
|
7
|
-
const isRow = direction === 'row' || direction === 'row-reverse';
|
|
8
|
-
const isReverse =
|
|
9
|
-
direction === 'row-reverse' || direction === 'column-reverse';
|
|
10
|
-
const dimension = isRow ? 'width' : 'height';
|
|
11
|
-
const crossDimension = isRow ? 'height' : 'width';
|
|
12
|
-
const marginOne = isRow ? 'marginLeft' : 'marginTop';
|
|
13
|
-
const crossMarginOne = isRow ? 'marginTop' : 'marginLeft';
|
|
14
|
-
const marginTwo = isRow ? 'marginRight' : 'marginBottom';
|
|
15
|
-
const crossMarginTwo = isRow ? 'marginBottom' : 'marginRight';
|
|
16
|
-
const minDimension = isRow ? 'minWidth' : 'minHeight';
|
|
17
|
-
const crossMinDimension = isRow ? 'minHeight' : 'minWidth';
|
|
18
|
-
|
|
19
|
-
const children = node.children;
|
|
20
|
-
const numChildren = children.length;
|
|
21
|
-
|
|
22
|
-
if (numChildren === 0) {
|
|
23
|
-
return false;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
const processableChildrenIndices: number[] = [];
|
|
27
|
-
let hasOrder = false;
|
|
28
|
-
let totalFlexGrow = 0;
|
|
29
|
-
|
|
30
|
-
for (let i = 0; i < numChildren; i++) {
|
|
31
|
-
const c = children[i]!;
|
|
32
|
-
|
|
33
|
-
if (isElementText(c) && c.text && !(c.width || c.height)) {
|
|
34
|
-
return false;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
if (isTextNode(c) || c.flexItem === false) {
|
|
38
|
-
continue;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
if (c.flexOrder !== undefined) {
|
|
42
|
-
hasOrder = true;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
const flexGrow = c.flexGrow;
|
|
46
|
-
if (flexGrow !== undefined && flexGrow >= 0) {
|
|
47
|
-
totalFlexGrow += flexGrow;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
if (c[minDimension] && (c[dimension] || 0) < c[minDimension]) {
|
|
51
|
-
c[dimension] = c[minDimension]!;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
if (
|
|
55
|
-
c[crossMinDimension] &&
|
|
56
|
-
(c[crossDimension] || 0) < c[crossMinDimension]
|
|
57
|
-
) {
|
|
58
|
-
c[crossDimension] = c[crossMinDimension]!;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
processableChildrenIndices.push(i);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
if (hasOrder) {
|
|
65
|
-
processableChildrenIndices.sort((aIdx, bIdx) => {
|
|
66
|
-
const a = children[aIdx] as ElementNode;
|
|
67
|
-
const b = children[bIdx] as ElementNode;
|
|
68
|
-
return (a.flexOrder || 0) - (b.flexOrder || 0);
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
if (isReverse || node.direction === 'rtl') {
|
|
73
|
-
processableChildrenIndices.reverse();
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
const numProcessedChildren = processableChildrenIndices.length;
|
|
77
|
-
if (numProcessedChildren === 0) {
|
|
78
|
-
return false; // No layout changes if no processable children
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
const prop = isRow ? 'x' : 'y';
|
|
82
|
-
const crossProp = isRow ? 'y' : 'x';
|
|
83
|
-
const containerSize = Math.max(
|
|
84
|
-
node[dimension] || 0,
|
|
85
|
-
node[minDimension] || 0,
|
|
86
|
-
0,
|
|
87
|
-
);
|
|
88
|
-
let containerCrossSize = Math.max(
|
|
89
|
-
node[crossDimension] || 0,
|
|
90
|
-
node[crossMinDimension] || 0,
|
|
91
|
-
0,
|
|
92
|
-
);
|
|
93
|
-
const isWrapReverse = node.flexWrap === 'wrap-reverse';
|
|
94
|
-
const gap = node.gap || 0;
|
|
95
|
-
const justify = node.justifyContent || 'flexStart';
|
|
96
|
-
const nodePadding = (node.padding as number) || 0;
|
|
97
|
-
let containerUpdated = false;
|
|
98
|
-
|
|
99
|
-
const childMainSizes = new Float32Array(numProcessedChildren);
|
|
100
|
-
const childMarginStarts = new Float32Array(numProcessedChildren);
|
|
101
|
-
const childMarginEnds = new Float32Array(numProcessedChildren);
|
|
102
|
-
const childTotalMainSizes = new Float32Array(numProcessedChildren);
|
|
103
|
-
const childCrossSizes = new Float32Array(numProcessedChildren);
|
|
104
|
-
const childMarginCrossStarts = new Float32Array(numProcessedChildren);
|
|
105
|
-
const childMarginCrossEnds = new Float32Array(numProcessedChildren);
|
|
106
|
-
|
|
107
|
-
let sumOfFlexBaseSizesWithMargins = 0;
|
|
108
|
-
|
|
109
|
-
for (let idx = 0; idx < numProcessedChildren; idx++) {
|
|
110
|
-
const c = children[processableChildrenIndices[idx]!] as ElementNode;
|
|
111
|
-
|
|
112
|
-
const baseMainSize = c[dimension] || 0;
|
|
113
|
-
const marginStart = (c[marginOne] as number) || 0;
|
|
114
|
-
const marginEnd = (c[marginTwo] as number) || 0;
|
|
115
|
-
|
|
116
|
-
childMainSizes[idx] = baseMainSize;
|
|
117
|
-
childMarginStarts[idx] = marginStart;
|
|
118
|
-
childMarginEnds[idx] = marginEnd;
|
|
119
|
-
childTotalMainSizes[idx] = baseMainSize + marginStart + marginEnd;
|
|
120
|
-
|
|
121
|
-
childCrossSizes[idx] = c[crossDimension] || 0;
|
|
122
|
-
childMarginCrossStarts[idx] = (c[crossMarginOne] as number) || 0;
|
|
123
|
-
childMarginCrossEnds[idx] = (c[crossMarginTwo] as number) || 0;
|
|
124
|
-
|
|
125
|
-
sumOfFlexBaseSizesWithMargins += childTotalMainSizes[idx]!;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
if (totalFlexGrow > 0 && numProcessedChildren > 1) {
|
|
129
|
-
// When flex-grow is used, the container's size is considered fixed for this calculation pass,
|
|
130
|
-
// unless flexBoundary is explicitly set to allow container resizing based on content.
|
|
131
|
-
node.flexBoundary = node.flexBoundary || 'fixed';
|
|
132
|
-
|
|
133
|
-
// Calculate the total space occupied by gaps between items.
|
|
134
|
-
const totalGapSpace =
|
|
135
|
-
numProcessedChildren > 0 ? gap * (numProcessedChildren - 1) : 0;
|
|
136
|
-
|
|
137
|
-
// Calculate the available space for flex items to grow into.
|
|
138
|
-
const availableSpace =
|
|
139
|
-
containerSize - sumOfFlexBaseSizesWithMargins - totalGapSpace;
|
|
140
|
-
|
|
141
|
-
if (availableSpace > 0) {
|
|
142
|
-
for (let idx = 0; idx < numProcessedChildren; idx++) {
|
|
143
|
-
const c = children[processableChildrenIndices[idx]!] as ElementNode;
|
|
144
|
-
const flexGrowValue = c.flexGrow;
|
|
145
|
-
if (flexGrowValue !== undefined && flexGrowValue > 0) {
|
|
146
|
-
const shareOfSpace = (flexGrowValue / totalFlexGrow) * availableSpace;
|
|
147
|
-
const newMainSize = childMainSizes[idx]! + shareOfSpace;
|
|
148
|
-
c[dimension] = newMainSize;
|
|
149
|
-
childMainSizes[idx] = newMainSize;
|
|
150
|
-
childTotalMainSizes[idx] =
|
|
151
|
-
newMainSize + childMarginStarts[idx]! + childMarginEnds[idx]!;
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
// prevent infinite loops by only doing this once
|
|
155
|
-
node._containsFlexGrow = node._containsFlexGrow ? null : true;
|
|
156
|
-
} else if (node._containsFlexGrow) {
|
|
157
|
-
node._containsFlexGrow = null;
|
|
158
|
-
} else if (isDev) {
|
|
159
|
-
// No positive space available for items to grow, or items overflow.
|
|
160
|
-
// flex-grow has no effect in this case.
|
|
161
|
-
console.warn(
|
|
162
|
-
'No available space for flex-grow items to expand, or items overflow.',
|
|
163
|
-
);
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
let totalItemSize = 0;
|
|
168
|
-
if (
|
|
169
|
-
justify === 'center' ||
|
|
170
|
-
justify === 'spaceBetween' ||
|
|
171
|
-
justify === 'spaceEvenly' ||
|
|
172
|
-
justify === 'spaceAround'
|
|
173
|
-
) {
|
|
174
|
-
for (let idx = 0; idx < numProcessedChildren; idx++) {
|
|
175
|
-
totalItemSize += childTotalMainSizes[idx]!;
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
const align = node.alignItems || (node.flexWrap ? 'flexStart' : undefined);
|
|
180
|
-
const doCrossAlign = containerCrossSize
|
|
181
|
-
? (c: ElementNode, idx: number, crossCurrentPos: number = 0) => {
|
|
182
|
-
const alignSelf = c.alignSelf || align;
|
|
183
|
-
if (!alignSelf) {
|
|
184
|
-
return;
|
|
185
|
-
}
|
|
186
|
-
if (alignSelf === 'flexStart') {
|
|
187
|
-
c[crossProp] = crossCurrentPos + childMarginCrossStarts[idx]!;
|
|
188
|
-
} else if (alignSelf === 'center') {
|
|
189
|
-
c[crossProp] =
|
|
190
|
-
crossCurrentPos +
|
|
191
|
-
(containerCrossSize - childCrossSizes[idx]!) / 2 +
|
|
192
|
-
childMarginCrossStarts[idx]!;
|
|
193
|
-
} else if (alignSelf === 'flexEnd') {
|
|
194
|
-
c[crossProp] =
|
|
195
|
-
crossCurrentPos +
|
|
196
|
-
containerCrossSize -
|
|
197
|
-
childCrossSizes[idx]! -
|
|
198
|
-
childMarginCrossEnds[idx]!;
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
: (_c: ElementNode, _idx: number, _crossCurrentPos: number = 0) => {
|
|
202
|
-
/* no-op */
|
|
203
|
-
};
|
|
204
|
-
|
|
205
|
-
if (isRow && node._calcHeight && !node.flexCrossBoundary) {
|
|
206
|
-
let maxHeight = 0;
|
|
207
|
-
for (let idx = 0; idx < numProcessedChildren; idx++) {
|
|
208
|
-
if (childCrossSizes[idx]! > maxHeight) maxHeight = childCrossSizes[idx]!;
|
|
209
|
-
}
|
|
210
|
-
const newHeight = maxHeight || node.height;
|
|
211
|
-
if (newHeight !== node.height) {
|
|
212
|
-
containerUpdated = true;
|
|
213
|
-
node.height = containerCrossSize = newHeight;
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
let currentPos = nodePadding;
|
|
218
|
-
if (justify === 'flexStart') {
|
|
219
|
-
if (node.flexWrap === 'wrap' || isWrapReverse) {
|
|
220
|
-
const childCrossSizeVar =
|
|
221
|
-
numProcessedChildren > 0 ? childCrossSizes[0]! : containerCrossSize;
|
|
222
|
-
let crossCurrentPos = isWrapReverse
|
|
223
|
-
? containerCrossSize - childCrossSizeVar
|
|
224
|
-
: 0;
|
|
225
|
-
const crossGap = isRow ? (node.columnGap ?? gap) : (node.rowGap ?? gap);
|
|
226
|
-
|
|
227
|
-
for (let idx = 0; idx < numProcessedChildren; idx++) {
|
|
228
|
-
const c = children[processableChildrenIndices[idx]!] as ElementNode;
|
|
229
|
-
if (
|
|
230
|
-
currentPos + childTotalMainSizes[idx]! > containerSize &&
|
|
231
|
-
currentPos > nodePadding
|
|
232
|
-
) {
|
|
233
|
-
currentPos = nodePadding;
|
|
234
|
-
crossCurrentPos += isWrapReverse
|
|
235
|
-
? -(childCrossSizeVar + crossGap)
|
|
236
|
-
: childCrossSizeVar + crossGap;
|
|
237
|
-
}
|
|
238
|
-
c[prop] = currentPos + childMarginStarts[idx]!;
|
|
239
|
-
currentPos += childTotalMainSizes[idx]! + gap;
|
|
240
|
-
doCrossAlign(c, idx, crossCurrentPos);
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
const finalCrossSize = isWrapReverse
|
|
244
|
-
? containerCrossSize - crossCurrentPos
|
|
245
|
-
: crossCurrentPos + childCrossSizeVar;
|
|
246
|
-
|
|
247
|
-
if (node[crossDimension] !== finalCrossSize) {
|
|
248
|
-
node[`preFlex${crossDimension}`] = node[crossDimension];
|
|
249
|
-
node[crossDimension] = finalCrossSize;
|
|
250
|
-
containerUpdated = true;
|
|
251
|
-
}
|
|
252
|
-
} else {
|
|
253
|
-
for (let idx = 0; idx < numProcessedChildren; idx++) {
|
|
254
|
-
const c = children[processableChildrenIndices[idx]!] as ElementNode;
|
|
255
|
-
c[prop] = currentPos + childMarginStarts[idx]!;
|
|
256
|
-
currentPos += childTotalMainSizes[idx]! + gap;
|
|
257
|
-
doCrossAlign(c, idx);
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
// Update container size
|
|
261
|
-
if (node.flexBoundary !== 'fixed' && node.flexWrap !== 'wrap') {
|
|
262
|
-
let calculatedSize = currentPos - gap + nodePadding;
|
|
263
|
-
const minSize = node[minDimension] || 0;
|
|
264
|
-
if (calculatedSize < minSize) {
|
|
265
|
-
calculatedSize = minSize;
|
|
266
|
-
}
|
|
267
|
-
if (calculatedSize !== (node[dimension] || 0)) {
|
|
268
|
-
// store the original size for Row & Column
|
|
269
|
-
node[`preFlex${dimension}`] = containerSize;
|
|
270
|
-
node[dimension] = calculatedSize;
|
|
271
|
-
return true;
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
} else if (justify === 'flexEnd') {
|
|
275
|
-
currentPos = containerSize - nodePadding;
|
|
276
|
-
for (let idx = numProcessedChildren - 1; idx >= 0; idx--) {
|
|
277
|
-
const c = children[processableChildrenIndices[idx]!] as ElementNode;
|
|
278
|
-
c[prop] = currentPos - childMainSizes[idx]! - childMarginEnds[idx]!;
|
|
279
|
-
currentPos -= childTotalMainSizes[idx]! + gap;
|
|
280
|
-
doCrossAlign(c, idx);
|
|
281
|
-
}
|
|
282
|
-
} else if (justify === 'center') {
|
|
283
|
-
currentPos =
|
|
284
|
-
(containerSize - (totalItemSize + gap * (numProcessedChildren - 1))) / 2 +
|
|
285
|
-
nodePadding;
|
|
286
|
-
for (let idx = 0; idx < numProcessedChildren; idx++) {
|
|
287
|
-
const c = children[processableChildrenIndices[idx]!] as ElementNode;
|
|
288
|
-
c[prop] = currentPos + childMarginStarts[idx]!;
|
|
289
|
-
currentPos += childTotalMainSizes[idx]! + gap;
|
|
290
|
-
doCrossAlign(c, idx);
|
|
291
|
-
}
|
|
292
|
-
} else if (justify === 'spaceBetween') {
|
|
293
|
-
const spaceBetween =
|
|
294
|
-
numProcessedChildren > 1
|
|
295
|
-
? (containerSize - totalItemSize - nodePadding * 2) /
|
|
296
|
-
(numProcessedChildren - 1)
|
|
297
|
-
: 0;
|
|
298
|
-
currentPos = nodePadding;
|
|
299
|
-
for (let idx = 0; idx < numProcessedChildren; idx++) {
|
|
300
|
-
const c = children[processableChildrenIndices[idx]!] as ElementNode;
|
|
301
|
-
c[prop] = currentPos + childMarginStarts[idx]!;
|
|
302
|
-
currentPos += childTotalMainSizes[idx]! + spaceBetween;
|
|
303
|
-
doCrossAlign(c, idx);
|
|
304
|
-
}
|
|
305
|
-
} else if (justify === 'spaceAround') {
|
|
306
|
-
const spaceAround =
|
|
307
|
-
numProcessedChildren > 0
|
|
308
|
-
? (containerSize - totalItemSize - nodePadding * 2) /
|
|
309
|
-
numProcessedChildren
|
|
310
|
-
: 0;
|
|
311
|
-
currentPos = nodePadding + spaceAround / 2;
|
|
312
|
-
for (let idx = 0; idx < numProcessedChildren; idx++) {
|
|
313
|
-
const c = children[processableChildrenIndices[idx]!] as ElementNode;
|
|
314
|
-
c[prop] = currentPos + childMarginStarts[idx]!;
|
|
315
|
-
currentPos += childTotalMainSizes[idx]! + spaceAround;
|
|
316
|
-
doCrossAlign(c, idx);
|
|
317
|
-
}
|
|
318
|
-
} else if (justify === 'spaceEvenly') {
|
|
319
|
-
const spaceEvenly =
|
|
320
|
-
(containerSize - totalItemSize - nodePadding * 2) /
|
|
321
|
-
(numProcessedChildren + 1);
|
|
322
|
-
currentPos = spaceEvenly + nodePadding;
|
|
323
|
-
for (let idx = 0; idx < numProcessedChildren; idx++) {
|
|
324
|
-
const c = children[processableChildrenIndices[idx]!] as ElementNode;
|
|
325
|
-
c[prop] = currentPos + childMarginStarts[idx]!;
|
|
326
|
-
currentPos += childTotalMainSizes[idx]! + spaceEvenly;
|
|
327
|
-
doCrossAlign(c, idx);
|
|
328
|
-
}
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
return containerUpdated;
|
|
332
|
-
}
|