@floless/app 0.131.0 → 0.131.1
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/floless-server.cjs +306 -9
- package/dist/web/reference-changes.js +55 -0
- package/dist/web/steel-editor.html +740 -24
- package/dist/web/steel-split-view.js +19 -0
- package/package.json +1 -1
|
@@ -77,6 +77,25 @@ export function clampRatio(ratio, stageWidthPx) {
|
|
|
77
77
|
return { ratio: Math.min(1 - min, Math.max(min, safe)), ok: true, reason: null };
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
+
/**
|
|
81
|
+
* Where the 3D pane's left edge sits, in px from the stage's left edge.
|
|
82
|
+
*
|
|
83
|
+
* This is the SAME arithmetic the CSS does — `#pane2d` is
|
|
84
|
+
* `flex:0 0 calc((100% - var(--split-divider)) * var(--split-ratio))` and `#splitBar` is one
|
|
85
|
+
* `--split-divider` wide — and the same `usable = stage - DIVIDER_PX` that clampRatio above works in.
|
|
86
|
+
* It lives here, beside that, so the two cannot drift apart.
|
|
87
|
+
*
|
|
88
|
+
* It exists because the caller USED to read `pane3d.offsetLeft` instead. That read came after the
|
|
89
|
+
* `--split-ratio` write, so it forced a synchronous layout in the middle of every pointer sample of a
|
|
90
|
+
* divider drag — measured at +78 layouts and +80 style recalcs over an 80-step drag. Deriving costs
|
|
91
|
+
* nothing and the value is identical; `expect(derived).toEqual(measured)` is asserted in the browser
|
|
92
|
+
* pass and guarded by the test that pins this formula to the CSS. (Codex review, D1.)
|
|
93
|
+
*/
|
|
94
|
+
export function paneThreeLeftPx(stageWidthPx, ratio) {
|
|
95
|
+
if (!finite(stageWidthPx) || stageWidthPx <= DIVIDER_PX) return 0;
|
|
96
|
+
return (stageWidthPx - DIVIDER_PX) * sanitizeRatio(ratio) + DIVIDER_PX;
|
|
97
|
+
}
|
|
98
|
+
|
|
80
99
|
/**
|
|
81
100
|
* Resolve the mode the editor may actually enter. A `split` the stage cannot hold becomes '2d' and
|
|
82
101
|
* carries the reason, so the caller can both render something legal and say why it is not what was
|