Skip to content

Conversation

@chiefcll
Copy link
Contributor

No description provided.

chiefcll and others added 30 commits March 19, 2025 17:01
* Init work on dom renderer

* Intercept node setters

* Add a proxy DOMNode class

* Animate more props

* Cleanup

* Update DOM property setters to not ignore zero values

* Fix line-height prop

* Apply font settings from config

* Add DOMText class proxy

* Handle destroy

* Call node destroy method in DOMNode destroy

* Handle border and radius shaders

* Support image masks

* Support maxLines

* Correct background-size to strech

* Support textures

* Set default line height to 1

* Refactor updating node styles to imperative approach
Support vertical and horizontal gradients

* Animate color

* Handle animation repeat

* Fix applying gradients

* Support diagonal gradients

* Use overflow: hidden for text with contain

* Improve gradients

* Add empty core renderer to avoid rendering to the canvas

* Add a noop text rendering engine

* Measure text rect with dom elements

* get core working with Renderer 3

* Add domRendering option to configuration for conditional rendering

* Update to lightning 3

* Fix rendering of new shaders

* Remove CanvasShaderNode

* Fix measuring text elements

* Implement lng.RendererMain interface instead of extending it

* Replace instanciating CoreShaderNode with plain object.

* Always use the dom engines

* Remove any usage of lightning internals and custom rendering engines implementations

* Remove usage of internal lightning types

* Update animation handling to modify styles after completion instead of using 'forwards' fill

* Replace unhandled getters with undefined

* Implement a custom animation system to replace waapi

* Derive paused state from pausedTime field

* Fix interpolating colors

* Add renderer interfaces to abstract the part of lightning interface implemented by dom renderer

* Correct IRendererTextNode inferface

* Add absX and absY to Node and Text interfaces

* Typecast RendererMain to IRendererMain
The type errors are too deep, complex and stupid to handle

* Format

* Use stage root el as dom root

* Calculate height and width of text nodes for flex layout

* Fix setting the background image when src is an empty string

* Use transform-translate instead of top/left for positioning to improve performance

* remove wordBreak property from DOMText class

* Revert "remove wordBreak property from DOMText class"

This reverts commit 9eab664.

* Mock shader manager

* Correct calculating element's size

---------

Co-authored-by: Chris Lorenzo <chiefcll@gmail.com>
* Remove background-blend-mode from getNodeStyles function

* Update getNodeStyles to always include z-index

* Add missing break statements

* Correct el size by dpr

* use props directly in getNodeStyles

* Remove default line-height assignment in getNodeStyles function

* Add background-blend-mode back

* Remove rounding of dimensions from getElSize
* Some fixes to dom renderer

* Make sure the font is loaded before measuring

* Correct handling text contain in dom renderer

* Update text node styles when the measurement changes

* Support contain textureOptions.resizeMode

* Separate border and background to differnet divs when needed

* Rename 'el' field to 'div' to match lightning inspector
* Implement animation.waitUntilStopped()

* Cleanup AnimationController

* Improve clipping text over limited height

* Cleanup dom renderer

* Handle resizeMode.type=cover

* Add max-content width style for contain=none

* Attach root to target element instead of body
* start adding some flex tests with vitest

* refactor flex with some tests, change flex grow calculations

* update flex and tests - one child dont apply flexgrow

* 🚀 bump version v3.0.0-7

* fix up rounded in effects
chiefcll and others added 30 commits July 4, 2025 10:40
- Remove vite and vitest types from globals
- separate tsconfig for tests
- move tests out of src
- Use `tsc -b` for building
It's already used everywhere as an object. I haven't seen any place that would really use the `| undefined` disjunction. Only places that added it.
* Add `hasFocus` function to check if an element has focus

* Rename `hasFocus` function to `isFocused`

* Update `isFocused` function to accept `ElementText` in addition to `ElementNode`

* Export `hasFocus` as an alias for `isFocused` function
Removes `selectedNode` getter from `ElementNode`.
After lightning-tv/solid#61 is merged, nothing is using this getter anymore.
Also this getter is weird in general, so it would be good to remove it.
  - it doesn't just return the current selected child, but searches for fist available when nothing is selected, even though it's not obvious from the name.
  - it mutates the element (`this.selected = i`)
  - it handles selection, which is a system introduced by lightning solid/primitives, not core.
* Add `from` and `out` params to `getElementScreenRect`

* Reset output rectangle coordinates in `getElementScreenRect` function
* Update layout on removeChild (fixes #64)

* Use spliceItem in removeChild
* wip: add default shaders and outside border shader

* Implement border gap in domrenderer

* Fix ts errors

* Border inset prop

* Correct shader for inset

* Handle non-uniform border width with inset border

* Force update when re-setting
effects

* Handle inset borders in dom renderer

* Cleanup and add comments

* Update todo comment

* Replace float u_inset with bool

* Replace borderZero varying with uniform

* Cleanup shader
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants