Commit Graph

93 Commits

Author SHA1 Message Date
Daniel McNab 25d4a8ce35
Implement `AnyView` in `xilem_masonry` (#206)
* Implement `AnyView` in `xilem_masonry`

* Address review comments

* Improperly wire up anyview to give an idpath element
2024-04-25 16:12:22 +00:00
Bruce Mitchener f27a3ea9b0
masonry: Update MSRV to 1.75 from 1.65 (#208)
The code currently uses some API that is not available in Rust 1.65:

* `is_ok_and` from 1.70
* `next_multiple_of` from 1.73

Vello requires 1.75.
2024-04-25 16:11:57 +00:00
Bruce Mitchener 473ccc3a02
masonry: Fix clippy::legacy_numeric_constants lints. (#207) 2024-04-25 16:00:14 +00:00
Daniel McNab 69ac0807b9
Create a minimal xilem_masonry (#205)
* Create a minimal xilem_masonry

* Add a first draft of view sequences

* Implement a flex view

* Fix clippy

Some of these suggestions are kind of bad
but that's by-the-by

* Update CI to 1.77

* Skip masonry docs in CI

* Clippy, again

* Fix clippy

* Skip render snapshot tests

* Skip testing which needs rendering on CI

* Add tuple sequences

* Address review comments and clippy
2024-04-25 12:27:37 +00:00
Olivier FAURE 9b2ebfc157
Import Masonry crate (#203)
This commit adds the `masonry` crate as-is to the repository. It doesn't integrate Xilem with Masonry in any way.

Masonry is a modular backend providing a Widget tree for GUI libraries, originally forked from the Druid project.

Previous history of this code is maintained in [the original Masonry repository](https://github.com/linebender/masonry). Explanations for design decisions may also be found in issues from [the Druid repository](https://github.com/linebender/druid).

---------

Co-authored-by: 7k5x <7k5xlp0onfire@gmail.com>
Co-authored-by: 8176135 <8176135@gmail.com>
Co-authored-by: Aaron Muir Hamilton <aaron@correspondwith.me>
Co-authored-by: Alberto Slavica <104838972+albertoslavicadev@users.noreply.github.com>
Co-authored-by: Al M <yrns@users.noreply.github.com>
Co-authored-by: Alve™ <lolzman12@hotmail.se>
Co-authored-by: Andrea Cognolato <andrecogno@hotmail.it>
Co-authored-by: Andrew Hickman <andrew.hickman1@sky.com>
Co-authored-by: Andrey Kabylin <andrey@kabylin.ru>
Co-authored-by: Andrii Lysenko <andrewkvlp@gmail.com>
Co-authored-by: Andrii Zymohliad <andrii.zymohliad@lightcodephotonics.com>
Co-authored-by: Andrii Zymohliad <azymohliad@users.noreply.github.com>
Co-authored-by: Ankur Sethi <contact@ankursethi.in>
Co-authored-by: Anna Scholtz <anna@scholtzan.net>
Co-authored-by: Arif Driessen <arifd86@gmail.com>
Co-authored-by: Arpad Borsos <swatinem@swatinem.de>
Co-authored-by: arthmis <arthmis20@gmail.com>
Co-authored-by: astrale-sharp <53686698+astrale-sharp@users.noreply.github.com>
Co-authored-by: becky <becky@micropelt.com>
Co-authored-by: Benedikt Terhechte <terhechte@gmail.com>
Co-authored-by: Benjamin Saunders <ben.e.saunders@gmail.com>
Co-authored-by: binomial0 <binomial0@users.noreply.github.com>
Co-authored-by: bitec0de <102129407+bitec0de@users.noreply.github.com>
Co-authored-by: bobtwinkles <srkoser+github@gmail.com>
Co-authored-by: bobtwinkles <srkoser+GitHub@gmail.com>
Co-authored-by: Brook Heisler <brookheisler@gmail.com>
Co-authored-by: Brook Heisler <redattack34@gmail.com>
Co-authored-by: Bruce Mitchener <bruce.mitchener@gmail.com>
Co-authored-by: Bruno Dupuis <bdupuis@unowhy.com>
Co-authored-by: Calle Malmz <callem217@gmail.com>
Co-authored-by: Carl Malmz <callem217@gmail.com>
Co-authored-by: ccQpein <ccqpein@protonmail.com>
Co-authored-by: Chad Brokaw <cbrokaw@gmail.com>
Co-authored-by: Charles Saracco <crsaracco@gmail.com>
Co-authored-by: Chris Overcash <covercash2@gmail.com>
Co-authored-by: Christian Pérez-Llamas <932644+chris-zen@users.noreply.github.com>
Co-authored-by: Christopher Anderson <chris@nullcode.org>
Co-authored-by: Christopher N. Hesse <raymanfx@gmail.com>
Co-authored-by: Christopher Serr <christopher.serr@gmail.com>
Co-authored-by: Christoph Herzog <chris@theduke.at>
Co-authored-by: Christoph <xarvic@web.de>
Co-authored-by: Christoph <xarvix@web.de>
Co-authored-by: colinfruit <17092461+colinfruit@users.noreply.github.com>
Co-authored-by: Colin Rofls <colin@cmyr.net>
Co-authored-by: Connor Brewster <connor.brewster@eagles.oc.edu>
Co-authored-by: crumblingstatue <radiantstatue@gmail.com>
Co-authored-by: Daniel Dulaney <dan@dulaney.xyz>
Co-authored-by: Daniel Kessler <daniel@dkess.me>
Co-authored-by: Daniel McNab <36049421+DJMcNab@users.noreply.github.com>
Co-authored-by: Dan Knutson <dan.knutson@gmail.com>
Co-authored-by: David Soria Parra <david.soriaparra@oculus.com>
Co-authored-by: David Soria Parra <dsp@experimentalworks.net>
Co-authored-by: DetaNexus <Philipp.schaback@gmail.com>
Co-authored-by: Diggory Hardy <github1@dhardy.name>
Co-authored-by: Dmitry Borodin <11879032+Dmitry-Borodin@users.noreply.github.com>
Co-authored-by: Dmitry Borodin <git@DmitryBorodin.com>
Co-authored-by: Dmitry Borodin <inbox@DmitryBorodin.com>
Co-authored-by: Downtime <40173605+Cupnfish@users.noreply.github.com>
Co-authored-by: Downtime <40173605+YRainbbbb@users.noreply.github.com>
Co-authored-by: DrGabble <jub777@hotmail.co.uk>
Co-authored-by: DUDDINO RITARDATO <rezziandrea106@gmail.com>
Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
Co-authored-by: Edwin Cheng <edwin@m-inverse.com>
Co-authored-by: Egor Larionov <egor.larionov@gmail.com>
Co-authored-by: Emilio Gonzalez <emigr2k1@gmail.com>
Co-authored-by: Emilio González <emigr2k1@gmail.com>
Co-authored-by: Erik Gilling <konkers@konkers.net>
Co-authored-by: Felix Rabe <felix@rabe.io>
Co-authored-by: ForLoveOfCats <30666851+ForLoveOfCats@users.noreply.github.com>
Co-authored-by: ForLoveOfCats <ForLoveOfCats@vivaldi.net>
Co-authored-by: Gagandeep Singh <6944095+totsteps@users.noreply.github.com>
Co-authored-by: Gagandeep Singh <totsteps.gs@gmail.com>
Co-authored-by: Garrett Risley <30666851+ForLoveOfCats@users.noreply.github.com>
Co-authored-by: GitHub <noreply@github.com>
Co-authored-by: gmorenz <gmorenz@users.noreply.github.com>
Co-authored-by: Greg Morenz <greg-git@droid.cafe>
Co-authored-by: Gyusun Yeom <omniavinco@gmail.com>
Co-authored-by: hammsvietro <49427492+hammsvietro@users.noreply.github.com>
Co-authored-by: Hampus Lidin <hampuslidin@gmail.com>
Co-authored-by: Harry <36855805+minimal-state@users.noreply.github.com>
Co-authored-by: Hilmar Gústafsson <hilmargustafs@gmail.com>
Co-authored-by: Hilmar Gústafsson <LiHRaM@users.noreply.github.com>
Co-authored-by: HoNile <nicolas_cohen@hotmail.fr>
Co-authored-by: HuszarG <gergohuszar06@gmail.com>
Co-authored-by: i509VCB <i509vcb@gmail.com>
Co-authored-by: Isaac Snow <isaacjsnow@gmail.com>
Co-authored-by: jaap aarts <jaap.aarts1@gmail.com>
Co-authored-by: Jaap Aarts <JAicewizard@users.noreply.github.com>
Co-authored-by: Jacob Zhong <zyxin@umich.edu>
Co-authored-by: James Laver <james.laver@gmail.com>
Co-authored-by: Jan Pochyla <jpochyla@gmail.com>
Co-authored-by: Jari Pennanen <ciantic@oksidi.com>
Co-authored-by: Jarrett Billingsley <jarrett.billingsley@gmail.com>
Co-authored-by: Jeff Muizelaar <jrmuizel@gmail.com>
Co-authored-by: Jeff Parsons <jeff@parsons.io>
Co-authored-by: Jerboas86 <60667096+Jerboas86@users.noreply.github.com>
Co-authored-by: Jerome Humbert <djeedai@gmail.com>
Co-authored-by: jjl <james.laver@gmail.com>
Co-authored-by: jneem <joeneeman@gmail.com>
Co-authored-by: Joe Neeman <joeneeman@gmail.com>
Co-authored-by: John Kåre Alsaker <john.kare.alsaker@gmail.com>
Co-authored-by: John Skottis <giannis.sc@gmail.com>
Co-authored-by: John Terracina <quantumhobbit@gmail.com>
Co-authored-by: Jonas Platte <jplatte+git@posteo.de>
Co-authored-by: Joshua Wade <joshua_wade@selinc.com>
Co-authored-by: Joshua Wade <SecondFlight@users.noreply.github.com>
Co-authored-by: joshuawade <wadej@southern.edu>
Co-authored-by: Justin Moon <mail@justinmoon.com>
Co-authored-by: Kaiyin Zhong <kindlychung@gmai.com>
Co-authored-by: Kartoffelsaft <39356821+Kartoffelsaft@users.noreply.github.com>
Co-authored-by: Kaur Kuut <strom@nevermore.ee>
Co-authored-by: kbalt <konstantin.baltruschat@gmail.com>
Co-authored-by: keenz <kindlychung@gmail.com>
Co-authored-by: Keith Simmons <keith@the-simmons.net>
Co-authored-by: kud1ing <kud1ing@users.noreply.github.com>
Co-authored-by: Lassi Pulkkinen <lassi.s.pulkkinen@gmail.com>
Co-authored-by: lazypassion <25536767+lazypassion@users.noreply.github.com>
Co-authored-by: Lejero <37251497+Lejero@users.noreply.github.com>
Co-authored-by: Leopold Luley <git@leopoldluley.de>
Co-authored-by: Léo Stefanesco <leo.lveb@gmail.com>
Co-authored-by: Lev Khoroshansky <sololev27@gmail.com>
Co-authored-by: Lisael <lisael@lisael.org>
Co-authored-by: longmathemagician <steve@gibbel.us>
Co-authored-by: lord <lord@users.noreply.github.com>
Co-authored-by: Maan2003 <49202620+Maan2003@users.noreply.github.com>
Co-authored-by: Maan2003 <manmeetmaan2003@gmail.com>
Co-authored-by: Maan2003 <manmeetmann2003@gmail.com>
Co-authored-by: Manmeet Maan <49202620+Maan2003@users.noreply.github.com>
Co-authored-by: Manmeet Maan <manmeetmann2003@gmail.com>
Co-authored-by: Manmeet <manmeetmann2003@gmail.com>
Co-authored-by: Manmeet Singh <manmeetmaan2003@gmail.com>
Co-authored-by: Markus Kohlhase <mail@markus-kohlhase.de>
Co-authored-by: mastfissh <mastfish@gmail.com>
Co-authored-by: Mathias Peters <mathias.peters6@gmail.com>
Co-authored-by: matt rice <ratmice@gmail.com>
Co-authored-by: Maurizio Zucchelli <mauzuc90@yahoo.it>
Co-authored-by: Maximilian Köstler <maximilian@koestler.hamburg>
Co-authored-by: Melanie Riise <me@mriise.net>
Co-authored-by: Mendelt Siebenga <msiebenga@gmail.com>
Co-authored-by: MGlolenstine <MGlolenstine@gmail.com>
Co-authored-by: mobile-bungalow <paul@kalix.io>
Co-authored-by: Moses Miller <majora320@gmail.com>
Co-authored-by: msiglreith <m.siglreith@gmail.com>
Co-authored-by: Nico Burns <nico@nicoburns.com>
Co-authored-by: Nils Martel <nils.martel@graphmasters.net>
Co-authored-by: Nils Martel <nilsmartel@yahoo.de>
Co-authored-by: Ofek Lev <ofekmeister@gmail.com>
Co-authored-by: Olivier FAURE <couteaubleu@gmail.com>
Co-authored-by: Olivier FAURE <CouteauBleu@gmail.com>
Co-authored-by: Paul Miller <futurepaul@pop-os.localdomain>
Co-authored-by: Paul Miller <paul@pauljmiller.com>
Co-authored-by: Pedro Hamms <pedro@vimvest.com>
Co-authored-by: Per Lindgren <per.lindgren@ltu.se>
Co-authored-by: Per <Per Lindgren>
Co-authored-by: Philipp Mildenberger <philipp@mildenberger.me>
Co-authored-by: Points Waves <pointswaves@gmail.com>
Co-authored-by: Psykopear <psykopear@gmail.com>
Co-authored-by: pyroxymat <3037921+pyroxymat@users.noreply.github.com>
Co-authored-by: pyroxymat <pyroxymat@tutanota.com>
Co-authored-by: Raph Levien <raph@google.com>
Co-authored-by: Raph Levien <raph.levien@gmail.com>
Co-authored-by: raphlinus <raph.levien@gmail.com>
Co-authored-by: ratmice <ratmice+github@gmail.com>
Co-authored-by: rhzk <rhzkx@outlook.com>
Co-authored-by: Richard Dodd (dodj) <richard.o.dodd@gmail.com>
Co-authored-by: Richard Dodd <richard.o.dodd@gmail.com>
Co-authored-by: Richard Poole <rp@guests.deus.net>
Co-authored-by: rml <rml@maialouro.pt>
Co-authored-by: Robert Lord <lord@users.noreply.github.com>
Co-authored-by: Robert Wittams <robert@wittams.com>
Co-authored-by: Roman Frołow <rofrol@gmail.com>
Co-authored-by: Roman Zaynetdinov <627197+zaynetro@users.noreply.github.com>
Co-authored-by: Roman Zaynetdinov <roman@zaynetro.com>
Co-authored-by: Rose Hudson <rose@krx.sh>
Co-authored-by: Ross Schulman <ross@rbs.io>
Co-authored-by: Ruslan Kovtun <koutoftimer@gmail.com>
Co-authored-by: Ruslan Prakapchuk <fer.obbee@gmail.com>
Co-authored-by: Ryan Levick <ryan.levick@gmail.com>
Co-authored-by: Ryan Levick <rylev@users.noreply.github.com>
Co-authored-by: sergej jurecko <sergej.jurecko@wpn.tv>
Co-authored-by: Shohei Ueda <30958501+peaceiris@users.noreply.github.com>
Co-authored-by: sigaloid <69441971+sigaloid@users.noreply.github.com>
Co-authored-by: sombrastudios <nils.martel@graphmasters.net>
Co-authored-by: Stanislav Lapata <stanislavlapata@gmail.com>
Co-authored-by: Starfighter <thestarfightlp@gmail.com>
Co-authored-by: Steven Malis <smmalis37@gmail.com>
Co-authored-by: Steven <smmalis37@gmail.com>
Co-authored-by: Steven Van Bael <steven@quantus.io>
Co-authored-by: Sujit Joshi <joshi.sujit020386@gmail.com>
Co-authored-by: tay64 <tay64.mx+gh@gmail.com>
Co-authored-by: Ted de Munnik <ta.demunnik@gmail.com>
Co-authored-by: thecodewarrior <code@thecodewarrior.dev>
Co-authored-by: Thierry Arnoux <thierry.arnoux@gmx.net>
Co-authored-by: Thorbjørn Lindeijer <bjorn@lindeijer.nl>
Co-authored-by: Tim Schumacher <tim@tschumacher.net>
Co-authored-by: tirix <thierry.arnoux@gmx.net>
Co-authored-by: Tomasz Duda <tomasz.m.duda@gmail.com>
Co-authored-by: Tom Churchman <thomas@kepow.org>
Co-authored-by: totsteps <6944095+totsteps@users.noreply.github.com>
Co-authored-by: totsteps <totsteps.gs@gmail.com>
Co-authored-by: Trent <2771466+tbillington@users.noreply.github.com>
Co-authored-by: Uli Schlachter <psychon@users.noreply.github.com>
Co-authored-by: Uli Schlachter <psychon@znc.in>
Co-authored-by: Valentin Kahl <git@valentin-kahl.de>
Co-authored-by: vishalsodani <vishalsodani@rediffmail.com>
Co-authored-by: Vishal Sodani <vishalsodani@rediffmail.com>
Co-authored-by: Walther Chen <hwchen@users.noreply.github.com>
Co-authored-by: WeetHet <43210583+WeetHet@users.noreply.github.com>
Co-authored-by: WeetHet <stas.ale66@gmail.com>
Co-authored-by: Wicher Heldring <wicher.heldring@gmail.com>
Co-authored-by: xarvic <xarvic@web.de>
Co-authored-by: xarvic <xarvix@web.de>
Co-authored-by: Zarenor Darkstalker <zarenor@gmail.com>
Co-authored-by: Zoxc <john.kare.alsaker@gmail.com>
Co-authored-by: Zoxc <zoxc32@gmail.com>
2024-04-22 10:41:35 +01:00
Philipp Mildenberger 9a118da687
xilem_web: Support arrays (`impl IntoClasses for [impl IntoClasses; N]`) as classes (#198)
Support arrays (`impl IntoClasses for [impl IntoClasses; N]`) as classes
2024-04-16 15:00:54 +00:00
Bruce Mitchener 8b2949831e
[deps] Use release of peniko. (#200)
This also lets us stop building a separate version of kurbo for
xilem_web.
2024-04-15 02:45:25 +00:00
Philipp Mildenberger 50c16e3b3f
xilem_web: Allow `style` only on `HtmlElement` and `SvgElement` (#195) 2024-04-01 11:04:15 +00:00
Richard Dodd (dodj) 74bc6fcee8
add class and style interfaces (#193)
* add class interface

* add style interface

* remove parse style/class logic, and panic instead (in dev)

* combine attributes, styles, classes into single struct

* make `class` and `style` methods polymorphic

* fix clippy

* Update Cargo.toml

Co-authored-by: Philipp Mildenberger <philipp@mildenberger.me>

* Update crates/xilem_web/src/context.rs

Co-authored-by: Philipp Mildenberger <philipp@mildenberger.me>

* Update crates/xilem_web/src/context.rs

Co-authored-by: Philipp Mildenberger <philipp@mildenberger.me>

* Update crates/xilem_web/src/class.rs

Co-authored-by: Philipp Mildenberger <philipp@mildenberger.me>

---------

Co-authored-by: Philipp Mildenberger <philipp@mildenberger.me>
2024-03-31 22:15:32 +00:00
Philipp Mildenberger 50d51fad01
Fix peek in `VecSplice` (#187)
* Fix peek in `VecSplice`

* Rename `peek(_mut)` to `last_mutated(_mut)` in `VecSplice` and fixed index access
2024-03-11 10:24:48 +00:00
Bruce Mitchener fbe553f9de
clippy: Configure via `lints` table in `Cargo.toml` (#185)
As of Rust 1.74, lints can be configured within the `Cargo.toml`
which allows us to not have to configure them in the source code
as well as simplifying having a single configuration across an
entire workspace.

This is documented at: https://doc.rust-lang.org/nightly/cargo/reference/manifest.html#the-lints-section
2024-03-09 16:26:02 +00:00
Bruce Mitchener a0db0a4a61
clippy: Fix semicolon_if_nothing_returned lints. (#184) 2024-03-09 15:33:30 +00:00
Philipp Mildenberger 277160b484
Add fine-grained tree-structure tracking in `xilem` and effcient tree-updates in `xilem_web` (#160)
* Generalize `VecSplice` that is used in the ViewSequences as `ElementsSplice` trait and optimized tree-structure diffing in `xilem_web` with it

* Implement tree-structure tracking

* Moved tree-structure tracking into view and added tests and comments

* Deleted bloom filter

* Refactor tree structure tracking using methods like `Cx::with_pod`

* Add doc comments describing situations where the tree-structure will panic

* Deleted bloom filter (again whoops)

* Add doc comments for panic situations
2024-02-27 12:06:03 +00:00
Philipp Mildenberger ea45b9f8c1
Merge `xilem_html` and `xilem_svg` as `xilem_web` (#142)
* Merged xilem_svg into xilem_html

* Renamed xilem_html to xilem_web and removed xilem_svg

* xilem_web: factor pointer to root, as it can be used for all Elements and refactor slightly

* Rename example

* xilem_web: Make BoxedView public

* Rename cx.add_new_attribute_to_current_element -> add_attr_to_element and IntoAttributeValue::into_attribute_value -> IntoAttributeValue::into_attr_value

* Add the `fill` and `stroke` attribute to the `g` element
2024-01-04 16:17:13 +00:00
Philipp Mildenberger f643dc491b
xilem_html: Add more text views (support numbers directly as view) (#154) 2023-11-28 13:29:52 +00:00
Philipp Mildenberger 5b3de313c7
xilem_html: Add MathML and SVG elements/DOM interface traits (#153)
* Added all MathML elements

* xilem_html: Add all SVG elements and DOM interfaces, and an example using MathML and raw SVG

* Cargo fmt

* xilem_html: Reduce boilerplate in elements, by adding a new macro match arm

* xilem_html mathml_svg example: Remove unnecessary stuff in index.html

* xilem_html: Use `mod`s for each element namespace (html, mathml, svg)
2023-11-28 13:28:18 +00:00
Philipp Mildenberger d40a94fa8a
xilem_html: Significant refactor and introduce DOM interface traits (#141)
* xilem_html: Introduce DOM interface traits to make per DOM element typing possible and flexible

* Cleanup a little bit (remove artifacts from refactor)

* Use separate sealed interfaces to avoid blanket trait impl collisions

* Add generic params T and A to event views and Attr via PhantomData, to avoid inference issues with composed types

* xilem_html: Refactor DOM interface macros

* Add ancestor *and* descendent composable macros
* Added a macro to correctly and conveniently implement dom interfaces for interface restricted Views, this is used currently for the Attr view and the event views

* xilem_html: Add namespace to element generation and refactor element/attribute logic into separate functions

* xilem_html: Remove unnecessary features

* xilem_html: Implement DOM interface traits for Adapt and AdaptState

* xilem_html: Refactor OneOf views
* Eliminate associated trait bound for the View, for easier use
* Add additional OneSeqOf view sequences, to avoid removing the ViewMarker super trait bound on Element
* implement all dom interfaces for the OneOf views

* xilem_html: Reorder generic type parameters in composing views such as `Attr`
2023-11-23 16:25:42 +00:00
Raph Levien 71d1db04dc
Dust off xilem_svg (#139)
* Make xilem_svg into a library

Instead of having the demo app hardcoded, make it a library with a web_examples folder, just like its xilem_html sibling. This patch doesn't change the example or any functionality.

* Migrate KurboShape to ViewExt

Exports a `ViewExt` trait, and wires up types so that type inference can flow through the methods on this trait. That removes the hacky `KurboShape` workaround.

* clippy

* Add fill and stroke

Supports very basic fill and stroke (solid colors, stroke width but no other style parameters).

* rustfmt

* Address review feedback

Fix some cut'n'paste errors, and update README slightly.
2023-11-05 17:26:39 +00:00
Philipp Mildenberger 0a11232b9d
xilem_html: Fix DOM element table web_sys type (#136) 2023-09-21 15:12:10 +00:00
Kaur Kuut 3465ddefaa
Migrate to the generic Linebender CI script. (#135) 2023-09-12 17:50:50 +03:00
Philipp Mildenberger e6255931f7
xilem_html: minor improvement in Element::remove_attr (use `&str` instead of `Into<CowStr`) (#129) 2023-08-16 17:55:18 +02:00
Philipp Mildenberger 09271e7beb
xilem_html: Add support for different types in `el.attr("attr", <value>)` (#127)
Where `<value>` can be primitive values like numbers, booleans and strings, and options of these values.
In case a `None` or `false` value is passed, the attribute is removed from the element, as even an empty string value for an attribute evaluates to `true` in javascript (relevant for e.g. `input.attr("checked", false)`).
This is achieved via an enum that serializes to a string and syntax sugar via an extra trait `IntoAttributeValue` which converts a (currently) primitive value into this enum when passing it to the method.
This also adds an additional method `el.remove_attr(name)`.
2023-08-16 17:35:15 +02:00
Philipp Mildenberger 5600017d4a
xilem_html: Add an (ordered) `VecMap` for small `n` (#125)
A few benchmarks have shown, that for small n (roughly `n < ~20`, with small types < 50 bytes) a Vec is faster than a BTreeMap.
This seems to be the average case for html attributes.

Since it was a low hanging fruit to boldly copy the docs from the `std::collections::BTreeMap`, I have done so, it also implicitly adds doc tests for this

The `VecMap` is now used instead of the `BTreeMap` for the element attributes
2023-08-15 20:03:29 +02:00
Philipp Mildenberger f1a11ac3c7
xilem_html: Add a `DiffMapIterator` that computes a diff between two ordered maps (#124)
It is used in the diffing of HTML elements in View::rebuild

Co-authored-by: Richard Dodd (dodj) <richard.o.dodd@gmail.com>
2023-08-10 21:23:44 +02:00
Kaur Kuut 1ecaafe33c
Fill out and clean up all the `Cargo.toml` files. (#117) 2023-07-30 21:14:59 +03:00
Philipp Mildenberger 312687c083
xilem_core: Remove redundant macro match arm in message macro (#113) 2023-07-28 19:05:55 +02:00
Jonas Platte 065759f1a6 xilem_html: Remove old comment 2023-07-27 19:45:12 +02:00
Jonas Platte b184b30c44 xilem_html: Rename Either types to OneOfN 2023-07-27 19:45:12 +02:00
Jonas Platte 7a0fab9f00 xilem_html: Add Either3..=Either8 2023-07-27 19:45:12 +02:00
Jonas Platte 3c46ada75c xilem_html: Rename Either variants from Left, Right to A, B 2023-07-27 19:45:12 +02:00
Jonas Platte 55b4f31a48 xilem_html: Move Either into its own module 2023-07-27 19:45:12 +02:00
Philipp Mildenberger 4409fbb8df
Merge pull request #111 from Philipp-M/memoize-adapt-configurable-trait-bounds
Make function trait-bounds of the `Memoize`, `Adapt` and `AdaptState` views configurable (mostly to mirror the `View` trait bounds)
2023-07-24 12:34:33 +02:00
Jonas Platte c93b38e9f2
xilem_html: Re-export memoize, s functions from crate root 2023-07-23 18:06:06 +02:00
Philipp Mildenberger 39f5a9ffbe
Make function trait-bounds of the `Memoize`, `Adapt` and `AdaptState` views configurable (mostly to mirror the `View` trait bounds) 2023-07-23 13:53:01 +02:00
Jonas Platte 870544eedd xilem_html: Re-export Memoize from crate root 2023-07-23 13:01:13 +02:00
Jonas Platte 6525ea16f3 xilem_core: Move bounds to where clauses in macros
More readable in documentation, and improves rustfmt's output.
2023-07-23 13:00:30 +02:00
Jonas Platte e085ba5a36 xilem_html: Add ViewExt::adapt_state 2023-07-21 08:03:39 +02:00
Jonas Platte 4cdc102bc8 xilem_html: Add ViewExt::adapt 2023-07-21 08:03:39 +02:00
Jonas Platte cbc017e35d xilem_html: Simplify ViewExt implementation 2023-07-21 08:03:39 +02:00
Jonas Platte 38ee7c4923 Use non-passive input event handlers in todomvc 2023-07-18 18:51:02 +02:00
Jonas Platte d929001a8e xilem_html: Add support for non-passive event handlers 2023-07-18 18:51:02 +02:00
Jonas Platte 810d254122 Add default for generic parameter F of Adapt
This allows spelling out the Adapt type easily if F is a regular
function or closure that does not capture.
2023-07-17 19:11:52 +02:00
Jonas Platte 4a94174f1a Update order of generic parameters on Adapt 2023-07-17 19:11:52 +02:00
Jonas Platte 2b86d1d751
Add AdaptState view
Co-authored-by: Philipp Mildenberger <philipp@mildenberger.me>
2023-07-17 18:37:20 +02:00
Bruce Mitchener a2e0089f6f deps: Update bitflags from 1.x to most recent 2.x. 2023-07-14 00:26:58 +07:00
Bruce Mitchener a4b0c7cfd8
Merge pull request #92 from waywardmonkeys/missing-licensing-markers
xilem, xilem_core: State the license in Cargo.toml.
2023-07-13 11:45:44 +07:00
Bruce Mitchener 15a981bf55 xilem, xilem_core: State the license in Cargo.toml. 2023-07-12 23:58:33 +07:00
Bruce Mitchener 01b5fdca2a cargo fmt. 2023-07-12 23:50:35 +07:00
Richard Dodd (dodj) bfa78fd850
Merge pull request #88 from Philipp-M/remove-clone-in-memoize-view
Remove Clone trait bound in Memoize view
2023-07-12 15:02:21 +01:00
Richard Dodd 7361c59db3 Merge remote-tracking branch 'origin/main' into more_todomvc 2023-07-12 10:22:36 +01:00