gesso-core 0.1.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/CHANGELOG.md +24 -0
- package/LICENSE +21 -0
- package/README.md +43 -0
- package/dist/CanvasSurface-CrG-uJ5o.js +17273 -0
- package/dist/CanvasSurface-CrG-uJ5o.js.map +1 -0
- package/dist/index-DuZEAhyZ.d.ts +15815 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +13350 -0
- package/dist/index.js.map +1 -0
- package/dist/testing.d.ts +232 -0
- package/dist/testing.js +560 -0
- package/dist/testing.js.map +1 -0
- package/package.json +63 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# gesso-core
|
|
2
|
+
|
|
3
|
+
## 0.1.0
|
|
4
|
+
|
|
5
|
+
First public release.
|
|
6
|
+
|
|
7
|
+
The engine: the retained UI graph, typed properties and dirty flags; a layout
|
|
8
|
+
engine covering flexbox in full, CSS Grid with typed tracks, absolute, relative
|
|
9
|
+
and sticky positioning and overflow; one paragraph algorithm shared by the
|
|
10
|
+
engine and both renderers; `Canvas2DRenderer` and `WebGPURenderer` behind one
|
|
11
|
+
`UiRenderer` interface; pointer, wheel, keyboard, focus, gesture and
|
|
12
|
+
hit-testing input; and `UiEnvironment` for typed, scoped, reactive theming.
|
|
13
|
+
|
|
14
|
+
Layout is checked against headless Chrome: 239 generated cases agree within
|
|
15
|
+
0.1 px, with the divergences that remain pinned by name. Text breaking is
|
|
16
|
+
checked the same way across 124 paragraphs in seven faces, including CJK,
|
|
17
|
+
Arabic, Hebrew, Devanagari, Thai and emoji.
|
|
18
|
+
|
|
19
|
+
`engine.explain(node)` answers why a box is the size it is, in sentences, in
|
|
20
|
+
the order the rules applied.
|
|
21
|
+
|
|
22
|
+
Also in this release: the half of the accessibility mirror that lives below a
|
|
23
|
+
component. `UiEditingController.replaceText` is new, so a value set by an
|
|
24
|
+
assistive technology arrives as ordinary editing.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Kevin Baker
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# gesso-core
|
|
2
|
+
|
|
3
|
+
The engine under a Gesso application: the retained UI graph, the layout engine, the two renderers, input, text and theming. Everything below a component.
|
|
4
|
+
|
|
5
|
+
You do not usually install this directly. [`gesso-framework`](https://github.com/kevinpbaker/gesso/tree/main/packages/framework) depends on it and re-exports what an application author needs. Reach for `gesso-core` when you are writing a modifier, a custom layout, or anything else that works against elements rather than components.
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install gesso-core rxjs
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## What is in it
|
|
12
|
+
|
|
13
|
+
| Area | What it owns |
|
|
14
|
+
| ------------- | --------------------------------------------------------------------------------------------------------------------- |
|
|
15
|
+
| **Graph** | The retained node tree, typed properties, and the dirty flags a change raises |
|
|
16
|
+
| **Layout** | Flexbox in full, CSS Grid with typed tracks, absolute, relative and sticky positioning, overflow |
|
|
17
|
+
| **Text** | One paragraph algorithm shared by the engine and both renderers: wrapping, `maxLines`, ellipsis, real baselines, bidi |
|
|
18
|
+
| **Rendering** | `Canvas2DRenderer` and `WebGPURenderer` behind one `UiRenderer` interface |
|
|
19
|
+
| **Input** | Pointer, wheel, keyboard, focus, gestures and hit-testing against the painted boxes |
|
|
20
|
+
| **Theming** | `UiEnvironment`: typed, scoped, reactive values that dirty exactly the nodes reading them |
|
|
21
|
+
|
|
22
|
+
Layout borrows CSS's vocabulary, so it borrows CSS's answers. Every layout conformance case is rendered by headless Chrome and the engine is asserted against it within 0.1 px.
|
|
23
|
+
|
|
24
|
+
## Asking why
|
|
25
|
+
|
|
26
|
+
A box is never a mystery:
|
|
27
|
+
|
|
28
|
+
```ts
|
|
29
|
+
engine.explain(node);
|
|
30
|
+
// constraints received, sizes measured, and a per-axis `decidedBy`
|
|
31
|
+
// in sentences, in the order the rules applied
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Entry points
|
|
35
|
+
|
|
36
|
+
- `gesso-core` -- the engine
|
|
37
|
+
- `gesso-core/testing` -- the canvas doubles its own suite uses
|
|
38
|
+
|
|
39
|
+
## Documentation
|
|
40
|
+
|
|
41
|
+
[Layout](https://github.com/kevinpbaker/gesso/blob/main/apps/docs/layout/flex.md) | [Text](https://github.com/kevinpbaker/gesso/blob/main/apps/docs/guide/text.md) | [Canvas2D and WebGPU](https://github.com/kevinpbaker/gesso/blob/main/apps/docs/rendering/canvas2d-and-webgpu.md) | [Asking the engine why](https://github.com/kevinpbaker/gesso/blob/main/apps/docs/layout/explain.md)
|
|
42
|
+
|
|
43
|
+
MIT (c) Kevin Baker
|