@hypen-space/web 0.2.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/dist/chunk-2s02mkzs.js +32 -0
- package/dist/chunk-2s02mkzs.js.map +9 -0
- package/dist/src/canvas/accessibility.js +152 -0
- package/dist/src/canvas/accessibility.js.map +10 -0
- package/dist/src/canvas/events.js +198 -0
- package/dist/src/canvas/events.js.map +10 -0
- package/dist/src/canvas/index.js +28 -0
- package/dist/src/canvas/index.js.map +9 -0
- package/dist/src/canvas/input.js +132 -0
- package/dist/src/canvas/input.js.map +10 -0
- package/dist/src/canvas/layout.js +309 -0
- package/dist/src/canvas/layout.js.map +10 -0
- package/dist/src/canvas/paint.js +878 -0
- package/dist/src/canvas/paint.js.map +10 -0
- package/dist/src/canvas/renderer.js +276 -0
- package/dist/src/canvas/renderer.js.map +10 -0
- package/dist/src/canvas/text.js +118 -0
- package/dist/src/canvas/text.js.map +10 -0
- package/dist/src/canvas/types.js +2 -0
- package/dist/src/canvas/types.js.map +9 -0
- package/dist/src/canvas/utils.js +139 -0
- package/dist/src/canvas/utils.js.map +10 -0
- package/dist/src/dom/applicators/advanced-layout.js +111 -0
- package/dist/src/dom/applicators/advanced-layout.js.map +10 -0
- package/dist/src/dom/applicators/background.js +54 -0
- package/dist/src/dom/applicators/background.js.map +10 -0
- package/dist/src/dom/applicators/border.js +33 -0
- package/dist/src/dom/applicators/border.js.map +10 -0
- package/dist/src/dom/applicators/color.js +36 -0
- package/dist/src/dom/applicators/color.js.map +10 -0
- package/dist/src/dom/applicators/display.js +57 -0
- package/dist/src/dom/applicators/display.js.map +10 -0
- package/dist/src/dom/applicators/effects.js +89 -0
- package/dist/src/dom/applicators/effects.js.map +10 -0
- package/dist/src/dom/applicators/events.js +518 -0
- package/dist/src/dom/applicators/events.js.map +10 -0
- package/dist/src/dom/applicators/font.js +39 -0
- package/dist/src/dom/applicators/font.js.map +10 -0
- package/dist/src/dom/applicators/index.js +296 -0
- package/dist/src/dom/applicators/index.js.map +10 -0
- package/dist/src/dom/applicators/layout.js +86 -0
- package/dist/src/dom/applicators/layout.js.map +10 -0
- package/dist/src/dom/applicators/margin.js +32 -0
- package/dist/src/dom/applicators/margin.js.map +10 -0
- package/dist/src/dom/applicators/padding.js +35 -0
- package/dist/src/dom/applicators/padding.js.map +10 -0
- package/dist/src/dom/applicators/size.js +42 -0
- package/dist/src/dom/applicators/size.js.map +10 -0
- package/dist/src/dom/applicators/transform.js +92 -0
- package/dist/src/dom/applicators/transform.js.map +10 -0
- package/dist/src/dom/applicators/transition.js +66 -0
- package/dist/src/dom/applicators/transition.js.map +10 -0
- package/dist/src/dom/applicators/typography.js +87 -0
- package/dist/src/dom/applicators/typography.js.map +10 -0
- package/dist/src/dom/canvas/index.js +50 -0
- package/dist/src/dom/canvas/index.js.map +10 -0
- package/dist/src/dom/components/audio.js +48 -0
- package/dist/src/dom/components/audio.js.map +10 -0
- package/dist/src/dom/components/avatar.js +58 -0
- package/dist/src/dom/components/avatar.js.map +10 -0
- package/dist/src/dom/components/badge.js +55 -0
- package/dist/src/dom/components/badge.js.map +10 -0
- package/dist/src/dom/components/button.js +29 -0
- package/dist/src/dom/components/button.js.map +10 -0
- package/dist/src/dom/components/card.js +33 -0
- package/dist/src/dom/components/card.js.map +10 -0
- package/dist/src/dom/components/center.js +32 -0
- package/dist/src/dom/components/center.js.map +10 -0
- package/dist/src/dom/components/checkbox.js +54 -0
- package/dist/src/dom/components/checkbox.js.map +10 -0
- package/dist/src/dom/components/column.js +31 -0
- package/dist/src/dom/components/column.js.map +10 -0
- package/dist/src/dom/components/container.js +29 -0
- package/dist/src/dom/components/container.js.map +10 -0
- package/dist/src/dom/components/divider.js +45 -0
- package/dist/src/dom/components/divider.js.map +10 -0
- package/dist/src/dom/components/grid.js +44 -0
- package/dist/src/dom/components/grid.js.map +10 -0
- package/dist/src/dom/components/heading.js +47 -0
- package/dist/src/dom/components/heading.js.map +10 -0
- package/dist/src/dom/components/image.js +39 -0
- package/dist/src/dom/components/image.js.map +10 -0
- package/dist/src/dom/components/index.js +217 -0
- package/dist/src/dom/components/index.js.map +10 -0
- package/dist/src/dom/components/input.js +41 -0
- package/dist/src/dom/components/input.js.map +10 -0
- package/dist/src/dom/components/link.js +42 -0
- package/dist/src/dom/components/link.js.map +10 -0
- package/dist/src/dom/components/list.js +42 -0
- package/dist/src/dom/components/list.js.map +10 -0
- package/dist/src/dom/components/paragraph.js +35 -0
- package/dist/src/dom/components/paragraph.js.map +10 -0
- package/dist/src/dom/components/progressbar.js +57 -0
- package/dist/src/dom/components/progressbar.js.map +10 -0
- package/dist/src/dom/components/route.js +44 -0
- package/dist/src/dom/components/route.js.map +10 -0
- package/dist/src/dom/components/router.js +33 -0
- package/dist/src/dom/components/router.js.map +10 -0
- package/dist/src/dom/components/row.js +31 -0
- package/dist/src/dom/components/row.js.map +10 -0
- package/dist/src/dom/components/select.js +57 -0
- package/dist/src/dom/components/select.js.map +10 -0
- package/dist/src/dom/components/slider.js +48 -0
- package/dist/src/dom/components/slider.js.map +10 -0
- package/dist/src/dom/components/spacer.js +30 -0
- package/dist/src/dom/components/spacer.js.map +10 -0
- package/dist/src/dom/components/spinner.js +65 -0
- package/dist/src/dom/components/spinner.js.map +10 -0
- package/dist/src/dom/components/stack.js +45 -0
- package/dist/src/dom/components/stack.js.map +10 -0
- package/dist/src/dom/components/switch.js +83 -0
- package/dist/src/dom/components/switch.js.map +10 -0
- package/dist/src/dom/components/text.js +37 -0
- package/dist/src/dom/components/text.js.map +10 -0
- package/dist/src/dom/components/textarea.js +51 -0
- package/dist/src/dom/components/textarea.js.map +10 -0
- package/dist/src/dom/components/video.js +51 -0
- package/dist/src/dom/components/video.js.map +10 -0
- package/dist/src/dom/debug.js +170 -0
- package/dist/src/dom/debug.js.map +10 -0
- package/dist/src/dom/events.js +112 -0
- package/dist/src/dom/events.js.map +10 -0
- package/dist/src/dom/index.js +73 -0
- package/dist/src/dom/index.js.map +9 -0
- package/dist/src/dom/renderer.js +277 -0
- package/dist/src/dom/renderer.js.map +10 -0
- package/dist/src/index.js +89 -0
- package/dist/src/index.js.map +9 -0
- package/package.json +84 -0
- package/src/canvas/QUICKSTART.md +421 -0
- package/src/canvas/README.md +376 -0
- package/src/canvas/accessibility.ts +218 -0
- package/src/canvas/events.ts +307 -0
- package/src/canvas/index.ts +35 -0
- package/src/canvas/input.ts +210 -0
- package/src/canvas/layout.ts +401 -0
- package/src/canvas/paint.ts +1321 -0
- package/src/canvas/renderer.ts +422 -0
- package/src/canvas/text.ts +182 -0
- package/src/canvas/types.ts +137 -0
- package/src/canvas/utils.ts +218 -0
- package/src/dom/README.md +265 -0
- package/src/dom/applicators/advanced-layout.ts +128 -0
- package/src/dom/applicators/background.ts +50 -0
- package/src/dom/applicators/border.ts +19 -0
- package/src/dom/applicators/color.ts +23 -0
- package/src/dom/applicators/display.ts +54 -0
- package/src/dom/applicators/effects.ts +97 -0
- package/src/dom/applicators/events.ts +689 -0
- package/src/dom/applicators/font.ts +27 -0
- package/src/dom/applicators/index.ts +354 -0
- package/src/dom/applicators/layout.ts +92 -0
- package/src/dom/applicators/margin.ts +18 -0
- package/src/dom/applicators/padding.ts +18 -0
- package/src/dom/applicators/size.ts +31 -0
- package/src/dom/applicators/transform.ts +93 -0
- package/src/dom/applicators/transition.ts +65 -0
- package/src/dom/applicators/typography.ts +91 -0
- package/src/dom/canvas/index.ts +60 -0
- package/src/dom/components/audio.ts +45 -0
- package/src/dom/components/avatar.ts +49 -0
- package/src/dom/components/badge.ts +45 -0
- package/src/dom/components/button.ts +13 -0
- package/src/dom/components/card.ts +19 -0
- package/src/dom/components/center.ts +16 -0
- package/src/dom/components/checkbox.ts +54 -0
- package/src/dom/components/column.ts +15 -0
- package/src/dom/components/container.ts +13 -0
- package/src/dom/components/divider.ts +37 -0
- package/src/dom/components/grid.ts +40 -0
- package/src/dom/components/heading.ts +41 -0
- package/src/dom/components/image.ts +27 -0
- package/src/dom/components/index.ts +115 -0
- package/src/dom/components/input.ts +29 -0
- package/src/dom/components/link.ts +35 -0
- package/src/dom/components/list.ts +30 -0
- package/src/dom/components/paragraph.ts +23 -0
- package/src/dom/components/progressbar.ts +51 -0
- package/src/dom/components/route.ts +37 -0
- package/src/dom/components/router.ts +22 -0
- package/src/dom/components/row.ts +15 -0
- package/src/dom/components/select.ts +56 -0
- package/src/dom/components/slider.ts +45 -0
- package/src/dom/components/spacer.ts +16 -0
- package/src/dom/components/spinner.ts +60 -0
- package/src/dom/components/stack.ts +34 -0
- package/src/dom/components/switch.ts +86 -0
- package/src/dom/components/text.ts +24 -0
- package/src/dom/components/textarea.ts +50 -0
- package/src/dom/components/video.ts +50 -0
- package/src/dom/debug.ts +247 -0
- package/src/dom/events.ts +168 -0
- package/src/dom/index.ts +11 -0
- package/src/dom/renderer.ts +327 -0
- package/src/index.ts +56 -0
|
@@ -0,0 +1,309 @@
|
|
|
1
|
+
import {
|
|
2
|
+
measureText
|
|
3
|
+
} from "./text.js";
|
|
4
|
+
import {
|
|
5
|
+
parseSize,
|
|
6
|
+
parseSpacing
|
|
7
|
+
} from "./utils.js";
|
|
8
|
+
import"../../chunk-2s02mkzs.js";
|
|
9
|
+
|
|
10
|
+
// src/canvas/layout.ts
|
|
11
|
+
function computeLayout(ctx, node, availableWidth, availableHeight, x = 0, y = 0) {
|
|
12
|
+
const props = node.props;
|
|
13
|
+
let margin = parseSpacing(props.margin || 0);
|
|
14
|
+
if (props.marginTop !== undefined)
|
|
15
|
+
margin.top = parseFloat(props.marginTop) || 0;
|
|
16
|
+
if (props.marginRight !== undefined)
|
|
17
|
+
margin.right = parseFloat(props.marginRight) || 0;
|
|
18
|
+
if (props.marginBottom !== undefined)
|
|
19
|
+
margin.bottom = parseFloat(props.marginBottom) || 0;
|
|
20
|
+
if (props.marginLeft !== undefined)
|
|
21
|
+
margin.left = parseFloat(props.marginLeft) || 0;
|
|
22
|
+
let padding = parseSpacing(props.padding || 0);
|
|
23
|
+
if (props.paddingTop !== undefined)
|
|
24
|
+
padding.top = parseFloat(props.paddingTop) || 0;
|
|
25
|
+
if (props.paddingRight !== undefined)
|
|
26
|
+
padding.right = parseFloat(props.paddingRight) || 0;
|
|
27
|
+
if (props.paddingBottom !== undefined)
|
|
28
|
+
padding.bottom = parseFloat(props.paddingBottom) || 0;
|
|
29
|
+
if (props.paddingLeft !== undefined)
|
|
30
|
+
padding.left = parseFloat(props.paddingLeft) || 0;
|
|
31
|
+
const borderWidth = parseFloat(props.borderWidth) || 0;
|
|
32
|
+
const borderColor = props.borderColor || "transparent";
|
|
33
|
+
const borderRadius = parseFloat(props.borderRadius) || 0;
|
|
34
|
+
const availableAfterMargin = {
|
|
35
|
+
width: availableWidth - margin.left - margin.right,
|
|
36
|
+
height: availableHeight - margin.top - margin.bottom
|
|
37
|
+
};
|
|
38
|
+
let width = parseSize(props.width);
|
|
39
|
+
let height = parseSize(props.height);
|
|
40
|
+
const type = node.type.toLowerCase();
|
|
41
|
+
if (type === "spacer") {
|
|
42
|
+
if (width === null)
|
|
43
|
+
width = availableAfterMargin.width;
|
|
44
|
+
if (height === null)
|
|
45
|
+
height = availableAfterMargin.height;
|
|
46
|
+
} else if (type === "divider" || type === "separator") {
|
|
47
|
+
const orientation = props.orientation || "horizontal";
|
|
48
|
+
const thickness = parseFloat(props.thickness) || 1;
|
|
49
|
+
if (orientation === "vertical") {
|
|
50
|
+
if (width === null)
|
|
51
|
+
width = thickness;
|
|
52
|
+
if (height === null)
|
|
53
|
+
height = availableAfterMargin.height;
|
|
54
|
+
} else {
|
|
55
|
+
if (width === null)
|
|
56
|
+
width = availableAfterMargin.width;
|
|
57
|
+
if (height === null)
|
|
58
|
+
height = thickness;
|
|
59
|
+
}
|
|
60
|
+
} else if (type === "checkbox" || type === "radio") {
|
|
61
|
+
const size = parseFloat(props.size) || 20;
|
|
62
|
+
if (width === null)
|
|
63
|
+
width = size;
|
|
64
|
+
if (height === null)
|
|
65
|
+
height = size;
|
|
66
|
+
} else if (type === "switch" || type === "toggle") {
|
|
67
|
+
if (width === null)
|
|
68
|
+
width = 44;
|
|
69
|
+
if (height === null)
|
|
70
|
+
height = 24;
|
|
71
|
+
} else if (type === "slider") {
|
|
72
|
+
if (width === null)
|
|
73
|
+
width = 200;
|
|
74
|
+
if (height === null)
|
|
75
|
+
height = 20;
|
|
76
|
+
} else if (type === "progress" || type === "progressbar") {
|
|
77
|
+
if (width === null)
|
|
78
|
+
width = 200;
|
|
79
|
+
if (height === null)
|
|
80
|
+
height = 8;
|
|
81
|
+
} else if (type === "spinner" || type === "loading") {
|
|
82
|
+
const size = parseFloat(props.size) || 24;
|
|
83
|
+
if (width === null)
|
|
84
|
+
width = size;
|
|
85
|
+
if (height === null)
|
|
86
|
+
height = size;
|
|
87
|
+
} else if (type === "badge") {
|
|
88
|
+
if (width === null)
|
|
89
|
+
width = 20;
|
|
90
|
+
if (height === null)
|
|
91
|
+
height = 20;
|
|
92
|
+
} else if (type === "avatar") {
|
|
93
|
+
const size = parseFloat(props.size) || 40;
|
|
94
|
+
if (width === null)
|
|
95
|
+
width = size;
|
|
96
|
+
if (height === null)
|
|
97
|
+
height = size;
|
|
98
|
+
} else if (type === "icon") {
|
|
99
|
+
const size = parseFloat(props.size) || 24;
|
|
100
|
+
if (width === null)
|
|
101
|
+
width = size;
|
|
102
|
+
if (height === null)
|
|
103
|
+
height = size;
|
|
104
|
+
}
|
|
105
|
+
if (node.type === "text" && node.props[0]) {
|
|
106
|
+
const text = String(node.props[0] || "");
|
|
107
|
+
const fontSize = parseFloat(props.fontSize) || 16;
|
|
108
|
+
const fontWeight = props.fontWeight || "normal";
|
|
109
|
+
const fontFamily = props.fontFamily || "system-ui, sans-serif";
|
|
110
|
+
const lineHeight = parseFloat(props.lineHeight) || fontSize * 1.2;
|
|
111
|
+
const maxWidth2 = width || availableAfterMargin.width - padding.left - padding.right;
|
|
112
|
+
const metrics = measureText(ctx, text, { fontSize, fontWeight, fontFamily, lineHeight }, maxWidth2);
|
|
113
|
+
if (!width)
|
|
114
|
+
width = metrics.width + padding.left + padding.right;
|
|
115
|
+
if (!height)
|
|
116
|
+
height = metrics.height + padding.top + padding.bottom;
|
|
117
|
+
}
|
|
118
|
+
if (width === null)
|
|
119
|
+
width = availableAfterMargin.width;
|
|
120
|
+
if (height === null)
|
|
121
|
+
height = availableAfterMargin.height;
|
|
122
|
+
const minWidth = parseSize(props.minWidth);
|
|
123
|
+
const maxWidth = parseSize(props.maxWidth);
|
|
124
|
+
const minHeight = parseSize(props.minHeight);
|
|
125
|
+
const maxHeight = parseSize(props.maxHeight);
|
|
126
|
+
if (minWidth !== null)
|
|
127
|
+
width = Math.max(width, minWidth);
|
|
128
|
+
if (maxWidth !== null)
|
|
129
|
+
width = Math.min(width, maxWidth);
|
|
130
|
+
if (minHeight !== null)
|
|
131
|
+
height = Math.max(height, minHeight);
|
|
132
|
+
if (maxHeight !== null)
|
|
133
|
+
height = Math.min(height, maxHeight);
|
|
134
|
+
const layout = {
|
|
135
|
+
x: x + margin.left,
|
|
136
|
+
y: y + margin.top,
|
|
137
|
+
width,
|
|
138
|
+
height,
|
|
139
|
+
margin,
|
|
140
|
+
padding,
|
|
141
|
+
border: {
|
|
142
|
+
width: borderWidth,
|
|
143
|
+
color: borderColor,
|
|
144
|
+
radius: borderRadius
|
|
145
|
+
},
|
|
146
|
+
contentX: padding.left + borderWidth,
|
|
147
|
+
contentY: padding.top + borderWidth,
|
|
148
|
+
contentWidth: width - padding.left - padding.right - borderWidth * 2,
|
|
149
|
+
contentHeight: height - padding.top - padding.bottom - borderWidth * 2
|
|
150
|
+
};
|
|
151
|
+
node.layout = layout;
|
|
152
|
+
if (node.children.length > 0) {
|
|
153
|
+
layoutChildren(ctx, node);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
function layoutChildren(ctx, parent) {
|
|
157
|
+
const layout = parent.layout;
|
|
158
|
+
const props = parent.props;
|
|
159
|
+
if (parent.type.toLowerCase() === "stack") {
|
|
160
|
+
layoutStackChildren(ctx, parent);
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
const flexDirection = props.flexDirection || (parent.type === "column" ? "column" : "row");
|
|
164
|
+
const justifyContent = props.justifyContent || "flex-start";
|
|
165
|
+
const alignItems = props.alignItems || "flex-start";
|
|
166
|
+
const gap = parseFloat(props.gap) || 0;
|
|
167
|
+
const isColumn = flexDirection === "column";
|
|
168
|
+
const availableWidth = layout.contentWidth;
|
|
169
|
+
const availableHeight = layout.contentHeight;
|
|
170
|
+
const childInfo = [];
|
|
171
|
+
let totalMainSize = 0;
|
|
172
|
+
let totalFlexGrow = 0;
|
|
173
|
+
let totalFlexShrink = 0;
|
|
174
|
+
for (const child of parent.children) {
|
|
175
|
+
const flexGrow = parseFloat(child.props.flexGrow) || parseFloat(child.props.flex) || 0;
|
|
176
|
+
const flexShrink = parseFloat(child.props.flexShrink) || 1;
|
|
177
|
+
const flexBasis = parseSize(child.props.flexBasis);
|
|
178
|
+
computeLayout(ctx, child, availableWidth, availableHeight, 0, 0);
|
|
179
|
+
const childLayout = child.layout;
|
|
180
|
+
let mainSize = isColumn ? childLayout.height : childLayout.width;
|
|
181
|
+
if (flexBasis !== null) {
|
|
182
|
+
mainSize = flexBasis;
|
|
183
|
+
if (isColumn) {
|
|
184
|
+
childLayout.height = flexBasis;
|
|
185
|
+
} else {
|
|
186
|
+
childLayout.width = flexBasis;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
childInfo.push({
|
|
190
|
+
width: childLayout.width,
|
|
191
|
+
height: childLayout.height,
|
|
192
|
+
flexGrow,
|
|
193
|
+
flexShrink,
|
|
194
|
+
flexBasis
|
|
195
|
+
});
|
|
196
|
+
totalMainSize += mainSize;
|
|
197
|
+
totalFlexGrow += flexGrow;
|
|
198
|
+
totalFlexShrink += flexShrink;
|
|
199
|
+
}
|
|
200
|
+
const totalGap = gap * (parent.children.length - 1);
|
|
201
|
+
totalMainSize += totalGap;
|
|
202
|
+
const availableMain = isColumn ? availableHeight : availableWidth;
|
|
203
|
+
let remainingSpace = availableMain - totalMainSize;
|
|
204
|
+
if (remainingSpace > 0 && totalFlexGrow > 0) {
|
|
205
|
+
const spacePerFlex = remainingSpace / totalFlexGrow;
|
|
206
|
+
for (let i = 0;i < parent.children.length; i++) {
|
|
207
|
+
const info = childInfo[i];
|
|
208
|
+
if (info.flexGrow > 0) {
|
|
209
|
+
const extraSpace = spacePerFlex * info.flexGrow;
|
|
210
|
+
if (isColumn) {
|
|
211
|
+
info.height += extraSpace;
|
|
212
|
+
} else {
|
|
213
|
+
info.width += extraSpace;
|
|
214
|
+
}
|
|
215
|
+
totalMainSize += extraSpace;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
remainingSpace = 0;
|
|
219
|
+
}
|
|
220
|
+
if (remainingSpace < 0 && totalFlexShrink > 0) {
|
|
221
|
+
const shrinkPerFlex = Math.abs(remainingSpace) / totalFlexShrink;
|
|
222
|
+
for (let i = 0;i < parent.children.length; i++) {
|
|
223
|
+
const info = childInfo[i];
|
|
224
|
+
if (info.flexShrink > 0) {
|
|
225
|
+
const shrinkSpace = Math.min(shrinkPerFlex * info.flexShrink, isColumn ? info.height : info.width);
|
|
226
|
+
if (isColumn) {
|
|
227
|
+
info.height = Math.max(0, info.height - shrinkSpace);
|
|
228
|
+
} else {
|
|
229
|
+
info.width = Math.max(0, info.width - shrinkSpace);
|
|
230
|
+
}
|
|
231
|
+
totalMainSize -= shrinkSpace;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
remainingSpace = availableMain - totalMainSize;
|
|
235
|
+
}
|
|
236
|
+
let mainStart = 0;
|
|
237
|
+
let spacing = 0;
|
|
238
|
+
if (justifyContent === "center") {
|
|
239
|
+
mainStart = Math.max(0, remainingSpace / 2);
|
|
240
|
+
} else if (justifyContent === "flex-end") {
|
|
241
|
+
mainStart = Math.max(0, remainingSpace);
|
|
242
|
+
} else if (justifyContent === "space-between") {
|
|
243
|
+
spacing = remainingSpace / Math.max(1, parent.children.length - 1);
|
|
244
|
+
} else if (justifyContent === "space-around") {
|
|
245
|
+
spacing = remainingSpace / parent.children.length;
|
|
246
|
+
mainStart = spacing / 2;
|
|
247
|
+
}
|
|
248
|
+
let currentMain = mainStart;
|
|
249
|
+
for (let i = 0;i < parent.children.length; i++) {
|
|
250
|
+
const child = parent.children[i];
|
|
251
|
+
const childLayout = child.layout;
|
|
252
|
+
const info = childInfo[i];
|
|
253
|
+
childLayout.width = info.width;
|
|
254
|
+
childLayout.height = info.height;
|
|
255
|
+
let crossStart = 0;
|
|
256
|
+
const availableCross = isColumn ? availableWidth : availableHeight;
|
|
257
|
+
const childCross = isColumn ? info.width : info.height;
|
|
258
|
+
if (alignItems === "center") {
|
|
259
|
+
crossStart = (availableCross - childCross) / 2;
|
|
260
|
+
} else if (alignItems === "flex-end") {
|
|
261
|
+
crossStart = availableCross - childCross;
|
|
262
|
+
}
|
|
263
|
+
if (isColumn) {
|
|
264
|
+
childLayout.x = layout.x + layout.contentX + crossStart;
|
|
265
|
+
childLayout.y = layout.y + layout.contentY + currentMain;
|
|
266
|
+
currentMain += info.height + gap;
|
|
267
|
+
} else {
|
|
268
|
+
childLayout.x = layout.x + layout.contentX + currentMain;
|
|
269
|
+
childLayout.y = layout.y + layout.contentY + crossStart;
|
|
270
|
+
currentMain += info.width + gap;
|
|
271
|
+
}
|
|
272
|
+
if (justifyContent === "space-between" || justifyContent === "space-around") {
|
|
273
|
+
currentMain += spacing;
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
function layoutStackChildren(ctx, parent) {
|
|
278
|
+
const layout = parent.layout;
|
|
279
|
+
const props = parent.props;
|
|
280
|
+
const alignItems = props.alignItems || "flex-start";
|
|
281
|
+
const justifyContent = props.justifyContent || "flex-start";
|
|
282
|
+
const availableWidth = layout.contentWidth;
|
|
283
|
+
const availableHeight = layout.contentHeight;
|
|
284
|
+
for (const child of parent.children) {
|
|
285
|
+
computeLayout(ctx, child, availableWidth, availableHeight, 0, 0);
|
|
286
|
+
const childLayout = child.layout;
|
|
287
|
+
let x = 0;
|
|
288
|
+
let y = 0;
|
|
289
|
+
if (alignItems === "center") {
|
|
290
|
+
x = (availableWidth - childLayout.width) / 2;
|
|
291
|
+
} else if (alignItems === "flex-end") {
|
|
292
|
+
x = availableWidth - childLayout.width;
|
|
293
|
+
}
|
|
294
|
+
if (justifyContent === "center") {
|
|
295
|
+
y = (availableHeight - childLayout.height) / 2;
|
|
296
|
+
} else if (justifyContent === "flex-end") {
|
|
297
|
+
y = availableHeight - childLayout.height;
|
|
298
|
+
}
|
|
299
|
+
childLayout.x = layout.x + layout.contentX + x;
|
|
300
|
+
childLayout.y = layout.y + layout.contentY + y;
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
export {
|
|
304
|
+
computeLayout
|
|
305
|
+
};
|
|
306
|
+
|
|
307
|
+
export { computeLayout };
|
|
308
|
+
|
|
309
|
+
//# debugId=DB33C4C61753CE7B64756E2164756E21
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/canvas/layout.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"/**\n * Layout Engine\n *\n * Flexbox-like layout system for positioning virtual nodes\n */\n\nimport type { VirtualNode, Layout, BoxSpacing } from \"./types.js\";\nimport { parseSpacing, parseSize } from \"./utils.js\";\nimport { measureText } from \"./text.js\";\n\n/**\n * Compute layout for a virtual node tree\n */\nexport function computeLayout(\n ctx: CanvasRenderingContext2D,\n node: VirtualNode,\n availableWidth: number,\n availableHeight: number,\n x: number = 0,\n y: number = 0\n): void {\n // Parse props\n const props = node.props;\n\n // Support individual margins (marginTop, marginRight, etc.)\n let margin = parseSpacing(props.margin || 0);\n if (props.marginTop !== undefined) margin.top = parseFloat(props.marginTop) || 0;\n if (props.marginRight !== undefined) margin.right = parseFloat(props.marginRight) || 0;\n if (props.marginBottom !== undefined) margin.bottom = parseFloat(props.marginBottom) || 0;\n if (props.marginLeft !== undefined) margin.left = parseFloat(props.marginLeft) || 0;\n\n // Support individual padding (paddingTop, paddingRight, etc.)\n let padding = parseSpacing(props.padding || 0);\n if (props.paddingTop !== undefined) padding.top = parseFloat(props.paddingTop) || 0;\n if (props.paddingRight !== undefined) padding.right = parseFloat(props.paddingRight) || 0;\n if (props.paddingBottom !== undefined) padding.bottom = parseFloat(props.paddingBottom) || 0;\n if (props.paddingLeft !== undefined) padding.left = parseFloat(props.paddingLeft) || 0;\n\n const borderWidth = parseFloat(props.borderWidth) || 0;\n const borderColor = props.borderColor || \"transparent\";\n const borderRadius = parseFloat(props.borderRadius) || 0;\n\n // Calculate available space after margin\n const availableAfterMargin = {\n width: availableWidth - margin.left - margin.right,\n height: availableHeight - margin.top - margin.bottom,\n };\n\n // Determine size\n let width = parseSize(props.width);\n let height = parseSize(props.height);\n\n // Default sizing for specific component types\n const type = node.type.toLowerCase();\n\n if (type === \"spacer\") {\n // Spacer fills available space by default\n if (width === null) width = availableAfterMargin.width;\n if (height === null) height = availableAfterMargin.height;\n } else if (type === \"divider\" || type === \"separator\") {\n const orientation = props.orientation || \"horizontal\";\n const thickness = parseFloat(props.thickness) || 1;\n\n if (orientation === \"vertical\") {\n if (width === null) width = thickness;\n if (height === null) height = availableAfterMargin.height;\n } else {\n if (width === null) width = availableAfterMargin.width;\n if (height === null) height = thickness;\n }\n } else if (type === \"checkbox\" || type === \"radio\") {\n const size = parseFloat(props.size) || 20;\n if (width === null) width = size;\n if (height === null) height = size;\n } else if (type === \"switch\" || type === \"toggle\") {\n if (width === null) width = 44;\n if (height === null) height = 24;\n } else if (type === \"slider\") {\n if (width === null) width = 200;\n if (height === null) height = 20;\n } else if (type === \"progress\" || type === \"progressbar\") {\n if (width === null) width = 200;\n if (height === null) height = 8;\n } else if (type === \"spinner\" || type === \"loading\") {\n const size = parseFloat(props.size) || 24;\n if (width === null) width = size;\n if (height === null) height = size;\n } else if (type === \"badge\") {\n if (width === null) width = 20;\n if (height === null) height = 20;\n } else if (type === \"avatar\") {\n const size = parseFloat(props.size) || 40;\n if (width === null) width = size;\n if (height === null) height = size;\n } else if (type === \"icon\") {\n const size = parseFloat(props.size) || 24;\n if (width === null) width = size;\n if (height === null) height = size;\n }\n\n // Intrinsic sizing for text nodes\n if (node.type === \"text\" && node.props[0]) {\n const text = String(node.props[0] || \"\");\n const fontSize = parseFloat(props.fontSize) || 16;\n const fontWeight = props.fontWeight || \"normal\";\n const fontFamily = props.fontFamily || \"system-ui, sans-serif\";\n const lineHeight = parseFloat(props.lineHeight) || fontSize * 1.2;\n\n const maxWidth = width || availableAfterMargin.width - padding.left - padding.right;\n const metrics = measureText(ctx, text, { fontSize, fontWeight, fontFamily, lineHeight }, maxWidth);\n\n if (!width) width = metrics.width + padding.left + padding.right;\n if (!height) height = metrics.height + padding.top + padding.bottom;\n }\n\n // Default to available size if not specified\n if (width === null) width = availableAfterMargin.width;\n if (height === null) height = availableAfterMargin.height;\n\n // Apply constraints\n const minWidth = parseSize(props.minWidth);\n const maxWidth = parseSize(props.maxWidth);\n const minHeight = parseSize(props.minHeight);\n const maxHeight = parseSize(props.maxHeight);\n\n if (minWidth !== null) width = Math.max(width, minWidth);\n if (maxWidth !== null) width = Math.min(width, maxWidth);\n if (minHeight !== null) height = Math.max(height, minHeight);\n if (maxHeight !== null) height = Math.min(height, maxHeight);\n\n // Create layout object\n const layout: Layout = {\n x: x + margin.left,\n y: y + margin.top,\n width,\n height,\n margin,\n padding,\n border: {\n width: borderWidth,\n color: borderColor,\n radius: borderRadius,\n },\n contentX: padding.left + borderWidth,\n contentY: padding.top + borderWidth,\n contentWidth: width - padding.left - padding.right - borderWidth * 2,\n contentHeight: height - padding.top - padding.bottom - borderWidth * 2,\n };\n\n node.layout = layout;\n\n // Layout children if container\n if (node.children.length > 0) {\n layoutChildren(ctx, node);\n }\n}\n\n/**\n * Layout children using flexbox-like rules\n */\nfunction layoutChildren(ctx: CanvasRenderingContext2D, parent: VirtualNode): void {\n const layout = parent.layout!;\n const props = parent.props;\n\n // Stack components overlay children on top of each other\n if (parent.type.toLowerCase() === \"stack\") {\n layoutStackChildren(ctx, parent);\n return;\n }\n\n const flexDirection = props.flexDirection || (parent.type === \"column\" ? \"column\" : \"row\");\n const justifyContent = props.justifyContent || \"flex-start\";\n const alignItems = props.alignItems || \"flex-start\";\n const gap = parseFloat(props.gap) || 0;\n\n const isColumn = flexDirection === \"column\";\n const availableWidth = layout.contentWidth;\n const availableHeight = layout.contentHeight;\n\n // First pass: compute intrinsic sizes and collect flex info\n const childInfo: Array<{\n width: number;\n height: number;\n flexGrow: number;\n flexShrink: number;\n flexBasis: number | null;\n }> = [];\n let totalMainSize = 0;\n let totalFlexGrow = 0;\n let totalFlexShrink = 0;\n\n for (const child of parent.children) {\n const flexGrow = parseFloat(child.props.flexGrow) || parseFloat(child.props.flex) || 0;\n const flexShrink = parseFloat(child.props.flexShrink) || 1;\n const flexBasis = parseSize(child.props.flexBasis);\n\n // Compute child layout with available space\n computeLayout(\n ctx,\n child,\n availableWidth,\n availableHeight,\n 0,\n 0\n );\n\n const childLayout = child.layout!;\n let mainSize = isColumn ? childLayout.height : childLayout.width;\n\n // Use flexBasis if specified\n if (flexBasis !== null) {\n mainSize = flexBasis;\n if (isColumn) {\n childLayout.height = flexBasis;\n } else {\n childLayout.width = flexBasis;\n }\n }\n\n childInfo.push({\n width: childLayout.width,\n height: childLayout.height,\n flexGrow,\n flexShrink,\n flexBasis,\n });\n\n totalMainSize += mainSize;\n totalFlexGrow += flexGrow;\n totalFlexShrink += flexShrink;\n }\n\n // Add gaps\n const totalGap = gap * (parent.children.length - 1);\n totalMainSize += totalGap;\n\n // Apply flex grow/shrink\n const availableMain = isColumn ? availableHeight : availableWidth;\n let remainingSpace = availableMain - totalMainSize;\n\n // Distribute remaining space to flex-grow children\n if (remainingSpace > 0 && totalFlexGrow > 0) {\n const spacePerFlex = remainingSpace / totalFlexGrow;\n\n for (let i = 0; i < parent.children.length; i++) {\n const info = childInfo[i];\n if (info.flexGrow > 0) {\n const extraSpace = spacePerFlex * info.flexGrow;\n if (isColumn) {\n info.height += extraSpace;\n } else {\n info.width += extraSpace;\n }\n totalMainSize += extraSpace;\n }\n }\n\n remainingSpace = 0;\n }\n\n // Apply flex shrink if needed (content is too large)\n if (remainingSpace < 0 && totalFlexShrink > 0) {\n const shrinkPerFlex = Math.abs(remainingSpace) / totalFlexShrink;\n\n for (let i = 0; i < parent.children.length; i++) {\n const info = childInfo[i];\n if (info.flexShrink > 0) {\n const shrinkSpace = Math.min(\n shrinkPerFlex * info.flexShrink,\n isColumn ? info.height : info.width\n );\n\n if (isColumn) {\n info.height = Math.max(0, info.height - shrinkSpace);\n } else {\n info.width = Math.max(0, info.width - shrinkSpace);\n }\n\n totalMainSize -= shrinkSpace;\n }\n }\n\n remainingSpace = availableMain - totalMainSize;\n }\n\n // Calculate starting position based on justifyContent\n let mainStart = 0;\n let spacing = 0;\n\n if (justifyContent === \"center\") {\n mainStart = Math.max(0, remainingSpace / 2);\n } else if (justifyContent === \"flex-end\") {\n mainStart = Math.max(0, remainingSpace);\n } else if (justifyContent === \"space-between\") {\n spacing = remainingSpace / Math.max(1, parent.children.length - 1);\n } else if (justifyContent === \"space-around\") {\n spacing = remainingSpace / parent.children.length;\n mainStart = spacing / 2;\n }\n\n // Position children\n let currentMain = mainStart;\n\n for (let i = 0; i < parent.children.length; i++) {\n const child = parent.children[i];\n const childLayout = child.layout!;\n const info = childInfo[i];\n\n // Update child layout with flex-adjusted size\n childLayout.width = info.width;\n childLayout.height = info.height;\n\n // Calculate cross position based on alignItems\n let crossStart = 0;\n const availableCross = isColumn ? availableWidth : availableHeight;\n const childCross = isColumn ? info.width : info.height;\n\n if (alignItems === \"center\") {\n crossStart = (availableCross - childCross) / 2;\n } else if (alignItems === \"flex-end\") {\n crossStart = availableCross - childCross;\n }\n\n // Update child position relative to parent content area\n if (isColumn) {\n childLayout.x = layout.x + layout.contentX + crossStart;\n childLayout.y = layout.y + layout.contentY + currentMain;\n currentMain += info.height + gap;\n } else {\n childLayout.x = layout.x + layout.contentX + currentMain;\n childLayout.y = layout.y + layout.contentY + crossStart;\n currentMain += info.width + gap;\n }\n\n if (justifyContent === \"space-between\" || justifyContent === \"space-around\") {\n currentMain += spacing;\n }\n }\n}\n\n/**\n * Layout Stack children - overlays children on top of each other\n */\nfunction layoutStackChildren(ctx: CanvasRenderingContext2D, parent: VirtualNode): void {\n const layout = parent.layout!;\n const props = parent.props;\n\n const alignItems = props.alignItems || \"flex-start\";\n const justifyContent = props.justifyContent || \"flex-start\";\n\n const availableWidth = layout.contentWidth;\n const availableHeight = layout.contentHeight;\n\n // Layout all children at the same position (stacked on top of each other)\n for (const child of parent.children) {\n // Compute child layout\n computeLayout(\n ctx,\n child,\n availableWidth,\n availableHeight,\n 0,\n 0\n );\n\n const childLayout = child.layout!;\n\n // Calculate position based on alignment\n let x = 0;\n let y = 0;\n\n // Horizontal alignment\n if (alignItems === \"center\") {\n x = (availableWidth - childLayout.width) / 2;\n } else if (alignItems === \"flex-end\") {\n x = availableWidth - childLayout.width;\n }\n\n // Vertical alignment\n if (justifyContent === \"center\") {\n y = (availableHeight - childLayout.height) / 2;\n } else if (justifyContent === \"flex-end\") {\n y = availableHeight - childLayout.height;\n }\n\n // Update child position relative to parent content area\n childLayout.x = layout.x + layout.contentX + x;\n childLayout.y = layout.y + layout.contentY + y;\n }\n}\n\n\n\n\n\n\n\n\n\n\n\n"
|
|
6
|
+
],
|
|
7
|
+
"mappings": ";;;;;;;;;;AAaO,SAAS,aAAa,CAC3B,KACA,MACA,gBACA,iBACA,IAAY,GACZ,IAAY,GACN;AAAA,EAEN,MAAM,QAAQ,KAAK;AAAA,EAGnB,IAAI,SAAS,aAAa,MAAM,UAAU,CAAC;AAAA,EAC3C,IAAI,MAAM,cAAc;AAAA,IAAW,OAAO,MAAM,WAAW,MAAM,SAAS,KAAK;AAAA,EAC/E,IAAI,MAAM,gBAAgB;AAAA,IAAW,OAAO,Q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